Files
houyi-admin/dist/5855.e5ec8524.async.js
PC-202306242200\Administrator 23dc139a31 first commit
2026-03-28 23:25:01 +08:00

7898 lines
3.2 MiB

var JD=Object.defineProperty,QD=Object.defineProperties;var eO=Object.getOwnPropertyDescriptors;var qS=Object.getOwnPropertySymbols;var tO=Object.prototype.hasOwnProperty,rO=Object.prototype.propertyIsEnumerable;var bp=Math.pow,YS=(Zr,_r,Se)=>_r in Zr?JD(Zr,_r,{enumerable:!0,configurable:!0,writable:!0,value:Se}):Zr[_r]=Se,$S=(Zr,_r)=>{for(var Se in _r||(_r={}))tO.call(_r,Se)&&YS(Zr,Se,_r[Se]);if(qS)for(var Se of qS(_r))rO.call(_r,Se)&&YS(Zr,Se,_r[Se]);return Zr},KS=(Zr,_r)=>QD(Zr,eO(_r));var oE=(Zr,_r,Se)=>new Promise((ve,Ze)=>{var M=be=>{try{de(Se.next(be))}catch(Le){Ze(Le)}},R=be=>{try{de(Se.throw(be))}catch(Le){Ze(Le)}},de=be=>be.done?ve(be.value):Promise.resolve(be.value).then(M,R);de((Se=Se.apply(Zr,_r)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[5855],{41978:function(Zr){"use strict";(function(_r,Se){Zr.exports=Se()})(this,function(){function _r(Re){var Ce=[];return Re.AMapUI&&Ce.push(Se(Re.AMapUI)),Re.Loca&&Ce.push(ve(Re.Loca)),Promise.all(Ce)}function Se(Re){return new Promise(function(Ce,He){var Xe=[];if(Re.plugins)for(var Ke=0;Ke<Re.plugins.length;Ke+=1)M.AMapUI.plugins.indexOf(Re.plugins[Ke])==-1&&Xe.push(Re.plugins[Ke]);if(R.AMapUI===Ze.failed)He("\u524D\u6B21\u8BF7\u6C42 AMapUI \u5931\u8D25");else if(R.AMapUI===Ze.notload){R.AMapUI=Ze.loading,M.AMapUI.version=Re.version||M.AMapUI.version,Ke=M.AMapUI.version;var Ve=document.body||document.head,et=document.createElement("script");et.type="text/javascript",et.src="https://webapi.amap.com/ui/"+Ke+"/main.js",et.onerror=function(er){R.AMapUI=Ze.failed,He("\u8BF7\u6C42 AMapUI \u5931\u8D25")},et.onload=function(){if(R.AMapUI=Ze.loaded,Xe.length)window.AMapUI.loadUI(Xe,function(){for(var er=0,fr=Xe.length;er<fr;er++){var Ar=Xe[er].split("/").slice(-1)[0];window.AMapUI[Ar]=arguments[er]}for(Ce();de.AMapUI.length;)de.AMapUI.splice(0,1)[0]()});else for(Ce();de.AMapUI.length;)de.AMapUI.splice(0,1)[0]()},Ve.appendChild(et)}else R.AMapUI===Ze.loaded?Re.version&&Re.version!==M.AMapUI.version?He("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C AMapUI \u6DF7\u7528"):Xe.length?window.AMapUI.loadUI(Xe,function(){for(var er=0,fr=Xe.length;er<fr;er++){var Ar=Xe[er].split("/").slice(-1)[0];window.AMapUI[Ar]=arguments[er]}Ce()}):Ce():Re.version&&Re.version!==M.AMapUI.version?He("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C AMapUI \u6DF7\u7528"):de.AMapUI.push(function(er){er?He(er):Xe.length?window.AMapUI.loadUI(Xe,function(){for(var fr=0,Ar=Xe.length;fr<Ar;fr++){var pn=Xe[fr].split("/").slice(-1)[0];window.AMapUI[pn]=arguments[fr]}Ce()}):Ce()})})}function ve(Re){return new Promise(function(Ce,He){if(R.Loca===Ze.failed)He("\u524D\u6B21\u8BF7\u6C42 Loca \u5931\u8D25");else if(R.Loca===Ze.notload){R.Loca=Ze.loading,M.Loca.version=Re.version||M.Loca.version;var Xe=M.Loca.version,Ke=M.AMap.version.startsWith("2"),Ve=Xe.startsWith("2");if(Ke&&!Ve||!Ke&&Ve)He("JSAPI \u4E0E Loca \u7248\u672C\u4E0D\u5BF9\u5E94\uFF01\uFF01");else{Ke=M.key,Ve=document.body||document.head;var et=document.createElement("script");et.type="text/javascript",et.src="https://webapi.amap.com/loca?v="+Xe+"&key="+Ke,et.onerror=function(er){R.Loca=Ze.failed,He("\u8BF7\u6C42 AMapUI \u5931\u8D25")},et.onload=function(){for(R.Loca=Ze.loaded,Ce();de.Loca.length;)de.Loca.splice(0,1)[0]()},Ve.appendChild(et)}}else R.Loca===Ze.loaded?Re.version&&Re.version!==M.Loca.version?He("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C Loca \u6DF7\u7528"):Ce():Re.version&&Re.version!==M.Loca.version?He("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C Loca \u6DF7\u7528"):de.Loca.push(function(er){er?He(er):He()})})}if(!window)throw Error("AMap JSAPI can only be used in Browser.");var Ze;(function(Re){Re.notload="notload",Re.loading="loading",Re.loaded="loaded",Re.failed="failed"})(Ze||(Ze={}));var M={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},R={AMap:Ze.notload,AMapUI:Ze.notload,Loca:Ze.notload},de={AMap:[],AMapUI:[],Loca:[]},be=[],Le=function(Re){typeof Re=="function"&&(R.AMap===Ze.loaded?Re(window.AMap):be.push(Re))};return{load:function(Re){return new Promise(function(Ce,He){if(R.AMap==Ze.failed)He("");else if(R.AMap==Ze.notload){var Xe=Re.key,Ke=Re.version,Ve=Re.plugins;Xe?(window.AMap&&location.host!=="lbs.amap.com"&&He("\u7981\u6B62\u591A\u79CDAPI\u52A0\u8F7D\u65B9\u5F0F\u6DF7\u7528"),M.key=Xe,M.AMap.version=Ke||M.AMap.version,M.AMap.plugins=Ve||M.AMap.plugins,R.AMap=Ze.loading,Ke=document.body||document.head,window.___onAPILoaded=function(er){if(delete window.___onAPILoaded,er)R.AMap=Ze.failed,He(er);else for(R.AMap=Ze.loaded,_r(Re).then(function(){Ce(window.AMap)}).catch(He);be.length;)be.splice(0,1)[0]()},Ve=document.createElement("script"),Ve.type="text/javascript",Ve.src="https://webapi.amap.com/maps?callback=___onAPILoaded&v="+M.AMap.version+"&key="+Xe+"&plugin="+M.AMap.plugins.join(","),Ve.onerror=function(er){R.AMap=Ze.failed,He(er)},Ke.appendChild(Ve)):He("\u8BF7\u586B\u5199key")}else if(R.AMap==Ze.loaded)if(Re.key&&Re.key!==M.key)He("\u591A\u4E2A\u4E0D\u4E00\u81F4\u7684 key");else if(Re.version&&Re.version!==M.AMap.version)He("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C JSAPI \u6DF7\u7528");else{if(Xe=[],Re.plugins)for(Ke=0;Ke<Re.plugins.length;Ke+=1)M.AMap.plugins.indexOf(Re.plugins[Ke])==-1&&Xe.push(Re.plugins[Ke]);Xe.length?window.AMap.plugin(Xe,function(){_r(Re).then(function(){Ce(window.AMap)}).catch(He)}):_r(Re).then(function(){Ce(window.AMap)}).catch(He)}else if(Re.key&&Re.key!==M.key)He("\u591A\u4E2A\u4E0D\u4E00\u81F4\u7684 key");else if(Re.version&&Re.version!==M.AMap.version)He("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C JSAPI \u6DF7\u7528");else{var et=[];if(Re.plugins)for(Ke=0;Ke<Re.plugins.length;Ke+=1)M.AMap.plugins.indexOf(Re.plugins[Ke])==-1&&et.push(Re.plugins[Ke]);Le(function(){et.length?window.AMap.plugin(et,function(){_r(Re).then(function(){Ce(window.AMap)}).catch(He)}):_r(Re).then(function(){Ce(window.AMap)}).catch(He)})}})},reset:function(){delete window.AMap,delete window.AMapUI,delete window.Loca,M={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},R={AMap:Ze.notload,AMapUI:Ze.notload,Loca:Ze.notload},de={AMap:[],AMapUI:[],Loca:[]}}}})},61227:function(){window._iconfont_svg_string_3580659='<svg><symbol id="l7-icon-area1" viewBox="0 0 1024 1024"><path d="M796.444444 56.888889a113.777778 113.777778 0 0 1 43.064889 219.136l38.798223 466.261333a113.777778 113.777778 0 1 1-133.518223 145.237334H279.210667a113.777778 113.777778 0 1 1-60.302223-137.272889L697.856 227.555556A113.777778 113.777778 0 0 1 796.444444 56.888889z m56.888889 750.933333a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m-682.666666 0a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m577.592889-534.072889L269.198222 796.444444c4.152889 7.168 7.509333 14.791111 10.012445 22.812445h465.578666a114.119111 114.119111 0 0 1 65.479111-71.224889l-38.798222-466.261333a112.924444 112.924444 0 0 1-23.210666-7.964445zM796.444444 125.155556a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-area" viewBox="0 0 1024 1024"><path d="M796.444444 56.888889a113.777778 113.777778 0 0 1 43.008 219.136l38.855112 466.261333a113.777778 113.777778 0 0 1-16.497778 224.540445L853.333333 967.111111a113.777778 113.777778 0 0 1-108.544-79.644444H279.210667a113.834667 113.834667 0 0 1-100.067556 79.36L170.666667 967.111111a113.777778 113.777778 0 0 1-17.066667-226.304l30.492444-351.175111a113.777778 113.777778 0 0 1 34.986667-218.680889L227.555556 170.666667a113.777778 113.777778 0 0 1 99.896888 59.221333l355.84-71.395556a113.777778 113.777778 0 0 1 104.675556-101.262222L796.444444 56.888889z m56.888889 750.933333a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m-682.666666 0a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m526.051555-582.314666L340.650667 296.903111a113.891556 113.891556 0 0 1-88.462223 98.645333l-30.947555 355.84c27.477333 13.653333 48.64 38.115556 58.026667 67.754667h465.521777a114.119111 114.119111 0 0 1 65.536-71.168l-38.855111-466.261333a113.948444 113.948444 0 0 1-74.752-56.206222zM227.555556 238.933333a45.511111 45.511111 0 1 0 0 91.022223 45.511111 45.511111 0 0 0 0-91.022223z m568.888888-113.777777a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-delete" viewBox="0 0 1024 1024"><path d="M705.422222 85.333333a34.133333 34.133333 0 0 1 34.133334 34.133334V227.555556h136.533333a34.133333 34.133333 0 0 1 0 68.266666h-25.543111l-24.348445 610.076445a34.133333 34.133333 0 0 1-34.133333 32.768H231.936a34.133333 34.133333 0 0 1-34.076444-32.768L173.340444 295.822222H147.911111a34.133333 34.133333 0 1 1 0-68.266666H284.444444V119.466667a34.133333 34.133333 0 0 1 34.133334-34.133334h386.844444zM241.720889 295.822222l22.983111 574.577778h494.535111l23.04-574.577778H241.720889zM671.288889 153.6H352.711111V227.555556h318.577778V153.6z" ></path></symbol><symbol id="l7-icon-color" viewBox="0 0 1024 1024"><path d="M512 56.888889c9.841778 0 19.626667 0.341333 29.354667 0.910222 69.176889 4.437333 119.068444 62.577778 124.302222 131.072l0.455111 9.386667c0.739556 44.600889 15.303111 84.935111 44.999111 114.631111 27.022222 27.022222 62.805333 41.528889 102.570667 44.430222l12.060444 0.568889c72.476444 1.194667 135.793778 52.451556 140.458667 124.757333 1.137778 18.261333 1.251556 36.807111 0.170667 55.637334-13.198222 233.585778-211.399111 424.220444-445.326223 428.714666L512 967.111111a455.111111 455.111111 0 0 1-455.054222-464.156444c4.551111-233.927111 195.185778-432.128 428.771555-445.326223C494.535111 57.116444 503.296 56.888889 512 56.888889z m0 68.266667a385.706667 385.706667 0 0 0-22.414222 0.625777C291.726222 136.988444 129.080889 305.948444 125.155556 504.263111c-4.152889 212.366222 163.100444 387.185778 372.508444 394.353778l13.425778 0.227555 8.533333-0.113777c198.371556-3.811556 367.331556-166.456889 378.538667-364.373334a396.174222 396.174222 0 0 0-0.170667-47.331555c-1.991111-31.232-29.127111-56.604444-67.128889-60.472889l-8.248889-0.455111-14.051555-0.682667c-56.547556-4.209778-107.406222-25.884444-145.806222-64.284444-38.855111-38.798222-60.416-90.225778-64.284445-145.749334l-0.910222-21.333333c-2.901333-38.001778-28.785778-66.048-60.302222-68.096A433.891556 433.891556 0 0 0 512 125.155556zM438.044444 682.666667a68.266667 68.266667 0 1 1 0 136.533333 68.266667 68.266667 0 0 1 0-136.533333z m-170.666666-227.555556a68.266667 68.266667 0 1 1 0 136.533333 68.266667 68.266667 0 0 1 0-136.533333z m142.222222-227.555555a68.266667 68.266667 0 1 1 0 136.533333 68.266667 68.266667 0 0 1 0-136.533333z" ></path></symbol><symbol id="l7-icon-base-map" viewBox="0 0 1024 1024"><path d="M923.761778 115.029333A34.133333 34.133333 0 0 1 967.111111 147.911111v624.128a34.133333 34.133333 0 0 1-22.186667 32.028445l-278.755555 103.992888a34.133333 34.133333 0 0 1-23.665778 0.056889L381.724444 812.714667a34.133333 34.133333 0 0 0-23.665777 0.113777L102.968889 908.060444a34.133333 34.133333 0 0 1-45.738667-26.965333L56.888889 876.088889V251.960889a34.133333 34.133333 0 0 1 22.186667-32.028445l278.755555-103.992888a34.133333 34.133333 0 0 1 20.992-0.967112l266.183111 72.988445a34.133333 34.133333 0 0 0 18.204445 0zM403.911111 192.625778v555.576889l216.177778 79.075555V251.960889l-216.177778-59.335111z m-68.266667 4.380444L125.155556 275.569778v551.310222l210.432-78.506667V197.006222zM898.844444 192.853333l-210.545777 58.936889v575.089778l210.545777-78.563556V192.853333z" ></path></symbol><symbol id="l7-icon-dot" viewBox="0 0 1024 1024"><path d="M341.333333 739.555556a113.777778 113.777778 0 0 1 8.533334 227.271111L341.333333 967.111111a113.777778 113.777778 0 0 1-8.533333-227.271111L341.333333 739.555556z m0 68.266666a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222zM910.222222 341.333333a113.777778 113.777778 0 0 1 8.533334 227.271111L910.222222 568.888889a113.777778 113.777778 0 0 1-8.533333-227.271111L910.222222 341.333333z m0 68.266667a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222zM227.555556 56.888889a113.777778 113.777778 0 0 1 8.533333 227.271111L227.555556 284.444444a113.777778 113.777778 0 0 1-8.533334-227.271111L227.555556 56.888889z m0 68.266667a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-display" viewBox="0 0 1024 1024"><path d="M512 170.666667c284.444444 0 455.111111 227.555556 455.111111 341.333333s-170.666667 341.333333-455.111111 341.333333-455.111111-227.555556-455.111111-341.333333 170.666667-341.333333 455.111111-341.333333z m0 68.266666C303.729778 238.933333 125.155556 401.237333 125.155556 512c0 110.762667 178.574222 273.066667 386.844444 273.066667s386.844444-162.304 386.844444-273.066667c0-110.762667-178.574222-273.066667-386.844444-273.066667zM512 341.333333a170.666667 170.666667 0 1 1 0 341.333334 170.666667 170.666667 0 0 1 0-341.333334z m0 68.266667a102.4 102.4 0 1 0 0 204.8 102.4 102.4 0 0 0 0-204.8z" ></path></symbol><symbol id="l7-icon-enlarge" viewBox="0 0 1024 1024"><path d="M546.133333 147.911111l-0.056889 329.955556H876.088889a34.133333 34.133333 0 0 1 0 68.266666H546.076444v329.955556a34.133333 34.133333 0 0 1-68.266666 0V546.133333H147.911111a34.133333 34.133333 0 1 1 0-68.266666h329.898667V147.911111a34.133333 34.133333 0 0 1 68.266666 0z" ></path></symbol><symbol id="l7-icon-export-picture" viewBox="0 0 1024 1024"><path d="M883.873684 161.684211a32.336842 32.336842 0 0 1 32.336842 32.336842v582.063158a32.336842 32.336842 0 0 1-32.336842 32.336842H86.231579a32.336842 32.336842 0 0 1-32.336842-32.336842V194.021053a32.336842 32.336842 0 0 1 32.336842-32.336842h797.642105z m-32.336842 64.673684H118.568421v517.389473h170.792421a32.175158 32.175158 0 0 1 0.431158-0.646736l3.772632-4.473264 330.320842-330.374736a32.336842 32.336842 0 0 1 38.588631-5.389474l4.473263 3.018105 184.589474 147.725474V226.357895z m-202.428631 248.131368L379.850105 743.747368H851.536842v-107.304421l-202.428631-161.953684zM323.368421 323.368421a107.789474 107.789474 0 1 1 0 215.578947 107.789474 107.789474 0 0 1 0-215.578947z m0 64.673684a43.115789 43.115789 0 1 0 0 86.231579 43.115789 43.115789 0 0 0 0-86.231579z" ></path></symbol><symbol id="l7-icon-exit-fullscreen" viewBox="0 0 1024 1024"><path d="M841.955556 591.644444a34.133333 34.133333 0 0 1 5.518222 67.811556l-5.518222 0.455111h-133.745778l192 192.056889a34.133333 34.133333 0 0 1-38.343111 55.182222l-5.176889-2.958222-4.721778-3.982222L659.911111 708.266667V841.955556a34.133333 34.133333 0 0 1-28.615111 33.678222L625.777778 876.088889a34.133333 34.133333 0 0 1-33.678222-28.615111L591.644444 841.955556V625.777778a34.133333 34.133333 0 0 1 28.615112-33.678222L625.777778 591.644444h216.177778z m-443.733334 0a34.133333 34.133333 0 0 1 33.678222 28.615112L432.355556 625.777778v216.177778a34.133333 34.133333 0 0 1-67.811556 5.518222L364.088889 841.955556v-133.745778l-192.056889 192a34.133333 34.133333 0 0 1-52.224-43.52l3.982222-4.721778L315.847111 659.911111H182.044444a34.133333 34.133333 0 0 1-33.678222-28.615111L147.911111 625.777778a34.133333 34.133333 0 0 1 28.615111-33.678222L182.044444 591.644444H398.222222zM167.310222 119.808l4.721778 3.982222L364.088889 315.847111V182.044444a34.133333 34.133333 0 0 1 28.615111-33.678222L398.222222 147.911111a34.133333 34.133333 0 0 1 33.678222 28.615111L432.355556 182.044444V398.222222a34.133333 34.133333 0 0 1-28.615112 33.678222L398.222222 432.355556H182.044444a34.133333 34.133333 0 0 1-5.518222-67.811556L182.044444 364.088889h133.802667L123.790222 172.032a34.133333 34.133333 0 0 1 43.52-52.224z m732.899556 3.982222a34.133333 34.133333 0 0 1 3.982222 43.52l-3.982222 4.721778L708.266667 364.088889H841.955556a34.133333 34.133333 0 0 1 33.678222 28.615111L876.088889 398.222222a34.133333 34.133333 0 0 1-28.615111 33.678222L841.955556 432.355556H625.777778a34.133333 34.133333 0 0 1-33.678222-28.615112L591.644444 398.222222V182.044444a34.133333 34.133333 0 0 1 67.811556-5.518222l0.455111 5.518222v133.802667l192.056889-192.056889a34.133333 34.133333 0 0 1 48.241778 0z" ></path></symbol><symbol id="l7-icon-line" viewBox="0 0 1024 1024"><path d="M853.333333 56.888889a113.777778 113.777778 0 0 1 8.533334 227.271111L853.333333 284.444444c-19.000889 0-36.864-4.664889-52.622222-12.856888l-529.123555 529.066666a113.777778 113.777778 0 0 1-92.387556 166.115556L170.666667 967.111111a113.777778 113.777778 0 0 1-8.533334-227.271111L170.666667 739.555556c19.000889 0 36.864 4.664889 52.622222 12.856888l529.123555-529.066666a113.777778 113.777778 0 0 1 92.387556-166.115556L853.333333 56.888889zM170.666667 807.822222a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m682.666666-682.666666a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-layer" viewBox="0 0 1024 1024"><path d="M767.089778 625.777778l180.167111 82.773333a34.133333 34.133333 0 0 1 4.892444 59.278222l-4.892444 2.730667-420.977778 193.422222a34.133333 34.133333 0 0 1-22.983111 1.991111l-5.575111-1.991111-420.977778-193.422222a34.133333 34.133333 0 0 1-4.892444-59.278222l4.892444-2.730667L256.853333 625.777778l81.749334 37.546666L172.771556 739.555556 512 895.374222 851.171556 739.555556l-165.831112-76.231112 81.749334-37.546666z m0-227.555556l180.167111 82.773334a34.133333 34.133333 0 0 1 4.892444 59.278222l-4.892444 2.730666-420.977778 193.422223a34.133333 34.133333 0 0 1-22.983111 1.991111l-5.575111-1.991111-420.977778-193.422223a34.133333 34.133333 0 0 1-4.892444-59.278222l4.892444-2.730666L256.853333 398.222222l81.749334 37.546667-165.831111 76.174222L512 667.818667l339.171556-155.875556-165.831112-76.174222L767.089778 398.222222zM497.720889 60.017778a34.133333 34.133333 0 0 1 28.558222 0l420.977778 193.422222a34.133333 34.133333 0 0 1 0 62.008889l-420.977778 193.422222a34.133333 34.133333 0 0 1-28.558222 0l-420.977778-193.422222a34.133333 34.133333 0 0 1 0-62.008889zM512 128.568889L172.771556 284.387556 512 440.263111l339.171556-155.875555L512 128.568889z" ></path></symbol><symbol id="l7-icon-narrow" viewBox="0 0 1024 1024"><path d="M910.222222 512a34.133333 34.133333 0 0 1-34.133333 34.133333H147.911111a34.133333 34.133333 0 1 1 0-68.266666h728.177778a34.133333 34.133333 0 0 1 34.133333 34.133333z" ></path></symbol><symbol id="l7-icon-fullscreen" viewBox="0 0 1024 1024"><path d="M645.176889 597.674667l4.721778 3.982222L841.955556 793.6l0.056888-133.688889a34.133333 34.133333 0 0 1 28.615112-33.678222L876.088889 625.777778a34.133333 34.133333 0 0 1 33.678222 28.615111L910.222222 659.911111v216.177778a34.133333 34.133333 0 0 1-28.615111 33.678222L876.088889 910.222222h-216.177778a34.133333 34.133333 0 0 1-5.518222-67.811555l5.518222-0.455111h133.745778l-192-192.056889a34.133333 34.133333 0 0 1 43.52-52.224z m-222.833778 3.982222a34.133333 34.133333 0 0 1 3.982222 43.52l-3.982222 4.721778L230.286222 841.955556H364.088889a34.133333 34.133333 0 0 1 33.678222 28.615111L398.222222 876.088889a34.133333 34.133333 0 0 1-28.615111 33.678222L364.088889 910.222222H147.911111a34.133333 34.133333 0 0 1-33.678222-28.615111L113.777778 876.088889v-216.177778a34.133333 34.133333 0 0 1 67.811555-5.518222l0.455111 5.518222-0.056888 133.745778 192.113777-192a34.133333 34.133333 0 0 1 48.241778 0zM364.088889 113.777778a34.133333 34.133333 0 0 1 5.518222 67.811555L364.088889 182.044444H230.343111l192 192.056889a34.133333 34.133333 0 0 1-43.52 52.224l-4.721778-3.982222-192.113777-192.056889L182.044444 364.088889a34.133333 34.133333 0 0 1-28.615111 33.678222L147.911111 398.222222a34.133333 34.133333 0 0 1-33.678222-28.615111L113.777778 364.088889V147.911111a34.133333 34.133333 0 0 1 28.615111-33.678222L147.911111 113.777778h216.177778z m512 0a34.133333 34.133333 0 0 1 33.678222 28.615111L910.222222 147.911111v216.177778a34.133333 34.133333 0 0 1-67.811555 5.518222L841.955556 364.088889l-0.056889-133.745778-192 192a34.133333 34.133333 0 0 1-52.224-43.52l3.982222-4.721778L793.6 182.044444H659.911111a34.133333 34.133333 0 0 1-33.678222-28.615111L625.777778 147.911111a34.133333 34.133333 0 0 1 28.615111-33.678222L659.911111 113.777778h216.177778z" ></path></symbol><symbol id="l7-icon-hide" viewBox="0 0 1024 1024"><path d="M875.52 87.836444a34.133333 34.133333 0 0 1 7.281778 43.121778l-3.527111 5.006222-682.666667 796.444445a34.133333 34.133333 0 0 1-55.409778-39.367111l3.527111-5.006222 97.166223-113.379556C123.164444 697.969778 56.888889 582.940444 56.888889 512c0-113.777778 170.666667-341.333333 455.111111-341.333333a496.64 496.64 0 0 1 208.952889 45.112889l106.439111-124.188445a34.133333 34.133333 0 0 1 48.128-3.754667z m-38.684444 202.524445C921.031111 362.951111 967.111111 452.835556 967.111111 512c0 113.777778-170.666667 341.333333-455.111111 341.333333-50.631111 0-97.678222-7.224889-140.8-19.740444l50.232889-58.595556A417.393778 417.393778 0 0 0 512 785.066667c208.270222 0 386.844444-162.304 386.844444-273.066667 0-52.849778-40.675556-117.418667-105.813333-170.496l43.804445-51.2zM512 238.933333C303.729778 238.933333 125.155556 401.237333 125.155556 512c0 66.787556 64.853333 152.291556 162.133333 209.692444L377.173333 616.675556a170.666667 170.666667 0 0 1 217.713778-253.895112l78.620445-91.704888A432.924444 432.924444 0 0 0 512 238.933333z m166.684444 236.088889a170.666667 170.666667 0 0 1-177.664 207.303111l177.607112-207.303111zM512 409.6a102.4 102.4 0 0 0-88.746667 153.486222L548.864 416.426667A102.172444 102.172444 0 0 0 512 409.6z" ></path></symbol><symbol id="l7-icon-rectangle" viewBox="0 0 1024 1024"><path d="M170.666667 56.888889a113.777778 113.777778 0 0 1 108.544 79.644444H853.333333a34.133333 34.133333 0 0 1 33.678223 28.615111L887.466667 170.666667v574.122666a113.777778 113.777778 0 1 1-142.677334 142.734223L170.666667 887.466667a34.133333 34.133333 0 0 1-33.678223-28.615111L136.533333 853.333333V279.210667A113.777778 113.777778 0 0 1 170.666667 56.888889z m682.666666 750.933333a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m-34.133333-603.022222H279.210667a114.062222 114.062222 0 0 1-74.353778 74.410667L204.8 819.2h539.989333a114.062222 114.062222 0 0 1 74.410667-74.410667V204.8zM170.666667 125.155556a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-ranging" viewBox="0 0 1024 1024"><path d="M723.171556 50.403556l250.424888 250.424888a31.061333 31.061333 0 0 1 0 43.918223L344.746667 973.596444a31.061333 31.061333 0 0 1-43.918223 0L50.403556 723.171556a31.061333 31.061333 0 0 1 0-43.918223L679.253333 50.403556a31.061333 31.061333 0 0 1 43.918223 0z m-21.959112 74.524444l-39.765333 39.822222 98.986667 98.872889a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.640889-98.929778-98.929778-63.886222 63.886222 62.179556 62.122667a34.133333 34.133333 0 0 1-44.088889 51.882667L563.2 387.242667 501.077333 325.063111 437.191111 388.949333l98.986667 98.929778a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.640889-98.929778-98.929778-63.886222 63.886222L387.242667 563.2a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.584-62.122667-62.179556-63.886222 63.886222 98.986667 98.929778a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.640889-98.929778-98.929778-39.765333 39.822222 197.802667 197.745778 576.284444-576.284444-197.802667-197.745778z" ></path></symbol><symbol id="l7-icon-reposition" viewBox="0 0 1024 1024"><path d="M512 56.888889a34.133333 34.133333 0 0 1 34.133333 34.133333v24.177778A398.336 398.336 0 0 1 908.856889 477.866667h24.177778a34.133333 34.133333 0 0 1 0 68.266666h-24.177778A398.336 398.336 0 0 1 546.133333 908.856889L546.133333 932.977778a34.133333 34.133333 0 0 1-68.266666 0v-24.177778A398.336 398.336 0 0 1 115.2 546.133333L91.022222 546.133333a34.133333 34.133333 0 1 1 0-68.266666h24.177778A398.336 398.336 0 0 1 477.866667 115.2V91.022222A34.133333 34.133333 0 0 1 512 56.888889z m34.190222 126.862222L546.133333 193.422222a34.133333 34.133333 0 1 1-68.266666 0v-9.671111A330.069333 330.069333 0 0 0 183.751111 477.866667h9.671111a34.133333 34.133333 0 1 1 0 68.266666l-9.671111 0.056889A330.069333 330.069333 0 0 0 477.866667 840.248889V830.577778a34.133333 34.133333 0 0 1 68.266666 0l0.056889 9.671111A330.069333 330.069333 0 0 0 840.248889 546.133333L830.577778 546.133333a34.133333 34.133333 0 0 1 0-68.266666h9.671111A330.069333 330.069333 0 0 0 546.133333 183.751111zM512 341.333333a170.666667 170.666667 0 1 1 0 341.333334 170.666667 170.666667 0 0 1 0-341.333334z m0 68.266667a102.4 102.4 0 1 0 0 204.8 102.4 102.4 0 0 0 0-204.8z" ></path></symbol><symbol id="l7-icon-round" viewBox="0 0 1024 1024"><path d="M512 56.888889a455.111111 455.111111 0 0 1 391.395556 687.502222 113.777778 113.777778 0 0 1-159.061334 158.890667A455.111111 455.111111 0 0 1 120.604444 279.608889 113.777778 113.777778 0 0 1 279.608889 120.604444 452.835556 452.835556 0 0 1 512 56.888889z m0 68.266667a384.910222 384.910222 0 0 0-191.715556 50.744888A113.777778 113.777778 0 0 1 175.957333 320.284444a386.844444 386.844444 0 0 0 527.815111 527.758223 113.777778 113.777778 0 0 1 144.270223-144.440889A386.844444 386.844444 0 0 0 512 125.155556z m299.406222 640.739555a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222zM212.593778 167.082667a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-guanbi" viewBox="0 0 1024 1024"><path d="M576 512l277.333333 277.333333-64 64-277.333333-277.333333L234.666667 853.333333 170.666667 789.333333l277.333333-277.333333L170.666667 234.666667 234.666667 170.666667l277.333333 277.333333L789.333333 170.666667 853.333333 234.666667 576 512z" ></path></symbol></svg>',function(Zr){try{let Ce=function(){de||(de=!0,M())},He=function(){try{R.documentElement.doScroll("left")}catch(Xe){return void setTimeout(He,50)}Ce()};var Le=Ce,Re=He,Se=(Se=document.getElementsByTagName("script"))[Se.length-1],_r=Se.getAttribute("data-injectcss"),Se=Se.getAttribute("data-disable-injectsvg");if(!Se){var ve,Ze,M,R,de,be=function(Xe,Ke){Ke.parentNode.insertBefore(Xe,Ke)};if(_r&&!Zr.__iconfont__svg__cssinject__){Zr.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(Xe){console&&console.log(Xe)}}ve=function(){var Xe,Ke=document.createElement("div");Ke.innerHTML=Zr._iconfont_svg_string_3580659,(Ke=Ke.getElementsByTagName("svg")[0])&&(Ke.setAttribute("aria-hidden","true"),Ke.style.position="absolute",Ke.style.width=0,Ke.style.height=0,Ke.style.overflow="hidden",Ke=Ke,(Xe=document.body).firstChild?be(Ke,Xe.firstChild):Xe.appendChild(Ke))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(ve,0):(Ze=function(){document.removeEventListener("DOMContentLoaded",Ze,!1),ve()},document.addEventListener("DOMContentLoaded",Ze,!1)):document.attachEvent&&(M=ve,R=Zr.document,de=!1,He(),R.onreadystatechange=function(){R.readyState=="complete"&&(R.onreadystatechange=null,Ce())})}}catch(Ce){}}(window)},46236:function(Zr,_r,Se){(function(ve,Ze){Ze(_r,Se(5527))})(this,function(ve,Ze){"use strict";var M={draw:"crosshair",pointHover:"pointer",pointDrag:"move",lineHover:"pointer",lineDrag:"move",polygonHover:"pointer",polygonDrag:"move"},R={point:[],line:[],polygon:[],midPoint:[],dashLine:[],text:[]},de="top",be="bottom",Le="right",Re="left",Ce="auto",He=[de,be,Le,Re],Xe="start",Ke="end",Ve="clippingParents",et="viewport",er="popper",fr="reference",Ar=He.reduce(function(p,v){return p.concat([v+"-"+Xe,v+"-"+Ke])},[]),pn=[].concat(He,[Ce]).reduce(function(p,v){return p.concat([v,v+"-"+Xe,v+"-"+Ke])},[]),Kn=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Jn(p){return p?(p.nodeName||"").toLowerCase():null}function ki(p){if(p==null)return window;if(""+p!="[object Window]"){var v=p.ownerDocument;return v&&v.defaultView||window}return p}function pa(p){return p instanceof ki(p).Element||p instanceof Element}function xr(p){return p instanceof ki(p).HTMLElement||p instanceof HTMLElement}function jt(p){return typeof ShadowRoot!="undefined"&&(p instanceof ki(p).ShadowRoot||p instanceof ShadowRoot)}var Jr={name:"applyStyles",enabled:!0,phase:"write",fn:function(p){var v=p.state;Object.keys(v.elements).forEach(function(m){var w=v.styles[m]||{},D=v.attributes[m]||{},N=v.elements[m];xr(N)&&Jn(N)&&(Object.assign(N.style,w),Object.keys(D).forEach(function(W){var $=D[W];$===!1?N.removeAttribute(W):N.setAttribute(W,$===!0?"":$)}))})},effect:function(p){var v=p.state,m={popper:{position:v.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(v.elements.popper.style,m.popper),v.styles=m,v.elements.arrow&&Object.assign(v.elements.arrow.style,m.arrow),function(){Object.keys(v.elements).forEach(function(w){var D=v.elements[w],N=v.attributes[w]||{},W=Object.keys(v.styles.hasOwnProperty(w)?v.styles[w]:m[w]).reduce(function($,ie){return $[ie]="",$},{});xr(D)&&Jn(D)&&(Object.assign(D.style,W),Object.keys(N).forEach(function($){D.removeAttribute($)}))})}},requires:["computeStyles"]};function gr(p){return p.split("-")[0]}var rn=Math.max,jn=Math.min,qe=Math.round;function Dt(){var p=navigator.userAgentData;return p!=null&&p.brands&&Array.isArray(p.brands)?p.brands.map(function(v){return v.brand+"/"+v.version}).join(" "):navigator.userAgent}function $e(){return!/^((?!chrome|android).)*safari/i.test(Dt())}function Pt(p,v,m){v===void 0&&(v=!1),m===void 0&&(m=!1);var w=p.getBoundingClientRect(),D=1,N=1;v&&xr(p)&&(D=p.offsetWidth>0&&qe(w.width)/p.offsetWidth||1,N=p.offsetHeight>0&&qe(w.height)/p.offsetHeight||1);var W=(pa(p)?ki(p):window).visualViewport,$=!$e()&&m,ie=(w.left+($&&W?W.offsetLeft:0))/D,pe=(w.top+($&&W?W.offsetTop:0))/N,we=w.width/D,ke=w.height/N;return{width:we,height:ke,top:pe,right:ie+we,bottom:pe+ke,left:ie,x:ie,y:pe}}function vt(p){var v=Pt(p),m=p.offsetWidth,w=p.offsetHeight;return Math.abs(v.width-m)>1||(m=v.width),Math.abs(v.height-w)>1||(w=v.height),{x:p.offsetLeft,y:p.offsetTop,width:m,height:w}}function rr(p,v){var m=v.getRootNode&&v.getRootNode();if(p.contains(v))return!0;if(m&&jt(m)){var w=v;do{if(w&&p.isSameNode(w))return!0;w=w.parentNode||w.host}while(w)}return!1}function ar(p){return ki(p).getComputedStyle(p)}function wr(p){return["table","td","th"].indexOf(Jn(p))>=0}function Cr(p){return((pa(p)?p.ownerDocument:p.document)||window.document).documentElement}function an(p){return Jn(p)==="html"?p:p.assignedSlot||p.parentNode||(jt(p)?p.host:null)||Cr(p)}function yi(p){return xr(p)&&ar(p).position!=="fixed"?p.offsetParent:null}function li(p){for(var v=ki(p),m=yi(p);m&&wr(m)&&ar(m).position==="static";)m=yi(m);return m&&(Jn(m)==="html"||Jn(m)==="body"&&ar(m).position==="static")?v:m||function(w){var D=/firefox/i.test(Dt());if(/Trident/i.test(Dt())&&xr(w)&&ar(w).position==="fixed")return null;var N=an(w);for(jt(N)&&(N=N.host);xr(N)&&0>["html","body"].indexOf(Jn(N));){var W=ar(N);if(W.transform!=="none"||W.perspective!=="none"||W.contain==="paint"||["transform","perspective"].indexOf(W.willChange)!==-1||D&&W.willChange==="filter"||D&&W.filter&&W.filter!=="none")return N;N=N.parentNode}return null}(p)||v}function Uo(p){return 0>["top","bottom"].indexOf(p)?"y":"x"}function vi(p,v,m){return rn(p,jn(v,m))}function bo(p){return Object.assign({},{top:0,right:0,bottom:0,left:0},p)}function So(p,v){return v.reduce(function(m,w){return m[w]=p,m},{})}var Xi={name:"arrow",enabled:!0,phase:"main",fn:function(p){var v,m=p.state,w=p.name,D=p.options,N=m.elements.arrow,W=m.modifiersData.popperOffsets,$=gr(m.placement),ie=Uo($),pe=[Re,Le].indexOf($)>=0?"height":"width";if(N&&W){var we=function(nr,br){return bo(typeof(nr=typeof nr=="function"?nr(Object.assign({},br.rects,{placement:br.placement})):nr)!="number"?nr:So(nr,He))}(D.padding,m),ke=vt(N),Ge=ie==="y"?de:Re,ht=ie==="y"?be:Le,mt=m.rects.reference[pe]+m.rects.reference[ie]-W[ie]-m.rects.popper[pe],St=W[ie]-m.rects.reference[ie],xt=li(N),bt=xt?ie==="y"?xt.clientHeight||0:xt.clientWidth||0:0,kt=bt/2-ke[pe]/2+(mt/2-St/2),ft=vi(we[Ge],kt,bt-ke[pe]-we[ht]);m.modifiersData[w]=((v={})[ie]=ft,v.centerOffset=ft-kt,v)}},effect:function(p){var v=p.state,m=p.options.element,w=m===void 0?"[data-popper-arrow]":m;w!=null&&(typeof w!="string"||(w=v.elements.popper.querySelector(w)))&&rr(v.elements.popper,w)&&(v.elements.arrow=w)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Mi(p){return p.split("-")[1]}var qo={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ui(p){var v,m=p.popper,w=p.popperRect,D=p.placement,N=p.variation,W=p.offsets,$=p.position,ie=p.gpuAcceleration,pe=p.adaptive,we=p.roundOffsets,ke=p.isFixed,Ge=W.x,ht=Ge===void 0?0:Ge,mt=W.y,St=mt===void 0?0:mt,xt=typeof we=="function"?we({x:ht,y:St}):{x:ht,y:St};ht=xt.x,St=xt.y;var bt=W.hasOwnProperty("x"),kt=W.hasOwnProperty("y"),ft=Re,nr=de,br=window;if(pe){var Pr=li(m),Mn="clientHeight",yn="clientWidth";Pr===ki(m)&&ar(Pr=Cr(m)).position!=="static"&&$==="absolute"&&(Mn="scrollHeight",yn="scrollWidth"),(D===de||(D===Re||D===Le)&&N===Ke)&&(nr=be,St-=(ke&&Pr===br&&br.visualViewport?br.visualViewport.height:Pr[Mn])-w.height,St*=ie?1:-1),(D===Re||(D===de||D===be)&&N===Ke)&&(ft=Le,ht-=(ke&&Pr===br&&br.visualViewport?br.visualViewport.width:Pr[yn])-w.width,ht*=ie?1:-1)}var kr,Ai=Object.assign({position:$},pe&&qo),$n=we===!0?function(ti,ri){var hn=ti.y,An=ri.devicePixelRatio||1;return{x:qe(ti.x*An)/An||0,y:qe(hn*An)/An||0}}({x:ht,y:St},ki(m)):{x:ht,y:St};return ht=$n.x,St=$n.y,Object.assign({},Ai,ie?((kr={})[nr]=kt?"0":"",kr[ft]=bt?"0":"",kr.transform=(br.devicePixelRatio||1)>1?"translate3d("+ht+"px, "+St+"px, 0)":"translate("+ht+"px, "+St+"px)",kr):((v={})[nr]=kt?St+"px":"",v[ft]=bt?ht+"px":"",v.transform="",v))}var Qi={passive:!0},Vi={left:"right",right:"left",bottom:"top",top:"bottom"};function Pi(p){return p.replace(/left|right|bottom|top/g,function(v){return Vi[v]})}var ds={start:"end",end:"start"};function Ur(p){return p.replace(/start|end/g,function(v){return ds[v]})}function ls(p){var v=ki(p);return{scrollLeft:v.pageXOffset,scrollTop:v.pageYOffset}}function dr(p){return Pt(Cr(p)).left+ls(p).scrollLeft}function he(p){var v=ar(p);return/auto|scroll|overlay|hidden/.test(v.overflow+v.overflowY+v.overflowX)}function We(p){return 0>["html","body","#document"].indexOf(Jn(p))?xr(p)&&he(p)?p:We(an(p)):p.ownerDocument.body}function at(p,v){var m;v===void 0&&(v=[]);var w=We(p),D=w===((m=p.ownerDocument)==null?void 0:m.body),N=ki(w),W=D?[N].concat(N.visualViewport||[],he(w)?w:[]):w,$=v.concat(W);return D?$:$.concat(at(an(W)))}function Ot(p){return Object.assign({},p,{left:p.x,top:p.y,right:p.x+p.width,bottom:p.y+p.height})}function or(p,v,m){return v===et?Ot(function(w,D){var N=ki(w),W=Cr(w),$=N.visualViewport,ie=W.clientWidth,pe=W.clientHeight,we=0,ke=0;if($){ie=$.width,pe=$.height;var Ge=$e();(Ge||!Ge&&D==="fixed")&&(we=$.offsetLeft,ke=$.offsetTop)}return{width:ie,height:pe,x:we+dr(w),y:ke}}(p,m)):pa(v)?function(w,D){var N=Pt(w,!1,D==="fixed");return N.top=N.top+w.clientTop,N.left=N.left+w.clientLeft,N.bottom=N.top+w.clientHeight,N.right=N.left+w.clientWidth,N.width=w.clientWidth,N.height=w.clientHeight,N.x=N.left,N.y=N.top,N}(v,m):Ot(function(w){var D,N=Cr(w),W=ls(w),$=(D=w.ownerDocument)==null?void 0:D.body,ie=rn(N.scrollWidth,N.clientWidth,$?$.scrollWidth:0,$?$.clientWidth:0),pe=rn(N.scrollHeight,N.clientHeight,$?$.scrollHeight:0,$?$.clientHeight:0),we=-W.scrollLeft+dr(w),ke=-W.scrollTop;return ar($||N).direction==="rtl"&&(we+=rn(N.clientWidth,$?$.clientWidth:0)-ie),{width:ie,height:pe,x:we,y:ke}}(Cr(p)))}function Wr(p,v,m,w){var D=v==="clippingParents"?function($){var ie=at(an($)),pe=["absolute","fixed"].indexOf(ar($).position)>=0&&xr($)?li($):$;return pa(pe)?ie.filter(function(we){return pa(we)&&rr(we,pe)&&Jn(we)!=="body"}):[]}(p):[].concat(v),N=[].concat(D,[m]),W=N.reduce(function($,ie){var pe=or(p,ie,w);return $.top=rn(pe.top,$.top),$.right=jn(pe.right,$.right),$.bottom=jn(pe.bottom,$.bottom),$.left=rn(pe.left,$.left),$},or(p,N[0],w));return W.width=W.right-W.left,W.height=W.bottom-W.top,W.x=W.left,W.y=W.top,W}function In(p){var v,m=p.reference,w=p.element,D=p.placement,N=D?gr(D):null,W=D?Mi(D):null,$=m.x+m.width/2-w.width/2,ie=m.y+m.height/2-w.height/2;switch(N){case de:v={x:$,y:m.y-w.height};break;case be:v={x:$,y:m.y+m.height};break;case Le:v={x:m.x+m.width,y:ie};break;case Re:v={x:m.x-w.width,y:ie};break;default:v={x:m.x,y:m.y}}var pe=N?Uo(N):null;if(pe!=null){var we=pe==="y"?"height":"width";switch(W){case Xe:v[pe]=v[pe]-(m[we]/2-w[we]/2);break;case Ke:v[pe]=v[pe]+(m[we]/2-w[we]/2)}}return v}function kn(p,v){v===void 0&&(v={});var m=v.placement,w=m===void 0?p.placement:m,D=v.strategy,N=D===void 0?p.strategy:D,W=v.boundary,$=W===void 0?Ve:W,ie=v.rootBoundary,pe=ie===void 0?et:ie,we=v.elementContext,ke=we===void 0?er:we,Ge=v.altBoundary,ht=Ge!==void 0&&Ge,mt=v.padding,St=mt===void 0?0:mt,xt=bo(typeof St!="number"?St:So(St,He)),bt=p.rects.popper,kt=p.elements[ht?ke===er?fr:er:ke],ft=Wr(pa(kt)?kt:kt.contextElement||Cr(p.elements.popper),$,pe,N),nr=Pt(p.elements.reference),br=In({reference:nr,element:bt,strategy:"absolute",placement:w}),Pr=Ot(Object.assign({},bt,br)),Mn=ke===er?Pr:nr,yn={top:ft.top-Mn.top+xt.top,bottom:Mn.bottom-ft.bottom+xt.bottom,left:ft.left-Mn.left+xt.left,right:Mn.right-ft.right+xt.right},kr=p.modifiersData.offset;if(ke===er&&kr){var Ai=kr[w];Object.keys(yn).forEach(function($n){var ti=0>[Le,be].indexOf($n)?-1:1;yn[$n]+=Ai[0>[de,be].indexOf($n)?"x":"y"]*ti})}return yn}function eo(p,v){v===void 0&&(v={});var m=v.boundary,w=v.rootBoundary,D=v.padding,N=v.flipVariations,W=v.allowedAutoPlacements,$=W===void 0?pn:W,ie=Mi(v.placement),pe=ie?N?Ar:Ar.filter(function(Ge){return Mi(Ge)===ie}):He,we=pe.filter(function(Ge){return $.indexOf(Ge)>=0});we.length===0&&(we=pe);var ke=we.reduce(function(Ge,ht){return Ge[ht]=kn(p,{placement:ht,boundary:m,rootBoundary:w,padding:D})[gr(ht)],Ge},{});return Object.keys(ke).sort(function(Ge,ht){return ke[Ge]-ke[ht]})}var un={name:"flip",enabled:!0,phase:"main",fn:function(p){var v=p.state,m=p.options,w=p.name;if(!v.modifiersData[w]._skip){for(var D=m.mainAxis,N=D===void 0||D,W=m.altAxis,$=W===void 0||W,ie=m.fallbackPlacements,pe=m.padding,we=m.boundary,ke=m.rootBoundary,Ge=m.altBoundary,ht=m.flipVariations,mt=ht===void 0||ht,St=m.allowedAutoPlacements,xt=v.options.placement,bt=gr(xt),kt=ie||(bt===xt||!mt?[Pi(xt)]:function(zi){if(gr(zi)===Ce)return[];var Vo=Pi(zi);return[Ur(zi),Vo,Ur(Vo)]}(xt)),ft=[xt].concat(kt).reduce(function(zi,Vo){return zi.concat(gr(Vo)===Ce?eo(v,{placement:Vo,boundary:we,rootBoundary:ke,padding:pe,flipVariations:mt,allowedAutoPlacements:St}):Vo)},[]),nr=v.rects.reference,br=v.rects.popper,Pr=new Map,Mn=!0,yn=ft[0],kr=0;ft.length>kr;kr++){var Ai=ft[kr],$n=gr(Ai),ti=Mi(Ai)===Xe,ri=[de,be].indexOf($n)>=0,hn=ri?"width":"height",An=kn(v,{placement:Ai,boundary:we,rootBoundary:ke,altBoundary:Ge,padding:pe}),Yi=ri?ti?Le:Re:ti?be:de;nr[hn]>br[hn]&&(Yi=Pi(Yi));var Ci=Pi(Yi),fo=[];if(N&&fo.push(0>=An[$n]),$&&fo.push(0>=An[Yi],0>=An[Ci]),fo.every(function(zi){return zi})){yn=Ai,Mn=!1;break}Pr.set(Ai,fo)}if(Mn)for(var Go=function(zi){var Vo=ft.find(function(Ka){var ta=Pr.get(Ka);if(ta)return ta.slice(0,zi).every(function(ka){return ka})});if(Vo)return yn=Vo,"break"},hi=mt?3:1;hi>0&&Go(hi)!=="break";hi--);v.placement!==yn&&(v.modifiersData[w]._skip=!0,v.placement=yn,v.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function To(p,v,m){return m===void 0&&(m={x:0,y:0}),{top:p.top-v.height-m.y,right:p.right-v.width+m.x,bottom:p.bottom-v.height+m.y,left:p.left-v.width-m.x}}function Ti(p){return[de,Le,be,Re].some(function(v){return p[v]>=0})}var Lo={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(p){var v=p.state,m=p.name,w=p.options.offset,D=w===void 0?[0,0]:w,N=pn.reduce(function(ie,pe){return ie[pe]=function(we,ke,Ge){var ht=gr(we),mt=0>[Re,de].indexOf(ht)?1:-1,St=typeof Ge=="function"?Ge(Object.assign({},ke,{placement:we})):Ge,xt=St[0],bt=St[1];return xt=xt||0,bt=(bt||0)*mt,0>[Re,Le].indexOf(ht)?{x:xt,y:bt}:{x:bt,y:xt}}(pe,v.rects,D),ie},{}),W=N[v.placement],$=W.y;v.modifiersData.popperOffsets!=null&&(v.modifiersData.popperOffsets.x+=W.x,v.modifiersData.popperOffsets.y+=$),v.modifiersData[m]=N}},wa={name:"preventOverflow",enabled:!0,phase:"main",fn:function(p){var v=p.state,m=p.options,w=p.name,D=m.mainAxis,N=D===void 0||D,W=m.altAxis,$=W!==void 0&&W,ie=m.tether,pe=ie===void 0||ie,we=m.tetherOffset,ke=we===void 0?0:we,Ge=kn(v,{boundary:m.boundary,rootBoundary:m.rootBoundary,padding:m.padding,altBoundary:m.altBoundary}),ht=gr(v.placement),mt=Mi(v.placement),St=!mt,xt=Uo(ht),bt=xt==="x"?"y":"x",kt=v.modifiersData.popperOffsets,ft=v.rects.reference,nr=v.rects.popper,br=typeof ke=="function"?ke(Object.assign({},v.rects,{placement:v.placement})):ke,Pr=typeof br=="number"?{mainAxis:br,altAxis:br}:Object.assign({mainAxis:0,altAxis:0},br),Mn=v.modifiersData.offset?v.modifiersData.offset[v.placement]:null,yn={x:0,y:0};if(kt){if(N){var kr,Ai=xt==="y"?de:Re,$n=xt==="y"?be:Le,ti=xt==="y"?"height":"width",ri=kt[xt],hn=ri+Ge[Ai],An=ri-Ge[$n],Yi=pe?-nr[ti]/2:0,Ci=mt===Xe?ft[ti]:nr[ti],fo=mt===Xe?-nr[ti]:-ft[ti],Go=v.elements.arrow,hi=pe&&Go?vt(Go):{width:0,height:0},zi=v.modifiersData["arrow#persistent"]?v.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Vo=zi[Ai],Ka=zi[$n],ta=vi(0,ft[ti],hi[ti]),ka=St?ft[ti]/2-Yi-ta-Vo-Pr.mainAxis:Ci-ta-Vo-Pr.mainAxis,ca=St?-ft[ti]/2+Yi+ta+Ka+Pr.mainAxis:fo+ta+Ka+Pr.mainAxis,Eo=v.elements.arrow&&li(v.elements.arrow),Pa=(kr=Mn==null?void 0:Mn[xt])!=null?kr:0,na=ri+ca-Pa,ha=vi(pe?jn(hn,ri+ka-Pa-(Eo?xt==="y"?Eo.clientTop||0:Eo.clientLeft||0:0)):hn,ri,pe?rn(An,na):An);kt[xt]=ha,yn[xt]=ha-ri}if($){var Xs,Ls=kt[bt],Ea=bt==="y"?"height":"width",ws=Ls+Ge[xt==="x"?de:Re],qs=Ls-Ge[xt==="x"?be:Le],ua=[de,Re].indexOf(ht)!==-1,cu=(Xs=Mn==null?void 0:Mn[bt])!=null?Xs:0,c=ua?ws:Ls-ft[Ea]-nr[Ea]-cu+Pr.altAxis,o=ua?Ls+ft[Ea]+nr[Ea]-cu-Pr.altAxis:qs,f=pe&&ua?function(E,L,V){var X=vi(E,L,V);return X>V?V:X}(c,Ls,o):vi(pe?c:ws,Ls,pe?o:qs);kt[bt]=f,yn[bt]=f-Ls}v.modifiersData[w]=yn}},requiresIfExists:["offset"]};function dn(p,v,m){m===void 0&&(m=!1);var w,D,N=xr(v),W=xr(v)&&function(ke){var Ge=ke.getBoundingClientRect(),ht=qe(Ge.width)/ke.offsetWidth||1,mt=qe(Ge.height)/ke.offsetHeight||1;return ht!==1||mt!==1}(v),$=Cr(v),ie=Pt(p,W,m),pe={scrollLeft:0,scrollTop:0},we={x:0,y:0};return(N||!N&&!m)&&((Jn(v)!=="body"||he($))&&(pe=(w=v)!==ki(w)&&xr(w)?{scrollLeft:(D=w).scrollLeft,scrollTop:D.scrollTop}:ls(w)),xr(v)?((we=Pt(v,!0)).x+=v.clientLeft,we.y+=v.clientTop):$&&(we.x=dr($))),{x:ie.left+pe.scrollLeft-we.x,y:ie.top+pe.scrollTop-we.y,width:ie.width,height:ie.height}}function co(p){var v=new Map,m=new Set,w=[];function D(N){m.add(N.name),[].concat(N.requires||[],N.requiresIfExists||[]).forEach(function(W){if(!m.has(W)){var $=v.get(W);$&&D($)}}),w.push(N)}return p.forEach(function(N){v.set(N.name,N)}),p.forEach(function(N){m.has(N.name)||D(N)}),w}var no={placement:"bottom",modifiers:[],strategy:"absolute"};function Za(){for(var p=arguments.length,v=Array(p),m=0;p>m;m++)v[m]=arguments[m];return!v.some(function(w){return!(w&&typeof w.getBoundingClientRect=="function")})}function ms(p){p===void 0&&(p={});var v=p.defaultModifiers,m=v===void 0?[]:v,w=p.defaultOptions,D=w===void 0?no:w;return function(N,W,$){$===void 0&&($=D);var ie,pe,we={placement:"bottom",orderedModifiers:[],options:Object.assign({},no,D),modifiersData:{},elements:{reference:N,popper:W},attributes:{},styles:{}},ke=[],Ge=!1,ht={state:we,setOptions:function(St){var xt=typeof St=="function"?St(we.options):St;mt(),we.options=Object.assign({},D,we.options,xt),we.scrollParents={reference:pa(N)?at(N):N.contextElement?at(N.contextElement):[],popper:at(W)};var bt,kt,ft=function(nr){var br=co(nr);return Kn.reduce(function(Pr,Mn){return Pr.concat(br.filter(function(yn){return yn.phase===Mn}))},[])}((bt=[].concat(m,we.options.modifiers),kt=bt.reduce(function(nr,br){var Pr=nr[br.name];return nr[br.name]=Pr?Object.assign({},Pr,br,{options:Object.assign({},Pr.options,br.options),data:Object.assign({},Pr.data,br.data)}):br,nr},{}),Object.keys(kt).map(function(nr){return kt[nr]})));return we.orderedModifiers=ft.filter(function(nr){return nr.enabled}),we.orderedModifiers.forEach(function(nr){var br=nr.options,Pr=nr.effect;if(typeof Pr=="function"){var Mn=Pr({state:we,name:nr.name,instance:ht,options:br===void 0?{}:br});ke.push(Mn||function(){})}}),ht.update()},forceUpdate:function(){if(!Ge){var St=we.elements,xt=St.reference,bt=St.popper;if(Za(xt,bt)){we.rects={reference:dn(xt,li(bt),we.options.strategy==="fixed"),popper:vt(bt)},we.reset=!1,we.placement=we.options.placement,we.orderedModifiers.forEach(function(Pr){return we.modifiersData[Pr.name]=Object.assign({},Pr.data)});for(var kt=0;we.orderedModifiers.length>kt;kt++)if(we.reset!==!0){var ft=we.orderedModifiers[kt],nr=ft.fn,br=ft.options;typeof nr=="function"&&(we=nr({state:we,options:br===void 0?{}:br,name:ft.name,instance:ht})||we)}else we.reset=!1,kt=-1}}},update:(ie=function(){return new Promise(function(St){ht.forceUpdate(),St(we)})},function(){return pe||(pe=new Promise(function(St){Promise.resolve().then(function(){pe=void 0,St(ie())})})),pe}),destroy:function(){mt(),Ge=!0}};if(!Za(N,W))return ht;function mt(){ke.forEach(function(St){return St()}),ke=[]}return ht.setOptions($).then(function(St){!Ge&&$.onFirstUpdate&&$.onFirstUpdate(St)}),ht}}var Ji=ms({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(p){var v=p.state,m=p.instance,w=p.options,D=w.scroll,N=D===void 0||D,W=w.resize,$=W===void 0||W,ie=ki(v.elements.popper),pe=[].concat(v.scrollParents.reference,v.scrollParents.popper);return N&&pe.forEach(function(we){we.addEventListener("scroll",m.update,Qi)}),$&&ie.addEventListener("resize",m.update,Qi),function(){N&&pe.forEach(function(we){we.removeEventListener("scroll",m.update,Qi)}),$&&ie.removeEventListener("resize",m.update,Qi)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(p){var v=p.state;v.modifiersData[p.name]=In({reference:v.rects.reference,element:v.rects.popper,strategy:"absolute",placement:v.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(p){var v=p.state,m=p.options,w=m.gpuAcceleration,D=w===void 0||w,N=m.adaptive,W=N===void 0||N,$=m.roundOffsets,ie=$===void 0||$,pe={placement:gr(v.placement),variation:Mi(v.placement),popper:v.elements.popper,popperRect:v.rects.popper,gpuAcceleration:D,isFixed:v.options.strategy==="fixed"};v.modifiersData.popperOffsets!=null&&(v.styles.popper=Object.assign({},v.styles.popper,ui(Object.assign({},pe,{offsets:v.modifiersData.popperOffsets,position:v.options.strategy,adaptive:W,roundOffsets:ie})))),v.modifiersData.arrow!=null&&(v.styles.arrow=Object.assign({},v.styles.arrow,ui(Object.assign({},pe,{offsets:v.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:ie})))),v.attributes.popper=Object.assign({},v.attributes.popper,{"data-popper-placement":v.placement})},data:{}},Jr,Lo,un,wa,Xi,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(p){var v=p.state,m=p.name,w=v.rects.reference,D=v.rects.popper,N=v.modifiersData.preventOverflow,W=kn(v,{elementContext:"reference"}),$=kn(v,{altBoundary:!0}),ie=To(W,w),pe=To($,D,N),we=Ti(ie),ke=Ti(pe);v.modifiersData[m]={referenceClippingOffsets:ie,popperEscapeOffsets:pe,isReferenceHidden:we,hasPopperEscaped:ke},v.attributes.popper=Object.assign({},v.attributes.popper,{"data-popper-reference-hidden":we,"data-popper-escaped":ke})}}]}),Us="tippy-content",Lt="tippy-backdrop",Ne="tippy-arrow",re="tippy-svg-arrow",le={passive:!0,capture:!0},ge=function(){return document.body};function ye(p,v,m){if(Array.isArray(p)){var w=p[v];return w==null?Array.isArray(m)?m[v]:m:w}return p}function ze(p,v){var m={}.toString.call(p);return m.indexOf("[object")===0&&m.indexOf(v+"]")>-1}function je(p,v){return typeof p=="function"?p.apply(void 0,v):p}function Ue(p,v){return v===0?p:function(w){clearTimeout(m),m=setTimeout(function(){p(w)},v)};var m}function Ae(p){return[].concat(p)}function Je(p,v){p.indexOf(v)===-1&&p.push(v)}function wt(p){return[].slice.call(p)}function Ht(p){return Object.keys(p).reduce(function(v,m){return p[m]!==void 0&&(v[m]=p[m]),v},{})}function Fr(){return document.createElement("div")}function mr(p){return["Element","Fragment"].some(function(v){return ze(p,v)})}function Sr(p){return ze(p,"MouseEvent")}function fn(p){return mr(p)?[p]:function(v){return ze(v,"NodeList")}(p)?wt(p):Array.isArray(p)?p:wt(document.querySelectorAll(p))}function xn(p,v){p.forEach(function(m){m&&(m.style.transitionDuration=v+"ms")})}function Lr(p,v){p.forEach(function(m){m&&m.setAttribute("data-state",v)})}function Nn(p){var v,m=Ae(p)[0];return m!=null&&(v=m.ownerDocument)!=null&&v.body?m.ownerDocument:document}function bn(p,v,m){var w=v+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(D){p[w](D,m)})}function En(p,v){for(var m=v;m;){var w;if(p.contains(m))return!0;m=m.getRootNode==null||(w=m.getRootNode())==null?void 0:w.host}return!1}var io={isTouch:!1},On=0;function Ao(){io.isTouch||(io.isTouch=!0,window.performance&&document.addEventListener("mousemove",ia))}function ia(){var p=performance.now();20>p-On&&(io.isTouch=!1,document.removeEventListener("mousemove",ia)),On=p}function Ho(){var p,v=document.activeElement;(p=v)&&p._tippy&&p._tippy.reference===p&&v.blur&&!v._tippy.state.isVisible&&v.blur()}var Ga=typeof window!="undefined"&&typeof document!="undefined"&&!!window.msCrypto,Wo=Object.assign({appendTo:ge,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Hl=Object.keys(Wo);function ns(p){var v=(p.plugins||[]).reduce(function(m,w){var D,N=w.name;return N&&(m[N]=p[N]!==void 0?p[N]:(D=Wo[N])!=null?D:w.defaultValue),m},{});return Object.assign({},p,v)}function Yo(p,v){var m=Object.assign({},v,{content:je(v.content,[p])},v.ignoreAttributes?{}:function(w,D){return(D?Object.keys(ns(Object.assign({},Wo,{plugins:D}))):Hl).reduce(function(N,W){var $=(w.getAttribute("data-tippy-"+W)||"").trim();if(!$)return N;if(W==="content")N[W]=$;else try{N[W]=JSON.parse($)}catch(ie){N[W]=$}return N},{})}(p,v.plugins));return m.aria=Object.assign({},Wo.aria,m.aria),m.aria={expanded:m.aria.expanded==="auto"?v.interactive:m.aria.expanded,content:m.aria.content==="auto"?v.interactive?null:"describedby":m.aria.content},m}var _a=function(){return"innerHTML"};function $o(p,v){p[_a()]=v}function Fo(p){var v=Fr();return p===!0?v.className=Ne:(v.className=re,mr(p)?v.appendChild(p):$o(v,p)),v}function us(p,v){mr(v.content)?($o(p,""),p.appendChild(v.content)):typeof v.content!="function"&&(v.allowHTML?$o(p,v.content):p.textContent=v.content)}function xc(p){var v=p.firstElementChild,m=wt(v.children);return{box:v,content:m.find(function(w){return w.classList.contains(Us)}),arrow:m.find(function(w){return w.classList.contains(Ne)||w.classList.contains(re)}),backdrop:m.find(function(w){return w.classList.contains(Lt)})}}function Ba(p){var v=Fr(),m=Fr();m.className="tippy-box",m.setAttribute("data-state","hidden"),m.setAttribute("tabindex","-1");var w=Fr();function D(N,W){var $=xc(v),ie=$.box,pe=$.content,we=$.arrow;W.theme?ie.setAttribute("data-theme",W.theme):ie.removeAttribute("data-theme"),typeof W.animation=="string"?ie.setAttribute("data-animation",W.animation):ie.removeAttribute("data-animation"),W.inertia?ie.setAttribute("data-inertia",""):ie.removeAttribute("data-inertia"),ie.style.maxWidth=typeof W.maxWidth=="number"?W.maxWidth+"px":W.maxWidth,W.role?ie.setAttribute("role",W.role):ie.removeAttribute("role"),N.content===W.content&&N.allowHTML===W.allowHTML||us(pe,p.props),W.arrow?we?N.arrow!==W.arrow&&(ie.removeChild(we),ie.appendChild(Fo(W.arrow))):ie.appendChild(Fo(W.arrow)):we&&ie.removeChild(we)}return w.className=Us,w.setAttribute("data-state","hidden"),us(w,p.props),v.appendChild(m),m.appendChild(w),D(p.props,p.props),{popper:v,onUpdate:D}}Ba.$$tippy=!0;var Fa=1,sc=[],Ql=[];function oa(p,v){var m,w,D,N,W,$,ie,pe,we=Yo(p,Object.assign({},Wo,ns(Ht(v)))),ke=!1,Ge=!1,ht=!1,mt=!1,St=[],xt=Ue(Xs,we.interactiveDebounce),bt=Fa++,kt=(pe=we.plugins).filter(function(f,E){return pe.indexOf(f)===E}),ft={id:bt,reference:p,popper:Fr(),popperInstance:null,props:we,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:kt,clearDelayTimeouts:function(){clearTimeout(m),clearTimeout(w),cancelAnimationFrame(D)},setProps:function(f){if(!ft.state.isDestroyed){Ci("onBeforeUpdate",[ft,f]),na();var E=ft.props,L=Yo(p,Object.assign({},E,Ht(f),{ignoreAttributes:!0}));ft.props=L,Pa(),E.interactiveDebounce!==L.interactiveDebounce&&(hi(),xt=Ue(Xs,L.interactiveDebounce)),E.triggerTarget&&!L.triggerTarget?Ae(E.triggerTarget).forEach(function(V){V.removeAttribute("aria-expanded")}):L.triggerTarget&&p.removeAttribute("aria-expanded"),Go(),Yi(),Pr&&Pr(E,L),ft.popperInstance&&(qs(),cu().forEach(function(V){requestAnimationFrame(V._tippy.popperInstance.forceUpdate)})),Ci("onAfterUpdate",[ft,f])}},setContent:function(f){ft.setProps({content:f})},show:function(){var f=ft.state.isVisible,E=ft.state.isDestroyed,L=!ft.state.isEnabled,V=io.isTouch&&!ft.props.touch,X=ye(ft.props.duration,0,Wo.duration);if(!(f||E||L||V)&&!ti().hasAttribute("disabled")&&(Ci("onShow",[ft],!1),ft.props.onShow(ft)!==!1)){if(ft.state.isVisible=!0,$n()&&(br.style.visibility="visible"),Yi(),ta(),ft.state.isMounted||(br.style.transition="none"),$n()){var J=hn();xn([J.box,J.content],0)}$=function(){var oe;if(ft.state.isVisible&&!mt){if(mt=!0,br.style.transition=ft.props.moveTransition,$n()&&ft.props.animation){var me=hn(),Me=me.box,De=me.content;xn([Me,De],X),Lr([Me,De],"visible")}fo(),Go(),Je(Ql,ft),(oe=ft.popperInstance)==null||oe.forceUpdate(),Ci("onMount",[ft]),ft.props.animation&&$n()&&function(Ye,ot){ca(Ye,ot)}(X,function(){ft.state.isShown=!0,Ci("onShown",[ft])})}},function(){var oe,me=ft.props.appendTo,Me=ti();oe=ft.props.interactive&&me===ge||me==="parent"?Me.parentNode:je(me,[Me]),oe.contains(br)||oe.appendChild(br),ft.state.isMounted=!0,qs()}()}},hide:function(){var f=!ft.state.isVisible,E=ft.state.isDestroyed,L=!ft.state.isEnabled,V=ye(ft.props.duration,1,Wo.duration);if(!(f||E||L)&&(Ci("onHide",[ft],!1),ft.props.onHide(ft)!==!1)){if(ft.state.isVisible=!1,ft.state.isShown=!1,mt=!1,ke=!1,$n()&&(br.style.visibility="hidden"),hi(),ka(),Yi(!0),$n()){var X=hn(),J=X.box,oe=X.content;ft.props.animation&&(xn([J,oe],V),Lr([J,oe],"hidden"))}fo(),Go(),ft.props.animation?$n()&&function(me,Me){ca(me,function(){!ft.state.isVisible&&br.parentNode&&br.parentNode.contains(br)&&Me()})}(V,ft.unmount):ft.unmount()}},hideWithInteractivity:function(f){ri().addEventListener("mousemove",xt),Je(sc,xt),xt(f)},enable:function(){ft.state.isEnabled=!0},disable:function(){ft.hide(),ft.state.isEnabled=!1},unmount:function(){ft.state.isVisible&&ft.hide(),ft.state.isMounted&&(ua(),cu().forEach(function(f){f._tippy.unmount()}),br.parentNode&&br.parentNode.removeChild(br),Ql=Ql.filter(function(f){return f!==ft}),ft.state.isMounted=!1,Ci("onHidden",[ft]))},destroy:function(){ft.state.isDestroyed||(ft.clearDelayTimeouts(),ft.unmount(),na(),delete p._tippy,ft.state.isDestroyed=!0,Ci("onDestroy",[ft]))}};if(!we.render)return ft;var nr=we.render(ft),br=nr.popper,Pr=nr.onUpdate;br.setAttribute("data-tippy-root",""),br.id="tippy-"+ft.id,ft.popper=br,p._tippy=ft,br._tippy=ft;var Mn=kt.map(function(f){return f.fn(ft)}),yn=p.hasAttribute("aria-expanded");return Pa(),Go(),Yi(),Ci("onCreate",[ft]),we.showOnCreate&&c(),br.addEventListener("mouseenter",function(){ft.props.interactive&&ft.state.isVisible&&ft.clearDelayTimeouts()}),br.addEventListener("mouseleave",function(){ft.props.interactive&&ft.props.trigger.indexOf("mouseenter")>=0&&ri().addEventListener("mousemove",xt)}),ft;function kr(){var f=ft.props.touch;return Array.isArray(f)?f:[f,0]}function Ai(){return kr()[0]==="hold"}function $n(){var f;return!((f=ft.props.render)==null||!f.$$tippy)}function ti(){return ie||p}function ri(){var f=ti().parentNode;return f?Nn(f):document}function hn(){return xc(br)}function An(f){return ft.state.isMounted&&!ft.state.isVisible||io.isTouch||N&&N.type==="focus"?0:ye(ft.props.delay,f?0:1,Wo.delay)}function Yi(f){f===void 0&&(f=!1),br.style.pointerEvents=ft.props.interactive&&!f?"":"none",br.style.zIndex=""+ft.props.zIndex}function Ci(f,E,L){var V;L===void 0&&(L=!0),Mn.forEach(function(X){X[f]&&X[f].apply(X,E)}),L&&(V=ft.props)[f].apply(V,E)}function fo(){var f=ft.props.aria;if(f.content){var E="aria-"+f.content,L=br.id;Ae(ft.props.triggerTarget||p).forEach(function(V){var X=V.getAttribute(E);if(ft.state.isVisible)V.setAttribute(E,X?X+" "+L:L);else{var J=X&&X.replace(L,"").trim();J?V.setAttribute(E,J):V.removeAttribute(E)}})}}function Go(){!yn&&ft.props.aria.expanded&&Ae(ft.props.triggerTarget||p).forEach(function(f){ft.props.interactive?f.setAttribute("aria-expanded",ft.state.isVisible&&f===ti()?"true":"false"):f.removeAttribute("aria-expanded")})}function hi(){ri().removeEventListener("mousemove",xt),sc=sc.filter(function(f){return f!==xt})}function zi(f){if(!io.isTouch||!ht&&f.type!=="mousedown"){var E=f.composedPath&&f.composedPath()[0]||f.target;if(!ft.props.interactive||!En(br,E)){if(Ae(ft.props.triggerTarget||p).some(function(L){return En(L,E)})){if(io.isTouch||ft.state.isVisible&&ft.props.trigger.indexOf("click")>=0)return}else Ci("onClickOutside",[ft,f]);ft.props.hideOnClick===!0&&(ft.clearDelayTimeouts(),ft.hide(),Ge=!0,setTimeout(function(){Ge=!1}),ft.state.isMounted||ka())}}}function Vo(){ht=!0}function Ka(){ht=!1}function ta(){var f=ri();f.addEventListener("mousedown",zi,!0),f.addEventListener("touchend",zi,le),f.addEventListener("touchstart",Ka,le),f.addEventListener("touchmove",Vo,le)}function ka(){var f=ri();f.removeEventListener("mousedown",zi,!0),f.removeEventListener("touchend",zi,le),f.removeEventListener("touchstart",Ka,le),f.removeEventListener("touchmove",Vo,le)}function ca(f,E){var L=hn().box;function V(X){X.target===L&&(bn(L,"remove",V),E())}if(f===0)return E();bn(L,"remove",W),bn(L,"add",V),W=V}function Eo(f,E,L){L===void 0&&(L=!1),Ae(ft.props.triggerTarget||p).forEach(function(V){V.addEventListener(f,E,L),St.push({node:V,eventType:f,handler:E,options:L})})}function Pa(){var f;Ai()&&(Eo("touchstart",ha,{passive:!0}),Eo("touchend",Ls,{passive:!0})),(f=ft.props.trigger,f.split(/\s+/).filter(Boolean)).forEach(function(E){if(E!=="manual")switch(Eo(E,ha),E){case"mouseenter":Eo("mouseleave",Ls);break;case"focus":Eo(Ga?"focusout":"blur",Ea);break;case"focusin":Eo("focusout",Ea)}})}function na(){St.forEach(function(f){f.node.removeEventListener(f.eventType,f.handler,f.options)}),St=[]}function ha(f){var E,L=!1;if(ft.state.isEnabled&&!ws(f)&&!Ge){var V=((E=N)==null?void 0:E.type)==="focus";N=f,ie=f.currentTarget,Go(),!ft.state.isVisible&&Sr(f)&&sc.forEach(function(X){return X(f)}),f.type==="click"&&(0>ft.props.trigger.indexOf("mouseenter")||ke)&&ft.props.hideOnClick!==!1&&ft.state.isVisible?L=!0:c(f),f.type==="click"&&(ke=!L),L&&!V&&o(f)}}function Xs(f){var E=f.target,L=ti().contains(E)||br.contains(E);if(f.type!=="mousemove"||!L){var V=cu().concat(br).map(function(X){var J,oe=(J=X._tippy.popperInstance)==null?void 0:J.state;return oe?{popperRect:X.getBoundingClientRect(),popperState:oe,props:we}:null}).filter(Boolean);(function(X,J){var oe=J.clientX,me=J.clientY;return X.every(function(Me){var De=Me.popperRect,Ye=Me.popperState,ot=Me.props.interactiveBorder,lt=Ye.placement.split("-")[0],Ct=Ye.modifiersData.offset;return!Ct||De.top-me+(lt==="bottom"?Ct.top.y:0)>ot||me-De.bottom-(lt==="top"?Ct.bottom.y:0)>ot||De.left-oe+(lt==="right"?Ct.left.x:0)>ot||oe-De.right-(lt==="left"?Ct.right.x:0)>ot})})(V,f)&&(hi(),o(f))}}function Ls(f){ws(f)||ft.props.trigger.indexOf("click")>=0&&ke||(ft.props.interactive?ft.hideWithInteractivity(f):o(f))}function Ea(f){0>ft.props.trigger.indexOf("focusin")&&f.target!==ti()||ft.props.interactive&&f.relatedTarget&&br.contains(f.relatedTarget)||o(f)}function ws(f){return!!io.isTouch&&Ai()!==f.type.indexOf("touch")>=0}function qs(){ua();var f=ft.props,E=f.popperOptions,L=f.placement,V=f.offset,X=f.getReferenceClientRect,J=f.moveTransition,oe=$n()?xc(br).arrow:null,me=X?{getBoundingClientRect:X,contextElement:X.contextElement||ti()}:p,Me={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ye){var ot=Ye.state;if($n()){var lt=hn().box;["placement","reference-hidden","escaped"].forEach(function(Ct){Ct==="placement"?lt.setAttribute("data-placement",ot.placement):ot.attributes.popper["data-popper-"+Ct]?lt.setAttribute("data-"+Ct,""):lt.removeAttribute("data-"+Ct)}),ot.attributes.popper={}}}},De=[{name:"offset",options:{offset:V}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!J}},Me];$n()&&oe&&De.push({name:"arrow",options:{element:oe,padding:3}}),De.push.apply(De,(E==null?void 0:E.modifiers)||[]),ft.popperInstance=Ji(me,br,Object.assign({},E,{placement:L,onFirstUpdate:$,modifiers:De}))}function ua(){ft.popperInstance&&(ft.popperInstance.destroy(),ft.popperInstance=null)}function cu(){return wt(br.querySelectorAll("[data-tippy-root]"))}function c(f){ft.clearDelayTimeouts(),f&&Ci("onTrigger",[ft,f]),ta();var E=An(!0),L=kr(),V=L[1];io.isTouch&&L[0]==="hold"&&V&&(E=V),E?m=setTimeout(function(){ft.show()},E):ft.show()}function o(f){if(ft.clearDelayTimeouts(),Ci("onUntrigger",[ft,f]),ft.state.isVisible){if(0>ft.props.trigger.indexOf("mouseenter")||0>ft.props.trigger.indexOf("click")||0>["mouseleave","mousemove"].indexOf(f.type)||!ke){var E=An(!1);E?w=setTimeout(function(){ft.state.isVisible&&ft.hide()},E):D=requestAnimationFrame(function(){ft.hide()})}}else ka()}}function Zo(p,v){v===void 0&&(v={});var m=Wo.plugins.concat(v.plugins||[]);document.addEventListener("touchstart",Ao,le),window.addEventListener("blur",Ho);var w=Object.assign({},v,{plugins:m}),D=fn(p).reduce(function(N,W){var $=W&&oa(W,w);return $&&N.push($),N},[]);return mr(p)?D[0]:D}Zo.defaultProps=Wo,Zo.setDefaultProps=function(p){Object.keys(p).forEach(function(v){Wo[v]=p[v]})},Zo.currentInput=io,Object.assign({},Jr,{effect:function(p){var v=p.state,m={popper:{position:v.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(v.elements.popper.style,m.popper),v.styles=m,v.elements.arrow&&Object.assign(v.elements.arrow.style,m.arrow)}});var il={clientX:0,clientY:0},va=[];function El(p){il={clientX:p.clientX,clientY:p.clientY}}var Wa={name:"followCursor",defaultValue:!1,fn:function(p){var v=p.reference,m=Nn(p.props.triggerTarget||v),w=!1,D=!1,N=!0,W=p.props;function $(){return p.props.followCursor==="initial"&&p.state.isVisible}function ie(){m.addEventListener("mousemove",ke)}function pe(){m.removeEventListener("mousemove",ke)}function we(){w=!0,p.setProps({getReferenceClientRect:null}),w=!1}function ke(mt){var St=!mt.target||v.contains(mt.target),xt=p.props.followCursor,bt=mt.clientX,kt=mt.clientY,ft=v.getBoundingClientRect(),nr=bt-ft.left,br=kt-ft.top;!St&&p.props.interactive||p.setProps({getReferenceClientRect:function(){var Pr=v.getBoundingClientRect(),Mn=bt,yn=kt;xt==="initial"&&(Mn=Pr.left+nr,yn=Pr.top+br);var kr=xt==="horizontal"?Pr.top:yn,Ai=xt==="vertical"?Pr.right:Mn,$n=xt==="horizontal"?Pr.bottom:yn,ti=xt==="vertical"?Pr.left:Mn;return{width:Ai-ti,height:$n-kr,top:kr,right:Ai,bottom:$n,left:ti}}})}function Ge(){p.props.followCursor&&(va.push({instance:p,doc:m}),function(mt){mt.addEventListener("mousemove",El)}(m))}function ht(){(va=va.filter(function(mt){return mt.instance!==p})).filter(function(mt){return mt.doc===m}).length===0&&function(mt){mt.removeEventListener("mousemove",El)}(m)}return{onCreate:Ge,onDestroy:ht,onBeforeUpdate:function(){W=p.props},onAfterUpdate:function(mt,St){var xt=St.followCursor;w||xt!==void 0&&W.followCursor!==xt&&(ht(),xt?(Ge(),!p.state.isMounted||D||$()||ie()):(pe(),we()))},onMount:function(){p.props.followCursor&&!D&&(N&&(ke(il),N=!1),$()||ie())},onTrigger:function(mt,St){Sr(St)&&(il={clientX:St.clientX,clientY:St.clientY}),D=St.type==="focus"},onHidden:function(){p.props.followCursor&&(we(),pe(),N=!0)}}}};Zo.setDefaultProps({render:Ba});var Ds,Rl,gu,gl,wl,ol,Qa={showTotalDistance:!1,showDashDistance:!0,showWhen:["normal","active"],format:function(p){return 1e3>p?+p.toFixed(2)+"m":+(p/1e3).toFixed(2)+"km"}},Gl={showWhen:["normal","active"],format:function(p){return p>1e6?"".concat(+(p/1e6).toFixed(2),"km\xB2"):"".concat(+p.toFixed(2),"m\xB2")}},Wl={maxSize:100},ut={remove:["del","backspace"],revert:["command+z","ctrl+z"],redo:["command+shift+z","ctrl+shift+z"]},At={allowHTML:!0,followCursor:!0,placement:"bottom-start",offset:[-10,20],plugins:[Wa],trigger:"manual",hideOnClick:!1,theme:"light"},ir={data:"drawData",pointAdsorbPixel:12,lineAdsorbPixel:10},jr={dotDuration:100,dotDistance:30};function Dn(p,v,m){return v=Ni(v),function(w,D){if(D&&(typeof D=="object"||typeof D=="function"))return D;if(D!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ku(w)}(p,oo()?Reflect.construct(v,m||[],Ni(p).constructor):v.apply(p,m))}function oo(){try{var p=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(v){}return(oo=function(){return!!p})()}function Xa(p,v){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(p);v&&(w=w.filter(function(D){return Object.getOwnPropertyDescriptor(p,D).enumerable})),m.push.apply(m,w)}return m}function mn(p){for(var v=1;arguments.length>v;v++){var m=arguments[v]!=null?arguments[v]:{};v%2?Xa(Object(m),!0).forEach(function(w){Va(p,w,m[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):Xa(Object(m)).forEach(function(w){Object.defineProperty(p,w,Object.getOwnPropertyDescriptor(m,w))})}return p}function kl(p){var v=function(m,w){if(typeof m!="object"||!m)return m;var D=m[Symbol.toPrimitive];if(D!==void 0){var N=D.call(m,w||"default");if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(m)}(p,"string");return typeof v=="symbol"?v:v+""}function Il(p){return Il=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},Il(p)}function Ia(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function Xh(p,v){for(var m=0;v.length>m;m++){var w=v[m];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(p,kl(w.key),w)}}function Sl(p,v,m){return v&&Xh(p.prototype,v),m&&Xh(p,m),Object.defineProperty(p,"prototype",{writable:!1}),p}function Va(p,v,m){return(v=kl(v))in p?Object.defineProperty(p,v,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[v]=m,p}function Aa(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),Object.defineProperty(p,"prototype",{writable:!1}),v&&lc(p,v)}function Ni(p){return Ni=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(v){return v.__proto__||Object.getPrototypeOf(v)},Ni(p)}function lc(p,v){return lc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,w){return m.__proto__=w,m},lc(p,v)}function Ku(p){if(p===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p}function lo(){return lo=typeof Reflect!="undefined"&&Reflect.get?Reflect.get.bind():function(p,v,m){var w=function(N,W){for(;!Object.prototype.hasOwnProperty.call(N,W)&&(N=Ni(N))!==null;);return N}(p,v);if(w){var D=Object.getOwnPropertyDescriptor(w,v);return D.get?D.get.call(3>arguments.length?p:m):D.value}},lo.apply(this,arguments)}function bs(p,v){return function(m){if(Array.isArray(m))return m}(p)||function(m,w){var D=m==null?null:typeof Symbol!="undefined"&&m[Symbol.iterator]||m["@@iterator"];if(D!=null){var N,W,$,ie,pe=[],we=!0,ke=!1;try{if($=(D=D.call(m)).next,w===0){if(Object(D)!==D)return;we=!1}else for(;!(we=(N=$.call(D)).done)&&(pe.push(N.value),pe.length!==w);we=!0);}catch(Ge){ke=!0,W=Ge}finally{try{if(!we&&D.return!=null&&(ie=D.return(),Object(ie)!==ie))return}finally{if(ke)throw W}}return pe}}(p,v)||Nl(p,v)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Os(p){return function(v){if(Array.isArray(v))return Io(v)}(p)||function(v){if(typeof Symbol!="undefined"&&v[Symbol.iterator]!=null||v["@@iterator"]!=null)return Array.from(v)}(p)||Nl(p)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Nl(p,v){if(p){if(typeof p=="string")return Io(p,v);var m=Object.prototype.toString.call(p).slice(8,-1);return m==="Object"&&p.constructor&&(m=p.constructor.name),m==="Map"||m==="Set"?Array.from(p):m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m)?Io(p,v):void 0}}function Io(p,v){(v==null||v>p.length)&&(v=p.length);for(var m=0,w=Array(v);v>m;m++)w[m]=p[m];return w}(Ds=ve.DrawEvent||(ve.DrawEvent={})).Init="init",Ds.Destroy="destroy",Ds.Enable="enable",Ds.Disable="disable",Ds.Add="add",Ds.Edit="edit",Ds.Remove="remove",Ds.Clear="clear",Ds.Change="change",Ds.DragStart="dragStart",Ds.Dragging="dragging",Ds.DragEnd="dragEnd",Ds.Select="select",Ds.AddNode="addNode",Ds.RemoveNode="removeNode",(Rl=ve.SourceEvent||(ve.SourceEvent={})).Change="change",Rl.Update="update",(gu=ve.RenderEvent||(ve.RenderEvent={})).Click="click",gu.UnClick="unclick",gu.Dragstart="dragstart",gu.Mousemove="mousemove",gu.Mouseout="mouseout",gu.Dragging="dragging",gu.Dragend="dragend",gu.DblClick="dblClick",gu.Contextmenu="contextmenu",(gl=ve.LayerEvent||(ve.LayerEvent={})).Mousedown="mousedown",gl.Mouseup="mouseup",gl.Click="click",gl.UnClick="unclick",gl.Dblclick="dblclick",gl.Mousemove="mousemove",gl.Mouseover="mouseover",gl.Mouseenter="mouseenter",gl.Mouseleave="mouseleave",gl.Mouseout="mouseout",gl.Contextmenu="contextmenu",(wl=ve.SceneEvent||(ve.SceneEvent={})).Loaded="loaded",wl.MapMove="mapmove",wl.MoveStart="movestart",wl.MoveEnd="moveend",wl.ZoomChange="zoomchange",wl.ZoomStart="zoomstart",wl.ZoomEnd="zoomend",wl.Click="click",wl.Dblclick="dblclick",wl.Mousemove="mousemove",wl.Mousewheel="mousewheel",wl.Mouseover="mouseover",wl.Mouseout="mouseout",wl.Mouseup="mouseup",wl.Mousedown="mousedown",wl.Contextmenu="contextmenu",wl.Dragstart="dragstart",wl.Dragging="dragging",wl.Dragend="dragend",(ol=ve.ControlEvent||(ve.ControlEvent={})).DrawChange="drawchange",ol.DataChange="datachange",ol.DrawSelect="drawselect",ol.DrawClear="drawclear";var eu=63710088e-1,Tl={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260511392e-6,inches:39.37*eu,kilometers:6371.0088,kilometres:6371.0088,meters:eu,metres:eu,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:eu/1852,radians:1,yards:6967335223679999e-9},Fu={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Ju(p,v,m){m===void 0&&(m={});var w={type:"Feature"};return(m.id===0||m.id)&&(w.id=m.id),m.bbox&&(w.bbox=m.bbox),w.properties=v||{},w.geometry=p,w}function al(p,v,m){if(m===void 0&&(m={}),!p)throw Error("coordinates is required");if(!Array.isArray(p))throw Error("coordinates must be an Array");if(2>p.length)throw Error("coordinates must be at least 2 numbers long");if(!Jc(p[0])||!Jc(p[1]))throw Error("coordinates must contain numbers");return Ju({type:"Point",coordinates:p},v,m)}function Kc(p,v,m){m===void 0&&(m={});for(var w=0,D=p;D.length>w;w++){var N=D[w];if(4>N.length)throw Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var W=0;N[N.length-1].length>W;W++)if(N[N.length-1][W]!==N[0][W])throw Error("First and last Position are not equivalent.")}return Ju({type:"Polygon",coordinates:p},v,m)}function ou(p,v,m){if(m===void 0&&(m={}),2>p.length)throw Error("coordinates must be an array of two or more positions");return Ju({type:"LineString",coordinates:p},v,m)}function Ks(p,v){v===void 0&&(v={});var m={type:"FeatureCollection"};return v.id&&(m.id=v.id),v.bbox&&(m.bbox=v.bbox),m.features=p,m}function Lp(p,v,m){return m===void 0&&(m={}),Ju({type:"MultiLineString",coordinates:p},v,m)}function gf(p,v,m){return m===void 0&&(m={}),Ju({type:"MultiPoint",coordinates:p},v,m)}function Of(p,v,m){return m===void 0&&(m={}),Ju({type:"MultiPolygon",coordinates:p},v,m)}function qh(p,v){v===void 0&&(v="kilometers");var m=Tl[v];if(!m)throw Error(v+" units is invalid");return p*m}function zc(p,v){v===void 0&&(v="kilometers");var m=Tl[v];if(!m)throw Error(v+" units is invalid");return p/m}function Oh(p){return 180*(p%(2*Math.PI))/Math.PI}function Ms(p){return p%360*Math.PI/180}function Jc(p){return!isNaN(p)&&p!==null&&!Array.isArray(p)}function Yh(p){return!!p&&p.constructor===Object}var Qc=Object.freeze({__proto__:null,earthRadius:eu,factors:Tl,unitsFactors:{centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/eu,yards:1.0936133},areaFactors:Fu,feature:Ju,geometry:function(p,v,m){switch(p){case"Point":return al(v).geometry;case"LineString":return ou(v).geometry;case"Polygon":return Kc(v).geometry;case"MultiPoint":return gf(v).geometry;case"MultiLineString":return Lp(v).geometry;case"MultiPolygon":return Of(v).geometry;default:throw Error(p+" is invalid")}},point:al,points:function(p,v,m){return m===void 0&&(m={}),Ks(p.map(function(w){return al(w,v)}),m)},polygon:Kc,polygons:function(p,v,m){return m===void 0&&(m={}),Ks(p.map(function(w){return Kc(w,v)}),m)},lineString:ou,lineStrings:function(p,v,m){return m===void 0&&(m={}),Ks(p.map(function(w){return ou(w,v)}),m)},featureCollection:Ks,multiLineString:Lp,multiPoint:gf,multiPolygon:Of,geometryCollection:function(p,v,m){return m===void 0&&(m={}),Ju({type:"GeometryCollection",geometries:p},v,m)},round:function(p,v){if(v===void 0&&(v=0),v&&v<0)throw Error("precision must be a positive number");var m=Math.pow(10,v||0);return Math.round(p*m)/m},radiansToLength:qh,lengthToRadians:zc,lengthToDegrees:function(p,v){return Oh(zc(p,v))},bearingToAzimuth:function(p){var v=p%360;return 0>v&&(v+=360),v},radiansToDegrees:Oh,degreesToRadians:Ms,convertLength:function(p,v,m){if(v===void 0&&(v="kilometers"),m===void 0&&(m="kilometers"),p<0)throw Error("length must be a positive number");return qh(zc(p,v),m)},convertArea:function(p,v,m){if(v===void 0&&(v="meters"),m===void 0&&(m="kilometers"),p<0)throw Error("area must be a positive number");var w=Fu[v];if(!w)throw Error("invalid original units");var D=Fu[m];if(!D)throw Error("invalid final units");return p/w*D},isNumber:Jc,isObject:Yh,validateBBox:function(p){if(!p)throw Error("bbox is required");if(!Array.isArray(p))throw Error("bbox must be an Array");if(p.length!==4&&p.length!==6)throw Error("bbox must be an Array of 4 or 6 numbers");p.forEach(function(v){if(!Jc(v))throw Error("bbox must only contain numbers")})},validateId:function(p){if(!p)throw Error("id is required");if(["string","number"].indexOf(typeof p)===-1)throw Error("id must be a number or a string")}});function uc(p,v,m){if(p!==null)for(var w,D,N,W,$,ie,pe,we,ke=0,Ge=0,ht=p.type,mt=ht==="FeatureCollection",St=ht==="Feature",xt=mt?p.features.length:1,bt=0;xt>bt;bt++){$=(we=!!(pe=mt?p.features[bt].geometry:St?p.geometry:p)&&pe.type==="GeometryCollection")?pe.geometries.length:1;for(var kt=0;$>kt;kt++){var ft=0,nr=0;if((W=we?pe.geometries[kt]:pe)!==null){ie=W.coordinates;var br=W.type;switch(ke=!m||br!=="Polygon"&&br!=="MultiPolygon"?0:1,br){case null:break;case"Point":if(v(ie,Ge,bt,ft,nr)===!1)return!1;Ge++,ft++;break;case"LineString":case"MultiPoint":for(w=0;ie.length>w;w++){if(v(ie[w],Ge,bt,ft,nr)===!1)return!1;Ge++,br==="MultiPoint"&&ft++}br==="LineString"&&ft++;break;case"Polygon":case"MultiLineString":for(w=0;ie.length>w;w++){for(D=0;ie[w].length-ke>D;D++){if(v(ie[w][D],Ge,bt,ft,nr)===!1)return!1;Ge++}br==="MultiLineString"&&ft++,br==="Polygon"&&nr++}br==="Polygon"&&ft++;break;case"MultiPolygon":for(w=0;ie.length>w;w++){for(nr=0,D=0;ie[w].length>D;D++){for(N=0;ie[w][D].length-ke>N;N++){if(v(ie[w][D][N],Ge,bt,ft,nr)===!1)return!1;Ge++}nr++}ft++}break;case"GeometryCollection":for(w=0;W.geometries.length>w;w++)if(uc(W.geometries[w],v,m)===!1)return!1;break;default:throw Error("Unknown Geometry Type")}}}}}function eh(p,v){var m;switch(p.type){case"FeatureCollection":for(m=0;p.features.length>m&&v(p.features[m].properties,m)!==!1;m++);break;case"Feature":v(p.properties,0)}}function yh(p,v){if(p.type==="Feature")v(p,0);else if(p.type==="FeatureCollection")for(var m=0;p.features.length>m&&v(p.features[m],m)!==!1;m++);}function sl(p){var v=[];return uc(p,function(m){v.push(m)}),v}function Uc(p,v){var m,w,D,N,W,$,ie,pe,we,ke,Ge=0,ht=p.type==="FeatureCollection",mt=p.type==="Feature",St=ht?p.features.length:1;for(m=0;St>m;m++){for(pe=ht?p.features[m].properties:mt?p.properties:{},we=ht?p.features[m].bbox:mt?p.bbox:void 0,ke=ht?p.features[m].id:mt?p.id:void 0,W=(ie=!!($=ht?p.features[m].geometry:mt?p.geometry:p)&&$.type==="GeometryCollection")?$.geometries.length:1,D=0;W>D;D++)if((N=ie?$.geometries[D]:$)!==null)switch(N.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(v(N,Ge,pe,we,ke)===!1)return!1;break;case"GeometryCollection":for(w=0;N.geometries.length>w;w++)if(v(N.geometries[w],Ge,pe,we,ke)===!1)return!1;break;default:throw Error("Unknown Geometry Type")}else if(v(null,Ge,pe,we,ke)===!1)return!1;Ge++}}function bc(p,v,m){var w=m;return Uc(p,function(D,N,W,$,ie){w=N===0&&m===void 0?D:v(w,D,N,W,$,ie)}),w}function fp(p,v){Uc(p,function(m,w,D,N,W){var $,ie=m===null?null:m.type;switch(ie){case null:case"Point":case"LineString":case"Polygon":return v(Ju(m,D,{bbox:N,id:W}),w,0)!==!1&&void 0}switch(ie){case"MultiPoint":$="Point";break;case"MultiLineString":$="LineString";break;case"MultiPolygon":$="Polygon"}for(var pe=0;m.coordinates.length>pe;pe++)if(v(Ju({type:$,coordinates:m.coordinates[pe]},D),w,pe)===!1)return!1})}function dp(p,v){fp(p,function(m,w,D){var N=0;if(m.geometry){var W=m.geometry.type;if(W!=="Point"&&W!=="MultiPoint"){var $,ie=0,pe=0,we=0;return uc(m,function(ke,Ge,ht,mt,St){if($===void 0||w>ie||mt>pe||St>we)return $=ke,ie=w,pe=mt,we=St,void(N=0);var xt=ou([$,ke],m.properties);if(v(xt,w,D,St,N)===!1)return!1;N++,$=ke})!==!1&&void 0}}})}function Ps(p,v,m){var w=m,D=!1;return dp(p,function(N,W,$,ie,pe){w=D===!1&&m===void 0?N:v(w,N,W,$,ie,pe),D=!0}),w}function Gf(p,v){if(!p)throw Error("geojson is required");fp(p,function(m,w,D){if(m.geometry!==null){var N=m.geometry.coordinates;switch(m.geometry.type){case"LineString":if(v(m,w,D,0,0)===!1)return!1;break;case"Polygon":for(var W=0;N.length>W;W++)if(v(ou(N[W],m.properties),w,D,W)===!1)return!1}}})}var Xp=Object.freeze({__proto__:null,coordAll:sl,coordEach:uc,coordReduce:function(p,v,m,w){var D=m;return uc(p,function(N,W,$,ie,pe){D=W===0&&m===void 0?N:v(D,N,W,$,ie,pe)},w),D},featureEach:yh,featureReduce:function(p,v,m){var w=m;return yh(p,function(D,N){w=N===0&&m===void 0?D:v(w,D,N)}),w},findPoint:function(p,v){if(!Yh(v=v||{}))throw Error("options is invalid");var m,w=v.featureIndex||0,D=v.multiFeatureIndex||0,N=v.geometryIndex||0,W=v.coordIndex||0,$=v.properties;switch(p.type){case"FeatureCollection":0>w&&(w=p.features.length+w),$=$||p.features[w].properties,m=p.features[w].geometry;break;case"Feature":$=$||p.properties,m=p.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":m=p;break;default:throw Error("geojson is invalid")}if(m===null)return null;var ie=m.coordinates;switch(m.type){case"Point":return al(ie,$,v);case"MultiPoint":return 0>D&&(D=ie.length+D),al(ie[D],$,v);case"LineString":return 0>W&&(W=ie.length+W),al(ie[W],$,v);case"Polygon":return 0>N&&(N=ie.length+N),0>W&&(W=ie[N].length+W),al(ie[N][W],$,v);case"MultiLineString":return 0>D&&(D=ie.length+D),0>W&&(W=ie[D].length+W),al(ie[D][W],$,v);case"MultiPolygon":return 0>D&&(D=ie.length+D),0>N&&(N=ie[D].length+N),0>W&&(W=ie[D][N].length-W),al(ie[D][N][W],$,v)}throw Error("geojson is invalid")},findSegment:function(p,v){if(!Yh(v=v||{}))throw Error("options is invalid");var m,w=v.featureIndex||0,D=v.multiFeatureIndex||0,N=v.geometryIndex||0,W=v.segmentIndex||0,$=v.properties;switch(p.type){case"FeatureCollection":0>w&&(w=p.features.length+w),$=$||p.features[w].properties,m=p.features[w].geometry;break;case"Feature":$=$||p.properties,m=p.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":m=p;break;default:throw Error("geojson is invalid")}if(m===null)return null;var ie=m.coordinates;switch(m.type){case"Point":case"MultiPoint":return null;case"LineString":return 0>W&&(W=ie.length+W-1),ou([ie[W],ie[W+1]],$,v);case"Polygon":return 0>N&&(N=ie.length+N),0>W&&(W=ie[N].length+W-1),ou([ie[N][W],ie[N][W+1]],$,v);case"MultiLineString":return 0>D&&(D=ie.length+D),0>W&&(W=ie[D].length+W-1),ou([ie[D][W],ie[D][W+1]],$,v);case"MultiPolygon":return 0>D&&(D=ie.length+D),0>N&&(N=ie[D].length+N),0>W&&(W=ie[D][N].length-W-1),ou([ie[D][N][W],ie[D][N][W+1]],$,v)}throw Error("geojson is invalid")},flattenEach:fp,flattenReduce:function(p,v,m){var w=m;return fp(p,function(D,N,W){w=N===0&&W===0&&m===void 0?D:v(w,D,N,W)}),w},geomEach:Uc,geomReduce:bc,lineEach:Gf,lineReduce:function(p,v,m){var w=m;return Gf(p,function(D,N,W,$){w=N===0&&m===void 0?D:v(w,D,N,W,$)}),w},propEach:eh,propReduce:function(p,v,m){var w=m;return eh(p,function(D,N){w=N===0&&m===void 0?D:v(w,D,N)}),w},segmentEach:dp,segmentReduce:Ps});function cc(p){var v=[1/0,1/0,-1/0,-1/0];return uc(p,function(m){v[0]>m[0]&&(v[0]=m[0]),v[1]>m[1]&&(v[1]=m[1]),m[0]>v[2]&&(v[2]=m[0]),m[1]>v[3]&&(v[3]=m[1])}),v}cc.default=cc;var zl=Object.freeze({__proto__:null,default:cc});function Ec(p){if(!p)throw Error("coord is required");if(!Array.isArray(p)){if(p.type==="Feature"&&p.geometry!==null&&p.geometry.type==="Point")return p.geometry.coordinates;if(p.type==="Point")return p.coordinates}if(Array.isArray(p)&&p.length>=2&&!Array.isArray(p[0])&&!Array.isArray(p[1]))return p;throw Error("coord must be GeoJSON Point or an Array of numbers")}function th(p){if(Array.isArray(p))return p;if(p.type==="Feature"){if(p.geometry!==null)return p.geometry.coordinates}else if(p.coordinates)return p.coordinates;throw Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function vu(p){return p.type==="Feature"?p.geometry:p}function xh(p,v){return p.type==="FeatureCollection"?"FeatureCollection":p.type==="GeometryCollection"?"GeometryCollection":p.type==="Feature"&&p.geometry!==null?p.geometry.type:p.type}function qa(p,v,m,w,D){Hs(p,v,m||0,w||p.length-1,D||Na)}function Hs(p,v,m,w,D){for(;w>m;){if(w-m>600){var N=w-m+1,W=v-m+1,$=Math.log(N),ie=.5*Math.exp(2*$/3),pe=.5*Math.sqrt($*ie*(N-ie)/N)*(0>W-N/2?-1:1);Hs(p,v,Math.max(m,Math.floor(v-W*ie/N+pe)),Math.min(w,Math.floor(v+(N-W)*ie/N+pe)),D)}var we=p[v],ke=m,Ge=w;for(Ep(p,m,v),D(p[w],we)>0&&Ep(p,m,w);Ge>ke;){for(Ep(p,ke,Ge),ke++,Ge--;0>D(p[ke],we);)ke++;for(;D(p[Ge],we)>0;)Ge--}D(p[m],we)===0?Ep(p,m,Ge):Ep(p,++Ge,w),Ge>v||(m=Ge+1),v>Ge||(w=Ge-1)}}function Ep(p,v,m){var w=p[v];p[v]=p[m],p[m]=w}function Na(p,v){return v>p?-1:p>v?1:0}function Qu(p,v,m){if(!m)return v.indexOf(p);for(let w=0;v.length>w;w++)if(m(p,v[w]))return w;return-1}function Is(p,v){ys(p,0,p.children.length,v,p)}function ys(p,v,m,w,D){D||(D=Xo(null)),D.minX=1/0,D.minY=1/0,D.maxX=-1/0,D.maxY=-1/0;for(let N=v;m>N;N++){const W=p.children[N];ec(D,p.leaf?w(W):W)}return D}function ec(p,v){return p.minX=Math.min(p.minX,v.minX),p.minY=Math.min(p.minY,v.minY),p.maxX=Math.max(p.maxX,v.maxX),p.maxY=Math.max(p.maxY,v.maxY),p}function Bf(p,v){return p.minX-v.minX}function es(p,v){return p.minY-v.minY}function Bs(p){return(p.maxX-p.minX)*(p.maxY-p.minY)}function wc(p){return p.maxX-p.minX+(p.maxY-p.minY)}function qp(p,v){const m=Math.max(p.minX,v.minX),w=Math.max(p.minY,v.minY),D=Math.min(p.maxX,v.maxX),N=Math.min(p.maxY,v.maxY);return Math.max(0,D-m)*Math.max(0,N-w)}function Sc(p,v){return!(p.minX>v.minX||p.minY>v.minY||v.maxX>p.maxX||v.maxY>p.maxY)}function $h(p,v){return!(v.minX>p.maxX||v.minY>p.maxY||p.minX>v.maxX||p.minY>v.maxY)}function Xo(p){return{children:p,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function au(p,v,m,w,D){const N=[v,m];for(;N.length;){if(w>=(m=N.pop())-(v=N.pop()))continue;const W=v+Math.ceil((m-v)/w/2)*w;qa(p,W,v,m,D),N.push(v,W,W,m)}}var dl=Object.freeze({__proto__:null,default:class{constructor(p=9){this._maxEntries=Math.max(4,p),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(p){let v=this.data;const m=[];if(!$h(p,v))return m;const w=this.toBBox,D=[];for(;v;){for(let N=0;v.children.length>N;N++){const W=v.children[N],$=v.leaf?w(W):W;$h(p,$)&&(v.leaf?m.push(W):Sc(p,$)?this._all(W,m):D.push(W))}v=D.pop()}return m}collides(p){let v=this.data;if(!$h(p,v))return!1;const m=[];for(;v;){for(let w=0;v.children.length>w;w++){const D=v.children[w],N=v.leaf?this.toBBox(D):D;if($h(p,N)){if(v.leaf||Sc(p,N))return!0;m.push(D)}}v=m.pop()}return!1}load(p){if(!p||!p.length)return this;if(this._minEntries>p.length){for(let m=0;p.length>m;m++)this.insert(p[m]);return this}let v=this._build(p.slice(),0,p.length-1,0);if(this.data.children.length)if(this.data.height===v.height)this._splitRoot(this.data,v);else{if(v.height>this.data.height){const m=this.data;this.data=v,v=m}this._insert(v,this.data.height-v.height-1,!0)}else this.data=v;return this}insert(p){return p&&this._insert(p,this.data.height-1),this}clear(){return this.data=Xo([]),this}remove(p,v){if(!p)return this;let m=this.data;const w=this.toBBox(p),D=[],N=[];let W,$,ie;for(;m||D.length;){if(m||(m=D.pop(),$=D[D.length-1],W=N.pop(),ie=!0),m.leaf){const pe=Qu(p,m.children,v);if(pe!==-1)return m.children.splice(pe,1),D.push(m),this._condense(D),this}ie||m.leaf||!Sc(m,w)?$?(W++,m=$.children[W],ie=!1):m=null:(D.push(m),N.push(W),W=0,$=m,m=m.children[0])}return this}toBBox(p){return p}compareMinX(p,v){return p.minX-v.minX}compareMinY(p,v){return p.minY-v.minY}toJSON(){return this.data}fromJSON(p){return this.data=p,this}_all(p,v){const m=[];for(;p;)p.leaf?v.push(...p.children):m.push(...p.children),p=m.pop();return v}_build(p,v,m,w){const D=m-v+1;let N,W=this._maxEntries;if(W>=D)return N=Xo(p.slice(v,m+1)),Is(N,this.toBBox),N;w||(W=Math.ceil(D/Math.pow(W,(w=Math.ceil(Math.log(D)/Math.log(W)))-1))),N=Xo([]),N.leaf=!1,N.height=w;const $=Math.ceil(D/W),ie=$*Math.ceil(Math.sqrt(W));au(p,v,m,ie,this.compareMinX);for(let pe=v;m>=pe;pe+=ie){const we=Math.min(pe+ie-1,m);au(p,pe,we,$,this.compareMinY);for(let ke=pe;we>=ke;ke+=$)N.children.push(this._build(p,ke,Math.min(ke+$-1,we),w-1))}return Is(N,this.toBBox),N}_chooseSubtree(p,v,m,w){for(;w.push(v),!v.leaf&&w.length-1!==m;){let W,$=1/0,ie=1/0;for(let pe=0;v.children.length>pe;pe++){const we=v.children[pe],ke=Bs(we),Ge=(Math.max((N=we).maxX,(D=p).maxX)-Math.min(N.minX,D.minX))*(Math.max(N.maxY,D.maxY)-Math.min(N.minY,D.minY))-ke;ie>Ge?(ie=Ge,$=$>ke?ke:$,W=we):Ge===ie&&$>ke&&($=ke,W=we)}v=W||v.children[0]}var D,N;return v}_insert(p,v,m){const w=m?p:this.toBBox(p),D=[],N=this._chooseSubtree(w,this.data,v,D);for(N.children.push(p),ec(N,w);v>=0&&D[v].children.length>this._maxEntries;)this._split(D,v),v--;this._adjustParentBBoxes(w,D,v)}_split(p,v){const m=p[v],w=m.children.length,D=this._minEntries;this._chooseSplitAxis(m,D,w);const N=this._chooseSplitIndex(m,D,w),W=Xo(m.children.splice(N,m.children.length-N));W.height=m.height,W.leaf=m.leaf,Is(m,this.toBBox),Is(W,this.toBBox),v?p[v-1].children.push(W):this._splitRoot(m,W)}_splitRoot(p,v){this.data=Xo([p,v]),this.data.height=p.height+1,this.data.leaf=!1,Is(this.data,this.toBBox)}_chooseSplitIndex(p,v,m){let w,D=1/0,N=1/0;for(let W=v;m-v>=W;W++){const $=ys(p,0,W,this.toBBox),ie=ys(p,W,m,this.toBBox),pe=qp($,ie),we=Bs($)+Bs(ie);D>pe?(D=pe,w=W,N=N>we?we:N):pe===D&&N>we&&(N=we,w=W)}return w||m-v}_chooseSplitAxis(p,v,m){const w=p.leaf?this.compareMinX:Bf,D=p.leaf?this.compareMinY:es,N=this._allDistMargin(p,v,m,w);this._allDistMargin(p,v,m,D)>N&&p.children.sort(w)}_allDistMargin(p,v,m,w){p.children.sort(w);const D=this.toBBox,N=ys(p,0,v,D),W=ys(p,m-v,m,D);let $=wc(N)+wc(W);for(let ie=v;m-v>ie;ie++){const pe=p.children[ie];ec(N,p.leaf?D(pe):pe),$+=wc(N)}for(let ie=m-v-1;ie>=v;ie--){const pe=p.children[ie];ec(W,p.leaf?D(pe):pe),$+=wc(W)}return $}_adjustParentBBoxes(p,v,m){for(let w=m;w>=0;w--)ec(v[w],p)}_condense(p){for(let v,m=p.length-1;m>=0;m--)p[m].children.length===0?m>0?(v=p[m-1].children,v.splice(v.indexOf(p[m]),1)):this.clear():Is(p[m],this.toBBox)}}});function tc(p,v){return v>p?-1:p>v?1:0}var bh=Object.freeze({__proto__:null,default:class{constructor(p=[],v=tc){if(this.data=p,this.length=this.data.length,this.compare=v,this.length>0)for(let m=(this.length>>1)-1;m>=0;m--)this._down(m)}push(p){this.data.push(p),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const p=this.data[0],v=this.data.pop();return this.length--,this.length>0&&(this.data[0]=v,this._down(0)),p}peek(){return this.data[0]}_up(p){const{data:v,compare:m}=this,w=v[p];for(;p>0;){const D=p-1>>1,N=v[D];if(m(w,N)>=0)break;v[p]=N,p=D}v[p]=w}_down(p){const{data:v,compare:m}=this,w=this.length>>1,D=v[p];for(;w>p;){let N=1+(p<<1),W=v[N];const $=N+1;if(this.length>$&&0>m(v[$],W)&&(N=$,W=v[$]),m(W,D)>=0)break;v[p]=W,p=N}v[p]=D}}}),mp=function(p,v,m,w){var D=p[0],N=p[1],W=!1;m===void 0&&(m=0),w===void 0&&(w=v.length);for(var $=(w-m)/2,ie=0,pe=$-1;$>ie;pe=ie++){var we=v[m+2*ie+0],ke=v[m+2*ie+1],Ge=v[m+2*pe+1];ke>N!=Ge>N&&(v[m+2*pe+0]-we)*(N-ke)/(Ge-ke)+we>D&&(W=!W)}return W},Kh=function(p,v,m,w){var D=p[0],N=p[1],W=!1;m===void 0&&(m=0),w===void 0&&(w=v.length);for(var $=w-m,ie=0,pe=$-1;$>ie;pe=ie++){var we=v[ie+m][0],ke=v[ie+m][1],Ge=v[pe+m][1];ke>N!=Ge>N&&(v[pe+m][0]-we)*(N-ke)/(Ge-ke)+we>D&&(W=!W)}return W},Zc=function(p,v,m,w){return v.length>0&&Array.isArray(v[0])?Kh(p,v,m,w):mp(p,v,m,w)},vf=mp;Zc.nested=Kh,Zc.flat=vf;var Bh=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof Se.g!="undefined"?Se.g:typeof self!="undefined"?self:{};function _u(p,v,m){return p(m={path:v,exports:{},require:function(w,D){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},m.exports),m.exports}function Vc(p){if(p.__esModule)return p;var v=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(p).forEach(function(m){var w=Object.getOwnPropertyDescriptor(p,m);Object.defineProperty(v,m,w.get?w:{enumerable:!0,get:function(){return p[m]}})}),v}var Yp=_u(function(p,v){(function(m){const D=33306690738754706e-32;function N(St,xt,bt,kt,ft){let nr,br,Pr,Mn,yn=xt[0],kr=kt[0],Ai=0,$n=0;kr>yn==kr>-yn?(nr=yn,yn=xt[++Ai]):(nr=kr,kr=kt[++$n]);let ti=0;if(St>Ai&&bt>$n)for(kr>yn==kr>-yn?(Pr=nr-((br=yn+nr)-yn),yn=xt[++Ai]):(Pr=nr-((br=kr+nr)-kr),kr=kt[++$n]),nr=br,Pr!==0&&(ft[ti++]=Pr);St>Ai&&bt>$n;)kr>yn==kr>-yn?(Pr=nr-((br=nr+yn)-(Mn=br-nr))+(yn-Mn),yn=xt[++Ai]):(Pr=nr-((br=nr+kr)-(Mn=br-nr))+(kr-Mn),kr=kt[++$n]),nr=br,Pr!==0&&(ft[ti++]=Pr);for(;St>Ai;)Pr=nr-((br=nr+yn)-(Mn=br-nr))+(yn-Mn),yn=xt[++Ai],nr=br,Pr!==0&&(ft[ti++]=Pr);for(;bt>$n;)Pr=nr-((br=nr+kr)-(Mn=br-nr))+(kr-Mn),kr=kt[++$n],nr=br,Pr!==0&&(ft[ti++]=Pr);return nr===0&&ti!==0||(ft[ti++]=nr),ti}function W(St){return new Float64Array(St)}const $=33306690738754716e-32,ie=22204460492503146e-32,pe=11093356479670487e-47,we=W(4),ke=W(8),Ge=W(12),ht=W(16),mt=W(4);m.orient2d=function(St,xt,bt,kt,ft,nr){const br=(xt-nr)*(bt-ft),Pr=(St-ft)*(kt-nr),Mn=br-Pr;if(br===0||Pr===0||br>0!=Pr>0)return Mn;const yn=Math.abs(br+Pr);return $*yn>Math.abs(Mn)?-function(kr,Ai,$n,ti,ri,hn,An){let Yi,Ci,fo,Go,hi,zi,Vo,Ka,ta,ka,ca,Eo,Pa,na,ha,Xs,Ls,Ea;const ws=kr-ri,qs=$n-ri,ua=Ai-hn,cu=ti-hn;hi=(ha=(Ka=ws-(Vo=(zi=134217729*ws)-(zi-ws)))*(ka=cu-(ta=(zi=134217729*cu)-(zi-cu)))-((na=ws*cu)-Vo*ta-Ka*ta-Vo*ka))-(ca=ha-(Ls=(Ka=ua-(Vo=(zi=134217729*ua)-(zi-ua)))*(ka=qs-(ta=(zi=134217729*qs)-(zi-qs)))-((Xs=ua*qs)-Vo*ta-Ka*ta-Vo*ka))),we[0]=ha-(ca+hi)+(hi-Ls),hi=(Pa=na-((Eo=na+ca)-(hi=Eo-na))+(ca-hi))-(ca=Pa-Xs),we[1]=Pa-(ca+hi)+(hi-Xs),hi=(Ea=Eo+ca)-Eo,we[2]=Eo-(Ea-hi)+(ca-hi),we[3]=Ea;let c=function(V,X){let J=X[0];for(let oe=1;V>oe;oe++)J+=X[oe];return J}(4,we),o=ie*An;if(c>=o||-c>=o||(Yi=kr-(ws+(hi=kr-ws))+(hi-ri),fo=$n-(qs+(hi=$n-qs))+(hi-ri),Ci=Ai-(ua+(hi=Ai-ua))+(hi-hn),Go=ti-(cu+(hi=ti-cu))+(hi-hn),Yi===0&&Ci===0&&fo===0&&Go===0)||(o=pe*An+D*Math.abs(c),(c+=ws*Go+cu*Yi-(ua*fo+qs*Ci))>=o||-c>=o))return c;hi=(ha=(Ka=Yi-(Vo=(zi=134217729*Yi)-(zi-Yi)))*(ka=cu-(ta=(zi=134217729*cu)-(zi-cu)))-((na=Yi*cu)-Vo*ta-Ka*ta-Vo*ka))-(ca=ha-(Ls=(Ka=Ci-(Vo=(zi=134217729*Ci)-(zi-Ci)))*(ka=qs-(ta=(zi=134217729*qs)-(zi-qs)))-((Xs=Ci*qs)-Vo*ta-Ka*ta-Vo*ka))),mt[0]=ha-(ca+hi)+(hi-Ls),hi=(Pa=na-((Eo=na+ca)-(hi=Eo-na))+(ca-hi))-(ca=Pa-Xs),mt[1]=Pa-(ca+hi)+(hi-Xs),hi=(Ea=Eo+ca)-Eo,mt[2]=Eo-(Ea-hi)+(ca-hi),mt[3]=Ea;const f=N(4,we,4,mt,ke);hi=(ha=(Ka=ws-(Vo=(zi=134217729*ws)-(zi-ws)))*(ka=Go-(ta=(zi=134217729*Go)-(zi-Go)))-((na=ws*Go)-Vo*ta-Ka*ta-Vo*ka))-(ca=ha-(Ls=(Ka=ua-(Vo=(zi=134217729*ua)-(zi-ua)))*(ka=fo-(ta=(zi=134217729*fo)-(zi-fo)))-((Xs=ua*fo)-Vo*ta-Ka*ta-Vo*ka))),mt[0]=ha-(ca+hi)+(hi-Ls),hi=(Pa=na-((Eo=na+ca)-(hi=Eo-na))+(ca-hi))-(ca=Pa-Xs),mt[1]=Pa-(ca+hi)+(hi-Xs),hi=(Ea=Eo+ca)-Eo,mt[2]=Eo-(Ea-hi)+(ca-hi),mt[3]=Ea;const E=N(f,ke,4,mt,Ge);hi=(ha=(Ka=Yi-(Vo=(zi=134217729*Yi)-(zi-Yi)))*(ka=Go-(ta=(zi=134217729*Go)-(zi-Go)))-((na=Yi*Go)-Vo*ta-Ka*ta-Vo*ka))-(ca=ha-(Ls=(Ka=Ci-(Vo=(zi=134217729*Ci)-(zi-Ci)))*(ka=fo-(ta=(zi=134217729*fo)-(zi-fo)))-((Xs=Ci*fo)-Vo*ta-Ka*ta-Vo*ka))),mt[0]=ha-(ca+hi)+(hi-Ls),hi=(Pa=na-((Eo=na+ca)-(hi=Eo-na))+(ca-hi))-(ca=Pa-Xs),mt[1]=Pa-(ca+hi)+(hi-Xs),hi=(Ea=Eo+ca)-Eo,mt[2]=Eo-(Ea-hi)+(ca-hi),mt[3]=Ea;const L=N(E,Ge,4,mt,ht);return ht[L-1]}(St,xt,bt,kt,ft,nr,yn):Mn},m.orient2dfast=function(St,xt,bt,kt,ft,nr){return(xt-nr)*(bt-ft)-(St-ft)*(kt-nr)},Object.defineProperty(m,"__esModule",{value:!0})})(v)}),Fh=Vc(dl),Ll=Vc(bh),Fs=Yp.orient2d;Ll.default&&(Ll=Ll.default);var Tc=Ru;function Ru(p,v,m){v=Math.max(0,v===void 0?2:v),m=m||0;var w=function(kt){for(var ft=kt[0],nr=kt[0],br=kt[0],Pr=kt[0],Mn=0;kt.length>Mn;Mn++){var yn=kt[Mn];ft[0]>yn[0]&&(ft=yn),yn[0]>br[0]&&(br=yn),nr[1]>yn[1]&&(nr=yn),yn[1]>Pr[1]&&(Pr=yn)}var kr=[ft,nr,br,Pr],Ai=kr.slice();for(Mn=0;kt.length>Mn;Mn++)Zc(kt[Mn],kr)||Ai.push(kt[Mn]);return function($n){$n.sort(Eh);for(var ti=[],ri=0;$n.length>ri;ri++){for(;ti.length>=2&&0>=Iu(ti[ti.length-2],ti[ti.length-1],$n[ri]);)ti.pop();ti.push($n[ri])}for(var hn=[],An=$n.length-1;An>=0;An--){for(;hn.length>=2&&0>=Iu(hn[hn.length-2],hn[hn.length-1],$n[An]);)hn.pop();hn.push($n[An])}return hn.pop(),ti.pop(),ti.concat(hn)}(Ai)}(p),D=new Fh(16);D.toBBox=function(kt){return{minX:kt[0],minY:kt[1],maxX:kt[0],maxY:kt[1]}},D.compareMinX=function(kt,ft){return kt[0]-ft[0]},D.compareMinY=function(kt,ft){return kt[1]-ft[1]},D.load(p);for(var N,W=[],$=0;w.length>$;$++){var ie=w[$];D.remove(ie),N=gp(ie,N),W.push(N)}var pe=new Fh(16);for($=0;W.length>$;$++)pe.insert(rh(W[$]));for(var we=v*v,ke=m*m;W.length;){var Ge=W.shift(),ht=Ge.p,mt=Ge.next.p,St=vp(ht,mt);if(St>=ke){var xt=St/we;(ie=jc(D,Ge.prev.p,ht,mt,Ge.next.next.p,xt,pe))&&Math.min(vp(ie,ht),vp(ie,mt))<=xt&&(W.push(Ge),W.push(gp(ie,Ge)),D.remove(ie),pe.remove(Ge),pe.insert(rh(Ge)),pe.insert(rh(Ge.next)))}}Ge=N;var bt=[];do bt.push(Ge.p),Ge=Ge.next;while(Ge!==N);return bt.push(Ge.p),bt}function jc(p,v,m,w,D,N,W){for(var $=new Ll([],$p),ie=p.data;ie;){for(var pe=0;ie.children.length>pe;pe++){var we=ie.children[pe],ke=ie.leaf?Kp(we,m,w):Jh(m,w,we);N<ke||$.push({node:we,dist:ke})}for(;$.length&&!$.peek().node.children;){var Ge=$.pop(),ht=Ge.node,mt=Kp(ht,v,m),St=Kp(ht,w,D);if(mt>Ge.dist&&St>Ge.dist&&kh(m,ht,W)&&kh(w,ht,W))return ht}(ie=$.pop())&&(ie=ie.node)}return null}function $p(p,v){return p.dist-v.dist}function Jh(p,v,m){if(Ac(p,m)||Ac(v,m))return 0;var w=Hc(p[0],p[1],v[0],v[1],m.minX,m.minY,m.maxX,m.minY);if(w===0)return 0;var D=Hc(p[0],p[1],v[0],v[1],m.minX,m.minY,m.minX,m.maxY);if(D===0)return 0;var N=Hc(p[0],p[1],v[0],v[1],m.maxX,m.minY,m.maxX,m.maxY);if(N===0)return 0;var W=Hc(p[0],p[1],v[0],v[1],m.minX,m.maxY,m.maxX,m.maxY);return W===0?0:Math.min(w,D,N,W)}function Ac(p,v){return!(v.minX>p[0]||p[0]>v.maxX||v.minY>p[1]||p[1]>v.maxY)}function kh(p,v,m){for(var w,D,N,W,$=m.search({minX:Math.min(p[0],v[0]),minY:Math.min(p[1],v[1]),maxX:Math.max(p[0],v[0]),maxY:Math.max(p[1],v[1])}),ie=0;$.length>ie;ie++)if(D=$[ie].next.p,N=p,(w=$[ie].p)!==(W=v)&&D!==N&&Iu(w,D,N)>0!=Iu(w,D,W)>0&&Iu(N,W,w)>0!=Iu(N,W,D)>0)return!1;return!0}function Iu(p,v,m){return Fs(p[0],p[1],v[0],v[1],m[0],m[1])}function rh(p){var v=p.p,m=p.next.p;return p.minX=Math.min(v[0],m[0]),p.minY=Math.min(v[1],m[1]),p.maxX=Math.max(v[0],m[0]),p.maxY=Math.max(v[1],m[1]),p}function gp(p,v){var m={p,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return v?(m.next=v.next,m.prev=v,v.next.prev=m,v.next=m):(m.prev=m,m.next=m),m}function vp(p,v){var m=p[0]-v[0],w=p[1]-v[1];return m*m+w*w}function Kp(p,v,m){var w=v[0],D=v[1],N=m[0]-w,W=m[1]-D;if(N!==0||W!==0){var $=((p[0]-w)*N+(p[1]-D)*W)/(N*N+W*W);$>1?(w=m[0],D=m[1]):$>0&&(w+=N*$,D+=W*$)}return(N=p[0]-w)*N+(W=p[1]-D)*W}function Hc(p,v,m,w,D,N,W,$){var ie,pe,we,ke,Ge=m-p,ht=w-v,mt=W-D,St=$-N,xt=p-D,bt=v-N,kt=Ge*Ge+ht*ht,ft=Ge*mt+ht*St,nr=mt*mt+St*St,br=Ge*xt+ht*bt,Pr=mt*xt+St*bt,Mn=kt*nr-ft*ft,yn=Mn,kr=Mn;Mn===0?(pe=0,yn=1,ke=Pr,kr=nr):(ke=kt*Pr-ft*br,0>(pe=ft*Pr-nr*br)?(pe=0,ke=Pr,kr=nr):pe>yn&&(pe=yn,ke=Pr+ft,kr=nr)),0>ke?(ke=0,0>-br?pe=0:-br>kt?pe=yn:(pe=-br,yn=kt)):ke>kr&&(ke=kr,0>-br+ft?pe=0:-br+ft>kt?pe=yn:(pe=-br+ft,yn=kt));var Ai=(1-(we=ke===0?0:ke/kr))*D+we*W-((1-(ie=pe===0?0:pe/yn))*p+ie*m),$n=(1-we)*N+we*$-((1-ie)*v+ie*w);return Ai*Ai+$n*$n}function Eh(p,v){return p[0]===v[0]?p[1]-v[1]:p[0]-v[0]}function yu(p,v,m){m===void 0&&(m={});var w=Ec(p),D=Ec(v),N=Ms(D[1]-w[1]),W=Ms(D[0]-w[0]),$=Ms(w[1]),ie=Ms(D[1]),pe=Math.pow(Math.sin(N/2),2)+Math.pow(Math.sin(W/2),2)*Math.cos($)*Math.cos(ie);return qh(2*Math.atan2(Math.sqrt(pe),Math.sqrt(1-pe)),m.units)}function Ya(p){return function(v,m){m===void 0&&(m={});var w=Number(v[0]),D=Number(v[1]),N=Number(v[2]),W=Number(v[3]);if(v.length===6)throw Error("@turf/bbox-polygon does not support BBox with 6 positions");var $=[w,D];return Kc([[$,[N,D],[N,W],[w,W],$]],m.properties,{bbox:v,id:m.id})}(cc(p))}function nh(p,v,m,w){w===void 0&&(w={});var D=Ec(p),N=Ms(D[0]),W=Ms(D[1]),$=Ms(m),ie=zc(v,w.units),pe=Math.asin(Math.sin(W)*Math.cos(ie)+Math.cos(W)*Math.sin(ie)*Math.cos($));return al([Oh(N+Math.atan2(Math.sin($)*Math.sin(ie)*Math.cos(W),Math.cos(ie)-Math.sin(W)*Math.sin(pe))),Oh(pe)],w.properties)}function Gc(p,v,m){if(m===void 0&&(m={}),m.final===!0)return function(pe,we){var ke=Gc(we,pe);return ke=(ke+180)%360}(p,v);var w=Ec(p),D=Ec(v),N=Ms(w[0]),W=Ms(D[0]),$=Ms(w[1]),ie=Ms(D[1]);return Oh(Math.atan2(Math.sin(W-N)*Math.cos(ie),Math.cos($)*Math.sin(ie)-Math.sin($)*Math.cos(ie)*Math.cos(W-N)))}function ih(p,v){v===void 0&&(v={});var m=cc(p);return al([(m[0]+m[2])/2,(m[1]+m[3])/2],v.properties,v)}function Sa(p,v){v===void 0&&(v={});var m=0,w=0,D=0;return uc(p,function(N){m+=N[0],w+=N[1],D++},!0),al([m/D,w/D],v.properties)}function cs(p,v){switch(v===void 0&&(v={}),xh(p)){case"Point":return al(Ec(p),v.properties);case"Polygon":var m=[];uc(p,function(ft){m.push(ft)});var w,D,N,W,$,ie,pe,we,ke=Sa(p,{properties:v.properties}),Ge=ke.geometry.coordinates,ht=0,mt=0,St=0,xt=m.map(function(ft){return[ft[0]-Ge[0],ft[1]-Ge[1]]});for(w=0;m.length-1>w;w++)St+=we=(W=(D=xt[w])[0])*(pe=(N=xt[w+1])[1])-($=N[0])*(ie=D[1]),ht+=(W+$)*we,mt+=(ie+pe)*we;if(St===0)return ke;var bt=1/(6*(.5*St));return al([Ge[0]+bt*ht,Ge[1]+bt*mt],v.properties);default:var kt=function(ft,nr){nr===void 0&&(nr={}),nr.concavity=nr.concavity||1/0;var br=[];if(uc(ft,function(Mn){br.push([Mn[0],Mn[1]])}),!br.length)return null;var Pr=Tc(br,nr.concavity);return Pr.length>3?Kc([Pr]):null}(p);return kt?cs(kt,{properties:v.properties}):Sa(p,{properties:v.properties})}}function ku(p){if(!p)throw Error("geojson is required");var v=[];return fp(p,function(m){(function(w,D){var N=[],W=w.geometry;if(W!==null){switch(W.type){case"Polygon":N=th(W);break;case"LineString":N=[th(W)]}N.forEach(function($){var ie=function(pe,we){var ke=[];return pe.reduce(function(Ge,ht){var mt,St,xt,bt,kt,ft,nr=ou([Ge,ht],we);return nr.bbox=[(kt=(St=ht)[0])>(xt=(mt=Ge)[0])?xt:kt,(ft=St[1])>(bt=mt[1])?bt:ft,xt>kt?xt:kt,bt>ft?bt:ft],ke.push(nr),ht}),ke}($,w.properties);ie.forEach(function(pe){pe.id=D.length,D.push(pe)})})}})(m,v)}),Ks(v)}Tc.default=Ru;function rc(p,v,m){if(!m)return v.indexOf(p);for(let w=0;v.length>w;w++)if(m(p,v[w]))return w;return-1}function xu(p,v){oh(p,0,p.children.length,v,p)}function oh(p,v,m,w,D){D||(D=oi(null)),D.minX=1/0,D.minY=1/0,D.maxX=-1/0,D.maxY=-1/0;for(let N=v;m>N;N++){const W=p.children[N];Cc(D,p.leaf?w(W):W)}return D}function Cc(p,v){return p.minX=Math.min(p.minX,v.minX),p.minY=Math.min(p.minY,v.minY),p.maxX=Math.max(p.maxX,v.maxX),p.maxY=Math.max(p.maxY,v.maxY),p}function ah(p,v){return p.minX-v.minX}function Qh(p,v){return p.minY-v.minY}function sh(p){return(p.maxX-p.minX)*(p.maxY-p.minY)}function Ul(p){return p.maxX-p.minX+(p.maxY-p.minY)}function ll(p,v){const m=Math.max(p.minX,v.minX),w=Math.max(p.minY,v.minY),D=Math.min(p.maxX,v.maxX),N=Math.min(p.maxY,v.maxY);return Math.max(0,D-m)*Math.max(0,N-w)}function Wc(p,v){return!(p.minX>v.minX||p.minY>v.minY||v.maxX>p.maxX||v.maxY>p.maxY)}function vl(p,v){return!(v.minX>p.maxX||v.minY>p.maxY||p.minX>v.maxX||p.minY>v.maxY)}function oi(p){return{children:p,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function fi(p,v,m,w,D){const N=[v,m];for(;N.length;){if(w>=(m=N.pop())-(v=N.pop()))continue;const W=v+Math.ceil((m-v)/w/2)*w;qa(p,W,v,m,D),N.push(v,W,W,m)}}var tu=Object.freeze({__proto__:null,default:class{constructor(p=9){this._maxEntries=Math.max(4,p),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(p){let v=this.data;const m=[];if(!vl(p,v))return m;const w=this.toBBox,D=[];for(;v;){for(let N=0;v.children.length>N;N++){const W=v.children[N],$=v.leaf?w(W):W;vl(p,$)&&(v.leaf?m.push(W):Wc(p,$)?this._all(W,m):D.push(W))}v=D.pop()}return m}collides(p){let v=this.data;if(!vl(p,v))return!1;const m=[];for(;v;){for(let w=0;v.children.length>w;w++){const D=v.children[w],N=v.leaf?this.toBBox(D):D;if(vl(p,N)){if(v.leaf||Wc(p,N))return!0;m.push(D)}}v=m.pop()}return!1}load(p){if(!p||!p.length)return this;if(this._minEntries>p.length){for(let m=0;p.length>m;m++)this.insert(p[m]);return this}let v=this._build(p.slice(),0,p.length-1,0);if(this.data.children.length)if(this.data.height===v.height)this._splitRoot(this.data,v);else{if(v.height>this.data.height){const m=this.data;this.data=v,v=m}this._insert(v,this.data.height-v.height-1,!0)}else this.data=v;return this}insert(p){return p&&this._insert(p,this.data.height-1),this}clear(){return this.data=oi([]),this}remove(p,v){if(!p)return this;let m=this.data;const w=this.toBBox(p),D=[],N=[];let W,$,ie;for(;m||D.length;){if(m||(m=D.pop(),$=D[D.length-1],W=N.pop(),ie=!0),m.leaf){const pe=rc(p,m.children,v);if(pe!==-1)return m.children.splice(pe,1),D.push(m),this._condense(D),this}ie||m.leaf||!Wc(m,w)?$?(W++,m=$.children[W],ie=!1):m=null:(D.push(m),N.push(W),W=0,$=m,m=m.children[0])}return this}toBBox(p){return p}compareMinX(p,v){return p.minX-v.minX}compareMinY(p,v){return p.minY-v.minY}toJSON(){return this.data}fromJSON(p){return this.data=p,this}_all(p,v){const m=[];for(;p;)p.leaf?v.push(...p.children):m.push(...p.children),p=m.pop();return v}_build(p,v,m,w){const D=m-v+1;let N,W=this._maxEntries;if(W>=D)return N=oi(p.slice(v,m+1)),xu(N,this.toBBox),N;w||(W=Math.ceil(D/Math.pow(W,(w=Math.ceil(Math.log(D)/Math.log(W)))-1))),N=oi([]),N.leaf=!1,N.height=w;const $=Math.ceil(D/W),ie=$*Math.ceil(Math.sqrt(W));fi(p,v,m,ie,this.compareMinX);for(let pe=v;m>=pe;pe+=ie){const we=Math.min(pe+ie-1,m);fi(p,pe,we,$,this.compareMinY);for(let ke=pe;we>=ke;ke+=$)N.children.push(this._build(p,ke,Math.min(ke+$-1,we),w-1))}return xu(N,this.toBBox),N}_chooseSubtree(p,v,m,w){for(;w.push(v),!v.leaf&&w.length-1!==m;){let W,$=1/0,ie=1/0;for(let pe=0;v.children.length>pe;pe++){const we=v.children[pe],ke=sh(we),Ge=(Math.max((N=we).maxX,(D=p).maxX)-Math.min(N.minX,D.minX))*(Math.max(N.maxY,D.maxY)-Math.min(N.minY,D.minY))-ke;ie>Ge?(ie=Ge,$=$>ke?ke:$,W=we):Ge===ie&&$>ke&&($=ke,W=we)}v=W||v.children[0]}var D,N;return v}_insert(p,v,m){const w=m?p:this.toBBox(p),D=[],N=this._chooseSubtree(w,this.data,v,D);for(N.children.push(p),Cc(N,w);v>=0&&D[v].children.length>this._maxEntries;)this._split(D,v),v--;this._adjustParentBBoxes(w,D,v)}_split(p,v){const m=p[v],w=m.children.length,D=this._minEntries;this._chooseSplitAxis(m,D,w);const N=this._chooseSplitIndex(m,D,w),W=oi(m.children.splice(N,m.children.length-N));W.height=m.height,W.leaf=m.leaf,xu(m,this.toBBox),xu(W,this.toBBox),v?p[v-1].children.push(W):this._splitRoot(m,W)}_splitRoot(p,v){this.data=oi([p,v]),this.data.height=p.height+1,this.data.leaf=!1,xu(this.data,this.toBBox)}_chooseSplitIndex(p,v,m){let w,D=1/0,N=1/0;for(let W=v;m-v>=W;W++){const $=oh(p,0,W,this.toBBox),ie=oh(p,W,m,this.toBBox),pe=ll($,ie),we=sh($)+sh(ie);D>pe?(D=pe,w=W,N=N>we?we:N):pe===D&&N>we&&(N=we,w=W)}return w||m-v}_chooseSplitAxis(p,v,m){const w=p.leaf?this.compareMinX:ah,D=p.leaf?this.compareMinY:Qh,N=this._allDistMargin(p,v,m,w);this._allDistMargin(p,v,m,D)>N&&p.children.sort(w)}_allDistMargin(p,v,m,w){p.children.sort(w);const D=this.toBBox,N=oh(p,0,v,D),W=oh(p,m-v,m,D);let $=Ul(N)+Ul(W);for(let ie=v;m-v>ie;ie++){const pe=p.children[ie];Cc(N,p.leaf?D(pe):pe),$+=Ul(N)}for(let ie=m-v-1;ie>=v;ie--){const pe=p.children[ie];Cc(W,p.leaf?D(pe):pe),$+=Ul(W)}return $}_adjustParentBBoxes(p,v,m){for(let w=m;w>=0;w--)Cc(v[w],p)}_condense(p){for(let v,m=p.length-1;m>=0;m--)p[m].children.length===0?m>0?(v=p[m-1].children,v.splice(v.indexOf(p[m]),1)):this.clear():xu(p[m],this.toBBox)}}}),bu=Vc(tu),Dp=Vc(Qc),ai=Vc(Xp),is=Vc(zl).default,ep=ai.featureEach,mi=Dp.featureCollection;function Mc(p){var v=new bu(p);return v.insert=function(m){if(m.type!=="Feature")throw Error("invalid feature");return m.bbox=m.bbox?m.bbox:is(m),bu.prototype.insert.call(this,m)},v.load=function(m){var w=[];return Array.isArray(m)?m.forEach(function(D){if(D.type!=="Feature")throw Error("invalid features");D.bbox=D.bbox?D.bbox:is(D),w.push(D)}):ep(m,function(D){if(D.type!=="Feature")throw Error("invalid features");D.bbox=D.bbox?D.bbox:is(D),w.push(D)}),bu.prototype.load.call(this,w)},v.remove=function(m,w){if(m.type!=="Feature")throw Error("invalid feature");return m.bbox=m.bbox?m.bbox:is(m),bu.prototype.remove.call(this,m,w)},v.clear=function(){return bu.prototype.clear.call(this)},v.search=function(m){var w=bu.prototype.search.call(this,this.toBBox(m));return mi(w)},v.collides=function(m){return bu.prototype.collides.call(this,this.toBBox(m))},v.all=function(){var m=bu.prototype.all.call(this);return mi(m)},v.toJSON=function(){return bu.prototype.toJSON.call(this)},v.fromJSON=function(m){return bu.prototype.fromJSON.call(this,m)},v.toBBox=function(m){var w;if(m.bbox)w=m.bbox;else if(Array.isArray(m)&&m.length===4)w=m;else if(Array.isArray(m)&&m.length===6)w=[m[0],m[1],m[3],m[4]];else if(m.type==="Feature")w=is(m);else{if(m.type!=="FeatureCollection")throw Error("invalid geojson");w=is(m)}return{minX:w[0],minY:w[1],maxX:w[2],maxY:w[3]}},v}var Op=Mc;function Jp(p,v){var m={},w=[];if(p.type==="LineString"&&(p=Ju(p)),v.type==="LineString"&&(v=Ju(v)),p.type==="Feature"&&v.type==="Feature"&&p.geometry!==null&&v.geometry!==null&&p.geometry.type==="LineString"&&v.geometry.type==="LineString"&&p.geometry.coordinates.length===2&&v.geometry.coordinates.length===2){var D=Xc(p,v);return D&&w.push(D),Ks(w)}var N=Op();return N.load(ku(v)),yh(ku(p),function(W){yh(N.search(W),function($){var ie=Xc(W,$);if(ie){var pe=th(ie).join(",");m[pe]||(m[pe]=!0,w.push(ie))}})}),Ks(w)}function Xc(p,v){var m=th(p),w=th(v);if(m.length!==2)throw Error("<intersects> line1 must only contain 2 coordinates");if(w.length!==2)throw Error("<intersects> line2 must only contain 2 coordinates");var D=m[0][0],N=m[0][1],W=m[1][0],$=m[1][1],ie=w[0][0],pe=w[0][1],we=w[1][0],ke=w[1][1],Ge=(ke-pe)*(W-D)-(we-ie)*($-N),ht=(we-ie)*(N-pe)-(ke-pe)*(D-ie),mt=(W-D)*(N-pe)-($-N)*(D-ie);if(Ge===0)return null;var St=ht/Ge,xt=mt/Ge;return 0>St||St>1||0>xt||xt>1?null:al([D+St*(W-D),N+St*($-N)])}Op.default=Mc;var hc=6378137;function wh(p){return bc(p,function(v,m){return v+function(w){var D,N=0;switch(w.type){case"Polygon":return Pc(w.coordinates);case"MultiPolygon":for(D=0;w.coordinates.length>D;D++)N+=Pc(w.coordinates[D]);return N;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(m)},0)}function Pc(p){var v=0;if(p&&p.length>0){v+=Math.abs(Xl(p[0]));for(var m=1;p.length>m;m++)v-=Math.abs(Xl(p[m]))}return v}function Xl(p){var v,m,w,D,N,W,$=0,ie=p.length;if(ie>2){for(W=0;ie>W;W++)W===ie-2?(w=ie-2,D=ie-1,N=0):W===ie-1?(w=ie-1,D=0,N=1):(w=W,D=W+1,N=W+2),v=p[w],m=p[D],$+=(Rc(p[N][0])-Rc(v[0]))*Math.sin(Rc(m[1]));$=$*hc*hc/2}return $}function Rc(p){return p*Math.PI/180}function Eu(p,v){return v===void 0&&(v={}),Ps(p,function(m,w){var D=w.geometry.coordinates;return m+yu(D[0],D[1],v)},0)}function lh(p,v){v===void 0&&(v={});var m=vu(p);switch(v.properties||p.type!=="Feature"||(v.properties=p.properties),m.type){case"Polygon":return function(w,D){D===void 0&&(D={});var N=vu(w),W=N.coordinates,$=D.properties?D.properties:w.type==="Feature"?w.properties:{};return tp(W,$)}(m,v);case"MultiPolygon":return function(w,D){D===void 0&&(D={});var N=vu(w),W=N.coordinates,$=D.properties?D.properties:w.type==="Feature"?w.properties:{},ie=[];return W.forEach(function(pe){ie.push(tp(pe,$))}),Ks(ie)}(m,v);default:throw Error("invalid poly")}}function tp(p,v){return p.length>1?Lp(p,v):ou(p[0],v)}function rp(p){for(var v,m,w=th(p),D=0,N=1;w.length>N;)v=m||w[0],D+=((m=w[N])[0]-v[0])*(m[1]+v[1]),N++;return D>0}var su=_u(function(p){var v=Object.prototype.hasOwnProperty,m="~";function w(){}function D(ie,pe,we){this.fn=ie,this.context=pe,this.once=we||!1}function N(ie,pe,we,ke,Ge){if(typeof we!="function")throw new TypeError("The listener must be a function");var ht=new D(we,ke||ie,Ge),mt=m?m+pe:pe;return ie._events[mt]?ie._events[mt].fn?ie._events[mt]=[ie._events[mt],ht]:ie._events[mt].push(ht):(ie._events[mt]=ht,ie._eventsCount++),ie}function W(ie,pe){--ie._eventsCount==0?ie._events=new w:delete ie._events[pe]}function $(){this._events=new w,this._eventsCount=0}Object.create&&(w.prototype=Object.create(null),new w().__proto__||(m=!1)),$.prototype.eventNames=function(){var ie,pe,we=[];if(this._eventsCount===0)return we;for(pe in ie=this._events)v.call(ie,pe)&&we.push(m?pe.slice(1):pe);return Object.getOwnPropertySymbols?we.concat(Object.getOwnPropertySymbols(ie)):we},$.prototype.listeners=function(ie){var pe=this._events[m?m+ie:ie];if(!pe)return[];if(pe.fn)return[pe.fn];for(var we=0,ke=pe.length,Ge=Array(ke);ke>we;we++)Ge[we]=pe[we].fn;return Ge},$.prototype.listenerCount=function(ie){var pe=this._events[m?m+ie:ie];return pe?pe.fn?1:pe.length:0},$.prototype.emit=function(ie,pe,we,ke,Ge,ht){var mt=m?m+ie:ie;if(!this._events[mt])return!1;var St,xt,bt=this._events[mt],kt=arguments.length;if(bt.fn){switch(bt.once&&this.removeListener(ie,bt.fn,void 0,!0),kt){case 1:return bt.fn.call(bt.context),!0;case 2:return bt.fn.call(bt.context,pe),!0;case 3:return bt.fn.call(bt.context,pe,we),!0;case 4:return bt.fn.call(bt.context,pe,we,ke),!0;case 5:return bt.fn.call(bt.context,pe,we,ke,Ge),!0;case 6:return bt.fn.call(bt.context,pe,we,ke,Ge,ht),!0}for(xt=1,St=Array(kt-1);kt>xt;xt++)St[xt-1]=arguments[xt];bt.fn.apply(bt.context,St)}else{var ft,nr=bt.length;for(xt=0;nr>xt;xt++)switch(bt[xt].once&&this.removeListener(ie,bt[xt].fn,void 0,!0),kt){case 1:bt[xt].fn.call(bt[xt].context);break;case 2:bt[xt].fn.call(bt[xt].context,pe);break;case 3:bt[xt].fn.call(bt[xt].context,pe,we);break;case 4:bt[xt].fn.call(bt[xt].context,pe,we,ke);break;default:if(!St)for(ft=1,St=Array(kt-1);kt>ft;ft++)St[ft-1]=arguments[ft];bt[xt].fn.apply(bt[xt].context,St)}}return!0},$.prototype.on=function(ie,pe,we){return N(this,ie,pe,we,!1)},$.prototype.once=function(ie,pe,we){return N(this,ie,pe,we,!0)},$.prototype.removeListener=function(ie,pe,we,ke){var Ge=m?m+ie:ie;if(!this._events[Ge])return this;if(!pe)return W(this,Ge),this;var ht=this._events[Ge];if(ht.fn)ht.fn!==pe||ke&&!ht.once||we&&ht.context!==we||W(this,Ge);else{for(var mt=0,St=[],xt=ht.length;xt>mt;mt++)(ht[mt].fn!==pe||ke&&!ht[mt].once||we&&ht[mt].context!==we)&&St.push(ht[mt]);St.length?this._events[Ge]=St.length===1?St[0]:St:W(this,Ge)}return this},$.prototype.removeAllListeners=function(ie){var pe;return ie?this._events[pe=m?m+ie:ie]&&W(this,pe):(this._events=new w,this._eventsCount=0),this},$.prototype.off=$.prototype.removeListener,$.prototype.addListener=$.prototype.on,$.prefixed=m,$.EventEmitter=$,p.exports=$}),ql=function(p){function v(m,w){var D,N=w.style;return Ia(this,v),(D=Dn(this,v)).scene=void 0,D.style=void 0,D.layers=void 0,D.data=[],D.scene=m,D.style=N,D.layers=D.initLayers(),D.layers.forEach(function(W){m.addLayer(W)}),N.callback instanceof Function&&N.callback(D.layers),D}return Aa(v,p),Sl(v,[{key:"getLayers",value:function(){return this.layers}},{key:"show",value:function(){this.layers.forEach(function(m){m.show()})}},{key:"hide",value:function(){this.layers.forEach(function(m){m.hide()})}},{key:"setData",value:function(m){var w=Os(m).sort(function(D,N){return+D.properties.isActive-+N.properties.isActive});this.data=w,this.layers.forEach(function(D){D.setData(Ks(w))})}},{key:"destroy",value:function(){var m=this;this.layers.forEach(function(w){m.scene.removeLayer(w)})}}]),v}(su.EventEmitter),fa=function(p){function v(){return Ia(this,v),Dn(this,v,arguments)}return Aa(v,p),Sl(v,[{key:"initLayers",value:function(){var m=this.style,w=m.normal,D=m.style,N=m.options;return[new Ze.LineLayer(N!=null?N:{}).source(Ks([])).size(w.size).color(w.color).shape("line").style(D)]}}]),v}(ql),Rs=function(p){var v=typeof p;return p!=null&&(v=="object"||v=="function")},hs=typeof Bh=="object"&&Bh&&Bh.Object===Object&&Bh,lu=typeof self=="object"&&self&&self.Object===Object&&self,wu=hs||lu||Function("return this")(),uh=function(){return wu.Date.now()},ch=/\s/,Nu=function(p){for(var v=p.length;v--&&ch.test(p.charAt(v)););return v},Qp=/^\s+/,Gi=function(p){return p&&p.slice(0,Nu(p)+1).replace(Qp,"")},Si=wu.Symbol,ji=Object.prototype,ao=ji.hasOwnProperty,Ic=ji.toString,Gs=Si?Si.toStringTag:void 0,Lc=function(p){var v=ao.call(p,Gs),m=p[Gs];try{p[Gs]=void 0;var w=!0}catch(N){}var D=Ic.call(p);return w&&(v?p[Gs]=m:delete p[Gs]),D},ul=Object.prototype.toString,Nh=function(p){return ul.call(p)},xa=Si?Si.toStringTag:void 0,Al=function(p){return p==null?p===void 0?"[object Undefined]":"[object Null]":xa&&xa in Object(p)?Lc(p):Nh(p)},Lu=function(p){return p!=null&&typeof p=="object"},ks=function(p){return typeof p=="symbol"||Lu(p)&&Al(p)=="[object Symbol]"},_l=/^[-+]0x[0-9a-f]+$/i,pc=/^0b[01]+$/i,Du=/^0o[0-7]+$/i,zh=parseInt,Su=function(p){if(typeof p=="number")return p;if(ks(p))return NaN;if(Rs(p)){var v=typeof p.valueOf=="function"?p.valueOf():p;p=Rs(v)?v+"":v}if(typeof p!="string")return p===0?p:+p;p=Gi(p);var m=pc.test(p);return m||Du.test(p)?zh(p.slice(2),m?2:8):_l.test(p)?NaN:+p},qc=Math.max,Sh=Math.min,nc=function(p,v,m){var w,D,N,W,$,ie,pe=0,we=!1,ke=!1,Ge=!0;if(typeof p!="function")throw new TypeError("Expected a function");function ht(kt){var ft=w,nr=D;return w=D=void 0,pe=kt,W=p.apply(nr,ft)}function mt(kt){var ft=kt-ie;return ie===void 0||ft>=v||0>ft||ke&&kt-pe>=N}function St(){var kt=uh();if(mt(kt))return xt(kt);$=setTimeout(St,function(ft){var nr=v-(ft-ie);return ke?Sh(nr,N-(ft-pe)):nr}(kt))}function xt(kt){return $=void 0,Ge&&w?ht(kt):(w=D=void 0,W)}function bt(){var kt=uh(),ft=mt(kt);if(w=arguments,D=this,ie=kt,ft){if($===void 0)return function(nr){return pe=nr,$=setTimeout(St,v),we?ht(nr):W}(ie);if(ke)return clearTimeout($),$=setTimeout(St,v),ht(ie)}return $===void 0&&($=setTimeout(St,v)),W}return v=Su(v)||0,Rs(m)&&(we=!!m.leading,N=(ke="maxWait"in m)?qc(Su(m.maxWait)||0,v):N,Ge="trailing"in m?!!m.trailing:Ge),bt.cancel=function(){$!==void 0&&clearTimeout($),pe=0,w=ie=D=$=void 0},bt.flush=function(){return $===void 0?W:xt(uh())},bt},Yl=function(p){function v(){var m;Ia(this,v);for(var w=arguments.length,D=Array(w),N=0;w>N;N++)D[N]=arguments[N];return(m=Dn(this,v,[].concat(D))).onMouseMove=function(W){m.emit(ve.RenderEvent.Mousemove,W)},m.onMouseOut=function(W){m.emit(ve.RenderEvent.Mouseout,W)},m.onMouseDown=function(W){m.emit(ve.RenderEvent.Dragstart,W)},m.onDragging=function(W){m.emit(ve.RenderEvent.Dragging,W)},m.onDragEnd=nc(function(W){m.emit(ve.RenderEvent.Dragend,W)},0),m.onUnClick=function(W){m.emit(ve.RenderEvent.UnClick,W)},m.enableHover=function(){var W,$;m.disableHover(),(W=m.layers[0])===null||W===void 0||W.on(ve.LayerEvent.Mousemove,m.onMouseMove),($=m.layers[0])===null||$===void 0||$.on(ve.LayerEvent.Mouseout,m.onMouseOut)},m.disableHover=function(){var W,$;(W=m.layers[0])===null||W===void 0||W.off(ve.LayerEvent.Mousemove,m.onMouseMove),($=m.layers[0])===null||$===void 0||$.off(ve.LayerEvent.Mouseout,m.onMouseOut)},m}return Aa(v,p),Sl(v,[{key:"initLayers",value:function(){var m=this.style,w=m.normal,D=m.hover,N=m.active,W=m.style,$=m.options;return[new Ze.LineLayer($!=null?$:{}).source(Ks([])).size("isHover*isActive",function(ie,pe){return pe?N.size:ie?D.size:w.size}).color("isHover*isActive",function(ie,pe){return pe?N.color:ie?D.color:w.color}).shape("line").style(W)]}},{key:"enableDrag",value:function(){this.disableDrag(),this.layers[0].on(ve.LayerEvent.Mousedown,this.onMouseDown),this.scene.on(ve.SceneEvent.Dragging,this.onDragging),this.scene.on(ve.SceneEvent.Mouseup,this.onDragEnd),this.scene.on(ve.SceneEvent.Dragend,this.onDragEnd)}},{key:"disableDrag",value:function(){this.layers[0].off(ve.LayerEvent.Mousedown,this.onMouseDown),this.scene.off(ve.SceneEvent.Dragging,this.onDragging),this.scene.off(ve.SceneEvent.Mouseup,this.onDragEnd),this.scene.off(ve.SceneEvent.Dragend,this.onDragEnd)}},{key:"enableUnClick",value:function(){this.disableUnClick(),this.layers[0].on(ve.LayerEvent.UnClick,this.onUnClick)}},{key:"disableUnClick",value:function(){this.layers[0].off(ve.LayerEvent.UnClick,this.onUnClick)}}]),v}(ql),Th=function(p){function v(){var m;Ia(this,v);for(var w=arguments.length,D=Array(w),N=0;w>N;N++)D[N]=arguments[N];return(m=Dn(this,v,[].concat(D))).onMouseMove=function(W){m.emit(ve.RenderEvent.Mousemove,W)},m.onMouseOut=function(W){m.emit(ve.RenderEvent.Mouseout,W)},m.onMouseDown=function(W){m.emit(ve.RenderEvent.Click,W)},m}return Aa(v,p),Sl(v,[{key:"initLayers",value:function(){var m=this.style,w=m.normal,D=m.style,N=D===void 0?{}:D,W=m.options,$=w.shape,ie=w.size,pe=w.color;return[new Ze.PointLayer(W!=null?W:{}).source(Ks([])).size(ie).color(pe).shape($).style(N)]}},{key:"enableClick",value:function(){this.disableClick(),this.layers[0].on(ve.LayerEvent.Mousedown,this.onMouseDown)}},{key:"disableClick",value:function(){this.layers[0].off(ve.LayerEvent.Mousedown,this.onMouseDown)}},{key:"enableHover",value:function(){var m,w;this.disableHover(),(m=this.layers[0])===null||m===void 0||m.on(ve.LayerEvent.Mousemove,this.onMouseMove),(w=this.layers[0])===null||w===void 0||w.on(ve.LayerEvent.Mouseout,this.onMouseOut)}},{key:"disableHover",value:function(){var m,w;(m=this.layers[0])===null||m===void 0||m.off(ve.LayerEvent.Mousemove,this.onMouseMove),(w=this.layers[0])===null||w===void 0||w.off(ve.LayerEvent.Mouseout,this.onMouseOut)}}]),v}(ql),ba=function(p){function v(){var m;Ia(this,v);for(var w=arguments.length,D=Array(w),N=0;w>N;N++)D[N]=arguments[N];return(m=Dn(this,v,[].concat(D))).onCreate=function(W){m.emit(ve.RenderEvent.UnClick,W)},m.onMouseMove=function(W){m.emit(ve.RenderEvent.Mousemove,W)},m.onMouseOut=function(W){m.emit(ve.RenderEvent.Mouseout,W)},m.onMouseDown=function(W){m.emit(ve.RenderEvent.Dragstart,W)},m.onDragging=function(W){m.emit(ve.RenderEvent.Dragging,W)},m.onDragEnd=nc(function(W){m.emit(ve.RenderEvent.Dragend,W)},0),m.onClick=function(W){m.emit(ve.RenderEvent.Click,W)},m.onContextmenu=function(W){m.emit(ve.RenderEvent.Contextmenu,W)},m}return Aa(v,p),Sl(v,[{key:"initLayers",value:function(){var m=this.style,w=m.normal,D=m.hover,N=m.active,W=m.style,$=W===void 0?{}:W,ie=m.options;return[new Ze.PointLayer(ie!=null?ie:{}).source(Ks([])).size("isHover*isActive",function(pe,we){return we?N.size:pe?D.size:w.size}).color("isHover*isActive",function(pe,we){return we?N.color:pe?D.color:w.color}).shape("isHover*isActive",function(pe,we){return we?N.shape:pe?D.shape:w.shape}).style($)]}},{key:"enableCreate",value:function(){this.disableCreate(),this.layers[0].on(ve.LayerEvent.UnClick,this.onCreate)}},{key:"disableCreate",value:function(){this.layers[0].off(ve.LayerEvent.UnClick,this.onCreate)}},{key:"enableHover",value:function(){var m,w;this.disableHover(),(m=this.layers[0])===null||m===void 0||m.on(ve.LayerEvent.Mousemove,this.onMouseMove),(w=this.layers[0])===null||w===void 0||w.on(ve.LayerEvent.Mouseout,this.onMouseOut)}},{key:"disableHover",value:function(){var m,w;(m=this.layers[0])===null||m===void 0||m.off(ve.LayerEvent.Mousemove,this.onMouseMove),(w=this.layers[0])===null||w===void 0||w.off(ve.LayerEvent.Mouseout,this.onMouseOut)}},{key:"enableDrag",value:function(){this.disableDrag(),this.layers[0].on(ve.LayerEvent.Mousedown,this.onMouseDown),this.scene.on(ve.SceneEvent.Dragging,this.onDragging),this.scene.on(ve.SceneEvent.Mouseup,this.onDragEnd),this.scene.on(ve.SceneEvent.Dragend,this.onDragEnd)}},{key:"disableDrag",value:function(){this.layers[0].off(ve.LayerEvent.Mousedown,this.onMouseDown),this.scene.off(ve.SceneEvent.Dragging,this.onDragging),this.scene.off(ve.SceneEvent.Mouseup,this.onDragEnd),this.scene.off(ve.SceneEvent.Dragend,this.onDragEnd)}},{key:"enableClick",value:function(){this.disableClick(),this.layers[0].on(ve.LayerEvent.Click,this.onClick)}},{key:"disableClick",value:function(){this.layers[0].off(ve.LayerEvent.Click,this.onClick)}},{key:"enableContextMenu",value:function(){this.disableContextMenu(),this.layers[0].on(ve.LayerEvent.Contextmenu,this.onContextmenu)}},{key:"disableContextMenu",value:function(){this.layers[0].off(ve.LayerEvent.Contextmenu,this.onContextmenu)}}]),v}(ql),z=function(p){function v(){var m;Ia(this,v);for(var w=arguments.length,D=Array(w),N=0;w>N;N++)D[N]=arguments[N];return(m=Dn(this,v,[].concat(D))).onMouseMove=function(W){m.emit(ve.RenderEvent.Mousemove,W)},m.onMouseOut=function(W){m.emit(ve.RenderEvent.Mouseout,W)},m.onMouseDown=function(W){m.emit(ve.RenderEvent.Dragstart,W)},m.onDragging=function(W){m.emit(ve.RenderEvent.Dragging,W)},m.onDragEnd=nc(function(W){m.emit(ve.RenderEvent.Dragend,W)},0),m.onUnClick=function(W){m.emit(ve.RenderEvent.UnClick,W)},m.enableHover=function(){var W,$;m.disableHover(),(W=m.layers[0])===null||W===void 0||W.on(ve.LayerEvent.Mousemove,m.onMouseMove),($=m.layers[0])===null||$===void 0||$.on(ve.LayerEvent.Mouseout,m.onMouseOut)},m.disableHover=function(){var W,$;(W=m.layers[0])===null||W===void 0||W.off(ve.LayerEvent.Mousemove,m.onMouseMove),($=m.layers[0])===null||$===void 0||$.off(ve.LayerEvent.Mouseout,m.onMouseOut)},m}return Aa(v,p),Sl(v,[{key:"initLayers",value:function(){var m=this.style,w=m.normal,D=m.hover,N=m.active,W=m.style,$=m.options,ie=new Ze.PolygonLayer($!=null?$:{});return ie.source(Ks([])).color("isHover*isActive",function(pe,we){return we?N.color:pe?D.color:w.color}).style(W),[ie]}},{key:"enableDrag",value:function(){this.disableDrag(),this.layers[0].on(ve.LayerEvent.Mousedown,this.onMouseDown),this.scene.on(ve.SceneEvent.Dragging,this.onDragging),this.scene.on(ve.SceneEvent.Mouseup,this.onDragEnd),this.scene.on(ve.SceneEvent.Dragend,this.onDragEnd)}},{key:"disableDrag",value:function(){this.layers[0].off(ve.LayerEvent.Mousedown,this.onMouseDown),this.scene.off(ve.SceneEvent.Dragging,this.onDragging),this.scene.off(ve.SceneEvent.Mouseup,this.onDragEnd),this.scene.off(ve.SceneEvent.Dragend,this.onDragEnd)}},{key:"enableUnClick",value:function(){this.disableUnClick(),this.layers[0].on(ve.LayerEvent.UnClick,this.onUnClick)}},{key:"disableUnClick",value:function(){this.layers[0].off(ve.LayerEvent.UnClick,this.onUnClick)}}]),v}(ql),s=function(p){function v(m){var w;return Ia(this,v),(w=Dn(this,v)).scene=void 0,w.previousClick=void 0,w.onDblClick=function(D){var N,W,$=(N=(W=D.pixel)!==null&&W!==void 0?W:D.point)!==null&&N!==void 0?N:{},ie=$.x,pe=ie===void 0?0:ie,we=$.y,ke=we===void 0?0:we,Ge=Date.now();if(w.previousClick){var ht=w.previousClick,mt=ht.y;300>Ge-ht.time&&5>Math.abs(pe-ht.x)&&5>Math.abs(ke-mt)&&w.emit(ve.RenderEvent.DblClick,D)}w.previousClick={x:pe,y:ke,time:Ge}},w.onMouseMove=function(D){w.emit(ve.RenderEvent.Mousemove,D)},w.onMouseDown=function(D){w.emit(ve.RenderEvent.Dragstart,D)},w.onDragging=function(D){w.emit(ve.RenderEvent.Dragging,D)},w.onDragEnd=nc(function(D){w.emit(ve.RenderEvent.Dragend,D)},0),w.scene=m,w}return Aa(v,p),Sl(v,[{key:"enableDrag",value:function(){this.disableDrag(),this.scene.on(ve.SceneEvent.Mousedown,this.onMouseDown),this.scene.on(ve.SceneEvent.Dragging,this.onDragging),this.scene.on(ve.SceneEvent.Mouseup,this.onDragEnd),this.scene.on(ve.SceneEvent.Dragend,this.onDragEnd)}},{key:"disableDrag",value:function(){this.scene.off(ve.SceneEvent.Mousedown,this.onMouseDown),this.scene.off(ve.SceneEvent.Dragging,this.onDragging),this.scene.off(ve.SceneEvent.Mouseup,this.onDragEnd),this.scene.off(ve.SceneEvent.Dragend,this.onDragEnd)}},{key:"enableMouseMove",value:function(){this.disableMouseMove(),this.scene.on(ve.SceneEvent.Mousemove,this.onMouseMove)}},{key:"disableMouseMove",value:function(){this.scene.off(ve.SceneEvent.Mousemove,this.onMouseMove)}},{key:"enableDblClick",value:function(){this.disableDblClick(),this.scene.on(ve.SceneEvent.Mousedown,this.onDblClick)}},{key:"disableDblClick",value:function(){this.scene.off(ve.SceneEvent.Mousedown,this.onDblClick)}}]),v}(su),x=function(p){function v(){return Ia(this,v),Dn(this,v,arguments)}return Aa(v,p),Sl(v,[{key:"initLayers",value:function(){var m=this.style,w=m.normal,D=m.active,N=m.style,W=N===void 0?{}:N,$=m.options;return[new Ze.PointLayer($!=null?$:{}).source(Ks([])).size("isActive",function(ie){return ie?D.size:w.size}).color("isActive",function(ie){return ie?D.color:w.color}).shape("text","text").style(W)]}}]),v}(ql),I={point:ba,line:Yl,dashLine:fa,midPoint:Th,text:x,polygon:z},k="#1990FF",H="#ED9D48",ee={blend:"normal",pickingBuffer:5},ne={color:k,shape:"circle",size:6},ue={color:H,shape:"circle",size:6},_e={shape:"circle",size:6,color:H},h={options:ee,normal:ne,hover:mn(mn({},ne),{},{size:8}),active:mn(mn({},ne),{},{size:8,color:H}),style:{stroke:"#ffffff",strokeWidth:2}},g={options:ee,normal:ue,hover:mn(mn({},ue),{},{size:8}),active:mn(mn({},ue),{},{size:8}),style:{stroke:"#ffffff",strokeWidth:2}},d={color:k,size:12},b={point:g,line:{options:ee,normal:{color:k,size:2},hover:{color:k,size:2},active:{color:H,size:2},style:{}},polygon:{options:ee,normal:{color:k},hover:{color:k},active:{color:H},style:{opacity:.15}},midPoint:{options:ee,normal:_e},dashLine:{options:ee,normal:{color:H,size:2},style:{lineType:"dash",dashArray:[6,6]}},text:{options:ee,normal:d,active:mn(mn({},d),{},{color:H}),style:{fontWeight:"800",textOffset:[0,d.size+6],textAllowOverlap:!0,stroke:"#ffffff",strokeWidth:2}}},B={draw:"\u5355\u51FB\u7ED8\u5236\u70B9",pointHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u70B9\u4F4D\u7F6E",pointDrag:null},G={draw:"\u5355\u51FB\u7ED8\u5236\u9996\u4E2A\u8282\u70B9",pointHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u8282\u70B9\u4F4D\u7F6E",pointDrag:null,lineHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u7EBF\u4F4D\u7F6E",lineDrag:null,midPointHover:"\u5355\u51FB\u5728\u8BE5\u4F4D\u7F6E\u65B0\u589E\u8282\u70B9",drawFinish:"\u5355\u51FB\u7EE7\u7EED\u7ED8\u5236\uFF0C\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236"},q={draw:"\u5355\u51FB\u7ED8\u5236\u9996\u4E2A\u8282\u70B9",drawContinue:"\u5355\u51FB\u7EE7\u7EED\u7ED8\u5236",drawFinish:"\u5355\u51FB\u7EE7\u7EED\u7ED8\u5236\uFF0C\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236",midPointHover:"\u5355\u51FB\u5728\u8BE5\u4F4D\u7F6E\u65B0\u589E\u8282\u70B9",pointHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u8282\u70B9\u4F4D\u7F6E",pointDrag:null,lineHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u9762\u4F4D\u7F6E",lineDrag:null,polygonHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u9762\u4F4D\u7F6E",polygonDrag:null},te=mn(mn({},q),{},{draw:"\u5355\u51FB\u7ED8\u5236\u9996\u4E2A\u8282\u70B9",drawFinish:"\u5355\u51FB\u7ED3\u675F\u7ED8\u5236"}),fe={draw:"\u62D6\u62FD\u5F00\u59CB\u7ED8\u5236",drawFinish:"\u677E\u5F00\u9F20\u6807\u7ED3\u675F\u7ED8\u5236"},ce={lineHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u77E9\u5F62\u4F4D\u7F6E",polygonHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u77E9\u5F62\u4F4D\u7F6E"},Te={lineHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u5706\u4F4D\u7F6E",polygonHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u5706\u4F4D\u7F6E"},Ie=function(p,v){return p===v||p!=p&&v!=v},Oe=function(p,v){for(var m=p.length;m--;)if(Ie(p[m][0],v))return m;return-1},Qe=Array.prototype.splice,nt=function(p){var v=this.__data__,m=Oe(v,p);return m>=0&&(m==v.length-1?v.pop():Qe.call(v,m,1),--this.size,!0)},ct=function(p){var v=this.__data__,m=Oe(v,p);return 0>m?void 0:v[m][1]},tt=function(p){return Oe(this.__data__,p)>-1},Tt=function(p,v){var m=this.__data__,w=Oe(m,p);return 0>w?(++this.size,m.push([p,v])):m[w][1]=v,this};function Ut(p){var v=-1,m=p==null?0:p.length;for(this.clear();++v<m;){var w=p[v];this.set(w[0],w[1])}}Ut.prototype.clear=function(){this.__data__=[],this.size=0},Ut.prototype.delete=nt,Ut.prototype.get=ct,Ut.prototype.has=tt,Ut.prototype.set=Tt;var Nt=Ut,pr=function(){this.__data__=new Nt,this.size=0},tr=function(p){var v=this.__data__,m=v.delete(p);return this.size=v.size,m},Dr=function(p){return this.__data__.get(p)},Hr=function(p){return this.__data__.has(p)},sn,nn=function(p){if(!Rs(p))return!1;var v=Al(p);return v=="[object Function]"||v=="[object GeneratorFunction]"||v=="[object AsyncFunction]"||v=="[object Proxy]"},Gn=wu["__core-js_shared__"],di=(sn=/[^.]+$/.exec(Gn&&Gn.keys&&Gn.keys.IE_PROTO||""))?"Symbol(src)_1."+sn:"",Di=function(p){return!!di&&di in p},Ui=Function.prototype.toString,ho=function(p){if(p!=null){try{return Ui.call(p)}catch(v){}try{return p+""}catch(v){}}return""},gi=/^\[object .+?Constructor\]$/,Wi=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ko=function(p){return!(!Rs(p)||Di(p))&&(nn(p)?Wi:gi).test(ho(p))},Mo=function(p,v){return p==null?void 0:p[v]},mo=function(p,v){var m=Mo(p,v);return Ko(m)?m:void 0},ko=mo(wu,"Map"),xo=mo(Object,"create"),qi=function(p){var v=this.has(p)&&delete this.__data__[p];return this.size-=v?1:0,v},xs=Object.prototype.hasOwnProperty,gs=function(p){var v=this.__data__;if(xo){var m=v[p];return m==="__lodash_hash_undefined__"?void 0:m}return xs.call(v,p)?v[p]:void 0},Cl=Object.prototype.hasOwnProperty,ts=function(p){var v=this.__data__;return xo?v[p]!==void 0:Cl.call(v,p)},ja=function(p,v){var m=this.__data__;return this.size+=this.has(p)?0:1,m[p]=xo&&v===void 0?"__lodash_hash_undefined__":v,this};function $a(p){var v=-1,m=p==null?0:p.length;for(this.clear();++v<m;){var w=p[v];this.set(w[0],w[1])}}$a.prototype.clear=function(){this.__data__=xo?xo(null):{},this.size=0},$a.prototype.delete=qi,$a.prototype.get=gs,$a.prototype.has=ts,$a.prototype.set=ja;var vs=$a,Zl=function(p){var v=typeof p;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?p!=="__proto__":p===null},zu=function(p,v){var m=p.__data__;return Zl(v)?m[typeof v=="string"?"string":"hash"]:m.map},Uu=function(p){var v=zu(this,p).delete(p);return this.size-=v?1:0,v},hh=function(p){return zu(this,p).get(p)},Yc=function(p){return zu(this,p).has(p)},np=function(p,v){var m=zu(this,p),w=m.size;return m.set(p,v),this.size+=m.size==w?0:1,this};function pu(p){var v=-1,m=p==null?0:p.length;for(this.clear();++v<m;){var w=p[v];this.set(w[0],w[1])}}pu.prototype.clear=function(){this.size=0,this.__data__={hash:new vs,map:new(ko||Nt),string:new vs}},pu.prototype.delete=Uu,pu.prototype.get=hh,pu.prototype.has=Yc,pu.prototype.set=np;var Tu=pu,Zu=function(p,v){var m=this.__data__;if(m instanceof Nt){var w=m.__data__;if(!ko||199>w.length)return w.push([p,v]),this.size=++m.size,this;m=this.__data__=new Tu(w)}return m.set(p,v),this.size=m.size,this};function Dl(p){var v=this.__data__=new Nt(p);this.size=v.size}Dl.prototype.clear=pr,Dl.prototype.delete=tr,Dl.prototype.get=Dr,Dl.prototype.has=Hr,Dl.prototype.set=Zu;var Vl=Dl,Uh=function(p,v){for(var m=-1,w=p==null?0:p.length;++m<w&&v(p[m],m,p)!==!1;);return p},ml=function(){try{var p=mo(Object,"defineProperty");return p({},"",{}),p}catch(v){}}(),$l=function(p,v,m){v=="__proto__"&&ml?ml(p,v,{configurable:!0,enumerable:!0,value:m,writable:!0}):p[v]=m},Vu=Object.prototype.hasOwnProperty,Ws=function(p,v,m){var w=p[v];Vu.call(p,v)&&Ie(w,m)&&(m!==void 0||v in p)||$l(p,v,m)},ju=function(p,v,m,w){var D=!m;m||(m={});for(var N=-1,W=v.length;++N<W;){var $=v[N],ie=w?w(m[$],p[$],$,m,p):void 0;ie===void 0&&(ie=p[$]),D?$l(m,$,ie):Ws(m,$,ie)}return m},os=function(p,v){for(var m=-1,w=Array(p);++m<p;)w[m]=v(m);return w},yl=function(p){return Lu(p)&&Al(p)=="[object Arguments]"},Ol=Object.prototype,ph=Ol.hasOwnProperty,_f=Ol.propertyIsEnumerable,ip=yl(function(){return arguments}())?yl:function(p){return Lu(p)&&ph.call(p,"callee")&&!_f.call(p,"callee")},yf=ip,Hu=Array.isArray,Bp=function(){return!1},fc=_u(function(p,v){var m=v&&!v.nodeType&&v,w=m&&p&&!p.nodeType&&p,D=w&&w.exports===m?wu.Buffer:void 0;p.exports=(D?D.isBuffer:void 0)||Bp}),Wf=/^(?:0|[1-9]\d*)$/,op=function(p,v){var m=typeof p;return!!(v=v==null?9007199254740991:v)&&(m=="number"||m!="symbol"&&Wf.test(p))&&p>-1&&p%1==0&&v>p},ef=function(p){return typeof p=="number"&&p>-1&&p%1==0&&9007199254740991>=p},_s={};_s["[object Float32Array]"]=_s["[object Float64Array]"]=_s["[object Int8Array]"]=_s["[object Int16Array]"]=_s["[object Int32Array]"]=_s["[object Uint8Array]"]=_s["[object Uint8ClampedArray]"]=_s["[object Uint16Array]"]=_s["[object Uint32Array]"]=!0,_s["[object Arguments]"]=_s["[object Array]"]=_s["[object ArrayBuffer]"]=_s["[object Boolean]"]=_s["[object DataView]"]=_s["[object Date]"]=_s["[object Error]"]=_s["[object Function]"]=_s["[object Map]"]=_s["[object Number]"]=_s["[object Object]"]=_s["[object RegExp]"]=_s["[object Set]"]=_s["[object String]"]=_s["[object WeakMap]"]=!1;var Ff=function(p){return Lu(p)&&ef(p.length)&&!!_s[Al(p)]},sd=function(p){return function(v){return p(v)}},fh=_u(function(p,v){var m=v&&!v.nodeType&&v,w=m&&p&&!p.nodeType&&p,D=w&&w.exports===m&&hs.process,N=function(){try{var W=w&&w.require&&w.require("util").types;return W||D&&D.binding&&D.binding("util")}catch($){}}();p.exports=N}),_d=fh&&fh.isTypedArray,ld=_d?sd(_d):Ff,ym=Object.prototype.hasOwnProperty,Xf=function(p,v){var m=Hu(p),w=!m&&yf(p),D=!m&&!w&&fc(p),N=!m&&!w&&!D&&ld(p),W=m||w||D||N,$=W?os(p.length,String):[],ie=$.length;for(var pe in p)!v&&!ym.call(p,pe)||W&&(pe=="length"||D&&(pe=="offset"||pe=="parent")||N&&(pe=="buffer"||pe=="byteLength"||pe=="byteOffset")||op(pe,ie))||$.push(pe);return $},tm=Object.prototype,Gu=function(p){var v=p&&p.constructor;return p===(typeof v=="function"&&v.prototype||tm)},xf=function(p,v){return function(m){return p(v(m))}},tf=xf(Object.keys,Object),ud=Object.prototype.hasOwnProperty,qf=function(p){if(!Gu(p))return tf(p);var v=[];for(var m in Object(p))ud.call(p,m)&&m!="constructor"&&v.push(m);return v},Dd=function(p){return p!=null&&ef(p.length)&&!nn(p)},Yf=function(p){return Dd(p)?Xf(p):qf(p)},Kl=function(p,v){return p&&ju(v,Yf(v),p)},Od=function(p){var v=[];if(p!=null)for(var m in Object(p))v.push(m);return v},Bd=Object.prototype.hasOwnProperty,bf=function(p){if(!Rs(p))return Od(p);var v=Gu(p),m=[];for(var w in p)(w!="constructor"||!v&&Bd.call(p,w))&&m.push(w);return m},wp=function(p){return Dd(p)?Xf(p,!0):bf(p)},$f=function(p,v){return p&&ju(v,wp(v),p)},ap=_u(function(p,v){var m=v&&!v.nodeType&&v,w=m&&p&&!p.nodeType&&p,D=w&&w.exports===m?wu.Buffer:void 0,N=D?D.allocUnsafe:void 0;p.exports=function(W,$){if($)return W.slice();var ie=W.length,pe=N?N(ie):new W.constructor(ie);return W.copy(pe),pe}}),kf=function(p,v){var m=-1,w=p.length;for(v||(v=Array(w));++m<w;)v[m]=p[m];return v},xl=function(p,v){for(var m=-1,w=p==null?0:p.length,D=0,N=[];++m<w;){var W=p[m];v(W,m,p)&&(N[D++]=W)}return N},dc=function(){return[]},Fp=Object.prototype.propertyIsEnumerable,Sp=Object.getOwnPropertySymbols,rf=Sp?function(p){return p==null?[]:xl(Sp(p=Object(p)),function(v){return Fp.call(p,v)})}:dc,nf=function(p,v){return ju(p,rf(p),v)},Nf=function(p,v){for(var m=-1,w=v.length,D=p.length;++m<w;)p[D+m]=v[m];return p},zf=xf(Object.getPrototypeOf,Object),of=Object.getOwnPropertySymbols?function(p){for(var v=[];p;)Nf(v,rf(p)),p=zf(p);return v}:dc,af=function(p,v){return ju(p,of(p),v)},kp=function(p,v,m){var w=v(p);return Hu(p)?w:Nf(w,m(p))},yd=function(p){return kp(p,Yf,rf)},Dc=function(p){return kp(p,wp,of)},_p=mo(wu,"DataView"),Kf=mo(wu,"Promise"),xd=mo(wu,"Set"),bd=mo(wu,"WeakMap"),Ed="[object Map]",Tp="[object Promise]",Ef="[object Set]",wd="[object WeakMap]",cd="[object DataView]",hd=ho(_p),Uf=ho(ko),sf=ho(Kf),Ou=ho(xd),Zh=ho(bd),lf=Al;(_p&&lf(new _p(new ArrayBuffer(1)))!=cd||ko&&lf(new ko)!=Ed||Kf&&lf(Kf.resolve())!=Tp||xd&&lf(new xd)!=Ef||bd&&lf(new bd)!=wd)&&(lf=function(p){var v=Al(p),m=v=="[object Object]"?p.constructor:void 0,w=m?ho(m):"";if(w)switch(w){case hd:return cd;case Uf:return Ed;case sf:return Tp;case Ou:return Ef;case Zh:return wd}return v});var Ah=lf,Np=Object.prototype.hasOwnProperty,pd=function(p){var v=p.length,m=new p.constructor(v);return v&&typeof p[0]=="string"&&Np.call(p,"index")&&(m.index=p.index,m.input=p.input),m},yp=wu.Uint8Array,Zf=function(p){var v=new p.constructor(p.byteLength);return new yp(v).set(new yp(p)),v},zp=function(p,v){var m=v?Zf(p.buffer):p.buffer;return new p.constructor(m,p.byteOffset,p.byteLength)},Oc=/\w*$/,Wu=function(p){var v=new p.constructor(p.source,Oc.exec(p));return v.lastIndex=p.lastIndex,v},Au=Si?Si.prototype:void 0,dh=Au?Au.valueOf:void 0,rm=function(p){return dh?Object(dh.call(p)):{}},Ap=function(p,v){var m=v?Zf(p.buffer):p.buffer;return new p.constructor(m,p.byteOffset,p.length)},nm=function(p,v,m){var w=p.constructor;switch(v){case"[object ArrayBuffer]":return Zf(p);case"[object Boolean]":case"[object Date]":return new w(+p);case"[object DataView]":return zp(p,m);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Ap(p,m);case"[object Map]":case"[object Set]":return new w;case"[object Number]":case"[object String]":return new w(p);case"[object RegExp]":return Wu(p);case"[object Symbol]":return rm(p)}},Fd=Object.create,xm=function(){function p(){}return function(v){if(!Rs(v))return{};if(Fd)return Fd(v);p.prototype=v;var m=new p;return p.prototype=void 0,m}}(),Jf=function(p){return typeof p.constructor!="function"||Gu(p)?{}:xm(zf(p))},kd=function(p){return Lu(p)&&Ah(p)=="[object Map]"},fd=fh&&fh.isMap,Bc=fd?sd(fd):kd,im=function(p){return Lu(p)&&Ah(p)=="[object Set]"},om=fh&&fh.isSet,Nd=om?sd(om):im,am="[object Arguments]",uf="[object Function]",Qf="[object Object]",cl={};cl[am]=cl["[object Array]"]=cl["[object ArrayBuffer]"]=cl["[object DataView]"]=cl["[object Boolean]"]=cl["[object Date]"]=cl["[object Float32Array]"]=cl["[object Float64Array]"]=cl["[object Int8Array]"]=cl["[object Int16Array]"]=cl["[object Int32Array]"]=cl["[object Map]"]=cl["[object Number]"]=cl[Qf]=cl["[object RegExp]"]=cl["[object Set]"]=cl["[object String]"]=cl["[object Symbol]"]=cl["[object Uint8Array]"]=cl["[object Uint8ClampedArray]"]=cl["[object Uint16Array]"]=cl["[object Uint32Array]"]=!0,cl["[object Error]"]=cl[uf]=cl["[object WeakMap]"]=!1;var zd=function p(v,m,w,D,N,W){var $,ie=1&m,pe=2&m,we=4&m;if(w&&($=N?w(v,D,N,W):w(v)),$!==void 0)return $;if(!Rs(v))return v;var ke=Hu(v);if(ke){if($=pd(v),!ie)return kf(v,$)}else{var Ge=Ah(v),ht=Ge==uf||Ge=="[object GeneratorFunction]";if(fc(v))return ap(v,ie);if(Ge==Qf||Ge==am||ht&&!N){if($=pe||ht?{}:Jf(v),!ie)return pe?af(v,$f($,v)):nf(v,Kl($,v))}else{if(!cl[Ge])return N?v:{};$=nm(v,Ge,ie)}}W||(W=new Vl);var mt=W.get(v);if(mt)return mt;W.set(v,$),Nd(v)?v.forEach(function(xt){$.add(p(xt,m,w,xt,v,W))}):Bc(v)&&v.forEach(function(xt,bt){$.set(bt,p(xt,m,w,bt,v,W))});var St=ke?void 0:(we?pe?Dc:yd:pe?wp:Yf)(v);return Uh(St||v,function(xt,bt){St&&(xt=v[bt=xt]),Ws($,bt,p(xt,m,w,bt,v,W))}),$},Fc=function(p){return zd(p,5)},Pe=function(p){for(var v=-1,m=p==null?0:p.length,w={};++v<m;){var D=p[v];w[D[0]]=D[1]}return w},_t=function(p){return this.__data__.has(p)};function Zt(p){var v=-1,m=p==null?0:p.length;for(this.__data__=new Tu;++v<m;)this.add(p[v])}Zt.prototype.add=Zt.prototype.push=function(p){return this.__data__.set(p,"__lodash_hash_undefined__"),this},Zt.prototype.has=_t;var qr=Zt,wn=function(p,v){for(var m=-1,w=p==null?0:p.length;++m<w;)if(v(p[m],m,p))return!0;return!1},Yr=function(p,v){return p.has(v)},Or=function(p,v,m,w,D,N){var W=1&m,$=p.length,ie=v.length;if(!($==ie||W&&ie>$))return!1;var pe=N.get(p),we=N.get(v);if(pe&&we)return pe==v&&we==p;var ke=-1,Ge=!0,ht=2&m?new qr:void 0;for(N.set(p,v),N.set(v,p);++ke<$;){var mt=p[ke],St=v[ke];if(w)var xt=W?w(St,mt,ke,v,p,N):w(mt,St,ke,p,v,N);if(xt!==void 0){if(xt)continue;Ge=!1;break}if(ht){if(!wn(v,function(bt,kt){if(!Yr(ht,kt)&&(mt===bt||D(mt,bt,m,w,N)))return ht.push(kt)})){Ge=!1;break}}else if(mt!==St&&!D(mt,St,m,w,N)){Ge=!1;break}}return N.delete(p),N.delete(v),Ge},Wn=function(p){var v=-1,m=Array(p.size);return p.forEach(function(w,D){m[++v]=[D,w]}),m},Bn=function(p){var v=-1,m=Array(p.size);return p.forEach(function(w){m[++v]=w}),m},si=Si?Si.prototype:void 0,Hn=si?si.valueOf:void 0,qn=function(p,v,m,w,D,N,W){switch(m){case"[object DataView]":if(p.byteLength!=v.byteLength||p.byteOffset!=v.byteOffset)return!1;p=p.buffer,v=v.buffer;case"[object ArrayBuffer]":return!(p.byteLength!=v.byteLength||!N(new yp(p),new yp(v)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ie(+p,+v);case"[object Error]":return p.name==v.name&&p.message==v.message;case"[object RegExp]":case"[object String]":return p==v+"";case"[object Map]":var $=Wn;case"[object Set]":if($||($=Bn),p.size!=v.size&&!(1&w))return!1;var ie=W.get(p);if(ie)return ie==v;w|=2,W.set(p,v);var pe=Or($(p),$(v),w,D,N,W);return W.delete(p),pe;case"[object Symbol]":if(Hn)return Hn.call(p)==Hn.call(v)}return!1},ci=Object.prototype.hasOwnProperty,Vn=function(p,v,m,w,D,N){var W=1&m,$=yd(p),ie=$.length;if(ie!=yd(v).length&&!W)return!1;for(var pe=ie;pe--;){var we=$[pe];if(!(W?we in v:ci.call(v,we)))return!1}var ke=N.get(p),Ge=N.get(v);if(ke&&Ge)return ke==v&&Ge==p;var ht=!0;N.set(p,v),N.set(v,p);for(var mt=W;++pe<ie;){var St=p[we=$[pe]],xt=v[we];if(w)var bt=W?w(xt,St,we,v,p,N):w(St,xt,we,p,v,N);if(!(bt===void 0?St===xt||D(St,xt,m,w,N):bt)){ht=!1;break}mt||(mt=we=="constructor")}if(ht&&!mt){var kt=p.constructor,ft=v.constructor;kt==ft||!("constructor"in p)||!("constructor"in v)||typeof kt=="function"&&kt instanceof kt&&typeof ft=="function"&&ft instanceof ft||(ht=!1)}return N.delete(p),N.delete(v),ht},Yn="[object Arguments]",Tr="[object Array]",en="[object Object]",Xn=Object.prototype.hasOwnProperty,_i=function(p,v,m,w,D,N){var W=Hu(p),$=Hu(v),ie=W?Tr:Ah(p),pe=$?Tr:Ah(v),we=(ie=ie==Yn?en:ie)==en,ke=(pe=pe==Yn?en:pe)==en,Ge=ie==pe;if(Ge&&fc(p)){if(!fc(v))return!1;W=!0,we=!1}if(Ge&&!we)return N||(N=new Vl),W||ld(p)?Or(p,v,m,w,D,N):qn(p,v,ie,m,w,D,N);if(!(1&m)){var ht=we&&Xn.call(p,"__wrapped__"),mt=ke&&Xn.call(v,"__wrapped__");if(ht||mt){var St=ht?p.value():p,xt=mt?v.value():v;return N||(N=new Vl),D(St,xt,m,w,N)}}return!!Ge&&(N||(N=new Vl),Vn(p,v,m,w,D,N))},Rn=function p(v,m,w,D,N){return v===m||(v==null||m==null||!Lu(v)&&!Lu(m)?v!=v&&m!=m:_i(v,m,w,D,p,N))},xi=function(p,v){return Rn(p,v)},Un=function(p,v,m){(m!==void 0&&!Ie(p[v],m)||m===void 0&&!(v in p))&&$l(p,v,m)},Oi=function(p){return function(v,m,w){for(var D=-1,N=Object(v),W=w(v),$=W.length;$--;){var ie=W[p?$:++D];if(m(N[ie],ie,N)===!1)break}return v}},Ln=Oi(),wi=function(p){return Lu(p)&&Dd(p)},Po=Function.prototype.toString,da=Object.prototype.hasOwnProperty,bi=Po.call(Object),Zn=function(p){if(!Lu(p)||Al(p)!="[object Object]")return!1;var v=zf(p);if(v===null)return!0;var m=da.call(v,"constructor")&&v.constructor;return typeof m=="function"&&m instanceof m&&Po.call(m)==bi},Sn=function(p,v){if((v!=="constructor"||typeof p[v]!="function")&&v!="__proto__")return p[v]},Wt=function(p){return ju(p,wp(p))},K=function(p,v,m,w,D,N,W){var $=Sn(p,m),ie=Sn(v,m),pe=W.get(ie);if(pe)Un(p,m,pe);else{var we=N?N($,ie,m+"",p,v,W):void 0,ke=we===void 0;if(ke){var Ge=Hu(ie),ht=!Ge&&fc(ie),mt=!Ge&&!ht&&ld(ie);we=ie,Ge||ht||mt?Hu($)?we=$:wi($)?we=kf($):ht?(ke=!1,we=ap(ie,!0)):mt?(ke=!1,we=Ap(ie,!0)):we=[]:Zn(ie)||yf(ie)?(we=$,yf($)?we=Wt($):Rs($)&&!nn($)||(we=Jf(ie))):ke=!1}ke&&(W.set(ie,we),D(we,ie,w,N,W),W.delete(ie)),Un(p,m,we)}},Ei=function p(v,m,w,D,N){v!==m&&Ln(m,function(W,$){if(N||(N=new Vl),Rs(W))K(v,m,$,w,p,D,N);else{var ie=D?D(Sn(v,$),W,$+"",v,m,N):void 0;ie===void 0&&(ie=W),Un(v,$,ie)}},wp)},Ee=function(p){return p},sa=function(p,v,m){switch(m.length){case 0:return p.call(v);case 1:return p.call(v,m[0]);case 2:return p.call(v,m[0],m[1]);case 3:return p.call(v,m[0],m[1],m[2])}return p.apply(v,m)},Jo=Math.max,Es=function(p,v,m){return v=Jo(v===void 0?p.length-1:v,0),function(){for(var w=arguments,D=-1,N=Jo(w.length-v,0),W=Array(N);++D<N;)W[D]=w[v+D];D=-1;for(var $=Array(v+1);++D<v;)$[D]=w[D];return $[v]=m(W),sa(p,this,$)}},Cu=function(p){return function(){return p}},Bl=Date.now,as=function(p){var v=0,m=0;return function(){var w=Bl(),D=16-(w-m);if(m=w,D>0){if(++v>=800)return arguments[0]}else v=0;return p.apply(void 0,arguments)}},fu=as(ml?function(p,v){return ml(p,"toString",{configurable:!0,enumerable:!1,value:Cu(v),writable:!0})}:Ee),Js=function(p,v){return fu(Es(p,v,Ee),p+"")},ps=function(p,v,m){if(!Rs(m))return!1;var w=typeof v;return!!(w=="number"?Dd(m)&&op(v,m.length):w=="string"&&v in m)&&Ie(m[v],p)},du=function(p){return Js(function(v,m){var w=-1,D=m.length,N=D>1?m[D-1]:void 0,W=D>2?m[2]:void 0;for(N=p.length>3&&typeof N=="function"?(D--,N):void 0,W&&ps(m[0],m[1],W)&&(N=3>D?void 0:N,D=1),v=Object(v);++w<D;){var $=m[w];$&&p(v,$,w,N)}return v})},ru=du(function(p,v,m){Ei(p,v,m)}),uu=function(p,v){for(var m=-1,w=p==null?0:p.length,D=Array(w);++m<w;)D[m]=v(p[m],m,p);return D},za=function(p,v){return uu(v,function(m){return[m,p[m]]})},Mu=function(p){var v=-1,m=Array(p.size);return p.forEach(function(w){m[++v]=[w,w]}),m},Ca=function(p){return function(v){var m=Ah(v);return m=="[object Map]"?Wn(v):m=="[object Set]"?Mu(v):za(v,p(v))}}(Yf),mu=_u(function(p){(function(v,m,w){if(v){for(var D,N={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},W={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},$={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},ie={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},pe=1;20>pe;++pe)N[111+pe]="f"+pe;for(pe=0;9>=pe;++pe)N[pe+96]=""+pe;xt.prototype.bind=function(bt,kt,ft){var nr=this;return nr._bindMultiple.call(nr,bt=bt instanceof Array?bt:[bt],kt,ft),nr},xt.prototype.unbind=function(bt,kt){return this.bind.call(this,bt,function(){},kt)},xt.prototype.trigger=function(bt,kt){var ft=this;return ft._directMap[bt+":"+kt]&&ft._directMap[bt+":"+kt]({},bt),ft},xt.prototype.reset=function(){var bt=this;return bt._callbacks={},bt._directMap={},bt},xt.prototype.stopCallback=function(bt,kt){if((" "+kt.className+" ").indexOf(" mousetrap ")>-1||St(kt,this.target))return!1;if("composedPath"in bt&&typeof bt.composedPath=="function"){var ft=bt.composedPath()[0];ft!==bt.target&&(kt=ft)}return kt.tagName=="INPUT"||kt.tagName=="SELECT"||kt.tagName=="TEXTAREA"||kt.isContentEditable},xt.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},xt.addKeycodes=function(bt){for(var kt in bt)bt.hasOwnProperty(kt)&&(N[kt]=bt[kt]);D=null},xt.init=function(){var bt=xt(m);for(var kt in bt)kt.charAt(0)!=="_"&&(xt[kt]=function(ft){return function(){return bt[ft].apply(bt,arguments)}}(kt))},xt.init(),v.Mousetrap=xt,p.exports&&(p.exports=xt)}function we(bt,kt,ft){bt.addEventListener?bt.addEventListener(kt,ft,!1):bt.attachEvent("on"+kt,ft)}function ke(bt){if(bt.type=="keypress"){var kt=String.fromCharCode(bt.which);return bt.shiftKey||(kt=kt.toLowerCase()),kt}return N[bt.which]?N[bt.which]:W[bt.which]?W[bt.which]:String.fromCharCode(bt.which).toLowerCase()}function Ge(bt){return bt=="shift"||bt=="ctrl"||bt=="alt"||bt=="meta"}function ht(bt,kt,ft){return ft||(ft=function(){if(!D)for(var nr in D={},N)nr>95&&112>nr||N.hasOwnProperty(nr)&&(D[N[nr]]=nr);return D}()[bt]?"keydown":"keypress"),ft=="keypress"&&kt.length&&(ft="keydown"),ft}function mt(bt,kt){var ft,nr,br,Pr=[];for(ft=function(Mn){return Mn==="+"?["+"]:(Mn=Mn.replace(/\+{2}/g,"+plus")).split("+")}(bt),br=0;ft.length>br;++br)ie[nr=ft[br]]&&(nr=ie[nr]),kt&&kt!="keypress"&&$[nr]&&(nr=$[nr],Pr.push("shift")),Ge(nr)&&Pr.push(nr);return{key:nr,modifiers:Pr,action:kt=ht(nr,Pr,kt)}}function St(bt,kt){return bt!==null&&bt!==m&&(bt===kt||St(bt.parentNode,kt))}function xt(bt){var kt=this;if(bt=bt||m,!(kt instanceof xt))return new xt(bt);kt.target=bt,kt._callbacks={},kt._directMap={};var ft,nr={},br=!1,Pr=!1,Mn=!1;function yn(hn){hn=hn||{};var An,Yi=!1;for(An in nr)hn[An]?Yi=!0:nr[An]=0;Yi||(Mn=!1)}function kr(hn,An,Yi,Ci,fo,Go){var hi,zi,Vo,Ka=[],ta=Yi.type;if(!kt._callbacks[hn])return[];for(ta=="keyup"&&Ge(hn)&&(An=[hn]),hi=0;kt._callbacks[hn].length>hi;++hi)zi=kt._callbacks[hn][hi],(Ci||!zi.seq||nr[zi.seq]==zi.level)&&ta==zi.action&&(ta=="keypress"&&!Yi.metaKey&&!Yi.ctrlKey||(Vo=zi.modifiers,An.sort().join(",")===Vo.sort().join(",")))&&((!Ci&&zi.combo==fo||Ci&&zi.seq==Ci&&zi.level==Go)&&kt._callbacks[hn].splice(hi,1),Ka.push(zi));return Ka}function Ai(hn,An,Yi,Ci){kt.stopCallback(An,An.target||An.srcElement,Yi,Ci)||hn(An,Yi)===!1&&(function(fo){fo.preventDefault?fo.preventDefault():fo.returnValue=!1}(An),function(fo){fo.stopPropagation?fo.stopPropagation():fo.cancelBubble=!0}(An))}function $n(hn){typeof hn.which!="number"&&(hn.which=hn.keyCode);var An=ke(hn);An&&(hn.type!="keyup"||br!==An?kt.handleKey(An,function(Yi){var Ci=[];return Yi.shiftKey&&Ci.push("shift"),Yi.altKey&&Ci.push("alt"),Yi.ctrlKey&&Ci.push("ctrl"),Yi.metaKey&&Ci.push("meta"),Ci}(hn),hn):br=!1)}function ti(hn,An,Yi,Ci){function fo(Vo){return function(){Mn=Vo,++nr[hn],clearTimeout(ft),ft=setTimeout(yn,1e3)}}function Go(Vo){Ai(Yi,Vo,hn),Ci!=="keyup"&&(br=ke(Vo)),setTimeout(yn,10)}nr[hn]=0;for(var hi=0;An.length>hi;++hi){var zi=hi+1===An.length?Go:fo(Ci||mt(An[hi+1]).action);ri(An[hi],zi,Ci,hn,hi)}}function ri(hn,An,Yi,Ci,fo){kt._directMap[hn+":"+Yi]=An;var Go,hi=(hn=hn.replace(/\s+/g," ")).split(" ");hi.length>1?ti(hn,hi,An,Yi):(Go=mt(hn,Yi),kt._callbacks[Go.key]=kt._callbacks[Go.key]||[],kr(Go.key,Go.modifiers,{type:Go.action},Ci,hn,fo),kt._callbacks[Go.key][Ci?"unshift":"push"]({callback:An,modifiers:Go.modifiers,action:Go.action,seq:Ci,level:fo,combo:hn}))}kt._handleKey=function(hn,An,Yi){var Ci,fo=kr(hn,An,Yi),Go={},hi=0,zi=!1;for(Ci=0;fo.length>Ci;++Ci)fo[Ci].seq&&(hi=Math.max(hi,fo[Ci].level));for(Ci=0;fo.length>Ci;++Ci)if(fo[Ci].seq){if(fo[Ci].level!=hi)continue;zi=!0,Go[fo[Ci].seq]=1,Ai(fo[Ci].callback,Yi,fo[Ci].combo,fo[Ci].seq)}else zi||Ai(fo[Ci].callback,Yi,fo[Ci].combo);var Vo=Yi.type=="keypress"&&Pr;Yi.type!=Mn||Ge(hn)||Vo||yn(Go),Pr=zi&&Yi.type=="keydown"},kt._bindMultiple=function(hn,An,Yi){for(var Ci=0;hn.length>Ci;++Ci)ri(hn[Ci],An,Yi)},we(bt,"keypress",$n),we(bt,"keydown",$n),we(bt,"keyup",$n)}})(typeof window!="undefined"?window:null,typeof window!="undefined"?document:null)}),ss,go=function(p){return p&&p.length?p[0]:void 0},ya=(ss=1,function(p){return"".concat(p,"-").concat(ss++)}),Qo=function(p,v){var m,w;return!(!p||!v||((m=p.properties)===null||m===void 0?void 0:m.id)!==((w=v.properties)===null||w===void 0?void 0:w.id))},Qs=function(p){var v=p.target,m=p.targetHandler,w=p.otherHandler;return p.data.map(function(D,N){var W,$=Qo(D,v)?m:w;return(W=$==null?void 0:$(D,N))!==null&&W!==void 0?W:D})},Cp=function(){return{id:ya("point"),isHover:!1,isActive:!1,isDrag:!1,createTime:Date.now()}},Ft=function(){return{id:ya("line"),isHover:!1,isActive:!1,isDrag:!1,isDraw:!1,createTime:Date.now()}},Xr=function(){return{id:ya("polygon"),isHover:!1,isActive:!1,isDrag:!1,isDraw:!1,createTime:Date.now()}},Mr=function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return al(p,mn(mn({},Cp()),v))},Bi=function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return{type:"Feature",properties:mn(mn({},Ft()),{},{nodes:p},v),geometry:{type:"LineString",coordinates:sl(Ks(p))}}},Ma=function(p){return ou(p,{id:ya("dashLine")})},el=function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return{type:"Feature",properties:mn(mn({},Xr()),{},{nodes:p},v),geometry:{type:"Polygon",coordinates:[sl(Ks([].concat(Os(p),[go(p)])))]}}},st=function(p){return p.forEach(function(v){v.bbox=cc(v)}),p},Et=function(p){return p.map(function(v,m){if(v.geometry.type.startsWith("Multi")){var w=v.geometry.type.replace("Multi","");return v.geometry.coordinates.map(function(D){return{type:"Feature",properties:mn(mn({},v.properties),{},{multiIndex:m}),geometry:{type:w,coordinates:D}}})}return v}).flat()},Vt=function(p){var v=[],m={};return p.forEach(function(w){var D,N=(D=w.properties)===null||D===void 0?void 0:D.multiIndex;if(typeof N=="number"){var W=m[N];if(W)W.geometry.coordinates.push(w.geometry.coordinates);else{var $="Multi".concat(w.geometry.type),ie={type:"Feature",properties:mn({},w.properties),geometry:{type:$,coordinates:[w.geometry.coordinates]}};m[N]=ie,v.push(ie)}}else v.push(w)}),v},Br=function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6;return Math.round(p*Math.pow(10,v))/Math.pow(10,v)},Ir=function(p){return function(v,m,w){w===void 0&&(w={});for(var D=vu(v).coordinates,N=0,W=0;D.length>W&&(N>m||W!==D.length-1);W++){if(N>=m){var $=m-N;if($){var ie=Gc(D[W],D[W-1])-180;return nh(D[W],$,ie,w)}return al(D[W])}N+=yu(D[W],D[W+1],w)}return al(D[D.length-1])}(p,Eu(p,{units:"meters"})/2,{units:"meters"})},Jt=function(p,v){var m=v.format,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=[];if(v.showTotalDistance){var N=Ir(p),W=Eu(p,{units:"meters"}),$=sl(p).map(function(mt){return al(mt)});N.properties=mn({id:ya("text"),isActive:!1,meters:W,text:m(W,$),type:"totalDistance"},w),D.push(N)}else for(var ie=p.geometry.coordinates,pe=0;ie.length-1>pe;pe++){var we=al(ie[pe]),ke=al(ie[pe+1]),Ge=yu(we,ke,{units:"meters"}),ht=ih(Ks([we,ke]));ht.properties=mn({id:ya("text"),isActive:!1,meters:Ge,text:m(Ge,[we,ke]),type:"distance"},w),D.push(ht)}return D},sr=function(p,v){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},w=v.format,D=wh(p);return cs(p,{properties:mn({meters:D,text:w(D,p),type:"area",isActive:!1},m)})},lr=function(p){var v,m,w,D,N,W,$=p.getContainer();return(v=(m=(w=(D=(N=(W=$==null?void 0:$.querySelector(".l7-marker-container"))!==null&&W!==void 0?W:$==null?void 0:$.querySelector(".BMap_mask"))!==null&&N!==void 0?N:p.getMapCanvasContainer())!==null&&D!==void 0?D:$==null?void 0:$.querySelector(".l7-scene"))!==null&&w!==void 0?w:$==null?void 0:$.querySelector(".l7-control-container"))!==null&&m!==void 0?m:$==null?void 0:$.querySelector(".l7-marker-container2"))!==null&&v!==void 0?v:null},Mt=function(p){return p.lngLat||p.lnglat},Xt=function(p){var v=Mt(p);return[v.lng,v.lat]},pt=function(p){return[p.lng,p.lat]},$t=function(p){for(var v=Number.MAX_SAFE_INTEGER,m=0,w=p.length,D=0;w>D;D++)v>p[D]&&(v=p[D],m=D);return m},zr=function(p,v){var m=[],w=[];return p.forEach(function(D){xi(D,v)?w.length&&(m.push(w),w=[]):w.push(D)}),w.length&&m.push(w),m},$r=function(p,v,m,w){var D=[];D=v.map(function(ht){var mt,St,xt=(mt=ht.properties)===null||mt===void 0?void 0:mt.line;return!((St=ht.properties)===null||St===void 0)&&St.isActive&&xt?zr(xt.properties.nodes.map(function(bt){return bt.geometry.coordinates}),p).filter(function(bt){return bt.length>1}).map(function(bt){return ou(bt)}):[xt]}).flat().filter(function(ht){return ht}),D.length||v.forEach(function(ht){var mt=xh(ht);if(/linestring/i.test(mt)&&D.push(ht),/polygon/i.test(mt)){var St,xt,bt=lh(ht);return(St=D).push.apply(St,Os((xt=bt==null?void 0:bt.features)!==null&&xt!==void 0?xt:[bt]))}});var N=m.lineAdsorbPixel,W=bs(p,2),$=w.lngLatToPixel([W[0],W[1]]),ie=$.x,pe=$.y,we=D.filter(function(ht){return sl(ht).length>1}).map(function(ht){return function(mt,St,xt){xt===void 0&&(xt={});var bt=al([1/0,1/0],{dist:1/0}),kt=0;return fp(mt,function(ft){for(var nr=th(ft),br=0;nr.length-1>br;br++){var Pr=al(nr[br]);Pr.properties.dist=yu(St,Pr,xt);var Mn=al(nr[br+1]);Mn.properties.dist=yu(St,Mn,xt);var yn=yu(Pr,Mn,xt),kr=Math.max(Pr.properties.dist,Mn.properties.dist),Ai=Gc(Pr,Mn),$n=nh(St,kr,Ai+90,xt),ti=nh(St,kr,Ai-90,xt),ri=Jp(ou([$n.geometry.coordinates,ti.geometry.coordinates]),ou([Pr.geometry.coordinates,Mn.geometry.coordinates])),hn=null;ri.features.length>0&&((hn=ri.features[0]).properties.dist=yu(St,hn,xt),hn.properties.location=kt+yu(Pr,hn,xt)),bt.properties.dist>Pr.properties.dist&&((bt=Pr).properties.index=br,bt.properties.location=kt),bt.properties.dist>Mn.properties.dist&&((bt=Mn).properties.index=br+1,bt.properties.location=kt+yn),hn&&bt.properties.dist>hn.properties.dist&&((bt=hn).properties.index=br),kt+=yn}}),bt}(ht,p)});if(!we.length)return null;var ke=we.map(function(ht){var mt=bs(ht.geometry.coordinates,2),St=w.lngLatToPixel([mt[0],mt[1]]),xt=St.y;return Math.pow(ie-St.x,2)+Math.pow(pe-xt,2)}),Ge=$t(ke);return Math.pow(ke[Ge],.5)>N?null:we[Ge].geometry.coordinates},Tn=function(p,v,m){var w,D=bs((w=p.bbox)!==null&&w!==void 0?w:st([p])[0].bbox,4),N=D[2],W=D[3],$=v.lngLatToContainer([D[0],D[1]]),ie=$.x,pe=$.y,we=v.lngLatToContainer([N,W]),ke=we.x,Ge=we.y,ht=v.containerToLngLat([ie-m,pe+m]),mt=ht.lng,St=ht.lat,xt=v.containerToLngLat([ke+m,Ge-m]),bt=xt.lng,kt=xt.lat;return[Math.min(mt,bt),Math.min(St,kt),Math.max(mt,bt),Math.max(St,kt)]},vn=function(p,v){var m=bs(v,4),w=m[0],D=m[1],N=m[2],W=m[3],$=bs(p,2),ie=$[0],pe=$[1];return!(w>ie||ie>N||D>pe||pe>W)},_n=function(p){var v=p.adsorbOptions,m=p.draw,w=p.position,D=p.scene,N=v.data,W=v.pointAdsorbPixel,$=v.lineAdsorbPixel,ie=[];if(ie=N==="allDrawData"?Fl.instances.map(function(ke){return ke.getData(!0)}).flat():N==="drawData"?m.getData(!0):N instanceof Function?N(w):N,ie=ie.filter(function(ke){var Ge;if(!((Ge=ke.properties)===null||Ge===void 0)&&Ge.isActive)return!0;var ht=Tn(ke,D,W);if(vn(w,ht))return!0;var mt=Tn(ke,D,$);return!!vn(w,mt)}),v.pointAdsorbPixel>0){var pe=function(ke,Ge,ht,mt){var St=ht.pointAdsorbPixel,xt=[];Ge.length&&(xt=Ge.map(function(Mn){var yn,kr=(yn=Mn.properties)!==null&&yn!==void 0?yn:{},Ai=kr.nodes,$n=Ai===void 0?[]:Ai,ti=kr.isActive;return ti!==void 0&&ti?$n.filter(function(ri){return!xi(ri.geometry.coordinates,ke)}):$n}).flat().filter(function(Mn){return Mn})),xt.length||(xt=sl(Ks(Ge)).map(function(Mn){return al(Mn)})),xt=xt.filter(function(Mn){var yn=Tn(Mn,mt,St);return vn(ke,yn)});var bt=bs(ke,2),kt=mt.lngLatToPixel([bt[0],bt[1]]),ft=kt.x,nr=kt.y,br=xt.map(function(Mn){var yn=bs(Mn.geometry.coordinates,2),kr=mt.lngLatToPixel([yn[0],yn[1]]),Ai=kr.y;return Math.pow(ft-kr.x,2)+Math.pow(nr-Ai,2)}),Pr=$t(br);return Math.pow(br[Pr],.5)>St?null:xt[Pr].geometry.coordinates}(w,ie,v,D);if(pe)return pe}if(v.lineAdsorbPixel>0){var we=$r(w,ie,v,D);if(we)return we}return w},Qn=function(p,v){var m=bs(v,2),w=m[0],D=m[1];p.lngLat&&(p.lngLat={lng:w,lat:D}),p.lnglat&&(p.lnglat={lng:w,lat:D})},Fi=function(){function p(v,m){Ia(this,p),this.container=void 0,this.cursor=null,this.options=void 0,this.container=lr(v),this.options=m}return Sl(p,[{key:"setCursor",value:function(v){v!==this.cursor&&this.container&&(this.container.style.cursor=v?this.options[v]:"",this.cursor=v)}},{key:"destroy",value:function(){this.setCursor(null)}}]),p}();function Vr(p,v){v===void 0&&(v={});var m=v.insertAt;if(p&&typeof document!="undefined"){var w=document.head||document.getElementsByTagName("head")[0],D=document.createElement("style");D.type="text/css",m==="top"&&w.firstChild?w.insertBefore(D,w.firstChild):w.appendChild(D),D.styleSheet?D.styleSheet.cssText=p:D.appendChild(document.createTextNode(p))}}Vr('.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}'),Vr(".tippy-box[data-theme~=light]{color:#26323d;box-shadow:0 0 20px 4px rgba(154,161,177,.15),0 4px 80px -8px rgba(36,40,47,.25),0 4px 4px -2px rgba(91,94,105,.15);background-color:#fff}.tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff}.tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff}.tippy-box[data-theme~=light]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light]>.tippy-svg-arrow{fill:#fff}");var po=function(){function p(v,m){var w=this;Ia(this,p),this.content="",this.tippy=void 0,this.scene=void 0,this.isMouseInner=!1,this.onMouseMove=function(){w.isMouseInner=!0,w.checkTippyShow()},this.onMouseOut=function(){w.isMouseInner=!1,w.checkTippyShow()},this.setContent=nc(function(N){var W;w.content=N!=null?N:"",(W=w.tippy)===null||W===void 0||W.setContent(N!=null?N:""),w.checkTippyShow()},16,{maxWait:16});var D=lr(v);this.scene=v,D&&(this.tippy=Zo(lr(v),mn(mn({},At),m)),this.tippy.hide(),v.on(ve.SceneEvent.Mousemove,this.onMouseMove),v.on(ve.SceneEvent.Mouseout,this.onMouseOut))}return Sl(p,[{key:"getContent",value:function(){return this.content}},{key:"checkTippyShow",value:function(){var v,m;this.content&&this.isMouseInner?(v=this.tippy)===null||v===void 0||v.show():(m=this.tippy)===null||m===void 0||m.hide()}},{key:"destroy",value:function(){var v;this.scene.off(ve.SceneEvent.Mousemove,this.onMouseMove),this.scene.off(ve.SceneEvent.Mouseout,this.onMouseOut),(v=this.tippy)===null||v===void 0||v.destroy()}}]),p}(),la=function(){function p(v){var m=v.config;Ia(this,p),this.historyList=[],this.historyIndex=0,this.config=void 0,this.config=m}return Sl(p,[{key:"save",value:function(v){if(this.config){var m=this.config.maxSize;this.historyIndex&&(this.historyList=this.historyList.slice(this.historyIndex),this.historyIndex=0),m>this.historyList.length||this.historyList.pop();var w=Fc(v);return this.historyList.unshift(w),w}}},{key:"revert",value:function(){if(this.historyList.length&&this.historyList.length-1>this.historyIndex){var v=this.historyList[++this.historyIndex];return v?Fc(v):void 0}}},{key:"redo",value:function(){if(this.historyList.length&&this.historyIndex>0){var v=this.historyList[--this.historyIndex];return v?Fc(v):void 0}}}]),p}(),Ns=function(p){function v(m){var w,D=m.data,N=m.render,W=m.history,$=m.scene,ie=m.bbox;return Ia(this,v),(w=Dn(this,v)).scene=void 0,w.render=void 0,w.data=Fc(R),w.timeout=null,w.diffData={},w.enableBBox=void 0,w.featureType=void 0,w.history=void 0,w.scene=$,w.render=N,W&&(w.history=new la({config:W})),D&&w.setData(D),w.featureType=N.polygon?"polygon":N.line?"line":"point",w.enableBBox=ie,w}return Aa(v,p),Sl(v,[{key:"saveHistory",value:function(){var m;return(m=this.history)===null||m===void 0?void 0:m.save(this.data)}},{key:"revertHistory",value:function(){var m,w=(m=this.history)===null||m===void 0?void 0:m.revert();if(w)return this.setData(w),w}},{key:"redoHistory",value:function(){var m,w=(m=this.history)===null||m===void 0?void 0:m.redo();if(w)return this.setData(w),w}},{key:"setData",value:function(m){var w,D=this;return Object.keys(m).length&&(this.enableBBox&&(!((w=m[this.featureType])===null||w===void 0)&&w.length)&&(m[this.featureType]=st(m[this.featureType])),this.data=mn(mn({},this.data),m),this.diffData=mn(mn({},this.diffData),m),this.timeout||(this.timeout=requestAnimationFrame(function(){return D.updateDiffData()})),this.emit(ve.SourceEvent.Change,{data:this.data})),this.data}},{key:"getData",value:function(){return this.data}},{key:"getRenderData",value:function(m){return this.data[m]}},{key:"setRenderData",value:function(m,w){var D=typeof w=="function"?w(this.getRenderData(m)):w;return this.setData(Va({},m,D)),this.emit(ve.SourceEvent.Change,this.data),D}},{key:"updateDiffData",value:function(){var m=this,w=Object.entries(this.diffData);w.length&&(w.forEach(function(D){var N,W=bs(D,2),$=W[0],ie=W[1];Array.isArray(ie)&&((N=m.getRender($))===null||N===void 0||N.setData(ie))}),this.emit(ve.SourceEvent.Update,this.data,this.diffData),this.diffData={},this.timeout=null,requestAnimationFrame(function(){m.scene.render()}))}},{key:"getRender",value:function(m){return this.render[m]}},{key:"clear",value:function(){this.setData(Pe(Object.keys(this.render).map(function(m){return[m,[]]})))}}]),v}(su),Fl=function(p){function v(m,w){var D,N;Ia(this,v),(N=Dn(this,v)).scene=void 0,N.source=void 0,N.render=void 0,N.cursor=void 0,N.options=void 0,N.enabled=!1,N.allowCreate=!1,N.sceneRender=void 0,N.mouseLngLat={lng:0,lat:0},N.popup=void 0,N.addCount=0,N.saveMouseLngLat=nc(function(pe){N.mouseLngLat=Mt(pe)},100,{maxWait:100}),N.saveHistory=nc(function(){N.options.history&&N.source.saveHistory()},100),N.bindThis(),N.scene=m,N.sceneRender=new s(m),N.options=ru({},N.getDefaultOptions(w),w),N.render=N.initRender(),N.source=new Ns({render:N.render,history:N.options.history||void 0,scene:m,bbox:(D=N.options.bbox)!==null&&D!==void 0&&D}),N.cursor=new Fi(m,N.options.cursor);var W=N.options,$=W.initialData,ie=W.popup;return $&&N.setData($),ie&&(N.popup=new po(m,ie instanceof Object?ie:{})),N.saveHistory(),N.bindCommonEvent(),N.emit(ve.DrawEvent.Init,Ku(N)),N.bindEnableEvent(),v.instances.push(Ku(N)),N}return Aa(v,p),Sl(v,[{key:"addable",get:function(){var m=this.getData(),w=this.options,D=w.multiple,N=w.maxCount,W=m.find(function($){var ie;return(ie=$.properties)===null||ie===void 0?void 0:ie.isDraw});return!(!this.enabled||!this.allowCreate)&&(!!(D&&0>=N||W)||!(!D&&this.addCount>=1)&&(0>=N||N>m.length))}},{key:"getOptions",value:function(){return this.options}},{key:"getEditItem",value:function(){return this.editItem}},{key:"getDragItem",value:function(){return this.dragItem}},{key:"setHelper",value:function(m){var w,D,N=this.options.helper;if(N){var W=(w=m in N?N[m]:m)!==null&&w!==void 0?w:null;(D=this.popup)===null||D===void 0||D.setContent(W)}}},{key:"isEnable",value:function(){return this.enabled}},{key:"bindThis",value:function(){this.initRender=this.initRender.bind(this),this.getData=this.getData.bind(this),this.setData=this.setData.bind(this),this.emitChangeEvent=this.emitChangeEvent.bind(this),this.saveHistory=this.saveHistory.bind(this),this.onSceneMouseMove=this.onSceneMouseMove.bind(this),this.revertHistory=this.revertHistory.bind(this),this.redoHistory=this.redoHistory.bind(this),this.removeActiveFeature=this.removeActiveFeature.bind(this),this.bindCommonEvent=this.bindCommonEvent.bind(this),this.bindEnableEvent=this.bindEnableEvent.bind(this),this.unbindEnableEvent=this.unbindEnableEvent.bind(this),this.setActiveFeature=this.setActiveFeature.bind(this)}},{key:"bindCommonEvent",value:function(){var m=this;this.on(ve.DrawEvent.Add,this.emitChangeEvent),this.on(ve.DrawEvent.Add,function(){m.addCount++}),this.on(ve.DrawEvent.Edit,this.emitChangeEvent),this.on(ve.DrawEvent.Remove,this.emitChangeEvent),this.on(ve.DrawEvent.Clear,this.emitChangeEvent),this.on(ve.DrawEvent.AddNode,this.saveHistory),this.on(ve.DrawEvent.RemoveNode,this.emitChangeEvent),this.bindEmitSelectEvent(!0)}},{key:"bindEmitSelectEvent",value:function(){var m=this,w=arguments.length>0&&arguments[0]!==void 0&&arguments[0],D=null,N=function(){var W,$,ie,pe=m.getData(!0).find(function(we){var ke;return(ke=we.properties)===null||ke===void 0?void 0:ke.isActive})||null;((W=D)===null||W===void 0||($=W.properties)===null||$===void 0?void 0:$.id)!==(pe==null||(ie=pe.properties)===null||ie===void 0?void 0:ie.id)&&(D=pe,m.emit(ve.DrawEvent.Select,pe))};this.source.on(ve.SourceEvent.Change,N),w&&N()}},{key:"bindEnableEvent",value:function(){this.unbindKeyboardEvent(),this.scene.setMapStatus({doubleClickZoom:!1}),this.scene.on(ve.SceneEvent.Mousemove,this.saveMouseLngLat),this.bindKeyboardEvent()}},{key:"unbindEnableEvent",value:function(){this.scene.setMapStatus({doubleClickZoom:!0}),this.scene.off(ve.SceneEvent.Mousemove,this.saveMouseLngLat),this.unbindKeyboardEvent()}},{key:"bindKeyboardEvent",value:function(){var m=this,w=this.options.keyboard||{},D=w.revert,N=w.redo,W=w.remove;W&&mu.bind(W,function(){m.removeActiveFeature()}),this.options.history&&(D&&mu.bind(D,this.revertHistory),N&&mu.bind(N,this.redoHistory))}},{key:"unbindKeyboardEvent",value:function(){var m=this.options.keyboard||{},w=m.revert,D=m.redo,N=m.remove;N&&mu.unbind(N),this.options.history&&(w&&mu.unbind(w),D&&mu.unbind(D))}},{key:"emitChangeEvent",value:function(){this.emit(ve.DrawEvent.Change,this.getData()),this.saveHistory()}},{key:"revertHistory",value:function(){this.enabled&&this.options.history&&this.source.revertHistory()&&(this.correctDrawItem(),this.emit(ve.DrawEvent.Change,this.getData()))}},{key:"redoHistory",value:function(){this.enabled&&this.options.history&&this.source.redoHistory()&&(this.correctDrawItem(),this.emit(ve.DrawEvent.Change,this.getData()))}},{key:"getRenderLayers",value:function(){return Pe(Ca(this.render).map(function(m){var w=bs(m,2);return[w[0],w[1].getLayers()]}))}},{key:"getTargetFeature",value:function(m){var w,D,N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getData(!0),W=null;return m&&(W=(w=N.find(function($){var ie,pe;return((ie=$.properties)===null||ie===void 0?void 0:ie.id)===(typeof m=="string"?m:(pe=m.properties)===null||pe===void 0?void 0:pe.id)}))!==null&&w!==void 0?w:null,!W&&m instanceof Object&&(W=(D=N.find(function($){return xi(m.geometry,$.geometry)}))!==null&&D!==void 0?D:null)),W}},{key:"removeActiveFeature",value:function(){var m=this.getData(!0).find(function(w){var D,N=(D=w.properties)!==null&&D!==void 0?D:{};return N.isActive||N.isDraw});return m&&this.removeFeature(m),m}},{key:"removeFeature",value:function(m){var w=this.getData(!0),D=this.getTargetFeature(m);D&&(this.setData(w.filter(function(N){return!Qo(D,N)})),this.emit(ve.DrawEvent.Remove,m,this.getData()))}},{key:"correctDrawItem",value:function(){this.getData(!0).find(function(m){var w;return(w=m.properties)===null||w===void 0?void 0:w.isDraw})&&this.onSceneMouseMove({type:"mousemove",lnglat:this.mouseLngLat,lngLat:this.mouseLngLat})}},{key:"initRender",value:function(){var m,w={},D=function(W,$){var ie=typeof Symbol!="undefined"&&W[Symbol.iterator]||W["@@iterator"];if(!ie){if(Array.isArray(W)||(ie=Nl(W))||$&&W&&typeof W.length=="number"){ie&&(W=ie);var pe=0,we=function(){};return{s:we,n:function(){return W.length>pe?{done:!1,value:W[pe++]}:{done:!0}},e:function(mt){throw mt},f:we}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ke,Ge=!0,ht=!1;return{s:function(){ie=ie.call(W)},n:function(){var mt=ie.next();return Ge=mt.done,mt},e:function(mt){ht=!0,ke=mt},f:function(){try{Ge||ie.return==null||ie.return()}finally{if(ht)throw ke}}}}(this.getRenderTypes());try{for(D.s();!(m=D.n()).done;){var N=m.value;w[N]=new I[N](this.scene,{style:this.options.style[N]})}}catch(W){D.e(W)}finally{D.f()}return w}},{key:"getCommonOptions",value:function(m){return{initialData:[],autoActive:!0,cursor:Fc(M),editable:!0,style:Fc(b),multiple:!0,history:Fc(Wl),keyboard:Fc(ut),popup:!0,helper:{},maxCount:-1}}},{key:"setCursor",value:function(m){this.cursor.setCursor(m)}},{key:"resetCursor",value:function(){this.setCursor(this.addable?"draw":null)}},{key:"enable",value:function(){var m=this;this.allowCreate=0>=arguments.length||arguments[0]===void 0||arguments[0],this.addCount=0,this.enabled=!0,this.bindEnableEvent(),this.resetCursor(),this.setHelper(this.addable?"draw":null),setTimeout(function(){m.emit(ve.DrawEvent.Enable,m)},0)}},{key:"disable",value:function(){var m=this;this.resetFeatures(),this.enabled=!1,this.setCursor(null),this.unbindEnableEvent(),this.addCount=0,this.setHelper(null),setTimeout(function(){m.emit(ve.DrawEvent.Disable,m)},0)}},{key:"clear",value:function(){var m=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this.source.clear(),this.emit(ve.DrawEvent.Clear,this),m&&this.disable()}},{key:"show",value:function(){return Object.values(this.render).forEach(function(m){m.show()})}},{key:"hide",value:function(){return Object.values(this.render).forEach(function(m){m.hide()})}},{key:"destroy",value:function(){var m,w=this;Object.values(this.render).forEach(function(N){N.destroy()}),Object.values(ve.RenderEvent).forEach(function(N){Object.values(w.render).forEach(function(W){W.removeAllListeners(N)}),w.sceneRender.removeAllListeners(N)}),setTimeout(function(){Object.values(ve.DrawEvent).forEach(function(N){w.removeAllListeners(N)})},0),(m=this.popup)===null||m===void 0||m.destroy(),this.cursor.destroy(),this.emit(ve.DrawEvent.Destroy,this);var D=v.instances.indexOf(this);D>-1&&v.instances.splice(D,1)}}]),v}(su);Fl.instances=[];var ic=function(p){var v=p==null?0:p.length;return v?p[v-1]:void 0},ed=function(p){function v(){return Ia(this,v),Dn(this,v,arguments)}return Aa(v,p),Sl(v,[{key:"pointRender",get:function(){return this.render.point}},{key:"dragPoint",get:function(){return this.getPointData().find(function(m){return m.properties.isDrag})}},{key:"editPoint",get:function(){return this.getPointData().find(function(m){return m.properties.isActive})}},{key:"hoverPoint",get:function(){return this.getPointData().find(function(m){return m.properties.isHover})}},{key:"getDragPoint",value:function(){return this.dragPoint}},{key:"getEditPoint",value:function(){return this.editPoint}},{key:"getPointData",value:function(){return this.source.getRenderData("point")}},{key:"setPointData",value:function(m){return this.source.setRenderData("point",m)}},{key:"bindPointRenderEvent",value:function(){var m,w,D,N,W,$;(m=this.pointRender)===null||m===void 0||m.on(ve.RenderEvent.UnClick,this.onPointCreate.bind(this)),(w=this.pointRender)===null||w===void 0||w.on(ve.RenderEvent.Mousemove,this.onPointMouseMove.bind(this)),(D=this.pointRender)===null||D===void 0||D.on(ve.RenderEvent.Mouseout,this.onPointMouseOut.bind(this)),(N=this.pointRender)===null||N===void 0||N.on(ve.RenderEvent.Dragstart,this.onPointDragStart.bind(this)),(W=this.pointRender)===null||W===void 0||W.on(ve.RenderEvent.Dragging,this.onPointDragging.bind(this)),($=this.pointRender)===null||$===void 0||$.on(ve.RenderEvent.Dragend,this.onPointDragEnd.bind(this))}},{key:"handleCreatePoint",value:function(m){var w=this.options,D=w.autoActive,N=w.editable,W=Mr(m);return this.setPointData(function($){return Qs({target:W,data:[].concat(Os($),[W]),targetHandler:function(ie){ie.properties=mn(mn({},ie.properties),{},{isHover:N,isActive:D&&N})},otherHandler:function(ie){ie.properties=mn(mn({},ie.properties),{},{isHover:!1,isActive:!1,isDrag:!1})}})}),W}},{key:"handlePointHover",value:function(m){return this.setCursor("pointHover"),Qo(m,this.hoverPoint)||this.setPointData(function(w){return Qs({target:m,data:w,targetHandler:function(D){D.properties.isHover=!0},otherHandler:function(D){D.properties.isHover=!1}})}),m}},{key:"handlePointUnHover",value:function(m){return this.resetCursor(),this.setPointData(function(w){return w.map(function(D){return D.properties.isHover=!1,D})}),m}},{key:"handlePointDragStart",value:function(m){return this.setPointData(function(w){return Qs({target:m,data:w,targetHandler:function(D){D.properties=mn(mn({},D.properties),{},{isDrag:!0,isActive:!0})},otherHandler:function(D){D.properties=mn(mn({},D.properties),{},{isDrag:!1,isActive:!1})}})}),this.scene.setMapStatus({dragEnable:!1}),this.setCursor("pointDrag"),m}},{key:"handlePointDragging",value:function(m,w){return this.setPointData(function(D){return Qs({target:m,data:D,targetHandler:function(N){N.geometry.coordinates=pt(w)}})}),this.scene.setMapStatus({dragEnable:!1}),this.setCursor("pointDrag"),m}},{key:"handlePointDragEnd",value:function(m){return this.setPointData(function(w){return Qs({target:m,data:w,targetHandler:function(D){D.properties.isDrag=!1}})}),this.scene.setMapStatus({dragEnable:!0}),this.setCursor("pointHover"),m}},{key:"onPointCreate",value:function(m){return this.handleCreatePoint(pt(Mt(m)))}},{key:"onPointMouseMove",value:function(m){return this.handlePointHover(m.feature)}},{key:"onPointMouseOut",value:function(m){return this.handlePointUnHover(m.feature)}},{key:"onPointDragStart",value:function(m){if(this.options.editable)return this.handlePointDragStart(m.feature)}},{key:"onPointDragging",value:function(m){var w=this.dragPoint;if(this.options.editable&&w)return this.handlePointDragging(w,Mt(m))}},{key:"onPointDragEnd",value:function(m){var w=this.dragPoint;if(this.options.editable&&w)return this.handlePointDragEnd(w)}},{key:"enablePointRenderAction",value:function(){var m,w,D,N,W=this.options.editable;this.enabled&&((w=this.pointRender)===null||w===void 0||w.enableCreate()),(m=this.pointRender)===null||m===void 0||m.enableClick(),W&&((D=this.pointRender)===null||D===void 0||D.enableHover(),(N=this.pointRender)===null||N===void 0||N.enableDrag())}},{key:"disablePointRenderAction",value:function(){var m,w,D,N;(m=this.pointRender)===null||m===void 0||m.disableCreate(),(w=this.pointRender)===null||w===void 0||w.disableHover(),(D=this.pointRender)===null||D===void 0||D.disableDrag(),(N=this.pointRender)===null||N===void 0||N.disableClick()}}]),v}(Fl),Ch=function(p){function v(){return Ia(this,v),Dn(this,v,arguments)}return Aa(v,p),Sl(v,[{key:"midPointRender",get:function(){return this.render.midPoint}},{key:"getCommonOptions",value:function(m){return mn(mn({},lo(Ni(v.prototype),"getCommonOptions",this).call(this,m)),{},{showMidPoint:!0})}},{key:"bindMidPointRenderEvent",value:function(){var m,w,D;(m=this.midPointRender)===null||m===void 0||m.on(ve.RenderEvent.Click,this.onMidPointClick.bind(this)),(w=this.midPointRender)===null||w===void 0||w.on(ve.RenderEvent.Mousemove,this.onMidPointHover.bind(this)),(D=this.midPointRender)===null||D===void 0||D.on(ve.RenderEvent.Mouseout,this.onMidPointUnHover.bind(this))}},{key:"getMidPointData",value:function(){return this.source.getRenderData("midPoint")}},{key:"setMidPointData",value:function(m){return this.source.setRenderData("midPoint",m)}},{key:"getMidPointsByLine",value:function(m){var w=m.properties.nodes;if(!this.options.showMidPoint||2>w.length)return[];for(var D=[],N=0;w.length-1>N;N++){var W,$,ie,pe,we=ih(Ks([w[N],w[N+1]]),{properties:{id:ya("midPoint"),startId:(W=($=w[N].properties)===null||$===void 0?void 0:$.id)!==null&&W!==void 0?W:"",endId:(ie=(pe=w[N+1].properties)===null||pe===void 0?void 0:pe.id)!==null&&ie!==void 0?ie:""}});D.push(we)}return D}},{key:"onMidPointHover",value:function(m){this.setCursor("pointHover")}},{key:"onMidPointUnHover",value:function(m){this.resetCursor()}},{key:"enableMidPointRenderAction",value:function(){var m,w;(m=this.midPointRender)===null||m===void 0||m.enableClick(),(w=this.midPointRender)===null||w===void 0||w.enableHover()}},{key:"disableMidPointRenderAction",value:function(){var m,w;(m=this.midPointRender)===null||m===void 0||m.disableClick(),(w=this.midPointRender)===null||w===void 0||w.disableHover()}}]),v}(ed),Sd=function(p){function v(){var m;Ia(this,v);for(var w=arguments.length,D=Array(w),N=0;w>N;N++)D[N]=arguments[N];return(m=Dn(this,v,[].concat(D))).prevCreateTime=Date.now(),m.previousPosition=[0,0],m}return Aa(v,p),Sl(v,[{key:"isDragTrigger",get:function(){return this.options.trigger==="drag"}},{key:"isClickTrigger",get:function(){return this.options.trigger==="click"}},{key:"editLine",get:function(){return this.getLineData().find(function(m){var w=m.properties;return!w.isDraw&&w.isActive})}},{key:"lineRender",get:function(){return this.render.line}},{key:"dragLine",get:function(){return this.getLineData().find(function(m){return m.properties.isDrag})}},{key:"drawLine",get:function(){return this.getLineData().find(function(m){return m.properties.isDraw})}},{key:"hoverLine",get:function(){return this.getLineData().find(function(m){return m.properties.isHover})}},{key:"getDragLine",value:function(){return this.dragLine}},{key:"getDrawLine",value:function(){return this.drawLine}},{key:"getEditLine",value:function(){return this.editLine}},{key:"getDefaultOptions",value:function(m){var w=mn(mn({},this.getCommonOptions(m)),{},{showMidPoint:!0,distanceOptions:!1,helper:Fc(G),dragOptions:Fc(jr)});return m.distanceOptions&&(w.distanceOptions=mn(mn({},Qa),w.distanceOptions)),m.adsorbOptions&&(w.adsorbOptions=mn(mn({},ir),w.adsorbOptions),w.bbox=!0),m.trigger==="drag"&&(w.autoActive=!1,w.helper=mn(mn({},w.helper),fe)),w}},{key:"getAdsorbPosition",value:function(m){var w=this.options.adsorbOptions;return typeof w=="boolean"?m:_n({adsorbOptions:w,position:m,scene:this.scene,draw:this})}},{key:"bindSceneEvent",value:function(){this.sceneRender.on(ve.RenderEvent.Mousemove,this.onSceneMouseMove.bind(this))}},{key:"bindPointRenderEvent",value:function(){var m;lo(Ni(v.prototype),"bindPointRenderEvent",this).call(this),(m=this.pointRender)===null||m===void 0||m.on(ve.RenderEvent.Click,this.onPointClick.bind(this))}},{key:"bindLineRenderEvent",value:function(){var m,w,D,N,W,$;(m=this.lineRender)===null||m===void 0||m.on(ve.RenderEvent.UnClick,this.onLineUnClick.bind(this)),(w=this.lineRender)===null||w===void 0||w.on(ve.RenderEvent.Mousemove,this.onLineMouseMove.bind(this)),(D=this.lineRender)===null||D===void 0||D.on(ve.RenderEvent.Mouseout,this.onLineMouseOut.bind(this)),(N=this.lineRender)===null||N===void 0||N.on(ve.RenderEvent.Dragstart,this.onLineDragStart.bind(this)),(W=this.lineRender)===null||W===void 0||W.on(ve.RenderEvent.Dragging,this.onLineDragging.bind(this)),($=this.lineRender)===null||$===void 0||$.on(ve.RenderEvent.Dragend,this.onLineDragEnd.bind(this))}},{key:"getDashLineDistanceTexts",value:function(m,w){var D=w.showTotalDistance,N=w.format;return w.showDashDistance?m.map(function(W){return Jt(W,{showTotalDistance:D,format:N},{isActive:!0,type:"dash"})}).flat():[]}},{key:"getLineDistanceTexts",value:function(m,w){var D=w.showTotalDistance,N=w.format,W=w.showWhen,$=[];if(W.includes("active")){var ie=m.filter(function(we){return we.properties.isActive&&we.properties.nodes.length>1});$.push.apply($,Os(ie.map(function(we){return Jt(we,{showTotalDistance:D,format:N},{isActive:!0})}).flat()))}if(W.includes("normal")){var pe=m.filter(function(we){return!we.properties.isActive&&we.properties.nodes.length>1});$.push.apply($,Os(pe.map(function(we){return Jt(we,{showTotalDistance:D,format:N})}).flat()))}return $}},{key:"getDistanceTexts",value:function(){var m=this.options.distanceOptions;if(!m)return[];var w=[],D=m.showWhen,N=m.showDashDistance,W=m.format,$=m.showTotalDistance;return w.push.apply(w,Os(this.getDashLineDistanceTexts(this.getDashLineData(),{showTotalDistance:!1,format:W,showDashDistance:N})).concat(Os(this.getLineDistanceTexts(this.getLineData(),{showTotalDistance:$,format:W,showWhen:D})))),w}},{key:"getAllTexts",value:function(){return this.getDistanceTexts()}},{key:"handleCreateLine",value:function(m){var w=Bi([m],{isActive:!0,isDraw:!0});return this.setLineData(function(D){return Qs({target:w,data:[].concat(Os(D),[w]),otherHandler:function(N){N.properties.isActive=!1}})}),this.setPointData([m]),this.setTextData(this.getAllTexts()),w}},{key:"syncLineNodes",value:function(m,w){return m.properties.nodes=w,m.geometry.coordinates=sl(Ks(w)),this.setLineData(function(D){return D.map(function(N){return Qo(N,m)?m:N})}),Qo(this.editLine,m)&&this.setMidPointData(this.getMidPointsByLine(m)),this.setPointData(m.properties.nodes),this.setTextData(this.getAllTexts()),m}},{key:"setActiveLine",value:function(m){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.setLineData(function(D){return Qs({target:m,data:D,targetHandler:function(N){N.properties=mn(mn({},N.properties),{},{isDraw:!1,isActive:!0,isDrag:!1,isHover:!1},w)},otherHandler:function(N){N.properties=mn(mn({},N.properties),{},{isDraw:!1,isActive:!1,isDrag:!1})}})}),this.setPointData(m.properties.nodes.map(function(D){return D.properties=mn(mn({},D.properties),{},{isHover:!1,isActive:!1}),D})),this.setMidPointData(this.getMidPointsByLine(m)),this.setDashLineData([]),this.setTextData(this.getAllTexts()),m}},{key:"clearActiveLine",value:function(){this.source.setData({point:[],line:this.getLineData().map(function(m){return m.properties=mn(mn({},m.properties),{},{isDrag:!1,isActive:!1,isHover:!1}),m}),midPoint:[],text:this.getAllTexts()})}},{key:"handleLineUnClick",value:function(m){return this.clearActiveLine(),m}},{key:"handleLineHover",value:function(m){if(!this.drawLine)return this.setCursor("lineHover"),Qo(m,this.hoverLine)||this.setLineData(function(w){return Qs({target:m,data:w,targetHandler:function(D){D.properties.isHover=!0},otherHandler:function(D){D.properties.isHover=!1}})}),m}},{key:"handleLineUnHover",value:function(m){if(!this.drawLine)return this.resetCursor(),this.setLineData(function(w){return w.map(function(D){return D.properties.isHover=!1,D})}),m}},{key:"handleLineDragStart",value:function(m){return this.setActiveLine(m,{isDrag:!0,isActive:!0}),this.scene.setMapStatus({dragEnable:!1}),this.setCursor("lineDrag"),m}},{key:"handleLineDragging",value:function(m,w){var D=w.lng,N=w.lat,W=m.properties.nodes,$=bs(this.previousPosition,2),ie=$[0],pe=$[1];return W.forEach(function(we){var ke=we.geometry.coordinates;we.geometry.coordinates=[Br(ke[0]+D-ie),Br(ke[1]+N-pe)]}),this.syncLineNodes(m,W),this.setActiveLine(m,{isDrag:!0}),this.setCursor("lineDrag"),this.previousPosition=[D,N],m}},{key:"handleLineDragEnd",value:function(m){return m.properties.isDrag=!1,this.setLineData(function(w){return w}),this.scene.setMapStatus({dragEnable:!0}),m}},{key:"resetAdsorbLngLat",value:function(m){if(this.options.adsorbOptions){var w=this.getAdsorbPosition(pt(Mt(m)));return w&&Qn(m,w),w}}},{key:"onPointCreate",value:function(m){if(!this.editLine){this.resetAdsorbLngLat(m);var w=lo(Ni(v.prototype),"onPointCreate",this).call(this,m),D=this.drawLine;if(w)return D?(this.syncLineNodes(D,[].concat(Os(D.properties.nodes),[w])),this.setDashLineData([])):this.handleCreateLine(w),w}}},{key:"onPointDragStart",value:function(m){if(this.editLine)return this.setHelper("pointDrag"),lo(Ni(v.prototype),"onPointDragStart",this).call(this,m)}},{key:"onPointDragging",value:function(m){var w=lo(Ni(v.prototype),"onPointDragging",this).call(this,m);if(w){var D=this.resetAdsorbLngLat(m);D&&(w.geometry.coordinates=Fc(D))}var N=this.editLine;return N&&w&&(this.syncLineNodes(N,N.properties.nodes.map(function(W){return Qo(w,W)?w:W})),this.setActiveLine(N)),w}},{key:"onPointDragEnd",value:function(m){if(this.editLine){var w=lo(Ni(v.prototype),"onPointDragEnd",this).call(this,m);return this.setPointData(function(D){return D.map(function(N){return N.properties.isActive=!1,N})}),this.setHelper("pointHover"),w}}},{key:"onLineUnClick",value:function(m){var w=this.editLine;if(w)return this.handleLineUnClick(w)}},{key:"onLineMouseMove",value:function(m){if(!this.drawLine)return this.dragLine||this.drawLine||!this.options.editable||this.setHelper("lineHover"),this.handleLineHover(m.feature)}},{key:"onLineMouseOut",value:function(m){if(!this.drawLine)return this.dragLine||this.drawLine||this.setHelper(this.addable?"draw":null),this.handleLineUnHover(m.feature)}},{key:"onLineDragStart",value:function(m){if(this.options.editable&&!this.drawLine)return this.previousPosition=Xt(m),this.setHelper("lineDrag"),this.handleLineDragStart(m.feature)}},{key:"onLineDragging",value:function(m){var w=this.dragLine;if(w)return this.handleLineDragging(w,Mt(m))}},{key:"onLineDragEnd",value:function(m){var w=this.dragLine;if(w)return this.setHelper("lineHover"),this.handleLineDragEnd(w)}},{key:"onPointMouseMove",value:function(m){var w=lo(Ni(v.prototype),"onPointMouseMove",this).call(this,m);return this.dragLine||this.drawLine||this.dragPoint||this.setHelper("pointHover"),w}},{key:"onPointMouseOut",value:function(m){var w=lo(Ni(v.prototype),"onPointMouseOut",this).call(this,m);return this.dragLine||this.drawLine||this.dragPoint||this.setHelper(this.addable?"draw":null),w}},{key:"onMidPointHover",value:function(m){lo(Ni(v.prototype),"onMidPointHover",this).call(this,m),this.setHelper("midPointHover")}},{key:"onMidPointUnHover",value:function(m){lo(Ni(v.prototype),"onMidPointUnHover",this).call(this,m),this.setHelper(null)}},{key:"onPointClick",value:function(m){}},{key:"getLineData",value:function(){return this.source.getRenderData("line")}},{key:"setLineData",value:function(m){return this.source.setRenderData("line",m)}},{key:"getTextData",value:function(){return this.source.getRenderData("text")}},{key:"setTextData",value:function(m){return this.source.setRenderData("text",m)}},{key:"getDashLineData",value:function(){return this.source.getRenderData("dashLine")}},{key:"setDashLineData",value:function(m){return this.source.setRenderData("dashLine",m)}},{key:"onMidPointClick",value:function(m){var w=this.editLine,D=m.feature;if(w&&D&&!this.dragPoint){var N=w.properties.nodes,W=D.properties,$=W.startId,ie=W.endId,pe=N.findIndex(function(Ge){return Ge.properties.id===$}),we=N.findIndex(function(Ge){return Ge.properties.id===ie});if(pe>-1&&we>-1){var ke=Mr(D.geometry.coordinates,{isDrag:!0,isHover:!0});return this.setHelper("pointDrag"),N.splice(we,0,ke),w.geometry.coordinates=sl(Ks(N)),this.syncLineNodes(w,N),this.setActiveLine(w),ke}}}},{key:"enableSceneRenderAction",value:function(){this.sceneRender.enableDrag(),this.sceneRender.enableMouseMove(),this.sceneRender.enableDblClick()}},{key:"disableSceneRenderAction",value:function(){this.sceneRender.disableDrag(),this.sceneRender.disableMouseMove(),this.sceneRender.disableDblClick()}},{key:"enableLineRenderAction",value:function(){var m,w,D,N=this.options.editable;(m=this.lineRender)===null||m===void 0||m.enableUnClick(),N&&((w=this.lineRender)===null||w===void 0||w.enableHover(),(D=this.lineRender)===null||D===void 0||D.enableDrag())}},{key:"disableLineRenderAction",value:function(){var m,w,D;(m=this.lineRender)===null||m===void 0||m.disableUnClick(),(w=this.lineRender)===null||w===void 0||w.disableHover(),(D=this.lineRender)===null||D===void 0||D.disableDrag()}},{key:"onSceneDragStart",value:function(m){this.isDragTrigger&&this.addable&&!this.dragPoint&&!this.editLine&&(this.scene.setMapStatus({dragEnable:!1}),this.onPointCreate(m),this.prevCreateTime=Date.now(),this.sceneRender.on(ve.RenderEvent.Dragging,this.onSceneDragging))}},{key:"onSceneDragging",value:function(m){var w=this.drawLine,D=Date.now(),N=mn(mn({},jr),this.options.dragOptions),W=N.dotDistance,$=N.dotDuration;if(this.isDragTrigger&&this.addable&&w&&(!$||D-this.prevCreateTime>=$)){var ie=Mt(m),pe=ie.lng,we=ie.lat,ke=ic(w.properties.nodes).geometry.coordinates,Ge=this.scene.lngLatToPixel([ke[0],ke[1]]),ht=Ge.x,mt=Ge.y,St=this.scene.lngLatToPixel([pe,we]),xt=St.x,bt=St.y;W&&Math.pow(W,2)>=Math.pow(xt-ht,2)+Math.pow(bt-mt,2)||(this.onPointCreate(m),this.prevCreateTime=D)}}},{key:"onSceneDragEnd",value:function(m){}},{key:"bindSceneDragEvent",value:function(){this.unbindSceneDragEvent(),this.sceneRender.on(ve.RenderEvent.Dragstart,this.onSceneDragStart),this.sceneRender.on(ve.RenderEvent.Dragging,this.onSceneDragging),this.sceneRender.on(ve.RenderEvent.Dragend,this.onSceneDragEnd),this.scene.setMapStatus({dragEnable:!1})}},{key:"unbindSceneDragEvent",value:function(){this.sceneRender.off(ve.RenderEvent.Dragstart,this.onSceneDragStart),this.sceneRender.off(ve.RenderEvent.Dragging,this.onSceneDragging),this.sceneRender.off(ve.RenderEvent.Dragend,this.onSceneDragEnd),this.scene.setMapStatus({dragEnable:!0})}},{key:"bindEnableEvent",value:function(){lo(Ni(v.prototype),"bindEnableEvent",this).call(this),this.isDragTrigger&&this.bindSceneDragEvent()}},{key:"unbindEnableEvent",value:function(){lo(Ni(v.prototype),"unbindEnableEvent",this).call(this),this.isDragTrigger&&this.unbindSceneDragEvent()}},{key:"bindThis",value:function(){lo(Ni(v.prototype),"bindThis",this).call(this),this.onSceneDragStart=this.onSceneDragStart.bind(this),this.onSceneDragging=this.onSceneDragging.bind(this),this.onSceneDragEnd=this.onSceneDragEnd.bind(this)}}]),v}(Ch),Up=function(p){function v(){return Ia(this,v),Dn(this,v,arguments)}return Aa(v,p),Sl(v,[{key:"dragItem",get:function(){return this.dragPolygon}},{key:"editItem",get:function(){return this.editPolygon}},{key:"polygonRender",get:function(){return this.render.polygon}},{key:"dragPolygon",get:function(){return this.getPolygonData().find(function(m){return m.properties.isDrag})}},{key:"drawPolygon",get:function(){return this.getPolygonData().find(function(m){return m.properties.isDraw})}},{key:"editPolygon",get:function(){return this.getPolygonData().find(function(m){var w=m.properties;return!w.isDraw&&w.isActive})}},{key:"hoverPolygon",get:function(){return this.getPolygonData().find(function(m){return m.properties.isHover})}},{key:"getDragPolygon",value:function(){return this.dragPolygon}},{key:"getDrawPolygon",value:function(){return this.drawPolygon}},{key:"getEditPolygon",value:function(){return this.editPolygon}},{key:"getRenderTypes",value:function(){return["polygon","line","dashLine","midPoint","point","text"]}},{key:"getData",value:function(){var m=arguments.length>0&&arguments[0]!==void 0&&arguments[0],w=this.getPolygonData();return m?w:Vt(w)}},{key:"getMainLayer",value:function(){var m,w;return(m=(w=this.render.polygon)===null||w===void 0?void 0:w.getLayers())!==null&&m!==void 0?m:[]}},{key:"getDefaultOptions",value:function(m){var w=mn(mn({},lo(Ni(v.prototype),"getDefaultOptions",this).call(this,m)),{},{areaOptions:!1,helper:Fc(q)});return m.areaOptions&&(w.areaOptions=mn(mn({},Gl),m.areaOptions)),w}},{key:"getAreaTexts",value:function(m){var w=this.options.areaOptions;if(!w)return[];var D=w.format,N=w.showWhen,W=[],$=m.filter(function(ie){return ie.geometry.coordinates[0].length>=4});return N.includes("active")&&$.filter(function(ie){return ie.properties.isActive}).forEach(function(ie){W.push(sr(ie,{format:D},{isActive:!0}))}),N.includes("normal")&&$.filter(function(ie){return!ie.properties.isActive}).forEach(function(ie){W.push(sr(ie,{format:D},{isActive:!1}))}),W}},{key:"getAllTexts",value:function(){return[].concat(Os(lo(Ni(v.prototype),"getAllTexts",this).call(this)),Os(this.getAreaTexts(this.getPolygonData())))}},{key:"getPolygonData",value:function(){return this.source.getRenderData("polygon")}},{key:"setPolygonData",value:function(m){return this.source.setRenderData("polygon",m)}},{key:"handleCreatePolygon",value:function(m,w){var D=el(m,{nodes:m,line:w,isActive:!0,isDraw:!0});return this.setPolygonData(function(N){return Qs({target:D,data:[].concat(Os(N),[D]),otherHandler:function(W){W.properties.isActive=!1}})}),D}},{key:"handlePolygonUnClick",value:function(m){return this.clearActivePolygon(),m}},{key:"handlePolygonHover",value:function(m){return this.setCursor("polygonHover"),Qo(m,this.hoverPolygon)||this.setPolygonData(function(w){return Qs({target:m,data:w,targetHandler:function(D){D.properties.isHover=!0},otherHandler:function(D){D.properties.isHover=!1}})}),m}},{key:"handlePolygonUnHover",value:function(){this.resetCursor(),this.setPolygonData(function(m){return m.map(function(w){return w.properties.isHover=!1,w})})}},{key:"handlePolygonDragStart",value:function(m){return this.setActivePolygon(m,{isDrag:!0}),this.scene.setMapStatus({dragEnable:!1}),this.setCursor("polygonDrag"),m}},{key:"bindPolygonRenderEvent",value:function(){var m,w,D,N;(m=this.polygonRender)===null||m===void 0||m.on(ve.RenderEvent.UnClick,this.onPolygonUnClick.bind(this)),(w=this.polygonRender)===null||w===void 0||w.on(ve.RenderEvent.Mousemove,this.onPolygonHover.bind(this)),(D=this.polygonRender)===null||D===void 0||D.on(ve.RenderEvent.Mouseout,this.onPolygonUnHover.bind(this)),(N=this.polygonRender)===null||N===void 0||N.on(ve.RenderEvent.Dragstart,this.onPolygonDragStart.bind(this))}},{key:"syncPolygonNodes",value:function(m,w){var D=sl(Ks([].concat(Os(w),[go(w)]))),N=m.properties,W=N.line;if(m.properties.nodes=w,m.geometry.coordinates=[rp(ou(D))?D:D.reverse()],this.setPolygonData(function(ke){return ke.map(function(Ge){return Qo(Ge,m)?m:Ge})}),!Qo(this.drawPolygon,m)){var $=W.properties.nodes,ie=Os(w),pe=go(ie);ie.push($.length===w.length?Mr(pe.geometry.coordinates):ic($));var we=ic(ie);xi(pe.geometry.coordinates,we.geometry.coordinates)||(we.geometry.coordinates=Fc(pe.geometry.coordinates)),this.syncLineNodes(W,ie)}return m}},{key:"setActivePolygon",value:function(m){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.setActiveLine(m.properties.line,w),this.setPolygonData(function(D){return Qs({target:m,data:D,targetHandler:function(N){N.properties=mn(mn({},N.properties),{},{isDraw:!1,isActive:!0,isDrag:!1,isHover:!1},w)},otherHandler:function(N){N.properties=mn(mn({},N.properties),{},{isDraw:!1,isActive:!1,isDrag:!1})}})}),this.setTextData(this.getAllTexts()),m}},{key:"clearActivePolygon",value:function(){this.setPolygonData(function(m){return m.map(function(w){return w.properties=mn(mn({},w.properties),{},{isDrag:!1,isActive:!1,isHover:!1}),w})}),this.clearActiveLine()}},{key:"onLineDragStart",value:function(m){var w=lo(Ni(v.prototype),"onLineDragStart",this).call(this,m),D=this.getPolygonData().find(function(N){return Qo(N.properties.line,w)});return D&&(this.setActivePolygon(D,{isDrag:!0}),this.emit(ve.DrawEvent.DragStart,D,this.getPolygonData())),w}},{key:"onLineUnClick",value:function(m){return this.editLine}},{key:"onLineDragEnd",value:function(m){var w=lo(Ni(v.prototype),"onLineDragEnd",this).call(this,m),D=this.dragPolygon;return w&&D&&(D.properties.isDrag=!1,this.emit(ve.DrawEvent.DragEnd,D,this.getPolygonData()),this.emit(ve.DrawEvent.Edit,D,this.getPolygonData())),w}},{key:"onPolygonUnClick",value:function(m){var w=this.editPolygon;if(w)return this.handlePolygonUnClick(w)}},{key:"onPolygonHover",value:function(m){if(!this.drawPolygon)return this.dragPolygon||this.setHelper("polygonHover"),this.handlePolygonHover(m.feature)}},{key:"onPolygonUnHover",value:function(m){if(!this.drawPolygon)return this.setHelper(this.addable?"draw":null),this.handlePolygonUnHover()}},{key:"onPolygonDragStart",value:function(m){if(this.options.editable&&!this.drawPolygon){var w=m.feature;return this.previousPosition=Xt(m),this.setHelper("polygonDrag"),this.emit(ve.DrawEvent.DragStart,w,this.getPolygonData()),this.handlePolygonDragStart(w)}}},{key:"onMidPointClick",value:function(m){var w=this.editPolygon,D=lo(Ni(v.prototype),"onMidPointClick",this).call(this,m);if(D&&w){var N=w.properties.line.properties.nodes;this.syncPolygonNodes(w,N.slice(0,N.length-1)),this.setActivePolygon(w)}return D}},{key:"onPointDragEnd",value:function(m){var w=this.editPolygon,D=lo(Ni(v.prototype),"onPointDragEnd",this).call(this,m);return D&&w&&this.emit(ve.DrawEvent.Edit,w,this.getPolygonData()),D}},{key:"enablePolygonRenderAction",value:function(){var m,w,D,N=this.options.editable;(m=this.polygonRender)===null||m===void 0||m.enableUnClick(),N&&((w=this.polygonRender)===null||w===void 0||w.enableHover(),(D=this.polygonRender)===null||D===void 0||D.enableDrag())}},{key:"disablePolygonRenderAction",value:function(){var m,w,D;(m=this.polygonRender)===null||m===void 0||m.disableUnClick(),(w=this.polygonRender)===null||w===void 0||w.disableHover(),(D=this.polygonRender)===null||D===void 0||D.disableDrag()}},{key:"bindEnableEvent",value:function(){lo(Ni(v.prototype),"bindEnableEvent",this).call(this),this.enableSceneRenderAction(),this.enablePointRenderAction(),this.enableLineRenderAction(),this.enableMidPointRenderAction(),this.enablePolygonRenderAction()}},{key:"unbindEnableEvent",value:function(){lo(Ni(v.prototype),"unbindEnableEvent",this).call(this),this.disableSceneRenderAction(),this.disablePointRenderAction(),this.disableLineRenderAction(),this.disableMidPointRenderAction(),this.disablePolygonRenderAction()}},{key:"bindThis",value:function(){lo(Ni(v.prototype),"bindThis",this).call(this),this.bindPointRenderEvent=this.bindPointRenderEvent.bind(this),this.bindSceneEvent=this.bindSceneEvent.bind(this),this.bindLineRenderEvent=this.bindLineRenderEvent.bind(this),this.bindMidPointRenderEvent=this.bindMidPointRenderEvent.bind(this),this.bindPolygonRenderEvent=this.bindPolygonRenderEvent.bind(this)}},{key:"setActiveFeature",value:function(m){var w=this.getTargetFeature(m);w?this.setActivePolygon(w):this.clearActivePolygon()}},{key:"resetFeatures",value:function(){var m=this.getPolygonData();this.drawPolygon&&(m=m.filter(function(w){return!w.properties.isDraw}),this.source.setData({point:[],dashLine:[],midPoint:[]}),this.setLineData(function(w){return w.filter(function(D){return!D.properties.isDraw})}),this.setTextData(function(w){return w.filter(function(D){return!D.properties.isActive})})),this.editPolygon&&this.handlePolygonUnClick(this.editPolygon),this.setPolygonData(m.map(function(w){return w.properties=mn(mn({},w.properties),{},{isDrag:!1,isActive:!1,isHover:!1}),w}))}}]),v}(Sd),td=function(p){function v(){return Ia(this,v),Dn(this,v,arguments)}return Aa(v,p),Sl(v,[{key:"drawLine",get:function(){var m;return(m=this.drawPolygon)===null||m===void 0?void 0:m.properties.line}},{key:"getDefaultOptions",value:function(m){var w=mn(mn({},lo(Ni(v.prototype),"getDefaultOptions",this).call(this,m)),{},{showMidPoint:!1,trigger:"click",autoActive:!1,helper:Fc(te)});return m.trigger==="drag"&&(w.helper=mn(mn({},w.helper),fe)),w}},{key:"getMidPointsByLine",value:function(m){return[]}},{key:"handleCreatePolygon",value:function(m,w){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},N=w.properties.nodes;return el(N.slice(0,N.length-1),mn({nodes:m,line:w},D))}},{key:"handleFirstNodeCreate",value:function(m){var w=Mr(m.geometry.coordinates),D=this.handleCreatePolygonLine(m,w,{isDraw:!0,isActive:!0}),N=this.handleCreatePolygon([m,w],D,{isDraw:!0,isActive:!0});return this.setPolygonData(function(W){return Qs({target:N,data:[].concat(Os(W),[N]),targetHandler:function($){$.properties=mn(mn({},$.properties),{},{isDraw:!0,isActive:!0})}})}),this.emit(ve.DrawEvent.AddNode,m,this.drawPolygon,this.getPolygonData()),this.setHelper("drawFinish"),m}},{key:"handleLastNodeCreate",value:function(m){var w=this.options,D=w.autoActive,N=w.editable,W=this.drawPolygon;return W&&(this.setLineData(function($){return[].concat(Os($),[W.properties.line])}),this.setActivePolygon(W),D&&N||this.handlePolygonUnClick(W),this.emit(ve.DrawEvent.Add,W,this.getPolygonData()),this.emit(ve.DrawEvent.AddNode,W.properties.nodes[1],this.drawPolygon,this.getPolygonData()),this.setHelper(N?D?"pointHover":"polygonHover":this.addable?"draw":null)),m}},{key:"onPointCreate",value:function(m){var w=this;if(this.addable&&!this.dragPoint&&!this.editLine&&this.isClickTrigger){var D=this.drawPolygon,N=Xt(m),W=this.handleCreatePoint(N);return D?requestAnimationFrame(function(){w.handleLastNodeCreate(W)}):this.handleFirstNodeCreate(W),W}}},{key:"setActivePolygon",value:function(m){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.setActiveLine(m.properties.line,w),this.setPolygonData(function(N){return Qs({target:m,data:N,targetHandler:function(W){W.properties=mn(mn({},W.properties),{},{isDraw:!1,isActive:!0,isDrag:!1,isHover:!1},w)},otherHandler:function(W){W.properties=mn(mn({},W.properties),{},{isDraw:!1,isActive:!1,isDrag:!1})}})}),this.setPointData(m.properties.nodes),this.setDashLineData([]);var D=this.getAllTexts();return this.setTextData(D),m}},{key:"onPointDragging",value:function(m){var w=this.dragPoint;if(w){var D=this.handlePointDragging(w,Mt(m)),N=this.editPolygon;return D&&N&&(this.syncPolygonNodes(N,N.properties.nodes.map(function(W){return Qo(W,D)?D:W})),this.setActivePolygon(N)),D}}},{key:"onSceneDragStart",value:function(m){this.isDragTrigger&&this.addable&&!this.dragPoint&&!this.editLine&&(this.scene.setMapStatus({dragEnable:!1}),this.handleFirstNodeCreate(this.handleCreatePoint(Xt(m))))}},{key:"onSceneDragEnd",value:function(m){this.isDragTrigger&&this.addable&&!this.dragPoint&&!this.editLine&&this.drawPolygon&&(this.scene.setMapStatus({dragEnable:!1}),this.handleLastNodeCreate(this.handleCreatePoint(Xt(m))))}},{key:"onSceneMouseMove",value:function(m){var w=this.drawPolygon;if(w){var D=w.properties.nodes,N=go(D),W=ic(D);W.geometry.coordinates=Xt(m),this.syncPolygonNodes(w,[N,W]),this.setDashLineData([w.properties.line]),this.setTextData(this.getAllTexts()),this.resetCursor()}}}]),v}(Up),dd=function(p){function v(m,w){var D;return Ia(this,v),(D=Dn(this,v,[m,w])).bindPointRenderEvent(),D.bindSceneEvent(),D.bindMidPointRenderEvent(),D.bindLineRenderEvent(),D.bindPolygonRenderEvent(),D}return Aa(v,p),Sl(v,[{key:"getDefaultOptions",value:function(m){var w=mn(mn({},lo(Ni(v.prototype),"getDefaultOptions",this).call(this,m)),{},{showMidPoint:!1,circleSteps:60});return w.distanceOptions&&(w.distanceOptions.showTotalDistance=!0,w.distanceOptions.showOnRadius===void 0&&(w.distanceOptions.showOnRadius=!0)),w.helper&&(w.helper=mn(mn({},w.helper),Te)),w}},{key:"getDistanceTexts",value:function(){var m=this.options.distanceOptions;if(!m)return[];var w=[],D=m.showWhen,N=m.showDashDistance,W=m.format,$=m.showTotalDistance;return w.push.apply(w,Os(this.getDashLineDistanceTexts(this.getDashLineData(),{showTotalDistance:!0,format:W,showDashDistance:N})).concat(Os(this.getLineDistanceTexts(this.getLineData(),{showTotalDistance:$,format:W,showWhen:D})))),w}},{key:"setData",value:function(m){var w=this,D=m.map(function(N){var W,$,ie;N.properties=mn(mn({},Xr()),N.properties);var pe=(W=N.properties)===null||W===void 0?void 0:W.nodes;if((($=pe)===null||$===void 0?void 0:$.length)!==2){var we=bs(ih(N).geometry.coordinates,2),ke=we[0],Ge=we[1],ht=cc(N),mt=ht[2],St=(ht[1]+ht[3])/2;pe=[Mr([ke,Ge]),Mr([mt,St])],N.properties.nodes=pe}var xt=pe[0],bt=pe[1],kt=!!(!((ie=N.properties)===null||ie===void 0)&&ie.isActive),ft=N.properties.line;return ft||(ft=w.handleCreatePolygonLine(xt,bt,{isActive:kt}),N.properties.line=ft),w.handleCreatePolygon([xt,bt],ft,mn(mn({},N.properties),{},{isActive:kt}))});this.source.setData({point:[],midPoint:[],dashLine:[],polygon:D,line:D.map(function(N){return N.properties.line})}),this.setTextData(this.getAllTexts()),this.editPolygon&&this.setActivePolygon(this.editPolygon)}},{key:"handleCreatePolygonLine",value:function(m,w){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},N=this.getBoundaryPositions(m,w).map(function(W){return Mr(W)});return Bi(N,D)}},{key:"syncPolygonNodes",value:function(m,w){var D=m.properties.line,N=this.getBoundaryPositions(w[0],w[1]);return m.properties.nodes=w,m.geometry.coordinates=[N],this.setPolygonData(function(W){return W.map(function($){return Qo($,m)?m:$})}),this.setPointData(m.properties.isDraw?[w[0]]:w),D.properties.nodes.forEach(function(W,$){W.geometry.coordinates=N[$]}),D.geometry.coordinates=N,m}},{key:"onLineDragging",value:function(m){var w=this.dragPolygon,D=bs(this.previousPosition,2),N=D[0],W=D[1],$=lo(Ni(v.prototype),"onLineDragging",this).call(this,m);if(w){var ie=bs(Xt(m),2),pe=ie[0],we=ie[1];w.properties.nodes.forEach(function(ke){var Ge=bs(ke.geometry.coordinates,2),ht=Ge[1];ke.geometry.coordinates=[Br(Ge[0]+pe-N),Br(ht+we-W)]}),this.syncPolygonNodes(w,w.properties.nodes),this.setActivePolygon(w,{isDrag:!0}),this.emit(ve.DrawEvent.Dragging,w,this.getPolygonData())}return $}},{key:"getBoundaryPositions",value:function(m,w){for(var D=this.options.circleSteps,N=yu(m,w,{units:"meters"}),W=[],$=0;D>$;$++)W.push(nh(m,N,-360*$/D,{units:"meters"}).geometry.coordinates.map(function(ie){return Br(ie,6)}));return W.push(W[0]),W}}]),v}(td),Zp=function(p){function v(m,w){var D;return Ia(this,v),(D=Dn(this,v,[m,w])).drawLineFinish=function(){var N,W=D.drawLine,$=(N=W==null?void 0:W.properties.nodes)!==null&&N!==void 0?N:[];if(W&&($==null?void 0:$.length)>1){D.setActiveLine(W);var ie=D.options,pe=ie.autoActive,we=ie.editable;pe&&we||D.handleLineUnClick(W),D.setHelper(we&&pe?"pointHover":D.addable?"draw":null),D.emit(ve.DrawEvent.Add,W,D.getLineData())}},D.sceneRender.on(ve.RenderEvent.DblClick,D.drawLineFinish),D.bindPointRenderEvent(),D.bindSceneEvent(),D.bindMidPointRenderEvent(),D.bindLineRenderEvent(),D}return Aa(v,p),Sl(v,[{key:"dragItem",get:function(){return this.dragLine}},{key:"editItem",get:function(){return this.editLine}},{key:"getMainLayer",value:function(){var m,w;return(m=(w=this.render.line)===null||w===void 0?void 0:w.getLayers())!==null&&m!==void 0?m:[]}},{key:"setData",value:function(m){var w=Et(m).map(function(D){var N,W;return D.properties=mn(mn({},Ft()),(N=D.properties)!==null&&N!==void 0?N:{}),!((W=D.properties.nodes)===null||W===void 0)&&W.length||(D.properties.nodes=sl(D).map(function($){return Mr($)})),D});this.source.setData({point:[],midPoint:[],dashLine:[],line:w}),this.setTextData(this.getAllTexts()),this.editLine&&this.setActiveLine(this.editLine)}},{key:"getData",value:function(){var m=arguments.length>0&&arguments[0]!==void 0&&arguments[0],w=this.getLineData();return m?w:Vt(w)}},{key:"getRenderTypes",value:function(){return["line","dashLine","midPoint","point","text"]}},{key:"bindPointRenderEvent",value:function(){var m;lo(Ni(v.prototype),"bindPointRenderEvent",this).call(this),(m=this.pointRender)===null||m===void 0||m.on(ve.RenderEvent.Contextmenu,this.onPointContextMenu.bind(this))}},{key:"onPointClick",value:function(m){var w,D=this,N=this.drawLine,W=(w=N==null?void 0:N.properties.nodes)!==null&&w!==void 0?w:[],$=m.feature;if(Qo($,ic(W)))requestAnimationFrame(function(){D.drawLineFinish()});else{var ie=bs($.geometry.coordinates,2);m.lngLat={lng:ie[0],lat:ie[1]},this.onPointCreate(m)}}},{key:"removeNode",value:function(m,w){var D,N=this.getTargetFeature(w),W=this.getTargetFeature(m,(D=N==null?void 0:N.properties.nodes)!==null&&D!==void 0?D:[]);if(N&&W){var $,ie=($=N==null?void 0:N.properties.nodes)!==null&&$!==void 0?$:[];if(3>ie.length)return;this.syncLineNodes(N,ie.filter(function(pe){return!Qo(W,pe)})),this.emit(ve.DrawEvent.RemoveNode,W,N,this.getLineData()),this.emit(ve.DrawEvent.Edit,N,this.getLineData())}}},{key:"onPointContextMenu",value:function(m){var w,D=this.editLine,N=m.feature,W=(w=D==null?void 0:D.properties.nodes)!==null&&w!==void 0?w:[];if(D&&W.length>=3)return this.removeNode(N,D),this.scene.setMapStatus({dragEnable:!0}),N}},{key:"onPointCreate",value:function(m){if(this.addable){var w=lo(Ni(v.prototype),"onPointCreate",this).call(this,m);return w&&(this.setHelper("drawFinish"),this.emit(ve.DrawEvent.AddNode,w,this.drawLine,this.getLineData())),w}}},{key:"onPointDragEnd",value:function(m){var w=this.editLine,D=lo(Ni(v.prototype),"onPointDragEnd",this).call(this,m);return w&&D&&this.emit(ve.DrawEvent.Edit,w,this.getLineData()),D}},{key:"onLineDragStart",value:function(m){var w=lo(Ni(v.prototype),"onLineDragStart",this).call(this,m);return w&&this.emit(ve.DrawEvent.DragStart,w,this.getLineData()),w}},{key:"onLineDragging",value:function(m){var w=lo(Ni(v.prototype),"onLineDragging",this).call(this,m);return w&&this.emit(ve.DrawEvent.Dragging,w,this.getLineData()),w}},{key:"onLineDragEnd",value:function(m){var w=lo(Ni(v.prototype),"onLineDragEnd",this).call(this,m);return w&&(this.emit(ve.DrawEvent.DragEnd,w,this.getLineData()),this.emit(ve.DrawEvent.Edit,w,this.getLineData())),w}},{key:"onMidPointClick",value:function(m){var w=this.editLine,D=lo(Ni(v.prototype),"onMidPointClick",this).call(this,m);return w&&D&&(this.emit(ve.DrawEvent.Edit,w,this.getLineData()),this.emit(ve.DrawEvent.AddNode,D,w,this.getLineData())),D}},{key:"onSceneMouseMove",value:function(m){var w=this.drawLine;if(w){var D,N=ic(w.properties.nodes),W=Xt(m);this.options.adsorbOptions&&(W=(D=this.getAdsorbPosition(W))!==null&&D!==void 0?D:W),this.setDashLineData([Ma([W,N.geometry.coordinates])]),this.setTextData(this.getAllTexts())}}},{key:"onSceneDragEnd",value:function(m){this.isDragTrigger&&this.addable&&this.drawLine&&this.drawLineFinish()}},{key:"setActiveFeature",value:function(m){var w=this.getTargetFeature(m);w?this.setActiveLine(w):this.clearActiveLine()}},{key:"resetFeatures",value:function(){var m=this.getLineData();this.drawLine&&(m=m.filter(function(w){return!w.properties.isDraw}),this.source.setData({point:[],dashLine:[],midPoint:[]}),this.setTextData(function(w){return w.filter(function(D){return!D.properties.isActive})})),this.editLine&&this.handleLineUnClick(this.editLine),this.setLineData(m.map(function(w){return w.properties=mn(mn({},w.properties),{},{isDrag:!1,isActive:!1,isHover:!1}),w}))}},{key:"enablePointRenderAction",value:function(){var m;lo(Ni(v.prototype),"enablePointRenderAction",this).call(this),this.options.editable&&((m=this.pointRender)===null||m===void 0||m.enableContextMenu())}},{key:"disablePointRenderAction",value:function(){var m;lo(Ni(v.prototype),"disablePointRenderAction",this).call(this),(m=this.pointRender)===null||m===void 0||m.disableContextMenu()}},{key:"bindEnableEvent",value:function(){lo(Ni(v.prototype),"bindEnableEvent",this).call(this),this.enableSceneRenderAction(),this.enablePointRenderAction(),this.enableLineRenderAction(),this.enableMidPointRenderAction(),this.sceneRender.enableDblClick()}},{key:"unbindEnableEvent",value:function(){lo(Ni(v.prototype),"unbindEnableEvent",this).call(this),this.disableSceneRenderAction(),this.disablePointRenderAction(),this.disableLineRenderAction(),this.disableMidPointRenderAction(),this.sceneRender.disableDblClick()}},{key:"bindThis",value:function(){lo(Ni(v.prototype),"bindThis",this).call(this),this.bindPointRenderEvent=this.bindPointRenderEvent.bind(this),this.bindSceneEvent=this.bindSceneEvent.bind(this),this.bindLineRenderEvent=this.bindLineRenderEvent.bind(this),this.bindMidPointRenderEvent=this.bindMidPointRenderEvent.bind(this)}}]),v}(Sd),wf=function(p){function v(m,w){var D;return Ia(this,v),(D=Dn(this,v,[m,w])).bindPointRenderEvent(),D}return Aa(v,p),Sl(v,[{key:"dragItem",get:function(){return this.dragPoint}},{key:"editItem",get:function(){return this.editPoint}},{key:"getDefaultOptions",value:function(m){var w=mn(mn({},this.getCommonOptions(m)),{},{helper:Fc(B),initialData:m.initialData});return w.style.point=h,w}},{key:"bindEnableEvent",value:function(){lo(Ni(v.prototype),"bindEnableEvent",this).call(this),this.enablePointRenderAction()}},{key:"unbindEnableEvent",value:function(){lo(Ni(v.prototype),"unbindEnableEvent",this).call(this),this.disablePointRenderAction()}},{key:"getRenderTypes",value:function(){return["point"]}},{key:"getMainLayer",value:function(){var m,w;return(m=(w=this.render.point)===null||w===void 0?void 0:w.getLayers())!==null&&m!==void 0?m:[]}},{key:"setData",value:function(m){this.setPointData(Et(m).map(function(w){return w.properties=mn(mn({},Cp()),w.properties),w}))}},{key:"getData",value:function(){var m=arguments.length>0&&arguments[0]!==void 0&&arguments[0],w=this.getPointData();return m?w:Vt(w)}},{key:"onPointCreate",value:function(m){if(this.addable){var w=lo(Ni(v.prototype),"onPointCreate",this).call(this,m);if(w)return this.options.editable&&this.setHelper("pointHover"),this.emit(ve.DrawEvent.Add,w,this.getData()),w}else this.setPointData(function(D){return D.map(function(N){return N.properties=mn(mn({},N.properties),{},{isHover:!1,isActive:!1}),N})})}},{key:"onPointMouseMove",value:function(m){var w=lo(Ni(v.prototype),"onPointMouseMove",this).call(this,m);return this.options.editable&&!this.dragPoint&&this.setHelper("pointHover"),w}},{key:"onPointMouseOut",value:function(m){var w=lo(Ni(v.prototype),"onPointMouseOut",this).call(this,m);return this.setHelper(this.addable?"draw":null),w}},{key:"onPointDragStart",value:function(m){var w=lo(Ni(v.prototype),"onPointDragStart",this).call(this,m);return this.setHelper("pointDrag"),this.emit(ve.DrawEvent.DragStart,w,this.getData()),w}},{key:"onPointDragging",value:function(m){var w=lo(Ni(v.prototype),"onPointDragging",this).call(this,m);return w&&this.options.editable&&this.emit(ve.DrawEvent.Dragging,w,this.getData()),w}},{key:"onPointDragEnd",value:function(m){var w=lo(Ni(v.prototype),"onPointDragEnd",this).call(this,m);return w&&this.options.editable&&(this.setHelper("pointHover"),this.emit(ve.DrawEvent.DragEnd,w,this.getData()),this.emit(ve.DrawEvent.Edit,w,this.getData())),w}},{key:"bindThis",value:function(){lo(Ni(v.prototype),"bindThis",this).call(this),this.bindPointRenderEvent=this.bindPointRenderEvent.bind(this)}},{key:"onSceneMouseMove",value:function(m){}},{key:"setActiveFeature",value:function(m){var w=this.getTargetFeature(m);this.setPointData(function(D){return D.map(function(N){return N.properties.isActive=Qo(w,N),N})})}},{key:"resetFeatures",value:function(){this.setPointData(function(m){return m.map(function(w){return w.properties=mn(mn({},w.properties),{},{isDrag:!1,isActive:!1,isHover:!1}),w})})}}]),v}(ed),Td=function(p){function v(m,w){var D;return Ia(this,v),(D=Dn(this,v,[m,w])).drawPolygonFinish=function(){var N,W=D.drawPolygon,$=(N=W==null?void 0:W.properties.nodes)!==null&&N!==void 0?N:[];if(W&&$.length>=3){W.properties.isDraw=!1,D.syncPolygonNodes(W,$),D.setActivePolygon(W);var ie=D.options,pe=ie.autoActive,we=ie.editable;pe&&we||D.handlePolygonUnClick(W),D.setHelper(we?pe?"pointHover":"polygonHover":D.addable?"draw":null),D.emit(ve.DrawEvent.Add,W,D.getPolygonData())}},D.sceneRender.on(ve.RenderEvent.DblClick,D.drawPolygonFinish),D.bindPointRenderEvent(),D.bindSceneEvent(),D.bindMidPointRenderEvent(),D.bindLineRenderEvent(),D.bindPolygonRenderEvent(),D}return Aa(v,p),Sl(v,[{key:"getDefaultOptions",value:function(m){return mn(mn({},lo(Ni(v.prototype),"getDefaultOptions",this).call(this,m)),{},{liveUpdate:!1})}},{key:"setData",value:function(m){var w=Et(m).map(function(D){var N,W;if(D.properties=mn(mn({},Xr()),(N=D.properties)!==null&&N!==void 0?N:{}),!(!((W=D.properties.nodes)===null||W===void 0)&&W.length)){var $=sl(D);$=$.slice(0,$.length-1),D.properties.nodes=$.map(function(pe){return Mr(pe)})}if(!D.properties.line){var ie=D.properties.nodes;D.properties.line=Bi([].concat(Os(ie),[Mr(go(ie).geometry.coordinates)]))}return D});this.source.setData({point:[],midPoint:[],dashLine:[],polygon:w,line:w.map(function(D){return D.properties.line})}),this.setTextData(this.getAllTexts()),this.editPolygon&&this.setActivePolygon(this.editPolygon)}},{key:"onPointCreate",value:function(m){if(this.addable&&!this.dragPoint){var w=lo(Ni(v.prototype),"onPointCreate",this).call(this,m),D=this.drawPolygon,N=this.drawLine;return w&&(D?(this.syncPolygonNodes(D,[].concat(Os(D.properties.nodes),[w])),this.setDashLineData([Ma([Xt(m),D.properties.nodes[0].geometry.coordinates])]),D.properties.nodes.length>1&&this.setHelper("drawFinish")):N&&(this.handleCreatePolygon([w],N),this.setHelper("drawContinue")),this.emit(ve.DrawEvent.AddNode,w,D,this.getPolygonData())),w}}},{key:"onPointClick",value:function(m){var w=this,D=this.drawPolygon,N=m.feature;if(D){var W=D.properties.nodes;if(W.length<3||!Qo(go(W),N)&&!Qo(ic(W),N)){var $=bs(N.geometry.coordinates,2);m.lngLat={lng:$[0],lat:$[1]},this.onPointCreate(m)}else requestAnimationFrame(function(){w.drawPolygonFinish()})}}},{key:"onPointDragging",value:function(m){var w=this.dragPoint,D=this.editPolygon;if(w&&D){var N=D.properties.line;N.properties.nodes=N.properties.nodes.map(function(Ge){return Qo(Ge,w)?w:Ge});var W=N.properties.nodes,$=W.slice(0,W.length-1),ie=go(W),pe=ic(W),we=Qo(ie,w)||Qo(pe,w);if(we&&(ie.geometry.coordinates=pe.geometry.coordinates=Xt(m)),this.options.adsorbOptions&&we){var ke=this.resetAdsorbLngLat(m);ke&&(ie.geometry.coordinates=pe.geometry.coordinates=ke)}lo(Ni(v.prototype),"onPointDragging",this).call(this,m),this.syncPolygonNodes(D,$),this.setActivePolygon(D)}return w}},{key:"onLineDragging",value:function(m){var w=this.dragPolygon,D=lo(Ni(v.prototype),"onLineDragging",this).call(this,m);if(D&&w){var N=D.properties.nodes;this.syncPolygonNodes(w,N.slice(0,N.length-1)),this.emit(ve.DrawEvent.Dragging,w,this.getPolygonData())}return D}},{key:"onMidPointClick",value:function(m){var w=lo(Ni(v.prototype),"onMidPointClick",this).call(this,m),D=this.editPolygon;return w&&D&&(this.emit(ve.DrawEvent.Edit,D,this.getPolygonData()),this.emit(ve.DrawEvent.AddNode,w,D,this.getPolygonData())),w}},{key:"onSceneMouseMove",value:function(m){var w,D=this.drawPolygon,N=(w=D==null?void 0:D.properties.nodes)!==null&&w!==void 0?w:[];if(D&&N.length){this.options.adsorbOptions&&this.resetAdsorbLngLat(m);var W=Xt(m),$=[];if($.push(Ma([W,go(N).geometry.coordinates])),N.length>1&&$.push(Ma([W,ic(N).geometry.coordinates])),this.options.liveUpdate&&N.length>=2){var ie=sl(Ks(N));D.geometry.coordinates=[[].concat(Os(ie),[W,ie[0]])],this.setPolygonData(this.getPolygonData())}this.setDashLineData($),this.setTextData(this.getAllTexts())}}},{key:"onSceneDragEnd",value:function(m){this.isDragTrigger&&this.addable&&this.drawLine&&this.drawPolygonFinish()}},{key:"removeNode",value:function(m,w){var D,N=this.getTargetFeature(w),W=this.getTargetFeature(m,(D=N==null?void 0:N.properties.nodes)!==null&&D!==void 0?D:[]);if(N&&W){var $,ie=($=N==null?void 0:N.properties.nodes)!==null&&$!==void 0?$:[];if(4>ie.length)return;this.syncPolygonNodes(N,ie.filter(function(pe){return!Qo(W,pe)})),this.emit(ve.DrawEvent.RemoveNode,W,N,this.getLineData()),this.emit(ve.DrawEvent.Edit,N,this.getPolygonData())}}},{key:"onPointContextMenu",value:function(m){var w,D=this.editPolygon,N=m.feature,W=(w=D==null?void 0:D.properties.nodes)!==null&&w!==void 0?w:[];if(D&&W.length>=4)return W.find(function($){return Qo($,N)})||(N=W[0]),this.removeNode(N,D),N}},{key:"bindPointRenderEvent",value:function(){var m;lo(Ni(v.prototype),"bindPointRenderEvent",this).call(this),(m=this.pointRender)===null||m===void 0||m.on(ve.RenderEvent.Contextmenu,this.onPointContextMenu.bind(this))}},{key:"enablePointRenderAction",value:function(){var m;lo(Ni(v.prototype),"enablePointRenderAction",this).call(this),this.options.editable&&((m=this.pointRender)===null||m===void 0||m.enableContextMenu())}},{key:"disablePointRenderAction",value:function(){var m;lo(Ni(v.prototype),"disablePointRenderAction",this).call(this),(m=this.pointRender)===null||m===void 0||m.disableContextMenu()}}]),v}(Up),Sf=function(p){function v(m,w){var D;return Ia(this,v),(D=Dn(this,v,[m,w])).bindPointRenderEvent(),D.bindSceneEvent(),D.bindMidPointRenderEvent(),D.bindLineRenderEvent(),D.bindPolygonRenderEvent(),D}return Aa(v,p),Sl(v,[{key:"getDefaultOptions",value:function(m){var w=lo(Ni(v.prototype),"getDefaultOptions",this).call(this,m);return w.helper&&(w.helper=mn(mn({},w.helper),ce)),w}},{key:"setData",value:function(m){var w=this,D=m.map(function(N){var W,$,ie;N.properties=mn(mn({},Xr()),(W=N.properties)!==null&&W!==void 0?W:{});var pe=N.properties.nodes;if((($=pe)===null||$===void 0?void 0:$.length)!==2){var we=bs(cc(N),4),ke=we[2],Ge=we[3];pe=[Mr([we[0],we[1]]),Mr([ke,Ge])],N.properties.nodes=pe}var ht=bs(pe,2),mt=ht[0],St=ht[1],xt=!!(!((ie=N.properties)===null||ie===void 0)&&ie.isActive),bt=N.properties.line;return bt||(bt=w.handleCreatePolygonLine(mt,St,{isActive:xt}),N.properties.line=bt),w.handleCreatePolygon([mt,St],bt,mn(mn({},N.properties),{},{isActive:xt}))});this.source.setData({point:[],midPoint:[],dashLine:[],polygon:D,line:D.map(function(N){return N.properties.line})}),this.setTextData(this.getAllTexts()),this.editPolygon&&this.setActivePolygon(this.editPolygon)}},{key:"handleCreatePolygonLine",value:function(m,w){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},N=sl(Ya(Ks([m,w]))).map(function(W,$){return $===0?m:$===2?w:Mr(W)});return Bi(N,D)}},{key:"syncPolygonNodes",value:function(m,w){var D=m.properties.line,N=sl(Ya(Ks(w)));m.properties.nodes=w,m.geometry.coordinates=[N],this.setPolygonData(function(ie){return ie.map(function(pe){return Qo(pe,m)?m:pe})}),this.setPointData(m.properties.isDraw?[w[0]]:w);var W=D.properties.nodes,$=N.filter(function(ie){return!xi(ie,w[0].geometry.coordinates)&&!xi(ie,w[1].geometry.coordinates)});return W.forEach(function(ie,pe){var we=[0,0];switch(pe){case 0:we=w[0].geometry.coordinates;break;case 1:we=$[0];break;case 2:we=w[1].geometry.coordinates;break;case 3:we=$[1];break;case 4:we=Fc(w[0].geometry.coordinates)}ie.geometry.coordinates=we}),D.geometry.coordinates=N,m}},{key:"onLineDragging",value:function(m){var w=lo(Ni(v.prototype),"onLineDragging",this).call(this,m),D=this.dragPolygon;if(w&&D){var N=D.properties.line.properties.nodes;this.syncPolygonNodes(D,[N[0],N[2]]),this.setActivePolygon(D,{isDrag:!0}),this.emit(ve.DrawEvent.Dragging,D,this.getPolygonData())}return w}}]),v}(td),sm=function(p,v){for(var m=p;m&&!Array.from(m.classList).includes(v);)m=m.parentElement;return m},Ud=["point","line","polygon","rect","circle","clear"],Ad={point:"#l7draw-point",line:"#l7draw-line",polygon:"#l7draw-polygon",rect:"#l7draw-rect",circle:"#l7draw-circle",clear:"#l7draw-qingkong"},Bu={point:wf,line:Zp,polygon:Td,rect:Sf,circle:dd},nu="data-draw-type",lm="l7-draw-control",Cd="".concat(lm,"__btn"),rd="".concat(Cd,"--active");(function(p){var v,m,w,D,N,W='<svg><symbol id="l7draw-qingkong" viewBox="0 0 1024 1024"><path d="M778.96777344 334.02148437h-148.31542969V284.58300781A71.78466797 71.78466797 0 0 0 556.49462891 215.36914062H467.50537109a71.78466797 71.78466797 0 0 0-74.15771484 69.11499024V334.02148437h-148.31542969a29.66308594 29.66308594 0 1 0 0 59.32617188h29.66308594v326.29394531A88.98925781 88.98925781 0 0 0 363.68457031 808.63085938h296.63085938a88.98925781 88.98925781 0 0 0 88.98925781-88.98925782V393.34765625h29.66308594a29.66308594 29.66308594 0 0 0 0-59.32617188zM452.67382812 284.58300781c0-4.74609375 6.22924805-9.78881836 14.83154297-9.78881836h88.98925782c8.60229492 0 14.83154297 5.04272461 14.83154296 9.78881836V334.02148437H452.67382812V284.53356934z m237.30468751 435.10803223a29.66308594 29.66308594 0 0 1-29.66308594 29.66308593H363.68457031a29.66308594 29.66308594 0 0 1-29.66308593-29.66308594V393.34765625h355.95703124v326.29394531z" ></path><path d="M437.84228516 660.31542969c6.57531739 0 12.85400391-3.46069336 17.5012207-9.64050294A39.20471192 39.20471192 0 0 0 462.56152344 627.33996582V495.5369873a39.20471192 39.20471192 0 0 0-7.21801758-23.33496093A22.09899903 22.09899903 0 0 0 437.84228516 462.56152344c-6.57531739 0-12.85400391 3.46069336-17.50122071 9.64050293A39.20471192 39.20471192 0 0 0 413.12304687 495.5369873v131.80297853c0 8.75061036 2.62023926 17.15515137 7.21801758 23.33496092 4.6472168 6.17980958 10.92590333 9.64050293 17.50122071 9.64050294zM586.15771484 660.31542969c6.57531739 0 12.85400391-3.46069336 17.50122071-9.64050294a39.20471192 39.20471192 0 0 0 7.21801758-23.33496093V495.5369873a39.20471192 39.20471192 0 0 0-7.21801758-23.33496093A22.09899903 22.09899903 0 0 0 586.15771484 462.56152344c-6.57531739 0-12.85400391 3.46069336-17.5012207 9.64050293A39.20471192 39.20471192 0 0 0 561.43847656 495.5369873v131.80297853c0 8.75061036 2.62023926 17.15515137 7.21801758 23.33496092 4.6472168 6.17980958 10.92590333 9.64050293 17.5012207 9.64050294z" ></path></symbol><symbol id="l7draw-rect" viewBox="0 0 1024 1024"><path d="M736.14 648.79V330c0-23.16-18.84-42-42-42H375.49c-11.07-19.13-31.74-32.01-55.43-32.01-35.35 0-64.01 28.66-64.01 64.01 0 23.69 12.88 44.36 32.01 55.43v318.8c0 23.16 18.84 42 42 42H648.7c11.07 19.13 31.74 32.01 55.43 32.01 35.35 0 64.01-28.66 64.01-64.01 0.01-23.7-12.87-44.37-32-55.44zM352.06 375.43A64.281 64.281 0 0 0 375.49 352h296.64v296.8a64.357 64.357 0 0 0-23.43 23.43H352.06v-296.8z" ></path></symbol><symbol id="l7draw-circle" viewBox="0 0 1024 1024"><path d="M467.013228 557.765038a64.01 64.01 0 1 0 90.52223-90.52539 64.01 64.01 0 1 0-90.52223 90.52539Z" ></path><path d="M832.16 512.22c0-26.06-15.58-48.46-37.93-58.45-11.21-54.67-38.11-104.92-78.48-145.3-54.42-54.42-126.78-84.4-203.75-84.4s-149.33 29.97-203.75 84.4c-54.42 54.42-84.4 126.79-84.4 203.75s29.97 149.33 84.4 203.75c54.42 54.42 126.78 84.4 203.75 84.4s149.33-29.97 203.75-84.4c40.37-40.37 67.28-90.62 78.48-145.3 22.35-9.98 37.93-32.39 37.93-58.45zM670.5 670.72c-42.34 42.34-98.62 65.65-158.5 65.65-59.87 0-116.16-23.32-158.5-65.65-42.34-42.34-65.65-98.62-65.65-158.5s23.32-116.16 65.65-158.5c42.34-42.34 98.62-65.65 158.5-65.65 59.87 0 116.16 23.32 158.5 65.65 29.9 29.9 50.3 66.77 59.71 106.95-15.81 11.66-26.07 30.4-26.07 51.55s10.26 39.9 26.07 51.55c-9.41 40.18-29.81 77.05-59.71 106.95z" ></path></symbol><symbol id="l7draw-polygon" viewBox="0 0 1024 1024"><path d="M705.97 640.31c-5.79 0-11.39 0.78-16.72 2.22L381.94 336.66a64.079 64.079 0 0 0 2.14-16.43c0-35.35-28.66-64.01-64.01-64.01s-64.01 28.66-64.01 64.01c0 23.69 12.88 44.36 32.01 55.43V648.8c-19.13 11.07-32.01 31.74-32.01 55.43 0 35.35 28.66 64.01 64.01 64.01 23.69 0 44.35-12.87 55.42-32l275.05 0.07c11.07 19.14 31.74 32.03 55.44 32.03 35.35 0 64.01-28.66 64.01-64.01s-28.66-64.02-64.02-64.02z m-353.91 8.48V397.22L628.44 672.3l-252.94-0.07a64.411 64.411 0 0 0-23.44-23.44z" ></path></symbol><symbol id="l7draw-line" viewBox="0 0 1024 1024"><path d="M832.16 449.21c0-35.35-28.66-64.01-64.01-64.01-29.2 0-53.81 19.56-61.5 46.28l-390.9 96.82 72.18-144.18c33.56-1.99 60.17-29.83 60.17-63.89 0-35.35-28.66-64.01-64.01-64.01s-64.01 28.66-64.01 64.01c0 13.04 3.91 25.17 10.61 35.28l-78.42 156.65c-33.58 1.97-60.21 29.81-60.21 63.89 0 35.35 28.66 64.01 64.01 64.01 29.2 0 53.81-19.56 61.5-46.28l390.8-96.79-71.97 143.34c-33.62 1.93-60.28 29.8-60.28 63.9 0 35.35 28.66 64.01 64.01 64.01s64.01-28.66 64.01-64.01c0-13-3.89-25.09-10.54-35.18l78.28-155.93c33.61-1.95 60.28-29.81 60.28-63.91z" ></path></symbol><symbol id="l7draw-point" viewBox="0 0 1024 1024"><path d="M331.46 330.08m-64.01 0a64.01 64.01 0 1 0 128.02 0 64.01 64.01 0 1 0-128.02 0Z" ></path><path d="M384.12 735.84m-64.01 0a64.01 64.01 0 1 0 128.02 0 64.01 64.01 0 1 0-128.02 0Z" ></path><path d="M769.11 512.7m-64.01 0a64.01 64.01 0 1 0 128.02 0 64.01 64.01 0 1 0-128.02 0Z" ></path></symbol></svg>',$=($=document.getElementsByTagName("script"))[$.length-1].getAttribute("data-injectcss");if($&&!p.__iconfont__svg__cssinject__){p.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(pe){console&&console.log(pe)}}function ie(){N||(N=!0,w())}v=function(){var pe,we=document.createElement("div");we.innerHTML=W,W=null,(we=we.getElementsByTagName("svg")[0])&&(we.setAttribute("aria-hidden","true"),we.style.position="absolute",we.style.width=0,we.style.height=0,we.style.overflow="hidden",(pe=document.body).firstChild?function(ke,Ge){Ge.parentNode.insertBefore(ke,Ge)}(we,pe.firstChild):pe.appendChild(we))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(v,0):(m=function(){document.removeEventListener("DOMContentLoaded",m,!1),v()},document.addEventListener("DOMContentLoaded",m,!1)):document.attachEvent&&(w=v,D=p.document,N=!1,function pe(){try{D.documentElement.doScroll("left")}catch(we){return void setTimeout(pe,50)}ie()}(),D.onreadystatechange=function(){D.readyState=="complete"&&(D.onreadystatechange=null,ie())})})(window),Vr(".l7-draw-control{display:flex;overflow:hidden;background:#fff;border-radius:2px;box-shadow:0 0 20px rgba(0,0,0,.14901960784313725)}.l7-draw-control__btn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;text-align:center;background:transparent;border-width:0;border-right:1px solid #e0e0e0;outline:0;cursor:pointer;transition:background-color .3s}.l7-draw-control__btn svg{transition:color .3s}.l7-draw-control__btn:hover{background-color:#e5e5e5}.l7-draw-control__btn:hover svg{color:#000}.l7-draw-control__btn:last-child{border-right:0;border-bottom:0}.l7-draw-control__btn .l7-draw-icon{width:26px;height:26px;overflow:hidden;fill:currentColor}.l7-draw-control__btn--active,.l7-draw-control__btn--active:hover{background-color:#0370fe}.l7-draw-control__btn--active:hover svg,.l7-draw-control__btn--active svg{color:#fff}");var bm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Nr=/^\w*$/,um=function(p,v){if(Hu(p))return!1;var m=typeof p;return!(m!="number"&&m!="symbol"&&m!="boolean"&&p!=null&&!ks(p))||Nr.test(p)||!bm.test(p)||v!=null&&p in Object(v)};function Tf(p,v){if(typeof p!="function"||v!=null&&typeof v!="function")throw new TypeError("Expected a function");var m=function(){var w=arguments,D=v?v.apply(this,w):w[0],N=m.cache;if(N.has(D))return N.get(D);var W=p.apply(this,w);return m.cache=N.set(D,W)||N,W};return m.cache=new(Tf.Cache||Tu),m}Tf.Cache=Tu;var Mp=Tf,Bm=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Kr=/\\(\\)?/g,cm=function(p){var v=Mp(p,function(w){return m.size===500&&m.clear(),w}),m=v.cache;return v}(function(p){var v=[];return p.charCodeAt(0)===46&&v.push(""),p.replace(Bm,function(m,w,D,N){v.push(D?N.replace(Kr,"$1"):w||m)}),v}),Af=Si?Si.prototype:void 0,hm=Af?Af.toString:void 0,Em=function p(v){if(typeof v=="string")return v;if(Hu(v))return uu(v,p)+"";if(ks(v))return hm?hm.call(v):"";var m=v+"";return m=="0"&&1/v==-1/0?"-0":m},wm=function(p){return p==null?"":Em(p)},Md=function(p,v){return Hu(p)?p:um(p,v)?[p]:cm(wm(p))},cf=function(p){if(typeof p=="string"||ks(p))return p;var v=p+"";return v=="0"&&1/p==-1/0?"-0":v},nd=function(p,v){for(var m=0,w=(v=Md(v,p)).length;p!=null&&w>m;)p=p[cf(v[m++])];return m&&m==w?p:void 0},Sm=function(p,v,m){var w=-1,D=p.length;0>v&&(v=-v>D?0:D+v),0>(m=m>D?D:m)&&(m+=D),D=v>m?0:m-v>>>0,v>>>=0;for(var N=Array(D);++w<D;)N[w]=p[w+v];return N},qm=function(p,v){return 2>v.length?p:nd(p,Sm(v,0,-1))},mc=function(p,v){return v=Md(v,p),(p=qm(p,v))==null||delete p[cf(ic(v))]},mh=function(p){return Zn(p)?void 0:p},Zd=Si?Si.isConcatSpreadable:void 0,i=function(p){return Hu(p)||yf(p)||!!(Zd&&p&&p[Zd])},l=function p(v,m,w,D,N){var W=-1,$=v.length;for(w||(w=i),N||(N=[]);++W<$;){var ie=v[W];m>0&&w(ie)?m>1?p(ie,m-1,w,D,N):Nf(N,ie):D||(N[N.length]=ie)}return N},_=function(p){return p!=null&&p.length?l(p,1):[]},S=function(p){return fu(Es(p,void 0,_),p+"")}(function(p,v){var m={};if(p==null)return m;var w=!1;v=uu(v,function(N){return N=Md(N,p),w||(w=N.length>1),N}),ju(p,Dc(p),m),w&&(m=zd(m,7,mh));for(var D=v.length;D--;)mc(m,v[D]);return m}),F=S,j=function(p){function v(m){var w,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ia(this,v),(w=Dn(this,v,[D])).controlOption=void 0,w.sceneInstance=void 0,w.drawMap={},w.btnMap={},w.activeType=null,w.emitDataChange=nc(function(){w.emit(ve.ControlEvent.DataChange,w.getDrawData())},16),w.emitDrawSelect=function(N,W){w.emit(ve.ControlEvent.DrawSelect,N,W)},w.sceneInstance=m,w.controlOption=mn(mn({},w.getDefault()),D||{}),w.onBtnClick=w.onBtnClick.bind(Ku(w)),w}return Aa(v,p),Sl(v,[{key:"getActiveType",value:function(){return this.activeType}},{key:"getDefault",value:function(){return mn(mn({},lo(Ni(v.prototype),"getDefault",this).call(this)),{},{className:"",buttonClassName:"",activeButtonClassName:"",style:"",position:"topleft",commonDrawOptions:{},drawConfig:{point:!0,line:!0,polygon:!0,rect:!0,circle:!0,clear:!0}})}},{key:"addTo",value:function(m){return lo(Ni(v.prototype),"addTo",this).call(this,m),this.init(),this}},{key:"onAdd",value:function(){var m=this.controlOption,w=m.className,D=m.style,N=Ze.DOM.create("div","".concat(lm," ").concat(w));return D&&N.setAttribute("style",D),N}},{key:"onRemove",value:function(){Object.values(this.drawMap).forEach(function(m){m.clear(!0)})}},{key:"init",value:function(){var m,w=this,D=[];Object.entries(this.controlOption.drawConfig).filter(function(N){var W=bs(N,2);return W[1]}).sort(function(N,W){var $=bs(N,2)[1],ie=bs(W,2)[1],pe=Number.MAX_SAFE_INTEGER;return(typeof $=="boolean"?pe:$.order)-(typeof ie=="boolean"?pe:ie.order)}).map(function(N){var W=bs(N,2),$=W[1];return[W[0],Il($)==="object"?F($,"order"):$]}).forEach(function(N){var W=bs(N,2),$=W[0],ie=W[1];if(Il(ie)==="object"&&ie.button){var pe=ie.button;pe.classList.contains("l7-draw-control__btn")||pe.classList.add("l7-draw-control__btn"),w.btnMap[$]=pe,D.push(pe)}else if(ie&&Ud.includes($)){var we=w.initBtn($);we.addEventListener("click",w.onBtnClick),D.push(we),w.btnMap[$]=we;var ke=Bu[$];if(ke&&w.sceneInstance){var Ge=new ke(w.sceneInstance,mn(mn({},w.controlOption.commonDrawOptions),typeof ie=="boolean"?{}:ie));Ge.on(ve.DrawEvent.Change,w.emitDataChange),Ge.on(ve.DrawEvent.Select,function(ht){w.emitDrawSelect($,ht),ht&&Object.values(w.drawMap).forEach(function(mt){mt!==Ge&&mt.setActiveFeature(null)})}),w.drawMap[$]=Ge}}}),(m=this.container).append.apply(m,D),this.controlOption.defaultActiveType&&this.onDrawClick(this.controlOption.defaultActiveType)}},{key:"getDrawData",value:function(){return Pe(Ca(this.drawMap).map(function(m){var w=bs(m,2);return[w[0],w[1].getData()]}))}},{key:"getTypeDraw",value:function(m){var w;return(w=this.drawMap[m])!==null&&w!==void 0?w:null}},{key:"onBtnClick",value:function(m){var w=sm(m.target,Cd);if(w){var D=w.getAttribute(nu);D==="clear"?this.clearDrawData():this.onDrawClick(D)}}},{key:"setActiveType",value:function(m){var w=null,D=this.activeType;if(D){var N,W=this.btnMap[D];if(W){Ze.DOM.removeClass(W,rd);var $=this.controlOption.activeButtonClassName;$&&Ze.DOM.removeClass(W,$)}(N=this.drawMap[D])===null||N===void 0||N.disable(),w=null}if(D!==m&&m){var ie;(ie=this.drawMap[m])===null||ie===void 0||ie.enable();var pe=this.btnMap[m];pe&&Ze.DOM.addClass(pe,"".concat(rd," ").concat(this.controlOption.activeButtonClassName)),w=m}this.activeType=w,this.emit(ve.ControlEvent.DrawChange,w)}},{key:"onDrawClick",value:function(m){this.setActiveType(m)}},{key:"clearDrawData",value:function(){Object.values(this.drawMap).forEach(function(m){m==null||m.clear()}),this.emit(ve.ControlEvent.DrawClear)}},{key:"initBtn",value:function(m){var w=Ze.DOM.create("button","".concat(Cd," ").concat(this.controlOption.buttonClassName));return w.innerHTML=`<svg class="l7-draw-icon" aria-hidden="true">
<use xlink:href="`.concat(Ad[m],`"></use>
</svg>`),w.setAttribute(nu,m),w}}]),v}(Ze.Control);ve.ACTIVE_COLOR=H,ve.BaseMode=Fl,ve.CircleDrawer=dd,ve.DEFAULT_ADSORB_CONFIG=ir,ve.DEFAULT_AREA_OPTIONS=Gl,ve.DEFAULT_CIRCLE_HELPER_CONFIG=Te,ve.DEFAULT_COMMON_OPTIONS=ee,ve.DEFAULT_CURSOR_MAP=M,ve.DEFAULT_DISTANCE_OPTIONS=Qa,ve.DEFAULT_DRAG_OPTIONS=jr,ve.DEFAULT_DRAG_POLYGON_HELPER_CONFIg=te,ve.DEFAULT_HISTORY_CONFIG=Wl,ve.DEFAULT_KEYBOARD_CONFIG=ut,ve.DEFAULT_LINE_HELPER_CONFIG=G,ve.DEFAULT_MID_POINT_STYLE=_e,ve.DEFAULT_NODE_NORMAL_STYLE=ue,ve.DEFAULT_NODE_STYLE=g,ve.DEFAULT_POINT_HELPER_CONFIG=B,ve.DEFAULT_POINT_NORMAL_STYLE=ne,ve.DEFAULT_POINT_STYLE=h,ve.DEFAULT_POLYGON_HELPER_CONFIG=q,ve.DEFAULT_POPUP_CONFIG=At,ve.DEFAULT_RECT_HELPER_CONFIG=ce,ve.DEFAULT_SOURCE_DATA=R,ve.DEFAULT_STYLE=b,ve.DEFAULT_TEXT_NORMAL_STYLE=d,ve.DEFAULT_TRIGGER_DRAG_HELPER_CONFIG=fe,ve.DashLineRender=fa,ve.DragPolygonMode=td,ve.DrawCircle=dd,ve.DrawControl=j,ve.DrawLine=Zp,ve.DrawPoint=wf,ve.DrawPolygon=Td,ve.DrawRect=Sf,ve.LayerRender=ql,ve.LineDrawer=Zp,ve.LineMode=Sd,ve.LineRender=Yl,ve.MidPointMode=Ch,ve.MidPointRender=Th,ve.NORMAL_COLOR=k,ve.PointDrawer=wf,ve.PointMode=ed,ve.PointRender=ba,ve.PolygonDrawer=Td,ve.PolygonMode=Up,ve.PolygonRender=z,ve.RENDER_MAP=I,ve.RectDrawer=Sf,ve.SceneRender=s,ve.Source=Ns,ve.TextRender=x,ve.calcAreaText=sr,ve.calcDistanceTextsByLine=Jt,ve.createDashLine=Ma,ve.createLineFeature=Bi,ve.createPointFeature=Mr,ve.createPolygonFeature=el,ve.findMinIndex=$t,ve.getAdsorbPosition=_n,ve.getDefaultLineProperties=Ft,ve.getDefaultPointProperties=Cp,ve.getDefaultPolygonProperties=Xr,ve.getLineCenterPoint=Ir,ve.getLngLat=Mt,ve.getMapDom=lr,ve.getParentByClassName=sm,ve.getPixelExpandBBox=Tn,ve.getPosition=Xt,ve.getPrecisionNumber=Br,ve.getSingleColorStyle=function(p){return{point:{normal:{color:p},hover:{color:p},active:{color:p}},line:{normal:{color:p},hover:{color:p},active:{color:p}},polygon:{normal:{color:p},hover:{color:p},active:{color:p},style:{opacity:.2}},text:{normal:{color:p},active:{color:p}},midPoint:{normal:{color:p}},dashLine:{normal:{color:p}}}},ve.getUuid=ya,ve.injectFeaturesBBox=st,ve.isDev=!1,ve.isPositionInBBox=vn,ve.isSameFeature=Qo,ve.joinMultiFeatures=Vt,ve.resetEventLngLat=Qn,ve.splitByPosition=zr,ve.splitMultiFeatures=Et,ve.transLngLat2Position=pt,ve.updateTargetFeature=Qs,Object.defineProperty(ve,"__esModule",{value:!0})})},20446:function(){},5527:function(Zr,_r,Se){"use strict";Se.r(_r),Se.d(_r,{AJAXError:function(){return Lr},AttributeType:function(){return Vr},BKDRHash:function(){return Eu},BaiduMap:function(){return zP},BaseLayer:function(){return Yd},BaseMapService:function(){return _g},BaseMapWrapper:function(){return Nm},BaseModel:function(){return Ml},BasePostProcessingPass:function(){return Bl},BlendType:function(){return $r},ButtonControl:function(){return hg},CameraUniform:function(){return lr},CanvasLayer:function(){return nC},CanvasUpdateType:function(){return cw},CityBuildingLayer:function(){return wC},Control:function(){return Xd},CoordinateSystem:function(){return Xt},CoordinateUniform:function(){return pt},DOM:function(){return ve},Earth:function(){return tI},EarthLayer:function(){return D4},ExportImage:function(){return fg},FrequencyController:function(){return Gc},Fullscreen:function(){return yy},GaodeMap:function(){return v3},GaodeMapV1:function(){return MP},GaodeMapV2:function(){return v3},GeoLocate:function(){return xy},GeometryLayer:function(){return OC},GoogleMap:function(){return sI},HeatmapLayer:function(){return QC},IDebugLog:function(){return $t},ILayerStage:function(){return _n},ImageLayer:function(){return Cw},InteractionEvent:function(){return zr},LRUCache:function(){return Lu},LayerPopup:function(){return K4},LayerSwitch:function(){return bb},LineLayer:function(){return m2},LinearDir:function(){return s2},LoadTileDataStatus:function(){return z},Logo:function(){return Ey},Map:function(){return cI},MapLibre:function(){return wI},MapServiceEvent:function(){return po},MapTheme:function(){return y0},MapType:function(){return rp},Mapbox:function(){return vI},Marker:function(){return Tv},MarkerLayer:function(){return vy},MaskLayer:function(){return v2},MaskOperation:function(){return vn},MouseLocation:function(){return wb},PassType:function(){return Ei},PointLayer:function(){return l1},PolygonLayer:function(){return u1},PopperControl:function(){return Av},Popup:function(){return Jw},PositionType:function(){return Mt},RasterLayer:function(){return c1},RasterTileType:function(){return Vh},Satistics:function(){return Ze},Scale:function(){return Sy},ScaleTypes:function(){return Qn},Scene:function(){return VD},SceneConifg:function(){return je},SceneEventList:function(){return dm},SelectControl:function(){return Cv},SizeUnitType:function(){return r1},Source:function(){return gy},SourceTile:function(){return Ie},StencilType:function(){return Tn},StyleScaleType:function(){return Fi},Swipe:function(){return q4},TMap:function(){return CI},TencentMap:function(){return OI},TextureBlend:function(){return uw},TextureUsage:function(){return $},TileDebugLayer:function(){return y4},TileLayer:function(){return Xw},TilesetManager:function(){return nn},UpdateTileStrategy:function(){return ba},Viewport:function(){return Fg},WindLayer:function(){return X4},Zoom:function(){return Y4},aProjectFlat:function(){return vl},amap2Project:function(){return fi},amap2UnProject:function(){return tu},anchorTranslate:function(){return $o},anchorType:function(){return _a},applyAnchorClass:function(){return Fo},bBoxToBounds:function(){return ep},bindAll:function(){return nh},boundsContains:function(){return is},calAngle:function(){return Xc},calDistance:function(){return Mc},calculateCentroid:function(){return Pc},calculatePointsCenterAndRadius:function(){return Xl},createLayerContainer:function(){return cp},createSceneContainer:function(){return jp},decodePickingColor:function(){return Aa},defaultValue:function(){return ho},djb2hash:function(){return lh},encodePickingColor:function(){return Ni},expandUrl:function(){return di},extent:function(){return xu},flow:function(){return wh},formatImage:function(){return Yo},generateCatRamp:function(){return lo},generateColorRamp:function(){return lc},generateCustomRamp:function(){return Os},generateLinearRamp:function(){return Ku},generateQuantizeRamp:function(){return bs},getAngle:function(){return hc},getArrayBuffer:function(){return On},getBBoxFromPoints:function(){return Rc},getCullFace:function(){return Tl},getData:function(){return ia},getDefaultDomain:function(){return Io},getImage:function(){return ns},getJSON:function(){return io},getProtocolAction:function(){return xn},getReferrer:function(){return Kp},getTileIndices:function(){return fe},getTileWarpXY:function(){return ce},getURLFromTemplate:function(){return Di},getWMTSURLFromTemplate:function(){return Ui},gl:function(){return Ee},globalConfigService:function(){return $m},guid:function(){return tp},isAndroid:function(){return yu},isColor:function(){return Sl},isImageBitmap:function(){return gp},isPC:function(){return Ya},isURLTemplate:function(){return Gn},isWorker:function(){return vp},isiOS:function(){return Eh},latitude:function(){return ll},lineAtOffset:function(){return Nh},lineAtOffsetAsyc:function(){return xa},lineStyleType:function(){return eC},lngLatInExtent:function(){return rc},lngLatToMeters:function(){return Qh},lnglatDistance:function(){return bu},lodashUtil:function(){return es},longitude:function(){return Ul},makeXMLHttpRequestPromise:function(){return bn},metersToLngLat:function(){return sh},normalize:function(){return mi},osmLonLat2TileXY:function(){return G},osmTileXY2LonLat:function(){return q},packCircleVertex:function(){return Jt},padBounds:function(){return ai},postData:function(){return Ao},project:function(){return Dp},removeDuplicateUniforms:function(){return du},rgb2arr:function(){return Va},sameOrigin:function(){return Ho},tileToBounds:function(){return te},tranfrormCoord:function(){return Cc},unProjectFlat:function(){return oi},validateLngLat:function(){return Wc},version:function(){return jD}});var ve={};Se.r(ve),Se.d(ve,{DPR:function(){return Ll},addClass:function(){return dl},addStyle:function(){return Fs},appendElementType:function(){return Iu},clearChildren:function(){return Ac},create:function(){return Xo},css2Style:function(){return jc},empty:function(){return vf},findParentElement:function(){return rh},getClass:function(){return Zc},getContainer:function(){return wc},getDiffRect:function(){return $p},getStyleList:function(){return Tc},getViewPortScale:function(){return Fh},hasClass:function(){return bh},printCanvas:function(){return Yp},remove:function(){return au},removeClass:function(){return tc},removeStyle:function(){return Ru},setChecked:function(){return Jh},setClass:function(){return mp},setTransform:function(){return _u},setUnDraggable:function(){return kh},splitWords:function(){return Sc},toggleClass:function(){return Kh},triggerResize:function(){return Vc},trim:function(){return qp}});var Ze={};Se.r(Ze),Se.d(Ze,{getColumn:function(){return qc},getSatByColumn:function(){return Sh},max:function(){return ks},mean:function(){return Du},min:function(){return _l},mode:function(){return zh},statMap:function(){return Su},sum:function(){return pc}});var M={},R={},de=t=>R[t],be=(t,e)=>{R[t]=e},Le=t=>M[t],Re=(t,e)=>{M[t]=e},Ce={},He={},Xe=34,Ke=10,Ve=13;function et(t){return new Function("d","return {"+t.map(function(e,r){return JSON.stringify(e)+": d["+r+'] || ""'}).join(",")+"}")}function er(t,e){var r=et(t);return function(n,a){return e(r(n),a,t)}}function fr(t){var e=Object.create(null),r=[];return t.forEach(function(n){for(var a in n)a in e||r.push(e[a]=a)}),r}function Ar(t,e){var r=t+"",n=r.length;return n<e?new Array(e-n+1).join(0)+r:r}function pn(t){return t<0?"-"+Ar(-t,6):t>9999?"+"+Ar(t,6):Ar(t,4)}function Kn(t){var e=t.getUTCHours(),r=t.getUTCMinutes(),n=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":pn(t.getUTCFullYear(),4)+"-"+Ar(t.getUTCMonth()+1,2)+"-"+Ar(t.getUTCDate(),2)+(a?"T"+Ar(e,2)+":"+Ar(r,2)+":"+Ar(n,2)+"."+Ar(a,3)+"Z":n?"T"+Ar(e,2)+":"+Ar(r,2)+":"+Ar(n,2)+"Z":r||e?"T"+Ar(e,2)+":"+Ar(r,2)+"Z":"")}function Jn(t){var e=new RegExp('["'+t+`
\r]`),r=t.charCodeAt(0);function n(Q,ae){var xe,Be,it=a(Q,function(gt,Bt){if(xe)return xe(gt,Bt-1);Be=gt,xe=ae?er(gt,ae):et(gt)});return it.columns=Be||[],it}function a(Q,ae){var xe=[],Be=Q.length,it=0,gt=0,Bt,Rt=Be<=0,Yt=!1;Q.charCodeAt(Be-1)===Ke&&--Be,Q.charCodeAt(Be-1)===Ve&&--Be;function vr(){if(Rt)return He;if(Yt)return Yt=!1,Ce;var cn,Gr=it,Pn;if(Q.charCodeAt(Gr)===Xe){for(;it++<Be&&Q.charCodeAt(it)!==Xe||Q.charCodeAt(++it)===Xe;);return(cn=it)>=Be?Rt=!0:(Pn=Q.charCodeAt(it++))===Ke?Yt=!0:Pn===Ve&&(Yt=!0,Q.charCodeAt(it)===Ke&&++it),Q.slice(Gr+1,cn-1).replace(/""/g,'"')}for(;it<Be;){if((Pn=Q.charCodeAt(cn=it++))===Ke)Yt=!0;else if(Pn===Ve)Yt=!0,Q.charCodeAt(it)===Ke&&++it;else if(Pn!==r)continue;return Q.slice(Gr,cn)}return Rt=!0,Q.slice(Gr,Be)}for(;(Bt=vr())!==He;){for(var ln=[];Bt!==Ce&&Bt!==He;)ln.push(Bt),Bt=vr();ae&&(ln=ae(ln,gt++))==null||xe.push(ln)}return xe}function u(Q,ae){return Q.map(function(xe){return ae.map(function(Be){return Y(xe[Be])}).join(t)})}function y(Q,ae){return ae==null&&(ae=fr(Q)),[ae.map(Y).join(t)].concat(u(Q,ae)).join(`
`)}function A(Q,ae){return ae==null&&(ae=fr(Q)),u(Q,ae).join(`
`)}function O(Q){return Q.map(Z).join(`
`)}function Z(Q){return Q.map(Y).join(t)}function Y(Q){return Q==null?"":Q instanceof Date?Kn(Q):e.test(Q+="")?'"'+Q.replace(/"/g,'""')+'"':Q}return{parse:n,parseRows:a,format:y,formatBody:A,formatRows:O,formatRow:Z,formatValue:Y}}var ki=Jn(","),pa=ki.parse,xr=ki.parseRows,jt=ki.format,Jr=ki.formatBody,gr=ki.formatRows,rn=ki.formatRow,jn=ki.formatValue,qe=63710088e-1,Dt={centimeters:qe*100,centimetres:qe*100,degrees:qe/111325,feet:qe*3.28084,inches:qe*39.37,kilometers:qe/1e3,kilometres:qe/1e3,meters:qe,metres:qe,miles:qe/1609.344,millimeters:qe*1e3,millimetres:qe*1e3,nauticalmiles:qe/1852,radians:1,yards:qe*1.0936},$e={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/qe,yards:1.0936133},Pt={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function vt(t,e,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function rr(t,e,r){switch(r===void 0&&(r={}),t){case"Point":return ar(e).geometry;case"LineString":return yi(e).geometry;case"Polygon":return Cr(e).geometry;case"MultiPoint":return bo(e).geometry;case"MultiLineString":return vi(e).geometry;case"MultiPolygon":return So(e).geometry;default:throw new Error(t+" is invalid")}}function ar(t,e,r){if(r===void 0&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!dr(t[0])||!dr(t[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:t};return vt(n,e,r)}function wr(t,e,r){return r===void 0&&(r={}),Uo(t.map(function(n){return ar(n,e)}),r)}function Cr(t,e,r){r===void 0&&(r={});for(var n=0,a=t;n<a.length;n++){var u=a[n];if(u.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var y=0;y<u[u.length-1].length;y++)if(u[u.length-1][y]!==u[0][y])throw new Error("First and last Position are not equivalent.")}var A={type:"Polygon",coordinates:t};return vt(A,e,r)}function an(t,e,r){return r===void 0&&(r={}),Uo(t.map(function(n){return Cr(n,e)}),r)}function yi(t,e,r){if(r===void 0&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:t};return vt(n,e,r)}function li(t,e,r){return r===void 0&&(r={}),Uo(t.map(function(n){return yi(n,e)}),r)}function Uo(t,e){e===void 0&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function vi(t,e,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:t};return vt(n,e,r)}function bo(t,e,r){r===void 0&&(r={});var n={type:"MultiPoint",coordinates:t};return vt(n,e,r)}function So(t,e,r){r===void 0&&(r={});var n={type:"MultiPolygon",coordinates:t};return vt(n,e,r)}function Xi(t,e,r){r===void 0&&(r={});var n={type:"GeometryCollection",geometries:t};return vt(n,e,r)}function Mi(t,e){if(e===void 0&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r}function qo(t,e){e===void 0&&(e="kilometers");var r=Dt[e];if(!r)throw new Error(e+" units is invalid");return t*r}function ui(t,e){e===void 0&&(e="kilometers");var r=Dt[e];if(!r)throw new Error(e+" units is invalid");return t/r}function Qi(t,e){return Pi(ui(t,e))}function Vi(t){var e=t%360;return e<0&&(e+=360),e}function Pi(t){var e=t%(2*Math.PI);return e*180/Math.PI}function ds(t){var e=t%360;return e*Math.PI/180}function Ur(t,e,r){if(e===void 0&&(e="kilometers"),r===void 0&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return qo(ui(t,e),r)}function ls(t,e,r){if(e===void 0&&(e="meters"),r===void 0&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var n=Pt[e];if(!n)throw new Error("invalid original units");var a=Pt[r];if(!a)throw new Error("invalid final units");return t/n*a}function dr(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function he(t){return!!t&&t.constructor===Object}function We(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(e){if(!dr(e))throw new Error("bbox must only contain numbers")})}function at(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}function Ot(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function or(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Wr(t){if(t.length>1&&isNumber(t[0])&&isNumber(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return Wr(t[0]);throw new Error("coordinates must only contain numbers")}function In(t,e,r){if(!e||!r)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.type)}function kn(t,e,r){if(!t)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!t||t.type!=="Feature"||!t.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.geometry.type)}function eo(t,e,r){if(!t)throw new Error("No featureCollection passed");if(!r)throw new Error(".collectionOf() requires a name");if(!t||t.type!=="FeatureCollection")throw new Error("Invalid input to "+r+", FeatureCollection required");for(var n=0,a=t.features;n<a.length;n++){var u=a[n];if(!u||u.type!=="Feature"||!u.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!u.geometry||u.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+u.geometry.type)}}function un(t){return t.type==="Feature"?t.geometry:t}function To(t,e){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function Ti(t,e,r){if(t!==null)for(var n,a,u,y,A,O,Z,Y=0,Q=0,ae,xe=t.type,Be=xe==="FeatureCollection",it=xe==="Feature",gt=Be?t.features.length:1,Bt=0;Bt<gt;Bt++){Z=Be?t.features[Bt].geometry:it?t.geometry:t,ae=Z?Z.type==="GeometryCollection":!1,A=ae?Z.geometries.length:1;for(var Rt=0;Rt<A;Rt++){var Yt=0,vr=0;if(y=ae?Z.geometries[Rt]:Z,y!==null){O=y.coordinates;var ln=y.type;switch(Y=r&&(ln==="Polygon"||ln==="MultiPolygon")?1:0,ln){case null:break;case"Point":if(e(O,Q,Bt,Yt,vr)===!1)return!1;Q++,Yt++;break;case"LineString":case"MultiPoint":for(n=0;n<O.length;n++){if(e(O[n],Q,Bt,Yt,vr)===!1)return!1;Q++,ln==="MultiPoint"&&Yt++}ln==="LineString"&&Yt++;break;case"Polygon":case"MultiLineString":for(n=0;n<O.length;n++){for(a=0;a<O[n].length-Y;a++){if(e(O[n][a],Q,Bt,Yt,vr)===!1)return!1;Q++}ln==="MultiLineString"&&Yt++,ln==="Polygon"&&vr++}ln==="Polygon"&&Yt++;break;case"MultiPolygon":for(n=0;n<O.length;n++){for(vr=0,a=0;a<O[n].length;a++){for(u=0;u<O[n][a].length-Y;u++){if(e(O[n][a][u],Q,Bt,Yt,vr)===!1)return!1;Q++}vr++}Yt++}break;case"GeometryCollection":for(n=0;n<y.geometries.length;n++)if(Ti(y.geometries[n],e,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Lo(t,e,r,n){var a=r;return Ti(t,function(u,y,A,O,Z){y===0&&r===void 0?a=u:a=e(a,u,y,A,O,Z)},n),a}function wa(t,e){var r;switch(t.type){case"FeatureCollection":for(r=0;r<t.features.length&&e(t.features[r].properties,r)!==!1;r++);break;case"Feature":e(t.properties,0);break}}function dn(t,e,r){var n=r;return wa(t,function(a,u){u===0&&r===void 0?n=a:n=e(n,a,u)}),n}function co(t,e){if(t.type==="Feature")e(t,0);else if(t.type==="FeatureCollection")for(var r=0;r<t.features.length&&e(t.features[r],r)!==!1;r++);}function no(t,e,r){var n=r;return co(t,function(a,u){u===0&&r===void 0?n=a:n=e(n,a,u)}),n}function Za(t){var e=[];return Ti(t,function(r){e.push(r)}),e}function ms(t,e){var r,n,a,u,y,A,O,Z,Y,Q,ae=0,xe=t.type==="FeatureCollection",Be=t.type==="Feature",it=xe?t.features.length:1;for(r=0;r<it;r++){for(A=xe?t.features[r].geometry:Be?t.geometry:t,Z=xe?t.features[r].properties:Be?t.properties:{},Y=xe?t.features[r].bbox:Be?t.bbox:void 0,Q=xe?t.features[r].id:Be?t.id:void 0,O=A?A.type==="GeometryCollection":!1,y=O?A.geometries.length:1,a=0;a<y;a++){if(u=O?A.geometries[a]:A,u===null){if(e(null,ae,Z,Y,Q)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(u,ae,Z,Y,Q)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<u.geometries.length;n++)if(e(u.geometries[n],ae,Z,Y,Q)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}ae++}}function Ji(t,e,r){var n=r;return ms(t,function(a,u,y,A,O){u===0&&r===void 0?n=a:n=e(n,a,u,y,A,O)}),n}function Us(t,e){ms(t,function(r,n,a,u,y){var A=r===null?null:r.type;switch(A){case null:case"Point":case"LineString":case"Polygon":return e(vt(r,a,{bbox:u,id:y}),n,0)===!1?!1:void 0}var O;switch(A){case"MultiPoint":O="Point";break;case"MultiLineString":O="LineString";break;case"MultiPolygon":O="Polygon";break}for(var Z=0;Z<r.coordinates.length;Z++){var Y=r.coordinates[Z],Q={type:O,coordinates:Y};if(e(vt(Q,a),n,Z)===!1)return!1}})}function Lt(t,e,r){var n=r;return Us(t,function(a,u,y){u===0&&y===0&&r===void 0?n=a:n=e(n,a,u,y)}),n}function Ne(t,e){Us(t,function(r,n,a){var u=0;if(r.geometry){var y=r.geometry.type;if(!(y==="Point"||y==="MultiPoint")){var A,O=0,Z=0,Y=0;if(Ti(r,function(Q,ae,xe,Be,it){if(A===void 0||n>O||Be>Z||it>Y){A=Q,O=n,Z=Be,Y=it,u=0;return}var gt=lineString([A,Q],r.properties);if(e(gt,n,a,it,u)===!1)return!1;u++,A=Q})===!1)return!1}}})}function re(t,e,r){var n=r,a=!1;return Ne(t,function(u,y,A,O,Z){a===!1&&r===void 0?n=u:n=e(n,u,y,A,O,Z),a=!0}),n}function le(t,e){if(!t)throw new Error("geojson is required");Us(t,function(r,n,a){if(r.geometry!==null){var u=r.geometry.type,y=r.geometry.coordinates;switch(u){case"LineString":if(e(r,n,a,0,0)===!1)return!1;break;case"Polygon":for(var A=0;A<y.length;A++)if(e(lineString(y[A],r.properties),n,a,A)===!1)return!1;break}}})}function ge(t,e,r){var n=r;return le(t,function(a,u,y,A){u===0&&r===void 0?n=a:n=e(n,a,u,y,A)}),n}function ye(t,e){if(e=e||{},!isObject(e))throw new Error("options is invalid");var r=e.featureIndex||0,n=e.multiFeatureIndex||0,a=e.geometryIndex||0,u=e.segmentIndex||0,y=e.properties,A;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),y=y||t.features[r].properties,A=t.features[r].geometry;break;case"Feature":y=y||t.properties,A=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":A=t;break;default:throw new Error("geojson is invalid")}if(A===null)return null;var O=A.coordinates;switch(A.type){case"Point":case"MultiPoint":return null;case"LineString":return u<0&&(u=O.length+u-1),lineString([O[u],O[u+1]],y,e);case"Polygon":return a<0&&(a=O.length+a),u<0&&(u=O[a].length+u-1),lineString([O[a][u],O[a][u+1]],y,e);case"MultiLineString":return n<0&&(n=O.length+n),u<0&&(u=O[n].length+u-1),lineString([O[n][u],O[n][u+1]],y,e);case"MultiPolygon":return n<0&&(n=O.length+n),a<0&&(a=O[n].length+a),u<0&&(u=O[n][a].length-u-1),lineString([O[n][a][u],O[n][a][u+1]],y,e)}throw new Error("geojson is invalid")}function ze(t,e){if(e=e||{},!isObject(e))throw new Error("options is invalid");var r=e.featureIndex||0,n=e.multiFeatureIndex||0,a=e.geometryIndex||0,u=e.coordIndex||0,y=e.properties,A;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),y=y||t.features[r].properties,A=t.features[r].geometry;break;case"Feature":y=y||t.properties,A=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":A=t;break;default:throw new Error("geojson is invalid")}if(A===null)return null;var O=A.coordinates;switch(A.type){case"Point":return point(O,y,e);case"MultiPoint":return n<0&&(n=O.length+n),point(O[n],y,e);case"LineString":return u<0&&(u=O.length+u),point(O[u],y,e);case"Polygon":return a<0&&(a=O.length+a),u<0&&(u=O[a].length+u),point(O[a][u],y,e);case"MultiLineString":return n<0&&(n=O.length+n),u<0&&(u=O[n].length+u),point(O[n][u],y,e);case"MultiPolygon":return n<0&&(n=O.length+n),a<0&&(a=O[n].length+a),u<0&&(u=O[n][a].length-u),point(O[n][a][u],y,e)}throw new Error("geojson is invalid")}var je={REGISTERED_PROTOCOLS:{}},Ue=Object.defineProperty,Ae=Object.defineProperties,Je=Object.getOwnPropertyDescriptors,wt=Object.getOwnPropertySymbols,Ht=Object.prototype.hasOwnProperty,Fr=Object.prototype.propertyIsEnumerable,mr=(t,e,r)=>e in t?Ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sr=(t,e)=>{for(var r in e||(e={}))Ht.call(e,r)&&mr(t,r,e[r]);if(wt)for(var r of wt(e))Fr.call(e,r)&&mr(t,r,e[r]);return t},fn=(t,e)=>Ae(t,Je(e)),xn=t=>je.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))],Lr=class extends Error{constructor(t,e,r,n){super(`AJAXError: ${e} (${t}): ${r}`),this.status=t,this.statusText=e,this.url=r,this.body=n}};function Nn(t,e){const r=new XMLHttpRequest,n=Array.isArray(t.url)?t.url[0]:t.url;r.open(t.method||"GET",n,!0),t.type==="arrayBuffer"&&(r.responseType="arraybuffer");for(const a in t.headers)t.headers.hasOwnProperty(a)&&r.setRequestHeader(a,t.headers[a]);return t.type==="json"&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials=t.credentials==="include",r.onerror=()=>{e(new Error(r.statusText))},r.onload=()=>{if((r.status>=200&&r.status<300||r.status===0)&&r.response!==null){let a=r.response;if(t.type==="json")try{a=JSON.parse(r.response)}catch(u){return e(u)}e(null,a,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"),r)}else{const a=new Blob([r.response],{type:r.getResponseHeader("Content-Type")});e(new Lr(r.status,r.statusText,n.toString(),a))}},r.cancel=r.abort,r.send(t.body),r}function bn(t){return new Promise((e,r)=>{Nn(t,(n,a,u,y,A)=>{n?r({err:n,data:null,xhr:A}):e({err:null,data:a,cacheControl:u,expires:y,xhr:A})})})}function En(t,e){return Nn(t,e)}var io=(t,e)=>(xn(t.url)||En)(fn(Sr({},t),{type:"json"}),e),On=(t,e)=>(xn(t.url)||En)(fn(Sr({},t),{type:"arrayBuffer"}),e),Ao=(t,e)=>En(fn(Sr({},t),{method:"POST"}),e),ia=(t,e)=>En(fn(Sr({},t),{method:"GET"}),e);function Ho(t){const e=window.document.createElement("a");return e.href=t,e.protocol===window.document.location.protocol&&e.host===window.document.location.host}var Ga="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Wo(t,e){const r=new window.Image,n=window.URL||window.webkitURL;r.crossOrigin="anonymous",r.onload=()=>{e(null,r),n.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>{r.src=Ga})},r.onerror=()=>e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const a=new Blob([new Uint8Array(t)],{type:"image/png"});r.src=t.byteLength?n.createObjectURL(a):Ga}function Hl(t,e){const r=new Blob([new Uint8Array(t)],{type:"image/png"});createImageBitmap(r).then(n=>{e(null,n)}).catch(n=>{e(new Error(`Could not load image because of ${n.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}var ns=(t,e,r)=>{const n=(a,u)=>{if(a)e(a);else if(u){const y=typeof createImageBitmap=="function",A=r?r(u):u;y?Hl(A,e):Wo(A,e)}};return t.type==="json"?io(t,n):On(t,n)},Yo=(t,e)=>{typeof createImageBitmap=="function"?Hl(t,e):Wo(t,e)},_a=(t=>(t.CENTER="center",t.TOP="top",t["TOP-LEFT"]="top-left",t["TOP-RIGHT"]="top-right",t.BOTTOM="bottom",t["BOTTOM-LEFT"]="bottom-left",t["BOTTOM-RIGHT"]="bottom-right",t.LEFT="left",t.RIGHT="right",t))(_a||{}),$o={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Fo(t,e,r){const n=t.classList;for(const a in $o)$o.hasOwnProperty(a)&&n.remove(`l7-${r}-anchor-${a}`);n.add(`l7-${r}-anchor-${e}`)}function us(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function xc(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Ba(){}var Fa=.7,sc=1/Fa,Ql="\\s*([+-]?\\d+)\\s*",oa="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zo="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",il=/^#([0-9a-f]{3,8})$/,va=new RegExp("^rgb\\("+[Ql,Ql,Ql]+"\\)$"),El=new RegExp("^rgb\\("+[Zo,Zo,Zo]+"\\)$"),Wa=new RegExp("^rgba\\("+[Ql,Ql,Ql,oa]+"\\)$"),Ds=new RegExp("^rgba\\("+[Zo,Zo,Zo,oa]+"\\)$"),Rl=new RegExp("^hsl\\("+[oa,Zo,Zo]+"\\)$"),gu=new RegExp("^hsla\\("+[oa,Zo,Zo,oa]+"\\)$"),gl={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};us(Ba,Gl,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:wl,formatHex:wl,formatHsl:ol,formatRgb:Qa,toString:Qa});function wl(){return this.rgb().formatHex()}function ol(){return kl(this).formatHsl()}function Qa(){return this.rgb().formatRgb()}function Gl(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=il.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?Wl(e):r===3?new jr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?ut(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?ut(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=va.exec(t))?new jr(e[1],e[2],e[3],1):(e=El.exec(t))?new jr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Wa.exec(t))?ut(e[1],e[2],e[3],e[4]):(e=Ds.exec(t))?ut(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Rl.exec(t))?mn(e[1],e[2]/100,e[3]/100,1):(e=gu.exec(t))?mn(e[1],e[2]/100,e[3]/100,e[4]):gl.hasOwnProperty(t)?Wl(gl[t]):t==="transparent"?new jr(NaN,NaN,NaN,0):null}function Wl(t){return new jr(t>>16&255,t>>8&255,t&255,1)}function ut(t,e,r,n){return n<=0&&(t=e=r=NaN),new jr(t,e,r,n)}function At(t){return t instanceof Ba||(t=Gl(t)),t?(t=t.rgb(),new jr(t.r,t.g,t.b,t.opacity)):new jr}function ir(t,e,r,n){return arguments.length===1?At(t):new jr(t,e,r,n==null?1:n)}function jr(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}us(jr,ir,xc(Ba,{brighter:function(t){return t=t==null?sc:Math.pow(sc,t),new jr(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=t==null?Fa:Math.pow(Fa,t),new jr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Dn,formatHex:Dn,formatRgb:oo,toString:oo}));function Dn(){return"#"+Xa(this.r)+Xa(this.g)+Xa(this.b)}function oo(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(t===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(t===1?")":", "+t+")")}function Xa(t){return t=Math.max(0,Math.min(255,Math.round(t)||0)),(t<16?"0":"")+t.toString(16)}function mn(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Ia(t,e,r,n)}function kl(t){if(t instanceof Ia)return new Ia(t.h,t.s,t.l,t.opacity);if(t instanceof Ba||(t=Gl(t)),!t)return new Ia;if(t instanceof Ia)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,a=Math.min(e,r,n),u=Math.max(e,r,n),y=NaN,A=u-a,O=(u+a)/2;return A?(e===u?y=(r-n)/A+(r<n)*6:r===u?y=(n-e)/A+2:y=(e-r)/A+4,A/=O<.5?u+a:2-u-a,y*=60):A=O>0&&O<1?0:y,new Ia(y,A,O,t.opacity)}function Il(t,e,r,n){return arguments.length===1?kl(t):new Ia(t,e,r,n==null?1:n)}function Ia(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}us(Ia,Il,xc(Ba,{brighter:function(t){return t=t==null?sc:Math.pow(sc,t),new Ia(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=t==null?Fa:Math.pow(Fa,t),new Ia(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,a=2*r-n;return new jr(Xh(t>=240?t-240:t+120,a,n),Xh(t,a,n),Xh(t<120?t+240:t-120,a,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(t===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(t===1?")":", "+t+")")}}));function Xh(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}function Sl(t){return typeof t=="string"?!!Gl(t):!1}function Va(t){const e=Gl(t),r=[0,0,0,0];return e!=null&&(r[0]=e.r/255,r[1]=e.g/255,r[2]=e.b/255,r[3]=e.opacity),r}function Aa(t){const e=t&&t[0],r=t&&t[1],n=t&&t[2];return e+r*256+n*65536-1}function Ni(t){return[t+1&255,t+1>>8&255,t+1>>8>>8&255]}function lc(t){let e=window.document.createElement("canvas"),r=e.getContext("2d");e.width=256,e.height=1;let n=null;const a=r.createLinearGradient(0,0,256,1),u=t.positions[0],y=t.positions[t.positions.length-1];for(let A=0;A<t.colors.length;++A){const O=(t.positions[A]-u)/(y-u);a.addColorStop(O,t.colors[A])}return r.fillStyle=a,r.fillRect(0,0,256,1),n=new Uint8ClampedArray(r.getImageData(0,0,256,1).data),e=null,r=null,{data:n,width:256,height:1}}function Ku(t,e){let r=window.document.createElement("canvas"),n=r.getContext("2d");r.width=256,r.height=1;const a=n.createLinearGradient(0,0,256,1),u=e[1]-e[0];for(let O=0;O<t.colors.length;++O){const Z=Math.max((t.positions[O]-e[0])/u,0);a.addColorStop(Z,t.colors[O])}n.fillStyle=a,n.fillRect(0,0,256,1);const y=n.getImageData(0,0,256,1).data,A=Nl(n,y);return r=null,n=null,A}function lo(t){let e=window.document.createElement("canvas"),r=e.getContext("2d");e.width=256,e.height=1;const n=r.createImageData(256,1);return n.data.fill(0),t.positions.forEach((a,u)=>{const y=Va(t.colors[u]);n.data[a*4+0]=y[0]*255,n.data[a*4+1]=y[1]*255,n.data[a*4+2]=y[2]*255,n.data[a*4+3]=y[3]*255}),e=null,r=null,n}function bs(t){let e=window.document.createElement("canvas"),r=e.getContext("2d");r.globalAlpha=1,e.width=256,e.height=1;const n=256/t.colors.length;for(let y=0;y<t.colors.length;y++)r.beginPath(),r.lineWidth=2,r.strokeStyle=t.colors[y],r.moveTo(y*n,0),r.lineTo((y+1)*n,0),r.stroke();const a=r.getImageData(0,0,256,1).data,u=Nl(r,a);return e=null,r=null,u}function Os(t,e){let r=window.document.createElement("canvas"),n=r.getContext("2d");n.globalAlpha=1,r.width=256,r.height=1;const a=e[1]-e[0];t.positions.length-t.colors.length!==1&&console.warn("positions \u7684\u6570\u5B57\u4E2A\u6570\u5E94\u5F53\u6BD4 colors \u7684\u6837\u5F0F\u591A\u4E00\u4E2A,poisitions \u7684\u9996\u5C3E\u503C\u4E00\u822C\u4E3A\u6570\u636E\u7684\u6700\u5927\u6700\u65B0\u503C");for(let A=0;A<t.colors.length;A++)n.beginPath(),n.lineWidth=2,n.strokeStyle=t.colors[A],n.moveTo((t.positions[A]-e[0])/a*255,0),n.lineTo((t.positions[A+1]-e[0])/a*255,0),n.stroke();const u=n.getImageData(0,0,256,1).data,y=Nl(n,u);return r=null,n=null,y}function Nl(t,e){const r=t.createImageData(256,1);for(let n=0;n<r.data.length;n+=4)r.data[n+0]=e[n+0],r.data[n+1]=e[n+1],r.data[n+2]=e[n+2],r.data[n+3]=e[n+3];return r}function Io(t){switch(t==null?void 0:t.type){case"cat":return[0,255];default:return[0,1]}}var eu={BACK:1029,FRONT:1028};function Tl(t){switch(t){case"GAODE1.x":return eu.BACK;case"GAODE2.x":return eu.BACK;case"MAPBOX":return eu.FRONT;case"SIMPLE":return eu.FRONT;case"GLOBEL":return eu.BACK;case"DEBAULT":return eu.FRONT;default:return eu.FRONT}}var Fu=Se(35636),Ju=Se.n(Fu),al=Se(32222),Kc=Se.n(al),ou=Se(66292),Ks=Se.n(ou),Lp=Se(65439),gf=Se.n(Lp),Of=Se(98071),qh=Se.n(Of),zc=Se(31223),Oh=Se.n(zc),Ms=Se(46207),Jc=Se.n(Ms),Yh=Se(59933),Qc=Se.n(Yh),uc=Se(69143),eh=Se.n(uc),yh=Se(56549),sl=Se.n(yh),Uc=Se(73806),bc=Se.n(Uc),fp=Se(67929),dp=Se.n(fp),Ps=Se(53954),Gf=Se.n(Ps),Xp=Se(25066),cc=Se.n(Xp),zl=Se(38209),Ec=Se.n(zl),th=Se(4363),vu=Se.n(th),xh=Se(42950),qa=Se.n(xh),Hs=Se(92042),Ep=Se.n(Hs),Na=Se(36838),Qu=Se.n(Na),Is=Se(89300),ys=Se.n(Is),ec=Se(47638),Bf=Se.n(ec),es={isNil:Jc(),merge:dp(),throttle:Ec(),isString:sl(),debounce:Ks(),pull:cc(),isTypedArray:bc(),isPlainObject:eh(),isNumber:Qc(),isBoolean:qh(),isEqual:Oh(),cloneDeep:Kc(),uniq:vu(),clamp:Ju(),upperFirst:qa(),get:gf(),mergeWith:Gf(),isFunction:Ep(),isObject:Qu(),isUndefined:ys(),camelCase:Bf()},{pull:Bs}=es;function wc(t){let e=t;return typeof t=="string"&&(e=window.document.getElementById(t)),e}function qp(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Sc(t){return qp(t).split(/\s+/)}function $h(t){var e;const r=(e=document==null?void 0:document.documentElement)==null?void 0:e.style;if(!r)return t[0];for(const n in t)if(t[n]&&t[n]in r)return t[n];return t[0]}function Xo(t,e,r){const n=window.document.createElement(t);return e&&(n.className=e||""),r&&r.appendChild(n),n}function au(t){const e=t.parentNode;e&&e.removeChild(t)}function dl(t,e){if(t.classList!==void 0){const r=Sc(e);for(let n=0,a=r.length;n<a;n++)t.classList.add(r[n])}else if(!bh(t,e)){const r=Zc(t);mp(t,(r?r+" ":"")+e)}}function tc(t,e){t.classList!==void 0?Sc(e).forEach(n=>{t.classList.remove(n)}):mp(t,qp((" "+Zc(t)+" ").replace(" "+e+" "," ")))}function bh(t,e){if(t.classList!==void 0)return t.classList.contains(e);const r=Zc(t);return r.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(r)}function mp(t,e){t instanceof HTMLElement?t.className=e:t.className.baseVal=e}function Kh(t,e,r){r===void 0?bh(t,e)?tc(t,e):dl(t,e):r?dl(t,e):tc(t,e)}function Zc(t){return t instanceof SVGElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}function vf(t){for(;t&&t.firstChild;)t.removeChild(t.firstChild)}var Bh=$h(["transform","WebkitTransform"]);function _u(t,e){t.style[Bh]=e}function Vc(){if(typeof Event=="function")window.dispatchEvent(new Event("resize"));else{const t=window.document.createEvent("UIEvents");t.initUIEvent("resize",!0,!1,window,0),window.dispatchEvent(t)}}function Yp(t){const e=["padding: "+(t.height/2-8)+"px "+t.width/2+"px;","line-height: "+t.height+"px;","background-image: url("+t.toDataURL()+");"];console.log(`%c
`,e.join(""))}function Fh(){var t;const e=window.document.querySelector('meta[name="viewport"]');if(!e)return 1;const n=((t=e.content)==null?void 0:t.split(",")).find(a=>{const[u]=a.split("=");return u==="initial-scale"});return n?n.split("=")[1]*1:1}var Ll=Fh()<1?1:window.devicePixelRatio;function Fs(t,e){t.setAttribute("style",`${t.style.cssText}${e}`)}function Tc(t){return t.split(";").map(e=>e.trim()).filter(e=>e)}function Ru(t,e){var r;const n=Tc((r=t.getAttribute("style"))!=null?r:""),a=Tc(e),u=Bs(n,...a);t.setAttribute("style",u.join(";"))}function jc(t){return Object.entries(t).map(([e,r])=>`${e}: ${r}`).join(";")}function $p(t,e){return{left:t.left-e.left,top:t.top-e.top,right:e.left+e.width-t.left-t.width,bottom:e.top+e.height-t.top-t.height}}function Jh(t,e){t.checked=e,e?t.setAttribute("checked","true"):t.removeAttribute("checked")}function Ac(t){t.innerHTML=""}function kh(t){t.setAttribute("draggable","false")}function Iu(t,e){if(typeof e=="string"){const r=document.createElement("div");for(r.innerHTML=e;r.firstChild;)t.append(r.firstChild)}else Array.isArray(e)?t.append(...e):t.append(e)}function rh(t,e){var r;const n=Array.isArray(e)?e:[e];let a=t;for(;a instanceof Element&&a!==window.document.body;){if(n.find(u=>a==null?void 0:a.matches(u)))return a;a=(r=a==null?void 0:a.parentElement)!=null?r:null}}function gp(t){return typeof ImageBitmap!="undefined"&&t instanceof ImageBitmap}function vp(){return typeof importScripts=="function"}var Kp=vp()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,Hc=navigator==null?void 0:navigator.userAgent,Eh=!!Hc.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),yu=Hc.indexOf("Android")>-1||Hc.indexOf("Adr")>-1;function Ya(){const t=Hc,e=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"];let r=!0;for(const n of e)if(t.indexOf(n)>0){r=!1;break}return r}function nh(t,e){t.forEach(r=>{e[r]&&(e[r]=e[r].bind(e))})}var Gc=class{constructor(t=16){this.duration=16,this.timestamp=new Date().getTime(),this.duration=t}run(t){const e=new Date().getTime(),r=e-this.timestamp;this.timestamp=e,r>=this.duration&&t()}};function ih(t){var e=[1/0,1/0,-1/0,-1/0];return Ti(t,function(r){e[0]>r[0]&&(e[0]=r[0]),e[1]>r[1]&&(e[1]=r[1]),e[2]<r[0]&&(e[2]=r[0]),e[3]<r[1]&&(e[3]=r[1])}),e}ih.default=ih;var Sa=ih;function cs(t){return typeof t=="number"}var ku=2*Math.PI*6378137/2;function rc(t,e){const[r,n,a,u]=e;return t.lng>r&&t.lng<=a&&t.lat>n&&t.lat<=u}function xu(t){const e=[1/0,1/0,-1/0,-1/0];return t.forEach(r=>{const{coordinates:n}=r;oh(e,n)}),e}function oh(t,e){return Array.isArray(e[0])?e.forEach(r=>{oh(t,r)}):(t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])),t}function Cc(t,e){return ah(t,e)}function ah(t,e){return Array.isArray(t[0])?t.map(r=>ah(r,e)):e(t)}function Qh(t,e=!0,r={enable:!0,decimal:1}){t=Wc(t,e);const n=t[0],a=t[1];let u=n*ku/180,y=Math.log(Math.tan((90+a)*Math.PI/360))/(Math.PI/180);return y=y*ku/180,r.enable&&(u=Number(u.toFixed(r.decimal)),y=Number(y.toFixed(r.decimal))),t.length===3?[u,y,t[2]]:[u,y]}function sh(t,e=6){const r=t[0],n=t[1];let a=r/ku*180,u=n/ku*180;return u=180/Math.PI*(2*Math.atan(Math.exp(u*Math.PI/180))-Math.PI/2),e!=null&&(a=Number(a.toFixed(e)),u=Number(u.toFixed(e))),t.length===3?[a,u,t[2]]:[a,u]}function Ul(t){if(t==null)throw new Error("lng is required");return(t>180||t<-180)&&(t=t%360,t>180&&(t=-360+t),t<-180&&(t=360+t),t===0&&(t=0)),t}function ll(t){if(t==null)throw new Error("lat is required");return(t>90||t<-90)&&(t=t%180,t>90&&(t=-180+t),t<-90&&(t=180+t),t===0&&(t=0)),t}function Wc(t,e){if(e===!1)return t;const r=Ul(t[0]);let n=ll(t[1]);return n>85&&(n=85),n<-85&&(n=-85),t.length===3?[r,n,t[2]]:[r,n]}function vl(t){const e=85.0511287798,r=Math.max(Math.min(e,t[1]),-e),n=256<<20;let a=Math.PI/180,u=t[0]*a,y=r*a;y=Math.log(Math.tan(Math.PI/4+y/2));const A=.5/Math.PI,O=.5,Z=-.5/Math.PI;return a=.5,u=n*(A*u+O),y=n*(Z*y+a),[Math.floor(u),Math.floor(y)]}function oi(t){const e=.5/Math.PI,r=.5,n=-.5/Math.PI;let a=.5;const u=256<<20;let[y,A]=t;y=(y/u-r)/e,A=(A/u-a)/n,A=(Math.atan(Math.pow(Math.E,A))-Math.PI/4)*2,a=Math.PI/180;const O=A/a;return[y/a,O]}function fi(t,e){const r=85.0511287798,n=Math.PI/180,a=6378137;return e=Math.max(Math.min(r,e),-r),t*=n,e*=n,e=Math.log(Math.tan(Math.PI/4+e/2)),[t*a,e*a]}function tu(t,e){const r=Math.PI/180,n=6378137,a=t/n/r,u=2*(Math.atan(Math.exp(e/n))-Math.PI/4)/r;return[a,u]}function bu(t,e,r){const n=ds(e[1]-t[1]),a=ds(e[0]-t[0]),u=ds(t[1]),y=ds(e[1]),A=Math.pow(Math.sin(n/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(u)*Math.cos(y);return qo(2*Math.atan2(Math.sqrt(A),Math.sqrt(1-A)),r="meters")}function Dp(t){const e=Math.PI/180,r=85.0511287798,n=6378137,a=Math.max(Math.min(r,t[1]),-r),u=Math.sin(a*e),y=n*t[0]*e,A=n*Math.log((1+u)/(1-u))/2;return[y,A]}function ai(t,e){const r=Math.abs(t[1][1]-t[0][1])*e,n=Math.abs(t[1][0]-t[0][0])*e;return[[t[0][0]-n,t[0][1]-r],[t[1][0]+n,t[1][1]+r]]}function is(t,e){return t[0][0]<=e[0][0]&&t[0][1]<=e[0][1]&&t[1][0]>=e[1][0]&&t[1][1]>=e[1][1]}function ep(t){return[[t[0],t[1]],[t[2],t[3]]]}function mi(t){const e=Mc(t,[0,0]);return[t[0]/e,t[1]/e]}function Mc(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Op(t,e){return t[0]*e[0]+t[1]*e[1]}function Jp(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Xc(t,e){return Math.acos(Op(t,e)/(Jp(t)*Jp(e)))*180/Math.PI}function hc(t,e){return e[0]>0?e[1]>0?90-Math.atan(e[1]/e[0])*180/Math.PI:90+Math.atan(-e[1]/e[0])*180/Math.PI:e[1]<0?180+(90-Math.atan(e[1]/e[0])*180/Math.PI):270+Math.atan(e[1]/-e[0])*180/Math.PI}function wh(t,e=100){if(!t||t.length<2)return;const r=[0,1];let n=0;const a=[];for(let u=0;u<t.length-1;u++){const y=t[u],A=t[u+1],O=Mc(y,A);n+=O;const Z=[y[0]-A[0],y[1]-A[1]];let Y=hc(r,Z);if(u>0){const Q=a[u-1].rotation;Q-Y>360-Q+Y&&(Y=Y+360)}a.push({start:y,end:A,dis:O,rotation:Y,duration:0})}return a.map(u=>{u.duration=e*(u.dis/n)}),a}function Pc(t){if(cs(t[0]))return t;if(cs(t[0][0]))throw new Error("\u5F53\u524D\u6570\u636E\u4E0D\u652F\u6301\u6807\u6CE8");if(cs(t[0][0][0])){const e=t;let r=0,n=0,a=0;return e.forEach(u=>{u.forEach(y=>{r+=y[0],n+=y[1],a++})}),[r/a,n/a,0]}else throw new Error("\u5F53\u524D\u6570\u636E\u4E0D\u652F\u6301\u6807\u6CE8")}function Xl(t){let e=t[0],r=t[1],n=t[0],a=t[1],u=0,y=0,A=0;for(let O=0;O<t.length;O+=2){const Z=t[O],Y=t[O+1];Z&&Y&&(e=Math.max(Z,e),r=Math.max(Y,r),n=Math.min(Z,n),a=Math.min(Y,a),u+=Z,y+=Y,A++)}return{center:[u/A,y/A],radius:Math.sqrt(Math.pow(e-n,2)+Math.pow(r-a,2))/2}}function Rc(t){return Sa(Uo([yi(t)]))}function Eu(t){let n=0;t+="x";const a=Math.floor(9007199254740991/137);for(let u=0;u<t.length;u++)n>a&&(n=Math.floor(n/137)),n=n*131+t.charCodeAt(u);return n}function lh(t){t=t.toString();let e=5381,r=t.length;for(;r;)e=e*33^t.charCodeAt(--r);return e>>>0}function tp(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var rp=(t=>(t["GAODE1.x"]="GAODE1.x",t["GAODE2.x"]="GAODE2.x",t.MAPBOX="MAPBOX",t.DEFAULT="DEFAUlTMAP",t.SIMPLE="SIMPLE",t.GLOBEL="GLOBEL",t))(rp||{});function su(t,e,r,n,a,u=30,y){let A=r;return y&&(A=Math.round(r*(u-1))/(u-1)),n?hs(t,e,A,n,a):hs(t,e,A,.314,a)}function ql(t,e){const r=1-e;return(t[0]*r+t[1]*e)*r+(t[1]*r+t[2]*e)*e}function fa(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Rs(t,e,r){const n=[e[0]-t[0],e[1]-t[1]],a=fa(n,[0,0]),u=Math.atan2(n[1],n[0]),y=a/2/Math.cos(r),A=u+r;return[y*Math.cos(A)+t[0],y*Math.sin(A)+t[1]]}function hs(t,e,r,n,a){if(a===rp["GAODE2.x"]){const u=fi(t[0],t[1]),y=fi(e[0],e[1]),A=Rs(u,y,n),O=[u[0],A[0],y[0]],Z=[u[1],A[1],y[1]];return[...tu(ql(O,r),ql(Z,r)),0]}else{const u=Rs(t,e,n),y=[t[0],u[0],e[0]],A=[t[1],u[1],e[1]];return[ql(y,r),ql(A,r),0]}}function lu(t,e,r,n,a,u=30,y){let A=r;return y&&(A=Math.round(r*29)/29),Nu(t,e,A,a)}function wu(t,e){const r=[e[0]-t[0],e[1]-t[1]],n=Mc(r,[0,0]),a=Math.atan2(r[1],r[0]),u=.314,y=n/2/Math.cos(u),A=a+u;return[y*Math.cos(A)+t[0],y*Math.sin(A)+t[1]]}function uh(t,e){const r=1-e;return(t[0]*r+t[1]*e)*r+(t[1]*r+t[2]*e)*e}function ch(t,e){const r=[t[0]-e[0],t[1]-e[1]],n=[Math.sin(r[0]/2),Math.sin(r[1]/2)],a=n[1]*n[1]+Math.cos(t[1])*Math.cos(e[1])*n[0]*n[0];return 2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function Nu(t,e,r,n){const a=[ds(t[0]),ds(t[1])],u=[ds(e[0]),ds(e[1])];if(n==="GAODE2.x"){const y=wu(a,u),A=[a[0],y[0],u[0]],O=[a[1],y[1],u[1]];return[uh(A,r),uh(O,r),0]}else{const y=ch(a,u);if(Math.abs(y-Math.PI)<.001)return[(1-r)*a[0]+r*u[0],(1-r)*a[1]+r*u[1]];const A=Math.sin((1-r)*y)/Math.sin(y),O=Math.sin(r*y)/Math.sin(y),Z=[Math.sin(a[0]),Math.sin(a[1])],Y=[Math.cos(a[0]),Math.cos(a[1])],Q=[Math.sin(u[0]),Math.sin(u[1])],ae=[Math.cos(u[0]),Math.cos(u[1])],xe=A*Y[1]*Y[0]+O*ae[1]*ae[0],Be=A*Y[1]*Z[0]+O*ae[1]*Q[0],it=A*Z[1]+O*Q[1];return[Pi(Math.atan2(Be,xe)),Pi(Math.atan2(it,Math.sqrt(xe*xe+Be*Be)))]}}function Qp(t,e){let r=0;const n=[];for(let A=0;A<t.length-1;A++){const O=t[A],Z=t[A+1],Y=Si(O,Z),Q=r;r+=Y,n.push({p1:O,p2:Z,totalDistance:r,distance:Y,lastTotalDistance:Q})}const a=r*e;let u,y;for(const A of n)if(A.totalDistance>a){const Z=A.p1,Y=A.p2,Q=(a-A.lastTotalDistance)/A.distance,ae=Gi(Y,Z,Q);u=ae[0],y=ae[1];break}return{lng:u,lat:y,height:0}}function Gi(t,e,r){return[t[0]*r+e[0]*(1-r),t[1]*r+e[1]*(1-r)]}function Si(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}var ji=Object.defineProperty,ao=Object.getOwnPropertySymbols,Ic=Object.prototype.hasOwnProperty,Gs=Object.prototype.propertyIsEnumerable,Lc=(t,e,r)=>e in t?ji(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ul=(t,e)=>{for(var r in e||(e={}))Ic.call(e,r)&&Lc(t,r,e[r]);if(ao)for(var r of ao(e))Gs.call(e,r)&&Lc(t,r,e[r]);return t};function Nh(t,e){const{featureId:r}=e;let n=t.data.dataArray;return typeof r=="number"&&(n=n.filter(({id:a})=>a===r)),n.map(a=>{const u=Al(a,e);return ul(ul({},a),u)})}function xa(t,e){return new Promise(r=>{t.inited?r(Nh(t,e)):t.once("update",()=>{r(Nh(t,e))})})}function Al(t,e){const{offset:r,shape:n,thetaOffset:a,mapVersion:u,segmentNumber:y=30,autoFit:A=!0}=e,{coordinates:O}=t;if(n==="line")return Qp(O,r);const Z=O[0],Y=O[1],Q=typeof a=="string"?t[a]||0:a;let ae;switch(n){case"arc":ae=su;break;case"greatcircle":ae=lu;break;default:ae=su}const[xe,Be,it]=ae(Z,Y,r,Q,u,y,A);return{lng:xe,lat:Be,height:it}}var Lu=class{constructor(t=50,e){this.limit=t,this.destroy=e||this.defaultDestroy,this.order=[],this.clear()}clear(){this.order.forEach(t=>{this.delete(t)}),this.cache={},this.order=[]}get(t){const e=this.cache[t];return e&&(this.deleteOrder(t),this.appendOrder(t)),e}set(t,e){this.cache[t]?(this.delete(t),this.cache[t]=e,this.appendOrder(t)):(Object.keys(this.cache).length===this.limit&&this.delete(this.order[0]),this.cache[t]=e,this.appendOrder(t))}delete(t){const e=this.cache[t];e&&(this.deleteCache(t),this.deleteOrder(t),this.destroy(e,t))}deleteCache(t){delete this.cache[t]}deleteOrder(t){const e=this.order.findIndex(r=>r===t);e>=0&&this.order.splice(e,1)}appendOrder(t){this.order.push(t)}defaultDestroy(t,e){return null}};function ks(t){if(t.length===0)throw new Error("max requires at least one data point");let e=t[0];for(let r=1;r<t.length;r++)t[r]>e&&(e=t[r]);return e*1}function _l(t){if(t.length===0)throw new Error("min requires at least one data point");let e=t[0];for(let r=1;r<t.length;r++)t[r]<e&&(e=t[r]);return e*1}function pc(t){if(t.length===0)return 0;let e=t[0]*1;for(let r=1;r<t.length;r++)e+=t[r]*1;return e}function Du(t){if(t.length===0)throw new Error("mean requires at least one data point");return pc(t)/t.length}function zh(t){if(t.length===0)throw new Error("mean requires at least one data point");if(t.length<3)return t[0];t.sort();let e=t[0],r=NaN,n=0,a=1;for(let u=1;u<t.length+1;u++)t[u]!==e?(a>n&&(n=a,r=e),a=1,e=t[u]):a++;return r*1}var Su={min:_l,max:ks,mean:Du,sum:pc,mode:zh};function qc(t,e){return t.map(r=>r[e])}function Sh(t,e){return Su[t](e)}function nc(t,e){e===void 0&&(e={});var r=Number(t[0]),n=Number(t[1]),a=Number(t[2]),u=Number(t[3]);if(t.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var y=[r,n],A=[r,u],O=[a,u],Z=[a,n];return Cr([[y,Z,O,A,y]],e.properties,{bbox:t,id:e.id})}var Yl=Se(11312),Th=Se.n(Yl),ba=(t=>(t.Realtime="realtime",t.Overlap="overlap",t.Replace="replace",t))(ba||{}),z=(t=>(t.Loading="Loading",t.Loaded="Loaded",t.Failure="Failure",t.Cancelled="Cancelled",t))(z||{}),s=0,x=1,I=2;function k(t){t.forEach(e=>{e.isCurrent&&(e.isVisible=e.isLoaded)})}function H(t){t.forEach(e=>{e.properties.state=s}),t.forEach(e=>{e.isCurrent&&!ne(e)&&ue(e)}),t.forEach(e=>{e.isVisible=!!(e.properties.state&I)})}function ee(t){t.forEach(r=>{r.properties.state=s}),t.forEach(r=>{r.isCurrent&&ne(r)}),t.slice().sort((r,n)=>r.z-n.z).forEach(r=>{r.isVisible=!!(r.properties.state&I),r.children.length&&(r.isVisible||r.properties.state&x)?r.children.forEach(n=>{n.properties.state=x}):r.isCurrent&&ue(r)})}function ne(t){for(;t;){if(t.isLoaded)return t.properties.state|=I,!0;t=t.parent}return!1}function ue(t){t.children.forEach(e=>{e.isLoaded?e.properties.state|=I:ue(e)})}var _e=256,h=[-1/0,-1/0,1/0,1/0],g=.2,d=5,b={[ba.Realtime]:k,[ba.Overlap]:H,[ba.Replace]:ee},B=()=>{};function G(t,e,r){const n=Math.floor((t+180)/360*Math.pow(2,r)),a=Math.floor((1-Math.log(Math.tan(e*Math.PI/180)+1/Math.cos(e*Math.PI/180))/Math.PI)/2*Math.pow(2,r));return[n,a]}function q(t,e,r){const n=t/Math.pow(2,r)*360-180,a=Math.PI-2*Math.PI*e/Math.pow(2,r),u=180/Math.PI*Math.atan(.5*(Math.exp(a)-Math.exp(-a)));return[n,u]}var te=(t,e,r)=>{const[n,a]=q(t,e,r),[u,y]=q(t+1,e+1,r);return[n,y,u,a]};function fe({zoom:t,latLonBounds:e,maxZoom:r=1/0,minZoom:n=0,zoomOffset:a=0,extent:u=h}){let y=Math.ceil(t)+a;if(Number.isFinite(n)&&y<n)return[];Number.isFinite(r)&&y>r&&(y=r);const[A,O,Z,Y]=e,Q=[Math.max(A,u[0]),Math.max(O,u[1]),Math.min(Z,u[2]),Math.min(Y,u[3])],ae=[],[xe,Be]=G(Q[0],Q[1],y),[it,gt]=G(Q[2],Q[3],y);for(let vr=xe;vr<=it;vr++)for(let ln=gt;ln<=Be;ln++)ae.push({x:vr,y:ln,z:y});const Bt=(it+xe)/2,Rt=(Be+gt)/2,Yt=(vr,ln)=>Math.abs(vr-Bt)+Math.abs(ln-Rt);return ae.sort((vr,ln)=>Yt(vr.x,vr.y)-Yt(ln.x,ln.y)),ae}var ce=(t,e,r,n=!0)=>{const a=Math.pow(2,r),u=a-1,y=a;let A=t;const O=e;return n&&(A<0?A=A+y:A>u&&(A=A%y)),{warpX:A,warpY:O}},Te=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),Ie=class extends Yl.EventEmitter{constructor(t){super(),this.tileSize=256,this.isVisible=!1,this.isCurrent=!1,this.isVisibleChange=!1,this.loadedLayers=0,this.isLayerLoaded=!1,this.isLoad=!1,this.isChildLoad=!1,this.parent=null,this.children=[],this.data=null,this.properties={},this.loadDataId=0;const{x:e,y:r,z:n,tileSize:a,warp:u=!0}=t;this.x=e,this.y=r,this.z=n,this.warp=u||!0,this.tileSize=a}get isLoading(){return this.loadStatus===z.Loading}get isLoaded(){return this.loadStatus===z.Loaded}get isFailure(){return this.loadStatus===z.Failure}setTileLayerLoaded(){this.isLayerLoaded=!0}get isCancelled(){return this.loadStatus===z.Cancelled}get isDone(){return[z.Loaded,z.Cancelled,z.Failure].includes(this.loadStatus)}get bounds(){return te(this.x,this.y,this.z)}get bboxPolygon(){const[t,e,r,n]=this.bounds,a=[(r-t)/2,(n-e)/2];return nc(this.bounds,{properties:{key:this.key,id:this.key,bbox:this.bounds,center:a,meta:`
${this.key}
`}})}get key(){return`${this.x}_${this.y}_${this.z}`}layerLoad(){this.loadedLayers++,this.emit("layerLoaded")}loadData(t){return Te(this,arguments,function*({getData:e,onLoad:r,onError:n}){this.loadDataId++;const a=this.loadDataId;this.isLoading&&this.abortLoad(),this.abortController=new AbortController,this.loadStatus=z.Loading;let u=null,y;try{const{x:A,y:O,z:Z,bounds:Y,tileSize:Q,warp:ae}=this,{warpX:xe,warpY:Be}=ce(A,O,Z,ae),{signal:it}=this.abortController;u=yield e({x:xe,y:Be,z:Z,bounds:Y,tileSize:Q,signal:it,warp:ae},this)}catch(A){y=A}if(a===this.loadDataId&&!(this.isCancelled&&!u)){if(y||!u){this.loadStatus=z.Failure,n(y,this);return}this.loadStatus=z.Loaded,this.data=u,r(this)}})}reloadData(t){this.isLoading&&this.abortLoad(),this.loadData(t)}abortLoad(){this.isLoaded||this.isCancelled||(this.loadStatus=z.Cancelled,this.abortController.abort(),this.xhrCancel&&this.xhrCancel())}},Oe=(t,e)=>{const r=ep(t),n=ai(r,e),a=360*3-180,u=85.0511287798065;return[Math.max(n[0][0],-a),Math.max(n[0][1],-u),Math.min(n[1][0],a),Math.min(n[1][1],u)]},Qe=(t,e)=>{const r=ep(t),n=ep(e);return is(r,n)},nt=Object.defineProperty,ct=Object.defineProperties,tt=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertySymbols,Ut=Object.prototype.hasOwnProperty,Nt=Object.prototype.propertyIsEnumerable,pr=(t,e,r)=>e in t?nt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,tr=(t,e)=>{for(var r in e||(e={}))Ut.call(e,r)&&pr(t,r,e[r]);if(Tt)for(var r of Tt(e))Nt.call(e,r)&&pr(t,r,e[r]);return t},Dr=(t,e)=>ct(t,tt(e)),{throttle:Hr}=es,sn=(t=>(t.TilesLoadStart="tiles-load-start",t.TileLoaded="tile-loaded",t.TileError="tile-error",t.TileUnload="tile-unload",t.TileUpdate="tile-update",t.TilesLoadFinished="tiles-load-finished",t))(sn||{}),nn=class extends Th(){constructor(t){super(),this.currentTiles=[],this.cacheTiles=new Map,this.throttleUpdate=Hr((e,r)=>{this.update(e,r)},16),this.onTileLoad=e=>{this.emit("tile-loaded",e),this.updateTileVisible(),this.loadFinished()},this.onTileError=(e,r)=>{this.emit("tile-error",{error:e,tile:r}),this.updateTileVisible(),this.loadFinished()},this.onTileUnload=e=>{this.emit("tile-unload",e),this.loadFinished()},this.options={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,extent:h,getTileData:B,warp:!0,updateStrategy:ba.Replace},this.updateOptions(t)}get isLoaded(){return this.currentTiles.every(t=>t.isDone)}get tiles(){return Array.from(this.cacheTiles.values()).sort((e,r)=>e.z-r.z)}updateOptions(t){const e=t.minZoom===void 0?this.options.minZoom:Math.ceil(t.minZoom),r=t.maxZoom===void 0?this.options.maxZoom:Math.floor(t.maxZoom);this.options=Dr(tr(tr({},this.options),t),{minZoom:e,maxZoom:r})}update(t,e){const r=Math.max(0,Math.ceil(t));if(this.lastViewStates&&this.lastViewStates.zoom===r&&Qe(this.lastViewStates.latLonBoundsBuffer,e))return;const n=Oe(e,g);this.lastViewStates={zoom:r,latLonBounds:e,latLonBoundsBuffer:n},this.currentZoom=r;let a=!1;const u=this.getTileIndices(r,n).filter(y=>this.options.warp||y.x>=0&&y.x<Math.pow(2,r));this.emit("tiles-load-start"),this.currentTiles=u.map(({x:y,y:A,z:O})=>{let Z=this.getTile(y,A,O);return Z?(((Z==null?void 0:Z.isFailure)||(Z==null?void 0:Z.isCancelled))&&Z.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError}),Z):(Z=this.createTile(y,A,O),a=!0,Z)}),a&&this.resizeCacheTiles(),this.updateTileVisible(),this.pruneRequests()}reloadAll(){for(const[t,e]of this.cacheTiles){if(!this.currentTiles.includes(e)){this.cacheTiles.delete(t),this.onTileUnload(e);return}this.onTileUnload(e),e.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError})}}reloadTileById(t,e,r){const n=this.cacheTiles.get(`${e},${r},${t}`);n&&(this.onTileUnload(n),n.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError}))}reloadTileByLnglat(t,e,r){const n=this.getTileByLngLat(t,e,r);n&&this.reloadTileById(n.z,n.x,n.y)}reloadTileByExtent(t,e){this.getTileIndices(e,t).forEach(n=>{this.reloadTileById(n.z,n.x,n.y)})}pruneRequests(){const t=[];for(const e of this.cacheTiles.values())e.isLoading&&!e.isCurrent&&!e.isVisible&&t.push(e);for(;t.length>0;)t.shift().abortLoad()}getTileByLngLat(t,e,r){const{zoomOffset:n}=this.options,a=Math.ceil(r)+n,u=G(t,e,a);return this.tiles.filter(A=>A.key===`${u[0]}_${u[1]}_${a}`)[0]}getTileExtent(t,e){return this.getTileIndices(e,t)}getTileByZXY(t,e,r){return this.tiles.filter(a=>a.key===`${e}_${r}_${t}`)[0]}clear(){for(const t of this.cacheTiles.values())t.isLoading?t.abortLoad():this.onTileUnload(t);this.lastViewStates=void 0,this.cacheTiles.clear(),this.currentTiles=[]}destroy(){this.clear(),this.removeAllListeners()}updateTileVisible(){const t=this.options.updateStrategy,e=new Map;for(const a of this.cacheTiles.values())e.set(a.key,a.isVisible),a.isCurrent=!1,a.isVisible=!1;for(const a of this.currentTiles)a.isCurrent=!0,a.isVisible=!0;const r=Array.from(this.cacheTiles.values());typeof t=="function"?t(r):b[t](r);let n=!1;Array.from(this.cacheTiles.values()).forEach(a=>{a.isVisible!==e.get(a.key)?(a.isVisibleChange=!0,n=!0):a.isVisibleChange=!1}),n&&this.emit("tile-update")}getTileIndices(t,e){const{tileSize:r,extent:n,zoomOffset:a}=this.options,u=Math.floor(this.options.maxZoom),y=Math.ceil(this.options.minZoom);return fe({maxZoom:u,minZoom:y,zoomOffset:a,tileSize:r,zoom:t,latLonBounds:e,extent:n})}getTileId(t,e,r){return`${t},${e},${r}`}loadFinished(){const t=!this.currentTiles.some(e=>!e.isDone);return t&&this.emit("tiles-load-finished"),t}getTile(t,e,r){const n=this.getTileId(t,e,r);return this.cacheTiles.get(n)}createTile(t,e,r){const n=this.getTileId(t,e,r),a=new Ie({x:t,y:e,z:r,tileSize:this.options.tileSize,warp:this.options.warp});return this.cacheTiles.set(n,a),a.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError}),a}resizeCacheTiles(){const t=d*this.currentTiles.length;if(this.cacheTiles.size>t){for(const[r,n]of this.cacheTiles)if(!n.isVisible&&!this.currentTiles.includes(n)&&(this.cacheTiles.delete(r),this.onTileUnload(n)),this.cacheTiles.size<=t)break}this.rebuildTileTree()}rebuildTileTree(){for(const t of this.cacheTiles.values())t.parent=null,t.children.length=0;for(const t of this.cacheTiles.values()){const e=this.getNearestAncestor(t.x,t.y,t.z);t.parent=e,e!=null&&e.children&&e.children.push(t)}}getNearestAncestor(t,e,r){for(;r>this.options.minZoom;){t=Math.floor(t/2),e=Math.floor(e/2),r=r-1;const n=this.getTile(t,e,r);if(n)return n}return null}};function Gn(t){return/(?=.*{box})(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(t)}function di(t){const e=[];let r=/\{([a-z])-([a-z])\}/.exec(t);if(r){const n=r[1].charCodeAt(0),a=r[2].charCodeAt(0);let u;for(u=n;u<=a;++u)e.push(t.replace(r[0],String.fromCharCode(u)));return e}if(r=/\{(\d+)-(\d+)\}/.exec(t),r){const n=parseInt(r[2],10);for(let a=parseInt(r[1],10);a<=n;a++)e.push(t.replace(r[0],a.toString()));return e}return e.push(t),e}function Di(t,e){if(!t||!t.length)throw new Error("url is not allowed to be empty");const{x:r,y:n,z:a}=e,u=di(t),y=Math.abs(r+n)%u.length;return(xn(u[y])?`${u[y]}/{z}/{x}/{y}`:u[y]).replace(/\{x\}/g,r.toString()).replace(/\{y\}/g,n.toString()).replace(/\{z\}/g,a.toString()).replace(/\{bbox\}/g,te(r,n,a).join(",")).replace(/\{-y\}/g,(Math.pow(2,a)-n-1).toString())}function Ui(t,e){const{x:r,y:n,z:a,layer:u,version:y="1.0.0",style:A="default",format:O,service:Z="WMTS",tileMatrixset:Y}=e,Q=di(t),ae=Math.abs(r+n)%Q.length;return`${Q[ae]}&SERVICE=${Z}&REQUEST=GetTile&VERSION=${y}&LAYER=${u}&STYLE=${A}&TILEMATRIXSET=${Y}&FORMAT=${O}&TILECOL=${r}&TILEROW=${n}&TILEMATRIX=${a}`}function ho(t,e){return t==null?e:t}var gi=Se(47903),Wi=Se.n(gi);function Ko(t,e){return t.map(r=>r[e]*1)}function Mo(t){return t===void 0?!1:!Array.isArray(t)&&t.data!==void 0}function mo(t){return Array.isArray(t)?t.length===0?!1:!!Mo(t[0]):!1}function ko(t){return Array.isArray(t)?t.length===0||typeof t[0]=="number":!1}function xo(t){const e=Object.isFrozen(t)?es.cloneDeep(t):t;return Wi()(e,!0),e}function qi(t,e){return t||[[e[0],e[3]],[e[2],e[3]],[e[2],e[1]],[e[0],e[1]]]}var xs=Object.defineProperty,gs=Object.defineProperties,Cl=Object.getOwnPropertyDescriptors,ts=Object.getOwnPropertySymbols,ja=Object.prototype.hasOwnProperty,$a=Object.prototype.propertyIsEnumerable,vs=(t,e,r)=>e in t?xs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zl=(t,e)=>{for(var r in e||(e={}))ja.call(e,r)&&vs(t,r,e[r]);if(ts)for(var r of ts(e))$a.call(e,r)&&vs(t,r,e[r]);return t},zu=(t,e)=>gs(t,Cl(e));function Uu(t,e){const{x:r,y:n,x1:a,y1:u,coordinates:y,geometry:A}=e,O=[];if(!Array.isArray(t))return{dataArray:[]};if(A)return t.filter(Z=>Z[A]&&Z[A].type&&Z[A].coordinates&&Z[A].coordinates.length>0).forEach((Z,Y)=>{const Q=xo(Z[A]);Us(Q,ae=>{const xe=or(ae),Be=zu(Zl({},Z),{_id:Y,coordinates:xe});O.push(Be)})}),{dataArray:O};for(let Z=0;Z<t.length;Z++){const Y=t[Z];let Q=[];if(y){let xe="Polygon";Array.isArray(y[0])||(xe="Point"),Array.isArray(y[0])&&!Array.isArray(y[0][0])&&(xe="LineString"),Q=xo({type:xe,coordinates:Y[y]}).coordinates}else if(r&&n&&a&&u){const xe=[parseFloat(Y[r]),parseFloat(Y[n])],Be=[parseFloat(Y[a]),parseFloat(Y[u])];Q=[xe,Be]}else r&&n&&(Q=[parseFloat(Y[r]),parseFloat(Y[n])]);const ae=zu(Zl({},Y),{_id:Z,coordinates:Q});O.push(ae)}return{dataArray:O}}function hh(t,e){const r=pa(t);return Uu(r,e)}var Yc=Object.defineProperty,np=Object.defineProperties,pu=Object.getOwnPropertyDescriptors,Tu=Object.getOwnPropertySymbols,Zu=Object.prototype.hasOwnProperty,Dl=Object.prototype.propertyIsEnumerable,Vl=(t,e,r)=>e in t?Yc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Uh=(t,e)=>{for(var r in e||(e={}))Zu.call(e,r)&&Vl(t,r,e[r]);if(Tu)for(var r of Tu(e))Dl.call(e,r)&&Vl(t,r,e[r]);return t},ml=(t,e)=>np(t,pu(e));function $l(t){const e=t.toString();let r=5381,n=e.length;for(;n;)r=r*33^e.charCodeAt(--n);return r>>>0}function Vu(t,e){return e===void 0?null:typeof(t.properties[e]*1)=="number"?t.properties[e]*1:t.properties&&t.properties[e]?$l(t.properties[e]+"")%1000019:null}function Ws(t,e){const r=[],n={};return t.features?(t.features=t.features.filter(a=>{const u=a.geometry;return a!=null&&u&&u.type&&u.coordinates&&u.coordinates.length>0}),t=xo(t),t.features.length===0?{dataArray:[],featureKeys:n}:(Us(t,(a,u)=>{let y=Vu(a,e==null?void 0:e.featureId);y===null&&(y=u);const A=y,O=or(a),Z=ml(Uh({},a.properties),{coordinates:O,_id:A});r.push(Z)}),{dataArray:r,featureKeys:n})):(t.features=[],{dataArray:[]})}function ju(t,e,r,n){for(var a=n,u=r-e>>1,y=r-e,A,O=t[e],Z=t[e+1],Y=t[r],Q=t[r+1],ae=e+3;ae<r;ae+=3){var xe=os(t[ae],t[ae+1],O,Z,Y,Q);if(xe>a)A=ae,a=xe;else if(xe===a){var Be=Math.abs(ae-u);Be<y&&(A=ae,y=Be)}}a>n&&(A-e>3&&ju(t,e,A,n),t[A+2]=a,r-A>3&&ju(t,A,r,n))}function os(t,e,r,n,a,u){var y=a-r,A=u-n;if(y!==0||A!==0){var O=((t-r)*y+(e-n)*A)/(y*y+A*A);O>1?(r=a,n=u):O>0&&(r+=y*O,n+=A*O)}return y=t-r,A=e-n,y*y+A*A}function yl(t,e,r,n){var a={id:typeof t=="undefined"?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Ol(a),a}function Ol(t){var e=t.geometry,r=t.type;if(r==="Point"||r==="MultiPoint"||r==="LineString")ph(t,e);else if(r==="Polygon"||r==="MultiLineString")for(var n=0;n<e.length;n++)ph(t,e[n]);else if(r==="MultiPolygon")for(n=0;n<e.length;n++)for(var a=0;a<e[n].length;a++)ph(t,e[n][a])}function ph(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function _f(t,e){var r=[];if(t.type==="FeatureCollection")for(var n=0;n<t.features.length;n++)ip(r,t.features[n],e,n);else t.type==="Feature"?ip(r,t,e):ip(r,{geometry:t},e);return r}function ip(t,e,r,n){if(e.geometry){var a=e.geometry.coordinates,u=e.geometry.type,y=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),A=[],O=e.id;if(r.promoteId?O=e.properties[r.promoteId]:r.generateId&&(O=n||0),u==="Point")yf(a,A);else if(u==="MultiPoint")for(var Z=0;Z<a.length;Z++)yf(a[Z],A);else if(u==="LineString")Hu(a,A,y,!1);else if(u==="MultiLineString")if(r.lineMetrics){for(Z=0;Z<a.length;Z++)A=[],Hu(a[Z],A,y,!1),t.push(yl(O,"LineString",A,e.properties));return}else Bp(a,A,y,!1);else if(u==="Polygon")Bp(a,A,y,!0);else if(u==="MultiPolygon")for(Z=0;Z<a.length;Z++){var Y=[];Bp(a[Z],Y,y,!0),A.push(Y)}else if(u==="GeometryCollection"){for(Z=0;Z<e.geometry.geometries.length;Z++)ip(t,{id:O,geometry:e.geometry.geometries[Z],properties:e.properties},r,n);return}else throw new Error("Input data is not a valid GeoJSON object.");t.push(yl(O,u,A,e.properties))}}function yf(t,e){e.push(fc(t[0])),e.push(Wf(t[1])),e.push(0)}function Hu(t,e,r,n){for(var a,u,y=0,A=0;A<t.length;A++){var O=fc(t[A][0]),Z=Wf(t[A][1]);e.push(O),e.push(Z),e.push(0),A>0&&(n?y+=(a*Z-O*u)/2:y+=Math.sqrt(Math.pow(O-a,2)+Math.pow(Z-u,2))),a=O,u=Z}var Y=e.length-3;e[2]=1,ju(e,0,Y,r),e[Y+2]=1,e.size=Math.abs(y),e.start=0,e.end=e.size}function Bp(t,e,r,n){for(var a=0;a<t.length;a++){var u=[];Hu(t[a],u,r,n),e.push(u)}}function fc(t){return t/360+.5}function Wf(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function op(t,e,r,n,a,u,y,A){if(r/=e,n/=e,u>=r&&y<n)return t;if(y<r||u>=n)return null;for(var O=[],Z=0;Z<t.length;Z++){var Y=t[Z],Q=Y.geometry,ae=Y.type,xe=a===0?Y.minX:Y.minY,Be=a===0?Y.maxX:Y.maxY;if(xe>=r&&Be<n){O.push(Y);continue}else if(Be<r||xe>=n)continue;var it=[];if(ae==="Point"||ae==="MultiPoint")ef(Q,it,r,n,a);else if(ae==="LineString")_s(Q,it,r,n,a,!1,A.lineMetrics);else if(ae==="MultiLineString")sd(Q,it,r,n,a,!1);else if(ae==="Polygon")sd(Q,it,r,n,a,!0);else if(ae==="MultiPolygon")for(var gt=0;gt<Q.length;gt++){var Bt=[];sd(Q[gt],Bt,r,n,a,!0),Bt.length&&it.push(Bt)}if(it.length){if(A.lineMetrics&&ae==="LineString"){for(gt=0;gt<it.length;gt++)O.push(yl(Y.id,ae,it[gt],Y.tags));continue}(ae==="LineString"||ae==="MultiLineString")&&(it.length===1?(ae="LineString",it=it[0]):ae="MultiLineString"),(ae==="Point"||ae==="MultiPoint")&&(ae=it.length===3?"Point":"MultiPoint"),O.push(yl(Y.id,ae,it,Y.tags))}}return O.length?O:null}function ef(t,e,r,n,a){for(var u=0;u<t.length;u+=3){var y=t[u+a];y>=r&&y<=n&&(e.push(t[u]),e.push(t[u+1]),e.push(t[u+2]))}}function _s(t,e,r,n,a,u,y){for(var A=Ff(t),O=a===0?_d:ld,Z=t.start,Y,Q,ae=0;ae<t.length-3;ae+=3){var xe=t[ae],Be=t[ae+1],it=t[ae+2],gt=t[ae+3],Bt=t[ae+4],Rt=a===0?xe:Be,Yt=a===0?gt:Bt,vr=!1;y&&(Y=Math.sqrt(Math.pow(xe-gt,2)+Math.pow(Be-Bt,2))),Rt<r?Yt>r&&(Q=O(A,xe,Be,gt,Bt,r),y&&(A.start=Z+Y*Q)):Rt>n?Yt<n&&(Q=O(A,xe,Be,gt,Bt,n),y&&(A.start=Z+Y*Q)):fh(A,xe,Be,it),Yt<r&&Rt>=r&&(Q=O(A,xe,Be,gt,Bt,r),vr=!0),Yt>n&&Rt<=n&&(Q=O(A,xe,Be,gt,Bt,n),vr=!0),!u&&vr&&(y&&(A.end=Z+Y*Q),e.push(A),A=Ff(t)),y&&(Z+=Y)}var ln=t.length-3;xe=t[ln],Be=t[ln+1],it=t[ln+2],Rt=a===0?xe:Be,Rt>=r&&Rt<=n&&fh(A,xe,Be,it),ln=A.length-3,u&&ln>=3&&(A[ln]!==A[0]||A[ln+1]!==A[1])&&fh(A,A[0],A[1],A[2]),A.length&&e.push(A)}function Ff(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function sd(t,e,r,n,a,u){for(var y=0;y<t.length;y++)_s(t[y],e,r,n,a,u,!1)}function fh(t,e,r,n){t.push(e),t.push(r),t.push(n)}function _d(t,e,r,n,a,u){var y=(u-e)/(n-e);return t.push(u),t.push(r+(a-r)*y),t.push(1),y}function ld(t,e,r,n,a,u){var y=(u-r)/(a-r);return t.push(e+(n-e)*y),t.push(u),t.push(1),y}function ym(t,e){var r=e.buffer/e.extent,n=t,a=op(t,1,-1-r,r,0,-1,2,e),u=op(t,1,1-r,2+r,0,-1,2,e);return(a||u)&&(n=op(t,1,-r,1+r,0,-1,2,e)||[],a&&(n=Xf(a,1).concat(n)),u&&(n=n.concat(Xf(u,-1)))),n}function Xf(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n],u=a.type,y;if(u==="Point"||u==="MultiPoint"||u==="LineString")y=tm(a.geometry,e);else if(u==="MultiLineString"||u==="Polygon"){y=[];for(var A=0;A<a.geometry.length;A++)y.push(tm(a.geometry[A],e))}else if(u==="MultiPolygon")for(y=[],A=0;A<a.geometry.length;A++){for(var O=[],Z=0;Z<a.geometry[A].length;Z++)O.push(tm(a.geometry[A][Z],e));y.push(O)}r.push(yl(a.id,u,y,a.tags))}return r}function tm(t,e){var r=[];r.size=t.size,t.start!==void 0&&(r.start=t.start,r.end=t.end);for(var n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}function Gu(t,e){if(t.transformed)return t;var r=1<<t.z,n=t.x,a=t.y,u,y,A;for(u=0;u<t.features.length;u++){var O=t.features[u],Z=O.geometry,Y=O.type;if(O.geometry=[],Y===1)for(y=0;y<Z.length;y+=2)O.geometry.push(xf(Z[y],Z[y+1],e,r,n,a));else for(y=0;y<Z.length;y++){var Q=[];for(A=0;A<Z[y].length;A+=2)Q.push(xf(Z[y][A],Z[y][A+1],e,r,n,a));O.geometry.push(Q)}}return t.transformed=!0,t}function xf(t,e,r,n,a,u){return[Math.round(r*(t*n-a)),Math.round(r*(e*n-u))]}function tf(t,e,r,n,a){for(var u=e===a.maxZoom?0:a.tolerance/((1<<e)*a.extent),y={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},A=0;A<t.length;A++){y.numFeatures++,ud(y,t[A],u,a);var O=t[A].minX,Z=t[A].minY,Y=t[A].maxX,Q=t[A].maxY;O<y.minX&&(y.minX=O),Z<y.minY&&(y.minY=Z),Y>y.maxX&&(y.maxX=Y),Q>y.maxY&&(y.maxY=Q)}return y}function ud(t,e,r,n){var a=e.geometry,u=e.type,y=[];if(u==="Point"||u==="MultiPoint")for(var A=0;A<a.length;A+=3)y.push(a[A]),y.push(a[A+1]),t.numPoints++,t.numSimplified++;else if(u==="LineString")qf(y,a,t,r,!1,!1);else if(u==="MultiLineString"||u==="Polygon")for(A=0;A<a.length;A++)qf(y,a[A],t,r,u==="Polygon",A===0);else if(u==="MultiPolygon")for(var O=0;O<a.length;O++){var Z=a[O];for(A=0;A<Z.length;A++)qf(y,Z[A],t,r,!0,A===0)}if(y.length){var Y=e.tags||null;if(u==="LineString"&&n.lineMetrics){Y={};for(var Q in e.tags)Y[Q]=e.tags[Q];Y.mapbox_clip_start=a.start/a.size,Y.mapbox_clip_end=a.end/a.size}var ae={geometry:y,type:u==="Polygon"||u==="MultiPolygon"?3:u==="LineString"||u==="MultiLineString"?2:1,tags:Y};e.id!==null&&(ae.id=e.id),t.features.push(ae)}}function qf(t,e,r,n,a,u){var y=n*n;if(n>0&&e.size<(a?y:n)){r.numPoints+=e.length/3;return}for(var A=[],O=0;O<e.length;O+=3)(n===0||e[O+2]>y)&&(r.numSimplified++,A.push(e[O]),A.push(e[O+1])),r.numPoints++;a&&Dd(A,u),t.push(A)}function Dd(t,e){for(var r=0,n=0,a=t.length,u=a-2;n<a;u=n,n+=2)r+=(t[n]-t[u])*(t[n+1]+t[u+1]);if(r>0===e)for(n=0,a=t.length;n<a/2;n+=2){var y=t[n],A=t[n+1];t[n]=t[a-2-n],t[n+1]=t[a-1-n],t[a-2-n]=y,t[a-1-n]=A}}function Yf(t,e){return new Kl(t,e)}function Kl(t,e){e=this.options=Bd(Object.create(this.options),e);var r=e.debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=_f(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=ym(n,e),n.length&&this.splitTile(n,0,0,0),r&&(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)))}Kl.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Kl.prototype.splitTile=function(t,e,r,n,a,u,y){for(var A=[t,e,r,n],O=this.options,Z=O.debug;A.length;){n=A.pop(),r=A.pop(),e=A.pop(),t=A.pop();var Y=1<<e,Q=Od(e,r,n),ae=this.tiles[Q];if(!ae&&(Z>1&&console.time("creation"),ae=this.tiles[Q]=tf(t,e,r,n,O),this.tileCoords.push({z:e,x:r,y:n}),Z)){Z>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,ae.numFeatures,ae.numPoints,ae.numSimplified),console.timeEnd("creation"));var xe="z"+e;this.stats[xe]=(this.stats[xe]||0)+1,this.total++}if(ae.source=t,a){if(e===O.maxZoom||e===a)continue;var Be=1<<a-e;if(r!==Math.floor(u/Be)||n!==Math.floor(y/Be))continue}else if(e===O.indexMaxZoom||ae.numPoints<=O.indexMaxPoints)continue;if(ae.source=null,t.length!==0){Z>1&&console.time("clipping");var it=.5*O.buffer/O.extent,gt=.5-it,Bt=.5+it,Rt=1+it,Yt,vr,ln,cn,Gr,Pn;Yt=vr=ln=cn=null,Gr=op(t,Y,r-it,r+Bt,0,ae.minX,ae.maxX,O),Pn=op(t,Y,r+gt,r+Rt,0,ae.minX,ae.maxX,O),t=null,Gr&&(Yt=op(Gr,Y,n-it,n+Bt,1,ae.minY,ae.maxY,O),vr=op(Gr,Y,n+gt,n+Rt,1,ae.minY,ae.maxY,O),Gr=null),Pn&&(ln=op(Pn,Y,n-it,n+Bt,1,ae.minY,ae.maxY,O),cn=op(Pn,Y,n+gt,n+Rt,1,ae.minY,ae.maxY,O),Pn=null),Z>1&&console.timeEnd("clipping"),A.push(Yt||[],e+1,r*2,n*2),A.push(vr||[],e+1,r*2,n*2+1),A.push(ln||[],e+1,r*2+1,n*2),A.push(cn||[],e+1,r*2+1,n*2+1)}}},Kl.prototype.getTile=function(t,e,r){var n=this.options,a=n.extent,u=n.debug;if(t<0||t>24)return null;var y=1<<t;e=(e%y+y)%y;var A=Od(t,e,r);if(this.tiles[A])return Gu(this.tiles[A],a);u>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var O=t,Z=e,Y=r,Q;!Q&&O>0;)O--,Z=Math.floor(Z/2),Y=Math.floor(Y/2),Q=this.tiles[Od(O,Z,Y)];return!Q||!Q.source?null:(u>1&&console.log("found parent tile z%d-%d-%d",O,Z,Y),u>1&&console.time("drilling down"),this.splitTile(Q.source,O,Z,Y,t,e,r),u>1&&console.timeEnd("drilling down"),this.tiles[A]?Gu(this.tiles[A],a):null)};function Od(t,e,r){return((1<<t)*r+e)*32+t}function Bd(t,e){for(var r in e)t[r]=e[r];return t}var bf=class{constructor(t,e,r,n){this.vectorLayerCache={},this.x=e,this.y=r,this.z=n,this.vectorTile=t}getTileData(t){return!t||!this.vectorTile.layers[t]?[]:this.vectorLayerCache[t]?this.vectorLayerCache[t]:this.vectorTile.layers[t].features}getFeatureById(){throw new Error("Method not implemented.")}},wp=Object.defineProperty,$f=Object.defineProperties,ap=Object.getOwnPropertyDescriptors,kf=Object.getOwnPropertySymbols,xl=Object.prototype.hasOwnProperty,dc=Object.prototype.propertyIsEnumerable,Fp=(t,e,r)=>e in t?wp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sp=(t,e)=>{for(var r in e||(e={}))xl.call(e,r)&&Fp(t,r,e[r]);if(kf)for(var r of kf(e))dc.call(e,r)&&Fp(t,r,e[r]);return t},rf=(t,e)=>$f(t,ap(e)),nf=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),Nf={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0};function zf(t){let e=0;for(let r=0,n=t.length,a=n-1,u,y;r<n;a=r++)u=t[r],y=t[a],e+=(y.x-u.x)*(u.y+y.y);return e}function of(t){const e=t.length;if(e<=1)return[t];const r=[];let n,a;for(let u=0;u<e;u++){const y=zf(t[u]);y!==0&&(a===void 0&&(a=y<0),a===y<0?(n&&r.push(n),n=[t[u]]):n.push(t[u]))}return n&&r.push(n),r}var af=["Unknown","Point","LineString","Polygon"];function kp(t,e,r,n,a){let u=a.geometry;const y=a.type,A=a.tags,O=a.id,Z=t*Math.pow(2,n),Y=t*e,Q=t*r;let ae=af[y],xe,Be;function it(Bt){for(let Rt=0;Rt<Bt.length;Rt++){const Yt=Bt[Rt];if(Yt[3])break;const vr=180-(Yt[1]+Q)*360/Z,ln=(Yt[0]+Y)*360/Z-180,cn=360/Math.PI*Math.atan(Math.exp(vr*Math.PI/180))-90;Bt[Rt]=[ln,cn,0,1]}}switch(y){case 1:const Bt=[];for(xe=0;xe<u.length;xe++)Bt[xe]=u[xe][0];u=Bt,it(u);break;case 2:for(xe=0;xe<u.length;xe++)it(u[xe]);break;case 3:for(u=of(u),xe=0;xe<u.length;xe++)for(Be=0;Be<u[xe].length;Be++)it(u[xe][Be]);break}return u.length===1?u=u[0]:ae="Multi"+ae,{type:"Feature",geometry:{type:ae,coordinates:u},properties:A,id:O,tileOrigin:[0,0],coord:""}}var yd=(t,e,r,n)=>nf(void 0,null,function*(){return new Promise(a=>{const u=e.getTile(t.z,t.x,t.y),A={layers:{defaultLayer:{features:u?u.features.map(Z=>kp(n,r.x,r.y,r.z,Z)):[]}}},O=new bf(A,t.x,t.y,t.z);a(O)})});function Dc(t){const e={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!0,debug:0};return t===void 0||typeof t.geojsonvtOptions=="undefined"?e:Sp(Sp({},e),t.geojsonvtOptions)}function _p(t,e){const r=Dc(e),n=r.extent||4096,a=Yf(t,r),u=(A,O)=>yd(O,a,A,n),y=rf(Sp(Sp({},Nf),e),{getTileData:u});return{data:t,dataArray:[],tilesetOptions:y,isTile:!0}}var Kf=Object.defineProperty,xd=Object.defineProperties,bd=Object.getOwnPropertyDescriptors,Ed=Object.getOwnPropertySymbols,Tp=Object.prototype.hasOwnProperty,Ef=Object.prototype.propertyIsEnumerable,wd=(t,e,r)=>e in t?Kf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cd=(t,e)=>{for(var r in e||(e={}))Tp.call(e,r)&&wd(t,r,e[r]);if(Ed)for(var r of Ed(e))Ef.call(e,r)&&wd(t,r,e[r]);return t},hd=(t,e)=>xd(t,bd(e));function Uf(t,e){const{extent:r=[121.168,30.2828,121.384,30.4219],coordinates:n,requestParameters:a={}}=e,u=new Promise(O=>{t instanceof HTMLImageElement||gp(t)?O([t]):sf(t,a,Z=>{O(Z)})}),y=qi(n,r);return{originData:t,images:u,_id:1,dataArray:[{_id:0,coordinates:y}]}}function sf(t,e,r){const n=[];if(typeof t=="string")ns(hd(cd({},e),{url:t}),(a,u)=>{u&&(n.push(u),r(n))});else{const a=t.length;let u=0;t.forEach(y=>{ns(hd(cd({},e),{url:y}),(A,O)=>{u++,O&&n.push(O),u===a&&r(n)})})}return Uf}var Ou=Object.defineProperty,Zh=Object.defineProperties,lf=Object.getOwnPropertyDescriptors,Ah=Object.getOwnPropertySymbols,Np=Object.prototype.hasOwnProperty,pd=Object.prototype.propertyIsEnumerable,yp=(t,e,r)=>e in t?Ou(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zf=(t,e)=>{for(var r in e||(e={}))Np.call(e,r)&&yp(t,r,e[r]);if(Ah)for(var r of Ah(e))pd.call(e,r)&&yp(t,r,e[r]);return t},zp=(t,e)=>Zh(t,lf(e)),Oc=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),Wu=(t,e,r,n)=>Oc(void 0,null,function*(){const a={x:e.x,y:e.y,z:e.z},u=Di(t,a);return new Promise(y=>{n?n(a,(A,O)=>{if(A||!O){const Z={layers:{defaultLayer:{features:[]}}},Y=new bf(Z,e.x,e.y,e.z);y(Y)}else{const Z={layers:{defaultLayer:{features:O.features}}},Y=new bf(Z,e.x,e.y,e.z);y(Y)}}):ia(zp(Zf({},r),{url:u}),(A,O)=>{if(A||!O){const Z={layers:{defaultLayer:{features:[]}}},Y=new bf(Z,e.x,e.y,e.z);y(Y)}else{const Y={layers:{defaultLayer:{features:JSON.parse(O)}}},Q=new bf(Y,e.x,e.y,e.z);y(Q)}})})});function Au(t,e){const r=(a,u)=>Wu(t,u,e==null?void 0:e.requestParameters,e.getCustomData),n=zp(Zf({},e),{getTileData:r});return{dataArray:[],tilesetOptions:n,isTile:!0}}var dh=Se(99996),rm=Se(63713),Ap=Se.n(rm),nm=Object.defineProperty,Fd=Object.defineProperties,xm=Object.getOwnPropertyDescriptors,Jf=Object.getOwnPropertySymbols,kd=Object.prototype.hasOwnProperty,fd=Object.prototype.propertyIsEnumerable,Bc=(t,e,r)=>e in t?nm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,im=(t,e)=>{for(var r in e||(e={}))kd.call(e,r)&&Bc(t,r,e[r]);if(Jf)for(var r of Jf(e))fd.call(e,r)&&Bc(t,r,e[r]);return t},om=(t,e)=>Fd(t,xm(e)),Nd=class{constructor(t,e,r,n){this.vectorLayerCache={},this.x=e,this.y=r,this.z=n,this.vectorTile=new dh.VectorTile(new(Ap())(t))}getTileData(t){if(!t||!this.vectorTile.layers[t])return[];if(this.vectorLayerCache[t])return this.vectorLayerCache[t];const e=this.vectorTile.layers[t];if(Array.isArray(e.features))return this.vectorLayerCache[t]=e.features,e.features;const r=[];for(let n=0;n<e.length;n++){const u=e.feature(n).toGeoJSON(this.x,this.y,this.z);r.push(om(im({},u),{properties:im({id:u.id},u.properties)}))}return this.vectorLayerCache[t]=r,r}getFeatureById(){throw new Error("Method not implemented.")}},am=Object.defineProperty,uf=Object.defineProperties,Qf=Object.getOwnPropertyDescriptors,cl=Object.getOwnPropertySymbols,zd=Object.prototype.hasOwnProperty,Fc=Object.prototype.propertyIsEnumerable,Pe=(t,e,r)=>e in t?am(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_t=(t,e)=>{for(var r in e||(e={}))zd.call(e,r)&&Pe(t,r,e[r]);if(cl)for(var r of cl(e))Fc.call(e,r)&&Pe(t,r,e[r]);return t},Zt=(t,e)=>uf(t,Qf(e)),qr=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),wn={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,warp:!0},Yr=(t,e,r,n,a)=>qr(void 0,null,function*(){const u=Di(t,e);return new Promise(y=>{if(a)a({x:r.x,y:r.y,z:r.z},(A,O)=>{if(A||!O)y(void 0);else{const Z=new Nd(O,r.x,r.y,r.z);y(Z)}});else{const A=On(Zt(_t({},n),{url:u}),(O,Z)=>{if(O||!Z)y(void 0);else{const Y=new Nd(Z,r.x,r.y,r.z);y(Y)}});r.xhrCancel=()=>A.cancel()}})});function Or(t,e){const r=Array.isArray(t)?t[0]:t,n=(u,y)=>Yr(r,u,y,e==null?void 0:e.requestParameters,e==null?void 0:e.getCustomData),a=Zt(_t(_t({},wn),e),{getTileData:n});return{data:r,dataArray:[],tilesetOptions:a,isTile:!0}}function Wn(t,e,r){switch(t){case"+":return e+r;case"-":return e-r;case"*":return e*r;case"/":return e/r;case"%":return e%r;case"^":return Math.pow(e,r);case"abs":return Math.abs(e);case"floor":return Math.floor(e);case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"sin":return Math.sin(e);case"cos":return Math.cos(e);case"atan":return r===-1?Math.atan(e):Math.atan2(e,r);case"min":return Math.min(e,r);case"max":return Math.max(e,r);case"log10":return Math.log(e);case"log2":return Math.log2(e);default:return console.warn("Calculate symbol err! Return default 0"),0}}function Bn(t,e){const{width:r,height:n}=e[0],a=e.map(O=>O.rasterData),u=r*n,y=[],A=JSON.stringify(t);for(let O=0;O<u;O++){const Z=JSON.parse(A),Y=si(Z,a,O);if(typeof Y=="number")y.push(Y);else{const Q=qn(Z);y.push(Q)}}return y}function si(t,e,r){if(t.length===2&&t[0]==="band"&&typeof t[1]=="number")try{return e[t[1]][r]}catch(n){return console.warn("Raster Data err!"),0}t.map((n,a)=>{if(Array.isArray(n)&&n.length>0)switch(n[0]){case"band":try{t[a]=e[n[1]][r]}catch(u){console.warn("Raster Data err!"),t[a]=0}break;default:si(n,e,r)}})}function Hn(t){const[e,r=-1,n=-1]=t;return e===void 0?(console.warn("Express err!"),["+",0,0]):[e.replace(/\s+/g,""),r,n]}function qn(t){const e=Hn(t),r=e[0];let n=e[1],a=e[2];return Array.isArray(n)&&(n=qn(t[1])),Array.isArray(a)&&(a=qn(t[2])),Wn(r,n,a)}var ci={nd:{type:"operation",expression:["/",["-",["band",1],["band",0]],["+",["band",1],["band",0]]]},rgb:{type:"function",method:Vn}};function Vn(t,e){const r=t[0].rasterData,n=t[1].rasterData,a=t[2].rasterData,u=[],[y,A]=(e==null?void 0:e.countCut)||[2,98],O=(e==null?void 0:e.RMinMax)||Yn(r,y,A),Z=(e==null?void 0:e.GMinMax)||Yn(n,y,A),Y=(e==null?void 0:e.BMinMax)||Yn(a,y,A);for(let Q=0;Q<r.length;Q++)u.push(Math.max(0,r[Q]-O[0])),u.push(Math.max(0,n[Q]-Z[0])),u.push(Math.max(0,a[Q]-Y[0]));return{rasterData:u,rMinMax:O,gMinMax:Z,bMinMax:Y}}function Yn(t,e,r){const n=t.slice().sort((A,O)=>A-O),a=n.length,u=n[Math.ceil(a*e/100)],y=n[Math.ceil(a*r/100)];return[u,y]}var Tr=Object.defineProperty,en=Object.defineProperties,Xn=Object.getOwnPropertyDescriptors,_i=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,xi=Object.prototype.propertyIsEnumerable,Un=(t,e,r)=>e in t?Tr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Oi=(t,e)=>{for(var r in e||(e={}))Rn.call(e,r)&&Un(t,r,e[r]);if(_i)for(var r of _i(e))xi.call(e,r)&&Un(t,r,e[r]);return t},Ln=(t,e)=>en(t,Xn(e)),wi=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())});function Po(t,e,r){return wi(this,null,function*(){if(t.length===0)return{rasterData:[0],width:1,heigh:1};const n=yield Promise.all(t.map(({data:O,bands:Z=[0]})=>e(O,Z))),a=[];n.forEach(O=>{Array.isArray(O)?a.push(...O):a.push(O)});const{width:u,height:y}=a[0];let A;switch(typeof r){case"function":A=r(a);break;case"object":Array.isArray(r)?A={rasterData:Bn(r,a)}:A=da(r,a);break;default:A={rasterData:a[0].rasterData}}return Ln(Oi({},A),{width:u,height:y})})}function da(t,e){const r=ci[t.type];if(r.type==="function")return r.method(e,t==null?void 0:t.options);if(r.type==="operation")return t.type==="rgb"?bi(r.expression,e):{rasterData:Bn(r.expression,e)}}function bi(t,e){t.r===void 0&&console.warn("Channel R lost in Operation! Use band[0] to fill!"),t.g===void 0&&console.warn("Channel G lost in Operation! Use band[0] to fill!"),t.b===void 0&&console.warn("Channel B lost in Operation! Use band[0] to fill!");const r=Bn(t.r||["band",0],e),n=Bn(t.g||["band",0],e),a=Bn(t.b||["band",0],e);return[r,n,a]}function Zn(t,e,r,n){return wi(this,null,function*(){const a=yield Po(t,e,r);n(null,{data:a})})}function Sn(t,e){const{extent:r=[121.168,30.2828,121.384,30.4219],coordinates:n,width:a,height:u,min:y,max:A,format:O,operation:Z}=e;let Y,Q,ae;if(O===void 0||ko(t))Y=Array.from(t),Q=a,ae=u;else{const it=Array.isArray(t)?t:[t];Y=Po(it,O,Z)}const xe=qi(n,r);return{_id:1,dataArray:[{_id:1,data:Y,width:Q,height:ae,min:y,max:A,coordinates:xe}]}}var Wt=Se(88351),K=Se(40749);let Ei=function(t){return t.Normal="normal",t.PostProcessing="post-processing",t}({}),Ee=function(t){return t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.CULL_FACE=2884]="CULL_FACE",t[t.BLEND=3042]="BLEND",t[t.DITHER=3024]="DITHER",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.RED=6403]="RED",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.TEXTURE1=33985]="TEXTURE1",t[t.TEXTURE2=33986]="TEXTURE2",t[t.TEXTURE3=33987]="TEXTURE3",t[t.TEXTURE4=33988]="TEXTURE4",t[t.TEXTURE5=33989]="TEXTURE5",t[t.TEXTURE6=33990]="TEXTURE6",t[t.TEXTURE7=33991]="TEXTURE7",t[t.TEXTURE8=33992]="TEXTURE8",t[t.TEXTURE9=33993]="TEXTURE9",t[t.TEXTURE10=33994]="TEXTURE10",t[t.TEXTURE11=33995]="TEXTURE11",t[t.TEXTURE12=33996]="TEXTURE12",t[t.TEXTURE13=33997]="TEXTURE13",t[t.TEXTURE14=33998]="TEXTURE14",t[t.TEXTURE15=33999]="TEXTURE15",t[t.TEXTURE16=34e3]="TEXTURE16",t[t.TEXTURE17=34001]="TEXTURE17",t[t.TEXTURE18=34002]="TEXTURE18",t[t.TEXTURE19=34003]="TEXTURE19",t[t.TEXTURE20=34004]="TEXTURE20",t[t.TEXTURE21=34005]="TEXTURE21",t[t.TEXTURE22=34006]="TEXTURE22",t[t.TEXTURE23=34007]="TEXTURE23",t[t.TEXTURE24=34008]="TEXTURE24",t[t.TEXTURE25=34009]="TEXTURE25",t[t.TEXTURE26=34010]="TEXTURE26",t[t.TEXTURE27=34011]="TEXTURE27",t[t.TEXTURE28=34012]="TEXTURE28",t[t.TEXTURE29=34013]="TEXTURE29",t[t.TEXTURE30=34014]="TEXTURE30",t[t.TEXTURE31=34015]="TEXTURE31",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t}({});const sa=`attribute vec2 a_Position;
varying vec2 v_UV;
void main() {
v_UV = 0.5 * (a_Position + 1.0);
gl_Position = vec4(a_Position, 0., 1.);
}`,{camelCase:Jo,isNil:Es,upperFirst:Cu}=es;class Bl{constructor(){(0,K.Z)(this,"shaderModuleService",void 0),(0,K.Z)(this,"rendererService",void 0),(0,K.Z)(this,"config",void 0),(0,K.Z)(this,"quad",sa),(0,K.Z)(this,"enabled",!0),(0,K.Z)(this,"renderToScreen",!1),(0,K.Z)(this,"model",void 0),(0,K.Z)(this,"name",void 0),(0,K.Z)(this,"optionsToUpdate",{})}getName(){return this.name}setName(e){this.name=e}getType(){return Ei.PostProcessing}init(e,r){this.config=r,this.rendererService=e.getContainer().rendererService,this.shaderModuleService=e.getContainer().shaderModuleService;const{createAttribute:n,createBuffer:a,createModel:u}=this.rendererService,{vs:y,fs:A,uniforms:O}=this.setupShaders();this.model=u({vs:y,fs:A,attributes:{a_Position:n({buffer:a({data:[-4,-4,4,-4,0,4],type:Ee.FLOAT}),size:2})},uniforms:(0,Wt.Z)((0,Wt.Z)({u_Texture:null},O),this.config&&this.convertOptionsToUniforms(this.config)),depth:{enable:!1},count:3,blend:{enable:this.getName()==="copy"}})}render(e,r){const n=e.multiPassRenderer.getPostProcessor(),{useFramebuffer:a,getViewportSize:u,clear:y}=this.rendererService,{width:A,height:O}=u();a(this.renderToScreen?null:n.getWriteFBO(),()=>{y({framebuffer:n.getWriteFBO(),color:[0,0,0,0],depth:1,stencil:0});const Z=(0,Wt.Z)({u_BloomFinal:0,u_Texture:n.getReadFBO(),u_ViewportSize:[A,O]},this.convertOptionsToUniforms(this.optionsToUpdate));r&&(Z.u_BloomFinal=1,Z.u_Texture2=r),this.model.draw({uniforms:Z})})}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}setRenderToScreen(e){this.renderToScreen=e}updateOptions(e){this.optionsToUpdate=(0,Wt.Z)((0,Wt.Z)({},this.optionsToUpdate),e)}setupShaders(){throw new Error("Method not implemented.")}convertOptionsToUniforms(e){const r={};return Object.keys(e).forEach(n=>{Es(e[n])||(r[`u_${Cu(Jo(n))}`]=e[n])}),r}}function as(t){let e=0;switch(t){case"vec2":case"ivec2":e=2;break;case"vec3":case"ivec3":e=3;break;case"vec4":case"ivec4":case"mat2":e=4;break;case"mat3":e=9;break;case"mat4":e=16;break;default:}return e}const fu=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function Js(t,e=!1){const r={};return t=t.replace(fu,(n,a,u)=>{const y=u.split(":"),A=y[0].trim();let O="";switch(y.length>1&&(O=y[1].trim()),a){case"bool":O=O==="true";break;case"float":case"int":O=Number(O);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":O?O=O.replace("[","").replace("]","").split(",").reduce((Z,Y)=>(Z.push(Number(Y.trim())),Z),[]):O=new Array(as(a)).fill(0);break;default:}return r[A]=O,`${e?"uniform ":""}${a} ${A};
`}),{content:t,uniforms:r}}function ps(t){let{content:e,uniforms:r}=Js(t,!0);return e=e.replace(/(\s*uniform\s*.*\s*){((?:\s*.*\s*)*?)};/g,(n,a,u)=>{u=u.trim().replace(/^.*$/gm,O=>`uniform ${O}`);const{content:y,uniforms:A}=Js(u);return Object.assign(r,A),`${a}{
${y}
};`}),{content:e,uniforms:r}}function du(t){const e={};return t.replace(fu,(r,n,a)=>{const u=a.trim();return e[u]?"":(e[u]=!0,`uniform ${n} ${u};
`)})}const ru=["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"];function uu(t){return ru.indexOf(t)}const{clamp:za}=es,Mu=2,Ca=4,mu=64,ss=128,go=256,ya=512,Qo=8192,Qs=16384,Cp=32768,Ft=null,Xr=131072,Mr=262144,Bi=524288,Ma=1048576,el=2097152,st=4194304,Et=8388608,Vt=16777216,Br=null;function Ir(t,e){return t=za(Math.floor(t),0,255),e=za(Math.floor(e),0,255),256*t+e}function Jt(t){const{color:e,radius:r,tileX:n,tileY:a,shape:u,opacity:y,stroke:A,strokeWidth:O,strokeOpacity:Z}=t,Y=[],Q=[],ae=[],xe=[Ir(e[0],e[1]),Ir(e[2],e[3])],Be=[Ir(A[0],A[1]),Ir(A[2],A[3])];return[[-1,-1],[1,-1],[1,1],[-1,1]].forEach(([it,gt])=>{Y.push([...xe,(it+1)*Et+(gt+1)*el+uu(u)*Xr+r,(n+512)*Bi+(a+512)*mu]),Q.push([...Be,O,Z]),ae.push([y,0,0,0])}),{packedBuffer:Y,packedBuffer2:Q,packedBuffer3:ae}}function sr(t,e){if(t===0&&!e)return 0;if(t===1&&e)return 4294967295;const r=e?1:0,n=Math.floor(t*127);return n*Br+r*Vt+n*Xr+r*Ft+n*ya+r*go+n*Mu+r}const lr={ProjectionMatrix:"u_ProjectionMatrix",ViewMatrix:"u_ViewMatrix",ViewProjectionMatrix:"u_ViewProjectionMatrix",Zoom:"u_Zoom",ZoomScale:"u_ZoomScale",FocalDistance:"u_FocalDistance",CameraPosition:"u_CameraPosition"};let Mt=function(t){return t.TOPRIGHT="topright",t.TOPLEFT="topleft",t.BOTTOMRIGHT="bottomright",t.BOTTOMLEFT="bottomleft",t.TOPCENTER="topcenter",t.BOTTOMCENTER="bottomcenter",t.LEFTCENTER="leftcenter",t.RIGHTCENTER="rightcenter",t.LEFTTOP="lefttop",t.RIGHTTOP="righttop",t.LEFTBOTTOM="leftbottom",t.RIGHTBOTTOM="rightbottom",t}({}),Xt=function(t){return t[t.LNGLAT=1]="LNGLAT",t[t.LNGLAT_OFFSET=2]="LNGLAT_OFFSET",t[t.VECTOR_TILE=3]="VECTOR_TILE",t[t.IDENTITY=4]="IDENTITY",t[t.P20=5]="P20",t[t.P20_OFFSET=6]="P20_OFFSET",t[t.METER_OFFSET=7]="METER_OFFSET",t[t.P20_2=8]="P20_2",t}({});const pt={CoordinateSystem:"u_CoordinateSystem",ViewportCenter:"u_ViewportCenter",ViewportCenterProjection:"u_ViewportCenterProjection",PixelsPerDegree:"u_PixelsPerDegree",PixelsPerDegree2:"u_PixelsPerDegree2",PixelsPerMeter:"u_PixelsPerMeter",Mvp:"u_Mvp"};var $t={MapInitStart:"mapInitStart",LayerInitStart:"layerInitStart",LayerInitEnd:"layerInitEnd",SourceInitStart:"sourceInitStart",SourceInitEnd:"sourceInitEnd",ScaleInitStart:"scaleInitStart",ScaleInitEnd:"scaleInitEnd",MappingStart:"mappingStart",MappingEnd:"mappingEnd",BuildModelStart:"buildModelStart",BuildModelEnd:"buildModelEnd"};let zr=function(t){return t.Hover="hover",t.Click="click",t.Select="select",t.Active="active",t.Drag="drag",t}({}),$r=function(t){return t.normal="normal",t.additive="additive",t.subtractive="subtractive",t.min="min",t.max="max",t.none="none",t}({}),Tn=function(t){return t.MULTIPLE="MULTIPLE",t.SINGLE="SINGLE",t}({}),vn=function(t){return t.AND="and",t.OR="or",t}({}),_n=function(t){return t.INIT="init",t.UPDATE="update",t}({}),Qn=function(t){return t.LINEAR="linear",t.SEQUENTIAL="sequential",t.POWER="power",t.LOG="log",t.IDENTITY="identity",t.TIME="time",t.QUANTILE="quantile",t.QUANTIZE="quantize",t.THRESHOLD="threshold",t.CAT="cat",t.DIVERGING="diverging",t.CUSTOM="threshold",t}({}),Fi=function(t){return t.CONSTANT="constant",t.VARIABLE="variable",t}({}),Vr=function(t){return t[t.Attribute=0]="Attribute",t[t.InstancedAttribute=1]="InstancedAttribute",t[t.Uniform=2]="Uniform",t}({});const po=["mapload","mapchange","mapAfterFrameChange"];var la=Se(25865),Ns=Se.n(la);const Fl=30;function ic({characterSet:t,getFontWidth:e,fontHeight:r,buffer:n,maxCanvasWidth:a,mapping:u={},xOffset:y=0,yOffset:A=0}){let O=0,Z=y;Array.from(t).forEach((Q,ae)=>{if(!u[Q]){const xe=e(Q,ae);Z+Fl>a&&(Z=0,O++),u[Q]={x:Z,y:A+O*Fl,width:Fl,height:Fl,advance:xe},Z+=Fl}});const Y=r+n*2;return{mapping:u,xOffset:Z,yOffset:A+O*Y,canvasHeight:Sd(A+(O+1)*Y)}}function ed(t,e,r){let n=0,a=0,u=0,y=[];const A={};for(const Z of t)if(!A[Z.id]){const{size:Y}=Z;n+Y+e>r&&(Ch(A,y,a),n=0,a=u+a+e,u=0,y=[]),y.push({icon:Z,xOffset:n}),n=n+Y+e,u=Math.max(u,Y)}y.length>0&&Ch(A,y,a);const O=Sd(u+a+e);return{mapping:A,canvasHeight:O}}function Ch(t,e,r){for(const n of e){const{icon:a,xOffset:u}=n;t[a.id]=(0,Wt.Z)((0,Wt.Z)({},a),{},{x:u,y:r,image:a.image,width:a.width,height:a.height})}}function Sd(t){return Math.pow(2,Math.ceil(Math.log2(t)))}const Up=lm(),td="sans-serif",dd="normal",Zp=24,wf=3,Td=.25,Sf=8,sm=1024,Ud=1,Ad=1,Bu=3,nu=null;function lm(){const t=[];for(let e=32;e<128;e++)t.push(String.fromCharCode(e));return t}function Cd(t,e,r,n){t.font=`${n} ${r}px ${e}`,t.fillStyle="black",t.textBaseline="middle"}function rd(t,e){for(let r=0;r<t.length;r++)e.data[4*r+3]=t[r]}class bm extends Yl.EventEmitter{constructor(...e){super(...e),(0,K.Z)(this,"fontAtlas",void 0),(0,K.Z)(this,"iconFontMap",void 0),(0,K.Z)(this,"iconFontGlyphs",{}),(0,K.Z)(this,"fontOptions",void 0),(0,K.Z)(this,"key",void 0),(0,K.Z)(this,"cache",new Lu(Bu))}get scale(){return Ad}get canvas(){const e=this.cache.get(this.key);return e&&e.data}get mapping(){const e=this.cache.get(this.key);return e&&e.mapping||{}}getCanvasByKey(e){const r=this.cache.get(e);return r&&r.data}getMappingByKey(e){const r=this.cache.get(e);return r&&r.mapping||{}}init(){this.cache.clear(),this.fontOptions={fontFamily:td,fontWeight:dd,characterSet:Up,fontSize:Zp,buffer:wf,sdf:!0,cutoff:Td,radius:Sf,iconfont:!1},this.key="",this.iconFontMap=new Map}addIconGlyphs(e){e.forEach(r=>{this.iconFontGlyphs[r.name]=r.unicode})}addIconFont(e,r){this.iconFontMap.set(e,r)}getIconFontKey(e){return this.iconFontMap.get(e)||e}getGlyph(e){return this.iconFontGlyphs[e]?String.fromCharCode(parseInt(this.iconFontGlyphs[e],16)):""}setFontOptions(e){this.fontOptions=(0,Wt.Z)((0,Wt.Z)({},this.fontOptions),e),this.key=this.getKey();const r=this.getNewChars(this.key,this.fontOptions.characterSet),n=this.cache.get(this.key);if(n&&r.length===0)return;const a=this.generateFontAtlas(this.key,r,n);this.fontAtlas=a,this.cache.set(this.key,a)}addFontFace(e,r){const n=document.createElement("style");n.type="text/css",n.innerText=`
@font-face{
font-family: '${e}';
src: url('${r}') format('woff2'),
url('${r}') format('woff'),
url('${r}') format('truetype');
}`,n.onload=()=>{if(document.fonts)try{document.fonts.load(`24px ${e}`,"L7text"),document.fonts.ready.then(()=>{this.emit("fontloaded",{fontFamily:e})})}catch(a){console.warn("\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301 document.fonts !"),console.warn("\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301 iconfont !"),console.warn(a)}},document.getElementsByTagName("head")[0].appendChild(n)}destroy(){this.cache.clear(),this.iconFontMap.clear()}generateFontAtlas(e,r,n){const{fontFamily:a,fontWeight:u,fontSize:y,buffer:A,sdf:O,radius:Z,cutoff:Y,iconfont:Q}=this.fontOptions;let ae=n&&n.data;ae||(ae=window.document.createElement("canvas"),ae.width=sm);const xe=ae.getContext("2d",{willReadFrequently:!0});Cd(xe,a,y,u);const{mapping:Be,canvasHeight:it,xOffset:gt,yOffset:Bt}=ic((0,Wt.Z)({getFontWidth:Yt=>xe.measureText(Yt).width,fontHeight:y*Ad,buffer:A,characterSet:r,maxCanvasWidth:sm},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),Rt=xe.getImageData(0,0,ae.width,ae.height);if(ae.height=it,xe.putImageData(Rt,0,0),Cd(xe,a,y,u),O){const Yt=new(Ns())(y,A,Z,Y,a,u),vr=xe.getImageData(0,0,Yt.size,Yt.size);for(const ln of r){if(Q){const cn=String.fromCharCode(parseInt(ln.replace("&#x","").replace(";",""),16)),Gr=Yt.draw(cn);rd(Gr,vr)}else rd(Yt.draw(ln),vr);xe.putImageData(vr,Be[ln].x,Be[ln].y)}}else for(const Yt of r)xe.fillText(Yt,Be[Yt].x,Be[Yt].y+y*Ud);return{xOffset:gt,yOffset:Bt,mapping:Be,data:ae,width:ae.width,height:ae.height}}getKey(){const{fontFamily:e,fontWeight:r}=this.fontOptions;return`${e}_${r}`}getNewChars(e,r){const n=this.cache.get(e);if(!n)return r;const a=[],u=n.mapping,y=new Set(Object.keys(u));return new Set(r).forEach(O=>{y.has(O)||a.push(O)}),a}}var Nr=Se(42700);const um=3,Tf=1024,Mp=64;class Bm extends Yl.EventEmitter{constructor(...e){super(...e),(0,K.Z)(this,"canvasHeight",128),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"canvas",void 0),(0,K.Z)(this,"iconData",void 0),(0,K.Z)(this,"iconMap",void 0),(0,K.Z)(this,"ctx",void 0),(0,K.Z)(this,"loadingImageCount",0)}isLoading(){return this.loadingImageCount===0}init(){this.iconData=[],this.iconMap={},this.canvas=window.document.createElement("canvas"),this.canvas.width=128,this.canvas.height=128,this.ctx=this.canvas.getContext("2d")}addImage(e,r){var n=this;return(0,Nr.Z)(function*(){let a=new Image;n.loadingImageCount++,n.hasImage(e)?console.warn("Image Id already exists"):n.iconData.push({id:e,size:Mp}),n.updateIconMap(),a=yield n.loadImage(r);const u=n.iconData.find(y=>y.id===e);u&&(u.image=a,u.width=a.width,u.height=a.height),n.update()})()}addImageMini(e,r,n){const a=n.getSceneConfig().canvas;let u=a.createImage();if(this.loadingImageCount++,this.hasImage(e))throw new Error("Image Id already exists");this.iconData.push({id:e,size:Mp}),this.updateIconMap(),this.loadImageMini(r,a).then(y=>{u=y;const A=this.iconData.find(O=>O.id===e);A&&(A.image=u,A.width=u.width,A.height=u.height),this.update()})}getTexture(){return this.texture}getIconMap(){return this.iconMap}getCanvas(){return this.canvas}hasImage(e){return this.iconMap.hasOwnProperty(e)}removeImage(e){this.hasImage(e)&&(this.iconData=this.iconData.filter(r=>r.id!==e),delete this.iconMap[e],this.update())}destroy(){this.removeAllListeners("imageUpdate"),this.iconData=[],this.iconMap={}}loadImage(e){return new Promise((r,n)=>{if(e instanceof HTMLImageElement){r(e);return}const a=new Image;a.crossOrigin="anonymous",a.onload=()=>{r(a)},a.onerror=()=>{n(new Error("Could not load image at "+e))},a.src=e instanceof File?URL.createObjectURL(e):e})}update(){this.updateIconMap(),this.updateIconAtlas(),this.loadingImageCount--,this.loadingImageCount===0&&this.emit("imageUpdate")}updateIconAtlas(){this.canvas.width=Tf,this.canvas.height=this.canvasHeight,Object.keys(this.iconMap).forEach(e=>{const{x:r,y:n,image:a,width:u=64,height:y=64}=this.iconMap[e],O=Math.max(u,y)/Mp,Z=y/O,Y=u/O;a&&this.ctx.drawImage(a,r+(Mp-Y)/2,n+(Mp-Z)/2,Y,Z)})}updateIconMap(){const{mapping:e,canvasHeight:r}=ed(this.iconData,um,Tf);this.iconMap=e,this.canvasHeight=r}loadImageMini(e,r){return new Promise((n,a)=>{const u=r.createImage();u.crossOrigin="anonymous",u.onload=()=>{n(u)},u.onerror=()=>{a(new Error("Could not load image at "+e))},u.src=e})}}var Kr=Se(39536);class cm{constructor(){(0,K.Z)(this,"viewport",void 0),(0,K.Z)(this,"overridedViewProjectionMatrix",void 0),(0,K.Z)(this,"jitteredViewProjectionMatrix",void 0),(0,K.Z)(this,"jitteredProjectionMatrix",void 0),(0,K.Z)(this,"viewMatrixInverse",void 0),(0,K.Z)(this,"cameraPosition",void 0)}init(){}update(e){this.viewport=e,this.viewMatrixInverse=Kr.create(),Kr.invert(this.viewMatrixInverse,e.getViewMatrix()),this.cameraPosition=[this.viewMatrixInverse[12],this.viewMatrixInverse[13],this.viewMatrixInverse[14]]}getProjectionMatrix(){return this.jitteredProjectionMatrix||this.viewport.getProjectionMatrix()}getModelMatrix(){return this.viewport.getModelMatrix()}getViewMatrix(){return this.viewport.getViewMatrix()}getViewMatrixUncentered(){return this.viewport.getViewMatrixUncentered()}getViewProjectionMatrixUncentered(){return this.viewport.getViewProjectionMatrixUncentered()}getViewProjectionMatrix(){return this.overridedViewProjectionMatrix||this.jitteredViewProjectionMatrix||this.viewport.getViewProjectionMatrix()}getZoom(){return this.viewport.getZoom()}getZoomScale(){return this.viewport.getZoomScale()}getCenter(){const[e,r]=this.viewport.getCenter();return[e,r]}getFocalDistance(){return this.viewport.getFocalDistance()}getCameraPosition(){return this.cameraPosition}projectFlat(e,r){return this.viewport.projectFlat(e,r)}setViewProjectionMatrix(e){this.overridedViewProjectionMatrix=e}jitterProjectionMatrix(e,r){const n=Kr.fromTranslation(Kr.create(),[e,r,0]);this.jitteredProjectionMatrix=Kr.multiply(Kr.create(),n,this.viewport.getProjectionMatrix()),this.jitteredViewProjectionMatrix=Kr.multiply(Kr.create(),this.jitteredProjectionMatrix,this.viewport.getViewMatrix())}clearJitterProjectionMatrix(){this.jitteredProjectionMatrix=void 0,this.jitteredViewProjectionMatrix=void 0}}const Af={topleft:"column",topright:"column",bottomright:"column",bottomleft:"column",leftcenter:"column",rightcenter:"column",topcenter:"row",bottomcenter:"row",lefttop:"row",righttop:"row",leftbottom:"row",rightbottom:"row"};class hm{constructor(){(0,K.Z)(this,"container",void 0),(0,K.Z)(this,"controlCorners",void 0),(0,K.Z)(this,"controlContainer",void 0),(0,K.Z)(this,"scene",void 0),(0,K.Z)(this,"mapsService",void 0),(0,K.Z)(this,"controls",[]),(0,K.Z)(this,"unAddControls",[])}init(e,r){this.container=e.container,this.scene=r,this.mapsService=r.mapService,this.initControlPos()}addControl(e,r){r.mapService.map?(e.addTo(this.scene),this.controls.push(e)):this.unAddControls.push(e)}getControlByName(e){return this.controls.find(r=>r.controlOption.name===e)}removeControl(e){const r=this.controls.indexOf(e);return r>-1&&this.controls.splice(r,1),e.remove(),this}addControls(){this.unAddControls.forEach(e=>{e.addTo(this.scene),this.controls.push(e)}),this.unAddControls=[]}destroy(){for(const e of this.controls)e.remove();this.controls=[],this.clearControlPos()}initControlPos(){const e=this.controlCorners={},r="l7-",n=this.controlContainer=Xo("div",r+"control-container",this.container);function a(y=[]){const A=y.map(O=>r+O).join(" ");e[y.filter(O=>!["row","column"].includes(O)).join("")]=Xo("div",A,n)}function u(y){return[...y.replace(/^(top|bottom|left|right|center)/,"$1-").split("-"),Af[y]]}Object.values(Mt).forEach(y=>{a(u(y))}),this.checkCornerOverlap()}clearControlPos(){for(const e in this.controlCorners)this.controlCorners[e]&&au(this.controlCorners[e]);this.controlContainer&&au(this.controlContainer)}checkCornerOverlap(){const e=window.MutationObserver;if(e)for(const r of Object.keys(this.controlCorners)){const n=r.match(/^(top|bottom)(left|right)$/);if(n){const[,a,u]=n,y=this.controlCorners[`${a}${u}`];new e(([{target:O}])=>{y&&(y.style[a]=O.clientHeight+"px")}).observe(this.controlCorners[`${u}${a}`],{childList:!0,attributes:!0})}}}}class Em{constructor(){(0,K.Z)(this,"container",void 0),(0,K.Z)(this,"scene",void 0),(0,K.Z)(this,"mapsService",void 0),(0,K.Z)(this,"markers",[]),(0,K.Z)(this,"markerLayers",[]),(0,K.Z)(this,"unAddMarkers",[]),(0,K.Z)(this,"unAddMarkerLayers",[])}addMarkerLayer(e){this.mapsService.map&&this.mapsService.getMarkerContainer()?(this.markerLayers.push(e),e.addTo(this.scene)):this.unAddMarkerLayers.push(e)}removeMarkerLayer(e){e.destroy(),this.markerLayers.indexOf(e);const r=this.markerLayers.indexOf(e);r>-1&&this.markerLayers.splice(r,1)}addMarker(e){this.mapsService.map&&this.mapsService.getMarkerContainer()?(this.markers.push(e),e.addTo(this.scene)):this.unAddMarkers.push(e)}addMarkers(){this.unAddMarkers.forEach(e=>{e.addTo(this.scene),this.markers.push(e)}),this.unAddMarkers=[]}addMarkerLayers(){this.unAddMarkerLayers.forEach(e=>{this.markerLayers.push(e),e.addTo(this.scene)}),this.unAddMarkers=[]}removeMarker(e){e.remove(),this.markers.indexOf(e);const r=this.markers.indexOf(e);r>-1&&this.markers.splice(r,1)}removeAllMarkers(){this.destroy()}init(e){this.scene=e,this.mapsService=e.mapService}destroy(){this.markers.forEach(e=>{e.remove()}),this.markers=[],this.markerLayers.forEach(e=>{e.destroy()}),this.markerLayers=[]}removeMakerLayerMarker(e){e.destroy()}}class wm{constructor(){(0,K.Z)(this,"scene",void 0),(0,K.Z)(this,"mapsService",void 0),(0,K.Z)(this,"popups",[]),(0,K.Z)(this,"unAddPopups",[])}get isMarkerReady(){return this.mapsService.map&&this.mapsService.getMarkerContainer()}removePopup(e){e!=null&&e.isOpen()&&e.remove();const r=this.popups.indexOf(e);r>-1&&this.popups.splice(r,1);const n=this.unAddPopups.indexOf(e);n>-1&&this.unAddPopups.splice(n,1)}destroy(){this.popups.forEach(e=>e.remove())}addPopup(e){e&&e.getOptions().autoClose&&[...this.popups,...this.unAddPopups].forEach(r=>{r.getOptions().autoClose&&this.removePopup(r)}),this.isMarkerReady?(e.addTo(this.scene),this.popups.push(e)):this.unAddPopups.push(e),e.on("close",()=>{this.removePopup(e)})}initPopup(){this.unAddPopups.length&&this.unAddPopups.forEach(e=>{this.addPopup(e),this.unAddPopups=[]})}init(e){this.scene=e,this.mapsService=e.mapService}}var cf={MapToken:"\u60A8\u6B63\u5728\u4F7F\u7528 Demo \u6D4B\u8BD5 Token, \u751F\u4EA7\u73AF\u5883\u52A1\u5FC5\u81EA\u884C\u6CE8\u518C Token \u786E\u4FDD\u670D\u52A1\u7A33\u5B9A \u9AD8\u5FB7\u5730\u56FE\u7533\u8BF7\u5730\u5740 https://lbs.amap.com/api/javascript-api/guide/abc/prepare Mapbox\u5730\u56FE\u7533\u8BF7\u5730\u5740 https://docs.mapbox.com/help/glossary/access-token/",SDK:"\u8BF7\u786E\u8BA4\u5F15\u5165\u4E86mapbox-gl api\u4E14\u5728L7\u4E4B\u524D\u5F15\u5165"};const{merge:nd}=es,Sm={id:"map",logoPosition:"bottomleft",logoVisible:!0,antialias:!0,stencil:!0,preserveDrawingBuffer:!1,pickBufferScale:1,fitBoundsOptions:{animate:!1}},qm={colors:["rgb(103,0,31)","rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(247,247,247)","rgb(209,229,240)","rgb(146,197,222)","rgb(67,147,195)","rgb(33,102,172)","rgb(5,48,97)"],size:10,shape:"circle",scales:{},shape2d:["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],shape3d:["cylinder","triangleColumn","hexagonColumn","squareColumn"],minZoom:-1,maxZoom:24,visible:!0,autoFit:!1,pickingBuffer:0,enablePropagation:!1,zIndex:0,blend:"normal",maskLayers:[],enableMask:!0,maskOperation:vn.AND,pickedFeatureID:-1,enableMultiPassRenderer:!1,enablePicking:!0,active:!1,activeColor:"#2f54eb",enableHighlight:!1,enableSelect:!1,highlightColor:"#2f54eb",activeMix:0,selectColor:"blue",selectMix:0,enableTAA:!1,jitterScale:1,enableLighting:!1,animateOption:{enable:!1,interval:.2,duration:4,trailLength:.15},forward:!0};class mc{constructor(){(0,K.Z)(this,"sceneConfigCache",{}),(0,K.Z)(this,"layerConfigCache",{}),(0,K.Z)(this,"layerAttributeConfigCache",{})}getSceneConfig(e){return this.sceneConfigCache[e]}getSceneWarninfo(e){return cf[e]}setSceneConfig(e,r){this.sceneConfigCache[e]=(0,Wt.Z)((0,Wt.Z)({},Sm),r)}getLayerConfig(e){return this.layerConfigCache[e]}setLayerConfig(e,r,n){this.layerConfigCache[r]=(0,Wt.Z)({},nd({},this.sceneConfigCache[e],qm,n))}getAttributeConfig(e){return this.layerAttributeConfigCache[e]}setAttributeConfig(e,r){this.layerAttributeConfigCache[e]=(0,Wt.Z)((0,Wt.Z)({},this.layerAttributeConfigCache[e]),r)}clean(){this.sceneConfigCache={},this.layerConfigCache={}}}var mh=Se(49953);const Zd=Math.PI/180,i=512,l=4003e4;function _({latitude:t=0,zoom:e=0,scale:r,highPrecision:n=!1,flipY:a=!1}){r=r!==void 0?r:Math.pow(2,e);const u={},y=i*r,A=Math.cos(t*Zd),O=y/360,Z=O/A,Y=y/l/A;if(u.pixelsPerMeter=[Y,-Y,Y],u.metersPerPixel=[1/Y,-1/Y,1/Y],u.pixelsPerDegree=[O,-Z,Y],u.degreesPerPixel=[1/O,-1/Z,1/Y],n){const Q=Zd*Math.tan(t*Zd)/A,ae=O*Q/2,xe=y/l*Q,Be=xe/Z*Y;u.pixelsPerDegree2=[0,-ae,xe],u.pixelsPerMeter2=[Be,0,Be],a&&(u.pixelsPerDegree2[1]=-u.pixelsPerDegree2[1],u.pixelsPerMeter2[1]=-u.pixelsPerMeter2[1])}return a&&(u.pixelsPerMeter[1]=-u.pixelsPerMeter[1],u.metersPerPixel[1]=-u.metersPerPixel[1],u.pixelsPerDegree[1]=-u.pixelsPerDegree[1],u.degreesPerPixel[1]=-u.degreesPerPixel[1]),u}const S=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];class F{constructor(e){(0,K.Z)(this,"needRefresh",!0),(0,K.Z)(this,"coordinateSystem",void 0),(0,K.Z)(this,"viewportCenter",void 0),(0,K.Z)(this,"viewportCenterProjection",void 0),(0,K.Z)(this,"pixelsPerDegree",void 0),(0,K.Z)(this,"pixelsPerDegree2",void 0),(0,K.Z)(this,"pixelsPerMeter",void 0),this.cameraService=e}refresh(e){const r=this.cameraService.getZoom(),n=this.cameraService.getZoomScale(),a=e||this.cameraService.getCenter(),{pixelsPerMeter:u,pixelsPerDegree:y}=_({latitude:a[1],zoom:r});this.viewportCenter=a,this.viewportCenterProjection=[0,0,0,0],this.pixelsPerMeter=u,this.pixelsPerDegree=y,this.pixelsPerDegree2=[0,0,0],this.coordinateSystem===Xt.LNGLAT||this.coordinateSystem===Xt.P20?this.cameraService.setViewProjectionMatrix(void 0):this.coordinateSystem===Xt.LNGLAT_OFFSET?this.calculateLnglatOffset(a,r):this.coordinateSystem===Xt.P20_OFFSET&&this.calculateLnglatOffset(a,r,n,!0),this.needRefresh=!1}getCoordinateSystem(){return this.coordinateSystem}setCoordinateSystem(e){this.coordinateSystem=e}getViewportCenter(){return this.viewportCenter}getViewportCenterProjection(){return this.viewportCenterProjection}getPixelsPerDegree(){return this.pixelsPerDegree}getPixelsPerDegree2(){return this.pixelsPerDegree2}getPixelsPerMeter(){return this.pixelsPerMeter}calculateLnglatOffset(e,r,n,a){const{pixelsPerMeter:u,pixelsPerDegree:y,pixelsPerDegree2:A}=_({latitude:e[1],zoom:r,scale:n,flipY:a,highPrecision:!0});let O=this.cameraService.getViewMatrix();const Z=this.cameraService.getProjectionMatrix();let Y=Kr.multiply([],Z,O);const Q=this.cameraService.projectFlat([Math.fround(e[0]),Math.fround(e[1])],Math.pow(2,r));this.viewportCenterProjection=mh.transformMat4([],[Q[0],Q[1],0,1],Y),O=this.cameraService.getViewMatrixUncentered()||O,Y=Kr.multiply([],Z,O),Y=Kr.multiply([],Y,S),this.cameraService.setViewProjectionMatrix(Y),this.pixelsPerMeter=u,this.pixelsPerDegree=y,this.pixelsPerDegree2=A}}class j extends Yl.EventEmitter{constructor(...e){super(...e),(0,K.Z)(this,"renderMap",new Map),(0,K.Z)(this,"enable",!1),(0,K.Z)(this,"renderEnable",!1),(0,K.Z)(this,"cacheLogs",{})}setEnable(e){this.enable=!!e}log(e,r){if(!this.enable)return;const n=e.split(".");let a=null;n.forEach((u,y)=>{a!==null?(a[u]||(a[u]={}),y!==n.length-1&&(a=a[u])):(this.cacheLogs[u]||(this.cacheLogs[u]={}),y!==n.length-1&&(a=this.cacheLogs[u])),y===n.length-1&&(a[u]=(0,Wt.Z)((0,Wt.Z)({time:Date.now()},a[u]),r))})}getLog(e){switch(typeof e){case"string":return this.cacheLogs[e];case"object":return e.map(r=>this.cacheLogs[r]).filter(r=>r!==void 0);case"undefined":return this.cacheLogs}}removeLog(e){delete this.cacheLogs[e]}generateRenderUid(){return this.renderEnable?tp():""}renderDebug(e){this.renderEnable=e}renderStart(e){if(!this.renderEnable||!this.enable)return;const r=this.renderMap.get(e)||{};this.renderMap.set(e,(0,Wt.Z)((0,Wt.Z)({},r),{},{renderUid:e,renderStart:Date.now()}))}renderEnd(e){if(!this.renderEnable||!this.enable)return;const r=this.renderMap.get(e);if(r){const n=r.renderStart,a=Date.now();this.emit("renderEnd",(0,Wt.Z)((0,Wt.Z)({},r),{},{renderEnd:a,renderDuration:a-n})),this.renderMap.delete(e)}}destroy(){this.cacheLogs=null,this.renderMap.clear()}}var p=Se(11553),v=Se.n(p);const m={panstart:"dragstart",panmove:"dragging",panend:"dragend",pancancel:"dragcancel"};class w extends Th(){get mapService(){return this.container.mapService}constructor(e){super(),(0,K.Z)(this,"indragging",!1),(0,K.Z)(this,"hammertime",void 0),(0,K.Z)(this,"lastClickTime",0),(0,K.Z)(this,"lastClickXY",[-1,-1]),(0,K.Z)(this,"clickTimer",void 0),(0,K.Z)(this,"$containter",void 0),(0,K.Z)(this,"onDrag",r=>{const n=this.interactionEvent(r);n.type=m[n.type],n.type==="dragging"?this.indragging=!0:this.indragging=!1,this.emit(zr.Drag,n)}),(0,K.Z)(this,"onHammer",r=>{r.srcEvent.stopPropagation();const n=this.interactionEvent(r);this.emit(zr.Hover,n)}),(0,K.Z)(this,"onTouch",r=>{const n=r.touches[0];this.onHover({clientX:n.clientX,clientY:n.clientY,type:"touchstart"})}),(0,K.Z)(this,"onTouchEnd",r=>{if(r.changedTouches.length>0){const n=r.changedTouches[0];this.onHover({clientX:n.clientX,clientY:n.clientY,type:"touchend"})}}),(0,K.Z)(this,"onTouchMove",r=>{const n=r.changedTouches[0];this.onHover({clientX:n.clientX,clientY:n.clientY,type:"touchmove"})}),(0,K.Z)(this,"onHover",r=>{const{clientX:n,clientY:a}=r;let u=n,y=a;const A=r.type,O=this.mapService.getMapContainer();if(O){const{top:Y,left:Q}=O.getBoundingClientRect();u=u-Q-O.clientLeft,y=y-Y-O.clientTop}const Z=this.mapService.containerToLngLat([u,y]);if(A==="click"){this.isDoubleTap(u,y,Z);return}if(A==="touch"){this.isDoubleTap(u,y,Z);return}A!=="click"&&A!=="dblclick"&&this.emit(zr.Hover,{x:u,y,lngLat:Z,type:A,target:r})}),this.container=e}init(){this.addEventListenerOnMap(),this.$containter=this.mapService.getMapContainer()}destroy(){this.hammertime&&this.hammertime.destroy(),this.removeEventListenerOnMap(),this.off(zr.Hover)}triggerHover({x:e,y:r}){this.emit(zr.Hover,{x:e,y:r})}triggerSelect(e){this.emit(zr.Select,{featureId:e})}triggerActive(e){this.emit(zr.Active,{featureId:e})}addEventListenerOnMap(){const e=this.mapService.getMapContainer();if(e){const r=new(v()).Manager(e);r.add(new(v()).Tap({event:"dblclick",taps:2})),r.add(new(v()).Tap({event:"click"})),r.add(new(v()).Pan({threshold:0,pointers:0})),r.add(new(v()).Press({})),r.on("dblclick click",this.onHammer),r.on("panstart panmove panend pancancel",this.onDrag),e.addEventListener("touchstart",this.onTouch),e.addEventListener("touchend",this.onTouchEnd),e.addEventListener("mousemove",this.onHover),e.addEventListener("touchmove",this.onTouchMove),e.addEventListener("mousedown",this.onHover,!0),e.addEventListener("mouseup",this.onHover),e.addEventListener("contextmenu",this.onHover),this.hammertime=r}}removeEventListenerOnMap(){const e=this.mapService.getMapContainer();e&&(e.removeEventListener("mousemove",this.onHover),this.hammertime.off("dblclick click",this.onHammer),this.hammertime.off("panstart panmove panend pancancel",this.onDrag),e.removeEventListener("touchstart",this.onTouch),e.removeEventListener("touchend",this.onTouchEnd),e.removeEventListener("mousedown",this.onHover),e.removeEventListener("mouseup",this.onHover),e.removeEventListener("contextmenu",this.onHover))}interactionEvent(e){const{type:r,pointerType:n}=e;let a,u;n==="touch"?(u=Math.floor(e.pointers[0].clientY),a=Math.floor(e.pointers[0].clientX)):(u=Math.floor(e.srcEvent.y),a=Math.floor(e.srcEvent.x));const y=this.mapService.getMapContainer();if(y){const{top:O,left:Z}=y.getBoundingClientRect();a-=Z,u-=O}const A=this.mapService.containerToLngLat([a,u]);return{x:a,y:u,lngLat:A,type:r,target:e.srcEvent}}isDoubleTap(e,r,n){const a=new Date().getTime();let u="click";a-this.lastClickTime<400&&Math.abs(this.lastClickXY[0]-e)<10&&Math.abs(this.lastClickXY[1]-r)<10?(this.lastClickTime=0,this.lastClickXY=[-1,-1],this.clickTimer&&clearTimeout(this.clickTimer),u="dblclick",this.emit(zr.Hover,{x:e,y:r,lngLat:n,type:u})):(this.lastClickTime=a,this.lastClickXY=[e,r],this.clickTimer=setTimeout(()=>{u="click",this.emit(zr.Hover,{x:e,y:r,lngLat:n,type:u})},400))}}let D=0;function N(t){let e=t;if(typeof t=="string"&&(e=document.getElementById(t)),e){const r=document.createElement("div");return r.style.cssText+=`
position: absolute;
z-index:2;
height: 100%;
width: 100%;
pointer-events: none;
`,r.id=`l7-scene-${D++}`,r.classList.add("l7-scene"),e.appendChild(r),r}return null}function W(t){var e;let r=!0;if((t==null||(e=t.target)===null||e===void 0?void 0:e.target)instanceof HTMLElement){var n;let u=t==null||(n=t.target)===null||n===void 0?void 0:n.target;for(;u;){var a;const y=Array.from(u.classList);if(y.includes("l7-marker")||y.includes("l7-popup")){r=!1;break}u=(a=u)===null||a===void 0?void 0:a.parentElement}}return r}let $=function(t){return t[t.SAMPLED=0]="SAMPLED",t[t.RENDER_TARGET=1]="RENDER_TARGET",t}({});class ie{constructor(e){var r=this;(0,K.Z)(this,"pickedColors",void 0),(0,K.Z)(this,"pickedTileLayers",[]),(0,K.Z)(this,"pickingFBO",void 0),(0,K.Z)(this,"width",0),(0,K.Z)(this,"height",0),(0,K.Z)(this,"alreadyInPicking",!1),(0,K.Z)(this,"pickBufferScale",1),(0,K.Z)(this,"pickFromPickingFBO",function(){var n=(0,Nr.Z)(function*(a,{x:u,y,lngLat:A,type:O,target:Z}){let Y=!1;const{readPixelsAsync:Q,getViewportSize:ae}=r.rendererService,{width:xe,height:Be}=ae(),{enableHighlight:it,enableSelect:gt}=a.getLayerConfig(),Bt=u*Ll,Rt=y*Ll;if(Bt>xe-1*Ll||Bt<0||Rt>Be-1*Ll||Rt<0)return!1;const Yt=yield Q({x:Math.floor(Bt/r.pickBufferScale),y:Math.floor((Be-(y+1)*Ll)/r.pickBufferScale),width:1,height:1,data:new Uint8Array(1*1*4),framebuffer:r.pickingFBO});if(r.pickedColors=Yt,Yt[0]!==0||Yt[1]!==0||Yt[2]!==0){const vr=Aa(Yt),ln=a.layerPickService.getFeatureById(vr);vr!==a.getCurrentPickId()&&O==="mousemove"&&(O="mouseenter");const cn={x:u,y,type:O,lngLat:A,featureId:vr,feature:ln,target:Z};ln&&(Y=!0,a.setCurrentPickId(vr),r.triggerHoverOnLayer(a,cn))}else{const vr={x:u,y,lngLat:A,type:a.getCurrentPickId()!==null&&O==="mousemove"?"mouseout":"un"+O,featureId:null,target:Z,feature:null};r.triggerHoverOnLayer(a,(0,Wt.Z)((0,Wt.Z)({},vr),{},{type:"unpick"})),r.triggerHoverOnLayer(a,vr),a.setCurrentPickId(null)}if(it&&a.layerPickService.highlightPickedFeature(Yt),gt&&O==="click"&&(Yt==null?void 0:Yt.toString())!==[0,0,0,0].toString()){const vr=Aa(Yt);a.getCurrentSelectedId()===null||vr!==a.getCurrentSelectedId()?(a.layerPickService.selectFeature(Yt),a.setCurrentSelectedId(vr)):(a.layerPickService.selectFeature(new Uint8Array([0,0,0,0])),a.setCurrentSelectedId(null))}return Y});return function(a,u){return n.apply(this,arguments)}}()),this.container=e}get mapService(){return this.container.mapService}get rendererService(){return this.container.rendererService}get configService(){return this.container.globalConfigService}get interactionService(){return this.container.interactionService}get layerService(){return this.container.layerService}init(e){const{createTexture2D:r,createFramebuffer:n,getViewportSize:a}=this.rendererService;let{width:u,height:y}=a();this.pickBufferScale=this.configService.getSceneConfig(e).pickBufferScale||1,u=Math.round(u/this.pickBufferScale),y=Math.round(y/this.pickBufferScale);const A=r({width:u,height:y,usage:$.RENDER_TARGET,label:"Picking Texture"});this.pickingFBO=n({color:A,depth:!0,width:u,height:y}),this.interactionService.on(zr.Hover,this.pickingAllLayer.bind(this))}boxPickLayer(e,r,n){var a=this;return(0,Nr.Z)(function*(){const{useFramebufferAsync:u,clear:y}=a.rendererService;a.resizePickingFBO(),e.hooks.beforePickingEncode.call(),yield u(a.pickingFBO,(0,Nr.Z)(function*(){y({framebuffer:a.pickingFBO,color:[0,0,0,0],stencil:0,depth:1}),e.renderModels({ispick:!0})})),e.hooks.afterPickingEncode.call();const A=yield a.pickBox(e,r);n(A)})()}pickBox(e,r){var n=this;return(0,Nr.Z)(function*(){const[a,u,y,A]=r.map(Bt=>{const Rt=Bt<0?0:Bt;return Math.floor(Rt*Ll/n.pickBufferScale)}),{readPixelsAsync:O,getViewportSize:Z}=n.rendererService,{width:Y,height:Q}=Z();if(a>(Y-1)*Ll/n.pickBufferScale||y<0||u>(Q-1)*Ll/n.pickBufferScale||A<0)return[];const ae=Math.min(Y/n.pickBufferScale,y)-a,xe=Math.min(Q/n.pickBufferScale,A)-u,Be=yield O({x:a,y:Math.floor(Q/n.pickBufferScale-(A+1)),width:ae,height:xe,data:new Uint8Array(ae*xe*4),framebuffer:n.pickingFBO}),it=[],gt={};for(let Bt=0;Bt<Be.length/4;Bt=Bt+1){const Rt=Be.slice(Bt*4,Bt*4+4),Yt=Aa(Rt);if(Yt!==-1&&!gt[Yt]){const vr=e.layerPickService.getFeatureById(Yt);it.push((0,Wt.Z)((0,Wt.Z)({},vr),{},{pickedFeatureIdx:Yt})),gt[Yt]=!0}}return it})()}handleCursor(e,r){const{cursor:n="",cursorEnabled:a}=e.getLayerConfig();if(a){const y=this.mapService.version==="GAODE2.x"?this.mapService.getMapContainer():this.mapService.getMarkerContainer(),A=y==null?void 0:y.style.getPropertyValue("cursor");r==="unmousemove"&&A!==""?y==null||y.style.setProperty("cursor",""):r==="mousemove"&&(y==null||y.style.setProperty("cursor",n))}}destroy(){this.pickingFBO.destroy(),this.pickingFBO=null}pickingAllLayer(e){var r=this;return(0,Nr.Z)(function*(){!r.layerService.needPick(e.type)||!r.isPickingAllLayer()||(r.alreadyInPicking=!0,yield r.pickingLayers(e),r.layerService.renderLayers(),r.alreadyInPicking=!1)})()}isPickingAllLayer(){return!(this.alreadyInPicking||this.layerService.alreadyInRendering||this.interactionService.indragging||!this.layerService.getShaderPickStat())}resizePickingFBO(){const{getViewportSize:e}=this.rendererService,{width:r,height:n}=e();(this.width!==r||this.height!==n)&&(this.pickingFBO.resize({width:Math.round(r/this.pickBufferScale),height:Math.round(n/this.pickBufferScale)}),this.width=r,this.height=n)}pickingLayers(e){var r=this;return(0,Nr.Z)(function*(){const{clear:n,useFramebufferAsync:a}=r.rendererService;r.resizePickingFBO();const u=r.layerService.getRenderList();for(const y of u.filter(A=>A.needPick(e.type)).reverse()){yield a(r.pickingFBO,(0,Nr.Z)(function*(){n({framebuffer:r.pickingFBO,color:[0,0,0,0],stencil:0,depth:1}),y.layerPickService.pickRender(e)}));const A=yield r.pickFromPickingFBO(y,e);if(r.layerService.pickedLayerId=A?+y.id:-1,A&&!y.getLayerConfig().enablePropagation)break}})()}triggerHoverOnLayer(e,r){W(r)&&(this.handleCursor(e,r.type),e.emit(r.type,r))}}class pe{constructor(e=!0){(0,K.Z)(this,"autoStart",void 0),(0,K.Z)(this,"startTime",0),(0,K.Z)(this,"oldTime",0),(0,K.Z)(this,"running",!1),(0,K.Z)(this,"elapsedTime",0),this.autoStart=e}start(){this.startTime=(typeof performance=="undefined"?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const r=(typeof performance=="undefined"?Date:performance).now();e=(r-this.oldTime)/1e3,this.oldTime=r,this.elapsedTime+=e}return e}}const{throttle:we}=es;class ke extends Yl.EventEmitter{get renderService(){return this.container.rendererService}get mapService(){return this.container.mapService}get debugService(){return this.container.debugService}constructor(e){super(),(0,K.Z)(this,"pickedLayerId",-1),(0,K.Z)(this,"clock",new pe),(0,K.Z)(this,"alreadyInRendering",!1),(0,K.Z)(this,"layers",[]),(0,K.Z)(this,"layerList",[]),(0,K.Z)(this,"layerRenderID",void 0),(0,K.Z)(this,"sceneInited",!1),(0,K.Z)(this,"animateInstanceCount",0),(0,K.Z)(this,"shaderPicking",!0),(0,K.Z)(this,"enableRender",!0),(0,K.Z)(this,"reRender",we(()=>{this.renderLayers()},32)),(0,K.Z)(this,"throttleRenderLayers",we(()=>{this.renderLayers()},16)),this.container=e}needPick(e){return this.updateLayerRenderList(),this.layerList.some(r=>r.needPick(e))}add(e){this.layers.push(e),this.sceneInited&&e.init().then(()=>{this.renderLayers()})}addMask(e){this.sceneInited&&e.init().then(()=>{this.renderLayers()})}initLayers(){var e=this;return(0,Nr.Z)(function*(){e.sceneInited=!0,e.layers.forEach(function(){var r=(0,Nr.Z)(function*(n){n.startInit||(yield n.init(),e.updateLayerRenderList())});return function(n){return r.apply(this,arguments)}}())})()}getSceneInited(){return this.sceneInited}getRenderList(){return this.layerList}getLayers(){return this.layers}getLayer(e){return this.layers.find(r=>r.id===e)}getLayerByName(e){return this.layers.find(r=>r.name===e)}remove(e,r){var n=this;return(0,Nr.Z)(function*(){r?r.layerChildren=r.layerChildren.filter(a=>a!==e):n.layers=n.layers.filter(a=>a!==e),e.destroy(),n.reRender(),n.emit("layerChange",n.layers)})()}removeAllLayers(){var e=this;return(0,Nr.Z)(function*(){e.destroy(),e.reRender()})()}setEnableRender(e){this.enableRender=e}renderLayers(){var e=this;return(0,Nr.Z)(function*(){if(e.alreadyInRendering||!e.enableRender)return;e.updateLayerRenderList();const r=e.debugService.generateRenderUid();e.debugService.renderStart(r),e.alreadyInRendering=!0,e.clear();for(const n of e.layerList)n.prerender();e.renderService.beginFrame();for(const n of e.layerList){const{enableMask:a}=n.getLayerConfig();n.masks.filter(u=>u.inited).length>0&&a&&e.renderMask(n.masks),n.getLayerConfig().enableMultiPassRenderer?yield n.renderMultiPass():n.render()}e.renderService.endFrame(),e.debugService.renderEnd(r),e.alreadyInRendering=!1})()}renderMask(e){let r=0;this.renderService.clear({stencil:0,depth:1,framebuffer:null});const n=e.length>1?Tn.MULTIPLE:Tn.SINGLE;for(const a of e)a.render({isStencil:!0,stencilType:n,stencilIndex:r++})}beforeRenderData(e){var r=this;return(0,Nr.Z)(function*(){(yield e.hooks.beforeRenderData.promise())&&r.renderLayers()})()}renderTileLayerMask(e){let r=0;const{enableMask:n=!0}=e.getLayerConfig();let a=e.tileMask?1:0;const u=e.masks.filter(A=>A.inited);a=a+(n?u.length:1);const y=a>1?Tn.MULTIPLE:Tn.SINGLE;if((e.tileMask||u.length&&n)&&this.renderService.clear({stencil:0,depth:1,framebuffer:null}),u.length&&n)for(const A of u)A.render({isStencil:!0,stencilType:y,stencilIndex:r++});e.tileMask&&e.tileMask.render({isStencil:!0,stencilType:y,stencilIndex:r++,stencilOperation:vn.OR})}renderTileLayer(e){var r=this;return(0,Nr.Z)(function*(){r.renderTileLayerMask(e),e.getLayerConfig().enableMultiPassRenderer?yield e.renderMultiPass():yield e.render()})()}updateLayerRenderList(){this.layerList=[],this.layers.filter(e=>e.inited).filter(e=>e.isVisible()).sort((e,r)=>e.zIndex-r.zIndex).forEach(e=>{this.layerList.push(e)})}destroy(){this.layers.forEach(e=>{e.destroy()}),this.layers=[],this.layerList=[],this.emit("layerChange",this.layers)}startAnimate(){this.animateInstanceCount++===0&&(this.clock.start(),this.runRender())}stopAnimate(){--this.animateInstanceCount===0&&(this.stopRender(),this.clock.stop())}getOESTextureFloat(){return this.renderService.extensionObject.OES_texture_float}enableShaderPick(){this.shaderPicking=!0}disableShaderPick(){this.shaderPicking=!1}getShaderPickStat(){return this.shaderPicking}clear(){const e=Va(this.mapService.bgColor);this.renderService.clear({color:e,depth:1,stencil:0,framebuffer:null})}runRender(){this.renderLayers(),this.layerRenderID=window.requestAnimationFrame(this.runRender.bind(this))}stopRender(){window.cancelAnimationFrame(this.layerRenderID)}}var Ge=Se(87841);const{isNil:ht}=es;class mt{constructor(e){(0,K.Z)(this,"name",void 0),(0,K.Z)(this,"type",void 0),(0,K.Z)(this,"scale",void 0),(0,K.Z)(this,"descriptor",void 0),(0,K.Z)(this,"featureBufferLayout",[]),(0,K.Z)(this,"needRescale",!1),(0,K.Z)(this,"needRemapping",!1),(0,K.Z)(this,"needRegenerateVertices",!1),(0,K.Z)(this,"featureRange",{startIndex:0,endIndex:1/0}),(0,K.Z)(this,"vertexAttribute",void 0),(0,K.Z)(this,"defaultCallback",r=>{if(r.length===0){var n;return((n=this.scale)===null||n===void 0?void 0:n.defaultValues)||[]}return r.map((a,u)=>{var y;return((y=this.scale)===null||y===void 0?void 0:y.scalers[u].func)(a)})}),this.setProps(e)}setProps(e){Object.assign(this,e)}mapping(e){var r;if((r=this.scale)!==null&&r!==void 0&&r.callback){var n;const a=(n=this.scale)===null||n===void 0?void 0:n.callback(...e);if(!ht(a))return[a]}return this.defaultCallback(e)}resetDescriptor(){this.descriptor&&(this.descriptor.buffer.data=[])}}const St=["buffer","update","name"],xt=["buffer","update","name"],bt={[Ee.FLOAT]:4,[Ee.UNSIGNED_BYTE]:1,[Ee.UNSIGNED_SHORT]:2};class kt{constructor(e){(0,K.Z)(this,"attributesAndIndices",void 0),(0,K.Z)(this,"attributes",[]),(0,K.Z)(this,"triangulation",void 0),(0,K.Z)(this,"featureLayout",{sizePerElement:0,elements:[]}),this.rendererService=e}registerStyleAttribute(e){let r=this.getLayerStyleAttribute(e.name||"");return r?r.setProps(e):(r=new mt(e),this.attributes.push(r)),r}unRegisterStyleAttribute(e){const r=this.attributes.findIndex(n=>n.name===e);r>-1&&this.attributes.splice(r,1)}updateScaleAttribute(e){this.attributes.forEach(r=>{var n;const a=r.name,u=(n=r.scale)===null||n===void 0?void 0:n.field;(e[a]||u&&e[u])&&(r.needRescale=!0,r.needRemapping=!0,r.needRegenerateVertices=!0)})}updateStyleAttribute(e,r,n){let a=this.getLayerStyleAttribute(e);a||(a=this.registerStyleAttribute((0,Wt.Z)((0,Wt.Z)({},r),{},{name:e})));const{scale:u}=r;u&&a&&(a.scale=u,a.needRescale=!0,a.needRemapping=!0,a.needRegenerateVertices=!0,n&&n.featureRange&&(a.featureRange=n.featureRange))}getLayerStyleAttributes(){return this.attributes}getLayerStyleAttribute(e){return this.attributes.find(r=>r.name===e)}getLayerAttributeScale(e){var r;const n=this.getLayerStyleAttribute(e),a=n==null||(r=n.scale)===null||r===void 0?void 0:r.scalers;return a&&a[0]?a[0].func:null}updateAttributeByFeatureRange(e,r,n=0,a,u){const y=this.attributes.find(A=>A.name===e);if(y&&y.descriptor){const{descriptor:A}=y,{update:O,buffer:Z,size:Y=0}=A,Q=bt[Z.type||Ee.FLOAT];if(O){const{elements:ae,sizePerElement:xe}=this.featureLayout,Be=ae.slice(n,a);if(!Be.length)return;const{offset:it}=Be[0],gt=it*Y*Q,Bt=Be.map(({featureIdx:Rt,vertices:Yt,normals:vr},ln)=>{const cn=Yt.length/xe,Gr=[];for(let Pn=0;Pn<cn;Pn++){const Oo=vr?vr.slice(Pn*3,Pn*3+3):[];Gr.push(...O(r[Rt],Rt,Yt.slice(Pn*xe,Pn*xe+xe),ln,Oo))}return Gr}).flat();y.vertexAttribute.updateBuffer({data:Bt,offset:gt}),u==null||u.emit(`legend:${e}`,u.getLegend(e))}}}createAttributesAndIndices(e,r,n,a){this.featureLayout={sizePerElement:0,elements:[]},r&&(this.triangulation=r);const u=this.attributes.map(it=>(it.resetDescriptor(),it.descriptor));let y=0,A=0;const O=[];let Z=3;e.forEach((it,gt)=>{const{indices:Bt,vertices:Rt,normals:Yt,size:vr,indexes:ln,count:cn}=this.triangulation(it,n);typeof cn=="number"&&(A+=cn),Bt.forEach(Pn=>{O.push(Pn+y)}),Z=vr;const Gr=Rt.length/vr;this.featureLayout.sizePerElement=Z,this.featureLayout.elements.push({featureIdx:gt,vertices:Rt,normals:Yt,offset:y}),y+=Gr;for(let Pn=0;Pn<Gr;Pn++){const Oo=(Yt==null?void 0:Yt.slice(Pn*3,Pn*3+3))||[],Da=Rt.slice(Pn*vr,Pn*vr+vr);let Bo=0;ln&&ln[Pn]!==void 0&&(Bo=ln[Pn]),u.forEach((Oa,fl)=>{Oa&&Oa.update&&Oa.buffer.data.push(...Oa.update(it,gt,Da,Pn,Oo,Bo))})}});const{createAttribute:Y,createBuffer:Q,createElements:ae}=this.rendererService,xe={};u.forEach((it,gt)=>{if(it){const{buffer:Bt,update:Rt,name:Yt}=it,vr=(0,Ge.Z)(it,St),ln=Y((0,Wt.Z)({buffer:Q(Bt)},vr));xe[it.name||""]=ln,this.attributes[gt].vertexAttribute=ln}});const Be=ae({data:O,type:Ee.UNSIGNED_INT,count:O.length});return this.attributesAndIndices={attributes:xe,elements:Be,count:A},Object.values(this.attributes).filter(it=>it.scale).forEach(it=>{const gt=it.name;a==null||a.emit(`legend:${gt}`,a.getLegend(gt))}),this.attributesAndIndices}createAttributes(e,r){this.featureLayout={sizePerElement:0,elements:[]},r&&(this.triangulation=r);const n=this.attributes.map(Y=>(Y.resetDescriptor(),Y.descriptor));let a=0;const u=[];let y=3;e.forEach((Y,Q)=>{const{indices:ae,vertices:xe,normals:Be,size:it,indexes:gt}=this.triangulation(Y);ae.forEach(Rt=>{u.push(Rt+a)}),y=it;const Bt=xe.length/it;this.featureLayout.sizePerElement=y,this.featureLayout.elements.push({featureIdx:Q,vertices:xe,normals:Be,offset:a}),a+=Bt;for(let Rt=0;Rt<Bt;Rt++){const Yt=(Be==null?void 0:Be.slice(Rt*3,Rt*3+3))||[],vr=xe.slice(Rt*it,Rt*it+it);let ln=0;gt&&gt[Rt]!==void 0&&(ln=gt[Rt]),n.forEach((cn,Gr)=>{cn&&cn.update&&cn.buffer.data.push(...cn.update(Y,Q,vr,Rt,Yt,ln))})}});const{createAttribute:A,createBuffer:O}=this.rendererService,Z={};return n.forEach((Y,Q)=>{if(Y){const{buffer:ae,update:xe,name:Be}=Y,it=(0,Ge.Z)(Y,xt),gt=A((0,Wt.Z)({buffer:O(ae)},it));Z[Y.name||""]=gt,this.attributes[Q].vertexAttribute=gt}}),{attributes:Z}}clearAllAttributes(){var e;this.attributes.forEach(r=>{r.vertexAttribute&&r.vertexAttribute.destroy()}),(e=this.attributesAndIndices)===null||e===void 0||e.elements.destroy(),this.attributes=[]}}var ft=Se(14224);function nr(t,e,r,n){function a(u){return u instanceof r?u:new r(function(y){y(u)})}return new(r||(r=Promise))(function(u,y){function A(Y){try{Z(n.next(Y))}catch(Q){y(Q)}}function O(Y){try{Z(n.throw(Y))}catch(Q){y(Q)}}function Z(Y){Y.done?u(Y.value):a(Y.value).then(A,O)}Z((n=n.apply(t,e||[])).next())})}function br(t,e){var r={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},n,a,u,y;return y={next:A(0),throw:A(1),return:A(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function A(Z){return function(Y){return O([Z,Y])}}function O(Z){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(u=Z[0]&2?a.return:Z[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,Z[1])).done)return u;switch(a=0,u&&(Z=[Z[0]&2,u.value]),Z[0]){case 0:case 1:u=Z;break;case 4:return r.label++,{value:Z[1],done:!1};case 5:r.label++,a=Z[1],Z=[0];continue;case 7:Z=r.ops.pop(),r.trys.pop();continue;default:if(u=r.trys,!(u=u.length>0&&u[u.length-1])&&(Z[0]===6||Z[0]===2)){r=0;continue}if(Z[0]===3&&(!u||Z[1]>u[0]&&Z[1]<u[3])){r.label=Z[1];break}if(Z[0]===6&&r.label<u[1]){r.label=u[1],u=Z;break}if(u&&r.label<u[2]){r.label=u[2],r.ops.push(Z);break}u[2]&&r.ops.pop(),r.trys.pop();continue}Z=e.call(t,r)}catch(Y){Z=[6,Y],a=0}finally{n=u=0}if(Z[0]&5)throw Z[1];return{value:Z[0]?Z[1]:void 0,done:!0}}}function Pr(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),a,u=[],y;try{for(;(e===void 0||e-- >0)&&!(a=n.next()).done;)u.push(a.value)}catch(A){y={error:A}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(y)throw y.error}}return u}function Mn(t,e,r){if(r||arguments.length===2)for(var n=0,a=e.length,u;n<a;n++)(u||!(n in e))&&(u||(u=Array.prototype.slice.call(e,0,n)),u[n]=e[n]);return t.concat(u||Array.prototype.slice.call(e))}function yn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kr={exports:{}},Ai={exports:{}},$n={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;function r(n){return n&&typeof n.length=="number"&&n.length>=0&&n.length%1===0}t.exports=e.default})($n,$n.exports);var ti={},ri={exports:{}},hn={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(r){return function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];var u=n.pop();return r.call(this,n,u)}},t.exports=e.default})(hn,hn.exports);var An={};Object.defineProperty(An,"__esModule",{value:!0}),An.fallback=Go,An.wrap=hi;var Yi=An.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,Ci=An.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,fo=An.hasNextTick=typeof ft=="object"&&typeof ft.nextTick=="function";function Go(t){setTimeout(t,0)}function hi(t){return function(e){for(var r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return t(function(){return e.apply(void 0,r)})}}var zi;Yi?zi=queueMicrotask:Ci?zi=setImmediate:fo?zi=ft.nextTick:zi=Go,An.default=hi(zi),function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=O;var r=hn.exports,n=A(r),a=An,u=A(a),y=ti;function A(Q){return Q&&Q.__esModule?Q:{default:Q}}function O(Q){return(0,y.isAsync)(Q)?function(){for(var ae=[],xe=arguments.length;xe--;)ae[xe]=arguments[xe];var Be=ae.pop(),it=Q.apply(this,ae);return Z(it,Be)}:(0,n.default)(function(ae,xe){var Be;try{Be=Q.apply(this,ae)}catch(it){return xe(it)}if(Be&&typeof Be.then=="function")return Z(Be,xe);xe(null,Be)})}function Z(Q,ae){return Q.then(function(xe){Y(ae,null,xe)},function(xe){Y(ae,xe&&xe.message?xe:new Error(xe))})}function Y(Q,ae,xe){try{Q(ae,xe)}catch(Be){(0,u.default)(function(it){throw it},Be)}}t.exports=e.default}(ri,ri.exports),Object.defineProperty(ti,"__esModule",{value:!0}),ti.isAsyncIterable=ti.isAsyncGenerator=ti.isAsync=void 0;var Vo=ri.exports,Ka=ta(Vo);function ta(t){return t&&t.__esModule?t:{default:t}}function ka(t){return t[Symbol.toStringTag]==="AsyncFunction"}function ca(t){return t[Symbol.toStringTag]==="AsyncGenerator"}function Eo(t){return typeof t[Symbol.asyncIterator]=="function"}function Pa(t){if(typeof t!="function")throw new Error("expected a function");return ka(t)?(0,Ka.default)(t):t}ti.default=Pa,ti.isAsync=ka,ti.isAsyncGenerator=ca,ti.isAsyncIterable=Eo;var na={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;function r(n,a){if(a===void 0&&(a=n.length),!a)throw new Error("arity is undefined");function u(){for(var y=this,A=[],O=arguments.length;O--;)A[O]=arguments[O];return typeof A[a-1]=="function"?n.apply(this,A):new Promise(function(Z,Y){A[a-1]=function(Q){for(var ae=[],xe=arguments.length-1;xe-- >0;)ae[xe]=arguments[xe+1];if(Q)return Y(Q);Z(ae.length>1?ae:ae[0])},n.apply(y,A)})}return u}t.exports=e.default})(na,na.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=$n.exports,n=O(r),a=ti,u=O(a),y=na.exports,A=O(y);function O(Z){return Z&&Z.__esModule?Z:{default:Z}}e.default=(0,A.default)(function(Z,Y,Q){var ae=(0,n.default)(Y)?[]:{};Z(Y,function(xe,Be,it){(0,u.default)(xe)(function(gt){for(var Bt,Rt=[],Yt=arguments.length-1;Yt-- >0;)Rt[Yt]=arguments[Yt+1];Rt.length<2&&(Bt=Rt,Rt=Bt[0]),ae[Be]=Rt,it(gt)})},function(xe){return Q(xe,ae)})},3),t.exports=e.default}(Ai,Ai.exports);var ha={exports:{}},Xs={exports:{}},Ls={exports:{}},Ea={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;function r(n){function a(){for(var u=[],y=arguments.length;y--;)u[y]=arguments[y];if(n!==null){var A=n;n=null,A.apply(this,u)}}return Object.assign(a,n),a}t.exports=e.default})(Ea,Ea.exports);var ws={exports:{}},qs={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(r){return r[Symbol.iterator]&&r[Symbol.iterator]()},t.exports=e.default})(qs,qs.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Y;var r=$n.exports,n=y(r),a=qs.exports,u=y(a);function y(Q){return Q&&Q.__esModule?Q:{default:Q}}function A(Q){var ae=-1,xe=Q.length;return function(){return++ae<xe?{value:Q[ae],key:ae}:null}}function O(Q){var ae=-1;return function(){var Be=Q.next();return Be.done?null:(ae++,{value:Be.value,key:ae})}}function Z(Q){var ae=Q?Object.keys(Q):[],xe=-1,Be=ae.length;return function it(){var gt=ae[++xe];return gt==="__proto__"?it():xe<Be?{value:Q[gt],key:gt}:null}}function Y(Q){if((0,n.default)(Q))return A(Q);var ae=(0,u.default)(Q);return ae?O(ae):Z(Q)}t.exports=e.default}(ws,ws.exports);var ua={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;function r(n){return function(){for(var a=[],u=arguments.length;u--;)a[u]=arguments[u];if(n===null)throw new Error("Callback was already called.");var y=n;n=null,y.apply(this,a)}}t.exports=e.default})(ua,ua.exports);var cu={exports:{}},c={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r={};e.default=r,t.exports=e.default})(c,c.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var r=c.exports,n=a(r);function a(y){return y&&y.__esModule?y:{default:y}}function u(y,A,O,Z){var Y=!1,Q=!1,ae=!1,xe=0,Be=0;function it(){xe>=A||ae||Y||(ae=!0,y.next().then(function(Rt){var Yt=Rt.value,vr=Rt.done;if(!(Q||Y)){if(ae=!1,vr){Y=!0,xe<=0&&Z(null);return}xe++,O(Yt,Be,gt),Be++,it()}}).catch(Bt))}function gt(Rt,Yt){if(xe-=1,!Q){if(Rt)return Bt(Rt);if(Rt===!1){Y=!0,Q=!0;return}if(Yt===n.default||Y&&xe<=0)return Y=!0,Z(null);it()}}function Bt(Rt){Q||(ae=!1,Y=!0,Z(Rt))}it()}t.exports=e.default}(cu,cu.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=Ea.exports,n=xe(r),a=ws.exports,u=xe(a),y=ua.exports,A=xe(y),O=ti,Z=cu.exports,Y=xe(Z),Q=c.exports,ae=xe(Q);function xe(Be){return Be&&Be.__esModule?Be:{default:Be}}e.default=function(Be){return function(it,gt,Bt){if(Bt=(0,n.default)(Bt),Be<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!it)return Bt(null);if((0,O.isAsyncGenerator)(it))return(0,Y.default)(it,Be,gt,Bt);if((0,O.isAsyncIterable)(it))return(0,Y.default)(it[Symbol.asyncIterator](),Be,gt,Bt);var Rt=(0,u.default)(it),Yt=!1,vr=!1,ln=0,cn=!1;function Gr(Oo,Da){if(!vr)if(ln-=1,Oo)Yt=!0,Bt(Oo);else if(Oo===!1)Yt=!0,vr=!0;else{if(Da===ae.default||Yt&&ln<=0)return Yt=!0,Bt(null);cn||Pn()}}function Pn(){for(cn=!0;ln<Be&&!Yt;){var Oo=Rt();if(Oo===null){Yt=!0,ln<=0&&Bt(null);return}ln+=1,gt(Oo.value,Oo.key,(0,A.default)(Gr))}cn=!1}Pn()}},t.exports=e.default}(Ls,Ls.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=Ls.exports,n=O(r),a=ti,u=O(a),y=na.exports,A=O(y);function O(Y){return Y&&Y.__esModule?Y:{default:Y}}function Z(Y,Q,ae,xe){return(0,n.default)(Q)(Y,(0,u.default)(ae),xe)}e.default=(0,A.default)(Z,4),t.exports=e.default}(Xs,Xs.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=Xs.exports,n=y(r),a=na.exports,u=y(a);function y(O){return O&&O.__esModule?O:{default:O}}function A(O,Z,Y){return(0,n.default)(O,1,Z,Y)}e.default=(0,u.default)(A,3),t.exports=e.default}(ha,ha.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=A;var r=Ai.exports,n=y(r),a=ha.exports,u=y(a);function y(O){return O&&O.__esModule?O:{default:O}}function A(O,Z){return(0,n.default)(u.default,O,Z)}t.exports=e.default}(kr,kr.exports);var o=yn(kr.exports),f=function(){function t(){this.args=[],this.tasks=[]}return t.prototype.call=function(){for(var e=arguments,r=[],n=0;n<arguments.length;n++)r[n]=e[n];return this.args=r,o(this.tasks)},t.prototype.tap=function(e,r){var n=this;this.tasks.push(function(a){r.apply(void 0,Mn([],Pr(n.args),!1)),a(null,e)})},t}(),E={exports:{}},L={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=$n.exports,n=gt(r),a=c.exports,u=gt(a),y=Xs.exports,A=gt(y),O=Ea.exports,Z=gt(O),Y=ua.exports,Q=gt(Y),ae=ti,xe=gt(ae),Be=na.exports,it=gt(Be);function gt(vr){return vr&&vr.__esModule?vr:{default:vr}}function Bt(vr,ln,cn){cn=(0,Z.default)(cn);var Gr=0,Pn=0,Oo=vr.length,Da=!1;Oo===0&&cn(null);function Bo(Oa,fl){Oa===!1&&(Da=!0),Da!==!0&&(Oa?cn(Oa):(++Pn===Oo||fl===u.default)&&cn(null))}for(;Gr<Oo;Gr++)ln(vr[Gr],Gr,(0,Q.default)(Bo))}function Rt(vr,ln,cn){return(0,A.default)(vr,1/0,ln,cn)}function Yt(vr,ln,cn){var Gr=(0,n.default)(vr)?Bt:Rt;return Gr(vr,(0,xe.default)(ln),cn)}e.default=(0,it.default)(Yt,3),t.exports=e.default})(L,L.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=A;var r=L.exports,n=y(r),a=Ai.exports,u=y(a);function y(O){return O&&O.__esModule?O:{default:O}}function A(O,Z){return(0,u.default)(n.default,O,Z)}t.exports=e.default}(E,E.exports);var V=yn(E.exports),X=function(){function t(){this.tasks=[]}return t.prototype.promise=function(){return V(this.tasks)},t.prototype.tapPromise=function(e,r){var n=this;this.tasks.push(function(a){return nr(n,void 0,void 0,function(){return br(this,function(u){switch(u.label){case 0:return[4,r()];case 1:return u.sent(),a(null,e),[2]}})})})},t}(),J={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=Ea.exports,n=Y(r),a=ua.exports,u=Y(a),y=ti,A=Y(y),O=na.exports,Z=Y(O);function Y(ae){return ae&&ae.__esModule?ae:{default:ae}}function Q(ae,xe){if(xe=(0,n.default)(xe),!Array.isArray(ae))return xe(new Error("First argument to waterfall must be an array of functions"));if(!ae.length)return xe();var Be=0;function it(Bt){var Rt=(0,A.default)(ae[Be++]);Rt.apply(void 0,Bt.concat([(0,u.default)(gt)]))}function gt(Bt){for(var Rt=[],Yt=arguments.length-1;Yt-- >0;)Rt[Yt]=arguments[Yt+1];if(Bt!==!1){if(Bt||Be===ae.length)return xe.apply(void 0,[Bt].concat(Rt));it(Rt)}}it([])}e.default=(0,Z.default)(Q),t.exports=e.default})(J,J.exports);var oe=yn(J.exports),me=function(){function t(){this.tasks=[]}return t.prototype.call=function(){return oe(this.tasks)},t.prototype.tap=function(e,r){this.tasks.length===0?this.tasks.push(function(n){var a=r();n(a?null:!1,a)}):this.tasks.push(function(n,a){var u=r.apply(void 0,Mn([],Pr(n),!1));a(u?null:!1,e)})},t}(),Me=function(){function t(){this.tasks=[]}return t.prototype.call=function(){return o(this.tasks)},t.prototype.tap=function(e,r){this.tasks.push(function(n){var a=r();n(a,e)})},t}(),De=function(){function t(){this.args=[],this.tasks=[]}return t.prototype.promise=function(){for(var e=arguments,r=[],n=0;n<arguments.length;n++)r[n]=e[n];return this.args=r,o(this.tasks)},t.prototype.tapPromise=function(e,r){var n=this;this.tasks.push(function(a){return nr(n,void 0,void 0,function(){return br(this,function(u){switch(u.label){case 0:return[4,r.apply(void 0,Mn([],Pr(this.args),!1))];case 1:return u.sent(),a(null,e),[2]}})})})},t}(),Ye=function(){function t(){this.args=[],this.tasks=[]}return t.prototype.promise=function(){for(var e=arguments,r=[],n=0;n<arguments.length;n++)r[n]=e[n];return this.args=r,o(this.tasks)},t.prototype.tapPromise=function(e,r){var n=this;this.tasks.push(function(a){return nr(n,void 0,void 0,function(){var u;return br(this,function(y){switch(y.label){case 0:return[4,r.apply(void 0,Mn([],Pr(this.args),!1))];case 1:return u=y.sent(),a(u,e),[2]}})})})},t}(),ot=function(){function t(){this.tasks=[]}return t.prototype.promise=function(){return oe(this.tasks)},t.prototype.tapPromise=function(e,r){this.tasks.length===0?this.tasks.push(function(n){r().then(function(a){n(null,a)})}):this.tasks.push(function(n,a){r(n).then(function(u){a(null,u)})})},t}(),lt=Se(28766),Ct=Se.n(lt);class Gt extends Yl.EventEmitter{get iconService(){return this.container.iconService}get fontService(){return this.container.fontService}get controlService(){return this.container.controlService}get configService(){return this.container.globalConfigService}get map(){return this.container.mapService}get coordinateSystemService(){return this.container.coordinateSystemService}get rendererService(){return this.container.rendererService}get layerService(){return this.container.layerService}get debugService(){return this.container.debugService}get cameraService(){return this.container.cameraService}get interactionService(){return this.container.interactionService}get pickingService(){return this.container.pickingService}get shaderModuleService(){return this.container.shaderModuleService}get markerService(){return this.container.markerService}get popupService(){return this.container.popupService}constructor(e){super(),(0,K.Z)(this,"destroyed",!1),(0,K.Z)(this,"loaded",!1),(0,K.Z)(this,"id",void 0),(0,K.Z)(this,"inited",!1),(0,K.Z)(this,"rendering",!1),(0,K.Z)(this,"$container",void 0),(0,K.Z)(this,"canvas",void 0),(0,K.Z)(this,"markerContainer",void 0),(0,K.Z)(this,"resizeDetector",void 0),(0,K.Z)(this,"hooks",void 0),(0,K.Z)(this,"handleWindowResized",()=>{this.emit("resize"),this.$container&&(this.initContainer(),this.coordinateSystemService.needRefresh=!0,this.render())}),(0,K.Z)(this,"handleMapCameraChanged",r=>{this.cameraService.update(r),this.render()}),this.container=e,this.hooks={init:new De},this.id=e.id}init(e){var r=this;this.configService.setSceneConfig(this.id,e),this.shaderModuleService.registerBuiltinModules(),this.iconService.init(),this.iconService.on("imageUpdate",()=>this.render()),this.fontService.init(),this.hooks.init.tapPromise("initMap",(0,Nr.Z)(function*(){r.debugService.log("map.mapInitStart",{type:r.map.version}),yield new Promise(n=>{r.map.onCameraChanged(a=>{r.cameraService.init(),r.cameraService.update(a),n()}),r.map.init()}),r.map.onCameraChanged(r.handleMapCameraChanged),r.map.addMarkerContainer(),r.markerService.addMarkers(),r.markerService.addMarkerLayers(),r.popupService.initPopup(),r.interactionService.init(),r.interactionService.on(zr.Drag,r.addSceneEvent.bind(r))})),this.hooks.init.tapPromise("initRenderer",(0,Nr.Z)(function*(){var n;const a=((n=r.map)===null||n===void 0?void 0:n.getOverlayContainer())||void 0;if(a?r.$container=a:r.$container=N(r.configService.getSceneConfig(r.id).id||""),r.$container){if(r.canvas=Xo("canvas","",r.$container),r.setCanvas(),yield r.rendererService.init(r.canvas,r.configService.getSceneConfig(r.id),e.gl),r.registerContextLost(),r.initContainer(),r.resizeDetector=Ct()({strategy:"scroll"}),r.resizeDetector.listenTo(r.$container,r.handleWindowResized),window.matchMedia){var u;(u=window.matchMedia("screen and (-webkit-min-device-pixel-ratio: 1.5)"))===null||u===void 0||u.addListener(r.handleWindowResized.bind("screen"))}}else console.error("\u5BB9\u5668 id \u4E0D\u5B58\u5728");r.pickingService.init(r.id)})),this.render()}registerContextLost(){const e=this.rendererService.getCanvas();e&&e.addEventListener("webglcontextlost",()=>this.emit("webglcontextlost"))}addLayer(e){this.layerService.sceneService=this,this.layerService.add(e)}addMask(e){this.layerService.sceneService=this,this.layerService.addMask(e)}render(){var e=this;return(0,Nr.Z)(function*(){e.rendering||e.destroyed||(e.rendering=!0,e.inited?(yield e.layerService.initLayers(),yield e.layerService.renderLayers()):(yield e.hooks.init.promise(),e.destroyed&&e.destroy(),yield e.layerService.initLayers(),e.layerService.renderLayers(),e.controlService.addControls(),e.loaded=!0,e.emit("loaded"),e.inited=!0),e.rendering=!1)})()}addFontFace(e,r){this.fontService.addFontFace(e,r)}getSceneContainer(){return this.$container}exportPng(e){var r=this;return(0,Nr.Z)(function*(){var n;const a=(n=r.$container)===null||n===void 0?void 0:n.getElementsByTagName("canvas")[0];return yield r.render(),e==="jpg"?a==null?void 0:a.toDataURL("image/jpeg"):a==null?void 0:a.toDataURL("image/png")})()}getSceneConfig(){return this.configService.getSceneConfig(this.id)}getPointSizeRange(){return this.rendererService.getPointSizeRange()}addMarkerContainer(){const e=this.$container.parentElement;e!==null&&(this.markerContainer=Xo("div","l7-marker-container",e))}getMarkerContainer(){return this.markerContainer}destroy(){var e;if(!this.inited){this.destroyed=!0;return}this.resizeDetector.removeListener(this.$container,this.handleWindowResized),this.pickingService.destroy(),this.layerService.destroy(),this.interactionService.destroy(),this.controlService.destroy(),this.markerService.destroy(),this.fontService.destroy(),this.iconService.destroy(),this.removeAllListeners(),this.inited=!1,this.map.destroy(),setTimeout(()=>{var r;(r=this.$container)===null||r===void 0||r.removeChild(this.canvas),this.canvas=null,this.rendererService.destroy()}),(e=this.$container)===null||e===void 0||(e=e.parentNode)===null||e===void 0||e.removeChild(this.$container),this.emit("destroy")}initContainer(){var e,r;const n=Ll,a=((e=this.$container)===null||e===void 0?void 0:e.clientWidth)||400,u=((r=this.$container)===null||r===void 0?void 0:r.clientHeight)||300,y=this.canvas;y&&(y.width=a*n,y.height=u*n),this.rendererService.viewport({x:0,y:0,width:n*a,height:n*u})}setCanvas(){var e,r;const n=Ll,a=((e=this.$container)===null||e===void 0?void 0:e.clientWidth)||400,u=((r=this.$container)===null||r===void 0?void 0:r.clientHeight)||300,y=this.canvas;y.width=a*n,y.height=u*n,y.style.width="100%",y.style.height="100%"}addSceneEvent(e){this.emit(e.type,e)}}const{uniq:Kt}=es,Er="#define PI 3.14159265359",cr=`#define ambientRatio 0.5
#define diffuseRatio 0.3
#define specularRatio 0.2
float calc_lighting(vec4 pos) {
vec3 worldPos = vec3(pos * u_ModelMatrix);
vec3 worldNormal = a_Normal;
// //cal light weight
vec3 viewDir = normalize(u_CameraPosition - worldPos);
vec3 lightDir = normalize(vec3(1, -10.5, 12));
vec3 halfDir = normalize(viewDir+lightDir);
// //lambert
float lambert = dot(worldNormal, lightDir);
//specular
float specular = pow(max(0.0, dot(worldNormal, halfDir)), 32.0);
//sum to light weight
float lightWeight = ambientRatio + diffuseRatio * lambert + specularRatio * specular;
return lightWeight;
}
`,Rr=`#define SHIFT_RIGHT17 1.0 / 131072.0
#define SHIFT_RIGHT18 1.0 / 262144.0
#define SHIFT_RIGHT19 1.0 / 524288.0
#define SHIFT_RIGHT20 1.0 / 1048576.0
#define SHIFT_RIGHT21 1.0 / 2097152.0
#define SHIFT_RIGHT22 1.0 / 4194304.0
#define SHIFT_RIGHT23 1.0 / 8388608.0
#define SHIFT_RIGHT24 1.0 / 16777216.0
#define SHIFT_LEFT17 131072.0
#define SHIFT_LEFT18 262144.0
#define SHIFT_LEFT19 524288.0
#define SHIFT_LEFT20 1048576.0
#define SHIFT_LEFT21 2097152.0
#define SHIFT_LEFT22 4194304.0
#define SHIFT_LEFT23 8388608.0
#define SHIFT_LEFT24 16777216.0
vec2 unpack_float(float packedValue) {
int packedIntValue = int(packedValue);
int v0 = packedIntValue / 256;
return vec2(v0, packedIntValue - v0 * 256);
}
vec4 decode_color(vec2 encodedColor) {
return vec4(
unpack_float(encodedColor[0]) / 255.0,
unpack_float(encodedColor[1]) / 255.0
);
}
`,Qr=`// Blinn-Phong model
// apply lighting in vertex shader instead of fragment shader
// @see https://learnopengl.com/Advanced-Lighting/Advanced-Lighting
uniform float u_Ambient : 1.0;
uniform float u_Diffuse : 1.0;
uniform float u_Specular : 1.0;
uniform int u_NumOfDirectionalLights : 1;
uniform int u_NumOfSpotLights : 0;
#define SHININESS 32.0
#define MAX_NUM_OF_DIRECTIONAL_LIGHTS 3
#define MAX_NUM_OF_SPOT_LIGHTS 3
struct DirectionalLight {
vec3 direction;
vec3 ambient;
vec3 diffuse;
vec3 specular;
};
struct SpotLight {
vec3 position;
vec3 direction;
vec3 ambient;
vec3 diffuse;
vec3 specular;
float constant;
float linear;
float quadratic;
float angle;
float blur;
float exponent;
};
uniform DirectionalLight u_DirectionalLights[MAX_NUM_OF_DIRECTIONAL_LIGHTS];
uniform SpotLight u_SpotLights[MAX_NUM_OF_SPOT_LIGHTS];
vec3 calc_directional_light(DirectionalLight light, vec3 normal, vec3 viewDir) {
vec3 lightDir = normalize(light.direction);
// diffuse shading
float diff = max(dot(normal, lightDir), 0.0);
// Blinn-Phong specular shading
vec3 halfwayDir = normalize(lightDir + viewDir);
float spec = pow(max(dot(normal, halfwayDir), 0.0), SHININESS);
vec3 ambient = light.ambient * u_Ambient;
vec3 diffuse = light.diffuse * diff * u_Diffuse;
vec3 specular = light.specular * spec * u_Specular;
return ambient + diffuse + specular;
}
vec3 calc_lighting(vec3 position, vec3 normal, vec3 viewDir) {
vec3 weight = vec3(0.0);
for (int i = 0; i < MAX_NUM_OF_DIRECTIONAL_LIGHTS; i++) {
if (i >= u_NumOfDirectionalLights) {
break;
}
weight += calc_directional_light(u_DirectionalLights[i], normal, viewDir);
}
return weight;
}
`,Fn=`
in vec4 v_PickingResult;
#pragma include "picking_uniforms"
#define PICKING_NONE 0.0
#define PICKING_ENCODE 1.0
#define PICKING_HIGHLIGHT 2.0
#define COLOR_SCALE 1. / 255.
#define HIGHLIGHT 1.0
#define SELECT 2.0
/*
* Returns highlight color if this item is selected.
*/
vec4 filterHighlightColor(vec4 color, float weight) {
float activeType = v_PickingResult.a;
if(activeType > 0.0) {
vec4 highLightColor = activeType > 1.5 ? u_SelectColor : u_HighlightColor;
highLightColor = highLightColor * COLOR_SCALE;
float highLightAlpha = highLightColor.a;
float highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha));
vec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);
return vec4(mix(resultRGB * weight, color.rgb, u_activeMix), color.a);
}
else {
return color;
}
}
/*
* Returns picking color if picking enabled else unmodified argument.
*/
vec4 filterPickingColor(vec4 color) {
vec3 pickingColor = v_PickingResult.rgb;
if (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) {
discard;
}
return u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color;
}
/*
* Returns picking color if picking is enabled if not
* highlight color if this item is selected, otherwise unmodified argument.
*/
vec4 filterColor(vec4 color) {
// \u8FC7\u6EE4\u591A\u4F59\u7684 shader \u8BA1\u7B97
// return color;
if(u_shaderPick < 0.5) {
return color; // \u6682\u65F6\u53BB\u9664 \u76F4\u63A5\u53D6\u6D88\u8BA1\u7B97\u5728\u9009\u4E2D\u65F6\u62D6\u62FD\u5730\u56FE\u4F1A\u6709\u95EE\u9898
} else {
return filterPickingColor(filterHighlightColor(color, 1.0));
}
}
vec4 filterColorAlpha(vec4 color, float alpha) {
// \u8FC7\u6EE4\u591A\u4F59\u7684 shader \u8BA1\u7B97
// return color;
if(u_shaderPick < 0.5) {
return color; // \u6682\u65F6\u53BB\u9664 \u76F4\u63A5\u53D6\u6D88\u8BA1\u7B97\u5728\u9009\u4E2D\u65F6\u62D6\u62FD\u5730\u56FE\u4F1A\u6709\u95EE\u9898
} else {
return filterPickingColor(filterHighlightColor(color, alpha));
}
}
`,Ki=`layout(location = 3) in vec3 a_PickingColor;
out vec4 v_PickingResult;
#pragma include "picking_uniforms"
#define PICKING_NONE 0.0
#define PICKING_ENCODE 1.0
#define PICKING_HIGHLIGHT 2.0
#define COLOR_SCALE 1. / 255.
#define NORMAL 0.0
#define HIGHLIGHT 1.0
#define SELECT 2.0
bool isVertexPicked(vec3 vertexColor) {
return distance(vertexColor,u_PickingColor.rgb) < 0.01;
}
// \u5224\u65AD\u5F53\u524D\u70B9\u662F\u5426\u5DF2\u7ECF\u88AB select \u9009\u4E2D
bool isVertexSelected(vec3 vertexColor) {
return distance(vertexColor,u_CurrentSelectedId.rgb) < 0.01;
}
void setPickingColor(vec3 pickingColor) {
if(u_shaderPick < 0.5) {
return;
}
// compares only in highlight stage
if(u_PickingStage == PICKING_HIGHLIGHT) {
if(isVertexPicked(pickingColor)) {
v_PickingResult = vec4(pickingColor.rgb * COLOR_SCALE,HIGHLIGHT);
return;
}
if(isVertexSelected(pickingColor)) {
v_PickingResult = vec4(u_CurrentSelectedId.rgb * COLOR_SCALE,SELECT);
return;
}
} else {
v_PickingResult= vec4(pickingColor.rgb * COLOR_SCALE,NORMAL);
return;
}
// // v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && (isVertexPicked(pickingColor) || isVertexPicked(u_CurrentSelectedId)));
// // Stores the picking color so that the fragment shader can render it during picking
// v_PickingResult.rgb = pickingColor * COLOR_SCALE;
}
float setPickingSize(float x) {
return u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x;
}
float setPickingOrder(float z) {
bool selected = bool(v_PickingResult.a);
return selected ? z + 1. : 0.;
}
`,Co=`layout(std140) uniform PickingUniforms {
vec4 u_HighlightColor;
vec4 u_SelectColor;
vec3 u_PickingColor;
float u_PickingStage;
vec3 u_CurrentSelectedId;
float u_PickingThreshold;
float u_PickingBuffer;
float u_shaderPick;
float u_activeMix;
};`,$i=`
#define E 2.718281828459045
vec2 ProjectFlat(vec2 lnglat){
float maxs=85.0511287798;
float lat=max(min(maxs,lnglat.y),-maxs);
float scale= 268435456.;
float d=PI/180.;
float x=lnglat.x*d;
float y=lat*d;
y=log(tan((PI/4.)+(y/2.)));
float a=.5/PI,
b=.5,
c=-.5/PI;
d=.5;
x=scale*(a*x+b);
y=scale*(c*y+d);
return vec2(x,y);
}
vec2 unProjectFlat(vec2 px){
float a=.5/PI;
float b=.5;
float c=-.5/PI;
float d=.5;
float scale = 268435456.;
float x=(px.x/scale-b)/a;
float y=(px.y/scale-d)/c;
y=(atan(pow(E,y))-(PI/4.))*2.;
d=PI/180.;
float lat=y/d;
float lng=x/d;
return vec2(lng,lat);
}
float pixelDistance(vec2 from, vec2 to) {
vec2 a1 = ProjectFlat(from);
vec2 b1 = ProjectFlat(to);
return distance(a1, b1);
}
// gaode2.0
vec2 customProject(vec2 lnglat) { // \u7ECF\u7EAC\u5EA6 => \u5E73\u9762\u5750\u6807
float t = lnglat.x;
float e = lnglat.y;
float Sm = 180.0 / PI;
float Tm = 6378137.0;
float Rm = PI / 180.0;
float r = 85.0511287798;
e = max(min(r, e), -r);
t *= Rm;
e *= Rm;
e = log(tan(PI / 4.0 + e / 2.0));
return vec2(t * Tm, e * Tm);
}
vec2 unProjCustomCoord(vec2 point) { // \u5E73\u9762\u5750\u6807 => \u7ECF\u7EAC\u5EA6
float Sm = 57.29577951308232; //180 / Math.PI
float Tm = 6378137.0;
float t = point.x;
float e = point.y;
return vec2(t / Tm * Sm, (2.0 * atan(exp(e / Tm)) - PI / 2.0) * Sm);
}
float customPixelDistance(vec2 from, vec2 to) {
vec2 a1 = ProjectFlat(from);
vec2 b1 = ProjectFlat(to);
return distance(a1, b1);
}`,Zi=`#define TILE_SIZE 512.0
#define PI 3.1415926536
#define WORLD_SCALE TILE_SIZE / (PI * 2.0)
#define EARTH_CIRCUMFERENCE 40.03e6
#define COORDINATE_SYSTEM_LNGLAT 1.0 // mapbox
#define COORDINATE_SYSTEM_LNGLAT_OFFSET 2.0 // mapbox offset
#define COORDINATE_SYSTEM_VECTOR_TILE 3.0
#define COORDINATE_SYSTEM_IDENTITY 4.0
#define COORDINATE_SYSTEM_P20 5.0 // amap
#define COORDINATE_SYSTEM_P20_OFFSET 6.0 // amap offset
#define COORDINATE_SYSTEM_METER_OFFSET 7.0
#define COORDINATE_SYSTEM_P20_2 8.0 // amap2.0
#pragma include "scene_uniforms"
// web mercator coords -> world coords
vec2 project_mercator(vec2 lnglat) {
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.0
return lnglat;
}
float x = lnglat.x;
return vec2(
radians(x) + PI,
PI - log(tan(PI * 0.25 + radians(lnglat.y) * 0.5))
);
}
float project_scale(float meters) {
return meters * u_PixelsPerMeter.z;
}
// offset coords -> world coords
vec4 project_offset(vec4 offset) {
float dy = offset.y;
dy = clamp(dy, -1., 1.);
vec3 pixels_per_unit = u_PixelsPerDegree + u_PixelsPerDegree2 * dy;
return vec4(offset.xyz * pixels_per_unit, offset.w);
}
vec3 project_normal(vec3 normal) {
vec4 normal_modelspace = u_ModelMatrix * vec4(normal, 0.0);
return normalize(normal_modelspace.xyz * u_PixelsPerMeter);
}
vec3 project_offset_normal(vec3 vector) {
if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01
|| u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
// normals generated by the polygon tesselator are in lnglat offsets instead of meters
return normalize(vector * u_PixelsPerDegree);
}
return project_normal(vector);
}
// || u_CoordinateSystem < COORDINATE_SYSTEM_P20_OFFSET + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_P20_OFFSET - 0.01
// reverse Y
vec3 reverse_offset_normal(vec3 vector) {
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 ||u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET ) {
return vector * vec3(1.0, -1.0, 1.0);
}
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.0
return vector;
}
return vector;
}
vec4 project_mvt_offset_position(vec4 position) {
float a = COORDINATE_SYSTEM_LNGLAT_OFFSET;
float b = COORDINATE_SYSTEM_P20_OFFSET;
float c = COORDINATE_SYSTEM_LNGLAT;
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
return project_offset(vec4(0.0, 0.0, position.z, position.w));
}
if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01) {
return vec4(
project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale,
project_scale(position.z),
position.w
);
}
return position;
}
vec4 project_position(vec4 position) {
float a = COORDINATE_SYSTEM_LNGLAT_OFFSET;
float b = COORDINATE_SYSTEM_P20_OFFSET;
float c = COORDINATE_SYSTEM_LNGLAT;
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET
|| u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
float X = position.x - u_ViewportCenter.x;
float Y = position.y - u_ViewportCenter.y;
return project_offset(vec4(X, Y, position.z, position.w));
}
if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01) {
return vec4(
project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale,
project_scale(position.z),
position.w
);
}
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20) {
return vec4(
(project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale - vec2(215440491., 106744817.)) * vec2(1., -1.),
project_scale(position.z),
position.w
);
}
// if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
// return vec4(
// position.xy,
// project_scale(position.z),
// position.w);
// }
return position;
// TODO: \u74E6\u7247\u5750\u6807\u7CFB & \u5E38\u89C4\u4E16\u754C\u5750\u6807\u7CFB
}
vec2 project_pixel_size_to_clipspace(vec2 pixels) {
vec2 offset = pixels / u_ViewportSize * u_DevicePixelRatio * 2.0;
return offset * u_FocalDistance;
}
float project_pixel_allmap(float pixel) {
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {
return pixel * pow(2.0, u_Zoom);
}
return pixel * u_FocalDistance ;
}
// \u9002\u914D\u7EB9\u7406\u8D34\u56FE\u7684\u7B49\u50CF\u7D20\u5927\u5C0F
float project_pixel_texture(float pixel) {
// mapbox zoom > 12
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
return pixel * pow(0.5, u_Zoom) * u_FocalDistance ;
}
// amap2 zoom > 12
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom))* u_FocalDistance ;
}
// amap zoom > 12
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
return pixel * pow(0.5, u_Zoom)* u_FocalDistance ;
}
// amap zoom < 12
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20) {
return pixel * pow(2.0, (20.0 - u_Zoom))* u_FocalDistance ;
}
return pixel * 2.0 * u_FocalDistance;;
}
// \u5728\u4E0D\u8BBA\u4EC0\u4E48\u5E95\u56FE\u4E0B\u9700\u8981\u7EDF\u4E00\u5904\u7406\u7684\u65F6\u5019\u4F7F\u7528
float project_float_pixel(float pixel) {
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
// mapbox P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1
return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ;
}
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
// amap P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1
return pixel * pow(2.0, (19.0 - u_Zoom));
}
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
// amap2 P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom))* u_FocalDistance ;
}
return pixel * u_FocalDistance;
}
// Project meter into the unit of pixel which used in the camera world space
float project_float_meter(float meter) {
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
// Since the zoom level uniform is updated by mapservice and it's alread been subtracted by 1
// Not sure if we are supposed to do that again
return meter;
} else {
return project_float_pixel(meter);
}
// TODO: change the following code to make adaptations for amap
// return u_FocalDistance * TILE_SIZE * pow(2.0, u_Zoom) * meter / EARTH_CIRCUMFERENCE;
}
float project_pixel(float pixel) {
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
// amap P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1
return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ;
}
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
// amap2 P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom)) * u_FocalDistance ;
}
return pixel * u_FocalDistance;
}
vec2 project_pixel(vec2 pixel) {
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
// P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1
return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ;
}
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
// P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom)) * u_FocalDistance ;
}
return pixel * -1. * u_FocalDistance;
}
vec3 project_pixel(vec3 pixel) {
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
// P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1
return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ;
}
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
// P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom)) * u_FocalDistance ;
}
return pixel * -1. * u_FocalDistance;
}
vec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {
if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET ||
u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
// Needs to be divided with project_uCommonUnitsPerMeter
position.w *= u_PixelsPerMeter.z;
}
return viewProjectionMatrix * position + center;
}
// Projects from common space coordinates to clip space
vec4 project_common_position_to_clipspace(vec4 position) {
return project_common_position_to_clipspace(
position,
u_ViewProjectionMatrix,
u_ViewportCenterProjection
);
}
vec4 unproject_clipspace_to_position(vec4 clipspacePos, mat4 u_InverseViewProjectionMatrix) {
vec4 pos = u_InverseViewProjectionMatrix * (clipspacePos - u_ViewportCenterProjection);
if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET ||
u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
// Needs to be divided with project_uCommonUnitsPerMeter
pos.w = pos.w / u_PixelsPerMeter.z;
}
return pos;
}
bool isEqual( float a, float b) {
return a< b + 0.001 && a > b - 0.001;
}
// \u652F\u6301 GaodeV2\u3001Mapbox
vec4 project_common_position_to_clipspace_v2(vec4 position) {
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
return u_Mvp * position;
} else {
return project_common_position_to_clipspace(position);
}
}
`,Ri=`vec2 rotate_matrix(vec2 v, float a) {
float b = a / 180.0 * 3.1415926535897932384626433832795;
float s = sin(b);
float c = cos(b);
mat2 m = mat2(c, s, -s, c);
return m * v;
}`,vo=`layout(std140) uniform SceneUniforms {
mat4 u_ViewMatrix;
mat4 u_ProjectionMatrix;
mat4 u_ViewProjectionMatrix;
mat4 u_ModelMatrix;
vec4 u_ViewportCenterProjection;
vec3 u_PixelsPerDegree;
float u_Zoom;
vec3 u_PixelsPerDegree2;
float u_ZoomScale;
vec3 u_PixelsPerMeter;
float u_CoordinateSystem;
vec3 u_CameraPosition;
float u_DevicePixelRatio;
vec2 u_ViewportCenter;
vec2 u_ViewportSize;
float u_FocalDistance;
};
layout(std140) uniform LayerUniforms {
mat4 u_Mvp;
vec2 u_sceneCenterMercator;
};
`,Ii=`/**
* 2D signed distance field functions
* @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm
*/
float ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }
float sdCircle(vec2 p, float r) {
return length(p) - r;
}
float sdEquilateralTriangle(vec2 p) {
float k = sqrt(3.0);
p.x = abs(p.x) - 1.0;
p.y = p.y + 1.0/k;
if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;
p.x -= clamp( p.x, -2.0, 0.0 );
return -length(p)*sign(p.y);
}
float sdBox(vec2 p, vec2 b) {
vec2 d = abs(p)-b;
return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);
}
float sdPentagon(vec2 p, float r) {
vec3 k = vec3(0.809016994,0.587785252,0.726542528);
p.x = abs(p.x);
p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);
p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);
p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);
return length(p)*sign(p.y);
}
float sdHexagon(vec2 p, float r) {
vec3 k = vec3(-0.866025404,0.5,0.577350269);
p = abs(p);
p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;
p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);
return length(p)*sign(p.y);
}
float sdOctogon(vec2 p, float r) {
vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );
p = abs(p);
p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);
p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);
p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);
return length(p)*sign(p.y);
}
float sdHexagram(vec2 p, float r) {
vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);
p = abs(p);
p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;
p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;
p -= vec2(clamp(p.x,r*k.z,r*k.w),r);
return length(p)*sign(p.y);
}
float sdRhombus(vec2 p, vec2 b) {
vec2 q = abs(p);
float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);
float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );
return d * sign( q.x*b.y + q.y*b.x - b.x*b.y );
}
float sdVesica(vec2 p, float r, float d) {
p = abs(p);
float b = sqrt(r*r-d*d); // can delay this sqrt
return ((p.y-b)*d>p.x*b)
? length(p-vec2(0.0,b))
: length(p-vec2(-d,0.0))-r;
}
`,ni=/precision\s+(high|low|medium)p\s+float/,jo=`#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
`,Do=/#pragma include (["^+"]?["[a-zA-Z_0-9](.*)"]*?)/g,rs=/void\s+main\s*\([^)]*\)\s*\{\n?/;class iu{constructor(){(0,K.Z)(this,"moduleCache",{}),(0,K.Z)(this,"rawContentCache",{})}registerBuiltinModules(){this.destroy(),this.registerModule("common",{vs:Er,fs:Er}),this.registerModule("decode",{vs:Rr,fs:""}),this.registerModule("scene_uniforms",{vs:vo,fs:vo}),this.registerModule("picking_uniforms",{vs:Co,fs:Co}),this.registerModule("projection",{vs:Zi,fs:Zi}),this.registerModule("project",{vs:$i,fs:""}),this.registerModule("sdf_2d",{vs:"",fs:Ii}),this.registerModule("lighting",{vs:Qr,fs:""}),this.registerModule("light",{vs:cr,fs:""}),this.registerModule("picking",{vs:Ki,fs:Fn}),this.registerModule("rotation_2d",{vs:Ri,fs:""})}registerModule(e,r){r.vs=r.vs.replace(/\r\n/g,`
`),r.fs=r.fs.replace(/\r\n/g,`
`);const{vs:n,fs:a,uniforms:u,inject:y}=r,{content:A,uniforms:O}=ps(n),{content:Z,uniforms:Y}=ps(a);this.rawContentCache[e]={fs:Z,inject:y,uniforms:(0,Wt.Z)((0,Wt.Z)((0,Wt.Z)({},O),Y),u),vs:A}}destroy(){this.moduleCache={},this.rawContentCache={}}getModule(e){let r=this.rawContentCache[e].vs,n=this.rawContentCache[e].fs;const a=this.rawContentCache[e].inject;let u={};a!=null&&a["vs:#decl"]&&(r=(a==null?void 0:a["vs:#decl"])+r,u=ps(a==null?void 0:a["vs:#decl"]).uniforms),a!=null&&a["vs:#main-start"]&&(r=r.replace(rs,xe=>xe+(a==null?void 0:a["vs:#main-start"]))),a!=null&&a["fs:#decl"]&&(n=(a==null?void 0:a["fs:#decl"])+n);const{content:y,includeList:A}=this.processModule(r,[],"vs"),{content:O,includeList:Z}=this.processModule(n,[],"fs");let Y="";const Q=Kt(A.concat(Z).concat(e)).reduce((xe,Be)=>(0,Wt.Z)((0,Wt.Z)({},xe),this.rawContentCache[Be].uniforms),(0,Wt.Z)({},u));ni.test(O)||(Y=Y+jo),Y=Y+O;let ae="";return ni.test(y)||(ae=ae+jo),ae=ae+y,this.moduleCache[e]={fs:Y.trim(),uniforms:Q,vs:ae.trim()},this.moduleCache[e]}processModule(e,r,n){return{content:e.replace(Do,(u,y)=>{const O=y.split(" ")[0].replace(/"/g,"");if(r.indexOf(O)>-1)return"";const Z=this.rawContentCache[O][n];r.push(O);const{content:Y}=this.processModule(Z,r,n);return Y}),includeList:r}}injectDefines(e){return Object.keys(e).reduce((n,a)=>n+`#define ${a.toUpperCase()} ${e[a]};
`,`
`)}}class tl{constructor(){(0,K.Z)(this,"shaderModuleService",void 0),(0,K.Z)(this,"rendererService",void 0),(0,K.Z)(this,"cameraService",void 0),(0,K.Z)(this,"mapService",void 0),(0,K.Z)(this,"interactionService",void 0),(0,K.Z)(this,"layerService",void 0),(0,K.Z)(this,"config",void 0)}getName(){return""}getType(){return Ei.Normal}init(e,r){this.config=r,this.rendererService=e.getContainer().rendererService,this.cameraService=e.getContainer().cameraService,this.mapService=e.getContainer().mapService,this.interactionService=e.getContainer().interactionService,this.layerService=e.getContainer().layerService,this.shaderModuleService=e.getContainer().shaderModuleService}render(e){}}class gc extends tl{getName(){return"clear"}init(e,r){super.init(e,r)}render(){this.rendererService.clear({color:[0,0,0,0],depth:1,framebuffer:null})}}class Pp{constructor(e){(0,K.Z)(this,"passes",[]),(0,K.Z)(this,"layer",void 0),(0,K.Z)(this,"renderFlag",void 0),(0,K.Z)(this,"width",0),(0,K.Z)(this,"height",0),this.postProcessor=e}setLayer(e){this.layer=e}setRenderFlag(e){this.renderFlag=e}getRenderFlag(){return this.renderFlag}getPostProcessor(){return this.postProcessor}render(){var e=this;return(0,Nr.Z)(function*(){for(const r of e.passes)yield r.render(e.layer);yield e.postProcessor.render(e.layer)})()}resize(e,r){(this.width!==e||this.height!==r)&&(this.postProcessor.resize(e,r),this.width=e,this.height=r)}add(e,r){e.getType()===Ei.PostProcessing?this.postProcessor.add(e,this.layer,r):(e.init(this.layer,r),this.passes.push(e))}insert(e,r,n){e.init(this.layer,r),this.passes.splice(n,0,e)}destroy(){this.passes.length=0}}class sp extends tl{constructor(...e){var r;super(...e),r=this,(0,K.Z)(this,"pickingFBO",void 0),(0,K.Z)(this,"layer",void 0),(0,K.Z)(this,"width",0),(0,K.Z)(this,"height",0),(0,K.Z)(this,"alreadyInRendering",!1),(0,K.Z)(this,"pickFromPickingFBO",({x:n,y:a,lngLat:u,type:y})=>{if(!this.layer.isVisible()||!this.layer.needPick(y))return;const{getViewportSize:A,readPixelsAsync:O,useFramebuffer:Z}=this.rendererService,{width:Y,height:Q}=A(),{enableHighlight:ae,enableSelect:xe}=this.layer.getLayerConfig(),Be=n*Ll,it=a*Ll;if(Be>Y||Be<0||it>Q||it<0)return;let gt;Z(this.pickingFBO,(0,Nr.Z)(function*(){var Bt;if(gt=yield O({x:Math.round(Be),y:Math.round(Q-(a+1)*Ll),width:1,height:1,data:new Uint8Array(1*1*4),framebuffer:r.pickingFBO}),gt[0]!==0||gt[1]!==0||gt[2]!==0){const Rt=Aa(gt),Yt=r.layer.getSource().getFeatureById(Rt),vr={x:n,y:a,type:y,lngLat:u,featureId:Rt,feature:Yt};Yt&&(r.layer.setCurrentPickId(Rt),r.triggerHoverOnLayer(vr))}else{const Rt={x:n,y:a,lngLat:u,type:r.layer.getCurrentPickId()===null?"un"+y:"mouseout",featureId:null,feature:null};r.triggerHoverOnLayer((0,Wt.Z)((0,Wt.Z)({},Rt),{},{type:"unpick"})),r.triggerHoverOnLayer(Rt),r.layer.setCurrentPickId(null)}ae&&r.highlightPickedFeature(gt),xe&&y==="click"&&((Bt=gt)===null||Bt===void 0?void 0:Bt.toString())!==[0,0,0,0].toString()&&r.selectFeature(gt)}))})}getType(){return Ei.Normal}getName(){return"pixelPicking"}init(e,r){super.init(e,r),this.layer=e;const{createTexture2D:n,createFramebuffer:a,getViewportSize:u}=this.rendererService,{width:y,height:A}=u(),O=n({width:y,height:A,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE,label:"Picking Texture"});this.pickingFBO=a({color:O}),this.interactionService.on(zr.Hover,this.pickFromPickingFBO),this.interactionService.on(zr.Select,this.selectFeatureHandle.bind(this)),this.interactionService.on(zr.Active,this.highlightFeatureHandle.bind(this))}render(e){if(this.alreadyInRendering)return;const{getViewportSize:r,useFramebuffer:n,clear:a}=this.rendererService,{width:u,height:y}=r();this.alreadyInRendering=!0,(this.width!==u||this.height!==y)&&(this.pickingFBO.resize({width:u,height:y}),this.width=u,this.height=y),n(this.pickingFBO,()=>{a({framebuffer:this.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});const A=this.layer.multiPassRenderer.getRenderFlag();this.layer.multiPassRenderer.setRenderFlag(!1),e.hooks.beforePickingEncode.call(),e.render(),e.hooks.afterPickingEncode.call(),this.layer.multiPassRenderer.setRenderFlag(A),this.alreadyInRendering=!1})}triggerHoverOnLayer(e){this.layer.emit(e.type,e)}highlightPickedFeature(e){const[r,n,a]=e;this.layer.hooks.beforeHighlight.call([r,n,a]),this.layerService.renderLayers()}selectFeature(e){const[r,n,a]=e;this.layer.hooks.beforeSelect.call([r,n,a]),this.layerService.renderLayers()}selectFeatureHandle({featureId:e}){const r=Ni(e);this.selectFeature(new Uint8Array(r))}highlightFeatureHandle({featureId:e}){const r=Ni(e);this.highlightPickedFeature(new Uint8Array(r))}}class kc{constructor(e){(0,K.Z)(this,"passes",[]),(0,K.Z)(this,"readFBO",void 0),(0,K.Z)(this,"writeFBO",void 0),this.rendererService=e,this.init()}getReadFBO(){return this.readFBO}getWriteFBO(){return this.writeFBO}getCurrentFBOTex(){const{getViewportSize:e,createTexture2D:r}=this.rendererService,{width:n,height:a}=e();return r({x:0,y:0,width:n,height:a,copy:!0})}getReadFBOTex(){var e=this;const{useFramebuffer:r}=this.rendererService;return new Promise(n=>{r(this.readFBO,(0,Nr.Z)(function*(){n(e.getCurrentFBOTex())}))})}renderBloomPass(e,r){var n=this;return(0,Nr.Z)(function*(){const a=yield n.getReadFBOTex();let u=0;for(;u<4;)yield r.render(e,a),n.swap(),u++})()}render(e){var r=this;return(0,Nr.Z)(function*(){for(let n=0;n<r.passes.length;n++){const a=r.passes[n];a.setRenderToScreen(r.isLastEnabledPass(n)),a.getName()==="bloom"?yield r.renderBloomPass(e,a):(yield a.render(e),n!==r.passes.length-1&&r.swap())}})()}resize(e,r){this.readFBO.resize({width:e,height:r}),this.writeFBO.resize({width:e,height:r})}add(e,r,n){e.init(r,n),this.passes.push(e)}insert(e,r,n,a){e.init(n,a),this.passes.splice(r,0,e)}getPostProcessingPassByName(e){return this.passes.find(r=>r.getName()===e)}init(){const{createFramebuffer:e,createTexture2D:r}=this.rendererService;this.readFBO=e({color:r({width:1,height:1,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE})}),this.writeFBO=e({color:r({width:1,height:1,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE})})}isLastEnabledPass(e){for(let r=e+1;r<this.passes.length;r++)if(this.passes[r].isEnabled())return!1;return!0}swap(){const e=this.readFBO;this.readFBO=this.writeFBO,this.writeFBO=e}}class gh extends tl{getType(){return Ei.Normal}getName(){return"render"}init(e,r){super.init(e,r)}render(e){const{useFramebuffer:r,clear:n}=this.rendererService,a=e.multiPassRenderer.getPostProcessor().getReadFBO();r(a,()=>{n({color:[0,0,0,0],depth:1,stencil:0,framebuffer:a}),e.multiPassRenderer.setRenderFlag(!1),e.models.forEach(u=>{u.draw({uniforms:e.layerModel.getUninforms()})}),e.multiPassRenderer.setRenderFlag(!0)})}}const lp=`uniform float u_opacity : 1.0;
uniform float u_MixRatio : 0.5;
uniform sampler2D u_Diffuse1;
uniform sampler2D u_Diffuse2;
varying vec2 v_UV;
void main() {
vec4 texel1 = texture2D(u_Diffuse1, v_UV);
vec4 texel2 = texture2D(u_Diffuse2, v_UV);
gl_FragColor = u_opacity * mix(texel1, texel2, u_MixRatio);
}
`,vh=`varying vec2 v_UV;
uniform sampler2D u_Texture;
void main() {
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
}`,Ys=`attribute vec2 a_Position;
varying vec2 v_UV;
void main() {
v_UV = 0.5 * (a_Position + 1.0);
gl_Position = vec4(a_Position, 0., 1.);
}`;function jl(t,e){let r=0,n=1/e,a=t;for(;a>0;)r=r+n*(a%e),a=Math.floor(a/e),n=n/e;return r}let _h=1;class vc extends tl{constructor(e){super(),(0,K.Z)(this,"haltonSequence",[]),(0,K.Z)(this,"accumulatingId",0),(0,K.Z)(this,"frame",0),(0,K.Z)(this,"timer",void 0),(0,K.Z)(this,"sampleRenderTarget",void 0),(0,K.Z)(this,"prevRenderTarget",void 0),(0,K.Z)(this,"outputRenderTarget",void 0),(0,K.Z)(this,"copyRenderTarget",void 0),(0,K.Z)(this,"blendModel",void 0),(0,K.Z)(this,"outputModel",void 0),(0,K.Z)(this,"copyModel",void 0),this.shaderModuleService=e}getType(){return Ei.Normal}getName(){return"taa"}init(e,r){super.init(e,r);const{createFramebuffer:n,createTexture2D:a}=this.rendererService;this.sampleRenderTarget=n({color:a({width:1,height:1,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE})}),this.prevRenderTarget=n({color:a({width:1,height:1,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE})}),this.outputRenderTarget=n({color:a({width:1,height:1,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE})}),this.copyRenderTarget=n({color:a({width:1,height:1,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE})});for(let u=0;u<30;u++)this.haltonSequence.push([jl(u,2),jl(u,3)]);this.blendModel=this.createTriangleModel("blend-pass",lp),this.outputModel=this.createTriangleModel("copy-pass",vh,{blend:{enable:!0,func:{srcRGB:Ee.ONE,dstRGB:Ee.ONE_MINUS_SRC_ALPHA,srcAlpha:Ee.ONE,dstAlpha:Ee.ONE_MINUS_SRC_ALPHA},equation:{rgb:Ee.FUNC_ADD,alpha:Ee.FUNC_ADD}}}),this.copyModel=this.createTriangleModel("copy-pass",vh)}render(e){const{clear:r,getViewportSize:n,useFramebuffer:a}=this.rendererService,{width:u,height:y}=n();this.sampleRenderTarget.resize({width:u,height:y}),this.prevRenderTarget.resize({width:u,height:y}),this.outputRenderTarget.resize({width:u,height:y}),this.copyRenderTarget.resize({width:u,height:y}),this.resetFrame(),this.stopAccumulating();const A=e.multiPassRenderer.getPostProcessor().getReadFBO();a(A,()=>{r({color:[0,0,0,0],depth:1,stencil:0,framebuffer:A}),e.multiPassRenderer.setRenderFlag(!1),e.render(),e.multiPassRenderer.setRenderFlag(!0)});const O=Z=>{!this.accumulatingId||Z!==this.accumulatingId||this.isFinished()||(this.doRender(e),window.requestAnimationFrame(()=>{O(Z)}))};this.accumulatingId=_h++,this.timer=window.setTimeout(()=>{O(this.accumulatingId)},50)}doRender(e){const{clear:r,getViewportSize:n,useFramebuffer:a}=this.rendererService,{width:u,height:y}=n(),{jitterScale:A=1}=e.getLayerConfig(),O=this.haltonSequence[this.frame%this.haltonSequence.length];this.cameraService.jitterProjectionMatrix((O[0]*2-1)/u*A,(O[1]*2-1)/y*A),e.multiPassRenderer.setRenderFlag(!1),e.hooks.beforeRender.call(),a(this.sampleRenderTarget,()=>{r({color:[0,0,0,0],depth:1,stencil:0,framebuffer:this.sampleRenderTarget}),e.render()}),e.hooks.afterRender.call(),e.multiPassRenderer.setRenderFlag(!0);const Z=e.getLayerConfig();a(this.outputRenderTarget,()=>{this.blendModel.draw({uniforms:{u_opacity:Z.opacity||1,u_MixRatio:this.frame===0?1:.9,u_Diffuse1:this.sampleRenderTarget,u_Diffuse2:this.frame===0?e.multiPassRenderer.getPostProcessor().getReadFBO():this.prevRenderTarget}})}),this.frame===0&&r({color:[0,0,0,0],depth:1,stencil:0,framebuffer:this.copyRenderTarget}),this.frame>=1&&(a(this.copyRenderTarget,()=>{this.outputModel.draw({uniforms:{u_Texture:this.outputRenderTarget}})}),a(e.multiPassRenderer.getPostProcessor().getReadFBO(),()=>{this.copyModel.draw({uniforms:{u_Texture:this.copyRenderTarget}})}),e.multiPassRenderer.getPostProcessor().render(e));const Y=this.prevRenderTarget;this.prevRenderTarget=this.outputRenderTarget,this.outputRenderTarget=Y,this.frame++,this.cameraService.clearJitterProjectionMatrix()}isFinished(){return this.frame>=this.haltonSequence.length}resetFrame(){this.frame=0}stopAccumulating(){this.accumulatingId=0,window.clearTimeout(this.timer)}createTriangleModel(e,r,n){this.shaderModuleService.registerModule(e,{vs:Ys,fs:r});const{vs:a,fs:u,uniforms:y}=this.shaderModuleService.getModule(e),{createAttribute:A,createBuffer:O,createModel:Z}=this.rendererService;return Z((0,Wt.Z)({vs:a,fs:u,attributes:{a_Position:A({buffer:O({data:[-4,-4,4,-4,0,4],type:Ee.FLOAT}),size:2})},uniforms:(0,Wt.Z)({},y),depth:{enable:!1},count:3},n))}}const xp=`varying vec2 v_UV;
uniform float u_BloomFinal: 0.0;
uniform sampler2D u_Texture;
uniform sampler2D u_Texture2;
uniform vec2 u_ViewportSize: [1.0, 1.0];
uniform float u_radius: 5.0;
uniform float u_intensity: 0.3;
uniform float u_baseRadio: 0.5;
// https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl
vec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {
vec4 color = vec4(0.0);
vec2 off1 = vec2(1.3846153846) * direction;
vec2 off2 = vec2(3.2307692308) * direction;
color += texture2D(image, uv) * 0.2270270270;
color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;
color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;
color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;
color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;
return color;
}
float luminance(vec4 color) {
return 0.2125 * color.r + 0.7154 * color.g + 0.0721 * color.b;
}
void main() {
// vec4 baseColor = texture2D(u_Texture, v_UV);
float r = sqrt(u_radius);
vec4 c1 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(u_radius, 0.0));
// c1 *= luminance(c1);
vec4 c2 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(0.0, u_radius));
// c2 *= luminance(c2);
vec4 c3 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(r, r));
// c3 *= luminance(c3);
vec4 c4 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(r, -r));
// c4 *= luminance(c4);
vec4 inbloomColor = (c1 + c2 + c3 + c4) * 0.25;
// float lum = luminance(inbloomColor);
// inbloomColor.rgb *= lum;
if(u_BloomFinal > 0.0) {
vec4 baseColor = texture2D(u_Texture2, v_UV);
float baselum = luminance(baseColor);
gl_FragColor = mix(inbloomColor, baseColor, u_baseRadio);
if(baselum <= 0.2) {
gl_FragColor = inbloomColor * u_intensity;
}
} else {
gl_FragColor = inbloomColor;
}
}`,up=`attribute vec2 a_Position;
varying vec2 v_UV;
void main() {
v_UV = 0.5 * (a_Position + 1.0);
gl_Position = vec4(a_Position, 0., 1.);
}`,{isNil:Mh}=es;class _c extends Bl{setupShaders(){this.shaderModuleService.registerModule("blur-pass",{vs:up,fs:xp});const{vs:e,fs:r,uniforms:n}=this.shaderModuleService.getModule("blur-pass"),{width:a,height:u}=this.rendererService.getViewportSize();return{vs:e,fs:r,uniforms:(0,Wt.Z)((0,Wt.Z)({},n),{},{u_ViewportSize:[a,u]})}}convertOptionsToUniforms(e){const r={};return Mh(e.bloomRadius)||(r.u_radius=e.bloomRadius),Mh(e.bloomIntensity)||(r.u_intensity=e.bloomIntensity),Mh(e.bloomBaseRadio)||(r.u_baseRadio=e.bloomBaseRadio),r}}const oc=`varying vec2 v_UV;
uniform sampler2D u_Texture;
uniform vec2 u_ViewportSize: [1.0, 1.0];
uniform vec2 u_BlurDir: [1.0, 0.0];
// https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl
vec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {
vec4 color = vec4(0.0);
vec2 off1 = vec2(1.3846153846) * direction;
vec2 off2 = vec2(3.2307692308) * direction;
color += texture2D(image, uv) * 0.2270270270;
color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;
color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;
color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;
color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;
return color;
}
void main() {
gl_FragColor = blur9(u_Texture, v_UV, u_ViewportSize, u_BlurDir);
}`,Ss=`attribute vec2 a_Position;
varying vec2 v_UV;
void main() {
v_UV = 0.5 * (a_Position + 1.0);
gl_Position = vec4(a_Position, 0., 1.);
}`,{isNil:Ph}=es;class Rh extends Bl{setupShaders(){this.shaderModuleService.registerModule("blur-pass",{vs:Ss,fs:oc});const{vs:e,fs:r,uniforms:n}=this.shaderModuleService.getModule("blur-pass"),{width:a,height:u}=this.rendererService.getViewportSize();return{vs:e,fs:r,uniforms:(0,Wt.Z)((0,Wt.Z)({},n),{},{u_ViewportSize:[a,u]})}}convertOptionsToUniforms(e){const r={};return Ph(e.blurRadius)||(r.u_BlurDir=[e.blurRadius,0]),r}}const Nc=`varying vec2 v_UV;
uniform sampler2D u_Texture;
uniform vec2 u_ViewportSize: [1.0, 1.0];
uniform vec2 u_BlurDir: [1.0, 0.0];
// https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl
vec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {
vec4 color = vec4(0.0);
vec2 off1 = vec2(1.3846153846) * direction;
vec2 off2 = vec2(3.2307692308) * direction;
color += texture2D(image, uv) * 0.2270270270;
color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;
color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;
color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;
color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;
return color;
}
void main() {
gl_FragColor = blur9(u_Texture, v_UV, u_ViewportSize, u_BlurDir);
}`,Cf=`attribute vec2 a_Position;
varying vec2 v_UV;
void main() {
v_UV = 0.5 * (a_Position + 1.0);
gl_Position = vec4(a_Position, 0., 1.);
}`,{isNil:Vp}=es;class Mf extends Bl{setupShaders(){this.shaderModuleService.registerModule("blur-pass",{vs:Cf,fs:Nc});const{vs:e,fs:r,uniforms:n}=this.shaderModuleService.getModule("blur-pass"),{width:a,height:u}=this.rendererService.getViewportSize();return{vs:e,fs:r,uniforms:(0,Wt.Z)((0,Wt.Z)({},n),{},{u_ViewportSize:[a,u]})}}convertOptionsToUniforms(e){const r={};return Vp(e.blurRadius)||(r.u_BlurDir=[0,e.blurRadius]),r}}const md=`varying vec2 v_UV;
uniform sampler2D u_Texture;
uniform vec2 u_ViewportSize: [1.0, 1.0];
uniform vec2 u_Center : [0.5, 0.5];
uniform float u_Angle : 0;
uniform float u_Size : 8;
#pragma include "common"
float scale = PI / u_Size;
float pattern(float u_Angle, vec2 texSize, vec2 texCoord) {
float s = sin(u_Angle), c = cos(u_Angle);
vec2 tex = texCoord * texSize - u_Center * texSize;
vec2 point = vec2(
c * tex.x - s * tex.y,
s * tex.x + c * tex.y
) * scale;
return (sin(point.x) * sin(point.y)) * 4.0;
}
// https://github.com/evanw/glfx.js/blob/master/src/filters/fun/colorhalftone.js
vec4 colorHalftone_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
vec3 cmy = 1.0 - color.rgb;
float k = min(cmy.x, min(cmy.y, cmy.z));
cmy = (cmy - k) / (1.0 - k);
cmy = clamp(
cmy * 10.0 - 3.0 + vec3(
pattern(u_Angle + 0.26179, texSize, texCoord),
pattern(u_Angle + 1.30899, texSize, texCoord),
pattern(u_Angle, texSize, texCoord)
),
0.0,
1.0
);
k = clamp(k * 10.0 - 5.0 + pattern(u_Angle + 0.78539, texSize, texCoord), 0.0, 1.0);
return vec4(1.0 - cmy - k, color.a);
}
void main() {
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
gl_FragColor = colorHalftone_filterColor(gl_FragColor, u_ViewportSize, v_UV);
}`,Pf=`attribute vec2 a_Position;
varying vec2 v_UV;
void main() {
v_UV = 0.5 * (a_Position + 1.0);
gl_Position = vec4(a_Position, 0., 1.);
}`;class Rf extends Bl{setupShaders(){this.shaderModuleService.registerModule("colorhalftone-pass",{vs:Pf,fs:md});const{vs:e,fs:r,uniforms:n}=this.shaderModuleService.getModule("colorhalftone-pass"),{width:a,height:u}=this.rendererService.getViewportSize();return{vs:e,fs:r,uniforms:(0,Wt.Z)((0,Wt.Z)({},n),{},{u_ViewportSize:[a,u]})}}}const Rp=`varying vec2 v_UV;
uniform sampler2D u_Texture;
void main() {
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
}`,$c=`attribute vec2 a_Position;
varying vec2 v_UV;
void main() {
v_UV = 0.5 * (a_Position + 1.0);
gl_Position = vec4(a_Position, 0., 1.);
}`;class Vd extends Bl{setupShaders(){return this.shaderModuleService.registerModule("copy-pass",{vs:$c,fs:Rp}),this.shaderModuleService.getModule("copy-pass")}}const Ym=`varying vec2 v_UV;
uniform sampler2D u_Texture;
uniform vec2 u_ViewportSize: [1.0, 1.0];
uniform vec2 u_Center : [0.5, 0.5];
uniform float u_Scale : 10;
// https://github.com/evanw/glfx.js/blob/master/src/filters/fun/hexagonalpixelate.js
vec4 hexagonalPixelate_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
vec2 tex = (texCoord * texSize - u_Center * texSize) / u_Scale;
tex.y /= 0.866025404;
tex.x -= tex.y * 0.5;
vec2 a;
if (tex.x + tex.y - floor(tex.x) - floor(tex.y) < 1.0) {
a = vec2(floor(tex.x), floor(tex.y));
}
else a = vec2(ceil(tex.x), ceil(tex.y));
vec2 b = vec2(ceil(tex.x), floor(tex.y));
vec2 c = vec2(floor(tex.x), ceil(tex.y));
vec3 TEX = vec3(tex.x, tex.y, 1.0 - tex.x - tex.y);
vec3 A = vec3(a.x, a.y, 1.0 - a.x - a.y);
vec3 B = vec3(b.x, b.y, 1.0 - b.x - b.y);
vec3 C = vec3(c.x, c.y, 1.0 - c.x - c.y);
float alen = length(TEX - A);
float blen = length(TEX - B);
float clen = length(TEX - C);
vec2 choice;
if (alen < blen) {
if (alen < clen) choice = a;
else choice = c;
} else {
if (blen < clen) choice = b;
else choice = c;
}
choice.x += choice.y * 0.5;
choice.y *= 0.866025404;
choice *= u_Scale / texSize;
return texture2D(texture, choice + u_Center);
}
void main() {
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
gl_FragColor = hexagonalPixelate_sampleColor(u_Texture, u_ViewportSize, v_UV);
}`,Vf=`attribute vec2 a_Position;
varying vec2 v_UV;
void main() {
v_UV = 0.5 * (a_Position + 1.0);
gl_Position = vec4(a_Position, 0., 1.);
}`;class og extends Bl{setupShaders(){this.shaderModuleService.registerModule("hexagonalpixelate-pass",{vs:Vf,fs:Ym});const{vs:e,fs:r,uniforms:n}=this.shaderModuleService.getModule("hexagonalpixelate-pass"),{width:a,height:u}=this.rendererService.getViewportSize();return{vs:e,fs:r,uniforms:(0,Wt.Z)((0,Wt.Z)({},n),{},{u_ViewportSize:[a,u]})}}}const Pd=`varying vec2 v_UV;
uniform sampler2D u_Texture;
uniform vec2 u_ViewportSize: [1.0, 1.0];
uniform float u_Strength : 0.6;
vec4 ink_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
vec2 dx = vec2(1.0 / texSize.x, 0.0);
vec2 dy = vec2(0.0, 1.0 / texSize.y);
vec4 color = texture2D(texture, texCoord);
float bigTotal = 0.0;
float smallTotal = 0.0;
vec3 bigAverage = vec3(0.0);
vec3 smallAverage = vec3(0.0);
for (float x = -2.0; x <= 2.0; x += 1.0) {
for (float y = -2.0; y <= 2.0; y += 1.0) {
vec3 sample = texture2D(texture, texCoord + dx * x + dy * y).rgb;
bigAverage += sample;
bigTotal += 1.0;
if (abs(x) + abs(y) < 2.0) {
smallAverage += sample;
smallTotal += 1.0;
}
}
}
vec3 edge = max(vec3(0.0), bigAverage / bigTotal - smallAverage / smallTotal);
float power = u_Strength * u_Strength * u_Strength * u_Strength * u_Strength;
return vec4(color.rgb - dot(edge, edge) * power * 100000.0, color.a);
}
void main() {
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
gl_FragColor = ink_sampleColor(u_Texture, u_ViewportSize, v_UV);
}`,jd=`attribute vec2 a_Position;
varying vec2 v_UV;
void main() {
v_UV = 0.5 * (a_Position + 1.0);
gl_Position = vec4(a_Position, 0., 1.);
}`;class pm extends Bl{setupShaders(){this.shaderModuleService.registerModule("ink-pass",{vs:jd,fs:Pd});const{vs:e,fs:r,uniforms:n}=this.shaderModuleService.getModule("ink-pass"),{width:a,height:u}=this.rendererService.getViewportSize();return{vs:e,fs:r,uniforms:(0,Wt.Z)((0,Wt.Z)({},n),{},{u_ViewportSize:[a,u]})}}}const Tm=`varying vec2 v_UV;
uniform sampler2D u_Texture;
uniform float u_Amount : 0.5;
float rand(vec2 co) {
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}
// https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js
vec4 noise_filterColor(vec4 color, vec2 texCoord) {
float diff = (rand(texCoord) - 0.5) * u_Amount;
color.r += diff;
color.g += diff;
color.b += diff;
return color;
}
void main() {
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
gl_FragColor = noise_filterColor(gl_FragColor, v_UV);
}`,fm=`attribute vec2 a_Position;
varying vec2 v_UV;
void main() {
v_UV = 0.5 * (a_Position + 1.0);
gl_Position = vec4(a_Position, 0., 1.);
}`;class Am extends Bl{setupShaders(){return this.shaderModuleService.registerModule("noise-pass",{vs:fm,fs:Tm}),this.shaderModuleService.getModule("noise-pass")}}const Cg=`attribute vec2 a_Position;
varying vec2 v_UV;
void main() {
v_UV = 0.5 * (a_Position + 1.0);
gl_Position = vec4(a_Position, 0., 1.);
}`,Vg=`varying vec2 v_UV;
uniform sampler2D u_Texture;
uniform float u_Amount : 0.5;
// https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/sepia.js
vec4 sepia_filterColor(vec4 color) {
float r = color.r;
float g = color.g;
float b = color.b;
color.r =
min(1.0, (r * (1.0 - (0.607 * u_Amount))) + (g * (0.769 * u_Amount)) + (b * (0.189 * u_Amount)));
color.g = min(1.0, (r * 0.349 * u_Amount) + (g * (1.0 - (0.314 * u_Amount))) + (b * 0.168 * u_Amount));
color.b = min(1.0, (r * 0.272 * u_Amount) + (g * 0.534 * u_Amount) + (b * (1.0 - (0.869 * u_Amount))));
return color;
}
void main() {
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
gl_FragColor = sepia_filterColor(gl_FragColor);
}`;class Mg extends Bl{setupShaders(){return this.shaderModuleService.registerModule("sepia-pass",{vs:Cg,fs:Vg}),this.shaderModuleService.getModule("sepia-pass")}}const $m=new mc;let ag=0;function jp(){const t=new iu,e=new j,r=new cm,n=new F(r),a=new bm,u=new Bm,y=new Em,A=new wm,O=new hm,Z={id:`${ag++}`,globalConfigService:$m,shaderModuleService:t,debugService:e,cameraService:r,coordinateSystemService:n,fontService:a,iconService:u,markerService:y,popupService:A,controlService:O,customRenderService:{}},Y=new ke(Z);Z.layerService=Y;const Q=new Gt(Z);Z.sceneService=Q;const ae=new w(Z);Z.interactionService=ae;const xe=new ie(Z);Z.pickingService=xe;const Be={clear:new gc,pixelPicking:new sp,render:new gh,taa:new vc(t)};Z.normalPassFactory=gt=>Be[gt];const it={copy:new Vd,bloom:new _c,blurH:new Rh,blurV:new Mf,noise:new Am,sepia:new Mg,colorHalftone:new Rf,hexagonalPixelate:new og,ink:new pm};return Z.postProcessingPass=it,Z.postProcessingPassFactory=gt=>it[gt],Z}function cp(t){const e=(0,Wt.Z)({},t);return e.postProcessor=new kc(e.rendererService),e.multiPassRenderer=new Pp(e.postProcessor),e.styleAttributeService=new kt(e.rendererService),e}const dm=["loaded","fontloaded","maploaded","resize","destroy","dragstart","dragging","dragend","dragcancel"];let Vh=function(t){return t.IMAGE="image",t.CUSTOMIMAGE="customImage",t.ARRAYBUFFER="arraybuffer",t.RGB="rgb",t.TERRAINRGB="terrainRGB",t.CUSTOMRGB="customRGB",t.CUSTOMARRAYBUFFER="customArrayBuffer",t.CUSTOMTERRAINRGB="customTerrainRGB",t}({});var sg=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),Cm=(t,e,r,n)=>sg(void 0,null,function*(){return new Promise((a,u)=>{e({x:t.x,y:t.y,z:t.z},(y,A)=>{if(y||A.length===0){u(y);return}A&&Zn([{data:A,bands:[0]}],r,n,(O,Z)=>{O?u(O):Z&&a(Z)})})})}),Ih=(t,e)=>sg(void 0,null,function*(){return new Promise((r,n)=>{e({x:t.x,y:t.y,z:t.z},(a,u)=>{if(a||!u){n(a);return}u instanceof ArrayBuffer?Yo(u,(y,A)=>{y&&n(y),r(A)}):u instanceof HTMLImageElement?r(u):n(a)})})});function Hp(t,e){return Array.isArray(t)?typeof t[0]=="string"?t.map(r=>Di(r,e)):t.map(r=>({url:Di(r.url,e),bands:r.bands||[0]})):Di(t,e)}function Hd(t){return typeof t=="string"?[{url:t,bands:[0]}]:typeof t[0]=="string"?t.map(e=>({url:e,bands:[0]})):t}function hf(t,e){t.xhrCancel=()=>{e.map(r=>{r.abort()})}}var Gd=Object.defineProperty,pf=Object.defineProperties,h0=Object.getOwnPropertyDescriptors,lg=Object.getOwnPropertySymbols,av=Object.prototype.hasOwnProperty,jg=Object.prototype.propertyIsEnumerable,p0=(t,e,r)=>e in t?Gd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,f0=(t,e)=>{for(var r in e||(e={}))av.call(e,r)&&p0(t,r,e[r]);if(lg)for(var r of lg(e))jg.call(e,r)&&p0(t,r,e[r]);return t},sv=(t,e)=>pf(t,h0(e)),lv=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),uv=(t,e,r,n,a)=>lv(void 0,null,function*(){const u=Hd(e.url);if(u.length>1){const{rasterFiles:y,xhrList:A,errList:O}=yield cv(u,e);if(hf(t,A),O.length>0){r(O,null);return}Zn(y,n,a,r)}else{const y=On(e,(A,O)=>{if(A)r(A);else if(O){const Z=[{data:O,bands:u[0].bands}];Zn(Z,n,a,r)}});hf(t,[y])}});function cv(t,e){return lv(this,null,function*(){const r=[],n=[],a=[];for(let u=0;u<t.length;u++){const y=t[u],A=sv(f0({},e),{url:y.url}),O=y.bands,{err:Z,data:Y,xhr:Q}=yield bn(sv(f0({},A),{type:"arrayBuffer"}));Z&&a.push(Z),n.push(Q),r.push({data:Y,bands:O})}return{rasterFiles:r,xhrList:n,errList:a}})}var hv=Object.defineProperty,pv=Object.defineProperties,Wd=Object.getOwnPropertyDescriptors,ug=Object.getOwnPropertySymbols,Hg=Object.prototype.hasOwnProperty,Fm=Object.prototype.propertyIsEnumerable,Gg=(t,e,r)=>e in t?hv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,d0=(t,e)=>{for(var r in e||(e={}))Hg.call(e,r)&&Gg(t,r,e[r]);if(ug)for(var r of ug(e))Fm.call(e,r)&&Gg(t,r,e[r]);return t},ax=(t,e)=>pv(t,Wd(e)),fv=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),sx=(t,e,r,n)=>fv(void 0,null,function*(){const{format:a=D_,operation:u,requestParameters:y={}}=n,A=ax(d0({},y),{url:Hp(t,e)});return new Promise((O,Z)=>{uv(r,A,(Y,Q)=>{Y?Z(Y):Q&&O(Q)},a,u)})}),L_=(t,e,r,n)=>fv(void 0,null,function*(){let a;const u=Array.isArray(t)?t[0]:t;return n.wmtsOptions?a=((n==null?void 0:n.getURLFromTemplate)||Ui)(u,d0(d0({},e),n.wmtsOptions)):a=((n==null?void 0:n.getURLFromTemplate)||Di)(u,e),new Promise((y,A)=>{var O;const Z=ns(ax(d0({},n==null?void 0:n.requestParameters),{url:a,type:((O=n==null?void 0:n.requestParameters)==null?void 0:O.type)||"arrayBuffer"}),(Y,Q)=>{Y?A(Y):Q&&y(Q)},n.transformResponse);r.xhrCancel=()=>Z.cancel()})}),D_=()=>({rasterData:new Uint8Array([0]),width:1,height:1}),lx=Object.defineProperty,ux=Object.defineProperties,cx=Object.getOwnPropertyDescriptors,O_=Object.getOwnPropertySymbols,hx=Object.prototype.hasOwnProperty,px=Object.prototype.propertyIsEnumerable,B_=(t,e,r)=>e in t?lx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,dv=(t,e)=>{for(var r in e||(e={}))hx.call(e,r)&&B_(t,r,e[r]);if(O_)for(var r of O_(e))px.call(e,r)&&B_(t,r,e[r]);return t},fx=(t,e)=>ux(t,cx(e)),dx={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,warp:!0},aE=[Vh.ARRAYBUFFER,Vh.RGB];function mx(t){return!!(Array.isArray(t)&&t.length===0||!Array.isArray(t)&&typeof t!="string")}function gx(t,e={}){if(mx(t))throw new Error("tile server url is error");let r=(e==null?void 0:e.dataType)||Vh.IMAGE;r===Vh.RGB&&(r=Vh.ARRAYBUFFER);const n=(u,y)=>{switch(r){case Vh.IMAGE:return L_(t,u,y,e);case Vh.CUSTOMIMAGE:case Vh.CUSTOMTERRAINRGB:return Ih(y,e==null?void 0:e.getCustomData);case Vh.ARRAYBUFFER:return sx(t,u,y,e);case Vh.CUSTOMARRAYBUFFER:case Vh.CUSTOMRGB:return Cm(y,e==null?void 0:e.getCustomData,(e==null?void 0:e.format)||D_,e==null?void 0:e.operation);default:return L_(t,u,y,e)}},a=fx(dv(dv({},dx),e),{getTileData:n});return{data:t,dataArray:[],tilesetOptions:a,isTile:!0}}var vx=Object.defineProperty,F_=Object.defineProperties,_x=Object.getOwnPropertyDescriptors,m0=Object.getOwnPropertySymbols,k_=Object.prototype.hasOwnProperty,N_=Object.prototype.propertyIsEnumerable,z_=(t,e,r)=>e in t?vx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mv=(t,e)=>{for(var r in e||(e={}))k_.call(e,r)&&z_(t,r,e[r]);if(m0)for(var r of m0(e))N_.call(e,r)&&z_(t,r,e[r]);return t},yx=(t,e)=>F_(t,_x(e)),xx=(t,e)=>{var r={};for(var n in t)k_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&m0)for(var n of m0(t))e.indexOf(n)<0&&N_.call(t,n)&&(r[n]=t[n]);return r};function bx(t,e){const r=e,{extent:n=[121.168,30.2828,121.384,30.4219],coordinates:a,width:u,height:y}=r,A=xx(r,["extent","coordinates","width","height"]);t.length<2&&console.warn("RGB\u89E3\u6790\u9700\u89812\u4E2A\u6CE2\u6BB5\u7684\u6570\u636E");const[O,Z]=A.bands||[0,1],Y=[t[O],t[Z]],Q=[];for(let Be=0;Be<Y[0].length;Be++)Q.push((Y[1][Be]-Y[0][Be])/(Y[1][Be]+Y[0][Be]));const ae=qi(a,n);return{_id:1,dataArray:[yx(mv({_id:1,data:Q,width:u,height:y},A),{coordinates:ae})]}}var Ex=Object.defineProperty,Sx=Object.defineProperties,Tx=Object.getOwnPropertyDescriptors,Pg=Object.getOwnPropertySymbols,U_=Object.prototype.hasOwnProperty,Z_=Object.prototype.propertyIsEnumerable,V_=(t,e,r)=>e in t?Ex(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ax=(t,e)=>{for(var r in e||(e={}))U_.call(e,r)&&V_(t,r,e[r]);if(Pg)for(var r of Pg(e))Z_.call(e,r)&&V_(t,r,e[r]);return t},Cx=(t,e)=>Sx(t,Tx(e)),Mx=(t,e)=>{var r={};for(var n in t)U_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Pg)for(var n of Pg(t))e.indexOf(n)<0&&Z_.call(t,n)&&(r[n]=t[n]);return r};function Px(t,e){const r=e,{extent:n,coordinates:a,width:u,height:y}=r,A=Mx(r,["extent","coordinates","width","height"]);t.length<3&&console.warn("RGB\u89E3\u6790\u9700\u8981\u4E09\u4E2A\u6CE2\u6BB5\u7684\u6570\u636E");const[O,Z,Y]=A.bands||[0,1,2],Q=[t[O],t[Z],t[Y]],ae=[],[xe,Be]=(A==null?void 0:A.countCut)||[2,98],it=(A==null?void 0:A.RMinMax)||Yn(Q[0],xe,Be),gt=(A==null?void 0:A.GMinMax)||Yn(Q[1],xe,Be),Bt=(A==null?void 0:A.BMinMax)||Yn(Q[2],xe,Be);for(let vr=0;vr<Q[0].length;vr++)ae.push(Math.max(0,Q[0][vr]-it[0])),ae.push(Math.max(0,Q[1][vr]-gt[0])),ae.push(Math.max(0,Q[2][vr]-Bt[0]));const Rt=qi(a,n);return{_id:1,dataArray:[Cx(Ax({_id:1,data:ae,width:u,height:y,rMinMax:it,gMinMax:gt,bMinMax:Bt},A),{coordinates:Rt})]}}var Rx=Object.defineProperty,Ix=Object.defineProperties,gv=Object.getOwnPropertyDescriptors,g0=Object.getOwnPropertySymbols,j_=Object.prototype.hasOwnProperty,H_=Object.prototype.propertyIsEnumerable,G_=(t,e,r)=>e in t?Rx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,W_=(t,e)=>{for(var r in e||(e={}))j_.call(e,r)&&G_(t,r,e[r]);if(g0)for(var r of g0(e))H_.call(e,r)&&G_(t,r,e[r]);return t},Lx=(t,e)=>Ix(t,gv(e)),Dx=(t,e)=>{var r={};for(var n in t)j_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&g0)for(var n of g0(t))e.indexOf(n)<0&&H_.call(t,n)&&(r[n]=t[n]);return r};function Ox(t,e){const r=e,{extent:n,coordinates:a,min:u,max:y,width:A,height:O,format:Z,operation:Y}=r,Q=Dx(r,["extent","coordinates","min","max","width","height","format","operation"]);let ae;if(Z===void 0||ko(t))ae=Array.from(t);else{const it=Array.isArray(t)?t:[t];ae=Po(it,Z,Y)}const xe=qi(a,n);return{_id:1,dataArray:[Lx(W_({_id:1,data:ae,width:A,height:O},Q),{min:u,max:y,coordinates:xe})]}}var Bx=Object.defineProperty,Fx=Object.defineProperties,kx=Object.getOwnPropertyDescriptors,X_=Object.getOwnPropertySymbols,Nx=Object.prototype.hasOwnProperty,zx=Object.prototype.propertyIsEnumerable,q_=(t,e,r)=>e in t?Bx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Y_=(t,e)=>{for(var r in e||(e={}))Nx.call(e,r)&&q_(t,r,e[r]);if(X_)for(var r of X_(e))zx.call(e,r)&&q_(t,r,e[r]);return t},$_=(t,e)=>Fx(t,kx(e)),Ux=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),Zx={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0},Vx=t=>Ux(void 0,null,function*(){return new Promise(e=>{const[r,n,a,u]=t.bounds,y={layers:{testTile:{features:[{type:"Feature",properties:{key:t.x+"/"+t.y+"/"+t.z,x:(r+a)/2,y:(n+u)/2},geometry:{type:"LineString",coordinates:[[a,u],[a,n],[r,n],[r,n]]}}]}}};e(y)})});function jx(t,e){const r=a=>Vx(a),n=$_(Y_(Y_({},Zx),e),{getTileData:r});return{data:t,dataArray:[],tilesetOptions:n,isTile:!0}}var Hx=Se(48096),K_=Se.n(Hx),J_=Object.defineProperty,Q_=Object.getOwnPropertySymbols,Gx=Object.prototype.hasOwnProperty,ey=Object.prototype.propertyIsEnumerable,ty=(t,e,r)=>e in t?J_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ry=(t,e)=>{for(var r in e||(e={}))Gx.call(e,r)&&ty(t,r,e[r]);if(Q_)for(var r of Q_(e))ey.call(e,r)&&ty(t,r,e[r]);return t};function ny(t,e){const{radius:r=40,maxZoom:n=18,minZoom:a=0,zoom:u=2}=e;if(t.pointIndex){const O=t.pointIndex.getClusters(t.extent,Math.floor(u));return t.dataArray=Wx(O),t}const y=new(K_())({radius:r,minZoom:a,maxZoom:n}),A={type:"FeatureCollection",features:[]};return A.features=t.dataArray.map(O=>({type:"Feature",geometry:{type:"Point",coordinates:O.coordinates},properties:ry({},O)})),y.load(A.features),y}function Wx(t){return t.map((e,r)=>ry({coordinates:e.geometry.coordinates,_id:r+1},e.properties))}function Xx(t){if(t.length===0)throw new Error("max requires at least one data point");let e=t[0];for(let r=1;r<t.length;r++)t[r]>e&&(e=t[r]);return e}function iy(t){if(t.length===0)throw new Error("min requires at least one data point");let e=t[0];for(let r=1;r<t.length;r++)t[r]<e&&(e=t[r]);return e}function oy(t){if(t.length===0)return 0;let e=t[0],r=0,n;for(let a=1;a<t.length;a++)n=e+t[a]*1,Math.abs(e)>=Math.abs(t[a])?r+=e-n+t[a]:r+=t[a]-n+e,e=n;return e+r*1}function qx(t){if(t.length===0)throw new Error("mean requires at least one data point");return oy(t)/t.length}var Yx={min:iy,max:Xx,mean:qx,sum:oy},$x=Object.defineProperty,ay=Object.getOwnPropertySymbols,sy=Object.prototype.hasOwnProperty,Kx=Object.prototype.propertyIsEnumerable,ly=(t,e,r)=>e in t?$x(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wg=(t,e)=>{for(var r in e||(e={}))sy.call(e,r)&&ly(t,r,e[r]);if(ay)for(var r of ay(e))Kx.call(e,r)&&ly(t,r,e[r]);return t},uy=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),{cloneDeep:Jx,isFunction:cy,isString:Qx,mergeWith:eb}=es;function tb(t,e){if(Array.isArray(e))return e}var rb=class extends Yl.EventEmitter{constructor(t,e){super(),this.type="source",this.isTile=!1,this.inited=!1,this.hooks={init:new f},this.parser={type:"geojson"},this.transforms=[],this.cluster=!1,this.clusterOptions={enable:!1,radius:40,maxZoom:20,zoom:-99,method:"count"},this.invalidExtent=!1,this.dataArrayChanged=!1,this.cfg={autoRender:!0},this.originData=t,this.initCfg(e),this.init().then(()=>{this.inited=!0,this.emit("update",{type:"inited"})})}getSourceCfg(){return this.cfg}getClusters(t){return this.clusterIndex.getClusters(this.caculClusterExtent(2),t)}getClustersLeaves(t){return this.clusterIndex.getLeaves(t,1/0)}getParserType(){return this.parser.type}updateClusterData(t){const{method:e="sum",field:r}=this.clusterOptions;let n=this.clusterIndex.getClusters(this.caculClusterExtent(2),Math.floor(t));this.clusterOptions.zoom=t,n.forEach(a=>{a.id||(a.properties.point_count=1)}),(r||cy(e))&&(n=n.map(a=>{const u=a.id;if(u){const A=this.clusterIndex.getLeaves(u,1/0).map(Z=>Z.properties);let O;if(Qx(e)&&r){const Z=Ko(A,r);O=Yx[e](Z)}cy(e)&&(O=e(A)),a.properties.stat=O}else a.properties.point_count=1;return a})),this.data=de("geojson")({type:"FeatureCollection",features:n}),this.executeTrans()}getFeatureById(t){const{type:e="geojson",geometry:r}=this.parser;if(e==="geojson"&&!this.cluster){const n=t<this.originData.features.length?this.originData.features[t]:"null",a=Jx(n);if(a!=null&&a.properties&&(this.transforms.length!==0||this.dataArrayChanged)){const u=this.data.dataArray.find(y=>y._id===t);a.properties=u}return a}else return e==="json"&&r?this.data.dataArray.find(n=>n._id===t):t<this.data.dataArray.length?this.data.dataArray[t]:"null"}updateFeaturePropertiesById(t,e){this.data.dataArray=this.data.dataArray.map(r=>r._id===t?Wg(Wg({},r),e):r),this.dataArrayChanged=!0,this.emit("update",{type:"update"})}getFeatureId(t,e){const r=this.data.dataArray.find(n=>n[t]===e);return r==null?void 0:r._id}setData(t,e){this.originData=t,this.dataArrayChanged=!1,this.initCfg(e),this.init().then(()=>{this.emit("update",{type:"update"})})}reloadAllTile(){var t;(t=this.tileset)==null||t.reloadAll()}reloadTilebyId(t,e,r){var n;(n=this.tileset)==null||n.reloadTileById(t,e,r)}reloadTileByLnglat(t,e,r){var n;(n=this.tileset)==null||n.reloadTileByLnglat(t,e,r)}getTileExtent(t,e){var r;return(r=this.tileset)==null?void 0:r.getTileExtent(t,e)}getTileByZXY(t,e,r){var n;return(n=this.tileset)==null?void 0:n.getTileByZXY(t,e,r)}reloadTileByExtent(t,e){var r;(r=this.tileset)==null||r.reloadTileByExtent(t,e)}destroy(){var t;this.removeAllListeners(),this.originData=null,this.clusterIndex=null,this.data=null,(t=this.tileset)==null||t.destroy()}processData(){return uy(this,null,function*(){return new Promise((t,e)=>{try{this.excuteParser(),this.initCluster(),this.executeTrans(),t({})}catch(r){e(r)}})})}initCfg(t){this.cfg=eb(this.cfg,t,tb);const e=this.cfg;e&&(e.parser&&(this.parser=e.parser),e.transforms&&(this.transforms=e.transforms),this.cluster=e.cluster||!1,e.clusterOptions&&(this.cluster=!0,this.clusterOptions=Wg(Wg({},this.clusterOptions),e.clusterOptions)))}init(){return uy(this,null,function*(){this.inited=!1,yield this.processData(),this.inited=!0})}excuteParser(){const t=this.parser,e=t.type||"geojson",r=de(e);this.data=r(this.originData,t),this.tileset=this.initTileset(),!t.cancelExtent&&(this.extent=xu(this.data.dataArray),this.setCenter(this.extent),this.invalidExtent=this.extent[0]===this.extent[2]||this.extent[1]===this.extent[3])}setCenter(t){this.center=[(t[0]+t[2])/2,(t[1]+t[3])/2],(isNaN(this.center[0])||isNaN(this.center[1]))&&(this.center=[108.92361111111111,34.54083333333333])}initTileset(){const{tilesetOptions:t}=this.data;return t?(this.isTile=!0,this.tileset?(this.tileset.updateOptions(t),this.tileset):new nn(Wg({},t))):void 0}executeTrans(){this.transforms.forEach(e=>{const{type:r}=e,n=Le(r)(this.data,e);Object.assign(this.data,n)})}initCluster(){if(!this.cluster)return;const t=this.clusterOptions||{};this.clusterIndex=ny(this.data,t)}caculClusterExtent(t){let e=[[-1/0,-1/0],[1/0,1/0]];return this.invalidExtent||(e=ai(ep(this.extent),t)),e[0].concat(e[1])}};function nb(t,e){const{callback:r}=e;return r&&(t.dataArray=t.dataArray.filter(r)),t}var vv=6378e3;function ib(t,e){const r=t.dataArray,{size:n=10}=e,a=n/(2*Math.PI*vv)*(256<<20)/2,{gridHash:u,gridOffset:y}=ob(r,n),A=Xg(u,y,e);return{yOffset:a,xOffset:a,radius:a,type:"grid",dataArray:A}}function ob(t,e){let r=1/0,n=-1/0,a;for(const O of t)a=O.coordinates[1],Number.isFinite(a)&&(r=a<r?a:r,n=a>n?a:n);const u=(r+n)/2,y=ab(e,u);if(y.xOffset<=0||y.yOffset<=0)return{gridHash:{},gridOffset:y};const A={};for(const O of t){const Z=O.coordinates[1],Y=O.coordinates[0];if(Number.isFinite(Z)&&Number.isFinite(Y)){const Q=Math.floor((Z+90)/y.yOffset),ae=Math.floor((Y+180)/y.xOffset),xe=`${Q}-${ae}`;A[xe]=A[xe]||{count:0,points:[]},A[xe].count+=1,A[xe].points.push(O)}}return{gridHash:A,gridOffset:y}}function ab(t,e){const r=sb(t),n=_v(e,t);return{yOffset:r,xOffset:n}}function sb(t){return t/vv*(180/Math.PI)}function _v(t,e){return e/vv*(180/Math.PI)/Math.cos(t*Math.PI/180)}function Xg(t,e,r){return Object.keys(t).reduce((n,a,u)=>{const y=a.split("-"),A=parseInt(y[0],10),O=parseInt(y[1],10),Z={};if(r.field&&r.method){const Y=qc(t[a].points,r.field);Z[r.method]=Su[r.method](Y)}return Object.assign(Z,{_id:u,coordinates:vl([-180+e.xOffset*(O+.5),-90+e.yOffset*(A+.5)]),rawData:t[a].points,count:t[a].count}),n.push(Z),n},[])}var Rg=Math.PI/3,yv=[0,Rg,2*Rg,3*Rg,4*Rg,5*Rg];function lb(t){return t[0]}function ub(t){return t[1]}function cb(){var t=0,e=0,r=1,n=1,a=lb,u=ub,y,A,O;function Z(Q){var ae={},xe=[],Be,it=Q.length;for(Be=0;Be<it;++Be)if(!(isNaN(Bt=+a.call(null,gt=Q[Be],Be,Q))||isNaN(Rt=+u.call(null,gt,Be,Q)))){var gt,Bt,Rt,Yt=Math.round(Rt=Rt/O),vr=Math.round(Bt=Bt/A-(Yt&1)/2),ln=Rt-Yt;if(Math.abs(ln)*3>1){var cn=Bt-vr,Gr=vr+(Bt<vr?-1:1)/2,Pn=Yt+(Rt<Yt?-1:1),Oo=Bt-Gr,Da=Rt-Pn;cn*cn+ln*ln>Oo*Oo+Da*Da&&(vr=Gr+(Yt&1?1:-1)/2,Yt=Pn)}var Bo=vr+"-"+Yt,Oa=ae[Bo];Oa?Oa.push(gt):(xe.push(Oa=ae[Bo]=[gt]),Oa.x=(vr+(Yt&1)/2)*A,Oa.y=Yt*O)}return xe}function Y(Q){var ae=0,xe=0;return yv.map(function(Be){var it=Math.sin(Be)*Q,gt=-Math.cos(Be)*Q,Bt=it-ae,Rt=gt-xe;return ae=it,xe=gt,[Bt,Rt]})}return Z.hexagon=function(Q){return"m"+Y(Q==null?y:+Q).join("l")+"z"},Z.centers=function(){for(var Q=[],ae=Math.round(e/O),xe=Math.round(t/A),Be=ae*O;Be<n+y;Be+=O,++ae)for(var it=xe*A+(ae&1)*A/2;it<r+A/2;it+=A)Q.push([it,Be]);return Q},Z.mesh=function(){var Q=Y(y).slice(0,4).join("l");return Z.centers().map(function(ae){return"M"+ae+"m"+Q}).join("")},Z.x=function(Q){return arguments.length?(a=Q,Z):a},Z.y=function(Q){return arguments.length?(u=Q,Z):u},Z.radius=function(Q){return arguments.length?(y=+Q,A=y*2*Math.sin(Rg),O=y*1.5,Z):y},Z.size=function(Q){return arguments.length?(t=e=0,r=+Q[0],n=+Q[1],Z):[r-t,n-e]},Z.extent=function(Q){return arguments.length?(t=+Q[0][0],e=+Q[0][1],r=+Q[1][0],n=+Q[1][1],Z):[[t,e],[r,n]]},Z.radius(1)}var hb=Object.defineProperty,pb=Object.defineProperties,hy=Object.getOwnPropertyDescriptors,xv=Object.getOwnPropertySymbols,fb=Object.prototype.hasOwnProperty,v0=Object.prototype.propertyIsEnumerable,bv=(t,e,r)=>e in t?hb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cg=(t,e)=>{for(var r in e||(e={}))fb.call(e,r)&&bv(t,r,e[r]);if(xv)for(var r of xv(e))v0.call(e,r)&&bv(t,r,e[r]);return t},db=(t,e)=>pb(t,hy(e)),mb=6378e3;function Ev(t,e){const r=t.dataArray,{size:n=10,method:a="sum"}=e,u=n/(2*Math.PI*mb)*(256<<20)/2,y=r.map(Y=>{const[Q,ae]=vl(Y.coordinates);return db(cg({},Y),{coordinates:[Q,ae]})});return{dataArray:cb().radius(u).x(Y=>Y.coordinates[0]).y(Y=>Y.coordinates[1])(y).map((Y,Q)=>{if(e.field&&a){const ae=qc(Y,e.field);Y[a]=Su[a](ae)}return{[e.method]:Y[a],count:Y.length,rawData:Y,coordinates:[Y.x,Y.y],_id:Q}}),radius:u,xOffset:u,yOffset:u,type:"hexagon"}}var wv=Object.defineProperty,py=Object.getOwnPropertySymbols,gb=Object.prototype.hasOwnProperty,vb=Object.prototype.propertyIsEnumerable,fy=(t,e,r)=>e in t?wv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sv=(t,e)=>{for(var r in e||(e={}))gb.call(e,r)&&fy(t,r,e[r]);if(py)for(var r of py(e))vb.call(e,r)&&fy(t,r,e[r]);return t};function dy(t,e){const{sourceField:r,targetField:n,data:a}=e,u={};return a.forEach(y=>{u[y[r]]=y}),t.dataArray=t.dataArray.map(y=>{const A=y[n];return Sv(Sv({},y),u[A])}),t}function _b(t,e){const{callback:r}=e;return r&&(t.dataArray=t.dataArray.map(r)),t}var sE=Se(20446);be("rasterTile",gx),be("mvt",Or),be("geojsonvt",_p),be("testTile",jx),be("geojson",Ws),be("jsonTile",Au),be("image",Uf),be("csv",hh),be("json",Uu),be("raster",Sn),be("rasterRgb",Ox),be("rgb",Px),be("ndi",bx),Re("cluster",ny),Re("filter",nb),Re("join",dy),Re("map",_b),Re("grid",ib),Re("hexagon",Ev);var gy=rb;class Tv extends Yl.EventEmitter{getMarkerLayerContainerSize(){}constructor(e){super(),(0,K.Z)(this,"markerOption",void 0),(0,K.Z)(this,"popup",void 0),(0,K.Z)(this,"mapsService",void 0),(0,K.Z)(this,"lngLat",void 0),(0,K.Z)(this,"scene",void 0),(0,K.Z)(this,"added",!1),(0,K.Z)(this,"preLngLat",{lng:0,lat:0}),(0,K.Z)(this,"onMarkerDragStart",r=>{const n=this.mapsService.getContainer();if(!n)return;this.mapsService.setMapStatus({dragEnable:!1,zoomEnable:!1});const{left:a,top:u}=n.getClientRects()[0],{x:y,y:A}=r;this.preLngLat=this.mapsService.containerToLngLat([y-a,A-u]),this.mapsService.on("mousemove",this.onMarkerDragMove),document.addEventListener("mouseup",this.onMarkerDragEnd),this.emit("dragstart",this.lngLat)}),(0,K.Z)(this,"onMarkerDragMove",r=>{const{lng:n,lat:a}=this.preLngLat,{lng:u,lat:y}=r.lnglat,A={lng:this.lngLat.lng+u-n,lat:this.lngLat.lat+y-a};this.setLnglat(A),this.preLngLat=r.lnglat,this.emit("dragging",A)}),(0,K.Z)(this,"onMarkerDragEnd",()=>{this.mapsService.setMapStatus({dragEnable:!0,zoomEnable:!0}),this.mapsService.off("mousemove",this.onMarkerDragMove),document.removeEventListener("mouseup",this.onMarkerDragEnd),this.emit("dragend",this.lngLat)}),(0,K.Z)(this,"eventHandle",r=>{this.polyfillEvent(r),this.emit(r.type,{target:r,data:this.markerOption.extData,lngLat:this.lngLat})}),(0,K.Z)(this,"touchStartTime",void 0),this.markerOption=(0,Wt.Z)((0,Wt.Z)({},this.getDefault()),e),nh(["update","onMove","onMapClick","updatePositionWhenZoom"],this),this.init()}getDefault(){return{element:void 0,anchor:_a.BOTTOM,offsets:[0,0],color:"#5B8FF9",draggable:!1}}addTo(e){this.scene=e,this.mapsService=e.mapService;const{element:r}=this.markerOption;return this.mapsService.getMarkerContainer().appendChild(r),this.registerMarkerEvent(r),this.mapsService.on("camerachange",this.update),this.update(),this.updateDraggable(),this.added=!0,this.emit("added"),this}remove(){this.mapsService&&(this.mapsService.off("click",this.onMapClick),this.mapsService.off("move",this.update),this.mapsService.off("moveend",this.update),this.mapsService.off("camerachange",this.update)),this.unRegisterMarkerEvent(),this.removeAllListeners();const{element:e}=this.markerOption;return e&&au(e),this.popup&&this.popup.remove(),this}setLnglat(e){return this.lngLat=e,Array.isArray(e)&&(this.lngLat={lng:e[0],lat:e[1]}),this.popup&&this.popup.setLnglat(this.lngLat),this.update(),this}getLnglat(){return this.lngLat}getElement(){return this.markerOption.element}setElement(e){if(!this.added)return this.once("added",()=>{this.setElement(e)}),this;const{element:r}=this.markerOption;return r&&au(r),this.markerOption.element=e,this.init(),this.mapsService.getMarkerContainer().appendChild(e),this.registerMarkerEvent(e),this.updateDraggable(),this.update(),this}openPopup(){if(!this.added)return this.once("added",()=>{this.openPopup()}),this;const e=this.popup;return e?(e.isOpen()||e.addTo(this.scene),this):this}closePopup(){this.added||this.once("added",()=>{this.closePopup()});const e=this.popup;return e&&e.remove(),this}setPopup(e){return this.popup=e,this.lngLat&&this.popup.setLnglat(this.lngLat),this}togglePopup(){const e=this.popup;if(e)e.isOpen()?e.remove():e.addTo(this.scene);else return this;return this}getPopup(){return this.popup}getOffset(){return this.markerOption.offsets}setDraggable(e){this.markerOption.draggable=e,this.updateDraggable()}getDraggable(){return this.markerOption.draggable}getExtData(){return this.markerOption.extData}setExtData(e){this.markerOption.extData=e}update(){if(!this.mapsService)return;const{element:e,anchor:r}=this.markerOption;this.updatePosition(),_u(e,`${$o[r]}`)}updatePositionWhenZoom(e){if(!this.mapsService)return;const{element:r,offsets:n}=this.markerOption,{lng:a,lat:u}=this.lngLat;if(r){r.style.display="block",r.style.whiteSpace="nowrap";const{containerHeight:y,containerWidth:A,bounds:O}=this.getMarkerLayerContainerSize()||this.getCurrentContainerSize();if(!O)return;const Z=e.map,Y=e.center,Q=e.zoom,ae=Z.DE(this.lngLat,Q,Y);if(ae.x=Math.round(ae.x+n[0]),ae.y=Math.round(ae.y-n[1]),Math.abs(O[0][0])>180||Math.abs(O[1][0])>180){if(ae.x>A){const xe=this.mapsService.lngLatToContainer([a-360,u]);ae.x=xe.x}if(ae.x<0){const xe=this.mapsService.lngLatToContainer([a+360,u]);ae.x=xe.x}}(ae.x>A||ae.x<0||ae.y>y||ae.y<0)&&(r.style.display="none"),r.style.left=ae.x+"px",r.style.top=ae.y+"px",r.style.transition="left 0.25s cubic-bezier(0,0,0.25,1), top 0.25s cubic-bezier(0,0,0.25,1)"}}onMapClick(e){const{element:r}=this.markerOption;this.popup&&r&&this.togglePopup()}getCurrentContainerSize(){const e=this.mapsService.getContainer();return{containerHeight:(e==null?void 0:e.scrollHeight)||0,containerWidth:(e==null?void 0:e.scrollWidth)||0,bounds:this.mapsService.getBounds()}}updateDraggable(){const{element:e}=this.markerOption;e==null||e.removeEventListener("mousedown",this.onMarkerDragStart),this.mapsService.off("mousemove",this.onMarkerDragMove),document.removeEventListener("mouseup",this.onMarkerDragEnd),this.markerOption.draggable&&(e==null||e.addEventListener("mousedown",this.onMarkerDragStart))}updatePosition(){if(!this.mapsService)return;const{element:e,offsets:r}=this.markerOption,{lng:n,lat:a}=this.lngLat,u=this.mapsService.lngLatToContainer([n,a]);if(e){e.style.display="block",e.style.whiteSpace="nowrap";const{containerHeight:y,containerWidth:A,bounds:O}=this.getMarkerLayerContainerSize()||this.getCurrentContainerSize();if(!O)return;if(Math.abs(O[0][0])>180||Math.abs(O[1][0])>180){if(u.x>A){const Z=this.mapsService.lngLatToContainer([n-360,a]);u.x=Z.x}if(u.x<0){const Z=this.mapsService.lngLatToContainer([n+360,a]);u.x=Z.x}}(u.x>A||u.x<0||u.y>y||u.y<0)&&(e.style.display="none"),e.style.left=u.x+r[0]+"px",e.style.top=u.y-r[1]+"px"}}init(){let{element:e}=this.markerOption;const{color:r,anchor:n}=this.markerOption;if(!e){e=Xo("div"),this.markerOption.element=e;const a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height","48px"),a.setAttributeNS(null,"width","48px"),a.setAttributeNS(null,"viewBox","0 0 1024 1024");const u=document.createElementNS("http://www.w3.org/2000/svg","path");u.setAttributeNS(null,"d","M512 490.666667C453.12 490.666667 405.333333 442.88 405.333333 384 405.333333 325.12 453.12 277.333333 512 277.333333 570.88 277.333333 618.666667 325.12 618.666667 384 618.666667 442.88 570.88 490.666667 512 490.666667M512 85.333333C346.88 85.333333 213.333333 218.88 213.333333 384 213.333333 608 512 938.666667 512 938.666667 512 938.666667 810.666667 608 810.666667 384 810.666667 218.88 677.12 85.333333 512 85.333333Z"),u.setAttributeNS(null,"fill",r),a.appendChild(u),e.appendChild(a)}dl(e,"l7-marker"),Object.keys(this.markerOption.style||{}).forEach(a=>{var u,y;const A=((u=this.markerOption)===null||u===void 0?void 0:u.style)&&((y=this.markerOption)===null||y===void 0?void 0:y.style[a]);e&&(e.style[a]=A)}),Fo(e,n,"marker")}registerMarkerEvent(e){e.addEventListener("click",this.onMapClick),e.addEventListener("mousemove",this.eventHandle),e.addEventListener("click",this.eventHandle),e.addEventListener("mousedown",this.eventHandle),e.addEventListener("mouseup",this.eventHandle),e.addEventListener("dblclick",this.eventHandle),e.addEventListener("contextmenu",this.eventHandle),e.addEventListener("mouseover",this.eventHandle),e.addEventListener("mouseout",this.eventHandle),e.addEventListener("touchstart",this.eventHandle),e.addEventListener("touchend",this.eventHandle)}unRegisterMarkerEvent(){const e=this.getElement();e.removeEventListener("click",this.onMapClick),e.removeEventListener("mousemove",this.eventHandle),e.removeEventListener("click",this.eventHandle),e.removeEventListener("mousedown",this.eventHandle),e.removeEventListener("mouseup",this.eventHandle),e.removeEventListener("dblclick",this.eventHandle),e.removeEventListener("contextmenu",this.eventHandle),e.removeEventListener("mouseover",this.eventHandle),e.removeEventListener("mouseout",this.eventHandle),e.removeEventListener("touchstart",this.eventHandle),e.removeEventListener("touchend",this.eventHandle)}polyfillEvent(e){!this.mapsService||this.mapsService.version!=="GAODE2.x"||Ya()||(e.type==="touchstart"&&(this.touchStartTime=Date.now()),e.type==="touchend"&&Date.now()-this.touchStartTime<300&&this.emit("click",{target:e,data:this.markerOption.extData,lngLat:this.lngLat}))}addDragHandler(e){return null}onUp(e){throw new Error("Method not implemented.")}}const{merge:yb}=es;class vy extends Yl.EventEmitter{constructor(e){var r;super(),(0,K.Z)(this,"markers",[]),(0,K.Z)(this,"markerLayerOption",void 0),(0,K.Z)(this,"clusterIndex",void 0),(0,K.Z)(this,"points",[]),(0,K.Z)(this,"clusterMarkers",[]),(0,K.Z)(this,"mapsService",void 0),(0,K.Z)(this,"scene",void 0),(0,K.Z)(this,"zoom",void 0),(0,K.Z)(this,"bbox",void 0),(0,K.Z)(this,"inited",void 0),(0,K.Z)(this,"containerSize",void 0),this.markerLayerOption=yb(this.getDefault(),e),nh(["update"],this),this.zoom=((r=this.markerLayerOption.clusterOption)===null||r===void 0?void 0:r.zoom)||-99}getDefault(){return{cluster:!1,clusterOption:{radius:80,maxZoom:20,minZoom:0,zoom:-99,style:{},className:""}}}addTo(e){return this.scene=e,this.mapsService=e.mapService,this.markerLayerOption.cluster&&(this.initCluster(),this.update(),this.mapsService.on("camerachange",this.update),this.mapsService.on("viewchange",this.update)),this.mapsService.on("camerachange",this.setContainerSize.bind(this)),this.mapsService.on("viewchange",this.setContainerSize.bind(this)),this.addMarkers(),this.inited=!0,this}setContainerSize(){if(!this.mapsService)return;const e=this.mapsService.getContainer();this.containerSize={containerWidth:(e==null?void 0:e.scrollWidth)||0,containerHeight:(e==null?void 0:e.scrollHeight)||0,bounds:this.mapsService.getBounds()}}getContainerSize(){return this.containerSize}addMarker(e){const r=this.markerLayerOption.cluster;if(e.getMarkerLayerContainerSize=this.getContainerSize.bind(this),r&&(this.addPoint(e,this.markers.length),this.mapsService)){const n=this.mapsService.getZoom(),a=this.mapsService.getBounds();this.bbox=ai(a,.5),this.zoom=Math.floor(n),this.getClusterMarker(this.bbox,this.zoom)}this.markers.push(e)}removeMarker(e){this.markers.indexOf(e);const r=this.markers.indexOf(e);r>-1&&(this.markers.splice(r,1),this.markerLayerOption.cluster&&(this.removePoint(r),this.mapsService&&this.getClusterMarker(this.bbox,this.zoom)))}hide(){this.markers.map(e=>{e.getElement().style.opacity="0"}),this.clusterMarkers.map(e=>{e.getElement().style.opacity="0"})}show(){this.markers.map(e=>{e.getElement().style.opacity="1"}),this.clusterMarkers.map(e=>{e.getElement().style.opacity="1"})}getMarkers(){return this.markerLayerOption.cluster?this.clusterMarkers:this.markers}getOriginMarkers(){return this.markers}addMarkers(){this.getMarkers().forEach(e=>{e.addTo(this.scene)})}clear(){this.markers.forEach(e=>{e.remove()}),this.clusterMarkers.forEach(e=>{e.remove()}),this.markers=[],this.points=[],this.clusterMarkers=[]}destroy(){this.clear(),this.removeAllListeners(),this.mapsService.off("camerachange",this.update),this.mapsService.off("viewchange",this.update),this.mapsService.off("camerachange",this.setContainerSize.bind(this)),this.mapsService.off("viewchange",this.setContainerSize.bind(this))}addPoint(e,r){const{lng:n,lat:a}=e.getLnglat(),u={geometry:{type:"Point",coordinates:[n,a]},properties:(0,Wt.Z)((0,Wt.Z)({},e.getExtData()),{},{marker_id:r})};this.points.push(u),this.clusterIndex&&this.clusterIndex.load(this.points)}removePoint(e){const r=this.points.findIndex(n=>n.properties.marker_id===e);r>-1&&this.points.splice(r,1),this.clusterIndex&&this.clusterIndex.load(this.points)}initCluster(){if(!this.markerLayerOption.cluster)return;const{radius:e,minZoom:r=0,maxZoom:n}=this.markerLayerOption.clusterOption;this.clusterIndex=new(K_())({radius:e,minZoom:r,maxZoom:n}),this.clusterIndex.load(this.points)}getClusterMarker(e,r){const n=e[0].concat(e[1]),a=this.clusterIndex.getClusters(n,r);this.clusterMarkers.forEach(u=>{u.remove()}),this.clusterMarkers=[],a.forEach(u=>{var y;const{field:A,method:O}=this.markerLayerOption.clusterOption;if((y=u.properties)!==null&&y!==void 0&&y.cluster_id){var Z;const Q=this.getLeaves((Z=u.properties)===null||Z===void 0?void 0:Z.cluster_id);if(u.properties.clusterData=Q,A&&O){const ae=Q==null?void 0:Q.map(gt=>({[A]:gt.properties[A]})),xe=qc(ae,A),Be=Sh(O,xe),it="point_"+O;u.properties[it]=Be.toFixed(2)}}const Y=this.clusterMarker(u);this.clusterMarkers.push(Y),Y.addTo(this.scene)})}getLeaves(e,r=1/0,n=0){return e?this.clusterIndex.getLeaves(e,r,n):null}clusterMarker(e){const r=this.markerLayerOption.clusterOption,{element:n=this.generateElement.bind(this)}=r;return new Tv({element:n(e)}).setLnglat({lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]})}normalMarker(e){const r=e.properties.marker_id;return this.markers[r]}update(){if(!this.mapsService||this.markers.length===0)return;const e=this.mapsService.getZoom(),r=this.mapsService.getBounds();(!this.bbox||Math.abs(e-this.zoom)>=1||!is(this.bbox,r))&&(this.bbox=ai(r,.5),this.zoom=Math.floor(e),this.getClusterMarker(this.bbox,this.zoom))}generateElement(e){const r=Xo("div","l7-marker-cluster"),n=Xo("div","",r),a=Xo("span","",n),{field:u,method:y}=this.markerLayerOption.clusterOption;e.properties.point_count=e.properties.point_count||1;const A=u&&y?e.properties["point_"+y]||e.properties[u]:e.properties.point_count;return a.textContent=A,r}}var lE=Se(61227);class Xd extends Th(){constructor(e){super(),(0,K.Z)(this,"controlOption",void 0),(0,K.Z)(this,"container",void 0),(0,K.Z)(this,"isShow",void 0),(0,K.Z)(this,"sceneContainer",void 0),(0,K.Z)(this,"scene",void 0),(0,K.Z)(this,"mapsService",void 0),(0,K.Z)(this,"renderService",void 0),(0,K.Z)(this,"layerService",void 0),(0,K.Z)(this,"controlService",void 0),(0,K.Z)(this,"configService",void 0),Xd.controlCount++,this.controlOption=(0,Wt.Z)((0,Wt.Z)({},this.getDefault(e)),e||{})}getOptions(){return this.controlOption}setOptions(e){const r=this.getDefault(e);Object.entries(e).forEach(([n,a])=>{a===void 0&&(e[n]=r[n])}),"position"in e&&this.setPosition(e.position),"className"in e&&this.setClassName(e.className),"style"in e&&this.setStyle(e.style),this.controlOption=(0,Wt.Z)((0,Wt.Z)({},this.controlOption),e)}addTo(e){this.mapsService=e.mapService,this.renderService=e.rendererService,this.layerService=e.layerService,this.controlService=e.controlService,this.configService=e.globalConfigService,this.scene=e.sceneService,this.sceneContainer=e,this.isShow=!0,this.container=this.onAdd(),dl(this.container,"l7-control");const{className:r,style:n}=this.controlOption;return r&&this.setClassName(r),n&&this.setStyle(n),this.insertContainer(),this.emit("add",this),this}remove(){if(!this.mapsService)return this;au(this.container),this.onRemove(),this.emit("remove",this)}onAdd(){return Xo("div")}onRemove(){}show(){const e=this.container;tc(e,"l7-control--hide"),this.isShow=!0,this.emit("show",this)}hide(){const e=this.container;dl(e,"l7-control--hide"),this.isShow=!1,this.emit("hide",this)}getDefault(e){return{position:Mt.TOPRIGHT,name:`${Xd.controlCount}`}}getContainer(){return this.container}getIsShow(){return this.isShow}_refocusOnMap(e){if(this.mapsService&&e&&e.screenX>0&&e.screenY>0){const r=this.mapsService.getContainer();r!==null&&r.focus()}}setPosition(e=Mt.TOPLEFT){const r=this.controlService;return r&&r.removeControl(this),this.controlOption.position=e,r&&r.addControl(this,this.sceneContainer),this}setClassName(e){const r=this.container,{className:n}=this.controlOption;n&&tc(r,n),e&&dl(r,e)}setStyle(e){const r=this.container;e?r.setAttribute("style",e):r.removeAttribute("style")}insertContainer(){const e=this.controlOption.position,r=this.container;if(e instanceof Element)e.appendChild(r);else{const n=this.controlService.controlCorners[e];["bottomleft","bottomright","righttop","rightbottom"].includes(e)?n.insertBefore(r,n.firstChild):n.appendChild(r)}}checkUpdateOption(e,r){return r.some(n=>n in e)}}(0,K.Z)(Xd,"controlCount",0);class hg extends Xd{constructor(...e){super(...e),(0,K.Z)(this,"isDisable",!1),(0,K.Z)(this,"button",void 0),(0,K.Z)(this,"buttonText",void 0),(0,K.Z)(this,"buttonIcon",void 0)}setIsDisable(e){if(this.isDisable=e,e){var r;(r=this.button)===null||r===void 0||r.setAttribute("disabled","true")}else{var n;(n=this.button)===null||n===void 0||n.removeAttribute("disabled")}}createButton(e=""){return Xo("button",`l7-button-control ${e}`)}onAdd(){this.button=this.createButton(),this.isDisable=!1;const{title:e,btnText:r,btnIcon:n}=this.controlOption;return this.setBtnTitle(e),this.setBtnText(r),this.setBtnIcon(n),this.button}onRemove(){this.button=this.buttonIcon=this.buttonText=void 0,this.isDisable=!1}setOptions(e){const{title:r,btnText:n,btnIcon:a}=e;this.checkUpdateOption(e,["title"])&&this.setBtnTitle(r),this.checkUpdateOption(e,["btnIcon"])&&this.setBtnIcon(a),this.checkUpdateOption(e,["btnText"])&&this.setBtnText(n),super.setOptions(e)}setBtnTitle(e){var r;(r=this.button)===null||r===void 0||r.setAttribute("title",e!=null?e:"")}setBtnIcon(e){if(this.buttonIcon&&au(this.buttonIcon),e){var r;const u=(r=this.button)===null||r===void 0?void 0:r.firstChild;if(u){var n;(n=this.button)===null||n===void 0||n.insertBefore(e,u)}else{var a;(a=this.button)===null||a===void 0||a.appendChild(e)}this.buttonIcon=e}}setBtnText(e){if(this.button)if(tc(this.button,"l7-button-control--row"),tc(this.button,"l7-button-control--column"),e){let n=this.buttonText;if(!n){var r;n=Xo("div","l7-button-control__text"),(r=this.button)===null||r===void 0||r.appendChild(n),this.buttonText=n}n.innerText=e,dl(this.button,this.controlOption.vertical?"l7-button-control--column":"l7-button-control--row")}else!e&&this.buttonText&&(au(this.buttonText),this.buttonText=void 0)}}class qg extends Yl.EventEmitter{get buttonRect(){return this.button.getBoundingClientRect()}constructor(e,r){super(),(0,K.Z)(this,"popperDOM",void 0),(0,K.Z)(this,"contentDOM",void 0),(0,K.Z)(this,"button",void 0),(0,K.Z)(this,"option",void 0),(0,K.Z)(this,"isShow",!1),(0,K.Z)(this,"content",void 0),(0,K.Z)(this,"timeout",null),(0,K.Z)(this,"show",()=>this.isShow||!this.contentDOM.innerHTML?this:(this.resetPopperPosition(),tc(this.popperDOM,"l7-popper-hide"),this.isShow=!0,this.option.unique&&qg.conflictPopperList.forEach(n=>{n!==this&&n.isShow&&n.hide()}),this.emit("show"),window.addEventListener("pointerdown",this.onPopperUnClick),this)),(0,K.Z)(this,"hide",()=>this.isShow?(dl(this.popperDOM,"l7-popper-hide"),this.isShow=!1,this.emit("hide"),window.removeEventListener("pointerdown",this.onPopperUnClick),this):this),(0,K.Z)(this,"setHideTimeout",()=>{this.timeout||(this.timeout=window.setTimeout(()=>{this.isShow&&(this.hide(),this.timeout=null)},300))}),(0,K.Z)(this,"clearHideTimeout",()=>{this.timeout&&(window.clearTimeout(this.timeout),this.timeout=null)}),(0,K.Z)(this,"onBtnClick",()=>{this.isShow?this.hide():this.show()}),(0,K.Z)(this,"onPopperUnClick",n=>{rh(n.target,[".l7-button-control",".l7-popper-content"])||this.hide()}),(0,K.Z)(this,"onBtnMouseLeave",()=>{this.setHideTimeout()}),(0,K.Z)(this,"onBtnMouseMove",()=>{this.clearHideTimeout(),!this.isShow&&this.show()}),this.button=e,this.option=r,this.init(),r.unique&&qg.conflictPopperList.push(this)}getPopperDOM(){return this.popperDOM}getIsShow(){return this.isShow}getContent(){return this.content}setContent(e){typeof e=="string"?this.contentDOM.innerHTML=e:e instanceof HTMLElement&&(Ac(this.contentDOM),this.contentDOM.appendChild(e)),this.content=e}init(){const{trigger:e}=this.option;this.popperDOM=this.createPopper(),e==="click"?this.button.addEventListener("click",this.onBtnClick):(this.button.addEventListener("mousemove",this.onBtnMouseMove),this.button.addEventListener("mouseleave",this.onBtnMouseLeave),this.popperDOM.addEventListener("mousemove",this.onBtnMouseMove),this.popperDOM.addEventListener("mouseleave",this.onBtnMouseLeave))}destroy(){this.button.removeEventListener("click",this.onBtnClick),this.button.removeEventListener("mousemove",this.onBtnMouseMove),this.button.removeEventListener("mousemove",this.onBtnMouseLeave),this.popperDOM.removeEventListener("mousemove",this.onBtnMouseMove),this.popperDOM.removeEventListener("mouseleave",this.onBtnMouseLeave),au(this.popperDOM)}resetPopperPosition(){const e={},{container:r,offset:n=[0,0],placement:a}=this.option,[u,y]=n,A=this.button.getBoundingClientRect(),O=r.getBoundingClientRect(),{left:Z,right:Y,top:Q,bottom:ae}=$p(A,O);let xe=!1,Be=!1;/^(left|right)/.test(a)?(a.includes("left")?e.right=`${A.width+Y}px`:a.includes("right")&&(e.left=`${A.width+Z}px`),a.includes("start")?e.top=`${Q}px`:a.includes("end")?e.bottom=`${ae}px`:(e.top=`${Q+A.height/2}px`,Be=!0,e.transform=`translate(${u}px, calc(${y}px - 50%))`)):/^(top|bottom)/.test(a)&&(a.includes("top")?e.bottom=`${A.height+ae}px`:a.includes("bottom")&&(e.top=`${A.height+Q}px`),a.includes("start")?e.left=`${Z}px`:a.includes("end")?e.right=`${Y}px`:(e.left=`${Z+A.width/2}px`,xe=!0,e.transform=`translate(calc(${u}px - 50%), ${y}px)`)),e.transform=`translate(calc(${u}px - ${xe?"50%":"0%"}), calc(${y}px - ${Be?"50%":"0%"})`;const it=a.split("-");it.length&&dl(this.popperDOM,it.map(gt=>`l7-popper-${gt}`).join(" ")),Fs(this.popperDOM,jc(e))}createPopper(){const{container:e,className:r="",content:n}=this.option,a=Xo("div",`l7-popper l7-popper-hide ${r}`),u=Xo("div","l7-popper-content"),y=Xo("div","l7-popper-arrow");return a.appendChild(u),a.appendChild(y),e.appendChild(a),this.popperDOM=a,this.contentDOM=u,n&&this.setContent(n),a}}(0,K.Z)(qg,"conflictPopperList",[]);const xb={topleft:"right-start",topcenter:"bottom",topright:"left-start",bottomleft:"right-end",bottomcenter:"top",bottomright:"left-end",lefttop:"bottom-start",leftcenter:"right",leftbottom:"top-start",righttop:"bottom-end",rightcenter:"left",rightbottom:"top-end"};class Av extends hg{constructor(...e){super(...e),(0,K.Z)(this,"popper",void 0)}getPopper(){return this.popper}hide(){this.popper.hide(),super.hide()}getDefault(e){var r;const n=super.getDefault(e),a=(r=e==null?void 0:e.position)!==null&&r!==void 0?r:n.position;return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{popperPlacement:a instanceof Element?"bottom":xb[a],popperTrigger:"click"})}onAdd(){const e=super.onAdd();return this.initPopper(),e}onRemove(){this.popper.destroy()}initPopper(){const{popperClassName:e,popperPlacement:r,popperTrigger:n}=this.controlOption,a=this.mapsService.getMapContainer();return this.popper=new qg(this.button,{className:e,placement:r,trigger:n,container:a,unique:!0}),this.popper.on("show",()=>{this.emit("popperShow",this)}).on("hide",()=>{this.emit("popperHide",this)}),this.popper}setOptions(e){if(super.setOptions(e),this.checkUpdateOption(e,["popperPlacement","popperTrigger","popperClassName"])){const r=this.popper.getContent();this.popper.destroy(),this.initPopper(),this.popper.setContent(r)}}}var pg=function(t){return t.ActiveOptionClassName="l7-select-control-item-active",t.OptionValueAttrKey="data-option-value",t.OptionIndexAttrKey="data-option-index",t}(pg||{});class Cv extends Av{constructor(...e){super(...e),(0,K.Z)(this,"selectValue",[]),(0,K.Z)(this,"optionDOMList",void 0),(0,K.Z)(this,"createNormalOption",r=>{const n=this.selectValue.includes(r.value),a=Xo("div",`l7-select-control-item ${n?pg.ActiveOptionClassName:""}`);this.getIsMultiple()?a.appendChild(this.createCheckbox(n)):a.appendChild(this.createRadio(n)),r.icon&&a.appendChild(r.icon);const u=Xo("span");return u.innerText=r.text,a.appendChild(u),a}),(0,K.Z)(this,"onItemClick",r=>{if(this.getIsMultiple()){const n=this.selectValue.findIndex(a=>a===r.value);n>-1?this.selectValue.splice(n,1):this.selectValue=[...this.selectValue,r.value]}else this.selectValue=[r.value];this.setSelectValue(this.selectValue)})}setOptions(e){super.setOptions(e);const{options:r}=e;r&&this.popper.setContent(this.getPopperContent(r))}onAdd(){const e=super.onAdd(),{defaultValue:r}=this.controlOption;return r&&(this.selectValue=this.transSelectValue(r)),this.popper.setContent(this.getPopperContent(this.controlOption.options)),e}getSelectValue(){return this.getIsMultiple()?this.selectValue:this.selectValue[0]}setSelectValue(e,r=!0){const n=this.transSelectValue(e);this.optionDOMList.forEach(a=>{const u=a.getAttribute(pg.OptionValueAttrKey),y=a.querySelector("input[type=checkbox]"),A=a.querySelector("input[type=radio]"),O=n.includes(u),Z=(Y,Q)=>{Kh(a,pg.ActiveOptionClassName,Q),Y&&Jh(Y,Q)};Z(y,O),Z(A,O)}),this.selectValue=n,r&&this.emit("selectChange",this.getIsMultiple()?n:n[0])}getIsMultiple(){return!1}getPopperContent(e){const r=this.isImageOptions(),n=Xo("div",r?"l7-select-control--image":"l7-select-control--normal");this.getIsMultiple()&&dl(n,"l7-select-control--multiple");const a=e.map((u,y)=>{const A=r?this.createImageOption(u):this.createNormalOption(u);return A.setAttribute(pg.OptionValueAttrKey,u.value),A.setAttribute(pg.OptionIndexAttrKey,window.String(y)),A.addEventListener("click",this.onItemClick.bind(this,u)),A});return n.append(...a),this.optionDOMList=a,n}createImageOption(e){const r=this.selectValue.includes(e.value),n=Xo("div",`l7-select-control-item ${r?pg.ActiveOptionClassName:""}`),a=Xo("img");a.setAttribute("src",e.img),kh(a),n.appendChild(a);const u=Xo("div","l7-select-control-item-row");this.getIsMultiple()&&n.appendChild(this.createCheckbox(r));const y=Xo("span");return y.innerText=e.text,u.appendChild(y),n.appendChild(u),n}createCheckbox(e){const r=Xo("input");return r.setAttribute("type","checkbox"),e&&Jh(r,!0),r}createRadio(e){const r=Xo("input");return r.setAttribute("type","radio"),e&&Jh(r,!0),r}isImageOptions(){return!!this.controlOption.options.find(e=>e.img)}transSelectValue(e){return Array.isArray(e)?e:[e]}}const km=t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.classList.add("l7-iconfont"),e.setAttribute("aria-hidden","true");const r=document.createElementNS("http://www.w3.org/2000/svg","use");return r.setAttributeNS("http://www.w3.org/1999/xlink","href",`#${t}`),e.appendChild(r),e};class fg extends hg{constructor(...e){var r;super(...e),r=this,(0,K.Z)(this,"onClick",(0,Nr.Z)(function*(){const{onExport:n}=r.controlOption;n==null||n(yield r.getImage())})),(0,K.Z)(this,"mergeImage",(0,Nr.Z)(function*(...n){var a,u;const{imageType:y}=r.controlOption,{width:A=0,height:O=0}=(a=(u=r.mapsService.getContainer())===null||u===void 0?void 0:u.getBoundingClientRect())!==null&&a!==void 0?a:{},Z=document.createElement("canvas");Z.width=A,Z.height=O;const Y=Z.getContext("2d");return(yield Promise.all(n.map(ae=>new Promise(xe=>{const Be=new Image;Be.onload=()=>{xe(Be)},Be.src=ae})))).forEach(ae=>{Y==null||Y.drawImage(ae,0,0,A,O)}),Z.toDataURL(`image/${y}`)}))}onAdd(){const e=super.onAdd();return e.addEventListener("click",this.onClick),e}getDefault(e){return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{title:"\u5BFC\u51FA\u56FE\u7247",btnIcon:km("l7-icon-export-picture"),imageType:"png"})}getImage(){var e=this;return(0,Nr.Z)(function*(){const r=yield e.mapsService.exportMap("png"),n=yield e.scene.exportPng("png");return e.mergeImage(...[r,n].filter(a=>a))})()}}const _0=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],Mm=(()=>{if(typeof document=="undefined")return!1;const t=_0[0],e={};for(const r of _0)if((r==null?void 0:r[1])in document){for(const[a,u]of r.entries())e[t[a]]=u;return e}return!1})(),_y={change:Mm.fullscreenchange,error:Mm.fullscreenerror};let Rd={request(t=document.documentElement,e){return new Promise((r,n)=>{const a=()=>{Rd.off("change",a),r()};Rd.on("change",a);const u=t[Mm.requestFullscreen](e);u instanceof Promise&&u.then(a).catch(n)})},exit(){return new Promise((t,e)=>{if(!Rd.isFullscreen){t();return}const r=()=>{Rd.off("change",r),t()};Rd.on("change",r);const n=document[Mm.exitFullscreen]();n instanceof Promise&&n.then(r).catch(e)})},toggle(t,e){return Rd.isFullscreen?Rd.exit():Rd.request(t,e)},onchange(t){Rd.on("change",t)},onerror(t){Rd.on("error",t)},on(t,e){const r=_y[t];r&&document.addEventListener(r,e,!1)},off(t,e){const r=_y[t];r&&document.removeEventListener(r,e,!1)},raw:Mm};Object.defineProperties(Rd,{isFullscreen:{get:()=>!!document[Mm.fullscreenElement]},element:{enumerable:!0,get:()=>{var t;return(t=document[Mm.fullscreenElement])!==null&&t!==void 0?t:void 0}},isEnabled:{enumerable:!0,get:()=>!!document[Mm.fullscreenEnabled]}}),Mm||(Rd={isEnabled:!1});var Mv=Rd;class yy extends hg{constructor(e){var r;super(e),r=this,(0,K.Z)(this,"isFullscreen",!1),(0,K.Z)(this,"mapContainer",void 0),(0,K.Z)(this,"toggleFullscreen",(0,Nr.Z)(function*(){Mv.isEnabled&&(yield Mv.toggle(r.mapContainer))})),(0,K.Z)(this,"onClick",()=>{this.toggleFullscreen()}),(0,K.Z)(this,"onFullscreenChange",()=>{this.isFullscreen=!!document.fullscreenElement;const{btnText:n,btnIcon:a,title:u,exitBtnText:y,exitBtnIcon:A,exitTitle:O}=this.controlOption;this.isFullscreen?(this.setBtnTitle(O),this.setBtnText(y),this.setBtnIcon(A)):(this.setBtnTitle(u),this.setBtnText(n),this.setBtnIcon(a)),this.emit("fullscreenChange",this.isFullscreen)}),Mv.isEnabled||console.warn("\u5F53\u524D\u6D4F\u89C8\u5668\u73AF\u5883\u4E0D\u652F\u6301\u5BF9\u5730\u56FE\u5168\u5C4F\u5316")}setOptions(e){const{exitBtnText:r,exitBtnIcon:n,exitTitle:a}=e;this.isFullscreen&&(this.checkUpdateOption(e,["exitBtnIcon"])&&this.setBtnIcon(n),this.checkUpdateOption(e,["exitBtnText"])&&this.setBtnText(r),this.checkUpdateOption(e,["exitTitle"])&&this.setBtnTitle(a)),super.setOptions(e)}onAdd(){const e=super.onAdd();return e.addEventListener("click",this.onClick),this.mapContainer=wc(this.scene.getSceneConfig().id),this.mapContainer.addEventListener("fullscreenchange",this.onFullscreenChange),e}onRemove(){super.onRemove(),this.mapContainer.removeEventListener("fullscreenchange",this.onFullscreenChange)}getDefault(e){return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{title:"\u5168\u5C4F",btnIcon:km("l7-icon-fullscreen"),exitTitle:"\u9000\u51FA\u5168\u5C4F",exitBtnIcon:km("l7-icon-exit-fullscreen")})}}class xy extends hg{constructor(e){var r;super(e),r=this,(0,K.Z)(this,"getGeoLocation",()=>new Promise((n,a)=>{window.navigator.geolocation.getCurrentPosition(({coords:u})=>{const{longitude:y,latitude:A}=u!=null?u:{};!isNaN(y)&&!isNaN(A)?n([y,A]):a()},u=>{a(u)})})),(0,K.Z)(this,"onClick",(0,Nr.Z)(function*(){if(!window.navigator.geolocation)return;const{transform:n}=r.controlOption,a=yield r.getGeoLocation(),u=r.mapsService.getZoom();r.mapsService.setZoomAndCenter(u>15?u:15,n?yield n(a):a)})),window.navigator.geolocation||console.warn("\u5F53\u524D\u6D4F\u89C8\u5668\u73AF\u5883\u4E0D\u652F\u6301\u83B7\u53D6\u5730\u7406\u5B9A\u4F4D")}getDefault(e){return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{title:"\u5B9A\u4F4D",btnIcon:km("l7-icon-reposition")})}onAdd(){const e=super.onAdd();return e.addEventListener("click",this.onClick),e}}function by(t){return Object.keys(t!=null?t:{}).every(e=>["layer","name","img"].includes(e))}class bb extends Cv{constructor(...e){super(...e),(0,K.Z)(this,"onLayerChange",()=>{var r;(r=this.controlOption.layers)!==null&&r!==void 0&&r.length||(this.selectValue=this.getLayerVisible(),this.setOptions({options:this.getLayerOptions()}))}),(0,K.Z)(this,"onLayerVisibleChane",()=>{this.setSelectValue(this.getLayerVisible())}),(0,K.Z)(this,"onSelectChange",()=>{this.layers.forEach(r=>{const n=this.selectValue.includes(r.name),a=r.isVisible();n&&!a&&r.show(),!n&&a&&r.hide()})})}get layers(){const e=this.layerService,{layers:r}=this.controlOption;if(Array.isArray(r)&&r.length){const n=[];return r.forEach(a=>{if(a instanceof Object&&(by(a)?n.push(a.layer):n.push(a)),typeof a=="string"){const u=e.getLayer(a)||e.getLayerByName(a);u&&n.push(u)}}),n}return e.getLayers()||[]}getDefault(e){var r;return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{title:"\u56FE\u5C42\u63A7\u5236",btnIcon:km("l7-icon-layer"),options:[],multiple:(r=e==null?void 0:e.multiple)!==null&&r!==void 0?r:!0})}getLayerVisible(){return this.layers.filter(e=>e.isVisible()).map(e=>e.name)}getLayerOptions(){const{layers:e}=this.controlOption,r=e==null?void 0:e.every(n=>n.img);return e?e==null?void 0:e.map(n=>{if(by(n))return{text:n.name||n.layer.name,value:n.layer.name,img:r?n.img:void 0};if(typeof n=="string"){const a=this.layerService.getLayer(n)||this.layerService.getLayerByName(n);return{text:a==null?void 0:a.name,value:a==null?void 0:a.name}}return{text:n.name,value:n.name}}):this.layers.map(n=>({text:n.name,value:n.name}))}setOptions(e){const r=this.checkUpdateOption(e,["layers","multiple"]);super.setOptions(e),r&&(this.controlOption.multiple===!1&&this.handleSingleSelection(),this.selectValue=this.getLayerVisible(),this.controlOption.options=this.getLayerOptions(),this.popper.setContent(this.getPopperContent(this.controlOption.options)))}handleSingleSelection(){this.layers.forEach((e,r)=>{r===0?e.show():e.hide()})}onAdd(){var e;return this.controlOption.multiple===!1&&this.handleSingleSelection(),(e=this.controlOption.options)!==null&&e!==void 0&&e.length||(this.controlOption.options=this.getLayerOptions()),this.controlOption.defaultValue||(this.controlOption.defaultValue=this.getLayerVisible()),this.on("selectChange",this.onSelectChange),this.layerService.on("layerChange",this.onLayerChange),super.onAdd()}onRemove(){this.off("selectChange",this.onSelectChange),this.layerService.off("layerChange",this.onLayerChange)}getIsMultiple(){return this.controlOption.multiple}}class Ey extends Xd{getDefault(){return{position:Mt.BOTTOMLEFT,name:"logo",href:"https://l7.antv.antgroup.com/",img:"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*GRb1TKp4HcMAAAAAAAAAAAAAARQnAQ"}}onAdd(){const e=Xo("div","l7-control-logo");return this.setLogoContent(e),e}onRemove(){return null}setOptions(e){super.setOptions(e),this.checkUpdateOption(e,["img","href"])&&(Ac(this.container),this.setLogoContent(this.container))}setLogoContent(e){const{href:r,img:n}=this.controlOption,a=Xo("img");if(a.setAttribute("src",n),a.setAttribute("aria-label","AntV logo"),kh(a),r){const u=Xo("a","l7-control-logo-link");u.target="_blank",u.href=r,u.rel="noopener nofollow",u.setAttribute("rel","noopener nofollow"),u.appendChild(a),e.appendChild(u)}else e.appendChild(a)}}const wy={normal:{text:"\u6807\u51C6",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*qdFDSbvIalgAAAAAAAAAAAAADmJ7AQ/original"},light:{text:"\u6708\u5149\u94F6",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*d-vcRLzu8WIAAAAAAAAAAAAADmJ7AQ/original"},dark:{text:"\u5E7B\u5F71\u9ED1",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*HMbRTI3XnpIAAAAAAAAAAAAADmJ7AQ/original"},fresh:{text:"\u8349\u8272\u9752",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*kqaGQ5kjSiAAAAAAAAAAAAAADmJ7AQ/original"},grey:{text:"\u96C5\u58EB\u7070",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*XegrTpZIbqAAAAAAAAAAAAAADmJ7AQ/original"},graffiti:{text:"\u6D82\u9E26",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*G5g9SZ_Jg4cAAAAAAAAAAAAADmJ7AQ/original"},macaron:{text:"\u9A6C\u5361\u9F99",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*irVvQbDpQMwAAAAAAAAAAAAADmJ7AQ/original"},darkblue:{text:"\u6781\u591C\u84DD",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*lKRzQYB4iR0AAAAAAAAAAAAADmJ7AQ/original"},wine:{text:"\u9171\u7C7D",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*orY0T7QL-lwAAAAAAAAAAAAADmJ7AQ/original"}},Eb={normal:{text:"\u6807\u51C6",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*kIyZTok4Uk0AAAAAAAAAAAAADmJ7AQ/original"},light:{text:"\u4EAE",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*Z3JRQKDI-cIAAAAAAAAAAAAADmJ7AQ/original"},dark:{text:"\u6697",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*d7HCQbfmyaoAAAAAAAAAAAAADmJ7AQ/original"},satellite:{text:"\u536B\u661F",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*TytUT6pS9okAAAAAAAAAAAAADmJ7AQ/original"},outdoors:{text:"\u6237\u5916",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*hWwFSYJEFWsAAAAAAAAAAAAADmJ7AQ/original"}};class y0 extends Cv{constructor(...e){super(...e),(0,K.Z)(this,"onMapThemeChange",()=>{this.mapsService.setMapStyle(this.selectValue[0])})}getDefault(e){return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{title:"\u5730\u56FE\u6837\u5F0F",btnIcon:km("l7-icon-color"),options:[]})}getStyleOptions(){const e=this.mapsService.getType()==="mapbox"?Eb:wy;return Object.entries(this.mapsService.getMapStyleConfig()).filter(([r,n])=>typeof n=="string"&&r!=="blank").map(([r,n])=>{var a;const{text:u,img:y}=(a=e[r])!==null&&a!==void 0?a:{};return{text:u!=null?u:r,value:n,img:y,key:r}})}getMapStyle(){return this.mapsService.getMapStyle()}onAdd(){var e;if((e=this.controlOption.options)!==null&&e!==void 0&&e.length||(this.controlOption.options=this.getStyleOptions()),this.controlOption.defaultValue){var r,n;const a=this.controlOption.defaultValue;this.controlOption.defaultValue=(r=(n=this.controlOption.options.find(u=>u.key===a))===null||n===void 0?void 0:n.value)!==null&&r!==void 0?r:a}else{const a=this.getMapStyle();a?this.controlOption.defaultValue=a:this.mapsService.map.once("styledata",()=>{const u=this.mapsService.getMapStyle();this.controlOption.defaultValue=u,this.setSelectValue(u,!1)})}return this.on("selectChange",this.onMapThemeChange),super.onAdd()}getIsMultiple(){return!1}}class wb extends Xd{constructor(...e){super(...e),(0,K.Z)(this,"location",[0,0]),(0,K.Z)(this,"onMouseMove",r=>{let n=this.location;const a=r.lngLat||r.lnglat,{transform:u}=this.controlOption;a&&(n=[a.lng,a.lat]),this.location=n,u&&(n=u(n)),this.insertLocation2HTML(n),this.emit("locationChange",n)})}getLocation(){return this.location}getDefault(e){return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{position:Mt.BOTTOMLEFT,transform:([r,n])=>[+(+r).toFixed(6),+(+n).toFixed(6)]})}onAdd(){const e=Xo("div","l7-control-mouse-location");return e.innerHTML="&nbsp;",this.mapsService.on("mousemove",this.onMouseMove),e}onRemove(){this.mapsService.off("mousemove",this.onMouseMove)}insertLocation2HTML(e){this.container.innerText=e.join(", ")}}class Sy extends Xd{constructor(...e){super(...e),(0,K.Z)(this,"mScale",void 0),(0,K.Z)(this,"iScale",void 0),(0,K.Z)(this,"update",()=>{const r=this.mapsService,{maxWidth:n}=this.controlOption,a=r.getSize()[1]/2,u=r.containerToLngLat([0,a]),y=r.containerToLngLat([n,a]),A=bu([u.lng,u.lat],[y.lng,y.lat]);this.updateScales(A)})}getDefault(e){return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{name:"scale",position:Mt.BOTTOMLEFT,maxWidth:100,metric:!0,updateWhenIdle:!1,imperial:!1,lockWidth:!0})}onAdd(){const r=Xo("div","l7-control-scale");this.resetScaleLines(r);const{updateWhenIdle:n}=this.controlOption;return this.mapsService.on(n?"moveend":"mapmove",this.update),this.mapsService.on(n?"zoomend":"zoomchange",this.update),r}onRemove(){const{updateWhenIdle:e}=this.controlOption;this.mapsService.off(e?"zoomend":"zoomchange",this.update),this.mapsService.off(e?"moveend":"mapmove",this.update)}setOptions(e){super.setOptions(e),this.checkUpdateOption(e,["lockWidth","maxWidth","metric","updateWhenIdle","imperial"])&&this.resetScaleLines(this.container)}updateScales(e){const{metric:r,imperial:n}=this.controlOption;r&&e&&this.updateMetric(e),n&&e&&this.updateImperial(e)}resetScaleLines(e){Ac(e);const{metric:r,imperial:n,maxWidth:a,lockWidth:u}=this.controlOption;u&&Fs(e,`width: ${a}px`),r&&(this.mScale=Xo("div","l7-control-scale-line",e)),n&&(this.iScale=Xo("div","l7-control-scale-line",e)),this.update()}updateScale(e,r,n){const{maxWidth:a}=this.controlOption;e.style.width=Math.round(a*n)+"px",e.innerHTML=r}getRoundNum(e){const r=Math.pow(10,(Math.floor(e)+"").length-1);let n=e/r;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,r*n}updateMetric(e){const r=this.getRoundNum(e),n=r<1e3?r+" m":r/1e3+" km";this.updateScale(this.mScale,n,r/e)}updateImperial(e){const r=e*3.2808399;let n,a,u;r>5280?(n=r/5280,a=this.getRoundNum(n),this.updateScale(this.iScale,a+" mi",a/n)):(u=this.getRoundNum(r),this.updateScale(this.iScale,u+" ft",u/r))}}const{cloneDeep:Pv}=es;class Sb{constructor(){(0,K.Z)(this,"mapService",void 0),(0,K.Z)(this,"fontService",void 0)}apply(e,{styleAttributeService:r,mapService:n,fontService:a}){var u=this;this.mapService=n,this.fontService=a,e.hooks.init.tapPromise("DataMappingPlugin",(0,Nr.Z)(function*(){e.log($t.MappingStart,_n.INIT),u.generateMaping(e,{styleAttributeService:r}),e.log($t.MappingEnd,_n.INIT)})),e.hooks.beforeRenderData.tapPromise("DataMappingPlugin",function(){var y=(0,Nr.Z)(function*(A){if(!A)return A;e.dataState.dataMappingNeedUpdate=!1,e.log($t.MappingStart,_n.UPDATE);const O=u.generateMaping(e,{styleAttributeService:r});return e.log($t.MappingEnd,_n.UPDATE),O});return function(A){return y.apply(this,arguments)}}()),e.hooks.beforeRender.tap("DataMappingPlugin",()=>{const y=e.getSource();if(e.layerModelNeedUpdate||!y||!y.inited)return;const A=r.getLayerStyleAttributes()||[],O=r.getLayerStyleAttribute("filter"),{dataArray:Z}=y.data;if(Array.isArray(Z)&&Z.length===0)return;const Y=A.filter(ae=>ae.needRemapping);let Q=Z;if(O!=null&&O.needRemapping&&O!==null&&O!==void 0&&O.scale&&(Q=Z.filter(ae=>this.applyAttributeMapping(O,ae)[0])),Y.length){const ae=this.mapping(e,Y,Q,e.getEncodedData());e.setEncodedData(ae)}})}generateMaping(e,{styleAttributeService:r}){const n=r.getLayerStyleAttributes()||[],a=r.getLayerStyleAttribute("filter"),{dataArray:u}=e.getSource().data;let y=u;a!=null&&a.scale&&(y=u.filter(O=>this.applyAttributeMapping(a,O)[0])),y=e.processData(y);const A=this.mapping(e,n,y,void 0);return e.setEncodedData(A),e.emit("dataUpdate",null),!0}mapping(e,r,n,a){const u=r.filter(A=>A.scale!==void 0).filter(A=>A.name!=="filter"),y=n.map((A,O)=>{const Z=a?a[O]:{},Y=(0,Wt.Z)({id:A._id,coordinates:A.coordinates},Z);return u.forEach(Q=>{let ae=this.applyAttributeMapping(Q,A);(Q.name==="color"||Q.name==="stroke")&&(ae=ae.map(xe=>Va(xe))),Y[Q.name]=Array.isArray(ae)&&ae.length===1?ae[0]:ae,Q.name==="shape"&&(Y.shape=this.fontService.getIconFontKey(Y[Q.name]))}),Y});return r.forEach(A=>{A.needRemapping=!1}),this.adjustData2Amap2Coordinates(y,e),this.adjustData2SimpleCoordinates(y),y}adjustData2Amap2Coordinates(e,r){if(e.length>0&&this.mapService.version==="GAODE2.x"){const n=r.coordCenter||r.getSource().center;e.filter(a=>!a.originCoordinates).map(a=>{a.version="GAODE2.x",a.originCoordinates=Pv(a.coordinates),a.coordinates=this.mapService.coordToAMap2RelativeCoordinates(a.coordinates,n)})}}adjustData2SimpleCoordinates(e){e.length>0&&this.mapService.version==="SIMPLE"&&e.map(r=>{r.simpleCoordinate||(r.coordinates=this.unProjectCoordinates(r.coordinates),r.simpleCoordinate=!0)})}unProjectCoordinates(e){if(typeof e[0]=="number")return this.mapService.simpleMapCoord.unproject(e);if(e[0]&&e[0][0]instanceof Array){const r=[];return e.map(n=>{const a=[];n.map(u=>{a.push(this.mapService.simpleMapCoord.unproject(u))}),r.push(a)}),r}else{const r=[];return e.map(n=>{r.push(this.mapService.simpleMapCoord.unproject(n))}),r}}applyAttributeMapping(e,r){var n;if(!e.scale)return[];const a=(e==null||(n=e.scale)===null||n===void 0?void 0:n.scalers)||[],u=[];return a.forEach(({field:A})=>{var O;(r.hasOwnProperty(A)||((O=e.scale)===null||O===void 0?void 0:O.type)==="variable")&&u.push(r[A])}),e.mapping?e.mapping(u):[]}getArrowPoints(e,r){const n=[r[0]-e[0],r[1]-e[1]],a=mi(n);return[e[0]+a[0]*1e-4,e[1]+a[1]*1e-4]}}class Tb{constructor(){(0,K.Z)(this,"mapService",void 0)}apply(e){var r=this;this.mapService=e.getContainer().mapService,e.hooks.init.tapPromise("DataSourcePlugin",(0,Nr.Z)(function*(){e.log($t.SourceInitStart,_n.INIT);let n=e.getSource();if(!n){const{data:a,options:u}=e.sourceOption||e.defaultSourceConfig;n=new gy(a,u),e.setSource(n)}n.inited?(r.updateClusterData(e),e.log($t.SourceInitEnd,_n.INIT)):yield new Promise(a=>{n.on("update",u=>{u.type==="inited"&&(r.updateClusterData(e),e.log($t.SourceInitEnd,_n.INIT)),a(null)})})})),e.hooks.beforeRenderData.tapPromise("DataSourcePlugin",(0,Nr.Z)(function*(){const n=r.updateClusterData(e),a=e.dataState.dataSourceNeedUpdate;return e.dataState.dataSourceNeedUpdate=!1,n||a}))}updateClusterData(e){if(e.isTileLayer||e.tileLayer||!e.getSource())return!1;const r=e.getSource(),n=r.cluster,{zoom:a=0}=r.clusterOptions,u=this.mapService.getZoom()-1,y=e.dataState.dataSourceNeedUpdate;return n&&y&&r.updateClusterData(Math.floor(u)),n&&Math.abs(e.clusterZoom-u)>=1?(a!==Math.floor(u)&&r.updateClusterData(Math.floor(u)),e.clusterZoom=u,!0):!1}}function Ty(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Rv(t){return t.length===1&&(t=uE(t)),{left:function(e,r,n,a){for(n==null&&(n=0),a==null&&(a=e.length);n<a;){var u=n+a>>>1;t(e[u],r)<0?n=u+1:a=u}return n},right:function(e,r,n,a){for(n==null&&(n=0),a==null&&(a=e.length);n<a;){var u=n+a>>>1;t(e[u],r)>0?a=u:n=u+1}return n}}}function uE(t){return function(e,r){return Ty(t(e),r)}}var Ay=Rv(Ty),Cy=Ay.right,cE=Ay.left,x0=Cy;function My(t,e){var r=t.length,n=-1,a,u,y;if(e==null){for(;++n<r;)if((a=t[n])!=null&&a>=a)for(u=y=a;++n<r;)(a=t[n])!=null&&(u>a&&(u=a),y<a&&(y=a))}else for(;++n<r;)if((a=e(t[n],n,t))!=null&&a>=a)for(u=y=a;++n<r;)(a=e(t[n],n,t))!=null&&(u>a&&(u=a),y<a&&(y=a));return[u,y]}var Py=Array.prototype,hE=Py.slice,pE=Py.map,Iv=Math.sqrt(50),Lv=Math.sqrt(10),Dv=Math.sqrt(2);function Ov(t,e,r){var n,a=-1,u,y,A;if(e=+e,t=+t,r=+r,t===e&&r>0)return[t];if((n=e<t)&&(u=t,t=e,e=u),(A=Ig(t,e,r))===0||!isFinite(A))return[];if(A>0)for(t=Math.ceil(t/A),e=Math.floor(e/A),y=new Array(u=Math.ceil(e-t+1));++a<u;)y[a]=(t+a)*A;else for(t=Math.floor(t*A),e=Math.ceil(e*A),y=new Array(u=Math.ceil(t-e+1));++a<u;)y[a]=(t-a)/A;return n&&y.reverse(),y}function Ig(t,e,r){var n=(e-t)/Math.max(0,r),a=Math.floor(Math.log(n)/Math.LN10),u=n/Math.pow(10,a);return a>=0?(u>=Iv?10:u>=Lv?5:u>=Dv?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(u>=Iv?10:u>=Lv?5:u>=Dv?2:1)}function Bv(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),a=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),u=n/a;return u>=Iv?a*=10:u>=Lv?a*=5:u>=Dv&&(a*=2),e<t?-a:a}function fE(){var t=identity,e=extent,r=sturges;function n(a){var u,y=a.length,A,O=new Array(y);for(u=0;u<y;++u)O[u]=t(a[u],u,a);var Z=e(O),Y=Z[0],Q=Z[1],ae=r(O,Y,Q);Array.isArray(ae)||(ae=tickStep(Y,Q,ae),ae=range(Math.ceil(Y/ae)*ae,Q,ae));for(var xe=ae.length;ae[0]<=Y;)ae.shift(),--xe;for(;ae[xe-1]>Q;)ae.pop(),--xe;var Be=new Array(xe+1),it;for(u=0;u<=xe;++u)it=Be[u]=[],it.x0=u>0?ae[u-1]:Y,it.x1=u<xe?ae[u]:Q;for(u=0;u<y;++u)A=O[u],Y<=A&&A<=Q&&Be[bisect(ae,A,0,xe)].push(a[u]);return Be}return n.value=function(a){return arguments.length?(t=typeof a=="function"?a:constant(a),n):t},n.domain=function(a){return arguments.length?(e=typeof a=="function"?a:constant([a[0],a[1]]),n):e},n.thresholds=function(a){return arguments.length?(r=typeof a=="function"?a:Array.isArray(a)?constant(slice.call(a)):constant(a),n):r},n}function Fv(t,e,r){return t=map.call(t,number).sort(ascending),Math.ceil((r-e)/(2*(quantile(t,.75)-quantile(t,.25))*Math.pow(t.length,-1/3)))}function Ab(t){return t===null?NaN:+t}function Cb(t,e,r){if(r==null&&(r=Ab),!!(n=t.length)){if((e=+e)<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,a=(n-1)*e,u=Math.floor(a),y=+r(t[u],u,t),A=+r(t[u+1],u+1,t);return y+(A-y)*(a-u)}}function b0(t,e,r,n,a){var u=t*t,y=u*t;return((1-3*t+3*u-y)*e+(4-6*u+3*y)*r+(1+3*t+3*u-3*y)*n+y*a)/6}function Mb(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),a=t[n],u=t[n+1],y=n>0?t[n-1]:2*a-u,A=n<e-1?t[n+2]:2*u-a;return b0((r-n/e)*e,y,a,u,A)}}function Pb(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),a=t[(n+e-1)%e],u=t[n%e],y=t[(n+1)%e],A=t[(n+2)%e];return b0((r-n/e)*e,a,u,y,A)}}function kv(t){return function(){return t}}function Ry(t,e){return function(r){return t+r*e}}function Rb(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function dE(t,e){var r=e-t;return r?Ry(t,r>180||r<-180?r-360*Math.round(r/360):r):constant(isNaN(t)?e:t)}function Ib(t){return(t=+t)==1?Iy:function(e,r){return r-e?Rb(e,r,t):kv(isNaN(e)?r:e)}}function Iy(t,e){var r=e-t;return r?Ry(t,r):kv(isNaN(t)?e:t)}var Ly=function t(e){var r=Ib(e);function n(a,u){var y=r((a=ir(a)).r,(u=ir(u)).r),A=r(a.g,u.g),O=r(a.b,u.b),Z=Iy(a.opacity,u.opacity);return function(Y){return a.r=y(Y),a.g=A(Y),a.b=O(Y),a.opacity=Z(Y),a+""}}return n.gamma=t,n}(1);function Dy(t){return function(e){var r=e.length,n=new Array(r),a=new Array(r),u=new Array(r),y,A;for(y=0;y<r;++y)A=ir(e[y]),n[y]=A.r||0,a[y]=A.g||0,u[y]=A.b||0;return n=t(n),a=t(a),u=t(u),A.opacity=1,function(O){return A.r=n(O),A.g=a(O),A.b=u(O),A+""}}}var Lb=Dy(Mb),mE=Dy(Pb),qd="$";function E0(){}E0.prototype=Oy.prototype={constructor:E0,has:function(t){return qd+t in this},get:function(t){return this[qd+t]},set:function(t,e){return this[qd+t]=e,this},remove:function(t){var e=qd+t;return e in this&&delete this[e]},clear:function(){for(var t in this)t[0]===qd&&delete this[t]},keys:function(){var t=[];for(var e in this)e[0]===qd&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)e[0]===qd&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)e[0]===qd&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)e[0]===qd&&++t;return t},empty:function(){for(var t in this)if(t[0]===qd)return!1;return!0},each:function(t){for(var e in this)e[0]===qd&&t(this[e],e.slice(1),this)}};function Oy(t,e){var r=new E0;if(t instanceof E0)t.each(function(A,O){r.set(O,A)});else if(Array.isArray(t)){var n=-1,a=t.length,u;if(e==null)for(;++n<a;)r.set(n,t[n]);else for(;++n<a;)r.set(e(u=t[n],n,t),u)}else if(t)for(var y in t)r.set(y,t[y]);return r}var Nv=Oy;function gE(){var t=[],e=[],r,n,a;function u(A,O,Z,Y){if(O>=t.length)return r!=null&&A.sort(r),n!=null?n(A):A;for(var Q=-1,ae=A.length,xe=t[O++],Be,it,gt=map(),Bt,Rt=Z();++Q<ae;)(Bt=gt.get(Be=xe(it=A[Q])+""))?Bt.push(it):gt.set(Be,[it]);return gt.each(function(Yt,vr){Y(Rt,vr,u(Yt,O,Z,Y))}),Rt}function y(A,O){if(++O>t.length)return A;var Z,Y=e[O-1];return n!=null&&O>=t.length?Z=A.entries():(Z=[],A.each(function(Q,ae){Z.push({key:ae,values:y(Q,O)})})),Y!=null?Z.sort(function(Q,ae){return Y(Q.key,ae.key)}):Z}return a={object:function(A){return u(A,0,Db,Ob)},map:function(A){return u(A,0,By,zv)},entries:function(A){return y(u(A,0,By,zv),0)},key:function(A){return t.push(A),a},sortKeys:function(A){return e[t.length-1]=A,a},sortValues:function(A){return r=A,a},rollup:function(A){return n=A,a}}}function Db(){return{}}function Ob(t,e,r){t[e]=r}function By(){return map()}function zv(t,e,r){t.set(e,r)}function w0(){}var dg=Nv.prototype;w0.prototype=Bb.prototype={constructor:w0,has:dg.has,add:function(t){return t+="",this[qd+t]=t,this},remove:dg.remove,clear:dg.clear,values:dg.keys,size:dg.size,empty:dg.empty,each:dg.each};function Bb(t,e){var r=new w0;if(t instanceof w0)t.each(function(u){r.add(u)});else if(t){var n=-1,a=t.length;if(e==null)for(;++n<a;)r.add(t[n]);else for(;++n<a;)r.add(e(t[n],n,t))}return r}var vE=null,Fy=Array.prototype,Uv=Fy.map,Km=Fy.slice;function Jm(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function ky(t,e){switch(arguments.length){case 0:break;case 1:this.interpolator(t);break;default:this.interpolator(e).domain(t);break}return this}var Ny={name:"implicit"};function S0(){var t=Nv(),e=[],r=[],n=Ny;function a(u){var y=u+"",A=t.get(y);if(!A){if(n!==Ny)return n;t.set(y,A=e.push(u))}return r[(A-1)%r.length]}return a.domain=function(u){if(!arguments.length)return e.slice();e=[],t=Nv();for(var y=-1,A=u.length,O,Z;++y<A;)t.has(Z=(O=u[y])+"")||t.set(Z,e.push(O));return a},a.range=function(u){return arguments.length?(r=Km.call(u),a):r.slice()},a.unknown=function(u){return arguments.length?(n=u,a):n},a.copy=function(){return S0(e,r).unknown(n)},Jm.apply(a,arguments),a}function zy(){var t=ordinal().unknown(void 0),e=t.domain,r=t.range,n=[0,1],a,u,y=!1,A=0,O=0,Z=.5;delete t.unknown;function Y(){var Q=e().length,ae=n[1]<n[0],xe=n[ae-0],Be=n[1-ae];a=(Be-xe)/Math.max(1,Q-A+O*2),y&&(a=Math.floor(a)),xe+=(Be-xe-a*(Q-A))*Z,u=a*(1-A),y&&(xe=Math.round(xe),u=Math.round(u));var it=sequence(Q).map(function(gt){return xe+a*gt});return r(ae?it.reverse():it)}return t.domain=function(Q){return arguments.length?(e(Q),Y()):e()},t.range=function(Q){return arguments.length?(n=[+Q[0],+Q[1]],Y()):n.slice()},t.rangeRound=function(Q){return n=[+Q[0],+Q[1]],y=!0,Y()},t.bandwidth=function(){return u},t.step=function(){return a},t.round=function(Q){return arguments.length?(y=!!Q,Y()):y},t.padding=function(Q){return arguments.length?(A=Math.min(1,O=+Q),Y()):A},t.paddingInner=function(Q){return arguments.length?(A=Math.min(1,Q),Y()):A},t.paddingOuter=function(Q){return arguments.length?(O=+Q,Y()):O},t.align=function(Q){return arguments.length?(Z=Math.max(0,Math.min(1,Q)),Y()):Z},t.copy=function(){return zy(e(),n).round(y).paddingInner(A).paddingOuter(O).align(Z)},initRange.apply(Y(),arguments)}function Uy(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Uy(e())},t}function _E(){return Uy(zy.apply(null,arguments).paddingInner(1))}function yE(t,e){return(isNumberArray(e)?numberArray:Zy)(t,e)}function Zy(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,a=new Array(n),u=new Array(r),y;for(y=0;y<n;++y)a[y]=Vv(t[y],e[y]);for(;y<r;++y)u[y]=e[y];return function(A){for(y=0;y<n;++y)u[y]=a[y](A);return u}}function Fb(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function Lg(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function kb(t,e){var r={},n={},a;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(a in e)a in t?r[a]=Vv(t[a],e[a]):n[a]=e[a];return function(u){for(a in r)n[a]=r[a](u);return n}}var mg=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zv=new RegExp(mg.source,"g");function Nb(t){return function(){return t}}function zb(t){return function(e){return t(e)+""}}function Yg(t,e){var r=mg.lastIndex=Zv.lastIndex=0,n,a,u,y=-1,A=[],O=[];for(t=t+"",e=e+"";(n=mg.exec(t))&&(a=Zv.exec(e));)(u=a.index)>r&&(u=e.slice(r,u),A[y]?A[y]+=u:A[++y]=u),(n=n[0])===(a=a[0])?A[y]?A[y]+=a:A[++y]=a:(A[++y]=null,O.push({i:y,x:Lg(n,a)})),r=Zv.lastIndex;return r<e.length&&(u=e.slice(r),A[y]?A[y]+=u:A[++y]=u),A.length<2?O[0]?zb(O[0].x):Nb(e):(e=O.length,function(Z){for(var Y=0,Q;Y<e;++Y)A[(Q=O[Y]).i]=Q.x(Z);return A.join("")})}function Ub(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),a;return function(u){for(a=0;a<r;++a)n[a]=t[a]*(1-u)+e[a]*u;return n}}function Zb(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Vv(t,e){var r=typeof e,n;return e==null||r==="boolean"?kv(e):(r==="number"?Lg:r==="string"?(n=Gl(e))?(e=n,Ly):Yg:e instanceof Gl?Ly:e instanceof Date?Fb:Zb(e)?Ub:Array.isArray(e)?Zy:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?kb:Lg)(t,e)}function Vb(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function Vy(t){return function(){return t}}function jv(t){return+t}var Hv=[0,1];function jf(t){return t}function T0(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:Vy(isNaN(e)?NaN:.5)}function jy(t){var e=t[0],r=t[t.length-1],n;return e>r&&(n=e,e=r,r=n),function(a){return Math.max(e,Math.min(r,a))}}function jb(t,e,r){var n=t[0],a=t[1],u=e[0],y=e[1];return a<n?(n=T0(a,n),u=r(y,u)):(n=T0(n,a),u=r(u,y)),function(A){return u(n(A))}}function Hb(t,e,r){var n=Math.min(t.length,e.length)-1,a=new Array(n),u=new Array(n),y=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++y<n;)a[y]=T0(t[y],t[y+1]),u[y]=r(e[y],e[y+1]);return function(A){var O=x0(t,A,1,n)-1;return u[O](a[O](A))}}function A0(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Gv(){var t=Hv,e=Hv,r=Vv,n,a,u,y=jf,A,O,Z;function Y(){return A=Math.min(t.length,e.length)>2?Hb:jb,O=Z=null,Q}function Q(ae){return isNaN(ae=+ae)?u:(O||(O=A(t.map(n),e,r)))(n(y(ae)))}return Q.invert=function(ae){return y(a((Z||(Z=A(e,t.map(n),Lg)))(ae)))},Q.domain=function(ae){return arguments.length?(t=Uv.call(ae,jv),y===jf||(y=jy(t)),Y()):t.slice()},Q.range=function(ae){return arguments.length?(e=Km.call(ae),Y()):e.slice()},Q.rangeRound=function(ae){return e=Km.call(ae),r=Vb,Y()},Q.clamp=function(ae){return arguments.length?(y=ae?jy(t):jf,Q):y!==jf},Q.interpolate=function(ae){return arguments.length?(r=ae,Y()):r},Q.unknown=function(ae){return arguments.length?(u=ae,Q):u},function(ae,xe){return n=ae,a=xe,Y()}}function Hy(t,e){return Gv()(t,e)}var Gb=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function C0(t){if(!(e=Gb.exec(t)))throw new Error("invalid format: "+t);var e;return new Pm({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}C0.prototype=Pm.prototype;function Pm(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Pm.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function xE(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function M0(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function Dg(t){return t=M0(Math.abs(t)),t?t[1]:NaN}function Wb(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Dg(e)/3)))*3-Dg(Math.abs(t)))}function $g(t,e){return function(r,n){for(var a=r.length,u=[],y=0,A=t[0],O=0;a>0&&A>0&&(O+A+1>n&&(A=Math.max(1,n-O)),u.push(r.substring(a-=A,a+A)),!((O+=A+1)>n));)A=t[y=(y+1)%t.length];return u.reverse().join(e)}}function bE(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}function Kg(t){e:for(var e=t.length,r=1,n=-1,a;r<e;++r)switch(t[r]){case".":n=a=r;break;case"0":n===0&&(n=r),a=r;break;default:if(!+t[r])break e;n>0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(a+1):t}var Wv;function Xv(t,e){var r=M0(t,e);if(!r)return t+"";var n=r[0],a=r[1],u=a-(Wv=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,y=n.length;return u===y?n:u>y?n+new Array(u-y+1).join("0"):u>0?n.slice(0,u)+"."+n.slice(u):"0."+new Array(1-u).join("0")+M0(t,Math.max(0,e+u-1))[0]}function Gy(t,e){var r=M0(t,e);if(!r)return t+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}var Wy={"%":function(t,e){return(t*100).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:xE,e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return Gy(t*100,e)},r:Gy,s:Xv,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function Xy(t){return t}var qv=Array.prototype.map,qy=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function Xb(t){var e=t.grouping===void 0||t.thousands===void 0?Xy:$g(qv.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",a=t.decimal===void 0?".":t.decimal+"",u=t.numerals===void 0?Xy:bE(qv.call(t.numerals,String)),y=t.percent===void 0?"%":t.percent+"",A=t.minus===void 0?"-":t.minus+"",O=t.nan===void 0?"NaN":t.nan+"";function Z(Q){Q=C0(Q);var ae=Q.fill,xe=Q.align,Be=Q.sign,it=Q.symbol,gt=Q.zero,Bt=Q.width,Rt=Q.comma,Yt=Q.precision,vr=Q.trim,ln=Q.type;ln==="n"?(Rt=!0,ln="g"):Wy[ln]||(Yt===void 0&&(Yt=12),vr=!0,ln="g"),(gt||ae==="0"&&xe==="=")&&(gt=!0,ae="0",xe="=");var cn=it==="$"?r:it==="#"&&/[boxX]/.test(ln)?"0"+ln.toLowerCase():"",Gr=it==="$"?n:/[%p]/.test(ln)?y:"",Pn=Wy[ln],Oo=/[defgprs%]/.test(ln);Yt=Yt===void 0?6:/[gprs]/.test(ln)?Math.max(1,Math.min(21,Yt)):Math.max(0,Math.min(20,Yt));function Da(Bo){var Oa=cn,fl=Gr,Gp,Wp,nl;if(ln==="c")fl=Pn(Bo)+fl,Bo="";else{Bo=+Bo;var Df=Bo<0||1/Bo<0;if(Bo=isNaN(Bo)?O:Pn(Math.abs(Bo),Yt),vr&&(Bo=Kg(Bo)),Df&&+Bo==0&&Be!=="+"&&(Df=!1),Oa=(Df?Be==="("?Be:A:Be==="-"||Be==="("?"":Be)+Oa,fl=(ln==="s"?qy[8+Wv/3]:"")+fl+(Df&&Be==="("?")":""),Oo){for(Gp=-1,Wp=Bo.length;++Gp<Wp;)if(nl=Bo.charCodeAt(Gp),48>nl||nl>57){fl=(nl===46?a+Bo.slice(Gp+1):Bo.slice(Gp))+fl,Bo=Bo.slice(0,Gp);break}}}Rt&&!gt&&(Bo=e(Bo,1/0));var Xm=Oa.length+Bo.length+fl.length,vd=Xm<Bt?new Array(Bt-Xm+1).join(ae):"";switch(Rt&&gt&&(Bo=e(vd+Bo,vd.length?Bt-fl.length:1/0),vd=""),xe){case"<":Bo=Oa+Bo+fl+vd;break;case"=":Bo=Oa+vd+Bo+fl;break;case"^":Bo=vd.slice(0,Xm=vd.length>>1)+Oa+Bo+fl+vd.slice(Xm);break;default:Bo=vd+Oa+Bo+fl;break}return u(Bo)}return Da.toString=function(){return Q+""},Da}function Y(Q,ae){var xe=Z((Q=C0(Q),Q.type="f",Q)),Be=Math.max(-8,Math.min(8,Math.floor(Dg(ae)/3)))*3,it=Math.pow(10,-Be),gt=qy[8+Be/3];return function(Bt){return xe(it*Bt)+gt}}return{format:Z,formatPrefix:Y}}var Jg,Yv,Yy;EE({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function EE(t){return Jg=Xb(t),Yv=Jg.format,Yy=Jg.formatPrefix,Jg}function Qg(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Dg(e)-Dg(t))+1}function P0(t){return Math.max(0,-Dg(Math.abs(t)))}function qb(t,e,r,n){var a=Bv(t,e,r),u;switch(n=C0(n==null?",f":n),n.type){case"s":{var y=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(u=Wb(a,y))&&(n.precision=u),Yy(n,y)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(u=Qg(a,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=u-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(u=P0(a))&&(n.precision=u-(n.type==="%")*2);break}}return Yv(n)}function e0(t){var e=t.domain;return t.ticks=function(r){var n=e();return Ov(n[0],n[n.length-1],r==null?10:r)},t.tickFormat=function(r,n){var a=e();return qb(a[0],a[a.length-1],r==null?10:r,n)},t.nice=function(r){r==null&&(r=10);var n=e(),a=0,u=n.length-1,y=n[a],A=n[u],O;return A<y&&(O=y,y=A,A=O,O=a,a=u,u=O),O=Ig(y,A,r),O>0?(y=Math.floor(y/O)*O,A=Math.ceil(A/O)*O,O=Ig(y,A,r)):O<0&&(y=Math.ceil(y*O)/O,A=Math.floor(A*O)/O,O=Ig(y,A,r)),O>0?(n[a]=Math.floor(y/O)*O,n[u]=Math.ceil(A/O)*O,e(n)):O<0&&(n[a]=Math.ceil(y*O)/O,n[u]=Math.floor(A*O)/O,e(n)),t},t}function $v(){var t=Hy(jf,jf);return t.copy=function(){return A0(t,$v())},Jm.apply(t,arguments),e0(t)}function Yb(t){var e;function r(n){return isNaN(n=+n)?e:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(t=map.call(n,number),r):t.slice()},r.unknown=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return Yb(t).unknown(e)},t=arguments.length?map.call(t,number):[0,1],linearish(r)}function $y(t,e){t=t.slice();var r=0,n=t.length-1,a=t[r],u=t[n],y;return u<a&&(y=r,r=n,n=y,y=a,a=u,u=y),t[r]=e.floor(a),t[n]=e.ceil(u),t}function Kv(t){return Math.log(t)}function Jv(t){return Math.exp(t)}function $b(t){return-Math.log(-t)}function Kb(t){return-Math.exp(-t)}function Jb(t){return isFinite(t)?+("1e"+t):t<0?0:t}function wE(t){return t===10?Jb:t===Math.E?Math.exp:function(e){return Math.pow(t,e)}}function SE(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),function(e){return Math.log(e)/t})}function C(t){return function(e){return-t(-e)}}function P(t){var e=t(Kv,Jv),r=e.domain,n=10,a,u;function y(){return a=SE(n),u=wE(n),r()[0]<0?(a=C(a),u=C(u),t($b,Kb)):t(Kv,Jv),e}return e.base=function(A){return arguments.length?(n=+A,y()):n},e.domain=function(A){return arguments.length?(r(A),y()):r()},e.ticks=function(A){var O=r(),Z=O[0],Y=O[O.length-1],Q;(Q=Y<Z)&&(ae=Z,Z=Y,Y=ae);var ae=a(Z),xe=a(Y),Be,it,gt,Bt=A==null?10:+A,Rt=[];if(!(n%1)&&xe-ae<Bt){if(ae=Math.round(ae)-1,xe=Math.round(xe)+1,Z>0){for(;ae<xe;++ae)for(it=1,Be=u(ae);it<n;++it)if(gt=Be*it,!(gt<Z)){if(gt>Y)break;Rt.push(gt)}}else for(;ae<xe;++ae)for(it=n-1,Be=u(ae);it>=1;--it)if(gt=Be*it,!(gt<Z)){if(gt>Y)break;Rt.push(gt)}}else Rt=Ov(ae,xe,Math.min(xe-ae,Bt)).map(u);return Q?Rt.reverse():Rt},e.tickFormat=function(A,O){if(O==null&&(O=n===10?".0e":","),typeof O!="function"&&(O=Yv(O)),A===1/0)return O;A==null&&(A=10);var Z=Math.max(1,n*A/e.ticks().length);return function(Y){var Q=Y/u(Math.round(a(Y)));return Q*n<n-.5&&(Q*=n),Q<=Z?O(Y):""}},e.nice=function(){return r($y(r(),{floor:function(A){return u(Math.floor(a(A)))},ceil:function(A){return u(Math.ceil(a(A)))}}))},e}function U(){var t=P(Gv()).domain([1,10]);return t.copy=function(){return A0(t,U()).base(t.base())},Jm.apply(t,arguments),t}function se(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Fe(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function rt(t){var e=1,r=t(se(e),Fe(e));return r.constant=function(n){return arguments.length?t(se(e=+n),Fe(e)):e},linearish(r)}function yt(){var t=rt(transformer());return t.copy=function(){return copy(t,yt()).constant(t.constant())},initRange.apply(t,arguments)}function dt(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function zt(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function ur(t){return t<0?-t*t:t*t}function on(t){var e=t(jf,jf),r=1;function n(){return r===1?t(jf,jf):r===.5?t(zt,ur):t(dt(r),dt(1/r))}return e.exponent=function(a){return arguments.length?(r=+a,n()):r},e0(e)}function pi(){var t=on(Gv());return t.copy=function(){return A0(t,pi()).exponent(t.exponent())},Jm.apply(t,arguments),t}function Hi(){return pi.apply(null,arguments).exponent(.5)}function so(){var t=[],e=[],r=[],n;function a(){var y=0,A=Math.max(1,e.length);for(r=new Array(A-1);++y<A;)r[y-1]=Cb(t,y/A);return u}function u(y){return isNaN(y=+y)?n:e[x0(r,y)]}return u.invertExtent=function(y){var A=e.indexOf(y);return A<0?[NaN,NaN]:[A>0?r[A-1]:t[0],A<r.length?r[A]:t[t.length-1]]},u.domain=function(y){if(!arguments.length)return t.slice();t=[];for(var A=0,O=y.length,Z;A<O;++A)Z=y[A],Z!=null&&!isNaN(Z=+Z)&&t.push(Z);return t.sort(Ty),a()},u.range=function(y){return arguments.length?(e=Km.call(y),a()):e.slice()},u.unknown=function(y){return arguments.length?(n=y,u):n},u.quantiles=function(){return r.slice()},u.copy=function(){return so().domain(t).range(e).unknown(n)},Jm.apply(u,arguments)}function uo(){var t=0,e=1,r=1,n=[.5],a=[0,1],u;function y(O){return O<=O?a[x0(n,O,0,r)]:u}function A(){var O=-1;for(n=new Array(r);++O<r;)n[O]=((O+1)*e-(O-r)*t)/(r+1);return y}return y.domain=function(O){return arguments.length?(t=+O[0],e=+O[1],A()):[t,e]},y.range=function(O){return arguments.length?(r=(a=Km.call(O)).length-1,A()):a.slice()},y.invertExtent=function(O){var Z=a.indexOf(O);return Z<0?[NaN,NaN]:Z<1?[t,n[0]]:Z>=r?[n[r-1],e]:[n[Z-1],n[Z]]},y.unknown=function(O){return arguments.length&&(u=O),y},y.thresholds=function(){return n.slice()},y.copy=function(){return uo().domain([t,e]).range(a).unknown(u)},Jm.apply(e0(y),arguments)}function ei(){var t=[.5],e=[0,1],r,n=1;function a(u){return u<=u?e[x0(t,u,0,n)]:r}return a.domain=function(u){return arguments.length?(t=Km.call(u),n=Math.min(t.length,e.length-1),a):t.slice()},a.range=function(u){return arguments.length?(e=Km.call(u),n=Math.min(t.length,e.length-1),a):e.slice()},a.invertExtent=function(u){var y=e.indexOf(u);return[t[y-1],t[y]]},a.unknown=function(u){return arguments.length?(r=u,a):r},a.copy=function(){return ei().domain(t).range(e).unknown(r)},Jm.apply(a,arguments)}var ii=new Date,_o=new Date;function Li(t,e,r,n){function a(u){return t(u=arguments.length===0?new Date:new Date(+u)),u}return a.floor=function(u){return t(u=new Date(+u)),u},a.ceil=function(u){return t(u=new Date(u-1)),e(u,1),t(u),u},a.round=function(u){var y=a(u),A=a.ceil(u);return u-y<A-u?y:A},a.offset=function(u,y){return e(u=new Date(+u),y==null?1:Math.floor(y)),u},a.range=function(u,y,A){var O=[],Z;if(u=a.ceil(u),A=A==null?1:Math.floor(A),!(u<y)||!(A>0))return O;do O.push(Z=new Date(+u)),e(u,A),t(u);while(Z<u&&u<y);return O},a.filter=function(u){return Li(function(y){if(y>=y)for(;t(y),!u(y);)y.setTime(y-1)},function(y,A){if(y>=y)if(A<0)for(;++A<=0;)for(;e(y,-1),!u(y););else for(;--A>=0;)for(;e(y,1),!u(y););})},r&&(a.count=function(u,y){return ii.setTime(+u),_o.setTime(+y),t(ii),t(_o),Math.floor(r(ii,_o))},a.every=function(u){return u=Math.floor(u),!isFinite(u)||!(u>0)?null:u>1?a.filter(n?function(y){return n(y)%u===0}:function(y){return a.count(0,y)%u===0}):a}),a}var yo=Li(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});yo.every=function(t){return!isFinite(t=Math.floor(t))||!(t>0)?null:Li(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,r){e.setFullYear(e.getFullYear()+r*t)})};var Ta=yo,Ha=yo.range,Ua=Li(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12},function(t){return t.getMonth()}),ma=Ua,Zs=Ua.range,Ts=1e3,aa=6e4,La=36e5,hl=864e5,As=6048e5;function zs(t){return Li(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(e,r){e.setDate(e.getDate()+r*7)},function(e,r){return(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*aa)/As})}var $s=zs(0),hr=zs(1),It=zs(2),Qt=zs(3),tn=zs(4),Cn=zs(5),gn=zs(6),zo=$s.range,fs=hr.range,Vs=It.range,Lh=Qt.range,yc=tn.range,hp=Cn.range,nO=gn.range,TE=Li(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*aa)/hl},function(t){return t.getDate()-1}),Qb=TE,iO=TE.range,AE=Li(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ts-t.getMinutes()*aa)},function(t,e){t.setTime(+t+e*La)},function(t,e){return(e-t)/La},function(t){return t.getHours()}),QS=AE,oO=AE.range,CE=Li(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ts)},function(t,e){t.setTime(+t+e*aa)},function(t,e){return(e-t)/aa},function(t){return t.getMinutes()}),eT=CE,aO=CE.range,ME=Li(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+e*Ts)},function(t,e){return(e-t)/Ts},function(t){return t.getUTCSeconds()}),tT=ME,sO=ME.range,Ky=Li(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});Ky.every=function(t){return t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Li(function(e){e.setTime(Math.floor(e/t)*t)},function(e,r){e.setTime(+e+r*t)},function(e,r){return(r-e)/t}):Ky};var rT=Ky,lO=Ky.range;function t0(t){return Li(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(e,r){e.setUTCDate(e.getUTCDate()+r*7)},function(e,r){return(r-e)/As})}var PE=t0(0),Jy=t0(1),nT=t0(2),iT=t0(3),R0=t0(4),oT=t0(5),aT=t0(6),uO=PE.range,cO=Jy.range,hO=nT.range,pO=iT.range,fO=R0.range,dO=oT.range,mO=aT.range,RE=Li(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/hl},function(t){return t.getUTCDate()-1}),IE=RE,gO=RE.range,e2=Li(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});e2.every=function(t){return!isFinite(t=Math.floor(t))||!(t>0)?null:Li(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})};var Qv=e2,vO=e2.range;function t2(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function r2(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function e_(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function sT(t){var e=t.dateTime,r=t.date,n=t.time,a=t.periods,u=t.days,y=t.shortDays,A=t.months,O=t.shortMonths,Z=t_(a),Y=r_(a),Q=t_(u),ae=r_(u),xe=t_(y),Be=r_(y),it=t_(A),gt=r_(A),Bt=t_(O),Rt=r_(O),Yt={a:Df,A:Xm,b:vd,B:I_,c:null,d:kE,e:kE,f:RT,g:UT,G:VT,H:CT,I:MT,j:PT,L:NE,m:IT,M:LT,p:HD,q:GD,Q:HE,s:GE,S:DT,u:OT,U:BT,V:FT,w:kT,W:NT,x:null,X:null,y:zT,Y:ZT,Z:jT,"%":jE},vr={a:WD,A:XD,b:qD,B:YD,c:null,d:UE,e:UE,f:XT,g:nA,G:oA,H:HT,I:GT,j:WT,L:ZE,m:qT,M:YT,p:$D,q:KD,Q:HE,s:GE,S:$T,u:KT,U:JT,V:QT,w:eA,W:tA,x:null,X:null,y:rA,Y:iA,Z:aA,"%":jE},ln={a:Da,A:Bo,b:Oa,B:fl,c:Gp,d:BE,e:BE,f:wT,g:OE,G:DE,H:FE,I:FE,j:yT,L:ET,m:_T,M:xT,p:Oo,q:vT,Q:TT,s:AT,S:bT,u:pT,U:fT,V:dT,w:hT,W:mT,x:Wp,X:nl,y:OE,Y:DE,Z:gT,"%":ST};Yt.x=cn(r,Yt),Yt.X=cn(n,Yt),Yt.c=cn(e,Yt),vr.x=cn(r,vr),vr.X=cn(n,vr),vr.c=cn(e,vr);function cn(Ra,hu){return function($u){var ro=[],em=-1,Dh=0,vm=Ra.length,_m,c0,XS;for($u instanceof Date||($u=new Date(+$u));++em<vm;)Ra.charCodeAt(em)===37&&(ro.push(Ra.slice(Dh,em)),(c0=LE[_m=Ra.charAt(++em)])!=null?_m=Ra.charAt(++em):c0=_m==="e"?" ":"0",(XS=hu[_m])&&(_m=XS($u,c0)),ro.push(_m),Dh=em+1);return ro.push(Ra.slice(Dh,em)),ro.join("")}}function Gr(Ra,hu){return function($u){var ro=e_(1900,void 0,1),em=Pn(ro,Ra,$u+="",0),Dh,vm;if(em!=$u.length)return null;if("Q"in ro)return new Date(ro.Q);if("s"in ro)return new Date(ro.s*1e3+("L"in ro?ro.L:0));if(hu&&!("Z"in ro)&&(ro.Z=0),"p"in ro&&(ro.H=ro.H%12+ro.p*12),ro.m===void 0&&(ro.m="q"in ro?ro.q:0),"V"in ro){if(ro.V<1||ro.V>53)return null;"w"in ro||(ro.w=1),"Z"in ro?(Dh=r2(e_(ro.y,0,1)),vm=Dh.getUTCDay(),Dh=vm>4||vm===0?Jy.ceil(Dh):Jy(Dh),Dh=IE.offset(Dh,(ro.V-1)*7),ro.y=Dh.getUTCFullYear(),ro.m=Dh.getUTCMonth(),ro.d=Dh.getUTCDate()+(ro.w+6)%7):(Dh=t2(e_(ro.y,0,1)),vm=Dh.getDay(),Dh=vm>4||vm===0?hr.ceil(Dh):hr(Dh),Dh=Qb.offset(Dh,(ro.V-1)*7),ro.y=Dh.getFullYear(),ro.m=Dh.getMonth(),ro.d=Dh.getDate()+(ro.w+6)%7)}else("W"in ro||"U"in ro)&&("w"in ro||(ro.w="u"in ro?ro.u%7:"W"in ro?1:0),vm="Z"in ro?r2(e_(ro.y,0,1)).getUTCDay():t2(e_(ro.y,0,1)).getDay(),ro.m=0,ro.d="W"in ro?(ro.w+6)%7+ro.W*7-(vm+5)%7:ro.w+ro.U*7-(vm+6)%7);return"Z"in ro?(ro.H+=ro.Z/100|0,ro.M+=ro.Z%100,r2(ro)):t2(ro)}}function Pn(Ra,hu,$u,ro){for(var em=0,Dh=hu.length,vm=$u.length,_m,c0;em<Dh;){if(ro>=vm)return-1;if(_m=hu.charCodeAt(em++),_m===37){if(_m=hu.charAt(em++),c0=ln[_m in LE?hu.charAt(em++):_m],!c0||(ro=c0(Ra,$u,ro))<0)return-1}else if(_m!=$u.charCodeAt(ro++))return-1}return ro}function Oo(Ra,hu,$u){var ro=Z.exec(hu.slice($u));return ro?(Ra.p=Y[ro[0].toLowerCase()],$u+ro[0].length):-1}function Da(Ra,hu,$u){var ro=xe.exec(hu.slice($u));return ro?(Ra.w=Be[ro[0].toLowerCase()],$u+ro[0].length):-1}function Bo(Ra,hu,$u){var ro=Q.exec(hu.slice($u));return ro?(Ra.w=ae[ro[0].toLowerCase()],$u+ro[0].length):-1}function Oa(Ra,hu,$u){var ro=Bt.exec(hu.slice($u));return ro?(Ra.m=Rt[ro[0].toLowerCase()],$u+ro[0].length):-1}function fl(Ra,hu,$u){var ro=it.exec(hu.slice($u));return ro?(Ra.m=gt[ro[0].toLowerCase()],$u+ro[0].length):-1}function Gp(Ra,hu,$u){return Pn(Ra,e,hu,$u)}function Wp(Ra,hu,$u){return Pn(Ra,r,hu,$u)}function nl(Ra,hu,$u){return Pn(Ra,n,hu,$u)}function Df(Ra){return y[Ra.getDay()]}function Xm(Ra){return u[Ra.getDay()]}function vd(Ra){return O[Ra.getMonth()]}function I_(Ra){return A[Ra.getMonth()]}function HD(Ra){return a[+(Ra.getHours()>=12)]}function GD(Ra){return 1+~~(Ra.getMonth()/3)}function WD(Ra){return y[Ra.getUTCDay()]}function XD(Ra){return u[Ra.getUTCDay()]}function qD(Ra){return O[Ra.getUTCMonth()]}function YD(Ra){return A[Ra.getUTCMonth()]}function $D(Ra){return a[+(Ra.getUTCHours()>=12)]}function KD(Ra){return 1+~~(Ra.getUTCMonth()/3)}return{format:function(Ra){var hu=cn(Ra+="",Yt);return hu.toString=function(){return Ra},hu},parse:function(Ra){var hu=Gr(Ra+="",!1);return hu.toString=function(){return Ra},hu},utcFormat:function(Ra){var hu=cn(Ra+="",vr);return hu.toString=function(){return Ra},hu},utcParse:function(Ra){var hu=Gr(Ra+="",!0);return hu.toString=function(){return Ra},hu}}}var LE={"-":"",_:" ",0:"0"},Hf=/^\s*\d+/,lT=/^%/,uT=/[\\^$*+?|[\]().{}]/g;function Xu(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",u=a.length;return n+(u<r?new Array(r-u+1).join(e)+a:a)}function cT(t){return t.replace(uT,"\\$&")}function t_(t){return new RegExp("^(?:"+t.map(cT).join("|")+")","i")}function r_(t){for(var e={},r=-1,n=t.length;++r<n;)e[t[r].toLowerCase()]=r;return e}function hT(t,e,r){var n=Hf.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function pT(t,e,r){var n=Hf.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function fT(t,e,r){var n=Hf.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function dT(t,e,r){var n=Hf.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function mT(t,e,r){var n=Hf.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function DE(t,e,r){var n=Hf.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function OE(t,e,r){var n=Hf.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function gT(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function vT(t,e,r){var n=Hf.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function _T(t,e,r){var n=Hf.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function BE(t,e,r){var n=Hf.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function yT(t,e,r){var n=Hf.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function FE(t,e,r){var n=Hf.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function xT(t,e,r){var n=Hf.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function bT(t,e,r){var n=Hf.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function ET(t,e,r){var n=Hf.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function wT(t,e,r){var n=Hf.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function ST(t,e,r){var n=lT.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function TT(t,e,r){var n=Hf.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function AT(t,e,r){var n=Hf.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function kE(t,e){return Xu(t.getDate(),e,2)}function CT(t,e){return Xu(t.getHours(),e,2)}function MT(t,e){return Xu(t.getHours()%12||12,e,2)}function PT(t,e){return Xu(1+Qb.count(Ta(t),t),e,3)}function NE(t,e){return Xu(t.getMilliseconds(),e,3)}function RT(t,e){return NE(t,e)+"000"}function IT(t,e){return Xu(t.getMonth()+1,e,2)}function LT(t,e){return Xu(t.getMinutes(),e,2)}function DT(t,e){return Xu(t.getSeconds(),e,2)}function OT(t){var e=t.getDay();return e===0?7:e}function BT(t,e){return Xu($s.count(Ta(t)-1,t),e,2)}function zE(t){var e=t.getDay();return e>=4||e===0?tn(t):tn.ceil(t)}function FT(t,e){return t=zE(t),Xu(tn.count(Ta(t),t)+(Ta(t).getDay()===4),e,2)}function kT(t){return t.getDay()}function NT(t,e){return Xu(hr.count(Ta(t)-1,t),e,2)}function zT(t,e){return Xu(t.getFullYear()%100,e,2)}function UT(t,e){return t=zE(t),Xu(t.getFullYear()%100,e,2)}function ZT(t,e){return Xu(t.getFullYear()%1e4,e,4)}function VT(t,e){var r=t.getDay();return t=r>=4||r===0?tn(t):tn.ceil(t),Xu(t.getFullYear()%1e4,e,4)}function jT(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Xu(e/60|0,"0",2)+Xu(e%60,"0",2)}function UE(t,e){return Xu(t.getUTCDate(),e,2)}function HT(t,e){return Xu(t.getUTCHours(),e,2)}function GT(t,e){return Xu(t.getUTCHours()%12||12,e,2)}function WT(t,e){return Xu(1+IE.count(Qv(t),t),e,3)}function ZE(t,e){return Xu(t.getUTCMilliseconds(),e,3)}function XT(t,e){return ZE(t,e)+"000"}function qT(t,e){return Xu(t.getUTCMonth()+1,e,2)}function YT(t,e){return Xu(t.getUTCMinutes(),e,2)}function $T(t,e){return Xu(t.getUTCSeconds(),e,2)}function KT(t){var e=t.getUTCDay();return e===0?7:e}function JT(t,e){return Xu(PE.count(Qv(t)-1,t),e,2)}function VE(t){var e=t.getUTCDay();return e>=4||e===0?R0(t):R0.ceil(t)}function QT(t,e){return t=VE(t),Xu(R0.count(Qv(t),t)+(Qv(t).getUTCDay()===4),e,2)}function eA(t){return t.getUTCDay()}function tA(t,e){return Xu(Jy.count(Qv(t)-1,t),e,2)}function rA(t,e){return Xu(t.getUTCFullYear()%100,e,2)}function nA(t,e){return t=VE(t),Xu(t.getUTCFullYear()%100,e,2)}function iA(t,e){return Xu(t.getUTCFullYear()%1e4,e,4)}function oA(t,e){var r=t.getUTCDay();return t=r>=4||r===0?R0(t):R0.ceil(t),Xu(t.getUTCFullYear()%1e4,e,4)}function aA(){return"+0000"}function jE(){return"%"}function HE(t){return+t}function GE(t){return Math.floor(+t/1e3)}var I0,WE,sA,lA,uA;cA({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function cA(t){return I0=sT(t),WE=I0.format,sA=I0.parse,lA=I0.utcFormat,uA=I0.utcParse,I0}var n_=1e3,i_=n_*60,o_=i_*60,a_=o_*24,hA=a_*7,XE=a_*30,n2=a_*365;function pA(t){return new Date(t)}function fA(t){return t instanceof Date?+t:+new Date(+t)}function qE(t,e,r,n,a,u,y,A,O){var Z=Hy(jf,jf),Y=Z.invert,Q=Z.domain,ae=O(".%L"),xe=O(":%S"),Be=O("%I:%M"),it=O("%I %p"),gt=O("%a %d"),Bt=O("%b %d"),Rt=O("%B"),Yt=O("%Y"),vr=[[y,1,n_],[y,5,5*n_],[y,15,15*n_],[y,30,30*n_],[u,1,i_],[u,5,5*i_],[u,15,15*i_],[u,30,30*i_],[a,1,o_],[a,3,3*o_],[a,6,6*o_],[a,12,12*o_],[n,1,a_],[n,2,2*a_],[r,1,hA],[e,1,XE],[e,3,3*XE],[t,1,n2]];function ln(Gr){return(y(Gr)<Gr?ae:u(Gr)<Gr?xe:a(Gr)<Gr?Be:n(Gr)<Gr?it:e(Gr)<Gr?r(Gr)<Gr?gt:Bt:t(Gr)<Gr?Rt:Yt)(Gr)}function cn(Gr,Pn,Oo,Da){if(Gr==null&&(Gr=10),typeof Gr=="number"){var Bo=Math.abs(Oo-Pn)/Gr,Oa=Rv(function(fl){return fl[2]}).right(vr,Bo);Oa===vr.length?(Da=Bv(Pn/n2,Oo/n2,Gr),Gr=t):Oa?(Oa=vr[Bo/vr[Oa-1][2]<vr[Oa][2]/Bo?Oa-1:Oa],Da=Oa[1],Gr=Oa[0]):(Da=Math.max(Bv(Pn,Oo,Gr),1),Gr=A)}return Da==null?Gr:Gr.every(Da)}return Z.invert=function(Gr){return new Date(Y(Gr))},Z.domain=function(Gr){return arguments.length?Q(Uv.call(Gr,fA)):Q().map(pA)},Z.ticks=function(Gr,Pn){var Oo=Q(),Da=Oo[0],Bo=Oo[Oo.length-1],Oa=Bo<Da,fl;return Oa&&(fl=Da,Da=Bo,Bo=fl),fl=cn(Gr,Da,Bo,Pn),fl=fl?fl.range(Da,Bo+1):[],Oa?fl.reverse():fl},Z.tickFormat=function(Gr,Pn){return Pn==null?ln:O(Pn)},Z.nice=function(Gr,Pn){var Oo=Q();return(Gr=cn(Gr,Oo[0],Oo[Oo.length-1],Pn))?Q($y(Oo,Gr)):Z},Z.copy=function(){return A0(Z,qE(t,e,r,n,a,u,y,A,O))},Z}function dA(){return Jm.apply(qE(Ta,ma,$s,Qb,QS,eT,tT,rT,WE).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function _O(){return initRange.apply(calendar(utcYear,utcMonth,utcWeek,utcDay,utcHour,utcMinute,utcSecond,utcMillisecond,utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Qy(){var t=0,e=1,r,n,a,u,y=jf,A=!1,O;function Z(Y){return isNaN(Y=+Y)?O:y(a===0?.5:(Y=(u(Y)-r)*a,A?Math.max(0,Math.min(1,Y)):Y))}return Z.domain=function(Y){return arguments.length?(r=u(t=+Y[0]),n=u(e=+Y[1]),a=r===n?0:1/(n-r),Z):[t,e]},Z.clamp=function(Y){return arguments.length?(A=!!Y,Z):A},Z.interpolator=function(Y){return arguments.length?(y=Y,Z):y},Z.unknown=function(Y){return arguments.length?(O=Y,Z):O},function(Y){return u=Y,r=Y(t),n=Y(e),a=r===n?0:1/(n-r),Z}}function s_(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function YE(){var t=e0(Qy()(jf));return t.copy=function(){return s_(t,YE())},ky.apply(t,arguments)}function mA(){var t=loggish(Qy()).domain([1,10]);return t.copy=function(){return s_(t,mA()).base(t.base())},initInterpolator.apply(t,arguments)}function gA(){var t=symlogish(Qy());return t.copy=function(){return s_(t,gA()).constant(t.constant())},initInterpolator.apply(t,arguments)}function $E(){var t=powish(Qy());return t.copy=function(){return s_(t,$E()).exponent(t.exponent())},initInterpolator.apply(t,arguments)}function yO(){return $E.apply(null,arguments).exponent(.5)}function vA(){var t=[],e=identity;function r(n){if(!isNaN(n=+n))return e((bisect(t,n)-1)/(t.length-1))}return r.domain=function(n){if(!arguments.length)return t.slice();t=[];for(var a=0,u=n.length,y;a<u;++a)y=n[a],y!=null&&!isNaN(y=+y)&&t.push(y);return t.sort(ascending),r},r.interpolator=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return vA(e).domain(t)},initInterpolator.apply(r,arguments)}function e1(){var t=0,e=.5,r=1,n,a,u,y,A,O=jf,Z,Y=!1,Q;function ae(xe){return isNaN(xe=+xe)?Q:(xe=.5+((xe=+Z(xe))-a)*(xe<a?y:A),O(Y?Math.max(0,Math.min(1,xe)):xe))}return ae.domain=function(xe){return arguments.length?(n=Z(t=+xe[0]),a=Z(e=+xe[1]),u=Z(r=+xe[2]),y=n===a?0:.5/(a-n),A=a===u?0:.5/(u-a),ae):[t,e,r]},ae.clamp=function(xe){return arguments.length?(Y=!!xe,ae):Y},ae.interpolator=function(xe){return arguments.length?(O=xe,ae):O},ae.unknown=function(xe){return arguments.length?(Q=xe,ae):Q},function(xe){return Z=xe,n=xe(t),a=xe(e),u=xe(r),y=n===a?0:.5/(a-n),A=a===u?0:.5/(u-a),ae}}function KE(){var t=e0(e1()(jf));return t.copy=function(){return s_(t,KE())},ky.apply(t,arguments)}function _A(){var t=loggish(e1()).domain([.1,1,10]);return t.copy=function(){return copy(t,_A()).base(t.base())},initInterpolator.apply(t,arguments)}function yA(){var t=symlogish(e1());return t.copy=function(){return copy(t,yA()).constant(t.constant())},initInterpolator.apply(t,arguments)}function JE(){var t=powish(e1());return t.copy=function(){return copy(t,JE()).exponent(t.exponent())},initInterpolator.apply(t,arguments)}function xO(){return JE.apply(null,arguments).exponent(.5)}function QE(t){let e,r=[];function n(a){return a==null?e:a}return n.invert=n,n.domain=n.range=a=>a?(r=a,a):r,n.unknown=a=>a?(e=a,a):e,n.copy=()=>QE(t).unknown(e),n}const{isNil:i2,isString:xA,uniq:bA}=es,EA=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/,wA={[Qn.LINEAR]:$v,[Qn.POWER]:pi,[Qn.LOG]:U,[Qn.IDENTITY]:QE,[Qn.SEQUENTIAL]:YE,[Qn.TIME]:dA,[Qn.QUANTILE]:so,[Qn.QUANTIZE]:uo,[Qn.THRESHOLD]:ei,[Qn.CAT]:S0,[Qn.DIVERGING]:KE};class SA{constructor(){(0,K.Z)(this,"scaleOptions",{})}apply(e,{styleAttributeService:r}){var n=this;e.hooks.init.tapPromise("FeatureScalePlugin",(0,Nr.Z)(function*(){var a;e.log($t.ScaleInitStart,_n.INIT),n.scaleOptions=e.getScaleOptions();const u=r.getLayerStyleAttributes(),y=(a=e.getSource())===null||a===void 0?void 0:a.data.dataArray;Array.isArray(y)&&y.length===0||(n.caculateScalesForAttributes(u||[],y),e.log($t.ScaleInitEnd,_n.INIT))})),e.hooks.beforeRenderData.tapPromise("FeatureScalePlugin",function(){var a=(0,Nr.Z)(function*(u){if(!u)return u;e.log($t.ScaleInitStart,_n.UPDATE),n.scaleOptions=e.getScaleOptions();const y=r.getLayerStyleAttributes(),A=e.getSource().data.dataArray;return Array.isArray(A)&&A.length===0||(n.caculateScalesForAttributes(y||[],A),e.log($t.ScaleInitEnd,_n.UPDATE),e.layerModelNeedUpdate=!0),!0});return function(u){return a.apply(this,arguments)}}()),e.hooks.beforeRender.tap("FeatureScalePlugin",()=>{if(e.layerModelNeedUpdate)return;this.scaleOptions=e.getScaleOptions();const a=r.getLayerStyleAttributes(),u=e.getSource().data.dataArray;if(!(Array.isArray(u)&&u.length===0)&&a){const y=a.filter(A=>A.needRescale);y.length&&this.caculateScalesForAttributes(y,u)}})}isNumber(e){return!isNaN(parseFloat(e))&&isFinite(e)}caculateScalesForAttributes(e,r){e.forEach(n=>{if(n.scale){const a=n.scale,u=n.scale.field;a.names=this.parseFields(i2(u)?[]:u);const y=[];a.names.forEach(A=>{var O;y.push(this.createScale(A,n.name,(O=n.scale)===null||O===void 0?void 0:O.values,r))}),y.some(A=>A.type===Fi.VARIABLE)?(a.type=Fi.VARIABLE,y.forEach(A=>{if(!a.callback&&a.values!=="text"){var O;switch((O=A.option)===null||O===void 0?void 0:O.type){case Qn.LOG:case Qn.LINEAR:case Qn.POWER:if(a.values&&a.values.length>2){const Y=A.scale.ticks(a.values.length);A.scale.domain(Y)}a.values?A.scale.range(a.values):A.scale.range(A.option.domain);break;case Qn.QUANTILE:case Qn.QUANTIZE:case Qn.THRESHOLD:A.scale.range(a.values);break;case Qn.IDENTITY:break;case Qn.CAT:a.values?A.scale.range(a.values):A.scale.range(A.option.domain);break;case Qn.DIVERGING:case Qn.SEQUENTIAL:A.scale.interpolator(Lb(a.values));break}}if(a.values==="text"){var Z;A.scale.range((Z=A.option)===null||Z===void 0?void 0:Z.domain)}})):(a.type=Fi.CONSTANT,a.defaultValues=y.map((A,O)=>A.scale(a.names[O]))),a.scalers=y.map(A=>({field:A.field,func:A.scale,option:A.option})),n.needRescale=!1}})}parseFields(e){return Array.isArray(e)?e:xA(e)?e.split("*"):[e]}createScale(e,r,n,a){var u,y;const A=this.scaleOptions[r]&&((u=this.scaleOptions[r])===null||u===void 0?void 0:u.field)===e?this.scaleOptions[r]:this.scaleOptions[e],O={field:e,scale:void 0,type:Fi.VARIABLE,option:A};if(!a||!a.length)return A&&A.type?O.scale=this.createDefaultScale(A):(O.scale=S0([e]),O.type=Fi.CONSTANT),O;const Z=(y=a.find(Y=>!i2(Y[e])))===null||y===void 0?void 0:y[e];if(this.isNumber(e)||i2(Z)&&!A)O.scale=S0([e]),O.type=Fi.CONSTANT;else{let Y=A&&A.type||this.getDefaultType(Z);n==="text"&&(Y=Qn.CAT),n===void 0&&(Y=Qn.IDENTITY);const Q=this.createScaleConfig(Y,e,A,a);O.scale=this.createDefaultScale(Q),O.option=Q}return O}getDefaultType(e){let r=Qn.LINEAR;return typeof e=="string"&&(r=EA.test(e)?Qn.TIME:Qn.CAT),r}createScaleConfig(e,r,n,a){const u={type:e};let y=[];if(e===Qn.QUANTILE){const A=new Map;a==null||a.forEach(O=>{A.set(O._id,O[r])}),y=Array.from(A.values())}else y=(a==null?void 0:a.map(A=>A[r]))||[];if(n!=null&&n.domain)u.domain=n==null?void 0:n.domain;else if(e===Qn.CAT||e===Qn.IDENTITY)u.domain=bA(y);else if(e===Qn.QUANTILE)u.domain=y;else if(e===Qn.DIVERGING){const A=My(y),O=(n==null?void 0:n.neutral)!==void 0?n==null?void 0:n.neutral:(A[0]+A[1])/2;u.domain=[A[0],O,A[1]]}else u.domain=My(y);return(0,Wt.Z)((0,Wt.Z)({},u),n)}createDefaultScale({type:e,domain:r,unknown:n,clamp:a,nice:u}){const y=wA[e]();return r&&y.domain&&y.domain(r),n&&y.unknown(n),a!==void 0&&y.clamp&&y.clamp(a),u!==void 0&&y.nice&&y.nice(u),y}}class TA{apply(e){e.hooks.beforeRender.tap("LayerAnimateStylePlugin",()=>{e.animateStatus&&e.models.forEach(n=>{n.addUniforms((0,Wt.Z)({},e.layerModel.getAnimateUniforms()))})})}}class AA{apply(e){e.hooks.afterInit.tap("LayerMaskPlugin",()=>{const{maskLayers:r,enableMask:n}=e.getLayerConfig();!e.tileLayer&&r&&r.length>0&&e.updateLayerConfig({mask:n})})}}class CA{build(e){return(0,Nr.Z)(function*(){e.prepareBuildModel(),yield e.buildModels()})()}initLayerModel(e){var r=this;return(0,Nr.Z)(function*(){yield r.build(e),e.styleNeedUpdate=!1})()}prepareLayerModel(e){var r=this;return(0,Nr.Z)(function*(){yield r.build(e),e.styleNeedUpdate=!1})()}apply(e){var r=this;e.hooks.init.tapPromise("LayerModelPlugin",(0,Nr.Z)(function*(){if(e.getSource().isTile){e.prepareBuildModel();return}e.log($t.BuildModelStart,_n.INIT),yield r.initLayerModel(e),e.log($t.BuildModelEnd,_n.INIT)})),e.hooks.beforeRenderData.tapPromise("LayerModelPlugin",function(){var n=(0,Nr.Z)(function*(a){return!a||e.getSource().isTile?!1:(e.log($t.BuildModelStart,_n.UPDATE),yield r.prepareLayerModel(e),e.log($t.BuildModelEnd,_n.UPDATE),!0)});return function(a){return n.apply(this,arguments)}}())}}class MA{apply(e){e.hooks.afterInit.tap("LayerStylePlugin",()=>{const{autoFit:r,fitBoundsOptions:n}=e.getLayerConfig();r&&e.fitBounds(n),e.styleNeedUpdate=!1})}}const PA=["type"],ew={directional:{lights:"u_DirectionalLights",num:"u_NumOfDirectionalLights"},spot:{lights:"u_SpotLights",num:"u_NumOfSpotLights"}},RA={type:"directional",direction:[1,10.5,12],ambient:[.2,.2,.2],diffuse:[.6,.6,.6],specular:[.1,.1,.1]},IA={direction:[0,0,0],ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0]},LA={position:[0,0,0],direction:[0,0,0],ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],constant:1,linear:0,quadratic:0,angle:14,exponent:40,blur:5};function DA(t){const e={u_DirectionalLights:new Array(3).fill((0,Wt.Z)({},IA)),u_NumOfDirectionalLights:0,u_SpotLights:new Array(3).fill((0,Wt.Z)({},LA)),u_NumOfSpotLights:0};return(!t||!t.length)&&(t=[RA]),t.forEach(r=>{let{type:n="directional"}=r,a=(0,Ge.Z)(r,PA);const u=ew[n].lights,y=ew[n].num,A=e[y];e[u][A]=(0,Wt.Z)((0,Wt.Z)({},e[u][A]),a),e[y]++}),e}class OA{apply(e){e.hooks.beforeRender.tap("LightingPlugin",()=>{const{enableLighting:r}=e.getLayerConfig();r&&e.models.forEach(n=>n.addUniforms((0,Wt.Z)({},DA())))})}}function tw(t){return t.map(e=>(typeof e=="string"&&(e=[e,{}]),e))}function rw(t,e,r,n){const a=t.multiPassRenderer,{enableTAA:u}=t.getLayerConfig();return u?a.add(n("taa")):a.add(n("render")),tw(e).forEach(y=>{const[A,O]=y;a.add(r(A),O)}),a.add(r("copy")),a}class BA{constructor(){(0,K.Z)(this,"enabled",void 0)}apply(e,{rendererService:r,postProcessingPassFactory:n,normalPassFactory:a}){e.hooks.init.tapPromise("MultiPassRendererPlugin",()=>{const{enableMultiPassRenderer:u,passes:y=[]}=e.getLayerConfig();this.enabled=!!u&&e.getLayerConfig().enableMultiPassRenderer!==!1,this.enabled&&(e.multiPassRenderer=rw(e,y,n,a),e.multiPassRenderer.setRenderFlag(!0))}),e.hooks.beforeRender.tap("MultiPassRendererPlugin",()=>{if(this.enabled){const{width:u,height:y}=r.getViewportSize();e.multiPassRenderer.resize(u,y)}})}}let Ro=function(t){return t[t.POSITION=0]="POSITION",t[t.COLOR=1]="COLOR",t[t.VERTEX_ID=2]="VERTEX_ID",t[t.PICKING_COLOR=3]="PICKING_COLOR",t[t.STROKE=4]="STROKE",t[t.OPACITY=5]="OPACITY",t[t.OFFSETS=6]="OFFSETS",t[t.ROTATION=7]="ROTATION",t[t.EXTRUSION_BASE=8]="EXTRUSION_BASE",t[t.SIZE=9]="SIZE",t[t.SHAPE=10]="SHAPE",t[t.EXTRUDE=11]="EXTRUDE",t[t.MAX=12]="MAX",t[t.NORMAL=13]="NORMAL",t[t.UV=14]="UV",t[t.LINEAR=15]="LINEAR",t}({});function FA(t){switch(t){case"rotation":return{name:"Rotation",type:Vr.Attribute,descriptor:{name:"a_Rotation",shaderLocation:Ro.ROTATION,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{rotation:r=0}=e;return Array.isArray(r)?[r[0]]:[r]}}};case"stroke":return{name:"stroke",type:Vr.Attribute,descriptor:{name:"a_Stroke",shaderLocation:Ro.STROKE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:4,update:e=>{const{stroke:r=[1,1,1,1]}=e;return r}}};case"opacity":return{name:"opacity",type:Vr.Attribute,descriptor:{name:"a_Opacity",shaderLocation:Ro.OPACITY,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{opacity:r=1}=e;return[r]}}};case"extrusionBase":return{name:"extrusionBase",type:Vr.Attribute,descriptor:{name:"a_ExtrusionBase",shaderLocation:Ro.EXTRUSION_BASE,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{extrusionBase:r=0}=e;return[r]}}};case"offsets":return{name:"offsets",type:Vr.Attribute,descriptor:{name:"a_Offsets",shaderLocation:Ro.OFFSETS,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const{offsets:r}=e;return r}}};case"thetaOffset":return{name:"thetaOffset",type:Vr.Attribute,descriptor:{name:"a_ThetaOffset",shaderLocation:15,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{thetaOffset:r=1}=e;return[r]}}};default:return}}const{isNumber:kA}=es,L0={NONE:0,ENCODE:1,HIGHLIGHT:2};class NA{constructor(){(0,K.Z)(this,"pickingUniformMap",void 0)}pickOption2Array(){const e=[];return this.pickingUniformMap.forEach(r=>{kA(r)?e.push(r):e.push(...r)}),e}updatePickOption(e,r){Object.keys(e).forEach(y=>{this.pickingUniformMap.set(y,e[y])});const n=r.getLayerConfig().pickingBuffer||0,a=Number(r.getShaderPickStat());this.pickingUniformMap.set("u_PickingBuffer",n),this.pickingUniformMap.set("u_shaderPick",a),r.getPickingUniformBuffer().subData({offset:0,data:this.pickOption2Array()})}apply(e,{styleAttributeService:r}){this.pickingUniformMap=new Map([["u_HighlightColor",[1,0,0,1]],["u_SelectColor",[1,0,0,1]],["u_PickingColor",[0,0,0]],["u_PickingStage",0],["u_CurrentSelectedId",[0,0,0]],["u_PickingThreshold",10],["u_PickingBuffer",0],["u_shaderPick",0],["u_activeMix",0]]),e.hooks.init.tapPromise("PixelPickingPlugin",()=>{const{enablePicking:n}=e.getLayerConfig();r.registerStyleAttribute({name:"pickingColor",type:Vr.Attribute,descriptor:{name:"a_PickingColor",shaderLocation:Ro.PICKING_COLOR,buffer:{data:[],type:Ee.FLOAT},size:3,update:a=>{const{id:u}=a;return n?Ni(u):[0,0,0]}}})}),e.hooks.beforePickingEncode.tap("PixelPickingPlugin",()=>{const{enablePicking:n}=e.getLayerConfig();n&&e.isVisible()&&(this.updatePickOption({u_PickingStage:L0.ENCODE},e),e.models.forEach(a=>a.addUniforms({u_PickingStage:L0.ENCODE})))}),e.hooks.afterPickingEncode.tap("PixelPickingPlugin",()=>{const{enablePicking:n}=e.getLayerConfig();n&&e.isVisible()&&(this.updatePickOption({u_PickingStage:L0.HIGHLIGHT},e),e.models.forEach(a=>a.addUniforms({u_PickingStage:L0.HIGHLIGHT})))}),e.hooks.beforeHighlight.tap("PixelPickingPlugin",n=>{const{highlightColor:a,activeMix:u=0}=e.getLayerConfig(),y=typeof a=="string"?Va(a):a||[1,0,0,1];e.updateLayerConfig({pickedFeatureID:Aa(new Uint8Array(n))});const A={u_PickingStage:L0.HIGHLIGHT,u_PickingColor:n,u_HighlightColor:y.map(O=>O*255),u_activeMix:u};this.updatePickOption(A,e),e.models.forEach(O=>O.addUniforms(A))}),e.hooks.beforeSelect.tap("PixelPickingPlugin",n=>{const{selectColor:a,selectMix:u=0}=e.getLayerConfig(),y=typeof a=="string"?Va(a):a||[1,0,0,1];e.updateLayerConfig({pickedFeatureID:Aa(new Uint8Array(n))});const A={u_PickingStage:L0.HIGHLIGHT,u_PickingColor:n,u_HighlightColor:y.map(O=>O*255),u_activeMix:u,u_CurrentSelectedId:n,u_SelectColor:y.map(O=>O*255)};this.updatePickOption(A,e),e.models.forEach(O=>O.addUniforms(A))})}}const zA=["mvt","geojsonvt","testTile"];function UA(t){const e=t.getSource();return zA.includes(e.parser.type)}class ZA{apply(e,{styleAttributeService:r}){e.hooks.init.tapPromise("RegisterStyleAttributePlugin",()=>{UA(e)||this.registerBuiltinAttributes(r,e)})}registerBuiltinAttributes(e,r){if(r.type==="MaskLayer"){this.registerPositionAttribute(e);return}this.registerPositionAttribute(e),this.registerColorAttribute(e),this.registerVertexIdAttribute(e)}registerPositionAttribute(e){e.registerStyleAttribute({name:"position",type:Vr.Attribute,descriptor:{name:"a_Position",shaderLocation:Ro.POSITION,buffer:{data:[],type:Ee.FLOAT},size:3,update:(r,n,a)=>a.length===2?[a[0],a[1],0]:[a[0],a[1],a[2]]}})}registerColorAttribute(e){e.registerStyleAttribute({name:"color",type:Vr.Attribute,descriptor:{name:"a_Color",shaderLocation:Ro.COLOR,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:4,update:r=>{const{color:n}=r;return!n||!n.length?[1,1,1,1]:n}}})}registerVertexIdAttribute(e){e.registerStyleAttribute({name:"vertexId",type:Vr.Attribute,descriptor:{name:"a_vertexId",shaderLocation:Ro.VERTEX_ID,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:(r,n)=>[n]}})}}class VA{constructor(){(0,K.Z)(this,"cameraService",void 0),(0,K.Z)(this,"coordinateSystemService",void 0),(0,K.Z)(this,"rendererService",void 0),(0,K.Z)(this,"mapService",void 0),(0,K.Z)(this,"layerService",void 0)}apply(e,{rendererService:r,mapService:n,layerService:a,coordinateSystemService:u,cameraService:y}){this.rendererService=r,this.mapService=n,this.layerService=a,this.coordinateSystemService=u,this.cameraService=y;const A=this.mapService.version;let O=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],Z=[0,0],Y;this.rendererService.uniformBuffers[0]||(Y=this.rendererService.createBuffer({data:new Float32Array(16*4+4*7),isUBO:!0}),this.rendererService.uniformBuffers[0]=Y),e.hooks.beforeRender.tap("ShaderUniformPlugin",()=>{const Q=e.getLayerConfig().tileOrigin;this.coordinateSystemService.refresh(Q),A==="GAODE2.x"&&(this.setLayerCenter(e),O=this.mapService.map.customCoords.getMVPMatrix(),Z=this.mapService.getCustomCoordCenter(),e.getLayerUniformBuffer().subData({offset:0,data:new Uint8Array(new Float32Array([...O,...Z]).buffer)}));const{width:ae,height:xe}=this.rendererService.getViewportSize(),{data:Be,uniforms:it}=this.generateUBO(O,Z,ae,xe);this.layerService.alreadyInRendering&&this.rendererService.uniformBuffers[0]&&this.rendererService.uniformBuffers[0].subData({offset:0,data:Be}),this.rendererService.queryVerdorInfo()==="WebGL1"&&e.models.forEach(Bt=>{Bt.addUniforms((0,Wt.Z)((0,Wt.Z)({},it),{},{u_PickingBuffer:e.getLayerConfig().pickingBuffer||0,u_shaderPick:Number(e.getShaderPickStat())}))})})}setLayerCenter(e){e.coordCenter===void 0&&(e.coordCenter=e.getSource().center),this.mapService.setCoordCenter&&this.mapService.setCoordCenter(e.coordCenter)}generateUBO(e,r,n,a){const u=this.cameraService.getProjectionMatrix(),y=this.cameraService.getViewMatrix(),A=this.cameraService.getViewProjectionMatrix(),O=this.cameraService.getModelMatrix(),Z=this.coordinateSystemService.getViewportCenterProjection(),Y=this.coordinateSystemService.getPixelsPerDegree(),Q=this.cameraService.getZoom(),ae=this.coordinateSystemService.getPixelsPerDegree2(),xe=this.cameraService.getZoomScale(),Be=this.coordinateSystemService.getPixelsPerMeter(),it=this.coordinateSystemService.getCoordinateSystem(),gt=this.cameraService.getCameraPosition(),Bt=window.devicePixelRatio,Rt=this.coordinateSystemService.getViewportCenter(),Yt=[n,a],vr=this.cameraService.getFocalDistance();return{data:[...y,...u,...A,...O,...Z,...Y,Q,...ae,xe,...Be,it,...gt,Bt,...Rt,...Yt,vr,0,0,0],uniforms:{[lr.ProjectionMatrix]:u,[lr.ViewMatrix]:y,[lr.ViewProjectionMatrix]:A,[lr.Zoom]:Q,[lr.ZoomScale]:xe,[lr.FocalDistance]:vr,[lr.CameraPosition]:gt,[pt.CoordinateSystem]:it,[pt.ViewportCenter]:Rt,[pt.ViewportCenterProjection]:Z,[pt.PixelsPerDegree]:Y,[pt.PixelsPerDegree2]:ae,[pt.PixelsPerMeter]:Be,[pt.Mvp]:e,u_sceneCenterMercator:r,u_ViewportSize:Yt,u_ModelMatrix:O,u_DevicePixelRatio:Bt}}}}class jA{apply(e){e.hooks.beforeRender.tap("UpdateModelPlugin",()=>{e.layerModel&&e.layerModel.needUpdate().then(r=>{r&&e.renderLayers()})}),e.hooks.afterRender.tap("UpdateModelPlugin",()=>{e.layerModelNeedUpdate=!1})}}class HA{apply(e,{styleAttributeService:r}){e.hooks.init.tapPromise("UpdateStyleAttributePlugin",()=>{this.initStyleAttribute(e,{styleAttributeService:r})}),e.hooks.beforeRender.tap("UpdateStyleAttributePlugin",()=>{e.layerModelNeedUpdate||e.inited&&this.updateStyleAttribute(e,{styleAttributeService:r})})}updateStyleAttribute(e,{styleAttributeService:r}){const n=r.getLayerStyleAttributes()||[],a=r.getLayerStyleAttribute("filter");if(a&&a.needRegenerateVertices){e.layerModelNeedUpdate=!0,n.forEach(u=>u.needRegenerateVertices=!1);return}n.filter(u=>u.needRegenerateVertices).forEach(u=>{r.updateAttributeByFeatureRange(u.name,e.getEncodedData(),u.featureRange.startIndex,u.featureRange.endIndex,e),u.needRegenerateVertices=!1})}initStyleAttribute(e,{styleAttributeService:r}){(r.getLayerStyleAttributes()||[]).filter(a=>a.needRegenerateVertices).forEach(a=>{r.updateAttributeByFeatureRange(a.name,e.getEncodedData(),a.featureRange.startIndex,a.featureRange.endIndex),a.needRegenerateVertices=!1})}}function GA(){return[new Tb,new ZA,new SA,new Sb,new MA,new AA,new HA,new jA,new BA,new VA,new TA,new OA,new NA,new CA]}const nw={[$r.additive]:{enable:!0,func:{srcRGB:Ee.ONE,dstRGB:Ee.ONE,srcAlpha:1,dstAlpha:1}},[$r.none]:{enable:!1},[$r.normal]:{enable:!0,func:{srcRGB:Ee.SRC_ALPHA,dstRGB:Ee.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}},[$r.subtractive]:{enable:!0,func:{srcRGB:Ee.ONE,dstRGB:Ee.ONE,srcAlpha:Ee.ZERO,dstAlpha:Ee.ONE_MINUS_SRC_COLOR},equation:{rgb:Ee.FUNC_SUBTRACT,alpha:Ee.FUNC_SUBTRACT}},[$r.max]:{enable:!0,func:{srcRGB:Ee.ONE,dstRGB:Ee.ONE},equation:{rgb:Ee.MAX_EXT}},[$r.min]:{enable:!0,func:{srcRGB:Ee.ONE,dstRGB:Ee.ONE},equation:{rgb:Ee.MIN_EXT}}};class WA{constructor(e){(0,K.Z)(this,"layer",void 0),this.layer=e}pickRender(e){const n=this.layer.getContainer().layerService,a=this.layer;if(a.tileLayer)return a.tileLayer.pickRender(e);a.hooks.beforePickingEncode.call(),n.renderTileLayerMask(a),a.renderModels({ispick:!0}),a.hooks.afterPickingEncode.call()}pick(e,r){var n=this;return(0,Nr.Z)(function*(){const u=n.layer.getContainer().pickingService;return e.type==="RasterLayer"?n.pickRasterLayer(e,r):(n.pickRender(r),u.pickFromPickingFBO(e,r))})()}pickRasterLayer(e,r,n){const a=this.layer.getContainer(),u=a.pickingService,y=a.mapService,A=this.layer.getSource().extent,O=rc(r.lngLat,A),Z={x:r.x,y:r.y,type:r.type,lngLat:r.lngLat,target:r,rasterValue:null},Y=n||e;if(O){const Q=this.readRasterValue(e,A,y,r.x,r.y);return Z.rasterValue=Q,u.triggerHoverOnLayer(Y,Z),!0}else return Z.type=r.type==="mousemove"?"mouseout":"un"+r.type,u.triggerHoverOnLayer(Y,(0,Wt.Z)((0,Wt.Z)({},Z),{},{type:"unpick"})),u.triggerHoverOnLayer(Y,Z),!1}readRasterValue(e,r,n,a,u){const y=e.getSource().data.dataArray[0],[A=0,O=0,Z=10,Y=-10]=r,Q=n.lngLatToContainer([A,O]),ae=n.lngLatToContainer([Z,Y]),xe=ae.x-Q.x,Be=Q.y-ae.y,it=[(a-Q.x)/xe,(u-ae.y)/Be],gt=y.width||1,Bt=y.height||1,Rt=Math.floor(it[0]*gt),Yt=Math.floor(it[1]*Bt),vr=Math.max(0,Yt-1)*gt+Rt;return y.data[vr]}selectFeature(e){const r=this.layer,[n,a,u]=e;r.hooks.beforeSelect.call([n,a,u])}highlightPickedFeature(e){const[r,n,a]=e;this.layer.hooks.beforeHighlight.call([r,n,a])}getFeatureById(e){return this.layer.getSource().getFeatureById(e)}}class XA{constructor(e){(0,K.Z)(this,"layer",void 0),(0,K.Z)(this,"rendererService",void 0),(0,K.Z)(this,"colorTexture",void 0),(0,K.Z)(this,"key",void 0),this.layer=e;const r=this.layer.getContainer();this.rendererService=r.rendererService}getColorTexture(e,r){const n=this.getTextureKey(e,r);return this.key===n?this.colorTexture:(this.createColorTexture(e,r),this.key=n,this.colorTexture)}createColorTexture(e,r){const{createTexture2D:n}=this.rendererService,a=this.getColorRampBar(e,r),u=n({data:new Uint8Array(a.data),width:a.width,height:a.height,flipY:!1,unorm:!0});return this.colorTexture=u,u}setColorTexture(e,r,n){this.key=this.getTextureKey(r,n),this.colorTexture=e}destroy(){var e;(e=this.colorTexture)===null||e===void 0||e.destroy()}getColorRampBar(e,r){switch(e.type){case"cat":return lo(e);case"quantize":return bs(e);case"custom":return Os(e,r);case"linear":return Ku(e,r);default:return lc(e)}}getTextureKey(e,r){var n;return`${e.colors.join("_")}_${e==null||(n=e.positions)===null||n===void 0?void 0:n.join("_")}_${e.type}_${r==null?void 0:r.join("_")}`}}const qA=["passes"],YA=["moduleName","vertexShader","fragmentShader","inject","triangulation","styleOption","pickingEnabled"],{isEqual:o2,isFunction:iw,isNumber:ow,isObject:id,isPlainObject:$A,isUndefined:KA}=es;let aw=0;class Yd extends Yl.EventEmitter{get shaderModuleService(){return this.container.shaderModuleService}get cameraService(){return this.container.cameraService}get coordinateService(){return this.container.coordinateSystemService}get iconService(){return this.container.iconService}get fontService(){return this.container.fontService}get pickingService(){return this.container.pickingService}get rendererService(){return this.container.rendererService}get layerService(){return this.container.layerService}get debugService(){return this.container.debugService}get interactionService(){return this.container.interactionService}get mapService(){return this.container.mapService}get normalPassFactory(){return this.container.normalPassFactory}constructor(e={}){super(),(0,K.Z)(this,"id",`${aw++}`),(0,K.Z)(this,"name",`${aw}`),(0,K.Z)(this,"parent",void 0),(0,K.Z)(this,"coordCenter",void 0),(0,K.Z)(this,"type",void 0),(0,K.Z)(this,"visible",!0),(0,K.Z)(this,"zIndex",0),(0,K.Z)(this,"minZoom",void 0),(0,K.Z)(this,"maxZoom",void 0),(0,K.Z)(this,"inited",!1),(0,K.Z)(this,"layerModelNeedUpdate",!1),(0,K.Z)(this,"pickedFeatureID",null),(0,K.Z)(this,"selectedFeatureID",null),(0,K.Z)(this,"styleNeedUpdate",!1),(0,K.Z)(this,"rendering",void 0),(0,K.Z)(this,"forceRender",!1),(0,K.Z)(this,"clusterZoom",0),(0,K.Z)(this,"layerType",void 0),(0,K.Z)(this,"triangulation",void 0),(0,K.Z)(this,"layerPickService",void 0),(0,K.Z)(this,"textureService",void 0),(0,K.Z)(this,"defaultSourceConfig",{data:[],options:{parser:{type:"json"}}}),(0,K.Z)(this,"dataState",{dataSourceNeedUpdate:!1,dataMappingNeedUpdate:!1,filterNeedUpdate:!1,featureScaleNeedUpdate:!1,StyleAttrNeedUpdate:!1}),(0,K.Z)(this,"hooks",{init:new Ye,afterInit:new Me,beforeRender:new Me,beforeRenderData:new ot,afterRender:new f,beforePickingEncode:new f,afterPickingEncode:new f,beforeHighlight:new f(["pickedColor"]),afterHighlight:new f,beforeSelect:new f(["pickedColor"]),afterSelect:new f,beforeDestroy:new f,afterDestroy:new f}),(0,K.Z)(this,"models",[]),(0,K.Z)(this,"multiPassRenderer",void 0),(0,K.Z)(this,"plugins",void 0),(0,K.Z)(this,"startInit",!1),(0,K.Z)(this,"sourceOption",void 0),(0,K.Z)(this,"layerModel",void 0),(0,K.Z)(this,"shapeOption",void 0),(0,K.Z)(this,"tileLayer",void 0),(0,K.Z)(this,"layerChildren",[]),(0,K.Z)(this,"masks",[]),(0,K.Z)(this,"configService",$m),(0,K.Z)(this,"styleAttributeService",void 0),(0,K.Z)(this,"layerSource",void 0),(0,K.Z)(this,"postProcessingPassFactory",void 0),(0,K.Z)(this,"animateOptions",{enable:!1}),(0,K.Z)(this,"container",void 0),(0,K.Z)(this,"encodedData",void 0),(0,K.Z)(this,"currentPickId",null),(0,K.Z)(this,"rawConfig",void 0),(0,K.Z)(this,"needUpdateConfig",void 0),(0,K.Z)(this,"encodeStyleAttribute",{}),(0,K.Z)(this,"enableShaderEncodeStyles",[]),(0,K.Z)(this,"enableDataEncodeStyles",[]),(0,K.Z)(this,"pendingStyleAttributes",[]),(0,K.Z)(this,"scaleOptions",{}),(0,K.Z)(this,"animateStartTime",void 0),(0,K.Z)(this,"animateStatus",!1),(0,K.Z)(this,"isDestroyed",!1),(0,K.Z)(this,"uniformBuffers",[]),(0,K.Z)(this,"encodeDataLength",0),(0,K.Z)(this,"sourceEvent",()=>{this.dataState.dataSourceNeedUpdate=!0;const r=this.getLayerConfig();r&&r.autoFit&&this.fitBounds(r.fitBoundsOptions),this.layerSource.getSourceCfg().autoRender&&setTimeout(()=>{this.reRender()},10)}),this.name=e.name||this.id,this.zIndex=e.zIndex||0,this.rawConfig=e,this.masks=e.maskLayers||[]}addMask(e){this.masks.push(e),this.updateLayerConfig({maskLayers:this.masks}),this.enableMask()}removeMask(e){const r=this.masks.indexOf(e);r>-1&&this.masks.splice(r,1),this.updateLayerConfig({maskLayers:this.masks})}disableMask(){this.updateLayerConfig({enableMask:!1})}enableMask(){this.updateLayerConfig({enableMask:!0})}addMaskLayer(e){this.masks.push(e)}removeMaskLayer(e){const r=this.masks.indexOf(e);r>-1&&this.masks.splice(r,1),e.destroy()}getAttribute(e){return this.styleAttributeService.getLayerStyleAttribute(e)}getLayerConfig(){return this.configService.getLayerConfig(this.id)}updateLayerConfig(e){if(Object.keys(e).map(r=>{r in this.rawConfig&&(this.rawConfig[r]=e[r])}),!this.startInit)this.needUpdateConfig=(0,Wt.Z)((0,Wt.Z)({},this.needUpdateConfig),e);else{const r=this.container.id;this.configService.setLayerConfig(r,this.id,(0,Wt.Z)((0,Wt.Z)((0,Wt.Z)({},this.configService.getLayerConfig(this.id)),this.needUpdateConfig),e)),this.needUpdateConfig={}}}setContainer(e){this.container=e}getContainer(){return this.container}addPlugin(e){return this.plugins.push(e),this}init(){var e=this;return(0,Nr.Z)(function*(){const r=e.container.id;e.startInit=!0,e.configService.setLayerConfig(r,e.id,e.rawConfig),e.layerType=e.rawConfig.layerType;const{enableMultiPassRenderer:n,passes:a}=e.getLayerConfig();n&&a!==null&&a!==void 0&&a.length&&a.length>0&&e.mapService.on("mapAfterFrameChange",()=>{e.renderLayers()}),e.postProcessingPassFactory=e.container.postProcessingPassFactory,e.styleAttributeService=e.container.styleAttributeService,n&&(e.multiPassRenderer=e.container.multiPassRenderer,e.multiPassRenderer.setLayer(e)),e.pendingStyleAttributes.forEach(({attributeName:u,attributeField:y,attributeValues:A,updateOptions:O})=>{e.styleAttributeService.updateStyleAttribute(u,{scale:(0,Wt.Z)({field:y},e.splitValuesAndCallbackInAttribute(A,y?void 0:e.getLayerConfig()[u]))},O)}),e.pendingStyleAttributes=[],e.plugins=GA();for(const u of e.plugins)u.apply(e,e.container);e.layerPickService=new WA(e),e.textureService=new XA(e),e.log($t.LayerInitStart),yield e.hooks.init.promise(),e.log($t.LayerInitEnd),e.inited=!0,e.emit("inited",{target:e,type:"inited"}),e.emit("add",{target:e,type:"add"}),e.hooks.afterInit.call()})()}log(e,r="init"){var n;if(this.tileLayer||this.isTileLayer)return;const a=`${this.id}.${r}.${e}`,u={id:this.id,type:this.type};(n=this.debugService)===null||n===void 0||n.log(a,u)}updateModelData(e){e.attributes&&e.elements?this.models.map(r=>{r.updateAttributesAndElements(e.attributes,e.elements)}):console.warn("data error")}setLayerPickService(e){this.layerPickService=e}prepareBuildModel(){Object.keys(this.needUpdateConfig||{}).length!==0&&this.updateLayerConfig({});const{animateOption:e}=this.getLayerConfig();e!=null&&e.enable&&(this.layerService.startAnimate(),this.animateStatus=!0)}color(e,r,n){return this.updateStyleAttribute("color",e,r,n),this}texture(e,r,n){return this.updateStyleAttribute("texture",e,r,n),this}rotate(e,r,n){return this.updateStyleAttribute("rotate",e,r,n),this}size(e,r,n){return this.updateStyleAttribute("size",e,r,n),this}filter(e,r,n){const a=this.updateStyleAttribute("filter",e,r,n);return this.dataState.dataSourceNeedUpdate=a&&this.inited,this}shape(e,r,n){this.shapeOption={field:e,values:r};const a=this.updateStyleAttribute("shape",e,r,n);return this.dataState.dataSourceNeedUpdate=a&&this.inited,this}label(e,r,n){return this.pendingStyleAttributes.push({attributeName:"label",attributeField:e,attributeValues:r,updateOptions:n}),this}animate(e){let r={};return id(e)?(r.enable=!0,r=(0,Wt.Z)((0,Wt.Z)({},r),e)):r.enable=e,this.updateLayerConfig({animateOption:r}),this}source(e,r){return(e==null?void 0:e.type)==="source"?(this.setSource(e),this):(this.sourceOption={data:e,options:r},this.clusterZoom=0,this)}setData(e,r){return this.inited?(this.dataUpdatelog(),this.layerSource.setData(e,r)):this.on("inited",()=>{this.dataUpdatelog(),this.layerSource.setData(e,r)}),this}dataUpdatelog(){this.log($t.SourceInitStart,_n.UPDATE),this.layerSource.once("update",()=>{this.log($t.SourceInitEnd,_n.UPDATE)})}style(e){const{passes:r}=e,n=(0,Ge.Z)(e,qA);r&&tw(r).forEach(u=>{const y=this.multiPassRenderer.getPostProcessor().getPostProcessingPassByName(u[0]);y&&y.updateOptions(u[1])}),n.borderColor&&(n.stroke=n.borderColor),n.borderWidth&&(n.strokeWidth=n.borderWidth);const a=n;return Object.keys(n).forEach(u=>{const y=n[u];Array.isArray(y)&&y.length===2&&!ow(y[0])&&!ow(y[1])&&(a[u]={field:y[0],value:y[1]})}),this.encodeStyle(a),this.updateLayerConfig(a),this}encodeStyle(e){Object.keys(e).forEach(r=>{[...this.enableShaderEncodeStyles,...this.enableDataEncodeStyles].includes(r)&&$A(e[r])&&(e[r].field||e[r].value)&&!o2(this.encodeStyleAttribute[r],e[r])?(this.encodeStyleAttribute[r]=e[r],this.updateStyleAttribute(r,e[r].field,e[r].value),this.inited&&(this.dataState.dataMappingNeedUpdate=!0)):this.encodeStyleAttribute[r]&&(delete this.encodeStyleAttribute[r],this.dataState.dataSourceNeedUpdate=!0)})}scale(e,r){const n=(0,Wt.Z)({},this.scaleOptions);if(id(e)?this.scaleOptions=(0,Wt.Z)((0,Wt.Z)({},this.scaleOptions),e):this.scaleOptions[e]=r,this.styleAttributeService&&!o2(n,this.scaleOptions)){const a=id(e)?e:{[e]:r};this.styleAttributeService.updateScaleAttribute(a)}return this}renderLayers(){this.rendering=!0,this.layerService.reRender(),this.rendering=!1}prerender(){}render(e={}){return this.tileLayer?(this.tileLayer.render(),this):(this.layerService.beforeRenderData(this),this.encodeDataLength<=0&&!this.forceRender?this:(this.renderModels(e),this))}renderMultiPass(){var e=this;return(0,Nr.Z)(function*(){e.encodeDataLength<=0&&!e.forceRender||(e.multiPassRenderer&&e.multiPassRenderer.getRenderFlag()?yield e.multiPassRenderer.render():(e.multiPassRenderer,e.renderModels()))})()}active(e){const r={};return r.enableHighlight=id(e)?!0:e,id(e)?(r.enableHighlight=!0,e.color&&(r.highlightColor=e.color),e.mix&&(r.activeMix=e.mix)):r.enableHighlight=!!e,this.updateLayerConfig(r),this}setActive(e,r){if(id(e)){const{x:n=0,y:a=0}=e;this.updateLayerConfig({highlightColor:id(r)?r.color:this.getLayerConfig().highlightColor,activeMix:id(r)?r.mix:this.getLayerConfig().activeMix}),this.pick({x:n,y:a})}else this.updateLayerConfig({pickedFeatureID:e,highlightColor:id(r)?r.color:this.getLayerConfig().highlightColor,activeMix:id(r)?r.mix:this.getLayerConfig().activeMix}),this.hooks.beforeHighlight.call(Ni(e)).then(()=>{setTimeout(()=>{this.reRender()},1)})}select(e){const r={};return r.enableSelect=id(e)?!0:e,id(e)?(r.enableSelect=!0,e.color&&(r.selectColor=e.color),e.mix&&(r.selectMix=e.mix)):r.enableSelect=!!e,this.updateLayerConfig(r),this}setSelect(e,r){if(id(e)){const{x:n=0,y:a=0}=e;this.updateLayerConfig({selectColor:id(r)?r.color:this.getLayerConfig().selectColor,selectMix:id(r)?r.mix:this.getLayerConfig().selectMix}),this.pick({x:n,y:a})}else this.updateLayerConfig({pickedFeatureID:e,selectColor:id(r)?r.color:this.getLayerConfig().selectColor,selectMix:id(r)?r.mix:this.getLayerConfig().selectMix}),this.hooks.beforeSelect.call(Ni(e)).then(()=>{setTimeout(()=>{this.reRender()},1)})}setBlend(e){return this.updateLayerConfig({blend:e}),this.reRender(),this}show(){return this.updateLayerConfig({visible:!0}),this.reRender(),this.emit("show"),this}hide(){return this.updateLayerConfig({visible:!1}),this.reRender(),this.emit("hide"),this}setIndex(e){return this.zIndex=e,this.layerService.updateLayerRenderList(),this.layerService.renderLayers(),this}setCurrentPickId(e){this.currentPickId=e}getCurrentPickId(){return this.currentPickId}setCurrentSelectedId(e){this.selectedFeatureID=e}getCurrentSelectedId(){return this.selectedFeatureID}isVisible(){const e=this.mapService.getZoom(),{visible:r,minZoom:n=-1/0,maxZoom:a=1/0}=this.getLayerConfig();return!!r&&e>=n&&e<a}setMultiPass(e,r){if(this.updateLayerConfig({enableMultiPassRenderer:e}),r&&this.updateLayerConfig({passes:r}),e){const{passes:n=[]}=this.getLayerConfig();this.multiPassRenderer=rw(this,n,this.postProcessingPassFactory,this.normalPassFactory),this.multiPassRenderer.setRenderFlag(!0);const{width:a,height:u}=this.rendererService.getViewportSize();this.multiPassRenderer.resize(a,u)}return this}setMinZoom(e){return this.updateLayerConfig({minZoom:e}),this}getMinZoom(){const{minZoom:e}=this.getLayerConfig();return e}getMaxZoom(){const{maxZoom:e}=this.getLayerConfig();return e}get(e){return this.getLayerConfig()[e]}setMaxZoom(e){return this.updateLayerConfig({maxZoom:e}),this}setAutoFit(e){return this.updateLayerConfig({autoFit:e}),this}fitBounds(e){if(!this.inited)return this.updateLayerConfig({autoFit:!0}),this;const n=this.getSource().extent;return n.some(u=>Math.abs(u)===1/0)?this:(this.mapService.fitBounds([[n[0],n[1]],[n[2],n[3]]],e),this)}destroy(e=!0){var r,n,a,u,y;if(this.isDestroyed)return;(r=this.layerModel)===null||r===void 0||r.uniformBuffers.forEach(O=>{O.destroy()}),this.layerChildren.map(O=>O.destroy(!1)),this.layerChildren=[];const{maskfence:A}=this.getLayerConfig();A&&(this.masks.map(O=>O.destroy(!1)),this.masks=[]),this.hooks.beforeDestroy.call(),this.layerSource.off("update",this.sourceEvent),(n=this.multiPassRenderer)===null||n===void 0||n.destroy(),this.textureService.destroy(),this.styleAttributeService.clearAllAttributes(),this.hooks.afterDestroy.call(),(a=this.layerModel)===null||a===void 0||a.clearModels(e),(u=this.tileLayer)===null||u===void 0||u.destroy(),this.models=[],(y=this.debugService)===null||y===void 0||y.removeLog(this.id),this.emit("remove",{target:this,type:"remove"}),this.emit("destroy",{target:this,type:"destroy"}),this.removeAllListeners(),this.isDestroyed=!0}clear(){this.styleAttributeService.clearAllAttributes()}clearModels(){var e;this.models.forEach(r=>r.destroy()),(e=this.layerModel)===null||e===void 0||e.clearModels(),this.models=[]}isDirty(){return!!(this.styleAttributeService.getLayerStyleAttributes()||[]).filter(e=>e.needRescale||e.needRemapping||e.needRegenerateVertices).length}setSource(e){if(this.layerSource&&this.layerSource.off("update",this.sourceEvent),this.layerSource=e,this.clusterZoom=0,this.inited&&this.layerSource.cluster){const r=this.mapService.getZoom();this.layerSource.updateClusterData(r)}this.layerSource.inited&&this.sourceEvent(),this.layerSource.on("update",({type:r})=>{if(this.coordCenter===void 0){var n;const a=this.layerSource.center;this.coordCenter=a,(n=this.mapService)!==null&&n!==void 0&&n.setCoordCenter&&this.mapService.setCoordCenter(a)}if(r==="update"){if(this.tileLayer){this.tileLayer.reload();return}this.sourceEvent()}})}getSource(){return this.layerSource}getScaleOptions(){return this.scaleOptions}setEncodedData(e){this.encodedData=e,this.encodeDataLength=e.length}getEncodedData(){return this.encodedData}getScale(e){return this.styleAttributeService.getLayerAttributeScale(e)}getLegend(e){var r,n,a;const u=this.styleAttributeService.getLayerStyleAttribute(e);return{type:(n=((u==null||(r=u.scale)===null||r===void 0?void 0:r.scalers)||[])[0])===null||n===void 0||(n=n.option)===null||n===void 0?void 0:n.type,field:u==null||(a=u.scale)===null||a===void 0?void 0:a.field,items:this.getLegendItems(e)}}getLegendItems(e){const r=this.styleAttributeService.getLayerAttributeScale(e);return r?r.invertExtent?r.range().map(a=>({value:r.invertExtent(a),[e]:a})):r.ticks?r.ticks().map(a=>({value:a,[e]:r(a)})):r!=null&&r.domain?r.domain().filter(a=>!KA(a)).map(a=>({value:a,[e]:r(a)})):[]:[]}pick({x:e,y:r}){this.interactionService.triggerHover({x:e,y:r})}boxSelect(e,r){this.pickingService.boxPickLayer(this,e,r)}buildLayerModel(e){var r=this;return(0,Nr.Z)(function*(){const{moduleName:n,vertexShader:a,fragmentShader:u,inject:y,triangulation:A,styleOption:O,pickingEnabled:Z=!0}=e,Y=(0,Ge.Z)(e,YA);r.shaderModuleService.registerModule(n,{vs:a,fs:u,inject:y});const{vs:Q,fs:ae,uniforms:xe}=r.shaderModuleService.getModule(n),{createModel:Be}=r.rendererService;return new Promise(it=>{const{attributes:gt,elements:Bt,count:Rt}=r.styleAttributeService.createAttributesAndIndices(r.encodedData,A,O,r),Yt=[...r.layerModel.uniformBuffers,...r.rendererService.uniformBuffers,r.getLayerUniformBuffer()];Z&&Yt.push(r.getPickingUniformBuffer());const vr=(0,Wt.Z)({attributes:gt,uniforms:xe,fs:ae,vs:Q,elements:Bt,blend:nw[$r.normal],uniformBuffers:Yt,textures:r.layerModel.textures},Y);Rt&&(vr.count=Rt);const ln=Be(vr);it(ln)})})()}createAttributes(e){const{triangulation:r}=e,{attributes:n}=this.styleAttributeService.createAttributes(this.encodedData,r);return n}getTime(){return this.layerService.clock.getDelta()}setAnimateStartTime(){this.animateStartTime=this.layerService.clock.getElapsedTime()}stopAnimate(){this.animateStatus&&(this.layerService.stopAnimate(),this.animateStatus=!1,this.updateLayerConfig({animateOption:{enable:!1}}))}getLayerAnimateTime(){return this.layerService.clock.getElapsedTime()-this.animateStartTime}needPick(e){const{enableHighlight:r=!0,enableSelect:n=!0}=this.getLayerConfig();let a=this.eventNames().indexOf(e)!==-1||this.eventNames().indexOf("un"+e)!==-1;return(e==="click"||e==="dblclick")&&n&&(a=!0),e==="mousemove"&&(r||this.eventNames().indexOf("mouseenter")!==-1||this.eventNames().indexOf("unmousemove")!==-1||this.eventNames().indexOf("mouseout")!==-1)&&(a=!0),this.isVisible()&&a}buildModels(){return(0,Nr.Z)(function*(){throw new Error("Method not implemented.")})()}rebuildModels(){var e=this;return(0,Nr.Z)(function*(){yield e.buildModels()})()}renderMulPass(e){return(0,Nr.Z)(function*(){yield e.render()})()}renderModels(e={}){return this.encodeDataLength<=0&&!this.forceRender?(this.clearModels(),this):(this.hooks.beforeRender.call(),this.models.forEach(r=>{r.draw({uniforms:this.layerModel.getUninforms(),blend:this.layerModel.getBlend(),stencil:this.layerModel.getStencil(e),textures:this.layerModel.textures},(e==null?void 0:e.ispick)||!1)}),this.hooks.afterRender.call(),this)}updateStyleAttribute(e,r,n,a){const u=this.configService.getAttributeConfig(this.id)||{};return o2(u[e],{field:r,values:n})?!1:(["color","size","texture","rotate","filter","label","shape"].indexOf(e)!==-1&&this.configService.setAttributeConfig(this.id,{[e]:{field:r,values:n}}),this.startInit?this.styleAttributeService.updateStyleAttribute(e,{scale:(0,Wt.Z)({field:r},this.splitValuesAndCallbackInAttribute(n,this.getLayerConfig()[r]))},a):this.pendingStyleAttributes.push({attributeName:e,attributeField:r,attributeValues:n,updateOptions:a}),!0)}getLayerAttributeConfig(){return this.configService.getAttributeConfig(this.id)}getShaderPickStat(){return this.layerService.getShaderPickStat()}setEarthTime(e){console.warn("empty fn")}processData(e){return e}getModelType(){throw new Error("Method not implemented.")}getDefaultConfig(){return{}}initLayerModels(){var e=this;return(0,Nr.Z)(function*(){e.models.forEach(a=>a.destroy()),e.models=[],e.uniformBuffers.forEach(a=>{a.destroy()}),e.uniformBuffers=[];const r=e.rendererService.createBuffer({data:new Float32Array(16+4).fill(0),isUBO:!0});e.uniformBuffers.push(r);const n=e.rendererService.createBuffer({data:new Float32Array(20).fill(0),isUBO:!0});e.uniformBuffers.push(n),e.models=yield e.layerModel.initModels()})()}getLayerUniformBuffer(){return this.uniformBuffers[0]}getPickingUniformBuffer(){return this.uniformBuffers[1]}reRender(){this.inited&&this.layerService.reRender()}splitValuesAndCallbackInAttribute(e){return{values:iw(e)?void 0:e,callback:iw(e)?e:void 0}}}function JA(t,e){return{enable:t,mask:255,func:{cmp:Ee.EQUAL,ref:e?1:0,mask:1}}}function sw(t){return t.maskOperation===vn.OR?{enable:!0,mask:255,func:{cmp:Ee.ALWAYS,ref:1,mask:255},opFront:{fail:Ee.KEEP,zfail:Ee.REPLACE,zpass:Ee.REPLACE}}:{enable:!0,mask:255,func:{cmp:t.stencilType===Tn.SINGLE||t.stencilIndex===0?Ee.ALWAYS:Ee.LESS,ref:t.stencilType===Tn.SINGLE?1:t.stencilIndex===0?2:1,mask:255},opFront:{fail:Ee.KEEP,zfail:Ee.REPLACE,zpass:Ee.REPLACE}}}const QA={opacity:1,stroke:[1,0,0,1],offsets:[0,0],rotation:0,extrusionBase:0,strokeOpacity:1,thetaOffset:.314},t1={opacity:"float",stroke:"vec4",offsets:"vec2",textOffset:"vec2",rotation:"float",extrusionBase:"float",strokeOpacity:"float",thetaOffset:"float"};function lw(t){return Math.max(Math.ceil(t/4)*4,4)}const a2={opacity:Ro.OPACITY,stroke:Ro.STROKE,offsets:Ro.OFFSETS,rotation:Ro.ROTATION,extrusionBase:Ro.EXTRUSION_BASE,thetaOffset:15};class Ml{constructor(e){(0,K.Z)(this,"triangulation",void 0),(0,K.Z)(this,"uniformBuffers",[]),(0,K.Z)(this,"textures",[]),(0,K.Z)(this,"createTexture2D",void 0),(0,K.Z)(this,"preStyleAttribute",{}),(0,K.Z)(this,"encodeStyleAttribute",{}),(0,K.Z)(this,"layer",void 0),(0,K.Z)(this,"dataTexture",void 0),(0,K.Z)(this,"DATA_TEXTURE_WIDTH",void 0),(0,K.Z)(this,"dataTextureTest",void 0),(0,K.Z)(this,"configService",void 0),(0,K.Z)(this,"shaderModuleService",void 0),(0,K.Z)(this,"rendererService",void 0),(0,K.Z)(this,"iconService",void 0),(0,K.Z)(this,"fontService",void 0),(0,K.Z)(this,"styleAttributeService",void 0),(0,K.Z)(this,"mapService",void 0),(0,K.Z)(this,"cameraService",void 0),(0,K.Z)(this,"layerService",void 0),(0,K.Z)(this,"pickingService",void 0),(0,K.Z)(this,"attributeUnifoms",void 0),(0,K.Z)(this,"commonUnifoms",void 0),this.layer=e,this.configService=e.getContainer().globalConfigService,this.rendererService=e.getContainer().rendererService,this.pickingService=e.getContainer().pickingService,this.shaderModuleService=e.getContainer().shaderModuleService,this.styleAttributeService=e.getContainer().styleAttributeService,this.mapService=e.getContainer().mapService,this.iconService=e.getContainer().iconService,this.fontService=e.getContainer().fontService,this.cameraService=e.getContainer().cameraService,this.layerService=e.getContainer().layerService,this.registerStyleAttribute(),this.registerBuiltinAttributes(),this.startModelAnimate();const{createTexture2D:r}=this.rendererService;this.createTexture2D=r}getBlend(){const{blend:e="normal"}=this.layer.getLayerConfig();return nw[$r[e]]}getStencil(e){const{mask:r=!1,maskInside:n=!0,enableMask:a,maskOperation:u=vn.AND}=this.layer.getLayerConfig();if(this.layer.type==="MaskLayer")return sw({isStencil:!0,stencilType:Tn.SINGLE});if(e.isStencil)return sw((0,Wt.Z)((0,Wt.Z)({},e),{},{maskOperation:u}));const y=r||a&&this.layer.masks.length!==0||this.layer.tileMask!==void 0;return JA(y,n)}getDefaultStyle(){return{}}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());this.updateStyleUnifoms();const n=(0,Wt.Z)((0,Wt.Z)({},r.uniformsOption),e.uniformsOption);return Object.keys(n).forEach(a=>{typeof n[a]=="boolean"&&(n[a]=n[a]?1:0)}),!this.rendererService.hasOwnProperty("device")&&this.textures&&this.textures.length===1&&(n.u_texture=this.textures[0]),n}getAnimateUniforms(){return{}}needUpdate(){return(0,Nr.Z)(function*(){return!1})()}buildModels(){return(0,Nr.Z)(function*(){throw new Error("Method not implemented.")})()}initModels(){return(0,Nr.Z)(function*(){throw new Error("Method not implemented.")})()}clearModels(e=!0){}getAttribute(){throw new Error("Method not implemented.")}prerender(){}render(e){throw new Error("Method not implemented.")}registerBuiltinAttributes(){throw new Error("Method not implemented.")}animateOption2Array(e){return[e.enable?0:1,e.duration||4,e.interval||.2,e.trailLength||.1]}startModelAnimate(){const{animateOption:e}=this.layer.getLayerConfig();e.enable&&this.layer.setAnimateStartTime()}getInject(){const e=this.layer.encodeStyleAttribute;let r="";const n=[];this.layer.enableShaderEncodeStyles.forEach(y=>{e[y]?r+=`#define USE_ATTRIBUTE_${y.toUpperCase()} 0.0;
`:n.push(` ${t1[y]} u_${y};`);let A=a2[y];!A&&y==="THETA_OFFSET"&&(A=15),r+=`
#ifdef USE_ATTRIBUTE_${y.toUpperCase()}
layout(location = ${a2[y]}) in ${t1[y]} a_${y.charAt(0).toUpperCase()+y.slice(1)};
#endif
`});const a=n.length?`
layout(std140) uniform AttributeUniforms {
${n.join(`
`)}
};
`:"";r+=a;let u="";return this.layer.enableShaderEncodeStyles.forEach(y=>{u+=`
#ifdef USE_ATTRIBUTE_${y.toUpperCase()}
${t1[y]} ${y} = a_${y.charAt(0).toUpperCase()+y.slice(1)};
#else
${t1[y]} ${y} = u_${y};
#endif
`}),{"vs:#decl":r,"fs:#decl":a,"vs:#main-start":u}}getStyleAttribute(){const e={};return this.layer.enableShaderEncodeStyles.forEach(r=>{if(!this.layer.encodeStyleAttribute[r]){const n=this.layer.getLayerConfig()[r];let a=typeof n=="undefined"?QA[r]:n;r==="stroke"&&(a=Va(a)),e["u_"+r]=a}}),e}registerStyleAttribute(){Object.keys(this.layer.encodeStyleAttribute).forEach(e=>{const r=FA(e);r&&(this.styleAttributeService.registerStyleAttribute(r),r.descriptor&&(r.descriptor.shaderLocation=a2[e]))})}updateEncodeAttribute(e,r){this.encodeStyleAttribute[e]=r}initUniformsBuffer(){const e=this.getUniformsBufferInfo(this.getStyleAttribute()),r=this.getCommonUniformsInfo();e.uniformsLength!==0&&(this.attributeUnifoms=this.rendererService.createBuffer({data:new Float32Array(lw(e.uniformsLength)).fill(0),isUBO:!0}),this.uniformBuffers.push(this.attributeUnifoms)),r.uniformsLength!==0&&(this.commonUnifoms=this.rendererService.createBuffer({data:new Float32Array(lw(r.uniformsLength)).fill(0),isUBO:!0}),this.uniformBuffers.push(this.commonUnifoms))}getUniformsBufferInfo(e){let r=0;const n=[];return Object.values(e).forEach(a=>{Array.isArray(a)?(n.push(...a),r+=a.length):typeof a=="number"?(n.push(a),r+=1):typeof a=="boolean"&&(n.push(Number(a)),r+=1)}),{uniformsOption:e,uniformsLength:r,uniformsArray:n}}getCommonUniformsInfo(){return{uniformsLength:0,uniformsArray:[],uniformsOption:{}}}updateStyleUnifoms(){var e,r;const{uniformsArray:n}=this.getUniformsBufferInfo(this.getStyleAttribute()),{uniformsArray:a}=this.getCommonUniformsInfo();(e=this.attributeUnifoms)===null||e===void 0||e.subData({offset:0,data:new Uint8Array(new Float32Array(n).buffer)}),(r=this.commonUnifoms)===null||r===void 0||r.subData({offset:0,data:new Uint8Array(new Float32Array(a).buffer)})}}let eC=function(t){return t[t.solid=0]="solid",t[t.dash=1]="dash",t}({}),s2=function(t){return t.VERTICAL="vertical",t.HORIZONTAL="horizontal",t}({}),uw=function(t){return t.NORMAL="normal",t.REPLACE="replace",t}({}),r1=function(t){return t[t.pixel=0]="pixel",t[t.meter=1]="meter",t}({}),cw=function(t){return t.ALWAYS="always",t.DRAGEND="dragend",t}({});const tC={canvas2d:"2d",webgl:"webgl",webgl2:"webgl2",webgpu:"webgpu"};class rC extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"canvas",null),(0,K.Z)(this,"ctx",void 0),(0,K.Z)(this,"ctxType",void 0),(0,K.Z)(this,"viewportSize",void 0),(0,K.Z)(this,"initCanvas",()=>{var r,n,a,u,y;const{zIndex:A,getContext:O}=this.layerConfig,Z=document.createElement("canvas"),Y=this.layer.getModelType();this.canvas=Z,Z.classList.add("l7-canvas-layer"),Z.style.position="absolute",Z.style.top="0",Z.style.left="0",Z.style.zIndex=String(A),this.resetCanvasSize();const Q=(r=(n=(a=this.mapService).getCanvasOverlays)===null||n===void 0?void 0:n.call(a))!==null&&r!==void 0?r:(u=(y=this.mapService).getMapCanvasContainer)===null||u===void 0?void 0:u.call(y);Q==null||Q.appendChild(Z),this.ctx=O?O(Z):Z.getContext(tC[Y]),this.ctx||console.error("Failed to get rendering context for canvas"),this.bindListeners()}),(0,K.Z)(this,"resetViewportSize",()=>{const{width:r,height:n}=this.rendererService.getViewportSize();this.viewportSize=[r,n]}),(0,K.Z)(this,"resetCanvasSize",()=>{const r=this.canvas;if(!r)return;this.resetViewportSize();const[n,a]=this.mapService.getSize(),[u,y]=this.viewportSize;r.width=u,r.height=y,r.style.width=n+"px",r.style.height=a+"px"}),(0,K.Z)(this,"renderCanvas",()=>{var r;this.canvas||this.initCanvas();const{draw:n,drawingOnCanvas:a}=this.layerConfig,[u,y]=this.viewportSize,A=this.mapService.getBounds();(r=n!=null?n:a)===null||r===void 0||r({canvas:this.canvas,ctx:this.ctx,container:{width:u,height:y,bounds:A},size:[u,y],utils:{lngLatToContainer:this.lngLatToContainer},mapService:this.mapService})}),(0,K.Z)(this,"removeCanvas",()=>{if(this.canvas){var r;(r=this.canvas.parentElement)===null||r===void 0||r.removeChild(this.canvas),this.canvas=null}this.unbindListeners()}),(0,K.Z)(this,"onMapResize",()=>{requestAnimationFrame(()=>{this.resetCanvasSize(),this.renderCanvas()})}),(0,K.Z)(this,"lngLatToContainer",r=>{const{x:n,y:a}=this.mapService.lngLatToContainer(r);return{x:n*window.devicePixelRatio,y:a*window.devicePixelRatio}})}get layerConfig(){return this.layer.getLayerConfig()}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.renderCanvas(),[]})()}bindListeners(){this.mapService.on("resize",this.onMapResize);const{trigger:e,update:r}=this.layerConfig;r===cw.ALWAYS||e==="change"?this.mapService.on("mapchange",this.renderCanvas):(this.mapService.on("zoomstart",this.removeCanvas),this.mapService.on("zoomend",this.renderCanvas),this.mapService.on("movestart",this.removeCanvas),this.mapService.on("moveend",this.renderCanvas))}unbindListeners(){this.mapService.off("resize",this.onMapResize),this.mapService.off("mapchange",this.renderCanvas),this.mapService.off("zoomstart",this.removeCanvas),this.mapService.off("zoomend",this.renderCanvas),this.mapService.off("movestart",this.removeCanvas),this.mapService.off("moveend",this.renderCanvas)}registerBuiltinAttributes(){}}class nC extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","CanvasLayer")}getDefaultConfig(){return{zIndex:3,contextType:"canvas2d",trigger:"change"}}buildModels(){var e=this;return(0,Nr.Z)(function*(){e.layerModel=new rC(e),yield e.initLayerModels()})()}getModelType(){return this.getLayerConfig().contextType||"canvas2d"}draw(e){return this.updateLayerConfig({draw:e}),this.render(),this}getLayerConfig(){const e=(0,Wt.Z)((0,Wt.Z)({},this.getDefaultConfig()),super.getLayerConfig());return e.zIndex<3&&(e.zIndex=3),e}render(){var e;return(e=this.layerModel)===null||e===void 0||e.renderCanvas(),this}getCanvas(){var e;return(e=this.layerModel)===null||e===void 0?void 0:e.canvas}show(){const e=this.getCanvas();return e&&(e.style.display="unset"),this}hide(){const e=this.getCanvas();return e&&(e.style.display="none"),this}destroy(){this.layerModel.removeCanvas(),super.destroy()}}var iC=Se(75734),Rm=Se.n(iC),ra=Se(54442);const n1=100,hw=36,oC=40;function pw(t){return t/180*Math.acos(-1)}function fw(t){const e=pw(t[0])+Math.PI/2,r=pw(t[1]),n=n1+Math.random()*.4,a=n*Math.cos(r)*Math.cos(e),u=n*Math.cos(r)*Math.sin(e),y=n*Math.sin(r);return[u,y,a]}function dw(t,e){const r=Kr.create(),n=Kr.create(),a=ra.fromValues(0,1,0),u=ra.fromValues(0,0,0);e=e||{},t=typeof t!="undefined"?t:1;const A=2+(typeof e.segments!="undefined"?e.segments:32),O=2*A,Z=[],Y=[],Q=[],ae=[],xe=[],Be=[];for(let it=0;it<=A;it++){const gt=it/A,Bt=gt*Math.PI;for(let Rt=0;Rt<=O;Rt++){const Yt=Rt/O,vr=Yt*Math.PI*2;Kr.identity(n),Kr.rotateZ(n,n,-Bt),Kr.identity(r),Kr.rotateY(r,r,vr),ra.transformMat4(u,a,n),ra.transformMat4(u,u,r),ra.scale(u,u,-t),Q.push(u.slice()),ae.push(...u.slice()),ra.normalize(u,u),xe.push(...u.slice()),Be.push([Yt,1-gt]),ae.push(Yt,1-gt)}if(it>0){const Rt=Q.length;let Yt=Rt-2*(O+1);for(;Yt+O+2<Rt;Yt++)Z.push([Yt,Yt+1,Yt+O+1]),Y.push(Yt,Yt+1,Yt+O+1),Z.push([Yt+O+1,Yt+1,Yt+O+2]),Y.push(Yt+O+1,Yt+1,Yt+O+2)}}return{cells:Z,positions:Q,uvs:Be,positionsArr:ae,indicesArr:Y,normalArr:xe}}var Ja=Se(38015);const i1=Ja.create(),bO=Ja.create(),ff=Ja.create(),Og=Ja.create(),D0=Ja.create();function l2(t,e,r,n,a){Ja.add(t,r,n),Ja.normalize(t,t),e=Ja.fromValues(-t[1],t[0]);const u=Ja.fromValues(-r[1],r[0]);return[a/Ja.dot(e,u),e]}function Bg(t,e){return Ja.set(t,-e[1],e[0])}function O0(t,e,r){return Ja.sub(t,e,r),Ja.normalize(t,t),t}function u2(t,e){return t[0]===e[0]&&t[1]===e[1]}function EO(t){const e=new Map;for(let r=0;r<t.length;r++){const n=t[0].toString()+"-"+t[1].toString();e.get(n)?(t.splice(r,1),r++):e.set(n,n)}return t}class aC{constructor(e={}){(0,K.Z)(this,"complex",void 0),(0,K.Z)(this,"join",void 0),(0,K.Z)(this,"cap",void 0),(0,K.Z)(this,"miterLimit",void 0),(0,K.Z)(this,"thickness",void 0),(0,K.Z)(this,"normal",void 0),(0,K.Z)(this,"lastFlip",-1),(0,K.Z)(this,"miter",Ja.fromValues(0,0)),(0,K.Z)(this,"started",!1),(0,K.Z)(this,"dash",!1),(0,K.Z)(this,"totalDistance",0),(0,K.Z)(this,"currentIndex",0),this.join=e.join||"miter",this.cap=e.cap||"butt",this.miterLimit=e.miterLimit||10,this.thickness=e.thickness||1,this.dash=e.dash||!1,this.complex={positions:[],indices:[],normals:[],startIndex:0,indexes:[]}}simpleExtrude(e){const r=this.complex;if(e.length<=1)return r;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;const n=e.length;let a=r.startIndex;for(let u=1;u<n;u++){const y=e[u-1],A=e[u],O=u<e.length-1?e[u+1]:null,Z=this.simpleSegment(r,a,y,A,O);a+=Z}if(this.dash)for(let u=0;u<r.positions.length/6;u++)r.positions[u*6+5]=this.totalDistance;return r.startIndex=r.positions.length/6,r}simpleExtrude_gaode2(e,r){const n=this.complex;if(e.length<=1)return n;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;const a=e.length;let u=n.startIndex;for(let Z=1;Z<a;Z++){var y,A,O;const Y=e[Z-1];Y.push((y=r[Z-1][2])!==null&&y!==void 0?y:0);const Q=r[Z-1],ae=e[Z];ae.push((A=r[Z][2])!==null&&A!==void 0?A:0);const xe=r[Z],Be=Z<e.length-1?[...e[Z+1],(O=r[Z+1][2])!==null&&O!==void 0?O:0]:null,it=Z<r.length-1?r[Z+1]:null,gt=this.simpleSegment(n,u,Y,ae,Be,Q,xe,it);u+=gt}if(this.dash)for(let Z=0;Z<n.positions.length/6;Z++)n.positions[Z*6+5]=this.totalDistance;return n.startIndex=n.positions.length/6,n}extrude_gaode2(e,r){const n=this.complex;if(e.length<=1)return n;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;const a=e.length;let u=n.startIndex;for(let Z=1;Z<a;Z++){var y,A,O;const Y=e[Z-1];Y.push((y=r[Z-1][2])!==null&&y!==void 0?y:0);const Q=r[Z-1],ae=e[Z];ae.push((A=r[Z][2])!==null&&A!==void 0?A:0);const xe=r[Z],Be=Z<e.length-1?[...e[Z+1],(O=r[Z+1][2])!==null&&O!==void 0?O:0]:null,it=Z<r.length-1?r[Z+1]:null,gt=this.segment_gaode2(n,u,Y,ae,Be,Q,xe,it);u+=gt}if(this.dash)for(let Z=0;Z<n.positions.length/6;Z++)n.positions[Z*6+5]=this.totalDistance;return n.startIndex=n.positions.length/6,n}extrude(e){const r=this.complex;if(e.length<=1)return r;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;const n=e.length;let a=r.startIndex;for(let u=1;u<n;u++){const y=e[u-1],A=e[u],O=u<e.length-1?e[u+1]:null,Z=this.segment(r,a,y,A,O);a+=Z}if(this.dash)for(let u=0;u<r.positions.length/6;u++)r.positions[u*6+5]=this.totalDistance;return r.startIndex=r.positions.length/6,r}simpleSegment(e,r,n,a,u){let y=0;const A=e.indices,O=e.positions,Z=e.normals,Y=vl([a[0],a[1]]),Q=vl([n[0],n[1]]);O0(ff,Y,Q);let ae=0;if(this.dash&&(ae=this.lineSegmentDistance(Y,Q),this.totalDistance+=ae),this.normal||(this.normal=Ja.create(),Bg(this.normal,ff)),this.started||(this.started=!0,this.extrusions(O,Z,n,this.normal,this.thickness,this.totalDistance-ae)),A.push(r+0,r+1,r+2),!u)Bg(this.normal,ff),this.extrusions(O,Z,a,this.normal,this.thickness,this.totalDistance),A.push(...this.lastFlip===1?[r,r+2,r+3]:[r+2,r+1,r+3]),y+=2;else{const xe=vl([u[0],u[1]]);u2(Y,xe)&&Ja.add(xe,Y,Ja.normalize(xe,Ja.subtract(xe,Y,Q))),O0(Og,xe,Y);const[Be,it]=l2(D0,Ja.create(),ff,Og,this.thickness);let gt=Ja.dot(D0,this.normal)<0?-1:1;this.extrusions(O,Z,a,it,Be,this.totalDistance),A.push(...this.lastFlip===1?[r,r+2,r+3]:[r+2,r+1,r+3]),gt=-1,Ja.copy(this.normal,it),y+=2,this.lastFlip=gt}return y}segment_gaode2(e,r,n,a,u,y,A,O){let Z=0;const Y=e.indices,Q=e.positions,ae=e.normals,xe=this.cap==="square",Be=this.join==="bevel",it=vl([A[0],A[1]]),gt=vl([y[0],y[1]]);O0(ff,a,n);let Bt=0;if(this.dash&&(Bt=this.lineSegmentDistance(it,gt),this.totalDistance+=Bt),this.normal||(this.normal=Ja.create(),Bg(this.normal,ff)),!this.started)if(this.started=!0,xe){const Rt=Ja.create(),Yt=Ja.create();Ja.add(Rt,this.normal,ff),Ja.add(Yt,this.normal,ff),ae.push(Yt[0],Yt[1],0),ae.push(Rt[0],Rt[1],0),Q.push(n[0],n[1],n[2]|0,this.totalDistance-Bt,-this.thickness,n[2]|0),this.complex.indexes.push(this.currentIndex),Q.push(n[0],n[1],n[2]|0,this.totalDistance-Bt,this.thickness,n[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(Q,ae,n,this.normal,this.thickness,this.totalDistance-Bt);if(Y.push(r+0,r+1,r+2),u){u2(a,u)&&Ja.add(u,a,Ja.normalize(u,Ja.subtract(u,a,n))),O0(Og,u,a);const[Rt,Yt]=l2(D0,Ja.create(),ff,Og,this.thickness);let vr=Ja.dot(D0,this.normal)<0?-1:1,ln=Be;!ln&&this.join==="miter"&&Rt>this.miterLimit&&(ln=!0),ln?(ae.push(this.normal[0],this.normal[1],0),ae.push(Yt[0],Yt[1],0),Q.push(a[0],a[1],a[2]|0,this.totalDistance,-this.thickness*vr,a[2]|0),this.complex.indexes.push(this.currentIndex),Q.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness*vr,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,Y.push(...this.lastFlip!==-vr?[r,r+2,r+3]:[r+2,r+1,r+3]),Y.push(r+2,r+3,r+4),Bg(i1,Og),Ja.copy(this.normal,i1),ae.push(this.normal[0],this.normal[1],0),Q.push(a[0],a[1],a[2]|0,this.totalDistance,-this.thickness*vr,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,Z+=3):(this.extrusions(Q,ae,a,Yt,Rt,this.totalDistance),Y.push(...this.lastFlip===1?[r,r+2,r+3]:[r+2,r+1,r+3]),vr=-1,Ja.copy(this.normal,Yt),Z+=2),this.lastFlip=vr}else{if(Bg(this.normal,ff),xe){const Rt=Ja.create(),Yt=Ja.create();Ja.sub(Yt,ff,this.normal),Ja.add(Rt,ff,this.normal),ae.push(Yt[0],Yt[1],0),ae.push(Rt[0],Rt[1],0),Q.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness,a[2]|0),this.complex.indexes.push(this.currentIndex),Q.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(Q,ae,a,this.normal,this.thickness,this.totalDistance);Y.push(...this.lastFlip===1?[r,r+2,r+3]:[r+2,r+1,r+3]),Z+=2}return Z}segment(e,r,n,a,u){let y=0;const A=e.indices,O=e.positions,Z=e.normals,Y=this.cap==="square",Q=this.join==="bevel",ae=vl([a[0],a[1]]),xe=vl([n[0],n[1]]);O0(ff,ae,xe);let Be=0;if(this.dash&&(Be=this.lineSegmentDistance(ae,xe),this.totalDistance+=Be),this.normal||(this.normal=Ja.create(),Bg(this.normal,ff)),!this.started)if(this.started=!0,Y){const it=Ja.create(),gt=Ja.create();Ja.add(it,this.normal,ff),Ja.add(gt,this.normal,ff),Z.push(gt[0],gt[1],0),Z.push(it[0],it[1],0),O.push(n[0],n[1],n[2]|0,this.totalDistance-Be,-this.thickness,n[2]|0),this.complex.indexes.push(this.currentIndex),O.push(n[0],n[1],n[2]|0,this.totalDistance-Be,this.thickness,n[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(O,Z,n,this.normal,this.thickness,this.totalDistance-Be);if(A.push(r+0,r+1,r+2),u){const it=vl([u[0],u[1]]);u2(ae,it)&&Ja.add(it,ae,Ja.normalize(it,Ja.subtract(it,ae,xe))),O0(Og,it,ae);const[gt,Bt]=l2(D0,Ja.create(),ff,Og,this.thickness);let Rt=Ja.dot(D0,this.normal)<0?-1:1,Yt=Q;!Yt&&this.join==="miter"&&gt>this.miterLimit&&(Yt=!0),Yt?(Z.push(this.normal[0],this.normal[1],0),Z.push(Bt[0],Bt[1],0),O.push(a[0],a[1],a[2]|0,this.totalDistance,-this.thickness*Rt,a[2]|0),this.complex.indexes.push(this.currentIndex),O.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness*Rt,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,A.push(...this.lastFlip!==-Rt?[r,r+2,r+3]:[r+2,r+1,r+3]),A.push(r+2,r+3,r+4),Bg(i1,Og),Ja.copy(this.normal,i1),Z.push(this.normal[0],this.normal[1],0),O.push(a[0],a[1],a[2]|0,this.totalDistance,-this.thickness*Rt,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,y+=3):(this.extrusions(O,Z,a,Bt,gt,this.totalDistance),A.push(...this.lastFlip===1?[r,r+2,r+3]:[r+2,r+1,r+3]),Rt=-1,Ja.copy(this.normal,Bt),y+=2),this.lastFlip=Rt}else{if(Bg(this.normal,ff),Y){const it=Ja.create(),gt=Ja.create();Ja.sub(gt,ff,this.normal),Ja.add(it,ff,this.normal),Z.push(gt[0],gt[1],0),Z.push(it[0],it[1],0),O.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness,a[2]|0),this.complex.indexes.push(this.currentIndex),O.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(O,Z,a,this.normal,this.thickness,this.totalDistance);A.push(...this.lastFlip===1?[r,r+2,r+3]:[r+2,r+1,r+3]),y+=2}return y}extrusions(e,r,n,a,u,y){r.push(a[0],a[1],0),r.push(a[0],a[1],0),e.push(n[0],n[1],n[2]|0,y,-u,n[2]|0),this.complex.indexes.push(this.currentIndex),e.push(n[0],n[1],n[2]|0,y,u,n[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}lineSegmentDistance(e,r){const n=r[0]-e[0],a=r[1]-e[1];return Math.sqrt(n*n+a*a)}}function sC(t){const e=t[0][0],r=t[0][t[0].length-1];e[0]===r[0]&&e[1]===r[1]&&(t[0]=t[0].slice(0,t[0].length-1));const n=t[0].length,a=Rm().flatten(t),{vertices:u,dimensions:y}=a,A=[],O=[];for(let Y=0;Y<u.length/y;Y++)y===2?A.push(u[Y*2],u[Y*2+1],1):A.push(u[Y*3],u[Y*3+1],1);const Z=Rm()(a.vertices,a.holes,a.dimensions);O.push(...Z);for(let Y=0;Y<n;Y++){const Q=a.vertices.slice(Y*y,(Y+1)*y);let ae=a.vertices.slice((Y+1)*y,(Y+2)*y);ae.length===0&&(ae=a.vertices.slice(0,y));const xe=A.length/3;A.push(Q[0],Q[1],1,ae[0],ae[1],1,Q[0],Q[1],0,ae[0],ae[1],0),O.push(...[0,2,1,2,3,1].map(Be=>Be+xe))}return{positions:A,index:O}}function lC(t){const e=Rm().flatten(t),r=Rm()(e.vertices,e.holes,e.dimensions);return{positions:e.vertices,index:r}}function mw(t,e=!1){const r=t[0][0],n=t[0][t[0].length-1];r[0]===n[0]&&r[1]===n[1]&&(t[0]=t[0].slice(0,t[0].length-1));const a=t[0].length,u=Rm().flatten(t),{vertices:y,dimensions:A}=u,O=[],Z=[],Y=[];for(let ae=0;ae<y.length/A;ae++)O.push(y[ae*A],y[ae*A+1],1,-1,-1),Y.push(0,0,1);const Q=Rm()(u.vertices,u.holes,u.dimensions);Z.push(...Q);for(let ae=0;ae<a;ae++){const xe=u.vertices.slice(ae*A,(ae+1)*A);let Be=u.vertices.slice((ae+1)*A,(ae+2)*A);Be.length===0&&(Be=u.vertices.slice(0,A));const it=O.length/5;O.push(xe[0],xe[1],1,0,0,Be[0],Be[1],1,.1,0,xe[0],xe[1],0,0,.8,Be[0],Be[1],0,.1,.8);const gt=uC([Be[0],Be[1],1],[xe[0],xe[1],0],[xe[0],xe[1],1],e);Y.push(...gt,...gt,...gt,...gt),Z.push(...[1,2,0,3,2,1].map(Bt=>Bt+it))}return{positions:O,index:Z,normals:Y}}function uC(t,e,r,n=!1){const a=ra.create(),u=ra.create(),y=ra.create();n&&(t=Qh(t),e=Qh(e),r=Qh(r));const A=ra.fromValues(...t),O=ra.fromValues(...e),Z=ra.fromValues(...r);ra.sub(a,Z,O),ra.sub(u,A,O),ra.cross(y,a,u);const Y=ra.create();return ra.normalize(Y,y),Y}let l_=function(t){return t.CYLINDER="cylinder",t.SQUARECOLUMN="squareColumn",t.TRIANGLECOLUMN="triangleColumn",t.HEXAGONCOLUMN="hexagonColumn",t.PENTAGONCOLUMN="pentagonColumn",t}({}),u_=function(t){return t.CIRCLE="circle",t.SQUARE="square",t.TRIANGLE="triangle",t.HEXAGON="hexagon",t.PENTAGON="pentagon",t}({});function c_(t,e=0){const r=Math.PI*2/t,n=[];for(let u=0;u<t;u++)n.push(r*u+e*Math.PI/12);return n.map(u=>{const y=Math.sin(u+Math.PI/4),A=Math.cos(u+Math.PI/4);return[y,A,0]})}function c2(){return c_(30)}function gw(){return c_(4)}function vw(){return c_(3)}function _w(){return c_(6,1)}function yw(){return c_(5)}const B0={[u_.CIRCLE]:c2,[u_.HEXAGON]:_w,[u_.TRIANGLE]:vw,[u_.SQUARE]:gw,[u_.PENTAGON]:yw,[l_.CYLINDER]:c2,[l_.HEXAGONCOLUMN]:_w,[l_.TRIANGLECOLUMN]:vw,[l_.SQUARECOLUMN]:gw,[l_.PENTAGONCOLUMN]:yw},o1={};function r0(t){const e=Pc(t.coordinates);return{vertices:[...e,...e,...e,...e],indices:[0,1,2,2,3,0],size:e.length}}function xw(t){const e=Pc(t.coordinates),r=fw(e);return{vertices:[...r,...r,...r,...r],indices:[0,1,2,2,3,0],size:r.length}}function h2(t){const{shape:e}=t,{positions:r,index:n,normals:a}=gC(e,!1);return{vertices:r,indices:n,normals:a,size:5}}function cC(t){const e=Pc(t.coordinates);return{vertices:[...e],indices:[0],size:e.length}}function p2(t){const{coordinates:e,originCoordinates:r,version:n}=t,a=new aC({dash:!0,join:"bevel"});if(n==="GAODE2.x"){let y=e;Array.isArray(y[0][0])||(y=[e]);let A=r;Array.isArray(A[0][0])||(A=[r]);for(let O=0;O<y.length;O++){const Z=y[O],Y=A[O];a.extrude_gaode2(Z,Y)}}else{let y=e;y[0]&&!Array.isArray(y[0][0])&&(y=[e]),y.forEach(A=>{a.extrude(A)})}const u=a.complex;return{vertices:u.positions,indices:u.indices,normals:u.normals,indexes:u.indexes,size:6}}function wO(t){const e=t.coordinates.flat(),r=1,n=1;return{vertices:[1,0,0,...e,1,2,-3,...e,1,1,-3,...e,0,1,0,...e,0,0,0,...e,1,0,0,...e,1,2,-3,...e,1,1,-3,...e,0,1,0,...e,0,0,0,...e],normals:[-r,2*n,1,2*n,-n,1,n,-n,1,n,-n,1,-r,-n,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],indices:[0,1,2,0,2,3,0,3,4,5,6,7,5,7,8,5,8,9],size:7}}function hC(t){const{coordinates:e,originCoordinates:r}=t,n=[];if(!Array.isArray(e[0]))return{vertices:[],indices:[],normals:[],size:6,count:0};const{results:a,totalDistance:u}=pC(e,r);return a.map(y=>{n.push(y[0],y[1],y[2],y[3],0,u)}),{vertices:n,indices:[],normals:[],size:6,count:a.length}}function SO(t){const{coordinates:e}=t,r=[];if(!Array.isArray(e[0]))return{vertices:[],indices:[],size:4,count:0};const{results:n}=fC(e);return n.map(a=>{r.push(a[0],a[1],a[2],a[3])}),{vertices:r,indices:[],size:4,count:n.length}}function bw(t,e){const r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)}function F0(t,e){return t.length<3&&t.push(0),e!==void 0&&t.push(e),t}function pC(t,e){let r=t,n=e||t;Array.isArray(r)&&Array.isArray(r[0])&&Array.isArray(r[0][0])&&(r=e.flat(),n=e.flat());let a=0;if(r.length<2)return{results:r,totalDistance:0};{const u=[],y=F0(r[0],a);u.push(y);for(let O=1;O<r.length-1;O++){const Z=bw(vl(n[O-1]),vl(n[O]));a+=Z;const Y=F0(r[O],a);u.push(Y),u.push(Y)}const A=bw(vl(n[n.length-2]),vl(n[n.length-1]));return a+=A,u.push(F0(r[r.length-1],a)),{results:u,totalDistance:a}}}function fC(t){if(t.length<2)return{results:t};{const e=[],r=F0(t[0]);e.push(r);for(let n=1;n<t.length-1;n++){const a=F0(t[n]);e.push(a),e.push(a)}return e.push(F0(t[t.length-1])),{results:e}}}function a1(t){const{coordinates:e}=t,r=Rm().flatten(e),{vertices:n,dimensions:a,holes:u}=r;return{indices:Rm()(n,u,a),vertices:n,size:a}}function dC(t){const{coordinates:e}=t,r=Rm().flatten(e),{vertices:n,dimensions:a,holes:u}=r;return{indices:Rm()(n,u,a),vertices:mC(n),size:a+4}}function mC(t){const e=[],{center:r,radius:n}=Xl(t);for(let a=0;a<t.length;a+=2){const u=t[a],y=t[a+1];e.push(u,y,0,...r,n)}return e}function f2(t){const e=t.coordinates,{positions:r,index:n,normals:a}=mw(e,!0);return{vertices:r,indices:n,normals:a,size:5}}function Ew(t){const{shape:e}=t,{positions:r,index:n}=_C(e);return{vertices:r,indices:n,size:3}}function h_(t){const e=t.coordinates;return{vertices:[...e[0],0,0,0,...e[1],0,1,0,...e[2],0,1,1,...e[3],0,0,1],indices:[0,1,2,0,2,3],size:5}}function d2(t,e){const{segmentNumber:r=30}=e,n=t.coordinates,a=[],u=[];for(let y=0;y<r;y++)a.push(y,1,y,n[0][0],n[0][1],n[1][0],n[1][1],y,-1,y,n[0][0],n[0][1],n[1][0],n[1][1]),y!==r-1&&u.push(...[0,1,2,1,3,2].map(A=>y*2+A));return{vertices:a,indices:u,size:7}}function ww(t){const e=t.coordinates;e.length===2&&e.push(0);const r=s1(-1,1),n=s1(1,1),a=s1(-1,-1),u=s1(1,-1);return{vertices:[...e,...r,...e,...a,...e,...u,...e,...n],indices:[0,1,2,3,0,2],size:5}}function gC(t,e=!1){if(o1&&o1[t])return o1[t];const r=B0[t]?B0[t]():B0.cylinder(),n=mw([r],e);return o1[t]=n,n}function TO(t,e,r=3,n=!1){const a=new Float32Array(t.length/r*3);let u,y,A;const O=vec3.create(),Z=vec3.create(),Y=vec3.create();for(let Q=0,ae=e.length;Q<ae;Q+=3){u=e[Q+0]*3,y=e[Q+1]*3,A=e[Q+2]*3;let xe=[t[u],t[u+1]],Be=[t[y],t[y+1]],it=[t[A],t[A+1]];n&&(xe=lngLatToMeters(xe),Be=lngLatToMeters(Be),it=lngLatToMeters(it));const[gt,Bt]=xe,Rt=vec3.fromValues(gt,Bt,t[u+2]),[Yt,vr]=Be,ln=vec3.fromValues(Yt,vr,t[y+2]),[cn,Gr]=it,Pn=vec3.fromValues(cn,Gr,t[A+2]);vec3.sub(O,Pn,ln),vec3.sub(Z,Rt,ln),vec3.cross(Y,O,Z),a[u]+=O[0],a[u+1]+=O[1],a[u+2]+=O[2],a[y]+=O[0],a[y+1]+=O[1],a[y+2]+=O[2],a[A]+=O[0],a[A+1]+=O[1],a[A+2]+=O[2]}return vC(a),a}function vC(t){for(let e=0,r=t.length;e<r;e+=3){const n=vec3.fromValues(t[e],t[e+1],t[e+2]),a=vec3.create();vec3.normalize(a,n),t.set(a,e)}}function AO(t){const e=t[0][0],r=t[0][t[0].length-1];return e[0]===r[0]&&e[1]===r[1]}function _C(t){const e=["cylinder","triangleColumn","hexagonColumn","squareColumn"],r=B0[t]?B0[t]():B0.circle();return e.indexOf(t)===-1?lC([r]):sC([r])}function s1(t,e){const r=(t+1)/2,n=(e+1)/2;return[r,n]}function Sw(){const t=dw(n1,{segments:hw}),{positionsArr:e,indicesArr:r,normalArr:n}=t;return{vertices:e,indices:r,size:5,normals:n}}function yC(){const t=dw(n1+oC,{segments:hw}),{positionsArr:e,indicesArr:r,normalArr:n}=t;return{vertices:e,indices:r,size:5,normals:n}}const xC=`precision highp float;
layout(std140) uniform commonUniforms {
vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];
vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];
vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];
vec4 u_circleSweepColor;
vec2 u_cityCenter;
float u_circleSweep;
float u_cityMinSize;
float u_circleSweepSpeed;
float u_opacity: 1.0;
float u_near : 0;
float u_far : 1;
float u_time;
};
in vec4 v_Color;
in vec2 v_texCoord;
in float v_worldDis;
out vec4 outputColor;
#pragma include "picking"
#pragma include "scene_uniforms"
vec3 getWindowColor(float n, float hot, vec3 brightColor, vec3 darkColor) {
float s = step(hot, n);
vec3 color = mix(brightColor,vec3(0.9,0.9,1.0),n);
return mix(darkColor, color, s);
}
float random (vec2 st) {
return fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123);
}
float LinearizeDepth()
{
float z = gl_FragCoord.z * 2.0 - 1.0;
return (2.0 * u_near * u_far) / (u_far + u_near - z * (u_far - u_near));
}
vec3 fog(vec3 color, vec3 fogColor, float depth){
float fogFactor=clamp(depth,0.0,1.0);
vec3 output_color=mix(fogColor,color,fogFactor);
return output_color;
}
float sdRect(vec2 p, vec2 sz) {
vec2 d = abs(p) - sz;
float outside = length(max(d, 0.));
float inside = min(max(d.x, d.y), 0.);
return outside + inside;
}
void main() {
outputColor = v_Color;
vec3 baseColor = u_baseColor.xyz;
vec3 brightColor = u_brightColor.xyz;
vec3 windowColor = u_windowColor.xyz;
float targetColId = 5.;
float depth = 1.0 - LinearizeDepth() / u_far * u_Zoom;
vec3 fogColor = vec3(23.0/255.0,31.0/255.0,51.0/255.0);
if(v_texCoord.x < 0.) { //\u9876\u90E8\u989C\u8272
vec3 foggedColor = fog(baseColor.xyz + vec3(0.12*0.9,0.2*0.9,0.3*0.9),fogColor,depth);
outputColor = vec4( foggedColor, v_Color.w);
}else { // \u4FA7\u9762\u989C\u8272
vec2 st = v_texCoord;
vec2 UvScale = v_texCoord;
float tStep = min(0.08,max(0.05* (18.0-u_Zoom),0.02));
float tStart = 0.25 * tStep;
float tEnd = 0.75 * tStep;
float u = mod(UvScale.x, tStep);
float v = mod(UvScale.y, tStep);
float ux = floor(UvScale.x/tStep);
float uy = floor(UvScale.y/tStep);
float n = random(vec2(ux,uy));
float lightP = u_time;
float head = 1.0- step(0.005,st.y);
/*step3*/
// \u5C06\u7A97\u6237\u989C\u8272\u548C\u5899\u9762\u989C\u8272\u533A\u522B\u5F00\u6765
float sU = step(tStart, u) - step(tEnd, u);
float sV = step(tStart, v) - step(tEnd, v);
vec2 windowSize = vec2(abs(tEnd-tStart),abs(tEnd-tStart));
float dist = sdRect(vec2(u,v), windowSize);
float s = sU * sV;
float curColId = floor(UvScale.x / tStep);
float sCol = step(targetColId - 0.2, curColId) - step(targetColId + 0.2, curColId);
float mLightP = mod(lightP, 2.);
float sRow = step(mLightP - 0.2, st.y) - step(mLightP, st.y);
if(ux == targetColId){
n =0.;
}
float timeP = min(0.75, abs ( sin(u_time/3.0) ) );
float hot = smoothstep(1.0,0.0,timeP);
vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), s);
//vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), 1.0);
float sFinal = s * sCol * sRow;
color += mix(baseColor, brightColor, sFinal*n);
if (st.y<0.01){
color = baseColor;
}
if(head ==1.0) { // \u9876\u90E8\u4EAE\u7EBF
color = brightColor;
}
color = color * v_Color.rgb;
vec3 foggedColor = fog(color,fogColor,depth);
outputColor = vec4(foggedColor,1.0);
}
if(u_circleSweep > 0.0 && v_worldDis < u_cityMinSize) {
float r = fract(((v_worldDis/u_cityMinSize) - u_time * u_circleSweepSpeed) * 2.0);
outputColor.rgb += r * r * u_circleSweepColor.rgb;
}
outputColor.a *= u_opacity;
outputColor = filterColor(outputColor);
}
`,bC=`precision highp float;
#define ambientRatio 0.5
#define diffuseRatio 0.3
#define specularRatio 0.2
layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(location = 13) in vec3 a_Normal;
layout(location = 14) in vec2 a_Uv;
out vec2 v_texCoord;
out vec4 v_Color;
out float v_worldDis;
layout(std140) uniform commonUniforms {
vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];
vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];
vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];
vec4 u_circleSweepColor;
vec2 u_cityCenter;
float u_circleSweep;
float u_cityMinSize;
float u_circleSweepSpeed;
float u_opacity: 1.0;
float u_near : 0;
float u_far : 1;
float u_time;
};
#pragma include "projection"
#pragma include "light"
#pragma include "picking"
void main() {
vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);
vec4 project_pos = project_position(pos);
v_texCoord = a_Uv;
if(u_circleSweep > 0.0) {
vec2 lnglatscale = vec2(0.0);
if(u_CoordinateSystem != COORDINATE_SYSTEM_P20_2) {
lnglatscale = (a_Position.xy - u_cityCenter) * vec2(0.0, 0.135);
}
v_worldDis = length(a_Position.xy + lnglatscale - u_cityCenter);
}
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));
} else {
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
}
float lightWeight = calc_lighting(pos);
// v_Color = a_Color;
v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);
setPickingColor(a_PickingColor);
}
`;class EC extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"cityCenter",void 0),(0,K.Z)(this,"cityMinSize",void 0)}getCommonUniformsInfo(){const{opacity:e=1,baseColor:r="rgb(16,16,16)",brightColor:n="rgb(255,176,38)",windowColor:a="rgb(30,60,89)",time:u=0,sweep:y={enable:!1,sweepRadius:1,sweepColor:"rgb(255, 255, 255)",sweepSpeed:.4,sweepCenter:this.cityCenter}}=this.layer.getLayerConfig(),A={u_baseColor:Va(r),u_brightColor:Va(n),u_windowColor:Va(a),u_circleSweepColor:[...Va(y.sweepColor).slice(0,3),1],u_cityCenter:y.sweepCenter||this.cityCenter,u_circleSweep:y.enable?1:0,u_cityMinSize:this.cityMinSize*y.sweepRadius,u_circleSweepSpeed:y.sweepSpeed,u_opacity:e,u_near:0,u_far:1,u_time:this.layer.getLayerAnimateTime()||u};return this.getUniformsBufferInfo(A)}calCityGeo(){const[e,r,n,a]=this.layer.getSource().extent;if(this.mapService.version==="GAODE2.x"){this.cityCenter=this.mapService.lngLatToCoord([(n+e)/2,(a+r)/2]);const u=this.mapService.lngLatToCoord([n,a]),y=this.mapService.lngLatToCoord([e,r]);this.cityMinSize=Math.sqrt(Math.pow(u[0]-y[0],2)+Math.pow(u[1]-y[1],2))/4}else{const u=n-e,y=a-r;this.cityCenter=[(n+e)/2,(a+r)/2],this.cityMinSize=Math.sqrt(Math.pow(u,2)+Math.pow(y,2))/4}}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.calCityGeo(),e.initUniformsBuffer(),e.startModelAnimate(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return[yield e.layer.buildLayerModel({moduleName:"cityBuilding",vertexShader:bC,fragmentShader:xC,triangulation:f2,depth:{enable:!0},inject:e.getInject(),cull:{enable:!0,face:Ee.BACK}})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=10}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}class wC extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","CityBuildingLayer")}buildModels(){var e=this;return(0,Nr.Z)(function*(){e.layerModel=new EC(e),yield e.initLayerModels()})()}setLight(e){this.updateLayerConfig({time:e})}getModelType(){return"citybuilding"}}const SC=`layout(std140) uniform commonUniforms {
vec2 u_size;
float u_raisingHeight;
float u_rotation;
float u_opacity;
};
uniform sampler2D u_texture;
in vec2 v_uv;
out vec4 outputColor;
#pragma include "picking"
void main() {
outputColor = texture(SAMPLER_2D(u_texture), vec2(v_uv.x, 1.0 - v_uv.y));
outputColor.a *= u_opacity;
outputColor = filterColor(outputColor);
}
`,TC=`layout(location = 0) in vec3 a_Position;
layout(location = 11) in vec3 a_Extrude;
layout(location = 14) in vec2 a_Uv;
layout(std140) uniform commonUniforms {
vec2 u_size;
float u_raisingHeight;
float u_rotation;
float u_opacity;
};
out vec2 v_uv;
#pragma include "projection"
#pragma include "picking"
#pragma include "rotation_2d"
void main() {
vec3 extrude = a_Extrude;
v_uv = a_Uv;
float raiseHeight = u_raisingHeight;
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
raiseHeight = u_raisingHeight * mapboxZoomScale;
}
// \u8BA1\u7B97\u7ECF\u7EAC\u5EA6\u70B9\u4F4D\u5750\u6807
vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));
// \u8BA1\u7B97\u7ED5 z \u8F74\u65CB\u8F6C\u540E\u7684\u504F\u79FB
vec2 offsetXY = project_pixel(rotate_matrix(vec2(extrude.x * u_size.x, 0.0),u_rotation));
// \u7ED5 z \u8F74\u65CB\u8F6C
float x = project_pos.x + offsetXY.x;
float y = project_pos.y + offsetXY.y;
// z \u8F74\u4E0D\u53C2\u4E0E\u65CB\u8F6C
float z = project_pixel(extrude.y * u_size.y + raiseHeight);
gl_Position = project_common_position_to_clipspace_v2(vec4(x , y, z , 1.0));
setPickingColor(a_PickingColor);
}
`;class AC extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"radian",0),(0,K.Z)(this,"planeGeometryTriangulation",()=>{const{center:r=[120,30]}=this.layer.getLayerConfig();return{size:4,indices:[0,1,2,2,3,0],vertices:[...r,1,1,...r,0,1,...r,0,0,...r,1,0]}})}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{opacity:e,width:r=1,height:n=1,raisingHeight:a=0}=this.layer.getLayerConfig();let u=1;(this.mapService.version==="GAODE2.x"||this.mapService.version==="GAODE1.x")&&(u=-1),this.radian=u*Math.PI*(this.mapService.getRotation()%360)/180;const y={u_size:[r,n],u_raisingHeight:Number(a),u_rotation:this.radian,u_opacity:e||1,u_texture:this.texture};return this.textures=[this.texture],this.getUniformsBufferInfo(y)}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy()}initModels(){var e=this;return(0,Nr.Z)(function*(){const{drawCanvas:r}=e.layer.getLayerConfig(),{createTexture2D:n}=e.rendererService;return e.texture=n({height:0,width:0}),r&&e.updateTexture(r),e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"geometryBillboard",vertexShader:TC,fragmentShader:SC,triangulation:e.planeGeometryTriangulation,inject:e.getInject(),primitive:Ee.TRIANGLES,depth:{enable:!0}})]})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initModels()})()}updateTexture(e){const{createTexture2D:r}=this.rendererService,{canvasWidth:n=1,canvasHeight:a=1}=this.layer.getLayerConfig(),u=document.createElement("canvas");u.width=n,u.height=a,u.getContext("2d")&&(e(u),this.texture=r({data:u,width:u.width,height:u.height,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE}),this.layerService.reRender())}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Vr.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Ro.EXTRUDE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a)=>{const u=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],y=a%4*3;return[u[y],u[y+1],u[y+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[2],n[3]]}})}}const CC=`
uniform sampler2D u_texture;
layout(std140) uniform commonUniforms {
float u_opacity;
float u_mapFlag;
float u_terrainClipHeight;
};
in vec3 v_Color;
in vec2 v_uv;
in float v_clip;
out vec4 outputColor;
#pragma include "picking"
void main() {
// gl_FragColor = vec4(v_Color, u_opacity);
if(u_mapFlag > 0.0) {
outputColor = texture(SAMPLER_2D(u_texture), vec2(v_uv.x, 1.0 - v_uv.y));
outputColor.a *= u_opacity;
} else {
// gl_FragColor = vec4(v_uv, 0.0, u_opacity);
outputColor = vec4(v_Color, u_opacity);
}
outputColor.a *= v_clip;
outputColor = filterColor(outputColor);
}
`,MC=`
layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec3 a_Color;
layout(location = 14) in vec2 a_Uv;
layout(std140) uniform commonUniforms {
float u_opacity;
float u_mapFlag;
float u_terrainClipHeight;
};
out vec3 v_Color;
out vec2 v_uv;
out float v_clip;
#pragma include "projection"
#pragma include "picking"
void main() {
v_Color = a_Color;
v_uv = a_Uv;
vec4 project_pos = project_position(vec4(a_Position, 1.0));
v_clip = 1.0;
if(a_Position.z < u_terrainClipHeight) {
v_clip = 0.0;
}
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy, a_Position.z, 1.0));
setPickingColor(a_PickingColor);
}
`;class PC extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"terrainImage",void 0),(0,K.Z)(this,"terrainImageLoaded",!1),(0,K.Z)(this,"mapTexture",void 0),(0,K.Z)(this,"planeGeometryTriangulation",()=>{const{width:r=1,height:n=1,widthSegments:a=1,heightSegments:u=1,center:y=[120,30],terrainTexture:A}=this.layer.getLayerConfig(),{indices:O,positions:Z}=this.initPlane(r,n,a,u,...y);return A&&this.loadTerrainTexture(Z,O),{vertices:Z,indices:O,size:5}})}initPlane(e=1,r=1,n=1,a=1,u=120,y=30){const A=e/2,O=r/2,Z=Math.floor(n),Y=Math.floor(a),Q=Z+1,ae=Y+1,xe=e/Z,Be=r/Y,it=[],gt=[];for(let Bt=0;Bt<ae;Bt++){const Rt=Bt*Be-O;for(let Yt=0;Yt<Q;Yt++){const vr=Yt*xe-A;if(this.mapService.version==="GAODE2.x"){const[ln,cn]=this.mapService.lngLatToCoord([vr+u,-Rt+y]);gt.push(ln,cn,0)}else gt.push(vr+u,-Rt+y,0);gt.push(Yt/Z),gt.push(1-Bt/Y)}}for(let Bt=0;Bt<Y;Bt++)for(let Rt=0;Rt<Z;Rt++){const Yt=Rt+Q*Bt,vr=Rt+Q*(Bt+1),ln=Rt+1+Q*(Bt+1),cn=Rt+1+Q*Bt;it.push(Yt,vr,cn),it.push(vr,ln,cn)}return{indices:it,positions:gt}}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{opacity:e,mapTexture:r,terrainClipHeight:n=0,terrainTexture:a}=this.layer.getLayerConfig();if(this.mapTexture!==r){var u;this.mapTexture=r,(u=this.texture)===null||u===void 0||u.destroy(),this.updateTexture(r)}const y={u_opacity:e||1,u_mapFlag:r?1:0,u_terrainClipHeight:a?n:-1,u_texture:this.texture};return this.textures=[this.texture],this.getUniformsBufferInfo(y)}clearModels(){var e;this.terrainImage=null,(e=this.texture)===null||e===void 0||e.destroy(),this.textures=[]}initModels(){var e=this;return(0,Nr.Z)(function*(){const{mapTexture:r}=e.layer.getLayerConfig();e.mapTexture=r;const{createTexture2D:n}=e.rendererService;return e.texture=n({height:0,width:0}),e.updateTexture(r),e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"geometryPlane",vertexShader:MC,fragmentShader:CC,triangulation:e.planeGeometryTriangulation,inject:e.getInject(),primitive:Ee.TRIANGLES,depth:{enable:!0},cull:{enable:!0,face:Ee.BACK}})]})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initModels()})()}createModelData(e){if(e){const{widthSegments:a,heightSegments:u,width:y,height:A}=this.layer.getLayerConfig(),{widthSegments:O,heightSegments:Z,width:Y,height:Q}=e;this.layer.style({widthSegments:O!==void 0?O:a,heightSegments:Z!==void 0?Z:u,width:Y!==void 0?Y:y,height:Q!==void 0?Q:A})}const r=this.layer.getEncodedData();return this.styleAttributeService.createAttributesAndIndices(r,this.planeGeometryTriangulation)}updateTexture(e){const{createTexture2D:r}=this.rendererService;if(e){const n=new Image;n.crossOrigin="anonymous",n.onload=()=>{this.texture=r({data:n,width:n.width,height:n.height,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE}),this.layerService.reRender()},n.src=e}else this.texture=r({width:0,height:0})}getImageData(e){const r=document.createElement("canvas"),n=r.getContext("2d"),{width:a,height:u}=e;return r.width=a,r.height=u,n.drawImage(e,0,0,a,u),n.getImageData(0,0,a,u)}translateVertex(e,r,n,a,u,y){const A=n.width,O=n.height,Z=this.getImageData(n).data,Y=Math.floor(a),Q=Math.floor(u),ae=Y+1,xe=Q+1,Be=A/Y,it=O/Q;for(let Rt=0;Rt<xe;Rt++){const vr=Math.floor(Rt*it)*A;for(let ln=0;ln<ae;ln++){const cn=Math.floor(ln*Be),Gr=(vr+cn)*4,Pn=Z[Gr],Oo=Z[Gr+1],Da=Z[Gr+2],Bo=(Rt*ae+ln)*5+2;e[Bo]=y(Pn,Oo,Da)}}const gt=this.layer.getEncodedData(),Bt=this.styleAttributeService.createAttributesAndIndices(gt,()=>({vertices:e,indices:r,size:5}));this.layer.updateModelData(Bt),this.layerService.throttleRenderLayers()}loadTerrainTexture(e,r){const{widthSegments:n=1,heightSegments:a=1,terrainTexture:u,rgb2height:y=(A,O,Z)=>A+O+Z}=this.layer.getLayerConfig();if(this.terrainImage)this.terrainImageLoaded?this.translateVertex(e,r,this.terrainImage,n,a,y):this.terrainImage.onload=()=>{this.translateVertex(e,r,this.terrainImage,n,a,y)};else{const A=new Image;this.terrainImage=A,A.crossOrigin="anonymous",A.onload=()=>{this.terrainImageLoaded=!0,setTimeout(()=>this.layer.emit("terrainImageLoaded",null)),this.translateVertex(e,r,A,n,a,y)},A.src=u}}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}const RC=`
layout(std140) uniform commonUniforms {
float u_opacity;
float u_mapFlag;
float u_Scale;
};
uniform sampler2D u_texture;
in vec3 v_Color;
in float v_d;
out vec4 outputColor;
void main() {
if(v_d < 0.0) {
discard;
}
if(u_mapFlag > 0.0) {
outputColor = texture(SAMPLER_2D(u_texture), gl_PointCoord);
outputColor.a *= u_opacity;
} else {
outputColor = vec4(v_Color, u_opacity);
}
}
`,IC=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec3 a_Color;
layout(std140) uniform commonUniforms {
float u_opacity;
float u_mapFlag;
float u_Scale;
};
out vec3 v_Color;
out float v_d;
#pragma include "projection"
void main() {
v_Color = a_Color.xyz;
vec4 project_pos = project_position(vec4(a_Position, 1.0));
v_d = a_Position.z;
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy, a_Position.z, 1.0));
gl_PointSize = pow((u_Zoom - 1.0), 2.0) * u_Scale;
}
`;var k0=function(t){return t.UP="up",t.DOWN="down",t}(k0||{});class LC extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"mapTexture",void 0),(0,K.Z)(this,"positions",void 0),(0,K.Z)(this,"indices",void 0),(0,K.Z)(this,"timer",void 0),(0,K.Z)(this,"spriteTop",void 0),(0,K.Z)(this,"spriteUpdate",void 0),(0,K.Z)(this,"spriteAnimate",void 0),(0,K.Z)(this,"planeGeometryUpdateTriangulation",()=>{const{spriteBottom:r=-1e5}=this.layer.getLayerConfig(),n=this.spriteUpdate,a=r,u=this.spriteTop;for(let y=0;y<this.positions.length;y+=5)this.spriteAnimate===k0.UP?(this.positions[y+2]+=n,this.positions[y+2]>u&&(this.positions[y+2]=a)):(this.positions[y+2]-=n,this.positions[y+2]<a&&(this.positions[y+2]=u));return{vertices:this.positions,indices:this.indices,size:5}}),(0,K.Z)(this,"updatePosition",()=>{var r;this.planeGeometryUpdateTriangulation();const n=(r=this.styleAttributeService.getLayerStyleAttribute("position"))===null||r===void 0?void 0:r.vertexAttribute;if(n){const a=[];for(let u=0;u<this.positions.length;u+=5)a.push(this.positions[u],this.positions[u+1],this.positions[u+2]);n.updateBuffer({data:a,offset:0})}this.layerService.throttleRenderLayers(),this.timer=requestAnimationFrame(this.updatePosition)}),(0,K.Z)(this,"planeGeometryTriangulation",()=>{const{center:r=[120,30],spriteCount:n=100,spriteRadius:a=10}=this.layer.getLayerConfig(),{indices:u,positions:y}=this.initSprite(a,n,...r);return this.positions=y,this.indices=u,{vertices:y,indices:u,size:5}})}initSprite(e=10,r=100,n=120,a=30){const u=[],y=[],A=this.mapService,O=this.spriteAnimate===k0.UP?-this.spriteTop:this.spriteTop;for(let Y=0;Y<r;Y++){const Q=Math.random()*O;y.push(...Z(Q))}for(let Y=0;Y<r;Y++)u.push(Y);function Z(Y){const Q=e*Math.random(),ae=e*Math.random(),xe=-e/2+Q,Be=-e/2+ae;if(A.version==="GAODE2.x"){const[it,gt]=A.lngLatToCoord([xe+n,-Be+a]);return[it,gt,Y,0,0]}else return[xe+n,-Be+a,Y,0,0]}return{indices:u,positions:y}}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{opacity:e,mapTexture:r,spriteScale:n=1}=this.layer.getLayerConfig();if(this.mapTexture!==r){var a;this.mapTexture=r,(a=this.texture)===null||a===void 0||a.destroy(),this.textures=[],this.updateTexture(r)}const u={u_opacity:e||1,u_mapFlag:r?1:0,u_Scale:n,u_texture:this.texture};return this.textures=[this.texture],this.getUniformsBufferInfo(u)}clearModels(){var e;cancelAnimationFrame(this.timer),(e=this.texture)===null||e===void 0||e.destroy(),this.textures=[]}initModels(){var e=this;return(0,Nr.Z)(function*(){const{mapTexture:r,spriteTop:n=5e6,spriteUpdate:a=1e4,spriteAnimate:u=k0.DOWN}=e.layer.getLayerConfig();e.initUniformsBuffer(),e.mapTexture=r,e.spriteTop=n,e.spriteUpdate=a,u==="up"?e.spriteAnimate=k0.UP:e.spriteAnimate=k0.DOWN;const{createTexture2D:y}=e.rendererService;return e.texture=y({height:0,width:0}),e.updateTexture(r),setTimeout(()=>{e.updatePosition()},100),[yield e.layer.buildLayerModel({moduleName:"geometrySprite",vertexShader:IC,fragmentShader:RC,triangulation:e.planeGeometryTriangulation,inject:e.getInject(),primitive:Ee.POINTS,depth:{enable:!1},blend:e.getBlend()})]})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initModels()})()}updateTexture(e){const{createTexture2D:r}=this.rendererService;if(e){const n=new Image;n.crossOrigin="anonymous",n.onload=()=>{this.texture=r({data:n,width:n.width,height:n.height,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE}),this.layerService.reRender()},n.src=e}else this.texture=r({width:1,height:1})}registerBuiltinAttributes(){return""}}var DC={plane:PC,sprite:LC,billboard:AC};class OC extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","GeometryLayer"),(0,K.Z)(this,"defaultSourceConfig",{data:[{x:0,y:0}],options:{parser:{type:"json",x:"x",y:"y"}}})}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new DC[r](e),yield e.initLayerModels()})()}getDefaultConfig(){const e=this.getModelType();return{plane:{},sprite:{},billboard:{}}[e]}getModelType(){var e;const r=this.styleAttributeService.getLayerStyleAttribute("shape"),n=r==null||(e=r.scale)===null||e===void 0?void 0:e.field;return n==="plane"?"plane":n==="sprite"?"sprite":n==="billboard"?"billboard":"plane"}}function Tw(t,e){return{type:t.type,field:"value",items:t.positions.map((r,n)=>({[e]:n>=t.colors.length?null:t.colors[n],value:r}))}}const BC=`in vec4 v_color;
#pragma include "scene_uniforms"
#pragma include "picking"
out vec4 outputColor;
void main() {
outputColor = v_color;
outputColor = filterColor(outputColor);
}
`,FC=`layout(location = 0) in vec3 a_Position;\r
layout(location = 1) in vec4 a_Color;\r
layout(location = 10) in vec3 a_Pos;\r
\r
layout(std140) uniform commonUniforms {\r
vec2 u_radius;\r
float u_opacity;\r
float u_coverage;\r
float u_angle;\r
};\r
\r
\r
out vec4 v_color;\r
\r
\r
#pragma include "projection"\r
#pragma include "project"\r
#pragma include "picking"\r
\r
void main() {\r
v_color = a_Color;\r
v_color.a *= u_opacity;\r
\r
mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\r
vec2 offset = a_Position.xy * u_radius * rotationMatrix * u_coverage ;\r
// vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r
// vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r
// gl_Position = project_common_position_to_clipspace(project_pos);\r
\r
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\r
vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r
vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator; // \u5C06\u7ECF\u7EAC\u5EA6\u8F6C\u6362\u4E3A\u9AD8\u5FB72.0\u9700\u8981\u7684\u5E73\u9762\u5750\u6807\r
vec4 project_pos = project_position(vec4(customLnglat, 0, 1.0));\r
gl_Position = u_Mvp * (project_pos);\r
} else {\r
vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r
vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r
gl_Position = project_common_position_to_clipspace(project_pos);\r
}\r
\r
setPickingColor(a_PickingColor);\r
}\r
`;class kC extends Ml{getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{opacity:e,coverage:r,angle:n}=this.layer.getLayerConfig(),a={u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset],u_opacity:e||1,u_coverage:r||.9,u_angle:n||0};return this.getUniformsBufferInfo(a)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"heatmapGrid",vertexShader:FC,fragmentShader:BC,triangulation:Ew,primitive:Ee.TRIANGLES,depth:{enable:!1}})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"pos",type:Vr.Attribute,descriptor:{shaderLocation:10,name:"a_Pos",buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:e=>{const r=e.version==="GAODE2.x"?e.originCoordinates:e.coordinates;return[r[0],r[1],0]}}})}}const NC=`in vec4 v_color;
layout(std140) uniform commonUniforms {
vec2 u_radius;
float u_opacity;
float u_coverage;
float u_angle;
};
#pragma include "scene_uniforms"
#pragma include "picking"
out vec4 outputColor;
void main() {
outputColor = v_color;
outputColor = filterColor(outputColor);
}
`,zC=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(location = 10) in vec3 a_Pos;
layout(location = 13) in vec3 a_Normal;
layout(std140) uniform commonUniforms {
vec2 u_radius;
float u_opacity;
float u_coverage;
float u_angle;
};
out vec4 v_color;
#pragma include "projection"
#pragma include "project"
#pragma include "light"
#pragma include "picking"
void main() {
mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));
vec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage));
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // \u7ECF\u7EAC\u5EA6
vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator; // \u5C06\u7ECF\u7EAC\u5EA6\u8F6C\u6362\u4E3A\u9AD8\u5FB72.0\u9700\u8981\u7684\u5E73\u9762\u5750\u6807
vec4 project_pos = project_position(vec4(customLnglat, a_Position.z * a_Size, 1.0));
float lightWeight = calc_lighting(project_pos);
v_color =vec4(a_Color.rgb*lightWeight, a_Color.w * u_opacity);
gl_Position = u_Mvp * vec4(customLnglat , a_Position.z * a_Size, 1.0);
} else {
vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // \u5B9E\u9645\u7684\u7ECF\u7EAC\u5EA6
vec4 project_pos = project_position(vec4(lnglat, a_Position.z * a_Size, 1.0));
float lightWeight = calc_lighting(project_pos);
v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);
gl_Position = project_common_position_to_clipspace(project_pos);
}
setPickingColor(a_PickingColor);
}
`;class UC extends Ml{getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{opacity:e,coverage:r,angle:n}=this.layer.getLayerConfig(),a={u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset],u_opacity:e||1,u_coverage:r||.9,u_angle:n||0};return this.getUniformsBufferInfo(a)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"heatmapGrid3d",vertexShader:zC,fragmentShader:NC,triangulation:h2,primitive:Ee.TRIANGLES,depth:{enable:!0}})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{shaderLocation:Ro.SIZE,name:"a_Size",buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"pos",type:Vr.Attribute,descriptor:{name:"a_Pos",shaderLocation:10,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:e=>{const r=e.version==="GAODE2.x"?e.originCoordinates:e.coordinates;return[r[0],r[1],0]}}})}}function ZC(t,e){const r=[],n=[],a=[],u=t+1,y=e+1,A=t/2,O=e/2;for(let Z=0;Z<y;Z++){const Y=Z-O;for(let Q=0;Q<u;Q++){const ae=Q-A;n.push(ae/A,-Y/O,0),a.push(Q/t),a.push(1-Z/e)}}for(let Z=0;Z<e;Z++)for(let Y=0;Y<t;Y++){const Q=Y+u*Z,ae=Y+u*(Z+1),xe=Y+1+u*(Z+1),Be=Y+1+u*Z;r.push(Q,ae,Be),r.push(ae,xe,Be)}return{vertices:n,indices:r,uvs:a}}const VC=`layout(std140) uniform commonUniforms {
mat4 u_ViewProjectionMatrixUncentered;
mat4 u_InverseViewProjectionMatrix;
float u_opacity;
float u_common_uniforms_padding1;
float u_common_uniforms_padding2;
float u_common_uniforms_padding3;
};
uniform sampler2D u_texture;
uniform sampler2D u_colorTexture;
in vec2 v_texCoord;
in float v_intensity;
out vec4 outputColor;
void main(){
float intensity = texture(SAMPLER_2D(u_texture), v_texCoord).r;
vec4 color = texture(SAMPLER_2D(u_colorTexture),vec2(intensity, 0));
outputColor = color;
// gl_FragColor.a = color.a * smoothstep(0.1,0.2,intensity)* u_opacity;
outputColor.a = color.a * smoothstep(0.,0.1,intensity) * u_opacity;
}
`,jC=`layout(location = 0) in vec3 a_Position;
layout(location = 14) in vec2 a_Uv;
layout(std140) uniform commonUniforms {
mat4 u_ViewProjectionMatrixUncentered;
mat4 u_InverseViewProjectionMatrix;
float u_opacity;
float u_common_uniforms_padding1;
float u_common_uniforms_padding2;
float u_common_uniforms_padding3;
};
uniform sampler2D u_texture;
uniform sampler2D u_colorTexture;
out vec2 v_texCoord;
out float v_intensity;
vec2 toBezier(float t, vec2 P0, vec2 P1, vec2 P2, vec2 P3) {
float t2 = t * t;
float one_minus_t = 1.0 - t;
float one_minus_t2 = one_minus_t * one_minus_t;
return (P0 * one_minus_t2 * one_minus_t + P1 * 3.0 * t * one_minus_t2 + P2 * 3.0 * t2 * one_minus_t + P3 * t2 * t);
}
vec2 toBezier(float t, vec4 p){
return toBezier(t, vec2(0.0, 0.0), vec2(p.x, p.y), vec2(p.z, p.w), vec2(1.0, 1.0));
}
#pragma include "projection"
#pragma include "project"
void main() {
v_texCoord = a_Uv;
vec2 pos = a_Uv * vec2(2.0) - vec2(1.0); // \u5C06\u539F\u672C 0 -> 1 \u7684 uv \u8F6C\u6362\u4E3A -1 -> 1 \u7684\u6807\u51C6\u5750\u6807\u7A7A\u95F4\uFF08NDC\uFF09
vec4 p1 = vec4(pos, 0.0, 1.0); // x/y \u5E73\u9762\u4E0A\u7684\u70B9\uFF08z == 0\uFF09\u53EF\u4EE5\u8BA4\u4E3A\u662F\u4E09\u7EF4\u4E0A\u7684\u70B9\u88AB\u6295\u5F71\u5230\u5E73\u9762\u540E\u7684\u70B9
vec4 p2 = vec4(pos, 1.0, 1.0); // \u5E73\u884C\u4E8Ex/y\u5E73\u9762\u3001z==1 \u7684\u5E73\u9762\u4E0A\u7684\u70B9
vec4 inverseP1 = u_InverseViewProjectionMatrix * p1; // \u6839\u636E\u89C6\u56FE\u6295\u5F71\u77E9\u9635\u7684\u9006\u77E9\u9635\u5E73\u9762\u4E0A\u7684\u53CD\u7B97\u51FA\u4E09\u7EF4\u7A7A\u95F4\u4E2D\u7684\u70B9\uFF08p1\u5E73\u9762\u4E0A\u7684\u70B9\uFF09
vec4 inverseP2 = u_InverseViewProjectionMatrix * p2;
inverseP1 = inverseP1 / inverseP1.w; // \u5F52\u4E00\u5316\u64CD\u4F5C\uFF08\u5F52\u4E00\u5316\u540E\u4E3A\u4E16\u754C\u5750\u6807\uFF09
inverseP2 = inverseP2 / inverseP2.w;
float zPos = (0.0 - inverseP1.z) / (inverseP2.z - inverseP1.z); // ??
vec4 position = inverseP1 + zPos * (inverseP2 - inverseP1);
vec4 b= vec4(0.5000, 0.0, 1.0, 0.5000);
float fh;
v_intensity = texture(SAMPLER_2D(u_texture), v_texCoord).r;
fh = toBezier(v_intensity, b).y;
gl_Position = u_ViewProjectionMatrixUncentered * vec4(position.xy, fh * project_pixel(50.), 1.0);
}
`,HC=`uniform sampler2D u_texture; // \u70ED\u529B\u5F3A\u5EA6\u56FE
uniform sampler2D u_colorTexture; // \u6839\u636E\u5F3A\u5EA6\u5206\u5E03\u7684\u8272\u5E26
layout(std140) uniform commonUniforms {
float u_opacity;
float u_common_uniforms_padding1;
float u_common_uniforms_padding2;
float u_common_uniforms_padding3;
};
in vec2 v_texCoord;
out vec4 outputColor;
#pragma include "scene_uniforms"
float getBlurIndusty() {
float vW = 2.0/ u_ViewportSize.x;
float vH = 2.0/ u_ViewportSize.y;
vec2 vUv = v_texCoord;
float i11 = texture(SAMPLER_2D(u_texture), vec2( vUv.x - 1.0 * vW, vUv.y + 1.0 * vH) ).r;
float i12 = texture(SAMPLER_2D(u_texture), vec2( vUv.x - 0.0 * vW, vUv.y + 1.0 * vH) ).r;
float i13 = texture(SAMPLER_2D(u_texture), vec2( vUv.x + 1.0 * vW, vUv.y + 1.0 * vH) ).r;
float i21 = texture(SAMPLER_2D(u_texture), vec2( vUv.x - 1.0 * vW, vUv.y) ).r;
float i22 = texture(SAMPLER_2D(u_texture), vec2( vUv.x , vUv.y) ).r;
float i23 = texture(SAMPLER_2D(u_texture), vec2( vUv.x + 1.0 * vW, vUv.y) ).r;
float i31 = texture(SAMPLER_2D(u_texture), vec2( vUv.x - 1.0 * vW, vUv.y-1.0*vH) ).r;
float i32 = texture(SAMPLER_2D(u_texture), vec2( vUv.x - 0.0 * vW, vUv.y-1.0*vH) ).r;
float i33 = texture(SAMPLER_2D(u_texture), vec2( vUv.x + 1.0 * vW, vUv.y-1.0*vH) ).r;
return(
i11 +
i12 +
i13 +
i21 +
i21 +
i22 +
i23 +
i31 +
i32 +
i33
)/9.0;
}
void main(){
// float intensity = texture(u_texture, v_texCoord).r;
float intensity = getBlurIndusty();
vec4 color = texture(SAMPLER_2D(u_colorTexture), vec2(intensity, 0.0));
outputColor = color;
outputColor.a = color.a * smoothstep(0.,0.1,intensity) * u_opacity;
}
`,GC=`
layout(location = 0) in vec3 a_Position;
layout(location = 14) in vec2 a_Uv;
layout(std140) uniform commonUniforms {
float u_opacity;
float u_common_uniforms_padding1;
float u_common_uniforms_padding2;
float u_common_uniforms_padding3;
};
#pragma include "scene_uniforms"
out vec2 v_texCoord;
void main() {
v_texCoord = a_Uv;
#ifdef VIEWPORT_ORIGIN_TL
v_texCoord.y = 1.0 - v_texCoord.y;
#endif
gl_Position = vec4(a_Position.xy, 0, 1.);
}
`,WC=`layout(std140) uniform commonUniforms {
float u_radius;
float u_intensity;
float u_common_uniforms_padding1;
float u_common_uniforms_padding2;
};
in vec2 v_extrude;
in float v_weight;
out vec4 outputColor;
#define GAUSS_COEF 0.3989422804014327
void main(){
float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude);
float val = v_weight * u_intensity * GAUSS_COEF * exp(d);
outputColor = vec4(val, 1., 1., 1.);
}
`,XC=`layout(location = 0) in vec3 a_Position;
layout(location = 9) in float a_Size;
layout(location = 10) in vec2 a_Dir;
layout(std140) uniform commonUniforms {
float u_radius;
float u_intensity;
float u_common_uniforms_padding1;
float u_common_uniforms_padding2;
};
out vec2 v_extrude;
out float v_weight;
#define GAUSS_COEF 0.3989422804014327
#pragma include "projection"
#pragma include "picking"
void main(){
vec3 picking_color_placeholder = u_PickingColor;
v_weight = a_Size;
float ZERO = 1.0 / 255.0 / 16.0;
float extrude_x = a_Dir.x * 2.0 -1.0;
float extrude_y = a_Dir.y * 2.0 -1.0;
vec2 extrude_dir = normalize(vec2(extrude_x,extrude_y));
float S = sqrt(-2.0 * log(ZERO / a_Size / u_intensity / GAUSS_COEF)) / 2.5;
v_extrude = extrude_dir * S;
vec2 offset = project_pixel(v_extrude * u_radius);
vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
gl_Position = u_Mvp * (vec4(project_pos.xy + offset, 0.0, 1.0));
} else {
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));
}
}
`,{isEqual:qC}=es;class Aw extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"colorTexture",void 0),(0,K.Z)(this,"heatmapFramerBuffer",void 0),(0,K.Z)(this,"heatmapTexture",void 0),(0,K.Z)(this,"intensityModel",void 0),(0,K.Z)(this,"colorModel",void 0),(0,K.Z)(this,"shapeType",void 0),(0,K.Z)(this,"preRampColors",void 0),(0,K.Z)(this,"colorModelUniformBuffer",[]),(0,K.Z)(this,"heat3DModelUniformBuffer",[])}prerender(){const{clear:e,useFramebuffer:r}=this.rendererService;r(this.heatmapFramerBuffer,()=>{e({color:[0,0,0,0],depth:1,stencil:0,framebuffer:this.heatmapFramerBuffer}),this.drawIntensityMode()})}render(e){const{rampColors:r}=this.layer.getLayerConfig();qC(this.preRampColors,r)||this.updateColorTexture(),this.shapeType==="heatmap"?this.drawHeatMap(e):this.draw3DHeatMap(e)}getUninforms(){throw new Error("Method not implemented.")}initModels(){var e=this;return(0,Nr.Z)(function*(){var r;const{createFramebuffer:n,getViewportSize:a,createTexture2D:u}=e.rendererService,y=e.styleAttributeService.getLayerStyleAttribute("shape"),A=(y==null||(r=y.scale)===null||r===void 0?void 0:r.field)||"heatmap";e.shapeType=A,e.intensityModel=yield e.buildHeatMapIntensity(),e.colorModel=A==="heatmap"?e.buildHeatmap():e.build3dHeatMap();const{width:O,height:Z}=a();return e.heatmapTexture=u({width:Math.floor(O/4),height:Math.floor(Z/4),wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE,min:Ee.LINEAR,mag:Ee.LINEAR,usage:$.RENDER_TARGET}),e.heatmapFramerBuffer=n({color:e.heatmapTexture,depth:!0,width:Math.floor(O/4),height:Math.floor(Z/4)}),e.updateColorTexture(),[e.intensityModel,e.colorModel]})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initModels()})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"dir",type:Vr.Attribute,descriptor:{name:"a_Dir",shaderLocation:10,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return[r]}}})}buildHeatMapIntensity(){var e=this;return(0,Nr.Z)(function*(){return e.uniformBuffers=[e.rendererService.createBuffer({data:new Float32Array(4).fill(0),isUBO:!0})],e.layer.triangulation=ww,yield e.layer.buildLayerModel({moduleName:"heatmapIntensity",vertexShader:XC,fragmentShader:WC,triangulation:ww,depth:{enable:!1},cull:{enable:!0,face:Tl(e.mapService.version)}})})()}buildHeatmap(){this.shaderModuleService.registerModule("heatmapColor",{vs:GC,fs:HC}),this.colorModelUniformBuffer=[this.rendererService.createBuffer({data:new Float32Array(4).fill(0),isUBO:!0})];const{vs:e,fs:r,uniforms:n}=this.shaderModuleService.getModule("heatmapColor"),{createAttribute:a,createElements:u,createBuffer:y,createModel:A}=this.rendererService;return A({vs:e,fs:r,uniformBuffers:[...this.colorModelUniformBuffer,...this.rendererService.uniformBuffers],attributes:{a_Position:a({shaderLocation:Ro.POSITION,buffer:y({data:[-1,1,0,1,1,0,-1,-1,0,1,-1,0],type:Ee.FLOAT}),size:3}),a_Uv:a({shaderLocation:Ro.UV,buffer:y({data:[0,1,1,1,0,0,1,0],type:Ee.FLOAT}),size:2})},uniforms:(0,Wt.Z)({},n),depth:{enable:!1},elements:u({data:[0,2,1,2,3,1],type:Ee.UNSIGNED_INT,count:6})})}drawIntensityMode(){var e;const{intensity:r=10,radius:n=5}=this.layer.getLayerConfig(),a={u_radius:n,u_intensity:r};this.uniformBuffers[0].subData({offset:0,data:[n,r]}),this.layerService.beforeRenderData(this.layer),this.layer.hooks.beforeRender.call(),(e=this.intensityModel)===null||e===void 0||e.draw({uniforms:a,blend:{enable:!0,func:{srcRGB:Ee.ONE,srcAlpha:1,dstRGB:Ee.ONE,dstAlpha:1}},stencil:{enable:!1,mask:255,func:{cmp:514,ref:1,mask:255}}}),this.layer.hooks.afterRender.call()}drawHeatMap(e){var r;const{opacity:n=1}=this.layer.getLayerConfig(),a={u_opacity:n,u_colorTexture:this.colorTexture,u_texture:this.heatmapFramerBuffer},u=[this.heatmapTexture,this.colorTexture];this.colorModelUniformBuffer[0].subData({offset:0,data:[n]}),(r=this.colorModel)===null||r===void 0||r.draw({uniforms:a,textures:u,blend:this.getBlend(),stencil:this.getStencil(e)})}draw3DHeatMap(e){var r;const{opacity:n=1}=this.layer.getLayerConfig(),a=Kr.create();Kr.invert(a,this.cameraService.getViewProjectionMatrixUncentered());const u={u_opacity:n,u_colorTexture:this.colorTexture,u_texture:this.heatmapFramerBuffer,u_ViewProjectionMatrixUncentered:this.cameraService.getViewProjectionMatrixUncentered(),u_InverseViewProjectionMatrix:[...a]};this.heat3DModelUniformBuffer[0].subData({offset:0,data:[...u.u_ViewProjectionMatrixUncentered,...u.u_InverseViewProjectionMatrix,n]});const y=[this.heatmapTexture,this.colorTexture];(r=this.colorModel)===null||r===void 0||r.draw({uniforms:u,textures:y,blend:{enable:!0,func:{srcRGB:Ee.SRC_ALPHA,srcAlpha:1,dstRGB:Ee.ONE_MINUS_SRC_ALPHA,dstAlpha:1}},stencil:this.getStencil(e)})}build3dHeatMap(){const{getViewportSize:e}=this.rendererService,{width:r,height:n}=e(),a=ZC(r/4,n/4);this.shaderModuleService.registerModule("heatmap3dColor",{vs:jC,fs:VC}),this.heat3DModelUniformBuffer=[this.rendererService.createBuffer({data:new Float32Array(16*2+4).fill(0),isUBO:!0})];const{vs:u,fs:y,uniforms:A}=this.shaderModuleService.getModule("heatmap3dColor"),{createAttribute:O,createElements:Z,createBuffer:Y,createModel:Q}=this.rendererService;return Q({vs:u,fs:y,attributes:{a_Position:O({shaderLocation:Ro.POSITION,buffer:Y({data:a.vertices,type:Ee.FLOAT}),size:3}),a_Uv:O({shaderLocation:Ro.UV,buffer:Y({data:a.uvs,type:Ee.FLOAT}),size:2})},primitive:Ee.TRIANGLES,uniformBuffers:[...this.heat3DModelUniformBuffer,...this.rendererService.uniformBuffers],uniforms:(0,Wt.Z)({},A),depth:{enable:!0},blend:{enable:!0,func:{srcRGB:Ee.SRC_ALPHA,srcAlpha:1,dstRGB:Ee.ONE_MINUS_SRC_ALPHA,dstAlpha:1}},elements:Z({data:a.indices,type:Ee.UNSIGNED_INT,count:a.indices.length})})}updateColorTexture(){const{createTexture2D:e}=this.rendererService;this.texture&&this.texture.destroy();const{rampColors:r}=this.layer.getLayerConfig(),n=lc(r);this.colorTexture=e({data:n.data,usage:$.SAMPLED,width:n.width,height:n.height,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE,min:Ee.NEAREST,mag:Ee.NEAREST,flipY:!1,unorm:!0}),this.preRampColors=r}}const YC=`in vec4 v_color;
#pragma include "picking"
out vec4 outputColor;
void main() {
outputColor = v_color;
outputColor = filterColor(outputColor);
}
`,$C=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 10) in vec3 a_Pos;
layout(std140) uniform commonUniforms {
vec2 u_radius;
float u_opacity;
float u_coverage;
float u_angle;
};
out vec4 v_color;
#pragma include "projection"
#pragma include "project"
#pragma include "picking"
void main() {
v_color = a_Color;
v_color.a *= u_opacity;
mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));
vec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage));
vec2 lnglat = unProjectFlat(a_Pos.xy + offset);
// vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0., 1.0));
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
// gl_Position = u_Mvp * (vec4(project_pos.xy, 0., 1.0));
// gl_Position = u_Mvp * (vec4(a_Pos.xy + offset, 0., 1.0));
vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator;
vec4 project_pos = project_position(vec4(customLnglat, 0, 1.0));
gl_Position = u_Mvp * vec4(project_pos.xy, 0.0, 1.0);
} else {
vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0., 1.0));
}
setPickingColor(a_PickingColor);
}
`;class KC extends Ml{getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{opacity:e,coverage:r,angle:n}=this.layer.getLayerConfig(),a={u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset],u_opacity:e||1,u_coverage:r||.9,u_angle:n||0};return this.getUniformsBufferInfo(a)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"heatmapHexagon",vertexShader:$C,fragmentShader:YC,triangulation:Ew,depth:{enable:!1},primitive:Ee.TRIANGLES})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"pos",type:Vr.Attribute,descriptor:{name:"a_Pos",shaderLocation:10,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:e=>{const r=e.version==="GAODE2.x"?e.originCoordinates:e.coordinates;return[r[0],r[1],0]}}})}}var JC={heatmap:Aw,heatmap3d:Aw,grid:kC,grid3d:UC,hexagon:KC};class QC extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","HeatMapLayer")}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new JC[r](e),yield e.initLayerModels()})()}prerender(){this.getModelType()==="heatmap"&&this.layerModel&&this.layerModel.prerender()}renderModels(e={}){return this.getModelType()==="heatmap"?(this.layerModel&&this.layerModel.render(e),this):this.encodeDataLength<=0&&!this.forceRender?this:(this.hooks.beforeRender.call(),this.models.forEach(n=>n.draw({uniforms:this.layerModel.getUninforms(),blend:this.layerModel.getBlend(),stencil:this.layerModel.getStencil(e)})),this.hooks.afterRender.call(),this)}updateModelData(e){e.attributes&&e.elements?this.models[0].updateAttributesAndElements(e.attributes,e.elements):console.warn("data error")}getModelType(){var e;const r=this.styleAttributeService.getLayerStyleAttribute("shape"),{shape3d:n}=this.getLayerConfig(),u=this.getSource().data.type,y=(r==null||(e=r.scale)===null||e===void 0?void 0:e.field)||"heatmap";return y==="heatmap"||y==="heatmap3d"?"heatmap":u==="hexagon"?(n==null?void 0:n.indexOf(y))===-1?"hexagon":"grid3d":u==="grid"?(n==null?void 0:n.indexOf(y))===-1?"grid":"grid3d":"heatmap"}getLegend(e){if(this.getModelType()==="heatmap"){if(e!=="color")return{type:void 0,field:void 0,items:[]};const r=this.getLayerConfig().rampColors;return Tw(r,e)}else return super.getLegend(e)}}const e5=`uniform sampler2D u_texture;
layout(std140) uniform commonUniforms {
float u_opacity:1.0;
float u_brightness:1.0;
float u_contrast:1.0;
float u_saturation:1.0;
float u_gamma:1.0;
};
in vec2 v_texCoord;
out vec4 outputColor;
vec3 setContrast(vec3 rgb, float contrast) {
vec3 color = mix(vec3(0.5), rgb, contrast);
color = clamp(color, 0.0, 1.0);
return color;
}
vec3 setSaturation(vec3 rgb, float adjustment) {
const vec3 grayVector = vec3(0.2125, 0.7154, 0.0721);
vec3 intensity = vec3(dot(rgb, grayVector));
vec3 color = mix(intensity, rgb, adjustment);
color = clamp(color, 0.0, 1.0);
return color;
}
void main() {
vec4 color = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y));
//brightness
color.rgb = mix(vec3(0.0, 0.0, 0.0), color.rgb, u_brightness);
//contrast
color.rgb = setContrast(color.rgb, u_contrast);
// saturation
color.rgb = setSaturation(color.rgb, u_saturation);
// gamma
color.rgb = pow(color.rgb, vec3(u_gamma));
outputColor = color;
outputColor.a *= u_opacity;
if(outputColor.a < 0.01)
discard;
}
`,t5=`layout(location = 0) in vec3 a_Position;
layout(location = 14) in vec2 a_Uv;
layout(std140) uniform commonUniforms {
float u_opacity:1.0;
float u_brightness:1.0;
float u_contrast:1.0;
float u_saturation:1.0;
float u_gamma:1.0;
};
out vec2 v_texCoord;
#pragma include "projection"
void main() {
v_texCoord = a_Uv;
vec4 project_pos = project_position(vec4(a_Position, 1.0));
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
}
`;class r5 extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0)}getCommonUniformsInfo(){const{opacity:e,brightness:r,contrast:n,saturation:a,gamma:u}=this.layer.getLayerConfig(),y={u_opacity:ho(e,1),u_brightness:ho(r,1),u_contrast:ho(n,1),u_saturation:ho(a,1),u_gamma:ho(u,1)};return this.textures=[this.texture],this.getUniformsBufferInfo(y)}initModels(){var e=this;return(0,Nr.Z)(function*(){return yield e.loadTexture(),e.buildModels()})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy()}loadTexture(){var e=this;return(0,Nr.Z)(function*(){const{createTexture2D:r}=e.rendererService;e.texture=r({height:1,width:1});const a=yield e.layer.getSource().data.images;e.texture=r({data:a[0],width:a[0].width,height:a[0].height,mag:Ee.LINEAR,min:Ee.LINEAR})})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"rasterImage",vertexShader:t5,fragmentShader:e5,triangulation:h_,primitive:Ee.TRIANGLES,blend:{enable:!0},depth:{enable:!1},pickingEnabled:!1})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}var n5={image:r5};class Cw extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","ImageLayer")}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new n5[r](e),yield e.initLayerModels()})()}getDefaultConfig(){const e=this.getModelType();return{image:{}}[e]}getModelType(){return"image"}}const i5=`
#define Animate 0.0
#define LineTexture 1.0
uniform sampler2D u_texture;
layout(std140) uniform commonUniorm {
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
vec4 u_dash_array;
vec4 u_sourceColor;
vec4 u_targetColor;
vec2 u_textSize;
float segmentNumber;
float u_lineDir: 1.0;
float u_icon_step: 100;
float u_line_texture: 0.0;
float u_textureBlend;
float u_blur : 0.9;
float u_line_type: 0.0;
float u_time;
float u_linearColor: 0.0;
};
in vec4 v_color;
in vec2 v_iconMapUV;
in vec4 v_lineData;
//dash
in vec4 v_dash_array;
in float v_distance_ratio;
out vec4 outputColor;
#pragma include "picking"
void main() {
if(u_dash_array!=vec4(0.0)){
float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
if(!(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z))) {
discard;
};
}
float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6
outputColor = v_color;
if(u_animate.x == Animate && u_line_texture != LineTexture) {
animateSpeed = u_time / u_animate.y;
float alpha =1.0 - fract( mod(1.0- v_lineData.b, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
// alpha = smoothstep(0., 1., alpha);
alpha = clamp(alpha, 0.0, 1.0);
outputColor.a *= alpha;
}
// \u5F53\u5B58\u5728\u8D34\u56FE\u65F6\u5728\u5E95\u8272\u4E0A\u8D34\u4E0A\u8D34\u56FE
if(u_line_texture == LineTexture) { // while load texture
float arcRadio = smoothstep( 0.0, 1.0, (v_lineData.r / segmentNumber));
// float arcRadio = smoothstep( 0.0, 1.0, d_distance_ratio);
float count = v_lineData.g; // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF
float time = 0.0;
if(u_animate.x == Animate) {
time = u_time / u_animate.y;
}
float redioCount = arcRadio * count;
float u = fract(redioCount - time);
float v = v_lineData.a; // \u6A2A\u5411 v
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
vec4 pattern = texture(SAMPLER_2D(u_texture), uv);
if(u_animate.x == Animate) {
float currentPlane = floor(redioCount - time);
float textureStep = floor(count * u_animate.z);
float a = mod(currentPlane, textureStep);
if(a < textureStep - 1.0) {
pattern = vec4(0.0);
}
}
if(u_textureBlend == 0.0) { // normal
pattern.a = 0.0;
outputColor = filterColor(outputColor + pattern);
} else { // replace
pattern.a *= v_color.a;
if(outputColor.a <= 0.0) {
pattern.a = 0.0;
}
outputColor = filterColor(pattern);
}
} else {
outputColor = filterColor(outputColor);
}
}`,o5=`#define Animate 0.0
#define LineTexture 1.0
layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(location = 12) in vec4 a_Instance;
layout(location = 14) in vec2 a_iconMapUV;
layout(std140) uniform commonUniorm {
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
vec4 u_dash_array;
vec4 u_sourceColor;
vec4 u_targetColor;
vec2 u_textSize;
float segmentNumber;
float u_lineDir: 1.0;
float u_icon_step: 100;
float u_line_texture: 0.0;
float u_textureBlend;
float u_blur : 0.9;
float u_line_type: 0.0;
float u_time;
float u_linearColor: 0.0;
};
out vec4 v_color;
out vec2 v_iconMapUV;
out vec4 v_lineData;
//dash
out vec4 v_dash_array;
out float v_distance_ratio;
#pragma include "projection"
#pragma include "project"
#pragma include "picking"
float bezier3(vec3 arr, float t) {
float ut = 1. - t;
return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;
}
vec2 midPoint(vec2 source, vec2 target, float arcThetaOffset) {
vec2 center = target - source;
float r = length(center);
float theta = atan(center.y, center.x);
float thetaOffset = arcThetaOffset;
float r2 = r / 2.0 / cos(thetaOffset);
float theta2 = theta + thetaOffset;
vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y);
if(u_lineDir == 1.0) { // \u6B63\u5411
return mid;
} else { // \u9006\u5411
// (mid + vmin)/2 = (s + t)/2
vec2 vmid = source + target - mid;
return vmid;
}
// return mid;
}
float getSegmentRatio(float index) {
// dash: index / (segmentNumber - 1.);
// normal: smoothstep(0.0, 1.0, index / (segmentNumber - 1.));
return smoothstep(0.0, 1.0, index / (segmentNumber - 1.));
// return index / (segmentNumber - 1.);
}
vec2 interpolate (vec2 source, vec2 target, float t, float arcThetaOffset) {
// if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation
vec2 mid = midPoint(source, target, arcThetaOffset);
vec3 x = vec3(source.x, mid.x, target.x);
vec3 y = vec3(source.y, mid.y, target.y);
return vec2(bezier3(x ,t), bezier3(y,t));
}
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {
// normalized direction of the line
vec2 dir_screenspace = normalize(line_clipspace);
// rotate by 90 degrees
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;
return offset;
}
vec2 getNormal(vec2 line_clipspace, float offset_direction) {
// normalized direction of the line
vec2 dir_screenspace = normalize(line_clipspace);
// rotate by 90 degrees
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);
}
void main() {
//vs\u4E2D\u8BA1\u7B97\u6E10\u53D8\u8272
if(u_linearColor==1.0){
float d_segmentIndex = a_Position.x + 1.0; // \u5F53\u524D\u9876\u70B9\u5728\u5F27\u7EBF\u4E2D\u6240\u5904\u7684\u5206\u6BB5\u4F4D\u7F6E
v_color = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);
}
else{
v_color = a_Color;
}
v_color.a = v_color.a * opacity;
vec2 source = a_Instance.rg; // \u8D77\u59CB\u70B9
vec2 target = a_Instance.ba; // \u7EC8\u70B9
float segmentIndex = a_Position.x;
float segmentRatio = getSegmentRatio(segmentIndex);
//\u8BA1\u7B97dashArray\u548CdistanceRatio \u8F93\u51FA\u5230\u7247\u5143
vec2 s = source;
vec2 t = target;
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
s = unProjCustomCoord(source);
t = unProjCustomCoord(target);
}
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;
v_distance_ratio = segmentIndex / segmentNumber;
float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
float d_distance_ratio;
if(u_animate.x == Animate) {
d_distance_ratio = segmentIndex / segmentNumber;
if(u_lineDir != 1.0) {
d_distance_ratio = 1.0 - d_distance_ratio;
}
}
v_lineData.b = d_distance_ratio;
vec4 curr = project_position(vec4(interpolate(source, target, segmentRatio, thetaOffset), 0.0, 1.0));
vec4 next = project_position(vec4(interpolate(source, target, nextSegmentRatio, thetaOffset), 0.0, 1.0));
vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));
float d_segmentIndex = a_Position.x + 1.0; // \u5F53\u524D\u9876\u70B9\u5728\u5F27\u7EBF\u4E2D\u6240\u5904\u7684\u5206\u6BB5\u4F4D\u7F6E
v_lineData.r = d_segmentIndex;
if(LineTexture == u_line_texture) { // \u5F00\u542F\u8D34\u56FE\u6A21\u5F0F
float arcDistrance = length(source - target); // \u8D77\u59CB\u70B9\u548C\u7EC8\u70B9\u7684\u8DDD\u79BB
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20) { // amap
arcDistrance *= 1000000.0;
}
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // mapbox
// arcDistrance *= 8.0;
arcDistrance = project_pixel_allmap(arcDistrance);
}
v_iconMapUV = a_iconMapUV;
float pixelLen = project_pixel_texture(u_icon_step); // \u8D34\u56FE\u6CBF\u5F27\u7EBF\u65B9\u5411\u7684\u957F\u5EA6 - \u968F\u5730\u56FE\u7F29\u653E\u6539\u53D8
float texCount = floor(arcDistrance/pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF
v_lineData.g = texCount;
float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB
float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB
v_lineData.a = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
}
gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + offset, 0, 1.0));
setPickingColor(a_PickingColor);
}
`,a5={solid:0,dash:1};class s5 extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"updateTexture",()=>{const{createTexture2D:r}=this.rendererService;if(this.texture){this.texture.update({data:this.iconService.getCanvas()}),this.layer.render();return}this.texture=r({data:this.iconService.getCanvas(),mag:Ee.NEAREST,min:Ee.NEAREST,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128}),this.textures=[this.texture]})}getCommonUniformsInfo(){const{sourceColor:e,targetColor:r,textureBlend:n="normal",lineType:a="solid",dashArray:u=[10,5],forward:y=!0,lineTexture:A=!1,iconStep:O=100,segmentNumber:Z=30}=this.layer.getLayerConfig(),{animateOption:Y}=this.layer.getLayerConfig();let Q=u;a!=="dash"&&(Q=[0,0]),Q.length===2&&Q.push(0,0);let ae=0,xe=[0,0,0,0],Be=[0,0,0,0];if(e&&r&&(xe=Va(e),Be=Va(r),ae=1),this.rendererService.getDirty()){var it;(it=this.texture)===null||it===void 0||it.bind()}const gt={u_animate:this.animateOption2Array(Y),u_dash_array:Q,u_sourceColor:xe,u_targetColor:Be,u_textSize:[1024,this.iconService.canvasHeight||128],segmentNumber:Z,u_lineDir:y?1:-1,u_icon_step:O,u_line_texture:A?1:0,u_textureBlend:n==="normal"?0:1,u_blur:.9,u_line_type:a5[a||"solid"],u_time:this.layer.getLayerAnimateTime()||0,u_linearColor:ae};return this.getUniformsBufferInfo(gt)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.updateTexture(),e.iconService.on("imageUpdate",e.updateTexture),e.buildModels()})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}getShaders(){return{frag:i5,vert:o5,type:""}}buildModels(){var e=this;return(0,Nr.Z)(function*(){e.initUniformsBuffer();const{segmentNumber:r=30}=e.layer.getLayerConfig(),{frag:n,vert:a,type:u}=e.getShaders();return[yield e.layer.buildLayerModel({moduleName:"lineArc2d"+u,vertexShader:a,fragmentShader:n,inject:e.getInject(),triangulation:d2,depth:{enable:!1},styleOption:{segmentNumber:r}})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:Vr.Attribute,descriptor:{name:"a_Instance",shaderLocation:12,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:4,update:(e,r,n)=>[n[3],n[4],n[5],n[6]]}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:14,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const r=this.iconService.getIconMap(),{texture:n}=e,{x:a,y:u}=r[n]||{x:0,y:0};return[a,u]}}})}}const l5=`#define LineTypeSolid 0.0
#define LineTypeDash 1.0
#define Animate 0.0
#define LineTexture 1.0
uniform sampler2D u_texture;
layout(std140) uniform commonUniorm {
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
vec4 u_dash_array: [10.0, 5., 0, 0];
vec4 u_sourceColor;
vec4 u_targetColor;
vec2 u_textSize;
float u_globel;
float u_globel_radius;
float u_global_height: 10;
float segmentNumber;
float u_line_type: 0.0;
float u_icon_step: 100;
float u_line_texture: 0.0;
float u_textureBlend;
float u_time;
float u_linearColor: 0.0;
};
// varying vec2 v_normal;
in vec4 v_dash_array;
in vec4 v_color;
in vec4 v_line_data;
in float v_segmentIndex;
in vec2 v_iconMapUV;
out vec4 outputColor;
#pragma include "picking"
void main() {
float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6
float d_distance_ratio = v_line_data.g; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B
outputColor = v_color;
if(u_line_type == LineTypeDash) {
float flag = 0.;
float dashLength = mod(d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {
flag = 1.;
}
outputColor.a *=flag;
}
if(u_animate.x == Animate && u_line_texture != LineTexture) {
animateSpeed = u_time / u_animate.y;
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
// alpha = smoothstep(0., 1., alpha);
alpha = clamp(alpha, 0.0, 1.0);
outputColor.a *= alpha;
// u_animate
// x enable
// y duration
// z interval
// w trailLength
}
if(u_line_texture == LineTexture && u_line_type != LineTypeDash) { // while load texture
// float arcRadio = smoothstep( 0.0, 1.0, (v_segmentIndex / segmentNumber));
float arcRadio = v_segmentIndex / (segmentNumber - 1.0);
float count = v_line_data.b; // // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF
float time = 0.0;
if(u_animate.x == Animate) {
time = u_time / u_animate.y;
}
float redioCount = arcRadio * count;
float u = fract(redioCount - time);
float v = v_line_data.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
vec4 pattern = texture(SAMPLER_2D(u_texture), uv);
if(u_animate.x == Animate) {
float currentPlane = floor(redioCount - time);
float textureStep = floor(count * u_animate.z);
float a = mod(currentPlane, textureStep);
if(a < textureStep - 1.0) {
pattern = vec4(0.0);
}
}
if(u_textureBlend == 0.0) { // normal
pattern.a = 0.0;
outputColor = filterColor(outputColor + pattern);
} else { // replace
pattern.a *= v_color.a;
if(outputColor.a <= 0.0) {
pattern.a = 0.0;
discard;
} else {
outputColor = filterColor(pattern);
}
}
} else {
outputColor = filterColor(outputColor);
}
}
`,u5=`#define LineTypeSolid 0.0
#define LineTypeDash 1.0
#define Animate 0.0
#define LineTexture 1.0
layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(location = 12) in vec4 a_Instance;
layout(location = 14) in vec2 a_iconMapUV;
layout(std140) uniform commonUniorm {
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
vec4 u_dash_array: [10.0, 5., 0, 0];
vec4 u_sourceColor;
vec4 u_targetColor;
vec2 u_textSize;
float u_globel;
float u_globel_radius;
float u_global_height: 10;
float segmentNumber;
float u_line_type: 0.0;
float u_icon_step: 100;
float u_line_texture: 0.0;
float u_textureBlend;
float u_time;
float u_linearColor: 0.0;
};
out vec4 v_color;
out vec4 v_dash_array;
out float v_segmentIndex;
out vec2 v_iconMapUV;
out vec4 v_line_data;
#pragma include "projection"
#pragma include "project"
#pragma include "picking"
float maps (float value, float start1, float stop1, float start2, float stop2) {
return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));
}
float getSegmentRatio(float index) {
return smoothstep(0.0, 1.0, index / (segmentNumber - 1.0));
}
float paraboloid(vec2 source, vec2 target, float ratio) {
vec2 x = mix(source, target, ratio);
vec2 center = mix(source, target, 0.5);
float dSourceCenter = distance(source, center);
float dXCenter = distance(x, center);
return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);
}
vec3 getPos(vec2 source, vec2 target, float segmentRatio) {
float vertex_height = paraboloid(source, target, segmentRatio);
return vec3(
mix(source, target, segmentRatio),
sqrt(max(0.0, vertex_height))
);
}
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {
// normalized direction of the line
vec2 dir_screenspace = normalize(line_clipspace);
// rotate by 90 degrees
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;
return offset;
}
vec2 getNormal(vec2 line_clipspace, float offset_direction) {
// normalized direction of the line
vec2 dir_screenspace = normalize(line_clipspace);
// rotate by 90 degrees
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);
}
float torad(float deg) {
return (deg / 180.0) * acos(-1.0);
}
vec3 lglt2xyz(vec2 lnglat) {
float pi = 3.1415926;
// + Math.PI/2 \u662F\u4E3A\u4E86\u5BF9\u9F50\u5750\u6807
float lng = torad(lnglat.x) + pi / 2.0;
float lat = torad(lnglat.y);
// \u624B\u52A8\u589E\u52A0\u4E00\u4E9B\u504F\u79FB\uFF0C\u51CF\u8F7B\u9762\u7684\u51B2\u7A81
float radius = u_globel_radius;
float z = radius * cos(lat) * cos(lng);
float x = radius * cos(lat) * sin(lng);
float y = radius * sin(lat);
return vec3(x, y, z);
}
void main() {
//vs\u4E2D\u8BA1\u7B97\u6E10\u53D8\u8272
if(u_linearColor==1.0){
float d_segmentIndex = a_Position.x + 1.0; // \u5F53\u524D\u9876\u70B9\u5728\u5F27\u7EBF\u4E2D\u6240\u5904\u7684\u5206\u6BB5\u4F4D\u7F6E
v_color = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);
}
else{
v_color = a_Color;
}
v_color.a = v_color.a * opacity;
vec2 source = project_position(vec4(a_Instance.rg, 0, 0)).xy;
vec2 target = project_position(vec4(a_Instance.ba, 0, 0)).xy;
float segmentIndex = a_Position.x;
float segmentRatio = getSegmentRatio(segmentIndex);
float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));
float d_distance_ratio;
if(u_line_type == LineTypeDash) {
d_distance_ratio = segmentIndex / segmentNumber;
vec2 s = source;
vec2 t = target;
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
s = unProjCustomCoord(source);
t = unProjCustomCoord(target);
}
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
}
if(u_animate.x == Animate) {
d_distance_ratio = segmentIndex / segmentNumber;
}
v_line_data.g = d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
vec3 curr = getPos(source, target, segmentRatio);
vec3 next = getPos(source, target, nextSegmentRatio);
vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y);
// v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);
v_segmentIndex = a_Position.x;
if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { // \u5F00\u542F\u8D34\u56FE\u6A21\u5F0F
float arcDistrance = length(source - target);
float pixelLen = project_pixel_texture(u_icon_step);
v_line_data.b = floor(arcDistrance/pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF
vec2 projectOffset = project_pixel(offset);
float lineOffsetWidth = length(projectOffset + projectOffset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB
float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB
v_line_data.a = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
v_iconMapUV = a_iconMapUV;
}
gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + project_pixel(offset), curr.z * thetaOffset, 1.0));
// \u5730\u7403\u6A21\u5F0F
if(u_globel > 0.0) {
vec3 startLngLat = lglt2xyz(a_Instance.rg);
vec3 endLngLat = lglt2xyz(a_Instance.ba);
float globalRadius = length(startLngLat);
vec3 lineDir = normalize(endLngLat - startLngLat);
vec3 midPointDir = normalize((startLngLat + endLngLat)/2.0);
// \u7EBF\u7684\u504F\u79FB
vec3 lnglatOffset = cross(lineDir, midPointDir) * a_Position.y;
// \u8BA1\u7B97\u8D77\u59CB\u70B9\u548C\u7EC8\u6B62\u70B9\u7684\u8DDD\u79BB
float lnglatLength = length(a_Instance.rg - a_Instance.ba)/50.0;
// \u8BA1\u7B97\u98DE\u7EBF\u5404\u4E2A\u8282\u70B9\u76F8\u5E94\u7684\u9AD8\u5EA6
float lineHeight = u_global_height * (-4.0*segmentRatio*segmentRatio + 4.0 * segmentRatio) * lnglatLength;
// \u5730\u7403\u70B9\u4F4D
vec3 globalPoint = normalize(mix(startLngLat, endLngLat, segmentRatio)) * (globalRadius + lineHeight) + lnglatOffset * a_Size;
gl_Position = u_ViewProjectionMatrix * vec4(globalPoint, 1.0);
}
setPickingColor(a_PickingColor);
}
`,c5={solid:0,dash:1};class Mw extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"updateTexture",()=>{const{createTexture2D:r}=this.rendererService;if(this.texture){this.texture.update({data:this.iconService.getCanvas()}),this.layer.render();return}this.texture=r({data:this.iconService.getCanvas(),mag:Ee.NEAREST,min:Ee.NEAREST,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128}),this.textures=[this.texture]})}getCommonUniformsInfo(){const{sourceColor:e,targetColor:r,textureBlend:n="normal",lineType:a="solid",dashArray:u=[10,5],lineTexture:y=!1,iconStep:A=100,segmentNumber:O=30,globalArcHeight:Z=10}=this.layer.getLayerConfig(),{animateOption:Y}=this.layer.getLayerConfig();u.length===2&&u.push(0,0);let Q=0,ae=[0,0,0,0],xe=[0,0,0,0];if(e&&r&&(ae=Va(e),xe=Va(r),Q=1),this.rendererService.getDirty()){var Be;(Be=this.texture)===null||Be===void 0||Be.bind()}const it={u_animate:this.animateOption2Array(Y),u_dash_array:u,u_sourceColor:ae,u_targetColor:xe,u_textSize:[1024,this.iconService.canvasHeight||128],u_globel:this.mapService.version==="GLOBEL"?1:0,u_globel_radius:n1,u_global_height:Z,segmentNumber:O,u_line_type:c5[a]||0,u_icon_step:A,u_line_texture:y?1:0,u_textureBlend:n==="normal"?0:1,u_time:this.layer.getLayerAnimateTime()||0,u_linearColor:Q};return this.getUniformsBufferInfo(it)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.updateTexture(),e.iconService.on("imageUpdate",e.updateTexture),e.buildModels()})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}getShaders(){return{frag:l5,vert:u5,type:""}}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{segmentNumber:r=30}=e.layer.getLayerConfig(),{frag:n,vert:a,type:u}=e.getShaders();return[yield e.layer.buildLayerModel({moduleName:"lineArc3d"+u,vertexShader:a,fragmentShader:n,inject:e.getInject(),triangulation:d2,styleOption:{segmentNumber:r}})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:Vr.Attribute,descriptor:{name:"a_Instance",shaderLocation:12,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:4,update:(e,r,n)=>[n[3],n[4],n[5],n[6]]}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:14,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const r=this.iconService.getIconMap(),{texture:n}=e,{x:a,y:u}=r[n]||{x:0,y:0};return[a,u]}}})}}const Pw={circle:2,triangle:2,diamond:4,rect:2,classic:3,halfTriangle:2,none:0},$d=1/2;function h5(t,e){const{width:r=2,height:n=1}=e;return{vertices:[0,$d*t,1*t*r,-(n+$d)*t,1*t*r,(n-$d)*t,0,$d*t,1*t*r,-(n+$d)*t,1*t*r,(n-$d)*t],indices:[3,4,5],outLineIndices:[0,1,2],normals:[1*t,-2*t,1,-2*t,1.5*t,1,1*t,1.5*t,1,0,0,0,0,0,0,0,0,0],dimensions:2}}function p5(t,e){const{width:r=2,height:n=3}=e;return{vertices:[0,0,1*t*r,1*n,1*t*r,-1*n,0,0,1*t*r,1*n,1*t*r,-1*n],outLineIndices:[0,1,2],indices:[3,4,5],normals:[0,-1.5*t,1,2,1*t,1,-2,1*t,1,0,0,0,0,0,0,0,0,0],dimensions:2}}function f5(t,e){const{width:r=2,height:n=2}=e;return{vertices:[0,n/2,t*r*1,n/2,t*r*1,-n/2,0,-n/2,0,n/2,t*r*1,n/2,t*r*1,-n/2,0,-n/2],dimensions:2,indices:[4,5,6,4,6,7],outLineIndices:[0,1,2,0,2,3],normals:[0,-t,1,1,0,1,0,-t,1,-1,-0,1,0,0,0,0,0,0,0,0,0,0,0,0]}}function d5(t,e){const{width:r=2,height:n=3}=e;return{vertices:[0,0,1*r*t,.5*n,2*r*t,0,1*r*t,-.5*n,0,0,1*r*t,.5*n,2*r*t,0,1*r*t,-.5*n],dimensions:2,indices:[4,5,6,4,6,7],outLineIndices:[0,1,2,0,2,3],normals:[0,-t,1,1,0,1,0,-t,1,-1,-0,1,0,0,0,0,0,0,0,0,0,0,0,0]}}function m5(t,e){const{width:r=2,height:n=3}=e;return{vertices:[0,0,2*t*r,1*n,1.5*t*r,0,2*t*r,-1*n,0,0,2*t*r,1*n,1.5*t*r,0,2*t*r,-1*n],dimensions:2,indices:[4,5,6,4,6,7],outLineIndices:[0,1,2,0,2,3],normals:[0,-t,1,1,0,1,0,-t,1,-1,-0,1,0,0,0,0,0,0,0,0,0,0,0,0]}}function g5(t,e){const{width:r=2,height:n=2}=e,a=c2(),u=Rm().flatten([a]),y=Rm()(u.vertices,u.holes,u.dimensions),A=a.map(O=>[O[0]*r*t,O[1]*n]).flat();return{vertices:[...A,...A],dimensions:2,indices:y.map(O=>O+a.length),outLineIndices:y,normals:[...a.map(O=>[O[1]*n,O[0]*r*t,1]).flat(),...new Array(a.length*3).fill(0)]}}function v5(t,e=0,r){const n=typeof r.source=="object"?r.source.type:r.source,a=typeof r.target=="object"?r.target.type:r.target,{width:u=n?Pw[n]:0}=typeof r.source=="object"?r.source:{},{width:y=a?Pw[a]:0}=typeof r.target=="object"?r.target:{};return{vertices:[0,$d,1*u,...t,1,$d,-1*y,...t,1,-$d,-1*y,...t,0,-$d,1*u,...t,0,$d,1*u,...t,1,$d,-1*y,...t,1,-$d,-1*y,...t,0,-$d,1*u,...t],outLineIndices:[0,1,2,0,2,3].map(A=>A+e),indices:[4,5,6,4,6,7].map(A=>A+e),normals:[1,-1,1,1,1,1,-1,0,1,-1,0,1,0,0,0,0,0,0,0,0,0,0,0,0],dimensions:2}}function Rw(t,e){const r=typeof t=="object"?t.type:t,n=e==="source"?1:-1,a=typeof t=="object"?t:{};switch(r){case"circle":return g5(n,a);case"triangle":return p5(n,a);case"diamond":return d5(n,a);case"rect":return f5(n,a);case"classic":return m5(n,a);case"halfTriangle":return h5(n,a);default:return{vertices:[],indices:[],normals:[],dimensions:2,outLineIndices:[],outLineNormals:[]}}}function _5(t){const e=t.coordinates.flat(),r=1,n=1;return{vertices:[1,0,0,...e,1,2,-3,...e,1,1,-3,...e,0,1,0,...e,0,0,0,...e,1,0,0,...e,1,2,-3,...e,1,1,-3,...e,0,1,0,...e,0,0,0,...e],normals:[-r,2*n,1,2*n,-n,1,n,-n,1,n,-n,1,-r,-n,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],indices:[0,1,2,0,2,3,0,3,4,5,6,7,5,7,8,5,8,9],size:7}}function y5(t,e){return e?x5(t,e):_5(t)}function x5(t,e){const r=t.coordinates.flat(),{target:n="classic",source:a="circle"}=e,u=Iw(Rw(a,"source"),r,0,0),y=v5(r,u.vertices.length/7,e),A=Iw(Rw(n,"target"),r,1,u.vertices.length/7+y.vertices.length/7);return{vertices:[...u.vertices,...y.vertices,...A.vertices],indices:[...u.outLineIndices,...y.outLineIndices,...A.outLineIndices,...u.indices,...y.indices,...A.indices],normals:[...u.normals,...y.normals,...A.normals],size:7}}function Iw(t,e,r=1,n=0){const a=[],{vertices:u,indices:y,dimensions:A,outLineIndices:O}=t;for(let Z=0;Z<u.length;Z+=A)a.push(r,u[Z+1],u[Z],...e);return(0,Wt.Z)((0,Wt.Z)({},t),{},{vertices:a,indices:y.map(Z=>Z+n),outLineIndices:O.map(Z=>Z+n)})}const b5=`// #extension GL_OES_standard_derivatives : enable
in vec4 v_color;
out vec4 outputColor;
// line texture
#pragma include "picking"
void main() {
outputColor = v_color;
outputColor = filterColor(outputColor);
}
`,E5=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in vec2 a_Size;
layout(location = 12) in vec4 a_Instance;
layout(location = 13) in vec3 a_Normal;
layout(std140) uniform commonUniorm {
float u_gap_width: 1.0;
float u_stroke_width: 1.0;
float u_stroke_opacity: 1.0;
};
#pragma include "projection"
#pragma include "project"
#pragma include "picking"
out vec4 v_color;
vec2 project_pixel_offset(vec2 offsets) {
vec2 data = project_pixel(offsets);
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
// P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
return data;
}
return vec2(data.x, -data.y);;
}
vec2 line_dir(vec2 target, vec2 source) {
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
// P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
return normalize(target - source);
}
return normalize(ProjectFlat(target) - ProjectFlat(source));
}
float flag_gap() {
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
// P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
return 1.;
}
return -1.;
}
void main() {
// \u900F\u660E\u5EA6\u8BA1\u7B97
vec2 source = a_Instance.rg; // \u8D77\u59CB\u70B9
vec2 target = a_Instance.ba; // \u7EC8\u70B9
vec2 flowlineDir = line_dir(target,source);
vec2 perpendicularDir = vec2(-flowlineDir.y, flowlineDir.x); // mapbox || \u9AD8\u5FB7
vec2 position = mix(source, target, a_Position.x);
float lengthCommon = length(project_position(vec4(target,0,1)) - project_position(vec4(source,0,1))); //
vec2 offsetDistances = a_Size.x * project_pixel_offset(vec2(a_Position.y, a_Position.z)); // Mapbox || \u9AD8\u5FB7
vec2 limitedOffsetDistances = clamp(
offsetDistances,
project_pixel(-lengthCommon*.2), project_pixel(lengthCommon*.2)
);
float startOffsetCommon = project_pixel(offsets[0]);
float endOffsetCommon = project_pixel(offsets[1]);
float endpointOffset = mix(
clamp(startOffsetCommon, 0.0, lengthCommon*.2),
-clamp(endOffsetCommon, 0.0, lengthCommon*.2),
a_Position.x
);
vec2 normalsCommon = u_stroke_width * project_pixel_offset(vec2(a_Normal.x, a_Normal.y)); // mapbox || \u9AD8\u5FB7
float gapCommon = flag_gap() * project_pixel(u_gap_width);
vec3 offsetCommon = vec3(
flowlineDir * (limitedOffsetDistances[1] + normalsCommon.y + endpointOffset * 1.05) -
perpendicularDir * (limitedOffsetDistances[0] + gapCommon + normalsCommon.x),
0.0
);
vec4 project_pos = project_position(vec4(position.xy, 0, 1.0));
vec4 fillColor = vec4(a_Color.rgb, a_Color.a * opacity);
v_color = mix(fillColor, vec4(u_stroke.xyz, u_stroke.w * fillColor.w * u_stroke_opacity), a_Normal.z);
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offsetCommon.xy, 0., 1.0));
setPickingColor(a_PickingColor);
}
`;class w5 extends Ml{getCommonUniformsInfo(){const{gapWidth:e=2,strokeWidth:r=1,strokeOpacity:n=1}=this.layer.getLayerConfig(),a={u_gap_width:e,u_stroke_width:r,u_stroke_opacity:n};return this.getUniformsBufferInfo(a)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return[yield e.layer.buildLayerModel({moduleName:"flow_line",vertexShader:E5,fragmentShader:b5,inject:e.getInject(),triangulation:y5,styleOption:e.layer.getLayerConfig().symbol,primitive:Ee.TRIANGLES,depth:{enable:!1},pick:!1})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0],r[1]]:[r,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:Vr.Attribute,descriptor:{name:"a_Instance",shaderLocation:12,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:4,update:(e,r,n)=>[n[3],n[4],n[5],n[6]]}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}})}}const S5=`#define LineTypeSolid 0.0
#define LineTypeDash 1.0
#define Animate 0.0
#define LineTexture 1.0
uniform sampler2D u_texture;
layout(std140) uniform commonUniorm {
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
vec4 u_dash_array: [10.0, 5., 0, 0];
vec4 u_sourceColor;
vec4 u_targetColor;
vec2 u_textSize;
float segmentNumber;
float u_line_type: 0.0;
float u_icon_step: 100;
float u_line_texture: 0.0;
float u_textureBlend;
float u_time;
float u_linearColor: 0;
};
in vec4 v_line_data;
in vec2 v_iconMapUV;
in vec4 v_dash_array;
in float v_distance_ratio;
in vec4 v_color;
out vec4 outputColor;
#pragma include "picking"
#pragma include "project"
#pragma include "projection"
void main() {
float animateSpeed = 0.0;
float d_segmentIndex = v_line_data.g;
// \u8BBE\u7F6E\u5F27\u7EBF\u7684\u5E95\u8272
if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272
outputColor = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);
outputColor.a *= v_color.a;
} else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272
outputColor = v_color;
}
// float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy));
// float blur = smoothstep(1.0, u_blur, length(v_normal.xy));
if(u_line_type == LineTypeDash) {
float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {
// \u5B9E\u7EBF\u90E8\u5206
} else {
// \u865A\u7EBF\u90E8\u5206
discard;
};
}
// \u8BBE\u7F6E\u5F27\u7EBF\u7684\u52A8\u753B\u6A21\u5F0F
if(u_animate.x == Animate) {
animateSpeed = u_time / u_animate.y;
float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
alpha = smoothstep(0., 1., alpha);
outputColor.a *= alpha;
}
// \u8BBE\u7F6E\u5F27\u7EBF\u7684\u8D34\u56FE
if(LineTexture == u_line_texture && u_line_type != LineTypeDash) {
float arcRadio = smoothstep( 0.0, 1.0, (d_segmentIndex / (segmentNumber - 1.0)));
// float arcRadio = d_segmentIndex / (segmentNumber - 1.0);
float count = v_line_data.b; // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF
float u = fract(arcRadio * count - animateSpeed * count);
// float u = fract(arcRadio * count - animateSpeed);
if(u_animate.x == Animate) {
u = outputColor.a/v_color.a;
}
float v = v_line_data.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
vec4 pattern = texture(SAMPLER_2D(u_texture), uv);
// \u8BBE\u7F6E\u8D34\u56FE\u548C\u5E95\u8272\u7684\u53E0\u52A0\u6A21\u5F0F
if(u_textureBlend == 0.0) { // normal
pattern.a = 0.0;
outputColor = filterColor(outputColor + pattern);
} else { // replace
pattern.a *= v_color.a;
if(outputColor.a <= 0.0) {
pattern.a = 0.0;
}
outputColor = filterColor(pattern);
}
} else {
outputColor = filterColor(outputColor);
}
// gl_FragColor = filterColor(gl_FragColor);
}`,T5=`#define LineTypeSolid 0.0
#define LineTypeDash 1.0
#define Animate 0.0
#define LineTexture 1.0
layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(location = 12) in vec4 a_Instance;
layout(location = 14) in vec2 a_iconMapUV;
layout(std140) uniform commonUniorm {
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
vec4 u_dash_array: [10.0, 5., 0, 0];
vec4 u_sourceColor;
vec4 u_targetColor;
vec2 u_textSize;
float segmentNumber;
float u_line_type: 0.0;
float u_icon_step: 100;
float u_line_texture: 0.0;
float u_textureBlend;
float u_time;
float u_linearColor: 0;
};
out vec4 v_dash_array;
out vec4 v_color;
out vec2 v_iconMapUV;
out vec4 v_line_data;
out float v_distance_ratio;
#pragma include "projection"
#pragma include "project"
#pragma include "picking"
float maps (float value, float start1, float stop1, float start2, float stop2) {
return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));
}
float getSegmentRatio(float index) {
return index / (segmentNumber - 1.);
}
float paraboloid(vec2 source, vec2 target, float ratio) {
vec2 x = mix(source, target, ratio);
vec2 center = mix(source, target, 0.5);
float dSourceCenter = distance(source, center);
float dXCenter = distance(x, center);
return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);
}
vec3 getPos(vec2 source, vec2 target, float segmentRatio) {
float vertex_height = paraboloid(source, target, segmentRatio);
return vec3(
mix(source, target, segmentRatio),
sqrt(max(0.0, vertex_height))
);
}
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {
// normalized direction of the line
vec2 dir_screenspace = normalize(line_clipspace);
// rotate by 90 degrees
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size)/ 2.0;
return offset;
}
vec2 getNormal(vec2 line_clipspace, float offset_direction) {
// normalized direction of the line
vec2 dir_screenspace = normalize(line_clipspace);
// rotate by 90 degrees
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);
}
float getAngularDist (vec2 source, vec2 target) {
vec2 delta = source - target;
vec2 sin_half_delta = sin(delta / 2.0);
float a =
sin_half_delta.y * sin_half_delta.y +
cos(source.y) * cos(target.y) *
sin_half_delta.x * sin_half_delta.x;
return 2.0 * atan(sqrt(a), sqrt(1.0 - a));
}
vec2 midPoint(vec2 source, vec2 target) {
vec2 center = target - source;
float r = length(center);
float theta = atan(center.y, center.x);
float thetaOffset = 0.314;
float r2 = r / 2.0 / cos(thetaOffset);
float theta2 = theta + thetaOffset;
vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y);
return mid;
}
float bezier3(vec3 arr, float t) {
float ut = 1. - t;
return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;
}
vec2 interpolate (vec2 source, vec2 target, float angularDist, float t) {
// if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
vec2 mid = midPoint(source, target);
vec3 x = vec3(source.x, mid.x, target.x);
vec3 y = vec3(source.y, mid.y, target.y);
return vec2(bezier3(x ,t), bezier3(y,t));
}
else {
if(abs(angularDist - PI) < 0.001) {
return (1.0 - t) * source + t * target;
}
float a = sin((1.0 - t) * angularDist) / sin(angularDist);
float b = sin(t * angularDist) / sin(angularDist);
vec2 sin_source = sin(source);
vec2 cos_source = cos(source);
vec2 sin_target = sin(target);
vec2 cos_target = cos(target);
float x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x;
float y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x;
float z = a * sin_source.y + b * sin_target.y;
return vec2(atan(y, x), atan(z, sqrt(x * x + y * y)));
}
}
void main() {
v_color = a_Color;
v_color.a = v_color.a * opacity;
vec2 source = radians(a_Instance.rg);
vec2 target = radians(a_Instance.ba);
float angularDist = getAngularDist(source, target);
float segmentIndex = a_Position.x;
float segmentRatio = getSegmentRatio(segmentIndex);
float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));
if(u_line_type == LineTypeDash) {
v_distance_ratio = segmentIndex / segmentNumber;
vec2 s = source;
vec2 t = target;
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
s = unProjCustomCoord(source);
t = unProjCustomCoord(target);
}
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
total_Distance = total_Distance*16.0; // total_Distance*16.0 \u8C03\u6574\u9ED8\u8BA4\u7684\u6548\u679C
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;
}
if(u_animate.x == Animate) {
v_distance_ratio = segmentIndex / segmentNumber;
}
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
v_distance_ratio = segmentIndex / segmentNumber;
vec4 curr = project_position(vec4(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0, 1.0));
vec4 next = project_position(vec4(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0, 1.0));
// v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);
vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));
// vec4 project_pos = project_position(vec4(curr.xy, 0, 1.0));
// gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0));
v_line_data.g = a_Position.x; // \u8BE5\u9876\u70B9\u5728\u5F27\u7EBF\u4E0A\u7684\u5206\u6BB5\u6392\u5E8F
if(LineTexture == u_line_texture) { // \u5F00\u542F\u8D34\u56FE\u6A21\u5F0F
// float mapZoomScale = u_CoordinateSystem !== COORDINATE_SYSTEM_P20_2?10000000.0:1.0;
float d_arcDistrance = length(source - target);
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20) { // amap
d_arcDistrance = d_arcDistrance * 1000000.0;
}
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // mapbox
d_arcDistrance = project_pixel_allmap(d_arcDistrance);
}
float d_pixelLen = project_pixel(u_icon_step)/8.0;
v_line_data.b = floor(d_arcDistrance/d_pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF
float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB
float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB
v_line_data.a = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
v_iconMapUV = a_iconMapUV;
}
gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + offset, 0, 1.0));
setPickingColor(a_PickingColor);
}
`,A5={solid:0,dash:1};class C5 extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"updateTexture",()=>{const{createTexture2D:r}=this.rendererService;if(this.texture){this.texture.update({data:this.iconService.getCanvas()}),this.layer.render();return}this.texture=r({data:this.iconService.getCanvas(),mag:Ee.NEAREST,min:Ee.NEAREST,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128}),this.textures=[this.texture]})}getCommonUniformsInfo(){const{sourceColor:e,targetColor:r,textureBlend:n="normal",lineType:a="solid",dashArray:u=[10,5],lineTexture:y=!1,iconStep:A=100,segmentNumber:O=30}=this.layer.getLayerConfig(),{animateOption:Z}=this.layer.getLayerConfig();if(u.length===2&&u.push(0,0),this.rendererService.getDirty()){var Y;(Y=this.texture)===null||Y===void 0||Y.bind()}let Q=0,ae=[0,0,0,0],xe=[0,0,0,0];e&&r&&(ae=Va(e),xe=Va(r),Q=1);let Be=this.layer.getLayerAnimateTime();isNaN(Be)&&(Be=0);const it={u_animate:this.animateOption2Array(Z),u_dash_array:u,u_sourceColor:ae,u_targetColor:xe,u_textSize:[1024,this.iconService.canvasHeight||128],segmentNumber:O,u_line_type:A5[a]||0,u_icon_step:A,u_line_texture:y?1:0,u_textureBlend:n==="normal"?0:1,u_time:Be,u_linearColor:Q};return this.getUniformsBufferInfo(it)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.updateTexture(),e.iconService.on("imageUpdate",e.updateTexture),e.buildModels()})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{segmentNumber:r=30}=e.layer.getLayerConfig();return[yield e.layer.buildLayerModel({moduleName:"lineGreatCircle",vertexShader:T5,fragmentShader:S5,triangulation:d2,styleOption:{segmentNumber:r},inject:e.getInject(),depth:{enable:!1}})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:Vr.Attribute,descriptor:{name:"a_Instance",shaderLocation:12,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:4,update:(e,r,n)=>[n[3],n[4],n[5],n[6]]}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:14,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const r=this.iconService.getIconMap(),{texture:n}=e,{x:a,y:u}=r[n]||{x:0,y:0};return[a,u]}}})}}const M5=`// #extension GL_OES_standard_derivatives : enable
#define Animate 0.0
#define LineTexture 1.0
uniform sampler2D u_texture;
layout(std140) uniform commonUniorm {
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
vec4 u_dash_array;
vec4 u_blur;
vec4 u_sourceColor;
vec4 u_targetColor;
vec2 u_textSize;
float u_icon_step: 100;
float u_heightfixed: 0.0;
float u_vertexScale: 1.0;
float u_raisingHeight: 0.0;
float u_strokeWidth: 0.0;
float u_textureBlend;
float u_line_texture;
float u_linearDir: 1.0;
float u_linearColor: 0;
float u_time;
};
in vec4 v_color;
in vec4 v_stroke;
// dash
in vec4 v_dash_array;
in float v_d_distance_ratio;
in vec2 v_iconMapUV;
in vec4 v_texture_data;
out vec4 outputColor;
#pragma include "picking"
// [animate, duration, interval, trailLength],
void main() {
if(u_dash_array!=vec4(0.0)){
float dashLength = mod(v_d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
if(!(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z))) {
// \u865A\u7EBF\u90E8\u5206
discard;
};
}
float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6
float d_distance_ratio = v_texture_data.r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B
if(u_linearDir < 1.0) {
d_distance_ratio = v_texture_data.a;
}
if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272
outputColor = mix(u_sourceColor, u_targetColor, d_distance_ratio);
outputColor.a *= v_color.a;
} else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272
outputColor = v_color;
}
// anti-alias
// float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy));
if(u_animate.x == Animate) {
animateSpeed = u_time / u_animate.y;
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
alpha = smoothstep(0., 1., alpha);
outputColor.a *= alpha;
}
if(u_line_texture == LineTexture) { // while load texture
float aDistance = v_texture_data.g; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB
float d_texPixelLen = v_texture_data.b; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E
float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed);
float v = v_texture_data.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
// v = max(smoothstep(0.95, 1.0, v), v);
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
vec4 pattern = texture(SAMPLER_2D(u_texture), uv);
if(u_textureBlend == 0.0) { // normal
pattern.a = 0.0;
outputColor += pattern;
} else { // replace
pattern.a *= v_color.a;
if(outputColor.a <= 0.0) {
pattern.a = 0.0;
}
outputColor = pattern;
}
}
float v = v_texture_data.a;
float strokeWidth = min(0.5, u_strokeWidth);
// \u7ED8\u5236 border
if(strokeWidth > 0.01) {
float borderOuterWidth = strokeWidth / 2.0;
if(v >= 1.0 - strokeWidth || v <= strokeWidth) {
if(v > strokeWidth) { // \u5916\u4FA7
float linear = smoothstep(0.0, 1.0, (v - (1.0 - strokeWidth))/strokeWidth);
// float linear = step(0.0, (v - (1.0 - borderWidth))/borderWidth);
outputColor.rgb = mix(outputColor.rgb, v_stroke.rgb, linear);
} else if(v <= strokeWidth) {
float linear = smoothstep(0.0, 1.0, v/strokeWidth);
outputColor.rgb = mix(v_stroke.rgb, outputColor.rgb, linear);
}
}
if(v < borderOuterWidth) {
outputColor.a = mix(0.0, outputColor.a, v/borderOuterWidth);
} else if(v > 1.0 - borderOuterWidth) {
outputColor.a = mix(outputColor.a, 0.0, (v - (1.0 - borderOuterWidth))/borderOuterWidth);
}
}
// blur
float blurV = v_texture_data.a;
if(blurV < 0.5) {
outputColor.a *= mix(u_blur.r, u_blur.g, blurV/0.5);
} else {
outputColor.a *= mix(u_blur.g, u_blur.b, (blurV - 0.5)/0.5);
}
outputColor = filterColor(outputColor);
}
`,P5=`
#define Animate 0.0
layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in vec2 a_Size;
layout(location = 10) in vec3 a_DistanceAndIndexAndMiter;
layout(location = 13) in vec4 a_Normal_Total_Distance;
layout(location = 14) in vec2 a_iconMapUV;
layout(std140) uniform commonUniorm {
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
vec4 u_dash_array;
vec4 u_blur;
vec4 u_sourceColor;
vec4 u_targetColor;
vec2 u_textSize;
float u_icon_step: 100;
float u_heightfixed: 0.0;
float u_vertexScale: 1.0;
float u_raisingHeight: 0.0;
float u_strokeWidth: 0.0;
float u_textureBlend;
float u_line_texture;
float u_linearDir: 1.0;
float u_linearColor: 0;
float u_time;
};
out vec4 v_color;
out vec4 v_stroke;
//dash
out vec4 v_dash_array;
out float v_d_distance_ratio;
// texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09
out vec2 v_iconMapUV;
out vec4 v_texture_data;
#pragma include "projection"
#pragma include "picking"
void main() {
vec2 a_DistanceAndIndex = a_DistanceAndIndexAndMiter.xy;
float a_Miter = a_DistanceAndIndexAndMiter.z;
vec3 a_Normal = a_Normal_Total_Distance.xyz;
float a_Total_Distance = a_Normal_Total_Distance.w;
//dash\u8F93\u51FA
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance;
v_d_distance_ratio = a_DistanceAndIndex.x / a_Total_Distance;
// cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97
float d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E
v_iconMapUV = a_iconMapUV;
d_texPixelLen = project_float_pixel(u_icon_step);
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
d_texPixelLen *= 10.0;
}
v_color = a_Color;
v_color.a *= opacity;
v_stroke = stroke;
vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal);
vec2 offset = project_pixel(size.xy);
float lineDistance = a_DistanceAndIndex.x;
float currentLinePointRatio = lineDistance / a_Total_Distance;
float lineOffsetWidth = length(offset + offset * sign(a_Miter)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB\uFF08\u5411\u4E24\u4FA7\u504F\u79FB\u7684\u548C\uFF09
float linePixelSize = project_pixel(a_Size.x) * 2.0; // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB \u5355\u4FA7 * 2
float texV = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
v_texture_data = vec4(currentLinePointRatio, lineDistance, d_texPixelLen, texV);
// \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570
vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0));
float h = float(a_Position.z) * u_vertexScale; // \u7EBF\u9876\u70B9\u7684\u9AD8\u5EA6 - \u517C\u5BB9\u4E0D\u5B58\u5728\u7B2C\u4E09\u4E2A\u6570\u503C\u7684\u60C5\u51B5 vertex height
float lineHeight = a_Size.y; // size \u7B2C\u4E8C\u4E2A\u53C2\u6570\u4EE3\u8868\u7684\u9AD8\u5EA6 [linewidth, lineheight]
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
lineHeight *= 0.2; // \u4FDD\u6301\u548C amap/mapbox \u4E00\u81F4\u7684\u6548\u679C
h *= 0.2;
if(u_heightfixed < 1.0) {
lineHeight = project_pixel(a_Size.y);
}
gl_Position = u_Mvp * (vec4(project_pos.xy + offset, lineHeight + h + u_raisingHeight, 1.0));
} else {
// \u517C\u5BB9 mapbox \u5728\u7EBF\u9AD8\u5EA6\u4E0A\u7684\u6548\u679C\u8868\u73B0\u57FA\u672C\u4E00\u81F4
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
// mapbox
// \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
h *= mapboxZoomScale;
h += u_raisingHeight * mapboxZoomScale;
if(u_heightfixed > 0.0) {
lineHeight *= mapboxZoomScale;
}
} else {
// amap
h += u_raisingHeight;
// lineHeight \u9876\u70B9\u504F\u79FB\u9AD8\u5EA6
if(u_heightfixed < 1.0) {
lineHeight *= pow(2.0, 20.0 - u_Zoom);
}
}
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, lineHeight + h, 1.0));
}
setPickingColor(a_PickingColor);
}
`;class Lw extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"textureEventFlag",!1),(0,K.Z)(this,"texture",this.createTexture2D({data:new Uint8Array([0,0,0,0]),width:1,height:1})),(0,K.Z)(this,"updateTexture",()=>{const{createTexture2D:r}=this.rendererService;if(this.textures.length===0&&(this.textures=[this.texture]),this.texture){this.texture.update({data:this.iconService.getCanvas()}),this.layer.render();return}this.texture=r({data:this.iconService.getCanvas(),mag:Ee.NEAREST,min:Ee.NEAREST,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128})})}getCommonUniformsInfo(){const{sourceColor:e,targetColor:r,textureBlend:n="normal",lineType:a="solid",dashArray:u=[10,5,0,0],lineTexture:y=!1,iconStep:A=100,vertexHeightScale:O=20,strokeWidth:Z=0,raisingHeight:Y=0,heightfixed:Q=!1,linearDir:ae=s2.VERTICAL,blur:xe=[1,1,1,0]}=this.layer.getLayerConfig();let Be=u;if(a!=="dash"&&(Be=[0,0,0,0]),Be.length===2&&Be.push(0,0),this.rendererService.getDirty()&&this.texture){var it;(it=this.texture)===null||it===void 0||it.bind()}const{animateOption:gt}=this.layer.getLayerConfig();let Bt=0,Rt=[0,0,0,0],Yt=[0,0,0,0];e&&r&&(Rt=Va(e),Yt=Va(r),Bt=1);const vr={u_animate:this.animateOption2Array(gt),u_dash_array:Be,u_blur:xe,u_sourceColor:Rt,u_targetColor:Yt,u_textSize:[1024,this.iconService.canvasHeight||128],u_icon_step:A,u_heightfixed:Number(Q),u_vertexScale:O,u_raisingHeight:Number(Y),u_strokeWidth:Z,u_textureBlend:n===uw.NORMAL?0:1,u_line_texture:y?1:0,u_linearDir:ae===s2.VERTICAL?1:0,u_linearColor:Bt,u_time:this.layer.getLayerAnimateTime()||0};return this.getUniformsBufferInfo(vr)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.textureEventFlag||(e.textureEventFlag=!0,e.updateTexture(),e.iconService.on("imageUpdate",e.updateTexture)),e.buildModels()})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{depth:r=!1}=e.layer.getLayerConfig(),{frag:n,vert:a,type:u}=e.getShaders();return e.layer.triangulation=p2,[yield e.layer.buildLayerModel({moduleName:"line"+u,vertexShader:a,fragmentShader:n,triangulation:p2,inject:e.getInject(),depth:{enable:r}})]})()}getShaders(){return{frag:M5,vert:P5,type:""}}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"distanceAndIndex",type:Vr.Attribute,descriptor:{name:"a_DistanceAndIndexAndMiter",shaderLocation:10,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u,y)=>y===void 0?[n[3],10,n[4]]:[n[3],y,n[4]]}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0],r[1]]:[r,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal_total_distance",type:Vr.Attribute,descriptor:{name:"a_Normal_Total_Distance",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:4,update:(e,r,n,a,u)=>[...u,n[5]]}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const r=this.iconService.getIconMap(),{texture:n}=e,{x:a,y:u}=r[n]||{x:0,y:0};return[a,u]}}})}}const R5=`
layout(std140) uniform commonUniorm {
vec4 u_sourceColor;
vec4 u_targetColor;
vec4 u_dash_array;
float u_vertexScale: 1.0;
float u_linearColor: 0;
};
in float v_distanceScale;
in vec4 v_color;
//dash
in vec4 v_dash_array;
out vec4 outputColor;
void main() {
if(u_dash_array!=vec4(0.0)){
float dashLength = mod(v_distanceScale, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
if(!(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z))) {
// \u865A\u7EBF\u90E8\u5206
discard;
};
}
if(u_linearColor==1.0){
outputColor = mix(u_sourceColor, u_targetColor, v_distanceScale);
outputColor.a *= v_color.a; // \u5168\u5C40\u900F\u660E\u5EA6
}
else{
outputColor = v_color;
}
}
`,I5=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in vec4 a_SizeDistanceAndTotalDistance;
layout(std140) uniform commonUniorm {
vec4 u_sourceColor;
vec4 u_targetColor;
vec4 u_dash_array;
float u_vertexScale: 1.0;
float u_linearColor: 0;
};
#pragma include "projection"
#pragma include "picking"
out vec4 v_color;
out float v_distanceScale;
out vec4 v_dash_array;
void main() {
//dash\u8F93\u51FA
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_SizeDistanceAndTotalDistance.a;
v_color = a_Color;
v_distanceScale = a_SizeDistanceAndTotalDistance.b / a_SizeDistanceAndTotalDistance.a;
v_color.a = v_color.a * opacity;
vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));
float h = float(a_Position.z) * u_vertexScale; // \u7EBF\u9876\u70B9\u7684\u9AD8\u5EA6 - \u517C\u5BB9\u4E0D\u5B58\u5728\u7B2C\u4E09\u4E2A\u6570\u503C\u7684\u60C5\u51B5
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
gl_Position = u_Mvp * (vec4(project_pos.xy, project_pixel(a_SizeDistanceAndTotalDistance.y) + h * 0.2, 1.0));
} else {
float lineHeight = a_SizeDistanceAndTotalDistance.y;
// \u517C\u5BB9 mapbox \u5728\u7EBF\u9AD8\u5EA6\u4E0A\u7684\u6548\u679C\u8868\u73B0\u57FA\u672C\u4E00\u81F4
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
// \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8
h *= 2.0/pow(2.0, 20.0 - u_Zoom);
}
// amap1.x
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
// \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8
lineHeight *= pow(2.0, 20.0 - u_Zoom);
}
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, lineHeight + h, 1.0));
gl_PointSize = 10.0;
}
}
`;class L5 extends Ml{getCommonUniformsInfo(){const{sourceColor:e,targetColor:r,lineType:n="solid",dashArray:a=[10,5,0,0],vertexHeightScale:u=20}=this.layer.getLayerConfig();let y=a;n!=="dash"&&(y=[0,0,0,0]),y.length===2&&y.push(0,0);let A=0,O=[0,0,0,0],Z=[0,0,0,0];e&&r&&(O=Va(e),Z=Va(r),A=1);const Y={u_sourceColor:O,u_targetColor:Z,u_dash_array:y,u_vertexScale:u,u_linearColor:A};return this.getUniformsBufferInfo(Y)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}getShaders(){return{frag:R5,vert:I5,type:"lineSimpleNormal"}}buildModels(){var e=this;return(0,Nr.Z)(function*(){e.initUniformsBuffer();const{frag:r,vert:n,type:a}=e.getShaders();return[yield e.layer.buildLayerModel({moduleName:a,vertexShader:n,fragmentShader:r,triangulation:hC,inject:e.getInject(),primitive:Ee.LINES,depth:{enable:!1},pick:!1})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"sizeDistanceAndTotalDistance",type:Vr.Attribute,descriptor:{name:"a_SizeDistanceAndTotalDistance",shaderLocation:Ro.SIZE,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:4,update:(e,r,n)=>{const{size:a=1}=e,u=Array.isArray(a)?[a[0],a[1]]:[a,0];return[u[0],u[1],n[3],n[5]]}}})}}const D5=`#define Animate 0.0
#define LineTexture 1.0
// line texture
uniform sampler2D u_texture;
layout(std140) uniform commonUniorm {
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
vec4 u_sourceColor;
vec4 u_targetColor;
vec2 u_textSize;
float u_icon_step: 100;
float u_heightfixed;
float u_linearColor: 0;
float u_line_texture;
float u_textureBlend;
float u_iconStepCount;
float u_time;
};
in vec2 v_iconMapUV;
in float v_blur;
in float v_radio;
in vec4 v_color;
in vec4 v_dataset;
out vec4 outputColor;
#pragma include "picking"
void main() {
float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6
float d_distance_ratio = v_dataset.r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B
float v = v_dataset.a;
if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272
outputColor = mix(u_sourceColor, u_targetColor, v);
} else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272
outputColor = v_color;
}
outputColor.a *= v_color.a; // \u5168\u5C40\u900F\u660E\u5EA6
if(u_animate.x == Animate) {
animateSpeed = u_time / u_animate.y;
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
alpha = smoothstep(0., 1., alpha);
outputColor.a *= alpha;
}
if(u_line_texture == LineTexture) { // while load texture
float aDistance = v_dataset.g; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB
float d_texPixelLen = v_dataset.b; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E
float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed);
float v = v_dataset.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
// \u8BA1\u7B97\u7EB9\u7406\u95F4\u9694 start
float flag = 0.0;
if(u > 1.0/u_iconStepCount) {
flag = 1.0;
}
u = fract(u*u_iconStepCount);
// \u8BA1\u7B97\u7EB9\u7406\u95F4\u9694 end
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
vec4 pattern = texture(SAMPLER_2D(u_texture), uv);
// Tip: \u5224\u65AD\u7EB9\u7406\u95F4\u9694
if(flag > 0.0) {
pattern = vec4(0.0);
}
if(u_textureBlend == 0.0) { // normal
pattern.a = 0.0;
outputColor = filterColor(outputColor + pattern);
} else { // replace
pattern.a *= v_color.a;
if(outputColor.a <= 0.0) {
pattern.a = 0.0;
}
outputColor = filterColor(pattern);
}
}
// blur - AA
if(v < v_blur) {
outputColor.a = mix(0.0, outputColor.a, v/v_blur);
} else if(v > 1.0 - v_blur) {
outputColor.a = mix(outputColor.a, 0.0, (v - (1.0 - v_blur))/v_blur);
}
outputColor = filterColor(outputColor);
}
`,O5=`#define Animate 0.0
layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in vec2 a_Size;
layout(location = 10) in float a_Miter;
layout(location = 11) in float a_Total_Distance;
layout(location = 12) in vec4 a_Instance;
layout(location = 13) in vec3 a_Normal;
layout(location = 14) in vec2 a_iconMapUV;
layout(location = 15) in float a_Distance;
layout(std140) uniform commonUniorm {
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
vec4 u_sourceColor;
vec4 u_targetColor;
vec2 u_textSize;
float u_icon_step: 100;
float u_heightfixed;
float u_linearColor: 0;
float u_line_texture;
float u_textureBlend;
float u_iconStepCount;
float u_time;
};
#pragma include "projection"
#pragma include "light"
#pragma include "picking"
// texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09
out vec2 v_iconMapUV;
out vec4 v_color;
out float v_blur;
out float v_radio;
out vec4 v_dataset;
void main() {
float d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B
float d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E
v_iconMapUV = a_iconMapUV;
if(u_heightfixed < 1.0) { // \u9AD8\u5EA6\u968F zoom \u8C03\u6574
d_texPixelLen = project_pixel(u_icon_step);
} else {
d_texPixelLen = u_icon_step;
}
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
d_texPixelLen *= 10.0;
}
if(u_animate.x == Animate || u_linearColor == 1.0) {
d_distance_ratio = a_Distance / a_Total_Distance;
}
float miter = (a_Miter + 1.0)/2.0;
// \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570
v_dataset[0] = d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B
v_dataset[1] = a_Distance; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB
v_dataset[2] = d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E
v_dataset[3] = miter; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C 0 - 1
vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));
float originSize = a_Size.x; // \u56FA\u5B9A\u9AD8\u5EA6
if(u_heightfixed < 1.0) {
originSize = project_float_meter(a_Size.x); // \u9AD8\u5EA6\u968F zoom \u8C03\u6574
}
float wallHeight = originSize * miter;
float lightWeight = calc_lighting(vec4(project_pos.xy, wallHeight, 1.0));
v_blur = min(project_float_pixel(2.0) / originSize, 0.05);
v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
gl_Position = u_Mvp * (vec4(project_pos.xy, wallHeight, 1.0));
} else {
// \u517C\u5BB9 mapbox \u5728\u7EBF\u9AD8\u5EA6\u4E0A\u7684\u6548\u679C\u8868\u73B0\u57FA\u672C\u4E00\u81F4
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
// mapbox
// \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8
float mapboxZoomScale = 4.0 / pow(2.0, 21.0 - u_Zoom);
if(u_heightfixed > 0.0) {
wallHeight *= mapboxZoomScale;
}
} else {
// lineHeight \u9876\u70B9\u504F\u79FB\u9AD8\u5EA6
if(u_heightfixed < 1.0) {
wallHeight *= pow(2.0, 20.0 - u_Zoom);
}
}
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, wallHeight, 1.0));
}
setPickingColor(a_PickingColor);
}
`;class B5 extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"updateTexture",()=>{const{createTexture2D:r}=this.rendererService;if(this.texture){this.texture.update({data:this.iconService.getCanvas()}),this.layer.render();return}this.texture=r({data:this.iconService.getCanvas(),mag:Ee.NEAREST,min:Ee.NEAREST,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128}),this.textures=[this.texture]})}getCommonUniformsInfo(){const{sourceColor:e,targetColor:r,textureBlend:n="normal",heightfixed:a=!1,lineTexture:u=!1,iconStep:y=100,iconStepCount:A=1}=this.layer.getLayerConfig(),{animateOption:O}=this.layer.getLayerConfig();if(this.rendererService.getDirty()){var Z;(Z=this.texture)===null||Z===void 0||Z.bind()}let Y=0,Q=[0,0,0,0],ae=[0,0,0,0];e&&r&&(Q=Va(e),ae=Va(r),Y=1);const xe={u_animate:this.animateOption2Array(O),u_sourceColor:Q,u_targetColor:ae,u_textSize:[1024,this.iconService.canvasHeight||128],u_icon_step:y,u_heightfixed:Number(a),u_linearColor:Y,u_line_texture:u?1:0,u_textureBlend:n==="normal"?0:1,u_iconStepCount:A,u_time:this.layer.getLayerAnimateTime()||0};return this.getUniformsBufferInfo(xe)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.updateTexture(),e.iconService.on("imageUpdate",e.updateTexture),e.buildModels()})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}buildModels(){var e=this;return(0,Nr.Z)(function*(){return[yield e.layer.buildLayerModel({moduleName:"lineWall",vertexShader:O5,fragmentShader:D5,triangulation:p2,inject:e.getInject(),depth:{enable:!1},blend:e.getBlend()})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"distance",type:Vr.Attribute,descriptor:{name:"a_Distance",shaderLocation:15,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:(e,r,n)=>[n[3]]}}),this.styleAttributeService.registerStyleAttribute({name:"total_distance",type:Vr.Attribute,descriptor:{name:"a_Total_Distance",shaderLocation:11,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:(e,r,n)=>[n[5]]}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0],r[1]]:[r,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"miter",type:Vr.Attribute,descriptor:{name:"a_Miter",shaderLocation:10,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:(e,r,n)=>[n[4]]}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:14,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const r=this.iconService.getIconMap(),{texture:n}=e,{x:a,y:u}=r[n]||{x:0,y:0};return[a,u]}}})}}var F5={arc:s5,arc3d:Mw,greatcircle:C5,wall:B5,line:Lw,simple:L5,flowline:w5,earthArc3d:Mw};class m2 extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","LineLayer"),(0,K.Z)(this,"enableShaderEncodeStyles",["stroke","offsets","opacity","thetaOffset"]),(0,K.Z)(this,"arrowInsertCount",0),(0,K.Z)(this,"defaultSourceConfig",{data:[{lng1:100,lat1:30,lng2:130,lat2:30}],options:{parser:{type:"json",x:"lng1",y:"lat1",x1:"lng2",y1:"lat2"}}})}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new F5[r](e),yield e.initLayerModels()})()}getDefaultConfig(){const e=this.getModelType();return{line:{},linearline:{},simple:{},wall:{},arc3d:{blend:"additive"},arc:{blend:"additive"},greatcircle:{blend:"additive"},tileLine:{},earthArc3d:{},flowline:{},arrow:{}}[e]}getModelType(){var e;if(this.layerType)return this.layerType;const r=this.styleAttributeService.getLayerStyleAttribute("shape");return(r==null||(e=r.scale)===null||e===void 0?void 0:e.field)||"line"}processData(e){if(this.getModelType()!=="simple")return e;const r=[];return e.map(n=>{if(Array.isArray(n.coordinates)&&Array.isArray(n.coordinates[0])&&Array.isArray(n.coordinates[0][0])){const a=(0,Wt.Z)({},n);n.coordinates.map(u=>{r.push((0,Wt.Z)((0,Wt.Z)({},a),{},{coordinates:u}))})}else r.push(n)}),r}}const k5=`
layout(std140) uniform commonUniorm {
vec4 u_stroke_color;
float u_additive;
float u_stroke_opacity;
float u_stroke_width;
};
in vec4 v_color;
in float v_blur;
in float v_innerRadius;
out vec4 outputColor;
#pragma include "picking"
void main() {
vec2 center = vec2(0.5);
// Tip: \u7247\u5143\u5230\u4E2D\u5FC3\u70B9\u7684\u8DDD\u79BB 0 - 1
float fragmengTocenter = distance(center, gl_PointCoord) * 2.0;
// Tip: \u7247\u5143\u7684\u526A\u5207\u6210\u5706\u5F62
float circleClipOpacity = 1.0 - smoothstep(v_blur, 1.0, fragmengTocenter);
if(v_innerRadius < 0.99) {
// \u5F53\u5B58\u5728 stroke \u4E14 stroke > 0.01
float blurWidth = (1.0 - v_blur)/2.0;
vec4 stroke = vec4(u_stroke_color.rgb, u_stroke_opacity);
if(fragmengTocenter > v_innerRadius + blurWidth) {
outputColor = stroke;
} else if(fragmengTocenter > v_innerRadius - blurWidth){
float mixR = (fragmengTocenter - (v_innerRadius - blurWidth)) / (blurWidth * 2.0);
outputColor = mix(v_color, stroke, mixR);
} else {
outputColor = v_color;
}
} else {
// \u5F53\u4E0D\u5B58\u5728 stroke \u6216 stroke <= 0.01
outputColor = v_color;
}
outputColor = filterColor(outputColor);
if(u_additive > 0.0) {
outputColor *= circleClipOpacity;
} else {
outputColor.a *= circleClipOpacity;
}
}
`,N5=`
layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(std140) uniform commonUniorm {
vec4 u_stroke_color;
float u_additive;
float u_stroke_opacity;
float u_stroke_width;
};
out vec4 v_color;
out float v_blur;
out float v_innerRadius;
#pragma include "projection"
#pragma include "picking"
#pragma include "project"
void main() {
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
v_blur = 1.0 - max(2.0/a_Size, 0.05);
v_innerRadius = max((a_Size - u_stroke_width) / a_Size, 0.0);
vec2 offset = project_pixel(u_offsets);
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
gl_Position = u_Mvp * vec4(a_Position.xy + offset, a_Position.z, 1.0);
} else { // else
vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);
gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));
}
gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;
setPickingColor(a_PickingColor);
}
`;function Dw(t){const e=t.coordinates;return{vertices:[...e],indices:[0],size:e.length}}class z5 extends Ml{getDefaultStyle(){return{blend:"additive"}}getCommonUniformsInfo(){const{blend:e,strokeOpacity:r=1,strokeWidth:n=0,stroke:a="#fff"}=this.layer.getLayerConfig(),u={u_stroke_color:Va(a),u_additive:e==="additive"?1:0,u_stroke_opacity:r,u_stroke_width:n};return this.getUniformsBufferInfo(u)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.layer.triangulation=Dw,e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointSimple",vertexShader:N5,fragmentShader:k5,inject:e.getInject(),triangulation:Dw,depth:{enable:!1},primitive:Ee.POINTS})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0]]:[r]}}})}}const U5=`precision highp float;
in vec4 v_color;
#pragma include "picking"
layout(std140) uniform commonUniform {
vec4 u_sourceColor;
vec4 u_targetColor;
float u_linearColor: 0;
float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
float u_globel;
float u_r;
float u_pickLight: 0.0;
float u_opacitylinear: 0.0;
float u_opacitylinear_dir: 1.0;
float u_lightEnable: 1.0;
};
in float v_lightWeight;
in float v_barLinearZ;
out vec4 outputColor;
void main() {
outputColor = v_color;
// \u5F00\u542F\u900F\u660E\u5EA6\u6E10\u53D8
if(u_opacitylinear > 0.0) {
outputColor.a *= u_opacitylinear_dir > 0.0 ? (1.0 - v_barLinearZ): v_barLinearZ;
}
// picking
if(u_pickLight > 0.0) {
outputColor = filterColorAlpha(outputColor, v_lightWeight);
} else {
outputColor = filterColor(outputColor);
}
}
`,Z5=`precision highp float;
#define pi 3.1415926535
#define ambientRatio 0.5
#define diffuseRatio 0.3
#define specularRatio 0.2
layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in vec3 a_Size;
layout(location = 11) in vec3 a_Pos;
layout(location = 13) in vec3 a_Normal;
layout(std140) uniform commonUniform {
vec4 u_sourceColor;
vec4 u_targetColor;
float u_linearColor: 0;
float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
float u_globel;
float u_r;
float u_pickLight: 0.0;
float u_opacitylinear: 0.0;
float u_opacitylinear_dir: 1.0;
float u_lightEnable: 1.0;
};
out vec4 v_color;
out float v_lightWeight;
out float v_barLinearZ;
// \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143
#pragma include "projection"
#pragma include "light"
#pragma include "picking"
float getYRadian(float x, float z) {
if(x > 0.0 && z > 0.0) {
return atan(x/z);
} else if(x > 0.0 && z <= 0.0){
return atan(-z/x) + pi/2.0;
} else if(x <= 0.0 && z <= 0.0) {
return pi + atan(x/z); //atan(x/z) +
} else {
return atan(z/-x) + pi*3.0/2.0;
}
}
float getXRadian(float y, float r) {
return atan(y/r);
}
void main() {
// cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97
vec3 size = a_Size * a_Position;
// a_Position.z \u662F\u5728\u6784\u5EFA\u7F51\u683C\u7684\u65F6\u5019\u4F20\u5165\u7684\u6807\u51C6\u503C 0 - 1\uFF0C\u5728\u63D2\u503C\u5668\u63D2\u503C\u53EF\u4EE5\u83B7\u53D6 0\uFF5E1 \u7EBF\u6027\u6E10\u53D8\u7684\u503C
v_barLinearZ = a_Position.z;
vec3 offset = size; // \u63A7\u5236\u5706\u67F1\u4F53\u7684\u5927\u5C0F - \u4ECE\u6807\u51C6\u5355\u4F4D\u5706\u67F1\u4F53\u8FDB\u884C\u504F\u79FB
if(u_heightfixed < 1.0) { // \u5706\u67F1\u4F53\u4E0D\u56FA\u5B9A\u9AD8\u5EA6
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
// P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1
offset = offset * pow(2.0, (19.0 - u_Zoom));
}
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
// P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
offset = offset * pow(2.0, (19.0 - 3.0 - u_Zoom));
}
} else {// \u5706\u67F1\u4F53\u56FA\u5B9A\u9AD8\u5EA6 \uFF08 \u5904\u7406 mapbox \uFF09
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
offset *= 4.0/pow(2.0, 21.0 - u_Zoom);
}
}
vec4 project_pos = project_position(vec4(a_Pos.xy, 0., 1.0));
// u_r \u63A7\u5236\u5706\u67F1\u7684\u751F\u957F
vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);
// \u5706\u67F1\u5149\u7167\u6548\u679C
float lightWeight = 1.0;
if(u_lightEnable > 0.0) { // \u53D6\u6D88\u4E09\u5143\u8868\u8FBE\u5F0F\uFF0C\u589E\u5F3A\u5065\u58EE\u6027
lightWeight = calc_lighting(pos);
}
v_lightWeight = lightWeight;
// \u8BBE\u7F6E\u5706\u67F1\u7684\u5E95\u8272
if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272
v_color = mix(u_sourceColor, u_targetColor, v_barLinearZ);
v_color.rgb *= lightWeight;
} else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272
v_color = a_Color;
}
v_color.a *= u_opacity;
// \u5728\u5730\u7403\u6A21\u5F0F\u4E0B\uFF0C\u5C06\u539F\u672C\u5782\u76F4\u4E8E xy \u5E73\u9762\u7684\u5706\u67F1\u8C03\u6574\u59FF\u6001\u5230\u9002\u5E94\u5706\u7684\u89D2\u5EA6
//\u65CB\u8F6C\u77E9\u9635mx\uFF0C\u521B\u5EFA\u7ED5x\u8F74\u65CB\u8F6C\u77E9\u9635
float r = sqrt(a_Pos.z*a_Pos.z + a_Pos.x*a_Pos.x);
float xRadian = getXRadian(a_Pos.y, r);
float xcos = cos(xRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u4F59\u5F26\u503C
float xsin = sin(xRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u6B63\u5F26\u503C
mat4 mx = mat4(
1,0,0,0,
0,xcos,-xsin,0,
0,xsin,xcos,0,
0,0,0,1);
//\u65CB\u8F6C\u77E9\u9635my\uFF0C\u521B\u5EFA\u7ED5y\u8F74\u65CB\u8F6C\u77E9\u9635
float yRadian = getYRadian(a_Pos.x, a_Pos.z);
float ycos = cos(yRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u4F59\u5F26\u503C
float ysin = sin(yRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u6B63\u5F26\u503C
mat4 my = mat4(
ycos,0,-ysin,0,
0,1,0,0,
ysin,0,ycos,0,
0,0,0,1);
gl_Position = u_ViewProjectionMatrix * vec4(( my * mx * vec4(a_Position * a_Size, 1.0)).xyz + a_Pos, 1.0);
setPickingColor(a_PickingColor);
}
`,{isNumber:V5}=es;class j5 extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"raiseCount",0),(0,K.Z)(this,"raiseRepeat",0)}getCommonUniformsInfo(){const{animateOption:e={enable:!1,speed:.01,repeat:!1},opacity:r=1,sourceColor:n,targetColor:a,pickLight:u=!1,heightfixed:y=!0,opacityLinear:A={enable:!1,dir:"up"},lightEnable:O=!0}=this.layer.getLayerConfig();let Z=0,Y=[0,0,0,0],Q=[0,0,0,0];if(n&&a&&(Y=Va(n),Q=Va(a),Z=1),this.raiseCount<1&&this.raiseRepeat>0&&e.enable){const{speed:Be=.01}=e;this.raiseCount+=Be,this.raiseCount>=1&&(this.raiseRepeat>1?(this.raiseCount=0,this.raiseRepeat--):this.raiseCount=1)}const ae={u_sourceColor:Y,u_targetColor:Q,u_linearColor:Z,u_pickLight:Number(u),u_heightfixed:Number(y),u_r:e.enable&&this.raiseRepeat>0?this.raiseCount:1,u_opacity:V5(r)?r:1,u_opacitylinear:Number(A.enable),u_opacitylinear_dir:A.dir==="up"?1:0,u_lightEnable:Number(O)};return this.getUniformsBufferInfo(ae)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{animateOption:{repeat:r=1}}=e.layer.getLayerConfig();return e.raiseRepeat=r,[yield e.layer.buildLayerModel({moduleName:"pointEarthExtrude",vertexShader:Z5,fragmentShader:U5,triangulation:h2,depth:{enable:!0},inject:e.getInject(),cull:{enable:!0,face:Tl(e.mapService.version)},blend:e.getBlend()})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:e=>{const{size:r}=e;if(r){let n=[];return Array.isArray(r)&&(n=r.length===2?[r[0],r[0],r[1]]:r),Array.isArray(r)||(n=[r,r,r]),n}else return[2,2,2]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"pos",type:Vr.Attribute,descriptor:{name:"a_Pos",shaderLocation:15,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:e=>{const r=Pc(e.coordinates);return fw([r[0],r[1]])}}})}}const H5=`in vec4 v_data;
in vec4 v_color;
in float v_radius;
layout(std140) uniform commonUniform {
float u_additive;
float u_stroke_opacity : 1;
float u_stroke_width : 2;
float u_blur : 0.0;
};
#pragma include "sdf_2d"
#pragma include "picking"
out vec4 outputColor;
void main() {
int shape = int(floor(v_data.w + 0.5));
vec4 strokeColor = u_stroke == vec4(0.0) ? v_color : u_stroke;
lowp float antialiasblur = v_data.z;
float r = v_radius / (v_radius + u_stroke_width);
float outer_df;
float inner_df;
// 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'
if (shape == 0) {
outer_df = sdCircle(v_data.xy, 1.0);
inner_df = sdCircle(v_data.xy, r);
} else if (shape == 1) {
outer_df = sdEquilateralTriangle(1.1 * v_data.xy);
inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);
} else if (shape == 2) {
outer_df = sdBox(v_data.xy, vec2(1.));
inner_df = sdBox(v_data.xy, vec2(r));
} else if (shape == 3) {
outer_df = sdPentagon(v_data.xy, 0.8);
inner_df = sdPentagon(v_data.xy, r * 0.8);
} else if (shape == 4) {
outer_df = sdHexagon(v_data.xy, 0.8);
inner_df = sdHexagon(v_data.xy, r * 0.8);
} else if (shape == 5) {
outer_df = sdOctogon(v_data.xy, 1.0);
inner_df = sdOctogon(v_data.xy, r);
} else if (shape == 6) {
outer_df = sdHexagram(v_data.xy, 0.52);
inner_df = sdHexagram(v_data.xy, r * 0.52);
} else if (shape == 7) {
outer_df = sdRhombus(v_data.xy, vec2(1.0));
inner_df = sdRhombus(v_data.xy, vec2(r));
} else if (shape == 8) {
outer_df = sdVesica(v_data.xy, 1.1, 0.8);
inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);
}
if(outer_df > antialiasblur + 0.018) discard;
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(
antialiasblur,
0.0,
inner_df
);
if(u_stroke_width < 0.01) {
outputColor = vec4(v_color.rgb, v_color.a * u_opacity);
} else {
outputColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t);
}
if(u_additive > 0.0) {
outputColor *= opacity_t;
outputColor = filterColorAlpha(outputColor, outputColor.a);
} else {
outputColor.a *= opacity_t;
outputColor = filterColor(outputColor);
}
}
`,G5=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(location = 10) in float a_Shape;
layout(location = 11) in vec3 a_Extrude;
layout(std140) uniform commonUniform {
float u_additive;
float u_stroke_opacity : 1;
float u_stroke_width : 2;
float u_blur : 0.0;
};
out vec4 v_data;
out vec4 v_color;
out float v_radius;
#pragma include "projection"
#pragma include "picking"
void main() {
vec3 extrude = a_Extrude;
float shape_type = a_Shape;
/*
* setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F
*/
float newSize = setPickingSize(a_Size);
// float newSize = setPickingSize(a_Size) * 0.00001038445708445579;
// unpack color(vec2)
v_color = a_Color;
// radius(16-bit)
v_radius = newSize;
// anti-alias
// float antialiased_blur = -max(u_blur, antialiasblur);
float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur);
// TODP: /abs(extrude.x) \u662F\u4E3A\u4E86\u517C\u5BB9\u5730\u7403\u6A21\u5F0F
v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);
gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1 + vec3(u_offsets,0.0), 1.0);
setPickingColor(a_PickingColor);
}`;class W5 extends Ml{getCommonUniformsInfo(){const{strokeOpacity:e=1,strokeWidth:r=0,blend:n,blur:a=0}=this.layer.getLayerConfig();this.layer.getLayerConfig();const u={u_additive:n==="additive"?1:0,u_stroke_opacity:e,u_stroke_width:r,u_blur:a};return this.getUniformsBufferInfo(u)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.layer.triangulation=xw,[yield e.layer.buildLayerModel({moduleName:"pointEarthFill",vertexShader:G5,fragmentShader:H5,triangulation:xw,inject:e.getInject(),depth:{enable:!0},blend:e.getBlend()})]})()}animateOption2Array(e){return[e.enable?0:1,e.speed||1,e.rings||3,0]}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Vr.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Ro.EXTRUDE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a)=>{const[u,y,A]=n,O=ra.fromValues(0,0,1),Z=ra.fromValues(u,0,A),Y=u>=0?ra.angle(O,Z):Math.PI*2-ra.angle(O,Z),Q=Math.PI*2-Math.asin(y/100),ae=Kr.create();Kr.rotateY(ae,ae,Y),Kr.rotateX(ae,ae,Q);const xe=ra.fromValues(1,1,0);ra.transformMat4(xe,xe,ae),ra.normalize(xe,xe);const Be=ra.fromValues(-1,1,0);ra.transformMat4(Be,Be,ae),ra.normalize(Be,Be);const it=ra.fromValues(-1,-1,0);ra.transformMat4(it,it,ae),ra.normalize(it,it);const gt=ra.fromValues(1,-1,0);ra.transformMat4(gt,gt,ae),ra.normalize(gt,gt);const Bt=[...xe,...Be,...it,...gt],Rt=a%4*3;return[Bt[Rt],Bt[Rt+1],Bt[Rt+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=5}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"shape",type:Vr.Attribute,descriptor:{name:"a_Shape",shaderLocation:Ro.SHAPE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{shape:r=2}=e;return[this.layer.getLayerConfig().shape2d.indexOf(r)]}}})}}const X5=`
in vec4 v_color;
in float v_lightWeight;
out vec4 outputColor;
layout(std140) uniform commonUniforms {
float u_pickLight;
float u_heightfixed;
float u_r;
float u_linearColor;
vec4 u_sourceColor;
vec4 u_targetColor;
float u_opacitylinear;
float u_opacitylinear_dir;
float u_lightEnable;
};
#pragma include "scene_uniforms"
#pragma include "picking"
void main() {
outputColor = v_color;
// \u5F00\u542F\u900F\u660E\u5EA6\u6E10\u53D8
// picking
if(u_pickLight > 0.0) {
outputColor = filterColorAlpha(outputColor, v_lightWeight);
} else {
outputColor = filterColor(outputColor);
}
}
`,q5=`#define pi 3.1415926535
layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in vec3 a_Size;
layout(location = 11) in vec3 a_Extrude;
layout(location = 13) in vec3 a_Normal;
layout(std140) uniform commonUniforms {
float u_pickLight;
float u_heightfixed;
float u_r;
float u_linearColor;
vec4 u_sourceColor;
vec4 u_targetColor;
float u_opacitylinear;
float u_opacitylinear_dir;
float u_lightEnable;
};
out vec4 v_color;
out float v_lightWeight;
#pragma include "projection"
#pragma include "light"
#pragma include "picking"
float getYRadian(float x, float z) {
if(x > 0.0 && z > 0.0) {
return atan(x/z);
} else if(x > 0.0 && z <= 0.0){
return atan(-z/x) + pi/2.0;
} else if(x <= 0.0 && z <= 0.0) {
return pi + atan(x/z); //atan(x/z) +
} else {
return atan(z/-x) + pi*3.0/2.0;
}
}
float getXRadian(float y, float r) {
return atan(y/r);
}
void main() {
vec3 size = a_Size * a_Position;
vec3 offset = size; // \u63A7\u5236\u5706\u67F1\u4F53\u7684\u5927\u5C0F - \u4ECE\u6807\u51C6\u5355\u4F4D\u5706\u67F1\u4F53\u8FDB\u884C\u504F\u79FB
if(u_heightfixed < 1.0) { // \u5706\u67F1\u4F53\u4E0D\u56FA\u5B9A\u9AD8\u5EA6
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
// P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1
offset = offset * pow(2.0, (19.0 - u_Zoom));
}
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
// P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
offset = offset * pow(2.0, (19.0 - 3.0 - u_Zoom));
}
} else {// \u5706\u67F1\u4F53\u56FA\u5B9A\u9AD8\u5EA6 \uFF08 \u5904\u7406 mapbox \uFF09
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
offset *= 4.0/pow(2.0, 21.0 - u_Zoom);
}
}
vec4 project_pos = project_position(vec4(a_Extrude.xy, 0., 1.0));
// u_r \u63A7\u5236\u5706\u67F1\u7684\u751F\u957F
vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);
// // \u5706\u67F1\u5149\u7167\u6548\u679C
float lightWeight = 1.0;
if(u_lightEnable > 0.0) { // \u53D6\u6D88\u4E09\u5143\u8868\u8FBE\u5F0F\uFF0C\u589E\u5F3A\u5065\u58EE\u6027
lightWeight = calc_lighting(pos);
}
v_lightWeight = lightWeight;
v_color = a_Color;
// \u8BBE\u7F6E\u5706\u67F1\u7684\u5E95\u8272
if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272
v_color = mix(u_sourceColor, u_targetColor, a_Position.z);
v_color.a = v_color.a * opacity;
} else {
v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);
}
if(u_opacitylinear > 0.0) {
v_color.a *= u_opacitylinear_dir > 0.0 ? (1.0 - a_Position.z): a_Position.z;
}
gl_Position = project_common_position_to_clipspace_v2(pos);
setPickingColor(a_PickingColor);
}
`;class Ow extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"raiseCount",0),(0,K.Z)(this,"raiseRepeat",0)}getCommonUniformsInfo(){const{animateOption:e={enable:!1,speed:.01,repeat:!1},sourceColor:r,targetColor:n,pickLight:a=!1,heightfixed:u=!1,opacityLinear:y={enable:!1,dir:"up"},lightEnable:A=!0}=this.layer.getLayerConfig();let O=0,Z=[0,0,0,0],Y=[0,0,0,0];if(r&&n&&(Z=Va(r),Y=Va(n),O=1),this.raiseCount<1&&this.raiseRepeat>0&&e.enable){const{speed:xe=.01}=e;this.raiseCount+=xe,this.raiseCount>=1&&(this.raiseRepeat>1?(this.raiseCount=0,this.raiseRepeat--):this.raiseCount=1)}const Q={u_pickLight:Number(a),u_heightfixed:Number(u),u_r:e.enable&&this.raiseRepeat>0?this.raiseCount:1,u_linearColor:O,u_sourceColor:Z,u_targetColor:Y,u_opacitylinear:Number(y.enable),u_opacitylinear_dir:y.dir==="up"?1:0,u_lightEnable:Number(A)};return this.getUniformsBufferInfo(Q)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{depth:r=!0,animateOption:{repeat:n=1}}=e.layer.getLayerConfig();return e.raiseRepeat=n,e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointExtrude",vertexShader:q5,fragmentShader:X5,triangulation:h2,inject:e.getInject(),cull:{enable:!0,face:Tl(e.mapService.version)},depth:{enable:r}})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:e=>{const{size:r}=e;if(r){let n=[];return Array.isArray(r)&&(n=r.length===2?[r[0],r[0],r[1]]:r),Array.isArray(r)||(n=[r,r,r]),n}else return[2,2,2]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Vr.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Ro.EXTRUDE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:e=>{const r=Pc(e.coordinates);return[r[0],r[1],0]}}})}}const Y5=`
layout(std140) uniform commonUniforms {
vec3 u_blur_height_fixed;
float u_stroke_width;
float u_additive;
float u_stroke_opacity;
float u_size_unit;
float u_time;
vec4 u_animate;
};
in vec4 v_color;
in vec4 v_stroke;
in vec4 v_data;
in float v_radius;
#pragma include "scene_uniforms"
#pragma include "sdf_2d"
#pragma include "picking"
out vec4 outputColor;
void main() {
int shape = int(floor(v_data.w + 0.5));
lowp float antialiasblur = v_data.z;
float r = v_radius / (v_radius + u_stroke_width);
float outer_df;
float inner_df;
// 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'
if (shape == 0) {
outer_df = sdCircle(v_data.xy, 1.0);
inner_df = sdCircle(v_data.xy, r);
} else if (shape == 1) {
outer_df = sdEquilateralTriangle(1.1 * v_data.xy);
inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);
} else if (shape == 2) {
outer_df = sdBox(v_data.xy, vec2(1.));
inner_df = sdBox(v_data.xy, vec2(r));
} else if (shape == 3) {
outer_df = sdPentagon(v_data.xy, 0.8);
inner_df = sdPentagon(v_data.xy, r * 0.8);
} else if (shape == 4) {
outer_df = sdHexagon(v_data.xy, 0.8);
inner_df = sdHexagon(v_data.xy, r * 0.8);
} else if (shape == 5) {
outer_df = sdOctogon(v_data.xy, 1.0);
inner_df = sdOctogon(v_data.xy, r);
} else if (shape == 6) {
outer_df = sdHexagram(v_data.xy, 0.52);
inner_df = sdHexagram(v_data.xy, r * 0.52);
} else if (shape == 7) {
outer_df = sdRhombus(v_data.xy, vec2(1.0));
inner_df = sdRhombus(v_data.xy, vec2(r));
} else if (shape == 8) {
outer_df = sdVesica(v_data.xy, 1.1, 0.8);
inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);
}
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(
antialiasblur,
0.0,
inner_df
);
float PI = 3.14159;
float N_RINGS = 3.0;
float FREQ = 1.0;
if(u_stroke_width < 0.01) {
outputColor = v_color;
} else {
outputColor = mix(v_color, v_stroke * u_stroke_opacity, color_t);
}
float intensity = 1.0;
if(u_time!=-1.0){
//wave\u76F8\u5173\u903B\u8F91
float d = length(v_data.xy);
if(d > 0.5) {
discard;
}
intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_animate.z - u_animate.y * u_time)), 0.0, 1.0);
}
if(u_additive > 0.0) {
outputColor *= opacity_t;
outputColor *= intensity;//wave
outputColor = filterColorAlpha(outputColor, outputColor.a);
} else {
outputColor.a *= opacity_t;
outputColor.a *= intensity;//wave
outputColor = filterColor(outputColor);
}
// \u4F5C\u4E3A mask \u6A21\u677F\u65F6\u9700\u8981\u4E22\u5F03\u900F\u660E\u7684\u50CF\u7D20
if(outputColor.a < 0.01) {
discard;
}
}
`,$5=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(location = 10) in float a_Shape;
layout(location = 11) in vec3 a_Extrude;
layout(std140) uniform commonUniforms {
vec3 u_blur_height_fixed;
float u_stroke_width;
float u_additive;
float u_stroke_opacity;
float u_size_unit;
float u_time;
vec4 u_animate;
};
out vec4 v_color;
out vec4 v_stroke;
out vec4 v_data;
out float v_radius;
#pragma include "projection"
#pragma include "picking"
#pragma include "rotation_2d"
void main() {
// \u900F\u660E\u5EA6\u8BA1\u7B97
v_stroke = stroke;
vec3 extrude = a_Extrude;
float shape_type = a_Shape;
/*
* setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F
* u_meter2coord \u5728\u7B49\u9762\u79EF\u5927\u5C0F\u7684\u65F6\u5019\u8BBE\u7F6E\u5355\u4F4D
*/
float newSize = setPickingSize(a_Size);
// float newSize = setPickingSize(a_Size) * 0.00001038445708445579;
// unpack color(vec2)
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
if(u_size_unit == 1.0) {
newSize = newSize * u_PixelsPerMeter.z;
}
v_radius = newSize;
// anti-alias
// float antialiased_blur = -max(u_blur, antialiasblur);
float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur_height_fixed.x);
vec2 offset = (extrude.xy * (newSize + u_stroke_width) + u_offsets);
vec3 aPosition = a_Position;
offset = project_pixel(offset);
offset = rotate_matrix(offset,rotation);
// TODP: /abs(extrude.x) \u662F\u4E3A\u4E86\u517C\u5BB9\u5730\u7403\u6A21\u5F0F
v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);
// vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));
vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));
float raisingHeight = u_blur_height_fixed.y;
if(u_blur_height_fixed.z < 1.0) { // false
raisingHeight = project_pixel(u_blur_height_fixed.y);
} else {
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
raisingHeight = u_blur_height_fixed.y * mapboxZoomScale;
}
}
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, raisingHeight, 1.0));
setPickingColor(a_PickingColor);
}
`;class Bw extends Ml{getCommonUniformsInfo(){const{strokeOpacity:e=1,strokeWidth:r=0,blend:n,blur:a=0,raisingHeight:u=0,heightfixed:y=!1,unit:A="pixel"}=this.layer.getLayerConfig();let O=this.getAnimateUniforms().u_time;isNaN(O)&&(O=-1);const Z={u_blur_height_fixed:[a,Number(u),Number(y)],u_stroke_width:r,u_additive:n==="additive"?1:0,u_stroke_opacity:e,u_size_unit:r1[A],u_time:O,u_animate:this.getAnimateUniforms().u_animate};return this.getUniformsBufferInfo(Z)}getAnimateUniforms(){const{animateOption:e={enable:!1}}=this.layer.getLayerConfig();return{u_animate:this.animateOption2Array(e),u_time:this.layer.getLayerAnimateTime()}}getAttribute(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),r0)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{frag:r,vert:n,type:a}=e.getShaders();return e.layer.triangulation=r0,e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:a,vertexShader:n,fragmentShader:r,inject:e.getInject(),triangulation:r0,depth:{enable:!1}})]})()}getShaders(){return{frag:Y5,vert:$5,type:"pointFill"}}animateOption2Array(e){return[e.enable?0:1,e.speed||1,e.rings||3,0]}registerBuiltinAttributes(){const e=this.layer.getLayerConfig().shape2d;this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Vr.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Ro.EXTRUDE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(r,n,a,u)=>{const y=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],A=u%4*3;return[y[A],y[A+1],y[A+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:r=>{const{size:n=5}=r;return Array.isArray(n)?[n[0]]:[n]}}}),this.styleAttributeService.registerStyleAttribute({name:"shape",type:Vr.Attribute,descriptor:{name:"a_Shape",shaderLocation:Ro.SHAPE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:r=>{const{shape:n=2}=r;return[e.indexOf(n)]}}})}}const K5=`in vec2 v_uv;// \u672C\u8EAB\u7684 uv \u5750\u6807
in vec2 v_Iconuv;
in float v_opacity;
out vec4 outputColor;
uniform sampler2D u_texture;
layout(std140) uniform commonUniform {
vec2 u_textSize;
float u_heightfixed: 0.0;
float u_raisingHeight: 0.0;
float u_size_unit;
};
#pragma include "scene_uniforms"
#pragma include "sdf_2d"
#pragma include "picking"
void main() {
vec2 pos = v_Iconuv / u_textSize + v_uv / u_textSize * 64.;
outputColor = texture(SAMPLER_2D(u_texture), pos);
outputColor.a *= v_opacity;
outputColor = filterColor(outputColor);
}
`,J5=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(location = 11) in vec3 a_Extrude;
layout(location = 14) in vec2 a_Uv;
layout(std140) uniform commonUniform {
vec2 u_textSize;
float u_heightfixed: 0.0;
float u_raisingHeight: 0.0;
float u_size_unit;
};
out vec2 v_uv;
out vec2 v_Iconuv;
out float v_opacity;
#pragma include "projection"
#pragma include "picking"
#pragma include "rotation_2d"
void main() {
vec3 extrude = a_Extrude;
v_uv = (a_Extrude.xy + 1.0)/2.0;
v_uv.y = 1.0 - v_uv.y;
v_Iconuv = a_Uv;
v_opacity = opacity;
float newSize = a_Size;
if(u_size_unit == 1.0) {
newSize = newSize * u_PixelsPerMeter.z;
}
// vec2 offset = (u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);
vec2 offset = (extrude.xy * (newSize) + offsets);
offset = rotate_matrix(offset,rotation);
vec3 aPosition = a_Position;
offset = project_pixel(offset);
vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
float raisingHeight = u_raisingHeight;
if(u_heightfixed < 1.0) { // height fixed
raisingHeight = project_pixel(u_raisingHeight);
} else {
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
raisingHeight = u_raisingHeight * mapboxZoomScale;
}
}
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, 0.0, 1.0));
setPickingColor(a_PickingColor);
}
`;class Q5 extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"meter2coord",1),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"isMeter",!1),(0,K.Z)(this,"radian",0),(0,K.Z)(this,"updateTexture",()=>{const{createTexture2D:r}=this.rendererService;if(this.texture){this.texture.update({data:this.iconService.getCanvas(),mag:"linear",min:"linear mipmap nearest",mipmap:!0}),this.layerService.throttleRenderLayers();return}this.texture=r({data:this.iconService.getCanvas(),mag:Ee.LINEAR,min:Ee.LINEAR_MIPMAP_LINEAR,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128,mipmap:!0}),this.textures=[this.texture]})}getCommonUniformsInfo(){const{raisingHeight:e=0,heightfixed:r=!1,unit:n="pixel"}=this.layer.getLayerConfig();if(this.rendererService.getDirty()){var a;(a=this.texture)===null||a===void 0||a.bind()}const u={u_textSize:[1024,this.iconService.canvasHeight||128],u_heightfixed:Number(r),u_raisingHeight:Number(e),u_size_unit:r1[n]};return this.getUniformsBufferInfo(u)}getAttribute(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),r0)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.iconService.on("imageUpdate",e.updateTexture),e.updateTexture(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointFillImage",vertexShader:J5,fragmentShader:K5,triangulation:r0,depth:{enable:!1},inject:e.getInject(),cull:{enable:!0,face:Tl(e.mapService.version)}})]})()}clearModels(){var e;this.iconService.off("imageUpdate",this.updateTexture),(e=this.texture)===null||e===void 0||e.destroy()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const r=this.iconService.getIconMap(),{shape:n}=e,{x:a,y:u}=r[n]||{x:-64,y:-64};return[a,u]}}}),this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Vr.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Ro.EXTRUDE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a)=>{const u=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],y=a%4*3;return[u[y],u[y+1],u[y+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=5}=e;return Array.isArray(r)?[r[0]]:[r]}}})}}const eM=`layout(std140) uniform commonUniforms {
vec2 u_textSize;
float u_raisingHeight;
float u_heightfixed;
};
uniform sampler2D u_texture;
in vec4 v_color;
in vec2 v_uv;
in float v_opacity;
#pragma include "picking"
out vec4 outputColor;
void main(){
vec2 pos = v_uv / u_textSize + gl_PointCoord / u_textSize * 64.;
vec4 textureColor;
// Y = 0.299R + 0.587G + 0.114B // \u4EAE\u5EA6\u63D0\u53D6
textureColor = texture(SAMPLER_2D(u_texture), pos);
// Tip: \u53BB\u9664\u8FB9\u7F18\u90E8\u5206 mipmap \u5BFC\u81F4\u7684\u6DF7\u5408\u53D8\u6697
float fragmengTocenter = distance(vec2(0.5), gl_PointCoord);
if(fragmengTocenter >= 0.5) {
float luma = 0.299 * textureColor.r + 0.587 * textureColor.g + 0.114 * textureColor.b;
textureColor.a *= luma;
}
if(all(lessThan(v_color, vec4(1.0+0.00001))) && all(greaterThan(v_color, vec4(1.0-0.00001))) || v_color==vec4(1.0)){
outputColor= textureColor;
}else {
outputColor= step(0.01, textureColor.z) * v_color;
}
outputColor.a *= v_opacity;
if (outputColor.a < 0.01) {
discard;
}
outputColor = filterColor(outputColor);
}
`,tM=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(location = 14) in vec2 a_Uv;
layout(std140) uniform commonUniforms {
vec2 u_textSize;
float u_raisingHeight;
float u_heightfixed;
};
out vec4 v_color;
out vec2 v_uv;
out float v_opacity;
#pragma include "projection"
#pragma include "picking"
void main() {
// cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97
v_color = a_Color;
v_opacity = opacity;
v_uv = a_Uv;
vec4 project_pos = project_position(vec4(a_Position, 1.0));
vec2 offset = project_pixel(offsets);
float raisingHeight = u_raisingHeight;
if(u_heightfixed < 1.0) { // false
raisingHeight = project_pixel(u_raisingHeight);
} else {
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
raisingHeight = u_raisingHeight * mapboxZoomScale;
}
}
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, raisingHeight, 1.0));
gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;
setPickingColor(a_PickingColor);
}
`;class Fw extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"updateTexture",()=>{const{createTexture2D:r}=this.rendererService;if(this.texture){this.texture.update({data:this.iconService.getCanvas(),mag:"linear",min:"linear mipmap nearest",mipmap:!0}),setTimeout(()=>{this.layerService.throttleRenderLayers()});return}this.texture=r({data:this.iconService.getCanvas(),mag:Ee.LINEAR,min:Ee.LINEAR_MIPMAP_LINEAR,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128,mipmap:!0})})}getUninforms(){if(this.rendererService.getDirty()){var e;(e=this.texture)===null||e===void 0||e.bind()}const r=this.getCommonUniformsInfo(),n=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},r.uniformsOption),n.uniformsOption)}getCommonUniformsInfo(){const{raisingHeight:e=0,heightfixed:r=!1}=this.layer.getLayerConfig(),n={u_textSize:[1024,this.iconService.canvasHeight||128],u_raisingHeight:Number(e),u_heightfixed:Number(r),u_texture:this.texture};return this.textures=[this.texture],this.getUniformsBufferInfo(n)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.iconService.on("imageUpdate",e.updateTexture),e.updateTexture(),e.buildModels()})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointImage",vertexShader:tM,fragmentShader:eM,triangulation:cC,inject:e.getInject(),depth:{enable:!1},primitive:Ee.POINTS})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=5}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const r=this.iconService.getIconMap(),{shape:n}=e,{x:a,y:u}=r[n]||{x:-64,y:-64};return[a,u]}}})}}const rM=`in vec4 v_color;
out vec4 outputColor;
void main() {
outputColor = v_color;
}`,nM=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(std140) uniform u_Common {
float u_size_scale;
};
out vec4 v_color;
#pragma include "projection"
#pragma include "project"
void main() {
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
gl_Position = u_Mvp * vec4(a_Position, 1.0);
} else {
vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2., -a_Size /2., 0., 0.);
gl_Position = project_common_position_to_clipspace(project_pos);
}
gl_PointSize = a_Size * u_size_scale * 2.0 * u_DevicePixelRatio;
}
`;function kw(t){const e=t.coordinates;return{vertices:[...e],indices:[0],size:e.length}}class Nw extends Ml{getDefaultStyle(){return{blend:"additive"}}getCommonUniformsInfo(){const e={u_size_scale:.5};return this.getUniformsBufferInfo(e)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.layer.triangulation=kw,e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointNormal",vertexShader:nM,fragmentShader:rM,triangulation:kw,inject:e.getInject(),depth:{enable:!1},primitive:Ee.POINTS,pick:!1})]})()}clearModels(){}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0]]:[r]}}})}}const iM=`
layout(std140) uniform commonUniorm{
float u_additive;
float u_size_unit;
float u_speed: 1.0;
float u_time;
};
in vec4 v_data;
in vec4 v_color;
in float v_radius;
in vec2 v_extrude;
#pragma include "sdf_2d"
#pragma include "picking"
out vec4 outputColor;
void main() {
lowp float antialiasblur = v_data.z;
float r = v_radius / (v_radius);
float outer_df = sdCircle(v_data.xy, 1.0);
float inner_df = sdCircle(v_data.xy, r);
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
outputColor = vec4(v_color.rgb, v_color.a);
if(u_additive > 0.0) {
outputColor *= opacity_t;
} else {
outputColor.a *= opacity_t;
}
if(outputColor.a > 0.0) {
outputColor = filterColor(outputColor);
}
vec2 extrude = v_extrude;
vec2 dir = normalize(extrude);
vec2 baseDir = vec2(1.0, 0.0);
float pi = 3.14159265359;
float flag = sign(dir.y);
float rades = dot(dir, baseDir);
float radar_v = (flag - 1.0) * -0.5 * acos(rades)/pi;
// simple AA
if(radar_v > 0.99) {
radar_v = 1.0 - (radar_v - 0.99)/0.01;
}
outputColor.a *= radar_v;
}
`,oM=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(location = 11) in vec3 a_Extrude;
layout(std140) uniform commonUniorm {
float u_additive;
float u_size_unit;
float u_speed: 1.0;
float u_time;
};
out vec4 v_data;
out vec4 v_color;
out float v_radius;
out vec2 v_extrude;
#pragma include "projection"
#pragma include "picking"
void main() {
float newSize = setPickingSize(a_Size);
float time = u_time * u_speed;
mat2 rotateMatrix = mat2(
cos(time), sin(time),
-sin(time), cos(time)
);
v_extrude = rotateMatrix * a_Extrude.xy;
v_color = a_Color;
v_color.a *= opacity;
float blur = 0.0;
float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur);
if(u_size_unit == 1.) {
newSize = newSize * u_PixelsPerMeter.z;
}
v_radius = newSize;
vec2 offset = (a_Extrude.xy * (newSize));
vec3 aPosition = a_Position;
offset = project_pixel(offset);
v_data = vec4(a_Extrude.x, a_Extrude.y, antialiasblur, -1.0);
vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));
setPickingColor(a_PickingColor);
}
`;class aM extends Ml{getCommonUniformsInfo(){const{blend:e,speed:r=1,unit:n="pixel"}=this.layer.getLayerConfig(),a={u_additive:e==="additive"?1:0,u_size_unit:r1[n],u_speed:r,u_time:this.layer.getLayerAnimateTime()};return this.getUniformsBufferInfo(a)}getAnimateUniforms(){return{}}getAttribute(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),r0)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointRadar",vertexShader:oM,fragmentShader:iM,triangulation:r0,inject:e.getInject(),depth:{enable:!1}})]})()}animateOption2Array(e){return[e.enable?0:1,e.speed||1,e.rings||3,0]}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Vr.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Ro.EXTRUDE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a)=>{const u=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],y=a%4*3;return[u[y],u[y+1],u[y+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{shaderLocation:Ro.SIZE,name:"a_Size",buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=5}=e;return Array.isArray(r)?[r[0]]:[r]}}})}}class sM{constructor(e,r,n){(0,K.Z)(this,"boxCells",[]),(0,K.Z)(this,"xCellCount",void 0),(0,K.Z)(this,"yCellCount",void 0),(0,K.Z)(this,"boxKeys",void 0),(0,K.Z)(this,"bboxes",void 0),(0,K.Z)(this,"width",void 0),(0,K.Z)(this,"height",void 0),(0,K.Z)(this,"xScale",void 0),(0,K.Z)(this,"yScale",void 0),(0,K.Z)(this,"boxUid",void 0);const a=this.boxCells;this.xCellCount=Math.ceil(e/n),this.yCellCount=Math.ceil(r/n);for(let u=0;u<this.xCellCount*this.yCellCount;u++)a.push([]);this.boxKeys=[],this.bboxes=[],this.width=e,this.height=r,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/r,this.boxUid=0}insert(e,r,n,a,u){this.forEachCell(r,n,a,u,this.insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(a),this.bboxes.push(u)}query(e,r,n,a,u){return this.queryHitTest(e,r,n,a,!1,u)}hitTest(e,r,n,a,u){return this.queryHitTest(e,r,n,a,!0,u)}insertBoxCell(e,r,n,a,u,y){this.boxCells[u].push(y)}queryHitTest(e,r,n,a,u,y){if(n<0||e>this.width||a<0||r>this.height)return u?!1:[];const A=[];if(e<=0&&r<=0&&this.width<=n&&this.height<=a){if(u)return!0;for(let Z=0;Z<this.boxKeys.length;Z++)A.push({key:this.boxKeys[Z],x1:this.bboxes[Z*4],y1:this.bboxes[Z*4+1],x2:this.bboxes[Z*4+2],y2:this.bboxes[Z*4+3]});return y?A.filter(y):A}const O={hitTest:u,seenUids:{box:{},circle:{}}};return this.forEachCell(e,r,n,a,this.queryCell,A,O,y),u?A.length>0:A}queryCell(e,r,n,a,u,y,A,O){const Z=A.seenUids,Y=this.boxCells[u];if(Y!==null){const Q=this.bboxes;for(const ae of Y)if(!Z.box[ae]){Z.box[ae]=!0;const xe=ae*4;if(e<=Q[xe+2]&&r<=Q[xe+3]&&n>=Q[xe+0]&&a>=Q[xe+1]&&(!O||O(this.boxKeys[ae]))){if(A.hitTest)return y.push(!0),!0;y.push({key:this.boxKeys[ae],x1:Q[xe],y1:Q[xe+1],x2:Q[xe+2],y2:Q[xe+3]})}}}return!1}forEachCell(e,r,n,a,u,y,A,O){const Z=this.convertToXCellCoord(e),Y=this.convertToYCellCoord(r),Q=this.convertToXCellCoord(n),ae=this.convertToYCellCoord(a);for(let xe=Z;xe<=Q;xe++)for(let Be=Y;Be<=ae;Be++){const it=this.xCellCount*Be+xe;if(u.call(this,e,r,n,a,it,y,A,O))return}}convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}}var lM=sM;class uM{constructor(e,r){(0,K.Z)(this,"width",void 0),(0,K.Z)(this,"height",void 0),(0,K.Z)(this,"grid",void 0),(0,K.Z)(this,"viewportPadding",100),(0,K.Z)(this,"screenRightBoundary",void 0),(0,K.Z)(this,"screenBottomBoundary",void 0),(0,K.Z)(this,"gridRightBoundary",void 0),(0,K.Z)(this,"gridBottomBoundary",void 0),this.width=e,this.height=r,this.viewportPadding=Math.max(e,r),this.grid=new lM(e+this.viewportPadding,r+this.viewportPadding,25),this.screenRightBoundary=e+this.viewportPadding,this.screenBottomBoundary=r+this.viewportPadding,this.gridRightBoundary=e+2*this.viewportPadding,this.gridBottomBoundary=r+2*this.viewportPadding}placeCollisionBox(e){const r=e.x1+e.anchorPointX+this.viewportPadding,n=e.y1+e.anchorPointY+this.viewportPadding,a=e.x2+e.anchorPointX+this.viewportPadding,u=e.y2+e.anchorPointY+this.viewportPadding;return!this.isInsideGrid(r,n,a,u)||this.grid.hitTest(r,n,a,u)?{box:[]}:{box:[r,n,a,u]}}insertCollisionBox(e,r){const n={featureIndex:r};this.grid.insert(n,e[0],e[1],e[2],e[3])}project(e,r,n){const a=mh.fromValues(r,n,0,1),u=mh.create(),y=Kr.fromValues(...e);return mh.transformMat4(u,a,y),{x:(u[0]/u[3]+1)/2*this.width+this.viewportPadding,y:(-u[1]/u[3]+1)/2*this.height+this.viewportPadding}}isInsideGrid(e,r,n,a){return n>=0&&e<this.gridRightBoundary&&a>=0&&r<this.gridBottomBoundary}}function zw(t){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0;break;default:e=.5}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0;break;default:r=.5}return{horizontalAlign:e,verticalAlign:r}}function Uw(t,e,r,n,a){if(!a)return;const u=t[n],y=u.glyph;if(y){const A=e[y].advance*u.scale,O=(t[n].x+A)*a;for(let Z=r;Z<=n;Z++)t[Z].x-=O}}function Zw(t,e,r,n,a,u,y){const A=(e-r)*a,O=(-n*y+.5)*u;for(const Z of t)Z.x+=A,Z.y+=O}function cM(t,e,r,n,a,u,y){let O=0,Z=-8,Y=0;const Q=t.positionedGlyphs,ae=u==="right"?1:u==="left"?0:.5,xe=Q.length;r.forEach(Bt=>{if(Bt.split("").forEach(Rt=>{const Yt=e[Rt],vr=0;Yt&&(Q.push({glyph:Rt,x:O,y:Z+vr,vertical:!1,scale:1,metrics:Yt}),O+=Yt.advance+y)}),Q.length!==xe){const Rt=O-y;Y=Math.max(Rt,Y),Uw(Q,e,xe,Q.length-1,ae)}O=0,Z-=n+5});const{horizontalAlign:Be,verticalAlign:it}=zw(a);Zw(Q,ae,Be,it,Y,n,r.length);const gt=Z- -8;t.top+=-it*gt,t.bottom=t.top-gt,t.left+=-Be*Y,t.right=t.left+Y}function hM(t,e,r,n,a,u,y){let O=0,Z=-8,Y=0;const Q=t.positionedGlyphs,ae=u==="right"?1:u==="left"?0:.5,xe=Q.length;r.forEach(Bt=>{const Rt=e[Bt],Yt=0;if(Rt&&(Q.push({glyph:Bt,x:Rt.advance/2,y:Z+Yt,vertical:!1,scale:1,metrics:Rt}),O+=Rt.advance+y),Q.length!==xe){const vr=O-y;Y=Math.max(vr,Y),Uw(Q,e,xe,Q.length-1,ae)}O=0,Z-=n+5});const{horizontalAlign:Be,verticalAlign:it}=zw(a);Zw(Q,ae,Be,it,Y,n,r.length);const gt=Z- -8;t.top+=-it*gt,t.bottom=t.top-gt,t.left+=-Be*Y,t.right=t.left+Y}function pM(t,e,r,n,a,u,y=[0,0],A){const O=t.split(`
`),Z=[],Y={positionedGlyphs:Z,top:y[1],bottom:y[1],left:y[0],right:y[0],lineCount:O.length,text:t};return A?hM(Y,e,O,r,n,a,u):cM(Y,e,O,r,n,a,u),Z.length?Y:!1}function fM(t,e=[0,0],r){const{positionedGlyphs:n=[]}=t,a=[];for(const u of n){const y=u.metrics,A=4,O=y.advance*u.scale/2,Z=r?[u.x+O,u.y]:[0,0],Y=r?[0,0]:[u.x+O+e[0],u.y+e[1]],Q=(0-A)*u.scale-O+Y[0],ae=(0-A)*u.scale+Y[1],xe=Q+y.width*u.scale,Be=ae+y.height*u.scale,it={x:Q,y:ae},gt={x:xe,y:ae},Bt={x:Q,y:Be},Rt={x:xe,y:Be};a.push({tl:it,tr:gt,bl:Bt,br:Rt,tex:y,glyphOffset:Z})}return a}const Vw=`#define SDF_PX 8.0
#define EDGE_GAMMA 0.105
#define FONT_SIZE 48.0
uniform sampler2D u_sdf_map;
layout(std140) uniform commonUniforms {
vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
vec2 u_sdf_map_size;
float u_raisingHeight: 0.0;
float u_stroke_width : 2;
float u_gamma_scale : 0.5;
float u_halo_blur : 0.5;
};
in vec2 v_uv;
in float v_gamma_scale;
in vec4 v_color;
in vec4 v_stroke_color;
in float v_fontScale;
out vec4 outputColor;
#pragma include "picking"
void main() {
// get style data mapping
// get sdf from atlas
float dist = texture(SAMPLER_2D(u_sdf_map), v_uv).a;
lowp float buff = (6.0 - u_stroke_width / v_fontScale) / SDF_PX;
highp float gamma = (u_halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (v_fontScale * u_gamma_scale) / 1.0;
highp float gamma_scaled = gamma * v_gamma_scale;
highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);
outputColor = mix(v_color, v_stroke_color, smoothstep(0., 0.5, 1.- dist));
outputColor.a *= alpha;
// \u4F5C\u4E3A mask \u6A21\u677F\u65F6\u9700\u8981\u4E22\u5F03\u900F\u660E\u7684\u50CF\u7D20
if (outputColor.a < 0.01) {
discard;
}
outputColor = filterColor(outputColor);
}
`,jw=`#define SDF_PX 8.0
#define EDGE_GAMMA 0.105
#define FONT_SIZE 24.0
layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(location = 10) in vec2 a_textOffsets;
layout(location = 14) in vec2 a_tex;
layout(std140) uniform commonUniforms {
vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
vec2 u_sdf_map_size;
float u_raisingHeight: 0.0;
float u_stroke_width : 2;
float u_gamma_scale : 0.5;
float u_halo_blur : 0.5;
};
out vec2 v_uv;
out float v_gamma_scale;
out vec4 v_color;
out vec4 v_stroke_color;
out float v_fontScale;
#pragma include "projection"
#pragma include "picking"
#pragma include "rotation_2d"
void main() {
// cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97
v_uv = a_tex / u_sdf_map_size;
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
v_stroke_color = vec4(u_stroke_color.xyz, u_stroke_color.w * opacity);
// \u6587\u672C\u7F29\u653E\u6BD4\u4F8B
float fontScale = a_Size / FONT_SIZE;
v_fontScale = fontScale;
vec4 project_pos = project_position(vec4(a_Position, 1.0));
// vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
vec2 offset = rotate_matrix(a_textOffsets,rotation);
// gl_Position = vec4(projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);
float raiseHeight = u_raisingHeight;
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
raiseHeight = u_raisingHeight * mapboxZoomScale;
}
vec4 projected_position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));
gl_Position = vec4(
projected_position.xy / projected_position.w + offset * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);
v_gamma_scale = gl_Position.w;
setPickingColor(a_PickingColor);
}
`,{isEqual:p_}=es;function Hw(t){const e=this,r=t.id,n=[],a=[];if(!e.glyphInfoMap||!e.glyphInfoMap[r])return{vertices:[],indices:[],size:7};const u=e.glyphInfoMap[r].centroid,y=u.length===2?[u[0],u[1],0]:u;return e.glyphInfoMap[r].glyphQuads.forEach((A,O)=>{n.push(...y,A.tex.x,A.tex.y+A.tex.height,A.tl.x,A.tl.y,...y,A.tex.x+A.tex.width,A.tex.y+A.tex.height,A.tr.x,A.tr.y,...y,A.tex.x+A.tex.width,A.tex.y,A.br.x,A.br.y,...y,A.tex.x,A.tex.y,A.bl.x,A.bl.y),a.push(0+O*4,1+O*4,2+O*4,2+O*4,3+O*4,0+O*4)}),{vertices:n,indices:a,size:7}}class Gw extends Ml{constructor(...e){var r;super(...e),r=this,(0,K.Z)(this,"glyphInfo",void 0),(0,K.Z)(this,"glyphInfoMap",{}),(0,K.Z)(this,"rawEncodeData",void 0),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"currentZoom",-1),(0,K.Z)(this,"extent",void 0),(0,K.Z)(this,"textureHeight",0),(0,K.Z)(this,"textCount",0),(0,K.Z)(this,"preTextStyle",{}),(0,K.Z)(this,"mapping",(0,Nr.Z)(function*(){r.initGlyph(),r.updateTexture(),yield r.reBuildModel()}))}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption),{u_sdf_map:this.textures[0]})}getCommonUniformsInfo(){const{stroke:e="#fff",strokeWidth:r=0,halo:n=.5,gamma:a=2,raisingHeight:u=0}=this.layer.getLayerConfig(),y=this.getFontServiceMapping(),A=this.getFontServiceCanvas();y&&Object.keys(y).length!==this.textCount&&A&&(this.updateTexture(),this.textCount=Object.keys(y).length),this.preTextStyle=this.getTextStyle();const O={u_stroke_color:Va(e),u_sdf_map_size:[(A==null?void 0:A.width)||1,(A==null?void 0:A.height)||1],u_raisingHeight:Number(u),u_stroke_width:r,u_gamma_scale:a,u_halo_blur:n};return this.getUniformsBufferInfo(O)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.bindEvent(),e.extent=e.textExtent(),e.rawEncodeData=e.layer.getEncodedData(),e.preTextStyle=e.getTextStyle(),e.initUniformsBuffer(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{textAllowOverlap:r=!1}=e.layer.getLayerConfig();return e.initGlyph(),e.updateTexture(),r||e.filterGlyphs(),[yield e.layer.buildLayerModel({moduleName:"pointText",vertexShader:jw,fragmentShader:Vw,inject:e.getInject(),triangulation:Hw.bind(e),depth:{enable:!1}})]})()}needUpdate(){var e=this;return(0,Nr.Z)(function*(){const{textAllowOverlap:r=!1,textAnchor:n="center",textOffset:a,padding:u,fontFamily:y,fontWeight:A}=e.getTextStyle();if(!p_(u,e.preTextStyle.padding)||!p_(a,e.preTextStyle.textOffset)||!p_(n,e.preTextStyle.textAnchor)||!p_(y,e.preTextStyle.fontFamily)||!p_(A,e.preTextStyle.fontWeight))return yield e.mapping(),!0;if(r)return!1;const O=e.mapService.getZoom(),Z=e.mapService.getBounds(),Y=is(e.extent,Z);return Math.abs(e.currentZoom-O)>.5||!Y||r!==e.preTextStyle.textAllowOverlap?(yield e.reBuildModel(),!0):!1})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy(),this.layer.off("remapping",this.mapping)}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"textOffsets",type:Vr.Attribute,descriptor:{shaderLocation:10,name:"a_textOffsets",buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[5],n[6]]}}),this.styleAttributeService.registerStyleAttribute({name:"textUv",type:Vr.Attribute,descriptor:{name:"a_tex",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=12}=e;return Array.isArray(r)?[r[0]]:[r]}}})}bindEvent(){this.layer.isTileLayer||this.layer.on("remapping",this.mapping)}textExtent(){const e=this.mapService.getBounds();return ai(e,.5)}initTextFont(){const{fontWeight:e,fontFamily:r}=this.getTextStyle(),n=this.rawEncodeData,a=[];n.forEach(u=>{let{shape:y=""}=u;y=y.toString();for(const A of y)a.indexOf(A)===-1&&a.push(A)}),this.fontService.setFontOptions({characterSet:a,fontWeight:e,fontFamily:r,iconfont:!1})}initIconFontTex(){const{fontWeight:e,fontFamily:r}=this.getTextStyle(),n=this.rawEncodeData,a=[];n.forEach(u=>{let{shape:y=""}=u;y=`${y}`,a.indexOf(y)===-1&&a.push(y)}),this.fontService.setFontOptions({characterSet:a,fontWeight:e,fontFamily:r,iconfont:!0})}getTextStyle(){const{fontWeight:e="400",fontFamily:r="sans-serif",textAllowOverlap:n=!1,padding:a=[0,0],textAnchor:u="center",textOffset:y=[0,0],opacity:A=1,strokeOpacity:O=1,strokeWidth:Z=0,stroke:Y="#000"}=this.layer.getLayerConfig();return{fontWeight:e,fontFamily:r,textAllowOverlap:n,padding:a,textAnchor:u,textOffset:y,opacity:A,strokeOpacity:O,strokeWidth:Z,stroke:Y}}generateGlyphLayout(e){const r=this.getFontServiceMapping(),{spacing:n=2,textAnchor:a="center",textOffset:u}=this.layer.getLayerConfig(),y=this.rawEncodeData;this.glyphInfo=y.map(A=>{const{shape:O="",id:Z,size:Y=1}=A,Q=A.textOffset?A.textOffset:u||[0,0],ae=A.textAnchor?A.textAnchor:a||"center",xe=pM(O.toString(),r,Y,ae,"left",n,Q,e),Be=fM(xe,Q,!1);return A.shaping=xe,A.glyphQuads=Be,A.centroid=Pc(A.coordinates),A.originCentroid=A.version==="GAODE2.x"?Pc(A.originCoordinates):A.originCentroid=A.centroid,this.glyphInfoMap[Z]={shaping:xe,glyphQuads:Be,centroid:Pc(A.coordinates)},A})}getFontServiceMapping(){const{fontWeight:e="400",fontFamily:r="sans-serif"}=this.layer.getLayerConfig();return this.fontService.getMappingByKey(`${r}_${e}`)}getFontServiceCanvas(){const{fontWeight:e="400",fontFamily:r="sans-serif"}=this.layer.getLayerConfig();return this.fontService.getCanvasByKey(`${r}_${e}`)}filterGlyphs(){const{padding:e=[0,0],textAllowOverlap:r=!1}=this.layer.getLayerConfig();if(r)return;this.glyphInfoMap={},this.currentZoom=this.mapService.getZoom(),this.extent=this.textExtent();const{width:n,height:a}=this.rendererService.getViewportSize(),u=new uM(n,a);this.glyphInfo.filter(A=>{const{shaping:O,id:Z=0}=A,Y=A.version==="GAODE2.x"?A.originCentroid:A.centroid,ae=A.size/16,xe=this.mapService.lngLatToContainer(Y),{box:Be}=u.placeCollisionBox({x1:O.left*ae-e[0],x2:O.right*ae+e[0],y1:O.top*ae-e[1],y2:O.bottom*ae+e[1],anchorPointX:xe.x,anchorPointY:xe.y});return Be&&Be.length?(u.insertCollisionBox(Be,Z),!0):!1}).forEach(A=>{this.glyphInfoMap[A.id]=A})}initGlyph(){const{iconfont:e=!1}=this.layer.getLayerConfig();e?this.initIconFontTex():this.initTextFont(),this.generateGlyphLayout(e)}updateTexture(){const{createTexture2D:e}=this.rendererService,r=this.getFontServiceCanvas();this.textureHeight=r.height,this.texture&&this.texture.destroy(),this.texture=e({data:r,mag:Ee.LINEAR,min:Ee.LINEAR,width:r.width,height:r.height}),this.textures=[this.texture]}reBuildModel(){var e=this;return(0,Nr.Z)(function*(){e.filterGlyphs();const r=yield e.layer.buildLayerModel({moduleName:"pointText",vertexShader:jw,fragmentShader:Vw,triangulation:Hw.bind(e),inject:e.getInject(),depth:{enable:!1}});e.layer.models=[r]})()}}var dM={fillImage:Q5,fill:Bw,radar:aM,image:Fw,normal:Nw,simplePoint:z5,extrude:Ow,text:Gw,earthFill:W5,earthExtrude:j5};class l1 extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","PointLayer"),(0,K.Z)(this,"enableShaderEncodeStyles",["stroke","offsets","opacity","rotation"]),(0,K.Z)(this,"enableDataEncodeStyles",["textOffset","textAnchor"]),(0,K.Z)(this,"defaultSourceConfig",{data:[],options:{parser:{type:"json",x:"lng",y:"lat"}}})}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel&&e.layerModel.clearModels(),e.layerModel=new dM[r](e),yield e.initLayerModels()})()}rebuildModels(){var e=this;return(0,Nr.Z)(function*(){yield e.buildModels()})()}getModelTypeWillEmptyData(){if(this.shapeOption){const{field:e,values:r}=this.shapeOption,{shape2d:n}=this.getLayerConfig(),a=this.iconService.getIconMap();if(e&&(n==null?void 0:n.indexOf(e))!==-1)return"fill";if(r==="text")return"text";if(r&&r instanceof Array){for(const u of r)if(typeof u=="string"&&a.hasOwnProperty(u))return"image"}}return"normal"}getDefaultConfig(){const e=this.getModelType();return{fillImage:{},normal:{blend:"additive"},radar:{},simplePoint:{},fill:{blend:"normal"},extrude:{},image:{},text:{blend:"normal"},tile:{},tileText:{},earthFill:{},earthExtrude:{}}[e]}getModelType(){const e=this.getEncodedData(),{shape2d:r,shape3d:n,billboard:a=!0}=this.getLayerConfig(),u=this.iconService.getIconMap(),y=e.find(A=>A.hasOwnProperty("shape"));if(y){const A=y.shape;return A==="dot"?"normal":A==="simple"?"simplePoint":A==="radar"?"radar":this.layerType==="fillImage"||a===!1?"fillImage":(r==null?void 0:r.indexOf(A))!==-1?this.mapService.version==="GLOBEL"?"earthFill":"fill":(n==null?void 0:n.indexOf(A))!==-1?this.mapService.version==="GLOBEL"?"earthExtrude":"extrude":u.hasOwnProperty(A)?"image":"text"}else return this.getModelTypeWillEmptyData()}}function mM(t){return g2.apply(this,arguments)}function g2(){return g2=(0,Nr.Z)(function*(t){if(window.createImageBitmap){const e=yield fetch(t);return yield createImageBitmap(yield e.blob())}else{const e=new window.Image;return new Promise(r=>{e.onload=()=>r(e),e.src=t,e.crossOrigin="Anonymous"})}}),g2.apply(this,arguments)}const gM=`layout(std140) uniform commonUniforms {
vec4 u_sourceColor;
vec4 u_targetColor;
float u_linearColor;
float u_topsurface;
float u_sidesurface;
float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
float u_raisingHeight;
};
in vec4 v_Color;
#pragma include "scene_uniforms"
#pragma include "picking"
out vec4 outputColor;
void main() {
// top face
if(u_topsurface < 1.0) {
discard;
}
outputColor = v_Color;
outputColor = filterColor(outputColor);
}
`,vM=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(location = 13) in vec3 a_Normal;
layout(location = 14) in vec3 a_uvs;
layout(std140) uniform commonUniforms {
vec4 u_sourceColor;
vec4 u_targetColor;
float u_linearColor;
float u_topsurface;
float u_sidesurface;
float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
float u_raisingHeight;
};
out vec4 v_Color;
#pragma include "projection"
#pragma include "light"
#pragma include "picking"
void main() {
float isSide = a_Position.z;
float topU = a_uvs[0];
float topV = 1.0 - a_uvs[1];
float sidey = a_uvs[2];
vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);
float lightWeight = calc_lighting(pos);
vec4 project_pos = project_position(pos);
if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6
project_pos.z = a_Position.z * a_Size;
project_pos.z += u_raisingHeight;
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
project_pos.z *= mapboxZoomScale;
project_pos.z += u_raisingHeight * mapboxZoomScale;
}
}
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
// Tip: \u90E8\u5206\u673A\u578B GPU \u8BA1\u7B97\u7CBE\u5EA6\u517C\u5BB9
if(isSide < 0.999) {
// side face
// if(u_sidesurface < 1.0) {
// discard;
// }
if(u_linearColor == 1.0) {
vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);
linearColor.rgb *= lightWeight;
v_Color = linearColor;
} else {
v_Color = a_Color;
}
} else {
v_Color = a_Color;
}
v_Color = vec4(v_Color.rgb * lightWeight, v_Color.w * opacity);
setPickingColor(a_PickingColor);
}
`,_M=`uniform sampler2D u_texture;
layout(std140) uniform commonUniforms {
vec4 u_sourceColor;
vec4 u_targetColor;
float u_linearColor;
float u_topsurface;
float u_sidesurface;
float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
float u_raisingHeight;
};
in vec4 v_Color;
in vec3 v_uvs;
in vec2 v_texture_data;
#pragma include "scene_uniforms"
#pragma include "picking"
out vec4 outputColor;
void main() {
float opacity = u_opacity;
float isSide = v_texture_data.x;
float lightWeight = v_texture_data.y;
float topU = v_uvs[0];
float topV = 1.0 - v_uvs[1];
float sidey = v_uvs[2];
outputColor = texture(SAMPLER_2D(u_texture), vec2(topU, topV));
// Tip: \u90E8\u5206\u673A\u578B GPU \u8BA1\u7B97\u7CBE\u5EA6\u517C\u5BB9
if (isSide < 0.999) {// \u662F\u5426\u662F\u8FB9\u7F18
// side face
if (u_sidesurface < 1.0) {
discard;
}
if (u_linearColor == 1.0) {
vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);
linearColor.rgb *= lightWeight;
outputColor = linearColor;
} else {
outputColor = v_Color;
}
} else {
// top face
if (u_topsurface < 1.0) {
discard;
}
}
outputColor.a *= opacity;
outputColor = filterColor(outputColor);
}
`,yM=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(location = 13) in vec3 a_Normal;
layout(location = 14) in vec3 a_uvs;
layout(std140) uniform commonUniforms {
vec4 u_sourceColor;
vec4 u_targetColor;
float u_linearColor;
float u_topsurface;
float u_sidesurface;
float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
float u_raisingHeight;
};
out vec4 v_Color;
out vec3 v_uvs;
out vec2 v_texture_data;
#pragma include "projection"
#pragma include "light"
#pragma include "picking"
void main() {
vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);
float lightWeight = calc_lighting(pos);
vec4 project_pos = project_position(pos);
v_uvs = a_uvs;
v_Color = a_Color;
v_Color.a *= opacity;
v_texture_data = vec2(a_Position.z, lightWeight);
if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6
project_pos.z = a_Position.z * a_Size;
project_pos.z += u_raisingHeight;
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
project_pos.z *= mapboxZoomScale;
project_pos.z += u_raisingHeight * mapboxZoomScale;
}
}
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
setPickingColor(a_PickingColor);
}
`,xM=`
layout(std140) uniform commonUniforms {
vec4 u_sourceColor;
vec4 u_targetColor;
float u_linearColor;
float u_topsurface;
float u_sidesurface;
float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
float u_raisingHeight;
};
in vec4 v_Color;
in vec3 v_uvs;
in vec2 v_texture_data;
out vec4 outputColor;
#pragma include "scene_uniforms"
#pragma include "picking"
void main() {
float isSide = v_texture_data.x;
float sidey = v_uvs[2];
float lightWeight = v_texture_data.y;
// Tip: \u90E8\u5206\u673A\u578B GPU \u8BA1\u7B97\u7CBE\u5EA6\u517C\u5BB9
if(isSide < 0.999) {
// side face
if(u_sidesurface < 1.0) {
discard;
}
if( u_linearColor == 1.0) {
// side use linear
vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);
linearColor.rgb *= lightWeight;
outputColor = linearColor;
} else {
// side notuse linear
outputColor = v_Color;
}
} else {
// top face
if(u_topsurface < 1.0) {
discard;
}
outputColor = v_Color;
}
outputColor = filterColorAlpha(outputColor, lightWeight);
}
`,bM=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(location = 13) in vec3 a_Normal;
layout(location = 14) in vec3 a_uvs;
layout(std140) uniform commonUniforms {
vec4 u_sourceColor;
vec4 u_targetColor;
float u_linearColor;
float u_topsurface;
float u_sidesurface;
float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
float u_raisingHeight;
};
out vec4 v_Color;
out vec3 v_uvs;
out vec2 v_texture_data;
#pragma include "projection"
#pragma include "light"
#pragma include "picking"
void main() {
v_uvs = a_uvs;
// cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97
vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);
vec4 project_pos = project_position(pos);
if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6
project_pos.z = a_Position.z * a_Size;
project_pos.z += u_raisingHeight;
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
project_pos.z *= mapboxZoomScale;
project_pos.z += u_raisingHeight * mapboxZoomScale;
}
}
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
float lightWeight = calc_lighting(pos);
v_texture_data = vec2(a_Position.z,lightWeight);
v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);
setPickingColor(a_PickingColor);
}
`;class EM extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0)}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{mapTexture:e,heightfixed:r=!1,raisingHeight:n=0,topsurface:a=!0,sidesurface:u=!0,sourceColor:y,targetColor:A}=this.layer.getLayerConfig();let O=0,Z=[1,1,1,1],Y=[1,1,1,1];y&&A&&(Z=Va(y),Y=Va(A),O=1);const Q={u_sourceColor:Z,u_targetColor:Y,u_linearColor:O,u_topsurface:Number(a),u_sidesurface:Number(u),u_heightfixed:Number(r),u_raisingHeight:Number(n)};return e&&this.texture&&(Q.u_texture=this.texture,this.textures=[this.texture]),this.getUniformsBufferInfo(Q)}initModels(){var e=this;return(0,Nr.Z)(function*(){return yield e.loadTexture(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{frag:r,vert:n,type:a}=e.getShaders();return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:a,vertexShader:n,fragmentShader:r,depth:{enable:!0},inject:e.getInject(),triangulation:f2})]})()}getShaders(){const{pickLight:e,mapTexture:r}=this.layer.getLayerConfig();return r?{frag:_M,vert:yM,type:"polygonExtrudeTexture"}:e?{frag:xM,vert:bM,type:"polygonExtrudePickLight"}:{frag:gM,vert:vM,type:"polygonExtrude"}}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy(),this.textures=[]}registerBuiltinAttributes(){const e=this.layer.getSource().extent;let r=e;const n=this.layer.coordCenter||this.layer.getSource().center;let a=r[2]-r[0],u=r[3]-r[1];if(this.mapService.version==="GAODE2.x"){const[y,A]=this.mapService.coordToAMap2RelativeCoordinates([e[0],e[1]],n),[O,Z]=this.mapService.coordToAMap2RelativeCoordinates([e[2],e[3]],n);a=O-y,u=Z-A,r=[y,A,O,Z]}this.styleAttributeService.registerStyleAttribute({name:"uvs",type:Vr.Attribute,descriptor:{name:"a_uvs",shaderLocation:Ro.UV,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(y,A,O)=>{const Z=O[0],Y=O[1];return[(Z-r[0])/a,(Y-r[1])/u,O[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(y,A,O,Z,Y)=>Y}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:y=>{const{size:A=10}=y;return Array.isArray(A)?[A[0]]:[A]}}})}loadTexture(){var e=this;return(0,Nr.Z)(function*(){const{mapTexture:r}=e.layer.getLayerConfig(),{createTexture2D:n}=e.rendererService;if(e.texture=n({height:1,width:1}),r){const a=yield mM(r);e.texture=n({data:a,width:a.width,height:a.height,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE,min:Ee.LINEAR,mag:Ee.LINEAR})}})()}}const wM=`
in vec4 v_Color;
#pragma include "scene_uniforms"
#pragma include "picking"
out vec4 outputColor;
void main() {
outputColor = v_Color;
outputColor = filterColor(outputColor);
}
`,SM=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 9) in float a_Size;
layout(location = 13) in vec3 a_Normal;
out vec4 v_Color;
#pragma include "projection"
#pragma include "light"
#pragma include "picking"
void main() {
vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size + (1.0 - a_Position.z) * extrusionBase, 1.0);
vec4 project_pos = project_position(pos);
float lightWeight = calc_lighting(project_pos);
v_Color = a_Color;
v_Color = vec4(v_Color.rgb * lightWeight, v_Color.w * opacity);
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
setPickingColor(a_PickingColor);
}
`;class TM extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0)}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const e={};return this.getUniformsBufferInfo(e)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{frag:r,vert:n,type:a}=e.getShaders();return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:a,vertexShader:n,fragmentShader:r,inject:e.getInject(),triangulation:f2,depth:{enable:!0}})]})()}getShaders(){return{frag:wM,vert:SM,type:"polygonExtrude"}}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=10}=e;return Array.isArray(r)?[r[0]]:[r]}}})}}const AM=`in vec4 v_color;
#pragma include "scene_uniforms"
#pragma include "picking"
out vec4 outputColor;
void main() {
outputColor = v_color;
outputColor = filterColor(outputColor);
}
`,CM=`
layout(std140) uniform commonUniforms {
float u_raisingHeight;
float u_opacitylinear;
float u_dir;
};
in vec4 v_color;
in vec3 v_linear;
in vec2 v_pos;
out vec4 outputColor;
#pragma include "scene_uniforms"
#pragma include "picking"
void main() {
outputColor = v_color;
if (u_opacitylinear > 0.0) {
outputColor.a *= u_dir == 1.0 ? 1.0 - length(v_pos - v_linear.xy)/v_linear.z : length(v_pos - v_linear.xy)/v_linear.z;
}
outputColor = filterColor(outputColor);
}
`,MM=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 15) in vec3 a_linear;
layout(std140) uniform commonUniforms {
float u_raisingHeight;
float u_opacitylinear;
float u_dir;
};
out vec4 v_color;
out vec3 v_linear;
out vec2 v_pos;
#pragma include "projection"
#pragma include "picking"
void main() {
if (u_opacitylinear > 0.0) {
v_linear = a_linear;
v_pos = a_Position.xy;
}
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
vec4 project_pos = project_position(vec4(a_Position, 1.0));
project_pos.z += u_raisingHeight;
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
project_pos.z *= mapboxZoomScale;
project_pos.z += u_raisingHeight * mapboxZoomScale;
}
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
setPickingColor(a_PickingColor);
}`,PM=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(std140) uniform commonUniforms {
float u_raisingHeight;
};
out vec4 v_color;
#pragma include "projection"
#pragma include "picking"
void main() {
// cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97
// cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
vec4 project_pos = project_position(vec4(a_Position, 1.0));
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
project_pos.z += u_raisingHeight;
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
project_pos.z *= mapboxZoomScale;
project_pos.z += u_raisingHeight * mapboxZoomScale;
}
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
setPickingColor(a_PickingColor);
}
`;class RM extends Ml{getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{raisingHeight:e=0,opacityLinear:r={enable:!1,dir:"in"}}=this.layer.getLayerConfig(),n={u_raisingHeight:Number(e),u_opacitylinear:Number(r.enable),u_dir:r.dir==="in"?1:0};return this.getUniformsBufferInfo(n)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{frag:r,vert:n,triangulation:a,type:u}=e.getModelParams();return e.initUniformsBuffer(),e.layer.triangulation=a,[yield e.layer.buildLayerModel({moduleName:u,vertexShader:n,fragmentShader:r,inject:e.getInject(),triangulation:a,primitive:Ee.TRIANGLES,depth:{enable:!1}})]})()}registerBuiltinAttributes(){const{opacityLinear:e={enable:!1,dir:"in"}}=this.layer.getLayerConfig();e.enable&&this.styleAttributeService.registerStyleAttribute({name:"linear",type:Vr.Attribute,descriptor:{name:"a_linear",shaderLocation:Ro.LINEAR,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(r,n,a)=>[a[3],a[4],a[5]]}})}getModelParams(){const{opacityLinear:e={enable:!1}}=this.layer.getLayerConfig();return e.enable?{frag:CM,vert:MM,type:"polygonLinear",triangulation:dC}:{frag:AM,vert:PM,type:"polygonFill",triangulation:a1}}}const IM=`
layout(std140) uniform commonUniforms {
vec4 u_watercolor;
vec4 u_watercolor2;
float u_time;
};
in vec2 v_uv;
in float v_opacity;
out vec4 outputColor;
float coast2water_fadedepth = 0.10;
float large_waveheight = .750; // change to adjust the "heavy" waves
float large_wavesize = 3.4; // factor to adjust the large wave size
float small_waveheight = 0.6; // change to adjust the small random waves
float small_wavesize = 0.5; // factor to ajust the small wave size
float water_softlight_fact = 15.; // range [1..200] (should be << smaller than glossy-fact)
float water_glossylight_fact= 120.; // range [1..200]
float particle_amount = 70.;
vec3 water_specularcolor = vec3(1.3, 1.3, 0.9); // specular Color (RGB) of the water-highlights
#define light vec3(-0., sin(u_time*0.5)*.5 + .35, 2.8) // position of the sun
uniform sampler2D u_texture1;
uniform sampler2D u_texture2;
uniform sampler2D u_texture3;
float hash( float n ) {
return fract(sin(n)*43758.5453123);
}
// 2d noise function
float noise1( in vec2 x ) {
vec2 p = floor(x);
vec2 f = smoothstep(0.0, 1.0, fract(x));
float n = p.x + p.y*57.0;
return mix(mix( hash(n+ 0.0), hash(n+ 1.0),f.x),
mix( hash(n+ 57.0), hash(n+ 58.0),f.x),f.y);
}
float noise(vec2 p) {
return texture(SAMPLER_2D(u_texture2),p*vec2(1./256.)).x;
}
vec4 highness(vec2 p) {
vec4 t = texture(SAMPLER_2D(u_texture1),fract(p));
float clipped = -2.0-smoothstep(3.,10.,t.a)*6.9-smoothstep(10.,100.,t.a)*89.9-smoothstep(0.,10000.,t.a)*10000.0;
return clamp(t, 0.0,3.0)+clamp(t/3.0-1.0, 0.0,1.0)+clamp(t/16.0-1.0, 0.0,1.0);
}
float height_map( vec2 p ) {
vec4 height=highness(p);
/*
height = -0.5+
0.5*smoothstep(-100.,0.,-height)+
2.75*smoothstep(0.,2.,height)+
1.75*smoothstep(2.,4.,height)+
2.75*smoothstep(4.,16.,height)+
1.5*smoothstep(16.,1000.,height);
*/
mat2 m = mat2( 0.9563*1.4, -0.2924*1.4, 0.2924*1.4, 0.9563*1.4 );
//p = p*6.;
float f = 0.6000*noise1( p ); p = m*p*1.1*6.;
f += 0.2500*noise( p ); p = m*p*1.32;
f += 0.1666*noise( p ); p = m*p*1.11;
f += 0.0834*noise( p ); p = m*p*1.12;
f += 0.0634*noise( p ); p = m*p*1.13;
f += 0.0444*noise( p ); p = m*p*1.14;
f += 0.0274*noise( p ); p = m*p*1.15;
f += 0.0134*noise( p ); p = m*p*1.16;
f += 0.0104*noise( p ); p = m*p*1.17;
f += 0.0084*noise( p );
f = .25*f+dot(height,vec4(-.03125,-.125,.25,.25))*.5;
const float FLAT_LEVEL = 0.92525;
//f = f*0.25+height*0.75;
if (f<FLAT_LEVEL)
f = f;
else
f = pow((f-FLAT_LEVEL)/(1.-FLAT_LEVEL), 2.)*(1.-FLAT_LEVEL)*2.0+FLAT_LEVEL; // makes a smooth coast-increase
return clamp(f, 0., 10.);
}
vec3 plasma_quintic( float x ) {
x = clamp( x, 0.0, 1.0);
vec4 x1 = vec4( 1.0, x, x * x, x * x * x ); // 1 x x2 x3
vec4 x2 = x1 * x1.w * x; // x4 x5 x6 x7
return vec3(
dot( x1.xyzw, vec4( +0.063861086, +1.992659096, -1.023901152, -0.490832805 ) ) + dot( x2.xy, vec2( +1.308442123, -0.914547012 ) ),
dot( x1.xyzw, vec4( +0.049718590, -0.791144343, +2.892305078, +0.811726816 ) ) + dot( x2.xy, vec2( -4.686502417, +2.717794514 ) ),
dot( x1.xyzw, vec4( +0.513275779, +1.580255060, -5.164414457, +4.559573646 ) ) + dot( x2.xy, vec2( -1.916810682, +0.570638854 ) ) );
}
vec4 color(vec2 p){
vec4 c1 = vec4(1.7,1.6,.9,1);
vec4 c2 = vec4(.2,.94,.1,1);
vec4 c3 = vec4(.3,.2,.0,1);
vec4 c4 = vec4(.99,.99,1.6,1);
vec4 v = highness(p);
float los = smoothstep(0.1,1.1,v.b);
float his = smoothstep(3.5,6.5,v.b);
float ces = smoothstep(1.,5.,v.a);
vec4 lo = mix(c1,c2,los);
vec4 hi = mix(c3,c4,his);
vec4 ce = mix(lo,hi,ces);
return vec4(plasma_quintic(ces),1).ragb;
}
vec3 terrain_map( vec2 p )
{
return color(p).rgb*0.75+0.25*vec3(0.7, .55, .4)+texture(SAMPLER_2D(u_texture3), fract(p*5.)).rgb*.5; // test-terrain is simply 'sandstone'
}
const mat2 m = mat2( 0.72, -1.60, 1.60, 0.72 );
float water_map( vec2 p, float height ) {
vec2 p2 = p*large_wavesize;
vec2 shift1 = 0.001*vec2( u_time*160.0*2.0, u_time*120.0*2.0 );
vec2 shift2 = 0.001*vec2( u_time*190.0*2.0, -u_time*130.0*2.0 );
// coarse crossing 'ocean' waves...
float f = 0.6000*noise( p );
f += 0.2500*noise( p*m );
f += 0.1666*noise( p*m*m );
float wave = sin(p2.x*0.622+p2.y*0.622+shift2.x*4.269)*large_waveheight*f*height*height ;
p *= small_wavesize;
f = 0.;
float amp = 1.0, s = .5;
for (int i=0; i<9; i++)
{ p = m*p*.947; f -= amp*abs(sin((noise( p+shift1*s )-.5)*2.)); amp = amp*.59; s*=-1.329; }
return wave+f*small_waveheight;
}
float nautic(vec2 p) {
p *= 18.;
float f = 0.;
float amp = 1.0, s = .5;
for (int i=0; i<3; i++)
{ p = m*p*1.2; f += amp*abs(smoothstep(0., 1., noise( p+u_time*s ))-.5); amp = amp*.5; s*=-1.227; }
return pow(1.-f, 5.);
}
float particles(vec2 p) {
p *= 200.;
float f = 0.;
float amp = 1.0, s = 1.5;
for (int i=0; i<3; i++)
{ p = m*p*1.2; f += amp*noise( p+u_time*s ); amp = amp*.5; s*=-1.227; }
return pow(f*.35, 7.)*particle_amount;
}
float test_shadow( vec2 xy, float height) {
vec3 r0 = vec3(xy, height);
vec3 rd = normalize( light - r0 );
float hit = 1.0;
float t = 0.001;
for (int j=1; j<25; j++)
{
vec3 p = r0 + t*rd;
float h = height_map( p.xy );
float height_diff = p.z - h;
if (height_diff<0.0)
{
return 0.0;
}
t += 0.01+height_diff*.02;
hit = min(hit, 2.*height_diff/t); // soft shaddow
}
return hit;
}
vec3 CalcTerrain(vec2 uv, float height) {
vec3 col = terrain_map( uv );
vec2 iResolution = vec2(512.);
float h1 = height_map(uv-vec2(0., 0.5)/ iResolution.xy);
float h2 = height_map(uv+vec2(0., 0.5)/ iResolution.xy);
float h3 = height_map(uv-vec2(0.5, 0.)/ iResolution.xy);
float h4 = height_map(uv+vec2(0.5, 0.)/ iResolution.xy);
vec3 norm = normalize(vec3(h3-h4, h1-h2, 1.));
vec3 r0 = vec3(uv, height);
vec3 rd = normalize( light - r0 );
float grad = dot(norm, rd);
col *= grad+pow(grad, 8.);
float terrainshade = test_shadow( uv, height );
col = mix(col*.25, col, terrainshade);
return col;
}
void main() {
vec3 watercolor = u_watercolor.rgb;
vec3 watercolor2 = u_watercolor2.rgb;
vec2 uv = v_uv;
float WATER_LEVEL = 0.84; // Water level (range: 0.0 - 2.0)
float deepwater_fadedepth = 0.4 + coast2water_fadedepth;
float height = height_map( uv );
vec3 col;
float waveheight = clamp(WATER_LEVEL*3.-1.5, 0., 1.);
float level = WATER_LEVEL + .2*water_map(uv*15. + vec2(u_time*.1), waveheight);
if (height > level)
{
col = CalcTerrain(uv, height);
}
if (height <= level)
{
vec2 dif = vec2(.0, .01);
vec2 pos = uv*15. + vec2(u_time*.01);
float h1 = water_map(pos-dif,waveheight);
float h2 = water_map(pos+dif,waveheight);
float h3 = water_map(pos-dif.yx,waveheight);
float h4 = water_map(pos+dif.yx,waveheight);
vec3 normwater = normalize(vec3(h3-h4, h1-h2, .125)); // norm-vector of the 'bumpy' water-plane
uv += normwater.xy*.002*(level-height);
col = CalcTerrain(uv, height);
float coastfade = clamp((level-height)/coast2water_fadedepth, 0., 1.);
float coastfade2= clamp((level-height)/deepwater_fadedepth, 0., 1.);
float intensity = col.r*.2126+col.g*.7152+col.b*.0722;
watercolor = mix(watercolor*intensity, watercolor2, smoothstep(0., 1., coastfade2));
vec3 r0 = vec3(uv, WATER_LEVEL);
vec3 rd = normalize( light - r0 ); // ray-direction to the light from water-position
float grad = dot(normwater, rd); // dot-product of norm-vector and light-direction
float specular = pow(grad, water_softlight_fact); // used for soft highlights
float specular2= pow(grad, water_glossylight_fact); // used for glossy highlights
float gradpos = dot(vec3(0., 0., 1.), rd);
float specular1= smoothstep(0., 1., pow(gradpos, 5.)); // used for diffusity (some darker corona around light's specular reflections...)
float watershade = test_shadow( uv, level );
watercolor *= 2.2+watershade;
watercolor += (.2+.8*watershade) * ((grad-1.0)*.5+specular) * .25;
watercolor /= (1.+specular1*1.25);
watercolor += watershade*specular2*water_specularcolor;
watercolor += watershade*coastfade*(1.-coastfade2)*(vec3(.5, .6, .7)*nautic(uv)+vec3(1., 1., 1.)*particles(uv));
col = mix(col, watercolor, coastfade);
}
outputColor = vec4(col, v_opacity);
}
`,LM=`layout(location = 0) in vec3 a_Position;
layout(location = 14) in vec2 a_uv;
layout(std140) uniform commonUniforms {
vec4 u_watercolor;
vec4 u_watercolor2;
float u_time;
};
out vec2 v_uv;
out float v_opacity;
#pragma include "projection"
void main() {
v_uv = a_uv;
v_opacity = opacity;
vec4 project_pos = project_position(vec4(a_Position, 1.0));
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
}
`;class DM extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture1",void 0),(0,K.Z)(this,"texture2",void 0),(0,K.Z)(this,"texture3",void 0)}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{watercolor:e="#6D99A8",watercolor2:r="#0F121C"}=this.layer.getLayerConfig(),n={u_watercolor:Va(e),u_watercolor2:Va(r),u_time:this.layer.getLayerAnimateTime(),u_texture1:this.texture1,u_texture2:this.texture2,u_texture3:this.texture3};return this.textures=[this.texture1,this.texture2,this.texture3],this.getUniformsBufferInfo(n)}getAnimateUniforms(){return{u_time:this.layer.getLayerAnimateTime()}}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.loadTexture(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"polygonOcean",vertexShader:LM,fragmentShader:IM,inject:e.getInject(),triangulation:a1,primitive:Ee.TRIANGLES,depth:{enable:!1}})]})()}clearModels(){var e,r,n;(e=this.texture1)===null||e===void 0||e.destroy(),(r=this.texture2)===null||r===void 0||r.destroy(),(n=this.texture3)===null||n===void 0||n.destroy()}registerBuiltinAttributes(){const e=this.layer.getSource().extent,[r,n,a,u]=e,y=a-r,A=u-n;this.styleAttributeService.registerStyleAttribute({name:"oceanUv",type:Vr.Attribute,descriptor:{name:"a_uv",shaderLocation:Ro.UV,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(O,Z,Y,Q)=>{const ae=O.version==="GAODE2.x"?O.originCoordinates[0][Q]:Y,[xe,Be]=ae;return[(xe-r)/y,(Be-n)/A]}}})}loadTexture(){const{createTexture2D:e}=this.rendererService,r={height:0,width:0};this.texture1=e(r),this.texture2=e(r),this.texture3=e(r),n(u=>{this.texture1=a(u[0]),this.texture2=a(u[1]),this.texture3=a(u[2]),this.layerService.reRender()});function n(u){let y=0;const A=[];["https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ","https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*MJ22QbpuCzIAAAAAAAAAAAAAARQnAQ","https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*-z2HSIVDsHIAAAAAAAAAAAAAARQnAQ"].map(Z=>{const Y=new Image;Y.crossOrigin="",Y.src=Z,A.push(Y),Y.onload=()=>{y++,y===3&&u(A)}})}function a(u){return e({data:u,width:u.width,height:u.height,wrapS:Ee.MIRRORED_REPEAT,wrapT:Ee.MIRRORED_REPEAT,min:Ee.LINEAR,mag:Ee.LINEAR})}}}const OM=`uniform sampler2D u_texture;
layout(std140) uniform commonUniforms {
float u_speed;
float u_time;
};
out vec4 outputColor;
in vec4 v_Color;
in vec2 v_uv;
float rand(vec2 n) { return 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453); }
float water(vec3 p) {
float t = u_time * u_speed;
p.z += t * 2.; p.x += t * 2.;
vec3 c1 = texture(SAMPLER_2D(u_texture), p.xz / 30.).xyz;
p.z += t * 3.; p.x += t * 0.52;
vec3 c2 = texture(SAMPLER_2D(u_texture), p.xz / 30.).xyz;
p.z += t * 4.; p.x += t * 0.8;
vec3 c3 = texture(SAMPLER_2D(u_texture), p.xz / 30.).xyz;
c1 += c2 - c3;
float z = (c1.x + c1.y + c1.z) / 3.;
return p.y + z / 4.;
}
float map(vec3 p) {
float d = 100.0;
d = water(p);
return d;
}
float intersect(vec3 ro, vec3 rd) {
float d = 0.0;
for (int i = 0; i <= 100; i++) {
float h = map(ro + rd * d);
if (h < 0.1) return d;
d += h;
}
return 0.0;
}
vec3 norm(vec3 p) {
float eps = .1;
return normalize(vec3(
map(p + vec3(eps, 0, 0)) - map(p + vec3(-eps, 0, 0)),
map(p + vec3(0, eps, 0)) - map(p + vec3(0, -eps, 0)),
map(p + vec3(0, 0, eps)) - map(p + vec3(0, 0, -eps))
));
}
float calSpc() {
vec3 l1 = normalize(vec3(1, 1, 1));
vec3 ro = vec3(-3, 20, -8);
vec3 rc = vec3(0, 0, 0);
vec3 ww = normalize(rc - ro);
vec3 uu = normalize(cross(vec3(0,1,0), ww));
vec3 vv = normalize(cross(rc - ro, uu));
vec3 rd = normalize(uu * v_uv.x + vv * v_uv.y + ww);
float d = intersect(ro, rd);
vec3 p = ro + rd * d;
vec3 n = norm(p);
float spc = pow(max(0.0, dot(reflect(l1, n), rd)), 30.0);
return spc;
}
void main() {
outputColor = v_Color;
float spc = calSpc();
outputColor += spc * 0.4;
}
`,BM=`layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 14) in vec2 a_uv;
layout(std140) uniform commonUniforms {
float u_speed;
float u_time;
};
out vec4 v_Color;
out vec2 v_uv;
#pragma include "projection"
void main() {
v_uv = a_uv;
v_Color = a_Color;
v_Color.a *= opacity;
vec4 project_pos = project_position(vec4(a_Position, 1.0));
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
}
`;class FM extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0)}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{speed:e=.5}=this.layer.getLayerConfig(),r={u_speed:e,u_time:this.layer.getLayerAnimateTime(),u_texture:this.texture};return this.textures=[this.texture],this.getUniformsBufferInfo(r)}getAnimateUniforms(){return{u_time:this.layer.getLayerAnimateTime()}}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.loadTexture(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"polygonWater",vertexShader:BM,fragmentShader:OM,triangulation:a1,inject:e.getInject(),primitive:Ee.TRIANGLES,depth:{enable:!1},pickingEnabled:!1,diagnosticDerivativeUniformityEnabled:!1})]})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy()}registerBuiltinAttributes(){const e=this.layer.getSource().extent,[r,n,a,u]=e,y=a-r,A=u-n;this.styleAttributeService.registerStyleAttribute({name:"waterUv",type:Vr.Attribute,descriptor:{name:"a_uv",shaderLocation:Ro.UV,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(O,Z,Y,Q)=>{const ae=O.version==="GAODE2.x"?O.originCoordinates[0][Q]:Y,[xe,Be]=ae;return[(xe-r)/y,(Be-n)/A]}}})}loadTexture(){const{waterTexture:e}=this.layer.getLayerConfig(),{createTexture2D:r}=this.rendererService;this.texture=r({height:1,width:1});const n=new Image;n.crossOrigin="",e?(console.warn("L7 recommend\uFF1Ahttps://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ"),n.src=e):n.src="https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ",n.onload=()=>{this.texture=r({data:n,width:n.width,height:n.height,wrapS:Ee.MIRRORED_REPEAT,wrapT:Ee.MIRRORED_REPEAT,min:Ee.LINEAR,mag:Ee.LINEAR}),this.layerService.reRender()}}}var kM={fill:RM,line:Lw,extrude:EM,text:Gw,point_fill:Bw,point_image:Fw,point_normal:Nw,point_extrude:Ow,water:FM,ocean:DM,extrusion:TM};class u1 extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","PolygonLayer"),(0,K.Z)(this,"enableShaderEncodeStyles",["opacity","extrusionBase","rotation","offsets","stroke"])}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new kM[r](e),yield e.initLayerModels()})()}getModelType(){var e;const r=this.styleAttributeService.getLayerStyleAttribute("shape"),n=r==null||(e=r.scale)===null||e===void 0?void 0:e.field;return n==="fill"||!n?"fill":n==="extrude"?"extrude":n==="extrusion"?"extrusion":n==="water"?"water":n==="ocean"?"ocean":n==="line"?"line":this.getPointModelType()}getPointModelType(){const e=this.getEncodedData(),{shape2d:r,shape3d:n}=this.getLayerConfig(),a=this.iconService.getIconMap(),u=e.find(y=>y.hasOwnProperty("shape"));if(u){const y=u.shape;return y==="dot"?"point_normal":(r==null?void 0:r.indexOf(y))!==-1?"point_fill":(n==null?void 0:n.indexOf(y))!==-1?"point_extrude":a.hasOwnProperty(y)?"point_image":"text"}else return"fill"}}const NM=`layout(std140) uniform commonUniforms {
vec2 u_domain;
float u_opacity;
float u_noDataValue;
float u_clampLow;
float u_clampHigh;
};
uniform sampler2D u_rasterTexture;
uniform sampler2D u_colorTexture;
in vec2 v_texCoord;
bool isnan_emu(float x) { return (x > 0.0 || x < 0.0) ? x != x : x != 0.0; }
out vec4 outputColor;
void main() {
// Can use any component here since u_rasterTexture is under luminance format.
float value = texture(SAMPLER_2D(u_rasterTexture), vec2(v_texCoord.x, v_texCoord.y)).r;
if (value == u_noDataValue || isnan_emu(value)) {
discard;
} else if ((u_clampLow < 0.5 && value < u_domain[0]) || (u_clampHigh < 0.5 && value > u_domain[1])) {
discard;
} else {
float normalisedValue =(value - u_domain[0]) / (u_domain[1] - u_domain[0]);
vec4 color = texture(SAMPLER_2D(u_colorTexture), vec2(normalisedValue, 0));
outputColor = color;
outputColor.a = outputColor.a * u_opacity ;
if (outputColor.a < 0.01)
discard;
}
}
`,zM=`
layout(location = 0) in vec3 a_Position;
layout(location = 14) in vec2 a_Uv;
layout(std140) uniform commonUniforms {
vec2 u_domain;
float u_opacity;
float u_noDataValue;
float u_clampLow;
float u_clampHigh;
};
out vec2 v_texCoord;
#pragma include "projection"
void main() {
v_texCoord = a_Uv;
vec4 project_pos = project_position(vec4(a_Position, 1.0));
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
}
`;class Ww extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"colorTexture",void 0)}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{opacity:e=1,clampLow:r=!0,clampHigh:n=!0,noDataValue:a=-9999999,domain:u,rampColors:y}=this.layer.getLayerConfig(),A=u||Io(y);this.colorTexture=this.layer.textureService.getColorTexture(y,A);const O={u_domain:A,u_opacity:e||1,u_noDataValue:a,u_clampLow:r?1:0,u_clampHigh:(typeof n!="undefined"?n:r)?1:0,u_rasterTexture:this.texture,u_colorTexture:this.colorTexture};return this.textures=[this.texture,this.colorTexture],this.getUniformsBufferInfo(O)}getRasterData(e){return(0,Nr.Z)(function*(){if(Array.isArray(e.data))return{data:e.data,width:e.width,height:e.height};{const{rasterData:r,width:n,height:a}=yield e.data;return{data:Array.from(r),width:n,height:a}}})()}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){e.initUniformsBuffer();const r=e.layer.getSource(),{createTexture2D:n,queryVerdorInfo:a}=e.rendererService,u=r.data.dataArray[0],{data:y,width:A,height:O}=yield e.getRasterData(u);return e.texture=n({data:new Float32Array(y),width:A,height:O,format:a()==="WebGL1"?Ee.LUMINANCE:Ee.RED,type:Ee.FLOAT,alignment:1}),[yield e.layer.buildLayerModel({moduleName:"rasterImageData",vertexShader:zM,fragmentShader:NM,triangulation:h_,primitive:Ee.TRIANGLES,depth:{enable:!1},pickingEnabled:!1})]})()}clearModels(){var e,r;(e=this.texture)===null||e===void 0||e.destroy(),(r=this.colorTexture)===null||r===void 0||r.destroy()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{shaderLocation:Ro.UV,name:"a_Uv",buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}const UM=["data"],ZM=["rasterData"],VM=`uniform sampler2D u_texture;
layout(std140) uniform commonUniforms {
vec2 u_rminmax;
vec2 u_gminmax;
vec2 u_bminmax;
float u_opacity;
float u_noDataValue;
};
in vec2 v_texCoord;
out vec4 outputColor;
void main() {
vec3 rgb = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y)).rgb;
if(rgb == vec3(u_noDataValue)) {
outputColor = vec4(0.0, 0, 0, 0.0);
} else {
outputColor = vec4(rgb.r / (u_rminmax.y -u_rminmax.x), rgb.g /(u_gminmax.y -u_gminmax.x), rgb.b/ (u_bminmax.y - u_bminmax.x), u_opacity);
}
if(outputColor.a < 0.01)
discard;
}`,jM=`
layout(location = 0) in vec3 a_Position;
layout(location = 14) in vec2 a_Uv;
layout(std140) uniform commonUniforms {
vec2 u_rminmax;
vec2 u_gminmax;
vec2 u_bminmax;
float u_opacity;
float u_noDataValue;
};
out vec2 v_texCoord;
#pragma include "projection"
void main() {
v_texCoord = a_Uv;
vec4 project_pos = project_position(vec4(a_Position, 1.0));
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
}
`;class HM extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"dataOption",{})}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{opacity:e=1,noDataValue:r=0}=this.layer.getLayerConfig(),{rMinMax:n=[0,255],gMinMax:a=[0,255],bMinMax:u=[0,255]}=this.dataOption,y={u_rminmax:n,u_gminmax:a,u_bminmax:u,u_opacity:e||1,u_noDataValue:r,u_texture:this.texture};return this.textures=[this.texture],this.getUniformsBufferInfo(y)}getRasterData(e){var r=this;return(0,Nr.Z)(function*(){if(Array.isArray(e.data)){const{data:y}=e,A=(0,Ge.Z)(e,UM);return r.dataOption=A,(0,Wt.Z)({data:y},A)}const n=yield e.data,{rasterData:a}=n,u=(0,Ge.Z)(n,ZM);return r.dataOption=u,Array.isArray(a)?(0,Wt.Z)({data:a},u):(0,Wt.Z)({data:Array.from(a)},u)})()}initModels(){var e=this;return(0,Nr.Z)(function*(){e.initUniformsBuffer();const r=e.layer.getSource(),{createTexture2D:n}=e.rendererService,a=r.data.dataArray[0],{data:u,width:y,height:A}=yield e.getRasterData(a);return e.texture=n({data:new Float32Array(u),width:y,height:A,format:Ee.RGB,type:Ee.FLOAT}),[yield e.layer.buildLayerModel({moduleName:"rasterImageDataRGBA",vertexShader:jM,fragmentShader:VM,triangulation:h_,primitive:Ee.TRIANGLES,depth:{enable:!1},pickingEnabled:!1})]})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initModels()})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}const GM=`uniform sampler2D u_texture;
uniform sampler2D u_colorTexture;
layout(std140) uniform commonUniforms {
vec4 u_unpack;
vec2 u_domain;
float u_opacity;
float u_noDataValue;
float u_clampLow;
float u_clampHigh;
};
in vec2 v_texCoord;
out vec4 outputColor;
float getElevation(vec2 coord, float bias) {
// Convert encoded elevation value to meters
vec4 data = texture(SAMPLER_2D(u_texture), coord,bias) * 255.0;
data.a = -1.0;
return dot(data, u_unpack);
}
vec4 getColor(float value) {
float normalisedValue =(value- u_domain[0]) / (u_domain[1] - u_domain[0]);
vec2 coord = vec2(normalisedValue, 0);
return texture(SAMPLER_2D(u_colorTexture), coord);
}
void main() {
float value = getElevation(v_texCoord,0.0);
if (value == u_noDataValue) {
outputColor = vec4(0.0, 0, 0, 0.0);
} else if ((u_clampLow < 0.5 && value < u_domain[0]) || (u_clampHigh < 0.5 && value > u_domain[1])) {
outputColor = vec4(0.0, 0, 0, 0.0);
} else {
outputColor = getColor(value);
outputColor.a = outputColor.a * u_opacity ;
if(outputColor.a < 0.01)
discard;
}
}
`,WM=`layout(location = 0) in vec3 a_Position;
layout(location = 14) in vec2 a_Uv;
layout(std140) uniform commonUniforms {
vec4 u_unpack;
vec2 u_domain;
float u_opacity;
float u_noDataValue;
float u_clampLow;
float u_clampHigh;
};
out vec2 v_texCoord;
#pragma include "projection"
void main() {
v_texCoord = a_Uv;
vec4 project_pos = project_position(vec4(a_Position, 1.0));
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
}
`;class XM extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0)}getCommonUniformsInfo(){const{opacity:e,clampLow:r=!0,clampHigh:n=!0,noDataValue:a=-9999999,domain:u,rampColors:y,colorTexture:A,rScaler:O=6553.6,gScaler:Z=25.6,bScaler:Y=.1,offset:Q=1e4}=this.layer.getLayerConfig(),ae=u||Io(y);let xe=A;A?this.layer.textureService.setColorTexture(A,y,ae):xe=this.layer.textureService.getColorTexture(y,ae);const Be={u_unpack:[O,Z,Y,Q],u_domain:ae,u_opacity:e||1,u_noDataValue:a,u_clampLow:r,u_clampHigh:typeof n!="undefined"?n:r,u_texture:this.texture,u_colorTexture:xe};return this.textures=[this.texture,xe],this.getUniformsBufferInfo(Be)}initModels(){var e=this;return(0,Nr.Z)(function*(){e.initUniformsBuffer();const r=e.layer.getSource(),{createTexture2D:n}=e.rendererService,a=yield r.data.images;return e.texture=n({data:a[0],width:a[0].width,height:a[0].height,min:Ee.LINEAR,mag:Ee.LINEAR}),[yield e.layer.buildLayerModel({moduleName:"RasterTileDataImage",vertexShader:WM,fragmentShader:GM,triangulation:h_,primitive:Ee.TRIANGLES,depth:{enable:!1}})]})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initModels()})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}var qM={raster:Ww,rasterRgb:HM,raster3d:Ww,rasterTerrainRgb:XM};class c1 extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","RasterLayer")}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new qM[r](e),yield e.initLayerModels()})()}getDefaultConfig(){const e=this.getModelType();return{raster:{},rasterRgb:{},raster3d:{},rasterTerrainRgb:{}}[e]}getModelType(){switch(this.layerSource.getParserType()){case"raster":return"raster";case"rasterRgb":return"rasterRgb";case"rgb":return"rasterRgb";case"image":return"rasterTerrainRgb";default:return"raster"}}getLegend(e){if(e!=="color")return{type:void 0,field:void 0,items:[]};const r=this.getLayerConfig().rampColors;return Tw(r,e)}}class YM{constructor({rendererService:e,layerService:r,parent:n}){(0,K.Z)(this,"tileResource",new Map),(0,K.Z)(this,"rendererService",void 0),(0,K.Z)(this,"layerService",void 0),(0,K.Z)(this,"parent",void 0),(0,K.Z)(this,"layerTiles",[]),this.rendererService=e,this.layerService=r,this.parent=n}get tiles(){return this.layerTiles}hasTile(e){return this.layerTiles.some(r=>r.key===e)}addTile(e){this.layerTiles.push(e)}getTile(e){return this.layerTiles.find(r=>r.key===e)}getVisibleTileBylngLat(e){return this.layerTiles.find(r=>r.isLoaded&&r.visible&&r.lnglatInBounds(e))}removeTile(e){const r=this.layerTiles.findIndex(a=>a.key===e),n=this.layerTiles.splice(r,1);n[0]&&n[0].destroy()}updateTileVisible(e){const r=this.getTile(e.key);if(e.isVisible)if(e.parent){const n=this.isChildrenLoaded(e.parent);r==null||r.updateVisible(n)}else r==null||r.updateVisible(!0);else if(e.parent){const n=this.isChildrenLoaded(e.parent);r==null||r.updateVisible(!n)}else r==null||r.updateVisible(!1)}isParentLoaded(e){const r=e.parent;if(!r)return!0;const n=this.getTile(r==null?void 0:r.key);return!!(n!=null&&n.isLoaded)}isChildrenLoaded(e){const r=e==null?void 0:e.children;return r.length===0?!0:r.every(n=>{const a=this.getTile(n==null?void 0:n.key);return a?(a==null?void 0:a.isLoaded)===!0:!0})}render(){var e=this;return(0,Nr.Z)(function*(){const n=e.getRenderLayers().map(function(){var a=(0,Nr.Z)(function*(u){yield e.layerService.renderTileLayer(u)});return function(u){return a.apply(this,arguments)}}());yield Promise.all(n)})()}getRenderLayers(){const e=this.layerTiles.filter(n=>n.visible&&n.isLoaded),r=[];return e.map(n=>r.push(...n.getLayers())),r}getLayers(){const e=this.layerTiles.filter(n=>n.isLoaded),r=[];return e.map(n=>r.push(...n.getLayers())),r}getTiles(){return this.layerTiles}destroy(){this.layerTiles.forEach(e=>e.destroy()),this.tileResource.clear()}}var $M=Se(23167);function KM(t,e,r){r===void 0&&(r={});var n=un(t),a=un(e),u=$M.union(n.coordinates,a.coordinates);return u.length===0?null:u.length===1?Cr(u[0],r.properties):So(u,r.properties)}var JM=KM;class QM{getCombineFeature(e){let r=null;const n=e[0];return e.map(a=>{const u=Cr(a.coordinates);r===null?r=u:r=JM(r,u)}),n&&(r.properties=(0,Wt.Z)({},n)),r}}const f_="select",d_="active";class e4{constructor({layerService:e,tileLayerService:r,parent:n}){(0,K.Z)(this,"layerService",void 0),(0,K.Z)(this,"tileLayerService",void 0),(0,K.Z)(this,"tileSourceService",void 0),(0,K.Z)(this,"parent",void 0),(0,K.Z)(this,"tilePickID",new Map),this.layerService=e,this.tileLayerService=r,this.parent=n,this.tileSourceService=new QM}pickRender(e){const r=this.tileLayerService.getVisibleTileBylngLat(e.lngLat);if(r){const n=r.getMainLayer();n==null||n.layerPickService.pickRender(e)}}pick(e,r){var n=this;return(0,Nr.Z)(function*(){const u=n.parent.getContainer().pickingService;if(e.type==="RasterLayer"){const y=n.tileLayerService.getVisibleTileBylngLat(r.lngLat);if(y&&y.getMainLayer()!==void 0){const A=y.getMainLayer();return A.layerPickService.pickRasterLayer(A,r,n.parent)}return!1}return n.pickRender(r),u.pickFromPickingFBO(e,r)})()}selectFeature(e){const[r,n,a]=e,u=this.color2PickId(r,n,a);this.tilePickID.set(f_,u),this.updateHighLight(r,n,a,f_)}highlightPickedFeature(e){const[r,n,a]=e,u=this.color2PickId(r,n,a);this.tilePickID.set(d_,u),this.updateHighLight(r,n,a,d_)}updateHighLight(e,r,n,a){this.tileLayerService.tiles.map(u=>{const y=u.getMainLayer();switch(a){case f_:y==null||y.hooks.beforeSelect.call([e,r,n]);break;case d_:y==null||y.hooks.beforeHighlight.call([e,r,n]);break}})}setPickState(){const e=this.tilePickID.get(f_),r=this.tilePickID.get(d_);if(e){const[n,a,u]=this.pickId2Color(e);this.updateHighLight(n,a,u,f_);return}if(r){const[n,a,u]=this.pickId2Color(r);this.updateHighLight(n,a,u,d_);return}}color2PickId(e,r,n){return Aa(new Uint8Array([e,r,n]))}pickId2Color(e){return Ni(e)}getFeatureById(e){const r=this.tileLayerService.getTiles().filter(a=>a.visible),n=[];return r.forEach(a=>{n.push(...a.getFeatureById(e))}),n}pickRasterLayer(){return!1}}function t4(t){return t==="PolygonLayer"?u1:t==="LineLayer"?m2:l1}function r4(t){return["PolygonLayer","LineLayer"].indexOf(t)!==-1}class n0 extends Yl.EventEmitter{constructor(e,r){super(),(0,K.Z)(this,"x",void 0),(0,K.Z)(this,"y",void 0),(0,K.Z)(this,"z",void 0),(0,K.Z)(this,"key",void 0),(0,K.Z)(this,"parent",void 0),(0,K.Z)(this,"sourceTile",void 0),(0,K.Z)(this,"visible",!0),(0,K.Z)(this,"layers",[]),(0,K.Z)(this,"isLoaded",!1),(0,K.Z)(this,"tileMaskLayers",[]),(0,K.Z)(this,"tileMask",void 0),this.parent=r,this.sourceTile=e,this.x=e.x,this.y=e.y,this.z=e.z,this.key=`${this.x}_${this.y}_${this.z}`}getLayers(){return this.layers}styleUpdate(...e){}lnglatInBounds(e){const[r,n,a,u]=this.sourceTile.bounds,{lng:y,lat:A}=e;return y>=r&&y<=a&&A>=n&&A<=u}getLayerOptions(){var e;const r=this.parent.getLayerConfig();return(0,Wt.Z)((0,Wt.Z)({},r),{},{textAllowOverlap:!0,autoFit:!1,maskLayers:this.getMaskLayer(),tileMask:r4(this.parent.type),mask:r.mask||((e=r.maskLayers)===null||e===void 0?void 0:e.length)!==0&&r.enableMask})}getMaskLayer(){const{maskLayers:e}=this.parent.getLayerConfig(),r=[];return e==null||e.forEach(n=>{if(!n.tileLayer)return r.push(n),n;const u=n.tileLayer.getTile(this.sourceTile.key),y=u==null?void 0:u.getLayers()[0];y&&r.push(y)}),r}addTileMask(){var e=this;return(0,Nr.Z)(function*(){const r=new u1({name:"mask",visible:!0,enablePicking:!1}).source({type:"FeatureCollection",features:[e.sourceTile.bboxPolygon]},{parser:{type:"geojson",featureId:"id"}}).shape("fill").color("#0f0").style({opacity:.5}),n=cp(e.parent.container);r.setContainer(n),yield r.init(),e.tileMask=r;const a=e.getMainLayer();return a!==void 0&&(a.tileMask=r),r})()}addMask(e,r){var n=this;return(0,Nr.Z)(function*(){const a=cp(n.parent.container);r.setContainer(a),yield r.init(),e.addMask(r),n.tileMaskLayers.push(r)})()}addLayer(e){var r=this;return(0,Nr.Z)(function*(){e.isTileLayer=!0;const n=cp(r.parent.container);e.setContainer(n),r.layers.push(e),yield e.init()})()}updateVisible(e){this.visible=e,this.updateOptions("visible",e)}updateOptions(e,r){this.layers.forEach(n=>{n.updateLayerConfig({[e]:r})})}getMainLayer(){return this.layers[0]}getFeatures(e){return[]}getFeatureById(e){return[]}destroy(){var e;(e=this.tileMask)===null||e===void 0||e.destroy(),this.layers.forEach(r=>r.destroy())}}class n4 extends n0{initTileLayer(){var e=this;return(0,Nr.Z)(function*(){const r=e.getSourceOption(),n=r.data.features[0].properties,a=new m2().source(r.data,r.options).size(1).shape("line").color("red"),u=new l1({minZoom:e.z-1,maxZoom:e.z+1,textAllowOverlap:!0}).source([n],{parser:{type:"json",x:"x",y:"y"}}).size(20).color("red").shape(e.key).style({stroke:"#fff",strokeWidth:2});yield e.addLayer(a),yield e.addLayer(u),e.isLoaded=!0})()}getSourceOption(){const e=this.parent.getSource();return{data:{type:"FeatureCollection",features:this.sourceTile.data.layers.testTile.features},options:{parser:{type:"geojson"},transforms:e.transforms}}}}class i4 extends n0{initTileLayer(){var e=this;return(0,Nr.Z)(function*(){const r=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),a=e.getSourceOption(),u=new Cw((0,Wt.Z)({},n)).source(a.data,a.options);r&&Object.keys(r).forEach(y=>{var A,O;const Z=y;u[Z]((A=r[Z])===null||A===void 0?void 0:A.field,(O=r[Z])===null||O===void 0?void 0:O.values)}),yield e.addLayer(u),e.isLoaded=!0})()}getSourceOption(){const e=this.parent.getSource();return{data:this.sourceTile.data,options:{parser:{type:"image",extent:this.sourceTile.bounds},transforms:e.transforms}}}}const o4=`layout(std140) uniform commonUniorm {
vec4 u_color;
float u_opacity;
};
out vec4 outputColor;
void main() {
outputColor = u_color;
outputColor.a *= u_opacity;
}
`,a4=`layout(location = 0) in vec3 a_Position;
layout(std140) uniform commonUniorm {
vec4 u_color;
float u_opacity;
};
#pragma include "projection"
void main() {
vec4 project_pos = project_position(vec4(a_Position, 1.0));
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));
} else {
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
}
}
`;class s4 extends Ml{getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{opacity:e=1,color:r="#000"}=this.layer.getLayerConfig(),n={u_color:Va(r),u_opacity:e||1};return this.getUniformsBufferInfo(n)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"mask",vertexShader:a4,fragmentShader:o4,triangulation:a1,depth:{enable:!1},pick:!1})]})()}clearModels(e=!0){e&&this.layerService.clear()}registerBuiltinAttributes(){return""}}var l4={fill:s4};class v2 extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","MaskLayer")}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new l4[r](e),yield e.initLayerModels()})()}getModelType(){return"fill"}}class u4 extends n0{initTileLayer(){var e=this;return(0,Nr.Z)(function*(){const r=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),a=e.getSourceOption(),u=new v2((0,Wt.Z)({},n)).source(a.data,a.options);r&&Object.keys(r).forEach(y=>{var A,O;const Z=y;u[Z]((A=r[Z])===null||A===void 0?void 0:A.field,(O=r[Z])===null||O===void 0?void 0:O.values)}),yield e.addLayer(u),e.isLoaded=!0})()}getFeatures(e){return e?this.sourceTile.data.getTileData(e):[]}getSourceOption(){const e=this.parent.getSource(),{sourceLayer:r,featureId:n}=this.parent.getLayerConfig();return{data:{type:"FeatureCollection",features:this.getFeatures(r)},options:{parser:{type:"geojson",featureId:n},transforms:e.transforms}}}}const c4=["rasterData"];class h4 extends n0{initTileLayer(){var e=this;return(0,Nr.Z)(function*(){const r=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),a=e.getSourceOption(),u=new c1((0,Wt.Z)({},n)).source(a.data,a.options);r&&Object.keys(r).forEach(y=>{var A,O;const Z=y;u[Z]((A=r[Z])===null||A===void 0?void 0:A.field,(O=r[Z])===null||O===void 0?void 0:O.values)}),yield e.addLayer(u),e.isLoaded=!0})()}getSourceOption(){const e=this.parent.getSource(),r=this.sourceTile.data.data,{rasterData:n}=r,a=(0,Ge.Z)(r,c4);return{data:n,options:{parser:(0,Wt.Z)({type:"rasterRgb",extent:this.sourceTile.bounds},a),transforms:e.transforms}}}}class p4 extends n0{initTileLayer(){var e=this;return(0,Nr.Z)(function*(){const r=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),a=e.getSourceOption(),u=new c1((0,Wt.Z)({},n)).source(a.data,a.options);r&&Object.keys(r).forEach(y=>{var A,O;const Z=y;u[Z]((A=r[Z])===null||A===void 0?void 0:A.field,(O=r[Z])===null||O===void 0?void 0:O.values)}),yield e.addLayer(u),e.isLoaded=!0})()}getSourceOption(){const e=this.parent.getSource();return{data:this.sourceTile.data,options:{parser:{type:"image",extent:this.sourceTile.bounds},transforms:e.transforms}}}}const f4=["rasterData"],d4={positions:[0,1],colors:["#000","#fff"]};class m4 extends n0{constructor(...e){super(...e),(0,K.Z)(this,"colorTexture",void 0)}initTileLayer(){var e=this;return(0,Nr.Z)(function*(){const r=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),a=e.getSourceOption(),{rampColors:u,domain:y}=e.getLayerOptions();e.colorTexture=e.parent.textureService.getColorTexture(u,y);const A=new c1((0,Wt.Z)((0,Wt.Z)({},n),{},{colorTexture:e.colorTexture})).source(a.data,a.options);r&&Object.keys(r).forEach(O=>{var Z,Y;const Q=O;A[Q]((Z=r[Q])===null||Z===void 0?void 0:Z.field,(Y=r[Q])===null||Y===void 0?void 0:Y.values)}),yield e.addLayer(A),e.isLoaded=!0})()}getSourceOption(){const e=this.parent.getSource(),r=this.sourceTile.data.data,{rasterData:n}=r,a=(0,Ge.Z)(r,f4);return{data:n,options:{parser:(0,Wt.Z)({type:"raster",extent:this.sourceTile.bounds},a),transforms:e.transforms}}}styleUpdate(...e){const{rampColors:r=d4,domain:n}=e;this.colorTexture=this.parent.textureService.getColorTexture(r,n||Io(r)),this.layers.forEach(a=>a.style({colorTexture:this.colorTexture}))}destroy(){this.layers.forEach(e=>e.destroy())}}class h1 extends n0{initTileLayer(){var e=this;return(0,Nr.Z)(function*(){const r=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),a=t4(e.parent.type),u=e.getSourceOption();if(!u){e.isLoaded=!0,e.emit("loaded");return}const y=new a((0,Wt.Z)({},n)).source(u.data,u.options);Object.keys(r).forEach(A=>{var O,Z;const Y=A;y[Y]((O=r[Y])===null||O===void 0?void 0:O.field,(Z=r[Y])===null||Z===void 0?void 0:Z.values)}),yield e.addLayer(y),n.tileMask&&(yield e.addTileMask()),e.setLayerMinMaxZoom(y),e.isLoaded=!0,e.emit("loaded")})()}getSourceOption(){const e=this.parent.getSource(),{sourceLayer:r="defaultLayer",featureId:n="id"}=this.parent.getLayerConfig();return{data:{type:"FeatureCollection",features:this.getFeatures(r)},options:{parser:{type:"geojson",featureId:n},transforms:e.transforms}}}setLayerMinMaxZoom(e){e.getModelType()==="text"&&e.updateLayerConfig({maxZoom:this.z+1,minZoom:this.z-1})}getFeatures(e){return this.sourceTile.data.getTileData(e)}getFeatureById(e){const r=this.getMainLayer();return r?r.getSource().data.dataArray.filter(a=>a._id===e):[]}}function g4(t){switch(t.type){case"PolygonLayer":return h1;case"LineLayer":return h1;case"PointLayer":return h1;case"TileDebugLayer":return n4;case"MaskLayer":return u4;case"RasterLayer":const{dataType:r}=t.getSource().parser;switch(r){case Vh.RGB:case Vh.CUSTOMRGB:return h4;case Vh.ARRAYBUFFER:case Vh.CUSTOMARRAYBUFFER:return m4;case Vh.TERRAINRGB:case Vh.CUSTOMTERRAINRGB:return p4;default:return i4}default:return h1}}const v4=["shape","color","size","style","animate","filter","rotate","scale","setBlend","setSelect","setActive","disableMask","enableMask","addMask","removeMask"],{debounce:_4}=es;class Xw{constructor(e){(0,K.Z)(this,"parent",void 0),(0,K.Z)(this,"tileLayerService",void 0),(0,K.Z)(this,"mapService",void 0),(0,K.Z)(this,"layerService",void 0),(0,K.Z)(this,"rendererService",void 0),(0,K.Z)(this,"pickingService",void 0),(0,K.Z)(this,"tilePickService",void 0),(0,K.Z)(this,"tilesetManager",void 0),(0,K.Z)(this,"initedTileset",!1),(0,K.Z)(this,"lastViewStates",void 0),(0,K.Z)(this,"mapchange",()=>{var n;if(this.parent.isVisible()===!1)return;const{latLonBounds:a,zoom:u}=this.getCurrentView();if(this.mapService.version==="GAODE1.x"){const{visible:y}=this.parent.getLayerConfig();u<2&&y?(this.parent.updateLayerConfig({visible:!1}),this.layerService.reRender()):u>=2&&!y&&(this.parent.updateLayerConfig({visible:!0}),this.layerService.reRender())}this.lastViewStates&&this.lastViewStates.zoom===u&&this.lastViewStates.latLonBounds.toString()===a.toString()||(this.lastViewStates={zoom:u,latLonBounds:a},(n=this.tilesetManager)===null||n===void 0||n.throttleUpdate(u,a))}),(0,K.Z)(this,"viewchange",_4(this.mapchange,24)),this.parent=e;const r=this.parent.getContainer();this.rendererService=r.rendererService,this.layerService=r.layerService,this.mapService=r.mapService,this.pickingService=r.pickingService,this.tileLayerService=new YM({rendererService:this.rendererService,layerService:this.layerService,parent:e}),this.tilePickService=new e4({tileLayerService:this.tileLayerService,layerService:this.layerService,parent:e}),this.parent.setLayerPickService(this.tilePickService),this.proxy(e),this.initTileSetManager()}initTileSetManager(){var e;const r=this.parent.getSource();if(this.tilesetManager=r.tileset,this.initedTileset||(this.bindTilesetEvent(),this.initedTileset=!0),this.parent.isVisible()===!1)return;const{latLonBounds:n,zoom:a}=this.getCurrentView();(e=this.tilesetManager)===null||e===void 0||e.update(a,n)}getCurrentView(){const e=this.mapService.getBounds(),r=[e[0][0],e[0][1],e[1][0],e[1][1]],n=this.mapService.getZoom();return{latLonBounds:r,zoom:n}}bindTilesetEvent(){this.tilesetManager.on("tile-loaded",e=>{}),this.tilesetManager.on("tile-unload",e=>{this.tileUnLoad(e)}),this.tilesetManager.on("tile-error",(e,r)=>{this.tileError(e)}),this.tilesetManager.on("tile-update",()=>{this.tileUpdate()}),this.mapService.on("zoomend",this.mapchange),this.mapService.on("moveend",this.viewchange)}render(){this.tileLayerService.render()}getLayers(){return this.tileLayerService.getLayers()}getTiles(){return this.tileLayerService.getTiles()}getTile(e){return this.tileLayerService.getTile(e)}tileLoaded(e){}tileError(e){console.warn("error:",e)}destroy(){var e;this.mapService.off("zoomend",this.mapchange),this.mapService.off("moveend",this.viewchange),(e=this.tilesetManager)===null||e===void 0||e.destroy(),this.tileLayerService.destroy()}reload(){var e;this.tilesetManager.clear();const{latLonBounds:r,zoom:n}=this.getCurrentView();(e=this.tilesetManager)===null||e===void 0||e.update(n,r)}tileUnLoad(e){this.tileLayerService.removeTile(e.key)}tileUpdate(){var e=this;return(0,Nr.Z)(function*(){if(!e.tilesetManager)return;const r=e.parent.getMinZoom(),n=e.parent.getMaxZoom(),a=e.tilesetManager.tiles.filter(u=>u.isLoaded).filter(u=>u.isVisibleChange).filter(u=>u.data).filter(u=>u.z>=r&&u.z<n);yield Promise.all(a.map(function(){var u=(0,Nr.Z)(function*(y){if(e.tileLayerService.hasTile(y.key))e.tileLayerService.updateTileVisible(y),e.tilePickService.setPickState(),e.layerService.reRender();else{const A=g4(e.parent),O=new A(y,e.parent);yield O.initTileLayer(),e.tilePickService.setPickState(),O.getLayers().length!==0&&(e.tileLayerService.addTile(O),e.tileLayerService.updateTileVisible(y),e.layerService.reRender())}});return function(y){return u.apply(this,arguments)}}())),e.tilesetManager.isLoaded&&e.parent.emit("tiles-loaded",e.tilesetManager.currentTiles)})()}setPickState(e){}pickRender(e){this.tilePickService.pickRender(e)}selectFeature(e){this.tilePickService.selectFeature(e)}highlightPickedFeature(e){this.tilePickService.highlightPickedFeature(e)}proxy(e){v4.forEach(r=>{const n=e[r].bind(e);e[r]=(...a)=>(n(...a),this.getLayers().map(u=>{u[r](...a)}),r==="style"&&this.getTiles().forEach(u=>u.styleUpdate(...a)),e)})}}class y4 extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","TileDebugLayer"),(0,K.Z)(this,"zIndex",1e4),(0,K.Z)(this,"defaultSourceConfig",{data:[],options:{parser:{type:"testTile"}}})}buildModels(){return(0,Nr.Z)(function*(){})()}}const x4=`
layout(std140) uniform commonUniforms {
float u_opacity;
};
in vec3 vVertexNormal;
in float v_offset;
in vec4 v_Color;
#pragma include "scene_uniforms"
out vec4 outputColor;
void main() {
// float intensity = pow(0.5 + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);
float intensity = pow(v_offset + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);
// \u53BB\u9664\u80CC\u9762
if(intensity > 1.0) intensity = 0.0;
outputColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);
}
`,b4=`layout(location = 0) in vec3 a_Position;
layout(location = 1) vec4 a_Color;
layout(location = 13) in vec3 a_Normal;
layout(location = 14) in vec2 a_Uv;
layout(std140) uniform commonUniforms {
float u_opacity;
};
#pragma include "scene_uniforms"
out vec3 vVertexNormal;
out vec4 v_Color;
out float v_offset;
void main() {
float EARTH_RADIUS = 100.0;
v_Color = a_Color;
v_offset = min(((length(u_CameraPosition) - EARTH_RADIUS)/600.0) * 0.5 + 0.4, 1.0);
vVertexNormal = a_Normal;
gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);
}
`,{isNumber:E4}=es;class w4 extends Ml{getCommonUniformsInfo(){const{opacity:e=1}=this.layer.getLayerConfig(),r={u_opacity:E4(e)?e:1};return this.getUniformsBufferInfo(r)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.buildModels()})()}clearModels(){return""}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.layer.zIndex=-997,[yield e.layer.buildLayerModel({moduleName:"earthAtmoSphere",vertexShader:b4,fragmentShader:x4,triangulation:Sw,depth:{enable:!1},blend:e.getBlend()})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}const S4=`uniform sampler2D u_texture;
in vec2 v_texCoord;
in float v_lightWeight;
out vec4 outputColor;
void main() {
vec4 color = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y));
color.xyz = color.xyz * v_lightWeight;
outputColor = color;
}
`,T4=`// attribute vec4 a_Color;
layout(location = 0) in vec3 a_Position;
layout(location = 13) in vec3 a_Normal;
layout(location = 14) in vec2 a_Uv;
// attribute vec2 a_Extrude;
// attribute float a_Size;
// attribute float a_Shape;
layout(std140) uniform commonUniforms {
vec4 u_sunLight: [1.0, -10.5, 12.0,0.0];
float u_ambientRatio : 0.5;
float u_diffuseRatio : 0.3;
float u_specularRatio : 0.2;
};
#pragma include "scene_uniforms"
out vec2 v_texCoord;
out float v_lightWeight;
float calc_lighting(vec4 pos) {
vec3 worldPos = vec3(pos * u_ModelMatrix);
vec3 worldNormal = a_Normal;
// cal light weight
vec3 viewDir = normalize(u_CameraPosition - worldPos);
vec3 lightDir = normalize(u_sunLight.xyz);
vec3 halfDir = normalize(viewDir+lightDir);
// lambert
float lambert = dot(worldNormal, lightDir);
// specular
float specular = pow(max(0.0, dot(worldNormal, halfDir)), 32.0);
//sum to light weight
float lightWeight = u_ambientRatio + u_diffuseRatio * lambert + u_specularRatio * specular;
return lightWeight;
}
void main() {
v_texCoord = a_Uv;
float lightWeight = calc_lighting(vec4(a_Position, 1.0));
v_lightWeight = lightWeight;
gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);
}
`;class A4 extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"earthTime",3.4),(0,K.Z)(this,"sunX",1e3),(0,K.Z)(this,"sunY",1e3),(0,K.Z)(this,"sunZ",1e3),(0,K.Z)(this,"sunRadius",Math.sqrt(this.sunX*this.sunX+this.sunY*this.sunY+this.sunZ*this.sunZ))}getCommonUniformsInfo(){const{animateOption:e,globalOptions:r}=this.layer.getLayerConfig();e!=null&&e.enable&&(this.mapService.rotateY({reg:.002}),this.earthTime+=.02,this.sunY=10,this.sunX=Math.cos(this.earthTime)*(this.sunRadius-this.sunY),this.sunZ=Math.sin(this.earthTime)*(this.sunRadius-this.sunY));const n={u_sunLight:[this.sunX,this.sunY,this.sunZ,0],u_ambientRatio:(r==null?void 0:r.ambientRatio)||.6,u_diffuseRatio:(r==null?void 0:r.diffuseRatio)||.4,u_specularRatio:(r==null?void 0:r.specularRatio)||.1};return this.textures=[this.texture],this.getUniformsBufferInfo(n)}setEarthTime(e){this.earthTime=e,this.sunY=10,this.sunX=Math.cos(this.earthTime)*(this.sunRadius-this.sunY),this.sunZ=Math.sin(this.earthTime)*(this.sunRadius-this.sunY),this.layerService.throttleRenderLayers()}initModels(){var e=this;return(0,Nr.Z)(function*(){const{globalOptions:r}=e.layer.getLayerConfig();(r==null?void 0:r.earthTime)!==void 0&&e.setEarthTime(r.earthTime);const n=e.layer.getSource(),{createTexture2D:a}=e.rendererService;return e.texture=a({height:0,width:0}),n.data.images.then(u=>{e.texture=a({data:u[0],width:u[0].width,height:u[0].height}),e.textures=[e.texture],e.layerService.reRender()}),e.initUniformsBuffer(),e.buildModels()})()}clearModels(){return""}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.layer.zIndex=-998,[yield e.layer.buildLayerModel({moduleName:"earthBase",vertexShader:T4,fragmentShader:S4,triangulation:Sw,depth:{enable:!0},blend:e.getBlend()})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}const C4=`
in vec3 vVertexNormal;
in vec4 v_Color;
layout(std140) uniform commonUniforms {
float u_opacity;
};
out vec4 outputColor;
#pragma include "scene_uniforms"
void main() {
float intensity = - dot(normalize(vVertexNormal), normalize(u_CameraPosition));
// \u53BB\u9664\u80CC\u9762
if(intensity > 1.0) intensity = 0.0;
outputColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);
}
`,M4=`layout(location = 0) in vec3 a_Position;
layout(location = 1) vec4 a_Color;
layout(location = 13) in vec3 a_Normal;
layout(location = 14) in vec2 a_Uv;
layout(std140) uniform commonUniforms {
float u_opacity;
};
#pragma include "scene_uniforms"
out vec3 vVertexNormal;
out vec4 v_Color;
void main() {
v_Color = a_Color;
vVertexNormal = a_Normal;
gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);
}
`,{isNumber:P4}=es;class R4 extends Ml{getCommonUniformsInfo(){const{opacity:e=1}=this.layer.getLayerConfig(),r={u_opacity:P4(e)?e:1};return this.getUniformsBufferInfo(r)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.buildModels()})()}clearModels(){return""}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.layer.zIndex=-999,[yield e.layer.buildLayerModel({moduleName:"earthBloom",vertexShader:M4,fragmentShader:C4,triangulation:yC,depth:{enable:!1},blend:e.getBlend()})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}const I4={base:A4,atomSphere:w4,bloomSphere:R4},L4=["base","atomSphere","bloomSphere"];class D4 extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","EarthLayer"),(0,K.Z)(this,"defaultSourceConfig",{data:[],options:{parser:{type:"json"}}})}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new I4[r](e),yield e.initLayerModels()})()}setEarthTime(e){this.layerModel&&this.layerModel.setEarthTime?this.layerModel.setEarthTime(e):console.warn("\u8BF7\u5728 scene loaded \u4E4B\u540E\u6267\u884C\u8BE5\u65B9\u6CD5\uFF01")}getModelType(){var e;const r=this.styleAttributeService.getLayerStyleAttribute("shape");let n=(r==null||(e=r.scale)===null||e===void 0?void 0:e.field)||"base";return L4.indexOf(n)<0&&(n="base"),n}}function _2(t,e,r){const n=qw(t,t.VERTEX_SHADER,e),a=qw(t,t.FRAGMENT_SHADER,r);if(!n||!a)return null;const u=t.createProgram();if(!u)return null;if(t.attachShader(u,n),t.attachShader(u,a),t.linkProgram(u),!t.getProgramParameter(u,t.LINK_STATUS)){const Z=t.getProgramInfoLog(u);return console.warn("Failed to link program: "+Z),t.deleteProgram(u),t.deleteShader(a),t.deleteShader(n),null}const A=t.getProgramParameter(u,t.ACTIVE_ATTRIBUTES);for(let Z=0;Z<A;Z++){const Y=t.getActiveAttrib(u,Z);u[Y.name]=t.getAttribLocation(u,Y.name)}const O=t.getProgramParameter(u,t.ACTIVE_UNIFORMS);for(let Z=0;Z<O;Z++){const Y=t.getActiveUniform(u,Z);u[Y.name]=t.getUniformLocation(u,Y.name)}return u.vertexShader=n,u.fragmentShader=a,u}function qw(t,e,r){const n=t.createShader(e);if(n==null)return console.warn("unable to create shader"),null;if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){const u=t.getShaderInfoLog(n);return console.warn("Failed to compile shader: "+u),t.deleteShader(n),null}return n}function Qm(t,e,r,n,a){const u=t.createTexture();return t.bindTexture(t.TEXTURE_2D,u),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,a,0,t.RGBA,t.UNSIGNED_BYTE,r),t.bindTexture(t.TEXTURE_2D,null),u}function O4(t,e,r){const n=t.createTexture();return t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r),t.bindTexture(t.TEXTURE_2D,null),n}function p1(t,e,r){t.activeTexture(t.TEXTURE0+r),t.bindTexture(t.TEXTURE_2D,e)}function y2(t,e){const r=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,r),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),r}function BO(t,e,r,n,a){const u=t.createBuffer();u||console.warn("failed create vertex buffer"),t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,r,t.STATIC_DRAW);const y=t.getAttribLocation(a,e);return t.vertexAttribPointer(y,n,t.FLOAT,!1,0,0),t.enableVertexAttribArray(y),t.bindBuffer(t.ARRAY_BUFFER,null),{buffer:u,attr:y,count:n}}function FO(t,e){const r=t.createBuffer();return r?(t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,r),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e,t.STATIC_DRAW)):console.warn("failed create vertex buffer"),r}function kO(t,e,r,n,a){const u=t.getUniformLocation(n,e);return u===null||u<0?console.warn("\u65E0\u6CD5\u83B7\u53D6 uniform \u53D8\u91CF\u7684\u5B58\u50A8\u4F4D\u7F6E"):B4(t,u,r,a),u}function B4(t,e,r,n){switch(n){case"float":t.uniform1f(e,r);break;case"vec2":t.uniform2fv(e,r);break;case"vec3":t.uniform3fv(e,r);break;case"vec4":t.uniform4fv(e,r);break;case"bool":t.uniform1i(e,r);break;case"sampler2d":break;case"mat4":t.uniformMatrix4fv(e,!1,r);break}}function NO(t){const{drawingBufferWidth:e,drawingBufferHeight:r}=t,n=e,a=r,u=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,u);const y=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,y),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,n,a),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,y);const A=t.createTexture();return u.texture=A,u.width=n,u.height=a,t.bindTexture(t.TEXTURE_2D,A),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,a,0,t.RGBA,t.UNSIGNED_BYTE,null),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,A,0),t.bindTexture(t.TEXTURE_2D,null),t.bindFramebuffer(t.FRAMEBUFFER,null),{FRAMEBUFFER:u,OFFER_SCREEN_WIDTH:n,OFFER_SCREEN_HEIGHT:a}}const F4=`
precision mediump float;
attribute float a_index;
uniform sampler2D u_particles;
uniform float u_particles_res;
varying vec2 v_particle_pos;
void main() {
vec4 color = texture2D(u_particles, vec2(
fract(a_index / u_particles_res),
floor(a_index / u_particles_res) / u_particles_res)
);
// decode current particle position from the pixel's RGBA value
v_particle_pos = vec2( color.r / 255.0 + color.b, color.g / 255.0 + color.a);
gl_PointSize = 1.0;
gl_Position = vec4(2.0 * v_particle_pos.x - 1.0, 1.0 - 2.0 * v_particle_pos.y, 0, 1);
}`,k4=`
precision mediump float;
uniform sampler2D u_wind;
uniform vec2 u_wind_min;
uniform vec2 u_wind_max;
uniform sampler2D u_color_ramp;
varying vec2 v_particle_pos;
void main() {
vec2 velocity = mix(u_wind_min, u_wind_max, texture2D(u_wind, v_particle_pos).rg);
float speed_t = length(velocity) / length(u_wind_max);
// color ramp is encoded in a 16x16 texture
vec2 ramp_pos = vec2( fract(16.0 * speed_t), floor(16.0 * speed_t) / 16.0);
gl_FragColor = texture2D(u_color_ramp, ramp_pos);
}`,N4=`
precision mediump float;
attribute vec2 a_pos;
varying vec2 v_tex_pos;
void main() {
v_tex_pos = a_pos;
gl_Position = vec4(1.0 - 2.0 * a_pos, 0, 1);
// framebuffer \u59CB\u7EC8\u7528\u94FA\u6EE1\u5C4F\u5E55\u7684 texture
}`,z4=`
precision highp float;
uniform sampler2D u_particles;
uniform sampler2D u_wind;
uniform vec2 u_wind_res;
uniform vec2 u_wind_min;
uniform vec2 u_wind_max;
uniform float u_rand_seed;
uniform float u_speed_factor;
uniform float u_drop_rate;
uniform float u_drop_rate_bump;
varying vec2 v_tex_pos;
// pseudo-random generator
const vec3 rand_constants = vec3(12.9898, 78.233, 4375.85453);
float rand(const vec2 co) {
float t = dot(rand_constants.xy, co);
return fract(sin(t) * (rand_constants.z + t));
}
// wind speed lookup; use manual bilinear filtering based on 4 adjacent pixels for smooth interpolation
vec2 lookup_wind(const vec2 uv) {
// return texture2D(u_wind, uv).rg; // lower-res hardware filtering
vec2 px = 1.0 / u_wind_res;
vec2 vc = (floor(uv * u_wind_res)) * px;
vec2 f = fract(uv * u_wind_res);
vec2 tl = texture2D(u_wind, vc).rg;
vec2 tr = texture2D(u_wind, vc + vec2(px.x, 0)).rg;
vec2 bl = texture2D(u_wind, vc + vec2(0, px.y)).rg;
vec2 br = texture2D(u_wind, vc + px).rg;
return mix(mix(tl, tr, f.x), mix(bl, br, f.x), f.y);
}
void main() {
vec4 color = texture2D(u_particles, v_tex_pos);
vec2 pos = vec2(
color.r / 255.0 + color.b,
color.g / 255.0 + color.a); // decode particle position from pixel RGBA
vec2 velocity = mix(u_wind_min, u_wind_max, lookup_wind(pos));
float speed_t = length(velocity) / length(u_wind_max);
// take EPSG:4236 distortion into account for calculating where the particle moved
float distortion = cos(radians(pos.y * 180.0 - 90.0));
vec2 offset = vec2(velocity.x / distortion, -velocity.y) * 0.0001 * u_speed_factor;
// update particle position, wrapping around the date line
pos = fract(1.0 + pos + offset);
// a random seed to use for the particle drop
vec2 seed = (pos + v_tex_pos) * u_rand_seed;
// drop rate is a chance a particle will restart at random position, to avoid degeneration
float drop_rate = u_drop_rate + speed_t * u_drop_rate_bump;
float drop = step(1.0 - drop_rate, rand(seed));
vec2 random_pos = vec2(
rand(seed + 1.3),
rand(seed + 2.1));
pos = mix(pos, random_pos, drop);
// encode the new particle position back into RGBA
gl_FragColor = vec4(
fract(pos * 255.0),
floor(pos * 255.0) / 255.0);
}`,U4=`
precision mediump float;
attribute vec2 a_pos;
varying vec2 v_tex_pos;
void main() {
v_tex_pos = a_pos;
gl_Position = vec4(1.0 - 2.0 * a_pos, 0.0, 1.0);
gl_PointSize = 100.0;
}`,Z4=`
precision mediump float;
uniform sampler2D u_screen;
uniform float u_opacity;
varying vec2 v_tex_pos;
void main() {
vec4 color = texture2D(u_screen, 1.0 - v_tex_pos);
// a hack to guarantee opacity fade out even with a value close to 1.0
gl_FragColor = vec4(floor(255.0 * color * u_opacity) / 255.0);
}`;function Yw(t){let e=document.createElement("canvas");const r=e.getContext("2d");e.width=256,e.height=1;const n=r.createLinearGradient(0,0,256,0);for(const a of Object.keys(t))n.addColorStop(+a,t[+a]);return r.fillStyle=n,r.fillRect(0,0,256,1),e=null,new Uint8Array(r.getImageData(0,0,256,1).data)}function $w(t,e,r,n){t.bindBuffer(t.ARRAY_BUFFER,e),t.enableVertexAttribArray(r),t.vertexAttribPointer(r,n,t.FLOAT,!1,0,0)}function f1(t,e,r){t.bindFramebuffer(t.FRAMEBUFFER,e),r&&t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0)}class V4{constructor(e){(0,K.Z)(this,"width",512),(0,K.Z)(this,"height",512),(0,K.Z)(this,"pixels",void 0),(0,K.Z)(this,"fadeOpacity",void 0),(0,K.Z)(this,"speedFactor",void 0),(0,K.Z)(this,"dropRate",void 0),(0,K.Z)(this,"dropRateBump",void 0),(0,K.Z)(this,"gl",void 0),(0,K.Z)(this,"drawProgram",void 0),(0,K.Z)(this,"fullScreenProgram",void 0),(0,K.Z)(this,"updateProgram",void 0),(0,K.Z)(this,"rampColors",void 0),(0,K.Z)(this,"numParticles",65536),(0,K.Z)(this,"numParticlesSize",void 0),(0,K.Z)(this,"particleStateResolution",void 0),(0,K.Z)(this,"quadBuffer",void 0),(0,K.Z)(this,"particleIndexBuffer",void 0),(0,K.Z)(this,"framebuffer",void 0),(0,K.Z)(this,"colorRampTexture",void 0),(0,K.Z)(this,"backgroundTexture",void 0),(0,K.Z)(this,"screenTexture",void 0),(0,K.Z)(this,"particleStateTexture0",void 0),(0,K.Z)(this,"particleStateTexture1",void 0),(0,K.Z)(this,"windTexture",void 0),(0,K.Z)(this,"windData",void 0),this.gl=e.glContext,this.width=e.imageWidth,this.height=e.imageHeight,this.fadeOpacity=e.fadeOpacity,this.speedFactor=e.speedFactor,this.dropRate=e.dropRate,this.dropRateBump=e.dropRateBump,this.rampColors=e.rampColors,this.init()}init(){const e=this.gl;this.fadeOpacity=.996,this.speedFactor=.25,this.dropRate=.003,this.dropRateBump=.01,this.drawProgram=_2(e,F4,k4),this.fullScreenProgram=_2(e,U4,Z4),this.updateProgram=_2(e,N4,z4),this.quadBuffer=y2(e,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),this.framebuffer=e.createFramebuffer(),this.colorRampTexture=Qm(this.gl,this.gl.LINEAR,Yw(this.rampColors),16,16);const r=new Uint8Array(this.width*this.height*4);this.backgroundTexture=Qm(e,e.NEAREST,r,this.width,this.height),this.screenTexture=Qm(e,e.NEAREST,r,this.width,this.height);const n=this.particleStateResolution=Math.ceil(Math.sqrt(this.numParticles));this.numParticlesSize=n*n;const a=new Uint8Array(this.numParticlesSize*4);for(let y=0;y<a.length;y++)a[y]=Math.floor(Math.random()*256);this.particleStateTexture0=Qm(e,e.NEAREST,a,n,n),this.particleStateTexture1=Qm(e,e.NEAREST,a,n,n);const u=new Float32Array(this.numParticlesSize);for(let y=0;y<this.numParticlesSize;y++)u[y]=y;this.particleIndexBuffer=y2(e,u)}setWind(e){this.windData=e,this.windTexture=O4(this.gl,this.gl.LINEAR,e.image)}updateParticelNum(e){const r=this.gl;if(e!==this.numParticles){this.numParticles=e;const n=this.particleStateResolution=Math.ceil(Math.sqrt(this.numParticles));this.numParticlesSize=n*n;const a=new Uint8Array(this.numParticlesSize*4);for(let y=0;y<a.length;y++)a[y]=Math.floor(Math.random()*256);this.particleStateTexture0=Qm(r,r.NEAREST,a,n,n),this.particleStateTexture1=Qm(r,r.NEAREST,a,n,n);const u=new Float32Array(this.numParticlesSize);for(let y=0;y<this.numParticlesSize;y++)u[y]=y;this.particleIndexBuffer=y2(r,u)}}updateWindDir(e,r,n,a){this.windData.uMin=e,this.windData.uMax=r,this.windData.vMin=n,this.windData.vMax=a}updateColorRampTexture(e){if(this.isColorChanged(e)){this.rampColors=e;const r=this.gl;r.deleteTexture(this.colorRampTexture),this.colorRampTexture=Qm(r,r.LINEAR,Yw(e),16,16)}}isColorChanged(e){const r=Object.keys(e);for(const n of r){const a=Number(n);if(!this.rampColors[a]||this.rampColors[a]&&this.rampColors[a]!==e[a])return!0}return!1}reSize(e,r){if(e!==this.width||r!==this.height){const n=this.gl;n.deleteTexture(this.backgroundTexture),n.deleteTexture(this.screenTexture),this.width=e,this.height=r;const a=new Uint8Array(e*r*4);this.backgroundTexture=Qm(n,n.NEAREST,a,e,r),this.screenTexture=Qm(n,n.NEAREST,a,e,r)}}draw(){var e;if((e=this.windData)!==null&&e!==void 0&&e.image){const r=this.gl;return p1(r,this.windTexture,0),p1(r,this.particleStateTexture0,1),this.drawScreen(),this.updateParticles(),{d:this.pixels,w:this.width,h:this.height}}else return{d:new Uint8Array([0,0,0,0]),w:1,h:1}}drawScreen(){const e=this.gl;f1(e,this.framebuffer,this.screenTexture),e.viewport(0,0,this.width,this.height),e.disable(e.BLEND),this.drawFullTexture(this.backgroundTexture,this.fadeOpacity),this.drawParticles(),this.pixels=new Uint8Array(4*this.width*this.height),e.readPixels(0,0,this.width,this.height,e.RGBA,e.UNSIGNED_BYTE,this.pixels),f1(e,null,null),e.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height);const r=this.backgroundTexture;this.backgroundTexture=this.screenTexture,this.screenTexture=r}drawFullTexture(e,r){const n=this.gl,a=this.fullScreenProgram;n.useProgram(a),n.bindBuffer(n.ARRAY_BUFFER,this.quadBuffer),n.vertexAttribPointer(a.a_pos,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(a.a_pos),n.bindBuffer(n.ARRAY_BUFFER,null),p1(n,e,2),n.uniform1i(a.u_screen,2),n.uniform1f(a.u_opacity,r),n.drawArrays(n.TRIANGLES,0,6)}drawParticles(){const e=this.gl,r=this.drawProgram;e.useProgram(r),$w(e,this.particleIndexBuffer,r.a_index,1),p1(e,this.colorRampTexture,2),e.uniform1i(r.u_wind,0),e.uniform1i(r.u_particles,1),e.uniform1i(r.u_color_ramp,2),e.uniform1f(r.u_particles_res,this.particleStateResolution),e.uniform2f(r.u_wind_min,this.windData.uMin,this.windData.vMin),e.uniform2f(r.u_wind_max,this.windData.uMax,this.windData.vMax),e.drawArrays(e.POINTS,0,this.numParticlesSize)}updateParticles(){const e=this.gl;f1(e,this.framebuffer,this.particleStateTexture1),e.viewport(0,0,this.particleStateResolution,this.particleStateResolution);const r=this.updateProgram;e.useProgram(r),$w(e,this.quadBuffer,r.a_pos,2),e.uniform1i(r.u_wind,0),e.uniform1i(r.u_particles,1),e.uniform1f(r.u_rand_seed,Math.random()),e.uniform2f(r.u_wind_res,this.windData.image.width*2,this.windData.image.height*2),e.uniform2f(r.u_wind_min,this.windData.uMin,this.windData.vMin),e.uniform2f(r.u_wind_max,this.windData.uMax,this.windData.vMax),e.uniform1f(r.u_speed_factor,this.speedFactor),e.uniform1f(r.u_drop_rate,this.dropRate),e.uniform1f(r.u_drop_rate_bump,this.dropRateBump),e.drawArrays(e.TRIANGLES,0,6);const n=this.particleStateTexture0;this.particleStateTexture0=this.particleStateTexture1,this.particleStateTexture1=n,f1(e,null,null)}destroy(){this.gl.deleteBuffer(this.quadBuffer),this.gl.deleteBuffer(this.particleIndexBuffer),this.gl.deleteFramebuffer(this.framebuffer),this.gl.deleteShader(this.drawProgram.vertexShader),this.gl.deleteShader(this.drawProgram.fragmentShader),this.gl.deleteProgram(this.drawProgram),this.gl.deleteShader(this.fullScreenProgram.vertexShader),this.gl.deleteShader(this.fullScreenProgram.fragmentShader),this.gl.deleteProgram(this.fullScreenProgram),this.gl.deleteShader(this.updateProgram.vertexShader),this.gl.deleteShader(this.updateProgram.fragmentShader),this.gl.deleteProgram(this.updateProgram),this.gl.deleteTexture(this.colorRampTexture),this.gl.deleteTexture(this.backgroundTexture),this.gl.deleteTexture(this.screenTexture),this.gl.deleteTexture(this.particleStateTexture0),this.gl.deleteTexture(this.particleStateTexture1),this.gl.deleteTexture(this.windTexture)}}const j4=`precision mediump float;
uniform float u_opacity: 1.0;
uniform sampler2D u_texture;
varying vec2 v_texCoord;
void main() {
vec4 color = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y));
gl_FragColor = color;
gl_FragColor.a *= u_opacity;
}
`,H4=`precision highp float;
uniform mat4 u_ModelMatrix;
attribute vec3 a_Position;
attribute vec2 a_Uv;
varying vec2 v_texCoord;
#pragma include "projection"
void main() {
v_texCoord = a_Uv;
vec4 project_pos = project_position(vec4(a_Position, 1.0));
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
}
`,Kw={0:"#3288bd",.1:"#66c2a5",.2:"#abdda4",.3:"#e6f598",.4:"#fee08b",.5:"#fdae61",.6:"#f46d43",1:"#d53e4f"};class G4 extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"colorModel",void 0),(0,K.Z)(this,"wind",void 0),(0,K.Z)(this,"imageCoords",void 0),(0,K.Z)(this,"sizeScale",.5),(0,K.Z)(this,"frequency",new Gc(7.2)),(0,K.Z)(this,"cacheZoom",void 0)}render(e){this.drawColorMode(e),this.frequency.run(()=>{this.drawWind()})}getUninforms(){throw new Error("Method not implemented.")}initModels(){var e=this;return(0,Nr.Z)(function*(){var r,n;const{uMin:a=-21.32,uMax:u=26.8,vMin:y=-21.57,vMax:A=21.42,fadeOpacity:O=.996,speedFactor:Z=.25,dropRate:Y=.003,dropRateBump:Q=.01,rampColors:ae=Kw,sizeScale:xe=.5}=e.layer.getLayerConfig(),{createTexture2D:Be}=e.rendererService,it=e.layer.getSource();e.texture=Be({height:0,width:0}),e.cacheZoom=Math.floor(e.mapService.getZoom());const gt=e.rendererService.getGLContext();e.imageCoords=(r=it.data)===null||r===void 0?void 0:r.dataArray[0].coordinates,(n=it.data)===null||n===void 0||(n=n.images)===null||n===void 0||n.then(Rt=>{var Yt;e.sizeScale=xe*e.getZoomScale();const{imageWidth:vr,imageHeight:ln}=e.getWindSize(),cn={glContext:gt,imageWidth:vr,imageHeight:ln,fadeOpacity:O,speedFactor:Z,dropRate:Y,dropRateBump:Q,rampColors:ae};e.wind=new V4(cn),e.wind.setWind({uMin:a,uMax:u,vMin:y,vMax:A,image:Rt[0]}),(Yt=e.texture)===null||Yt===void 0||Yt.destroy(),e.texture=Be({width:vr,height:ln}),e.layerService.reRender()});const Bt=yield e.layer.buildLayerModel({moduleName:"wind",vertexShader:H4,fragmentShader:j4,triangulation:h_,primitive:Ee.TRIANGLES,depth:{enable:!1}});return e.colorModel=Bt,[Bt]})()}getWindSize(){const e=this.mapService.lngLatToPixel(this.imageCoords[0]),r=this.mapService.lngLatToPixel(this.imageCoords[1]),n=Math.min(Math.floor((r.x-e.x)*this.sizeScale),2048),a=Math.min(Math.floor((e.y-r.y)*this.sizeScale),2048);return{imageWidth:n,imageHeight:a}}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initModels()})()}clearModels(){var e,r;(e=this.texture)===null||e===void 0||e.destroy(),(r=this.wind)===null||r===void 0||r.destroy()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}getZoomScale(){return Math.min((this.cacheZoom+4)/30*2,2)}drawWind(){if(this.wind){const{uMin:e=-21.32,uMax:r=26.8,vMin:n=-21.57,vMax:a=21.42,numParticles:u=65535,fadeOpacity:y=.996,speedFactor:A=.25,dropRate:O=.003,dropRateBump:Z=.01,rampColors:Y=Kw,sizeScale:Q=.5}=this.layer.getLayerConfig();let ae=u;const xe=Math.floor(this.mapService.getZoom());if(typeof Q=="number"&&Q!==this.sizeScale||xe!==this.cacheZoom){const Bt=this.getZoomScale();this.sizeScale=Q,ae*=Bt;const{imageWidth:Rt,imageHeight:Yt}=this.getWindSize();this.wind.reSize(Rt,Yt),this.cacheZoom=xe}this.wind.updateWindDir(e,r,n,a),this.wind.updateParticelNum(ae),this.wind.updateColorRampTexture(Y),this.wind.fadeOpacity=y,this.wind.speedFactor=A,this.wind.dropRate=O,this.wind.dropRateBump=Z;const{d:Be,w:it,h:gt}=this.wind.draw();this.rendererService.setBaseState(),this.texture.update({data:Be,width:it,height:gt})}}drawColorMode(e={}){var r;const{opacity:n}=this.layer.getLayerConfig();this.layerService.beforeRenderData(this.layer),this.layer.hooks.beforeRender.call(),this.layerService.renderMask(this.layer.masks),(r=this.colorModel)===null||r===void 0||r.draw({uniforms:{u_opacity:n||1,u_texture:this.texture},blend:this.getBlend(),stencil:this.getStencil(e)}),this.layer.hooks.afterRender.call()}}var W4={wind:G4};class X4 extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","WindLayer")}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new W4[r](e),yield e.initLayerModels()})()}renderModels(e={}){return this.layerModel&&this.layerModel.render(e),this}getDefaultConfig(){const e=this.getModelType();return{wind:{}}[e]}getModelType(){return"wind"}}class q4 extends Xd{constructor(...e){super(...e),(0,K.Z)(this,"isMoving",!1),(0,K.Z)(this,"maskLayer",void 0),(0,K.Z)(this,"move",r=>{switch(r.stopPropagation(),r.type){case"touchcancel":case"touchend":case"mouseup":{var n;this.isMoving=!1,["mouseup","mousemove","touchend","touchcancel","touchmove"].forEach(a=>{document.removeEventListener(a,this.move)}),(n=this.scene)===null||n===void 0||n.render();break}case"mousedown":case"touchstart":this.isMoving=!0,["mouseup","mousemove","touchend","touchcancel","touchmove"].forEach(a=>{document.addEventListener(a,this.move)});case"mousemove":case"touchmove":{if(this.isMoving)if(this.controlOption.orientation==="vertical"){let a;if("pageX"in r?a=r.pageX:r.touches&&r.touches.length&&r.touches[0].pageX?a=r.touches[0].pageX:r.changedTouches&&r.changedTouches.length&&(a=r.changedTouches[0].pageX),!a)break;const u=this.getContainerDOMRect(),y=this.getContainerSize(),A=y[0],O=(u==null?void 0:u.left)||0,Z=a-O+window.scrollX-document.documentElement.clientLeft,Y=A-Math.min(Math.max(0,A-Z),A),Q=Y/A;this.setOptions({ratio:Q}),this.emit("moving",{size:[Y,y[1]],ratio:[Q,0]})}else{let a;if("pageY"in r?a=r.pageY:r.touches&&r.touches.length&&r.touches[0].pageY?a=r.touches[0].pageY:r.changedTouches&&r.changedTouches.length&&(a=r.changedTouches[0].pageY),!a)break;const u=this.getContainerDOMRect(),y=this.getContainerSize(),A=y[1],O=(u==null?void 0:u.top)||0,Z=a-O+window.scrollY-document.documentElement.clientTop,Y=A-Math.min(Math.max(0,A-Z),A),Q=Y/A;this.setOptions({ratio:Q}),this.emit("moving",{size:[y[0],Y],ratio:[0,Q]})}break}default:break}}),(0,K.Z)(this,"getMaskLayer",()=>(console.log(this.getMaskGeoData()),new u1({visible:!1}).source(this.getMaskGeoData()).shape("fill").color("red").style({opacity:.1}))),(0,K.Z)(this,"updateMask",()=>{var r;if(!this.mapsService)return;const n=this.getMaskGeoData();(r=this.maskLayer)===null||r===void 0||r.setData(n)})}getDefault(){return(0,Wt.Z)((0,Wt.Z)({},super.getDefault()),{},{layers:[],rightLayers:[],ratio:.5,orientation:"vertical"})}onAdd(){const e=Xo("div","l7-control-swipe");Xo("button","l7-control-swipe__button",e);const{orientation:r="vertical",ratio:n=.5}=this.controlOption;return r==="horizontal"?(e.style.top=n*100+"%",e.style.left=""):(e.style.left=n*100+"%",e.style.top=""),e.classList.add(r),e}addTo(e){this.mapsService=e.mapService,this.renderService=e.rendererService,this.layerService=e.layerService,this.controlService=e.controlService,this.configService=e.globalConfigService,this.scene=e.sceneService,this.sceneContainer=e,this.isShow=!0,this.container=this.onAdd();const{className:r,style:n,layers:a,rightLayers:u}=this.controlOption;r&&this.setClassName(r),n&&this.setStyle(n),this.mapsService.getMarkerContainer().appendChild(this.container),this.maskLayer=this.getMaskLayer(),this.registerEvent();const y=cp(e);return this.maskLayer.setContainer(y),this.scene.addLayer(this.maskLayer),this.addMaskToLayers(a,!1),this.addMaskToLayers(u,!0),this.emit("add",this),this}onRemove(){if(this.maskLayer){var e;const{layers:r,rightLayers:n}=this.controlOption;this.removeMaskFromLayers(r),this.removeMaskFromLayers(n),(e=this.layerService)===null||e===void 0||e.remove(this.maskLayer)}this.unRegisterEvent(),this.removeAllListeners()}show(){var e;const r=this.container;tc(r,"l7-control-swipe_hide");const{layers:n,rightLayers:a}=this.controlOption;n.forEach(u=>u.enableMask()),a.forEach(u=>u.enableMask()),(e=this.scene)===null||e===void 0||e.render(),this.isShow=!0,this.emit("show",this)}hide(){var e;const r=this.container;dl(r,"l7-control-swipe_hide");const{layers:n,rightLayers:a}=this.controlOption;n.forEach(u=>u.disableMask()),a.forEach(u=>u.disableMask()),(e=this.scene)===null||e===void 0||e.render(),this.isShow=!1,this.emit("hide",this)}setOptions(e){const r=(0,Wt.Z)((0,Wt.Z)({},this.controlOption),e);if(e.className&&this.setClassName(e.className),e.style&&this.setStyle(e.style),(e.orientation||e.ratio!==void 0)&&this.setOrientationAndRatio(r.orientation,r.ratio),e.layers){const n=e.layers,a=this.controlOption.layers;this.setLayers(n,a,!1)}if(e.rightLayers){const n=e.rightLayers,a=this.controlOption.rightLayers;this.setLayers(n,a,!0)}this.controlOption=r,this.updateMask()}registerEvent(){this.container.addEventListener("mousedown",this.move),this.container.addEventListener("touchstart",this.move),this.mapsService.on("camerachange",this.updateMask)}unRegisterEvent(){var e;this.container.removeEventListener("mousedown",this.move),this.container.removeEventListener("touchstart",this.move),(e=this.mapsService)===null||e===void 0||e.off("camerachange",this.updateMask)}setOrientationAndRatio(e="vertical",r=.5){this.container.classList.remove("horizontal","vertical"),this.container.classList.add(e),e==="horizontal"?(this.container.style.top=r*100+"%",this.container.style.left=""):(this.container.style.left=r*100+"%",this.container.style.top="")}setLayers(e,r,n=!1){const a=e.filter(y=>r.includes(y)===!1),u=r.filter(y=>e.includes(y)===!1);this.addMaskToLayers(a,n),this.removeMaskFromLayers(u)}addMaskToLayers(e,r){e.forEach(n=>{n.updateLayerConfig({maskInside:!r}),n.addMask(this.maskLayer)})}removeMaskFromLayers(e){e.forEach(r=>{r.updateLayerConfig({maskInside:!0}),r.removeMask(this.maskLayer)})}getMaskGeoData(){const{ratio:e=.5,orientation:r="vertical"}=this.controlOption,n=r==="vertical",[a,u]=this.getBounds(),[y,A]=a,[O,Z]=u;let Y;if(n){const ae=y+(O-y)*e;Y=[[y,Z],[ae,Z],[ae,A],a,[y,Z]]}else{const ae=this.getContainerSize(),Be=this.mapsService.containerToLngLat([ae[0],ae[1]*e]).lat;Y=[[y,Z],u,[O,Be],[y,Be],[y,Z]]}return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[Y]}}]}}getContainerDOMRect(){var e;return(e=this.mapsService.getContainer())===null||e===void 0?void 0:e.getBoundingClientRect()}getContainerSize(){return this.mapsService.getSize()}getBounds(){return this.mapsService.getBounds()}addLayer(e,r=!1){const n=Array.isArray(e)?e:[e];if(r){const a=this.controlOption.rightLayers.concat(...n);this.setOptions({rightLayers:a})}else{const a=this.controlOption.layers.concat(...n);this.setOptions({layers:a})}}removeLayer(e){const r=Array.isArray(e)?e:[e],n=this.controlOption.layers.filter(u=>r.includes(u)),a=this.controlOption.rightLayers.filter(u=>r.includes(u));this.setOptions({layers:n,rightLayers:a})}removeLayers(){this.setOptions({layers:[],rightLayers:[]})}}class Y4 extends Xd{constructor(...e){super(...e),(0,K.Z)(this,"disabled",void 0),(0,K.Z)(this,"zoomInButton",void 0),(0,K.Z)(this,"zoomOutButton",void 0),(0,K.Z)(this,"zoomNumDiv",void 0),(0,K.Z)(this,"zoomIn",()=>{!this.disabled&&this.mapsService.getZoom()<this.mapsService.getMaxZoom()&&this.mapsService.zoomIn()}),(0,K.Z)(this,"zoomOut",()=>{!this.disabled&&this.mapsService.getZoom()>this.mapsService.getMinZoom()&&this.mapsService.zoomOut()}),(0,K.Z)(this,"updateDisabled",()=>{const r=this.mapsService;this.zoomInButton.removeAttribute("disabled"),this.zoomOutButton.removeAttribute("disabled"),(this.disabled||r.getZoom()<=r.getMinZoom())&&this.zoomOutButton.setAttribute("disabled","true"),this.controlOption.showZoom&&this.zoomNumDiv&&(this.zoomNumDiv.innerText=String(Math.floor(r.getZoom()))),(this.disabled||r.getZoom()>=r.getMaxZoom())&&this.zoomInButton.setAttribute("disabled","true")})}getDefault(e){return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{position:Mt.BOTTOMRIGHT,name:"zoom",zoomInText:km("l7-icon-enlarge"),zoomInTitle:"Zoom in",zoomOutText:km("l7-icon-narrow"),zoomOutTitle:"Zoom out",showZoom:!1})}setOptions(e){super.setOptions(e),this.checkUpdateOption(e,["zoomInText","zoomInTitle","zoomOutText","zoomOutTitle","showZoom"])&&this.resetButtonGroup(this.container)}onAdd(){const e=Xo("div","l7-control-zoom");return this.resetButtonGroup(e),this.mapsService.on("zoomend",this.updateDisabled),this.mapsService.on("zoomchange",this.updateDisabled),e}onRemove(){this.mapsService.off("zoomend",this.updateDisabled),this.mapsService.off("zoomchange",this.updateDisabled)}disable(){return this.disabled=!0,this.updateDisabled(),this}enable(){return this.disabled=!1,this.updateDisabled(),this}resetButtonGroup(e){Ac(e),this.zoomInButton=this.createButton(this.controlOption.zoomInText,this.controlOption.zoomInTitle,"l7-button-control",e,this.zoomIn),this.controlOption.showZoom&&(this.zoomNumDiv=this.createButton("0","","l7-button-control l7-control-zoom__number",e)),this.zoomOutButton=this.createButton(this.controlOption.zoomOutText,this.controlOption.zoomOutTitle,"l7-button-control",e,this.zoomOut),this.updateDisabled()}createButton(e,r,n,a,u){const y=Xo("button",n,a);return typeof e=="string"?y.innerHTML=e:y.append(e),y.title=r,u&&y.addEventListener("click",u),y}}class Jw extends Yl.EventEmitter{get lngLat(){var e;return(e=this.popupOption.lngLat)!==null&&e!==void 0?e:{lng:0,lat:0}}set lngLat(e){this.popupOption.lngLat=e}constructor(e){super(),(0,K.Z)(this,"popupOption",void 0),(0,K.Z)(this,"mapsService",void 0),(0,K.Z)(this,"sceneService",void 0),(0,K.Z)(this,"layerService",void 0),(0,K.Z)(this,"scene",void 0),(0,K.Z)(this,"closeButton",void 0),(0,K.Z)(this,"container",void 0),(0,K.Z)(this,"content",void 0),(0,K.Z)(this,"contentTitle",void 0),(0,K.Z)(this,"contentPanel",void 0),(0,K.Z)(this,"tip",void 0),(0,K.Z)(this,"isShow",!0),(0,K.Z)(this,"onMouseMove",n=>{var a;const u=this.mapsService.getMapContainer(),{left:y=0,top:A=0}=(a=u==null?void 0:u.getBoundingClientRect())!==null&&a!==void 0?a:{};this.setPopupPosition(n.clientX-y,n.clientY-A)}),(0,K.Z)(this,"updateLngLatPosition",()=>{if(!this.mapsService||this.popupOption.followCursor)return;const{lng:n,lat:a}=this.lngLat,{x:u,y}=this.mapsService.lngLatToContainer([n,a]);this.setPopupPosition(u,y)}),(0,K.Z)(this,"updateLngLatPositionWhenZoom",n=>{if(!this.mapsService||this.popupOption.followCursor)return;const a=n.map,u=a.getSize();u.x=u.x/2,u.y=u.y/2;const y=n.center,A=n.zoom,O=a.DE(this.lngLat,A,y);O.x=Math.round(O.x),O.y=Math.round(O.y),this.setPopupPosition(O.x,O.y,!0)}),(0,K.Z)(this,"onKeyDown",n=>{n.keyCode===27&&this.remove()}),(0,K.Z)(this,"onCloseButtonClick",n=>{n.stopPropagation&&n.stopPropagation(),this.hide()}),(0,K.Z)(this,"updatePosition",(n,a=!0)=>{const u=!!this.lngLat,{className:y,style:A,maxWidth:O,anchor:Z,stopPropagation:Y}=this.popupOption;if(!this.mapsService||!u||!this.content)return;const Q=this.mapsService.getMarkerContainer();if(!this.container&&Q&&(this.container=Xo("div",`l7-popup ${y!=null?y:""} ${this.isShow?"":"l7-popup-hide"}`,Q),A&&this.container.setAttribute("style",A),this.tip=Xo("div","l7-popup-tip",this.container),this.container.appendChild(this.content),Y&&["mousemove","mousedown","mouseup","click","dblclick"].forEach(ae=>{this.container.addEventListener(ae,xe=>{xe.stopPropagation()})}),this.container.style.whiteSpace="nowrap"),a?this.updateLngLatPositionWhenZoom(n):this.updateLngLatPosition(),_u(this.container,`${$o[Z]}`),Fo(this.container,Z,"popup"),O){const{width:ae}=this.container.getBoundingClientRect();ae>parseFloat(O)&&(this.container.style.width=O)}else this.container.style.removeProperty("width")}),(0,K.Z)(this,"updateWhenZoom",n=>{this.updatePosition(n,!0)}),(0,K.Z)(this,"update",()=>{this.updatePosition(null,!1)}),this.popupOption=(0,Wt.Z)((0,Wt.Z)({},this.getDefault(e!=null?e:{})),e);const{lngLat:r}=this.popupOption;r&&(this.lngLat=r)}getIsShow(){return this.isShow}addTo(e){this.mapsService=e.mapService,this.sceneService=e.sceneService,this.layerService=e.layerService,this.mapsService.on("camerachange",this.update),this.mapsService.on("viewchange",this.update),this.scene=e,this.update(),this.updateCloseOnClick(),this.updateCloseOnEsc(),this.updateFollowCursor();const{html:r,text:n,title:a}=this.popupOption;return r?this.setHTML(r):n&&this.setText(n),a&&this.setTitle(a),this.emit("open"),this}remove(){if(this!==null&&this!==void 0&&this.isOpen())return this.content&&au(this.content),this.container&&(au(this.container),delete this.container),this.mapsService&&(this.mapsService.off("camerachange",this.update),this.mapsService.off("viewchange",this.update),this.updateCloseOnClick(!0),this.updateCloseOnEsc(!0),this.updateFollowCursor(!0),delete this.mapsService),this.emit("close"),this}getOptions(){return this.popupOption}setOptions(e){return this.show(),this.popupOption=(0,Wt.Z)((0,Wt.Z)({},this.popupOption),e),this.checkUpdateOption(e,["html","text","title","closeButton","closeButtonOffsets","maxWidth","anchor","stopPropagation","className","style","lngLat","offsets"])&&(this.container&&(au(this.container),this.container=void 0),this.popupOption.html?this.setHTML(this.popupOption.html):this.popupOption.text&&this.setText(this.popupOption.text),this.popupOption.title&&this.setTitle(this.popupOption.title)),this.checkUpdateOption(e,["closeOnEsc"])&&this.updateCloseOnEsc(),this.checkUpdateOption(e,["closeOnClick"])&&this.updateCloseOnClick(),this.checkUpdateOption(e,["followCursor"])&&this.updateFollowCursor(),this.checkUpdateOption(e,["html"])&&e.html?this.setHTML(e.html):this.checkUpdateOption(e,["text"])&&e.text&&this.setText(e.text),this.checkUpdateOption(e,["lngLat"])&&e.lngLat&&this.setLnglat(e.lngLat),this}open(){return this.addTo(this.scene),this}close(){return this.remove(),this}show(){if(!this.isShow)return this.container&&tc(this.container,"l7-popup-hide"),this.isShow=!0,this.emit("show"),this}hide(){if(this.isShow)return this.container&&dl(this.container,"l7-popup-hide"),this.isShow=!1,this.emit("hide"),this}setHTML(e){return this.popupOption.html=e,this.setDOMContent(e)}setText(e){return this.popupOption.text=e,this.setDOMContent(window.document.createTextNode(e))}setTitle(e){this.show(),this.popupOption.title=e,e?(this.contentTitle||(this.contentTitle=Xo("div","l7-popup-content__title"),this.content.firstChild?this.content.insertBefore(this.contentTitle,this.content.firstChild):this.content.append(this.contentTitle)),Ac(this.contentTitle),Iu(this.contentTitle,e)):this.contentTitle&&(au(this.contentTitle),this.contentTitle=void 0)}panToPopup(){const{lng:e,lat:r}=this.lngLat;return this.popupOption.autoPan&&this.mapsService.panTo([e,r]),this}setLngLat(e){return this.setLnglat(e)}setLnglat(e){return this.show(),this.lngLat=e,Array.isArray(e)&&(this.lngLat={lng:e[0],lat:e[1]}),this.mapsService&&(this.mapsService.off("camerachange",this.update),this.mapsService.off("viewchange",this.update),this.mapsService.on("camerachange",this.update),this.mapsService.on("viewchange",this.update)),this.update(),this.popupOption.autoPan&&setTimeout(()=>{this.panToPopup()},0),this}getLnglat(){return this.lngLat}setMaxWidth(e){return this.popupOption.maxWidth=e,this.update(),this}isOpen(){return!!this.mapsService}getDefault(e){return{closeButton:!0,closeOnClick:!1,maxWidth:"240px",offsets:[0,0],anchor:_a.BOTTOM,stopPropagation:!0,autoPan:!1,autoClose:!0,closeOnEsc:!1,followCursor:!1}}setDOMContent(e){return this.show(),this.createContent(),Iu(this.contentPanel,e),this.update(),this}updateCloseOnClick(e){const r=this.mapsService;r&&(r==null||r.off("click",this.onCloseButtonClick),this.popupOption.closeOnClick&&!e&&requestAnimationFrame(()=>{r==null||r.on("click",this.onCloseButtonClick)}))}updateCloseOnEsc(e){window.removeEventListener("keydown",this.onKeyDown),this.popupOption.closeOnEsc&&!e&&window.addEventListener("keydown",this.onKeyDown)}updateFollowCursor(e){var r;const n=(r=this.mapsService)===null||r===void 0?void 0:r.getContainer();n&&(n==null||n.removeEventListener("mousemove",this.onMouseMove),this.popupOption.followCursor&&!e&&(n==null||n.addEventListener("mousemove",this.onMouseMove)))}createContent(){if(this.content&&au(this.content),this.contentTitle=void 0,this.content=Xo("div","l7-popup-content",this.container),this.setTitle(this.popupOption.title),this.popupOption.closeButton){const e=km("l7-icon-guanbi");dl(e,"l7-popup-close-button"),this.content.appendChild(e),this.popupOption.closeButtonOffsets&&(e.style.right=this.popupOption.closeButtonOffsets[0]+"px",e.style.top=this.popupOption.closeButtonOffsets[1]+"px"),e.setAttribute("aria-label","Close popup"),e.addEventListener("click",()=>{this.hide()}),e.addEventListener("pointerup",r=>{r.stopPropagation()}),e.addEventListener("pointerdown",r=>{r.stopPropagation()}),this.closeButton=e}else this.closeButton=void 0;this.contentPanel=Xo("div","l7-popup-content__panel",this.content)}setPopupPosition(e,r,n=!1){if(this.container){const{offsets:a}=this.popupOption;this.container.style.left=e+a[0]+"px",this.container.style.top=r-a[1]+"px",n?this.container.style.transition="left 0.25s cubic-bezier(0,0,0.25,1), top 0.25s cubic-bezier(0,0,0.25,1)":this.container.style.transition=""}}checkUpdateOption(e,r){return r.some(n=>n in e)}}const{get:$4}=es;class K4 extends Jw{constructor(...e){super(...e),(0,K.Z)(this,"layerClickCountByFrame",0),(0,K.Z)(this,"layerConfigMap",new WeakMap),(0,K.Z)(this,"displayFeatureInfo",void 0),(0,K.Z)(this,"onLayerClick",(r,n)=>{requestAnimationFrame(()=>{if(this.popupOption.closeOnClick&&this.layerClickCountByFrame++,this.isShow&&this.isSameFeature(r,n.featureId))this.hide();else{const{title:a,content:u}=this.getLayerInfoFrag(r,n);this.setDOMContent(u),this.setLnglat(n.lngLat),this.setTitle(a),this.setDisplayFeatureInfo({layer:r,featureId:n.featureId}),this.show()}})}),(0,K.Z)(this,"onSceneClick",()=>{this.layerClickCountByFrame=0,requestAnimationFrame(()=>{this.layerClickCountByFrame||this.hide()})}),(0,K.Z)(this,"onLayerHide",()=>{this.hide(),this.setDisplayFeatureInfo(void 0)}),(0,K.Z)(this,"updateCloseOnClick",()=>{})}get layerConfigItems(){var e;const{config:r,items:n}=this.popupOption;return(e=r!=null?r:n)!==null&&e!==void 0?e:[]}addTo(e){return super.addTo(e),this.bindLayerEvent(),this.hide(),this}remove(){return super.remove(),this.unbindLayerEvent(),this}setOptions(e){this.unbindLayerEvent();const r=(0,Wt.Z)({},e),n=r.trigger||this.popupOption.trigger,a=r.items||this.popupOption.items,u=(a==null?void 0:a.length)===0;r.followCursor=n==="hover"&&!u;const y=this.isShow;return super.setOptions(r),this.bindLayerEvent(),(u||!y)&&this.hide(),this}getDefault(e){const r=e.trigger==="hover";return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{trigger:"hover",followCursor:r,lngLat:{lng:0,lat:0},offsets:[0,10],closeButton:!1,closeOnClick:!0,autoClose:!1,closeOnEsc:!1})}bindLayerEvent(){const{trigger:e,closeOnClick:r}=this.popupOption;this.layerConfigItems.forEach(n=>{var a;const u=this.getLayerByConfig(n);if(!u)return;const y=(0,Wt.Z)({},n);if(e==="hover"){const Y=this.onLayerMouseMove.bind(this,u),Q=this.onLayerMouseOut.bind(this,u);y.onMouseMove=Y,y.onMouseOut=Q,u==null||u.on("mousemove",Y),u==null||u.on("mouseout",Q)}else{var A;const Y=this.onLayerClick.bind(this,u);y.onClick=Y,u==null||u.on("click",Y);const Q=(A=this.mapsService)===null||A===void 0?void 0:A.getMapContainer();Q&&r&&Q.addEventListener("click",this.onSceneClick)}const O=u==null||(a=u.getSource)===null||a===void 0?void 0:a.call(u),Z=this.onSourceUpdate.bind(this);O==null||O.on("update",Z),y.onSourceUpdate=Z,this.layerConfigMap.set(u,y)})}unbindLayerEvent(){this.layerConfigItems.forEach(e=>{var r;const n=this.getLayerByConfig(e),a=n&&this.layerConfigMap.get(n);if(!a)return;const{onMouseMove:u,onMouseOut:y,onClick:A,onSourceUpdate:O}=a;if(u&&n.off("mousemove",u),y&&n.off("mouseout",y),A&&n.off("click",A),O){var Z;n==null||(Z=n.getSource())===null||Z===void 0||Z.off("update",O)}const Y=(r=this.mapsService)===null||r===void 0?void 0:r.getMapContainer();Y&&Y.removeEventListener("click",this.onSceneClick)})}onLayerMouseMove(e,r){if(!this.isSameFeature(e,r.featureId)){const{title:n,content:a}=this.getLayerInfoFrag(e,r);this.setDOMContent(a),this.setTitle(n),this.setDisplayFeatureInfo({layer:e,featureId:r.featureId}),this.show()}}onLayerMouseOut(e,r){this.setDisplayFeatureInfo(void 0),this.isShow&&this.hide()}onSourceUpdate(){this.hide(),this.setDisplayFeatureInfo(void 0)}getLayerInfoFrag(e,r){const n=this.layerConfigMap.get(e);let a;const u=document.createDocumentFragment();if(n){let y=r.feature;y.type==="Feature"&&"properties"in y&&"geometry"in y&&(y=y.properties);const{title:A,fields:O,customContent:Z}=n;if(A){a=document.createDocumentFragment();const Y=A instanceof Function?A(y):A;Iu(a,Y)}if(Z){const Y=Z instanceof Function?Z(y):Z;Iu(u,Y)}else O!=null&&O.length&&(O==null||O.forEach(Y=>{var Q,ae;const{field:xe,formatField:Be,formatValue:it,getValue:gt}=typeof Y=="string"?{field:Y}:Y,Bt=Xo("div","l7-layer-popup__row"),Rt=gt?gt(r.feature):$4(y,xe),Yt=(Q=Be instanceof Function?Be(xe,y):Be)!==null&&Q!==void 0?Q:xe;let vr=(ae=it instanceof Function?it(Rt,y):it)!==null&&ae!==void 0?ae:Rt;const ln=Xo("span","l7-layer-popup__key",Bt);Iu(ln,Yt),Iu(ln,document.createTextNode("\uFF1A"));const cn=Xo("span","l7-layer-popup__value",Bt);Array.isArray(vr)&&vr.every(Gr=>!(Gr instanceof Object))&&(vr=vr.map(Gr=>String(Gr)).join(",")),Iu(cn,vr),u.appendChild(Bt)}))}return{title:a,content:u}}getLayerByConfig(e){const r=e.layer;if(r instanceof Object)return r;if(typeof r=="string")return this.layerService.getLayer(r)||this.layerService.getLayerByName(r)}isSameFeature(e,r){const n=this.displayFeatureInfo;return n&&e===n.layer&&r===n.featureId}setDisplayFeatureInfo(e){const r=this.displayFeatureInfo;r&&r.layer.off("hide",this.onLayerHide),e&&e.layer.on("hide",this.onLayerHide),this.displayFeatureInfo=e}}function J4(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}J4(`.l7-marker-container {
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
}
.l7-marker {
position: absolute !important;
top: 0;
left: 0;
z-index: 5;
cursor: pointer;
}
.l7-marker-cluster {
width: 40px;
height: 40px;
background-color: rgba(181, 226, 140, 0.6);
background-clip: padding-box;
border-radius: 20px;
}
.l7-marker-cluster div {
width: 30px;
height: 30px;
margin-top: 5px;
margin-left: 5px;
font:
12px 'Helvetica Neue',
Arial,
Helvetica,
sans-serif;
text-align: center;
background-color: rgba(110, 204, 57, 0.6);
border-radius: 15px;
}
.l7-marker-cluster span {
line-height: 30px;
}
.l7-touch .l7-control-attribution,
.l7-touch .l7-control-layers,
.l7-touch .l7-bar {
box-shadow: none;
}
.l7-touch .l7-control-layers,
.l7-touch .l7-bar {
background-clip: padding-box;
border: 2px solid rgba(0, 0, 0, 0.2);
}
.mapboxgl-ctrl-logo,
.amap-logo {
display: none !important;
}
.l7-select-box {
border: 3px dashed gray;
border-radius: 2px;
position: absolute;
z-index: 999;
box-sizing: border-box;
}
.l7-control-container {
font:
12px/1.5 'Helvetica Neue',
Arial,
Helvetica,
sans-serif;
}
.l7-control-container .l7-control {
position: relative;
z-index: 999;
float: left;
clear: both;
color: #595959;
font-size: 12px;
pointer-events: visiblePainted;
/* IE 9-10 doesn't have auto */
pointer-events: auto;
}
.l7-control-container .l7-control.l7-control--hide {
display: none;
}
.l7-control-container .l7-top {
top: 0;
display: flex;
position: absolute;
z-index: 999;
pointer-events: none;
}
.l7-control-container .l7-top .l7-control:not(.l7-control--hide) {
margin-top: 8px;
}
.l7-control-container .l7-right {
right: 0;
display: flex;
position: absolute;
z-index: 999;
pointer-events: none;
}
.l7-control-container .l7-right .l7-control:not(.l7-control--hide) {
margin-right: 8px;
}
.l7-control-container .l7-bottom {
bottom: 0;
display: flex;
position: absolute;
z-index: 999;
pointer-events: none;
}
.l7-control-container .l7-bottom .l7-control:not(.l7-control--hide) {
margin-bottom: 8px;
}
.l7-control-container .l7-left {
left: 0;
display: flex;
position: absolute;
z-index: 999;
pointer-events: none;
}
.l7-control-container .l7-left .l7-control:not(.l7-control--hide) {
margin-left: 8px;
}
.l7-control-container .l7-center {
position: absolute;
display: flex;
justify-content: center;
}
.l7-control-container .l7-center.l7-top,
.l7-control-container .l7-center.l7-bottom {
width: 100%;
}
.l7-control-container .l7-center.l7-left,
.l7-control-container .l7-center.l7-right {
height: 100%;
}
.l7-control-container .l7-center .l7-control {
margin-right: 8px;
margin-bottom: 8px;
}
.l7-control-container .l7-row {
flex-direction: row;
}
.l7-control-container .l7-row.l7-top {
align-items: flex-start;
}
.l7-control-container .l7-row.l7-bottom {
align-items: flex-end;
}
.l7-control-container .l7-column {
flex-direction: column;
}
.l7-control-container .l7-column.l7-left {
align-items: flex-start;
}
.l7-control-container .l7-column.l7-right {
align-items: flex-end;
}
.l7-button-control {
min-width: 28px;
height: 28px;
background-color: #fff;
border-width: 0;
border-radius: 2px;
outline: 0;
cursor: pointer;
transition: all 0.2s;
display: flex;
justify-content: center;
align-items: center;
padding: 0 6px;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
line-height: 16px;
}
.l7-button-control .l7-iconfont {
fill: #595959;
color: #595959;
width: 16px;
height: 16px;
}
.l7-button-control.l7-button-control--row {
padding: 0 16px 0 13px;
}
.l7-button-control.l7-button-control--row * + .l7-button-control__text {
margin-left: 8px;
}
.l7-button-control.l7-button-control--column {
height: 44px;
flex-direction: column;
}
.l7-button-control.l7-button-control--column .l7-iconfont {
margin-top: 3px;
}
.l7-button-control.l7-button-control--column .l7-button-control__text {
margin-top: 3px;
font-size: 10px;
-webkit-transform: scale(0.83333);
transform: scale(0.83333);
}
.l7-button-control:not(:disabled):hover {
background-color: #f3f3f3;
}
.l7-button-control:not(:disabled):active {
background-color: #f3f3f3;
}
.l7-button-control:disabled {
background-color: #fafafa;
color: #bdbdbd;
cursor: not-allowed;
}
.l7-button-control:disabled .l7-iconfont {
fill: #bdbdbd;
color: #bdbdbd;
}
.l7-button-control:disabled:hover {
background-color: #fafafa;
}
.l7-button-control:disabled:active {
background-color: #fafafa;
}
.l7-popper {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
z-index: 5;
color: #595959;
}
.l7-popper.l7-popper-hide {
display: none;
}
.l7-popper .l7-popper-content {
min-height: 28px;
background: #fff;
border-radius: 2px;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
}
.l7-popper .l7-popper-arrow {
width: 0;
height: 0;
border-width: 4px;
border-style: solid;
border-top-color: transparent;
border-bottom-color: transparent;
border-left-color: transparent;
border-right-color: transparent;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
}
.l7-popper.l7-popper-left {
flex-direction: row;
}
.l7-popper.l7-popper-left .l7-popper-arrow {
border-left-color: #fff;
margin: 10px 0;
}
.l7-popper.l7-popper-right {
flex-direction: row-reverse;
}
.l7-popper.l7-popper-right .l7-popper-arrow {
border-right-color: #fff;
margin: 10px 0;
}
.l7-popper.l7-popper-top {
flex-direction: column;
}
.l7-popper.l7-popper-top .l7-popper-arrow {
border-top-color: #fff;
margin: 0 10px;
}
.l7-popper.l7-popper-bottom {
flex-direction: column-reverse;
}
.l7-popper.l7-popper-bottom .l7-popper-arrow {
border-bottom-color: #fff;
margin: 0 10px;
}
.l7-popper.l7-popper-start {
align-items: flex-start;
}
.l7-popper.l7-popper-end {
align-items: flex-end;
}
.l7-select-control--normal {
padding: 4px 0;
}
.l7-select-control--normal .l7-select-control-item {
display: flex;
align-items: center;
height: 24px;
padding: 0 16px;
font-size: 12px;
line-height: 24px;
}
.l7-select-control--normal .l7-select-control-item > * + * {
margin-left: 6px;
}
.l7-select-control--normal .l7-select-control-item input[type='checkbox'] {
width: 14px;
height: 14px;
}
.l7-select-control--normal .l7-select-control-item:hover {
background-color: #f3f3f3;
}
.l7-select-control--image {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
box-sizing: content-box;
max-width: 460px;
max-height: 400px;
margin: 12px 0 0 12px;
overflow-x: hidden;
overflow-y: auto;
}
.l7-select-control--image .l7-select-control-item {
position: relative;
display: flex;
flex: 0 0 calc((100% - (12px + 9px) * 2) / 3);
flex-direction: column;
justify-content: center;
box-sizing: content-box;
margin-right: 12px;
margin-bottom: 12px;
overflow: hidden;
font-size: 12px;
border: 1px solid #fff;
border-radius: 2px;
}
.l7-select-control--image .l7-select-control-item img {
width: 100%;
height: 80px;
}
.l7-select-control--image .l7-select-control-item input[type='checkbox'] {
position: absolute;
top: 0;
right: 0;
}
.l7-select-control--image .l7-select-control-item .l7-select-control-item-row {
display: flex;
align-items: center;
justify-content: center;
line-height: 26px;
}
.l7-select-control--image .l7-select-control-item .l7-select-control-item-row > * + * {
margin-left: 8px;
}
.l7-select-control--image .l7-select-control-item.l7-select-control-item-active {
border-color: #0370fe;
}
.l7-select-control-item {
cursor: pointer;
}
.l7-select-control-item input[type='checkbox'] {
margin: 0;
cursor: pointer;
}
.l7-select-control--multiple .l7-select-control-item:hover {
background-color: transparent;
}
.l7-control-logo {
width: 89px;
height: 16px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.l7-control-logo img {
height: 100%;
width: 100%;
}
.l7-control-logo .l7-control-logo-link {
display: block;
cursor: pointer;
}
.l7-control-logo .l7-control-logo-link img {
cursor: pointer;
}
.l7-control-mouse-location {
background-color: #fff;
border-radius: 2px;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
padding: 2px 4px;
min-width: 130px;
}
.l7-control-zoom {
overflow: hidden;
border-radius: 2px;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
}
.l7-control-zoom .l7-button-control {
font-size: 16px;
border-bottom: 1px solid #f0f0f0;
border-radius: 0;
box-shadow: 0 0 0;
}
.l7-control-zoom .l7-button-control .l7-iconfont {
width: 14px;
height: 14px;
}
.l7-control-zoom .l7-button-control:last-child {
border-bottom: 0;
}
.l7-control-zoom .l7-control-zoom__number {
color: #595959;
padding: 0;
}
.l7-control-zoom .l7-control-zoom__number:hover {
background-color: #fff;
}
.l7-control-scale {
display: flex;
flex-direction: column;
}
.l7-control-scale .l7-control-scale-line {
box-sizing: border-box;
padding: 2px 5px 1px;
overflow: hidden;
color: #595959;
font-size: 10px;
line-height: 1.1;
white-space: nowrap;
background: #fff;
border: 2px solid #000;
border-top: 0;
transition: width 0.1s;
}
.l7-control-scale .l7-control-scale-line + .l7-control-scale .l7-control-scale-line {
margin-top: -2px;
border-top: 2px solid #777;
border-bottom: none;
}
.l7-right .l7-control-scale {
display: flex;
align-items: flex-end;
}
.l7-right .l7-control-scale .l7-control-scale-line {
text-align: right;
}
.l7-popup {
position: absolute;
top: 0;
left: 0;
z-index: 5;
display: flex;
will-change: transform;
pointer-events: none;
}
.l7-popup.l7-popup-hide {
display: none;
}
.l7-popup .l7-popup-content {
position: relative;
padding: 16px;
font-size: 14px;
background: #fff;
border-radius: 3px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.l7-popup .l7-popup-content .l7-popup-content__title {
margin-bottom: 8px;
font-weight: bold;
}
.l7-popup .l7-popup-content .l7-popup-close-button,
.l7-popup .l7-popup-content .l7-popup-content__title,
.l7-popup .l7-popup-content .l7-popup-content__panel {
white-space: normal;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
pointer-events: initial;
}
.l7-popup .l7-popup-content .l7-popup-close-button {
position: absolute;
top: 0;
right: 0;
width: 18px;
height: 18px;
padding: 0;
font-size: 14px;
line-height: 18px;
text-align: center;
background-color: transparent;
border: 0;
border-radius: 0 3px 0 0;
cursor: pointer;
}
.l7-popup .l7-popup-tip {
position: relative;
z-index: 1;
width: 0;
height: 0;
border: 10px solid transparent;
}
.l7-popup.l7-popup-anchor-bottom,
.l7-popup.l7-popup-anchor-bottom-left,
.l7-popup.l7-popup-anchor-bottom-right {
flex-direction: column-reverse;
}
.l7-popup.l7-popup-anchor-bottom .l7-popup-tip,
.l7-popup.l7-popup-anchor-bottom-left .l7-popup-tip,
.l7-popup.l7-popup-anchor-bottom-right .l7-popup-tip {
bottom: 1px;
}
.l7-popup.l7-popup-anchor-top,
.l7-popup.l7-popup-anchor-top-left,
.l7-popup.l7-popup-anchor-top-right {
flex-direction: column;
}
.l7-popup.l7-popup-anchor-top .l7-popup-tip,
.l7-popup.l7-popup-anchor-top-left .l7-popup-tip,
.l7-popup.l7-popup-anchor-top-right .l7-popup-tip {
top: 1px;
}
.l7-popup.l7-popup-anchor-left {
flex-direction: row;
}
.l7-popup.l7-popup-anchor-right {
flex-direction: row-reverse;
}
.l7-popup-anchor-top .l7-popup-tip {
position: relative;
align-self: center;
border-top: none;
border-bottom-color: #fff;
}
.l7-popup-anchor-top-left .l7-popup-tip {
align-self: flex-start;
border-top: none;
border-bottom-color: #fff;
border-left: none;
}
.l7-popup-anchor-top-right .l7-popup-tip {
align-self: flex-end;
border-top: none;
border-right: none;
border-bottom-color: #fff;
}
.l7-popup-anchor-bottom .l7-popup-tip {
align-self: center;
border-top-color: #fff;
border-bottom: none;
}
.l7-popup-anchor-bottom-left .l7-popup-tip {
align-self: flex-start;
border-top-color: #fff;
border-bottom: none;
border-left: none;
}
.l7-popup-anchor-bottom-right .l7-popup-tip {
align-self: flex-end;
border-top-color: #fff;
border-right: none;
border-bottom: none;
}
.l7-popup-anchor-left .l7-popup-tip {
align-self: center;
border-right-color: #fff;
border-left: none;
}
.l7-popup-anchor-right .l7-popup-tip {
right: 1px;
align-self: center;
border-right: none;
border-left-color: #fff;
}
.l7-popup-anchor-top-left .l7-popup-content {
border-top-left-radius: 0;
}
.l7-popup-anchor-top-right .l7-popup-content {
border-top-right-radius: 0;
}
.l7-popup-anchor-bottom-left .l7-popup-content {
border-bottom-left-radius: 0;
}
.l7-popup-anchor-bottom-right .l7-popup-content {
border-bottom-right-radius: 0;
}
.l7-popup-track-pointer {
display: none;
}
.l7-popup-track-pointer * {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
}
.l7-map:hover .l7-popup-track-pointer {
display: flex;
}
.l7-map:active .l7-popup-track-pointer {
display: none;
}
.l7-layer-popup__row {
font-size: 12px;
}
.l7-layer-popup__row + .l7-layer-popup__row {
margin-top: 4px;
}
.l7-control-swipe {
position: absolute;
top: 50%;
left: 50%;
z-index: 6;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
touch-action: none;
}
.l7-control-swipe_hide {
display: none;
}
.l7-control-swipe:before {
position: absolute;
top: -5000px;
bottom: -5000px;
left: 50%;
z-index: -1;
width: 4px;
background: #fff;
-webkit-transform: translate(-2px, 0);
transform: translate(-2px, 0);
content: '';
}
.l7-control-swipe.horizontal:before {
top: 50%;
right: -5000px;
bottom: auto;
left: -5000px;
width: auto;
height: 4px;
}
.l7-control-swipe__button {
display: block;
width: 28px;
height: 28px;
margin: 0;
padding: 0;
color: #595959;
font-weight: bold;
font-size: inherit;
text-align: center;
text-decoration: none;
background-color: #fff;
border: none;
border-radius: 2px;
outline: none;
}
.l7-control-swipe,
.l7-control-swipe__button {
cursor: ew-resize;
}
.l7-control-swipe.horizontal,
.l7-control-swipe.horizontal button {
cursor: ns-resize;
}
.l7-control-swipe:after,
.l7-control-swipe__button:before,
.l7-control-swipe__button:after {
position: absolute;
top: 25%;
bottom: 25%;
left: 50%;
width: 2px;
background: currentColor;
-webkit-transform: translate(-1px, 0);
transform: translate(-1px, 0);
content: '';
}
.l7-control-swipe__button:after {
-webkit-transform: translateX(4px);
transform: translateX(4px);
}
.l7-control-swipe__button:before {
-webkit-transform: translateX(-6px);
transform: translateX(-6px);
}
`);class Nm{constructor(e){(0,K.Z)(this,"configService",void 0),(0,K.Z)(this,"config",void 0),this.config=e}setContainer(e,r,n){this.configService=e.globalConfigService,e.mapConfig=(0,Wt.Z)((0,Wt.Z)({},this.config),{},{id:r,canvas:n}),e.mapService=new(this.getServiceConstructor())(e)}getServiceConstructor(){throw new Error("Method not implemented.")}}var Q4=Se(41978),Qw=Se.n(Q4),e3=Se(92711),t3=Se(37678),eP=Se(40962),tP=Se(95311),rP=Se(64003),d1=Se(28419),Im=Se(67654);function m_(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function m1(t,e){var r=mh.transformMat4([],e,t);return mh.scale(r,r,1/r[3]),r}function UO(t,e){var r=t%e;return r<0?e+r:r}function ZO(t,e,r){return r*e+(1-r)*t}function i0(t,e){if(!t)throw new Error(e||"viewport-mercator-project: assertion failed.")}var zm=Math.PI,r3=zm/4,gg=zm/180,n3=180/zm,x2=512,b2=4003e4,nP=1.5;function i3(t){return Math.pow(2,t)}function iP(t){return Math.log2(t)}function g1(t,e){var r=(0,Im.Z)(t,2),n=r[0],a=r[1];i0(Number.isFinite(n)&&Number.isFinite(e)),i0(Number.isFinite(a)&&a>=-90&&a<=90,"invalid latitude"),e*=x2;var u=n*gg,y=a*gg,A=e*(u+zm)/(2*zm),O=e*(zm-Math.log(Math.tan(r3+y*.5)))/(2*zm);return[A,O]}function E2(t,e){var r=(0,Im.Z)(t,2),n=r[0],a=r[1];e*=x2;var u=n/e*(2*zm)-zm,y=2*(Math.atan(Math.exp(zm-a/e*(2*zm)))-r3);return[u*n3,y*n3]}function VO(t){var e=t.latitude;assert(Number.isFinite(e));var r=Math.cos(e*gg);return iP(b2*r)-9}function o3(t){var e=t.latitude,r=t.longitude,n=t.zoom,a=t.scale,u=t.highPrecision,y=u===void 0?!1:u;a=a!==void 0?a:i3(n),i0(Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(a));var A={},O=x2*a,Z=Math.cos(e*gg),Y=O/360,Q=Y/Z,ae=O/b2/Z;if(A.pixelsPerMeter=[ae,-ae,ae],A.metersPerPixel=[1/ae,-1/ae,1/ae],A.pixelsPerDegree=[Y,-Q,ae],A.degreesPerPixel=[1/Y,-1/Q,1/ae],y){var xe=gg*Math.tan(e*gg)/Z,Be=Y*xe/2,it=O/b2*xe,gt=it/Q*ae;A.pixelsPerDegree2=[0,-Be,it],A.pixelsPerMeter2=[gt,0,gt]}return A}function jO(t,e){var r=_slicedToArray(t,3),n=r[0],a=r[1],u=r[2],y=_slicedToArray(e,3),A=y[0],O=y[1],Z=y[2],Y=1,Q=o3({longitude:n,latitude:a,scale:Y,highPrecision:!0}),ae=Q.pixelsPerMeter,xe=Q.pixelsPerMeter2,Be=g1(t,Y);Be[0]+=A*(ae[0]+xe[0]*O),Be[1]+=O*(ae[1]+xe[1]*O);var it=E2(Be,Y),gt=(u||0)+(Z||0);return Number.isFinite(u)||Number.isFinite(Z)?[it[0],it[1],gt]:it}function oP(t){var e=t.height,r=t.pitch,n=t.bearing,a=t.altitude,u=t.center,y=u===void 0?null:u,A=t.flipY,O=A===void 0?!1:A,Z=m_();return Kr.translate(Z,Z,[0,0,-a]),Kr.scale(Z,Z,[1,1,1/e]),Kr.rotateX(Z,Z,-r*gg),Kr.rotateZ(Z,Z,n*gg),O&&Kr.scale(Z,Z,[1,-1,1]),y&&Kr.translate(Z,Z,ra.negate([],y)),Z}function aP(t){var e=t.width,r=t.height,n=t.altitude,a=n===void 0?nP:n,u=t.pitch,y=u===void 0?0:u,A=t.nearZMultiplier,O=A===void 0?1:A,Z=t.farZMultiplier,Y=Z===void 0?1:Z,Q=y*gg,ae=Math.atan(.5/a),xe=Math.sin(ae)*a/Math.sin(Math.PI/2-Q-ae),Be=Math.cos(Math.PI/2-Q)*xe+a;return{fov:2*Math.atan(r/2/a),aspect:e/r,focalDistance:a,near:O,far:Be*Y}}function sP(t){var e=t.width,r=t.height,n=t.pitch,a=t.altitude,u=t.nearZMultiplier,y=t.farZMultiplier,A=aP({width:e,height:r,altitude:a,pitch:n,nearZMultiplier:u,farZMultiplier:y}),O=A.fov,Z=A.aspect,Y=A.near,Q=A.far,ae=Kr.perspective([],O,Z,Y,Q);return ae}function lP(t,e){var r=(0,Im.Z)(t,3),n=r[0],a=r[1],u=r[2],y=u===void 0?0:u;return i0(Number.isFinite(n)&&Number.isFinite(a)&&Number.isFinite(y)),m1(e,[n,a,y,1])}function a3(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(0,Im.Z)(t,3),a=n[0],u=n[1],y=n[2];if(i0(Number.isFinite(a)&&Number.isFinite(u),"invalid pixel coordinate"),Number.isFinite(y)){var A=m1(e,[a,u,y,1]);return A}var O=m1(e,[a,u,0,1]),Z=m1(e,[a,u,1,1]),Y=O[2],Q=Z[2],ae=Y===Q?0:((r||0)-Y)/(Q-Y);return Ja.lerp([],O,Z,ae)}var s3=m_(),uP=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.width,n=e.height,a=e.viewMatrix,u=a===void 0?s3:a,y=e.projectionMatrix,A=y===void 0?s3:y;(0,e3.Z)(this,t),this.width=r||1,this.height=n||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=u,this.projectionMatrix=A;var O=m_();Kr.multiply(O,O,this.projectionMatrix),Kr.multiply(O,O,this.viewMatrix),this.viewProjectionMatrix=O;var Z=m_();Kr.scale(Z,Z,[this.width/2,-this.height/2,1]),Kr.translate(Z,Z,[1,-1,0]),Kr.multiply(Z,Z,this.viewProjectionMatrix);var Y=Kr.invert(m_(),Z);if(!Y)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=Z,this.pixelUnprojectionMatrix=Y,this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}return(0,t3.Z)(t,[{key:"equals",value:function(r){return r instanceof t?r.width===this.width&&r.height===this.height&&Kr.equals(r.projectionMatrix,this.projectionMatrix)&&Kr.equals(r.viewMatrix,this.viewMatrix):!1}},{key:"project",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.topLeft,u=a===void 0?!0:a,y=this.projectPosition(r),A=lP(y,this.pixelProjectionMatrix),O=(0,Im.Z)(A,2),Z=O[0],Y=O[1],Q=u?Y:this.height-Y;return r.length===2?[Z,Q]:[Z,Q,A[2]]}},{key:"unproject",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.topLeft,u=a===void 0?!0:a,y=n.targetZ,A=(0,Im.Z)(r,3),O=A[0],Z=A[1],Y=A[2],Q=u?Z:this.height-Z,ae=y&&y*this.pixelsPerMeter,xe=a3([O,Q,Y],this.pixelUnprojectionMatrix,ae),Be=this.unprojectPosition(xe),it=(0,Im.Z)(Be,3),gt=it[0],Bt=it[1],Rt=it[2];return Number.isFinite(Y)?[gt,Bt,Rt]:Number.isFinite(y)?[gt,Bt,y]:[gt,Bt]}},{key:"projectPosition",value:function(r){var n=this.projectFlat(r),a=(0,Im.Z)(n,2),u=a[0],y=a[1],A=(r[2]||0)*this.pixelsPerMeter;return[u,y,A]}},{key:"unprojectPosition",value:function(r){var n=this.unprojectFlat(r),a=(0,Im.Z)(n,2),u=a[0],y=a[1],A=(r[2]||0)/this.pixelsPerMeter;return[u,y,A]}},{key:"projectFlat",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return r}},{key:"unprojectFlat",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return r}}]),t}();function cP(t){var e=t.width,r=t.height,n=t.bounds,a=t.minExtent,u=a===void 0?0:a,y=t.maxZoom,A=y===void 0?24:y,O=t.padding,Z=O===void 0?0:O,Y=t.offset,Q=Y===void 0?[0,0]:Y,ae=(0,Im.Z)(n,2),xe=(0,Im.Z)(ae[0],2),Be=xe[0],it=xe[1],gt=(0,Im.Z)(ae[1],2),Bt=gt[0],Rt=gt[1];if(Number.isFinite(Z)){var Yt=Z;Z={top:Yt,bottom:Yt,left:Yt,right:Yt}}else i0(Number.isFinite(Z.top)&&Number.isFinite(Z.bottom)&&Number.isFinite(Z.left)&&Number.isFinite(Z.right));var vr=new w2({width:e,height:r,longitude:0,latitude:0,zoom:0}),ln=vr.project([Be,Rt]),cn=vr.project([Bt,it]),Gr=[Math.max(Math.abs(cn[0]-ln[0]),u),Math.max(Math.abs(cn[1]-ln[1]),u)],Pn=[e-Z.left-Z.right-Math.abs(Q[0])*2,r-Z.top-Z.bottom-Math.abs(Q[1])*2];i0(Pn[0]>0&&Pn[1]>0);var Oo=Pn[0]/Gr[0],Da=Pn[1]/Gr[1],Bo=(Z.right-Z.left)/2/Oo,Oa=(Z.bottom-Z.top)/2/Da,fl=[(cn[0]+ln[0])/2+Bo,(cn[1]+ln[1])/2+Oa],Gp=vr.unproject(fl),Wp=vr.zoom+Math.log2(Math.abs(Math.min(Oo,Da)));return{longitude:Gp[0],latitude:Gp[1],zoom:Math.min(Wp,A)}}var w2=function(t){(0,rP.Z)(e,t);function e(){var r,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=n.width,u=n.height,y=n.latitude,A=y===void 0?0:y,O=n.longitude,Z=O===void 0?0:O,Y=n.zoom,Q=Y===void 0?0:Y,ae=n.pitch,xe=ae===void 0?0:ae,Be=n.bearing,it=Be===void 0?0:Be,gt=n.altitude,Bt=gt===void 0?1.5:gt,Rt=n.nearZMultiplier,Yt=n.farZMultiplier;(0,e3.Z)(this,e),a=a||1,u=u||1;var vr=i3(Q);Bt=Math.max(.75,Bt);var ln=g1([Z,A],vr);ln[2]=0;var cn=sP({width:a,height:u,pitch:xe,bearing:it,altitude:Bt,nearZMultiplier:Rt||1/u,farZMultiplier:Yt||1.01}),Gr=oP({height:u,center:ln,pitch:xe,bearing:it,altitude:Bt,flipY:!0});return r=(0,eP.Z)(this,(0,tP.Z)(e).call(this,{width:a,height:u,viewMatrix:Gr,projectionMatrix:cn})),r.latitude=A,r.longitude=Z,r.zoom=Q,r.pitch=xe,r.bearing=it,r.altitude=Bt,r.scale=vr,r.center=ln,r.pixelsPerMeter=o3((0,d1.Z)((0,d1.Z)(r))).pixelsPerMeter[2],Object.freeze((0,d1.Z)((0,d1.Z)(r))),r}return(0,t3.Z)(e,[{key:"projectFlat",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return g1(n,a)}},{key:"unprojectFlat",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return E2(n,a)}},{key:"getMapCenterByLngLatPosition",value:function(n){var a=n.lngLat,u=n.pos,y=a3(u,this.pixelUnprojectionMatrix),A=g1(a,this.scale),O=Ja.add([],A,Ja.negate([],y)),Z=Ja.add([],this.center,O);return E2(Z,this.scale)}},{key:"getLocationAtPoint",value:function(n){var a=n.lngLat,u=n.pos;return this.getMapCenterByLngLatPosition({lngLat:a,pos:u})}},{key:"fitBounds",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=this.width,y=this.height,A=cP(Object.assign({width:u,height:y,bounds:n},a)),O=A.longitude,Z=A.latitude,Y=A.zoom;return new e({width:u,height:y,longitude:O,latitude:Z,zoom:Y})}}]),e}(uP);class Fg{constructor(){(0,K.Z)(this,"viewport",void 0)}syncWithMapCamera(e){const{center:r,zoom:n,pitch:a,bearing:u,viewportHeight:y,viewportWidth:A}=e,O=this.viewport?{width:this.viewport.width,height:this.viewport.height,longitude:this.viewport.center[0],latitude:this.viewport.center[1],zoom:this.viewport.zoom,pitch:this.viewport.pitch,bearing:this.viewport.bearing}:{};this.viewport=new w2((0,Wt.Z)((0,Wt.Z)({},O),{},{width:A,height:y,longitude:r&&r[0],latitude:r&&r[1],zoom:n,pitch:a,bearing:u}))}getZoom(){return this.viewport.zoom}getZoomScale(){return Math.pow(2,this.getZoom())}getCenter(){return[this.viewport.longitude,this.viewport.latitude]}getProjectionMatrix(){return this.viewport.projectionMatrix}getModelMatrix(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}getViewMatrix(){return this.viewport.viewMatrix}getViewMatrixUncentered(){return this.viewport.viewMatrixUncentered}getViewProjectionMatrix(){return this.viewport.viewProjectionMatrix}getViewProjectionMatrixUncentered(){return this.viewport.viewProjectionMatrix}getFocalDistance(){return 1}projectFlat(e,r){return this.viewport.projectFlat(e,r)}}class l3{constructor(e){(0,K.Z)(this,"size",1e4),this.size=e||1e4}setSize(e){this.size=e}getSize(){return[this.size,this.size]}mercatorXfromLng(e){return(180+e)/360*this.size}mercatorYfromLat(e){return(1-(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360)*this.size}lngFromMercatorX(e){return e/this.size*360-180}latFromMercatorY(e){const r=180-(1-e/this.size)*360;return 360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90}project(e){const r=this.mercatorXfromLng(e[0]),n=this.mercatorYfromLat(e[1]);return[r,n]}unproject(e){const r=this.lngFromMercatorX(e[0]),n=this.latFromMercatorY(e[1]);return[r,n]}}function v1(t={}){const e={top:0,right:0,bottom:0,left:0};if(typeof t=="number")return{top:t,right:t,bottom:t,left:t};if(Array.isArray(t)){if(t.length===4)return{top:t[0],right:t[1],bottom:t[2],left:t[3]};if(t.length===2)return{top:t[0],right:t[1],bottom:t[0],left:t[1]}}return(0,Wt.Z)((0,Wt.Z)({},e),t)}const hP={normal:"amap://styles/normal",light:"amap://styles/c422f5c0cfced5be9fe3a83f05f28a68?isPublic=true",dark:"amap://styles/c9f1d10cae34f8ab05e425462c5a58d7?isPublic=true",blank:"amap://styles/07c17002b38775b32a7a76c66cf90e99?isPublic=true",fresh:"amap://styles/fresh",grey:"amap://styles/grey",graffiti:"amap://styles/graffiti",macaron:"amap://styles/macaron",darkblue:"amap://styles/darkblue",wine:"amap://styles/wine"},pP=["id","style","minZoom","maxZoom","token","mapInstance","plugin"];function fP(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}fP(`.amap-logo {
display: none !important;
}
.amap-copyright {
display: none !important;
}
`);const u3={"GAODE1.x":{contextmenu:"rightclick"},"GAODE2.x":{contextmenu:"rightclick",camerachange:"viewchange"}};let dP=0;window.forceWebGL=!0;const c3="15cd8a57710d40c9b7c0e3cc120f1200",mP="1.4.15",gP="amap-script";let S2=!1,_1=[];const vP=12;class h3{constructor(e){(0,K.Z)(this,"version",rp["GAODE1.x"]),(0,K.Z)(this,"simpleMapCoord",new l3),(0,K.Z)(this,"map",void 0),(0,K.Z)(this,"bgColor","rgba(0, 0, 0, 0)"),(0,K.Z)(this,"configService",void 0),(0,K.Z)(this,"config",void 0),(0,K.Z)(this,"coordinateSystemService",void 0),(0,K.Z)(this,"eventEmitter",void 0),(0,K.Z)(this,"markerContainer",void 0),(0,K.Z)(this,"$mapContainer",void 0),(0,K.Z)(this,"cameraChangedCallback",void 0),(0,K.Z)(this,"handleCameraChanged",r=>{const{fov:n,near:a,far:u,height:y,pitch:A,rotation:O,aspect:Z,position:Y}=r.camera,{lng:Q,lat:ae}=this.getCenter();if(this.emit("mapchange"),this.cameraChangedCallback){this.viewport.syncWithMapCamera({aspect:Z,bearing:360-O,far:u,fov:n,cameraHeight:y,near:a,pitch:A,zoom:this.map.getZoom()-1,center:[Q,ae],offsetOrigin:[Y.x,Y.y]});const{offsetZoom:xe=vP}=this.config;this.viewport.getZoom()>xe?this.coordinateSystemService.setCoordinateSystem(Xt.P20_OFFSET):this.coordinateSystemService.setCoordinateSystem(Xt.P20),this.cameraChangedCallback(this.viewport)}}),this.config=e.mapConfig,this.configService=e.globalConfigService,this.coordinateSystemService=e.coordinateSystemService,this.eventEmitter=new Yl.EventEmitter}setBgColor(e){this.bgColor=e}addMarkerContainer(){const e=this.map.getContainer();if(e!==null){const r=e.getElementsByClassName("amap-maps")[0];this.markerContainer=Xo("div","l7-marker-container",r)}}getMarkerContainer(){return this.markerContainer}on(e,r){po.indexOf(e)!==-1?this.eventEmitter.on(e,r):this.map.on(u3[this.version][e]||e,r)}off(e,r){po.indexOf(e)!==-1?this.eventEmitter.off(e,r):this.map.off(u3[this.version][e]||e,r)}getContainer(){return this.map.getContainer()}getMapCanvasContainer(){var e;return(e=this.map.getContainer())===null||e===void 0?void 0:e.getElementsByClassName("amap-maps")[0]}getCanvasOverlays(){var e;return(e=this.$mapContainer)===null||e===void 0?void 0:e.querySelector(".amap-overlays")}getSize(){const e=this.map.getSize();return[e.getWidth(),e.getHeight()]}getType(){return"amap"}getZoom(){return this.map.getZoom()-1}setZoom(e){return this.map.setZoom(e+1)}getCenter(e){if(e!=null&&e.padding){const n=this.getCenter(),a=v1(e.padding),u=this.lngLatToPixel([n.lng,n.lat]),y=[(a.right-a.left)/2,(a.bottom-a.top)/2];return this.pixelToLngLat([u.x-y[0],u.y-y[1]])}const r=this.map.getCenter();return{lng:r.getLng(),lat:r.getLat()}}setCenter(e,r){if(r!=null&&r.padding){const n=v1(r.padding),a=this.lngLatToPixel(e),u=[(n.right-n.left)/2,(n.bottom-n.top)/2],y=this.pixelToLngLat([a.x+u[0],a.y+u[1]]);this.map.setCenter([y.lng,y.lat])}else this.map.setCenter(e)}getPitch(){return this.map.getPitch()}getRotation(){return 360-this.map.getRotation()}getBounds(){const e=this.map.getBounds().toBounds(),r=e.getNorthEast(),n=e.getSouthWest(),a=this.getCenter(),u=a.lng>r.getLng()||a.lng<n.getLng()?180-r.getLng():r.getLng();return[[a.lng<n.getLng()?n.getLng()-180:n.getLng(),n.getLat()],[u,r.getLat()]]}getMinZoom(){return this.map.get("zooms")[0]-1}getMaxZoom(){return this.map.get("zooms")[1]-1}setRotation(e){return this.map.setRotation(e)}setPitch(e){return this.map.setPitch(e)}zoomIn(){this.map.zoomIn()}zoomOut(){this.map.zoomOut()}panTo(e){this.map.panTo(e)}panBy(e=0,r=0){this.map.panBy(e,r)}fitBounds(e){this.map.setBounds(new AMap.Bounds([e[0][0],e[0][1],e[1][0],e[1][1]]))}setZoomAndCenter(e,r){this.map.setZoomAndCenter(e+1,r)}setMapStyle(e){this.map.setMapStyle(this.getMapStyleValue(e))}setMapStatus(e){this.map.setStatus(e)}getMapStyleConfig(){return hP}getMapStyleValue(e){return this.getMapStyleConfig()[e]||e}getMapStyle(){return this.map.getMapStyle()}pixelToLngLat(e){const r=this.map.pixelToLngLat(new AMap.Pixel(e[0],e[1]));return{lng:r.getLng(),lat:r.getLat()}}lngLatToPixel(e){const r=this.map.lnglatToPixel(new AMap.LngLat(e[0],e[1]));return{x:r.getX(),y:r.getY()}}containerToLngLat(e){const r=new AMap.Pixel(e[0],e[1]),n=this.map.containerToLngLat(r);return{lng:n==null?void 0:n.getLng(),lat:n==null?void 0:n.getLat()}}lngLatToContainer(e){const r=new AMap.LngLat(e[0],e[1]),n=this.map.lngLatToContainer(r);return{x:n.getX(),y:n.getY()}}lngLatToCoord(e){const{x:r,y:n}=this.map.lngLatToGeodeticCoord(e);return[r,-n]}lngLatToMercator(e,r){return{x:0,y:0,z:0}}getModelMatrix(e,r,n,a=[1,1,1]){const u=this.viewport.projectFlat(e),y=Kr.create();return Kr.translate(y,y,ra.fromValues(u[0],u[1],r)),Kr.scale(y,y,ra.fromValues(a[0],a[1],a[2])),Kr.rotateX(y,y,n[0]),Kr.rotateY(y,y,n[1]),Kr.rotateZ(y,y,n[2]),y}init(){var e=this;return(0,Nr.Z)(function*(){const r=e.config,{id:n,style:a="light",minZoom:u=0,maxZoom:y=18,token:A=c3,mapInstance:O,plugin:Z=[]}=r,Y=(0,Ge.Z)(r,pP);yield new Promise(Q=>{const ae=()=>{if(O)e.map=O,e.$mapContainer=e.map.getContainer(),setTimeout(()=>{e.map.on("camerachange",e.handleCameraChanged),Q()},30);else{e.$mapContainer=e.creatMapContainer(n);const xe=(0,Wt.Z)({mapStyle:e.getMapStyleValue(a),zooms:[u,y],viewMode:"3D"},Y);xe.zoom&&(xe.zoom+=1);const Be=new AMap.Map(e.$mapContainer,xe);Be.on("camerachange",e.handleCameraChanged),Be.on("camerachange",()=>{setTimeout(()=>e.handleAfterMapChange())}),e.map=Be,setTimeout(()=>{Q()},10)}};!S2&&!O?(A===c3&&console.warn(`%c${e.configService.getSceneWarninfo("MapToken")}!`,"color: #873bf4;font-weigh:900;font-size: 16px;"),S2=!0,Z.push("Map3D"),Qw().load({key:A,version:mP,plugins:Z}).then(()=>{ae(),_1.length&&(_1.forEach(xe=>xe()),_1=[])}).catch(xe=>{throw new Error(xe)})):S2&&window.AMap||O?ae():_1.push(ae)}),e.viewport=new Fg})()}meterToCoord(e,r){const n=AMap.GeometryUtil.distance(new AMap.LngLat(...e),new AMap.LngLat(...r)),[a,u]=this.lngLatToCoord(e),[y,A]=this.lngLatToCoord(r);return Math.sqrt(Math.pow(a-y,2)+Math.pow(u-A,2))/n}updateView(e){}getOverlayContainer(){}exportMap(e){var r;const n=(r=this.getContainer())===null||r===void 0?void 0:r.getElementsByClassName("amap-layer")[0];return e==="jpg"?n==null?void 0:n.toDataURL("image/jpeg"):n==null?void 0:n.toDataURL("image/png")}emit(e,...r){this.eventEmitter.emit(e,...r)}once(e,...r){this.eventEmitter.once(e,...r)}destroy(){var e;(e=this.$mapContainer)===null||e===void 0||(e=e.parentNode)===null||e===void 0||e.removeChild(this.$mapContainer),delete window.initAMap;const r=document.getElementById(gP);r&&document.head.removeChild(r),this.map.destroy()}getMapContainer(){return this.$mapContainer}onCameraChanged(e){this.cameraChangedCallback=e}handleAfterMapChange(){this.emit("mapAfterFrameChange")}creatMapContainer(e){let r=e;typeof e=="string"&&(r=document.getElementById(e));const n=document.createElement("div");return n.style.cssText+=`
position: absolute;
top: 0;
height: 100%;
width: 100%;
`,n.id="l7_amap_div"+dP++,r.appendChild(n),n}}if(!window)throw Error("AMap JSAPI can only be used in Browser.");var Um=function(t){return t.notload="notload",t.loading="loading",t.loaded="loaded",t.failed="failed",t}(Um||{});let Kd={key:"",AMap:{version:"2.0",plugins:[]}},vg={AMap:Um.notload};const _P=[],yP=t=>{if(typeof t=="function"){if(vg.AMap===Um.loaded){t(window.AMap);return}_P.push(t)}},xP=function(){var t=(0,Nr.Z)(function*(e){return new Promise((r,n)=>{if(vg.AMap===Um.failed)n("");else if(vg.AMap===Um.notload){const{key:a,version:u,plugins:y}=e;if(!a){n("\u8BF7\u586B\u5199key");return}window.AMap&&location.host!=="lbs.amap.com"&&n("\u7981\u6B62\u591A\u79CDAPI\u52A0\u8F7D\u65B9\u5F0F\u6DF7\u7528"),Kd.key=a,Kd.AMap.version=u||Kd.AMap.version,Kd.AMap.plugins=y||Kd.AMap.plugins,vg.AMap=Um.loading;const A=document.body||document.head;window._onAPILoaded=Z=>{Z?(vg.AMap=Um.failed,n(Z)):(vg.AMap=Um.loaded,r(null))};const O=document.createElement("script");O.type="text/javascript",O.async=!1,O.src="https://webapi.amap.com/maps?callback=_onAPILoaded&v="+Kd.AMap.version+"&key="+a+"&plugin="+Kd.AMap.plugins.join(","),O.onerror=Z=>{vg.AMap=Um.failed,n(Z)},A.appendChild(O)}else if(vg.AMap===Um.loaded){if(e.key&&e.key!==Kd.key){n("\u591A\u4E2A\u4E0D\u4E00\u81F4\u7684 key");return}if(e.version&&e.version!==Kd.AMap.version){n("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C JSAPI \u6DF7\u7528");return}const a=[];e.plugins&&e.plugins.forEach(u=>{Kd.AMap.plugins.indexOf(u)===-1&&a.push(u)}),a.length&&window.AMap.plugin(a,()=>{r(window.AMap)})}else{if(e.key&&e.key!==Kd.key){n("\u591A\u4E2A\u4E0D\u4E00\u81F4\u7684 key");return}if(e.version&&e.version!==Kd.AMap.version){n("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C JSAPI \u6DF7\u7528");return}const a=[];e.plugins&&e.plugins.forEach(u=>{Kd.AMap.plugins.indexOf(u)===-1&&a.push(u)}),yP(()=>{a.length&&window.AMap.plugin(a,()=>{r(window.AMap)})})}})});return function(r){return t.apply(this,arguments)}}();function bP(){delete window.AMap,Kd={key:"",AMap:{version:"1.4.15",plugins:[]}},vg={AMap:Um.notload}}var EP={load:xP,reset:bP};const p3=Math.PI/180;class wP{constructor(){(0,K.Z)(this,"projectionMatrix",Kr.create()),(0,K.Z)(this,"viewMatrix",Kr.create()),(0,K.Z)(this,"viewProjectionMatrix",Kr.create()),(0,K.Z)(this,"ViewProjectionMatrixUncentered",Kr.create()),(0,K.Z)(this,"viewUncenteredMatrix",Kr.create()),(0,K.Z)(this,"zoom",void 0),(0,K.Z)(this,"center",void 0)}syncWithMapCamera(e){const{zoom:r=1,pitch:n=0,bearing:a=0,center:u=[0,0],offsetOrigin:y=[0,0],cameraHeight:A=1,aspect:O=1,near:Z=.1,far:Y=1e3,fov:Q=0}=e;this.zoom=r,this.center=u;const ae=n*p3,xe=(360-a)*p3;Kr.perspective(this.projectionMatrix,Q,O,Z,Y);const Be=ra.fromValues(A*Math.sin(ae)*Math.sin(xe),-A*Math.sin(ae)*Math.cos(xe),A*Math.cos(ae)),it=ra.fromValues(-Math.cos(ae)*Math.sin(xe),Math.cos(ae)*Math.cos(xe),Math.sin(ae));Kr.lookAt(this.viewMatrix,Be,ra.fromValues(0,0,0),it),this.viewUncenteredMatrix=Kr.clone(this.viewMatrix),Kr.translate(this.viewMatrix,this.viewMatrix,ra.fromValues(-y[0],y[1],0)),Kr.multiply(this.viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),Kr.multiply(this.ViewProjectionMatrixUncentered,this.projectionMatrix,this.viewMatrix)}getZoom(){return this.zoom}getZoomScale(){return 524288}getCenter(){const[e,r]=this.center;return[e,r]}getProjectionMatrix(){return this.projectionMatrix}getModelMatrix(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}getViewMatrix(){return this.viewMatrix}getViewMatrixUncentered(){return this.viewUncenteredMatrix}getViewProjectionMatrix(){return this.viewProjectionMatrix}getViewProjectionMatrixUncentered(){return this.ViewProjectionMatrixUncentered}getFocalDistance(){return 1}projectFlat(e){const r=85.0511287798,n=Math.max(Math.min(r,e[1]),-r),a=256<<20;let u=Math.PI/180,y=e[0]*u,A=n*u;A=Math.log(Math.tan(Math.PI/4+A/2));const O=.5/Math.PI,Z=.5,Y=-.5/Math.PI;return u=.5,y=a*(O*y+Z)-215440491,A=-(a*(Y*A+u)-106744817),[y,A]}}const SP=["id","style","minZoom","maxZoom","token","mapInstance","plugin"];window.forceWebGL=!0;const f3="15cd8a57710d40c9b7c0e3cc120f1200",TP="1.4.15";let T2=!1,y1=[];const AP=12;class CP extends h3{constructor(...e){super(...e),(0,K.Z)(this,"version","GAODE1.x"),(0,K.Z)(this,"viewport",void 0),(0,K.Z)(this,"handleCameraChanged",r=>{const{fov:n,near:a,far:u,height:y,pitch:A,rotation:O,aspect:Z,position:Y}=r.camera,{lng:Q,lat:ae}=this.getCenter();if(this.emit("mapchange"),this.cameraChangedCallback){this.viewport.syncWithMapCamera({aspect:Z,bearing:360-O,far:u,fov:n,cameraHeight:y,near:a,pitch:A,zoom:this.map.getZoom()-1,center:[Q,ae],offsetOrigin:[Y.x,Y.y]});const{offsetZoom:xe=AP}=this.config;this.viewport.getZoom()>xe?this.coordinateSystemService.setCoordinateSystem(Xt.P20_OFFSET):this.coordinateSystemService.setCoordinateSystem(Xt.P20),this.cameraChangedCallback(this.viewport)}})}getModelMatrix(e,r,n,a=[1,1,1]){const u=this.viewport.projectFlat(e),y=Kr.create();return Kr.translate(y,y,ra.fromValues(u[0],u[1],r)),Kr.scale(y,y,ra.fromValues(a[0],a[1],a[2])),Kr.rotateX(y,y,n[0]),Kr.rotateY(y,y,n[1]),Kr.rotateZ(y,y,n[2]),y}init(){var e=this;return(0,Nr.Z)(function*(){const r=e.config,{id:n,style:a="light",minZoom:u=0,maxZoom:y=18,token:A=f3,mapInstance:O,plugin:Z=[]}=r,Y=(0,Ge.Z)(r,SP);yield new Promise(Q=>{const ae=()=>{if(O)e.map=O,e.$mapContainer=e.map.getContainer(),setTimeout(()=>{e.map.on("camerachange",e.handleCameraChanged),Q()},30);else{e.$mapContainer=e.creatMapContainer(n);const xe=(0,Wt.Z)({mapStyle:e.getMapStyleValue(a),zooms:[u,y],viewMode:"3D"},Y);xe.zoom&&(xe.zoom+=1);const Be=new AMap.Map(e.$mapContainer,xe);Be.on("camerachange",e.handleCameraChanged),Be.on("camerachange",()=>{setTimeout(()=>e.handleAfterMapChange())}),e.map=Be,setTimeout(()=>{Q()},10)}};!T2&&!O?(A===f3&&console.warn(e.configService.getSceneWarninfo("MapToken")),T2=!0,Z.push("Map3D"),EP.load({key:A,version:TP,plugins:Z}).then(xe=>{ae(),y1.length&&(y1.forEach(Be=>Be()),y1=[])}).catch(xe=>{throw new Error(xe)})):T2&&window.AMap||O?ae():y1.push(ae)}),e.viewport=new wP})()}meterToCoord(e,r){const n=AMap.GeometryUtil.distance(new AMap.LngLat(...e),new AMap.LngLat(...r)),[a,u]=this.lngLatToCoord(e),[y,A]=this.lngLatToCoord(r);return Math.sqrt(Math.pow(a-y,2)+Math.pow(u-A,2))/n}updateView(e){}getOverlayContainer(){}exportMap(e){var r;const n=(r=this.getContainer())===null||r===void 0?void 0:r.getElementsByClassName("amap-layer")[0];return e==="jpg"?n==null?void 0:n.toDataURL("image/jpeg"):n==null?void 0:n.toDataURL("image/png")}onCameraChanged(e){this.cameraChangedCallback=e}}class MP extends Nm{getServiceConstructor(){return CP}}class PP{constructor(){(0,K.Z)(this,"projectionMatrix",Kr.create()),(0,K.Z)(this,"viewMatrix",Kr.create()),(0,K.Z)(this,"viewProjectionMatrix",Kr.create()),(0,K.Z)(this,"ViewProjectionMatrixUncentered",Kr.create()),(0,K.Z)(this,"viewUncenteredMatrix",Kr.create()),(0,K.Z)(this,"zoom",void 0),(0,K.Z)(this,"center",void 0)}syncWithMapCamera(e){const{zoom:r=1,center:n=[0,0],offsetOrigin:a=[0,0],cameraPosition:u=[0,0,0],up:y=[0,1,0],lookAt:A=[0,0,0],aspect:O=1,near:Z=.1,far:Y=1e3,fov:Q=45}=e;this.zoom=r,this.center=n,Kr.perspective(this.projectionMatrix,Q/180*Math.PI,O,Z,Y);const ae=ra.fromValues(...u),xe=ra.fromValues(...A),Be=ra.fromValues(...y);Kr.lookAt(this.viewMatrix,ae,xe,Be),this.viewUncenteredMatrix=Kr.clone(this.viewMatrix),Kr.translate(this.viewMatrix,this.viewMatrix,ra.fromValues(-a[0],a[1],0)),Kr.multiply(this.viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),Kr.multiply(this.ViewProjectionMatrixUncentered,this.projectionMatrix,this.viewMatrix)}getZoom(){return this.zoom}getZoomScale(){return 1048576}getCenter(){const[e,r]=this.center;return[e,r]}getProjectionMatrix(){return this.projectionMatrix}getModelMatrix(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}getViewMatrix(){return this.viewMatrix}getViewMatrixUncentered(){return this.viewUncenteredMatrix}getViewProjectionMatrix(){return this.viewProjectionMatrix}getViewProjectionMatrixUncentered(){return this.ViewProjectionMatrixUncentered}getFocalDistance(){return 1.2}projectFlat(e){const r=85.0511287798,n=Math.max(Math.min(r,e[1]),-r),a=256<<20;let u=Math.PI/180,y=e[0]*u,A=n*u;A=Math.log(Math.tan(Math.PI/4+A/2));const O=.5/Math.PI,Z=.5,Y=-.5/Math.PI;return u=.5,y=a*(O*y+Z)-215440491,A=-(a*(Y*A+u)-106744817),[y,A]}}const RP=["id","style","minZoom","maxZoom","token","mapInstance","plugin","version"];function IP(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}IP(`.amap-logo {
display: none !important;
}
.amap-copyright {
display: none !important;
}
.amap-overlays {
z-index: 3 !important;
}
`);const d3=[108.92361,34.54083];window.forceWebGL=!0;const m3="f59bcf249433f8b05caaee19f349b3d7",g3="2.0",WO=!1,XO=null;class LP extends h3{constructor(...e){super(...e),(0,K.Z)(this,"version","GAODE2.x"),(0,K.Z)(this,"sceneCenter",void 0),(0,K.Z)(this,"sceneCenterMercator",void 0),(0,K.Z)(this,"viewport",void 0),(0,K.Z)(this,"handleViewChanged",r=>{const{fov:n,near:a,far:u,aspect:y,position:A,lookAt:O,up:Z}=this.map.customCoords.getCameraParams();this.emit("mapchange");const Y=this.map.customCoords.getCenter();this.cameraChangedCallback&&(this.viewport.syncWithMapCamera({aspect:y,far:u,fov:n,cameraPosition:A,lookAt:O,up:Z,near:a,zoom:this.map.getZoom()-1,center:Y,offsetOrigin:[A[0],A[1]]}),this.coordinateSystemService.setCoordinateSystem(Xt.P20_2),this.cameraChangedCallback(this.viewport))})}setCustomCoordCenter(e){this.sceneCenter=e,this.sceneCenterMercator=fi(...e)}getCustomCoordCenter(){return this.sceneCenterMercator}lngLatToCoordByLayer(e,r){const n=r||this.sceneCenterMercator,a=this._sub(fi(e[0],e[1]),n);return e[2]&&a.push(e[2]),a}coordToAMap2RelativeCoordinates(e,r){const n=fi(r[0],r[1]);return typeof e[0]=="number"?this.lngLatToCoordByLayer(e,n):e.map(a=>Array.isArray(a)&&typeof a[0]=="number"?this.lngLatToCoordByLayer(a,n):a.map(u=>this.lngLatToCoordByLayer(u,n)))}setCoordCenter(e){this.map.customCoords.setCenter(e||d3),this.setCustomCoordCenter(e||d3)}lngLatToCoord(e){return this.sceneCenter||(this.map.customCoords.setCenter(e),this.setCustomCoordCenter(e)),this._sub(fi(e[0],e[1]),this.sceneCenterMercator)}lngLatToCoords(e){return e.map(r=>typeof r[0]=="number"?this.lngLatToCoord(r):r.map(n=>this.lngLatToCoord(n)))}addMarkerContainer(){if(!this.map)return;const e=this.map.getContainer();if(e!==null){const r=e.getElementsByClassName("amap-maps")[0];r.style.zIndex="auto",this.markerContainer=Xo("div","l7-marker-container2",r)}}updateView(e){}getOverlayContainer(){}getType(){return"amap2"}getBounds(){const e=this.map.getBounds(),r=e.getNorthEast(),n=e.getSouthWest(),a=this.getCenter(),u=a.lng>r.getLng()||a.lng<n.getLng()?180-r.getLng():r.getLng();return[[a.lng<n.getLng()?n.getLng()-180:n.getLng(),n.getLat()],[u,r.getLat()]]}getMinZoom(){return this.map.getZooms()[0]-1}getMaxZoom(){return this.map.getZooms()[1]-1}lngLatToContainer(e){const r=this.map.lngLatToContainer(e);return{x:r.getX(),y:r.getY()}}lngLatToPixel(e){const r=this.map.lngLatToPixel(new AMap.LngLat(e[0],e[1]));return{x:r.getX(),y:r.getY()}}getModelMatrix(e,r,n,a=[1,1,1]){const u=this.map.customCoords.lngLatToCoord(e),y=Kr.create();return Kr.translate(y,y,ra.fromValues(u[0],u[1],r)),Kr.scale(y,y,ra.fromValues(a[0],a[1],a[2])),Kr.rotateX(y,y,n[0]),Kr.rotateY(y,y,n[1]),Kr.rotateZ(y,y,n[2]),y}init(){var e=this;return(0,Nr.Z)(function*(){const r=e.config,{id:n,style:a="light",minZoom:u=0,maxZoom:y=24,token:A=m3,mapInstance:O,plugin:Z=[],version:Y=g3}=r,Q=(0,Ge.Z)(r,RP);if(e.viewport=new PP,window.AMap||O||(Z.push("Map3D"),yield Qw().load({key:A,version:g3,plugins:Z})),O){var ae;e.map=O,e.$mapContainer=e.map.getContainer();const Be=e.map.getCenter();(ae=e.map.customCoords)===null||ae===void 0||ae.setCenter([Be.lng,Be.lat]),e.setCustomCoordCenter([Be.lng,Be.lat]),e.map.on("viewchange",e.handleViewChanged)}else{var xe;e.$mapContainer=e.creatMapContainer(n);const Be=(0,Wt.Z)({mapStyle:e.getMapStyleValue(a),zooms:[u,y],viewMode:"3D"},Q);Be.zoom&&(Be.zoom+=1),A===m3&&(window._AMapSecurityConfig={securityJsCode:"2653011adeb04230b3a26cc9a780a800"},console.warn(`%c${e.configService.getSceneWarninfo("MapToken")}!`,"color: #873bf4;font-weigh:900;font-size: 16px;"));const it=new AMap.Map(e.$mapContainer,Be);e.map=it;const gt=it.getCenter();(xe=e.map.customCoords)===null||xe===void 0||xe.setCenter([gt.lng,gt.lat]),e.setCustomCoordCenter([gt.lng,gt.lat]),it.on("viewchange",e.handleViewChanged)}e.initViewPort()})()}getMapContainer(){return this.$mapContainer}onCameraChanged(e){this.cameraChangedCallback=e}initViewPort(){var e;const{fov:r,near:n,far:a,aspect:u,position:y,lookAt:A,up:O}=((e=this.map.customCoords)===null||e===void 0?void 0:e.getCameraParams())||{};this.emit("mapchange");const Z=this.map.customCoords.getCenter(),Y=this.map.getZoom();this.cameraChangedCallback&&(this.viewport.syncWithMapCamera({aspect:u,far:a,fov:r,cameraPosition:y,lookAt:A,near:n,up:O,zoom:Y-1,center:Z,offsetOrigin:[y[0],y[1]]}),this.coordinateSystemService.setCoordinateSystem(Xt.P20_2),this.cameraChangedCallback(this.viewport))}_sub(e,r){const n=[0,0];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n}}class v3 extends Nm{getServiceConstructor(){return LP}}const DP={light:"mapbox://styles/zcxduo/ck2ypyb1r3q9o1co1766dex29",dark:"mapbox://styles/zcxduo/ck241p6413s0b1cpayzldv7x7",normal:"mapbox://styles/mapbox/streets-v11",blank:{version:8,sources:{},layers:[{id:"background",type:"background",layout:{visibility:"none"}}]}},_3={mapmove:"move",camerachange:"move",zoomchange:"zoom",dragging:"drag"},OP=12;class _g{constructor(e){(0,K.Z)(this,"version","DEFAUlTMAP"),(0,K.Z)(this,"map",void 0),(0,K.Z)(this,"simpleMapCoord",new l3),(0,K.Z)(this,"bgColor","rgba(0.0, 0.0, 0.0, 0.0)"),(0,K.Z)(this,"config",void 0),(0,K.Z)(this,"configService",void 0),(0,K.Z)(this,"coordinateSystemService",void 0),(0,K.Z)(this,"eventEmitter",void 0),(0,K.Z)(this,"markerContainer",void 0),(0,K.Z)(this,"cameraChangedCallback",void 0),(0,K.Z)(this,"$mapContainer",void 0),(0,K.Z)(this,"handleCameraChanged",r=>{const{lat:n,lng:a}=this.map.getCenter();this.emit("mapchange"),this.viewport.syncWithMapCamera({bearing:this.map.getBearing(),center:[a,n],viewportHeight:this.map.transform.height,pitch:this.map.getPitch(),viewportWidth:this.map.transform.width,zoom:this.map.getZoom(),cameraHeight:0}),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport)}),this.config=e.mapConfig,this.configService=e.globalConfigService,this.coordinateSystemService=e.coordinateSystemService,this.eventEmitter=new Yl.EventEmitter}setBgColor(e){this.bgColor=e}addMarkerContainer(){const e=this.map.getCanvasContainer();this.markerContainer=Xo("div","l7-marker-container",e),this.markerContainer.setAttribute("tabindex","-1")}getMarkerContainer(){return this.markerContainer}getOverlayContainer(){}getCanvasOverlays(){}on(e,r){po.indexOf(e)!==-1?this.eventEmitter.on(e,r):this.map.on(_3[e]||e,r)}off(e,r){this.map.off(_3[e]||e,r),this.eventEmitter.off(e,r)}getContainer(){return this.map.getContainer()}getMapCanvasContainer(){return this.map.getCanvasContainer()}getSize(){if(this.version==="SIMPLE")return this.simpleMapCoord.getSize();const e=this.map.transform;return[e.width,e.height]}getType(){return"default"}getZoom(){return this.map.getZoom()}setZoom(e){return this.map.setZoom(e)}getCenter(){return this.map.getCenter()}setCenter(e){this.map.setCenter(e)}getPitch(){return this.map.getPitch()}getRotation(){return this.map.getBearing()}getBounds(){return this.map.getBounds().toArray()}getMinZoom(){return this.map.getMinZoom()}getMaxZoom(){return this.map.getMaxZoom()}setRotation(e){this.map.setBearing(e)}zoomIn(e,r){this.map.zoomIn(e,r)}zoomOut(e,r){this.map.zoomOut(e,r)}setPitch(e){return this.map.setPitch(e)}panTo(e){this.map.panTo(e)}panBy(e=0,r=0){this.map.panBy([e,r])}fitBounds(e,r){this.map.fitBounds(e,r)}setMaxZoom(e){this.map.setMaxZoom(e)}setMinZoom(e){this.map.setMinZoom(e)}setMapStatus(e){e.doubleClickZoom===!0&&this.map.doubleClickZoom.enable(),e.doubleClickZoom===!1&&this.map.doubleClickZoom.disable(),e.dragEnable===!1&&this.map.dragPan.disable(),e.dragEnable===!0&&this.map.dragPan.enable(),e.rotateEnable===!1&&this.map.dragRotate.disable(),e.dragEnable===!0&&this.map.dragRotate.enable(),e.keyboardEnable===!1&&this.map.keyboard.disable(),e.keyboardEnable===!0&&this.map.keyboard.enable(),e.zoomEnable===!1&&this.map.scrollZoom.disable(),e.zoomEnable===!0&&this.map.scrollZoom.enable()}setZoomAndCenter(e,r){this.map.flyTo({zoom:e,center:r})}setMapStyle(e){this.map.setStyle(this.getMapStyleValue(e))}meterToCoord(e,r){return 1}pixelToLngLat(e){return this.map.unproject(e)}lngLatToPixel(e){return this.map.project(e)}containerToLngLat(e){return this.map.unproject(e)}lngLatToContainer(e){return this.map.project(e)}getMapStyle(){try{var e;const r=(e=this.map.getStyle().sprite)!==null&&e!==void 0?e:"";return/^mapbox:\/\/sprites\/zcxduo\/\w+\/\w+$/.test(r)?r==null?void 0:r.replace(/\/\w+$/,"").replace(/sprites/,"styles"):r}catch(r){return""}}getMapStyleConfig(){return DP}getMapStyleValue(e){var r;return(r=this.getMapStyleConfig()[e])!==null&&r!==void 0?r:e}destroy(){this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}emit(e,...r){this.eventEmitter.emit(e,...r)}once(e,...r){this.eventEmitter.once(e,...r)}getMapContainer(){return this.$mapContainer}exportMap(e){const r=this.map.getCanvas();return e==="jpg"?r==null?void 0:r.toDataURL("image/jpeg"):r==null?void 0:r.toDataURL("image/png")}onCameraChanged(e){this.cameraChangedCallback=e}creatMapContainer(e){let r=e;return typeof e=="string"&&(r=document.getElementById(e)),r}updateView(e){this.emit("mapchange"),this.viewport.syncWithMapCamera({bearing:e.bearing,center:e.center,viewportHeight:e.viewportHeight,pitch:e.pitch,viewportWidth:e.viewportWidth,zoom:e.zoom,cameraHeight:0}),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport)}updateCoordinateSystemService(){const{offsetCoordinate:e=!0}=this.config;this.viewport.getZoom()>OP&&e?this.coordinateSystemService.setCoordinateSystem(Xt.LNGLAT_OFFSET):this.coordinateSystemService.setCoordinateSystem(Xt.LNGLAT)}}if(!window)throw Error("BMapGL JSAPI can only be used in Browser.");var Zm=function(t){return t.notload="notload",t.loading="loading",t.loaded="loaded",t.failed="failed",t}(Zm||{});let eg={key:"",BMapGL:{version:"1.0"}},yg={BMapGL:Zm.notload};const A2=[],y3=t=>{if(typeof t=="function"){if(yg.BMapGL===Zm.loaded){t(window.BMapGL);return}A2.push(t)}};var BP={load:t=>new Promise((e,r)=>{if(yg.BMapGL===Zm.failed)r("");else if(yg.BMapGL===Zm.notload){const{key:n,version:a}=t;if(!n){r("\u8BF7\u586B\u5199key");return}eg.key=n,eg.BMapGL.version=a||eg.BMapGL.version,yg.BMapGL=Zm.loading;const u=document.body||document.head;window.___onBMapGLAPILoaded=A=>{if(delete window.___onBMapGLAPILoaded,A)yg.BMapGL=Zm.failed,r(A);else for(yg.BMapGL=Zm.loaded;A2.length;)A2.splice(0,1)[0](window.BMapGL)};const y=document.createElement("script");y.type="text/javascript",y.src=`https://api.map.baidu.com/api?type=webgl&v=${eg.BMapGL.version}&ak=${eg.key}&callback=___onBMapGLAPILoaded`,y.onerror=A=>{yg.BMapGL=Zm.failed,r(A)},u.appendChild(y),y3(e)}else if(yg.BMapGL===Zm.loaded){if(t.key&&t.key!==eg.key){r("\u591A\u4E2A\u4E0D\u4E00\u81F4\u7684 key");return}if(t.version&&t.version!==eg.BMapGL.version){r("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C JSAPI \u6DF7\u7528");return}e(window.BMapGL)}else{if(t.key&&t.key!==eg.key){r("\u591A\u4E2A\u4E0D\u4E00\u81F4\u7684 key");return}if(t.version&&t.version!==eg.BMapGL.version){r("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C JSAPI \u6DF7\u7528");return}y3(e)}}),reset:()=>{delete window.BMapGL,eg={key:"",BMapGL:{version:"1.0"}},yg={BMapGL:Zm.notload}}};const FP=["id","center","zoom","token","mapInstance","version","mapSize","minZoom","maxZoom"];function kP(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}kP(`.BMap_cpyCtrl .anchorBL {
display: none !important;
}
.anchorBL {
display: none !important;
}
`);const x3={mapmove:"moving",contextmenu:"rightclick",camerachange:"update",zoomchange:"zoomend"},b3="zLhopYPPERGtpGOgimcdKcCimGRyyIsh",E3="1.0";class NP extends _g{constructor(...e){super(...e),(0,K.Z)(this,"viewport",void 0),(0,K.Z)(this,"styleConfig",{normal:[]}),(0,K.Z)(this,"currentStyle","normal"),(0,K.Z)(this,"evtCbProxyMap",new Map),(0,K.Z)(this,"handleCameraChanged",()=>{this.emit("mapchange");const r=this.getMap(),{lng:n,lat:a}=r.getCenter(),u={center:[n,a],viewportHeight:r.getContainer().clientHeight,viewportWidth:r.getContainer().clientWidth,bearing:360-r.getHeading(),pitch:r.getTilt(),zoom:r.getZoom()-1.75};this.viewport.syncWithMapCamera(u),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport)})}getMap(){return this.map}setBgColor(e){this.bgColor=e}init(){var e=this;return(0,Nr.Z)(function*(){e.viewport=new Fg;const r=e.config,{id:n,center:a=[121.30654632240122,31.25744185633306],zoom:u=12,token:y=b3,mapInstance:A,version:O=E3,mapSize:Z=1e4,minZoom:Y=0,maxZoom:Q=21}=r,ae=(0,Ge.Z)(r,FP);if(e.viewport=new Fg,e.version=O,e.simpleMapCoord.setSize(Z),window.BMapGL||A||(yield BP.load({key:y,version:E3})),A){e.map=A,e.$mapContainer=e.map.getContainer();const xe=new BMapGL.Point(a[0],a[1]);e.map.isLoaded()||e.map.centerAndZoom(xe,u),e.initMapByConfig(e.config),e.map.on("update",e.handleCameraChanged)}else{const xe=(0,Wt.Z)({enableWheelZoom:!0,minZoom:Y,maxZoom:Q},ae);if(y===b3&&console.warn(`%c${e.configService.getSceneWarninfo("MapToken")}!`,"color: #873bf4;font-weigh:900;font-size: 16px;"),!n)throw Error("No container id specified");const Be=wc(n);let it=[...Be.childNodes];const gt=new BMapGL.Map(Be,xe);e.$mapContainer=gt.getContainer(),it.forEach(Rt=>{e.$mapContainer.appendChild(Rt)}),it=null,e.map=gt;const Bt=new BMapGL.Point(a[0],a[1]);e.map.centerAndZoom(Bt,u),e.initMapByConfig(e.config),gt.on("update",e.handleCameraChanged)}})()}destroy(){this.getMap().destroy()}onCameraChanged(e){this.cameraChangedCallback=e}addMarkerContainer(){}getMarkerContainer(){return this.map.getPanes().markerPane}getCanvasOverlays(){var e;return(e=this.getMap().getContainer().querySelector("#platform"))===null||e===void 0?void 0:e.lastChild}on(e,r){if(po.indexOf(e)!==-1){this.eventEmitter.on(e,r);return}let n=this.evtCbProxyMap.get(e);if(n||this.evtCbProxyMap.set(e,n=new Map),n.get(r))return;const a=(...u)=>{u[0]&&typeof u[0]=="object"&&!u[0].lngLat&&!u[0].lnglat&&(u[0].lngLat=u[0].latlng||u[0].latLng),r(...u)};n.set(r,a),this.map.on(x3[e]||e,a)}off(e,r){var n,a;if(po.indexOf(e)!==-1){this.eventEmitter.off(e,r);return}const u=(n=this.evtCbProxyMap.get(e))===null||n===void 0?void 0:n.get(r);u&&((a=this.evtCbProxyMap.get(e))===null||a===void 0||a.delete(r),this.map.off(x3[e]||e,u))}once(e,r){this.eventEmitter.once(e,r)}getContainer(){return this.getMap().getContainer()}getSize(){const e=this.getMap().getSize();return[e.width,e.height]}getMinZoom(){return this.map.getMinZoom()}getMaxZoom(){return this.map.getMaxZoom()}getType(){return"bmap"}getZoom(){return this.getMap().getZoom()}getCenter(e){if(e!=null&&e.padding){const n=this.getCenter(),a=v1(e.padding),u=this.lngLatToPixel([n.lng,n.lat]),y=[(a.right-a.left)/2,(a.bottom-a.top)/2];return this.pixelToLngLat([u.x-y[0],u.y-y[1]])}const r=this.map.getCenter();return{lng:r.lng,lat:r.lat}}getPitch(){return this.getMap().getTilt()}getRotation(){return 360-this.getMap().getHeading()}getBounds(){const e=this.getMap().getBounds(),r=e.getNorthEast(),n=e.getSouthWest();return[[n.lng,n.lat],[r.lng,r.lat]]}getMapContainer(){return this.getMap().getContainer()}getMapCanvasContainer(){return this.getMap().getContainer()}getMapStyleConfig(){return this.styleConfig}getMapStyleValue(e){return this.styleConfig[e]}setMapStyle(e){if(this.currentStyle===e)return;const r=Array.isArray(e)?e:this.styleConfig[e]||e;if(Array.isArray(r)){this.map.setMapStyleV2({styleJson:r}),this.currentStyle=e;return}if(typeof r=="string"){this.map.setMapStyleV2({styleId:r}),this.currentStyle=e;return}}setRotation(e){this.getMap().setHeading(e)}zoomIn(){this.getMap().zoomIn()}zoomOut(){this.getMap().zoomOut()}panTo(e){this.getMap().panTo(new BMapGL.Point(e[0],e[1]))}panBy(e,r){this.getMap().panBy(e,r)}fitBounds(e,r){this.map.setViewport(e.map(n=>new BMapGL.Point(n[0],n[1])),r)}setZoomAndCenter(e,[r,n]){this.getMap().centerAndZoom(new BMapGL.Point(r,n),e+1.75)}setCenter([e,r],n){let a={lng:e,lat:r};if(n!=null&&n.padding){const u=v1(n.padding),y=this.lngLatToPixel([e,r]),A=[(u.right-u.left)/2,(u.bottom-u.top)/2];a=this.pixelToLngLat([y.x+A[0],y.y+A[1]])}this.getMap().setCenter(new BMapGL.Point(a.lng,a.lat))}setPitch(e){this.getMap().setTilt(e)}setZoom(e){this.getMap().setZoom(e)}setMapStatus(e){const r=this.getMap();Object.keys(e).map(n=>{switch(n){case"doubleClickZoom":e.doubleClickZoom?r.enableDoubleClickZoom():r.disableDoubleClickZoom();break;case"dragEnable":e.dragEnable?r.enableDragging():r.disableDragging();break;case"keyboardEnable":e.keyboardEnable?r.enableKeyboard():r.disableKeyboard();break;case"resizeEnable":e.resizeEnable?r.enableAutoResize():r.disableAutoResize();break;case"rotateEnable":e.rotateEnable?(r.enableRotate(),r.enableRotateGestures()):(r.disableRotate(),r.disableRotateGestures());break;case"zoomEnable":e.zoomEnable?(this.map.enableDoubleClickZoom(),this.map.enableScrollWheelZoom(),this.map.enablePinchToZoom()):(this.map.disableDoubleClickZoom(),this.map.disableScrollWheelZoom(),this.map.disablePinchToZoom());break;case"showIndoorMap":r.setDisplayOptions({indoor:!!e.showIndoorMap});break;default:}})}meterToCoord(e,r){const n=this.getMap().getDistance(new BMapGL.Point(...e),new BMapGL.Point(...r)),[a,u]=this.lngLatToCoord(e),[y,A]=this.lngLatToCoord(r);return Math.sqrt(Math.pow(a-y,2)+Math.pow(u-A,2))/n}pixelToLngLat([e,r]){const n=this.getMap().pixelToPoint(new BMapGL.Pixel(e,r));return{lng:n.lng,lat:n.lat}}lngLatToPixel([e,r]){const n=this.getMap().pointToPixel(new BMapGL.Point(e,r));return{x:n.x,y:n.y}}containerToLngLat([e,r]){const n=this.getMap().overlayPixelToPoint(new BMapGL.Pixel(e,r));return{lng:n.lng,lat:n.lat}}lngLatToContainer([e,r]){const n=this.getMap().pointToOverlayPixel(new BMapGL.Point(e,r));return{x:n.x,y:n.y}}lngLatToCoord([e,r]){const{x:n,y:a}=this.getMap().pointToPixel(new BMapGL.Point(e,r));return[n,-a]}lngLatToCoords(e){return e.map(r=>Array.isArray(r[0])?this.lngLatToCoords(r):this.lngLatToCoord(r))}lngLatToMercator([e,r],n){const[a,u]=this.getMap().lnglatToMercator(e,r);return{x:a,y:u,z:n}}getModelMatrix(e,r,n,a=[1,1,1]){const u=this.viewport.projectFlat(e),y=Kr.create();return Kr.translate(y,y,ra.fromValues(u[0],u[1],r)),Kr.scale(y,y,ra.fromValues(a[0],a[1],a[2])),Kr.rotateX(y,y,n[0]),Kr.rotateY(y,y,n[1]),Kr.rotateZ(y,y,n[2]),y}getCustomCoordCenter(){throw new Error("Method not implemented.")}exportMap(e){const r=this.getMap()._webglPainter._canvas;return e==="jpg"?r==null?void 0:r.toDataURL("image/jpeg"):r==null?void 0:r.toDataURL("image/png")}hideLogo(){const e=this.map.getContainer();e&&dl(e,"bmap-contianer--hide-logo")}initMapByConfig(e){const{style:r,pitch:n=0,rotation:a=0,logoVisible:u=!0}=e;r&&this.setMapStyle(r),n&&this.setPitch(n),a&&this.setRotation(a),u===!1&&this.hideLogo()}}class zP extends Nm{getServiceConstructor(){return NP}}var UP=Se(545),ZP=Se.n(UP);let C2;function M2(t,e,r){const n=r-e,a=((t-e)%n+n)%n+e;return a===e?r:a}function xg(t,e,r){return Math.min(r,Math.max(e,t))}function Lm(t,e,r){return t*(1-r)+e*r}function P2(t,e,r,n){const a=new(ZP())(t,e,r,n);return u=>a.solve(u)}const R2=P2(.25,.1,.25,1);function w3(){var t;return C2==null&&typeof window!="undefined"&&window.matchMedia&&(C2=window.matchMedia("(prefers-reduced-motion: reduce)")),(t=C2)===null||t===void 0?void 0:t.matches}function VP(t,e){const r={};for(const n of e)n in t&&(r[n]=t[n]);return r}const kg=window.performance&&window.performance.now?window.performance.now.bind(window.performance):Date.now.bind(Date),jP=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,HP=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame;function x1(t){const e=jP(t);return{cancel:()=>HP(e)}}function GP(t,...e){for(const r of e)for(const n in r)r[n]!==void 0&&(t[n]=r[n]);return t}const S3=63710088e-1;class qu{static convert(e){if(e instanceof qu)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new qu(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null){const r="lng"in e?e.lng:e.lon;return new qu(Number(r),Number(e.lat))}throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}constructor(e,r){if((0,K.Z)(this,"lng",void 0),(0,K.Z)(this,"lat",void 0),isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new qu(M2(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,n=this.lat*r,a=e.lat*r,u=Math.sin(n)*Math.sin(a)+Math.cos(n)*Math.cos(a)*Math.cos((e.lng-this.lng)*r);return S3*Math.acos(Math.min(u,1))}}class tg{static convert(e){return e instanceof tg?e:new tg(e)}constructor(e,r){(0,K.Z)(this,"ne",void 0),(0,K.Z)(this,"sw",void 0),e&&(r?this.setSouthWest(e).setNorthEast(r):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this.ne=e instanceof qu?new qu(e.lng,e.lat):qu.convert(e),this}setSouthWest(e){return this.sw=e instanceof qu?new qu(e.lng,e.lat):qu.convert(e),this}extend(e){const r=this.sw,n=this.ne;let a,u;if(e instanceof qu)a=e,u=e;else if(e instanceof tg){if(a=e.sw,u=e.ne,!a||!u)return this}else{if(Array.isArray(e))if(e.length===4||e.every(Array.isArray)){const y=e;return this.extend(tg.convert(y))}else{const y=e;return this.extend(qu.convert(y))}return this}return!r&&!n?(this.sw=new qu(a.lng,a.lat),this.ne=new qu(u.lng,u.lat)):(r.lng=Math.min(a.lng,r.lng),r.lat=Math.min(a.lat,r.lat),n.lng=Math.max(u.lng,n.lng),n.lat=Math.max(u.lat,n.lat)),this}getCenter(){return new qu((this.sw.lng+this.ne.lng)/2,(this.sw.lat+this.ne.lat)/2)}getSouthWest(){return this.sw}getNorthEast(){return this.ne}getNorthWest(){return new qu(this.getWest(),this.getNorth())}getSouthEast(){return new qu(this.getEast(),this.getSouth())}getWest(){return this.sw.lng}getSouth(){return this.sw.lat}getEast(){return this.ne.lng}getNorth(){return this.ne.lat}toArray(){return[this.sw.toArray(),this.ne.toArray()]}toString(){return`LngLatBounds(${this.sw.toString()}, ${this.ne.toString()})`}isEmpty(){return!(this.sw&&this.ne)}contains(e){const{lng:r,lat:n}=qu.convert(e),a=this.sw.lat<=n&&n<=this.ne.lat;let u=this.sw.lng<=r&&r<=this.ne.lng;return this.sw.lng>this.ne.lng&&(u=this.sw.lng>=r&&r>=this.ne.lng),a&&u}}class Pl{static convert(e){return e instanceof Pl?e:Array.isArray(e)?new Pl(e[0],e[1]):e}constructor(e,r){(0,K.Z)(this,"x",void 0),(0,K.Z)(this,"y",void 0),this.x=e,this.y=r}clone(){return new Pl(this.x,this.y)}_add(e){return this.x+=e.x,this.y+=e.y,this}add(e){return this.clone()._add(e)}_sub(e){return this.x-=e.x,this.y-=e.y,this}sub(e){return this.clone()._sub(e)}_multByPoint(e){return this.x*=e.x,this.y*=e.y,this}multByPoint(e){return this.clone()._multByPoint(e)}_divByPoint(e){return this.x/=e.x,this.y/=e.y,this}divByPoint(e){return this.clone()._divByPoint(e)}_mult(e){return this.x*=e,this.y*=e,this}mult(e){return this.clone()._mult(e)}_div(e){return this.x/=e,this.y/=e,this}div(e){return this.clone()._div(e)}_rotate(e){const r=Math.cos(e),n=Math.sin(e),a=r*this.x-n*this.y,u=n*this.x+r*this.y;return this.x=a,this.y=u,this}rotate(e){return this.clone()._rotate(e)}_rotateAround(e,r){const n=Math.cos(e),a=Math.sin(e),u=r.x+n*(this.x-r.x)-a*(this.y-r.y),y=r.y+a*(this.x-r.x)+n*(this.y-r.y);return this.x=u,this.y=y,this}roateAround(e,r){return this.clone()._rotateAround(e,r)}_matMult(e){const r=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=r,this.y=n,this}matMult(e){return this.clone()._matMult(e)}_unit(){return this.div(this.mag()),this}unit(){return this.clone()._unit()}_perp(){const e=this.y;return this.y=this.x,this.x=-e,this}perp(){return this.clone()._perp()}_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}round(){return this.clone()._round()}mag(){return Math.sqrt(this.x*this.x+this.y*this.y)}equals(e){return this.x===e.x&&this.y===e.y}dist(e){return Math.sqrt(this.distSqr(e))}distSqr(e){const r=e.x-this.x,n=e.y-this.y;return r*r+n*n}angle(){return Math.atan2(this.y,this.x)}angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)}angleWith(e){return this.angleWithSep(e.x,e.y)}angleWithSep(e,r){return Math.atan2(this.x*r-this.y*e,this.x*e+this.y*r)}}var T3=Se(76406);class I2{constructor(e=0,r=0,n=0,a=0){if((0,K.Z)(this,"top",void 0),(0,K.Z)(this,"bottom",void 0),(0,K.Z)(this,"left",void 0),(0,K.Z)(this,"right",void 0),isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0||isNaN(a)||a<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=r,this.left=n,this.right=a}interpolate(e,r,n){return r.top!=null&&e.top!=null&&(this.top=Lm(e.top,r.top,n)),r.bottom!=null&&e.bottom!=null&&(this.bottom=Lm(e.bottom,r.bottom,n)),r.left!=null&&e.left!=null&&(this.left=Lm(e.left,r.left,n)),r.right!=null&&e.right!=null&&(this.right=Lm(e.right,r.right,n)),this}getCenter(e,r){const n=xg((this.left+e-this.right)/2,0,e),a=xg((this.top+r-this.bottom)/2,0,r);return new Pl(n,a)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new I2(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const A3=2*Math.PI*S3;function C3(t){return A3*Math.cos(t*Math.PI/180)}function b1(t){return(180+t)/360}function E1(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function M3(t,e){return t/C3(e)}function WP(t){return t*360-180}function L2(t){const e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function XP(t,e){return t*C3(L2(e))}function qP(t){return 1/Math.cos(t*Math.PI/180)}class Vm{static fromLngLat(e,r=0){const n=qu.convert(e);return new Vm(b1(n.lng),E1(n.lat),M3(r,n.lat))}constructor(e,r,n=0){(0,K.Z)(this,"x",void 0),(0,K.Z)(this,"y",void 0),(0,K.Z)(this,"z",void 0),this.x=+e,this.y=+r,this.z=+n}toLngLat(){return new qu(WP(this.x),L2(this.y))}toAltitude(){return XP(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/A3*qP(L2(this.y))}}const $O=8192;class D2{get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this._pitch=Math.max(this._pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this._pitch=Math.min(this._pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new Pl(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){const r=-M2(e,-180,180)*Math.PI/180;this.angle!==r&&(this.unmodified=!1,this.angle=r,this.calcMatrices(),this.rotationMatrix=T3.create(),T3.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const r=xg(e,this._minPitch,this._maxPitch)/180*Math.PI;this._pitch!==r&&(this.unmodified=!1,this._pitch=r,this.calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this.unmodified=!1,this._fov=e/180*Math.PI,this.calcMatrices())}get zoom(){return this._zoom}set zoom(e){const r=Math.min(Math.max(e,this._minZoom),this._maxZoom);this._zoom!==r&&(this.unmodified=!1,this._zoom=r,this.scale=this.zoomScale(r),this.tileZoom=Math.floor(r),this.zoomFraction=r-this.tileZoom,this.constrain(),this.calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this.unmodified=!1,this._center=e,this.constrain(),this.calcMatrices())}get padding(){return this.edgeInsets.toJSON()}set padding(e){this.edgeInsets.equals(e)||(this.unmodified=!1,this.edgeInsets.interpolate(this.edgeInsets,e,1),this.calcMatrices())}get centerPoint(){return this.edgeInsets.getCenter(this.width,this.height)}get point(){return this.project(this.center)}constructor(e,r,n,a,u){(0,K.Z)(this,"tileSize",void 0),(0,K.Z)(this,"tileZoom",void 0),(0,K.Z)(this,"lngRange",void 0),(0,K.Z)(this,"latRange",void 0),(0,K.Z)(this,"maxValidLatitude",void 0),(0,K.Z)(this,"scale",void 0),(0,K.Z)(this,"width",void 0),(0,K.Z)(this,"height",void 0),(0,K.Z)(this,"angle",void 0),(0,K.Z)(this,"rotationMatrix",void 0),(0,K.Z)(this,"pixelsToGLUnits",void 0),(0,K.Z)(this,"cameraToCenterDistance",void 0),(0,K.Z)(this,"mercatorMatrix",void 0),(0,K.Z)(this,"projMatrix",void 0),(0,K.Z)(this,"invProjMatrix",void 0),(0,K.Z)(this,"alignedProjMatrix",void 0),(0,K.Z)(this,"pixelMatrix",void 0),(0,K.Z)(this,"pixelMatrixInverse",void 0),(0,K.Z)(this,"glCoordMatrix",void 0),(0,K.Z)(this,"labelPlaneMatrix",void 0),(0,K.Z)(this,"_fov",void 0),(0,K.Z)(this,"_pitch",void 0),(0,K.Z)(this,"_zoom",void 0),(0,K.Z)(this,"_renderWorldCopies",void 0),(0,K.Z)(this,"_minZoom",void 0),(0,K.Z)(this,"_maxZoom",void 0),(0,K.Z)(this,"_minPitch",void 0),(0,K.Z)(this,"_maxPitch",void 0),(0,K.Z)(this,"_center",void 0),(0,K.Z)(this,"zoomFraction",void 0),(0,K.Z)(this,"unmodified",void 0),(0,K.Z)(this,"edgeInsets",void 0),(0,K.Z)(this,"constraining",void 0),(0,K.Z)(this,"posMatrixCache",void 0),(0,K.Z)(this,"alignedPosMatrixCache",void 0),this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=u===void 0?!0:u,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=n==null?0:n,this._maxPitch=a==null?60:a,this.setMaxBounds(),this.width=0,this.height=0,this._center=new qu(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this.unmodified=!0,this.edgeInsets=new I2,this.posMatrixCache={},this.alignedPosMatrixCache={}}clone(){const e=new D2(this._minZoom,this._maxZoom,this._minPitch,this._maxPitch,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e.center=this._center,e.zoom=this.zoom,e.angle=this.angle,e.fov=this._fov,e.pitch=this._pitch,e.unmodified=this.unmodified,e.edgeInsets=this.edgeInsets.clone(),e.calcMatrices(),e}isPaddingEqual(e){return this.edgeInsets.equals(e)}interpolatePadding(e,r,n){this.unmodified=!1,this.edgeInsets.interpolate(e,r,n),this.constrain(),this.calcMatrices()}coveringZoomLevel(e){const r=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,r)}resize(e,r){this.width=e,this.height=r,this.pixelsToGLUnits=[2/e,-2/r],this.constrain(),this.calcMatrices()}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){const r=xg(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new Pl(b1(e.lng)*this.worldSize,E1(r)*this.worldSize)}unproject(e){return new Vm(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}setLocationAtPoint(e,r){const n=this.pointCoordinate(r),a=this.pointCoordinate(this.centerPoint),u=this.locationCoordinate(e),y=new Vm(u.x-(n.x-a.x),u.y-(n.y-a.y));this.center=this.coordinateLocation(y),this._renderWorldCopies&&(this.center=this.center.wrap())}pointCoordinate(e){const n=new Float64Array([e.x,e.y,0,1]),a=new Float64Array([e.x,e.y,1,1]);mh.transformMat4(n,n,this.pixelMatrixInverse),mh.transformMat4(a,a,this.pixelMatrixInverse);const u=n[3],y=a[3],A=n[0]/u,O=a[0]/y,Z=n[1]/u,Y=a[1]/y,Q=n[2]/u,ae=a[2]/y,xe=Q===ae?0:(0-Q)/(ae-Q);return new Vm(Lm(A,O,xe)/this.worldSize,Lm(Z,Y,xe)/this.worldSize)}getBounds(){return new tg().extend(this.pointLocation(new Pl(0,0))).extend(this.pointLocation(new Pl(this.width,0))).extend(this.pointLocation(new Pl(this.width,this.height))).extend(this.pointLocation(new Pl(0,this.height)))}getMaxBounds(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new tg([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this.constrain()):(this.lngRange=void 0,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}customLayerMatrix(){return this.mercatorMatrix.slice()}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const e=this.pointCoordinate(new Pl(0,0)),r=new Float32Array([e.x*this.worldSize,e.y*this.worldSize,0,1]);return mh.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new Pl(0,r))}getCameraQueryGeometry(e){const r=this.getCameraPoint();if(e.length===1)return[e[0],r];{let n=r.x,a=r.y,u=r.x,y=r.y;for(const A of e)n=Math.min(n,A.x),a=Math.min(a,A.y),u=Math.max(u,A.x),y=Math.max(y,A.y);return[new Pl(n,a),new Pl(u,a),new Pl(u,y),new Pl(n,y),new Pl(n,a)]}}coordinatePoint(e){const r=mh.fromValues(e.x*this.worldSize,e.y*this.worldSize,0,1);return mh.transformMat4(r,r,this.pixelMatrix),new Pl(r[0]/r[3],r[1]/r[3])}locationPoint(e){return this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e){return this.coordinateLocation(this.pointCoordinate(e))}locationCoordinate(e){return Vm.fromLngLat(e)}coordinateLocation(e){return e.toLngLat()}getProjectionMatrix(){return this.projMatrix}constrain(){if(!this.center||!this.width||!this.height||this.constraining)return;this.constraining=!0;let e=-90,r=90,n=-180,a=180,u,y,A,O;const Z=this.size,Y=this.unmodified;if(this.latRange){const xe=this.latRange;e=E1(xe[1])*this.worldSize,r=E1(xe[0])*this.worldSize,u=r-e<Z.y?Z.y/(r-e):0}if(this.lngRange){const xe=this.lngRange;n=b1(xe[0])*this.worldSize,a=b1(xe[1])*this.worldSize,y=a-n<Z.x?Z.x/(a-n):0}const Q=this.point,ae=Math.max(y||0,u||0);if(ae){this.center=this.unproject(new Pl(y?(a+n)/2:Q.x,u?(r+e)/2:Q.y)),this.zoom+=this.scaleZoom(ae),this.unmodified=Y,this.constraining=!1;return}if(this.latRange){const xe=Q.y,Be=Z.y/2;xe-Be<e&&(O=e+Be),xe+Be>r&&(O=r-Be)}if(this.lngRange){const xe=Q.x,Be=Z.x/2;xe-Be<n&&(A=n+Be),xe+Be>a&&(A=a-Be)}(A!==void 0||O!==void 0)&&(this.center=this.unproject(new Pl(A!==void 0?A:Q.x,O!==void 0?O:Q.y))),this.unmodified=Y,this.constraining=!1}calcMatrices(){if(!this.height)return;const e=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(e)*this.height;const n=Math.PI/2+this._pitch,a=this._fov*(.5+r.y/this.height),u=Math.sin(a)*this.cameraToCenterDistance/Math.sin(xg(Math.PI-n-a,.01,Math.PI-.01)),y=this.point,A=y.x,O=y.y,Y=(Math.cos(Math.PI/2-this._pitch)*u+this.cameraToCenterDistance)*1.01,Q=this.height/50;let ae=new Float64Array(16);Kr.perspective(ae,this._fov,this.width/this.height,Q,Y),ae[8]=-r.x*2/this.width,ae[9]=r.y*2/this.height,Kr.scale(ae,ae,[1,-1,1]),Kr.translate(ae,ae,[0,0,-this.cameraToCenterDistance]),Kr.rotateX(ae,ae,this._pitch),Kr.rotateZ(ae,ae,this.angle),Kr.translate(ae,ae,[-A,-O,0]),this.mercatorMatrix=Kr.scale([],ae,[this.worldSize,this.worldSize,this.worldSize]),Kr.scale(ae,ae,[1,1,M3(1,this.center.lat)*this.worldSize,1]),this.projMatrix=ae,this.invProjMatrix=Kr.invert([],this.projMatrix);const xe=this.width%2/2,Be=this.height%2/2,it=Math.cos(this.angle),gt=Math.sin(this.angle),Bt=A-Math.round(A)+it*xe+gt*Be,Rt=O-Math.round(O)+it*Be+gt*xe,Yt=new Float64Array(ae);if(Kr.translate(Yt,Yt,[Bt>.5?Bt-1:Bt,Rt>.5?Rt-1:Rt,0]),this.alignedProjMatrix=Yt,ae=Kr.create(),Kr.scale(ae,ae,[this.width/2,-this.height/2,1]),Kr.translate(ae,ae,[1,-1,0]),this.labelPlaneMatrix=ae,ae=Kr.create(),Kr.scale(ae,ae,[1,-1,1]),Kr.translate(ae,ae,[-1,-1,0]),Kr.scale(ae,ae,[2/this.width,2/this.height,1]),this.glCoordMatrix=ae,this.pixelMatrix=Kr.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),ae=Kr.invert(new Float64Array(16),this.pixelMatrix),!ae)throw new Error("failed to invert matrix");this.pixelMatrixInverse=ae,this.posMatrixCache={},this.alignedPosMatrixCache={}}}const{merge:YP}=es;class Yu{constructor(e,r={}){(0,K.Z)(this,"type",void 0),YP(this,r),this.type=e}}const{merge:rg}=es;class P3 extends Yl.EventEmitter{constructor(e){super(),(0,K.Z)(this,"transform",void 0),(0,K.Z)(this,"options",void 0),(0,K.Z)(this,"moving",void 0),(0,K.Z)(this,"zooming",void 0),(0,K.Z)(this,"rotating",void 0),(0,K.Z)(this,"pitching",void 0),(0,K.Z)(this,"padding",void 0),(0,K.Z)(this,"bearingSnap",void 0),(0,K.Z)(this,"easeEndTimeoutID",void 0),(0,K.Z)(this,"easeStart",void 0),(0,K.Z)(this,"easeOptions",void 0),(0,K.Z)(this,"easeId",void 0),(0,K.Z)(this,"onEaseFrame",void 0),(0,K.Z)(this,"onEaseEnd",void 0),(0,K.Z)(this,"easeFrameId",void 0),(0,K.Z)(this,"pitchEnabled",void 0),(0,K.Z)(this,"rotateEnabled",void 0),(0,K.Z)(this,"renderFrameCallback",()=>{const A=Math.min((kg()-this.easeStart)/this.easeOptions.duration,1);this.onEaseFrame(this.easeOptions.easing(A)),A<1?this.easeFrameId=this.requestRenderFrame(this.renderFrameCallback):this.stop()}),this.options=e;const{minZoom:r,maxZoom:n,minPitch:a,maxPitch:u,renderWorldCopies:y}=e;this.moving=!1,this.zooming=!1,this.bearingSnap=e.bearingSnap,this.pitchEnabled=e.pitchEnabled,this.rotateEnabled=e.rotateEnabled,this.transform=new D2(r,n,a,u,y)}requestRenderFrame(e){return 0}cancelRenderFrame(e){}getCenter(){const{lng:e,lat:r}=this.transform.center;return new qu(e,r)}getZoom(){return this.transform.zoom}getPitch(){return this.transform.pitch}setCenter(e,r){return this.jumpTo({center:e},r)}setPitch(e,r){return this.jumpTo({pitch:e},r),this}getBearing(){return this.transform.bearing}panTo(e,r,n){return this.easeTo(rg({center:e},r),n)}panBy(e,r,n){return e=Pl.convert(e).mult(-1),this.panTo(this.transform.center,GP({offset:e},r||{}),n)}zoomOut(e,r){return this.zoomTo(this.getZoom()-1,e,r),this}setBearing(e,r){return this.jumpTo({bearing:e},r),this}setZoom(e,r){return this.jumpTo({zoom:e},r),this}zoomIn(e,r){return this.zoomTo(this.getZoom()+1,e,r),this}zoomTo(e,r,n){return this.easeTo(rg({zoom:e},r),n)}getPadding(){return this.transform.padding}setPadding(e,r){return this.jumpTo({padding:e},r),this}rotateTo(e,r,n){return this.easeTo(rg({bearing:e},r),n)}resetNorth(e,r){return this.rotateTo(0,rg({duration:1e3},e),r),this}resetNorthPitch(e,r){return this.easeTo(rg({bearing:0,pitch:0,duration:1e3},e),r),this}fitBounds(e,r,n){return this.fitInternal(this.cameraForBounds(e,r),r,n)}cameraForBounds(e,r){return e=tg.convert(e),this.cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),0,r)}snapToNorth(e,r){return Math.abs(this.getBearing())<this.bearingSnap?this.resetNorth(e,r):this}jumpTo(e={},r){this.stop();const n=this.transform;let a=!1,u=!1,y=!1;return e.zoom!==void 0&&n.zoom!==+e.zoom&&(a=!0,n.zoom=+e.zoom),e.center!==void 0&&(n.center=qu.convert(e.center)),e.bearing!==void 0&&n.bearing!==+e.bearing&&(u=!0,n.bearing=+e.bearing),e.pitch!==void 0&&n.pitch!==+e.pitch&&(y=!0,n.pitch=+e.pitch),e.padding!==void 0&&!n.isPaddingEqual(e.padding)&&(n.padding=e.padding),this.emit("movestart",new Yu("movestart",r)),this.emit("move",new Yu("move",r)),a&&(this.emit("zoomstart",new Yu("zoomstart",r)),this.emit("zoom",new Yu("zoom",r)),this.emit("zoomend",new Yu("zoomend",r))),u&&(this.emit("rotatestart",new Yu("rotatestart",r)),this.emit("rotate",new Yu("rotate",r)),this.emit("rotateend",new Yu("rotateend",r))),y&&(this.emit("pitchstart",new Yu("pitchstart",r)),this.emit("pitch",new Yu("pitch",r)),this.emit("pitchend",new Yu("pitchend",r))),this.emit("moveend",new Yu("moveend",r))}easeTo(e={},r){e=rg({offset:[0,0],duration:500,easing:R2},e),(e.animate===!1||!e.essential&&w3())&&(e.duration=0);const n=this.transform,a=this.getZoom(),u=this.getBearing(),y=this.getPitch(),A=this.getPadding(),O=e.zoom?+e.zoom:a,Z=e.bearing?this.normalizeBearing(e.bearing,u):u,Y=e.pitch?+e.pitch:y,Q=e.padding?e.padding:n.padding,ae=Pl.convert(e.offset);let xe=n.centerPoint.add(ae);const Be=n.pointLocation(xe),it=qu.convert(e.center||Be);this.normalizeCenter(it);const gt=n.project(Be),Bt=n.project(it).sub(gt),Rt=n.zoomScale(O-a);let Yt,vr;e.around&&(Yt=qu.convert(e.around),vr=n.locationPoint(Yt));const ln={moving:this.moving,zooming:this.zooming,rotating:this.rotating,pitching:this.pitching};return this.zooming=this.zooming||O!==a,this.rotating=this.rotating||u!==Z,this.pitching=this.pitching||Y!==y,this.padding=!n.isPaddingEqual(Q),this.easeId=e.easeId,this.prepareEase(r,e.noMoveStart,ln),clearTimeout(this.easeEndTimeoutID),this.ease(cn=>{if(this.zooming&&(n.zoom=Lm(a,O,cn)),this.rotating&&this.rotateEnabled&&(n.bearing=Lm(u,Z,cn)),this.pitching&&this.pitchEnabled&&(n.pitch=Lm(y,Y,cn)),this.padding&&(n.interpolatePadding(A,Q,cn),xe=n.centerPoint.add(ae)),Yt)n.setLocationAtPoint(Yt,vr);else{const Gr=n.zoomScale(n.zoom-a),Pn=O>a?Math.min(2,Rt):Math.max(.5,Rt),Oo=Math.pow(Pn,1-cn),Da=n.unproject(gt.add(Bt.mult(cn*Oo)).mult(Gr));n.setLocationAtPoint(n.renderWorldCopies?Da.wrap():Da,xe)}this.fireMoveEvents(r)},cn=>{this.afterEase(r,cn)},e),this}flyTo(e={},r){if(!e.essential&&w3()){const nl=VP(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(nl,r)}this.stop(),e=rg({offset:[0,0],speed:1.2,curve:1.42,easing:R2},e);const n=this.transform,a=this.getZoom(),u=this.getBearing(),y=this.getPitch(),A=this.getPadding(),O=e.zoom?xg(+e.zoom,n.minZoom,n.maxZoom):a,Z=e.bearing?this.normalizeBearing(e.bearing,u):u,Y=e.pitch?+e.pitch:y,Q="padding"in e?e.padding:n.padding,ae=n.zoomScale(O-a),xe=Pl.convert(e.offset);let Be=n.centerPoint.add(xe);const it=n.pointLocation(Be),gt=qu.convert(e.center||it);this.normalizeCenter(gt);const Bt=n.project(it),Rt=n.project(gt).sub(Bt);let Yt=e.curve;const vr=Math.max(n.width,n.height),ln=vr/ae,cn=Rt.mag();if("minZoom"in e){const nl=xg(Math.min(e.minZoom,a,O),n.minZoom,n.maxZoom),Df=vr/n.zoomScale(nl-a);Yt=Math.sqrt(Df/cn*2)}const Gr=Yt*Yt;function Pn(nl){const Df=(ln*ln-vr*vr+(nl?-1:1)*Gr*Gr*cn*cn)/(2*(nl?ln:vr)*Gr*cn);return Math.log(Math.sqrt(Df*Df+1)-Df)}function Oo(nl){return(Math.exp(nl)-Math.exp(-nl))/2}function Da(nl){return(Math.exp(nl)+Math.exp(-nl))/2}function Bo(nl){return Oo(nl)/Da(nl)}const Oa=Pn(0);let fl=nl=>Da(Oa)/Da(Oa+Yt*nl),Gp=nl=>vr*((Da(Oa)*Bo(Oa+Yt*nl)-Oo(Oa))/Gr)/cn,Wp=(Pn(1)-Oa)/Yt;if(Math.abs(cn)<1e-6||!isFinite(Wp)){if(Math.abs(vr-ln)<1e-6)return this.easeTo(e,r);const nl=ln<vr?-1:1;Wp=Math.abs(Math.log(ln/vr))/Yt,Gp=()=>0,fl=Df=>Math.exp(nl*Yt*Df)}if("duration"in e)e.duration=+e.duration;else{const nl="screenSpeed"in e?+e.screenSpeed/Yt:+e.speed;e.duration=1e3*Wp/nl}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this.zooming=!0,this.rotating=u!==Z,this.pitching=Y!==y,this.padding=!n.isPaddingEqual(Q),this.prepareEase(r,!1),this.ease(nl=>{const Df=nl*Wp,Xm=1/fl(Df);n.zoom=nl===1?O:a+n.scaleZoom(Xm),this.rotating&&(n.bearing=Lm(u,Z,nl)),this.pitching&&(n.pitch=Lm(y,Y,nl)),this.padding&&(n.interpolatePadding(A,Q,nl),Be=n.centerPoint.add(xe));const vd=nl===1?gt:n.unproject(Bt.add(Rt.mult(Gp(Df))).mult(Xm));n.setLocationAtPoint(n.renderWorldCopies?vd.wrap():vd,Be),this.fireMoveEvents(r)},()=>this.afterEase(r),e),this}fitScreenCoordinates(e,r,n,a,u){return this.fitInternal(this.cameraForBoxAndBearing(this.transform.pointLocation(Pl.convert(e)),this.transform.pointLocation(Pl.convert(r)),n,a),a,u)}stop(e,r){if(this.easeFrameId&&(this.cancelRenderFrame(this.easeFrameId),delete this.easeFrameId,delete this.onEaseFrame),this.onEaseEnd){const n=this.onEaseEnd;delete this.onEaseEnd,n.call(this,r)}return this}normalizeBearing(e,r){e=M2(e,-180,180);const n=Math.abs(e-r);return Math.abs(e-360-r)<n&&(e-=360),Math.abs(e+360-r)<n&&(e+=360),e}normalizeCenter(e){const r=this.transform;if(!r.renderWorldCopies||r.lngRange)return;const n=e.lng-r.center.lng;e.lng+=n>180?-360:n<-180?360:0}fireMoveEvents(e){this.emit("move",new Yu("move",e)),this.zooming&&this.emit("zoom",new Yu("zoom",e)),this.rotating&&this.emit("rotate",new Yu("rotate",e)),this.pitching&&this.emit("rotate",new Yu("pitch",e))}prepareEase(e,r=!1,n={}){this.moving=!0,!r&&!n.moving&&this.emit("movestart",new Yu("movestart",e)),this.zooming&&!n.zooming&&this.emit("zoomstart",new Yu("zoomstart",e)),this.rotating&&!n.rotating&&this.emit("rotatestart",new Yu("rotatestart",e)),this.pitching&&!n.pitching&&this.emit("pitchstart",new Yu("pitchstart",e))}afterEase(e,r){if(this.easeId&&r&&this.easeId===r)return;delete this.easeId;const n=this.zooming,a=this.rotating,u=this.pitching;this.moving=!1,this.zooming=!1,this.rotating=!1,this.pitching=!1,this.padding=!1,n&&this.emit("zoomend",new Yu("zoomend",e)),a&&this.emit("rotateend",new Yu("rotateend",e)),u&&this.emit("pitchend",new Yu("pitchend",e)),this.emit("moveend",new Yu("moveend",e))}ease(e,r,n){n.animate===!1||n.duration===0?(e(1),r()):(this.easeStart=kg(),this.easeOptions=n,this.onEaseFrame=e,this.onEaseEnd=r,this.easeFrameId=this.requestRenderFrame(this.renderFrameCallback))}cameraForBoxAndBearing(e,r,n,a){const u={top:0,bottom:0,right:0,left:0};if(a=rg({padding:u,offset:[0,0],maxZoom:this.transform.maxZoom},a),typeof a.padding=="number"){const Pn=a.padding;a.padding={top:Pn,bottom:Pn,right:Pn,left:Pn}}a.padding=rg(u,a.padding);const y=this.transform,A=y.padding,O=y.project(qu.convert(e)),Z=y.project(qu.convert(r)),Y=O.rotate(-n*Math.PI/180),Q=Z.rotate(-n*Math.PI/180),ae=new Pl(Math.max(Y.x,Q.x),Math.max(Y.y,Q.y)),xe=new Pl(Math.min(Y.x,Q.x),Math.min(Y.y,Q.y)),Be=ae.sub(xe),it=(y.width-(A.left+A.right+a.padding.left+a.padding.right))/Be.x,gt=(y.height-(A.top+A.bottom+a.padding.top+a.padding.bottom))/Be.y;if(gt<0||it<0)return;const Bt=Math.min(y.scaleZoom(y.scale*Math.min(it,gt)),a.maxZoom),Rt=Pl.convert(a.offset),Yt=(a.padding.left-a.padding.right)/2,vr=(a.padding.top-a.padding.bottom)/2,cn=new Pl(Rt.x+Yt,Rt.y+vr).mult(y.scale/y.zoomScale(Bt));return{center:y.unproject(O.add(Z).div(2).sub(cn)),zoom:Bt,bearing:n}}fitInternal(e,r,n){return e?(r=rg(e,r),delete r.padding,r.linear?this.easeTo(r,n):this.flyTo(r,n)):this}}const mm={};var od=mm;mm.create=(t,e,r)=>{const n=window.document.createElement(t);return e!==void 0&&(n.className=e),r&&r.appendChild(n),n},mm.createNS=(t,e)=>window.document.createElementNS(t,e);const o0=window.document&&window.document.documentElement.style;function R3(t){if(!o0)return t[0];for(const e of t)if(e in o0)return e;return t[0]}const g_=R3(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);let I3;mm.disableDrag=()=>{o0&&g_&&(I3=o0[g_],o0[g_]="none")},mm.enableDrag=()=>{o0&&g_&&(o0[g_]=I3)};const $P=R3(["transform","WebkitTransform"]);mm.setTransform=(t,e)=>{t.style[$P]=e};let w1=!1;try{const t=Object.defineProperty({},"passive",{get(){w1=!0}});window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){w1=!1}mm.addEventListener=(t,e,r,n={})=>{"passive"in n&&w1?t.addEventListener(e,r,n):t.addEventListener(e,r,n.capture)},mm.removeEventListener=(t,e,r,n={})=>{"passive"in n&&w1?t.removeEventListener(e,r,n):t.removeEventListener(e,r,n.capture)};const O2=t=>{t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",O2,!0)};mm.suppressClick=()=>{window.addEventListener("click",O2,!0),setTimeout(()=>{window.removeEventListener("click",O2,!0)},0)},mm.mousePos=(t,e)=>{const r=t.getBoundingClientRect();return new Pl(e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop)},mm.touchPos=(t,e)=>{const r=t.getBoundingClientRect(),n=[];for(const a of e)n.push(new Pl(a.clientX-r.left-t.clientLeft,a.clientY-r.top-t.clientTop));return n},mm.mouseButton=t=>t.button,mm.remove=t=>{t.parentNode&&t.parentNode.removeChild(t)};class bg extends Yu{constructor(e,r,n){super(e),(0,K.Z)(this,"target",void 0),(0,K.Z)(this,"originalEvent",void 0),(0,K.Z)(this,"point",void 0),(0,K.Z)(this,"lngLat",void 0),(0,K.Z)(this,"defaultPrevented",void 0);const a=od.mousePos(r.getCanvasContainer(),n),u=r.unproject(a);this.point=a,this.lngLat=u,this.originalEvent=n,this.defaultPrevented=!1,this.target=r}preventDefault(){this.defaultPrevented=!0}}class S1 extends Yu{constructor(e,r,n){super(e),(0,K.Z)(this,"target",void 0),(0,K.Z)(this,"originalEvent",void 0),(0,K.Z)(this,"lngLat",void 0),(0,K.Z)(this,"point",void 0),(0,K.Z)(this,"points",void 0),(0,K.Z)(this,"lngLats",void 0),(0,K.Z)(this,"defaultPrevented",void 0);const a=e==="touchend"?n.changedTouches:n.touches,u=od.touchPos(r.getCanvasContainer(),a),y=u.map(Z=>r.unproject(Z)),A=u.reduce((Z,Y,Q,ae)=>Z.add(Y.div(ae.length)),new Pl(0,0)),O=r.unproject(A);this.points=u,this.point=A,this.lngLats=y,this.lngLat=O,this.originalEvent=n,this.defaultPrevented=!1}preventDefault(){this.defaultPrevented=!0}}class KP extends Yu{constructor(e,r,n){super(e),(0,K.Z)(this,"originalEvent",void 0),(0,K.Z)(this,"defaultPrevented",void 0),(0,K.Z)(this,"target",void 0),this.originalEvent=n,this.defaultPrevented=!1}preventDefault(){this.defaultPrevented=!0}}class JP{constructor(e){(0,K.Z)(this,"map",void 0),(0,K.Z)(this,"delayContextMenu",void 0),(0,K.Z)(this,"contextMenuEvent",void 0),this.map=e}reset(){this.delayContextMenu=!1,delete this.contextMenuEvent}mousemove(e){this.map.emit(e.type,new bg(e.type,this.map,e))}mousedown(){this.delayContextMenu=!0}mouseup(){this.delayContextMenu=!1,this.contextMenuEvent&&(this.map.emit("contextmenu",new bg("contextmenu",this.map,this.contextMenuEvent)),delete this.contextMenuEvent)}contextmenu(e){this.delayContextMenu?this.contextMenuEvent=e:this.map.emit(e.type,new bg(e.type,this.map,e)),this.map.listeners("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){return!0}disable(){return!1}}class QP{constructor(e,r){(0,K.Z)(this,"map",void 0),(0,K.Z)(this,"el",void 0),(0,K.Z)(this,"container",void 0),(0,K.Z)(this,"enabled",void 0),(0,K.Z)(this,"active",void 0),(0,K.Z)(this,"startPos",void 0),(0,K.Z)(this,"lastPos",void 0),(0,K.Z)(this,"box",void 0),(0,K.Z)(this,"clickTolerance",void 0),this.map=e,this.el=e.getCanvasContainer(),this.container=e.getContainer(),this.clickTolerance=r.clickTolerance||1}isEnabled(){return!!this.enabled}isActive(){return!!this.active}enable(){this.isEnabled()||(this.enabled=!0)}disable(){this.isEnabled()&&(this.enabled=!1)}mousedown(e,r){this.isEnabled()&&e.shiftKey&&e.button===0&&(od.disableDrag(),this.startPos=this.lastPos=r,this.active=!0)}mousemoveWindow(e,r){if(!this.active)return;const n=r;if(this.lastPos.equals(n)||!this.box&&n.dist(this.startPos)<this.clickTolerance)return;const a=this.startPos;this.lastPos=n,this.box||(this.box=od.create("div","l7-boxzoom",this.container),this.container.classList.add("l7-crosshair"),this.fireEvent("boxzoomstart",e));const u=Math.min(a.x,n.x),y=Math.max(a.x,n.x),A=Math.min(a.y,n.y),O=Math.max(a.y,n.y);od.setTransform(this.box,`translate(${u}px,${A}px)`),this.box&&(this.box.style.width=`${y-u}px`,this.box.style.height=`${O-A}px`)}mouseupWindow(e,r){if(!this.active||e.button!==0)return;const n=this.startPos,a=r;if(this.reset(),od.suppressClick(),n.x===a.x&&n.y===a.y)this.fireEvent("boxzoomcancel",e);else return this.map.emit("boxzoomend",new Yu("boxzoomend",{originalEvent:e})),{cameraAnimation:u=>u.fitScreenCoordinates(n,a,this.map.getBearing(),{linear:!0})}}keydown(e){this.active&&e.keyCode===27&&(this.reset(),this.fireEvent("boxzoomcancel",e))}reset(){this.active=!1,this.container.classList.remove("l7-crosshair"),this.box&&(od.remove(this.box),this.box=null),od.enableDrag(),delete this.startPos,delete this.lastPos}fireEvent(e,r){return this.map.emit(e,new Yu(e,{originalEvent:r}))}}var eR=QP;class tR{constructor(){(0,K.Z)(this,"enabled",void 0),(0,K.Z)(this,"active",void 0),this.reset()}reset(){this.active=!1}dblclick(e,r){return e.preventDefault(),{cameraAnimation:n=>{n.easeTo({duration:300,zoom:n.getZoom()+(e.shiftKey?-1:1),around:n.unproject(r)},{originalEvent:e})}}}enable(){this.enabled=!0}disable(){this.enabled=!1,this.reset()}isEnabled(){return this.enabled}isActive(){return this.active}}class rR extends Yu{constructor(e,r){super(e),(0,K.Z)(this,"type","renderFrame"),(0,K.Z)(this,"timeStamp",void 0),this.timeStamp=r}}const{merge:N0}=es,T1={linearity:.3,easing:P2(0,0,.3,1)},nR=N0({deceleration:2500,maxSpeed:1400},T1),iR=N0({deceleration:20,maxSpeed:1400},T1),oR=N0({deceleration:1e3,maxSpeed:360},T1),aR=N0({deceleration:1e3,maxSpeed:90},T1);class sR{constructor(e){(0,K.Z)(this,"map",void 0),(0,K.Z)(this,"inertiaBuffer",void 0),this.map=e,this.clear()}clear(){this.inertiaBuffer=[]}record(e){this.drainInertiaBuffer(),this.inertiaBuffer.push({time:kg(),settings:e})}drainInertiaBuffer(){const e=this.inertiaBuffer,r=kg(),n=160;for(;e.length>0&&r-e[0].time>n;)e.shift()}onMoveEnd(e){if(this.drainInertiaBuffer(),this.inertiaBuffer.length<2)return;const r={zoom:0,bearing:0,pitch:0,pan:new Pl(0,0),pinchAround:void 0,around:void 0};for(const{settings:y}of this.inertiaBuffer)r.zoom+=y.zoomDelta||0,r.bearing+=y.bearingDelta||0,r.pitch+=y.pitchDelta||0,y.panDelta&&r.pan._add(y.panDelta),y.around&&(r.around=y.around),y.pinchAround&&(r.pinchAround=y.pinchAround);const a=this.inertiaBuffer[this.inertiaBuffer.length-1].time-this.inertiaBuffer[0].time,u={};if(r.pan.mag()){const y=C1(r.pan.mag(),a,N0({},nR,e||{}));u.offset=r.pan.mult(y.amount/r.pan.mag()),u.center=this.map.transform.center,A1(u,y)}if(r.zoom){const y=C1(r.zoom,a,iR);u.zoom=this.map.transform.zoom+y.amount,A1(u,y)}if(r.bearing){const y=C1(r.bearing,a,oR);u.bearing=this.map.transform.bearing+xg(y.amount,-179,179),A1(u,y)}if(r.pitch){const y=C1(r.pitch,a,aR);u.pitch=this.map.transform.pitch+y.amount,A1(u,y)}if(u.zoom||u.bearing){const y=r.pinchAround===void 0?r.around:r.pinchAround;u.around=y?this.map.unproject(y):this.map.getCenter()}return this.clear(),N0(u,{noMoveStart:!0})}}function A1(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function C1(t,e,r){const{maxSpeed:n,linearity:a,deceleration:u}=r,y=xg(t*a/(e/1e3),-n,n),A=Math.abs(y)/(u*a);return{easing:r.easing,duration:A*1e3,amount:y*(A/2)}}const lR={panStep:100,bearingStep:15,pitchStep:10};class uR{constructor(){(0,K.Z)(this,"enabled",void 0),(0,K.Z)(this,"active",void 0),(0,K.Z)(this,"panStep",void 0),(0,K.Z)(this,"bearingStep",void 0),(0,K.Z)(this,"pitchStep",void 0);const e=lR;this.panStep=e.panStep,this.bearingStep=e.bearingStep,this.pitchStep=e.pitchStep}reset(){this.active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let r=0,n=0,a=0,u=0,y=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),u=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),u=1);break;case 38:e.shiftKey?a=1:(e.preventDefault(),y=-1);break;case 40:e.shiftKey?a=-1:(e.preventDefault(),y=1);break;default:return}return{cameraAnimation:A=>{const O=A.getZoom();A.easeTo({duration:300,easeId:"keyboardHandler",easing:cR,zoom:r?Math.round(O)+r*(e.shiftKey?2:1):O,bearing:A.getBearing()+n*this.bearingStep,pitch:A.getPitch()+a*this.pitchStep,offset:[-u*this.panStep,-y*this.panStep],center:A.getCenter()},{originalEvent:e})}}}enable(){this.enabled=!0}disable(){this.enabled=!1,this.reset()}isEnabled(){return this.enabled}isActive(){return this.active}}function cR(t){return t*(2-t)}var hR=uR;class pR{constructor(e,r){(0,K.Z)(this,"mousedownPos",void 0),(0,K.Z)(this,"clickTolerance",void 0),(0,K.Z)(this,"map",void 0),this.map=e,this.clickTolerance=r.clickTolerance}reset(){delete this.mousedownPos}wheel(e){return this.firePreventable(new KP(e.type,this.map,e))}mousedown(e,r){return this.mousedownPos=r,this.firePreventable(new bg(e.type,this.map,e))}mouseup(e){this.map.emit(e.type,new bg(e.type,this.map,e))}click(e,r){this.mousedownPos&&this.mousedownPos.dist(r)>=this.clickTolerance||this.map.emit(e.type,new bg(e.type,this.map,e))}dblclick(e){return this.firePreventable(new bg(e.type,this.map,e))}mouseover(e){this.map.emit(e.type,new bg(e.type,this.map,e))}mouseout(e){this.map.emit(e.type,new bg(e.type,this.map,e))}touchstart(e){return this.firePreventable(new S1(e.type,this.map,e))}touchmove(e){this.map.emit(e.type,new S1(e.type,this.map,e))}touchend(e){this.map.emit(e.type,new S1(e.type,this.map,e))}touchcancel(e){this.map.emit(e.type,new S1(e.type,this.map,e))}firePreventable(e){if(this.map.emit(e.type,e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){return!1}disable(){return!1}}const M1=0,B2=2,fR={[M1]:1,[B2]:2};function dR(t,e){const r=fR[e];return t.buttons===void 0||(t.buttons&r)!==r}class F2{constructor(e){(0,K.Z)(this,"enabled",void 0),(0,K.Z)(this,"active",void 0),(0,K.Z)(this,"lastPoint",void 0),(0,K.Z)(this,"eventButton",void 0),(0,K.Z)(this,"moved",void 0),(0,K.Z)(this,"clickTolerance",void 0),this.reset(),this.clickTolerance=e.clickTolerance||1}reset(){this.active=!1,this.moved=!1,delete this.lastPoint,delete this.eventButton}mousedown(e,r){if(this.lastPoint)return;const n=od.mouseButton(e);this.correctButton(e,n)&&(this.lastPoint=r,this.eventButton=n)}mousemoveWindow(e,r){const n=this.lastPoint;if(n){if(e.preventDefault(),dR(e,this.eventButton)){this.reset();return}if(!(!this.moved&&r.dist(n)<this.clickTolerance))return this.moved=!0,this.lastPoint=r,this.move(n,r)}}mouseupWindow(e){!this.lastPoint||od.mouseButton(e)!==this.eventButton||(this.moved&&od.suppressClick(),this.reset())}enable(){this.enabled=!0}disable(){this.enabled=!1,this.reset()}isEnabled(){return this.enabled}isActive(){return this.active}correctButton(e,r){return!1}move(e,r){}}class mR extends F2{mousedown(e,r){super.mousedown(e,r),this.lastPoint&&(this.active=!0)}move(e,r){return{around:r,panDelta:r.sub(e)}}correctButton(e,r){return r===M1&&!e.ctrlKey}}class gR extends F2{correctButton(e,r){return r===M1&&e.ctrlKey||r===B2}move(e,r){const a=(r.y-e.y)*-.5;if(a)return this.active=!0,{pitchDelta:a}}contextmenu(e){e.preventDefault()}}class vR extends F2{contextmenu(e){e.preventDefault()}correctButton(e,r){return r===M1&&e.ctrlKey||r===B2}move(e,r){const a=(r.x-e.x)*.8;if(a)return this.active=!0,{bearingDelta:a}}}const L3=4.000244140625,_R=1/100,yR=1/450,xR=2;class bR{constructor(e,r){(0,K.Z)(this,"map",void 0),(0,K.Z)(this,"el",void 0),(0,K.Z)(this,"enabled",void 0),(0,K.Z)(this,"active",void 0),(0,K.Z)(this,"zooming",void 0),(0,K.Z)(this,"aroundCenter",void 0),(0,K.Z)(this,"around",void 0),(0,K.Z)(this,"aroundPoint",void 0),(0,K.Z)(this,"type",void 0),(0,K.Z)(this,"lastValue",void 0),(0,K.Z)(this,"timeout",void 0),(0,K.Z)(this,"finishTimeout",void 0),(0,K.Z)(this,"lastWheelEvent",void 0),(0,K.Z)(this,"lastWheelEventTime",void 0),(0,K.Z)(this,"startZoom",void 0),(0,K.Z)(this,"targetZoom",void 0),(0,K.Z)(this,"delta",void 0),(0,K.Z)(this,"easing",void 0),(0,K.Z)(this,"prevEase",void 0),(0,K.Z)(this,"frameId",void 0),(0,K.Z)(this,"handler",void 0),(0,K.Z)(this,"defaultZoomRate",void 0),(0,K.Z)(this,"wheelZoomRate",void 0),(0,K.Z)(this,"onScrollFrame",()=>{if(!this.frameId||(this.frameId=null,!this.isActive()))return;const n=this.map.transform;if(this.delta!==0){const Z=this.type==="wheel"&&Math.abs(this.delta)>L3?this.wheelZoomRate:this.defaultZoomRate;let Y=xR/(1+Math.exp(-Math.abs(this.delta*Z)));this.delta<0&&Y!==0&&(Y=1/Y);const Q=typeof this.targetZoom=="number"?n.zoomScale(this.targetZoom):n.scale;this.targetZoom=Math.min(n.maxZoom,Math.max(n.minZoom,n.scaleZoom(Q*Y))),this.type==="wheel"&&(this.startZoom=n.zoom,this.easing=this.smoothOutEasing(200)),this.delta=0}const a=typeof this.targetZoom=="number"?this.targetZoom:n.zoom,u=this.startZoom,y=this.easing;let A=!1,O;if(this.type==="wheel"&&u&&y){const Z=Math.min((kg()-this.lastWheelEventTime)/200,1),Y=y(Z);O=Lm(u,a,Y),Z<1?this.frameId||(this.frameId=!0):A=!0}else O=a,A=!0;return this.active=!0,A&&(this.active=!1,this.finishTimeout=setTimeout(()=>{this.zooming=!1,this.handler.triggerRenderFrame(),delete this.targetZoom,delete this.finishTimeout},200)),{noInertia:!0,needsRenderFrame:!A,zoomDelta:O-n.zoom,around:this.aroundPoint,originalEvent:this.lastWheelEvent}}),this.map=e,this.el=e.getCanvasContainer(),this.handler=r,this.delta=0,this.defaultZoomRate=_R,this.wheelZoomRate=yR}setZoomRate(e){this.defaultZoomRate=e}setWheelZoomRate(e){this.wheelZoomRate=e}isEnabled(){return!!this.enabled}isActive(){return!!this.active||this.finishTimeout!==void 0}isZooming(){return!!this.zooming}enable(e){this.isEnabled()||(this.enabled=!0,this.aroundCenter=e&&e.around==="center")}disable(){this.isEnabled()&&(this.enabled=!1)}wheel(e){if(!this.isEnabled())return;let r=e.deltaMode===window.WheelEvent.DOM_DELTA_LINE?e.deltaY*40:e.deltaY;const n=kg(),a=n-(this.lastWheelEventTime||0);this.lastWheelEventTime=n,r!==0&&r%L3===0?this.type="wheel":r!==0&&Math.abs(r)<4?this.type="trackpad":a>400?(this.type=null,this.lastValue=r,this.timeout=setTimeout(this.onTimeout,40,e)):this.type||(this.type=Math.abs(a*r)<200?"trackpad":"wheel",this.timeout&&(clearTimeout(this.timeout),this.timeout=null,r+=this.lastValue)),e.shiftKey&&r&&(r=r/4),this.type&&(this.lastWheelEvent=e,this.delta-=r,this.active||this.start(e)),e.preventDefault()}renderFrame(){return this.onScrollFrame()}reset(){this.active=!1}onTimeout(e){this.type="wheel",this.delta-=this.lastValue,!this.active&&this.start&&this.start(e)}start(e){if(!this.delta)return;this.frameId&&(this.frameId=null),this.active=!0,this.isZooming()||(this.zooming=!0),this.finishTimeout&&(clearTimeout(this.finishTimeout),delete this.finishTimeout);const r=od.mousePos(this.el,e);this.around=qu.convert(this.aroundCenter?this.map.getCenter():this.map.unproject(r)),this.aroundPoint=this.map.transform.locationPoint(this.around),this.frameId||(this.frameId=!0,this.handler.triggerRenderFrame())}smoothOutEasing(e){let r=R2;if(this.prevEase){const n=this.prevEase,a=(kg()-n.start)/n.duration,u=n.easing(a+.01)-n.easing(a),y=.27/Math.sqrt(u*u+1e-4)*.01,A=Math.sqrt(.27*.27-y*y);r=P2(y,A,.25,1)}return this.prevEase={start:kg(),duration:e,easing:r},r}}var ER=bR;class wR{constructor(e,r){(0,K.Z)(this,"clickZoom",void 0),(0,K.Z)(this,"tapZoom",void 0),this.clickZoom=e,this.tapZoom=r}enable(){this.clickZoom.enable(),this.tapZoom.enable()}disable(){this.clickZoom.disable(),this.tapZoom.disable()}isEnabled(){return this.clickZoom.isEnabled()&&this.tapZoom.isEnabled()}isActive(){return this.clickZoom.isActive()||this.tapZoom.isActive()}}class SR{constructor(e,r,n){(0,K.Z)(this,"inertiaOptions",void 0),(0,K.Z)(this,"el",void 0),(0,K.Z)(this,"mousePan",void 0),(0,K.Z)(this,"touchPan",void 0),this.el=e,this.mousePan=r,this.touchPan=n}enable(e){this.inertiaOptions=e||{},this.mousePan.enable(),this.touchPan.enable(),this.el.classList.add("l7-touch-drag-pan")}disable(){this.mousePan.disable(),this.touchPan.disable(),this.el.classList.remove("l7-touch-drag-pan")}isEnabled(){return this.mousePan.isEnabled()&&this.touchPan.isEnabled()}isActive(){return this.mousePan.isActive()||this.touchPan.isActive()}}class TR{constructor(e,r,n){(0,K.Z)(this,"mouseRotate",void 0),(0,K.Z)(this,"mousePitch",void 0),(0,K.Z)(this,"pitchWithRotate",void 0),this.pitchWithRotate=e.pitchWithRotate,this.mouseRotate=r,this.mousePitch=n}enable(){this.mouseRotate.enable(),this.pitchWithRotate&&this.mousePitch.enable()}disable(){this.mouseRotate.disable(),this.mousePitch.disable()}isEnabled(){return this.mouseRotate.isEnabled()&&(!this.pitchWithRotate||this.mousePitch.isEnabled())}isActive(){return this.mouseRotate.isActive()||this.mousePitch.isActive()}}class AR{constructor(e,r,n,a){(0,K.Z)(this,"el",void 0),(0,K.Z)(this,"touchZoom",void 0),(0,K.Z)(this,"touchRotate",void 0),(0,K.Z)(this,"tapDragZoom",void 0),(0,K.Z)(this,"rotationDisabled",void 0),(0,K.Z)(this,"enabled",void 0),this.el=e,this.touchZoom=r,this.touchRotate=n,this.tapDragZoom=a,this.rotationDisabled=!1,this.enabled=!0}enable(e){this.touchZoom.enable(e),this.rotationDisabled||this.touchRotate.enable(e),this.tapDragZoom.enable(),this.el.classList.add("l7-touch-zoom-rotate")}disable(){this.touchZoom.disable(),this.touchRotate.disable(),this.tapDragZoom.disable(),this.el.classList.remove("l7-touch-zoom-rotate")}isEnabled(){return this.touchZoom.isEnabled()&&(this.rotationDisabled||this.touchRotate.isEnabled())&&this.tapDragZoom.isEnabled()}isActive(){return this.touchZoom.isActive()||this.touchRotate.isActive()||this.tapDragZoom.isActive()}disableRotation(){this.rotationDisabled=!0,this.touchRotate.disable()}enableRotation(){this.rotationDisabled=!1,this.touchZoom.isEnabled()&&this.touchRotate.enable()}}function k2(t,e){const r={};for(let n=0;n<t.length;n++)r[t[n].identifier]=e[n];return r}function CR(t){const e=new Pl(0,0);for(const r of t)e._add(r);return e.div(t.length)}const D3=500,MR=500,O3=30;class PR{constructor(e){(0,K.Z)(this,"numTouches",void 0),(0,K.Z)(this,"centroid",void 0),(0,K.Z)(this,"startTime",void 0),(0,K.Z)(this,"aborted",void 0),(0,K.Z)(this,"touches",void 0),this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,r,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=CR(r),this.touches=k2(n,r)))}touchmove(e,r,n){if(this.aborted||!this.centroid)return;const a=k2(n,r);for(const u in this.touches)if(this.touches[u]){const y=this.touches[u],A=a[u];(!A||A.dist(y)>O3)&&(this.aborted=!0)}}touchend(e,r,n){if((!this.centroid||e.timeStamp-this.startTime>MR)&&(this.aborted=!0),n.length===0){const a=!this.aborted&&this.centroid;if(this.reset(),a)return a}}}class N2{constructor(e){(0,K.Z)(this,"singleTap",void 0),(0,K.Z)(this,"numTaps",void 0),(0,K.Z)(this,"lastTime",void 0),(0,K.Z)(this,"lastTap",void 0),(0,K.Z)(this,"count",void 0),this.singleTap=new PR(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,r,n){this.singleTap.touchstart(e,r,n)}touchmove(e,r,n){this.singleTap.touchmove(e,r,n)}touchend(e,r,n){const a=this.singleTap.touchend(e,r,n);if(a){const u=e.timeStamp-this.lastTime<D3,y=!this.lastTap||this.lastTap.dist(a)<O3;if((!u||!y)&&this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=a,this.count===this.numTaps)return this.reset(),a}}}class RR{constructor(){(0,K.Z)(this,"enabled",void 0),(0,K.Z)(this,"active",void 0),(0,K.Z)(this,"swipePoint",void 0),(0,K.Z)(this,"swipeTouch",void 0),(0,K.Z)(this,"tapTime",void 0),(0,K.Z)(this,"tap",void 0),this.tap=new N2({numTouches:1,numTaps:1}),this.reset()}reset(){this.active=!1,delete this.swipePoint,delete this.swipeTouch,delete this.tapTime,this.tap.reset()}touchstart(e,r,n){this.swipePoint||(this.tapTime&&e.timeStamp-this.tapTime>D3&&this.reset(),this.tapTime?n.length>0&&(this.swipePoint=r[0],this.swipeTouch=n[0].identifier):this.tap.touchstart(e,r,n))}touchmove(e,r,n){if(!this.tapTime)this.tap.touchmove(e,r,n);else if(this.swipePoint){if(n[0].identifier!==this.swipeTouch)return;const a=r[0],u=a.y-this.swipePoint.y;return this.swipePoint=a,e.preventDefault(),this.active=!0,{zoomDelta:u/128}}}touchend(e,r,n){this.tapTime?this.swipePoint&&n.length===0&&this.reset():this.tap.touchend(e,r,n)&&(this.tapTime=e.timeStamp)}touchcancel(){this.reset()}enable(){this.enabled=!0}disable(){this.enabled=!1,this.reset()}isEnabled(){return this.enabled}isActive(){return this.active}}class IR{constructor(){(0,K.Z)(this,"enabled",void 0),(0,K.Z)(this,"active",void 0),(0,K.Z)(this,"zoomIn",void 0),(0,K.Z)(this,"zoomOut",void 0),this.zoomIn=new N2({numTouches:1,numTaps:2}),this.zoomOut=new N2({numTouches:2,numTaps:1}),this.reset()}reset(){this.active=!1,this.zoomIn.reset(),this.zoomOut.reset()}touchstart(e,r,n){this.zoomIn.touchstart(e,r,n),this.zoomOut.touchstart(e,r,n)}touchmove(e,r,n){this.zoomIn.touchmove(e,r,n),this.zoomOut.touchmove(e,r,n)}touchend(e,r,n){const a=this.zoomIn.touchend(e,r,n),u=this.zoomOut.touchend(e,r,n);if(a)return this.active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:y=>y.easeTo({duration:300,zoom:y.getZoom()+1,around:y.unproject(a)},{originalEvent:e})};if(u)return this.active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:y=>y.easeTo({duration:300,zoom:y.getZoom()-1,around:y.unproject(u)},{originalEvent:e})}}touchcancel(){this.reset()}enable(){this.enabled=!0}disable(){this.enabled=!1,this.reset()}isEnabled(){return this.enabled}isActive(){return this.active}}class LR{constructor(e){(0,K.Z)(this,"enabled",void 0),(0,K.Z)(this,"active",void 0),(0,K.Z)(this,"touches",void 0),(0,K.Z)(this,"minTouches",void 0),(0,K.Z)(this,"clickTolerance",void 0),(0,K.Z)(this,"sum",void 0),this.minTouches=1,this.clickTolerance=e.clickTolerance||1,this.reset()}reset(){this.active=!1,this.touches={},this.sum=new Pl(0,0)}touchstart(e,r,n){return this.calculateTransform(e,r,n)}touchmove(e,r,n){if(this.active)return e.preventDefault(),this.calculateTransform(e,r,n)}touchend(e,r,n){this.calculateTransform(e,r,n),this.active&&n.length<this.minTouches&&this.reset()}touchcancel(){this.reset()}enable(){this.enabled=!0}disable(){this.enabled=!1,this.reset()}isEnabled(){return this.enabled}isActive(){return this.active}calculateTransform(e,r,n){n.length>0&&(this.active=!0);const a=k2(n,r),u=new Pl(0,0),y=new Pl(0,0);let A=0;for(const Y in a)if(a[Y]){const Q=a[Y],ae=this.touches[Y];ae&&(u._add(Q),y._add(Q.sub(ae)),A++,a[Y]=Q)}if(this.touches=a,A<this.minTouches||!y.mag())return;const O=y.div(A);return this.sum._add(O),this.sum.mag()<this.clickTolerance?void 0:{around:u.div(A),panDelta:O}}}class z2{constructor(){(0,K.Z)(this,"enabled",void 0),(0,K.Z)(this,"active",void 0),(0,K.Z)(this,"firstTwoTouches",void 0),(0,K.Z)(this,"vector",void 0),(0,K.Z)(this,"startVector",void 0),(0,K.Z)(this,"aroundCenter",void 0),this.reset()}reset(){this.active=!1,delete this.firstTwoTouches}start(e){}move(e,r,n){}touchstart(e,r,n){this.firstTwoTouches||n.length<2||(this.firstTwoTouches=[n[0].identifier,n[1].identifier],this.start([r[0],r[1]]))}touchmove(e,r,n){if(!this.firstTwoTouches)return;e.preventDefault();const[a,u]=this.firstTwoTouches,y=P1(n,r,a),A=P1(n,r,u);if(!y||!A)return;const O=this.aroundCenter?null:y.add(A).div(2);return this.move([y,A],O,e)}touchend(e,r,n){if(!this.firstTwoTouches)return;const[a,u]=this.firstTwoTouches,y=P1(n,r,a),A=P1(n,r,u);y&&A||(this.active&&od.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this.enabled=!0,this.aroundCenter=!!e&&e.around==="center"}disable(){this.enabled=!1,this.reset()}isEnabled(){return this.enabled}isActive(){return this.active}}function P1(t,e,r){for(let n=0;n<t.length;n++)if(t[n].identifier===r)return e[n]}function U2(t){return Math.abs(t.y)>Math.abs(t.x)}const DR=100;class OR extends z2{constructor(...e){super(...e),(0,K.Z)(this,"valid",void 0),(0,K.Z)(this,"firstMove",void 0),(0,K.Z)(this,"lastPoints",void 0)}reset(){super.reset(),this.valid=void 0,delete this.firstMove,delete this.lastPoints}start(e){this.lastPoints=e,U2(e[0].sub(e[1]))&&(this.valid=!1)}move(e,r,n){const a=e[0].sub(this.lastPoints[0]),u=e[1].sub(this.lastPoints[1]);return this.valid=this.gestureBeginsVertically(a,u,n.timeStamp),this.valid?(this.lastPoints=e,this.active=!0,{pitchDelta:(a.y+u.y)/2*-.5}):void 0}gestureBeginsVertically(e,r,n){if(this.valid!==void 0)return this.valid;const a=2,u=e.mag()>=a,y=r.mag()>=a;if(!u&&!y)return;if(!u||!y)return this.firstMove===void 0&&(this.firstMove=n),n-this.firstMove<DR?void 0:!1;const A=e.y>0==r.y>0;return U2(e)&&U2(r)&&A}}const BR=25;function B3(t,e){return t.angleWith(e)*180/Math.PI}class FR extends z2{constructor(...e){super(...e),(0,K.Z)(this,"minDiameter",void 0)}reset(){super.reset(),delete this.minDiameter,delete this.startVector,delete this.vector}start(e){this.startVector=this.vector=e[0].sub(e[1]),this.minDiameter=e[0].dist(e[1])}move(e,r){const n=this.vector;if(this.vector=e[0].sub(e[1]),!(!this.active&&this.isBelowThreshold(this.vector)))return this.active=!0,{bearingDelta:B3(this.vector,n),pinchAround:r}}isBelowThreshold(e){this.minDiameter=Math.min(this.minDiameter,e.mag());const r=Math.PI*this.minDiameter,n=BR/r*360,a=B3(e,this.startVector);return Math.abs(a)<n}}const kR=.1;function F3(t,e){return Math.log(t/e)/Math.LN2}class NR extends z2{constructor(...e){super(...e),(0,K.Z)(this,"distance",void 0),(0,K.Z)(this,"startDistance",void 0)}reset(){super.reset(),delete this.distance,delete this.startDistance}start(e){this.startDistance=this.distance=e[0].dist(e[1])}move(e,r){const n=this.distance;if(this.distance=e[0].dist(e[1]),!(!this.active&&Math.abs(F3(this.distance,this.startDistance))<kR))return this.active=!0,{zoomDelta:F3(this.distance,n),pinchAround:r}}}const{merge:Z2}=es,R1=t=>t.zoom||t.drag||t.pitch||t.rotate;function V2(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}class zR{constructor(e,r){(0,K.Z)(this,"map",void 0),(0,K.Z)(this,"el",void 0),(0,K.Z)(this,"handlers",void 0),(0,K.Z)(this,"eventsInProgress",void 0),(0,K.Z)(this,"frameId",void 0),(0,K.Z)(this,"inertia",void 0),(0,K.Z)(this,"bearingSnap",void 0),(0,K.Z)(this,"handlersById",void 0),(0,K.Z)(this,"updatingCamera",void 0),(0,K.Z)(this,"changes",void 0),(0,K.Z)(this,"previousActiveHandlers",void 0),(0,K.Z)(this,"bearingChanged",void 0),(0,K.Z)(this,"rotateEnabled",void 0),(0,K.Z)(this,"pitchEnabled",void 0),(0,K.Z)(this,"listeners",void 0),(0,K.Z)(this,"handleWindowEvent",a=>{this.handleEvent(a,`${a.type}Window`)}),(0,K.Z)(this,"handleEvent",(a,u)=>{if(a.type==="blur"){this.stop();return}this.updatingCamera=!0;const y=a.type==="renderFrame"?void 0:a,A={needsRenderFrame:!1},O={},Z={},Y=a.touches?this.getMapTouches(a.touches):void 0,Q=Y?od.touchPos(this.el,Y):od.mousePos(this.el,a);for(const{handlerName:Be,handler:it,allowed:gt}of this.handlers){if(!it.isEnabled())continue;let Bt;if(this.blockedByActive(Z,gt,Be))it.reset();else{const Rt=u||a.type;it&&it[Rt]&&(Bt=it[Rt](a,Q,Y),this.mergeIHandlerResult(A,O,Bt,Be,y),Bt&&Bt.needsRenderFrame&&this.triggerRenderFrame())}(Bt||it.isActive())&&(Z[Be]=it)}const ae={};for(const Be in this.previousActiveHandlers)Z[Be]||(ae[Be]=y);this.previousActiveHandlers=Z,(Object.keys(ae).length||V2(A))&&(this.changes.push([A,O,ae]),this.triggerRenderFrame()),(Object.keys(Z).length||V2(A))&&this.map.stop(!0),this.updatingCamera=!1;const{cameraAnimation:xe}=A;xe&&(this.inertia.clear(),this.fireEvents({},{}),this.changes=[],xe(this.map))}),this.map=e,this.el=this.map.getCanvasContainer(),this.handlers=[],this.handlersById={},this.changes=[],this.inertia=new sR(e),this.bearingSnap=r.bearingSnap,this.rotateEnabled=r.rotateEnabled,this.pitchEnabled=r.pitchEnabled,this.previousActiveHandlers={},this.eventsInProgress={},this.addDefaultHandlers(r);const n=this.el;this.listeners=[],this.listeners=[[n,"touchstart",{passive:!1}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[window.document,"mousemove",{capture:!0}],[window.document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[window,"blur",void 0]];for(const[a,u,y]of this.listeners)od.addEventListener(a,u,a===window.document?this.handleWindowEvent:this.handleEvent,y)}destroy(){for(const[e,r,n]of this.listeners)od.removeEventListener(e,r,e===window.document?this.handleWindowEvent:this.handleEvent,n)}stop(){if(!this.updatingCamera){for(const{handler:e}of this.handlers)e.reset();this.inertia.clear(),this.fireEvents({},{}),this.changes=[]}}isActive(){for(const{handler:e}of this.handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this.eventsInProgress.zoom||this.map.scrollZoom.isZooming()}isRotating(){return!!this.eventsInProgress.rotate}isMoving(){return!!R1(this.eventsInProgress)||this.isZooming()}mergeIHandlerResult(e,r,n,a,u){if(!n)return;Z2(e,n);const y={handlerName:a,originalEvent:n.originalEvent||u};n.zoomDelta!==void 0&&(r.zoom=y),n.panDelta!==void 0&&(r.drag=y),n.pitchDelta!==void 0&&(r.pitch=y),n.bearingDelta!==void 0&&(r.rotate=y)}triggerRenderFrame(){this.frameId===void 0&&(this.frameId=this.map.requestRenderFrame(e=>{delete this.frameId,this.handleEvent(new rR("renderFrame",e)),this.applyChanges()}))}addDefaultHandlers(e){const r=this.map,n=r.getCanvasContainer();this.add("mapEvent",new pR(r,e));const a=r.boxZoom=new eR(r,e);this.add("boxZoom",a);const u=new IR,y=new tR;r.doubleClickZoom=new wR(y,u),this.add("tapZoom",u),this.add("clickZoom",y);const A=new RR;this.add("tapDragZoom",A);const O=r.touchPitch=new OR;this.add("touchPitch",O);const Z=new gR(e),Y=new vR(e);r.dragRotate=new TR(e,Z,Y),this.add("mouseRotate",Z,["mousePitch"]),this.add("mousePitch",Y,["mouseRotate"]);const Q=new mR(e),ae=new LR(e);r.dragPan=new SR(n,Q,ae),this.add("mousePan",Q),this.add("touchPan",ae,["touchZoom","touchRotate"]);const xe=new FR,Be=new NR;r.touchZoomRotate=new AR(n,Be,xe,A),this.add("touchRotate",xe,["touchPan","touchZoom"]),this.add("touchZoom",Be,["touchPan","touchRotate"]);const it=r.scrollZoom=new ER(r,this);this.add("scrollZoom",it,["mousePan"]);const gt=r.keyboard=new hR;this.add("keyboard",gt),this.add("blockableMapEvent",new JP(r));for(const Bt of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])e.interactive&&e[Bt]&&r[Bt].enable(e[Bt])}add(e,r,n){this.handlers.push({handlerName:e,handler:r,allowed:n}),this.handlersById[e]=r}blockedByActive(e,r,n){for(const a in e)if(a!==n&&(!r||r.indexOf(a)<0))return!0;return!1}getMapTouches(e){const r=[];for(const n of e){const a=n.target;this.el.contains(a)&&r.push(n)}return r}applyChanges(){const e={},r={},n={};for(const[a,u,y]of this.changes)a.panDelta&&(e.panDelta=(e.panDelta||new Pl(0,0))._add(a.panDelta)),a.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+a.zoomDelta),a.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+a.bearingDelta),a.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+a.pitchDelta),a.around!==void 0&&(e.around=a.around),a.pinchAround!==void 0&&(e.pinchAround=a.pinchAround),a.noInertia&&(e.noInertia=a.noInertia),Z2(r,u),Z2(n,y);this.updateMapTransform(e,r,n),this.changes=[]}updateMapTransform(e,r,n){const a=this.map,u=a.transform;if(!V2(e))return this.fireEvents(r,n);const{panDelta:y,zoomDelta:A,bearingDelta:O,pitchDelta:Z,pinchAround:Y}=e;let{around:Q}=e;Y!==void 0&&(Q=Y),a.stop(!0),Q=Q||a.transform.centerPoint;const ae=u.pointLocation(y?Q.sub(y):Q);O&&this.rotateEnabled&&(u.bearing+=O),Z&&this.pitchEnabled&&(u.pitch+=Z),A&&(u.zoom+=A),u.setLocationAtPoint(ae,Q),this.map.update(),e.noInertia||this.inertia.record(e),this.fireEvents(r,n)}fireEvents(e,r){const n=R1(this.eventsInProgress),a=R1(e),u={};for(const Z in e)if(e[Z]){const{originalEvent:Y}=e[Z];this.eventsInProgress[Z]||(u[`${Z}start`]=Y),this.eventsInProgress[Z]=e[Z]}!n&&a&&this.fireEvent("movestart",a.originalEvent);for(const Z in u)u[Z]&&this.fireEvent(Z,u[Z]);e.rotate&&(this.bearingChanged=!0),a&&this.fireEvent("move",a.originalEvent);for(const Z in e)if(e[Z]){const{originalEvent:Y}=e[Z];this.fireEvent(Z,Y)}const y={};let A;for(const Z in this.eventsInProgress)if(this.eventsInProgress[Z]){const{handlerName:Y,originalEvent:Q}=this.eventsInProgress[Z];this.handlersById[Y].isActive()||(delete this.eventsInProgress[Z],A=r[Y]||Q,y[`${Z}end`]=A)}for(const Z in y)y[Z]&&this.fireEvent(Z,y[Z]);const O=R1(this.eventsInProgress);if((n||a)&&!O){this.updatingCamera=!0;const Z=this.inertia.onMoveEnd(this.map.dragPan.inertiaOptions),Y=Q=>Q!==0&&-this.bearingSnap<Q&&Q<this.bearingSnap;Z?(Y(Z.bearing||this.map.getBearing())&&(Z.bearing=0),this.map.easeTo(Z,{originalEvent:A})):(this.map.emit("moveend",new Yu("moveend",{originalEvent:A})),Y(this.map.getBearing())&&this.map.resetNorth()),this.bearingChanged=!1,this.updatingCamera=!1}}fireEvent(e,r){this.map.emit(e,new Yu(e,r?{originalEvent:r}:{}))}}var k3=zR;let I1=null,v_=[];const j2=1e3/30,z0=window.performance,U0={create:"create",load:"load",fullLoad:"fullLoad"},L1={mark(t){z0.mark(t)},frame(t){const e=t;if(I1!=null){const r=e-I1;v_.push(r)}I1=e},clearMetrics(){I1=null,v_=[],z0.clearMeasures("loadTime"),z0.clearMeasures("fullLoadTime");for(const t in U0)z0.clearMarks(U0[t])},getPerformanceMetrics(){const t=z0.measure("loadTime",U0.create,U0.load).duration,e=z0.measure("fullLoadTime",U0.create,U0.fullLoad).duration,r=v_.length,a=1/(v_.reduce((A,O)=>A+O,0)/r/1e3),u=v_.filter(A=>A>j2).reduce((A,O)=>A+(O-j2)/j2,0),y=u/(r+u)*100;return{loadTime:t,fullLoadTime:e,fps:a,percentDroppedFrames:y}}};class UR{constructor(){(0,K.Z)(this,"queue",void 0),(0,K.Z)(this,"id",void 0),(0,K.Z)(this,"cleared",void 0),(0,K.Z)(this,"currentlyRunning",void 0),this.queue=[],this.id=0,this.cleared=!1,this.currentlyRunning=!1}add(e){const r=++this.id;return this.queue.push({callback:e,id:r,cancelled:!1}),r}remove(e){const r=this.currentlyRunning,n=r?this.queue.concat(r):this.queue;for(const a of n)if(a.id===e){a.cancelled=!0;return}}run(e=0){const r=this.currentlyRunning=this.queue;this.queue=[];for(const n of r)if(!n.cancelled&&(n.callback(e),this.cleared))break;this.cleared=!1,this.currentlyRunning=!1}clear(){this.currentlyRunning&&(this.cleared=!0),this.queue=[]}}var N3=UR;function ZR(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}ZR(`.l7-map {
font:
12px/20px 'Helvetica Neue',
Arial,
Helvetica,
sans-serif;
overflow: hidden;
position: relative;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.l7-canvas {
position: absolute;
left: 0;
top: 0;
}
.l7-map:-webkit-full-screen {
width: 100%;
height: 100%;
}
.l7-canary {
background-color: salmon;
}
.l7-canvas-container.l7-interactive,
.l7-ctrl-group button.l7-ctrl-compass {
cursor: grab;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.l7-canvas-container.l7-interactive.l7-track-pointer {
cursor: pointer;
}
.l7-canvas-container.l7-interactive:active,
.l7-ctrl-group button.l7-ctrl-compass:active {
cursor: grabbing;
}
.l7-canvas-container.l7-touch-zoom-rotate,
.l7-canvas-container.l7-touch-zoom-rotate .l7-canvas {
touch-action: pan-x pan-y;
}
.l7-canvas-container.l7-touch-drag-pan,
.l7-canvas-container.l7-touch-drag-pan .l7-canvas {
touch-action: pinch-zoom;
}
.l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan,
.l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan .l7-canvas {
touch-action: none;
}
.l7-ctrl-top-left,
.l7-ctrl-top-right,
.l7-ctrl-bottom-left,
.l7-ctrl-bottom-right {
position: absolute;
pointer-events: none;
z-index: 2;
}
.l7-ctrl-top-left {
top: 0;
left: 0;
}
.l7-ctrl-top-right {
top: 0;
right: 0;
}
.l7-ctrl-bottom-left {
bottom: 0;
left: 0;
}
.l7-ctrl-bottom-right {
right: 0;
bottom: 0;
}
.l7-ctrl {
clear: both;
pointer-events: auto;
/* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
.l7-ctrl-top-left .l7-ctrl {
margin: 10px 0 0 10px;
float: left;
}
.l7-ctrl-top-right .l7-ctrl {
margin: 10px 10px 0 0;
float: right;
}
.l7-ctrl-bottom-left .l7-ctrl {
margin: 0 0 10px 10px;
float: left;
}
.l7-ctrl-bottom-right .l7-ctrl {
margin: 0 10px 10px 0;
float: right;
}
.l7-crosshair,
.l7-crosshair .l7-interactive,
.l7-crosshair .l7-interactive:active {
cursor: crosshair;
}
.l7-boxzoom {
position: absolute;
top: 0;
left: 0;
width: 0;
height: 0;
background: #fff;
border: 2px dotted #202020;
opacity: 0.5;
z-index: 10;
}
`);const D1=-2,z3=22,{merge:VR}=es,Z0=0,O1=60,jR={hash:!1,zoom:-1,center:[112,32],pitch:0,bearing:0,interactive:!0,minZoom:D1,maxZoom:z3,minPitch:Z0,maxPitch:O1,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,trackResize:!0,renderWorldCopies:!0,pitchEnabled:!0,rotateEnabled:!0};class HR extends P3{constructor(e){super(VR({},jR,e)),(0,K.Z)(this,"doubleClickZoom",void 0),(0,K.Z)(this,"dragRotate",void 0),(0,K.Z)(this,"dragPan",void 0),(0,K.Z)(this,"touchZoomRotate",void 0),(0,K.Z)(this,"scrollZoom",void 0),(0,K.Z)(this,"keyboard",void 0),(0,K.Z)(this,"touchPitch",void 0),(0,K.Z)(this,"boxZoom",void 0),(0,K.Z)(this,"handlers",void 0),(0,K.Z)(this,"container",void 0),(0,K.Z)(this,"canvas",void 0),(0,K.Z)(this,"canvasContainer",void 0),(0,K.Z)(this,"renderTaskQueue",new N3),(0,K.Z)(this,"frame",void 0),(0,K.Z)(this,"trackResize",!0),(0,K.Z)(this,"onWindowOnline",()=>{this.update()}),(0,K.Z)(this,"onWindowResize",r=>{this.trackResize&&this.resize({originalEvent:r}).update()}),this.initContainer(),this.resize(),this.handlers=new k3(this,this.options),typeof window!="undefined"&&(window.addEventListener("online",this.onWindowOnline,!1),window.addEventListener("resize",this.onWindowResize,!1),window.addEventListener("orientationchange",this.onWindowResize,!1))}resize(e){const r=this.containerDimensions(),n=r[0],a=r[1];this.transform.resize(n,a);const u=!this.moving;return u&&(this.stop(),this.emit("movestart",new Event("movestart",e)),this.emit("move",new Event("move",e))),this.emit("resize",new Event("resize",e)),u&&this.emit("moveend",new Event("moveend",e)),this}getContainer(){return this.container}getCanvas(){return this.canvas}getCanvasContainer(){return this.canvasContainer}project(e){return this.transform.locationPoint(qu.convert(e))}unproject(e){return this.transform.pointLocation(Pl.convert(e))}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(e){this.transform.setMaxBounds(tg.convert(e))}setStyle(e){}setMinZoom(e){if(e=e==null?D1:e,e>=D1&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this.getZoom()<e&&this.setZoom(e),this;throw new Error(`minZoom must be between ${D1} and the current maxZoom, inclusive`)}getMinZoom(){return this.transform.minZoom}setMaxZoom(e){if(e=e==null?z3:e,e>=this.transform.minZoom)return this.transform.maxZoom=e,this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if(e=e==null?Z0:e,e<Z0)throw new Error(`minPitch must be greater than or equal to ${Z0}`);if(e>=Z0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this.getPitch()<e&&this.setPitch(e),this;throw new Error(`minPitch must be between ${Z0} and the current maxPitch, inclusive`)}getMinPitch(){return this.transform.minPitch}setMaxPitch(e){if(e=e==null?O1:e,e>O1)throw new Error(`maxPitch must be less than or equal to ${O1}`);if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){this.transform.renderWorldCopies=!!e}remove(){this.frame&&(this.frame.cancel(),this.frame=null),this.renderTaskQueue.clear(),this.handlers.destroy(),typeof window!="undefined"&&(window.removeEventListener("online",this.onWindowOnline,!1),window.removeEventListener("resize",this.onWindowResize,!1),window.removeEventListener("orientationchange",this.onWindowResize,!1))}requestRenderFrame(e){return this.update(),this.renderTaskQueue.add(e)}cancelRenderFrame(e){return this.renderTaskQueue.remove(e)}triggerRepaint(){this.frame||(this.frame=x1(e=>{L1.frame(e),this.frame=null,this.update(e)}))}update(e){this.frame||(this.frame=x1(r=>{L1.frame(r),this.frame=null,this.renderTaskQueue.run(e)}))}initContainer(){if(typeof this.options.container=="string"){if(this.container=window.document.getElementById(this.options.container),!this.container)throw new Error(`Container '${this.options.container}' not found.`)}else if(this.options.container instanceof HTMLElement)this.container=this.options.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");const e=this.container;e.classList.add("l7-map");const r=this.canvasContainer=Xo("div","l7-canvas-container",e);this.options.interactive&&r.classList.add("l7-interactive")}containerDimensions(){let e=0,r=0;return this.container&&(e=this.container.clientWidth||400,r=this.container.clientHeight||300),[e,r]}resizeCanvas(e,r){const n=Ll||1;this.canvas.width=n*e,this.canvas.height=n*r,this.canvas.style.width=`${e}px`,this.canvas.style.height=`${r}px`}}const{throttle:GR}=es;class WR{constructor(e){(0,K.Z)(this,"map",void 0),(0,K.Z)(this,"updateHash",void 0),(0,K.Z)(this,"hashName",void 0),(0,K.Z)(this,"onHashChange",()=>{const r=this.getCurrentHash();if(r.length>=3&&!r.some(n=>isNaN(+n))){const n=this.map.dragRotate.isEnabled()&&this.map.touchZoomRotate.isEnabled()?+(r[3]||0):this.map.getBearing();return this.map.jumpTo({center:[+r[2],+r[1]],zoom:+r[0],bearing:n,pitch:+(r[4]||0)}),!0}return!1}),(0,K.Z)(this,"getCurrentHash",()=>{const r=window.location.hash.replace("#","");if(this.hashName){let n;return r.split("&").map(a=>a.split("=")).forEach(a=>{a[0]===this.hashName&&(n=a)}),(n&&n[1]||"").split("/")}return r.split("/")}),(0,K.Z)(this,"updateHashUnthrottled",()=>{const r=this.getHashString();try{window.history.replaceState(window.history.state,"",r)}catch(n){}}),this.hashName=e&&encodeURIComponent(e),this.updateHash=GR(this.updateHashUnthrottled,30*1e3/100)}addTo(e){return this.map=e,window.addEventListener("hashchange",this.onHashChange,!1),this.map.on("moveend",this.updateHash),this}remove(){return window.removeEventListener("hashchange",this.onHashChange,!1),this.map.off("moveend",this.updateHash),delete this.map,this}getHashString(e){const r=this.map.getCenter(),n=Math.round(this.map.getZoom()*100)/100,a=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),u=Math.pow(10,a),y=Math.round(r.lng*u)/u,A=Math.round(r.lat*u)/u,O=this.map.getBearing(),Z=this.map.getPitch();let Y="";if(e?Y+=`/${y}/${A}/${n}`:Y+=`${n}/${A}/${y}`,(O||Z)&&(Y+=`/${Math.round(O*10)/10}`),Z&&(Y+=`/${Math.round(Z)}`),this.hashName){const Q=this.hashName;let ae=!1;const xe=window.location.hash.slice(1).split("&").map(Be=>{const it=Be.split("=")[0];return it===Q?(ae=!0,`${it}=${Y}`):Be}).filter(Be=>Be);return ae||xe.push(`${Q}=${Y}`),`#${xe.join("&")}`}return`#${Y}`}}var XR=WR;function qR(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}qR(`.l7-map {
font:
12px/20px 'Helvetica Neue',
Arial,
Helvetica,
sans-serif;
overflow: hidden;
position: relative;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.l7-canvas {
position: absolute;
left: 0;
top: 0;
}
.l7-map:-webkit-full-screen {
width: 100%;
height: 100%;
}
.l7-canary {
background-color: salmon;
}
.l7-canvas-container.l7-interactive,
.l7-ctrl-group button.l7-ctrl-compass {
cursor: grab;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.l7-canvas-container.l7-interactive.l7-track-pointer {
cursor: pointer;
}
.l7-canvas-container.l7-interactive:active,
.l7-ctrl-group button.l7-ctrl-compass:active {
cursor: grabbing;
}
.l7-canvas-container.l7-touch-zoom-rotate,
.l7-canvas-container.l7-touch-zoom-rotate .l7-canvas {
touch-action: pan-x pan-y;
}
.l7-canvas-container.l7-touch-drag-pan,
.l7-canvas-container.l7-touch-drag-pan .l7-canvas {
touch-action: pinch-zoom;
}
.l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan,
.l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan .l7-canvas {
touch-action: none;
}
.l7-ctrl-top-left,
.l7-ctrl-top-right,
.l7-ctrl-bottom-left,
.l7-ctrl-bottom-right {
position: absolute;
pointer-events: none;
z-index: 2;
}
.l7-ctrl-top-left {
top: 0;
left: 0;
}
.l7-ctrl-top-right {
top: 0;
right: 0;
}
.l7-ctrl-bottom-left {
bottom: 0;
left: 0;
}
.l7-ctrl-bottom-right {
right: 0;
bottom: 0;
}
.l7-ctrl {
clear: both;
pointer-events: auto;
/* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
.l7-ctrl-top-left .l7-ctrl {
margin: 10px 0 0 10px;
float: left;
}
.l7-ctrl-top-right .l7-ctrl {
margin: 10px 10px 0 0;
float: right;
}
.l7-ctrl-bottom-left .l7-ctrl {
margin: 0 0 10px 10px;
float: left;
}
.l7-ctrl-bottom-right .l7-ctrl {
margin: 0 10px 10px 0;
float: right;
}
.l7-crosshair,
.l7-crosshair .l7-interactive,
.l7-crosshair .l7-interactive:active {
cursor: crosshair;
}
.l7-boxzoom {
position: absolute;
top: 0;
left: 0;
width: 0;
height: 0;
background: #fff;
border: 2px dotted #202020;
opacity: 0.5;
z-index: 10;
}
`),function(){if(typeof window.CustomEvent=="function")return!1;function t(e,r){r=r||{bubbles:!1,cancelable:!1,detail:void 0};const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,r.bubbles,r.cancelable,r.detail),n}t.prototype=window.Event.prototype,window.CustomEvent=t}();const B1=-2,U3=22,{merge:Z3}=es,V0=0,F1=60,YR={hash:!1,zoom:-1,center:[112,32],pitch:0,bearing:0,interactive:!0,minZoom:B1,maxZoom:U3,minPitch:V0,maxPitch:F1,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,trackResize:!0,renderWorldCopies:!0,pitchEnabled:!0,rotateEnabled:!0};class $R extends P3{constructor(e){super(Z3({},YR,e)),(0,K.Z)(this,"doubleClickZoom",void 0),(0,K.Z)(this,"dragRotate",void 0),(0,K.Z)(this,"dragPan",void 0),(0,K.Z)(this,"touchZoomRotate",void 0),(0,K.Z)(this,"scrollZoom",void 0),(0,K.Z)(this,"keyboard",void 0),(0,K.Z)(this,"touchPitch",void 0),(0,K.Z)(this,"boxZoom",void 0),(0,K.Z)(this,"handlers",void 0),(0,K.Z)(this,"container",void 0),(0,K.Z)(this,"canvas",void 0),(0,K.Z)(this,"canvasContainer",void 0),(0,K.Z)(this,"renderTaskQueue",new N3),(0,K.Z)(this,"frame",void 0),(0,K.Z)(this,"trackResize",!0),(0,K.Z)(this,"hash",void 0),(0,K.Z)(this,"onWindowOnline",()=>{this.update()}),(0,K.Z)(this,"onWindowResize",n=>{this.trackResize&&this.resize({originalEvent:n}).update()}),this.initContainer(),this.resize(),this.handlers=new k3(this,this.options),typeof window!="undefined"&&(window.addEventListener("online",this.onWindowOnline,!1),window.addEventListener("resize",this.onWindowResize,!1),window.addEventListener("orientationchange",this.onWindowResize,!1));const r=typeof e.hash=="string"&&e.hash||void 0;e.hash&&(this.hash=new XR(r).addTo(this)),(!this.hash||!this.hash.onHashChange())&&(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,Z3({},e.fitBoundsOptions,{duration:0}))))}resize(e){const[r,n]=this.containerDimensions();this.transform.resize(r,n);const a=!this.moving;return a&&(this.stop(),this.emit("movestart",new window.CustomEvent("movestart",e)),this.emit("move",new window.CustomEvent("move",e))),this.emit("resize",new window.CustomEvent("resize",e)),a&&this.emit("moveend",new window.CustomEvent("moveend",e)),this}getContainer(){return this.container}getCanvas(){return this.canvas}getCanvasContainer(){return this.canvasContainer}getCanvasOverlays(){return this.getCanvasContainer()}project(e){return this.transform.locationPoint(qu.convert(e))}unproject(e){return this.transform.pointLocation(Pl.convert(e))}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(e){this.transform.setMaxBounds(tg.convert(e))}setStyle(e){}setMinZoom(e){if(e=e==null?B1:e,e>=B1&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this.getZoom()<e&&this.setZoom(e),this;throw new Error(`minZoom must be between ${B1} and the current maxZoom, inclusive`)}getMinZoom(){return this.transform.minZoom}setMaxZoom(e){if(e=e==null?U3:e,e>=this.transform.minZoom)return this.transform.maxZoom=e,this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if(e=e==null?V0:e,e<V0)throw new Error(`minPitch must be greater than or equal to ${V0}`);if(e>=V0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this.getPitch()<e&&this.setPitch(e),this;throw new Error(`minPitch must be between ${V0} and the current maxPitch, inclusive`)}getMinPitch(){return this.transform.minPitch}setMaxPitch(e){if(e=e==null?F1:e,e>F1)throw new Error(`maxPitch must be less than or equal to ${F1}`);if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){this.transform.renderWorldCopies=!!e}remove(){this.container.removeChild(this.canvasContainer),this.canvasContainer=null,this.frame&&(this.frame.cancel(),this.frame=null),this.renderTaskQueue.clear(),this.handlers.destroy(),typeof window!="undefined"&&(window.removeEventListener("online",this.onWindowOnline,!1),window.removeEventListener("resize",this.onWindowResize,!1),window.removeEventListener("orientationchange",this.onWindowResize,!1))}requestRenderFrame(e){return this.update(),this.renderTaskQueue.add(e)}cancelRenderFrame(e){return this.renderTaskQueue.remove(e)}triggerRepaint(){this.frame||(this.frame=x1(e=>{L1.frame(e),this.frame=null,this.update(e)}))}update(e){this.frame||(this.frame=x1(r=>{L1.frame(r),this.frame=null,this.renderTaskQueue.run(e)}))}initContainer(){if(typeof this.options.container=="string"){if(this.container=window.document.getElementById(this.options.container),!this.container)throw new Error(`Container '${this.options.container}' not found.`)}else if(this.options.container instanceof HTMLElement)this.container=this.options.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");const e=this.container;e.classList.add("l7-map");const r=this.canvasContainer=Xo("div","l7-canvas-container",e);this.options.interactive&&r.classList.add("l7-interactive")}containerDimensions(){let e=0,r=0;return this.container&&(e=this.container.clientWidth,r=this.container.clientHeight,e=e===0?400:e,r=r===0?300:r),[e,r]}}class KR{constructor(){(0,K.Z)(this,"xzReg",-Math.PI*.6),(0,K.Z)(this,"yReg",Math.PI*.2),(0,K.Z)(this,"earthCameraRadius",200),(0,K.Z)(this,"earthCameraZoom",1),(0,K.Z)(this,"cameraPosition",ra.create()),(0,K.Z)(this,"viewport",void 0),(0,K.Z)(this,"projectionMatrix",Kr.create()),(0,K.Z)(this,"modelMatrix",Kr.create()),(0,K.Z)(this,"viewMatrix",Kr.create()),(0,K.Z)(this,"viewProjectionMatrix",Kr.create()),(0,K.Z)(this,"ViewProjectionMatrixUncentered",Kr.create()),(0,K.Z)(this,"viewUncenteredMatrix",Kr.create())}syncWithMapCamera(e){const{viewportHeight:r=1,viewportWidth:n=1}=e,a=n/r,u=.1,y=1e4,A=20;Kr.perspective(this.projectionMatrix,A,a,u,y);const O=this.earthCameraRadius*Math.cos(this.xzReg),Z=this.earthCameraRadius*Math.sin(this.xzReg),Y=this.earthCameraRadius*Math.sin(this.yReg);this.cameraPosition=ra.fromValues(O,Y,Z),ra.normalize(this.cameraPosition,this.cameraPosition),ra.multiply(this.cameraPosition,this.cameraPosition,ra.fromValues(this.earthCameraRadius,this.earthCameraRadius,this.earthCameraRadius)),ra.scale(this.cameraPosition,this.cameraPosition,this.earthCameraZoom);const Q=ra.create();ra.cross(Q,this.cameraPosition,ra.fromValues(0,1,0));const ae=ra.fromValues(0,1,0);ra.cross(ae,Q,this.cameraPosition);const xe=ra.fromValues(0,0,0);Kr.lookAt(this.viewMatrix,this.cameraPosition,xe,ae),this.viewUncenteredMatrix=Kr.clone(this.viewMatrix),Kr.multiply(this.viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),Kr.multiply(this.ViewProjectionMatrixUncentered,this.projectionMatrix,this.viewMatrix)}rotateY(e){this.xzReg+=e*Math.min(this.earthCameraZoom*this.earthCameraZoom,1)}rotateX(e){this.yReg+=e*Math.min(this.earthCameraZoom*this.earthCameraZoom,1)}scaleZoom(e){this.earthCameraZoom+=e,this.earthCameraZoom=Math.max(this.earthCameraZoom,.6)}getZoom(){return 4}getZoomScale(){return Math.pow(2,this.getZoom())}getCenter(){return[0,0]}getProjectionMatrix(){return this.projectionMatrix}getModelMatrix(){return this.modelMatrix}getViewMatrix(){return this.viewMatrix}getViewMatrixUncentered(){return this.viewMatrix}getViewProjectionMatrix(){return this.viewProjectionMatrix}getViewProjectionMatrixUncentered(){return this.viewProjectionMatrix}getFocalDistance(){return 1}projectFlat(e,r){return this.viewport.projectFlat(e,r)}}const JR=["id","style","rotation"],V3={mapmove:"move",camerachange:"move",zoomchange:"zoom",dragging:"drag"},QR=12;class eI extends _g{constructor(...e){super(...e),(0,K.Z)(this,"version","GLOBEL"),(0,K.Z)(this,"dragging",!1),(0,K.Z)(this,"viewport",void 0),(0,K.Z)(this,"handleCameraChanging",void 0),(0,K.Z)(this,"handleCameraTimer",void 0),(0,K.Z)(this,"handleCameraChanged",r=>{this.emit("mapchange");const n=2e3;this.handleCameraChanging=!0,this.handleCameraTimer&&clearTimeout(this.handleCameraTimer),this.handleCameraTimer=setTimeout(()=>{this.handleCameraChanging=!1},n);const a=.02;r.type&&r.originalEvent&&(r.originalEvent.type==="wheel"&&this.viewport.scaleZoom(.01*Math.sign(r.originalEvent.wheelDelta)*-1),Math.abs(r.originalEvent.movementX)>Math.abs(r.originalEvent.movementY)?r.originalEvent.movementX>0?this.viewport.rotateY(a):r.originalEvent.movementX<0&&this.viewport.rotateY(-a):r.originalEvent.movementY>0?this.viewport.rotateX(a):r.originalEvent.movementY<0&&this.viewport.rotateX(-a));const{offsetCoordinate:u=!0}=this.config;this.viewport.syncWithMapCamera({viewportHeight:this.map.transform.height,viewportWidth:this.map.transform.width}),this.viewport.getZoom()>QR&&u?this.coordinateSystemService.setCoordinateSystem(Xt.LNGLAT_OFFSET):this.coordinateSystemService.setCoordinateSystem(Xt.LNGLAT),this.cameraChangedCallback(this.viewport)})}lngLatToMercator(e,r){throw new Error("Method not implemented.")}getModelMatrix(e,r,n,a,u){throw new Error("Method not implemented.")}on(e,r){po.indexOf(e)!==-1?this.eventEmitter.on(e,r):this.map.on(V3[e]||e,r)}off(e,r){this.map.off(V3[e]||e,r),this.eventEmitter.off(e,r)}getMapCanvasContainer(){return this.map.getCanvasContainer()}getSize(){const e=this.map.transform;return[e.width,e.height]}getType(){return"earth"}init(){var e=this;return(0,Nr.Z)(function*(){const r=e.config,{id:n="map",style:a="light",rotation:u=0}=r,y=(0,Ge.Z)(r,JR);e.viewport=new KR,e.$mapContainer=e.creatMapContainer(n),e.map=new HR((0,Wt.Z)({container:e.$mapContainer,style:e.getMapStyleValue(a),bearing:u},y)),e.map.on("load",e.handleCameraChanged),e.map.on("move",e.handleCameraChanged),e.handleCameraChanged({})})()}destroy(){var e;(e=this.$mapContainer)===null||e===void 0||(e=e.parentNode)===null||e===void 0||e.removeChild(this.$mapContainer),this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}emit(e,...r){this.eventEmitter.emit(e,...r)}once(e,...r){this.eventEmitter.once(e,...r)}getMapContainer(){return this.$mapContainer}getCanvasOverlays(){}onCameraChanged(e){this.cameraChangedCallback=e}rotateY(e){const{force:r=!1,reg:n=.01}=e||{};this.handleCameraChanging&&!r||this.viewport&&(this.viewport.rotateY(n),this.viewport.syncWithMapCamera({viewportHeight:this.map.transform.height,viewportWidth:this.map.transform.width}),this.cameraChangedCallback(this.viewport))}}class tI extends Nm{getServiceConstructor(){return eI}}if(!window)throw Error("Google Map JSAPI can only be used in Browser.");var jm=function(t){return t.notload="notload",t.loading="loading",t.loaded="loaded",t.failed="failed",t}(jm||{});const H2={key:""};let Eg={GMap:jm.notload};const G2=[],j3=t=>{if(typeof t=="function"){if(Eg.GMap===jm.loaded){t(window.google.maps.Map);return}G2.push(t)}};var rI={load:t=>new Promise((e,r)=>{if(Eg.GMap===jm.failed)r("");else if(Eg.GMap===jm.notload){const{key:n}=t;if(!n){r("\u8BF7\u586B\u5199key");return}H2.key=n,Eg.GMap=jm.loading,window.initMap=y=>{if(delete window.initMap,y)Eg.GMap=jm.failed,r(y);else for(Eg.GMap=jm.loaded;G2.length;)G2.splice(0,1)[0](window.google.maps.Map)};const a=document.createElement("script");a.type="text/javascript",a.async=!1,a.src=`https://maps.googleapis.com/maps/api/js?key=${H2.key}&callback=initMap`,a.onerror=y=>{Eg.GMap=jm.failed,r(y)},(document.body||document.head).appendChild(a),j3(e)}else if(Eg.GMap===jm.loaded){if(t.key&&t.key!==H2.key){r("\u591A\u4E2A\u4E0D\u4E00\u81F4\u7684 key");return}j3(e)}}),reset:()=>{delete window.google,Eg={GMap:jm.notload}}};const nI=["id","mapInstance","center","token","minZoom","maxZoom","logoVisible"];function iI(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}iI(`img[src*='//mapapi.qq.com/web/jsapi/logo/logo_def.png'],.logo-text
{
display: none !important;
}
`);const oI="AIzaSyDBDCfl4pvuDtaazdCog3LmhA7CQLhmcRE",j0={mapmove:"center_changed",camerachange:["drag","pan","rotate","tilt","zoom_changed"],zoomchange:"zoom_changed",dragging:"drag"};class aI extends _g{constructor(...e){super(...e),(0,K.Z)(this,"viewport",null),(0,K.Z)(this,"evtCbProxyMap",new Map),(0,K.Z)(this,"handleCameraChanged",()=>{this.emit("mapchange");const r=this.map,{lng:n,lat:a}=r.getCenter(),u={center:[n(),a()],viewportHeight:r.getDiv().clientHeight,viewportWidth:r.getDiv().clientWidth,bearing:r.getHeading(),pitch:r.getTilt(),zoom:r.getZoom()-1};this.viewport.syncWithMapCamera(u),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport)})}init(){var e=this;return(0,Nr.Z)(function*(){var r;e.viewport=new Fg;const n=e.config,{id:a,mapInstance:u,center:y=[121.30654632240122,31.25744185633306],token:A=oI,minZoom:O=3,maxZoom:Z=18,logoVisible:Y=!0}=n,Q=(0,Ge.Z)(n,nI);if((r=window.google)!==null&&r!==void 0&&(r=r.maps)!==null&&r!==void 0&&r.Map||u||(yield rI.load({key:A})),u)e.map=u,e.$mapContainer=e.map.getDiv(),Y===!1&&e.hideLogo();else{if(!a)throw Error("No container id specified");const ae=wc(a),xe=new google.maps.Map(ae,(0,Wt.Z)({maxZoom:Z,minZoom:O,zoomControl:!1,fullscreenControl:!1,center:new google.maps.LatLng(y[1],y[0])},Q));e.map=xe,e.$mapContainer=xe.getDiv(),Y===!1&&e.hideLogo()}google.maps.event.addListener(e.map,"drag",e.handleCameraChanged),google.maps.event.addListener(e.map,"pan",e.handleCameraChanged),google.maps.event.addListener(e.map,"rotate",e.handleCameraChanged),google.maps.event.addListener(e.map,"idle",e.handleCameraChanged),google.maps.event.addListener(e.map,"zoom_changed",e.handleCameraChanged),e.handleCameraChanged()})()}destroy(){this.map.setMap(null)}onCameraChanged(e){this.cameraChangedCallback=e}addMarkerContainer(){}getMarkerContainer(){return this.markerContainer}getCanvasOverlays(){return this.map.getDiv()}on(e,r){if(po.indexOf(e)!==-1)this.eventEmitter.on(e,r);else{const n=a=>{let u=this.evtCbProxyMap.get(a);if(u||this.evtCbProxyMap.set(a,u=new Map),u.get(r))return;const y=(...A)=>{A[0]&&typeof A[0]=="object"&&!A[0].lngLat&&!A[0].lnglat&&(A[0].lngLat=A[0].latlng||A[0].latLng),r(...A)};u.set(r,y),this.map.on(a,y)};Array.isArray(j0[e])?j0[e].forEach(a=>{n(a||e)}):n(j0[e]||e)}}off(e,r){if(po.indexOf(e)!==-1){this.eventEmitter.off(e,r);return}const n=a=>{var u,y;const A=(u=this.evtCbProxyMap.get(e))===null||u===void 0?void 0:u.get(r);A&&((y=this.evtCbProxyMap.get(a))===null||y===void 0||y.delete(r),this.map.off(a,A))};Array.isArray(j0[e])?j0[e].forEach(a=>{n(a||e)}):n(j0[e]||e)}once(){throw new Error("Method not implemented.")}getContainer(){return this.map.getDiv()}getSize(){return[this.map.width,this.map.height]}getMinZoom(){return this.map.transform._minZoom}getMaxZoom(){return this.map.transform._maxZoom}getType(){return"googlemap"}getZoom(){return this.map.getZoom()}getCenter(){const{lng:e,lat:r}=this.map.getCenter();return{lng:e(),lat:r()}}getPitch(){return this.map.getTilt()}getRotation(){return this.map.getHeading()}getBounds(){const e=this.map.getBounds(),r=e==null?void 0:e.getNorthEast(),n=e==null?void 0:e.getSouthWest();return[[n.lng(),n.lat()],[r.lng(),r.lat()]]}getMapContainer(){return this.map.getDiv()}getMapCanvasContainer(){var e;return(e=this.map.getDiv())===null||e===void 0?void 0:e.getElementsByTagName("canvas")[0]}getMapStyleConfig(){throw new Error("Method not implemented.")}setBgColor(e){this.bgColor=e}setMapStyle(e){this.map.setMapStyleId(e)}setRotation(e){this.map.setHeading(e)}zoomIn(){const e=this.map.getZoom();this.map.setZoom(e+1)}zoomOut(){const e=this.map.getZoom();this.map.setZoom(e-1)}panTo([e,r]){this.map.panTo({lat:r,lng:e})}panBy(e,r){this.map.panBy(e,r)}fitBounds(e,r){const[n,a]=e,u=new google.maps.LatLngBounds({lat:n[1],lng:n[0]},{lat:a[1],lng:a[0]});this.map.fitBounds(u,r)}setZoomAndCenter(e,[r,n]){this.map.setZoom(e),this.map.setCenter({lat:n,lng:r})}setCenter([e,r]){this.map.setCenter({lat:r,lng:e})}setPitch(e){this.map.setTilt(e)}setZoom(e){this.map.setZoom(e)}setMapStatus(e){Object.keys(e).map(r=>{switch(r){case"doubleClickZoom":this.map.setOptions({gestureHandling:e.doubleClickZoom?"auto":"none"});break;case"dragEnable":this.map.setOptions({draggable:e.dragEnable});break;case"rotateEnable":break;case"zoomEnable":this.map.setOptions({zoomControl:e.zoomEnable});break;case"keyboardEnable":case"resizeEnable":case"showIndoorMap":throw Error("Options may not be supported");default:}})}meterToCoord([e,r],[n,a]){const u=google.maps.geometry.spherical.computeDistanceBetween([new google.maps.LatLng(r,e),new google.maps.LatLng(a,n)]),[y,A]=this.lngLatToCoord([e,r]),[O,Z]=this.lngLatToCoord([n,a]);return Math.sqrt(Math.pow(y-O,2)+Math.pow(A-Z,2))/u}pixelToLngLat([e,r]){const{lng:n,lat:a}=this.map.getCenter(),{x:u,y}=this.lngLatToPixel([n(),a()]),{x:A,y:O}=this.lngLatToContainer([n(),a()]),{lng:Z,lat:Y}=this.map.unprojectFromContainer(new google.maps.Point(A+(e-u),O+(r-y)));return this.containerToLngLat([Z,Y])}lngLatToPixel([e,r]){const n=new google.maps.LatLng(r,e),a=this.map.getProjection().fromLatLngToPoint(n);return{x:a.x,y:a.y}}containerToLngLat([e,r]){var n;const a=new google.maps.Point(e,r),u=(n=this.map.getProjection())===null||n===void 0?void 0:n.fromPointToLatLng(a);return{lng:u.lng(),lat:u.lat()}}lngLatToContainer([e,r]){var n,a;const u=new google.maps.LatLng(r,e),y=(n=this.map.getProjection())===null||n===void 0||(a=n.fromLatLngToContainerPixel)===null||a===void 0?void 0:a.call(n,u);return{x:y.x,y:y.y}}lngLatToCoord([e,r]){const{x:n,y:a}=this.lngLatToPixel([e,r]);return[n,-a]}lngLatToCoords(e){return e.map(r=>Array.isArray(r[0])?this.lngLatToCoords(r):this.lngLatToCoord(r))}lngLatToMercator(e,r){const{x:n=0,y:a=0,z:u=0}=Vm.fromLngLat(e,r);return{x:n,y:a,z:u}}getModelMatrix(e,r,n,a=[1,1,1]){const u=this.viewport.projectFlat(e),y=Kr.create();return Kr.translate(y,y,ra.fromValues(u[0],u[1],r)),Kr.scale(y,y,ra.fromValues(a[0],a[1],a[2])),Kr.rotateX(y,y,n[0]),Kr.rotateY(y,y,n[1]),Kr.rotateZ(y,y,n[2]),y}getCustomCoordCenter(){throw new Error("Method not implemented.")}exportMap(e){const r=this.getMapCanvasContainer();return e==="jpg"?r==null?void 0:r.toDataURL("image/jpeg"):r==null?void 0:r.toDataURL("image/png")}rotateY(){throw new Error("Method not implemented.")}hideLogo(){const e=this.map.getDiv();e&&dl(e,"tmap-contianer--hide-logo")}}class sI extends Nm{getServiceConstructor(){return aI}}const lI=["id","style","rotation","mapInstance","version","mapSize","interactive"];class uI extends _g{constructor(...e){super(...e),(0,K.Z)(this,"version",rp.DEFAULT),(0,K.Z)(this,"viewport",void 0)}lngLatToCoord(e,r={x:0,y:0,z:0}){const{x:n,y:a}=this.lngLatToMercator(e,0);return[n-r.x,a-r.y]}lngLatToMercator(e,r){const{x:n=0,y:a=0,z:u=0}=Vm.fromLngLat(e,r);return{x:n,y:a,z:u}}getModelMatrix(e,r,n,a=[1,1,1],u={x:0,y:0,z:0}){const y=Vm.fromLngLat(e,r),A=y.meterInMercatorCoordinateUnits(),O=Kr.create();return Kr.translate(O,O,ra.fromValues(y.x-u.x,y.y-u.y,y.z||0-u.z)),Kr.scale(O,O,ra.fromValues(A*a[0],-A*a[1],A*a[2])),Kr.rotateX(O,O,n[0]),Kr.rotateY(O,O,n[1]),Kr.rotateZ(O,O,n[2]),O}init(){var e=this;return(0,Nr.Z)(function*(){const r=e.config,{id:n="map",style:a="light",rotation:u=0,mapInstance:y,version:A="DEFAULTMAP",mapSize:O=1e4,interactive:Z=!0}=r,Y=(0,Ge.Z)(r,lI);e.viewport=new Fg,e.version=A,e.simpleMapCoord.setSize(O),A==="SIMPLE"&&Y.center&&(Y.center=e.simpleMapCoord.unproject(Y.center)),y?(e.map=y,e.$mapContainer=e.map.getContainer()):(e.$mapContainer=e.creatMapContainer(n),e.map=new $R((0,Wt.Z)({container:e.$mapContainer,style:e.getMapStyleValue(a),bearing:u},Y))),e.map.on("load",()=>{e.handleCameraChanged()}),Z&&e.map.on("move",e.handleCameraChanged),setTimeout(()=>{e.handleCameraChanged()},100),e.handleCameraChanged()})()}exportMap(e){const r=this.map.getCanvas();return e==="jpg"?r==null?void 0:r.toDataURL("image/jpeg"):r==null?void 0:r.toDataURL("image/png")}getCanvasOverlays(){return this.getContainer()}}class cI extends Nm{getServiceConstructor(){return uI}}var hI=Se(86463),__=Se.n(hI);class H3{constructor(){(0,K.Z)(this,"viewport",void 0)}syncWithMapCamera(e){const{center:r,zoom:n,pitch:a,bearing:u,viewportHeight:y,viewportWidth:A}=e;this.viewport=new w2({width:A,height:y,longitude:r&&r[0],latitude:r&&r[1],zoom:n,pitch:a,bearing:u})}getZoom(){return this.viewport.zoom}getZoomScale(){return Math.pow(2,this.getZoom())}getCenter(){return[this.viewport.longitude,this.viewport.latitude]}getProjectionMatrix(){return this.viewport.projectionMatrix}getModelMatrix(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}getViewMatrix(){return this.viewport.viewMatrix}getViewMatrixUncentered(){return this.viewport.viewMatrixUncentered}getViewProjectionMatrix(){return this.viewport.viewProjectionMatrix}getViewProjectionMatrixUncentered(){return this.viewport.viewProjectionMatrix}getFocalDistance(){return 1}projectFlat(e,r){return this.viewport.projectFlat(e,r)}}const pI=["id","attributionControl","style","token","rotation","mapInstance"];function fI(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}fI(`.mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mapboxgl-canvas{position:absolute;left:0;top:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;-webkit-transform:translate(0);transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:"";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);transform:scale(3);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}`),window.mapboxgl=__();let dI=0;const G3="101MlGsZ2AmmA&access_token=pk.eyJ1IjoiZXhhbXBsZXMiLCJhIjoiY2p0MG01MXRqMW45cjQzb2R6b2ptc3J4MSJ9.zA2W0IkI0c6KaAhJfk9bWg";class mI extends _g{constructor(...e){super(...e),(0,K.Z)(this,"version","MAPBOX"),(0,K.Z)(this,"viewport",void 0)}getType(){return"mapbox"}lngLatToCoord(e,r={x:0,y:0,z:0}){const{x:n,y:a}=this.lngLatToMercator(e,0);return[n-r.x,a-r.y]}lngLatToMercator(e,r){const{x:n=0,y:a=0,z:u=0}=window.mapboxgl.MercatorCoordinate.fromLngLat(e,r);return{x:n,y:a,z:u}}getModelMatrix(e,r,n,a=[1,1,1],u={x:0,y:0,z:0}){const y=window.mapboxgl.MercatorCoordinate.fromLngLat(e,r),A=y.meterInMercatorCoordinateUnits(),O=Kr.create();return Kr.translate(O,O,ra.fromValues(y.x-u.x,y.y-u.y,y.z||0-u.z)),Kr.scale(O,O,ra.fromValues(A*a[0],-A*a[1],A*a[2])),Kr.rotateX(O,O,n[0]),Kr.rotateY(O,O,n[1]),Kr.rotateZ(O,O,n[2]),O}init(){var e=this;return(0,Nr.Z)(function*(){const r=e.config,{id:n="map",attributionControl:a=!1,style:u="light",token:y=G3,rotation:A=0,mapInstance:O}=r,Z=(0,Ge.Z)(r,pI);e.viewport=new H3,!O&&!window.mapboxgl&&console.error(e.configService.getSceneWarninfo("SDK")),y===G3&&u!=="blank"&&!window.mapboxgl.accessToken&&!O&&console.warn(e.configService.getSceneWarninfo("MapToken")),!O&&!window.mapboxgl.accessToken&&(window.mapboxgl.accessToken=y),O?(e.map=O,e.$mapContainer=e.map.getContainer()):(e.$mapContainer=e.creatMapContainer(n),e.map=new window.mapboxgl.Map((0,Wt.Z)({container:e.$mapContainer,style:e.getMapStyleValue(u),attributionControl:a,bearing:A},Z))),e.map.on("load",()=>{e.handleCameraChanged()}),e.map.on("move",e.handleCameraChanged),e.handleCameraChanged()})()}destroy(){var e;(e=this.$mapContainer)===null||e===void 0||(e=e.parentNode)===null||e===void 0||e.removeChild(this.$mapContainer),this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}emit(e,...r){this.eventEmitter.emit(e,...r)}once(e,...r){this.eventEmitter.once(e,...r)}getMapContainer(){return this.$mapContainer}getCanvasOverlays(){var e;return(e=this.getMapContainer())===null||e===void 0?void 0:e.querySelector(".mapboxgl-canvas-container")}meterToCoord(e,r){const n=new(__()).LngLat(e[0],e[1]),a=new(__()).LngLat(r[0],r[1]),u=n.distanceTo(a),y=__().MercatorCoordinate.fromLngLat({lng:e[0],lat:e[1]}),A=__().MercatorCoordinate.fromLngLat({lng:r[0],lat:r[1]}),{x:O,y:Z}=y,{x:Y,y:Q}=A;return Math.sqrt(Math.pow(O-Y,2)+Math.pow(Z-Q,2))*4194304*2/u}exportMap(e){const r=this.map.getCanvas();return e==="jpg"?r==null?void 0:r.toDataURL("image/jpeg"):r==null?void 0:r.toDataURL("image/png")}creatMapContainer(e){let r=e;typeof e=="string"&&(r=document.getElementById(e));const n=document.createElement("div");return n.style.cssText+=`
position: absolute;
top: 0;
height: 100%;
width: 100%;
`,n.id="l7_mapbox_div"+dI++,r.appendChild(n),n}}function gI(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}gI(`.mapboxgl-ctrl-logo {
display: none !important;
}
`);class vI extends Nm{getServiceConstructor(){return mI}}var _I=Se(68974),y_=Se.n(_I);const yI=["id","attributionControl","style","rotation","mapInstance"];function xI(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}xI(`.maplibregl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:-moz-full-screen{height:100%;width:100%}.maplibregl-map:-ms-fullscreen{height:100%;width:100%}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;-webkit-transform:translate(0);transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23999' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{-webkit-animation:maplibregl-spin 2s linear infinite;animation:maplibregl-spin 2s linear infinite}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}}@-webkit-keyframes maplibregl-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes maplibregl-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (-ms-high-contrast:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{-webkit-animation:maplibregl-user-location-dot-pulse 2s infinite;animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@-webkit-keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}70%{opacity:0;-webkit-transform:scale(3);transform:scale(3)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}70%{opacity:0;-webkit-transform:scale(3);transform:scale(3)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`),window.maplibregl=y_();let bI=0;class EI extends _g{constructor(...e){super(...e),(0,K.Z)(this,"version",rp.MAPBOX),(0,K.Z)(this,"viewport",void 0)}getType(){return"mapbox"}lngLatToCoord(e,r={x:0,y:0,z:0}){const{x:n,y:a}=this.lngLatToMercator(e,0);return[n-r.x,a-r.y]}lngLatToMercator(e,r){const{x:n=0,y:a=0,z:u=0}=window.maplibregl.MercatorCoordinate.fromLngLat(e,r);return{x:n,y:a,z:u}}getModelMatrix(e,r,n,a=[1,1,1],u={x:0,y:0,z:0}){const y=window.maplibregl.MercatorCoordinate.fromLngLat(e,r),A=y.meterInMercatorCoordinateUnits(),O=Kr.create();return Kr.translate(O,O,ra.fromValues(y.x-u.x,y.y-u.y,y.z||0-u.z)),Kr.scale(O,O,ra.fromValues(A*a[0],-A*a[1],A*a[2])),Kr.rotateX(O,O,n[0]),Kr.rotateY(O,O,n[1]),Kr.rotateZ(O,O,n[2]),O}init(){var e=this;return(0,Nr.Z)(function*(){const r=e.config,{id:n="map",attributionControl:a=!1,style:u="light",rotation:y=0,mapInstance:A}=r,O=(0,Ge.Z)(r,yI);e.viewport=new H3,!A&&!window.maplibregl&&console.error(e.configService.getSceneWarninfo("SDK")),A?(e.map=A,e.$mapContainer=e.map.getContainer()):(e.$mapContainer=e.creatMapContainer(n),e.map=new window.maplibregl.Map((0,Wt.Z)({container:e.$mapContainer,style:e.getMapStyleValue(u),attributionControl:a,bearing:y},O))),e.map.on("load",()=>{e.handleCameraChanged()}),e.map.on("move",e.handleCameraChanged),e.handleCameraChanged()})()}destroy(){var e;(e=this.$mapContainer)===null||e===void 0||(e=e.parentNode)===null||e===void 0||e.removeChild(this.$mapContainer),this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}emit(e,...r){this.eventEmitter.emit(e,...r)}once(e,...r){this.eventEmitter.once(e,...r)}getMapContainer(){return this.$mapContainer}getCanvasOverlays(){var e;return(e=this.getMapContainer())===null||e===void 0?void 0:e.querySelector(".maplibregl-canvas-container")}meterToCoord(e,r){const n=new(y_()).LngLat(e[0],e[1]),a=new(y_()).LngLat(r[0],r[1]),u=n.distanceTo(a),y=y_().MercatorCoordinate.fromLngLat({lng:e[0],lat:e[1]}),A=y_().MercatorCoordinate.fromLngLat({lng:r[0],lat:r[1]}),{x:O,y:Z}=y,{x:Y,y:Q}=A;return Math.sqrt(Math.pow(O-Y,2)+Math.pow(Z-Q,2))*4194304*2/u}exportMap(e){const r=this.map.getCanvas();return e==="jpg"?r==null?void 0:r.toDataURL("image/jpeg"):r==null?void 0:r.toDataURL("image/png")}creatMapContainer(e){let r=e;typeof e=="string"&&(r=document.getElementById(e));const n=document.createElement("div");return n.style.cssText+=`
position: absolute;
top: 0;
height: 100%;
width: 100%;
`,n.id="l7_mapbox_div"+bI++,r.appendChild(n),n}}class wI extends Nm{getServiceConstructor(){return EI}}const SI=t=>{const{tk:e}=t;return new Promise(r=>{const n=document.createElement("script");n.type="text/javascript",n.src=`https://api.tianditu.gov.cn/api?v=4.0&tk=${e}`,n.onload=function(){console.log("TianDiTu API script loaded."),r(!0)},n.onerror=function(){console.error("Failed to load TianDiTu API script."),r(!1)},document.head.appendChild(n)})},e7=()=>{};let TI=0;const H0={zoomchange:["Ge"]};class AI extends _g{constructor(...e){super(...e),(0,K.Z)(this,"viewport",null),(0,K.Z)(this,"evtCbProxyMap",new Map),(0,K.Z)(this,"sceneContainer",void 0),(0,K.Z)(this,"handleCameraChanged",()=>{this.emit("mapchange");const r=this.map,{lng:n,lat:a}=this.map.getCenter(),u={center:[n,a],viewportHeight:r.getContainer().clientHeight,viewportWidth:r.getContainer().clientWidth,bearing:360,pitch:0,zoom:r.getZoom()-1};this.viewport&&(this.viewport.syncWithMapCamera(u),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport))})}addMarkerContainer(){const e=this.map.getContainer(),r=this.markerContainer=document.createElement("div");e.appendChild(r),r.setAttribute("tabindex","-1"),r.id="tdt-L7-marker",r.style.position="absolute",r.style.left="",r.style.top="",r.style.zIndex="600",r.style.width="0px",r.style.height="0px",r.style.overflow="visible"}getMarkerContainer(){return this.markerContainer}onCameraChanged(e){this.cameraChangedCallback=e}resize(e){this.sceneContainer.style.width=e.newSize.x+"px",this.sceneContainer.style.height=e.newSize.y+"px"}update(){const e=this.map.getBounds(),{x:r,y:n}=this.map.lngLatToLayerPoint({lng:e.getSouthWest().lng,lat:e.getNorthEast().lat});this.sceneContainer.style.transition="",this.sceneContainer.style.transformOrigin="center",this.sceneContainer.style.transform=`translate3d(${r}px, ${n}px, 0px) scale(1)`,this.markerContainer.style.transition="",this.markerContainer.style.transformOrigin="center",this.markerContainer.style.transform=`translate3d(${-r}px, ${-n}px, 0px) scale(1)`,this.sceneContainer._tdt_pos=new T.Point(r,n),this.handleCameraChanged()}getZoomScale(e,r){const n=this.map.options.IW;return r=r===void 0?this.map.getZoom():r,n.scale(e)/n.scale(r)}zoomStartUpdate(e){const r=e.center,n=e.zoom,a=this.getZoomScale(n,this.map.getZoom()),u=T._Q.getPosition(this.sceneContainer),y=this.map.getSize().GQ(.5),A=this.map.options.IW.qW(this.map.getCenter(),n),Z=this.map.options.IW.qW(r,n).DQ(A),Y=new T.Point(y.x,y.y).GQ(-a);Y.aQ(u),Y.aQ(y),Y.DQ(Z),this.sceneContainer.style.transform=`translate3d(${Y.x}px,${Y.y}px,0px) scale(${a})`,this.sceneContainer.style.transformOrigin="0 0",this.sceneContainer.style.transition="transform 0.25s cubic-bezier(0,0,0.25,1)",this.handleCameraChanged()}getOverlayContainer(){var e;const r=(e=this.map.getPanes())===null||e===void 0?void 0:e.overlayPane,n=document.createElement("div");r.parentElement.appendChild(n),n.id="tdt-L7";const a=this.map.getSize();return n.style.zIndex="200",n.style.width=`${a.x}px`,n.style.height=`${a.y}px`,this.sceneContainer=n,n}init(){var e=this;return(0,Nr.Z)(function*(){e.viewport=new Fg;const{id:r,mapInstance:n,center:a=[121.30654632240122,31.25744185633306],token:u="b15e548080c79819617367d3f6095c69",minZoom:y=1,maxZoom:A=18,zoom:O=3}=e.config;if(window.T||(yield SI({tk:u})),n){e.map=n,e.map.centerAndZoom(new window.T.LngLat(a[0],a[1]),O),e.$mapContainer=e.map.getContainer();const Q=new window.T.LngLat(a[0],a[1]);e.map.centerAndZoom(Q,O),e.setMinZoom(y),e.setMaxZoom(A)}else{if(!r)throw Error("No container id specified");e.$mapContainer=e.creatMapContainer(r);const Q=new T.Map(e.$mapContainer,{center:window.T.LngLat(a[0],a[1]),minZoom:y,maxZoom:A,zoom:O,projection:"EPSG:900913"});e.map=Q;const ae=new window.T.Control.Zoom;Q.addControl(ae)}const Y=e.map.getContainer().querySelector(".tdt-pane");Y.style.zIndex=1,e.handleCameraChanged(),e.map.on("move",e.update,e),e.map.on("Ge",e.zoomStartUpdate,e),e.map.on("resize",e.resize,e)})()}destroy(){}on(e,r){if(po.indexOf(e)!==-1)this.eventEmitter.on(e,r);else{const n=a=>{let u=this.evtCbProxyMap.get(a);if(u||this.evtCbProxyMap.set(a,u=new Map),u.get(r))return;const y=(...A)=>{A[0]&&typeof A[0]=="object"&&!A[0].lngLat&&!A[0].lnglat&&(A[0].lngLat=A[0].latlng||A[0].latLng,A[0].map=this.map),r(...A)};u.set(r,y),this.map.on(a,y)};Array.isArray(H0[e])?H0[e].forEach(a=>{n(a||e)}):n(H0[e]||e)}}off(e,r){if(po.indexOf(e)!==-1){this.eventEmitter.off(e,r);return}const n=a=>{var u,y;const A=(u=this.evtCbProxyMap.get(e))===null||u===void 0?void 0:u.get(r);A&&((y=this.evtCbProxyMap.get(a))===null||y===void 0||y.delete(r),this.map.off(a,A))};Array.isArray(H0[e])?H0[e].forEach(a=>{n(a||e)}):n(H0[e]||e)}once(e,r){throw new Error("Method not implemented.")}getMapContainer(){return this.map.getContainer()}getType(){return"tdtmap"}getMapCanvasContainer(){var e;return(e=this.map.getContainer())===null||e===void 0?void 0:e.getElementsByClassName("tdt-container")[0]}getSize(){const e=this.map.getSize();return[e.x,e.y]}getZoom(){return this.map.getZoom()}setZoom(e){return this.map.setZoom(e)}getCenter(){return this.map.getCenter()}setCenter(e){this.map.setCenter(e)}getPitch(){return 0}getRotation(){return 0}setRotation(e){this.map.setBearing(e)}zoomIn(e,r){this.map.zoomIn(e,r)}zoomOut(e,r){this.map.zoomOut(e,r)}panTo(e){this.map.panTo(e)}panBy(e=0,r=0){this.map.panBy([e,r])}fitBounds(e){const[r,n]=e;this.map.setViewport([new window.T.LngLat(r[0],r[1]),new window.T.LngLat(n[0],n[1])])}setMaxZoom(e){this.map.setMaxZoom(e)}setMinZoom(e){this.map.setMinZoom(e)}setMapStatus(e){e.doubleClickZoom===!0&&this.map.enableDoubleClickZoom(),e.doubleClickZoom===!1&&this.map.disableDoubleClickZoom(),e.dragEnable===!1&&this.map.disableDrag(),e.dragEnable===!0&&this.map.enableDrag(),e.keyboardEnable===!1&&this.map.disableKeyboard(),e.keyboardEnable===!0&&this.map.enableKeyboard(),e.zoomEnable===!1&&this.map.disableScrollWheelZoom(),e.zoomEnable===!0&&this.map.enableScrollWheelZoom()}getModelMatrix(){throw new Error("Method not implemented.")}pixelToLngLat([e,r]){const n=this.map.layerPointToLngLat({x:e,y:r});return{lng:n.lng,lat:n.lat}}lngLatToPixel([e,r]){const n=this.map.lngLatToLayerPoint({lng:e,lat:r});return{x:n.x,y:n.y}}containerToLngLat([e,r]){const n=this.map.containerPointToLngLat({x:e,y:r});return{lng:n.lng,lat:n.lat}}lngLatToContainer([e,r]){const n=this.map.lngLatToContainerPoint({lat:r,lng:e});return{x:n.x,y:n.y}}lngLatToCoord([e,r]){const n=this.lngLatToPixel([e,r]);return[n.x,n.y]}lngLatToCoords(e){return e.map(r=>Array.isArray(r[0])?this.lngLatToCoords(r):this.lngLatToCoord(r))}getBounds(){const e=this.map.getBounds(),r=e.getSouthWest(),n=e.getNorthEast();return[[r.lng,r.lat],[n.lng,n.lat]]}lngLatToMercator(e,r){const{x:n=0,y:a=0,z:u=0}=Vm.fromLngLat(e,r);return{x:n,y:a,z:u}}getCustomCoordCenter(){throw new Error("Method not implemented.")}creatMapContainer(e){let r=e;typeof e=="string"&&(r=document.getElementById(e));const n=document.createElement("div");return n.style.cssText+=`
position: absolute;
top: 0;
height: 100%;
width: 100%;
`,n.id="l7_tdt_div"+TI++,r.appendChild(n),n}}class CI extends Nm{getServiceConstructor(){return AI}}if(!window)throw Error("TMap JSAPI can only be used in Browser.");var Hm=function(t){return t.notload="notload",t.loading="loading",t.loaded="loaded",t.failed="failed",t}(Hm||{});const wg={key:"",version:"1.exp",libraries:[]};let Sg={TMap:Hm.notload};const W2=[],W3=t=>{if(typeof t=="function"){if(Sg.TMap===Hm.loaded){t(window.TMap);return}W2.push(t)}};var MI={load:t=>new Promise((e,r)=>{if(Sg.TMap===Hm.failed)r("");else if(Sg.TMap===Hm.notload){const{key:n,version:a,libraries:u}=t;if(!n){r("\u8BF7\u586B\u5199key");return}wg.key=n,wg.version=a||wg.version,wg.libraries=u||wg.libraries,Sg.TMap=Hm.loading,window._onTMapAPILoaded=O=>{if(delete window._onTMapAPILoaded,O)Sg.TMap=Hm.failed,r(O);else for(Sg.TMap=Hm.loaded;W2.length;)W2.splice(0,1)[0](window.TMap)};const y=document.createElement("script");y.type="text/javascript",y.async=!1,y.src="https://map.qq.com/api/gljs?callback=_onTMapAPILoaded&v="+wg.version+"&key="+n+"&plugin="+wg.libraries.join(","),y.onerror=O=>{Sg.TMap=Hm.failed,r(O)},(document.body||document.head).appendChild(y),W3(e)}else if(Sg.TMap===Hm.loaded){if(t.key&&t.key!==wg.key){r("\u591A\u4E2A\u4E0D\u4E00\u81F4\u7684 key");return}if(t.version&&t.version!==wg.version){r("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C JSAPI \u6DF7\u7528");return}W3(e)}}),reset:()=>{delete window.TMap,Sg={TMap:Hm.notload}}};const PI=["id","mapInstance","center","token","version","libraries","minZoom","maxZoom","rotation","pitch","mapSize","logoVisible"];function RI(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}RI(`img[src*='//mapapi.qq.com/web/jsapi/logo/logo_def.png'],.logo-text
{
display: none !important;
}
.tencent-map > canvas + div {
z-index: 3 !important;
}
`);const II="OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77",LI="1.exp",G0={mapmove:"center_changed",camerachange:["drag","pan","rotate","pitch","zoom"],zoomchange:"zoom",dragging:"drag"};class DI extends _g{constructor(...e){super(...e),(0,K.Z)(this,"viewport",null),(0,K.Z)(this,"evtCbProxyMap",new Map),(0,K.Z)(this,"handleCameraChanged",()=>{this.emit("mapchange");const r=this.map,{lng:n,lat:a}=r.getCenter(),u={center:[n,a],viewportHeight:r.getContainer().clientHeight,viewportWidth:r.getContainer().clientWidth,bearing:r.getHeading(),pitch:r.getPitch(),zoom:r.getZoom()-1};this.viewport.syncWithMapCamera(u),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport)})}init(){var e=this;return(0,Nr.Z)(function*(){var r;e.viewport=new Fg;const n=e.config,{id:a,mapInstance:u,center:y=[121.30654632240122,31.25744185633306],token:A=II,version:O=LI,libraries:Z=[],minZoom:Y=3,maxZoom:Q=18,rotation:ae=0,pitch:xe=0,mapSize:Be=1e4,logoVisible:it=!0}=n,gt=(0,Ge.Z)(n,PI);if(window.TMap||u||(yield MI.load({key:A,version:O,libraries:Z})),u)e.map=u,e.$mapContainer=e.map.getContainer(),it===!1&&e.hideLogo();else{if(!a)throw Error("No container id specified");const Rt=wc(a),Yt=new TMap.Map(Rt,(0,Wt.Z)({maxZoom:Q,minZoom:Y,rotation:ae,pitch:xe,showControl:!1,center:new TMap.LatLng(y[1],y[0])},gt));e.map=Yt,e.$mapContainer=Yt.getContainer(),it===!1&&e.hideLogo()}e.map.canvasContainer.style.position="absolute",e.map.drawContainer.classList.add("tencent-map");const Bt=(r=e.map.controlManager.controlContainer)===null||r===void 0?void 0:r.parentNode;Bt&&(Bt.style.zIndex=2),e.simpleMapCoord.setSize(Be),e.map.on("drag",e.handleCameraChanged),e.map.on("pan",e.handleCameraChanged),e.map.on("rotate",e.handleCameraChanged),e.map.on("pitch",e.handleCameraChanged),e.map.on("zoom",e.handleCameraChanged),e.handleCameraChanged()})()}destroy(){this.map.destroy()}onCameraChanged(e){this.cameraChangedCallback=e}addMarkerContainer(){const e=this.map.getContainer();this.markerContainer=Xo("div","l7-marker-container",e),this.markerContainer.setAttribute("tabindex","-1"),this.markerContainer.style.zIndex="2"}getMarkerContainer(){return this.markerContainer}on(e,r){if(po.indexOf(e)!==-1)this.eventEmitter.on(e,r);else{const n=a=>{let u=this.evtCbProxyMap.get(a);if(u||this.evtCbProxyMap.set(a,u=new Map),u.get(r))return;const y=(...A)=>{A[0]&&typeof A[0]=="object"&&!A[0].lngLat&&!A[0].lnglat&&(A[0].lngLat=A[0].latlng||A[0].latLng),r(...A)};u.set(r,y),this.map.on(a,y)};Array.isArray(G0[e])?G0[e].forEach(a=>{n(a||e)}):n(G0[e]||e)}}off(e,r){if(po.indexOf(e)!==-1){this.eventEmitter.off(e,r);return}const n=a=>{var u,y;const A=(u=this.evtCbProxyMap.get(e))===null||u===void 0?void 0:u.get(r);A&&((y=this.evtCbProxyMap.get(a))===null||y===void 0||y.delete(r),this.map.off(a,A))};Array.isArray(G0[e])?G0[e].forEach(a=>{n(a||e)}):n(G0[e]||e)}once(){throw new Error("Method not implemented.")}getContainer(){return this.map.getContainer()}getSize(){return[this.map.width,this.map.height]}getMinZoom(){return this.map.transform._minZoom}getMaxZoom(){return this.map.transform._maxZoom}getType(){return"tmap"}getZoom(){return this.map.getZoom()}getCenter(){const{lng:e,lat:r}=this.map.getCenter();return{lng:e,lat:r}}getPitch(){return this.map.getPitch()}getRotation(){return this.map.getRotation()}getBounds(){const e=this.map.getBounds().getNorthEast(),r=this.map.getBounds().getSouthWest();return[[r.lng,r.lat],[e.lng,e.lat]]}getMapContainer(){return this.map.getContainer()}getMapCanvasContainer(){var e;return(e=this.map.getContainer())===null||e===void 0?void 0:e.getElementsByTagName("canvas")[0]}getCanvasOverlays(){var e;return(e=this.getMapCanvasContainer())===null||e===void 0||(e=e.nextSibling)===null||e===void 0?void 0:e.firstChild}getMapStyleConfig(){throw new Error("Method not implemented.")}setBgColor(e){this.bgColor=e}setMapStyle(e){this.map.setMapStyleId(e)}setRotation(e){this.map.setRotation(e)}zoomIn(){this.map.setZoom(this.getZoom()+1)}zoomOut(){this.map.setZoom(this.getZoom()-1)}panTo([e,r]){this.map.panTo(new TMap.LatLng(r,e))}panBy(e,r){this.map.panBy([e,r])}fitBounds(e,r){const[n,a]=e,u=new TMap.LatLng(n[1],n[0]),y=new TMap.LatLng(a[1],a[0]),A=new TMap.LatLngBounds(u,y);this.map.fitBounds(A,r)}setZoomAndCenter(e,[r,n]){this.map.setCenter(new TMap.LatLng(n,r)),this.map.setZoom(e)}setCenter([e,r]){this.map.setCenter(new TMap.LatLng(r,e))}setPitch(e){this.map.setPitch(e)}setZoom(e){this.map.setZoom(e)}setMapStatus(e){Object.keys(e).map(r=>{switch(r){case"doubleClickZoom":this.map.setDoubleClickZoom(!!e.doubleClickZoom);break;case"dragEnable":this.map.setDraggable(!!e.dragEnable);break;case"rotateEnable":this.map.setRotatable(!!e.rotateEnable);break;case"zoomEnable":this.map.setDoubleClickZoom(!!e.zoomEnable),this.map.setScrollable(!!e.zoomEnable);break;case"keyboardEnable":case"resizeEnable":case"showIndoorMap":throw Error("Options may bot be supported");default:}})}meterToCoord([e,r],[n,a]){const u=TMap.geometry.computeDistance([new TMap.LatLng(r,e),new TMap.LatLng(a,n)]),[y,A]=this.lngLatToCoord([e,r]),[O,Z]=this.lngLatToCoord([n,a]);return Math.sqrt(Math.pow(y-O,2)+Math.pow(A-Z,2))/u}pixelToLngLat([e,r]){const{lng:n,lat:a}=this.map.getCenter(),{x:u,y}=this.lngLatToPixel([n,a]),{x:A,y:O}=this.lngLatToContainer([n,a]),{lng:Z,lat:Y}=this.map.unprojectFromContainer(new TMap.Point(A+(e-u),O+(r-y)));return this.containerToLngLat([Z,Y])}lngLatToPixel([e,r]){const{x:n,y:a}=this.map.projectToWorldPlane(new TMap.LatLng(r,e));return{x:n,y:a}}containerToLngLat([e,r]){const{lng:n,lat:a}=this.map.unprojectFromContainer(new TMap.Point(e,r));return{lng:n,lat:a}}lngLatToContainer([e,r]){const{x:n,y:a}=this.map.projectToContainer(new TMap.LatLng(r,e));return{x:n,y:a}}lngLatToCoord([e,r]){const{x:n,y:a}=this.lngLatToPixel([e,r]);return[n,-a]}lngLatToCoords(e){return e.map(r=>Array.isArray(r[0])?this.lngLatToCoords(r):this.lngLatToCoord(r))}lngLatToMercator(e,r){const{x:n=0,y:a=0,z:u=0}=Vm.fromLngLat(e,r);return{x:n,y:a,z:u}}getModelMatrix(e,r,n,a=[1,1,1]){const u=this.viewport.projectFlat(e),y=Kr.create();return Kr.translate(y,y,ra.fromValues(u[0],u[1],r)),Kr.scale(y,y,ra.fromValues(a[0],a[1],a[2])),Kr.rotateX(y,y,n[0]),Kr.rotateY(y,y,n[1]),Kr.rotateZ(y,y,n[2]),y}getCustomCoordCenter(){throw new Error("Method not implemented.")}exportMap(e){const r=this.getMapCanvasContainer();return e==="jpg"?r==null?void 0:r.toDataURL("image/jpeg"):r==null?void 0:r.toDataURL("image/png")}rotateY(){throw new Error("Method not implemented.")}hideLogo(){const e=this.map.getContainer();e&&dl(e,"tmap-contianer--hide-logo")}}class OI extends Nm{getServiceConstructor(){return DI}}var BI=Se(79801),FI=Se.n(BI),kI=class{constructor(t,e){const{buffer:r,offset:n,stride:a,normalized:u,size:y,divisor:A}=e;this.buffer=r,this.attribute={buffer:r.get(),offset:n||0,stride:a||0,normalized:u||!1,divisor:A||0},y&&(this.attribute.size=y)}get(){return this.attribute}updateBuffer(t){this.buffer.subData(t)}destroy(){this.buffer.destroy()}},NI={[Ee.POINTS]:"points",[Ee.LINES]:"lines",[Ee.LINE_LOOP]:"line loop",[Ee.LINE_STRIP]:"line strip",[Ee.TRIANGLES]:"triangles",[Ee.TRIANGLE_FAN]:"triangle fan",[Ee.TRIANGLE_STRIP]:"triangle strip"},X3={[Ee.STATIC_DRAW]:"static",[Ee.DYNAMIC_DRAW]:"dynamic",[Ee.STREAM_DRAW]:"stream"},X2={[Ee.BYTE]:"int8",[Ee.INT]:"int32",[Ee.UNSIGNED_BYTE]:"uint8",[Ee.UNSIGNED_SHORT]:"uint16",[Ee.UNSIGNED_INT]:"uint32",[Ee.FLOAT]:"float"},zI={[Ee.ALPHA]:"alpha",[Ee.LUMINANCE]:"luminance",[Ee.LUMINANCE_ALPHA]:"luminance alpha",[Ee.RGB]:"rgb",[Ee.RGBA]:"rgba",[Ee.RGBA4]:"rgba4",[Ee.RGB5_A1]:"rgb5 a1",[Ee.RGB565]:"rgb565",[Ee.DEPTH_COMPONENT]:"depth",[Ee.DEPTH_STENCIL]:"depth stencil"},UI={[Ee.DONT_CARE]:"dont care",[Ee.NICEST]:"nice",[Ee.FASTEST]:"fast"},q3={[Ee.NEAREST]:"nearest",[Ee.LINEAR]:"linear",[Ee.LINEAR_MIPMAP_LINEAR]:"mipmap",[Ee.NEAREST_MIPMAP_LINEAR]:"nearest mipmap linear",[Ee.LINEAR_MIPMAP_NEAREST]:"linear mipmap nearest",[Ee.NEAREST_MIPMAP_NEAREST]:"nearest mipmap nearest"},Y3={[Ee.REPEAT]:"repeat",[Ee.CLAMP_TO_EDGE]:"clamp",[Ee.MIRRORED_REPEAT]:"mirror"},ZI={[Ee.NONE]:"none",[Ee.BROWSER_DEFAULT_WEBGL]:"browser"},VI={[Ee.NEVER]:"never",[Ee.ALWAYS]:"always",[Ee.LESS]:"less",[Ee.LEQUAL]:"lequal",[Ee.GREATER]:"greater",[Ee.GEQUAL]:"gequal",[Ee.EQUAL]:"equal",[Ee.NOTEQUAL]:"notequal"},$3={[Ee.FUNC_ADD]:"add",[Ee.MIN_EXT]:"min",[Ee.MAX_EXT]:"max",[Ee.FUNC_SUBTRACT]:"subtract",[Ee.FUNC_REVERSE_SUBTRACT]:"reverse subtract"},k1={[Ee.ZERO]:"zero",[Ee.ONE]:"one",[Ee.SRC_COLOR]:"src color",[Ee.ONE_MINUS_SRC_COLOR]:"one minus src color",[Ee.SRC_ALPHA]:"src alpha",[Ee.ONE_MINUS_SRC_ALPHA]:"one minus src alpha",[Ee.DST_COLOR]:"dst color",[Ee.ONE_MINUS_DST_COLOR]:"one minus dst color",[Ee.DST_ALPHA]:"dst alpha",[Ee.ONE_MINUS_DST_ALPHA]:"one minus dst alpha",[Ee.CONSTANT_COLOR]:"constant color",[Ee.ONE_MINUS_CONSTANT_COLOR]:"one minus constant color",[Ee.CONSTANT_ALPHA]:"constant alpha",[Ee.ONE_MINUS_CONSTANT_ALPHA]:"one minus constant alpha",[Ee.SRC_ALPHA_SATURATE]:"src alpha saturate"},jI={[Ee.NEVER]:"never",[Ee.ALWAYS]:"always",[Ee.LESS]:"less",[Ee.LEQUAL]:"lequal",[Ee.GREATER]:"greater",[Ee.GEQUAL]:"gequal",[Ee.EQUAL]:"equal",[Ee.NOTEQUAL]:"notequal"},W0={[Ee.ZERO]:"zero",[Ee.KEEP]:"keep",[Ee.REPLACE]:"replace",[Ee.INVERT]:"invert",[Ee.INCR]:"increment",[Ee.DECR]:"decrement",[Ee.INCR_WRAP]:"increment wrap",[Ee.DECR_WRAP]:"decrement wrap"},HI={[Ee.FRONT]:"front",[Ee.BACK]:"back"},GI=class{constructor(t,e){this.isDestroyed=!1;const{data:r,usage:n,type:a}=e;this.buffer=t.buffer({data:r,usage:X3[n||Ee.STATIC_DRAW],type:X2[a||Ee.UNSIGNED_BYTE]})}get(){return this.buffer}destroy(){this.isDestroyed||this.buffer.destroy(),this.isDestroyed=!0}subData({data:t,offset:e}){this.buffer.subdata(t,e)}},WI=class{constructor(t,e){const{data:r,usage:n,type:a,count:u}=e;this.elements=t.elements({data:r,usage:X3[n||Ee.STATIC_DRAW],type:X2[a||Ee.UNSIGNED_BYTE],count:u})}get(){return this.elements}subData({data:t}){this.elements.subdata(t)}destroy(){}},XI=class{constructor(t,e){const{width:r,height:n,color:a,colors:u}=e,y={width:r,height:n};Array.isArray(u)&&(y.colors=u.map(A=>A.get())),a&&typeof a!="boolean"&&(y.color=a.get()),this.framebuffer=t.framebuffer(y)}get(){return this.framebuffer}destroy(){this.framebuffer.destroy()}resize({width:t,height:e}){this.framebuffer.resize(t,e)}},Dm=Se(58622),X0=Se(39696),qI=Se(39083),wo=Se(99938),YI=Se(2337),K3=YI,qt;(function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",t[t.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.CULL_FACE=2884]="CULL_FACE",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.BLEND=3042]="BLEND",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.DITHER=3024]="DITHER",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DOUBLE=5130]="DOUBLE",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.ALWAYS=519]="ALWAYS",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.GEQUAL=518]="GEQUAL",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",t[t.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.READ_BUFFER=3074]="READ_BUFFER",t[t.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",t[t.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",t[t.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",t[t.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",t[t.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",t[t.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",t[t.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",t[t.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",t[t.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",t[t.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",t[t.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",t[t.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",t[t.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",t[t.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",t[t.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",t[t.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",t[t.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",t[t.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",t[t.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",t[t.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",t[t.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",t[t.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",t[t.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",t[t.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",t[t.RED=6403]="RED",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB10_A2=32857]="RGB10_A2",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",t[t.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",t[t.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",t[t.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",t[t.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",t[t.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",t[t.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",t[t.SRGB=35904]="SRGB",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",t[t.RGBA32F=34836]="RGBA32F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.RGB16F=34843]="RGB16F",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R16F=33325]="R16F",t[t.R32F=33326]="R32F",t[t.RG16F=33327]="RG16F",t[t.RG32F=33328]="RG32F",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2UI=36975]="RGB10_A2UI",t[t.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",t[t.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.RG=33319]="RG",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",t[t.CURRENT_QUERY=34917]="CURRENT_QUERY",t[t.QUERY_RESULT=34918]="QUERY_RESULT",t[t.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",t[t.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",t[t.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",t[t.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",t[t.DRAW_BUFFER0=34853]="DRAW_BUFFER0",t[t.DRAW_BUFFER1=34854]="DRAW_BUFFER1",t[t.DRAW_BUFFER2=34855]="DRAW_BUFFER2",t[t.DRAW_BUFFER3=34856]="DRAW_BUFFER3",t[t.DRAW_BUFFER4=34857]="DRAW_BUFFER4",t[t.DRAW_BUFFER5=34858]="DRAW_BUFFER5",t[t.DRAW_BUFFER6=34859]="DRAW_BUFFER6",t[t.DRAW_BUFFER7=34860]="DRAW_BUFFER7",t[t.DRAW_BUFFER8=34861]="DRAW_BUFFER8",t[t.DRAW_BUFFER9=34862]="DRAW_BUFFER9",t[t.DRAW_BUFFER10=34863]="DRAW_BUFFER10",t[t.DRAW_BUFFER11=34864]="DRAW_BUFFER11",t[t.DRAW_BUFFER12=34865]="DRAW_BUFFER12",t[t.DRAW_BUFFER13=34866]="DRAW_BUFFER13",t[t.DRAW_BUFFER14=34867]="DRAW_BUFFER14",t[t.DRAW_BUFFER15=34868]="DRAW_BUFFER15",t[t.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",t[t.MAX_SAMPLES=36183]="MAX_SAMPLES",t[t.SAMPLER_BINDING=35097]="SAMPLER_BINDING",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",t[t.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",t[t.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",t[t.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",t[t.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",t[t.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",t[t.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",t[t.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",t[t.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",t[t.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",t[t.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",t[t.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",t[t.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",t[t.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",t[t.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",t[t.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",t[t.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",t[t.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",t[t.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",t[t.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",t[t.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",t[t.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",t[t.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",t[t.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",t[t.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",t[t.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",t[t.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",t[t.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",t[t.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",t[t.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",t[t.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",t[t.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",t[t.UNIFORM_TYPE=35383]="UNIFORM_TYPE",t[t.UNIFORM_SIZE=35384]="UNIFORM_SIZE",t[t.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",t[t.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",t[t.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",t[t.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",t[t.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",t[t.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",t[t.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",t[t.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",t[t.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS",t[t.SYNC_FENCE=37142]="SYNC_FENCE",t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED",t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED",t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",t[t.COLOR=6144]="COLOR",t[t.DEPTH=6145]="DEPTH",t[t.STENCIL=6146]="STENCIL",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STREAM_COPY=35042]="STREAM_COPY",t[t.STATIC_READ=35045]="STATIC_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",t[t.INVALID_INDEX=4294967295]="INVALID_INDEX",t[t.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",t[t.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",t[t.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",t[t.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",t[t.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",t[t.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.UNSIGNED_INT_24_8_WEBGL=34042]="UNSIGNED_INT_24_8_WEBGL",t[t.HALF_FLOAT_OES=36193]="HALF_FLOAT_OES",t[t.RGBA32F_EXT=34836]="RGBA32F_EXT",t[t.RGB32F_EXT=34837]="RGB32F_EXT",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",t[t.UNSIGNED_NORMALIZED_EXT=35863]="UNSIGNED_NORMALIZED_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.SRGB_EXT=35904]="SRGB_EXT",t[t.SRGB_ALPHA_EXT=35906]="SRGB_ALPHA_EXT",t[t.SRGB8_ALPHA8_EXT=35907]="SRGB8_ALPHA8_EXT",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT_OES=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT_OES",t[t.COLOR_ATTACHMENT0_WEBGL=36064]="COLOR_ATTACHMENT0_WEBGL",t[t.COLOR_ATTACHMENT1_WEBGL=36065]="COLOR_ATTACHMENT1_WEBGL",t[t.COLOR_ATTACHMENT2_WEBGL=36066]="COLOR_ATTACHMENT2_WEBGL",t[t.COLOR_ATTACHMENT3_WEBGL=36067]="COLOR_ATTACHMENT3_WEBGL",t[t.COLOR_ATTACHMENT4_WEBGL=36068]="COLOR_ATTACHMENT4_WEBGL",t[t.COLOR_ATTACHMENT5_WEBGL=36069]="COLOR_ATTACHMENT5_WEBGL",t[t.COLOR_ATTACHMENT6_WEBGL=36070]="COLOR_ATTACHMENT6_WEBGL",t[t.COLOR_ATTACHMENT7_WEBGL=36071]="COLOR_ATTACHMENT7_WEBGL",t[t.COLOR_ATTACHMENT8_WEBGL=36072]="COLOR_ATTACHMENT8_WEBGL",t[t.COLOR_ATTACHMENT9_WEBGL=36073]="COLOR_ATTACHMENT9_WEBGL",t[t.COLOR_ATTACHMENT10_WEBGL=36074]="COLOR_ATTACHMENT10_WEBGL",t[t.COLOR_ATTACHMENT11_WEBGL=36075]="COLOR_ATTACHMENT11_WEBGL",t[t.COLOR_ATTACHMENT12_WEBGL=36076]="COLOR_ATTACHMENT12_WEBGL",t[t.COLOR_ATTACHMENT13_WEBGL=36077]="COLOR_ATTACHMENT13_WEBGL",t[t.COLOR_ATTACHMENT14_WEBGL=36078]="COLOR_ATTACHMENT14_WEBGL",t[t.COLOR_ATTACHMENT15_WEBGL=36079]="COLOR_ATTACHMENT15_WEBGL",t[t.DRAW_BUFFER0_WEBGL=34853]="DRAW_BUFFER0_WEBGL",t[t.DRAW_BUFFER1_WEBGL=34854]="DRAW_BUFFER1_WEBGL",t[t.DRAW_BUFFER2_WEBGL=34855]="DRAW_BUFFER2_WEBGL",t[t.DRAW_BUFFER3_WEBGL=34856]="DRAW_BUFFER3_WEBGL",t[t.DRAW_BUFFER4_WEBGL=34857]="DRAW_BUFFER4_WEBGL",t[t.DRAW_BUFFER5_WEBGL=34858]="DRAW_BUFFER5_WEBGL",t[t.DRAW_BUFFER6_WEBGL=34859]="DRAW_BUFFER6_WEBGL",t[t.DRAW_BUFFER7_WEBGL=34860]="DRAW_BUFFER7_WEBGL",t[t.DRAW_BUFFER8_WEBGL=34861]="DRAW_BUFFER8_WEBGL",t[t.DRAW_BUFFER9_WEBGL=34862]="DRAW_BUFFER9_WEBGL",t[t.DRAW_BUFFER10_WEBGL=34863]="DRAW_BUFFER10_WEBGL",t[t.DRAW_BUFFER11_WEBGL=34864]="DRAW_BUFFER11_WEBGL",t[t.DRAW_BUFFER12_WEBGL=34865]="DRAW_BUFFER12_WEBGL",t[t.DRAW_BUFFER13_WEBGL=34866]="DRAW_BUFFER13_WEBGL",t[t.DRAW_BUFFER14_WEBGL=34867]="DRAW_BUFFER14_WEBGL",t[t.DRAW_BUFFER15_WEBGL=34868]="DRAW_BUFFER15_WEBGL",t[t.MAX_COLOR_ATTACHMENTS_WEBGL=36063]="MAX_COLOR_ATTACHMENTS_WEBGL",t[t.MAX_DRAW_BUFFERS_WEBGL=34852]="MAX_DRAW_BUFFERS_WEBGL",t[t.VERTEX_ARRAY_BINDING_OES=34229]="VERTEX_ARRAY_BINDING_OES",t[t.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",t[t.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",t[t.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",t[t.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",t[t.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",t[t.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",t[t.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT"})(qt||(qt={}));var Jl;(function(t){t[t.Buffer=0]="Buffer",t[t.Texture=1]="Texture",t[t.RenderTarget=2]="RenderTarget",t[t.Sampler=3]="Sampler",t[t.Program=4]="Program",t[t.Bindings=5]="Bindings",t[t.InputLayout=6]="InputLayout",t[t.RenderPipeline=7]="RenderPipeline",t[t.ComputePipeline=8]="ComputePipeline",t[t.Readback=9]="Readback",t[t.QueryPool=10]="QueryPool",t[t.RenderBundle=11]="RenderBundle"})(Jl||(Jl={}));var js;(function(t){t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS"})(js||(js={}));var x_;(function(t){t[t.CCW=2305]="CCW",t[t.CW=2304]="CW"})(x_||(x_={}));var Jd;(function(t){t[t.NONE=0]="NONE",t[t.FRONT=1]="FRONT",t[t.BACK=2]="BACK",t[t.FRONT_AND_BACK=3]="FRONT_AND_BACK"})(Jd||(Jd={}));var pl;(function(t){t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC=768]="SRC",t[t.ONE_MINUS_SRC=769]="ONE_MINUS_SRC",t[t.DST=774]="DST",t[t.ONE_MINUS_DST=775]="ONE_MINUS_DST",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.CONST=32769]="CONST",t[t.ONE_MINUS_CONSTANT=32770]="ONE_MINUS_CONSTANT",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE"})(pl||(pl={}));var If;(function(t){t[t.ADD=32774]="ADD",t[t.SUBSTRACT=32778]="SUBSTRACT",t[t.REVERSE_SUBSTRACT=32779]="REVERSE_SUBSTRACT",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX"})(If||(If={}));var Id;(function(t){t[t.CLAMP_TO_EDGE=0]="CLAMP_TO_EDGE",t[t.REPEAT=1]="REPEAT",t[t.MIRRORED_REPEAT=2]="MIRRORED_REPEAT"})(Id||(Id={}));var pp;(function(t){t[t.POINT=0]="POINT",t[t.BILINEAR=1]="BILINEAR"})(pp||(pp={}));var df;(function(t){t[t.NO_MIP=0]="NO_MIP",t[t.NEAREST=1]="NEAREST",t[t.LINEAR=2]="LINEAR"})(df||(df={}));var Ip;(function(t){t[t.POINTS=0]="POINTS",t[t.TRIANGLES=1]="TRIANGLES",t[t.TRIANGLE_STRIP=2]="TRIANGLE_STRIP",t[t.LINES=3]="LINES",t[t.LINE_STRIP=4]="LINE_STRIP"})(Ip||(Ip={}));var ac;(function(t){t[t.MAP_READ=1]="MAP_READ",t[t.MAP_WRITE=2]="MAP_WRITE",t[t.COPY_SRC=4]="COPY_SRC",t[t.COPY_DST=8]="COPY_DST",t[t.INDEX=16]="INDEX",t[t.VERTEX=32]="VERTEX",t[t.UNIFORM=64]="UNIFORM",t[t.STORAGE=128]="STORAGE",t[t.INDIRECT=256]="INDIRECT",t[t.QUERY_RESOLVE=512]="QUERY_RESOLVE"})(ac||(ac={}));var Gm;(function(t){t[t.STATIC=1]="STATIC",t[t.DYNAMIC=2]="DYNAMIC"})(Gm||(Gm={}));var a0;(function(t){t[t.VERTEX=1]="VERTEX",t[t.INSTANCE=2]="INSTANCE"})(a0||(a0={}));var J3;(function(t){t.LOADED="loaded"})(J3||(J3={}));var rl;(function(t){t[t.TEXTURE_2D=0]="TEXTURE_2D",t[t.TEXTURE_2D_ARRAY=1]="TEXTURE_2D_ARRAY",t[t.TEXTURE_3D=2]="TEXTURE_3D",t[t.TEXTURE_CUBE_MAP=3]="TEXTURE_CUBE_MAP"})(rl||(rl={}));var ad;(function(t){t[t.SAMPLED=1]="SAMPLED",t[t.RENDER_TARGET=2]="RENDER_TARGET",t[t.STORAGE=4]="STORAGE"})(ad||(ad={}));var Lf;(function(t){t[t.NONE=0]="NONE",t[t.RED=1]="RED",t[t.GREEN=2]="GREEN",t[t.BLUE=4]="BLUE",t[t.ALPHA=8]="ALPHA",t[t.RGB=7]="RGB",t[t.ALL=15]="ALL"})(Lf||(Lf={}));var jh;(function(t){t[t.KEEP=7680]="KEEP",t[t.ZERO=0]="ZERO",t[t.REPLACE=7681]="REPLACE",t[t.INVERT=5386]="INVERT",t[t.INCREMENT_CLAMP=7682]="INCREMENT_CLAMP",t[t.DECREMENT_CLAMP=7683]="DECREMENT_CLAMP",t[t.INCREMENT_WRAP=34055]="INCREMENT_WRAP",t[t.DECREMENT_WRAP=34056]="DECREMENT_WRAP"})(jh||(jh={}));function n7(t,e,r,n){var a=rl.TEXTURE_2D,u=1,y=ad.SAMPLED;return{dimension:a,format:t,width:e,height:r,depthOrArrayLayers:u,mipLevelCount:n,usage:y}}var Hh;(function(t){t[t.Float=0]="Float",t[t.UnfilterableFloat=1]="UnfilterableFloat",t[t.Uint=2]="Uint",t[t.Sint=3]="Sint",t[t.Depth=4]="Depth"})(Hh||(Hh={}));var ng;(function(t){t[t.LOWER_LEFT=0]="LOWER_LEFT",t[t.UPPER_LEFT=1]="UPPER_LEFT"})(ng||(ng={}));var q0;(function(t){t[t.NEGATIVE_ONE=0]="NEGATIVE_ONE",t[t.ZERO=1]="ZERO"})(q0||(q0={}));var N1;(function(t){t[t.OcclusionConservative=0]="OcclusionConservative"})(N1||(N1={}));var zn;(function(t){t[t.U8=1]="U8",t[t.U16=2]="U16",t[t.U32=3]="U32",t[t.S8=4]="S8",t[t.S16=5]="S16",t[t.S32=6]="S32",t[t.F16=7]="F16",t[t.F32=8]="F32",t[t.BC1=65]="BC1",t[t.BC2=66]="BC2",t[t.BC3=67]="BC3",t[t.BC4_UNORM=68]="BC4_UNORM",t[t.BC4_SNORM=69]="BC4_SNORM",t[t.BC5_UNORM=70]="BC5_UNORM",t[t.BC5_SNORM=71]="BC5_SNORM",t[t.U16_PACKED_5551=97]="U16_PACKED_5551",t[t.U16_PACKED_565=98]="U16_PACKED_565",t[t.D24=129]="D24",t[t.D32F=130]="D32F",t[t.D24S8=131]="D24S8",t[t.D32FS8=132]="D32FS8"})(zn||(zn={}));var No;(function(t){t[t.R=1]="R",t[t.RG=2]="RG",t[t.RGB=3]="RGB",t[t.RGBA=4]="RGBA",t[t.A=5]="A"})(No||(No={}));function i7(t){return t}var to;(function(t){t[t.None=0]="None",t[t.Normalized=1]="Normalized",t[t.sRGB=2]="sRGB",t[t.Depth=4]="Depth",t[t.Stencil=8]="Stencil",t[t.RenderTarget=16]="RenderTarget",t[t.Luminance=32]="Luminance"})(to||(to={}));function ga(t,e,r){return t<<16|e<<8|r}var yr;(function(t){t[t.ALPHA=ga(zn.U8,No.A,to.None)]="ALPHA",t[t.U8_LUMINANCE=ga(zn.U8,No.A,to.Luminance)]="U8_LUMINANCE",t[t.F16_LUMINANCE=ga(zn.F16,No.A,to.Luminance)]="F16_LUMINANCE",t[t.F32_LUMINANCE=ga(zn.F32,No.A,to.Luminance)]="F32_LUMINANCE",t[t.F16_R=ga(zn.F16,No.R,to.None)]="F16_R",t[t.F16_RG=ga(zn.F16,No.RG,to.None)]="F16_RG",t[t.F16_RGB=ga(zn.F16,No.RGB,to.None)]="F16_RGB",t[t.F16_RGBA=ga(zn.F16,No.RGBA,to.None)]="F16_RGBA",t[t.F32_R=ga(zn.F32,No.R,to.None)]="F32_R",t[t.F32_RG=ga(zn.F32,No.RG,to.None)]="F32_RG",t[t.F32_RGB=ga(zn.F32,No.RGB,to.None)]="F32_RGB",t[t.F32_RGBA=ga(zn.F32,No.RGBA,to.None)]="F32_RGBA",t[t.U8_R=ga(zn.U8,No.R,to.None)]="U8_R",t[t.U8_R_NORM=ga(zn.U8,No.R,to.Normalized)]="U8_R_NORM",t[t.U8_RG=ga(zn.U8,No.RG,to.None)]="U8_RG",t[t.U8_RG_NORM=ga(zn.U8,No.RG,to.Normalized)]="U8_RG_NORM",t[t.U8_RGB=ga(zn.U8,No.RGB,to.None)]="U8_RGB",t[t.U8_RGB_NORM=ga(zn.U8,No.RGB,to.Normalized)]="U8_RGB_NORM",t[t.U8_RGB_SRGB=ga(zn.U8,No.RGB,to.sRGB|to.Normalized)]="U8_RGB_SRGB",t[t.U8_RGBA=ga(zn.U8,No.RGBA,to.None)]="U8_RGBA",t[t.U8_RGBA_NORM=ga(zn.U8,No.RGBA,to.Normalized)]="U8_RGBA_NORM",t[t.U8_RGBA_SRGB=ga(zn.U8,No.RGBA,to.sRGB|to.Normalized)]="U8_RGBA_SRGB",t[t.U16_R=ga(zn.U16,No.R,to.None)]="U16_R",t[t.U16_R_NORM=ga(zn.U16,No.R,to.Normalized)]="U16_R_NORM",t[t.U16_RG_NORM=ga(zn.U16,No.RG,to.Normalized)]="U16_RG_NORM",t[t.U16_RGBA_NORM=ga(zn.U16,No.RGBA,to.Normalized)]="U16_RGBA_NORM",t[t.U16_RGBA=ga(zn.U16,No.RGBA,to.None)]="U16_RGBA",t[t.U16_RGB=ga(zn.U16,No.RGB,to.None)]="U16_RGB",t[t.U16_RG=ga(zn.U16,No.RG,to.None)]="U16_RG",t[t.U32_R=ga(zn.U32,No.R,to.None)]="U32_R",t[t.U32_RG=ga(zn.U32,No.RG,to.None)]="U32_RG",t[t.U32_RGB=ga(zn.U32,No.RGB,to.None)]="U32_RGB",t[t.U32_RGBA=ga(zn.U32,No.RGBA,to.None)]="U32_RGBA",t[t.S8_R=ga(zn.S8,No.R,to.None)]="S8_R",t[t.S8_R_NORM=ga(zn.S8,No.R,to.Normalized)]="S8_R_NORM",t[t.S8_RG_NORM=ga(zn.S8,No.RG,to.Normalized)]="S8_RG_NORM",t[t.S8_RGB_NORM=ga(zn.S8,No.RGB,to.Normalized)]="S8_RGB_NORM",t[t.S8_RGBA_NORM=ga(zn.S8,No.RGBA,to.Normalized)]="S8_RGBA_NORM",t[t.S16_R=ga(zn.S16,No.R,to.None)]="S16_R",t[t.S16_RG=ga(zn.S16,No.RG,to.None)]="S16_RG",t[t.S16_RG_NORM=ga(zn.S16,No.RG,to.Normalized)]="S16_RG_NORM",t[t.S16_RGB_NORM=ga(zn.S16,No.RGB,to.Normalized)]="S16_RGB_NORM",t[t.S16_RGBA=ga(zn.S16,No.RGBA,to.None)]="S16_RGBA",t[t.S16_RGBA_NORM=ga(zn.S16,No.RGBA,to.Normalized)]="S16_RGBA_NORM",t[t.S32_R=ga(zn.S32,No.R,to.None)]="S32_R",t[t.S32_RG=ga(zn.S32,No.RG,to.None)]="S32_RG",t[t.S32_RGB=ga(zn.S32,No.RGB,to.None)]="S32_RGB",t[t.S32_RGBA=ga(zn.S32,No.RGBA,to.None)]="S32_RGBA",t[t.U16_RGBA_5551=ga(zn.U16_PACKED_5551,No.RGBA,to.Normalized)]="U16_RGBA_5551",t[t.U16_RGB_565=ga(zn.U16_PACKED_565,No.RGB,to.Normalized)]="U16_RGB_565",t[t.BC1=ga(zn.BC1,No.RGBA,to.Normalized)]="BC1",t[t.BC1_SRGB=ga(zn.BC1,No.RGBA,to.Normalized|to.sRGB)]="BC1_SRGB",t[t.BC2=ga(zn.BC2,No.RGBA,to.Normalized)]="BC2",t[t.BC2_SRGB=ga(zn.BC2,No.RGBA,to.Normalized|to.sRGB)]="BC2_SRGB",t[t.BC3=ga(zn.BC3,No.RGBA,to.Normalized)]="BC3",t[t.BC3_SRGB=ga(zn.BC3,No.RGBA,to.Normalized|to.sRGB)]="BC3_SRGB",t[t.BC4_UNORM=ga(zn.BC4_UNORM,No.R,to.Normalized)]="BC4_UNORM",t[t.BC4_SNORM=ga(zn.BC4_SNORM,No.R,to.Normalized)]="BC4_SNORM",t[t.BC5_UNORM=ga(zn.BC5_UNORM,No.RG,to.Normalized)]="BC5_UNORM",t[t.BC5_SNORM=ga(zn.BC5_SNORM,No.RG,to.Normalized)]="BC5_SNORM",t[t.D24=ga(zn.D24,No.R,to.Depth)]="D24",t[t.D24_S8=ga(zn.D24S8,No.RG,to.Depth|to.Stencil)]="D24_S8",t[t.D32F=ga(zn.D32F,No.R,to.Depth)]="D32F",t[t.D32F_S8=ga(zn.D32FS8,No.RG,to.Depth|to.Stencil)]="D32F_S8",t[t.U8_RGB_RT=ga(zn.U8,No.RGB,to.RenderTarget|to.Normalized)]="U8_RGB_RT",t[t.U8_RGBA_RT=ga(zn.U8,No.RGBA,to.RenderTarget|to.Normalized)]="U8_RGBA_RT",t[t.U8_RGBA_RT_SRGB=ga(zn.U8,No.RGBA,to.RenderTarget|to.Normalized|to.sRGB)]="U8_RGBA_RT_SRGB"})(yr||(yr={}));function z1(t){return t>>>8&255}function ig(t){return t>>>16&255}function Y0(t){return t&255}function Q3(t){switch(t){case zn.F32:case zn.U32:case zn.S32:return 4;case zn.U16:case zn.S16:case zn.F16:return 2;case zn.U8:case zn.S8:return 1;default:throw new Error("whoops")}}function eS(t){return Q3(ig(t))}function o7(t){return z1(t)}function $I(t){var e=Q3(ig(t)),r=z1(t);return e*r}function a7(t,e){return t&4294967040|e}function s7(t,e){return t&4294902015|e<<8}function tS(t){var e=Y0(t);if(e&to.Depth)return Hh.Depth;if(e&to.Normalized)return Hh.Float;var r=ig(t);if(r===zn.F16||r===zn.F32)return Hh.Float;if(r===zn.U8||r===zn.U16||r===zn.U32)return Hh.Uint;if(r===zn.S8||r===zn.S16||r===zn.S32)return Hh.Sint;throw new Error("whoops")}function Cs(t,e){if(e===void 0&&(e=""),!t)throw new Error("Assert fail: ".concat(e))}function s0(t){if(t!=null)return t;throw new Error("Missing object")}function rS(t,e){return t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a}function nS(t,e){t.r=e.r,t.g=e.g,t.b=e.b,t.a=e.a}function iS(t){var e=t.r,r=t.g,n=t.b,a=t.a;return{r:e,g:r,b:n,a}}function b_(t,e,r,n){return n===void 0&&(n=1),{r:t,g:e,b:r,a:n}}var U1=b_(0,0,0,0),l7=b_(0,0,0,1),KI=b_(1,1,1,0),u7=b_(1,1,1,1),$0=!0;function c7(t,e){e===void 0&&(e=$0),e&&(t[10]=-t[10],t[14]=-t[14])}function h7(t,e){e===void 0&&(e=$0),e&&(t[10]=-t[10],t[14]=-t[14]+1)}function JI(t,e){if(e===void 0&&(e=$0),e)switch(t){case js.LESS:return js.GREATER;case js.LEQUAL:return js.GEQUAL;case js.GEQUAL:return js.LEQUAL;case js.GREATER:return js.LESS;default:return t}else return t}function p7(t,e){return e===void 0&&(e=$0),e?1-t:t}function f7(t,e){return e===void 0&&(e=$0),e?-t:t}function d7(t,e,r,n){if(n===void 0&&(n=$0),r=JI(r,n),r===js.LESS)return t<e;if(r===js.LEQUAL)return t<=e;if(r===js.GREATER)return t>e;if(r===js.GEQUAL)return t>=e;throw new Error("whoops")}function Z1(t){return!!(t&&!(t&t-1))}function K0(t,e){return t!=null?t:e}function QI(t){return t===void 0?null:t}function m7(t,e,r){t.length=e,t.fill(r)}function V1(t,e){var r=e-1;return t+r&~r}function g7(t,e){return((t+e-1)/e|0)*e}function e6(t,e,r){for(var n=0,a=t.length;n<a;){var u=n+(a-n>>>1),y=r(e,t[u]);y<0?a=u:n=u+1}return n}function v7(t,e,r){var n=e6(t,e,r);t.splice(n,0,e)}function _7(t,e,r){return r?t|=e:t&=~e,t}function t6(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=e();return r}function r6(t,e){e===void 0&&(e=1);var r=t.split(`
`);return r.map(function(n,a){return"".concat(n6(""+(e+a),4," ")," ").concat(n)}).join(`
`)}function n6(t,e,r){for(r===void 0&&(r="0");t.length<e;)t="".concat(r).concat(t);return t}function y7(t,e){for(var r=[],n=t;n<t+e;n++)r.push(n);return r}function oS(t,e){t.blendDstFactor=e.blendDstFactor,t.blendSrcFactor=e.blendSrcFactor,t.blendMode=e.blendMode}function j1(t,e){return t===void 0&&(t={}),t.compare=e.compare,t.depthFailOp=e.depthFailOp,t.passOp=e.passOp,t.failOp=e.failOp,t.mask=e.mask,t}function aS(t,e){return t===void 0&&(t={rgbBlendState:{},alphaBlendState:{},channelWriteMask:0}),oS(t.rgbBlendState,e.rgbBlendState),oS(t.alphaBlendState,e.alphaBlendState),t.channelWriteMask=e.channelWriteMask,t}function q2(t,e){t.length!==e.length&&(t.length=e.length);for(var r=0;r<e.length;r++)t[r]=aS(t[r],e[r])}function i6(t,e){e.attachmentsState!==void 0&&q2(t.attachmentsState,e.attachmentsState),t.blendConstant&&e.blendConstant&&nS(t.blendConstant,e.blendConstant),t.depthCompare=K0(e.depthCompare,t.depthCompare),t.depthWrite=K0(e.depthWrite,t.depthWrite),t.stencilWrite=K0(e.stencilWrite,t.stencilWrite),t.stencilFront&&e.stencilFront&&j1(t.stencilFront,e.stencilFront),t.stencilBack&&e.stencilBack&&j1(t.stencilBack,e.stencilBack),t.cullMode=K0(e.cullMode,t.cullMode),t.frontFace=K0(e.frontFace,t.frontFace),t.polygonOffset=K0(e.polygonOffset,t.polygonOffset)}function J0(t){var e=Object.assign({},t);return e.attachmentsState=[],q2(e.attachmentsState,t.attachmentsState),e.blendConstant=e.blendConstant&&iS(e.blendConstant),e.stencilFront=j1(void 0,t.stencilFront),e.stencilBack=j1(void 0,t.stencilBack),e}function o6(t,e){e.channelWriteMask!==void 0&&(t.channelWriteMask=e.channelWriteMask),e.rgbBlendMode!==void 0&&(t.rgbBlendState.blendMode=e.rgbBlendMode),e.alphaBlendMode!==void 0&&(t.alphaBlendState.blendMode=e.alphaBlendMode),e.rgbBlendSrcFactor!==void 0&&(t.rgbBlendState.blendSrcFactor=e.rgbBlendSrcFactor),e.alphaBlendSrcFactor!==void 0&&(t.alphaBlendState.blendSrcFactor=e.alphaBlendSrcFactor),e.rgbBlendDstFactor!==void 0&&(t.rgbBlendState.blendDstFactor=e.rgbBlendDstFactor),e.alphaBlendDstFactor!==void 0&&(t.alphaBlendState.blendDstFactor=e.alphaBlendDstFactor)}var sS={blendMode:If.ADD,blendSrcFactor:pl.ONE,blendDstFactor:pl.ZERO},l0={attachmentsState:[{channelWriteMask:Lf.ALL,rgbBlendState:sS,alphaBlendState:sS}],blendConstant:iS(U1),depthWrite:!0,depthCompare:js.LEQUAL,stencilWrite:!1,stencilFront:{compare:js.ALWAYS,passOp:jh.KEEP,depthFailOp:jh.KEEP,failOp:jh.KEEP},stencilBack:{compare:js.ALWAYS,passOp:jh.KEEP,depthFailOp:jh.KEEP,failOp:jh.KEEP},cullMode:Jd.NONE,frontFace:x_.CCW,polygonOffset:!1};function a6(t,e){t===void 0&&(t=null),e===void 0&&(e=l0);var r=J0(e);return t!==null&&i6(r,t),r}var x7=a6({depthCompare:js.ALWAYS,depthWrite:!1},l0);function b7(t,e){return t.attachmentsState===void 0&&(t.attachmentsState=[],q2(t.attachmentsState,l0.attachmentsState)),o6(t.attachmentsState[0],e),t}var lS={texture:null,sampler:null,formatKind:Hh.Float,dimension:rl.TEXTURE_2D};function Ng(t,e,r){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!r(t[n],e[n]))return!1;return!0}function Q0(t,e){for(var r=Array(t.length),n=0;n<t.length;n++)r[n]=e(t[n]);return r}function s6(t,e){return t.texture===e.texture&&t.binding===e.binding}function uS(t,e){return t.buffer===e.buffer&&t.size===e.size&&t.binding===e.binding&&t.offset===e.offset}function l6(t,e){return t===null?e===null:e===null?!1:t.sampler===e.sampler&&t.texture===e.texture&&t.dimension===e.dimension&&t.formatKind===e.formatKind&&t.comparison===e.comparison}function u6(t,e){return t.samplerBindings=t.samplerBindings||[],t.uniformBufferBindings=t.uniformBufferBindings||[],t.storageBufferBindings=t.storageBufferBindings||[],t.storageTextureBindings=t.storageTextureBindings||[],e.samplerBindings=e.samplerBindings||[],e.uniformBufferBindings=e.uniformBufferBindings||[],e.storageBufferBindings=e.storageBufferBindings||[],e.storageTextureBindings=e.storageTextureBindings||[],!(t.samplerBindings.length!==e.samplerBindings.length||!Ng(t.samplerBindings,e.samplerBindings,l6)||!Ng(t.uniformBufferBindings,e.uniformBufferBindings,uS)||!Ng(t.storageBufferBindings,e.storageBufferBindings,uS)||!Ng(t.storageTextureBindings,e.storageTextureBindings,s6))}function cS(t,e){return t.blendMode==e.blendMode&&t.blendSrcFactor===e.blendSrcFactor&&t.blendDstFactor===e.blendDstFactor}function c6(t,e){return!(!cS(t.rgbBlendState,e.rgbBlendState)||!cS(t.alphaBlendState,e.alphaBlendState)||t.channelWriteMask!==e.channelWriteMask)}function H1(t,e){return t.compare==e.compare&&t.depthFailOp===e.depthFailOp&&t.failOp===e.failOp&&t.passOp===e.passOp&&t.mask===e.mask}function h6(t,e){return!Ng(t.attachmentsState,e.attachmentsState,c6)||t.blendConstant&&e.blendConstant&&!rS(t.blendConstant,e.blendConstant)||t.stencilFront&&e.stencilFront&&!H1(t.stencilFront,e.stencilFront)||t.stencilBack&&e.stencilBack&&!H1(t.stencilBack,e.stencilBack)?!1:t.depthCompare===e.depthCompare&&t.depthWrite===e.depthWrite&&t.stencilWrite===e.stencilWrite&&t.cullMode===e.cullMode&&t.frontFace===e.frontFace&&t.polygonOffset===e.polygonOffset}function hS(t,e){return t.id===e.id}function p6(t,e){return t===e}function f6(t,e){return!(t.topology!==e.topology||t.inputLayout!==e.inputLayout||t.sampleCount!==e.sampleCount||t.megaStateDescriptor&&e.megaStateDescriptor&&!h6(t.megaStateDescriptor,e.megaStateDescriptor)||!hS(t.program,e.program)||!Ng(t.colorAttachmentFormats,e.colorAttachmentFormats,p6)||t.depthStencilAttachmentFormat!==e.depthStencilAttachmentFormat)}function d6(t,e){return t.offset===e.offset&&t.shaderLocation===e.shaderLocation&&t.format===e.format&&t.divisor===e.divisor}function m6(t,e){return(0,Dm.Z)(t)?(0,Dm.Z)(e):(0,Dm.Z)(e)?!1:t.arrayStride===e.arrayStride&&t.stepMode===e.stepMode&&Ng(t.attributes,e.attributes,d6)}function g6(t,e){return!(t.indexBufferFormat!==e.indexBufferFormat||!Ng(t.vertexBufferDescriptors,e.vertexBufferDescriptors,m6)||!hS(t.program,e.program))}function E7(t,e){return t.addressModeU===e.addressModeU&&t.addressModeV===e.addressModeV&&t.minFilter===e.minFilter&&t.magFilter===e.magFilter&&t.mipmapFilter===e.mipmapFilter&&t.lodMinClamp===e.lodMinClamp&&t.lodMaxClamp===e.lodMaxClamp&&t.maxAnisotropy===e.maxAnisotropy&&t.compareFunction===e.compareFunction}function v6(t){var e=t.sampler,r=t.texture,n=t.dimension,a=t.formatKind,u=t.comparison;return{sampler:e,texture:r,dimension:n,formatKind:a,comparison:u}}function pS(t){var e=t.buffer,r=t.size,n=t.binding,a=t.offset;return{binding:n,buffer:e,offset:a,size:r}}function _6(t){var e=t.binding,r=t.texture;return{binding:e,texture:r}}function y6(t){var e=t.samplerBindings&&Q0(t.samplerBindings,v6),r=t.uniformBufferBindings&&Q0(t.uniformBufferBindings,pS),n=t.storageBufferBindings&&Q0(t.storageBufferBindings,pS),a=t.storageTextureBindings&&Q0(t.storageTextureBindings,_6);return{samplerBindings:e,uniformBufferBindings:r,storageBufferBindings:n,storageTextureBindings:a,pipeline:t.pipeline}}function x6(t){var e=t.inputLayout,r=t.program,n=t.topology,a=t.megaStateDescriptor&&J0(t.megaStateDescriptor),u=t.colorAttachmentFormats.slice(),y=t.depthStencilAttachmentFormat,A=t.sampleCount;return{inputLayout:e,megaStateDescriptor:a,program:r,topology:n,colorAttachmentFormats:u,depthStencilAttachmentFormat:y,sampleCount:A}}function b6(t){var e=t.shaderLocation,r=t.format,n=t.offset,a=t.divisor;return{shaderLocation:e,format:r,offset:n,divisor:a}}function E6(t){if((0,Dm.Z)(t))return t;var e=t.arrayStride,r=t.stepMode,n=Q0(t.attributes,b6);return{arrayStride:e,stepMode:r,attributes:n}}function w6(t){var e=Q0(t.vertexBufferDescriptors,E6),r=t.indexBufferFormat,n=t.program;return{vertexBufferDescriptors:e,indexBufferFormat:r,program:n}}var bl,S6=/([^[]*)(\[[0-9]+\])?/;function T6(t){if(t[t.length-1]!=="]")return{name:t,length:1,isArray:!1};var e=t.match(S6);if(!e||e.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(t));return{name:e[1],length:Number(e[2])||1,isArray:!!e[2]}}function Ld(){var t=null;return function(e,r,n){var a=t!==n;return a&&(e.uniform1i(r,n),t=n),a}}function Gh(t,e,r,n){var a=null,u=null;return function(y,A,O){var Z=e(O,r),Y=Z.length,Q=!1;if(a===null)a=new Float32Array(Y),u=Y,Q=!0;else{Cs(u===Y,"Uniform length cannot change.");for(var ae=0;ae<Y;++ae)if(Z[ae]!==a[ae]){Q=!0;break}}return Q&&(n(y,t,A,Z),a.set(Z)),Q}}function gd(t,e,r,n){t[e](r,n)}function Tg(t,e,r,n){t[e](r,!1,n)}var A6={},C6={},M6={},fS=[0];function Y2(t,e,r,n){e===1&&typeof t=="boolean"&&(t=t?1:0),Number.isFinite(t)&&(fS[0]=t,t=fS);var a=t.length;if(t instanceof r)return t;var u=n[a];u||(u=new r(a),n[a]=u);for(var y=0;y<a;y++)u[y]=t[y];return u}function gm(t,e){return Y2(t,e,Float32Array,A6)}function zg(t,e){return Y2(t,e,Int32Array,C6)}function G1(t,e){return Y2(t,e,Uint32Array,M6)}var P6=(bl={},bl[qt.FLOAT]=Gh.bind(null,"uniform1fv",gm,1,gd),bl[qt.FLOAT_VEC2]=Gh.bind(null,"uniform2fv",gm,2,gd),bl[qt.FLOAT_VEC3]=Gh.bind(null,"uniform3fv",gm,3,gd),bl[qt.FLOAT_VEC4]=Gh.bind(null,"uniform4fv",gm,4,gd),bl[qt.INT]=Gh.bind(null,"uniform1iv",zg,1,gd),bl[qt.INT_VEC2]=Gh.bind(null,"uniform2iv",zg,2,gd),bl[qt.INT_VEC3]=Gh.bind(null,"uniform3iv",zg,3,gd),bl[qt.INT_VEC4]=Gh.bind(null,"uniform4iv",zg,4,gd),bl[qt.BOOL]=Gh.bind(null,"uniform1iv",zg,1,gd),bl[qt.BOOL_VEC2]=Gh.bind(null,"uniform2iv",zg,2,gd),bl[qt.BOOL_VEC3]=Gh.bind(null,"uniform3iv",zg,3,gd),bl[qt.BOOL_VEC4]=Gh.bind(null,"uniform4iv",zg,4,gd),bl[qt.FLOAT_MAT2]=Gh.bind(null,"uniformMatrix2fv",gm,4,Tg),bl[qt.FLOAT_MAT3]=Gh.bind(null,"uniformMatrix3fv",gm,9,Tg),bl[qt.FLOAT_MAT4]=Gh.bind(null,"uniformMatrix4fv",gm,16,Tg),bl[qt.UNSIGNED_INT]=Gh.bind(null,"uniform1uiv",G1,1,gd),bl[qt.UNSIGNED_INT_VEC2]=Gh.bind(null,"uniform2uiv",G1,2,gd),bl[qt.UNSIGNED_INT_VEC3]=Gh.bind(null,"uniform3uiv",G1,3,gd),bl[qt.UNSIGNED_INT_VEC4]=Gh.bind(null,"uniform4uiv",G1,4,gd),bl[qt.FLOAT_MAT2x3]=Gh.bind(null,"uniformMatrix2x3fv",gm,6,Tg),bl[qt.FLOAT_MAT2x4]=Gh.bind(null,"uniformMatrix2x4fv",gm,8,Tg),bl[qt.FLOAT_MAT3x2]=Gh.bind(null,"uniformMatrix3x2fv",gm,6,Tg),bl[qt.FLOAT_MAT3x4]=Gh.bind(null,"uniformMatrix3x4fv",gm,12,Tg),bl[qt.FLOAT_MAT4x2]=Gh.bind(null,"uniformMatrix4x2fv",gm,8,Tg),bl[qt.FLOAT_MAT4x3]=Gh.bind(null,"uniformMatrix4x3fv",gm,12,Tg),bl[qt.SAMPLER_2D]=Ld,bl[qt.SAMPLER_CUBE]=Ld,bl[qt.SAMPLER_3D]=Ld,bl[qt.SAMPLER_2D_SHADOW]=Ld,bl[qt.SAMPLER_2D_ARRAY]=Ld,bl[qt.SAMPLER_2D_ARRAY_SHADOW]=Ld,bl[qt.SAMPLER_CUBE_SHADOW]=Ld,bl[qt.INT_SAMPLER_2D]=Ld,bl[qt.INT_SAMPLER_3D]=Ld,bl[qt.INT_SAMPLER_CUBE]=Ld,bl[qt.INT_SAMPLER_2D_ARRAY]=Ld,bl[qt.UNSIGNED_INT_SAMPLER_2D]=Ld,bl[qt.UNSIGNED_INT_SAMPLER_3D]=Ld,bl[qt.UNSIGNED_INT_SAMPLER_CUBE]=Ld,bl[qt.UNSIGNED_INT_SAMPLER_2D_ARRAY]=Ld,bl);function dS(t,e,r){var n=P6[r.type];if(!n)throw new Error("Unknown GLSL uniform type ".concat(r.type));return n().bind(null,t,e)}var R6={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121};function I6(t){return Object.prototype.toString.call(t)in R6}function E_(t,e){return"#define ".concat(t," ").concat(e)}function L6(t){var e={};return t.replace(/^\s*#define\s*(\S*)\s*(\S*)\s*$/gm,function(r,n,a){var u=Number(a);return e[n]=isNaN(u)?a:u,""}),e}function D6(t,e){var r=[];return t.replace(/^\s*layout\(location\s*=\s*(\S*)\)\s*in\s+\S+\s*(.*);$/gm,function(n,a,u){var y=Number(a);return r.push({location:isNaN(y)?e[a]:y,name:u}),""}),r}function w7(t){var e=[],r=[];return t.replace(/\s*struct\s*(.*)\s*{((?:\s*.*\s*)*?)};/g,function(n,a,u){var y=[];return u.trim().replace(`\r
`,`
`).split(`
`).forEach(function(A){var O=__read(A.trim().split(/\s+/),2),Z=O[0],Y=O[1];y.push({type:Z.trim(),name:Y.replace(";","").trim()})}),r.push({type:a.trim(),uniforms:y}),""}),t.replace(/\s*uniform(?:\s+)(?:\w+)(?:\s?){([^]*?)};?/g,function(n,a){return a.trim().replace(`\r
`,`
`).split(`
`).forEach(function(u){var y=u.trim().split(" "),A=y[0]||"",O=y[1]||"",Z=O.indexOf("[")>-1;if(O=O.replace(";","").replace("[","").trim(),!A.startsWith("#")){if(A){var Y=r.find(function(xe){return A===xe.type});if(Y)if(Z)for(var Q=function(xe){Y.uniforms.forEach(function(Be){e.push("".concat(O,"[").concat(xe,"].").concat(Be.name))})},ae=0;ae<5;ae++)Q(ae);else Y.uniforms.forEach(function(xe){e.push("".concat(O,".").concat(xe.name))})}O&&e.push(O)}}),""}),e}function mS(t){if(t===void 0)return null;var e=/binding\s*=\s*(\d+)/.exec(t);if(e!==null){var r=parseInt(e[1],10);if(!Number.isNaN(r))return r}return null}function gS(t){var e="",r=t;return[r,e]}function Ug(t,e,r,n,a){var u;n===void 0&&(n=null),a===void 0&&(a=!0);var y=t.glslVersion==="#version 100",A=e==="frag"&&((u=r.match(/^\s*layout\(location\s*=\s*\d*\)\s*out\s+vec4\s*(.*);$/gm))===null||u===void 0?void 0:u.length)>1,O=r.replace(`\r
`,`
`).split(`
`).map(function(cn){return cn.replace(/[/][/].*$/,"")}).filter(function(cn){var Gr=!cn||/^\s+$/.test(cn);return!Gr}),Z="";n!==null&&(Z=Object.keys(n).map(function(cn){return E_(cn,n[cn])}).join(`
`));var Y=O.find(function(cn){return cn.startsWith("precision")})||"precision mediump float;",Q=a?O.filter(function(cn){return!cn.startsWith("precision")}).join(`
`):O.join(`
`),ae="";if(t.viewportOrigin===ng.UPPER_LEFT&&(ae+="".concat(E_("VIEWPORT_ORIGIN_TL","1"),`
`)),t.clipSpaceNearZ===q0.ZERO&&(ae+="".concat(E_("CLIPSPACE_NEAR_ZERO","1"),`
`)),t.explicitBindingLocations){var xe=0,Be=0,it=0;Q=Q.replace(/^\s*(layout\((.*)\))?\s*uniform(.+{)$/gm,function(cn,Gr,Pn,Oo){var Da=Pn?"".concat(Pn,", "):"";return"layout(".concat(Da,"set = ").concat(xe,", binding = ").concat(Be++,") uniform ").concat(Oo)}),xe++,Be=0,Cs(t.separateSamplerTextures),Q=Q.replace(/^\s*(layout\((.*)\))?\s*uniform sampler(\w+) (.*);/gm,function(cn,Gr,Pn,Oo,Da){var Bo=mS(Pn);Bo===null&&(Bo=Be++);var Oa=(0,wo.__read)(gS(Oo),2),fl=Oa[0],Gp=Oa[1];return e==="frag"?`
layout(set = `.concat(xe,", binding = ").concat(Bo*2+0,") uniform texture").concat(fl," T_").concat(Da,`;
layout(set = `).concat(xe,", binding = ").concat(Bo*2+1,") uniform sampler").concat(Gp," S_").concat(Da,";").trim():""}),Q=Q.replace(e==="frag"?/^\s*\b(varying|in)\b/gm:/^\s*\b(varying|out)\b/gm,function(cn,Gr){return"layout(location = ".concat(it++,") ").concat(Gr)}),ae+="".concat(E_("gl_VertexID","gl_VertexIndex"),`
`),ae+="".concat(E_("gl_InstanceID","gl_InstanceIndex"),`
`),Y=Y.replace(/^precision (.*) sampler(.*);$/gm,"")}else{var gt=0;Q=Q.replace(/^\s*(layout\((.*)\))?\s*uniform sampler(\w+) (.*);/gm,function(cn,Gr,Pn,Oo,Da){var Bo=mS(Pn);return Bo===null&&(Bo=gt++),"uniform sampler".concat(Oo," ").concat(Da,"; // BINDING=").concat(Bo)})}if(Q=Q.replace(/\bPU_SAMPLER_(\w+)\((.*?)\)/g,function(cn,Gr,Pn){return"SAMPLER_".concat(Gr,"(P_").concat(Pn,")")}),Q=Q.replace(/\bPF_SAMPLER_(\w+)\((.*?)\)/g,function(cn,Gr,Pn){return"PP_SAMPLER_".concat(Gr,"(P_").concat(Pn,")")}),Q=Q.replace(/\bPU_TEXTURE\((.*?)\)/g,function(cn,Gr){return"TEXTURE(P_".concat(Gr,")")}),t.separateSamplerTextures)Q=Q.replace(/\bPD_SAMPLER_(\w+)\((.*?)\)/g,function(cn,Gr,Pn){var Oo=(0,wo.__read)(gS(Gr),2),Da=Oo[0],Bo=Oo[1];return"texture".concat(Da," T_P_").concat(Pn,", sampler").concat(Bo," S_P_").concat(Pn)}),Q=Q.replace(/\bPP_SAMPLER_(\w+)\((.*?)\)/g,function(cn,Gr,Pn){return"T_".concat(Pn,", S_").concat(Pn)}),Q=Q.replace(/\bSAMPLER_(\w+)\((.*?)\)/g,function(cn,Gr,Pn){return"sampler".concat(Gr,"(T_").concat(Pn,", S_").concat(Pn,")")}),Q=Q.replace(/\bTEXTURE\((.*?)\)/g,function(cn,Gr){return"T_".concat(Gr)});else{var Bt=[];Q=Q.replace(/\bPD_SAMPLER_(\w+)\((.*?)\)/g,function(cn,Gr,Pn){return"sampler".concat(Gr," P_").concat(Pn)}),Q=Q.replace(/\bPP_SAMPLER_(\w+)\((.*?)\)/g,function(cn,Gr,Pn){return Pn}),Q=Q.replace(/\bSAMPLER_(\w+)\((.*?)\)/g,function(cn,Gr,Pn){return Bt.push([Pn,Gr]),Pn}),y&&Bt.forEach(function(cn){var Gr=(0,wo.__read)(cn,2),Pn=Gr[0],Oo=Gr[1];Q=Q.replace(new RegExp("texture\\(".concat(Pn),"g"),function(){return"texture".concat(Oo,"(").concat(Pn)})}),Q=Q.replace(/\bTEXTURE\((.*?)\)/g,function(cn,Gr){return Gr})}var Rt="".concat(y?"":t.glslVersion,`
`).concat(y&&A?`#extension GL_EXT_draw_buffers : require
`:"",`
`).concat(y&&e==="frag"?`#extension GL_OES_standard_derivatives : enable
`:"").concat(a?Y:"",`
`).concat(ae||"").concat(Z?Z+`
`:"",`
`).concat(Q,`
`).trim();if(t.explicitBindingLocations&&e==="frag"&&(Rt=Rt.replace(/^\b(out)\b/g,function(cn,Gr){return"layout(location = 0) ".concat(Gr)})),y){if(e==="frag"&&(Rt=Rt.replace(/^\s*in\s+(\S+)\s*(.*);$/gm,function(cn,Gr,Pn){return"varying ".concat(Gr," ").concat(Pn,`;
`)})),e==="vert"&&(Rt=Rt.replace(/^\s*out\s+(\S+)\s*(.*);$/gm,function(cn,Gr,Pn){return"varying ".concat(Gr," ").concat(Pn,`;
`)}),Rt=Rt.replace(/^\s*layout\(location\s*=\s*\S*\)\s*in\s+(\S+)\s*(.*);$/gm,function(cn,Gr,Pn){return"attribute ".concat(Gr," ").concat(Pn,`;
`)})),Rt=Rt.replace(/\s*uniform\s*.*\s*{((?:\s*.*\s*)*?)};/g,function(cn,Gr){return Gr.trim().replace(/^.*$/gm,function(Pn){var Oo=Pn.trim();return Oo.startsWith("#")?Oo:Pn?"uniform ".concat(Oo):""})}),e==="frag")if(A){var Yt=[];Rt=Rt.replace(/^\s*layout\(location\s*=\s*\d*\)\s*out\s+vec4\s*(.*);$/gm,function(cn,Gr){return Yt.push(Gr),"vec4 ".concat(Gr,`;
`)});var vr=Rt.lastIndexOf("}");Rt=Rt.substring(0,vr)+`
`.concat(Yt.map(function(cn,Gr){return"gl_FragData[".concat(Gr,"] = ").concat(cn,`;
`)}).join(`
`))+Rt.substring(vr)}else{var ln;if(Rt=Rt.replace(/^\s*out\s+(\S+)\s*(.*);$/gm,function(cn,Gr,Pn){return ln=Pn,"".concat(Gr," ").concat(Pn,`;
`)}),ln){var vr=Rt.lastIndexOf("}");Rt=Rt.substring(0,vr)+`
gl_FragColor = vec4(`.concat(ln,`);
`)+Rt.substring(vr)}}Rt=Rt.replace(/^\s*layout\((.*)\)/gm,"")}return Rt}function S7(t,e,r,n){n===void 0&&(n=null);var a=Ug(t,"vert",e,n),u=Ug(t,"frag",r,n);return{vert:e,frag:r,preprocessedVert:a,preprocessedFrag:u}}var Om=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=t.call(this)||this;return u.id=n,u.device=a,u.device.resourceCreationTracker!==null&&u.device.resourceCreationTracker.trackResourceCreated(u),u}return e.prototype.destroy=function(){this.device.resourceCreationTracker!==null&&this.device.resourceCreationTracker.trackResourceDestroyed(this)},e}(K3),O6=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=t.call(this,{id:n,device:a})||this;y.type=Jl.Bindings;var A=u.uniformBufferBindings,O=u.samplerBindings;return y.uniformBufferBindings=A||[],y.samplerBindings=O||[],y.bindingLayouts=y.createBindingLayouts(),y}return e.prototype.createBindingLayouts=function(){var r=0,n=0,a=[],u=this.uniformBufferBindings.length,y=this.samplerBindings.length;return a.push({firstUniformBuffer:r,numUniformBuffers:u,firstSampler:n,numSamplers:y}),r+=u,n+=y,{numUniformBuffers:r,numSamplers:n,bindingLayoutTables:a}},e}(Om);function ea(t){return typeof WebGL2RenderingContext!="undefined"&&t instanceof WebGL2RenderingContext?!0:!!(t&&t._version===2)}function vS(t){var e=ig(t);switch(e){case zn.BC1:case zn.BC2:case zn.BC3:case zn.BC4_UNORM:case zn.BC4_SNORM:case zn.BC5_UNORM:case zn.BC5_SNORM:return!0;default:return!1}}function _S(t){var e=Y0(t);if(e&to.Normalized)return!1;var r=ig(t);return r===zn.S8||r===zn.S16||r===zn.S32||r===zn.U8||r===zn.U16||r===zn.U32}function B6(t){switch(t){case Gm.STATIC:return qt.STATIC_DRAW;case Gm.DYNAMIC:return qt.DYNAMIC_DRAW}}function yS(t){if(t&ac.INDEX)return qt.ELEMENT_ARRAY_BUFFER;if(t&ac.VERTEX)return qt.ARRAY_BUFFER;if(t&ac.UNIFORM)return qt.UNIFORM_BUFFER}function F6(t){switch(t){case Ip.TRIANGLES:return qt.TRIANGLES;case Ip.POINTS:return qt.POINTS;case Ip.TRIANGLE_STRIP:return qt.TRIANGLE_STRIP;case Ip.LINES:return qt.LINES;case Ip.LINE_STRIP:return qt.LINE_STRIP;default:throw new Error("Unknown primitive topology mode")}}function k6(t){switch(t){case zn.U8:return qt.UNSIGNED_BYTE;case zn.U16:return qt.UNSIGNED_SHORT;case zn.U32:return qt.UNSIGNED_INT;case zn.S8:return qt.BYTE;case zn.S16:return qt.SHORT;case zn.S32:return qt.INT;case zn.F16:return qt.HALF_FLOAT;case zn.F32:return qt.FLOAT;default:throw new Error("whoops")}}function N6(t){switch(t){case No.R:return 1;case No.RG:return 2;case No.RGB:return 3;case No.RGBA:return 4;default:return 1}}function z6(t){var e=ig(t),r=z1(t),n=Y0(t),a=k6(e),u=N6(r),y=!!(n&to.Normalized);return{size:u,type:a,normalized:y}}function U6(t){switch(t){case yr.U8_R:return qt.UNSIGNED_BYTE;case yr.U16_R:return qt.UNSIGNED_SHORT;case yr.U32_R:return qt.UNSIGNED_INT;default:throw new Error("whoops")}}function w_(t){switch(t){case Id.CLAMP_TO_EDGE:return qt.CLAMP_TO_EDGE;case Id.REPEAT:return qt.REPEAT;case Id.MIRRORED_REPEAT:return qt.MIRRORED_REPEAT;default:throw new Error("whoops")}}function W1(t,e){if(e===df.LINEAR&&t===pp.BILINEAR)return qt.LINEAR_MIPMAP_LINEAR;if(e===df.LINEAR&&t===pp.POINT)return qt.NEAREST_MIPMAP_LINEAR;if(e===df.NEAREST&&t===pp.BILINEAR)return qt.LINEAR_MIPMAP_NEAREST;if(e===df.NEAREST&&t===pp.POINT)return qt.NEAREST_MIPMAP_NEAREST;if(e===df.NO_MIP&&t===pp.BILINEAR)return qt.LINEAR;if(e===df.NO_MIP&&t===pp.POINT)return qt.NEAREST;throw new Error("Unknown texture filter mode")}function ev(t,e){e===void 0&&(e=0);var r=t;return r.gl_buffer_pages[e/r.pageByteSize|0]}function tv(t){var e=t;return e.gl_texture}function $2(t){var e=t;return e.gl_sampler}function S_(t,e){t.name=e,t.__SPECTOR_Metadata={name:e}}function xS(t,e){for(var r=[];;){var n=e.exec(t);if(!n)break;r.push(n)}return r}function Zg(t){return t.blendMode==If.ADD&&t.blendSrcFactor==pl.ONE&&t.blendDstFactor===pl.ZERO}function Z6(t){switch(t){case N1.OcclusionConservative:return qt.ANY_SAMPLES_PASSED_CONSERVATIVE;default:throw new Error("whoops")}}function V6(t){if(t===rl.TEXTURE_2D)return qt.TEXTURE_2D;if(t===rl.TEXTURE_2D_ARRAY)return qt.TEXTURE_2D_ARRAY;if(t===rl.TEXTURE_CUBE_MAP)return qt.TEXTURE_CUBE_MAP;if(t===rl.TEXTURE_3D)return qt.TEXTURE_3D;throw new Error("whoops")}function K2(t,e,r,n){return!(t%r!==0||e%n!==0)}var j6=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=t.call(this,{id:n,device:a})||this;y.type=Jl.Buffer;var A=u.viewOrSize,O=u.usage,Z=u.hint,Y=Z===void 0?Gm.STATIC:Z,Q=a.uniformBufferMaxPageByteSize,ae=a.gl,xe=O&ac.UNIFORM;xe||(ea(ae)?ae.bindVertexArray(null):a.OES_vertex_array_object.bindVertexArrayOES(null));var Be=(0,X0.Z)(A)?V1(A,4):V1(A.byteLength,4);y.gl_buffer_pages=[];var it;if(xe){for(var gt=Be;gt>0;)y.gl_buffer_pages.push(y.createBufferPage(Math.min(gt,Q),O,Y)),gt-=Q;it=Q}else y.gl_buffer_pages.push(y.createBufferPage(Be,O,Y)),it=Be;return y.pageByteSize=it,y.byteSize=Be,y.usage=O,y.gl_target=yS(O),(0,X0.Z)(A)||y.setSubData(0,new Uint8Array(A.buffer)),xe||(ea(ae)?ae.bindVertexArray(y.device.currentBoundVAO):a.OES_vertex_array_object.bindVertexArrayOES(y.device.currentBoundVAO)),y}return e.prototype.setSubData=function(r,n,a,u){a===void 0&&(a=0),u===void 0&&(u=n.byteLength-a);for(var y=this.device.gl,A=this.pageByteSize,O=r+u,Z=r,Y=r%A;Z<O;){var Q=ea(y)?y.COPY_WRITE_BUFFER:this.gl_target,ae=ev(this,Z);if(ae.ubo)return;y.bindBuffer(Q,ae),ea(y)?y.bufferSubData(Q,Y,n,a,Math.min(O-Z,A)):y.bufferSubData(Q,Y,n),Z+=A,Y=0,a+=A,this.device.debugGroupStatisticsBufferUpload()}},e.prototype.destroy=function(){t.prototype.destroy.call(this);for(var r=0;r<this.gl_buffer_pages.length;r++)this.gl_buffer_pages[r].ubo||this.device.gl.deleteBuffer(this.gl_buffer_pages[r]);this.gl_buffer_pages=[]},e.prototype.createBufferPage=function(r,n,a){var u=this.device.gl,y=n&ac.UNIFORM;if(!ea(u)&&y)return{ubo:!0};var A=this.device.ensureResourceExists(u.createBuffer()),O=yS(n),Z=B6(a);return u.bindBuffer(O,A),u.bufferData(O,r,Z),A},e}(Om),H6=function(t){(0,wo.__extends)(e,t);function e(r){var n,a,u,y,A=r.id,O=r.device,Z=r.descriptor,Y,Q=t.call(this,{id:A,device:O})||this;Q.type=Jl.InputLayout;var ae=Z.vertexBufferDescriptors,xe=Z.indexBufferFormat,Be=Z.program;Cs(xe===yr.U16_R||xe===yr.U32_R||xe===null);var it=xe!==null?U6(xe):null,gt=xe!==null?eS(xe):null,Bt=Q.device.gl,Rt=Q.device.ensureResourceExists(ea(Bt)?Bt.createVertexArray():O.OES_vertex_array_object.createVertexArrayOES());ea(Bt)?Bt.bindVertexArray(Rt):O.OES_vertex_array_object.bindVertexArrayOES(Rt),Bt.bindBuffer(Bt.ARRAY_BUFFER,ev(Q.device.fallbackVertexBuffer));try{for(var Yt=(0,wo.__values)(Z.vertexBufferDescriptors),vr=Yt.next();!vr.done;vr=Yt.next()){var ln=vr.value,cn=ln.stepMode,Gr=ln.attributes;try{for(var Pn=(u=void 0,(0,wo.__values)(Gr)),Oo=Pn.next();!Oo.done;Oo=Pn.next()){var Da=Oo.value,Bo=Da.shaderLocation,Oa=Da.format,fl=Da.divisor,Gp=fl===void 0?1:fl,Wp=ea(Bt)?Bo:(Y=Be.attributes[Bo])===null||Y===void 0?void 0:Y.location,nl=z6(Oa);if(Da.vertexFormat=nl,!(0,Dm.Z)(Wp)){_S(Oa);var Df=nl.size,Xm=nl.type,vd=nl.normalized;Bt.vertexAttribPointer(Wp,Df,Xm,vd,0,0),cn===a0.INSTANCE&&(ea(Bt)?Bt.vertexAttribDivisor(Wp,Gp):O.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(Wp,Gp)),Bt.enableVertexAttribArray(Wp)}}}catch(I_){u={error:I_}}finally{try{Oo&&!Oo.done&&(y=Pn.return)&&y.call(Pn)}finally{if(u)throw u.error}}}}catch(I_){n={error:I_}}finally{try{vr&&!vr.done&&(a=Yt.return)&&a.call(Yt)}finally{if(n)throw n.error}}return ea(Bt)?Bt.bindVertexArray(null):O.OES_vertex_array_object.bindVertexArrayOES(null),Q.vertexBufferDescriptors=ae,Q.vao=Rt,Q.indexBufferFormat=xe,Q.indexBufferType=it,Q.indexBufferCompByteSize=gt,Q.program=Be,Q}return e.prototype.destroy=function(){t.prototype.destroy.call(this),this.device.currentBoundVAO===this.vao&&(ea(this.device.gl)?(this.device.gl.bindVertexArray(null),this.device.gl.deleteVertexArray(this.vao)):(this.device.OES_vertex_array_object.bindVertexArrayOES(null),this.device.OES_vertex_array_object.deleteVertexArrayOES(this.vao)),this.device.currentBoundVAO=null)},e}(Om),J2=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=r.fake,A=t.call(this,{id:n,device:a})||this;A.type=Jl.Texture,u=(0,wo.__assign)({dimension:rl.TEXTURE_2D,depthOrArrayLayers:1,mipLevelCount:1},u);var O=A.device.gl,Z,Y,Q=A.clampmipLevelCount(u);if(A.immutable=u.usage===ad.RENDER_TARGET,A.pixelStore=u.pixelStore,A.format=u.format,A.dimension=u.dimension,A.formatKind=tS(u.format),A.width=u.width,A.height=u.height,A.depthOrArrayLayers=u.depthOrArrayLayers,A.mipmaps=Q>=1,!y){Y=A.device.ensureResourceExists(O.createTexture());var ae=A.device.translateTextureType(u.format),xe=A.device.translateTextureInternalFormat(u.format);if(A.device.setActiveTexture(O.TEXTURE0),A.device.currentTextures[0]=null,A.preprocessImage(),u.dimension===rl.TEXTURE_2D){if(Z=qt.TEXTURE_2D,O.bindTexture(Z,Y),A.immutable)if(ea(O))O.texStorage2D(Z,Q,xe,u.width,u.height);else{var Be=(xe===qt.DEPTH_COMPONENT||A.isNPOT(),0);(A.format===yr.D32F||A.format===yr.D24_S8)&&!ea(O)&&!a.WEBGL_depth_texture||(O.texImage2D(Z,Be,xe,u.width,u.height,0,xe,ae,null),A.mipmaps&&(A.mipmaps=!1,O.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_MIN_FILTER,qt.LINEAR),O.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_WRAP_S,qt.CLAMP_TO_EDGE),O.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_WRAP_T,qt.CLAMP_TO_EDGE)))}Cs(u.depthOrArrayLayers===1)}else if(u.dimension===rl.TEXTURE_2D_ARRAY)Z=qt.TEXTURE_2D_ARRAY,O.bindTexture(Z,Y),A.immutable&&ea(O)&&O.texStorage3D(Z,Q,xe,u.width,u.height,u.depthOrArrayLayers);else if(u.dimension===rl.TEXTURE_3D)Z=qt.TEXTURE_3D,O.bindTexture(Z,Y),A.immutable&&ea(O)&&O.texStorage3D(Z,Q,xe,u.width,u.height,u.depthOrArrayLayers);else if(u.dimension===rl.TEXTURE_CUBE_MAP)Z=qt.TEXTURE_CUBE_MAP,O.bindTexture(Z,Y),A.immutable&&ea(O)&&O.texStorage2D(Z,Q,xe,u.width,u.height),Cs(u.depthOrArrayLayers===6);else throw new Error("whoops")}return A.gl_texture=Y,A.gl_target=Z,A.mipLevelCount=Q,A}return e.prototype.setImageData=function(r,n){n===void 0&&(n=0);var a=this.device.gl;vS(this.format);var u=this.gl_target===qt.TEXTURE_3D||this.gl_target===qt.TEXTURE_2D_ARRAY,y=this.gl_target===qt.TEXTURE_CUBE_MAP,A=I6(r[0]);this.device.setActiveTexture(a.TEXTURE0),this.device.currentTextures[0]=null;var O=r[0],Z,Y;A?(Z=this.width,Y=this.height):(Z=O.width,Y=O.height,this.width=Z,this.height=Y),a.bindTexture(this.gl_target,this.gl_texture);var Q=this.device.translateTextureFormat(this.format),ae=ea(a)?this.device.translateInternalTextureFormat(this.format):Q,xe=this.device.translateTextureType(this.format);this.preprocessImage();for(var Be=0;Be<this.depthOrArrayLayers;Be++){var it=r[Be],gt=this.gl_target;y&&(gt=qt.TEXTURE_CUBE_MAP_POSITIVE_X+Be%6),this.immutable?a.texSubImage2D(gt,n,0,0,Z,Y,Q,xe,it):ea(a)?u?a.texImage3D(gt,n,ae,Z,Y,this.depthOrArrayLayers,0,Q,xe,it):a.texImage2D(gt,n,ae,Z,Y,0,Q,xe,it):A?a.texImage2D(gt,n,Q,Z,Y,0,Q,xe,it):a.texImage2D(gt,n,Q,Q,xe,it)}this.mipmaps&&this.generateMipmap(u)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.device.gl.deleteTexture(tv(this))},e.prototype.clampmipLevelCount=function(r){if(r.dimension===rl.TEXTURE_2D_ARRAY&&r.depthOrArrayLayers>1){var n=ig(r.format);if(n===zn.BC1)for(var a=r.width,u=r.height,y=0;y<r.mipLevelCount;y++){if(a<=2||u<=2)return y-1;a=Math.max(a/2|0,1),u=Math.max(u/2|0,1)}}return r.mipLevelCount},e.prototype.preprocessImage=function(){var r=this.device.gl;this.pixelStore&&(this.pixelStore.unpackFlipY&&r.pixelStorei(qt.UNPACK_FLIP_Y_WEBGL,!0),this.pixelStore.packAlignment&&r.pixelStorei(qt.PACK_ALIGNMENT,this.pixelStore.packAlignment),this.pixelStore.unpackAlignment&&r.pixelStorei(qt.UNPACK_ALIGNMENT,this.pixelStore.unpackAlignment))},e.prototype.generateMipmap=function(r){r===void 0&&(r=!1);var n=this.device.gl;return!ea(n)&&this.isNPOT()?this:(this.gl_texture&&this.gl_target&&(n.bindTexture(this.gl_target,this.gl_texture),r?(n.texParameteri(this.gl_target,qt.TEXTURE_BASE_LEVEL,0),n.texParameteri(this.gl_target,qt.TEXTURE_MAX_LEVEL,Math.log2(this.width)),n.texParameteri(this.gl_target,qt.TEXTURE_MIN_FILTER,qt.LINEAR_MIPMAP_LINEAR),n.texParameteri(this.gl_target,qt.TEXTURE_MAG_FILTER,qt.LINEAR)):n.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_MIN_FILTER,qt.NEAREST_MIPMAP_LINEAR),n.generateMipmap(this.gl_target),n.bindTexture(this.gl_target,null)),this)},e.prototype.isNPOT=function(){var r=this.device.gl;return ea(r)?!1:!Z1(this.width)||!Z1(this.height)},e}(Om),G6=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=t.call(this,{id:n,device:a})||this;y.type=Jl.RenderTarget,y.gl_renderbuffer=null,y.texture=null;var A=y.device.gl,O=u.format,Z=u.width,Y=u.height,Q=u.sampleCount,ae=Q===void 0?1:Q,xe=u.texture,Be=!1;if((O===yr.D32F||O===yr.D24_S8)&&xe&&!ea(A)&&!a.WEBGL_depth_texture&&(xe.destroy(),y.texture=null,Be=!0),!Be&&xe)y.texture=xe;else{y.gl_renderbuffer=y.device.ensureResourceExists(A.createRenderbuffer()),A.bindRenderbuffer(A.RENDERBUFFER,y.gl_renderbuffer);var it=y.device.translateTextureInternalFormat(O,!0);ea(A)&&ae>1?A.renderbufferStorageMultisample(qt.RENDERBUFFER,ae,it,Z,Y):A.renderbufferStorage(qt.RENDERBUFFER,it,Z,Y)}return y.format=O,y.width=Z,y.height=Y,y.sampleCount=ae,y}return e.prototype.destroy=function(){t.prototype.destroy.call(this),this.gl_renderbuffer!==null&&this.device.gl.deleteRenderbuffer(this.gl_renderbuffer),this.texture&&this.texture.destroy()},e}(Om),Qd;(function(t){t[t.NeedsCompile=0]="NeedsCompile",t[t.Compiling=1]="Compiling",t[t.NeedsBind=2]="NeedsBind",t[t.ReadyToUse=3]="ReadyToUse"})(Qd||(Qd={}));var W6=function(t){(0,wo.__extends)(e,t);function e(r,n){var a=r.id,u=r.device,y=r.descriptor,A=t.call(this,{id:a,device:u})||this;A.rawVertexGLSL=n,A.type=Jl.Program,A.uniformSetters={},A.attributes=[];var O=A.device.gl;return A.descriptor=y,A.gl_program=A.device.ensureResourceExists(O.createProgram()),A.gl_shader_vert=null,A.gl_shader_frag=null,A.compileState=Qd.NeedsCompile,A.tryCompileProgram(),A}return e.prototype.destroy=function(){t.prototype.destroy.call(this),this.device.gl.deleteProgram(this.gl_program),this.device.gl.deleteShader(this.gl_shader_vert),this.device.gl.deleteShader(this.gl_shader_frag)},e.prototype.tryCompileProgram=function(){Cs(this.compileState===Qd.NeedsCompile);var r=this.descriptor,n=r.vertex,a=r.fragment,u=this.device.gl;n!=null&&n.glsl&&(a!=null&&a.glsl)&&(this.gl_shader_vert=this.compileShader(n.postprocess?n.postprocess(n.glsl):n.glsl,u.VERTEX_SHADER),this.gl_shader_frag=this.compileShader(a.postprocess?a.postprocess(a.glsl):a.glsl,u.FRAGMENT_SHADER),u.attachShader(this.gl_program,this.gl_shader_vert),u.attachShader(this.gl_program,this.gl_shader_frag),u.linkProgram(this.gl_program),this.compileState=Qd.Compiling,ea(u)||(this.readUniformLocationsFromLinkedProgram(),this.readAttributesFromLinkedProgram()))},e.prototype.readAttributesFromLinkedProgram=function(){for(var r,n=this.device.gl,a=n.getProgramParameter(this.gl_program,n.ACTIVE_ATTRIBUTES),u=L6(this.descriptor.vertex.glsl),y=D6(this.rawVertexGLSL,u),A=function(Y){var Q=n.getActiveAttrib(O.gl_program,Y),ae=Q.name,xe=Q.type,Be=Q.size,it=n.getAttribLocation(O.gl_program,ae),gt=(r=y.find(function(Bt){return Bt.name===ae}))===null||r===void 0?void 0:r.location;it>=0&&!(0,Dm.Z)(gt)&&(O.attributes[gt]={name:ae,location:it,type:xe,size:Be})},O=this,Z=0;Z<a;Z++)A(Z)},e.prototype.readUniformLocationsFromLinkedProgram=function(){for(var r=this.device.gl,n=r.getProgramParameter(this.gl_program,r.ACTIVE_UNIFORMS),a=0;a<n;a++){var u=r.getActiveUniform(this.gl_program,a),y=T6(u.name).name,A=r.getUniformLocation(this.gl_program,y);if(this.uniformSetters[y]=dS(r,A,u),u&&u.size>1)for(var O=0;O<u.size;O++)A=r.getUniformLocation(this.gl_program,"".concat(y,"[").concat(O,"]")),this.uniformSetters["".concat(y,"[").concat(O,"]")]=dS(r,A,u)}},e.prototype.compileShader=function(r,n){var a=this.device.gl,u=this.device.ensureResourceExists(a.createShader(n));return a.shaderSource(u,r),a.compileShader(u),u},e.prototype.setUniformsLegacy=function(r){r===void 0&&(r={});var n=this.device.gl;if(!ea(n)){var a=!1;for(var u in r){a||(n.useProgram(this.gl_program),a=!0);var y=r[u],A=this.uniformSetters[u];if(A){var O=y;O instanceof J2&&(O=O.textureIndex),A(O)}}}return this},e}(Om),X6=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=t.call(this,{id:n,device:a})||this;y.type=Jl.QueryPool;var A=y.device.gl;if(ea(A)){var O=u.elemCount,Z=u.type;y.gl_query=t6(O,function(){return y.device.ensureResourceExists(A.createQuery())}),y.gl_query_type=Z6(Z)}return y}return e.prototype.queryResultOcclusion=function(r){var n=this.device.gl;if(ea(n)){var a=this.gl_query[r];return n.getQueryParameter(a,n.QUERY_RESULT_AVAILABLE)?!!n.getQueryParameter(a,n.QUERY_RESULT):null}return null},e.prototype.destroy=function(){t.prototype.destroy.call(this);var r=this.device.gl;if(ea(r))for(var n=0;n<this.gl_query.length;n++)r.deleteQuery(this.gl_query[n])},e}(Om),q6=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=t.call(this,{id:n,device:a})||this;return u.type=Jl.Readback,u.gl_pbo=null,u.gl_sync=null,u}return e.prototype.clientWaitAsync=function(r,n,a){n===void 0&&(n=0),a===void 0&&(a=10);var u=this.device.gl;return new Promise(function(y,A){function O(){var Z=u.clientWaitSync(r,n,0);if(Z==u.WAIT_FAILED){A();return}if(Z==u.TIMEOUT_EXPIRED){setTimeout(O,(0,qI.Z)(a,0,u.MAX_CLIENT_WAIT_TIMEOUT_WEBGL));return}y()}O()})},e.prototype.getBufferSubDataAsync=function(r,n,a,u,y,A){return(0,wo.__awaiter)(this,void 0,void 0,function(){var O;return(0,wo.__generator)(this,function(Z){switch(Z.label){case 0:return O=this.device.gl,ea(O)?(this.gl_sync=O.fenceSync(O.SYNC_GPU_COMMANDS_COMPLETE,0),O.flush(),[4,this.clientWaitAsync(this.gl_sync,0,10)]):[3,2];case 1:return Z.sent(),O.bindBuffer(r,n),O.getBufferSubData(r,a,u,y,A),O.bindBuffer(r,null),[2,u];case 2:return[2]}})})},e.prototype.readTexture=function(r,n,a,u,y,A,O,Z){return O===void 0&&(O=0),Z===void 0&&(Z=A.byteLength||0),(0,wo.__awaiter)(this,void 0,void 0,function(){var Y,Q,ae,xe,Be;return(0,wo.__generator)(this,function(it){return Y=this.device.gl,Q=r,ae=this.device.translateTextureFormat(Q.format),xe=this.device.translateTextureType(Q.format),Be=$I(Q.format),ea(Y)?(this.gl_pbo=this.device.ensureResourceExists(Y.createBuffer()),Y.bindBuffer(Y.PIXEL_PACK_BUFFER,this.gl_pbo),Y.bufferData(Y.PIXEL_PACK_BUFFER,Z,Y.STREAM_READ),Y.bindBuffer(Y.PIXEL_PACK_BUFFER,null),Y.bindFramebuffer(qt.READ_FRAMEBUFFER,this.device.readbackFramebuffer),Y.framebufferTexture2D(qt.READ_FRAMEBUFFER,qt.COLOR_ATTACHMENT0,qt.TEXTURE_2D,Q.gl_texture,0),Y.bindBuffer(Y.PIXEL_PACK_BUFFER,this.gl_pbo),Y.readPixels(n,a,u,y,ae,xe,O*Be),Y.bindBuffer(Y.PIXEL_PACK_BUFFER,null),[2,this.getBufferSubDataAsync(Y.PIXEL_PACK_BUFFER,this.gl_pbo,0,A,O,0)]):[2,this.readTextureSync(r,n,a,u,y,A,O,Z)]})})},e.prototype.readTextureSync=function(r,n,a,u,y,A,O,Z){Z===void 0&&(Z=A.byteLength||0);var Y=this.device.gl,Q=r,ae=this.device.translateTextureType(Q.format);return Y.bindFramebuffer(qt.FRAMEBUFFER,this.device.readbackFramebuffer),Y.framebufferTexture2D(qt.FRAMEBUFFER,qt.COLOR_ATTACHMENT0,qt.TEXTURE_2D,Q.gl_texture,0),Y.pixelStorei(Y.PACK_ALIGNMENT,4),Y.readPixels(n,a,u,y,Y.RGBA,ae,A),A},e.prototype.readBuffer=function(r,n,a,u,y){return(0,wo.__awaiter)(this,void 0,void 0,function(){var A;return(0,wo.__generator)(this,function(O){return A=this.device.gl,ea(A)?[2,this.getBufferSubDataAsync(A.ARRAY_BUFFER,ev(r,n),n,a,u,y)]:[2,Promise.reject()]})})},e.prototype.destroy=function(){t.prototype.destroy.call(this),ea(this.device.gl)&&(this.gl_sync!==null&&this.device.gl.deleteSync(this.gl_sync),this.gl_pbo!==null&&this.device.gl.deleteBuffer(this.gl_pbo))},e}(Om),Y6=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y,A,O=t.call(this,{id:n,device:a})||this;return O.type=Jl.RenderPipeline,O.drawMode=F6((y=u.topology)!==null&&y!==void 0?y:Ip.TRIANGLES),O.program=u.program,O.inputLayout=u.inputLayout,O.megaState=(0,wo.__assign)((0,wo.__assign)({},J0(l0)),u.megaStateDescriptor),O.colorAttachmentFormats=u.colorAttachmentFormats.slice(),O.depthStencilAttachmentFormat=u.depthStencilAttachmentFormat,O.sampleCount=(A=u.sampleCount)!==null&&A!==void 0?A:1,O}return e}(Om),$6=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=t.call(this,{id:n,device:a})||this;return y.type=Jl.ComputePipeline,y.descriptor=u,y}return e}(Om),K6=function(){function t(){this.liveObjects=new Set,this.creationStacks=new Map,this.deletionStacks=new Map}return t.prototype.trackResourceCreated=function(e){this.creationStacks.set(e,new Error().stack),this.liveObjects.add(e)},t.prototype.trackResourceDestroyed=function(e){this.deletionStacks.has(e)&&console.warn("Object double freed:",e,`
Creation stack: `,this.creationStacks.get(e),`
Deletion stack: `,this.deletionStacks.get(e),`
This stack: `,new Error().stack),this.deletionStacks.set(e,new Error().stack),this.liveObjects.delete(e)},t.prototype.checkForLeaks=function(){var e,r;try{for(var n=(0,wo.__values)(this.liveObjects.values()),a=n.next();!a.done;a=n.next()){var u=a.value;console.warn("Object leaked:",u,"Creation stack:",this.creationStacks.get(u))}}catch(y){e={error:y}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},t.prototype.setResourceLeakCheck=function(e,r){r?this.liveObjects.add(e):this.liveObjects.delete(e)},t}(),J6=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y,A,O=t.call(this,{id:n,device:a})||this;O.type=Jl.Sampler;var Z=O.device.gl;if(ea(Z)){var Y=O.device.ensureResourceExists(Z.createSampler());Z.samplerParameteri(Y,qt.TEXTURE_WRAP_S,w_(u.addressModeU)),Z.samplerParameteri(Y,qt.TEXTURE_WRAP_T,w_(u.addressModeV)),Z.samplerParameteri(Y,qt.TEXTURE_WRAP_R,w_((y=u.addressModeW)!==null&&y!==void 0?y:u.addressModeU)),Z.samplerParameteri(Y,qt.TEXTURE_MIN_FILTER,W1(u.minFilter,u.mipmapFilter)),Z.samplerParameteri(Y,qt.TEXTURE_MAG_FILTER,W1(u.magFilter,df.NO_MIP)),u.lodMinClamp!==void 0&&Z.samplerParameterf(Y,qt.TEXTURE_MIN_LOD,u.lodMinClamp),u.lodMaxClamp!==void 0&&Z.samplerParameterf(Y,qt.TEXTURE_MAX_LOD,u.lodMaxClamp),u.compareFunction!==void 0&&(Z.samplerParameteri(Y,Z.TEXTURE_COMPARE_MODE,Z.COMPARE_REF_TO_TEXTURE),Z.samplerParameteri(Y,Z.TEXTURE_COMPARE_FUNC,u.compareFunction));var Q=(A=u.maxAnisotropy)!==null&&A!==void 0?A:1;Q>1&&O.device.EXT_texture_filter_anisotropic!==null&&(Cs(u.minFilter===pp.BILINEAR&&u.magFilter===pp.BILINEAR&&u.mipmapFilter===df.LINEAR),Z.samplerParameterf(Y,O.device.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Q)),O.gl_sampler=Y}else O.descriptor=u;return O}return e.prototype.setTextureParameters=function(r,n,a){var u,y=this.device.gl,A=this.descriptor;this.isNPOT(n,a)?y.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_MIN_FILTER,qt.LINEAR):y.texParameteri(r,qt.TEXTURE_MIN_FILTER,W1(A.minFilter,A.mipmapFilter)),y.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_WRAP_S,w_(A.addressModeU)),y.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_WRAP_T,w_(A.addressModeV)),y.texParameteri(r,qt.TEXTURE_MAG_FILTER,W1(A.magFilter,df.NO_MIP));var O=(u=A.maxAnisotropy)!==null&&u!==void 0?u:1;O>1&&this.device.EXT_texture_filter_anisotropic!==null&&(Cs(A.minFilter===pp.BILINEAR&&A.magFilter===pp.BILINEAR&&A.mipmapFilter===df.LINEAR),y.texParameteri(r,this.device.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT,O))},e.prototype.destroy=function(){t.prototype.destroy.call(this),ea(this.device.gl)&&this.device.gl.deleteSampler($2(this))},e.prototype.isNPOT=function(r,n){return!Z1(r)||!Z1(n)},e}(Om),Q6=function(){function t(){}return t.prototype.dispatchWorkgroups=function(e,r,n){},t.prototype.dispatchWorkgroupsIndirect=function(e,r){},t.prototype.setPipeline=function(e){},t.prototype.setBindings=function(e){},t.prototype.pushDebugGroup=function(e){},t.prototype.popDebugGroup=function(){},t.prototype.insertDebugMarker=function(e){},t}(),eL=function(t){(0,wo.__extends)(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Jl.RenderBundle,r.commands=[],r}return e.prototype.push=function(r){this.commands.push(r)},e.prototype.replay=function(){this.commands.forEach(function(r){return r()})},e}(Om),bS=65536,tL=/uniform(?:\s+)(\w+)(?:\s?){([^]*?)}/g,rL=function(){function t(e,r){r===void 0&&(r={}),this.shaderDebug=!1,this.OES_vertex_array_object=null,this.ANGLE_instanced_arrays=null,this.OES_texture_float=null,this.OES_draw_buffers_indexed=null,this.WEBGL_draw_buffers=null,this.WEBGL_depth_texture=null,this.WEBGL_color_buffer_float=null,this.EXT_color_buffer_half_float=null,this.WEBGL_compressed_texture_s3tc=null,this.WEBGL_compressed_texture_s3tc_srgb=null,this.EXT_texture_compression_rgtc=null,this.EXT_texture_filter_anisotropic=null,this.KHR_parallel_shader_compile=null,this.EXT_texture_norm16=null,this.EXT_color_buffer_float=null,this.OES_texture_float_linear=null,this.OES_texture_half_float_linear=null,this.scTexture=null,this.scPlatformFramebuffer=null,this.currentActiveTexture=null,this.currentBoundVAO=null,this.currentProgram=null,this.resourceCreationTracker=null,this.resourceUniqueId=0,this.currentColorAttachments=[],this.currentColorAttachmentLevels=[],this.currentColorResolveTos=[],this.currentColorResolveToLevels=[],this.currentSampleCount=-1,this.currentIndexBufferByteOffset=null,this.currentMegaState=J0(l0),this.currentSamplers=[],this.currentTextures=[],this.currentUniformBuffers=[],this.currentUniformBufferByteOffsets=[],this.currentUniformBufferByteSizes=[],this.currentScissorEnabled=!1,this.currentStencilRef=null,this.currentRenderPassDescriptor=null,this.currentRenderPassDescriptorStack=[],this.debugGroupStack=[],this.resolveColorAttachmentsChanged=!1,this.resolveDepthStencilAttachmentsChanged=!1,this.explicitBindingLocations=!1,this.separateSamplerTextures=!1,this.viewportOrigin=ng.LOWER_LEFT,this.clipSpaceNearZ=q0.NEGATIVE_ONE,this.supportMRT=!1,this.inBlitRenderPass=!1,this.supportedSampleCounts=[],this.occlusionQueriesRecommended=!1,this.computeShadersSupported=!1,this.gl=e,this.contextAttributes=s0(e.getContextAttributes()),ea(e)?(this.EXT_texture_norm16=e.getExtension("EXT_texture_norm16"),this.EXT_color_buffer_float=e.getExtension("EXT_color_buffer_float")):(this.OES_vertex_array_object=e.getExtension("OES_vertex_array_object"),this.ANGLE_instanced_arrays=e.getExtension("ANGLE_instanced_arrays"),this.OES_texture_float=e.getExtension("OES_texture_float"),this.WEBGL_draw_buffers=e.getExtension("WEBGL_draw_buffers"),this.WEBGL_depth_texture=e.getExtension("WEBGL_depth_texture"),this.WEBGL_color_buffer_float=e.getExtension("WEBGL_color_buffer_float"),this.EXT_color_buffer_half_float=e.getExtension("EXT_color_buffer_half_float"),e.getExtension("EXT_frag_depth"),e.getExtension("OES_element_index_uint"),e.getExtension("OES_standard_derivatives")),this.WEBGL_compressed_texture_s3tc=e.getExtension("WEBGL_compressed_texture_s3tc"),this.WEBGL_compressed_texture_s3tc_srgb=e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),this.EXT_texture_compression_rgtc=e.getExtension("EXT_texture_compression_rgtc"),this.EXT_texture_filter_anisotropic=e.getExtension("EXT_texture_filter_anisotropic"),this.EXT_texture_norm16=e.getExtension("EXT_texture_norm16"),this.OES_texture_float_linear=e.getExtension("OES_texture_float_linear"),this.OES_texture_half_float_linear=e.getExtension("OES_texture_half_float_linear"),this.KHR_parallel_shader_compile=e.getExtension("KHR_parallel_shader_compile"),ea(e)?(this.platformString="WebGL2",this.glslVersion="#version 300 es"):(this.platformString="WebGL1",this.glslVersion="#version 100"),this.scTexture=new J2({id:this.getNextUniqueId(),device:this,descriptor:{width:0,height:0,depthOrArrayLayers:1,dimension:rl.TEXTURE_2D,mipLevelCount:1,usage:ad.RENDER_TARGET,format:this.contextAttributes.alpha===!1?yr.U8_RGB_RT:yr.U8_RGBA_RT},fake:!0}),this.scTexture.formatKind=Hh.Float,this.scTexture.gl_target=null,this.scTexture.gl_texture=null,this.resolveColorReadFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.resolveColorDrawFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.resolveDepthStencilReadFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.resolveDepthStencilDrawFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.renderPassDrawFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.readbackFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.fallbackTexture2D=this.createFallbackTexture(rl.TEXTURE_2D,Hh.Float),this.fallbackTexture2DDepth=this.createFallbackTexture(rl.TEXTURE_2D,Hh.Depth),this.fallbackVertexBuffer=this.createBuffer({viewOrSize:1,usage:ac.VERTEX,hint:Gm.STATIC}),ea(e)&&(this.fallbackTexture2DArray=this.createFallbackTexture(rl.TEXTURE_2D_ARRAY,Hh.Float),this.fallbackTexture3D=this.createFallbackTexture(rl.TEXTURE_3D,Hh.Float),this.fallbackTextureCube=this.createFallbackTexture(rl.TEXTURE_CUBE_MAP,Hh.Float)),this.currentMegaState.depthCompare=js.LESS,this.currentMegaState.depthWrite=!1,this.currentMegaState.attachmentsState[0].channelWriteMask=Lf.ALL,e.enable(e.DEPTH_TEST),e.enable(e.STENCIL_TEST),this.checkLimits(),r.shaderDebug&&(this.shaderDebug=!0),r.trackResources&&(this.resourceCreationTracker=new K6)}return t.prototype.destroy=function(){this.blitBindings&&this.blitBindings.destroy(),this.blitInputLayout&&this.blitInputLayout.destroy(),this.blitRenderPipeline&&this.blitRenderPipeline.destroy(),this.blitVertexBuffer&&this.blitVertexBuffer.destroy(),this.blitProgram&&this.blitProgram.destroy()},t.prototype.createFallbackTexture=function(e,r){var n=e===rl.TEXTURE_CUBE_MAP?6:1,a=r===Hh.Depth?yr.D32F:yr.U8_RGBA_NORM,u=this.createTexture({dimension:e,format:a,usage:ad.SAMPLED,width:1,height:1,depthOrArrayLayers:n,mipLevelCount:1});return r===Hh.Float&&u.setImageData([new Uint8Array(4*n)]),tv(u)},t.prototype.getNextUniqueId=function(){return++this.resourceUniqueId},t.prototype.checkLimits=function(){var e=this.gl;if(this.maxVertexAttribs=e.getParameter(qt.MAX_VERTEX_ATTRIBS),ea(e)){this.uniformBufferMaxPageByteSize=Math.min(e.getParameter(qt.MAX_UNIFORM_BLOCK_SIZE),bS),this.uniformBufferWordAlignment=e.getParameter(e.UNIFORM_BUFFER_OFFSET_ALIGNMENT)/4;var r=e.getInternalformatParameter(e.RENDERBUFFER,e.DEPTH32F_STENCIL8,e.SAMPLES);this.supportedSampleCounts=r?(0,wo.__spreadArray)([],(0,wo.__read)(r),!1):[],this.occlusionQueriesRecommended=!0}else this.uniformBufferWordAlignment=64,this.uniformBufferMaxPageByteSize=bS;this.uniformBufferMaxPageWordSize=this.uniformBufferMaxPageByteSize/4,this.supportedSampleCounts.includes(1)||this.supportedSampleCounts.push(1),this.supportedSampleCounts.sort(function(n,a){return n-a})},t.prototype.configureSwapChain=function(e,r,n){var a=this.scTexture;a.width=e,a.height=r,this.scPlatformFramebuffer=QI(n)},t.prototype.getDevice=function(){return this},t.prototype.getCanvas=function(){return this.gl.canvas},t.prototype.getOnscreenTexture=function(){return this.scTexture},t.prototype.beginFrame=function(){},t.prototype.endFrame=function(){},t.prototype.translateTextureInternalFormat=function(e,r){switch(r===void 0&&(r=!1),e){case yr.ALPHA:return qt.ALPHA;case yr.U8_LUMINANCE:case yr.F16_LUMINANCE:case yr.F32_LUMINANCE:return qt.LUMINANCE;case yr.F16_R:return qt.R16F;case yr.F16_RG:return qt.RG16F;case yr.F16_RGB:return qt.RGB16F;case yr.F16_RGBA:return qt.RGBA16F;case yr.F32_R:return qt.R32F;case yr.F32_RG:return qt.RG32F;case yr.F32_RGB:return qt.RGB32F;case yr.F32_RGBA:return ea(this.gl)?qt.RGBA32F:r?this.WEBGL_color_buffer_float.RGBA32F_EXT:qt.RGBA;case yr.U8_R_NORM:return qt.R8;case yr.U8_RG_NORM:return qt.RG8;case yr.U8_RGB_NORM:case yr.U8_RGB_RT:return qt.RGB8;case yr.U8_RGB_SRGB:return qt.SRGB8;case yr.U8_RGBA_NORM:case yr.U8_RGBA_RT:return ea(this.gl)?qt.RGBA8:r?qt.RGBA4:qt.RGBA;case yr.U8_RGBA:return qt.RGBA;case yr.U8_RGBA_SRGB:case yr.U8_RGBA_RT_SRGB:return qt.SRGB8_ALPHA8;case yr.U16_R:return qt.R16UI;case yr.U16_R_NORM:return this.EXT_texture_norm16.R16_EXT;case yr.U16_RG_NORM:return this.EXT_texture_norm16.RG16_EXT;case yr.U16_RGBA_NORM:return this.EXT_texture_norm16.RGBA16_EXT;case yr.U16_RGBA_5551:return qt.RGB5_A1;case yr.U16_RGB_565:return qt.RGB565;case yr.U32_R:return qt.R32UI;case yr.S8_RGBA_NORM:return qt.RGBA8_SNORM;case yr.S8_RG_NORM:return qt.RG8_SNORM;case yr.BC1:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT;case yr.BC1_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;case yr.BC2:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT;case yr.BC2_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;case yr.BC3:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT;case yr.BC3_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;case yr.BC4_UNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_RED_RGTC1_EXT;case yr.BC4_SNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT;case yr.BC5_UNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT;case yr.BC5_SNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;case yr.D32F_S8:return ea(this.gl)?qt.DEPTH32F_STENCIL8:this.WEBGL_depth_texture?qt.DEPTH_STENCIL:qt.DEPTH_COMPONENT16;case yr.D24_S8:return ea(this.gl)?qt.DEPTH24_STENCIL8:this.WEBGL_depth_texture?qt.DEPTH_STENCIL:qt.DEPTH_COMPONENT16;case yr.D32F:return ea(this.gl)?qt.DEPTH_COMPONENT32F:this.WEBGL_depth_texture?qt.DEPTH_COMPONENT:qt.DEPTH_COMPONENT16;case yr.D24:return ea(this.gl)?qt.DEPTH_COMPONENT24:this.WEBGL_depth_texture?qt.DEPTH_COMPONENT:qt.DEPTH_COMPONENT16;default:throw new Error("whoops")}},t.prototype.translateTextureType=function(e){var r=ig(e);switch(r){case zn.U8:return qt.UNSIGNED_BYTE;case zn.U16:return qt.UNSIGNED_SHORT;case zn.U32:return qt.UNSIGNED_INT;case zn.S8:return qt.BYTE;case zn.F16:return qt.HALF_FLOAT;case zn.F32:return qt.FLOAT;case zn.U16_PACKED_5551:return qt.UNSIGNED_SHORT_5_5_5_1;case zn.D32F:return ea(this.gl)?qt.FLOAT:this.WEBGL_depth_texture?qt.UNSIGNED_INT:qt.UNSIGNED_BYTE;case zn.D24:return ea(this.gl)?qt.UNSIGNED_INT_24_8:this.WEBGL_depth_texture?qt.UNSIGNED_SHORT:qt.UNSIGNED_BYTE;case zn.D24S8:return ea(this.gl)?qt.UNSIGNED_INT_24_8:this.WEBGL_depth_texture?qt.UNSIGNED_INT_24_8_WEBGL:qt.UNSIGNED_BYTE;case zn.D32FS8:return qt.FLOAT_32_UNSIGNED_INT_24_8_REV;default:throw new Error("whoops")}},t.prototype.translateInternalTextureFormat=function(e){switch(e){case yr.F32_R:return qt.R32F;case yr.F32_RG:return qt.RG32F;case yr.F32_RGB:return qt.RGB32F;case yr.F32_RGBA:return qt.RGBA32F;case yr.F16_R:return qt.R16F;case yr.F16_RG:return qt.RG16F;case yr.F16_RGB:return qt.RGB16F;case yr.F16_RGBA:return qt.RGBA16F}return this.translateTextureFormat(e)},t.prototype.translateTextureFormat=function(e){if(vS(e)||e===yr.F32_LUMINANCE||e===yr.U8_LUMINANCE)return this.translateTextureInternalFormat(e);var r=ea(this.gl)||!ea(this.gl)&&!!this.WEBGL_depth_texture;switch(e){case yr.D24_S8:case yr.D32F_S8:return r?qt.DEPTH_STENCIL:qt.RGBA;case yr.D24:case yr.D32F:return r?qt.DEPTH_COMPONENT:qt.RGBA}var n=_S(e),a=z1(e);switch(a){case No.A:return qt.ALPHA;case No.R:return n?qt.RED_INTEGER:qt.RED;case No.RG:return n?qt.RG_INTEGER:qt.RG;case No.RGB:return n?qt.RGB_INTEGER:qt.RGB;case No.RGBA:return qt.RGBA}},t.prototype.setActiveTexture=function(e){this.currentActiveTexture!==e&&(this.gl.activeTexture(e),this.currentActiveTexture=e)},t.prototype.bindVAO=function(e){this.currentBoundVAO!==e&&(ea(this.gl)?this.gl.bindVertexArray(e):this.OES_vertex_array_object.bindVertexArrayOES(e),this.currentBoundVAO=e)},t.prototype.programCompiled=function(e){Cs(e.compileState!==Qd.NeedsCompile),e.compileState===Qd.Compiling&&(e.compileState=Qd.NeedsBind,this.shaderDebug&&this.checkProgramCompilationForErrors(e))},t.prototype.useProgram=function(e){this.currentProgram!==e&&(this.programCompiled(e),this.gl.useProgram(e.gl_program),this.currentProgram=e)},t.prototype.ensureResourceExists=function(e){if(e===null){var r=this.gl.getError();throw new Error("Created resource is null; GL error encountered: ".concat(r))}else return e},t.prototype.createBuffer=function(e){return new j6({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createTexture=function(e){return new J2({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createSampler=function(e){return new J6({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createRenderTarget=function(e){return new G6({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createRenderTargetFromTexture=function(e){var r=e,n=r.format,a=r.width,u=r.height,y=r.mipLevelCount;return Cs(y===1),this.createRenderTarget({format:n,width:a,height:u,sampleCount:1,texture:e})},t.prototype.createProgram=function(e){var r,n,a,u=(r=e.vertex)===null||r===void 0?void 0:r.glsl;return!((n=e.vertex)===null||n===void 0)&&n.glsl&&(e.vertex.glsl=Ug(this.queryVendorInfo(),"vert",e.vertex.glsl)),!((a=e.fragment)===null||a===void 0)&&a.glsl&&(e.fragment.glsl=Ug(this.queryVendorInfo(),"frag",e.fragment.glsl)),this.createProgramSimple(e,u)},t.prototype.createProgramSimple=function(e,r){var n=new W6({id:this.getNextUniqueId(),device:this,descriptor:e},r);return n},t.prototype.createBindings=function(e){return new O6({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createInputLayout=function(e){return new H6({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createRenderPipeline=function(e){return new Y6({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createComputePass=function(){return new Q6},t.prototype.createComputePipeline=function(e){return new $6({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createReadback=function(){return new q6({id:this.getNextUniqueId(),device:this})},t.prototype.createQueryPool=function(e,r){return new X6({id:this.getNextUniqueId(),device:this,descriptor:{type:e,elemCount:r}})},t.prototype.formatRenderPassDescriptor=function(e){var r,n,a,u,y,A,O=e.colorAttachment;e.depthClearValue=(r=e.depthClearValue)!==null&&r!==void 0?r:"load",e.stencilClearValue=(n=e.stencilClearValue)!==null&&n!==void 0?n:"load";for(var Z=0;Z<O.length;Z++)e.colorAttachmentLevel||(e.colorAttachmentLevel=[]),e.colorAttachmentLevel[Z]=(a=e.colorAttachmentLevel[Z])!==null&&a!==void 0?a:0,e.colorResolveToLevel||(e.colorResolveToLevel=[]),e.colorResolveToLevel[Z]=(u=e.colorResolveToLevel[Z])!==null&&u!==void 0?u:0,e.colorClearColor||(e.colorClearColor=[]),e.colorClearColor[Z]=(y=e.colorClearColor[Z])!==null&&y!==void 0?y:"load",e.colorStore||(e.colorStore=[]),e.colorStore[Z]=(A=e.colorStore[Z])!==null&&A!==void 0?A:!1},t.prototype.createRenderBundle=function(){return new eL({id:this.getNextUniqueId(),device:this})},t.prototype.beginBundle=function(e){this.renderBundle=e},t.prototype.endBundle=function(){this.renderBundle=void 0},t.prototype.executeBundles=function(e){e.forEach(function(r){r.replay()})},t.prototype.createRenderPass=function(e){this.currentRenderPassDescriptor!==null&&this.currentRenderPassDescriptorStack.push(this.currentRenderPassDescriptor),this.currentRenderPassDescriptor=e,this.formatRenderPassDescriptor(e);var r=e.colorAttachment,n=e.colorAttachmentLevel,a=e.colorClearColor,u=e.colorResolveTo,y=e.colorResolveToLevel,A=e.depthStencilAttachment,O=e.depthClearValue,Z=e.stencilClearValue,Y=e.depthStencilResolveTo;this.setRenderPassParametersBegin(r.length);for(var Q=0;Q<r.length;Q++)this.setRenderPassParametersColor(Q,r[Q],n[Q],u[Q],y[Q]);this.setRenderPassParametersDepthStencil(A,Y),this.validateCurrentAttachments();for(var Q=0;Q<r.length;Q++){var ae=a[Q];ae!=="load"&&this.setRenderPassParametersClearColor(Q,ae.r,ae.g,ae.b,ae.a)}return this.setRenderPassParametersClearDepthStencil(O,Z),this},t.prototype.submitPass=function(e){Cs(this.currentRenderPassDescriptor!==null),this.endPass(),this.currentRenderPassDescriptorStack.length?this.currentRenderPassDescriptor=this.currentRenderPassDescriptorStack.pop():this.currentRenderPassDescriptor=null},t.prototype.copySubTexture2D=function(e,r,n,a,u,y){var A=this.gl,O=e,Z=a;if(Cs(Z.mipLevelCount===1),Cs(O.mipLevelCount===1),ea(A))O===this.scTexture?A.bindFramebuffer(A.DRAW_FRAMEBUFFER,this.scPlatformFramebuffer):(A.bindFramebuffer(A.DRAW_FRAMEBUFFER,this.resolveColorDrawFramebuffer),this.bindFramebufferAttachment(A.DRAW_FRAMEBUFFER,A.COLOR_ATTACHMENT0,O,0)),A.bindFramebuffer(A.READ_FRAMEBUFFER,this.resolveColorReadFramebuffer),this.bindFramebufferAttachment(A.READ_FRAMEBUFFER,A.COLOR_ATTACHMENT0,Z,0),A.blitFramebuffer(u,y,u+Z.width,y+Z.height,r,n,r+Z.width,n+Z.height,A.COLOR_BUFFER_BIT,A.LINEAR),A.bindFramebuffer(A.READ_FRAMEBUFFER,null),A.bindFramebuffer(A.DRAW_FRAMEBUFFER,null);else if(O===this.scTexture){var Y=this.createRenderTargetFromTexture(a);this.submitBlitRenderPass(Y,O)}},t.prototype.queryLimits=function(){return this},t.prototype.queryTextureFormatSupported=function(e,r,n){switch(e){case yr.BC1_SRGB:case yr.BC2_SRGB:case yr.BC3_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb!==null?K2(r,n,4,4):!1;case yr.BC1:case yr.BC2:case yr.BC3:return this.WEBGL_compressed_texture_s3tc!==null?K2(r,n,4,4):!1;case yr.BC4_UNORM:case yr.BC4_SNORM:case yr.BC5_UNORM:case yr.BC5_SNORM:return this.EXT_texture_compression_rgtc!==null?K2(r,n,4,4):!1;case yr.U16_R_NORM:case yr.U16_RG_NORM:case yr.U16_RGBA_NORM:return this.EXT_texture_norm16!==null;case yr.F32_R:case yr.F32_RG:case yr.F32_RGB:case yr.F32_RGBA:return this.OES_texture_float_linear!==null;case yr.F16_R:case yr.F16_RG:case yr.F16_RGB:case yr.F16_RGBA:return this.OES_texture_half_float_linear!==null;default:return!0}},t.prototype.queryProgramReady=function(e){var r=this.gl;if(e.compileState===Qd.NeedsCompile)throw new Error("whoops");if(e.compileState===Qd.Compiling){var n=void 0;return this.KHR_parallel_shader_compile!==null?n=r.getProgramParameter(e.gl_program,this.KHR_parallel_shader_compile.COMPLETION_STATUS_KHR):n=!0,n&&this.programCompiled(e),n}return e.compileState===Qd.NeedsBind||e.compileState===Qd.ReadyToUse},t.prototype.queryPlatformAvailable=function(){return this.gl.isContextLost()},t.prototype.queryVendorInfo=function(){return this},t.prototype.queryRenderPass=function(e){return this.currentRenderPassDescriptor},t.prototype.queryRenderTarget=function(e){var r=e;return r},t.prototype.setResourceName=function(e,r){if(e.name=r,e.type===Jl.Buffer)for(var n=e.gl_buffer_pages,a=0;a<n.length;a++)S_(n[a],"".concat(r," Page ").concat(a));else if(e.type===Jl.Texture)S_(tv(e),r);else if(e.type===Jl.Sampler)S_($2(e),r);else if(e.type===Jl.RenderTarget){var u=e.gl_renderbuffer;u!==null&&S_(u,r)}else e.type===Jl.InputLayout&&S_(e.vao,r)},t.prototype.setResourceLeakCheck=function(e,r){this.resourceCreationTracker!==null&&this.resourceCreationTracker.setResourceLeakCheck(e,r)},t.prototype.checkForLeaks=function(){this.resourceCreationTracker!==null&&this.resourceCreationTracker.checkForLeaks()},t.prototype.pushDebugGroup=function(e){},t.prototype.popDebugGroup=function(){},t.prototype.insertDebugMarker=function(e){},t.prototype.programPatched=function(e,r){Cs(this.shaderDebug)},t.prototype.getBufferData=function(e,r,n){n===void 0&&(n=0);var a=this.gl;ea(a)&&(a.bindBuffer(a.COPY_READ_BUFFER,ev(e,n*4)),a.getBufferSubData(a.COPY_READ_BUFFER,n*4,r))},t.prototype.debugGroupStatisticsDrawCall=function(e){e===void 0&&(e=1);for(var r=this.debugGroupStack.length-1;r>=0;r--)this.debugGroupStack[r].drawCallCount+=e},t.prototype.debugGroupStatisticsBufferUpload=function(e){e===void 0&&(e=1);for(var r=this.debugGroupStack.length-1;r>=0;r--)this.debugGroupStack[r].bufferUploadCount+=e},t.prototype.debugGroupStatisticsTextureBind=function(e){e===void 0&&(e=1);for(var r=this.debugGroupStack.length-1;r>=0;r--)this.debugGroupStack[r].textureBindCount+=e},t.prototype.debugGroupStatisticsTriangles=function(e){for(var r=this.debugGroupStack.length-1;r>=0;r--)this.debugGroupStack[r].triangleCount+=e},t.prototype.reportShaderError=function(e,r){var n=this.gl,a=n.getShaderParameter(e,n.COMPILE_STATUS);if(!a){console.error(r6(r));var u=n.getExtension("WEBGL_debug_shaders");u&&console.error(u.getTranslatedShaderSource(e)),console.error(n.getShaderInfoLog(e))}return a},t.prototype.checkProgramCompilationForErrors=function(e){var r=this.gl,n=e.gl_program;if(!r.getProgramParameter(n,r.LINK_STATUS)){var a=e.descriptor;if(!this.reportShaderError(e.gl_shader_vert,a.vertex.glsl)||!this.reportShaderError(e.gl_shader_frag,a.fragment.glsl))return;console.error(r.getProgramInfoLog(e.gl_program))}},t.prototype.bindFramebufferAttachment=function(e,r,n,a){var u=this.gl;if((0,Dm.Z)(n))u.framebufferRenderbuffer(e,r,u.RENDERBUFFER,null);else if(n.type===Jl.RenderTarget)n.gl_renderbuffer!==null?u.framebufferRenderbuffer(e,r,u.RENDERBUFFER,n.gl_renderbuffer):n.texture!==null&&u.framebufferTexture2D(e,r,qt.TEXTURE_2D,tv(n.texture),a);else if(n.type===Jl.Texture){var y=tv(n);n.dimension===rl.TEXTURE_2D?u.framebufferTexture2D(e,r,qt.TEXTURE_2D,y,a):ea(u)&&(n.dimension,rl.TEXTURE_2D_ARRAY)}},t.prototype.bindFramebufferDepthStencilAttachment=function(e,r){var n=this.gl,a=(0,Dm.Z)(r)?to.Depth|to.Stencil:Y0(r.format),u=!!(a&to.Depth),y=!!(a&to.Stencil);if(u&&y){var A=ea(this.gl)||!ea(this.gl)&&!!this.WEBGL_depth_texture;A?this.bindFramebufferAttachment(e,n.DEPTH_STENCIL_ATTACHMENT,r,0):this.bindFramebufferAttachment(e,n.DEPTH_ATTACHMENT,r,0)}else u?(this.bindFramebufferAttachment(e,n.DEPTH_ATTACHMENT,r,0),this.bindFramebufferAttachment(e,n.STENCIL_ATTACHMENT,null,0)):y&&(this.bindFramebufferAttachment(e,n.STENCIL_ATTACHMENT,r,0),this.bindFramebufferAttachment(e,n.DEPTH_ATTACHMENT,null,0))},t.prototype.validateCurrentAttachments=function(){for(var e=-1,r=-1,n=-1,a=0;a<this.currentColorAttachments.length;a++){var u=this.currentColorAttachments[a];u!==null&&(e===-1?(e=u.sampleCount,r=u.width,n=u.height):(Cs(e===u.sampleCount),Cs(r===u.width),Cs(n===u.height)))}this.currentDepthStencilAttachment&&(e===-1?e=this.currentDepthStencilAttachment.sampleCount:(Cs(e===this.currentDepthStencilAttachment.sampleCount),Cs(r===this.currentDepthStencilAttachment.width),Cs(n===this.currentDepthStencilAttachment.height))),this.currentSampleCount=e},t.prototype.setRenderPassParametersBegin=function(e){var r=this.gl;if(ea(r)?r.bindFramebuffer(qt.DRAW_FRAMEBUFFER,this.renderPassDrawFramebuffer):this.inBlitRenderPass||r.bindFramebuffer(qt.FRAMEBUFFER,this.renderPassDrawFramebuffer),ea(r)?r.drawBuffers([qt.COLOR_ATTACHMENT0,qt.COLOR_ATTACHMENT1,qt.COLOR_ATTACHMENT2,qt.COLOR_ATTACHMENT3]):!this.inBlitRenderPass&&this.WEBGL_draw_buffers&&this.WEBGL_draw_buffers.drawBuffersWEBGL([qt.COLOR_ATTACHMENT0_WEBGL,qt.COLOR_ATTACHMENT1_WEBGL,qt.COLOR_ATTACHMENT2_WEBGL,qt.COLOR_ATTACHMENT3_WEBGL]),!this.inBlitRenderPass)for(var n=e;n<this.currentColorAttachments.length;n++){var a=ea(r)?qt.DRAW_FRAMEBUFFER:qt.FRAMEBUFFER,u=ea(r)?qt.COLOR_ATTACHMENT0:qt.COLOR_ATTACHMENT0_WEBGL;r.framebufferRenderbuffer(a,u+n,qt.RENDERBUFFER,null),r.framebufferTexture2D(a,u+n,qt.TEXTURE_2D,null,0)}this.currentColorAttachments.length=e},t.prototype.setRenderPassParametersColor=function(e,r,n,a,u){var y=this.gl,A=ea(y);(this.currentColorAttachments[e]!==r||this.currentColorAttachmentLevels[e]!==n)&&(this.currentColorAttachments[e]=r,this.currentColorAttachmentLevels[e]=n,(A||!A&&this.WEBGL_draw_buffers)&&this.bindFramebufferAttachment(A?qt.DRAW_FRAMEBUFFER:qt.FRAMEBUFFER,(A?qt.COLOR_ATTACHMENT0:qt.COLOR_ATTACHMENT0_WEBGL)+e,r,n),this.resolveColorAttachmentsChanged=!0),(this.currentColorResolveTos[e]!==a||this.currentColorResolveToLevels[e]!==u)&&(this.currentColorResolveTos[e]=a,this.currentColorResolveToLevels[e]=u,a!==null&&(this.resolveColorAttachmentsChanged=!0))},t.prototype.setRenderPassParametersDepthStencil=function(e,r){var n=this.gl;this.currentDepthStencilAttachment!==e&&(this.currentDepthStencilAttachment=e,this.inBlitRenderPass||this.bindFramebufferDepthStencilAttachment(ea(n)?qt.DRAW_FRAMEBUFFER:qt.FRAMEBUFFER,this.currentDepthStencilAttachment),this.resolveDepthStencilAttachmentsChanged=!0),this.currentDepthStencilResolveTo!==r&&(this.currentDepthStencilResolveTo=r,r&&(this.resolveDepthStencilAttachmentsChanged=!0))},t.prototype.setRenderPassParametersClearColor=function(e,r,n,a,u){var y=this.gl;if(this.OES_draw_buffers_indexed!==null){var A=this.currentMegaState.attachmentsState[e];A&&A.channelWriteMask!==Lf.ALL&&(this.OES_draw_buffers_indexed.colorMaskiOES(e,!0,!0,!0,!0),A.channelWriteMask=Lf.ALL)}else{var A=this.currentMegaState.attachmentsState[0];A&&A.channelWriteMask!==Lf.ALL&&(y.colorMask(!0,!0,!0,!0),A.channelWriteMask=Lf.ALL)}this.setScissorRectEnabled(!1),ea(y)?y.clearBufferfv(y.COLOR,e,[r,n,a,u]):(y.clearColor(r,n,a,u),y.clear(y.COLOR_BUFFER_BIT))},t.prototype.setRenderPassParametersClearDepthStencil=function(e,r){e===void 0&&(e="load"),r===void 0&&(r="load");var n=this.gl;e!=="load"&&(Cs(!!this.currentDepthStencilAttachment),this.currentMegaState.depthWrite||(n.depthMask(!0),this.currentMegaState.depthWrite=!0),ea(n)?n.clearBufferfv(n.DEPTH,0,[e]):(n.clearDepth(e),n.clear(n.DEPTH_BUFFER_BIT))),r!=="load"&&(Cs(!!this.currentDepthStencilAttachment),this.currentMegaState.stencilWrite||(n.enable(n.STENCIL_TEST),n.stencilMask(255),this.currentMegaState.stencilWrite=!0),ea(n)?n.clearBufferiv(n.STENCIL,0,[r]):(n.clearStencil(r),n.clear(n.STENCIL_BUFFER_BIT)))},t.prototype.setBindings=function(e){var r=this,n;if(this.renderBundle){this.renderBundle.push(function(){return r.setBindings(e)});return}var a=this.gl,u=e,y=u.uniformBufferBindings,A=u.samplerBindings,O=u.bindingLayouts;Cs(0<O.bindingLayoutTables.length);var Z=O.bindingLayoutTables[0];Cs(y.length>=Z.numUniformBuffers),Cs(A.length>=Z.numSamplers);for(var Y=0;Y<y.length;Y++){var Q=y[Y];if(Q.size!==0){var ae=Z.firstUniformBuffer+Y,xe=Q.buffer,Be=Q.offset||0,it=Q.size||xe.byteSize;if(xe!==this.currentUniformBuffers[ae]||Be!==this.currentUniformBufferByteOffsets[ae]||it!==this.currentUniformBufferByteSizes[ae]){var gt=Be%xe.pageByteSize,Bt=xe.gl_buffer_pages[Be/xe.pageByteSize|0];Cs(gt+it<=xe.pageByteSize),ea(a)&&a.bindBufferRange(a.UNIFORM_BUFFER,ae,Bt,gt,it),this.currentUniformBuffers[ae]=xe,this.currentUniformBufferByteOffsets[ae]=Be,this.currentUniformBufferByteSizes[ae]=it}}}for(var Y=0;Y<Z.numSamplers;Y++){var Q=A[Y],Rt=Z.firstSampler+Y,Yt=Q!==null&&Q.sampler!==null?$2(Q.sampler):null,vr=Q!==null&&Q.texture!==null?tv(Q.texture):null;if(this.currentSamplers[Rt]!==Yt&&(ea(a)&&a.bindSampler(Rt,Yt),this.currentSamplers[Rt]=Yt),this.currentTextures[Rt]!==vr){if(this.setActiveTexture(a.TEXTURE0+Rt),vr!==null){var ln=s0(Q).texture,cn=ln.gl_target,Gr=ln.width,Pn=ln.height;Q.texture.textureIndex=Rt,a.bindTexture(cn,vr),ea(a)||(n=Q.sampler)===null||n===void 0||n.setTextureParameters(cn,Gr,Pn),this.debugGroupStatisticsTextureBind()}else{var Oo=(0,wo.__assign)((0,wo.__assign)({},Q),lS),Da=Oo.dimension,Bo=Oo.formatKind,cn=V6(Da);a.bindTexture(cn,this.getFallbackTexture((0,wo.__assign)({gl_target:cn,formatKind:Bo},Oo)))}this.currentTextures[Rt]=vr}}},t.prototype.setViewport=function(e,r,n,a){var u=this.gl;u.viewport(e,r,n,a)},t.prototype.setScissorRect=function(e,r,n,a){var u=this.gl;this.setScissorRectEnabled(!0),u.scissor(e,r,n,a)},t.prototype.applyAttachmentStateIndexed=function(e,r,n){var a=this.gl,u=this.OES_draw_buffers_indexed;r.channelWriteMask!==n.channelWriteMask&&(u.colorMaskiOES(e,!!(n.channelWriteMask&Lf.RED),!!(n.channelWriteMask&Lf.GREEN),!!(n.channelWriteMask&Lf.BLUE),!!(n.channelWriteMask&Lf.ALPHA)),r.channelWriteMask=n.channelWriteMask);var y=r.rgbBlendState.blendMode!==n.rgbBlendState.blendMode||r.alphaBlendState.blendMode!==n.alphaBlendState.blendMode,A=r.rgbBlendState.blendSrcFactor!==n.rgbBlendState.blendSrcFactor||r.alphaBlendState.blendSrcFactor!==n.alphaBlendState.blendSrcFactor||r.rgbBlendState.blendDstFactor!==n.rgbBlendState.blendDstFactor||r.alphaBlendState.blendDstFactor!==n.alphaBlendState.blendDstFactor;(A||y)&&(Zg(r.rgbBlendState)&&Zg(r.alphaBlendState)?u.enableiOES(e,a.BLEND):Zg(n.rgbBlendState)&&Zg(n.alphaBlendState)&&u.disableiOES(e,a.BLEND)),y&&(u.blendEquationSeparateiOES(e,n.rgbBlendState.blendMode,n.alphaBlendState.blendMode),r.rgbBlendState.blendMode=n.rgbBlendState.blendMode,r.alphaBlendState.blendMode=n.alphaBlendState.blendMode),A&&(u.blendFuncSeparateiOES(e,n.rgbBlendState.blendSrcFactor,n.rgbBlendState.blendDstFactor,n.alphaBlendState.blendSrcFactor,n.alphaBlendState.blendDstFactor),r.rgbBlendState.blendSrcFactor=n.rgbBlendState.blendSrcFactor,r.alphaBlendState.blendSrcFactor=n.alphaBlendState.blendSrcFactor,r.rgbBlendState.blendDstFactor=n.rgbBlendState.blendDstFactor,r.alphaBlendState.blendDstFactor=n.alphaBlendState.blendDstFactor)},t.prototype.applyAttachmentState=function(e,r){var n=this.gl;e.channelWriteMask!==r.channelWriteMask&&(n.colorMask(!!(r.channelWriteMask&Lf.RED),!!(r.channelWriteMask&Lf.GREEN),!!(r.channelWriteMask&Lf.BLUE),!!(r.channelWriteMask&Lf.ALPHA)),e.channelWriteMask=r.channelWriteMask);var a=e.rgbBlendState.blendMode!==r.rgbBlendState.blendMode||e.alphaBlendState.blendMode!==r.alphaBlendState.blendMode,u=e.rgbBlendState.blendSrcFactor!==r.rgbBlendState.blendSrcFactor||e.alphaBlendState.blendSrcFactor!==r.alphaBlendState.blendSrcFactor||e.rgbBlendState.blendDstFactor!==r.rgbBlendState.blendDstFactor||e.alphaBlendState.blendDstFactor!==r.alphaBlendState.blendDstFactor;(u||a)&&(Zg(e.rgbBlendState)&&Zg(e.alphaBlendState)?n.enable(n.BLEND):Zg(r.rgbBlendState)&&Zg(r.alphaBlendState)&&n.disable(n.BLEND)),a&&(n.blendEquationSeparate(r.rgbBlendState.blendMode,r.alphaBlendState.blendMode),e.rgbBlendState.blendMode=r.rgbBlendState.blendMode,e.alphaBlendState.blendMode=r.alphaBlendState.blendMode),u&&(n.blendFuncSeparate(r.rgbBlendState.blendSrcFactor,r.rgbBlendState.blendDstFactor,r.alphaBlendState.blendSrcFactor,r.alphaBlendState.blendDstFactor),e.rgbBlendState.blendSrcFactor=r.rgbBlendState.blendSrcFactor,e.alphaBlendState.blendSrcFactor=r.alphaBlendState.blendSrcFactor,e.rgbBlendState.blendDstFactor=r.rgbBlendState.blendDstFactor,e.alphaBlendState.blendDstFactor=r.alphaBlendState.blendDstFactor)},t.prototype.setMegaState=function(e){var r=this.gl,n=this.currentMegaState;if(this.OES_draw_buffers_indexed!==null)for(var a=0;a<e.attachmentsState.length;a++)this.applyAttachmentStateIndexed(a,n.attachmentsState[0],e.attachmentsState[0]);else Cs(e.attachmentsState.length===1),this.applyAttachmentState(n.attachmentsState[0],e.attachmentsState[0]);if(rS(n.blendConstant,e.blendConstant)||(r.blendColor(e.blendConstant.r,e.blendConstant.g,e.blendConstant.b,e.blendConstant.a),nS(n.blendConstant,e.blendConstant)),n.depthCompare!==e.depthCompare&&(r.depthFunc(e.depthCompare),n.depthCompare=e.depthCompare),!!n.depthWrite!=!!e.depthWrite&&(r.depthMask(e.depthWrite),n.depthWrite=e.depthWrite),!!n.stencilWrite!=!!e.stencilWrite&&(r.stencilMask(e.stencilWrite?255:0),n.stencilWrite=e.stencilWrite),!H1(n.stencilFront,e.stencilFront)){var u=e.stencilFront,y=u.passOp,A=u.failOp,O=u.depthFailOp,Z=u.compare;(n.stencilFront.passOp!==y||n.stencilFront.failOp!==A||n.stencilFront.depthFailOp!==O)&&(r.stencilOpSeparate(r.FRONT,A,O,y),n.stencilFront.passOp=y,n.stencilFront.failOp=A,n.stencilFront.depthFailOp=O),n.stencilFront.compare!==Z&&(this.setStencilReference(0),n.stencilFront.compare=Z)}if(!H1(n.stencilBack,e.stencilBack)){var Y=e.stencilBack,y=Y.passOp,A=Y.failOp,O=Y.depthFailOp,Z=Y.compare;(n.stencilBack.passOp!==y||n.stencilBack.failOp!==A||n.stencilBack.depthFailOp!==O)&&(r.stencilOpSeparate(r.BACK,A,O,y),n.stencilBack.passOp=y,n.stencilBack.failOp=A,n.stencilBack.depthFailOp=O),n.stencilBack.compare!==Z&&(this.setStencilReference(0),n.stencilBack.compare=Z)}(n.stencilFront.mask!==e.stencilFront.mask||n.stencilBack.mask!==e.stencilBack.mask)&&(n.stencilFront.mask=e.stencilFront.mask,n.stencilBack.mask=e.stencilBack.mask,this.applyStencil()),n.cullMode!==e.cullMode&&(n.cullMode===Jd.NONE?r.enable(r.CULL_FACE):e.cullMode===Jd.NONE&&r.disable(r.CULL_FACE),e.cullMode===Jd.BACK?r.cullFace(r.BACK):e.cullMode===Jd.FRONT?r.cullFace(r.FRONT):e.cullMode===Jd.FRONT_AND_BACK&&r.cullFace(r.FRONT_AND_BACK),n.cullMode=e.cullMode),n.frontFace!==e.frontFace&&(r.frontFace(e.frontFace),n.frontFace=e.frontFace),n.polygonOffset!==e.polygonOffset&&(e.polygonOffset?(r.polygonOffset(1,1),r.enable(r.POLYGON_OFFSET_FILL)):r.disable(r.POLYGON_OFFSET_FILL),n.polygonOffset=e.polygonOffset)},t.prototype.validatePipelineFormats=function(e){for(var r=0;r<this.currentColorAttachments.length;r++)var n=this.currentColorAttachments[r];this.currentDepthStencilAttachment&&Cs(this.currentDepthStencilAttachment.format===e.depthStencilAttachmentFormat),this.currentSampleCount!==-1&&Cs(this.currentSampleCount===e.sampleCount)},t.prototype.setPipeline=function(e){var r=this;if(this.renderBundle){this.renderBundle.push(function(){return r.setPipeline(e)});return}this.currentPipeline=e,this.validatePipelineFormats(this.currentPipeline),this.setMegaState(this.currentPipeline.megaState);var n=this.currentPipeline.program;if(this.useProgram(n),n.compileState===Qd.NeedsBind){var a=this.gl,u=n.gl_program,y=n.descriptor,A=xS(y.vertex.glsl,tL);if(ea(a))for(var O=0;O<A.length;O++){var Z=(0,wo.__read)(A[O],2),Y=Z[1],Q=a.getUniformBlockIndex(u,Y);Q!==-1&&Q!==4294967295&&a.uniformBlockBinding(u,Q,O)}for(var ae=xS(y.fragment.glsl,/^uniform .*sampler\S+ (\w+);\s* \/\/ BINDING=(\d+)$/gm),O=0;O<ae.length;O++){var xe=(0,wo.__read)(ae[O],3),Be=xe[1],it=xe[2],gt=a.getUniformLocation(u,Be);a.uniform1i(gt,parseInt(it))}n.compileState=Qd.ReadyToUse}},t.prototype.setVertexInput=function(e,r,n){var a,u,y=this,A;if(this.renderBundle){this.renderBundle.push(function(){return y.setVertexInput(e,r,n)});return}if(e!==null){Cs(this.currentPipeline.inputLayout===e);var O=e;this.bindVAO(O.vao);for(var Z=this.gl,Y=0;Y<O.vertexBufferDescriptors.length;Y++){var Q=O.vertexBufferDescriptors[Y],ae=Q.arrayStride,xe=Q.attributes;try{for(var Be=(a=void 0,(0,wo.__values)(xe)),it=Be.next();!it.done;it=Be.next()){var gt=it.value,Bt=gt.shaderLocation,Rt=gt.offset,Yt=ea(Z)?Bt:(A=O.program.attributes[Bt])===null||A===void 0?void 0:A.location;if(!(0,Dm.Z)(Yt)){var vr=r[Y];if(vr===null)continue;var ln=gt.vertexFormat;Z.bindBuffer(Z.ARRAY_BUFFER,ev(vr.buffer));var cn=(vr.offset||0)+Rt;Z.vertexAttribPointer(Yt,ln.size,ln.type,ln.normalized,ae,cn)}}}catch(Pn){a={error:Pn}}finally{try{it&&!it.done&&(u=Be.return)&&u.call(Be)}finally{if(a)throw a.error}}}if(Cs(n!==null==(O.indexBufferFormat!==null)),n!==null){var Gr=n.buffer;Cs(Gr.usage===ac.INDEX),Z.bindBuffer(Z.ELEMENT_ARRAY_BUFFER,ev(Gr)),this.currentIndexBufferByteOffset=n.offset||0}else this.currentIndexBufferByteOffset=null}else Cs(this.currentPipeline.inputLayout===null),Cs(n===null),this.bindVAO(null),this.currentIndexBufferByteOffset=0},t.prototype.setStencilReference=function(e){this.currentStencilRef!==e&&(this.currentStencilRef=e,this.applyStencil())},t.prototype.draw=function(e,r,n,a){var u,y=this;if(this.renderBundle){this.renderBundle.push(function(){return y.draw(e,r,n,a)});return}var A=this.gl,O=this.currentPipeline;if(r){var Z=[O.drawMode,n||0,e,r];ea(A)?A.drawArraysInstanced.apply(A,(0,wo.__spreadArray)([],(0,wo.__read)(Z),!1)):(u=this.ANGLE_instanced_arrays).drawArraysInstancedANGLE.apply(u,(0,wo.__spreadArray)([],(0,wo.__read)(Z),!1))}else A.drawArrays(O.drawMode,n,e);this.debugGroupStatisticsDrawCall(),this.debugGroupStatisticsTriangles(e/3*Math.max(r,1))},t.prototype.drawIndexed=function(e,r,n,a,u){var y,A=this;if(this.renderBundle){this.renderBundle.push(function(){return A.drawIndexed(e,r,n,a,u)});return}var O=this.gl,Z=this.currentPipeline,Y=s0(Z.inputLayout),Q=s0(this.currentIndexBufferByteOffset)+n*Y.indexBufferCompByteSize;if(r){var ae=[Z.drawMode,e,Y.indexBufferType,Q,r];ea(O)?O.drawElementsInstanced.apply(O,(0,wo.__spreadArray)([],(0,wo.__read)(ae),!1)):(y=this.ANGLE_instanced_arrays).drawElementsInstancedANGLE.apply(y,(0,wo.__spreadArray)([],(0,wo.__read)(ae),!1))}else O.drawElements(Z.drawMode,e,Y.indexBufferType,Q);this.debugGroupStatisticsDrawCall(),this.debugGroupStatisticsTriangles(e/3*Math.max(r,1))},t.prototype.drawIndirect=function(e,r){},t.prototype.drawIndexedIndirect=function(e,r){},t.prototype.beginOcclusionQuery=function(e){var r=this.gl;if(ea(r)){var n=this.currentRenderPassDescriptor.occlusionQueryPool;r.beginQuery(n.gl_query_type,n.gl_query[e])}},t.prototype.endOcclusionQuery=function(){var e=this.gl;if(ea(e)){var r=this.currentRenderPassDescriptor.occlusionQueryPool;e.endQuery(r.gl_query_type)}},t.prototype.pipelineQueryReady=function(e){var r=e;return this.queryProgramReady(r.program)},t.prototype.pipelineForceReady=function(e){},t.prototype.endPass=function(){for(var e=this.gl,r=ea(e),n=!1,a=0;a<this.currentColorAttachments.length;a++){var u=this.currentColorAttachments[a];if(u!==null){var y=this.currentColorResolveTos[a],A=!1;y!==null&&(Cs(u.width===y.width&&u.height===y.height),this.setScissorRectEnabled(!1),r&&e.bindFramebuffer(e.READ_FRAMEBUFFER,this.resolveColorReadFramebuffer),this.resolveColorAttachmentsChanged&&r&&this.bindFramebufferAttachment(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,u,this.currentColorAttachmentLevels[a]),A=!0,y===this.scTexture?e.bindFramebuffer(r?qt.DRAW_FRAMEBUFFER:qt.FRAMEBUFFER,this.scPlatformFramebuffer):(e.bindFramebuffer(r?qt.DRAW_FRAMEBUFFER:qt.FRAMEBUFFER,this.resolveColorDrawFramebuffer),this.resolveColorAttachmentsChanged&&e.framebufferTexture2D(r?qt.DRAW_FRAMEBUFFER:qt.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,y.gl_texture,this.currentColorResolveToLevels[a])),r?(e.blitFramebuffer(0,0,u.width,u.height,0,0,y.width,y.height,e.COLOR_BUFFER_BIT,e.LINEAR),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null)):this.submitBlitRenderPass(u,y),n=!0),this.currentRenderPassDescriptor.colorStore[a]||A||(e.bindFramebuffer(r?qt.READ_FRAMEBUFFER:qt.FRAMEBUFFER,this.resolveColorReadFramebuffer),this.resolveColorAttachmentsChanged&&this.bindFramebufferAttachment(r?qt.READ_FRAMEBUFFER:qt.FRAMEBUFFER,e.COLOR_ATTACHMENT0,u,this.currentColorAttachmentLevels[a])),e.bindFramebuffer(r?qt.READ_FRAMEBUFFER:qt.FRAMEBUFFER,null)}}this.resolveColorAttachmentsChanged=!1;var O=this.currentDepthStencilAttachment;if(O){var Z=this.currentDepthStencilResolveTo,A=!1;Z&&(Cs(O.width===Z.width&&O.height===Z.height),this.setScissorRectEnabled(!1),e.bindFramebuffer(r?qt.READ_FRAMEBUFFER:qt.FRAMEBUFFER,this.resolveDepthStencilReadFramebuffer),e.bindFramebuffer(r?qt.DRAW_FRAMEBUFFER:qt.FRAMEBUFFER,this.resolveDepthStencilDrawFramebuffer),this.resolveDepthStencilAttachmentsChanged&&(this.bindFramebufferDepthStencilAttachment(r?qt.READ_FRAMEBUFFER:qt.FRAMEBUFFER,O),this.bindFramebufferDepthStencilAttachment(r?qt.DRAW_FRAMEBUFFER:qt.FRAMEBUFFER,Z)),A=!0,r&&e.blitFramebuffer(0,0,O.width,O.height,0,0,Z.width,Z.height,e.DEPTH_BUFFER_BIT,e.NEAREST),e.bindFramebuffer(r?qt.DRAW_FRAMEBUFFER:qt.FRAMEBUFFER,null),n=!0),this.currentRenderPassDescriptor.depthStencilStore||(A||(e.bindFramebuffer(r?qt.READ_FRAMEBUFFER:qt.FRAMEBUFFER,this.resolveDepthStencilReadFramebuffer),this.resolveDepthStencilAttachmentsChanged&&this.bindFramebufferDepthStencilAttachment(r?qt.READ_FRAMEBUFFER:qt.FRAMEBUFFER,O),A=!0),r&&e.invalidateFramebuffer(e.READ_FRAMEBUFFER,[e.DEPTH_STENCIL_ATTACHMENT])),A&&e.bindFramebuffer(r?qt.READ_FRAMEBUFFER:qt.FRAMEBUFFER,null),this.resolveDepthStencilAttachmentsChanged=!1}n||e.bindFramebuffer(r?qt.DRAW_FRAMEBUFFER:qt.FRAMEBUFFER,null)},t.prototype.setScissorRectEnabled=function(e){if(this.currentScissorEnabled!==e){var r=this.gl;e?r.enable(r.SCISSOR_TEST):r.disable(r.SCISSOR_TEST),this.currentScissorEnabled=e}},t.prototype.applyStencil=function(){(0,Dm.Z)(this.currentStencilRef)||(this.gl.stencilFuncSeparate(qt.FRONT,this.currentMegaState.stencilFront.compare,this.currentStencilRef,this.currentMegaState.stencilFront.mask||255),this.gl.stencilFuncSeparate(qt.BACK,this.currentMegaState.stencilBack.compare,this.currentStencilRef,this.currentMegaState.stencilBack.mask||255))},t.prototype.getFallbackTexture=function(e){var r=e.gl_target,n=e.formatKind;if(r===qt.TEXTURE_2D)return n===Hh.Depth?this.fallbackTexture2DDepth:this.fallbackTexture2D;if(r===qt.TEXTURE_2D_ARRAY)return this.fallbackTexture2DArray;if(r===qt.TEXTURE_3D)return this.fallbackTexture3D;if(r===qt.TEXTURE_CUBE_MAP)return this.fallbackTextureCube;throw new Error("whoops")},t.prototype.submitBlitRenderPass=function(e,r){this.blitRenderPipeline||(this.blitProgram=this.createProgram({vertex:{glsl:`layout(location = 0) in vec2 a_Position;
out vec2 v_TexCoord;
void main() {
v_TexCoord = 0.5 * (a_Position + 1.0);
gl_Position = vec4(a_Position, 0., 1.);
#ifdef VIEWPORT_ORIGIN_TL
v_TexCoord.y = 1.0 - v_TexCoord.y;
#endif
}`},fragment:{glsl:`uniform sampler2D u_Texture;
in vec2 v_TexCoord;
out vec4 outputColor;
void main() {
outputColor = texture(SAMPLER_2D(u_Texture), v_TexCoord);
}`}}),this.blitVertexBuffer=this.createBuffer({usage:ac.VERTEX|ac.COPY_DST,viewOrSize:new Float32Array([-4,-4,4,-4,0,4])}),this.blitInputLayout=this.createInputLayout({vertexBufferDescriptors:[{arrayStride:4*2,stepMode:a0.VERTEX,attributes:[{format:yr.F32_RG,offset:4*0,shaderLocation:0}]}],indexBufferFormat:null,program:this.blitProgram}),this.blitRenderPipeline=this.createRenderPipeline({topology:Ip.TRIANGLES,sampleCount:1,program:this.blitProgram,colorAttachmentFormats:[yr.U8_RGBA_RT],depthStencilAttachmentFormat:null,inputLayout:this.blitInputLayout,megaStateDescriptor:J0(l0)}),this.blitBindings=this.createBindings({samplerBindings:[{sampler:null,texture:e.texture}],uniformBufferBindings:[]}),this.blitProgram.setUniformsLegacy({u_Texture:e}));var n=this.currentRenderPassDescriptor;this.currentRenderPassDescriptor=null,this.inBlitRenderPass=!0;var a=this.createRenderPass({colorAttachment:[e],colorResolveTo:[r],colorClearColor:[KI]}),u=this.getCanvas(),y=u.width,A=u.height;a.setPipeline(this.blitRenderPipeline),a.setBindings(this.blitBindings),a.setVertexInput(this.blitInputLayout,[{buffer:this.blitVertexBuffer}],null),a.setViewport(0,0,y,A),this.gl.disable(this.gl.BLEND),a.draw(3,0),this.gl.enable(this.gl.BLEND),this.currentRenderPassDescriptor=n,this.inBlitRenderPass=!1},t}(),nL=function(){function t(e){this.pluginOptions=e}return t.prototype.createSwapChain=function(e){return(0,wo.__awaiter)(this,void 0,void 0,function(){var r,n,a,u,y,A,O,Z,Y,Q,ae,xe,Be;return(0,wo.__generator)(this,function(it){return r=this.pluginOptions,n=r.targets,a=r.xrCompatible,u=r.antialias,y=u===void 0?!1:u,A=r.preserveDrawingBuffer,O=A===void 0?!1:A,Z=r.premultipliedAlpha,Y=Z===void 0?!0:Z,Q=r.shaderDebug,ae=r.trackResources,xe={antialias:y,preserveDrawingBuffer:O,stencil:!0,premultipliedAlpha:Y,xrCompatible:a},this.handleContextEvents(e),n.includes("webgl2")&&(Be=e.getContext("webgl2",xe)||e.getContext("experimental-webgl2",xe)),!Be&&n.includes("webgl1")&&(Be=e.getContext("webgl",xe)||e.getContext("experimental-webgl",xe)),[2,new rL(Be,{shaderDebug:Q,trackResources:ae})]})})},t.prototype.handleContextEvents=function(e){var r=this.pluginOptions,n=r.onContextLost,a=r.onContextRestored,u=r.onContextCreationError;u&&e.addEventListener("webglcontextcreationerror",u,!1),n&&e.addEventListener("webglcontextlost",n,!1),a&&e.addEventListener("webglcontextrestored",a,!1)},t}();let Wh;const ES=typeof TextDecoder!="undefined"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder!="undefined"&&ES.decode();let T_=null;function X1(){return(T_===null||T_.byteLength===0)&&(T_=new Uint8Array(Wh.memory.buffer)),T_}function q1(t,e){return t=t>>>0,ES.decode(X1().subarray(t,t+e))}const Ag=new Array(128).fill(void 0);Ag.push(void 0,null,!0,!1);let A_=Ag.length;function iL(t){A_===Ag.length&&Ag.push(Ag.length+1);const e=A_;return A_=Ag[e],Ag[e]=t,e}function Y1(t){return Ag[t]}function oL(t){t<132||(Ag[t]=A_,A_=t)}function aL(t){const e=Y1(t);return oL(t),e}let rv=0;const $1=typeof TextEncoder!="undefined"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},sL=typeof $1.encodeInto=="function"?function(t,e){return $1.encodeInto(t,e)}:function(t,e){const r=$1.encode(t);return e.set(r),{read:t.length,written:r.length}};function K1(t,e,r){if(r===void 0){const A=$1.encode(t),O=e(A.length,1)>>>0;return X1().subarray(O,O+A.length).set(A),rv=A.length,O}let n=t.length,a=e(n,1)>>>0;const u=X1();let y=0;for(;y<n;y++){const A=t.charCodeAt(y);if(A>127)break;u[a+y]=A}if(y!==n){y!==0&&(t=t.slice(y)),a=r(a,n,n=y+t.length*3,1)>>>0;const A=X1().subarray(a+y,a+n),O=sL(t,A);y+=O.written}return rv=y,a}let C_=null;function J1(){return(C_===null||C_.byteLength===0)&&(C_=new Int32Array(Wh.memory.buffer)),C_}function lL(t,e,r){let n,a;try{const A=Wh.__wbindgen_add_to_stack_pointer(-16),O=K1(t,Wh.__wbindgen_malloc,Wh.__wbindgen_realloc),Z=rv,Y=K1(e,Wh.__wbindgen_malloc,Wh.__wbindgen_realloc),Q=rv;Wh.glsl_compile(A,O,Z,Y,Q,r);var u=J1()[A/4+0],y=J1()[A/4+1];return n=u,a=y,q1(u,y)}finally{Wh.__wbindgen_add_to_stack_pointer(16),Wh.__wbindgen_free(n,a,1)}}class M_{static __wrap(e){e=e>>>0;const r=Object.create(M_.prototype);return r.__wbg_ptr=e,r}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,e}free(){const e=this.__destroy_into_raw();Wh.__wbg_wgslcomposer_free(e)}constructor(){const e=Wh.wgslcomposer_new();return M_.__wrap(e)}load_composable(e){const r=K1(e,Wh.__wbindgen_malloc,Wh.__wbindgen_realloc),n=rv;Wh.wgslcomposer_load_composable(this.__wbg_ptr,r,n)}wgsl_compile(e){let r,n;try{const y=Wh.__wbindgen_add_to_stack_pointer(-16),A=K1(e,Wh.__wbindgen_malloc,Wh.__wbindgen_realloc),O=rv;Wh.wgslcomposer_wgsl_compile(y,this.__wbg_ptr,A,O);var a=J1()[y/4+0],u=J1()[y/4+1];return r=a,n=u,q1(a,u)}finally{Wh.__wbindgen_add_to_stack_pointer(16),Wh.__wbindgen_free(r,n,1)}}}function uL(t,e){return oE(this,null,function*(){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return yield WebAssembly.instantiateStreaming(t,e)}catch(n){if(t.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}const r=yield t.arrayBuffer();return yield WebAssembly.instantiate(r,e)}else{const r=yield WebAssembly.instantiate(t,e);return r instanceof WebAssembly.Instance?{instance:r,module:t}:r}})}function cL(){const t={};return t.wbg={},t.wbg.__wbindgen_string_new=function(e,r){const n=q1(e,r);return iL(n)},t.wbg.__wbindgen_object_drop_ref=function(e){aL(e)},t.wbg.__wbg_log_1d3ae0273d8f4f8a=function(e){console.log(Y1(e))},t.wbg.__wbg_log_576ca876af0d4a77=function(e,r){console.log(Y1(e),Y1(r))},t.wbg.__wbindgen_throw=function(e,r){throw new Error(q1(e,r))},t}function hL(t,e){return Wh=t.exports,wS.__wbindgen_wasm_module=e,C_=null,T_=null,Wh}function wS(t){return oE(this,null,function*(){if(Wh!==void 0)return Wh;const e=cL();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));const{instance:r,module:n}=yield uL(yield t,e);return hL(r,n)})}var mf;(function(t){t[t.COPY_SRC=1]="COPY_SRC",t[t.COPY_DST=2]="COPY_DST",t[t.TEXTURE_BINDING=4]="TEXTURE_BINDING",t[t.STORAGE_BINDING=8]="STORAGE_BINDING",t[t.STORAGE=8]="STORAGE",t[t.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"})(mf||(mf={}));var Q2;(function(t){t[t.READ=1]="READ",t[t.WRITE=2]="WRITE"})(Q2||(Q2={}));function pL(t){var e=0;return t&ad.SAMPLED&&(e|=mf.TEXTURE_BINDING|mf.COPY_DST|mf.COPY_SRC),t&ad.STORAGE&&(e|=mf.TEXTURE_BINDING|mf.STORAGE_BINDING|mf.COPY_SRC|mf.COPY_DST),t&ad.RENDER_TARGET&&(e|=mf.RENDER_ATTACHMENT|mf.TEXTURE_BINDING|mf.COPY_SRC|mf.COPY_DST),e}function eE(t){if(t===yr.U8_R_NORM)return"r8unorm";if(t===yr.S8_R_NORM)return"r8snorm";if(t===yr.U8_RG_NORM)return"rg8unorm";if(t===yr.S8_RG_NORM)return"rg8snorm";if(t===yr.U32_R)return"r32uint";if(t===yr.S32_R)return"r32sint";if(t===yr.F32_R)return"r32float";if(t===yr.U16_RG)return"rg16uint";if(t===yr.S16_RG)return"rg16sint";if(t===yr.F16_RG)return"rg16float";if(t===yr.U8_RGBA_RT)return"bgra8unorm";if(t===yr.U8_RGBA_RT_SRGB)return"bgra8unorm-srgb";if(t===yr.U8_RGBA_NORM)return"rgba8unorm";if(t===yr.U8_RGBA_SRGB)return"rgba8unorm-srgb";if(t===yr.S8_RGBA_NORM)return"rgba8snorm";if(t===yr.U32_RG)return"rg32uint";if(t===yr.S32_RG)return"rg32sint";if(t===yr.F32_RG)return"rg32float";if(t===yr.U16_RGBA)return"rgba16uint";if(t===yr.S16_RGBA)return"rgba16sint";if(t===yr.F16_RGBA)return"rgba16float";if(t===yr.F32_RGBA)return"rgba32float";if(t===yr.U32_RGBA)return"rgba32uint";if(t===yr.S32_RGBA)return"rgba32sint";if(t===yr.D24)return"depth24plus";if(t===yr.D24_S8)return"depth24plus-stencil8";if(t===yr.D32F)return"depth32float";if(t===yr.D32F_S8)return"depth32float-stencil8";if(t===yr.BC1)return"bc1-rgba-unorm";if(t===yr.BC1_SRGB)return"bc1-rgba-unorm-srgb";if(t===yr.BC2)return"bc2-rgba-unorm";if(t===yr.BC2_SRGB)return"bc2-rgba-unorm-srgb";if(t===yr.BC3)return"bc3-rgba-unorm";if(t===yr.BC3_SRGB)return"bc3-rgba-unorm-srgb";if(t===yr.BC4_SNORM)return"bc4-r-snorm";if(t===yr.BC4_UNORM)return"bc4-r-unorm";if(t===yr.BC5_SNORM)return"bc5-rg-snorm";if(t===yr.BC5_UNORM)return"bc5-rg-unorm";throw"whoops"}function fL(t){if(t===rl.TEXTURE_2D)return"2d";if(t===rl.TEXTURE_CUBE_MAP)return"2d";if(t===rl.TEXTURE_2D_ARRAY)return"2d";if(t===rl.TEXTURE_3D)return"3d";throw new Error("whoops")}function dL(t){if(t===rl.TEXTURE_2D)return"2d";if(t===rl.TEXTURE_CUBE_MAP)return"cube";if(t===rl.TEXTURE_2D_ARRAY)return"2d-array";if(t===rl.TEXTURE_3D)return"3d";throw new Error("whoops")}function mL(t){var e=0;return t&ac.INDEX&&(e|=GPUBufferUsage.INDEX),t&ac.VERTEX&&(e|=GPUBufferUsage.VERTEX),t&ac.UNIFORM&&(e|=GPUBufferUsage.UNIFORM),t&ac.STORAGE&&(e|=GPUBufferUsage.STORAGE),t&ac.COPY_SRC&&(e|=GPUBufferUsage.COPY_SRC),t&ac.INDIRECT&&(e|=GPUBufferUsage.INDIRECT),e|=GPUBufferUsage.COPY_DST,e}function tE(t){if(t===Id.CLAMP_TO_EDGE)return"clamp-to-edge";if(t===Id.REPEAT)return"repeat";if(t===Id.MIRRORED_REPEAT)return"mirror-repeat";throw new Error("whoops")}function SS(t){if(t===pp.BILINEAR)return"linear";if(t===pp.POINT)return"nearest";throw new Error("whoops")}function gL(t){if(t===df.LINEAR)return"linear";if(t===df.NEAREST)return"nearest";if(t===df.NO_MIP)return"nearest";throw new Error("whoops")}function nv(t){var e=t;return e.gpuBuffer}function vL(t){var e=t;return e.gpuSampler}function _L(t){var e=t;return e.querySet}function yL(t){if(t===N1.OcclusionConservative)return"occlusion";throw new Error("whoops")}function xL(t){switch(t){case Ip.TRIANGLES:return"triangle-list";case Ip.POINTS:return"point-list";case Ip.TRIANGLE_STRIP:return"triangle-strip";case Ip.LINES:return"line-list";case Ip.LINE_STRIP:return"line-strip";default:throw new Error("Unknown primitive topology mode")}}function bL(t){if(t===Jd.NONE)return"none";if(t===Jd.FRONT)return"front";if(t===Jd.BACK)return"back";throw new Error("whoops")}function EL(t){if(t===x_.CCW)return"ccw";if(t===x_.CW)return"cw";throw new Error("whoops")}function wL(t,e){return{topology:xL(t),cullMode:bL(e.cullMode),frontFace:EL(e.frontFace)}}function TS(t){if(t===pl.ZERO)return"zero";if(t===pl.ONE)return"one";if(t===pl.SRC)return"src";if(t===pl.ONE_MINUS_SRC)return"one-minus-src";if(t===pl.DST)return"dst";if(t===pl.ONE_MINUS_DST)return"one-minus-dst";if(t===pl.SRC_ALPHA)return"src-alpha";if(t===pl.ONE_MINUS_SRC_ALPHA)return"one-minus-src-alpha";if(t===pl.DST_ALPHA)return"dst-alpha";if(t===pl.ONE_MINUS_DST_ALPHA)return"one-minus-dst-alpha";if(t===pl.CONST)return"constant";if(t===pl.ONE_MINUS_CONSTANT)return"one-minus-constant";if(t===pl.SRC_ALPHA_SATURATE)return"src-alpha-saturated";throw new Error("whoops")}function SL(t){if(t===If.ADD)return"add";if(t===If.SUBSTRACT)return"subtract";if(t===If.REVERSE_SUBSTRACT)return"reverse-subtract";if(t===If.MIN)return"min";if(t===If.MAX)return"max";throw new Error("whoops")}function AS(t){return{operation:SL(t.blendMode),srcFactor:TS(t.blendSrcFactor),dstFactor:TS(t.blendDstFactor)}}function CS(t){return t.blendMode===If.ADD&&t.blendSrcFactor===pl.ONE&&t.blendDstFactor===pl.ZERO}function TL(t){if(!(CS(t.rgbBlendState)&&CS(t.alphaBlendState)))return{color:AS(t.rgbBlendState),alpha:AS(t.alphaBlendState)}}function AL(t,e){return{format:eE(e),blend:TL(t),writeMask:t.channelWriteMask}}function CL(t,e){return e.attachmentsState.map(function(r,n){return AL(r,t[n])})}function Q1(t){if(t===js.NEVER)return"never";if(t===js.LESS)return"less";if(t===js.EQUAL)return"equal";if(t===js.LEQUAL)return"less-equal";if(t===js.GREATER)return"greater";if(t===js.NOTEQUAL)return"not-equal";if(t===js.GEQUAL)return"greater-equal";if(t===js.ALWAYS)return"always";throw new Error("whoops")}function iv(t){if(t===jh.KEEP)return"keep";if(t===jh.REPLACE)return"replace";if(t===jh.ZERO)return"zero";if(t===jh.DECREMENT_CLAMP)return"decrement-clamp";if(t===jh.DECREMENT_WRAP)return"decrement-wrap";if(t===jh.INCREMENT_CLAMP)return"increment-clamp";if(t===jh.INCREMENT_WRAP)return"increment-wrap";if(t===jh.INVERT)return"invert";throw new Error("whoops")}function ML(t,e){if(!(0,Dm.Z)(t))return{format:eE(t),depthWriteEnabled:!!e.depthWrite,depthCompare:Q1(e.depthCompare),depthBias:e.polygonOffset?1:0,depthBiasSlopeScale:e.polygonOffset?1:0,stencilFront:{compare:Q1(e.stencilFront.compare),passOp:iv(e.stencilFront.passOp),failOp:iv(e.stencilFront.failOp),depthFailOp:iv(e.stencilFront.depthFailOp)},stencilBack:{compare:Q1(e.stencilBack.compare),passOp:iv(e.stencilBack.passOp),failOp:iv(e.stencilBack.failOp),depthFailOp:iv(e.stencilBack.depthFailOp)},stencilReadMask:4294967295,stencilWriteMask:4294967295}}function PL(t){if(t!==null){if(t===yr.U16_R)return"uint16";if(t===yr.U32_R)return"uint32";throw new Error("whoops")}}function RL(t){if(t===a0.VERTEX)return"vertex";if(t===a0.INSTANCE)return"instance";throw new Error("whoops")}function IL(t){if(t===yr.U8_R)return"uint8x2";if(t===yr.U8_RG)return"uint8x2";if(t===yr.U8_RGB)return"uint8x4";if(t===yr.U8_RGBA)return"uint8x4";if(t===yr.U8_RG_NORM)return"unorm8x2";if(t===yr.U8_RGBA_NORM)return"unorm8x4";if(t===yr.S8_RGB_NORM)return"snorm8x4";if(t===yr.S8_RGBA_NORM)return"snorm8x4";if(t===yr.U16_RG_NORM)return"unorm16x2";if(t===yr.U16_RGBA_NORM)return"unorm16x4";if(t===yr.S16_RG_NORM)return"snorm16x2";if(t===yr.S16_RGBA_NORM)return"snorm16x4";if(t===yr.S16_RG)return"uint16x2";if(t===yr.F16_RG)return"float16x2";if(t===yr.F16_RGBA)return"float16x4";if(t===yr.F32_R)return"float32";if(t===yr.F32_RG)return"float32x2";if(t===yr.F32_RGB)return"float32x3";if(t===yr.F32_RGBA)return"float32x4";throw"whoops"}function LL(t){var e=ig(t);switch(e){case zn.BC1:case zn.BC2:case zn.BC3:case zn.BC4_SNORM:case zn.BC4_UNORM:case zn.BC5_SNORM:case zn.BC5_UNORM:return!0;default:return!1}}function DL(t){var e=ig(t);switch(e){case zn.BC1:case zn.BC2:case zn.BC3:case zn.BC4_SNORM:case zn.BC4_UNORM:case zn.BC5_SNORM:case zn.BC5_UNORM:return 4;default:return 1}}function MS(t,e,r,n){switch(r===void 0&&(r=!1),t){case yr.S8_R:case yr.S8_R_NORM:case yr.S8_RG_NORM:case yr.S8_RGB_NORM:case yr.S8_RGBA_NORM:{var a=e instanceof ArrayBuffer?new Int8Array(e):new Int8Array(e);return n&&a.set(new Int8Array(n)),a}case yr.U8_R:case yr.U8_R_NORM:case yr.U8_RG:case yr.U8_RG_NORM:case yr.U8_RGB:case yr.U8_RGB_NORM:case yr.U8_RGB_SRGB:case yr.U8_RGBA:case yr.U8_RGBA_NORM:case yr.U8_RGBA_SRGB:{var u=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e);return n&&u.set(new Uint8Array(n)),u}case yr.S16_R:case yr.S16_RG:case yr.S16_RG_NORM:case yr.S16_RGB_NORM:case yr.S16_RGBA:case yr.S16_RGBA_NORM:{var y=e instanceof ArrayBuffer?new Int16Array(e):new Int16Array(r?e/2:e);return n&&y.set(new Int16Array(n)),y}case yr.U16_R:case yr.U16_RGB:case yr.U16_RGBA_5551:case yr.U16_RGBA_NORM:case yr.U16_RG_NORM:case yr.U16_R_NORM:{var A=e instanceof ArrayBuffer?new Uint16Array(e):new Uint16Array(r?e/2:e);return n&&A.set(new Uint16Array(n)),A}case yr.S32_R:{var O=e instanceof ArrayBuffer?new Int32Array(e):new Int32Array(r?e/4:e);return n&&O.set(new Int32Array(n)),O}case yr.U32_R:case yr.U32_RG:{var Z=e instanceof ArrayBuffer?new Uint32Array(e):new Uint32Array(r?e/4:e);return n&&Z.set(new Uint32Array(n)),Z}case yr.F32_R:case yr.F32_RG:case yr.F32_RGB:case yr.F32_RGBA:{var Y=e instanceof ArrayBuffer?new Float32Array(e):new Float32Array(r?e/4:e);return n&&Y.set(new Float32Array(n)),Y}}var Q=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e);return n&&Q.set(new Uint8Array(n)),Q}function OL(t){var e=(t&32768)>>15,r=(t&31744)>>10,n=t&1023;return r===0?(e?-1:1)*Math.pow(2,-14)*(n/Math.pow(2,10)):r==31?n?NaN:(e?-1:1)*(1/0):(e?-1:1)*Math.pow(2,r-15)*(1+n/Math.pow(2,10))}function PS(t){switch(t){case"r8unorm":case"r8snorm":case"r8uint":case"r8sint":return{width:1,height:1,length:1};case"r16uint":case"r16sint":case"r16float":case"rg8unorm":case"rg8snorm":case"rg8uint":case"rg8sint":return{width:1,height:1,length:2};case"r32uint":case"r32sint":case"r32float":case"rg16uint":case"rg16sint":case"rg16float":case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8snorm":case"rgba8uint":case"rgba8sint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgb9e5ufloat":case"rgb10a2unorm":case"rg11b10ufloat":return{width:1,height:1,length:4};case"rg32uint":case"rg32sint":case"rg32float":case"rgba16uint":case"rgba16sint":case"rgba16float":return{width:1,height:1,length:8};case"rgba32uint":case"rgba32sint":case"rgba32float":return{width:1,height:1,length:16};case"stencil8":throw new Error("No fixed size for Stencil8 format!");case"depth16unorm":return{width:1,height:1,length:2};case"depth24plus":throw new Error("No fixed size for Depth24Plus format!");case"depth24plus-stencil8":throw new Error("No fixed size for Depth24PlusStencil8 format!");case"depth32float":return{width:1,height:1,length:4};case"depth32float-stencil8":return{width:1,height:1,length:5};case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc6h-rgb-ufloat":case"bc6h-rgb-float":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc5-rg-unorm":case"bc5-rg-snorm":return{width:4,height:4,length:16};case"bc4-r-unorm":case"bc4-r-snorm":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":return{width:4,height:4,length:8};default:return{width:1,height:1,length:4}}}var Wm=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=t.call(this)||this;return u.id=n,u.device=a,u}return e.prototype.destroy=function(){},e}(K3),BL=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y,A,O=t.call(this,{id:n,device:a})||this;O.type=Jl.Bindings;var Z=u.pipeline;Cs(!!Z);var Y=u.uniformBufferBindings,Q=u.storageBufferBindings,ae=u.samplerBindings,xe=u.storageTextureBindings;O.numUniformBuffers=(Y==null?void 0:Y.length)||0;var Be=[[],[],[],[]],it=0;if(Y&&Y.length)for(var gt=0;gt<Y.length;gt++){var Bt=u.uniformBufferBindings[gt],Rt=Bt.binding,Yt=Bt.size,vr=Bt.offset,ln=Bt.buffer,cn={buffer:nv(ln),offset:vr!=null?vr:0,size:Yt};Be[0].push({binding:Rt!=null?Rt:it++,resource:cn})}if(ae&&ae.length){it=0;for(var gt=0;gt<ae.length;gt++){var Gr=(0,wo.__assign)((0,wo.__assign)({},ae[gt]),lS),Rt=u.samplerBindings[gt],Pn=Rt.texture!==null?Rt.texture:O.device.getFallbackTexture(Gr);Gr.dimension=Pn.dimension,Gr.formatKind=tS(Pn.format);var Oo=Pn.gpuTextureView;if(Be[1].push({binding:(y=Rt.textureBinding)!==null&&y!==void 0?y:it++,resource:Oo}),Rt.samplerBinding!==-1){var Da=Rt.sampler!==null?Rt.sampler:O.device.getFallbackSampler(Gr),Bo=vL(Da);Be[1].push({binding:(A=Rt.samplerBinding)!==null&&A!==void 0?A:it++,resource:Bo})}}}if(Q&&Q.length){it=0;for(var gt=0;gt<Q.length;gt++){var Oa=u.storageBufferBindings[gt],Rt=Oa.binding,Yt=Oa.size,vr=Oa.offset,ln=Oa.buffer,cn={buffer:nv(ln),offset:vr!=null?vr:0,size:Yt};Be[2].push({binding:Rt!=null?Rt:it++,resource:cn})}}if(xe&&xe.length){it=0;for(var gt=0;gt<xe.length;gt++){var fl=u.storageTextureBindings[gt],Rt=fl.binding,Pn=fl.texture,Oo=Pn.gpuTextureView;Be[3].push({binding:Rt!=null?Rt:it++,resource:Oo})}}var Gp=Be.findLastIndex(function(Wp){return!!Wp.length});return O.gpuBindGroup=Be.map(function(Wp,nl){return nl<=Gp&&O.device.device.createBindGroup({layout:Z.getBindGroupLayout(nl),entries:Wp})}),O}return e}(Wm),FL=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=t.call(this,{id:n,device:a})||this;y.type=Jl.Buffer;var A=u.usage,O=u.viewOrSize,Z=!!(A&ac.MAP_READ);y.usage=mL(A),Z&&(y.usage=ac.MAP_READ|ac.COPY_DST);var Y=!(0,X0.Z)(O);if(y.view=(0,X0.Z)(O)?null:O,y.size=(0,X0.Z)(O)?V1(O,4):V1(O.byteLength,4),(0,X0.Z)(O))y.gpuBuffer=y.device.device.createBuffer({usage:y.usage,size:y.size,mappedAtCreation:Z?Y:!1});else{y.gpuBuffer=y.device.device.createBuffer({usage:y.usage,size:y.size,mappedAtCreation:!0});var Q=O&&O.constructor||Float32Array;new Q(y.gpuBuffer.getMappedRange()).set(O),y.gpuBuffer.unmap()}return y}return e.prototype.setSubData=function(r,n,a,u){a===void 0&&(a=0),u===void 0&&(u=0);var y=this.gpuBuffer;u=u||n.byteLength,u=Math.min(u,this.size-r);var A=n.byteOffset+a,O=A+u,Z=u+3&-4;if(Z!==u){var Y=new Uint8Array(n.buffer.slice(A,O));n=new Uint8Array(Z),n.set(Y),a=0,A=0,O=Z,u=Z}for(var Q=1024*1024*15,ae=0;O-(A+ae)>Q;)this.device.device.queue.writeBuffer(y,r+ae,n.buffer,A+ae,Q),ae+=Q;this.device.device.queue.writeBuffer(y,r+ae,n.buffer,A+ae,u-ae)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.gpuBuffer.destroy()},e}(Wm),RS=function(){function t(){this.gpuComputePassEncoder=null}return t.prototype.dispatchWorkgroups=function(e,r,n){this.gpuComputePassEncoder.dispatchWorkgroups(e,r,n)},t.prototype.dispatchWorkgroupsIndirect=function(e,r){this.gpuComputePassEncoder.dispatchWorkgroupsIndirect(e.gpuBuffer,r)},t.prototype.finish=function(){this.gpuComputePassEncoder.end(),this.gpuComputePassEncoder=null,this.frameCommandEncoder=null},t.prototype.beginComputePass=function(e){Cs(this.gpuComputePassEncoder===null),this.frameCommandEncoder=e,this.gpuComputePassEncoder=this.frameCommandEncoder.beginComputePass(this.gpuComputePassDescriptor)},t.prototype.setPipeline=function(e){var r=e,n=s0(r.gpuComputePipeline);this.gpuComputePassEncoder.setPipeline(n)},t.prototype.setBindings=function(e){var r=this,n=e;n.gpuBindGroup.forEach(function(a,u){a&&r.gpuComputePassEncoder.setBindGroup(u,n.gpuBindGroup[u])})},t.prototype.pushDebugGroup=function(e){this.gpuComputePassEncoder.pushDebugGroup(e)},t.prototype.popDebugGroup=function(){this.gpuComputePassEncoder.popDebugGroup()},t.prototype.insertDebugMarker=function(e){this.gpuComputePassEncoder.insertDebugMarker(e)},t}(),kL=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=t.call(this,{id:n,device:a})||this;y.type=Jl.ComputePipeline,y.gpuComputePipeline=null,y.descriptor=u;var A=u.program,O=A.computeStage;if(O===null)return y;var Z={layout:"auto",compute:(0,wo.__assign)({},O)};return y.gpuComputePipeline=y.device.device.createComputePipeline(Z),y.name!==void 0&&(y.gpuComputePipeline.label=y.name),y}return e.prototype.getBindGroupLayout=function(r){return this.gpuComputePipeline.getBindGroupLayout(r)},e}(Wm),NL=function(t){(0,wo.__extends)(e,t);function e(r){var n,a,u,y,A=r.id,O=r.device,Z=r.descriptor,Y=t.call(this,{id:A,device:O})||this;Y.type=Jl.InputLayout;var Q=[];try{for(var ae=(0,wo.__values)(Z.vertexBufferDescriptors),xe=ae.next();!xe.done;xe=ae.next()){var Be=xe.value,it=Be.arrayStride,gt=Be.stepMode,Bt=Be.attributes;Q.push({arrayStride:it,stepMode:RL(gt),attributes:[]});try{for(var Rt=(u=void 0,(0,wo.__values)(Bt)),Yt=Rt.next();!Yt.done;Yt=Rt.next()){var vr=Yt.value,ln=vr.shaderLocation,cn=vr.format,Gr=vr.offset;Q[Q.length-1].attributes.push({shaderLocation:ln,format:IL(cn),offset:Gr})}}catch(Pn){u={error:Pn}}finally{try{Yt&&!Yt.done&&(y=Rt.return)&&y.call(Rt)}finally{if(u)throw u.error}}}}catch(Pn){n={error:Pn}}finally{try{xe&&!xe.done&&(a=ae.return)&&a.call(ae)}finally{if(n)throw n.error}}return Y.indexFormat=PL(Z.indexBufferFormat),Y.buffers=Q,Y}return e}(Wm),IS=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=t.call(this,{id:n,device:a})||this;return y.type=Jl.Program,y.vertexStage=null,y.fragmentStage=null,y.computeStage=null,y.descriptor=u,u.vertex&&(y.vertexStage=y.createShaderStage(u.vertex,"vertex")),u.fragment&&(y.fragmentStage=y.createShaderStage(u.fragment,"fragment")),u.compute&&(y.computeStage=y.createShaderStage(u.compute,"compute")),y}return e.prototype.setUniformsLegacy=function(r){},e.prototype.createShaderStage=function(r,n){var a,u,y=r.glsl,A=r.wgsl,O=r.entryPoint,Z=r.postprocess,Y=!1,Q=A;if(!Q)try{Q=this.device.glsl_compile(y,n,Y)}catch(Bt){throw console.error(Bt,y),new Error("whoops")}var ae=function(Bt){if(!Q.includes(Bt))return"continue";Q=Q.replace("var T_".concat(Bt,": texture_2d<f32>;"),"var T_".concat(Bt,": texture_depth_2d;")),Q=Q.replace(new RegExp("textureSample\\(T_".concat(Bt,"(.*)\\);$"),"gm"),function(Rt,Yt){return"vec4<f32>(textureSample(T_".concat(Bt).concat(Yt,"), 0.0, 0.0, 0.0);")})};try{for(var xe=(0,wo.__values)(["u_TextureFramebufferDepth"]),Be=xe.next();!Be.done;Be=xe.next()){var it=Be.value;ae(it)}}catch(Bt){a={error:Bt}}finally{try{Be&&!Be.done&&(u=xe.return)&&u.call(xe)}finally{if(a)throw a.error}}Z&&(Q=Z(Q));var gt=this.device.device.createShaderModule({code:Q});return{module:gt,entryPoint:O||"main"}},e}(Wm),zL=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=t.call(this,{id:n,device:a})||this;y.type=Jl.QueryPool;var A=u.elemCount,O=u.type;return y.querySet=y.device.device.createQuerySet({type:yL(O),count:A}),y.resolveBuffer=y.device.device.createBuffer({size:A*8,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),y.cpuBuffer=y.device.device.createBuffer({size:A*8,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),y.results=null,y}return e.prototype.queryResultOcclusion=function(r){return this.results===null?null:this.results[r]!==BigInt(0)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.querySet.destroy(),this.resolveBuffer.destroy(),this.cpuBuffer.destroy()},e}(Wm),UL=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=t.call(this,{id:n,device:a})||this;return u.type=Jl.Readback,u}return e.prototype.readTexture=function(r,n,a,u,y,A,O,Z){return O===void 0&&(O=0),(0,wo.__awaiter)(this,void 0,void 0,function(){var Y,Q,ae,xe,Be,it,gt,Bt;return(0,wo.__generator)(this,function(Rt){return Y=r,Q=0,ae=PS(Y.gpuTextureformat),xe=Math.ceil(u/ae.width)*ae.length,Be=Math.ceil(xe/256)*256,it=Be*y,gt=this.device.createBuffer({usage:ac.STORAGE|ac.MAP_READ|ac.COPY_DST,hint:Gm.STATIC,viewOrSize:it}),Bt=this.device.device.createCommandEncoder(),Bt.copyTextureToBuffer({texture:Y.gpuTexture,mipLevel:0,origin:{x:n,y:a,z:Math.max(Q,0)}},{buffer:gt.gpuBuffer,offset:0,bytesPerRow:Be},{width:u,height:y,depthOrArrayLayers:1}),this.device.device.queue.submit([Bt.finish()]),[2,this.readBuffer(gt,0,A.byteLength===it?A:null,O,it,Y.format,!0,!1,xe,Be,y)]})})},e.prototype.readTextureSync=function(r,n,a,u,y,A,O,Z){throw new Error("ERROR_MSG_METHOD_NOT_IMPLEMENTED")},e.prototype.readBuffer=function(r,n,a,u,y,A,O,Z,Y,Q,ae){var xe=this;n===void 0&&(n=0),a===void 0&&(a=null),y===void 0&&(y=0),A===void 0&&(A=yr.U8_RGB),O===void 0&&(O=!1),Y===void 0&&(Y=0),Q===void 0&&(Q=0),ae===void 0&&(ae=0);var Be=r,it=y||Be.size,gt=a||Be.view,Bt=gt&&gt.constructor&&gt.constructor.BYTES_PER_ELEMENT||eS(A),Rt=Be;if(!(Be.usage&ac.MAP_READ&&Be.usage&ac.COPY_DST)){var Yt=this.device.device.createCommandEncoder();Rt=this.device.createBuffer({usage:ac.STORAGE|ac.MAP_READ|ac.COPY_DST,hint:Gm.STATIC,viewOrSize:it}),Yt.copyBufferToBuffer(Be.gpuBuffer,n,Rt.gpuBuffer,0,it),this.device.device.queue.submit([Yt.finish()])}return new Promise(function(vr,ln){Rt.gpuBuffer.mapAsync(Q2.READ,n,it).then(function(){var cn=Rt.gpuBuffer.getMappedRange(n,it),Gr=gt;if(O)Gr===null?Gr=MS(A,it,!0,cn):Gr=MS(A,Gr.buffer,void 0,cn);else if(Gr===null)switch(Bt){case 1:Gr=new Uint8Array(it),Gr.set(new Uint8Array(cn));break;case 2:Gr=xe.getHalfFloatAsFloatRGBAArrayBuffer(it/2,cn);break;case 4:Gr=new Float32Array(it/4),Gr.set(new Float32Array(cn));break}else switch(Bt){case 1:Gr=new Uint8Array(Gr.buffer),Gr.set(new Uint8Array(cn));break;case 2:Gr=xe.getHalfFloatAsFloatRGBAArrayBuffer(it/2,cn,gt);break;case 4:var Pn=gt&&gt.constructor||Float32Array;Gr=new Pn(Gr.buffer),Gr.set(new Pn(cn));break}if(Y!==Q){Bt===1&&!O&&(Y*=2,Q*=2);for(var Oo=new Uint8Array(Gr.buffer),Da=Y,Bo=0,Oa=1;Oa<ae;++Oa){Bo=Oa*Q;for(var fl=0;fl<Y;++fl)Oo[Da++]=Oo[Bo++]}Bt!==0&&!O?Gr=new Float32Array(Oo.buffer,0,Da/4):Gr=new Uint8Array(Oo.buffer,0,Da)}Rt.gpuBuffer.unmap(),vr(Gr)},function(cn){return ln(cn)})})},e.prototype.getHalfFloatAsFloatRGBAArrayBuffer=function(r,n,a){a||(a=new Float32Array(r));for(var u=new Uint16Array(n);r--;)a[r]=OL(u[r]);return a},e}(Wm),LS=function(){function t(e){this.device=e,this.gpuRenderPassEncoder=null,this.gfxColorAttachment=[],this.gfxColorAttachmentLevel=[],this.gfxColorResolveTo=[],this.gfxColorResolveToLevel=[],this.gfxDepthStencilAttachment=null,this.gfxDepthStencilResolveTo=null,this.gpuColorAttachments=[],this.gpuDepthStencilAttachment={view:null,depthLoadOp:"load",depthStoreOp:"store",stencilLoadOp:"load",stencilStoreOp:"store"},this.gpuRenderPassDescriptor={colorAttachments:this.gpuColorAttachments,depthStencilAttachment:this.gpuDepthStencilAttachment}}return t.prototype.getEncoder=function(){var e;return((e=this.renderBundle)===null||e===void 0?void 0:e.renderBundleEncoder)||this.gpuRenderPassEncoder},t.prototype.getTextureView=function(e,r){return Cs(r<e.mipLevelCount),e.mipLevelCount===1?e.gpuTextureView:e.gpuTexture.createView({baseMipLevel:r,mipLevelCount:1})},t.prototype.setRenderPassDescriptor=function(e){var r,n,a,u,y,A;this.descriptor=e,this.gpuRenderPassDescriptor.colorAttachments=this.gpuColorAttachments;var O=e.colorAttachment.length;this.gfxColorAttachment.length=O,this.gfxColorResolveTo.length=O;for(var Z=0;Z<e.colorAttachment.length;Z++){var Y=e.colorAttachment[Z],Q=e.colorResolveTo[Z];if(Y===null&&Q!==null&&(Y=Q,Q=null),this.gfxColorAttachment[Z]=Y,this.gfxColorResolveTo[Z]=Q,this.gfxColorAttachmentLevel[Z]=((r=e.colorAttachmentLevel)===null||r===void 0?void 0:r[Z])||0,this.gfxColorResolveToLevel[Z]=((n=e.colorResolveToLevel)===null||n===void 0?void 0:n[Z])||0,Y!==null){this.gpuColorAttachments[Z]===void 0&&(this.gpuColorAttachments[Z]={});var ae=this.gpuColorAttachments[Z];ae.view=this.getTextureView(Y,((a=this.gfxColorAttachmentLevel)===null||a===void 0?void 0:a[Z])||0);var xe=(y=(u=e.colorClearColor)===null||u===void 0?void 0:u[Z])!==null&&y!==void 0?y:"load";xe==="load"?ae.loadOp="load":(ae.loadOp="clear",ae.clearValue=xe),ae.storeOp=!((A=e.colorStore)===null||A===void 0)&&A[Z]?"store":"discard",ae.resolveTarget=void 0,Q!==null&&(Y.sampleCount>1?ae.resolveTarget=this.getTextureView(Q,this.gfxColorResolveToLevel[Z]):ae.storeOp="store")}else{this.gpuColorAttachments.length=Z,this.gfxColorAttachment.length=Z,this.gfxColorResolveTo.length=Z;break}}if(this.gfxDepthStencilAttachment=e.depthStencilAttachment,this.gfxDepthStencilResolveTo=e.depthStencilResolveTo,e.depthStencilAttachment){var Be=e.depthStencilAttachment,ae=this.gpuDepthStencilAttachment;ae.view=Be.gpuTextureView;var it=!!(Y0(Be.format)&to.Depth);it?(e.depthClearValue==="load"?ae.depthLoadOp="load":(ae.depthLoadOp="clear",ae.depthClearValue=e.depthClearValue),e.depthStencilStore||this.gfxDepthStencilResolveTo!==null?ae.depthStoreOp="store":ae.depthStoreOp="discard"):(ae.depthLoadOp=void 0,ae.depthStoreOp=void 0);var gt=!!(Y0(Be.format)&to.Stencil);gt?(e.stencilClearValue==="load"?ae.stencilLoadOp="load":(ae.stencilLoadOp="clear",ae.stencilClearValue=e.stencilClearValue),e.depthStencilStore||this.gfxDepthStencilResolveTo!==null?ae.stencilStoreOp="store":ae.stencilStoreOp="discard"):(ae.stencilLoadOp=void 0,ae.stencilStoreOp=void 0),this.gpuRenderPassDescriptor.depthStencilAttachment=this.gpuDepthStencilAttachment}else this.gpuRenderPassDescriptor.depthStencilAttachment=void 0;this.gpuRenderPassDescriptor.occlusionQuerySet=(0,Dm.Z)(e.occlusionQueryPool)?void 0:_L(e.occlusionQueryPool)},t.prototype.beginRenderPass=function(e,r){Cs(this.gpuRenderPassEncoder===null),this.setRenderPassDescriptor(r),this.frameCommandEncoder=e,this.gpuRenderPassEncoder=this.frameCommandEncoder.beginRenderPass(this.gpuRenderPassDescriptor)},t.prototype.flipY=function(e,r){var n=this.device.swapChainHeight;return n-e-r},t.prototype.setViewport=function(e,r,n,a,u,y){u===void 0&&(u=0),y===void 0&&(y=1),this.gpuRenderPassEncoder.setViewport(e,this.flipY(r,a),n,a,u,y)},t.prototype.setScissorRect=function(e,r,n,a){this.gpuRenderPassEncoder.setScissorRect(e,this.flipY(r,a),n,a)},t.prototype.setPipeline=function(e){var r=e,n=s0(r.gpuRenderPipeline);this.getEncoder().setPipeline(n)},t.prototype.setVertexInput=function(e,r,n){if(e!==null){var a=this.getEncoder(),u=e;n!==null&&a.setIndexBuffer(nv(n.buffer),s0(u.indexFormat),n.offset);for(var y=0;y<r.length;y++){var A=r[y];A!==null&&a.setVertexBuffer(y,nv(A.buffer),A.offset)}}},t.prototype.setBindings=function(e){var r=e,n=this.getEncoder();r.gpuBindGroup.forEach(function(a,u){a&&n.setBindGroup(u,r.gpuBindGroup[u])})},t.prototype.setStencilReference=function(e){this.gpuRenderPassEncoder.setStencilReference(e)},t.prototype.draw=function(e,r,n,a){this.getEncoder().draw(e,r,n,a)},t.prototype.drawIndexed=function(e,r,n,a,u){this.getEncoder().drawIndexed(e,r,n,a,u)},t.prototype.drawIndirect=function(e,r){this.getEncoder().drawIndirect(nv(e),r)},t.prototype.drawIndexedIndirect=function(e,r){this.getEncoder().drawIndexedIndirect(nv(e),r)},t.prototype.beginOcclusionQuery=function(e){this.gpuRenderPassEncoder.beginOcclusionQuery(e)},t.prototype.endOcclusionQuery=function(){this.gpuRenderPassEncoder.endOcclusionQuery()},t.prototype.pushDebugGroup=function(e){this.gpuRenderPassEncoder.pushDebugGroup(e)},t.prototype.popDebugGroup=function(){this.gpuRenderPassEncoder.popDebugGroup()},t.prototype.insertDebugMarker=function(e){this.gpuRenderPassEncoder.insertDebugMarker(e)},t.prototype.beginBundle=function(e){this.renderBundle=e},t.prototype.endBundle=function(){this.renderBundle.finish()},t.prototype.executeBundles=function(e){this.gpuRenderPassEncoder.executeBundles(e.map(function(r){return r.renderBundle}))},t.prototype.finish=function(){var e;(e=this.gpuRenderPassEncoder)===null||e===void 0||e.end(),this.gpuRenderPassEncoder=null;for(var r=0;r<this.gfxColorAttachment.length;r++){var n=this.gfxColorAttachment[r],a=this.gfxColorResolveTo[r];n!==null&&a!==null&&n.sampleCount===1&&this.copyAttachment(a,this.gfxColorAttachmentLevel[r],n,this.gfxColorResolveToLevel[r])}this.gfxDepthStencilAttachment&&this.gfxDepthStencilResolveTo&&(this.gfxDepthStencilAttachment.sampleCount>1||this.copyAttachment(this.gfxDepthStencilResolveTo,0,this.gfxDepthStencilAttachment,0)),this.frameCommandEncoder=null},t.prototype.copyAttachment=function(e,r,n,a){Cs(n.sampleCount===1);var u={texture:n.gpuTexture,mipLevel:a},y={texture:e.gpuTexture,mipLevel:r};Cs(n.width>>>a===e.width>>>r),Cs(n.height>>>a===e.height>>>r),Cs(!!(n.usage&mf.COPY_SRC)),Cs(!!(e.usage&mf.COPY_DST)),this.frameCommandEncoder.copyTextureToTexture(u,y,[e.width,e.height,1])},t}(),ZL=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=t.call(this,{id:n,device:a})||this;return y.type=Jl.RenderPipeline,y.isCreatingAsync=!1,y.gpuRenderPipeline=null,y.descriptor=u,y.device.createRenderPipelineInternal(y,!1),y}return e.prototype.getBindGroupLayout=function(r){return this.gpuRenderPipeline.getBindGroupLayout(r)},e}(Wm),VL=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y,A,O=t.call(this,{id:n,device:a})||this;O.type=Jl.Sampler;var Z=u.lodMinClamp,Y=u.mipmapFilter===df.NO_MIP?u.lodMinClamp:u.lodMaxClamp,Q=(y=u.maxAnisotropy)!==null&&y!==void 0?y:1;return Q>1&&Cs(u.minFilter===pp.BILINEAR&&u.magFilter===pp.BILINEAR&&u.mipmapFilter===df.LINEAR),O.gpuSampler=O.device.device.createSampler({addressModeU:tE(u.addressModeU),addressModeV:tE(u.addressModeV),addressModeW:tE((A=u.addressModeW)!==null&&A!==void 0?A:u.addressModeU),lodMinClamp:Z,lodMaxClamp:Y,minFilter:SS(u.minFilter),magFilter:SS(u.magFilter),mipmapFilter:gL(u.mipmapFilter),compare:u.compareFunction!==void 0?Q1(u.compareFunction):void 0,maxAnisotropy:Q}),O}return e}(Wm),ex=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=r.skipCreate,A=r.sampleCount,O=t.call(this,{id:n,device:a})||this;O.type=Jl.Texture,O.flipY=!1;var Z=u.format,Y=u.dimension,Q=u.width,ae=u.height,xe=u.depthOrArrayLayers,Be=u.mipLevelCount,it=u.usage,gt=u.pixelStore;return O.flipY=!!(gt!=null&&gt.unpackFlipY),O.device.createTextureShared({format:Z,dimension:Y!=null?Y:rl.TEXTURE_2D,width:Q,height:ae,depthOrArrayLayers:xe!=null?xe:1,mipLevelCount:Be!=null?Be:1,usage:it,sampleCount:A!=null?A:1},O,y),O}return e.prototype.textureFromImageBitmapOrCanvas=function(r,n,a){for(var u=n[0].width,y=n[0].height,A={size:{width:u,height:y,depthOrArrayLayers:a},format:"rgba8unorm",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT},O=r.createTexture(A),Z=0;Z<n.length;Z++)r.queue.copyExternalImageToTexture({source:n[Z],flipY:this.flipY},{texture:O,origin:[0,0,Z]},[u,y]);return[O,u,y]},e.prototype.isImageBitmapOrCanvases=function(r){var n=r[0];return n instanceof ImageBitmap||n instanceof HTMLCanvasElement||n instanceof OffscreenCanvas},e.prototype.isVideo=function(r){var n=r[0];return n instanceof HTMLVideoElement},e.prototype.setImageData=function(r,n){var a,u=this,y=this.device.device,A,O,Z;if(this.isImageBitmapOrCanvases(r))a=(0,wo.__read)(this.textureFromImageBitmapOrCanvas(y,r,this.depthOrArrayLayers),3),A=a[0],O=a[1],Z=a[2];else if(this.isVideo(r))A=y.importExternalTexture({source:r[0]});else{var Y=PS(this.gpuTextureformat),Q=Math.ceil(this.width/Y.width)*Y.length;r.forEach(function(ae){y.queue.writeTexture({texture:u.gpuTexture},ae,{bytesPerRow:Q},{width:u.width,height:u.height})})}this.width=O,this.height=Z,A&&(this.gpuTexture=A),this.gpuTextureView=this.gpuTexture.createView({dimension:dL(this.dimension)})},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.gpuTexture.destroy()},e}(Wm),jL=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=t.call(this,{id:n,device:a})||this;return u.type=Jl.RenderBundle,u.renderBundleEncoder=u.device.device.createRenderBundleEncoder({colorFormats:[u.device.swapChainFormat]}),u}return e.prototype.finish=function(){this.renderBundle=this.renderBundleEncoder.finish()},e}(Wm),HL=function(){function t(e,r,n,a,u,y){this.swapChainWidth=0,this.swapChainHeight=0,this.swapChainTextureUsage=mf.RENDER_ATTACHMENT|mf.COPY_DST,this._resourceUniqueId=0,this.renderPassPool=[],this.computePassPool=[],this.frameCommandEncoderPool=[],this.featureTextureCompressionBC=!1,this.platformString="WebGPU",this.glslVersion="#version 440",this.explicitBindingLocations=!0,this.separateSamplerTextures=!0,this.viewportOrigin=ng.UPPER_LEFT,this.clipSpaceNearZ=q0.ZERO,this.supportsSyncPipelineCompilation=!1,this.supportMRT=!0,this.device=r,this.canvas=n,this.canvasContext=a,this.glsl_compile=u,this.WGSLComposer=y,this.fallbackTexture2D=this.createFallbackTexture(rl.TEXTURE_2D,Hh.Float),this.setResourceName(this.fallbackTexture2D,"Fallback Texture2D"),this.fallbackTexture2DDepth=this.createFallbackTexture(rl.TEXTURE_2D,Hh.Depth),this.setResourceName(this.fallbackTexture2DDepth,"Fallback Depth Texture2D"),this.fallbackTexture2DArray=this.createFallbackTexture(rl.TEXTURE_2D_ARRAY,Hh.Float),this.setResourceName(this.fallbackTexture2DArray,"Fallback Texture2DArray"),this.fallbackTexture3D=this.createFallbackTexture(rl.TEXTURE_3D,Hh.Float),this.setResourceName(this.fallbackTexture3D,"Fallback Texture3D"),this.fallbackTextureCube=this.createFallbackTexture(rl.TEXTURE_CUBE_MAP,Hh.Float),this.setResourceName(this.fallbackTextureCube,"Fallback TextureCube"),this.fallbackSamplerFiltering=this.createSampler({addressModeU:Id.REPEAT,addressModeV:Id.REPEAT,minFilter:pp.POINT,magFilter:pp.POINT,mipmapFilter:df.NEAREST}),this.setResourceName(this.fallbackSamplerFiltering,"Fallback Sampler Filtering"),this.fallbackSamplerComparison=this.createSampler({addressModeU:Id.REPEAT,addressModeV:Id.REPEAT,minFilter:pp.POINT,magFilter:pp.POINT,mipmapFilter:df.NEAREST,compareFunction:js.ALWAYS}),this.setResourceName(this.fallbackSamplerComparison,"Fallback Sampler Comparison Filtering"),this.device.features&&(this.featureTextureCompressionBC=this.device.features.has("texture-compression-bc")),this.device.onuncapturederror=function(A){console.error(A.error)},this.swapChainFormat=navigator.gpu.getPreferredCanvasFormat(),this.canvasContext.configure({device:this.device,format:this.swapChainFormat,usage:this.swapChainTextureUsage,alphaMode:"premultiplied"})}return t.prototype.destroy=function(){},t.prototype.configureSwapChain=function(e,r){this.swapChainWidth===e&&this.swapChainHeight===r||(this.swapChainWidth=e,this.swapChainHeight=r)},t.prototype.getOnscreenTexture=function(){var e=this.canvasContext.getCurrentTexture(),r=e.createView(),n=new ex({id:0,device:this,descriptor:{format:yr.U8_RGBA_RT,width:this.swapChainWidth,height:this.swapChainHeight,depthOrArrayLayers:0,dimension:rl.TEXTURE_2D,mipLevelCount:1,usage:this.swapChainTextureUsage},skipCreate:!0});return n.depthOrArrayLayers=1,n.sampleCount=1,n.gpuTexture=e,n.gpuTextureView=r,n.name="Onscreen",this.setResourceName(n,"Onscreen Texture"),n},t.prototype.getDevice=function(){return this},t.prototype.getCanvas=function(){return this.canvas},t.prototype.beginFrame=function(){Cs(this.frameCommandEncoderPool.length===0)},t.prototype.endFrame=function(){Cs(this.frameCommandEncoderPool.every(function(e){return e!==null})),this.device.queue.submit(this.frameCommandEncoderPool.map(function(e){return e.finish()})),this.frameCommandEncoderPool=[]},t.prototype.getNextUniqueId=function(){return++this._resourceUniqueId},t.prototype.createBuffer=function(e){return new FL({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createTexture=function(e){return new ex({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createSampler=function(e){return new VL({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createRenderTarget=function(e){var r=new ex({id:this.getNextUniqueId(),device:this,descriptor:(0,wo.__assign)((0,wo.__assign)({},e),{dimension:rl.TEXTURE_2D,mipLevelCount:1,depthOrArrayLayers:1,usage:ad.RENDER_TARGET}),sampleCount:e.sampleCount});return r.depthOrArrayLayers=1,r.type=Jl.RenderTarget,r},t.prototype.createRenderTargetFromTexture=function(e){var r=e,n=r.format,a=r.width,u=r.height,y=r.depthOrArrayLayers,A=r.sampleCount,O=r.mipLevelCount,Z=r.gpuTexture,Y=r.gpuTextureView,Q=r.usage;Cs(!!(Q&mf.RENDER_ATTACHMENT));var ae=new ex({id:this.getNextUniqueId(),device:this,descriptor:{format:n,width:a,height:u,depthOrArrayLayers:y,dimension:rl.TEXTURE_2D,mipLevelCount:O,usage:Q},skipCreate:!0});return ae.depthOrArrayLayers=y,ae.sampleCount=A,ae.gpuTexture=Z,ae.gpuTextureView=Y,ae},t.prototype.createProgram=function(e){var r,n;return!((r=e.vertex)===null||r===void 0)&&r.glsl&&(e.vertex.glsl=Ug(this.queryVendorInfo(),"vert",e.vertex.glsl)),!((n=e.fragment)===null||n===void 0)&&n.glsl&&(e.fragment.glsl=Ug(this.queryVendorInfo(),"frag",e.fragment.glsl)),new IS({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createProgramSimple=function(e){return new IS({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createTextureShared=function(e,r,n){var a={width:e.width,height:e.height,depthOrArrayLayers:e.depthOrArrayLayers},u=e.mipLevelCount,y=eE(e.format),A=fL(e.dimension),O=pL(e.usage);if(r.gpuTextureformat=y,r.dimension=e.dimension,r.format=e.format,r.width=e.width,r.height=e.height,r.depthOrArrayLayers=e.depthOrArrayLayers,r.mipLevelCount=u,r.usage=O,r.sampleCount=e.sampleCount,!n){var Z=this.device.createTexture({size:a,mipLevelCount:u,format:y,dimension:A,sampleCount:e.sampleCount,usage:O}),Y=Z.createView();r.gpuTexture=Z,r.gpuTextureView=Y}},t.prototype.getFallbackSampler=function(e){var r=e.formatKind;return r===Hh.Depth&&e.comparison?this.fallbackSamplerComparison:this.fallbackSamplerFiltering},t.prototype.getFallbackTexture=function(e){var r=e.dimension,n=e.formatKind;if(r===rl.TEXTURE_2D)return n===Hh.Depth?this.fallbackTexture2DDepth:this.fallbackTexture2D;if(r===rl.TEXTURE_2D_ARRAY)return this.fallbackTexture2DArray;if(r===rl.TEXTURE_3D)return this.fallbackTexture3D;if(r===rl.TEXTURE_CUBE_MAP)return this.fallbackTextureCube;throw new Error("whoops")},t.prototype.createFallbackTexture=function(e,r){var n=e===rl.TEXTURE_CUBE_MAP?6:1,a=r===Hh.Float?yr.U8_RGBA_NORM:yr.D24;return this.createTexture({dimension:e,format:a,usage:ad.SAMPLED,width:1,height:1,depthOrArrayLayers:n,mipLevelCount:1})},t.prototype.createBindings=function(e){return new BL({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createInputLayout=function(e){return new NL({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createComputePipeline=function(e){return new kL({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createRenderPipeline=function(e){return new ZL({id:this.getNextUniqueId(),device:this,descriptor:(0,wo.__assign)({},e)})},t.prototype.createQueryPool=function(e,r){return new zL({id:this.getNextUniqueId(),device:this,descriptor:{type:e,elemCount:r}})},t.prototype.createRenderPipelineInternal=function(e,r){var n;if(e.gpuRenderPipeline===null){var a=e.descriptor,u=a.program,y=u.vertexStage,A=u.fragmentStage;if(!(y===null||A===null)){var O=a.megaStateDescriptor||{},Z=O.stencilBack,Y=O.stencilFront,Q=(0,wo.__rest)(O,["stencilBack","stencilFront"]),ae=J0(l0);a.megaStateDescriptor=(0,wo.__assign)((0,wo.__assign)((0,wo.__assign)({},ae),{stencilBack:(0,wo.__assign)((0,wo.__assign)({},ae.stencilBack),Z),stencilFront:(0,wo.__assign)((0,wo.__assign)({},ae.stencilFront),Y)}),Q);var xe=a.megaStateDescriptor.attachmentsState[0];a.colorAttachmentFormats.forEach(function(vr,ln){a.megaStateDescriptor.attachmentsState[ln]||(a.megaStateDescriptor.attachmentsState[ln]=aS(void 0,xe))});var Be=wL((n=a.topology)!==null&&n!==void 0?n:Ip.TRIANGLES,a.megaStateDescriptor),it=CL(a.colorAttachmentFormats,a.megaStateDescriptor),gt=ML(a.depthStencilAttachmentFormat,a.megaStateDescriptor),Bt=void 0;a.inputLayout!==null&&(Bt=a.inputLayout.buffers);var Rt=a.sampleCount,Yt={layout:"auto",vertex:(0,wo.__assign)((0,wo.__assign)({},y),{buffers:Bt}),primitive:Be,depthStencil:gt,multisample:{count:Rt},fragment:(0,wo.__assign)((0,wo.__assign)({},A),{targets:it})};e.gpuRenderPipeline=this.device.createRenderPipeline(Yt)}}},t.prototype.createReadback=function(){return new UL({id:this.getNextUniqueId(),device:this})},t.prototype.createRenderBundle=function(){return new jL({id:this.getNextUniqueId(),device:this})},t.prototype.createRenderPass=function(e){var r=this.renderPassPool.pop();r===void 0&&(r=new LS(this));var n=this.frameCommandEncoderPool.pop();return n===void 0&&(n=this.device.createCommandEncoder()),r.beginRenderPass(n,e),r},t.prototype.createComputePass=function(){var e=this.computePassPool.pop();e===void 0&&(e=new RS);var r=this.frameCommandEncoderPool.pop();return r===void 0&&(r=this.device.createCommandEncoder()),e.beginComputePass(r),e},t.prototype.submitPass=function(e){var r=e;r instanceof LS?(this.frameCommandEncoderPool.push(r.frameCommandEncoder),r.finish(),this.renderPassPool.push(r)):r instanceof RS&&(this.frameCommandEncoderPool.push(r.frameCommandEncoder),r.finish(),this.computePassPool.push(r))},t.prototype.copySubTexture2D=function(e,r,n,a,u,y,A){var O=this.device.createCommandEncoder(),Z=e,Y=a,Q={texture:Y.gpuTexture,origin:[u,y,0],mipLevel:0,aspect:"all"},ae={texture:Z.gpuTexture,origin:[r,n,0],mipLevel:0,aspect:"all"};Cs(!!(Y.usage&mf.COPY_SRC)),Cs(!!(Z.usage&mf.COPY_DST)),O.copyTextureToTexture(Q,ae,[Y.width,Y.height,A||1]),this.device.queue.submit([O.finish()])},t.prototype.queryLimits=function(){return{uniformBufferMaxPageWordSize:this.device.limits.maxUniformBufferBindingSize>>>2,uniformBufferWordAlignment:this.device.limits.minUniformBufferOffsetAlignment>>>2,supportedSampleCounts:[1],occlusionQueriesRecommended:!0,computeShadersSupported:!0}},t.prototype.queryTextureFormatSupported=function(e,r,n){if(LL(e)){if(!this.featureTextureCompressionBC)return!1;var a=DL(e);return r%a!==0||n%a!==0?!1:this.featureTextureCompressionBC}switch(e){case yr.U16_RGBA_NORM:return!1;case yr.F32_RGBA:return!1}return!0},t.prototype.queryPlatformAvailable=function(){return!0},t.prototype.queryVendorInfo=function(){return this},t.prototype.queryRenderPass=function(e){var r=e;return r.descriptor},t.prototype.queryRenderTarget=function(e){var r=e;return r},t.prototype.setResourceName=function(e,r){if(e.name=r,e.type===Jl.Buffer){var n=e;n.gpuBuffer.label=r}else if(e.type===Jl.Texture){var n=e;n.gpuTexture.label=r,n.gpuTextureView.label=r}else if(e.type===Jl.RenderTarget){var n=e;n.gpuTexture.label=r,n.gpuTextureView.label=r}else if(e.type===Jl.Sampler){var n=e;n.gpuSampler.label=r}else if(e.type===Jl.RenderPipeline){var n=e;n.gpuRenderPipeline!==null&&(n.gpuRenderPipeline.label=r)}},t.prototype.setResourceLeakCheck=function(e,r){},t.prototype.checkForLeaks=function(){},t.prototype.programPatched=function(e){},t.prototype.pipelineQueryReady=function(e){var r=e;return r.gpuRenderPipeline!==null},t.prototype.pipelineForceReady=function(e){var r=e;this.createRenderPipelineInternal(r,!1)},t}(),GL=function(){function t(e){this.pluginOptions=e}return t.prototype.createSwapChain=function(e){return(0,wo.__awaiter)(this,void 0,void 0,function(){var r,n,a,u,y,A,O,Z;return(0,wo.__generator)(this,function(Y){switch(Y.label){case 0:if(globalThis.navigator.gpu===void 0)return[2,null];r=null,Y.label=1;case 1:return Y.trys.push([1,3,,4]),n=this.pluginOptions.xrCompatible,[4,globalThis.navigator.gpu.requestAdapter({xrCompatible:n})];case 2:return r=Y.sent(),[3,4];case 3:return a=Y.sent(),console.log(a),[3,4];case 4:return r===null?[2,null]:(u=["depth32float-stencil8","texture-compression-bc","float32-filterable"],y=u.filter(function(Q){return r.features.has(Q)}),[4,r.requestDevice({requiredFeatures:y})]);case 5:if(A=Y.sent(),A&&(O=this.pluginOptions.onContextLost,A.lost.then(function(){O&&O()})),A===null)return[2,null];if(Z=e.getContext("webgpu"),!Z)return[2,null];Y.label=6;case 6:return Y.trys.push([6,8,,9]),[4,wS(this.pluginOptions.shaderCompilerPath)];case 7:return Y.sent(),[3,9];case 8:return Y.sent(),[3,9];case 9:return[2,new HL(r,A,e,Z,lL,M_&&new M_)]}})})},t}(),WL=Object.defineProperty,XL=Object.defineProperties,qL=Object.getOwnPropertyDescriptors,DS=Object.getOwnPropertySymbols,YL=Object.prototype.hasOwnProperty,$L=Object.prototype.propertyIsEnumerable,OS=(t,e,r)=>e in t?WL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,P_=(t,e)=>{for(var r in e||(e={}))YL.call(e,r)&&OS(t,r,e[r]);if(DS)for(var r of DS(e))$L.call(e,r)&&OS(t,r,e[r]);return t},KL=(t,e)=>XL(t,qL(e)),{isPlainObject:JL,isTypedArray:QL}=es,eD=class{constructor(t,e){this.destroyed=!1,this.uniforms={},this.reGl=t;const{vs:r,fs:n,attributes:a,uniforms:u,primitive:y,count:A,elements:O,depth:Z,cull:Y,instances:Q}=e,ae={platformString:"WebGL1",glslVersion:"#version 100",explicitBindingLocations:!1,separateSamplerTextures:!1,viewportOrigin:ng.LOWER_LEFT,clipSpaceNearZ:q0.NEGATIVE_ONE,supportMRT:!1},xe={};this.options=e,u&&(this.uniforms=this.extractUniforms(u),Object.keys(u).forEach(Rt=>{xe[Rt]=t.prop(Rt)}));const Be={};Object.keys(a).forEach(Rt=>{Be[Rt]=a[Rt].get()});const it=du(Ug(ae,"frag",n,null,!1)),gt=du(Ug(ae,"vert",r,null,!1)),Bt={attributes:Be,frag:it,uniforms:xe,vert:gt,colorMask:t.prop("colorMask"),lineWidth:1,blend:{enable:t.prop("blend.enable"),func:t.prop("blend.func"),equation:t.prop("blend.equation"),color:t.prop("blend.color")},stencil:{enable:t.prop("stencil.enable"),mask:t.prop("stencil.mask"),func:t.prop("stencil.func"),opFront:t.prop("stencil.opFront"),opBack:t.prop("stencil.opBack")},primitive:NI[y===void 0?Ee.TRIANGLES:y]};Q&&(Bt.instances=Q),A?Bt.count=A:O&&(Bt.elements=O.get()),this.initDepthDrawParams({depth:Z},Bt),this.initCullDrawParams({cull:Y},Bt),this.drawCommand=t(Bt),this.drawParams=Bt}updateAttributesAndElements(t,e){const r={};Object.keys(t).forEach(n=>{r[n]=t[n].get()}),this.drawParams.attributes=r,this.drawParams.elements=e.get(),this.drawCommand=this.reGl(this.drawParams)}updateAttributes(t){const e={};Object.keys(t).forEach(r=>{e[r]=t[r].get()}),this.drawParams.attributes=e,this.drawCommand=this.reGl(this.drawParams)}addUniforms(t){this.uniforms=P_(P_({},this.uniforms),this.extractUniforms(t))}draw(t,e){if(this.drawParams.attributes&&Object.keys(this.drawParams.attributes).length===0)return;const r=P_(P_({},this.uniforms),this.extractUniforms(t.uniforms||{})),n={};Object.keys(r).forEach(a=>{const u=typeof r[a];u==="boolean"||u==="number"||Array.isArray(r[a])||r[a].BYTES_PER_ELEMENT?n[a]=r[a]:n[a]=r[a].get()}),n.blend=e?this.getBlendDrawParams({blend:{enable:!1}}):this.getBlendDrawParams(t),n.stencil=this.getStencilDrawParams(t),n.colorMask=this.getColorMaskDrawParams(t,e),this.drawCommand(n)}destroy(){var t,e;(e=(t=this.drawParams)==null?void 0:t.elements)==null||e.destroy(),this.options.attributes&&Object.values(this.options.attributes).forEach(r=>{r==null||r.destroy()}),this.destroyed=!0}initDepthDrawParams({depth:t},e){t&&(e.depth={enable:t.enable===void 0?!0:!!t.enable,mask:t.mask===void 0?!0:!!t.mask,func:VI[t.func||Ee.LESS],range:t.range||[0,1]})}getBlendDrawParams({blend:t}){const{enable:e,func:r,equation:n,color:a=[0,0,0,0]}=t||{};return{enable:!!e,func:{srcRGB:k1[r&&r.srcRGB||Ee.SRC_ALPHA],srcAlpha:k1[r&&r.srcAlpha||Ee.SRC_ALPHA],dstRGB:k1[r&&r.dstRGB||Ee.ONE_MINUS_SRC_ALPHA],dstAlpha:k1[r&&r.dstAlpha||Ee.ONE_MINUS_SRC_ALPHA]},equation:{rgb:$3[n&&n.rgb||Ee.FUNC_ADD],alpha:$3[n&&n.alpha||Ee.FUNC_ADD]},color:a}}getStencilDrawParams({stencil:t}){const{enable:e,mask:r=-1,func:n={cmp:Ee.ALWAYS,ref:0,mask:-1},opFront:a={fail:Ee.KEEP,zfail:Ee.KEEP,zpass:Ee.KEEP},opBack:u={fail:Ee.KEEP,zfail:Ee.KEEP,zpass:Ee.KEEP}}=t||{};return{enable:!!e,mask:r,func:KL(P_({},n),{cmp:jI[n.cmp]}),opFront:{fail:W0[a.fail],zfail:W0[a.zfail],zpass:W0[a.zpass]},opBack:{fail:W0[u.fail],zfail:W0[u.zfail],zpass:W0[u.zpass]}}}getColorMaskDrawParams({stencil:t},e){return t!=null&&t.enable&&t.opFront&&!e?[!1,!1,!1,!1]:[!0,!0,!0,!0]}initCullDrawParams({cull:t},e){if(t){const{enable:r,face:n=Ee.BACK}=t;e.cull={enable:!!r,face:HI[n]}}}extractUniforms(t){const e={};return Object.keys(t).forEach(r=>{this.extractUniformsRecursively(r,t[r],e,"")}),e}extractUniformsRecursively(t,e,r,n){if(e===null||typeof e=="number"||typeof e=="boolean"||Array.isArray(e)&&typeof e[0]=="number"||QL(e)||e===""||"resize"in e){r[`${n&&n+"."}${t}`]=e;return}JL(e)&&Object.keys(e).forEach(a=>{this.extractUniformsRecursively(a,e[a],r,`${n&&n+"."}${t}`)}),Array.isArray(e)&&e.forEach((a,u)=>{Object.keys(a).forEach(y=>{this.extractUniformsRecursively(y,a[y],r,`${n&&n+"."}${t}[${u}]`)})})}},tD=class{constructor(t,e){this.isDestroy=!1;const{data:r,type:n=Ee.UNSIGNED_BYTE,width:a,height:u,flipY:y=!1,format:A=Ee.RGBA,mipmap:O=!1,wrapS:Z=Ee.CLAMP_TO_EDGE,wrapT:Y=Ee.CLAMP_TO_EDGE,aniso:Q=0,alignment:ae=1,premultiplyAlpha:xe=!1,mag:Be=Ee.NEAREST,min:it=Ee.NEAREST,colorSpace:gt=Ee.BROWSER_DEFAULT_WEBGL,x:Bt=0,y:Rt=0,copy:Yt=!1}=e;this.width=a,this.height=u;const vr={width:a,height:u,type:X2[n],format:zI[A],wrapS:Y3[Z],wrapT:Y3[Y],mag:q3[Be],min:q3[it],alignment:ae,flipY:y,colorSpace:ZI[gt],premultiplyAlpha:xe,aniso:Q,x:Bt,y:Rt,copy:Yt};r&&(vr.data=r),typeof O=="number"?vr.mipmap=UI[O]:typeof O=="boolean"&&(vr.mipmap=O),this.texture=t.texture(vr)}get(){return this.texture}update(t={}){this.texture(t)}bind(){this.texture._texture.bind()}resize({width:t,height:e}){this.texture.resize(t,e),this.width=t,this.height=e}getSize(){return[this.width,this.height]}destroy(){var t;this.isDestroy||(t=this.texture)==null||t.destroy(),this.isDestroy=!0}},rE=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),rD=class{constructor(){this.uniformBuffers=[],this.queryVerdorInfo=()=>"WebGL1",this.createModel=t=>new eD(this.gl,t),this.createAttribute=t=>new kI(this.gl,t),this.createBuffer=t=>new GI(this.gl,t),this.createElements=t=>new WI(this.gl,t),this.createTexture2D=t=>new tD(this.gl,t),this.createFramebuffer=t=>new XI(this.gl,t),this.useFramebuffer=(t,e)=>{this.gl({framebuffer:t?t.get():null})(e)},this.useFramebufferAsync=(t,e)=>rE(this,null,function*(){this.gl({framebuffer:t?t.get():null})(e)}),this.clear=t=>{var e;const{color:r,depth:n,stencil:a,framebuffer:u=null}=t,y={color:r,depth:n,stencil:a};y.framebuffer=u===null?u:u.get(),(e=this.gl)==null||e.clear(y)},this.viewport=({x:t,y:e,width:r,height:n})=>{this.gl._gl.viewport(t,e,r,n),this.width=r,this.height=n,this.gl._refresh()},this.readPixels=t=>{const{framebuffer:e,x:r,y:n,width:a,height:u}=t,y={x:r,y:n,width:a,height:u};return e&&(y.framebuffer=e.get()),this.gl.read(y)},this.readPixelsAsync=t=>rE(this,null,function*(){return this.readPixels(t)}),this.getViewportSize=()=>({width:this.gl._gl.drawingBufferWidth,height:this.gl._gl.drawingBufferHeight}),this.getContainer=()=>{var t;return(t=this.canvas)==null?void 0:t.parentElement},this.getCanvas=()=>this.canvas,this.getGLContext=()=>this.gl._gl,this.destroy=()=>{var t,e,r;this.canvas=null,(r=(e=(t=this.gl)==null?void 0:t._gl)==null?void 0:e.getExtension("WEBGL_lose_context"))==null||r.loseContext(),this.gl.destroy(),this.gl=null}}init(t,e,r){return rE(this,null,function*(){this.canvas=t,r?this.gl=r:this.gl=yield new Promise((n,a)=>{FI()({canvas:this.canvas,attributes:{alpha:!0,antialias:e.antialias,premultipliedAlpha:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,stencil:e.stencil},extensions:["OES_element_index_uint","OES_standard_derivatives","ANGLE_instanced_arrays"],optionalExtensions:["oes_texture_float_linear","OES_texture_float","EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture","WEBGL_lose_context"],profile:!0,onDone:(u,y)=>{(u||!y)&&a(u),n(y)}})}),this.extensionObject={OES_texture_float:this.testExtension("OES_texture_float")}})}getPointSizeRange(){return this.gl._gl.getParameter(this.gl._gl.ALIASED_POINT_SIZE_RANGE)}testExtension(t){return!!this.getGLContext().getExtension(t)}setState(){this.gl({cull:{enable:!1,face:"back"},viewport:{x:0,y:0,height:this.width,width:this.height},blend:{enable:!0,equation:"add"},framebuffer:null}),this.gl._refresh()}setBaseState(){this.gl({cull:{enable:!1,face:"back"},viewport:{x:0,y:0,height:this.width,width:this.height},blend:{enable:!1,equation:"add"},framebuffer:null}),this.gl._refresh()}setCustomLayerDefaults(){const t=this.getGLContext();t.disable(t.CULL_FACE)}setDirty(t){this.isDirty=t}getDirty(){return this.isDirty}beginFrame(){}endFrame(){}},nD=class{constructor(t,e){const{buffer:r,offset:n,stride:a,normalized:u,size:y,divisor:A,shaderLocation:O}=e;this.buffer=r,this.attribute={shaderLocation:O,buffer:r.get(),offset:n||0,stride:a||0,normalized:u||!1,divisor:A||0},y&&(this.attribute.size=y)}get(){return this.buffer}updateBuffer(t){this.buffer.subData(t)}destroy(){this.buffer.destroy()}},tx={[Ee.FLOAT]:Float32Array,[Ee.UNSIGNED_BYTE]:Uint8Array,[Ee.SHORT]:Int16Array,[Ee.UNSIGNED_SHORT]:Uint16Array,[Ee.INT]:Int32Array,[Ee.UNSIGNED_INT]:Uint32Array},iD={[Ee.POINTS]:Ip.POINTS,[Ee.LINES]:Ip.LINES,[Ee.LINE_LOOP]:Ip.LINES,[Ee.LINE_STRIP]:Ip.LINE_STRIP,[Ee.TRIANGLES]:Ip.TRIANGLES,[Ee.TRIANGLE_FAN]:Ip.TRIANGLES,[Ee.TRIANGLE_STRIP]:Ip.TRIANGLE_STRIP},oD={[1]:yr.F32_R,[2]:yr.F32_RG,[3]:yr.F32_RGB,[4]:yr.F32_RGBA},aD={[Ee.STATIC_DRAW]:Gm.STATIC,[Ee.DYNAMIC_DRAW]:Gm.DYNAMIC,[Ee.STREAM_DRAW]:Gm.DYNAMIC},BS={[Ee.REPEAT]:Id.REPEAT,[Ee.CLAMP_TO_EDGE]:Id.CLAMP_TO_EDGE,[Ee.MIRRORED_REPEAT]:Id.MIRRORED_REPEAT},sD={[Ee.NEVER]:js.NEVER,[Ee.ALWAYS]:js.ALWAYS,[Ee.LESS]:js.LESS,[Ee.LEQUAL]:js.LEQUAL,[Ee.GREATER]:js.GREATER,[Ee.GEQUAL]:js.GEQUAL,[Ee.EQUAL]:js.EQUAL,[Ee.NOTEQUAL]:js.NOTEQUAL},lD={[Ee.FRONT]:Jd.FRONT,[Ee.BACK]:Jd.BACK},FS={[Ee.FUNC_ADD]:If.ADD,[Ee.MIN_EXT]:If.MIN,[Ee.MAX_EXT]:If.MAX,[Ee.FUNC_SUBTRACT]:If.SUBSTRACT,[Ee.FUNC_REVERSE_SUBTRACT]:If.REVERSE_SUBSTRACT},rx={[Ee.ZERO]:pl.ZERO,[Ee.ONE]:pl.ONE,[Ee.SRC_COLOR]:pl.SRC,[Ee.ONE_MINUS_SRC_COLOR]:pl.ONE_MINUS_SRC,[Ee.SRC_ALPHA]:pl.SRC_ALPHA,[Ee.ONE_MINUS_SRC_ALPHA]:pl.ONE_MINUS_SRC_ALPHA,[Ee.DST_COLOR]:pl.DST,[Ee.ONE_MINUS_DST_COLOR]:pl.ONE_MINUS_DST,[Ee.DST_ALPHA]:pl.DST_ALPHA,[Ee.ONE_MINUS_DST_ALPHA]:pl.ONE_MINUS_DST_ALPHA,[Ee.CONSTANT_COLOR]:pl.CONST,[Ee.ONE_MINUS_CONSTANT_COLOR]:pl.ONE_MINUS_CONSTANT,[Ee.CONSTANT_ALPHA]:pl.CONST,[Ee.ONE_MINUS_CONSTANT_ALPHA]:pl.ONE_MINUS_CONSTANT,[Ee.SRC_ALPHA_SATURATE]:pl.SRC_ALPHA_SATURATE},ov={[Ee.REPLACE]:jh.REPLACE,[Ee.KEEP]:jh.KEEP,[Ee.ZERO]:jh.ZERO,[Ee.INVERT]:jh.INVERT,[Ee.INCR]:jh.INCREMENT_CLAMP,[Ee.DECR]:jh.DECREMENT_CLAMP,[Ee.INCR_WRAP]:jh.INCREMENT_WRAP,[Ee.DECR_WRAP]:jh.DECREMENT_WRAP},uD={[Ee.ALWAYS]:js.ALWAYS,[Ee.EQUAL]:js.EQUAL,[Ee.GEQUAL]:js.GEQUAL,[Ee.GREATER]:js.GREATER,[Ee.LEQUAL]:js.LEQUAL,[Ee.LESS]:js.LESS,[Ee.NEVER]:js.NEVER,[Ee.NOTEQUAL]:js.NOTEQUAL},cD={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121};function nx(t){return Object.prototype.toString.call(t)in cD}function hD(t,e){const r=t.length,n=Math.ceil(r/3),a=r+n,u=new Float32Array(a);for(let y=0;y<a;y+=4)u[y]=t[y/4*3],u[y+1]=t[y/4*3+1],u[y+2]=t[y/4*3+2],u[y+3]=e;return u}var pD=class{constructor(t,e){this.isDestroyed=!1;const{data:r,usage:n,type:a,isUBO:u,label:y}=e;let A;nx(r)?A=r:A=new tx[this.type||Ee.FLOAT](r),this.type=a,this.size=A.byteLength,this.buffer=t.createBuffer({viewOrSize:A,usage:u?ac.UNIFORM:ac.VERTEX,hint:aD[n||Ee.STATIC_DRAW]}),y&&t.setResourceName(this.buffer,y)}get(){return this.buffer}destroy(){this.isDestroyed||this.buffer.destroy(),this.isDestroyed=!0}subData({data:t,offset:e}){let r;nx(t)?r=t:r=new tx[this.type||Ee.FLOAT](t),this.buffer.setSubData(e,new Uint8Array(r.buffer))}};function Pu(t,e=0){return t+=e,t+=t<<10,t+=t>>>6,t>>>0}function kS(t){return t+=t<<3,t^=t>>>11,t+=t<<15,t>>>0}function NS(){return 0}var fD=class{constructor(){this.keys=[],this.values=[]}},ix=class{constructor(t,e){this.keyEqualFunc=t,this.keyHashFunc=e,this.buckets=new Map}findBucketIndex(t,e){for(let r=0;r<t.keys.length;r++)if(this.keyEqualFunc(e,t.keys[r]))return r;return-1}findBucket(t){const e=this.keyHashFunc(t);return this.buckets.get(e)}get(t){const e=this.findBucket(t);if(e===void 0)return null;const r=this.findBucketIndex(e,t);return r<0?null:e.values[r]}add(t,e){const r=this.keyHashFunc(t);this.buckets.get(r)===void 0&&this.buckets.set(r,new fD);const n=this.buckets.get(r);n.keys.push(t),n.values.push(e)}delete(t){const e=this.findBucket(t);if(e===void 0)return;const r=this.findBucketIndex(e,t);r!==-1&&(e.keys.splice(r,1),e.values.splice(r,1))}clear(){this.buckets.clear()}size(){let t=0;for(const e of this.buckets.values())t+=e.values.length;return t}*values(){for(const t of this.buckets.values())for(let e=t.values.length-1;e>=0;e--)yield t.values[e]}};function zS(t,e){return t=Pu(t,e.blendMode),t=Pu(t,e.blendSrcFactor),t=Pu(t,e.blendDstFactor),t}function dD(t,e){return t=zS(t,e.rgbBlendState),t=zS(t,e.alphaBlendState),t=Pu(t,e.channelWriteMask),t}function mD(t,e){return t=Pu(t,e.r<<24|e.g<<16|e.b<<8|e.a),t}function gD(t,e){var r,n,a,u,y,A,O,Z;for(let Y=0;Y<e.attachmentsState.length;Y++)t=dD(t,e.attachmentsState[Y]);return t=mD(t,e.blendConstant||U1),t=Pu(t,e.depthCompare),t=Pu(t,e.depthWrite?1:0),t=Pu(t,(r=e.stencilFront)==null?void 0:r.compare),t=Pu(t,(n=e.stencilFront)==null?void 0:n.passOp),t=Pu(t,(a=e.stencilFront)==null?void 0:a.failOp),t=Pu(t,(u=e.stencilFront)==null?void 0:u.depthFailOp),t=Pu(t,(y=e.stencilBack)==null?void 0:y.compare),t=Pu(t,(A=e.stencilBack)==null?void 0:A.passOp),t=Pu(t,(O=e.stencilBack)==null?void 0:O.failOp),t=Pu(t,(Z=e.stencilBack)==null?void 0:Z.depthFailOp),t=Pu(t,e.stencilWrite?1:0),t=Pu(t,e.cullMode),t=Pu(t,e.frontFace?1:0),t=Pu(t,e.polygonOffset?1:0),t}function vD(t){let e=0;e=Pu(e,t.program.id),t.inputLayout!==null&&(e=Pu(e,t.inputLayout.id)),e=gD(e,t.megaStateDescriptor);for(let r=0;r<t.colorAttachmentFormats.length;r++)e=Pu(e,t.colorAttachmentFormats[r]||0);return e=Pu(e,t.depthStencilAttachmentFormat||0),kS(e)}function _D(t){let e=0;if(t.samplerBindings)for(let r=0;r<t.samplerBindings.length;r++){const n=t.samplerBindings[r];n!==null&&n.texture!==null&&(e=Pu(e,n.texture.id))}if(t.uniformBufferBindings)for(let r=0;r<t.uniformBufferBindings.length;r++){const n=t.uniformBufferBindings[r];n!==null&&n.buffer!==null&&(e=Pu(e,n.buffer.id),e=Pu(e,n.binding),e=Pu(e,n.offset),e=Pu(e,n.size))}if(t.storageBufferBindings)for(let r=0;r<t.storageBufferBindings.length;r++){const n=t.storageBufferBindings[r];n!==null&&n.buffer!==null&&(e=Pu(e,n.buffer.id),e=Pu(e,n.binding),e=Pu(e,n.offset),e=Pu(e,n.size))}if(t.storageTextureBindings)for(let r=0;r<t.storageTextureBindings.length;r++){const n=t.storageTextureBindings[r];n!==null&&n.texture!==null&&(e=Pu(e,n.texture.id),e=Pu(e,n.binding))}return kS(e)}function yD(t,e){var r,n,a,u;return((r=t.vertex)==null?void 0:r.glsl)===((n=e.vertex)==null?void 0:n.glsl)&&((a=t.fragment)==null?void 0:a.glsl)===((u=e.fragment)==null?void 0:u.glsl)}function xD(t){var e,r;return{vertex:{glsl:(e=t.vertex)==null?void 0:e.glsl},fragment:{glsl:(r=t.fragment)==null?void 0:r.glsl}}}var bD=class{constructor(t){this.device=t,this.bindingsCache=new ix(u6,_D),this.renderPipelinesCache=new ix(f6,vD),this.inputLayoutsCache=new ix(g6,NS),this.programCache=new ix(yD,NS)}createBindings(t){var e;let r=this.bindingsCache.get(t);if(r===null){const n=y6(t);n.uniformBufferBindings=(e=n.uniformBufferBindings)==null?void 0:e.filter(({size:a})=>a&&a>0),r=this.device.createBindings(n),this.bindingsCache.add(n,r)}return r}createRenderPipeline(t){let e=this.renderPipelinesCache.get(t);if(e===null){const r=x6(t);r.colorAttachmentFormats=r.colorAttachmentFormats.filter(n=>n),e=this.device.createRenderPipeline(r),this.renderPipelinesCache.add(r,e)}return e}createInputLayout(t){t.vertexBufferDescriptors=t.vertexBufferDescriptors.filter(r=>!!r);let e=this.inputLayoutsCache.get(t);if(e===null){const r=w6(t);e=this.device.createInputLayout(r),this.inputLayoutsCache.add(r,e)}return e}createProgram(t){let e=this.programCache.get(t);if(e===null){const r=xD(t);e=this.device.createProgram(t),this.programCache.add(r,e)}return e}destroy(){for(const t of this.bindingsCache.values())t.destroy();for(const t of this.renderPipelinesCache.values())t.destroy();for(const t of this.inputLayoutsCache.values())t.destroy();for(const t of this.programCache.values())t.destroy();this.bindingsCache.clear(),this.renderPipelinesCache.clear(),this.inputLayoutsCache.clear(),this.programCache.clear()}},ED=class{constructor(t,e){const{data:r,type:n,count:a=0}=e;let u;nx(r)?u=r:u=new tx[this.type||Ee.UNSIGNED_INT](r),this.type=n,this.count=a,this.indexBuffer=t.createBuffer({viewOrSize:u,usage:ac.INDEX})}get(){return this.indexBuffer}subData({data:t}){let e;nx(t)?e=t:e=new tx[this.type||Ee.UNSIGNED_INT](t),this.indexBuffer.setSubData(0,new Uint8Array(e.buffer))}destroy(){this.indexBuffer.destroy()}};function US(t){return!!(t&&t.texture)}var ZS=class{constructor(t,e){this.device=t,this.options=e,this.isDestroy=!1;const{wrapS:r=Ee.CLAMP_TO_EDGE,wrapT:n=Ee.CLAMP_TO_EDGE,aniso:a,mag:u=Ee.NEAREST,min:y=Ee.NEAREST}=e;this.createTexture(e),this.sampler=t.createSampler({addressModeU:BS[r],addressModeV:BS[n],minFilter:y===Ee.NEAREST?pp.POINT:pp.BILINEAR,magFilter:u===Ee.NEAREST?pp.POINT:pp.BILINEAR,mipmapFilter:df.NO_MIP,maxAnisotropy:a})}createTexture(t){const{type:e=Ee.UNSIGNED_BYTE,width:r,height:n,flipY:a=!1,format:u=Ee.RGBA,alignment:y=1,usage:A=$.SAMPLED,unorm:O=!1,label:Z}=t;let{data:Y}=t;this.width=r,this.height=n;let Q=yr.U8_RGBA_RT;if(e===Ee.UNSIGNED_BYTE&&u===Ee.RGBA)Q=O?yr.U8_RGBA_NORM:yr.U8_RGBA_RT;else if(e===Ee.UNSIGNED_BYTE&&u===Ee.LUMINANCE)Q=yr.U8_LUMINANCE;else if(e===Ee.FLOAT&&u===Ee.RGB)this.device.queryVendorInfo().platformString==="WebGPU"?(Y&&(Y=hD(Y,0)),Q=yr.F32_RGBA):Q=yr.F32_RGB;else if(e===Ee.FLOAT&&u===Ee.RGBA)Q=yr.F32_RGBA;else if(e===Ee.FLOAT&&u===Ee.RED)Q=yr.F32_R;else throw new Error(`create texture error, type: ${e}, format: ${u}`);this.texture=this.device.createTexture({format:Q,width:r,height:n,usage:A===$.SAMPLED?ad.SAMPLED:ad.RENDER_TARGET,pixelStore:{unpackFlipY:a,packAlignment:y},mipLevelCount:1}),Z&&this.device.setResourceName(this.texture,Z),Y&&this.texture.setImageData([Y])}get(){return this.texture}update(t){const{data:e}=t;this.texture.setImageData([e])}bind(){}resize({width:t,height:e}){(this.width!==t||this.height!==e)&&this.destroy(),this.options.width=t,this.options.height=e,this.createTexture(this.options),this.isDestroy=!1}getSize(){return[this.width,this.height]}destroy(){var t;!this.isDestroy&&!this.texture.destroyed&&((t=this.texture)==null||t.destroy()),this.isDestroy=!0}},VS=class{constructor(t,e){this.device=t,this.options=e,this.createColorRenderTarget(),this.createDepthRenderTarget()}createColorRenderTarget(t=!1){const{width:e,height:r,color:n}=this.options;n&&(US(n)?(t&&n.resize({width:e,height:r}),this.colorTexture=n.get(),this.colorRenderTarget=this.device.createRenderTargetFromTexture(this.colorTexture),this.width=n.width,this.height=n.height):e&&r&&(this.colorTexture=this.device.createTexture({format:yr.U8_RGBA_RT,usage:ad.RENDER_TARGET,width:e,height:r}),this.colorRenderTarget=this.device.createRenderTargetFromTexture(this.colorTexture),this.width=e,this.height=r))}createDepthRenderTarget(t=!1){const{width:e,height:r,depth:n}=this.options;n&&(US(n)?(t&&n.resize({width:e,height:r}),this.depthTexture=n.get(),this.depthRenderTarget=this.device.createRenderTargetFromTexture(this.depthTexture),this.width=n.width,this.height=n.height):e&&r&&(this.depthTexture=this.device.createTexture({format:yr.D24_S8,usage:ad.RENDER_TARGET,width:e,height:r}),this.depthRenderTarget=this.device.createRenderTargetFromTexture(this.depthTexture),this.width=e,this.height=r))}get(){return this.colorRenderTarget}destroy(){var t,e;(t=this.colorRenderTarget)==null||t.destroy(),(e=this.depthRenderTarget)==null||e.destroy()}resize({width:t,height:e}){(this.width!==t||this.height!==e)&&(this.destroy(),this.colorTexture.destroyed=!0,this.depthTexture.destroyed=!0,this.options.width=t,this.options.height=e,this.createColorRenderTarget(!0),this.createDepthRenderTarget(!0))}},wD=Object.defineProperty,SD=Object.defineProperties,TD=Object.getOwnPropertyDescriptors,jS=Object.getOwnPropertySymbols,AD=Object.prototype.hasOwnProperty,CD=Object.prototype.propertyIsEnumerable,HS=(t,e,r)=>e in t?wD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,u0=(t,e)=>{for(var r in e||(e={}))AD.call(e,r)&&HS(t,r,e[r]);if(jS)for(var r of jS(e))CD.call(e,r)&&HS(t,r,e[r]);return t},MD=(t,e)=>SD(t,TD(e)),{isPlainObject:PD,isTypedArray:RD}=es,ID=class{constructor(t,e,r){this.device=t,this.options=e,this.service=r,this.destroyed=!1,this.uniforms={},this.vertexBuffers=[];const{vs:n,fs:a,attributes:u,uniforms:y,count:A,elements:O,diagnosticDerivativeUniformityEnabled:Z}=e;this.options=e;const Y=Z?"":this.service.viewportOrigin===ng.UPPER_LEFT?"diagnostic(off,derivative_uniformity);":"";this.program=r.renderCache.createProgram({vertex:{glsl:n},fragment:{glsl:a,postprocess:Be=>Y+Be}}),y&&(this.uniforms=this.extractUniforms(y));const Q=[];let ae=0;Object.keys(u).forEach(Be=>{const it=u[Be],gt=it.get();this.vertexBuffers.push(gt.get());const{offset:Bt=0,stride:Rt=0,size:Yt=1,divisor:vr=0,shaderLocation:ln=0}=it.attribute;Q.push({arrayStride:Rt||Yt*4,stepMode:a0.VERTEX,attributes:[{format:oD[Yt],shaderLocation:ln,offset:Bt,divisor:vr}]}),ae=gt.size/Yt}),A||(this.options.count=ae),O&&(this.indexBuffer=O.get());const xe=r.renderCache.createInputLayout({vertexBufferDescriptors:Q,indexBufferFormat:O?yr.U32_R:null,program:this.program});this.inputLayout=xe,this.pipeline=this.createPipeline(e)}createPipeline(t,e){const{primitive:r=Ee.TRIANGLES,depth:n,cull:a,blend:u,stencil:y}=t,A=this.initDepthDrawParams({depth:n}),O=!!(A&&A.enable),Z=this.initCullDrawParams({cull:a}),Y=!!(Z&&Z.enable),Q=this.getBlendDrawParams({blend:u}),ae=!!(Q&&Q.enable),xe=this.getStencilDrawParams({stencil:y}),Be=!!(xe&&xe.enable);return this.device.createRenderPipeline({inputLayout:this.inputLayout,program:this.program,topology:iD[r],colorAttachmentFormats:[yr.U8_RGBA_RT],depthStencilAttachmentFormat:yr.D24_S8,megaStateDescriptor:{attachmentsState:[e?{channelWriteMask:Lf.ALL,rgbBlendState:{blendMode:If.ADD,blendSrcFactor:pl.ONE,blendDstFactor:pl.ZERO},alphaBlendState:{blendMode:If.ADD,blendSrcFactor:pl.ONE,blendDstFactor:pl.ZERO}}:{channelWriteMask:Be&&xe.opFront.zpass===jh.REPLACE?Lf.NONE:Lf.ALL,rgbBlendState:{blendMode:ae&&Q.equation.rgb||If.ADD,blendSrcFactor:ae&&Q.func.srcRGB||pl.SRC_ALPHA,blendDstFactor:ae&&Q.func.dstRGB||pl.ONE_MINUS_SRC_ALPHA},alphaBlendState:{blendMode:ae&&Q.equation.alpha||If.ADD,blendSrcFactor:ae&&Q.func.srcAlpha||pl.ONE,blendDstFactor:ae&&Q.func.dstAlpha||pl.ONE}}],blendConstant:ae?U1:void 0,depthWrite:O,depthCompare:O&&A.func||js.LESS,cullMode:Y&&Z.face||Jd.NONE,stencilWrite:Be,stencilFront:{compare:Be?xe.func.cmp:js.ALWAYS,passOp:xe.opFront.zpass,failOp:xe.opFront.fail,depthFailOp:xe.opFront.zfail,mask:xe.opFront.mask},stencilBack:{compare:Be?xe.func.cmp:js.ALWAYS,passOp:xe.opBack.zpass,failOp:xe.opBack.fail,depthFailOp:xe.opBack.zfail,mask:xe.opBack.mask}}})}updateAttributesAndElements(){}updateAttributes(){}addUniforms(t){this.uniforms=u0(u0({},this.uniforms),this.extractUniforms(t))}draw(t,e){const r=u0(u0({},this.options),t),{count:n=0,instances:a,elements:u,uniforms:y={},uniformBuffers:A,textures:O}=r;this.uniforms=u0(u0({},this.uniforms),this.extractUniforms(y));const{renderPass:Z,currentFramebuffer:Y,width:Q,height:ae,renderCache:xe}=this.service;this.pipeline=this.createPipeline(r,e);const Be=this.service.device,it=Be.swapChainHeight;if(Be.swapChainHeight=(Y==null?void 0:Y.height)||ae,Z.setViewport(0,0,(Y==null?void 0:Y.width)||Q,(Y==null?void 0:Y.height)||ae),Be.swapChainHeight=it,Z.setPipeline(this.pipeline),Z.setStencilReference(1),Z.setVertexInput(this.inputLayout,this.vertexBuffers.map(gt=>({buffer:gt})),u?{buffer:this.indexBuffer,offset:0}:null),A&&(this.bindings=xe.createBindings({pipeline:this.pipeline,uniformBufferBindings:A.map((gt,Bt)=>{const Rt=gt;return{binding:Bt,buffer:Rt.get(),size:Rt.size}}),samplerBindings:O==null?void 0:O.map(gt=>({texture:gt.texture,sampler:gt.sampler}))})),this.bindings&&(Z.setBindings(this.bindings),Object.keys(this.uniforms).forEach(gt=>{const Bt=this.uniforms[gt];Bt instanceof ZS?this.uniforms[gt]=Bt.get():Bt instanceof VS&&(this.uniforms[gt]=Bt.get().texture)}),this.program.setUniformsLegacy(this.uniforms)),u){const gt=u.count;gt===0?Z.draw(n,a):Z.drawIndexed(gt,a)}else Z.draw(n,a)}destroy(){var t,e,r;this.program.destroy(),(t=this.vertexBuffers)==null||t.forEach(n=>n.destroy()),(e=this.indexBuffer)==null||e.destroy(),(r=this.bindings)==null||r.destroy(),this.inputLayout.destroy(),this.pipeline.destroy(),this.destroyed=!0}initDepthDrawParams({depth:t}){if(t)return{enable:t.enable===void 0?!0:!!t.enable,mask:t.mask===void 0?!0:!!t.mask,func:sD[t.func||Ee.LESS],range:t.range||[0,1]}}getBlendDrawParams({blend:t}){const{enable:e,func:r,equation:n,color:a=[0,0,0,0]}=t||{};return{enable:!!e,func:{srcRGB:rx[r&&r.srcRGB||Ee.SRC_ALPHA],srcAlpha:rx[r&&r.srcAlpha||Ee.SRC_ALPHA],dstRGB:rx[r&&r.dstRGB||Ee.ONE_MINUS_SRC_ALPHA],dstAlpha:rx[r&&r.dstAlpha||Ee.ONE_MINUS_SRC_ALPHA]},equation:{rgb:FS[n&&n.rgb||Ee.FUNC_ADD],alpha:FS[n&&n.alpha||Ee.FUNC_ADD]},color:a}}getStencilDrawParams({stencil:t}){const{enable:e,mask:r=4294967295,func:n={cmp:Ee.ALWAYS,ref:0,mask:4294967295},opFront:a={fail:Ee.KEEP,zfail:Ee.KEEP,zpass:Ee.KEEP},opBack:u={fail:Ee.KEEP,zfail:Ee.KEEP,zpass:Ee.KEEP}}=t||{};return{enable:!!e,mask:r,func:MD(u0({},n),{cmp:uD[n.cmp]}),opFront:{fail:ov[a.fail],zfail:ov[a.zfail],zpass:ov[a.zpass],mask:n.mask},opBack:{fail:ov[u.fail],zfail:ov[u.zfail],zpass:ov[u.zpass],mask:n.mask}}}initCullDrawParams({cull:t}){if(t){const{enable:e,face:r=Ee.BACK}=t;return{enable:!!e,face:lD[r]}}}extractUniforms(t){const e={};return Object.keys(t).forEach(r=>{this.extractUniformsRecursively(r,t[r],e,"")}),e}extractUniformsRecursively(t,e,r,n){if(e===null||typeof e=="number"||typeof e=="boolean"||Array.isArray(e)&&typeof e[0]=="number"||RD(e)||e===""||"resize"in e){r[`${n&&n+"."}${t}`]=e;return}PD(e)&&Object.keys(e).forEach(a=>{this.extractUniformsRecursively(a,e[a],r,`${n&&n+"."}${t}`)}),Array.isArray(e)&&e.forEach((a,u)=>{Object.keys(a).forEach(y=>{this.extractUniformsRecursively(y,a[y],r,`${n&&n+"."}${t}[${u}]`)})})}};function LD(t){return typeof WebGL2RenderingContext!="undefined"&&t instanceof WebGL2RenderingContext?!0:!!(t&&t._version===2)}var nE=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),{isUndefined:ox}=es,DD=class{constructor(){this.uniformBuffers=[],this.queryVerdorInfo=()=>this.device.queryVendorInfo().platformString,this.createModel=t=>new ID(this.device,t,this),this.createAttribute=t=>new nD(this.device,t),this.createBuffer=t=>new pD(this.device,t),this.createElements=t=>new ED(this.device,t),this.createTexture2D=t=>new ZS(this.device,t),this.createFramebuffer=t=>new VS(this.device,t),this.useFramebuffer=(t,e)=>{this.currentFramebuffer=t,this.beginFrame(),e(),this.endFrame(),this.currentFramebuffer=null},this.useFramebufferAsync=(t,e)=>nE(this,null,function*(){this.currentFramebuffer=t,this.preRenderPass=this.renderPass,this.beginFrame(),yield e(),this.endFrame(),this.currentFramebuffer=null,this.renderPass=this.preRenderPass}),this.clear=t=>{const{color:e,depth:r,stencil:n,framebuffer:a=null}=t;if(a)a.clearOptions={color:e,depth:r,stencil:n};else{const u=this.queryVerdorInfo();if(u==="WebGL1"){const y=this.getGLContext();ox(n)?ox(r)||(y.clearDepth(r),y.clear(y.DEPTH_BUFFER_BIT)):(y.clearStencil(n),y.clear(y.STENCIL_BUFFER_BIT))}else if(u==="WebGL2"){const y=this.getGLContext();ox(n)?ox(r)||y.clearBufferfv(y.DEPTH,0,[r]):y.clearBufferiv(y.STENCIL,0,[n])}}},this.viewport=({width:t,height:e})=>{this.swapChain.configureSwapChain(t,e),this.createMainColorDepthRT(t,e),this.width=t,this.height=e},this.readPixels=t=>{const{framebuffer:e,x:r,y:n,width:a,height:u}=t,y=this.device.createReadback(),A=e.colorTexture,O=y.readTextureSync(A,r,this.viewportOrigin===ng.LOWER_LEFT?n:this.height-n,a,u,new Uint8Array(a*u*4));return y.destroy(),O},this.readPixelsAsync=t=>nE(this,null,function*(){const{framebuffer:e,x:r,y:n,width:a,height:u}=t,y=this.device.createReadback(),A=e.colorTexture,O=yield y.readTexture(A,r,this.viewportOrigin===ng.LOWER_LEFT?n:this.height-n,a,u,new Uint8Array(a*u*4));if(this.viewportOrigin!==ng.LOWER_LEFT)for(let Z=0;Z<O.length;Z+=4){const Y=O[Z];O[Z]=O[Z+2],O[Z+2]=Y}return y.destroy(),O}),this.getViewportSize=()=>({width:this.width,height:this.height}),this.getContainer=()=>{var t;return(t=this.canvas)==null?void 0:t.parentElement},this.getCanvas=()=>this.canvas,this.getGLContext=()=>this.device.gl,this.destroy=()=>{var t;this.canvas=null,(t=this.uniformBuffers)==null||t.forEach(e=>{e.destroy()}),this.device.destroy(),this.renderCache.destroy()}}init(t,e){return nE(this,null,function*(){const{enableWebGPU:r,shaderCompilerPath:n}=e;this.canvas=t;const u=yield(r?new GL({shaderCompilerPath:n}):new nL({targets:["webgl2","webgl1"],onContextLost(A){console.warn("context lost",A)},onContextCreationError(A){console.warn("context creation error",A)},onContextRestored(A){console.warn("context restored",A)}})).createSwapChain(t);u.configureSwapChain(t.width,t.height),this.device=u.getDevice(),this.swapChain=u,this.renderCache=new bD(this.device),this.currentFramebuffer=null,this.viewportOrigin=this.device.queryVendorInfo().viewportOrigin;const y=this.device.gl;this.extensionObject={OES_texture_float:!LD(y)&&this.device.OES_texture_float},this.createMainColorDepthRT(t.width,t.height)})}createMainColorDepthRT(t,e){this.mainColorRT&&this.mainColorRT.destroy(),this.mainDepthRT&&this.mainDepthRT.destroy(),this.mainColorRT=this.device.createRenderTargetFromTexture(this.device.createTexture({format:yr.U8_RGBA_RT,width:t,height:e,usage:ad.RENDER_TARGET})),this.mainDepthRT=this.device.createRenderTargetFromTexture(this.device.createTexture({format:yr.D24_S8,width:t,height:e,usage:ad.RENDER_TARGET}))}beginFrame(){this.device.beginFrame();const{currentFramebuffer:t,swapChain:e,mainColorRT:r,mainDepthRT:n}=this,a=t?t.colorRenderTarget:r,u=t?null:e.getOnscreenTexture(),y=t?t.depthRenderTarget:n,{color:A=[0,0,0,0],depth:O=1,stencil:Z=0}=(t==null?void 0:t.clearOptions)||{},Y=a?b_(A[0]*255,A[1]*255,A[2]*255,A[3]):U1,Q=y?O:void 0,ae=y?Z:void 0,xe=this.device.createRenderPass({colorAttachment:[a],colorResolveTo:[u],colorClearColor:[Y],colorStore:[!0],depthStencilAttachment:y,depthClearValue:Q,stencilClearValue:ae});this.renderPass=xe}endFrame(){this.device.submitPass(this.renderPass),this.device.endFrame()}getPointSizeRange(){const t=this.device.gl;return t.getParameter(t.ALIASED_POINT_SIZE_RANGE)}testExtension(t){return!!this.getGLContext().getExtension(t)}setState(){}setBaseState(){}setCustomLayerDefaults(){}setDirty(t){this.isDirty=t}getDirty(){return this.isDirty}},iE=["selectstart","selecting","selectend"],OD=class extends Yl.EventEmitter{constructor(t,e={}){super(),this.isEnable=!1,this.onDragStart=r=>{this.box.style.display="block",this.startEvent=this.endEvent=r,this.syncBoxBound(),this.emit("selectstart",this.getLngLatBox(),this.startEvent,this.endEvent)},this.onDragging=r=>{this.endEvent=r,this.syncBoxBound(),this.emit("selecting",this.getLngLatBox(),this.startEvent,this.endEvent)},this.onDragEnd=r=>{this.endEvent=r,this.box.style.display="none",this.emit("selectend",this.getLngLatBox(),this.startEvent,this.endEvent)},this.scene=t,this.options=e}get container(){return this.scene.getMapService().getMarkerContainer()}enable(){if(this.isEnable)return;const{className:t}=this.options;if(this.scene.setMapStatus({dragEnable:!1}),this.container.style.cursor="crosshair",!this.box){const e=Xo("div",void 0,this.container);e.classList.add("l7-select-box"),t&&e.classList.add(t),e.style.display="none",this.box=e}this.scene.on("dragstart",this.onDragStart),this.scene.on("dragging",this.onDragging),this.scene.on("dragend",this.onDragEnd),this.isEnable=!0}disable(){this.isEnable&&(this.scene.setMapStatus({dragEnable:!0}),this.container.style.cursor="auto",this.scene.off("dragstart",this.onDragStart),this.scene.off("dragging",this.onDragging),this.scene.off("dragend",this.onDragEnd),this.isEnable=!1)}syncBoxBound(){const{x:t,y:e}=this.startEvent,{x:r,y:n}=this.endEvent,a=Math.min(t,r),u=Math.min(e,n),y=Math.abs(t-r),A=Math.abs(e-n);this.box.style.top=`${u}px`,this.box.style.left=`${a}px`,this.box.style.width=`${y}px`,this.box.style.height=`${A}px`}getLngLatBox(){const{lngLat:{lng:t,lat:e}}=this.startEvent,{lngLat:{lng:r,lat:n}}=this.endEvent;return Rc([[t,e],[r,n]])}},BD=Object.defineProperty,FD=Object.defineProperties,kD=Object.getOwnPropertyDescriptors,GS=Object.getOwnPropertySymbols,ND=Object.prototype.hasOwnProperty,zD=Object.prototype.propertyIsEnumerable,WS=(t,e,r)=>e in t?BD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,UD=(t,e)=>{for(var r in e||(e={}))ND.call(e,r)&&WS(t,r,e[r]);if(GS)for(var r of GS(e))zD.call(e,r)&&WS(t,r,e[r]);return t},ZD=(t,e)=>FD(t,kD(e)),R_=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),VD=class{constructor(t){const{id:e,map:r,canvas:n,renderer:a="regl"}=t,u=jp();this.container=u,r.setContainer(u,e,n),a==="regl"?u.rendererService=new rD:u.rendererService=new DD,this.sceneService=u.sceneService,this.mapService=u.mapService,this.iconService=u.iconService,this.fontService=u.fontService,this.controlService=u.controlService,this.layerService=u.layerService,this.debugService=u.debugService,this.debugService.setEnable(t.debug),this.markerService=u.markerService,this.interactionService=u.interactionService,this.popupService=u.popupService,this.boxSelect=new OD(this,{}),this.initComponent(e),this.sceneService.init(t),this.initControl()}get map(){return this.mapService.map}get loaded(){return this.sceneService.loaded}getServiceContainer(){return this.container}getSize(){return this.mapService.getSize()}getMinZoom(){return this.mapService.getMinZoom()}getMaxZoom(){return this.mapService.getMaxZoom()}getType(){return this.mapService.getType()}getMapContainer(){return this.mapService.getMapContainer()}getMapCanvasContainer(){return this.mapService.getMapCanvasContainer()}getMapService(){return this.mapService}getDebugService(){return this.debugService}exportPng(t){return R_(this,null,function*(){return this.sceneService.exportPng(t)})}exportMap(t){return R_(this,null,function*(){return this.sceneService.exportPng(t)})}registerRenderService(t){this.sceneService.loaded?new t(this).init():this.on("loaded",()=>{new t(this).init()})}setBgColor(t){this.mapService.setBgColor(t)}addLayer(t){this.loaded?this.preAddLayer(t):this.once("loaded",()=>{this.preAddLayer(t)})}preAddLayer(t){const e=cp(this.container);if(t.setContainer(e),this.sceneService.addLayer(t),t.inited){this.initTileLayer(t);const r=this.initMask(t);this.addMask(r,t.id)}else t.on("inited",()=>{this.initTileLayer(t);const r=this.initMask(t);this.addMask(r,t.id)})}initMask(t){const{mask:e,maskfence:r,maskColor:n="#000",maskOpacity:a=0}=t.getLayerConfig();return!e||!r?void 0:new v2().source(r).shape("fill").style({color:n,opacity:a})}addMask(t,e){if(!t)return;const r=this.getLayer(e);if(r){const n=cp(this.container);t.setContainer(n),r.addMaskLayer(t),this.sceneService.addMask(t)}else console.warn("parent layer not find!")}getPickedLayer(){return this.layerService.pickedLayerId}getLayers(){return this.layerService.getLayers()}getLayer(t){return this.layerService.getLayer(t)}getLayerByName(t){return this.layerService.getLayerByName(t)}removeLayer(t,e){return R_(this,null,function*(){yield this.layerService.remove(t,e)})}removeAllLayer(){return R_(this,null,function*(){yield this.layerService.removeAllLayers()})}render(){this.sceneService.render()}setEnableRender(t){this.layerService.setEnableRender(t)}addIconFont(t,e){this.fontService.addIconFont(t,e)}addIconFonts(t){t.forEach(([e,r])=>{this.fontService.addIconFont(e,r)})}addFontFace(t,e){this.fontService.once("fontloaded",r=>{this.emit("fontloaded",r)}),this.fontService.addFontFace(t,e)}addImage(t,e){return R_(this,null,function*(){yield this.iconService.addImage(t,e)})}hasImage(t){return this.iconService.hasImage(t)}removeImage(t){this.iconService.removeImage(t)}addIconFontGlyphs(t,e){this.fontService.addIconGlyphs(e)}addControl(t){this.controlService.addControl(t,this.container)}removeControl(t){this.controlService.removeControl(t)}getControlByName(t){return this.controlService.getControlByName(t)}addMarker(t){this.markerService.addMarker(t)}addMarkerLayer(t){this.markerService.addMarkerLayer(t)}removeMarkerLayer(t){this.markerService.removeMarkerLayer(t)}removeAllMarkers(){this.markerService.removeAllMarkers()}removeAllMakers(){console.warn("removeAllMakers \u5DF2\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 removeAllMarkers"),this.markerService.removeAllMarkers()}addPopup(t){this.popupService.addPopup(t)}removePopup(t){this.popupService.removePopup(t)}on(t,e){var r;iE.includes(t)?(r=this.boxSelect)==null||r.on(t,e):dm.includes(t)?this.sceneService.on(t,e):this.mapService.on(t,e)}once(t,e){var r;iE.includes(t)?(r=this.boxSelect)==null||r.once(t,e):dm.includes(t)?this.sceneService.once(t,e):this.mapService.once(t,e)}emit(t,e){dm.indexOf(t)===-1?this.mapService.on(t,e):this.sceneService.emit(t,e)}off(t,e){var r;iE.includes(t)?(r=this.boxSelect)==null||r.off(t,e):dm.includes(t)?this.sceneService.off(t,e):this.mapService.off(t,e)}getZoom(){return this.mapService.getZoom()}getCenter(t){return this.mapService.getCenter(t)}setCenter(t,e){return this.mapService.setCenter(t,e)}getPitch(){return this.mapService.getPitch()}setPitch(t){return this.mapService.setPitch(t)}getRotation(){return this.mapService.getRotation()}getBounds(){return this.mapService.getBounds()}setRotation(t){this.mapService.setRotation(t)}zoomIn(){this.mapService.zoomIn()}zoomOut(){this.mapService.zoomOut()}panTo(t){this.mapService.panTo(t)}panBy(t,e){this.mapService.panBy(t,e)}getContainer(){return this.mapService.getContainer()}setZoom(t){this.mapService.setZoom(t)}fitBounds(t,e){const{fitBoundsOptions:r,animate:n}=this.sceneService.getSceneConfig();this.mapService.fitBounds(t,e||ZD(UD({},r),{animate:n}))}setZoomAndCenter(t,e){this.mapService.setZoomAndCenter(t,e)}setMapStyle(t){this.mapService.setMapStyle(t)}setMapStatus(t){this.mapService.setMapStatus(t)}pixelToLngLat(t){return this.mapService.pixelToLngLat(t)}lngLatToPixel(t){return this.mapService.lngLatToPixel(t)}containerToLngLat(t){return this.mapService.containerToLngLat(t)}lngLatToContainer(t){return this.mapService.lngLatToContainer(t)}destroy(){this.sceneService.destroy()}registerPostProcessingPass(t){this.container.postProcessingPass.name=new t}enableShaderPick(){this.layerService.enableShaderPick()}diasbleShaderPick(){this.layerService.disableShaderPick()}enableBoxSelect(t=!0){this.boxSelect.enable(),t&&this.boxSelect.once("selectend",()=>{this.disableBoxSelect()})}disableBoxSelect(){this.boxSelect.disable()}static addProtocol(t,e){je.REGISTERED_PROTOCOLS[t]=e}static removeProtocol(t){delete je.REGISTERED_PROTOCOLS[t]}getProtocol(t){return je.REGISTERED_PROTOCOLS[t]}startAnimate(){this.layerService.startAnimate()}stopAnimate(){this.layerService.stopAnimate()}getPointSizeRange(){return this.sceneService.getPointSizeRange()}initComponent(t){this.controlService.init({container:wc(t)},this.container),this.markerService.init(this.container),this.popupService.init(this.container)}initControl(){const{logoVisible:t,logoPosition:e}=this.sceneService.getSceneConfig();t&&this.addControl(new Ey({position:e}))}initTileLayer(t){t.getSource().isTile&&(t.tileLayer=new Xw(t))}},jD="2.21.8"},35855:function(Zr,_r,Se){"use strict";Se.d(_r,{$2:function(){return Qu},ns:function(){return na}});var ve=Se(5527),Ze=Se(93236),M=Se(31223),R=Se.n(M),de=function(C,P){return C===void 0&&(C=[]),P===void 0&&(P=[]),R()(C,P)},be=function(C){return function(P,U){var se=(0,Ze.useRef)(),Fe=(0,Ze.useRef)(0);(U===void 0||!de(U,se.current))&&(se.current=U,Fe.current+=1),C(P,[Fe.current])}},Le=be(Ze.useEffect),Re=Se(84875),Ce=Se.n(Re);function He(C){return C===void 0}var Xe=He;function Ke(C){return C===null}var Ve=Ke,et=typeof global=="object"&&global&&global.Object===Object&&global,er=et,fr=typeof self=="object"&&self&&self.Object===Object&&self,Ar=er||fr||Function("return this")(),pn=Ar,Kn=pn.Symbol,Jn=Kn,ki=Object.prototype,pa=ki.hasOwnProperty,xr=ki.toString,jt=Jn?Jn.toStringTag:void 0;function Jr(C){var P=pa.call(C,jt),U=C[jt];try{C[jt]=void 0;var se=!0}catch(rt){}var Fe=xr.call(C);return se&&(P?C[jt]=U:delete C[jt]),Fe}var gr=Jr,rn=Object.prototype,jn=rn.toString;function qe(C){return jn.call(C)}var Dt=qe,$e="[object Null]",Pt="[object Undefined]",vt=Jn?Jn.toStringTag:void 0;function rr(C){return C==null?C===void 0?Pt:$e:vt&&vt in Object(C)?gr(C):Dt(C)}var ar=rr;function wr(C){return C!=null&&typeof C=="object"}var Cr=wr,an="[object Number]";function yi(C){return typeof C=="number"||Cr(C)&&ar(C)==an}var li=yi,Uo=Se(80216);function vi(C){"@babel/helpers - typeof";return vi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},vi(C)}function bo(C,P){var U=typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(!U){if(Array.isArray(C)||(U=So(C))||P&&C&&typeof C.length=="number"){U&&(C=U);var se=0,Fe=function(){};return{s:Fe,n:function(){return se>=C.length?{done:!0}:{done:!1,value:C[se++]}},e:function(ur){throw ur},f:Fe}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var rt=!0,yt=!1,dt;return{s:function(){U=U.call(C)},n:function(){var ur=U.next();return rt=ur.done,ur},e:function(ur){yt=!0,dt=ur},f:function(){try{!rt&&U.return!=null&&U.return()}finally{if(yt)throw dt}}}}function So(C,P){if(C){if(typeof C=="string")return Xi(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return Xi(C,P)}}function Xi(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function Mi(C,P){if(!(C instanceof P))throw new TypeError("Cannot call a class as a function")}function qo(C,P){for(var U=0;U<P.length;U++){var se=P[U];se.enumerable=se.enumerable||!1,se.configurable=!0,"value"in se&&(se.writable=!0),Object.defineProperty(C,We(se.key),se)}}function ui(C,P,U){return P&&qo(C.prototype,P),U&&qo(C,U),Object.defineProperty(C,"prototype",{writable:!1}),C}function Qi(C,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");C.prototype=Object.create(P&&P.prototype,{constructor:{value:C,writable:!0,configurable:!0}}),Object.defineProperty(C,"prototype",{writable:!1}),P&&Vi(C,P)}function Vi(C,P){return Vi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(se,Fe){return se.__proto__=Fe,se},Vi(C,P)}function Pi(C){var P=ls();return function(){var se=dr(C),Fe;if(P){var rt=dr(this).constructor;Fe=Reflect.construct(se,arguments,rt)}else Fe=se.apply(this,arguments);return ds(this,Fe)}}function ds(C,P){if(P&&(vi(P)==="object"||typeof P=="function"))return P;if(P!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ur(C)}function Ur(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function ls(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(C){return!1}}function dr(C){return dr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},dr(C)}function he(C,P,U){return P=We(P),P in C?Object.defineProperty(C,P,{value:U,enumerable:!0,configurable:!0,writable:!0}):C[P]=U,C}function We(C){var P=at(C,"string");return vi(P)=="symbol"?P:String(P)}function at(C,P){if(vi(C)!="object"||!C)return C;var U=C[Symbol.toPrimitive];if(U!==void 0){var se=U.call(C,P||"default");if(vi(se)!="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(C)}var Ot=0,or=function(C){Qi(U,C);var P=Pi(U);function U(se){var Fe;return Mi(this,U),Fe=P.call(this),he(Ur(Fe),"scene",void 0),he(Ur(Fe),"options",void 0),he(Ur(Fe),"layerMap",new Map),Fe.scene=se.scene,Fe.options=se,Fe}return ui(U,[{key:"hasLayer",value:function(Fe){return this.layerMap.has(Fe)}},{key:"addLayer",value:function(Fe){var rt=this.getLayerId(Fe);this.layerMap.set(rt,Fe),Fe.addTo(this.scene),this.emit("add",Fe)}},{key:"addLayers",value:function(Fe){var rt=this;Fe.forEach(function(yt){rt.addLayer(yt)})}},{key:"removeLayer",value:function(Fe){var rt=typeof Fe=="string"?Fe:this.getLayerId(Fe),yt=this.layerMap.get(rt);return yt?(this.layerMap.delete(rt),yt.remove(),this.emit("remove",rt),!0):!1}},{key:"getLayers",value:function(){return Array.from(this.layerMap.values())}},{key:"getLayerById",value:function(Fe){return this.layerMap.get(Fe)}},{key:"getLayer",value:function(Fe){return this.getLayerById(Fe)}},{key:"removeAllLayer",value:function(){var Fe=bo(this.layerMap.values()),rt;try{for(Fe.s();!(rt=Fe.n()).done;){var yt=rt.value;yt.remove()}}catch(dt){Fe.e(dt)}finally{Fe.f()}this.layerMap.clear()}},{key:"isEmpty",value:function(){return this.layerMap.size===0}},{key:"getLayerId",value:function(Fe){return"id"in Fe?Fe.id:"".concat(Ot++)}},{key:"destroy",value:function(){this.removeAllLayer()}}]),U}(Uo.Z);function Wr(C,P,U,se){var Fe=-1,rt=C==null?0:C.length;for(se&&rt&&(U=C[++Fe]);++Fe<rt;)U=P(U,C[Fe],Fe,C);return U}var In=Wr;function kn(C){return function(P){return C==null?void 0:C[P]}}var eo=kn,un={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},To=eo(un),Ti=To;function Lo(C,P){for(var U=-1,se=C==null?0:C.length,Fe=Array(se);++U<se;)Fe[U]=P(C[U],U,C);return Fe}var wa=Lo,dn=Se(56052),co="[object Symbol]";function no(C){return typeof C=="symbol"||Cr(C)&&ar(C)==co}var Za=no,ms=1/0,Ji=Jn?Jn.prototype:void 0,Us=Ji?Ji.toString:void 0;function Lt(C){if(typeof C=="string")return C;if((0,dn.Z)(C))return wa(C,Lt)+"";if(Za(C))return Us?Us.call(C):"";var P=C+"";return P=="0"&&1/C==-ms?"-0":P}var Ne=Lt;function re(C){return C==null?"":Ne(C)}var le=re,ge=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ye="\\u0300-\\u036f",ze="\\ufe20-\\ufe2f",je="\\u20d0-\\u20ff",Ue=ye+ze+je,Ae="["+Ue+"]",Je=RegExp(Ae,"g");function wt(C){return C=le(C),C&&C.replace(ge,Ti).replace(Je,"")}var Ht=wt,Fr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function mr(C){return C.match(Fr)||[]}var Sr=mr,fn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function xn(C){return fn.test(C)}var Lr=xn,Nn="\\ud800-\\udfff",bn="\\u0300-\\u036f",En="\\ufe20-\\ufe2f",io="\\u20d0-\\u20ff",On=bn+En+io,Ao="\\u2700-\\u27bf",ia="a-z\\xdf-\\xf6\\xf8-\\xff",Ho="\\xac\\xb1\\xd7\\xf7",Ga="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Wo="\\u2000-\\u206f",Hl=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ns="A-Z\\xc0-\\xd6\\xd8-\\xde",Yo="\\ufe0e\\ufe0f",_a=Ho+Ga+Wo+Hl,$o="['\u2019]",Fo="["+_a+"]",us="["+On+"]",xc="\\d+",Ba="["+Ao+"]",Fa="["+ia+"]",sc="[^"+Nn+_a+xc+Ao+ia+ns+"]",Ql="\\ud83c[\\udffb-\\udfff]",oa="(?:"+us+"|"+Ql+")",Zo="[^"+Nn+"]",il="(?:\\ud83c[\\udde6-\\uddff]){2}",va="[\\ud800-\\udbff][\\udc00-\\udfff]",El="["+ns+"]",Wa="\\u200d",Ds="(?:"+Fa+"|"+sc+")",Rl="(?:"+El+"|"+sc+")",gu="(?:"+$o+"(?:d|ll|m|re|s|t|ve))?",gl="(?:"+$o+"(?:D|LL|M|RE|S|T|VE))?",wl=oa+"?",ol="["+Yo+"]?",Qa="(?:"+Wa+"(?:"+[Zo,il,va].join("|")+")"+ol+wl+")*",Gl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Wl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ut=ol+wl+Qa,At="(?:"+[Ba,il,va].join("|")+")"+ut,ir=RegExp([El+"?"+Fa+"+"+gu+"(?="+[Fo,El,"$"].join("|")+")",Rl+"+"+gl+"(?="+[Fo,El+Ds,"$"].join("|")+")",El+"?"+Ds+"+"+gu,El+"+"+gl,Wl,Gl,xc,At].join("|"),"g");function jr(C){return C.match(ir)||[]}var Dn=jr;function oo(C,P,U){return C=le(C),P=U?void 0:P,P===void 0?Lr(C)?Dn(C):Sr(C):C.match(P)||[]}var Xa=oo,mn="['\u2019]",kl=RegExp(mn,"g");function Il(C){return function(P){return In(Xa(Ht(P).replace(kl,"")),C,"")}}var Ia=Il,Xh=Ia(function(C,P,U){return C+(U?"-":"")+P.toLowerCase()}),Sl=Xh;function Va(C,P){return lo(C)||Ku(C,P)||Ni(C,P)||Aa()}function Aa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ni(C,P){if(C){if(typeof C=="string")return lc(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return lc(C,P)}}function lc(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function Ku(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function lo(C){if(Array.isArray(C))return C}var bs=function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.entries(P!=null?P:{}).map(function(U){var se=Va(U,2),Fe=se[0],rt=se[1],yt=Sl(Fe),dt=rt;return typeof dt=="number"?dt="".concat(dt,"px"):typeof dt=="string"&&(dt=dt.replace("'","")),"".concat(yt," :").concat(dt)}).join("; ")};function Os(C,P){return Fu(C)||Tl(C,P)||Io(C,P)||Nl()}function Nl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Io(C,P){if(C){if(typeof C=="string")return eu(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return eu(C,P)}}function eu(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function Tl(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function Fu(C){if(Array.isArray(C))return C}function Ju(C){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object.entries(C).sort(function(U,se){var Fe=Os(U,1),rt=Fe[0],yt=Os(se,1),dt=yt[0];return rt.localeCompare(dt)}).map(function(U){var se=Os(U,2),Fe=se[0],rt=se[1],yt=String(rt);return P&&(yt=window.encodeURI(String(rt))),"".concat(Fe,"=").concat(yt)}).join("&")}function al(C,P){return"".concat(C,"?").concat(Ju(P,!0))}function Kc(C){"@babel/helpers - typeof";return Kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},Kc(C)}function ou(){"use strict";ou=function(){return P};var C,P={},U=Object.prototype,se=U.hasOwnProperty,Fe=Object.defineProperty||function(hr,It,Qt){hr[It]=Qt.value},rt=typeof Symbol=="function"?Symbol:{},yt=rt.iterator||"@@iterator",dt=rt.asyncIterator||"@@asyncIterator",zt=rt.toStringTag||"@@toStringTag";function ur(hr,It,Qt){return Object.defineProperty(hr,It,{value:Qt,enumerable:!0,configurable:!0,writable:!0}),hr[It]}try{ur({},"")}catch(hr){ur=function(Qt,tn,Cn){return Qt[tn]=Cn}}function on(hr,It,Qt,tn){var Cn=It&&It.prototype instanceof _o?It:_o,gn=Object.create(Cn.prototype),zo=new zs(tn||[]);return Fe(gn,"_invoke",{value:aa(hr,Qt,zo)}),gn}function pi(hr,It,Qt){try{return{type:"normal",arg:hr.call(It,Qt)}}catch(tn){return{type:"throw",arg:tn}}}P.wrap=on;var Hi="suspendedStart",so="suspendedYield",uo="executing",ei="completed",ii={};function _o(){}function Li(){}function yo(){}var Ta={};ur(Ta,yt,function(){return this});var Ha=Object.getPrototypeOf,Ua=Ha&&Ha(Ha($s([])));Ua&&Ua!==U&&se.call(Ua,yt)&&(Ta=Ua);var ma=yo.prototype=_o.prototype=Object.create(Ta);function Zs(hr){["next","throw","return"].forEach(function(It){ur(hr,It,function(Qt){return this._invoke(It,Qt)})})}function Ts(hr,It){function Qt(Cn,gn,zo,fs){var Vs=pi(hr[Cn],hr,gn);if(Vs.type!=="throw"){var Lh=Vs.arg,yc=Lh.value;return yc&&Kc(yc)=="object"&&se.call(yc,"__await")?It.resolve(yc.__await).then(function(hp){Qt("next",hp,zo,fs)},function(hp){Qt("throw",hp,zo,fs)}):It.resolve(yc).then(function(hp){Lh.value=hp,zo(Lh)},function(hp){return Qt("throw",hp,zo,fs)})}fs(Vs.arg)}var tn;Fe(this,"_invoke",{value:function(gn,zo){function fs(){return new It(function(Vs,Lh){Qt(gn,zo,Vs,Lh)})}return tn=tn?tn.then(fs,fs):fs()}})}function aa(hr,It,Qt){var tn=Hi;return function(Cn,gn){if(tn===uo)throw new Error("Generator is already running");if(tn===ei){if(Cn==="throw")throw gn;return{value:C,done:!0}}for(Qt.method=Cn,Qt.arg=gn;;){var zo=Qt.delegate;if(zo){var fs=La(zo,Qt);if(fs){if(fs===ii)continue;return fs}}if(Qt.method==="next")Qt.sent=Qt._sent=Qt.arg;else if(Qt.method==="throw"){if(tn===Hi)throw tn=ei,Qt.arg;Qt.dispatchException(Qt.arg)}else Qt.method==="return"&&Qt.abrupt("return",Qt.arg);tn=uo;var Vs=pi(hr,It,Qt);if(Vs.type==="normal"){if(tn=Qt.done?ei:so,Vs.arg===ii)continue;return{value:Vs.arg,done:Qt.done}}Vs.type==="throw"&&(tn=ei,Qt.method="throw",Qt.arg=Vs.arg)}}}function La(hr,It){var Qt=It.method,tn=hr.iterator[Qt];if(tn===C)return It.delegate=null,Qt==="throw"&&hr.iterator.return&&(It.method="return",It.arg=C,La(hr,It),It.method==="throw")||Qt!=="return"&&(It.method="throw",It.arg=new TypeError("The iterator does not provide a '"+Qt+"' method")),ii;var Cn=pi(tn,hr.iterator,It.arg);if(Cn.type==="throw")return It.method="throw",It.arg=Cn.arg,It.delegate=null,ii;var gn=Cn.arg;return gn?gn.done?(It[hr.resultName]=gn.value,It.next=hr.nextLoc,It.method!=="return"&&(It.method="next",It.arg=C),It.delegate=null,ii):gn:(It.method="throw",It.arg=new TypeError("iterator result is not an object"),It.delegate=null,ii)}function hl(hr){var It={tryLoc:hr[0]};1 in hr&&(It.catchLoc=hr[1]),2 in hr&&(It.finallyLoc=hr[2],It.afterLoc=hr[3]),this.tryEntries.push(It)}function As(hr){var It=hr.completion||{};It.type="normal",delete It.arg,hr.completion=It}function zs(hr){this.tryEntries=[{tryLoc:"root"}],hr.forEach(hl,this),this.reset(!0)}function $s(hr){if(hr||hr===""){var It=hr[yt];if(It)return It.call(hr);if(typeof hr.next=="function")return hr;if(!isNaN(hr.length)){var Qt=-1,tn=function Cn(){for(;++Qt<hr.length;)if(se.call(hr,Qt))return Cn.value=hr[Qt],Cn.done=!1,Cn;return Cn.value=C,Cn.done=!0,Cn};return tn.next=tn}}throw new TypeError(Kc(hr)+" is not iterable")}return Li.prototype=yo,Fe(ma,"constructor",{value:yo,configurable:!0}),Fe(yo,"constructor",{value:Li,configurable:!0}),Li.displayName=ur(yo,zt,"GeneratorFunction"),P.isGeneratorFunction=function(hr){var It=typeof hr=="function"&&hr.constructor;return!!It&&(It===Li||(It.displayName||It.name)==="GeneratorFunction")},P.mark=function(hr){return Object.setPrototypeOf?Object.setPrototypeOf(hr,yo):(hr.__proto__=yo,ur(hr,zt,"GeneratorFunction")),hr.prototype=Object.create(ma),hr},P.awrap=function(hr){return{__await:hr}},Zs(Ts.prototype),ur(Ts.prototype,dt,function(){return this}),P.AsyncIterator=Ts,P.async=function(hr,It,Qt,tn,Cn){Cn===void 0&&(Cn=Promise);var gn=new Ts(on(hr,It,Qt,tn),Cn);return P.isGeneratorFunction(It)?gn:gn.next().then(function(zo){return zo.done?zo.value:gn.next()})},Zs(ma),ur(ma,zt,"Generator"),ur(ma,yt,function(){return this}),ur(ma,"toString",function(){return"[object Generator]"}),P.keys=function(hr){var It=Object(hr),Qt=[];for(var tn in It)Qt.push(tn);return Qt.reverse(),function Cn(){for(;Qt.length;){var gn=Qt.pop();if(gn in It)return Cn.value=gn,Cn.done=!1,Cn}return Cn.done=!0,Cn}},P.values=$s,zs.prototype={constructor:zs,reset:function(It){if(this.prev=0,this.next=0,this.sent=this._sent=C,this.done=!1,this.delegate=null,this.method="next",this.arg=C,this.tryEntries.forEach(As),!It)for(var Qt in this)Qt.charAt(0)==="t"&&se.call(this,Qt)&&!isNaN(+Qt.slice(1))&&(this[Qt]=C)},stop:function(){this.done=!0;var It=this.tryEntries[0].completion;if(It.type==="throw")throw It.arg;return this.rval},dispatchException:function(It){if(this.done)throw It;var Qt=this;function tn(Lh,yc){return zo.type="throw",zo.arg=It,Qt.next=Lh,yc&&(Qt.method="next",Qt.arg=C),!!yc}for(var Cn=this.tryEntries.length-1;Cn>=0;--Cn){var gn=this.tryEntries[Cn],zo=gn.completion;if(gn.tryLoc==="root")return tn("end");if(gn.tryLoc<=this.prev){var fs=se.call(gn,"catchLoc"),Vs=se.call(gn,"finallyLoc");if(fs&&Vs){if(this.prev<gn.catchLoc)return tn(gn.catchLoc,!0);if(this.prev<gn.finallyLoc)return tn(gn.finallyLoc)}else if(fs){if(this.prev<gn.catchLoc)return tn(gn.catchLoc,!0)}else{if(!Vs)throw new Error("try statement without catch or finally");if(this.prev<gn.finallyLoc)return tn(gn.finallyLoc)}}}},abrupt:function(It,Qt){for(var tn=this.tryEntries.length-1;tn>=0;--tn){var Cn=this.tryEntries[tn];if(Cn.tryLoc<=this.prev&&se.call(Cn,"finallyLoc")&&this.prev<Cn.finallyLoc){var gn=Cn;break}}gn&&(It==="break"||It==="continue")&&gn.tryLoc<=Qt&&Qt<=gn.finallyLoc&&(gn=null);var zo=gn?gn.completion:{};return zo.type=It,zo.arg=Qt,gn?(this.method="next",this.next=gn.finallyLoc,ii):this.complete(zo)},complete:function(It,Qt){if(It.type==="throw")throw It.arg;return It.type==="break"||It.type==="continue"?this.next=It.arg:It.type==="return"?(this.rval=this.arg=It.arg,this.method="return",this.next="end"):It.type==="normal"&&Qt&&(this.next=Qt),ii},finish:function(It){for(var Qt=this.tryEntries.length-1;Qt>=0;--Qt){var tn=this.tryEntries[Qt];if(tn.finallyLoc===It)return this.complete(tn.completion,tn.afterLoc),As(tn),ii}},catch:function(It){for(var Qt=this.tryEntries.length-1;Qt>=0;--Qt){var tn=this.tryEntries[Qt];if(tn.tryLoc===It){var Cn=tn.completion;if(Cn.type==="throw"){var gn=Cn.arg;As(tn)}return gn}}throw new Error("illegal catch attempt")},delegateYield:function(It,Qt,tn){return this.delegate={iterator:$s(It),resultName:Qt,nextLoc:tn},this.method==="next"&&(this.arg=C),ii}},P}function Ks(C,P,U,se,Fe,rt,yt){try{var dt=C[rt](yt),zt=dt.value}catch(ur){U(ur);return}dt.done?P(zt):Promise.resolve(zt).then(se,Fe)}function Lp(C){return function(){var P=this,U=arguments;return new Promise(function(se,Fe){var rt=C.apply(P,U);function yt(zt){Ks(rt,se,Fe,yt,dt,"next",zt)}function dt(zt){Ks(rt,se,Fe,yt,dt,"throw",zt)}yt(void 0)})}}var gf=function(){var C=Lp(ou().mark(function P(U,se){return ou().wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:if(U!=="Map"){rt.next=2;break}return rt.abrupt("return",new ve.Map(se));case 2:if(U!=="Gaode"){rt.next=6;break}return rt.abrupt("return",new ve.GaodeMap(se));case 6:if(U!=="GaodeV1"){rt.next=10;break}return rt.abrupt("return",new ve.GaodeMapV1(se));case 10:if(U!=="GaodeV2"){rt.next=12;break}return rt.abrupt("return",new ve.GaodeMapV2(se));case 12:if(U!=="Tencent"){rt.next=14;break}return rt.abrupt("return",Promise.resolve(Promise.resolve().then(Se.bind(Se,5527))).then(function(yt){var dt=yt.TencentMap;return new dt(se)}));case 14:if(U!=="Baidu"){rt.next=16;break}return rt.abrupt("return",Promise.resolve(Promise.resolve().then(Se.bind(Se,5527))).then(function(yt){var dt=yt.BaiduMap;return new dt(se)}));case 16:return rt.abrupt("return",Promise.resolve(Promise.resolve().then(Se.bind(Se,5527))).then(function(yt){var dt=yt.Mapbox;return new dt(se)}));case 17:case"end":return rt.stop()}},P)}));return function(U,se){return C.apply(this,arguments)}}(),Of=function(C,P){return C?C.map(function(U,se){return Object.is(C[se],P==null?void 0:P[se])?-1:se}).filter(function(U){return U>=0}):P?P.map(function(U,se){return se}):[]},qh=function(C,P){var U=(0,Ze.useRef)();(0,Ze.useEffect)(function(){var se=Of(U.current,P),Fe=U.current;return U.current=P,C(se,Fe,P)},P)},zc=qh,Oh=Se(91168),Ms={onLoaded:"loaded",onDestroy:"destroy",onResize:"resize",onMapMove:"mapmove",onMoveStart:"movestart",onMoveEnd:"moveend",onZoomChange:"zoomchange",onZoomStart:"zoomstart",onZoomEnd:"zoomend",onClick:"click",onDblclick:"dblclick",onContextMenu:"contextmenu",onMouseMove:"mousemove",onMouseWheel:"mousewheel",onMouseDown:"mousedown",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseUp:"mouseup",onDragStart:"dragstart",onDragging:"dragging",onDragEnd:"dragend"},Jc=Object.keys(Ms);function Yh(C){return yh(C)||eh(C)||uc(C)||Qc()}function Qc(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uc(C,P){if(C){if(typeof C=="string")return sl(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return sl(C,P)}}function eh(C){if(typeof Symbol!="undefined"&&C[Symbol.iterator]!=null||C["@@iterator"]!=null)return Array.from(C)}function yh(C){if(Array.isArray(C))return sl(C)}function sl(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}var Uc=function(P,U){zc(function(se,Fe,rt){if(P){var yt=se.filter(function(dt){return!!dt}).map(function(dt){return dt-1});se.includes(0)&&(yt=Jc.map(function(dt,zt){return zt})),yt.forEach(function(dt){var zt=Ms[Jc[dt]],ur=Fe[dt+1],on=rt[dt+1];ur&&P.off(zt,ur),on&&P.on(zt,on)})}},[P].concat(Yh(Jc.map(function(se){return U[se]})))),(0,Oh.Z)(function(){P&&Jc.forEach(function(se){var Fe=Ms[se],rt=U[se];Fe&&rt&&P.off(Fe,rt)})})};function bc(C){"@babel/helpers - typeof";return bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},bc(C)}var fp=["id","style","className","map","mapType","mapOptions","onLayerManagerCreated","onSceneLoaded","children"];function dp(C,P){var U=Object.keys(C);if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(C);P&&(se=se.filter(function(Fe){return Object.getOwnPropertyDescriptor(C,Fe).enumerable})),U.push.apply(U,se)}return U}function Ps(C){for(var P=1;P<arguments.length;P++){var U=arguments[P]!=null?arguments[P]:{};P%2?dp(Object(U),!0).forEach(function(se){Gf(C,se,U[se])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(U)):dp(Object(U)).forEach(function(se){Object.defineProperty(C,se,Object.getOwnPropertyDescriptor(U,se))})}return C}function Gf(C,P,U){return P=Xp(P),P in C?Object.defineProperty(C,P,{value:U,enumerable:!0,configurable:!0,writable:!0}):C[P]=U,C}function Xp(C){var P=cc(C,"string");return bc(P)=="symbol"?P:String(P)}function cc(C,P){if(bc(C)!="object"||!C)return C;var U=C[Symbol.toPrimitive];if(U!==void 0){var se=U.call(C,P||"default");if(bc(se)!="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(C)}function zl(C,P){return qa(C)||xh(C,P)||th(C,P)||Ec()}function Ec(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function th(C,P){if(C){if(typeof C=="string")return vu(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return vu(C,P)}}function vu(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function xh(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function qa(C){if(Array.isArray(C))return C}function Hs(C,P){if(C==null)return{};var U=Ep(C,P),se,Fe;if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(C);for(Fe=0;Fe<rt.length;Fe++)se=rt[Fe],!(P.indexOf(se)>=0)&&Object.prototype.propertyIsEnumerable.call(C,se)&&(U[se]=C[se])}return U}function Ep(C,P){if(C==null)return{};var U={},se=Object.keys(C),Fe,rt;for(rt=0;rt<se.length;rt++)Fe=se[rt],!(P.indexOf(Fe)>=0)&&(U[Fe]=C[Fe]);return U}var Na=Ze.createContext(null),Qu=(0,Ze.memo)((0,Ze.forwardRef)(function(P,U){var se=P.id,Fe=P.style,rt=P.className,yt=P.map,dt=P.mapType,zt=dt===void 0?"Gaode":dt,ur=P.mapOptions,on=ur===void 0?{}:ur,pi=P.onLayerManagerCreated,Hi=P.onSceneLoaded,so=P.children,uo=Hs(P,fp),ei=(0,Ze.useRef)(),ii=(0,Ze.useState)(null),_o=zl(ii,2),Li=_o[0],yo=_o[1],Ta=(0,Ze.useRef)({scene:null,layerManager:null}),Ha=Ta.current;(0,Ze.useEffect)(function(){var ma,Zs=!0,Ts=Xe(yt)?gf(zt,on):typeof yt=="function"?yt():yt;return Promise.resolve(Ts).then(function(aa){if(Zs){ma=new ve.Scene(Ps(Ps({},uo),{},{id:ei.current,map:aa}));var La=new or({scene:ma});Ha.scene=ma,Ha.layerManager=La,ma.once("loaded",function(){Hi&&Hi(ma),pi&&pi(La),yo(ma)})}}).catch(function(aa){console.error(aa)}),function(){Zs=!1,ma&&(Ha.scene=null,Ha.layerManager=null,ma.destroy())}},[]),Uc(Li,P),(0,Ze.useImperativeHandle)(U,function(){return{getScene:function(){return Li},getMap:function(){return Li.map}}},[Li]),(0,Ze.useEffect)(function(){Li&&on.style&&Li.setMapStyle(on.style)},[on.style]),Le(function(){Ve(Li)||(on.center&&li(on.zoom)?Li.setZoomAndCenter(on.zoom,on.center):li(on.zoom)?Li.setZoom(on.zoom):on.center&&Li.setCenter(on.center))},[on.zoom,on.center]),(0,Ze.useEffect)(function(){Li&&li(on.pitch)&&Li.setPitch(on.pitch)},[on.pitch]),(0,Ze.useEffect)(function(){Li&&li(on.rotation)&&Li.setRotation(on.rotation)},[on.rotation]);var Ua=(0,Ze.useMemo)(function(){return Ps({position:"relative"},Fe)},[Fe]);return Ze.createElement("div",{id:se,ref:ei,style:Ua,className:Ce()("larkmap",rt)},Li&&Ze.createElement(Na.Provider,{value:Ha},so))})),Is=Se(8573),ys=function(){var P=(0,Ze.useContext)(Na);if(!P)throw new Error("The useScene must be used in the LarkMap container");var U=P.scene;return U},ec=function(P,U,se){var Fe=ys(),rt=(0,Ze.useRef)();(0,Ze.useEffect)(function(){var yt=new ve.Control(se);return yt.onAdd=function(){return P(Fe)},yt.onRemove=function(){},rt.current=yt,Fe.addControl(yt),function(){typeof U=="function"&&U(Fe),rt.current=null,Fe.removeControl(yt)}},[]),(0,Is.Z)(function(){var yt;(yt=rt.current)===null||yt===void 0||yt.setOptions(se)},[se])},Bf=function(){var P=(0,Ze.useContext)(Na);if(!P)throw new Error("The useLayerManager must be used in the LarkMap container");var U=P.layerManager;return U};function es(C,P){return $h(C)||Sc(C,P)||wc(C,P)||Bs()}function Bs(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wc(C,P){if(C){if(typeof C=="string")return qp(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return qp(C,P)}}function qp(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function Sc(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function $h(C){if(Array.isArray(C))return C}var Xo=function(P){var U=useLayerManager(),se=useState(U.getLayer(P)),Fe=es(se,2),rt=Fe[0],yt=Fe[1];return useEffect(function(){var dt=function(pi){P===pi.id&&yt(pi)},zt=function(pi){P===pi&&yt(void 0)},ur=U.getLayer(P);return ur?yt(ur):(U.on("add",dt),U.on("remove",zt)),function(){ur===void 0&&(U.off("add",dt),U.off("remove",zt))}},[P]),rt};function au(C,P){return Kh(C)||mp(C,P)||tc(C,P)||dl()}function dl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tc(C,P){if(C){if(typeof C=="string")return bh(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return bh(C,P)}}function bh(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function mp(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function Kh(C){if(Array.isArray(C))return C}var Zc=function(){var P=useLayerManager(),U=useState((P==null?void 0:P.getLayers())||[]),se=au(U,2),Fe=se[0],rt=se[1];return useEffect(function(){if(P){var yt=function(){rt(P.getLayers())};return P.on("add",yt),P.on("remove",yt),function(){P.off("add",yt),P.off("remove",yt)}}},[P]),Fe};function vf(){this.__data__=[],this.size=0}var Bh=vf;function _u(C,P){return C===P||C!==C&&P!==P}var Vc=_u;function Yp(C,P){for(var U=C.length;U--;)if(Vc(C[U][0],P))return U;return-1}var Fh=Yp,Ll=Array.prototype,Fs=Ll.splice;function Tc(C){var P=this.__data__,U=Fh(P,C);if(U<0)return!1;var se=P.length-1;return U==se?P.pop():Fs.call(P,U,1),--this.size,!0}var Ru=Tc;function jc(C){var P=this.__data__,U=Fh(P,C);return U<0?void 0:P[U][1]}var $p=jc;function Jh(C){return Fh(this.__data__,C)>-1}var Ac=Jh;function kh(C,P){var U=this.__data__,se=Fh(U,C);return se<0?(++this.size,U.push([C,P])):U[se][1]=P,this}var Iu=kh;function rh(C){var P=-1,U=C==null?0:C.length;for(this.clear();++P<U;){var se=C[P];this.set(se[0],se[1])}}rh.prototype.clear=Bh,rh.prototype.delete=Ru,rh.prototype.get=$p,rh.prototype.has=Ac,rh.prototype.set=Iu;var gp=rh;function vp(){this.__data__=new gp,this.size=0}var Kp=vp;function Hc(C){var P=this.__data__,U=P.delete(C);return this.size=P.size,U}var Eh=Hc;function yu(C){return this.__data__.get(C)}var Ya=yu;function nh(C){return this.__data__.has(C)}var Gc=nh;function ih(C){var P=typeof C;return C!=null&&(P=="object"||P=="function")}var Sa=ih,cs="[object AsyncFunction]",ku="[object Function]",rc="[object GeneratorFunction]",xu="[object Proxy]";function oh(C){if(!Sa(C))return!1;var P=ar(C);return P==ku||P==rc||P==cs||P==xu}var Cc=oh,ah=pn["__core-js_shared__"],Qh=ah,sh=function(){var C=/[^.]+$/.exec(Qh&&Qh.keys&&Qh.keys.IE_PROTO||"");return C?"Symbol(src)_1."+C:""}();function Ul(C){return!!sh&&sh in C}var ll=Ul,Wc=Function.prototype,vl=Wc.toString;function oi(C){if(C!=null){try{return vl.call(C)}catch(P){}try{return C+""}catch(P){}}return""}var fi=oi,tu=/[\\^$.*+?()[\]{}|]/g,bu=/^\[object .+?Constructor\]$/,Dp=Function.prototype,ai=Object.prototype,is=Dp.toString,ep=ai.hasOwnProperty,mi=RegExp("^"+is.call(ep).replace(tu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Mc(C){if(!Sa(C)||ll(C))return!1;var P=Cc(C)?mi:bu;return P.test(fi(C))}var Op=Mc;function Jp(C,P){return C==null?void 0:C[P]}var Xc=Jp;function hc(C,P){var U=Xc(C,P);return Op(U)?U:void 0}var wh=hc,Pc=wh(pn,"Map"),Xl=Pc,Rc=wh(Object,"create"),Eu=Rc;function lh(){this.__data__=Eu?Eu(null):{},this.size=0}var tp=lh;function rp(C){var P=this.has(C)&&delete this.__data__[C];return this.size-=P?1:0,P}var su=rp,ql="__lodash_hash_undefined__",fa=Object.prototype,Rs=fa.hasOwnProperty;function hs(C){var P=this.__data__;if(Eu){var U=P[C];return U===ql?void 0:U}return Rs.call(P,C)?P[C]:void 0}var lu=hs,wu=Object.prototype,uh=wu.hasOwnProperty;function ch(C){var P=this.__data__;return Eu?P[C]!==void 0:uh.call(P,C)}var Nu=ch,Qp="__lodash_hash_undefined__";function Gi(C,P){var U=this.__data__;return this.size+=this.has(C)?0:1,U[C]=Eu&&P===void 0?Qp:P,this}var Si=Gi;function ji(C){var P=-1,U=C==null?0:C.length;for(this.clear();++P<U;){var se=C[P];this.set(se[0],se[1])}}ji.prototype.clear=tp,ji.prototype.delete=su,ji.prototype.get=lu,ji.prototype.has=Nu,ji.prototype.set=Si;var ao=ji;function Ic(){this.size=0,this.__data__={hash:new ao,map:new(Xl||gp),string:new ao}}var Gs=Ic;function Lc(C){var P=typeof C;return P=="string"||P=="number"||P=="symbol"||P=="boolean"?C!=="__proto__":C===null}var ul=Lc;function Nh(C,P){var U=C.__data__;return ul(P)?U[typeof P=="string"?"string":"hash"]:U.map}var xa=Nh;function Al(C){var P=xa(this,C).delete(C);return this.size-=P?1:0,P}var Lu=Al;function ks(C){return xa(this,C).get(C)}var _l=ks;function pc(C){return xa(this,C).has(C)}var Du=pc;function zh(C,P){var U=xa(this,C),se=U.size;return U.set(C,P),this.size+=U.size==se?0:1,this}var Su=zh;function qc(C){var P=-1,U=C==null?0:C.length;for(this.clear();++P<U;){var se=C[P];this.set(se[0],se[1])}}qc.prototype.clear=Gs,qc.prototype.delete=Lu,qc.prototype.get=_l,qc.prototype.has=Du,qc.prototype.set=Su;var Sh=qc,nc=200;function Yl(C,P){var U=this.__data__;if(U instanceof gp){var se=U.__data__;if(!Xl||se.length<nc-1)return se.push([C,P]),this.size=++U.size,this;U=this.__data__=new Sh(se)}return U.set(C,P),this.size=U.size,this}var Th=Yl;function ba(C){var P=this.__data__=new gp(C);this.size=P.size}ba.prototype.clear=Kp,ba.prototype.delete=Eh,ba.prototype.get=Ya,ba.prototype.has=Gc,ba.prototype.set=Th;var z=ba,s="__lodash_hash_undefined__";function x(C){return this.__data__.set(C,s),this}var I=x;function k(C){return this.__data__.has(C)}var H=k;function ee(C){var P=-1,U=C==null?0:C.length;for(this.__data__=new Sh;++P<U;)this.add(C[P])}ee.prototype.add=ee.prototype.push=I,ee.prototype.has=H;var ne=ee;function ue(C,P){for(var U=-1,se=C==null?0:C.length;++U<se;)if(P(C[U],U,C))return!0;return!1}var _e=ue;function h(C,P){return C.has(P)}var g=h,d=1,b=2;function B(C,P,U,se,Fe,rt){var yt=U&d,dt=C.length,zt=P.length;if(dt!=zt&&!(yt&&zt>dt))return!1;var ur=rt.get(C),on=rt.get(P);if(ur&&on)return ur==P&&on==C;var pi=-1,Hi=!0,so=U&b?new ne:void 0;for(rt.set(C,P),rt.set(P,C);++pi<dt;){var uo=C[pi],ei=P[pi];if(se)var ii=yt?se(ei,uo,pi,P,C,rt):se(uo,ei,pi,C,P,rt);if(ii!==void 0){if(ii)continue;Hi=!1;break}if(so){if(!_e(P,function(_o,Li){if(!g(so,Li)&&(uo===_o||Fe(uo,_o,U,se,rt)))return so.push(Li)})){Hi=!1;break}}else if(!(uo===ei||Fe(uo,ei,U,se,rt))){Hi=!1;break}}return rt.delete(C),rt.delete(P),Hi}var G=B,q=pn.Uint8Array,te=q;function fe(C){var P=-1,U=Array(C.size);return C.forEach(function(se,Fe){U[++P]=[Fe,se]}),U}var ce=fe;function Te(C){var P=-1,U=Array(C.size);return C.forEach(function(se){U[++P]=se}),U}var Ie=Te,Oe=1,Qe=2,nt="[object Boolean]",ct="[object Date]",tt="[object Error]",Tt="[object Map]",Ut="[object Number]",Nt="[object RegExp]",pr="[object Set]",tr="[object String]",Dr="[object Symbol]",Hr="[object ArrayBuffer]",sn="[object DataView]",nn=Jn?Jn.prototype:void 0,Gn=nn?nn.valueOf:void 0;function di(C,P,U,se,Fe,rt,yt){switch(U){case sn:if(C.byteLength!=P.byteLength||C.byteOffset!=P.byteOffset)return!1;C=C.buffer,P=P.buffer;case Hr:return!(C.byteLength!=P.byteLength||!rt(new te(C),new te(P)));case nt:case ct:case Ut:return Vc(+C,+P);case tt:return C.name==P.name&&C.message==P.message;case Nt:case tr:return C==P+"";case Tt:var dt=ce;case pr:var zt=se&Oe;if(dt||(dt=Ie),C.size!=P.size&&!zt)return!1;var ur=yt.get(C);if(ur)return ur==P;se|=Qe,yt.set(C,P);var on=G(dt(C),dt(P),se,Fe,rt,yt);return yt.delete(C),on;case Dr:if(Gn)return Gn.call(C)==Gn.call(P)}return!1}var Di=di;function Ui(C,P){for(var U=-1,se=P.length,Fe=C.length;++U<se;)C[Fe+U]=P[U];return C}var ho=Ui;function gi(C,P,U){var se=P(C);return(0,dn.Z)(C)?se:ho(se,U(C))}var Wi=gi;function Ko(C,P){for(var U=-1,se=C==null?0:C.length,Fe=0,rt=[];++U<se;){var yt=C[U];P(yt,U,C)&&(rt[Fe++]=yt)}return rt}var Mo=Ko;function mo(){return[]}var ko=mo,xo=Object.prototype,qi=xo.propertyIsEnumerable,xs=Object.getOwnPropertySymbols,gs=xs?function(C){return C==null?[]:(C=Object(C),Mo(xs(C),function(P){return qi.call(C,P)}))}:ko,Cl=gs;function ts(C,P){for(var U=-1,se=Array(C);++U<C;)se[U]=P(U);return se}var ja=ts,$a="[object Arguments]";function vs(C){return Cr(C)&&ar(C)==$a}var Zl=vs,zu=Object.prototype,Uu=zu.hasOwnProperty,hh=zu.propertyIsEnumerable,Yc=Zl(function(){return arguments}())?Zl:function(C){return Cr(C)&&Uu.call(C,"callee")&&!hh.call(C,"callee")},np=Yc;function pu(){return!1}var Tu=pu,Zu=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Dl=Zu&&typeof module=="object"&&module&&!module.nodeType&&module,Vl=Dl&&Dl.exports===Zu,Uh=Vl?pn.Buffer:void 0,ml=Uh?Uh.isBuffer:void 0,$l=ml||Tu,Vu=$l,Ws=9007199254740991,ju=/^(?:0|[1-9]\d*)$/;function os(C,P){var U=typeof C;return P=P==null?Ws:P,!!P&&(U=="number"||U!="symbol"&&ju.test(C))&&C>-1&&C%1==0&&C<P}var yl=os,Ol=9007199254740991;function ph(C){return typeof C=="number"&&C>-1&&C%1==0&&C<=Ol}var _f=ph,ip="[object Arguments]",yf="[object Array]",Hu="[object Boolean]",Bp="[object Date]",fc="[object Error]",Wf="[object Function]",op="[object Map]",ef="[object Number]",_s="[object Object]",Ff="[object RegExp]",sd="[object Set]",fh="[object String]",_d="[object WeakMap]",ld="[object ArrayBuffer]",ym="[object DataView]",Xf="[object Float32Array]",tm="[object Float64Array]",Gu="[object Int8Array]",xf="[object Int16Array]",tf="[object Int32Array]",ud="[object Uint8Array]",qf="[object Uint8ClampedArray]",Dd="[object Uint16Array]",Yf="[object Uint32Array]",Kl={};Kl[Xf]=Kl[tm]=Kl[Gu]=Kl[xf]=Kl[tf]=Kl[ud]=Kl[qf]=Kl[Dd]=Kl[Yf]=!0,Kl[ip]=Kl[yf]=Kl[ld]=Kl[Hu]=Kl[ym]=Kl[Bp]=Kl[fc]=Kl[Wf]=Kl[op]=Kl[ef]=Kl[_s]=Kl[Ff]=Kl[sd]=Kl[fh]=Kl[_d]=!1;function Od(C){return Cr(C)&&_f(C.length)&&!!Kl[ar(C)]}var Bd=Od;function bf(C){return function(P){return C(P)}}var wp=bf,$f=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ap=$f&&typeof module=="object"&&module&&!module.nodeType&&module,kf=ap&&ap.exports===$f,xl=kf&&er.process,dc=function(){try{var C=ap&&ap.require&&ap.require("util").types;return C||xl&&xl.binding&&xl.binding("util")}catch(P){}}(),Fp=dc,Sp=Fp&&Fp.isTypedArray,rf=Sp?wp(Sp):Bd,nf=rf,Nf=Object.prototype,zf=Nf.hasOwnProperty;function of(C,P){var U=(0,dn.Z)(C),se=!U&&np(C),Fe=!U&&!se&&Vu(C),rt=!U&&!se&&!Fe&&nf(C),yt=U||se||Fe||rt,dt=yt?ja(C.length,String):[],zt=dt.length;for(var ur in C)(P||zf.call(C,ur))&&!(yt&&(ur=="length"||Fe&&(ur=="offset"||ur=="parent")||rt&&(ur=="buffer"||ur=="byteLength"||ur=="byteOffset")||yl(ur,zt)))&&dt.push(ur);return dt}var af=of,kp=Object.prototype;function yd(C){var P=C&&C.constructor,U=typeof P=="function"&&P.prototype||kp;return C===U}var Dc=yd;function _p(C,P){return function(U){return C(P(U))}}var Kf=_p,xd=Kf(Object.keys,Object),bd=xd,Ed=Object.prototype,Tp=Ed.hasOwnProperty;function Ef(C){if(!Dc(C))return bd(C);var P=[];for(var U in Object(C))Tp.call(C,U)&&U!="constructor"&&P.push(U);return P}var wd=Ef;function cd(C){return C!=null&&_f(C.length)&&!Cc(C)}var hd=cd;function Uf(C){return hd(C)?af(C):wd(C)}var sf=Uf;function Ou(C){return Wi(C,sf,Cl)}var Zh=Ou,lf=1,Ah=Object.prototype,Np=Ah.hasOwnProperty;function pd(C,P,U,se,Fe,rt){var yt=U&lf,dt=Zh(C),zt=dt.length,ur=Zh(P),on=ur.length;if(zt!=on&&!yt)return!1;for(var pi=zt;pi--;){var Hi=dt[pi];if(!(yt?Hi in P:Np.call(P,Hi)))return!1}var so=rt.get(C),uo=rt.get(P);if(so&&uo)return so==P&&uo==C;var ei=!0;rt.set(C,P),rt.set(P,C);for(var ii=yt;++pi<zt;){Hi=dt[pi];var _o=C[Hi],Li=P[Hi];if(se)var yo=yt?se(Li,_o,Hi,P,C,rt):se(_o,Li,Hi,C,P,rt);if(!(yo===void 0?_o===Li||Fe(_o,Li,U,se,rt):yo)){ei=!1;break}ii||(ii=Hi=="constructor")}if(ei&&!ii){var Ta=C.constructor,Ha=P.constructor;Ta!=Ha&&"constructor"in C&&"constructor"in P&&!(typeof Ta=="function"&&Ta instanceof Ta&&typeof Ha=="function"&&Ha instanceof Ha)&&(ei=!1)}return rt.delete(C),rt.delete(P),ei}var yp=pd,Zf=wh(pn,"DataView"),zp=Zf,Oc=wh(pn,"Promise"),Wu=Oc,Au=wh(pn,"Set"),dh=Au,rm=wh(pn,"WeakMap"),Ap=rm,nm="[object Map]",Fd="[object Object]",xm="[object Promise]",Jf="[object Set]",kd="[object WeakMap]",fd="[object DataView]",Bc=fi(zp),im=fi(Xl),om=fi(Wu),Nd=fi(dh),am=fi(Ap),uf=ar;(zp&&uf(new zp(new ArrayBuffer(1)))!=fd||Xl&&uf(new Xl)!=nm||Wu&&uf(Wu.resolve())!=xm||dh&&uf(new dh)!=Jf||Ap&&uf(new Ap)!=kd)&&(uf=function(C){var P=ar(C),U=P==Fd?C.constructor:void 0,se=U?fi(U):"";if(se)switch(se){case Bc:return fd;case im:return nm;case om:return xm;case Nd:return Jf;case am:return kd}return P});var Qf=uf,cl=1,zd="[object Arguments]",Fc="[object Array]",Pe="[object Object]",_t=Object.prototype,Zt=_t.hasOwnProperty;function qr(C,P,U,se,Fe,rt){var yt=(0,dn.Z)(C),dt=(0,dn.Z)(P),zt=yt?Fc:Qf(C),ur=dt?Fc:Qf(P);zt=zt==zd?Pe:zt,ur=ur==zd?Pe:ur;var on=zt==Pe,pi=ur==Pe,Hi=zt==ur;if(Hi&&Vu(C)){if(!Vu(P))return!1;yt=!0,on=!1}if(Hi&&!on)return rt||(rt=new z),yt||nf(C)?G(C,P,U,se,Fe,rt):Di(C,P,zt,U,se,Fe,rt);if(!(U&cl)){var so=on&&Zt.call(C,"__wrapped__"),uo=pi&&Zt.call(P,"__wrapped__");if(so||uo){var ei=so?C.value():C,ii=uo?P.value():P;return rt||(rt=new z),Fe(ei,ii,U,se,rt)}}return Hi?(rt||(rt=new z),yp(C,P,U,se,Fe,rt)):!1}var wn=qr;function Yr(C,P,U,se,Fe){return C===P?!0:C==null||P==null||!Cr(C)&&!Cr(P)?C!==C&&P!==P:wn(C,P,U,se,Yr,Fe)}var Or=Yr;function Wn(C,P){return Or(C,P)}var Bn=Wn;function si(C,P){for(var U=-1,se=C==null?0:C.length;++U<se&&P(C[U],U,C)!==!1;);return C}var Hn=si,qn=function(){try{var C=wh(Object,"defineProperty");return C({},"",{}),C}catch(P){}}(),ci=qn;function Vn(C,P,U){P=="__proto__"&&ci?ci(C,P,{configurable:!0,enumerable:!0,value:U,writable:!0}):C[P]=U}var Yn=Vn,Tr=Object.prototype,en=Tr.hasOwnProperty;function Xn(C,P,U){var se=C[P];(!(en.call(C,P)&&Vc(se,U))||U===void 0&&!(P in C))&&Yn(C,P,U)}var _i=Xn;function Rn(C,P,U,se){var Fe=!U;U||(U={});for(var rt=-1,yt=P.length;++rt<yt;){var dt=P[rt],zt=se?se(U[dt],C[dt],dt,U,C):void 0;zt===void 0&&(zt=C[dt]),Fe?Yn(U,dt,zt):_i(U,dt,zt)}return U}var xi=Rn;function Un(C,P){return C&&xi(P,sf(P),C)}var Oi=Un;function Ln(C){var P=[];if(C!=null)for(var U in Object(C))P.push(U);return P}var wi=Ln,Po=Object.prototype,da=Po.hasOwnProperty;function bi(C){if(!Sa(C))return wi(C);var P=Dc(C),U=[];for(var se in C)se=="constructor"&&(P||!da.call(C,se))||U.push(se);return U}var Zn=bi;function Sn(C){return hd(C)?af(C,!0):Zn(C)}var Wt=Sn;function K(C,P){return C&&xi(P,Wt(P),C)}var Ei=K,Ee=typeof exports=="object"&&exports&&!exports.nodeType&&exports,sa=Ee&&typeof module=="object"&&module&&!module.nodeType&&module,Jo=sa&&sa.exports===Ee,Es=Jo?pn.Buffer:void 0,Cu=Es?Es.allocUnsafe:void 0;function Bl(C,P){if(P)return C.slice();var U=C.length,se=Cu?Cu(U):new C.constructor(U);return C.copy(se),se}var as=Bl;function fu(C,P){var U=-1,se=C.length;for(P||(P=Array(se));++U<se;)P[U]=C[U];return P}var Js=fu;function ps(C,P){return xi(C,Cl(C),P)}var du=ps,ru=Kf(Object.getPrototypeOf,Object),uu=ru,za=Object.getOwnPropertySymbols,Mu=za?function(C){for(var P=[];C;)ho(P,Cl(C)),C=uu(C);return P}:ko,Ca=Mu;function mu(C,P){return xi(C,Ca(C),P)}var ss=mu;function go(C){return Wi(C,Wt,Ca)}var ya=go,Qo=Object.prototype,Qs=Qo.hasOwnProperty;function Cp(C){var P=C.length,U=new C.constructor(P);return P&&typeof C[0]=="string"&&Qs.call(C,"index")&&(U.index=C.index,U.input=C.input),U}var Ft=Cp;function Xr(C){var P=new C.constructor(C.byteLength);return new te(P).set(new te(C)),P}var Mr=Xr;function Bi(C,P){var U=P?Mr(C.buffer):C.buffer;return new C.constructor(U,C.byteOffset,C.byteLength)}var Ma=Bi,el=/\w*$/;function st(C){var P=new C.constructor(C.source,el.exec(C));return P.lastIndex=C.lastIndex,P}var Et=st,Vt=Jn?Jn.prototype:void 0,Br=Vt?Vt.valueOf:void 0;function Ir(C){return Br?Object(Br.call(C)):{}}var Jt=Ir;function sr(C,P){var U=P?Mr(C.buffer):C.buffer;return new C.constructor(U,C.byteOffset,C.length)}var lr=sr,Mt="[object Boolean]",Xt="[object Date]",pt="[object Map]",$t="[object Number]",zr="[object RegExp]",$r="[object Set]",Tn="[object String]",vn="[object Symbol]",_n="[object ArrayBuffer]",Qn="[object DataView]",Fi="[object Float32Array]",Vr="[object Float64Array]",po="[object Int8Array]",la="[object Int16Array]",Ns="[object Int32Array]",Fl="[object Uint8Array]",ic="[object Uint8ClampedArray]",ed="[object Uint16Array]",Ch="[object Uint32Array]";function Sd(C,P,U){var se=C.constructor;switch(P){case _n:return Mr(C);case Mt:case Xt:return new se(+C);case Qn:return Ma(C,U);case Fi:case Vr:case po:case la:case Ns:case Fl:case ic:case ed:case Ch:return lr(C,U);case pt:return new se;case $t:case Tn:return new se(C);case zr:return Et(C);case $r:return new se;case vn:return Jt(C)}}var Up=Sd,td=Object.create,dd=function(){function C(){}return function(P){if(!Sa(P))return{};if(td)return td(P);C.prototype=P;var U=new C;return C.prototype=void 0,U}}(),Zp=dd;function wf(C){return typeof C.constructor=="function"&&!Dc(C)?Zp(uu(C)):{}}var Td=wf,Sf="[object Map]";function sm(C){return Cr(C)&&Qf(C)==Sf}var Ud=sm,Ad=Fp&&Fp.isMap,Bu=Ad?wp(Ad):Ud,nu=Bu,lm="[object Set]";function Cd(C){return Cr(C)&&Qf(C)==lm}var rd=Cd,bm=Fp&&Fp.isSet,Nr=bm?wp(bm):rd,um=Nr,Tf=1,Mp=2,Bm=4,Kr="[object Arguments]",cm="[object Array]",Af="[object Boolean]",hm="[object Date]",Em="[object Error]",wm="[object Function]",Md="[object GeneratorFunction]",cf="[object Map]",nd="[object Number]",Sm="[object Object]",qm="[object RegExp]",mc="[object Set]",mh="[object String]",Zd="[object Symbol]",i="[object WeakMap]",l="[object ArrayBuffer]",_="[object DataView]",S="[object Float32Array]",F="[object Float64Array]",j="[object Int8Array]",p="[object Int16Array]",v="[object Int32Array]",m="[object Uint8Array]",w="[object Uint8ClampedArray]",D="[object Uint16Array]",N="[object Uint32Array]",W={};W[Kr]=W[cm]=W[l]=W[_]=W[Af]=W[hm]=W[S]=W[F]=W[j]=W[p]=W[v]=W[cf]=W[nd]=W[Sm]=W[qm]=W[mc]=W[mh]=W[Zd]=W[m]=W[w]=W[D]=W[N]=!0,W[Em]=W[wm]=W[i]=!1;function $(C,P,U,se,Fe,rt){var yt,dt=P&Tf,zt=P&Mp,ur=P&Bm;if(U&&(yt=Fe?U(C,se,Fe,rt):U(C)),yt!==void 0)return yt;if(!Sa(C))return C;var on=(0,dn.Z)(C);if(on){if(yt=Ft(C),!dt)return Js(C,yt)}else{var pi=Qf(C),Hi=pi==wm||pi==Md;if(Vu(C))return as(C,dt);if(pi==Sm||pi==Kr||Hi&&!Fe){if(yt=zt||Hi?{}:Td(C),!dt)return zt?ss(C,Ei(yt,C)):du(C,Oi(yt,C))}else{if(!W[pi])return Fe?C:{};yt=Up(C,pi,dt)}}rt||(rt=new z);var so=rt.get(C);if(so)return so;rt.set(C,yt),um(C)?C.forEach(function(ii){yt.add($(ii,P,U,ii,C,rt))}):nu(C)&&C.forEach(function(ii,_o){yt.set(_o,$(ii,P,U,_o,C,rt))});var uo=ur?zt?ya:Zh:zt?Wt:sf,ei=on?void 0:uo(C);return Hn(ei||C,function(ii,_o){ei&&(_o=ii,ii=C[_o]),_i(yt,_o,$(ii,P,U,_o,C,rt))}),yt}var ie=$,pe=1,we=4;function ke(C){return ie(C,pe|we)}var Ge=ke;function ht(C){"@babel/helpers - typeof";return ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},ht(C)}var mt=["onCreated","source"],St=["data"],xt=["data"];function bt(C,P){var U=Object.keys(C);if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(C);P&&(se=se.filter(function(Fe){return Object.getOwnPropertyDescriptor(C,Fe).enumerable})),U.push.apply(U,se)}return U}function kt(C){for(var P=1;P<arguments.length;P++){var U=arguments[P]!=null?arguments[P]:{};P%2?bt(Object(U),!0).forEach(function(se){ft(C,se,U[se])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(U)):bt(Object(U)).forEach(function(se){Object.defineProperty(C,se,Object.getOwnPropertyDescriptor(U,se))})}return C}function ft(C,P,U){return P=nr(P),P in C?Object.defineProperty(C,P,{value:U,enumerable:!0,configurable:!0,writable:!0}):C[P]=U,C}function nr(C){var P=br(C,"string");return ht(P)=="symbol"?P:String(P)}function br(C,P){if(ht(C)!="object"||!C)return C;var U=C[Symbol.toPrimitive];if(U!==void 0){var se=U.call(C,P||"default");if(ht(se)!="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(C)}function Pr(C,P){if(C==null)return{};var U=Mn(C,P),se,Fe;if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(C);for(Fe=0;Fe<rt.length;Fe++)se=rt[Fe],!(P.indexOf(se)>=0)&&Object.prototype.propertyIsEnumerable.call(C,se)&&(U[se]=C[se])}return U}function Mn(C,P){if(C==null)return{};var U={},se=Object.keys(C),Fe,rt;for(rt=0;rt<se.length;rt++)Fe=se[rt],!(P.indexOf(Fe)>=0)&&(U[Fe]=C[Fe]);return U}var yn=function(P,U){var se=U.onCreated,Fe=U.source,rt=Pr(U,mt),yt=Bf(),dt=(0,Ze.useRef)(),zt=(0,Ze.useRef)(rt),ur=(0,Ze.useRef)(Fe);return dt.current||(dt.current=new P(U),se&&dt.current.once("inited",function(){return se(dt.current)}),yt.addLayer(dt.current)),(0,Is.Z)(function(){if(dt.current){var on=!Bn(zt.current,rt);on&&(dt.current.update(rt),zt.current=Ge(rt))}},[rt]),(0,Is.Z)(function(){if(dt.current){var on=Fe.data,pi=Pr(Fe,St),Hi=ur.current,so=Hi.data,uo=Pr(Hi,xt),ei=on!==so||!Bn(pi,uo);ei&&(dt.current.changeData(Fe),ur.current=kt({},Fe))}},[Fe]),(0,Ze.useEffect)(function(){return function(){dt.current&&(yt.removeLayer(dt.current),dt.current=null)}},[]),dt},kr={onRemove:"remove",onShow:"show",onHide:"hide",onDataUpdate:"dataUpdate",onLegend:"legend",onLegendColor:"legend:color",onLegendSize:"legend:size",onClick:"click",onUnClick:"unclick",onDblClick:"dblclick",onUndblclick:"undblclick",onContextMenu:"contextmenu",onUnContextMenu:"uncontextmenu",onMouseEnter:"mouseenter",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseUp:"mouseup",onMouseDown:"mousedown",onUnMousemove:"unmousemove",onUnMouseup:"unmouseup",onUnMousedown:"unmousedown",onUnPick:"unpick"},Ai=function(P,U){var se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:kr,Fe=(0,Ze.useMemo)(function(){return Object.keys(se)},[se]),rt=function(on){Fe.forEach(function(pi){var Hi=se[pi],so=U[pi];pi&&so&&P[on](Hi,so)})},yt=function(){return rt("on")},dt=function(){return rt("off")},zt=(0,Ze.useRef)(!0);zt.current&&yt(),(0,Ze.useEffect)(function(){return zt.current?zt.current=!1:yt(),function(){dt()}},Fe.map(function(ur){return U[ur]})),(0,Oh.Z)(function(){dt()})},$n=null,ti=null,ri=null,hn=Se(13206),An=Se(13526);function Yi(C,P){return function(){for(var U=[],se=0;se<arguments.length;se++)U[se]=arguments[se];var Fe={};return C.forEach(function(rt,yt){Fe[rt]=U[yt]}),delete Fe.undefined,P(Fe)}}var Ci=function(){function C(){}return C.shape=function(P,U){if((0,An.isString)(U))P.shape(U);else if((0,An.isFunction)(U)){var se=[];P.shape(se.join("*"),Yi(se,U))}else if((0,An.isObject)(U)){var Fe=U.field?U.field:"";if((0,An.isFunction)(U.value)){var se=(0,An.isArray)(Fe)?Fe:Fe.split("*");P.shape(Fe,Yi(se,U.value))}else P.shape(Fe,U.value);(0,An.isString)(Fe)&&U.scale&&C.scale(P,Fe,U.scale)}},C.size=function(P,U){if((0,An.isNumber)(U))P.size(U);else if((0,An.isArray)(U))P.size(U);else if((0,An.isFunction)(U)){var se=[];P.size(se.join("*"),Yi(se,U))}else if((0,An.isObject)(U)){var Fe=U.field?U.field:"";if((0,An.isFunction)(U.value)){var se=(0,An.isArray)(Fe)?Fe:Fe.split("*");P.size(Fe,Yi(se,U.value))}else P.size(Fe,U.value);(0,An.isString)(Fe)&&U.scale&&C.scale(P,Fe,U.scale)}},C.color=function(P,U){if((0,An.isString)(U))P.color(U);else if((0,An.isFunction)(U)){var se=[];P.color(se.join("*"),Yi(se,U))}else if((0,An.isObject)(U)){var Fe=U.field?U.field:"";if((0,An.isFunction)(U.value)){var se=(0,An.isArray)(Fe)?Fe:Fe.split("*");P.color(Fe,Yi(se,U.value))}else P.color(Fe,U.value);(0,An.isString)(Fe)&&U.scale&&C.scale(P,Fe,U.scale)}},C.scale=function(P,U,se){P.scale(U,se)},C.rotate=function(P,U){(0,An.isString)(U)||(0,An.isFunction)(U)||(0,An.isObject)(U)},C.texture=function(P,U){(0,An.isString)(U)&&P.texture(U)},C.animate=function(P,U){((0,An.isBoolean)(U)||(0,An.isObject)(U))&&P.animate(U)},C.filter=function(P,U){var se=U.field?U.field:"",Fe=(0,An.isArray)(se)?se:se.split("*");P.filter(Fe.join("*"),Yi(Fe,U.value))},C.style=function(P,U){U&&P.style(U)},C.state=function(P,U){var se=U.active,Fe=U.select;se&&P.active(se),Fe&&P.select(Fe)},C}();function fo(C,P,U,se){U===void 0&&(U=0),se===void 0&&(se=5);for(var Fe in P)if(Object.prototype.hasOwnProperty.call(P,Fe)){var rt=P[Fe];rt!==null&&(0,An.isPlainObject)(rt)?((0,An.isPlainObject)(C[Fe])||(C[Fe]={}),U<se?fo(C[Fe],rt,U+1,se):C[Fe]=P[Fe]):Array.isArray(rt)?(C[Fe]=[],C[Fe]=C[Fe].concat(rt)):rt!==void 0&&(C[Fe]=rt)}}var Go=function(C){for(var P=[],U=1;U<arguments.length;U++)P[U-1]=arguments[U];for(var se=0;se<P.length;se+=1)fo(C,P[se],0,1);return C},hi=function(C,P){var U=C.source,se=(0,hn._T)(C,["source"]),Fe=P.source,rt=(0,hn._T)(P,["source"]),yt=Go({},se,rt);return Fe instanceof ve.Source?yt.source=Fe:U instanceof ve.Source?yt.source=U:yt.source=(0,hn.pi)((0,hn.pi)({},U),Fe),yt},zi=function(C,P){if(C instanceof ve.Source&&P instanceof ve.Source)return C!==P;var U=C.data,se=(0,hn._T)(C,["data"]),Fe=P.data,rt=(0,hn._T)(P,["data"]),yt=U!==Fe||!(0,An.isEqual)(se,rt);return yt},Vo=["click","dblclick","unclick","undblclick","contextmenu","uncontextmenu","mouseenter","unmouseenter","mousemove","unmousemove","mouseout","mouseup","unmouseup","mousedown","unpick"],Ka=(0,hn.ev)(["show","hide","dataUpdate","destroy","legend","legend:color","legend:size"],(0,hn.CR)(Vo),!1),ta;(function(C){C.CREATED="created",C.INITED="inited",C.ADD="add",C.REMOVE="remove"})(ta||(ta={}));var ka;(function(C){C.CREATED="created",C.INITED="inited",C.ADD="add",C.REMOVE="remove"})(ka||(ka={}));var ca;(function(C){C.INITED_LAYER="inited-layer",C.INITED_LAYERS="inited-layers"})(ca||(ca={}));var Eo=function(C){(0,hn.ZT)(P,C);function P(U){var se=C.call(this)||this;se.isComposite=!1;var Fe=U.id,rt=U.name,yt=U.source,dt=U.interaction,zt=dt===void 0?!1:dt;return se.id=Fe||(0,An.uniqueId)("core-layer"),se.name=rt||se.id,se.interaction=zt,se.options=hi(se.getDefaultOptions(),U),se.lastOptions=se.options,se.layer=se.createLayer(),se.adaptorLayerAttr(!1),se.setSource(yt),se.emit(ta.CREATED,se),se}return Object.defineProperty(P.prototype,"inited",{get:function(){return this.layer.inited},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"source",{get:function(){return this.layer.getSource()},enumerable:!1,configurable:!0}),P.prototype.getDefaultOptions=function(){return P.DefaultOptions},P.prototype.getLayerConfig=function(){var U=(0,An.omit)(this.options,["source","shape","color","size","scale","texture","style","animate","state"]);return U},P.prototype.adaptorAttrOptions=function(U){return U},P.prototype.adaptorLayerAttr=function(U){U===void 0&&(U=!0);for(var se=["shape","color","size","scale","texture","filter","style","animate","state"],Fe=this.adaptorAttrOptions(this.options),rt=this.adaptorAttrOptions(this.lastOptions),yt=0;yt<se.length;yt++){var dt=se[yt],zt=Fe[dt],ur=rt[dt];!(0,An.isUndefined)(zt)&&(!U||!(0,An.isEqual)(zt,ur))&&Ci[dt](this.layer,zt)}},P.prototype.setSource=function(U){if(U instanceof ve.Source)this.layer.setSource(U);else{var se=U.data,Fe=(0,hn._T)(U,["data"]),rt=this.layer.getSource();rt?this.layer.setData(se,Fe):this.layer.source(se,Fe)}},P.prototype.getSource=function(){return this.source},P.prototype.addTo=function(U){var se=this;this.scene=U,this.layer.once(ta.INITED,function(){se.emit(ta.INITED,se)}),this.layer.once(ta.ADD,function(){se.emit(ta.ADD,se)}),U.addLayer(this.layer)},P.prototype.remove=function(){this.scene&&(this.scene.removeLayer(this.layer),this.emit(ta.REMOVE))},P.prototype.update=function(U,se){var Fe,rt;se===void 0&&(se=!0),this.updateOption(U),this.updateConfig(U),se&&((Fe=this.scene)===null||Fe===void 0||Fe.setEnableRender(!1)),((0,An.isUndefined)(this.options.visible)||this.options.visible)&&this.adaptorLayerAttr(),U.source&&zi(U.source,this.lastOptions.source)&&this.changeData(U.source),se&&((rt=this.scene)===null||rt===void 0||rt.setEnableRender(!0),this.render())},P.prototype.updateOption=function(U){this.lastOptions=this.options,this.options=hi(this.options,U)},P.prototype.updateConfig=function(U){!(0,An.isUndefined)(U.zIndex)&&!(0,An.isEqual)(this.lastOptions.zIndex,this.options.zIndex)&&this.setIndex(U.zIndex),!(0,An.isUndefined)(U.blend)&&!(0,An.isEqual)(this.lastOptions.blend,this.options.blend)&&this.setBlend(U.blend),!(0,An.isUndefined)(U.minZoom)&&!(0,An.isEqual)(this.lastOptions.minZoom,this.options.minZoom)&&this.setMinZoom(U.minZoom),!(0,An.isUndefined)(U.maxZoom)&&!(0,An.isEqual)(this.lastOptions.maxZoom,this.options.maxZoom)&&this.setMaxZoom(U.maxZoom),!(0,An.isUndefined)(U.visible)&&!(0,An.isEqual)(this.lastOptions.visible,this.options.visible)&&(U.visible?this.show():this.hide())},P.prototype.render=function(){this.scene&&this.scene.render()},P.prototype.changeData=function(U){this.setSource(U)},P.prototype.setIndex=function(U){this.layer.setIndex(U)},P.prototype.setBlend=function(U){this.layer.setBlend(U)},P.prototype.setMinZoom=function(U){this.layer.setMinZoom(U)},P.prototype.setMaxZoom=function(U){this.layer.setMaxZoom(U)},P.prototype.show=function(){this.layer.inited&&this.layer.show()},P.prototype.hide=function(){this.layer.inited&&this.layer.hide()},P.prototype.toggleVisible=function(){this.isVisible()?this.hide():this.show()},P.prototype.isVisible=function(){return this.layer.inited?this.layer.isVisible():(0,An.isUndefined)(this.options.visible)?!0:this.options.visible},P.prototype.boxSelect=function(U,se){this.layer.boxSelect(U,se)},P.prototype.fitBounds=function(U){this.layer.fitBounds(U)},P.prototype.getLegend=function(U){return this.layer.getLegend(U)},P.prototype.getLegendItems=function(U){return this.layer.getLegendItems(U)},P.prototype.on=function(U,se,Fe){return Ka.indexOf(U)!==-1?this.layer.on(U,se):C.prototype.on.call(this,U,se,Fe),this},P.prototype.once=function(U,se){return Ka.indexOf(U)!==-1?this.layer.once(U,se):C.prototype.once.call(this,U,se),this},P.prototype.off=function(U,se){return Ka.indexOf(U)!==-1?this.layer.off(U,se):C.prototype.off.call(this,U,se),this},P.prototype.destroy=function(){this.layer.destroy()},P.DefaultOptions={},P}(Uo.Z),Pa=function(C){(0,hn.ZT)(P,C);function P(){var U=C.apply(this,(0,hn.ev)([],(0,hn.CR)(arguments),!1))||this;return U.type="pointLayer",U}return P.prototype.createLayer=function(){var U=this.getLayerConfig(),se=new ve.PointLayer(U);return se},P}(Eo),na=(0,Ze.memo)((0,Ze.forwardRef)(function(P,U){var se=yn(Pa,P);return Ai(se.current,P),(0,Ze.useImperativeHandle)(U,function(){return se.current}),null})),ha=null,Xs=null,Ls=null,Ea=Object.assign(kr,{onSelect:"select",onUnselect:"unselect"}),ws=null,qs=Object.assign(kr,{onSelect:"select",onUnselect:"unselect"}),ua=null,cu={onRemove:kr.onRemove,onShow:kr.onShow,onHide:kr.onHide,onDataUpdate:kr.onDataUpdate,onLegend:kr.onLegend,onLegendColor:kr.onLegendColor,onLegendSize:kr.onLegendSize,onCircleLayerClick:"circleLayer:"+kr.onClick,onCircleLayerUnClick:"circleLayer:"+kr.onUnClick,onCircleLayerDblClick:"circleLayer:"+kr.onDblClick,onCircleLayerUndblclick:"circleLayer:"+kr.onUndblclick,onCircleLayerContextMenu:"circleLayer:"+kr.onContextMenu,onCircleLayerUnContextMenu:"circleLayer:"+kr.onUnContextMenu,onCircleLayerMouseEnter:"circleLayer:"+kr.onMouseEnter,onCircleLayerMouseMove:"circleLayer:"+kr.onMouseMove,onCircleLayerMouseOut:"circleLayer:"+kr.onMouseOut,onCircleLayerMouseUp:"circleLayer:"+kr.onMouseUp,onCircleLayerMouseDown:"circleLayer:"+kr.onMouseDown,onCircleLayerUnMousemove:"circleLayer:"+kr.onUnMousemove,onCircleLayerUnMouseup:"circleLayer:"+kr.onUnMouseup,onCircleLayerUnMousedown:"circleLayer:"+kr.onUnMousedown,onCircleLayerUnPick:"circleLayer:"+kr.onUnPick,onLineLayerClick:"lineLayer:"+kr.onClick,onLineLayerUnClick:"lineLayer:"+kr.onUnClick,onLineLayerDblClick:"lineLayer:"+kr.onDblClick,onLineLayerUndblclick:"lineLayer:"+kr.onUndblclick,onLineLayerContextMenu:"lineLayer:"+kr.onContextMenu,onLineLayerUnContextMenu:"lineLayer:"+kr.onUnContextMenu,onLineLayerMouseEnter:"lineLayer:"+kr.onMouseEnter,onLineLayerMouseMove:"lineLayer:"+kr.onMouseMove,onLineLayerMouseOut:"lineLayer:"+kr.onMouseOut,onLineLayerMouseUp:"lineLayer:"+kr.onMouseUp,onLineLayerMouseDown:"lineLayer:"+kr.onMouseDown,onLineLayerUnMousemove:"lineLayer:"+kr.onUnMousemove,onLineLayerUnMouseup:"lineLayer:"+kr.onUnMouseup,onLineLayerUnMousedown:"lineLayer:"+kr.onUnMousedown,onLineLayerUnPick:"lineLayer:"+kr.onUnPick},c=null,o=null,f=null,E=Se(19103),L=function(P){var U=P.className,se=P.style,Fe=P.children,rt=P.position,yt=P.name,dt=(0,Ze.useRef)(document.createElement("div")),zt=bs(se),ur=(0,Ze.useCallback)(function(){return dt.current},[]),on=(0,Ze.useMemo)(function(){return{position:rt,name:yt,className:U,style:zt}},[rt,yt,U,zt]);return ec(ur,void 0,on),(0,E.createPortal)(Fe,dt.current)};L.defaultProps={position:"topleft"};function V(C){return me(C)||oe(C)||J(C)||X()}function X(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J(C,P){if(C){if(typeof C=="string")return Me(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return Me(C,P)}}function oe(C){if(typeof Symbol!="undefined"&&C[Symbol.iterator]!=null||C["@@iterator"]!=null)return Array.from(C)}function me(C){if(Array.isArray(C))return Me(C)}function Me(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}var De=function(P,U){var se=useMemo(function(){return Object.keys(U)},[U]);useEffect(function(){return P&&se.forEach(function(Fe){var rt=U[Fe];rt&&P.on(Fe,rt)}),function(){P&&se.forEach(function(Fe){var rt=U[Fe];rt&&P.off(Fe,rt)})}},[P].concat(V(Object.values(U)))),useUnmount(function(){P&&se.forEach(function(Fe){var rt=U[Fe];rt&&P.off(Fe,rt)})})},Ye=function(P,U){var se=useRef(!0),Fe=useMemo(function(){return Object.keys(U)},[U]);useTrackedEffect(function(rt){if(se.current){se.current=!1;return}var yt={};rt.forEach(function(dt){var zt=Fe[dt];yt[zt]=U[zt]}),P==null||P.setOptions(yt)},Object.values(U))},ot=function(P){var U=useRef(document.createElement("span"));return{portal:P?createPortal(P,U.current):null,dom:P?U.current:void 0}};function lt(C,P){return cr(C)||Er(C,P)||Gt(C,P)||Ct()}function Ct(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gt(C,P){if(C){if(typeof C=="string")return Kt(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return Kt(C,P)}}function Kt(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function Er(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function cr(C){if(Array.isArray(C))return C}var Rr=function(P){var U=P.onExport,se=P.onShow,Fe=P.onHide,rt=P.onAdd,yt=P.onRemove,dt=P.imageType,zt=P.btnIcon,ur=P.btnText,on=P.title,pi=P.vertical,Hi=P.position,so=P.className,uo=P.style,ei=useScene(),ii=useState(),_o=lt(ii,2),Li=_o[0],yo=_o[1],Ta=useMemo(function(){return getStyleText(uo)},[uo]),Ha=useL7ComponentPortal(zt),Ua=Ha.portal,ma=Ha.dom,Zs=useMemo(function(){return{btnText:ur,title:on,vertical:pi,position:Hi,className:so,imageType:dt,style:Ta,btnIcon:ma,onExport:U}},[ur,on,pi,Hi,so,Ta,dt,U,ma]);return useEffect(function(){var Ts=new L7ExportImage(omitBy(Zs,function(aa){return aa===void 0}));return yo(Ts),ei.addControl(Ts),function(){ei.removeControl(Ts),yo(void 0)}},[]),useL7ComponentUpdate(Li,Zs),useL7ComponentEvent(Li,{add:rt,remove:yt,show:se,hide:Fe}),React.createElement(React.Fragment,null,Ua)};function Qr(C,P){return Zi(C)||$i(C,P)||Ki(C,P)||Fn()}function Fn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ki(C,P){if(C){if(typeof C=="string")return Co(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return Co(C,P)}}function Co(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function $i(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function Zi(C){if(Array.isArray(C))return C}var Ri=function(P){var U=P.onShow,se=P.onHide,Fe=P.onAdd,rt=P.onRemove,yt=P.onFullscreenChange,dt=P.btnIcon,zt=P.btnText,ur=P.title,on=P.vertical,pi=P.exitBtnIcon,Hi=P.exitBtnText,so=P.exitTitle,uo=P.position,ei=P.className,ii=P.style,_o=useScene(),Li=useState(),yo=Qr(Li,2),Ta=yo[0],Ha=yo[1],Ua=useMemo(function(){return getStyleText(ii)},[ii]),ma=useL7ComponentPortal(dt),Zs=ma.portal,Ts=ma.dom,aa=useL7ComponentPortal(pi),La=aa.portal,hl=aa.dom,As=useMemo(function(){return{btnText:zt,title:ur,vertical:on,exitBtnText:Hi,exitTitle:so,position:uo,className:ei,style:Ua,btnIcon:Ts,exitBtnIcon:hl}},[zt,ur,on,Hi,so,uo,ei,Ua,Ts,hl]);return useEffect(function(){var zs=new L7Fullscreen(omitBy(As,function($s){return $s===void 0}));return Ha(zs),_o.addControl(zs),function(){_o.removeControl(zs),Ha(void 0)}},[]),useL7ComponentUpdate(Ta,As),useL7ComponentEvent(Ta,{add:Fe,remove:rt,show:U,hide:se,fullscreenChange:yt}),React.createElement(React.Fragment,null,Zs,La)};function vo(C,P){return rs(C)||Do(C,P)||ni(C,P)||Ii()}function Ii(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ni(C,P){if(C){if(typeof C=="string")return jo(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return jo(C,P)}}function jo(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function Do(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function rs(C){if(Array.isArray(C))return C}var iu=function(P){var U=P.transform,se=P.onShow,Fe=P.onHide,rt=P.onAdd,yt=P.onRemove,dt=P.btnIcon,zt=P.btnText,ur=P.title,on=P.vertical,pi=P.position,Hi=P.className,so=P.style,uo=useScene(),ei=useState(),ii=vo(ei,2),_o=ii[0],Li=ii[1],yo=useMemo(function(){return getStyleText(so)},[so]),Ta=useL7ComponentPortal(dt),Ha=Ta.portal,Ua=Ta.dom,ma=useMemo(function(){return{btnText:zt,title:ur,vertical:on,position:pi,className:Hi,style:yo,transform:U,btnIcon:Ua}},[zt,ur,on,pi,Hi,yo,U,Ua]);return useEffect(function(){var Zs=new L7GeoLocate(omitBy(ma,function(Ts){return Ts===void 0}));return Li(Zs),uo.addControl(Zs),function(){uo.removeControl(Zs),Li(void 0)}},[]),useL7ComponentUpdate(_o,ma),useL7ComponentEvent(_o,{add:rt,remove:yt,show:se,hide:Fe}),React.createElement(React.Fragment,null,Ha)};function tl(C){"@babel/helpers - typeof";return tl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},tl(C)}function gc(C,P){var U=Object.keys(C);if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(C);P&&(se=se.filter(function(Fe){return Object.getOwnPropertyDescriptor(C,Fe).enumerable})),U.push.apply(U,se)}return U}function Pp(C){for(var P=1;P<arguments.length;P++){var U=arguments[P]!=null?arguments[P]:{};P%2?gc(Object(U),!0).forEach(function(se){sp(C,se,U[se])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(U)):gc(Object(U)).forEach(function(se){Object.defineProperty(C,se,Object.getOwnPropertyDescriptor(U,se))})}return C}function sp(C,P,U){return P=kc(P),P in C?Object.defineProperty(C,P,{value:U,enumerable:!0,configurable:!0,writable:!0}):C[P]=U,C}function kc(C){var P=gh(C,"string");return tl(P)=="symbol"?P:String(P)}function gh(C,P){if(tl(C)!="object"||!C)return C;var U=C[Symbol.toPrimitive];if(U!==void 0){var se=U.call(C,P||"default");if(tl(se)!="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(C)}function lp(C,P){return vc(C)||_h(C,P)||Ys(C,P)||vh()}function vh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ys(C,P){if(C){if(typeof C=="string")return jl(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return jl(C,P)}}function jl(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function _h(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function vc(C){if(Array.isArray(C))return C}var xp=function(P){var U=P.layers,se=P.popperPlacement,Fe=P.popperTrigger,rt=P.popperClassName,yt=P.btnIcon,dt=P.btnText,zt=P.title,ur=P.vertical,on=P.position,pi=P.className,Hi=P.style,so=P.multiple,uo=P.onAdd,ei=P.onRemove,ii=P.onShow,_o=P.onHide,Li=P.onPopperShow,yo=P.onPopperHide,Ta=P.onSelectChange,Ha=useScene(),Ua=useLayerList(),ma=useState(),Zs=lp(ma,2),Ts=Zs[0],aa=Zs[1],La=useMemo(function(){return getStyleText(Hi)},[Hi]),hl=useL7ComponentPortal(yt),As=hl.portal,zs=hl.dom,$s=useMemo(function(){return U!=null&&U.length?U.map(function(It){if(typeof It=="string")return Ua.find(function(gn){return gn.id===It});if(!Object.prototype.hasOwnProperty.call(It,"isComposite")){var Qt=It,tn=Qt.layer;if(typeof tn=="string"){var Cn=Ua.find(function(gn){return gn.id===tn});return Cn?Pp(Pp({},It),{},{layer:Cn}):void 0}return It}return It}).filter(function(It){return!!It}):Ua},[U,Ua]),hr=useMemo(function(){return{layers:$s,popperPlacement:se,popperTrigger:Fe,popperClassName:rt,btnText:dt,title:zt,vertical:ur,position:on,className:pi,multiple:so,style:La,btnIcon:zs}},[$s,se,Fe,rt,dt,zt,ur,on,pi,so,La,zs]);return useEffect(function(){var It=new L7LayerSwitch(omitBy(hr,function(Qt){return Qt===void 0}));return aa(It),Ha.addControl(It),function(){Ha.removeControl(It),aa(void 0)}},[]),useL7ComponentUpdate(Ts,hr),useL7ComponentEvent(Ts,{add:uo,remove:ei,show:ii,hide:_o,popperShow:Li,popperHide:yo,selectChange:Ta}),React.createElement(React.Fragment,null,As)};function up(C,P){return Ph(C)||Ss(C,P)||_c(C,P)||Mh()}function Mh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _c(C,P){if(C){if(typeof C=="string")return oc(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return oc(C,P)}}function oc(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function Ss(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function Ph(C){if(Array.isArray(C))return C}var Rh=function(P){var U=P.popperPlacement,se=P.btnText,Fe=P.title,rt=P.vertical,yt=P.position,dt=P.className,zt=P.options,ur=P.popperTrigger,on=P.popperClassName,pi=P.btnIcon,Hi=P.style,so=P.onAdd,uo=P.onRemove,ei=P.onShow,ii=P.onHide,_o=P.onPopperShow,Li=P.onPopperHide,yo=P.onSelectChange,Ta=useScene(),Ha=useState(),Ua=up(Ha,2),ma=Ua[0],Zs=Ua[1],Ts=useMemo(function(){return getStyleText(Hi)},[Hi]),aa=useL7ComponentPortal(pi),La=aa.portal,hl=aa.dom,As=useMemo(function(){return{popperPlacement:U,popperTrigger:ur,popperClassName:on,btnText:se,title:Fe,vertical:rt,position:yt,className:dt,options:zt,style:Ts,btnIcon:hl}},[zt,U,ur,on,se,Fe,rt,yt,dt,Ts,hl]);return useEffect(function(){var zs=new L7MapTheme(omitBy(As,function($s){return $s===void 0}));return Zs(zs),Ta.addControl(zs),function(){Ta.removeControl(zs),Zs(void 0)}},[]),useL7ComponentUpdate(ma,As),useL7ComponentEvent(ma,{add:so,remove:uo,show:ei,hide:ii,popperShow:_o,popperHide:Li,selectChange:yo}),React.createElement(React.Fragment,null,La)};function Nc(C,P){return Pf(C)||md(C,P)||Vp(C,P)||Cf()}function Cf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vp(C,P){if(C){if(typeof C=="string")return Mf(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return Mf(C,P)}}function Mf(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function md(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function Pf(C){if(Array.isArray(C))return C}var Rf=function(P){var U=P.position,se=P.className,Fe=P.style,rt=P.onLocationChange,yt=P.transform,dt=P.onAdd,zt=P.onRemove,ur=P.onShow,on=P.onHide,pi=useScene(),Hi=useState(),so=Nc(Hi,2),uo=so[0],ei=so[1],ii=useMemo(function(){return getStyleText(Fe)},[Fe]),_o=useMemo(function(){return{transform:yt,position:U,className:se,style:ii}},[yt,U,se,ii]);return useEffect(function(){var Li=new L7MouseLocation(omitBy(_o,function(yo){return yo===void 0}));return ei(Li),pi.addControl(Li),function(){pi.removeControl(Li),ei(void 0)}},[]),useL7ComponentUpdate(uo,_o),useL7ComponentEvent(uo,{add:dt,remove:zt,show:ur,hide:on,locationChange:rt}),null};function Rp(C,P){return og(C)||Vf(C,P)||Vd(C,P)||$c()}function $c(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vd(C,P){if(C){if(typeof C=="string")return Ym(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return Ym(C,P)}}function Ym(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function Vf(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function og(C){if(Array.isArray(C))return C}var Pd=function(P){var U=P.onShow,se=P.onHide,Fe=P.onAdd,rt=P.onRemove,yt=P.position,dt=P.className,zt=P.style,ur=P.lockWidth,on=P.maxWidth,pi=P.metric,Hi=P.imperial,so=P.updateWhenIdle,uo=useScene(),ei=useState(),ii=Rp(ei,2),_o=ii[0],Li=ii[1],yo=useMemo(function(){return getStyleText(zt)},[zt]),Ta=useMemo(function(){return{position:yt,className:dt,style:yo,lockWidth:ur,maxWidth:on,metric:pi,imperial:Hi,updateWhenIdle:so}},[yt,dt,yo,ur,on,pi,Hi,so]);return useEffect(function(){var Ha=new L7Scale(omitBy(Ta,function(Ua){return Ua===void 0}));return Li(Ha),uo.addControl(Ha),function(){uo.removeControl(Ha),Li(void 0)}},[]),useL7ComponentUpdate(_o,Ta),useL7ComponentEvent(_o,{add:Fe,remove:rt,show:U,hide:se}),null};function jd(C,P){return Cg(C)||Am(C,P)||Tm(C,P)||pm()}function pm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tm(C,P){if(C){if(typeof C=="string")return fm(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return fm(C,P)}}function fm(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function Am(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function Cg(C){if(Array.isArray(C))return C}var Vg=function(P){var U=P.onShow,se=P.onHide,Fe=P.onAdd,rt=P.onRemove,yt=P.position,dt=P.name,zt=P.className,ur=P.style,on=P.zoomInText,pi=P.zoomOutText,Hi=P.zoomInTitle,so=P.zoomOutTitle,uo=P.showZoom,ei=useScene(),ii=useState(),_o=jd(ii,2),Li=_o[0],yo=_o[1],Ta=useMemo(function(){return getStyleText(ur)},[ur]),Ha=useL7ComponentPortal(on),Ua=Ha.portal,ma=Ha.dom,Zs=useL7ComponentPortal(pi),Ts=Zs.portal,aa=Zs.dom,La=useMemo(function(){return{position:yt,name:dt,className:zt,zoomInTitle:Hi,zoomOutTitle:so,showZoom:uo,style:Ta,zoomInText:ma,zoomOutText:aa}},[yt,dt,zt,Ta,Hi,so,ma,aa,uo]);return useEffect(function(){var hl=new L7Zoom(omitBy(La,function(As){return As===void 0}));return yo(hl),ei.addControl(hl),function(){ei.removeControl(hl),yo(void 0)}},[]),useL7ComponentUpdate(Li,La),useL7ComponentEvent(Li,{add:Fe,remove:rt,show:U,hide:se}),React.createElement(React.Fragment,null,Ua,Ts)};function Mg(C,P){return dm(C)||cp(C,P)||ag(C,P)||$m()}function $m(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ag(C,P){if(C){if(typeof C=="string")return jp(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return jp(C,P)}}function jp(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function cp(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function dm(C){if(Array.isArray(C))return C}var Vh=function(P){var U=P.img,se=P.href,Fe=P.position,rt=P.className,yt=P.style,dt=P.onShow,zt=P.onHide,ur=P.onAdd,on=P.onRemove,pi=useScene(),Hi=useState(),so=Mg(Hi,2),uo=so[0],ei=so[1],ii=useMemo(function(){return getStyleText(yt)},[yt]),_o=useMemo(function(){return{img:U,href:se,position:Fe,className:rt,style:ii}},[U,se,Fe,rt,ii]);return useEffect(function(){var Li=new L7Logo(omitBy(_o,function(yo){return yo===void 0}));return ei(Li),pi.addControl(Li),function(){pi.removeControl(Li),ei(void 0)}},[]),useL7ComponentUpdate(uo,_o),useL7ComponentEvent(uo,{add:ur,remove:on,show:dt,hide:zt}),null},sg=function(P){var U=P.title,se=P.className,Fe=P.style;return React.createElement("h1",{className:classNames("".concat(CLS_PREFIX,"_decoration"),se),style:Fe},U)};function Cm(C){"@babel/helpers - typeof";return Cm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},Cm(C)}function Ih(C,P){var U=Object.keys(C);if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(C);P&&(se=se.filter(function(Fe){return Object.getOwnPropertyDescriptor(C,Fe).enumerable})),U.push.apply(U,se)}return U}function Hp(C){for(var P=1;P<arguments.length;P++){var U=arguments[P]!=null?arguments[P]:{};P%2?Ih(Object(U),!0).forEach(function(se){Hd(C,se,U[se])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(U)):Ih(Object(U)).forEach(function(se){Object.defineProperty(C,se,Object.getOwnPropertyDescriptor(U,se))})}return C}function Hd(C,P,U){return P=hf(P),P in C?Object.defineProperty(C,P,{value:U,enumerable:!0,configurable:!0,writable:!0}):C[P]=U,C}function hf(C){var P=Gd(C,"string");return Cm(P)=="symbol"?P:String(P)}function Gd(C,P){if(Cm(C)!="object"||!C)return C;var U=C[Symbol.toPrimitive];if(U!==void 0){var se=U.call(C,P||"default");if(Cm(se)!="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(C)}var pf=(0,Ze.memo)(function(P){var U=ys(),se=(0,Ze.useRef)({props:P});se.current.props=P;var Fe=(0,Ze.useMemo)(function(){var rt=!1;Ze.Children.forEach(P.children,function(zt){zt&&(rt=!0)});var yt=Hp(Hp({},P),{},{element:rt?document.createElement("div"):null}),dt=new ve.Marker(yt);return dt.on("click",function(zt){var ur,on;(ur=(on=se.current.props).onClick)===null||ur===void 0||ur.call(on,zt)}),dt},[]);return Le(function(){Fe.setLnglat(P.lngLat)},[P.lngLat]),(0,Ze.useEffect)(function(){return U.addMarker(Fe),function(){Fe.remove()}},[]),(0,E.createPortal)(P.children,Fe.getElement())});function h0(C,P){return f0(C)||p0(C,P)||av(C,P)||lg()}function lg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function av(C,P){if(C){if(typeof C=="string")return jg(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return jg(C,P)}}function jg(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function p0(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function f0(C){if(Array.isArray(C))return C}var sv=function(P){var U=P.style,se=P.closeButton,Fe=P.closeButtonOffsets,rt=P.closeOnClick,yt=P.closeOnEsc,dt=P.maxWidth,zt=P.anchor,ur=P.offsets,on=P.stopPropagation,pi=P.autoPan,Hi=P.autoClose,so=P.followCursor,uo=P.className,ei=P.lngLat,ii=P.children,_o=P.title,Li=P.onOpen,yo=P.onClose,Ta=P.onShow,Ha=P.onHide,Ua=useScene(),ma=useState(),Zs=h0(ma,2),Ts=Zs[0],aa=Zs[1],La=useMemo(function(){return getStyleText(U)},[U]),hl=useL7ComponentPortal(ii),As=hl.portal,zs=hl.dom,$s=useL7ComponentPortal(_o),hr=$s.portal,It=$s.dom,Qt=useMemo(function(){return{style:La,closeButton:se,closeButtonOffsets:Fe,closeOnClick:rt,closeOnEsc:yt,maxWidth:dt,anchor:zt,offsets:ur,stopPropagation:on,autoPan:pi,autoClose:Hi,followCursor:so,className:uo,lngLat:ei,html:zs,title:It}},[La,se,JSON.stringify(Fe),rt,yt,dt,zt,JSON.stringify(ur),on,pi,Hi,so,uo,zs,It,JSON.stringify(ei)]);return useEffect(function(){var tn=new L7Popup(omitBy(Qt,function(Cn){return Cn===void 0}));return aa(tn),Ua.addPopup(tn),function(){Ua.removePopup(tn),aa(void 0)}},[]),useL7ComponentUpdate(Ts,Qt),useL7ComponentEvent(Ts,{open:Li,close:yo,show:Ta,hide:Ha}),React.createElement(React.Fragment,null,As,hr)},lv=function(P,U){if(P instanceof Function){var se=document.createElement(U);return function(){var yt=P.apply(void 0,arguments),dt=ReactDOM.createPortal(yt,se);return ReactDOM.render(dt,se),se}}else{var Fe=document.createElement(U),rt=ReactDOM.createPortal(P,Fe);return ReactDOM.render(rt,Fe),Fe}};function uv(C){return pv(C)||hv(C)||Hg(C)||cv()}function cv(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hv(C){if(typeof Symbol!="undefined"&&C[Symbol.iterator]!=null||C["@@iterator"]!=null)return Array.from(C)}function pv(C){if(Array.isArray(C))return Fm(C)}function Wd(C,P){return d0(C)||Gg(C,P)||Hg(C,P)||ug()}function ug(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hg(C,P){if(C){if(typeof C=="string")return Fm(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return Fm(C,P)}}function Fm(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function Gg(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function d0(C){if(Array.isArray(C))return C}var ax=function(P){var U=P.style,se=P.closeButton,Fe=P.closeButtonOffsets,rt=P.closeOnClick,yt=P.closeOnEsc,dt=P.maxWidth,zt=P.anchor,ur=P.offsets,on=P.stopPropagation,pi=P.autoPan,Hi=P.autoClose,so=P.className,uo=P.lngLat,ei=P.items,ii=P.trigger,_o=P.onOpen,Li=P.onClose,yo=P.onShow,Ta=P.onHide,Ha=useScene(),Ua=useState(),ma=Wd(Ua,2),Zs=ma[0],Ts=ma[1],aa=useMemo(function(){return getStyleText(U)},[U]),La=useLayerList(),hl=useMemo(function(){var zs=[];return ei.forEach(function($s){var hr;if(typeof $s.layer=="string"){var It=La.find(function(tn){return tn.id===$s.layer});if(It)hr=It;else return}else hr=$s.layer;var Qt=[];hr.isComposite?Qt.push.apply(Qt,uv(hr.getInteractionSubLayers())):Qt.push(hr),Qt.forEach(function(tn){var Cn,gn={layer:tn};$s.title&&(gn.title=getElementTypePortal($s.title,"div")),$s.customContent&&(gn.customContent=getElementTypePortal($s.customContent,"div")),(Cn=$s.fields)!==null&&Cn!==void 0&&Cn.length&&(gn.fields=$s.fields.map(function(zo){if(typeof zo=="string")return zo;var fs={field:zo.field,getValue:zo.getValue};return zo.formatField&&(fs.formatField=getElementTypePortal(zo.formatField,"span")),zo.formatValue&&(fs.formatValue=getElementTypePortal(zo.formatValue,"span")),fs})),zs.push(gn)})}),zs},[La,ei]),As=useMemo(function(){return{style:aa,closeButton:se,closeButtonOffsets:Fe,closeOnClick:rt,closeOnEsc:yt,maxWidth:dt,anchor:zt,offsets:ur,stopPropagation:on,autoPan:pi,autoClose:Hi,followCursor:ii==="hover",className:so,lngLat:uo,items:hl,trigger:ii}},[aa,se,JSON.stringify(Fe),rt,yt,dt,zt,JSON.stringify(ur),on,pi,Hi,so,ii,JSON.stringify(uo),hl]);return useEffect(function(){var zs=new L7LayerPopup(omitBy(As,function($s){return $s===void 0}));return Ts(zs),Ha.addPopup(zs),function(){Ha.removePopup(zs),Ts(void 0)}},[]),useL7ComponentUpdate(Zs,As),useL7ComponentEvent(Zs,{open:_o,close:Li,show:yo,hide:Ta}),React.createElement(React.Fragment,null)},fv="larkmap-context-menu",sx="[object Map]",L_="[object Set]",D_=Object.prototype,lx=D_.hasOwnProperty;function ux(C){if(C==null)return!0;if(hd(C)&&((0,dn.Z)(C)||typeof C=="string"||typeof C.splice=="function"||Vu(C)||nf(C)||np(C)))return!C.length;var P=Qf(C);if(P==sx||P==L_)return!C.size;if(Dc(C))return!wd(C).length;for(var U in C)if(lx.call(C,U))return!1;return!0}var cx=ux,O_=(0,Ze.memo)(function(P){var U=P.text,se=U===void 0?"":U,Fe=P.onClick;return cx(se)?null:Ze.createElement("li",{className:Ce()("".concat(fv,"__menu-item"),P==null?void 0:P.className),style:P==null?void 0:P.style,onClick:Fe},se)});function hx(C,P){return dx(C)||fx(C,P)||B_(C,P)||px()}function px(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B_(C,P){if(C){if(typeof C=="string")return dv(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return dv(C,P)}}function dv(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function fx(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function dx(C){if(Array.isArray(C))return C}var aE=function(P){var U=ys(),se=(0,Ze.useState)({visible:!1,position:void 0}),Fe=hx(se,2),rt=Fe[0],yt=Fe[1],dt=(0,Ze.useMemo)(function(){return Ze.createElement("div",{className:Ce()("".concat(fv),P==null?void 0:P.className),style:P==null?void 0:P.style},P==null?void 0:P.children)},[P]),zt=function(pi){var Hi=pi.lnglat,so=Hi.lng,uo=Hi.lat;yt({visible:!0,position:{lng:so,lat:uo}})},ur=function(){var pi=setTimeout(function(){pi&&(clearTimeout(pi),yt({visible:!1,position:void 0}))},0)};return(0,Ze.useEffect)(function(){return U&&(U.on("contextmenu",zt),U.on("click",ur)),function(){U.off("contextmenu",zt),U.off("click",ur)}},[U]),rt.visible?Ze.createElement(pf,{lngLat:rt.position,anchor:"top-left"},dt):null};aE.Item=O_;var mx=Se(66292),gx=Se.n(mx),vx=Se(66023),F_=Se(81121),_x=Se(26963);function m0(C,P){var U;_x.Z&&((0,F_.mf)(C)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof C)));var se=(0,vx.Z)(C),Fe=(U=P==null?void 0:P.wait)!==null&&U!==void 0?U:1e3,rt=(0,Ze.useMemo)(function(){return gx()(function(){for(var yt=[],dt=0;dt<arguments.length;dt++)yt[dt]=arguments[dt];return se.current.apply(se,(0,hn.ev)([],(0,hn.CR)(yt),!1))},Fe,P)},[]);return(0,Oh.Z)(function(){rt.cancel()}),{run:rt,cancel:rt.cancel,flush:rt.flush}}var k_=m0,N_=Se(96706),z_=Se.n(N_),mv="larkmap-location-search",yx="https://restapi.amap.com/v3/assistant/inputtips",xx=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bx=/^\w*$/;function Ex(C,P){if((0,dn.Z)(C))return!1;var U=typeof C;return U=="number"||U=="symbol"||U=="boolean"||C==null||Za(C)?!0:bx.test(C)||!xx.test(C)||P!=null&&C in Object(P)}var Sx=Ex,Tx="Expected a function";function Pg(C,P){if(typeof C!="function"||P!=null&&typeof P!="function")throw new TypeError(Tx);var U=function(){var se=arguments,Fe=P?P.apply(this,se):se[0],rt=U.cache;if(rt.has(Fe))return rt.get(Fe);var yt=C.apply(this,se);return U.cache=rt.set(Fe,yt)||rt,yt};return U.cache=new(Pg.Cache||Sh),U}Pg.Cache=Sh;var U_=Pg,Z_=500;function V_(C){var P=U_(C,function(se){return U.size===Z_&&U.clear(),se}),U=P.cache;return P}var Ax=V_,Cx=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mx=/\\(\\)?/g,Px=Ax(function(C){var P=[];return C.charCodeAt(0)===46&&P.push(""),C.replace(Cx,function(U,se,Fe,rt){P.push(Fe?rt.replace(Mx,"$1"):se||U)}),P}),Rx=Px;function Ix(C,P){return(0,dn.Z)(C)?C:Sx(C,P)?[C]:Rx(le(C))}var gv=Ix;function g0(C){var P=C==null?0:C.length;return P?C[P-1]:void 0}var j_=g0,H_=1/0;function G_(C){if(typeof C=="string"||Za(C))return C;var P=C+"";return P=="0"&&1/C==-H_?"-0":P}var W_=G_;function Lx(C,P){P=gv(P,C);for(var U=0,se=P.length;C!=null&&U<se;)C=C[W_(P[U++])];return U&&U==se?C:void 0}var Dx=Lx;function Ox(C,P,U){var se=-1,Fe=C.length;P<0&&(P=-P>Fe?0:Fe+P),U=U>Fe?Fe:U,U<0&&(U+=Fe),Fe=P>U?0:U-P>>>0,P>>>=0;for(var rt=Array(Fe);++se<Fe;)rt[se]=C[se+P];return rt}var Bx=Ox;function Fx(C,P){return P.length<2?C:Dx(C,Bx(P,0,-1))}var kx=Fx;function X_(C,P){return P=gv(P,C),C=kx(C,P),C==null||delete C[W_(j_(P))]}var Nx=X_,zx="[object Object]",q_=Function.prototype,Y_=Object.prototype,$_=q_.toString,Ux=Y_.hasOwnProperty,Zx=$_.call(Object);function Vx(C){if(!Cr(C)||ar(C)!=zx)return!1;var P=uu(C);if(P===null)return!0;var U=Ux.call(P,"constructor")&&P.constructor;return typeof U=="function"&&U instanceof U&&$_.call(U)==Zx}var jx=Vx;function Hx(C){return jx(C)?void 0:C}var K_=Hx,J_=Jn?Jn.isConcatSpreadable:void 0;function Q_(C){return(0,dn.Z)(C)||np(C)||!!(J_&&C&&C[J_])}var Gx=Q_;function ey(C,P,U,se,Fe){var rt=-1,yt=C.length;for(U||(U=Gx),Fe||(Fe=[]);++rt<yt;){var dt=C[rt];P>0&&U(dt)?P>1?ey(dt,P-1,U,se,Fe):ho(Fe,dt):se||(Fe[Fe.length]=dt)}return Fe}var ty=ey;function ry(C){var P=C==null?0:C.length;return P?ty(C,1):[]}var ny=ry;function Wx(C,P,U){switch(U.length){case 0:return C.call(P);case 1:return C.call(P,U[0]);case 2:return C.call(P,U[0],U[1]);case 3:return C.call(P,U[0],U[1],U[2])}return C.apply(P,U)}var Xx=Wx,iy=Math.max;function oy(C,P,U){return P=iy(P===void 0?C.length-1:P,0),function(){for(var se=arguments,Fe=-1,rt=iy(se.length-P,0),yt=Array(rt);++Fe<rt;)yt[Fe]=se[P+Fe];Fe=-1;for(var dt=Array(P+1);++Fe<P;)dt[Fe]=se[Fe];return dt[P]=U(yt),Xx(C,this,dt)}}var qx=oy;function Yx(C){return function(){return C}}var $x=Yx;function ay(C){return C}var sy=ay,Kx=ci?function(C,P){return ci(C,"toString",{configurable:!0,enumerable:!1,value:$x(P),writable:!0})}:sy,ly=Kx,Wg=800,uy=16,Jx=Date.now;function cy(C){var P=0,U=0;return function(){var se=Jx(),Fe=uy-(se-U);if(U=se,Fe>0){if(++P>=Wg)return arguments[0]}else P=0;return C.apply(void 0,arguments)}}var Qx=cy,eb=Qx(ly),tb=eb;function rb(C){return tb(qx(C,void 0,ny),C+"")}var nb=rb,vv=1,ib=2,ob=4,ab=nb(function(C,P){var U={};if(C==null)return U;var se=!1;P=wa(P,function(rt){return rt=gv(rt,C),se||(se=rt.length>1),rt}),xi(C,ya(C),U),se&&(U=ie(U,vv|ib|ob,K_));for(var Fe=P.length;Fe--;)Nx(U,P[Fe]);return U}),sb=ab,_v=Se(77374);function Xg(C){"@babel/helpers - typeof";return Xg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},Xg(C)}var Rg=["prefixCls","bordered","className","getPopupContainer","dropdownClassName","popupClassName","listHeight","placement","listItemHeight","disabled","notFoundContent"];function yv(){return yv=Object.assign?Object.assign.bind():function(C){for(var P=1;P<arguments.length;P++){var U=arguments[P];for(var se in U)Object.prototype.hasOwnProperty.call(U,se)&&(C[se]=U[se])}return C},yv.apply(this,arguments)}function lb(C,P,U){return P=ub(P),P in C?Object.defineProperty(C,P,{value:U,enumerable:!0,configurable:!0,writable:!0}):C[P]=U,C}function ub(C){var P=cb(C,"string");return Xg(P)=="symbol"?P:String(P)}function cb(C,P){if(Xg(C)!="object"||!C)return C;var U=C[Symbol.toPrimitive];if(U!==void 0){var se=U.call(C,P||"default");if(Xg(se)!="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(C)}function hb(C,P){if(C==null)return{};var U=pb(C,P),se,Fe;if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(C);for(Fe=0;Fe<rt.length;Fe++)se=rt[Fe],!(P.indexOf(se)>=0)&&Object.prototype.propertyIsEnumerable.call(C,se)&&(U[se]=C[se])}return U}function pb(C,P){if(C==null)return{};var U={},se=Object.keys(C),Fe,rt;for(rt=0;rt<se.length;rt++)Fe=se[rt],!(P.indexOf(Fe)>=0)&&(U[Fe]=C[Fe]);return U}var hy="SECRET_COMBOBOX_MODE_DO_NOT_USE",xv="larkmap-select",fb=function(P,U){var se=P.prefixCls,Fe=P.bordered,rt=Fe===void 0?!0:Fe,yt=P.className,dt=P.getPopupContainer,zt=P.dropdownClassName,ur=P.popupClassName,on=P.listHeight,pi=on===void 0?256:on,Hi=P.placement,so=P.listItemHeight,uo=so===void 0?24:so,ei=P.disabled,ii=P.notFoundContent,_o=hb(P,Rg),Li=Ze.useMemo(function(){var Ha=_o,Ua=Ha.mode;if(Ua!=="combobox")return Ua===hy?"combobox":Ua},[_o]),yo=sb(_o,"suffixIcon","itemIcon"),Ta=Ce()(lb({},"".concat(xv,"-borderless"),!rt),yt);return Ze.createElement(_v.ZP,yv({ref:U},yo,{listHeight:pi,listItemHeight:uo,mode:Li,prefixCls:xv,placement:Hi,notFoundContent:ii!=null?ii:"\u5F53\u524D\u65E0\u6570\u636E",className:Ta,getPopupContainer:dt,dropdownClassName:ur,disabled:ei}))},v0=Ze.forwardRef(fb);v0.SECRET_COMBOBOX_MODE_DO_NOT_USE=hy,v0.Option=_v.Wx,v0.OptGroup=_v.Xo;var bv=v0;function cg(C){"@babel/helpers - typeof";return cg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},cg(C)}var db=["searchParams","showDistrict","showAddress","onSearchFinish","onChange"],mb=["keywords","privateKey"];function Ev(){return Ev=Object.assign?Object.assign.bind():function(C){for(var P=1;P<arguments.length;P++){var U=arguments[P];for(var se in U)Object.prototype.hasOwnProperty.call(U,se)&&(C[se]=U[se])}return C},Ev.apply(this,arguments)}function wv(){"use strict";wv=function(){return P};var C,P={},U=Object.prototype,se=U.hasOwnProperty,Fe=Object.defineProperty||function(hr,It,Qt){hr[It]=Qt.value},rt=typeof Symbol=="function"?Symbol:{},yt=rt.iterator||"@@iterator",dt=rt.asyncIterator||"@@asyncIterator",zt=rt.toStringTag||"@@toStringTag";function ur(hr,It,Qt){return Object.defineProperty(hr,It,{value:Qt,enumerable:!0,configurable:!0,writable:!0}),hr[It]}try{ur({},"")}catch(hr){ur=function(Qt,tn,Cn){return Qt[tn]=Cn}}function on(hr,It,Qt,tn){var Cn=It&&It.prototype instanceof _o?It:_o,gn=Object.create(Cn.prototype),zo=new zs(tn||[]);return Fe(gn,"_invoke",{value:aa(hr,Qt,zo)}),gn}function pi(hr,It,Qt){try{return{type:"normal",arg:hr.call(It,Qt)}}catch(tn){return{type:"throw",arg:tn}}}P.wrap=on;var Hi="suspendedStart",so="suspendedYield",uo="executing",ei="completed",ii={};function _o(){}function Li(){}function yo(){}var Ta={};ur(Ta,yt,function(){return this});var Ha=Object.getPrototypeOf,Ua=Ha&&Ha(Ha($s([])));Ua&&Ua!==U&&se.call(Ua,yt)&&(Ta=Ua);var ma=yo.prototype=_o.prototype=Object.create(Ta);function Zs(hr){["next","throw","return"].forEach(function(It){ur(hr,It,function(Qt){return this._invoke(It,Qt)})})}function Ts(hr,It){function Qt(Cn,gn,zo,fs){var Vs=pi(hr[Cn],hr,gn);if(Vs.type!=="throw"){var Lh=Vs.arg,yc=Lh.value;return yc&&cg(yc)=="object"&&se.call(yc,"__await")?It.resolve(yc.__await).then(function(hp){Qt("next",hp,zo,fs)},function(hp){Qt("throw",hp,zo,fs)}):It.resolve(yc).then(function(hp){Lh.value=hp,zo(Lh)},function(hp){return Qt("throw",hp,zo,fs)})}fs(Vs.arg)}var tn;Fe(this,"_invoke",{value:function(gn,zo){function fs(){return new It(function(Vs,Lh){Qt(gn,zo,Vs,Lh)})}return tn=tn?tn.then(fs,fs):fs()}})}function aa(hr,It,Qt){var tn=Hi;return function(Cn,gn){if(tn===uo)throw new Error("Generator is already running");if(tn===ei){if(Cn==="throw")throw gn;return{value:C,done:!0}}for(Qt.method=Cn,Qt.arg=gn;;){var zo=Qt.delegate;if(zo){var fs=La(zo,Qt);if(fs){if(fs===ii)continue;return fs}}if(Qt.method==="next")Qt.sent=Qt._sent=Qt.arg;else if(Qt.method==="throw"){if(tn===Hi)throw tn=ei,Qt.arg;Qt.dispatchException(Qt.arg)}else Qt.method==="return"&&Qt.abrupt("return",Qt.arg);tn=uo;var Vs=pi(hr,It,Qt);if(Vs.type==="normal"){if(tn=Qt.done?ei:so,Vs.arg===ii)continue;return{value:Vs.arg,done:Qt.done}}Vs.type==="throw"&&(tn=ei,Qt.method="throw",Qt.arg=Vs.arg)}}}function La(hr,It){var Qt=It.method,tn=hr.iterator[Qt];if(tn===C)return It.delegate=null,Qt==="throw"&&hr.iterator.return&&(It.method="return",It.arg=C,La(hr,It),It.method==="throw")||Qt!=="return"&&(It.method="throw",It.arg=new TypeError("The iterator does not provide a '"+Qt+"' method")),ii;var Cn=pi(tn,hr.iterator,It.arg);if(Cn.type==="throw")return It.method="throw",It.arg=Cn.arg,It.delegate=null,ii;var gn=Cn.arg;return gn?gn.done?(It[hr.resultName]=gn.value,It.next=hr.nextLoc,It.method!=="return"&&(It.method="next",It.arg=C),It.delegate=null,ii):gn:(It.method="throw",It.arg=new TypeError("iterator result is not an object"),It.delegate=null,ii)}function hl(hr){var It={tryLoc:hr[0]};1 in hr&&(It.catchLoc=hr[1]),2 in hr&&(It.finallyLoc=hr[2],It.afterLoc=hr[3]),this.tryEntries.push(It)}function As(hr){var It=hr.completion||{};It.type="normal",delete It.arg,hr.completion=It}function zs(hr){this.tryEntries=[{tryLoc:"root"}],hr.forEach(hl,this),this.reset(!0)}function $s(hr){if(hr||hr===""){var It=hr[yt];if(It)return It.call(hr);if(typeof hr.next=="function")return hr;if(!isNaN(hr.length)){var Qt=-1,tn=function Cn(){for(;++Qt<hr.length;)if(se.call(hr,Qt))return Cn.value=hr[Qt],Cn.done=!1,Cn;return Cn.value=C,Cn.done=!0,Cn};return tn.next=tn}}throw new TypeError(cg(hr)+" is not iterable")}return Li.prototype=yo,Fe(ma,"constructor",{value:yo,configurable:!0}),Fe(yo,"constructor",{value:Li,configurable:!0}),Li.displayName=ur(yo,zt,"GeneratorFunction"),P.isGeneratorFunction=function(hr){var It=typeof hr=="function"&&hr.constructor;return!!It&&(It===Li||(It.displayName||It.name)==="GeneratorFunction")},P.mark=function(hr){return Object.setPrototypeOf?Object.setPrototypeOf(hr,yo):(hr.__proto__=yo,ur(hr,zt,"GeneratorFunction")),hr.prototype=Object.create(ma),hr},P.awrap=function(hr){return{__await:hr}},Zs(Ts.prototype),ur(Ts.prototype,dt,function(){return this}),P.AsyncIterator=Ts,P.async=function(hr,It,Qt,tn,Cn){Cn===void 0&&(Cn=Promise);var gn=new Ts(on(hr,It,Qt,tn),Cn);return P.isGeneratorFunction(It)?gn:gn.next().then(function(zo){return zo.done?zo.value:gn.next()})},Zs(ma),ur(ma,zt,"Generator"),ur(ma,yt,function(){return this}),ur(ma,"toString",function(){return"[object Generator]"}),P.keys=function(hr){var It=Object(hr),Qt=[];for(var tn in It)Qt.push(tn);return Qt.reverse(),function Cn(){for(;Qt.length;){var gn=Qt.pop();if(gn in It)return Cn.value=gn,Cn.done=!1,Cn}return Cn.done=!0,Cn}},P.values=$s,zs.prototype={constructor:zs,reset:function(It){if(this.prev=0,this.next=0,this.sent=this._sent=C,this.done=!1,this.delegate=null,this.method="next",this.arg=C,this.tryEntries.forEach(As),!It)for(var Qt in this)Qt.charAt(0)==="t"&&se.call(this,Qt)&&!isNaN(+Qt.slice(1))&&(this[Qt]=C)},stop:function(){this.done=!0;var It=this.tryEntries[0].completion;if(It.type==="throw")throw It.arg;return this.rval},dispatchException:function(It){if(this.done)throw It;var Qt=this;function tn(Lh,yc){return zo.type="throw",zo.arg=It,Qt.next=Lh,yc&&(Qt.method="next",Qt.arg=C),!!yc}for(var Cn=this.tryEntries.length-1;Cn>=0;--Cn){var gn=this.tryEntries[Cn],zo=gn.completion;if(gn.tryLoc==="root")return tn("end");if(gn.tryLoc<=this.prev){var fs=se.call(gn,"catchLoc"),Vs=se.call(gn,"finallyLoc");if(fs&&Vs){if(this.prev<gn.catchLoc)return tn(gn.catchLoc,!0);if(this.prev<gn.finallyLoc)return tn(gn.finallyLoc)}else if(fs){if(this.prev<gn.catchLoc)return tn(gn.catchLoc,!0)}else{if(!Vs)throw new Error("try statement without catch or finally");if(this.prev<gn.finallyLoc)return tn(gn.finallyLoc)}}}},abrupt:function(It,Qt){for(var tn=this.tryEntries.length-1;tn>=0;--tn){var Cn=this.tryEntries[tn];if(Cn.tryLoc<=this.prev&&se.call(Cn,"finallyLoc")&&this.prev<Cn.finallyLoc){var gn=Cn;break}}gn&&(It==="break"||It==="continue")&&gn.tryLoc<=Qt&&Qt<=gn.finallyLoc&&(gn=null);var zo=gn?gn.completion:{};return zo.type=It,zo.arg=Qt,gn?(this.method="next",this.next=gn.finallyLoc,ii):this.complete(zo)},complete:function(It,Qt){if(It.type==="throw")throw It.arg;return It.type==="break"||It.type==="continue"?this.next=It.arg:It.type==="return"?(this.rval=this.arg=It.arg,this.method="return",this.next="end"):It.type==="normal"&&Qt&&(this.next=Qt),ii},finish:function(It){for(var Qt=this.tryEntries.length-1;Qt>=0;--Qt){var tn=this.tryEntries[Qt];if(tn.finallyLoc===It)return this.complete(tn.completion,tn.afterLoc),As(tn),ii}},catch:function(It){for(var Qt=this.tryEntries.length-1;Qt>=0;--Qt){var tn=this.tryEntries[Qt];if(tn.tryLoc===It){var Cn=tn.completion;if(Cn.type==="throw"){var gn=Cn.arg;As(tn)}return gn}}throw new Error("illegal catch attempt")},delegateYield:function(It,Qt,tn){return this.delegate={iterator:$s(It),resultName:Qt,nextLoc:tn},this.method==="next"&&(this.arg=C),ii}},P}function py(C){return fy(C)||vb(C)||Xd(C)||gb()}function gb(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vb(C){if(typeof Symbol!="undefined"&&C[Symbol.iterator]!=null||C["@@iterator"]!=null)return Array.from(C)}function fy(C){if(Array.isArray(C))return hg(C)}function Sv(C,P){var U=Object.keys(C);if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(C);P&&(se=se.filter(function(Fe){return Object.getOwnPropertyDescriptor(C,Fe).enumerable})),U.push.apply(U,se)}return U}function dy(C){for(var P=1;P<arguments.length;P++){var U=arguments[P]!=null?arguments[P]:{};P%2?Sv(Object(U),!0).forEach(function(se){_b(C,se,U[se])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(U)):Sv(Object(U)).forEach(function(se){Object.defineProperty(C,se,Object.getOwnPropertyDescriptor(U,se))})}return C}function _b(C,P,U){return P=sE(P),P in C?Object.defineProperty(C,P,{value:U,enumerable:!0,configurable:!0,writable:!0}):C[P]=U,C}function sE(C){var P=gy(C,"string");return cg(P)=="symbol"?P:String(P)}function gy(C,P){if(cg(C)!="object"||!C)return C;var U=C[Symbol.toPrimitive];if(U!==void 0){var se=U.call(C,P||"default");if(cg(se)!="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(C)}function Tv(C,P,U,se,Fe,rt,yt){try{var dt=C[rt](yt),zt=dt.value}catch(ur){U(ur);return}dt.done?P(zt):Promise.resolve(zt).then(se,Fe)}function yb(C){return function(){var P=this,U=arguments;return new Promise(function(se,Fe){var rt=C.apply(P,U);function yt(zt){Tv(rt,se,Fe,yt,dt,"next",zt)}function dt(zt){Tv(rt,se,Fe,yt,dt,"throw",zt)}yt(void 0)})}}function vy(C,P){return xb(C)||qg(C,P)||Xd(C,P)||lE()}function lE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xd(C,P){if(C){if(typeof C=="string")return hg(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return hg(C,P)}}function hg(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function qg(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function xb(C){if(Array.isArray(C))return C}function Av(C,P){if(C==null)return{};var U=pg(C,P),se,Fe;if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(C);for(Fe=0;Fe<rt.length;Fe++)se=rt[Fe],!(P.indexOf(se)>=0)&&Object.prototype.propertyIsEnumerable.call(C,se)&&(U[se]=C[se])}return U}function pg(C,P){if(C==null)return{};var U={},se=Object.keys(C),Fe,rt;for(rt=0;rt<se.length;rt++)Fe=se[rt],!(P.indexOf(Fe)>=0)&&(U[Fe]=C[Fe]);return U}var Cv=bv.Option,km=function(P){var U=P.searchParams,se=P.showDistrict,Fe=P.showAddress,rt=P.onSearchFinish,yt=P.onChange,dt=Av(P,db),zt=(0,Ze.useState)([]),ur=vy(zt,2),on=ur[0],pi=ur[1];(0,Ze.useEffect)(function(){rt==null||rt(on)},[rt,on]);var Hi=k_(function(){var ei=yb(wv().mark(function ii(_o){var Li,yo,Ta,Ha,Ua,ma,Zs;return wv().wrap(function(aa){for(;;)switch(aa.prev=aa.next){case 0:if(_o){aa.next=3;break}return pi([]),aa.abrupt("return");case 3:return yo=U.keywords,Ta=U.privateKey,Ha=Av(U,mb),Ua=dy(dy({},Ha),{},{keywords:[].concat(py((yo!=null?yo:"").split("|")),[_o]).filter(function(La){return!!La}).join("|")}),Ta&&(Ua.sig=z_()(Ju(Ua,!1)+Ta)),ma="".concat(yx,"?").concat(Ju(Ua,!0)),aa.next=9,fetch(ma);case 9:return aa.next=11,aa.sent.json();case 11:Zs=aa.sent,pi(((Li=Zs==null?void 0:Zs.tips)!==null&&Li!==void 0?Li:[]).filter(function(La){return La.location&&La.location.length}).map(function(La){var hl=La.location.split(","),As=vy(hl,2),zs=As[0],$s=As[1];return La.longitude=+zs,La.latitude=+$s,La}));case 13:case"end":return aa.stop()}},ii)}));return function(ii){return ei.apply(this,arguments)}}(),{wait:1e3}),so=Hi.run,uo=(0,Ze.useCallback)(function(ei){var ii=ei&&on.find(function(_o){return _o.name===ei});yt==null||yt(ei||void 0,ii||void 0)},[yt,on]);return Ze.createElement(bv,Ev({className:"".concat(mv),onSearch:so,onChange:uo,clearIcon:function(){return null}},dt),on.map(function(ei){var ii="".concat(se?ei.district:"").concat(Fe?ei.address:"");return Ze.createElement(Cv,{key:ei.id,value:ei.name},Ze.createElement("div",{title:ei.name,className:"".concat(mv,"__option-name")},ei.name),ii&&Ze.createElement("div",{title:ii,className:"".concat(mv,"__option-tip")},ii))}))};km.defaultProps={placeholder:"\u8BF7\u8F93\u5165\u8981\u641C\u7D22\u5730\u540D",showSearch:!0,allowClear:!0,filterOption:!1,defaultActiveFirstOption:!1,showAddress:!0,showDistrict:!0};function fg(C){"@babel/helpers - typeof";return fg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},fg(C)}function _0(){"use strict";_0=function(){return P};var C,P={},U=Object.prototype,se=U.hasOwnProperty,Fe=Object.defineProperty||function(hr,It,Qt){hr[It]=Qt.value},rt=typeof Symbol=="function"?Symbol:{},yt=rt.iterator||"@@iterator",dt=rt.asyncIterator||"@@asyncIterator",zt=rt.toStringTag||"@@toStringTag";function ur(hr,It,Qt){return Object.defineProperty(hr,It,{value:Qt,enumerable:!0,configurable:!0,writable:!0}),hr[It]}try{ur({},"")}catch(hr){ur=function(Qt,tn,Cn){return Qt[tn]=Cn}}function on(hr,It,Qt,tn){var Cn=It&&It.prototype instanceof _o?It:_o,gn=Object.create(Cn.prototype),zo=new zs(tn||[]);return Fe(gn,"_invoke",{value:aa(hr,Qt,zo)}),gn}function pi(hr,It,Qt){try{return{type:"normal",arg:hr.call(It,Qt)}}catch(tn){return{type:"throw",arg:tn}}}P.wrap=on;var Hi="suspendedStart",so="suspendedYield",uo="executing",ei="completed",ii={};function _o(){}function Li(){}function yo(){}var Ta={};ur(Ta,yt,function(){return this});var Ha=Object.getPrototypeOf,Ua=Ha&&Ha(Ha($s([])));Ua&&Ua!==U&&se.call(Ua,yt)&&(Ta=Ua);var ma=yo.prototype=_o.prototype=Object.create(Ta);function Zs(hr){["next","throw","return"].forEach(function(It){ur(hr,It,function(Qt){return this._invoke(It,Qt)})})}function Ts(hr,It){function Qt(Cn,gn,zo,fs){var Vs=pi(hr[Cn],hr,gn);if(Vs.type!=="throw"){var Lh=Vs.arg,yc=Lh.value;return yc&&fg(yc)=="object"&&se.call(yc,"__await")?It.resolve(yc.__await).then(function(hp){Qt("next",hp,zo,fs)},function(hp){Qt("throw",hp,zo,fs)}):It.resolve(yc).then(function(hp){Lh.value=hp,zo(Lh)},function(hp){return Qt("throw",hp,zo,fs)})}fs(Vs.arg)}var tn;Fe(this,"_invoke",{value:function(gn,zo){function fs(){return new It(function(Vs,Lh){Qt(gn,zo,Vs,Lh)})}return tn=tn?tn.then(fs,fs):fs()}})}function aa(hr,It,Qt){var tn=Hi;return function(Cn,gn){if(tn===uo)throw new Error("Generator is already running");if(tn===ei){if(Cn==="throw")throw gn;return{value:C,done:!0}}for(Qt.method=Cn,Qt.arg=gn;;){var zo=Qt.delegate;if(zo){var fs=La(zo,Qt);if(fs){if(fs===ii)continue;return fs}}if(Qt.method==="next")Qt.sent=Qt._sent=Qt.arg;else if(Qt.method==="throw"){if(tn===Hi)throw tn=ei,Qt.arg;Qt.dispatchException(Qt.arg)}else Qt.method==="return"&&Qt.abrupt("return",Qt.arg);tn=uo;var Vs=pi(hr,It,Qt);if(Vs.type==="normal"){if(tn=Qt.done?ei:so,Vs.arg===ii)continue;return{value:Vs.arg,done:Qt.done}}Vs.type==="throw"&&(tn=ei,Qt.method="throw",Qt.arg=Vs.arg)}}}function La(hr,It){var Qt=It.method,tn=hr.iterator[Qt];if(tn===C)return It.delegate=null,Qt==="throw"&&hr.iterator.return&&(It.method="return",It.arg=C,La(hr,It),It.method==="throw")||Qt!=="return"&&(It.method="throw",It.arg=new TypeError("The iterator does not provide a '"+Qt+"' method")),ii;var Cn=pi(tn,hr.iterator,It.arg);if(Cn.type==="throw")return It.method="throw",It.arg=Cn.arg,It.delegate=null,ii;var gn=Cn.arg;return gn?gn.done?(It[hr.resultName]=gn.value,It.next=hr.nextLoc,It.method!=="return"&&(It.method="next",It.arg=C),It.delegate=null,ii):gn:(It.method="throw",It.arg=new TypeError("iterator result is not an object"),It.delegate=null,ii)}function hl(hr){var It={tryLoc:hr[0]};1 in hr&&(It.catchLoc=hr[1]),2 in hr&&(It.finallyLoc=hr[2],It.afterLoc=hr[3]),this.tryEntries.push(It)}function As(hr){var It=hr.completion||{};It.type="normal",delete It.arg,hr.completion=It}function zs(hr){this.tryEntries=[{tryLoc:"root"}],hr.forEach(hl,this),this.reset(!0)}function $s(hr){if(hr||hr===""){var It=hr[yt];if(It)return It.call(hr);if(typeof hr.next=="function")return hr;if(!isNaN(hr.length)){var Qt=-1,tn=function Cn(){for(;++Qt<hr.length;)if(se.call(hr,Qt))return Cn.value=hr[Qt],Cn.done=!1,Cn;return Cn.value=C,Cn.done=!0,Cn};return tn.next=tn}}throw new TypeError(fg(hr)+" is not iterable")}return Li.prototype=yo,Fe(ma,"constructor",{value:yo,configurable:!0}),Fe(yo,"constructor",{value:Li,configurable:!0}),Li.displayName=ur(yo,zt,"GeneratorFunction"),P.isGeneratorFunction=function(hr){var It=typeof hr=="function"&&hr.constructor;return!!It&&(It===Li||(It.displayName||It.name)==="GeneratorFunction")},P.mark=function(hr){return Object.setPrototypeOf?Object.setPrototypeOf(hr,yo):(hr.__proto__=yo,ur(hr,zt,"GeneratorFunction")),hr.prototype=Object.create(ma),hr},P.awrap=function(hr){return{__await:hr}},Zs(Ts.prototype),ur(Ts.prototype,dt,function(){return this}),P.AsyncIterator=Ts,P.async=function(hr,It,Qt,tn,Cn){Cn===void 0&&(Cn=Promise);var gn=new Ts(on(hr,It,Qt,tn),Cn);return P.isGeneratorFunction(It)?gn:gn.next().then(function(zo){return zo.done?zo.value:gn.next()})},Zs(ma),ur(ma,zt,"Generator"),ur(ma,yt,function(){return this}),ur(ma,"toString",function(){return"[object Generator]"}),P.keys=function(hr){var It=Object(hr),Qt=[];for(var tn in It)Qt.push(tn);return Qt.reverse(),function Cn(){for(;Qt.length;){var gn=Qt.pop();if(gn in It)return Cn.value=gn,Cn.done=!1,Cn}return Cn.done=!0,Cn}},P.values=$s,zs.prototype={constructor:zs,reset:function(It){if(this.prev=0,this.next=0,this.sent=this._sent=C,this.done=!1,this.delegate=null,this.method="next",this.arg=C,this.tryEntries.forEach(As),!It)for(var Qt in this)Qt.charAt(0)==="t"&&se.call(this,Qt)&&!isNaN(+Qt.slice(1))&&(this[Qt]=C)},stop:function(){this.done=!0;var It=this.tryEntries[0].completion;if(It.type==="throw")throw It.arg;return this.rval},dispatchException:function(It){if(this.done)throw It;var Qt=this;function tn(Lh,yc){return zo.type="throw",zo.arg=It,Qt.next=Lh,yc&&(Qt.method="next",Qt.arg=C),!!yc}for(var Cn=this.tryEntries.length-1;Cn>=0;--Cn){var gn=this.tryEntries[Cn],zo=gn.completion;if(gn.tryLoc==="root")return tn("end");if(gn.tryLoc<=this.prev){var fs=se.call(gn,"catchLoc"),Vs=se.call(gn,"finallyLoc");if(fs&&Vs){if(this.prev<gn.catchLoc)return tn(gn.catchLoc,!0);if(this.prev<gn.finallyLoc)return tn(gn.finallyLoc)}else if(fs){if(this.prev<gn.catchLoc)return tn(gn.catchLoc,!0)}else{if(!Vs)throw new Error("try statement without catch or finally");if(this.prev<gn.finallyLoc)return tn(gn.finallyLoc)}}}},abrupt:function(It,Qt){for(var tn=this.tryEntries.length-1;tn>=0;--tn){var Cn=this.tryEntries[tn];if(Cn.tryLoc<=this.prev&&se.call(Cn,"finallyLoc")&&this.prev<Cn.finallyLoc){var gn=Cn;break}}gn&&(It==="break"||It==="continue")&&gn.tryLoc<=Qt&&Qt<=gn.finallyLoc&&(gn=null);var zo=gn?gn.completion:{};return zo.type=It,zo.arg=Qt,gn?(this.method="next",this.next=gn.finallyLoc,ii):this.complete(zo)},complete:function(It,Qt){if(It.type==="throw")throw It.arg;return It.type==="break"||It.type==="continue"?this.next=It.arg:It.type==="return"?(this.rval=this.arg=It.arg,this.method="return",this.next="end"):It.type==="normal"&&Qt&&(this.next=Qt),ii},finish:function(It){for(var Qt=this.tryEntries.length-1;Qt>=0;--Qt){var tn=this.tryEntries[Qt];if(tn.finallyLoc===It)return this.complete(tn.completion,tn.afterLoc),As(tn),ii}},catch:function(It){for(var Qt=this.tryEntries.length-1;Qt>=0;--Qt){var tn=this.tryEntries[Qt];if(tn.tryLoc===It){var Cn=tn.completion;if(Cn.type==="throw"){var gn=Cn.arg;As(tn)}return gn}}throw new Error("illegal catch attempt")},delegateYield:function(It,Qt,tn){return this.delegate={iterator:$s(It),resultName:Qt,nextLoc:tn},this.method==="next"&&(this.arg=C),ii}},P}function Mm(C){return Mv(C)||Rd(C)||Sy(C)||_y()}function _y(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rd(C){if(typeof Symbol!="undefined"&&C[Symbol.iterator]!=null||C["@@iterator"]!=null)return Array.from(C)}function Mv(C){if(Array.isArray(C))return Pv(C)}function yy(C,P){var U=Object.keys(C);if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(C);P&&(se=se.filter(function(Fe){return Object.getOwnPropertyDescriptor(C,Fe).enumerable})),U.push.apply(U,se)}return U}function xy(C){for(var P=1;P<arguments.length;P++){var U=arguments[P]!=null?arguments[P]:{};P%2?yy(Object(U),!0).forEach(function(se){by(C,se,U[se])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(U)):yy(Object(U)).forEach(function(se){Object.defineProperty(C,se,Object.getOwnPropertyDescriptor(U,se))})}return C}function by(C,P,U){return P=bb(P),P in C?Object.defineProperty(C,P,{value:U,enumerable:!0,configurable:!0,writable:!0}):C[P]=U,C}function bb(C){var P=Ey(C,"string");return fg(P)=="symbol"?P:String(P)}function Ey(C,P){if(fg(C)!="object"||!C)return C;var U=C[Symbol.toPrimitive];if(U!==void 0){var se=U.call(C,P||"default");if(fg(se)!="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(C)}function wy(C,P,U,se,Fe,rt,yt){try{var dt=C[rt](yt),zt=dt.value}catch(ur){U(ur);return}dt.done?P(zt):Promise.resolve(zt).then(se,Fe)}function Eb(C){return function(){var P=this,U=arguments;return new Promise(function(se,Fe){var rt=C.apply(P,U);function yt(zt){wy(rt,se,Fe,yt,dt,"next",zt)}function dt(zt){wy(rt,se,Fe,yt,dt,"throw",zt)}yt(void 0)})}}function y0(C,P){return Tb(C)||Sb(C,P)||Sy(C,P)||wb()}function wb(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sy(C,P){if(C){if(typeof C=="string")return Pv(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return Pv(C,P)}}function Pv(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function Sb(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function Tb(C){if(Array.isArray(C))return C}var Ty=function(P){var U=P.className,se=P.style,Fe=P.searchParams,rt=P.transformBounds,yt=P.onChange,dt=useScene(),zt=useState("-"),ur=y0(zt,2),on=ur[0],pi=ur[1];return useEffect(function(){var Hi=function(){var uo=Eb(_0().mark(function ei(){var ii,_o,Li,yo,Ta,Ha,Ua,ma,Zs,Ts,aa,La;return _0().wrap(function(As){for(;;)switch(As.prev=As.next){case 0:if(dt){As.next=2;break}return As.abrupt("return");case 2:return ii=function($s,hr){return new Promise(function(It,Qt){fetch(urlStringify(GAO_DE_API_URL,xy(xy({},Fe),{},{location:"".concat($s,",").concat(hr)}))).then(function(tn){return tn.json()}).then(function(tn){if(tn.status==="1"){var Cn=tn.regeocode.addressComponent,gn=Cn.country,zo=Cn.province,fs=Cn.city,Vs=Cn.district,Lh=Cn.township;It([gn,zo,fs,Vs,Lh].filter(function(yc){return typeof yc=="string"&&yc}))}else Qt(tn)})})},_o=dt.getBounds(),Li=y0(_o,2),yo=Li[0],Ta=Li[1],rt&&(Ha=rt([yo,Ta]),Ua=y0(Ha,2),yo=Ua[0],Ta=Ua[1]),As.next=7,Promise.all([ii.apply(void 0,Mm(yo)),ii.apply(void 0,Mm(Ta))]);case 7:ma=As.sent,Zs=y0(ma,2),Ts=Zs[0],aa=Zs[1],La=Ts.length&&aa.length?intersection(Ts,aa).join(" "):"-",pi(La),yt==null||yt(La,[yo,Ta]);case 14:case"end":return As.stop()}},ei)}));return function(){return uo.apply(this,arguments)}}(),so=debounce(Hi,500,{maxWait:500});return Hi(),dt==null||dt.on("mapchange",so),function(){dt==null||dt.off("mapchange",so)}},[yt,dt,Fe,rt]),React.createElement("div",{className:classNames([U,CLS_PREFIX]),style:se},on)},Rv="larkmap-legend-icon",uE=function(P){var U=P.labels,se=P.icons,Fe=P.className,rt=P.style,yt=function(zt){if(React.isValidElement(zt))return zt;if(typeof zt=="string")return React.createElement("img",{src:zt})};return React.createElement("div",{className:classnames("".concat(Rv),Fe),style:rt},U.map(function(dt,zt){return React.createElement("div",{key:dt,className:"".concat(Rv,"__content")},yt(se[zt]),React.createElement("div",null,dt))}))};function Ay(C){return li(C)&&C!=+C}var Cy=Ay,cE=0;function x0(C){var P=++cE;return le(C)+P}var My=x0;function Py(C){return Iv(C)||pE(C)||Ov(C)||hE()}function hE(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pE(C){if(typeof Symbol!="undefined"&&C[Symbol.iterator]!=null||C["@@iterator"]!=null)return Array.from(C)}function Iv(C){if(Array.isArray(C))return Ig(C)}function Lv(C,P){return fE(C)||Bv(C,P)||Ov(C,P)||Dv()}function Dv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ov(C,P){if(C){if(typeof C=="string")return Ig(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return Ig(C,P)}}function Ig(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function Bv(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function fE(C){if(Array.isArray(C))return C}var Fv="larkmap-legend-proportion",Ab=function(P){var U=P.labels,se=P.fillColor,Fe=se===void 0?"#f9f9f9":se,rt=P.className,yt=P.style,dt=Lv(U,2),zt=dt[0],ur=dt[1],on=[86,62,38,24];function pi(ei,ii){var _o=(ii-ei)/4,Li=Math.floor(ei+_o),yo=Math.floor(ii-_o);return[Li,yo]}function Hi(){var ei=zt,ii=ur;(!li(ei)||!li(ei))&&(ei=ii=0),Cy(ei)&&(ei=0),Cy(ii)&&(ii=0);var _o=pi(ei,ii),Li=[{prefix:"MIN:",val:ei}].concat(Py(_o),[{prefix:"MAX:",val:ii}]);return Li}function so(){return Ze.createElement("div",{className:"".concat(Fv,"__circlebox"),style:{width:on[0]}},on.map(function(ei){return Ze.createElement("div",{key:ei,style:{width:ei,height:ei,background:Fe},className:"".concat(Fv,"__circlebox__item")})}))}function uo(){return Ze.createElement("div",{style:{height:on[0]}},Hi().reverse().map(function(ei){return Ze.createElement("div",{key:My(),className:"".concat(Fv,"__labelitem")},ei==null?void 0:ei.prefix,typeof ei=="number"?ei:ei.val)}))}return Ze.createElement("div",{className:Ce()("".concat(Fv),rt),style:yt},Ze.createElement(so,null),Ze.createElement(uo,null))};Ab.defaultProps={fillColor:"#f9f9f9"};var Cb=Se(22305),b0=Se.n(Cb);function Mb(C){return function(P,U,se){for(var Fe=-1,rt=Object(P),yt=se(P),dt=yt.length;dt--;){var zt=yt[C?dt:++Fe];if(U(rt[zt],zt,rt)===!1)break}return P}}var Pb=Mb,kv=Pb(),Ry=kv;function Rb(C,P){return C&&Ry(C,P,sf)}var dE=Rb;function Ib(C,P){return function(U,se){if(U==null)return U;if(!hd(U))return C(U,se);for(var Fe=U.length,rt=P?Fe:-1,yt=Object(U);(P?rt--:++rt<Fe)&&se(yt[rt],rt,yt)!==!1;);return U}}var Iy=Ib,Ly=Iy(dE),Dy=Ly;function Lb(C){return typeof C=="function"?C:sy}var mE=Lb;function qd(C,P){var U=(0,dn.Z)(C)?Hn:Dy;return U(C,mE(P))}var E0=qd,Oy=/\s/;function Nv(C){for(var P=C.length;P--&&Oy.test(C.charAt(P)););return P}var gE=Nv,Db=/^\s+/;function Ob(C){return C&&C.slice(0,gE(C)+1).replace(Db,"")}var By=Ob,zv=0/0,w0=/^[-+]0x[0-9a-f]+$/i,dg=/^0b[01]+$/i,Bb=/^0o[0-7]+$/i,vE=parseInt;function Fy(C){if(typeof C=="number")return C;if(Za(C))return zv;if(Sa(C)){var P=typeof C.valueOf=="function"?C.valueOf():C;C=Sa(P)?P+"":P}if(typeof C!="string")return C===0?C:+C;C=By(C);var U=dg.test(C);return U||Bb.test(C)?vE(C.slice(2),U?2:8):w0.test(C)?zv:+C}var Uv=Fy,Km=1/0,Jm=17976931348623157e292;function ky(C){if(!C)return C===0?C:0;if(C=Uv(C),C===Km||C===-Km){var P=C<0?-1:1;return P*Jm}return C===C?C:0}var Ny=ky;function S0(C){var P=Ny(C),U=P%1;return P===P?U?P-U:P:0}var zy=S0,Uy=pn.isFinite,_E=Math.min;function yE(C){var P=Math[C];return function(U,se){if(U=Uv(U),se=se==null?0:_E(zy(se),292),se&&Uy(U)){var Fe=(le(U)+"e").split("e"),rt=P(Fe[0]+"e"+(+Fe[1]+se));return Fe=(le(rt)+"e").split("e"),+(Fe[0]+"e"+(+Fe[1]-se))}return P(U)}}var Zy=yE,Fb=Zy("round"),Lg=Fb,kb=function(P,U){var se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:5,Fe=[P],rt=b0()(P).object(),yt=b0()(U).object();if(se<2)return se<1?[]:Fe;var dt={r:(rt.r-yt.r)/(se-1),g:(rt.g-yt.g)/(se-1),b:(rt.b-yt.b)/(se-1)};return E0(new Array(se-2),function(zt,ur){return Fe.push(b0()({r:Lg(rt.r-dt.r*(ur+1),0),g:Lg(rt.g-dt.g*(ur+1),0),b:Lg(rt.b-dt.b*(ur+1),0)}).hex())}),Fe.push(U),Fe};function mg(C){"@babel/helpers - typeof";return mg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},mg(C)}function Zv(C,P,U){return P=Nb(P),P in C?Object.defineProperty(C,P,{value:U,enumerable:!0,configurable:!0,writable:!0}):C[P]=U,C}function Nb(C){var P=zb(C,"string");return mg(P)=="symbol"?P:String(P)}function zb(C,P){if(mg(C)!="object"||!C)return C;var U=C[Symbol.toPrimitive];if(U!==void 0){var se=U.call(C,P||"default");if(mg(se)!="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(C)}var Yg="larkmap-legend-category";function Ub(C){var P=C.labels,U=C.colors,se=C.geometryType,Fe=se===void 0?"circle":se,rt=C.isStrokeColor,yt=C.style,dt=C.className;function zt(pi){return rt?{border:"2px solid ".concat(pi)}:{background:pi}}function ur(pi){return Ze.createElement("div",{className:Ce()(Yg,dt),style:yt},P.map(function(Hi,so){return Ze.createElement("div",{className:"".concat(Yg,"__content"),key:Hi},Ze.createElement("div",{className:Ce()("".concat(Yg,"__content__shape"),Zv({},"".concat(Yg,"__content__").concat(Fe),Fe)),style:zt(pi[so])}),Ze.createElement("div",{className:"".concat(Yg,"labels")},Hi))}))}function on(){if(Array.isArray(U))return ur(U);var pi=kb(U.startColor,U.endColor,P.length);return ur(pi)}return Ze.createElement(on,null)}Ub.defaultProps={geometryType:"circle",isStrokeColor:!1};var Zb=Se(73023);function Vv(C){var P=(0,Ze.useRef)(0),U=(0,hn.CR)((0,Ze.useState)(C),2),se=U[0],Fe=U[1],rt=(0,Ze.useCallback)(function(yt){cancelAnimationFrame(P.current),P.current=requestAnimationFrame(function(){Fe(yt)})},[]);return(0,Oh.Z)(function(){cancelAnimationFrame(P.current)}),[se,rt]}var Vb=Vv,Vy=Se(70941);function jv(C,P){if(Vy.Z){if(!C)return P;var U;return(0,F_.mf)(C)?U=C():"current"in C?U=C.current:U=C,U}}var Hv=Se(41523),jf=function(C){var P=function(U,se,Fe){var rt=(0,Ze.useRef)(!1),yt=(0,Ze.useRef)([]),dt=(0,Ze.useRef)([]),zt=(0,Ze.useRef)();C(function(){var ur,on=Array.isArray(Fe)?Fe:[Fe],pi=on.map(function(Hi){return jv(Hi)});if(!rt.current){rt.current=!0,yt.current=pi,dt.current=se,zt.current=U();return}(pi.length!==yt.current.length||!(0,Hv.Z)(pi,yt.current)||!(0,Hv.Z)(se,dt.current))&&((ur=zt.current)===null||ur===void 0||ur.call(zt),yt.current=pi,dt.current=se,zt.current=U())}),(0,Oh.Z)(function(){var ur;(ur=zt.current)===null||ur===void 0||ur.call(zt),rt.current=!1})};return P},T0=jf,jy=T0(Ze.useEffect),jb=jy,Hb=T0(Ze.useLayoutEffect),A0=Hb,Gv=Vy.Z?A0:jb,Hy=Gv;function Gb(C){var P=(0,hn.CR)(Vb(function(){var Fe=jv(C);return Fe?{width:Fe.clientWidth,height:Fe.clientHeight}:void 0}),2),U=P[0],se=P[1];return Hy(function(){var Fe=jv(C);if(Fe){var rt=new Zb.Z(function(yt){yt.forEach(function(dt){var zt=dt.target,ur=zt.clientWidth,on=zt.clientHeight;se({width:ur,height:on})})});return rt.observe(Fe),function(){rt.disconnect()}}},[],C),U}var C0=Gb,Pm="larkmap-legend-ramp",xE=function(P){var U=P[P.length-1],se=P[0];return Number.isFinite(se)||(se=parseInt(se,10)),Number.isFinite(U)||(U=parseInt(U,10)),[se,U]};function M0(C){var P=C.labels,U=C.labelUnit,se=U===void 0?"":U,Fe=C.colors,rt=P[0]+se,yt=P[P.length-1]+se;return Ze.createElement(Ze.Fragment,null,Ze.createElement("div",{className:"".concat(Pm,"__continuous"),style:{background:"linear-gradient(to right,".concat(Fe,")")}}),Ze.createElement("div",{className:"".concat(Pm,"__continuous-labelbar")},Ze.createElement("span",null,rt),Ze.createElement("span",null,yt)))}function Dg(C){var P=C.labels,U=C.labelUnit,se=U===void 0?"":U,Fe=C.colors,rt=(0,Ze.useRef)(null),yt=C0(rt),dt=(yt==null?void 0:yt.width)/(Fe.length+1),zt=P;if(P.length+1===Fe.length){var ur="< "+P[0],on="\u2265 "+P[P.length-1];zt.unshift(ur),zt.push(on)}var pi=function(so){var uo="".concat(P[so]).concat(se," - ").concat(P[so+1]).concat(se);return uo};return Ze.createElement("div",{className:"".concat(Pm,"__dis-continuous"),ref:rt},Number.isNaN(dt)?null:Ze.createElement(Ze.Fragment,null,Ze.createElement("div",{className:"".concat(Pm,"__dis-continuous__colors"),style:{paddingLeft:dt/2}},Fe==null?void 0:Fe.map(function(Hi,so){return Ze.createElement("div",{key:Hi,title:pi(so),className:"".concat(Pm,"__dis-continuous__color"),style:{background:Hi,width:dt}})})),Ze.createElement("div",{className:"".concat(Pm,"__dis-continuous__labels")},P==null?void 0:P.map(function(Hi){var so=Hi+se;return Ze.createElement("span",{key:Hi,className:"".concat(Pm,"__dis-continuous__label")},so)}))))}function Wb(C){var P=C.isContinuous,U=C.labels,se=C.colors,Fe=C.labelUnit,rt=C.className,yt=C.style;return Ze.createElement("div",{className:Ce()("".concat(Pm),rt),style:yt},P?Ze.createElement(M0,{labels:U,labelUnit:Fe,colors:se}):Ze.createElement(Dg,{labels:U,labelUnit:Fe,colors:se}))}Wb.defaultProps={isContinuous:!1,labelUnit:""};var $g=Se(46236),bE={point:$g.DrawPoint,line:$g.DrawLine,polygon:$g.DrawPolygon,rect:$g.DrawRect,circle:$g.DrawCircle};function Kg(C){"@babel/helpers - typeof";return Kg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},Kg(C)}function Wv(C,P){var U=Object.keys(C);if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(C);P&&(se=se.filter(function(Fe){return Object.getOwnPropertyDescriptor(C,Fe).enumerable})),U.push.apply(U,se)}return U}function Xv(C){for(var P=1;P<arguments.length;P++){var U=arguments[P]!=null?arguments[P]:{};P%2?Wv(Object(U),!0).forEach(function(se){Gy(C,se,U[se])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(U)):Wv(Object(U)).forEach(function(se){Object.defineProperty(C,se,Object.getOwnPropertyDescriptor(U,se))})}return C}function Gy(C,P,U){return P=Wy(P),P in C?Object.defineProperty(C,P,{value:U,enumerable:!0,configurable:!0,writable:!0}):C[P]=U,C}function Wy(C){var P=Xy(C,"string");return Kg(P)=="symbol"?P:String(P)}function Xy(C,P){if(Kg(C)!="object"||!C)return C;var U=C[Symbol.toPrimitive];if(U!==void 0){var se=U.call(C,P||"default");if(Kg(se)!="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(C)}function qv(C,P){return Yy(C)||Yv(C,P)||Xb(C,P)||qy()}function qy(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xb(C,P){if(C){if(typeof C=="string")return Jg(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return Jg(C,P)}}function Jg(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function Yv(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function Yy(C){if(Array.isArray(C))return C}var EE=function(P){var U=useScene(),se=useState(function(){var uo,ei;return(uo=cloneDeep(P==null||(ei=P.options)===null||ei===void 0?void 0:ei.initialData))!==null&&uo!==void 0?uo:[]}),Fe=qv(se,2),rt=Fe[0],yt=Fe[1],dt=useMemo(function(){if(!U)return console.error("useDraw \u53EA\u80FD\u4F7F\u7528\u5728 LarkMap \u5BB9\u5668\u4E2D"),null;var uo=DRAW_TYPE_MAP[P.type],ei=new uo(U,Xv(Xv({},P.options),{},{initialData:cloneDeep(rt)}));return ei},[U,JSON.stringify(omit(P.options,"initialData")),P.type]),zt=useState(dt.isEnable()),ur=qv(zt,2),on=ur[0],pi=ur[1];useEffect(function(){var uo=function(){return pi(!0)},ei=function(){return pi(!1)},ii=function(Li){yt(Li)};return dt==null||dt.setData(rt),dt==null||dt.on(DrawEvent.Enable,uo),dt==null||dt.on(DrawEvent.Disable,ei),dt==null||dt.on(DrawEvent.Change,ii),function(){yt(dt.getData()),dt==null||dt.off(DrawEvent.Enable,uo),dt==null||dt.off(DrawEvent.Disable,ei),dt==null||dt.off(DrawEvent.Change,ii),dt==null||dt.destroy()}},[dt]);var Hi=useCallback(function(uo){dt==null||dt.setData(uo),yt(uo)},[dt]),so=useMemo(function(){return{enable:dt==null?void 0:dt.enable.bind(dt),disable:dt==null?void 0:dt.disable.bind(dt),getDrawData:dt==null?void 0:dt.getData.bind(dt)}},[dt]);return Xv({drawType:P.type,draw:dt,drawData:rt,setDrawData:Hi,isEnable:on},so)};function Qg(C){"@babel/helpers - typeof";return Qg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},Qg(C)}function P0(C,P){return $y(C)||Yb(C,P)||e0(C,P)||qb()}function qb(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e0(C,P){if(C){if(typeof C=="string")return $v(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return $v(C,P)}}function $v(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U<P;U++)se[U]=C[U];return se}function Yb(C,P){var U=C==null?null:typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(U!=null){var se,Fe,rt,yt,dt=[],zt=!0,ur=!1;try{if(rt=(U=U.call(C)).next,P===0){if(Object(U)!==U)return;zt=!1}else for(;!(zt=(se=rt.call(U)).done)&&(dt.push(se.value),dt.length!==P);zt=!0);}catch(on){ur=!0,Fe=on}finally{try{if(!zt&&U.return!=null&&(yt=U.return(),Object(yt)!==yt))return}finally{if(ur)throw Fe}}return dt}}function $y(C){if(Array.isArray(C))return C}function Kv(C,P){var U=Object.keys(C);if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(C);P&&(se=se.filter(function(Fe){return Object.getOwnPropertyDescriptor(C,Fe).enumerable})),U.push.apply(U,se)}return U}function Jv(C){for(var P=1;P<arguments.length;P++){var U=arguments[P]!=null?arguments[P]:{};P%2?Kv(Object(U),!0).forEach(function(se){$b(C,se,U[se])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(U)):Kv(Object(U)).forEach(function(se){Object.defineProperty(C,se,Object.getOwnPropertyDescriptor(U,se))})}return C}function $b(C,P,U){return P=Kb(P),P in C?Object.defineProperty(C,P,{value:U,enumerable:!0,configurable:!0,writable:!0}):C[P]=U,C}function Kb(C){var P=Jb(C,"string");return Qg(P)=="symbol"?P:String(P)}function Jb(C,P){if(Qg(C)!="object"||!C)return C;var U=C[Symbol.toPrimitive];if(U!==void 0){var se=U.call(C,P||"default");if(Qg(se)!="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(C)}var wE=function(P,U){var se=P.point,Fe=P.line,rt=P.polygon,yt=P.rect,dt=P.circle,zt=!!se,ur=!!Fe,on=!!rt,pi=!!yt,Hi=!!dt,so=useCallback(function(aa){return Jv(Jv({},U),aa instanceof Object?aa:{})},[U]),uo=useDraw({type:"point",options:so(se)}),ei=useDraw({type:"line",options:so(Fe)}),ii=useDraw({type:"polygon",options:so(rt)}),_o=useDraw({type:"rect",options:so(yt)}),Li=useDraw({type:"circle",options:so(dt)}),yo=useMemo(function(){return fromPairs(toPairs({point:zt?uo:void 0,line:ur?ei:void 0,polygon:on?ii:void 0,rect:pi?_o:void 0,circle:Hi?Li:void 0}).filter(function(aa){var La=P0(aa,2),hl=La[1];return!!hl}))},[uo,ei,ii,_o,Li,zt,ur,on,pi,Hi]),Ta=useMemo(function(){return fromPairs(toPairs(yo).map(function(aa){var La=P0(aa,2),hl=La[0],As=La[1];return[hl,As.draw]}))},[yo]),Ha=useMemo(function(){return fromPairs(toPairs(yo).map(function(aa){var La=P0(aa,2),hl=La[0],As=La[1];return[hl,As.drawData]}))},[yo]),Ua=useCallback(function(aa){Object.entries(aa).forEach(function(La){var hl,As=P0(La,2),zs=As[0],$s=As[1];(hl=yo[zs])===null||hl===void 0||hl.setDrawData($s)})},[yo]),ma=useMemo(function(){return Object.values(yo).find(function(aa){return aa.isEnable})},[yo]),Zs=useMemo(function(){var aa;return(aa=ma==null?void 0:ma.draw)!==null&&aa!==void 0?aa:null},[ma]),Ts=useCallback(function(aa){Object.values(yo).forEach(function(La){var hl,As;if(La){var zs=typeof aa=="string"?(hl=(As=yo[aa])===null||As===void 0?void 0:As.draw)!==null&&hl!==void 0?hl:null:aa;if(!zs){La.disable();return}var $s=La.isEnable;zs===La.draw?$s||La.enable():$s&&La.disable()}})},[yo]);return{drawMap:Ta,drawGroupData:Ha,setDrawGroupData:Ua,activeDraw:Zs,activeDrawInfo:ma,setActiveDraw:Ts}},SE=function(P){var U=P.scenes,se=P.options;return React.useEffect(function(){var Fe=syncScene(U,se);return Fe},[U,se]),React.createElement(React.Fragment,null)}},47903:function(Zr){Zr.exports=_r;function _r(Ze,M){var R=Ze&&Ze.type,de;if(R==="FeatureCollection")for(de=0;de<Ze.features.length;de++)_r(Ze.features[de],M);else if(R==="GeometryCollection")for(de=0;de<Ze.geometries.length;de++)_r(Ze.geometries[de],M);else if(R==="Feature")_r(Ze.geometry,M);else if(R==="Polygon")Se(Ze.coordinates,M);else if(R==="MultiPolygon")for(de=0;de<Ze.coordinates.length;de++)Se(Ze.coordinates[de],M);return Ze}function Se(Ze,M){if(Ze.length!==0){ve(Ze[0],M);for(var R=1;R<Ze.length;R++)ve(Ze[R],!M)}}function ve(Ze,M){for(var R=0,de=0,be=0,Le=Ze.length,Re=Le-1;be<Le;Re=be++){var Ce=(Ze[be][0]-Ze[Re][0])*(Ze[Re][1]+Ze[be][1]),He=R+Ce;de+=Math.abs(R)>=Math.abs(Ce)?R-He+Ce:Ce-He+R,R=He}R+de>=0!=!!M&&Ze.reverse()}},96542:function(Zr){"use strict";Zr.exports=_r;function _r(Se,ve){this.x=Se,this.y=ve}_r.prototype={clone:function(){return new _r(this.x,this.y)},add:function(Se){return this.clone()._add(Se)},sub:function(Se){return this.clone()._sub(Se)},multByPoint:function(Se){return this.clone()._multByPoint(Se)},divByPoint:function(Se){return this.clone()._divByPoint(Se)},mult:function(Se){return this.clone()._mult(Se)},div:function(Se){return this.clone()._div(Se)},rotate:function(Se){return this.clone()._rotate(Se)},rotateAround:function(Se,ve){return this.clone()._rotateAround(Se,ve)},matMult:function(Se){return this.clone()._matMult(Se)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(Se){return this.x===Se.x&&this.y===Se.y},dist:function(Se){return Math.sqrt(this.distSqr(Se))},distSqr:function(Se){var ve=Se.x-this.x,Ze=Se.y-this.y;return ve*ve+Ze*Ze},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(Se){return Math.atan2(this.y-Se.y,this.x-Se.x)},angleWith:function(Se){return this.angleWithSep(Se.x,Se.y)},angleWithSep:function(Se,ve){return Math.atan2(this.x*ve-this.y*Se,this.x*Se+this.y*ve)},_matMult:function(Se){var ve=Se[0]*this.x+Se[1]*this.y,Ze=Se[2]*this.x+Se[3]*this.y;return this.x=ve,this.y=Ze,this},_add:function(Se){return this.x+=Se.x,this.y+=Se.y,this},_sub:function(Se){return this.x-=Se.x,this.y-=Se.y,this},_mult:function(Se){return this.x*=Se,this.y*=Se,this},_div:function(Se){return this.x/=Se,this.y/=Se,this},_multByPoint:function(Se){return this.x*=Se.x,this.y*=Se.y,this},_divByPoint:function(Se){return this.x/=Se.x,this.y/=Se.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var Se=this.y;return this.y=this.x,this.x=-Se,this},_rotate:function(Se){var ve=Math.cos(Se),Ze=Math.sin(Se),M=ve*this.x-Ze*this.y,R=Ze*this.x+ve*this.y;return this.x=M,this.y=R,this},_rotateAround:function(Se,ve){var Ze=Math.cos(Se),M=Math.sin(Se),R=ve.x+Ze*(this.x-ve.x)-M*(this.y-ve.y),de=ve.y+M*(this.x-ve.x)+Ze*(this.y-ve.y);return this.x=R,this.y=de,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},_r.convert=function(Se){return Se instanceof _r?Se:Array.isArray(Se)?new _r(Se[0],Se[1]):Se}},25865:function(Zr){"use strict";Zr.exports=Se,Zr.exports.default=Se;var _r=1e20;function Se(de,be,Le,Re,Ce,He){this.fontSize=de||24,this.buffer=be===void 0?3:be,this.cutoff=Re||.25,this.fontFamily=Ce||"sans-serif",this.fontWeight=He||"normal",this.radius=Le||8;var Xe=this.size=this.fontSize+this.buffer*2,Ke=Xe+this.buffer*2;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=Xe,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(Ke*Ke),this.gridInner=new Float64Array(Ke*Ke),this.f=new Float64Array(Ke),this.z=new Float64Array(Ke+1),this.v=new Uint16Array(Ke),this.useMetrics=this.ctx.measureText("A").actualBoundingBoxLeft!==void 0,this.middle=Math.round(Xe/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function ve(de,be,Le,Re,Ce,He,Xe){He.fill(_r,0,be*Le),Xe.fill(0,0,be*Le);for(var Ke=(be-Re)/2,Ve=0;Ve<Ce;Ve++)for(var et=0;et<Re;et++){var er=(Ve+Ke)*be+et+Ke,fr=de.data[4*(Ve*Re+et)+3]/255;if(fr===1)He[er]=0,Xe[er]=_r;else if(fr===0)He[er]=_r,Xe[er]=0;else{var Ar=Math.max(0,.5-fr),pn=Math.max(0,fr-.5);He[er]=Ar*Ar,Xe[er]=pn*pn}}}function Ze(de,be,Le,Re,Ce,He,Xe){for(var Ke=0;Ke<be*Le;Ke++){var Ve=Math.sqrt(Re[Ke])-Math.sqrt(Ce[Ke]);de[Ke]=Math.round(255-255*(Ve/He+Xe))}}Se.prototype._draw=function(de,be){var Le=this.ctx.measureText(de),Re=Le.width,Ce=2*this.buffer,He,Xe,Ke,Ve,et,er,fr,Ar;be&&this.useMetrics?(et=Math.floor(Le.actualBoundingBoxAscent),Ar=this.buffer+Math.ceil(Le.actualBoundingBoxAscent),er=this.buffer,fr=this.buffer,Xe=Math.min(this.size,Math.ceil(Le.actualBoundingBoxRight-Le.actualBoundingBoxLeft)),Ve=Math.min(this.size-er,Math.ceil(Le.actualBoundingBoxAscent+Le.actualBoundingBoxDescent)),He=Xe+Ce,Ke=Ve+Ce,this.ctx.textBaseline="alphabetic"):(He=Xe=this.size,Ke=Ve=this.size,et=19*this.fontSize/24,er=fr=0,Ar=this.middle,this.ctx.textBaseline="middle");var pn;Xe&&Ve&&(this.ctx.clearRect(fr,er,Xe,Ve),this.ctx.fillText(de,this.buffer,Ar),pn=this.ctx.getImageData(fr,er,Xe,Ve));var Kn=new Uint8ClampedArray(He*Ke);return ve(pn,He,Ke,Xe,Ve,this.gridOuter,this.gridInner),M(this.gridOuter,He,Ke,this.f,this.v,this.z),M(this.gridInner,He,Ke,this.f,this.v,this.z),Ze(Kn,He,Ke,this.gridOuter,this.gridInner,this.radius,this.cutoff),{data:Kn,metrics:{width:Xe,height:Ve,sdfWidth:He,sdfHeight:Ke,top:et,left:0,advance:Re}}},Se.prototype.draw=function(de){return this._draw(de,!1).data},Se.prototype.drawWithMetrics=function(de){return this._draw(de,!0)};function M(de,be,Le,Re,Ce,He){for(var Xe=0;Xe<be;Xe++)R(de,Xe,be,Le,Re,Ce,He);for(var Ke=0;Ke<Le;Ke++)R(de,Ke*be,1,be,Re,Ce,He)}function R(de,be,Le,Re,Ce,He,Xe){var Ke,Ve,et,er;for(He[0]=0,Xe[0]=-_r,Xe[1]=_r,Ke=0;Ke<Re;Ke++)Ce[Ke]=de[be+Ke*Le];for(Ke=1,Ve=0,et=0;Ke<Re;Ke++){do er=He[Ve],et=(Ce[Ke]-Ce[er]+Ke*Ke-er*er)/(Ke-er)/2;while(et<=Xe[Ve]&&--Ve>-1);Ve++,He[Ve]=Ke,Xe[Ve]=et,Xe[Ve+1]=_r}for(Ke=0,Ve=0;Ke<Re;Ke++){for(;Xe[Ve+1]<Ke;)Ve++;er=He[Ve],de[be+Ke*Le]=Ce[er]+(Ke-er)*(Ke-er)}}},545:function(Zr){Zr.exports=_r;function _r(Se,ve,Ze,M){this.cx=3*Se,this.bx=3*(Ze-Se)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*ve,this.by=3*(M-ve)-this.cy,this.ay=1-this.cy-this.by,this.p1x=Se,this.p1y=M,this.p2x=Ze,this.p2y=M}_r.prototype.sampleCurveX=function(Se){return((this.ax*Se+this.bx)*Se+this.cx)*Se},_r.prototype.sampleCurveY=function(Se){return((this.ay*Se+this.by)*Se+this.cy)*Se},_r.prototype.sampleCurveDerivativeX=function(Se){return(3*this.ax*Se+2*this.bx)*Se+this.cx},_r.prototype.solveCurveX=function(Se,ve){typeof ve=="undefined"&&(ve=1e-6);var Ze,M,R,de,be;for(R=Se,be=0;be<8;be++){if(de=this.sampleCurveX(R)-Se,Math.abs(de)<ve)return R;var Le=this.sampleCurveDerivativeX(R);if(Math.abs(Le)<1e-6)break;R=R-de/Le}if(Ze=0,M=1,R=Se,R<Ze)return Ze;if(R>M)return M;for(;Ze<M;){if(de=this.sampleCurveX(R),Math.abs(de-Se)<ve)return R;Se>de?Ze=R:M=R,R=(M-Ze)*.5+Ze}return R},_r.prototype.solve=function(Se,ve){return this.sampleCurveY(this.solveCurveX(Se,ve))}},99996:function(Zr,_r,Se){Zr.exports.VectorTile=Se(14253),Se(35752),Se(143)},14253:function(Zr,_r,Se){"use strict";var ve=Se(143);Zr.exports=Ze;function Ze(R,de){this.layers=R.readFields(M,{},de)}function M(R,de,be){if(R===3){var Le=new ve(be,be.readVarint()+be.pos);Le.length&&(de[Le.name]=Le)}}},35752:function(Zr,_r,Se){"use strict";var ve=Se(96542);Zr.exports=Ze;function Ze(Le,Re,Ce,He,Xe){this.properties={},this.extent=Ce,this.type=0,this._pbf=Le,this._geometry=-1,this._keys=He,this._values=Xe,Le.readFields(M,this,Re)}function M(Le,Re,Ce){Le==1?Re.id=Ce.readVarint():Le==2?R(Ce,Re):Le==3?Re.type=Ce.readVarint():Le==4&&(Re._geometry=Ce.pos)}function R(Le,Re){for(var Ce=Le.readVarint()+Le.pos;Le.pos<Ce;){var He=Re._keys[Le.readVarint()],Xe=Re._values[Le.readVarint()];Re.properties[He]=Xe}}Ze.types=["Unknown","Point","LineString","Polygon"],Ze.prototype.loadGeometry=function(){var Le=this._pbf;Le.pos=this._geometry;for(var Re=Le.readVarint()+Le.pos,Ce=1,He=0,Xe=0,Ke=0,Ve=[],et;Le.pos<Re;){if(He<=0){var er=Le.readVarint();Ce=er&7,He=er>>3}if(He--,Ce===1||Ce===2)Xe+=Le.readSVarint(),Ke+=Le.readSVarint(),Ce===1&&(et&&Ve.push(et),et=[]),et.push(new ve(Xe,Ke));else if(Ce===7)et&&et.push(et[0].clone());else throw new Error("unknown command "+Ce)}return et&&Ve.push(et),Ve},Ze.prototype.bbox=function(){var Le=this._pbf;Le.pos=this._geometry;for(var Re=Le.readVarint()+Le.pos,Ce=1,He=0,Xe=0,Ke=0,Ve=1/0,et=-1/0,er=1/0,fr=-1/0;Le.pos<Re;){if(He<=0){var Ar=Le.readVarint();Ce=Ar&7,He=Ar>>3}if(He--,Ce===1||Ce===2)Xe+=Le.readSVarint(),Ke+=Le.readSVarint(),Xe<Ve&&(Ve=Xe),Xe>et&&(et=Xe),Ke<er&&(er=Ke),Ke>fr&&(fr=Ke);else if(Ce!==7)throw new Error("unknown command "+Ce)}return[Ve,er,et,fr]},Ze.prototype.toGeoJSON=function(Le,Re,Ce){var He=this.extent*Math.pow(2,Ce),Xe=this.extent*Le,Ke=this.extent*Re,Ve=this.loadGeometry(),et=Ze.types[this.type],er,fr;function Ar(Jn){for(var ki=0;ki<Jn.length;ki++){var pa=Jn[ki],xr=180-(pa.y+Ke)*360/He;Jn[ki]=[(pa.x+Xe)*360/He-180,360/Math.PI*Math.atan(Math.exp(xr*Math.PI/180))-90]}}switch(this.type){case 1:var pn=[];for(er=0;er<Ve.length;er++)pn[er]=Ve[er][0];Ve=pn,Ar(Ve);break;case 2:for(er=0;er<Ve.length;er++)Ar(Ve[er]);break;case 3:for(Ve=de(Ve),er=0;er<Ve.length;er++)for(fr=0;fr<Ve[er].length;fr++)Ar(Ve[er][fr]);break}Ve.length===1?Ve=Ve[0]:et="Multi"+et;var Kn={type:"Feature",geometry:{type:et,coordinates:Ve},properties:this.properties};return"id"in this&&(Kn.id=this.id),Kn};function de(Le){var Re=Le.length;if(Re<=1)return[Le];for(var Ce=[],He,Xe,Ke=0;Ke<Re;Ke++){var Ve=be(Le[Ke]);Ve!==0&&(Xe===void 0&&(Xe=Ve<0),Xe===Ve<0?(He&&Ce.push(He),He=[Le[Ke]]):He.push(Le[Ke]))}return He&&Ce.push(He),Ce}function be(Le){for(var Re=0,Ce=0,He=Le.length,Xe=He-1,Ke,Ve;Ce<He;Xe=Ce++)Ke=Le[Ce],Ve=Le[Xe],Re+=(Ve.x-Ke.x)*(Ke.y+Ve.y);return Re}},143:function(Zr,_r,Se){"use strict";var ve=Se(35752);Zr.exports=Ze;function Ze(de,be){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=de,this._keys=[],this._values=[],this._features=[],de.readFields(M,this,be),this.length=this._features.length}function M(de,be,Le){de===15?be.version=Le.readVarint():de===1?be.name=Le.readString():de===5?be.extent=Le.readVarint():de===2?be._features.push(Le.pos):de===3?be._keys.push(Le.readString()):de===4&&be._values.push(R(Le))}function R(de){for(var be=null,Le=de.readVarint()+de.pos;de.pos<Le;){var Re=de.readVarint()>>3;be=Re===1?de.readString():Re===2?de.readFloat():Re===3?de.readDouble():Re===4?de.readVarint64():Re===5?de.readVarint():Re===6?de.readSVarint():Re===7?de.readBoolean():null}return be}Ze.prototype.feature=function(de){if(de<0||de>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[de];var be=this._pbf.readVarint()+this._pbf.pos;return new ve(this._pbf,be,this.extent,this._keys,this._values)}},20300:function(Zr,_r,Se){"use strict";var ve=Se(56906);Zr.exports=function(R){R=R||{};var de=R.reporter,be=ve.getOption(R,"async",!0),Le=ve.getOption(R,"auto",!0);Le&&!be&&(de&&de.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),be=!0);var Re=Ze(),Ce,He=!1;function Xe(pn,Kn){!He&&Le&&be&&Re.size()===0&&et(),Re.add(pn,Kn)}function Ke(){for(He=!0;Re.size();){var pn=Re;Re=Ze(),pn.process()}He=!1}function Ve(pn){He||(pn===void 0&&(pn=be),Ce&&(fr(Ce),Ce=null),pn?et():Ke())}function et(){Ce=Ar(Ke)}function er(){Re={},batchSize=0,topLevel=0,bottomLevel=0}function fr(pn){var Kn=clearTimeout;return Kn(pn)}function Ar(pn){var Kn=function(Jn){return setTimeout(Jn,0)};return Kn(pn)}return{add:Xe,force:Ve}};function Ze(){var M={},R=0,de=0,be=0;function Le(He,Xe){Xe||(Xe=He,He=0),He>de?de=He:He<be&&(be=He),M[He]||(M[He]=[]),M[He].push(Xe),R++}function Re(){for(var He=be;He<=de;He++)for(var Xe=M[He],Ke=0;Ke<Xe.length;Ke++){var Ve=Xe[Ke];Ve()}}function Ce(){return R}return{add:Le,process:Re,size:Ce}}},56906:function(Zr){"use strict";var _r=Zr.exports={};_r.getOption=Se;function Se(ve,Ze,M){var R=ve[Ze];return R==null&&M!==void 0?M:R}},6636:function(Zr){var _r={utf8:{stringToBytes:function(Se){return _r.bin.stringToBytes(unescape(encodeURIComponent(Se)))},bytesToString:function(Se){return decodeURIComponent(escape(_r.bin.bytesToString(Se)))}},bin:{stringToBytes:function(Se){for(var ve=[],Ze=0;Ze<Se.length;Ze++)ve.push(Se.charCodeAt(Ze)&255);return ve},bytesToString:function(Se){for(var ve=[],Ze=0;Ze<Se.length;Ze++)ve.push(String.fromCharCode(Se[Ze]));return ve.join("")}}};Zr.exports=_r},5101:function(Zr,_r,Se){const ve=Se(99419),Ze={};for(const de of Object.keys(ve))Ze[ve[de]]=de;const M={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Zr.exports=M;for(const de of Object.keys(M)){if(!("channels"in M[de]))throw new Error("missing channels property: "+de);if(!("labels"in M[de]))throw new Error("missing channel labels property: "+de);if(M[de].labels.length!==M[de].channels)throw new Error("channel and label counts mismatch: "+de);const{channels:be,labels:Le}=M[de];delete M[de].channels,delete M[de].labels,Object.defineProperty(M[de],"channels",{value:be}),Object.defineProperty(M[de],"labels",{value:Le})}M.rgb.hsl=function(de){const be=de[0]/255,Le=de[1]/255,Re=de[2]/255,Ce=Math.min(be,Le,Re),He=Math.max(be,Le,Re),Xe=He-Ce;let Ke,Ve;He===Ce?Ke=0:be===He?Ke=(Le-Re)/Xe:Le===He?Ke=2+(Re-be)/Xe:Re===He&&(Ke=4+(be-Le)/Xe),Ke=Math.min(Ke*60,360),Ke<0&&(Ke+=360);const et=(Ce+He)/2;return He===Ce?Ve=0:et<=.5?Ve=Xe/(He+Ce):Ve=Xe/(2-He-Ce),[Ke,Ve*100,et*100]},M.rgb.hsv=function(de){let be,Le,Re,Ce,He;const Xe=de[0]/255,Ke=de[1]/255,Ve=de[2]/255,et=Math.max(Xe,Ke,Ve),er=et-Math.min(Xe,Ke,Ve),fr=function(Ar){return(et-Ar)/6/er+1/2};return er===0?(Ce=0,He=0):(He=er/et,be=fr(Xe),Le=fr(Ke),Re=fr(Ve),Xe===et?Ce=Re-Le:Ke===et?Ce=1/3+be-Re:Ve===et&&(Ce=2/3+Le-be),Ce<0?Ce+=1:Ce>1&&(Ce-=1)),[Ce*360,He*100,et*100]},M.rgb.hwb=function(de){const be=de[0],Le=de[1];let Re=de[2];const Ce=M.rgb.hsl(de)[0],He=1/255*Math.min(be,Math.min(Le,Re));return Re=1-1/255*Math.max(be,Math.max(Le,Re)),[Ce,He*100,Re*100]},M.rgb.cmyk=function(de){const be=de[0]/255,Le=de[1]/255,Re=de[2]/255,Ce=Math.min(1-be,1-Le,1-Re),He=(1-be-Ce)/(1-Ce)||0,Xe=(1-Le-Ce)/(1-Ce)||0,Ke=(1-Re-Ce)/(1-Ce)||0;return[He*100,Xe*100,Ke*100,Ce*100]};function R(de,be){return bp(de[0]-be[0],2)+bp(de[1]-be[1],2)+bp(de[2]-be[2],2)}M.rgb.keyword=function(de){const be=Ze[de];if(be)return be;let Le=1/0,Re;for(const Ce of Object.keys(ve)){const He=ve[Ce],Xe=R(de,He);Xe<Le&&(Le=Xe,Re=Ce)}return Re},M.keyword.rgb=function(de){return ve[de]},M.rgb.xyz=function(de){let be=de[0]/255,Le=de[1]/255,Re=de[2]/255;be=be>.04045?bp((be+.055)/1.055,2.4):be/12.92,Le=Le>.04045?bp((Le+.055)/1.055,2.4):Le/12.92,Re=Re>.04045?bp((Re+.055)/1.055,2.4):Re/12.92;const Ce=be*.4124+Le*.3576+Re*.1805,He=be*.2126+Le*.7152+Re*.0722,Xe=be*.0193+Le*.1192+Re*.9505;return[Ce*100,He*100,Xe*100]},M.rgb.lab=function(de){const be=M.rgb.xyz(de);let Le=be[0],Re=be[1],Ce=be[2];Le/=95.047,Re/=100,Ce/=108.883,Le=Le>.008856?bp(Le,1/3):7.787*Le+16/116,Re=Re>.008856?bp(Re,1/3):7.787*Re+16/116,Ce=Ce>.008856?bp(Ce,1/3):7.787*Ce+16/116;const He=116*Re-16,Xe=500*(Le-Re),Ke=200*(Re-Ce);return[He,Xe,Ke]},M.hsl.rgb=function(de){const be=de[0]/360,Le=de[1]/100,Re=de[2]/100;let Ce,He,Xe;if(Le===0)return Xe=Re*255,[Xe,Xe,Xe];Re<.5?Ce=Re*(1+Le):Ce=Re+Le-Re*Le;const Ke=2*Re-Ce,Ve=[0,0,0];for(let et=0;et<3;et++)He=be+1/3*-(et-1),He<0&&He++,He>1&&He--,6*He<1?Xe=Ke+(Ce-Ke)*6*He:2*He<1?Xe=Ce:3*He<2?Xe=Ke+(Ce-Ke)*(2/3-He)*6:Xe=Ke,Ve[et]=Xe*255;return Ve},M.hsl.hsv=function(de){const be=de[0];let Le=de[1]/100,Re=de[2]/100,Ce=Le;const He=Math.max(Re,.01);Re*=2,Le*=Re<=1?Re:2-Re,Ce*=He<=1?He:2-He;const Xe=(Re+Le)/2,Ke=Re===0?2*Ce/(He+Ce):2*Le/(Re+Le);return[be,Ke*100,Xe*100]},M.hsv.rgb=function(de){const be=de[0]/60,Le=de[1]/100;let Re=de[2]/100;const Ce=Math.floor(be)%6,He=be-Math.floor(be),Xe=255*Re*(1-Le),Ke=255*Re*(1-Le*He),Ve=255*Re*(1-Le*(1-He));switch(Re*=255,Ce){case 0:return[Re,Ve,Xe];case 1:return[Ke,Re,Xe];case 2:return[Xe,Re,Ve];case 3:return[Xe,Ke,Re];case 4:return[Ve,Xe,Re];case 5:return[Re,Xe,Ke]}},M.hsv.hsl=function(de){const be=de[0],Le=de[1]/100,Re=de[2]/100,Ce=Math.max(Re,.01);let He,Xe;Xe=(2-Le)*Re;const Ke=(2-Le)*Ce;return He=Le*Ce,He/=Ke<=1?Ke:2-Ke,He=He||0,Xe/=2,[be,He*100,Xe*100]},M.hwb.rgb=function(de){const be=de[0]/360;let Le=de[1]/100,Re=de[2]/100;const Ce=Le+Re;let He;Ce>1&&(Le/=Ce,Re/=Ce);const Xe=Math.floor(6*be),Ke=1-Re;He=6*be-Xe,Xe&1&&(He=1-He);const Ve=Le+He*(Ke-Le);let et,er,fr;switch(Xe){default:case 6:case 0:et=Ke,er=Ve,fr=Le;break;case 1:et=Ve,er=Ke,fr=Le;break;case 2:et=Le,er=Ke,fr=Ve;break;case 3:et=Le,er=Ve,fr=Ke;break;case 4:et=Ve,er=Le,fr=Ke;break;case 5:et=Ke,er=Le,fr=Ve;break}return[et*255,er*255,fr*255]},M.cmyk.rgb=function(de){const be=de[0]/100,Le=de[1]/100,Re=de[2]/100,Ce=de[3]/100,He=1-Math.min(1,be*(1-Ce)+Ce),Xe=1-Math.min(1,Le*(1-Ce)+Ce),Ke=1-Math.min(1,Re*(1-Ce)+Ce);return[He*255,Xe*255,Ke*255]},M.xyz.rgb=function(de){const be=de[0]/100,Le=de[1]/100,Re=de[2]/100;let Ce,He,Xe;return Ce=be*3.2406+Le*-1.5372+Re*-.4986,He=be*-.9689+Le*1.8758+Re*.0415,Xe=be*.0557+Le*-.204+Re*1.057,Ce=Ce>.0031308?1.055*bp(Ce,1/2.4)-.055:Ce*12.92,He=He>.0031308?1.055*bp(He,1/2.4)-.055:He*12.92,Xe=Xe>.0031308?1.055*bp(Xe,1/2.4)-.055:Xe*12.92,Ce=Math.min(Math.max(0,Ce),1),He=Math.min(Math.max(0,He),1),Xe=Math.min(Math.max(0,Xe),1),[Ce*255,He*255,Xe*255]},M.xyz.lab=function(de){let be=de[0],Le=de[1],Re=de[2];be/=95.047,Le/=100,Re/=108.883,be=be>.008856?bp(be,1/3):7.787*be+16/116,Le=Le>.008856?bp(Le,1/3):7.787*Le+16/116,Re=Re>.008856?bp(Re,1/3):7.787*Re+16/116;const Ce=116*Le-16,He=500*(be-Le),Xe=200*(Le-Re);return[Ce,He,Xe]},M.lab.xyz=function(de){const be=de[0],Le=de[1],Re=de[2];let Ce,He,Xe;He=(be+16)/116,Ce=Le/500+He,Xe=He-Re/200;const Ke=bp(He,3),Ve=bp(Ce,3),et=bp(Xe,3);return He=Ke>.008856?Ke:(He-16/116)/7.787,Ce=Ve>.008856?Ve:(Ce-16/116)/7.787,Xe=et>.008856?et:(Xe-16/116)/7.787,Ce*=95.047,He*=100,Xe*=108.883,[Ce,He,Xe]},M.lab.lch=function(de){const be=de[0],Le=de[1],Re=de[2];let Ce;Ce=Math.atan2(Re,Le)*360/2/Math.PI,Ce<0&&(Ce+=360);const Xe=Math.sqrt(Le*Le+Re*Re);return[be,Xe,Ce]},M.lch.lab=function(de){const be=de[0],Le=de[1],Ce=de[2]/360*2*Math.PI,He=Le*Math.cos(Ce),Xe=Le*Math.sin(Ce);return[be,He,Xe]},M.rgb.ansi16=function(de,be=null){const[Le,Re,Ce]=de;let He=be===null?M.rgb.hsv(de)[2]:be;if(He=Math.round(He/50),He===0)return 30;let Xe=30+(Math.round(Ce/255)<<2|Math.round(Re/255)<<1|Math.round(Le/255));return He===2&&(Xe+=60),Xe},M.hsv.ansi16=function(de){return M.rgb.ansi16(M.hsv.rgb(de),de[2])},M.rgb.ansi256=function(de){const be=de[0],Le=de[1],Re=de[2];return be===Le&&Le===Re?be<8?16:be>248?231:Math.round((be-8)/247*24)+232:16+36*Math.round(be/255*5)+6*Math.round(Le/255*5)+Math.round(Re/255*5)},M.ansi16.rgb=function(de){let be=de%10;if(be===0||be===7)return de>50&&(be+=3.5),be=be/10.5*255,[be,be,be];const Le=(~~(de>50)+1)*.5,Re=(be&1)*Le*255,Ce=(be>>1&1)*Le*255,He=(be>>2&1)*Le*255;return[Re,Ce,He]},M.ansi256.rgb=function(de){if(de>=232){const He=(de-232)*10+8;return[He,He,He]}de-=16;let be;const Le=Math.floor(de/36)/5*255,Re=Math.floor((be=de%36)/6)/5*255,Ce=be%6/5*255;return[Le,Re,Ce]},M.rgb.hex=function(de){const Le=(((Math.round(de[0])&255)<<16)+((Math.round(de[1])&255)<<8)+(Math.round(de[2])&255)).toString(16).toUpperCase();return"000000".substring(Le.length)+Le},M.hex.rgb=function(de){const be=de.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!be)return[0,0,0];let Le=be[0];be[0].length===3&&(Le=Le.split("").map(Ke=>Ke+Ke).join(""));const Re=parseInt(Le,16),Ce=Re>>16&255,He=Re>>8&255,Xe=Re&255;return[Ce,He,Xe]},M.rgb.hcg=function(de){const be=de[0]/255,Le=de[1]/255,Re=de[2]/255,Ce=Math.max(Math.max(be,Le),Re),He=Math.min(Math.min(be,Le),Re),Xe=Ce-He;let Ke,Ve;return Xe<1?Ke=He/(1-Xe):Ke=0,Xe<=0?Ve=0:Ce===be?Ve=(Le-Re)/Xe%6:Ce===Le?Ve=2+(Re-be)/Xe:Ve=4+(be-Le)/Xe,Ve/=6,Ve%=1,[Ve*360,Xe*100,Ke*100]},M.hsl.hcg=function(de){const be=de[1]/100,Le=de[2]/100,Re=Le<.5?2*be*Le:2*be*(1-Le);let Ce=0;return Re<1&&(Ce=(Le-.5*Re)/(1-Re)),[de[0],Re*100,Ce*100]},M.hsv.hcg=function(de){const be=de[1]/100,Le=de[2]/100,Re=be*Le;let Ce=0;return Re<1&&(Ce=(Le-Re)/(1-Re)),[de[0],Re*100,Ce*100]},M.hcg.rgb=function(de){const be=de[0]/360,Le=de[1]/100,Re=de[2]/100;if(Le===0)return[Re*255,Re*255,Re*255];const Ce=[0,0,0],He=be%1*6,Xe=He%1,Ke=1-Xe;let Ve=0;switch(Math.floor(He)){case 0:Ce[0]=1,Ce[1]=Xe,Ce[2]=0;break;case 1:Ce[0]=Ke,Ce[1]=1,Ce[2]=0;break;case 2:Ce[0]=0,Ce[1]=1,Ce[2]=Xe;break;case 3:Ce[0]=0,Ce[1]=Ke,Ce[2]=1;break;case 4:Ce[0]=Xe,Ce[1]=0,Ce[2]=1;break;default:Ce[0]=1,Ce[1]=0,Ce[2]=Ke}return Ve=(1-Le)*Re,[(Le*Ce[0]+Ve)*255,(Le*Ce[1]+Ve)*255,(Le*Ce[2]+Ve)*255]},M.hcg.hsv=function(de){const be=de[1]/100,Le=de[2]/100,Re=be+Le*(1-be);let Ce=0;return Re>0&&(Ce=be/Re),[de[0],Ce*100,Re*100]},M.hcg.hsl=function(de){const be=de[1]/100,Re=de[2]/100*(1-be)+.5*be;let Ce=0;return Re>0&&Re<.5?Ce=be/(2*Re):Re>=.5&&Re<1&&(Ce=be/(2*(1-Re))),[de[0],Ce*100,Re*100]},M.hcg.hwb=function(de){const be=de[1]/100,Le=de[2]/100,Re=be+Le*(1-be);return[de[0],(Re-be)*100,(1-Re)*100]},M.hwb.hcg=function(de){const be=de[1]/100,Re=1-de[2]/100,Ce=Re-be;let He=0;return Ce<1&&(He=(Re-Ce)/(1-Ce)),[de[0],Ce*100,He*100]},M.apple.rgb=function(de){return[de[0]/65535*255,de[1]/65535*255,de[2]/65535*255]},M.rgb.apple=function(de){return[de[0]/255*65535,de[1]/255*65535,de[2]/255*65535]},M.gray.rgb=function(de){return[de[0]/100*255,de[0]/100*255,de[0]/100*255]},M.gray.hsl=function(de){return[0,0,de[0]]},M.gray.hsv=M.gray.hsl,M.gray.hwb=function(de){return[0,100,de[0]]},M.gray.cmyk=function(de){return[0,0,0,de[0]]},M.gray.lab=function(de){return[de[0],0,0]},M.gray.hex=function(de){const be=Math.round(de[0]/100*255)&255,Re=((be<<16)+(be<<8)+be).toString(16).toUpperCase();return"000000".substring(Re.length)+Re},M.rgb.gray=function(de){return[(de[0]+de[1]+de[2])/3/255*100]}},2771:function(Zr,_r,Se){const ve=Se(5101),Ze=Se(3153),M={},R=Object.keys(ve);function de(Le){const Re=function(...Ce){const He=Ce[0];return He==null?He:(He.length>1&&(Ce=He),Le(Ce))};return"conversion"in Le&&(Re.conversion=Le.conversion),Re}function be(Le){const Re=function(...Ce){const He=Ce[0];if(He==null)return He;He.length>1&&(Ce=He);const Xe=Le(Ce);if(typeof Xe=="object")for(let Ke=Xe.length,Ve=0;Ve<Ke;Ve++)Xe[Ve]=Math.round(Xe[Ve]);return Xe};return"conversion"in Le&&(Re.conversion=Le.conversion),Re}R.forEach(Le=>{M[Le]={},Object.defineProperty(M[Le],"channels",{value:ve[Le].channels}),Object.defineProperty(M[Le],"labels",{value:ve[Le].labels});const Re=Ze(Le);Object.keys(Re).forEach(He=>{const Xe=Re[He];M[Le][He]=be(Xe),M[Le][He].raw=de(Xe)})}),Zr.exports=M},3153:function(Zr,_r,Se){const ve=Se(5101);function Ze(){const be={},Le=Object.keys(ve);for(let Re=Le.length,Ce=0;Ce<Re;Ce++)be[Le[Ce]]={distance:-1,parent:null};return be}function M(be){const Le=Ze(),Re=[be];for(Le[be].distance=0;Re.length;){const Ce=Re.pop(),He=Object.keys(ve[Ce]);for(let Xe=He.length,Ke=0;Ke<Xe;Ke++){const Ve=He[Ke],et=Le[Ve];et.distance===-1&&(et.distance=Le[Ce].distance+1,et.parent=Ce,Re.unshift(Ve))}}return Le}function R(be,Le){return function(Re){return Le(be(Re))}}function de(be,Le){const Re=[Le[be].parent,be];let Ce=ve[Le[be].parent][be],He=Le[be].parent;for(;Le[He].parent;)Re.unshift(Le[He].parent),Ce=R(ve[Le[He].parent][He],Ce),He=Le[He].parent;return Ce.conversion=Re,Ce}Zr.exports=function(be){const Le=M(be),Re={},Ce=Object.keys(Le);for(let He=Ce.length,Xe=0;Xe<He;Xe++){const Ke=Ce[Xe];Le[Ke].parent!==null&&(Re[Ke]=de(Ke,Le))}return Re}},22305:function(Zr,_r,Se){const ve=Se(2489),Ze=Se(2771),M=["keyword","gray","hex"],R={};for(const Ve of Object.keys(Ze))R[[...Ze[Ve].labels].sort().join("")]=Ve;const de={};function be(Ve,et){if(!(this instanceof be))return new be(Ve,et);if(et&&et in M&&(et=null),et&&!(et in Ze))throw new Error("Unknown model: "+et);let er,fr;if(Ve==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(Ve instanceof be)this.model=Ve.model,this.color=[...Ve.color],this.valpha=Ve.valpha;else if(typeof Ve=="string"){const Ar=ve.get(Ve);if(Ar===null)throw new Error("Unable to parse color from string: "+Ve);this.model=Ar.model,fr=Ze[this.model].channels,this.color=Ar.value.slice(0,fr),this.valpha=typeof Ar.value[fr]=="number"?Ar.value[fr]:1}else if(Ve.length>0){this.model=et||"rgb",fr=Ze[this.model].channels;const Ar=Array.prototype.slice.call(Ve,0,fr);this.color=Ke(Ar,fr),this.valpha=typeof Ve[fr]=="number"?Ve[fr]:1}else if(typeof Ve=="number")this.model="rgb",this.color=[Ve>>16&255,Ve>>8&255,Ve&255],this.valpha=1;else{this.valpha=1;const Ar=Object.keys(Ve);"alpha"in Ve&&(Ar.splice(Ar.indexOf("alpha"),1),this.valpha=typeof Ve.alpha=="number"?Ve.alpha:0);const pn=Ar.sort().join("");if(!(pn in R))throw new Error("Unable to parse color from object: "+JSON.stringify(Ve));this.model=R[pn];const{labels:Kn}=Ze[this.model],Jn=[];for(er=0;er<Kn.length;er++)Jn.push(Ve[Kn[er]]);this.color=Ke(Jn)}if(de[this.model])for(fr=Ze[this.model].channels,er=0;er<fr;er++){const Ar=de[this.model][er];Ar&&(this.color[er]=Ar(this.color[er]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}be.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(Ve){let et=this.model in ve.to?this:this.rgb();et=et.round(typeof Ve=="number"?Ve:1);const er=et.valpha===1?et.color:[...et.color,this.valpha];return ve.to[et.model](er)},percentString(Ve){const et=this.rgb().round(typeof Ve=="number"?Ve:1),er=et.valpha===1?et.color:[...et.color,this.valpha];return ve.to.rgb.percent(er)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){const Ve={},{channels:et}=Ze[this.model],{labels:er}=Ze[this.model];for(let fr=0;fr<et;fr++)Ve[er[fr]]=this.color[fr];return this.valpha!==1&&(Ve.alpha=this.valpha),Ve},unitArray(){const Ve=this.rgb().color;return Ve[0]/=255,Ve[1]/=255,Ve[2]/=255,this.valpha!==1&&Ve.push(this.valpha),Ve},unitObject(){const Ve=this.rgb().object();return Ve.r/=255,Ve.g/=255,Ve.b/=255,this.valpha!==1&&(Ve.alpha=this.valpha),Ve},round(Ve){return Ve=Math.max(Ve||0,0),new be([...this.color.map(Re(Ve)),this.valpha],this.model)},alpha(Ve){return Ve!==void 0?new be([...this.color,Math.max(0,Math.min(1,Ve))],this.model):this.valpha},red:Ce("rgb",0,He(255)),green:Ce("rgb",1,He(255)),blue:Ce("rgb",2,He(255)),hue:Ce(["hsl","hsv","hsl","hwb","hcg"],0,Ve=>(Ve%360+360)%360),saturationl:Ce("hsl",1,He(100)),lightness:Ce("hsl",2,He(100)),saturationv:Ce("hsv",1,He(100)),value:Ce("hsv",2,He(100)),chroma:Ce("hcg",1,He(100)),gray:Ce("hcg",2,He(100)),white:Ce("hwb",1,He(100)),wblack:Ce("hwb",2,He(100)),cyan:Ce("cmyk",0,He(100)),magenta:Ce("cmyk",1,He(100)),yellow:Ce("cmyk",2,He(100)),black:Ce("cmyk",3,He(100)),x:Ce("xyz",0,He(95.047)),y:Ce("xyz",1,He(100)),z:Ce("xyz",2,He(108.833)),l:Ce("lab",0,He(100)),a:Ce("lab",1),b:Ce("lab",2),keyword(Ve){return Ve!==void 0?new be(Ve):Ze[this.model].keyword(this.color)},hex(Ve){return Ve!==void 0?new be(Ve):ve.to.hex(this.rgb().round().color)},hexa(Ve){if(Ve!==void 0)return new be(Ve);const et=this.rgb().round().color;let er=Math.round(this.valpha*255).toString(16).toUpperCase();return er.length===1&&(er="0"+er),ve.to.hex(et)+er},rgbNumber(){const Ve=this.rgb().color;return(Ve[0]&255)<<16|(Ve[1]&255)<<8|Ve[2]&255},luminosity(){const Ve=this.rgb().color,et=[];for(const[er,fr]of Ve.entries()){const Ar=fr/255;et[er]=Ar<=.04045?Ar/12.92:bp((Ar+.055)/1.055,2.4)}return .2126*et[0]+.7152*et[1]+.0722*et[2]},contrast(Ve){const et=this.luminosity(),er=Ve.luminosity();return et>er?(et+.05)/(er+.05):(er+.05)/(et+.05)},level(Ve){const et=this.contrast(Ve);return et>=7?"AAA":et>=4.5?"AA":""},isDark(){const Ve=this.rgb().color;return(Ve[0]*2126+Ve[1]*7152+Ve[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const Ve=this.rgb();for(let et=0;et<3;et++)Ve.color[et]=255-Ve.color[et];return Ve},lighten(Ve){const et=this.hsl();return et.color[2]+=et.color[2]*Ve,et},darken(Ve){const et=this.hsl();return et.color[2]-=et.color[2]*Ve,et},saturate(Ve){const et=this.hsl();return et.color[1]+=et.color[1]*Ve,et},desaturate(Ve){const et=this.hsl();return et.color[1]-=et.color[1]*Ve,et},whiten(Ve){const et=this.hwb();return et.color[1]+=et.color[1]*Ve,et},blacken(Ve){const et=this.hwb();return et.color[2]+=et.color[2]*Ve,et},grayscale(){const Ve=this.rgb().color,et=Ve[0]*.3+Ve[1]*.59+Ve[2]*.11;return be.rgb(et,et,et)},fade(Ve){return this.alpha(this.valpha-this.valpha*Ve)},opaquer(Ve){return this.alpha(this.valpha+this.valpha*Ve)},rotate(Ve){const et=this.hsl();let er=et.color[0];return er=(er+Ve)%360,er=er<0?360+er:er,et.color[0]=er,et},mix(Ve,et){if(!Ve||!Ve.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof Ve);const er=Ve.rgb(),fr=this.rgb(),Ar=et===void 0?.5:et,pn=2*Ar-1,Kn=er.alpha()-fr.alpha(),Jn=((pn*Kn===-1?pn:(pn+Kn)/(1+pn*Kn))+1)/2,ki=1-Jn;return be.rgb(Jn*er.red()+ki*fr.red(),Jn*er.green()+ki*fr.green(),Jn*er.blue()+ki*fr.blue(),er.alpha()*Ar+fr.alpha()*(1-Ar))}};for(const Ve of Object.keys(Ze)){if(M.includes(Ve))continue;const{channels:et}=Ze[Ve];be.prototype[Ve]=function(...er){return this.model===Ve?new be(this):er.length>0?new be(er,Ve):new be([...Xe(Ze[this.model][Ve].raw(this.color)),this.valpha],Ve)},be[Ve]=function(...er){let fr=er[0];return typeof fr=="number"&&(fr=Ke(er,et)),new be(fr,Ve)}}function Le(Ve,et){return Number(Ve.toFixed(et))}function Re(Ve){return function(et){return Le(et,Ve)}}function Ce(Ve,et,er){Ve=Array.isArray(Ve)?Ve:[Ve];for(const fr of Ve)(de[fr]||(de[fr]=[]))[et]=er;return Ve=Ve[0],function(fr){let Ar;return fr!==void 0?(er&&(fr=er(fr)),Ar=this[Ve](),Ar.color[et]=fr,Ar):(Ar=this[Ve]().color[et],er&&(Ar=er(Ar)),Ar)}}function He(Ve){return function(et){return Math.max(0,Math.min(Ve,et))}}function Xe(Ve){return Array.isArray(Ve)?Ve:[Ve]}function Ke(Ve,et){for(let er=0;er<et;er++)typeof Ve[er]!="number"&&(Ve[er]=0);return Ve}Zr.exports=be},1048:function(Zr){(function(){var _r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Se={rotl:function(ve,Ze){return ve<<Ze|ve>>>32-Ze},rotr:function(ve,Ze){return ve<<32-Ze|ve>>>Ze},endian:function(ve){if(ve.constructor==Number)return Se.rotl(ve,8)&16711935|Se.rotl(ve,24)&4278255360;for(var Ze=0;Ze<ve.length;Ze++)ve[Ze]=Se.endian(ve[Ze]);return ve},randomBytes:function(ve){for(var Ze=[];ve>0;ve--)Ze.push(Math.floor(Math.random()*256));return Ze},bytesToWords:function(ve){for(var Ze=[],M=0,R=0;M<ve.length;M++,R+=8)Ze[R>>>5]|=ve[M]<<24-R%32;return Ze},wordsToBytes:function(ve){for(var Ze=[],M=0;M<ve.length*32;M+=8)Ze.push(ve[M>>>5]>>>24-M%32&255);return Ze},bytesToHex:function(ve){for(var Ze=[],M=0;M<ve.length;M++)Ze.push((ve[M]>>>4).toString(16)),Ze.push((ve[M]&15).toString(16));return Ze.join("")},hexToBytes:function(ve){for(var Ze=[],M=0;M<ve.length;M+=2)Ze.push(parseInt(ve.substr(M,2),16));return Ze},bytesToBase64:function(ve){for(var Ze=[],M=0;M<ve.length;M+=3)for(var R=ve[M]<<16|ve[M+1]<<8|ve[M+2],de=0;de<4;de++)M*8+de*6<=ve.length*8?Ze.push(_r.charAt(R>>>6*(3-de)&63)):Ze.push("=");return Ze.join("")},base64ToBytes:function(ve){ve=ve.replace(/[^A-Z0-9+\/]/ig,"");for(var Ze=[],M=0,R=0;M<ve.length;R=++M%4)R!=0&&Ze.push((_r.indexOf(ve.charAt(M-1))&Math.pow(2,-2*R+8)-1)<<R*2|_r.indexOf(ve.charAt(M))>>>6-R*2);return Ze}};Zr.exports=Se})()},75734:function(Zr){"use strict";Zr.exports=_r,Zr.exports.default=_r;function _r($e,Pt,vt){vt=vt||2;var rr=Pt&&Pt.length,ar=rr?Pt[0]*vt:$e.length,wr=Se($e,0,ar,vt,!0),Cr=[];if(!wr||wr.next===wr.prev)return Cr;var an,yi,li,Uo,vi,bo,So;if(rr&&(wr=Le($e,Pt,wr,vt)),$e.length>80*vt){an=li=$e[0],yi=Uo=$e[1];for(var Xi=vt;Xi<ar;Xi+=vt)vi=$e[Xi],bo=$e[Xi+1],vi<an&&(an=vi),bo<yi&&(yi=bo),vi>li&&(li=vi),bo>Uo&&(Uo=bo);So=Math.max(li-an,Uo-yi),So=So!==0?32767/So:0}return Ze(wr,Cr,vt,an,yi,So,0),Cr}function Se($e,Pt,vt,rr,ar){var wr,Cr;if(ar===Dt($e,Pt,vt,rr)>0)for(wr=Pt;wr<vt;wr+=rr)Cr=rn(wr,$e[wr],$e[wr+1],Cr);else for(wr=vt-rr;wr>=Pt;wr-=rr)Cr=rn(wr,$e[wr],$e[wr+1],Cr);return Cr&&Kn(Cr,Cr.next)&&(jn(Cr),Cr=Cr.next),Cr}function ve($e,Pt){if(!$e)return $e;Pt||(Pt=$e);var vt=$e,rr;do if(rr=!1,!vt.steiner&&(Kn(vt,vt.next)||pn(vt.prev,vt,vt.next)===0)){if(jn(vt),vt=Pt=vt.prev,vt===vt.next)break;rr=!0}else vt=vt.next;while(rr||vt!==Pt);return Pt}function Ze($e,Pt,vt,rr,ar,wr,Cr){if($e){!Cr&&wr&&Ke($e,rr,ar,wr);for(var an=$e,yi,li;$e.prev!==$e.next;){if(yi=$e.prev,li=$e.next,wr?R($e,rr,ar,wr):M($e)){Pt.push(yi.i/vt|0),Pt.push($e.i/vt|0),Pt.push(li.i/vt|0),jn($e),$e=li.next,an=li.next;continue}if($e=li,$e===an){Cr?Cr===1?($e=de(ve($e),Pt,vt),Ze($e,Pt,vt,rr,ar,wr,2)):Cr===2&&be($e,Pt,vt,rr,ar,wr):Ze(ve($e),Pt,vt,rr,ar,wr,1);break}}}}function M($e){var Pt=$e.prev,vt=$e,rr=$e.next;if(pn(Pt,vt,rr)>=0)return!1;for(var ar=Pt.x,wr=vt.x,Cr=rr.x,an=Pt.y,yi=vt.y,li=rr.y,Uo=ar<wr?ar<Cr?ar:Cr:wr<Cr?wr:Cr,vi=an<yi?an<li?an:li:yi<li?yi:li,bo=ar>wr?ar>Cr?ar:Cr:wr>Cr?wr:Cr,So=an>yi?an>li?an:li:yi>li?yi:li,Xi=rr.next;Xi!==Pt;){if(Xi.x>=Uo&&Xi.x<=bo&&Xi.y>=vi&&Xi.y<=So&&fr(ar,an,wr,yi,Cr,li,Xi.x,Xi.y)&&pn(Xi.prev,Xi,Xi.next)>=0)return!1;Xi=Xi.next}return!0}function R($e,Pt,vt,rr){var ar=$e.prev,wr=$e,Cr=$e.next;if(pn(ar,wr,Cr)>=0)return!1;for(var an=ar.x,yi=wr.x,li=Cr.x,Uo=ar.y,vi=wr.y,bo=Cr.y,So=an<yi?an<li?an:li:yi<li?yi:li,Xi=Uo<vi?Uo<bo?Uo:bo:vi<bo?vi:bo,Mi=an>yi?an>li?an:li:yi>li?yi:li,qo=Uo>vi?Uo>bo?Uo:bo:vi>bo?vi:bo,ui=et(So,Xi,Pt,vt,rr),Qi=et(Mi,qo,Pt,vt,rr),Vi=$e.prevZ,Pi=$e.nextZ;Vi&&Vi.z>=ui&&Pi&&Pi.z<=Qi;){if(Vi.x>=So&&Vi.x<=Mi&&Vi.y>=Xi&&Vi.y<=qo&&Vi!==ar&&Vi!==Cr&&fr(an,Uo,yi,vi,li,bo,Vi.x,Vi.y)&&pn(Vi.prev,Vi,Vi.next)>=0||(Vi=Vi.prevZ,Pi.x>=So&&Pi.x<=Mi&&Pi.y>=Xi&&Pi.y<=qo&&Pi!==ar&&Pi!==Cr&&fr(an,Uo,yi,vi,li,bo,Pi.x,Pi.y)&&pn(Pi.prev,Pi,Pi.next)>=0))return!1;Pi=Pi.nextZ}for(;Vi&&Vi.z>=ui;){if(Vi.x>=So&&Vi.x<=Mi&&Vi.y>=Xi&&Vi.y<=qo&&Vi!==ar&&Vi!==Cr&&fr(an,Uo,yi,vi,li,bo,Vi.x,Vi.y)&&pn(Vi.prev,Vi,Vi.next)>=0)return!1;Vi=Vi.prevZ}for(;Pi&&Pi.z<=Qi;){if(Pi.x>=So&&Pi.x<=Mi&&Pi.y>=Xi&&Pi.y<=qo&&Pi!==ar&&Pi!==Cr&&fr(an,Uo,yi,vi,li,bo,Pi.x,Pi.y)&&pn(Pi.prev,Pi,Pi.next)>=0)return!1;Pi=Pi.nextZ}return!0}function de($e,Pt,vt){var rr=$e;do{var ar=rr.prev,wr=rr.next.next;!Kn(ar,wr)&&Jn(ar,rr,rr.next,wr)&&jt(ar,wr)&&jt(wr,ar)&&(Pt.push(ar.i/vt|0),Pt.push(rr.i/vt|0),Pt.push(wr.i/vt|0),jn(rr),jn(rr.next),rr=$e=wr),rr=rr.next}while(rr!==$e);return ve(rr)}function be($e,Pt,vt,rr,ar,wr){var Cr=$e;do{for(var an=Cr.next.next;an!==Cr.prev;){if(Cr.i!==an.i&&Ar(Cr,an)){var yi=gr(Cr,an);Cr=ve(Cr,Cr.next),yi=ve(yi,yi.next),Ze(Cr,Pt,vt,rr,ar,wr,0),Ze(yi,Pt,vt,rr,ar,wr,0);return}an=an.next}Cr=Cr.next}while(Cr!==$e)}function Le($e,Pt,vt,rr){var ar=[],wr,Cr,an,yi,li;for(wr=0,Cr=Pt.length;wr<Cr;wr++)an=Pt[wr]*rr,yi=wr<Cr-1?Pt[wr+1]*rr:$e.length,li=Se($e,an,yi,rr,!1),li===li.next&&(li.steiner=!0),ar.push(er(li));for(ar.sort(Re),wr=0;wr<ar.length;wr++)vt=Ce(ar[wr],vt);return vt}function Re($e,Pt){return $e.x-Pt.x}function Ce($e,Pt){var vt=He($e,Pt);if(!vt)return Pt;var rr=gr(vt,$e);return ve(rr,rr.next),ve(vt,vt.next)}function He($e,Pt){var vt=Pt,rr=$e.x,ar=$e.y,wr=-1/0,Cr;do{if(ar<=vt.y&&ar>=vt.next.y&&vt.next.y!==vt.y){var an=vt.x+(ar-vt.y)*(vt.next.x-vt.x)/(vt.next.y-vt.y);if(an<=rr&&an>wr&&(wr=an,Cr=vt.x<vt.next.x?vt:vt.next,an===rr))return Cr}vt=vt.next}while(vt!==Pt);if(!Cr)return null;var yi=Cr,li=Cr.x,Uo=Cr.y,vi=1/0,bo;vt=Cr;do rr>=vt.x&&vt.x>=li&&rr!==vt.x&&fr(ar<Uo?rr:wr,ar,li,Uo,ar<Uo?wr:rr,ar,vt.x,vt.y)&&(bo=Math.abs(ar-vt.y)/(rr-vt.x),jt(vt,$e)&&(bo<vi||bo===vi&&(vt.x>Cr.x||vt.x===Cr.x&&Xe(Cr,vt)))&&(Cr=vt,vi=bo)),vt=vt.next;while(vt!==yi);return Cr}function Xe($e,Pt){return pn($e.prev,$e,Pt.prev)<0&&pn(Pt.next,$e,$e.next)<0}function Ke($e,Pt,vt,rr){var ar=$e;do ar.z===0&&(ar.z=et(ar.x,ar.y,Pt,vt,rr)),ar.prevZ=ar.prev,ar.nextZ=ar.next,ar=ar.next;while(ar!==$e);ar.prevZ.nextZ=null,ar.prevZ=null,Ve(ar)}function Ve($e){var Pt,vt,rr,ar,wr,Cr,an,yi,li=1;do{for(vt=$e,$e=null,wr=null,Cr=0;vt;){for(Cr++,rr=vt,an=0,Pt=0;Pt<li&&(an++,rr=rr.nextZ,!!rr);Pt++);for(yi=li;an>0||yi>0&&rr;)an!==0&&(yi===0||!rr||vt.z<=rr.z)?(ar=vt,vt=vt.nextZ,an--):(ar=rr,rr=rr.nextZ,yi--),wr?wr.nextZ=ar:$e=ar,ar.prevZ=wr,wr=ar;vt=rr}wr.nextZ=null,li*=2}while(Cr>1);return $e}function et($e,Pt,vt,rr,ar){return $e=($e-vt)*ar|0,Pt=(Pt-rr)*ar|0,$e=($e|$e<<8)&16711935,$e=($e|$e<<4)&252645135,$e=($e|$e<<2)&858993459,$e=($e|$e<<1)&1431655765,Pt=(Pt|Pt<<8)&16711935,Pt=(Pt|Pt<<4)&252645135,Pt=(Pt|Pt<<2)&858993459,Pt=(Pt|Pt<<1)&1431655765,$e|Pt<<1}function er($e){var Pt=$e,vt=$e;do(Pt.x<vt.x||Pt.x===vt.x&&Pt.y<vt.y)&&(vt=Pt),Pt=Pt.next;while(Pt!==$e);return vt}function fr($e,Pt,vt,rr,ar,wr,Cr,an){return(ar-Cr)*(Pt-an)>=($e-Cr)*(wr-an)&&($e-Cr)*(rr-an)>=(vt-Cr)*(Pt-an)&&(vt-Cr)*(wr-an)>=(ar-Cr)*(rr-an)}function Ar($e,Pt){return $e.next.i!==Pt.i&&$e.prev.i!==Pt.i&&!xr($e,Pt)&&(jt($e,Pt)&&jt(Pt,$e)&&Jr($e,Pt)&&(pn($e.prev,$e,Pt.prev)||pn($e,Pt.prev,Pt))||Kn($e,Pt)&&pn($e.prev,$e,$e.next)>0&&pn(Pt.prev,Pt,Pt.next)>0)}function pn($e,Pt,vt){return(Pt.y-$e.y)*(vt.x-Pt.x)-(Pt.x-$e.x)*(vt.y-Pt.y)}function Kn($e,Pt){return $e.x===Pt.x&&$e.y===Pt.y}function Jn($e,Pt,vt,rr){var ar=pa(pn($e,Pt,vt)),wr=pa(pn($e,Pt,rr)),Cr=pa(pn(vt,rr,$e)),an=pa(pn(vt,rr,Pt));return!!(ar!==wr&&Cr!==an||ar===0&&ki($e,vt,Pt)||wr===0&&ki($e,rr,Pt)||Cr===0&&ki(vt,$e,rr)||an===0&&ki(vt,Pt,rr))}function ki($e,Pt,vt){return Pt.x<=Math.max($e.x,vt.x)&&Pt.x>=Math.min($e.x,vt.x)&&Pt.y<=Math.max($e.y,vt.y)&&Pt.y>=Math.min($e.y,vt.y)}function pa($e){return $e>0?1:$e<0?-1:0}function xr($e,Pt){var vt=$e;do{if(vt.i!==$e.i&&vt.next.i!==$e.i&&vt.i!==Pt.i&&vt.next.i!==Pt.i&&Jn(vt,vt.next,$e,Pt))return!0;vt=vt.next}while(vt!==$e);return!1}function jt($e,Pt){return pn($e.prev,$e,$e.next)<0?pn($e,Pt,$e.next)>=0&&pn($e,$e.prev,Pt)>=0:pn($e,Pt,$e.prev)<0||pn($e,$e.next,Pt)<0}function Jr($e,Pt){var vt=$e,rr=!1,ar=($e.x+Pt.x)/2,wr=($e.y+Pt.y)/2;do vt.y>wr!=vt.next.y>wr&&vt.next.y!==vt.y&&ar<(vt.next.x-vt.x)*(wr-vt.y)/(vt.next.y-vt.y)+vt.x&&(rr=!rr),vt=vt.next;while(vt!==$e);return rr}function gr($e,Pt){var vt=new qe($e.i,$e.x,$e.y),rr=new qe(Pt.i,Pt.x,Pt.y),ar=$e.next,wr=Pt.prev;return $e.next=Pt,Pt.prev=$e,vt.next=ar,ar.prev=vt,rr.next=vt,vt.prev=rr,wr.next=rr,rr.prev=wr,rr}function rn($e,Pt,vt,rr){var ar=new qe($e,Pt,vt);return rr?(ar.next=rr.next,ar.prev=rr,rr.next.prev=ar,rr.next=ar):(ar.prev=ar,ar.next=ar),ar}function jn($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 qe($e,Pt,vt){this.i=$e,this.x=Pt,this.y=vt,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}_r.deviation=function($e,Pt,vt,rr){var ar=Pt&&Pt.length,wr=ar?Pt[0]*vt:$e.length,Cr=Math.abs(Dt($e,0,wr,vt));if(ar)for(var an=0,yi=Pt.length;an<yi;an++){var li=Pt[an]*vt,Uo=an<yi-1?Pt[an+1]*vt:$e.length;Cr-=Math.abs(Dt($e,li,Uo,vt))}var vi=0;for(an=0;an<rr.length;an+=3){var bo=rr[an]*vt,So=rr[an+1]*vt,Xi=rr[an+2]*vt;vi+=Math.abs(($e[bo]-$e[Xi])*($e[So+1]-$e[bo+1])-($e[bo]-$e[So])*($e[Xi+1]-$e[bo+1]))}return Cr===0&&vi===0?0:Math.abs((vi-Cr)/Cr)};function Dt($e,Pt,vt,rr){for(var ar=0,wr=Pt,Cr=vt-rr;wr<vt;wr+=rr)ar+=($e[Cr]-$e[wr])*($e[wr+1]+$e[Cr+1]),Cr=wr;return ar}_r.flatten=function($e){for(var Pt=$e[0][0].length,vt={vertices:[],holes:[],dimensions:Pt},rr=0,ar=0;ar<$e.length;ar++){for(var wr=0;wr<$e[ar].length;wr++)for(var Cr=0;Cr<Pt;Cr++)vt.vertices.push($e[ar][wr][Cr]);ar>0&&(rr+=$e[ar-1].length,vt.holes.push(rr))}return vt}},91895:function(Zr){"use strict";var _r=Zr.exports={};_r.isIE=function(Se){function ve(){var M=navigator.userAgent.toLowerCase();return M.indexOf("msie")!==-1||M.indexOf("trident")!==-1||M.indexOf(" edge/")!==-1}if(!ve())return!1;if(!Se)return!0;var Ze=function(){var M,R=3,de=document.createElement("div"),be=de.getElementsByTagName("i");do de.innerHTML="<!--[if gt IE "+ ++R+"]><i></i><![endif]-->";while(be[0]);return R>4?R:M}();return Se===Ze},_r.isLegacyOpera=function(){return!!window.opera}},10219:function(Zr){"use strict";var _r=Zr.exports={};_r.forEach=function(Se,ve){for(var Ze=0;Ze<Se.length;Ze++){var M=ve(Se[Ze]);if(M)return M}}},90153:function(Zr,_r,Se){"use strict";var ve=Se(91895);Zr.exports=function(Ze){Ze=Ze||{};var M=Ze.reporter,R=Ze.batchProcessor,de=Ze.stateHandler.getState;if(!M)throw new Error("Missing required dependency: reporter.");function be(Xe,Ke){function Ve(){Ke(Xe)}if(ve.isIE(8))de(Xe).object={proxy:Ve},Xe.attachEvent("onresize",Ve);else{var et=Ce(Xe);if(!et)throw new Error("Element is not detectable by this strategy.");et.contentDocument.defaultView.addEventListener("resize",Ve)}}function Le(Xe){var Ke=Ze.important?" !important; ":"; ";return(Xe.join(Ke)+Ke).trim()}function Re(Xe,Ke,Ve){Ve||(Ve=Ke,Ke=Xe,Xe=null),Xe=Xe||{};var et=Xe.debug;function er(fr,Ar){var pn=Le(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),Kn=!1,Jn=window.getComputedStyle(fr),ki=fr.offsetWidth,pa=fr.offsetHeight;de(fr).startSize={width:ki,height:pa};function xr(){function jt(){if(Jn.position==="static"){fr.style.setProperty("position","relative",Xe.important?"important":"");var rn=function(jn,qe,Dt,$e){function Pt(rr){return rr.replace(/[^-\d\.]/g,"")}var vt=Dt[$e];vt!=="auto"&&Pt(vt)!=="0"&&(jn.warn("An element that is positioned static has style."+$e+"="+vt+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+$e+" will be set to 0. Element: ",qe),qe.style.setProperty($e,"0",Xe.important?"important":""))};rn(M,fr,Jn,"top"),rn(M,fr,Jn,"right"),rn(M,fr,Jn,"bottom"),rn(M,fr,Jn,"left")}}function Jr(){Kn||jt();function rn(qe,Dt){if(!qe.contentDocument){var $e=de(qe);$e.checkForObjectDocumentTimeoutId&&window.clearTimeout($e.checkForObjectDocumentTimeoutId),$e.checkForObjectDocumentTimeoutId=setTimeout(function(){$e.checkForObjectDocumentTimeoutId=0,rn(qe,Dt)},100);return}Dt(qe.contentDocument)}var jn=this;rn(jn,function(Dt){Ar(fr)})}Jn.position!==""&&(jt(Jn),Kn=!0);var gr=document.createElement("object");gr.style.cssText=pn,gr.tabIndex=-1,gr.type="text/html",gr.setAttribute("aria-hidden","true"),gr.onload=Jr,ve.isIE()||(gr.data="about:blank"),de(fr)&&(fr.appendChild(gr),de(fr).object=gr,ve.isIE()&&(gr.data="about:blank"))}R?R.add(xr):xr()}ve.isIE(8)?Ve(Ke):er(Ke,Ve)}function Ce(Xe){return de(Xe).object}function He(Xe){if(de(Xe)){var Ke=Ce(Xe);Ke&&(ve.isIE(8)?Xe.detachEvent("onresize",Ke.proxy):Xe.removeChild(Ke),de(Xe).checkForObjectDocumentTimeoutId&&window.clearTimeout(de(Xe).checkForObjectDocumentTimeoutId),delete de(Xe).object)}}return{makeDetectable:Re,addListener:be,uninstall:He}}},21762:function(Zr,_r,Se){"use strict";var ve=Se(10219).forEach;Zr.exports=function(Ze){Ze=Ze||{};var M=Ze.reporter,R=Ze.batchProcessor,de=Ze.stateHandler.getState,be=Ze.stateHandler.hasState,Le=Ze.idHandler;if(!R)throw new Error("Missing required dependency: batchProcessor");if(!M)throw new Error("Missing required dependency: reporter.");var Re=Ve(),Ce="erd_scroll_detection_scrollbar_style",He="erd_scroll_detection_container";function Xe(xr){et(xr,Ce,He)}Xe(window.document);function Ke(xr){var jt=Ze.important?" !important; ":"; ";return(xr.join(jt)+jt).trim()}function Ve(){var xr=500,jt=500,Jr=document.createElement("div");Jr.style.cssText=Ke(["position: absolute","width: "+xr*2+"px","height: "+jt*2+"px","visibility: hidden","margin: 0","padding: 0"]);var gr=document.createElement("div");gr.style.cssText=Ke(["position: absolute","width: "+xr+"px","height: "+jt+"px","overflow: scroll","visibility: none","top: "+-xr*3+"px","left: "+-jt*3+"px","visibility: hidden","margin: 0","padding: 0"]),gr.appendChild(Jr),document.body.insertBefore(gr,document.body.firstChild);var rn=xr-gr.clientWidth,jn=jt-gr.clientHeight;return document.body.removeChild(gr),{width:rn,height:jn}}function et(xr,jt,Jr){function gr(Dt,$e){$e=$e||function(vt){xr.head.appendChild(vt)};var Pt=xr.createElement("style");return Pt.innerHTML=Dt,Pt.id=jt,$e(Pt),Pt}if(!xr.getElementById(jt)){var rn=Jr+"_animation",jn=Jr+"_animation_active",qe=`/* Created by the element-resize-detector library. */
`;qe+="."+Jr+" > div::-webkit-scrollbar { "+Ke(["display: none"])+` }
`,qe+="."+jn+" { "+Ke(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+rn,"animation-name: "+rn])+` }
`,qe+="@-webkit-keyframes "+rn+` { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }
`,qe+="@keyframes "+rn+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }",gr(qe)}}function er(xr){xr.className+=" "+He+"_animation_active"}function fr(xr,jt,Jr){if(xr.addEventListener)xr.addEventListener(jt,Jr);else if(xr.attachEvent)xr.attachEvent("on"+jt,Jr);else return M.error("[scroll] Don't know how to add event listeners.")}function Ar(xr,jt,Jr){if(xr.removeEventListener)xr.removeEventListener(jt,Jr);else if(xr.detachEvent)xr.detachEvent("on"+jt,Jr);else return M.error("[scroll] Don't know how to remove event listeners.")}function pn(xr){return de(xr).container.childNodes[0].childNodes[0].childNodes[0]}function Kn(xr){return de(xr).container.childNodes[0].childNodes[0].childNodes[1]}function Jn(xr,jt){var Jr=de(xr).listeners;if(!Jr.push)throw new Error("Cannot add listener to an element that is not detectable.");de(xr).listeners.push(jt)}function ki(xr,jt,Jr){Jr||(Jr=jt,jt=xr,xr=null),xr=xr||{};function gr(){if(xr.debug){var ui=Array.prototype.slice.call(arguments);if(ui.unshift(Le.get(jt),"Scroll: "),M.log.apply)M.log.apply(null,ui);else for(var Qi=0;Qi<ui.length;Qi++)M.log(ui[Qi])}}function rn(ui){function Qi(Vi){var Pi=Vi.getRootNode&&Vi.getRootNode().contains(Vi);return Vi===Vi.ownerDocument.body||Vi.ownerDocument.body.contains(Vi)||Pi}return!Qi(ui)||window.getComputedStyle(ui)===null}function jn(ui){var Qi=de(ui).container.childNodes[0],Vi=window.getComputedStyle(Qi);return!Vi.width||Vi.width.indexOf("px")===-1}function qe(){var ui=window.getComputedStyle(jt),Qi={};return Qi.position=ui.position,Qi.width=jt.offsetWidth,Qi.height=jt.offsetHeight,Qi.top=ui.top,Qi.right=ui.right,Qi.bottom=ui.bottom,Qi.left=ui.left,Qi.widthCSS=ui.width,Qi.heightCSS=ui.height,Qi}function Dt(){var ui=qe();de(jt).startSize={width:ui.width,height:ui.height},gr("Element start size",de(jt).startSize)}function $e(){de(jt).listeners=[]}function Pt(){if(gr("storeStyle invoked."),!de(jt)){gr("Aborting because element has been uninstalled");return}var ui=qe();de(jt).style=ui}function vt(ui,Qi,Vi){de(ui).lastWidth=Qi,de(ui).lastHeight=Vi}function rr(ui){return pn(ui).childNodes[0]}function ar(){return 2*Re.width+1}function wr(){return 2*Re.height+1}function Cr(ui){return ui+10+ar()}function an(ui){return ui+10+wr()}function yi(ui){return ui*2+ar()}function li(ui){return ui*2+wr()}function Uo(ui,Qi,Vi){var Pi=pn(ui),ds=Kn(ui),Ur=Cr(Qi),ls=an(Vi),dr=yi(Qi),he=li(Vi);Pi.scrollLeft=Ur,Pi.scrollTop=ls,ds.scrollLeft=dr,ds.scrollTop=he}function vi(){var ui=de(jt).container;if(!ui){ui=document.createElement("div"),ui.className=He,ui.style.cssText=Ke(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),de(jt).container=ui,er(ui),jt.appendChild(ui);var Qi=function(){de(jt).onRendered&&de(jt).onRendered()};fr(ui,"animationstart",Qi),de(jt).onAnimationStart=Qi}return ui}function bo(){function ui(){var Ti=de(jt).style;if(Ti.position==="static"){jt.style.setProperty("position","relative",xr.important?"important":"");var Lo=function(wa,dn,co,no){function Za(Ji){return Ji.replace(/[^-\d\.]/g,"")}var ms=co[no];ms!=="auto"&&Za(ms)!=="0"&&(wa.warn("An element that is positioned static has style."+no+"="+ms+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+no+" will be set to 0. Element: ",dn),dn.style[no]=0)};Lo(M,jt,Ti,"top"),Lo(M,jt,Ti,"right"),Lo(M,jt,Ti,"bottom"),Lo(M,jt,Ti,"left")}}function Qi(Ti,Lo,wa,dn){return Ti=Ti?Ti+"px":"0",Lo=Lo?Lo+"px":"0",wa=wa?wa+"px":"0",dn=dn?dn+"px":"0",["left: "+Ti,"top: "+Lo,"right: "+dn,"bottom: "+wa]}if(gr("Injecting elements"),!de(jt)){gr("Aborting because element has been uninstalled");return}ui();var Vi=de(jt).container;Vi||(Vi=vi());var Pi=Re.width,ds=Re.height,Ur=Ke(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),ls=Ke(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(Qi(-(1+Pi),-(1+ds),-ds,-Pi))),dr=Ke(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),he=Ke(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),We=Ke(["position: absolute","left: 0","top: 0"]),at=Ke(["position: absolute","width: 200%","height: 200%"]),Ot=document.createElement("div"),or=document.createElement("div"),Wr=document.createElement("div"),In=document.createElement("div"),kn=document.createElement("div"),eo=document.createElement("div");Ot.dir="ltr",Ot.style.cssText=Ur,Ot.className=He,or.className=He,or.style.cssText=ls,Wr.style.cssText=dr,In.style.cssText=We,kn.style.cssText=he,eo.style.cssText=at,Wr.appendChild(In),kn.appendChild(eo),or.appendChild(Wr),or.appendChild(kn),Ot.appendChild(or),Vi.appendChild(Ot);function un(){var Ti=de(jt);Ti&&Ti.onExpand?Ti.onExpand():gr("Aborting expand scroll handler: element has been uninstalled")}function To(){var Ti=de(jt);Ti&&Ti.onShrink?Ti.onShrink():gr("Aborting shrink scroll handler: element has been uninstalled")}fr(Wr,"scroll",un),fr(kn,"scroll",To),de(jt).onExpandScroll=un,de(jt).onShrinkScroll=To}function So(){function ui(dr,he,We){var at=rr(dr),Ot=Cr(he),or=an(We);at.style.setProperty("width",Ot+"px",xr.important?"important":""),at.style.setProperty("height",or+"px",xr.important?"important":"")}function Qi(dr){var he=jt.offsetWidth,We=jt.offsetHeight,at=he!==de(jt).lastWidth||We!==de(jt).lastHeight;gr("Storing current size",he,We),vt(jt,he,We),R.add(0,function(){if(at){if(!de(jt)){gr("Aborting because element has been uninstalled");return}if(!Vi()){gr("Aborting because element container has not been initialized");return}if(xr.debug){var or=jt.offsetWidth,Wr=jt.offsetHeight;(or!==he||Wr!==We)&&M.warn(Le.get(jt),"Scroll: Size changed before updating detector elements.")}ui(jt,he,We)}}),R.add(1,function(){if(!de(jt)){gr("Aborting because element has been uninstalled");return}if(!Vi()){gr("Aborting because element container has not been initialized");return}Uo(jt,he,We)}),at&&dr&&R.add(2,function(){if(!de(jt)){gr("Aborting because element has been uninstalled");return}if(!Vi()){gr("Aborting because element container has not been initialized");return}dr()})}function Vi(){return!!de(jt).container}function Pi(){function dr(){return de(jt).lastNotifiedWidth===void 0}gr("notifyListenersIfNeeded invoked");var he=de(jt);if(dr()&&he.lastWidth===he.startSize.width&&he.lastHeight===he.startSize.height)return gr("Not notifying: Size is the same as the start size, and there has been no notification yet.");if(he.lastWidth===he.lastNotifiedWidth&&he.lastHeight===he.lastNotifiedHeight)return gr("Not notifying: Size already notified");gr("Current size not notified, notifying..."),he.lastNotifiedWidth=he.lastWidth,he.lastNotifiedHeight=he.lastHeight,ve(de(jt).listeners,function(We){We(jt)})}function ds(){if(gr("startanimation triggered."),jn(jt)){gr("Ignoring since element is still unrendered...");return}gr("Element rendered.");var dr=pn(jt),he=Kn(jt);(dr.scrollLeft===0||dr.scrollTop===0||he.scrollLeft===0||he.scrollTop===0)&&(gr("Scrollbars out of sync. Updating detector elements..."),Qi(Pi))}function Ur(){if(gr("Scroll detected."),jn(jt)){gr("Scroll event fired while unrendered. Ignoring...");return}Qi(Pi)}if(gr("registerListenersAndPositionElements invoked."),!de(jt)){gr("Aborting because element has been uninstalled");return}de(jt).onRendered=ds,de(jt).onExpand=Ur,de(jt).onShrink=Ur;var ls=de(jt).style;ui(jt,ls.width,ls.height)}function Xi(){if(gr("finalizeDomMutation invoked."),!de(jt)){gr("Aborting because element has been uninstalled");return}var ui=de(jt).style;vt(jt,ui.width,ui.height),Uo(jt,ui.width,ui.height)}function Mi(){Jr(jt)}function qo(){gr("Installing..."),$e(),Dt(),R.add(0,Pt),R.add(1,bo),R.add(2,So),R.add(3,Xi),R.add(4,Mi)}gr("Making detectable..."),rn(jt)?(gr("Element is detached"),vi(),gr("Waiting until element is attached..."),de(jt).onRendered=function(){gr("Element is now attached"),qo()}):qo()}function pa(xr){var jt=de(xr);jt&&(jt.onExpandScroll&&Ar(pn(xr),"scroll",jt.onExpandScroll),jt.onShrinkScroll&&Ar(Kn(xr),"scroll",jt.onShrinkScroll),jt.onAnimationStart&&Ar(jt.container,"animationstart",jt.onAnimationStart),jt.container&&xr.removeChild(jt.container))}return{makeDetectable:ki,addListener:Jn,uninstall:pa,initDocument:Xe}}},28766:function(Zr,_r,Se){"use strict";var ve=Se(10219).forEach,Ze=Se(12167),M=Se(49315),R=Se(36179),de=Se(49806),be=Se(34880),Le=Se(91895),Re=Se(20300),Ce=Se(55619),He=Se(90153),Xe=Se(21762);function Ke(fr){return Array.isArray(fr)||fr.length!==void 0}function Ve(fr){if(Array.isArray(fr))return fr;var Ar=[];return ve(fr,function(pn){Ar.push(pn)}),Ar}function et(fr){return fr&&fr.nodeType===1}Zr.exports=function(fr){fr=fr||{};var Ar;if(fr.idHandler)Ar={get:function(rr){return fr.idHandler.get(rr,!0)},set:fr.idHandler.set};else{var pn=R(),Kn=de({idGenerator:pn,stateHandler:Ce});Ar=Kn}var Jn=fr.reporter;if(!Jn){var ki=Jn===!1;Jn=be(ki)}var pa=er(fr,"batchProcessor",Re({reporter:Jn})),xr={};xr.callOnAdd=!!er(fr,"callOnAdd",!0),xr.debug=!!er(fr,"debug",!1);var jt=M(Ar),Jr=Ze({stateHandler:Ce}),gr,rn=er(fr,"strategy","object"),jn=er(fr,"important",!1),qe={reporter:Jn,batchProcessor:pa,stateHandler:Ce,idHandler:Ar,important:jn};if(rn==="scroll"&&(Le.isLegacyOpera()?(Jn.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),rn="object"):Le.isIE(9)&&(Jn.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),rn="object")),rn==="scroll")gr=Xe(qe);else if(rn==="object")gr=He(qe);else throw new Error("Invalid strategy name: "+rn);var Dt={};function $e(rr,ar,wr){function Cr(bo){var So=jt.get(bo);ve(So,function(Mi){Mi(bo)})}function an(bo,So,Xi){jt.add(So,Xi),bo&&Xi(So)}if(wr||(wr=ar,ar=rr,rr={}),!ar)throw new Error("At least one element required.");if(!wr)throw new Error("Listener required.");if(et(ar))ar=[ar];else if(Ke(ar))ar=Ve(ar);else return Jn.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");var yi=0,li=er(rr,"callOnAdd",xr.callOnAdd),Uo=er(rr,"onReady",function(){}),vi=er(rr,"debug",xr.debug);ve(ar,function(So){Ce.getState(So)||(Ce.initState(So),Ar.set(So));var Xi=Ar.get(So);if(vi&&Jn.log("Attaching listener to element",Xi,So),!Jr.isDetectable(So)){if(vi&&Jn.log(Xi,"Not detectable."),Jr.isBusy(So)){vi&&Jn.log(Xi,"System busy making it detectable"),an(li,So,wr),Dt[Xi]=Dt[Xi]||[],Dt[Xi].push(function(){yi++,yi===ar.length&&Uo()});return}return vi&&Jn.log(Xi,"Making detectable..."),Jr.markBusy(So,!0),gr.makeDetectable({debug:vi,important:jn},So,function(qo){if(vi&&Jn.log(Xi,"onElementDetectable"),Ce.getState(qo)){Jr.markAsDetectable(qo),Jr.markBusy(qo,!1),gr.addListener(qo,Cr),an(li,qo,wr);var ui=Ce.getState(qo);if(ui&&ui.startSize){var Qi=qo.offsetWidth,Vi=qo.offsetHeight;(ui.startSize.width!==Qi||ui.startSize.height!==Vi)&&Cr(qo)}Dt[Xi]&&ve(Dt[Xi],function(Pi){Pi()})}else vi&&Jn.log(Xi,"Element uninstalled before being detectable.");delete Dt[Xi],yi++,yi===ar.length&&Uo()})}vi&&Jn.log(Xi,"Already detecable, adding listener."),an(li,So,wr),yi++}),yi===ar.length&&Uo()}function Pt(rr){if(!rr)return Jn.error("At least one element is required.");if(et(rr))rr=[rr];else if(Ke(rr))rr=Ve(rr);else return Jn.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");ve(rr,function(ar){jt.removeAllListeners(ar),gr.uninstall(ar),Ce.cleanState(ar)})}function vt(rr){gr.initDocument&&gr.initDocument(rr)}return{listenTo:$e,removeListener:jt.removeListener,removeAllListeners:jt.removeAllListeners,uninstall:Pt,initDocument:vt}};function er(fr,Ar,pn){var Kn=fr[Ar];return Kn==null&&pn!==void 0?pn:Kn}},12167:function(Zr){"use strict";Zr.exports=function(_r){var Se=_r.stateHandler.getState;function ve(de){var be=Se(de);return be&&!!be.isDetectable}function Ze(de){Se(de).isDetectable=!0}function M(de){return!!Se(de).busy}function R(de,be){Se(de).busy=!!be}return{isDetectable:ve,markAsDetectable:Ze,isBusy:M,markBusy:R}}},36179:function(Zr){"use strict";Zr.exports=function(){var _r=1;function Se(){return _r++}return{generate:Se}}},49806:function(Zr){"use strict";Zr.exports=function(_r){var Se=_r.idGenerator,ve=_r.stateHandler.getState;function Ze(R){var de=ve(R);return de&&de.id!==void 0?de.id:null}function M(R){var de=ve(R);if(!de)throw new Error("setId required the element to have a resize detection state.");var be=Se.generate();return de.id=be,be}return{get:Ze,set:M}}},49315:function(Zr){"use strict";Zr.exports=function(_r){var Se={};function ve(de){var be=_r.get(de);return be===void 0?[]:Se[be]||[]}function Ze(de,be){var Le=_r.get(de);Se[Le]||(Se[Le]=[]),Se[Le].push(be)}function M(de,be){for(var Le=ve(de),Re=0,Ce=Le.length;Re<Ce;++Re)if(Le[Re]===be){Le.splice(Re,1);break}}function R(de){var be=ve(de);be&&(be.length=0)}return{get:ve,add:Ze,removeListener:M,removeAllListeners:R}}},34880:function(Zr){"use strict";Zr.exports=function(_r){function Se(){}var ve={log:Se,warn:Se,error:Se};if(!_r&&window.console){var Ze=function(M,R){M[R]=function(){var be=console[R];if(be.apply)be.apply(console,arguments);else for(var Le=0;Le<arguments.length;Le++)be(arguments[Le])}};Ze(ve,"log"),Ze(ve,"warn"),Ze(ve,"error")}return ve}},55619:function(Zr){"use strict";var _r="_erd";function Se(M){return M[_r]={},ve(M)}function ve(M){return M[_r]}function Ze(M){delete M[_r]}Zr.exports={initState:Se,getState:ve,cleanState:Ze}},11312:function(Zr){"use strict";var _r=Object.prototype.hasOwnProperty,Se="~";function ve(){}Object.create&&(ve.prototype=Object.create(null),new ve().__proto__||(Se=!1));function Ze(be,Le,Re){this.fn=be,this.context=Le,this.once=Re||!1}function M(be,Le,Re,Ce,He){if(typeof Re!="function")throw new TypeError("The listener must be a function");var Xe=new Ze(Re,Ce||be,He),Ke=Se?Se+Le:Le;return be._events[Ke]?be._events[Ke].fn?be._events[Ke]=[be._events[Ke],Xe]:be._events[Ke].push(Xe):(be._events[Ke]=Xe,be._eventsCount++),be}function R(be,Le){--be._eventsCount===0?be._events=new ve:delete be._events[Le]}function de(){this._events=new ve,this._eventsCount=0}de.prototype.eventNames=function(){var Le=[],Re,Ce;if(this._eventsCount===0)return Le;for(Ce in Re=this._events)_r.call(Re,Ce)&&Le.push(Se?Ce.slice(1):Ce);return Object.getOwnPropertySymbols?Le.concat(Object.getOwnPropertySymbols(Re)):Le},de.prototype.listeners=function(Le){var Re=Se?Se+Le:Le,Ce=this._events[Re];if(!Ce)return[];if(Ce.fn)return[Ce.fn];for(var He=0,Xe=Ce.length,Ke=new Array(Xe);He<Xe;He++)Ke[He]=Ce[He].fn;return Ke},de.prototype.listenerCount=function(Le){var Re=Se?Se+Le:Le,Ce=this._events[Re];return Ce?Ce.fn?1:Ce.length:0},de.prototype.emit=function(Le,Re,Ce,He,Xe,Ke){var Ve=Se?Se+Le:Le;if(!this._events[Ve])return!1;var et=this._events[Ve],er=arguments.length,fr,Ar;if(et.fn){switch(et.once&&this.removeListener(Le,et.fn,void 0,!0),er){case 1:return et.fn.call(et.context),!0;case 2:return et.fn.call(et.context,Re),!0;case 3:return et.fn.call(et.context,Re,Ce),!0;case 4:return et.fn.call(et.context,Re,Ce,He),!0;case 5:return et.fn.call(et.context,Re,Ce,He,Xe),!0;case 6:return et.fn.call(et.context,Re,Ce,He,Xe,Ke),!0}for(Ar=1,fr=new Array(er-1);Ar<er;Ar++)fr[Ar-1]=arguments[Ar];et.fn.apply(et.context,fr)}else{var pn=et.length,Kn;for(Ar=0;Ar<pn;Ar++)switch(et[Ar].once&&this.removeListener(Le,et[Ar].fn,void 0,!0),er){case 1:et[Ar].fn.call(et[Ar].context);break;case 2:et[Ar].fn.call(et[Ar].context,Re);break;case 3:et[Ar].fn.call(et[Ar].context,Re,Ce);break;case 4:et[Ar].fn.call(et[Ar].context,Re,Ce,He);break;default:if(!fr)for(Kn=1,fr=new Array(er-1);Kn<er;Kn++)fr[Kn-1]=arguments[Kn];et[Ar].fn.apply(et[Ar].context,fr)}}return!0},de.prototype.on=function(Le,Re,Ce){return M(this,Le,Re,Ce,!1)},de.prototype.once=function(Le,Re,Ce){return M(this,Le,Re,Ce,!0)},de.prototype.removeListener=function(Le,Re,Ce,He){var Xe=Se?Se+Le:Le;if(!this._events[Xe])return this;if(!Re)return R(this,Xe),this;var Ke=this._events[Xe];if(Ke.fn)Ke.fn===Re&&(!He||Ke.once)&&(!Ce||Ke.context===Ce)&&R(this,Xe);else{for(var Ve=0,et=[],er=Ke.length;Ve<er;Ve++)(Ke[Ve].fn!==Re||He&&!Ke[Ve].once||Ce&&Ke[Ve].context!==Ce)&&et.push(Ke[Ve]);et.length?this._events[Xe]=et.length===1?et[0]:et:R(this,Xe)}return this},de.prototype.removeAllListeners=function(Le){var Re;return Le?(Re=Se?Se+Le:Le,this._events[Re]&&R(this,Re)):(this._events=new ve,this._eventsCount=0),this},de.prototype.off=de.prototype.removeListener,de.prototype.addListener=de.prototype.on,de.prefixed=Se,de.EventEmitter=de,Zr.exports=de},2337:function(Zr){"use strict";var _r=Object.prototype.hasOwnProperty,Se="~";function ve(){}Object.create&&(ve.prototype=Object.create(null),new ve().__proto__||(Se=!1));function Ze(be,Le,Re){this.fn=be,this.context=Le,this.once=Re||!1}function M(be,Le,Re,Ce,He){if(typeof Re!="function")throw new TypeError("The listener must be a function");var Xe=new Ze(Re,Ce||be,He),Ke=Se?Se+Le:Le;return be._events[Ke]?be._events[Ke].fn?be._events[Ke]=[be._events[Ke],Xe]:be._events[Ke].push(Xe):(be._events[Ke]=Xe,be._eventsCount++),be}function R(be,Le){--be._eventsCount===0?be._events=new ve:delete be._events[Le]}function de(){this._events=new ve,this._eventsCount=0}de.prototype.eventNames=function(){var Le=[],Re,Ce;if(this._eventsCount===0)return Le;for(Ce in Re=this._events)_r.call(Re,Ce)&&Le.push(Se?Ce.slice(1):Ce);return Object.getOwnPropertySymbols?Le.concat(Object.getOwnPropertySymbols(Re)):Le},de.prototype.listeners=function(Le){var Re=Se?Se+Le:Le,Ce=this._events[Re];if(!Ce)return[];if(Ce.fn)return[Ce.fn];for(var He=0,Xe=Ce.length,Ke=new Array(Xe);He<Xe;He++)Ke[He]=Ce[He].fn;return Ke},de.prototype.listenerCount=function(Le){var Re=Se?Se+Le:Le,Ce=this._events[Re];return Ce?Ce.fn?1:Ce.length:0},de.prototype.emit=function(Le,Re,Ce,He,Xe,Ke){var Ve=Se?Se+Le:Le;if(!this._events[Ve])return!1;var et=this._events[Ve],er=arguments.length,fr,Ar;if(et.fn){switch(et.once&&this.removeListener(Le,et.fn,void 0,!0),er){case 1:return et.fn.call(et.context),!0;case 2:return et.fn.call(et.context,Re),!0;case 3:return et.fn.call(et.context,Re,Ce),!0;case 4:return et.fn.call(et.context,Re,Ce,He),!0;case 5:return et.fn.call(et.context,Re,Ce,He,Xe),!0;case 6:return et.fn.call(et.context,Re,Ce,He,Xe,Ke),!0}for(Ar=1,fr=new Array(er-1);Ar<er;Ar++)fr[Ar-1]=arguments[Ar];et.fn.apply(et.context,fr)}else{var pn=et.length,Kn;for(Ar=0;Ar<pn;Ar++)switch(et[Ar].once&&this.removeListener(Le,et[Ar].fn,void 0,!0),er){case 1:et[Ar].fn.call(et[Ar].context);break;case 2:et[Ar].fn.call(et[Ar].context,Re);break;case 3:et[Ar].fn.call(et[Ar].context,Re,Ce);break;case 4:et[Ar].fn.call(et[Ar].context,Re,Ce,He);break;default:if(!fr)for(Kn=1,fr=new Array(er-1);Kn<er;Kn++)fr[Kn-1]=arguments[Kn];et[Ar].fn.apply(et[Ar].context,fr)}}return!0},de.prototype.on=function(Le,Re,Ce){return M(this,Le,Re,Ce,!1)},de.prototype.once=function(Le,Re,Ce){return M(this,Le,Re,Ce,!0)},de.prototype.removeListener=function(Le,Re,Ce,He){var Xe=Se?Se+Le:Le;if(!this._events[Xe])return this;if(!Re)return R(this,Xe),this;var Ke=this._events[Xe];if(Ke.fn)Ke.fn===Re&&(!He||Ke.once)&&(!Ce||Ke.context===Ce)&&R(this,Xe);else{for(var Ve=0,et=[],er=Ke.length;Ve<er;Ve++)(Ke[Ve].fn!==Re||He&&!Ke[Ve].once||Ce&&Ke[Ve].context!==Ce)&&et.push(Ke[Ve]);et.length?this._events[Xe]=et.length===1?et[0]:et:R(this,Xe)}return this},de.prototype.removeAllListeners=function(Le){var Re;return Le?(Re=Se?Se+Le:Le,this._events[Re]&&R(this,Re)):(this._events=new ve,this._eventsCount=0),this},de.prototype.off=de.prototype.removeListener,de.prototype.addListener=de.prototype.on,de.prefixed=Se,de.EventEmitter=de,Zr.exports=de},11553:function(Zr,_r,Se){var ve;(function(Ze,M,R,de){"use strict";var be=["","webkit","Moz","MS","ms","o"],Le=M.createElement("div"),Re="function",Ce=Math.round,He=Math.abs,Xe=Date.now;function Ke(ut,At,ir){return setTimeout(Jn(ut,ir),At)}function Ve(ut,At,ir){return Array.isArray(ut)?(et(ut,ir[At],ir),!0):!1}function et(ut,At,ir){var jr;if(ut)if(ut.forEach)ut.forEach(At,ir);else if(ut.length!==de)for(jr=0;jr<ut.length;)At.call(ir,ut[jr],jr,ut),jr++;else for(jr in ut)ut.hasOwnProperty(jr)&&At.call(ir,ut[jr],jr,ut)}function er(ut,At,ir){var jr="DEPRECATED METHOD: "+At+`
`+ir+` AT
`;return function(){var Dn=new Error("get-stack-trace"),oo=Dn&&Dn.stack?Dn.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Xa=Ze.console&&(Ze.console.warn||Ze.console.log);return Xa&&Xa.call(Ze.console,jr,oo),ut.apply(this,arguments)}}var fr;typeof Object.assign!="function"?fr=function(At){if(At===de||At===null)throw new TypeError("Cannot convert undefined or null to object");for(var ir=Object(At),jr=1;jr<arguments.length;jr++){var Dn=arguments[jr];if(Dn!==de&&Dn!==null)for(var oo in Dn)Dn.hasOwnProperty(oo)&&(ir[oo]=Dn[oo])}return ir}:fr=Object.assign;var Ar=er(function(At,ir,jr){for(var Dn=Object.keys(ir),oo=0;oo<Dn.length;)(!jr||jr&&At[Dn[oo]]===de)&&(At[Dn[oo]]=ir[Dn[oo]]),oo++;return At},"extend","Use `assign`."),pn=er(function(At,ir){return Ar(At,ir,!0)},"merge","Use `assign`.");function Kn(ut,At,ir){var jr=At.prototype,Dn;Dn=ut.prototype=Object.create(jr),Dn.constructor=ut,Dn._super=jr,ir&&fr(Dn,ir)}function Jn(ut,At){return function(){return ut.apply(At,arguments)}}function ki(ut,At){return typeof ut==Re?ut.apply(At&&At[0]||de,At):ut}function pa(ut,At){return ut===de?At:ut}function xr(ut,At,ir){et(rn(At),function(jr){ut.addEventListener(jr,ir,!1)})}function jt(ut,At,ir){et(rn(At),function(jr){ut.removeEventListener(jr,ir,!1)})}function Jr(ut,At){for(;ut;){if(ut==At)return!0;ut=ut.parentNode}return!1}function gr(ut,At){return ut.indexOf(At)>-1}function rn(ut){return ut.trim().split(/\s+/g)}function jn(ut,At,ir){if(ut.indexOf&&!ir)return ut.indexOf(At);for(var jr=0;jr<ut.length;){if(ir&&ut[jr][ir]==At||!ir&&ut[jr]===At)return jr;jr++}return-1}function qe(ut){return Array.prototype.slice.call(ut,0)}function Dt(ut,At,ir){for(var jr=[],Dn=[],oo=0;oo<ut.length;){var Xa=At?ut[oo][At]:ut[oo];jn(Dn,Xa)<0&&jr.push(ut[oo]),Dn[oo]=Xa,oo++}return ir&&(At?jr=jr.sort(function(kl,Il){return kl[At]>Il[At]}):jr=jr.sort()),jr}function $e(ut,At){for(var ir,jr,Dn=At[0].toUpperCase()+At.slice(1),oo=0;oo<be.length;){if(ir=be[oo],jr=ir?ir+Dn:At,jr in ut)return jr;oo++}return de}var Pt=1;function vt(){return Pt++}function rr(ut){var At=ut.ownerDocument||ut;return At.defaultView||At.parentWindow||Ze}var ar=/mobile|tablet|ip(ad|hone|od)|android/i,wr="ontouchstart"in Ze,Cr=$e(Ze,"PointerEvent")!==de,an=wr&&ar.test(navigator.userAgent),yi="touch",li="pen",Uo="mouse",vi="kinect",bo=25,So=1,Xi=2,Mi=4,qo=8,ui=1,Qi=2,Vi=4,Pi=8,ds=16,Ur=Qi|Vi,ls=Pi|ds,dr=Ur|ls,he=["x","y"],We=["clientX","clientY"];function at(ut,At){var ir=this;this.manager=ut,this.callback=At,this.element=ut.element,this.target=ut.options.inputTarget,this.domHandler=function(jr){ki(ut.options.enable,[ut])&&ir.handler(jr)},this.init()}at.prototype={handler:function(){},init:function(){this.evEl&&xr(this.element,this.evEl,this.domHandler),this.evTarget&&xr(this.target,this.evTarget,this.domHandler),this.evWin&&xr(rr(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&jt(this.element,this.evEl,this.domHandler),this.evTarget&&jt(this.target,this.evTarget,this.domHandler),this.evWin&&jt(rr(this.element),this.evWin,this.domHandler)}};function Ot(ut){var At,ir=ut.options.inputClass;return ir?At=ir:Cr?At=le:an?At=wt:wr?At=Sr:At=Ji,new At(ut,or)}function or(ut,At,ir){var jr=ir.pointers.length,Dn=ir.changedPointers.length,oo=At&So&&jr-Dn===0,Xa=At&(Mi|qo)&&jr-Dn===0;ir.isFirst=!!oo,ir.isFinal=!!Xa,oo&&(ut.session={}),ir.eventType=At,Wr(ut,ir),ut.emit("hammer.input",ir),ut.recognize(ir),ut.session.prevInput=ir}function Wr(ut,At){var ir=ut.session,jr=At.pointers,Dn=jr.length;ir.firstInput||(ir.firstInput=eo(At)),Dn>1&&!ir.firstMultiple?ir.firstMultiple=eo(At):Dn===1&&(ir.firstMultiple=!1);var oo=ir.firstInput,Xa=ir.firstMultiple,mn=Xa?Xa.center:oo.center,kl=At.center=un(jr);At.timeStamp=Xe(),At.deltaTime=At.timeStamp-oo.timeStamp,At.angle=wa(mn,kl),At.distance=Lo(mn,kl),In(ir,At),At.offsetDirection=Ti(At.deltaX,At.deltaY);var Il=To(At.deltaTime,At.deltaX,At.deltaY);At.overallVelocityX=Il.x,At.overallVelocityY=Il.y,At.overallVelocity=He(Il.x)>He(Il.y)?Il.x:Il.y,At.scale=Xa?co(Xa.pointers,jr):1,At.rotation=Xa?dn(Xa.pointers,jr):0,At.maxPointers=ir.prevInput?At.pointers.length>ir.prevInput.maxPointers?At.pointers.length:ir.prevInput.maxPointers:At.pointers.length,kn(ir,At);var Ia=ut.element;Jr(At.srcEvent.target,Ia)&&(Ia=At.srcEvent.target),At.target=Ia}function In(ut,At){var ir=At.center,jr=ut.offsetDelta||{},Dn=ut.prevDelta||{},oo=ut.prevInput||{};(At.eventType===So||oo.eventType===Mi)&&(Dn=ut.prevDelta={x:oo.deltaX||0,y:oo.deltaY||0},jr=ut.offsetDelta={x:ir.x,y:ir.y}),At.deltaX=Dn.x+(ir.x-jr.x),At.deltaY=Dn.y+(ir.y-jr.y)}function kn(ut,At){var ir=ut.lastInterval||At,jr=At.timeStamp-ir.timeStamp,Dn,oo,Xa,mn;if(At.eventType!=qo&&(jr>bo||ir.velocity===de)){var kl=At.deltaX-ir.deltaX,Il=At.deltaY-ir.deltaY,Ia=To(jr,kl,Il);oo=Ia.x,Xa=Ia.y,Dn=He(Ia.x)>He(Ia.y)?Ia.x:Ia.y,mn=Ti(kl,Il),ut.lastInterval=At}else Dn=ir.velocity,oo=ir.velocityX,Xa=ir.velocityY,mn=ir.direction;At.velocity=Dn,At.velocityX=oo,At.velocityY=Xa,At.direction=mn}function eo(ut){for(var At=[],ir=0;ir<ut.pointers.length;)At[ir]={clientX:Ce(ut.pointers[ir].clientX),clientY:Ce(ut.pointers[ir].clientY)},ir++;return{timeStamp:Xe(),pointers:At,center:un(At),deltaX:ut.deltaX,deltaY:ut.deltaY}}function un(ut){var At=ut.length;if(At===1)return{x:Ce(ut[0].clientX),y:Ce(ut[0].clientY)};for(var ir=0,jr=0,Dn=0;Dn<At;)ir+=ut[Dn].clientX,jr+=ut[Dn].clientY,Dn++;return{x:Ce(ir/At),y:Ce(jr/At)}}function To(ut,At,ir){return{x:At/ut||0,y:ir/ut||0}}function Ti(ut,At){return ut===At?ui:He(ut)>=He(At)?ut<0?Qi:Vi:At<0?Pi:ds}function Lo(ut,At,ir){ir||(ir=he);var jr=At[ir[0]]-ut[ir[0]],Dn=At[ir[1]]-ut[ir[1]];return Math.sqrt(jr*jr+Dn*Dn)}function wa(ut,At,ir){ir||(ir=he);var jr=At[ir[0]]-ut[ir[0]],Dn=At[ir[1]]-ut[ir[1]];return Math.atan2(Dn,jr)*180/Math.PI}function dn(ut,At){return wa(At[1],At[0],We)+wa(ut[1],ut[0],We)}function co(ut,At){return Lo(At[0],At[1],We)/Lo(ut[0],ut[1],We)}var no={mousedown:So,mousemove:Xi,mouseup:Mi},Za="mousedown",ms="mousemove mouseup";function Ji(){this.evEl=Za,this.evWin=ms,this.pressed=!1,at.apply(this,arguments)}Kn(Ji,at,{handler:function(At){var ir=no[At.type];ir&So&&At.button===0&&(this.pressed=!0),ir&Xi&&At.which!==1&&(ir=Mi),this.pressed&&(ir&Mi&&(this.pressed=!1),this.callback(this.manager,ir,{pointers:[At],changedPointers:[At],pointerType:Uo,srcEvent:At}))}});var Us={pointerdown:So,pointermove:Xi,pointerup:Mi,pointercancel:qo,pointerout:qo},Lt={2:yi,3:li,4:Uo,5:vi},Ne="pointerdown",re="pointermove pointerup pointercancel";Ze.MSPointerEvent&&!Ze.PointerEvent&&(Ne="MSPointerDown",re="MSPointerMove MSPointerUp MSPointerCancel");function le(){this.evEl=Ne,this.evWin=re,at.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}Kn(le,at,{handler:function(At){var ir=this.store,jr=!1,Dn=At.type.toLowerCase().replace("ms",""),oo=Us[Dn],Xa=Lt[At.pointerType]||At.pointerType,mn=Xa==yi,kl=jn(ir,At.pointerId,"pointerId");oo&So&&(At.button===0||mn)?kl<0&&(ir.push(At),kl=ir.length-1):oo&(Mi|qo)&&(jr=!0),!(kl<0)&&(ir[kl]=At,this.callback(this.manager,oo,{pointers:ir,changedPointers:[At],pointerType:Xa,srcEvent:At}),jr&&ir.splice(kl,1))}});var ge={touchstart:So,touchmove:Xi,touchend:Mi,touchcancel:qo},ye="touchstart",ze="touchstart touchmove touchend touchcancel";function je(){this.evTarget=ye,this.evWin=ze,this.started=!1,at.apply(this,arguments)}Kn(je,at,{handler:function(At){var ir=ge[At.type];if(ir===So&&(this.started=!0),!!this.started){var jr=Ue.call(this,At,ir);ir&(Mi|qo)&&jr[0].length-jr[1].length===0&&(this.started=!1),this.callback(this.manager,ir,{pointers:jr[0],changedPointers:jr[1],pointerType:yi,srcEvent:At})}}});function Ue(ut,At){var ir=qe(ut.touches),jr=qe(ut.changedTouches);return At&(Mi|qo)&&(ir=Dt(ir.concat(jr),"identifier",!0)),[ir,jr]}var Ae={touchstart:So,touchmove:Xi,touchend:Mi,touchcancel:qo},Je="touchstart touchmove touchend touchcancel";function wt(){this.evTarget=Je,this.targetIds={},at.apply(this,arguments)}Kn(wt,at,{handler:function(At){var ir=Ae[At.type],jr=Ht.call(this,At,ir);jr&&this.callback(this.manager,ir,{pointers:jr[0],changedPointers:jr[1],pointerType:yi,srcEvent:At})}});function Ht(ut,At){var ir=qe(ut.touches),jr=this.targetIds;if(At&(So|Xi)&&ir.length===1)return jr[ir[0].identifier]=!0,[ir,ir];var Dn,oo,Xa=qe(ut.changedTouches),mn=[],kl=this.target;if(oo=ir.filter(function(Il){return Jr(Il.target,kl)}),At===So)for(Dn=0;Dn<oo.length;)jr[oo[Dn].identifier]=!0,Dn++;for(Dn=0;Dn<Xa.length;)jr[Xa[Dn].identifier]&&mn.push(Xa[Dn]),At&(Mi|qo)&&delete jr[Xa[Dn].identifier],Dn++;if(mn.length)return[Dt(oo.concat(mn),"identifier",!0),mn]}var Fr=2500,mr=25;function Sr(){at.apply(this,arguments);var ut=Jn(this.handler,this);this.touch=new wt(this.manager,ut),this.mouse=new Ji(this.manager,ut),this.primaryTouch=null,this.lastTouches=[]}Kn(Sr,at,{handler:function(At,ir,jr){var Dn=jr.pointerType==yi,oo=jr.pointerType==Uo;if(!(oo&&jr.sourceCapabilities&&jr.sourceCapabilities.firesTouchEvents)){if(Dn)fn.call(this,ir,jr);else if(oo&&Lr.call(this,jr))return;this.callback(At,ir,jr)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function fn(ut,At){ut&So?(this.primaryTouch=At.changedPointers[0].identifier,xn.call(this,At)):ut&(Mi|qo)&&xn.call(this,At)}function xn(ut){var At=ut.changedPointers[0];if(At.identifier===this.primaryTouch){var ir={x:At.clientX,y:At.clientY};this.lastTouches.push(ir);var jr=this.lastTouches,Dn=function(){var oo=jr.indexOf(ir);oo>-1&&jr.splice(oo,1)};setTimeout(Dn,Fr)}}function Lr(ut){for(var At=ut.srcEvent.clientX,ir=ut.srcEvent.clientY,jr=0;jr<this.lastTouches.length;jr++){var Dn=this.lastTouches[jr],oo=Math.abs(At-Dn.x),Xa=Math.abs(ir-Dn.y);if(oo<=mr&&Xa<=mr)return!0}return!1}var Nn=$e(Le.style,"touchAction"),bn=Nn!==de,En="compute",io="auto",On="manipulation",Ao="none",ia="pan-x",Ho="pan-y",Ga=ns();function Wo(ut,At){this.manager=ut,this.set(At)}Wo.prototype={set:function(ut){ut==En&&(ut=this.compute()),bn&&this.manager.element.style&&Ga[ut]&&(this.manager.element.style[Nn]=ut),this.actions=ut.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var ut=[];return et(this.manager.recognizers,function(At){ki(At.options.enable,[At])&&(ut=ut.concat(At.getTouchAction()))}),Hl(ut.join(" "))},preventDefaults:function(ut){var At=ut.srcEvent,ir=ut.offsetDirection;if(this.manager.session.prevented){At.preventDefault();return}var jr=this.actions,Dn=gr(jr,Ao)&&!Ga[Ao],oo=gr(jr,Ho)&&!Ga[Ho],Xa=gr(jr,ia)&&!Ga[ia];if(Dn){var mn=ut.pointers.length===1,kl=ut.distance<2,Il=ut.deltaTime<250;if(mn&&kl&&Il)return}if(!(Xa&&oo)&&(Dn||oo&&ir&Ur||Xa&&ir&ls))return this.preventSrc(At)},preventSrc:function(ut){this.manager.session.prevented=!0,ut.preventDefault()}};function Hl(ut){if(gr(ut,Ao))return Ao;var At=gr(ut,ia),ir=gr(ut,Ho);return At&&ir?Ao:At||ir?At?ia:Ho:gr(ut,On)?On:io}function ns(){if(!bn)return!1;var ut={},At=Ze.CSS&&Ze.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(ir){ut[ir]=At?Ze.CSS.supports("touch-action",ir):!0}),ut}var Yo=1,_a=2,$o=4,Fo=8,us=Fo,xc=16,Ba=32;function Fa(ut){this.options=fr({},this.defaults,ut||{}),this.id=vt(),this.manager=null,this.options.enable=pa(this.options.enable,!0),this.state=Yo,this.simultaneous={},this.requireFail=[]}Fa.prototype={defaults:{},set:function(ut){return fr(this.options,ut),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(ut){if(Ve(ut,"recognizeWith",this))return this;var At=this.simultaneous;return ut=oa(ut,this),At[ut.id]||(At[ut.id]=ut,ut.recognizeWith(this)),this},dropRecognizeWith:function(ut){return Ve(ut,"dropRecognizeWith",this)?this:(ut=oa(ut,this),delete this.simultaneous[ut.id],this)},requireFailure:function(ut){if(Ve(ut,"requireFailure",this))return this;var At=this.requireFail;return ut=oa(ut,this),jn(At,ut)===-1&&(At.push(ut),ut.requireFailure(this)),this},dropRequireFailure:function(ut){if(Ve(ut,"dropRequireFailure",this))return this;ut=oa(ut,this);var At=jn(this.requireFail,ut);return At>-1&&this.requireFail.splice(At,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(ut){return!!this.simultaneous[ut.id]},emit:function(ut){var At=this,ir=this.state;function jr(Dn){At.manager.emit(Dn,ut)}ir<Fo&&jr(At.options.event+sc(ir)),jr(At.options.event),ut.additionalEvent&&jr(ut.additionalEvent),ir>=Fo&&jr(At.options.event+sc(ir))},tryEmit:function(ut){if(this.canEmit())return this.emit(ut);this.state=Ba},canEmit:function(){for(var ut=0;ut<this.requireFail.length;){if(!(this.requireFail[ut].state&(Ba|Yo)))return!1;ut++}return!0},recognize:function(ut){var At=fr({},ut);if(!ki(this.options.enable,[this,At])){this.reset(),this.state=Ba;return}this.state&(us|xc|Ba)&&(this.state=Yo),this.state=this.process(At),this.state&(_a|$o|Fo|xc)&&this.tryEmit(At)},process:function(ut){},getTouchAction:function(){},reset:function(){}};function sc(ut){return ut&xc?"cancel":ut&Fo?"end":ut&$o?"move":ut&_a?"start":""}function Ql(ut){return ut==ds?"down":ut==Pi?"up":ut==Qi?"left":ut==Vi?"right":""}function oa(ut,At){var ir=At.manager;return ir?ir.get(ut):ut}function Zo(){Fa.apply(this,arguments)}Kn(Zo,Fa,{defaults:{pointers:1},attrTest:function(ut){var At=this.options.pointers;return At===0||ut.pointers.length===At},process:function(ut){var At=this.state,ir=ut.eventType,jr=At&(_a|$o),Dn=this.attrTest(ut);return jr&&(ir&qo||!Dn)?At|xc:jr||Dn?ir&Mi?At|Fo:At&_a?At|$o:_a:Ba}});function il(){Zo.apply(this,arguments),this.pX=null,this.pY=null}Kn(il,Zo,{defaults:{event:"pan",threshold:10,pointers:1,direction:dr},getTouchAction:function(){var ut=this.options.direction,At=[];return ut&Ur&&At.push(Ho),ut&ls&&At.push(ia),At},directionTest:function(ut){var At=this.options,ir=!0,jr=ut.distance,Dn=ut.direction,oo=ut.deltaX,Xa=ut.deltaY;return Dn&At.direction||(At.direction&Ur?(Dn=oo===0?ui:oo<0?Qi:Vi,ir=oo!=this.pX,jr=Math.abs(ut.deltaX)):(Dn=Xa===0?ui:Xa<0?Pi:ds,ir=Xa!=this.pY,jr=Math.abs(ut.deltaY))),ut.direction=Dn,ir&&jr>At.threshold&&Dn&At.direction},attrTest:function(ut){return Zo.prototype.attrTest.call(this,ut)&&(this.state&_a||!(this.state&_a)&&this.directionTest(ut))},emit:function(ut){this.pX=ut.deltaX,this.pY=ut.deltaY;var At=Ql(ut.direction);At&&(ut.additionalEvent=this.options.event+At),this._super.emit.call(this,ut)}});function va(){Zo.apply(this,arguments)}Kn(va,Zo,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ao]},attrTest:function(ut){return this._super.attrTest.call(this,ut)&&(Math.abs(ut.scale-1)>this.options.threshold||this.state&_a)},emit:function(ut){if(ut.scale!==1){var At=ut.scale<1?"in":"out";ut.additionalEvent=this.options.event+At}this._super.emit.call(this,ut)}});function El(){Fa.apply(this,arguments),this._timer=null,this._input=null}Kn(El,Fa,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[io]},process:function(ut){var At=this.options,ir=ut.pointers.length===At.pointers,jr=ut.distance<At.threshold,Dn=ut.deltaTime>At.time;if(this._input=ut,!jr||!ir||ut.eventType&(Mi|qo)&&!Dn)this.reset();else if(ut.eventType&So)this.reset(),this._timer=Ke(function(){this.state=us,this.tryEmit()},At.time,this);else if(ut.eventType&Mi)return us;return Ba},reset:function(){clearTimeout(this._timer)},emit:function(ut){this.state===us&&(ut&&ut.eventType&Mi?this.manager.emit(this.options.event+"up",ut):(this._input.timeStamp=Xe(),this.manager.emit(this.options.event,this._input)))}});function Wa(){Zo.apply(this,arguments)}Kn(Wa,Zo,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ao]},attrTest:function(ut){return this._super.attrTest.call(this,ut)&&(Math.abs(ut.rotation)>this.options.threshold||this.state&_a)}});function Ds(){Zo.apply(this,arguments)}Kn(Ds,Zo,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ur|ls,pointers:1},getTouchAction:function(){return il.prototype.getTouchAction.call(this)},attrTest:function(ut){var At=this.options.direction,ir;return At&(Ur|ls)?ir=ut.overallVelocity:At&Ur?ir=ut.overallVelocityX:At&ls&&(ir=ut.overallVelocityY),this._super.attrTest.call(this,ut)&&At&ut.offsetDirection&&ut.distance>this.options.threshold&&ut.maxPointers==this.options.pointers&&He(ir)>this.options.velocity&&ut.eventType&Mi},emit:function(ut){var At=Ql(ut.offsetDirection);At&&this.manager.emit(this.options.event+At,ut),this.manager.emit(this.options.event,ut)}});function Rl(){Fa.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}Kn(Rl,Fa,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[On]},process:function(ut){var At=this.options,ir=ut.pointers.length===At.pointers,jr=ut.distance<At.threshold,Dn=ut.deltaTime<At.time;if(this.reset(),ut.eventType&So&&this.count===0)return this.failTimeout();if(jr&&Dn&&ir){if(ut.eventType!=Mi)return this.failTimeout();var oo=this.pTime?ut.timeStamp-this.pTime<At.interval:!0,Xa=!this.pCenter||Lo(this.pCenter,ut.center)<At.posThreshold;this.pTime=ut.timeStamp,this.pCenter=ut.center,!Xa||!oo?this.count=1:this.count+=1,this._input=ut;var mn=this.count%At.taps;if(mn===0)return this.hasRequireFailures()?(this._timer=Ke(function(){this.state=us,this.tryEmit()},At.interval,this),_a):us}return Ba},failTimeout:function(){return this._timer=Ke(function(){this.state=Ba},this.options.interval,this),Ba},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==us&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function gu(ut,At){return At=At||{},At.recognizers=pa(At.recognizers,gu.defaults.preset),new ol(ut,At)}gu.VERSION="2.0.7",gu.defaults={domEvents:!1,touchAction:En,enable:!0,inputTarget:null,inputClass:null,preset:[[Wa,{enable:!1}],[va,{enable:!1},["rotate"]],[Ds,{direction:Ur}],[il,{direction:Ur},["swipe"]],[Rl],[Rl,{event:"doubletap",taps:2},["tap"]],[El]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var gl=1,wl=2;function ol(ut,At){this.options=fr({},gu.defaults,At||{}),this.options.inputTarget=this.options.inputTarget||ut,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=ut,this.input=Ot(this),this.touchAction=new Wo(this,this.options.touchAction),Qa(this,!0),et(this.options.recognizers,function(ir){var jr=this.add(new ir[0](ir[1]));ir[2]&&jr.recognizeWith(ir[2]),ir[3]&&jr.requireFailure(ir[3])},this)}ol.prototype={set:function(ut){return fr(this.options,ut),ut.touchAction&&this.touchAction.update(),ut.inputTarget&&(this.input.destroy(),this.input.target=ut.inputTarget,this.input.init()),this},stop:function(ut){this.session.stopped=ut?wl:gl},recognize:function(ut){var At=this.session;if(!At.stopped){this.touchAction.preventDefaults(ut);var ir,jr=this.recognizers,Dn=At.curRecognizer;(!Dn||Dn&&Dn.state&us)&&(Dn=At.curRecognizer=null);for(var oo=0;oo<jr.length;)ir=jr[oo],At.stopped!==wl&&(!Dn||ir==Dn||ir.canRecognizeWith(Dn))?ir.recognize(ut):ir.reset(),!Dn&&ir.state&(_a|$o|Fo)&&(Dn=At.curRecognizer=ir),oo++}},get:function(ut){if(ut instanceof Fa)return ut;for(var At=this.recognizers,ir=0;ir<At.length;ir++)if(At[ir].options.event==ut)return At[ir];return null},add:function(ut){if(Ve(ut,"add",this))return this;var At=this.get(ut.options.event);return At&&this.remove(At),this.recognizers.push(ut),ut.manager=this,this.touchAction.update(),ut},remove:function(ut){if(Ve(ut,"remove",this))return this;if(ut=this.get(ut),ut){var At=this.recognizers,ir=jn(At,ut);ir!==-1&&(At.splice(ir,1),this.touchAction.update())}return this},on:function(ut,At){if(ut!==de&&At!==de){var ir=this.handlers;return et(rn(ut),function(jr){ir[jr]=ir[jr]||[],ir[jr].push(At)}),this}},off:function(ut,At){if(ut!==de){var ir=this.handlers;return et(rn(ut),function(jr){At?ir[jr]&&ir[jr].splice(jn(ir[jr],At),1):delete ir[jr]}),this}},emit:function(ut,At){this.options.domEvents&&Gl(ut,At);var ir=this.handlers[ut]&&this.handlers[ut].slice();if(!(!ir||!ir.length)){At.type=ut,At.preventDefault=function(){At.srcEvent.preventDefault()};for(var jr=0;jr<ir.length;)ir[jr](At),jr++}},destroy:function(){this.element&&Qa(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Qa(ut,At){var ir=ut.element;if(ir.style){var jr;et(ut.options.cssProps,function(Dn,oo){jr=$e(ir.style,oo),At?(ut.oldCssProps[jr]=ir.style[jr],ir.style[jr]=Dn):ir.style[jr]=ut.oldCssProps[jr]||""}),At||(ut.oldCssProps={})}}function Gl(ut,At){var ir=M.createEvent("Event");ir.initEvent(ut,!0,!0),ir.gesture=At,At.target.dispatchEvent(ir)}fr(gu,{INPUT_START:So,INPUT_MOVE:Xi,INPUT_END:Mi,INPUT_CANCEL:qo,STATE_POSSIBLE:Yo,STATE_BEGAN:_a,STATE_CHANGED:$o,STATE_ENDED:Fo,STATE_RECOGNIZED:us,STATE_CANCELLED:xc,STATE_FAILED:Ba,DIRECTION_NONE:ui,DIRECTION_LEFT:Qi,DIRECTION_RIGHT:Vi,DIRECTION_UP:Pi,DIRECTION_DOWN:ds,DIRECTION_HORIZONTAL:Ur,DIRECTION_VERTICAL:ls,DIRECTION_ALL:dr,Manager:ol,Input:at,TouchAction:Wo,TouchInput:wt,MouseInput:Ji,PointerEventInput:le,TouchMouseInput:Sr,SingleTouchInput:je,Recognizer:Fa,AttrRecognizer:Zo,Tap:Rl,Pan:il,Swipe:Ds,Pinch:va,Rotate:Wa,Press:El,on:xr,off:jt,each:et,merge:pn,extend:Ar,assign:fr,inherit:Kn,bindFn:Jn,prefixed:$e});var Wl=typeof Ze!="undefined"?Ze:typeof self!="undefined"?self:{};Wl.Hammer=gu,ve=function(){return gu}.call(_r,Se,_r,Zr),ve!==de&&(Zr.exports=ve)})(window,document,"Hammer")},13149:function(Zr){Zr.exports=function(ve){return ve!=null&&(_r(ve)||Se(ve)||!!ve._isBuffer)};function _r(ve){return!!ve.constructor&&typeof ve.constructor.isBuffer=="function"&&ve.constructor.isBuffer(ve)}function Se(ve){return typeof ve.readFloatLE=="function"&&typeof ve.slice=="function"&&_r(ve.slice(0,0))}},45170:function(Zr,_r,Se){var ve=Se(13807);function Ze(M,R){var de=M==null?0:M.length;return!!de&&ve(M,R,0)>-1}Zr.exports=Ze},94936:function(Zr){function _r(Se,ve,Ze){for(var M=-1,R=Se==null?0:Se.length;++M<R;)if(Ze(ve,Se[M]))return!0;return!1}Zr.exports=_r},30695:function(Zr){function _r(Se,ve,Ze,M){var R=-1,de=Se==null?0:Se.length;for(M&&de&&(Ze=Se[++R]);++R<de;)Ze=ve(Ze,Se[R],R,Se);return Ze}Zr.exports=_r},74202:function(Zr){function _r(Se){return Se.split("")}Zr.exports=_r},81034:function(Zr){var _r=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Se(ve){return ve.match(_r)||[]}Zr.exports=Se},54527:function(Zr){function _r(Se,ve,Ze){return Se===Se&&(Ze!==void 0&&(Se=Se<=Ze?Se:Ze),ve!==void 0&&(Se=Se>=ve?Se:ve)),Se}Zr.exports=_r},92504:function(Zr){function _r(Se,ve,Ze,M){for(var R=Se.length,de=Ze+(M?1:-1);M?de--:++de<R;)if(ve(Se[de],de,Se))return de;return-1}Zr.exports=_r},13807:function(Zr,_r,Se){var ve=Se(92504),Ze=Se(99940),M=Se(3729);function R(de,be,Le){return be===be?M(de,be,Le):ve(de,Ze,Le)}Zr.exports=R},70525:function(Zr){function _r(Se,ve,Ze,M){for(var R=Ze-1,de=Se.length;++R<de;)if(M(Se[R],ve))return R;return-1}Zr.exports=_r},99940:function(Zr){function _r(Se){return Se!==Se}Zr.exports=_r},243:function(Zr){function _r(Se){return function(ve){return Se==null?void 0:Se[ve]}}Zr.exports=_r},66868:function(Zr,_r,Se){var ve=Se(75697),Ze=Se(13807),M=Se(70525),R=Se(58792),de=Se(47165),be=Array.prototype,Le=be.splice;function Re(Ce,He,Xe,Ke){var Ve=Ke?M:Ze,et=-1,er=He.length,fr=Ce;for(Ce===He&&(He=de(He)),Xe&&(fr=ve(Ce,R(Xe)));++et<er;)for(var Ar=0,pn=He[et],Kn=Xe?Xe(pn):pn;(Ar=Ve(fr,Kn,Ar,Ke))>-1;)fr!==Ce&&Le.call(fr,Ar,1),Le.call(Ce,Ar,1);return Ce}Zr.exports=Re},43846:function(Zr){function _r(Se,ve,Ze){var M=-1,R=Se.length;ve<0&&(ve=-ve>R?0:R+ve),Ze=Ze>R?R:Ze,Ze<0&&(Ze+=R),R=ve>Ze?0:Ze-ve>>>0,ve>>>=0;for(var de=Array(R);++M<R;)de[M]=Se[M+ve];return de}Zr.exports=_r},95453:function(Zr,_r,Se){var ve=Se(78188),Ze=Se(45170),M=Se(94936),R=Se(29880),de=Se(17319),be=Se(79967),Le=200;function Re(Ce,He,Xe){var Ke=-1,Ve=Ze,et=Ce.length,er=!0,fr=[],Ar=fr;if(Xe)er=!1,Ve=M;else if(et>=Le){var pn=He?null:de(Ce);if(pn)return be(pn);er=!1,Ve=R,Ar=new ve}else Ar=He?[]:fr;e:for(;++Ke<et;){var Kn=Ce[Ke],Jn=He?He(Kn):Kn;if(Kn=Xe||Kn!==0?Kn:0,er&&Jn===Jn){for(var ki=Ar.length;ki--;)if(Ar[ki]===Jn)continue e;He&&Ar.push(Jn),fr.push(Kn)}else Ve(Ar,Jn,Xe)||(Ar!==fr&&Ar.push(Jn),fr.push(Kn))}return fr}Zr.exports=Re},20167:function(Zr,_r,Se){var ve=Se(43846);function Ze(M,R,de){var be=M.length;return de=de===void 0?be:de,!R&&de>=be?M:ve(M,R,de)}Zr.exports=Ze},23684:function(Zr,_r,Se){var ve=Se(20167),Ze=Se(30080),M=Se(30078),R=Se(8389);function de(be){return function(Le){Le=R(Le);var Re=Ze(Le)?M(Le):void 0,Ce=Re?Re[0]:Le.charAt(0),He=Re?ve(Re,1).join(""):Le.slice(1);return Ce[be]()+He}}Zr.exports=de},51471:function(Zr,_r,Se){var ve=Se(30695),Ze=Se(26357),M=Se(71055),R="['\u2019]",de=RegExp(R,"g");function be(Le){return function(Re){return ve(M(Ze(Re).replace(de,"")),Le,"")}}Zr.exports=be},17319:function(Zr,_r,Se){var ve=Se(81956),Ze=Se(43226),M=Se(79967),R=1/0,de=ve&&1/M(new ve([,-0]))[1]==R?function(be){return new ve(be)}:Ze;Zr.exports=de},92523:function(Zr,_r,Se){var ve=Se(243),Ze={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},M=ve(Ze);Zr.exports=M},30080:function(Zr){var _r="\\ud800-\\udfff",Se="\\u0300-\\u036f",ve="\\ufe20-\\ufe2f",Ze="\\u20d0-\\u20ff",M=Se+ve+Ze,R="\\ufe0e\\ufe0f",de="\\u200d",be=RegExp("["+de+_r+M+R+"]");function Le(Re){return be.test(Re)}Zr.exports=Le},37854:function(Zr){var _r=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Se(ve){return _r.test(ve)}Zr.exports=Se},3729:function(Zr){function _r(Se,ve,Ze){for(var M=Ze-1,R=Se.length;++M<R;)if(Se[M]===ve)return M;return-1}Zr.exports=_r},30078:function(Zr,_r,Se){var ve=Se(74202),Ze=Se(30080),M=Se(95611);function R(de){return Ze(de)?M(de):ve(de)}Zr.exports=R},95611:function(Zr){var _r="\\ud800-\\udfff",Se="\\u0300-\\u036f",ve="\\ufe20-\\ufe2f",Ze="\\u20d0-\\u20ff",M=Se+ve+Ze,R="\\ufe0e\\ufe0f",de="["+_r+"]",be="["+M+"]",Le="\\ud83c[\\udffb-\\udfff]",Re="(?:"+be+"|"+Le+")",Ce="[^"+_r+"]",He="(?:\\ud83c[\\udde6-\\uddff]){2}",Xe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ke="\\u200d",Ve=Re+"?",et="["+R+"]?",er="(?:"+Ke+"(?:"+[Ce,He,Xe].join("|")+")"+et+Ve+")*",fr=et+Ve+er,Ar="(?:"+[Ce+be+"?",be,He,Xe,de].join("|")+")",pn=RegExp(Le+"(?="+Le+")|"+Ar+fr,"g");function Kn(Jn){return Jn.match(pn)||[]}Zr.exports=Kn},32358:function(Zr){var _r="\\ud800-\\udfff",Se="\\u0300-\\u036f",ve="\\ufe20-\\ufe2f",Ze="\\u20d0-\\u20ff",M=Se+ve+Ze,R="\\u2700-\\u27bf",de="a-z\\xdf-\\xf6\\xf8-\\xff",be="\\xac\\xb1\\xd7\\xf7",Le="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Re="\\u2000-\\u206f",Ce=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",He="A-Z\\xc0-\\xd6\\xd8-\\xde",Xe="\\ufe0e\\ufe0f",Ke=be+Le+Re+Ce,Ve="['\u2019]",et="["+Ke+"]",er="["+M+"]",fr="\\d+",Ar="["+R+"]",pn="["+de+"]",Kn="[^"+_r+Ke+fr+R+de+He+"]",Jn="\\ud83c[\\udffb-\\udfff]",ki="(?:"+er+"|"+Jn+")",pa="[^"+_r+"]",xr="(?:\\ud83c[\\udde6-\\uddff]){2}",jt="[\\ud800-\\udbff][\\udc00-\\udfff]",Jr="["+He+"]",gr="\\u200d",rn="(?:"+pn+"|"+Kn+")",jn="(?:"+Jr+"|"+Kn+")",qe="(?:"+Ve+"(?:d|ll|m|re|s|t|ve))?",Dt="(?:"+Ve+"(?:D|LL|M|RE|S|T|VE))?",$e=ki+"?",Pt="["+Xe+"]?",vt="(?:"+gr+"(?:"+[pa,xr,jt].join("|")+")"+Pt+$e+")*",rr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ar="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",wr=Pt+$e+vt,Cr="(?:"+[Ar,xr,jt].join("|")+")"+wr,an=RegExp([Jr+"?"+pn+"+"+qe+"(?="+[et,Jr,"$"].join("|")+")",jn+"+"+Dt+"(?="+[et,Jr+rn,"$"].join("|")+")",Jr+"?"+rn+"+"+qe,Jr+"+"+Dt,ar,rr,fr,Cr].join("|"),"g");function yi(li){return li.match(an)||[]}Zr.exports=yi},47638:function(Zr,_r,Se){var ve=Se(68437),Ze=Se(51471),M=Ze(function(R,de,be){return de=de.toLowerCase(),R+(be?ve(de):de)});Zr.exports=M},68437:function(Zr,_r,Se){var ve=Se(8389),Ze=Se(42950);function M(R){return Ze(ve(R).toLowerCase())}Zr.exports=M},35636:function(Zr,_r,Se){var ve=Se(54527),Ze=Se(12448);function M(R,de,be){return be===void 0&&(be=de,de=void 0),be!==void 0&&(be=Ze(be),be=be===be?be:0),de!==void 0&&(de=Ze(de),de=de===de?de:0),ve(Ze(R),de,be)}Zr.exports=M},26357:function(Zr,_r,Se){var ve=Se(92523),Ze=Se(8389),M=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,R="\\u0300-\\u036f",de="\\ufe20-\\ufe2f",be="\\u20d0-\\u20ff",Le=R+de+be,Re="["+Le+"]",Ce=RegExp(Re,"g");function He(Xe){return Xe=Ze(Xe),Xe&&Xe.replace(M,ve).replace(Ce,"")}Zr.exports=He},98071:function(Zr,_r,Se){var ve=Se(80732),Ze=Se(55073),M="[object Boolean]";function R(de){return de===!0||de===!1||Ze(de)&&ve(de)==M}Zr.exports=R},31223:function(Zr,_r,Se){var ve=Se(6620);function Ze(M,R){return ve(M,R)}Zr.exports=Ze},46207:function(Zr){function _r(Se){return Se==null}Zr.exports=_r},89300:function(Zr){function _r(Se){return Se===void 0}Zr.exports=_r},53954:function(Zr,_r,Se){var ve=Se(97254),Ze=Se(77991),M=Ze(function(R,de,be,Le){ve(R,de,be,Le)});Zr.exports=M},43226:function(Zr){function _r(){}Zr.exports=_r},25066:function(Zr,_r,Se){var ve=Se(5125),Ze=Se(20396),M=ve(Ze);Zr.exports=M},20396:function(Zr,_r,Se){var ve=Se(66868);function Ze(M,R){return M&&M.length&&R&&R.length?ve(M,R):M}Zr.exports=Ze},4363:function(Zr,_r,Se){var ve=Se(95453);function Ze(M){return M&&M.length?ve(M):[]}Zr.exports=Ze},42950:function(Zr,_r,Se){var ve=Se(23684),Ze=ve("toUpperCase");Zr.exports=Ze},71055:function(Zr,_r,Se){var ve=Se(81034),Ze=Se(37854),M=Se(8389),R=Se(32358);function de(be,Le,Re){return be=M(be),Le=Re?void 0:Le,Le===void 0?Ze(be)?R(be):ve(be):be.match(Le)||[]}Zr.exports=de},86463:function(Zr){(function(_r,Se){Zr.exports=Se()})(this,function(){"use strict";var _r,Se,ve;function Ze(M,R){if(!_r)_r=R;else if(!Se)Se=R;else{var de="var sharedChunk = {}; ("+_r+")(sharedChunk); ("+Se+")(sharedChunk);",be={};_r(be),ve=R(be),typeof window!="undefined"&&(ve.workerUrl=window.URL.createObjectURL(new Blob([de],{type:"text/javascript"})))}}return Ze(["exports"],function(M){"use strict";function R(i,l){return i(l={exports:{}},l.exports),l.exports}var de=be;function be(i,l,_,S){this.cx=3*i,this.bx=3*(_-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*l,this.by=3*(S-l)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=S,this.p2x=_,this.p2y=S}be.prototype.sampleCurveX=function(i){return((this.ax*i+this.bx)*i+this.cx)*i},be.prototype.sampleCurveY=function(i){return((this.ay*i+this.by)*i+this.cy)*i},be.prototype.sampleCurveDerivativeX=function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},be.prototype.solveCurveX=function(i,l){var _,S,F,j,p;for(l===void 0&&(l=1e-6),F=i,p=0;p<8;p++){if(j=this.sampleCurveX(F)-i,Math.abs(j)<l)return F;var v=this.sampleCurveDerivativeX(F);if(Math.abs(v)<1e-6)break;F-=j/v}if((F=i)<(_=0))return _;if(F>(S=1))return S;for(;_<S;){if(j=this.sampleCurveX(F),Math.abs(j-i)<l)return F;i>j?_=F:S=F,F=.5*(S-_)+_}return F},be.prototype.solve=function(i,l){return this.sampleCurveY(this.solveCurveX(i,l))};var Le=Re;function Re(i,l){this.x=i,this.y=l}Re.prototype={clone:function(){return new Re(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,l){return this.clone()._rotateAround(i,l)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var l=i.x-this.x,_=i.y-this.y;return l*l+_*_},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,l){return Math.atan2(this.x*l-this.y*i,this.x*i+this.y*l)},_matMult:function(i){var l=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=l,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var l=Math.cos(i),_=Math.sin(i),S=_*this.x+l*this.y;return this.x=l*this.x-_*this.y,this.y=S,this},_rotateAround:function(i,l){var _=Math.cos(i),S=Math.sin(i),F=l.y+S*(this.x-l.x)+_*(this.y-l.y);return this.x=l.x+_*(this.x-l.x)-S*(this.y-l.y),this.y=F,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Re.convert=function(i){return i instanceof Re?i:Array.isArray(i)?new Re(i[0],i[1]):i};var Ce=typeof self!="undefined"?self:{},He=Math.pow(2,53)-1;function Xe(i,l,_,S){var F=new de(i,l,_,S);return function(j){return F.solve(j)}}var Ke=Xe(.25,.1,.25,1);function Ve(i,l,_){return Math.min(_,Math.max(l,i))}function et(i,l,_){var S=_-l,F=((i-l)%S+S)%S+l;return F===l?_:F}function er(i){for(var l=[],_=arguments.length-1;_-- >0;)l[_]=arguments[_+1];for(var S=0,F=l;S<F.length;S+=1){var j=F[S];for(var p in j)i[p]=j[p]}return i}var fr=1;function Ar(){return fr++}function pn(){return function i(l){return l?(l^16*Math.random()>>l/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,i)}()}function Kn(i){return!!i&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(i)}function Jn(i,l){i.forEach(function(_){l[_]&&(l[_]=l[_].bind(l))})}function ki(i,l){return i.indexOf(l,i.length-l.length)!==-1}function pa(i,l,_){var S={};for(var F in i)S[F]=l.call(_||this,i[F],F,i);return S}function xr(i,l,_){var S={};for(var F in i)l.call(_||this,i[F],F,i)&&(S[F]=i[F]);return S}function jt(i){return Array.isArray(i)?i.map(jt):typeof i=="object"&&i?pa(i,jt):i}var Jr={};function gr(i){Jr[i]||(typeof console!="undefined"&&console.warn(i),Jr[i]=!0)}function rn(i,l,_){return(_.y-i.y)*(l.x-i.x)>(l.y-i.y)*(_.x-i.x)}function jn(i){for(var l=0,_=0,S=i.length,F=S-1,j=void 0,p=void 0;_<S;F=_++)l+=((p=i[F]).x-(j=i[_]).x)*(j.y+p.y);return l}function qe(){return typeof WorkerGlobalScope!="undefined"&&typeof self!="undefined"&&self instanceof WorkerGlobalScope}function Dt(i){var l={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(S,F,j,p){var v=j||p;return l[F]=!v||v.toLowerCase(),""}),l["max-age"]){var _=parseInt(l["max-age"],10);isNaN(_)?delete l["max-age"]:l["max-age"]=_}return l}var $e=null;function Pt(i){if($e==null){var l=i.navigator?i.navigator.userAgent:null;$e=!!i.safari||!(!l||!(/\b(iPad|iPhone|iPod)\b/.test(l)||l.match("Safari")&&!l.match("Chrome")))}return $e}function vt(i){try{var l=Ce[i];return l.setItem("_mapbox_test_",1),l.removeItem("_mapbox_test_"),!0}catch(_){return!1}}var rr,ar,wr,Cr,an=Ce.performance&&Ce.performance.now?Ce.performance.now.bind(Ce.performance):Date.now.bind(Date),yi=Ce.requestAnimationFrame||Ce.mozRequestAnimationFrame||Ce.webkitRequestAnimationFrame||Ce.msRequestAnimationFrame,li=Ce.cancelAnimationFrame||Ce.mozCancelAnimationFrame||Ce.webkitCancelAnimationFrame||Ce.msCancelAnimationFrame,Uo={now:an,frame:function(i){var l=yi(i);return{cancel:function(){return li(l)}}},getImageData:function(i,l){l===void 0&&(l=0);var _=Ce.document.createElement("canvas"),S=_.getContext("2d");if(!S)throw new Error("failed to create canvas 2d context");return _.width=i.width,_.height=i.height,S.drawImage(i,0,0,i.width,i.height),S.getImageData(-l,-l,i.width+2*l,i.height+2*l)},resolveURL:function(i){return rr||(rr=Ce.document.createElement("a")),rr.href=i,rr.href},hardwareConcurrency:Ce.navigator&&Ce.navigator.hardwareConcurrency||4,get devicePixelRatio(){return Ce.devicePixelRatio},get prefersReducedMotion(){return!!Ce.matchMedia&&(ar==null&&(ar=Ce.matchMedia("(prefers-reduced-motion: reduce)")),ar.matches)}},vi={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},bo={supported:!1,testSupport:function(i){!So&&Cr&&(Xi?Mi(i):wr=i)}},So=!1,Xi=!1;function Mi(i){var l=i.createTexture();i.bindTexture(i.TEXTURE_2D,l);try{if(i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,Cr),i.isContextLost())return;bo.supported=!0}catch(_){}i.deleteTexture(l),So=!0}Ce.document&&((Cr=Ce.document.createElement("img")).onload=function(){wr&&Mi(wr),wr=null,Xi=!0},Cr.onerror=function(){So=!0,wr=null},Cr.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var qo="01",ui=function(i,l){this._transformRequestFn=i,this._customAccessToken=l,this._createSkuToken()};function Qi(i){return i.indexOf("mapbox:")===0}ui.prototype._createSkuToken=function(){var i=function(){for(var l="",_=0;_<10;_++)l+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",qo,l].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=i.token,this._skuTokenExpiresAt=i.tokenExpiresAt},ui.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},ui.prototype.transformRequest=function(i,l){return this._transformRequestFn&&this._transformRequestFn(i,l)||{url:i}},ui.prototype.normalizeStyleURL=function(i,l){if(!Qi(i))return i;var _=Ur(i);return _.path="/styles/v1"+_.path,this._makeAPIURL(_,this._customAccessToken||l)},ui.prototype.normalizeGlyphsURL=function(i,l){if(!Qi(i))return i;var _=Ur(i);return _.path="/fonts/v1"+_.path,this._makeAPIURL(_,this._customAccessToken||l)},ui.prototype.normalizeSourceURL=function(i,l){if(!Qi(i))return i;var _=Ur(i);return _.path="/v4/"+_.authority+".json",_.params.push("secure"),this._makeAPIURL(_,this._customAccessToken||l)},ui.prototype.normalizeSpriteURL=function(i,l,_,S){var F=Ur(i);return Qi(i)?(F.path="/styles/v1"+F.path+"/sprite"+l+_,this._makeAPIURL(F,this._customAccessToken||S)):(F.path+=""+l+_,ls(F))},ui.prototype.normalizeTileURL=function(i,l){if(this._isSkuTokenExpired()&&this._createSkuToken(),i&&!Qi(i))return i;var _=Ur(i);_.path=_.path.replace(/(\.(png|jpg)\d*)(?=$)/,(Uo.devicePixelRatio>=2||l===512?"@2x":"")+(bo.supported?".webp":"$1")),_.path=_.path.replace(/^.+\/v4\//,"/"),_.path="/v4"+_.path;var S=this._customAccessToken||function(F){for(var j=0,p=F;j<p.length;j+=1){var v=p[j].match(/^access_token=(.*)$/);if(v)return v[1]}return null}(_.params)||vi.ACCESS_TOKEN;return vi.REQUIRE_ACCESS_TOKEN&&S&&this._skuToken&&_.params.push("sku="+this._skuToken),this._makeAPIURL(_,S)},ui.prototype.canonicalizeTileURL=function(i,l){var _=Ur(i);if(!_.path.match(/(^\/v4\/)/)||!_.path.match(/\.[\w]+$/))return i;var S="mapbox://tiles/";S+=_.path.replace("/v4/","");var F=_.params;return l&&(F=F.filter(function(j){return!j.match(/^access_token=/)})),F.length&&(S+="?"+F.join("&")),S},ui.prototype.canonicalizeTileset=function(i,l){for(var _=!!l&&Qi(l),S=[],F=0,j=i.tiles||[];F<j.length;F+=1){var p=j[F];Pi(p)?S.push(this.canonicalizeTileURL(p,_)):S.push(p)}return S},ui.prototype._makeAPIURL=function(i,l){var _="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",S=Ur(vi.API_URL);if(i.protocol=S.protocol,i.authority=S.authority,i.protocol==="http"){var F=i.params.indexOf("secure");F>=0&&i.params.splice(F,1)}if(S.path!=="/"&&(i.path=""+S.path+i.path),!vi.REQUIRE_ACCESS_TOKEN)return ls(i);if(!(l=l||vi.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+_);if(l[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+_);return i.params=i.params.filter(function(j){return j.indexOf("access_token")===-1}),i.params.push("access_token="+l),ls(i)};var Vi=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Pi(i){return Vi.test(i)}var ds=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Ur(i){var l=i.match(ds);if(!l)throw new Error("Unable to parse URL object");return{protocol:l[1],authority:l[2],path:l[3]||"/",params:l[4]?l[4].split("&"):[]}}function ls(i){var l=i.params.length?"?"+i.params.join("&"):"";return i.protocol+"://"+i.authority+i.path+l}function dr(i){if(!i)return null;var l=i.split(".");if(!l||l.length!==3)return null;try{return JSON.parse(decodeURIComponent(Ce.atob(l[1]).split("").map(function(_){return"%"+("00"+_.charCodeAt(0).toString(16)).slice(-2)}).join("")))}catch(_){return null}}var he=function(i){this.type=i,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};he.prototype.getStorageKey=function(i){var l,_=dr(vi.ACCESS_TOKEN);return l=_&&_.u?Ce.btoa(encodeURIComponent(_.u).replace(/%([0-9A-F]{2})/g,function(S,F){return String.fromCharCode(+("0x"+F))})):vi.ACCESS_TOKEN||"",i?"mapbox.eventData."+i+":"+l:"mapbox.eventData:"+l},he.prototype.fetchEventData=function(){var i=vt("localStorage"),l=this.getStorageKey(),_=this.getStorageKey("uuid");if(i)try{var S=Ce.localStorage.getItem(l);S&&(this.eventData=JSON.parse(S));var F=Ce.localStorage.getItem(_);F&&(this.anonId=F)}catch(j){gr("Unable to read from LocalStorage")}},he.prototype.saveEventData=function(){var i=vt("localStorage"),l=this.getStorageKey(),_=this.getStorageKey("uuid");if(i)try{Ce.localStorage.setItem(_,this.anonId),Object.keys(this.eventData).length>=1&&Ce.localStorage.setItem(l,JSON.stringify(this.eventData))}catch(S){gr("Unable to write to LocalStorage")}},he.prototype.processRequests=function(i){},he.prototype.postEvent=function(i,l,_,S){var F=this;if(vi.EVENTS_URL){var j=Ur(vi.EVENTS_URL);j.params.push("access_token="+(S||vi.ACCESS_TOKEN||""));var p={event:this.type,created:new Date(i).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:qo,userId:this.anonId},v=l?er(p,l):p,m={url:ls(j),headers:{"Content-Type":"text/plain"},body:JSON.stringify([v])};this.pendingRequest=Ne(m,function(w){F.pendingRequest=null,_(w),F.saveEventData(),F.processRequests(S)})}},he.prototype.queueRequest=function(i,l){this.queue.push(i),this.processRequests(l)};var We,at,Ot=function(i){function l(){i.call(this,"map.load"),this.success={},this.skuToken=""}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.postMapLoadEvent=function(_,S,F,j){this.skuToken=F;var p=!(!j&&!vi.ACCESS_TOKEN),v=Array.isArray(_)&&_.some(function(m){return Qi(m)||Pi(m)});vi.EVENTS_URL&&p&&v&&this.queueRequest({id:S,timestamp:Date.now()},j)},l.prototype.processRequests=function(_){var S=this;if(!this.pendingRequest&&this.queue.length!==0){var F=this.queue.shift(),j=F.id,p=F.timestamp;j&&this.success[j]||(this.anonId||this.fetchEventData(),Kn(this.anonId)||(this.anonId=pn()),this.postEvent(p,{skuToken:this.skuToken},function(v){v||j&&(S.success[j]=!0)},_))}},l}(he),or=new(function(i){function l(_){i.call(this,"appUserTurnstile"),this._customAccessToken=_}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.postTurnstileEvent=function(_,S){vi.EVENTS_URL&&vi.ACCESS_TOKEN&&Array.isArray(_)&&_.some(function(F){return Qi(F)||Pi(F)})&&this.queueRequest(Date.now(),S)},l.prototype.processRequests=function(_){var S=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var F=dr(vi.ACCESS_TOKEN),j=F?F.u:vi.ACCESS_TOKEN,p=j!==this.eventData.tokenU;Kn(this.anonId)||(this.anonId=pn(),p=!0);var v=this.queue.shift();if(this.eventData.lastSuccess){var m=new Date(this.eventData.lastSuccess),w=new Date(v),D=(v-this.eventData.lastSuccess)/864e5;p=p||D>=1||D<-1||m.getDate()!==w.getDate()}else p=!0;if(!p)return this.processRequests();this.postEvent(v,{"enabled.telemetry":!1},function(N){N||(S.eventData.lastSuccess=v,S.eventData.tokenU=j)},_)}},l}(he)),Wr=or.postTurnstileEvent.bind(or),In=new Ot,kn=In.postMapLoadEvent.bind(In),eo=500,un=50;function To(){Ce.caches&&!We&&(We=Ce.caches.open("mapbox-tiles"))}function Ti(i){var l=i.indexOf("?");return l<0?i:i.slice(0,l)}var Lo,wa=1/0;function dn(){return Lo==null&&(Lo=Ce.OffscreenCanvas&&new Ce.OffscreenCanvas(1,1).getContext("2d")&&typeof Ce.createImageBitmap=="function"),Lo}var co={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(co);var no=function(i){function l(_,S,F){S===401&&Pi(F)&&(_+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),i.call(this,_),this.status=S,this.url=F,this.name=this.constructor.name,this.message=_}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},l}(Error),Za=qe()?function(){return self.worker&&self.worker.referrer}:function(){return(Ce.location.protocol==="blob:"?Ce.parent:Ce).location.href},ms,Ji,Us=function(i,l){if(!(/^file:/.test(_=i.url)||/^file:/.test(Za())&&!/^\w+:/.test(_))){if(Ce.fetch&&Ce.Request&&Ce.AbortController&&Ce.Request.prototype.hasOwnProperty("signal"))return function(S,F){var j,p=new Ce.AbortController,v=new Ce.Request(S.url,{method:S.method||"GET",body:S.body,credentials:S.credentials,headers:S.headers,referrer:Za(),signal:p.signal}),m=!1,w=!1,D=(j=v.url).indexOf("sku=")>0&&Pi(j);S.type==="json"&&v.headers.set("Accept","application/json");var N=function($,ie,pe){if(!w){if($&&$.message!=="SecurityError"&&gr($),ie&&pe)return W(ie);var we=Date.now();Ce.fetch(v).then(function(ke){if(ke.ok){var Ge=D?ke.clone():null;return W(ke,Ge,we)}return F(new no(ke.statusText,ke.status,S.url))}).catch(function(ke){ke.code!==20&&F(new Error(ke.message))})}},W=function($,ie,pe){(S.type==="arrayBuffer"?$.arrayBuffer():S.type==="json"?$.json():$.text()).then(function(we){w||(ie&&pe&&function(ke,Ge,ht){if(To(),We){var mt={status:Ge.status,statusText:Ge.statusText,headers:new Ce.Headers};Ge.headers.forEach(function(xt,bt){return mt.headers.set(bt,xt)});var St=Dt(Ge.headers.get("Cache-Control")||"");St["no-store"]||(St["max-age"]&&mt.headers.set("Expires",new Date(ht+1e3*St["max-age"]).toUTCString()),new Date(mt.headers.get("Expires")).getTime()-ht<42e4||function(xt,bt){if(at===void 0)try{new Response(new ReadableStream),at=!0}catch(kt){at=!1}at?bt(xt.body):xt.blob().then(bt)}(Ge,function(xt){var bt=new Ce.Response(xt,mt);To(),We&&We.then(function(kt){return kt.put(Ti(ke.url),bt)}).catch(function(kt){return gr(kt.message)})}))}}(v,ie,pe),m=!0,F(null,we,$.headers.get("Cache-Control"),$.headers.get("Expires")))}).catch(function(we){w||F(new Error(we.message))})};return D?function($,ie){if(To(),!We)return ie(null);var pe=Ti($.url);We.then(function(we){we.match(pe).then(function(ke){var Ge=function(ht){if(!ht)return!1;var mt=new Date(ht.headers.get("Expires")||0),St=Dt(ht.headers.get("Cache-Control")||"");return mt>Date.now()&&!St["no-cache"]}(ke);we.delete(pe),Ge&&we.put(pe,ke.clone()),ie(null,ke,Ge)}).catch(ie)}).catch(ie)}(v,N):N(null,null),{cancel:function(){w=!0,m||p.abort()}}}(i,l);if(qe()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,l,void 0,!0)}var _;return function(S,F){var j=new Ce.XMLHttpRequest;for(var p in j.open(S.method||"GET",S.url,!0),S.type==="arrayBuffer"&&(j.responseType="arraybuffer"),S.headers)j.setRequestHeader(p,S.headers[p]);return S.type==="json"&&(j.responseType="text",j.setRequestHeader("Accept","application/json")),j.withCredentials=S.credentials==="include",j.onerror=function(){F(new Error(j.statusText))},j.onload=function(){if((j.status>=200&&j.status<300||j.status===0)&&j.response!==null){var v=j.response;if(S.type==="json")try{v=JSON.parse(j.response)}catch(m){return F(m)}F(null,v,j.getResponseHeader("Cache-Control"),j.getResponseHeader("Expires"))}else F(new no(j.statusText,j.status,S.url))},j.send(S.body),{cancel:function(){return j.abort()}}}(i,l)},Lt=function(i,l){return Us(er(i,{type:"arrayBuffer"}),l)},Ne=function(i,l){return Us(er(i,{method:"POST"}),l)},re="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";ms=[],Ji=0;var le=function(i,l){if(bo.supported&&(i.headers||(i.headers={}),i.headers.accept="image/webp,*/*"),Ji>=vi.MAX_PARALLEL_IMAGE_REQUESTS){var _={requestParameters:i,callback:l,cancelled:!1,cancel:function(){this.cancelled=!0}};return ms.push(_),_}Ji++;var S=!1,F=function(){if(!S)for(S=!0,Ji--;ms.length&&Ji<vi.MAX_PARALLEL_IMAGE_REQUESTS;){var p=ms.shift();p.cancelled||(p.cancel=le(p.requestParameters,p.callback).cancel)}},j=Lt(i,function(p,v,m,w){F(),p?l(p):v&&(dn()?function(D,N){var W=new Ce.Blob([new Uint8Array(D)],{type:"image/png"});Ce.createImageBitmap(W).then(function($){N(null,$)}).catch(function($){N(new Error("Could not load image because of "+$.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}(v,l):function(D,N,W,$){var ie=new Ce.Image,pe=Ce.URL;ie.onload=function(){N(null,ie),pe.revokeObjectURL(ie.src),ie.onload=null,Ce.requestAnimationFrame(function(){ie.src=re})},ie.onerror=function(){return N(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var we=new Ce.Blob([new Uint8Array(D)],{type:"image/png"});ie.cacheControl=W,ie.expires=$,ie.src=D.byteLength?pe.createObjectURL(we):re}(v,l,m,w))});return{cancel:function(){j.cancel(),F()}}};function ge(i,l,_){_[i]&&_[i].indexOf(l)!==-1||(_[i]=_[i]||[],_[i].push(l))}function ye(i,l,_){if(_&&_[i]){var S=_[i].indexOf(l);S!==-1&&_[i].splice(S,1)}}var ze=function(i,l){l===void 0&&(l={}),er(this,l),this.type=i},je=function(i){function l(_,S){S===void 0&&(S={}),i.call(this,"error",er({error:_},S))}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l}(ze),Ue=function(){};Ue.prototype.on=function(i,l){return this._listeners=this._listeners||{},ge(i,l,this._listeners),this},Ue.prototype.off=function(i,l){return ye(i,l,this._listeners),ye(i,l,this._oneTimeListeners),this},Ue.prototype.once=function(i,l){return this._oneTimeListeners=this._oneTimeListeners||{},ge(i,l,this._oneTimeListeners),this},Ue.prototype.fire=function(i,l){typeof i=="string"&&(i=new ze(i,l||{}));var _=i.type;if(this.listens(_)){i.target=this;for(var S=0,F=this._listeners&&this._listeners[_]?this._listeners[_].slice():[];S<F.length;S+=1)F[S].call(this,i);for(var j=0,p=this._oneTimeListeners&&this._oneTimeListeners[_]?this._oneTimeListeners[_].slice():[];j<p.length;j+=1){var v=p[j];ye(_,v,this._oneTimeListeners),v.call(this,i)}var m=this._eventedParent;m&&(er(i,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),m.fire(i))}else i instanceof je&&console.error(i.error);return this},Ue.prototype.listens=function(i){return this._listeners&&this._listeners[i]&&this._listeners[i].length>0||this._oneTimeListeners&&this._oneTimeListeners[i]&&this._oneTimeListeners[i].length>0||this._eventedParent&&this._eventedParent.listens(i)},Ue.prototype.setEventedParent=function(i,l){return this._eventedParent=i,this._eventedParentData=l,this};var Ae={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Je=function(i,l,_,S){this.message=(i?i+": ":"")+_,S&&(this.identifier=S),l!=null&&l.__line__&&(this.line=l.__line__)};function wt(i){var l=i.value;return l?[new Je(i.key,l,"constants have been deprecated as of v8")]:[]}function Ht(i){for(var l=[],_=arguments.length-1;_-- >0;)l[_]=arguments[_+1];for(var S=0,F=l;S<F.length;S+=1){var j=F[S];for(var p in j)i[p]=j[p]}return i}function Fr(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function mr(i){if(Array.isArray(i))return i.map(mr);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){var l={};for(var _ in i)l[_]=mr(i[_]);return l}return Fr(i)}var Sr=function(i){function l(_,S){i.call(this,S),this.message=S,this.key=_}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l}(Error),fn=function(i,l){l===void 0&&(l=[]),this.parent=i,this.bindings={};for(var _=0,S=l;_<S.length;_+=1){var F=S[_];this.bindings[F[0]]=F[1]}};fn.prototype.concat=function(i){return new fn(this,i)},fn.prototype.get=function(i){if(this.bindings[i])return this.bindings[i];if(this.parent)return this.parent.get(i);throw new Error(i+" not found in scope.")},fn.prototype.has=function(i){return!!this.bindings[i]||!!this.parent&&this.parent.has(i)};var xn={kind:"null"},Lr={kind:"number"},Nn={kind:"string"},bn={kind:"boolean"},En={kind:"color"},io={kind:"object"},On={kind:"value"},Ao={kind:"collator"},ia={kind:"formatted"},Ho={kind:"resolvedImage"};function Ga(i,l){return{kind:"array",itemType:i,N:l}}function Wo(i){if(i.kind==="array"){var l=Wo(i.itemType);return typeof i.N=="number"?"array<"+l+", "+i.N+">":i.itemType.kind==="value"?"array":"array<"+l+">"}return i.kind}var Hl=[xn,Lr,Nn,bn,En,ia,io,Ga(On),Ho];function ns(i,l){if(l.kind==="error")return null;if(i.kind==="array"){if(l.kind==="array"&&(l.N===0&&l.itemType.kind==="value"||!ns(i.itemType,l.itemType))&&(typeof i.N!="number"||i.N===l.N))return null}else{if(i.kind===l.kind)return null;if(i.kind==="value"){for(var _=0,S=Hl;_<S.length;_+=1)if(!ns(S[_],l))return null}}return"Expected "+Wo(i)+" but found "+Wo(l)+" instead."}function Yo(i,l){return l.some(function(_){return _.kind===i.kind})}function _a(i,l){return l.some(function(_){return _==="null"?i===null:_==="array"?Array.isArray(i):_==="object"?i&&!Array.isArray(i)&&typeof i=="object":_===typeof i})}var $o=R(function(i,l){var _={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function S(v){return(v=Math.round(v))<0?0:v>255?255:v}function F(v){return S(v[v.length-1]==="%"?parseFloat(v)/100*255:parseInt(v))}function j(v){return(m=v[v.length-1]==="%"?parseFloat(v)/100:parseFloat(v))<0?0:m>1?1:m;var m}function p(v,m,w){return w<0?w+=1:w>1&&(w-=1),6*w<1?v+(m-v)*w*6:2*w<1?m:3*w<2?v+(m-v)*(2/3-w)*6:v}try{l.parseCSSColor=function(v){var m,w=v.replace(/ /g,"").toLowerCase();if(w in _)return _[w].slice();if(w[0]==="#")return w.length===4?(m=parseInt(w.substr(1),16))>=0&&m<=4095?[(3840&m)>>4|(3840&m)>>8,240&m|(240&m)>>4,15&m|(15&m)<<4,1]:null:w.length===7&&(m=parseInt(w.substr(1),16))>=0&&m<=16777215?[(16711680&m)>>16,(65280&m)>>8,255&m,1]:null;var D=w.indexOf("("),N=w.indexOf(")");if(D!==-1&&N+1===w.length){var W=w.substr(0,D),$=w.substr(D+1,N-(D+1)).split(","),ie=1;switch(W){case"rgba":if($.length!==4)return null;ie=j($.pop());case"rgb":return $.length!==3?null:[F($[0]),F($[1]),F($[2]),ie];case"hsla":if($.length!==4)return null;ie=j($.pop());case"hsl":if($.length!==3)return null;var pe=(parseFloat($[0])%360+360)%360/360,we=j($[1]),ke=j($[2]),Ge=ke<=.5?ke*(we+1):ke+we-ke*we,ht=2*ke-Ge;return[S(255*p(ht,Ge,pe+1/3)),S(255*p(ht,Ge,pe)),S(255*p(ht,Ge,pe-1/3)),ie];default:return null}}return null}}catch(v){}}).parseCSSColor,Fo=function(i,l,_,S){S===void 0&&(S=1),this.r=i,this.g=l,this.b=_,this.a=S};Fo.parse=function(i){if(i){if(i instanceof Fo)return i;if(typeof i=="string"){var l=$o(i);if(l)return new Fo(l[0]/255*l[3],l[1]/255*l[3],l[2]/255*l[3],l[3])}}},Fo.prototype.toString=function(){var i=this.toArray(),l=i[1],_=i[2],S=i[3];return"rgba("+Math.round(i[0])+","+Math.round(l)+","+Math.round(_)+","+S+")"},Fo.prototype.toArray=function(){var i=this.a;return i===0?[0,0,0,0]:[255*this.r/i,255*this.g/i,255*this.b/i,i]},Fo.black=new Fo(0,0,0,1),Fo.white=new Fo(1,1,1,1),Fo.transparent=new Fo(0,0,0,0),Fo.red=new Fo(1,0,0,1);var us=function(i,l,_){this.sensitivity=i?l?"variant":"case":l?"accent":"base",this.locale=_,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};us.prototype.compare=function(i,l){return this.collator.compare(i,l)},us.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var xc=function(i,l,_,S,F){this.text=i,this.image=l,this.scale=_,this.fontStack=S,this.textColor=F},Ba=function(i){this.sections=i};Ba.fromString=function(i){return new Ba([new xc(i,null,null,null,null)])},Ba.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some(function(i){return i.text.length!==0||i.image&&i.image.name.length!==0})},Ba.factory=function(i){return i instanceof Ba?i:Ba.fromString(i)},Ba.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(i){return i.text}).join("")},Ba.prototype.serialize=function(){for(var i=["format"],l=0,_=this.sections;l<_.length;l+=1){var S=_[l];if(S.image)i.push(["image",S.image.name]);else{i.push(S.text);var F={};S.fontStack&&(F["text-font"]=["literal",S.fontStack.split(",")]),S.scale&&(F["font-scale"]=S.scale),S.textColor&&(F["text-color"]=["rgba"].concat(S.textColor.toArray())),i.push(F)}}return i};var Fa=function(i){this.name=i.name,this.available=i.available};function sc(i,l,_,S){return typeof i=="number"&&i>=0&&i<=255&&typeof l=="number"&&l>=0&&l<=255&&typeof _=="number"&&_>=0&&_<=255?S===void 0||typeof S=="number"&&S>=0&&S<=1?null:"Invalid rgba value ["+[i,l,_,S].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof S=="number"?[i,l,_,S]:[i,l,_]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Ql(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof Fo||i instanceof us||i instanceof Ba||i instanceof Fa)return!0;if(Array.isArray(i)){for(var l=0,_=i;l<_.length;l+=1)if(!Ql(_[l]))return!1;return!0}if(typeof i=="object"){for(var S in i)if(!Ql(i[S]))return!1;return!0}return!1}function oa(i){if(i===null)return xn;if(typeof i=="string")return Nn;if(typeof i=="boolean")return bn;if(typeof i=="number")return Lr;if(i instanceof Fo)return En;if(i instanceof us)return Ao;if(i instanceof Ba)return ia;if(i instanceof Fa)return Ho;if(Array.isArray(i)){for(var l,_=i.length,S=0,F=i;S<F.length;S+=1){var j=oa(F[S]);if(l){if(l===j)continue;l=On;break}l=j}return Ga(l||On,_)}return io}function Zo(i){var l=typeof i;return i===null?"":l==="string"||l==="number"||l==="boolean"?String(i):i instanceof Fo||i instanceof Ba||i instanceof Fa?i.toString():JSON.stringify(i)}Fa.prototype.toString=function(){return this.name},Fa.fromString=function(i){return i?new Fa({name:i,available:!1}):null},Fa.prototype.serialize=function(){return["image",this.name]};var il=function(i,l){this.type=i,this.value=l};il.parse=function(i,l){if(i.length!==2)return l.error("'literal' expression requires exactly one argument, but found "+(i.length-1)+" instead.");if(!Ql(i[1]))return l.error("invalid value");var _=i[1],S=oa(_),F=l.expectedType;return S.kind!=="array"||S.N!==0||!F||F.kind!=="array"||typeof F.N=="number"&&F.N!==0||(S=F),new il(S,_)},il.prototype.evaluate=function(){return this.value},il.prototype.eachChild=function(){},il.prototype.outputDefined=function(){return!0},il.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Fo?["rgba"].concat(this.value.toArray()):this.value instanceof Ba?this.value.serialize():this.value};var va=function(i){this.name="ExpressionEvaluationError",this.message=i};va.prototype.toJSON=function(){return this.message};var El={string:Nn,number:Lr,boolean:bn,object:io},Wa=function(i,l){this.type=i,this.args=l};Wa.parse=function(i,l){if(i.length<2)return l.error("Expected at least one argument.");var _,S=1,F=i[0];if(F==="array"){var j,p;if(i.length>2){var v=i[1];if(typeof v!="string"||!(v in El)||v==="object")return l.error('The item type argument of "array" must be one of string, number, boolean',1);j=El[v],S++}else j=On;if(i.length>3){if(i[2]!==null&&(typeof i[2]!="number"||i[2]<0||i[2]!==Math.floor(i[2])))return l.error('The length argument to "array" must be a positive integer literal',2);p=i[2],S++}_=Ga(j,p)}else _=El[F];for(var m=[];S<i.length;S++){var w=l.parse(i[S],S,On);if(!w)return null;m.push(w)}return new Wa(_,m)},Wa.prototype.evaluate=function(i){for(var l=0;l<this.args.length;l++){var _=this.args[l].evaluate(i);if(!ns(this.type,oa(_)))return _;if(l===this.args.length-1)throw new va("Expected value to be of type "+Wo(this.type)+", but found "+Wo(oa(_))+" instead.")}return null},Wa.prototype.eachChild=function(i){this.args.forEach(i)},Wa.prototype.outputDefined=function(){return this.args.every(function(i){return i.outputDefined()})},Wa.prototype.serialize=function(){var i=this.type,l=[i.kind];if(i.kind==="array"){var _=i.itemType;if(_.kind==="string"||_.kind==="number"||_.kind==="boolean"){l.push(_.kind);var S=i.N;(typeof S=="number"||this.args.length>1)&&l.push(S)}}return l.concat(this.args.map(function(F){return F.serialize()}))};var Ds=function(i){this.type=ia,this.sections=i};Ds.parse=function(i,l){if(i.length<2)return l.error("Expected at least one argument.");var _=i[1];if(!Array.isArray(_)&&typeof _=="object")return l.error("First argument must be an image or text section.");for(var S=[],F=!1,j=1;j<=i.length-1;++j){var p=i[j];if(F&&typeof p=="object"&&!Array.isArray(p)){F=!1;var v=null;if(p["font-scale"]&&!(v=l.parse(p["font-scale"],1,Lr)))return null;var m=null;if(p["text-font"]&&!(m=l.parse(p["text-font"],1,Ga(Nn))))return null;var w=null;if(p["text-color"]&&!(w=l.parse(p["text-color"],1,En)))return null;var D=S[S.length-1];D.scale=v,D.font=m,D.textColor=w}else{var N=l.parse(i[j],1,On);if(!N)return null;var W=N.type.kind;if(W!=="string"&&W!=="value"&&W!=="null"&&W!=="resolvedImage")return l.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");F=!0,S.push({content:N,scale:null,font:null,textColor:null})}}return new Ds(S)},Ds.prototype.evaluate=function(i){return new Ba(this.sections.map(function(l){var _=l.content.evaluate(i);return oa(_)===Ho?new xc("",_,null,null,null):new xc(Zo(_),null,l.scale?l.scale.evaluate(i):null,l.font?l.font.evaluate(i).join(","):null,l.textColor?l.textColor.evaluate(i):null)}))},Ds.prototype.eachChild=function(i){for(var l=0,_=this.sections;l<_.length;l+=1){var S=_[l];i(S.content),S.scale&&i(S.scale),S.font&&i(S.font),S.textColor&&i(S.textColor)}},Ds.prototype.outputDefined=function(){return!1},Ds.prototype.serialize=function(){for(var i=["format"],l=0,_=this.sections;l<_.length;l+=1){var S=_[l];i.push(S.content.serialize());var F={};S.scale&&(F["font-scale"]=S.scale.serialize()),S.font&&(F["text-font"]=S.font.serialize()),S.textColor&&(F["text-color"]=S.textColor.serialize()),i.push(F)}return i};var Rl=function(i){this.type=Ho,this.input=i};Rl.parse=function(i,l){if(i.length!==2)return l.error("Expected two arguments.");var _=l.parse(i[1],1,Nn);return _?new Rl(_):l.error("No image name provided.")},Rl.prototype.evaluate=function(i){var l=this.input.evaluate(i),_=Fa.fromString(l);return _&&i.availableImages&&(_.available=i.availableImages.indexOf(l)>-1),_},Rl.prototype.eachChild=function(i){i(this.input)},Rl.prototype.outputDefined=function(){return!1},Rl.prototype.serialize=function(){return["image",this.input.serialize()]};var gu={"to-boolean":bn,"to-color":En,"to-number":Lr,"to-string":Nn},gl=function(i,l){this.type=i,this.args=l};gl.parse=function(i,l){if(i.length<2)return l.error("Expected at least one argument.");var _=i[0];if((_==="to-boolean"||_==="to-string")&&i.length!==2)return l.error("Expected one argument.");for(var S=gu[_],F=[],j=1;j<i.length;j++){var p=l.parse(i[j],j,On);if(!p)return null;F.push(p)}return new gl(S,F)},gl.prototype.evaluate=function(i){if(this.type.kind==="boolean")return!!this.args[0].evaluate(i);if(this.type.kind==="color"){for(var l,_,S=0,F=this.args;S<F.length;S+=1){if(_=null,(l=F[S].evaluate(i))instanceof Fo)return l;if(typeof l=="string"){var j=i.parseColor(l);if(j)return j}else if(Array.isArray(l)&&!(_=l.length<3||l.length>4?"Invalid rbga value "+JSON.stringify(l)+": expected an array containing either three or four numeric values.":sc(l[0],l[1],l[2],l[3])))return new Fo(l[0]/255,l[1]/255,l[2]/255,l[3])}throw new va(_||"Could not parse color from value '"+(typeof l=="string"?l:String(JSON.stringify(l)))+"'")}if(this.type.kind==="number"){for(var p=null,v=0,m=this.args;v<m.length;v+=1){if((p=m[v].evaluate(i))===null)return 0;var w=Number(p);if(!isNaN(w))return w}throw new va("Could not convert "+JSON.stringify(p)+" to number.")}return this.type.kind==="formatted"?Ba.fromString(Zo(this.args[0].evaluate(i))):this.type.kind==="resolvedImage"?Fa.fromString(Zo(this.args[0].evaluate(i))):Zo(this.args[0].evaluate(i))},gl.prototype.eachChild=function(i){this.args.forEach(i)},gl.prototype.outputDefined=function(){return this.args.every(function(i){return i.outputDefined()})},gl.prototype.serialize=function(){if(this.type.kind==="formatted")return new Ds([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Rl(this.args[0]).serialize();var i=["to-"+this.type.kind];return this.eachChild(function(l){i.push(l.serialize())}),i};var wl=["Unknown","Point","LineString","Polygon"],ol=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};ol.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},ol.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?wl[this.feature.type]:this.feature.type:null},ol.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},ol.prototype.canonicalID=function(){return this.canonical},ol.prototype.properties=function(){return this.feature&&this.feature.properties||{}},ol.prototype.parseColor=function(i){var l=this._parseColorCache[i];return l||(l=this._parseColorCache[i]=Fo.parse(i)),l};var Qa=function(i,l,_,S){this.name=i,this.type=l,this._evaluate=_,this.args=S};Qa.prototype.evaluate=function(i){return this._evaluate(i,this.args)},Qa.prototype.eachChild=function(i){this.args.forEach(i)},Qa.prototype.outputDefined=function(){return!1},Qa.prototype.serialize=function(){return[this.name].concat(this.args.map(function(i){return i.serialize()}))},Qa.parse=function(i,l){var _,S=i[0],F=Qa.definitions[S];if(!F)return l.error('Unknown expression "'+S+'". If you wanted a literal array, use ["literal", [...]].',0);for(var j=Array.isArray(F)?F[0]:F.type,p=Array.isArray(F)?[[F[1],F[2]]]:F.overloads,v=p.filter(function(br){var Pr=br[0];return!Array.isArray(Pr)||Pr.length===i.length-1}),m=null,w=0,D=v;w<D.length;w+=1){var N=D[w],W=N[0],$=N[1];m=new bs(l.registry,l.path,null,l.scope);for(var ie=[],pe=!1,we=1;we<i.length;we++){var ke=i[we],Ge=Array.isArray(W)?W[we-1]:W.type,ht=m.parse(ke,1+ie.length,Ge);if(!ht){pe=!0;break}ie.push(ht)}if(!pe)if(Array.isArray(W)&&W.length!==ie.length)m.error("Expected "+W.length+" arguments, but found "+ie.length+" instead.");else{for(var mt=0;mt<ie.length;mt++){var St=Array.isArray(W)?W[mt]:W.type,xt=ie[mt];m.concat(mt+1).checkSubtype(St,xt.type)}if(m.errors.length===0)return new Qa(S,j,$,ie)}}if(v.length===1)(_=l.errors).push.apply(_,m.errors);else{for(var bt=(v.length?v:p).map(function(br){var Pr;return Pr=br[0],Array.isArray(Pr)?"("+Pr.map(Wo).join(", ")+")":"("+Wo(Pr.type)+"...)"}).join(" | "),kt=[],ft=1;ft<i.length;ft++){var nr=l.parse(i[ft],1+kt.length);if(!nr)return null;kt.push(Wo(nr.type))}l.error("Expected arguments of type "+bt+", but found ("+kt.join(", ")+") instead.")}return null},Qa.register=function(i,l){for(var _ in Qa.definitions=l,l)i[_]=Qa};var Gl=function(i,l,_){this.type=Ao,this.locale=_,this.caseSensitive=i,this.diacriticSensitive=l};function Wl(i,l){i[0]=Math.min(i[0],l[0]),i[1]=Math.min(i[1],l[1]),i[2]=Math.max(i[2],l[0]),i[3]=Math.max(i[3],l[1])}function ut(i,l){return!(i[0]<=l[0]||i[2]>=l[2]||i[1]<=l[1]||i[3]>=l[3])}function At(i,l){var _=(180+i[0])/360,S=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,F=Math.pow(2,l.z);return[Math.round(_*F*8192),Math.round(S*F*8192)]}function ir(i,l,_){return l[1]>i[1]!=_[1]>i[1]&&i[0]<(_[0]-l[0])*(i[1]-l[1])/(_[1]-l[1])+l[0]}function jr(i,l){for(var _,S,F,j,p,v,m,w=!1,D=0,N=l.length;D<N;D++)for(var W=l[D],$=0,ie=W.length;$<ie-1;$++){if((j=(_=i)[0]-(S=W[$])[0])*(m=_[1]-(F=W[$+1])[1])-(v=_[0]-F[0])*(p=_[1]-S[1])==0&&j*v<=0&&p*m<=0)return!1;ir(i,W[$],W[$+1])&&(w=!w)}return w}function Dn(i,l){for(var _=0;_<l.length;_++)if(jr(i,l[_]))return!0;return!1}function oo(i,l,_,S){var F=S[0]-_[0],j=S[1]-_[1],p=(i[0]-_[0])*j-F*(i[1]-_[1]),v=(l[0]-_[0])*j-F*(l[1]-_[1]);return p>0&&v<0||p<0&&v>0}function Xa(i,l,_){for(var S=0,F=_;S<F.length;S+=1)for(var j=F[S],p=0;p<j.length-1;++p)if((N=[(D=j[p+1])[0]-(w=j[p])[0],D[1]-w[1]])[0]*(W=[(m=l)[0]-(v=i)[0],m[1]-v[1]])[1]-N[1]*W[0]!=0&&oo(v,m,w,D)&&oo(w,D,v,m))return!0;var v,m,w,D,N,W;return!1}function mn(i,l){for(var _=0;_<i.length;++_)if(!jr(i[_],l))return!1;for(var S=0;S<i.length-1;++S)if(Xa(i[S],i[S+1],l))return!1;return!0}function kl(i,l){for(var _=0;_<l.length;_++)if(mn(i,l[_]))return!0;return!1}function Il(i,l,_){for(var S=[],F=0;F<i.length;F++){for(var j=[],p=0;p<i[F].length;p++){var v=At(i[F][p],_);Wl(l,v),j.push(v)}S.push(j)}return S}function Ia(i,l,_){for(var S=[],F=0;F<i.length;F++){var j=Il(i[F],l,_);S.push(j)}return S}function Xh(i,l,_,S){if(i[0]<_[0]||i[0]>_[2]){var F=.5*S,j=i[0]-_[0]>F?-S:_[0]-i[0]>F?S:0;j===0&&(j=i[0]-_[2]>F?-S:_[2]-i[0]>F?S:0),i[0]+=j}Wl(l,i)}function Sl(i,l,_,S){for(var F=8192*Math.pow(2,S.z),j=[8192*S.x,8192*S.y],p=[],v=0,m=i;v<m.length;v+=1)for(var w=0,D=m[v];w<D.length;w+=1){var N=D[w],W=[N.x+j[0],N.y+j[1]];Xh(W,l,_,F),p.push(W)}return p}function Va(i,l,_,S){for(var F,j=8192*Math.pow(2,S.z),p=[8192*S.x,8192*S.y],v=[],m=0,w=i;m<w.length;m+=1){for(var D=[],N=0,W=w[m];N<W.length;N+=1){var $=W[N],ie=[$.x+p[0],$.y+p[1]];Wl(l,ie),D.push(ie)}v.push(D)}if(l[2]-l[0]<=j/2){(F=l)[0]=F[1]=1/0,F[2]=F[3]=-1/0;for(var pe=0,we=v;pe<we.length;pe+=1)for(var ke=0,Ge=we[pe];ke<Ge.length;ke+=1)Xh(Ge[ke],l,_,j)}return v}Gl.parse=function(i,l){if(i.length!==2)return l.error("Expected one argument.");var _=i[1];if(typeof _!="object"||Array.isArray(_))return l.error("Collator options argument must be an object.");var S=l.parse(_["case-sensitive"]!==void 0&&_["case-sensitive"],1,bn);if(!S)return null;var F=l.parse(_["diacritic-sensitive"]!==void 0&&_["diacritic-sensitive"],1,bn);if(!F)return null;var j=null;return _.locale&&!(j=l.parse(_.locale,1,Nn))?null:new Gl(S,F,j)},Gl.prototype.evaluate=function(i){return new us(this.caseSensitive.evaluate(i),this.diacriticSensitive.evaluate(i),this.locale?this.locale.evaluate(i):null)},Gl.prototype.eachChild=function(i){i(this.caseSensitive),i(this.diacriticSensitive),this.locale&&i(this.locale)},Gl.prototype.outputDefined=function(){return!1},Gl.prototype.serialize=function(){var i={};return i["case-sensitive"]=this.caseSensitive.serialize(),i["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(i.locale=this.locale.serialize()),["collator",i]};var Aa=function(i,l){this.type=bn,this.geojson=i,this.geometries=l};function Ni(i){if(i instanceof Qa&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof Aa)return!1;var l=!0;return i.eachChild(function(_){l&&!Ni(_)&&(l=!1)}),l}function lc(i){if(i instanceof Qa&&i.name==="feature-state")return!1;var l=!0;return i.eachChild(function(_){l&&!lc(_)&&(l=!1)}),l}function Ku(i,l){if(i instanceof Qa&&l.indexOf(i.name)>=0)return!1;var _=!0;return i.eachChild(function(S){_&&!Ku(S,l)&&(_=!1)}),_}Aa.parse=function(i,l){if(i.length!==2)return l.error("'within' expression requires exactly one argument, but found "+(i.length-1)+" instead.");if(Ql(i[1])){var _=i[1];if(_.type==="FeatureCollection")for(var S=0;S<_.features.length;++S){var F=_.features[S].geometry.type;if(F==="Polygon"||F==="MultiPolygon")return new Aa(_,_.features[S].geometry)}else if(_.type==="Feature"){var j=_.geometry.type;if(j==="Polygon"||j==="MultiPolygon")return new Aa(_,_.geometry)}else if(_.type==="Polygon"||_.type==="MultiPolygon")return new Aa(_,_)}return l.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Aa.prototype.evaluate=function(i){if(i.geometry()!=null&&i.canonicalID()!=null){if(i.geometryType()==="Point")return function(l,_){var S=[1/0,1/0,-1/0,-1/0],F=[1/0,1/0,-1/0,-1/0],j=l.canonicalID();if(_.type==="Polygon"){var p=Il(_.coordinates,F,j),v=Sl(l.geometry(),S,F,j);if(!ut(S,F))return!1;for(var m=0,w=v;m<w.length;m+=1)if(!jr(w[m],p))return!1}if(_.type==="MultiPolygon"){var D=Ia(_.coordinates,F,j),N=Sl(l.geometry(),S,F,j);if(!ut(S,F))return!1;for(var W=0,$=N;W<$.length;W+=1)if(!Dn($[W],D))return!1}return!0}(i,this.geometries);if(i.geometryType()==="LineString")return function(l,_){var S=[1/0,1/0,-1/0,-1/0],F=[1/0,1/0,-1/0,-1/0],j=l.canonicalID();if(_.type==="Polygon"){var p=Il(_.coordinates,F,j),v=Va(l.geometry(),S,F,j);if(!ut(S,F))return!1;for(var m=0,w=v;m<w.length;m+=1)if(!mn(w[m],p))return!1}if(_.type==="MultiPolygon"){var D=Ia(_.coordinates,F,j),N=Va(l.geometry(),S,F,j);if(!ut(S,F))return!1;for(var W=0,$=N;W<$.length;W+=1)if(!kl($[W],D))return!1}return!0}(i,this.geometries)}return!1},Aa.prototype.eachChild=function(){},Aa.prototype.outputDefined=function(){return!0},Aa.prototype.serialize=function(){return["within",this.geojson]};var lo=function(i,l){this.type=l.type,this.name=i,this.boundExpression=l};lo.parse=function(i,l){if(i.length!==2||typeof i[1]!="string")return l.error("'var' expression requires exactly one string literal argument.");var _=i[1];return l.scope.has(_)?new lo(_,l.scope.get(_)):l.error('Unknown variable "'+_+'". Make sure "'+_+'" has been bound in an enclosing "let" expression before using it.',1)},lo.prototype.evaluate=function(i){return this.boundExpression.evaluate(i)},lo.prototype.eachChild=function(){},lo.prototype.outputDefined=function(){return!1},lo.prototype.serialize=function(){return["var",this.name]};var bs=function(i,l,_,S,F){l===void 0&&(l=[]),S===void 0&&(S=new fn),F===void 0&&(F=[]),this.registry=i,this.path=l,this.key=l.map(function(j){return"["+j+"]"}).join(""),this.scope=S,this.errors=F,this.expectedType=_};function Os(i,l){for(var _,S=i.length-1,F=0,j=S,p=0;F<=j;)if((_=i[p=Math.floor((F+j)/2)])<=l){if(p===S||l<i[p+1])return p;F=p+1}else{if(!(_>l))throw new va("Input is not a number.");j=p-1}return 0}bs.prototype.parse=function(i,l,_,S,F){return F===void 0&&(F={}),l?this.concat(l,_,S)._parse(i,F):this._parse(i,F)},bs.prototype._parse=function(i,l){function _(w,D,N){return N==="assert"?new Wa(D,[w]):N==="coerce"?new gl(D,[w]):w}if(i!==null&&typeof i!="string"&&typeof i!="boolean"&&typeof i!="number"||(i=["literal",i]),Array.isArray(i)){if(i.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var S=i[0];if(typeof S!="string")return this.error("Expression name must be a string, but found "+typeof S+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var F=this.registry[S];if(F){var j=F.parse(i,this);if(!j)return null;if(this.expectedType){var p=this.expectedType,v=j.type;if(p.kind!=="string"&&p.kind!=="number"&&p.kind!=="boolean"&&p.kind!=="object"&&p.kind!=="array"||v.kind!=="value")if(p.kind!=="color"&&p.kind!=="formatted"&&p.kind!=="resolvedImage"||v.kind!=="value"&&v.kind!=="string"){if(this.checkSubtype(p,v))return null}else j=_(j,p,l.typeAnnotation||"coerce");else j=_(j,p,l.typeAnnotation||"assert")}if(!(j instanceof il)&&j.type.kind!=="resolvedImage"&&function w(D){if(D instanceof lo)return w(D.boundExpression);if(D instanceof Qa&&D.name==="error"||D instanceof Gl||D instanceof Aa)return!1;var N=D instanceof gl||D instanceof Wa,W=!0;return D.eachChild(function($){W=N?W&&w($):W&&$ instanceof il}),!!W&&Ni(D)&&Ku(D,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(j)){var m=new ol;try{j=new il(j.type,j.evaluate(m))}catch(w){return this.error(w.message),null}}return j}return this.error('Unknown expression "'+S+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(i===void 0?"'undefined' value invalid. Use null instead.":typeof i=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof i+" instead.")},bs.prototype.concat=function(i,l,_){var S=typeof i=="number"?this.path.concat(i):this.path,F=_?this.scope.concat(_):this.scope;return new bs(this.registry,S,l||null,F,this.errors)},bs.prototype.error=function(i){for(var l=[],_=arguments.length-1;_-- >0;)l[_]=arguments[_+1];var S=""+this.key+l.map(function(F){return"["+F+"]"}).join("");this.errors.push(new Sr(S,i))},bs.prototype.checkSubtype=function(i,l){var _=ns(i,l);return _&&this.error(_),_};var Nl=function(i,l,_){this.type=i,this.input=l,this.labels=[],this.outputs=[];for(var S=0,F=_;S<F.length;S+=1){var j=F[S],p=j[1];this.labels.push(j[0]),this.outputs.push(p)}};function Io(i,l,_){return i*(1-_)+l*_}Nl.parse=function(i,l){if(i.length-1<4)return l.error("Expected at least 4 arguments, but found only "+(i.length-1)+".");if((i.length-1)%2!=0)return l.error("Expected an even number of arguments.");var _=l.parse(i[1],1,Lr);if(!_)return null;var S=[],F=null;l.expectedType&&l.expectedType.kind!=="value"&&(F=l.expectedType);for(var j=1;j<i.length;j+=2){var p=j===1?-1/0:i[j],v=i[j+1],m=j,w=j+1;if(typeof p!="number")return l.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',m);if(S.length&&S[S.length-1][0]>=p)return l.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',m);var D=l.parse(v,w,F);if(!D)return null;F=F||D.type,S.push([p,D])}return new Nl(F,_,S)},Nl.prototype.evaluate=function(i){var l=this.labels,_=this.outputs;if(l.length===1)return _[0].evaluate(i);var S=this.input.evaluate(i);if(S<=l[0])return _[0].evaluate(i);var F=l.length;return S>=l[F-1]?_[F-1].evaluate(i):_[Os(l,S)].evaluate(i)},Nl.prototype.eachChild=function(i){i(this.input);for(var l=0,_=this.outputs;l<_.length;l+=1)i(_[l])},Nl.prototype.outputDefined=function(){return this.outputs.every(function(i){return i.outputDefined()})},Nl.prototype.serialize=function(){for(var i=["step",this.input.serialize()],l=0;l<this.labels.length;l++)l>0&&i.push(this.labels[l]),i.push(this.outputs[l].serialize());return i};var eu=Object.freeze({__proto__:null,number:Io,color:function(i,l,_){return new Fo(Io(i.r,l.r,_),Io(i.g,l.g,_),Io(i.b,l.b,_),Io(i.a,l.a,_))},array:function(i,l,_){return i.map(function(S,F){return Io(S,l[F],_)})}}),Tl=6/29*3*(6/29),Fu=Math.PI/180,Ju=180/Math.PI;function al(i){return i>.008856451679035631?Math.pow(i,1/3):i/Tl+4/29}function Kc(i){return i>6/29?i*i*i:Tl*(i-4/29)}function ou(i){return 255*(i<=.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055)}function Ks(i){return(i/=255)<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Lp(i){var l=Ks(i.r),_=Ks(i.g),S=Ks(i.b),F=al((.4124564*l+.3575761*_+.1804375*S)/.95047),j=al((.2126729*l+.7151522*_+.072175*S)/1);return{l:116*j-16,a:500*(F-j),b:200*(j-al((.0193339*l+.119192*_+.9503041*S)/1.08883)),alpha:i.a}}function gf(i){var l=(i.l+16)/116,_=isNaN(i.a)?l:l+i.a/500,S=isNaN(i.b)?l:l-i.b/200;return l=1*Kc(l),_=.95047*Kc(_),S=1.08883*Kc(S),new Fo(ou(3.2404542*_-1.5371385*l-.4985314*S),ou(-.969266*_+1.8760108*l+.041556*S),ou(.0556434*_-.2040259*l+1.0572252*S),i.alpha)}function Of(i,l,_){var S=l-i;return i+_*(S>180||S<-180?S-360*Math.round(S/360):S)}var qh={forward:Lp,reverse:gf,interpolate:function(i,l,_){return{l:Io(i.l,l.l,_),a:Io(i.a,l.a,_),b:Io(i.b,l.b,_),alpha:Io(i.alpha,l.alpha,_)}}},zc={forward:function(i){var l=Lp(i),_=l.l,S=l.a,F=l.b,j=Math.atan2(F,S)*Ju;return{h:j<0?j+360:j,c:Math.sqrt(S*S+F*F),l:_,alpha:i.a}},reverse:function(i){var l=i.h*Fu,_=i.c;return gf({l:i.l,a:Math.cos(l)*_,b:Math.sin(l)*_,alpha:i.alpha})},interpolate:function(i,l,_){return{h:Of(i.h,l.h,_),c:Io(i.c,l.c,_),l:Io(i.l,l.l,_),alpha:Io(i.alpha,l.alpha,_)}}},Oh=Object.freeze({__proto__:null,lab:qh,hcl:zc}),Ms=function(i,l,_,S,F){this.type=i,this.operator=l,this.interpolation=_,this.input=S,this.labels=[],this.outputs=[];for(var j=0,p=F;j<p.length;j+=1){var v=p[j],m=v[1];this.labels.push(v[0]),this.outputs.push(m)}};function Jc(i,l,_,S){var F=S-_,j=i-_;return F===0?0:l===1?j/F:(Math.pow(l,j)-1)/(Math.pow(l,F)-1)}Ms.interpolationFactor=function(i,l,_,S){var F=0;if(i.name==="exponential")F=Jc(l,i.base,_,S);else if(i.name==="linear")F=Jc(l,1,_,S);else if(i.name==="cubic-bezier"){var j=i.controlPoints;F=new de(j[0],j[1],j[2],j[3]).solve(Jc(l,1,_,S))}return F},Ms.parse=function(i,l){var _=i[0],S=i[1],F=i[2],j=i.slice(3);if(!Array.isArray(S)||S.length===0)return l.error("Expected an interpolation type expression.",1);if(S[0]==="linear")S={name:"linear"};else if(S[0]==="exponential"){var p=S[1];if(typeof p!="number")return l.error("Exponential interpolation requires a numeric base.",1,1);S={name:"exponential",base:p}}else{if(S[0]!=="cubic-bezier")return l.error("Unknown interpolation type "+String(S[0]),1,0);var v=S.slice(1);if(v.length!==4||v.some(function(we){return typeof we!="number"||we<0||we>1}))return l.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);S={name:"cubic-bezier",controlPoints:v}}if(i.length-1<4)return l.error("Expected at least 4 arguments, but found only "+(i.length-1)+".");if((i.length-1)%2!=0)return l.error("Expected an even number of arguments.");if(!(F=l.parse(F,2,Lr)))return null;var m=[],w=null;_==="interpolate-hcl"||_==="interpolate-lab"?w=En:l.expectedType&&l.expectedType.kind!=="value"&&(w=l.expectedType);for(var D=0;D<j.length;D+=2){var N=j[D],W=j[D+1],$=D+3,ie=D+4;if(typeof N!="number")return l.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',$);if(m.length&&m[m.length-1][0]>=N)return l.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',$);var pe=l.parse(W,ie,w);if(!pe)return null;w=w||pe.type,m.push([N,pe])}return w.kind==="number"||w.kind==="color"||w.kind==="array"&&w.itemType.kind==="number"&&typeof w.N=="number"?new Ms(w,_,S,F,m):l.error("Type "+Wo(w)+" is not interpolatable.")},Ms.prototype.evaluate=function(i){var l=this.labels,_=this.outputs;if(l.length===1)return _[0].evaluate(i);var S=this.input.evaluate(i);if(S<=l[0])return _[0].evaluate(i);var F=l.length;if(S>=l[F-1])return _[F-1].evaluate(i);var j=Os(l,S),p=Ms.interpolationFactor(this.interpolation,S,l[j],l[j+1]),v=_[j].evaluate(i),m=_[j+1].evaluate(i);return this.operator==="interpolate"?eu[this.type.kind.toLowerCase()](v,m,p):this.operator==="interpolate-hcl"?zc.reverse(zc.interpolate(zc.forward(v),zc.forward(m),p)):qh.reverse(qh.interpolate(qh.forward(v),qh.forward(m),p))},Ms.prototype.eachChild=function(i){i(this.input);for(var l=0,_=this.outputs;l<_.length;l+=1)i(_[l])},Ms.prototype.outputDefined=function(){return this.outputs.every(function(i){return i.outputDefined()})},Ms.prototype.serialize=function(){var i;i=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var l=[this.operator,i,this.input.serialize()],_=0;_<this.labels.length;_++)l.push(this.labels[_],this.outputs[_].serialize());return l};var Yh=function(i,l){this.type=i,this.args=l};Yh.parse=function(i,l){if(i.length<2)return l.error("Expectected at least one argument.");var _=null,S=l.expectedType;S&&S.kind!=="value"&&(_=S);for(var F=[],j=0,p=i.slice(1);j<p.length;j+=1){var v=l.parse(p[j],1+F.length,_,void 0,{typeAnnotation:"omit"});if(!v)return null;_=_||v.type,F.push(v)}var m=S&&F.some(function(w){return ns(S,w.type)});return new Yh(m?On:_,F)},Yh.prototype.evaluate=function(i){for(var l,_=null,S=0,F=0,j=this.args;F<j.length&&(S++,(_=j[F].evaluate(i))&&_ instanceof Fa&&!_.available&&(l||(l=_.name),_=null,S===this.args.length&&(_=l)),_===null);F+=1);return _},Yh.prototype.eachChild=function(i){this.args.forEach(i)},Yh.prototype.outputDefined=function(){return this.args.every(function(i){return i.outputDefined()})},Yh.prototype.serialize=function(){var i=["coalesce"];return this.eachChild(function(l){i.push(l.serialize())}),i};var Qc=function(i,l){this.type=l.type,this.bindings=[].concat(i),this.result=l};Qc.prototype.evaluate=function(i){return this.result.evaluate(i)},Qc.prototype.eachChild=function(i){for(var l=0,_=this.bindings;l<_.length;l+=1)i(_[l][1]);i(this.result)},Qc.parse=function(i,l){if(i.length<4)return l.error("Expected at least 3 arguments, but found "+(i.length-1)+" instead.");for(var _=[],S=1;S<i.length-1;S+=2){var F=i[S];if(typeof F!="string")return l.error("Expected string, but found "+typeof F+" instead.",S);if(/[^a-zA-Z0-9_]/.test(F))return l.error("Variable names must contain only alphanumeric characters or '_'.",S);var j=l.parse(i[S+1],S+1);if(!j)return null;_.push([F,j])}var p=l.parse(i[i.length-1],i.length-1,l.expectedType,_);return p?new Qc(_,p):null},Qc.prototype.outputDefined=function(){return this.result.outputDefined()},Qc.prototype.serialize=function(){for(var i=["let"],l=0,_=this.bindings;l<_.length;l+=1){var S=_[l];i.push(S[0],S[1].serialize())}return i.push(this.result.serialize()),i};var uc=function(i,l,_){this.type=i,this.index=l,this.input=_};uc.parse=function(i,l){if(i.length!==3)return l.error("Expected 2 arguments, but found "+(i.length-1)+" instead.");var _=l.parse(i[1],1,Lr),S=l.parse(i[2],2,Ga(l.expectedType||On));return _&&S?new uc(S.type.itemType,_,S):null},uc.prototype.evaluate=function(i){var l=this.index.evaluate(i),_=this.input.evaluate(i);if(l<0)throw new va("Array index out of bounds: "+l+" < 0.");if(l>=_.length)throw new va("Array index out of bounds: "+l+" > "+(_.length-1)+".");if(l!==Math.floor(l))throw new va("Array index must be an integer, but found "+l+" instead.");return _[l]},uc.prototype.eachChild=function(i){i(this.index),i(this.input)},uc.prototype.outputDefined=function(){return!1},uc.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var eh=function(i,l){this.type=bn,this.needle=i,this.haystack=l};eh.parse=function(i,l){if(i.length!==3)return l.error("Expected 2 arguments, but found "+(i.length-1)+" instead.");var _=l.parse(i[1],1,On),S=l.parse(i[2],2,On);return _&&S?Yo(_.type,[bn,Nn,Lr,xn,On])?new eh(_,S):l.error("Expected first argument to be of type boolean, string, number or null, but found "+Wo(_.type)+" instead"):null},eh.prototype.evaluate=function(i){var l=this.needle.evaluate(i),_=this.haystack.evaluate(i);if(!_)return!1;if(!_a(l,["boolean","string","number","null"]))throw new va("Expected first argument to be of type boolean, string, number or null, but found "+Wo(oa(l))+" instead.");if(!_a(_,["string","array"]))throw new va("Expected second argument to be of type array or string, but found "+Wo(oa(_))+" instead.");return _.indexOf(l)>=0},eh.prototype.eachChild=function(i){i(this.needle),i(this.haystack)},eh.prototype.outputDefined=function(){return!0},eh.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var yh=function(i,l,_){this.type=Lr,this.needle=i,this.haystack=l,this.fromIndex=_};yh.parse=function(i,l){if(i.length<=2||i.length>=5)return l.error("Expected 3 or 4 arguments, but found "+(i.length-1)+" instead.");var _=l.parse(i[1],1,On),S=l.parse(i[2],2,On);if(!_||!S)return null;if(!Yo(_.type,[bn,Nn,Lr,xn,On]))return l.error("Expected first argument to be of type boolean, string, number or null, but found "+Wo(_.type)+" instead");if(i.length===4){var F=l.parse(i[3],3,Lr);return F?new yh(_,S,F):null}return new yh(_,S)},yh.prototype.evaluate=function(i){var l=this.needle.evaluate(i),_=this.haystack.evaluate(i);if(!_a(l,["boolean","string","number","null"]))throw new va("Expected first argument to be of type boolean, string, number or null, but found "+Wo(oa(l))+" instead.");if(!_a(_,["string","array"]))throw new va("Expected second argument to be of type array or string, but found "+Wo(oa(_))+" instead.");if(this.fromIndex){var S=this.fromIndex.evaluate(i);return _.indexOf(l,S)}return _.indexOf(l)},yh.prototype.eachChild=function(i){i(this.needle),i(this.haystack),this.fromIndex&&i(this.fromIndex)},yh.prototype.outputDefined=function(){return!1},yh.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var i=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),i]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var sl=function(i,l,_,S,F,j){this.inputType=i,this.type=l,this.input=_,this.cases=S,this.outputs=F,this.otherwise=j};sl.parse=function(i,l){if(i.length<5)return l.error("Expected at least 4 arguments, but found only "+(i.length-1)+".");if(i.length%2!=1)return l.error("Expected an even number of arguments.");var _,S;l.expectedType&&l.expectedType.kind!=="value"&&(S=l.expectedType);for(var F={},j=[],p=2;p<i.length-1;p+=2){var v=i[p],m=i[p+1];Array.isArray(v)||(v=[v]);var w=l.concat(p);if(v.length===0)return w.error("Expected at least one branch label.");for(var D=0,N=v;D<N.length;D+=1){var W=N[D];if(typeof W!="number"&&typeof W!="string")return w.error("Branch labels must be numbers or strings.");if(typeof W=="number"&&Math.abs(W)>Number.MAX_SAFE_INTEGER)return w.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof W=="number"&&Math.floor(W)!==W)return w.error("Numeric branch labels must be integer values.");if(_){if(w.checkSubtype(_,oa(W)))return null}else _=oa(W);if(F[String(W)]!==void 0)return w.error("Branch labels must be unique.");F[String(W)]=j.length}var $=l.parse(m,p,S);if(!$)return null;S=S||$.type,j.push($)}var ie=l.parse(i[1],1,On);if(!ie)return null;var pe=l.parse(i[i.length-1],i.length-1,S);return pe?ie.type.kind!=="value"&&l.concat(1).checkSubtype(_,ie.type)?null:new sl(_,S,ie,F,j,pe):null},sl.prototype.evaluate=function(i){var l=this.input.evaluate(i);return(oa(l)===this.inputType&&this.outputs[this.cases[l]]||this.otherwise).evaluate(i)},sl.prototype.eachChild=function(i){i(this.input),this.outputs.forEach(i),i(this.otherwise)},sl.prototype.outputDefined=function(){return this.outputs.every(function(i){return i.outputDefined()})&&this.otherwise.outputDefined()},sl.prototype.serialize=function(){for(var i=this,l=["match",this.input.serialize()],_=[],S={},F=0,j=Object.keys(this.cases).sort();F<j.length;F+=1){var p=j[F];(N=S[this.cases[p]])===void 0?(S[this.cases[p]]=_.length,_.push([this.cases[p],[p]])):_[N][1].push(p)}for(var v=function($){return i.inputType.kind==="number"?Number($):$},m=0,w=_;m<w.length;m+=1){var D=w[m],N=D[0],W=D[1];l.push(W.length===1?v(W[0]):W.map(v)),l.push(this.outputs[outputIndex$1].serialize())}return l.push(this.otherwise.serialize()),l};var Uc=function(i,l,_){this.type=i,this.branches=l,this.otherwise=_};Uc.parse=function(i,l){if(i.length<4)return l.error("Expected at least 3 arguments, but found only "+(i.length-1)+".");if(i.length%2!=0)return l.error("Expected an odd number of arguments.");var _;l.expectedType&&l.expectedType.kind!=="value"&&(_=l.expectedType);for(var S=[],F=1;F<i.length-1;F+=2){var j=l.parse(i[F],F,bn);if(!j)return null;var p=l.parse(i[F+1],F+1,_);if(!p)return null;S.push([j,p]),_=_||p.type}var v=l.parse(i[i.length-1],i.length-1,_);return v?new Uc(_,S,v):null},Uc.prototype.evaluate=function(i){for(var l=0,_=this.branches;l<_.length;l+=1){var S=_[l],F=S[1];if(S[0].evaluate(i))return F.evaluate(i)}return this.otherwise.evaluate(i)},Uc.prototype.eachChild=function(i){for(var l=0,_=this.branches;l<_.length;l+=1){var S=_[l],F=S[1];i(S[0]),i(F)}i(this.otherwise)},Uc.prototype.outputDefined=function(){return this.branches.every(function(i){return i[1].outputDefined()})&&this.otherwise.outputDefined()},Uc.prototype.serialize=function(){var i=["case"];return this.eachChild(function(l){i.push(l.serialize())}),i};var bc=function(i,l,_,S){this.type=i,this.input=l,this.beginIndex=_,this.endIndex=S};function fp(i,l){return i==="=="||i==="!="?l.kind==="boolean"||l.kind==="string"||l.kind==="number"||l.kind==="null"||l.kind==="value":l.kind==="string"||l.kind==="number"||l.kind==="value"}function dp(i,l,_,S){return S.compare(l,_)===0}function Ps(i,l,_){var S=i!=="=="&&i!=="!=";return function(){function F(j,p,v){this.type=bn,this.lhs=j,this.rhs=p,this.collator=v,this.hasUntypedArgument=j.type.kind==="value"||p.type.kind==="value"}return F.parse=function(j,p){if(j.length!==3&&j.length!==4)return p.error("Expected two or three arguments.");var v=j[0],m=p.parse(j[1],1,On);if(!m)return null;if(!fp(v,m.type))return p.concat(1).error('"'+v+`" comparisons are not supported for type '`+Wo(m.type)+"'.");var w=p.parse(j[2],2,On);if(!w)return null;if(!fp(v,w.type))return p.concat(2).error('"'+v+`" comparisons are not supported for type '`+Wo(w.type)+"'.");if(m.type.kind!==w.type.kind&&m.type.kind!=="value"&&w.type.kind!=="value")return p.error("Cannot compare types '"+Wo(m.type)+"' and '"+Wo(w.type)+"'.");S&&(m.type.kind==="value"&&w.type.kind!=="value"?m=new Wa(w.type,[m]):m.type.kind!=="value"&&w.type.kind==="value"&&(w=new Wa(m.type,[w])));var D=null;if(j.length===4){if(m.type.kind!=="string"&&w.type.kind!=="string"&&m.type.kind!=="value"&&w.type.kind!=="value")return p.error("Cannot use collator to compare non-string types.");if(!(D=p.parse(j[3],3,Ao)))return null}return new F(m,w,D)},F.prototype.evaluate=function(j){var p=this.lhs.evaluate(j),v=this.rhs.evaluate(j);if(S&&this.hasUntypedArgument){var m=oa(p),w=oa(v);if(m.kind!==w.kind||m.kind!=="string"&&m.kind!=="number")throw new va('Expected arguments for "'+i+'" to be (string, string) or (number, number), but found ('+m.kind+", "+w.kind+") instead.")}if(this.collator&&!S&&this.hasUntypedArgument){var D=oa(p),N=oa(v);if(D.kind!=="string"||N.kind!=="string")return l(j,p,v)}return this.collator?_(j,p,v,this.collator.evaluate(j)):l(j,p,v)},F.prototype.eachChild=function(j){j(this.lhs),j(this.rhs),this.collator&&j(this.collator)},F.prototype.outputDefined=function(){return!0},F.prototype.serialize=function(){var j=[i];return this.eachChild(function(p){j.push(p.serialize())}),j},F}()}bc.parse=function(i,l){if(i.length<=2||i.length>=5)return l.error("Expected 3 or 4 arguments, but found "+(i.length-1)+" instead.");var _=l.parse(i[1],1,On),S=l.parse(i[2],2,Lr);if(!_||!S)return null;if(!Yo(_.type,[Ga(On),Nn,On]))return l.error("Expected first argument to be of type array or string, but found "+Wo(_.type)+" instead");if(i.length===4){var F=l.parse(i[3],3,Lr);return F?new bc(_.type,_,S,F):null}return new bc(_.type,_,S)},bc.prototype.evaluate=function(i){var l=this.input.evaluate(i),_=this.beginIndex.evaluate(i);if(!_a(l,["string","array"]))throw new va("Expected first argument to be of type array or string, but found "+Wo(oa(l))+" instead.");if(this.endIndex){var S=this.endIndex.evaluate(i);return l.slice(_,S)}return l.slice(_)},bc.prototype.eachChild=function(i){i(this.input),i(this.beginIndex),this.endIndex&&i(this.endIndex)},bc.prototype.outputDefined=function(){return!1},bc.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var i=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),i]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Gf=Ps("==",function(i,l,_){return l===_},dp),Xp=Ps("!=",function(i,l,_){return l!==_},function(i,l,_,S){return!dp(0,l,_,S)}),cc=Ps("<",function(i,l,_){return l<_},function(i,l,_,S){return S.compare(l,_)<0}),zl=Ps(">",function(i,l,_){return l>_},function(i,l,_,S){return S.compare(l,_)>0}),Ec=Ps("<=",function(i,l,_){return l<=_},function(i,l,_,S){return S.compare(l,_)<=0}),th=Ps(">=",function(i,l,_){return l>=_},function(i,l,_,S){return S.compare(l,_)>=0}),vu=function(i,l,_,S,F){this.type=Nn,this.number=i,this.locale=l,this.currency=_,this.minFractionDigits=S,this.maxFractionDigits=F};vu.parse=function(i,l){if(i.length!==3)return l.error("Expected two arguments.");var _=l.parse(i[1],1,Lr);if(!_)return null;var S=i[2];if(typeof S!="object"||Array.isArray(S))return l.error("NumberFormat options argument must be an object.");var F=null;if(S.locale&&!(F=l.parse(S.locale,1,Nn)))return null;var j=null;if(S.currency&&!(j=l.parse(S.currency,1,Nn)))return null;var p=null;if(S["min-fraction-digits"]&&!(p=l.parse(S["min-fraction-digits"],1,Lr)))return null;var v=null;return S["max-fraction-digits"]&&!(v=l.parse(S["max-fraction-digits"],1,Lr))?null:new vu(_,F,j,p,v)},vu.prototype.evaluate=function(i){return new Intl.NumberFormat(this.locale?this.locale.evaluate(i):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(i):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(i):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(i):void 0}).format(this.number.evaluate(i))},vu.prototype.eachChild=function(i){i(this.number),this.locale&&i(this.locale),this.currency&&i(this.currency),this.minFractionDigits&&i(this.minFractionDigits),this.maxFractionDigits&&i(this.maxFractionDigits)},vu.prototype.outputDefined=function(){return!1},vu.prototype.serialize=function(){var i={};return this.locale&&(i.locale=this.locale.serialize()),this.currency&&(i.currency=this.currency.serialize()),this.minFractionDigits&&(i["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(i["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),i]};var xh=function(i){this.type=Lr,this.input=i};xh.parse=function(i,l){if(i.length!==2)return l.error("Expected 1 argument, but found "+(i.length-1)+" instead.");var _=l.parse(i[1],1);return _?_.type.kind!=="array"&&_.type.kind!=="string"&&_.type.kind!=="value"?l.error("Expected argument of type string or array, but found "+Wo(_.type)+" instead."):new xh(_):null},xh.prototype.evaluate=function(i){var l=this.input.evaluate(i);if(typeof l=="string"||Array.isArray(l))return l.length;throw new va("Expected value to be of type string or array, but found "+Wo(oa(l))+" instead.")},xh.prototype.eachChild=function(i){i(this.input)},xh.prototype.outputDefined=function(){return!1},xh.prototype.serialize=function(){var i=["length"];return this.eachChild(function(l){i.push(l.serialize())}),i};var qa={"==":Gf,"!=":Xp,">":zl,"<":cc,">=":th,"<=":Ec,array:Wa,at:uc,boolean:Wa,case:Uc,coalesce:Yh,collator:Gl,format:Ds,image:Rl,in:eh,"index-of":yh,interpolate:Ms,"interpolate-hcl":Ms,"interpolate-lab":Ms,length:xh,let:Qc,literal:il,match:sl,number:Wa,"number-format":vu,object:Wa,slice:bc,step:Nl,string:Wa,"to-boolean":gl,"to-color":gl,"to-number":gl,"to-string":gl,var:lo,within:Aa};function Hs(i,l){var _=l[0],S=l[1],F=l[2],j=l[3];_=_.evaluate(i),S=S.evaluate(i),F=F.evaluate(i);var p=j?j.evaluate(i):1,v=sc(_,S,F,p);if(v)throw new va(v);return new Fo(_/255*p,S/255*p,F/255*p,p)}function Ep(i,l){return i in l}function Na(i,l){var _=l[i];return _===void 0?null:_}function Qu(i){return{type:i}}function Is(i){return{result:"success",value:i}}function ys(i){return{result:"error",value:i}}function ec(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function Bf(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function es(i){return!!i.expression&&i.expression.interpolated}function Bs(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function wc(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function qp(i){return i}function Sc(i,l,_){return i!==void 0?i:l!==void 0?l:_!==void 0?_:void 0}function $h(i,l,_,S,F){return Sc(typeof _===F?S[_]:void 0,i.default,l.default)}function Xo(i,l,_){if(Bs(_)!=="number")return Sc(i.default,l.default);var S=i.stops.length;if(S===1||_<=i.stops[0][0])return i.stops[0][1];if(_>=i.stops[S-1][0])return i.stops[S-1][1];var F=Os(i.stops.map(function(j){return j[0]}),_);return i.stops[F][1]}function au(i,l,_){var S=i.base!==void 0?i.base:1;if(Bs(_)!=="number")return Sc(i.default,l.default);var F=i.stops.length;if(F===1||_<=i.stops[0][0])return i.stops[0][1];if(_>=i.stops[F-1][0])return i.stops[F-1][1];var j=Os(i.stops.map(function(N){return N[0]}),_),p=function(N,W,$,ie){var pe=ie-$,we=N-$;return pe===0?0:W===1?we/pe:(Math.pow(W,we)-1)/(Math.pow(W,pe)-1)}(_,S,i.stops[j][0],i.stops[j+1][0]),v=i.stops[j][1],m=i.stops[j+1][1],w=eu[l.type]||qp;if(i.colorSpace&&i.colorSpace!=="rgb"){var D=Oh[i.colorSpace];w=function(N,W){return D.reverse(D.interpolate(D.forward(N),D.forward(W),p))}}return typeof v.evaluate=="function"?{evaluate:function(){for(var N=[],W=arguments.length;W--;)N[W]=arguments[W];var $=v.evaluate.apply(void 0,N),ie=m.evaluate.apply(void 0,N);if($!==void 0&&ie!==void 0)return w($,ie,p)}}:w(v,m,p)}function dl(i,l,_){return l.type==="color"?_=Fo.parse(_):l.type==="formatted"?_=Ba.fromString(_.toString()):l.type==="resolvedImage"?_=Fa.fromString(_.toString()):Bs(_)===l.type||l.type==="enum"&&l.values[_]||(_=void 0),Sc(_,i.default,l.default)}Qa.register(qa,{error:[{kind:"error"},[Nn],function(i,l){throw new va(l[0].evaluate(i))}],typeof:[Nn,[On],function(i,l){return Wo(oa(l[0].evaluate(i)))}],"to-rgba":[Ga(Lr,4),[En],function(i,l){return l[0].evaluate(i).toArray()}],rgb:[En,[Lr,Lr,Lr],Hs],rgba:[En,[Lr,Lr,Lr,Lr],Hs],has:{type:bn,overloads:[[[Nn],function(i,l){return Ep(l[0].evaluate(i),i.properties())}],[[Nn,io],function(i,l){var _=l[1];return Ep(l[0].evaluate(i),_.evaluate(i))}]]},get:{type:On,overloads:[[[Nn],function(i,l){return Na(l[0].evaluate(i),i.properties())}],[[Nn,io],function(i,l){var _=l[1];return Na(l[0].evaluate(i),_.evaluate(i))}]]},"feature-state":[On,[Nn],function(i,l){return Na(l[0].evaluate(i),i.featureState||{})}],properties:[io,[],function(i){return i.properties()}],"geometry-type":[Nn,[],function(i){return i.geometryType()}],id:[On,[],function(i){return i.id()}],zoom:[Lr,[],function(i){return i.globals.zoom}],"heatmap-density":[Lr,[],function(i){return i.globals.heatmapDensity||0}],"line-progress":[Lr,[],function(i){return i.globals.lineProgress||0}],accumulated:[On,[],function(i){return i.globals.accumulated===void 0?null:i.globals.accumulated}],"+":[Lr,Qu(Lr),function(i,l){for(var _=0,S=0,F=l;S<F.length;S+=1)_+=F[S].evaluate(i);return _}],"*":[Lr,Qu(Lr),function(i,l){for(var _=1,S=0,F=l;S<F.length;S+=1)_*=F[S].evaluate(i);return _}],"-":{type:Lr,overloads:[[[Lr,Lr],function(i,l){var _=l[1];return l[0].evaluate(i)-_.evaluate(i)}],[[Lr],function(i,l){return-l[0].evaluate(i)}]]},"/":[Lr,[Lr,Lr],function(i,l){var _=l[1];return l[0].evaluate(i)/_.evaluate(i)}],"%":[Lr,[Lr,Lr],function(i,l){var _=l[1];return l[0].evaluate(i)%_.evaluate(i)}],ln2:[Lr,[],function(){return Math.LN2}],pi:[Lr,[],function(){return Math.PI}],e:[Lr,[],function(){return Math.E}],"^":[Lr,[Lr,Lr],function(i,l){var _=l[1];return Math.pow(l[0].evaluate(i),_.evaluate(i))}],sqrt:[Lr,[Lr],function(i,l){return Math.sqrt(l[0].evaluate(i))}],log10:[Lr,[Lr],function(i,l){return Math.log(l[0].evaluate(i))/Math.LN10}],ln:[Lr,[Lr],function(i,l){return Math.log(l[0].evaluate(i))}],log2:[Lr,[Lr],function(i,l){return Math.log(l[0].evaluate(i))/Math.LN2}],sin:[Lr,[Lr],function(i,l){return Math.sin(l[0].evaluate(i))}],cos:[Lr,[Lr],function(i,l){return Math.cos(l[0].evaluate(i))}],tan:[Lr,[Lr],function(i,l){return Math.tan(l[0].evaluate(i))}],asin:[Lr,[Lr],function(i,l){return Math.asin(l[0].evaluate(i))}],acos:[Lr,[Lr],function(i,l){return Math.acos(l[0].evaluate(i))}],atan:[Lr,[Lr],function(i,l){return Math.atan(l[0].evaluate(i))}],min:[Lr,Qu(Lr),function(i,l){return Math.min.apply(Math,l.map(function(_){return _.evaluate(i)}))}],max:[Lr,Qu(Lr),function(i,l){return Math.max.apply(Math,l.map(function(_){return _.evaluate(i)}))}],abs:[Lr,[Lr],function(i,l){return Math.abs(l[0].evaluate(i))}],round:[Lr,[Lr],function(i,l){var _=l[0].evaluate(i);return _<0?-Math.round(-_):Math.round(_)}],floor:[Lr,[Lr],function(i,l){return Math.floor(l[0].evaluate(i))}],ceil:[Lr,[Lr],function(i,l){return Math.ceil(l[0].evaluate(i))}],"filter-==":[bn,[Nn,On],function(i,l){var _=l[0],S=l[1];return i.properties()[_.value]===S.value}],"filter-id-==":[bn,[On],function(i,l){var _=l[0];return i.id()===_.value}],"filter-type-==":[bn,[Nn],function(i,l){var _=l[0];return i.geometryType()===_.value}],"filter-<":[bn,[Nn,On],function(i,l){var _=l[0],S=l[1],F=i.properties()[_.value],j=S.value;return typeof F==typeof j&&F<j}],"filter-id-<":[bn,[On],function(i,l){var _=l[0],S=i.id(),F=_.value;return typeof S==typeof F&&S<F}],"filter->":[bn,[Nn,On],function(i,l){var _=l[0],S=l[1],F=i.properties()[_.value],j=S.value;return typeof F==typeof j&&F>j}],"filter-id->":[bn,[On],function(i,l){var _=l[0],S=i.id(),F=_.value;return typeof S==typeof F&&S>F}],"filter-<=":[bn,[Nn,On],function(i,l){var _=l[0],S=l[1],F=i.properties()[_.value],j=S.value;return typeof F==typeof j&&F<=j}],"filter-id-<=":[bn,[On],function(i,l){var _=l[0],S=i.id(),F=_.value;return typeof S==typeof F&&S<=F}],"filter->=":[bn,[Nn,On],function(i,l){var _=l[0],S=l[1],F=i.properties()[_.value],j=S.value;return typeof F==typeof j&&F>=j}],"filter-id->=":[bn,[On],function(i,l){var _=l[0],S=i.id(),F=_.value;return typeof S==typeof F&&S>=F}],"filter-has":[bn,[On],function(i,l){return l[0].value in i.properties()}],"filter-has-id":[bn,[],function(i){return i.id()!==null&&i.id()!==void 0}],"filter-type-in":[bn,[Ga(Nn)],function(i,l){return l[0].value.indexOf(i.geometryType())>=0}],"filter-id-in":[bn,[Ga(On)],function(i,l){return l[0].value.indexOf(i.id())>=0}],"filter-in-small":[bn,[Nn,Ga(On)],function(i,l){var _=l[0];return l[1].value.indexOf(i.properties()[_.value])>=0}],"filter-in-large":[bn,[Nn,Ga(On)],function(i,l){var _=l[0],S=l[1];return function(F,j,p,v){for(;p<=v;){var m=p+v>>1;if(j[m]===F)return!0;j[m]>F?v=m-1:p=m+1}return!1}(i.properties()[_.value],S.value,0,S.value.length-1)}],all:{type:bn,overloads:[[[bn,bn],function(i,l){var _=l[1];return l[0].evaluate(i)&&_.evaluate(i)}],[Qu(bn),function(i,l){for(var _=0,S=l;_<S.length;_+=1)if(!S[_].evaluate(i))return!1;return!0}]]},any:{type:bn,overloads:[[[bn,bn],function(i,l){var _=l[1];return l[0].evaluate(i)||_.evaluate(i)}],[Qu(bn),function(i,l){for(var _=0,S=l;_<S.length;_+=1)if(S[_].evaluate(i))return!0;return!1}]]},"!":[bn,[bn],function(i,l){return!l[0].evaluate(i)}],"is-supported-script":[bn,[Nn],function(i,l){var _=i.globals&&i.globals.isSupportedScript;return!_||_(l[0].evaluate(i))}],upcase:[Nn,[Nn],function(i,l){return l[0].evaluate(i).toUpperCase()}],downcase:[Nn,[Nn],function(i,l){return l[0].evaluate(i).toLowerCase()}],concat:[Nn,Qu(On),function(i,l){return l.map(function(_){return Zo(_.evaluate(i))}).join("")}],"resolved-locale":[Nn,[Ao],function(i,l){return l[0].evaluate(i).resolvedLocale()}]});var tc=function(i,l){this.expression=i,this._warningHistory={},this._evaluator=new ol,this._defaultValue=l?function(_){return _.type==="color"&&wc(_.default)?new Fo(0,0,0,0):_.type==="color"?Fo.parse(_.default)||null:_.default===void 0?null:_.default}(l):null,this._enumValues=l&&l.type==="enum"?l.values:null};function bh(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in qa}function mp(i,l){var _=new bs(qa,[],l?function(F){var j={color:En,string:Nn,number:Lr,enum:Nn,boolean:bn,formatted:ia,resolvedImage:Ho};return F.type==="array"?Ga(j[F.value]||On,F.length):j[F.type]}(l):void 0),S=_.parse(i,void 0,void 0,void 0,l&&l.type==="string"?{typeAnnotation:"coerce"}:void 0);return S?Is(new tc(S,l)):ys(_.errors)}tc.prototype.evaluateWithoutErrorHandling=function(i,l,_,S,F,j){return this._evaluator.globals=i,this._evaluator.feature=l,this._evaluator.featureState=_,this._evaluator.canonical=S,this._evaluator.availableImages=F||null,this._evaluator.formattedSection=j,this.expression.evaluate(this._evaluator)},tc.prototype.evaluate=function(i,l,_,S,F,j){this._evaluator.globals=i,this._evaluator.feature=l||null,this._evaluator.featureState=_||null,this._evaluator.canonical=S,this._evaluator.availableImages=F||null,this._evaluator.formattedSection=j||null;try{var p=this.expression.evaluate(this._evaluator);if(p==null||typeof p=="number"&&p!=p)return this._defaultValue;if(this._enumValues&&!(p in this._enumValues))throw new va("Expected value to be one of "+Object.keys(this._enumValues).map(function(v){return JSON.stringify(v)}).join(", ")+", but found "+JSON.stringify(p)+" instead.");return p}catch(v){return this._warningHistory[v.message]||(this._warningHistory[v.message]=!0,typeof console!="undefined"&&console.warn(v.message)),this._defaultValue}};var Kh=function(i,l){this.kind=i,this._styleExpression=l,this.isStateDependent=i!=="constant"&&!lc(l.expression)};Kh.prototype.evaluateWithoutErrorHandling=function(i,l,_,S,F,j){return this._styleExpression.evaluateWithoutErrorHandling(i,l,_,S,F,j)},Kh.prototype.evaluate=function(i,l,_,S,F,j){return this._styleExpression.evaluate(i,l,_,S,F,j)};var Zc=function(i,l,_,S){this.kind=i,this.zoomStops=_,this._styleExpression=l,this.isStateDependent=i!=="camera"&&!lc(l.expression),this.interpolationType=S};function vf(i,l){if((i=mp(i,l)).result==="error")return i;var _=i.value.expression,S=Ni(_);if(!S&&!ec(l))return ys([new Sr("","data expressions not supported")]);var F=Ku(_,["zoom"]);if(!F&&!Bf(l))return ys([new Sr("","zoom expressions not supported")]);var j=function p(v){var m=null;if(v instanceof Qc)m=p(v.result);else if(v instanceof Yh)for(var w=0,D=v.args;w<D.length&&!(m=p(D[w]));w+=1);else(v instanceof Nl||v instanceof Ms)&&v.input instanceof Qa&&v.input.name==="zoom"&&(m=v);return m instanceof Sr||v.eachChild(function(N){var W=p(N);W instanceof Sr?m=W:!m&&W?m=new Sr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):m&&W&&m!==W&&(m=new Sr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),m}(_);return j||F?j instanceof Sr?ys([j]):j instanceof Ms&&!es(l)?ys([new Sr("",'"interpolate" expressions cannot be used with this property')]):Is(j?new Zc(S?"camera":"composite",i.value,j.labels,j instanceof Ms?j.interpolation:void 0):new Kh(S?"constant":"source",i.value)):ys([new Sr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Zc.prototype.evaluateWithoutErrorHandling=function(i,l,_,S,F,j){return this._styleExpression.evaluateWithoutErrorHandling(i,l,_,S,F,j)},Zc.prototype.evaluate=function(i,l,_,S,F,j){return this._styleExpression.evaluate(i,l,_,S,F,j)},Zc.prototype.interpolationFactor=function(i,l,_){return this.interpolationType?Ms.interpolationFactor(this.interpolationType,i,l,_):0};var Bh=function(i,l){this._parameters=i,this._specification=l,Ht(this,function _(S,F){var j,p,v,m=F.type==="color",w=S.stops&&typeof S.stops[0][0]=="object",D=w||!(w||S.property!==void 0),N=S.type||(es(F)?"exponential":"interval");if(m&&((S=Ht({},S)).stops&&(S.stops=S.stops.map(function(nr){return[nr[0],Fo.parse(nr[1])]})),S.default=Fo.parse(S.default?S.default:F.default)),S.colorSpace&&S.colorSpace!=="rgb"&&!Oh[S.colorSpace])throw new Error("Unknown color space: "+S.colorSpace);if(N==="exponential")j=au;else if(N==="interval")j=Xo;else if(N==="categorical"){j=$h,p=Object.create(null);for(var W=0,$=S.stops;W<$.length;W+=1){var ie=$[W];p[ie[0]]=ie[1]}v=typeof S.stops[0][0]}else{if(N!=="identity")throw new Error('Unknown function type "'+N+'"');j=dl}if(w){for(var pe={},we=[],ke=0;ke<S.stops.length;ke++){var Ge=S.stops[ke],ht=Ge[0].zoom;pe[ht]===void 0&&(pe[ht]={zoom:ht,type:S.type,property:S.property,default:S.default,stops:[]},we.push(ht)),pe[ht].stops.push([Ge[0].value,Ge[1]])}for(var mt=[],St=0,xt=we;St<xt.length;St+=1){var bt=xt[St];mt.push([pe[bt].zoom,_(pe[bt],F)])}var kt={name:"linear"};return{kind:"composite",interpolationType:kt,interpolationFactor:Ms.interpolationFactor.bind(void 0,kt),zoomStops:mt.map(function(nr){return nr[0]}),evaluate:function(nr,br){var Pr=nr.zoom;return au({stops:mt,base:S.base},F,Pr).evaluate(Pr,br)}}}if(D){var ft=N==="exponential"?{name:"exponential",base:S.base!==void 0?S.base:1}:null;return{kind:"camera",interpolationType:ft,interpolationFactor:Ms.interpolationFactor.bind(void 0,ft),zoomStops:S.stops.map(function(nr){return nr[0]}),evaluate:function(nr){return j(S,F,nr.zoom,p,v)}}}return{kind:"source",evaluate:function(nr,br){var Pr=br&&br.properties?br.properties[S.property]:void 0;return Pr===void 0?Sc(S.default,F.default):j(S,F,Pr,p,v)}}}(this._parameters,this._specification))};function _u(i){var l=i.key,_=i.value,S=i.valueSpec||{},F=i.objectElementValidators||{},j=i.style,p=i.styleSpec,v=[],m=Bs(_);if(m!=="object")return[new Je(l,_,"object expected, "+m+" found")];for(var w in _){var D=w.split(".")[0],N=S[D]||S["*"],W=void 0;if(F[D])W=F[D];else if(S[D])W=Sa;else if(F["*"])W=F["*"];else{if(!S["*"]){v.push(new Je(l,_[w],'unknown property "'+w+'"'));continue}W=Sa}v=v.concat(W({key:(l&&l+".")+w,value:_[w],valueSpec:N,style:j,styleSpec:p,object:_,objectKey:w},_))}for(var $ in S)F[$]||S[$].required&&S[$].default===void 0&&_[$]===void 0&&v.push(new Je(l,_,'missing required property "'+$+'"'));return v}function Vc(i){var l=i.value,_=i.valueSpec,S=i.style,F=i.styleSpec,j=i.key,p=i.arrayElementValidator||Sa;if(Bs(l)!=="array")return[new Je(j,l,"array expected, "+Bs(l)+" found")];if(_.length&&l.length!==_.length)return[new Je(j,l,"array length "+_.length+" expected, length "+l.length+" found")];if(_["min-length"]&&l.length<_["min-length"])return[new Je(j,l,"array length at least "+_["min-length"]+" expected, length "+l.length+" found")];var v={type:_.value,values:_.values};F.$version<7&&(v.function=_.function),Bs(_.value)==="object"&&(v=_.value);for(var m=[],w=0;w<l.length;w++)m=m.concat(p({array:l,arrayIndex:w,value:l[w],valueSpec:v,style:S,styleSpec:F,key:j+"["+w+"]"}));return m}function Yp(i){var l=i.key,_=i.value,S=i.valueSpec,F=Bs(_);return F==="number"&&_!=_&&(F="NaN"),F!=="number"?[new Je(l,_,"number expected, "+F+" found")]:"minimum"in S&&_<S.minimum?[new Je(l,_,_+" is less than the minimum value "+S.minimum)]:"maximum"in S&&_>S.maximum?[new Je(l,_,_+" is greater than the maximum value "+S.maximum)]:[]}function Fh(i){var l,_,S,F=i.valueSpec,j=Fr(i.value.type),p={},v=j!=="categorical"&&i.value.property===void 0,m=!v,w=Bs(i.value.stops)==="array"&&Bs(i.value.stops[0])==="array"&&Bs(i.value.stops[0][0])==="object",D=_u({key:i.key,value:i.value,valueSpec:i.styleSpec.function,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function($){if(j==="identity")return[new Je($.key,$.value,'identity function may not have a "stops" property')];var ie=[],pe=$.value;return ie=ie.concat(Vc({key:$.key,value:pe,valueSpec:$.valueSpec,style:$.style,styleSpec:$.styleSpec,arrayElementValidator:N})),Bs(pe)==="array"&&pe.length===0&&ie.push(new Je($.key,pe,"array must have at least one stop")),ie},default:function($){return Sa({key:$.key,value:$.value,valueSpec:F,style:$.style,styleSpec:$.styleSpec})}}});return j==="identity"&&v&&D.push(new Je(i.key,i.value,'missing required property "property"')),j==="identity"||i.value.stops||D.push(new Je(i.key,i.value,'missing required property "stops"')),j==="exponential"&&i.valueSpec.expression&&!es(i.valueSpec)&&D.push(new Je(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(m&&!ec(i.valueSpec)?D.push(new Je(i.key,i.value,"property functions not supported")):v&&!Bf(i.valueSpec)&&D.push(new Je(i.key,i.value,"zoom functions not supported"))),j!=="categorical"&&!w||i.value.property!==void 0||D.push(new Je(i.key,i.value,'"property" property is required')),D;function N($){var ie=[],pe=$.value,we=$.key;if(Bs(pe)!=="array")return[new Je(we,pe,"array expected, "+Bs(pe)+" found")];if(pe.length!==2)return[new Je(we,pe,"array length 2 expected, length "+pe.length+" found")];if(w){if(Bs(pe[0])!=="object")return[new Je(we,pe,"object expected, "+Bs(pe[0])+" found")];if(pe[0].zoom===void 0)return[new Je(we,pe,"object stop key must have zoom")];if(pe[0].value===void 0)return[new Je(we,pe,"object stop key must have value")];if(S&&S>Fr(pe[0].zoom))return[new Je(we,pe[0].zoom,"stop zoom values must appear in ascending order")];Fr(pe[0].zoom)!==S&&(S=Fr(pe[0].zoom),_=void 0,p={}),ie=ie.concat(_u({key:we+"[0]",value:pe[0],valueSpec:{zoom:{}},style:$.style,styleSpec:$.styleSpec,objectElementValidators:{zoom:Yp,value:W}}))}else ie=ie.concat(W({key:we+"[0]",value:pe[0],valueSpec:{},style:$.style,styleSpec:$.styleSpec},pe));return bh(mr(pe[1]))?ie.concat([new Je(we+"[1]",pe[1],"expressions are not allowed in function stops.")]):ie.concat(Sa({key:we+"[1]",value:pe[1],valueSpec:F,style:$.style,styleSpec:$.styleSpec}))}function W($,ie){var pe=Bs($.value),we=Fr($.value),ke=$.value!==null?$.value:ie;if(l){if(pe!==l)return[new Je($.key,ke,pe+" stop domain type must match previous stop domain type "+l)]}else l=pe;if(pe!=="number"&&pe!=="string"&&pe!=="boolean")return[new Je($.key,ke,"stop domain value must be a number, string, or boolean")];if(pe!=="number"&&j!=="categorical"){var Ge="number expected, "+pe+" found";return ec(F)&&j===void 0&&(Ge+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Je($.key,ke,Ge)]}return j!=="categorical"||pe!=="number"||isFinite(we)&&Math.floor(we)===we?j!=="categorical"&&pe==="number"&&_!==void 0&&we<_?[new Je($.key,ke,"stop domain values must appear in ascending order")]:(_=we,j==="categorical"&&we in p?[new Je($.key,ke,"stop domain values must be unique")]:(p[we]=!0,[])):[new Je($.key,ke,"integer expected, found "+we)]}}function Ll(i){var l=(i.expressionContext==="property"?vf:mp)(mr(i.value),i.valueSpec);if(l.result==="error")return l.value.map(function(S){return new Je(""+i.key+S.key,i.value,S.message)});var _=l.value.expression||l.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!_.outputDefined())return[new Je(i.key,i.value,'Invalid data expression for "'+i.propertyKey+'". Output values must be contained as literals within the expression.')];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!lc(_))return[new Je(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!lc(_))return[new Je(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!Ku(_,["zoom","feature-state"]))return[new Je(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Ni(_))return[new Je(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Fs(i){var l=i.key,_=i.value,S=i.valueSpec,F=[];return Array.isArray(S.values)?S.values.indexOf(Fr(_))===-1&&F.push(new Je(l,_,"expected one of ["+S.values.join(", ")+"], "+JSON.stringify(_)+" found")):Object.keys(S.values).indexOf(Fr(_))===-1&&F.push(new Je(l,_,"expected one of ["+Object.keys(S.values).join(", ")+"], "+JSON.stringify(_)+" found")),F}function Tc(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(var l=0,_=i.slice(1);l<_.length;l+=1){var S=_[l];if(!Tc(S)&&typeof S!="boolean")return!1}return!0;default:return!0}}Bh.deserialize=function(i){return new Bh(i._parameters,i._specification)},Bh.serialize=function(i){return{_parameters:i._parameters,_specification:i._specification}};var Ru={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function jc(i){if(i==null)return{filter:function(){return!0},needGeometry:!1};Tc(i)||(i=Jh(i));var l=mp(i,Ru);if(l.result==="error")throw new Error(l.value.map(function(_){return _.key+": "+_.message}).join(", "));return{filter:function(_,S,F){return l.value.evaluate(_,S,{},F)},needGeometry:function _(S){if(!Array.isArray(S))return!1;if(S[0]==="within")return!0;for(var F=1;F<S.length;F++)if(_(S[F]))return!0;return!1}(i)}}function $p(i,l){return i<l?-1:i>l?1:0}function Jh(i){if(!i)return!0;var l,_=i[0];return i.length<=1?_!=="any":_==="=="?Ac(i[1],i[2],"=="):_==="!="?rh(Ac(i[1],i[2],"==")):_==="<"||_===">"||_==="<="||_===">="?Ac(i[1],i[2],_):_==="any"?(l=i.slice(1),["any"].concat(l.map(Jh))):_==="all"?["all"].concat(i.slice(1).map(Jh)):_==="none"?["all"].concat(i.slice(1).map(Jh).map(rh)):_==="in"?kh(i[1],i.slice(2)):_==="!in"?rh(kh(i[1],i.slice(2))):_==="has"?Iu(i[1]):_==="!has"?rh(Iu(i[1])):_!=="within"||i}function Ac(i,l,_){switch(i){case"$type":return["filter-type-"+_,l];case"$id":return["filter-id-"+_,l];default:return["filter-"+_,i,l]}}function kh(i,l){if(l.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",l]];case"$id":return["filter-id-in",["literal",l]];default:return l.length>200&&!l.some(function(_){return typeof _!=typeof l[0]})?["filter-in-large",i,["literal",l.sort($p)]]:["filter-in-small",i,["literal",l]]}}function Iu(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function rh(i){return["!",i]}function gp(i){return Tc(mr(i.value))?Ll(Ht({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function l(_){var S=_.value,F=_.key;if(Bs(S)!=="array")return[new Je(F,S,"array expected, "+Bs(S)+" found")];var j,p=_.styleSpec,v=[];if(S.length<1)return[new Je(F,S,"filter array must have at least 1 element")];switch(v=v.concat(Fs({key:F+"[0]",value:S[0],valueSpec:p.filter_operator,style:_.style,styleSpec:_.styleSpec})),Fr(S[0])){case"<":case"<=":case">":case">=":S.length>=2&&Fr(S[1])==="$type"&&v.push(new Je(F,S,'"$type" cannot be use with operator "'+S[0]+'"'));case"==":case"!=":S.length!==3&&v.push(new Je(F,S,'filter array for operator "'+S[0]+'" must have 3 elements'));case"in":case"!in":S.length>=2&&(j=Bs(S[1]))!=="string"&&v.push(new Je(F+"[1]",S[1],"string expected, "+j+" found"));for(var m=2;m<S.length;m++)j=Bs(S[m]),Fr(S[1])==="$type"?v=v.concat(Fs({key:F+"["+m+"]",value:S[m],valueSpec:p.geometry_type,style:_.style,styleSpec:_.styleSpec})):j!=="string"&&j!=="number"&&j!=="boolean"&&v.push(new Je(F+"["+m+"]",S[m],"string, number, or boolean expected, "+j+" found"));break;case"any":case"all":case"none":for(var w=1;w<S.length;w++)v=v.concat(l({key:F+"["+w+"]",value:S[w],style:_.style,styleSpec:_.styleSpec}));break;case"has":case"!has":j=Bs(S[1]),S.length!==2?v.push(new Je(F,S,'filter array for "'+S[0]+'" operator must have 2 elements')):j!=="string"&&v.push(new Je(F+"[1]",S[1],"string expected, "+j+" found"));break;case"within":j=Bs(S[1]),S.length!==2?v.push(new Je(F,S,'filter array for "'+S[0]+'" operator must have 2 elements')):j!=="object"&&v.push(new Je(F+"[1]",S[1],"object expected, "+j+" found"))}return v}(i)}function vp(i,l){var _=i.key,S=i.style,F=i.styleSpec,j=i.value,p=i.objectKey,v=F[l+"_"+i.layerType];if(!v)return[];var m=p.match(/^(.*)-transition$/);if(l==="paint"&&m&&v[m[1]]&&v[m[1]].transition)return Sa({key:_,value:j,valueSpec:F.transition,style:S,styleSpec:F});var w,D=i.valueSpec||v[p];if(!D)return[new Je(_,j,'unknown property "'+p+'"')];if(Bs(j)==="string"&&ec(D)&&!D.tokens&&(w=/^{([^}]+)}$/.exec(j)))return[new Je(_,j,'"'+p+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(w[1])+" }`.")];var N=[];return i.layerType==="symbol"&&(p==="text-field"&&S&&!S.glyphs&&N.push(new Je(_,j,'use of "text-field" requires a style "glyphs" property')),p==="text-font"&&wc(mr(j))&&Fr(j.type)==="identity"&&N.push(new Je(_,j,'"text-font" does not support identity functions'))),N.concat(Sa({key:i.key,value:j,valueSpec:D,style:S,styleSpec:F,expressionContext:"property",propertyType:l,propertyKey:p}))}function Kp(i){return vp(i,"paint")}function Hc(i){return vp(i,"layout")}function Eh(i){var l=[],_=i.value,S=i.key,F=i.style,j=i.styleSpec;_.type||_.ref||l.push(new Je(S,_,'either "type" or "ref" is required'));var p,v=Fr(_.type),m=Fr(_.ref);if(_.id)for(var w=Fr(_.id),D=0;D<i.arrayIndex;D++){var N=F.layers[D];Fr(N.id)===w&&l.push(new Je(S,_.id,'duplicate layer id "'+_.id+'", previously used at line '+N.id.__line__))}if("ref"in _)["type","source","source-layer","filter","layout"].forEach(function(ie){ie in _&&l.push(new Je(S,_[ie],'"'+ie+'" is prohibited for ref layers'))}),F.layers.forEach(function(ie){Fr(ie.id)===m&&(p=ie)}),p?p.ref?l.push(new Je(S,_.ref,"ref cannot reference another ref layer")):v=Fr(p.type):l.push(new Je(S,_.ref,'ref layer "'+m+'" not found'));else if(v!=="background")if(_.source){var W=F.sources&&F.sources[_.source],$=W&&Fr(W.type);W?$==="vector"&&v==="raster"?l.push(new Je(S,_.source,'layer "'+_.id+'" requires a raster source')):$==="raster"&&v!=="raster"?l.push(new Je(S,_.source,'layer "'+_.id+'" requires a vector source')):$!=="vector"||_["source-layer"]?$==="raster-dem"&&v!=="hillshade"?l.push(new Je(S,_.source,"raster-dem source can only be used with layer type 'hillshade'.")):v!=="line"||!_.paint||!_.paint["line-gradient"]||$==="geojson"&&W.lineMetrics||l.push(new Je(S,_,'layer "'+_.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):l.push(new Je(S,_,'layer "'+_.id+'" must specify a "source-layer"')):l.push(new Je(S,_.source,'source "'+_.source+'" not found'))}else l.push(new Je(S,_,'missing required property "source"'));return l=l.concat(_u({key:S,value:_,valueSpec:j.layer,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Sa({key:S+".type",value:_.type,valueSpec:j.layer.type,style:i.style,styleSpec:i.styleSpec,object:_,objectKey:"type"})},filter:gp,layout:function(ie){return _u({layer:_,key:ie.key,value:ie.value,style:ie.style,styleSpec:ie.styleSpec,objectElementValidators:{"*":function(pe){return Hc(Ht({layerType:v},pe))}}})},paint:function(ie){return _u({layer:_,key:ie.key,value:ie.value,style:ie.style,styleSpec:ie.styleSpec,objectElementValidators:{"*":function(pe){return Kp(Ht({layerType:v},pe))}}})}}}))}function yu(i){var l=i.value,_=i.key,S=Bs(l);return S!=="string"?[new Je(_,l,"string expected, "+S+" found")]:[]}var Ya={promoteId:function(i){var l=i.key,_=i.value;if(Bs(_)==="string")return yu({key:l,value:_});var S=[];for(var F in _)S.push.apply(S,yu({key:l+"."+F,value:_[F]}));return S}};function nh(i){var l=i.value,_=i.key,S=i.styleSpec,F=i.style;if(!l.type)return[new Je(_,l,'"type" is required')];var j,p=Fr(l.type);switch(p){case"vector":case"raster":case"raster-dem":return _u({key:_,value:l,valueSpec:S["source_"+p.replace("-","_")],style:i.style,styleSpec:S,objectElementValidators:Ya});case"geojson":if(j=_u({key:_,value:l,valueSpec:S.source_geojson,style:F,styleSpec:S,objectElementValidators:Ya}),l.cluster)for(var v in l.clusterProperties){var m=l.clusterProperties[v],w=m[0],D=typeof w=="string"?[w,["accumulated"],["get",v]]:w;j.push.apply(j,Ll({key:_+"."+v+".map",value:m[1],expressionContext:"cluster-map"})),j.push.apply(j,Ll({key:_+"."+v+".reduce",value:D,expressionContext:"cluster-reduce"}))}return j;case"video":return _u({key:_,value:l,valueSpec:S.source_video,style:F,styleSpec:S});case"image":return _u({key:_,value:l,valueSpec:S.source_image,style:F,styleSpec:S});case"canvas":return[new Je(_,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Fs({key:_+".type",value:l.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:F,styleSpec:S})}}function Gc(i){var l=i.value,_=i.styleSpec,S=_.light,F=i.style,j=[],p=Bs(l);if(l===void 0)return j;if(p!=="object")return j.concat([new Je("light",l,"object expected, "+p+" found")]);for(var v in l){var m=v.match(/^(.*)-transition$/);j=j.concat(m&&S[m[1]]&&S[m[1]].transition?Sa({key:v,value:l[v],valueSpec:_.transition,style:F,styleSpec:_}):S[v]?Sa({key:v,value:l[v],valueSpec:S[v],style:F,styleSpec:_}):[new Je(v,l[v],'unknown property "'+v+'"')])}return j}var ih={"*":function(){return[]},array:Vc,boolean:function(i){var l=i.value,_=i.key,S=Bs(l);return S!=="boolean"?[new Je(_,l,"boolean expected, "+S+" found")]:[]},number:Yp,color:function(i){var l=i.key,_=i.value,S=Bs(_);return S!=="string"?[new Je(l,_,"color expected, "+S+" found")]:$o(_)===null?[new Je(l,_,'color expected, "'+_+'" found')]:[]},constants:wt,enum:Fs,filter:gp,function:Fh,layer:Eh,object:_u,source:nh,light:Gc,string:yu,formatted:function(i){return yu(i).length===0?[]:Ll(i)},resolvedImage:function(i){return yu(i).length===0?[]:Ll(i)}};function Sa(i){var l=i.value,_=i.valueSpec,S=i.styleSpec;return _.expression&&wc(Fr(l))?Fh(i):_.expression&&bh(mr(l))?Ll(i):_.type&&ih[_.type]?ih[_.type](i):_u(Ht({},i,{valueSpec:_.type?S[_.type]:_}))}function cs(i){var l=i.value,_=i.key,S=yu(i);return S.length||(l.indexOf("{fontstack}")===-1&&S.push(new Je(_,l,'"glyphs" url must include a "{fontstack}" token')),l.indexOf("{range}")===-1&&S.push(new Je(_,l,'"glyphs" url must include a "{range}" token'))),S}function ku(i,l){l===void 0&&(l=Ae);var _=[];return _=_.concat(Sa({key:"",value:i,valueSpec:l.$root,styleSpec:l,style:i,objectElementValidators:{glyphs:cs,"*":function(){return[]}}})),i.constants&&(_=_.concat(wt({key:"constants",value:i.constants,style:i,styleSpec:l}))),rc(_)}function rc(i){return[].concat(i).sort(function(l,_){return l.line-_.line})}function xu(i){return function(){for(var l=[],_=arguments.length;_--;)l[_]=arguments[_];return rc(i.apply(this,l))}}ku.source=xu(nh),ku.light=xu(Gc),ku.layer=xu(Eh),ku.filter=xu(gp),ku.paintProperty=xu(Kp),ku.layoutProperty=xu(Hc);var oh=ku,Cc=oh.light,ah=oh.paintProperty,Qh=oh.layoutProperty;function sh(i,l){var _=!1;if(l&&l.length)for(var S=0,F=l;S<F.length;S+=1)i.fire(new je(new Error(F[S].message))),_=!0;return _}var Ul=ll;function ll(i,l,_){var S=this.cells=[];if(i instanceof ArrayBuffer){this.arrayBuffer=i;var F=new Int32Array(this.arrayBuffer);i=F[0],this.d=(l=F[1])+2*(_=F[2]);for(var j=0;j<this.d*this.d;j++){var p=F[3+j],v=F[3+j+1];S.push(p===v?null:F.subarray(p,v))}var m=F[3+S.length+1];this.keys=F.subarray(F[3+S.length],m),this.bboxes=F.subarray(m),this.insert=this._insertReadonly}else{this.d=l+2*_;for(var w=0;w<this.d*this.d;w++)S.push([]);this.keys=[],this.bboxes=[]}this.n=l,this.extent=i,this.padding=_,this.scale=l/i,this.uid=0;var D=_/l*i;this.min=-D,this.max=i+D}ll.prototype.insert=function(i,l,_,S,F){this._forEachCell(l,_,S,F,this._insertCell,this.uid++),this.keys.push(i),this.bboxes.push(l),this.bboxes.push(_),this.bboxes.push(S),this.bboxes.push(F)},ll.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},ll.prototype._insertCell=function(i,l,_,S,F,j){this.cells[F].push(j)},ll.prototype.query=function(i,l,_,S,F){var j=this.min,p=this.max;if(i<=j&&l<=j&&p<=_&&p<=S&&!F)return Array.prototype.slice.call(this.keys);var v=[];return this._forEachCell(i,l,_,S,this._queryCell,v,{},F),v},ll.prototype._queryCell=function(i,l,_,S,F,j,p,v){var m=this.cells[F];if(m!==null)for(var w=this.keys,D=this.bboxes,N=0;N<m.length;N++){var W=m[N];if(p[W]===void 0){var $=4*W;(v?v(D[$+0],D[$+1],D[$+2],D[$+3]):i<=D[$+2]&&l<=D[$+3]&&_>=D[$+0]&&S>=D[$+1])?(p[W]=!0,j.push(w[W])):p[W]=!1}}},ll.prototype._forEachCell=function(i,l,_,S,F,j,p,v){for(var m=this._convertToCellCoord(i),w=this._convertToCellCoord(l),D=this._convertToCellCoord(_),N=this._convertToCellCoord(S),W=m;W<=D;W++)for(var $=w;$<=N;$++){var ie=this.d*$+W;if((!v||v(this._convertFromCellCoord(W),this._convertFromCellCoord($),this._convertFromCellCoord(W+1),this._convertFromCellCoord($+1)))&&F.call(this,i,l,_,S,ie,j,p,v))return}},ll.prototype._convertFromCellCoord=function(i){return(i-this.padding)/this.scale},ll.prototype._convertToCellCoord=function(i){return Math.max(0,Math.min(this.d-1,Math.floor(i*this.scale)+this.padding))},ll.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var i=this.cells,l=3+this.cells.length+1+1,_=0,S=0;S<this.cells.length;S++)_+=this.cells[S].length;var F=new Int32Array(l+_+this.keys.length+this.bboxes.length);F[0]=this.extent,F[1]=this.n,F[2]=this.padding;for(var j=l,p=0;p<i.length;p++){var v=i[p];F[3+p]=j,F.set(v,j),j+=v.length}return F[3+i.length]=j,F.set(this.keys,j),F[3+i.length+1]=j+=this.keys.length,F.set(this.bboxes,j),j+=this.bboxes.length,F.buffer};var Wc=Ce.ImageData,vl=Ce.ImageBitmap,oi={};function fi(i,l,_){_===void 0&&(_={}),Object.defineProperty(l,"_classRegistryKey",{value:i,writeable:!1}),oi[i]={klass:l,omit:_.omit||[],shallow:_.shallow||[]}}for(var tu in fi("Object",Object),Ul.serialize=function(i,l){var _=i.toArrayBuffer();return l&&l.push(_),{buffer:_}},Ul.deserialize=function(i){return new Ul(i.buffer)},fi("Grid",Ul),fi("Color",Fo),fi("Error",Error),fi("ResolvedImage",Fa),fi("StylePropertyFunction",Bh),fi("StyleExpression",tc,{omit:["_evaluator"]}),fi("ZoomDependentExpression",Zc),fi("ZoomConstantExpression",Kh),fi("CompoundExpression",Qa,{omit:["_evaluate"]}),qa)qa[tu]._classRegistryKey||fi("Expression_"+tu,qa[tu]);function bu(i){return i&&typeof ArrayBuffer!="undefined"&&(i instanceof ArrayBuffer||i.constructor&&i.constructor.name==="ArrayBuffer")}function Dp(i){return vl&&i instanceof vl}function ai(i,l){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp)return i;if(bu(i)||Dp(i))return l&&l.push(i),i;if(ArrayBuffer.isView(i)){var _=i;return l&&l.push(_.buffer),_}if(i instanceof Wc)return l&&l.push(i.data.buffer),i;if(Array.isArray(i)){for(var S=[],F=0,j=i;F<j.length;F+=1)S.push(ai(j[F],l));return S}if(typeof i=="object"){var p=i.constructor,v=p._classRegistryKey;if(!v)throw new Error("can't serialize object of unregistered class");var m=p.serialize?p.serialize(i,l):{};if(!p.serialize){for(var w in i)if(i.hasOwnProperty(w)&&!(oi[v].omit.indexOf(w)>=0)){var D=i[w];m[w]=oi[v].shallow.indexOf(w)>=0?D:ai(D,l)}i instanceof Error&&(m.message=i.message)}if(m.$name)throw new Error("$name property is reserved for worker serialization logic.");return v!=="Object"&&(m.$name=v),m}throw new Error("can't serialize object of type "+typeof i)}function is(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||bu(i)||Dp(i)||ArrayBuffer.isView(i)||i instanceof Wc)return i;if(Array.isArray(i))return i.map(is);if(typeof i=="object"){var l=i.$name||"Object",_=oi[l].klass;if(!_)throw new Error("can't deserialize unregistered class "+l);if(_.deserialize)return _.deserialize(i);for(var S=Object.create(_.prototype),F=0,j=Object.keys(i);F<j.length;F+=1){var p=j[F];if(p!=="$name"){var v=i[p];S[p]=oi[l].shallow.indexOf(p)>=0?v:is(v)}}return S}throw new Error("can't deserialize object of type "+typeof i)}var ep=function(){this.first=!0};ep.prototype.update=function(i,l){var _=Math.floor(i);return this.first?(this.first=!1,this.lastIntegerZoom=_,this.lastIntegerZoomTime=0,this.lastZoom=i,this.lastFloorZoom=_,!0):(this.lastFloorZoom>_?(this.lastIntegerZoom=_+1,this.lastIntegerZoomTime=l):this.lastFloorZoom<_&&(this.lastIntegerZoom=_,this.lastIntegerZoomTime=l),i!==this.lastZoom&&(this.lastZoom=i,this.lastFloorZoom=_,!0))};var mi={"Latin-1 Supplement":function(i){return i>=128&&i<=255},Arabic:function(i){return i>=1536&&i<=1791},"Arabic Supplement":function(i){return i>=1872&&i<=1919},"Arabic Extended-A":function(i){return i>=2208&&i<=2303},"Hangul Jamo":function(i){return i>=4352&&i<=4607},"Unified Canadian Aboriginal Syllabics":function(i){return i>=5120&&i<=5759},Khmer:function(i){return i>=6016&&i<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(i){return i>=6320&&i<=6399},"General Punctuation":function(i){return i>=8192&&i<=8303},"Letterlike Symbols":function(i){return i>=8448&&i<=8527},"Number Forms":function(i){return i>=8528&&i<=8591},"Miscellaneous Technical":function(i){return i>=8960&&i<=9215},"Control Pictures":function(i){return i>=9216&&i<=9279},"Optical Character Recognition":function(i){return i>=9280&&i<=9311},"Enclosed Alphanumerics":function(i){return i>=9312&&i<=9471},"Geometric Shapes":function(i){return i>=9632&&i<=9727},"Miscellaneous Symbols":function(i){return i>=9728&&i<=9983},"Miscellaneous Symbols and Arrows":function(i){return i>=11008&&i<=11263},"CJK Radicals Supplement":function(i){return i>=11904&&i<=12031},"Kangxi Radicals":function(i){return i>=12032&&i<=12255},"Ideographic Description Characters":function(i){return i>=12272&&i<=12287},"CJK Symbols and Punctuation":function(i){return i>=12288&&i<=12351},Hiragana:function(i){return i>=12352&&i<=12447},Katakana:function(i){return i>=12448&&i<=12543},Bopomofo:function(i){return i>=12544&&i<=12591},"Hangul Compatibility Jamo":function(i){return i>=12592&&i<=12687},Kanbun:function(i){return i>=12688&&i<=12703},"Bopomofo Extended":function(i){return i>=12704&&i<=12735},"CJK Strokes":function(i){return i>=12736&&i<=12783},"Katakana Phonetic Extensions":function(i){return i>=12784&&i<=12799},"Enclosed CJK Letters and Months":function(i){return i>=12800&&i<=13055},"CJK Compatibility":function(i){return i>=13056&&i<=13311},"CJK Unified Ideographs Extension A":function(i){return i>=13312&&i<=19903},"Yijing Hexagram Symbols":function(i){return i>=19904&&i<=19967},"CJK Unified Ideographs":function(i){return i>=19968&&i<=40959},"Yi Syllables":function(i){return i>=40960&&i<=42127},"Yi Radicals":function(i){return i>=42128&&i<=42191},"Hangul Jamo Extended-A":function(i){return i>=43360&&i<=43391},"Hangul Syllables":function(i){return i>=44032&&i<=55215},"Hangul Jamo Extended-B":function(i){return i>=55216&&i<=55295},"Private Use Area":function(i){return i>=57344&&i<=63743},"CJK Compatibility Ideographs":function(i){return i>=63744&&i<=64255},"Arabic Presentation Forms-A":function(i){return i>=64336&&i<=65023},"Vertical Forms":function(i){return i>=65040&&i<=65055},"CJK Compatibility Forms":function(i){return i>=65072&&i<=65103},"Small Form Variants":function(i){return i>=65104&&i<=65135},"Arabic Presentation Forms-B":function(i){return i>=65136&&i<=65279},"Halfwidth and Fullwidth Forms":function(i){return i>=65280&&i<=65519}};function Mc(i){for(var l=0,_=i;l<_.length;l+=1)if(Op(_[l].charCodeAt(0)))return!0;return!1}function Op(i){return!(i!==746&&i!==747&&(i<4352||!(mi["Bopomofo Extended"](i)||mi.Bopomofo(i)||mi["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||mi["CJK Compatibility Ideographs"](i)||mi["CJK Compatibility"](i)||mi["CJK Radicals Supplement"](i)||mi["CJK Strokes"](i)||!(!mi["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||mi["CJK Unified Ideographs Extension A"](i)||mi["CJK Unified Ideographs"](i)||mi["Enclosed CJK Letters and Months"](i)||mi["Hangul Compatibility Jamo"](i)||mi["Hangul Jamo Extended-A"](i)||mi["Hangul Jamo Extended-B"](i)||mi["Hangul Jamo"](i)||mi["Hangul Syllables"](i)||mi.Hiragana(i)||mi["Ideographic Description Characters"](i)||mi.Kanbun(i)||mi["Kangxi Radicals"](i)||mi["Katakana Phonetic Extensions"](i)||mi.Katakana(i)&&i!==12540||!(!mi["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!mi["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||mi["Unified Canadian Aboriginal Syllabics"](i)||mi["Unified Canadian Aboriginal Syllabics Extended"](i)||mi["Vertical Forms"](i)||mi["Yijing Hexagram Symbols"](i)||mi["Yi Syllables"](i)||mi["Yi Radicals"](i))))}function Jp(i){return!(Op(i)||function(l){return!!(mi["Latin-1 Supplement"](l)&&(l===167||l===169||l===174||l===177||l===188||l===189||l===190||l===215||l===247)||mi["General Punctuation"](l)&&(l===8214||l===8224||l===8225||l===8240||l===8241||l===8251||l===8252||l===8258||l===8263||l===8264||l===8265||l===8273)||mi["Letterlike Symbols"](l)||mi["Number Forms"](l)||mi["Miscellaneous Technical"](l)&&(l>=8960&&l<=8967||l>=8972&&l<=8991||l>=8996&&l<=9e3||l===9003||l>=9085&&l<=9114||l>=9150&&l<=9165||l===9167||l>=9169&&l<=9179||l>=9186&&l<=9215)||mi["Control Pictures"](l)&&l!==9251||mi["Optical Character Recognition"](l)||mi["Enclosed Alphanumerics"](l)||mi["Geometric Shapes"](l)||mi["Miscellaneous Symbols"](l)&&!(l>=9754&&l<=9759)||mi["Miscellaneous Symbols and Arrows"](l)&&(l>=11026&&l<=11055||l>=11088&&l<=11097||l>=11192&&l<=11243)||mi["CJK Symbols and Punctuation"](l)||mi.Katakana(l)||mi["Private Use Area"](l)||mi["CJK Compatibility Forms"](l)||mi["Small Form Variants"](l)||mi["Halfwidth and Fullwidth Forms"](l)||l===8734||l===8756||l===8757||l>=9984&&l<=10087||l>=10102&&l<=10131||l===65532||l===65533)}(i))}function Xc(i){return i>=1424&&i<=2303||mi["Arabic Presentation Forms-A"](i)||mi["Arabic Presentation Forms-B"](i)}function hc(i,l){return!(!l&&Xc(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||mi.Khmer(i))}function wh(i){for(var l=0,_=i;l<_.length;l+=1)if(Xc(_[l].charCodeAt(0)))return!0;return!1}var Pc=null,Xl="unavailable",Rc=null,Eu=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(Xl="error"),Pc&&Pc(i)};function lh(){tp.fire(new ze("pluginStateChange",{pluginStatus:Xl,pluginURL:Rc}))}var tp=new Ue,rp=function(){return Xl},su=function(){if(Xl!=="deferred"||!Rc)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Xl="loading",lh(),Rc&&Lt({url:Rc},function(i){i?Eu(i):(Xl="loaded",lh())})},ql={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Xl==="loaded"||ql.applyArabicShaping!=null},isLoading:function(){return Xl==="loading"},setState:function(i){Xl=i.pluginStatus,Rc=i.pluginURL},isParsed:function(){return ql.applyArabicShaping!=null&&ql.processBidirectionalText!=null&&ql.processStyledBidirectionalText!=null},getPluginURL:function(){return Rc}},fa=function(i,l){this.zoom=i,l?(this.now=l.now,this.fadeDuration=l.fadeDuration,this.zoomHistory=l.zoomHistory,this.transition=l.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ep,this.transition={})};fa.prototype.isSupportedScript=function(i){return function(l,_){for(var S=0,F=l;S<F.length;S+=1)if(!hc(F[S].charCodeAt(0),_))return!1;return!0}(i,ql.isLoaded())},fa.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},fa.prototype.getCrossfadeParameters=function(){var i=this.zoom,l=i-Math.floor(i),_=this.crossFadingFactor();return i>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:l+(1-l)*_}:{fromScale:.5,toScale:1,t:1-(1-_)*l}};var Rs=function(i,l){this.property=i,this.value=l,this.expression=function(_,S){if(wc(_))return new Bh(_,S);if(bh(_)){var F=vf(_,S);if(F.result==="error")throw new Error(F.value.map(function(p){return p.key+": "+p.message}).join(", "));return F.value}var j=_;return typeof _=="string"&&S.type==="color"&&(j=Fo.parse(_)),{kind:"constant",evaluate:function(){return j}}}(l===void 0?i.specification.default:l,i.specification)};Rs.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},Rs.prototype.possiblyEvaluate=function(i,l,_){return this.property.possiblyEvaluate(this,i,l,_)};var hs=function(i){this.property=i,this.value=new Rs(i,void 0)};hs.prototype.transitioned=function(i,l){return new wu(this.property,this.value,l,er({},i.transition,this.transition),i.now)},hs.prototype.untransitioned=function(){return new wu(this.property,this.value,null,{},0)};var lu=function(i){this._properties=i,this._values=Object.create(i.defaultTransitionablePropertyValues)};lu.prototype.getValue=function(i){return jt(this._values[i].value.value)},lu.prototype.setValue=function(i,l){this._values.hasOwnProperty(i)||(this._values[i]=new hs(this._values[i].property)),this._values[i].value=new Rs(this._values[i].property,l===null?void 0:jt(l))},lu.prototype.getTransition=function(i){return jt(this._values[i].transition)},lu.prototype.setTransition=function(i,l){this._values.hasOwnProperty(i)||(this._values[i]=new hs(this._values[i].property)),this._values[i].transition=jt(l)||void 0},lu.prototype.serialize=function(){for(var i={},l=0,_=Object.keys(this._values);l<_.length;l+=1){var S=_[l],F=this.getValue(S);F!==void 0&&(i[S]=F);var j=this.getTransition(S);j!==void 0&&(i[S+"-transition"]=j)}return i},lu.prototype.transitioned=function(i,l){for(var _=new uh(this._properties),S=0,F=Object.keys(this._values);S<F.length;S+=1){var j=F[S];_._values[j]=this._values[j].transitioned(i,l._values[j])}return _},lu.prototype.untransitioned=function(){for(var i=new uh(this._properties),l=0,_=Object.keys(this._values);l<_.length;l+=1){var S=_[l];i._values[S]=this._values[S].untransitioned()}return i};var wu=function(i,l,_,S,F){this.property=i,this.value=l,this.begin=F+S.delay||0,this.end=this.begin+S.duration||0,i.specification.transition&&(S.delay||S.duration)&&(this.prior=_)};wu.prototype.possiblyEvaluate=function(i,l,_){var S=i.now||0,F=this.value.possiblyEvaluate(i,l,_),j=this.prior;if(j){if(S>this.end)return this.prior=null,F;if(this.value.isDataDriven())return this.prior=null,F;if(S<this.begin)return j.possiblyEvaluate(i,l,_);var p=(S-this.begin)/(this.end-this.begin);return this.property.interpolate(j.possiblyEvaluate(i,l,_),F,function(v){if(v<=0)return 0;if(v>=1)return 1;var m=v*v,w=m*v;return 4*(v<.5?w:3*(v-m)+w-.75)}(p))}return F};var uh=function(i){this._properties=i,this._values=Object.create(i.defaultTransitioningPropertyValues)};uh.prototype.possiblyEvaluate=function(i,l,_){for(var S=new Qp(this._properties),F=0,j=Object.keys(this._values);F<j.length;F+=1){var p=j[F];S._values[p]=this._values[p].possiblyEvaluate(i,l,_)}return S},uh.prototype.hasTransition=function(){for(var i=0,l=Object.keys(this._values);i<l.length;i+=1)if(this._values[l[i]].prior)return!0;return!1};var ch=function(i){this._properties=i,this._values=Object.create(i.defaultPropertyValues)};ch.prototype.getValue=function(i){return jt(this._values[i].value)},ch.prototype.setValue=function(i,l){this._values[i]=new Rs(this._values[i].property,l===null?void 0:jt(l))},ch.prototype.serialize=function(){for(var i={},l=0,_=Object.keys(this._values);l<_.length;l+=1){var S=_[l],F=this.getValue(S);F!==void 0&&(i[S]=F)}return i},ch.prototype.possiblyEvaluate=function(i,l,_){for(var S=new Qp(this._properties),F=0,j=Object.keys(this._values);F<j.length;F+=1){var p=j[F];S._values[p]=this._values[p].possiblyEvaluate(i,l,_)}return S};var Nu=function(i,l,_){this.property=i,this.value=l,this.parameters=_};Nu.prototype.isConstant=function(){return this.value.kind==="constant"},Nu.prototype.constantOr=function(i){return this.value.kind==="constant"?this.value.value:i},Nu.prototype.evaluate=function(i,l,_,S){return this.property.evaluate(this.value,this.parameters,i,l,_,S)};var Qp=function(i){this._properties=i,this._values=Object.create(i.defaultPossiblyEvaluatedValues)};Qp.prototype.get=function(i){return this._values[i]};var Gi=function(i){this.specification=i};Gi.prototype.possiblyEvaluate=function(i,l){return i.expression.evaluate(l)},Gi.prototype.interpolate=function(i,l,_){var S=eu[this.specification.type];return S?S(i,l,_):i};var Si=function(i,l){this.specification=i,this.overrides=l};Si.prototype.possiblyEvaluate=function(i,l,_,S){return new Nu(this,i.expression.kind==="constant"||i.expression.kind==="camera"?{kind:"constant",value:i.expression.evaluate(l,null,{},_,S)}:i.expression,l)},Si.prototype.interpolate=function(i,l,_){if(i.value.kind!=="constant"||l.value.kind!=="constant")return i;if(i.value.value===void 0||l.value.value===void 0)return new Nu(this,{kind:"constant",value:void 0},i.parameters);var S=eu[this.specification.type];return S?new Nu(this,{kind:"constant",value:S(i.value.value,l.value.value,_)},i.parameters):i},Si.prototype.evaluate=function(i,l,_,S,F,j){return i.kind==="constant"?i.value:i.evaluate(l,_,S,F,j)};var ji=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.possiblyEvaluate=function(_,S,F,j){if(_.value===void 0)return new Nu(this,{kind:"constant",value:void 0},S);if(_.expression.kind==="constant"){var p=_.expression.evaluate(S,null,{},F,j),v=_.property.specification.type==="resolvedImage"&&typeof p!="string"?p.name:p,m=this._calculate(v,v,v,S);return new Nu(this,{kind:"constant",value:m},S)}if(_.expression.kind==="camera"){var w=this._calculate(_.expression.evaluate({zoom:S.zoom-1}),_.expression.evaluate({zoom:S.zoom}),_.expression.evaluate({zoom:S.zoom+1}),S);return new Nu(this,{kind:"constant",value:w},S)}return new Nu(this,_.expression,S)},l.prototype.evaluate=function(_,S,F,j,p,v){if(_.kind==="source"){var m=_.evaluate(S,F,j,p,v);return this._calculate(m,m,m,S)}return _.kind==="composite"?this._calculate(_.evaluate({zoom:Math.floor(S.zoom)-1},F,j),_.evaluate({zoom:Math.floor(S.zoom)},F,j),_.evaluate({zoom:Math.floor(S.zoom)+1},F,j),S):_.value},l.prototype._calculate=function(_,S,F,j){return j.zoom>j.zoomHistory.lastIntegerZoom?{from:_,to:S}:{from:F,to:S}},l.prototype.interpolate=function(_){return _},l}(Si),ao=function(i){this.specification=i};ao.prototype.possiblyEvaluate=function(i,l,_,S){if(i.value!==void 0){if(i.expression.kind==="constant"){var F=i.expression.evaluate(l,null,{},_,S);return this._calculate(F,F,F,l)}return this._calculate(i.expression.evaluate(new fa(Math.floor(l.zoom-1),l)),i.expression.evaluate(new fa(Math.floor(l.zoom),l)),i.expression.evaluate(new fa(Math.floor(l.zoom+1),l)),l)}},ao.prototype._calculate=function(i,l,_,S){return S.zoom>S.zoomHistory.lastIntegerZoom?{from:i,to:l}:{from:_,to:l}},ao.prototype.interpolate=function(i){return i};var Ic=function(i){this.specification=i};Ic.prototype.possiblyEvaluate=function(i,l,_,S){return!!i.expression.evaluate(l,null,{},_,S)},Ic.prototype.interpolate=function(){return!1};var Gs=function(i){for(var l in this.properties=i,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],i){var _=i[l];_.specification.overridable&&this.overridableProperties.push(l);var S=this.defaultPropertyValues[l]=new Rs(_,void 0),F=this.defaultTransitionablePropertyValues[l]=new hs(_);this.defaultTransitioningPropertyValues[l]=F.untransitioned(),this.defaultPossiblyEvaluatedValues[l]=S.possiblyEvaluate({})}};fi("DataDrivenProperty",Si),fi("DataConstantProperty",Gi),fi("CrossFadedDataDrivenProperty",ji),fi("CrossFadedProperty",ao),fi("ColorRampProperty",Ic);var Lc=function(i){function l(_,S){if(i.call(this),this.id=_.id,this.type=_.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},_.type!=="custom"&&(this.metadata=(_=_).metadata,this.minzoom=_.minzoom,this.maxzoom=_.maxzoom,_.type!=="background"&&(this.source=_.source,this.sourceLayer=_["source-layer"],this.filter=_.filter),S.layout&&(this._unevaluatedLayout=new ch(S.layout)),S.paint)){for(var F in this._transitionablePaint=new lu(S.paint),_.paint)this.setPaintProperty(F,_.paint[F],{validate:!1});for(var j in _.layout)this.setLayoutProperty(j,_.layout[j],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Qp(S.paint)}}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},l.prototype.getLayoutProperty=function(_){return _==="visibility"?this.visibility:this._unevaluatedLayout.getValue(_)},l.prototype.setLayoutProperty=function(_,S,F){F===void 0&&(F={}),S!=null&&this._validate(Qh,"layers."+this.id+".layout."+_,_,S,F)||(_!=="visibility"?this._unevaluatedLayout.setValue(_,S):this.visibility=S)},l.prototype.getPaintProperty=function(_){return ki(_,"-transition")?this._transitionablePaint.getTransition(_.slice(0,-11)):this._transitionablePaint.getValue(_)},l.prototype.setPaintProperty=function(_,S,F){if(F===void 0&&(F={}),S!=null&&this._validate(ah,"layers."+this.id+".paint."+_,_,S,F))return!1;if(ki(_,"-transition"))return this._transitionablePaint.setTransition(_.slice(0,-11),S||void 0),!1;var j=this._transitionablePaint._values[_],p=j.property.specification["property-type"]==="cross-faded-data-driven",v=j.value.isDataDriven(),m=j.value;this._transitionablePaint.setValue(_,S),this._handleSpecialPaintPropertyUpdate(_);var w=this._transitionablePaint._values[_].value;return w.isDataDriven()||v||p||this._handleOverridablePaintPropertyUpdate(_,m,w)},l.prototype._handleSpecialPaintPropertyUpdate=function(_){},l.prototype._handleOverridablePaintPropertyUpdate=function(_,S,F){return!1},l.prototype.isHidden=function(_){return!!(this.minzoom&&_<this.minzoom)||!!(this.maxzoom&&_>=this.maxzoom)||this.visibility==="none"},l.prototype.updateTransitions=function(_){this._transitioningPaint=this._transitionablePaint.transitioned(_,this._transitioningPaint)},l.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},l.prototype.recalculate=function(_,S){_.getCrossfadeParameters&&(this._crossfadeParameters=_.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(_,void 0,S)),this.paint=this._transitioningPaint.possiblyEvaluate(_,void 0,S)},l.prototype.serialize=function(){var _={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(_.layout=_.layout||{},_.layout.visibility=this.visibility),xr(_,function(S,F){return!(S===void 0||F==="layout"&&!Object.keys(S).length||F==="paint"&&!Object.keys(S).length)})},l.prototype._validate=function(_,S,F,j,p){return p===void 0&&(p={}),(!p||p.validate!==!1)&&sh(this,_.call(oh,{key:S,layerType:this.type,objectKey:F,value:j,styleSpec:Ae,style:{glyphs:!0,sprite:!0}}))},l.prototype.is3D=function(){return!1},l.prototype.isTileClipped=function(){return!1},l.prototype.hasOffscreenPass=function(){return!1},l.prototype.resize=function(){},l.prototype.isStateDependent=function(){for(var _ in this.paint._values){var S=this.paint.get(_);if(S instanceof Nu&&ec(S.property.specification)&&(S.value.kind==="source"||S.value.kind==="composite")&&S.value.isStateDependent)return!0}return!1},l}(Ue),ul={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Nh=function(i,l){this._structArray=i,this._pos1=l*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},xa=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Al(i,l){l===void 0&&(l=1);var _=0,S=0;return{members:i.map(function(F){var j=ul[F.type].BYTES_PER_ELEMENT,p=_=Lu(_,Math.max(l,j)),v=F.components||1;return S=Math.max(S,j),_+=j*v,{name:F.name,type:F.type,components:v,offset:p}}),size:Lu(_,Math.max(S,l)),alignment:l}}function Lu(i,l){return Math.ceil(i/l)*l}xa.serialize=function(i,l){return i._trim(),l&&(i.isTransferred=!0,l.push(i.arrayBuffer)),{length:i.length,arrayBuffer:i.arrayBuffer}},xa.deserialize=function(i){var l=Object.create(this.prototype);return l.arrayBuffer=i.arrayBuffer,l.length=i.length,l.capacity=i.arrayBuffer.byteLength/l.bytesPerElement,l._refreshViews(),l},xa.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},xa.prototype.clear=function(){this.length=0},xa.prototype.resize=function(i){this.reserve(i),this.length=i},xa.prototype.reserve=function(i){if(i>this.capacity){this.capacity=Math.max(i,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var l=this.uint8;this._refreshViews(),l&&this.uint8.set(l)}},xa.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var ks=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S){var F=this.length;return this.resize(F+1),this.emplace(F,_,S)},l.prototype.emplace=function(_,S,F){var j=2*_;return this.int16[j+0]=S,this.int16[j+1]=F,_},l}(xa);ks.prototype.bytesPerElement=4,fi("StructArrayLayout2i4",ks);var _l=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j){var p=this.length;return this.resize(p+1),this.emplace(p,_,S,F,j)},l.prototype.emplace=function(_,S,F,j,p){var v=4*_;return this.int16[v+0]=S,this.int16[v+1]=F,this.int16[v+2]=j,this.int16[v+3]=p,_},l}(xa);_l.prototype.bytesPerElement=8,fi("StructArrayLayout4i8",_l);var pc=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p,v){var m=this.length;return this.resize(m+1),this.emplace(m,_,S,F,j,p,v)},l.prototype.emplace=function(_,S,F,j,p,v,m){var w=6*_;return this.int16[w+0]=S,this.int16[w+1]=F,this.int16[w+2]=j,this.int16[w+3]=p,this.int16[w+4]=v,this.int16[w+5]=m,_},l}(xa);pc.prototype.bytesPerElement=12,fi("StructArrayLayout2i4i12",pc);var Du=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p,v){var m=this.length;return this.resize(m+1),this.emplace(m,_,S,F,j,p,v)},l.prototype.emplace=function(_,S,F,j,p,v,m){var w=4*_,D=8*_;return this.int16[w+0]=S,this.int16[w+1]=F,this.uint8[D+4]=j,this.uint8[D+5]=p,this.uint8[D+6]=v,this.uint8[D+7]=m,_},l}(xa);Du.prototype.bytesPerElement=8,fi("StructArrayLayout2i4ub8",Du);var zh=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S){var F=this.length;return this.resize(F+1),this.emplace(F,_,S)},l.prototype.emplace=function(_,S,F){var j=2*_;return this.float32[j+0]=S,this.float32[j+1]=F,_},l}(xa);zh.prototype.bytesPerElement=8,fi("StructArrayLayout2f8",zh);var Su=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p,v,m,w,D,N){var W=this.length;return this.resize(W+1),this.emplace(W,_,S,F,j,p,v,m,w,D,N)},l.prototype.emplace=function(_,S,F,j,p,v,m,w,D,N,W){var $=10*_;return this.uint16[$+0]=S,this.uint16[$+1]=F,this.uint16[$+2]=j,this.uint16[$+3]=p,this.uint16[$+4]=v,this.uint16[$+5]=m,this.uint16[$+6]=w,this.uint16[$+7]=D,this.uint16[$+8]=N,this.uint16[$+9]=W,_},l}(xa);Su.prototype.bytesPerElement=20,fi("StructArrayLayout10ui20",Su);var qc=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p,v,m,w,D,N,W,$){var ie=this.length;return this.resize(ie+1),this.emplace(ie,_,S,F,j,p,v,m,w,D,N,W,$)},l.prototype.emplace=function(_,S,F,j,p,v,m,w,D,N,W,$,ie){var pe=12*_;return this.int16[pe+0]=S,this.int16[pe+1]=F,this.int16[pe+2]=j,this.int16[pe+3]=p,this.uint16[pe+4]=v,this.uint16[pe+5]=m,this.uint16[pe+6]=w,this.uint16[pe+7]=D,this.int16[pe+8]=N,this.int16[pe+9]=W,this.int16[pe+10]=$,this.int16[pe+11]=ie,_},l}(xa);qc.prototype.bytesPerElement=24,fi("StructArrayLayout4i4ui4i24",qc);var Sh=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F){var j=this.length;return this.resize(j+1),this.emplace(j,_,S,F)},l.prototype.emplace=function(_,S,F,j){var p=3*_;return this.float32[p+0]=S,this.float32[p+1]=F,this.float32[p+2]=j,_},l}(xa);Sh.prototype.bytesPerElement=12,fi("StructArrayLayout3f12",Sh);var nc=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_){var S=this.length;return this.resize(S+1),this.emplace(S,_)},l.prototype.emplace=function(_,S){return this.uint32[1*_+0]=S,_},l}(xa);nc.prototype.bytesPerElement=4,fi("StructArrayLayout1ul4",nc);var Yl=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p,v,m,w,D){var N=this.length;return this.resize(N+1),this.emplace(N,_,S,F,j,p,v,m,w,D)},l.prototype.emplace=function(_,S,F,j,p,v,m,w,D,N){var W=10*_,$=5*_;return this.int16[W+0]=S,this.int16[W+1]=F,this.int16[W+2]=j,this.int16[W+3]=p,this.int16[W+4]=v,this.int16[W+5]=m,this.uint32[$+3]=w,this.uint16[W+8]=D,this.uint16[W+9]=N,_},l}(xa);Yl.prototype.bytesPerElement=20,fi("StructArrayLayout6i1ul2ui20",Yl);var Th=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p,v){var m=this.length;return this.resize(m+1),this.emplace(m,_,S,F,j,p,v)},l.prototype.emplace=function(_,S,F,j,p,v,m){var w=6*_;return this.int16[w+0]=S,this.int16[w+1]=F,this.int16[w+2]=j,this.int16[w+3]=p,this.int16[w+4]=v,this.int16[w+5]=m,_},l}(xa);Th.prototype.bytesPerElement=12,fi("StructArrayLayout2i2i2i12",Th);var ba=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p){var v=this.length;return this.resize(v+1),this.emplace(v,_,S,F,j,p)},l.prototype.emplace=function(_,S,F,j,p,v){var m=4*_,w=8*_;return this.float32[m+0]=S,this.float32[m+1]=F,this.float32[m+2]=j,this.int16[w+6]=p,this.int16[w+7]=v,_},l}(xa);ba.prototype.bytesPerElement=16,fi("StructArrayLayout2f1f2i16",ba);var z=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j){var p=this.length;return this.resize(p+1),this.emplace(p,_,S,F,j)},l.prototype.emplace=function(_,S,F,j,p){var v=12*_,m=3*_;return this.uint8[v+0]=S,this.uint8[v+1]=F,this.float32[m+1]=j,this.float32[m+2]=p,_},l}(xa);z.prototype.bytesPerElement=12,fi("StructArrayLayout2ub2f12",z);var s=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F){var j=this.length;return this.resize(j+1),this.emplace(j,_,S,F)},l.prototype.emplace=function(_,S,F,j){var p=3*_;return this.uint16[p+0]=S,this.uint16[p+1]=F,this.uint16[p+2]=j,_},l}(xa);s.prototype.bytesPerElement=6,fi("StructArrayLayout3ui6",s);var x=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p,v,m,w,D,N,W,$,ie,pe,we,ke,Ge){var ht=this.length;return this.resize(ht+1),this.emplace(ht,_,S,F,j,p,v,m,w,D,N,W,$,ie,pe,we,ke,Ge)},l.prototype.emplace=function(_,S,F,j,p,v,m,w,D,N,W,$,ie,pe,we,ke,Ge,ht){var mt=24*_,St=12*_,xt=48*_;return this.int16[mt+0]=S,this.int16[mt+1]=F,this.uint16[mt+2]=j,this.uint16[mt+3]=p,this.uint32[St+2]=v,this.uint32[St+3]=m,this.uint32[St+4]=w,this.uint16[mt+10]=D,this.uint16[mt+11]=N,this.uint16[mt+12]=W,this.float32[St+7]=$,this.float32[St+8]=ie,this.uint8[xt+36]=pe,this.uint8[xt+37]=we,this.uint8[xt+38]=ke,this.uint32[St+10]=Ge,this.int16[mt+22]=ht,_},l}(xa);x.prototype.bytesPerElement=48,fi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",x);var I=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p,v,m,w,D,N,W,$,ie,pe,we,ke,Ge,ht,mt,St,xt,bt,kt,ft,nr,br,Pr,Mn){var yn=this.length;return this.resize(yn+1),this.emplace(yn,_,S,F,j,p,v,m,w,D,N,W,$,ie,pe,we,ke,Ge,ht,mt,St,xt,bt,kt,ft,nr,br,Pr,Mn)},l.prototype.emplace=function(_,S,F,j,p,v,m,w,D,N,W,$,ie,pe,we,ke,Ge,ht,mt,St,xt,bt,kt,ft,nr,br,Pr,Mn,yn){var kr=34*_,Ai=17*_;return this.int16[kr+0]=S,this.int16[kr+1]=F,this.int16[kr+2]=j,this.int16[kr+3]=p,this.int16[kr+4]=v,this.int16[kr+5]=m,this.int16[kr+6]=w,this.int16[kr+7]=D,this.uint16[kr+8]=N,this.uint16[kr+9]=W,this.uint16[kr+10]=$,this.uint16[kr+11]=ie,this.uint16[kr+12]=pe,this.uint16[kr+13]=we,this.uint16[kr+14]=ke,this.uint16[kr+15]=Ge,this.uint16[kr+16]=ht,this.uint16[kr+17]=mt,this.uint16[kr+18]=St,this.uint16[kr+19]=xt,this.uint16[kr+20]=bt,this.uint16[kr+21]=kt,this.uint16[kr+22]=ft,this.uint32[Ai+12]=nr,this.float32[Ai+13]=br,this.float32[Ai+14]=Pr,this.float32[Ai+15]=Mn,this.float32[Ai+16]=yn,_},l}(xa);I.prototype.bytesPerElement=68,fi("StructArrayLayout8i15ui1ul4f68",I);var k=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_){var S=this.length;return this.resize(S+1),this.emplace(S,_)},l.prototype.emplace=function(_,S){return this.float32[1*_+0]=S,_},l}(xa);k.prototype.bytesPerElement=4,fi("StructArrayLayout1f4",k);var H=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F){var j=this.length;return this.resize(j+1),this.emplace(j,_,S,F)},l.prototype.emplace=function(_,S,F,j){var p=3*_;return this.int16[p+0]=S,this.int16[p+1]=F,this.int16[p+2]=j,_},l}(xa);H.prototype.bytesPerElement=6,fi("StructArrayLayout3i6",H);var ee=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F){var j=this.length;return this.resize(j+1),this.emplace(j,_,S,F)},l.prototype.emplace=function(_,S,F,j){var p=4*_;return this.uint32[2*_+0]=S,this.uint16[p+2]=F,this.uint16[p+3]=j,_},l}(xa);ee.prototype.bytesPerElement=8,fi("StructArrayLayout1ul2ui8",ee);var ne=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S){var F=this.length;return this.resize(F+1),this.emplace(F,_,S)},l.prototype.emplace=function(_,S,F){var j=2*_;return this.uint16[j+0]=S,this.uint16[j+1]=F,_},l}(xa);ne.prototype.bytesPerElement=4,fi("StructArrayLayout2ui4",ne);var ue=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_){var S=this.length;return this.resize(S+1),this.emplace(S,_)},l.prototype.emplace=function(_,S){return this.uint16[1*_+0]=S,_},l}(xa);ue.prototype.bytesPerElement=2,fi("StructArrayLayout1ui2",ue);var _e=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j){var p=this.length;return this.resize(p+1),this.emplace(p,_,S,F,j)},l.prototype.emplace=function(_,S,F,j,p){var v=4*_;return this.float32[v+0]=S,this.float32[v+1]=F,this.float32[v+2]=j,this.float32[v+3]=p,_},l}(xa);_e.prototype.bytesPerElement=16,fi("StructArrayLayout4f16",_e);var h=function(i){function l(){i.apply(this,arguments)}i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l;var _={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return _.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},_.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},_.x1.get=function(){return this._structArray.int16[this._pos2+2]},_.y1.get=function(){return this._structArray.int16[this._pos2+3]},_.x2.get=function(){return this._structArray.int16[this._pos2+4]},_.y2.get=function(){return this._structArray.int16[this._pos2+5]},_.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},_.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},_.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},_.anchorPoint.get=function(){return new Le(this.anchorPointX,this.anchorPointY)},Object.defineProperties(l.prototype,_),l}(Nh);h.prototype.size=20;var g=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.get=function(_){return new h(this,_)},l}(Yl);fi("CollisionBoxArray",g);var d=function(i){function l(){i.apply(this,arguments)}i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l;var _={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return _.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},_.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},_.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},_.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},_.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},_.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},_.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},_.segment.get=function(){return this._structArray.uint16[this._pos2+10]},_.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},_.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},_.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},_.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},_.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},_.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},_.placedOrientation.set=function(S){this._structArray.uint8[this._pos1+37]=S},_.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},_.hidden.set=function(S){this._structArray.uint8[this._pos1+38]=S},_.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},_.crossTileID.set=function(S){this._structArray.uint32[this._pos4+10]=S},_.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(l.prototype,_),l}(Nh);d.prototype.size=48;var b=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.get=function(_){return new d(this,_)},l}(x);fi("PlacedSymbolArray",b);var B=function(i){function l(){i.apply(this,arguments)}i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l;var _={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return _.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},_.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},_.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},_.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},_.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},_.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},_.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},_.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},_.key.get=function(){return this._structArray.uint16[this._pos2+8]},_.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},_.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},_.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},_.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},_.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},_.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},_.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},_.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},_.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},_.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},_.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},_.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},_.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},_.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},_.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},_.crossTileID.set=function(S){this._structArray.uint32[this._pos4+12]=S},_.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},_.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},_.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},_.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(l.prototype,_),l}(Nh);B.prototype.size=68;var G=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.get=function(_){return new B(this,_)},l}(I);fi("SymbolInstanceArray",G);var q=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.getoffsetX=function(_){return this.float32[1*_+0]},l}(k);fi("GlyphOffsetArray",q);var te=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.getx=function(_){return this.int16[3*_+0]},l.prototype.gety=function(_){return this.int16[3*_+1]},l.prototype.gettileUnitDistanceFromAnchor=function(_){return this.int16[3*_+2]},l}(H);fi("SymbolLineVertexArray",te);var fe=function(i){function l(){i.apply(this,arguments)}i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l;var _={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return _.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},_.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},_.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(l.prototype,_),l}(Nh);fe.prototype.size=8;var ce=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.get=function(_){return new fe(this,_)},l}(ee);fi("FeatureIndexArray",ce);var Te=Al([{name:"a_pos",components:2,type:"Int16"}],4).members,Ie=function(i){i===void 0&&(i=[]),this.segments=i};function Oe(i,l){return 256*(i=Ve(Math.floor(i),0,255))+Ve(Math.floor(l),0,255)}Ie.prototype.prepareSegment=function(i,l,_,S){var F=this.segments[this.segments.length-1];return i>Ie.MAX_VERTEX_ARRAY_LENGTH&&gr("Max vertices per segment is "+Ie.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+i),(!F||F.vertexLength+i>Ie.MAX_VERTEX_ARRAY_LENGTH||F.sortKey!==S)&&(F={vertexOffset:l.length,primitiveOffset:_.length,vertexLength:0,primitiveLength:0},S!==void 0&&(F.sortKey=S),this.segments.push(F)),F},Ie.prototype.get=function(){return this.segments},Ie.prototype.destroy=function(){for(var i=0,l=this.segments;i<l.length;i+=1){var _=l[i];for(var S in _.vaos)_.vaos[S].destroy()}},Ie.simpleSegment=function(i,l,_,S){return new Ie([{vertexOffset:i,primitiveOffset:l,vertexLength:_,primitiveLength:S,vaos:{},sortKey:0}])},Ie.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,fi("SegmentVector",Ie);var Qe=Al([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),nt=R(function(i){i.exports=function(l,_){var S,F,j,p,v,m,w,D;for(F=l.length-(S=3&l.length),j=_,v=3432918353,m=461845907,D=0;D<F;)w=255&l.charCodeAt(D)|(255&l.charCodeAt(++D))<<8|(255&l.charCodeAt(++D))<<16|(255&l.charCodeAt(++D))<<24,++D,j=27492+(65535&(p=5*(65535&(j=(j^=w=(65535&(w=(w=(65535&w)*v+(((w>>>16)*v&65535)<<16)&4294967295)<<15|w>>>17))*m+(((w>>>16)*m&65535)<<16)&4294967295)<<13|j>>>19))+((5*(j>>>16)&65535)<<16)&4294967295))+((58964+(p>>>16)&65535)<<16);switch(w=0,S){case 3:w^=(255&l.charCodeAt(D+2))<<16;case 2:w^=(255&l.charCodeAt(D+1))<<8;case 1:j^=w=(65535&(w=(w=(65535&(w^=255&l.charCodeAt(D)))*v+(((w>>>16)*v&65535)<<16)&4294967295)<<15|w>>>17))*m+(((w>>>16)*m&65535)<<16)&4294967295}return j^=l.length,j=2246822507*(65535&(j^=j>>>16))+((2246822507*(j>>>16)&65535)<<16)&4294967295,j=3266489909*(65535&(j^=j>>>13))+((3266489909*(j>>>16)&65535)<<16)&4294967295,(j^=j>>>16)>>>0}}),ct=R(function(i){i.exports=function(l,_){for(var S,F=l.length,j=_^F,p=0;F>=4;)S=1540483477*(65535&(S=255&l.charCodeAt(p)|(255&l.charCodeAt(++p))<<8|(255&l.charCodeAt(++p))<<16|(255&l.charCodeAt(++p))<<24))+((1540483477*(S>>>16)&65535)<<16),j=1540483477*(65535&j)+((1540483477*(j>>>16)&65535)<<16)^(S=1540483477*(65535&(S^=S>>>24))+((1540483477*(S>>>16)&65535)<<16)),F-=4,++p;switch(F){case 3:j^=(255&l.charCodeAt(p+2))<<16;case 2:j^=(255&l.charCodeAt(p+1))<<8;case 1:j=1540483477*(65535&(j^=255&l.charCodeAt(p)))+((1540483477*(j>>>16)&65535)<<16)}return j=1540483477*(65535&(j^=j>>>13))+((1540483477*(j>>>16)&65535)<<16),(j^=j>>>15)>>>0}}),tt=nt,Tt=ct;tt.murmur3=nt,tt.murmur2=Tt;var Ut=function(){this.ids=[],this.positions=[],this.indexed=!1};Ut.prototype.add=function(i,l,_,S){this.ids.push(pr(i)),this.positions.push(l,_,S)},Ut.prototype.getPositions=function(i){for(var l=pr(i),_=0,S=this.ids.length-1;_<S;){var F=_+S>>1;this.ids[F]>=l?S=F:_=F+1}for(var j=[];this.ids[_]===l;)j.push({index:this.positions[3*_],start:this.positions[3*_+1],end:this.positions[3*_+2]}),_++;return j},Ut.serialize=function(i,l){var _=new Float64Array(i.ids),S=new Uint32Array(i.positions);return function F(j,p,v,m){for(;v<m;){for(var w=j[v+m>>1],D=v-1,N=m+1;;){do D++;while(j[D]<w);do N--;while(j[N]>w);if(D>=N)break;tr(j,D,N),tr(p,3*D,3*N),tr(p,3*D+1,3*N+1),tr(p,3*D+2,3*N+2)}N-v<m-N?(F(j,p,v,N),v=N+1):(F(j,p,N+1,m),m=N)}}(_,S,0,_.length-1),l&&l.push(_.buffer,S.buffer),{ids:_,positions:S}},Ut.deserialize=function(i){var l=new Ut;return l.ids=i.ids,l.positions=i.positions,l.indexed=!0,l};var Nt=Math.pow(2,53)-1;function pr(i){var l=+i;return!isNaN(l)&&l<=Nt?l:tt(String(i))}function tr(i,l,_){var S=i[l];i[l]=i[_],i[_]=S}fi("FeaturePositionMap",Ut);var Dr=function(i,l){this.gl=i.gl,this.location=l},Hr=function(i){function l(_,S){i.call(this,_,S),this.current=0}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.set=function(_){this.current!==_&&(this.current=_,this.gl.uniform1i(this.location,_))},l}(Dr),sn=function(i){function l(_,S){i.call(this,_,S),this.current=0}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.set=function(_){this.current!==_&&(this.current=_,this.gl.uniform1f(this.location,_))},l}(Dr),nn=function(i){function l(_,S){i.call(this,_,S),this.current=[0,0]}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.set=function(_){_[0]===this.current[0]&&_[1]===this.current[1]||(this.current=_,this.gl.uniform2f(this.location,_[0],_[1]))},l}(Dr),Gn=function(i){function l(_,S){i.call(this,_,S),this.current=[0,0,0]}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.set=function(_){_[0]===this.current[0]&&_[1]===this.current[1]&&_[2]===this.current[2]||(this.current=_,this.gl.uniform3f(this.location,_[0],_[1],_[2]))},l}(Dr),di=function(i){function l(_,S){i.call(this,_,S),this.current=[0,0,0,0]}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.set=function(_){_[0]===this.current[0]&&_[1]===this.current[1]&&_[2]===this.current[2]&&_[3]===this.current[3]||(this.current=_,this.gl.uniform4f(this.location,_[0],_[1],_[2],_[3]))},l}(Dr),Di=function(i){function l(_,S){i.call(this,_,S),this.current=Fo.transparent}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.set=function(_){_.r===this.current.r&&_.g===this.current.g&&_.b===this.current.b&&_.a===this.current.a||(this.current=_,this.gl.uniform4f(this.location,_.r,_.g,_.b,_.a))},l}(Dr),Ui=new Float32Array(16),ho=function(i){function l(_,S){i.call(this,_,S),this.current=Ui}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.set=function(_){if(_[12]!==this.current[12]||_[0]!==this.current[0])return this.current=_,void this.gl.uniformMatrix4fv(this.location,!1,_);for(var S=1;S<16;S++)if(_[S]!==this.current[S]){this.current=_,this.gl.uniformMatrix4fv(this.location,!1,_);break}},l}(Dr);function gi(i){return[Oe(255*i.r,255*i.g),Oe(255*i.b,255*i.a)]}var Wi=function(i,l,_){this.value=i,this.uniformNames=l.map(function(S){return"u_"+S}),this.type=_};Wi.prototype.setUniform=function(i,l,_){i.set(_.constantOr(this.value))},Wi.prototype.getBinding=function(i,l,_){return this.type==="color"?new Di(i,l):new sn(i,l)};var Ko=function(i,l){this.uniformNames=l.map(function(_){return"u_"+_}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Ko.prototype.setConstantPatternPositions=function(i,l){this.pixelRatioFrom=l.pixelRatio,this.pixelRatioTo=i.pixelRatio,this.patternFrom=l.tlbr,this.patternTo=i.tlbr},Ko.prototype.setUniform=function(i,l,_,S){var F=S==="u_pattern_to"?this.patternTo:S==="u_pattern_from"?this.patternFrom:S==="u_pixel_ratio_to"?this.pixelRatioTo:S==="u_pixel_ratio_from"?this.pixelRatioFrom:null;F&&i.set(F)},Ko.prototype.getBinding=function(i,l,_){return _.substr(0,9)==="u_pattern"?new di(i,l):new sn(i,l)};var Mo=function(i,l,_,S){this.expression=i,this.type=_,this.maxValue=0,this.paintVertexAttributes=l.map(function(F){return{name:"a_"+F,type:"Float32",components:_==="color"?2:1,offset:0}}),this.paintVertexArray=new S};Mo.prototype.populatePaintArray=function(i,l,_,S,F){var j=this.paintVertexArray.length,p=this.expression.evaluate(new fa(0),l,{},S,[],F);this.paintVertexArray.resize(i),this._setPaintValue(j,i,p)},Mo.prototype.updatePaintArray=function(i,l,_,S){var F=this.expression.evaluate({zoom:0},_,S);this._setPaintValue(i,l,F)},Mo.prototype._setPaintValue=function(i,l,_){if(this.type==="color")for(var S=gi(_),F=i;F<l;F++)this.paintVertexArray.emplace(F,S[0],S[1]);else{for(var j=i;j<l;j++)this.paintVertexArray.emplace(j,_);this.maxValue=Math.max(this.maxValue,Math.abs(_))}},Mo.prototype.upload=function(i){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=i.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Mo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var mo=function(i,l,_,S,F,j){this.expression=i,this.uniformNames=l.map(function(p){return"u_"+p+"_t"}),this.type=_,this.useIntegerZoom=S,this.zoom=F,this.maxValue=0,this.paintVertexAttributes=l.map(function(p){return{name:"a_"+p,type:"Float32",components:_==="color"?4:2,offset:0}}),this.paintVertexArray=new j};mo.prototype.populatePaintArray=function(i,l,_,S,F){var j=this.expression.evaluate(new fa(this.zoom),l,{},S,[],F),p=this.expression.evaluate(new fa(this.zoom+1),l,{},S,[],F),v=this.paintVertexArray.length;this.paintVertexArray.resize(i),this._setPaintValue(v,i,j,p)},mo.prototype.updatePaintArray=function(i,l,_,S){var F=this.expression.evaluate({zoom:this.zoom},_,S),j=this.expression.evaluate({zoom:this.zoom+1},_,S);this._setPaintValue(i,l,F,j)},mo.prototype._setPaintValue=function(i,l,_,S){if(this.type==="color")for(var F=gi(_),j=gi(S),p=i;p<l;p++)this.paintVertexArray.emplace(p,F[0],F[1],j[0],j[1]);else{for(var v=i;v<l;v++)this.paintVertexArray.emplace(v,_,S);this.maxValue=Math.max(this.maxValue,Math.abs(_),Math.abs(S))}},mo.prototype.upload=function(i){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=i.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},mo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},mo.prototype.setUniform=function(i,l){var _=this.useIntegerZoom?Math.floor(l.zoom):l.zoom,S=Ve(this.expression.interpolationFactor(_,this.zoom,this.zoom+1),0,1);i.set(S)},mo.prototype.getBinding=function(i,l,_){return new sn(i,l)};var ko=function(i,l,_,S,F,j){this.expression=i,this.type=l,this.useIntegerZoom=_,this.zoom=S,this.layerId=j,this.zoomInPaintVertexArray=new F,this.zoomOutPaintVertexArray=new F};ko.prototype.populatePaintArray=function(i,l,_){var S=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(i),this.zoomOutPaintVertexArray.resize(i),this._setPaintValues(S,i,l.patterns&&l.patterns[this.layerId],_)},ko.prototype.updatePaintArray=function(i,l,_,S,F){this._setPaintValues(i,l,_.patterns&&_.patterns[this.layerId],F)},ko.prototype._setPaintValues=function(i,l,_,S){if(S&&_){var F=S[_.min],j=S[_.mid],p=S[_.max];if(F&&j&&p)for(var v=i;v<l;v++)this.zoomInPaintVertexArray.emplace(v,j.tl[0],j.tl[1],j.br[0],j.br[1],F.tl[0],F.tl[1],F.br[0],F.br[1],j.pixelRatio,F.pixelRatio),this.zoomOutPaintVertexArray.emplace(v,j.tl[0],j.tl[1],j.br[0],j.br[1],p.tl[0],p.tl[1],p.br[0],p.br[1],j.pixelRatio,p.pixelRatio)}},ko.prototype.upload=function(i){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=i.createVertexBuffer(this.zoomInPaintVertexArray,Qe.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=i.createVertexBuffer(this.zoomOutPaintVertexArray,Qe.members,this.expression.isStateDependent))},ko.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var xo=function(i,l,_){this.binders={},this._buffers=[];var S=[];for(var F in i.paint._values)if(_(F)){var j=i.paint.get(F);if(j instanceof Nu&&ec(j.property.specification)){var p=xs(F,i.type),v=j.value,m=j.property.specification.type,w=j.property.useIntegerZoom,D=j.property.specification["property-type"],N=D==="cross-faded"||D==="cross-faded-data-driven";if(v.kind==="constant")this.binders[F]=N?new Ko(v.value,p):new Wi(v.value,p,m),S.push("/u_"+F);else if(v.kind==="source"||N){var W=gs(F,m,"source");this.binders[F]=N?new ko(v,m,w,l,W,i.id):new Mo(v,p,m,W),S.push("/a_"+F)}else{var $=gs(F,m,"composite");this.binders[F]=new mo(v,p,m,w,l,$),S.push("/z_"+F)}}}this.cacheKey=S.sort().join("")};xo.prototype.getMaxValue=function(i){var l=this.binders[i];return l instanceof Mo||l instanceof mo?l.maxValue:0},xo.prototype.populatePaintArrays=function(i,l,_,S,F){for(var j in this.binders){var p=this.binders[j];(p instanceof Mo||p instanceof mo||p instanceof ko)&&p.populatePaintArray(i,l,_,S,F)}},xo.prototype.setConstantPatternPositions=function(i,l){for(var _ in this.binders){var S=this.binders[_];S instanceof Ko&&S.setConstantPatternPositions(i,l)}},xo.prototype.updatePaintArrays=function(i,l,_,S,F){var j=!1;for(var p in i)for(var v=0,m=l.getPositions(p);v<m.length;v+=1){var w=m[v],D=_.feature(w.index);for(var N in this.binders){var W=this.binders[N];if((W instanceof Mo||W instanceof mo||W instanceof ko)&&W.expression.isStateDependent===!0){var $=S.paint.get(N);W.expression=$.value,W.updatePaintArray(w.start,w.end,D,i[p],F),j=!0}}}return j},xo.prototype.defines=function(){var i=[];for(var l in this.binders){var _=this.binders[l];(_ instanceof Wi||_ instanceof Ko)&&i.push.apply(i,_.uniformNames.map(function(S){return"#define HAS_UNIFORM_"+S}))}return i},xo.prototype.getBinderAttributes=function(){var i=[];for(var l in this.binders){var _=this.binders[l];if(_ instanceof Mo||_ instanceof mo)for(var S=0;S<_.paintVertexAttributes.length;S++)i.push(_.paintVertexAttributes[S].name);else if(_ instanceof ko)for(var F=0;F<Qe.members.length;F++)i.push(Qe.members[F].name)}return i},xo.prototype.getBinderUniforms=function(){var i=[];for(var l in this.binders){var _=this.binders[l];if(_ instanceof Wi||_ instanceof Ko||_ instanceof mo)for(var S=0,F=_.uniformNames;S<F.length;S+=1)i.push(F[S])}return i},xo.prototype.getPaintVertexBuffers=function(){return this._buffers},xo.prototype.getUniforms=function(i,l){var _=[];for(var S in this.binders){var F=this.binders[S];if(F instanceof Wi||F instanceof Ko||F instanceof mo)for(var j=0,p=F.uniformNames;j<p.length;j+=1){var v=p[j];if(l[v]){var m=F.getBinding(i,l[v],v);_.push({name:v,property:S,binding:m})}}}return _},xo.prototype.setUniforms=function(i,l,_,S){for(var F=0,j=l;F<j.length;F+=1){var p=j[F],v=p.name,m=p.property;this.binders[m].setUniform(p.binding,S,_.get(m),v)}},xo.prototype.updatePaintBuffers=function(i){for(var l in this._buffers=[],this.binders){var _=this.binders[l];if(i&&_ instanceof ko){var S=i.fromScale===2?_.zoomInPaintVertexBuffer:_.zoomOutPaintVertexBuffer;S&&this._buffers.push(S)}else(_ instanceof Mo||_ instanceof mo)&&_.paintVertexBuffer&&this._buffers.push(_.paintVertexBuffer)}},xo.prototype.upload=function(i){for(var l in this.binders){var _=this.binders[l];(_ instanceof Mo||_ instanceof mo||_ instanceof ko)&&_.upload(i)}this.updatePaintBuffers()},xo.prototype.destroy=function(){for(var i in this.binders){var l=this.binders[i];(l instanceof Mo||l instanceof mo||l instanceof ko)&&l.destroy()}};var qi=function(i,l,_){_===void 0&&(_=function(){return!0}),this.programConfigurations={};for(var S=0,F=i;S<F.length;S+=1){var j=F[S];this.programConfigurations[j.id]=new xo(j,l,_)}this.needsUpload=!1,this._featureMap=new Ut,this._bufferOffset=0};function xs(i,l){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(l+"-","").replace(/-/g,"_")]}function gs(i,l,_){var S={color:{source:zh,composite:_e},number:{source:k,composite:zh}},F=function(j){return{"line-pattern":{source:Su,composite:Su},"fill-pattern":{source:Su,composite:Su},"fill-extrusion-pattern":{source:Su,composite:Su}}[j]}(i);return F&&F[_]||S[l][_]}qi.prototype.populatePaintArrays=function(i,l,_,S,F,j){for(var p in this.programConfigurations)this.programConfigurations[p].populatePaintArrays(i,l,S,F,j);l.id!==void 0&&this._featureMap.add(l.id,_,this._bufferOffset,i),this._bufferOffset=i,this.needsUpload=!0},qi.prototype.updatePaintArrays=function(i,l,_,S){for(var F=0,j=_;F<j.length;F+=1){var p=j[F];this.needsUpload=this.programConfigurations[p.id].updatePaintArrays(i,this._featureMap,l,p,S)||this.needsUpload}},qi.prototype.get=function(i){return this.programConfigurations[i]},qi.prototype.upload=function(i){if(this.needsUpload){for(var l in this.programConfigurations)this.programConfigurations[l].upload(i);this.needsUpload=!1}},qi.prototype.destroy=function(){for(var i in this.programConfigurations)this.programConfigurations[i].destroy()},fi("ConstantBinder",Wi),fi("CrossFadedConstantBinder",Ko),fi("SourceExpressionBinder",Mo),fi("CrossFadedCompositeBinder",ko),fi("CompositeExpressionBinder",mo),fi("ProgramConfiguration",xo,{omit:["_buffers"]}),fi("ProgramConfigurationSet",qi);var Cl=Math.pow(2,14)-1,ts=-Cl-1;function ja(i){for(var l=8192/i.extent,_=i.loadGeometry(),S=0;S<_.length;S++)for(var F=_[S],j=0;j<F.length;j++){var p=F[j],v=Math.round(p.x*l),m=Math.round(p.y*l);p.x=Ve(v,ts,Cl),p.y=Ve(m,ts,Cl),(v<p.x||v>p.x+1||m<p.y||m>p.y+1)&&gr("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return _}function $a(i,l){return{type:i.type,id:i.id,properties:i.properties,geometry:l?ja(i):[]}}function vs(i,l,_,S,F){i.emplaceBack(2*l+(S+1)/2,2*_+(F+1)/2)}var Zl=function(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(function(l){return l.id}),this.index=i.index,this.hasPattern=!1,this.layoutVertexArray=new ks,this.indexArray=new s,this.segments=new Ie,this.programConfigurations=new qi(i.layers,i.zoom),this.stateDependentLayerIds=this.layers.filter(function(l){return l.isStateDependent()}).map(function(l){return l.id})};function zu(i,l){for(var _=0;_<i.length;_++)if(Vl(l,i[_]))return!0;for(var S=0;S<l.length;S++)if(Vl(i,l[S]))return!0;return!!np(i,l)}function Uu(i,l,_){return!!Vl(i,l)||!!Tu(l,i,_)}function hh(i,l){if(i.length===1)return Dl(l,i[0]);for(var _=0;_<l.length;_++)for(var S=l[_],F=0;F<S.length;F++)if(Vl(i,S[F]))return!0;for(var j=0;j<i.length;j++)if(Dl(l,i[j]))return!0;for(var p=0;p<l.length;p++)if(np(i,l[p]))return!0;return!1}function Yc(i,l,_){if(i.length>1){if(np(i,l))return!0;for(var S=0;S<l.length;S++)if(Tu(l[S],i,_))return!0}for(var F=0;F<i.length;F++)if(Tu(i[F],l,_))return!0;return!1}function np(i,l){if(i.length===0||l.length===0)return!1;for(var _=0;_<i.length-1;_++)for(var S=i[_],F=i[_+1],j=0;j<l.length-1;j++)if(pu(S,F,l[j],l[j+1]))return!0;return!1}function pu(i,l,_,S){return rn(i,_,S)!==rn(l,_,S)&&rn(i,l,_)!==rn(i,l,S)}function Tu(i,l,_){var S=_*_;if(l.length===1)return i.distSqr(l[0])<S;for(var F=1;F<l.length;F++)if(Zu(i,l[F-1],l[F])<S)return!0;return!1}function Zu(i,l,_){var S=l.distSqr(_);if(S===0)return i.distSqr(l);var F=((i.x-l.x)*(_.x-l.x)+(i.y-l.y)*(_.y-l.y))/S;return i.distSqr(F<0?l:F>1?_:_.sub(l)._mult(F)._add(l))}function Dl(i,l){for(var _,S,F,j=!1,p=0;p<i.length;p++)for(var v=0,m=(_=i[p]).length-1;v<_.length;m=v++)(S=_[v]).y>l.y!=(F=_[m]).y>l.y&&l.x<(F.x-S.x)*(l.y-S.y)/(F.y-S.y)+S.x&&(j=!j);return j}function Vl(i,l){for(var _=!1,S=0,F=i.length-1;S<i.length;F=S++){var j=i[S],p=i[F];j.y>l.y!=p.y>l.y&&l.x<(p.x-j.x)*(l.y-j.y)/(p.y-j.y)+j.x&&(_=!_)}return _}function Uh(i,l,_){var S=_[0],F=_[2];if(i.x<S.x&&l.x<S.x||i.x>F.x&&l.x>F.x||i.y<S.y&&l.y<S.y||i.y>F.y&&l.y>F.y)return!1;var j=rn(i,l,_[0]);return j!==rn(i,l,_[1])||j!==rn(i,l,_[2])||j!==rn(i,l,_[3])}function ml(i,l,_){var S=l.paint.get(i).value;return S.kind==="constant"?S.value:_.programConfigurations.get(l.id).getMaxValue(i)}function $l(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function Vu(i,l,_,S,F){if(!l[0]&&!l[1])return i;var j=Le.convert(l)._mult(F);_==="viewport"&&j._rotate(-S);for(var p=[],v=0;v<i.length;v++)p.push(i[v].sub(j));return p}Zl.prototype.populate=function(i,l,_){var S=this.layers[0],F=[],j=null;S.type==="circle"&&(j=S.layout.get("circle-sort-key"));for(var p=0,v=i;p<v.length;p+=1){var m=v[p],w=m.feature,D=m.id,N=m.index,W=m.sourceLayerIndex,$=this.layers[0]._featureFilter.needGeometry,ie=$a(w,$);if(this.layers[0]._featureFilter.filter(new fa(this.zoom),ie,_)){var pe=j?j.evaluate(ie,{},_):void 0,we={id:D,properties:w.properties,type:w.type,sourceLayerIndex:W,index:N,geometry:$?ie.geometry:ja(w),patterns:{},sortKey:pe};F.push(we)}}j&&F.sort(function(kt,ft){return kt.sortKey-ft.sortKey});for(var ke=0,Ge=F;ke<Ge.length;ke+=1){var ht=Ge[ke],mt=ht.geometry,St=ht.index,xt=ht.sourceLayerIndex,bt=i[St].feature;this.addFeature(ht,mt,St,_),l.featureIndex.insert(bt,mt,St,xt,this.index)}},Zl.prototype.update=function(i,l,_){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,l,this.stateDependentLayers,_)},Zl.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Zl.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Zl.prototype.upload=function(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,Te),this.indexBuffer=i.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(i),this.uploaded=!0},Zl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Zl.prototype.addFeature=function(i,l,_,S){for(var F=0,j=l;F<j.length;F+=1)for(var p=0,v=j[F];p<v.length;p+=1){var m=v[p],w=m.x,D=m.y;if(!(w<0||w>=8192||D<0||D>=8192)){var N=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,i.sortKey),W=N.vertexLength;vs(this.layoutVertexArray,w,D,-1,-1),vs(this.layoutVertexArray,w,D,1,-1),vs(this.layoutVertexArray,w,D,1,1),vs(this.layoutVertexArray,w,D,-1,1),this.indexArray.emplaceBack(W,W+1,W+2),this.indexArray.emplaceBack(W,W+3,W+2),N.vertexLength+=4,N.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,_,{},S)},fi("CircleBucket",Zl,{omit:["layers"]});var Ws=new Gs({"circle-sort-key":new Si(Ae.layout_circle["circle-sort-key"])}),ju={paint:new Gs({"circle-radius":new Si(Ae.paint_circle["circle-radius"]),"circle-color":new Si(Ae.paint_circle["circle-color"]),"circle-blur":new Si(Ae.paint_circle["circle-blur"]),"circle-opacity":new Si(Ae.paint_circle["circle-opacity"]),"circle-translate":new Gi(Ae.paint_circle["circle-translate"]),"circle-translate-anchor":new Gi(Ae.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Gi(Ae.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Gi(Ae.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Si(Ae.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Si(Ae.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Si(Ae.paint_circle["circle-stroke-opacity"])}),layout:Ws},os=typeof Float32Array!="undefined"?Float32Array:Array;function yl(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function Ol(i,l,_){var S=l[0],F=l[1],j=l[2],p=l[3],v=l[4],m=l[5],w=l[6],D=l[7],N=l[8],W=l[9],$=l[10],ie=l[11],pe=l[12],we=l[13],ke=l[14],Ge=l[15],ht=_[0],mt=_[1],St=_[2],xt=_[3];return i[0]=ht*S+mt*v+St*N+xt*pe,i[1]=ht*F+mt*m+St*W+xt*we,i[2]=ht*j+mt*w+St*$+xt*ke,i[3]=ht*p+mt*D+St*ie+xt*Ge,i[4]=(ht=_[4])*S+(mt=_[5])*v+(St=_[6])*N+(xt=_[7])*pe,i[5]=ht*F+mt*m+St*W+xt*we,i[6]=ht*j+mt*w+St*$+xt*ke,i[7]=ht*p+mt*D+St*ie+xt*Ge,i[8]=(ht=_[8])*S+(mt=_[9])*v+(St=_[10])*N+(xt=_[11])*pe,i[9]=ht*F+mt*m+St*W+xt*we,i[10]=ht*j+mt*w+St*$+xt*ke,i[11]=ht*p+mt*D+St*ie+xt*Ge,i[12]=(ht=_[12])*S+(mt=_[13])*v+(St=_[14])*N+(xt=_[15])*pe,i[13]=ht*F+mt*m+St*W+xt*we,i[14]=ht*j+mt*w+St*$+xt*ke,i[15]=ht*p+mt*D+St*ie+xt*Ge,i}Math.hypot||(Math.hypot=function(){for(var i=arguments,l=0,_=arguments.length;_--;)l+=i[_]*i[_];return Math.sqrt(l)});var ph,_f=Ol;function ip(i,l,_){var S=l[0],F=l[1],j=l[2],p=l[3];return i[0]=_[0]*S+_[4]*F+_[8]*j+_[12]*p,i[1]=_[1]*S+_[5]*F+_[9]*j+_[13]*p,i[2]=_[2]*S+_[6]*F+_[10]*j+_[14]*p,i[3]=_[3]*S+_[7]*F+_[11]*j+_[15]*p,i}ph=new os(3),os!=Float32Array&&(ph[0]=0,ph[1]=0,ph[2]=0),function(){var i=new os(4);os!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0,i[3]=0)}();var yf=(function(){var i=new os(2);os!=Float32Array&&(i[0]=0,i[1]=0)}(),function(i){function l(_){i.call(this,_,ju)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.createBucket=function(_){return new Zl(_)},l.prototype.queryRadius=function(_){var S=_;return ml("circle-radius",this,S)+ml("circle-stroke-width",this,S)+$l(this.paint.get("circle-translate"))},l.prototype.queryIntersectsFeature=function(_,S,F,j,p,v,m,w){for(var D=Vu(_,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),v.angle,m),N=this.paint.get("circle-radius").evaluate(S,F)+this.paint.get("circle-stroke-width").evaluate(S,F),W=this.paint.get("circle-pitch-alignment")==="map",$=W?D:function(bt,kt){return bt.map(function(ft){return Hu(ft,kt)})}(D,w),ie=W?N*m:N,pe=0,we=j;pe<we.length;pe+=1)for(var ke=0,Ge=we[pe];ke<Ge.length;ke+=1){var ht=Ge[ke],mt=W?ht:Hu(ht,w),St=ie,xt=ip([],[ht.x,ht.y,0,1],w);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?St*=xt[3]/v.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(St*=v.cameraToCenterDistance/xt[3]),Uu($,mt,St))return!0}return!1},l}(Lc));function Hu(i,l){var _=ip([],[i.x,i.y,0,1],l);return new Le(_[0]/_[3],_[1]/_[3])}var Bp=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l}(Zl);function fc(i,l,_,S){var F=l.width,j=l.height;if(S){if(S instanceof Uint8ClampedArray)S=new Uint8Array(S.buffer);else if(S.length!==F*j*_)throw new RangeError("mismatched image size")}else S=new Uint8Array(F*j*_);return i.width=F,i.height=j,i.data=S,i}function Wf(i,l,_){var S=l.width,F=l.height;if(S!==i.width||F!==i.height){var j=fc({},{width:S,height:F},_);op(i,j,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,S),height:Math.min(i.height,F)},_),i.width=S,i.height=F,i.data=j.data}}function op(i,l,_,S,F,j){if(F.width===0||F.height===0)return l;if(F.width>i.width||F.height>i.height||_.x>i.width-F.width||_.y>i.height-F.height)throw new RangeError("out of range source coordinates for image copy");if(F.width>l.width||F.height>l.height||S.x>l.width-F.width||S.y>l.height-F.height)throw new RangeError("out of range destination coordinates for image copy");for(var p=i.data,v=l.data,m=0;m<F.height;m++)for(var w=((_.y+m)*i.width+_.x)*j,D=((S.y+m)*l.width+S.x)*j,N=0;N<F.width*j;N++)v[D+N]=p[w+N];return l}fi("HeatmapBucket",Bp,{omit:["layers"]});var ef=function(i,l){fc(this,i,1,l)};ef.prototype.resize=function(i){Wf(this,i,1)},ef.prototype.clone=function(){return new ef({width:this.width,height:this.height},new Uint8Array(this.data))},ef.copy=function(i,l,_,S,F){op(i,l,_,S,F,1)};var _s=function(i,l){fc(this,i,4,l)};_s.prototype.resize=function(i){Wf(this,i,4)},_s.prototype.replace=function(i,l){l?this.data.set(i):this.data=i instanceof Uint8ClampedArray?new Uint8Array(i.buffer):i},_s.prototype.clone=function(){return new _s({width:this.width,height:this.height},new Uint8Array(this.data))},_s.copy=function(i,l,_,S,F){op(i,l,_,S,F,4)},fi("AlphaImage",ef),fi("RGBAImage",_s);var Ff={paint:new Gs({"heatmap-radius":new Si(Ae.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Si(Ae.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Gi(Ae.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Ic(Ae.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Gi(Ae.paint_heatmap["heatmap-opacity"])})};function sd(i){var l={},_=i.resolution||256,S=i.clips?i.clips.length:1,F=i.image||new _s({width:_,height:S}),j=function(ie,pe,we){l[i.evaluationKey]=we;var ke=i.expression.evaluate(l);F.data[ie+pe+0]=Math.floor(255*ke.r/ke.a),F.data[ie+pe+1]=Math.floor(255*ke.g/ke.a),F.data[ie+pe+2]=Math.floor(255*ke.b/ke.a),F.data[ie+pe+3]=Math.floor(255*ke.a)};if(i.clips)for(var p=0,v=0;p<S;++p,v+=4*_)for(var m=0,w=0;m<_;m++,w+=4){var D=m/(_-1),N=i.clips[p];j(v,w,N.start*(1-D)+N.end*D)}else for(var W=0,$=0;W<_;W++,$+=4)j(0,$,W/(_-1));return F}var fh=function(i){function l(_){i.call(this,_,Ff),this._updateColorRamp()}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.createBucket=function(_){return new Bp(_)},l.prototype._handleSpecialPaintPropertyUpdate=function(_){_==="heatmap-color"&&this._updateColorRamp()},l.prototype._updateColorRamp=function(){this.colorRamp=sd({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},l.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},l.prototype.queryRadius=function(){return 0},l.prototype.queryIntersectsFeature=function(){return!1},l.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},l}(Lc),_d={paint:new Gs({"hillshade-illumination-direction":new Gi(Ae.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Gi(Ae.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Gi(Ae.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Gi(Ae.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Gi(Ae.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Gi(Ae.paint_hillshade["hillshade-accent-color"])})},ld=function(i){function l(_){i.call(this,_,_d)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},l}(Lc),ym=Al([{name:"a_pos",components:2,type:"Int16"}],4).members,Xf=Gu,tm=Gu;function Gu(i,l,_){_=_||2;var S,F,j,p,v,m,w,D=l&&l.length,N=D?l[0]*_:i.length,W=xf(i,0,N,_,!0),$=[];if(!W||W.next===W.prev)return $;if(D&&(W=function(pe,we,ke,Ge){var ht,mt,St,xt=[];for(ht=0,mt=we.length;ht<mt;ht++)(St=xf(pe,we[ht]*Ge,ht<mt-1?we[ht+1]*Ge:pe.length,Ge,!1))===St.next&&(St.steiner=!0),xt.push($f(St));for(xt.sort(Od),ht=0;ht<xt.length;ht++)Bd(xt[ht],ke),ke=tf(ke,ke.next);return ke}(i,l,W,_)),i.length>80*_){S=j=i[0],F=p=i[1];for(var ie=_;ie<N;ie+=_)(v=i[ie])<S&&(S=v),(m=i[ie+1])<F&&(F=m),v>j&&(j=v),m>p&&(p=m);w=(w=Math.max(j-S,p-F))!==0?1/w:0}return ud(W,$,_,S,F,w),$}function xf(i,l,_,S,F){var j,p;if(F===kp(i,l,_,S)>0)for(j=l;j<_;j+=S)p=zf(j,i[j],i[j+1],p);else for(j=_-S;j>=l;j-=S)p=zf(j,i[j],i[j+1],p);return p&&dc(p,p.next)&&(of(p),p=p.next),p}function tf(i,l){if(!i)return i;l||(l=i);var _,S=i;do if(_=!1,S.steiner||!dc(S,S.next)&&xl(S.prev,S,S.next)!==0)S=S.next;else{if(of(S),(S=l=S.prev)===S.next)break;_=!0}while(_||S!==l);return l}function ud(i,l,_,S,F,j,p){if(i){!p&&j&&function(D,N,W,$){var ie=D;do ie.z===null&&(ie.z=wp(ie.x,ie.y,N,W,$)),ie.prevZ=ie.prev,ie.nextZ=ie.next,ie=ie.next;while(ie!==D);ie.prevZ.nextZ=null,ie.prevZ=null,function(pe){var we,ke,Ge,ht,mt,St,xt,bt,kt=1;do{for(ke=pe,pe=null,mt=null,St=0;ke;){for(St++,Ge=ke,xt=0,we=0;we<kt&&(xt++,Ge=Ge.nextZ);we++);for(bt=kt;xt>0||bt>0&&Ge;)xt!==0&&(bt===0||!Ge||ke.z<=Ge.z)?(ht=ke,ke=ke.nextZ,xt--):(ht=Ge,Ge=Ge.nextZ,bt--),mt?mt.nextZ=ht:pe=ht,ht.prevZ=mt,mt=ht;ke=Ge}mt.nextZ=null,kt*=2}while(St>1)}(ie)}(i,S,F,j);for(var v,m,w=i;i.prev!==i.next;)if(v=i.prev,m=i.next,j?Dd(i,S,F,j):qf(i))l.push(v.i/_),l.push(i.i/_),l.push(m.i/_),of(i),i=m.next,w=m.next;else if((i=m)===w){p?p===1?ud(i=Yf(tf(i),l,_),l,_,S,F,j,2):p===2&&Kl(i,l,_,S,F,j):ud(tf(i),l,_,S,F,j,1);break}}}function qf(i){var l=i.prev,_=i,S=i.next;if(xl(l,_,S)>=0)return!1;for(var F=i.next.next;F!==i.prev;){if(ap(l.x,l.y,_.x,_.y,S.x,S.y,F.x,F.y)&&xl(F.prev,F,F.next)>=0)return!1;F=F.next}return!0}function Dd(i,l,_,S){var F=i.prev,j=i,p=i.next;if(xl(F,j,p)>=0)return!1;for(var v=F.x>j.x?F.x>p.x?F.x:p.x:j.x>p.x?j.x:p.x,m=F.y>j.y?F.y>p.y?F.y:p.y:j.y>p.y?j.y:p.y,w=wp(F.x<j.x?F.x<p.x?F.x:p.x:j.x<p.x?j.x:p.x,F.y<j.y?F.y<p.y?F.y:p.y:j.y<p.y?j.y:p.y,l,_,S),D=wp(v,m,l,_,S),N=i.prevZ,W=i.nextZ;N&&N.z>=w&&W&&W.z<=D;){if(N!==i.prev&&N!==i.next&&ap(F.x,F.y,j.x,j.y,p.x,p.y,N.x,N.y)&&xl(N.prev,N,N.next)>=0||(N=N.prevZ,W!==i.prev&&W!==i.next&&ap(F.x,F.y,j.x,j.y,p.x,p.y,W.x,W.y)&&xl(W.prev,W,W.next)>=0))return!1;W=W.nextZ}for(;N&&N.z>=w;){if(N!==i.prev&&N!==i.next&&ap(F.x,F.y,j.x,j.y,p.x,p.y,N.x,N.y)&&xl(N.prev,N,N.next)>=0)return!1;N=N.prevZ}for(;W&&W.z<=D;){if(W!==i.prev&&W!==i.next&&ap(F.x,F.y,j.x,j.y,p.x,p.y,W.x,W.y)&&xl(W.prev,W,W.next)>=0)return!1;W=W.nextZ}return!0}function Yf(i,l,_){var S=i;do{var F=S.prev,j=S.next.next;!dc(F,j)&&Fp(F,S,S.next,j)&&nf(F,j)&&nf(j,F)&&(l.push(F.i/_),l.push(S.i/_),l.push(j.i/_),of(S),of(S.next),S=i=j),S=S.next}while(S!==i);return tf(S)}function Kl(i,l,_,S,F,j){var p=i;do{for(var v=p.next.next;v!==p.prev;){if(p.i!==v.i&&kf(p,v)){var m=Nf(p,v);return p=tf(p,p.next),m=tf(m,m.next),ud(p,l,_,S,F,j),void ud(m,l,_,S,F,j)}v=v.next}p=p.next}while(p!==i)}function Od(i,l){return i.x-l.x}function Bd(i,l){if(l=function(S,F){var j,p=F,v=S.x,m=S.y,w=-1/0;do{if(m<=p.y&&m>=p.next.y&&p.next.y!==p.y){var D=p.x+(m-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(D<=v&&D>w){if(w=D,D===v){if(m===p.y)return p;if(m===p.next.y)return p.next}j=p.x<p.next.x?p:p.next}}p=p.next}while(p!==F);if(!j)return null;if(v===w)return j;var N,W=j,$=j.x,ie=j.y,pe=1/0;p=j;do v>=p.x&&p.x>=$&&v!==p.x&&ap(m<ie?v:w,m,$,ie,m<ie?w:v,m,p.x,p.y)&&(N=Math.abs(m-p.y)/(v-p.x),nf(p,S)&&(N<pe||N===pe&&(p.x>j.x||p.x===j.x&&bf(j,p)))&&(j=p,pe=N)),p=p.next;while(p!==W);return j}(i,l)){var _=Nf(l,i);tf(l,l.next),tf(_,_.next)}}function bf(i,l){return xl(i.prev,i,l.prev)<0&&xl(l.next,i,i.next)<0}function wp(i,l,_,S,F){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=32767*(i-_)*F)|i<<8))|i<<4))|i<<2))|i<<1))|(l=1431655765&((l=858993459&((l=252645135&((l=16711935&((l=32767*(l-S)*F)|l<<8))|l<<4))|l<<2))|l<<1))<<1}function $f(i){var l=i,_=i;do(l.x<_.x||l.x===_.x&&l.y<_.y)&&(_=l),l=l.next;while(l!==i);return _}function ap(i,l,_,S,F,j,p,v){return(F-p)*(l-v)-(i-p)*(j-v)>=0&&(i-p)*(S-v)-(_-p)*(l-v)>=0&&(_-p)*(j-v)-(F-p)*(S-v)>=0}function kf(i,l){return i.next.i!==l.i&&i.prev.i!==l.i&&!function(_,S){var F=_;do{if(F.i!==_.i&&F.next.i!==_.i&&F.i!==S.i&&F.next.i!==S.i&&Fp(F,F.next,_,S))return!0;F=F.next}while(F!==_);return!1}(i,l)&&(nf(i,l)&&nf(l,i)&&function(_,S){var F=_,j=!1,p=(_.x+S.x)/2,v=(_.y+S.y)/2;do F.y>v!=F.next.y>v&&F.next.y!==F.y&&p<(F.next.x-F.x)*(v-F.y)/(F.next.y-F.y)+F.x&&(j=!j),F=F.next;while(F!==_);return j}(i,l)&&(xl(i.prev,i,l.prev)||xl(i,l.prev,l))||dc(i,l)&&xl(i.prev,i,i.next)>0&&xl(l.prev,l,l.next)>0)}function xl(i,l,_){return(l.y-i.y)*(_.x-l.x)-(l.x-i.x)*(_.y-l.y)}function dc(i,l){return i.x===l.x&&i.y===l.y}function Fp(i,l,_,S){var F=rf(xl(i,l,_)),j=rf(xl(i,l,S)),p=rf(xl(_,S,i)),v=rf(xl(_,S,l));return F!==j&&p!==v||!(F!==0||!Sp(i,_,l))||!(j!==0||!Sp(i,S,l))||!(p!==0||!Sp(_,i,S))||!(v!==0||!Sp(_,l,S))}function Sp(i,l,_){return l.x<=Math.max(i.x,_.x)&&l.x>=Math.min(i.x,_.x)&&l.y<=Math.max(i.y,_.y)&&l.y>=Math.min(i.y,_.y)}function rf(i){return i>0?1:i<0?-1:0}function nf(i,l){return xl(i.prev,i,i.next)<0?xl(i,l,i.next)>=0&&xl(i,i.prev,l)>=0:xl(i,l,i.prev)<0||xl(i,i.next,l)<0}function Nf(i,l){var _=new af(i.i,i.x,i.y),S=new af(l.i,l.x,l.y),F=i.next,j=l.prev;return i.next=l,l.prev=i,_.next=F,F.prev=_,S.next=_,_.prev=S,j.next=S,S.prev=j,S}function zf(i,l,_,S){var F=new af(i,l,_);return S?(F.next=S.next,F.prev=S,S.next.prev=F,S.next=F):(F.prev=F,F.next=F),F}function of(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function af(i,l,_){this.i=i,this.x=l,this.y=_,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function kp(i,l,_,S){for(var F=0,j=l,p=_-S;j<_;j+=S)F+=(i[p]-i[j])*(i[j+1]+i[p+1]),p=j;return F}function yd(i,l,_,S,F){(function j(p,v,m,w,D){for(;w>m;){if(w-m>600){var N=w-m+1,W=v-m+1,$=Math.log(N),ie=.5*Math.exp(2*$/3),pe=.5*Math.sqrt($*ie*(N-ie)/N)*(W-N/2<0?-1:1);j(p,v,Math.max(m,Math.floor(v-W*ie/N+pe)),Math.min(w,Math.floor(v+(N-W)*ie/N+pe)),D)}var we=p[v],ke=m,Ge=w;for(Dc(p,m,v),D(p[w],we)>0&&Dc(p,m,w);ke<Ge;){for(Dc(p,ke,Ge),ke++,Ge--;D(p[ke],we)<0;)ke++;for(;D(p[Ge],we)>0;)Ge--}D(p[m],we)===0?Dc(p,m,Ge):Dc(p,++Ge,w),Ge<=v&&(m=Ge+1),v<=Ge&&(w=Ge-1)}})(i,l,_||0,S||i.length-1,F||_p)}function Dc(i,l,_){var S=i[l];i[l]=i[_],i[_]=S}function _p(i,l){return i<l?-1:i>l?1:0}function Kf(i,l){var _=i.length;if(_<=1)return[i];for(var S,F,j=[],p=0;p<_;p++){var v=jn(i[p]);v!==0&&(i[p].area=Math.abs(v),F===void 0&&(F=v<0),F===v<0?(S&&j.push(S),S=[i[p]]):S.push(i[p]))}if(S&&j.push(S),l>1)for(var m=0;m<j.length;m++)j[m].length<=l||(yd(j[m],l,1,j[m].length-1,xd),j[m]=j[m].slice(0,l));return j}function xd(i,l){return l.area-i.area}function bd(i,l,_){for(var S=_.patternDependencies,F=!1,j=0,p=l;j<p.length;j+=1){var v=p[j].paint.get(i+"-pattern");v.isConstant()||(F=!0);var m=v.constantOr(null);m&&(F=!0,S[m.to]=!0,S[m.from]=!0)}return F}function Ed(i,l,_,S,F){for(var j=F.patternDependencies,p=0,v=l;p<v.length;p+=1){var m=v[p],w=m.paint.get(i+"-pattern").value;if(w.kind!=="constant"){var D=w.evaluate({zoom:S-1},_,{},F.availableImages),N=w.evaluate({zoom:S},_,{},F.availableImages),W=w.evaluate({zoom:S+1},_,{},F.availableImages);N=N&&N.name?N.name:N,W=W&&W.name?W.name:W,j[D=D&&D.name?D.name:D]=!0,j[N]=!0,j[W]=!0,_.patterns[m.id]={min:D,mid:N,max:W}}}return _}Gu.deviation=function(i,l,_,S){var F=l&&l.length,j=Math.abs(kp(i,0,F?l[0]*_:i.length,_));if(F)for(var p=0,v=l.length;p<v;p++)j-=Math.abs(kp(i,l[p]*_,p<v-1?l[p+1]*_:i.length,_));var m=0;for(p=0;p<S.length;p+=3){var w=S[p]*_,D=S[p+1]*_,N=S[p+2]*_;m+=Math.abs((i[w]-i[N])*(i[D+1]-i[w+1])-(i[w]-i[D])*(i[N+1]-i[w+1]))}return j===0&&m===0?0:Math.abs((m-j)/j)},Gu.flatten=function(i){for(var l=i[0][0].length,_={vertices:[],holes:[],dimensions:l},S=0,F=0;F<i.length;F++){for(var j=0;j<i[F].length;j++)for(var p=0;p<l;p++)_.vertices.push(i[F][j][p]);F>0&&_.holes.push(S+=i[F-1].length)}return _},Xf.default=tm;var Tp=function(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(function(l){return l.id}),this.index=i.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ks,this.indexArray=new s,this.indexArray2=new ne,this.programConfigurations=new qi(i.layers,i.zoom),this.segments=new Ie,this.segments2=new Ie,this.stateDependentLayerIds=this.layers.filter(function(l){return l.isStateDependent()}).map(function(l){return l.id})};Tp.prototype.populate=function(i,l,_){this.hasPattern=bd("fill",this.layers,l);for(var S=this.layers[0].layout.get("fill-sort-key"),F=[],j=0,p=i;j<p.length;j+=1){var v=p[j],m=v.feature,w=v.id,D=v.index,N=v.sourceLayerIndex,W=this.layers[0]._featureFilter.needGeometry,$=$a(m,W);if(this.layers[0]._featureFilter.filter(new fa(this.zoom),$,_)){var ie=S?S.evaluate($,{},_,l.availableImages):void 0,pe={id:w,properties:m.properties,type:m.type,sourceLayerIndex:N,index:D,geometry:W?$.geometry:ja(m),patterns:{},sortKey:ie};F.push(pe)}}S&&F.sort(function(bt,kt){return bt.sortKey-kt.sortKey});for(var we=0,ke=F;we<ke.length;we+=1){var Ge=ke[we],ht=Ge.geometry,mt=Ge.index,St=Ge.sourceLayerIndex;if(this.hasPattern){var xt=Ed("fill",this.layers,Ge,this.zoom,l);this.patternFeatures.push(xt)}else this.addFeature(Ge,ht,mt,_,{});l.featureIndex.insert(i[mt].feature,ht,mt,St,this.index)}},Tp.prototype.update=function(i,l,_){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,l,this.stateDependentLayers,_)},Tp.prototype.addFeatures=function(i,l,_){for(var S=0,F=this.patternFeatures;S<F.length;S+=1){var j=F[S];this.addFeature(j,j.geometry,j.index,l,_)}},Tp.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Tp.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Tp.prototype.upload=function(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,ym),this.indexBuffer=i.createIndexBuffer(this.indexArray),this.indexBuffer2=i.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(i),this.uploaded=!0},Tp.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Tp.prototype.addFeature=function(i,l,_,S,F){for(var j=0,p=Kf(l,500);j<p.length;j+=1){for(var v=p[j],m=0,w=0,D=v;w<D.length;w+=1)m+=D[w].length;for(var N=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray),W=N.vertexLength,$=[],ie=[],pe=0,we=v;pe<we.length;pe+=1){var ke=we[pe];if(ke.length!==0){ke!==v[0]&&ie.push($.length/2);var Ge=this.segments2.prepareSegment(ke.length,this.layoutVertexArray,this.indexArray2),ht=Ge.vertexLength;this.layoutVertexArray.emplaceBack(ke[0].x,ke[0].y),this.indexArray2.emplaceBack(ht+ke.length-1,ht),$.push(ke[0].x),$.push(ke[0].y);for(var mt=1;mt<ke.length;mt++)this.layoutVertexArray.emplaceBack(ke[mt].x,ke[mt].y),this.indexArray2.emplaceBack(ht+mt-1,ht+mt),$.push(ke[mt].x),$.push(ke[mt].y);Ge.vertexLength+=ke.length,Ge.primitiveLength+=ke.length}}for(var St=Xf($,ie),xt=0;xt<St.length;xt+=3)this.indexArray.emplaceBack(W+St[xt],W+St[xt+1],W+St[xt+2]);N.vertexLength+=m,N.primitiveLength+=St.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,_,F,S)},fi("FillBucket",Tp,{omit:["layers","patternFeatures"]});var Ef=new Gs({"fill-sort-key":new Si(Ae.layout_fill["fill-sort-key"])}),wd={paint:new Gs({"fill-antialias":new Gi(Ae.paint_fill["fill-antialias"]),"fill-opacity":new Si(Ae.paint_fill["fill-opacity"]),"fill-color":new Si(Ae.paint_fill["fill-color"]),"fill-outline-color":new Si(Ae.paint_fill["fill-outline-color"]),"fill-translate":new Gi(Ae.paint_fill["fill-translate"]),"fill-translate-anchor":new Gi(Ae.paint_fill["fill-translate-anchor"]),"fill-pattern":new ji(Ae.paint_fill["fill-pattern"])}),layout:Ef},cd=function(i){function l(_){i.call(this,_,wd)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.recalculate=function(_,S){i.prototype.recalculate.call(this,_,S);var F=this.paint._values["fill-outline-color"];F.value.kind==="constant"&&F.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},l.prototype.createBucket=function(_){return new Tp(_)},l.prototype.queryRadius=function(){return $l(this.paint.get("fill-translate"))},l.prototype.queryIntersectsFeature=function(_,S,F,j,p,v,m){return hh(Vu(_,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),v.angle,m),j)},l.prototype.isTileClipped=function(){return!0},l}(Lc),hd=Al([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Uf=sf;function sf(i,l,_,S,F){this.properties={},this.extent=_,this.type=0,this._pbf=i,this._geometry=-1,this._keys=S,this._values=F,i.readFields(Ou,this,l)}function Ou(i,l,_){i==1?l.id=_.readVarint():i==2?function(S,F){for(var j=S.readVarint()+S.pos;S.pos<j;){var p=F._keys[S.readVarint()],v=F._values[S.readVarint()];F.properties[p]=v}}(_,l):i==3?l.type=_.readVarint():i==4&&(l._geometry=_.pos)}function Zh(i){for(var l,_,S=0,F=0,j=i.length,p=j-1;F<j;p=F++)S+=((_=i[p]).x-(l=i[F]).x)*(l.y+_.y);return S}sf.types=["Unknown","Point","LineString","Polygon"],sf.prototype.loadGeometry=function(){var i=this._pbf;i.pos=this._geometry;for(var l,_=i.readVarint()+i.pos,S=1,F=0,j=0,p=0,v=[];i.pos<_;){if(F<=0){var m=i.readVarint();S=7&m,F=m>>3}if(F--,S===1||S===2)j+=i.readSVarint(),p+=i.readSVarint(),S===1&&(l&&v.push(l),l=[]),l.push(new Le(j,p));else{if(S!==7)throw new Error("unknown command "+S);l&&l.push(l[0].clone())}}return l&&v.push(l),v},sf.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var l=i.readVarint()+i.pos,_=1,S=0,F=0,j=0,p=1/0,v=-1/0,m=1/0,w=-1/0;i.pos<l;){if(S<=0){var D=i.readVarint();_=7&D,S=D>>3}if(S--,_===1||_===2)(F+=i.readSVarint())<p&&(p=F),F>v&&(v=F),(j+=i.readSVarint())<m&&(m=j),j>w&&(w=j);else if(_!==7)throw new Error("unknown command "+_)}return[p,m,v,w]},sf.prototype.toGeoJSON=function(i,l,_){var S,F,j=this.extent*Math.pow(2,_),p=this.extent*i,v=this.extent*l,m=this.loadGeometry(),w=sf.types[this.type];function D($){for(var ie=0;ie<$.length;ie++){var pe=$[ie];$[ie]=[360*(pe.x+p)/j-180,360/Math.PI*Math.atan(Math.exp((180-360*(pe.y+v)/j)*Math.PI/180))-90]}}switch(this.type){case 1:var N=[];for(S=0;S<m.length;S++)N[S]=m[S][0];D(m=N);break;case 2:for(S=0;S<m.length;S++)D(m[S]);break;case 3:for(m=function($){var ie=$.length;if(ie<=1)return[$];for(var pe,we,ke=[],Ge=0;Ge<ie;Ge++){var ht=Zh($[Ge]);ht!==0&&(we===void 0&&(we=ht<0),we===ht<0?(pe&&ke.push(pe),pe=[$[Ge]]):pe.push($[Ge]))}return pe&&ke.push(pe),ke}(m),S=0;S<m.length;S++)for(F=0;F<m[S].length;F++)D(m[S][F])}m.length===1?m=m[0]:w="Multi"+w;var W={type:"Feature",geometry:{type:w,coordinates:m},properties:this.properties};return"id"in this&&(W.id=this.id),W};var lf=Ah;function Ah(i,l){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=i,this._keys=[],this._values=[],this._features=[],i.readFields(Np,this,l),this.length=this._features.length}function Np(i,l,_){i===15?l.version=_.readVarint():i===1?l.name=_.readString():i===5?l.extent=_.readVarint():i===2?l._features.push(_.pos):i===3?l._keys.push(_.readString()):i===4&&l._values.push(function(S){for(var F=null,j=S.readVarint()+S.pos;S.pos<j;){var p=S.readVarint()>>3;F=p===1?S.readString():p===2?S.readFloat():p===3?S.readDouble():p===4?S.readVarint64():p===5?S.readVarint():p===6?S.readSVarint():p===7?S.readBoolean():null}return F}(_))}function pd(i,l,_){if(i===3){var S=new lf(_,_.readVarint()+_.pos);S.length&&(l[S.name]=S)}}Ah.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var l=this._pbf.readVarint()+this._pbf.pos;return new Uf(this._pbf,l,this.extent,this._keys,this._values)};var yp={VectorTile:function(i,l){this.layers=i.readFields(pd,{},l)},VectorTileFeature:Uf,VectorTileLayer:lf},Zf=yp.VectorTileFeature.types,zp=Math.pow(2,13);function Oc(i,l,_,S,F,j,p,v){i.emplaceBack(l,_,2*Math.floor(S*zp)+p,F*zp*2,j*zp*2,Math.round(v))}var Wu=function(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(function(l){return l.id}),this.index=i.index,this.hasPattern=!1,this.layoutVertexArray=new pc,this.indexArray=new s,this.programConfigurations=new qi(i.layers,i.zoom),this.segments=new Ie,this.stateDependentLayerIds=this.layers.filter(function(l){return l.isStateDependent()}).map(function(l){return l.id})};function Au(i,l){return i.x===l.x&&(i.x<0||i.x>8192)||i.y===l.y&&(i.y<0||i.y>8192)}Wu.prototype.populate=function(i,l,_){this.features=[],this.hasPattern=bd("fill-extrusion",this.layers,l);for(var S=0,F=i;S<F.length;S+=1){var j=F[S],p=j.feature,v=j.id,m=j.index,w=j.sourceLayerIndex,D=this.layers[0]._featureFilter.needGeometry,N=$a(p,D);if(this.layers[0]._featureFilter.filter(new fa(this.zoom),N,_)){var W={id:v,sourceLayerIndex:w,index:m,geometry:D?N.geometry:ja(p),properties:p.properties,type:p.type,patterns:{}};this.hasPattern?this.features.push(Ed("fill-extrusion",this.layers,W,this.zoom,l)):this.addFeature(W,W.geometry,m,_,{}),l.featureIndex.insert(p,W.geometry,m,w,this.index,!0)}}},Wu.prototype.addFeatures=function(i,l,_){for(var S=0,F=this.features;S<F.length;S+=1){var j=F[S];this.addFeature(j,j.geometry,j.index,l,_)}},Wu.prototype.update=function(i,l,_){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,l,this.stateDependentLayers,_)},Wu.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Wu.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Wu.prototype.upload=function(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,hd),this.indexBuffer=i.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(i),this.uploaded=!0},Wu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Wu.prototype.addFeature=function(i,l,_,S,F){for(var j=0,p=Kf(l,500);j<p.length;j+=1){for(var v=p[j],m=0,w=0,D=v;w<D.length;w+=1)m+=D[w].length;for(var N=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),W=0,$=v;W<$.length;W+=1){var ie=$[W];if(ie.length!==0&&!((Ai=ie).every(function($n){return $n.x<0})||Ai.every(function($n){return $n.x>8192})||Ai.every(function($n){return $n.y<0})||Ai.every(function($n){return $n.y>8192})))for(var pe=0,we=0;we<ie.length;we++){var ke=ie[we];if(we>=1){var Ge=ie[we-1];if(!Au(ke,Ge)){N.vertexLength+4>Ie.MAX_VERTEX_ARRAY_LENGTH&&(N=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var ht=ke.sub(Ge)._perp()._unit(),mt=Ge.dist(ke);pe+mt>32768&&(pe=0),Oc(this.layoutVertexArray,ke.x,ke.y,ht.x,ht.y,0,0,pe),Oc(this.layoutVertexArray,ke.x,ke.y,ht.x,ht.y,0,1,pe),Oc(this.layoutVertexArray,Ge.x,Ge.y,ht.x,ht.y,0,0,pe+=mt),Oc(this.layoutVertexArray,Ge.x,Ge.y,ht.x,ht.y,0,1,pe);var St=N.vertexLength;this.indexArray.emplaceBack(St,St+2,St+1),this.indexArray.emplaceBack(St+1,St+2,St+3),N.vertexLength+=4,N.primitiveLength+=2}}}}if(N.vertexLength+m>Ie.MAX_VERTEX_ARRAY_LENGTH&&(N=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray)),Zf[i.type]==="Polygon"){for(var xt=[],bt=[],kt=N.vertexLength,ft=0,nr=v;ft<nr.length;ft+=1){var br=nr[ft];if(br.length!==0){br!==v[0]&&bt.push(xt.length/2);for(var Pr=0;Pr<br.length;Pr++){var Mn=br[Pr];Oc(this.layoutVertexArray,Mn.x,Mn.y,0,0,1,1,0),xt.push(Mn.x),xt.push(Mn.y)}}}for(var yn=Xf(xt,bt),kr=0;kr<yn.length;kr+=3)this.indexArray.emplaceBack(kt+yn[kr],kt+yn[kr+2],kt+yn[kr+1]);N.primitiveLength+=yn.length/3,N.vertexLength+=m}}var Ai;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,_,F,S)},fi("FillExtrusionBucket",Wu,{omit:["layers","features"]});var dh={paint:new Gs({"fill-extrusion-opacity":new Gi(Ae["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Si(Ae["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Gi(Ae["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Gi(Ae["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ji(Ae["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Si(Ae["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Si(Ae["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Gi(Ae["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},rm=function(i){function l(_){i.call(this,_,dh)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.createBucket=function(_){return new Wu(_)},l.prototype.queryRadius=function(){return $l(this.paint.get("fill-extrusion-translate"))},l.prototype.is3D=function(){return!0},l.prototype.queryIntersectsFeature=function(_,S,F,j,p,v,m,w){var D=Vu(_,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),v.angle,m),N=this.paint.get("fill-extrusion-height").evaluate(S,F),W=this.paint.get("fill-extrusion-base").evaluate(S,F),$=function(pe,we,ke,Ge){for(var ht=[],mt=0,St=pe;mt<St.length;mt+=1){var xt=St[mt],bt=[xt.x,xt.y,0,1];ip(bt,bt,we),ht.push(new Le(bt[0]/bt[3],bt[1]/bt[3]))}return ht}(D,w),ie=function(pe,we,ke,Ge){for(var ht=[],mt=[],St=Ge[8]*we,xt=Ge[9]*we,bt=Ge[10]*we,kt=Ge[11]*we,ft=Ge[8]*ke,nr=Ge[9]*ke,br=Ge[10]*ke,Pr=Ge[11]*ke,Mn=0,yn=pe;Mn<yn.length;Mn+=1){for(var kr=[],Ai=[],$n=0,ti=yn[Mn];$n<ti.length;$n+=1){var ri=ti[$n],hn=ri.x,An=ri.y,Yi=Ge[0]*hn+Ge[4]*An+Ge[12],Ci=Ge[1]*hn+Ge[5]*An+Ge[13],fo=Ge[2]*hn+Ge[6]*An+Ge[14],Go=Ge[3]*hn+Ge[7]*An+Ge[15],hi=fo+bt,zi=Go+kt,Vo=Yi+ft,Ka=Ci+nr,ta=fo+br,ka=Go+Pr,ca=new Le((Yi+St)/zi,(Ci+xt)/zi);ca.z=hi/zi,kr.push(ca);var Eo=new Le(Vo/ka,Ka/ka);Eo.z=ta/ka,Ai.push(Eo)}ht.push(kr),mt.push(Ai)}return[ht,mt]}(j,W,N,w);return function(pe,we,ke){var Ge=1/0;hh(ke,we)&&(Ge=nm(ke,we[0]));for(var ht=0;ht<we.length;ht++)for(var mt=we[ht],St=pe[ht],xt=0;xt<mt.length-1;xt++){var bt=mt[xt],kt=[bt,mt[xt+1],St[xt+1],St[xt],bt];zu(ke,kt)&&(Ge=Math.min(Ge,nm(ke,kt)))}return Ge!==1/0&&Ge}(ie[0],ie[1],$)},l}(Lc);function Ap(i,l){return i.x*l.x+i.y*l.y}function nm(i,l){if(i.length===1){for(var _,S=0,F=l[S++];!_||F.equals(_);)if(!(_=l[S++]))return 1/0;for(;S<l.length;S++){var j=l[S],p=i[0],v=_.sub(F),m=j.sub(F),w=p.sub(F),D=Ap(v,v),N=Ap(v,m),W=Ap(m,m),$=Ap(w,v),ie=Ap(w,m),pe=D*W-N*N,we=(W*$-N*ie)/pe,ke=(D*ie-N*$)/pe,Ge=F.z*(1-we-ke)+_.z*we+j.z*ke;if(isFinite(Ge))return Ge}return 1/0}for(var ht=1/0,mt=0,St=l;mt<St.length;mt+=1)ht=Math.min(ht,St[mt].z);return ht}var Fd=Al([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,xm=Al([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,Jf=yp.VectorTileFeature.types,kd=Math.cos(Math.PI/180*37.5),fd=Math.pow(2,14)/.5,Bc=function(i){var l=this;this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(function(_){return _.id}),this.index=i.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(_){l.gradients[_.id]={}}),this.layoutVertexArray=new Du,this.layoutVertexArray2=new zh,this.indexArray=new s,this.programConfigurations=new qi(i.layers,i.zoom),this.segments=new Ie,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(_){return _.isStateDependent()}).map(function(_){return _.id})};Bc.prototype.populate=function(i,l,_){this.hasPattern=bd("line",this.layers,l);for(var S=this.layers[0].layout.get("line-sort-key"),F=[],j=0,p=i;j<p.length;j+=1){var v=p[j],m=v.feature,w=v.id,D=v.index,N=v.sourceLayerIndex,W=this.layers[0]._featureFilter.needGeometry,$=$a(m,W);if(this.layers[0]._featureFilter.filter(new fa(this.zoom),$,_)){var ie=S?S.evaluate($,{},_):void 0,pe={id:w,properties:m.properties,type:m.type,sourceLayerIndex:N,index:D,geometry:W?$.geometry:ja(m),patterns:{},sortKey:ie};F.push(pe)}}S&&F.sort(function(bt,kt){return bt.sortKey-kt.sortKey});for(var we=0,ke=F;we<ke.length;we+=1){var Ge=ke[we],ht=Ge.geometry,mt=Ge.index,St=Ge.sourceLayerIndex;if(this.hasPattern){var xt=Ed("line",this.layers,Ge,this.zoom,l);this.patternFeatures.push(xt)}else this.addFeature(Ge,ht,mt,_,{});l.featureIndex.insert(i[mt].feature,ht,mt,St,this.index)}},Bc.prototype.update=function(i,l,_){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,l,this.stateDependentLayers,_)},Bc.prototype.addFeatures=function(i,l,_){for(var S=0,F=this.patternFeatures;S<F.length;S+=1){var j=F[S];this.addFeature(j,j.geometry,j.index,l,_)}},Bc.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Bc.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Bc.prototype.upload=function(i){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=i.createVertexBuffer(this.layoutVertexArray2,xm)),this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,Fd),this.indexBuffer=i.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(i),this.uploaded=!0},Bc.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Bc.prototype.lineFeatureClips=function(i){if(i.properties&&i.properties.hasOwnProperty("mapbox_clip_start")&&i.properties.hasOwnProperty("mapbox_clip_end"))return{start:+i.properties.mapbox_clip_start,end:+i.properties.mapbox_clip_end}},Bc.prototype.addFeature=function(i,l,_,S,F){var j=this.layers[0].layout,p=j.get("line-join").evaluate(i,{}),v=j.get("line-cap"),m=j.get("line-miter-limit"),w=j.get("line-round-limit");this.lineClips=this.lineFeatureClips(i);for(var D=0,N=l;D<N.length;D+=1)this.addLine(N[D],i,p,v,m,w);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,_,F,S)},Bc.prototype.addLine=function(i,l,_,S,F,j){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var p=0;p<i.length-1;p++)this.totalDistance+=i[p].dist(i[p+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var v=Jf[l.type]==="Polygon",m=i.length;m>=2&&i[m-1].equals(i[m-2]);)m--;for(var w=0;w<m-1&&i[w].equals(i[w+1]);)w++;if(!(m<(v?3:2))){_==="bevel"&&(F=1.05);var D,N=this.overscaling<=16?122880/(512*this.overscaling):0,W=this.segments.prepareSegment(10*m,this.layoutVertexArray,this.indexArray),$=void 0,ie=void 0,pe=void 0,we=void 0;this.e1=this.e2=-1,v&&(we=i[w].sub(D=i[m-2])._unit()._perp());for(var ke=w;ke<m;ke++)if(!(ie=ke===m-1?v?i[w+1]:void 0:i[ke+1])||!i[ke].equals(ie)){we&&(pe=we),D&&($=D),D=i[ke],we=ie?ie.sub(D)._unit()._perp():pe;var Ge=(pe=pe||we).add(we);Ge.x===0&&Ge.y===0||Ge._unit();var ht=pe.x*we.x+pe.y*we.y,mt=Ge.x*we.x+Ge.y*we.y,St=mt!==0?1/mt:1/0,xt=2*Math.sqrt(2-2*mt),bt=mt<kd&&$&&ie,kt=pe.x*we.y-pe.y*we.x>0;if(bt&&ke>w){var ft=D.dist($);if(ft>2*N){var nr=D.sub(D.sub($)._mult(N/ft)._round());this.updateDistance($,nr),this.addCurrentVertex(nr,pe,0,0,W),$=nr}}var br=$&&ie,Pr=br?_:v?"butt":S;if(br&&Pr==="round"&&(St<j?Pr="miter":St<=2&&(Pr="fakeround")),Pr==="miter"&&St>F&&(Pr="bevel"),Pr==="bevel"&&(St>2&&(Pr="flipbevel"),St<F&&(Pr="miter")),$&&this.updateDistance($,D),Pr==="miter")Ge._mult(St),this.addCurrentVertex(D,Ge,0,0,W);else if(Pr==="flipbevel"){if(St>100)Ge=we.mult(-1);else{var Mn=St*pe.add(we).mag()/pe.sub(we).mag();Ge._perp()._mult(Mn*(kt?-1:1))}this.addCurrentVertex(D,Ge,0,0,W),this.addCurrentVertex(D,Ge.mult(-1),0,0,W)}else if(Pr==="bevel"||Pr==="fakeround"){var yn=-Math.sqrt(St*St-1),kr=kt?yn:0,Ai=kt?0:yn;if($&&this.addCurrentVertex(D,pe,kr,Ai,W),Pr==="fakeround")for(var $n=Math.round(180*xt/Math.PI/20),ti=1;ti<$n;ti++){var ri=ti/$n;if(ri!==.5){var hn=ri-.5;ri+=ri*hn*(ri-1)*((1.0904+ht*(ht*(3.55645-1.43519*ht)-3.2452))*hn*hn+(.848013+ht*(.215638*ht-1.06021)))}var An=we.sub(pe)._mult(ri)._add(pe)._unit()._mult(kt?-1:1);this.addHalfVertex(D,An.x,An.y,!1,kt,0,W)}ie&&this.addCurrentVertex(D,we,-kr,-Ai,W)}else if(Pr==="butt")this.addCurrentVertex(D,Ge,0,0,W);else if(Pr==="square"){var Yi=$?1:-1;this.addCurrentVertex(D,Ge,Yi,Yi,W)}else Pr==="round"&&($&&(this.addCurrentVertex(D,pe,0,0,W),this.addCurrentVertex(D,pe,1,1,W,!0)),ie&&(this.addCurrentVertex(D,we,-1,-1,W,!0),this.addCurrentVertex(D,we,0,0,W)));if(bt&&ke<m-1){var Ci=D.dist(ie);if(Ci>2*N){var fo=D.add(ie.sub(D)._mult(N/Ci)._round());this.updateDistance(D,fo),this.addCurrentVertex(fo,we,0,0,W),D=fo}}}}},Bc.prototype.addCurrentVertex=function(i,l,_,S,F,j){j===void 0&&(j=!1);var p=l.y*S-l.x,v=-l.y-l.x*S;this.addHalfVertex(i,l.x+l.y*_,l.y-l.x*_,j,!1,_,F),this.addHalfVertex(i,p,v,j,!0,-S,F),this.distance>fd/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(i,l,_,S,F,j))},Bc.prototype.addHalfVertex=function(i,l,_,S,F,j,p){var v=.5*(this.lineClips?this.scaledDistance*(fd-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((i.x<<1)+(S?1:0),(i.y<<1)+(F?1:0),Math.round(63*l)+128,Math.round(63*_)+128,1+(j===0?0:j<0?-1:1)|(63&v)<<2,v>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var m=p.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,m),p.primitiveLength++),F?this.e2=m:this.e1=m},Bc.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Bc.prototype.updateDistance=function(i,l){this.distance+=i.dist(l),this.updateScaledDistance()},fi("LineBucket",Bc,{omit:["layers","patternFeatures"]});var im=new Gs({"line-cap":new Gi(Ae.layout_line["line-cap"]),"line-join":new Si(Ae.layout_line["line-join"]),"line-miter-limit":new Gi(Ae.layout_line["line-miter-limit"]),"line-round-limit":new Gi(Ae.layout_line["line-round-limit"]),"line-sort-key":new Si(Ae.layout_line["line-sort-key"])}),om={paint:new Gs({"line-opacity":new Si(Ae.paint_line["line-opacity"]),"line-color":new Si(Ae.paint_line["line-color"]),"line-translate":new Gi(Ae.paint_line["line-translate"]),"line-translate-anchor":new Gi(Ae.paint_line["line-translate-anchor"]),"line-width":new Si(Ae.paint_line["line-width"]),"line-gap-width":new Si(Ae.paint_line["line-gap-width"]),"line-offset":new Si(Ae.paint_line["line-offset"]),"line-blur":new Si(Ae.paint_line["line-blur"]),"line-dasharray":new ao(Ae.paint_line["line-dasharray"]),"line-pattern":new ji(Ae.paint_line["line-pattern"]),"line-gradient":new Ic(Ae.paint_line["line-gradient"])}),layout:im},Nd=new(function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.possiblyEvaluate=function(_,S){return S=new fa(Math.floor(S.zoom),{now:S.now,fadeDuration:S.fadeDuration,zoomHistory:S.zoomHistory,transition:S.transition}),i.prototype.possiblyEvaluate.call(this,_,S)},l.prototype.evaluate=function(_,S,F,j){return S=er({},S,{zoom:Math.floor(S.zoom)}),i.prototype.evaluate.call(this,_,S,F,j)},l}(Si))(om.paint.properties["line-width"].specification);Nd.useIntegerZoom=!0;var am=function(i){function l(_){i.call(this,_,om),this.gradientVersion=0}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._handleSpecialPaintPropertyUpdate=function(_){_==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Nl,this.gradientVersion=(this.gradientVersion+1)%He)},l.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},l.prototype.recalculate=function(_,S){i.prototype.recalculate.call(this,_,S),this.paint._values["line-floorwidth"]=Nd.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,_)},l.prototype.createBucket=function(_){return new Bc(_)},l.prototype.queryRadius=function(_){var S=_,F=uf(ml("line-width",this,S),ml("line-gap-width",this,S)),j=ml("line-offset",this,S);return F/2+Math.abs(j)+$l(this.paint.get("line-translate"))},l.prototype.queryIntersectsFeature=function(_,S,F,j,p,v,m){var w=Vu(_,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),v.angle,m),D=m/2*uf(this.paint.get("line-width").evaluate(S,F),this.paint.get("line-gap-width").evaluate(S,F)),N=this.paint.get("line-offset").evaluate(S,F);return N&&(j=function(W,$){for(var ie=[],pe=new Le(0,0),we=0;we<W.length;we++){for(var ke=W[we],Ge=[],ht=0;ht<ke.length;ht++){var mt=ke[ht],St=ke[ht+1],xt=ht===0?pe:mt.sub(ke[ht-1])._unit()._perp(),bt=ht===ke.length-1?pe:St.sub(mt)._unit()._perp(),kt=xt._add(bt)._unit();kt._mult(1/(kt.x*bt.x+kt.y*bt.y)),Ge.push(kt._mult($)._add(mt))}ie.push(Ge)}return ie}(j,N*m)),function(W,$,ie){for(var pe=0;pe<$.length;pe++){var we=$[pe];if(W.length>=3){for(var ke=0;ke<we.length;ke++)if(Vl(W,we[ke]))return!0}if(Yc(W,we,ie))return!0}return!1}(w,j,D)},l.prototype.isTileClipped=function(){return!0},l}(Lc);function uf(i,l){return l>0?l+2*i:i}var Qf=Al([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),cl=Al([{name:"a_projected_pos",components:3,type:"Float32"}],4),zd=(Al([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Al([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Fc=(Al([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Al([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Pe=Al([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function _t(i,l,_){return i.sections.forEach(function(S){S.text=function(F,j,p){var v=j.layout.get("text-transform").evaluate(p,{});return v==="uppercase"?F=F.toLocaleUpperCase():v==="lowercase"&&(F=F.toLocaleLowerCase()),ql.applyArabicShaping&&(F=ql.applyArabicShaping(F)),F}(S.text,l,_)}),i}Al([{name:"triangle",components:3,type:"Uint16"}]),Al([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Al([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Al([{type:"Float32",name:"offsetX"}]),Al([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Zt={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"},qr=function(i,l,_,S,F){var j,p,v=8*F-S-1,m=(1<<v)-1,w=m>>1,D=-7,N=_?F-1:0,W=_?-1:1,$=i[l+N];for(N+=W,j=$&(1<<-D)-1,$>>=-D,D+=v;D>0;j=256*j+i[l+N],N+=W,D-=8);for(p=j&(1<<-D)-1,j>>=-D,D+=S;D>0;p=256*p+i[l+N],N+=W,D-=8);if(j===0)j=1-w;else{if(j===m)return p?NaN:1/0*($?-1:1);p+=Math.pow(2,S),j-=w}return($?-1:1)*p*Math.pow(2,j-S)},wn=function(i,l,_,S,F,j){var p,v,m,w=8*j-F-1,D=(1<<w)-1,N=D>>1,W=F===23?Math.pow(2,-24)-Math.pow(2,-77):0,$=S?0:j-1,ie=S?1:-1,pe=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(v=isNaN(l)?1:0,p=D):(p=Math.floor(Math.log(l)/Math.LN2),l*(m=Math.pow(2,-p))<1&&(p--,m*=2),(l+=p+N>=1?W/m:W*Math.pow(2,1-N))*m>=2&&(p++,m/=2),p+N>=D?(v=0,p=D):p+N>=1?(v=(l*m-1)*Math.pow(2,F),p+=N):(v=l*Math.pow(2,N-1)*Math.pow(2,F),p=0));F>=8;i[_+$]=255&v,$+=ie,v/=256,F-=8);for(p=p<<F|v,w+=F;w>0;i[_+$]=255&p,$+=ie,p/=256,w-=8);i[_+$-ie]|=128*pe},Yr=Or;function Or(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}Or.Varint=0,Or.Fixed64=1,Or.Bytes=2,Or.Fixed32=5;var Wn=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");function Bn(i){return i.type===Or.Bytes?i.readVarint()+i.pos:i.pos+1}function si(i,l,_){return _?4294967296*l+(i>>>0):4294967296*(l>>>0)+(i>>>0)}function Hn(i,l,_){var S=l<=16383?1:l<=2097151?2:l<=268435455?3:Math.floor(Math.log(l)/(7*Math.LN2));_.realloc(S);for(var F=_.pos-1;F>=i;F--)_.buf[F+S]=_.buf[F]}function qn(i,l){for(var _=0;_<i.length;_++)l.writeVarint(i[_])}function ci(i,l){for(var _=0;_<i.length;_++)l.writeSVarint(i[_])}function Vn(i,l){for(var _=0;_<i.length;_++)l.writeFloat(i[_])}function Yn(i,l){for(var _=0;_<i.length;_++)l.writeDouble(i[_])}function Tr(i,l){for(var _=0;_<i.length;_++)l.writeBoolean(i[_])}function en(i,l){for(var _=0;_<i.length;_++)l.writeFixed32(i[_])}function Xn(i,l){for(var _=0;_<i.length;_++)l.writeSFixed32(i[_])}function _i(i,l){for(var _=0;_<i.length;_++)l.writeFixed64(i[_])}function Rn(i,l){for(var _=0;_<i.length;_++)l.writeSFixed64(i[_])}function xi(i,l){return(i[l]|i[l+1]<<8|i[l+2]<<16)+16777216*i[l+3]}function Un(i,l,_){i[_]=l,i[_+1]=l>>>8,i[_+2]=l>>>16,i[_+3]=l>>>24}function Oi(i,l){return(i[l]|i[l+1]<<8|i[l+2]<<16)+(i[l+3]<<24)}function Ln(i,l,_){i===1&&_.readMessage(wi,l)}function wi(i,l,_){if(i===3){var S=_.readMessage(Po,{}),F=S.width,j=S.height,p=S.left,v=S.top,m=S.advance;l.push({id:S.id,bitmap:new ef({width:F+6,height:j+6},S.bitmap),metrics:{width:F,height:j,left:p,top:v,advance:m}})}}function Po(i,l,_){i===1?l.id=_.readVarint():i===2?l.bitmap=_.readBytes():i===3?l.width=_.readVarint():i===4?l.height=_.readVarint():i===5?l.left=_.readSVarint():i===6?l.top=_.readSVarint():i===7&&(l.advance=_.readVarint())}function da(i){for(var l=0,_=0,S=0,F=i;S<F.length;S+=1){var j=F[S];l+=j.w*j.h,_=Math.max(_,j.w)}i.sort(function(pe,we){return we.h-pe.h});for(var p=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(l/.95)),_),h:1/0}],v=0,m=0,w=0,D=i;w<D.length;w+=1)for(var N=D[w],W=p.length-1;W>=0;W--){var $=p[W];if(!(N.w>$.w||N.h>$.h)){if(N.x=$.x,N.y=$.y,m=Math.max(m,N.y+N.h),v=Math.max(v,N.x+N.w),N.w===$.w&&N.h===$.h){var ie=p.pop();W<p.length&&(p[W]=ie)}else N.h===$.h?($.x+=N.w,$.w-=N.w):N.w===$.w?($.y+=N.h,$.h-=N.h):(p.push({x:$.x+N.w,y:$.y,w:$.w-N.w,h:N.h}),$.y+=N.h,$.h-=N.h);break}}return{w:v,h:m,fill:l/(v*m)||0}}Or.prototype={destroy:function(){this.buf=null},readFields:function(i,l,_){for(_=_||this.length;this.pos<_;){var S=this.readVarint(),F=S>>3,j=this.pos;this.type=7&S,i(F,l,this),this.pos===j&&this.skip(S)}return l},readMessage:function(i,l){return this.readFields(i,l,this.readVarint()+this.pos)},readFixed32:function(){var i=xi(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=Oi(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=xi(this.buf,this.pos)+4294967296*xi(this.buf,this.pos+4);return this.pos+=8,i},readSFixed64:function(){var i=xi(this.buf,this.pos)+4294967296*Oi(this.buf,this.pos+4);return this.pos+=8,i},readFloat:function(){var i=qr(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=qr(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var l,_,S=this.buf;return l=127&(_=S[this.pos++]),_<128?l:(l|=(127&(_=S[this.pos++]))<<7,_<128?l:(l|=(127&(_=S[this.pos++]))<<14,_<128?l:(l|=(127&(_=S[this.pos++]))<<21,_<128?l:function(F,j,p){var v,m,w=p.buf;if(v=(112&(m=w[p.pos++]))>>4,m<128||(v|=(127&(m=w[p.pos++]))<<3,m<128)||(v|=(127&(m=w[p.pos++]))<<10,m<128)||(v|=(127&(m=w[p.pos++]))<<17,m<128)||(v|=(127&(m=w[p.pos++]))<<24,m<128)||(v|=(1&(m=w[p.pos++]))<<31,m<128))return si(F,v,j);throw new Error("Expected varint not more than 10 bytes")}(l|=(15&(_=S[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,l=this.pos;return this.pos=i,i-l>=12&&Wn?function(_,S,F){return Wn.decode(_.subarray(S,F))}(this.buf,l,i):function(_,S,F){for(var j="",p=S;p<F;){var v,m,w,D=_[p],N=null,W=D>239?4:D>223?3:D>191?2:1;if(p+W>F)break;W===1?D<128&&(N=D):W===2?(192&(v=_[p+1]))==128&&(N=(31&D)<<6|63&v)<=127&&(N=null):W===3?(m=_[p+2],(192&(v=_[p+1]))==128&&(192&m)==128&&((N=(15&D)<<12|(63&v)<<6|63&m)<=2047||N>=55296&&N<=57343)&&(N=null)):W===4&&(m=_[p+2],w=_[p+3],(192&(v=_[p+1]))==128&&(192&m)==128&&(192&w)==128&&((N=(15&D)<<18|(63&v)<<12|(63&m)<<6|63&w)<=65535||N>=1114112)&&(N=null)),N===null?(N=65533,W=1):N>65535&&(N-=65536,j+=String.fromCharCode(N>>>10&1023|55296),N=56320|1023&N),j+=String.fromCharCode(N),p+=W}return j}(this.buf,l,i)},readBytes:function(){var i=this.readVarint()+this.pos,l=this.buf.subarray(this.pos,i);return this.pos=i,l},readPackedVarint:function(i,l){if(this.type!==Or.Bytes)return i.push(this.readVarint(l));var _=Bn(this);for(i=i||[];this.pos<_;)i.push(this.readVarint(l));return i},readPackedSVarint:function(i){if(this.type!==Or.Bytes)return i.push(this.readSVarint());var l=Bn(this);for(i=i||[];this.pos<l;)i.push(this.readSVarint());return i},readPackedBoolean:function(i){if(this.type!==Or.Bytes)return i.push(this.readBoolean());var l=Bn(this);for(i=i||[];this.pos<l;)i.push(this.readBoolean());return i},readPackedFloat:function(i){if(this.type!==Or.Bytes)return i.push(this.readFloat());var l=Bn(this);for(i=i||[];this.pos<l;)i.push(this.readFloat());return i},readPackedDouble:function(i){if(this.type!==Or.Bytes)return i.push(this.readDouble());var l=Bn(this);for(i=i||[];this.pos<l;)i.push(this.readDouble());return i},readPackedFixed32:function(i){if(this.type!==Or.Bytes)return i.push(this.readFixed32());var l=Bn(this);for(i=i||[];this.pos<l;)i.push(this.readFixed32());return i},readPackedSFixed32:function(i){if(this.type!==Or.Bytes)return i.push(this.readSFixed32());var l=Bn(this);for(i=i||[];this.pos<l;)i.push(this.readSFixed32());return i},readPackedFixed64:function(i){if(this.type!==Or.Bytes)return i.push(this.readFixed64());var l=Bn(this);for(i=i||[];this.pos<l;)i.push(this.readFixed64());return i},readPackedSFixed64:function(i){if(this.type!==Or.Bytes)return i.push(this.readSFixed64());var l=Bn(this);for(i=i||[];this.pos<l;)i.push(this.readSFixed64());return i},skip:function(i){var l=7&i;if(l===Or.Varint)for(;this.buf[this.pos++]>127;);else if(l===Or.Bytes)this.pos=this.readVarint()+this.pos;else if(l===Or.Fixed32)this.pos+=4;else{if(l!==Or.Fixed64)throw new Error("Unimplemented type: "+l);this.pos+=8}},writeTag:function(i,l){this.writeVarint(i<<3|l)},realloc:function(i){for(var l=this.length||16;l<this.pos+i;)l*=2;if(l!==this.length){var _=new Uint8Array(l);_.set(this.buf),this.buf=_,this.length=l}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(i){this.realloc(4),Un(this.buf,i,this.pos),this.pos+=4},writeSFixed32:function(i){this.realloc(4),Un(this.buf,i,this.pos),this.pos+=4},writeFixed64:function(i){this.realloc(8),Un(this.buf,-1&i,this.pos),Un(this.buf,Math.floor(i*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(i){this.realloc(8),Un(this.buf,-1&i,this.pos),Un(this.buf,Math.floor(i*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(i){(i=+i||0)>268435455||i<0?function(l,_){var S,F;if(l>=0?(S=l%4294967296|0,F=l/4294967296|0):(F=~(-l/4294967296),4294967295^(S=~(-l%4294967296))?S=S+1|0:(S=0,F=F+1|0)),l>=18446744073709552e3||l<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");_.realloc(10),function(j,p,v){v.buf[v.pos++]=127&j|128,j>>>=7,v.buf[v.pos++]=127&j|128,j>>>=7,v.buf[v.pos++]=127&j|128,j>>>=7,v.buf[v.pos++]=127&j|128,v.buf[v.pos]=127&(j>>>=7)}(S,0,_),function(j,p){var v=(7&j)<<4;p.buf[p.pos++]|=v|((j>>>=3)?128:0),j&&(p.buf[p.pos++]=127&j|((j>>>=7)?128:0),j&&(p.buf[p.pos++]=127&j|((j>>>=7)?128:0),j&&(p.buf[p.pos++]=127&j|((j>>>=7)?128:0),j&&(p.buf[p.pos++]=127&j|((j>>>=7)?128:0),j&&(p.buf[p.pos++]=127&j)))))}(F,_)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var l=this.pos;this.pos=function(S,F,j){for(var p,v,m=0;m<F.length;m++){if((p=F.charCodeAt(m))>55295&&p<57344){if(!v){p>56319||m+1===F.length?(S[j++]=239,S[j++]=191,S[j++]=189):v=p;continue}if(p<56320){S[j++]=239,S[j++]=191,S[j++]=189,v=p;continue}p=v-55296<<10|p-56320|65536,v=null}else v&&(S[j++]=239,S[j++]=191,S[j++]=189,v=null);p<128?S[j++]=p:(p<2048?S[j++]=p>>6|192:(p<65536?S[j++]=p>>12|224:(S[j++]=p>>18|240,S[j++]=p>>12&63|128),S[j++]=p>>6&63|128),S[j++]=63&p|128)}return j}(this.buf,i,this.pos);var _=this.pos-l;_>=128&&Hn(l,_,this),this.pos=l-1,this.writeVarint(_),this.pos+=_},writeFloat:function(i){this.realloc(4),wn(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),wn(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var l=i.length;this.writeVarint(l),this.realloc(l);for(var _=0;_<l;_++)this.buf[this.pos++]=i[_]},writeRawMessage:function(i,l){this.pos++;var _=this.pos;i(l,this);var S=this.pos-_;S>=128&&Hn(_,S,this),this.pos=_-1,this.writeVarint(S),this.pos+=S},writeMessage:function(i,l,_){this.writeTag(i,Or.Bytes),this.writeRawMessage(l,_)},writePackedVarint:function(i,l){l.length&&this.writeMessage(i,qn,l)},writePackedSVarint:function(i,l){l.length&&this.writeMessage(i,ci,l)},writePackedBoolean:function(i,l){l.length&&this.writeMessage(i,Tr,l)},writePackedFloat:function(i,l){l.length&&this.writeMessage(i,Vn,l)},writePackedDouble:function(i,l){l.length&&this.writeMessage(i,Yn,l)},writePackedFixed32:function(i,l){l.length&&this.writeMessage(i,en,l)},writePackedSFixed32:function(i,l){l.length&&this.writeMessage(i,Xn,l)},writePackedFixed64:function(i,l){l.length&&this.writeMessage(i,_i,l)},writePackedSFixed64:function(i,l){l.length&&this.writeMessage(i,Rn,l)},writeBytesField:function(i,l){this.writeTag(i,Or.Bytes),this.writeBytes(l)},writeFixed32Field:function(i,l){this.writeTag(i,Or.Fixed32),this.writeFixed32(l)},writeSFixed32Field:function(i,l){this.writeTag(i,Or.Fixed32),this.writeSFixed32(l)},writeFixed64Field:function(i,l){this.writeTag(i,Or.Fixed64),this.writeFixed64(l)},writeSFixed64Field:function(i,l){this.writeTag(i,Or.Fixed64),this.writeSFixed64(l)},writeVarintField:function(i,l){this.writeTag(i,Or.Varint),this.writeVarint(l)},writeSVarintField:function(i,l){this.writeTag(i,Or.Varint),this.writeSVarint(l)},writeStringField:function(i,l){this.writeTag(i,Or.Bytes),this.writeString(l)},writeFloatField:function(i,l){this.writeTag(i,Or.Fixed32),this.writeFloat(l)},writeDoubleField:function(i,l){this.writeTag(i,Or.Fixed64),this.writeDouble(l)},writeBooleanField:function(i,l){this.writeVarintField(i,!!l)}};var bi=function(i,l){var _=l.pixelRatio,S=l.version,F=l.stretchX,j=l.stretchY,p=l.content;this.paddedRect=i,this.pixelRatio=_,this.stretchX=F,this.stretchY=j,this.content=p,this.version=S},Zn={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Zn.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Zn.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Zn.tlbr.get=function(){return this.tl.concat(this.br)},Zn.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(bi.prototype,Zn);var Sn=function(i,l){var _={},S={};this.haveRenderCallbacks=[];var F=[];this.addImages(i,_,F),this.addImages(l,S,F);var j=da(F),p=new _s({width:j.w||1,height:j.h||1});for(var v in i){var m=i[v],w=_[v].paddedRect;_s.copy(m.data,p,{x:0,y:0},{x:w.x+1,y:w.y+1},m.data)}for(var D in l){var N=l[D],W=S[D].paddedRect,$=W.x+1,ie=W.y+1,pe=N.data.width,we=N.data.height;_s.copy(N.data,p,{x:0,y:0},{x:$,y:ie},N.data),_s.copy(N.data,p,{x:0,y:we-1},{x:$,y:ie-1},{width:pe,height:1}),_s.copy(N.data,p,{x:0,y:0},{x:$,y:ie+we},{width:pe,height:1}),_s.copy(N.data,p,{x:pe-1,y:0},{x:$-1,y:ie},{width:1,height:we}),_s.copy(N.data,p,{x:0,y:0},{x:$+pe,y:ie},{width:1,height:we})}this.image=p,this.iconPositions=_,this.patternPositions=S};Sn.prototype.addImages=function(i,l,_){for(var S in i){var F=i[S],j={x:0,y:0,w:F.data.width+2,h:F.data.height+2};_.push(j),l[S]=new bi(j,F),F.hasRenderCallback&&this.haveRenderCallbacks.push(S)}},Sn.prototype.patchUpdatedImages=function(i,l){for(var _ in i.dispatchRenderCallbacks(this.haveRenderCallbacks),i.updatedImages)this.patchUpdatedImage(this.iconPositions[_],i.getImage(_),l),this.patchUpdatedImage(this.patternPositions[_],i.getImage(_),l)},Sn.prototype.patchUpdatedImage=function(i,l,_){if(i&&l&&i.version!==l.version){i.version=l.version;var S=i.tl;_.update(l.data,void 0,{x:S[0],y:S[1]})}},fi("ImagePosition",bi),fi("ImageAtlas",Sn);var Wt={horizontal:1,vertical:2,horizontalOnly:3},K=function(){this.scale=1,this.fontStack="",this.imageName=null};K.forText=function(i,l){var _=new K;return _.scale=i||1,_.fontStack=l,_},K.forImage=function(i){var l=new K;return l.imageName=i,l};var Ei=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Ee(i,l,_,S,F,j,p,v,m,w,D,N,W,$,ie,pe){var we,ke=Ei.fromFeature(i,F);N===Wt.vertical&&ke.verticalizePunctuation();var Ge=ql.processBidirectionalText,ht=ql.processStyledBidirectionalText;if(Ge&&ke.sections.length===1){we=[];for(var mt=0,St=Ge(ke.toString(),fu(ke,w,j,l,S,$,ie));mt<St.length;mt+=1){var xt=St[mt],bt=new Ei;bt.text=xt,bt.sections=ke.sections;for(var kt=0;kt<xt.length;kt++)bt.sectionIndex.push(0);we.push(bt)}}else if(ht){we=[];for(var ft=0,nr=ht(ke.text,ke.sectionIndex,fu(ke,w,j,l,S,$,ie));ft<nr.length;ft+=1){var br=nr[ft],Pr=new Ei;Pr.text=br[0],Pr.sectionIndex=br[1],Pr.sections=ke.sections,we.push(Pr)}}else we=function(kr,Ai){for(var $n=[],ti=kr.text,ri=0,hn=0,An=Ai;hn<An.length;hn+=1){var Yi=An[hn];$n.push(kr.substring(ri,Yi)),ri=Yi}return ri<ti.length&&$n.push(kr.substring(ri,ti.length)),$n}(ke,fu(ke,w,j,l,S,$,ie));var Mn=[],yn={positionedLines:Mn,text:ke.toString(),top:D[1],bottom:D[1],left:D[0],right:D[0],writingMode:N,iconsInText:!1,verticalizable:!1};return function(kr,Ai,$n,ti,ri,hn,An,Yi,Ci,fo,Go,hi){for(var zi=0,Vo=-17,Ka=0,ta=0,ka=Yi==="right"?1:Yi==="left"?0:.5,ca=0,Eo=0,Pa=ri;Eo<Pa.length;Eo+=1){var na=Pa[Eo];na.trim();var ha=na.getMaxScale(),Xs=24*(ha-1),Ls={positionedGlyphs:[],lineOffset:0};kr.positionedLines[ca]=Ls;var Ea=Ls.positionedGlyphs,ws=0;if(na.length()){for(var qs=0;qs<na.length();qs++){var ua=na.getSection(qs),cu=na.getSectionIndex(qs),c=na.getCharCode(qs),o=0,f=null,E=null,L=null,V=24,X=!(Ci===Wt.horizontal||!Go&&!Op(c)||Go&&(sa[c]||(Ct=c,mi.Arabic(Ct)||mi["Arabic Supplement"](Ct)||mi["Arabic Extended-A"](Ct)||mi["Arabic Presentation Forms-A"](Ct)||mi["Arabic Presentation Forms-B"](Ct))));if(ua.imageName){var J=ti[ua.imageName];if(!J)continue;L=ua.imageName,kr.iconsInText=kr.iconsInText||!0,E=J.paddedRect;var oe=J.displaySize;ua.scale=24*ua.scale/hi,o=Xs+(24-oe[1]*ua.scale),V=(f={width:oe[0],height:oe[1],left:1,top:-3,advance:X?oe[1]:oe[0]}).advance;var me=X?oe[0]*ua.scale-24*ha:oe[1]*ua.scale-24*ha;me>0&&me>ws&&(ws=me)}else{var Me=$n[ua.fontStack],De=Me&&Me[c];if(De&&De.rect)E=De.rect,f=De.metrics;else{var Ye=Ai[ua.fontStack],ot=Ye&&Ye[c];if(!ot)continue;f=ot.metrics}o=24*(ha-ua.scale)}X?(kr.verticalizable=!0,Ea.push({glyph:c,imageName:L,x:zi,y:Vo+o,vertical:X,scale:ua.scale,fontStack:ua.fontStack,sectionIndex:cu,metrics:f,rect:E}),zi+=V*ua.scale+fo):(Ea.push({glyph:c,imageName:L,x:zi,y:Vo+o,vertical:X,scale:ua.scale,fontStack:ua.fontStack,sectionIndex:cu,metrics:f,rect:E}),zi+=f.advance*ua.scale+fo)}Ea.length!==0&&(Ka=Math.max(zi-fo,Ka),ps(Ea,0,Ea.length-1,ka,ws)),zi=0;var lt=hn*ha+ws;Ls.lineOffset=Math.max(ws,Xs),Vo+=lt,ta=Math.max(lt,ta),++ca}else Vo+=hn,++ca}var Ct,Gt=Vo- -17,Kt=Js(An),Er=Kt.horizontalAlign,cr=Kt.verticalAlign;(function(Rr,Qr,Fn,Ki,Co,$i,Zi,Ri,vo){var Ii,ni=(Qr-Fn)*Co;Ii=$i!==Zi?-Ri*Ki- -17:(-Ki*vo+.5)*Zi;for(var jo=0,Do=Rr;jo<Do.length;jo+=1)for(var rs=0,iu=Do[jo].positionedGlyphs;rs<iu.length;rs+=1){var tl=iu[rs];tl.x+=ni,tl.y+=Ii}})(kr.positionedLines,ka,Er,cr,Ka,ta,hn,Gt,ri.length),kr.top+=-cr*Gt,kr.bottom=kr.top+Gt,kr.left+=-Er*Ka,kr.right=kr.left+Ka}(yn,l,_,S,we,p,v,m,N,w,W,pe),!function(kr){for(var Ai=0,$n=kr;Ai<$n.length;Ai+=1)if($n[Ai].positionedGlyphs.length!==0)return!1;return!0}(Mn)&&yn}Ei.fromFeature=function(i,l){for(var _=new Ei,S=0;S<i.sections.length;S++){var F=i.sections[S];F.image?_.addImageSection(F):_.addTextSection(F,l)}return _},Ei.prototype.length=function(){return this.text.length},Ei.prototype.getSection=function(i){return this.sections[this.sectionIndex[i]]},Ei.prototype.getSectionIndex=function(i){return this.sectionIndex[i]},Ei.prototype.getCharCode=function(i){return this.text.charCodeAt(i)},Ei.prototype.verticalizePunctuation=function(){this.text=function(i){for(var l="",_=0;_<i.length;_++){var S=i.charCodeAt(_+1)||null,F=i.charCodeAt(_-1)||null;l+=S&&Jp(S)&&!Zt[i[_+1]]||F&&Jp(F)&&!Zt[i[_-1]]||!Zt[i[_]]?i[_]:Zt[i[_]]}return l}(this.text)},Ei.prototype.trim=function(){for(var i=0,l=0;l<this.text.length&&sa[this.text.charCodeAt(l)];l++)i++;for(var _=this.text.length,S=this.text.length-1;S>=0&&S>=i&&sa[this.text.charCodeAt(S)];S--)_--;this.text=this.text.substring(i,_),this.sectionIndex=this.sectionIndex.slice(i,_)},Ei.prototype.substring=function(i,l){var _=new Ei;return _.text=this.text.substring(i,l),_.sectionIndex=this.sectionIndex.slice(i,l),_.sections=this.sections,_},Ei.prototype.toString=function(){return this.text},Ei.prototype.getMaxScale=function(){var i=this;return this.sectionIndex.reduce(function(l,_){return Math.max(l,i.sections[_].scale)},0)},Ei.prototype.addTextSection=function(i,l){this.text+=i.text,this.sections.push(K.forText(i.scale,i.fontStack||l));for(var _=this.sections.length-1,S=0;S<i.text.length;++S)this.sectionIndex.push(_)},Ei.prototype.addImageSection=function(i){var l=i.image?i.image.name:"";if(l.length!==0){var _=this.getNextImageSectionCharCode();_?(this.text+=String.fromCharCode(_),this.sections.push(K.forImage(l)),this.sectionIndex.push(this.sections.length-1)):gr("Reached maximum number of images 6401")}else gr("Can't add FormattedSection with an empty image.")},Ei.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var sa={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Jo={};function Es(i,l,_,S,F,j){if(l.imageName){var p=S[l.imageName];return p?p.displaySize[0]*l.scale*24/j+F:0}var v=_[l.fontStack],m=v&&v[i];return m?m.metrics.advance*l.scale+F:0}function Cu(i,l,_,S){var F=Math.pow(i-l,2);return S?i<l?F/2:2*F:F+Math.abs(_)*_}function Bl(i,l,_){var S=0;return i===10&&(S-=1e4),_&&(S+=150),i!==40&&i!==65288||(S+=50),l!==41&&l!==65289||(S+=50),S}function as(i,l,_,S,F,j){for(var p=null,v=Cu(l,_,F,j),m=0,w=S;m<w.length;m+=1){var D=w[m],N=Cu(l-D.x,_,F,j)+D.badness;N<=v&&(p=D,v=N)}return{index:i,x:l,priorBreak:p,badness:v}}function fu(i,l,_,S,F,j,p){if(j!=="point")return[];if(!i)return[];for(var v,m=[],w=function(we,ke,Ge,ht,mt,St){for(var xt=0,bt=0;bt<we.length();bt++){var kt=we.getSection(bt);xt+=Es(we.getCharCode(bt),kt,ht,mt,ke,St)}return xt/Math.max(1,Math.ceil(xt/Ge))}(i,l,_,S,F,p),D=i.text.indexOf("\u200B")>=0,N=0,W=0;W<i.length();W++){var $=i.getSection(W),ie=i.getCharCode(W);if(sa[ie]||(N+=Es(ie,$,S,F,l,p)),W<i.length()-1){var pe=!((v=ie)<11904||!(mi["Bopomofo Extended"](v)||mi.Bopomofo(v)||mi["CJK Compatibility Forms"](v)||mi["CJK Compatibility Ideographs"](v)||mi["CJK Compatibility"](v)||mi["CJK Radicals Supplement"](v)||mi["CJK Strokes"](v)||mi["CJK Symbols and Punctuation"](v)||mi["CJK Unified Ideographs Extension A"](v)||mi["CJK Unified Ideographs"](v)||mi["Enclosed CJK Letters and Months"](v)||mi["Halfwidth and Fullwidth Forms"](v)||mi.Hiragana(v)||mi["Ideographic Description Characters"](v)||mi["Kangxi Radicals"](v)||mi["Katakana Phonetic Extensions"](v)||mi.Katakana(v)||mi["Vertical Forms"](v)||mi["Yi Radicals"](v)||mi["Yi Syllables"](v)));(Jo[ie]||pe||$.imageName)&&m.push(as(W+1,N,w,m,Bl(ie,i.getCharCode(W+1),pe&&D),!1))}}return function we(ke){return ke?we(ke.priorBreak).concat(ke.index):[]}(as(i.length(),N,w,m,0,!0))}function Js(i){var l=.5,_=.5;switch(i){case"right":case"top-right":case"bottom-right":l=1;break;case"left":case"top-left":case"bottom-left":l=0}switch(i){case"bottom":case"bottom-right":case"bottom-left":_=1;break;case"top":case"top-right":case"top-left":_=0}return{horizontalAlign:l,verticalAlign:_}}function ps(i,l,_,S,F){if(S||F)for(var j=i[_],p=(i[_].x+j.metrics.advance*j.scale)*S,v=l;v<=_;v++)i[v].x-=p,i[v].y+=F}function du(i,l,_,S,F,j){var p,v=i.image;if(v.content){var m=v.content,w=v.pixelRatio||1;p=[m[0]/w,m[1]/w,v.displaySize[0]-m[2]/w,v.displaySize[1]-m[3]/w]}var D,N,W,$,ie=l.left*j,pe=l.right*j;_==="width"||_==="both"?($=F[0]+ie-S[3],N=F[0]+pe+S[1]):N=($=F[0]+(ie+pe-v.displaySize[0])/2)+v.displaySize[0];var we=l.top*j,ke=l.bottom*j;return _==="height"||_==="both"?(D=F[1]+we-S[0],W=F[1]+ke+S[2]):W=(D=F[1]+(we+ke-v.displaySize[1])/2)+v.displaySize[1],{image:v,top:D,right:N,bottom:W,left:$,collisionPadding:p}}Jo[10]=!0,Jo[32]=!0,Jo[38]=!0,Jo[40]=!0,Jo[41]=!0,Jo[43]=!0,Jo[45]=!0,Jo[47]=!0,Jo[173]=!0,Jo[183]=!0,Jo[8203]=!0,Jo[8208]=!0,Jo[8211]=!0,Jo[8231]=!0;var ru=function(i){function l(_,S,F,j){i.call(this,_,S),this.angle=F,j!==void 0&&(this.segment=j)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.clone=function(){return new l(this.x,this.y,this.angle,this.segment)},l}(Le);function uu(i,l){var _=l.expression;if(_.kind==="constant")return{kind:"constant",layoutSize:_.evaluate(new fa(i+1))};if(_.kind==="source")return{kind:"source"};for(var S=_.zoomStops,F=_.interpolationType,j=0;j<S.length&&S[j]<=i;)j++;for(var p=j=Math.max(0,j-1);p<S.length&&S[p]<i+1;)p++;p=Math.min(S.length-1,p);var v=S[j],m=S[p];return _.kind==="composite"?{kind:"composite",minZoom:v,maxZoom:m,interpolationType:F}:{kind:"camera",minZoom:v,maxZoom:m,minSize:_.evaluate(new fa(v)),maxSize:_.evaluate(new fa(m)),interpolationType:F}}function za(i,l,_){var S=l.uSize,F=_.lowerSize;return i.kind==="source"?F/128:i.kind==="composite"?Io(F/128,_.upperSize/128,l.uSizeT):S}function Mu(i,l){var _=0,S=0;if(i.kind==="constant")S=i.layoutSize;else if(i.kind!=="source"){var F=i.interpolationType,j=F?Ve(Ms.interpolationFactor(F,l,i.minZoom,i.maxZoom),0,1):0;i.kind==="camera"?S=Io(i.minSize,i.maxSize,j):_=j}return{uSizeT:_,uSize:S}}fi("Anchor",ru);var Ca=Object.freeze({__proto__:null,getSizeData:uu,evaluateSizeForFeature:za,evaluateSizeForZoom:Mu,SIZE_PACK_FACTOR:128});function mu(i,l,_,S,F){if(l.segment===void 0)return!0;for(var j=l,p=l.segment+1,v=0;v>-_/2;){if(--p<0)return!1;v-=i[p].dist(j),j=i[p]}v+=i[p].dist(i[p+1]),p++;for(var m=[],w=0;v<_/2;){var D=i[p],N=i[p+1];if(!N)return!1;var W=i[p-1].angleTo(D)-D.angleTo(N);for(W=Math.abs((W+3*Math.PI)%(2*Math.PI)-Math.PI),m.push({distance:v,angleDelta:W}),w+=W;v-m[0].distance>S;)w-=m.shift().angleDelta;if(w>F)return!1;p++,v+=D.dist(N)}return!0}function ss(i){for(var l=0,_=0;_<i.length-1;_++)l+=i[_].dist(i[_+1]);return l}function go(i,l,_){return i?.6*l*_:0}function ya(i,l){return Math.max(i?i.right-i.left:0,l?l.right-l.left:0)}function Qo(i,l,_,S,F,j){for(var p=go(_,F,j),v=ya(_,S)*j,m=0,w=ss(i)/2,D=0;D<i.length-1;D++){var N=i[D],W=i[D+1],$=N.dist(W);if(m+$>w){var ie=(w-m)/$,pe=Io(N.x,W.x,ie),we=Io(N.y,W.y,ie),ke=new ru(pe,we,W.angleTo(N),D);return ke._round(),!p||mu(i,ke,v,p,l)?ke:void 0}m+=$}}function Qs(i,l,_,S,F,j,p,v,m){var w=go(S,j,p),D=ya(S,F),N=D*p,W=i[0].x===0||i[0].x===m||i[0].y===0||i[0].y===m;return l-N<l/4&&(l=N+l/4),function $(ie,pe,we,ke,Ge,ht,mt,St,xt){for(var bt=ht/2,kt=ss(ie),ft=0,nr=pe-we,br=[],Pr=0;Pr<ie.length-1;Pr++){for(var Mn=ie[Pr],yn=ie[Pr+1],kr=Mn.dist(yn),Ai=yn.angleTo(Mn);nr+we<ft+kr;){var $n=((nr+=we)-ft)/kr,ti=Io(Mn.x,yn.x,$n),ri=Io(Mn.y,yn.y,$n);if(ti>=0&&ti<xt&&ri>=0&&ri<xt&&nr-bt>=0&&nr+bt<=kt){var hn=new ru(ti,ri,Ai,Pr);hn._round(),ke&&!mu(ie,hn,ht,ke,Ge)||br.push(hn)}}ft+=kr}return St||br.length||mt||(br=$(ie,ft/2,we,ke,Ge,ht,mt,!0,xt)),br}(i,W?l/2*v%l:(D/2+2*j)*p*v%l,l,w,_,N,W,!1,m)}function Cp(i,l,_,S,F){for(var j=[],p=0;p<i.length;p++)for(var v=i[p],m=void 0,w=0;w<v.length-1;w++){var D=v[w],N=v[w+1];D.x<l&&N.x<l||(D.x<l?D=new Le(l,D.y+(l-D.x)/(N.x-D.x)*(N.y-D.y))._round():N.x<l&&(N=new Le(l,D.y+(l-D.x)/(N.x-D.x)*(N.y-D.y))._round()),D.y<_&&N.y<_||(D.y<_?D=new Le(D.x+(_-D.y)/(N.y-D.y)*(N.x-D.x),_)._round():N.y<_&&(N=new Le(D.x+(_-D.y)/(N.y-D.y)*(N.x-D.x),_)._round()),D.x>=S&&N.x>=S||(D.x>=S?D=new Le(S,D.y+(S-D.x)/(N.x-D.x)*(N.y-D.y))._round():N.x>=S&&(N=new Le(S,D.y+(S-D.x)/(N.x-D.x)*(N.y-D.y))._round()),D.y>=F&&N.y>=F||(D.y>=F?D=new Le(D.x+(F-D.y)/(N.y-D.y)*(N.x-D.x),F)._round():N.y>=F&&(N=new Le(D.x+(F-D.y)/(N.y-D.y)*(N.x-D.x),F)._round()),m&&D.equals(m[m.length-1])||j.push(m=[D]),m.push(N)))))}return j}function Ft(i,l,_,S){var F=[],j=i.image,p=j.pixelRatio,v=j.paddedRect.w-2,m=j.paddedRect.h-2,w=i.right-i.left,D=i.bottom-i.top,N=j.stretchX||[[0,v]],W=j.stretchY||[[0,m]],$=function(ti,ri){return ti+ri[1]-ri[0]},ie=N.reduce($,0),pe=W.reduce($,0),we=v-ie,ke=m-pe,Ge=0,ht=ie,mt=0,St=pe,xt=0,bt=we,kt=0,ft=ke;if(j.content&&S){var nr=j.content;Ge=Xr(N,0,nr[0]),mt=Xr(W,0,nr[1]),ht=Xr(N,nr[0],nr[2]),St=Xr(W,nr[1],nr[3]),xt=nr[0]-Ge,kt=nr[1]-mt,bt=nr[2]-nr[0]-ht,ft=nr[3]-nr[1]-St}var br=function(ti,ri,hn,An){var Yi=Bi(ti.stretch-Ge,ht,w,i.left),Ci=Ma(ti.fixed-xt,bt,ti.stretch,ie),fo=Bi(ri.stretch-mt,St,D,i.top),Go=Ma(ri.fixed-kt,ft,ri.stretch,pe),hi=Bi(hn.stretch-Ge,ht,w,i.left),zi=Ma(hn.fixed-xt,bt,hn.stretch,ie),Vo=Bi(An.stretch-mt,St,D,i.top),Ka=Ma(An.fixed-kt,ft,An.stretch,pe),ta=new Le(Yi,fo),ka=new Le(hi,fo),ca=new Le(hi,Vo),Eo=new Le(Yi,Vo),Pa=new Le(Ci/p,Go/p),na=new Le(zi/p,Ka/p),ha=l*Math.PI/180;if(ha){var Xs=Math.sin(ha),Ls=Math.cos(ha),Ea=[Ls,-Xs,Xs,Ls];ta._matMult(Ea),ka._matMult(Ea),Eo._matMult(Ea),ca._matMult(Ea)}var ws=ti.stretch+ti.fixed,qs=ri.stretch+ri.fixed;return{tl:ta,tr:ka,bl:Eo,br:ca,tex:{x:j.paddedRect.x+1+ws,y:j.paddedRect.y+1+qs,w:hn.stretch+hn.fixed-ws,h:An.stretch+An.fixed-qs},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Pa,pixelOffsetBR:na,minFontScaleX:bt/p/w,minFontScaleY:ft/p/D,isSDF:_}};if(S&&(j.stretchX||j.stretchY))for(var Pr=Mr(N,we,ie),Mn=Mr(W,ke,pe),yn=0;yn<Pr.length-1;yn++)for(var kr=Pr[yn],Ai=Pr[yn+1],$n=0;$n<Mn.length-1;$n++)F.push(br(kr,Mn[$n],Ai,Mn[$n+1]));else F.push(br({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:v+1},{fixed:0,stretch:m+1}));return F}function Xr(i,l,_){for(var S=0,F=0,j=i;F<j.length;F+=1){var p=j[F];S+=Math.max(l,Math.min(_,p[1]))-Math.max(l,Math.min(_,p[0]))}return S}function Mr(i,l,_){for(var S=[{fixed:-1,stretch:0}],F=0,j=i;F<j.length;F+=1){var p=j[F],v=p[0],m=p[1],w=S[S.length-1];S.push({fixed:v-w.stretch,stretch:w.stretch}),S.push({fixed:v-w.stretch,stretch:w.stretch+(m-v)})}return S.push({fixed:l+1,stretch:_}),S}function Bi(i,l,_,S){return i/l*_+S}function Ma(i,l,_,S){return i-l*_/S}var el=function(i,l,_,S,F,j,p,v,m,w){if(this.boxStartIndex=i.length,m){var D=j.top,N=j.bottom,W=j.collisionPadding;W&&(D-=W[1],N+=W[3]);var $=N-D;$>0&&($=Math.max(10,$),this.circleDiameter=$)}else{var ie=j.top*p-v,pe=j.bottom*p+v,we=j.left*p-v,ke=j.right*p+v,Ge=j.collisionPadding;if(Ge&&(we-=Ge[0]*p,ie-=Ge[1]*p,ke+=Ge[2]*p,pe+=Ge[3]*p),w){var ht=new Le(we,ie),mt=new Le(ke,ie),St=new Le(we,pe),xt=new Le(ke,pe),bt=w*Math.PI/180;ht._rotate(bt),mt._rotate(bt),St._rotate(bt),xt._rotate(bt),we=Math.min(ht.x,mt.x,St.x,xt.x),ke=Math.max(ht.x,mt.x,St.x,xt.x),ie=Math.min(ht.y,mt.y,St.y,xt.y),pe=Math.max(ht.y,mt.y,St.y,xt.y)}i.emplaceBack(l.x,l.y,we,ie,ke,pe,_,S,F)}this.boxEndIndex=i.length},st=function(i,l){if(i===void 0&&(i=[]),l===void 0&&(l=Et),this.data=i,this.length=this.data.length,this.compare=l,this.length>0)for(var _=(this.length>>1)-1;_>=0;_--)this._down(_)};function Et(i,l){return i<l?-1:i>l?1:0}function Vt(i,l,_){l===void 0&&(l=1),_===void 0&&(_=!1);for(var S=1/0,F=1/0,j=-1/0,p=-1/0,v=i[0],m=0;m<v.length;m++){var w=v[m];(!m||w.x<S)&&(S=w.x),(!m||w.y<F)&&(F=w.y),(!m||w.x>j)&&(j=w.x),(!m||w.y>p)&&(p=w.y)}var D=Math.min(j-S,p-F),N=D/2,W=new st([],Br);if(D===0)return new Le(S,F);for(var $=S;$<j;$+=D)for(var ie=F;ie<p;ie+=D)W.push(new Ir($+N,ie+N,N,i));for(var pe=function(Ge){for(var ht=0,mt=0,St=0,xt=Ge[0],bt=0,kt=xt.length,ft=kt-1;bt<kt;ft=bt++){var nr=xt[bt],br=xt[ft],Pr=nr.x*br.y-br.x*nr.y;mt+=(nr.x+br.x)*Pr,St+=(nr.y+br.y)*Pr,ht+=3*Pr}return new Ir(mt/ht,St/ht,0,Ge)}(i),we=W.length;W.length;){var ke=W.pop();(ke.d>pe.d||!pe.d)&&(pe=ke,_&&console.log("found best %d after %d probes",Math.round(1e4*ke.d)/1e4,we)),ke.max-pe.d<=l||(W.push(new Ir(ke.p.x-(N=ke.h/2),ke.p.y-N,N,i)),W.push(new Ir(ke.p.x+N,ke.p.y-N,N,i)),W.push(new Ir(ke.p.x-N,ke.p.y+N,N,i)),W.push(new Ir(ke.p.x+N,ke.p.y+N,N,i)),we+=4)}return _&&(console.log("num probes: "+we),console.log("best distance: "+pe.d)),pe.p}function Br(i,l){return l.max-i.max}function Ir(i,l,_,S){this.p=new Le(i,l),this.h=_,this.d=function(F,j){for(var p=!1,v=1/0,m=0;m<j.length;m++)for(var w=j[m],D=0,N=w.length,W=N-1;D<N;W=D++){var $=w[D],ie=w[W];$.y>F.y!=ie.y>F.y&&F.x<(ie.x-$.x)*(F.y-$.y)/(ie.y-$.y)+$.x&&(p=!p),v=Math.min(v,Zu(F,$,ie))}return(p?1:-1)*Math.sqrt(v)}(this.p,S),this.max=this.d+this.h*Math.SQRT2}st.prototype.push=function(i){this.data.push(i),this.length++,this._up(this.length-1)},st.prototype.pop=function(){if(this.length!==0){var i=this.data[0],l=this.data.pop();return this.length--,this.length>0&&(this.data[0]=l,this._down(0)),i}},st.prototype.peek=function(){return this.data[0]},st.prototype._up=function(i){for(var l=this.data,_=this.compare,S=l[i];i>0;){var F=i-1>>1,j=l[F];if(_(S,j)>=0)break;l[i]=j,i=F}l[i]=S},st.prototype._down=function(i){for(var l=this.data,_=this.compare,S=this.length>>1,F=l[i];i<S;){var j=1+(i<<1),p=l[j],v=j+1;if(v<this.length&&_(l[v],p)<0&&(j=v,p=l[v]),_(p,F)>=0)break;l[i]=p,i=j}l[i]=F};var Jt=Number.POSITIVE_INFINITY;function sr(i,l){return l[1]!==Jt?function(_,S,F){var j=0,p=0;switch(S=Math.abs(S),F=Math.abs(F),_){case"top-right":case"top-left":case"top":p=F-7;break;case"bottom-right":case"bottom-left":case"bottom":p=7-F}switch(_){case"top-right":case"bottom-right":case"right":j=-S;break;case"top-left":case"bottom-left":case"left":j=S}return[j,p]}(i,l[0],l[1]):function(_,S){var F=0,j=0;S<0&&(S=0);var p=S/Math.sqrt(2);switch(_){case"top-right":case"top-left":j=p-7;break;case"bottom-right":case"bottom-left":j=7-p;break;case"bottom":j=7-S;break;case"top":j=S-7}switch(_){case"top-right":case"bottom-right":F=-p;break;case"top-left":case"bottom-left":F=p;break;case"left":F=S;break;case"right":F=-S}return[F,j]}(i,l[0])}function lr(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Mt(i,l,_,S,F,j,p,v,m,w,D,N,W,$,ie){var pe=function(mt,St,xt,bt,kt,ft,nr,br){for(var Pr=bt.layout.get("text-rotate").evaluate(ft,{})*Math.PI/180,Mn=[],yn=0,kr=St.positionedLines;yn<kr.length;yn+=1)for(var Ai=kr[yn],$n=0,ti=Ai.positionedGlyphs;$n<ti.length;$n+=1){var ri=ti[$n];if(ri.rect){var hn=ri.rect||{},An=4,Yi=!0,Ci=1,fo=0,Go=(kt||br)&&ri.vertical,hi=ri.metrics.advance*ri.scale/2;if(br&&St.verticalizable&&(fo=Ai.lineOffset/2-(ri.imageName?-(24-ri.metrics.width*ri.scale)/2:24*(ri.scale-1))),ri.imageName){var zi=nr[ri.imageName];Yi=zi.sdf,An=1/(Ci=zi.pixelRatio)}var Vo=kt?[ri.x+hi,ri.y]:[0,0],Ka=kt?[0,0]:[ri.x+hi+xt[0],ri.y+xt[1]-fo],ta=[0,0];Go&&(ta=Ka,Ka=[0,0]);var ka=(ri.metrics.left-An)*ri.scale-hi+Ka[0],ca=(-ri.metrics.top-An)*ri.scale+Ka[1],Eo=ka+hn.w*ri.scale/Ci,Pa=ca+hn.h*ri.scale/Ci,na=new Le(ka,ca),ha=new Le(Eo,ca),Xs=new Le(ka,Pa),Ls=new Le(Eo,Pa);if(Go){var Ea=new Le(-hi,hi- -17),ws=-Math.PI/2,qs=12-hi,ua=new Le(22-qs,-(ri.imageName?qs:0)),cu=new(Function.prototype.bind.apply(Le,[null].concat(ta)));na._rotateAround(ws,Ea)._add(ua)._add(cu),ha._rotateAround(ws,Ea)._add(ua)._add(cu),Xs._rotateAround(ws,Ea)._add(ua)._add(cu),Ls._rotateAround(ws,Ea)._add(ua)._add(cu)}if(Pr){var c=Math.sin(Pr),o=Math.cos(Pr),f=[o,-c,c,o];na._matMult(f),ha._matMult(f),Xs._matMult(f),Ls._matMult(f)}var E=new Le(0,0),L=new Le(0,0);Mn.push({tl:na,tr:ha,bl:Xs,br:Ls,tex:hn,writingMode:St.writingMode,glyphOffset:Vo,sectionIndex:ri.sectionIndex,isSDF:Yi,pixelOffsetTL:E,pixelOffsetBR:L,minFontScaleX:0,minFontScaleY:0})}}return Mn}(0,_,v,F,j,p,S,i.allowVerticalPlacement),we=i.textSizeData,ke=null;we.kind==="source"?(ke=[128*F.layout.get("text-size").evaluate(p,{})])[0]>32640&&gr(i.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):we.kind==="composite"&&((ke=[128*$.compositeTextSizes[0].evaluate(p,{},ie),128*$.compositeTextSizes[1].evaluate(p,{},ie)])[0]>32640||ke[1]>32640)&&gr(i.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),i.addSymbols(i.text,pe,ke,v,j,p,w,l,m.lineStartIndex,m.lineLength,W,ie);for(var Ge=0,ht=D;Ge<ht.length;Ge+=1)N[ht[Ge]]=i.text.placedSymbolArray.length-1;return 4*pe.length}function Xt(i){for(var l in i)return i[l];return null}function pt(i,l,_,S){var F=i.compareText;if(l in F){for(var j=F[l],p=j.length-1;p>=0;p--)if(S.dist(j[p])<_)return!0}else F[l]=[];return F[l].push(S),!1}var $t=yp.VectorTileFeature.types,zr=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function $r(i,l,_,S,F,j,p,v,m,w,D,N,W){var $=v?Math.min(32640,Math.round(v[0])):0,ie=v?Math.min(32640,Math.round(v[1])):0;i.emplaceBack(l,_,Math.round(32*S),Math.round(32*F),j,p,($<<1)+(m?1:0),ie,16*w,16*D,256*N,256*W)}function Tn(i,l,_){i.emplaceBack(l.x,l.y,_),i.emplaceBack(l.x,l.y,_),i.emplaceBack(l.x,l.y,_),i.emplaceBack(l.x,l.y,_)}function vn(i){for(var l=0,_=i.sections;l<_.length;l+=1)if(wh(_[l].text))return!0;return!1}var _n=function(i){this.layoutVertexArray=new qc,this.indexArray=new s,this.programConfigurations=i,this.segments=new Ie,this.dynamicLayoutVertexArray=new Sh,this.opacityVertexArray=new nc,this.placedSymbolArray=new b};_n.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},_n.prototype.upload=function(i,l,_,S){this.isEmpty()||(_&&(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,Qf.members),this.indexBuffer=i.createIndexBuffer(this.indexArray,l),this.dynamicLayoutVertexBuffer=i.createVertexBuffer(this.dynamicLayoutVertexArray,cl.members,!0),this.opacityVertexBuffer=i.createVertexBuffer(this.opacityVertexArray,zr,!0),this.opacityVertexBuffer.itemSize=1),(_||S)&&this.programConfigurations.upload(i))},_n.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},fi("SymbolBuffers",_n);var Qn=function(i,l,_){this.layoutVertexArray=new i,this.layoutAttributes=l,this.indexArray=new _,this.segments=new Ie,this.collisionVertexArray=new z};Qn.prototype.upload=function(i){this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=i.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=i.createVertexBuffer(this.collisionVertexArray,zd.members,!0)},Qn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},fi("CollisionBuffers",Qn);var Fi=function(i){this.collisionBoxArray=i.collisionBoxArray,this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(function(j){return j.id}),this.index=i.index,this.pixelRatio=i.pixelRatio,this.sourceLayerIndex=i.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=yl([]),this.placementViewportMatrix=yl([]);var l=this.layers[0]._unevaluatedLayout._values;this.textSizeData=uu(this.zoom,l["text-size"]),this.iconSizeData=uu(this.zoom,l["icon-size"]);var _=this.layers[0].layout,S=_.get("symbol-sort-key"),F=_.get("symbol-z-order");this.canOverlap=_.get("text-allow-overlap")||_.get("icon-allow-overlap")||_.get("text-ignore-placement")||_.get("icon-ignore-placement"),this.sortFeaturesByKey=F!=="viewport-y"&&S.constantOr(1)!==void 0,this.sortFeaturesByY=(F==="viewport-y"||F==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,_.get("symbol-placement")==="point"&&(this.writingModes=_.get("text-writing-mode").map(function(j){return Wt[j]})),this.stateDependentLayerIds=this.layers.filter(function(j){return j.isStateDependent()}).map(function(j){return j.id}),this.sourceID=i.sourceID};Fi.prototype.createArrays=function(){this.text=new _n(new qi(this.layers,this.zoom,function(i){return/^text/.test(i)})),this.icon=new _n(new qi(this.layers,this.zoom,function(i){return/^icon/.test(i)})),this.glyphOffsetArray=new q,this.lineVertexArray=new te,this.symbolInstances=new G},Fi.prototype.calculateGlyphDependencies=function(i,l,_,S,F){for(var j=0;j<i.length;j++)if(l[i.charCodeAt(j)]=!0,(_||S)&&F){var p=Zt[i.charAt(j)];p&&(l[p.charCodeAt(0)]=!0)}},Fi.prototype.populate=function(i,l,_){var S=this.layers[0],F=S.layout,j=F.get("text-font"),p=F.get("text-field"),v=F.get("icon-image"),m=(p.value.kind!=="constant"||p.value.value instanceof Ba&&!p.value.value.isEmpty()||p.value.value.toString().length>0)&&(j.value.kind!=="constant"||j.value.value.length>0),w=v.value.kind!=="constant"||!!v.value.value||Object.keys(v.parameters).length>0,D=F.get("symbol-sort-key");if(this.features=[],m||w){for(var N=l.iconDependencies,W=l.glyphDependencies,$=l.availableImages,ie=new fa(this.zoom),pe=0,we=i;pe<we.length;pe+=1){var ke=we[pe],Ge=ke.feature,ht=ke.id,mt=ke.index,St=ke.sourceLayerIndex,xt=S._featureFilter.needGeometry,bt=$a(Ge,xt);if(S._featureFilter.filter(ie,bt,_)){xt||(bt.geometry=ja(Ge));var kt=void 0;if(m){var ft=S.getValueAndResolveTokens("text-field",bt,_,$),nr=Ba.factory(ft);vn(nr)&&(this.hasRTLText=!0),(!this.hasRTLText||rp()==="unavailable"||this.hasRTLText&&ql.isParsed())&&(kt=_t(nr,S,bt))}var br=void 0;if(w){var Pr=S.getValueAndResolveTokens("icon-image",bt,_,$);br=Pr instanceof Fa?Pr:Fa.fromString(Pr)}if(kt||br){var Mn=this.sortFeaturesByKey?D.evaluate(bt,{},_):void 0;if(this.features.push({id:ht,text:kt,icon:br,index:mt,sourceLayerIndex:St,geometry:bt.geometry,properties:Ge.properties,type:$t[Ge.type],sortKey:Mn}),br&&(N[br.name]=!0),kt){var yn=j.evaluate(bt,{},_).join(","),kr=F.get("text-rotation-alignment")==="map"&&F.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Wt.vertical)>=0;for(var Ai=0,$n=kt.sections;Ai<$n.length;Ai+=1){var ti=$n[Ai];if(ti.image)N[ti.image.name]=!0;else{var ri=Mc(kt.toString()),hn=ti.fontStack||yn,An=W[hn]=W[hn]||{};this.calculateGlyphDependencies(ti.text,An,kr,this.allowVerticalPlacement,ri)}}}}}}F.get("symbol-placement")==="line"&&(this.features=function(Yi){var Ci={},fo={},Go=[],hi=0;function zi(Ea){Go.push(Yi[Ea]),hi++}function Vo(Ea,ws,qs){var ua=fo[Ea];return delete fo[Ea],fo[ws]=ua,Go[ua].geometry[0].pop(),Go[ua].geometry[0]=Go[ua].geometry[0].concat(qs[0]),ua}function Ka(Ea,ws,qs){var ua=Ci[ws];return delete Ci[ws],Ci[Ea]=ua,Go[ua].geometry[0].shift(),Go[ua].geometry[0]=qs[0].concat(Go[ua].geometry[0]),ua}function ta(Ea,ws,qs){var ua=qs?ws[0][ws[0].length-1]:ws[0][0];return Ea+":"+ua.x+":"+ua.y}for(var ka=0;ka<Yi.length;ka++){var ca=Yi[ka],Eo=ca.geometry,Pa=ca.text?ca.text.toString():null;if(Pa){var na=ta(Pa,Eo),ha=ta(Pa,Eo,!0);if(na in fo&&ha in Ci&&fo[na]!==Ci[ha]){var Xs=Ka(na,ha,Eo),Ls=Vo(na,ha,Go[Xs].geometry);delete Ci[na],delete fo[ha],fo[ta(Pa,Go[Ls].geometry,!0)]=Ls,Go[Xs].geometry=null}else na in fo?Vo(na,ha,Eo):ha in Ci?Ka(na,ha,Eo):(zi(ka),Ci[na]=hi-1,fo[ha]=hi-1)}else zi(ka)}return Go.filter(function(Ea){return Ea.geometry})}(this.features)),this.sortFeaturesByKey&&this.features.sort(function(Yi,Ci){return Yi.sortKey-Ci.sortKey})}},Fi.prototype.update=function(i,l,_){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(i,l,this.layers,_),this.icon.programConfigurations.updatePaintArrays(i,l,this.layers,_))},Fi.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},Fi.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Fi.prototype.upload=function(i){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(i),this.iconCollisionBox.upload(i)),this.text.upload(i,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(i,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Fi.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Fi.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Fi.prototype.addToLineVertexArray=function(i,l){var _=this.lineVertexArray.length;if(i.segment!==void 0){for(var S=i.dist(l[i.segment+1]),F=i.dist(l[i.segment]),j={},p=i.segment+1;p<l.length;p++)j[p]={x:l[p].x,y:l[p].y,tileUnitDistanceFromAnchor:S},p<l.length-1&&(S+=l[p+1].dist(l[p]));for(var v=i.segment||0;v>=0;v--)j[v]={x:l[v].x,y:l[v].y,tileUnitDistanceFromAnchor:F},v>0&&(F+=l[v-1].dist(l[v]));for(var m=0;m<l.length;m++){var w=j[m];this.lineVertexArray.emplaceBack(w.x,w.y,w.tileUnitDistanceFromAnchor)}}return{lineStartIndex:_,lineLength:this.lineVertexArray.length-_}},Fi.prototype.addSymbols=function(i,l,_,S,F,j,p,v,m,w,D,N){for(var W=i.indexArray,$=i.layoutVertexArray,ie=i.segments.prepareSegment(4*l.length,$,W,this.canOverlap?j.sortKey:void 0),pe=this.glyphOffsetArray.length,we=ie.vertexLength,ke=this.allowVerticalPlacement&&p===Wt.vertical?Math.PI/2:0,Ge=j.text&&j.text.sections,ht=0;ht<l.length;ht++){var mt=l[ht],St=mt.tl,xt=mt.tr,bt=mt.bl,kt=mt.br,ft=mt.tex,nr=mt.pixelOffsetTL,br=mt.pixelOffsetBR,Pr=mt.minFontScaleX,Mn=mt.minFontScaleY,yn=mt.glyphOffset,kr=mt.isSDF,Ai=mt.sectionIndex,$n=ie.vertexLength,ti=yn[1];$r($,v.x,v.y,St.x,ti+St.y,ft.x,ft.y,_,kr,nr.x,nr.y,Pr,Mn),$r($,v.x,v.y,xt.x,ti+xt.y,ft.x+ft.w,ft.y,_,kr,br.x,nr.y,Pr,Mn),$r($,v.x,v.y,bt.x,ti+bt.y,ft.x,ft.y+ft.h,_,kr,nr.x,br.y,Pr,Mn),$r($,v.x,v.y,kt.x,ti+kt.y,ft.x+ft.w,ft.y+ft.h,_,kr,br.x,br.y,Pr,Mn),Tn(i.dynamicLayoutVertexArray,v,ke),W.emplaceBack($n,$n+1,$n+2),W.emplaceBack($n+1,$n+2,$n+3),ie.vertexLength+=4,ie.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(yn[0]),ht!==l.length-1&&Ai===l[ht+1].sectionIndex||i.programConfigurations.populatePaintArrays($.length,j,j.index,{},N,Ge&&Ge[Ai])}i.placedSymbolArray.emplaceBack(v.x,v.y,pe,this.glyphOffsetArray.length-pe,we,m,w,v.segment,_?_[0]:0,_?_[1]:0,S[0],S[1],p,0,!1,0,D)},Fi.prototype._addCollisionDebugVertex=function(i,l,_,S,F,j){return l.emplaceBack(0,0),i.emplaceBack(_.x,_.y,S,F,Math.round(j.x),Math.round(j.y))},Fi.prototype.addCollisionDebugVertices=function(i,l,_,S,F,j,p){var v=F.segments.prepareSegment(4,F.layoutVertexArray,F.indexArray),m=v.vertexLength,w=F.layoutVertexArray,D=F.collisionVertexArray,N=p.anchorX,W=p.anchorY;this._addCollisionDebugVertex(w,D,j,N,W,new Le(i,l)),this._addCollisionDebugVertex(w,D,j,N,W,new Le(_,l)),this._addCollisionDebugVertex(w,D,j,N,W,new Le(_,S)),this._addCollisionDebugVertex(w,D,j,N,W,new Le(i,S)),v.vertexLength+=4;var $=F.indexArray;$.emplaceBack(m,m+1),$.emplaceBack(m+1,m+2),$.emplaceBack(m+2,m+3),$.emplaceBack(m+3,m),v.primitiveLength+=4},Fi.prototype.addDebugCollisionBoxes=function(i,l,_,S){for(var F=i;F<l;F++){var j=this.collisionBoxArray.get(F);this.addCollisionDebugVertices(j.x1,j.y1,j.x2,j.y2,S?this.textCollisionBox:this.iconCollisionBox,j.anchorPoint,_)}},Fi.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Qn(Th,Fc.members,ne),this.iconCollisionBox=new Qn(Th,Fc.members,ne);for(var i=0;i<this.symbolInstances.length;i++){var l=this.symbolInstances.get(i);this.addDebugCollisionBoxes(l.textBoxStartIndex,l.textBoxEndIndex,l,!0),this.addDebugCollisionBoxes(l.verticalTextBoxStartIndex,l.verticalTextBoxEndIndex,l,!0),this.addDebugCollisionBoxes(l.iconBoxStartIndex,l.iconBoxEndIndex,l,!1),this.addDebugCollisionBoxes(l.verticalIconBoxStartIndex,l.verticalIconBoxEndIndex,l,!1)}},Fi.prototype._deserializeCollisionBoxesForSymbol=function(i,l,_,S,F,j,p,v,m){for(var w={},D=l;D<_;D++){var N=i.get(D);w.textBox={x1:N.x1,y1:N.y1,x2:N.x2,y2:N.y2,anchorPointX:N.anchorPointX,anchorPointY:N.anchorPointY},w.textFeatureIndex=N.featureIndex;break}for(var W=S;W<F;W++){var $=i.get(W);w.verticalTextBox={x1:$.x1,y1:$.y1,x2:$.x2,y2:$.y2,anchorPointX:$.anchorPointX,anchorPointY:$.anchorPointY},w.verticalTextFeatureIndex=$.featureIndex;break}for(var ie=j;ie<p;ie++){var pe=i.get(ie);w.iconBox={x1:pe.x1,y1:pe.y1,x2:pe.x2,y2:pe.y2,anchorPointX:pe.anchorPointX,anchorPointY:pe.anchorPointY},w.iconFeatureIndex=pe.featureIndex;break}for(var we=v;we<m;we++){var ke=i.get(we);w.verticalIconBox={x1:ke.x1,y1:ke.y1,x2:ke.x2,y2:ke.y2,anchorPointX:ke.anchorPointX,anchorPointY:ke.anchorPointY},w.verticalIconFeatureIndex=ke.featureIndex;break}return w},Fi.prototype.deserializeCollisionBoxes=function(i){this.collisionArrays=[];for(var l=0;l<this.symbolInstances.length;l++){var _=this.symbolInstances.get(l);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(i,_.textBoxStartIndex,_.textBoxEndIndex,_.verticalTextBoxStartIndex,_.verticalTextBoxEndIndex,_.iconBoxStartIndex,_.iconBoxEndIndex,_.verticalIconBoxStartIndex,_.verticalIconBoxEndIndex))}},Fi.prototype.hasTextData=function(){return this.text.segments.get().length>0},Fi.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Fi.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Fi.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Fi.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Fi.prototype.addIndicesForPlacedSymbol=function(i,l){for(var _=i.placedSymbolArray.get(l),S=_.vertexStartIndex+4*_.numGlyphs,F=_.vertexStartIndex;F<S;F+=4)i.indexArray.emplaceBack(F,F+1,F+2),i.indexArray.emplaceBack(F+1,F+2,F+3)},Fi.prototype.getSortedSymbolIndexes=function(i){if(this.sortedAngle===i&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var l=Math.sin(i),_=Math.cos(i),S=[],F=[],j=[],p=0;p<this.symbolInstances.length;++p){j.push(p);var v=this.symbolInstances.get(p);S.push(0|Math.round(l*v.anchorX+_*v.anchorY)),F.push(v.featureIndex)}return j.sort(function(m,w){return S[m]-S[w]||F[w]-F[m]}),j},Fi.prototype.addToSortKeyRanges=function(i,l){var _=this.sortKeyRanges[this.sortKeyRanges.length-1];_&&_.sortKey===l?_.symbolInstanceEnd=i+1:this.sortKeyRanges.push({sortKey:l,symbolInstanceStart:i,symbolInstanceEnd:i+1})},Fi.prototype.sortFeatures=function(i){var l=this;if(this.sortFeaturesByY&&this.sortedAngle!==i&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(i),this.sortedAngle=i,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var _=0,S=this.symbolInstanceIndexes;_<S.length;_+=1){var F=this.symbolInstances.get(S[_]);this.featureSortOrder.push(F.featureIndex),[F.rightJustifiedTextSymbolIndex,F.centerJustifiedTextSymbolIndex,F.leftJustifiedTextSymbolIndex].forEach(function(j,p,v){j>=0&&v.indexOf(j)===p&&l.addIndicesForPlacedSymbol(l.text,j)}),F.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,F.verticalPlacedTextSymbolIndex),F.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,F.placedIconSymbolIndex),F.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,F.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},fi("SymbolBucket",Fi,{omit:["layers","collisionBoxArray","features","compareText"]}),Fi.MAX_GLYPHS=65535,Fi.addDynamicAttributes=Tn;var Vr=new Gs({"symbol-placement":new Gi(Ae.layout_symbol["symbol-placement"]),"symbol-spacing":new Gi(Ae.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Gi(Ae.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Si(Ae.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Gi(Ae.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Gi(Ae.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Gi(Ae.layout_symbol["icon-ignore-placement"]),"icon-optional":new Gi(Ae.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Gi(Ae.layout_symbol["icon-rotation-alignment"]),"icon-size":new Si(Ae.layout_symbol["icon-size"]),"icon-text-fit":new Gi(Ae.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Gi(Ae.layout_symbol["icon-text-fit-padding"]),"icon-image":new Si(Ae.layout_symbol["icon-image"]),"icon-rotate":new Si(Ae.layout_symbol["icon-rotate"]),"icon-padding":new Gi(Ae.layout_symbol["icon-padding"]),"icon-keep-upright":new Gi(Ae.layout_symbol["icon-keep-upright"]),"icon-offset":new Si(Ae.layout_symbol["icon-offset"]),"icon-anchor":new Si(Ae.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Gi(Ae.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Gi(Ae.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Gi(Ae.layout_symbol["text-rotation-alignment"]),"text-field":new Si(Ae.layout_symbol["text-field"]),"text-font":new Si(Ae.layout_symbol["text-font"]),"text-size":new Si(Ae.layout_symbol["text-size"]),"text-max-width":new Si(Ae.layout_symbol["text-max-width"]),"text-line-height":new Gi(Ae.layout_symbol["text-line-height"]),"text-letter-spacing":new Si(Ae.layout_symbol["text-letter-spacing"]),"text-justify":new Si(Ae.layout_symbol["text-justify"]),"text-radial-offset":new Si(Ae.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Gi(Ae.layout_symbol["text-variable-anchor"]),"text-anchor":new Si(Ae.layout_symbol["text-anchor"]),"text-max-angle":new Gi(Ae.layout_symbol["text-max-angle"]),"text-writing-mode":new Gi(Ae.layout_symbol["text-writing-mode"]),"text-rotate":new Si(Ae.layout_symbol["text-rotate"]),"text-padding":new Gi(Ae.layout_symbol["text-padding"]),"text-keep-upright":new Gi(Ae.layout_symbol["text-keep-upright"]),"text-transform":new Si(Ae.layout_symbol["text-transform"]),"text-offset":new Si(Ae.layout_symbol["text-offset"]),"text-allow-overlap":new Gi(Ae.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Gi(Ae.layout_symbol["text-ignore-placement"]),"text-optional":new Gi(Ae.layout_symbol["text-optional"])}),po={paint:new Gs({"icon-opacity":new Si(Ae.paint_symbol["icon-opacity"]),"icon-color":new Si(Ae.paint_symbol["icon-color"]),"icon-halo-color":new Si(Ae.paint_symbol["icon-halo-color"]),"icon-halo-width":new Si(Ae.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Si(Ae.paint_symbol["icon-halo-blur"]),"icon-translate":new Gi(Ae.paint_symbol["icon-translate"]),"icon-translate-anchor":new Gi(Ae.paint_symbol["icon-translate-anchor"]),"text-opacity":new Si(Ae.paint_symbol["text-opacity"]),"text-color":new Si(Ae.paint_symbol["text-color"],{runtimeType:En,getOverride:function(i){return i.textColor},hasOverride:function(i){return!!i.textColor}}),"text-halo-color":new Si(Ae.paint_symbol["text-halo-color"]),"text-halo-width":new Si(Ae.paint_symbol["text-halo-width"]),"text-halo-blur":new Si(Ae.paint_symbol["text-halo-blur"]),"text-translate":new Gi(Ae.paint_symbol["text-translate"]),"text-translate-anchor":new Gi(Ae.paint_symbol["text-translate-anchor"])}),layout:Vr},la=function(i){this.type=i.property.overrides?i.property.overrides.runtimeType:xn,this.defaultValue=i};la.prototype.evaluate=function(i){if(i.formattedSection){var l=this.defaultValue.property.overrides;if(l&&l.hasOverride(i.formattedSection))return l.getOverride(i.formattedSection)}return i.feature&&i.featureState?this.defaultValue.evaluate(i.feature,i.featureState):this.defaultValue.property.specification.default},la.prototype.eachChild=function(i){this.defaultValue.isConstant()||i(this.defaultValue.value._styleExpression.expression)},la.prototype.outputDefined=function(){return!1},la.prototype.serialize=function(){return null},fi("FormatSectionOverride",la,{omit:["defaultValue"]});var Ns=function(i){function l(_){i.call(this,_,po)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.recalculate=function(_,S){if(i.prototype.recalculate.call(this,_,S),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var F=this.layout.get("text-writing-mode");if(F){for(var j=[],p=0,v=F;p<v.length;p+=1){var m=v[p];j.indexOf(m)<0&&j.push(m)}this.layout._values["text-writing-mode"]=j}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},l.prototype.getValueAndResolveTokens=function(_,S,F,j){var p=this.layout.get(_).evaluate(S,{},F,j),v=this._unevaluatedLayout._values[_];return v.isDataDriven()||bh(v.value)||!p?p:function(m,w){return w.replace(/{([^{}]+)}/g,function(D,N){return N in m?String(m[N]):""})}(S.properties,p)},l.prototype.createBucket=function(_){return new Fi(_)},l.prototype.queryRadius=function(){return 0},l.prototype.queryIntersectsFeature=function(){return!1},l.prototype._setPaintOverrides=function(){for(var _=0,S=po.paint.overridableProperties;_<S.length;_+=1){var F=S[_];if(l.hasPaintOverride(this.layout,F)){var j,p=this.paint.get(F),v=new la(p),m=new tc(v,p.property.specification);j=p.value.kind==="constant"||p.value.kind==="source"?new Kh("source",m):new Zc("composite",m,p.value.zoomStops,p.value._interpolationType),this.paint._values[F]=new Nu(p.property,j,p.parameters)}}},l.prototype._handleOverridablePaintPropertyUpdate=function(_,S,F){return!(!this.layout||S.isDataDriven()||F.isDataDriven())&&l.hasPaintOverride(this.layout,_)},l.hasPaintOverride=function(_,S){var F=_.get("text-field"),j=po.paint.properties[S],p=!1,v=function(D){for(var N=0,W=D;N<W.length;N+=1)if(j.overrides&&j.overrides.hasOverride(W[N]))return void(p=!0)};if(F.value.kind==="constant"&&F.value.value instanceof Ba)v(F.value.value.sections);else if(F.value.kind==="source"){var m=function(D){p||(D instanceof il&&oa(D.value)===ia?v(D.value.sections):D instanceof Ds?v(D.sections):D.eachChild(m))},w=F.value;w._styleExpression&&m(w._styleExpression.expression)}return p},l}(Lc),Fl={paint:new Gs({"background-color":new Gi(Ae.paint_background["background-color"]),"background-pattern":new ao(Ae.paint_background["background-pattern"]),"background-opacity":new Gi(Ae.paint_background["background-opacity"])})},ic=function(i){function l(_){i.call(this,_,Fl)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l}(Lc),ed={paint:new Gs({"raster-opacity":new Gi(Ae.paint_raster["raster-opacity"]),"raster-hue-rotate":new Gi(Ae.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Gi(Ae.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Gi(Ae.paint_raster["raster-brightness-max"]),"raster-saturation":new Gi(Ae.paint_raster["raster-saturation"]),"raster-contrast":new Gi(Ae.paint_raster["raster-contrast"]),"raster-resampling":new Gi(Ae.paint_raster["raster-resampling"]),"raster-fade-duration":new Gi(Ae.paint_raster["raster-fade-duration"])})},Ch=function(i){function l(_){i.call(this,_,ed)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l}(Lc),Sd=function(i){function l(_){i.call(this,_,{}),this.implementation=_}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},l.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},l.prototype.recalculate=function(){},l.prototype.updateTransitions=function(){},l.prototype.hasTransition=function(){},l.prototype.serialize=function(){},l.prototype.onAdd=function(_){this.implementation.onAdd&&this.implementation.onAdd(_,_.painter.context.gl)},l.prototype.onRemove=function(_){this.implementation.onRemove&&this.implementation.onRemove(_,_.painter.context.gl)},l}(Lc),Up={circle:yf,heatmap:fh,hillshade:ld,fill:cd,"fill-extrusion":rm,line:am,symbol:Ns,background:ic,raster:Ch},td=Ce.HTMLImageElement,dd=Ce.HTMLCanvasElement,Zp=Ce.HTMLVideoElement,wf=Ce.ImageData,Td=Ce.ImageBitmap,Sf=function(i,l,_,S){this.context=i,this.format=_,this.texture=i.gl.createTexture(),this.update(l,S)};Sf.prototype.update=function(i,l,_){var S=i.width,F=i.height,j=!(this.size&&this.size[0]===S&&this.size[1]===F||_),p=this.context,v=p.gl;if(this.useMipmap=!!(l&&l.useMipmap),v.bindTexture(v.TEXTURE_2D,this.texture),p.pixelStoreUnpackFlipY.set(!1),p.pixelStoreUnpack.set(1),p.pixelStoreUnpackPremultiplyAlpha.set(this.format===v.RGBA&&(!l||l.premultiply!==!1)),j)this.size=[S,F],i instanceof td||i instanceof dd||i instanceof Zp||i instanceof wf||Td&&i instanceof Td?v.texImage2D(v.TEXTURE_2D,0,this.format,this.format,v.UNSIGNED_BYTE,i):v.texImage2D(v.TEXTURE_2D,0,this.format,S,F,0,this.format,v.UNSIGNED_BYTE,i.data);else{var m=_||{x:0,y:0},w=m.x,D=m.y;i instanceof td||i instanceof dd||i instanceof Zp||i instanceof wf||Td&&i instanceof Td?v.texSubImage2D(v.TEXTURE_2D,0,w,D,v.RGBA,v.UNSIGNED_BYTE,i):v.texSubImage2D(v.TEXTURE_2D,0,w,D,S,F,v.RGBA,v.UNSIGNED_BYTE,i.data)}this.useMipmap&&this.isSizePowerOfTwo()&&v.generateMipmap(v.TEXTURE_2D)},Sf.prototype.bind=function(i,l,_){var S=this.context.gl;S.bindTexture(S.TEXTURE_2D,this.texture),_!==S.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(_=S.LINEAR),i!==this.filter&&(S.texParameteri(S.TEXTURE_2D,S.TEXTURE_MAG_FILTER,i),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_MIN_FILTER,_||i),this.filter=i),l!==this.wrap&&(S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_S,l),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_T,l),this.wrap=l)},Sf.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Sf.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var sm=function(i){var l=this;this._callback=i,this._triggered=!1,typeof MessageChannel!="undefined"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){l._triggered=!1,l._callback()})};sm.prototype.trigger=function(){var i=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){i._triggered=!1,i._callback()},0))},sm.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Ud=function(i,l,_){this.target=i,this.parent=l,this.mapId=_,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},Jn(["receive","process"],this),this.invoker=new sm(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=qe()?i:Ce};function Ad(i,l,_){var S=2*Math.PI*6378137/256/Math.pow(2,_);return[i*S-2*Math.PI*6378137/2,l*S-2*Math.PI*6378137/2]}Ud.prototype.send=function(i,l,_,S,F){var j=this;F===void 0&&(F=!1);var p=Math.round(1e18*Math.random()).toString(36).substring(0,10);_&&(this.callbacks[p]=_);var v=Pt(this.globalScope)?void 0:[];return this.target.postMessage({id:p,type:i,hasCallback:!!_,targetMapId:S,mustQueue:F,sourceMapId:this.mapId,data:ai(l,v)},v),{cancel:function(){_&&delete j.callbacks[p],j.target.postMessage({id:p,type:"<cancel>",targetMapId:S,sourceMapId:j.mapId})}}},Ud.prototype.receive=function(i){var l=i.data,_=l.id;if(_&&(!l.targetMapId||this.mapId===l.targetMapId))if(l.type==="<cancel>"){delete this.tasks[_];var S=this.cancelCallbacks[_];delete this.cancelCallbacks[_],S&&S()}else qe()||l.mustQueue?(this.tasks[_]=l,this.taskQueue.push(_),this.invoker.trigger()):this.processTask(_,l)},Ud.prototype.process=function(){if(this.taskQueue.length){var i=this.taskQueue.shift(),l=this.tasks[i];delete this.tasks[i],this.taskQueue.length&&this.invoker.trigger(),l&&this.processTask(i,l)}},Ud.prototype.processTask=function(i,l){var _=this;if(l.type==="<response>"){var S=this.callbacks[i];delete this.callbacks[i],S&&(l.error?S(is(l.error)):S(null,is(l.data)))}else{var F=!1,j=Pt(this.globalScope)?void 0:[],p=l.hasCallback?function(D,N){F=!0,delete _.cancelCallbacks[i],_.target.postMessage({id:i,type:"<response>",sourceMapId:_.mapId,error:D?ai(D):null,data:ai(N,j)},j)}:function(D){F=!0},v=null,m=is(l.data);if(this.parent[l.type])v=this.parent[l.type](l.sourceMapId,m,p);else if(this.parent.getWorkerSource){var w=l.type.split(".");v=this.parent.getWorkerSource(l.sourceMapId,w[0],m.source)[w[1]](m,p)}else p(new Error("Could not find function "+l.type));!F&&v&&v.cancel&&(this.cancelCallbacks[i]=v.cancel)}},Ud.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Bu=function(i,l){i&&(l?this.setSouthWest(i).setNorthEast(l):i.length===4?this.setSouthWest([i[0],i[1]]).setNorthEast([i[2],i[3]]):this.setSouthWest(i[0]).setNorthEast(i[1]))};Bu.prototype.setNorthEast=function(i){return this._ne=i instanceof nu?new nu(i.lng,i.lat):nu.convert(i),this},Bu.prototype.setSouthWest=function(i){return this._sw=i instanceof nu?new nu(i.lng,i.lat):nu.convert(i),this},Bu.prototype.extend=function(i){var l,_,S=this._sw,F=this._ne;if(i instanceof nu)l=i,_=i;else{if(!(i instanceof Bu))return Array.isArray(i)?i.length===4||i.every(Array.isArray)?this.extend(Bu.convert(i)):this.extend(nu.convert(i)):this;if(_=i._ne,!(l=i._sw)||!_)return this}return S||F?(S.lng=Math.min(l.lng,S.lng),S.lat=Math.min(l.lat,S.lat),F.lng=Math.max(_.lng,F.lng),F.lat=Math.max(_.lat,F.lat)):(this._sw=new nu(l.lng,l.lat),this._ne=new nu(_.lng,_.lat)),this},Bu.prototype.getCenter=function(){return new nu((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Bu.prototype.getSouthWest=function(){return this._sw},Bu.prototype.getNorthEast=function(){return this._ne},Bu.prototype.getNorthWest=function(){return new nu(this.getWest(),this.getNorth())},Bu.prototype.getSouthEast=function(){return new nu(this.getEast(),this.getSouth())},Bu.prototype.getWest=function(){return this._sw.lng},Bu.prototype.getSouth=function(){return this._sw.lat},Bu.prototype.getEast=function(){return this._ne.lng},Bu.prototype.getNorth=function(){return this._ne.lat},Bu.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Bu.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Bu.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Bu.prototype.contains=function(i){var l=nu.convert(i),_=l.lng,S=l.lat,F=this._sw.lng<=_&&_<=this._ne.lng;return this._sw.lng>this._ne.lng&&(F=this._sw.lng>=_&&_>=this._ne.lng),this._sw.lat<=S&&S<=this._ne.lat&&F},Bu.convert=function(i){return!i||i instanceof Bu?i:new Bu(i)};var nu=function(i,l){if(isNaN(i)||isNaN(l))throw new Error("Invalid LngLat object: ("+i+", "+l+")");if(this.lng=+i,this.lat=+l,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};nu.prototype.wrap=function(){return new nu(et(this.lng,-180,180),this.lat)},nu.prototype.toArray=function(){return[this.lng,this.lat]},nu.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},nu.prototype.distanceTo=function(i){var l=Math.PI/180,_=this.lat*l,S=i.lat*l,F=Math.sin(_)*Math.sin(S)+Math.cos(_)*Math.cos(S)*Math.cos((i.lng-this.lng)*l);return 63710088e-1*Math.acos(Math.min(F,1))},nu.prototype.toBounds=function(i){i===void 0&&(i=0);var l=360*i/40075017,_=l/Math.cos(Math.PI/180*this.lat);return new Bu(new nu(this.lng-_,this.lat-l),new nu(this.lng+_,this.lat+l))},nu.convert=function(i){if(i instanceof nu)return i;if(Array.isArray(i)&&(i.length===2||i.length===3))return new nu(Number(i[0]),Number(i[1]));if(!Array.isArray(i)&&typeof i=="object"&&i!==null)return new nu(Number("lng"in i?i.lng:i.lon),Number(i.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var lm=2*Math.PI*63710088e-1;function Cd(i){return lm*Math.cos(i*Math.PI/180)}function rd(i){return(180+i)/360}function bm(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function Nr(i,l){return i/Cd(l)}function um(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}var Tf=function(i,l,_){_===void 0&&(_=0),this.x=+i,this.y=+l,this.z=+_};Tf.fromLngLat=function(i,l){l===void 0&&(l=0);var _=nu.convert(i);return new Tf(rd(_.lng),bm(_.lat),Nr(l,_.lat))},Tf.prototype.toLngLat=function(){return new nu(360*this.x-180,um(this.y))},Tf.prototype.toAltitude=function(){return this.z*Cd(um(this.y))},Tf.prototype.meterInMercatorCoordinateUnits=function(){return 1/lm*(i=um(this.y),1/Math.cos(i*Math.PI/180));var i};var Mp=function(i,l,_){this.z=i,this.x=l,this.y=_,this.key=cm(0,i,i,l,_)};Mp.prototype.equals=function(i){return this.z===i.z&&this.x===i.x&&this.y===i.y},Mp.prototype.url=function(i,l){var _,S,F,j,p,v=(S=this.y,F=this.z,j=Ad(256*(_=this.x),256*(S=Math.pow(2,F)-S-1),F),p=Ad(256*(_+1),256*(S+1),F),j[0]+","+j[1]+","+p[0]+","+p[1]),m=function(w,D,N){for(var W,$="",ie=w;ie>0;ie--)$+=(D&(W=1<<ie-1)?1:0)+(N&W?2:0);return $}(this.z,this.x,this.y);return i[(this.x+this.y)%i.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(l==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",m).replace("{bbox-epsg-3857}",v)},Mp.prototype.getTilePoint=function(i){var l=Math.pow(2,this.z);return new Le(8192*(i.x*l-this.x),8192*(i.y*l-this.y))},Mp.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Bm=function(i,l){this.wrap=i,this.canonical=l,this.key=cm(i,l.z,l.z,l.x,l.y)},Kr=function(i,l,_,S,F){this.overscaledZ=i,this.wrap=l,this.canonical=new Mp(_,+S,+F),this.key=cm(l,i,_,S,F)};function cm(i,l,_,S,F){(i*=2)<0&&(i=-1*i-1);var j=1<<_;return(j*j*i+j*F+S).toString(36)+_.toString(36)+l.toString(36)}Kr.prototype.equals=function(i){return this.overscaledZ===i.overscaledZ&&this.wrap===i.wrap&&this.canonical.equals(i.canonical)},Kr.prototype.scaledTo=function(i){var l=this.canonical.z-i;return i>this.canonical.z?new Kr(i,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Kr(i,this.wrap,i,this.canonical.x>>l,this.canonical.y>>l)},Kr.prototype.calculateScaledKey=function(i,l){var _=this.canonical.z-i;return i>this.canonical.z?cm(this.wrap*+l,i,this.canonical.z,this.canonical.x,this.canonical.y):cm(this.wrap*+l,i,i,this.canonical.x>>_,this.canonical.y>>_)},Kr.prototype.isChildOf=function(i){if(i.wrap!==this.wrap)return!1;var l=this.canonical.z-i.canonical.z;return i.overscaledZ===0||i.overscaledZ<this.overscaledZ&&i.canonical.x===this.canonical.x>>l&&i.canonical.y===this.canonical.y>>l},Kr.prototype.children=function(i){if(this.overscaledZ>=i)return[new Kr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var l=this.canonical.z+1,_=2*this.canonical.x,S=2*this.canonical.y;return[new Kr(l,this.wrap,l,_,S),new Kr(l,this.wrap,l,_+1,S),new Kr(l,this.wrap,l,_,S+1),new Kr(l,this.wrap,l,_+1,S+1)]},Kr.prototype.isLessThan=function(i){return this.wrap<i.wrap||!(this.wrap>i.wrap)&&(this.overscaledZ<i.overscaledZ||!(this.overscaledZ>i.overscaledZ)&&(this.canonical.x<i.canonical.x||!(this.canonical.x>i.canonical.x)&&this.canonical.y<i.canonical.y))},Kr.prototype.wrapped=function(){return new Kr(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Kr.prototype.unwrapTo=function(i){return new Kr(this.overscaledZ,i,this.canonical.z,this.canonical.x,this.canonical.y)},Kr.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Kr.prototype.toUnwrapped=function(){return new Bm(this.wrap,this.canonical)},Kr.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Kr.prototype.getTilePoint=function(i){return this.canonical.getTilePoint(new Tf(i.x-this.wrap,i.y))},fi("CanonicalTileID",Mp),fi("OverscaledTileID",Kr,{omit:["posMatrix"]});var Af=function(i,l,_){if(this.uid=i,l.height!==l.width)throw new RangeError("DEM tiles must be square");if(_&&_!=="mapbox"&&_!=="terrarium")return gr('"'+_+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=l.height;var S=this.dim=l.height-2;this.data=new Uint32Array(l.data.buffer),this.encoding=_||"mapbox";for(var F=0;F<S;F++)this.data[this._idx(-1,F)]=this.data[this._idx(0,F)],this.data[this._idx(S,F)]=this.data[this._idx(S-1,F)],this.data[this._idx(F,-1)]=this.data[this._idx(F,0)],this.data[this._idx(F,S)]=this.data[this._idx(F,S-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(S,-1)]=this.data[this._idx(S-1,0)],this.data[this._idx(-1,S)]=this.data[this._idx(0,S-1)],this.data[this._idx(S,S)]=this.data[this._idx(S-1,S-1)]};Af.prototype.get=function(i,l){var _=new Uint8Array(this.data.buffer),S=4*this._idx(i,l);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(_[S],_[S+1],_[S+2])},Af.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Af.prototype._idx=function(i,l){if(i<-1||i>=this.dim+1||l<-1||l>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(l+1)*this.stride+(i+1)},Af.prototype._unpackMapbox=function(i,l,_){return(256*i*256+256*l+_)/10-1e4},Af.prototype._unpackTerrarium=function(i,l,_){return 256*i+l+_/256-32768},Af.prototype.getPixels=function(){return new _s({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Af.prototype.backfillBorder=function(i,l,_){if(this.dim!==i.dim)throw new Error("dem dimension mismatch");var S=l*this.dim,F=l*this.dim+this.dim,j=_*this.dim,p=_*this.dim+this.dim;switch(l){case-1:S=F-1;break;case 1:F=S+1}switch(_){case-1:j=p-1;break;case 1:p=j+1}for(var v=-l*this.dim,m=-_*this.dim,w=j;w<p;w++)for(var D=S;D<F;D++)this.data[this._idx(D,w)]=i.data[this._idx(D+v,w+m)]},fi("DEMData",Af);var hm=function(i){this._stringToNumber={},this._numberToString=[];for(var l=0;l<i.length;l++){var _=i[l];this._stringToNumber[_]=l,this._numberToString[l]=_}};hm.prototype.encode=function(i){return this._stringToNumber[i]},hm.prototype.decode=function(i){return this._numberToString[i]};var Em=function(i,l,_,S,F){this.type="Feature",this._vectorTileFeature=i,i._z=l,i._x=_,i._y=S,this.properties=i.properties,this.id=F},wm={geometry:{configurable:!0}};wm.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},wm.geometry.set=function(i){this._geometry=i},Em.prototype.toJSON=function(){var i={geometry:this.geometry};for(var l in this)l!=="_geometry"&&l!=="_vectorTileFeature"&&(i[l]=this[l]);return i},Object.defineProperties(Em.prototype,wm);var Md=function(){this.state={},this.stateChanges={},this.deletedStates={}};Md.prototype.updateState=function(i,l,_){var S=String(l);if(this.stateChanges[i]=this.stateChanges[i]||{},this.stateChanges[i][S]=this.stateChanges[i][S]||{},er(this.stateChanges[i][S],_),this.deletedStates[i]===null)for(var F in this.deletedStates[i]={},this.state[i])F!==S&&(this.deletedStates[i][F]=null);else if(this.deletedStates[i]&&this.deletedStates[i][S]===null)for(var j in this.deletedStates[i][S]={},this.state[i][S])_[j]||(this.deletedStates[i][S][j]=null);else for(var p in _)this.deletedStates[i]&&this.deletedStates[i][S]&&this.deletedStates[i][S][p]===null&&delete this.deletedStates[i][S][p]},Md.prototype.removeFeatureState=function(i,l,_){if(this.deletedStates[i]!==null){var S=String(l);if(this.deletedStates[i]=this.deletedStates[i]||{},_&&l!==void 0)this.deletedStates[i][S]!==null&&(this.deletedStates[i][S]=this.deletedStates[i][S]||{},this.deletedStates[i][S][_]=null);else if(l!==void 0)if(this.stateChanges[i]&&this.stateChanges[i][S])for(_ in this.deletedStates[i][S]={},this.stateChanges[i][S])this.deletedStates[i][S][_]=null;else this.deletedStates[i][S]=null;else this.deletedStates[i]=null}},Md.prototype.getState=function(i,l){var _=String(l),S=er({},(this.state[i]||{})[_],(this.stateChanges[i]||{})[_]);if(this.deletedStates[i]===null)return{};if(this.deletedStates[i]){var F=this.deletedStates[i][l];if(F===null)return{};for(var j in F)delete S[j]}return S},Md.prototype.initializeTileState=function(i,l){i.setFeatureState(this.state,l)},Md.prototype.coalesceChanges=function(i,l){var _={};for(var S in this.stateChanges){this.state[S]=this.state[S]||{};var F={};for(var j in this.stateChanges[S])this.state[S][j]||(this.state[S][j]={}),er(this.state[S][j],this.stateChanges[S][j]),F[j]=this.state[S][j];_[S]=F}for(var p in this.deletedStates){this.state[p]=this.state[p]||{};var v={};if(this.deletedStates[p]===null)for(var m in this.state[p])v[m]={},this.state[p][m]={};else for(var w in this.deletedStates[p]){if(this.deletedStates[p][w]===null)this.state[p][w]={};else for(var D=0,N=Object.keys(this.deletedStates[p][w]);D<N.length;D+=1)delete this.state[p][w][N[D]];v[w]=this.state[p][w]}_[p]=_[p]||{},er(_[p],v)}if(this.stateChanges={},this.deletedStates={},Object.keys(_).length!==0)for(var W in i)i[W].setFeatureState(_,l)};var cf=function(i,l){this.tileID=i,this.x=i.canonical.x,this.y=i.canonical.y,this.z=i.canonical.z,this.grid=new Ul(8192,16,0),this.grid3D=new Ul(8192,16,0),this.featureIndexArray=new ce,this.promoteId=l};function nd(i,l,_,S,F){return pa(i,function(j,p){var v=l instanceof Qp?l.get(p):null;return v&&v.evaluate?v.evaluate(_,S,F):v})}function Sm(i){for(var l=1/0,_=1/0,S=-1/0,F=-1/0,j=0,p=i;j<p.length;j+=1){var v=p[j];l=Math.min(l,v.x),_=Math.min(_,v.y),S=Math.max(S,v.x),F=Math.max(F,v.y)}return{minX:l,minY:_,maxX:S,maxY:F}}function qm(i,l){return l-i}cf.prototype.insert=function(i,l,_,S,F,j){var p=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(_,S,F);for(var v=j?this.grid3D:this.grid,m=0;m<l.length;m++){for(var w=l[m],D=[1/0,1/0,-1/0,-1/0],N=0;N<w.length;N++){var W=w[N];D[0]=Math.min(D[0],W.x),D[1]=Math.min(D[1],W.y),D[2]=Math.max(D[2],W.x),D[3]=Math.max(D[3],W.y)}D[0]<8192&&D[1]<8192&&D[2]>=0&&D[3]>=0&&v.insert(p,D[0],D[1],D[2],D[3])}},cf.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new yp.VectorTile(new Yr(this.rawTileData)).layers,this.sourceLayerCoder=new hm(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},cf.prototype.query=function(i,l,_,S){var F=this;this.loadVTLayers();for(var j=i.params||{},p=8192/i.tileSize/i.scale,v=jc(j.filter),m=i.queryGeometry,w=i.queryPadding*p,D=Sm(m),N=this.grid.query(D.minX-w,D.minY-w,D.maxX+w,D.maxY+w),W=Sm(i.cameraQueryGeometry),$=this.grid3D.query(W.minX-w,W.minY-w,W.maxX+w,W.maxY+w,function(mt,St,xt,bt){return function(kt,ft,nr,br,Pr){for(var Mn=0,yn=kt;Mn<yn.length;Mn+=1){var kr=yn[Mn];if(ft<=kr.x&&nr<=kr.y&&br>=kr.x&&Pr>=kr.y)return!0}var Ai=[new Le(ft,nr),new Le(ft,Pr),new Le(br,Pr),new Le(br,nr)];if(kt.length>2){for(var $n=0,ti=Ai;$n<ti.length;$n+=1)if(Vl(kt,ti[$n]))return!0}for(var ri=0;ri<kt.length-1;ri++)if(Uh(kt[ri],kt[ri+1],Ai))return!0;return!1}(i.cameraQueryGeometry,mt-w,St-w,xt+w,bt+w)}),ie=0,pe=$;ie<pe.length;ie+=1)N.push(pe[ie]);N.sort(qm);for(var we,ke={},Ge=function(mt){var St=N[mt];if(St!==we){we=St;var xt=F.featureIndexArray.get(St),bt=null;F.loadMatchingFeature(ke,xt.bucketIndex,xt.sourceLayerIndex,xt.featureIndex,v,j.layers,j.availableImages,l,_,S,function(kt,ft,nr){return bt||(bt=ja(kt)),ft.queryIntersectsFeature(m,kt,nr,bt,F.z,i.transform,p,i.pixelPosMatrix)})}},ht=0;ht<N.length;ht++)Ge(ht);return ke},cf.prototype.loadMatchingFeature=function(i,l,_,S,F,j,p,v,m,w,D){var N=this.bucketLayerIDs[l];if(!j||function(kt,ft){for(var nr=0;nr<kt.length;nr++)if(ft.indexOf(kt[nr])>=0)return!0;return!1}(j,N)){var W=this.sourceLayerCoder.decode(_),$=this.vtLayers[W].feature(S);if(F.needGeometry){var ie=$a($,!0);if(!F.filter(new fa(this.tileID.overscaledZ),ie,this.tileID.canonical))return}else if(!F.filter(new fa(this.tileID.overscaledZ),$))return;for(var pe=this.getId($,W),we=0;we<N.length;we++){var ke=N[we];if(!(j&&j.indexOf(ke)<0)){var Ge=v[ke];if(Ge){var ht={};pe!==void 0&&w&&(ht=w.getState(Ge.sourceLayer||"_geojsonTileLayer",pe));var mt=er({},m[ke]);mt.paint=nd(mt.paint,Ge.paint,$,ht,p),mt.layout=nd(mt.layout,Ge.layout,$,ht,p);var St=!D||D($,Ge,ht);if(St){var xt=new Em($,this.z,this.x,this.y,pe);xt.layer=mt;var bt=i[ke];bt===void 0&&(bt=i[ke]=[]),bt.push({featureIndex:S,feature:xt,intersectionZ:St})}}}}}},cf.prototype.lookupSymbolFeatures=function(i,l,_,S,F,j,p,v){var m={};this.loadVTLayers();for(var w=jc(F),D=0,N=i;D<N.length;D+=1)this.loadMatchingFeature(m,_,S,N[D],w,j,p,v,l);return m},cf.prototype.hasLayer=function(i){for(var l=0,_=this.bucketLayerIDs;l<_.length;l+=1)for(var S=0,F=_[l];S<F.length;S+=1)if(i===F[S])return!0;return!1},cf.prototype.getId=function(i,l){var _=i.id;return this.promoteId&&typeof(_=i.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[l]])=="boolean"&&(_=Number(_)),_},fi("FeatureIndex",cf,{omit:["rawTileData","sourceLayerCoder"]});var mc=function(i,l){this.tileID=i,this.uid=Ar(),this.uses=0,this.tileSize=l,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};mc.prototype.registerFadeDuration=function(i){var l=i+this.timeAdded;l<Uo.now()||this.fadeEndTime&&l<this.fadeEndTime||(this.fadeEndTime=l)},mc.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},mc.prototype.loadVectorData=function(i,l,_){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",i){for(var S in i.featureIndex&&(this.latestFeatureIndex=i.featureIndex,i.rawTileData?(this.latestRawTileData=i.rawTileData,this.latestFeatureIndex.rawTileData=i.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=i.collisionBoxArray,this.buckets=function(w,D){var N={};if(!D)return N;for(var W=function(){var pe=ie[$],we=pe.layerIds.map(function(ht){return D.getLayer(ht)}).filter(Boolean);if(we.length!==0){pe.layers=we,pe.stateDependentLayerIds&&(pe.stateDependentLayers=pe.stateDependentLayerIds.map(function(ht){return we.filter(function(mt){return mt.id===ht})[0]}));for(var ke=0,Ge=we;ke<Ge.length;ke+=1)N[Ge[ke].id]=pe}},$=0,ie=w;$<ie.length;$+=1)W();return N}(i.buckets,l.style),this.hasSymbolBuckets=!1,this.buckets){var F=this.buckets[S];if(F instanceof Fi){if(this.hasSymbolBuckets=!0,!_)break;F.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var j in this.buckets){var p=this.buckets[j];if(p instanceof Fi&&p.hasRTLText){this.hasRTLText=!0,ql.isLoading()||ql.isLoaded()||rp()!=="deferred"||su();break}}for(var v in this.queryPadding=0,this.buckets){var m=this.buckets[v];this.queryPadding=Math.max(this.queryPadding,l.style.getLayer(v).queryRadius(m))}i.imageAtlas&&(this.imageAtlas=i.imageAtlas),i.glyphAtlasImage&&(this.glyphAtlasImage=i.glyphAtlasImage)}else this.collisionBoxArray=new g},mc.prototype.unloadVectorData=function(){for(var i in this.buckets)this.buckets[i].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},mc.prototype.getBucket=function(i){return this.buckets[i.id]},mc.prototype.upload=function(i){for(var l in this.buckets){var _=this.buckets[l];_.uploadPending()&&_.upload(i)}var S=i.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Sf(i,this.imageAtlas.image,S.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Sf(i,this.glyphAtlasImage,S.ALPHA),this.glyphAtlasImage=null)},mc.prototype.prepare=function(i){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(i,this.imageAtlasTexture)},mc.prototype.queryRenderedFeatures=function(i,l,_,S,F,j,p,v,m,w){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:S,cameraQueryGeometry:F,scale:j,tileSize:this.tileSize,pixelPosMatrix:w,transform:v,params:p,queryPadding:this.queryPadding*m},i,l,_):{}},mc.prototype.querySourceFeatures=function(i,l){var _=this.latestFeatureIndex;if(_&&_.rawTileData){var S=_.loadVTLayers(),F=l?l.sourceLayer:"",j=S._geojsonTileLayer||S[F];if(j)for(var p=jc(l&&l.filter),v=this.tileID.canonical,m=v.z,w=v.x,D=v.y,N={z:m,x:w,y:D},W=0;W<j.length;W++){var $=j.feature(W);if(p.needGeometry){var ie=$a($,!0);if(!p.filter(new fa(this.tileID.overscaledZ),ie,this.tileID.canonical))continue}else if(!p.filter(new fa(this.tileID.overscaledZ),$))continue;var pe=_.getId($,F),we=new Em($,m,w,D,pe);we.tile=N,i.push(we)}}},mc.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},mc.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},mc.prototype.setExpiryData=function(i){var l=this.expirationTime;if(i.cacheControl){var _=Dt(i.cacheControl);_["max-age"]&&(this.expirationTime=Date.now()+1e3*_["max-age"])}else i.expires&&(this.expirationTime=new Date(i.expires).getTime());if(this.expirationTime){var S=Date.now(),F=!1;if(this.expirationTime>S)F=!1;else if(l)if(this.expirationTime<l)F=!0;else{var j=this.expirationTime-l;j?this.expirationTime=S+Math.max(j,3e4):F=!0}else F=!0;F?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},mc.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)},mc.prototype.setFeatureState=function(i,l){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&Object.keys(i).length!==0){var _=this.latestFeatureIndex.loadVTLayers();for(var S in this.buckets)if(l.style.hasLayer(S)){var F=this.buckets[S],j=F.layers[0].sourceLayer||"_geojsonTileLayer",p=_[j],v=i[j];if(p&&v&&Object.keys(v).length!==0){F.update(v,p,this.imageAtlas&&this.imageAtlas.patternPositions||{});var m=l&&l.style&&l.style.getLayer(S);m&&(this.queryPadding=Math.max(this.queryPadding,m.queryRadius(F)))}}}},mc.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},mc.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Uo.now()},mc.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},mc.prototype.setHoldDuration=function(i){this.symbolFadeHoldUntil=Uo.now()+i},mc.prototype.setDependencies=function(i,l){for(var _={},S=0,F=l;S<F.length;S+=1)_[F[S]]=!0;this.dependencies[i]=_},mc.prototype.hasDependency=function(i,l){for(var _=0,S=i;_<S.length;_+=1){var F=this.dependencies[S[_]];if(F){for(var j=0,p=l;j<p.length;j+=1)if(F[p[j]])return!0}}return!1};var mh=Ce.performance,Zd=function(i){this._marks={start:[i.url,"start"].join("#"),end:[i.url,"end"].join("#"),measure:i.url.toString()},mh.mark(this._marks.start)};Zd.prototype.finish=function(){mh.mark(this._marks.end);var i=mh.getEntriesByName(this._marks.measure);return i.length===0&&(mh.measure(this._marks.measure,this._marks.start,this._marks.end),i=mh.getEntriesByName(this._marks.measure),mh.clearMarks(this._marks.start),mh.clearMarks(this._marks.end),mh.clearMeasures(this._marks.measure)),i},M.Actor=Ud,M.AlphaImage=ef,M.CanonicalTileID=Mp,M.CollisionBoxArray=g,M.Color=Fo,M.DEMData=Af,M.DataConstantProperty=Gi,M.DictionaryCoder=hm,M.EXTENT=8192,M.ErrorEvent=je,M.EvaluationParameters=fa,M.Event=ze,M.Evented=Ue,M.FeatureIndex=cf,M.FillBucket=Tp,M.FillExtrusionBucket=Wu,M.ImageAtlas=Sn,M.ImagePosition=bi,M.LineBucket=Bc,M.LngLat=nu,M.LngLatBounds=Bu,M.MercatorCoordinate=Tf,M.ONE_EM=24,M.OverscaledTileID=Kr,M.Point=Le,M.Point$1=Le,M.Properties=Gs,M.Protobuf=Yr,M.RGBAImage=_s,M.RequestManager=ui,M.RequestPerformance=Zd,M.ResourceType=co,M.SegmentVector=Ie,M.SourceFeatureState=Md,M.StructArrayLayout1ui2=ue,M.StructArrayLayout2f1f2i16=ba,M.StructArrayLayout2i4=ks,M.StructArrayLayout3ui6=s,M.StructArrayLayout4i8=_l,M.SymbolBucket=Fi,M.Texture=Sf,M.Tile=mc,M.Transitionable=lu,M.Uniform1f=sn,M.Uniform1i=Hr,M.Uniform2f=nn,M.Uniform3f=Gn,M.Uniform4f=di,M.UniformColor=Di,M.UniformMatrix4f=ho,M.UnwrappedTileID=Bm,M.ValidationError=Je,M.WritingMode=Wt,M.ZoomHistory=ep,M.add=function(i,l,_){return i[0]=l[0]+_[0],i[1]=l[1]+_[1],i[2]=l[2]+_[2],i},M.addDynamicAttributes=Tn,M.asyncAll=function(i,l,_){if(!i.length)return _(null,[]);var S=i.length,F=new Array(i.length),j=null;i.forEach(function(p,v){l(p,function(m,w){m&&(j=m),F[v]=w,--S==0&&_(j,F)})})},M.bezier=Xe,M.bindAll=Jn,M.browser=Uo,M.cacheEntryPossiblyAdded=function(i){++wa>un&&(i.getActor().send("enforceCacheSizeLimit",eo),wa=0)},M.clamp=Ve,M.clearTileCache=function(i){var l=Ce.caches.delete("mapbox-tiles");i&&l.catch(i).then(function(){return i()})},M.clipLine=Cp,M.clone=function(i){var l=new os(16);return l[0]=i[0],l[1]=i[1],l[2]=i[2],l[3]=i[3],l[4]=i[4],l[5]=i[5],l[6]=i[6],l[7]=i[7],l[8]=i[8],l[9]=i[9],l[10]=i[10],l[11]=i[11],l[12]=i[12],l[13]=i[13],l[14]=i[14],l[15]=i[15],l},M.clone$1=jt,M.clone$2=function(i){var l=new os(3);return l[0]=i[0],l[1]=i[1],l[2]=i[2],l},M.collisionCircleLayout=Pe,M.config=vi,M.create=function(){var i=new os(16);return os!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},M.create$1=function(){var i=new os(9);return os!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[5]=0,i[6]=0,i[7]=0),i[0]=1,i[4]=1,i[8]=1,i},M.create$2=function(){var i=new os(4);return os!=Float32Array&&(i[1]=0,i[2]=0),i[0]=1,i[3]=1,i},M.createCommonjsModule=R,M.createExpression=mp,M.createLayout=Al,M.createStyleLayer=function(i){return i.type==="custom"?new Sd(i):new Up[i.type](i)},M.cross=function(i,l,_){var S=l[0],F=l[1],j=l[2],p=_[0],v=_[1],m=_[2];return i[0]=F*m-j*v,i[1]=j*p-S*m,i[2]=S*v-F*p,i},M.deepEqual=function i(l,_){if(Array.isArray(l)){if(!Array.isArray(_)||l.length!==_.length)return!1;for(var S=0;S<l.length;S++)if(!i(l[S],_[S]))return!1;return!0}if(typeof l=="object"&&l!==null&&_!==null){if(typeof _!="object"||Object.keys(l).length!==Object.keys(_).length)return!1;for(var F in l)if(!i(l[F],_[F]))return!1;return!0}return l===_},M.dot=function(i,l){return i[0]*l[0]+i[1]*l[1]+i[2]*l[2]},M.dot$1=function(i,l){return i[0]*l[0]+i[1]*l[1]+i[2]*l[2]+i[3]*l[3]},M.ease=Ke,M.emitValidationErrors=sh,M.endsWith=ki,M.enforceCacheSizeLimit=function(i){To(),We&&We.then(function(l){l.keys().then(function(_){for(var S=0;S<_.length-i;S++)l.delete(_[S])})})},M.evaluateSizeForFeature=za,M.evaluateSizeForZoom=Mu,M.evaluateVariableOffset=sr,M.evented=tp,M.extend=er,M.featureFilter=jc,M.filterObject=xr,M.fromRotation=function(i,l){var _=Math.sin(l),S=Math.cos(l);return i[0]=S,i[1]=_,i[2]=0,i[3]=-_,i[4]=S,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i},M.getAnchorAlignment=Js,M.getAnchorJustification=lr,M.getArrayBuffer=Lt,M.getImage=le,M.getJSON=function(i,l){return Us(er(i,{type:"json"}),l)},M.getRTLTextPluginStatus=rp,M.getReferrer=Za,M.getVideo=function(i,l){var _,S,F=Ce.document.createElement("video");F.muted=!0,F.onloadstart=function(){l(null,F)};for(var j=0;j<i.length;j++){var p=Ce.document.createElement("source");_=i[j],S=void 0,(S=Ce.document.createElement("a")).href=_,(S.protocol!==Ce.document.location.protocol||S.host!==Ce.document.location.host)&&(F.crossOrigin="Anonymous"),p.src=i[j],F.appendChild(p)}return{cancel:function(){}}},M.identity=yl,M.invert=function(i,l){var _=l[0],S=l[1],F=l[2],j=l[3],p=l[4],v=l[5],m=l[6],w=l[7],D=l[8],N=l[9],W=l[10],$=l[11],ie=l[12],pe=l[13],we=l[14],ke=l[15],Ge=_*v-S*p,ht=_*m-F*p,mt=_*w-j*p,St=S*m-F*v,xt=S*w-j*v,bt=F*w-j*m,kt=D*pe-N*ie,ft=D*we-W*ie,nr=D*ke-$*ie,br=N*we-W*pe,Pr=N*ke-$*pe,Mn=W*ke-$*we,yn=Ge*Mn-ht*Pr+mt*br+St*nr-xt*ft+bt*kt;return yn?(i[0]=(v*Mn-m*Pr+w*br)*(yn=1/yn),i[1]=(F*Pr-S*Mn-j*br)*yn,i[2]=(pe*bt-we*xt+ke*St)*yn,i[3]=(W*xt-N*bt-$*St)*yn,i[4]=(m*nr-p*Mn-w*ft)*yn,i[5]=(_*Mn-F*nr+j*ft)*yn,i[6]=(we*mt-ie*bt-ke*ht)*yn,i[7]=(D*bt-W*mt+$*ht)*yn,i[8]=(p*Pr-v*nr+w*kt)*yn,i[9]=(S*nr-_*Pr-j*kt)*yn,i[10]=(ie*xt-pe*mt+ke*Ge)*yn,i[11]=(N*mt-D*xt-$*Ge)*yn,i[12]=(v*ft-p*br-m*kt)*yn,i[13]=(_*br-S*ft+F*kt)*yn,i[14]=(pe*ht-ie*St-we*Ge)*yn,i[15]=(D*St-N*ht+W*Ge)*yn,i):null},M.isChar=mi,M.isMapboxURL=Qi,M.keysDifference=function(i,l){var _=[];for(var S in i)S in l||_.push(S);return _},M.makeRequest=Us,M.mapObject=pa,M.mercatorXfromLng=rd,M.mercatorYfromLat=bm,M.mercatorZfromAltitude=Nr,M.mul=_f,M.multiply=Ol,M.mvt=yp,M.nextPowerOfTwo=function(i){return i<=1?1:Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))},M.normalize=function(i,l){var _=l[0],S=l[1],F=l[2],j=_*_+S*S+F*F;return j>0&&(j=1/Math.sqrt(j)),i[0]=l[0]*j,i[1]=l[1]*j,i[2]=l[2]*j,i},M.number=Io,M.offscreenCanvasSupported=dn,M.ortho=function(i,l,_,S,F,j,p){var v=1/(l-_),m=1/(S-F),w=1/(j-p);return i[0]=-2*v,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*m,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*w,i[11]=0,i[12]=(l+_)*v,i[13]=(F+S)*m,i[14]=(p+j)*w,i[15]=1,i},M.parseGlyphPBF=function(i){return new Yr(i).readFields(Ln,[])},M.pbf=Yr,M.performSymbolLayout=function(i,l,_,S,F,j,p){i.createArrays(),i.tilePixelRatio=8192/(512*i.overscaling),i.compareText={},i.iconsNeedLinear=!1;var v=i.layers[0].layout,m=i.layers[0]._unevaluatedLayout._values,w={};if(i.textSizeData.kind==="composite"){var D=i.textSizeData,N=D.maxZoom;w.compositeTextSizes=[m["text-size"].possiblyEvaluate(new fa(D.minZoom),p),m["text-size"].possiblyEvaluate(new fa(N),p)]}if(i.iconSizeData.kind==="composite"){var W=i.iconSizeData,$=W.maxZoom;w.compositeIconSizes=[m["icon-size"].possiblyEvaluate(new fa(W.minZoom),p),m["icon-size"].possiblyEvaluate(new fa($),p)]}w.layoutTextSize=m["text-size"].possiblyEvaluate(new fa(i.zoom+1),p),w.layoutIconSize=m["icon-size"].possiblyEvaluate(new fa(i.zoom+1),p),w.textMaxSize=m["text-size"].possiblyEvaluate(new fa(18));for(var ie=24*v.get("text-line-height"),pe=v.get("text-rotation-alignment")==="map"&&v.get("symbol-placement")!=="point",we=v.get("text-keep-upright"),ke=v.get("text-size"),Ge=function(){var St=mt[ht],xt=v.get("text-font").evaluate(St,{},p).join(","),bt=ke.evaluate(St,{},p),kt=w.layoutTextSize.evaluate(St,{},p),ft=w.layoutIconSize.evaluate(St,{},p),nr={horizontal:{},vertical:void 0},br=St.text,Pr=[0,0];if(br){var Mn=br.toString(),yn=24*v.get("text-letter-spacing").evaluate(St,{},p),kr=function(Eo){for(var Pa=0,na=Eo;Pa<na.length;Pa+=1)if(ha=na[Pa].charCodeAt(0),mi.Arabic(ha)||mi["Arabic Supplement"](ha)||mi["Arabic Extended-A"](ha)||mi["Arabic Presentation Forms-A"](ha)||mi["Arabic Presentation Forms-B"](ha))return!1;var ha;return!0}(Mn)?yn:0,Ai=v.get("text-anchor").evaluate(St,{},p),$n=v.get("text-variable-anchor");if(!$n){var ti=v.get("text-radial-offset").evaluate(St,{},p);Pr=ti?sr(Ai,[24*ti,Jt]):v.get("text-offset").evaluate(St,{},p).map(function(Eo){return 24*Eo})}var ri=pe?"center":v.get("text-justify").evaluate(St,{},p),hn=v.get("symbol-placement"),An=hn==="point"?24*v.get("text-max-width").evaluate(St,{},p):0,Yi=function(){i.allowVerticalPlacement&&Mc(Mn)&&(nr.vertical=Ee(br,l,_,F,xt,An,ie,Ai,"left",kr,Pr,Wt.vertical,!0,hn,kt,bt))};if(!pe&&$n){for(var Ci=ri==="auto"?$n.map(function(Eo){return lr(Eo)}):[ri],fo=!1,Go=0;Go<Ci.length;Go++){var hi=Ci[Go];if(!nr.horizontal[hi])if(fo)nr.horizontal[hi]=nr.horizontal[0];else{var zi=Ee(br,l,_,F,xt,An,ie,"center",hi,kr,Pr,Wt.horizontal,!1,hn,kt,bt);zi&&(nr.horizontal[hi]=zi,fo=zi.positionedLines.length===1)}}Yi()}else{ri==="auto"&&(ri=lr(Ai));var Vo=Ee(br,l,_,F,xt,An,ie,Ai,ri,kr,Pr,Wt.horizontal,!1,hn,kt,bt);Vo&&(nr.horizontal[ri]=Vo),Yi(),Mc(Mn)&&pe&&we&&(nr.vertical=Ee(br,l,_,F,xt,An,ie,Ai,ri,kr,Pr,Wt.vertical,!1,hn,kt,bt))}}var Ka=void 0,ta=!1;if(St.icon&&St.icon.name){var ka=S[St.icon.name];ka&&(Ka=function(Eo,Pa,na){var ha=Js(na),Xs=Pa[0]-Eo.displaySize[0]*ha.horizontalAlign,Ls=Pa[1]-Eo.displaySize[1]*ha.verticalAlign;return{image:Eo,top:Ls,bottom:Ls+Eo.displaySize[1],left:Xs,right:Xs+Eo.displaySize[0]}}(F[St.icon.name],v.get("icon-offset").evaluate(St,{},p),v.get("icon-anchor").evaluate(St,{},p)),ta=ka.sdf,i.sdfIcons===void 0?i.sdfIcons=ka.sdf:i.sdfIcons!==ka.sdf&&gr("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(ka.pixelRatio!==i.pixelRatio||v.get("icon-rotate").constantOr(1)!==0)&&(i.iconsNeedLinear=!0))}var ca=Xt(nr.horizontal)||nr.vertical;i.iconsInText=!!ca&&ca.iconsInText,(ca||Ka)&&function(Eo,Pa,na,ha,Xs,Ls,Ea,ws,qs,ua,cu){var c=Ls.textMaxSize.evaluate(Pa,{});c===void 0&&(c=Ea);var o,f=Eo.layers[0].layout,E=f.get("icon-offset").evaluate(Pa,{},cu),L=Xt(na.horizontal),V=Ea/24,X=Eo.tilePixelRatio*V,J=Eo.tilePixelRatio*c/24,oe=Eo.tilePixelRatio*ws,me=Eo.tilePixelRatio*f.get("symbol-spacing"),Me=f.get("text-padding")*Eo.tilePixelRatio,De=f.get("icon-padding")*Eo.tilePixelRatio,Ye=f.get("text-max-angle")/180*Math.PI,ot=f.get("text-rotation-alignment")==="map"&&f.get("symbol-placement")!=="point",lt=f.get("icon-rotation-alignment")==="map"&&f.get("symbol-placement")!=="point",Ct=f.get("symbol-placement"),Gt=me/2,Kt=f.get("icon-text-fit");ha&&Kt!=="none"&&(Eo.allowVerticalPlacement&&na.vertical&&(o=du(ha,na.vertical,Kt,f.get("icon-text-fit-padding"),E,V)),L&&(ha=du(ha,L,Kt,f.get("icon-text-fit-padding"),E,V)));var Er=function(lp,vh){vh.x<0||vh.x>=8192||vh.y<0||vh.y>=8192||function(Ys,jl,_h,vc,xp,up,Mh,_c,oc,Ss,Ph,Rh,Nc,Cf,Vp,Mf,md,Pf,Rf,Rp,$c,Vd,Ym,Vf,og){var Pd,jd,pm,Tm,fm,Am=Ys.addToLineVertexArray(jl,_h),Cg=0,Vg=0,Mg=0,$m=0,ag=-1,jp=-1,cp={},dm=tt(""),Vh=0,sg=0;if(_c._unevaluatedLayout.getValue("text-radial-offset")===void 0?(Vh=(Pd=_c.layout.get("text-offset").evaluate($c,{},Vf).map(function(Fm){return 24*Fm}))[0],sg=Pd[1]):(Vh=24*_c.layout.get("text-radial-offset").evaluate($c,{},Vf),sg=Jt),Ys.allowVerticalPlacement&&vc.vertical){var Cm=_c.layout.get("text-rotate").evaluate($c,{},Vf)+90;Tm=new el(oc,jl,Ss,Ph,Rh,vc.vertical,Nc,Cf,Vp,Cm),Mh&&(fm=new el(oc,jl,Ss,Ph,Rh,Mh,md,Pf,Vp,Cm))}if(xp){var Ih=_c.layout.get("icon-rotate").evaluate($c,{}),Hp=_c.layout.get("icon-text-fit")!=="none",Hd=Ft(xp,Ih,Ym,Hp),hf=Mh?Ft(Mh,Ih,Ym,Hp):void 0;pm=new el(oc,jl,Ss,Ph,Rh,xp,md,Pf,!1,Ih),Cg=4*Hd.length;var Gd=Ys.iconSizeData,pf=null;Gd.kind==="source"?(pf=[128*_c.layout.get("icon-size").evaluate($c,{})])[0]>32640&&gr(Ys.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):Gd.kind==="composite"&&((pf=[128*Vd.compositeIconSizes[0].evaluate($c,{},Vf),128*Vd.compositeIconSizes[1].evaluate($c,{},Vf)])[0]>32640||pf[1]>32640)&&gr(Ys.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),Ys.addSymbols(Ys.icon,Hd,pf,Rp,Rf,$c,!1,jl,Am.lineStartIndex,Am.lineLength,-1,Vf),ag=Ys.icon.placedSymbolArray.length-1,hf&&(Vg=4*hf.length,Ys.addSymbols(Ys.icon,hf,pf,Rp,Rf,$c,Wt.vertical,jl,Am.lineStartIndex,Am.lineLength,-1,Vf),jp=Ys.icon.placedSymbolArray.length-1)}for(var h0 in vc.horizontal){var lg=vc.horizontal[h0];if(!jd){dm=tt(lg.text);var av=_c.layout.get("text-rotate").evaluate($c,{},Vf);jd=new el(oc,jl,Ss,Ph,Rh,lg,Nc,Cf,Vp,av)}var jg=lg.positionedLines.length===1;if(Mg+=Mt(Ys,jl,lg,up,_c,Vp,$c,Mf,Am,vc.vertical?Wt.horizontal:Wt.horizontalOnly,jg?Object.keys(vc.horizontal):[h0],cp,ag,Vd,Vf),jg)break}vc.vertical&&($m+=Mt(Ys,jl,vc.vertical,up,_c,Vp,$c,Mf,Am,Wt.vertical,["vertical"],cp,jp,Vd,Vf));var p0=jd?jd.boxStartIndex:Ys.collisionBoxArray.length,f0=jd?jd.boxEndIndex:Ys.collisionBoxArray.length,sv=Tm?Tm.boxStartIndex:Ys.collisionBoxArray.length,lv=Tm?Tm.boxEndIndex:Ys.collisionBoxArray.length,uv=pm?pm.boxStartIndex:Ys.collisionBoxArray.length,cv=pm?pm.boxEndIndex:Ys.collisionBoxArray.length,hv=fm?fm.boxStartIndex:Ys.collisionBoxArray.length,pv=fm?fm.boxEndIndex:Ys.collisionBoxArray.length,Wd=-1,ug=function(Fm,Gg){return Fm&&Fm.circleDiameter?Math.max(Fm.circleDiameter,Gg):Gg};Wd=ug(jd,Wd),Wd=ug(Tm,Wd),Wd=ug(pm,Wd);var Hg=(Wd=ug(fm,Wd))>-1?1:0;Hg&&(Wd*=og/24),Ys.glyphOffsetArray.length>=Fi.MAX_GLYPHS&&gr("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),$c.sortKey!==void 0&&Ys.addToSortKeyRanges(Ys.symbolInstances.length,$c.sortKey),Ys.symbolInstances.emplaceBack(jl.x,jl.y,cp.right>=0?cp.right:-1,cp.center>=0?cp.center:-1,cp.left>=0?cp.left:-1,cp.vertical||-1,ag,jp,dm,p0,f0,sv,lv,uv,cv,hv,pv,Ss,Mg,$m,Cg,Vg,Hg,0,Nc,Vh,sg,Wd)}(Eo,vh,lp,na,ha,Xs,o,Eo.layers[0],Eo.collisionBoxArray,Pa.index,Pa.sourceLayerIndex,Eo.index,X,Me,ot,qs,oe,De,lt,E,Pa,Ls,ua,cu,Ea)};if(Ct==="line")for(var cr=0,Rr=Cp(Pa.geometry,0,0,8192,8192);cr<Rr.length;cr+=1)for(var Qr=Rr[cr],Fn=0,Ki=Qs(Qr,me,Ye,na.vertical||L,ha,24,J,Eo.overscaling,8192);Fn<Ki.length;Fn+=1){var Co=Ki[Fn];L&&pt(Eo,L.text,Gt,Co)||Er(Qr,Co)}else if(Ct==="line-center")for(var $i=0,Zi=Pa.geometry;$i<Zi.length;$i+=1){var Ri=Zi[$i];if(Ri.length>1){var vo=Qo(Ri,Ye,na.vertical||L,ha,24,J);vo&&Er(Ri,vo)}}else if(Pa.type==="Polygon")for(var Ii=0,ni=Kf(Pa.geometry,0);Ii<ni.length;Ii+=1){var jo=ni[Ii],Do=Vt(jo,16);Er(jo[0],new ru(Do.x,Do.y,0))}else if(Pa.type==="LineString")for(var rs=0,iu=Pa.geometry;rs<iu.length;rs+=1){var tl=iu[rs];Er(tl,new ru(tl[0].x,tl[0].y,0))}else if(Pa.type==="Point")for(var gc=0,Pp=Pa.geometry;gc<Pp.length;gc+=1)for(var sp=0,kc=Pp[gc];sp<kc.length;sp+=1){var gh=kc[sp];Er([gh],new ru(gh.x,gh.y,0))}}(i,St,nr,Ka,S,w,kt,ft,Pr,ta,p)},ht=0,mt=i.features;ht<mt.length;ht+=1)Ge();j&&i.generateCollisionDebugBuffers()},M.perspective=function(i,l,_,S,F){var j,p=1/Math.tan(l/2);return i[0]=p/_,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,F!=null&&F!==1/0?(i[10]=(F+S)*(j=1/(S-F)),i[14]=2*F*S*j):(i[10]=-1,i[14]=-2*S),i},M.pick=function(i,l){for(var _={},S=0;S<l.length;S++){var F=l[S];F in i&&(_[F]=i[F])}return _},M.plugin=ql,M.polygonIntersectsPolygon=zu,M.postMapLoadEvent=kn,M.postTurnstileEvent=Wr,M.potpack=da,M.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],M.register=fi,M.registerForPluginStateChange=function(i){return i({pluginStatus:Xl,pluginURL:Rc}),tp.on("pluginStateChange",i),i},M.renderColorRamp=sd,M.rotate=function(i,l,_){var S=l[0],F=l[1],j=l[2],p=l[3],v=Math.sin(_),m=Math.cos(_);return i[0]=S*m+j*v,i[1]=F*m+p*v,i[2]=S*-v+j*m,i[3]=F*-v+p*m,i},M.rotateX=function(i,l,_){var S=Math.sin(_),F=Math.cos(_),j=l[4],p=l[5],v=l[6],m=l[7],w=l[8],D=l[9],N=l[10],W=l[11];return l!==i&&(i[0]=l[0],i[1]=l[1],i[2]=l[2],i[3]=l[3],i[12]=l[12],i[13]=l[13],i[14]=l[14],i[15]=l[15]),i[4]=j*F+w*S,i[5]=p*F+D*S,i[6]=v*F+N*S,i[7]=m*F+W*S,i[8]=w*F-j*S,i[9]=D*F-p*S,i[10]=N*F-v*S,i[11]=W*F-m*S,i},M.rotateZ=function(i,l,_){var S=Math.sin(_),F=Math.cos(_),j=l[0],p=l[1],v=l[2],m=l[3],w=l[4],D=l[5],N=l[6],W=l[7];return l!==i&&(i[8]=l[8],i[9]=l[9],i[10]=l[10],i[11]=l[11],i[12]=l[12],i[13]=l[13],i[14]=l[14],i[15]=l[15]),i[0]=j*F+w*S,i[1]=p*F+D*S,i[2]=v*F+N*S,i[3]=m*F+W*S,i[4]=w*F-j*S,i[5]=D*F-p*S,i[6]=N*F-v*S,i[7]=W*F-m*S,i},M.scale=function(i,l,_){var S=_[0],F=_[1],j=_[2];return i[0]=l[0]*S,i[1]=l[1]*S,i[2]=l[2]*S,i[3]=l[3]*S,i[4]=l[4]*F,i[5]=l[5]*F,i[6]=l[6]*F,i[7]=l[7]*F,i[8]=l[8]*j,i[9]=l[9]*j,i[10]=l[10]*j,i[11]=l[11]*j,i[12]=l[12],i[13]=l[13],i[14]=l[14],i[15]=l[15],i},M.scale$1=function(i,l,_){return i[0]=l[0]*_,i[1]=l[1]*_,i[2]=l[2]*_,i[3]=l[3]*_,i},M.scale$2=function(i,l,_){return i[0]=l[0]*_,i[1]=l[1]*_,i[2]=l[2]*_,i},M.setCacheLimits=function(i,l){eo=i,un=l},M.setRTLTextPlugin=function(i,l,_){if(_===void 0&&(_=!1),Xl==="deferred"||Xl==="loading"||Xl==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");Rc=Uo.resolveURL(i),Xl="deferred",Pc=l,lh(),_||su()},M.sphericalToCartesian=function(i){var l=i[0],_=i[1],S=i[2];return _+=90,_*=Math.PI/180,S*=Math.PI/180,{x:l*Math.cos(_)*Math.sin(S),y:l*Math.sin(_)*Math.sin(S),z:l*Math.cos(S)}},M.sqrLen=function(i){var l=i[0],_=i[1];return l*l+_*_},M.styleSpec=Ae,M.sub=function(i,l,_){return i[0]=l[0]-_[0],i[1]=l[1]-_[1],i[2]=l[2]-_[2],i},M.symbolSize=Ca,M.transformMat3=function(i,l,_){var S=l[0],F=l[1],j=l[2];return i[0]=S*_[0]+F*_[3]+j*_[6],i[1]=S*_[1]+F*_[4]+j*_[7],i[2]=S*_[2]+F*_[5]+j*_[8],i},M.transformMat4=ip,M.translate=function(i,l,_){var S,F,j,p,v,m,w,D,N,W,$,ie,pe=_[0],we=_[1],ke=_[2];return l===i?(i[12]=l[0]*pe+l[4]*we+l[8]*ke+l[12],i[13]=l[1]*pe+l[5]*we+l[9]*ke+l[13],i[14]=l[2]*pe+l[6]*we+l[10]*ke+l[14],i[15]=l[3]*pe+l[7]*we+l[11]*ke+l[15]):(F=l[1],j=l[2],p=l[3],v=l[4],m=l[5],w=l[6],D=l[7],N=l[8],W=l[9],$=l[10],ie=l[11],i[0]=S=l[0],i[1]=F,i[2]=j,i[3]=p,i[4]=v,i[5]=m,i[6]=w,i[7]=D,i[8]=N,i[9]=W,i[10]=$,i[11]=ie,i[12]=S*pe+v*we+N*ke+l[12],i[13]=F*pe+m*we+W*ke+l[13],i[14]=j*pe+w*we+$*ke+l[14],i[15]=p*pe+D*we+ie*ke+l[15]),i},M.triggerPluginCompletionEvent=Eu,M.uniqueId=Ar,M.validateCustomStyleLayer=function(i){var l=[],_=i.id;return _===void 0&&l.push({message:"layers."+_+': missing required property "id"'}),i.render===void 0&&l.push({message:"layers."+_+': missing required method "render"'}),i.renderingMode&&i.renderingMode!=="2d"&&i.renderingMode!=="3d"&&l.push({message:"layers."+_+': property "renderingMode" must be either "2d" or "3d"'}),l},M.validateLight=Cc,M.validateStyle=oh,M.values=function(i){var l=[];for(var _ in i)l.push(i[_]);return l},M.vectorTile=yp,M.version="1.13.3",M.warnOnce=gr,M.webpSupported=bo,M.window=Ce,M.wrap=et}),Ze(["./shared"],function(M){"use strict";function R(re){var le=typeof re;if(le==="number"||le==="boolean"||le==="string"||re==null)return JSON.stringify(re);if(Array.isArray(re)){for(var ge="[",ye=0,ze=re;ye<ze.length;ye+=1)ge+=R(ze[ye])+",";return ge+"]"}for(var je=Object.keys(re).sort(),Ue="{",Ae=0;Ae<je.length;Ae++)Ue+=JSON.stringify(je[Ae])+":"+R(re[je[Ae]])+",";return Ue+"}"}function de(re){for(var le="",ge=0,ye=M.refProperties;ge<ye.length;ge+=1)le+="/"+R(re[ye[ge]]);return le}var be=function(re){this.keyCache={},re&&this.replace(re)};be.prototype.replace=function(re){this._layerConfigs={},this._layers={},this.update(re,[])},be.prototype.update=function(re,le){for(var ge=this,ye=0,ze=re;ye<ze.length;ye+=1){var je=ze[ye];this._layerConfigs[je.id]=je;var Ue=this._layers[je.id]=M.createStyleLayer(je);Ue._featureFilter=M.featureFilter(Ue.filter),this.keyCache[je.id]&&delete this.keyCache[je.id]}for(var Ae=0,Je=le;Ae<Je.length;Ae+=1){var wt=Je[Ae];delete this.keyCache[wt],delete this._layerConfigs[wt],delete this._layers[wt]}this.familiesBySource={};for(var Ht=0,Fr=function(bn,En){for(var io={},On=0;On<bn.length;On++){var Ao=En&&En[bn[On].id]||de(bn[On]);En&&(En[bn[On].id]=Ao);var ia=io[Ao];ia||(ia=io[Ao]=[]),ia.push(bn[On])}var Ho=[];for(var Ga in io)Ho.push(io[Ga]);return Ho}(M.values(this._layerConfigs),this.keyCache);Ht<Fr.length;Ht+=1){var mr=Fr[Ht].map(function(bn){return ge._layers[bn.id]}),Sr=mr[0];if(Sr.visibility!=="none"){var fn=Sr.source||"",xn=this.familiesBySource[fn];xn||(xn=this.familiesBySource[fn]={});var Lr=Sr.sourceLayer||"_geojsonTileLayer",Nn=xn[Lr];Nn||(Nn=xn[Lr]=[]),Nn.push(mr)}}};var Le=function(re){var le={},ge=[];for(var ye in re){var ze=re[ye],je=le[ye]={};for(var Ue in ze){var Ae=ze[+Ue];if(Ae&&Ae.bitmap.width!==0&&Ae.bitmap.height!==0){var Je={x:0,y:0,w:Ae.bitmap.width+2,h:Ae.bitmap.height+2};ge.push(Je),je[Ue]={rect:Je,metrics:Ae.metrics}}}}var wt=M.potpack(ge),Ht=new M.AlphaImage({width:wt.w||1,height:wt.h||1});for(var Fr in re){var mr=re[Fr];for(var Sr in mr){var fn=mr[+Sr];if(fn&&fn.bitmap.width!==0&&fn.bitmap.height!==0){var xn=le[Fr][Sr].rect;M.AlphaImage.copy(fn.bitmap,Ht,{x:0,y:0},{x:xn.x+1,y:xn.y+1},fn.bitmap)}}}this.image=Ht,this.positions=le};M.register("GlyphAtlas",Le);var Re=function(re){this.tileID=new M.OverscaledTileID(re.tileID.overscaledZ,re.tileID.wrap,re.tileID.canonical.z,re.tileID.canonical.x,re.tileID.canonical.y),this.uid=re.uid,this.zoom=re.zoom,this.pixelRatio=re.pixelRatio,this.tileSize=re.tileSize,this.source=re.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=re.showCollisionBoxes,this.collectResourceTiming=!!re.collectResourceTiming,this.returnDependencies=!!re.returnDependencies,this.promoteId=re.promoteId};function Ce(re,le,ge){for(var ye=new M.EvaluationParameters(le),ze=0,je=re;ze<je.length;ze+=1)je[ze].recalculate(ye,ge)}function He(re,le){var ge=M.getArrayBuffer(re.request,function(ye,ze,je,Ue){ye?le(ye):ze&&le(null,{vectorTile:new M.vectorTile.VectorTile(new M.pbf(ze)),rawData:ze,cacheControl:je,expires:Ue})});return function(){ge.cancel(),le()}}Re.prototype.parse=function(re,le,ge,ye,ze){var je=this;this.status="parsing",this.data=re,this.collisionBoxArray=new M.CollisionBoxArray;var Ue=new M.DictionaryCoder(Object.keys(re.layers).sort()),Ae=new M.FeatureIndex(this.tileID,this.promoteId);Ae.bucketLayerIDs=[];var Je,wt,Ht,Fr,mr={},Sr={featureIndex:Ae,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:ge},fn=le.familiesBySource[this.source];for(var xn in fn){var Lr=re.layers[xn];if(Lr){Lr.version===1&&M.warnOnce('Vector tile source "'+this.source+'" layer "'+xn+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var Nn=Ue.encode(xn),bn=[],En=0;En<Lr.length;En++){var io=Lr.feature(En),On=Ae.getId(io,xn);bn.push({feature:io,id:On,index:En,sourceLayerIndex:Nn})}for(var Ao=0,ia=fn[xn];Ao<ia.length;Ao+=1){var Ho=ia[Ao],Ga=Ho[0];Ga.minzoom&&this.zoom<Math.floor(Ga.minzoom)||Ga.maxzoom&&this.zoom>=Ga.maxzoom||Ga.visibility!=="none"&&(Ce(Ho,this.zoom,ge),(mr[Ga.id]=Ga.createBucket({index:Ae.bucketLayerIDs.length,layers:Ho,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Nn,sourceID:this.source})).populate(bn,Sr,this.tileID.canonical),Ae.bucketLayerIDs.push(Ho.map(function(_a){return _a.id})))}}}var Wo=M.mapObject(Sr.glyphDependencies,function(_a){return Object.keys(_a).map(Number)});Object.keys(Wo).length?ye.send("getGlyphs",{uid:this.uid,stacks:Wo},function(_a,$o){Je||(Je=_a,wt=$o,Yo.call(je))}):wt={};var Hl=Object.keys(Sr.iconDependencies);Hl.length?ye.send("getImages",{icons:Hl,source:this.source,tileID:this.tileID,type:"icons"},function(_a,$o){Je||(Je=_a,Ht=$o,Yo.call(je))}):Ht={};var ns=Object.keys(Sr.patternDependencies);function Yo(){if(Je)return ze(Je);if(wt&&Ht&&Fr){var _a=new Le(wt),$o=new M.ImageAtlas(Ht,Fr);for(var Fo in mr){var us=mr[Fo];us instanceof M.SymbolBucket?(Ce(us.layers,this.zoom,ge),M.performSymbolLayout(us,wt,_a.positions,Ht,$o.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):us.hasPattern&&(us instanceof M.LineBucket||us instanceof M.FillBucket||us instanceof M.FillExtrusionBucket)&&(Ce(us.layers,this.zoom,ge),us.addFeatures(Sr,this.tileID.canonical,$o.patternPositions))}this.status="done",ze(null,{buckets:M.values(mr).filter(function(xc){return!xc.isEmpty()}),featureIndex:Ae,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:_a.image,imageAtlas:$o,glyphMap:this.returnDependencies?wt:null,iconMap:this.returnDependencies?Ht:null,glyphPositions:this.returnDependencies?_a.positions:null})}}ns.length?ye.send("getImages",{icons:ns,source:this.source,tileID:this.tileID,type:"patterns"},function(_a,$o){Je||(Je=_a,Fr=$o,Yo.call(je))}):Fr={},Yo.call(this)};var Xe=function(re,le,ge,ye){this.actor=re,this.layerIndex=le,this.availableImages=ge,this.loadVectorData=ye||He,this.loading={},this.loaded={}};Xe.prototype.loadTile=function(re,le){var ge=this,ye=re.uid;this.loading||(this.loading={});var ze=!!(re&&re.request&&re.request.collectResourceTiming)&&new M.RequestPerformance(re.request),je=this.loading[ye]=new Re(re);je.abort=this.loadVectorData(re,function(Ue,Ae){if(delete ge.loading[ye],Ue||!Ae)return je.status="done",ge.loaded[ye]=je,le(Ue);var Je=Ae.rawData,wt={};Ae.expires&&(wt.expires=Ae.expires),Ae.cacheControl&&(wt.cacheControl=Ae.cacheControl);var Ht={};if(ze){var Fr=ze.finish();Fr&&(Ht.resourceTiming=JSON.parse(JSON.stringify(Fr)))}je.vectorTile=Ae.vectorTile,je.parse(Ae.vectorTile,ge.layerIndex,ge.availableImages,ge.actor,function(mr,Sr){if(mr||!Sr)return le(mr);le(null,M.extend({rawTileData:Je.slice(0)},Sr,wt,Ht))}),ge.loaded=ge.loaded||{},ge.loaded[ye]=je})},Xe.prototype.reloadTile=function(re,le){var ge=this,ye=this.loaded,ze=re.uid,je=this;if(ye&&ye[ze]){var Ue=ye[ze];Ue.showCollisionBoxes=re.showCollisionBoxes;var Ae=function(Je,wt){var Ht=Ue.reloadCallback;Ht&&(delete Ue.reloadCallback,Ue.parse(Ue.vectorTile,je.layerIndex,ge.availableImages,je.actor,Ht)),le(Je,wt)};Ue.status==="parsing"?Ue.reloadCallback=Ae:Ue.status==="done"&&(Ue.vectorTile?Ue.parse(Ue.vectorTile,this.layerIndex,this.availableImages,this.actor,Ae):Ae())}},Xe.prototype.abortTile=function(re,le){var ge=this.loading,ye=re.uid;ge&&ge[ye]&&ge[ye].abort&&(ge[ye].abort(),delete ge[ye]),le()},Xe.prototype.removeTile=function(re,le){var ge=this.loaded,ye=re.uid;ge&&ge[ye]&&delete ge[ye],le()};var Ke=M.window.ImageBitmap,Ve=function(){this.loaded={}};function et(re,le){if(re.length!==0){er(re[0],le);for(var ge=1;ge<re.length;ge++)er(re[ge],!le)}}function er(re,le){for(var ge=0,ye=0,ze=0,je=re.length,Ue=je-1;ze<je;Ue=ze++){var Ae=(re[ze][0]-re[Ue][0])*(re[Ue][1]+re[ze][1]),Je=ge+Ae;ye+=Math.abs(ge)>=Math.abs(Ae)?ge-Je+Ae:Ae-Je+ge,ge=Je}ge+ye>=0!=!!le&&re.reverse()}Ve.prototype.loadTile=function(re,le){var ge=re.uid,ye=re.encoding,ze=re.rawImageData,je=Ke&&ze instanceof Ke?this.getImageData(ze):ze,Ue=new M.DEMData(ge,je,ye);this.loaded=this.loaded||{},this.loaded[ge]=Ue,le(null,Ue)},Ve.prototype.getImageData=function(re){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(re.width,re.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=re.width,this.offscreenCanvas.height=re.height,this.offscreenCanvasContext.drawImage(re,0,0,re.width,re.height);var le=this.offscreenCanvasContext.getImageData(-1,-1,re.width+2,re.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new M.RGBAImage({width:le.width,height:le.height},le.data)},Ve.prototype.removeTile=function(re){var le=this.loaded,ge=re.uid;le&&le[ge]&&delete le[ge]};var fr=M.vectorTile.VectorTileFeature.prototype.toGeoJSON,Ar=function(re){this._feature=re,this.extent=M.EXTENT,this.type=re.type,this.properties=re.tags,"id"in re&&!isNaN(re.id)&&(this.id=parseInt(re.id,10))};Ar.prototype.loadGeometry=function(){if(this._feature.type===1){for(var re=[],le=0,ge=this._feature.geometry;le<ge.length;le+=1){var ye=ge[le];re.push([new M.Point$1(ye[0],ye[1])])}return re}for(var ze=[],je=0,Ue=this._feature.geometry;je<Ue.length;je+=1){for(var Ae=[],Je=0,wt=Ue[je];Je<wt.length;Je+=1){var Ht=wt[Je];Ae.push(new M.Point$1(Ht[0],Ht[1]))}ze.push(Ae)}return ze},Ar.prototype.toGeoJSON=function(re,le,ge){return fr.call(this,re,le,ge)};var pn=function(re){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=M.EXTENT,this.length=re.length,this._features=re};pn.prototype.feature=function(re){return new Ar(this._features[re])};var Kn=M.vectorTile.VectorTileFeature,Jn=ki;function ki(re,le){this.options=le||{},this.features=re,this.length=re.length}function pa(re,le){this.id=typeof re.id=="number"?re.id:void 0,this.type=re.type,this.rawGeometry=re.type===1?[re.geometry]:re.geometry,this.properties=re.tags,this.extent=le||4096}ki.prototype.feature=function(re){return new pa(this.features[re],this.options.extent)},pa.prototype.loadGeometry=function(){var re=this.rawGeometry;this.geometry=[];for(var le=0;le<re.length;le++){for(var ge=re[le],ye=[],ze=0;ze<ge.length;ze++)ye.push(new M.Point$1(ge[ze][0],ge[ze][1]));this.geometry.push(ye)}return this.geometry},pa.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var re=this.geometry,le=1/0,ge=-1/0,ye=1/0,ze=-1/0,je=0;je<re.length;je++)for(var Ue=re[je],Ae=0;Ae<Ue.length;Ae++){var Je=Ue[Ae];le=Math.min(le,Je.x),ge=Math.max(ge,Je.x),ye=Math.min(ye,Je.y),ze=Math.max(ze,Je.y)}return[le,ye,ge,ze]},pa.prototype.toGeoJSON=Kn.prototype.toGeoJSON;var xr=Jr,jt=Jn;function Jr(re){var le=new M.pbf;return function(ge,ye){for(var ze in ge.layers)ye.writeMessage(3,gr,ge.layers[ze])}(re,le),le.finish()}function gr(re,le){var ge;le.writeVarintField(15,re.version||1),le.writeStringField(1,re.name||""),le.writeVarintField(5,re.extent||4096);var ye={keys:[],values:[],keycache:{},valuecache:{}};for(ge=0;ge<re.length;ge++)ye.feature=re.feature(ge),le.writeMessage(2,rn,ye);var ze=ye.keys;for(ge=0;ge<ze.length;ge++)le.writeStringField(3,ze[ge]);var je=ye.values;for(ge=0;ge<je.length;ge++)le.writeMessage(4,Pt,je[ge])}function rn(re,le){var ge=re.feature;ge.id!==void 0&&le.writeVarintField(1,ge.id),le.writeMessage(2,jn,re),le.writeVarintField(3,ge.type),le.writeMessage(4,$e,ge)}function jn(re,le){var ge=re.feature,ye=re.keys,ze=re.values,je=re.keycache,Ue=re.valuecache;for(var Ae in ge.properties){var Je=je[Ae];Je===void 0&&(ye.push(Ae),je[Ae]=Je=ye.length-1),le.writeVarint(Je);var wt=ge.properties[Ae],Ht=typeof wt;Ht!=="string"&&Ht!=="boolean"&&Ht!=="number"&&(wt=JSON.stringify(wt));var Fr=Ht+":"+wt,mr=Ue[Fr];mr===void 0&&(ze.push(wt),Ue[Fr]=mr=ze.length-1),le.writeVarint(mr)}}function qe(re,le){return(le<<3)+(7&re)}function Dt(re){return re<<1^re>>31}function $e(re,le){for(var ge=re.loadGeometry(),ye=re.type,ze=0,je=0,Ue=ge.length,Ae=0;Ae<Ue;Ae++){var Je=ge[Ae],wt=1;ye===1&&(wt=Je.length),le.writeVarint(qe(1,wt));for(var Ht=ye===3?Je.length-1:Je.length,Fr=0;Fr<Ht;Fr++){Fr===1&&ye!==1&&le.writeVarint(qe(2,Ht-1));var mr=Je[Fr].x-ze,Sr=Je[Fr].y-je;le.writeVarint(Dt(mr)),le.writeVarint(Dt(Sr)),ze+=mr,je+=Sr}ye===3&&le.writeVarint(qe(7,1))}}function Pt(re,le){var ge=typeof re;ge==="string"?le.writeStringField(1,re):ge==="boolean"?le.writeBooleanField(7,re):ge==="number"&&(re%1!=0?le.writeDoubleField(3,re):re<0?le.writeSVarintField(6,re):le.writeVarintField(5,re))}function vt(re,le,ge,ye){rr(re,ge,ye),rr(le,2*ge,2*ye),rr(le,2*ge+1,2*ye+1)}function rr(re,le,ge){var ye=re[le];re[le]=re[ge],re[ge]=ye}function ar(re,le,ge,ye){var ze=re-ge,je=le-ye;return ze*ze+je*je}xr.fromVectorTileJs=Jr,xr.fromGeojsonVt=function(re,le){le=le||{};var ge={};for(var ye in re)ge[ye]=new Jn(re[ye].features,le),ge[ye].name=ye,ge[ye].version=le.version,ge[ye].extent=le.extent;return Jr({layers:ge})},xr.GeoJSONWrapper=jt;var wr=function(re){return re[0]},Cr=function(re){return re[1]},an=function(re,le,ge,ye,ze){le===void 0&&(le=wr),ge===void 0&&(ge=Cr),ye===void 0&&(ye=64),ze===void 0&&(ze=Float64Array),this.nodeSize=ye,this.points=re;for(var je=re.length<65536?Uint16Array:Uint32Array,Ue=this.ids=new je(re.length),Ae=this.coords=new ze(2*re.length),Je=0;Je<re.length;Je++)Ue[Je]=Je,Ae[2*Je]=le(re[Je]),Ae[2*Je+1]=ge(re[Je]);(function wt(Ht,Fr,mr,Sr,fn,xn){if(!(fn-Sr<=mr)){var Lr=Sr+fn>>1;(function Nn(bn,En,io,On,Ao,ia){for(;Ao>On;){if(Ao-On>600){var Ho=Ao-On+1,Ga=io-On+1,Wo=Math.log(Ho),Hl=.5*Math.exp(2*Wo/3),ns=.5*Math.sqrt(Wo*Hl*(Ho-Hl)/Ho)*(Ga-Ho/2<0?-1:1);Nn(bn,En,io,Math.max(On,Math.floor(io-Ga*Hl/Ho+ns)),Math.min(Ao,Math.floor(io+(Ho-Ga)*Hl/Ho+ns)),ia)}var Yo=En[2*io+ia],_a=On,$o=Ao;for(vt(bn,En,On,io),En[2*Ao+ia]>Yo&&vt(bn,En,On,Ao);_a<$o;){for(vt(bn,En,_a,$o),_a++,$o--;En[2*_a+ia]<Yo;)_a++;for(;En[2*$o+ia]>Yo;)$o--}En[2*On+ia]===Yo?vt(bn,En,On,$o):vt(bn,En,++$o,Ao),$o<=io&&(On=$o+1),io<=$o&&(Ao=$o-1)}})(Ht,Fr,Lr,Sr,fn,xn%2),wt(Ht,Fr,mr,Sr,Lr-1,xn+1),wt(Ht,Fr,mr,Lr+1,fn,xn+1)}})(Ue,Ae,ye,0,Ue.length-1,0)};an.prototype.range=function(re,le,ge,ye){return function(ze,je,Ue,Ae,Je,wt,Ht){for(var Fr,mr,Sr=[0,ze.length-1,0],fn=[];Sr.length;){var xn=Sr.pop(),Lr=Sr.pop(),Nn=Sr.pop();if(Lr-Nn<=Ht)for(var bn=Nn;bn<=Lr;bn++)mr=je[2*bn+1],(Fr=je[2*bn])>=Ue&&Fr<=Je&&mr>=Ae&&mr<=wt&&fn.push(ze[bn]);else{var En=Math.floor((Nn+Lr)/2);mr=je[2*En+1],(Fr=je[2*En])>=Ue&&Fr<=Je&&mr>=Ae&&mr<=wt&&fn.push(ze[En]);var io=(xn+1)%2;(xn===0?Ue<=Fr:Ae<=mr)&&(Sr.push(Nn),Sr.push(En-1),Sr.push(io)),(xn===0?Je>=Fr:wt>=mr)&&(Sr.push(En+1),Sr.push(Lr),Sr.push(io))}}return fn}(this.ids,this.coords,re,le,ge,ye,this.nodeSize)},an.prototype.within=function(re,le,ge){return function(ye,ze,je,Ue,Ae,Je){for(var wt=[0,ye.length-1,0],Ht=[],Fr=Ae*Ae;wt.length;){var mr=wt.pop(),Sr=wt.pop(),fn=wt.pop();if(Sr-fn<=Je)for(var xn=fn;xn<=Sr;xn++)ar(ze[2*xn],ze[2*xn+1],je,Ue)<=Fr&&Ht.push(ye[xn]);else{var Lr=Math.floor((fn+Sr)/2),Nn=ze[2*Lr],bn=ze[2*Lr+1];ar(Nn,bn,je,Ue)<=Fr&&Ht.push(ye[Lr]);var En=(mr+1)%2;(mr===0?je-Ae<=Nn:Ue-Ae<=bn)&&(wt.push(fn),wt.push(Lr-1),wt.push(En)),(mr===0?je+Ae>=Nn:Ue+Ae>=bn)&&(wt.push(Lr+1),wt.push(Sr),wt.push(En))}}return Ht}(this.ids,this.coords,re,le,ge,this.nodeSize)};var yi={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(re){return re}},li=function(re){this.options=qo(Object.create(yi),re),this.trees=new Array(this.options.maxZoom+1)};function Uo(re,le,ge,ye,ze){return{x:re,y:le,zoom:1/0,id:ge,parentId:-1,numPoints:ye,properties:ze}}function vi(re,le){var ge=re.geometry.coordinates,ye=ge[1];return{x:Xi(ge[0]),y:Mi(ye),zoom:1/0,index:le,parentId:-1}}function bo(re){return{type:"Feature",id:re.id,properties:So(re),geometry:{type:"Point",coordinates:[(ye=re.x,360*(ye-.5)),(le=re.y,ge=(180-360*le)*Math.PI/180,360*Math.atan(Math.exp(ge))/Math.PI-90)]}};var le,ge,ye}function So(re){var le=re.numPoints,ge=le>=1e4?Math.round(le/1e3)+"k":le>=1e3?Math.round(le/100)/10+"k":le;return qo(qo({},re.properties),{cluster:!0,cluster_id:re.id,point_count:le,point_count_abbreviated:ge})}function Xi(re){return re/360+.5}function Mi(re){var le=Math.sin(re*Math.PI/180),ge=.5-.25*Math.log((1+le)/(1-le))/Math.PI;return ge<0?0:ge>1?1:ge}function qo(re,le){for(var ge in le)re[ge]=le[ge];return re}function ui(re){return re.x}function Qi(re){return re.y}function Vi(re,le,ge,ye,ze,je){var Ue=ze-ge,Ae=je-ye;if(Ue!==0||Ae!==0){var Je=((re-ge)*Ue+(le-ye)*Ae)/(Ue*Ue+Ae*Ae);Je>1?(ge=ze,ye=je):Je>0&&(ge+=Ue*Je,ye+=Ae*Je)}return(Ue=re-ge)*Ue+(Ae=le-ye)*Ae}function Pi(re,le,ge,ye){var ze={id:re===void 0?null:re,type:le,geometry:ge,tags:ye,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(je){var Ue=je.geometry,Ae=je.type;if(Ae==="Point"||Ae==="MultiPoint"||Ae==="LineString")ds(je,Ue);else if(Ae==="Polygon"||Ae==="MultiLineString")for(var Je=0;Je<Ue.length;Je++)ds(je,Ue[Je]);else if(Ae==="MultiPolygon")for(Je=0;Je<Ue.length;Je++)for(var wt=0;wt<Ue[Je].length;wt++)ds(je,Ue[Je][wt])}(ze),ze}function ds(re,le){for(var ge=0;ge<le.length;ge+=3)re.minX=Math.min(re.minX,le[ge]),re.minY=Math.min(re.minY,le[ge+1]),re.maxX=Math.max(re.maxX,le[ge]),re.maxY=Math.max(re.maxY,le[ge+1])}function Ur(re,le,ge,ye){if(le.geometry){var ze=le.geometry.coordinates,je=le.geometry.type,Ue=Math.pow(ge.tolerance/((1<<ge.maxZoom)*ge.extent),2),Ae=[],Je=le.id;if(ge.promoteId?Je=le.properties[ge.promoteId]:ge.generateId&&(Je=ye||0),je==="Point")ls(ze,Ae);else if(je==="MultiPoint")for(var wt=0;wt<ze.length;wt++)ls(ze[wt],Ae);else if(je==="LineString")dr(ze,Ae,Ue,!1);else if(je==="MultiLineString"){if(ge.lineMetrics){for(wt=0;wt<ze.length;wt++)dr(ze[wt],Ae=[],Ue,!1),re.push(Pi(Je,"LineString",Ae,le.properties));return}he(ze,Ae,Ue,!1)}else if(je==="Polygon")he(ze,Ae,Ue,!0);else{if(je!=="MultiPolygon"){if(je==="GeometryCollection"){for(wt=0;wt<le.geometry.geometries.length;wt++)Ur(re,{id:Je,geometry:le.geometry.geometries[wt],properties:le.properties},ge,ye);return}throw new Error("Input data is not a valid GeoJSON object.")}for(wt=0;wt<ze.length;wt++){var Ht=[];he(ze[wt],Ht,Ue,!0),Ae.push(Ht)}}re.push(Pi(Je,je,Ae,le.properties))}}function ls(re,le){le.push(We(re[0])),le.push(at(re[1])),le.push(0)}function dr(re,le,ge,ye){for(var ze,je,Ue=0,Ae=0;Ae<re.length;Ae++){var Je=We(re[Ae][0]),wt=at(re[Ae][1]);le.push(Je),le.push(wt),le.push(0),Ae>0&&(Ue+=ye?(ze*wt-Je*je)/2:Math.sqrt(Math.pow(Je-ze,2)+Math.pow(wt-je,2))),ze=Je,je=wt}var Ht=le.length-3;le[2]=1,function Fr(mr,Sr,fn,xn){for(var Lr,Nn=xn,bn=fn-Sr>>1,En=fn-Sr,io=mr[Sr],On=mr[Sr+1],Ao=mr[fn],ia=mr[fn+1],Ho=Sr+3;Ho<fn;Ho+=3){var Ga=Vi(mr[Ho],mr[Ho+1],io,On,Ao,ia);if(Ga>Nn)Lr=Ho,Nn=Ga;else if(Ga===Nn){var Wo=Math.abs(Ho-bn);Wo<En&&(Lr=Ho,En=Wo)}}Nn>xn&&(Lr-Sr>3&&Fr(mr,Sr,Lr,xn),mr[Lr+2]=Nn,fn-Lr>3&&Fr(mr,Lr,fn,xn))}(le,0,Ht,ge),le[Ht+2]=1,le.size=Math.abs(Ue),le.start=0,le.end=le.size}function he(re,le,ge,ye){for(var ze=0;ze<re.length;ze++){var je=[];dr(re[ze],je,ge,ye),le.push(je)}}function We(re){return re/360+.5}function at(re){var le=Math.sin(re*Math.PI/180),ge=.5-.25*Math.log((1+le)/(1-le))/Math.PI;return ge<0?0:ge>1?1:ge}function Ot(re,le,ge,ye,ze,je,Ue,Ae){if(ye/=le,je>=(ge/=le)&&Ue<ye)return re;if(Ue<ge||je>=ye)return null;for(var Je=[],wt=0;wt<re.length;wt++){var Ht=re[wt],Fr=Ht.geometry,mr=Ht.type,Sr=ze===0?Ht.minX:Ht.minY,fn=ze===0?Ht.maxX:Ht.maxY;if(Sr>=ge&&fn<ye)Je.push(Ht);else if(!(fn<ge||Sr>=ye)){var xn=[];if(mr==="Point"||mr==="MultiPoint")or(Fr,xn,ge,ye,ze);else if(mr==="LineString")Wr(Fr,xn,ge,ye,ze,!1,Ae.lineMetrics);else if(mr==="MultiLineString")kn(Fr,xn,ge,ye,ze,!1);else if(mr==="Polygon")kn(Fr,xn,ge,ye,ze,!0);else if(mr==="MultiPolygon")for(var Lr=0;Lr<Fr.length;Lr++){var Nn=[];kn(Fr[Lr],Nn,ge,ye,ze,!0),Nn.length&&xn.push(Nn)}if(xn.length){if(Ae.lineMetrics&&mr==="LineString"){for(Lr=0;Lr<xn.length;Lr++)Je.push(Pi(Ht.id,mr,xn[Lr],Ht.tags));continue}mr!=="LineString"&&mr!=="MultiLineString"||(xn.length===1?(mr="LineString",xn=xn[0]):mr="MultiLineString"),mr!=="Point"&&mr!=="MultiPoint"||(mr=xn.length===3?"Point":"MultiPoint"),Je.push(Pi(Ht.id,mr,xn,Ht.tags))}}}return Je.length?Je:null}function or(re,le,ge,ye,ze){for(var je=0;je<re.length;je+=3){var Ue=re[je+ze];Ue>=ge&&Ue<=ye&&(le.push(re[je]),le.push(re[je+1]),le.push(re[je+2]))}}function Wr(re,le,ge,ye,ze,je,Ue){for(var Ae,Je,wt=In(re),Ht=ze===0?un:To,Fr=re.start,mr=0;mr<re.length-3;mr+=3){var Sr=re[mr],fn=re[mr+1],xn=re[mr+2],Lr=re[mr+3],Nn=re[mr+4],bn=ze===0?Sr:fn,En=ze===0?Lr:Nn,io=!1;Ue&&(Ae=Math.sqrt(Math.pow(Sr-Lr,2)+Math.pow(fn-Nn,2))),bn<ge?En>ge&&(Je=Ht(wt,Sr,fn,Lr,Nn,ge),Ue&&(wt.start=Fr+Ae*Je)):bn>ye?En<ye&&(Je=Ht(wt,Sr,fn,Lr,Nn,ye),Ue&&(wt.start=Fr+Ae*Je)):eo(wt,Sr,fn,xn),En<ge&&bn>=ge&&(Je=Ht(wt,Sr,fn,Lr,Nn,ge),io=!0),En>ye&&bn<=ye&&(Je=Ht(wt,Sr,fn,Lr,Nn,ye),io=!0),!je&&io&&(Ue&&(wt.end=Fr+Ae*Je),le.push(wt),wt=In(re)),Ue&&(Fr+=Ae)}var On=re.length-3;Sr=re[On],fn=re[On+1],xn=re[On+2],(bn=ze===0?Sr:fn)>=ge&&bn<=ye&&eo(wt,Sr,fn,xn),On=wt.length-3,je&&On>=3&&(wt[On]!==wt[0]||wt[On+1]!==wt[1])&&eo(wt,wt[0],wt[1],wt[2]),wt.length&&le.push(wt)}function In(re){var le=[];return le.size=re.size,le.start=re.start,le.end=re.end,le}function kn(re,le,ge,ye,ze,je){for(var Ue=0;Ue<re.length;Ue++)Wr(re[Ue],le,ge,ye,ze,je,!1)}function eo(re,le,ge,ye){re.push(le),re.push(ge),re.push(ye)}function un(re,le,ge,ye,ze,je){var Ue=(je-le)/(ye-le);return re.push(je),re.push(ge+(ze-ge)*Ue),re.push(1),Ue}function To(re,le,ge,ye,ze,je){var Ue=(je-ge)/(ze-ge);return re.push(le+(ye-le)*Ue),re.push(je),re.push(1),Ue}function Ti(re,le){for(var ge=[],ye=0;ye<re.length;ye++){var ze,je=re[ye],Ue=je.type;if(Ue==="Point"||Ue==="MultiPoint"||Ue==="LineString")ze=Lo(je.geometry,le);else if(Ue==="MultiLineString"||Ue==="Polygon"){ze=[];for(var Ae=0;Ae<je.geometry.length;Ae++)ze.push(Lo(je.geometry[Ae],le))}else if(Ue==="MultiPolygon")for(ze=[],Ae=0;Ae<je.geometry.length;Ae++){for(var Je=[],wt=0;wt<je.geometry[Ae].length;wt++)Je.push(Lo(je.geometry[Ae][wt],le));ze.push(Je)}ge.push(Pi(je.id,Ue,ze,je.tags))}return ge}function Lo(re,le){var ge=[];ge.size=re.size,re.start!==void 0&&(ge.start=re.start,ge.end=re.end);for(var ye=0;ye<re.length;ye+=3)ge.push(re[ye]+le,re[ye+1],re[ye+2]);return ge}function wa(re,le){if(re.transformed)return re;var ge,ye,ze,je=1<<re.z,Ue=re.x,Ae=re.y;for(ge=0;ge<re.features.length;ge++){var Je=re.features[ge],wt=Je.geometry,Ht=Je.type;if(Je.geometry=[],Ht===1)for(ye=0;ye<wt.length;ye+=2)Je.geometry.push(dn(wt[ye],wt[ye+1],le,je,Ue,Ae));else for(ye=0;ye<wt.length;ye++){var Fr=[];for(ze=0;ze<wt[ye].length;ze+=2)Fr.push(dn(wt[ye][ze],wt[ye][ze+1],le,je,Ue,Ae));Je.geometry.push(Fr)}}return re.transformed=!0,re}function dn(re,le,ge,ye,ze,je){return[Math.round(ge*(re*ye-ze)),Math.round(ge*(le*ye-je))]}function co(re,le,ge,ye,ze){for(var je=le===ze.maxZoom?0:ze.tolerance/((1<<le)*ze.extent),Ue={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:ge,y:ye,z:le,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},Ae=0;Ae<re.length;Ae++){Ue.numFeatures++,no(Ue,re[Ae],je,ze);var Je=re[Ae].minX,wt=re[Ae].minY,Ht=re[Ae].maxX,Fr=re[Ae].maxY;Je<Ue.minX&&(Ue.minX=Je),wt<Ue.minY&&(Ue.minY=wt),Ht>Ue.maxX&&(Ue.maxX=Ht),Fr>Ue.maxY&&(Ue.maxY=Fr)}return Ue}function no(re,le,ge,ye){var ze=le.geometry,je=le.type,Ue=[];if(je==="Point"||je==="MultiPoint")for(var Ae=0;Ae<ze.length;Ae+=3)Ue.push(ze[Ae]),Ue.push(ze[Ae+1]),re.numPoints++,re.numSimplified++;else if(je==="LineString")Za(Ue,ze,re,ge,!1,!1);else if(je==="MultiLineString"||je==="Polygon")for(Ae=0;Ae<ze.length;Ae++)Za(Ue,ze[Ae],re,ge,je==="Polygon",Ae===0);else if(je==="MultiPolygon")for(var Je=0;Je<ze.length;Je++){var wt=ze[Je];for(Ae=0;Ae<wt.length;Ae++)Za(Ue,wt[Ae],re,ge,!0,Ae===0)}if(Ue.length){var Ht=le.tags||null;if(je==="LineString"&&ye.lineMetrics){for(var Fr in Ht={},le.tags)Ht[Fr]=le.tags[Fr];Ht.mapbox_clip_start=ze.start/ze.size,Ht.mapbox_clip_end=ze.end/ze.size}var mr={geometry:Ue,type:je==="Polygon"||je==="MultiPolygon"?3:je==="LineString"||je==="MultiLineString"?2:1,tags:Ht};le.id!==null&&(mr.id=le.id),re.features.push(mr)}}function Za(re,le,ge,ye,ze,je){var Ue=ye*ye;if(ye>0&&le.size<(ze?Ue:ye))ge.numPoints+=le.length/3;else{for(var Ae=[],Je=0;Je<le.length;Je+=3)(ye===0||le[Je+2]>Ue)&&(ge.numSimplified++,Ae.push(le[Je]),Ae.push(le[Je+1])),ge.numPoints++;ze&&function(wt,Ht){for(var Fr=0,mr=0,Sr=wt.length,fn=Sr-2;mr<Sr;fn=mr,mr+=2)Fr+=(wt[mr]-wt[fn])*(wt[mr+1]+wt[fn+1]);if(Fr>0===Ht)for(mr=0,Sr=wt.length;mr<Sr/2;mr+=2){var xn=wt[mr],Lr=wt[mr+1];wt[mr]=wt[Sr-2-mr],wt[mr+1]=wt[Sr-1-mr],wt[Sr-2-mr]=xn,wt[Sr-1-mr]=Lr}}(Ae,je),re.push(Ae)}}function ms(re,le){var ge=(le=this.options=function(ze,je){for(var Ue in je)ze[Ue]=je[Ue];return ze}(Object.create(this.options),le)).debug;if(ge&&console.time("preprocess data"),le.maxZoom<0||le.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(le.promoteId&&le.generateId)throw new Error("promoteId and generateId cannot be used together.");var ye=function(ze,je){var Ue=[];if(ze.type==="FeatureCollection")for(var Ae=0;Ae<ze.features.length;Ae++)Ur(Ue,ze.features[Ae],je,Ae);else Ur(Ue,ze.type==="Feature"?ze:{geometry:ze},je);return Ue}(re,le);this.tiles={},this.tileCoords=[],ge&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",le.indexMaxZoom,le.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(ye=function(ze,je){var Ue=je.buffer/je.extent,Ae=ze,Je=Ot(ze,1,-1-Ue,Ue,0,-1,2,je),wt=Ot(ze,1,1-Ue,2+Ue,0,-1,2,je);return(Je||wt)&&(Ae=Ot(ze,1,-Ue,1+Ue,0,-1,2,je)||[],Je&&(Ae=Ti(Je,1).concat(Ae)),wt&&(Ae=Ae.concat(Ti(wt,-1)))),Ae}(ye,le)).length&&this.splitTile(ye,0,0,0),ge&&(ye.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)))}function Ji(re,le,ge){return 32*((1<<re)*ge+le)+re}function Us(re,le){var ge=re.tileID.canonical;if(!this._geoJSONIndex)return le(null,null);var ye=this._geoJSONIndex.getTile(ge.z,ge.x,ge.y);if(!ye)return le(null,null);var ze=new pn(ye.features),je=xr(ze);je.byteOffset===0&&je.byteLength===je.buffer.byteLength||(je=new Uint8Array(je)),le(null,{vectorTile:ze,rawData:je.buffer})}li.prototype.load=function(re){var le=this.options,ge=le.log,ye=le.minZoom,ze=le.maxZoom,je=le.nodeSize;ge&&console.time("total time");var Ue="prepare "+re.length+" points";ge&&console.time(Ue),this.points=re;for(var Ae=[],Je=0;Je<re.length;Je++)re[Je].geometry&&Ae.push(vi(re[Je],Je));this.trees[ze+1]=new an(Ae,ui,Qi,je,Float32Array),ge&&console.timeEnd(Ue);for(var wt=ze;wt>=ye;wt--){var Ht=+Date.now();Ae=this._cluster(Ae,wt),this.trees[wt]=new an(Ae,ui,Qi,je,Float32Array),ge&&console.log("z%d: %d clusters in %dms",wt,Ae.length,+Date.now()-Ht)}return ge&&console.timeEnd("total time"),this},li.prototype.getClusters=function(re,le){var ge=((re[0]+180)%360+360)%360-180,ye=Math.max(-90,Math.min(90,re[1])),ze=re[2]===180?180:((re[2]+180)%360+360)%360-180,je=Math.max(-90,Math.min(90,re[3]));if(re[2]-re[0]>=360)ge=-180,ze=180;else if(ge>ze){var Ue=this.getClusters([ge,ye,180,je],le),Ae=this.getClusters([-180,ye,ze,je],le);return Ue.concat(Ae)}for(var Je=this.trees[this._limitZoom(le)],wt=[],Ht=0,Fr=Je.range(Xi(ge),Mi(je),Xi(ze),Mi(ye));Ht<Fr.length;Ht+=1){var mr=Je.points[Fr[Ht]];wt.push(mr.numPoints?bo(mr):this.points[mr.index])}return wt},li.prototype.getChildren=function(re){var le=this._getOriginId(re),ge=this._getOriginZoom(re),ye="No cluster with the specified id.",ze=this.trees[ge];if(!ze)throw new Error(ye);var je=ze.points[le];if(!je)throw new Error(ye);for(var Ue=this.options.radius/(this.options.extent*Math.pow(2,ge-1)),Ae=[],Je=0,wt=ze.within(je.x,je.y,Ue);Je<wt.length;Je+=1){var Ht=ze.points[wt[Je]];Ht.parentId===re&&Ae.push(Ht.numPoints?bo(Ht):this.points[Ht.index])}if(Ae.length===0)throw new Error(ye);return Ae},li.prototype.getLeaves=function(re,le,ge){var ye=[];return this._appendLeaves(ye,re,le=le||10,ge=ge||0,0),ye},li.prototype.getTile=function(re,le,ge){var ye=this.trees[this._limitZoom(re)],ze=Math.pow(2,re),je=this.options,Ue=je.radius/je.extent,Ae=(ge-Ue)/ze,Je=(ge+1+Ue)/ze,wt={features:[]};return this._addTileFeatures(ye.range((le-Ue)/ze,Ae,(le+1+Ue)/ze,Je),ye.points,le,ge,ze,wt),le===0&&this._addTileFeatures(ye.range(1-Ue/ze,Ae,1,Je),ye.points,ze,ge,ze,wt),le===ze-1&&this._addTileFeatures(ye.range(0,Ae,Ue/ze,Je),ye.points,-1,ge,ze,wt),wt.features.length?wt:null},li.prototype.getClusterExpansionZoom=function(re){for(var le=this._getOriginZoom(re)-1;le<=this.options.maxZoom;){var ge=this.getChildren(re);if(le++,ge.length!==1)break;re=ge[0].properties.cluster_id}return le},li.prototype._appendLeaves=function(re,le,ge,ye,ze){for(var je=0,Ue=this.getChildren(le);je<Ue.length;je+=1){var Ae=Ue[je],Je=Ae.properties;if(Je&&Je.cluster?ze+Je.point_count<=ye?ze+=Je.point_count:ze=this._appendLeaves(re,Je.cluster_id,ge,ye,ze):ze<ye?ze++:re.push(Ae),re.length===ge)break}return ze},li.prototype._addTileFeatures=function(re,le,ge,ye,ze,je){for(var Ue=0,Ae=re;Ue<Ae.length;Ue+=1){var Je=le[Ae[Ue]],wt=Je.numPoints,Ht={type:1,geometry:[[Math.round(this.options.extent*(Je.x*ze-ge)),Math.round(this.options.extent*(Je.y*ze-ye))]],tags:wt?So(Je):this.points[Je.index].properties},Fr=void 0;wt?Fr=Je.id:this.options.generateId?Fr=Je.index:this.points[Je.index].id&&(Fr=this.points[Je.index].id),Fr!==void 0&&(Ht.id=Fr),je.features.push(Ht)}},li.prototype._limitZoom=function(re){return Math.max(this.options.minZoom,Math.min(+re,this.options.maxZoom+1))},li.prototype._cluster=function(re,le){for(var ge=[],ye=this.options,ze=ye.reduce,je=ye.minPoints,Ue=ye.radius/(ye.extent*Math.pow(2,le)),Ae=0;Ae<re.length;Ae++){var Je=re[Ae];if(!(Je.zoom<=le)){Je.zoom=le;for(var wt=this.trees[le+1],Ht=wt.within(Je.x,Je.y,Ue),Fr=Je.numPoints||1,mr=Fr,Sr=0,fn=Ht;Sr<fn.length;Sr+=1){var xn=wt.points[fn[Sr]];xn.zoom>le&&(mr+=xn.numPoints||1)}if(mr>=je){for(var Lr=Je.x*Fr,Nn=Je.y*Fr,bn=ze&&Fr>1?this._map(Je,!0):null,En=(Ae<<5)+(le+1)+this.points.length,io=0,On=Ht;io<On.length;io+=1){var Ao=wt.points[On[io]];if(!(Ao.zoom<=le)){Ao.zoom=le;var ia=Ao.numPoints||1;Lr+=Ao.x*ia,Nn+=Ao.y*ia,Ao.parentId=En,ze&&(bn||(bn=this._map(Je,!0)),ze(bn,this._map(Ao)))}}Je.parentId=En,ge.push(Uo(Lr/mr,Nn/mr,En,mr,bn))}else if(ge.push(Je),mr>1)for(var Ho=0,Ga=Ht;Ho<Ga.length;Ho+=1){var Wo=wt.points[Ga[Ho]];Wo.zoom<=le||(Wo.zoom=le,ge.push(Wo))}}}return ge},li.prototype._getOriginId=function(re){return re-this.points.length>>5},li.prototype._getOriginZoom=function(re){return(re-this.points.length)%32},li.prototype._map=function(re,le){if(re.numPoints)return le?qo({},re.properties):re.properties;var ge=this.points[re.index].properties,ye=this.options.map(ge);return le&&ye===ge?qo({},ye):ye},ms.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},ms.prototype.splitTile=function(re,le,ge,ye,ze,je,Ue){for(var Ae=[re,le,ge,ye],Je=this.options,wt=Je.debug;Ae.length;){ye=Ae.pop(),ge=Ae.pop(),le=Ae.pop(),re=Ae.pop();var Ht=1<<le,Fr=Ji(le,ge,ye),mr=this.tiles[Fr];if(!mr&&(wt>1&&console.time("creation"),mr=this.tiles[Fr]=co(re,le,ge,ye,Je),this.tileCoords.push({z:le,x:ge,y:ye}),wt)){wt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",le,ge,ye,mr.numFeatures,mr.numPoints,mr.numSimplified),console.timeEnd("creation"));var Sr="z"+le;this.stats[Sr]=(this.stats[Sr]||0)+1,this.total++}if(mr.source=re,ze){if(le===Je.maxZoom||le===ze)continue;var fn=1<<ze-le;if(ge!==Math.floor(je/fn)||ye!==Math.floor(Ue/fn))continue}else if(le===Je.indexMaxZoom||mr.numPoints<=Je.indexMaxPoints)continue;if(mr.source=null,re.length!==0){wt>1&&console.time("clipping");var xn,Lr,Nn,bn,En,io,On=.5*Je.buffer/Je.extent,Ao=.5-On,ia=.5+On,Ho=1+On;xn=Lr=Nn=bn=null,En=Ot(re,Ht,ge-On,ge+ia,0,mr.minX,mr.maxX,Je),io=Ot(re,Ht,ge+Ao,ge+Ho,0,mr.minX,mr.maxX,Je),re=null,En&&(xn=Ot(En,Ht,ye-On,ye+ia,1,mr.minY,mr.maxY,Je),Lr=Ot(En,Ht,ye+Ao,ye+Ho,1,mr.minY,mr.maxY,Je),En=null),io&&(Nn=Ot(io,Ht,ye-On,ye+ia,1,mr.minY,mr.maxY,Je),bn=Ot(io,Ht,ye+Ao,ye+Ho,1,mr.minY,mr.maxY,Je),io=null),wt>1&&console.timeEnd("clipping"),Ae.push(xn||[],le+1,2*ge,2*ye),Ae.push(Lr||[],le+1,2*ge,2*ye+1),Ae.push(Nn||[],le+1,2*ge+1,2*ye),Ae.push(bn||[],le+1,2*ge+1,2*ye+1)}}},ms.prototype.getTile=function(re,le,ge){var ye=this.options,ze=ye.extent,je=ye.debug;if(re<0||re>24)return null;var Ue=1<<re,Ae=Ji(re,le=(le%Ue+Ue)%Ue,ge);if(this.tiles[Ae])return wa(this.tiles[Ae],ze);je>1&&console.log("drilling down to z%d-%d-%d",re,le,ge);for(var Je,wt=re,Ht=le,Fr=ge;!Je&&wt>0;)wt--,Ht=Math.floor(Ht/2),Fr=Math.floor(Fr/2),Je=this.tiles[Ji(wt,Ht,Fr)];return Je&&Je.source?(je>1&&console.log("found parent tile z%d-%d-%d",wt,Ht,Fr),je>1&&console.time("drilling down"),this.splitTile(Je.source,wt,Ht,Fr,re,le,ge),je>1&&console.timeEnd("drilling down"),this.tiles[Ae]?wa(this.tiles[Ae],ze):null):null};var Lt=function(re){function le(ge,ye,ze,je){re.call(this,ge,ye,ze,Us),je&&(this.loadGeoJSON=je)}return re&&(le.__proto__=re),(le.prototype=Object.create(re&&re.prototype)).constructor=le,le.prototype.loadData=function(ge,ye){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=ye,this._pendingLoadDataParams=ge,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},le.prototype._loadData=function(){var ge=this;if(this._pendingCallback&&this._pendingLoadDataParams){var ye=this._pendingCallback,ze=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var je=!!(ze&&ze.request&&ze.request.collectResourceTiming)&&new M.RequestPerformance(ze.request);this.loadGeoJSON(ze,function(Ue,Ae){if(Ue||!Ae)return ye(Ue);if(typeof Ae!="object")return ye(new Error("Input data given to '"+ze.source+"' is not a valid GeoJSON object."));(function mr(Sr,fn){var xn,Lr=Sr&&Sr.type;if(Lr==="FeatureCollection")for(xn=0;xn<Sr.features.length;xn++)mr(Sr.features[xn],fn);else if(Lr==="GeometryCollection")for(xn=0;xn<Sr.geometries.length;xn++)mr(Sr.geometries[xn],fn);else if(Lr==="Feature")mr(Sr.geometry,fn);else if(Lr==="Polygon")et(Sr.coordinates,fn);else if(Lr==="MultiPolygon")for(xn=0;xn<Sr.coordinates.length;xn++)et(Sr.coordinates[xn],fn);return Sr})(Ae,!0);try{if(ze.filter){var Je=M.createExpression(ze.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Je.result==="error")throw new Error(Je.value.map(function(mr){return mr.key+": "+mr.message}).join(", "));var wt=Ae.features.filter(function(mr){return Je.value.evaluate({zoom:0},mr)});Ae={type:"FeatureCollection",features:wt}}ge._geoJSONIndex=ze.cluster?new li(function(mr){var Sr=mr.superclusterOptions,fn=mr.clusterProperties;if(!fn||!Sr)return Sr;for(var xn={},Lr={},Nn={accumulated:null,zoom:0},bn={properties:null},En=Object.keys(fn),io=0,On=En;io<On.length;io+=1){var Ao=On[io],ia=fn[Ao],Ho=ia[0],Ga=M.createExpression(ia[1]),Wo=M.createExpression(typeof Ho=="string"?[Ho,["accumulated"],["get",Ao]]:Ho);xn[Ao]=Ga.value,Lr[Ao]=Wo.value}return Sr.map=function(Hl){bn.properties=Hl;for(var ns={},Yo=0,_a=En;Yo<_a.length;Yo+=1){var $o=_a[Yo];ns[$o]=xn[$o].evaluate(Nn,bn)}return ns},Sr.reduce=function(Hl,ns){bn.properties=ns;for(var Yo=0,_a=En;Yo<_a.length;Yo+=1){var $o=_a[Yo];Nn.accumulated=Hl[$o],Hl[$o]=Lr[$o].evaluate(Nn,bn)}},Sr}(ze)).load(Ae.features):function(mr,Sr){return new ms(mr,Sr)}(Ae,ze.geojsonVtOptions)}catch(mr){return ye(mr)}ge.loaded={};var Ht={};if(je){var Fr=je.finish();Fr&&(Ht.resourceTiming={},Ht.resourceTiming[ze.source]=JSON.parse(JSON.stringify(Fr)))}ye(null,Ht)})}},le.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},le.prototype.reloadTile=function(ge,ye){var ze=this.loaded;return ze&&ze[ge.uid]?re.prototype.reloadTile.call(this,ge,ye):this.loadTile(ge,ye)},le.prototype.loadGeoJSON=function(ge,ye){if(ge.request)M.getJSON(ge.request,ye);else{if(typeof ge.data!="string")return ye(new Error("Input data given to '"+ge.source+"' is not a valid GeoJSON object."));try{return ye(null,JSON.parse(ge.data))}catch(ze){return ye(new Error("Input data given to '"+ge.source+"' is not a valid GeoJSON object."))}}},le.prototype.removeSource=function(ge,ye){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),ye()},le.prototype.getClusterExpansionZoom=function(ge,ye){try{ye(null,this._geoJSONIndex.getClusterExpansionZoom(ge.clusterId))}catch(ze){ye(ze)}},le.prototype.getClusterChildren=function(ge,ye){try{ye(null,this._geoJSONIndex.getChildren(ge.clusterId))}catch(ze){ye(ze)}},le.prototype.getClusterLeaves=function(ge,ye){try{ye(null,this._geoJSONIndex.getLeaves(ge.clusterId,ge.limit,ge.offset))}catch(ze){ye(ze)}},le}(Xe),Ne=function(re){var le=this;this.self=re,this.actor=new M.Actor(re,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Xe,geojson:Lt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(ge,ye){if(le.workerSourceTypes[ge])throw new Error('Worker source with name "'+ge+'" already registered.');le.workerSourceTypes[ge]=ye},this.self.registerRTLTextPlugin=function(ge){if(M.plugin.isParsed())throw new Error("RTL text plugin already registered.");M.plugin.applyArabicShaping=ge.applyArabicShaping,M.plugin.processBidirectionalText=ge.processBidirectionalText,M.plugin.processStyledBidirectionalText=ge.processStyledBidirectionalText}};return Ne.prototype.setReferrer=function(re,le){this.referrer=le},Ne.prototype.setImages=function(re,le,ge){for(var ye in this.availableImages[re]=le,this.workerSources[re]){var ze=this.workerSources[re][ye];for(var je in ze)ze[je].availableImages=le}ge()},Ne.prototype.setLayers=function(re,le,ge){this.getLayerIndex(re).replace(le),ge()},Ne.prototype.updateLayers=function(re,le,ge){this.getLayerIndex(re).update(le.layers,le.removedIds),ge()},Ne.prototype.loadTile=function(re,le,ge){this.getWorkerSource(re,le.type,le.source).loadTile(le,ge)},Ne.prototype.loadDEMTile=function(re,le,ge){this.getDEMWorkerSource(re,le.source).loadTile(le,ge)},Ne.prototype.reloadTile=function(re,le,ge){this.getWorkerSource(re,le.type,le.source).reloadTile(le,ge)},Ne.prototype.abortTile=function(re,le,ge){this.getWorkerSource(re,le.type,le.source).abortTile(le,ge)},Ne.prototype.removeTile=function(re,le,ge){this.getWorkerSource(re,le.type,le.source).removeTile(le,ge)},Ne.prototype.removeDEMTile=function(re,le){this.getDEMWorkerSource(re,le.source).removeTile(le)},Ne.prototype.removeSource=function(re,le,ge){if(this.workerSources[re]&&this.workerSources[re][le.type]&&this.workerSources[re][le.type][le.source]){var ye=this.workerSources[re][le.type][le.source];delete this.workerSources[re][le.type][le.source],ye.removeSource!==void 0?ye.removeSource(le,ge):ge()}},Ne.prototype.loadWorkerSource=function(re,le,ge){try{this.self.importScripts(le.url),ge()}catch(ye){ge(ye.toString())}},Ne.prototype.syncRTLPluginState=function(re,le,ge){try{M.plugin.setState(le);var ye=M.plugin.getPluginURL();if(M.plugin.isLoaded()&&!M.plugin.isParsed()&&ye!=null){this.self.importScripts(ye);var ze=M.plugin.isParsed();ge(ze?void 0:new Error("RTL Text Plugin failed to import scripts from "+ye),ze)}}catch(je){ge(je.toString())}},Ne.prototype.getAvailableImages=function(re){var le=this.availableImages[re];return le||(le=[]),le},Ne.prototype.getLayerIndex=function(re){var le=this.layerIndexes[re];return le||(le=this.layerIndexes[re]=new be),le},Ne.prototype.getWorkerSource=function(re,le,ge){var ye=this;return this.workerSources[re]||(this.workerSources[re]={}),this.workerSources[re][le]||(this.workerSources[re][le]={}),this.workerSources[re][le][ge]||(this.workerSources[re][le][ge]=new this.workerSourceTypes[le]({send:function(ze,je,Ue){ye.actor.send(ze,je,Ue,re)}},this.getLayerIndex(re),this.getAvailableImages(re))),this.workerSources[re][le][ge]},Ne.prototype.getDEMWorkerSource=function(re,le){return this.demWorkerSources[re]||(this.demWorkerSources[re]={}),this.demWorkerSources[re][le]||(this.demWorkerSources[re][le]=new Ve),this.demWorkerSources[re][le]},Ne.prototype.enforceCacheSizeLimit=function(re,le){M.enforceCacheSizeLimit(le)},typeof WorkerGlobalScope!="undefined"&&typeof self!="undefined"&&self instanceof WorkerGlobalScope&&(self.worker=new Ne(self)),Ne}),Ze(["./shared"],function(M){"use strict";var R=M.createCommonjsModule(function(h){function g(B){return!d(B)}function d(B){return typeof window=="undefined"||typeof document=="undefined"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var q,te,fe=new Blob([""],{type:"text/javascript"}),ce=URL.createObjectURL(fe);try{te=new Worker(ce),q=!0}catch(Te){q=!1}return te&&te.terminate(),URL.revokeObjectURL(ce),q}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var q=document.createElement("canvas");q.width=q.height=1;var te=q.getContext("2d");if(!te)return!1;var fe=te.getImageData(0,0,1,1);return fe&&fe.width===q.width}()?(b[G=B&&B.failIfMajorPerformanceCaveat]===void 0&&(b[G]=function(q){var te=function(ce){var Te=document.createElement("canvas"),Ie=Object.create(g.webGLContextAttributes);return Ie.failIfMajorPerformanceCaveat=ce,Te.probablySupportsContext?Te.probablySupportsContext("webgl",Ie)||Te.probablySupportsContext("experimental-webgl",Ie):Te.supportsContext?Te.supportsContext("webgl",Ie)||Te.supportsContext("experimental-webgl",Ie):Te.getContext("webgl",Ie)||Te.getContext("experimental-webgl",Ie)}(q);if(!te)return!1;var fe=te.createShader(te.VERTEX_SHADER);return!(!fe||te.isContextLost())&&(te.shaderSource(fe,"void main() {}"),te.compileShader(fe),te.getShaderParameter(fe,te.COMPILE_STATUS)===!0)}(G)),b[G]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var G}h.exports?h.exports=g:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=g,window.mapboxgl.notSupportedReason=d);var b={};g.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),de={create:function(h,g,d){var b=M.window.document.createElement(h);return g!==void 0&&(b.className=g),d&&d.appendChild(b),b},createNS:function(h,g){return M.window.document.createElementNS(h,g)}},be=M.window.document&&M.window.document.documentElement.style;function Le(h){if(!be)return h[0];for(var g=0;g<h.length;g++)if(h[g]in be)return h[g];return h[0]}var Re,Ce=Le(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);de.disableDrag=function(){be&&Ce&&(Re=be[Ce],be[Ce]="none")},de.enableDrag=function(){be&&Ce&&(be[Ce]=Re)};var He=Le(["transform","WebkitTransform"]);de.setTransform=function(h,g){h.style[He]=g};var Xe=!1;try{var Ke=Object.defineProperty({},"passive",{get:function(){Xe=!0}});M.window.addEventListener("test",Ke,Ke),M.window.removeEventListener("test",Ke,Ke)}catch(h){Xe=!1}de.addEventListener=function(h,g,d,b){b===void 0&&(b={}),h.addEventListener(g,d,"passive"in b&&Xe?b:b.capture)},de.removeEventListener=function(h,g,d,b){b===void 0&&(b={}),h.removeEventListener(g,d,"passive"in b&&Xe?b:b.capture)};var Ve=function(h){h.preventDefault(),h.stopPropagation(),M.window.removeEventListener("click",Ve,!0)};function et(h){var g=h.userImage;return!!(g&&g.render&&g.render())&&(h.data.replace(new Uint8Array(g.data.buffer)),!0)}de.suppressClick=function(){M.window.addEventListener("click",Ve,!0),M.window.setTimeout(function(){M.window.removeEventListener("click",Ve,!0)},0)},de.mousePos=function(h,g){var d=h.getBoundingClientRect();return new M.Point(g.clientX-d.left-h.clientLeft,g.clientY-d.top-h.clientTop)},de.touchPos=function(h,g){for(var d=h.getBoundingClientRect(),b=[],B=0;B<g.length;B++)b.push(new M.Point(g[B].clientX-d.left-h.clientLeft,g[B].clientY-d.top-h.clientTop));return b},de.mouseButton=function(h){return M.window.InstallTrigger!==void 0&&h.button===2&&h.ctrlKey&&M.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:h.button},de.remove=function(h){h.parentNode&&h.parentNode.removeChild(h)};var er=function(h){function g(){h.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new M.RGBAImage({width:1,height:1}),this.dirty=!0}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.isLoaded=function(){return this.loaded},g.prototype.setLoaded=function(d){if(this.loaded!==d&&(this.loaded=d,d)){for(var b=0,B=this.requestors;b<B.length;b+=1){var G=B[b];this._notify(G.ids,G.callback)}this.requestors=[]}},g.prototype.getImage=function(d){return this.images[d]},g.prototype.addImage=function(d,b){this._validate(d,b)&&(this.images[d]=b)},g.prototype._validate=function(d,b){var B=!0;return this._validateStretch(b.stretchX,b.data&&b.data.width)||(this.fire(new M.ErrorEvent(new Error('Image "'+d+'" has invalid "stretchX" value'))),B=!1),this._validateStretch(b.stretchY,b.data&&b.data.height)||(this.fire(new M.ErrorEvent(new Error('Image "'+d+'" has invalid "stretchY" value'))),B=!1),this._validateContent(b.content,b)||(this.fire(new M.ErrorEvent(new Error('Image "'+d+'" has invalid "content" value'))),B=!1),B},g.prototype._validateStretch=function(d,b){if(!d)return!0;for(var B=0,G=0,q=d;G<q.length;G+=1){var te=q[G];if(te[0]<B||te[1]<te[0]||b<te[1])return!1;B=te[1]}return!0},g.prototype._validateContent=function(d,b){return!(d&&(d.length!==4||d[0]<0||b.data.width<d[0]||d[1]<0||b.data.height<d[1]||d[2]<0||b.data.width<d[2]||d[3]<0||b.data.height<d[3]||d[2]<d[0]||d[3]<d[1]))},g.prototype.updateImage=function(d,b){b.version=this.images[d].version+1,this.images[d]=b,this.updatedImages[d]=!0},g.prototype.removeImage=function(d){var b=this.images[d];delete this.images[d],delete this.patterns[d],b.userImage&&b.userImage.onRemove&&b.userImage.onRemove()},g.prototype.listImages=function(){return Object.keys(this.images)},g.prototype.getImages=function(d,b){var B=!0;if(!this.isLoaded())for(var G=0,q=d;G<q.length;G+=1)this.images[q[G]]||(B=!1);this.isLoaded()||B?this._notify(d,b):this.requestors.push({ids:d,callback:b})},g.prototype._notify=function(d,b){for(var B={},G=0,q=d;G<q.length;G+=1){var te=q[G];this.images[te]||this.fire(new M.Event("styleimagemissing",{id:te}));var fe=this.images[te];fe?B[te]={data:fe.data.clone(),pixelRatio:fe.pixelRatio,sdf:fe.sdf,version:fe.version,stretchX:fe.stretchX,stretchY:fe.stretchY,content:fe.content,hasRenderCallback:!!(fe.userImage&&fe.userImage.render)}:M.warnOnce('Image "'+te+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}b(null,B)},g.prototype.getPixelSize=function(){var d=this.atlasImage;return{width:d.width,height:d.height}},g.prototype.getPattern=function(d){var b=this.patterns[d],B=this.getImage(d);if(!B)return null;if(b&&b.position.version===B.version)return b.position;if(b)b.position.version=B.version;else{var G={w:B.data.width+2,h:B.data.height+2,x:0,y:0},q=new M.ImagePosition(G,B);this.patterns[d]={bin:G,position:q}}return this._updatePatternAtlas(),this.patterns[d].position},g.prototype.bind=function(d){var b=d.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new M.Texture(d,this.atlasImage,b.RGBA),this.atlasTexture.bind(b.LINEAR,b.CLAMP_TO_EDGE)},g.prototype._updatePatternAtlas=function(){var d=[];for(var b in this.patterns)d.push(this.patterns[b].bin);var B=M.potpack(d),G=B.w,q=B.h,te=this.atlasImage;for(var fe in te.resize({width:G||1,height:q||1}),this.patterns){var ce=this.patterns[fe].bin,Te=ce.x+1,Ie=ce.y+1,Oe=this.images[fe].data,Qe=Oe.width,nt=Oe.height;M.RGBAImage.copy(Oe,te,{x:0,y:0},{x:Te,y:Ie},{width:Qe,height:nt}),M.RGBAImage.copy(Oe,te,{x:0,y:nt-1},{x:Te,y:Ie-1},{width:Qe,height:1}),M.RGBAImage.copy(Oe,te,{x:0,y:0},{x:Te,y:Ie+nt},{width:Qe,height:1}),M.RGBAImage.copy(Oe,te,{x:Qe-1,y:0},{x:Te-1,y:Ie},{width:1,height:nt}),M.RGBAImage.copy(Oe,te,{x:0,y:0},{x:Te+Qe,y:Ie},{width:1,height:nt})}this.dirty=!0},g.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},g.prototype.dispatchRenderCallbacks=function(d){for(var b=0,B=d;b<B.length;b+=1){var G=B[b];if(!this.callbackDispatchedThisFrame[G]){this.callbackDispatchedThisFrame[G]=!0;var q=this.images[G];et(q)&&this.updateImage(G,q)}}},g}(M.Evented),fr=Kn,Ar=Kn,pn=1e20;function Kn(h,g,d,b,B,G){this.fontSize=h||24,this.buffer=g===void 0?3:g,this.cutoff=b||.25,this.fontFamily=B||"sans-serif",this.fontWeight=G||"normal",this.radius=d||8;var q=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=q,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(q*q),this.gridInner=new Float64Array(q*q),this.f=new Float64Array(q),this.d=new Float64Array(q),this.z=new Float64Array(q+1),this.v=new Int16Array(q),this.middle=Math.round(q/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Jn(h,g,d,b,B,G,q){for(var te=0;te<g;te++){for(var fe=0;fe<d;fe++)b[fe]=h[fe*g+te];for(ki(b,B,G,q,d),fe=0;fe<d;fe++)h[fe*g+te]=B[fe]}for(fe=0;fe<d;fe++){for(te=0;te<g;te++)b[te]=h[fe*g+te];for(ki(b,B,G,q,g),te=0;te<g;te++)h[fe*g+te]=Math.sqrt(B[te])}}function ki(h,g,d,b,B){d[0]=0,b[0]=-pn,b[1]=+pn;for(var G=1,q=0;G<B;G++){for(var te=(h[G]+G*G-(h[d[q]]+d[q]*d[q]))/(2*G-2*d[q]);te<=b[q];)q--,te=(h[G]+G*G-(h[d[q]]+d[q]*d[q]))/(2*G-2*d[q]);d[++q]=G,b[q]=te,b[q+1]=+pn}for(G=0,q=0;G<B;G++){for(;b[q+1]<G;)q++;g[G]=(G-d[q])*(G-d[q])+h[d[q]]}}Kn.prototype.draw=function(h){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(h,this.buffer,this.middle);for(var g=this.ctx.getImageData(0,0,this.size,this.size),d=new Uint8ClampedArray(this.size*this.size),b=0;b<this.size*this.size;b++){var B=g.data[4*b+3]/255;this.gridOuter[b]=B===1?0:B===0?pn:Math.pow(Math.max(0,.5-B),2),this.gridInner[b]=B===1?pn:B===0?0:Math.pow(Math.max(0,B-.5),2)}for(Jn(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),Jn(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),b=0;b<this.size*this.size;b++)d[b]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[b]-this.gridInner[b])/this.radius+this.cutoff))));return d},fr.default=Ar;var pa=function(h,g){this.requestManager=h,this.localIdeographFontFamily=g,this.entries={}};pa.prototype.setURL=function(h){this.url=h},pa.prototype.getGlyphs=function(h,g){var d=this,b=[];for(var B in h)for(var G=0,q=h[B];G<q.length;G+=1)b.push({stack:B,id:q[G]});M.asyncAll(b,function(te,fe){var ce=te.stack,Te=te.id,Ie=d.entries[ce];Ie||(Ie=d.entries[ce]={glyphs:{},requests:{},ranges:{}});var Oe=Ie.glyphs[Te];if(Oe===void 0){if(Oe=d._tinySDF(Ie,ce,Te))return Ie.glyphs[Te]=Oe,void fe(null,{stack:ce,id:Te,glyph:Oe});var Qe=Math.floor(Te/256);if(256*Qe>65535)fe(new Error("glyphs > 65535 not supported"));else if(Ie.ranges[Qe])fe(null,{stack:ce,id:Te,glyph:Oe});else{var nt=Ie.requests[Qe];nt||(nt=Ie.requests[Qe]=[],pa.loadGlyphRange(ce,Qe,d.url,d.requestManager,function(ct,tt){if(tt){for(var Tt in tt)d._doesCharSupportLocalGlyph(+Tt)||(Ie.glyphs[+Tt]=tt[+Tt]);Ie.ranges[Qe]=!0}for(var Ut=0,Nt=nt;Ut<Nt.length;Ut+=1)(0,Nt[Ut])(ct,tt);delete Ie.requests[Qe]})),nt.push(function(ct,tt){ct?fe(ct):tt&&fe(null,{stack:ce,id:Te,glyph:tt[Te]||null})})}}else fe(null,{stack:ce,id:Te,glyph:Oe})},function(te,fe){if(te)g(te);else if(fe){for(var ce={},Te=0,Ie=fe;Te<Ie.length;Te+=1){var Oe=Ie[Te],Qe=Oe.stack,nt=Oe.id,ct=Oe.glyph;(ce[Qe]||(ce[Qe]={}))[nt]=ct&&{id:ct.id,bitmap:ct.bitmap.clone(),metrics:ct.metrics}}g(null,ce)}})},pa.prototype._doesCharSupportLocalGlyph=function(h){return!!this.localIdeographFontFamily&&(M.isChar["CJK Unified Ideographs"](h)||M.isChar["Hangul Syllables"](h)||M.isChar.Hiragana(h)||M.isChar.Katakana(h))},pa.prototype._tinySDF=function(h,g,d){var b=this.localIdeographFontFamily;if(b&&this._doesCharSupportLocalGlyph(d)){var B=h.tinySDF;if(!B){var G="400";/bold/i.test(g)?G="900":/medium/i.test(g)?G="500":/light/i.test(g)&&(G="200"),B=h.tinySDF=new pa.TinySDF(24,3,8,.25,b,G)}return{id:d,bitmap:new M.AlphaImage({width:30,height:30},B.draw(String.fromCharCode(d))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},pa.loadGlyphRange=function(h,g,d,b,B){var G=256*g,q=G+255,te=b.transformRequest(b.normalizeGlyphsURL(d).replace("{fontstack}",h).replace("{range}",G+"-"+q),M.ResourceType.Glyphs);M.getArrayBuffer(te,function(fe,ce){if(fe)B(fe);else if(ce){for(var Te={},Ie=0,Oe=M.parseGlyphPBF(ce);Ie<Oe.length;Ie+=1){var Qe=Oe[Ie];Te[Qe.id]=Qe}B(null,Te)}})},pa.TinySDF=fr;var xr=function(){this.specification=M.styleSpec.light.position};xr.prototype.possiblyEvaluate=function(h,g){return M.sphericalToCartesian(h.expression.evaluate(g))},xr.prototype.interpolate=function(h,g,d){return{x:M.number(h.x,g.x,d),y:M.number(h.y,g.y,d),z:M.number(h.z,g.z,d)}};var jt=new M.Properties({anchor:new M.DataConstantProperty(M.styleSpec.light.anchor),position:new xr,color:new M.DataConstantProperty(M.styleSpec.light.color),intensity:new M.DataConstantProperty(M.styleSpec.light.intensity)}),Jr=function(h){function g(d){h.call(this),this._transitionable=new M.Transitionable(jt),this.setLight(d),this._transitioning=this._transitionable.untransitioned()}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getLight=function(){return this._transitionable.serialize()},g.prototype.setLight=function(d,b){if(b===void 0&&(b={}),!this._validate(M.validateLight,d,b))for(var B in d){var G=d[B];M.endsWith(B,"-transition")?this._transitionable.setTransition(B.slice(0,-11),G):this._transitionable.setValue(B,G)}},g.prototype.updateTransitions=function(d){this._transitioning=this._transitionable.transitioned(d,this._transitioning)},g.prototype.hasTransition=function(){return this._transitioning.hasTransition()},g.prototype.recalculate=function(d){this.properties=this._transitioning.possiblyEvaluate(d)},g.prototype._validate=function(d,b,B){return(!B||B.validate!==!1)&&M.emitValidationErrors(this,d.call(M.validateStyle,M.extend({value:b,style:{glyphs:!0,sprite:!0},styleSpec:M.styleSpec})))},g}(M.Evented),gr=function(h,g){this.width=h,this.height=g,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};gr.prototype.getDash=function(h,g){var d=h.join(",")+String(g);return this.dashEntry[d]||(this.dashEntry[d]=this.addDash(h,g)),this.dashEntry[d]},gr.prototype.getDashRanges=function(h,g,d){var b=[],B=h.length%2==1?-h[h.length-1]*d:0,G=h[0]*d,q=!0;b.push({left:B,right:G,isDash:q,zeroLength:h[0]===0});for(var te=h[0],fe=1;fe<h.length;fe++){var ce=h[fe];b.push({left:B=te*d,right:G=(te+=ce)*d,isDash:q=!q,zeroLength:ce===0})}return b},gr.prototype.addRoundDash=function(h,g,d){for(var b=g/2,B=-d;B<=d;B++)for(var G=this.width*(this.nextRow+d+B),q=0,te=h[q],fe=0;fe<this.width;fe++){fe/te.right>1&&(te=h[++q]);var ce=Math.abs(fe-te.left),Te=Math.abs(fe-te.right),Ie=Math.min(ce,Te),Oe=void 0,Qe=B/d*(b+1);if(te.isDash){var nt=b-Math.abs(Qe);Oe=Math.sqrt(Ie*Ie+nt*nt)}else Oe=b-Math.sqrt(Ie*Ie+Qe*Qe);this.data[G+fe]=Math.max(0,Math.min(255,Oe+128))}},gr.prototype.addRegularDash=function(h){for(var g=h.length-1;g>=0;--g){var d=h[g],b=h[g+1];d.zeroLength?h.splice(g,1):b&&b.isDash===d.isDash&&(b.left=d.left,h.splice(g,1))}var B=h[0],G=h[h.length-1];B.isDash===G.isDash&&(B.left=G.left-this.width,G.right=B.right+this.width);for(var q=this.width*this.nextRow,te=0,fe=h[te],ce=0;ce<this.width;ce++){ce/fe.right>1&&(fe=h[++te]);var Te=Math.abs(ce-fe.left),Ie=Math.abs(ce-fe.right),Oe=Math.min(Te,Ie);this.data[q+ce]=Math.max(0,Math.min(255,(fe.isDash?Oe:-Oe)+128))}},gr.prototype.addDash=function(h,g){var d=g?7:0,b=2*d+1;if(this.nextRow+b>this.height)return M.warnOnce("LineAtlas out of space"),null;for(var B=0,G=0;G<h.length;G++)B+=h[G];if(B!==0){var q=this.width/B,te=this.getDashRanges(h,this.width,q);g?this.addRoundDash(te,q,d):this.addRegularDash(te)}var fe={y:(this.nextRow+d+.5)/this.height,height:2*d/this.height,width:B};return this.nextRow+=b,this.dirty=!0,fe},gr.prototype.bind=function(h){var g=h.gl;this.texture?(g.bindTexture(g.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,g.texSubImage2D(g.TEXTURE_2D,0,0,0,this.width,this.height,g.ALPHA,g.UNSIGNED_BYTE,this.data))):(this.texture=g.createTexture(),g.bindTexture(g.TEXTURE_2D,this.texture),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.REPEAT),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.REPEAT),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.LINEAR),g.texImage2D(g.TEXTURE_2D,0,g.ALPHA,this.width,this.height,0,g.ALPHA,g.UNSIGNED_BYTE,this.data))};var rn=function h(g,d){this.workerPool=g,this.actors=[],this.currentActor=0,this.id=M.uniqueId();for(var b=this.workerPool.acquire(this.id),B=0;B<b.length;B++){var G=new h.Actor(b[B],d,this.id);G.name="Worker "+B,this.actors.push(G)}};function jn(h,g,d){var b=function(B,G){if(B)return d(B);if(G){var q=M.pick(M.extend(G,h),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);G.vector_layers&&(q.vectorLayers=G.vector_layers,q.vectorLayerIds=q.vectorLayers.map(function(te){return te.id})),q.tiles=g.canonicalizeTileset(q,h.url),d(null,q)}};return h.url?M.getJSON(g.transformRequest(g.normalizeSourceURL(h.url),M.ResourceType.Source),b):M.browser.frame(function(){return b(null,h)})}rn.prototype.broadcast=function(h,g,d){M.asyncAll(this.actors,function(b,B){b.send(h,g,B)},d=d||function(){})},rn.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},rn.prototype.remove=function(){this.actors.forEach(function(h){h.remove()}),this.actors=[],this.workerPool.release(this.id)},rn.Actor=M.Actor;var qe=function(h,g,d){this.bounds=M.LngLatBounds.convert(this.validateBounds(h)),this.minzoom=g||0,this.maxzoom=d||24};qe.prototype.validateBounds=function(h){return Array.isArray(h)&&h.length===4?[Math.max(-180,h[0]),Math.max(-90,h[1]),Math.min(180,h[2]),Math.min(90,h[3])]:[-180,-90,180,90]},qe.prototype.contains=function(h){var g=Math.pow(2,h.z),d=Math.floor(M.mercatorXfromLng(this.bounds.getWest())*g),b=Math.floor(M.mercatorYfromLat(this.bounds.getNorth())*g),B=Math.ceil(M.mercatorXfromLng(this.bounds.getEast())*g),G=Math.ceil(M.mercatorYfromLat(this.bounds.getSouth())*g);return h.x>=d&&h.x<B&&h.y>=b&&h.y<G};var Dt=function(h){function g(d,b,B,G){if(h.call(this),this.id=d,this.dispatcher=B,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,M.extend(this,M.pick(b,["url","scheme","tileSize","promoteId"])),this._options=M.extend({type:"vector"},b),this._collectResourceTiming=b.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(G)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.load=function(){var d=this;this._loaded=!1,this.fire(new M.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=jn(this._options,this.map._requestManager,function(b,B){d._tileJSONRequest=null,d._loaded=!0,b?d.fire(new M.ErrorEvent(b)):B&&(M.extend(d,B),B.bounds&&(d.tileBounds=new qe(B.bounds,d.minzoom,d.maxzoom)),M.postTurnstileEvent(B.tiles,d.map._requestManager._customAccessToken),M.postMapLoadEvent(B.tiles,d.map._getMapId(),d.map._requestManager._skuToken,d.map._requestManager._customAccessToken),d.fire(new M.Event("data",{dataType:"source",sourceDataType:"metadata"})),d.fire(new M.Event("data",{dataType:"source",sourceDataType:"content"})))})},g.prototype.loaded=function(){return this._loaded},g.prototype.hasTile=function(d){return!this.tileBounds||this.tileBounds.contains(d.canonical)},g.prototype.onAdd=function(d){this.map=d,this.load()},g.prototype.setSourceProperty=function(d){this._tileJSONRequest&&this._tileJSONRequest.cancel(),d(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},g.prototype.setTiles=function(d){var b=this;return this.setSourceProperty(function(){b._options.tiles=d}),this},g.prototype.setUrl=function(d){var b=this;return this.setSourceProperty(function(){b.url=d,b._options.url=d}),this},g.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},g.prototype.serialize=function(){return M.extend({},this._options)},g.prototype.loadTile=function(d,b){var B=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme)),G={request:this.map._requestManager.transformRequest(B,M.ResourceType.Tile),uid:d.uid,tileID:d.tileID,zoom:d.tileID.overscaledZ,tileSize:this.tileSize*d.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:M.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function q(te,fe){return delete d.request,d.aborted?b(null):te&&te.status!==404?b(te):(fe&&fe.resourceTiming&&(d.resourceTiming=fe.resourceTiming),this.map._refreshExpiredTiles&&fe&&d.setExpiryData(fe),d.loadVectorData(fe,this.map.painter),M.cacheEntryPossiblyAdded(this.dispatcher),b(null),void(d.reloadCallback&&(this.loadTile(d,d.reloadCallback),d.reloadCallback=null)))}G.request.collectResourceTiming=this._collectResourceTiming,d.actor&&d.state!=="expired"?d.state==="loading"?d.reloadCallback=b:d.request=d.actor.send("reloadTile",G,q.bind(this)):(d.actor=this.dispatcher.getActor(),d.request=d.actor.send("loadTile",G,q.bind(this)))},g.prototype.abortTile=function(d){d.request&&(d.request.cancel(),delete d.request),d.actor&&d.actor.send("abortTile",{uid:d.uid,type:this.type,source:this.id},void 0)},g.prototype.unloadTile=function(d){d.unloadVectorData(),d.actor&&d.actor.send("removeTile",{uid:d.uid,type:this.type,source:this.id},void 0)},g.prototype.hasTransition=function(){return!1},g}(M.Evented),$e=function(h){function g(d,b,B,G){h.call(this),this.id=d,this.dispatcher=B,this.setEventedParent(G),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=M.extend({type:"raster"},b),M.extend(this,M.pick(b,["url","scheme","tileSize"]))}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.load=function(){var d=this;this._loaded=!1,this.fire(new M.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=jn(this._options,this.map._requestManager,function(b,B){d._tileJSONRequest=null,d._loaded=!0,b?d.fire(new M.ErrorEvent(b)):B&&(M.extend(d,B),B.bounds&&(d.tileBounds=new qe(B.bounds,d.minzoom,d.maxzoom)),M.postTurnstileEvent(B.tiles),M.postMapLoadEvent(B.tiles,d.map._getMapId(),d.map._requestManager._skuToken),d.fire(new M.Event("data",{dataType:"source",sourceDataType:"metadata"})),d.fire(new M.Event("data",{dataType:"source",sourceDataType:"content"})))})},g.prototype.loaded=function(){return this._loaded},g.prototype.onAdd=function(d){this.map=d,this.load()},g.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},g.prototype.serialize=function(){return M.extend({},this._options)},g.prototype.hasTile=function(d){return!this.tileBounds||this.tileBounds.contains(d.canonical)},g.prototype.loadTile=function(d,b){var B=this,G=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);d.request=M.getImage(this.map._requestManager.transformRequest(G,M.ResourceType.Tile),function(q,te){if(delete d.request,d.aborted)d.state="unloaded",b(null);else if(q)d.state="errored",b(q);else if(te){B.map._refreshExpiredTiles&&d.setExpiryData(te),delete te.cacheControl,delete te.expires;var fe=B.map.painter.context,ce=fe.gl;d.texture=B.map.painter.getTileTexture(te.width),d.texture?d.texture.update(te,{useMipmap:!0}):(d.texture=new M.Texture(fe,te,ce.RGBA,{useMipmap:!0}),d.texture.bind(ce.LINEAR,ce.CLAMP_TO_EDGE,ce.LINEAR_MIPMAP_NEAREST),fe.extTextureFilterAnisotropic&&ce.texParameterf(ce.TEXTURE_2D,fe.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,fe.extTextureFilterAnisotropicMax)),d.state="loaded",M.cacheEntryPossiblyAdded(B.dispatcher),b(null)}})},g.prototype.abortTile=function(d,b){d.request&&(d.request.cancel(),delete d.request),b()},g.prototype.unloadTile=function(d,b){d.texture&&this.map.painter.saveTileTexture(d.texture),b()},g.prototype.hasTransition=function(){return!1},g}(M.Evented),Pt=function(h){function g(d,b,B,G){h.call(this,d,b,B,G),this.type="raster-dem",this.maxzoom=22,this._options=M.extend({type:"raster-dem"},b),this.encoding=b.encoding||"mapbox"}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},g.prototype.loadTile=function(d,b){var B=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function G(q,te){q&&(d.state="errored",b(q)),te&&(d.dem=te,d.needsHillshadePrepare=!0,d.state="loaded",b(null))}d.request=M.getImage(this.map._requestManager.transformRequest(B,M.ResourceType.Tile),function(q,te){if(delete d.request,d.aborted)d.state="unloaded",b(null);else if(q)d.state="errored",b(q);else if(te){this.map._refreshExpiredTiles&&d.setExpiryData(te),delete te.cacheControl,delete te.expires;var fe=M.window.ImageBitmap&&te instanceof M.window.ImageBitmap&&M.offscreenCanvasSupported()?te:M.browser.getImageData(te,1),ce={uid:d.uid,coord:d.tileID,source:this.id,rawImageData:fe,encoding:this.encoding};d.actor&&d.state!=="expired"||(d.actor=this.dispatcher.getActor(),d.actor.send("loadDEMTile",ce,G.bind(this)))}}.bind(this)),d.neighboringTiles=this._getNeighboringTiles(d.tileID)},g.prototype._getNeighboringTiles=function(d){var b=d.canonical,B=Math.pow(2,b.z),G=(b.x-1+B)%B,q=b.x===0?d.wrap-1:d.wrap,te=(b.x+1+B)%B,fe=b.x+1===B?d.wrap+1:d.wrap,ce={};return ce[new M.OverscaledTileID(d.overscaledZ,q,b.z,G,b.y).key]={backfilled:!1},ce[new M.OverscaledTileID(d.overscaledZ,fe,b.z,te,b.y).key]={backfilled:!1},b.y>0&&(ce[new M.OverscaledTileID(d.overscaledZ,q,b.z,G,b.y-1).key]={backfilled:!1},ce[new M.OverscaledTileID(d.overscaledZ,d.wrap,b.z,b.x,b.y-1).key]={backfilled:!1},ce[new M.OverscaledTileID(d.overscaledZ,fe,b.z,te,b.y-1).key]={backfilled:!1}),b.y+1<B&&(ce[new M.OverscaledTileID(d.overscaledZ,q,b.z,G,b.y+1).key]={backfilled:!1},ce[new M.OverscaledTileID(d.overscaledZ,d.wrap,b.z,b.x,b.y+1).key]={backfilled:!1},ce[new M.OverscaledTileID(d.overscaledZ,fe,b.z,te,b.y+1).key]={backfilled:!1}),ce},g.prototype.unloadTile=function(d){d.demTexture&&this.map.painter.saveTileTexture(d.demTexture),d.fbo&&(d.fbo.destroy(),delete d.fbo),d.dem&&delete d.dem,delete d.neighboringTiles,d.state="unloaded",d.actor&&d.actor.send("removeDEMTile",{uid:d.uid,source:this.id})},g}($e),vt=function(h){function g(d,b,B,G){h.call(this),this.id=d,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=B.getActor(),this.setEventedParent(G),this._data=b.data,this._options=M.extend({},b),this._collectResourceTiming=b.collectResourceTiming,this._resourceTiming=[],b.maxzoom!==void 0&&(this.maxzoom=b.maxzoom),b.type&&(this.type=b.type),b.attribution&&(this.attribution=b.attribution),this.promoteId=b.promoteId;var q=M.EXTENT/this.tileSize;this.workerOptions=M.extend({source:this.id,cluster:b.cluster||!1,geojsonVtOptions:{buffer:(b.buffer!==void 0?b.buffer:128)*q,tolerance:(b.tolerance!==void 0?b.tolerance:.375)*q,extent:M.EXTENT,maxZoom:this.maxzoom,lineMetrics:b.lineMetrics||!1,generateId:b.generateId||!1},superclusterOptions:{maxZoom:b.clusterMaxZoom!==void 0?Math.min(b.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,b.clusterMinPoints||2),extent:M.EXTENT,radius:(b.clusterRadius||50)*q,log:!1,generateId:b.generateId||!1},clusterProperties:b.clusterProperties,filter:b.filter},b.workerOptions)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.load=function(){var d=this;this.fire(new M.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(b){if(b)d.fire(new M.ErrorEvent(b));else{var B={dataType:"source",sourceDataType:"metadata"};d._collectResourceTiming&&d._resourceTiming&&d._resourceTiming.length>0&&(B.resourceTiming=d._resourceTiming,d._resourceTiming=[]),d.fire(new M.Event("data",B))}})},g.prototype.onAdd=function(d){this.map=d,this.load()},g.prototype.setData=function(d){var b=this;return this._data=d,this.fire(new M.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(B){if(B)b.fire(new M.ErrorEvent(B));else{var G={dataType:"source",sourceDataType:"content"};b._collectResourceTiming&&b._resourceTiming&&b._resourceTiming.length>0&&(G.resourceTiming=b._resourceTiming,b._resourceTiming=[]),b.fire(new M.Event("data",G))}}),this},g.prototype.getClusterExpansionZoom=function(d,b){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:d,source:this.id},b),this},g.prototype.getClusterChildren=function(d,b){return this.actor.send("geojson.getClusterChildren",{clusterId:d,source:this.id},b),this},g.prototype.getClusterLeaves=function(d,b,B,G){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:d,limit:b,offset:B},G),this},g.prototype._updateWorkerData=function(d){var b=this;this._loaded=!1;var B=M.extend({},this.workerOptions),G=this._data;typeof G=="string"?(B.request=this.map._requestManager.transformRequest(M.browser.resolveURL(G),M.ResourceType.Source),B.request.collectResourceTiming=this._collectResourceTiming):B.data=JSON.stringify(G),this.actor.send(this.type+".loadData",B,function(q,te){b._removed||te&&te.abandoned||(b._loaded=!0,te&&te.resourceTiming&&te.resourceTiming[b.id]&&(b._resourceTiming=te.resourceTiming[b.id].slice(0)),b.actor.send(b.type+".coalesce",{source:B.source},null),d(q))})},g.prototype.loaded=function(){return this._loaded},g.prototype.loadTile=function(d,b){var B=this,G=d.actor?"reloadTile":"loadTile";d.actor=this.actor,d.request=this.actor.send(G,{type:this.type,uid:d.uid,tileID:d.tileID,zoom:d.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:M.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},function(q,te){return delete d.request,d.unloadVectorData(),d.aborted?b(null):q?b(q):(d.loadVectorData(te,B.map.painter,G==="reloadTile"),b(null))})},g.prototype.abortTile=function(d){d.request&&(d.request.cancel(),delete d.request),d.aborted=!0},g.prototype.unloadTile=function(d){d.unloadVectorData(),this.actor.send("removeTile",{uid:d.uid,type:this.type,source:this.id})},g.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},g.prototype.serialize=function(){return M.extend({},this._options,{type:this.type,data:this._data})},g.prototype.hasTransition=function(){return!1},g}(M.Evented),rr=M.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),ar=function(h){function g(d,b,B,G){h.call(this),this.id=d,this.dispatcher=B,this.coordinates=b.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(G),this.options=b}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.load=function(d,b){var B=this;this._loaded=!1,this.fire(new M.Event("dataloading",{dataType:"source"})),this.url=this.options.url,M.getImage(this.map._requestManager.transformRequest(this.url,M.ResourceType.Image),function(G,q){B._loaded=!0,G?B.fire(new M.ErrorEvent(G)):q&&(B.image=q,d&&(B.coordinates=d),b&&b(),B._finishLoading())})},g.prototype.loaded=function(){return this._loaded},g.prototype.updateImage=function(d){var b=this;return this.image&&d.url?(this.options.url=d.url,this.load(d.coordinates,function(){b.texture=null}),this):this},g.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new M.Event("data",{dataType:"source",sourceDataType:"metadata"})))},g.prototype.onAdd=function(d){this.map=d,this.load()},g.prototype.setCoordinates=function(d){var b=this;this.coordinates=d;var B=d.map(M.MercatorCoordinate.fromLngLat);this.tileID=function(q){for(var te=1/0,fe=1/0,ce=-1/0,Te=-1/0,Ie=0,Oe=q;Ie<Oe.length;Ie+=1){var Qe=Oe[Ie];te=Math.min(te,Qe.x),fe=Math.min(fe,Qe.y),ce=Math.max(ce,Qe.x),Te=Math.max(Te,Qe.y)}var nt=Math.max(ce-te,Te-fe),ct=Math.max(0,Math.floor(-Math.log(nt)/Math.LN2)),tt=Math.pow(2,ct);return new M.CanonicalTileID(ct,Math.floor((te+ce)/2*tt),Math.floor((fe+Te)/2*tt))}(B),this.minzoom=this.maxzoom=this.tileID.z;var G=B.map(function(q){return b.tileID.getTilePoint(q)._round()});return this._boundsArray=new M.StructArrayLayout4i8,this._boundsArray.emplaceBack(G[0].x,G[0].y,0,0),this._boundsArray.emplaceBack(G[1].x,G[1].y,M.EXTENT,0),this._boundsArray.emplaceBack(G[3].x,G[3].y,0,M.EXTENT),this._boundsArray.emplaceBack(G[2].x,G[2].y,M.EXTENT,M.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new M.Event("data",{dataType:"source",sourceDataType:"content"})),this},g.prototype.prepare=function(){if(Object.keys(this.tiles).length!==0&&this.image){var d=this.map.painter.context,b=d.gl;for(var B in this.boundsBuffer||(this.boundsBuffer=d.createVertexBuffer(this._boundsArray,rr.members)),this.boundsSegments||(this.boundsSegments=M.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new M.Texture(d,this.image,b.RGBA),this.texture.bind(b.LINEAR,b.CLAMP_TO_EDGE)),this.tiles){var G=this.tiles[B];G.state!=="loaded"&&(G.state="loaded",G.texture=this.texture)}}},g.prototype.loadTile=function(d,b){this.tileID&&this.tileID.equals(d.tileID.canonical)?(this.tiles[String(d.tileID.wrap)]=d,d.buckets={},b(null)):(d.state="errored",b(null))},g.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},g.prototype.hasTransition=function(){return!1},g}(M.Evented),wr=function(h){function g(d,b,B,G){h.call(this,d,b,B,G),this.roundZoom=!0,this.type="video",this.options=b}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.load=function(){var d=this;this._loaded=!1;var b=this.options;this.urls=[];for(var B=0,G=b.urls;B<G.length;B+=1)this.urls.push(this.map._requestManager.transformRequest(G[B],M.ResourceType.Source).url);M.getVideo(this.urls,function(q,te){d._loaded=!0,q?d.fire(new M.ErrorEvent(q)):te&&(d.video=te,d.video.loop=!0,d.video.setAttribute("playsinline",""),d.video.addEventListener("playing",function(){d.map.triggerRepaint()}),d.map&&d.video.play(),d._finishLoading())})},g.prototype.pause=function(){this.video&&this.video.pause()},g.prototype.play=function(){this.video&&this.video.play()},g.prototype.seek=function(d){if(this.video){var b=this.video.seekable;d<b.start(0)||d>b.end(0)?this.fire(new M.ErrorEvent(new M.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+b.start(0)+" and "+b.end(0)+"-second mark."))):this.video.currentTime=d}},g.prototype.getVideo=function(){return this.video},g.prototype.onAdd=function(d){this.map||(this.map=d,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},g.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var d=this.map.painter.context,b=d.gl;for(var B in this.boundsBuffer||(this.boundsBuffer=d.createVertexBuffer(this._boundsArray,rr.members)),this.boundsSegments||(this.boundsSegments=M.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(b.LINEAR,b.CLAMP_TO_EDGE),b.texSubImage2D(b.TEXTURE_2D,0,0,0,b.RGBA,b.UNSIGNED_BYTE,this.video)):(this.texture=new M.Texture(d,this.video,b.RGBA),this.texture.bind(b.LINEAR,b.CLAMP_TO_EDGE)),this.tiles){var G=this.tiles[B];G.state!=="loaded"&&(G.state="loaded",G.texture=this.texture)}}},g.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},g.prototype.hasTransition=function(){return this.video&&!this.video.paused},g}(ar),Cr=function(h){function g(d,b,B,G){h.call(this,d,b,B,G),b.coordinates?Array.isArray(b.coordinates)&&b.coordinates.length===4&&!b.coordinates.some(function(q){return!Array.isArray(q)||q.length!==2||q.some(function(te){return typeof te!="number"})})||this.fire(new M.ErrorEvent(new M.ValidationError("sources."+d,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new M.ErrorEvent(new M.ValidationError("sources."+d,null,'missing required property "coordinates"'))),b.animate&&typeof b.animate!="boolean"&&this.fire(new M.ErrorEvent(new M.ValidationError("sources."+d,null,'optional "animate" property must be a boolean value'))),b.canvas?typeof b.canvas=="string"||b.canvas instanceof M.window.HTMLCanvasElement||this.fire(new M.ErrorEvent(new M.ValidationError("sources."+d,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new M.ErrorEvent(new M.ValidationError("sources."+d,null,'missing required property "canvas"'))),this.options=b,this.animate=b.animate===void 0||b.animate}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof M.window.HTMLCanvasElement?this.options.canvas:M.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new M.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},g.prototype.getCanvas=function(){return this.canvas},g.prototype.onAdd=function(d){this.map=d,this.load(),this.canvas&&this.animate&&this.play()},g.prototype.onRemove=function(){this.pause()},g.prototype.prepare=function(){var d=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,d=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,d=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var b=this.map.painter.context,B=b.gl;for(var G in this.boundsBuffer||(this.boundsBuffer=b.createVertexBuffer(this._boundsArray,rr.members)),this.boundsSegments||(this.boundsSegments=M.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(d||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new M.Texture(b,this.canvas,B.RGBA,{premultiply:!0}),this.tiles){var q=this.tiles[G];q.state!=="loaded"&&(q.state="loaded",q.texture=this.texture)}}},g.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},g.prototype.hasTransition=function(){return this._playing},g.prototype._hasInvalidDimensions=function(){for(var d=0,b=[this.canvas.width,this.canvas.height];d<b.length;d+=1){var B=b[d];if(isNaN(B)||B<=0)return!0}return!1},g}(ar),an={vector:Dt,raster:$e,"raster-dem":Pt,geojson:vt,video:wr,image:ar,canvas:Cr};function yi(h,g){var d=M.identity([]);return M.translate(d,d,[1,1,0]),M.scale(d,d,[.5*h.width,.5*h.height,1]),M.multiply(d,d,h.calculatePosMatrix(g.toUnwrapped()))}function li(h,g,d,b,B,G){var q=function(ct,tt,Tt){if(ct)for(var Ut=0,Nt=ct;Ut<Nt.length;Ut+=1){var pr=tt[Nt[Ut]];if(pr&&pr.source===Tt&&pr.type==="fill-extrusion")return!0}else for(var tr in tt){var Dr=tt[tr];if(Dr.source===Tt&&Dr.type==="fill-extrusion")return!0}return!1}(B&&B.layers,g,h.id),te=G.maxPitchScaleFactor(),fe=h.tilesIn(b,te,q);fe.sort(Uo);for(var ce=[],Te=0,Ie=fe;Te<Ie.length;Te+=1){var Oe=Ie[Te];ce.push({wrappedTileID:Oe.tileID.wrapped().key,queryResults:Oe.tile.queryRenderedFeatures(g,d,h._state,Oe.queryGeometry,Oe.cameraQueryGeometry,Oe.scale,B,G,te,yi(h.transform,Oe.tileID))})}var Qe=function(ct){for(var tt={},Tt={},Ut=0,Nt=ct;Ut<Nt.length;Ut+=1){var pr=Nt[Ut],tr=pr.queryResults,Dr=pr.wrappedTileID,Hr=Tt[Dr]=Tt[Dr]||{};for(var sn in tr)for(var nn=tr[sn],Gn=Hr[sn]=Hr[sn]||{},di=tt[sn]=tt[sn]||[],Di=0,Ui=nn;Di<Ui.length;Di+=1){var ho=Ui[Di];Gn[ho.featureIndex]||(Gn[ho.featureIndex]=!0,di.push(ho))}}return tt}(ce);for(var nt in Qe)Qe[nt].forEach(function(ct){var tt=ct.feature,Tt=h.getFeatureState(tt.layer["source-layer"],tt.id);tt.source=tt.layer.source,tt.layer["source-layer"]&&(tt.sourceLayer=tt.layer["source-layer"]),tt.state=Tt});return Qe}function Uo(h,g){var d=h.tileID,b=g.tileID;return d.overscaledZ-b.overscaledZ||d.canonical.y-b.canonical.y||d.wrap-b.wrap||d.canonical.x-b.canonical.x}var vi=function(h,g){this.max=h,this.onRemove=g,this.reset()};vi.prototype.reset=function(){for(var h in this.data)for(var g=0,d=this.data[h];g<d.length;g+=1){var b=d[g];b.timeout&&clearTimeout(b.timeout),this.onRemove(b.value)}return this.data={},this.order=[],this},vi.prototype.add=function(h,g,d){var b=this,B=h.wrapped().key;this.data[B]===void 0&&(this.data[B]=[]);var G={value:g,timeout:void 0};if(d!==void 0&&(G.timeout=setTimeout(function(){b.remove(h,G)},d)),this.data[B].push(G),this.order.push(B),this.order.length>this.max){var q=this._getAndRemoveByKey(this.order[0]);q&&this.onRemove(q)}return this},vi.prototype.has=function(h){return h.wrapped().key in this.data},vi.prototype.getAndRemove=function(h){return this.has(h)?this._getAndRemoveByKey(h.wrapped().key):null},vi.prototype._getAndRemoveByKey=function(h){var g=this.data[h].shift();return g.timeout&&clearTimeout(g.timeout),this.data[h].length===0&&delete this.data[h],this.order.splice(this.order.indexOf(h),1),g.value},vi.prototype.getByKey=function(h){var g=this.data[h];return g?g[0].value:null},vi.prototype.get=function(h){return this.has(h)?this.data[h.wrapped().key][0].value:null},vi.prototype.remove=function(h,g){if(!this.has(h))return this;var d=h.wrapped().key,b=g===void 0?0:this.data[d].indexOf(g),B=this.data[d][b];return this.data[d].splice(b,1),B.timeout&&clearTimeout(B.timeout),this.data[d].length===0&&delete this.data[d],this.onRemove(B.value),this.order.splice(this.order.indexOf(d),1),this},vi.prototype.setMaxSize=function(h){for(this.max=h;this.order.length>this.max;){var g=this._getAndRemoveByKey(this.order[0]);g&&this.onRemove(g)}return this},vi.prototype.filter=function(h){var g=[];for(var d in this.data)for(var b=0,B=this.data[d];b<B.length;b+=1){var G=B[b];h(G.value)||g.push(G)}for(var q=0,te=g;q<te.length;q+=1){var fe=te[q];this.remove(fe.value.tileID,fe)}};var bo=function(h,g,d){this.context=h;var b=h.gl;this.buffer=b.createBuffer(),this.dynamicDraw=!!d,this.context.unbindVAO(),h.bindElementBuffer.set(this.buffer),b.bufferData(b.ELEMENT_ARRAY_BUFFER,g.arrayBuffer,this.dynamicDraw?b.DYNAMIC_DRAW:b.STATIC_DRAW),this.dynamicDraw||delete g.arrayBuffer};bo.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},bo.prototype.updateData=function(h){var g=this.context.gl;this.context.unbindVAO(),this.bind(),g.bufferSubData(g.ELEMENT_ARRAY_BUFFER,0,h.arrayBuffer)},bo.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var So={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Xi=function(h,g,d,b){this.length=g.length,this.attributes=d,this.itemSize=g.bytesPerElement,this.dynamicDraw=b,this.context=h;var B=h.gl;this.buffer=B.createBuffer(),h.bindVertexBuffer.set(this.buffer),B.bufferData(B.ARRAY_BUFFER,g.arrayBuffer,this.dynamicDraw?B.DYNAMIC_DRAW:B.STATIC_DRAW),this.dynamicDraw||delete g.arrayBuffer};Xi.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Xi.prototype.updateData=function(h){var g=this.context.gl;this.bind(),g.bufferSubData(g.ARRAY_BUFFER,0,h.arrayBuffer)},Xi.prototype.enableAttributes=function(h,g){for(var d=0;d<this.attributes.length;d++){var b=g.attributes[this.attributes[d].name];b!==void 0&&h.enableVertexAttribArray(b)}},Xi.prototype.setVertexAttribPointers=function(h,g,d){for(var b=0;b<this.attributes.length;b++){var B=this.attributes[b],G=g.attributes[B.name];G!==void 0&&h.vertexAttribPointer(G,B.components,h[So[B.type]],!1,this.itemSize,B.offset+this.itemSize*(d||0))}},Xi.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var Mi=function(h){this.gl=h.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};Mi.prototype.get=function(){return this.current},Mi.prototype.set=function(h){},Mi.prototype.getDefault=function(){return this.default},Mi.prototype.setDefault=function(){this.set(this.default)};var qo=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return M.Color.transparent},g.prototype.set=function(d){var b=this.current;(d.r!==b.r||d.g!==b.g||d.b!==b.b||d.a!==b.a||this.dirty)&&(this.gl.clearColor(d.r,d.g,d.b,d.a),this.current=d,this.dirty=!1)},g}(Mi),ui=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return 1},g.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.clearDepth(d),this.current=d,this.dirty=!1)},g}(Mi),Qi=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return 0},g.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.clearStencil(d),this.current=d,this.dirty=!1)},g}(Mi),Vi=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return[!0,!0,!0,!0]},g.prototype.set=function(d){var b=this.current;(d[0]!==b[0]||d[1]!==b[1]||d[2]!==b[2]||d[3]!==b[3]||this.dirty)&&(this.gl.colorMask(d[0],d[1],d[2],d[3]),this.current=d,this.dirty=!1)},g}(Mi),Pi=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return!0},g.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.depthMask(d),this.current=d,this.dirty=!1)},g}(Mi),ds=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return 255},g.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.stencilMask(d),this.current=d,this.dirty=!1)},g}(Mi),Ur=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},g.prototype.set=function(d){var b=this.current;(d.func!==b.func||d.ref!==b.ref||d.mask!==b.mask||this.dirty)&&(this.gl.stencilFunc(d.func,d.ref,d.mask),this.current=d,this.dirty=!1)},g}(Mi),ls=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){var d=this.gl;return[d.KEEP,d.KEEP,d.KEEP]},g.prototype.set=function(d){var b=this.current;(d[0]!==b[0]||d[1]!==b[1]||d[2]!==b[2]||this.dirty)&&(this.gl.stencilOp(d[0],d[1],d[2]),this.current=d,this.dirty=!1)},g}(Mi),dr=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return!1},g.prototype.set=function(d){if(d!==this.current||this.dirty){var b=this.gl;d?b.enable(b.STENCIL_TEST):b.disable(b.STENCIL_TEST),this.current=d,this.dirty=!1}},g}(Mi),he=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return[0,1]},g.prototype.set=function(d){var b=this.current;(d[0]!==b[0]||d[1]!==b[1]||this.dirty)&&(this.gl.depthRange(d[0],d[1]),this.current=d,this.dirty=!1)},g}(Mi),We=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return!1},g.prototype.set=function(d){if(d!==this.current||this.dirty){var b=this.gl;d?b.enable(b.DEPTH_TEST):b.disable(b.DEPTH_TEST),this.current=d,this.dirty=!1}},g}(Mi),at=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return this.gl.LESS},g.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.depthFunc(d),this.current=d,this.dirty=!1)},g}(Mi),Ot=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return!1},g.prototype.set=function(d){if(d!==this.current||this.dirty){var b=this.gl;d?b.enable(b.BLEND):b.disable(b.BLEND),this.current=d,this.dirty=!1}},g}(Mi),or=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){var d=this.gl;return[d.ONE,d.ZERO]},g.prototype.set=function(d){var b=this.current;(d[0]!==b[0]||d[1]!==b[1]||this.dirty)&&(this.gl.blendFunc(d[0],d[1]),this.current=d,this.dirty=!1)},g}(Mi),Wr=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return M.Color.transparent},g.prototype.set=function(d){var b=this.current;(d.r!==b.r||d.g!==b.g||d.b!==b.b||d.a!==b.a||this.dirty)&&(this.gl.blendColor(d.r,d.g,d.b,d.a),this.current=d,this.dirty=!1)},g}(Mi),In=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return this.gl.FUNC_ADD},g.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.blendEquation(d),this.current=d,this.dirty=!1)},g}(Mi),kn=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return!1},g.prototype.set=function(d){if(d!==this.current||this.dirty){var b=this.gl;d?b.enable(b.CULL_FACE):b.disable(b.CULL_FACE),this.current=d,this.dirty=!1}},g}(Mi),eo=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return this.gl.BACK},g.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.cullFace(d),this.current=d,this.dirty=!1)},g}(Mi),un=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return this.gl.CCW},g.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.frontFace(d),this.current=d,this.dirty=!1)},g}(Mi),To=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return null},g.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.useProgram(d),this.current=d,this.dirty=!1)},g}(Mi),Ti=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return this.gl.TEXTURE0},g.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.activeTexture(d),this.current=d,this.dirty=!1)},g}(Mi),Lo=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){var d=this.gl;return[0,0,d.drawingBufferWidth,d.drawingBufferHeight]},g.prototype.set=function(d){var b=this.current;(d[0]!==b[0]||d[1]!==b[1]||d[2]!==b[2]||d[3]!==b[3]||this.dirty)&&(this.gl.viewport(d[0],d[1],d[2],d[3]),this.current=d,this.dirty=!1)},g}(Mi),wa=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return null},g.prototype.set=function(d){if(d!==this.current||this.dirty){var b=this.gl;b.bindFramebuffer(b.FRAMEBUFFER,d),this.current=d,this.dirty=!1}},g}(Mi),dn=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return null},g.prototype.set=function(d){if(d!==this.current||this.dirty){var b=this.gl;b.bindRenderbuffer(b.RENDERBUFFER,d),this.current=d,this.dirty=!1}},g}(Mi),co=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return null},g.prototype.set=function(d){if(d!==this.current||this.dirty){var b=this.gl;b.bindTexture(b.TEXTURE_2D,d),this.current=d,this.dirty=!1}},g}(Mi),no=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return null},g.prototype.set=function(d){if(d!==this.current||this.dirty){var b=this.gl;b.bindBuffer(b.ARRAY_BUFFER,d),this.current=d,this.dirty=!1}},g}(Mi),Za=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return null},g.prototype.set=function(d){var b=this.gl;b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,d),this.current=d,this.dirty=!1},g}(Mi),ms=function(h){function g(d){h.call(this,d),this.vao=d.extVertexArrayObject}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return null},g.prototype.set=function(d){this.vao&&(d!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(d),this.current=d,this.dirty=!1)},g}(Mi),Ji=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return 4},g.prototype.set=function(d){if(d!==this.current||this.dirty){var b=this.gl;b.pixelStorei(b.UNPACK_ALIGNMENT,d),this.current=d,this.dirty=!1}},g}(Mi),Us=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return!1},g.prototype.set=function(d){if(d!==this.current||this.dirty){var b=this.gl;b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d),this.current=d,this.dirty=!1}},g}(Mi),Lt=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return!1},g.prototype.set=function(d){if(d!==this.current||this.dirty){var b=this.gl;b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,d),this.current=d,this.dirty=!1}},g}(Mi),Ne=function(h){function g(d,b){h.call(this,d),this.context=d,this.parent=b}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getDefault=function(){return null},g}(Mi),re=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.setDirty=function(){this.dirty=!0},g.prototype.set=function(d){if(d!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var b=this.gl;b.framebufferTexture2D(b.FRAMEBUFFER,b.COLOR_ATTACHMENT0,b.TEXTURE_2D,d,0),this.current=d,this.dirty=!1}},g}(Ne),le=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.set=function(d){if(d!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var b=this.gl;b.framebufferRenderbuffer(b.FRAMEBUFFER,b.DEPTH_ATTACHMENT,b.RENDERBUFFER,d),this.current=d,this.dirty=!1}},g}(Ne),ge=function(h,g,d,b){this.context=h,this.width=g,this.height=d;var B=this.framebuffer=h.gl.createFramebuffer();this.colorAttachment=new re(h,B),b&&(this.depthAttachment=new le(h,B))};ge.prototype.destroy=function(){var h=this.context.gl,g=this.colorAttachment.get();if(g&&h.deleteTexture(g),this.depthAttachment){var d=this.depthAttachment.get();d&&h.deleteRenderbuffer(d)}h.deleteFramebuffer(this.framebuffer)};var ye=function(h,g,d){this.func=h,this.mask=g,this.range=d};ye.ReadOnly=!1,ye.ReadWrite=!0,ye.disabled=new ye(519,ye.ReadOnly,[0,1]);var ze=function(h,g,d,b,B,G){this.test=h,this.ref=g,this.mask=d,this.fail=b,this.depthFail=B,this.pass=G};ze.disabled=new ze({func:519,mask:0},0,0,7680,7680,7680);var je=function(h,g,d){this.blendFunction=h,this.blendColor=g,this.mask=d};je.disabled=new je(je.Replace=[1,0],M.Color.transparent,[!1,!1,!1,!1]),je.unblended=new je(je.Replace,M.Color.transparent,[!0,!0,!0,!0]),je.alphaBlended=new je([1,771],M.Color.transparent,[!0,!0,!0,!0]);var Ue=function(h,g,d){this.enable=h,this.mode=g,this.frontFace=d};Ue.disabled=new Ue(!1,1029,2305),Ue.backCCW=new Ue(!0,1029,2305);var Ae=function(h){this.gl=h,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new qo(this),this.clearDepth=new ui(this),this.clearStencil=new Qi(this),this.colorMask=new Vi(this),this.depthMask=new Pi(this),this.stencilMask=new ds(this),this.stencilFunc=new Ur(this),this.stencilOp=new ls(this),this.stencilTest=new dr(this),this.depthRange=new he(this),this.depthTest=new We(this),this.depthFunc=new at(this),this.blend=new Ot(this),this.blendFunc=new or(this),this.blendColor=new Wr(this),this.blendEquation=new In(this),this.cullFace=new kn(this),this.cullFaceSide=new eo(this),this.frontFace=new un(this),this.program=new To(this),this.activeTexture=new Ti(this),this.viewport=new Lo(this),this.bindFramebuffer=new wa(this),this.bindRenderbuffer=new dn(this),this.bindTexture=new co(this),this.bindVertexBuffer=new no(this),this.bindElementBuffer=new Za(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new ms(this),this.pixelStoreUnpack=new Ji(this),this.pixelStoreUnpackPremultiplyAlpha=new Us(this),this.pixelStoreUnpackFlipY=new Lt(this),this.extTextureFilterAnisotropic=h.getExtension("EXT_texture_filter_anisotropic")||h.getExtension("MOZ_EXT_texture_filter_anisotropic")||h.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=h.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=h.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(h.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=h.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=h.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=h.getParameter(h.MAX_TEXTURE_SIZE)};Ae.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},Ae.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},Ae.prototype.createIndexBuffer=function(h,g){return new bo(this,h,g)},Ae.prototype.createVertexBuffer=function(h,g,d){return new Xi(this,h,g,d)},Ae.prototype.createRenderbuffer=function(h,g,d){var b=this.gl,B=b.createRenderbuffer();return this.bindRenderbuffer.set(B),b.renderbufferStorage(b.RENDERBUFFER,h,g,d),this.bindRenderbuffer.set(null),B},Ae.prototype.createFramebuffer=function(h,g,d){return new ge(this,h,g,d)},Ae.prototype.clear=function(h){var g=h.color,d=h.depth,b=this.gl,B=0;g&&(B|=b.COLOR_BUFFER_BIT,this.clearColor.set(g),this.colorMask.set([!0,!0,!0,!0])),d!==void 0&&(B|=b.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(d),this.depthMask.set(!0)),b.clear(B)},Ae.prototype.setCullFace=function(h){h.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(h.mode),this.frontFace.set(h.frontFace))},Ae.prototype.setDepthMode=function(h){h.func!==this.gl.ALWAYS||h.mask?(this.depthTest.set(!0),this.depthFunc.set(h.func),this.depthMask.set(h.mask),this.depthRange.set(h.range)):this.depthTest.set(!1)},Ae.prototype.setStencilMode=function(h){h.test.func!==this.gl.ALWAYS||h.mask?(this.stencilTest.set(!0),this.stencilMask.set(h.mask),this.stencilOp.set([h.fail,h.depthFail,h.pass]),this.stencilFunc.set({func:h.test.func,ref:h.ref,mask:h.test.mask})):this.stencilTest.set(!1)},Ae.prototype.setColorMode=function(h){M.deepEqual(h.blendFunction,je.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(h.blendFunction),this.blendColor.set(h.blendColor)),this.colorMask.set(h.mask)},Ae.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Je=function(h){function g(d,b,B){var G=this;h.call(this),this.id=d,this.dispatcher=B,this.on("data",function(q){q.dataType==="source"&&q.sourceDataType==="metadata"&&(G._sourceLoaded=!0),G._sourceLoaded&&!G._paused&&q.dataType==="source"&&q.sourceDataType==="content"&&(G.reload(),G.transform&&G.update(G.transform))}),this.on("error",function(){G._sourceErrored=!0}),this._source=function(q,te,fe,ce){var Te=new an[te.type](q,te,fe,ce);if(Te.id!==q)throw new Error("Expected Source id to be "+q+" instead of "+Te.id);return M.bindAll(["load","abort","unload","serialize","prepare"],Te),Te}(d,b,B,this),this._tiles={},this._cache=new vi(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new M.SourceFeatureState}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.onAdd=function(d){this.map=d,this._maxTileCacheSize=d?d._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(d)},g.prototype.onRemove=function(d){this._source&&this._source.onRemove&&this._source.onRemove(d)},g.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var d in this._tiles){var b=this._tiles[d];if(b.state!=="loaded"&&b.state!=="errored")return!1}return!0},g.prototype.getSource=function(){return this._source},g.prototype.pause=function(){this._paused=!0},g.prototype.resume=function(){if(this._paused){var d=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,d&&this.reload(),this.transform&&this.update(this.transform)}},g.prototype._loadTile=function(d,b){return this._source.loadTile(d,b)},g.prototype._unloadTile=function(d){if(this._source.unloadTile)return this._source.unloadTile(d,function(){})},g.prototype._abortTile=function(d){if(this._source.abortTile)return this._source.abortTile(d,function(){})},g.prototype.serialize=function(){return this._source.serialize()},g.prototype.prepare=function(d){for(var b in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var B=this._tiles[b];B.upload(d),B.prepare(this.map.style.imageManager)}},g.prototype.getIds=function(){return M.values(this._tiles).map(function(d){return d.tileID}).sort(wt).map(function(d){return d.key})},g.prototype.getRenderableIds=function(d){var b=this,B=[];for(var G in this._tiles)this._isIdRenderable(G,d)&&B.push(this._tiles[G]);return d?B.sort(function(q,te){var fe=q.tileID,ce=te.tileID,Te=new M.Point(fe.canonical.x,fe.canonical.y)._rotate(b.transform.angle),Ie=new M.Point(ce.canonical.x,ce.canonical.y)._rotate(b.transform.angle);return fe.overscaledZ-ce.overscaledZ||Ie.y-Te.y||Ie.x-Te.x}).map(function(q){return q.tileID.key}):B.map(function(q){return q.tileID}).sort(wt).map(function(q){return q.key})},g.prototype.hasRenderableParent=function(d){var b=this.findLoadedParent(d,0);return!!b&&this._isIdRenderable(b.tileID.key)},g.prototype._isIdRenderable=function(d,b){return this._tiles[d]&&this._tiles[d].hasData()&&!this._coveredTiles[d]&&(b||!this._tiles[d].holdingForFade())},g.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var d in this._cache.reset(),this._tiles)this._tiles[d].state!=="errored"&&this._reloadTile(d,"reloading")},g.prototype._reloadTile=function(d,b){var B=this._tiles[d];B&&(B.state!=="loading"&&(B.state=b),this._loadTile(B,this._tileLoaded.bind(this,B,d,b)))},g.prototype._tileLoaded=function(d,b,B,G){if(G)return d.state="errored",void(G.status!==404?this._source.fire(new M.ErrorEvent(G,{tile:d})):this.update(this.transform));d.timeAdded=M.browser.now(),B==="expired"&&(d.refreshedUponExpiration=!0),this._setTileReloadTimer(b,d),this.getSource().type==="raster-dem"&&d.dem&&this._backfillDEM(d),this._state.initializeTileState(d,this.map?this.map.painter:null),this._source.fire(new M.Event("data",{dataType:"source",tile:d,coord:d.tileID}))},g.prototype._backfillDEM=function(d){for(var b=this.getRenderableIds(),B=0;B<b.length;B++){var G=b[B];if(d.neighboringTiles&&d.neighboringTiles[G]){var q=this.getTileByID(G);te(d,q),te(q,d)}}function te(fe,ce){fe.needsHillshadePrepare=!0;var Te=ce.tileID.canonical.x-fe.tileID.canonical.x,Ie=ce.tileID.canonical.y-fe.tileID.canonical.y,Oe=Math.pow(2,fe.tileID.canonical.z),Qe=ce.tileID.key;Te===0&&Ie===0||Math.abs(Ie)>1||(Math.abs(Te)>1&&(Math.abs(Te+Oe)===1?Te+=Oe:Math.abs(Te-Oe)===1&&(Te-=Oe)),ce.dem&&fe.dem&&(fe.dem.backfillBorder(ce.dem,Te,Ie),fe.neighboringTiles&&fe.neighboringTiles[Qe]&&(fe.neighboringTiles[Qe].backfilled=!0)))}},g.prototype.getTile=function(d){return this.getTileByID(d.key)},g.prototype.getTileByID=function(d){return this._tiles[d]},g.prototype._retainLoadedChildren=function(d,b,B,G){for(var q in this._tiles){var te=this._tiles[q];if(!(G[q]||!te.hasData()||te.tileID.overscaledZ<=b||te.tileID.overscaledZ>B)){for(var fe=te.tileID;te&&te.tileID.overscaledZ>b+1;){var ce=te.tileID.scaledTo(te.tileID.overscaledZ-1);(te=this._tiles[ce.key])&&te.hasData()&&(fe=ce)}for(var Te=fe;Te.overscaledZ>b;)if(d[(Te=Te.scaledTo(Te.overscaledZ-1)).key]){G[fe.key]=fe;break}}}},g.prototype.findLoadedParent=function(d,b){if(d.key in this._loadedParentTiles){var B=this._loadedParentTiles[d.key];return B&&B.tileID.overscaledZ>=b?B:null}for(var G=d.overscaledZ-1;G>=b;G--){var q=d.scaledTo(G),te=this._getLoadedTile(q);if(te)return te}},g.prototype._getLoadedTile=function(d){var b=this._tiles[d.key];return b&&b.hasData()?b:this._cache.getByKey(d.wrapped().key)},g.prototype.updateCacheSize=function(d){var b=Math.ceil(d.width/this._source.tileSize)+1,B=Math.ceil(d.height/this._source.tileSize)+1,G=Math.floor(b*B*5),q=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,G):G;this._cache.setMaxSize(q)},g.prototype.handleWrapJump=function(d){var b=Math.round((d-(this._prevLng===void 0?d:this._prevLng))/360);if(this._prevLng=d,b){var B={};for(var G in this._tiles){var q=this._tiles[G];q.tileID=q.tileID.unwrapTo(q.tileID.wrap+b),B[q.tileID.key]=q}for(var te in this._tiles=B,this._timers)clearTimeout(this._timers[te]),delete this._timers[te];for(var fe in this._tiles)this._setTileReloadTimer(fe,this._tiles[fe])}},g.prototype.update=function(d){var b=this;if(this.transform=d,this._sourceLoaded&&!this._paused){var B;this.updateCacheSize(d),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?B=d.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(Hr){return new M.OverscaledTileID(Hr.canonical.z,Hr.wrap,Hr.canonical.z,Hr.canonical.x,Hr.canonical.y)}):(B=d.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(B=B.filter(function(Hr){return b._source.hasTile(Hr)}))):B=[];var G=d.coveringZoomLevel(this._source),q=Math.max(G-g.maxOverzooming,this._source.minzoom),te=Math.max(G+g.maxUnderzooming,this._source.minzoom),fe=this._updateRetainedTiles(B,G);if(Ht(this._source.type)){for(var ce={},Te={},Ie=0,Oe=Object.keys(fe);Ie<Oe.length;Ie+=1){var Qe=Oe[Ie],nt=fe[Qe],ct=this._tiles[Qe];if(ct&&!(ct.fadeEndTime&&ct.fadeEndTime<=M.browser.now())){var tt=this.findLoadedParent(nt,q);tt&&(this._addTile(tt.tileID),ce[tt.tileID.key]=tt.tileID),Te[Qe]=nt}}for(var Tt in this._retainLoadedChildren(Te,G,te,fe),ce)fe[Tt]||(this._coveredTiles[Tt]=!0,fe[Tt]=ce[Tt])}for(var Ut in fe)this._tiles[Ut].clearFadeHold();for(var Nt=0,pr=M.keysDifference(this._tiles,fe);Nt<pr.length;Nt+=1){var tr=pr[Nt],Dr=this._tiles[tr];Dr.hasSymbolBuckets&&!Dr.holdingForFade()?Dr.setHoldDuration(this.map._fadeDuration):Dr.hasSymbolBuckets&&!Dr.symbolFadeFinished()||this._removeTile(tr)}this._updateLoadedParentTileCache()}},g.prototype.releaseSymbolFadeTiles=function(){for(var d in this._tiles)this._tiles[d].holdingForFade()&&this._removeTile(d)},g.prototype._updateRetainedTiles=function(d,b){for(var B={},G={},q=Math.max(b-g.maxOverzooming,this._source.minzoom),te=Math.max(b+g.maxUnderzooming,this._source.minzoom),fe={},ce=0,Te=d;ce<Te.length;ce+=1){var Ie=Te[ce],Oe=this._addTile(Ie);B[Ie.key]=Ie,Oe.hasData()||b<this._source.maxzoom&&(fe[Ie.key]=Ie)}this._retainLoadedChildren(fe,b,te,B);for(var Qe=0,nt=d;Qe<nt.length;Qe+=1){var ct=nt[Qe],tt=this._tiles[ct.key];if(!tt.hasData()){if(b+1>this._source.maxzoom){var Tt=ct.children(this._source.maxzoom)[0],Ut=this.getTile(Tt);if(Ut&&Ut.hasData()){B[Tt.key]=Tt;continue}}else{var Nt=ct.children(this._source.maxzoom);if(B[Nt[0].key]&&B[Nt[1].key]&&B[Nt[2].key]&&B[Nt[3].key])continue}for(var pr=tt.wasRequested(),tr=ct.overscaledZ-1;tr>=q;--tr){var Dr=ct.scaledTo(tr);if(G[Dr.key]||(G[Dr.key]=!0,!(tt=this.getTile(Dr))&&pr&&(tt=this._addTile(Dr)),tt&&(B[Dr.key]=Dr,pr=tt.wasRequested(),tt.hasData())))break}}}return B},g.prototype._updateLoadedParentTileCache=function(){for(var d in this._loadedParentTiles={},this._tiles){for(var b=[],B=void 0,G=this._tiles[d].tileID;G.overscaledZ>0;){if(G.key in this._loadedParentTiles){B=this._loadedParentTiles[G.key];break}b.push(G.key);var q=G.scaledTo(G.overscaledZ-1);if(B=this._getLoadedTile(q))break;G=q}for(var te=0,fe=b;te<fe.length;te+=1)this._loadedParentTiles[fe[te]]=B}},g.prototype._addTile=function(d){var b=this._tiles[d.key];if(b)return b;(b=this._cache.getAndRemove(d))&&(this._setTileReloadTimer(d.key,b),b.tileID=d,this._state.initializeTileState(b,this.map?this.map.painter:null),this._cacheTimers[d.key]&&(clearTimeout(this._cacheTimers[d.key]),delete this._cacheTimers[d.key],this._setTileReloadTimer(d.key,b)));var B=!!b;return B||(b=new M.Tile(d,this._source.tileSize*d.overscaleFactor()),this._loadTile(b,this._tileLoaded.bind(this,b,d.key,b.state))),b?(b.uses++,this._tiles[d.key]=b,B||this._source.fire(new M.Event("dataloading",{tile:b,coord:b.tileID,dataType:"source"})),b):null},g.prototype._setTileReloadTimer=function(d,b){var B=this;d in this._timers&&(clearTimeout(this._timers[d]),delete this._timers[d]);var G=b.getExpiryTimeout();G&&(this._timers[d]=setTimeout(function(){B._reloadTile(d,"expired"),delete B._timers[d]},G))},g.prototype._removeTile=function(d){var b=this._tiles[d];b&&(b.uses--,delete this._tiles[d],this._timers[d]&&(clearTimeout(this._timers[d]),delete this._timers[d]),b.uses>0||(b.hasData()&&b.state!=="reloading"?this._cache.add(b.tileID,b,b.getExpiryTimeout()):(b.aborted=!0,this._abortTile(b),this._unloadTile(b))))},g.prototype.clearTiles=function(){for(var d in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(d);this._cache.reset()},g.prototype.tilesIn=function(d,b,B){var G=this,q=[],te=this.transform;if(!te)return q;for(var fe=B?te.getCameraQueryGeometry(d):d,ce=d.map(function(tr){return te.pointCoordinate(tr)}),Te=fe.map(function(tr){return te.pointCoordinate(tr)}),Ie=this.getIds(),Oe=1/0,Qe=1/0,nt=-1/0,ct=-1/0,tt=0,Tt=Te;tt<Tt.length;tt+=1){var Ut=Tt[tt];Oe=Math.min(Oe,Ut.x),Qe=Math.min(Qe,Ut.y),nt=Math.max(nt,Ut.x),ct=Math.max(ct,Ut.y)}for(var Nt=function(tr){var Dr=G._tiles[Ie[tr]];if(!Dr.holdingForFade()){var Hr=Dr.tileID,sn=Math.pow(2,te.zoom-Dr.tileID.overscaledZ),nn=b*Dr.queryPadding*M.EXTENT/Dr.tileSize/sn,Gn=[Hr.getTilePoint(new M.MercatorCoordinate(Oe,Qe)),Hr.getTilePoint(new M.MercatorCoordinate(nt,ct))];if(Gn[0].x-nn<M.EXTENT&&Gn[0].y-nn<M.EXTENT&&Gn[1].x+nn>=0&&Gn[1].y+nn>=0){var di=ce.map(function(Ui){return Hr.getTilePoint(Ui)}),Di=Te.map(function(Ui){return Hr.getTilePoint(Ui)});q.push({tile:Dr,tileID:Hr,queryGeometry:di,cameraQueryGeometry:Di,scale:sn})}}},pr=0;pr<Ie.length;pr++)Nt(pr);return q},g.prototype.getVisibleCoordinates=function(d){for(var b=this,B=this.getRenderableIds(d).map(function(fe){return b._tiles[fe].tileID}),G=0,q=B;G<q.length;G+=1){var te=q[G];te.posMatrix=this.transform.calculatePosMatrix(te.toUnwrapped())}return B},g.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Ht(this._source.type))for(var d in this._tiles){var b=this._tiles[d];if(b.fadeEndTime!==void 0&&b.fadeEndTime>=M.browser.now())return!0}return!1},g.prototype.setFeatureState=function(d,b,B){this._state.updateState(d=d||"_geojsonTileLayer",b,B)},g.prototype.removeFeatureState=function(d,b,B){this._state.removeFeatureState(d=d||"_geojsonTileLayer",b,B)},g.prototype.getFeatureState=function(d,b){return this._state.getState(d=d||"_geojsonTileLayer",b)},g.prototype.setDependencies=function(d,b,B){var G=this._tiles[d];G&&G.setDependencies(b,B)},g.prototype.reloadTilesForDependencies=function(d,b){for(var B in this._tiles)this._tiles[B].hasDependency(d,b)&&this._reloadTile(B,"reloading");this._cache.filter(function(G){return!G.hasDependency(d,b)})},g}(M.Evented);function wt(h,g){var d=Math.abs(2*h.wrap)-+(h.wrap<0),b=Math.abs(2*g.wrap)-+(g.wrap<0);return h.overscaledZ-g.overscaledZ||b-d||g.canonical.y-h.canonical.y||g.canonical.x-h.canonical.x}function Ht(h){return h==="raster"||h==="image"||h==="video"}function Fr(){return new M.window.Worker(_e.workerUrl)}Je.maxOverzooming=10,Je.maxUnderzooming=3;var mr="mapboxgl_preloaded_worker_pool",Sr=function(){this.active={}};Sr.prototype.acquire=function(h){if(!this.workers)for(this.workers=[];this.workers.length<Sr.workerCount;)this.workers.push(new Fr);return this.active[h]=!0,this.workers.slice()},Sr.prototype.release=function(h){delete this.active[h],this.numActive()===0&&(this.workers.forEach(function(g){g.terminate()}),this.workers=null)},Sr.prototype.isPreloaded=function(){return!!this.active[mr]},Sr.prototype.numActive=function(){return Object.keys(this.active).length};var fn,xn=Math.floor(M.browser.hardwareConcurrency/2);function Lr(){return fn||(fn=new Sr),fn}function Nn(h,g){var d={};for(var b in h)b!=="ref"&&(d[b]=h[b]);return M.refProperties.forEach(function(B){B in g&&(d[B]=g[B])}),d}function bn(h){h=h.slice();for(var g=Object.create(null),d=0;d<h.length;d++)g[h[d].id]=h[d];for(var b=0;b<h.length;b++)"ref"in h[b]&&(h[b]=Nn(h[b],g[h[b].ref]));return h}Sr.workerCount=Math.max(Math.min(xn,6),1);var En={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function io(h,g,d){d.push({command:En.addSource,args:[h,g[h]]})}function On(h,g,d){g.push({command:En.removeSource,args:[h]}),d[h]=!0}function Ao(h,g,d,b){On(h,d,b),io(h,g,d)}function ia(h,g,d){var b;for(b in h[d])if(h[d].hasOwnProperty(b)&&b!=="data"&&!M.deepEqual(h[d][b],g[d][b]))return!1;for(b in g[d])if(g[d].hasOwnProperty(b)&&b!=="data"&&!M.deepEqual(h[d][b],g[d][b]))return!1;return!0}function Ho(h,g,d,b,B,G){var q;for(q in g=g||{},h=h||{})h.hasOwnProperty(q)&&(M.deepEqual(h[q],g[q])||d.push({command:G,args:[b,q,g[q],B]}));for(q in g)g.hasOwnProperty(q)&&!h.hasOwnProperty(q)&&(M.deepEqual(h[q],g[q])||d.push({command:G,args:[b,q,g[q],B]}))}function Ga(h){return h.id}function Wo(h,g){return h[g.id]=g,h}var Hl=function(h,g){this.reset(h,g)};Hl.prototype.reset=function(h,g){this.points=h||[],this._distances=[0];for(var d=1;d<this.points.length;d++)this._distances[d]=this._distances[d-1]+this.points[d].dist(this.points[d-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(g||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Hl.prototype.lerp=function(h){if(this.points.length===1)return this.points[0];h=M.clamp(h,0,1);for(var g=1,d=this._distances[g],b=h*this.paddedLength+this.padding;d<b&&g<this._distances.length;)d=this._distances[++g];var B=g-1,G=this._distances[B],q=d-G,te=q>0?(b-G)/q:0;return this.points[B].mult(1-te).add(this.points[g].mult(te))};var ns=function(h,g,d){var b=this.boxCells=[],B=this.circleCells=[];this.xCellCount=Math.ceil(h/d),this.yCellCount=Math.ceil(g/d);for(var G=0;G<this.xCellCount*this.yCellCount;G++)b.push([]),B.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=h,this.height=g,this.xScale=this.xCellCount/h,this.yScale=this.yCellCount/g,this.boxUid=0,this.circleUid=0};function Yo(h,g,d,b,B){var G=M.create();return g?(M.scale(G,G,[1/B,1/B,1]),d||M.rotateZ(G,G,b.angle)):M.multiply(G,b.labelPlaneMatrix,h),G}function _a(h,g,d,b,B){if(g){var G=M.clone(h);return M.scale(G,G,[B,B,1]),d||M.rotateZ(G,G,-b.angle),G}return b.glCoordMatrix}function $o(h,g){var d=[h.x,h.y,0,1];va(d,d,g);var b=d[3];return{point:new M.Point(d[0]/b,d[1]/b),signedDistanceFromCamera:b}}function Fo(h,g){return .5+h/g*.5}function us(h,g){var d=h[0]/h[3],b=h[1]/h[3];return d>=-g[0]&&d<=g[0]&&b>=-g[1]&&b<=g[1]}function xc(h,g,d,b,B,G,q,te){var fe=b?h.textSizeData:h.iconSizeData,ce=M.evaluateSizeForZoom(fe,d.transform.zoom),Te=[256/d.width*2+1,256/d.height*2+1],Ie=b?h.text.dynamicLayoutVertexArray:h.icon.dynamicLayoutVertexArray;Ie.clear();for(var Oe=h.lineVertexArray,Qe=b?h.text.placedSymbolArray:h.icon.placedSymbolArray,nt=d.transform.width/d.transform.height,ct=!1,tt=0;tt<Qe.length;tt++){var Tt=Qe.get(tt);if(Tt.hidden||Tt.writingMode===M.WritingMode.vertical&&!ct)il(Tt.numGlyphs,Ie);else{ct=!1;var Ut=[Tt.anchorX,Tt.anchorY,0,1];if(M.transformMat4(Ut,Ut,g),us(Ut,Te)){var Nt=Fo(d.transform.cameraToCenterDistance,Ut[3]),pr=M.evaluateSizeForFeature(fe,ce,Tt),tr=q?pr/Nt:pr*Nt,Dr=new M.Point(Tt.anchorX,Tt.anchorY),Hr=$o(Dr,B).point,sn={},nn=sc(Tt,tr,!1,te,g,B,G,h.glyphOffsetArray,Oe,Ie,Hr,Dr,sn,nt);ct=nn.useVertical,(nn.notEnoughRoom||ct||nn.needsFlipping&&sc(Tt,tr,!0,te,g,B,G,h.glyphOffsetArray,Oe,Ie,Hr,Dr,sn,nt).notEnoughRoom)&&il(Tt.numGlyphs,Ie)}else il(Tt.numGlyphs,Ie)}}b?h.text.dynamicLayoutVertexBuffer.updateData(Ie):h.icon.dynamicLayoutVertexBuffer.updateData(Ie)}function Ba(h,g,d,b,B,G,q,te,fe,ce,Te){var Ie=te.glyphStartIndex+te.numGlyphs,Oe=te.lineStartIndex,Qe=te.lineStartIndex+te.lineLength,nt=g.getoffsetX(te.glyphStartIndex),ct=g.getoffsetX(Ie-1),tt=oa(h*nt,d,b,B,G,q,te.segment,Oe,Qe,fe,ce,Te);if(!tt)return null;var Tt=oa(h*ct,d,b,B,G,q,te.segment,Oe,Qe,fe,ce,Te);return Tt?{first:tt,last:Tt}:null}function Fa(h,g,d,b){return h===M.WritingMode.horizontal&&Math.abs(d.y-g.y)>Math.abs(d.x-g.x)*b?{useVertical:!0}:(h===M.WritingMode.vertical?g.y<d.y:g.x>d.x)?{needsFlipping:!0}:null}function sc(h,g,d,b,B,G,q,te,fe,ce,Te,Ie,Oe,Qe){var nt,ct=g/24,tt=h.lineOffsetX*ct,Tt=h.lineOffsetY*ct;if(h.numGlyphs>1){var Ut=h.glyphStartIndex+h.numGlyphs,Nt=h.lineStartIndex,pr=h.lineStartIndex+h.lineLength,tr=Ba(ct,te,tt,Tt,d,Te,Ie,h,fe,G,Oe);if(!tr)return{notEnoughRoom:!0};var Dr=$o(tr.first.point,q).point,Hr=$o(tr.last.point,q).point;if(b&&!d){var sn=Fa(h.writingMode,Dr,Hr,Qe);if(sn)return sn}nt=[tr.first];for(var nn=h.glyphStartIndex+1;nn<Ut-1;nn++)nt.push(oa(ct*te.getoffsetX(nn),tt,Tt,d,Te,Ie,h.segment,Nt,pr,fe,G,Oe));nt.push(tr.last)}else{if(b&&!d){var Gn=$o(Ie,B).point,di=h.lineStartIndex+h.segment+1,Di=new M.Point(fe.getx(di),fe.gety(di)),Ui=$o(Di,B),ho=Ui.signedDistanceFromCamera>0?Ui.point:Ql(Ie,Di,Gn,1,B),gi=Fa(h.writingMode,Gn,ho,Qe);if(gi)return gi}var Wi=oa(ct*te.getoffsetX(h.glyphStartIndex),tt,Tt,d,Te,Ie,h.segment,h.lineStartIndex,h.lineStartIndex+h.lineLength,fe,G,Oe);if(!Wi)return{notEnoughRoom:!0};nt=[Wi]}for(var Ko=0,Mo=nt;Ko<Mo.length;Ko+=1){var mo=Mo[Ko];M.addDynamicAttributes(ce,mo.point,mo.angle)}return{}}function Ql(h,g,d,b,B){var G=$o(h.add(h.sub(g)._unit()),B).point,q=d.sub(G);return d.add(q._mult(b/q.mag()))}function oa(h,g,d,b,B,G,q,te,fe,ce,Te,Ie){var Oe=b?h-g:h+g,Qe=Oe>0?1:-1,nt=0;b&&(Qe*=-1,nt=Math.PI),Qe<0&&(nt+=Math.PI);for(var ct=Qe>0?te+q:te+q+1,tt=B,Tt=B,Ut=0,Nt=0,pr=Math.abs(Oe),tr=[];Ut+Nt<=pr;){if((ct+=Qe)<te||ct>=fe)return null;if(Tt=tt,tr.push(tt),(tt=Ie[ct])===void 0){var Dr=new M.Point(ce.getx(ct),ce.gety(ct)),Hr=$o(Dr,Te);if(Hr.signedDistanceFromCamera>0)tt=Ie[ct]=Hr.point;else{var sn=ct-Qe;tt=Ql(Ut===0?G:new M.Point(ce.getx(sn),ce.gety(sn)),Dr,Tt,pr-Ut+1,Te)}}Ut+=Nt,Nt=Tt.dist(tt)}var nn=(pr-Ut)/Nt,Gn=tt.sub(Tt),di=Gn.mult(nn)._add(Tt);di._add(Gn._unit()._perp()._mult(d*Qe));var Di=nt+Math.atan2(tt.y-Tt.y,tt.x-Tt.x);return tr.push(di),{point:di,angle:Di,path:tr}}ns.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},ns.prototype.insert=function(h,g,d,b,B){this._forEachCell(g,d,b,B,this._insertBoxCell,this.boxUid++),this.boxKeys.push(h),this.bboxes.push(g),this.bboxes.push(d),this.bboxes.push(b),this.bboxes.push(B)},ns.prototype.insertCircle=function(h,g,d,b){this._forEachCell(g-b,d-b,g+b,d+b,this._insertCircleCell,this.circleUid++),this.circleKeys.push(h),this.circles.push(g),this.circles.push(d),this.circles.push(b)},ns.prototype._insertBoxCell=function(h,g,d,b,B,G){this.boxCells[B].push(G)},ns.prototype._insertCircleCell=function(h,g,d,b,B,G){this.circleCells[B].push(G)},ns.prototype._query=function(h,g,d,b,B,G){if(d<0||h>this.width||b<0||g>this.height)return!B&&[];var q=[];if(h<=0&&g<=0&&this.width<=d&&this.height<=b){if(B)return!0;for(var te=0;te<this.boxKeys.length;te++)q.push({key:this.boxKeys[te],x1:this.bboxes[4*te],y1:this.bboxes[4*te+1],x2:this.bboxes[4*te+2],y2:this.bboxes[4*te+3]});for(var fe=0;fe<this.circleKeys.length;fe++){var ce=this.circles[3*fe],Te=this.circles[3*fe+1],Ie=this.circles[3*fe+2];q.push({key:this.circleKeys[fe],x1:ce-Ie,y1:Te-Ie,x2:ce+Ie,y2:Te+Ie})}return G?q.filter(G):q}return this._forEachCell(h,g,d,b,this._queryCell,q,{hitTest:B,seenUids:{box:{},circle:{}}},G),B?q.length>0:q},ns.prototype._queryCircle=function(h,g,d,b,B){var G=h-d,q=h+d,te=g-d,fe=g+d;if(q<0||G>this.width||fe<0||te>this.height)return!b&&[];var ce=[];return this._forEachCell(G,te,q,fe,this._queryCellCircle,ce,{hitTest:b,circle:{x:h,y:g,radius:d},seenUids:{box:{},circle:{}}},B),b?ce.length>0:ce},ns.prototype.query=function(h,g,d,b,B){return this._query(h,g,d,b,!1,B)},ns.prototype.hitTest=function(h,g,d,b,B){return this._query(h,g,d,b,!0,B)},ns.prototype.hitTestCircle=function(h,g,d,b){return this._queryCircle(h,g,d,!0,b)},ns.prototype._queryCell=function(h,g,d,b,B,G,q,te){var fe=q.seenUids,ce=this.boxCells[B];if(ce!==null)for(var Te=this.bboxes,Ie=0,Oe=ce;Ie<Oe.length;Ie+=1){var Qe=Oe[Ie];if(!fe.box[Qe]){fe.box[Qe]=!0;var nt=4*Qe;if(h<=Te[nt+2]&&g<=Te[nt+3]&&d>=Te[nt+0]&&b>=Te[nt+1]&&(!te||te(this.boxKeys[Qe]))){if(q.hitTest)return G.push(!0),!0;G.push({key:this.boxKeys[Qe],x1:Te[nt],y1:Te[nt+1],x2:Te[nt+2],y2:Te[nt+3]})}}}var ct=this.circleCells[B];if(ct!==null)for(var tt=this.circles,Tt=0,Ut=ct;Tt<Ut.length;Tt+=1){var Nt=Ut[Tt];if(!fe.circle[Nt]){fe.circle[Nt]=!0;var pr=3*Nt;if(this._circleAndRectCollide(tt[pr],tt[pr+1],tt[pr+2],h,g,d,b)&&(!te||te(this.circleKeys[Nt]))){if(q.hitTest)return G.push(!0),!0;var tr=tt[pr],Dr=tt[pr+1],Hr=tt[pr+2];G.push({key:this.circleKeys[Nt],x1:tr-Hr,y1:Dr-Hr,x2:tr+Hr,y2:Dr+Hr})}}}},ns.prototype._queryCellCircle=function(h,g,d,b,B,G,q,te){var fe=q.circle,ce=q.seenUids,Te=this.boxCells[B];if(Te!==null)for(var Ie=this.bboxes,Oe=0,Qe=Te;Oe<Qe.length;Oe+=1){var nt=Qe[Oe];if(!ce.box[nt]){ce.box[nt]=!0;var ct=4*nt;if(this._circleAndRectCollide(fe.x,fe.y,fe.radius,Ie[ct+0],Ie[ct+1],Ie[ct+2],Ie[ct+3])&&(!te||te(this.boxKeys[nt])))return G.push(!0),!0}}var tt=this.circleCells[B];if(tt!==null)for(var Tt=this.circles,Ut=0,Nt=tt;Ut<Nt.length;Ut+=1){var pr=Nt[Ut];if(!ce.circle[pr]){ce.circle[pr]=!0;var tr=3*pr;if(this._circlesCollide(Tt[tr],Tt[tr+1],Tt[tr+2],fe.x,fe.y,fe.radius)&&(!te||te(this.circleKeys[pr])))return G.push(!0),!0}}},ns.prototype._forEachCell=function(h,g,d,b,B,G,q,te){for(var fe=this._convertToXCellCoord(h),ce=this._convertToYCellCoord(g),Te=this._convertToXCellCoord(d),Ie=this._convertToYCellCoord(b),Oe=fe;Oe<=Te;Oe++)for(var Qe=ce;Qe<=Ie;Qe++)if(B.call(this,h,g,d,b,this.xCellCount*Qe+Oe,G,q,te))return},ns.prototype._convertToXCellCoord=function(h){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(h*this.xScale)))},ns.prototype._convertToYCellCoord=function(h){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(h*this.yScale)))},ns.prototype._circlesCollide=function(h,g,d,b,B,G){var q=b-h,te=B-g,fe=d+G;return fe*fe>q*q+te*te},ns.prototype._circleAndRectCollide=function(h,g,d,b,B,G,q){var te=(G-b)/2,fe=Math.abs(h-(b+te));if(fe>te+d)return!1;var ce=(q-B)/2,Te=Math.abs(g-(B+ce));if(Te>ce+d)return!1;if(fe<=te||Te<=ce)return!0;var Ie=fe-te,Oe=Te-ce;return Ie*Ie+Oe*Oe<=d*d};var Zo=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function il(h,g){for(var d=0;d<h;d++){var b=g.length;g.resize(b+4),g.float32.set(Zo,3*b)}}function va(h,g,d){var b=g[0],B=g[1];return h[0]=d[0]*b+d[4]*B+d[12],h[1]=d[1]*b+d[5]*B+d[13],h[3]=d[3]*b+d[7]*B+d[15],h}var El=function(h,g,d){g===void 0&&(g=new ns(h.width+200,h.height+200,25)),d===void 0&&(d=new ns(h.width+200,h.height+200,25)),this.transform=h,this.grid=g,this.ignoredGrid=d,this.pitchfactor=Math.cos(h._pitch)*h.cameraToCenterDistance,this.screenRightBoundary=h.width+100,this.screenBottomBoundary=h.height+100,this.gridRightBoundary=h.width+200,this.gridBottomBoundary=h.height+200};function Wa(h,g,d){return g*(M.EXTENT/(h.tileSize*Math.pow(2,d-h.tileID.overscaledZ)))}El.prototype.placeCollisionBox=function(h,g,d,b,B){var G=this.projectAndGetPerspectiveRatio(b,h.anchorPointX,h.anchorPointY),q=d*G.perspectiveRatio,te=h.x1*q+G.point.x,fe=h.y1*q+G.point.y,ce=h.x2*q+G.point.x,Te=h.y2*q+G.point.y;return!this.isInsideGrid(te,fe,ce,Te)||!g&&this.grid.hitTest(te,fe,ce,Te,B)?{box:[],offscreen:!1}:{box:[te,fe,ce,Te],offscreen:this.isOffscreen(te,fe,ce,Te)}},El.prototype.placeCollisionCircles=function(h,g,d,b,B,G,q,te,fe,ce,Te,Ie,Oe){var Qe=[],nt=new M.Point(g.anchorX,g.anchorY),ct=$o(nt,G),tt=Fo(this.transform.cameraToCenterDistance,ct.signedDistanceFromCamera),Tt=(ce?B/tt:B*tt)/M.ONE_EM,Ut=$o(nt,q).point,Nt=Ba(Tt,b,g.lineOffsetX*Tt,g.lineOffsetY*Tt,!1,Ut,nt,g,d,q,{}),pr=!1,tr=!1,Dr=!0;if(Nt){for(var Hr=.5*Ie*tt+Oe,sn=new M.Point(-100,-100),nn=new M.Point(this.screenRightBoundary,this.screenBottomBoundary),Gn=new Hl,di=Nt.first,Di=Nt.last,Ui=[],ho=di.path.length-1;ho>=1;ho--)Ui.push(di.path[ho]);for(var gi=1;gi<Di.path.length;gi++)Ui.push(Di.path[gi]);var Wi=2.5*Hr;if(te){var Ko=Ui.map(function(Yc){return $o(Yc,te)});Ui=Ko.some(function(Yc){return Yc.signedDistanceFromCamera<=0})?[]:Ko.map(function(Yc){return Yc.point})}var Mo=[];if(Ui.length>0){for(var mo=Ui[0].clone(),ko=Ui[0].clone(),xo=1;xo<Ui.length;xo++)mo.x=Math.min(mo.x,Ui[xo].x),mo.y=Math.min(mo.y,Ui[xo].y),ko.x=Math.max(ko.x,Ui[xo].x),ko.y=Math.max(ko.y,Ui[xo].y);Mo=mo.x>=sn.x&&ko.x<=nn.x&&mo.y>=sn.y&&ko.y<=nn.y?[Ui]:ko.x<sn.x||mo.x>nn.x||ko.y<sn.y||mo.y>nn.y?[]:M.clipLine([Ui],sn.x,sn.y,nn.x,nn.y)}for(var qi=0,xs=Mo;qi<xs.length;qi+=1){var gs;Gn.reset(xs[qi],.25*Hr),gs=Gn.length<=.5*Hr?1:Math.ceil(Gn.paddedLength/Wi)+1;for(var Cl=0;Cl<gs;Cl++){var ts=Cl/Math.max(gs-1,1),ja=Gn.lerp(ts),$a=ja.x+100,vs=ja.y+100;Qe.push($a,vs,Hr,0);var Zl=$a-Hr,zu=vs-Hr,Uu=$a+Hr,hh=vs+Hr;if(Dr=Dr&&this.isOffscreen(Zl,zu,Uu,hh),tr=tr||this.isInsideGrid(Zl,zu,Uu,hh),!h&&this.grid.hitTestCircle($a,vs,Hr,Te)&&(pr=!0,!fe))return{circles:[],offscreen:!1,collisionDetected:pr}}}}return{circles:!fe&&pr||!tr?[]:Qe,offscreen:Dr,collisionDetected:pr}},El.prototype.queryRenderedSymbols=function(h){if(h.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var g=[],d=1/0,b=1/0,B=-1/0,G=-1/0,q=0,te=h;q<te.length;q+=1){var fe=te[q],ce=new M.Point(fe.x+100,fe.y+100);d=Math.min(d,ce.x),b=Math.min(b,ce.y),B=Math.max(B,ce.x),G=Math.max(G,ce.y),g.push(ce)}for(var Te={},Ie={},Oe=0,Qe=this.grid.query(d,b,B,G).concat(this.ignoredGrid.query(d,b,B,G));Oe<Qe.length;Oe+=1){var nt=Qe[Oe],ct=nt.key;if(Te[ct.bucketInstanceId]===void 0&&(Te[ct.bucketInstanceId]={}),!Te[ct.bucketInstanceId][ct.featureIndex]){var tt=[new M.Point(nt.x1,nt.y1),new M.Point(nt.x2,nt.y1),new M.Point(nt.x2,nt.y2),new M.Point(nt.x1,nt.y2)];M.polygonIntersectsPolygon(g,tt)&&(Te[ct.bucketInstanceId][ct.featureIndex]=!0,Ie[ct.bucketInstanceId]===void 0&&(Ie[ct.bucketInstanceId]=[]),Ie[ct.bucketInstanceId].push(ct.featureIndex))}}return Ie},El.prototype.insertCollisionBox=function(h,g,d,b,B){(g?this.ignoredGrid:this.grid).insert({bucketInstanceId:d,featureIndex:b,collisionGroupID:B},h[0],h[1],h[2],h[3])},El.prototype.insertCollisionCircles=function(h,g,d,b,B){for(var G=g?this.ignoredGrid:this.grid,q={bucketInstanceId:d,featureIndex:b,collisionGroupID:B},te=0;te<h.length;te+=4)G.insertCircle(q,h[te],h[te+1],h[te+2])},El.prototype.projectAndGetPerspectiveRatio=function(h,g,d){var b=[g,d,0,1];return va(b,b,h),{point:new M.Point((b[0]/b[3]+1)/2*this.transform.width+100,(-b[1]/b[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/b[3]*.5}},El.prototype.isOffscreen=function(h,g,d,b){return d<100||h>=this.screenRightBoundary||b<100||g>this.screenBottomBoundary},El.prototype.isInsideGrid=function(h,g,d,b){return d>=0&&h<this.gridRightBoundary&&b>=0&&g<this.gridBottomBoundary},El.prototype.getViewportMatrix=function(){var h=M.identity([]);return M.translate(h,h,[-100,-100,0]),h};var Ds=function(h,g,d,b){this.opacity=h?Math.max(0,Math.min(1,h.opacity+(h.placed?g:-g))):b&&d?1:0,this.placed=d};Ds.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var Rl=function(h,g,d,b,B){this.text=new Ds(h?h.text:null,g,d,B),this.icon=new Ds(h?h.icon:null,g,b,B)};Rl.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var gu=function(h,g,d){this.text=h,this.icon=g,this.skipFade=d},gl=function(){this.invProjMatrix=M.create(),this.viewportMatrix=M.create(),this.circles=[]},wl=function(h,g,d,b,B){this.bucketInstanceId=h,this.featureIndex=g,this.sourceLayerIndex=d,this.bucketIndex=b,this.tileID=B},ol=function(h){this.crossSourceCollisions=h,this.maxGroupID=0,this.collisionGroups={}};function Qa(h,g,d,b,B){var G=M.getAnchorAlignment(h),q=-(G.horizontalAlign-.5)*g,te=-(G.verticalAlign-.5)*d,fe=M.evaluateVariableOffset(h,b);return new M.Point(q+fe[0]*B,te+fe[1]*B)}function Gl(h,g,d,b,B,G){var q=h.x1,te=h.x2,fe=h.y1,ce=h.y2,Te=h.anchorPointX,Ie=h.anchorPointY,Oe=new M.Point(g,d);return b&&Oe._rotate(B?G:-G),{x1:q+Oe.x,y1:fe+Oe.y,x2:te+Oe.x,y2:ce+Oe.y,anchorPointX:Te,anchorPointY:Ie}}ol.prototype.get=function(h){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[h]){var g=++this.maxGroupID;this.collisionGroups[h]={ID:g,predicate:function(d){return d.collisionGroupID===g}}}return this.collisionGroups[h]};var Wl=function(h,g,d,b){this.transform=h.clone(),this.collisionIndex=new El(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=g,this.retainedQueryData={},this.collisionGroups=new ol(d),this.collisionCircleArrays={},this.prevPlacement=b,b&&(b.prevPlacement=void 0),this.placedOrientations={}};function ut(h,g,d,b,B){h.emplaceBack(g?1:0,d?1:0,b||0,B||0),h.emplaceBack(g?1:0,d?1:0,b||0,B||0),h.emplaceBack(g?1:0,d?1:0,b||0,B||0),h.emplaceBack(g?1:0,d?1:0,b||0,B||0)}Wl.prototype.getBucketParts=function(h,g,d,b){var B=d.getBucket(g),G=d.latestFeatureIndex;if(B&&G&&g.id===B.layerIds[0]){var q=d.collisionBoxArray,te=B.layers[0].layout,fe=Math.pow(2,this.transform.zoom-d.tileID.overscaledZ),ce=d.tileSize/M.EXTENT,Te=this.transform.calculatePosMatrix(d.tileID.toUnwrapped()),Ie=te.get("text-pitch-alignment")==="map",Oe=te.get("text-rotation-alignment")==="map",Qe=Wa(d,1,this.transform.zoom),nt=Yo(Te,Ie,Oe,this.transform,Qe),ct=null;if(Ie){var tt=_a(Te,Ie,Oe,this.transform,Qe);ct=M.multiply([],this.transform.labelPlaneMatrix,tt)}this.retainedQueryData[B.bucketInstanceId]=new wl(B.bucketInstanceId,G,B.sourceLayerIndex,B.index,d.tileID);var Tt={bucket:B,layout:te,posMatrix:Te,textLabelPlaneMatrix:nt,labelToScreenMatrix:ct,scale:fe,textPixelRatio:ce,holdingForFade:d.holdingForFade(),collisionBoxArray:q,partiallyEvaluatedTextSize:M.evaluateSizeForZoom(B.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(B.sourceID)};if(b)for(var Ut=0,Nt=B.sortKeyRanges;Ut<Nt.length;Ut+=1){var pr=Nt[Ut];h.push({sortKey:pr.sortKey,symbolInstanceStart:pr.symbolInstanceStart,symbolInstanceEnd:pr.symbolInstanceEnd,parameters:Tt})}else h.push({symbolInstanceStart:0,symbolInstanceEnd:B.symbolInstances.length,parameters:Tt})}},Wl.prototype.attemptAnchorPlacement=function(h,g,d,b,B,G,q,te,fe,ce,Te,Ie,Oe,Qe,nt){var ct,tt=[Ie.textOffset0,Ie.textOffset1],Tt=Qa(h,d,b,tt,B),Ut=this.collisionIndex.placeCollisionBox(Gl(g,Tt.x,Tt.y,G,q,this.transform.angle),Te,te,fe,ce.predicate);if(!nt||this.collisionIndex.placeCollisionBox(Gl(nt,Tt.x,Tt.y,G,q,this.transform.angle),Te,te,fe,ce.predicate).box.length!==0)return Ut.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[Ie.crossTileID]&&this.prevPlacement.placements[Ie.crossTileID]&&this.prevPlacement.placements[Ie.crossTileID].text&&(ct=this.prevPlacement.variableOffsets[Ie.crossTileID].anchor),this.variableOffsets[Ie.crossTileID]={textOffset:tt,width:d,height:b,anchor:h,textBoxScale:B,prevAnchor:ct},this.markUsedJustification(Oe,h,Ie,Qe),Oe.allowVerticalPlacement&&(this.markUsedOrientation(Oe,Qe,Ie),this.placedOrientations[Ie.crossTileID]=Qe),{shift:Tt,placedGlyphBoxes:Ut}):void 0},Wl.prototype.placeLayerBucketPart=function(h,g,d){var b=this,B=h.parameters,G=B.bucket,q=B.layout,te=B.posMatrix,fe=B.textLabelPlaneMatrix,ce=B.labelToScreenMatrix,Te=B.textPixelRatio,Ie=B.holdingForFade,Oe=B.collisionBoxArray,Qe=B.partiallyEvaluatedTextSize,nt=B.collisionGroup,ct=q.get("text-optional"),tt=q.get("icon-optional"),Tt=q.get("text-allow-overlap"),Ut=q.get("icon-allow-overlap"),Nt=q.get("text-rotation-alignment")==="map",pr=q.get("text-pitch-alignment")==="map",tr=q.get("icon-text-fit")!=="none",Dr=q.get("symbol-z-order")==="viewport-y",Hr=Tt&&(Ut||!G.hasIconData()||tt),sn=Ut&&(Tt||!G.hasTextData()||ct);!G.collisionArrays&&Oe&&G.deserializeCollisionBoxes(Oe);var nn=function(gi,Wi){if(!g[gi.crossTileID])if(Ie)b.placements[gi.crossTileID]=new gu(!1,!1,!1);else{var Ko,Mo=!1,mo=!1,ko=!0,xo=null,qi={box:null,offscreen:null},xs={box:null,offscreen:null},gs=null,Cl=null,ts=0,ja=0,$a=0;Wi.textFeatureIndex?ts=Wi.textFeatureIndex:gi.useRuntimeCollisionCircles&&(ts=gi.featureIndex),Wi.verticalTextFeatureIndex&&(ja=Wi.verticalTextFeatureIndex);var vs=Wi.textBox;if(vs){var Zl=function(os){var yl=M.WritingMode.horizontal;if(G.allowVerticalPlacement&&!os&&b.prevPlacement){var Ol=b.prevPlacement.placedOrientations[gi.crossTileID];Ol&&(b.placedOrientations[gi.crossTileID]=Ol,b.markUsedOrientation(G,yl=Ol,gi))}return yl},zu=function(os,yl){if(G.allowVerticalPlacement&&gi.numVerticalGlyphVertices>0&&Wi.verticalTextBox)for(var Ol=0,ph=G.writingModes;Ol<ph.length&&(ph[Ol]===M.WritingMode.vertical?(qi=yl(),xs=qi):qi=os(),!(qi&&qi.box&&qi.box.length));Ol+=1);else qi=os()};if(q.get("text-variable-anchor")){var Uu=q.get("text-variable-anchor");if(b.prevPlacement&&b.prevPlacement.variableOffsets[gi.crossTileID]){var hh=b.prevPlacement.variableOffsets[gi.crossTileID];Uu.indexOf(hh.anchor)>0&&(Uu=Uu.filter(function(os){return os!==hh.anchor})).unshift(hh.anchor)}var Yc=function(os,yl,Ol){for(var ph=os.x2-os.x1,_f=os.y2-os.y1,ip=gi.textBoxScale,yf=tr&&!Ut?yl:null,Hu={box:[],offscreen:!1},Bp=Tt?2*Uu.length:Uu.length,fc=0;fc<Bp;++fc){var Wf=b.attemptAnchorPlacement(Uu[fc%Uu.length],os,ph,_f,ip,Nt,pr,Te,te,nt,fc>=Uu.length,gi,G,Ol,yf);if(Wf&&(Hu=Wf.placedGlyphBoxes)&&Hu.box&&Hu.box.length){Mo=!0,xo=Wf.shift;break}}return Hu};zu(function(){return Yc(vs,Wi.iconBox,M.WritingMode.horizontal)},function(){var os=Wi.verticalTextBox;return G.allowVerticalPlacement&&!(qi&&qi.box&&qi.box.length)&&gi.numVerticalGlyphVertices>0&&os?Yc(os,Wi.verticalIconBox,M.WritingMode.vertical):{box:null,offscreen:null}}),qi&&(Mo=qi.box,ko=qi.offscreen);var np=Zl(qi&&qi.box);if(!Mo&&b.prevPlacement){var pu=b.prevPlacement.variableOffsets[gi.crossTileID];pu&&(b.variableOffsets[gi.crossTileID]=pu,b.markUsedJustification(G,pu.anchor,gi,np))}}else{var Tu=function(os,yl){var Ol=b.collisionIndex.placeCollisionBox(os,Tt,Te,te,nt.predicate);return Ol&&Ol.box&&Ol.box.length&&(b.markUsedOrientation(G,yl,gi),b.placedOrientations[gi.crossTileID]=yl),Ol};zu(function(){return Tu(vs,M.WritingMode.horizontal)},function(){var os=Wi.verticalTextBox;return G.allowVerticalPlacement&&gi.numVerticalGlyphVertices>0&&os?Tu(os,M.WritingMode.vertical):{box:null,offscreen:null}}),Zl(qi&&qi.box&&qi.box.length)}}if(Mo=(Ko=qi)&&Ko.box&&Ko.box.length>0,ko=Ko&&Ko.offscreen,gi.useRuntimeCollisionCircles){var Zu=G.text.placedSymbolArray.get(gi.centerJustifiedTextSymbolIndex),Dl=M.evaluateSizeForFeature(G.textSizeData,Qe,Zu),Vl=q.get("text-padding");gs=b.collisionIndex.placeCollisionCircles(Tt,Zu,G.lineVertexArray,G.glyphOffsetArray,Dl,te,fe,ce,d,pr,nt.predicate,gi.collisionCircleDiameter,Vl),Mo=Tt||gs.circles.length>0&&!gs.collisionDetected,ko=ko&&gs.offscreen}if(Wi.iconFeatureIndex&&($a=Wi.iconFeatureIndex),Wi.iconBox){var Uh=function(os){var yl=tr&&xo?Gl(os,xo.x,xo.y,Nt,pr,b.transform.angle):os;return b.collisionIndex.placeCollisionBox(yl,Ut,Te,te,nt.predicate)};mo=xs&&xs.box&&xs.box.length&&Wi.verticalIconBox?(Cl=Uh(Wi.verticalIconBox)).box.length>0:(Cl=Uh(Wi.iconBox)).box.length>0,ko=ko&&Cl.offscreen}var ml=ct||gi.numHorizontalGlyphVertices===0&&gi.numVerticalGlyphVertices===0,$l=tt||gi.numIconVertices===0;if(ml||$l?$l?ml||(mo=mo&&Mo):Mo=mo&&Mo:mo=Mo=mo&&Mo,Mo&&Ko&&Ko.box&&b.collisionIndex.insertCollisionBox(Ko.box,q.get("text-ignore-placement"),G.bucketInstanceId,xs&&xs.box&&ja?ja:ts,nt.ID),mo&&Cl&&b.collisionIndex.insertCollisionBox(Cl.box,q.get("icon-ignore-placement"),G.bucketInstanceId,$a,nt.ID),gs&&(Mo&&b.collisionIndex.insertCollisionCircles(gs.circles,q.get("text-ignore-placement"),G.bucketInstanceId,ts,nt.ID),d)){var Vu=G.bucketInstanceId,Ws=b.collisionCircleArrays[Vu];Ws===void 0&&(Ws=b.collisionCircleArrays[Vu]=new gl);for(var ju=0;ju<gs.circles.length;ju+=4)Ws.circles.push(gs.circles[ju+0]),Ws.circles.push(gs.circles[ju+1]),Ws.circles.push(gs.circles[ju+2]),Ws.circles.push(gs.collisionDetected?1:0)}b.placements[gi.crossTileID]=new gu(Mo||Hr,mo||sn,ko||G.justReloaded),g[gi.crossTileID]=!0}};if(Dr)for(var Gn=G.getSortedSymbolIndexes(this.transform.angle),di=Gn.length-1;di>=0;--di){var Di=Gn[di];nn(G.symbolInstances.get(Di),G.collisionArrays[Di])}else for(var Ui=h.symbolInstanceStart;Ui<h.symbolInstanceEnd;Ui++)nn(G.symbolInstances.get(Ui),G.collisionArrays[Ui]);if(d&&G.bucketInstanceId in this.collisionCircleArrays){var ho=this.collisionCircleArrays[G.bucketInstanceId];M.invert(ho.invProjMatrix,te),ho.viewportMatrix=this.collisionIndex.getViewportMatrix()}G.justReloaded=!1},Wl.prototype.markUsedJustification=function(h,g,d,b){var B;B=b===M.WritingMode.vertical?d.verticalPlacedTextSymbolIndex:{left:d.leftJustifiedTextSymbolIndex,center:d.centerJustifiedTextSymbolIndex,right:d.rightJustifiedTextSymbolIndex}[M.getAnchorJustification(g)];for(var G=0,q=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex,d.verticalPlacedTextSymbolIndex];G<q.length;G+=1){var te=q[G];te>=0&&(h.text.placedSymbolArray.get(te).crossTileID=B>=0&&te!==B?0:d.crossTileID)}},Wl.prototype.markUsedOrientation=function(h,g,d){for(var b=g===M.WritingMode.horizontal||g===M.WritingMode.horizontalOnly?g:0,B=g===M.WritingMode.vertical?g:0,G=0,q=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex];G<q.length;G+=1)h.text.placedSymbolArray.get(q[G]).placedOrientation=b;d.verticalPlacedTextSymbolIndex&&(h.text.placedSymbolArray.get(d.verticalPlacedTextSymbolIndex).placedOrientation=B)},Wl.prototype.commit=function(h){this.commitTime=h,this.zoomAtLastRecencyCheck=this.transform.zoom;var g=this.prevPlacement,d=!1;this.prevZoomAdjustment=g?g.zoomAdjustment(this.transform.zoom):0;var b=g?g.symbolFadeChange(h):1,B=g?g.opacities:{},G=g?g.variableOffsets:{},q=g?g.placedOrientations:{};for(var te in this.placements){var fe=this.placements[te],ce=B[te];ce?(this.opacities[te]=new Rl(ce,b,fe.text,fe.icon),d=d||fe.text!==ce.text.placed||fe.icon!==ce.icon.placed):(this.opacities[te]=new Rl(null,b,fe.text,fe.icon,fe.skipFade),d=d||fe.text||fe.icon)}for(var Te in B){var Ie=B[Te];if(!this.opacities[Te]){var Oe=new Rl(Ie,b,!1,!1);Oe.isHidden()||(this.opacities[Te]=Oe,d=d||Ie.text.placed||Ie.icon.placed)}}for(var Qe in G)this.variableOffsets[Qe]||!this.opacities[Qe]||this.opacities[Qe].isHidden()||(this.variableOffsets[Qe]=G[Qe]);for(var nt in q)this.placedOrientations[nt]||!this.opacities[nt]||this.opacities[nt].isHidden()||(this.placedOrientations[nt]=q[nt]);d?this.lastPlacementChangeTime=h:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=g?g.lastPlacementChangeTime:h)},Wl.prototype.updateLayerOpacities=function(h,g){for(var d={},b=0,B=g;b<B.length;b+=1){var G=B[b],q=G.getBucket(h);q&&G.latestFeatureIndex&&h.id===q.layerIds[0]&&this.updateBucketOpacities(q,d,G.collisionBoxArray)}},Wl.prototype.updateBucketOpacities=function(h,g,d){var b=this;h.hasTextData()&&h.text.opacityVertexArray.clear(),h.hasIconData()&&h.icon.opacityVertexArray.clear(),h.hasIconCollisionBoxData()&&h.iconCollisionBox.collisionVertexArray.clear(),h.hasTextCollisionBoxData()&&h.textCollisionBox.collisionVertexArray.clear();var B=h.layers[0].layout,G=new Rl(null,0,!1,!1,!0),q=B.get("text-allow-overlap"),te=B.get("icon-allow-overlap"),fe=B.get("text-variable-anchor"),ce=B.get("text-rotation-alignment")==="map",Te=B.get("text-pitch-alignment")==="map",Ie=B.get("icon-text-fit")!=="none",Oe=new Rl(null,0,q&&(te||!h.hasIconData()||B.get("icon-optional")),te&&(q||!h.hasTextData()||B.get("text-optional")),!0);!h.collisionArrays&&d&&(h.hasIconCollisionBoxData()||h.hasTextCollisionBoxData())&&h.deserializeCollisionBoxes(d);for(var Qe=function(Tt,Ut,Nt){for(var pr=0;pr<Ut/4;pr++)Tt.opacityVertexArray.emplaceBack(Nt)},nt=function(Tt){var Ut=h.symbolInstances.get(Tt),Nt=Ut.numHorizontalGlyphVertices,pr=Ut.numVerticalGlyphVertices,tr=Ut.crossTileID,Dr=b.opacities[tr];g[tr]?Dr=G:Dr||(b.opacities[tr]=Dr=Oe),g[tr]=!0;var Hr=Ut.numIconVertices>0,sn=b.placedOrientations[Ut.crossTileID],nn=sn===M.WritingMode.vertical,Gn=sn===M.WritingMode.horizontal||sn===M.WritingMode.horizontalOnly;if(Nt>0||pr>0){var di=kl(Dr.text);Qe(h.text,Nt,nn?Il:di),Qe(h.text,pr,Gn?Il:di);var Di=Dr.text.isHidden();[Ut.rightJustifiedTextSymbolIndex,Ut.centerJustifiedTextSymbolIndex,Ut.leftJustifiedTextSymbolIndex].forEach(function(qi){qi>=0&&(h.text.placedSymbolArray.get(qi).hidden=Di||nn?1:0)}),Ut.verticalPlacedTextSymbolIndex>=0&&(h.text.placedSymbolArray.get(Ut.verticalPlacedTextSymbolIndex).hidden=Di||Gn?1:0);var Ui=b.variableOffsets[Ut.crossTileID];Ui&&b.markUsedJustification(h,Ui.anchor,Ut,sn);var ho=b.placedOrientations[Ut.crossTileID];ho&&(b.markUsedJustification(h,"left",Ut,ho),b.markUsedOrientation(h,ho,Ut))}if(Hr){var gi=kl(Dr.icon),Wi=!(Ie&&Ut.verticalPlacedIconSymbolIndex&&nn);Ut.placedIconSymbolIndex>=0&&(Qe(h.icon,Ut.numIconVertices,Wi?gi:Il),h.icon.placedSymbolArray.get(Ut.placedIconSymbolIndex).hidden=Dr.icon.isHidden()),Ut.verticalPlacedIconSymbolIndex>=0&&(Qe(h.icon,Ut.numVerticalIconVertices,Wi?Il:gi),h.icon.placedSymbolArray.get(Ut.verticalPlacedIconSymbolIndex).hidden=Dr.icon.isHidden())}if(h.hasIconCollisionBoxData()||h.hasTextCollisionBoxData()){var Ko=h.collisionArrays[Tt];if(Ko){var Mo=new M.Point(0,0);if(Ko.textBox||Ko.verticalTextBox){var mo=!0;if(fe){var ko=b.variableOffsets[tr];ko?(Mo=Qa(ko.anchor,ko.width,ko.height,ko.textOffset,ko.textBoxScale),ce&&Mo._rotate(Te?b.transform.angle:-b.transform.angle)):mo=!1}Ko.textBox&&ut(h.textCollisionBox.collisionVertexArray,Dr.text.placed,!mo||nn,Mo.x,Mo.y),Ko.verticalTextBox&&ut(h.textCollisionBox.collisionVertexArray,Dr.text.placed,!mo||Gn,Mo.x,Mo.y)}var xo=!!(!Gn&&Ko.verticalIconBox);Ko.iconBox&&ut(h.iconCollisionBox.collisionVertexArray,Dr.icon.placed,xo,Ie?Mo.x:0,Ie?Mo.y:0),Ko.verticalIconBox&&ut(h.iconCollisionBox.collisionVertexArray,Dr.icon.placed,!xo,Ie?Mo.x:0,Ie?Mo.y:0)}}},ct=0;ct<h.symbolInstances.length;ct++)nt(ct);if(h.sortFeatures(this.transform.angle),this.retainedQueryData[h.bucketInstanceId]&&(this.retainedQueryData[h.bucketInstanceId].featureSortOrder=h.featureSortOrder),h.hasTextData()&&h.text.opacityVertexBuffer&&h.text.opacityVertexBuffer.updateData(h.text.opacityVertexArray),h.hasIconData()&&h.icon.opacityVertexBuffer&&h.icon.opacityVertexBuffer.updateData(h.icon.opacityVertexArray),h.hasIconCollisionBoxData()&&h.iconCollisionBox.collisionVertexBuffer&&h.iconCollisionBox.collisionVertexBuffer.updateData(h.iconCollisionBox.collisionVertexArray),h.hasTextCollisionBoxData()&&h.textCollisionBox.collisionVertexBuffer&&h.textCollisionBox.collisionVertexBuffer.updateData(h.textCollisionBox.collisionVertexArray),h.bucketInstanceId in this.collisionCircleArrays){var tt=this.collisionCircleArrays[h.bucketInstanceId];h.placementInvProjMatrix=tt.invProjMatrix,h.placementViewportMatrix=tt.viewportMatrix,h.collisionCircleArray=tt.circles,delete this.collisionCircleArrays[h.bucketInstanceId]}},Wl.prototype.symbolFadeChange=function(h){return this.fadeDuration===0?1:(h-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Wl.prototype.zoomAdjustment=function(h){return Math.max(0,(this.transform.zoom-h)/1.5)},Wl.prototype.hasTransitions=function(h){return this.stale||h-this.lastPlacementChangeTime<this.fadeDuration},Wl.prototype.stillRecent=function(h,g){var d=this.zoomAtLastRecencyCheck===g?1-this.zoomAdjustment(g):1;return this.zoomAtLastRecencyCheck=g,this.commitTime+this.fadeDuration*d>h},Wl.prototype.setStale=function(){this.stale=!0};var At=Math.pow(2,25),ir=Math.pow(2,24),jr=Math.pow(2,17),Dn=Math.pow(2,16),oo=Math.pow(2,9),Xa=Math.pow(2,8),mn=Math.pow(2,1);function kl(h){if(h.opacity===0&&!h.placed)return 0;if(h.opacity===1&&h.placed)return 4294967295;var g=h.placed?1:0,d=Math.floor(127*h.opacity);return d*At+g*ir+d*jr+g*Dn+d*oo+g*Xa+d*mn+g}var Il=0,Ia=function(h){this._sortAcrossTiles=h.layout.get("symbol-z-order")!=="viewport-y"&&h.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Ia.prototype.continuePlacement=function(h,g,d,b,B){for(var G=this._bucketParts;this._currentTileIndex<h.length;)if(g.getBucketParts(G,b,h[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,B())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,G.sort(function(q,te){return q.sortKey-te.sortKey}));this._currentPartIndex<G.length;)if(g.placeLayerBucketPart(G[this._currentPartIndex],this._seenCrossTileIDs,d),this._currentPartIndex++,B())return!0;return!1};var Xh=function(h,g,d,b,B,G,q){this.placement=new Wl(h,B,G,q),this._currentPlacementIndex=g.length-1,this._forceFullPlacement=d,this._showCollisionBoxes=b,this._done=!1};Xh.prototype.isDone=function(){return this._done},Xh.prototype.continuePlacement=function(h,g,d){for(var b=this,B=M.browser.now(),G=function(){var fe=M.browser.now()-B;return!b._forceFullPlacement&&fe>2};this._currentPlacementIndex>=0;){var q=g[h[this._currentPlacementIndex]],te=this.placement.collisionIndex.transform.zoom;if(q.type==="symbol"&&(!q.minzoom||q.minzoom<=te)&&(!q.maxzoom||q.maxzoom>te)){if(this._inProgressLayer||(this._inProgressLayer=new Ia(q)),this._inProgressLayer.continuePlacement(d[q.source],this.placement,this._showCollisionBoxes,q,G))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Xh.prototype.commit=function(h){return this.placement.commit(h),this.placement};var Sl=512/M.EXTENT/2,Va=function(h,g,d){this.tileID=h,this.indexedSymbolInstances={},this.bucketInstanceId=d;for(var b=0;b<g.length;b++){var B=g.get(b),G=B.key;this.indexedSymbolInstances[G]||(this.indexedSymbolInstances[G]=[]),this.indexedSymbolInstances[G].push({crossTileID:B.crossTileID,coord:this.getScaledCoordinates(B,h)})}};Va.prototype.getScaledCoordinates=function(h,g){var d=Sl/Math.pow(2,g.canonical.z-this.tileID.canonical.z);return{x:Math.floor((g.canonical.x*M.EXTENT+h.anchorX)*d),y:Math.floor((g.canonical.y*M.EXTENT+h.anchorY)*d)}},Va.prototype.findMatches=function(h,g,d){for(var b=this.tileID.canonical.z<g.canonical.z?1:Math.pow(2,this.tileID.canonical.z-g.canonical.z),B=0;B<h.length;B++){var G=h.get(B);if(!G.crossTileID){var q=this.indexedSymbolInstances[G.key];if(q)for(var te=this.getScaledCoordinates(G,g),fe=0,ce=q;fe<ce.length;fe+=1){var Te=ce[fe];if(Math.abs(Te.coord.x-te.x)<=b&&Math.abs(Te.coord.y-te.y)<=b&&!d[Te.crossTileID]){d[Te.crossTileID]=!0,G.crossTileID=Te.crossTileID;break}}}}};var Aa=function(){this.maxCrossTileID=0};Aa.prototype.generate=function(){return++this.maxCrossTileID};var Ni=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Ni.prototype.handleWrapJump=function(h){var g=Math.round((h-this.lng)/360);if(g!==0)for(var d in this.indexes){var b=this.indexes[d],B={};for(var G in b){var q=b[G];q.tileID=q.tileID.unwrapTo(q.tileID.wrap+g),B[q.tileID.key]=q}this.indexes[d]=B}this.lng=h},Ni.prototype.addBucket=function(h,g,d){if(this.indexes[h.overscaledZ]&&this.indexes[h.overscaledZ][h.key]){if(this.indexes[h.overscaledZ][h.key].bucketInstanceId===g.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(h.overscaledZ,this.indexes[h.overscaledZ][h.key])}for(var b=0;b<g.symbolInstances.length;b++)g.symbolInstances.get(b).crossTileID=0;this.usedCrossTileIDs[h.overscaledZ]||(this.usedCrossTileIDs[h.overscaledZ]={});var B=this.usedCrossTileIDs[h.overscaledZ];for(var G in this.indexes){var q=this.indexes[G];if(Number(G)>h.overscaledZ)for(var te in q){var fe=q[te];fe.tileID.isChildOf(h)&&fe.findMatches(g.symbolInstances,h,B)}else{var ce=q[h.scaledTo(Number(G)).key];ce&&ce.findMatches(g.symbolInstances,h,B)}}for(var Te=0;Te<g.symbolInstances.length;Te++){var Ie=g.symbolInstances.get(Te);Ie.crossTileID||(Ie.crossTileID=d.generate(),B[Ie.crossTileID]=!0)}return this.indexes[h.overscaledZ]===void 0&&(this.indexes[h.overscaledZ]={}),this.indexes[h.overscaledZ][h.key]=new Va(h,g.symbolInstances,g.bucketInstanceId),!0},Ni.prototype.removeBucketCrossTileIDs=function(h,g){for(var d in g.indexedSymbolInstances)for(var b=0,B=g.indexedSymbolInstances[d];b<B.length;b+=1)delete this.usedCrossTileIDs[h][B[b].crossTileID]},Ni.prototype.removeStaleBuckets=function(h){var g=!1;for(var d in this.indexes){var b=this.indexes[d];for(var B in b)h[b[B].bucketInstanceId]||(this.removeBucketCrossTileIDs(d,b[B]),delete b[B],g=!0)}return g};var lc=function(){this.layerIndexes={},this.crossTileIDs=new Aa,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};lc.prototype.addLayer=function(h,g,d){var b=this.layerIndexes[h.id];b===void 0&&(b=this.layerIndexes[h.id]=new Ni);var B=!1,G={};b.handleWrapJump(d);for(var q=0,te=g;q<te.length;q+=1){var fe=te[q],ce=fe.getBucket(h);ce&&h.id===ce.layerIds[0]&&(ce.bucketInstanceId||(ce.bucketInstanceId=++this.maxBucketInstanceId),b.addBucket(fe.tileID,ce,this.crossTileIDs)&&(B=!0),G[ce.bucketInstanceId]=!0)}return b.removeStaleBuckets(G)&&(B=!0),B},lc.prototype.pruneUnusedLayers=function(h){var g={};for(var d in h.forEach(function(b){g[b]=!0}),this.layerIndexes)g[d]||delete this.layerIndexes[d]};var Ku=function(h,g){return M.emitValidationErrors(h,g&&g.filter(function(d){return d.identifier!=="source.canvas"}))},lo=M.pick(En,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),bs=M.pick(En,["setCenter","setZoom","setBearing","setPitch"]),Os=function(){var h={},g=M.styleSpec.$version;for(var d in M.styleSpec.$root){var b,B=M.styleSpec.$root[d];B.required&&(b=d==="version"?g:B.type==="array"?[]:{})!=null&&(h[d]=b)}return h}(),Nl=function(h){function g(d,b){var B=this;b===void 0&&(b={}),h.call(this),this.map=d,this.dispatcher=new rn(Lr(),this),this.imageManager=new er,this.imageManager.setEventedParent(this),this.glyphManager=new pa(d._requestManager,b.localIdeographFontFamily),this.lineAtlas=new gr(256,512),this.crossTileSymbolIndex=new lc,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new M.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",M.getReferrer());var G=this;this._rtlTextPluginCallback=g.registerForPluginStateChange(function(q){G.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:q.pluginStatus,pluginURL:q.pluginURL},function(te,fe){if(M.triggerPluginCompletionEvent(te),fe&&fe.every(function(Te){return Te}))for(var ce in G.sourceCaches)G.sourceCaches[ce].reload()})}),this.on("data",function(q){if(q.dataType==="source"&&q.sourceDataType==="metadata"){var te=B.sourceCaches[q.sourceId];if(te){var fe=te.getSource();if(fe&&fe.vectorLayerIds)for(var ce in B._layers){var Te=B._layers[ce];Te.source===fe.id&&B._validateLayer(Te)}}}})}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.loadURL=function(d,b){var B=this;b===void 0&&(b={}),this.fire(new M.Event("dataloading",{dataType:"style"}));var G=typeof b.validate=="boolean"?b.validate:!M.isMapboxURL(d);d=this.map._requestManager.normalizeStyleURL(d,b.accessToken);var q=this.map._requestManager.transformRequest(d,M.ResourceType.Style);this._request=M.getJSON(q,function(te,fe){B._request=null,te?B.fire(new M.ErrorEvent(te)):fe&&B._load(fe,G)})},g.prototype.loadJSON=function(d,b){var B=this;b===void 0&&(b={}),this.fire(new M.Event("dataloading",{dataType:"style"})),this._request=M.browser.frame(function(){B._request=null,B._load(d,b.validate!==!1)})},g.prototype.loadEmpty=function(){this.fire(new M.Event("dataloading",{dataType:"style"})),this._load(Os,!1)},g.prototype._load=function(d,b){if(!b||!Ku(this,M.validateStyle(d))){for(var B in this._loaded=!0,this.stylesheet=d,d.sources)this.addSource(B,d.sources[B],{validate:!1});d.sprite?this._loadSprite(d.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(d.glyphs);var G=bn(this.stylesheet.layers);this._order=G.map(function(ce){return ce.id}),this._layers={},this._serializedLayers={};for(var q=0,te=G;q<te.length;q+=1){var fe=te[q];(fe=M.createStyleLayer(fe)).setEventedParent(this,{layer:{id:fe.id}}),this._layers[fe.id]=fe,this._serializedLayers[fe.id]=fe.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Jr(this.stylesheet.light),this.fire(new M.Event("data",{dataType:"style"})),this.fire(new M.Event("style.load"))}},g.prototype._loadSprite=function(d){var b=this;this._spriteRequest=function(B,G,q){var te,fe,ce,Te=M.browser.devicePixelRatio>1?"@2x":"",Ie=M.getJSON(G.transformRequest(G.normalizeSpriteURL(B,Te,".json"),M.ResourceType.SpriteJSON),function(nt,ct){Ie=null,ce||(ce=nt,te=ct,Qe())}),Oe=M.getImage(G.transformRequest(G.normalizeSpriteURL(B,Te,".png"),M.ResourceType.SpriteImage),function(nt,ct){Oe=null,ce||(ce=nt,fe=ct,Qe())});function Qe(){if(ce)q(ce);else if(te&&fe){var nt=M.browser.getImageData(fe),ct={};for(var tt in te){var Tt=te[tt],Ut=Tt.width,Nt=Tt.height,pr=Tt.x,tr=Tt.y,Dr=Tt.sdf,Hr=Tt.pixelRatio,sn=Tt.stretchX,nn=Tt.stretchY,Gn=Tt.content,di=new M.RGBAImage({width:Ut,height:Nt});M.RGBAImage.copy(nt,di,{x:pr,y:tr},{x:0,y:0},{width:Ut,height:Nt}),ct[tt]={data:di,pixelRatio:Hr,sdf:Dr,stretchX:sn,stretchY:nn,content:Gn}}q(null,ct)}}return{cancel:function(){Ie&&(Ie.cancel(),Ie=null),Oe&&(Oe.cancel(),Oe=null)}}}(d,this.map._requestManager,function(B,G){if(b._spriteRequest=null,B)b.fire(new M.ErrorEvent(B));else if(G)for(var q in G)b.imageManager.addImage(q,G[q]);b.imageManager.setLoaded(!0),b._availableImages=b.imageManager.listImages(),b.dispatcher.broadcast("setImages",b._availableImages),b.fire(new M.Event("data",{dataType:"style"}))})},g.prototype._validateLayer=function(d){var b=this.sourceCaches[d.source];if(b){var B=d.sourceLayer;if(B){var G=b.getSource();(G.type==="geojson"||G.vectorLayerIds&&G.vectorLayerIds.indexOf(B)===-1)&&this.fire(new M.ErrorEvent(new Error('Source layer "'+B+'" does not exist on source "'+G.id+'" as specified by style layer "'+d.id+'"')))}}},g.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var d in this.sourceCaches)if(!this.sourceCaches[d].loaded())return!1;return!!this.imageManager.isLoaded()},g.prototype._serializeLayers=function(d){for(var b=[],B=0,G=d;B<G.length;B+=1){var q=this._layers[G[B]];q.type!=="custom"&&b.push(q.serialize())}return b},g.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var d in this.sourceCaches)if(this.sourceCaches[d].hasTransition())return!0;for(var b in this._layers)if(this._layers[b].hasTransition())return!0;return!1},g.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},g.prototype.update=function(d){if(this._loaded){var b=this._changed;if(this._changed){var B=Object.keys(this._updatedLayers),G=Object.keys(this._removedLayers);for(var q in(B.length||G.length)&&this._updateWorkerLayers(B,G),this._updatedSources){var te=this._updatedSources[q];te==="reload"?this._reloadSource(q):te==="clear"&&this._clearSource(q)}for(var fe in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[fe].updateTransitions(d);this.light.updateTransitions(d),this._resetUpdates()}var ce={};for(var Te in this.sourceCaches){var Ie=this.sourceCaches[Te];ce[Te]=Ie.used,Ie.used=!1}for(var Oe=0,Qe=this._order;Oe<Qe.length;Oe+=1){var nt=this._layers[Qe[Oe]];nt.recalculate(d,this._availableImages),!nt.isHidden(d.zoom)&&nt.source&&(this.sourceCaches[nt.source].used=!0)}for(var ct in ce){var tt=this.sourceCaches[ct];ce[ct]!==tt.used&&tt.fire(new M.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:ct}))}this.light.recalculate(d),this.z=d.zoom,b&&this.fire(new M.Event("data",{dataType:"style"}))}},g.prototype._updateTilesForChangedImages=function(){var d=Object.keys(this._changedImages);if(d.length){for(var b in this.sourceCaches)this.sourceCaches[b].reloadTilesForDependencies(["icons","patterns"],d);this._changedImages={}}},g.prototype._updateWorkerLayers=function(d,b){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(d),removedIds:b})},g.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},g.prototype.setState=function(d){var b=this;if(this._checkLoaded(),Ku(this,M.validateStyle(d)))return!1;(d=M.clone$1(d)).layers=bn(d.layers);var B=function(q,te){if(!q)return[{command:En.setStyle,args:[te]}];var fe=[];try{if(!M.deepEqual(q.version,te.version))return[{command:En.setStyle,args:[te]}];M.deepEqual(q.center,te.center)||fe.push({command:En.setCenter,args:[te.center]}),M.deepEqual(q.zoom,te.zoom)||fe.push({command:En.setZoom,args:[te.zoom]}),M.deepEqual(q.bearing,te.bearing)||fe.push({command:En.setBearing,args:[te.bearing]}),M.deepEqual(q.pitch,te.pitch)||fe.push({command:En.setPitch,args:[te.pitch]}),M.deepEqual(q.sprite,te.sprite)||fe.push({command:En.setSprite,args:[te.sprite]}),M.deepEqual(q.glyphs,te.glyphs)||fe.push({command:En.setGlyphs,args:[te.glyphs]}),M.deepEqual(q.transition,te.transition)||fe.push({command:En.setTransition,args:[te.transition]}),M.deepEqual(q.light,te.light)||fe.push({command:En.setLight,args:[te.light]});var ce={},Te=[];(function(Oe,Qe,nt,ct){var tt;for(tt in Qe=Qe||{},Oe=Oe||{})Oe.hasOwnProperty(tt)&&(Qe.hasOwnProperty(tt)||On(tt,nt,ct));for(tt in Qe)Qe.hasOwnProperty(tt)&&(Oe.hasOwnProperty(tt)?M.deepEqual(Oe[tt],Qe[tt])||(Oe[tt].type==="geojson"&&Qe[tt].type==="geojson"&&ia(Oe,Qe,tt)?nt.push({command:En.setGeoJSONSourceData,args:[tt,Qe[tt].data]}):Ao(tt,Qe,nt,ct)):io(tt,Qe,nt))})(q.sources,te.sources,Te,ce);var Ie=[];q.layers&&q.layers.forEach(function(Oe){ce[Oe.source]?fe.push({command:En.removeLayer,args:[Oe.id]}):Ie.push(Oe)}),fe=fe.concat(Te),function(Oe,Qe,nt){Qe=Qe||[];var ct,tt,Tt,Ut,Nt,pr,tr,Dr=(Oe=Oe||[]).map(Ga),Hr=Qe.map(Ga),sn=Oe.reduce(Wo,{}),nn=Qe.reduce(Wo,{}),Gn=Dr.slice(),di=Object.create(null);for(ct=0,tt=0;ct<Dr.length;ct++)nn.hasOwnProperty(Tt=Dr[ct])?tt++:(nt.push({command:En.removeLayer,args:[Tt]}),Gn.splice(Gn.indexOf(Tt,tt),1));for(ct=0,tt=0;ct<Hr.length;ct++)Gn[Gn.length-1-ct]!==(Tt=Hr[Hr.length-1-ct])&&(sn.hasOwnProperty(Tt)?(nt.push({command:En.removeLayer,args:[Tt]}),Gn.splice(Gn.lastIndexOf(Tt,Gn.length-tt),1)):tt++,nt.push({command:En.addLayer,args:[nn[Tt],pr=Gn[Gn.length-ct]]}),Gn.splice(Gn.length-ct,0,Tt),di[Tt]=!0);for(ct=0;ct<Hr.length;ct++)if(Ut=sn[Tt=Hr[ct]],Nt=nn[Tt],!di[Tt]&&!M.deepEqual(Ut,Nt))if(M.deepEqual(Ut.source,Nt.source)&&M.deepEqual(Ut["source-layer"],Nt["source-layer"])&&M.deepEqual(Ut.type,Nt.type)){for(tr in Ho(Ut.layout,Nt.layout,nt,Tt,null,En.setLayoutProperty),Ho(Ut.paint,Nt.paint,nt,Tt,null,En.setPaintProperty),M.deepEqual(Ut.filter,Nt.filter)||nt.push({command:En.setFilter,args:[Tt,Nt.filter]}),M.deepEqual(Ut.minzoom,Nt.minzoom)&&M.deepEqual(Ut.maxzoom,Nt.maxzoom)||nt.push({command:En.setLayerZoomRange,args:[Tt,Nt.minzoom,Nt.maxzoom]}),Ut)Ut.hasOwnProperty(tr)&&tr!=="layout"&&tr!=="paint"&&tr!=="filter"&&tr!=="metadata"&&tr!=="minzoom"&&tr!=="maxzoom"&&(tr.indexOf("paint.")===0?Ho(Ut[tr],Nt[tr],nt,Tt,tr.slice(6),En.setPaintProperty):M.deepEqual(Ut[tr],Nt[tr])||nt.push({command:En.setLayerProperty,args:[Tt,tr,Nt[tr]]}));for(tr in Nt)Nt.hasOwnProperty(tr)&&!Ut.hasOwnProperty(tr)&&tr!=="layout"&&tr!=="paint"&&tr!=="filter"&&tr!=="metadata"&&tr!=="minzoom"&&tr!=="maxzoom"&&(tr.indexOf("paint.")===0?Ho(Ut[tr],Nt[tr],nt,Tt,tr.slice(6),En.setPaintProperty):M.deepEqual(Ut[tr],Nt[tr])||nt.push({command:En.setLayerProperty,args:[Tt,tr,Nt[tr]]}))}else nt.push({command:En.removeLayer,args:[Tt]}),pr=Gn[Gn.lastIndexOf(Tt)+1],nt.push({command:En.addLayer,args:[Nt,pr]})}(Ie,te.layers,fe)}catch(Oe){console.warn("Unable to compute style diff:",Oe),fe=[{command:En.setStyle,args:[te]}]}return fe}(this.serialize(),d).filter(function(q){return!(q.command in bs)});if(B.length===0)return!1;var G=B.filter(function(q){return!(q.command in lo)});if(G.length>0)throw new Error("Unimplemented: "+G.map(function(q){return q.command}).join(", ")+".");return B.forEach(function(q){q.command!=="setTransition"&&b[q.command].apply(b,q.args)}),this.stylesheet=d,!0},g.prototype.addImage=function(d,b){if(this.getImage(d))return this.fire(new M.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(d,b),this._afterImageUpdated(d)},g.prototype.updateImage=function(d,b){this.imageManager.updateImage(d,b)},g.prototype.getImage=function(d){return this.imageManager.getImage(d)},g.prototype.removeImage=function(d){if(!this.getImage(d))return this.fire(new M.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(d),this._afterImageUpdated(d)},g.prototype._afterImageUpdated=function(d){this._availableImages=this.imageManager.listImages(),this._changedImages[d]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new M.Event("data",{dataType:"style"}))},g.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},g.prototype.addSource=function(d,b,B){var G=this;if(B===void 0&&(B={}),this._checkLoaded(),this.sourceCaches[d]!==void 0)throw new Error("There is already a source with this ID");if(!b.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(b).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(b.type)>=0&&this._validate(M.validateStyle.source,"sources."+d,b,null,B))){this.map&&this.map._collectResourceTiming&&(b.collectResourceTiming=!0);var q=this.sourceCaches[d]=new Je(d,b,this.dispatcher);q.style=this,q.setEventedParent(this,function(){return{isSourceLoaded:G.loaded(),source:q.serialize(),sourceId:d}}),q.onAdd(this.map),this._changed=!0}},g.prototype.removeSource=function(d){if(this._checkLoaded(),this.sourceCaches[d]===void 0)throw new Error("There is no source with this ID");for(var b in this._layers)if(this._layers[b].source===d)return this.fire(new M.ErrorEvent(new Error('Source "'+d+'" cannot be removed while layer "'+b+'" is using it.')));var B=this.sourceCaches[d];delete this.sourceCaches[d],delete this._updatedSources[d],B.fire(new M.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:d})),B.setEventedParent(null),B.clearTiles(),B.onRemove&&B.onRemove(this.map),this._changed=!0},g.prototype.setGeoJSONSourceData=function(d,b){this._checkLoaded(),this.sourceCaches[d].getSource().setData(b),this._changed=!0},g.prototype.getSource=function(d){return this.sourceCaches[d]&&this.sourceCaches[d].getSource()},g.prototype.addLayer=function(d,b,B){B===void 0&&(B={}),this._checkLoaded();var G=d.id;if(this.getLayer(G))this.fire(new M.ErrorEvent(new Error('Layer with id "'+G+'" already exists on this map')));else{var q;if(d.type==="custom"){if(Ku(this,M.validateCustomStyleLayer(d)))return;q=M.createStyleLayer(d)}else{if(typeof d.source=="object"&&(this.addSource(G,d.source),d=M.clone$1(d),d=M.extend(d,{source:G})),this._validate(M.validateStyle.layer,"layers."+G,d,{arrayIndex:-1},B))return;q=M.createStyleLayer(d),this._validateLayer(q),q.setEventedParent(this,{layer:{id:G}}),this._serializedLayers[q.id]=q.serialize()}var te=b?this._order.indexOf(b):this._order.length;if(b&&te===-1)this.fire(new M.ErrorEvent(new Error('Layer with id "'+b+'" does not exist on this map.')));else{if(this._order.splice(te,0,G),this._layerOrderChanged=!0,this._layers[G]=q,this._removedLayers[G]&&q.source&&q.type!=="custom"){var fe=this._removedLayers[G];delete this._removedLayers[G],fe.type!==q.type?this._updatedSources[q.source]="clear":(this._updatedSources[q.source]="reload",this.sourceCaches[q.source].pause())}this._updateLayer(q),q.onAdd&&q.onAdd(this.map)}}},g.prototype.moveLayer=function(d,b){if(this._checkLoaded(),this._changed=!0,this._layers[d]){if(d!==b){var B=this._order.indexOf(d);this._order.splice(B,1);var G=b?this._order.indexOf(b):this._order.length;b&&G===-1?this.fire(new M.ErrorEvent(new Error('Layer with id "'+b+'" does not exist on this map.'))):(this._order.splice(G,0,d),this._layerOrderChanged=!0)}}else this.fire(new M.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be moved.")))},g.prototype.removeLayer=function(d){this._checkLoaded();var b=this._layers[d];if(b){b.setEventedParent(null);var B=this._order.indexOf(d);this._order.splice(B,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[d]=b,delete this._layers[d],delete this._serializedLayers[d],delete this._updatedLayers[d],delete this._updatedPaintProps[d],b.onRemove&&b.onRemove(this.map)}else this.fire(new M.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be removed.")))},g.prototype.getLayer=function(d){return this._layers[d]},g.prototype.hasLayer=function(d){return d in this._layers},g.prototype.setLayerZoomRange=function(d,b,B){this._checkLoaded();var G=this.getLayer(d);G?G.minzoom===b&&G.maxzoom===B||(b!=null&&(G.minzoom=b),B!=null&&(G.maxzoom=B),this._updateLayer(G)):this.fire(new M.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot have zoom extent.")))},g.prototype.setFilter=function(d,b,B){B===void 0&&(B={}),this._checkLoaded();var G=this.getLayer(d);if(G){if(!M.deepEqual(G.filter,b))return b==null?(G.filter=void 0,void this._updateLayer(G)):void(this._validate(M.validateStyle.filter,"layers."+G.id+".filter",b,null,B)||(G.filter=M.clone$1(b),this._updateLayer(G)))}else this.fire(new M.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be filtered.")))},g.prototype.getFilter=function(d){return M.clone$1(this.getLayer(d).filter)},g.prototype.setLayoutProperty=function(d,b,B,G){G===void 0&&(G={}),this._checkLoaded();var q=this.getLayer(d);q?M.deepEqual(q.getLayoutProperty(b),B)||(q.setLayoutProperty(b,B,G),this._updateLayer(q)):this.fire(new M.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be styled.")))},g.prototype.getLayoutProperty=function(d,b){var B=this.getLayer(d);if(B)return B.getLayoutProperty(b);this.fire(new M.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style.")))},g.prototype.setPaintProperty=function(d,b,B,G){G===void 0&&(G={}),this._checkLoaded();var q=this.getLayer(d);q?M.deepEqual(q.getPaintProperty(b),B)||(q.setPaintProperty(b,B,G)&&this._updateLayer(q),this._changed=!0,this._updatedPaintProps[d]=!0):this.fire(new M.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be styled.")))},g.prototype.getPaintProperty=function(d,b){return this.getLayer(d).getPaintProperty(b)},g.prototype.setFeatureState=function(d,b){this._checkLoaded();var B=d.source,G=d.sourceLayer,q=this.sourceCaches[B];if(q!==void 0){var te=q.getSource().type;te==="geojson"&&G?this.fire(new M.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):te!=="vector"||G?(d.id===void 0&&this.fire(new M.ErrorEvent(new Error("The feature id parameter must be provided."))),q.setFeatureState(G,d.id,b)):this.fire(new M.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new M.ErrorEvent(new Error("The source '"+B+"' does not exist in the map's style.")))},g.prototype.removeFeatureState=function(d,b){this._checkLoaded();var B=d.source,G=this.sourceCaches[B];if(G!==void 0){var q=G.getSource().type,te=q==="vector"?d.sourceLayer:void 0;q!=="vector"||te?b&&typeof d.id!="string"&&typeof d.id!="number"?this.fire(new M.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):G.removeFeatureState(te,d.id,b):this.fire(new M.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new M.ErrorEvent(new Error("The source '"+B+"' does not exist in the map's style.")))},g.prototype.getFeatureState=function(d){this._checkLoaded();var b=d.source,B=d.sourceLayer,G=this.sourceCaches[b];if(G!==void 0){if(G.getSource().type!=="vector"||B)return d.id===void 0&&this.fire(new M.ErrorEvent(new Error("The feature id parameter must be provided."))),G.getFeatureState(B,d.id);this.fire(new M.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new M.ErrorEvent(new Error("The source '"+b+"' does not exist in the map's style.")))},g.prototype.getTransition=function(){return M.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},g.prototype.serialize=function(){return M.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:M.mapObject(this.sourceCaches,function(d){return d.serialize()}),layers:this._serializeLayers(this._order)},function(d){return d!==void 0})},g.prototype._updateLayer=function(d){this._updatedLayers[d.id]=!0,d.source&&!this._updatedSources[d.source]&&this.sourceCaches[d.source].getSource().type!=="raster"&&(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause()),this._changed=!0},g.prototype._flattenAndSortRenderedFeatures=function(d){for(var b=this,B=function(sn){return b._layers[sn].type==="fill-extrusion"},G={},q=[],te=this._order.length-1;te>=0;te--){var fe=this._order[te];if(B(fe)){G[fe]=te;for(var ce=0,Te=d;ce<Te.length;ce+=1){var Ie=Te[ce][fe];if(Ie)for(var Oe=0,Qe=Ie;Oe<Qe.length;Oe+=1)q.push(Qe[Oe])}}}q.sort(function(sn,nn){return nn.intersectionZ-sn.intersectionZ});for(var nt=[],ct=this._order.length-1;ct>=0;ct--){var tt=this._order[ct];if(B(tt))for(var Tt=q.length-1;Tt>=0;Tt--){var Ut=q[Tt].feature;if(G[Ut.layer.id]<ct)break;nt.push(Ut),q.pop()}else for(var Nt=0,pr=d;Nt<pr.length;Nt+=1){var tr=pr[Nt][tt];if(tr)for(var Dr=0,Hr=tr;Dr<Hr.length;Dr+=1)nt.push(Hr[Dr].feature)}}return nt},g.prototype.queryRenderedFeatures=function(d,b,B){b&&b.filter&&this._validate(M.validateStyle.filter,"queryRenderedFeatures.filter",b.filter,null,b);var G={};if(b&&b.layers){if(!Array.isArray(b.layers))return this.fire(new M.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var q=0,te=b.layers;q<te.length;q+=1){var fe=te[q],ce=this._layers[fe];if(!ce)return this.fire(new M.ErrorEvent(new Error("The layer '"+fe+"' does not exist in the map's style and cannot be queried for features."))),[];G[ce.source]=!0}}var Te=[];for(var Ie in b.availableImages=this._availableImages,this.sourceCaches)b.layers&&!G[Ie]||Te.push(li(this.sourceCaches[Ie],this._layers,this._serializedLayers,d,b,B));return this.placement&&Te.push(function(Oe,Qe,nt,ct,tt,Tt,Ut){for(var Nt={},pr=Tt.queryRenderedSymbols(ct),tr=[],Dr=0,Hr=Object.keys(pr).map(Number);Dr<Hr.length;Dr+=1)tr.push(Ut[Hr[Dr]]);tr.sort(Uo);for(var sn=function(){var Ui=Gn[nn],ho=Ui.featureIndex.lookupSymbolFeatures(pr[Ui.bucketInstanceId],Qe,Ui.bucketIndex,Ui.sourceLayerIndex,tt.filter,tt.layers,tt.availableImages,Oe);for(var gi in ho){var Wi=Nt[gi]=Nt[gi]||[],Ko=ho[gi];Ko.sort(function(ko,xo){var qi=Ui.featureSortOrder;if(qi){var xs=qi.indexOf(ko.featureIndex);return qi.indexOf(xo.featureIndex)-xs}return xo.featureIndex-ko.featureIndex});for(var Mo=0,mo=Ko;Mo<mo.length;Mo+=1)Wi.push(mo[Mo])}},nn=0,Gn=tr;nn<Gn.length;nn+=1)sn();var di=function(Ui){Nt[Ui].forEach(function(ho){var gi=ho.feature,Wi=nt[Oe[Ui].source].getFeatureState(gi.layer["source-layer"],gi.id);gi.source=gi.layer.source,gi.layer["source-layer"]&&(gi.sourceLayer=gi.layer["source-layer"]),gi.state=Wi})};for(var Di in Nt)di(Di);return Nt}(this._layers,this._serializedLayers,this.sourceCaches,d,b,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Te)},g.prototype.querySourceFeatures=function(d,b){b&&b.filter&&this._validate(M.validateStyle.filter,"querySourceFeatures.filter",b.filter,null,b);var B=this.sourceCaches[d];return B?function(G,q){for(var te=G.getRenderableIds().map(function(Qe){return G.getTileByID(Qe)}),fe=[],ce={},Te=0;Te<te.length;Te++){var Ie=te[Te],Oe=Ie.tileID.canonical.key;ce[Oe]||(ce[Oe]=!0,Ie.querySourceFeatures(fe,q))}return fe}(B,b):[]},g.prototype.addSourceType=function(d,b,B){return g.getSourceType(d)?B(new Error('A source type called "'+d+'" already exists.')):(g.setSourceType(d,b),b.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:d,url:b.workerSourceURL},B):B(null,null))},g.prototype.getLight=function(){return this.light.getLight()},g.prototype.setLight=function(d,b){b===void 0&&(b={}),this._checkLoaded();var B=this.light.getLight(),G=!1;for(var q in d)if(!M.deepEqual(d[q],B[q])){G=!0;break}if(G){var te={now:M.browser.now(),transition:M.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(d,b),this.light.updateTransitions(te)}},g.prototype._validate=function(d,b,B,G,q){return q===void 0&&(q={}),(!q||q.validate!==!1)&&Ku(this,d.call(M.validateStyle,M.extend({key:b,style:this.serialize(),value:B,styleSpec:M.styleSpec},G)))},g.prototype._remove=function(){for(var d in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),M.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[d].setEventedParent(null);for(var b in this.sourceCaches)this.sourceCaches[b].clearTiles(),this.sourceCaches[b].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},g.prototype._clearSource=function(d){this.sourceCaches[d].clearTiles()},g.prototype._reloadSource=function(d){this.sourceCaches[d].resume(),this.sourceCaches[d].reload()},g.prototype._updateSources=function(d){for(var b in this.sourceCaches)this.sourceCaches[b].update(d)},g.prototype._generateCollisionBoxes=function(){for(var d in this.sourceCaches)this._reloadSource(d)},g.prototype._updatePlacement=function(d,b,B,G,q){q===void 0&&(q=!1);for(var te=!1,fe=!1,ce={},Te=0,Ie=this._order;Te<Ie.length;Te+=1){var Oe=this._layers[Ie[Te]];if(Oe.type==="symbol"){if(!ce[Oe.source]){var Qe=this.sourceCaches[Oe.source];ce[Oe.source]=Qe.getRenderableIds(!0).map(function(Ut){return Qe.getTileByID(Ut)}).sort(function(Ut,Nt){return Nt.tileID.overscaledZ-Ut.tileID.overscaledZ||(Ut.tileID.isLessThan(Nt.tileID)?-1:1)})}var nt=this.crossTileSymbolIndex.addLayer(Oe,ce[Oe.source],d.center.lng);te=te||nt}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((q=q||this._layerOrderChanged||B===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(M.browser.now(),d.zoom))&&(this.pauseablePlacement=new Xh(d,this._order,q,b,B,G,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,ce),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(M.browser.now()),fe=!0),te&&this.pauseablePlacement.placement.setStale()),fe||te)for(var ct=0,tt=this._order;ct<tt.length;ct+=1){var Tt=this._layers[tt[ct]];Tt.type==="symbol"&&this.placement.updateLayerOpacities(Tt,ce[Tt.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(M.browser.now())},g.prototype._releaseSymbolFadeTiles=function(){for(var d in this.sourceCaches)this.sourceCaches[d].releaseSymbolFadeTiles()},g.prototype.getImages=function(d,b,B){this.imageManager.getImages(b.icons,B),this._updateTilesForChangedImages();var G=this.sourceCaches[b.source];G&&G.setDependencies(b.tileID.key,b.type,b.icons)},g.prototype.getGlyphs=function(d,b,B){this.glyphManager.getGlyphs(b.stacks,B)},g.prototype.getResource=function(d,b,B){return M.makeRequest(b,B)},g}(M.Evented);Nl.getSourceType=function(h){return an[h]},Nl.setSourceType=function(h,g){an[h]=g},Nl.registerForPluginStateChange=M.registerForPluginStateChange;var Io=M.createLayout([{name:"a_pos",type:"Int16",components:2}]),eu=Ps(`#ifdef GL_ES
precision mediump float;
#else
#if !defined(lowp)
#define lowp
#endif
#if !defined(mediump)
#define mediump
#endif
#if !defined(highp)
#define highp
#endif
#endif`,`#ifdef GL_ES
precision highp float;
#else
#if !defined(lowp)
#define lowp
#endif
#if !defined(mediump)
#define mediump
#endif
#if !defined(highp)
#define highp
#endif
#endif
vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}`),Tl=Ps(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Fu=Ps(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),Ju=Ps(`varying vec3 v_data;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define mediump float radius
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define highp vec4 stroke_color
#pragma mapbox: define mediump float stroke_width
#pragma mapbox: define lowp float stroke_opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize mediump float radius
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize highp vec4 stroke_color
#pragma mapbox: initialize mediump float stroke_width
#pragma mapbox: initialize lowp float stroke_opacity
vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define mediump float radius
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define highp vec4 stroke_color
#pragma mapbox: define mediump float stroke_width
#pragma mapbox: define lowp float stroke_opacity
void main(void) {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize mediump float radius
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize highp vec4 stroke_color
#pragma mapbox: initialize mediump float stroke_width
#pragma mapbox: initialize lowp float stroke_opacity
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),al=Ps("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Kc=Ps(`uniform highp float u_intensity;varying vec2 v_extrude;
#pragma mapbox: define highp float weight
#define GAUSS_COEF 0.3989422804014327
void main() {
#pragma mapbox: initialize highp float weight
float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;
#pragma mapbox: define highp float weight
#pragma mapbox: define mediump float radius
const highp float ZERO=1.0/255.0/16.0;
#define GAUSS_COEF 0.3989422804014327
void main(void) {
#pragma mapbox: initialize highp float weight
#pragma mapbox: initialize mediump float radius
vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),ou=Ps(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(0.0);
#endif
}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),Ks=Ps("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Lp=Ps("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),gf=Ps("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),Of=Ps(`#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float opacity
gl_FragColor=color*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float opacity
gl_Position=u_matrix*vec4(a_pos,0,1);}`),qh=Ps(`varying vec2 v_pos;
#pragma mapbox: define highp vec4 outline_color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 outline_color
#pragma mapbox: initialize lowp float opacity
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
#pragma mapbox: define highp vec4 outline_color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 outline_color
#pragma mapbox: initialize lowp float opacity
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),zc=Ps(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),Oh=Ps(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),Ms=Ps(`varying vec4 v_color;void main() {gl_FragColor=v_color;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;
#pragma mapbox: define highp float base
#pragma mapbox: define highp float height
#pragma mapbox: define highp vec4 color
void main() {
#pragma mapbox: initialize highp float base
#pragma mapbox: initialize highp float height
#pragma mapbox: initialize highp vec4 color
vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),Jc=Ps(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
#pragma mapbox: define lowp float base
#pragma mapbox: define lowp float height
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float base
#pragma mapbox: initialize lowp float height
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
#pragma mapbox: define lowp float base
#pragma mapbox: define lowp float height
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float base
#pragma mapbox: initialize lowp float height
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
? a_pos
: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),Yh=Ps(`#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),Qc=Ps(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
#define PI 3.141592653589793
void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),uc=Ps(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float width
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float width
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),eh=Ps(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float width
void main() {
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float width
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),yh=Ps(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
#define LINE_DISTANCE_SCALE 2.0
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define mediump float width
#pragma mapbox: define lowp float floorwidth
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize mediump float width
#pragma mapbox: initialize lowp float floorwidth
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),sl=Ps(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float width
#pragma mapbox: define lowp float floorwidth
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float width
#pragma mapbox: initialize lowp float floorwidth
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
#define LINE_DISTANCE_SCALE 2.0
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float width
#pragma mapbox: define lowp float floorwidth
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float width
#pragma mapbox: initialize lowp float floorwidth
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),Uc=Ps(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),bc=Ps(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float opacity
lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float opacity
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`),fp=Ps(`#define SDF_PX 8.0
uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),dp=Ps(`#define SDF_PX 8.0
#define SDF 1.0
#define ICON 0.0
uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`);function Ps(h,g){var d=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,b=g.match(/attribute ([\w]+) ([\w]+)/g),B=h.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),G=g.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),q=G?G.concat(B):B,te={};return{fragmentSource:h=h.replace(d,function(fe,ce,Te,Ie,Oe){return te[Oe]=!0,ce==="define"?`
#ifndef HAS_UNIFORM_u_`+Oe+`
varying `+Te+" "+Ie+" "+Oe+`;
#else
uniform `+Te+" "+Ie+" u_"+Oe+`;
#endif
`:`
#ifdef HAS_UNIFORM_u_`+Oe+`
`+Te+" "+Ie+" "+Oe+" = u_"+Oe+`;
#endif
`}),vertexSource:g=g.replace(d,function(fe,ce,Te,Ie,Oe){var Qe=Ie==="float"?"vec2":"vec4",nt=Oe.match(/color/)?"color":Qe;return te[Oe]?ce==="define"?`
#ifndef HAS_UNIFORM_u_`+Oe+`
uniform lowp float u_`+Oe+`_t;
attribute `+Te+" "+Qe+" a_"+Oe+`;
varying `+Te+" "+Ie+" "+Oe+`;
#else
uniform `+Te+" "+Ie+" u_"+Oe+`;
#endif
`:nt==="vec4"?`
#ifndef HAS_UNIFORM_u_`+Oe+`
`+Oe+" = a_"+Oe+`;
#else
`+Te+" "+Ie+" "+Oe+" = u_"+Oe+`;
#endif
`:`
#ifndef HAS_UNIFORM_u_`+Oe+`
`+Oe+" = unpack_mix_"+nt+"(a_"+Oe+", u_"+Oe+`_t);
#else
`+Te+" "+Ie+" "+Oe+" = u_"+Oe+`;
#endif
`:ce==="define"?`
#ifndef HAS_UNIFORM_u_`+Oe+`
uniform lowp float u_`+Oe+`_t;
attribute `+Te+" "+Qe+" a_"+Oe+`;
#else
uniform `+Te+" "+Ie+" u_"+Oe+`;
#endif
`:nt==="vec4"?`
#ifndef HAS_UNIFORM_u_`+Oe+`
`+Te+" "+Ie+" "+Oe+" = a_"+Oe+`;
#else
`+Te+" "+Ie+" "+Oe+" = u_"+Oe+`;
#endif
`:`
#ifndef HAS_UNIFORM_u_`+Oe+`
`+Te+" "+Ie+" "+Oe+" = unpack_mix_"+nt+"(a_"+Oe+", u_"+Oe+`_t);
#else
`+Te+" "+Ie+" "+Oe+" = u_"+Oe+`;
#endif
`}),staticAttributes:b,staticUniforms:q}}var Gf=Object.freeze({__proto__:null,prelude:eu,background:Tl,backgroundPattern:Fu,circle:Ju,clippingMask:al,heatmap:Kc,heatmapTexture:ou,collisionBox:Ks,collisionCircle:Lp,debug:gf,fill:Of,fillOutline:qh,fillOutlinePattern:zc,fillPattern:Oh,fillExtrusion:Ms,fillExtrusionPattern:Jc,hillshadePrepare:Yh,hillshade:Qc,line:uc,lineGradient:eh,linePattern:yh,lineSDF:sl,raster:Uc,symbolIcon:bc,symbolSDF:fp,symbolTextAndIcon:dp}),Xp=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function cc(h){for(var g=[],d=0;d<h.length;d++)if(h[d]!==null){var b=h[d].split(" ");g.push(b.pop())}return g}Xp.prototype.bind=function(h,g,d,b,B,G,q,te){this.context=h;for(var fe=this.boundPaintVertexBuffers.length!==b.length,ce=0;!fe&&ce<b.length;ce++)this.boundPaintVertexBuffers[ce]!==b[ce]&&(fe=!0);h.extVertexArrayObject&&this.vao&&this.boundProgram===g&&this.boundLayoutVertexBuffer===d&&!fe&&this.boundIndexBuffer===B&&this.boundVertexOffset===G&&this.boundDynamicVertexBuffer===q&&this.boundDynamicVertexBuffer2===te?(h.bindVertexArrayOES.set(this.vao),q&&q.bind(),B&&B.dynamicDraw&&B.bind(),te&&te.bind()):this.freshBind(g,d,b,B,G,q,te)},Xp.prototype.freshBind=function(h,g,d,b,B,G,q){var te,fe=h.numAttributes,ce=this.context,Te=ce.gl;if(ce.extVertexArrayObject)this.vao&&this.destroy(),this.vao=ce.extVertexArrayObject.createVertexArrayOES(),ce.bindVertexArrayOES.set(this.vao),te=0,this.boundProgram=h,this.boundLayoutVertexBuffer=g,this.boundPaintVertexBuffers=d,this.boundIndexBuffer=b,this.boundVertexOffset=B,this.boundDynamicVertexBuffer=G,this.boundDynamicVertexBuffer2=q;else{te=ce.currentNumAttributes||0;for(var Ie=fe;Ie<te;Ie++)Te.disableVertexAttribArray(Ie)}g.enableAttributes(Te,h);for(var Oe=0,Qe=d;Oe<Qe.length;Oe+=1)Qe[Oe].enableAttributes(Te,h);G&&G.enableAttributes(Te,h),q&&q.enableAttributes(Te,h),g.bind(),g.setVertexAttribPointers(Te,h,B);for(var nt=0,ct=d;nt<ct.length;nt+=1){var tt=ct[nt];tt.bind(),tt.setVertexAttribPointers(Te,h,B)}G&&(G.bind(),G.setVertexAttribPointers(Te,h,B)),b&&b.bind(),q&&(q.bind(),q.setVertexAttribPointers(Te,h,B)),ce.currentNumAttributes=fe},Xp.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var zl=function(h,g,d,b,B,G){var q=h.gl;this.program=q.createProgram();for(var te=cc(d.staticAttributes),fe=b?b.getBinderAttributes():[],ce=te.concat(fe),Te=d.staticUniforms?cc(d.staticUniforms):[],Ie=b?b.getBinderUniforms():[],Oe=[],Qe=0,nt=Te.concat(Ie);Qe<nt.length;Qe+=1){var ct=nt[Qe];Oe.indexOf(ct)<0&&Oe.push(ct)}var tt=b?b.defines():[];G&&tt.push("#define OVERDRAW_INSPECTOR;");var Tt=tt.concat(eu.fragmentSource,d.fragmentSource).join(`
`),Ut=tt.concat(eu.vertexSource,d.vertexSource).join(`
`),Nt=q.createShader(q.FRAGMENT_SHADER);if(q.isContextLost())this.failedToCreate=!0;else{q.shaderSource(Nt,Tt),q.compileShader(Nt),q.attachShader(this.program,Nt);var pr=q.createShader(q.VERTEX_SHADER);if(q.isContextLost())this.failedToCreate=!0;else{q.shaderSource(pr,Ut),q.compileShader(pr),q.attachShader(this.program,pr),this.attributes={};var tr={};this.numAttributes=ce.length;for(var Dr=0;Dr<this.numAttributes;Dr++)ce[Dr]&&(q.bindAttribLocation(this.program,Dr,ce[Dr]),this.attributes[ce[Dr]]=Dr);q.linkProgram(this.program),q.deleteShader(pr),q.deleteShader(Nt);for(var Hr=0;Hr<Oe.length;Hr++){var sn=Oe[Hr];if(sn&&!tr[sn]){var nn=q.getUniformLocation(this.program,sn);nn&&(tr[sn]=nn)}}this.fixedUniforms=B(h,tr),this.binderUniforms=b?b.getUniforms(h,tr):[]}}};function Ec(h,g,d){var b=1/Wa(d,1,g.transform.tileZoom),B=Math.pow(2,d.tileID.overscaledZ),G=d.tileSize*Math.pow(2,g.transform.tileZoom)/B,q=G*(d.tileID.canonical.x+d.tileID.wrap*B),te=G*d.tileID.canonical.y;return{u_image:0,u_texsize:d.imageAtlasTexture.size,u_scale:[b,h.fromScale,h.toScale],u_fade:h.t,u_pixel_coord_upper:[q>>16,te>>16],u_pixel_coord_lower:[65535&q,65535&te]}}zl.prototype.draw=function(h,g,d,b,B,G,q,te,fe,ce,Te,Ie,Oe,Qe,nt,ct){var tt,Tt=h.gl;if(!this.failedToCreate){for(var Ut in h.program.set(this.program),h.setDepthMode(d),h.setStencilMode(b),h.setColorMode(B),h.setCullFace(G),this.fixedUniforms)this.fixedUniforms[Ut].set(q[Ut]);Qe&&Qe.setUniforms(h,this.binderUniforms,Ie,{zoom:Oe});for(var Nt=(tt={},tt[Tt.LINES]=2,tt[Tt.TRIANGLES]=3,tt[Tt.LINE_STRIP]=1,tt)[g],pr=0,tr=Te.get();pr<tr.length;pr+=1){var Dr=tr[pr],Hr=Dr.vaos||(Dr.vaos={});(Hr[te]||(Hr[te]=new Xp)).bind(h,this,fe,Qe?Qe.getPaintVertexBuffers():[],ce,Dr.vertexOffset,nt,ct),Tt.drawElements(g,Dr.primitiveLength*Nt,Tt.UNSIGNED_SHORT,Dr.primitiveOffset*Nt*2)}}};var th=function(h,g,d,b){var B=g.style.light,G=B.properties.get("position"),q=[G.x,G.y,G.z],te=M.create$1();B.properties.get("anchor")==="viewport"&&M.fromRotation(te,-g.transform.angle),M.transformMat3(q,q,te);var fe=B.properties.get("color");return{u_matrix:h,u_lightpos:q,u_lightintensity:B.properties.get("intensity"),u_lightcolor:[fe.r,fe.g,fe.b],u_vertical_gradient:+d,u_opacity:b}},vu=function(h,g,d,b,B,G,q){return M.extend(th(h,g,d,b),Ec(G,g,q),{u_height_factor:-Math.pow(2,B.overscaledZ)/q.tileSize/8})},xh=function(h){return{u_matrix:h}},qa=function(h,g,d,b){return M.extend(xh(h),Ec(d,g,b))},Hs=function(h,g){return{u_matrix:h,u_world:g}},Ep=function(h,g,d,b,B){return M.extend(qa(h,g,d,b),{u_world:B})},Na=function(h,g,d,b){var B,G,q=h.transform;if(b.paint.get("circle-pitch-alignment")==="map"){var te=Wa(d,1,q.zoom);B=!0,G=[te,te]}else B=!1,G=q.pixelsToGLUnits;return{u_camera_to_center_distance:q.cameraToCenterDistance,u_scale_with_map:+(b.paint.get("circle-pitch-scale")==="map"),u_matrix:h.translatePosMatrix(g.posMatrix,d,b.paint.get("circle-translate"),b.paint.get("circle-translate-anchor")),u_pitch_with_map:+B,u_device_pixel_ratio:M.browser.devicePixelRatio,u_extrude_scale:G}},Qu=function(h,g,d){var b=Wa(d,1,g.zoom),B=Math.pow(2,g.zoom-d.tileID.overscaledZ),G=d.tileID.overscaleFactor();return{u_matrix:h,u_camera_to_center_distance:g.cameraToCenterDistance,u_pixels_to_tile_units:b,u_extrude_scale:[g.pixelsToGLUnits[0]/(b*B),g.pixelsToGLUnits[1]/(b*B)],u_overscale_factor:G}},Is=function(h,g,d){return{u_matrix:h,u_inv_matrix:g,u_camera_to_center_distance:d.cameraToCenterDistance,u_viewport_size:[d.width,d.height]}},ys=function(h,g,d){return d===void 0&&(d=1),{u_matrix:h,u_color:g,u_overlay:0,u_overlay_scale:d}},ec=function(h){return{u_matrix:h}},Bf=function(h,g,d,b){return{u_matrix:h,u_extrude_scale:Wa(g,1,d),u_intensity:b}},es=function(h,g,d){var b=h.transform;return{u_matrix:$h(h,g,d),u_ratio:1/Wa(g,1,b.zoom),u_device_pixel_ratio:M.browser.devicePixelRatio,u_units_to_pixels:[1/b.pixelsToGLUnits[0],1/b.pixelsToGLUnits[1]]}},Bs=function(h,g,d,b){return M.extend(es(h,g,d),{u_image:0,u_image_height:b})},wc=function(h,g,d,b){var B=h.transform,G=Sc(g,B);return{u_matrix:$h(h,g,d),u_texsize:g.imageAtlasTexture.size,u_ratio:1/Wa(g,1,B.zoom),u_device_pixel_ratio:M.browser.devicePixelRatio,u_image:0,u_scale:[G,b.fromScale,b.toScale],u_fade:b.t,u_units_to_pixels:[1/B.pixelsToGLUnits[0],1/B.pixelsToGLUnits[1]]}},qp=function(h,g,d,b,B){var G=h.lineAtlas,q=Sc(g,h.transform),te=d.layout.get("line-cap")==="round",fe=G.getDash(b.from,te),ce=G.getDash(b.to,te),Te=fe.width*B.fromScale,Ie=ce.width*B.toScale;return M.extend(es(h,g,d),{u_patternscale_a:[q/Te,-fe.height/2],u_patternscale_b:[q/Ie,-ce.height/2],u_sdfgamma:G.width/(256*Math.min(Te,Ie)*M.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:fe.y,u_tex_y_b:ce.y,u_mix:B.t})};function Sc(h,g){return 1/Wa(h,1,g.tileZoom)}function $h(h,g,d){return h.translatePosMatrix(g.tileID.posMatrix,g,d.paint.get("line-translate"),d.paint.get("line-translate-anchor"))}var Xo=function(h,g,d,b,B){return{u_matrix:h,u_tl_parent:g,u_scale_parent:d,u_buffer_scale:1,u_fade_t:b.mix,u_opacity:b.opacity*B.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:B.paint.get("raster-brightness-min"),u_brightness_high:B.paint.get("raster-brightness-max"),u_saturation_factor:(q=B.paint.get("raster-saturation"),q>0?1-1/(1.001-q):-q),u_contrast_factor:(G=B.paint.get("raster-contrast"),G>0?1/(1-G):1+G),u_spin_weights:au(B.paint.get("raster-hue-rotate"))};var G,q};function au(h){h*=Math.PI/180;var g=Math.sin(h),d=Math.cos(h);return[(2*d+1)/3,(-Math.sqrt(3)*g-d+1)/3,(Math.sqrt(3)*g-d+1)/3]}var dl,tc=function(h,g,d,b,B,G,q,te,fe,ce){var Te=B.transform;return{u_is_size_zoom_constant:+(h==="constant"||h==="source"),u_is_size_feature_constant:+(h==="constant"||h==="camera"),u_size_t:g?g.uSizeT:0,u_size:g?g.uSize:0,u_camera_to_center_distance:Te.cameraToCenterDistance,u_pitch:Te.pitch/360*2*Math.PI,u_rotate_symbol:+d,u_aspect_ratio:Te.width/Te.height,u_fade_change:B.options.fadeDuration?B.symbolFadeChange:1,u_matrix:G,u_label_plane_matrix:q,u_coord_matrix:te,u_is_text:+fe,u_pitch_with_map:+b,u_texsize:ce,u_texture:0}},bh=function(h,g,d,b,B,G,q,te,fe,ce,Te){var Ie=B.transform;return M.extend(tc(h,g,d,b,B,G,q,te,fe,ce),{u_gamma_scale:b?Math.cos(Ie._pitch)*Ie.cameraToCenterDistance:1,u_device_pixel_ratio:M.browser.devicePixelRatio,u_is_halo:+Te})},mp=function(h,g,d,b,B,G,q,te,fe,ce){return M.extend(bh(h,g,d,b,B,G,q,te,!0,fe,!0),{u_texsize_icon:ce,u_texture_icon:1})},Kh=function(h,g,d){return{u_matrix:h,u_opacity:g,u_color:d}},Zc=function(h,g,d,b,B,G){return M.extend(function(q,te,fe,ce){var Te=fe.imageManager.getPattern(q.from.toString()),Ie=fe.imageManager.getPattern(q.to.toString()),Oe=fe.imageManager.getPixelSize(),Qe=Oe.width,nt=Oe.height,ct=Math.pow(2,ce.tileID.overscaledZ),tt=ce.tileSize*Math.pow(2,fe.transform.tileZoom)/ct,Tt=tt*(ce.tileID.canonical.x+ce.tileID.wrap*ct),Ut=tt*ce.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Te.tl,u_pattern_br_a:Te.br,u_pattern_tl_b:Ie.tl,u_pattern_br_b:Ie.br,u_texsize:[Qe,nt],u_mix:te.t,u_pattern_size_a:Te.displaySize,u_pattern_size_b:Ie.displaySize,u_scale_a:te.fromScale,u_scale_b:te.toScale,u_tile_units_to_pixels:1/Wa(ce,1,fe.transform.tileZoom),u_pixel_coord_upper:[Tt>>16,Ut>>16],u_pixel_coord_lower:[65535&Tt,65535&Ut]}}(b,G,d,B),{u_matrix:h,u_opacity:g})},vf={fillExtrusion:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_lightpos:new M.Uniform3f(h,g.u_lightpos),u_lightintensity:new M.Uniform1f(h,g.u_lightintensity),u_lightcolor:new M.Uniform3f(h,g.u_lightcolor),u_vertical_gradient:new M.Uniform1f(h,g.u_vertical_gradient),u_opacity:new M.Uniform1f(h,g.u_opacity)}},fillExtrusionPattern:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_lightpos:new M.Uniform3f(h,g.u_lightpos),u_lightintensity:new M.Uniform1f(h,g.u_lightintensity),u_lightcolor:new M.Uniform3f(h,g.u_lightcolor),u_vertical_gradient:new M.Uniform1f(h,g.u_vertical_gradient),u_height_factor:new M.Uniform1f(h,g.u_height_factor),u_image:new M.Uniform1i(h,g.u_image),u_texsize:new M.Uniform2f(h,g.u_texsize),u_pixel_coord_upper:new M.Uniform2f(h,g.u_pixel_coord_upper),u_pixel_coord_lower:new M.Uniform2f(h,g.u_pixel_coord_lower),u_scale:new M.Uniform3f(h,g.u_scale),u_fade:new M.Uniform1f(h,g.u_fade),u_opacity:new M.Uniform1f(h,g.u_opacity)}},fill:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix)}},fillPattern:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_image:new M.Uniform1i(h,g.u_image),u_texsize:new M.Uniform2f(h,g.u_texsize),u_pixel_coord_upper:new M.Uniform2f(h,g.u_pixel_coord_upper),u_pixel_coord_lower:new M.Uniform2f(h,g.u_pixel_coord_lower),u_scale:new M.Uniform3f(h,g.u_scale),u_fade:new M.Uniform1f(h,g.u_fade)}},fillOutline:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_world:new M.Uniform2f(h,g.u_world)}},fillOutlinePattern:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_world:new M.Uniform2f(h,g.u_world),u_image:new M.Uniform1i(h,g.u_image),u_texsize:new M.Uniform2f(h,g.u_texsize),u_pixel_coord_upper:new M.Uniform2f(h,g.u_pixel_coord_upper),u_pixel_coord_lower:new M.Uniform2f(h,g.u_pixel_coord_lower),u_scale:new M.Uniform3f(h,g.u_scale),u_fade:new M.Uniform1f(h,g.u_fade)}},circle:function(h,g){return{u_camera_to_center_distance:new M.Uniform1f(h,g.u_camera_to_center_distance),u_scale_with_map:new M.Uniform1i(h,g.u_scale_with_map),u_pitch_with_map:new M.Uniform1i(h,g.u_pitch_with_map),u_extrude_scale:new M.Uniform2f(h,g.u_extrude_scale),u_device_pixel_ratio:new M.Uniform1f(h,g.u_device_pixel_ratio),u_matrix:new M.UniformMatrix4f(h,g.u_matrix)}},collisionBox:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_camera_to_center_distance:new M.Uniform1f(h,g.u_camera_to_center_distance),u_pixels_to_tile_units:new M.Uniform1f(h,g.u_pixels_to_tile_units),u_extrude_scale:new M.Uniform2f(h,g.u_extrude_scale),u_overscale_factor:new M.Uniform1f(h,g.u_overscale_factor)}},collisionCircle:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_inv_matrix:new M.UniformMatrix4f(h,g.u_inv_matrix),u_camera_to_center_distance:new M.Uniform1f(h,g.u_camera_to_center_distance),u_viewport_size:new M.Uniform2f(h,g.u_viewport_size)}},debug:function(h,g){return{u_color:new M.UniformColor(h,g.u_color),u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_overlay:new M.Uniform1i(h,g.u_overlay),u_overlay_scale:new M.Uniform1f(h,g.u_overlay_scale)}},clippingMask:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix)}},heatmap:function(h,g){return{u_extrude_scale:new M.Uniform1f(h,g.u_extrude_scale),u_intensity:new M.Uniform1f(h,g.u_intensity),u_matrix:new M.UniformMatrix4f(h,g.u_matrix)}},heatmapTexture:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_world:new M.Uniform2f(h,g.u_world),u_image:new M.Uniform1i(h,g.u_image),u_color_ramp:new M.Uniform1i(h,g.u_color_ramp),u_opacity:new M.Uniform1f(h,g.u_opacity)}},hillshade:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_image:new M.Uniform1i(h,g.u_image),u_latrange:new M.Uniform2f(h,g.u_latrange),u_light:new M.Uniform2f(h,g.u_light),u_shadow:new M.UniformColor(h,g.u_shadow),u_highlight:new M.UniformColor(h,g.u_highlight),u_accent:new M.UniformColor(h,g.u_accent)}},hillshadePrepare:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_image:new M.Uniform1i(h,g.u_image),u_dimension:new M.Uniform2f(h,g.u_dimension),u_zoom:new M.Uniform1f(h,g.u_zoom),u_unpack:new M.Uniform4f(h,g.u_unpack)}},line:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_ratio:new M.Uniform1f(h,g.u_ratio),u_device_pixel_ratio:new M.Uniform1f(h,g.u_device_pixel_ratio),u_units_to_pixels:new M.Uniform2f(h,g.u_units_to_pixels)}},lineGradient:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_ratio:new M.Uniform1f(h,g.u_ratio),u_device_pixel_ratio:new M.Uniform1f(h,g.u_device_pixel_ratio),u_units_to_pixels:new M.Uniform2f(h,g.u_units_to_pixels),u_image:new M.Uniform1i(h,g.u_image),u_image_height:new M.Uniform1f(h,g.u_image_height)}},linePattern:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_texsize:new M.Uniform2f(h,g.u_texsize),u_ratio:new M.Uniform1f(h,g.u_ratio),u_device_pixel_ratio:new M.Uniform1f(h,g.u_device_pixel_ratio),u_image:new M.Uniform1i(h,g.u_image),u_units_to_pixels:new M.Uniform2f(h,g.u_units_to_pixels),u_scale:new M.Uniform3f(h,g.u_scale),u_fade:new M.Uniform1f(h,g.u_fade)}},lineSDF:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_ratio:new M.Uniform1f(h,g.u_ratio),u_device_pixel_ratio:new M.Uniform1f(h,g.u_device_pixel_ratio),u_units_to_pixels:new M.Uniform2f(h,g.u_units_to_pixels),u_patternscale_a:new M.Uniform2f(h,g.u_patternscale_a),u_patternscale_b:new M.Uniform2f(h,g.u_patternscale_b),u_sdfgamma:new M.Uniform1f(h,g.u_sdfgamma),u_image:new M.Uniform1i(h,g.u_image),u_tex_y_a:new M.Uniform1f(h,g.u_tex_y_a),u_tex_y_b:new M.Uniform1f(h,g.u_tex_y_b),u_mix:new M.Uniform1f(h,g.u_mix)}},raster:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_tl_parent:new M.Uniform2f(h,g.u_tl_parent),u_scale_parent:new M.Uniform1f(h,g.u_scale_parent),u_buffer_scale:new M.Uniform1f(h,g.u_buffer_scale),u_fade_t:new M.Uniform1f(h,g.u_fade_t),u_opacity:new M.Uniform1f(h,g.u_opacity),u_image0:new M.Uniform1i(h,g.u_image0),u_image1:new M.Uniform1i(h,g.u_image1),u_brightness_low:new M.Uniform1f(h,g.u_brightness_low),u_brightness_high:new M.Uniform1f(h,g.u_brightness_high),u_saturation_factor:new M.Uniform1f(h,g.u_saturation_factor),u_contrast_factor:new M.Uniform1f(h,g.u_contrast_factor),u_spin_weights:new M.Uniform3f(h,g.u_spin_weights)}},symbolIcon:function(h,g){return{u_is_size_zoom_constant:new M.Uniform1i(h,g.u_is_size_zoom_constant),u_is_size_feature_constant:new M.Uniform1i(h,g.u_is_size_feature_constant),u_size_t:new M.Uniform1f(h,g.u_size_t),u_size:new M.Uniform1f(h,g.u_size),u_camera_to_center_distance:new M.Uniform1f(h,g.u_camera_to_center_distance),u_pitch:new M.Uniform1f(h,g.u_pitch),u_rotate_symbol:new M.Uniform1i(h,g.u_rotate_symbol),u_aspect_ratio:new M.Uniform1f(h,g.u_aspect_ratio),u_fade_change:new M.Uniform1f(h,g.u_fade_change),u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_label_plane_matrix:new M.UniformMatrix4f(h,g.u_label_plane_matrix),u_coord_matrix:new M.UniformMatrix4f(h,g.u_coord_matrix),u_is_text:new M.Uniform1i(h,g.u_is_text),u_pitch_with_map:new M.Uniform1i(h,g.u_pitch_with_map),u_texsize:new M.Uniform2f(h,g.u_texsize),u_texture:new M.Uniform1i(h,g.u_texture)}},symbolSDF:function(h,g){return{u_is_size_zoom_constant:new M.Uniform1i(h,g.u_is_size_zoom_constant),u_is_size_feature_constant:new M.Uniform1i(h,g.u_is_size_feature_constant),u_size_t:new M.Uniform1f(h,g.u_size_t),u_size:new M.Uniform1f(h,g.u_size),u_camera_to_center_distance:new M.Uniform1f(h,g.u_camera_to_center_distance),u_pitch:new M.Uniform1f(h,g.u_pitch),u_rotate_symbol:new M.Uniform1i(h,g.u_rotate_symbol),u_aspect_ratio:new M.Uniform1f(h,g.u_aspect_ratio),u_fade_change:new M.Uniform1f(h,g.u_fade_change),u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_label_plane_matrix:new M.UniformMatrix4f(h,g.u_label_plane_matrix),u_coord_matrix:new M.UniformMatrix4f(h,g.u_coord_matrix),u_is_text:new M.Uniform1i(h,g.u_is_text),u_pitch_with_map:new M.Uniform1i(h,g.u_pitch_with_map),u_texsize:new M.Uniform2f(h,g.u_texsize),u_texture:new M.Uniform1i(h,g.u_texture),u_gamma_scale:new M.Uniform1f(h,g.u_gamma_scale),u_device_pixel_ratio:new M.Uniform1f(h,g.u_device_pixel_ratio),u_is_halo:new M.Uniform1i(h,g.u_is_halo)}},symbolTextAndIcon:function(h,g){return{u_is_size_zoom_constant:new M.Uniform1i(h,g.u_is_size_zoom_constant),u_is_size_feature_constant:new M.Uniform1i(h,g.u_is_size_feature_constant),u_size_t:new M.Uniform1f(h,g.u_size_t),u_size:new M.Uniform1f(h,g.u_size),u_camera_to_center_distance:new M.Uniform1f(h,g.u_camera_to_center_distance),u_pitch:new M.Uniform1f(h,g.u_pitch),u_rotate_symbol:new M.Uniform1i(h,g.u_rotate_symbol),u_aspect_ratio:new M.Uniform1f(h,g.u_aspect_ratio),u_fade_change:new M.Uniform1f(h,g.u_fade_change),u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_label_plane_matrix:new M.UniformMatrix4f(h,g.u_label_plane_matrix),u_coord_matrix:new M.UniformMatrix4f(h,g.u_coord_matrix),u_is_text:new M.Uniform1i(h,g.u_is_text),u_pitch_with_map:new M.Uniform1i(h,g.u_pitch_with_map),u_texsize:new M.Uniform2f(h,g.u_texsize),u_texsize_icon:new M.Uniform2f(h,g.u_texsize_icon),u_texture:new M.Uniform1i(h,g.u_texture),u_texture_icon:new M.Uniform1i(h,g.u_texture_icon),u_gamma_scale:new M.Uniform1f(h,g.u_gamma_scale),u_device_pixel_ratio:new M.Uniform1f(h,g.u_device_pixel_ratio),u_is_halo:new M.Uniform1i(h,g.u_is_halo)}},background:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_opacity:new M.Uniform1f(h,g.u_opacity),u_color:new M.UniformColor(h,g.u_color)}},backgroundPattern:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_opacity:new M.Uniform1f(h,g.u_opacity),u_image:new M.Uniform1i(h,g.u_image),u_pattern_tl_a:new M.Uniform2f(h,g.u_pattern_tl_a),u_pattern_br_a:new M.Uniform2f(h,g.u_pattern_br_a),u_pattern_tl_b:new M.Uniform2f(h,g.u_pattern_tl_b),u_pattern_br_b:new M.Uniform2f(h,g.u_pattern_br_b),u_texsize:new M.Uniform2f(h,g.u_texsize),u_mix:new M.Uniform1f(h,g.u_mix),u_pattern_size_a:new M.Uniform2f(h,g.u_pattern_size_a),u_pattern_size_b:new M.Uniform2f(h,g.u_pattern_size_b),u_scale_a:new M.Uniform1f(h,g.u_scale_a),u_scale_b:new M.Uniform1f(h,g.u_scale_b),u_pixel_coord_upper:new M.Uniform2f(h,g.u_pixel_coord_upper),u_pixel_coord_lower:new M.Uniform2f(h,g.u_pixel_coord_lower),u_tile_units_to_pixels:new M.Uniform1f(h,g.u_tile_units_to_pixels)}}};function Bh(h,g,d,b,B,G,q){for(var te=h.context,fe=te.gl,ce=h.useProgram("collisionBox"),Te=[],Ie=0,Oe=0,Qe=0;Qe<b.length;Qe++){var nt=b[Qe],ct=g.getTile(nt),tt=ct.getBucket(d);if(tt){var Tt=nt.posMatrix;B[0]===0&&B[1]===0||(Tt=h.translatePosMatrix(nt.posMatrix,ct,B,G));var Ut=q?tt.textCollisionBox:tt.iconCollisionBox,Nt=tt.collisionCircleArray;if(Nt.length>0){var pr=M.create(),tr=Tt;M.mul(pr,tt.placementInvProjMatrix,h.transform.glCoordMatrix),M.mul(pr,pr,tt.placementViewportMatrix),Te.push({circleArray:Nt,circleOffset:Oe,transform:tr,invTransform:pr}),Oe=Ie+=Nt.length/4}Ut&&ce.draw(te,fe.LINES,ye.disabled,ze.disabled,h.colorModeForRenderPass(),Ue.disabled,Qu(Tt,h.transform,ct),d.id,Ut.layoutVertexBuffer,Ut.indexBuffer,Ut.segments,null,h.transform.zoom,null,null,Ut.collisionVertexBuffer)}}if(q&&Te.length){var Dr=h.useProgram("collisionCircle"),Hr=new M.StructArrayLayout2f1f2i16;Hr.resize(4*Ie),Hr._trim();for(var sn=0,nn=0,Gn=Te;nn<Gn.length;nn+=1)for(var di=Gn[nn],Di=0;Di<di.circleArray.length/4;Di++){var Ui=4*Di,ho=di.circleArray[Ui+0],gi=di.circleArray[Ui+1],Wi=di.circleArray[Ui+2],Ko=di.circleArray[Ui+3];Hr.emplace(sn++,ho,gi,Wi,Ko,0),Hr.emplace(sn++,ho,gi,Wi,Ko,1),Hr.emplace(sn++,ho,gi,Wi,Ko,2),Hr.emplace(sn++,ho,gi,Wi,Ko,3)}(!dl||dl.length<2*Ie)&&(dl=function(gs){var Cl=2*gs,ts=new M.StructArrayLayout3ui6;ts.resize(Cl),ts._trim();for(var ja=0;ja<Cl;ja++){var $a=6*ja;ts.uint16[$a+0]=4*ja+0,ts.uint16[$a+1]=4*ja+1,ts.uint16[$a+2]=4*ja+2,ts.uint16[$a+3]=4*ja+2,ts.uint16[$a+4]=4*ja+3,ts.uint16[$a+5]=4*ja+0}return ts}(Ie));for(var Mo=te.createIndexBuffer(dl,!0),mo=te.createVertexBuffer(Hr,M.collisionCircleLayout.members,!0),ko=0,xo=Te;ko<xo.length;ko+=1){var qi=xo[ko],xs=Is(qi.transform,qi.invTransform,h.transform);Dr.draw(te,fe.TRIANGLES,ye.disabled,ze.disabled,h.colorModeForRenderPass(),Ue.disabled,xs,d.id,mo,Mo,M.SegmentVector.simpleSegment(0,2*qi.circleOffset,qi.circleArray.length,qi.circleArray.length/2),null,h.transform.zoom,null,null,null)}mo.destroy(),Mo.destroy()}}var _u=M.identity(new Float32Array(16));function Vc(h,g,d,b,B,G){var q=M.getAnchorAlignment(h),te=-(q.horizontalAlign-.5)*g,fe=-(q.verticalAlign-.5)*d,ce=M.evaluateVariableOffset(h,b);return new M.Point((te/B+ce[0])*G,(fe/B+ce[1])*G)}function Yp(h,g,d,b,B,G,q,te,fe,ce,Te){var Ie=h.text.placedSymbolArray,Oe=h.text.dynamicLayoutVertexArray,Qe=h.icon.dynamicLayoutVertexArray,nt={};Oe.clear();for(var ct=0;ct<Ie.length;ct++){var tt=Ie.get(ct),Tt=tt.hidden||!tt.crossTileID||h.allowVerticalPlacement&&!tt.placedOrientation?null:b[tt.crossTileID];if(Tt){var Ut=new M.Point(tt.anchorX,tt.anchorY),Nt=$o(Ut,d?te:q),pr=Fo(G.cameraToCenterDistance,Nt.signedDistanceFromCamera),tr=B.evaluateSizeForFeature(h.textSizeData,ce,tt)*pr/M.ONE_EM;d&&(tr*=h.tilePixelRatio/fe);for(var Dr=Vc(Tt.anchor,Tt.width,Tt.height,Tt.textOffset,Tt.textBoxScale,tr),Hr=d?$o(Ut.add(Dr),q).point:Nt.point.add(g?Dr.rotate(-G.angle):Dr),sn=h.allowVerticalPlacement&&tt.placedOrientation===M.WritingMode.vertical?Math.PI/2:0,nn=0;nn<tt.numGlyphs;nn++)M.addDynamicAttributes(Oe,Hr,sn);Te&&tt.associatedIconIndex>=0&&(nt[tt.associatedIconIndex]={shiftedAnchor:Hr,angle:sn})}else il(tt.numGlyphs,Oe)}if(Te){Qe.clear();for(var Gn=h.icon.placedSymbolArray,di=0;di<Gn.length;di++){var Di=Gn.get(di);if(Di.hidden)il(Di.numGlyphs,Qe);else{var Ui=nt[di];if(Ui)for(var ho=0;ho<Di.numGlyphs;ho++)M.addDynamicAttributes(Qe,Ui.shiftedAnchor,Ui.angle);else il(Di.numGlyphs,Qe)}}h.icon.dynamicLayoutVertexBuffer.updateData(Qe)}h.text.dynamicLayoutVertexBuffer.updateData(Oe)}function Fh(h,g,d){return d.iconsInText&&g?"symbolTextAndIcon":h?"symbolSDF":"symbolIcon"}function Ll(h,g,d,b,B,G,q,te,fe,ce,Te,Ie){for(var Oe=h.context,Qe=Oe.gl,nt=h.transform,ct=te==="map",tt=fe==="map",Tt=ct&&d.layout.get("symbol-placement")!=="point",Ut=ct&&!tt&&!Tt,Nt=d.layout.get("symbol-sort-key").constantOr(1)!==void 0,pr=!1,tr=h.depthModeForSublayer(0,ye.ReadOnly),Dr=d.layout.get("text-variable-anchor"),Hr=[],sn=0,nn=b;sn<nn.length;sn+=1){var Gn=nn[sn],di=g.getTile(Gn),Di=di.getBucket(d);if(Di){var Ui=B?Di.text:Di.icon;if(Ui&&Ui.segments.get().length){var ho=Ui.programConfigurations.get(d.id),gi=B||Di.sdfIcons,Wi=B?Di.textSizeData:Di.iconSizeData,Ko=tt||nt.pitch!==0,Mo=h.useProgram(Fh(gi,B,Di),ho),mo=M.evaluateSizeForZoom(Wi,nt.zoom),ko=void 0,xo=[0,0],qi=void 0,xs=void 0,gs=null,Cl=void 0;if(B)qi=di.glyphAtlasTexture,xs=Qe.LINEAR,ko=di.glyphAtlasTexture.size,Di.iconsInText&&(xo=di.imageAtlasTexture.size,gs=di.imageAtlasTexture,Cl=Ko||h.options.rotating||h.options.zooming||Wi.kind==="composite"||Wi.kind==="camera"?Qe.LINEAR:Qe.NEAREST);else{var ts=d.layout.get("icon-size").constantOr(0)!==1||Di.iconsNeedLinear;qi=di.imageAtlasTexture,xs=gi||h.options.rotating||h.options.zooming||ts||Ko?Qe.LINEAR:Qe.NEAREST,ko=di.imageAtlasTexture.size}var ja=Wa(di,1,h.transform.zoom),$a=Yo(Gn.posMatrix,tt,ct,h.transform,ja),vs=_a(Gn.posMatrix,tt,ct,h.transform,ja),Zl=Dr&&Di.hasTextData(),zu=d.layout.get("icon-text-fit")!=="none"&&Zl&&Di.hasIconData();Tt&&xc(Di,Gn.posMatrix,h,B,$a,vs,tt,ce);var Uu=h.translatePosMatrix(Gn.posMatrix,di,G,q),hh=Tt||B&&Dr||zu?_u:$a,Yc=h.translatePosMatrix(vs,di,G,q,!0),np=gi&&d.paint.get(B?"text-halo-width":"icon-halo-width").constantOr(1)!==0,pu={program:Mo,buffers:Ui,uniformValues:gi?Di.iconsInText?mp(Wi.kind,mo,Ut,tt,h,Uu,hh,Yc,ko,xo):bh(Wi.kind,mo,Ut,tt,h,Uu,hh,Yc,B,ko,!0):tc(Wi.kind,mo,Ut,tt,h,Uu,hh,Yc,B,ko),atlasTexture:qi,atlasTextureIcon:gs,atlasInterpolation:xs,atlasInterpolationIcon:Cl,isSDF:gi,hasHalo:np};if(Nt&&Di.canOverlap){pr=!0;for(var Tu=0,Zu=Ui.segments.get();Tu<Zu.length;Tu+=1){var Dl=Zu[Tu];Hr.push({segments:new M.SegmentVector([Dl]),sortKey:Dl.sortKey,state:pu})}}else Hr.push({segments:Ui.segments,sortKey:0,state:pu})}}}pr&&Hr.sort(function(Ws,ju){return Ws.sortKey-ju.sortKey});for(var Vl=0,Uh=Hr;Vl<Uh.length;Vl+=1){var ml=Uh[Vl],$l=ml.state;if(Oe.activeTexture.set(Qe.TEXTURE0),$l.atlasTexture.bind($l.atlasInterpolation,Qe.CLAMP_TO_EDGE),$l.atlasTextureIcon&&(Oe.activeTexture.set(Qe.TEXTURE1),$l.atlasTextureIcon&&$l.atlasTextureIcon.bind($l.atlasInterpolationIcon,Qe.CLAMP_TO_EDGE)),$l.isSDF){var Vu=$l.uniformValues;$l.hasHalo&&(Vu.u_is_halo=1,Fs($l.buffers,ml.segments,d,h,$l.program,tr,Te,Ie,Vu)),Vu.u_is_halo=0}Fs($l.buffers,ml.segments,d,h,$l.program,tr,Te,Ie,$l.uniformValues)}}function Fs(h,g,d,b,B,G,q,te,fe){var ce=b.context;B.draw(ce,ce.gl.TRIANGLES,G,q,te,Ue.disabled,fe,d.id,h.layoutVertexBuffer,h.indexBuffer,g,d.paint,b.transform.zoom,h.programConfigurations.get(d.id),h.dynamicLayoutVertexBuffer,h.opacityVertexBuffer)}function Tc(h,g,d,b,B,G,q){var te,fe,ce,Te,Ie,Oe=h.context.gl,Qe=d.paint.get("fill-pattern"),nt=Qe&&Qe.constantOr(1),ct=d.getCrossfadeParameters();q?(fe=nt&&!d.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",te=Oe.LINES):(fe=nt?"fillPattern":"fill",te=Oe.TRIANGLES);for(var tt=0,Tt=b;tt<Tt.length;tt+=1){var Ut=Tt[tt],Nt=g.getTile(Ut);if(!nt||Nt.patternsLoaded()){var pr=Nt.getBucket(d);if(pr){var tr=pr.programConfigurations.get(d.id),Dr=h.useProgram(fe,tr);nt&&(h.context.activeTexture.set(Oe.TEXTURE0),Nt.imageAtlasTexture.bind(Oe.LINEAR,Oe.CLAMP_TO_EDGE),tr.updatePaintBuffers(ct));var Hr=Qe.constantOr(null);if(Hr&&Nt.imageAtlas){var sn=Nt.imageAtlas,nn=sn.patternPositions[Hr.to.toString()],Gn=sn.patternPositions[Hr.from.toString()];nn&&Gn&&tr.setConstantPatternPositions(nn,Gn)}var di=h.translatePosMatrix(Ut.posMatrix,Nt,d.paint.get("fill-translate"),d.paint.get("fill-translate-anchor"));if(q){Te=pr.indexBuffer2,Ie=pr.segments2;var Di=[Oe.drawingBufferWidth,Oe.drawingBufferHeight];ce=fe==="fillOutlinePattern"&&nt?Ep(di,h,ct,Nt,Di):Hs(di,Di)}else Te=pr.indexBuffer,Ie=pr.segments,ce=nt?qa(di,h,ct,Nt):xh(di);Dr.draw(h.context,te,B,h.stencilModeForClipping(Ut),G,Ue.disabled,ce,d.id,pr.layoutVertexBuffer,Te,Ie,d.paint,h.transform.zoom,tr)}}}}function Ru(h,g,d,b,B,G,q){for(var te=h.context,fe=te.gl,ce=d.paint.get("fill-extrusion-pattern"),Te=ce.constantOr(1),Ie=d.getCrossfadeParameters(),Oe=d.paint.get("fill-extrusion-opacity"),Qe=0,nt=b;Qe<nt.length;Qe+=1){var ct=nt[Qe],tt=g.getTile(ct),Tt=tt.getBucket(d);if(Tt){var Ut=Tt.programConfigurations.get(d.id),Nt=h.useProgram(Te?"fillExtrusionPattern":"fillExtrusion",Ut);Te&&(h.context.activeTexture.set(fe.TEXTURE0),tt.imageAtlasTexture.bind(fe.LINEAR,fe.CLAMP_TO_EDGE),Ut.updatePaintBuffers(Ie));var pr=ce.constantOr(null);if(pr&&tt.imageAtlas){var tr=tt.imageAtlas,Dr=tr.patternPositions[pr.to.toString()],Hr=tr.patternPositions[pr.from.toString()];Dr&&Hr&&Ut.setConstantPatternPositions(Dr,Hr)}var sn=h.translatePosMatrix(ct.posMatrix,tt,d.paint.get("fill-extrusion-translate"),d.paint.get("fill-extrusion-translate-anchor")),nn=d.paint.get("fill-extrusion-vertical-gradient"),Gn=Te?vu(sn,h,nn,Oe,ct,Ie,tt):th(sn,h,nn,Oe);Nt.draw(te,te.gl.TRIANGLES,B,G,q,Ue.backCCW,Gn,d.id,Tt.layoutVertexBuffer,Tt.indexBuffer,Tt.segments,d.paint,h.transform.zoom,Ut)}}}function jc(h,g,d,b,B,G){var q=h.context,te=q.gl,fe=g.fbo;if(fe){var ce=h.useProgram("hillshade");q.activeTexture.set(te.TEXTURE0),te.bindTexture(te.TEXTURE_2D,fe.colorAttachment.get());var Te=function(Ie,Oe,Qe){var nt=Qe.paint.get("hillshade-shadow-color"),ct=Qe.paint.get("hillshade-highlight-color"),tt=Qe.paint.get("hillshade-accent-color"),Tt=Qe.paint.get("hillshade-illumination-direction")*(Math.PI/180);Qe.paint.get("hillshade-illumination-anchor")==="viewport"&&(Tt-=Ie.transform.angle);var Ut,Nt,pr,tr=!Ie.options.moving;return{u_matrix:Ie.transform.calculatePosMatrix(Oe.tileID.toUnwrapped(),tr),u_image:0,u_latrange:(Ut=Oe.tileID,Nt=Math.pow(2,Ut.canonical.z),pr=Ut.canonical.y,[new M.MercatorCoordinate(0,pr/Nt).toLngLat().lat,new M.MercatorCoordinate(0,(pr+1)/Nt).toLngLat().lat]),u_light:[Qe.paint.get("hillshade-exaggeration"),Tt],u_shadow:nt,u_highlight:ct,u_accent:tt}}(h,g,d);ce.draw(q,te.TRIANGLES,b,B,G,Ue.disabled,Te,d.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments)}}function $p(h,g,d,b,B,G){var q=h.context,te=q.gl,fe=g.dem;if(fe&&fe.data){var ce=fe.dim,Te=fe.stride,Ie=fe.getPixels();if(q.activeTexture.set(te.TEXTURE1),q.pixelStoreUnpackPremultiplyAlpha.set(!1),g.demTexture=g.demTexture||h.getTileTexture(Te),g.demTexture){var Oe=g.demTexture;Oe.update(Ie,{premultiply:!1}),Oe.bind(te.NEAREST,te.CLAMP_TO_EDGE)}else g.demTexture=new M.Texture(q,Ie,te.RGBA,{premultiply:!1}),g.demTexture.bind(te.NEAREST,te.CLAMP_TO_EDGE);q.activeTexture.set(te.TEXTURE0);var Qe=g.fbo;if(!Qe){var nt=new M.Texture(q,{width:ce,height:ce,data:null},te.RGBA);nt.bind(te.LINEAR,te.CLAMP_TO_EDGE),(Qe=g.fbo=q.createFramebuffer(ce,ce,!0)).colorAttachment.set(nt.texture)}q.bindFramebuffer.set(Qe.framebuffer),q.viewport.set([0,0,ce,ce]),h.useProgram("hillshadePrepare").draw(q,te.TRIANGLES,b,B,G,Ue.disabled,function(ct,tt){var Tt=tt.stride,Ut=M.create();return M.ortho(Ut,0,M.EXTENT,-M.EXTENT,0,0,1),M.translate(Ut,Ut,[0,-M.EXTENT,0]),{u_matrix:Ut,u_image:1,u_dimension:[Tt,Tt],u_zoom:ct.overscaledZ,u_unpack:tt.getUnpackVector()}}(g.tileID,fe),d.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments),g.needsHillshadePrepare=!1}}function Jh(h,g,d,b,B){var G=b.paint.get("raster-fade-duration");if(G>0){var q=M.browser.now(),te=(q-h.timeAdded)/G,fe=g?(q-g.timeAdded)/G:-1,ce=d.getSource(),Te=B.coveringZoomLevel({tileSize:ce.tileSize,roundZoom:ce.roundZoom}),Ie=!g||Math.abs(g.tileID.overscaledZ-Te)>Math.abs(h.tileID.overscaledZ-Te),Oe=Ie&&h.refreshedUponExpiration?1:M.clamp(Ie?te:1-fe,0,1);return h.refreshedUponExpiration&&te>=1&&(h.refreshedUponExpiration=!1),g?{opacity:1,mix:1-Oe}:{opacity:Oe,mix:0}}return{opacity:1,mix:0}}var Ac=new M.Color(1,0,0,1),kh=new M.Color(0,1,0,1),Iu=new M.Color(0,0,1,1),rh=new M.Color(1,0,1,1),gp=new M.Color(0,1,1,1);function vp(h,g,d,b){Hc(h,0,g+d/2,h.transform.width,d,b)}function Kp(h,g,d,b){Hc(h,g-d/2,0,d,h.transform.height,b)}function Hc(h,g,d,b,B,G){var q=h.context,te=q.gl;te.enable(te.SCISSOR_TEST),te.scissor(g*M.browser.devicePixelRatio,d*M.browser.devicePixelRatio,b*M.browser.devicePixelRatio,B*M.browser.devicePixelRatio),q.clear({color:G}),te.disable(te.SCISSOR_TEST)}function Eh(h,g,d){var b=h.context,B=b.gl,G=d.posMatrix,q=h.useProgram("debug"),te=ye.disabled,fe=ze.disabled,ce=h.colorModeForRenderPass();b.activeTexture.set(B.TEXTURE0),h.emptyTexture.bind(B.LINEAR,B.CLAMP_TO_EDGE),q.draw(b,B.LINE_STRIP,te,fe,ce,Ue.disabled,ys(G,M.Color.red),"$debug",h.debugBuffer,h.tileBorderIndexBuffer,h.debugSegments);var Te=g.getTileByID(d.key).latestRawTileData,Ie=Math.floor((Te&&Te.byteLength||0)/1024),Oe=g.getTile(d).tileSize,Qe=512/Math.min(Oe,512)*(d.overscaledZ/h.transform.zoom)*.5,nt=d.canonical.toString();d.overscaledZ!==d.canonical.z&&(nt+=" => "+d.overscaledZ),function(ct,tt){ct.initDebugOverlayCanvas();var Tt=ct.debugOverlayCanvas,Ut=ct.context.gl,Nt=ct.debugOverlayCanvas.getContext("2d");Nt.clearRect(0,0,Tt.width,Tt.height),Nt.shadowColor="white",Nt.shadowBlur=2,Nt.lineWidth=1.5,Nt.strokeStyle="white",Nt.textBaseline="top",Nt.font="bold 36px Open Sans, sans-serif",Nt.fillText(tt,5,5),Nt.strokeText(tt,5,5),ct.debugOverlayTexture.update(Tt),ct.debugOverlayTexture.bind(Ut.LINEAR,Ut.CLAMP_TO_EDGE)}(h,nt+" "+Ie+"kb"),q.draw(b,B.TRIANGLES,te,fe,je.alphaBlended,Ue.disabled,ys(G,M.Color.transparent,Qe),"$debug",h.debugBuffer,h.quadTriangleIndexBuffer,h.debugSegments)}var yu={symbol:function(h,g,d,b,B){if(h.renderPass==="translucent"){var G=ze.disabled,q=h.colorModeForRenderPass();d.layout.get("text-variable-anchor")&&function(te,fe,ce,Te,Ie,Oe,Qe){for(var nt=fe.transform,ct=Ie==="map",tt=Oe==="map",Tt=0,Ut=te;Tt<Ut.length;Tt+=1){var Nt=Ut[Tt],pr=Te.getTile(Nt),tr=pr.getBucket(ce);if(tr&&tr.text&&tr.text.segments.get().length){var Dr=M.evaluateSizeForZoom(tr.textSizeData,nt.zoom),Hr=Wa(pr,1,fe.transform.zoom),sn=Yo(Nt.posMatrix,tt,ct,fe.transform,Hr),nn=ce.layout.get("icon-text-fit")!=="none"&&tr.hasIconData();if(Dr){var Gn=Math.pow(2,nt.zoom-pr.tileID.overscaledZ);Yp(tr,ct,tt,Qe,M.symbolSize,nt,sn,Nt.posMatrix,Gn,Dr,nn)}}}}(b,h,d,g,d.layout.get("text-rotation-alignment"),d.layout.get("text-pitch-alignment"),B),d.paint.get("icon-opacity").constantOr(1)!==0&&Ll(h,g,d,b,!1,d.paint.get("icon-translate"),d.paint.get("icon-translate-anchor"),d.layout.get("icon-rotation-alignment"),d.layout.get("icon-pitch-alignment"),d.layout.get("icon-keep-upright"),G,q),d.paint.get("text-opacity").constantOr(1)!==0&&Ll(h,g,d,b,!0,d.paint.get("text-translate"),d.paint.get("text-translate-anchor"),d.layout.get("text-rotation-alignment"),d.layout.get("text-pitch-alignment"),d.layout.get("text-keep-upright"),G,q),g.map.showCollisionBoxes&&(Bh(h,g,d,b,d.paint.get("text-translate"),d.paint.get("text-translate-anchor"),!0),Bh(h,g,d,b,d.paint.get("icon-translate"),d.paint.get("icon-translate-anchor"),!1))}},circle:function(h,g,d,b){if(h.renderPass==="translucent"){var B=d.paint.get("circle-opacity"),G=d.paint.get("circle-stroke-width"),q=d.paint.get("circle-stroke-opacity"),te=d.layout.get("circle-sort-key").constantOr(1)!==void 0;if(B.constantOr(1)!==0||G.constantOr(1)!==0&&q.constantOr(1)!==0){for(var fe=h.context,ce=fe.gl,Te=h.depthModeForSublayer(0,ye.ReadOnly),Ie=ze.disabled,Oe=h.colorModeForRenderPass(),Qe=[],nt=0;nt<b.length;nt++){var ct=b[nt],tt=g.getTile(ct),Tt=tt.getBucket(d);if(Tt){var Ut=Tt.programConfigurations.get(d.id),Nt={programConfiguration:Ut,program:h.useProgram("circle",Ut),layoutVertexBuffer:Tt.layoutVertexBuffer,indexBuffer:Tt.indexBuffer,uniformValues:Na(h,ct,tt,d)};if(te)for(var pr=0,tr=Tt.segments.get();pr<tr.length;pr+=1){var Dr=tr[pr];Qe.push({segments:new M.SegmentVector([Dr]),sortKey:Dr.sortKey,state:Nt})}else Qe.push({segments:Tt.segments,sortKey:0,state:Nt})}}te&&Qe.sort(function(di,Di){return di.sortKey-Di.sortKey});for(var Hr=0,sn=Qe;Hr<sn.length;Hr+=1){var nn=sn[Hr],Gn=nn.state;Gn.program.draw(fe,ce.TRIANGLES,Te,Ie,Oe,Ue.disabled,Gn.uniformValues,d.id,Gn.layoutVertexBuffer,Gn.indexBuffer,nn.segments,d.paint,h.transform.zoom,Gn.programConfiguration)}}}},heatmap:function(h,g,d,b){if(d.paint.get("heatmap-opacity")!==0)if(h.renderPass==="offscreen"){var B=h.context,G=B.gl,q=ze.disabled,te=new je([G.ONE,G.ONE],M.Color.transparent,[!0,!0,!0,!0]);(function(Qe,nt,ct){var tt=Qe.gl;Qe.activeTexture.set(tt.TEXTURE1),Qe.viewport.set([0,0,nt.width/4,nt.height/4]);var Tt=ct.heatmapFbo;if(Tt)tt.bindTexture(tt.TEXTURE_2D,Tt.colorAttachment.get()),Qe.bindFramebuffer.set(Tt.framebuffer);else{var Ut=tt.createTexture();tt.bindTexture(tt.TEXTURE_2D,Ut),tt.texParameteri(tt.TEXTURE_2D,tt.TEXTURE_WRAP_S,tt.CLAMP_TO_EDGE),tt.texParameteri(tt.TEXTURE_2D,tt.TEXTURE_WRAP_T,tt.CLAMP_TO_EDGE),tt.texParameteri(tt.TEXTURE_2D,tt.TEXTURE_MIN_FILTER,tt.LINEAR),tt.texParameteri(tt.TEXTURE_2D,tt.TEXTURE_MAG_FILTER,tt.LINEAR),Tt=ct.heatmapFbo=Qe.createFramebuffer(nt.width/4,nt.height/4,!1),function(Nt,pr,tr,Dr){var Hr=Nt.gl;Hr.texImage2D(Hr.TEXTURE_2D,0,Hr.RGBA,pr.width/4,pr.height/4,0,Hr.RGBA,Nt.extRenderToTextureHalfFloat?Nt.extTextureHalfFloat.HALF_FLOAT_OES:Hr.UNSIGNED_BYTE,null),Dr.colorAttachment.set(tr)}(Qe,nt,Ut,Tt)}})(B,h,d),B.clear({color:M.Color.transparent});for(var fe=0;fe<b.length;fe++){var ce=b[fe];if(!g.hasRenderableParent(ce)){var Te=g.getTile(ce),Ie=Te.getBucket(d);if(Ie){var Oe=Ie.programConfigurations.get(d.id);h.useProgram("heatmap",Oe).draw(B,G.TRIANGLES,ye.disabled,q,te,Ue.disabled,Bf(ce.posMatrix,Te,h.transform.zoom,d.paint.get("heatmap-intensity")),d.id,Ie.layoutVertexBuffer,Ie.indexBuffer,Ie.segments,d.paint,h.transform.zoom,Oe)}}}B.viewport.set([0,0,h.width,h.height])}else h.renderPass==="translucent"&&(h.context.setColorMode(h.colorModeForRenderPass()),function(Qe,nt){var ct=Qe.context,tt=ct.gl,Tt=nt.heatmapFbo;if(Tt){ct.activeTexture.set(tt.TEXTURE0),tt.bindTexture(tt.TEXTURE_2D,Tt.colorAttachment.get()),ct.activeTexture.set(tt.TEXTURE1);var Ut=nt.colorRampTexture;Ut||(Ut=nt.colorRampTexture=new M.Texture(ct,nt.colorRamp,tt.RGBA)),Ut.bind(tt.LINEAR,tt.CLAMP_TO_EDGE),Qe.useProgram("heatmapTexture").draw(ct,tt.TRIANGLES,ye.disabled,ze.disabled,Qe.colorModeForRenderPass(),Ue.disabled,function(Nt,pr,tr,Dr){var Hr=M.create();M.ortho(Hr,0,Nt.width,Nt.height,0,0,1);var sn=Nt.context.gl;return{u_matrix:Hr,u_world:[sn.drawingBufferWidth,sn.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:pr.paint.get("heatmap-opacity")}}(Qe,nt),nt.id,Qe.viewportBuffer,Qe.quadTriangleIndexBuffer,Qe.viewportSegments,nt.paint,Qe.transform.zoom)}}(h,d))},line:function(h,g,d,b){if(h.renderPass==="translucent"){var B=d.paint.get("line-opacity"),G=d.paint.get("line-width");if(B.constantOr(1)!==0&&G.constantOr(1)!==0)for(var q=h.depthModeForSublayer(0,ye.ReadOnly),te=h.colorModeForRenderPass(),fe=d.paint.get("line-dasharray"),ce=d.paint.get("line-pattern"),Te=ce.constantOr(1),Ie=d.paint.get("line-gradient"),Oe=d.getCrossfadeParameters(),Qe=Te?"linePattern":fe?"lineSDF":Ie?"lineGradient":"line",nt=h.context,ct=nt.gl,tt=!0,Tt=0,Ut=b;Tt<Ut.length;Tt+=1){var Nt=Ut[Tt],pr=g.getTile(Nt);if(!Te||pr.patternsLoaded()){var tr=pr.getBucket(d);if(tr){var Dr=tr.programConfigurations.get(d.id),Hr=h.context.program.get(),sn=h.useProgram(Qe,Dr),nn=tt||sn.program!==Hr,Gn=ce.constantOr(null);if(Gn&&pr.imageAtlas){var di=pr.imageAtlas,Di=di.patternPositions[Gn.to.toString()],Ui=di.patternPositions[Gn.from.toString()];Di&&Ui&&Dr.setConstantPatternPositions(Di,Ui)}var ho=Te?wc(h,pr,d,Oe):fe?qp(h,pr,d,fe,Oe):Ie?Bs(h,pr,d,tr.lineClipsArray.length):es(h,pr,d);if(Te)nt.activeTexture.set(ct.TEXTURE0),pr.imageAtlasTexture.bind(ct.LINEAR,ct.CLAMP_TO_EDGE),Dr.updatePaintBuffers(Oe);else if(fe&&(nn||h.lineAtlas.dirty))nt.activeTexture.set(ct.TEXTURE0),h.lineAtlas.bind(nt);else if(Ie){var gi=tr.gradients[d.id],Wi=gi.texture;if(d.gradientVersion!==gi.version){var Ko=256;if(d.stepInterpolant){var Mo=g.getSource().maxzoom,mo=Nt.canonical.z===Mo?Math.ceil(1<<h.transform.maxZoom-Nt.canonical.z):1;Ko=M.clamp(M.nextPowerOfTwo(tr.maxLineLength/M.EXTENT*1024*mo),256,nt.maxTextureSize)}gi.gradient=M.renderColorRamp({expression:d.gradientExpression(),evaluationKey:"lineProgress",resolution:Ko,image:gi.gradient||void 0,clips:tr.lineClipsArray}),gi.texture?gi.texture.update(gi.gradient):gi.texture=new M.Texture(nt,gi.gradient,ct.RGBA),gi.version=d.gradientVersion,Wi=gi.texture}nt.activeTexture.set(ct.TEXTURE0),Wi.bind(d.stepInterpolant?ct.NEAREST:ct.LINEAR,ct.CLAMP_TO_EDGE)}sn.draw(nt,ct.TRIANGLES,q,h.stencilModeForClipping(Nt),te,Ue.disabled,ho,d.id,tr.layoutVertexBuffer,tr.indexBuffer,tr.segments,d.paint,h.transform.zoom,Dr,tr.layoutVertexBuffer2),tt=!1}}}}},fill:function(h,g,d,b){var B=d.paint.get("fill-color"),G=d.paint.get("fill-opacity");if(G.constantOr(1)!==0){var q=h.colorModeForRenderPass(),te=d.paint.get("fill-pattern"),fe=h.opaquePassEnabledForLayer()&&!te.constantOr(1)&&B.constantOr(M.Color.transparent).a===1&&G.constantOr(0)===1?"opaque":"translucent";if(h.renderPass===fe){var ce=h.depthModeForSublayer(1,h.renderPass==="opaque"?ye.ReadWrite:ye.ReadOnly);Tc(h,g,d,b,ce,q,!1)}if(h.renderPass==="translucent"&&d.paint.get("fill-antialias")){var Te=h.depthModeForSublayer(d.getPaintProperty("fill-outline-color")?2:0,ye.ReadOnly);Tc(h,g,d,b,Te,q,!0)}}},"fill-extrusion":function(h,g,d,b){var B=d.paint.get("fill-extrusion-opacity");if(B!==0&&h.renderPass==="translucent"){var G=new ye(h.context.gl.LEQUAL,ye.ReadWrite,h.depthRangeFor3D);if(B!==1||d.paint.get("fill-extrusion-pattern").constantOr(1))Ru(h,g,d,b,G,ze.disabled,je.disabled),Ru(h,g,d,b,G,h.stencilModeFor3D(),h.colorModeForRenderPass());else{var q=h.colorModeForRenderPass();Ru(h,g,d,b,G,ze.disabled,q)}}},hillshade:function(h,g,d,b){if(h.renderPass==="offscreen"||h.renderPass==="translucent"){for(var B=h.context,G=h.depthModeForSublayer(0,ye.ReadOnly),q=h.colorModeForRenderPass(),te=h.renderPass==="translucent"?h.stencilConfigForOverlap(b):[{},b],fe=te[0],ce=0,Te=te[1];ce<Te.length;ce+=1){var Ie=Te[ce],Oe=g.getTile(Ie);Oe.needsHillshadePrepare&&h.renderPass==="offscreen"?$p(h,Oe,d,G,ze.disabled,q):h.renderPass==="translucent"&&jc(h,Oe,d,G,fe[Ie.overscaledZ],q)}B.viewport.set([0,0,h.width,h.height])}},raster:function(h,g,d,b){if(h.renderPass==="translucent"&&d.paint.get("raster-opacity")!==0&&b.length)for(var B=h.context,G=B.gl,q=g.getSource(),te=h.useProgram("raster"),fe=h.colorModeForRenderPass(),ce=q instanceof ar?[{},b]:h.stencilConfigForOverlap(b),Te=ce[0],Ie=ce[1],Oe=Ie[Ie.length-1].overscaledZ,Qe=!h.options.moving,nt=0,ct=Ie;nt<ct.length;nt+=1){var tt=ct[nt],Tt=h.depthModeForSublayer(tt.overscaledZ-Oe,d.paint.get("raster-opacity")===1?ye.ReadWrite:ye.ReadOnly,G.LESS),Ut=g.getTile(tt),Nt=h.transform.calculatePosMatrix(tt.toUnwrapped(),Qe);Ut.registerFadeDuration(d.paint.get("raster-fade-duration"));var pr=g.findLoadedParent(tt,0),tr=Jh(Ut,pr,g,d,h.transform),Dr=void 0,Hr=void 0,sn=d.paint.get("raster-resampling")==="nearest"?G.NEAREST:G.LINEAR;B.activeTexture.set(G.TEXTURE0),Ut.texture.bind(sn,G.CLAMP_TO_EDGE,G.LINEAR_MIPMAP_NEAREST),B.activeTexture.set(G.TEXTURE1),pr?(pr.texture.bind(sn,G.CLAMP_TO_EDGE,G.LINEAR_MIPMAP_NEAREST),Dr=Math.pow(2,pr.tileID.overscaledZ-Ut.tileID.overscaledZ),Hr=[Ut.tileID.canonical.x*Dr%1,Ut.tileID.canonical.y*Dr%1]):Ut.texture.bind(sn,G.CLAMP_TO_EDGE,G.LINEAR_MIPMAP_NEAREST);var nn=Xo(Nt,Hr||[0,0],Dr||1,tr,d);q instanceof ar?te.draw(B,G.TRIANGLES,Tt,ze.disabled,fe,Ue.disabled,nn,d.id,q.boundsBuffer,h.quadTriangleIndexBuffer,q.boundsSegments):te.draw(B,G.TRIANGLES,Tt,Te[tt.overscaledZ],fe,Ue.disabled,nn,d.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments)}},background:function(h,g,d){var b=d.paint.get("background-color"),B=d.paint.get("background-opacity");if(B!==0){var G=h.context,q=G.gl,te=h.transform,fe=te.tileSize,ce=d.paint.get("background-pattern");if(!h.isPatternMissing(ce)){var Te=!ce&&b.a===1&&B===1&&h.opaquePassEnabledForLayer()?"opaque":"translucent";if(h.renderPass===Te){var Ie=ze.disabled,Oe=h.depthModeForSublayer(0,Te==="opaque"?ye.ReadWrite:ye.ReadOnly),Qe=h.colorModeForRenderPass(),nt=h.useProgram(ce?"backgroundPattern":"background"),ct=te.coveringTiles({tileSize:fe});ce&&(G.activeTexture.set(q.TEXTURE0),h.imageManager.bind(h.context));for(var tt=d.getCrossfadeParameters(),Tt=0,Ut=ct;Tt<Ut.length;Tt+=1){var Nt=Ut[Tt],pr=h.transform.calculatePosMatrix(Nt.toUnwrapped()),tr=ce?Zc(pr,B,h,ce,{tileID:Nt,tileSize:fe},tt):Kh(pr,B,b);nt.draw(G,q.TRIANGLES,Oe,Ie,Qe,Ue.disabled,tr,d.id,h.tileExtentBuffer,h.quadTriangleIndexBuffer,h.tileExtentSegments)}}}}},debug:function(h,g,d){for(var b=0;b<d.length;b++)Eh(h,g,d[b])},custom:function(h,g,d){var b=h.context,B=d.implementation;if(h.renderPass==="offscreen"){var G=B.prerender;G&&(h.setCustomLayerDefaults(),b.setColorMode(h.colorModeForRenderPass()),G.call(B,b.gl,h.transform.customLayerMatrix()),b.setDirty(),h.setBaseState())}else if(h.renderPass==="translucent"){h.setCustomLayerDefaults(),b.setColorMode(h.colorModeForRenderPass()),b.setStencilMode(ze.disabled);var q=B.renderingMode==="3d"?new ye(h.context.gl.LEQUAL,ye.ReadWrite,h.depthRangeFor3D):h.depthModeForSublayer(0,ye.ReadOnly);b.setDepthMode(q),B.render(b.gl,h.transform.customLayerMatrix()),b.setDirty(),h.setBaseState(),b.bindFramebuffer.set(null)}}},Ya=function(h,g){this.context=new Ae(h),this.transform=g,this._tileTextures={},this.setup(),this.numSublayers=Je.maxUnderzooming+Je.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new lc,this.gpuTimers={}};Ya.prototype.resize=function(h,g){if(this.width=h*M.browser.devicePixelRatio,this.height=g*M.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var d=0,b=this.style._order;d<b.length;d+=1)this.style._layers[b[d]].resize()},Ya.prototype.setup=function(){var h=this.context,g=new M.StructArrayLayout2i4;g.emplaceBack(0,0),g.emplaceBack(M.EXTENT,0),g.emplaceBack(0,M.EXTENT),g.emplaceBack(M.EXTENT,M.EXTENT),this.tileExtentBuffer=h.createVertexBuffer(g,Io.members),this.tileExtentSegments=M.SegmentVector.simpleSegment(0,0,4,2);var d=new M.StructArrayLayout2i4;d.emplaceBack(0,0),d.emplaceBack(M.EXTENT,0),d.emplaceBack(0,M.EXTENT),d.emplaceBack(M.EXTENT,M.EXTENT),this.debugBuffer=h.createVertexBuffer(d,Io.members),this.debugSegments=M.SegmentVector.simpleSegment(0,0,4,5);var b=new M.StructArrayLayout4i8;b.emplaceBack(0,0,0,0),b.emplaceBack(M.EXTENT,0,M.EXTENT,0),b.emplaceBack(0,M.EXTENT,0,M.EXTENT),b.emplaceBack(M.EXTENT,M.EXTENT,M.EXTENT,M.EXTENT),this.rasterBoundsBuffer=h.createVertexBuffer(b,rr.members),this.rasterBoundsSegments=M.SegmentVector.simpleSegment(0,0,4,2);var B=new M.StructArrayLayout2i4;B.emplaceBack(0,0),B.emplaceBack(1,0),B.emplaceBack(0,1),B.emplaceBack(1,1),this.viewportBuffer=h.createVertexBuffer(B,Io.members),this.viewportSegments=M.SegmentVector.simpleSegment(0,0,4,2);var G=new M.StructArrayLayout1ui2;G.emplaceBack(0),G.emplaceBack(1),G.emplaceBack(3),G.emplaceBack(2),G.emplaceBack(0),this.tileBorderIndexBuffer=h.createIndexBuffer(G);var q=new M.StructArrayLayout3ui6;q.emplaceBack(0,1,2),q.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=h.createIndexBuffer(q),this.emptyTexture=new M.Texture(h,{width:1,height:1,data:new Uint8Array([0,0,0,0])},h.gl.RGBA);var te=this.context.gl;this.stencilClearMode=new ze({func:te.ALWAYS,mask:0},0,255,te.ZERO,te.ZERO,te.ZERO)},Ya.prototype.clearStencil=function(){var h=this.context,g=h.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var d=M.create();M.ortho(d,0,this.width,this.height,0,0,1),M.scale(d,d,[g.drawingBufferWidth,g.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(h,g.TRIANGLES,ye.disabled,this.stencilClearMode,je.disabled,Ue.disabled,ec(d),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Ya.prototype._renderTileClippingMasks=function(h,g){if(this.currentStencilSource!==h.source&&h.isTileClipped()&&g&&g.length){this.currentStencilSource=h.source;var d=this.context,b=d.gl;this.nextStencilID+g.length>256&&this.clearStencil(),d.setColorMode(je.disabled),d.setDepthMode(ye.disabled);var B=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var G=0,q=g;G<q.length;G+=1){var te=q[G],fe=this._tileClippingMaskIDs[te.key]=this.nextStencilID++;B.draw(d,b.TRIANGLES,ye.disabled,new ze({func:b.ALWAYS,mask:0},fe,255,b.KEEP,b.KEEP,b.REPLACE),je.disabled,Ue.disabled,ec(te.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},Ya.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var h=this.nextStencilID++,g=this.context.gl;return new ze({func:g.NOTEQUAL,mask:255},h,255,g.KEEP,g.KEEP,g.REPLACE)},Ya.prototype.stencilModeForClipping=function(h){var g=this.context.gl;return new ze({func:g.EQUAL,mask:255},this._tileClippingMaskIDs[h.key],0,g.KEEP,g.KEEP,g.REPLACE)},Ya.prototype.stencilConfigForOverlap=function(h){var g,d=this.context.gl,b=h.sort(function(fe,ce){return ce.overscaledZ-fe.overscaledZ}),B=b[b.length-1].overscaledZ,G=b[0].overscaledZ-B+1;if(G>1){this.currentStencilSource=void 0,this.nextStencilID+G>256&&this.clearStencil();for(var q={},te=0;te<G;te++)q[te+B]=new ze({func:d.GEQUAL,mask:255},te+this.nextStencilID,255,d.KEEP,d.KEEP,d.REPLACE);return this.nextStencilID+=G,[q,b]}return[(g={},g[B]=ze.disabled,g),b]},Ya.prototype.colorModeForRenderPass=function(){var h=this.context.gl;return this._showOverdrawInspector?new je([h.CONSTANT_COLOR,h.ONE],new M.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?je.unblended:je.alphaBlended},Ya.prototype.depthModeForSublayer=function(h,g,d){if(!this.opaquePassEnabledForLayer())return ye.disabled;var b=1-((1+this.currentLayer)*this.numSublayers+h)*this.depthEpsilon;return new ye(d||this.context.gl.LEQUAL,g,[b,b])},Ya.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},Ya.prototype.render=function(h,g){var d=this;this.style=h,this.options=g,this.lineAtlas=h.lineAtlas,this.imageManager=h.imageManager,this.glyphManager=h.glyphManager,this.symbolFadeChange=h.placement.symbolFadeChange(M.browser.now()),this.imageManager.beginFrame();var b=this.style._order,B=this.style.sourceCaches;for(var G in B){var q=B[G];q.used&&q.prepare(this.context)}var te,fe,ce={},Te={},Ie={};for(var Oe in B){var Qe=B[Oe];ce[Oe]=Qe.getVisibleCoordinates(),Te[Oe]=ce[Oe].slice().reverse(),Ie[Oe]=Qe.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var nt=0;nt<b.length;nt++)if(this.style._layers[b[nt]].is3D()){this.opaquePassCutoff=nt;break}this.renderPass="offscreen";for(var ct=0,tt=b;ct<tt.length;ct+=1){var Tt=this.style._layers[tt[ct]];if(Tt.hasOffscreenPass()&&!Tt.isHidden(this.transform.zoom)){var Ut=Te[Tt.source];(Tt.type==="custom"||Ut.length)&&this.renderLayer(this,B[Tt.source],Tt,Ut)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:g.showOverdrawInspector?M.Color.black:M.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=g.showOverdrawInspector,this.depthRangeFor3D=[0,1-(h._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=b.length-1;this.currentLayer>=0;this.currentLayer--){var Nt=this.style._layers[b[this.currentLayer]],pr=B[Nt.source],tr=ce[Nt.source];this._renderTileClippingMasks(Nt,tr),this.renderLayer(this,pr,Nt,tr)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<b.length;this.currentLayer++){var Dr=this.style._layers[b[this.currentLayer]],Hr=B[Dr.source],sn=(Dr.type==="symbol"?Ie:Te)[Dr.source];this._renderTileClippingMasks(Dr,ce[Dr.source]),this.renderLayer(this,Hr,Dr,sn)}this.options.showTileBoundaries&&(M.values(this.style._layers).forEach(function(nn){nn.source&&!nn.isHidden(d.transform.zoom)&&(nn.source!==(fe&&fe.id)&&(fe=d.style.sourceCaches[nn.source]),(!te||te.getSource().maxzoom<fe.getSource().maxzoom)&&(te=fe))}),te&&yu.debug(this,te,te.getVisibleCoordinates())),this.options.showPadding&&function(nn){var Gn=nn.transform.padding;vp(nn,nn.transform.height-(Gn.top||0),3,Ac),vp(nn,Gn.bottom||0,3,kh),Kp(nn,Gn.left||0,3,Iu),Kp(nn,nn.transform.width-(Gn.right||0),3,rh);var di=nn.transform.centerPoint;(function(Di,Ui,ho,gi){Hc(Di,Ui-1,ho-10,2,20,gi),Hc(Di,Ui-10,ho-1,20,2,gi)})(nn,di.x,nn.transform.height-di.y,gp)}(this),this.context.setDefault()},Ya.prototype.renderLayer=function(h,g,d,b){d.isHidden(this.transform.zoom)||(d.type==="background"||d.type==="custom"||b.length)&&(this.id=d.id,this.gpuTimingStart(d),yu[d.type](h,g,d,b,this.style.placement.variableOffsets),this.gpuTimingEnd())},Ya.prototype.gpuTimingStart=function(h){if(this.options.gpuTiming){var g=this.context.extTimerQuery,d=this.gpuTimers[h.id];d||(d=this.gpuTimers[h.id]={calls:0,cpuTime:0,query:g.createQueryEXT()}),d.calls++,g.beginQueryEXT(g.TIME_ELAPSED_EXT,d.query)}},Ya.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var h=this.context.extTimerQuery;h.endQueryEXT(h.TIME_ELAPSED_EXT)}},Ya.prototype.collectGpuTimers=function(){var h=this.gpuTimers;return this.gpuTimers={},h},Ya.prototype.queryGpuTimers=function(h){var g={};for(var d in h){var b=h[d],B=this.context.extTimerQuery,G=B.getQueryObjectEXT(b.query,B.QUERY_RESULT_EXT)/1e6;B.deleteQueryEXT(b.query),g[d]=G}return g},Ya.prototype.translatePosMatrix=function(h,g,d,b,B){if(!d[0]&&!d[1])return h;var G=B?b==="map"?this.transform.angle:0:b==="viewport"?-this.transform.angle:0;if(G){var q=Math.sin(G),te=Math.cos(G);d=[d[0]*te-d[1]*q,d[0]*q+d[1]*te]}var fe=[B?d[0]:Wa(g,d[0],this.transform.zoom),B?d[1]:Wa(g,d[1],this.transform.zoom),0],ce=new Float32Array(16);return M.translate(ce,h,fe),ce},Ya.prototype.saveTileTexture=function(h){var g=this._tileTextures[h.size[0]];g?g.push(h):this._tileTextures[h.size[0]]=[h]},Ya.prototype.getTileTexture=function(h){var g=this._tileTextures[h];return g&&g.length>0?g.pop():null},Ya.prototype.isPatternMissing=function(h){if(!h)return!1;if(!h.from||!h.to)return!0;var g=this.imageManager.getPattern(h.from.toString()),d=this.imageManager.getPattern(h.to.toString());return!g||!d},Ya.prototype.useProgram=function(h,g){this.cache=this.cache||{};var d=""+h+(g?g.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[d]||(this.cache[d]=new zl(this.context,h,Gf[h],g,vf[h],this._showOverdrawInspector)),this.cache[d]},Ya.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Ya.prototype.setBaseState=function(){var h=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(h.FUNC_ADD)},Ya.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=M.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new M.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},Ya.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var nh=function(h,g){this.points=h,this.planes=g};nh.fromInvProjectionMatrix=function(h,g,d){var b=Math.pow(2,d),B=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(function(q){return M.transformMat4([],q,h)}).map(function(q){return M.scale$1([],q,1/q[3]/g*b)}),G=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(q){var te=M.sub([],B[q[0]],B[q[1]]),fe=M.sub([],B[q[2]],B[q[1]]),ce=M.normalize([],M.cross([],te,fe)),Te=-M.dot(ce,B[q[1]]);return ce.concat(Te)});return new nh(B,G)};var Gc=function(h,g){this.min=h,this.max=g,this.center=M.scale$2([],M.add([],this.min,this.max),.5)};Gc.prototype.quadrant=function(h){for(var g=[h%2==0,h<2],d=M.clone$2(this.min),b=M.clone$2(this.max),B=0;B<g.length;B++)d[B]=g[B]?this.min[B]:this.center[B],b[B]=g[B]?this.center[B]:this.max[B];return b[2]=this.max[2],new Gc(d,b)},Gc.prototype.distanceX=function(h){return Math.max(Math.min(this.max[0],h[0]),this.min[0])-h[0]},Gc.prototype.distanceY=function(h){return Math.max(Math.min(this.max[1],h[1]),this.min[1])-h[1]},Gc.prototype.intersects=function(h){for(var g=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],d=!0,b=0;b<h.planes.length;b++){for(var B=h.planes[b],G=0,q=0;q<g.length;q++)G+=M.dot$1(B,g[q])>=0;if(G===0)return 0;G!==g.length&&(d=!1)}if(d)return 2;for(var te=0;te<3;te++){for(var fe=Number.MAX_VALUE,ce=-Number.MAX_VALUE,Te=0;Te<h.points.length;Te++){var Ie=h.points[Te][te]-this.min[te];fe=Math.min(fe,Ie),ce=Math.max(ce,Ie)}if(ce<0||fe>this.max[te]-this.min[te])return 0}return 1};var ih=function(h,g,d,b){if(h===void 0&&(h=0),g===void 0&&(g=0),d===void 0&&(d=0),b===void 0&&(b=0),isNaN(h)||h<0||isNaN(g)||g<0||isNaN(d)||d<0||isNaN(b)||b<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=h,this.bottom=g,this.left=d,this.right=b};ih.prototype.interpolate=function(h,g,d){return g.top!=null&&h.top!=null&&(this.top=M.number(h.top,g.top,d)),g.bottom!=null&&h.bottom!=null&&(this.bottom=M.number(h.bottom,g.bottom,d)),g.left!=null&&h.left!=null&&(this.left=M.number(h.left,g.left,d)),g.right!=null&&h.right!=null&&(this.right=M.number(h.right,g.right,d)),this},ih.prototype.getCenter=function(h,g){var d=M.clamp((this.left+h-this.right)/2,0,h),b=M.clamp((this.top+g-this.bottom)/2,0,g);return new M.Point(d,b)},ih.prototype.equals=function(h){return this.top===h.top&&this.bottom===h.bottom&&this.left===h.left&&this.right===h.right},ih.prototype.clone=function(){return new ih(this.top,this.bottom,this.left,this.right)},ih.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Sa=function(h,g,d,b,B){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=B===void 0||B,this._minZoom=h||0,this._maxZoom=g||22,this._minPitch=d==null?0:d,this._maxPitch=b==null?60:b,this.setMaxBounds(),this.width=0,this.height=0,this._center=new M.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ih,this._posMatrixCache={},this._alignedPosMatrixCache={}},cs={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Sa.prototype.clone=function(){var h=new Sa(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return h.tileSize=this.tileSize,h.latRange=this.latRange,h.width=this.width,h.height=this.height,h._center=this._center,h.zoom=this.zoom,h.angle=this.angle,h._fov=this._fov,h._pitch=this._pitch,h._unmodified=this._unmodified,h._edgeInsets=this._edgeInsets.clone(),h._calcMatrices(),h},cs.minZoom.get=function(){return this._minZoom},cs.minZoom.set=function(h){this._minZoom!==h&&(this._minZoom=h,this.zoom=Math.max(this.zoom,h))},cs.maxZoom.get=function(){return this._maxZoom},cs.maxZoom.set=function(h){this._maxZoom!==h&&(this._maxZoom=h,this.zoom=Math.min(this.zoom,h))},cs.minPitch.get=function(){return this._minPitch},cs.minPitch.set=function(h){this._minPitch!==h&&(this._minPitch=h,this.pitch=Math.max(this.pitch,h))},cs.maxPitch.get=function(){return this._maxPitch},cs.maxPitch.set=function(h){this._maxPitch!==h&&(this._maxPitch=h,this.pitch=Math.min(this.pitch,h))},cs.renderWorldCopies.get=function(){return this._renderWorldCopies},cs.renderWorldCopies.set=function(h){h===void 0?h=!0:h===null&&(h=!1),this._renderWorldCopies=h},cs.worldSize.get=function(){return this.tileSize*this.scale},cs.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},cs.size.get=function(){return new M.Point(this.width,this.height)},cs.bearing.get=function(){return-this.angle/Math.PI*180},cs.bearing.set=function(h){var g=-M.wrap(h,-180,180)*Math.PI/180;this.angle!==g&&(this._unmodified=!1,this.angle=g,this._calcMatrices(),this.rotationMatrix=M.create$2(),M.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},cs.pitch.get=function(){return this._pitch/Math.PI*180},cs.pitch.set=function(h){var g=M.clamp(h,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==g&&(this._unmodified=!1,this._pitch=g,this._calcMatrices())},cs.fov.get=function(){return this._fov/Math.PI*180},cs.fov.set=function(h){h=Math.max(.01,Math.min(60,h)),this._fov!==h&&(this._unmodified=!1,this._fov=h/180*Math.PI,this._calcMatrices())},cs.zoom.get=function(){return this._zoom},cs.zoom.set=function(h){var g=Math.min(Math.max(h,this.minZoom),this.maxZoom);this._zoom!==g&&(this._unmodified=!1,this._zoom=g,this.scale=this.zoomScale(g),this.tileZoom=Math.floor(g),this.zoomFraction=g-this.tileZoom,this._constrain(),this._calcMatrices())},cs.center.get=function(){return this._center},cs.center.set=function(h){h.lat===this._center.lat&&h.lng===this._center.lng||(this._unmodified=!1,this._center=h,this._constrain(),this._calcMatrices())},cs.padding.get=function(){return this._edgeInsets.toJSON()},cs.padding.set=function(h){this._edgeInsets.equals(h)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,h,1),this._calcMatrices())},cs.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Sa.prototype.isPaddingEqual=function(h){return this._edgeInsets.equals(h)},Sa.prototype.interpolatePadding=function(h,g,d){this._unmodified=!1,this._edgeInsets.interpolate(h,g,d),this._constrain(),this._calcMatrices()},Sa.prototype.coveringZoomLevel=function(h){var g=(h.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/h.tileSize));return Math.max(0,g)},Sa.prototype.getVisibleUnwrappedCoordinates=function(h){var g=[new M.UnwrappedTileID(0,h)];if(this._renderWorldCopies)for(var d=this.pointCoordinate(new M.Point(0,0)),b=this.pointCoordinate(new M.Point(this.width,0)),B=this.pointCoordinate(new M.Point(this.width,this.height)),G=this.pointCoordinate(new M.Point(0,this.height)),q=Math.floor(Math.min(d.x,b.x,B.x,G.x)),te=Math.floor(Math.max(d.x,b.x,B.x,G.x)),fe=q-1;fe<=te+1;fe++)fe!==0&&g.push(new M.UnwrappedTileID(fe,h));return g},Sa.prototype.coveringTiles=function(h){var g=this.coveringZoomLevel(h),d=g;if(h.minzoom!==void 0&&g<h.minzoom)return[];h.maxzoom!==void 0&&g>h.maxzoom&&(g=h.maxzoom);var b=M.MercatorCoordinate.fromLngLat(this.center),B=Math.pow(2,g),G=[B*b.x,B*b.y,0],q=nh.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,g),te=h.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(te=g);var fe=function(nn){return{aabb:new Gc([nn*B,0,0],[(nn+1)*B,B,0]),zoom:0,x:0,y:0,wrap:nn,fullyVisible:!1}},ce=[],Te=[],Ie=g,Oe=h.reparseOverscaled?d:g;if(this._renderWorldCopies)for(var Qe=1;Qe<=3;Qe++)ce.push(fe(-Qe)),ce.push(fe(Qe));for(ce.push(fe(0));ce.length>0;){var nt=ce.pop(),ct=nt.x,tt=nt.y,Tt=nt.fullyVisible;if(!Tt){var Ut=nt.aabb.intersects(q);if(Ut===0)continue;Tt=Ut===2}var Nt=nt.aabb.distanceX(G),pr=nt.aabb.distanceY(G),tr=Math.max(Math.abs(Nt),Math.abs(pr));if(nt.zoom===Ie||tr>3+(1<<Ie-nt.zoom)-2&&nt.zoom>=te)Te.push({tileID:new M.OverscaledTileID(nt.zoom===Ie?Oe:nt.zoom,nt.wrap,nt.zoom,ct,tt),distanceSq:M.sqrLen([G[0]-.5-ct,G[1]-.5-tt])});else for(var Dr=0;Dr<4;Dr++){var Hr=(ct<<1)+Dr%2,sn=(tt<<1)+(Dr>>1);ce.push({aabb:nt.aabb.quadrant(Dr),zoom:nt.zoom+1,x:Hr,y:sn,wrap:nt.wrap,fullyVisible:Tt})}}return Te.sort(function(nn,Gn){return nn.distanceSq-Gn.distanceSq}).map(function(nn){return nn.tileID})},Sa.prototype.resize=function(h,g){this.width=h,this.height=g,this.pixelsToGLUnits=[2/h,-2/g],this._constrain(),this._calcMatrices()},cs.unmodified.get=function(){return this._unmodified},Sa.prototype.zoomScale=function(h){return Math.pow(2,h)},Sa.prototype.scaleZoom=function(h){return Math.log(h)/Math.LN2},Sa.prototype.project=function(h){var g=M.clamp(h.lat,-this.maxValidLatitude,this.maxValidLatitude);return new M.Point(M.mercatorXfromLng(h.lng)*this.worldSize,M.mercatorYfromLat(g)*this.worldSize)},Sa.prototype.unproject=function(h){return new M.MercatorCoordinate(h.x/this.worldSize,h.y/this.worldSize).toLngLat()},cs.point.get=function(){return this.project(this.center)},Sa.prototype.setLocationAtPoint=function(h,g){var d=this.pointCoordinate(g),b=this.pointCoordinate(this.centerPoint),B=this.locationCoordinate(h),G=new M.MercatorCoordinate(B.x-(d.x-b.x),B.y-(d.y-b.y));this.center=this.coordinateLocation(G),this._renderWorldCopies&&(this.center=this.center.wrap())},Sa.prototype.locationPoint=function(h){return this.coordinatePoint(this.locationCoordinate(h))},Sa.prototype.pointLocation=function(h){return this.coordinateLocation(this.pointCoordinate(h))},Sa.prototype.locationCoordinate=function(h){return M.MercatorCoordinate.fromLngLat(h)},Sa.prototype.coordinateLocation=function(h){return h.toLngLat()},Sa.prototype.pointCoordinate=function(h){var g=[h.x,h.y,0,1],d=[h.x,h.y,1,1];M.transformMat4(g,g,this.pixelMatrixInverse),M.transformMat4(d,d,this.pixelMatrixInverse);var b=g[3],B=d[3],G=g[1]/b,q=d[1]/B,te=g[2]/b,fe=d[2]/B,ce=te===fe?0:(0-te)/(fe-te);return new M.MercatorCoordinate(M.number(g[0]/b,d[0]/B,ce)/this.worldSize,M.number(G,q,ce)/this.worldSize)},Sa.prototype.coordinatePoint=function(h){var g=[h.x*this.worldSize,h.y*this.worldSize,0,1];return M.transformMat4(g,g,this.pixelMatrix),new M.Point(g[0]/g[3],g[1]/g[3])},Sa.prototype.getBounds=function(){return new M.LngLatBounds().extend(this.pointLocation(new M.Point(0,0))).extend(this.pointLocation(new M.Point(this.width,0))).extend(this.pointLocation(new M.Point(this.width,this.height))).extend(this.pointLocation(new M.Point(0,this.height)))},Sa.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new M.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Sa.prototype.setMaxBounds=function(h){h?(this.lngRange=[h.getWest(),h.getEast()],this.latRange=[h.getSouth(),h.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Sa.prototype.calculatePosMatrix=function(h,g){g===void 0&&(g=!1);var d=h.key,b=g?this._alignedPosMatrixCache:this._posMatrixCache;if(b[d])return b[d];var B=h.canonical,G=this.worldSize/this.zoomScale(B.z),q=B.x+Math.pow(2,B.z)*h.wrap,te=M.identity(new Float64Array(16));return M.translate(te,te,[q*G,B.y*G,0]),M.scale(te,te,[G/M.EXTENT,G/M.EXTENT,1]),M.multiply(te,g?this.alignedProjMatrix:this.projMatrix,te),b[d]=new Float32Array(te),b[d]},Sa.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Sa.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var h,g,d,b,B=-90,G=90,q=-180,te=180,fe=this.size,ce=this._unmodified;if(this.latRange){var Te=this.latRange;B=M.mercatorYfromLat(Te[1])*this.worldSize,h=(G=M.mercatorYfromLat(Te[0])*this.worldSize)-B<fe.y?fe.y/(G-B):0}if(this.lngRange){var Ie=this.lngRange;q=M.mercatorXfromLng(Ie[0])*this.worldSize,g=(te=M.mercatorXfromLng(Ie[1])*this.worldSize)-q<fe.x?fe.x/(te-q):0}var Oe=this.point,Qe=Math.max(g||0,h||0);if(Qe)return this.center=this.unproject(new M.Point(g?(te+q)/2:Oe.x,h?(G+B)/2:Oe.y)),this.zoom+=this.scaleZoom(Qe),this._unmodified=ce,void(this._constraining=!1);if(this.latRange){var nt=Oe.y,ct=fe.y/2;nt-ct<B&&(b=B+ct),nt+ct>G&&(b=G-ct)}if(this.lngRange){var tt=Oe.x,Tt=fe.x/2;tt-Tt<q&&(d=q+Tt),tt+Tt>te&&(d=te-Tt)}d===void 0&&b===void 0||(this.center=this.unproject(new M.Point(d!==void 0?d:Oe.x,b!==void 0?b:Oe.y))),this._unmodified=ce,this._constraining=!1}},Sa.prototype._calcMatrices=function(){if(this.height){var h=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var g=Math.PI/2+this._pitch,d=this._fov*(.5+h.y/this.height),b=Math.sin(d)*this.cameraToCenterDistance/Math.sin(M.clamp(Math.PI-g-d,.01,Math.PI-.01)),B=this.point,G=B.x,q=B.y,te=1.01*(Math.cos(Math.PI/2-this._pitch)*b+this.cameraToCenterDistance),fe=this.height/50,ce=new Float64Array(16);M.perspective(ce,this._fov,this.width/this.height,fe,te),ce[8]=2*-h.x/this.width,ce[9]=2*h.y/this.height,M.scale(ce,ce,[1,-1,1]),M.translate(ce,ce,[0,0,-this.cameraToCenterDistance]),M.rotateX(ce,ce,this._pitch),M.rotateZ(ce,ce,this.angle),M.translate(ce,ce,[-G,-q,0]),this.mercatorMatrix=M.scale([],ce,[this.worldSize,this.worldSize,this.worldSize]),M.scale(ce,ce,[1,1,M.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=ce,this.invProjMatrix=M.invert([],this.projMatrix);var Te=this.width%2/2,Ie=this.height%2/2,Oe=Math.cos(this.angle),Qe=Math.sin(this.angle),nt=G-Math.round(G)+Oe*Te+Qe*Ie,ct=q-Math.round(q)+Oe*Ie+Qe*Te,tt=new Float64Array(ce);if(M.translate(tt,tt,[nt>.5?nt-1:nt,ct>.5?ct-1:ct,0]),this.alignedProjMatrix=tt,ce=M.create(),M.scale(ce,ce,[this.width/2,-this.height/2,1]),M.translate(ce,ce,[1,-1,0]),this.labelPlaneMatrix=ce,ce=M.create(),M.scale(ce,ce,[1,-1,1]),M.translate(ce,ce,[-1,-1,0]),M.scale(ce,ce,[2/this.width,2/this.height,1]),this.glCoordMatrix=ce,this.pixelMatrix=M.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(ce=M.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=ce,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Sa.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var h=this.pointCoordinate(new M.Point(0,0)),g=[h.x*this.worldSize,h.y*this.worldSize,0,1];return M.transformMat4(g,g,this.pixelMatrix)[3]/this.cameraToCenterDistance},Sa.prototype.getCameraPoint=function(){var h=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new M.Point(0,h))},Sa.prototype.getCameraQueryGeometry=function(h){var g=this.getCameraPoint();if(h.length===1)return[h[0],g];for(var d=g.x,b=g.y,B=g.x,G=g.y,q=0,te=h;q<te.length;q+=1){var fe=te[q];d=Math.min(d,fe.x),b=Math.min(b,fe.y),B=Math.max(B,fe.x),G=Math.max(G,fe.y)}return[new M.Point(d,b),new M.Point(B,b),new M.Point(B,G),new M.Point(d,G),new M.Point(d,b)]},Object.defineProperties(Sa.prototype,cs);var ku=function(h){var g,d,b,B;this._hashName=h&&encodeURIComponent(h),M.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(g=this._updateHashUnthrottled.bind(this),d=!1,b=null,B=function(){b=null,d&&(g(),b=setTimeout(B,300),d=!1)},function(){return d=!0,b||B(),b})};ku.prototype.addTo=function(h){return this._map=h,M.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},ku.prototype.remove=function(){return M.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},ku.prototype.getHashString=function(h){var g=this._map.getCenter(),d=Math.round(100*this._map.getZoom())/100,b=Math.ceil((d*Math.LN2+Math.log(512/360/.5))/Math.LN10),B=Math.pow(10,b),G=Math.round(g.lng*B)/B,q=Math.round(g.lat*B)/B,te=this._map.getBearing(),fe=this._map.getPitch(),ce="";if(ce+=h?"/"+G+"/"+q+"/"+d:d+"/"+q+"/"+G,(te||fe)&&(ce+="/"+Math.round(10*te)/10),fe&&(ce+="/"+Math.round(fe)),this._hashName){var Te=this._hashName,Ie=!1,Oe=M.window.location.hash.slice(1).split("&").map(function(Qe){var nt=Qe.split("=")[0];return nt===Te?(Ie=!0,nt+"="+ce):Qe}).filter(function(Qe){return Qe});return Ie||Oe.push(Te+"="+ce),"#"+Oe.join("&")}return"#"+ce},ku.prototype._getCurrentHash=function(){var h,g=this,d=M.window.location.hash.replace("#","");return this._hashName?(d.split("&").map(function(b){return b.split("=")}).forEach(function(b){b[0]===g._hashName&&(h=b)}),(h&&h[1]||"").split("/")):d.split("/")},ku.prototype._onHashChange=function(){var h=this._getCurrentHash();if(h.length>=3&&!h.some(function(d){return isNaN(d)})){var g=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(h[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+h[2],+h[1]],zoom:+h[0],bearing:g,pitch:+(h[4]||0)}),!0}return!1},ku.prototype._updateHashUnthrottled=function(){var h=M.window.location.href.replace(/(#.+)?$/,this.getHashString());try{M.window.history.replaceState(M.window.history.state,null,h)}catch(g){}};var rc={linearity:.3,easing:M.bezier(0,0,.3,1)},xu=M.extend({deceleration:2500,maxSpeed:1400},rc),oh=M.extend({deceleration:20,maxSpeed:1400},rc),Cc=M.extend({deceleration:1e3,maxSpeed:360},rc),ah=M.extend({deceleration:1e3,maxSpeed:90},rc),Qh=function(h){this._map=h,this.clear()};function sh(h,g){(!h.duration||h.duration<g.duration)&&(h.duration=g.duration,h.easing=g.easing)}function Ul(h,g,d){var b=d.maxSpeed,B=d.linearity,G=d.deceleration,q=M.clamp(h*B/(g/1e3),-b,b),te=Math.abs(q)/(G*B);return{easing:d.easing,duration:1e3*te,amount:q*(te/2)}}Qh.prototype.clear=function(){this._inertiaBuffer=[]},Qh.prototype.record=function(h){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:M.browser.now(),settings:h})},Qh.prototype._drainInertiaBuffer=function(){for(var h=this._inertiaBuffer,g=M.browser.now();h.length>0&&g-h[0].time>160;)h.shift()},Qh.prototype._onMoveEnd=function(h){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var g={zoom:0,bearing:0,pitch:0,pan:new M.Point(0,0),pinchAround:void 0,around:void 0},d=0,b=this._inertiaBuffer;d<b.length;d+=1){var B=b[d].settings;g.zoom+=B.zoomDelta||0,g.bearing+=B.bearingDelta||0,g.pitch+=B.pitchDelta||0,B.panDelta&&g.pan._add(B.panDelta),B.around&&(g.around=B.around),B.pinchAround&&(g.pinchAround=B.pinchAround)}var G=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,q={};if(g.pan.mag()){var te=Ul(g.pan.mag(),G,M.extend({},xu,h||{}));q.offset=g.pan.mult(te.amount/g.pan.mag()),q.center=this._map.transform.center,sh(q,te)}if(g.zoom){var fe=Ul(g.zoom,G,oh);q.zoom=this._map.transform.zoom+fe.amount,sh(q,fe)}if(g.bearing){var ce=Ul(g.bearing,G,Cc);q.bearing=this._map.transform.bearing+M.clamp(ce.amount,-179,179),sh(q,ce)}if(g.pitch){var Te=Ul(g.pitch,G,ah);q.pitch=this._map.transform.pitch+Te.amount,sh(q,Te)}if(q.zoom||q.bearing){var Ie=g.pinchAround===void 0?g.around:g.pinchAround;q.around=Ie?this._map.unproject(Ie):this._map.getCenter()}return this.clear(),M.extend(q,{noMoveStart:!0})}};var ll=function(h){function g(b,B,G,q){q===void 0&&(q={});var te=de.mousePos(B.getCanvasContainer(),G),fe=B.unproject(te);h.call(this,b,M.extend({point:te,lngLat:fe,originalEvent:G},q)),this._defaultPrevented=!1,this.target=B}h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g;var d={defaultPrevented:{configurable:!0}};return g.prototype.preventDefault=function(){this._defaultPrevented=!0},d.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(g.prototype,d),g}(M.Event),Wc=function(h){function g(b,B,G){var q=b==="touchend"?G.changedTouches:G.touches,te=de.touchPos(B.getCanvasContainer(),q),fe=te.map(function(Ie){return B.unproject(Ie)}),ce=te.reduce(function(Ie,Oe,Qe,nt){return Ie.add(Oe.div(nt.length))},new M.Point(0,0)),Te=B.unproject(ce);h.call(this,b,{points:te,point:ce,lngLats:fe,lngLat:Te,originalEvent:G}),this._defaultPrevented=!1}h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g;var d={defaultPrevented:{configurable:!0}};return g.prototype.preventDefault=function(){this._defaultPrevented=!0},d.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(g.prototype,d),g}(M.Event),vl=function(h){function g(b,B,G){h.call(this,b,{originalEvent:G}),this._defaultPrevented=!1}h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g;var d={defaultPrevented:{configurable:!0}};return g.prototype.preventDefault=function(){this._defaultPrevented=!0},d.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(g.prototype,d),g}(M.Event),oi=function(h,g){this._map=h,this._clickTolerance=g.clickTolerance};oi.prototype.reset=function(){delete this._mousedownPos},oi.prototype.wheel=function(h){return this._firePreventable(new vl(h.type,this._map,h))},oi.prototype.mousedown=function(h,g){return this._mousedownPos=g,this._firePreventable(new ll(h.type,this._map,h))},oi.prototype.mouseup=function(h){this._map.fire(new ll(h.type,this._map,h))},oi.prototype.click=function(h,g){this._mousedownPos&&this._mousedownPos.dist(g)>=this._clickTolerance||this._map.fire(new ll(h.type,this._map,h))},oi.prototype.dblclick=function(h){return this._firePreventable(new ll(h.type,this._map,h))},oi.prototype.mouseover=function(h){this._map.fire(new ll(h.type,this._map,h))},oi.prototype.mouseout=function(h){this._map.fire(new ll(h.type,this._map,h))},oi.prototype.touchstart=function(h){return this._firePreventable(new Wc(h.type,this._map,h))},oi.prototype.touchmove=function(h){this._map.fire(new Wc(h.type,this._map,h))},oi.prototype.touchend=function(h){this._map.fire(new Wc(h.type,this._map,h))},oi.prototype.touchcancel=function(h){this._map.fire(new Wc(h.type,this._map,h))},oi.prototype._firePreventable=function(h){if(this._map.fire(h),h.defaultPrevented)return{}},oi.prototype.isEnabled=function(){return!0},oi.prototype.isActive=function(){return!1},oi.prototype.enable=function(){},oi.prototype.disable=function(){};var fi=function(h){this._map=h};fi.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},fi.prototype.mousemove=function(h){this._map.fire(new ll(h.type,this._map,h))},fi.prototype.mousedown=function(){this._delayContextMenu=!0},fi.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ll("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},fi.prototype.contextmenu=function(h){this._delayContextMenu?this._contextMenuEvent=h:this._map.fire(new ll(h.type,this._map,h)),this._map.listens("contextmenu")&&h.preventDefault()},fi.prototype.isEnabled=function(){return!0},fi.prototype.isActive=function(){return!1},fi.prototype.enable=function(){},fi.prototype.disable=function(){};var tu=function(h,g){this._map=h,this._el=h.getCanvasContainer(),this._container=h.getContainer(),this._clickTolerance=g.clickTolerance||1};function bu(h,g){for(var d={},b=0;b<h.length;b++)d[h[b].identifier]=g[b];return d}tu.prototype.isEnabled=function(){return!!this._enabled},tu.prototype.isActive=function(){return!!this._active},tu.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},tu.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},tu.prototype.mousedown=function(h,g){this.isEnabled()&&h.shiftKey&&h.button===0&&(de.disableDrag(),this._startPos=this._lastPos=g,this._active=!0)},tu.prototype.mousemoveWindow=function(h,g){if(this._active){var d=g;if(!(this._lastPos.equals(d)||!this._box&&d.dist(this._startPos)<this._clickTolerance)){var b=this._startPos;this._lastPos=d,this._box||(this._box=de.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",h));var B=Math.min(b.x,d.x),G=Math.max(b.x,d.x),q=Math.min(b.y,d.y),te=Math.max(b.y,d.y);de.setTransform(this._box,"translate("+B+"px,"+q+"px)"),this._box.style.width=G-B+"px",this._box.style.height=te-q+"px"}}},tu.prototype.mouseupWindow=function(h,g){var d=this;if(this._active&&h.button===0){var b=this._startPos,B=g;if(this.reset(),de.suppressClick(),b.x!==B.x||b.y!==B.y)return this._map.fire(new M.Event("boxzoomend",{originalEvent:h})),{cameraAnimation:function(G){return G.fitScreenCoordinates(b,B,d._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",h)}},tu.prototype.keydown=function(h){this._active&&h.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",h))},tu.prototype.blur=function(){this.reset()},tu.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(de.remove(this._box),this._box=null),de.enableDrag(),delete this._startPos,delete this._lastPos},tu.prototype._fireEvent=function(h,g){return this._map.fire(new M.Event(h,{originalEvent:g}))};var Dp=function(h){this.reset(),this.numTouches=h.numTouches};Dp.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Dp.prototype.touchstart=function(h,g,d){(this.centroid||d.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=h.timeStamp),d.length===this.numTouches&&(this.centroid=function(b){for(var B=new M.Point(0,0),G=0,q=b;G<q.length;G+=1)B._add(q[G]);return B.div(b.length)}(g),this.touches=bu(d,g)))},Dp.prototype.touchmove=function(h,g,d){if(!this.aborted&&this.centroid){var b=bu(d,g);for(var B in this.touches){var G=b[B];(!G||G.dist(this.touches[B])>30)&&(this.aborted=!0)}}},Dp.prototype.touchend=function(h,g,d){if((!this.centroid||h.timeStamp-this.startTime>500)&&(this.aborted=!0),d.length===0){var b=!this.aborted&&this.centroid;if(this.reset(),b)return b}};var ai=function(h){this.singleTap=new Dp(h),this.numTaps=h.numTaps,this.reset()};ai.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},ai.prototype.touchstart=function(h,g,d){this.singleTap.touchstart(h,g,d)},ai.prototype.touchmove=function(h,g,d){this.singleTap.touchmove(h,g,d)},ai.prototype.touchend=function(h,g,d){var b=this.singleTap.touchend(h,g,d);if(b){var B=h.timeStamp-this.lastTime<500,G=!this.lastTap||this.lastTap.dist(b)<30;if(B&&G||this.reset(),this.count++,this.lastTime=h.timeStamp,this.lastTap=b,this.count===this.numTaps)return this.reset(),b}};var is=function(){this._zoomIn=new ai({numTouches:1,numTaps:2}),this._zoomOut=new ai({numTouches:2,numTaps:1}),this.reset()};is.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},is.prototype.touchstart=function(h,g,d){this._zoomIn.touchstart(h,g,d),this._zoomOut.touchstart(h,g,d)},is.prototype.touchmove=function(h,g,d){this._zoomIn.touchmove(h,g,d),this._zoomOut.touchmove(h,g,d)},is.prototype.touchend=function(h,g,d){var b=this,B=this._zoomIn.touchend(h,g,d),G=this._zoomOut.touchend(h,g,d);return B?(this._active=!0,h.preventDefault(),setTimeout(function(){return b.reset()},0),{cameraAnimation:function(q){return q.easeTo({duration:300,zoom:q.getZoom()+1,around:q.unproject(B)},{originalEvent:h})}}):G?(this._active=!0,h.preventDefault(),setTimeout(function(){return b.reset()},0),{cameraAnimation:function(q){return q.easeTo({duration:300,zoom:q.getZoom()-1,around:q.unproject(G)},{originalEvent:h})}}):void 0},is.prototype.touchcancel=function(){this.reset()},is.prototype.enable=function(){this._enabled=!0},is.prototype.disable=function(){this._enabled=!1,this.reset()},is.prototype.isEnabled=function(){return this._enabled},is.prototype.isActive=function(){return this._active};var ep={0:1,2:2},mi=function(h){this.reset(),this._clickTolerance=h.clickTolerance||1};mi.prototype.blur=function(){this.reset()},mi.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},mi.prototype._correctButton=function(h,g){return!1},mi.prototype._move=function(h,g){return{}},mi.prototype.mousedown=function(h,g){if(!this._lastPoint){var d=de.mouseButton(h);this._correctButton(h,d)&&(this._lastPoint=g,this._eventButton=d)}},mi.prototype.mousemoveWindow=function(h,g){var d=this._lastPoint;if(d){if(h.preventDefault(),function(b,B){var G=ep[B];return b.buttons===void 0||(b.buttons&G)!==G}(h,this._eventButton))this.reset();else if(this._moved||!(g.dist(d)<this._clickTolerance))return this._moved=!0,this._lastPoint=g,this._move(d,g)}},mi.prototype.mouseupWindow=function(h){this._lastPoint&&de.mouseButton(h)===this._eventButton&&(this._moved&&de.suppressClick(),this.reset())},mi.prototype.enable=function(){this._enabled=!0},mi.prototype.disable=function(){this._enabled=!1,this.reset()},mi.prototype.isEnabled=function(){return this._enabled},mi.prototype.isActive=function(){return this._active};var Mc=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.mousedown=function(d,b){h.prototype.mousedown.call(this,d,b),this._lastPoint&&(this._active=!0)},g.prototype._correctButton=function(d,b){return b===0&&!d.ctrlKey},g.prototype._move=function(d,b){return{around:b,panDelta:b.sub(d)}},g}(mi),Op=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype._correctButton=function(d,b){return b===0&&d.ctrlKey||b===2},g.prototype._move=function(d,b){var B=.8*(b.x-d.x);if(B)return this._active=!0,{bearingDelta:B}},g.prototype.contextmenu=function(d){d.preventDefault()},g}(mi),Jp=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype._correctButton=function(d,b){return b===0&&d.ctrlKey||b===2},g.prototype._move=function(d,b){var B=-.5*(b.y-d.y);if(B)return this._active=!0,{pitchDelta:B}},g.prototype.contextmenu=function(d){d.preventDefault()},g}(mi),Xc=function(h){this._minTouches=1,this._clickTolerance=h.clickTolerance||1,this.reset()};Xc.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new M.Point(0,0)},Xc.prototype.touchstart=function(h,g,d){return this._calculateTransform(h,g,d)},Xc.prototype.touchmove=function(h,g,d){if(this._active&&!(d.length<this._minTouches))return h.preventDefault(),this._calculateTransform(h,g,d)},Xc.prototype.touchend=function(h,g,d){this._calculateTransform(h,g,d),this._active&&d.length<this._minTouches&&this.reset()},Xc.prototype.touchcancel=function(){this.reset()},Xc.prototype._calculateTransform=function(h,g,d){d.length>0&&(this._active=!0);var b=bu(d,g),B=new M.Point(0,0),G=new M.Point(0,0),q=0;for(var te in b){var fe=b[te],ce=this._touches[te];ce&&(B._add(fe),G._add(fe.sub(ce)),q++,b[te]=fe)}if(this._touches=b,!(q<this._minTouches)&&G.mag()){var Te=G.div(q);if(this._sum._add(Te),!(this._sum.mag()<this._clickTolerance))return{around:B.div(q),panDelta:Te}}},Xc.prototype.enable=function(){this._enabled=!0},Xc.prototype.disable=function(){this._enabled=!1,this.reset()},Xc.prototype.isEnabled=function(){return this._enabled},Xc.prototype.isActive=function(){return this._active};var hc=function(){this.reset()};function wh(h,g,d){for(var b=0;b<h.length;b++)if(h[b].identifier===d)return g[b]}function Pc(h,g){return Math.log(h/g)/Math.LN2}hc.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},hc.prototype._start=function(h){},hc.prototype._move=function(h,g,d){return{}},hc.prototype.touchstart=function(h,g,d){this._firstTwoTouches||d.length<2||(this._firstTwoTouches=[d[0].identifier,d[1].identifier],this._start([g[0],g[1]]))},hc.prototype.touchmove=function(h,g,d){if(this._firstTwoTouches){h.preventDefault();var b=this._firstTwoTouches,B=b[1],G=wh(d,g,b[0]),q=wh(d,g,B);if(G&&q){var te=this._aroundCenter?null:G.add(q).div(2);return this._move([G,q],te,h)}}},hc.prototype.touchend=function(h,g,d){if(this._firstTwoTouches){var b=this._firstTwoTouches,B=b[1],G=wh(d,g,b[0]),q=wh(d,g,B);G&&q||(this._active&&de.suppressClick(),this.reset())}},hc.prototype.touchcancel=function(){this.reset()},hc.prototype.enable=function(h){this._enabled=!0,this._aroundCenter=!!h&&h.around==="center"},hc.prototype.disable=function(){this._enabled=!1,this.reset()},hc.prototype.isEnabled=function(){return this._enabled},hc.prototype.isActive=function(){return this._active};var Xl=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.reset=function(){h.prototype.reset.call(this),delete this._distance,delete this._startDistance},g.prototype._start=function(d){this._startDistance=this._distance=d[0].dist(d[1])},g.prototype._move=function(d,b){var B=this._distance;if(this._distance=d[0].dist(d[1]),this._active||!(Math.abs(Pc(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Pc(this._distance,B),pinchAround:b}},g}(hc);function Rc(h,g){return 180*h.angleWith(g)/Math.PI}var Eu=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.reset=function(){h.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},g.prototype._start=function(d){this._startVector=this._vector=d[0].sub(d[1]),this._minDiameter=d[0].dist(d[1])},g.prototype._move=function(d,b){var B=this._vector;if(this._vector=d[0].sub(d[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Rc(this._vector,B),pinchAround:b}},g.prototype._isBelowThreshold=function(d){this._minDiameter=Math.min(this._minDiameter,d.mag());var b=25/(Math.PI*this._minDiameter)*360,B=Rc(d,this._startVector);return Math.abs(B)<b},g}(hc);function lh(h){return Math.abs(h.y)>Math.abs(h.x)}var tp=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.reset=function(){h.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},g.prototype._start=function(d){this._lastPoints=d,lh(d[0].sub(d[1]))&&(this._valid=!1)},g.prototype._move=function(d,b,B){var G=d[0].sub(this._lastPoints[0]),q=d[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(G,q,B.timeStamp),this._valid)return this._lastPoints=d,this._active=!0,{pitchDelta:(G.y+q.y)/2*-.5}},g.prototype.gestureBeginsVertically=function(d,b,B){if(this._valid!==void 0)return this._valid;var G=d.mag()>=2,q=b.mag()>=2;if(G||q){if(!G||!q)return this._firstMove===void 0&&(this._firstMove=B),B-this._firstMove<100&&void 0;var te=d.y>0==b.y>0;return lh(d)&&lh(b)&&te}},g}(hc),rp={panStep:100,bearingStep:15,pitchStep:10},su=function(){var h=rp;this._panStep=h.panStep,this._bearingStep=h.bearingStep,this._pitchStep=h.pitchStep,this._rotationDisabled=!1};function ql(h){return h*(2-h)}su.prototype.blur=function(){this.reset()},su.prototype.reset=function(){this._active=!1},su.prototype.keydown=function(h){var g=this;if(!(h.altKey||h.ctrlKey||h.metaKey)){var d=0,b=0,B=0,G=0,q=0;switch(h.keyCode){case 61:case 107:case 171:case 187:d=1;break;case 189:case 109:case 173:d=-1;break;case 37:h.shiftKey?b=-1:(h.preventDefault(),G=-1);break;case 39:h.shiftKey?b=1:(h.preventDefault(),G=1);break;case 38:h.shiftKey?B=1:(h.preventDefault(),q=-1);break;case 40:h.shiftKey?B=-1:(h.preventDefault(),q=1);break;default:return}return this._rotationDisabled&&(b=0,B=0),{cameraAnimation:function(te){var fe=te.getZoom();te.easeTo({duration:300,easeId:"keyboardHandler",easing:ql,zoom:d?Math.round(fe)+d*(h.shiftKey?2:1):fe,bearing:te.getBearing()+b*g._bearingStep,pitch:te.getPitch()+B*g._pitchStep,offset:[-G*g._panStep,-q*g._panStep],center:te.getCenter()},{originalEvent:h})}}}},su.prototype.enable=function(){this._enabled=!0},su.prototype.disable=function(){this._enabled=!1,this.reset()},su.prototype.isEnabled=function(){return this._enabled},su.prototype.isActive=function(){return this._active},su.prototype.disableRotation=function(){this._rotationDisabled=!0},su.prototype.enableRotation=function(){this._rotationDisabled=!1};var fa=function(h,g){this._map=h,this._el=h.getCanvasContainer(),this._handler=g,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,M.bindAll(["_onTimeout"],this)};fa.prototype.setZoomRate=function(h){this._defaultZoomRate=h},fa.prototype.setWheelZoomRate=function(h){this._wheelZoomRate=h},fa.prototype.isEnabled=function(){return!!this._enabled},fa.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},fa.prototype.isZooming=function(){return!!this._zooming},fa.prototype.enable=function(h){this.isEnabled()||(this._enabled=!0,this._aroundCenter=h&&h.around==="center")},fa.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},fa.prototype.wheel=function(h){if(this.isEnabled()){var g=h.deltaMode===M.window.WheelEvent.DOM_DELTA_LINE?40*h.deltaY:h.deltaY,d=M.browser.now(),b=d-(this._lastWheelEventTime||0);this._lastWheelEventTime=d,g!==0&&g%4.000244140625==0?this._type="wheel":g!==0&&Math.abs(g)<4?this._type="trackpad":b>400?(this._type=null,this._lastValue=g,this._timeout=setTimeout(this._onTimeout,40,h)):this._type||(this._type=Math.abs(b*g)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,g+=this._lastValue)),h.shiftKey&&g&&(g/=4),this._type&&(this._lastWheelEvent=h,this._delta-=g,this._active||this._start(h)),h.preventDefault()}},fa.prototype._onTimeout=function(h){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(h)},fa.prototype._start=function(h){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var g=de.mousePos(this._el,h);this._around=M.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(g)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},fa.prototype.renderFrame=function(){var h=this;if(this._frameId&&(this._frameId=null,this.isActive())){var g=this._map.transform;if(this._delta!==0){var d=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,b=2/(1+Math.exp(-Math.abs(this._delta*d)));this._delta<0&&b!==0&&(b=1/b);var B=typeof this._targetZoom=="number"?g.zoomScale(this._targetZoom):g.scale;this._targetZoom=Math.min(g.maxZoom,Math.max(g.minZoom,g.scaleZoom(B*b))),this._type==="wheel"&&(this._startZoom=g.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var G,q=typeof this._targetZoom=="number"?this._targetZoom:g.zoom,te=this._startZoom,fe=this._easing,ce=!1;if(this._type==="wheel"&&te&&fe){var Te=Math.min((M.browser.now()-this._lastWheelEventTime)/200,1),Ie=fe(Te);G=M.number(te,q,Ie),Te<1?this._frameId||(this._frameId=!0):ce=!0}else G=q,ce=!0;return this._active=!0,ce&&(this._active=!1,this._finishTimeout=setTimeout(function(){h._zooming=!1,h._handler._triggerRenderFrame(),delete h._targetZoom,delete h._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ce,zoomDelta:G-g.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},fa.prototype._smoothOutEasing=function(h){var g=M.ease;if(this._prevEase){var d=this._prevEase,b=(M.browser.now()-d.start)/d.duration,B=d.easing(b+.01)-d.easing(b),G=.27/Math.sqrt(B*B+1e-4)*.01,q=Math.sqrt(.0729-G*G);g=M.bezier(G,q,.25,1)}return this._prevEase={start:M.browser.now(),duration:h,easing:g},g},fa.prototype.blur=function(){this.reset()},fa.prototype.reset=function(){this._active=!1};var Rs=function(h,g){this._clickZoom=h,this._tapZoom=g};Rs.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Rs.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Rs.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Rs.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var hs=function(){this.reset()};hs.prototype.reset=function(){this._active=!1},hs.prototype.blur=function(){this.reset()},hs.prototype.dblclick=function(h,g){return h.preventDefault(),{cameraAnimation:function(d){d.easeTo({duration:300,zoom:d.getZoom()+(h.shiftKey?-1:1),around:d.unproject(g)},{originalEvent:h})}}},hs.prototype.enable=function(){this._enabled=!0},hs.prototype.disable=function(){this._enabled=!1,this.reset()},hs.prototype.isEnabled=function(){return this._enabled},hs.prototype.isActive=function(){return this._active};var lu=function(){this._tap=new ai({numTouches:1,numTaps:1}),this.reset()};lu.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},lu.prototype.touchstart=function(h,g,d){this._swipePoint||(this._tapTime&&h.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?d.length>0&&(this._swipePoint=g[0],this._swipeTouch=d[0].identifier):this._tap.touchstart(h,g,d))},lu.prototype.touchmove=function(h,g,d){if(this._tapTime){if(this._swipePoint){if(d[0].identifier!==this._swipeTouch)return;var b=g[0],B=b.y-this._swipePoint.y;return this._swipePoint=b,h.preventDefault(),this._active=!0,{zoomDelta:B/128}}}else this._tap.touchmove(h,g,d)},lu.prototype.touchend=function(h,g,d){this._tapTime?this._swipePoint&&d.length===0&&this.reset():this._tap.touchend(h,g,d)&&(this._tapTime=h.timeStamp)},lu.prototype.touchcancel=function(){this.reset()},lu.prototype.enable=function(){this._enabled=!0},lu.prototype.disable=function(){this._enabled=!1,this.reset()},lu.prototype.isEnabled=function(){return this._enabled},lu.prototype.isActive=function(){return this._active};var wu=function(h,g,d){this._el=h,this._mousePan=g,this._touchPan=d};wu.prototype.enable=function(h){this._inertiaOptions=h||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},wu.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},wu.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},wu.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var uh=function(h,g,d){this._pitchWithRotate=h.pitchWithRotate,this._mouseRotate=g,this._mousePitch=d};uh.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},uh.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},uh.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},uh.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var ch=function(h,g,d,b){this._el=h,this._touchZoom=g,this._touchRotate=d,this._tapDragZoom=b,this._rotationDisabled=!1,this._enabled=!0};ch.prototype.enable=function(h){this._touchZoom.enable(h),this._rotationDisabled||this._touchRotate.enable(h),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},ch.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},ch.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},ch.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},ch.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},ch.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Nu=function(h){return h.zoom||h.drag||h.pitch||h.rotate},Qp=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g}(M.Event);function Gi(h){return h.panDelta&&h.panDelta.mag()||h.zoomDelta||h.bearingDelta||h.pitchDelta}var Si=function(h,g){this._map=h,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Qh(h),this._bearingSnap=g.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(g),M.bindAll(["handleEvent","handleWindowEvent"],this);var d=this._el;this._listeners=[[d,"touchstart",{passive:!0}],[d,"touchmove",{passive:!1}],[d,"touchend",void 0],[d,"touchcancel",void 0],[d,"mousedown",void 0],[d,"mousemove",void 0],[d,"mouseup",void 0],[M.window.document,"mousemove",{capture:!0}],[M.window.document,"mouseup",void 0],[d,"mouseover",void 0],[d,"mouseout",void 0],[d,"dblclick",void 0],[d,"click",void 0],[d,"keydown",{capture:!1}],[d,"keyup",void 0],[d,"wheel",{passive:!1}],[d,"contextmenu",void 0],[M.window,"blur",void 0]];for(var b=0,B=this._listeners;b<B.length;b+=1){var G=B[b],q=G[0];de.addEventListener(q,G[1],q===M.window.document?this.handleWindowEvent:this.handleEvent,G[2])}};Si.prototype.destroy=function(){for(var h=0,g=this._listeners;h<g.length;h+=1){var d=g[h],b=d[0];de.removeEventListener(b,d[1],b===M.window.document?this.handleWindowEvent:this.handleEvent,d[2])}},Si.prototype._addDefaultHandlers=function(h){var g=this._map,d=g.getCanvasContainer();this._add("mapEvent",new oi(g,h));var b=g.boxZoom=new tu(g,h);this._add("boxZoom",b);var B=new is,G=new hs;g.doubleClickZoom=new Rs(G,B),this._add("tapZoom",B),this._add("clickZoom",G);var q=new lu;this._add("tapDragZoom",q);var te=g.touchPitch=new tp;this._add("touchPitch",te);var fe=new Op(h),ce=new Jp(h);g.dragRotate=new uh(h,fe,ce),this._add("mouseRotate",fe,["mousePitch"]),this._add("mousePitch",ce,["mouseRotate"]);var Te=new Mc(h),Ie=new Xc(h);g.dragPan=new wu(d,Te,Ie),this._add("mousePan",Te),this._add("touchPan",Ie,["touchZoom","touchRotate"]);var Oe=new Eu,Qe=new Xl;g.touchZoomRotate=new ch(d,Qe,Oe,q),this._add("touchRotate",Oe,["touchPan","touchZoom"]),this._add("touchZoom",Qe,["touchPan","touchRotate"]);var nt=g.scrollZoom=new fa(g,this);this._add("scrollZoom",nt,["mousePan"]);var ct=g.keyboard=new su;this._add("keyboard",ct),this._add("blockableMapEvent",new fi(g));for(var tt=0,Tt=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];tt<Tt.length;tt+=1){var Ut=Tt[tt];h.interactive&&h[Ut]&&g[Ut].enable(h[Ut])}},Si.prototype._add=function(h,g,d){this._handlers.push({handlerName:h,handler:g,allowed:d}),this._handlersById[h]=g},Si.prototype.stop=function(h){if(!this._updatingCamera){for(var g=0,d=this._handlers;g<d.length;g+=1)d[g].handler.reset();this._inertia.clear(),this._fireEvents({},{},h),this._changes=[]}},Si.prototype.isActive=function(){for(var h=0,g=this._handlers;h<g.length;h+=1)if(g[h].handler.isActive())return!0;return!1},Si.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Si.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Si.prototype.isMoving=function(){return!!Nu(this._eventsInProgress)||this.isZooming()},Si.prototype._blockedByActive=function(h,g,d){for(var b in h)if(b!==d&&(!g||g.indexOf(b)<0))return!0;return!1},Si.prototype.handleWindowEvent=function(h){this.handleEvent(h,h.type+"Window")},Si.prototype._getMapTouches=function(h){for(var g=[],d=0,b=h;d<b.length;d+=1){var B=b[d];this._el.contains(B.target)&&g.push(B)}return g},Si.prototype.handleEvent=function(h,g){this._updatingCamera=!0;for(var d=h.type==="renderFrame"?void 0:h,b={needsRenderFrame:!1},B={},G={},q=h.touches?this._getMapTouches(h.touches):void 0,te=q?de.touchPos(this._el,q):de.mousePos(this._el,h),fe=0,ce=this._handlers;fe<ce.length;fe+=1){var Te=ce[fe],Ie=Te.handlerName,Oe=Te.handler,Qe=Te.allowed;if(Oe.isEnabled()){var nt=void 0;this._blockedByActive(G,Qe,Ie)?Oe.reset():Oe[g||h.type]&&(nt=Oe[g||h.type](h,te,q),this.mergeHandlerResult(b,B,nt,Ie,d),nt&&nt.needsRenderFrame&&this._triggerRenderFrame()),(nt||Oe.isActive())&&(G[Ie]=Oe)}}var ct={};for(var tt in this._previousActiveHandlers)G[tt]||(ct[tt]=d);this._previousActiveHandlers=G,(Object.keys(ct).length||Gi(b))&&(this._changes.push([b,B,ct]),this._triggerRenderFrame()),(Object.keys(G).length||Gi(b))&&this._map._stop(!0),this._updatingCamera=!1;var Tt=b.cameraAnimation;Tt&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],Tt(this._map))},Si.prototype.mergeHandlerResult=function(h,g,d,b,B){if(d){M.extend(h,d);var G={handlerName:b,originalEvent:d.originalEvent||B};d.zoomDelta!==void 0&&(g.zoom=G),d.panDelta!==void 0&&(g.drag=G),d.pitchDelta!==void 0&&(g.pitch=G),d.bearingDelta!==void 0&&(g.rotate=G)}},Si.prototype._applyChanges=function(){for(var h={},g={},d={},b=0,B=this._changes;b<B.length;b+=1){var G=B[b],q=G[0],te=G[1],fe=G[2];q.panDelta&&(h.panDelta=(h.panDelta||new M.Point(0,0))._add(q.panDelta)),q.zoomDelta&&(h.zoomDelta=(h.zoomDelta||0)+q.zoomDelta),q.bearingDelta&&(h.bearingDelta=(h.bearingDelta||0)+q.bearingDelta),q.pitchDelta&&(h.pitchDelta=(h.pitchDelta||0)+q.pitchDelta),q.around!==void 0&&(h.around=q.around),q.pinchAround!==void 0&&(h.pinchAround=q.pinchAround),q.noInertia&&(h.noInertia=q.noInertia),M.extend(g,te),M.extend(d,fe)}this._updateMapTransform(h,g,d),this._changes=[]},Si.prototype._updateMapTransform=function(h,g,d){var b=this._map,B=b.transform;if(!Gi(h))return this._fireEvents(g,d,!0);var G=h.panDelta,q=h.zoomDelta,te=h.bearingDelta,fe=h.pitchDelta,ce=h.around,Te=h.pinchAround;Te!==void 0&&(ce=Te),b._stop(!0),ce=ce||b.transform.centerPoint;var Ie=B.pointLocation(G?ce.sub(G):ce);te&&(B.bearing+=te),fe&&(B.pitch+=fe),q&&(B.zoom+=q),B.setLocationAtPoint(Ie,ce),this._map._update(),h.noInertia||this._inertia.record(h),this._fireEvents(g,d,!0)},Si.prototype._fireEvents=function(h,g,d){var b=this,B=Nu(this._eventsInProgress),G=Nu(h),q={};for(var te in h)this._eventsInProgress[te]||(q[te+"start"]=h[te].originalEvent),this._eventsInProgress[te]=h[te];for(var fe in!B&&G&&this._fireEvent("movestart",G.originalEvent),q)this._fireEvent(fe,q[fe]);for(var ce in G&&this._fireEvent("move",G.originalEvent),h)this._fireEvent(ce,h[ce].originalEvent);var Te,Ie={};for(var Oe in this._eventsInProgress){var Qe=this._eventsInProgress[Oe],nt=Qe.handlerName,ct=Qe.originalEvent;this._handlersById[nt].isActive()||(delete this._eventsInProgress[Oe],Ie[Oe+"end"]=Te=g[nt]||ct)}for(var tt in Ie)this._fireEvent(tt,Ie[tt]);var Tt=Nu(this._eventsInProgress);if(d&&(B||G)&&!Tt){this._updatingCamera=!0;var Ut=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Nt=function(pr){return pr!==0&&-b._bearingSnap<pr&&pr<b._bearingSnap};Ut?(Nt(Ut.bearing||this._map.getBearing())&&(Ut.bearing=0),this._map.easeTo(Ut,{originalEvent:Te})):(this._map.fire(new M.Event("moveend",{originalEvent:Te})),Nt(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},Si.prototype._fireEvent=function(h,g){this._map.fire(new M.Event(h,g?{originalEvent:g}:{}))},Si.prototype._requestFrame=function(){var h=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(g){delete h._frameId,h.handleEvent(new Qp("renderFrame",{timeStamp:g})),h._applyChanges()})},Si.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var ji=function(h){function g(d,b){h.call(this),this._moving=!1,this._zooming=!1,this.transform=d,this._bearingSnap=b.bearingSnap,M.bindAll(["_renderFrameCallback"],this)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.getCenter=function(){return new M.LngLat(this.transform.center.lng,this.transform.center.lat)},g.prototype.setCenter=function(d,b){return this.jumpTo({center:d},b)},g.prototype.panBy=function(d,b,B){return d=M.Point.convert(d).mult(-1),this.panTo(this.transform.center,M.extend({offset:d},b),B)},g.prototype.panTo=function(d,b,B){return this.easeTo(M.extend({center:d},b),B)},g.prototype.getZoom=function(){return this.transform.zoom},g.prototype.setZoom=function(d,b){return this.jumpTo({zoom:d},b),this},g.prototype.zoomTo=function(d,b,B){return this.easeTo(M.extend({zoom:d},b),B)},g.prototype.zoomIn=function(d,b){return this.zoomTo(this.getZoom()+1,d,b),this},g.prototype.zoomOut=function(d,b){return this.zoomTo(this.getZoom()-1,d,b),this},g.prototype.getBearing=function(){return this.transform.bearing},g.prototype.setBearing=function(d,b){return this.jumpTo({bearing:d},b),this},g.prototype.getPadding=function(){return this.transform.padding},g.prototype.setPadding=function(d,b){return this.jumpTo({padding:d},b),this},g.prototype.rotateTo=function(d,b,B){return this.easeTo(M.extend({bearing:d},b),B)},g.prototype.resetNorth=function(d,b){return this.rotateTo(0,M.extend({duration:1e3},d),b),this},g.prototype.resetNorthPitch=function(d,b){return this.easeTo(M.extend({bearing:0,pitch:0,duration:1e3},d),b),this},g.prototype.snapToNorth=function(d,b){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(d,b):this},g.prototype.getPitch=function(){return this.transform.pitch},g.prototype.setPitch=function(d,b){return this.jumpTo({pitch:d},b),this},g.prototype.cameraForBounds=function(d,b){d=M.LngLatBounds.convert(d);var B=b&&b.bearing||0;return this._cameraForBoxAndBearing(d.getNorthWest(),d.getSouthEast(),B,b)},g.prototype._cameraForBoxAndBearing=function(d,b,B,G){var q={top:0,bottom:0,right:0,left:0};if(typeof(G=M.extend({padding:q,offset:[0,0],maxZoom:this.transform.maxZoom},G)).padding=="number"){var te=G.padding;G.padding={top:te,bottom:te,right:te,left:te}}G.padding=M.extend(q,G.padding);var fe=this.transform,ce=fe.padding,Te=fe.project(M.LngLat.convert(d)),Ie=fe.project(M.LngLat.convert(b)),Oe=Te.rotate(-B*Math.PI/180),Qe=Ie.rotate(-B*Math.PI/180),nt=new M.Point(Math.max(Oe.x,Qe.x),Math.max(Oe.y,Qe.y)),ct=new M.Point(Math.min(Oe.x,Qe.x),Math.min(Oe.y,Qe.y)),tt=nt.sub(ct),Tt=(fe.width-(ce.left+ce.right+G.padding.left+G.padding.right))/tt.x,Ut=(fe.height-(ce.top+ce.bottom+G.padding.top+G.padding.bottom))/tt.y;if(!(Ut<0||Tt<0)){var Nt=Math.min(fe.scaleZoom(fe.scale*Math.min(Tt,Ut)),G.maxZoom),pr=typeof G.offset.x=="number"?new M.Point(G.offset.x,G.offset.y):M.Point.convert(G.offset),tr=new M.Point((G.padding.left-G.padding.right)/2,(G.padding.top-G.padding.bottom)/2).rotate(B*Math.PI/180),Dr=pr.add(tr).mult(fe.scale/fe.zoomScale(Nt));return{center:fe.unproject(Te.add(Ie).div(2).sub(Dr)),zoom:Nt,bearing:B}}M.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},g.prototype.fitBounds=function(d,b,B){return this._fitInternal(this.cameraForBounds(d,b),b,B)},g.prototype.fitScreenCoordinates=function(d,b,B,G,q){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(M.Point.convert(d)),this.transform.pointLocation(M.Point.convert(b)),B,G),G,q)},g.prototype._fitInternal=function(d,b,B){return d?(delete(b=M.extend(d,b)).padding,b.linear?this.easeTo(b,B):this.flyTo(b,B)):this},g.prototype.jumpTo=function(d,b){this.stop();var B=this.transform,G=!1,q=!1,te=!1;return"zoom"in d&&B.zoom!==+d.zoom&&(G=!0,B.zoom=+d.zoom),d.center!==void 0&&(B.center=M.LngLat.convert(d.center)),"bearing"in d&&B.bearing!==+d.bearing&&(q=!0,B.bearing=+d.bearing),"pitch"in d&&B.pitch!==+d.pitch&&(te=!0,B.pitch=+d.pitch),d.padding==null||B.isPaddingEqual(d.padding)||(B.padding=d.padding),this.fire(new M.Event("movestart",b)).fire(new M.Event("move",b)),G&&this.fire(new M.Event("zoomstart",b)).fire(new M.Event("zoom",b)).fire(new M.Event("zoomend",b)),q&&this.fire(new M.Event("rotatestart",b)).fire(new M.Event("rotate",b)).fire(new M.Event("rotateend",b)),te&&this.fire(new M.Event("pitchstart",b)).fire(new M.Event("pitch",b)).fire(new M.Event("pitchend",b)),this.fire(new M.Event("moveend",b))},g.prototype.easeTo=function(d,b){var B=this;this._stop(!1,d.easeId),((d=M.extend({offset:[0,0],duration:500,easing:M.ease},d)).animate===!1||!d.essential&&M.browser.prefersReducedMotion)&&(d.duration=0);var G=this.transform,q=this.getZoom(),te=this.getBearing(),fe=this.getPitch(),ce=this.getPadding(),Te="zoom"in d?+d.zoom:q,Ie="bearing"in d?this._normalizeBearing(d.bearing,te):te,Oe="pitch"in d?+d.pitch:fe,Qe="padding"in d?d.padding:G.padding,nt=M.Point.convert(d.offset),ct=G.centerPoint.add(nt),tt=G.pointLocation(ct),Tt=M.LngLat.convert(d.center||tt);this._normalizeCenter(Tt);var Ut,Nt,pr=G.project(tt),tr=G.project(Tt).sub(pr),Dr=G.zoomScale(Te-q);d.around&&(Ut=M.LngLat.convert(d.around),Nt=G.locationPoint(Ut));var Hr={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||Te!==q,this._rotating=this._rotating||te!==Ie,this._pitching=this._pitching||Oe!==fe,this._padding=!G.isPaddingEqual(Qe),this._easeId=d.easeId,this._prepareEase(b,d.noMoveStart,Hr),this._ease(function(sn){if(B._zooming&&(G.zoom=M.number(q,Te,sn)),B._rotating&&(G.bearing=M.number(te,Ie,sn)),B._pitching&&(G.pitch=M.number(fe,Oe,sn)),B._padding&&(G.interpolatePadding(ce,Qe,sn),ct=G.centerPoint.add(nt)),Ut)G.setLocationAtPoint(Ut,Nt);else{var nn=G.zoomScale(G.zoom-q),Gn=Te>q?Math.min(2,Dr):Math.max(.5,Dr),di=Math.pow(Gn,1-sn),Di=G.unproject(pr.add(tr.mult(sn*di)).mult(nn));G.setLocationAtPoint(G.renderWorldCopies?Di.wrap():Di,ct)}B._fireMoveEvents(b)},function(sn){B._afterEase(b,sn)},d),this},g.prototype._prepareEase=function(d,b,B){B===void 0&&(B={}),this._moving=!0,b||B.moving||this.fire(new M.Event("movestart",d)),this._zooming&&!B.zooming&&this.fire(new M.Event("zoomstart",d)),this._rotating&&!B.rotating&&this.fire(new M.Event("rotatestart",d)),this._pitching&&!B.pitching&&this.fire(new M.Event("pitchstart",d))},g.prototype._fireMoveEvents=function(d){this.fire(new M.Event("move",d)),this._zooming&&this.fire(new M.Event("zoom",d)),this._rotating&&this.fire(new M.Event("rotate",d)),this._pitching&&this.fire(new M.Event("pitch",d))},g.prototype._afterEase=function(d,b){if(!this._easeId||!b||this._easeId!==b){delete this._easeId;var B=this._zooming,G=this._rotating,q=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,B&&this.fire(new M.Event("zoomend",d)),G&&this.fire(new M.Event("rotateend",d)),q&&this.fire(new M.Event("pitchend",d)),this.fire(new M.Event("moveend",d))}},g.prototype.flyTo=function(d,b){var B=this;if(!d.essential&&M.browser.prefersReducedMotion){var G=M.pick(d,["center","zoom","bearing","pitch","around"]);return this.jumpTo(G,b)}this.stop(),d=M.extend({offset:[0,0],speed:1.2,curve:1.42,easing:M.ease},d);var q=this.transform,te=this.getZoom(),fe=this.getBearing(),ce=this.getPitch(),Te=this.getPadding(),Ie="zoom"in d?M.clamp(+d.zoom,q.minZoom,q.maxZoom):te,Oe="bearing"in d?this._normalizeBearing(d.bearing,fe):fe,Qe="pitch"in d?+d.pitch:ce,nt="padding"in d?d.padding:q.padding,ct=q.zoomScale(Ie-te),tt=M.Point.convert(d.offset),Tt=q.centerPoint.add(tt),Ut=q.pointLocation(Tt),Nt=M.LngLat.convert(d.center||Ut);this._normalizeCenter(Nt);var pr=q.project(Ut),tr=q.project(Nt).sub(pr),Dr=d.curve,Hr=Math.max(q.width,q.height),sn=Hr/ct,nn=tr.mag();if("minZoom"in d){var Gn=M.clamp(Math.min(d.minZoom,te,Ie),q.minZoom,q.maxZoom),di=Hr/q.zoomScale(Gn-te);Dr=Math.sqrt(di/nn*2)}var Di=Dr*Dr;function Ui(xo){var qi=(sn*sn-Hr*Hr+(xo?-1:1)*Di*Di*nn*nn)/(2*(xo?sn:Hr)*Di*nn);return Math.log(Math.sqrt(qi*qi+1)-qi)}function ho(xo){return(Math.exp(xo)-Math.exp(-xo))/2}function gi(xo){return(Math.exp(xo)+Math.exp(-xo))/2}var Wi=Ui(0),Ko=function(xo){return gi(Wi)/gi(Wi+Dr*xo)},Mo=function(xo){return Hr*((gi(Wi)*(ho(qi=Wi+Dr*xo)/gi(qi))-ho(Wi))/Di)/nn;var qi},mo=(Ui(1)-Wi)/Dr;if(Math.abs(nn)<1e-6||!isFinite(mo)){if(Math.abs(Hr-sn)<1e-6)return this.easeTo(d,b);var ko=sn<Hr?-1:1;mo=Math.abs(Math.log(sn/Hr))/Dr,Mo=function(){return 0},Ko=function(xo){return Math.exp(ko*Dr*xo)}}return d.duration="duration"in d?+d.duration:1e3*mo/("screenSpeed"in d?+d.screenSpeed/Dr:+d.speed),d.maxDuration&&d.duration>d.maxDuration&&(d.duration=0),this._zooming=!0,this._rotating=fe!==Oe,this._pitching=Qe!==ce,this._padding=!q.isPaddingEqual(nt),this._prepareEase(b,!1),this._ease(function(xo){var qi=xo*mo,xs=1/Ko(qi);q.zoom=xo===1?Ie:te+q.scaleZoom(xs),B._rotating&&(q.bearing=M.number(fe,Oe,xo)),B._pitching&&(q.pitch=M.number(ce,Qe,xo)),B._padding&&(q.interpolatePadding(Te,nt,xo),Tt=q.centerPoint.add(tt));var gs=xo===1?Nt:q.unproject(pr.add(tr.mult(Mo(qi))).mult(xs));q.setLocationAtPoint(q.renderWorldCopies?gs.wrap():gs,Tt),B._fireMoveEvents(b)},function(){return B._afterEase(b)},d),this},g.prototype.isEasing=function(){return!!this._easeFrameId},g.prototype.stop=function(){return this._stop()},g.prototype._stop=function(d,b){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var B=this._onEaseEnd;delete this._onEaseEnd,B.call(this,b)}if(!d){var G=this.handlers;G&&G.stop(!1)}return this},g.prototype._ease=function(d,b,B){B.animate===!1||B.duration===0?(d(1),b()):(this._easeStart=M.browser.now(),this._easeOptions=B,this._onEaseFrame=d,this._onEaseEnd=b,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},g.prototype._renderFrameCallback=function(){var d=Math.min((M.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(d)),d<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},g.prototype._normalizeBearing=function(d,b){d=M.wrap(d,-180,180);var B=Math.abs(d-b);return Math.abs(d-360-b)<B&&(d-=360),Math.abs(d+360-b)<B&&(d+=360),d},g.prototype._normalizeCenter=function(d){var b=this.transform;if(b.renderWorldCopies&&!b.lngRange){var B=d.lng-b.center.lng;d.lng+=B>180?-360:B<-180?360:0}},g}(M.Evented),ao=function(h){h===void 0&&(h={}),this.options=h,M.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};ao.prototype.getDefaultPosition=function(){return"bottom-right"},ao.prototype.onAdd=function(h){var g=this.options&&this.options.compact;return this._map=h,this._container=de.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=de.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=de.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),g&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),g===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},ao.prototype.onRemove=function(){de.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},ao.prototype._setElementTitle=function(h,g){var d=this._map._getUIString("AttributionControl."+g);h.title=d,h.setAttribute("aria-label",d)},ao.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},ao.prototype._updateEditLink=function(){var h=this._editLink;h||(h=this._editLink=this._container.querySelector(".mapbox-improve-map"));var g=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||M.config.ACCESS_TOKEN}];if(h){var d=g.reduce(function(b,B,G){return B.value&&(b+=B.key+"="+B.value+(G<g.length-1?"&":"")),b},"?");h.href=M.config.FEEDBACK_URL+"/"+d+(this._map._hash?this._map._hash.getHashString(!0):""),h.rel="noopener nofollow",this._setElementTitle(h,"MapFeedback")}},ao.prototype._updateData=function(h){!h||h.sourceDataType!=="metadata"&&h.sourceDataType!=="visibility"&&h.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())},ao.prototype._updateAttributions=function(){if(this._map.style){var h=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?h=h.concat(this.options.customAttribution.map(function(te){return typeof te!="string"?"":te})):typeof this.options.customAttribution=="string"&&h.push(this.options.customAttribution)),this._map.style.stylesheet){var g=this._map.style.stylesheet;this.styleOwner=g.owner,this.styleId=g.id}var d=this._map.style.sourceCaches;for(var b in d){var B=d[b];if(B.used){var G=B.getSource();G.attribution&&h.indexOf(G.attribution)<0&&h.push(G.attribution)}}h.sort(function(te,fe){return te.length-fe.length});var q=(h=h.filter(function(te,fe){for(var ce=fe+1;ce<h.length;ce++)if(h[ce].indexOf(te)>=0)return!1;return!0})).join(" | ");q!==this._attribHTML&&(this._attribHTML=q,h.length?(this._innerContainer.innerHTML=q,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},ao.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Ic=function(){M.bindAll(["_updateLogo"],this),M.bindAll(["_updateCompact"],this)};Ic.prototype.onAdd=function(h){this._map=h,this._container=de.create("div","mapboxgl-ctrl");var g=de.create("a","mapboxgl-ctrl-logo");return g.target="_blank",g.rel="noopener nofollow",g.href="https://www.mapbox.com/",g.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),g.setAttribute("rel","noopener nofollow"),this._container.appendChild(g),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Ic.prototype.onRemove=function(){de.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Ic.prototype.getDefaultPosition=function(){return"bottom-left"},Ic.prototype._updateLogo=function(h){h&&h.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},Ic.prototype._logoRequired=function(){if(this._map.style){var h=this._map.style.sourceCaches;for(var g in h)if(h[g].getSource().mapbox_logo)return!0;return!1}},Ic.prototype._updateCompact=function(){var h=this._container.children;if(h.length){var g=h[0];this._map.getCanvasContainer().offsetWidth<250?g.classList.add("mapboxgl-compact"):g.classList.remove("mapboxgl-compact")}};var Gs=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Gs.prototype.add=function(h){var g=++this._id;return this._queue.push({callback:h,id:g,cancelled:!1}),g},Gs.prototype.remove=function(h){for(var g=this._currentlyRunning,d=0,b=g?this._queue.concat(g):this._queue;d<b.length;d+=1){var B=b[d];if(B.id===h)return void(B.cancelled=!0)}},Gs.prototype.run=function(h){h===void 0&&(h=0);var g=this._currentlyRunning=this._queue;this._queue=[];for(var d=0,b=g;d<b.length;d+=1){var B=b[d];if(!B.cancelled&&(B.callback(h),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Gs.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Lc={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},ul=M.window.HTMLImageElement,Nh=M.window.HTMLElement,xa=M.window.ImageBitmap,Al={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Lu=function(h){function g(b){var B=this;if((b=M.extend({},Al,b)).minZoom!=null&&b.maxZoom!=null&&b.minZoom>b.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(b.minPitch!=null&&b.maxPitch!=null&&b.minPitch>b.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(b.minPitch!=null&&b.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(b.maxPitch!=null&&b.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var G=new Sa(b.minZoom,b.maxZoom,b.minPitch,b.maxPitch,b.renderWorldCopies);if(h.call(this,G,b),this._interactive=b.interactive,this._maxTileCacheSize=b.maxTileCacheSize,this._failIfMajorPerformanceCaveat=b.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=b.preserveDrawingBuffer,this._antialias=b.antialias,this._trackResize=b.trackResize,this._bearingSnap=b.bearingSnap,this._refreshExpiredTiles=b.refreshExpiredTiles,this._fadeDuration=b.fadeDuration,this._crossSourceCollisions=b.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=b.collectResourceTiming,this._renderTaskQueue=new Gs,this._controls=[],this._mapId=M.uniqueId(),this._locale=M.extend({},Lc,b.locale),this._clickTolerance=b.clickTolerance,this._requestManager=new M.RequestManager(b.transformRequest,b.accessToken),typeof b.container=="string"){if(this._container=M.window.document.getElementById(b.container),!this._container)throw new Error("Container '"+b.container+"' not found.")}else{if(!(b.container instanceof Nh))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=b.container}if(b.maxBounds&&this.setMaxBounds(b.maxBounds),M.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return B._update(!1)}),this.on("moveend",function(){return B._update(!1)}),this.on("zoom",function(){return B._update(!0)}),M.window!==void 0&&(M.window.addEventListener("online",this._onWindowOnline,!1),M.window.addEventListener("resize",this._onWindowResize,!1),M.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Si(this,b),this._hash=b.hash&&new ku(typeof b.hash=="string"&&b.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:b.center,zoom:b.zoom,bearing:b.bearing,pitch:b.pitch}),b.bounds&&(this.resize(),this.fitBounds(b.bounds,M.extend({},b.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=b.localIdeographFontFamily,b.style&&this.setStyle(b.style,{localIdeographFontFamily:b.localIdeographFontFamily}),b.attributionControl&&this.addControl(new ao({customAttribution:b.customAttribution})),this.addControl(new Ic,b.logoPosition),this.on("style.load",function(){B.transform.unmodified&&B.jumpTo(B.style.stylesheet)}),this.on("data",function(q){B._update(q.dataType==="style"),B.fire(new M.Event(q.dataType+"data",q))}),this.on("dataloading",function(q){B.fire(new M.Event(q.dataType+"dataloading",q))})}h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g;var d={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return g.prototype._getMapId=function(){return this._mapId},g.prototype.addControl=function(b,B){if(B===void 0&&(B=b.getDefaultPosition?b.getDefaultPosition():"top-right"),!b||!b.onAdd)return this.fire(new M.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var G=b.onAdd(this);this._controls.push(b);var q=this._controlPositions[B];return B.indexOf("bottom")!==-1?q.insertBefore(G,q.firstChild):q.appendChild(G),this},g.prototype.removeControl=function(b){if(!b||!b.onRemove)return this.fire(new M.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var B=this._controls.indexOf(b);return B>-1&&this._controls.splice(B,1),b.onRemove(this),this},g.prototype.hasControl=function(b){return this._controls.indexOf(b)>-1},g.prototype.resize=function(b){var B=this._containerDimensions(),G=B[0],q=B[1];if(G===this.transform.width&&q===this.transform.height)return this;this._resizeCanvas(G,q),this.transform.resize(G,q),this.painter.resize(G,q);var te=!this._moving;return te&&this.fire(new M.Event("movestart",b)).fire(new M.Event("move",b)),this.fire(new M.Event("resize",b)),te&&this.fire(new M.Event("moveend",b)),this},g.prototype.getBounds=function(){return this.transform.getBounds()},g.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},g.prototype.setMaxBounds=function(b){return this.transform.setMaxBounds(M.LngLatBounds.convert(b)),this._update()},g.prototype.setMinZoom=function(b){if((b=b==null?-2:b)>=-2&&b<=this.transform.maxZoom)return this.transform.minZoom=b,this._update(),this.getZoom()<b&&this.setZoom(b),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},g.prototype.getMinZoom=function(){return this.transform.minZoom},g.prototype.setMaxZoom=function(b){if((b=b==null?22:b)>=this.transform.minZoom)return this.transform.maxZoom=b,this._update(),this.getZoom()>b&&this.setZoom(b),this;throw new Error("maxZoom must be greater than the current minZoom")},g.prototype.getMaxZoom=function(){return this.transform.maxZoom},g.prototype.setMinPitch=function(b){if((b=b==null?0:b)<0)throw new Error("minPitch must be greater than or equal to 0");if(b>=0&&b<=this.transform.maxPitch)return this.transform.minPitch=b,this._update(),this.getPitch()<b&&this.setPitch(b),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},g.prototype.getMinPitch=function(){return this.transform.minPitch},g.prototype.setMaxPitch=function(b){if((b=b==null?60:b)>60)throw new Error("maxPitch must be less than or equal to 60");if(b>=this.transform.minPitch)return this.transform.maxPitch=b,this._update(),this.getPitch()>b&&this.setPitch(b),this;throw new Error("maxPitch must be greater than the current minPitch")},g.prototype.getMaxPitch=function(){return this.transform.maxPitch},g.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},g.prototype.setRenderWorldCopies=function(b){return this.transform.renderWorldCopies=b,this._update()},g.prototype.project=function(b){return this.transform.locationPoint(M.LngLat.convert(b))},g.prototype.unproject=function(b){return this.transform.pointLocation(M.Point.convert(b))},g.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},g.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},g.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},g.prototype._createDelegatedListener=function(b,B,G){var q,te=this;if(b==="mouseenter"||b==="mouseover"){var fe=!1;return{layer:B,listener:G,delegates:{mousemove:function(Te){var Ie=te.getLayer(B)?te.queryRenderedFeatures(Te.point,{layers:[B]}):[];Ie.length?fe||(fe=!0,G.call(te,new ll(b,te,Te.originalEvent,{features:Ie}))):fe=!1},mouseout:function(){fe=!1}}}}if(b==="mouseleave"||b==="mouseout"){var ce=!1;return{layer:B,listener:G,delegates:{mousemove:function(Te){(te.getLayer(B)?te.queryRenderedFeatures(Te.point,{layers:[B]}):[]).length?ce=!0:ce&&(ce=!1,G.call(te,new ll(b,te,Te.originalEvent)))},mouseout:function(Te){ce&&(ce=!1,G.call(te,new ll(b,te,Te.originalEvent)))}}}}return{layer:B,listener:G,delegates:(q={},q[b]=function(Te){var Ie=te.getLayer(B)?te.queryRenderedFeatures(Te.point,{layers:[B]}):[];Ie.length&&(Te.features=Ie,G.call(te,Te),delete Te.features)},q)}},g.prototype.on=function(b,B,G){if(G===void 0)return h.prototype.on.call(this,b,B);var q=this._createDelegatedListener(b,B,G);for(var te in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[b]=this._delegatedListeners[b]||[],this._delegatedListeners[b].push(q),q.delegates)this.on(te,q.delegates[te]);return this},g.prototype.once=function(b,B,G){if(G===void 0)return h.prototype.once.call(this,b,B);var q=this._createDelegatedListener(b,B,G);for(var te in q.delegates)this.once(te,q.delegates[te]);return this},g.prototype.off=function(b,B,G){var q=this;return G===void 0?h.prototype.off.call(this,b,B):(this._delegatedListeners&&this._delegatedListeners[b]&&function(te){for(var fe=te[b],ce=0;ce<fe.length;ce++){var Te=fe[ce];if(Te.layer===B&&Te.listener===G){for(var Ie in Te.delegates)q.off(Ie,Te.delegates[Ie]);return fe.splice(ce,1),q}}}(this._delegatedListeners),this)},g.prototype.queryRenderedFeatures=function(b,B){if(!this.style)return[];var G;if(B!==void 0||b===void 0||b instanceof M.Point||Array.isArray(b)||(B=b,b=void 0),B=B||{},(b=b||[[0,0],[this.transform.width,this.transform.height]])instanceof M.Point||typeof b[0]=="number")G=[M.Point.convert(b)];else{var q=M.Point.convert(b[0]),te=M.Point.convert(b[1]);G=[q,new M.Point(te.x,q.y),te,new M.Point(q.x,te.y),q]}return this.style.queryRenderedFeatures(G,B,this.transform)},g.prototype.querySourceFeatures=function(b,B){return this.style.querySourceFeatures(b,B)},g.prototype.setStyle=function(b,B){return(B=M.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},B)).diff!==!1&&B.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&b?(this._diffStyle(b,B),this):(this._localIdeographFontFamily=B.localIdeographFontFamily,this._updateStyle(b,B))},g.prototype._getUIString=function(b){var B=this._locale[b];if(B==null)throw new Error("Missing UI string '"+b+"'");return B},g.prototype._updateStyle=function(b,B){return this.style&&(this.style.setEventedParent(null),this.style._remove()),b?(this.style=new Nl(this,B||{}),this.style.setEventedParent(this,{style:this.style}),typeof b=="string"?this.style.loadURL(b):this.style.loadJSON(b),this):(delete this.style,this)},g.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Nl(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},g.prototype._diffStyle=function(b,B){var G=this;if(typeof b=="string"){var q=this._requestManager.normalizeStyleURL(b),te=this._requestManager.transformRequest(q,M.ResourceType.Style);M.getJSON(te,function(fe,ce){fe?G.fire(new M.ErrorEvent(fe)):ce&&G._updateDiff(ce,B)})}else typeof b=="object"&&this._updateDiff(b,B)},g.prototype._updateDiff=function(b,B){try{this.style.setState(b)&&this._update(!0)}catch(G){M.warnOnce("Unable to perform style diff: "+(G.message||G.error||G)+". Rebuilding the style from scratch."),this._updateStyle(b,B)}},g.prototype.getStyle=function(){if(this.style)return this.style.serialize()},g.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():M.warnOnce("There is no style added to the map.")},g.prototype.addSource=function(b,B){return this._lazyInitEmptyStyle(),this.style.addSource(b,B),this._update(!0)},g.prototype.isSourceLoaded=function(b){var B=this.style&&this.style.sourceCaches[b];if(B!==void 0)return B.loaded();this.fire(new M.ErrorEvent(new Error("There is no source with ID '"+b+"'")))},g.prototype.areTilesLoaded=function(){var b=this.style&&this.style.sourceCaches;for(var B in b){var G=b[B]._tiles;for(var q in G){var te=G[q];if(te.state!=="loaded"&&te.state!=="errored")return!1}}return!0},g.prototype.addSourceType=function(b,B,G){return this._lazyInitEmptyStyle(),this.style.addSourceType(b,B,G)},g.prototype.removeSource=function(b){return this.style.removeSource(b),this._update(!0)},g.prototype.getSource=function(b){return this.style.getSource(b)},g.prototype.addImage=function(b,B,G){G===void 0&&(G={});var q=G.pixelRatio;q===void 0&&(q=1);var te=G.sdf;te===void 0&&(te=!1);var fe=G.stretchX,ce=G.stretchY,Te=G.content;if(this._lazyInitEmptyStyle(),B instanceof ul||xa&&B instanceof xa){var Ie=M.browser.getImageData(B);this.style.addImage(b,{data:new M.RGBAImage({width:Ie.width,height:Ie.height},Ie.data),pixelRatio:q,stretchX:fe,stretchY:ce,content:Te,sdf:te,version:0})}else{if(B.width===void 0||B.height===void 0)return this.fire(new M.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var Oe=B;this.style.addImage(b,{data:new M.RGBAImage({width:B.width,height:B.height},new Uint8Array(B.data)),pixelRatio:q,stretchX:fe,stretchY:ce,content:Te,sdf:te,version:0,userImage:Oe}),Oe.onAdd&&Oe.onAdd(this,b)}},g.prototype.updateImage=function(b,B){var G=this.style.getImage(b);if(!G)return this.fire(new M.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var q=B instanceof ul||xa&&B instanceof xa?M.browser.getImageData(B):B,te=q.width,fe=q.height,ce=q.data;return te===void 0||fe===void 0?this.fire(new M.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):te!==G.data.width||fe!==G.data.height?this.fire(new M.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(G.data.replace(ce,!(B instanceof ul||xa&&B instanceof xa)),void this.style.updateImage(b,G))},g.prototype.hasImage=function(b){return b?!!this.style.getImage(b):(this.fire(new M.ErrorEvent(new Error("Missing required image id"))),!1)},g.prototype.removeImage=function(b){this.style.removeImage(b)},g.prototype.loadImage=function(b,B){M.getImage(this._requestManager.transformRequest(b,M.ResourceType.Image),B)},g.prototype.listImages=function(){return this.style.listImages()},g.prototype.addLayer=function(b,B){return this._lazyInitEmptyStyle(),this.style.addLayer(b,B),this._update(!0)},g.prototype.moveLayer=function(b,B){return this.style.moveLayer(b,B),this._update(!0)},g.prototype.removeLayer=function(b){return this.style.removeLayer(b),this._update(!0)},g.prototype.getLayer=function(b){return this.style.getLayer(b)},g.prototype.setLayerZoomRange=function(b,B,G){return this.style.setLayerZoomRange(b,B,G),this._update(!0)},g.prototype.setFilter=function(b,B,G){return G===void 0&&(G={}),this.style.setFilter(b,B,G),this._update(!0)},g.prototype.getFilter=function(b){return this.style.getFilter(b)},g.prototype.setPaintProperty=function(b,B,G,q){return q===void 0&&(q={}),this.style.setPaintProperty(b,B,G,q),this._update(!0)},g.prototype.getPaintProperty=function(b,B){return this.style.getPaintProperty(b,B)},g.prototype.setLayoutProperty=function(b,B,G,q){return q===void 0&&(q={}),this.style.setLayoutProperty(b,B,G,q),this._update(!0)},g.prototype.getLayoutProperty=function(b,B){return this.style.getLayoutProperty(b,B)},g.prototype.setLight=function(b,B){return B===void 0&&(B={}),this._lazyInitEmptyStyle(),this.style.setLight(b,B),this._update(!0)},g.prototype.getLight=function(){return this.style.getLight()},g.prototype.setFeatureState=function(b,B){return this.style.setFeatureState(b,B),this._update()},g.prototype.removeFeatureState=function(b,B){return this.style.removeFeatureState(b,B),this._update()},g.prototype.getFeatureState=function(b){return this.style.getFeatureState(b)},g.prototype.getContainer=function(){return this._container},g.prototype.getCanvasContainer=function(){return this._canvasContainer},g.prototype.getCanvas=function(){return this._canvas},g.prototype._containerDimensions=function(){var b=0,B=0;return this._container&&(b=this._container.clientWidth||400,B=this._container.clientHeight||300),[b,B]},g.prototype._detectMissingCSS=function(){M.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&M.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},g.prototype._setupContainer=function(){var b=this._container;b.classList.add("mapboxgl-map"),(this._missingCSSCanary=de.create("div","mapboxgl-canary",b)).style.visibility="hidden",this._detectMissingCSS();var B=this._canvasContainer=de.create("div","mapboxgl-canvas-container",b);this._interactive&&B.classList.add("mapboxgl-interactive"),this._canvas=de.create("canvas","mapboxgl-canvas",B),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var G=this._containerDimensions();this._resizeCanvas(G[0],G[1]);var q=this._controlContainer=de.create("div","mapboxgl-control-container",b),te=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(fe){te[fe]=de.create("div","mapboxgl-ctrl-"+fe,q)}),this._container.addEventListener("scroll",this._onMapScroll,!1)},g.prototype._resizeCanvas=function(b,B){var G=M.browser.devicePixelRatio||1;this._canvas.width=G*b,this._canvas.height=G*B,this._canvas.style.width=b+"px",this._canvas.style.height=B+"px"},g.prototype._setupPainter=function(){var b=M.extend({},R.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),B=this._canvas.getContext("webgl",b)||this._canvas.getContext("experimental-webgl",b);B?(this.painter=new Ya(B,this.transform),M.webpSupported.testSupport(B)):this.fire(new M.ErrorEvent(new Error("Failed to initialize WebGL")))},g.prototype._contextLost=function(b){b.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new M.Event("webglcontextlost",{originalEvent:b}))},g.prototype._contextRestored=function(b){this._setupPainter(),this.resize(),this._update(),this.fire(new M.Event("webglcontextrestored",{originalEvent:b}))},g.prototype._onMapScroll=function(b){if(b.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},g.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},g.prototype._update=function(b){return this.style?(this._styleDirty=this._styleDirty||b,this._sourcesDirty=!0,this.triggerRepaint(),this):this},g.prototype._requestRenderFrame=function(b){return this._update(),this._renderTaskQueue.add(b)},g.prototype._cancelRenderFrame=function(b){this._renderTaskQueue.remove(b)},g.prototype._render=function(b){var B,G=this,q=0,te=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(B=te.createQueryEXT(),te.beginQueryEXT(te.TIME_ELAPSED_EXT,B),q=M.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(b),!this._removed){var fe=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var ce=this.transform.zoom,Te=M.browser.now();this.style.zoomHistory.update(ce,Te);var Ie=new M.EvaluationParameters(ce,{now:Te,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),Oe=Ie.crossFadingFactor();Oe===1&&Oe===this._crossFadingFactor||(fe=!0,this._crossFadingFactor=Oe),this.style.update(Ie)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new M.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new M.Event("load"))),this.style&&(this.style.hasTransitions()||fe)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var Qe=M.browser.now()-q;te.endQueryEXT(te.TIME_ELAPSED_EXT,B),setTimeout(function(){var tt=te.getQueryObjectEXT(B,te.QUERY_RESULT_EXT)/1e6;te.deleteQueryEXT(B),G.fire(new M.Event("gpu-timing-frame",{cpuTime:Qe,gpuTime:tt}))},50)}if(this.listens("gpu-timing-layer")){var nt=this.painter.collectGpuTimers();setTimeout(function(){var tt=G.painter.queryGpuTimers(nt);G.fire(new M.Event("gpu-timing-layer",{layerTimes:tt}))},50)}var ct=this._sourcesDirty||this._styleDirty||this._placementDirty;return ct||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new M.Event("idle")),!this._loaded||this._fullyLoaded||ct||(this._fullyLoaded=!0),this}},g.prototype.remove=function(){this._hash&&this._hash.remove();for(var b=0,B=this._controls;b<B.length;b+=1)B[b].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),M.window!==void 0&&(M.window.removeEventListener("resize",this._onWindowResize,!1),M.window.removeEventListener("orientationchange",this._onWindowResize,!1),M.window.removeEventListener("online",this._onWindowOnline,!1));var G=this.painter.context.gl.getExtension("WEBGL_lose_context");G&&G.loseContext(),ks(this._canvasContainer),ks(this._controlContainer),ks(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new M.Event("remove"))},g.prototype.triggerRepaint=function(){var b=this;this.style&&!this._frame&&(this._frame=M.browser.frame(function(B){b._frame=null,b._render(B)}))},g.prototype._onWindowOnline=function(){this._update()},g.prototype._onWindowResize=function(b){this._trackResize&&this.resize({originalEvent:b})._update()},d.showTileBoundaries.get=function(){return!!this._showTileBoundaries},d.showTileBoundaries.set=function(b){this._showTileBoundaries!==b&&(this._showTileBoundaries=b,this._update())},d.showPadding.get=function(){return!!this._showPadding},d.showPadding.set=function(b){this._showPadding!==b&&(this._showPadding=b,this._update())},d.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},d.showCollisionBoxes.set=function(b){this._showCollisionBoxes!==b&&(this._showCollisionBoxes=b,b?this.style._generateCollisionBoxes():this._update())},d.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},d.showOverdrawInspector.set=function(b){this._showOverdrawInspector!==b&&(this._showOverdrawInspector=b,this._update())},d.repaint.get=function(){return!!this._repaint},d.repaint.set=function(b){this._repaint!==b&&(this._repaint=b,this.triggerRepaint())},d.vertices.get=function(){return!!this._vertices},d.vertices.set=function(b){this._vertices=b,this._update()},g.prototype._setCacheLimits=function(b,B){M.setCacheLimits(b,B)},d.version.get=function(){return M.version},Object.defineProperties(g.prototype,d),g}(ji);function ks(h){h.parentNode&&h.parentNode.removeChild(h)}var _l={showCompass:!0,showZoom:!0,visualizePitch:!1},pc=function(h){var g=this;this.options=M.extend({},_l,h),this._container=de.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(d){return d.preventDefault()}),this.options.showZoom&&(M.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(d){return g._map.zoomIn({},{originalEvent:d})}),de.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(d){return g._map.zoomOut({},{originalEvent:d})}),de.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(M.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",function(d){g.options.visualizePitch?g._map.resetNorthPitch({},{originalEvent:d}):g._map.resetNorth({},{originalEvent:d})}),this._compassIcon=de.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};pc.prototype._updateZoomButtons=function(){var h=this._map.getZoom(),g=h===this._map.getMaxZoom(),d=h===this._map.getMinZoom();this._zoomInButton.disabled=g,this._zoomOutButton.disabled=d,this._zoomInButton.setAttribute("aria-disabled",g.toString()),this._zoomOutButton.setAttribute("aria-disabled",d.toString())},pc.prototype._rotateCompassArrow=function(){var h=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=h},pc.prototype.onAdd=function(h){return this._map=h,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Du(this._map,this._compass,this.options.visualizePitch)),this._container},pc.prototype.onRemove=function(){de.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},pc.prototype._createButton=function(h,g){var d=de.create("button",h,this._container);return d.type="button",d.addEventListener("click",g),d},pc.prototype._setButtonTitle=function(h,g){var d=this._map._getUIString("NavigationControl."+g);h.title=d,h.setAttribute("aria-label",d)};var Du=function(h,g,d){d===void 0&&(d=!1),this._clickTolerance=10,this.element=g,this.mouseRotate=new Op({clickTolerance:h.dragRotate._mouseRotate._clickTolerance}),this.map=h,d&&(this.mousePitch=new Jp({clickTolerance:h.dragRotate._mousePitch._clickTolerance})),M.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),de.addEventListener(g,"mousedown",this.mousedown),de.addEventListener(g,"touchstart",this.touchstart,{passive:!1}),de.addEventListener(g,"touchmove",this.touchmove),de.addEventListener(g,"touchend",this.touchend),de.addEventListener(g,"touchcancel",this.reset)};function zh(h,g,d){if(h=new M.LngLat(h.lng,h.lat),g){var b=new M.LngLat(h.lng-360,h.lat),B=new M.LngLat(h.lng+360,h.lat),G=d.locationPoint(h).distSqr(g);d.locationPoint(b).distSqr(g)<G?h=b:d.locationPoint(B).distSqr(g)<G&&(h=B)}for(;Math.abs(h.lng-d.center.lng)>180;){var q=d.locationPoint(h);if(q.x>=0&&q.y>=0&&q.x<=d.width&&q.y<=d.height)break;h.lng>d.center.lng?h.lng-=360:h.lng+=360}return h}Du.prototype.down=function(h,g){this.mouseRotate.mousedown(h,g),this.mousePitch&&this.mousePitch.mousedown(h,g),de.disableDrag()},Du.prototype.move=function(h,g){var d=this.map,b=this.mouseRotate.mousemoveWindow(h,g);if(b&&b.bearingDelta&&d.setBearing(d.getBearing()+b.bearingDelta),this.mousePitch){var B=this.mousePitch.mousemoveWindow(h,g);B&&B.pitchDelta&&d.setPitch(d.getPitch()+B.pitchDelta)}},Du.prototype.off=function(){var h=this.element;de.removeEventListener(h,"mousedown",this.mousedown),de.removeEventListener(h,"touchstart",this.touchstart,{passive:!1}),de.removeEventListener(h,"touchmove",this.touchmove),de.removeEventListener(h,"touchend",this.touchend),de.removeEventListener(h,"touchcancel",this.reset),this.offTemp()},Du.prototype.offTemp=function(){de.enableDrag(),de.removeEventListener(M.window,"mousemove",this.mousemove),de.removeEventListener(M.window,"mouseup",this.mouseup)},Du.prototype.mousedown=function(h){this.down(M.extend({},h,{ctrlKey:!0,preventDefault:function(){return h.preventDefault()}}),de.mousePos(this.element,h)),de.addEventListener(M.window,"mousemove",this.mousemove),de.addEventListener(M.window,"mouseup",this.mouseup)},Du.prototype.mousemove=function(h){this.move(h,de.mousePos(this.element,h))},Du.prototype.mouseup=function(h){this.mouseRotate.mouseupWindow(h),this.mousePitch&&this.mousePitch.mouseupWindow(h),this.offTemp()},Du.prototype.touchstart=function(h){h.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=de.touchPos(this.element,h.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return h.preventDefault()}},this._startPos))},Du.prototype.touchmove=function(h){h.targetTouches.length!==1?this.reset():(this._lastPos=de.touchPos(this.element,h.targetTouches)[0],this.move({preventDefault:function(){return h.preventDefault()}},this._lastPos))},Du.prototype.touchend=function(h){h.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Du.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Su={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function qc(h,g,d){var b=h.classList;for(var B in Su)b.remove("mapboxgl-"+d+"-anchor-"+B);b.add("mapboxgl-"+d+"-anchor-"+g)}var Sh,nc=function(h){function g(d,b){if(h.call(this),(d instanceof M.window.HTMLElement||b)&&(d=M.extend({element:d},b)),M.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=d&&d.anchor||"center",this._color=d&&d.color||"#3FB1CE",this._scale=d&&d.scale||1,this._draggable=d&&d.draggable||!1,this._clickTolerance=d&&d.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=d&&d.rotation||0,this._rotationAlignment=d&&d.rotationAlignment||"auto",this._pitchAlignment=d&&d.pitchAlignment&&d.pitchAlignment!=="auto"?d.pitchAlignment:this._rotationAlignment,d&&d.element)this._element=d.element,this._offset=M.Point.convert(d&&d.offset||[0,0]);else{this._defaultMarker=!0,this._element=de.create("div"),this._element.setAttribute("aria-label","Map marker");var B=de.createNS("http://www.w3.org/2000/svg","svg");B.setAttributeNS(null,"display","block"),B.setAttributeNS(null,"height","41px"),B.setAttributeNS(null,"width","27px"),B.setAttributeNS(null,"viewBox","0 0 27 41");var G=de.createNS("http://www.w3.org/2000/svg","g");G.setAttributeNS(null,"stroke","none"),G.setAttributeNS(null,"stroke-width","1"),G.setAttributeNS(null,"fill","none"),G.setAttributeNS(null,"fill-rule","evenodd");var q=de.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"fill-rule","nonzero");var te=de.createNS("http://www.w3.org/2000/svg","g");te.setAttributeNS(null,"transform","translate(3.0, 29.0)"),te.setAttributeNS(null,"fill","#000000");for(var fe=0,ce=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];fe<ce.length;fe+=1){var Te=ce[fe],Ie=de.createNS("http://www.w3.org/2000/svg","ellipse");Ie.setAttributeNS(null,"opacity","0.04"),Ie.setAttributeNS(null,"cx","10.5"),Ie.setAttributeNS(null,"cy","5.80029008"),Ie.setAttributeNS(null,"rx",Te.rx),Ie.setAttributeNS(null,"ry",Te.ry),te.appendChild(Ie)}var Oe=de.createNS("http://www.w3.org/2000/svg","g");Oe.setAttributeNS(null,"fill",this._color);var Qe=de.createNS("http://www.w3.org/2000/svg","path");Qe.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),Oe.appendChild(Qe);var nt=de.createNS("http://www.w3.org/2000/svg","g");nt.setAttributeNS(null,"opacity","0.25"),nt.setAttributeNS(null,"fill","#000000");var ct=de.createNS("http://www.w3.org/2000/svg","path");ct.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),nt.appendChild(ct);var tt=de.createNS("http://www.w3.org/2000/svg","g");tt.setAttributeNS(null,"transform","translate(6.0, 7.0)"),tt.setAttributeNS(null,"fill","#FFFFFF");var Tt=de.createNS("http://www.w3.org/2000/svg","g");Tt.setAttributeNS(null,"transform","translate(8.0, 8.0)");var Ut=de.createNS("http://www.w3.org/2000/svg","circle");Ut.setAttributeNS(null,"fill","#000000"),Ut.setAttributeNS(null,"opacity","0.25"),Ut.setAttributeNS(null,"cx","5.5"),Ut.setAttributeNS(null,"cy","5.5"),Ut.setAttributeNS(null,"r","5.4999962");var Nt=de.createNS("http://www.w3.org/2000/svg","circle");Nt.setAttributeNS(null,"fill","#FFFFFF"),Nt.setAttributeNS(null,"cx","5.5"),Nt.setAttributeNS(null,"cy","5.5"),Nt.setAttributeNS(null,"r","5.4999962"),Tt.appendChild(Ut),Tt.appendChild(Nt),q.appendChild(te),q.appendChild(Oe),q.appendChild(nt),q.appendChild(tt),q.appendChild(Tt),B.appendChild(q),B.setAttributeNS(null,"height",41*this._scale+"px"),B.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(B),this._offset=M.Point.convert(d&&d.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(pr){pr.preventDefault()}),this._element.addEventListener("mousedown",function(pr){pr.preventDefault()}),qc(this._element,this._anchor,"marker"),this._popup=null}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.addTo=function(d){return this.remove(),this._map=d,d.getCanvasContainer().appendChild(this._element),d.on("move",this._update),d.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},g.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),de.remove(this._element),this._popup&&this._popup.remove(),this},g.prototype.getLngLat=function(){return this._lngLat},g.prototype.setLngLat=function(d){return this._lngLat=M.LngLat.convert(d),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},g.prototype.getElement=function(){return this._element},g.prototype.setPopup=function(d){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),d){if(!("offset"in d.options)){var b=Math.sqrt(Math.pow(13.5,2)/2);d.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[b,-1*(24.6+b)],"bottom-right":[-b,-1*(24.6+b)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=d,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},g.prototype._onKeyPress=function(d){var b=d.code,B=d.charCode||d.keyCode;b!=="Space"&&b!=="Enter"&&B!==32&&B!==13||this.togglePopup()},g.prototype._onMapClick=function(d){var b=d.originalEvent.target,B=this._element;this._popup&&(b===B||B.contains(b))&&this.togglePopup()},g.prototype.getPopup=function(){return this._popup},g.prototype.togglePopup=function(){var d=this._popup;return d?(d.isOpen()?d.remove():d.addTo(this._map),this):this},g.prototype._update=function(d){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=zh(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var b="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?b="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(b="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var B="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?B="rotateX(0deg)":this._pitchAlignment==="map"&&(B="rotateX("+this._map.getPitch()+"deg)"),d&&d.type!=="moveend"||(this._pos=this._pos.round()),de.setTransform(this._element,Su[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+B+" "+b)}},g.prototype.getOffset=function(){return this._offset},g.prototype.setOffset=function(d){return this._offset=M.Point.convert(d),this._update(),this},g.prototype._onMove=function(d){if(!this._isDragging){var b=this._clickTolerance||this._map._clickTolerance;this._isDragging=d.point.dist(this._pointerdownPos)>=b}this._isDragging&&(this._pos=d.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new M.Event("dragstart"))),this.fire(new M.Event("drag")))},g.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new M.Event("dragend")),this._state="inactive"},g.prototype._addDragHandler=function(d){this._element.contains(d.originalEvent.target)&&(d.preventDefault(),this._positionDelta=d.point.sub(this._pos).add(this._offset),this._pointerdownPos=d.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},g.prototype.setDraggable=function(d){return this._draggable=!!d,this._map&&(d?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},g.prototype.isDraggable=function(){return this._draggable},g.prototype.setRotation=function(d){return this._rotation=d||0,this._update(),this},g.prototype.getRotation=function(){return this._rotation},g.prototype.setRotationAlignment=function(d){return this._rotationAlignment=d||"auto",this._update(),this},g.prototype.getRotationAlignment=function(){return this._rotationAlignment},g.prototype.setPitchAlignment=function(d){return this._pitchAlignment=d&&d!=="auto"?d:this._rotationAlignment,this._update(),this},g.prototype.getPitchAlignment=function(){return this._pitchAlignment},g}(M.Evented),Yl={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Th=0,ba=!1,z=function(h){function g(d){h.call(this),this.options=M.extend({},Yl,d),M.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.onAdd=function(d){var b;return this._map=d,this._container=de.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),b=this._setupUI,Sh!==void 0?b(Sh):M.window.navigator.permissions!==void 0?M.window.navigator.permissions.query({name:"geolocation"}).then(function(B){b(Sh=B.state!=="denied")}):b(Sh=!!M.window.navigator.geolocation),this._container},g.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(M.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),de.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Th=0,ba=!1},g.prototype._isOutOfMapMaxBounds=function(d){var b=this._map.getMaxBounds(),B=d.coords;return b&&(B.longitude<b.getWest()||B.longitude>b.getEast()||B.latitude<b.getSouth()||B.latitude>b.getNorth())},g.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},g.prototype._onSuccess=function(d){if(this._map){if(this._isOutOfMapMaxBounds(d))return this._setErrorState(),this.fire(new M.Event("outofmaxbounds",d)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=d,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(d),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(d),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new M.Event("geolocate",d)),this._finish()}},g.prototype._updateCamera=function(d){var b=new M.LngLat(d.coords.longitude,d.coords.latitude),B=d.coords.accuracy,G=this._map.getBearing(),q=M.extend({bearing:G},this.options.fitBoundsOptions);this._map.fitBounds(b.toBounds(B),q,{geolocateSource:!0})},g.prototype._updateMarker=function(d){if(d){var b=new M.LngLat(d.coords.longitude,d.coords.latitude);this._accuracyCircleMarker.setLngLat(b).addTo(this._map),this._userLocationDotMarker.setLngLat(b).addTo(this._map),this._accuracy=d.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},g.prototype._updateCircleRadius=function(){var d=this._map._container.clientHeight/2,b=this._map.unproject([0,d]),B=this._map.unproject([1,d]),G=b.distanceTo(B),q=Math.ceil(2*this._accuracy/G);this._circleElement.style.width=q+"px",this._circleElement.style.height=q+"px"},g.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},g.prototype._onError=function(d){if(this._map){if(this.options.trackUserLocation)if(d.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var b=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=b,this._geolocateButton.setAttribute("aria-label",b),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(d.code===3&&ba)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new M.Event("error",d)),this._finish()}},g.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},g.prototype._setupUI=function(d){var b=this;if(this._container.addEventListener("contextmenu",function(q){return q.preventDefault()}),this._geolocateButton=de.create("button","mapboxgl-ctrl-geolocate",this._container),de.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",d===!1){M.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var B=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=B,this._geolocateButton.setAttribute("aria-label",B)}else{var G=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=G,this._geolocateButton.setAttribute("aria-label",G)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=de.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new nc(this._dotElement),this._circleElement=de.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new nc({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(q){q.geolocateSource||b._watchState!=="ACTIVE_LOCK"||q.originalEvent&&q.originalEvent.type==="resize"||(b._watchState="BACKGROUND",b._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),b._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),b.fire(new M.Event("trackuserlocationend")))})},g.prototype.trigger=function(){if(!this._setup)return M.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new M.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Th--,ba=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new M.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new M.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var d;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Th>1?(d={maximumAge:6e5,timeout:0},ba=!0):(d=this.options.positionOptions,ba=!1),this._geolocationWatchID=M.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,d)}}else M.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},g.prototype._clearWatch=function(){M.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},g}(M.Evented),s={maxWidth:100,unit:"metric"},x=function(h){this.options=M.extend({},s,h),M.bindAll(["_onMove","setUnit"],this)};function I(h,g,d){var b=d&&d.maxWidth||100,B=h._container.clientHeight/2,G=h.unproject([0,B]),q=h.unproject([b,B]),te=G.distanceTo(q);if(d&&d.unit==="imperial"){var fe=3.2808*te;fe>5280?k(g,b,fe/5280,h._getUIString("ScaleControl.Miles")):k(g,b,fe,h._getUIString("ScaleControl.Feet"))}else d&&d.unit==="nautical"?k(g,b,te/1852,h._getUIString("ScaleControl.NauticalMiles")):te>=1e3?k(g,b,te/1e3,h._getUIString("ScaleControl.Kilometers")):k(g,b,te,h._getUIString("ScaleControl.Meters"))}function k(h,g,d,b){var B,G,q,te=(B=d,(G=Math.pow(10,(""+Math.floor(B)).length-1))*(q=(q=B/G)>=10?10:q>=5?5:q>=3?3:q>=2?2:q>=1?1:function(fe){var ce=Math.pow(10,Math.ceil(-Math.log(fe)/Math.LN10));return Math.round(fe*ce)/ce}(q)));h.style.width=g*(te/d)+"px",h.innerHTML=te+"&nbsp;"+b}x.prototype.getDefaultPosition=function(){return"bottom-left"},x.prototype._onMove=function(){I(this._map,this._container,this.options)},x.prototype.onAdd=function(h){return this._map=h,this._container=de.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",h.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},x.prototype.onRemove=function(){de.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},x.prototype.setUnit=function(h){this.options.unit=h,I(this._map,this._container,this.options)};var H=function(h){this._fullscreen=!1,h&&h.container&&(h.container instanceof M.window.HTMLElement?this._container=h.container:M.warnOnce("Full screen control 'container' must be a DOM element.")),M.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in M.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in M.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in M.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in M.window.document&&(this._fullscreenchange="MSFullscreenChange")};H.prototype.onAdd=function(h){return this._map=h,this._container||(this._container=this._map.getContainer()),this._controlContainer=de.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",M.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},H.prototype.onRemove=function(){de.remove(this._controlContainer),this._map=null,M.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},H.prototype._checkFullscreenSupport=function(){return!!(M.window.document.fullscreenEnabled||M.window.document.mozFullScreenEnabled||M.window.document.msFullscreenEnabled||M.window.document.webkitFullscreenEnabled)},H.prototype._setupUI=function(){var h=this._fullscreenButton=de.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);de.create("span","mapboxgl-ctrl-icon",h).setAttribute("aria-hidden",!0),h.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),M.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},H.prototype._updateTitle=function(){var h=this._getTitle();this._fullscreenButton.setAttribute("aria-label",h),this._fullscreenButton.title=h},H.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},H.prototype._isFullscreen=function(){return this._fullscreen},H.prototype._changeIcon=function(){(M.window.document.fullscreenElement||M.window.document.mozFullScreenElement||M.window.document.webkitFullscreenElement||M.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},H.prototype._onClickFullscreen=function(){this._isFullscreen()?M.window.document.exitFullscreen?M.window.document.exitFullscreen():M.window.document.mozCancelFullScreen?M.window.document.mozCancelFullScreen():M.window.document.msExitFullscreen?M.window.document.msExitFullscreen():M.window.document.webkitCancelFullScreen&&M.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var ee={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ne=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),ue=function(h){function g(d){h.call(this),this.options=M.extend(Object.create(ee),d),M.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.addTo=function(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new M.Event("open")),this},g.prototype.isOpen=function(){return!!this._map},g.prototype.remove=function(){return this._content&&de.remove(this._content),this._container&&(de.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new M.Event("close")),this},g.prototype.getLngLat=function(){return this._lngLat},g.prototype.setLngLat=function(d){return this._lngLat=M.LngLat.convert(d),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},g.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},g.prototype.getElement=function(){return this._container},g.prototype.setText=function(d){return this.setDOMContent(M.window.document.createTextNode(d))},g.prototype.setHTML=function(d){var b,B=M.window.document.createDocumentFragment(),G=M.window.document.createElement("body");for(G.innerHTML=d;b=G.firstChild;)B.appendChild(b);return this.setDOMContent(B)},g.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},g.prototype.setMaxWidth=function(d){return this.options.maxWidth=d,this._update(),this},g.prototype.setDOMContent=function(d){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=de.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(d),this._createCloseButton(),this._update(),this._focusFirstElement(),this},g.prototype.addClassName=function(d){this._container&&this._container.classList.add(d)},g.prototype.removeClassName=function(d){this._container&&this._container.classList.remove(d)},g.prototype.setOffset=function(d){return this.options.offset=d,this._update(),this},g.prototype.toggleClassName=function(d){if(this._container)return this._container.classList.toggle(d)},g.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=de.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))},g.prototype._onMouseUp=function(d){this._update(d.point)},g.prototype._onMouseMove=function(d){this._update(d.point)},g.prototype._onDrag=function(d){this._update(d.point)},g.prototype._update=function(d){var b=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=de.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=de.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(Ie){return b._container.classList.add(Ie)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=zh(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||d)){var B=this._pos=this._trackPointer&&d?d:this._map.project(this._lngLat),G=this.options.anchor,q=function Ie(Oe){if(Oe){if(typeof Oe=="number"){var Qe=Math.round(Math.sqrt(.5*Math.pow(Oe,2)));return{center:new M.Point(0,0),top:new M.Point(0,Oe),"top-left":new M.Point(Qe,Qe),"top-right":new M.Point(-Qe,Qe),bottom:new M.Point(0,-Oe),"bottom-left":new M.Point(Qe,-Qe),"bottom-right":new M.Point(-Qe,-Qe),left:new M.Point(Oe,0),right:new M.Point(-Oe,0)}}if(Oe instanceof M.Point||Array.isArray(Oe)){var nt=M.Point.convert(Oe);return{center:nt,top:nt,"top-left":nt,"top-right":nt,bottom:nt,"bottom-left":nt,"bottom-right":nt,left:nt,right:nt}}return{center:M.Point.convert(Oe.center||[0,0]),top:M.Point.convert(Oe.top||[0,0]),"top-left":M.Point.convert(Oe["top-left"]||[0,0]),"top-right":M.Point.convert(Oe["top-right"]||[0,0]),bottom:M.Point.convert(Oe.bottom||[0,0]),"bottom-left":M.Point.convert(Oe["bottom-left"]||[0,0]),"bottom-right":M.Point.convert(Oe["bottom-right"]||[0,0]),left:M.Point.convert(Oe.left||[0,0]),right:M.Point.convert(Oe.right||[0,0])}}return Ie(new M.Point(0,0))}(this.options.offset);if(!G){var te,fe=this._container.offsetWidth,ce=this._container.offsetHeight;te=B.y+q.bottom.y<ce?["top"]:B.y>this._map.transform.height-ce?["bottom"]:[],B.x<fe/2?te.push("left"):B.x>this._map.transform.width-fe/2&&te.push("right"),G=te.length===0?"bottom":te.join("-")}var Te=B.add(q[G]).round();de.setTransform(this._container,Su[G]+" translate("+Te.x+"px,"+Te.y+"px)"),qc(this._container,G,"popup")}},g.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var d=this._container.querySelector(ne);d&&d.focus()}},g.prototype._onClose=function(){this.remove()},g}(M.Evented),_e={version:M.version,supported:R,setRTLTextPlugin:M.setRTLTextPlugin,getRTLTextPluginStatus:M.getRTLTextPluginStatus,Map:Lu,NavigationControl:pc,GeolocateControl:z,AttributionControl:ao,ScaleControl:x,FullscreenControl:H,Popup:ue,Marker:nc,Style:Nl,LngLat:M.LngLat,LngLatBounds:M.LngLatBounds,Point:M.Point,MercatorCoordinate:M.MercatorCoordinate,Evented:M.Evented,config:M.config,prewarm:function(){Lr().acquire(mr)},clearPrewarmedResources:function(){var h=fn;h&&(h.isPreloaded()&&h.numActive()===1?(h.release(mr),fn=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return M.config.ACCESS_TOKEN},set accessToken(h){M.config.ACCESS_TOKEN=h},get baseApiUrl(){return M.config.API_URL},set baseApiUrl(h){M.config.API_URL=h},get workerCount(){return Sr.workerCount},set workerCount(h){Sr.workerCount=h},get maxParallelImageRequests(){return M.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(h){M.config.MAX_PARALLEL_IMAGE_REQUESTS=h},clearStorage:function(h){M.clearTileCache(h)},workerUrl:""};return _e}),ve})},96706:function(Zr,_r,Se){(function(){var ve=Se(1048),Ze=Se(6636).utf8,M=Se(13149),R=Se(6636).bin,de=function(be,Le){be.constructor==String?Le&&Le.encoding==="binary"?be=R.stringToBytes(be):be=Ze.stringToBytes(be):M(be)?be=Array.prototype.slice.call(be,0):!Array.isArray(be)&&be.constructor!==Uint8Array&&(be=be.toString());for(var Re=ve.bytesToWords(be),Ce=be.length*8,He=1732584193,Xe=-271733879,Ke=-1732584194,Ve=271733878,et=0;et<Re.length;et++)Re[et]=(Re[et]<<8|Re[et]>>>24)&16711935|(Re[et]<<24|Re[et]>>>8)&4278255360;Re[Ce>>>5]|=128<<Ce%32,Re[(Ce+64>>>9<<4)+14]=Ce;for(var er=de._ff,fr=de._gg,Ar=de._hh,pn=de._ii,et=0;et<Re.length;et+=16){var Kn=He,Jn=Xe,ki=Ke,pa=Ve;He=er(He,Xe,Ke,Ve,Re[et+0],7,-680876936),Ve=er(Ve,He,Xe,Ke,Re[et+1],12,-389564586),Ke=er(Ke,Ve,He,Xe,Re[et+2],17,606105819),Xe=er(Xe,Ke,Ve,He,Re[et+3],22,-1044525330),He=er(He,Xe,Ke,Ve,Re[et+4],7,-176418897),Ve=er(Ve,He,Xe,Ke,Re[et+5],12,1200080426),Ke=er(Ke,Ve,He,Xe,Re[et+6],17,-1473231341),Xe=er(Xe,Ke,Ve,He,Re[et+7],22,-45705983),He=er(He,Xe,Ke,Ve,Re[et+8],7,1770035416),Ve=er(Ve,He,Xe,Ke,Re[et+9],12,-1958414417),Ke=er(Ke,Ve,He,Xe,Re[et+10],17,-42063),Xe=er(Xe,Ke,Ve,He,Re[et+11],22,-1990404162),He=er(He,Xe,Ke,Ve,Re[et+12],7,1804603682),Ve=er(Ve,He,Xe,Ke,Re[et+13],12,-40341101),Ke=er(Ke,Ve,He,Xe,Re[et+14],17,-1502002290),Xe=er(Xe,Ke,Ve,He,Re[et+15],22,1236535329),He=fr(He,Xe,Ke,Ve,Re[et+1],5,-165796510),Ve=fr(Ve,He,Xe,Ke,Re[et+6],9,-1069501632),Ke=fr(Ke,Ve,He,Xe,Re[et+11],14,643717713),Xe=fr(Xe,Ke,Ve,He,Re[et+0],20,-373897302),He=fr(He,Xe,Ke,Ve,Re[et+5],5,-701558691),Ve=fr(Ve,He,Xe,Ke,Re[et+10],9,38016083),Ke=fr(Ke,Ve,He,Xe,Re[et+15],14,-660478335),Xe=fr(Xe,Ke,Ve,He,Re[et+4],20,-405537848),He=fr(He,Xe,Ke,Ve,Re[et+9],5,568446438),Ve=fr(Ve,He,Xe,Ke,Re[et+14],9,-1019803690),Ke=fr(Ke,Ve,He,Xe,Re[et+3],14,-187363961),Xe=fr(Xe,Ke,Ve,He,Re[et+8],20,1163531501),He=fr(He,Xe,Ke,Ve,Re[et+13],5,-1444681467),Ve=fr(Ve,He,Xe,Ke,Re[et+2],9,-51403784),Ke=fr(Ke,Ve,He,Xe,Re[et+7],14,1735328473),Xe=fr(Xe,Ke,Ve,He,Re[et+12],20,-1926607734),He=Ar(He,Xe,Ke,Ve,Re[et+5],4,-378558),Ve=Ar(Ve,He,Xe,Ke,Re[et+8],11,-2022574463),Ke=Ar(Ke,Ve,He,Xe,Re[et+11],16,1839030562),Xe=Ar(Xe,Ke,Ve,He,Re[et+14],23,-35309556),He=Ar(He,Xe,Ke,Ve,Re[et+1],4,-1530992060),Ve=Ar(Ve,He,Xe,Ke,Re[et+4],11,1272893353),Ke=Ar(Ke,Ve,He,Xe,Re[et+7],16,-155497632),Xe=Ar(Xe,Ke,Ve,He,Re[et+10],23,-1094730640),He=Ar(He,Xe,Ke,Ve,Re[et+13],4,681279174),Ve=Ar(Ve,He,Xe,Ke,Re[et+0],11,-358537222),Ke=Ar(Ke,Ve,He,Xe,Re[et+3],16,-722521979),Xe=Ar(Xe,Ke,Ve,He,Re[et+6],23,76029189),He=Ar(He,Xe,Ke,Ve,Re[et+9],4,-640364487),Ve=Ar(Ve,He,Xe,Ke,Re[et+12],11,-421815835),Ke=Ar(Ke,Ve,He,Xe,Re[et+15],16,530742520),Xe=Ar(Xe,Ke,Ve,He,Re[et+2],23,-995338651),He=pn(He,Xe,Ke,Ve,Re[et+0],6,-198630844),Ve=pn(Ve,He,Xe,Ke,Re[et+7],10,1126891415),Ke=pn(Ke,Ve,He,Xe,Re[et+14],15,-1416354905),Xe=pn(Xe,Ke,Ve,He,Re[et+5],21,-57434055),He=pn(He,Xe,Ke,Ve,Re[et+12],6,1700485571),Ve=pn(Ve,He,Xe,Ke,Re[et+3],10,-1894986606),Ke=pn(Ke,Ve,He,Xe,Re[et+10],15,-1051523),Xe=pn(Xe,Ke,Ve,He,Re[et+1],21,-2054922799),He=pn(He,Xe,Ke,Ve,Re[et+8],6,1873313359),Ve=pn(Ve,He,Xe,Ke,Re[et+15],10,-30611744),Ke=pn(Ke,Ve,He,Xe,Re[et+6],15,-1560198380),Xe=pn(Xe,Ke,Ve,He,Re[et+13],21,1309151649),He=pn(He,Xe,Ke,Ve,Re[et+4],6,-145523070),Ve=pn(Ve,He,Xe,Ke,Re[et+11],10,-1120210379),Ke=pn(Ke,Ve,He,Xe,Re[et+2],15,718787259),Xe=pn(Xe,Ke,Ve,He,Re[et+9],21,-343485551),He=He+Kn>>>0,Xe=Xe+Jn>>>0,Ke=Ke+ki>>>0,Ve=Ve+pa>>>0}return ve.endian([He,Xe,Ke,Ve])};de._ff=function(be,Le,Re,Ce,He,Xe,Ke){var Ve=be+(Le&Re|~Le&Ce)+(He>>>0)+Ke;return(Ve<<Xe|Ve>>>32-Xe)+Le},de._gg=function(be,Le,Re,Ce,He,Xe,Ke){var Ve=be+(Le&Ce|Re&~Ce)+(He>>>0)+Ke;return(Ve<<Xe|Ve>>>32-Xe)+Le},de._hh=function(be,Le,Re,Ce,He,Xe,Ke){var Ve=be+(Le^Re^Ce)+(He>>>0)+Ke;return(Ve<<Xe|Ve>>>32-Xe)+Le},de._ii=function(be,Le,Re,Ce,He,Xe,Ke){var Ve=be+(Re^(Le|~Ce))+(He>>>0)+Ke;return(Ve<<Xe|Ve>>>32-Xe)+Le},de._blocksize=16,de._digestsize=16,Zr.exports=function(be,Le){if(be==null)throw new Error("Illegal argument "+be);var Re=ve.wordsToBytes(de(be,Le));return Le&&Le.asBytes?Re:Le&&Le.asString?R.bytesToString(Re):ve.bytesToHex(Re)}})()},63713:function(Zr,_r,Se){"use strict";Zr.exports=Ze;var ve=Se(30551);function Ze(qe){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(qe)?qe:new Uint8Array(qe||0),this.pos=0,this.type=0,this.length=this.buf.length}Ze.Varint=0,Ze.Fixed64=1,Ze.Bytes=2,Ze.Fixed32=5;var M=65536*65536,R=1/M,de=12,be=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");Ze.prototype={destroy:function(){this.buf=null},readFields:function(qe,Dt,$e){for($e=$e||this.length;this.pos<$e;){var Pt=this.readVarint(),vt=Pt>>3,rr=this.pos;this.type=Pt&7,qe(vt,Dt,this),this.pos===rr&&this.skip(Pt)}return Dt},readMessage:function(qe,Dt){return this.readFields(qe,Dt,this.readVarint()+this.pos)},readFixed32:function(){var qe=xr(this.buf,this.pos);return this.pos+=4,qe},readSFixed32:function(){var qe=Jr(this.buf,this.pos);return this.pos+=4,qe},readFixed64:function(){var qe=xr(this.buf,this.pos)+xr(this.buf,this.pos+4)*M;return this.pos+=8,qe},readSFixed64:function(){var qe=xr(this.buf,this.pos)+Jr(this.buf,this.pos+4)*M;return this.pos+=8,qe},readFloat:function(){var qe=ve.read(this.buf,this.pos,!0,23,4);return this.pos+=4,qe},readDouble:function(){var qe=ve.read(this.buf,this.pos,!0,52,8);return this.pos+=8,qe},readVarint:function(qe){var Dt=this.buf,$e,Pt;return Pt=Dt[this.pos++],$e=Pt&127,Pt<128||(Pt=Dt[this.pos++],$e|=(Pt&127)<<7,Pt<128)||(Pt=Dt[this.pos++],$e|=(Pt&127)<<14,Pt<128)||(Pt=Dt[this.pos++],$e|=(Pt&127)<<21,Pt<128)?$e:(Pt=Dt[this.pos],$e|=(Pt&15)<<28,Le($e,qe,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var qe=this.readVarint();return qe%2===1?(qe+1)/-2:qe/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var qe=this.readVarint()+this.pos,Dt=this.pos;return this.pos=qe,qe-Dt>=de&&be?rn(this.buf,Dt,qe):gr(this.buf,Dt,qe)},readBytes:function(){var qe=this.readVarint()+this.pos,Dt=this.buf.subarray(this.pos,qe);return this.pos=qe,Dt},readPackedVarint:function(qe,Dt){if(this.type!==Ze.Bytes)return qe.push(this.readVarint(Dt));var $e=Re(this);for(qe=qe||[];this.pos<$e;)qe.push(this.readVarint(Dt));return qe},readPackedSVarint:function(qe){if(this.type!==Ze.Bytes)return qe.push(this.readSVarint());var Dt=Re(this);for(qe=qe||[];this.pos<Dt;)qe.push(this.readSVarint());return qe},readPackedBoolean:function(qe){if(this.type!==Ze.Bytes)return qe.push(this.readBoolean());var Dt=Re(this);for(qe=qe||[];this.pos<Dt;)qe.push(this.readBoolean());return qe},readPackedFloat:function(qe){if(this.type!==Ze.Bytes)return qe.push(this.readFloat());var Dt=Re(this);for(qe=qe||[];this.pos<Dt;)qe.push(this.readFloat());return qe},readPackedDouble:function(qe){if(this.type!==Ze.Bytes)return qe.push(this.readDouble());var Dt=Re(this);for(qe=qe||[];this.pos<Dt;)qe.push(this.readDouble());return qe},readPackedFixed32:function(qe){if(this.type!==Ze.Bytes)return qe.push(this.readFixed32());var Dt=Re(this);for(qe=qe||[];this.pos<Dt;)qe.push(this.readFixed32());return qe},readPackedSFixed32:function(qe){if(this.type!==Ze.Bytes)return qe.push(this.readSFixed32());var Dt=Re(this);for(qe=qe||[];this.pos<Dt;)qe.push(this.readSFixed32());return qe},readPackedFixed64:function(qe){if(this.type!==Ze.Bytes)return qe.push(this.readFixed64());var Dt=Re(this);for(qe=qe||[];this.pos<Dt;)qe.push(this.readFixed64());return qe},readPackedSFixed64:function(qe){if(this.type!==Ze.Bytes)return qe.push(this.readSFixed64());var Dt=Re(this);for(qe=qe||[];this.pos<Dt;)qe.push(this.readSFixed64());return qe},skip:function(qe){var Dt=qe&7;if(Dt===Ze.Varint)for(;this.buf[this.pos++]>127;);else if(Dt===Ze.Bytes)this.pos=this.readVarint()+this.pos;else if(Dt===Ze.Fixed32)this.pos+=4;else if(Dt===Ze.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+Dt)},writeTag:function(qe,Dt){this.writeVarint(qe<<3|Dt)},realloc:function(qe){for(var Dt=this.length||16;Dt<this.pos+qe;)Dt*=2;if(Dt!==this.length){var $e=new Uint8Array(Dt);$e.set(this.buf),this.buf=$e,this.length=Dt}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(qe){this.realloc(4),jt(this.buf,qe,this.pos),this.pos+=4},writeSFixed32:function(qe){this.realloc(4),jt(this.buf,qe,this.pos),this.pos+=4},writeFixed64:function(qe){this.realloc(8),jt(this.buf,qe&-1,this.pos),jt(this.buf,Math.floor(qe*R),this.pos+4),this.pos+=8},writeSFixed64:function(qe){this.realloc(8),jt(this.buf,qe&-1,this.pos),jt(this.buf,Math.floor(qe*R),this.pos+4),this.pos+=8},writeVarint:function(qe){if(qe=+qe||0,qe>268435455||qe<0){He(qe,this);return}this.realloc(4),this.buf[this.pos++]=qe&127|(qe>127?128:0),!(qe<=127)&&(this.buf[this.pos++]=(qe>>>=7)&127|(qe>127?128:0),!(qe<=127)&&(this.buf[this.pos++]=(qe>>>=7)&127|(qe>127?128:0),!(qe<=127)&&(this.buf[this.pos++]=qe>>>7&127)))},writeSVarint:function(qe){this.writeVarint(qe<0?-qe*2-1:qe*2)},writeBoolean:function(qe){this.writeVarint(!!qe)},writeString:function(qe){qe=String(qe),this.realloc(qe.length*4),this.pos++;var Dt=this.pos;this.pos=jn(this.buf,qe,this.pos);var $e=this.pos-Dt;$e>=128&&Ve(Dt,$e,this),this.pos=Dt-1,this.writeVarint($e),this.pos+=$e},writeFloat:function(qe){this.realloc(4),ve.write(this.buf,qe,this.pos,!0,23,4),this.pos+=4},writeDouble:function(qe){this.realloc(8),ve.write(this.buf,qe,this.pos,!0,52,8),this.pos+=8},writeBytes:function(qe){var Dt=qe.length;this.writeVarint(Dt),this.realloc(Dt);for(var $e=0;$e<Dt;$e++)this.buf[this.pos++]=qe[$e]},writeRawMessage:function(qe,Dt){this.pos++;var $e=this.pos;qe(Dt,this);var Pt=this.pos-$e;Pt>=128&&Ve($e,Pt,this),this.pos=$e-1,this.writeVarint(Pt),this.pos+=Pt},writeMessage:function(qe,Dt,$e){this.writeTag(qe,Ze.Bytes),this.writeRawMessage(Dt,$e)},writePackedVarint:function(qe,Dt){Dt.length&&this.writeMessage(qe,et,Dt)},writePackedSVarint:function(qe,Dt){Dt.length&&this.writeMessage(qe,er,Dt)},writePackedBoolean:function(qe,Dt){Dt.length&&this.writeMessage(qe,pn,Dt)},writePackedFloat:function(qe,Dt){Dt.length&&this.writeMessage(qe,fr,Dt)},writePackedDouble:function(qe,Dt){Dt.length&&this.writeMessage(qe,Ar,Dt)},writePackedFixed32:function(qe,Dt){Dt.length&&this.writeMessage(qe,Kn,Dt)},writePackedSFixed32:function(qe,Dt){Dt.length&&this.writeMessage(qe,Jn,Dt)},writePackedFixed64:function(qe,Dt){Dt.length&&this.writeMessage(qe,ki,Dt)},writePackedSFixed64:function(qe,Dt){Dt.length&&this.writeMessage(qe,pa,Dt)},writeBytesField:function(qe,Dt){this.writeTag(qe,Ze.Bytes),this.writeBytes(Dt)},writeFixed32Field:function(qe,Dt){this.writeTag(qe,Ze.Fixed32),this.writeFixed32(Dt)},writeSFixed32Field:function(qe,Dt){this.writeTag(qe,Ze.Fixed32),this.writeSFixed32(Dt)},writeFixed64Field:function(qe,Dt){this.writeTag(qe,Ze.Fixed64),this.writeFixed64(Dt)},writeSFixed64Field:function(qe,Dt){this.writeTag(qe,Ze.Fixed64),this.writeSFixed64(Dt)},writeVarintField:function(qe,Dt){this.writeTag(qe,Ze.Varint),this.writeVarint(Dt)},writeSVarintField:function(qe,Dt){this.writeTag(qe,Ze.Varint),this.writeSVarint(Dt)},writeStringField:function(qe,Dt){this.writeTag(qe,Ze.Bytes),this.writeString(Dt)},writeFloatField:function(qe,Dt){this.writeTag(qe,Ze.Fixed32),this.writeFloat(Dt)},writeDoubleField:function(qe,Dt){this.writeTag(qe,Ze.Fixed64),this.writeDouble(Dt)},writeBooleanField:function(qe,Dt){this.writeVarintField(qe,!!Dt)}};function Le(qe,Dt,$e){var Pt=$e.buf,vt,rr;if(rr=Pt[$e.pos++],vt=(rr&112)>>4,rr<128||(rr=Pt[$e.pos++],vt|=(rr&127)<<3,rr<128)||(rr=Pt[$e.pos++],vt|=(rr&127)<<10,rr<128)||(rr=Pt[$e.pos++],vt|=(rr&127)<<17,rr<128)||(rr=Pt[$e.pos++],vt|=(rr&127)<<24,rr<128)||(rr=Pt[$e.pos++],vt|=(rr&1)<<31,rr<128))return Ce(qe,vt,Dt);throw new Error("Expected varint not more than 10 bytes")}function Re(qe){return qe.type===Ze.Bytes?qe.readVarint()+qe.pos:qe.pos+1}function Ce(qe,Dt,$e){return $e?Dt*4294967296+(qe>>>0):(Dt>>>0)*4294967296+(qe>>>0)}function He(qe,Dt){var $e,Pt;if(qe>=0?($e=qe%4294967296|0,Pt=qe/4294967296|0):($e=~(-qe%4294967296),Pt=~(-qe/4294967296),$e^4294967295?$e=$e+1|0:($e=0,Pt=Pt+1|0)),qe>=18446744073709552e3||qe<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");Dt.realloc(10),Xe($e,Pt,Dt),Ke(Pt,Dt)}function Xe(qe,Dt,$e){$e.buf[$e.pos++]=qe&127|128,qe>>>=7,$e.buf[$e.pos++]=qe&127|128,qe>>>=7,$e.buf[$e.pos++]=qe&127|128,qe>>>=7,$e.buf[$e.pos++]=qe&127|128,qe>>>=7,$e.buf[$e.pos]=qe&127}function Ke(qe,Dt){var $e=(qe&7)<<4;Dt.buf[Dt.pos++]|=$e|((qe>>>=3)?128:0),qe&&(Dt.buf[Dt.pos++]=qe&127|((qe>>>=7)?128:0),qe&&(Dt.buf[Dt.pos++]=qe&127|((qe>>>=7)?128:0),qe&&(Dt.buf[Dt.pos++]=qe&127|((qe>>>=7)?128:0),qe&&(Dt.buf[Dt.pos++]=qe&127|((qe>>>=7)?128:0),qe&&(Dt.buf[Dt.pos++]=qe&127)))))}function Ve(qe,Dt,$e){var Pt=Dt<=16383?1:Dt<=2097151?2:Dt<=268435455?3:Math.floor(Math.log(Dt)/(Math.LN2*7));$e.realloc(Pt);for(var vt=$e.pos-1;vt>=qe;vt--)$e.buf[vt+Pt]=$e.buf[vt]}function et(qe,Dt){for(var $e=0;$e<qe.length;$e++)Dt.writeVarint(qe[$e])}function er(qe,Dt){for(var $e=0;$e<qe.length;$e++)Dt.writeSVarint(qe[$e])}function fr(qe,Dt){for(var $e=0;$e<qe.length;$e++)Dt.writeFloat(qe[$e])}function Ar(qe,Dt){for(var $e=0;$e<qe.length;$e++)Dt.writeDouble(qe[$e])}function pn(qe,Dt){for(var $e=0;$e<qe.length;$e++)Dt.writeBoolean(qe[$e])}function Kn(qe,Dt){for(var $e=0;$e<qe.length;$e++)Dt.writeFixed32(qe[$e])}function Jn(qe,Dt){for(var $e=0;$e<qe.length;$e++)Dt.writeSFixed32(qe[$e])}function ki(qe,Dt){for(var $e=0;$e<qe.length;$e++)Dt.writeFixed64(qe[$e])}function pa(qe,Dt){for(var $e=0;$e<qe.length;$e++)Dt.writeSFixed64(qe[$e])}function xr(qe,Dt){return(qe[Dt]|qe[Dt+1]<<8|qe[Dt+2]<<16)+qe[Dt+3]*16777216}function jt(qe,Dt,$e){qe[$e]=Dt,qe[$e+1]=Dt>>>8,qe[$e+2]=Dt>>>16,qe[$e+3]=Dt>>>24}function Jr(qe,Dt){return(qe[Dt]|qe[Dt+1]<<8|qe[Dt+2]<<16)+(qe[Dt+3]<<24)}function gr(qe,Dt,$e){for(var Pt="",vt=Dt;vt<$e;){var rr=qe[vt],ar=null,wr=rr>239?4:rr>223?3:rr>191?2:1;if(vt+wr>$e)break;var Cr,an,yi;wr===1?rr<128&&(ar=rr):wr===2?(Cr=qe[vt+1],(Cr&192)===128&&(ar=(rr&31)<<6|Cr&63,ar<=127&&(ar=null))):wr===3?(Cr=qe[vt+1],an=qe[vt+2],(Cr&192)===128&&(an&192)===128&&(ar=(rr&15)<<12|(Cr&63)<<6|an&63,(ar<=2047||ar>=55296&&ar<=57343)&&(ar=null))):wr===4&&(Cr=qe[vt+1],an=qe[vt+2],yi=qe[vt+3],(Cr&192)===128&&(an&192)===128&&(yi&192)===128&&(ar=(rr&15)<<18|(Cr&63)<<12|(an&63)<<6|yi&63,(ar<=65535||ar>=1114112)&&(ar=null))),ar===null?(ar=65533,wr=1):ar>65535&&(ar-=65536,Pt+=String.fromCharCode(ar>>>10&1023|55296),ar=56320|ar&1023),Pt+=String.fromCharCode(ar),vt+=wr}return Pt}function rn(qe,Dt,$e){return be.decode(qe.subarray(Dt,$e))}function jn(qe,Dt,$e){for(var Pt=0,vt,rr;Pt<Dt.length;Pt++){if(vt=Dt.charCodeAt(Pt),vt>55295&&vt<57344)if(rr)if(vt<56320){qe[$e++]=239,qe[$e++]=191,qe[$e++]=189,rr=vt;continue}else vt=rr-55296<<10|vt-56320|65536,rr=null;else{vt>56319||Pt+1===Dt.length?(qe[$e++]=239,qe[$e++]=191,qe[$e++]=189):rr=vt;continue}else rr&&(qe[$e++]=239,qe[$e++]=191,qe[$e++]=189,rr=null);vt<128?qe[$e++]=vt:(vt<2048?qe[$e++]=vt>>6|192:(vt<65536?qe[$e++]=vt>>12|224:(qe[$e++]=vt>>18|240,qe[$e++]=vt>>12&63|128),qe[$e++]=vt>>6&63|128),qe[$e++]=vt&63|128)}return $e}},23167:function(Zr,_r,Se){var ve=Se(14224);(function(Ze,M){Zr.exports=M()})(this,function(){"use strict";function Ze(dr,he){if(!(dr instanceof he))throw new TypeError("Cannot call a class as a function")}function M(dr,he){for(var We=0;We<he.length;We++){var at=he[We];at.enumerable=at.enumerable||!1,at.configurable=!0,"value"in at&&(at.writable=!0),Object.defineProperty(dr,at.key,at)}}function R(dr,he,We){return he&&M(dr.prototype,he),We&&M(dr,We),dr}var de=function(){function dr(he,We){this.next=null,this.key=he,this.data=We,this.left=null,this.right=null}return dr}();function be(dr,he){return dr>he?1:dr<he?-1:0}function Le(dr,he,We){for(var at=new de(null,null),Ot=at,or=at;;){var Wr=We(dr,he.key);if(Wr<0){if(he.left===null)break;if(We(dr,he.left.key)<0){var In=he.left;if(he.left=In.right,In.right=he,he=In,he.left===null)break}or.left=he,or=he,he=he.left}else if(Wr>0){if(he.right===null)break;if(We(dr,he.right.key)>0){var In=he.right;if(he.right=In.left,In.left=he,he=In,he.right===null)break}Ot.right=he,Ot=he,he=he.right}else break}return Ot.right=he.left,or.left=he.right,he.left=at.right,he.right=at.left,he}function Re(dr,he,We,at){var Ot=new de(dr,he);if(We===null)return Ot.left=Ot.right=null,Ot;We=Le(dr,We,at);var or=at(dr,We.key);return or<0?(Ot.left=We.left,Ot.right=We,We.left=null):or>=0&&(Ot.right=We.right,Ot.left=We,We.right=null),Ot}function Ce(dr,he,We){var at=null,Ot=null;if(he){he=Le(dr,he,We);var or=We(he.key,dr);or===0?(at=he.left,Ot=he.right):or<0?(Ot=he.right,he.right=null,at=he):(at=he.left,he.left=null,Ot=he)}return{left:at,right:Ot}}function He(dr,he,We){return he===null?dr:(dr===null||(he=Le(dr.key,he,We),he.left=dr),he)}function Xe(dr,he,We,at,Ot){if(dr){at(""+he+(We?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+Ot(dr)+`
`);var or=he+(We?" ":"\u2502 ");dr.left&&Xe(dr.left,or,!1,at,Ot),dr.right&&Xe(dr.right,or,!0,at,Ot)}}var Ke=function(){function dr(he){he===void 0&&(he=be),this._root=null,this._size=0,this._comparator=he}return dr.prototype.insert=function(he,We){return this._size++,this._root=Re(he,We,this._root,this._comparator)},dr.prototype.add=function(he,We){var at=new de(he,We);this._root===null&&(at.left=at.right=null,this._size++,this._root=at);var Ot=this._comparator,or=Le(he,this._root,Ot),Wr=Ot(he,or.key);return Wr===0?this._root=or:(Wr<0?(at.left=or.left,at.right=or,or.left=null):Wr>0&&(at.right=or.right,at.left=or,or.right=null),this._size++,this._root=at),this._root},dr.prototype.remove=function(he){this._root=this._remove(he,this._root,this._comparator)},dr.prototype._remove=function(he,We,at){var Ot;if(We===null)return null;We=Le(he,We,at);var or=at(he,We.key);return or===0?(We.left===null?Ot=We.right:(Ot=Le(he,We.left,at),Ot.right=We.right),this._size--,Ot):We},dr.prototype.pop=function(){var he=this._root;if(he){for(;he.left;)he=he.left;return this._root=Le(he.key,this._root,this._comparator),this._root=this._remove(he.key,this._root,this._comparator),{key:he.key,data:he.data}}return null},dr.prototype.findStatic=function(he){for(var We=this._root,at=this._comparator;We;){var Ot=at(he,We.key);if(Ot===0)return We;Ot<0?We=We.left:We=We.right}return null},dr.prototype.find=function(he){return this._root&&(this._root=Le(he,this._root,this._comparator),this._comparator(he,this._root.key)!==0)?null:this._root},dr.prototype.contains=function(he){for(var We=this._root,at=this._comparator;We;){var Ot=at(he,We.key);if(Ot===0)return!0;Ot<0?We=We.left:We=We.right}return!1},dr.prototype.forEach=function(he,We){for(var at=this._root,Ot=[],or=!1;!or;)at!==null?(Ot.push(at),at=at.left):Ot.length!==0?(at=Ot.pop(),he.call(We,at),at=at.right):or=!0;return this},dr.prototype.range=function(he,We,at,Ot){for(var or=[],Wr=this._comparator,In=this._root,kn;or.length!==0||In;)if(In)or.push(In),In=In.left;else{if(In=or.pop(),kn=Wr(In.key,We),kn>0)break;if(Wr(In.key,he)>=0&&at.call(Ot,In))return this;In=In.right}return this},dr.prototype.keys=function(){var he=[];return this.forEach(function(We){var at=We.key;return he.push(at)}),he},dr.prototype.values=function(){var he=[];return this.forEach(function(We){var at=We.data;return he.push(at)}),he},dr.prototype.min=function(){return this._root?this.minNode(this._root).key:null},dr.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},dr.prototype.minNode=function(he){if(he===void 0&&(he=this._root),he)for(;he.left;)he=he.left;return he},dr.prototype.maxNode=function(he){if(he===void 0&&(he=this._root),he)for(;he.right;)he=he.right;return he},dr.prototype.at=function(he){for(var We=this._root,at=!1,Ot=0,or=[];!at;)if(We)or.push(We),We=We.left;else if(or.length>0){if(We=or.pop(),Ot===he)return We;Ot++,We=We.right}else at=!0;return null},dr.prototype.next=function(he){var We=this._root,at=null;if(he.right){for(at=he.right;at.left;)at=at.left;return at}for(var Ot=this._comparator;We;){var or=Ot(he.key,We.key);if(or===0)break;or<0?(at=We,We=We.left):We=We.right}return at},dr.prototype.prev=function(he){var We=this._root,at=null;if(he.left!==null){for(at=he.left;at.right;)at=at.right;return at}for(var Ot=this._comparator;We;){var or=Ot(he.key,We.key);if(or===0)break;or<0?We=We.left:(at=We,We=We.right)}return at},dr.prototype.clear=function(){return this._root=null,this._size=0,this},dr.prototype.toList=function(){return er(this._root)},dr.prototype.load=function(he,We,at){We===void 0&&(We=[]),at===void 0&&(at=!1);var Ot=he.length,or=this._comparator;if(at&&pn(he,We,0,Ot-1,or),this._root===null)this._root=Ve(he,We,0,Ot),this._size=Ot;else{var Wr=Ar(this.toList(),et(he,We),or);Ot=this._size+Ot,this._root=fr({head:Wr},0,Ot)}return this},dr.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(dr.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(dr.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),dr.prototype.toString=function(he){he===void 0&&(he=function(Ot){return String(Ot.key)});var We=[];return Xe(this._root,"",!0,function(at){return We.push(at)},he),We.join("")},dr.prototype.update=function(he,We,at){var Ot=this._comparator,or=Ce(he,this._root,Ot),Wr=or.left,In=or.right;Ot(he,We)<0?In=Re(We,at,In,Ot):Wr=Re(We,at,Wr,Ot),this._root=He(Wr,In,Ot)},dr.prototype.split=function(he){return Ce(he,this._root,this._comparator)},dr}();function Ve(dr,he,We,at){var Ot=at-We;if(Ot>0){var or=We+Math.floor(Ot/2),Wr=dr[or],In=he[or],kn=new de(Wr,In);return kn.left=Ve(dr,he,We,or),kn.right=Ve(dr,he,or+1,at),kn}return null}function et(dr,he){for(var We=new de(null,null),at=We,Ot=0;Ot<dr.length;Ot++)at=at.next=new de(dr[Ot],he[Ot]);return at.next=null,We.next}function er(dr){for(var he=dr,We=[],at=!1,Ot=new de(null,null),or=Ot;!at;)he?(We.push(he),he=he.left):We.length>0?(he=or=or.next=We.pop(),he=he.right):at=!0;return or.next=null,Ot.next}function fr(dr,he,We){var at=We-he;if(at>0){var Ot=he+Math.floor(at/2),or=fr(dr,he,Ot),Wr=dr.head;return Wr.left=or,dr.head=dr.head.next,Wr.right=fr(dr,Ot+1,We),Wr}return null}function Ar(dr,he,We){for(var at=new de(null,null),Ot=at,or=dr,Wr=he;or!==null&&Wr!==null;)We(or.key,Wr.key)<0?(Ot.next=or,or=or.next):(Ot.next=Wr,Wr=Wr.next),Ot=Ot.next;return or!==null?Ot.next=or:Wr!==null&&(Ot.next=Wr),at.next}function pn(dr,he,We,at,Ot){if(!(We>=at)){for(var or=dr[We+at>>1],Wr=We-1,In=at+1;;){do Wr++;while(Ot(dr[Wr],or)<0);do In--;while(Ot(dr[In],or)>0);if(Wr>=In)break;var kn=dr[Wr];dr[Wr]=dr[In],dr[In]=kn,kn=he[Wr],he[Wr]=he[In],he[In]=kn}pn(dr,he,We,In,Ot),pn(dr,he,In+1,at,Ot)}}var Kn=function(he,We){return he.ll.x<=We.x&&We.x<=he.ur.x&&he.ll.y<=We.y&&We.y<=he.ur.y},Jn=function(he,We){if(We.ur.x<he.ll.x||he.ur.x<We.ll.x||We.ur.y<he.ll.y||he.ur.y<We.ll.y)return null;var at=he.ll.x<We.ll.x?We.ll.x:he.ll.x,Ot=he.ur.x<We.ur.x?he.ur.x:We.ur.x,or=he.ll.y<We.ll.y?We.ll.y:he.ll.y,Wr=he.ur.y<We.ur.y?he.ur.y:We.ur.y;return{ll:{x:at,y:or},ur:{x:Ot,y:Wr}}},ki=Number.EPSILON;ki===void 0&&(ki=Math.pow(2,-52));var pa=ki*ki,xr=function(he,We){if(-ki<he&&he<ki&&-ki<We&&We<ki)return 0;var at=he-We;return at*at<pa*he*We?0:he<We?-1:1},jt=function(){function dr(){Ze(this,dr),this.reset()}return R(dr,[{key:"reset",value:function(){this.xRounder=new Jr,this.yRounder=new Jr}},{key:"round",value:function(We,at){return{x:this.xRounder.round(We),y:this.yRounder.round(at)}}}]),dr}(),Jr=function(){function dr(){Ze(this,dr),this.tree=new Ke,this.round(0)}return R(dr,[{key:"round",value:function(We){var at=this.tree.add(We),Ot=this.tree.prev(at);if(Ot!==null&&xr(at.key,Ot.key)===0)return this.tree.remove(We),Ot.key;var or=this.tree.next(at);return or!==null&&xr(at.key,or.key)===0?(this.tree.remove(We),or.key):We}}]),dr}(),gr=new jt,rn=function(he,We){return he.x*We.y-he.y*We.x},jn=function(he,We){return he.x*We.x+he.y*We.y},qe=function(he,We,at){var Ot={x:We.x-he.x,y:We.y-he.y},or={x:at.x-he.x,y:at.y-he.y},Wr=rn(Ot,or);return xr(Wr,0)},Dt=function(he){return Math.sqrt(jn(he,he))},$e=function(he,We,at){var Ot={x:We.x-he.x,y:We.y-he.y},or={x:at.x-he.x,y:at.y-he.y};return rn(or,Ot)/Dt(or)/Dt(Ot)},Pt=function(he,We,at){var Ot={x:We.x-he.x,y:We.y-he.y},or={x:at.x-he.x,y:at.y-he.y};return jn(or,Ot)/Dt(or)/Dt(Ot)},vt=function(he,We,at){return We.y===0?null:{x:he.x+We.x/We.y*(at-he.y),y:at}},rr=function(he,We,at){return We.x===0?null:{x:at,y:he.y+We.y/We.x*(at-he.x)}},ar=function(he,We,at,Ot){if(We.x===0)return rr(at,Ot,he.x);if(Ot.x===0)return rr(he,We,at.x);if(We.y===0)return vt(at,Ot,he.y);if(Ot.y===0)return vt(he,We,at.y);var or=rn(We,Ot);if(or==0)return null;var Wr={x:at.x-he.x,y:at.y-he.y},In=rn(Wr,We)/or,kn=rn(Wr,Ot)/or,eo=he.x+kn*We.x,un=at.x+In*Ot.x,To=he.y+kn*We.y,Ti=at.y+In*Ot.y,Lo=(eo+un)/2,wa=(To+Ti)/2;return{x:Lo,y:wa}},wr=function(){R(dr,null,[{key:"compare",value:function(We,at){var Ot=dr.comparePoints(We.point,at.point);return Ot!==0?Ot:(We.point!==at.point&&We.link(at),We.isLeft!==at.isLeft?We.isLeft?1:-1:an.compare(We.segment,at.segment))}},{key:"comparePoints",value:function(We,at){return We.x<at.x?-1:We.x>at.x?1:We.y<at.y?-1:We.y>at.y?1:0}}]);function dr(he,We){Ze(this,dr),he.events===void 0?he.events=[this]:he.events.push(this),this.point=he,this.isLeft=We}return R(dr,[{key:"link",value:function(We){if(We.point===this.point)throw new Error("Tried to link already linked events");for(var at=We.point.events,Ot=0,or=at.length;Ot<or;Ot++){var Wr=at[Ot];this.point.events.push(Wr),Wr.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var We=this.point.events.length,at=0;at<We;at++){var Ot=this.point.events[at];if(Ot.segment.consumedBy===void 0)for(var or=at+1;or<We;or++){var Wr=this.point.events[or];Wr.consumedBy===void 0&&Ot.otherSE.point.events===Wr.otherSE.point.events&&Ot.segment.consume(Wr.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var We=[],at=0,Ot=this.point.events.length;at<Ot;at++){var or=this.point.events[at];or!==this&&!or.segment.ringOut&&or.segment.isInResult()&&We.push(or)}return We}},{key:"getLeftmostComparator",value:function(We){var at=this,Ot=new Map,or=function(In){var kn=In.otherSE;Ot.set(In,{sine:$e(at.point,We.point,kn.point),cosine:Pt(at.point,We.point,kn.point)})};return function(Wr,In){Ot.has(Wr)||or(Wr),Ot.has(In)||or(In);var kn=Ot.get(Wr),eo=kn.sine,un=kn.cosine,To=Ot.get(In),Ti=To.sine,Lo=To.cosine;return eo>=0&&Ti>=0?un<Lo?1:un>Lo?-1:0:eo<0&&Ti<0?un<Lo?-1:un>Lo?1:0:Ti<eo?-1:Ti>eo?1:0}}}]),dr}(),Cr=0,an=function(){R(dr,null,[{key:"compare",value:function(We,at){var Ot=We.leftSE.point.x,or=at.leftSE.point.x,Wr=We.rightSE.point.x,In=at.rightSE.point.x;if(In<Ot)return 1;if(Wr<or)return-1;var kn=We.leftSE.point.y,eo=at.leftSE.point.y,un=We.rightSE.point.y,To=at.rightSE.point.y;if(Ot<or){if(eo<kn&&eo<un)return 1;if(eo>kn&&eo>un)return-1;var Ti=We.comparePoint(at.leftSE.point);if(Ti<0)return 1;if(Ti>0)return-1;var Lo=at.comparePoint(We.rightSE.point);return Lo!==0?Lo:-1}if(Ot>or){if(kn<eo&&kn<To)return-1;if(kn>eo&&kn>To)return 1;var wa=at.comparePoint(We.leftSE.point);if(wa!==0)return wa;var dn=We.comparePoint(at.rightSE.point);return dn<0?1:dn>0?-1:1}if(kn<eo)return-1;if(kn>eo)return 1;if(Wr<In){var co=at.comparePoint(We.rightSE.point);if(co!==0)return co}if(Wr>In){var no=We.comparePoint(at.rightSE.point);if(no<0)return 1;if(no>0)return-1}if(Wr!==In){var Za=un-kn,ms=Wr-Ot,Ji=To-eo,Us=In-or;if(Za>ms&&Ji<Us)return 1;if(Za<ms&&Ji>Us)return-1}return Wr>In?1:Wr<In||un<To?-1:un>To?1:We.id<at.id?-1:We.id>at.id?1:0}}]);function dr(he,We,at,Ot){Ze(this,dr),this.id=++Cr,this.leftSE=he,he.segment=this,he.otherSE=We,this.rightSE=We,We.segment=this,We.otherSE=he,this.rings=at,this.windings=Ot}return R(dr,[{key:"replaceRightSE",value:function(We){this.rightSE=We,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var We=this.leftSE.point.y,at=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:We<at?We:at},ur:{x:this.rightSE.point.x,y:We>at?We:at}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(We){return We.x===this.leftSE.point.x&&We.y===this.leftSE.point.y||We.x===this.rightSE.point.x&&We.y===this.rightSE.point.y}},{key:"comparePoint",value:function(We){if(this.isAnEndpoint(We))return 0;var at=this.leftSE.point,Ot=this.rightSE.point,or=this.vector();if(at.x===Ot.x)return We.x===at.x?0:We.x<at.x?1:-1;var Wr=(We.y-at.y)/or.y,In=at.x+Wr*or.x;if(We.x===In)return 0;var kn=(We.x-at.x)/or.x,eo=at.y+kn*or.y;return We.y===eo?0:We.y<eo?-1:1}},{key:"getIntersection",value:function(We){var at=this.bbox(),Ot=We.bbox(),or=Jn(at,Ot);if(or===null)return null;var Wr=this.leftSE.point,In=this.rightSE.point,kn=We.leftSE.point,eo=We.rightSE.point,un=Kn(at,kn)&&this.comparePoint(kn)===0,To=Kn(Ot,Wr)&&We.comparePoint(Wr)===0,Ti=Kn(at,eo)&&this.comparePoint(eo)===0,Lo=Kn(Ot,In)&&We.comparePoint(In)===0;if(To&&un)return Lo&&!Ti?In:!Lo&&Ti?eo:null;if(To)return Ti&&Wr.x===eo.x&&Wr.y===eo.y?null:Wr;if(un)return Lo&&In.x===kn.x&&In.y===kn.y?null:kn;if(Lo&&Ti)return null;if(Lo)return In;if(Ti)return eo;var wa=ar(Wr,this.vector(),kn,We.vector());return wa===null||!Kn(or,wa)?null:gr.round(wa.x,wa.y)}},{key:"split",value:function(We){var at=[],Ot=We.events!==void 0,or=new wr(We,!0),Wr=new wr(We,!1),In=this.rightSE;this.replaceRightSE(Wr),at.push(Wr),at.push(or);var kn=new dr(or,In,this.rings.slice(),this.windings.slice());return wr.comparePoints(kn.leftSE.point,kn.rightSE.point)>0&&kn.swapEvents(),wr.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),Ot&&(or.checkForConsuming(),Wr.checkForConsuming()),at}},{key:"swapEvents",value:function(){var We=this.rightSE;this.rightSE=this.leftSE,this.leftSE=We,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var at=0,Ot=this.windings.length;at<Ot;at++)this.windings[at]*=-1}},{key:"consume",value:function(We){for(var at=this,Ot=We;at.consumedBy;)at=at.consumedBy;for(;Ot.consumedBy;)Ot=Ot.consumedBy;var or=dr.compare(at,Ot);if(or!==0){if(or>0){var Wr=at;at=Ot,Ot=Wr}if(at.prev===Ot){var In=at;at=Ot,Ot=In}for(var kn=0,eo=Ot.rings.length;kn<eo;kn++){var un=Ot.rings[kn],To=Ot.windings[kn],Ti=at.rings.indexOf(un);Ti===-1?(at.rings.push(un),at.windings.push(To)):at.windings[Ti]+=To}Ot.rings=null,Ot.windings=null,Ot.consumedBy=at,Ot.leftSE.consumedBy=at.leftSE,Ot.rightSE.consumedBy=at.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var We=this.prev.consumedBy||this.prev;this._beforeState=We.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var We=this.beforeState();this._afterState={rings:We.rings.slice(0),windings:We.windings.slice(0),multiPolys:[]};for(var at=this._afterState.rings,Ot=this._afterState.windings,or=this._afterState.multiPolys,Wr=0,In=this.rings.length;Wr<In;Wr++){var kn=this.rings[Wr],eo=this.windings[Wr],un=at.indexOf(kn);un===-1?(at.push(kn),Ot.push(eo)):Ot[un]+=eo}for(var To=[],Ti=[],Lo=0,wa=at.length;Lo<wa;Lo++)if(Ot[Lo]!==0){var dn=at[Lo],co=dn.poly;if(Ti.indexOf(co)===-1)if(dn.isExterior)To.push(co);else{Ti.indexOf(co)===-1&&Ti.push(co);var no=To.indexOf(dn.poly);no!==-1&&To.splice(no,1)}}for(var Za=0,ms=To.length;Za<ms;Za++){var Ji=To[Za].multiPoly;or.indexOf(Ji)===-1&&or.push(Ji)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var We=this.beforeState().multiPolys,at=this.afterState().multiPolys;switch(Qi.type){case"union":{var Ot=We.length===0,or=at.length===0;this._isInResult=Ot!==or;break}case"intersection":{var Wr,In;We.length<at.length?(Wr=We.length,In=at.length):(Wr=at.length,In=We.length),this._isInResult=In===Qi.numMultiPolys&&Wr<In;break}case"xor":{var kn=Math.abs(We.length-at.length);this._isInResult=kn%2===1;break}case"difference":{var eo=function(To){return To.length===1&&To[0].isSubject};this._isInResult=eo(We)!==eo(at);break}default:throw new Error("Unrecognized operation type found ".concat(Qi.type))}return this._isInResult}}],[{key:"fromRing",value:function(We,at,Ot){var or,Wr,In,kn=wr.comparePoints(We,at);if(kn<0)or=We,Wr=at,In=1;else if(kn>0)or=at,Wr=We,In=-1;else throw new Error("Tried to create degenerate segment at [".concat(We.x,", ").concat(We.y,"]"));var eo=new wr(or,!0),un=new wr(Wr,!1);return new dr(eo,un,[Ot],[In])}}]),dr}(),yi=function(){function dr(he,We,at){if(Ze(this,dr),!Array.isArray(he)||he.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=We,this.isExterior=at,this.segments=[],typeof he[0][0]!="number"||typeof he[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var Ot=gr.round(he[0][0],he[0][1]);this.bbox={ll:{x:Ot.x,y:Ot.y},ur:{x:Ot.x,y:Ot.y}};for(var or=Ot,Wr=1,In=he.length;Wr<In;Wr++){if(typeof he[Wr][0]!="number"||typeof he[Wr][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var kn=gr.round(he[Wr][0],he[Wr][1]);kn.x===or.x&&kn.y===or.y||(this.segments.push(an.fromRing(or,kn,this)),kn.x<this.bbox.ll.x&&(this.bbox.ll.x=kn.x),kn.y<this.bbox.ll.y&&(this.bbox.ll.y=kn.y),kn.x>this.bbox.ur.x&&(this.bbox.ur.x=kn.x),kn.y>this.bbox.ur.y&&(this.bbox.ur.y=kn.y),or=kn)}(Ot.x!==or.x||Ot.y!==or.y)&&this.segments.push(an.fromRing(or,Ot,this))}return R(dr,[{key:"getSweepEvents",value:function(){for(var We=[],at=0,Ot=this.segments.length;at<Ot;at++){var or=this.segments[at];We.push(or.leftSE),We.push(or.rightSE)}return We}}]),dr}(),li=function(){function dr(he,We){if(Ze(this,dr),!Array.isArray(he))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new yi(he[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var at=1,Ot=he.length;at<Ot;at++){var or=new yi(he[at],this,!1);or.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=or.bbox.ll.x),or.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=or.bbox.ll.y),or.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=or.bbox.ur.x),or.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=or.bbox.ur.y),this.interiorRings.push(or)}this.multiPoly=We}return R(dr,[{key:"getSweepEvents",value:function(){for(var We=this.exteriorRing.getSweepEvents(),at=0,Ot=this.interiorRings.length;at<Ot;at++)for(var or=this.interiorRings[at].getSweepEvents(),Wr=0,In=or.length;Wr<In;Wr++)We.push(or[Wr]);return We}}]),dr}(),Uo=function(){function dr(he,We){if(Ze(this,dr),!Array.isArray(he))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof he[0][0][0]=="number"&&(he=[he])}catch(Wr){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var at=0,Ot=he.length;at<Ot;at++){var or=new li(he[at],this);or.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=or.bbox.ll.x),or.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=or.bbox.ll.y),or.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=or.bbox.ur.x),or.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=or.bbox.ur.y),this.polys.push(or)}this.isSubject=We}return R(dr,[{key:"getSweepEvents",value:function(){for(var We=[],at=0,Ot=this.polys.length;at<Ot;at++)for(var or=this.polys[at].getSweepEvents(),Wr=0,In=or.length;Wr<In;Wr++)We.push(or[Wr]);return We}}]),dr}(),vi=function(){R(dr,null,[{key:"factory",value:function(We){for(var at=[],Ot=0,or=We.length;Ot<or;Ot++){var Wr=We[Ot];if(!(!Wr.isInResult()||Wr.ringOut)){for(var In=null,kn=Wr.leftSE,eo=Wr.rightSE,un=[kn],To=kn.point,Ti=[];In=kn,kn=eo,un.push(kn),kn.point!==To;)for(;;){var Lo=kn.getAvailableLinkedEvents();if(Lo.length===0){var wa=un[0].point,dn=un[un.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(wa.x,",")+" ".concat(wa.y,"]. Last matching segment found ends at")+" [".concat(dn.x,", ").concat(dn.y,"]."))}if(Lo.length===1){eo=Lo[0].otherSE;break}for(var co=null,no=0,Za=Ti.length;no<Za;no++)if(Ti[no].point===kn.point){co=no;break}if(co!==null){var ms=Ti.splice(co)[0],Ji=un.splice(ms.index);Ji.unshift(Ji[0].otherSE),at.push(new dr(Ji.reverse()));continue}Ti.push({index:un.length,point:kn.point});var Us=kn.getLeftmostComparator(In);eo=Lo.sort(Us)[0].otherSE;break}at.push(new dr(un))}}return at}}]);function dr(he){Ze(this,dr),this.events=he;for(var We=0,at=he.length;We<at;We++)he[We].segment.ringOut=this;this.poly=null}return R(dr,[{key:"getGeom",value:function(){for(var We=this.events[0].point,at=[We],Ot=1,or=this.events.length-1;Ot<or;Ot++){var Wr=this.events[Ot].point,In=this.events[Ot+1].point;qe(Wr,We,In)!==0&&(at.push(Wr),We=Wr)}if(at.length===1)return null;var kn=at[0],eo=at[1];qe(kn,We,eo)===0&&at.shift(),at.push(at[0]);for(var un=this.isExteriorRing()?1:-1,To=this.isExteriorRing()?0:at.length-1,Ti=this.isExteriorRing()?at.length:-1,Lo=[],wa=To;wa!=Ti;wa+=un)Lo.push([at[wa].x,at[wa].y]);return Lo}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var We=this.enclosingRing();this._isExteriorRing=We?!We.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var We=this.events[0],at=1,Ot=this.events.length;at<Ot;at++){var or=this.events[at];wr.compare(We,or)>0&&(We=or)}for(var Wr=We.segment.prevInResult(),In=Wr?Wr.prevInResult():null;;){if(!Wr)return null;if(!In)return Wr.ringOut;if(In.ringOut!==Wr.ringOut)return In.ringOut.enclosingRing()!==Wr.ringOut?Wr.ringOut:Wr.ringOut.enclosingRing();Wr=In.prevInResult(),In=Wr?Wr.prevInResult():null}}}]),dr}(),bo=function(){function dr(he){Ze(this,dr),this.exteriorRing=he,he.poly=this,this.interiorRings=[]}return R(dr,[{key:"addInterior",value:function(We){this.interiorRings.push(We),We.poly=this}},{key:"getGeom",value:function(){var We=[this.exteriorRing.getGeom()];if(We[0]===null)return null;for(var at=0,Ot=this.interiorRings.length;at<Ot;at++){var or=this.interiorRings[at].getGeom();or!==null&&We.push(or)}return We}}]),dr}(),So=function(){function dr(he){Ze(this,dr),this.rings=he,this.polys=this._composePolys(he)}return R(dr,[{key:"getGeom",value:function(){for(var We=[],at=0,Ot=this.polys.length;at<Ot;at++){var or=this.polys[at].getGeom();or!==null&&We.push(or)}return We}},{key:"_composePolys",value:function(We){for(var at=[],Ot=0,or=We.length;Ot<or;Ot++){var Wr=We[Ot];if(!Wr.poly)if(Wr.isExteriorRing())at.push(new bo(Wr));else{var In=Wr.enclosingRing();In.poly||at.push(new bo(In)),In.poly.addInterior(Wr)}}return at}}]),dr}(),Xi=function(){function dr(he){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:an.compare;Ze(this,dr),this.queue=he,this.tree=new Ke(We),this.segments=[]}return R(dr,[{key:"process",value:function(We){var at=We.segment,Ot=[];if(We.consumedBy)return We.isLeft?this.queue.remove(We.otherSE):this.tree.remove(at),Ot;var or=We.isLeft?this.tree.insert(at):this.tree.find(at);if(!or)throw new Error("Unable to find segment #".concat(at.id," ")+"[".concat(at.leftSE.point.x,", ").concat(at.leftSE.point.y,"] -> ")+"[".concat(at.rightSE.point.x,", ").concat(at.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var Wr=or,In=or,kn=void 0,eo=void 0;kn===void 0;)Wr=this.tree.prev(Wr),Wr===null?kn=null:Wr.key.consumedBy===void 0&&(kn=Wr.key);for(;eo===void 0;)In=this.tree.next(In),In===null?eo=null:In.key.consumedBy===void 0&&(eo=In.key);if(We.isLeft){var un=null;if(kn){var To=kn.getIntersection(at);if(To!==null&&(at.isAnEndpoint(To)||(un=To),!kn.isAnEndpoint(To)))for(var Ti=this._splitSafely(kn,To),Lo=0,wa=Ti.length;Lo<wa;Lo++)Ot.push(Ti[Lo])}var dn=null;if(eo){var co=eo.getIntersection(at);if(co!==null&&(at.isAnEndpoint(co)||(dn=co),!eo.isAnEndpoint(co)))for(var no=this._splitSafely(eo,co),Za=0,ms=no.length;Za<ms;Za++)Ot.push(no[Za])}if(un!==null||dn!==null){var Ji=null;if(un===null)Ji=dn;else if(dn===null)Ji=un;else{var Us=wr.comparePoints(un,dn);Ji=Us<=0?un:dn}this.queue.remove(at.rightSE),Ot.push(at.rightSE);for(var Lt=at.split(Ji),Ne=0,re=Lt.length;Ne<re;Ne++)Ot.push(Lt[Ne])}Ot.length>0?(this.tree.remove(at),Ot.push(We)):(this.segments.push(at),at.prev=kn)}else{if(kn&&eo){var le=kn.getIntersection(eo);if(le!==null){if(!kn.isAnEndpoint(le))for(var ge=this._splitSafely(kn,le),ye=0,ze=ge.length;ye<ze;ye++)Ot.push(ge[ye]);if(!eo.isAnEndpoint(le))for(var je=this._splitSafely(eo,le),Ue=0,Ae=je.length;Ue<Ae;Ue++)Ot.push(je[Ue])}}this.tree.remove(at)}return Ot}},{key:"_splitSafely",value:function(We,at){this.tree.remove(We);var Ot=We.rightSE;this.queue.remove(Ot);var or=We.split(at);return or.push(Ot),We.consumedBy===void 0&&this.tree.insert(We),or}}]),dr}(),Mi=typeof ve!="undefined"&&{API_URL:"https://shopapi.houyi2023.cn",WS_URL:"ws://shopapi.houyi2023.com",STATIC_URL:"https://shopapi.houyi2023.com",WEMAP_KEY:"ZFDBZ-YUTWB-353UZ-NYKEY-JTVIZ-Q3F6X"}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,qo=typeof ve!="undefined"&&{API_URL:"https://shopapi.houyi2023.cn",WS_URL:"ws://shopapi.houyi2023.com",STATIC_URL:"https://shopapi.houyi2023.com",WEMAP_KEY:"ZFDBZ-YUTWB-353UZ-NYKEY-JTVIZ-Q3F6X"}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,ui=function(){function dr(){Ze(this,dr)}return R(dr,[{key:"run",value:function(We,at,Ot){Qi.type=We,gr.reset();for(var or=[new Uo(at,!0)],Wr=0,In=Ot.length;Wr<In;Wr++)or.push(new Uo(Ot[Wr],!1));if(Qi.numMultiPolys=or.length,Qi.type==="difference")for(var kn=or[0],eo=1;eo<or.length;)Jn(or[eo].bbox,kn.bbox)!==null?eo++:or.splice(eo,1);if(Qi.type==="intersection"){for(var un=0,To=or.length;un<To;un++)for(var Ti=or[un],Lo=un+1,wa=or.length;Lo<wa;Lo++)if(Jn(Ti.bbox,or[Lo].bbox)===null)return[]}for(var dn=new Ke(wr.compare),co=0,no=or.length;co<no;co++)for(var Za=or[co].getSweepEvents(),ms=0,Ji=Za.length;ms<Ji;ms++)if(dn.insert(Za[ms]),dn.size>Mi)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var Us=new Xi(dn),Lt=dn.size,Ne=dn.pop();Ne;){var re=Ne.key;if(dn.size===Lt){var le=re.segment;throw new Error("Unable to pop() ".concat(re.isLeft?"left":"right"," SweepEvent ")+"[".concat(re.point.x,", ").concat(re.point.y,"] from segment #").concat(le.id," ")+"[".concat(le.leftSE.point.x,", ").concat(le.leftSE.point.y,"] -> ")+"[".concat(le.rightSE.point.x,", ").concat(le.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(dn.size>Mi)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(Us.segments.length>qo)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var ge=Us.process(re),ye=0,ze=ge.length;ye<ze;ye++){var je=ge[ye];je.consumedBy===void 0&&dn.insert(je)}Lt=dn.size,Ne=dn.pop()}gr.reset();var Ue=vi.factory(Us.segments),Ae=new So(Ue);return Ae.getGeom()}}]),dr}(),Qi=new ui,Vi=function(he){for(var We=arguments.length,at=new Array(We>1?We-1:0),Ot=1;Ot<We;Ot++)at[Ot-1]=arguments[Ot];return Qi.run("union",he,at)},Pi=function(he){for(var We=arguments.length,at=new Array(We>1?We-1:0),Ot=1;Ot<We;Ot++)at[Ot-1]=arguments[Ot];return Qi.run("intersection",he,at)},ds=function(he){for(var We=arguments.length,at=new Array(We>1?We-1:0),Ot=1;Ot<We;Ot++)at[Ot-1]=arguments[Ot];return Qi.run("xor",he,at)},Ur=function(he){for(var We=arguments.length,at=new Array(We>1?We-1:0),Ot=1;Ot<We;Ot++)at[Ot-1]=arguments[Ot];return Qi.run("difference",he,at)},ls={union:Vi,intersection:Pi,xor:ds,difference:Ur};return ls})},79801:function(Zr){(function(_r,Se){Zr.exports=Se()})(this,function(){"use strict";var _r=function(Pe){return Pe instanceof Uint8Array||Pe instanceof Uint16Array||Pe instanceof Uint32Array||Pe instanceof Int8Array||Pe instanceof Int16Array||Pe instanceof Int32Array||Pe instanceof Float32Array||Pe instanceof Float64Array||Pe instanceof Uint8ClampedArray},Se=function(Pe,_t){for(var Zt=Object.keys(_t),qr=0;qr<Zt.length;++qr)Pe[Zt[qr]]=_t[Zt[qr]];return Pe},ve=`
`;function Ze(Pe){return typeof atob!="undefined"?atob(Pe):"base64:"+Pe}function M(Pe){var _t=new Error("(regl) "+Pe);throw console.error(_t),_t}function R(Pe,_t){Pe||M(_t)}function de(Pe){return Pe?": "+Pe:""}function be(Pe,_t,Zt){Pe in _t||M("unknown parameter ("+Pe+")"+de(Zt)+". possible values: "+Object.keys(_t).join())}function Le(Pe,_t){_r(Pe)||M("invalid parameter type"+de(_t)+". must be a typed array")}function Re(Pe,_t){switch(_t){case"number":return typeof Pe=="number";case"object":return typeof Pe=="object";case"string":return typeof Pe=="string";case"boolean":return typeof Pe=="boolean";case"function":return typeof Pe=="function";case"undefined":return typeof Pe=="undefined";case"symbol":return typeof Pe=="symbol"}}function Ce(Pe,_t,Zt){Re(Pe,_t)||M("invalid parameter type"+de(Zt)+". expected "+_t+", got "+typeof Pe)}function He(Pe,_t){Pe>=0&&(Pe|0)===Pe||M("invalid parameter type, ("+Pe+")"+de(_t)+". must be a nonnegative integer")}function Xe(Pe,_t,Zt){_t.indexOf(Pe)<0&&M("invalid value"+de(Zt)+". must be one of: "+_t)}var Ke=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function Ve(Pe){Object.keys(Pe).forEach(function(_t){Ke.indexOf(_t)<0&&M('invalid regl constructor argument "'+_t+'". must be one of '+Ke)})}function et(Pe,_t){for(Pe=Pe+"";Pe.length<_t;)Pe=" "+Pe;return Pe}function er(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function fr(Pe,_t){this.number=Pe,this.line=_t,this.errors=[]}function Ar(Pe,_t,Zt){this.file=Pe,this.line=_t,this.message=Zt}function pn(){var Pe=new Error,_t=(Pe.stack||Pe).toString(),Zt=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(_t);if(Zt)return Zt[1];var qr=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(_t);return qr?qr[1]:"unknown"}function Kn(){var Pe=new Error,_t=(Pe.stack||Pe).toString(),Zt=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(_t);if(Zt)return Zt[1];var qr=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(_t);return qr?qr[1]:"unknown"}function Jn(Pe,_t){var Zt=Pe.split(`
`),qr=1,wn=0,Yr={unknown:new er,0:new er};Yr.unknown.name=Yr[0].name=_t||pn(),Yr.unknown.lines.push(new fr(0,""));for(var Or=0;Or<Zt.length;++Or){var Wn=Zt[Or],Bn=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(Wn);if(Bn)switch(Bn[1]){case"line":var si=/(\d+)(\s+\d+)?/.exec(Bn[2]);si&&(qr=si[1]|0,si[2]&&(wn=si[2]|0,wn in Yr||(Yr[wn]=new er)));break;case"define":var Hn=/SHADER_NAME(_B64)?\s+(.*)$/.exec(Bn[2]);Hn&&(Yr[wn].name=Hn[1]?Ze(Hn[2]):Hn[2]);break}Yr[wn].lines.push(new fr(qr++,Wn))}return Object.keys(Yr).forEach(function(qn){var ci=Yr[qn];ci.lines.forEach(function(Vn){ci.index[Vn.number]=Vn})}),Yr}function ki(Pe){var _t=[];return Pe.split(`
`).forEach(function(Zt){if(!(Zt.length<5)){var qr=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(Zt);qr?_t.push(new Ar(qr[1]|0,qr[2]|0,qr[3].trim())):Zt.length>0&&_t.push(new Ar("unknown",0,Zt))}}),_t}function pa(Pe,_t){_t.forEach(function(Zt){var qr=Pe[Zt.file];if(qr){var wn=qr.index[Zt.line];if(wn){wn.errors.push(Zt),qr.hasErrors=!0;return}}Pe.unknown.hasErrors=!0,Pe.unknown.lines[0].errors.push(Zt)})}function xr(Pe,_t,Zt,qr,wn){if(!Pe.getShaderParameter(_t,Pe.COMPILE_STATUS)){var Yr=Pe.getShaderInfoLog(_t),Or=qr===Pe.FRAGMENT_SHADER?"fragment":"vertex";Dt(Zt,"string",Or+" shader source must be a string",wn);var Wn=Jn(Zt,wn),Bn=ki(Yr);pa(Wn,Bn),Object.keys(Wn).forEach(function(si){var Hn=Wn[si];if(!Hn.hasErrors)return;var qn=[""],ci=[""];function Vn(Yn,Tr){qn.push(Yn),ci.push(Tr||"")}Vn("file number "+si+": "+Hn.name+`
`,"color:red;text-decoration:underline;font-weight:bold"),Hn.lines.forEach(function(Yn){if(Yn.errors.length>0){Vn(et(Yn.number,4)+"| ","background-color:yellow; font-weight:bold"),Vn(Yn.line+ve,"color:red; background-color:yellow; font-weight:bold");var Tr=0;Yn.errors.forEach(function(en){var Xn=en.message,_i=/^\s*'(.*)'\s*:\s*(.*)$/.exec(Xn);if(_i){var Rn=_i[1];switch(Xn=_i[2],Rn){case"assign":Rn="=";break}Tr=Math.max(Yn.line.indexOf(Rn,Tr),0)}else Tr=0;Vn(et("| ",6)),Vn(et("^^^",Tr+3)+ve,"font-weight:bold"),Vn(et("| ",6)),Vn(Xn+ve,"font-weight:bold")}),Vn(et("| ",6)+ve)}else Vn(et(Yn.number,4)+"| "),Vn(Yn.line+ve,"color:red")}),typeof document!="undefined"&&!window.chrome?(ci[0]=qn.join("%c"),console.log.apply(console,ci)):console.log(qn.join(""))}),R.raise("Error compiling "+Or+" shader, "+Wn[0].name)}}function jt(Pe,_t,Zt,qr,wn){if(!Pe.getProgramParameter(_t,Pe.LINK_STATUS)){var Yr=Pe.getProgramInfoLog(_t),Or=Jn(Zt,wn),Wn=Jn(qr,wn),Bn='Error linking program with vertex shader, "'+Wn[0].name+'", and fragment shader "'+Or[0].name+'"';typeof document!="undefined"?console.log("%c"+Bn+ve+"%c"+Yr,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(Bn+ve+Yr),R.raise(Bn)}}function Jr(Pe){Pe._commandRef=pn()}function gr(Pe,_t,Zt,qr){Jr(Pe);function wn(Bn){return Bn?qr.id(Bn):0}Pe._fragId=wn(Pe.static.frag),Pe._vertId=wn(Pe.static.vert);function Yr(Bn,si){Object.keys(si).forEach(function(Hn){Bn[qr.id(Hn)]=!0})}var Or=Pe._uniformSet={};Yr(Or,_t.static),Yr(Or,_t.dynamic);var Wn=Pe._attributeSet={};Yr(Wn,Zt.static),Yr(Wn,Zt.dynamic),Pe._hasCount="count"in Pe.static||"count"in Pe.dynamic||"elements"in Pe.static||"elements"in Pe.dynamic}function rn(Pe,_t){var Zt=Kn();M(Pe+" in command "+(_t||pn())+(Zt==="unknown"?"":" called from "+Zt))}function jn(Pe,_t,Zt){Pe||rn(_t,Zt||pn())}function qe(Pe,_t,Zt,qr){Pe in _t||rn("unknown parameter ("+Pe+")"+de(Zt)+". possible values: "+Object.keys(_t).join(),qr||pn())}function Dt(Pe,_t,Zt,qr){Re(Pe,_t)||rn("invalid parameter type"+de(Zt)+". expected "+_t+", got "+typeof Pe,qr||pn())}function $e(Pe){Pe()}function Pt(Pe,_t,Zt){Pe.texture?Xe(Pe.texture._texture.internalformat,_t,"unsupported texture format for attachment"):Xe(Pe.renderbuffer._renderbuffer.format,Zt,"unsupported renderbuffer format for attachment")}var vt=33071,rr=9728,ar=9984,wr=9985,Cr=9986,an=9987,yi=5120,li=5121,Uo=5122,vi=5123,bo=5124,So=5125,Xi=5126,Mi=32819,qo=32820,ui=33635,Qi=34042,Vi=36193,Pi={};Pi[yi]=Pi[li]=1,Pi[Uo]=Pi[vi]=Pi[Vi]=Pi[ui]=Pi[Mi]=Pi[qo]=2,Pi[bo]=Pi[So]=Pi[Xi]=Pi[Qi]=4;function ds(Pe,_t){return Pe===qo||Pe===Mi||Pe===ui?2:Pe===Qi?4:Pi[Pe]*_t}function Ur(Pe){return!(Pe&Pe-1)&&!!Pe}function ls(Pe,_t,Zt){var qr,wn=_t.width,Yr=_t.height,Or=_t.channels;R(wn>0&&wn<=Zt.maxTextureSize&&Yr>0&&Yr<=Zt.maxTextureSize,"invalid texture shape"),(Pe.wrapS!==vt||Pe.wrapT!==vt)&&R(Ur(wn)&&Ur(Yr),"incompatible wrap mode for texture, both width and height must be power of 2"),_t.mipmask===1?wn!==1&&Yr!==1&&R(Pe.minFilter!==ar&&Pe.minFilter!==Cr&&Pe.minFilter!==wr&&Pe.minFilter!==an,"min filter requires mipmap"):(R(Ur(wn)&&Ur(Yr),"texture must be a square power of 2 to support mipmapping"),R(_t.mipmask===(wn<<1)-1,"missing or incomplete mipmap data")),_t.type===Xi&&(Zt.extensions.indexOf("oes_texture_float_linear")<0&&R(Pe.minFilter===rr&&Pe.magFilter===rr,"filter not supported, must enable oes_texture_float_linear"),R(!Pe.genMipmaps,"mipmap generation not supported with float textures"));var Wn=_t.images;for(qr=0;qr<16;++qr)if(Wn[qr]){var Bn=wn>>qr,si=Yr>>qr;R(_t.mipmask&1<<qr,"missing mipmap data");var Hn=Wn[qr];if(R(Hn.width===Bn&&Hn.height===si,"invalid shape for mip images"),R(Hn.format===_t.format&&Hn.internalformat===_t.internalformat&&Hn.type===_t.type,"incompatible type for mip image"),!Hn.compressed)if(Hn.data){var qn=Math.ceil(ds(Hn.type,Or)*Bn/Hn.unpackAlignment)*Hn.unpackAlignment;R(Hn.data.byteLength===qn*si,"invalid data for image, buffer size is inconsistent with image format")}else Hn.element||Hn.copy}else Pe.genMipmaps||R((_t.mipmask&1<<qr)===0,"extra mipmap data");_t.compressed&&R(!Pe.genMipmaps,"mipmap generation for compressed images not supported")}function dr(Pe,_t,Zt,qr){var wn=Pe.width,Yr=Pe.height,Or=Pe.channels;R(wn>0&&wn<=qr.maxTextureSize&&Yr>0&&Yr<=qr.maxTextureSize,"invalid texture shape"),R(wn===Yr,"cube map must be square"),R(_t.wrapS===vt&&_t.wrapT===vt,"wrap mode not supported by cube map");for(var Wn=0;Wn<Zt.length;++Wn){var Bn=Zt[Wn];R(Bn.width===wn&&Bn.height===Yr,"inconsistent cube map face shape"),_t.genMipmaps&&(R(!Bn.compressed,"can not generate mipmap for compressed textures"),R(Bn.mipmask===1,"can not specify mipmaps and generate mipmaps"));for(var si=Bn.images,Hn=0;Hn<16;++Hn){var qn=si[Hn];if(qn){var ci=wn>>Hn,Vn=Yr>>Hn;R(Bn.mipmask&1<<Hn,"missing mipmap data"),R(qn.width===ci&&qn.height===Vn,"invalid shape for mip images"),R(qn.format===Pe.format&&qn.internalformat===Pe.internalformat&&qn.type===Pe.type,"incompatible type for mip image"),qn.compressed||(qn.data?R(qn.data.byteLength===ci*Vn*Math.max(ds(qn.type,Or),qn.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):qn.element||qn.copy)}}}}var he=Se(R,{optional:$e,raise:M,commandRaise:rn,command:jn,parameter:be,commandParameter:qe,constructor:Ve,type:Ce,commandType:Dt,isTypedArray:Le,nni:He,oneOf:Xe,shaderError:xr,linkError:jt,callSite:Kn,saveCommandRef:Jr,saveDrawInfo:gr,framebufferFormat:Pt,guessCommand:pn,texture2D:ls,textureCube:dr}),We=0,at=0;function Ot(Pe,_t){this.id=We++,this.type=Pe,this.data=_t}function or(Pe){return Pe.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Wr(Pe){if(Pe.length===0)return[];var _t=Pe.charAt(0),Zt=Pe.charAt(Pe.length-1);if(Pe.length>1&&_t===Zt&&(_t==='"'||_t==="'"))return['"'+or(Pe.substr(1,Pe.length-2))+'"'];var qr=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(Pe);if(qr)return Wr(Pe.substr(0,qr.index)).concat(Wr(qr[1])).concat(Wr(Pe.substr(qr.index+qr[0].length)));var wn=Pe.split(".");if(wn.length===1)return['"'+or(Pe)+'"'];for(var Yr=[],Or=0;Or<wn.length;++Or)Yr=Yr.concat(Wr(wn[Or]));return Yr}function In(Pe){return"["+Wr(Pe).join("][")+"]"}function kn(Pe,_t){return new Ot(Pe,In(_t+""))}function eo(Pe){return typeof Pe=="function"&&!Pe._reglType||Pe instanceof Ot}function un(Pe,_t){return typeof Pe=="function"?new Ot(at,Pe):Pe}var To={DynamicVariable:Ot,define:kn,isDynamic:eo,unbox:un,accessor:In},Ti={next:typeof requestAnimationFrame=="function"?function(Pe){return requestAnimationFrame(Pe)}:function(Pe){return setTimeout(Pe,16)},cancel:typeof cancelAnimationFrame=="function"?function(Pe){return cancelAnimationFrame(Pe)}:clearTimeout},Lo=typeof performance!="undefined"&&performance.now?function(){return performance.now()}:function(){return+new Date};function wa(){var Pe={"":0},_t=[""];return{id:function(Zt){var qr=Pe[Zt];return qr||(qr=Pe[Zt]=_t.length,_t.push(Zt),qr)},str:function(Zt){return _t[Zt]}}}function dn(Pe,_t,Zt){var qr=document.createElement("canvas");Se(qr.style,{border:0,margin:0,padding:0,top:0,left:0}),Pe.appendChild(qr),Pe===document.body&&(qr.style.position="absolute",Se(Pe.style,{margin:0,padding:0}));function wn(){var Wn=window.innerWidth,Bn=window.innerHeight;if(Pe!==document.body){var si=Pe.getBoundingClientRect();Wn=si.right-si.left,Bn=si.bottom-si.top}qr.width=Zt*Wn,qr.height=Zt*Bn,Se(qr.style,{width:Wn+"px",height:Bn+"px"})}var Yr;Pe!==document.body&&typeof ResizeObserver=="function"?(Yr=new ResizeObserver(function(){setTimeout(wn)}),Yr.observe(Pe)):window.addEventListener("resize",wn,!1);function Or(){Yr?Yr.disconnect():window.removeEventListener("resize",wn),Pe.removeChild(qr)}return wn(),{canvas:qr,onDestroy:Or}}function co(Pe,_t){function Zt(qr){try{return Pe.getContext(qr,_t)}catch(wn){return null}}return Zt("webgl")||Zt("experimental-webgl")||Zt("webgl-experimental")}function no(Pe){return typeof Pe.nodeName=="string"&&typeof Pe.appendChild=="function"&&typeof Pe.getBoundingClientRect=="function"}function Za(Pe){return typeof Pe.drawArrays=="function"||typeof Pe.drawElements=="function"}function ms(Pe){return typeof Pe=="string"?Pe.split():(he(Array.isArray(Pe),"invalid extension array"),Pe)}function Ji(Pe){return typeof Pe=="string"?(he(typeof document!="undefined","not supported outside of DOM"),document.querySelector(Pe)):Pe}function Us(Pe){var _t=Pe||{},Zt,qr,wn,Yr,Or={},Wn=[],Bn=[],si=typeof window=="undefined"?1:window.devicePixelRatio,Hn=!1,qn=function(Yn){Yn&&he.raise(Yn)},ci=function(){};if(typeof _t=="string"?(he(typeof document!="undefined","selector queries only supported in DOM enviroments"),Zt=document.querySelector(_t),he(Zt,"invalid query string for element")):typeof _t=="object"?no(_t)?Zt=_t:Za(_t)?(Yr=_t,wn=Yr.canvas):(he.constructor(_t),"gl"in _t?Yr=_t.gl:"canvas"in _t?wn=Ji(_t.canvas):"container"in _t&&(qr=Ji(_t.container)),"attributes"in _t&&(Or=_t.attributes,he.type(Or,"object","invalid context attributes")),"extensions"in _t&&(Wn=ms(_t.extensions)),"optionalExtensions"in _t&&(Bn=ms(_t.optionalExtensions)),"onDone"in _t&&(he.type(_t.onDone,"function","invalid or missing onDone callback"),qn=_t.onDone),"profile"in _t&&(Hn=!!_t.profile),"pixelRatio"in _t&&(si=+_t.pixelRatio,he(si>0,"invalid pixel ratio"))):he.raise("invalid arguments to regl"),Zt&&(Zt.nodeName.toLowerCase()==="canvas"?wn=Zt:qr=Zt),!Yr){if(!wn){he(typeof document!="undefined","must manually specify webgl context outside of DOM environments");var Vn=dn(qr||document.body,qn,si);if(!Vn)return null;wn=Vn.canvas,ci=Vn.onDestroy}Or.premultipliedAlpha===void 0&&(Or.premultipliedAlpha=!0),Yr=co(wn,Or)}return Yr?{gl:Yr,canvas:wn,container:qr,extensions:Wn,optionalExtensions:Bn,pixelRatio:si,profile:Hn,onDone:qn,onDestroy:ci}:(ci(),qn("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function Lt(Pe,_t){var Zt={};function qr(Or){he.type(Or,"string","extension name must be string");var Wn=Or.toLowerCase(),Bn;try{Bn=Zt[Wn]=Pe.getExtension(Wn)}catch(si){}return!!Bn}for(var wn=0;wn<_t.extensions.length;++wn){var Yr=_t.extensions[wn];if(!qr(Yr))return _t.onDestroy(),_t.onDone('"'+Yr+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return _t.optionalExtensions.forEach(qr),{extensions:Zt,restore:function(){Object.keys(Zt).forEach(function(Or){if(Zt[Or]&&!qr(Or))throw new Error("(regl): error restoring extension "+Or)})}}}function Ne(Pe,_t){for(var Zt=Array(Pe),qr=0;qr<Pe;++qr)Zt[qr]=_t(qr);return Zt}var re=5120,le=5121,ge=5122,ye=5123,ze=5124,je=5125,Ue=5126;function Ae(Pe){for(var _t=16;_t<=1<<28;_t*=16)if(Pe<=_t)return _t;return 0}function Je(Pe){var _t,Zt;return _t=(Pe>65535)<<4,Pe>>>=_t,Zt=(Pe>255)<<3,Pe>>>=Zt,_t|=Zt,Zt=(Pe>15)<<2,Pe>>>=Zt,_t|=Zt,Zt=(Pe>3)<<1,Pe>>>=Zt,_t|=Zt,_t|Pe>>1}function wt(){var Pe=Ne(8,function(){return[]});function _t(Yr){var Or=Ae(Yr),Wn=Pe[Je(Or)>>2];return Wn.length>0?Wn.pop():new ArrayBuffer(Or)}function Zt(Yr){Pe[Je(Yr.byteLength)>>2].push(Yr)}function qr(Yr,Or){var Wn=null;switch(Yr){case re:Wn=new Int8Array(_t(Or),0,Or);break;case le:Wn=new Uint8Array(_t(Or),0,Or);break;case ge:Wn=new Int16Array(_t(2*Or),0,Or);break;case ye:Wn=new Uint16Array(_t(2*Or),0,Or);break;case ze:Wn=new Int32Array(_t(4*Or),0,Or);break;case je:Wn=new Uint32Array(_t(4*Or),0,Or);break;case Ue:Wn=new Float32Array(_t(4*Or),0,Or);break;default:return null}return Wn.length!==Or?Wn.subarray(0,Or):Wn}function wn(Yr){Zt(Yr.buffer)}return{alloc:_t,free:Zt,allocType:qr,freeType:wn}}var Ht=wt();Ht.zero=wt();var Fr=3408,mr=3410,Sr=3411,fn=3412,xn=3413,Lr=3414,Nn=3415,bn=33901,En=33902,io=3379,On=3386,Ao=34921,ia=36347,Ho=36348,Ga=35661,Wo=35660,Hl=34930,ns=36349,Yo=34076,_a=34024,$o=7936,Fo=7937,us=7938,xc=35724,Ba=34047,Fa=36063,sc=34852,Ql=3553,oa=34067,Zo=34069,il=33984,va=6408,El=5126,Wa=5121,Ds=36160,Rl=36053,gu=36064,gl=16384,wl=function(Pe,_t){var Zt=1;_t.ext_texture_filter_anisotropic&&(Zt=Pe.getParameter(Ba));var qr=1,wn=1;_t.webgl_draw_buffers&&(qr=Pe.getParameter(sc),wn=Pe.getParameter(Fa));var Yr=!!_t.oes_texture_float;if(Yr){var Or=Pe.createTexture();Pe.bindTexture(Ql,Or),Pe.texImage2D(Ql,0,va,1,1,0,va,El,null);var Wn=Pe.createFramebuffer();if(Pe.bindFramebuffer(Ds,Wn),Pe.framebufferTexture2D(Ds,gu,Ql,Or,0),Pe.bindTexture(Ql,null),Pe.checkFramebufferStatus(Ds)!==Rl)Yr=!1;else{Pe.viewport(0,0,1,1),Pe.clearColor(1,0,0,1),Pe.clear(gl);var Bn=Ht.allocType(El,4);Pe.readPixels(0,0,1,1,va,El,Bn),Pe.getError()?Yr=!1:(Pe.deleteFramebuffer(Wn),Pe.deleteTexture(Or),Yr=Bn[0]===1),Ht.freeType(Bn)}}var si=typeof navigator!="undefined"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Hn=!0;if(!si){var qn=Pe.createTexture(),ci=Ht.allocType(Wa,36);Pe.activeTexture(il),Pe.bindTexture(oa,qn),Pe.texImage2D(Zo,0,va,3,3,0,va,Wa,ci),Ht.freeType(ci),Pe.bindTexture(oa,null),Pe.deleteTexture(qn),Hn=!Pe.getError()}return{colorBits:[Pe.getParameter(mr),Pe.getParameter(Sr),Pe.getParameter(fn),Pe.getParameter(xn)],depthBits:Pe.getParameter(Lr),stencilBits:Pe.getParameter(Nn),subpixelBits:Pe.getParameter(Fr),extensions:Object.keys(_t).filter(function(Vn){return!!_t[Vn]}),maxAnisotropic:Zt,maxDrawbuffers:qr,maxColorAttachments:wn,pointSizeDims:Pe.getParameter(bn),lineWidthDims:Pe.getParameter(En),maxViewportDims:Pe.getParameter(On),maxCombinedTextureUnits:Pe.getParameter(Ga),maxCubeMapSize:Pe.getParameter(Yo),maxRenderbufferSize:Pe.getParameter(_a),maxTextureUnits:Pe.getParameter(Hl),maxTextureSize:Pe.getParameter(io),maxAttributes:Pe.getParameter(Ao),maxVertexUniforms:Pe.getParameter(ia),maxVertexTextureUnits:Pe.getParameter(Wo),maxVaryingVectors:Pe.getParameter(Ho),maxFragmentUniforms:Pe.getParameter(ns),glsl:Pe.getParameter(xc),renderer:Pe.getParameter(Fo),vendor:Pe.getParameter($o),version:Pe.getParameter(us),readFloat:Yr,npotTextureCube:Hn}};function ol(Pe){return!!Pe&&typeof Pe=="object"&&Array.isArray(Pe.shape)&&Array.isArray(Pe.stride)&&typeof Pe.offset=="number"&&Pe.shape.length===Pe.stride.length&&(Array.isArray(Pe.data)||_r(Pe.data))}var Qa=function(Pe){return Object.keys(Pe).map(function(_t){return Pe[_t]})},Gl={shape:Dn,flatten:jr};function Wl(Pe,_t,Zt){for(var qr=0;qr<_t;++qr)Zt[qr]=Pe[qr]}function ut(Pe,_t,Zt,qr){for(var wn=0,Yr=0;Yr<_t;++Yr)for(var Or=Pe[Yr],Wn=0;Wn<Zt;++Wn)qr[wn++]=Or[Wn]}function At(Pe,_t,Zt,qr,wn,Yr){for(var Or=Yr,Wn=0;Wn<_t;++Wn)for(var Bn=Pe[Wn],si=0;si<Zt;++si)for(var Hn=Bn[si],qn=0;qn<qr;++qn)wn[Or++]=Hn[qn]}function ir(Pe,_t,Zt,qr,wn){for(var Yr=1,Or=Zt+1;Or<_t.length;++Or)Yr*=_t[Or];var Wn=_t[Zt];if(_t.length-Zt===4){var Bn=_t[Zt+1],si=_t[Zt+2],Hn=_t[Zt+3];for(Or=0;Or<Wn;++Or)At(Pe[Or],Bn,si,Hn,qr,wn),wn+=Yr}else for(Or=0;Or<Wn;++Or)ir(Pe[Or],_t,Zt+1,qr,wn),wn+=Yr}function jr(Pe,_t,Zt,qr){var wn=1;if(_t.length)for(var Yr=0;Yr<_t.length;++Yr)wn*=_t[Yr];else wn=0;var Or=qr||Ht.allocType(Zt,wn);switch(_t.length){case 0:break;case 1:Wl(Pe,_t[0],Or);break;case 2:ut(Pe,_t[0],_t[1],Or);break;case 3:At(Pe,_t[0],_t[1],_t[2],Or,0);break;default:ir(Pe,_t,0,Or,0)}return Or}function Dn(Pe){for(var _t=[],Zt=Pe;Zt.length;Zt=Zt[0])_t.push(Zt.length);return _t}var oo={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},Xa=5120,mn=5122,kl=5124,Il=5121,Ia=5123,Xh=5125,Sl=5126,Va=5126,Aa={int8:Xa,int16:mn,int32:kl,uint8:Il,uint16:Ia,uint32:Xh,float:Sl,float32:Va},Ni=35048,lc=35040,Ku={dynamic:Ni,stream:lc,static:35044},lo=Gl.flatten,bs=Gl.shape,Os=35044,Nl=35040,Io=5121,eu=5126,Tl=[];Tl[5120]=1,Tl[5122]=2,Tl[5124]=4,Tl[5121]=1,Tl[5123]=2,Tl[5125]=4,Tl[5126]=4;function Fu(Pe){return oo[Object.prototype.toString.call(Pe)]|0}function Ju(Pe,_t){for(var Zt=0;Zt<_t.length;++Zt)Pe[Zt]=_t[Zt]}function al(Pe,_t,Zt,qr,wn,Yr,Or){for(var Wn=0,Bn=0;Bn<Zt;++Bn)for(var si=0;si<qr;++si)Pe[Wn++]=_t[wn*Bn+Yr*si+Or]}function Kc(Pe,_t,Zt,qr){var wn=0,Yr={};function Or(Tr){this.id=wn++,this.buffer=Pe.createBuffer(),this.type=Tr,this.usage=Os,this.byteLength=0,this.dimension=1,this.dtype=Io,this.persistentData=null,Zt.profile&&(this.stats={size:0})}Or.prototype.bind=function(){Pe.bindBuffer(this.type,this.buffer)},Or.prototype.destroy=function(){ci(this)};var Wn=[];function Bn(Tr,en){var Xn=Wn.pop();return Xn||(Xn=new Or(Tr)),Xn.bind(),qn(Xn,en,Nl,0,1,!1),Xn}function si(Tr){Wn.push(Tr)}function Hn(Tr,en,Xn){Tr.byteLength=en.byteLength,Pe.bufferData(Tr.type,en,Xn)}function qn(Tr,en,Xn,_i,Rn,xi){var Un;if(Tr.usage=Xn,Array.isArray(en)){if(Tr.dtype=_i||eu,en.length>0){var Oi;if(Array.isArray(en[0])){Un=bs(en);for(var Ln=1,wi=1;wi<Un.length;++wi)Ln*=Un[wi];Tr.dimension=Ln,Oi=lo(en,Un,Tr.dtype),Hn(Tr,Oi,Xn),xi?Tr.persistentData=Oi:Ht.freeType(Oi)}else if(typeof en[0]=="number"){Tr.dimension=Rn;var Po=Ht.allocType(Tr.dtype,en.length);Ju(Po,en),Hn(Tr,Po,Xn),xi?Tr.persistentData=Po:Ht.freeType(Po)}else _r(en[0])?(Tr.dimension=en[0].length,Tr.dtype=_i||Fu(en[0])||eu,Oi=lo(en,[en.length,en[0].length],Tr.dtype),Hn(Tr,Oi,Xn),xi?Tr.persistentData=Oi:Ht.freeType(Oi)):he.raise("invalid buffer data")}}else if(_r(en))Tr.dtype=_i||Fu(en),Tr.dimension=Rn,Hn(Tr,en,Xn),xi&&(Tr.persistentData=new Uint8Array(new Uint8Array(en.buffer)));else if(ol(en)){Un=en.shape;var da=en.stride,bi=en.offset,Zn=0,Sn=0,Wt=0,K=0;Un.length===1?(Zn=Un[0],Sn=1,Wt=da[0],K=0):Un.length===2?(Zn=Un[0],Sn=Un[1],Wt=da[0],K=da[1]):he.raise("invalid shape"),Tr.dtype=_i||Fu(en.data)||eu,Tr.dimension=Sn;var Ei=Ht.allocType(Tr.dtype,Zn*Sn);al(Ei,en.data,Zn,Sn,Wt,K,bi),Hn(Tr,Ei,Xn),xi?Tr.persistentData=Ei:Ht.freeType(Ei)}else en instanceof ArrayBuffer?(Tr.dtype=Io,Tr.dimension=Rn,Hn(Tr,en,Xn),xi&&(Tr.persistentData=new Uint8Array(new Uint8Array(en)))):he.raise("invalid buffer data")}function ci(Tr){_t.bufferCount--,qr(Tr);var en=Tr.buffer;he(en,"buffer must not be deleted already"),Pe.deleteBuffer(en),Tr.buffer=null,delete Yr[Tr.id]}function Vn(Tr,en,Xn,_i){_t.bufferCount++;var Rn=new Or(en);Yr[Rn.id]=Rn;function xi(Ln){var wi=Os,Po=null,da=0,bi=0,Zn=1;return Array.isArray(Ln)||_r(Ln)||ol(Ln)||Ln instanceof ArrayBuffer?Po=Ln:typeof Ln=="number"?da=Ln|0:Ln&&(he.type(Ln,"object","buffer arguments must be an object, a number or an array"),"data"in Ln&&(he(Po===null||Array.isArray(Po)||_r(Po)||ol(Po),"invalid data for buffer"),Po=Ln.data),"usage"in Ln&&(he.parameter(Ln.usage,Ku,"invalid buffer usage"),wi=Ku[Ln.usage]),"type"in Ln&&(he.parameter(Ln.type,Aa,"invalid buffer type"),bi=Aa[Ln.type]),"dimension"in Ln&&(he.type(Ln.dimension,"number","invalid dimension"),Zn=Ln.dimension|0),"length"in Ln&&(he.nni(da,"buffer length must be a nonnegative integer"),da=Ln.length|0)),Rn.bind(),Po?qn(Rn,Po,wi,bi,Zn,_i):(da&&Pe.bufferData(Rn.type,da,wi),Rn.dtype=bi||Io,Rn.usage=wi,Rn.dimension=Zn,Rn.byteLength=da),Zt.profile&&(Rn.stats.size=Rn.byteLength*Tl[Rn.dtype]),xi}function Un(Ln,wi){he(wi+Ln.byteLength<=Rn.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+Ln.byteLength+" starting from offset "+wi+" to a buffer of size "+Rn.byteLength),Pe.bufferSubData(Rn.type,wi,Ln)}function Oi(Ln,wi){var Po=(wi||0)|0,da;if(Rn.bind(),_r(Ln)||Ln instanceof ArrayBuffer)Un(Ln,Po);else if(Array.isArray(Ln)){if(Ln.length>0)if(typeof Ln[0]=="number"){var bi=Ht.allocType(Rn.dtype,Ln.length);Ju(bi,Ln),Un(bi,Po),Ht.freeType(bi)}else if(Array.isArray(Ln[0])||_r(Ln[0])){da=bs(Ln);var Zn=lo(Ln,da,Rn.dtype);Un(Zn,Po),Ht.freeType(Zn)}else he.raise("invalid buffer data")}else if(ol(Ln)){da=Ln.shape;var Sn=Ln.stride,Wt=0,K=0,Ei=0,Ee=0;da.length===1?(Wt=da[0],K=1,Ei=Sn[0],Ee=0):da.length===2?(Wt=da[0],K=da[1],Ei=Sn[0],Ee=Sn[1]):he.raise("invalid shape");var sa=Array.isArray(Ln.data)?Rn.dtype:Fu(Ln.data),Jo=Ht.allocType(sa,Wt*K);al(Jo,Ln.data,Wt,K,Ei,Ee,Ln.offset),Un(Jo,Po),Ht.freeType(Jo)}else he.raise("invalid data for buffer subdata");return xi}return Xn||xi(Tr),xi._reglType="buffer",xi._buffer=Rn,xi.subdata=Oi,Zt.profile&&(xi.stats=Rn.stats),xi.destroy=function(){ci(Rn)},xi}function Yn(){Qa(Yr).forEach(function(Tr){Tr.buffer=Pe.createBuffer(),Pe.bindBuffer(Tr.type,Tr.buffer),Pe.bufferData(Tr.type,Tr.persistentData||Tr.byteLength,Tr.usage)})}return Zt.profile&&(_t.getTotalBufferSize=function(){var Tr=0;return Object.keys(Yr).forEach(function(en){Tr+=Yr[en].stats.size}),Tr}),{create:Vn,createStream:Bn,destroyStream:si,clear:function(){Qa(Yr).forEach(ci),Wn.forEach(ci)},getBuffer:function(Tr){return Tr&&Tr._buffer instanceof Or?Tr._buffer:null},restore:Yn,_initBuffer:qn}}var ou=0,Ks=0,Lp=1,gf=1,Of=4,qh=4,zc={points:ou,point:Ks,lines:Lp,line:gf,triangles:Of,triangle:qh,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Oh=0,Ms=1,Jc=4,Yh=5120,Qc=5121,uc=5122,eh=5123,yh=5124,sl=5125,Uc=34963,bc=35040,fp=35044;function dp(Pe,_t,Zt,qr){var wn={},Yr=0,Or={uint8:Qc,uint16:eh};_t.oes_element_index_uint&&(Or.uint32=sl);function Wn(Yn){this.id=Yr++,wn[this.id]=this,this.buffer=Yn,this.primType=Jc,this.vertCount=0,this.type=0}Wn.prototype.bind=function(){this.buffer.bind()};var Bn=[];function si(Yn){var Tr=Bn.pop();return Tr||(Tr=new Wn(Zt.create(null,Uc,!0,!1)._buffer)),qn(Tr,Yn,bc,-1,-1,0,0),Tr}function Hn(Yn){Bn.push(Yn)}function qn(Yn,Tr,en,Xn,_i,Rn,xi){Yn.buffer.bind();var Un;if(Tr){var Oi=xi;!xi&&(!_r(Tr)||ol(Tr)&&!_r(Tr.data))&&(Oi=_t.oes_element_index_uint?sl:eh),Zt._initBuffer(Yn.buffer,Tr,en,Oi,3)}else Pe.bufferData(Uc,Rn,en),Yn.buffer.dtype=Un||Qc,Yn.buffer.usage=en,Yn.buffer.dimension=3,Yn.buffer.byteLength=Rn;if(Un=xi,!xi){switch(Yn.buffer.dtype){case Qc:case Yh:Un=Qc;break;case eh:case uc:Un=eh;break;case sl:case yh:Un=sl;break;default:he.raise("unsupported type for element array")}Yn.buffer.dtype=Un}Yn.type=Un,he(Un!==sl||!!_t.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var Ln=_i;Ln<0&&(Ln=Yn.buffer.byteLength,Un===eh?Ln>>=1:Un===sl&&(Ln>>=2)),Yn.vertCount=Ln;var wi=Xn;if(Xn<0){wi=Jc;var Po=Yn.buffer.dimension;Po===1&&(wi=Oh),Po===2&&(wi=Ms),Po===3&&(wi=Jc)}Yn.primType=wi}function ci(Yn){qr.elementsCount--,he(Yn.buffer!==null,"must not double destroy elements"),delete wn[Yn.id],Yn.buffer.destroy(),Yn.buffer=null}function Vn(Yn,Tr){var en=Zt.create(null,Uc,!0),Xn=new Wn(en._buffer);qr.elementsCount++;function _i(Rn){if(!Rn)en(),Xn.primType=Jc,Xn.vertCount=0,Xn.type=Qc;else if(typeof Rn=="number")en(Rn),Xn.primType=Jc,Xn.vertCount=Rn|0,Xn.type=Qc;else{var xi=null,Un=fp,Oi=-1,Ln=-1,wi=0,Po=0;Array.isArray(Rn)||_r(Rn)||ol(Rn)?xi=Rn:(he.type(Rn,"object","invalid arguments for elements"),"data"in Rn&&(xi=Rn.data,he(Array.isArray(xi)||_r(xi)||ol(xi),"invalid data for element buffer")),"usage"in Rn&&(he.parameter(Rn.usage,Ku,"invalid element buffer usage"),Un=Ku[Rn.usage]),"primitive"in Rn&&(he.parameter(Rn.primitive,zc,"invalid element buffer primitive"),Oi=zc[Rn.primitive]),"count"in Rn&&(he(typeof Rn.count=="number"&&Rn.count>=0,"invalid vertex count for elements"),Ln=Rn.count|0),"type"in Rn&&(he.parameter(Rn.type,Or,"invalid buffer type"),Po=Or[Rn.type]),"length"in Rn?wi=Rn.length|0:(wi=Ln,Po===eh||Po===uc?wi*=2:(Po===sl||Po===yh)&&(wi*=4))),qn(Xn,xi,Un,Oi,Ln,wi,Po)}return _i}return _i(Yn),_i._reglType="elements",_i._elements=Xn,_i.subdata=function(Rn,xi){return en.subdata(Rn,xi),_i},_i.destroy=function(){ci(Xn)},_i}return{create:Vn,createStream:si,destroyStream:Hn,getElements:function(Yn){return typeof Yn=="function"&&Yn._elements instanceof Wn?Yn._elements:null},clear:function(){Qa(wn).forEach(ci)}}}var Ps=new Float32Array(1),Gf=new Uint32Array(Ps.buffer),Xp=5123;function cc(Pe){for(var _t=Ht.allocType(Xp,Pe.length),Zt=0;Zt<Pe.length;++Zt)if(isNaN(Pe[Zt]))_t[Zt]=65535;else if(Pe[Zt]===1/0)_t[Zt]=31744;else if(Pe[Zt]===-1/0)_t[Zt]=64512;else{Ps[0]=Pe[Zt];var qr=Gf[0],wn=qr>>>31<<15,Yr=(qr<<1>>>24)-127,Or=qr>>13&1024-1;if(Yr<-24)_t[Zt]=wn;else if(Yr<-14){var Wn=-14-Yr;_t[Zt]=wn+(Or+1024>>Wn)}else Yr>15?_t[Zt]=wn+31744:_t[Zt]=wn+(Yr+15<<10)+Or}return _t}function zl(Pe){return Array.isArray(Pe)||_r(Pe)}var Ec=function(Pe){return!(Pe&Pe-1)&&!!Pe},th=34467,vu=3553,xh=34067,qa=34069,Hs=6408,Ep=6406,Na=6407,Qu=6409,Is=6410,ys=32854,ec=32855,Bf=36194,es=32819,Bs=32820,wc=33635,qp=34042,Sc=6402,$h=34041,Xo=35904,au=35906,dl=36193,tc=33776,bh=33777,mp=33778,Kh=33779,Zc=35986,vf=35987,Bh=34798,_u=35840,Vc=35841,Yp=35842,Fh=35843,Ll=36196,Fs=5121,Tc=5123,Ru=5125,jc=5126,$p=10242,Jh=10243,Ac=10497,kh=33071,Iu=33648,rh=10240,gp=10241,vp=9728,Kp=9729,Hc=9984,Eh=9985,yu=9986,Ya=9987,nh=33170,Gc=4352,ih=4353,Sa=4354,cs=34046,ku=3317,rc=37440,xu=37441,oh=37443,Cc=37444,ah=33984,Qh=[Hc,yu,Eh,Ya],sh=[0,Qu,Is,Na,Hs],Ul={};Ul[Qu]=Ul[Ep]=Ul[Sc]=1,Ul[$h]=Ul[Is]=2,Ul[Na]=Ul[Xo]=3,Ul[Hs]=Ul[au]=4;function ll(Pe){return"[object "+Pe+"]"}var Wc=ll("HTMLCanvasElement"),vl=ll("OffscreenCanvas"),oi=ll("CanvasRenderingContext2D"),fi=ll("ImageBitmap"),tu=ll("HTMLImageElement"),bu=ll("HTMLVideoElement"),Dp=Object.keys(oo).concat([Wc,vl,oi,fi,tu,bu]),ai=[];ai[Fs]=1,ai[jc]=4,ai[dl]=2,ai[Tc]=2,ai[Ru]=4;var is=[];is[ys]=2,is[ec]=2,is[Bf]=2,is[$h]=4,is[tc]=.5,is[bh]=.5,is[mp]=1,is[Kh]=1,is[Zc]=.5,is[vf]=1,is[Bh]=1,is[_u]=.5,is[Vc]=.25,is[Yp]=.5,is[Fh]=.25,is[Ll]=.5;function ep(Pe){return Array.isArray(Pe)&&(Pe.length===0||typeof Pe[0]=="number")}function mi(Pe){if(!Array.isArray(Pe))return!1;var _t=Pe.length;return!(_t===0||!zl(Pe[0]))}function Mc(Pe){return Object.prototype.toString.call(Pe)}function Op(Pe){return Mc(Pe)===Wc}function Jp(Pe){return Mc(Pe)===vl}function Xc(Pe){return Mc(Pe)===oi}function hc(Pe){return Mc(Pe)===fi}function wh(Pe){return Mc(Pe)===tu}function Pc(Pe){return Mc(Pe)===bu}function Xl(Pe){if(!Pe)return!1;var _t=Mc(Pe);return Dp.indexOf(_t)>=0?!0:ep(Pe)||mi(Pe)||ol(Pe)}function Rc(Pe){return oo[Object.prototype.toString.call(Pe)]|0}function Eu(Pe,_t){var Zt=_t.length;switch(Pe.type){case Fs:case Tc:case Ru:case jc:var qr=Ht.allocType(Pe.type,Zt);qr.set(_t),Pe.data=qr;break;case dl:Pe.data=cc(_t);break;default:he.raise("unsupported texture type, must specify a typed array")}}function lh(Pe,_t){return Ht.allocType(Pe.type===dl?jc:Pe.type,_t)}function tp(Pe,_t){Pe.type===dl?(Pe.data=cc(_t),Ht.freeType(_t)):Pe.data=_t}function rp(Pe,_t,Zt,qr,wn,Yr){for(var Or=Pe.width,Wn=Pe.height,Bn=Pe.channels,si=Or*Wn*Bn,Hn=lh(Pe,si),qn=0,ci=0;ci<Wn;++ci)for(var Vn=0;Vn<Or;++Vn)for(var Yn=0;Yn<Bn;++Yn)Hn[qn++]=_t[Zt*Vn+qr*ci+wn*Yn+Yr];tp(Pe,Hn)}function su(Pe,_t,Zt,qr,wn,Yr){var Or;if(typeof is[Pe]!="undefined"?Or=is[Pe]:Or=Ul[Pe]*ai[_t],Yr&&(Or*=6),wn){for(var Wn=0,Bn=Zt;Bn>=1;)Wn+=Or*Bn*Bn,Bn/=2;return Wn}else return Or*Zt*qr}function ql(Pe,_t,Zt,qr,wn,Yr,Or){var Wn={"don't care":Gc,"dont care":Gc,nice:Sa,fast:ih},Bn={repeat:Ac,clamp:kh,mirror:Iu},si={nearest:vp,linear:Kp},Hn=Se({mipmap:Ya,"nearest mipmap nearest":Hc,"linear mipmap nearest":Eh,"nearest mipmap linear":yu,"linear mipmap linear":Ya},si),qn={none:0,browser:Cc},ci={uint8:Fs,rgba4:es,rgb565:wc,"rgb5 a1":Bs},Vn={alpha:Ep,luminance:Qu,"luminance alpha":Is,rgb:Na,rgba:Hs,rgba4:ys,"rgb5 a1":ec,rgb565:Bf},Yn={};_t.ext_srgb&&(Vn.srgb=Xo,Vn.srgba=au),_t.oes_texture_float&&(ci.float32=ci.float=jc),_t.oes_texture_half_float&&(ci.float16=ci["half float"]=dl),_t.webgl_depth_texture&&(Se(Vn,{depth:Sc,"depth stencil":$h}),Se(ci,{uint16:Tc,uint32:Ru,"depth stencil":qp})),_t.webgl_compressed_texture_s3tc&&Se(Yn,{"rgb s3tc dxt1":tc,"rgba s3tc dxt1":bh,"rgba s3tc dxt3":mp,"rgba s3tc dxt5":Kh}),_t.webgl_compressed_texture_atc&&Se(Yn,{"rgb atc":Zc,"rgba atc explicit alpha":vf,"rgba atc interpolated alpha":Bh}),_t.webgl_compressed_texture_pvrtc&&Se(Yn,{"rgb pvrtc 4bppv1":_u,"rgb pvrtc 2bppv1":Vc,"rgba pvrtc 4bppv1":Yp,"rgba pvrtc 2bppv1":Fh}),_t.webgl_compressed_texture_etc1&&(Yn["rgb etc1"]=Ll);var Tr=Array.prototype.slice.call(Pe.getParameter(th));Object.keys(Yn).forEach(function(Ft){var Xr=Yn[Ft];Tr.indexOf(Xr)>=0&&(Vn[Ft]=Xr)});var en=Object.keys(Vn);Zt.textureFormats=en;var Xn=[];Object.keys(Vn).forEach(function(Ft){var Xr=Vn[Ft];Xn[Xr]=Ft});var _i=[];Object.keys(ci).forEach(function(Ft){var Xr=ci[Ft];_i[Xr]=Ft});var Rn=[];Object.keys(si).forEach(function(Ft){var Xr=si[Ft];Rn[Xr]=Ft});var xi=[];Object.keys(Hn).forEach(function(Ft){var Xr=Hn[Ft];xi[Xr]=Ft});var Un=[];Object.keys(Bn).forEach(function(Ft){var Xr=Bn[Ft];Un[Xr]=Ft});var Oi=en.reduce(function(Ft,Xr){var Mr=Vn[Xr];return Mr===Qu||Mr===Ep||Mr===Qu||Mr===Is||Mr===Sc||Mr===$h||_t.ext_srgb&&(Mr===Xo||Mr===au)?Ft[Mr]=Mr:Mr===ec||Xr.indexOf("rgba")>=0?Ft[Mr]=Hs:Ft[Mr]=Na,Ft},{});function Ln(){this.internalformat=Hs,this.format=Hs,this.type=Fs,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Cc,this.width=0,this.height=0,this.channels=0}function wi(Ft,Xr){Ft.internalformat=Xr.internalformat,Ft.format=Xr.format,Ft.type=Xr.type,Ft.compressed=Xr.compressed,Ft.premultiplyAlpha=Xr.premultiplyAlpha,Ft.flipY=Xr.flipY,Ft.unpackAlignment=Xr.unpackAlignment,Ft.colorSpace=Xr.colorSpace,Ft.width=Xr.width,Ft.height=Xr.height,Ft.channels=Xr.channels}function Po(Ft,Xr){if(!(typeof Xr!="object"||!Xr)){if("premultiplyAlpha"in Xr&&(he.type(Xr.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),Ft.premultiplyAlpha=Xr.premultiplyAlpha),"flipY"in Xr&&(he.type(Xr.flipY,"boolean","invalid texture flip"),Ft.flipY=Xr.flipY),"alignment"in Xr&&(he.oneOf(Xr.alignment,[1,2,4,8],"invalid texture unpack alignment"),Ft.unpackAlignment=Xr.alignment),"colorSpace"in Xr&&(he.parameter(Xr.colorSpace,qn,"invalid colorSpace"),Ft.colorSpace=qn[Xr.colorSpace]),"type"in Xr){var Mr=Xr.type;he(_t.oes_texture_float||!(Mr==="float"||Mr==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),he(_t.oes_texture_half_float||!(Mr==="half float"||Mr==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),he(_t.webgl_depth_texture||!(Mr==="uint16"||Mr==="uint32"||Mr==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),he.parameter(Mr,ci,"invalid texture type"),Ft.type=ci[Mr]}var Bi=Ft.width,Ma=Ft.height,el=Ft.channels,st=!1;"shape"in Xr?(he(Array.isArray(Xr.shape)&&Xr.shape.length>=2,"shape must be an array"),Bi=Xr.shape[0],Ma=Xr.shape[1],Xr.shape.length===3&&(el=Xr.shape[2],he(el>0&&el<=4,"invalid number of channels"),st=!0),he(Bi>=0&&Bi<=Zt.maxTextureSize,"invalid width"),he(Ma>=0&&Ma<=Zt.maxTextureSize,"invalid height")):("radius"in Xr&&(Bi=Ma=Xr.radius,he(Bi>=0&&Bi<=Zt.maxTextureSize,"invalid radius")),"width"in Xr&&(Bi=Xr.width,he(Bi>=0&&Bi<=Zt.maxTextureSize,"invalid width")),"height"in Xr&&(Ma=Xr.height,he(Ma>=0&&Ma<=Zt.maxTextureSize,"invalid height")),"channels"in Xr&&(el=Xr.channels,he(el>0&&el<=4,"invalid number of channels"),st=!0)),Ft.width=Bi|0,Ft.height=Ma|0,Ft.channels=el|0;var Et=!1;if("format"in Xr){var Vt=Xr.format;he(_t.webgl_depth_texture||!(Vt==="depth"||Vt==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),he.parameter(Vt,Vn,"invalid texture format");var Br=Ft.internalformat=Vn[Vt];Ft.format=Oi[Br],Vt in ci&&("type"in Xr||(Ft.type=ci[Vt])),Vt in Yn&&(Ft.compressed=!0),Et=!0}!st&&Et?Ft.channels=Ul[Ft.format]:st&&!Et?Ft.channels!==sh[Ft.format]&&(Ft.format=Ft.internalformat=sh[Ft.channels]):Et&&st&&he(Ft.channels===Ul[Ft.format],"number of channels inconsistent with specified format")}}function da(Ft){Pe.pixelStorei(rc,Ft.flipY),Pe.pixelStorei(xu,Ft.premultiplyAlpha),Pe.pixelStorei(oh,Ft.colorSpace),Pe.pixelStorei(ku,Ft.unpackAlignment)}function bi(){Ln.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Zn(Ft,Xr){var Mr=null;if(Xl(Xr)?Mr=Xr:Xr&&(he.type(Xr,"object","invalid pixel data type"),Po(Ft,Xr),"x"in Xr&&(Ft.xOffset=Xr.x|0),"y"in Xr&&(Ft.yOffset=Xr.y|0),Xl(Xr.data)&&(Mr=Xr.data)),he(!Ft.compressed||Mr instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),Xr.copy){he(!Mr,"can not specify copy and data field for the same texture");var Bi=wn.viewportWidth,Ma=wn.viewportHeight;Ft.width=Ft.width||Bi-Ft.xOffset,Ft.height=Ft.height||Ma-Ft.yOffset,Ft.needsCopy=!0,he(Ft.xOffset>=0&&Ft.xOffset<Bi&&Ft.yOffset>=0&&Ft.yOffset<Ma&&Ft.width>0&&Ft.width<=Bi&&Ft.height>0&&Ft.height<=Ma,"copy texture read out of bounds")}else if(!Mr)Ft.width=Ft.width||1,Ft.height=Ft.height||1,Ft.channels=Ft.channels||4;else if(_r(Mr))Ft.channels=Ft.channels||4,Ft.data=Mr,!("type"in Xr)&&Ft.type===Fs&&(Ft.type=Rc(Mr));else if(ep(Mr))Ft.channels=Ft.channels||4,Eu(Ft,Mr),Ft.alignment=1,Ft.needsFree=!0;else if(ol(Mr)){var el=Mr.data;!Array.isArray(el)&&Ft.type===Fs&&(Ft.type=Rc(el));var st=Mr.shape,Et=Mr.stride,Vt,Br,Ir,Jt,sr,lr;st.length===3?(Ir=st[2],lr=Et[2]):(he(st.length===2,"invalid ndarray pixel data, must be 2 or 3D"),Ir=1,lr=1),Vt=st[0],Br=st[1],Jt=Et[0],sr=Et[1],Ft.alignment=1,Ft.width=Vt,Ft.height=Br,Ft.channels=Ir,Ft.format=Ft.internalformat=sh[Ir],Ft.needsFree=!0,rp(Ft,el,Jt,sr,lr,Mr.offset)}else if(Op(Mr)||Jp(Mr)||Xc(Mr))Op(Mr)||Jp(Mr)?Ft.element=Mr:Ft.element=Mr.canvas,Ft.width=Ft.element.width,Ft.height=Ft.element.height,Ft.channels=4;else if(hc(Mr))Ft.element=Mr,Ft.width=Mr.width,Ft.height=Mr.height,Ft.channels=4;else if(wh(Mr))Ft.element=Mr,Ft.width=Mr.naturalWidth,Ft.height=Mr.naturalHeight,Ft.channels=4;else if(Pc(Mr))Ft.element=Mr,Ft.width=Mr.videoWidth,Ft.height=Mr.videoHeight,Ft.channels=4;else if(mi(Mr)){var Mt=Ft.width||Mr[0].length,Xt=Ft.height||Mr.length,pt=Ft.channels;zl(Mr[0][0])?pt=pt||Mr[0][0].length:pt=pt||1;for(var $t=Gl.shape(Mr),zr=1,$r=0;$r<$t.length;++$r)zr*=$t[$r];var Tn=lh(Ft,zr);Gl.flatten(Mr,$t,"",Tn),tp(Ft,Tn),Ft.alignment=1,Ft.width=Mt,Ft.height=Xt,Ft.channels=pt,Ft.format=Ft.internalformat=sh[pt],Ft.needsFree=!0}Ft.type===jc?he(Zt.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):Ft.type===dl&&he(Zt.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function Sn(Ft,Xr,Mr){var Bi=Ft.element,Ma=Ft.data,el=Ft.internalformat,st=Ft.format,Et=Ft.type,Vt=Ft.width,Br=Ft.height;da(Ft),Bi?Pe.texImage2D(Xr,Mr,st,st,Et,Bi):Ft.compressed?Pe.compressedTexImage2D(Xr,Mr,el,Vt,Br,0,Ma):Ft.needsCopy?(qr(),Pe.copyTexImage2D(Xr,Mr,st,Ft.xOffset,Ft.yOffset,Vt,Br,0)):Pe.texImage2D(Xr,Mr,st,Vt,Br,0,st,Et,Ma||null)}function Wt(Ft,Xr,Mr,Bi,Ma){var el=Ft.element,st=Ft.data,Et=Ft.internalformat,Vt=Ft.format,Br=Ft.type,Ir=Ft.width,Jt=Ft.height;da(Ft),el?Pe.texSubImage2D(Xr,Ma,Mr,Bi,Vt,Br,el):Ft.compressed?Pe.compressedTexSubImage2D(Xr,Ma,Mr,Bi,Et,Ir,Jt,st):Ft.needsCopy?(qr(),Pe.copyTexSubImage2D(Xr,Ma,Mr,Bi,Ft.xOffset,Ft.yOffset,Ir,Jt)):Pe.texSubImage2D(Xr,Ma,Mr,Bi,Ir,Jt,Vt,Br,st)}var K=[];function Ei(){return K.pop()||new bi}function Ee(Ft){Ft.needsFree&&Ht.freeType(Ft.data),bi.call(Ft),K.push(Ft)}function sa(){Ln.call(this),this.genMipmaps=!1,this.mipmapHint=Gc,this.mipmask=0,this.images=Array(16)}function Jo(Ft,Xr,Mr){var Bi=Ft.images[0]=Ei();Ft.mipmask=1,Bi.width=Ft.width=Xr,Bi.height=Ft.height=Mr,Bi.channels=Ft.channels=4}function Es(Ft,Xr){var Mr=null;if(Xl(Xr))Mr=Ft.images[0]=Ei(),wi(Mr,Ft),Zn(Mr,Xr),Ft.mipmask=1;else if(Po(Ft,Xr),Array.isArray(Xr.mipmap))for(var Bi=Xr.mipmap,Ma=0;Ma<Bi.length;++Ma)Mr=Ft.images[Ma]=Ei(),wi(Mr,Ft),Mr.width>>=Ma,Mr.height>>=Ma,Zn(Mr,Bi[Ma]),Ft.mipmask|=1<<Ma;else Mr=Ft.images[0]=Ei(),wi(Mr,Ft),Zn(Mr,Xr),Ft.mipmask=1;wi(Ft,Ft.images[0]),Ft.compressed&&(Ft.internalformat===tc||Ft.internalformat===bh||Ft.internalformat===mp||Ft.internalformat===Kh)&&he(Ft.width%4===0&&Ft.height%4===0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function Cu(Ft,Xr){for(var Mr=Ft.images,Bi=0;Bi<Mr.length;++Bi){if(!Mr[Bi])return;Sn(Mr[Bi],Xr,Bi)}}var Bl=[];function as(){var Ft=Bl.pop()||new sa;Ln.call(Ft),Ft.mipmask=0;for(var Xr=0;Xr<16;++Xr)Ft.images[Xr]=null;return Ft}function fu(Ft){for(var Xr=Ft.images,Mr=0;Mr<Xr.length;++Mr)Xr[Mr]&&Ee(Xr[Mr]),Xr[Mr]=null;Bl.push(Ft)}function Js(){this.minFilter=vp,this.magFilter=vp,this.wrapS=kh,this.wrapT=kh,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Gc}function ps(Ft,Xr){if("min"in Xr){var Mr=Xr.min;he.parameter(Mr,Hn),Ft.minFilter=Hn[Mr],Qh.indexOf(Ft.minFilter)>=0&&!("faces"in Xr)&&(Ft.genMipmaps=!0)}if("mag"in Xr){var Bi=Xr.mag;he.parameter(Bi,si),Ft.magFilter=si[Bi]}var Ma=Ft.wrapS,el=Ft.wrapT;if("wrap"in Xr){var st=Xr.wrap;typeof st=="string"?(he.parameter(st,Bn),Ma=el=Bn[st]):Array.isArray(st)&&(he.parameter(st[0],Bn),he.parameter(st[1],Bn),Ma=Bn[st[0]],el=Bn[st[1]])}else{if("wrapS"in Xr){var Et=Xr.wrapS;he.parameter(Et,Bn),Ma=Bn[Et]}if("wrapT"in Xr){var Vt=Xr.wrapT;he.parameter(Vt,Bn),el=Bn[Vt]}}if(Ft.wrapS=Ma,Ft.wrapT=el,"anisotropic"in Xr){var Br=Xr.anisotropic;he(typeof Br=="number"&&Br>=1&&Br<=Zt.maxAnisotropic,"aniso samples must be between 1 and "),Ft.anisotropic=Xr.anisotropic}if("mipmap"in Xr){var Ir=!1;switch(typeof Xr.mipmap){case"string":he.parameter(Xr.mipmap,Wn,"invalid mipmap hint"),Ft.mipmapHint=Wn[Xr.mipmap],Ft.genMipmaps=!0,Ir=!0;break;case"boolean":Ir=Ft.genMipmaps=Xr.mipmap;break;case"object":he(Array.isArray(Xr.mipmap),"invalid mipmap type"),Ft.genMipmaps=!1,Ir=!0;break;default:he.raise("invalid mipmap type")}Ir&&!("min"in Xr)&&(Ft.minFilter=Hc)}}function du(Ft,Xr){Pe.texParameteri(Xr,gp,Ft.minFilter),Pe.texParameteri(Xr,rh,Ft.magFilter),Pe.texParameteri(Xr,$p,Ft.wrapS),Pe.texParameteri(Xr,Jh,Ft.wrapT),_t.ext_texture_filter_anisotropic&&Pe.texParameteri(Xr,cs,Ft.anisotropic),Ft.genMipmaps&&(Pe.hint(nh,Ft.mipmapHint),Pe.generateMipmap(Xr))}var ru=0,uu={},za=Zt.maxTextureUnits,Mu=Array(za).map(function(){return null});function Ca(Ft){Ln.call(this),this.mipmask=0,this.internalformat=Hs,this.id=ru++,this.refCount=1,this.target=Ft,this.texture=Pe.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Js,Or.profile&&(this.stats={size:0})}function mu(Ft){Pe.activeTexture(ah),Pe.bindTexture(Ft.target,Ft.texture)}function ss(){var Ft=Mu[0];Ft?Pe.bindTexture(Ft.target,Ft.texture):Pe.bindTexture(vu,null)}function go(Ft){var Xr=Ft.texture;he(Xr,"must not double destroy texture");var Mr=Ft.unit,Bi=Ft.target;Mr>=0&&(Pe.activeTexture(ah+Mr),Pe.bindTexture(Bi,null),Mu[Mr]=null),Pe.deleteTexture(Xr),Ft.texture=null,Ft.params=null,Ft.pixels=null,Ft.refCount=0,delete uu[Ft.id],Yr.textureCount--}Se(Ca.prototype,{bind:function(){var Ft=this;Ft.bindCount+=1;var Xr=Ft.unit;if(Xr<0){for(var Mr=0;Mr<za;++Mr){var Bi=Mu[Mr];if(Bi){if(Bi.bindCount>0)continue;Bi.unit=-1}Mu[Mr]=Ft,Xr=Mr;break}Xr>=za&&he.raise("insufficient number of texture units"),Or.profile&&Yr.maxTextureUnits<Xr+1&&(Yr.maxTextureUnits=Xr+1),Ft.unit=Xr,Pe.activeTexture(ah+Xr),Pe.bindTexture(Ft.target,Ft.texture)}return Xr},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&go(this)}});function ya(Ft,Xr){var Mr=new Ca(vu);uu[Mr.id]=Mr,Yr.textureCount++;function Bi(st,Et){var Vt=Mr.texInfo;Js.call(Vt);var Br=as();return typeof st=="number"?typeof Et=="number"?Jo(Br,st|0,Et|0):Jo(Br,st|0,st|0):st?(he.type(st,"object","invalid arguments to regl.texture"),ps(Vt,st),Es(Br,st)):Jo(Br,1,1),Vt.genMipmaps&&(Br.mipmask=(Br.width<<1)-1),Mr.mipmask=Br.mipmask,wi(Mr,Br),he.texture2D(Vt,Br,Zt),Mr.internalformat=Br.internalformat,Bi.width=Br.width,Bi.height=Br.height,mu(Mr),Cu(Br,vu),du(Vt,vu),ss(),fu(Br),Or.profile&&(Mr.stats.size=su(Mr.internalformat,Mr.type,Br.width,Br.height,Vt.genMipmaps,!1)),Bi.format=Xn[Mr.internalformat],Bi.type=_i[Mr.type],Bi.mag=Rn[Vt.magFilter],Bi.min=xi[Vt.minFilter],Bi.wrapS=Un[Vt.wrapS],Bi.wrapT=Un[Vt.wrapT],Bi}function Ma(st,Et,Vt,Br){he(!!st,"must specify image data");var Ir=Et|0,Jt=Vt|0,sr=Br|0,lr=Ei();return wi(lr,Mr),lr.width=0,lr.height=0,Zn(lr,st),lr.width=lr.width||(Mr.width>>sr)-Ir,lr.height=lr.height||(Mr.height>>sr)-Jt,he(Mr.type===lr.type&&Mr.format===lr.format&&Mr.internalformat===lr.internalformat,"incompatible format for texture.subimage"),he(Ir>=0&&Jt>=0&&Ir+lr.width<=Mr.width&&Jt+lr.height<=Mr.height,"texture.subimage write out of bounds"),he(Mr.mipmask&1<<sr,"missing mipmap data"),he(lr.data||lr.element||lr.needsCopy,"missing image data"),mu(Mr),Wt(lr,vu,Ir,Jt,sr),ss(),Ee(lr),Bi}function el(st,Et){var Vt=st|0,Br=Et|0||Vt;if(Vt===Mr.width&&Br===Mr.height)return Bi;Bi.width=Mr.width=Vt,Bi.height=Mr.height=Br,mu(Mr);for(var Ir=0;Mr.mipmask>>Ir;++Ir){var Jt=Vt>>Ir,sr=Br>>Ir;if(!Jt||!sr)break;Pe.texImage2D(vu,Ir,Mr.format,Jt,sr,0,Mr.format,Mr.type,null)}return ss(),Or.profile&&(Mr.stats.size=su(Mr.internalformat,Mr.type,Vt,Br,!1,!1)),Bi}return Bi(Ft,Xr),Bi.subimage=Ma,Bi.resize=el,Bi._reglType="texture2d",Bi._texture=Mr,Or.profile&&(Bi.stats=Mr.stats),Bi.destroy=function(){Mr.decRef()},Bi}function Qo(Ft,Xr,Mr,Bi,Ma,el){var st=new Ca(xh);uu[st.id]=st,Yr.cubeCount++;var Et=new Array(6);function Vt(Jt,sr,lr,Mt,Xt,pt){var $t,zr=st.texInfo;for(Js.call(zr),$t=0;$t<6;++$t)Et[$t]=as();if(typeof Jt=="number"||!Jt){var $r=Jt|0||1;for($t=0;$t<6;++$t)Jo(Et[$t],$r,$r)}else if(typeof Jt=="object")if(sr)Es(Et[0],Jt),Es(Et[1],sr),Es(Et[2],lr),Es(Et[3],Mt),Es(Et[4],Xt),Es(Et[5],pt);else if(ps(zr,Jt),Po(st,Jt),"faces"in Jt){var Tn=Jt.faces;for(he(Array.isArray(Tn)&&Tn.length===6,"cube faces must be a length 6 array"),$t=0;$t<6;++$t)he(typeof Tn[$t]=="object"&&!!Tn[$t],"invalid input for cube map face"),wi(Et[$t],st),Es(Et[$t],Tn[$t])}else for($t=0;$t<6;++$t)Es(Et[$t],Jt);else he.raise("invalid arguments to cube map");for(wi(st,Et[0]),Zt.npotTextureCube||he(Ec(st.width)&&Ec(st.height),"your browser does not support non power or two texture dimensions"),zr.genMipmaps?st.mipmask=(Et[0].width<<1)-1:st.mipmask=Et[0].mipmask,he.textureCube(st,zr,Et,Zt),st.internalformat=Et[0].internalformat,Vt.width=Et[0].width,Vt.height=Et[0].height,mu(st),$t=0;$t<6;++$t)Cu(Et[$t],qa+$t);for(du(zr,xh),ss(),Or.profile&&(st.stats.size=su(st.internalformat,st.type,Vt.width,Vt.height,zr.genMipmaps,!0)),Vt.format=Xn[st.internalformat],Vt.type=_i[st.type],Vt.mag=Rn[zr.magFilter],Vt.min=xi[zr.minFilter],Vt.wrapS=Un[zr.wrapS],Vt.wrapT=Un[zr.wrapT],$t=0;$t<6;++$t)fu(Et[$t]);return Vt}function Br(Jt,sr,lr,Mt,Xt){he(!!sr,"must specify image data"),he(typeof Jt=="number"&&Jt===(Jt|0)&&Jt>=0&&Jt<6,"invalid face");var pt=lr|0,$t=Mt|0,zr=Xt|0,$r=Ei();return wi($r,st),$r.width=0,$r.height=0,Zn($r,sr),$r.width=$r.width||(st.width>>zr)-pt,$r.height=$r.height||(st.height>>zr)-$t,he(st.type===$r.type&&st.format===$r.format&&st.internalformat===$r.internalformat,"incompatible format for texture.subimage"),he(pt>=0&&$t>=0&&pt+$r.width<=st.width&&$t+$r.height<=st.height,"texture.subimage write out of bounds"),he(st.mipmask&1<<zr,"missing mipmap data"),he($r.data||$r.element||$r.needsCopy,"missing image data"),mu(st),Wt($r,qa+Jt,pt,$t,zr),ss(),Ee($r),Vt}function Ir(Jt){var sr=Jt|0;if(sr!==st.width){Vt.width=st.width=sr,Vt.height=st.height=sr,mu(st);for(var lr=0;lr<6;++lr)for(var Mt=0;st.mipmask>>Mt;++Mt)Pe.texImage2D(qa+lr,Mt,st.format,sr>>Mt,sr>>Mt,0,st.format,st.type,null);return ss(),Or.profile&&(st.stats.size=su(st.internalformat,st.type,Vt.width,Vt.height,!1,!0)),Vt}}return Vt(Ft,Xr,Mr,Bi,Ma,el),Vt.subimage=Br,Vt.resize=Ir,Vt._reglType="textureCube",Vt._texture=st,Or.profile&&(Vt.stats=st.stats),Vt.destroy=function(){st.decRef()},Vt}function Qs(){for(var Ft=0;Ft<za;++Ft)Pe.activeTexture(ah+Ft),Pe.bindTexture(vu,null),Mu[Ft]=null;Qa(uu).forEach(go),Yr.cubeCount=0,Yr.textureCount=0}Or.profile&&(Yr.getTotalTextureSize=function(){var Ft=0;return Object.keys(uu).forEach(function(Xr){Ft+=uu[Xr].stats.size}),Ft});function Cp(){for(var Ft=0;Ft<za;++Ft){var Xr=Mu[Ft];Xr&&(Xr.bindCount=0,Xr.unit=-1,Mu[Ft]=null)}Qa(uu).forEach(function(Mr){Mr.texture=Pe.createTexture(),Pe.bindTexture(Mr.target,Mr.texture);for(var Bi=0;Bi<32;++Bi)if(Mr.mipmask&1<<Bi)if(Mr.target===vu)Pe.texImage2D(vu,Bi,Mr.internalformat,Mr.width>>Bi,Mr.height>>Bi,0,Mr.internalformat,Mr.type,null);else for(var Ma=0;Ma<6;++Ma)Pe.texImage2D(qa+Ma,Bi,Mr.internalformat,Mr.width>>Bi,Mr.height>>Bi,0,Mr.internalformat,Mr.type,null);du(Mr.texInfo,Mr.target)})}return{create2D:ya,createCube:Qo,clear:Qs,getTexture:function(Ft){return null},restore:Cp}}var fa=36161,Rs=32854,hs=32855,lu=36194,wu=33189,uh=36168,ch=34041,Nu=35907,Qp=34836,Gi=34842,Si=34843,ji=[];ji[Rs]=2,ji[hs]=2,ji[lu]=2,ji[wu]=2,ji[uh]=1,ji[ch]=4,ji[Nu]=4,ji[Qp]=16,ji[Gi]=8,ji[Si]=6;function ao(Pe,_t,Zt){return ji[Pe]*_t*Zt}var Ic=function(Pe,_t,Zt,qr,wn){var Yr={rgba4:Rs,rgb565:lu,"rgb5 a1":hs,depth:wu,stencil:uh,"depth stencil":ch};_t.ext_srgb&&(Yr.srgba=Nu),_t.ext_color_buffer_half_float&&(Yr.rgba16f=Gi,Yr.rgb16f=Si),_t.webgl_color_buffer_float&&(Yr.rgba32f=Qp);var Or=[];Object.keys(Yr).forEach(function(Vn){var Yn=Yr[Vn];Or[Yn]=Vn});var Wn=0,Bn={};function si(Vn){this.id=Wn++,this.refCount=1,this.renderbuffer=Vn,this.format=Rs,this.width=0,this.height=0,wn.profile&&(this.stats={size:0})}si.prototype.decRef=function(){--this.refCount<=0&&Hn(this)};function Hn(Vn){var Yn=Vn.renderbuffer;he(Yn,"must not double destroy renderbuffer"),Pe.bindRenderbuffer(fa,null),Pe.deleteRenderbuffer(Yn),Vn.renderbuffer=null,Vn.refCount=0,delete Bn[Vn.id],qr.renderbufferCount--}function qn(Vn,Yn){var Tr=new si(Pe.createRenderbuffer());Bn[Tr.id]=Tr,qr.renderbufferCount++;function en(_i,Rn){var xi=0,Un=0,Oi=Rs;if(typeof _i=="object"&&_i){var Ln=_i;if("shape"in Ln){var wi=Ln.shape;he(Array.isArray(wi)&&wi.length>=2,"invalid renderbuffer shape"),xi=wi[0]|0,Un=wi[1]|0}else"radius"in Ln&&(xi=Un=Ln.radius|0),"width"in Ln&&(xi=Ln.width|0),"height"in Ln&&(Un=Ln.height|0);"format"in Ln&&(he.parameter(Ln.format,Yr,"invalid renderbuffer format"),Oi=Yr[Ln.format])}else typeof _i=="number"?(xi=_i|0,typeof Rn=="number"?Un=Rn|0:Un=xi):_i?he.raise("invalid arguments to renderbuffer constructor"):xi=Un=1;if(he(xi>0&&Un>0&&xi<=Zt.maxRenderbufferSize&&Un<=Zt.maxRenderbufferSize,"invalid renderbuffer size"),!(xi===Tr.width&&Un===Tr.height&&Oi===Tr.format))return en.width=Tr.width=xi,en.height=Tr.height=Un,Tr.format=Oi,Pe.bindRenderbuffer(fa,Tr.renderbuffer),Pe.renderbufferStorage(fa,Oi,xi,Un),he(Pe.getError()===0,"invalid render buffer format"),wn.profile&&(Tr.stats.size=ao(Tr.format,Tr.width,Tr.height)),en.format=Or[Tr.format],en}function Xn(_i,Rn){var xi=_i|0,Un=Rn|0||xi;return xi===Tr.width&&Un===Tr.height||(he(xi>0&&Un>0&&xi<=Zt.maxRenderbufferSize&&Un<=Zt.maxRenderbufferSize,"invalid renderbuffer size"),en.width=Tr.width=xi,en.height=Tr.height=Un,Pe.bindRenderbuffer(fa,Tr.renderbuffer),Pe.renderbufferStorage(fa,Tr.format,xi,Un),he(Pe.getError()===0,"invalid render buffer format"),wn.profile&&(Tr.stats.size=ao(Tr.format,Tr.width,Tr.height))),en}return en(Vn,Yn),en.resize=Xn,en._reglType="renderbuffer",en._renderbuffer=Tr,wn.profile&&(en.stats=Tr.stats),en.destroy=function(){Tr.decRef()},en}wn.profile&&(qr.getTotalRenderbufferSize=function(){var Vn=0;return Object.keys(Bn).forEach(function(Yn){Vn+=Bn[Yn].stats.size}),Vn});function ci(){Qa(Bn).forEach(function(Vn){Vn.renderbuffer=Pe.createRenderbuffer(),Pe.bindRenderbuffer(fa,Vn.renderbuffer),Pe.renderbufferStorage(fa,Vn.format,Vn.width,Vn.height)}),Pe.bindRenderbuffer(fa,null)}return{create:qn,clear:function(){Qa(Bn).forEach(Hn)},restore:ci}},Gs=36160,Lc=36161,ul=3553,Nh=34069,xa=36064,Al=36096,Lu=36128,ks=33306,_l=36053,pc=36054,Du=36055,zh=36057,Su=36061,qc=36193,Sh=5121,nc=5126,Yl=6407,Th=6408,ba=6402,z=[Yl,Th],s=[];s[Th]=4,s[Yl]=3;var x=[];x[Sh]=1,x[nc]=4,x[qc]=2;var I=32854,k=32855,H=36194,ee=33189,ne=36168,ue=34041,_e=35907,h=34836,g=34842,d=34843,b=[I,k,H,_e,g,d,h],B={};B[_l]="complete",B[pc]="incomplete attachment",B[zh]="incomplete dimensions",B[Du]="incomplete, missing attachment",B[Su]="unsupported";function G(Pe,_t,Zt,qr,wn,Yr){var Or={cur:null,next:null,dirty:!1,setFBO:null},Wn=["rgba"],Bn=["rgba4","rgb565","rgb5 a1"];_t.ext_srgb&&Bn.push("srgba"),_t.ext_color_buffer_half_float&&Bn.push("rgba16f","rgb16f"),_t.webgl_color_buffer_float&&Bn.push("rgba32f");var si=["uint8"];_t.oes_texture_half_float&&si.push("half float","float16"),_t.oes_texture_float&&si.push("float","float32");function Hn(bi,Zn,Sn){this.target=bi,this.texture=Zn,this.renderbuffer=Sn;var Wt=0,K=0;Zn?(Wt=Zn.width,K=Zn.height):Sn&&(Wt=Sn.width,K=Sn.height),this.width=Wt,this.height=K}function qn(bi){bi&&(bi.texture&&bi.texture._texture.decRef(),bi.renderbuffer&&bi.renderbuffer._renderbuffer.decRef())}function ci(bi,Zn,Sn){if(bi)if(bi.texture){var Wt=bi.texture._texture,K=Math.max(1,Wt.width),Ei=Math.max(1,Wt.height);he(K===Zn&&Ei===Sn,"inconsistent width/height for supplied texture"),Wt.refCount+=1}else{var Ee=bi.renderbuffer._renderbuffer;he(Ee.width===Zn&&Ee.height===Sn,"inconsistent width/height for renderbuffer"),Ee.refCount+=1}}function Vn(bi,Zn){Zn&&(Zn.texture?Pe.framebufferTexture2D(Gs,bi,Zn.target,Zn.texture._texture.texture,0):Pe.framebufferRenderbuffer(Gs,bi,Lc,Zn.renderbuffer._renderbuffer.renderbuffer))}function Yn(bi){var Zn=ul,Sn=null,Wt=null,K=bi;typeof bi=="object"&&(K=bi.data,"target"in bi&&(Zn=bi.target|0)),he.type(K,"function","invalid attachment data");var Ei=K._reglType;return Ei==="texture2d"?(Sn=K,he(Zn===ul)):Ei==="textureCube"?(Sn=K,he(Zn>=Nh&&Zn<Nh+6,"invalid cube map target")):Ei==="renderbuffer"?(Wt=K,Zn=Lc):he.raise("invalid regl object for attachment"),new Hn(Zn,Sn,Wt)}function Tr(bi,Zn,Sn,Wt,K){if(Sn){var Ei=qr.create2D({width:bi,height:Zn,format:Wt,type:K});return Ei._texture.refCount=0,new Hn(ul,Ei,null)}else{var Ee=wn.create({width:bi,height:Zn,format:Wt});return Ee._renderbuffer.refCount=0,new Hn(Lc,null,Ee)}}function en(bi){return bi&&(bi.texture||bi.renderbuffer)}function Xn(bi,Zn,Sn){bi&&(bi.texture?bi.texture.resize(Zn,Sn):bi.renderbuffer&&bi.renderbuffer.resize(Zn,Sn),bi.width=Zn,bi.height=Sn)}var _i=0,Rn={};function xi(){this.id=_i++,Rn[this.id]=this,this.framebuffer=Pe.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function Un(bi){bi.colorAttachments.forEach(qn),qn(bi.depthAttachment),qn(bi.stencilAttachment),qn(bi.depthStencilAttachment)}function Oi(bi){var Zn=bi.framebuffer;he(Zn,"must not double destroy framebuffer"),Pe.deleteFramebuffer(Zn),bi.framebuffer=null,Yr.framebufferCount--,delete Rn[bi.id]}function Ln(bi){var Zn;Pe.bindFramebuffer(Gs,bi.framebuffer);var Sn=bi.colorAttachments;for(Zn=0;Zn<Sn.length;++Zn)Vn(xa+Zn,Sn[Zn]);for(Zn=Sn.length;Zn<Zt.maxColorAttachments;++Zn)Pe.framebufferTexture2D(Gs,xa+Zn,ul,null,0);Pe.framebufferTexture2D(Gs,ks,ul,null,0),Pe.framebufferTexture2D(Gs,Al,ul,null,0),Pe.framebufferTexture2D(Gs,Lu,ul,null,0),Vn(Al,bi.depthAttachment),Vn(Lu,bi.stencilAttachment),Vn(ks,bi.depthStencilAttachment);var Wt=Pe.checkFramebufferStatus(Gs);!Pe.isContextLost()&&Wt!==_l&&he.raise("framebuffer configuration not supported, status = "+B[Wt]),Pe.bindFramebuffer(Gs,Or.next?Or.next.framebuffer:null),Or.cur=Or.next,Pe.getError()}function wi(bi,Zn){var Sn=new xi;Yr.framebufferCount++;function Wt(Ei,Ee){var sa;he(Or.next!==Sn,"can not update framebuffer which is currently in use");var Jo=0,Es=0,Cu=!0,Bl=!0,as=null,fu=!0,Js="rgba",ps="uint8",du=1,ru=null,uu=null,za=null,Mu=!1;if(typeof Ei=="number")Jo=Ei|0,Es=Ee|0||Jo;else if(!Ei)Jo=Es=1;else{he.type(Ei,"object","invalid arguments for framebuffer");var Ca=Ei;if("shape"in Ca){var mu=Ca.shape;he(Array.isArray(mu)&&mu.length>=2,"invalid shape for framebuffer"),Jo=mu[0],Es=mu[1]}else"radius"in Ca&&(Jo=Es=Ca.radius),"width"in Ca&&(Jo=Ca.width),"height"in Ca&&(Es=Ca.height);("color"in Ca||"colors"in Ca)&&(as=Ca.color||Ca.colors,Array.isArray(as)&&he(as.length===1||_t.webgl_draw_buffers,"multiple render targets not supported")),as||("colorCount"in Ca&&(du=Ca.colorCount|0,he(du>0,"invalid color buffer count")),"colorTexture"in Ca&&(fu=!!Ca.colorTexture,Js="rgba4"),"colorType"in Ca&&(ps=Ca.colorType,fu?(he(_t.oes_texture_float||!(ps==="float"||ps==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),he(_t.oes_texture_half_float||!(ps==="half float"||ps==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):ps==="half float"||ps==="float16"?(he(_t.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),Js="rgba16f"):(ps==="float"||ps==="float32")&&(he(_t.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),Js="rgba32f"),he.oneOf(ps,si,"invalid color type")),"colorFormat"in Ca&&(Js=Ca.colorFormat,Wn.indexOf(Js)>=0?fu=!0:Bn.indexOf(Js)>=0?fu=!1:fu?he.oneOf(Ca.colorFormat,Wn,"invalid color format for texture"):he.oneOf(Ca.colorFormat,Bn,"invalid color format for renderbuffer"))),("depthTexture"in Ca||"depthStencilTexture"in Ca)&&(Mu=!!(Ca.depthTexture||Ca.depthStencilTexture),he(!Mu||_t.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in Ca&&(typeof Ca.depth=="boolean"?Cu=Ca.depth:(ru=Ca.depth,Bl=!1)),"stencil"in Ca&&(typeof Ca.stencil=="boolean"?Bl=Ca.stencil:(uu=Ca.stencil,Cu=!1)),"depthStencil"in Ca&&(typeof Ca.depthStencil=="boolean"?Cu=Bl=Ca.depthStencil:(za=Ca.depthStencil,Cu=!1,Bl=!1))}var ss=null,go=null,ya=null,Qo=null;if(Array.isArray(as))ss=as.map(Yn);else if(as)ss=[Yn(as)];else for(ss=new Array(du),sa=0;sa<du;++sa)ss[sa]=Tr(Jo,Es,fu,Js,ps);he(_t.webgl_draw_buffers||ss.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),he(ss.length<=Zt.maxColorAttachments,"too many color attachments, not supported"),Jo=Jo||ss[0].width,Es=Es||ss[0].height,ru?go=Yn(ru):Cu&&!Bl&&(go=Tr(Jo,Es,Mu,"depth","uint32")),uu?ya=Yn(uu):Bl&&!Cu&&(ya=Tr(Jo,Es,!1,"stencil","uint8")),za?Qo=Yn(za):!ru&&!uu&&Bl&&Cu&&(Qo=Tr(Jo,Es,Mu,"depth stencil","depth stencil")),he(!!ru+!!uu+!!za<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var Qs=null;for(sa=0;sa<ss.length;++sa)if(ci(ss[sa],Jo,Es),he(!ss[sa]||ss[sa].texture&&z.indexOf(ss[sa].texture._texture.format)>=0||ss[sa].renderbuffer&&b.indexOf(ss[sa].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+sa+" is invalid"),ss[sa]&&ss[sa].texture){var Cp=s[ss[sa].texture._texture.format]*x[ss[sa].texture._texture.type];Qs===null?Qs=Cp:he(Qs===Cp,"all color attachments much have the same number of bits per pixel.")}return ci(go,Jo,Es),he(!go||go.texture&&go.texture._texture.format===ba||go.renderbuffer&&go.renderbuffer._renderbuffer.format===ee,"invalid depth attachment for framebuffer object"),ci(ya,Jo,Es),he(!ya||ya.renderbuffer&&ya.renderbuffer._renderbuffer.format===ne,"invalid stencil attachment for framebuffer object"),ci(Qo,Jo,Es),he(!Qo||Qo.texture&&Qo.texture._texture.format===ue||Qo.renderbuffer&&Qo.renderbuffer._renderbuffer.format===ue,"invalid depth-stencil attachment for framebuffer object"),Un(Sn),Sn.width=Jo,Sn.height=Es,Sn.colorAttachments=ss,Sn.depthAttachment=go,Sn.stencilAttachment=ya,Sn.depthStencilAttachment=Qo,Wt.color=ss.map(en),Wt.depth=en(go),Wt.stencil=en(ya),Wt.depthStencil=en(Qo),Wt.width=Sn.width,Wt.height=Sn.height,Ln(Sn),Wt}function K(Ei,Ee){he(Or.next!==Sn,"can not resize a framebuffer which is currently in use");var sa=Math.max(Ei|0,1),Jo=Math.max(Ee|0||sa,1);if(sa===Sn.width&&Jo===Sn.height)return Wt;for(var Es=Sn.colorAttachments,Cu=0;Cu<Es.length;++Cu)Xn(Es[Cu],sa,Jo);return Xn(Sn.depthAttachment,sa,Jo),Xn(Sn.stencilAttachment,sa,Jo),Xn(Sn.depthStencilAttachment,sa,Jo),Sn.width=Wt.width=sa,Sn.height=Wt.height=Jo,Ln(Sn),Wt}return Wt(bi,Zn),Se(Wt,{resize:K,_reglType:"framebuffer",_framebuffer:Sn,destroy:function(){Oi(Sn),Un(Sn)},use:function(Ei){Or.setFBO({framebuffer:Wt},Ei)}})}function Po(bi){var Zn=Array(6);function Sn(K){var Ei;he(Zn.indexOf(Or.next)<0,"can not update framebuffer which is currently in use");var Ee={color:null},sa=0,Jo=null,Es="rgba",Cu="uint8",Bl=1;if(typeof K=="number")sa=K|0;else if(!K)sa=1;else{he.type(K,"object","invalid arguments for framebuffer");var as=K;if("shape"in as){var fu=as.shape;he(Array.isArray(fu)&&fu.length>=2,"invalid shape for framebuffer"),he(fu[0]===fu[1],"cube framebuffer must be square"),sa=fu[0]}else"radius"in as&&(sa=as.radius|0),"width"in as?(sa=as.width|0,"height"in as&&he(as.height===sa,"must be square")):"height"in as&&(sa=as.height|0);("color"in as||"colors"in as)&&(Jo=as.color||as.colors,Array.isArray(Jo)&&he(Jo.length===1||_t.webgl_draw_buffers,"multiple render targets not supported")),Jo||("colorCount"in as&&(Bl=as.colorCount|0,he(Bl>0,"invalid color buffer count")),"colorType"in as&&(he.oneOf(as.colorType,si,"invalid color type"),Cu=as.colorType),"colorFormat"in as&&(Es=as.colorFormat,he.oneOf(as.colorFormat,Wn,"invalid color format for texture"))),"depth"in as&&(Ee.depth=as.depth),"stencil"in as&&(Ee.stencil=as.stencil),"depthStencil"in as&&(Ee.depthStencil=as.depthStencil)}var Js;if(Jo)if(Array.isArray(Jo))for(Js=[],Ei=0;Ei<Jo.length;++Ei)Js[Ei]=Jo[Ei];else Js=[Jo];else{Js=Array(Bl);var ps={radius:sa,format:Es,type:Cu};for(Ei=0;Ei<Bl;++Ei)Js[Ei]=qr.createCube(ps)}for(Ee.color=Array(Js.length),Ei=0;Ei<Js.length;++Ei){var du=Js[Ei];he(typeof du=="function"&&du._reglType==="textureCube","invalid cube map"),sa=sa||du.width,he(du.width===sa&&du.height===sa,"invalid cube map shape"),Ee.color[Ei]={target:Nh,data:Js[Ei]}}for(Ei=0;Ei<6;++Ei){for(var ru=0;ru<Js.length;++ru)Ee.color[ru].target=Nh+Ei;Ei>0&&(Ee.depth=Zn[0].depth,Ee.stencil=Zn[0].stencil,Ee.depthStencil=Zn[0].depthStencil),Zn[Ei]?Zn[Ei](Ee):Zn[Ei]=wi(Ee)}return Se(Sn,{width:sa,height:sa,color:Js})}function Wt(K){var Ei,Ee=K|0;if(he(Ee>0&&Ee<=Zt.maxCubeMapSize,"invalid radius for cube fbo"),Ee===Sn.width)return Sn;var sa=Sn.color;for(Ei=0;Ei<sa.length;++Ei)sa[Ei].resize(Ee);for(Ei=0;Ei<6;++Ei)Zn[Ei].resize(Ee);return Sn.width=Sn.height=Ee,Sn}return Sn(bi),Se(Sn,{faces:Zn,resize:Wt,_reglType:"framebufferCube",destroy:function(){Zn.forEach(function(K){K.destroy()})}})}function da(){Or.cur=null,Or.next=null,Or.dirty=!0,Qa(Rn).forEach(function(bi){bi.framebuffer=Pe.createFramebuffer(),Ln(bi)})}return Se(Or,{getFramebuffer:function(bi){if(typeof bi=="function"&&bi._reglType==="framebuffer"){var Zn=bi._framebuffer;if(Zn instanceof xi)return Zn}return null},create:wi,createCube:Po,clear:function(){Qa(Rn).forEach(Oi)},restore:da})}var q=5126,te=34962;function fe(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=q,this.offset=0,this.stride=0,this.divisor=0}function ce(Pe,_t,Zt,qr,wn){for(var Yr=Zt.maxAttributes,Or=new Array(Yr),Wn=0;Wn<Yr;++Wn)Or[Wn]=new fe;var Bn=0,si={},Hn={Record:fe,scope:{},state:Or,currentVAO:null,targetVAO:null,restore:ci()?Rn:function(){},createVAO:xi,getVAO:Yn,destroyBuffer:qn,setVAO:ci()?Tr:en,clear:ci()?Xn:function(){}};function qn(Un){for(var Oi=0;Oi<Or.length;++Oi){var Ln=Or[Oi];Ln.buffer===Un&&(Pe.disableVertexAttribArray(Oi),Ln.buffer=null)}}function ci(){return _t.oes_vertex_array_object}function Vn(){return _t.angle_instanced_arrays}function Yn(Un){return typeof Un=="function"&&Un._vao?Un._vao:null}function Tr(Un){if(Un!==Hn.currentVAO){var Oi=ci();Un?Oi.bindVertexArrayOES(Un.vao):Oi.bindVertexArrayOES(null),Hn.currentVAO=Un}}function en(Un){if(Un!==Hn.currentVAO){if(Un)Un.bindAttrs();else for(var Oi=Vn(),Ln=0;Ln<Or.length;++Ln){var wi=Or[Ln];wi.buffer?(Pe.enableVertexAttribArray(Ln),Pe.vertexAttribPointer(Ln,wi.size,wi.type,wi.normalized,wi.stride,wi.offfset),Oi&&Oi.vertexAttribDivisorANGLE(Ln,wi.divisor)):(Pe.disableVertexAttribArray(Ln),Pe.vertexAttrib4f(Ln,wi.x,wi.y,wi.z,wi.w))}Hn.currentVAO=Un}}function Xn(){Qa(si).forEach(function(Un){Un.destroy()})}function _i(){this.id=++Bn,this.attributes=[];var Un=ci();Un?this.vao=Un.createVertexArrayOES():this.vao=null,si[this.id]=this,this.buffers=[]}_i.prototype.bindAttrs=function(){for(var Un=Vn(),Oi=this.attributes,Ln=0;Ln<Oi.length;++Ln){var wi=Oi[Ln];wi.buffer?(Pe.enableVertexAttribArray(Ln),Pe.bindBuffer(te,wi.buffer.buffer),Pe.vertexAttribPointer(Ln,wi.size,wi.type,wi.normalized,wi.stride,wi.offset),Un&&Un.vertexAttribDivisorANGLE(Ln,wi.divisor)):(Pe.disableVertexAttribArray(Ln),Pe.vertexAttrib4f(Ln,wi.x,wi.y,wi.z,wi.w))}for(var Po=Oi.length;Po<Yr;++Po)Pe.disableVertexAttribArray(Po)},_i.prototype.refresh=function(){var Un=ci();Un&&(Un.bindVertexArrayOES(this.vao),this.bindAttrs(),Hn.currentVAO=this)},_i.prototype.destroy=function(){if(this.vao){var Un=ci();this===Hn.currentVAO&&(Hn.currentVAO=null,Un.bindVertexArrayOES(null)),Un.deleteVertexArrayOES(this.vao),this.vao=null}si[this.id]&&(delete si[this.id],qr.vaoCount-=1)};function Rn(){var Un=ci();Un&&Qa(si).forEach(function(Oi){Oi.refresh()})}function xi(Un){var Oi=new _i;qr.vaoCount+=1;function Ln(wi){he(Array.isArray(wi),"arguments to vertex array constructor must be an array"),he(wi.length<Yr,"too many attributes"),he(wi.length>0,"must specify at least one attribute");for(var Po=0;Po<Oi.buffers.length;++Po)Oi.buffers[Po].destroy();Oi.buffers.length=0;var da=Oi.attributes;da.length=wi.length;for(var bi=0;bi<wi.length;++bi){var Zn=wi[bi],Sn=da[bi]=new fe;if(Array.isArray(Zn)||_r(Zn)||ol(Zn)){var Wt=wn.create(Zn,te,!1,!0);Sn.buffer=wn.getBuffer(Wt),Sn.size=Sn.buffer.dimension|0,Sn.normalized=!1,Sn.type=Sn.buffer.dtype,Sn.offset=0,Sn.stride=0,Sn.divisor=0,Sn.state=1,Oi.buffers.push(Wt)}else wn.getBuffer(Zn)?(Sn.buffer=wn.getBuffer(Zn),Sn.size=Sn.buffer.dimension|0,Sn.normalized=!1,Sn.type=Sn.buffer.dtype,Sn.offset=0,Sn.stride=0,Sn.divisor=0,Sn.state=1):wn.getBuffer(Zn.buffer)?(Sn.buffer=wn.getBuffer(Zn.buffer),Sn.size=(+Zn.size||Sn.buffer.dimension)|0,Sn.normalized=!!Zn.normalized||!1,"type"in Zn?(he.parameter(Zn.type,Aa,"invalid buffer type"),Sn.type=Aa[Zn.type]):Sn.type=Sn.buffer.dtype,Sn.offset=(Zn.offset||0)|0,Sn.stride=(Zn.stride||0)|0,Sn.divisor=(Zn.divisor||0)|0,Sn.state=1,he(Sn.size>=1&&Sn.size<=4,"size must be between 1 and 4"),he(Sn.offset>=0,"invalid offset"),he(Sn.stride>=0&&Sn.stride<=255,"stride must be between 0 and 255"),he(Sn.divisor>=0,"divisor must be positive"),he(!Sn.divisor||!!_t.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in Zn?(he(bi>0,"first attribute must not be a constant"),Sn.x=+Zn.x||0,Sn.y=+Zn.y||0,Sn.z=+Zn.z||0,Sn.w=+Zn.w||0,Sn.state=2):he(!1,"invalid attribute spec for location "+bi)}return Oi.refresh(),Ln}return Ln.destroy=function(){Oi.destroy()},Ln._vao=Oi,Ln._reglType="vao",Ln(Un)}return Hn}var Te=35632,Ie=35633,Oe=35718,Qe=35721;function nt(Pe,_t,Zt,qr){var wn={},Yr={};function Or(Tr,en,Xn,_i){this.name=Tr,this.id=en,this.location=Xn,this.info=_i}function Wn(Tr,en){for(var Xn=0;Xn<Tr.length;++Xn)if(Tr[Xn].id===en.id){Tr[Xn].location=en.location;return}Tr.push(en)}function Bn(Tr,en,Xn){var _i=Tr===Te?wn:Yr,Rn=_i[en];if(!Rn){var xi=_t.str(en);Rn=Pe.createShader(Tr),Pe.shaderSource(Rn,xi),Pe.compileShader(Rn),he.shaderError(Pe,Rn,xi,Tr,Xn),_i[en]=Rn}return Rn}var si={},Hn=[],qn=0;function ci(Tr,en){this.id=qn++,this.fragId=Tr,this.vertId=en,this.program=null,this.uniforms=[],this.attributes=[],qr.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function Vn(Tr,en,Xn){var _i,Rn,xi=Bn(Te,Tr.fragId),Un=Bn(Ie,Tr.vertId),Oi=Tr.program=Pe.createProgram();if(Pe.attachShader(Oi,xi),Pe.attachShader(Oi,Un),Xn)for(_i=0;_i<Xn.length;++_i){var Ln=Xn[_i];Pe.bindAttribLocation(Oi,Ln[0],Ln[1])}Pe.linkProgram(Oi),he.linkError(Pe,Oi,_t.str(Tr.fragId),_t.str(Tr.vertId),en);var wi=Pe.getProgramParameter(Oi,Oe);qr.profile&&(Tr.stats.uniformsCount=wi);var Po=Tr.uniforms;for(_i=0;_i<wi;++_i)if(Rn=Pe.getActiveUniform(Oi,_i),Rn)if(Rn.size>1)for(var da=0;da<Rn.size;++da){var bi=Rn.name.replace("[0]","["+da+"]");Wn(Po,new Or(bi,_t.id(bi),Pe.getUniformLocation(Oi,bi),Rn))}else Wn(Po,new Or(Rn.name,_t.id(Rn.name),Pe.getUniformLocation(Oi,Rn.name),Rn));var Zn=Pe.getProgramParameter(Oi,Qe);qr.profile&&(Tr.stats.attributesCount=Zn);var Sn=Tr.attributes;for(_i=0;_i<Zn;++_i)Rn=Pe.getActiveAttrib(Oi,_i),Rn&&Wn(Sn,new Or(Rn.name,_t.id(Rn.name),Pe.getAttribLocation(Oi,Rn.name),Rn))}qr.profile&&(Zt.getMaxUniformsCount=function(){var Tr=0;return Hn.forEach(function(en){en.stats.uniformsCount>Tr&&(Tr=en.stats.uniformsCount)}),Tr},Zt.getMaxAttributesCount=function(){var Tr=0;return Hn.forEach(function(en){en.stats.attributesCount>Tr&&(Tr=en.stats.attributesCount)}),Tr});function Yn(){wn={},Yr={};for(var Tr=0;Tr<Hn.length;++Tr)Vn(Hn[Tr],null,Hn[Tr].attributes.map(function(en){return[en.location,en.name]}))}return{clear:function(){var Tr=Pe.deleteShader.bind(Pe);Qa(wn).forEach(Tr),wn={},Qa(Yr).forEach(Tr),Yr={},Hn.forEach(function(en){Pe.deleteProgram(en.program)}),Hn.length=0,si={},Zt.shaderCount=0},program:function(Tr,en,Xn,_i){he.command(Tr>=0,"missing vertex shader",Xn),he.command(en>=0,"missing fragment shader",Xn);var Rn=si[en];Rn||(Rn=si[en]={});var xi=Rn[Tr];if(xi&&!_i)return xi;var Un=new ci(en,Tr);return Zt.shaderCount++,Vn(Un,Xn,_i),xi||(Rn[Tr]=Un),Hn.push(Un),Un},restore:Yn,shader:Bn,frag:-1,vert:-1}}var ct=6408,tt=5121,Tt=3333,Ut=5126;function Nt(Pe,_t,Zt,qr,wn,Yr,Or){function Wn(Hn){var qn;_t.next===null?(he(wn.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),qn=tt):(he(_t.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),qn=_t.next.colorAttachments[0].texture._texture.type,Yr.oes_texture_float?(he(qn===tt||qn===Ut,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),qn===Ut&&he(Or.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):he(qn===tt,"Reading from a framebuffer is only allowed for the type 'uint8'"));var ci=0,Vn=0,Yn=qr.framebufferWidth,Tr=qr.framebufferHeight,en=null;_r(Hn)?en=Hn:Hn&&(he.type(Hn,"object","invalid arguments to regl.read()"),ci=Hn.x|0,Vn=Hn.y|0,he(ci>=0&&ci<qr.framebufferWidth,"invalid x offset for regl.read"),he(Vn>=0&&Vn<qr.framebufferHeight,"invalid y offset for regl.read"),Yn=(Hn.width||qr.framebufferWidth-ci)|0,Tr=(Hn.height||qr.framebufferHeight-Vn)|0,en=Hn.data||null),en&&(qn===tt?he(en instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):qn===Ut&&he(en instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),he(Yn>0&&Yn+ci<=qr.framebufferWidth,"invalid width for read pixels"),he(Tr>0&&Tr+Vn<=qr.framebufferHeight,"invalid height for read pixels"),Zt();var Xn=Yn*Tr*4;return en||(qn===tt?en=new Uint8Array(Xn):qn===Ut&&(en=en||new Float32Array(Xn))),he.isTypedArray(en,"data buffer for regl.read() must be a typedarray"),he(en.byteLength>=Xn,"data buffer for regl.read() too small"),Pe.pixelStorei(Tt,4),Pe.readPixels(ci,Vn,Yn,Tr,ct,qn,en),en}function Bn(Hn){var qn;return _t.setFBO({framebuffer:Hn.framebuffer},function(){qn=Wn(Hn)}),qn}function si(Hn){return!Hn||!("framebuffer"in Hn)?Wn(Hn):Bn(Hn)}return si}function pr(Pe){return Array.prototype.slice.call(Pe)}function tr(Pe){return pr(Pe).join("")}function Dr(){var Pe=0,_t=[],Zt=[];function qr(qn){for(var ci=0;ci<Zt.length;++ci)if(Zt[ci]===qn)return _t[ci];var Vn="g"+Pe++;return _t.push(Vn),Zt.push(qn),Vn}function wn(){var qn=[];function ci(){qn.push.apply(qn,pr(arguments))}var Vn=[];function Yn(){var Tr="v"+Pe++;return Vn.push(Tr),arguments.length>0&&(qn.push(Tr,"="),qn.push.apply(qn,pr(arguments)),qn.push(";")),Tr}return Se(ci,{def:Yn,toString:function(){return tr([Vn.length>0?"var "+Vn.join(",")+";":"",tr(qn)])}})}function Yr(){var qn=wn(),ci=wn(),Vn=qn.toString,Yn=ci.toString;function Tr(en,Xn){ci(en,Xn,"=",qn.def(en,Xn),";")}return Se(function(){qn.apply(qn,pr(arguments))},{def:qn.def,entry:qn,exit:ci,save:Tr,set:function(en,Xn,_i){Tr(en,Xn),qn(en,Xn,"=",_i,";")},toString:function(){return Vn()+Yn()}})}function Or(){var qn=tr(arguments),ci=Yr(),Vn=Yr(),Yn=ci.toString,Tr=Vn.toString;return Se(ci,{then:function(){return ci.apply(ci,pr(arguments)),this},else:function(){return Vn.apply(Vn,pr(arguments)),this},toString:function(){var en=Tr();return en&&(en="else{"+en+"}"),tr(["if(",qn,"){",Yn(),"}",en])}})}var Wn=wn(),Bn={};function si(qn,ci){var Vn=[];function Yn(){var Rn="a"+Vn.length;return Vn.push(Rn),Rn}ci=ci||0;for(var Tr=0;Tr<ci;++Tr)Yn();var en=Yr(),Xn=en.toString,_i=Bn[qn]=Se(en,{arg:Yn,toString:function(){return tr(["function(",Vn.join(),"){",Xn(),"}"])}});return _i}function Hn(){var qn=['"use strict";',Wn,"return {"];Object.keys(Bn).forEach(function(Yn){qn.push('"',Yn,'":',Bn[Yn].toString(),",")}),qn.push("}");var ci=tr(qn).replace(/;/g,`;
`).replace(/}/g,`}
`).replace(/{/g,`{
`),Vn=Function.apply(null,_t.concat(ci));return Vn.apply(null,Zt)}return{global:Wn,link:qr,block:wn,proc:si,scope:Yr,cond:Or,compile:Hn}}var Hr="xyzw".split(""),sn=5121,nn=1,Gn=2,di=0,Di=1,Ui=2,ho=3,gi=4,Wi="dither",Ko="blend.enable",Mo="blend.color",mo="blend.equation",ko="blend.func",xo="depth.enable",qi="depth.func",xs="depth.range",gs="depth.mask",Cl="colorMask",ts="cull.enable",ja="cull.face",$a="frontFace",vs="lineWidth",Zl="polygonOffset.enable",zu="polygonOffset.offset",Uu="sample.alpha",hh="sample.enable",Yc="sample.coverage",np="stencil.enable",pu="stencil.mask",Tu="stencil.func",Zu="stencil.opFront",Dl="stencil.opBack",Vl="scissor.enable",Uh="scissor.box",ml="viewport",$l="profile",Vu="framebuffer",Ws="vert",ju="frag",os="elements",yl="primitive",Ol="count",ph="offset",_f="instances",ip="vao",yf="Width",Hu="Height",Bp=Vu+yf,fc=Vu+Hu,Wf=ml+yf,op=ml+Hu,ef="drawingBuffer",_s=ef+yf,Ff=ef+Hu,sd=[ko,mo,Tu,Zu,Dl,Yc,ml,Uh,zu],fh=34962,_d=34963,ld=35632,ym=35633,Xf=3553,tm=34067,Gu=2884,xf=3042,tf=3024,ud=2960,qf=2929,Dd=3089,Yf=32823,Kl=32926,Od=32928,Bd=5126,bf=35664,wp=35665,$f=35666,ap=5124,kf=35667,xl=35668,dc=35669,Fp=35670,Sp=35671,rf=35672,nf=35673,Nf=35674,zf=35675,of=35676,af=35678,kp=35680,yd=4,Dc=1028,_p=1029,Kf=2304,xd=2305,bd=32775,Ed=32776,Tp=519,Ef=7680,wd=0,cd=1,hd=32774,Uf=513,sf=36160,Ou=36064,Zh={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},lf=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Ah={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Np={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},pd={frag:ld,vert:ym},yp={cw:Kf,ccw:xd};function Zf(Pe){return Array.isArray(Pe)||_r(Pe)||ol(Pe)}function zp(Pe){return Pe.sort(function(_t,Zt){return _t===ml?-1:Zt===ml?1:_t<Zt?-1:1})}function Oc(Pe,_t,Zt,qr){this.thisDep=Pe,this.contextDep=_t,this.propDep=Zt,this.append=qr}function Wu(Pe){return Pe&&!(Pe.thisDep||Pe.contextDep||Pe.propDep)}function Au(Pe){return new Oc(!1,!1,!1,Pe)}function dh(Pe,_t){var Zt=Pe.type;if(Zt===di){var qr=Pe.data.length;return new Oc(!0,qr>=1,qr>=2,_t)}else if(Zt===gi){var wn=Pe.data;return new Oc(wn.thisDep,wn.contextDep,wn.propDep,_t)}else return new Oc(Zt===ho,Zt===Ui,Zt===Di,_t)}var rm=new Oc(!1,!1,!1,function(){});function Ap(Pe,_t,Zt,qr,wn,Yr,Or,Wn,Bn,si,Hn,qn,ci,Vn,Yn){var Tr=si.Record,en={add:32774,subtract:32778,"reverse subtract":32779};Zt.ext_blend_minmax&&(en.min=bd,en.max=Ed);var Xn=Zt.angle_instanced_arrays,_i=Zt.webgl_draw_buffers,Rn={dirty:!0,profile:Yn.profile},xi={},Un=[],Oi={},Ln={};function wi(st){return st.replace(".","_")}function Po(st,Et,Vt){var Br=wi(st);Un.push(st),xi[Br]=Rn[Br]=!!Vt,Oi[Br]=Et}function da(st,Et,Vt){var Br=wi(st);Un.push(st),Array.isArray(Vt)?(Rn[Br]=Vt.slice(),xi[Br]=Vt.slice()):Rn[Br]=xi[Br]=Vt,Ln[Br]=Et}Po(Wi,tf),Po(Ko,xf),da(Mo,"blendColor",[0,0,0,0]),da(mo,"blendEquationSeparate",[hd,hd]),da(ko,"blendFuncSeparate",[cd,wd,cd,wd]),Po(xo,qf,!0),da(qi,"depthFunc",Uf),da(xs,"depthRange",[0,1]),da(gs,"depthMask",!0),da(Cl,Cl,[!0,!0,!0,!0]),Po(ts,Gu),da(ja,"cullFace",_p),da($a,$a,xd),da(vs,vs,1),Po(Zl,Yf),da(zu,"polygonOffset",[0,0]),Po(Uu,Kl),Po(hh,Od),da(Yc,"sampleCoverage",[1,!1]),Po(np,ud),da(pu,"stencilMask",-1),da(Tu,"stencilFunc",[Tp,0,-1]),da(Zu,"stencilOpSeparate",[Dc,Ef,Ef,Ef]),da(Dl,"stencilOpSeparate",[_p,Ef,Ef,Ef]),Po(Vl,Dd),da(Uh,"scissor",[0,0,Pe.drawingBufferWidth,Pe.drawingBufferHeight]),da(ml,ml,[0,0,Pe.drawingBufferWidth,Pe.drawingBufferHeight]);var bi={gl:Pe,context:ci,strings:_t,next:xi,current:Rn,draw:qn,elements:Yr,buffer:wn,shader:Hn,attributes:si.state,vao:si,uniforms:Bn,framebuffer:Wn,extensions:Zt,timer:Vn,isBufferArgs:Zf},Zn={primTypes:zc,compareFuncs:Ah,blendFuncs:Zh,blendEquations:en,stencilOps:Np,glTypes:Aa,orientationType:yp};he.optional(function(){bi.isArrayLike=zl}),_i&&(Zn.backBuffer=[_p],Zn.drawBuffer=Ne(qr.maxDrawbuffers,function(st){return st===0?[0]:Ne(st,function(Et){return Ou+Et})}));var Sn=0;function Wt(){var st=Dr(),Et=st.link,Vt=st.global;st.id=Sn++,st.batchId="0";var Br=Et(bi),Ir=st.shared={props:"a0"};Object.keys(bi).forEach(function(Xt){Ir[Xt]=Vt.def(Br,".",Xt)}),he.optional(function(){st.CHECK=Et(he),st.commandStr=he.guessCommand(),st.command=Et(st.commandStr),st.assert=function(Xt,pt,$t){Xt("if(!(",pt,"))",this.CHECK,".commandRaise(",Et($t),",",this.command,");")},Zn.invalidBlendCombinations=lf});var Jt=st.next={},sr=st.current={};Object.keys(Ln).forEach(function(Xt){Array.isArray(Rn[Xt])&&(Jt[Xt]=Vt.def(Ir.next,".",Xt),sr[Xt]=Vt.def(Ir.current,".",Xt))});var lr=st.constants={};Object.keys(Zn).forEach(function(Xt){lr[Xt]=Vt.def(JSON.stringify(Zn[Xt]))}),st.invoke=function(Xt,pt){switch(pt.type){case di:var $t=["this",Ir.context,Ir.props,st.batchId];return Xt.def(Et(pt.data),".call(",$t.slice(0,Math.max(pt.data.length+1,4)),")");case Di:return Xt.def(Ir.props,pt.data);case Ui:return Xt.def(Ir.context,pt.data);case ho:return Xt.def("this",pt.data);case gi:return pt.data.append(st,Xt),pt.data.ref}},st.attribCache={};var Mt={};return st.scopeAttrib=function(Xt){var pt=_t.id(Xt);if(pt in Mt)return Mt[pt];var $t=si.scope[pt];$t||($t=si.scope[pt]=new Tr);var zr=Mt[pt]=Et($t);return zr},st}function K(st){var Et=st.static,Vt=st.dynamic,Br;if($l in Et){var Ir=!!Et[$l];Br=Au(function(sr,lr){return Ir}),Br.enable=Ir}else if($l in Vt){var Jt=Vt[$l];Br=dh(Jt,function(sr,lr){return sr.invoke(lr,Jt)})}return Br}function Ei(st,Et){var Vt=st.static,Br=st.dynamic;if(Vu in Vt){var Ir=Vt[Vu];return Ir?(Ir=Wn.getFramebuffer(Ir),he.command(Ir,"invalid framebuffer object"),Au(function(sr,lr){var Mt=sr.link(Ir),Xt=sr.shared;lr.set(Xt.framebuffer,".next",Mt);var pt=Xt.context;return lr.set(pt,"."+Bp,Mt+".width"),lr.set(pt,"."+fc,Mt+".height"),Mt})):Au(function(sr,lr){var Mt=sr.shared;lr.set(Mt.framebuffer,".next","null");var Xt=Mt.context;return lr.set(Xt,"."+Bp,Xt+"."+_s),lr.set(Xt,"."+fc,Xt+"."+Ff),"null"})}else if(Vu in Br){var Jt=Br[Vu];return dh(Jt,function(sr,lr){var Mt=sr.invoke(lr,Jt),Xt=sr.shared,pt=Xt.framebuffer,$t=lr.def(pt,".getFramebuffer(",Mt,")");he.optional(function(){sr.assert(lr,"!"+Mt+"||"+$t,"invalid framebuffer object")}),lr.set(pt,".next",$t);var zr=Xt.context;return lr.set(zr,"."+Bp,$t+"?"+$t+".width:"+zr+"."+_s),lr.set(zr,"."+fc,$t+"?"+$t+".height:"+zr+"."+Ff),$t})}else return null}function Ee(st,Et,Vt){var Br=st.static,Ir=st.dynamic;function Jt(Mt){if(Mt in Br){var Xt=Br[Mt];he.commandType(Xt,"object","invalid "+Mt,Vt.commandStr);var pt=!0,$t=Xt.x|0,zr=Xt.y|0,$r,Tn;return"width"in Xt?($r=Xt.width|0,he.command($r>=0,"invalid "+Mt,Vt.commandStr)):pt=!1,"height"in Xt?(Tn=Xt.height|0,he.command(Tn>=0,"invalid "+Mt,Vt.commandStr)):pt=!1,new Oc(!pt&&Et&&Et.thisDep,!pt&&Et&&Et.contextDep,!pt&&Et&&Et.propDep,function(Qn,Fi){var Vr=Qn.shared.context,po=$r;"width"in Xt||(po=Fi.def(Vr,".",Bp,"-",$t));var la=Tn;return"height"in Xt||(la=Fi.def(Vr,".",fc,"-",zr)),[$t,zr,po,la]})}else if(Mt in Ir){var vn=Ir[Mt],_n=dh(vn,function(Qn,Fi){var Vr=Qn.invoke(Fi,vn);he.optional(function(){Qn.assert(Fi,Vr+"&&typeof "+Vr+'==="object"',"invalid "+Mt)});var po=Qn.shared.context,la=Fi.def(Vr,".x|0"),Ns=Fi.def(Vr,".y|0"),Fl=Fi.def('"width" in ',Vr,"?",Vr,".width|0:","(",po,".",Bp,"-",la,")"),ic=Fi.def('"height" in ',Vr,"?",Vr,".height|0:","(",po,".",fc,"-",Ns,")");return he.optional(function(){Qn.assert(Fi,Fl+">=0&&"+ic+">=0","invalid "+Mt)}),[la,Ns,Fl,ic]});return Et&&(_n.thisDep=_n.thisDep||Et.thisDep,_n.contextDep=_n.contextDep||Et.contextDep,_n.propDep=_n.propDep||Et.propDep),_n}else return Et?new Oc(Et.thisDep,Et.contextDep,Et.propDep,function(Qn,Fi){var Vr=Qn.shared.context;return[0,0,Fi.def(Vr,".",Bp),Fi.def(Vr,".",fc)]}):null}var sr=Jt(ml);if(sr){var lr=sr;sr=new Oc(sr.thisDep,sr.contextDep,sr.propDep,function(Mt,Xt){var pt=lr.append(Mt,Xt),$t=Mt.shared.context;return Xt.set($t,"."+Wf,pt[2]),Xt.set($t,"."+op,pt[3]),pt})}return{viewport:sr,scissor_box:Jt(Uh)}}function sa(st,Et){var Vt=st.static,Br=typeof Vt[ju]=="string"&&typeof Vt[Ws]=="string";if(Br){if(Object.keys(Et.dynamic).length>0)return null;var Ir=Et.static,Jt=Object.keys(Ir);if(Jt.length>0&&typeof Ir[Jt[0]]=="number"){for(var sr=[],lr=0;lr<Jt.length;++lr)he(typeof Ir[Jt[lr]]=="number","must specify all vertex attribute locations when using vaos"),sr.push([Ir[Jt[lr]]|0,Jt[lr]]);return sr}}return null}function Jo(st,Et,Vt){var Br=st.static,Ir=st.dynamic;function Jt(pt){if(pt in Br){var $t=_t.id(Br[pt]);he.optional(function(){Hn.shader(pd[pt],$t,he.guessCommand())});var zr=Au(function(){return $t});return zr.id=$t,zr}else if(pt in Ir){var $r=Ir[pt];return dh($r,function(Tn,vn){var _n=Tn.invoke(vn,$r),Qn=vn.def(Tn.shared.strings,".id(",_n,")");return he.optional(function(){vn(Tn.shared.shader,".shader(",pd[pt],",",Qn,",",Tn.command,");")}),Qn})}return null}var sr=Jt(ju),lr=Jt(Ws),Mt=null,Xt;return Wu(sr)&&Wu(lr)?(Mt=Hn.program(lr.id,sr.id,null,Vt),Xt=Au(function(pt,$t){return pt.link(Mt)})):Xt=new Oc(sr&&sr.thisDep||lr&&lr.thisDep,sr&&sr.contextDep||lr&&lr.contextDep,sr&&sr.propDep||lr&&lr.propDep,function(pt,$t){var zr=pt.shared.shader,$r;sr?$r=sr.append(pt,$t):$r=$t.def(zr,".",ju);var Tn;lr?Tn=lr.append(pt,$t):Tn=$t.def(zr,".",Ws);var vn=zr+".program("+Tn+","+$r;return he.optional(function(){vn+=","+pt.command}),$t.def(vn+")")}),{frag:sr,vert:lr,progVar:Xt,program:Mt}}function Es(st,Et){var Vt=st.static,Br=st.dynamic;function Ir(){if(os in Vt){var pt=Vt[os];Zf(pt)?pt=Yr.getElements(Yr.create(pt,!0)):pt&&(pt=Yr.getElements(pt),he.command(pt,"invalid elements",Et.commandStr));var $t=Au(function($r,Tn){if(pt){var vn=$r.link(pt);return $r.ELEMENTS=vn,vn}return $r.ELEMENTS=null,null});return $t.value=pt,$t}else if(os in Br){var zr=Br[os];return dh(zr,function($r,Tn){var vn=$r.shared,_n=vn.isBufferArgs,Qn=vn.elements,Fi=$r.invoke(Tn,zr),Vr=Tn.def("null"),po=Tn.def(_n,"(",Fi,")"),la=$r.cond(po).then(Vr,"=",Qn,".createStream(",Fi,");").else(Vr,"=",Qn,".getElements(",Fi,");");return he.optional(function(){$r.assert(la.else,"!"+Fi+"||"+Vr,"invalid elements")}),Tn.entry(la),Tn.exit($r.cond(po).then(Qn,".destroyStream(",Vr,");")),$r.ELEMENTS=Vr,Vr})}return null}var Jt=Ir();function sr(){if(yl in Vt){var pt=Vt[yl];return he.commandParameter(pt,zc,"invalid primitve",Et.commandStr),Au(function(zr,$r){return zc[pt]})}else if(yl in Br){var $t=Br[yl];return dh($t,function(zr,$r){var Tn=zr.constants.primTypes,vn=zr.invoke($r,$t);return he.optional(function(){zr.assert($r,vn+" in "+Tn,"invalid primitive, must be one of "+Object.keys(zc))}),$r.def(Tn,"[",vn,"]")})}else if(Jt)return Wu(Jt)?Jt.value?Au(function(zr,$r){return $r.def(zr.ELEMENTS,".primType")}):Au(function(){return yd}):new Oc(Jt.thisDep,Jt.contextDep,Jt.propDep,function(zr,$r){var Tn=zr.ELEMENTS;return $r.def(Tn,"?",Tn,".primType:",yd)});return null}function lr(pt,$t){if(pt in Vt){var zr=Vt[pt]|0;return he.command(!$t||zr>=0,"invalid "+pt,Et.commandStr),Au(function(Tn,vn){return $t&&(Tn.OFFSET=zr),zr})}else if(pt in Br){var $r=Br[pt];return dh($r,function(Tn,vn){var _n=Tn.invoke(vn,$r);return $t&&(Tn.OFFSET=_n,he.optional(function(){Tn.assert(vn,_n+">=0","invalid "+pt)})),_n})}else if($t&&Jt)return Au(function(Tn,vn){return Tn.OFFSET="0",0});return null}var Mt=lr(ph,!0);function Xt(){if(Ol in Vt){var pt=Vt[Ol]|0;return he.command(typeof pt=="number"&&pt>=0,"invalid vertex count",Et.commandStr),Au(function(){return pt})}else if(Ol in Br){var $t=Br[Ol];return dh($t,function(Tn,vn){var _n=Tn.invoke(vn,$t);return he.optional(function(){Tn.assert(vn,"typeof "+_n+'==="number"&&'+_n+">=0&&"+_n+"===("+_n+"|0)","invalid vertex count")}),_n})}else if(Jt)if(Wu(Jt)){if(Jt)return Mt?new Oc(Mt.thisDep,Mt.contextDep,Mt.propDep,function(Tn,vn){var _n=vn.def(Tn.ELEMENTS,".vertCount-",Tn.OFFSET);return he.optional(function(){Tn.assert(vn,_n+">=0","invalid vertex offset/element buffer too small")}),_n}):Au(function(Tn,vn){return vn.def(Tn.ELEMENTS,".vertCount")});var zr=Au(function(){return-1});return he.optional(function(){zr.MISSING=!0}),zr}else{var $r=new Oc(Jt.thisDep||Mt.thisDep,Jt.contextDep||Mt.contextDep,Jt.propDep||Mt.propDep,function(Tn,vn){var _n=Tn.ELEMENTS;return Tn.OFFSET?vn.def(_n,"?",_n,".vertCount-",Tn.OFFSET,":-1"):vn.def(_n,"?",_n,".vertCount:-1")});return he.optional(function(){$r.DYNAMIC=!0}),$r}return null}return{elements:Jt,primitive:sr(),count:Xt(),instances:lr(_f,!1),offset:Mt}}function Cu(st,Et){var Vt=st.static,Br=st.dynamic,Ir={};return Un.forEach(function(Jt){var sr=wi(Jt);function lr(Mt,Xt){if(Jt in Vt){var pt=Mt(Vt[Jt]);Ir[sr]=Au(function(){return pt})}else if(Jt in Br){var $t=Br[Jt];Ir[sr]=dh($t,function(zr,$r){return Xt(zr,$r,zr.invoke($r,$t))})}}switch(Jt){case ts:case Ko:case Wi:case np:case xo:case Vl:case Zl:case Uu:case hh:case gs:return lr(function(Mt){return he.commandType(Mt,"boolean",Jt,Et.commandStr),Mt},function(Mt,Xt,pt){return he.optional(function(){Mt.assert(Xt,"typeof "+pt+'==="boolean"',"invalid flag "+Jt,Mt.commandStr)}),pt});case qi:return lr(function(Mt){return he.commandParameter(Mt,Ah,"invalid "+Jt,Et.commandStr),Ah[Mt]},function(Mt,Xt,pt){var $t=Mt.constants.compareFuncs;return he.optional(function(){Mt.assert(Xt,pt+" in "+$t,"invalid "+Jt+", must be one of "+Object.keys(Ah))}),Xt.def($t,"[",pt,"]")});case xs:return lr(function(Mt){return he.command(zl(Mt)&&Mt.length===2&&typeof Mt[0]=="number"&&typeof Mt[1]=="number"&&Mt[0]<=Mt[1],"depth range is 2d array",Et.commandStr),Mt},function(Mt,Xt,pt){he.optional(function(){Mt.assert(Xt,Mt.shared.isArrayLike+"("+pt+")&&"+pt+".length===2&&typeof "+pt+'[0]==="number"&&typeof '+pt+'[1]==="number"&&'+pt+"[0]<="+pt+"[1]","depth range must be a 2d array")});var $t=Xt.def("+",pt,"[0]"),zr=Xt.def("+",pt,"[1]");return[$t,zr]});case ko:return lr(function(Mt){he.commandType(Mt,"object","blend.func",Et.commandStr);var Xt="srcRGB"in Mt?Mt.srcRGB:Mt.src,pt="srcAlpha"in Mt?Mt.srcAlpha:Mt.src,$t="dstRGB"in Mt?Mt.dstRGB:Mt.dst,zr="dstAlpha"in Mt?Mt.dstAlpha:Mt.dst;return he.commandParameter(Xt,Zh,sr+".srcRGB",Et.commandStr),he.commandParameter(pt,Zh,sr+".srcAlpha",Et.commandStr),he.commandParameter($t,Zh,sr+".dstRGB",Et.commandStr),he.commandParameter(zr,Zh,sr+".dstAlpha",Et.commandStr),he.command(lf.indexOf(Xt+", "+$t)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+Xt+", "+$t+")",Et.commandStr),[Zh[Xt],Zh[$t],Zh[pt],Zh[zr]]},function(Mt,Xt,pt){var $t=Mt.constants.blendFuncs;he.optional(function(){Mt.assert(Xt,pt+"&&typeof "+pt+'==="object"',"invalid blend func, must be an object")});function zr(Vr,po){var la=Xt.def('"',Vr,po,'" in ',pt,"?",pt,".",Vr,po,":",pt,".",Vr);return he.optional(function(){Mt.assert(Xt,la+" in "+$t,"invalid "+Jt+"."+Vr+po+", must be one of "+Object.keys(Zh))}),la}var $r=zr("src","RGB"),Tn=zr("dst","RGB");he.optional(function(){var Vr=Mt.constants.invalidBlendCombinations;Mt.assert(Xt,Vr+".indexOf("+$r+'+", "+'+Tn+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var vn=Xt.def($t,"[",$r,"]"),_n=Xt.def($t,"[",zr("src","Alpha"),"]"),Qn=Xt.def($t,"[",Tn,"]"),Fi=Xt.def($t,"[",zr("dst","Alpha"),"]");return[vn,Qn,_n,Fi]});case mo:return lr(function(Mt){if(typeof Mt=="string")return he.commandParameter(Mt,en,"invalid "+Jt,Et.commandStr),[en[Mt],en[Mt]];if(typeof Mt=="object")return he.commandParameter(Mt.rgb,en,Jt+".rgb",Et.commandStr),he.commandParameter(Mt.alpha,en,Jt+".alpha",Et.commandStr),[en[Mt.rgb],en[Mt.alpha]];he.commandRaise("invalid blend.equation",Et.commandStr)},function(Mt,Xt,pt){var $t=Mt.constants.blendEquations,zr=Xt.def(),$r=Xt.def(),Tn=Mt.cond("typeof ",pt,'==="string"');return he.optional(function(){function vn(_n,Qn,Fi){Mt.assert(_n,Fi+" in "+$t,"invalid "+Qn+", must be one of "+Object.keys(en))}vn(Tn.then,Jt,pt),Mt.assert(Tn.else,pt+"&&typeof "+pt+'==="object"',"invalid "+Jt),vn(Tn.else,Jt+".rgb",pt+".rgb"),vn(Tn.else,Jt+".alpha",pt+".alpha")}),Tn.then(zr,"=",$r,"=",$t,"[",pt,"];"),Tn.else(zr,"=",$t,"[",pt,".rgb];",$r,"=",$t,"[",pt,".alpha];"),Xt(Tn),[zr,$r]});case Mo:return lr(function(Mt){return he.command(zl(Mt)&&Mt.length===4,"blend.color must be a 4d array",Et.commandStr),Ne(4,function(Xt){return+Mt[Xt]})},function(Mt,Xt,pt){return he.optional(function(){Mt.assert(Xt,Mt.shared.isArrayLike+"("+pt+")&&"+pt+".length===4","blend.color must be a 4d array")}),Ne(4,function($t){return Xt.def("+",pt,"[",$t,"]")})});case pu:return lr(function(Mt){return he.commandType(Mt,"number",sr,Et.commandStr),Mt|0},function(Mt,Xt,pt){return he.optional(function(){Mt.assert(Xt,"typeof "+pt+'==="number"',"invalid stencil.mask")}),Xt.def(pt,"|0")});case Tu:return lr(function(Mt){he.commandType(Mt,"object",sr,Et.commandStr);var Xt=Mt.cmp||"keep",pt=Mt.ref||0,$t="mask"in Mt?Mt.mask:-1;return he.commandParameter(Xt,Ah,Jt+".cmp",Et.commandStr),he.commandType(pt,"number",Jt+".ref",Et.commandStr),he.commandType($t,"number",Jt+".mask",Et.commandStr),[Ah[Xt],pt,$t]},function(Mt,Xt,pt){var $t=Mt.constants.compareFuncs;he.optional(function(){function vn(){Mt.assert(Xt,Array.prototype.join.call(arguments,""),"invalid stencil.func")}vn(pt+"&&typeof ",pt,'==="object"'),vn('!("cmp" in ',pt,")||(",pt,".cmp in ",$t,")")});var zr=Xt.def('"cmp" in ',pt,"?",$t,"[",pt,".cmp]",":",Ef),$r=Xt.def(pt,".ref|0"),Tn=Xt.def('"mask" in ',pt,"?",pt,".mask|0:-1");return[zr,$r,Tn]});case Zu:case Dl:return lr(function(Mt){he.commandType(Mt,"object",sr,Et.commandStr);var Xt=Mt.fail||"keep",pt=Mt.zfail||"keep",$t=Mt.zpass||"keep";return he.commandParameter(Xt,Np,Jt+".fail",Et.commandStr),he.commandParameter(pt,Np,Jt+".zfail",Et.commandStr),he.commandParameter($t,Np,Jt+".zpass",Et.commandStr),[Jt===Dl?_p:Dc,Np[Xt],Np[pt],Np[$t]]},function(Mt,Xt,pt){var $t=Mt.constants.stencilOps;he.optional(function(){Mt.assert(Xt,pt+"&&typeof "+pt+'==="object"',"invalid "+Jt)});function zr($r){return he.optional(function(){Mt.assert(Xt,'!("'+$r+'" in '+pt+")||("+pt+"."+$r+" in "+$t+")","invalid "+Jt+"."+$r+", must be one of "+Object.keys(Np))}),Xt.def('"',$r,'" in ',pt,"?",$t,"[",pt,".",$r,"]:",Ef)}return[Jt===Dl?_p:Dc,zr("fail"),zr("zfail"),zr("zpass")]});case zu:return lr(function(Mt){he.commandType(Mt,"object",sr,Et.commandStr);var Xt=Mt.factor|0,pt=Mt.units|0;return he.commandType(Xt,"number",sr+".factor",Et.commandStr),he.commandType(pt,"number",sr+".units",Et.commandStr),[Xt,pt]},function(Mt,Xt,pt){he.optional(function(){Mt.assert(Xt,pt+"&&typeof "+pt+'==="object"',"invalid "+Jt)});var $t=Xt.def(pt,".factor|0"),zr=Xt.def(pt,".units|0");return[$t,zr]});case ja:return lr(function(Mt){var Xt=0;return Mt==="front"?Xt=Dc:Mt==="back"&&(Xt=_p),he.command(!!Xt,sr,Et.commandStr),Xt},function(Mt,Xt,pt){return he.optional(function(){Mt.assert(Xt,pt+'==="front"||'+pt+'==="back"',"invalid cull.face")}),Xt.def(pt,'==="front"?',Dc,":",_p)});case vs:return lr(function(Mt){return he.command(typeof Mt=="number"&&Mt>=qr.lineWidthDims[0]&&Mt<=qr.lineWidthDims[1],"invalid line width, must be a positive number between "+qr.lineWidthDims[0]+" and "+qr.lineWidthDims[1],Et.commandStr),Mt},function(Mt,Xt,pt){return he.optional(function(){Mt.assert(Xt,"typeof "+pt+'==="number"&&'+pt+">="+qr.lineWidthDims[0]+"&&"+pt+"<="+qr.lineWidthDims[1],"invalid line width")}),pt});case $a:return lr(function(Mt){return he.commandParameter(Mt,yp,sr,Et.commandStr),yp[Mt]},function(Mt,Xt,pt){return he.optional(function(){Mt.assert(Xt,pt+'==="cw"||'+pt+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),Xt.def(pt+'==="cw"?'+Kf+":"+xd)});case Cl:return lr(function(Mt){return he.command(zl(Mt)&&Mt.length===4,"color.mask must be length 4 array",Et.commandStr),Mt.map(function(Xt){return!!Xt})},function(Mt,Xt,pt){return he.optional(function(){Mt.assert(Xt,Mt.shared.isArrayLike+"("+pt+")&&"+pt+".length===4","invalid color.mask")}),Ne(4,function($t){return"!!"+pt+"["+$t+"]"})});case Yc:return lr(function(Mt){he.command(typeof Mt=="object"&&Mt,sr,Et.commandStr);var Xt="value"in Mt?Mt.value:1,pt=!!Mt.invert;return he.command(typeof Xt=="number"&&Xt>=0&&Xt<=1,"sample.coverage.value must be a number between 0 and 1",Et.commandStr),[Xt,pt]},function(Mt,Xt,pt){he.optional(function(){Mt.assert(Xt,pt+"&&typeof "+pt+'==="object"',"invalid sample.coverage")});var $t=Xt.def('"value" in ',pt,"?+",pt,".value:1"),zr=Xt.def("!!",pt,".invert");return[$t,zr]})}}),Ir}function Bl(st,Et){var Vt=st.static,Br=st.dynamic,Ir={};return Object.keys(Vt).forEach(function(Jt){var sr=Vt[Jt],lr;if(typeof sr=="number"||typeof sr=="boolean")lr=Au(function(){return sr});else if(typeof sr=="function"){var Mt=sr._reglType;Mt==="texture2d"||Mt==="textureCube"?lr=Au(function(Xt){return Xt.link(sr)}):Mt==="framebuffer"||Mt==="framebufferCube"?(he.command(sr.color.length>0,'missing color attachment for framebuffer sent to uniform "'+Jt+'"',Et.commandStr),lr=Au(function(Xt){return Xt.link(sr.color[0])})):he.commandRaise('invalid data for uniform "'+Jt+'"',Et.commandStr)}else zl(sr)?lr=Au(function(Xt){var pt=Xt.global.def("[",Ne(sr.length,function($t){return he.command(typeof sr[$t]=="number"||typeof sr[$t]=="boolean","invalid uniform "+Jt,Xt.commandStr),sr[$t]}),"]");return pt}):he.commandRaise('invalid or missing data for uniform "'+Jt+'"',Et.commandStr);lr.value=sr,Ir[Jt]=lr}),Object.keys(Br).forEach(function(Jt){var sr=Br[Jt];Ir[Jt]=dh(sr,function(lr,Mt){return lr.invoke(Mt,sr)})}),Ir}function as(st,Et){var Vt=st.static,Br=st.dynamic,Ir={};return Object.keys(Vt).forEach(function(Jt){var sr=Vt[Jt],lr=_t.id(Jt),Mt=new Tr;if(Zf(sr))Mt.state=nn,Mt.buffer=wn.getBuffer(wn.create(sr,fh,!1,!0)),Mt.type=0;else{var Xt=wn.getBuffer(sr);if(Xt)Mt.state=nn,Mt.buffer=Xt,Mt.type=0;else if(he.command(typeof sr=="object"&&sr,"invalid data for attribute "+Jt,Et.commandStr),"constant"in sr){var pt=sr.constant;Mt.buffer="null",Mt.state=Gn,typeof pt=="number"?Mt.x=pt:(he.command(zl(pt)&&pt.length>0&&pt.length<=4,"invalid constant for attribute "+Jt,Et.commandStr),Hr.forEach(function(Qn,Fi){Fi<pt.length&&(Mt[Qn]=pt[Fi])}))}else{Zf(sr.buffer)?Xt=wn.getBuffer(wn.create(sr.buffer,fh,!1,!0)):Xt=wn.getBuffer(sr.buffer),he.command(!!Xt,'missing buffer for attribute "'+Jt+'"',Et.commandStr);var $t=sr.offset|0;he.command($t>=0,'invalid offset for attribute "'+Jt+'"',Et.commandStr);var zr=sr.stride|0;he.command(zr>=0&&zr<256,'invalid stride for attribute "'+Jt+'", must be integer betweeen [0, 255]',Et.commandStr);var $r=sr.size|0;he.command(!("size"in sr)||$r>0&&$r<=4,'invalid size for attribute "'+Jt+'", must be 1,2,3,4',Et.commandStr);var Tn=!!sr.normalized,vn=0;"type"in sr&&(he.commandParameter(sr.type,Aa,"invalid type for attribute "+Jt,Et.commandStr),vn=Aa[sr.type]);var _n=sr.divisor|0;"divisor"in sr&&(he.command(_n===0||Xn,'cannot specify divisor for attribute "'+Jt+'", instancing not supported',Et.commandStr),he.command(_n>=0,'invalid divisor for attribute "'+Jt+'"',Et.commandStr)),he.optional(function(){var Qn=Et.commandStr,Fi=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(sr).forEach(function(Vr){he.command(Fi.indexOf(Vr)>=0,'unknown parameter "'+Vr+'" for attribute pointer "'+Jt+'" (valid parameters are '+Fi+")",Qn)})}),Mt.buffer=Xt,Mt.state=nn,Mt.size=$r,Mt.normalized=Tn,Mt.type=vn||Xt.dtype,Mt.offset=$t,Mt.stride=zr,Mt.divisor=_n}}Ir[Jt]=Au(function(Qn,Fi){var Vr=Qn.attribCache;if(lr in Vr)return Vr[lr];var po={isStream:!1};return Object.keys(Mt).forEach(function(la){po[la]=Mt[la]}),Mt.buffer&&(po.buffer=Qn.link(Mt.buffer),po.type=po.type||po.buffer+".dtype"),Vr[lr]=po,po})}),Object.keys(Br).forEach(function(Jt){var sr=Br[Jt];function lr(Mt,Xt){var pt=Mt.invoke(Xt,sr),$t=Mt.shared,zr=Mt.constants,$r=$t.isBufferArgs,Tn=$t.buffer;he.optional(function(){Mt.assert(Xt,pt+"&&(typeof "+pt+'==="object"||typeof '+pt+'==="function")&&('+$r+"("+pt+")||"+Tn+".getBuffer("+pt+")||"+Tn+".getBuffer("+pt+".buffer)||"+$r+"("+pt+'.buffer)||("constant" in '+pt+"&&(typeof "+pt+'.constant==="number"||'+$t.isArrayLike+"("+pt+".constant))))",'invalid dynamic attribute "'+Jt+'"')});var vn={isStream:Xt.def(!1)},_n=new Tr;_n.state=nn,Object.keys(_n).forEach(function(po){vn[po]=Xt.def(""+_n[po])});var Qn=vn.buffer,Fi=vn.type;Xt("if(",$r,"(",pt,")){",vn.isStream,"=true;",Qn,"=",Tn,".createStream(",fh,",",pt,");",Fi,"=",Qn,".dtype;","}else{",Qn,"=",Tn,".getBuffer(",pt,");","if(",Qn,"){",Fi,"=",Qn,".dtype;",'}else if("constant" in ',pt,"){",vn.state,"=",Gn,";","if(typeof "+pt+'.constant === "number"){',vn[Hr[0]],"=",pt,".constant;",Hr.slice(1).map(function(po){return vn[po]}).join("="),"=0;","}else{",Hr.map(function(po,la){return vn[po]+"="+pt+".constant.length>"+la+"?"+pt+".constant["+la+"]:0;"}).join(""),"}}else{","if(",$r,"(",pt,".buffer)){",Qn,"=",Tn,".createStream(",fh,",",pt,".buffer);","}else{",Qn,"=",Tn,".getBuffer(",pt,".buffer);","}",Fi,'="type" in ',pt,"?",zr.glTypes,"[",pt,".type]:",Qn,".dtype;",vn.normalized,"=!!",pt,".normalized;");function Vr(po){Xt(vn[po],"=",pt,".",po,"|0;")}return Vr("size"),Vr("offset"),Vr("stride"),Vr("divisor"),Xt("}}"),Xt.exit("if(",vn.isStream,"){",Tn,".destroyStream(",Qn,");","}"),vn}Ir[Jt]=dh(sr,lr)}),Ir}function fu(st,Et){var Vt=st.static,Br=st.dynamic;if(ip in Vt){var Ir=Vt[ip];return Ir!==null&&si.getVAO(Ir)===null&&(Ir=si.createVAO(Ir)),Au(function(sr){return sr.link(si.getVAO(Ir))})}else if(ip in Br){var Jt=Br[ip];return dh(Jt,function(sr,lr){var Mt=sr.invoke(lr,Jt);return lr.def(sr.shared.vao+".getVAO("+Mt+")")})}return null}function Js(st){var Et=st.static,Vt=st.dynamic,Br={};return Object.keys(Et).forEach(function(Ir){var Jt=Et[Ir];Br[Ir]=Au(function(sr,lr){return typeof Jt=="number"||typeof Jt=="boolean"?""+Jt:sr.link(Jt)})}),Object.keys(Vt).forEach(function(Ir){var Jt=Vt[Ir];Br[Ir]=dh(Jt,function(sr,lr){return sr.invoke(lr,Jt)})}),Br}function ps(st,Et,Vt,Br,Ir){var Jt=st.static,sr=st.dynamic;he.optional(function(){var Vr=[Vu,Ws,ju,os,yl,ph,Ol,_f,$l,ip].concat(Un);function po(la){Object.keys(la).forEach(function(Ns){he.command(Vr.indexOf(Ns)>=0,'unknown parameter "'+Ns+'"',Ir.commandStr)})}po(Jt),po(sr)});var lr=sa(st,Et),Mt=Ei(st,Ir),Xt=Ee(st,Mt,Ir),pt=Es(st,Ir),$t=Cu(st,Ir),zr=Jo(st,Ir,lr);function $r(Vr){var po=Xt[Vr];po&&($t[Vr]=po)}$r(ml),$r(wi(Uh));var Tn=Object.keys($t).length>0,vn={framebuffer:Mt,draw:pt,shader:zr,state:$t,dirty:Tn,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(vn.profile=K(st,Ir),vn.uniforms=Bl(Vt,Ir),vn.drawVAO=vn.scopeVAO=fu(st,Ir),!vn.drawVAO&&zr.program&&!lr&&Zt.angle_instanced_arrays){var _n=!0,Qn=zr.program.attributes.map(function(Vr){var po=Et.static[Vr];return _n=_n&&!!po,po});if(_n&&Qn.length>0){var Fi=si.getVAO(si.createVAO(Qn));vn.drawVAO=new Oc(null,null,null,function(Vr,po){return Vr.link(Fi)}),vn.useVAO=!0}}return lr?vn.useVAO=!0:vn.attributes=as(Et,Ir),vn.context=Js(Br,Ir),vn}function du(st,Et,Vt){var Br=st.shared,Ir=Br.context,Jt=st.scope();Object.keys(Vt).forEach(function(sr){Et.save(Ir,"."+sr);var lr=Vt[sr];Jt(Ir,".",sr,"=",lr.append(st,Et),";")}),Et(Jt)}function ru(st,Et,Vt,Br){var Ir=st.shared,Jt=Ir.gl,sr=Ir.framebuffer,lr;_i&&(lr=Et.def(Ir.extensions,".webgl_draw_buffers"));var Mt=st.constants,Xt=Mt.drawBuffer,pt=Mt.backBuffer,$t;Vt?$t=Vt.append(st,Et):$t=Et.def(sr,".next"),Br||Et("if(",$t,"!==",sr,".cur){"),Et("if(",$t,"){",Jt,".bindFramebuffer(",sf,",",$t,".framebuffer);"),_i&&Et(lr,".drawBuffersWEBGL(",Xt,"[",$t,".colorAttachments.length]);"),Et("}else{",Jt,".bindFramebuffer(",sf,",null);"),_i&&Et(lr,".drawBuffersWEBGL(",pt,");"),Et("}",sr,".cur=",$t,";"),Br||Et("}")}function uu(st,Et,Vt){var Br=st.shared,Ir=Br.gl,Jt=st.current,sr=st.next,lr=Br.current,Mt=Br.next,Xt=st.cond(lr,".dirty");Un.forEach(function(pt){var $t=wi(pt);if(!($t in Vt.state)){var zr,$r;if($t in sr){zr=sr[$t],$r=Jt[$t];var Tn=Ne(Rn[$t].length,function(_n){return Xt.def(zr,"[",_n,"]")});Xt(st.cond(Tn.map(function(_n,Qn){return _n+"!=="+$r+"["+Qn+"]"}).join("||")).then(Ir,".",Ln[$t],"(",Tn,");",Tn.map(function(_n,Qn){return $r+"["+Qn+"]="+_n}).join(";"),";"))}else{zr=Xt.def(Mt,".",$t);var vn=st.cond(zr,"!==",lr,".",$t);Xt(vn),$t in Oi?vn(st.cond(zr).then(Ir,".enable(",Oi[$t],");").else(Ir,".disable(",Oi[$t],");"),lr,".",$t,"=",zr,";"):vn(Ir,".",Ln[$t],"(",zr,");",lr,".",$t,"=",zr,";")}}}),Object.keys(Vt.state).length===0&&Xt(lr,".dirty=false;"),Et(Xt)}function za(st,Et,Vt,Br){var Ir=st.shared,Jt=st.current,sr=Ir.current,lr=Ir.gl;zp(Object.keys(Vt)).forEach(function(Mt){var Xt=Vt[Mt];if(!(Br&&!Br(Xt))){var pt=Xt.append(st,Et);if(Oi[Mt]){var $t=Oi[Mt];Wu(Xt)?pt?Et(lr,".enable(",$t,");"):Et(lr,".disable(",$t,");"):Et(st.cond(pt).then(lr,".enable(",$t,");").else(lr,".disable(",$t,");")),Et(sr,".",Mt,"=",pt,";")}else if(zl(pt)){var zr=Jt[Mt];Et(lr,".",Ln[Mt],"(",pt,");",pt.map(function($r,Tn){return zr+"["+Tn+"]="+$r}).join(";"),";")}else Et(lr,".",Ln[Mt],"(",pt,");",sr,".",Mt,"=",pt,";")}})}function Mu(st,Et){Xn&&(st.instancing=Et.def(st.shared.extensions,".angle_instanced_arrays"))}function Ca(st,Et,Vt,Br,Ir){var Jt=st.shared,sr=st.stats,lr=Jt.current,Mt=Jt.timer,Xt=Vt.profile;function pt(){return typeof performance=="undefined"?"Date.now()":"performance.now()"}var $t,zr;function $r(Vr){$t=Et.def(),Vr($t,"=",pt(),";"),typeof Ir=="string"?Vr(sr,".count+=",Ir,";"):Vr(sr,".count++;"),Vn&&(Br?(zr=Et.def(),Vr(zr,"=",Mt,".getNumPendingQueries();")):Vr(Mt,".beginQuery(",sr,");"))}function Tn(Vr){Vr(sr,".cpuTime+=",pt(),"-",$t,";"),Vn&&(Br?Vr(Mt,".pushScopeStats(",zr,",",Mt,".getNumPendingQueries(),",sr,");"):Vr(Mt,".endQuery();"))}function vn(Vr){var po=Et.def(lr,".profile");Et(lr,".profile=",Vr,";"),Et.exit(lr,".profile=",po,";")}var _n;if(Xt){if(Wu(Xt)){Xt.enable?($r(Et),Tn(Et.exit),vn("true")):vn("false");return}_n=Xt.append(st,Et),vn(_n)}else _n=Et.def(lr,".profile");var Qn=st.block();$r(Qn),Et("if(",_n,"){",Qn,"}");var Fi=st.block();Tn(Fi),Et.exit("if(",_n,"){",Fi,"}")}function mu(st,Et,Vt,Br,Ir){var Jt=st.shared;function sr(Mt){switch(Mt){case bf:case kf:case Sp:return 2;case wp:case xl:case rf:return 3;case $f:case dc:case nf:return 4;default:return 1}}function lr(Mt,Xt,pt){var $t=Jt.gl,zr=Et.def(Mt,".location"),$r=Et.def(Jt.attributes,"[",zr,"]"),Tn=pt.state,vn=pt.buffer,_n=[pt.x,pt.y,pt.z,pt.w],Qn=["buffer","normalized","offset","stride"];function Fi(){Et("if(!",$r,".buffer){",$t,".enableVertexAttribArray(",zr,");}");var po=pt.type,la;if(pt.size?la=Et.def(pt.size,"||",Xt):la=Xt,Et("if(",$r,".type!==",po,"||",$r,".size!==",la,"||",Qn.map(function(Fl){return $r+"."+Fl+"!=="+pt[Fl]}).join("||"),"){",$t,".bindBuffer(",fh,",",vn,".buffer);",$t,".vertexAttribPointer(",[zr,la,po,pt.normalized,pt.stride,pt.offset],");",$r,".type=",po,";",$r,".size=",la,";",Qn.map(function(Fl){return $r+"."+Fl+"="+pt[Fl]+";"}).join(""),"}"),Xn){var Ns=pt.divisor;Et("if(",$r,".divisor!==",Ns,"){",st.instancing,".vertexAttribDivisorANGLE(",[zr,Ns],");",$r,".divisor=",Ns,";}")}}function Vr(){Et("if(",$r,".buffer){",$t,".disableVertexAttribArray(",zr,");",$r,".buffer=null;","}if(",Hr.map(function(po,la){return $r+"."+po+"!=="+_n[la]}).join("||"),"){",$t,".vertexAttrib4f(",zr,",",_n,");",Hr.map(function(po,la){return $r+"."+po+"="+_n[la]+";"}).join(""),"}")}Tn===nn?Fi():Tn===Gn?Vr():(Et("if(",Tn,"===",nn,"){"),Fi(),Et("}else{"),Vr(),Et("}"))}Br.forEach(function(Mt){var Xt=Mt.name,pt=Vt.attributes[Xt],$t;if(pt){if(!Ir(pt))return;$t=pt.append(st,Et)}else{if(!Ir(rm))return;var zr=st.scopeAttrib(Xt);he.optional(function(){st.assert(Et,zr+".state","missing attribute "+Xt)}),$t={},Object.keys(new Tr).forEach(function($r){$t[$r]=Et.def(zr,".",$r)})}lr(st.link(Mt),sr(Mt.info.type),$t)})}function ss(st,Et,Vt,Br,Ir){for(var Jt=st.shared,sr=Jt.gl,lr,Mt=0;Mt<Br.length;++Mt){var Xt=Br[Mt],pt=Xt.name,$t=Xt.info.type,zr=Vt.uniforms[pt],$r=st.link(Xt),Tn=$r+".location",vn;if(zr){if(!Ir(zr))continue;if(Wu(zr)){var _n=zr.value;if(he.command(_n!==null&&typeof _n!="undefined",'missing uniform "'+pt+'"',st.commandStr),$t===af||$t===kp){he.command(typeof _n=="function"&&($t===af&&(_n._reglType==="texture2d"||_n._reglType==="framebuffer")||$t===kp&&(_n._reglType==="textureCube"||_n._reglType==="framebufferCube")),"invalid texture for uniform "+pt,st.commandStr);var Qn=st.link(_n._texture||_n.color[0]._texture);Et(sr,".uniform1i(",Tn,",",Qn+".bind());"),Et.exit(Qn,".unbind();")}else if($t===Nf||$t===zf||$t===of){he.optional(function(){he.command(zl(_n),"invalid matrix for uniform "+pt,st.commandStr),he.command($t===Nf&&_n.length===4||$t===zf&&_n.length===9||$t===of&&_n.length===16,"invalid length for matrix uniform "+pt,st.commandStr)});var Fi=st.global.def("new Float32Array(["+Array.prototype.slice.call(_n)+"])"),Vr=2;$t===zf?Vr=3:$t===of&&(Vr=4),Et(sr,".uniformMatrix",Vr,"fv(",Tn,",false,",Fi,");")}else{switch($t){case Bd:he.commandType(_n,"number","uniform "+pt,st.commandStr),lr="1f";break;case bf:he.command(zl(_n)&&_n.length===2,"uniform "+pt,st.commandStr),lr="2f";break;case wp:he.command(zl(_n)&&_n.length===3,"uniform "+pt,st.commandStr),lr="3f";break;case $f:he.command(zl(_n)&&_n.length===4,"uniform "+pt,st.commandStr),lr="4f";break;case Fp:he.commandType(_n,"boolean","uniform "+pt,st.commandStr),lr="1i";break;case ap:he.commandType(_n,"number","uniform "+pt,st.commandStr),lr="1i";break;case Sp:he.command(zl(_n)&&_n.length===2,"uniform "+pt,st.commandStr),lr="2i";break;case kf:he.command(zl(_n)&&_n.length===2,"uniform "+pt,st.commandStr),lr="2i";break;case rf:he.command(zl(_n)&&_n.length===3,"uniform "+pt,st.commandStr),lr="3i";break;case xl:he.command(zl(_n)&&_n.length===3,"uniform "+pt,st.commandStr),lr="3i";break;case nf:he.command(zl(_n)&&_n.length===4,"uniform "+pt,st.commandStr),lr="4i";break;case dc:he.command(zl(_n)&&_n.length===4,"uniform "+pt,st.commandStr),lr="4i";break}Et(sr,".uniform",lr,"(",Tn,",",zl(_n)?Array.prototype.slice.call(_n):_n,");")}continue}else vn=zr.append(st,Et)}else{if(!Ir(rm))continue;vn=Et.def(Jt.uniforms,"[",_t.id(pt),"]")}$t===af?Et("if(",vn,"&&",vn,'._reglType==="framebuffer"){',vn,"=",vn,".color[0];","}"):$t===kp&&Et("if(",vn,"&&",vn,'._reglType==="framebufferCube"){',vn,"=",vn,".color[0];","}"),he.optional(function(){function ic(Up,td){st.assert(Et,Up,'bad data or missing for uniform "'+pt+'". '+td)}function ed(Up){ic("typeof "+vn+'==="'+Up+'"',"invalid type, expected "+Up)}function Ch(Up,td){ic(Jt.isArrayLike+"("+vn+")&&"+vn+".length==="+Up,"invalid vector, should have length "+Up,st.commandStr)}function Sd(Up){ic("typeof "+vn+'==="function"&&'+vn+'._reglType==="texture'+(Up===Xf?"2d":"Cube")+'"',"invalid texture type",st.commandStr)}switch($t){case ap:ed("number");break;case kf:Ch(2,"number");break;case xl:Ch(3,"number");break;case dc:Ch(4,"number");break;case Bd:ed("number");break;case bf:Ch(2,"number");break;case wp:Ch(3,"number");break;case $f:Ch(4,"number");break;case Fp:ed("boolean");break;case Sp:Ch(2,"boolean");break;case rf:Ch(3,"boolean");break;case nf:Ch(4,"boolean");break;case Nf:Ch(4,"number");break;case zf:Ch(9,"number");break;case of:Ch(16,"number");break;case af:Sd(Xf);break;case kp:Sd(tm);break}});var po=1;switch($t){case af:case kp:var la=Et.def(vn,"._texture");Et(sr,".uniform1i(",Tn,",",la,".bind());"),Et.exit(la,".unbind();");continue;case ap:case Fp:lr="1i";break;case kf:case Sp:lr="2i",po=2;break;case xl:case rf:lr="3i",po=3;break;case dc:case nf:lr="4i",po=4;break;case Bd:lr="1f";break;case bf:lr="2f",po=2;break;case wp:lr="3f",po=3;break;case $f:lr="4f",po=4;break;case Nf:lr="Matrix2fv";break;case zf:lr="Matrix3fv";break;case of:lr="Matrix4fv";break}if(Et(sr,".uniform",lr,"(",Tn,","),lr.charAt(0)==="M"){var Ns=Math.pow($t-Nf+2,2),Fl=st.global.def("new Float32Array(",Ns,")");Et("false,(Array.isArray(",vn,")||",vn," instanceof Float32Array)?",vn,":(",Ne(Ns,function(ic){return Fl+"["+ic+"]="+vn+"["+ic+"]"}),",",Fl,")")}else po>1?Et(Ne(po,function(ic){return vn+"["+ic+"]"})):Et(vn);Et(");")}}function go(st,Et,Vt,Br){var Ir=st.shared,Jt=Ir.gl,sr=Ir.draw,lr=Br.draw;function Mt(){var la=lr.elements,Ns,Fl=Et;return la?((la.contextDep&&Br.contextDynamic||la.propDep)&&(Fl=Vt),Ns=la.append(st,Fl)):Ns=Fl.def(sr,".",os),Ns&&Fl("if("+Ns+")"+Jt+".bindBuffer("+_d+","+Ns+".buffer.buffer);"),Ns}function Xt(){var la=lr.count,Ns,Fl=Et;return la?((la.contextDep&&Br.contextDynamic||la.propDep)&&(Fl=Vt),Ns=la.append(st,Fl),he.optional(function(){la.MISSING&&st.assert(Et,"false","missing vertex count"),la.DYNAMIC&&st.assert(Fl,Ns+">=0","missing vertex count")})):(Ns=Fl.def(sr,".",Ol),he.optional(function(){st.assert(Fl,Ns+">=0","missing vertex count")})),Ns}var pt=Mt();function $t(la){var Ns=lr[la];return Ns?Ns.contextDep&&Br.contextDynamic||Ns.propDep?Ns.append(st,Vt):Ns.append(st,Et):Et.def(sr,".",la)}var zr=$t(yl),$r=$t(ph),Tn=Xt();if(typeof Tn=="number"){if(Tn===0)return}else Vt("if(",Tn,"){"),Vt.exit("}");var vn,_n;Xn&&(vn=$t(_f),_n=st.instancing);var Qn=pt+".type",Fi=lr.elements&&Wu(lr.elements);function Vr(){function la(){Vt(_n,".drawElementsInstancedANGLE(",[zr,Tn,Qn,$r+"<<(("+Qn+"-"+sn+")>>1)",vn],");")}function Ns(){Vt(_n,".drawArraysInstancedANGLE(",[zr,$r,Tn,vn],");")}pt?Fi?la():(Vt("if(",pt,"){"),la(),Vt("}else{"),Ns(),Vt("}")):Ns()}function po(){function la(){Vt(Jt+".drawElements("+[zr,Tn,Qn,$r+"<<(("+Qn+"-"+sn+")>>1)"]+");")}function Ns(){Vt(Jt+".drawArrays("+[zr,$r,Tn]+");")}pt?Fi?la():(Vt("if(",pt,"){"),la(),Vt("}else{"),Ns(),Vt("}")):Ns()}Xn&&(typeof vn!="number"||vn>=0)?typeof vn=="string"?(Vt("if(",vn,">0){"),Vr(),Vt("}else if(",vn,"<0){"),po(),Vt("}")):Vr():po()}function ya(st,Et,Vt,Br,Ir){var Jt=Wt(),sr=Jt.proc("body",Ir);return he.optional(function(){Jt.commandStr=Et.commandStr,Jt.command=Jt.link(Et.commandStr)}),Xn&&(Jt.instancing=sr.def(Jt.shared.extensions,".angle_instanced_arrays")),st(Jt,sr,Vt,Br),Jt.compile().body}function Qo(st,Et,Vt,Br){Mu(st,Et),Vt.useVAO?Vt.drawVAO?Et(st.shared.vao,".setVAO(",Vt.drawVAO.append(st,Et),");"):Et(st.shared.vao,".setVAO(",st.shared.vao,".targetVAO);"):(Et(st.shared.vao,".setVAO(null);"),mu(st,Et,Vt,Br.attributes,function(){return!0})),ss(st,Et,Vt,Br.uniforms,function(){return!0}),go(st,Et,Et,Vt)}function Qs(st,Et){var Vt=st.proc("draw",1);Mu(st,Vt),du(st,Vt,Et.context),ru(st,Vt,Et.framebuffer),uu(st,Vt,Et),za(st,Vt,Et.state),Ca(st,Vt,Et,!1,!0);var Br=Et.shader.progVar.append(st,Vt);if(Vt(st.shared.gl,".useProgram(",Br,".program);"),Et.shader.program)Qo(st,Vt,Et,Et.shader.program);else{Vt(st.shared.vao,".setVAO(null);");var Ir=st.global.def("{}"),Jt=Vt.def(Br,".id"),sr=Vt.def(Ir,"[",Jt,"]");Vt(st.cond(sr).then(sr,".call(this,a0);").else(sr,"=",Ir,"[",Jt,"]=",st.link(function(lr){return ya(Qo,st,Et,lr,1)}),"(",Br,");",sr,".call(this,a0);"))}Object.keys(Et.state).length>0&&Vt(st.shared.current,".dirty=true;")}function Cp(st,Et,Vt,Br){st.batchId="a1",Mu(st,Et);function Ir(){return!0}mu(st,Et,Vt,Br.attributes,Ir),ss(st,Et,Vt,Br.uniforms,Ir),go(st,Et,Et,Vt)}function Ft(st,Et,Vt,Br){Mu(st,Et);var Ir=Vt.contextDep,Jt=Et.def(),sr="a0",lr="a1",Mt=Et.def();st.shared.props=Mt,st.batchId=Jt;var Xt=st.scope(),pt=st.scope();Et(Xt.entry,"for(",Jt,"=0;",Jt,"<",lr,";++",Jt,"){",Mt,"=",sr,"[",Jt,"];",pt,"}",Xt.exit);function $t(Qn){return Qn.contextDep&&Ir||Qn.propDep}function zr(Qn){return!$t(Qn)}if(Vt.needsContext&&du(st,pt,Vt.context),Vt.needsFramebuffer&&ru(st,pt,Vt.framebuffer),za(st,pt,Vt.state,$t),Vt.profile&&$t(Vt.profile)&&Ca(st,pt,Vt,!1,!0),Br)Vt.useVAO?Vt.drawVAO?$t(Vt.drawVAO)?pt(st.shared.vao,".setVAO(",Vt.drawVAO.append(st,pt),");"):Xt(st.shared.vao,".setVAO(",Vt.drawVAO.append(st,Xt),");"):Xt(st.shared.vao,".setVAO(",st.shared.vao,".targetVAO);"):(Xt(st.shared.vao,".setVAO(null);"),mu(st,Xt,Vt,Br.attributes,zr),mu(st,pt,Vt,Br.attributes,$t)),ss(st,Xt,Vt,Br.uniforms,zr),ss(st,pt,Vt,Br.uniforms,$t),go(st,Xt,pt,Vt);else{var $r=st.global.def("{}"),Tn=Vt.shader.progVar.append(st,pt),vn=pt.def(Tn,".id"),_n=pt.def($r,"[",vn,"]");pt(st.shared.gl,".useProgram(",Tn,".program);","if(!",_n,"){",_n,"=",$r,"[",vn,"]=",st.link(function(Qn){return ya(Cp,st,Vt,Qn,2)}),"(",Tn,");}",_n,".call(this,a0[",Jt,"],",Jt,");")}}function Xr(st,Et){var Vt=st.proc("batch",2);st.batchId="0",Mu(st,Vt);var Br=!1,Ir=!0;Object.keys(Et.context).forEach(function($r){Br=Br||Et.context[$r].propDep}),Br||(du(st,Vt,Et.context),Ir=!1);var Jt=Et.framebuffer,sr=!1;Jt?(Jt.propDep?Br=sr=!0:Jt.contextDep&&Br&&(sr=!0),sr||ru(st,Vt,Jt)):ru(st,Vt,null),Et.state.viewport&&Et.state.viewport.propDep&&(Br=!0);function lr($r){return $r.contextDep&&Br||$r.propDep}uu(st,Vt,Et),za(st,Vt,Et.state,function($r){return!lr($r)}),(!Et.profile||!lr(Et.profile))&&Ca(st,Vt,Et,!1,"a1"),Et.contextDep=Br,Et.needsContext=Ir,Et.needsFramebuffer=sr;var Mt=Et.shader.progVar;if(Mt.contextDep&&Br||Mt.propDep)Ft(st,Vt,Et,null);else{var Xt=Mt.append(st,Vt);if(Vt(st.shared.gl,".useProgram(",Xt,".program);"),Et.shader.program)Ft(st,Vt,Et,Et.shader.program);else{Vt(st.shared.vao,".setVAO(null);");var pt=st.global.def("{}"),$t=Vt.def(Xt,".id"),zr=Vt.def(pt,"[",$t,"]");Vt(st.cond(zr).then(zr,".call(this,a0,a1);").else(zr,"=",pt,"[",$t,"]=",st.link(function($r){return ya(Ft,st,Et,$r,2)}),"(",Xt,");",zr,".call(this,a0,a1);"))}}Object.keys(Et.state).length>0&&Vt(st.shared.current,".dirty=true;")}function Mr(st,Et){var Vt=st.proc("scope",3);st.batchId="a2";var Br=st.shared,Ir=Br.current;du(st,Vt,Et.context),Et.framebuffer&&Et.framebuffer.append(st,Vt),zp(Object.keys(Et.state)).forEach(function(sr){var lr=Et.state[sr],Mt=lr.append(st,Vt);zl(Mt)?Mt.forEach(function(Xt,pt){Vt.set(st.next[sr],"["+pt+"]",Xt)}):Vt.set(Br.next,"."+sr,Mt)}),Ca(st,Vt,Et,!0,!0),[os,ph,Ol,_f,yl].forEach(function(sr){var lr=Et.draw[sr];lr&&Vt.set(Br.draw,"."+sr,""+lr.append(st,Vt))}),Object.keys(Et.uniforms).forEach(function(sr){Vt.set(Br.uniforms,"["+_t.id(sr)+"]",Et.uniforms[sr].append(st,Vt))}),Object.keys(Et.attributes).forEach(function(sr){var lr=Et.attributes[sr].append(st,Vt),Mt=st.scopeAttrib(sr);Object.keys(new Tr).forEach(function(Xt){Vt.set(Mt,"."+Xt,lr[Xt])})}),Et.scopeVAO&&Vt.set(Br.vao,".targetVAO",Et.scopeVAO.append(st,Vt));function Jt(sr){var lr=Et.shader[sr];lr&&Vt.set(Br.shader,"."+sr,lr.append(st,Vt))}Jt(Ws),Jt(ju),Object.keys(Et.state).length>0&&(Vt(Ir,".dirty=true;"),Vt.exit(Ir,".dirty=true;")),Vt("a1(",st.shared.context,",a0,",st.batchId,");")}function Bi(st){if(!(typeof st!="object"||zl(st))){for(var Et=Object.keys(st),Vt=0;Vt<Et.length;++Vt)if(To.isDynamic(st[Et[Vt]]))return!0;return!1}}function Ma(st,Et,Vt){var Br=Et.static[Vt];if(!Br||!Bi(Br))return;var Ir=st.global,Jt=Object.keys(Br),sr=!1,lr=!1,Mt=!1,Xt=st.global.def("{}");Jt.forEach(function($t){var zr=Br[$t];if(To.isDynamic(zr)){typeof zr=="function"&&(zr=Br[$t]=To.unbox(zr));var $r=dh(zr,null);sr=sr||$r.thisDep,Mt=Mt||$r.propDep,lr=lr||$r.contextDep}else{switch(Ir(Xt,".",$t,"="),typeof zr){case"number":Ir(zr);break;case"string":Ir('"',zr,'"');break;case"object":Array.isArray(zr)&&Ir("[",zr.join(),"]");break;default:Ir(st.link(zr));break}Ir(";")}});function pt($t,zr){Jt.forEach(function($r){var Tn=Br[$r];if(To.isDynamic(Tn)){var vn=$t.invoke(zr,Tn);zr(Xt,".",$r,"=",vn,";")}})}Et.dynamic[Vt]=new To.DynamicVariable(gi,{thisDep:sr,contextDep:lr,propDep:Mt,ref:Xt,append:pt}),delete Et.static[Vt]}function el(st,Et,Vt,Br,Ir){var Jt=Wt();Jt.stats=Jt.link(Ir),Object.keys(Et.static).forEach(function(lr){Ma(Jt,Et,lr)}),sd.forEach(function(lr){Ma(Jt,st,lr)});var sr=ps(st,Et,Vt,Br,Jt);return Qs(Jt,sr),Mr(Jt,sr),Xr(Jt,sr),Jt.compile()}return{next:xi,current:Rn,procs:function(){var st=Wt(),Et=st.proc("poll"),Vt=st.proc("refresh"),Br=st.block();Et(Br),Vt(Br);var Ir=st.shared,Jt=Ir.gl,sr=Ir.next,lr=Ir.current;Br(lr,".dirty=false;"),ru(st,Et),ru(st,Vt,null,!0);var Mt;Xn&&(Mt=st.link(Xn)),Zt.oes_vertex_array_object&&Vt(st.link(Zt.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var Xt=0;Xt<qr.maxAttributes;++Xt){var pt=Vt.def(Ir.attributes,"[",Xt,"]"),$t=st.cond(pt,".buffer");$t.then(Jt,".enableVertexAttribArray(",Xt,");",Jt,".bindBuffer(",fh,",",pt,".buffer.buffer);",Jt,".vertexAttribPointer(",Xt,",",pt,".size,",pt,".type,",pt,".normalized,",pt,".stride,",pt,".offset);").else(Jt,".disableVertexAttribArray(",Xt,");",Jt,".vertexAttrib4f(",Xt,",",pt,".x,",pt,".y,",pt,".z,",pt,".w);",pt,".buffer=null;"),Vt($t),Xn&&Vt(Mt,".vertexAttribDivisorANGLE(",Xt,",",pt,".divisor);")}return Vt(st.shared.vao,".currentVAO=null;",st.shared.vao,".setVAO(",st.shared.vao,".targetVAO);"),Object.keys(Oi).forEach(function(zr){var $r=Oi[zr],Tn=Br.def(sr,".",zr),vn=st.block();vn("if(",Tn,"){",Jt,".enable(",$r,")}else{",Jt,".disable(",$r,")}",lr,".",zr,"=",Tn,";"),Vt(vn),Et("if(",Tn,"!==",lr,".",zr,"){",vn,"}")}),Object.keys(Ln).forEach(function(zr){var $r=Ln[zr],Tn=Rn[zr],vn,_n,Qn=st.block();if(Qn(Jt,".",$r,"("),zl(Tn)){var Fi=Tn.length;vn=st.global.def(sr,".",zr),_n=st.global.def(lr,".",zr),Qn(Ne(Fi,function(Vr){return vn+"["+Vr+"]"}),");",Ne(Fi,function(Vr){return _n+"["+Vr+"]="+vn+"["+Vr+"];"}).join("")),Et("if(",Ne(Fi,function(Vr){return vn+"["+Vr+"]!=="+_n+"["+Vr+"]"}).join("||"),"){",Qn,"}")}else vn=Br.def(sr,".",zr),_n=Br.def(lr,".",zr),Qn(vn,");",lr,".",zr,"=",vn,";"),Et("if(",vn,"!==",_n,"){",Qn,"}");Vt(Qn)}),st.compile()}(),compile:el}}function nm(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var Fd=34918,xm=34919,Jf=35007,kd=function(Pe,_t){if(!_t.ext_disjoint_timer_query)return null;var Zt=[];function qr(){return Zt.pop()||_t.ext_disjoint_timer_query.createQueryEXT()}function wn(Xn){Zt.push(Xn)}var Yr=[];function Or(Xn){var _i=qr();_t.ext_disjoint_timer_query.beginQueryEXT(Jf,_i),Yr.push(_i),Vn(Yr.length-1,Yr.length,Xn)}function Wn(){_t.ext_disjoint_timer_query.endQueryEXT(Jf)}function Bn(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var si=[];function Hn(){return si.pop()||new Bn}function qn(Xn){si.push(Xn)}var ci=[];function Vn(Xn,_i,Rn){var xi=Hn();xi.startQueryIndex=Xn,xi.endQueryIndex=_i,xi.sum=0,xi.stats=Rn,ci.push(xi)}var Yn=[],Tr=[];function en(){var Xn,_i,Rn=Yr.length;if(Rn!==0){Tr.length=Math.max(Tr.length,Rn+1),Yn.length=Math.max(Yn.length,Rn+1),Yn[0]=0,Tr[0]=0;var xi=0;for(Xn=0,_i=0;_i<Yr.length;++_i){var Un=Yr[_i];_t.ext_disjoint_timer_query.getQueryObjectEXT(Un,xm)?(xi+=_t.ext_disjoint_timer_query.getQueryObjectEXT(Un,Fd),wn(Un)):Yr[Xn++]=Un,Yn[_i+1]=xi,Tr[_i+1]=Xn}for(Yr.length=Xn,Xn=0,_i=0;_i<ci.length;++_i){var Oi=ci[_i],Ln=Oi.startQueryIndex,wi=Oi.endQueryIndex;Oi.sum+=Yn[wi]-Yn[Ln];var Po=Tr[Ln],da=Tr[wi];da===Po?(Oi.stats.gpuTime+=Oi.sum/1e6,qn(Oi)):(Oi.startQueryIndex=Po,Oi.endQueryIndex=da,ci[Xn++]=Oi)}ci.length=Xn}}return{beginQuery:Or,endQuery:Wn,pushScopeStats:Vn,update:en,getNumPendingQueries:function(){return Yr.length},clear:function(){Zt.push.apply(Zt,Yr);for(var Xn=0;Xn<Zt.length;Xn++)_t.ext_disjoint_timer_query.deleteQueryEXT(Zt[Xn]);Yr.length=0,Zt.length=0},restore:function(){Yr.length=0,Zt.length=0}}},fd=16384,Bc=256,im=1024,om=34962,Nd="webglcontextlost",am="webglcontextrestored",uf=1,Qf=2,cl=3;function zd(Pe,_t){for(var Zt=0;Zt<Pe.length;++Zt)if(Pe[Zt]===_t)return Zt;return-1}function Fc(Pe){var _t=Us(Pe);if(!_t)return null;var Zt=_t.gl,qr=Zt.getContextAttributes(),wn=Zt.isContextLost(),Yr=Lt(Zt,_t);if(!Yr)return null;var Or=wa(),Wn=nm(),Bn=Yr.extensions,si=kd(Zt,Bn),Hn=Lo(),qn=Zt.drawingBufferWidth,ci=Zt.drawingBufferHeight,Vn={tick:0,time:0,viewportWidth:qn,viewportHeight:ci,framebufferWidth:qn,framebufferHeight:ci,drawingBufferWidth:qn,drawingBufferHeight:ci,pixelRatio:_t.pixelRatio},Yn={},Tr={elements:null,primitive:4,count:-1,offset:0,instances:-1},en=wl(Zt,Bn),Xn=Kc(Zt,Wn,_t,Rn),_i=ce(Zt,Bn,en,Wn,Xn);function Rn(go){return _i.destroyBuffer(go)}var xi=dp(Zt,Bn,Xn,Wn),Un=nt(Zt,Or,Wn,_t),Oi=ql(Zt,Bn,en,function(){Po.procs.poll()},Vn,Wn,_t),Ln=Ic(Zt,Bn,en,Wn,_t),wi=G(Zt,Bn,en,Oi,Ln,Wn),Po=Ap(Zt,Or,Bn,en,Xn,xi,Oi,wi,Yn,_i,Un,Tr,Vn,si,_t),da=Nt(Zt,wi,Po.procs.poll,Vn,qr,Bn,en),bi=Po.next,Zn=Zt.canvas,Sn=[],Wt=[],K=[],Ei=[_t.onDestroy],Ee=null;function sa(){if(Sn.length===0){si&&si.update(),Ee=null;return}Ee=Ti.next(sa),za();for(var go=Sn.length-1;go>=0;--go){var ya=Sn[go];ya&&ya(Vn,null,0)}Zt.flush(),si&&si.update()}function Jo(){!Ee&&Sn.length>0&&(Ee=Ti.next(sa))}function Es(){Ee&&(Ti.cancel(sa),Ee=null)}function Cu(go){go.preventDefault(),wn=!0,Es(),Wt.forEach(function(ya){ya()})}function Bl(go){Zt.getError(),wn=!1,Yr.restore(),Un.restore(),Xn.restore(),Oi.restore(),Ln.restore(),wi.restore(),_i.restore(),si&&si.restore(),Po.procs.refresh(),Jo(),K.forEach(function(ya){ya()})}Zn&&(Zn.addEventListener(Nd,Cu,!1),Zn.addEventListener(am,Bl,!1));function as(){Sn.length=0,Es(),Zn&&(Zn.removeEventListener(Nd,Cu),Zn.removeEventListener(am,Bl)),Un.clear(),wi.clear(),Ln.clear(),Oi.clear(),xi.clear(),Xn.clear(),_i.clear(),si&&si.clear(),Ei.forEach(function(go){go()})}function fu(go){he(!!go,"invalid args to regl({...})"),he.type(go,"object","invalid args to regl({...})");function ya(Ir){var Jt=Se({},Ir);delete Jt.uniforms,delete Jt.attributes,delete Jt.context,delete Jt.vao,"stencil"in Jt&&Jt.stencil.op&&(Jt.stencil.opBack=Jt.stencil.opFront=Jt.stencil.op,delete Jt.stencil.op);function sr(lr){if(lr in Jt){var Mt=Jt[lr];delete Jt[lr],Object.keys(Mt).forEach(function(Xt){Jt[lr+"."+Xt]=Mt[Xt]})}}return sr("blend"),sr("depth"),sr("cull"),sr("stencil"),sr("polygonOffset"),sr("scissor"),sr("sample"),"vao"in Ir&&(Jt.vao=Ir.vao),Jt}function Qo(Ir){var Jt={},sr={};return Object.keys(Ir).forEach(function(lr){var Mt=Ir[lr];To.isDynamic(Mt)?sr[lr]=To.unbox(Mt,lr):Jt[lr]=Mt}),{dynamic:sr,static:Jt}}var Qs=Qo(go.context||{}),Cp=Qo(go.uniforms||{}),Ft=Qo(go.attributes||{}),Xr=Qo(ya(go)),Mr={gpuTime:0,cpuTime:0,count:0},Bi=Po.compile(Xr,Ft,Cp,Qs,Mr),Ma=Bi.draw,el=Bi.batch,st=Bi.scope,Et=[];function Vt(Ir){for(;Et.length<Ir;)Et.push(null);return Et}function Br(Ir,Jt){var sr;if(wn&&he.raise("context lost"),typeof Ir=="function")return st.call(this,null,Ir,0);if(typeof Jt=="function")if(typeof Ir=="number")for(sr=0;sr<Ir;++sr)st.call(this,null,Jt,sr);else if(Array.isArray(Ir))for(sr=0;sr<Ir.length;++sr)st.call(this,Ir[sr],Jt,sr);else return st.call(this,Ir,Jt,0);else if(typeof Ir=="number"){if(Ir>0)return el.call(this,Vt(Ir|0),Ir|0)}else if(Array.isArray(Ir)){if(Ir.length)return el.call(this,Ir,Ir.length)}else return Ma.call(this,Ir)}return Se(Br,{stats:Mr})}var Js=wi.setFBO=fu({framebuffer:To.define.call(null,uf,"framebuffer")});function ps(go,ya){var Qo=0;Po.procs.poll();var Qs=ya.color;Qs&&(Zt.clearColor(+Qs[0]||0,+Qs[1]||0,+Qs[2]||0,+Qs[3]||0),Qo|=fd),"depth"in ya&&(Zt.clearDepth(+ya.depth),Qo|=Bc),"stencil"in ya&&(Zt.clearStencil(ya.stencil|0),Qo|=im),he(!!Qo,"called regl.clear with no buffer specified"),Zt.clear(Qo)}function du(go){if(he(typeof go=="object"&&go,"regl.clear() takes an object as input"),"framebuffer"in go)if(go.framebuffer&&go.framebuffer_reglType==="framebufferCube")for(var ya=0;ya<6;++ya)Js(Se({framebuffer:go.framebuffer.faces[ya]},go),ps);else Js(go,ps);else ps(null,go)}function ru(go){he.type(go,"function","regl.frame() callback must be a function"),Sn.push(go);function ya(){var Qo=zd(Sn,go);he(Qo>=0,"cannot cancel a frame twice");function Qs(){var Cp=zd(Sn,Qs);Sn[Cp]=Sn[Sn.length-1],Sn.length-=1,Sn.length<=0&&Es()}Sn[Qo]=Qs}return Jo(),{cancel:ya}}function uu(){var go=bi.viewport,ya=bi.scissor_box;go[0]=go[1]=ya[0]=ya[1]=0,Vn.viewportWidth=Vn.framebufferWidth=Vn.drawingBufferWidth=go[2]=ya[2]=Zt.drawingBufferWidth,Vn.viewportHeight=Vn.framebufferHeight=Vn.drawingBufferHeight=go[3]=ya[3]=Zt.drawingBufferHeight}function za(){Vn.tick+=1,Vn.time=Ca(),uu(),Po.procs.poll()}function Mu(){uu(),Po.procs.refresh(),si&&si.update()}function Ca(){return(Lo()-Hn)/1e3}Mu();function mu(go,ya){he.type(ya,"function","listener callback must be a function");var Qo;switch(go){case"frame":return ru(ya);case"lost":Qo=Wt;break;case"restore":Qo=K;break;case"destroy":Qo=Ei;break;default:he.raise("invalid event, must be one of frame,lost,restore,destroy")}return Qo.push(ya),{cancel:function(){for(var Qs=0;Qs<Qo.length;++Qs)if(Qo[Qs]===ya){Qo[Qs]=Qo[Qo.length-1],Qo.pop();return}}}}var ss=Se(fu,{clear:du,prop:To.define.bind(null,uf),context:To.define.bind(null,Qf),this:To.define.bind(null,cl),draw:fu({}),buffer:function(go){return Xn.create(go,om,!1,!1)},elements:function(go){return xi.create(go,!1)},texture:Oi.create2D,cube:Oi.createCube,renderbuffer:Ln.create,framebuffer:wi.create,framebufferCube:wi.createCube,vao:_i.createVAO,attributes:qr,frame:ru,on:mu,limits:en,hasExtension:function(go){return en.extensions.indexOf(go.toLowerCase())>=0},read:da,destroy:as,_gl:Zt,_refresh:Mu,poll:function(){za(),si&&si.update()},now:Ca,stats:Wn});return _t.onDone(null,ss),ss}return Fc})},48096:function(Zr){(function(_r,Se){Zr.exports=Se()})(this,function(){"use strict";function _r(xr,jt,Jr,gr,rn,jn){if(!(rn-gr<=Jr)){var qe=gr+rn>>1;Se(xr,jt,qe,gr,rn,jn%2),_r(xr,jt,Jr,gr,qe-1,jn+1),_r(xr,jt,Jr,qe+1,rn,jn+1)}}function Se(xr,jt,Jr,gr,rn,jn){for(;rn>gr;){if(rn-gr>600){var qe=rn-gr+1,Dt=Jr-gr+1,$e=Math.log(qe),Pt=.5*Math.exp(2*$e/3),vt=.5*Math.sqrt($e*Pt*(qe-Pt)/qe)*(Dt-qe/2<0?-1:1),rr=Math.max(gr,Math.floor(Jr-Dt*Pt/qe+vt)),ar=Math.min(rn,Math.floor(Jr+(qe-Dt)*Pt/qe+vt));Se(xr,jt,Jr,rr,ar,jn)}var wr=jt[2*Jr+jn],Cr=gr,an=rn;for(ve(xr,jt,gr,Jr),jt[2*rn+jn]>wr&&ve(xr,jt,gr,rn);Cr<an;){for(ve(xr,jt,Cr,an),Cr++,an--;jt[2*Cr+jn]<wr;)Cr++;for(;jt[2*an+jn]>wr;)an--}jt[2*gr+jn]===wr?ve(xr,jt,gr,an):(an++,ve(xr,jt,an,rn)),an<=Jr&&(gr=an+1),Jr<=an&&(rn=an-1)}}function ve(xr,jt,Jr,gr){Ze(xr,Jr,gr),Ze(jt,2*Jr,2*gr),Ze(jt,2*Jr+1,2*gr+1)}function Ze(xr,jt,Jr){var gr=xr[jt];xr[jt]=xr[Jr],xr[Jr]=gr}function M(xr,jt,Jr,gr,rn,jn,qe){for(var Dt=[0,xr.length-1,0],$e=[],Pt,vt;Dt.length;){var rr=Dt.pop(),ar=Dt.pop(),wr=Dt.pop();if(ar-wr<=qe){for(var Cr=wr;Cr<=ar;Cr++)Pt=jt[2*Cr],vt=jt[2*Cr+1],Pt>=Jr&&Pt<=rn&&vt>=gr&&vt<=jn&&$e.push(xr[Cr]);continue}var an=Math.floor((wr+ar)/2);Pt=jt[2*an],vt=jt[2*an+1],Pt>=Jr&&Pt<=rn&&vt>=gr&&vt<=jn&&$e.push(xr[an]);var yi=(rr+1)%2;(rr===0?Jr<=Pt:gr<=vt)&&(Dt.push(wr),Dt.push(an-1),Dt.push(yi)),(rr===0?rn>=Pt:jn>=vt)&&(Dt.push(an+1),Dt.push(ar),Dt.push(yi))}return $e}function R(xr,jt,Jr,gr,rn,jn){for(var qe=[0,xr.length-1,0],Dt=[],$e=rn*rn;qe.length;){var Pt=qe.pop(),vt=qe.pop(),rr=qe.pop();if(vt-rr<=jn){for(var ar=rr;ar<=vt;ar++)de(jt[2*ar],jt[2*ar+1],Jr,gr)<=$e&&Dt.push(xr[ar]);continue}var wr=Math.floor((rr+vt)/2),Cr=jt[2*wr],an=jt[2*wr+1];de(Cr,an,Jr,gr)<=$e&&Dt.push(xr[wr]);var yi=(Pt+1)%2;(Pt===0?Jr-rn<=Cr:gr-rn<=an)&&(qe.push(rr),qe.push(wr-1),qe.push(yi)),(Pt===0?Jr+rn>=Cr:gr+rn>=an)&&(qe.push(wr+1),qe.push(vt),qe.push(yi))}return Dt}function de(xr,jt,Jr,gr){var rn=xr-Jr,jn=jt-gr;return rn*rn+jn*jn}var be=function(xr){return xr[0]},Le=function(xr){return xr[1]},Re=function(jt,Jr,gr,rn,jn){Jr===void 0&&(Jr=be),gr===void 0&&(gr=Le),rn===void 0&&(rn=64),jn===void 0&&(jn=Float64Array),this.nodeSize=rn,this.points=jt;for(var qe=jt.length<65536?Uint16Array:Uint32Array,Dt=this.ids=new qe(jt.length),$e=this.coords=new jn(jt.length*2),Pt=0;Pt<jt.length;Pt++)Dt[Pt]=Pt,$e[2*Pt]=Jr(jt[Pt]),$e[2*Pt+1]=gr(jt[Pt]);_r(Dt,$e,rn,0,Dt.length-1,0)};Re.prototype.range=function(jt,Jr,gr,rn){return M(this.ids,this.coords,jt,Jr,gr,rn,this.nodeSize)},Re.prototype.within=function(jt,Jr,gr){return R(this.ids,this.coords,jt,Jr,gr,this.nodeSize)};var Ce={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(xr){return xr}},He=Math.fround||function(xr){return function(jt){return xr[0]=+jt,xr[0]}}(new Float32Array(1)),Xe=function(jt){this.options=Jn(Object.create(Ce),jt),this.trees=new Array(this.options.maxZoom+1)};Xe.prototype.load=function(jt){var Jr=this.options,gr=Jr.log,rn=Jr.minZoom,jn=Jr.maxZoom,qe=Jr.nodeSize;gr&&console.time("total time");var Dt="prepare "+jt.length+" points";gr&&console.time(Dt),this.points=jt;for(var $e=[],Pt=0;Pt<jt.length;Pt++)jt[Pt].geometry&&$e.push(Ve(jt[Pt],Pt));this.trees[jn+1]=new Re($e,ki,pa,qe,Float32Array),gr&&console.timeEnd(Dt);for(var vt=jn;vt>=rn;vt--){var rr=+Date.now();$e=this._cluster($e,vt),this.trees[vt]=new Re($e,ki,pa,qe,Float32Array),gr&&console.log("z%d: %d clusters in %dms",vt,$e.length,+Date.now()-rr)}return gr&&console.timeEnd("total time"),this},Xe.prototype.getClusters=function(jt,Jr){var gr=((jt[0]+180)%360+360)%360-180,rn=Math.max(-90,Math.min(90,jt[1])),jn=jt[2]===180?180:((jt[2]+180)%360+360)%360-180,qe=Math.max(-90,Math.min(90,jt[3]));if(jt[2]-jt[0]>=360)gr=-180,jn=180;else if(gr>jn){var Dt=this.getClusters([gr,rn,180,qe],Jr),$e=this.getClusters([-180,rn,jn,qe],Jr);return Dt.concat($e)}for(var Pt=this.trees[this._limitZoom(Jr)],vt=Pt.range(fr(gr),Ar(qe),fr(jn),Ar(rn)),rr=[],ar=0,wr=vt;ar<wr.length;ar+=1){var Cr=wr[ar],an=Pt.points[Cr];rr.push(an.numPoints?et(an):this.points[an.index])}return rr},Xe.prototype.getChildren=function(jt){var Jr=this._getOriginId(jt),gr=this._getOriginZoom(jt),rn="No cluster with the specified id.",jn=this.trees[gr];if(!jn)throw new Error(rn);var qe=jn.points[Jr];if(!qe)throw new Error(rn);for(var Dt=this.options.radius/(this.options.extent*Math.pow(2,gr-1)),$e=jn.within(qe.x,qe.y,Dt),Pt=[],vt=0,rr=$e;vt<rr.length;vt+=1){var ar=rr[vt],wr=jn.points[ar];wr.parentId===jt&&Pt.push(wr.numPoints?et(wr):this.points[wr.index])}if(Pt.length===0)throw new Error(rn);return Pt},Xe.prototype.getLeaves=function(jt,Jr,gr){Jr=Jr||10,gr=gr||0;var rn=[];return this._appendLeaves(rn,jt,Jr,gr,0),rn},Xe.prototype.getTile=function(jt,Jr,gr){var rn=this.trees[this._limitZoom(jt)],jn=Math.pow(2,jt),qe=this.options,Dt=qe.extent,$e=qe.radius,Pt=$e/Dt,vt=(gr-Pt)/jn,rr=(gr+1+Pt)/jn,ar={features:[]};return this._addTileFeatures(rn.range((Jr-Pt)/jn,vt,(Jr+1+Pt)/jn,rr),rn.points,Jr,gr,jn,ar),Jr===0&&this._addTileFeatures(rn.range(1-Pt/jn,vt,1,rr),rn.points,jn,gr,jn,ar),Jr===jn-1&&this._addTileFeatures(rn.range(0,vt,Pt/jn,rr),rn.points,-1,gr,jn,ar),ar.features.length?ar:null},Xe.prototype.getClusterExpansionZoom=function(jt){for(var Jr=this._getOriginZoom(jt)-1;Jr<=this.options.maxZoom;){var gr=this.getChildren(jt);if(Jr++,gr.length!==1)break;jt=gr[0].properties.cluster_id}return Jr},Xe.prototype._appendLeaves=function(jt,Jr,gr,rn,jn){for(var qe=this.getChildren(Jr),Dt=0,$e=qe;Dt<$e.length;Dt+=1){var Pt=$e[Dt],vt=Pt.properties;if(vt&&vt.cluster?jn+vt.point_count<=rn?jn+=vt.point_count:jn=this._appendLeaves(jt,vt.cluster_id,gr,rn,jn):jn<rn?jn++:jt.push(Pt),jt.length===gr)break}return jn},Xe.prototype._addTileFeatures=function(jt,Jr,gr,rn,jn,qe){for(var Dt=0,$e=jt;Dt<$e.length;Dt+=1){var Pt=$e[Dt],vt=Jr[Pt],rr=vt.numPoints,ar=void 0,wr=void 0,Cr=void 0;if(rr)ar=er(vt),wr=vt.x,Cr=vt.y;else{var an=this.points[vt.index];ar=an.properties,wr=fr(an.geometry.coordinates[0]),Cr=Ar(an.geometry.coordinates[1])}var yi={type:1,geometry:[[Math.round(this.options.extent*(wr*jn-gr)),Math.round(this.options.extent*(Cr*jn-rn))]],tags:ar},li=void 0;rr?li=vt.id:this.options.generateId?li=vt.index:this.points[vt.index].id&&(li=this.points[vt.index].id),li!==void 0&&(yi.id=li),qe.features.push(yi)}},Xe.prototype._limitZoom=function(jt){return Math.max(this.options.minZoom,Math.min(Math.floor(+jt),this.options.maxZoom+1))},Xe.prototype._cluster=function(jt,Jr){for(var gr=[],rn=this.options,jn=rn.radius,qe=rn.extent,Dt=rn.reduce,$e=rn.minPoints,Pt=jn/(qe*Math.pow(2,Jr)),vt=0;vt<jt.length;vt++){var rr=jt[vt];if(!(rr.zoom<=Jr)){rr.zoom=Jr;for(var ar=this.trees[Jr+1],wr=ar.within(rr.x,rr.y,Pt),Cr=rr.numPoints||1,an=Cr,yi=0,li=wr;yi<li.length;yi+=1){var Uo=li[yi],vi=ar.points[Uo];vi.zoom>Jr&&(an+=vi.numPoints||1)}if(an>Cr&&an>=$e){for(var bo=rr.x*Cr,So=rr.y*Cr,Xi=Dt&&Cr>1?this._map(rr,!0):null,Mi=(vt<<5)+(Jr+1)+this.points.length,qo=0,ui=wr;qo<ui.length;qo+=1){var Qi=ui[qo],Vi=ar.points[Qi];if(!(Vi.zoom<=Jr)){Vi.zoom=Jr;var Pi=Vi.numPoints||1;bo+=Vi.x*Pi,So+=Vi.y*Pi,Vi.parentId=Mi,Dt&&(Xi||(Xi=this._map(rr,!0)),Dt(Xi,this._map(Vi)))}}rr.parentId=Mi,gr.push(Ke(bo/an,So/an,Mi,an,Xi))}else if(gr.push(rr),an>1)for(var ds=0,Ur=wr;ds<Ur.length;ds+=1){var ls=Ur[ds],dr=ar.points[ls];dr.zoom<=Jr||(dr.zoom=Jr,gr.push(dr))}}}return gr},Xe.prototype._getOriginId=function(jt){return jt-this.points.length>>5},Xe.prototype._getOriginZoom=function(jt){return(jt-this.points.length)%32},Xe.prototype._map=function(jt,Jr){if(jt.numPoints)return Jr?Jn({},jt.properties):jt.properties;var gr=this.points[jt.index].properties,rn=this.options.map(gr);return Jr&&rn===gr?Jn({},rn):rn};function Ke(xr,jt,Jr,gr,rn){return{x:He(xr),y:He(jt),zoom:1/0,id:Jr,parentId:-1,numPoints:gr,properties:rn}}function Ve(xr,jt){var Jr=xr.geometry.coordinates,gr=Jr[0],rn=Jr[1];return{x:He(fr(gr)),y:He(Ar(rn)),zoom:1/0,index:jt,parentId:-1}}function et(xr){return{type:"Feature",id:xr.id,properties:er(xr),geometry:{type:"Point",coordinates:[pn(xr.x),Kn(xr.y)]}}}function er(xr){var jt=xr.numPoints,Jr=jt>=1e4?Math.round(jt/1e3)+"k":jt>=1e3?Math.round(jt/100)/10+"k":jt;return Jn(Jn({},xr.properties),{cluster:!0,cluster_id:xr.id,point_count:jt,point_count_abbreviated:Jr})}function fr(xr){return xr/360+.5}function Ar(xr){var jt=Math.sin(xr*Math.PI/180),Jr=.5-.25*Math.log((1+jt)/(1-jt))/Math.PI;return Jr<0?0:Jr>1?1:Jr}function pn(xr){return(xr-.5)*360}function Kn(xr){var jt=(180-xr*360)*Math.PI/180;return 360*Math.atan(Math.exp(jt))/Math.PI-90}function Jn(xr,jt){for(var Jr in jt)xr[Jr]=jt[Jr];return xr}function ki(xr){return xr.x}function pa(xr){return xr.y}return Xe})},68974:function(Zr){(function(_r,Se){Zr.exports=Se()})(this,function(){"use strict";var _r,Se,ve;function Ze(R,de){if(!_r)_r=de;else if(!Se)Se=de;else{var be="var sharedChunk = {}; ("+_r+")(sharedChunk); ("+Se+")(sharedChunk);",Le={};_r(Le),ve=de(Le),typeof window!="undefined"&&(ve.workerUrl=window.URL.createObjectURL(new Blob([be],{type:"text/javascript"})))}}Ze(["exports"],function(R){"use strict";function de(c,o,f,E){return new(f||(f=Promise))(function(L,V){function X(me){try{oe(E.next(me))}catch(Me){V(Me)}}function J(me){try{oe(E.throw(me))}catch(Me){V(Me)}}function oe(me){var Me;me.done?L(me.value):(Me=me.value,Me instanceof f?Me:new f(function(De){De(Me)})).then(X,J)}oe((E=E.apply(c,o||[])).next())})}function be(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}typeof SuppressedError=="function"&&SuppressedError;var Le=Re;function Re(c,o){this.x=c,this.y=o}Re.prototype={clone:function(){return new Re(this.x,this.y)},add:function(c){return this.clone()._add(c)},sub:function(c){return this.clone()._sub(c)},multByPoint:function(c){return this.clone()._multByPoint(c)},divByPoint:function(c){return this.clone()._divByPoint(c)},mult:function(c){return this.clone()._mult(c)},div:function(c){return this.clone()._div(c)},rotate:function(c){return this.clone()._rotate(c)},rotateAround:function(c,o){return this.clone()._rotateAround(c,o)},matMult:function(c){return this.clone()._matMult(c)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(c){return this.x===c.x&&this.y===c.y},dist:function(c){return Math.sqrt(this.distSqr(c))},distSqr:function(c){var o=c.x-this.x,f=c.y-this.y;return o*o+f*f},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(c){return Math.atan2(this.y-c.y,this.x-c.x)},angleWith:function(c){return this.angleWithSep(c.x,c.y)},angleWithSep:function(c,o){return Math.atan2(this.x*o-this.y*c,this.x*c+this.y*o)},_matMult:function(c){var o=c[2]*this.x+c[3]*this.y;return this.x=c[0]*this.x+c[1]*this.y,this.y=o,this},_add:function(c){return this.x+=c.x,this.y+=c.y,this},_sub:function(c){return this.x-=c.x,this.y-=c.y,this},_mult:function(c){return this.x*=c,this.y*=c,this},_div:function(c){return this.x/=c,this.y/=c,this},_multByPoint:function(c){return this.x*=c.x,this.y*=c.y,this},_divByPoint:function(c){return this.x/=c.x,this.y/=c.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var c=this.y;return this.y=this.x,this.x=-c,this},_rotate:function(c){var o=Math.cos(c),f=Math.sin(c),E=f*this.x+o*this.y;return this.x=o*this.x-f*this.y,this.y=E,this},_rotateAround:function(c,o){var f=Math.cos(c),E=Math.sin(c),L=o.y+E*(this.x-o.x)+f*(this.y-o.y);return this.x=o.x+f*(this.x-o.x)-E*(this.y-o.y),this.y=L,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Re.convert=function(c){return c instanceof Re?c:Array.isArray(c)?new Re(c[0],c[1]):c};var Ce=be(Le),He=Xe;function Xe(c,o,f,E){this.cx=3*c,this.bx=3*(f-c)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*o,this.by=3*(E-o)-this.cy,this.ay=1-this.cy-this.by,this.p1x=c,this.p1y=o,this.p2x=f,this.p2y=E}Xe.prototype={sampleCurveX:function(c){return((this.ax*c+this.bx)*c+this.cx)*c},sampleCurveY:function(c){return((this.ay*c+this.by)*c+this.cy)*c},sampleCurveDerivativeX:function(c){return(3*this.ax*c+2*this.bx)*c+this.cx},solveCurveX:function(c,o){if(o===void 0&&(o=1e-6),c<0)return 0;if(c>1)return 1;for(var f=c,E=0;E<8;E++){var L=this.sampleCurveX(f)-c;if(Math.abs(L)<o)return f;var V=this.sampleCurveDerivativeX(f);if(Math.abs(V)<1e-6)break;f-=L/V}var X=0,J=1;for(f=c,E=0;E<20&&(L=this.sampleCurveX(f),!(Math.abs(L-c)<o));E++)c>L?X=f:J=f,f=.5*(J-X)+X;return f},solve:function(c,o){return this.sampleCurveY(this.solveCurveX(c,o))}};var Ke=be(He);let Ve,et;function er(){return Ve==null&&(Ve=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Ve}function fr(){if(et==null&&(et=!1,er())){const o=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(o){for(let E=0;E<5*5;E++){const L=4*E;o.fillStyle=`rgb(${L},${L+1},${L+2})`,o.fillRect(E%5,Math.floor(E/5),1,1)}const f=o.getImageData(0,0,5,5).data;for(let E=0;E<5*5*4;E++)if(E%4!=3&&f[E]!==E){et=!0;break}}}return et||!1}function Ar(c,o,f,E){const L=new Ke(c,o,f,E);return function(V){return L.solve(V)}}const pn=Ar(.25,.1,.25,1);function Kn(c,o,f){return Math.min(f,Math.max(o,c))}function Jn(c,o,f){const E=f-o,L=((c-o)%E+E)%E+o;return L===o?f:L}function ki(c,...o){for(const f of o)for(const E in f)c[E]=f[E];return c}let pa=1;function xr(c,o,f){const E={};for(const L in c)E[L]=o.call(f||this,c[L],L,c);return E}function jt(c,o,f){const E={};for(const L in c)o.call(f||this,c[L],L,c)&&(E[L]=c[L]);return E}function Jr(c){return Array.isArray(c)?c.map(Jr):typeof c=="object"&&c?xr(c,Jr):c}const gr={};function rn(c){gr[c]||(typeof console!="undefined"&&console.warn(c),gr[c]=!0)}function jn(c,o,f){return(f.y-c.y)*(o.x-c.x)>(o.y-c.y)*(f.x-c.x)}function qe(c){let o=0;for(let f,E,L=0,V=c.length,X=V-1;L<V;X=L++)f=c[L],E=c[X],o+=(E.x-f.x)*(f.y+E.y);return o}function Dt(){return typeof WorkerGlobalScope!="undefined"&&typeof self!="undefined"&&self instanceof WorkerGlobalScope}let $e=null;function Pt(c){return typeof ImageBitmap!="undefined"&&c instanceof ImageBitmap}const vt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function rr(c,o,f,E,L){return de(this,void 0,void 0,function*(){if(typeof VideoFrame=="undefined")throw new Error("VideoFrame not supported");const V=new VideoFrame(c,{timestamp:0});try{const X=V==null?void 0:V.format;if(!X||!X.startsWith("BGR")&&!X.startsWith("RGB"))throw new Error(`Unrecognized format ${X}`);const J=X.startsWith("BGR"),oe=new Uint8ClampedArray(E*L*4);if(yield V.copyTo(oe,function(me,Me,De,Ye,ot){const lt=4*Math.max(-Me,0),Ct=(Math.max(0,De)-De)*Ye*4+lt,Gt=4*Ye,Kt=Math.max(0,Me),Er=Math.max(0,De);return{rect:{x:Kt,y:Er,width:Math.min(me.width,Me+Ye)-Kt,height:Math.min(me.height,De+ot)-Er},layout:[{offset:Ct,stride:Gt}]}}(c,o,f,E,L)),J)for(let me=0;me<oe.length;me+=4){const Me=oe[me];oe[me]=oe[me+2],oe[me+2]=Me}return oe}finally{V.close()}})}let ar,wr,Cr,an;const yi={now:typeof performance!="undefined"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(c){const o=requestAnimationFrame(c);return{cancel:()=>cancelAnimationFrame(o)}},getImageData(c,o=0){return this.getImageCanvasContext(c).getImageData(-o,-o,c.width+2*o,c.height+2*o)},getImageCanvasContext(c){const o=window.document.createElement("canvas"),f=o.getContext("2d",{willReadFrequently:!0});if(!f)throw new Error("failed to create canvas 2d context");return o.width=c.width,o.height=c.height,f.drawImage(c,0,0,c.width,c.height),f},resolveURL:c=>(Cr||(Cr=document.createElement("a")),Cr.href=c,Cr.href),hardwareConcurrency:typeof navigator!="undefined"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(an==null&&(an=matchMedia("(prefers-reduced-motion: reduce)")),an.matches)}},li={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class Uo extends Error{constructor(o,f,E,L){super(`AJAXError: ${f} (${o}): ${E}`),this.status=o,this.statusText=f,this.url=E,this.body=L}}const vi=Dt()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,bo=c=>li.REGISTERED_PROTOCOLS[c.substring(0,c.indexOf("://"))];function So(c,o){const f=new AbortController,E=new Request(c.url,{method:c.method||"GET",body:c.body,credentials:c.credentials,headers:c.headers,cache:c.cache,referrer:vi(),signal:f.signal});let L=!1,V=!1;return c.type==="json"&&E.headers.set("Accept","application/json"),V||fetch(E).then(X=>X.ok?(J=>{(c.type==="arrayBuffer"||c.type==="image"?J.arrayBuffer():c.type==="json"?J.json():J.text()).then(oe=>{V||(L=!0,o(null,oe,J.headers.get("Cache-Control"),J.headers.get("Expires")))}).catch(oe=>{V||o(new Error(oe.message))})})(X):X.blob().then(J=>o(new Uo(X.status,X.statusText,c.url,J)))).catch(X=>{X.code!==20&&o(new Error(X.message))}),{cancel:()=>{V=!0,L||f.abort()}}}const Xi=function(c,o){if(/:\/\//.test(c.url)&&!/^https?:|^file:/.test(c.url)){if(Dt()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",c,o);if(!Dt())return(bo(c.url)||So)(c,o)}if(!(/^file:/.test(f=c.url)||/^file:/.test(vi())&&!/^\w+:/.test(f))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return So(c,o);if(Dt()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",c,o,void 0,!0)}var f;return function(E,L){const V=new XMLHttpRequest;V.open(E.method||"GET",E.url,!0),E.type!=="arrayBuffer"&&E.type!=="image"||(V.responseType="arraybuffer");for(const X in E.headers)V.setRequestHeader(X,E.headers[X]);return E.type==="json"&&(V.responseType="text",V.setRequestHeader("Accept","application/json")),V.withCredentials=E.credentials==="include",V.onerror=()=>{L(new Error(V.statusText))},V.onload=()=>{if((V.status>=200&&V.status<300||V.status===0)&&V.response!==null){let X=V.response;if(E.type==="json")try{X=JSON.parse(V.response)}catch(J){return L(J)}L(null,X,V.getResponseHeader("Cache-Control"),V.getResponseHeader("Expires"))}else{const X=new Blob([V.response],{type:V.getResponseHeader("Content-Type")});L(new Uo(V.status,V.statusText,E.url,X))}},V.send(E.body),{cancel:()=>V.abort()}}(c,o)},Mi=function(c,o){return Xi(ki(c,{type:"arrayBuffer"}),o)};function qo(c){if(!c||c.indexOf("://")<=0||c.indexOf("data:image/")===0||c.indexOf("blob:")===0)return!0;const o=new URL(c),f=window.location;return o.protocol===f.protocol&&o.host===f.host}function ui(c,o,f){f[c]&&f[c].indexOf(o)!==-1||(f[c]=f[c]||[],f[c].push(o))}function Qi(c,o,f){if(f&&f[c]){const E=f[c].indexOf(o);E!==-1&&f[c].splice(E,1)}}class Vi{constructor(o,f={}){ki(this,f),this.type=o}}class Pi extends Vi{constructor(o,f={}){super("error",ki({error:o},f))}}class ds{on(o,f){return this._listeners=this._listeners||{},ui(o,f,this._listeners),this}off(o,f){return Qi(o,f,this._listeners),Qi(o,f,this._oneTimeListeners),this}once(o,f){return f?(this._oneTimeListeners=this._oneTimeListeners||{},ui(o,f,this._oneTimeListeners),this):new Promise(E=>this.once(o,E))}fire(o,f){typeof o=="string"&&(o=new Vi(o,f||{}));const E=o.type;if(this.listens(E)){o.target=this;const L=this._listeners&&this._listeners[E]?this._listeners[E].slice():[];for(const J of L)J.call(this,o);const V=this._oneTimeListeners&&this._oneTimeListeners[E]?this._oneTimeListeners[E].slice():[];for(const J of V)Qi(E,J,this._oneTimeListeners),J.call(this,o);const X=this._eventedParent;X&&(ki(o,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),X.fire(o))}else o instanceof Pi&&console.error(o.error);return this}listens(o){return this._listeners&&this._listeners[o]&&this._listeners[o].length>0||this._oneTimeListeners&&this._oneTimeListeners[o]&&this._oneTimeListeners[o].length>0||this._eventedParent&&this._eventedParent.listens(o)}setEventedParent(o,f){return this._eventedParent=o,this._eventedParentData=f,this}}var Ur={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const ls=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function dr(c,o){const f={};for(const E in c)E!=="ref"&&(f[E]=c[E]);return ls.forEach(E=>{E in o&&(f[E]=o[E])}),f}function he(c,o){if(Array.isArray(c)){if(!Array.isArray(o)||c.length!==o.length)return!1;for(let f=0;f<c.length;f++)if(!he(c[f],o[f]))return!1;return!0}if(typeof c=="object"&&c!==null&&o!==null){if(typeof o!="object"||Object.keys(c).length!==Object.keys(o).length)return!1;for(const f in c)if(!he(c[f],o[f]))return!1;return!0}return c===o}const We={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function at(c,o,f){f.push({command:We.addSource,args:[c,o[c]]})}function Ot(c,o,f){o.push({command:We.removeSource,args:[c]}),f[c]=!0}function or(c,o,f,E){Ot(c,f,E),at(c,o,f)}function Wr(c,o,f){let E;for(E in c[f])if(Object.prototype.hasOwnProperty.call(c[f],E)&&E!=="data"&&!he(c[f][E],o[f][E]))return!1;for(E in o[f])if(Object.prototype.hasOwnProperty.call(o[f],E)&&E!=="data"&&!he(c[f][E],o[f][E]))return!1;return!0}function In(c,o,f,E,L,V){let X;for(X in o=o||{},c=c||{})Object.prototype.hasOwnProperty.call(c,X)&&(he(c[X],o[X])||f.push({command:V,args:[E,X,o[X],L]}));for(X in o)Object.prototype.hasOwnProperty.call(o,X)&&!Object.prototype.hasOwnProperty.call(c,X)&&(he(c[X],o[X])||f.push({command:V,args:[E,X,o[X],L]}))}function kn(c){return c.id}function eo(c,o){return c[o.id]=o,c}class un{constructor(o,f,E,L){this.message=(o?`${o}: `:"")+E,L&&(this.identifier=L),f!=null&&f.__line__&&(this.line=f.__line__)}}function To(c,...o){for(const f of o)for(const E in f)c[E]=f[E];return c}class Ti extends Error{constructor(o,f){super(f),this.message=f,this.key=o}}class Lo{constructor(o,f=[]){this.parent=o,this.bindings={};for(const[E,L]of f)this.bindings[E]=L}concat(o){return new Lo(this,o)}get(o){if(this.bindings[o])return this.bindings[o];if(this.parent)return this.parent.get(o);throw new Error(`${o} not found in scope.`)}has(o){return!!this.bindings[o]||!!this.parent&&this.parent.has(o)}}const wa={kind:"null"},dn={kind:"number"},co={kind:"string"},no={kind:"boolean"},Za={kind:"color"},ms={kind:"object"},Ji={kind:"value"},Us={kind:"collator"},Lt={kind:"formatted"},Ne={kind:"padding"},re={kind:"resolvedImage"},le={kind:"variableAnchorOffsetCollection"};function ge(c,o){return{kind:"array",itemType:c,N:o}}function ye(c){if(c.kind==="array"){const o=ye(c.itemType);return typeof c.N=="number"?`array<${o}, ${c.N}>`:c.itemType.kind==="value"?"array":`array<${o}>`}return c.kind}const ze=[wa,dn,co,no,Za,Lt,ms,ge(Ji),Ne,re,le];function je(c,o){if(o.kind==="error")return null;if(c.kind==="array"){if(o.kind==="array"&&(o.N===0&&o.itemType.kind==="value"||!je(c.itemType,o.itemType))&&(typeof c.N!="number"||c.N===o.N))return null}else{if(c.kind===o.kind)return null;if(c.kind==="value"){for(const f of ze)if(!je(f,o))return null}}return`Expected ${ye(c)} but found ${ye(o)} instead.`}function Ue(c,o){return o.some(f=>f.kind===c.kind)}function Ae(c,o){return o.some(f=>f==="null"?c===null:f==="array"?Array.isArray(c):f==="object"?c&&!Array.isArray(c)&&typeof c=="object":f===typeof c)}function Je(c,o){return c.kind==="array"&&o.kind==="array"?c.itemType.kind===o.itemType.kind&&typeof c.N=="number":c.kind===o.kind}const wt=.96422,Ht=.82521,Fr=4/29,mr=6/29,Sr=3*mr*mr,fn=mr*mr*mr,xn=Math.PI/180,Lr=180/Math.PI;function Nn(c){return(c%=360)<0&&(c+=360),c}function bn([c,o,f,E]){let L,V;const X=io((.2225045*(c=En(c))+.7168786*(o=En(o))+.0606169*(f=En(f)))/1);c===o&&o===f?L=V=X:(L=io((.4360747*c+.3850649*o+.1430804*f)/wt),V=io((.0139322*c+.0971045*o+.7141733*f)/Ht));const J=116*X-16;return[J<0?0:J,500*(L-X),200*(X-V),E]}function En(c){return c<=.04045?c/12.92:Math.pow((c+.055)/1.055,2.4)}function io(c){return c>fn?Math.pow(c,1/3):c/Sr+Fr}function On([c,o,f,E]){let L=(c+16)/116,V=isNaN(o)?L:L+o/500,X=isNaN(f)?L:L-f/200;return L=1*ia(L),V=wt*ia(V),X=Ht*ia(X),[Ao(3.1338561*V-1.6168667*L-.4906146*X),Ao(-.9787684*V+1.9161415*L+.033454*X),Ao(.0719453*V-.2289914*L+1.4052427*X),E]}function Ao(c){return(c=c<=.00304?12.92*c:1.055*Math.pow(c,1/2.4)-.055)<0?0:c>1?1:c}function ia(c){return c>mr?c*c*c:Sr*(c-Fr)}function Ho(c){return parseInt(c.padEnd(2,c),16)/255}function Ga(c,o){return Wo(o?c/100:c,0,1)}function Wo(c,o,f){return Math.min(Math.max(o,c),f)}function Hl(c){return!c.some(Number.isNaN)}const ns={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Yo{constructor(o,f,E,L=1,V=!0){this.r=o,this.g=f,this.b=E,this.a=L,V||(this.r*=L,this.g*=L,this.b*=L,L||this.overwriteGetter("rgb",[o,f,E,L]))}static parse(o){if(o instanceof Yo)return o;if(typeof o!="string")return;const f=function(E){if((E=E.toLowerCase().trim())==="transparent")return[0,0,0,0];const L=ns[E];if(L){const[X,J,oe]=L;return[X/255,J/255,oe/255,1]}if(E.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(E)){const X=E.length<6?1:2;let J=1;return[Ho(E.slice(J,J+=X)),Ho(E.slice(J,J+=X)),Ho(E.slice(J,J+=X)),Ho(E.slice(J,J+X)||"ff")]}if(E.startsWith("rgb")){const X=E.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(X){const[J,oe,me,Me,De,Ye,ot,lt,Ct,Gt,Kt,Er]=X,cr=[Me||" ",ot||" ",Gt].join("");if(cr===" "||cr===" /"||cr===",,"||cr===",,,"){const Rr=[me,Ye,Ct].join(""),Qr=Rr==="%%%"?100:Rr===""?255:0;if(Qr){const Fn=[Wo(+oe/Qr,0,1),Wo(+De/Qr,0,1),Wo(+lt/Qr,0,1),Kt?Ga(+Kt,Er):1];if(Hl(Fn))return Fn}}return}}const V=E.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(V){const[X,J,oe,me,Me,De,Ye,ot,lt]=V,Ct=[oe||" ",Me||" ",Ye].join("");if(Ct===" "||Ct===" /"||Ct===",,"||Ct===",,,"){const Gt=[+J,Wo(+me,0,100),Wo(+De,0,100),ot?Ga(+ot,lt):1];if(Hl(Gt))return function([Kt,Er,cr,Rr]){function Qr(Fn){const Ki=(Fn+Kt/30)%12,Co=Er*Math.min(cr,1-cr);return cr-Co*Math.max(-1,Math.min(Ki-3,9-Ki,1))}return Kt=Nn(Kt),Er/=100,cr/=100,[Qr(0),Qr(8),Qr(4),Rr]}(Gt)}}}(o);return f?new Yo(...f,!1):void 0}get rgb(){const{r:o,g:f,b:E,a:L}=this,V=L||1/0;return this.overwriteGetter("rgb",[o/V,f/V,E/V,L])}get hcl(){return this.overwriteGetter("hcl",function(o){const[f,E,L,V]=bn(o),X=Math.sqrt(E*E+L*L);return[Math.round(1e4*X)?Nn(Math.atan2(L,E)*Lr):NaN,X,f,V]}(this.rgb))}get lab(){return this.overwriteGetter("lab",bn(this.rgb))}overwriteGetter(o,f){return Object.defineProperty(this,o,{value:f}),f}toString(){const[o,f,E,L]=this.rgb;return`rgba(${[o,f,E].map(V=>Math.round(255*V)).join(",")},${L})`}}Yo.black=new Yo(0,0,0,1),Yo.white=new Yo(1,1,1,1),Yo.transparent=new Yo(0,0,0,0),Yo.red=new Yo(1,0,0,1);class _a{constructor(o,f,E){this.sensitivity=o?f?"variant":"case":f?"accent":"base",this.locale=E,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(o,f){return this.collator.compare(o,f)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class $o{constructor(o,f,E,L,V){this.text=o,this.image=f,this.scale=E,this.fontStack=L,this.textColor=V}}class Fo{constructor(o){this.sections=o}static fromString(o){return new Fo([new $o(o,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(o=>o.text.length!==0||o.image&&o.image.name.length!==0)}static factory(o){return o instanceof Fo?o:Fo.fromString(o)}toString(){return this.sections.length===0?"":this.sections.map(o=>o.text).join("")}}class us{constructor(o){this.values=o.slice()}static parse(o){if(o instanceof us)return o;if(typeof o=="number")return new us([o,o,o,o]);if(Array.isArray(o)&&!(o.length<1||o.length>4)){for(const f of o)if(typeof f!="number")return;switch(o.length){case 1:o=[o[0],o[0],o[0],o[0]];break;case 2:o=[o[0],o[1],o[0],o[1]];break;case 3:o=[o[0],o[1],o[2],o[1]]}return new us(o)}}toString(){return JSON.stringify(this.values)}}const xc=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Ba{constructor(o){this.values=o.slice()}static parse(o){if(o instanceof Ba)return o;if(Array.isArray(o)&&!(o.length<1)&&o.length%2==0){for(let f=0;f<o.length;f+=2){const E=o[f],L=o[f+1];if(typeof E!="string"||!xc.has(E)||!Array.isArray(L)||L.length!==2||typeof L[0]!="number"||typeof L[1]!="number")return}return new Ba(o)}}toString(){return JSON.stringify(this.values)}}class Fa{constructor(o){this.name=o.name,this.available=o.available}toString(){return this.name}static fromString(o){return o?new Fa({name:o,available:!1}):null}}function sc(c,o,f,E){return typeof c=="number"&&c>=0&&c<=255&&typeof o=="number"&&o>=0&&o<=255&&typeof f=="number"&&f>=0&&f<=255?E===void 0||typeof E=="number"&&E>=0&&E<=1?null:`Invalid rgba value [${[c,o,f,E].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof E=="number"?[c,o,f,E]:[c,o,f]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ql(c){if(c===null||typeof c=="string"||typeof c=="boolean"||typeof c=="number"||c instanceof Yo||c instanceof _a||c instanceof Fo||c instanceof us||c instanceof Ba||c instanceof Fa)return!0;if(Array.isArray(c)){for(const o of c)if(!Ql(o))return!1;return!0}if(typeof c=="object"){for(const o in c)if(!Ql(c[o]))return!1;return!0}return!1}function oa(c){if(c===null)return wa;if(typeof c=="string")return co;if(typeof c=="boolean")return no;if(typeof c=="number")return dn;if(c instanceof Yo)return Za;if(c instanceof _a)return Us;if(c instanceof Fo)return Lt;if(c instanceof us)return Ne;if(c instanceof Ba)return le;if(c instanceof Fa)return re;if(Array.isArray(c)){const o=c.length;let f;for(const E of c){const L=oa(E);if(f){if(f===L)continue;f=Ji;break}f=L}return ge(f||Ji,o)}return ms}function Zo(c){const o=typeof c;return c===null?"":o==="string"||o==="number"||o==="boolean"?String(c):c instanceof Yo||c instanceof Fo||c instanceof us||c instanceof Ba||c instanceof Fa?c.toString():JSON.stringify(c)}class il{constructor(o,f){this.type=o,this.value=f}static parse(o,f){if(o.length!==2)return f.error(`'literal' expression requires exactly one argument, but found ${o.length-1} instead.`);if(!Ql(o[1]))return f.error("invalid value");const E=o[1];let L=oa(E);const V=f.expectedType;return L.kind!=="array"||L.N!==0||!V||V.kind!=="array"||typeof V.N=="number"&&V.N!==0||(L=V),new il(L,E)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class va{constructor(o){this.name="ExpressionEvaluationError",this.message=o}toJSON(){return this.message}}const El={string:co,number:dn,boolean:no,object:ms};class Wa{constructor(o,f){this.type=o,this.args=f}static parse(o,f){if(o.length<2)return f.error("Expected at least one argument.");let E,L=1;const V=o[0];if(V==="array"){let J,oe;if(o.length>2){const me=o[1];if(typeof me!="string"||!(me in El)||me==="object")return f.error('The item type argument of "array" must be one of string, number, boolean',1);J=El[me],L++}else J=Ji;if(o.length>3){if(o[2]!==null&&(typeof o[2]!="number"||o[2]<0||o[2]!==Math.floor(o[2])))return f.error('The length argument to "array" must be a positive integer literal',2);oe=o[2],L++}E=ge(J,oe)}else{if(!El[V])throw new Error(`Types doesn't contain name = ${V}`);E=El[V]}const X=[];for(;L<o.length;L++){const J=f.parse(o[L],L,Ji);if(!J)return null;X.push(J)}return new Wa(E,X)}evaluate(o){for(let f=0;f<this.args.length;f++){const E=this.args[f].evaluate(o);if(!je(this.type,oa(E)))return E;if(f===this.args.length-1)throw new va(`Expected value to be of type ${ye(this.type)}, but found ${ye(oa(E))} instead.`)}throw new Error}eachChild(o){this.args.forEach(o)}outputDefined(){return this.args.every(o=>o.outputDefined())}}const Ds={"to-boolean":no,"to-color":Za,"to-number":dn,"to-string":co};class Rl{constructor(o,f){this.type=o,this.args=f}static parse(o,f){if(o.length<2)return f.error("Expected at least one argument.");const E=o[0];if(!Ds[E])throw new Error(`Can't parse ${E} as it is not part of the known types`);if((E==="to-boolean"||E==="to-string")&&o.length!==2)return f.error("Expected one argument.");const L=Ds[E],V=[];for(let X=1;X<o.length;X++){const J=f.parse(o[X],X,Ji);if(!J)return null;V.push(J)}return new Rl(L,V)}evaluate(o){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(o);case"color":{let f,E;for(const L of this.args){if(f=L.evaluate(o),E=null,f instanceof Yo)return f;if(typeof f=="string"){const V=o.parseColor(f);if(V)return V}else if(Array.isArray(f)&&(E=f.length<3||f.length>4?`Invalid rbga value ${JSON.stringify(f)}: expected an array containing either three or four numeric values.`:sc(f[0],f[1],f[2],f[3]),!E))return new Yo(f[0]/255,f[1]/255,f[2]/255,f[3])}throw new va(E||`Could not parse color from value '${typeof f=="string"?f:JSON.stringify(f)}'`)}case"padding":{let f;for(const E of this.args){f=E.evaluate(o);const L=us.parse(f);if(L)return L}throw new va(`Could not parse padding from value '${typeof f=="string"?f:JSON.stringify(f)}'`)}case"variableAnchorOffsetCollection":{let f;for(const E of this.args){f=E.evaluate(o);const L=Ba.parse(f);if(L)return L}throw new va(`Could not parse variableAnchorOffsetCollection from value '${typeof f=="string"?f:JSON.stringify(f)}'`)}case"number":{let f=null;for(const E of this.args){if(f=E.evaluate(o),f===null)return 0;const L=Number(f);if(!isNaN(L))return L}throw new va(`Could not convert ${JSON.stringify(f)} to number.`)}case"formatted":return Fo.fromString(Zo(this.args[0].evaluate(o)));case"resolvedImage":return Fa.fromString(Zo(this.args[0].evaluate(o)));default:return Zo(this.args[0].evaluate(o))}}eachChild(o){this.args.forEach(o)}outputDefined(){return this.args.every(o=>o.outputDefined())}}const gu=["Unknown","Point","LineString","Polygon"];class gl{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?gu[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(o){let f=this._parseColorCache[o];return f||(f=this._parseColorCache[o]=Yo.parse(o)),f}}class wl{constructor(o,f,E=[],L,V=new Lo,X=[]){this.registry=o,this.path=E,this.key=E.map(J=>`[${J}]`).join(""),this.scope=V,this.errors=X,this.expectedType=L,this._isConstant=f}parse(o,f,E,L,V={}){return f?this.concat(f,E,L)._parse(o,V):this._parse(o,V)}_parse(o,f){function E(L,V,X){return X==="assert"?new Wa(V,[L]):X==="coerce"?new Rl(V,[L]):L}if(o!==null&&typeof o!="string"&&typeof o!="boolean"&&typeof o!="number"||(o=["literal",o]),Array.isArray(o)){if(o.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const L=o[0];if(typeof L!="string")return this.error(`Expression name must be a string, but found ${typeof L} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const V=this.registry[L];if(V){let X=V.parse(o,this);if(!X)return null;if(this.expectedType){const J=this.expectedType,oe=X.type;if(J.kind!=="string"&&J.kind!=="number"&&J.kind!=="boolean"&&J.kind!=="object"&&J.kind!=="array"||oe.kind!=="value")if(J.kind!=="color"&&J.kind!=="formatted"&&J.kind!=="resolvedImage"||oe.kind!=="value"&&oe.kind!=="string")if(J.kind!=="padding"||oe.kind!=="value"&&oe.kind!=="number"&&oe.kind!=="array")if(J.kind!=="variableAnchorOffsetCollection"||oe.kind!=="value"&&oe.kind!=="array"){if(this.checkSubtype(J,oe))return null}else X=E(X,J,f.typeAnnotation||"coerce");else X=E(X,J,f.typeAnnotation||"coerce");else X=E(X,J,f.typeAnnotation||"coerce");else X=E(X,J,f.typeAnnotation||"assert")}if(!(X instanceof il)&&X.type.kind!=="resolvedImage"&&this._isConstant(X)){const J=new gl;try{X=new il(X.type,X.evaluate(J))}catch(oe){return this.error(oe.message),null}}return X}return this.error(`Unknown expression "${L}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(o===void 0?"'undefined' value invalid. Use null instead.":typeof o=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof o} instead.`)}concat(o,f,E){const L=typeof o=="number"?this.path.concat(o):this.path,V=E?this.scope.concat(E):this.scope;return new wl(this.registry,this._isConstant,L,f||null,V,this.errors)}error(o,...f){const E=`${this.key}${f.map(L=>`[${L}]`).join("")}`;this.errors.push(new Ti(E,o))}checkSubtype(o,f){const E=je(o,f);return E&&this.error(E),E}}class ol{constructor(o,f,E){this.type=Us,this.locale=E,this.caseSensitive=o,this.diacriticSensitive=f}static parse(o,f){if(o.length!==2)return f.error("Expected one argument.");const E=o[1];if(typeof E!="object"||Array.isArray(E))return f.error("Collator options argument must be an object.");const L=f.parse(E["case-sensitive"]!==void 0&&E["case-sensitive"],1,no);if(!L)return null;const V=f.parse(E["diacritic-sensitive"]!==void 0&&E["diacritic-sensitive"],1,no);if(!V)return null;let X=null;return E.locale&&(X=f.parse(E.locale,1,co),!X)?null:new ol(L,V,X)}evaluate(o){return new _a(this.caseSensitive.evaluate(o),this.diacriticSensitive.evaluate(o),this.locale?this.locale.evaluate(o):null)}eachChild(o){o(this.caseSensitive),o(this.diacriticSensitive),this.locale&&o(this.locale)}outputDefined(){return!1}}const Qa=8192;function Gl(c,o){c[0]=Math.min(c[0],o[0]),c[1]=Math.min(c[1],o[1]),c[2]=Math.max(c[2],o[0]),c[3]=Math.max(c[3],o[1])}function Wl(c,o){return!(c[0]<=o[0]||c[2]>=o[2]||c[1]<=o[1]||c[3]>=o[3])}function ut(c,o){const f=(180+c[0])/360,E=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c[1]*Math.PI/360)))/360,L=Math.pow(2,o.z);return[Math.round(f*L*Qa),Math.round(E*L*Qa)]}function At(c,o,f){const E=c[0]-o[0],L=c[1]-o[1],V=c[0]-f[0],X=c[1]-f[1];return E*X-V*L==0&&E*V<=0&&L*X<=0}function ir(c,o){let f=!1;for(let X=0,J=o.length;X<J;X++){const oe=o[X];for(let me=0,Me=oe.length;me<Me-1;me++){if(At(c,oe[me],oe[me+1]))return!1;(L=oe[me])[1]>(E=c)[1]!=(V=oe[me+1])[1]>E[1]&&E[0]<(V[0]-L[0])*(E[1]-L[1])/(V[1]-L[1])+L[0]&&(f=!f)}}var E,L,V;return f}function jr(c,o){for(let f=0;f<o.length;f++)if(ir(c,o[f]))return!0;return!1}function Dn(c,o,f,E){const L=E[0]-f[0],V=E[1]-f[1],X=(c[0]-f[0])*V-L*(c[1]-f[1]),J=(o[0]-f[0])*V-L*(o[1]-f[1]);return X>0&&J<0||X<0&&J>0}function oo(c,o,f){for(const me of f)for(let Me=0;Me<me.length-1;++Me)if((J=[(X=me[Me+1])[0]-(V=me[Me])[0],X[1]-V[1]])[0]*(oe=[(L=o)[0]-(E=c)[0],L[1]-E[1]])[1]-J[1]*oe[0]!=0&&Dn(E,L,V,X)&&Dn(V,X,E,L))return!0;var E,L,V,X,J,oe;return!1}function Xa(c,o){for(let f=0;f<c.length;++f)if(!ir(c[f],o))return!1;for(let f=0;f<c.length-1;++f)if(oo(c[f],c[f+1],o))return!1;return!0}function mn(c,o){for(let f=0;f<o.length;f++)if(Xa(c,o[f]))return!0;return!1}function kl(c,o,f){const E=[];for(let L=0;L<c.length;L++){const V=[];for(let X=0;X<c[L].length;X++){const J=ut(c[L][X],f);Gl(o,J),V.push(J)}E.push(V)}return E}function Il(c,o,f){const E=[];for(let L=0;L<c.length;L++){const V=kl(c[L],o,f);E.push(V)}return E}function Ia(c,o,f,E){if(c[0]<f[0]||c[0]>f[2]){const L=.5*E;let V=c[0]-f[0]>L?-E:f[0]-c[0]>L?E:0;V===0&&(V=c[0]-f[2]>L?-E:f[2]-c[0]>L?E:0),c[0]+=V}Gl(o,c)}function Xh(c,o,f,E){const L=Math.pow(2,E.z)*Qa,V=[E.x*Qa,E.y*Qa],X=[];for(const J of c)for(const oe of J){const me=[oe.x+V[0],oe.y+V[1]];Ia(me,o,f,L),X.push(me)}return X}function Sl(c,o,f,E){const L=Math.pow(2,E.z)*Qa,V=[E.x*Qa,E.y*Qa],X=[];for(const oe of c){const me=[];for(const Me of oe){const De=[Me.x+V[0],Me.y+V[1]];Gl(o,De),me.push(De)}X.push(me)}if(o[2]-o[0]<=L/2){(J=o)[0]=J[1]=1/0,J[2]=J[3]=-1/0;for(const oe of X)for(const me of oe)Ia(me,o,f,L)}var J;return X}class Va{constructor(o,f){this.type=no,this.geojson=o,this.geometries=f}static parse(o,f){if(o.length!==2)return f.error(`'within' expression requires exactly one argument, but found ${o.length-1} instead.`);if(Ql(o[1])){const E=o[1];if(E.type==="FeatureCollection")for(let L=0;L<E.features.length;++L){const V=E.features[L].geometry.type;if(V==="Polygon"||V==="MultiPolygon")return new Va(E,E.features[L].geometry)}else if(E.type==="Feature"){const L=E.geometry.type;if(L==="Polygon"||L==="MultiPolygon")return new Va(E,E.geometry)}else if(E.type==="Polygon"||E.type==="MultiPolygon")return new Va(E,E)}return f.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(o){if(o.geometry()!=null&&o.canonicalID()!=null){if(o.geometryType()==="Point")return function(f,E){const L=[1/0,1/0,-1/0,-1/0],V=[1/0,1/0,-1/0,-1/0],X=f.canonicalID();if(E.type==="Polygon"){const J=kl(E.coordinates,V,X),oe=Xh(f.geometry(),L,V,X);if(!Wl(L,V))return!1;for(const me of oe)if(!ir(me,J))return!1}if(E.type==="MultiPolygon"){const J=Il(E.coordinates,V,X),oe=Xh(f.geometry(),L,V,X);if(!Wl(L,V))return!1;for(const me of oe)if(!jr(me,J))return!1}return!0}(o,this.geometries);if(o.geometryType()==="LineString")return function(f,E){const L=[1/0,1/0,-1/0,-1/0],V=[1/0,1/0,-1/0,-1/0],X=f.canonicalID();if(E.type==="Polygon"){const J=kl(E.coordinates,V,X),oe=Sl(f.geometry(),L,V,X);if(!Wl(L,V))return!1;for(const me of oe)if(!Xa(me,J))return!1}if(E.type==="MultiPolygon"){const J=Il(E.coordinates,V,X),oe=Sl(f.geometry(),L,V,X);if(!Wl(L,V))return!1;for(const me of oe)if(!mn(me,J))return!1}return!0}(o,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class Aa{constructor(o,f){this.type=f.type,this.name=o,this.boundExpression=f}static parse(o,f){if(o.length!==2||typeof o[1]!="string")return f.error("'var' expression requires exactly one string literal argument.");const E=o[1];return f.scope.has(E)?new Aa(E,f.scope.get(E)):f.error(`Unknown variable "${E}". Make sure "${E}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(o){return this.boundExpression.evaluate(o)}eachChild(){}outputDefined(){return!1}}class Ni{constructor(o,f,E,L){this.name=o,this.type=f,this._evaluate=E,this.args=L}evaluate(o){return this._evaluate(o,this.args)}eachChild(o){this.args.forEach(o)}outputDefined(){return!1}static parse(o,f){const E=o[0],L=Ni.definitions[E];if(!L)return f.error(`Unknown expression "${E}". If you wanted a literal array, use ["literal", [...]].`,0);const V=Array.isArray(L)?L[0]:L.type,X=Array.isArray(L)?[[L[1],L[2]]]:L.overloads,J=X.filter(([me])=>!Array.isArray(me)||me.length===o.length-1);let oe=null;for(const[me,Me]of J){oe=new wl(f.registry,lc,f.path,null,f.scope);const De=[];let Ye=!1;for(let ot=1;ot<o.length;ot++){const lt=o[ot],Ct=Array.isArray(me)?me[ot-1]:me.type,Gt=oe.parse(lt,1+De.length,Ct);if(!Gt){Ye=!0;break}De.push(Gt)}if(!Ye)if(Array.isArray(me)&&me.length!==De.length)oe.error(`Expected ${me.length} arguments, but found ${De.length} instead.`);else{for(let ot=0;ot<De.length;ot++){const lt=Array.isArray(me)?me[ot]:me.type,Ct=De[ot];oe.concat(ot+1).checkSubtype(lt,Ct.type)}if(oe.errors.length===0)return new Ni(E,V,Me,De)}}if(J.length===1)f.errors.push(...oe.errors);else{const me=(J.length?J:X).map(([De])=>{return Ye=De,Array.isArray(Ye)?`(${Ye.map(ye).join(", ")})`:`(${ye(Ye.type)}...)`;var Ye}).join(" | "),Me=[];for(let De=1;De<o.length;De++){const Ye=f.parse(o[De],1+Me.length);if(!Ye)return null;Me.push(ye(Ye.type))}f.error(`Expected arguments of type ${me}, but found (${Me.join(", ")}) instead.`)}return null}static register(o,f){Ni.definitions=f;for(const E in f)o[E]=Ni}}function lc(c){if(c instanceof Aa)return lc(c.boundExpression);if(c instanceof Ni&&c.name==="error"||c instanceof ol||c instanceof Va)return!1;const o=c instanceof Rl||c instanceof Wa;let f=!0;return c.eachChild(E=>{f=o?f&&lc(E):f&&E instanceof il}),!!f&&Ku(c)&&bs(c,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Ku(c){if(c instanceof Ni&&(c.name==="get"&&c.args.length===1||c.name==="feature-state"||c.name==="has"&&c.args.length===1||c.name==="properties"||c.name==="geometry-type"||c.name==="id"||/^filter-/.test(c.name))||c instanceof Va)return!1;let o=!0;return c.eachChild(f=>{o&&!Ku(f)&&(o=!1)}),o}function lo(c){if(c instanceof Ni&&c.name==="feature-state")return!1;let o=!0;return c.eachChild(f=>{o&&!lo(f)&&(o=!1)}),o}function bs(c,o){if(c instanceof Ni&&o.indexOf(c.name)>=0)return!1;let f=!0;return c.eachChild(E=>{f&&!bs(E,o)&&(f=!1)}),f}function Os(c,o){const f=c.length-1;let E,L,V=0,X=f,J=0;for(;V<=X;)if(J=Math.floor((V+X)/2),E=c[J],L=c[J+1],E<=o){if(J===f||o<L)return J;V=J+1}else{if(!(E>o))throw new va("Input is not a number.");X=J-1}return 0}class Nl{constructor(o,f,E){this.type=o,this.input=f,this.labels=[],this.outputs=[];for(const[L,V]of E)this.labels.push(L),this.outputs.push(V)}static parse(o,f){if(o.length-1<4)return f.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if((o.length-1)%2!=0)return f.error("Expected an even number of arguments.");const E=f.parse(o[1],1,dn);if(!E)return null;const L=[];let V=null;f.expectedType&&f.expectedType.kind!=="value"&&(V=f.expectedType);for(let X=1;X<o.length;X+=2){const J=X===1?-1/0:o[X],oe=o[X+1],me=X,Me=X+1;if(typeof J!="number")return f.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',me);if(L.length&&L[L.length-1][0]>=J)return f.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',me);const De=f.parse(oe,Me,V);if(!De)return null;V=V||De.type,L.push([J,De])}return new Nl(V,E,L)}evaluate(o){const f=this.labels,E=this.outputs;if(f.length===1)return E[0].evaluate(o);const L=this.input.evaluate(o);if(L<=f[0])return E[0].evaluate(o);const V=f.length;return L>=f[V-1]?E[V-1].evaluate(o):E[Os(f,L)].evaluate(o)}eachChild(o){o(this.input);for(const f of this.outputs)o(f)}outputDefined(){return this.outputs.every(o=>o.outputDefined())}}function Io(c,o,f){return c+f*(o-c)}function eu(c,o,f){return c.map((E,L)=>Io(E,o[L],f))}const Tl={number:Io,color:function(c,o,f,E="rgb"){switch(E){case"rgb":{const[L,V,X,J]=eu(c.rgb,o.rgb,f);return new Yo(L,V,X,J,!1)}case"hcl":{const[L,V,X,J]=c.hcl,[oe,me,Me,De]=o.hcl;let Ye,ot;if(isNaN(L)||isNaN(oe))isNaN(L)?isNaN(oe)?Ye=NaN:(Ye=oe,X!==1&&X!==0||(ot=me)):(Ye=L,Me!==1&&Me!==0||(ot=V));else{let Er=oe-L;oe>L&&Er>180?Er-=360:oe<L&&L-oe>180&&(Er+=360),Ye=L+f*Er}const[lt,Ct,Gt,Kt]=function([Er,cr,Rr,Qr]){return Er=isNaN(Er)?0:Er*xn,On([Rr,Math.cos(Er)*cr,Math.sin(Er)*cr,Qr])}([Ye,ot!=null?ot:Io(V,me,f),Io(X,Me,f),Io(J,De,f)]);return new Yo(lt,Ct,Gt,Kt,!1)}case"lab":{const[L,V,X,J]=On(eu(c.lab,o.lab,f));return new Yo(L,V,X,J,!1)}}},array:eu,padding:function(c,o,f){return new us(eu(c.values,o.values,f))},variableAnchorOffsetCollection:function(c,o,f){const E=c.values,L=o.values;if(E.length!==L.length)throw new va(`Cannot interpolate values of different length. from: ${c.toString()}, to: ${o.toString()}`);const V=[];for(let X=0;X<E.length;X+=2){if(E[X]!==L[X])throw new va(`Cannot interpolate values containing mismatched anchors. from[${X}]: ${E[X]}, to[${X}]: ${L[X]}`);V.push(E[X]);const[J,oe]=E[X+1],[me,Me]=L[X+1];V.push([Io(J,me,f),Io(oe,Me,f)])}return new Ba(V)}};class Fu{constructor(o,f,E,L,V){this.type=o,this.operator=f,this.interpolation=E,this.input=L,this.labels=[],this.outputs=[];for(const[X,J]of V)this.labels.push(X),this.outputs.push(J)}static interpolationFactor(o,f,E,L){let V=0;if(o.name==="exponential")V=Ju(f,o.base,E,L);else if(o.name==="linear")V=Ju(f,1,E,L);else if(o.name==="cubic-bezier"){const X=o.controlPoints;V=new Ke(X[0],X[1],X[2],X[3]).solve(Ju(f,1,E,L))}return V}static parse(o,f){let[E,L,V,...X]=o;if(!Array.isArray(L)||L.length===0)return f.error("Expected an interpolation type expression.",1);if(L[0]==="linear")L={name:"linear"};else if(L[0]==="exponential"){const me=L[1];if(typeof me!="number")return f.error("Exponential interpolation requires a numeric base.",1,1);L={name:"exponential",base:me}}else{if(L[0]!=="cubic-bezier")return f.error(`Unknown interpolation type ${String(L[0])}`,1,0);{const me=L.slice(1);if(me.length!==4||me.some(Me=>typeof Me!="number"||Me<0||Me>1))return f.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);L={name:"cubic-bezier",controlPoints:me}}}if(o.length-1<4)return f.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if((o.length-1)%2!=0)return f.error("Expected an even number of arguments.");if(V=f.parse(V,2,dn),!V)return null;const J=[];let oe=null;E==="interpolate-hcl"||E==="interpolate-lab"?oe=Za:f.expectedType&&f.expectedType.kind!=="value"&&(oe=f.expectedType);for(let me=0;me<X.length;me+=2){const Me=X[me],De=X[me+1],Ye=me+3,ot=me+4;if(typeof Me!="number")return f.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Ye);if(J.length&&J[J.length-1][0]>=Me)return f.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Ye);const lt=f.parse(De,ot,oe);if(!lt)return null;oe=oe||lt.type,J.push([Me,lt])}return Je(oe,dn)||Je(oe,Za)||Je(oe,Ne)||Je(oe,le)||Je(oe,ge(dn))?new Fu(oe,E,L,V,J):f.error(`Type ${ye(oe)} is not interpolatable.`)}evaluate(o){const f=this.labels,E=this.outputs;if(f.length===1)return E[0].evaluate(o);const L=this.input.evaluate(o);if(L<=f[0])return E[0].evaluate(o);const V=f.length;if(L>=f[V-1])return E[V-1].evaluate(o);const X=Os(f,L),J=Fu.interpolationFactor(this.interpolation,L,f[X],f[X+1]),oe=E[X].evaluate(o),me=E[X+1].evaluate(o);switch(this.operator){case"interpolate":return Tl[this.type.kind](oe,me,J);case"interpolate-hcl":return Tl.color(oe,me,J,"hcl");case"interpolate-lab":return Tl.color(oe,me,J,"lab")}}eachChild(o){o(this.input);for(const f of this.outputs)o(f)}outputDefined(){return this.outputs.every(o=>o.outputDefined())}}function Ju(c,o,f,E){const L=E-f,V=c-f;return L===0?0:o===1?V/L:(Math.pow(o,V)-1)/(Math.pow(o,L)-1)}class al{constructor(o,f){this.type=o,this.args=f}static parse(o,f){if(o.length<2)return f.error("Expectected at least one argument.");let E=null;const L=f.expectedType;L&&L.kind!=="value"&&(E=L);const V=[];for(const J of o.slice(1)){const oe=f.parse(J,1+V.length,E,void 0,{typeAnnotation:"omit"});if(!oe)return null;E=E||oe.type,V.push(oe)}if(!E)throw new Error("No output type");const X=L&&V.some(J=>je(L,J.type));return new al(X?Ji:E,V)}evaluate(o){let f,E=null,L=0;for(const V of this.args)if(L++,E=V.evaluate(o),E&&E instanceof Fa&&!E.available&&(f||(f=E.name),E=null,L===this.args.length&&(E=f)),E!==null)break;return E}eachChild(o){this.args.forEach(o)}outputDefined(){return this.args.every(o=>o.outputDefined())}}class Kc{constructor(o,f){this.type=f.type,this.bindings=[].concat(o),this.result=f}evaluate(o){return this.result.evaluate(o)}eachChild(o){for(const f of this.bindings)o(f[1]);o(this.result)}static parse(o,f){if(o.length<4)return f.error(`Expected at least 3 arguments, but found ${o.length-1} instead.`);const E=[];for(let V=1;V<o.length-1;V+=2){const X=o[V];if(typeof X!="string")return f.error(`Expected string, but found ${typeof X} instead.`,V);if(/[^a-zA-Z0-9_]/.test(X))return f.error("Variable names must contain only alphanumeric characters or '_'.",V);const J=f.parse(o[V+1],V+1);if(!J)return null;E.push([X,J])}const L=f.parse(o[o.length-1],o.length-1,f.expectedType,E);return L?new Kc(E,L):null}outputDefined(){return this.result.outputDefined()}}class ou{constructor(o,f,E){this.type=o,this.index=f,this.input=E}static parse(o,f){if(o.length!==3)return f.error(`Expected 2 arguments, but found ${o.length-1} instead.`);const E=f.parse(o[1],1,dn),L=f.parse(o[2],2,ge(f.expectedType||Ji));return E&&L?new ou(L.type.itemType,E,L):null}evaluate(o){const f=this.index.evaluate(o),E=this.input.evaluate(o);if(f<0)throw new va(`Array index out of bounds: ${f} < 0.`);if(f>=E.length)throw new va(`Array index out of bounds: ${f} > ${E.length-1}.`);if(f!==Math.floor(f))throw new va(`Array index must be an integer, but found ${f} instead.`);return E[f]}eachChild(o){o(this.index),o(this.input)}outputDefined(){return!1}}class Ks{constructor(o,f){this.type=no,this.needle=o,this.haystack=f}static parse(o,f){if(o.length!==3)return f.error(`Expected 2 arguments, but found ${o.length-1} instead.`);const E=f.parse(o[1],1,Ji),L=f.parse(o[2],2,Ji);return E&&L?Ue(E.type,[no,co,dn,wa,Ji])?new Ks(E,L):f.error(`Expected first argument to be of type boolean, string, number or null, but found ${ye(E.type)} instead`):null}evaluate(o){const f=this.needle.evaluate(o),E=this.haystack.evaluate(o);if(!E)return!1;if(!Ae(f,["boolean","string","number","null"]))throw new va(`Expected first argument to be of type boolean, string, number or null, but found ${ye(oa(f))} instead.`);if(!Ae(E,["string","array"]))throw new va(`Expected second argument to be of type array or string, but found ${ye(oa(E))} instead.`);return E.indexOf(f)>=0}eachChild(o){o(this.needle),o(this.haystack)}outputDefined(){return!0}}class Lp{constructor(o,f,E){this.type=dn,this.needle=o,this.haystack=f,this.fromIndex=E}static parse(o,f){if(o.length<=2||o.length>=5)return f.error(`Expected 3 or 4 arguments, but found ${o.length-1} instead.`);const E=f.parse(o[1],1,Ji),L=f.parse(o[2],2,Ji);if(!E||!L)return null;if(!Ue(E.type,[no,co,dn,wa,Ji]))return f.error(`Expected first argument to be of type boolean, string, number or null, but found ${ye(E.type)} instead`);if(o.length===4){const V=f.parse(o[3],3,dn);return V?new Lp(E,L,V):null}return new Lp(E,L)}evaluate(o){const f=this.needle.evaluate(o),E=this.haystack.evaluate(o);if(!Ae(f,["boolean","string","number","null"]))throw new va(`Expected first argument to be of type boolean, string, number or null, but found ${ye(oa(f))} instead.`);if(!Ae(E,["string","array"]))throw new va(`Expected second argument to be of type array or string, but found ${ye(oa(E))} instead.`);if(this.fromIndex){const L=this.fromIndex.evaluate(o);return E.indexOf(f,L)}return E.indexOf(f)}eachChild(o){o(this.needle),o(this.haystack),this.fromIndex&&o(this.fromIndex)}outputDefined(){return!1}}class gf{constructor(o,f,E,L,V,X){this.inputType=o,this.type=f,this.input=E,this.cases=L,this.outputs=V,this.otherwise=X}static parse(o,f){if(o.length<5)return f.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if(o.length%2!=1)return f.error("Expected an even number of arguments.");let E,L;f.expectedType&&f.expectedType.kind!=="value"&&(L=f.expectedType);const V={},X=[];for(let me=2;me<o.length-1;me+=2){let Me=o[me];const De=o[me+1];Array.isArray(Me)||(Me=[Me]);const Ye=f.concat(me);if(Me.length===0)return Ye.error("Expected at least one branch label.");for(const lt of Me){if(typeof lt!="number"&&typeof lt!="string")return Ye.error("Branch labels must be numbers or strings.");if(typeof lt=="number"&&Math.abs(lt)>Number.MAX_SAFE_INTEGER)return Ye.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof lt=="number"&&Math.floor(lt)!==lt)return Ye.error("Numeric branch labels must be integer values.");if(E){if(Ye.checkSubtype(E,oa(lt)))return null}else E=oa(lt);if(V[String(lt)]!==void 0)return Ye.error("Branch labels must be unique.");V[String(lt)]=X.length}const ot=f.parse(De,me,L);if(!ot)return null;L=L||ot.type,X.push(ot)}const J=f.parse(o[1],1,Ji);if(!J)return null;const oe=f.parse(o[o.length-1],o.length-1,L);return oe?J.type.kind!=="value"&&f.concat(1).checkSubtype(E,J.type)?null:new gf(E,L,J,V,X,oe):null}evaluate(o){const f=this.input.evaluate(o);return(oa(f)===this.inputType&&this.outputs[this.cases[f]]||this.otherwise).evaluate(o)}eachChild(o){o(this.input),this.outputs.forEach(o),o(this.otherwise)}outputDefined(){return this.outputs.every(o=>o.outputDefined())&&this.otherwise.outputDefined()}}class Of{constructor(o,f,E){this.type=o,this.branches=f,this.otherwise=E}static parse(o,f){if(o.length<4)return f.error(`Expected at least 3 arguments, but found only ${o.length-1}.`);if(o.length%2!=0)return f.error("Expected an odd number of arguments.");let E;f.expectedType&&f.expectedType.kind!=="value"&&(E=f.expectedType);const L=[];for(let X=1;X<o.length-1;X+=2){const J=f.parse(o[X],X,no);if(!J)return null;const oe=f.parse(o[X+1],X+1,E);if(!oe)return null;L.push([J,oe]),E=E||oe.type}const V=f.parse(o[o.length-1],o.length-1,E);if(!V)return null;if(!E)throw new Error("Can't infer output type");return new Of(E,L,V)}evaluate(o){for(const[f,E]of this.branches)if(f.evaluate(o))return E.evaluate(o);return this.otherwise.evaluate(o)}eachChild(o){for(const[f,E]of this.branches)o(f),o(E);o(this.otherwise)}outputDefined(){return this.branches.every(([o,f])=>f.outputDefined())&&this.otherwise.outputDefined()}}class qh{constructor(o,f,E,L){this.type=o,this.input=f,this.beginIndex=E,this.endIndex=L}static parse(o,f){if(o.length<=2||o.length>=5)return f.error(`Expected 3 or 4 arguments, but found ${o.length-1} instead.`);const E=f.parse(o[1],1,Ji),L=f.parse(o[2],2,dn);if(!E||!L)return null;if(!Ue(E.type,[ge(Ji),co,Ji]))return f.error(`Expected first argument to be of type array or string, but found ${ye(E.type)} instead`);if(o.length===4){const V=f.parse(o[3],3,dn);return V?new qh(E.type,E,L,V):null}return new qh(E.type,E,L)}evaluate(o){const f=this.input.evaluate(o),E=this.beginIndex.evaluate(o);if(!Ae(f,["string","array"]))throw new va(`Expected first argument to be of type array or string, but found ${ye(oa(f))} instead.`);if(this.endIndex){const L=this.endIndex.evaluate(o);return f.slice(E,L)}return f.slice(E)}eachChild(o){o(this.input),o(this.beginIndex),this.endIndex&&o(this.endIndex)}outputDefined(){return!1}}function zc(c,o){return c==="=="||c==="!="?o.kind==="boolean"||o.kind==="string"||o.kind==="number"||o.kind==="null"||o.kind==="value":o.kind==="string"||o.kind==="number"||o.kind==="value"}function Oh(c,o,f,E){return E.compare(o,f)===0}function Ms(c,o,f){const E=c!=="=="&&c!=="!=";return class JS{constructor(V,X,J){this.type=no,this.lhs=V,this.rhs=X,this.collator=J,this.hasUntypedArgument=V.type.kind==="value"||X.type.kind==="value"}static parse(V,X){if(V.length!==3&&V.length!==4)return X.error("Expected two or three arguments.");const J=V[0];let oe=X.parse(V[1],1,Ji);if(!oe)return null;if(!zc(J,oe.type))return X.concat(1).error(`"${J}" comparisons are not supported for type '${ye(oe.type)}'.`);let me=X.parse(V[2],2,Ji);if(!me)return null;if(!zc(J,me.type))return X.concat(2).error(`"${J}" comparisons are not supported for type '${ye(me.type)}'.`);if(oe.type.kind!==me.type.kind&&oe.type.kind!=="value"&&me.type.kind!=="value")return X.error(`Cannot compare types '${ye(oe.type)}' and '${ye(me.type)}'.`);E&&(oe.type.kind==="value"&&me.type.kind!=="value"?oe=new Wa(me.type,[oe]):oe.type.kind!=="value"&&me.type.kind==="value"&&(me=new Wa(oe.type,[me])));let Me=null;if(V.length===4){if(oe.type.kind!=="string"&&me.type.kind!=="string"&&oe.type.kind!=="value"&&me.type.kind!=="value")return X.error("Cannot use collator to compare non-string types.");if(Me=X.parse(V[3],3,Us),!Me)return null}return new JS(oe,me,Me)}evaluate(V){const X=this.lhs.evaluate(V),J=this.rhs.evaluate(V);if(E&&this.hasUntypedArgument){const oe=oa(X),me=oa(J);if(oe.kind!==me.kind||oe.kind!=="string"&&oe.kind!=="number")throw new va(`Expected arguments for "${c}" to be (string, string) or (number, number), but found (${oe.kind}, ${me.kind}) instead.`)}if(this.collator&&!E&&this.hasUntypedArgument){const oe=oa(X),me=oa(J);if(oe.kind!=="string"||me.kind!=="string")return o(V,X,J)}return this.collator?f(V,X,J,this.collator.evaluate(V)):o(V,X,J)}eachChild(V){V(this.lhs),V(this.rhs),this.collator&&V(this.collator)}outputDefined(){return!0}}}const Jc=Ms("==",function(c,o,f){return o===f},Oh),Yh=Ms("!=",function(c,o,f){return o!==f},function(c,o,f,E){return!Oh(0,o,f,E)}),Qc=Ms("<",function(c,o,f){return o<f},function(c,o,f,E){return E.compare(o,f)<0}),uc=Ms(">",function(c,o,f){return o>f},function(c,o,f,E){return E.compare(o,f)>0}),eh=Ms("<=",function(c,o,f){return o<=f},function(c,o,f,E){return E.compare(o,f)<=0}),yh=Ms(">=",function(c,o,f){return o>=f},function(c,o,f,E){return E.compare(o,f)>=0});class sl{constructor(o,f,E,L,V){this.type=co,this.number=o,this.locale=f,this.currency=E,this.minFractionDigits=L,this.maxFractionDigits=V}static parse(o,f){if(o.length!==3)return f.error("Expected two arguments.");const E=f.parse(o[1],1,dn);if(!E)return null;const L=o[2];if(typeof L!="object"||Array.isArray(L))return f.error("NumberFormat options argument must be an object.");let V=null;if(L.locale&&(V=f.parse(L.locale,1,co),!V))return null;let X=null;if(L.currency&&(X=f.parse(L.currency,1,co),!X))return null;let J=null;if(L["min-fraction-digits"]&&(J=f.parse(L["min-fraction-digits"],1,dn),!J))return null;let oe=null;return L["max-fraction-digits"]&&(oe=f.parse(L["max-fraction-digits"],1,dn),!oe)?null:new sl(E,V,X,J,oe)}evaluate(o){return new Intl.NumberFormat(this.locale?this.locale.evaluate(o):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(o):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(o):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(o):void 0}).format(this.number.evaluate(o))}eachChild(o){o(this.number),this.locale&&o(this.locale),this.currency&&o(this.currency),this.minFractionDigits&&o(this.minFractionDigits),this.maxFractionDigits&&o(this.maxFractionDigits)}outputDefined(){return!1}}class Uc{constructor(o){this.type=Lt,this.sections=o}static parse(o,f){if(o.length<2)return f.error("Expected at least one argument.");const E=o[1];if(!Array.isArray(E)&&typeof E=="object")return f.error("First argument must be an image or text section.");const L=[];let V=!1;for(let X=1;X<=o.length-1;++X){const J=o[X];if(V&&typeof J=="object"&&!Array.isArray(J)){V=!1;let oe=null;if(J["font-scale"]&&(oe=f.parse(J["font-scale"],1,dn),!oe))return null;let me=null;if(J["text-font"]&&(me=f.parse(J["text-font"],1,ge(co)),!me))return null;let Me=null;if(J["text-color"]&&(Me=f.parse(J["text-color"],1,Za),!Me))return null;const De=L[L.length-1];De.scale=oe,De.font=me,De.textColor=Me}else{const oe=f.parse(o[X],1,Ji);if(!oe)return null;const me=oe.type.kind;if(me!=="string"&&me!=="value"&&me!=="null"&&me!=="resolvedImage")return f.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");V=!0,L.push({content:oe,scale:null,font:null,textColor:null})}}return new Uc(L)}evaluate(o){return new Fo(this.sections.map(f=>{const E=f.content.evaluate(o);return oa(E)===re?new $o("",E,null,null,null):new $o(Zo(E),null,f.scale?f.scale.evaluate(o):null,f.font?f.font.evaluate(o).join(","):null,f.textColor?f.textColor.evaluate(o):null)}))}eachChild(o){for(const f of this.sections)o(f.content),f.scale&&o(f.scale),f.font&&o(f.font),f.textColor&&o(f.textColor)}outputDefined(){return!1}}class bc{constructor(o){this.type=re,this.input=o}static parse(o,f){if(o.length!==2)return f.error("Expected two arguments.");const E=f.parse(o[1],1,co);return E?new bc(E):f.error("No image name provided.")}evaluate(o){const f=this.input.evaluate(o),E=Fa.fromString(f);return E&&o.availableImages&&(E.available=o.availableImages.indexOf(f)>-1),E}eachChild(o){o(this.input)}outputDefined(){return!1}}class fp{constructor(o){this.type=dn,this.input=o}static parse(o,f){if(o.length!==2)return f.error(`Expected 1 argument, but found ${o.length-1} instead.`);const E=f.parse(o[1],1);return E?E.type.kind!=="array"&&E.type.kind!=="string"&&E.type.kind!=="value"?f.error(`Expected argument of type string or array, but found ${ye(E.type)} instead.`):new fp(E):null}evaluate(o){const f=this.input.evaluate(o);if(typeof f=="string"||Array.isArray(f))return f.length;throw new va(`Expected value to be of type string or array, but found ${ye(oa(f))} instead.`)}eachChild(o){o(this.input)}outputDefined(){return!1}}const dp={"==":Jc,"!=":Yh,">":uc,"<":Qc,">=":yh,"<=":eh,array:Wa,at:ou,boolean:Wa,case:Of,coalesce:al,collator:ol,format:Uc,image:bc,in:Ks,"index-of":Lp,interpolate:Fu,"interpolate-hcl":Fu,"interpolate-lab":Fu,length:fp,let:Kc,literal:il,match:gf,number:Wa,"number-format":sl,object:Wa,slice:qh,step:Nl,string:Wa,"to-boolean":Rl,"to-color":Rl,"to-number":Rl,"to-string":Rl,var:Aa,within:Va};function Ps(c,[o,f,E,L]){o=o.evaluate(c),f=f.evaluate(c),E=E.evaluate(c);const V=L?L.evaluate(c):1,X=sc(o,f,E,V);if(X)throw new va(X);return new Yo(o/255,f/255,E/255,V,!1)}function Gf(c,o){return c in o}function Xp(c,o){const f=o[c];return f===void 0?null:f}function cc(c){return{type:c}}function zl(c){return{result:"success",value:c}}function Ec(c){return{result:"error",value:c}}function th(c){return c["property-type"]==="data-driven"||c["property-type"]==="cross-faded-data-driven"}function vu(c){return!!c.expression&&c.expression.parameters.indexOf("zoom")>-1}function xh(c){return!!c.expression&&c.expression.interpolated}function qa(c){return c instanceof Number?"number":c instanceof String?"string":c instanceof Boolean?"boolean":Array.isArray(c)?"array":c===null?"null":typeof c}function Hs(c){return typeof c=="object"&&c!==null&&!Array.isArray(c)}function Ep(c){return c}function Na(c,o){const f=o.type==="color",E=c.stops&&typeof c.stops[0][0]=="object",L=E||!(E||c.property!==void 0),V=c.type||(xh(o)?"exponential":"interval");if(f||o.type==="padding"){const Me=f?Yo.parse:us.parse;(c=To({},c)).stops&&(c.stops=c.stops.map(De=>[De[0],Me(De[1])])),c.default=Me(c.default?c.default:o.default)}if(c.colorSpace&&(X=c.colorSpace)!=="rgb"&&X!=="hcl"&&X!=="lab")throw new Error(`Unknown color space: "${c.colorSpace}"`);var X;let J,oe,me;if(V==="exponential")J=ec;else if(V==="interval")J=ys;else if(V==="categorical"){J=Is,oe=Object.create(null);for(const Me of c.stops)oe[Me[0]]=Me[1];me=typeof c.stops[0][0]}else{if(V!=="identity")throw new Error(`Unknown function type "${V}"`);J=Bf}if(E){const Me={},De=[];for(let lt=0;lt<c.stops.length;lt++){const Ct=c.stops[lt],Gt=Ct[0].zoom;Me[Gt]===void 0&&(Me[Gt]={zoom:Gt,type:c.type,property:c.property,default:c.default,stops:[]},De.push(Gt)),Me[Gt].stops.push([Ct[0].value,Ct[1]])}const Ye=[];for(const lt of De)Ye.push([Me[lt].zoom,Na(Me[lt],o)]);const ot={name:"linear"};return{kind:"composite",interpolationType:ot,interpolationFactor:Fu.interpolationFactor.bind(void 0,ot),zoomStops:Ye.map(lt=>lt[0]),evaluate:({zoom:lt},Ct)=>ec({stops:Ye,base:c.base},o,lt).evaluate(lt,Ct)}}if(L){const Me=V==="exponential"?{name:"exponential",base:c.base!==void 0?c.base:1}:null;return{kind:"camera",interpolationType:Me,interpolationFactor:Fu.interpolationFactor.bind(void 0,Me),zoomStops:c.stops.map(De=>De[0]),evaluate:({zoom:De})=>J(c,o,De,oe,me)}}return{kind:"source",evaluate(Me,De){const Ye=De&&De.properties?De.properties[c.property]:void 0;return Ye===void 0?Qu(c.default,o.default):J(c,o,Ye,oe,me)}}}function Qu(c,o,f){return c!==void 0?c:o!==void 0?o:f!==void 0?f:void 0}function Is(c,o,f,E,L){return Qu(typeof f===L?E[f]:void 0,c.default,o.default)}function ys(c,o,f){if(qa(f)!=="number")return Qu(c.default,o.default);const E=c.stops.length;if(E===1||f<=c.stops[0][0])return c.stops[0][1];if(f>=c.stops[E-1][0])return c.stops[E-1][1];const L=Os(c.stops.map(V=>V[0]),f);return c.stops[L][1]}function ec(c,o,f){const E=c.base!==void 0?c.base:1;if(qa(f)!=="number")return Qu(c.default,o.default);const L=c.stops.length;if(L===1||f<=c.stops[0][0])return c.stops[0][1];if(f>=c.stops[L-1][0])return c.stops[L-1][1];const V=Os(c.stops.map(Me=>Me[0]),f),X=function(Me,De,Ye,ot){const lt=ot-Ye,Ct=Me-Ye;return lt===0?0:De===1?Ct/lt:(Math.pow(De,Ct)-1)/(Math.pow(De,lt)-1)}(f,E,c.stops[V][0],c.stops[V+1][0]),J=c.stops[V][1],oe=c.stops[V+1][1],me=Tl[o.type]||Ep;return typeof J.evaluate=="function"?{evaluate(...Me){const De=J.evaluate.apply(void 0,Me),Ye=oe.evaluate.apply(void 0,Me);if(De!==void 0&&Ye!==void 0)return me(De,Ye,X,c.colorSpace)}}:me(J,oe,X,c.colorSpace)}function Bf(c,o,f){switch(o.type){case"color":f=Yo.parse(f);break;case"formatted":f=Fo.fromString(f.toString());break;case"resolvedImage":f=Fa.fromString(f.toString());break;case"padding":f=us.parse(f);break;default:qa(f)===o.type||o.type==="enum"&&o.values[f]||(f=void 0)}return Qu(f,c.default,o.default)}Ni.register(dp,{error:[{kind:"error"},[co],(c,[o])=>{throw new va(o.evaluate(c))}],typeof:[co,[Ji],(c,[o])=>ye(oa(o.evaluate(c)))],"to-rgba":[ge(dn,4),[Za],(c,[o])=>{const[f,E,L,V]=o.evaluate(c).rgb;return[255*f,255*E,255*L,V]}],rgb:[Za,[dn,dn,dn],Ps],rgba:[Za,[dn,dn,dn,dn],Ps],has:{type:no,overloads:[[[co],(c,[o])=>Gf(o.evaluate(c),c.properties())],[[co,ms],(c,[o,f])=>Gf(o.evaluate(c),f.evaluate(c))]]},get:{type:Ji,overloads:[[[co],(c,[o])=>Xp(o.evaluate(c),c.properties())],[[co,ms],(c,[o,f])=>Xp(o.evaluate(c),f.evaluate(c))]]},"feature-state":[Ji,[co],(c,[o])=>Xp(o.evaluate(c),c.featureState||{})],properties:[ms,[],c=>c.properties()],"geometry-type":[co,[],c=>c.geometryType()],id:[Ji,[],c=>c.id()],zoom:[dn,[],c=>c.globals.zoom],"heatmap-density":[dn,[],c=>c.globals.heatmapDensity||0],"line-progress":[dn,[],c=>c.globals.lineProgress||0],accumulated:[Ji,[],c=>c.globals.accumulated===void 0?null:c.globals.accumulated],"+":[dn,cc(dn),(c,o)=>{let f=0;for(const E of o)f+=E.evaluate(c);return f}],"*":[dn,cc(dn),(c,o)=>{let f=1;for(const E of o)f*=E.evaluate(c);return f}],"-":{type:dn,overloads:[[[dn,dn],(c,[o,f])=>o.evaluate(c)-f.evaluate(c)],[[dn],(c,[o])=>-o.evaluate(c)]]},"/":[dn,[dn,dn],(c,[o,f])=>o.evaluate(c)/f.evaluate(c)],"%":[dn,[dn,dn],(c,[o,f])=>o.evaluate(c)%f.evaluate(c)],ln2:[dn,[],()=>Math.LN2],pi:[dn,[],()=>Math.PI],e:[dn,[],()=>Math.E],"^":[dn,[dn,dn],(c,[o,f])=>Math.pow(o.evaluate(c),f.evaluate(c))],sqrt:[dn,[dn],(c,[o])=>Math.sqrt(o.evaluate(c))],log10:[dn,[dn],(c,[o])=>Math.log(o.evaluate(c))/Math.LN10],ln:[dn,[dn],(c,[o])=>Math.log(o.evaluate(c))],log2:[dn,[dn],(c,[o])=>Math.log(o.evaluate(c))/Math.LN2],sin:[dn,[dn],(c,[o])=>Math.sin(o.evaluate(c))],cos:[dn,[dn],(c,[o])=>Math.cos(o.evaluate(c))],tan:[dn,[dn],(c,[o])=>Math.tan(o.evaluate(c))],asin:[dn,[dn],(c,[o])=>Math.asin(o.evaluate(c))],acos:[dn,[dn],(c,[o])=>Math.acos(o.evaluate(c))],atan:[dn,[dn],(c,[o])=>Math.atan(o.evaluate(c))],min:[dn,cc(dn),(c,o)=>Math.min(...o.map(f=>f.evaluate(c)))],max:[dn,cc(dn),(c,o)=>Math.max(...o.map(f=>f.evaluate(c)))],abs:[dn,[dn],(c,[o])=>Math.abs(o.evaluate(c))],round:[dn,[dn],(c,[o])=>{const f=o.evaluate(c);return f<0?-Math.round(-f):Math.round(f)}],floor:[dn,[dn],(c,[o])=>Math.floor(o.evaluate(c))],ceil:[dn,[dn],(c,[o])=>Math.ceil(o.evaluate(c))],"filter-==":[no,[co,Ji],(c,[o,f])=>c.properties()[o.value]===f.value],"filter-id-==":[no,[Ji],(c,[o])=>c.id()===o.value],"filter-type-==":[no,[co],(c,[o])=>c.geometryType()===o.value],"filter-<":[no,[co,Ji],(c,[o,f])=>{const E=c.properties()[o.value],L=f.value;return typeof E==typeof L&&E<L}],"filter-id-<":[no,[Ji],(c,[o])=>{const f=c.id(),E=o.value;return typeof f==typeof E&&f<E}],"filter->":[no,[co,Ji],(c,[o,f])=>{const E=c.properties()[o.value],L=f.value;return typeof E==typeof L&&E>L}],"filter-id->":[no,[Ji],(c,[o])=>{const f=c.id(),E=o.value;return typeof f==typeof E&&f>E}],"filter-<=":[no,[co,Ji],(c,[o,f])=>{const E=c.properties()[o.value],L=f.value;return typeof E==typeof L&&E<=L}],"filter-id-<=":[no,[Ji],(c,[o])=>{const f=c.id(),E=o.value;return typeof f==typeof E&&f<=E}],"filter->=":[no,[co,Ji],(c,[o,f])=>{const E=c.properties()[o.value],L=f.value;return typeof E==typeof L&&E>=L}],"filter-id->=":[no,[Ji],(c,[o])=>{const f=c.id(),E=o.value;return typeof f==typeof E&&f>=E}],"filter-has":[no,[Ji],(c,[o])=>o.value in c.properties()],"filter-has-id":[no,[],c=>c.id()!==null&&c.id()!==void 0],"filter-type-in":[no,[ge(co)],(c,[o])=>o.value.indexOf(c.geometryType())>=0],"filter-id-in":[no,[ge(Ji)],(c,[o])=>o.value.indexOf(c.id())>=0],"filter-in-small":[no,[co,ge(Ji)],(c,[o,f])=>f.value.indexOf(c.properties()[o.value])>=0],"filter-in-large":[no,[co,ge(Ji)],(c,[o,f])=>function(E,L,V,X){for(;V<=X;){const J=V+X>>1;if(L[J]===E)return!0;L[J]>E?X=J-1:V=J+1}return!1}(c.properties()[o.value],f.value,0,f.value.length-1)],all:{type:no,overloads:[[[no,no],(c,[o,f])=>o.evaluate(c)&&f.evaluate(c)],[cc(no),(c,o)=>{for(const f of o)if(!f.evaluate(c))return!1;return!0}]]},any:{type:no,overloads:[[[no,no],(c,[o,f])=>o.evaluate(c)||f.evaluate(c)],[cc(no),(c,o)=>{for(const f of o)if(f.evaluate(c))return!0;return!1}]]},"!":[no,[no],(c,[o])=>!o.evaluate(c)],"is-supported-script":[no,[co],(c,[o])=>{const f=c.globals&&c.globals.isSupportedScript;return!f||f(o.evaluate(c))}],upcase:[co,[co],(c,[o])=>o.evaluate(c).toUpperCase()],downcase:[co,[co],(c,[o])=>o.evaluate(c).toLowerCase()],concat:[co,cc(Ji),(c,o)=>o.map(f=>Zo(f.evaluate(c))).join("")],"resolved-locale":[co,[Us],(c,[o])=>o.evaluate(c).resolvedLocale()]});class es{constructor(o,f){var E;this.expression=o,this._warningHistory={},this._evaluator=new gl,this._defaultValue=f?(E=f).type==="color"&&Hs(E.default)?new Yo(0,0,0,0):E.type==="color"?Yo.parse(E.default)||null:E.type==="padding"?us.parse(E.default)||null:E.type==="variableAnchorOffsetCollection"?Ba.parse(E.default)||null:E.default===void 0?null:E.default:null,this._enumValues=f&&f.type==="enum"?f.values:null}evaluateWithoutErrorHandling(o,f,E,L,V,X){return this._evaluator.globals=o,this._evaluator.feature=f,this._evaluator.featureState=E,this._evaluator.canonical=L,this._evaluator.availableImages=V||null,this._evaluator.formattedSection=X,this.expression.evaluate(this._evaluator)}evaluate(o,f,E,L,V,X){this._evaluator.globals=o,this._evaluator.feature=f||null,this._evaluator.featureState=E||null,this._evaluator.canonical=L,this._evaluator.availableImages=V||null,this._evaluator.formattedSection=X||null;try{const J=this.expression.evaluate(this._evaluator);if(J==null||typeof J=="number"&&J!=J)return this._defaultValue;if(this._enumValues&&!(J in this._enumValues))throw new va(`Expected value to be one of ${Object.keys(this._enumValues).map(oe=>JSON.stringify(oe)).join(", ")}, but found ${JSON.stringify(J)} instead.`);return J}catch(J){return this._warningHistory[J.message]||(this._warningHistory[J.message]=!0,typeof console!="undefined"&&console.warn(J.message)),this._defaultValue}}}function Bs(c){return Array.isArray(c)&&c.length>0&&typeof c[0]=="string"&&c[0]in dp}function wc(c,o){const f=new wl(dp,lc,[],o?function(L){const V={color:Za,string:co,number:dn,enum:co,boolean:no,formatted:Lt,padding:Ne,resolvedImage:re,variableAnchorOffsetCollection:le};return L.type==="array"?ge(V[L.value]||Ji,L.length):V[L.type]}(o):void 0),E=f.parse(c,void 0,void 0,void 0,o&&o.type==="string"?{typeAnnotation:"coerce"}:void 0);return E?zl(new es(E,o)):Ec(f.errors)}class qp{constructor(o,f){this.kind=o,this._styleExpression=f,this.isStateDependent=o!=="constant"&&!lo(f.expression)}evaluateWithoutErrorHandling(o,f,E,L,V,X){return this._styleExpression.evaluateWithoutErrorHandling(o,f,E,L,V,X)}evaluate(o,f,E,L,V,X){return this._styleExpression.evaluate(o,f,E,L,V,X)}}class Sc{constructor(o,f,E,L){this.kind=o,this.zoomStops=E,this._styleExpression=f,this.isStateDependent=o!=="camera"&&!lo(f.expression),this.interpolationType=L}evaluateWithoutErrorHandling(o,f,E,L,V,X){return this._styleExpression.evaluateWithoutErrorHandling(o,f,E,L,V,X)}evaluate(o,f,E,L,V,X){return this._styleExpression.evaluate(o,f,E,L,V,X)}interpolationFactor(o,f,E){return this.interpolationType?Fu.interpolationFactor(this.interpolationType,o,f,E):0}}function $h(c,o){const f=wc(c,o);if(f.result==="error")return f;const E=f.value.expression,L=Ku(E);if(!L&&!th(o))return Ec([new Ti("","data expressions not supported")]);const V=bs(E,["zoom"]);if(!V&&!vu(o))return Ec([new Ti("","zoom expressions not supported")]);const X=au(E);return X||V?X instanceof Ti?Ec([X]):X instanceof Fu&&!xh(o)?Ec([new Ti("",'"interpolate" expressions cannot be used with this property')]):zl(X?new Sc(L?"camera":"composite",f.value,X.labels,X instanceof Fu?X.interpolation:void 0):new qp(L?"constant":"source",f.value)):Ec([new Ti("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Xo{constructor(o,f){this._parameters=o,this._specification=f,To(this,Na(this._parameters,this._specification))}static deserialize(o){return new Xo(o._parameters,o._specification)}static serialize(o){return{_parameters:o._parameters,_specification:o._specification}}}function au(c){let o=null;if(c instanceof Kc)o=au(c.result);else if(c instanceof al){for(const f of c.args)if(o=au(f),o)break}else(c instanceof Nl||c instanceof Fu)&&c.input instanceof Ni&&c.input.name==="zoom"&&(o=c);return o instanceof Ti||c.eachChild(f=>{const E=au(f);E instanceof Ti?o=E:!o&&E?o=new Ti("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):o&&E&&o!==E&&(o=new Ti("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),o}function dl(c){if(c===!0||c===!1)return!0;if(!Array.isArray(c)||c.length===0)return!1;switch(c[0]){case"has":return c.length>=2&&c[1]!=="$id"&&c[1]!=="$type";case"in":return c.length>=3&&(typeof c[1]!="string"||Array.isArray(c[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return c.length!==3||Array.isArray(c[1])||Array.isArray(c[2]);case"any":case"all":for(const o of c.slice(1))if(!dl(o)&&typeof o!="boolean")return!1;return!0;default:return!0}}const tc={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function bh(c){if(c==null)return{filter:()=>!0,needGeometry:!1};dl(c)||(c=Zc(c));const o=wc(c,tc);if(o.result==="error")throw new Error(o.value.map(f=>`${f.key}: ${f.message}`).join(", "));return{filter:(f,E,L)=>o.value.evaluate(f,E,{},L),needGeometry:Kh(c)}}function mp(c,o){return c<o?-1:c>o?1:0}function Kh(c){if(!Array.isArray(c))return!1;if(c[0]==="within")return!0;for(let o=1;o<c.length;o++)if(Kh(c[o]))return!0;return!1}function Zc(c){if(!c)return!0;const o=c[0];return c.length<=1?o!=="any":o==="=="?vf(c[1],c[2],"=="):o==="!="?Vc(vf(c[1],c[2],"==")):o==="<"||o===">"||o==="<="||o===">="?vf(c[1],c[2],o):o==="any"?(f=c.slice(1),["any"].concat(f.map(Zc))):o==="all"?["all"].concat(c.slice(1).map(Zc)):o==="none"?["all"].concat(c.slice(1).map(Zc).map(Vc)):o==="in"?Bh(c[1],c.slice(2)):o==="!in"?Vc(Bh(c[1],c.slice(2))):o==="has"?_u(c[1]):o==="!has"?Vc(_u(c[1])):o!=="within"||c;var f}function vf(c,o,f){switch(c){case"$type":return[`filter-type-${f}`,o];case"$id":return[`filter-id-${f}`,o];default:return[`filter-${f}`,c,o]}}function Bh(c,o){if(o.length===0)return!1;switch(c){case"$type":return["filter-type-in",["literal",o]];case"$id":return["filter-id-in",["literal",o]];default:return o.length>200&&!o.some(f=>typeof f!=typeof o[0])?["filter-in-large",c,["literal",o.sort(mp)]]:["filter-in-small",c,["literal",o]]}}function _u(c){switch(c){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",c]}}function Vc(c){return["!",c]}function Yp(c){const o=typeof c;if(o==="number"||o==="boolean"||o==="string"||c==null)return JSON.stringify(c);if(Array.isArray(c)){let L="[";for(const V of c)L+=`${Yp(V)},`;return`${L}]`}const f=Object.keys(c).sort();let E="{";for(let L=0;L<f.length;L++)E+=`${JSON.stringify(f[L])}:${Yp(c[f[L]])},`;return`${E}}`}function Fh(c){let o="";for(const f of ls)o+=`/${Yp(c[f])}`;return o}function Ll(c){const o=c.value;return o?[new un(c.key,o,"constants have been deprecated as of v8")]:[]}function Fs(c){return c instanceof Number||c instanceof String||c instanceof Boolean?c.valueOf():c}function Tc(c){if(Array.isArray(c))return c.map(Tc);if(c instanceof Object&&!(c instanceof Number||c instanceof String||c instanceof Boolean)){const o={};for(const f in c)o[f]=Tc(c[f]);return o}return Fs(c)}function Ru(c){const o=c.key,f=c.value,E=c.valueSpec||{},L=c.objectElementValidators||{},V=c.style,X=c.styleSpec,J=c.validateSpec;let oe=[];const me=qa(f);if(me!=="object")return[new un(o,f,`object expected, ${me} found`)];for(const Me in f){const De=Me.split(".")[0],Ye=E[De]||E["*"];let ot;if(L[De])ot=L[De];else if(E[De])ot=J;else if(L["*"])ot=L["*"];else{if(!E["*"]){oe.push(new un(o,f[Me],`unknown property "${Me}"`));continue}ot=J}oe=oe.concat(ot({key:(o&&`${o}.`)+Me,value:f[Me],valueSpec:Ye,style:V,styleSpec:X,object:f,objectKey:Me,validateSpec:J},f))}for(const Me in E)L[Me]||E[Me].required&&E[Me].default===void 0&&f[Me]===void 0&&oe.push(new un(o,f,`missing required property "${Me}"`));return oe}function jc(c){const o=c.value,f=c.valueSpec,E=c.style,L=c.styleSpec,V=c.key,X=c.arrayElementValidator||c.validateSpec;if(qa(o)!=="array")return[new un(V,o,`array expected, ${qa(o)} found`)];if(f.length&&o.length!==f.length)return[new un(V,o,`array length ${f.length} expected, length ${o.length} found`)];if(f["min-length"]&&o.length<f["min-length"])return[new un(V,o,`array length at least ${f["min-length"]} expected, length ${o.length} found`)];let J={type:f.value,values:f.values};L.$version<7&&(J.function=f.function),qa(f.value)==="object"&&(J=f.value);let oe=[];for(let me=0;me<o.length;me++)oe=oe.concat(X({array:o,arrayIndex:me,value:o[me],valueSpec:J,validateSpec:c.validateSpec,style:E,styleSpec:L,key:`${V}[${me}]`}));return oe}function $p(c){const o=c.key,f=c.value,E=c.valueSpec;let L=qa(f);return L==="number"&&f!=f&&(L="NaN"),L!=="number"?[new un(o,f,`number expected, ${L} found`)]:"minimum"in E&&f<E.minimum?[new un(o,f,`${f} is less than the minimum value ${E.minimum}`)]:"maximum"in E&&f>E.maximum?[new un(o,f,`${f} is greater than the maximum value ${E.maximum}`)]:[]}function Jh(c){const o=c.valueSpec,f=Fs(c.value.type);let E,L,V,X={};const J=f!=="categorical"&&c.value.property===void 0,oe=!J,me=qa(c.value.stops)==="array"&&qa(c.value.stops[0])==="array"&&qa(c.value.stops[0][0])==="object",Me=Ru({key:c.key,value:c.value,valueSpec:c.styleSpec.function,validateSpec:c.validateSpec,style:c.style,styleSpec:c.styleSpec,objectElementValidators:{stops:function(ot){if(f==="identity")return[new un(ot.key,ot.value,'identity function may not have a "stops" property')];let lt=[];const Ct=ot.value;return lt=lt.concat(jc({key:ot.key,value:Ct,valueSpec:ot.valueSpec,validateSpec:ot.validateSpec,style:ot.style,styleSpec:ot.styleSpec,arrayElementValidator:De})),qa(Ct)==="array"&&Ct.length===0&&lt.push(new un(ot.key,Ct,"array must have at least one stop")),lt},default:function(ot){return ot.validateSpec({key:ot.key,value:ot.value,valueSpec:o,validateSpec:ot.validateSpec,style:ot.style,styleSpec:ot.styleSpec})}}});return f==="identity"&&J&&Me.push(new un(c.key,c.value,'missing required property "property"')),f==="identity"||c.value.stops||Me.push(new un(c.key,c.value,'missing required property "stops"')),f==="exponential"&&c.valueSpec.expression&&!xh(c.valueSpec)&&Me.push(new un(c.key,c.value,"exponential functions not supported")),c.styleSpec.$version>=8&&(oe&&!th(c.valueSpec)?Me.push(new un(c.key,c.value,"property functions not supported")):J&&!vu(c.valueSpec)&&Me.push(new un(c.key,c.value,"zoom functions not supported"))),f!=="categorical"&&!me||c.value.property!==void 0||Me.push(new un(c.key,c.value,'"property" property is required')),Me;function De(ot){let lt=[];const Ct=ot.value,Gt=ot.key;if(qa(Ct)!=="array")return[new un(Gt,Ct,`array expected, ${qa(Ct)} found`)];if(Ct.length!==2)return[new un(Gt,Ct,`array length 2 expected, length ${Ct.length} found`)];if(me){if(qa(Ct[0])!=="object")return[new un(Gt,Ct,`object expected, ${qa(Ct[0])} found`)];if(Ct[0].zoom===void 0)return[new un(Gt,Ct,"object stop key must have zoom")];if(Ct[0].value===void 0)return[new un(Gt,Ct,"object stop key must have value")];if(V&&V>Fs(Ct[0].zoom))return[new un(Gt,Ct[0].zoom,"stop zoom values must appear in ascending order")];Fs(Ct[0].zoom)!==V&&(V=Fs(Ct[0].zoom),L=void 0,X={}),lt=lt.concat(Ru({key:`${Gt}[0]`,value:Ct[0],valueSpec:{zoom:{}},validateSpec:ot.validateSpec,style:ot.style,styleSpec:ot.styleSpec,objectElementValidators:{zoom:$p,value:Ye}}))}else lt=lt.concat(Ye({key:`${Gt}[0]`,value:Ct[0],valueSpec:{},validateSpec:ot.validateSpec,style:ot.style,styleSpec:ot.styleSpec},Ct));return Bs(Tc(Ct[1]))?lt.concat([new un(`${Gt}[1]`,Ct[1],"expressions are not allowed in function stops.")]):lt.concat(ot.validateSpec({key:`${Gt}[1]`,value:Ct[1],valueSpec:o,validateSpec:ot.validateSpec,style:ot.style,styleSpec:ot.styleSpec}))}function Ye(ot,lt){const Ct=qa(ot.value),Gt=Fs(ot.value),Kt=ot.value!==null?ot.value:lt;if(E){if(Ct!==E)return[new un(ot.key,Kt,`${Ct} stop domain type must match previous stop domain type ${E}`)]}else E=Ct;if(Ct!=="number"&&Ct!=="string"&&Ct!=="boolean")return[new un(ot.key,Kt,"stop domain value must be a number, string, or boolean")];if(Ct!=="number"&&f!=="categorical"){let Er=`number expected, ${Ct} found`;return th(o)&&f===void 0&&(Er+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new un(ot.key,Kt,Er)]}return f!=="categorical"||Ct!=="number"||isFinite(Gt)&&Math.floor(Gt)===Gt?f!=="categorical"&&Ct==="number"&&L!==void 0&&Gt<L?[new un(ot.key,Kt,"stop domain values must appear in ascending order")]:(L=Gt,f==="categorical"&&Gt in X?[new un(ot.key,Kt,"stop domain values must be unique")]:(X[Gt]=!0,[])):[new un(ot.key,Kt,`integer expected, found ${Gt}`)]}}function Ac(c){const o=(c.expressionContext==="property"?$h:wc)(Tc(c.value),c.valueSpec);if(o.result==="error")return o.value.map(E=>new un(`${c.key}${E.key}`,c.value,E.message));const f=o.value.expression||o.value._styleExpression.expression;if(c.expressionContext==="property"&&c.propertyKey==="text-font"&&!f.outputDefined())return[new un(c.key,c.value,`Invalid data expression for "${c.propertyKey}". Output values must be contained as literals within the expression.`)];if(c.expressionContext==="property"&&c.propertyType==="layout"&&!lo(f))return[new un(c.key,c.value,'"feature-state" data expressions are not supported with layout properties.')];if(c.expressionContext==="filter"&&!lo(f))return[new un(c.key,c.value,'"feature-state" data expressions are not supported with filters.')];if(c.expressionContext&&c.expressionContext.indexOf("cluster")===0){if(!bs(f,["zoom","feature-state"]))return[new un(c.key,c.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(c.expressionContext==="cluster-initial"&&!Ku(f))return[new un(c.key,c.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function kh(c){const o=c.key,f=c.value,E=c.valueSpec,L=[];return Array.isArray(E.values)?E.values.indexOf(Fs(f))===-1&&L.push(new un(o,f,`expected one of [${E.values.join(", ")}], ${JSON.stringify(f)} found`)):Object.keys(E.values).indexOf(Fs(f))===-1&&L.push(new un(o,f,`expected one of [${Object.keys(E.values).join(", ")}], ${JSON.stringify(f)} found`)),L}function Iu(c){return dl(Tc(c.value))?Ac(To({},c,{expressionContext:"filter",valueSpec:{value:"boolean"}})):rh(c)}function rh(c){const o=c.value,f=c.key;if(qa(o)!=="array")return[new un(f,o,`array expected, ${qa(o)} found`)];const E=c.styleSpec;let L,V=[];if(o.length<1)return[new un(f,o,"filter array must have at least 1 element")];switch(V=V.concat(kh({key:`${f}[0]`,value:o[0],valueSpec:E.filter_operator,style:c.style,styleSpec:c.styleSpec})),Fs(o[0])){case"<":case"<=":case">":case">=":o.length>=2&&Fs(o[1])==="$type"&&V.push(new un(f,o,`"$type" cannot be use with operator "${o[0]}"`));case"==":case"!=":o.length!==3&&V.push(new un(f,o,`filter array for operator "${o[0]}" must have 3 elements`));case"in":case"!in":o.length>=2&&(L=qa(o[1]),L!=="string"&&V.push(new un(`${f}[1]`,o[1],`string expected, ${L} found`)));for(let X=2;X<o.length;X++)L=qa(o[X]),Fs(o[1])==="$type"?V=V.concat(kh({key:`${f}[${X}]`,value:o[X],valueSpec:E.geometry_type,style:c.style,styleSpec:c.styleSpec})):L!=="string"&&L!=="number"&&L!=="boolean"&&V.push(new un(`${f}[${X}]`,o[X],`string, number, or boolean expected, ${L} found`));break;case"any":case"all":case"none":for(let X=1;X<o.length;X++)V=V.concat(rh({key:`${f}[${X}]`,value:o[X],style:c.style,styleSpec:c.styleSpec}));break;case"has":case"!has":L=qa(o[1]),o.length!==2?V.push(new un(f,o,`filter array for "${o[0]}" operator must have 2 elements`)):L!=="string"&&V.push(new un(`${f}[1]`,o[1],`string expected, ${L} found`));break;case"within":L=qa(o[1]),o.length!==2?V.push(new un(f,o,`filter array for "${o[0]}" operator must have 2 elements`)):L!=="object"&&V.push(new un(`${f}[1]`,o[1],`object expected, ${L} found`))}return V}function gp(c,o){const f=c.key,E=c.validateSpec,L=c.style,V=c.styleSpec,X=c.value,J=c.objectKey,oe=V[`${o}_${c.layerType}`];if(!oe)return[];const me=J.match(/^(.*)-transition$/);if(o==="paint"&&me&&oe[me[1]]&&oe[me[1]].transition)return E({key:f,value:X,valueSpec:V.transition,style:L,styleSpec:V});const Me=c.valueSpec||oe[J];if(!Me)return[new un(f,X,`unknown property "${J}"`)];let De;if(qa(X)==="string"&&th(Me)&&!Me.tokens&&(De=/^{([^}]+)}$/.exec(X)))return[new un(f,X,`"${J}" does not support interpolation syntax
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(De[1])} }\`.`)];const Ye=[];return c.layerType==="symbol"&&(J==="text-field"&&L&&!L.glyphs&&Ye.push(new un(f,X,'use of "text-field" requires a style "glyphs" property')),J==="text-font"&&Hs(Tc(X))&&Fs(X.type)==="identity"&&Ye.push(new un(f,X,'"text-font" does not support identity functions'))),Ye.concat(E({key:c.key,value:X,valueSpec:Me,style:L,styleSpec:V,expressionContext:"property",propertyType:o,propertyKey:J}))}function vp(c){return gp(c,"paint")}function Kp(c){return gp(c,"layout")}function Hc(c){let o=[];const f=c.value,E=c.key,L=c.style,V=c.styleSpec;f.type||f.ref||o.push(new un(E,f,'either "type" or "ref" is required'));let X=Fs(f.type);const J=Fs(f.ref);if(f.id){const oe=Fs(f.id);for(let me=0;me<c.arrayIndex;me++){const Me=L.layers[me];Fs(Me.id)===oe&&o.push(new un(E,f.id,`duplicate layer id "${f.id}", previously used at line ${Me.id.__line__}`))}}if("ref"in f){let oe;["type","source","source-layer","filter","layout"].forEach(me=>{me in f&&o.push(new un(E,f[me],`"${me}" is prohibited for ref layers`))}),L.layers.forEach(me=>{Fs(me.id)===J&&(oe=me)}),oe?oe.ref?o.push(new un(E,f.ref,"ref cannot reference another ref layer")):X=Fs(oe.type):o.push(new un(E,f.ref,`ref layer "${J}" not found`))}else if(X!=="background")if(f.source){const oe=L.sources&&L.sources[f.source],me=oe&&Fs(oe.type);oe?me==="vector"&&X==="raster"?o.push(new un(E,f.source,`layer "${f.id}" requires a raster source`)):me!=="raster-dem"&&X==="hillshade"?o.push(new un(E,f.source,`layer "${f.id}" requires a raster-dem source`)):me==="raster"&&X!=="raster"?o.push(new un(E,f.source,`layer "${f.id}" requires a vector source`)):me!=="vector"||f["source-layer"]?me==="raster-dem"&&X!=="hillshade"?o.push(new un(E,f.source,"raster-dem source can only be used with layer type 'hillshade'.")):X!=="line"||!f.paint||!f.paint["line-gradient"]||me==="geojson"&&oe.lineMetrics||o.push(new un(E,f,`layer "${f.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):o.push(new un(E,f,`layer "${f.id}" must specify a "source-layer"`)):o.push(new un(E,f.source,`source "${f.source}" not found`))}else o.push(new un(E,f,'missing required property "source"'));return o=o.concat(Ru({key:E,value:f,valueSpec:V.layer,style:c.style,styleSpec:c.styleSpec,validateSpec:c.validateSpec,objectElementValidators:{"*":()=>[],type:()=>c.validateSpec({key:`${E}.type`,value:f.type,valueSpec:V.layer.type,style:c.style,styleSpec:c.styleSpec,validateSpec:c.validateSpec,object:f,objectKey:"type"}),filter:Iu,layout:oe=>Ru({layer:f,key:oe.key,value:oe.value,style:oe.style,styleSpec:oe.styleSpec,validateSpec:oe.validateSpec,objectElementValidators:{"*":me=>Kp(To({layerType:X},me))}}),paint:oe=>Ru({layer:f,key:oe.key,value:oe.value,style:oe.style,styleSpec:oe.styleSpec,validateSpec:oe.validateSpec,objectElementValidators:{"*":me=>vp(To({layerType:X},me))}})}})),o}function Eh(c){const o=c.value,f=c.key,E=qa(o);return E!=="string"?[new un(f,o,`string expected, ${E} found`)]:[]}const yu={promoteId:function({key:c,value:o}){if(qa(o)==="string")return Eh({key:c,value:o});{const f=[];for(const E in o)f.push(...Eh({key:`${c}.${E}`,value:o[E]}));return f}}};function Ya(c){const o=c.value,f=c.key,E=c.styleSpec,L=c.style,V=c.validateSpec;if(!o.type)return[new un(f,o,'"type" is required')];const X=Fs(o.type);let J;switch(X){case"vector":case"raster":return J=Ru({key:f,value:o,valueSpec:E[`source_${X.replace("-","_")}`],style:c.style,styleSpec:E,objectElementValidators:yu,validateSpec:V}),J;case"raster-dem":return J=function(oe){var me;const Me=(me=oe.sourceName)!==null&&me!==void 0?me:"",De=oe.value,Ye=oe.styleSpec,ot=Ye.source_raster_dem,lt=oe.style;let Ct=[];const Gt=qa(De);if(De===void 0)return Ct;if(Gt!=="object")return Ct.push(new un("source_raster_dem",De,`object expected, ${Gt} found`)),Ct;const Kt=Fs(De.encoding)==="custom",Er=["redFactor","greenFactor","blueFactor","baseShift"],cr=oe.value.encoding?`"${oe.value.encoding}"`:"Default";for(const Rr in De)!Kt&&Er.includes(Rr)?Ct.push(new un(Rr,De[Rr],`In "${Me}": "${Rr}" is only valid when "encoding" is set to "custom". ${cr} encoding found`)):ot[Rr]?Ct=Ct.concat(oe.validateSpec({key:Rr,value:De[Rr],valueSpec:ot[Rr],validateSpec:oe.validateSpec,style:lt,styleSpec:Ye})):Ct.push(new un(Rr,De[Rr],`unknown property "${Rr}"`));return Ct}({sourceName:f,value:o,style:c.style,styleSpec:E,validateSpec:V}),J;case"geojson":if(J=Ru({key:f,value:o,valueSpec:E.source_geojson,style:L,styleSpec:E,validateSpec:V,objectElementValidators:yu}),o.cluster)for(const oe in o.clusterProperties){const[me,Me]=o.clusterProperties[oe],De=typeof me=="string"?[me,["accumulated"],["get",oe]]:me;J.push(...Ac({key:`${f}.${oe}.map`,value:Me,validateSpec:V,expressionContext:"cluster-map"})),J.push(...Ac({key:`${f}.${oe}.reduce`,value:De,validateSpec:V,expressionContext:"cluster-reduce"}))}return J;case"video":return Ru({key:f,value:o,valueSpec:E.source_video,style:L,validateSpec:V,styleSpec:E});case"image":return Ru({key:f,value:o,valueSpec:E.source_image,style:L,validateSpec:V,styleSpec:E});case"canvas":return[new un(f,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return kh({key:`${f}.type`,value:o.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:L,validateSpec:V,styleSpec:E})}}function nh(c){const o=c.value,f=c.styleSpec,E=f.light,L=c.style;let V=[];const X=qa(o);if(o===void 0)return V;if(X!=="object")return V=V.concat([new un("light",o,`object expected, ${X} found`)]),V;for(const J in o){const oe=J.match(/^(.*)-transition$/);V=V.concat(oe&&E[oe[1]]&&E[oe[1]].transition?c.validateSpec({key:J,value:o[J],valueSpec:f.transition,validateSpec:c.validateSpec,style:L,styleSpec:f}):E[J]?c.validateSpec({key:J,value:o[J],valueSpec:E[J],validateSpec:c.validateSpec,style:L,styleSpec:f}):[new un(J,o[J],`unknown property "${J}"`)])}return V}function Gc(c){const o=c.value,f=c.styleSpec,E=f.terrain,L=c.style;let V=[];const X=qa(o);if(o===void 0)return V;if(X!=="object")return V=V.concat([new un("terrain",o,`object expected, ${X} found`)]),V;for(const J in o)V=V.concat(E[J]?c.validateSpec({key:J,value:o[J],valueSpec:E[J],validateSpec:c.validateSpec,style:L,styleSpec:f}):[new un(J,o[J],`unknown property "${J}"`)]);return V}function ih(c){let o=[];const f=c.value,E=c.key;if(Array.isArray(f)){const L=[],V=[];for(const X in f)f[X].id&&L.includes(f[X].id)&&o.push(new un(E,f,`all the sprites' ids must be unique, but ${f[X].id} is duplicated`)),L.push(f[X].id),f[X].url&&V.includes(f[X].url)&&o.push(new un(E,f,`all the sprites' URLs must be unique, but ${f[X].url} is duplicated`)),V.push(f[X].url),o=o.concat(Ru({key:`${E}[${X}]`,value:f[X],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:c.validateSpec}));return o}return Eh({key:E,value:f})}const Sa={"*":()=>[],array:jc,boolean:function(c){const o=c.value,f=c.key,E=qa(o);return E!=="boolean"?[new un(f,o,`boolean expected, ${E} found`)]:[]},number:$p,color:function(c){const o=c.key,f=c.value,E=qa(f);return E!=="string"?[new un(o,f,`color expected, ${E} found`)]:Yo.parse(String(f))?[]:[new un(o,f,`color expected, "${f}" found`)]},constants:Ll,enum:kh,filter:Iu,function:Jh,layer:Hc,object:Ru,source:Ya,light:nh,terrain:Gc,string:Eh,formatted:function(c){return Eh(c).length===0?[]:Ac(c)},resolvedImage:function(c){return Eh(c).length===0?[]:Ac(c)},padding:function(c){const o=c.key,f=c.value;if(qa(f)==="array"){if(f.length<1||f.length>4)return[new un(o,f,`padding requires 1 to 4 values; ${f.length} values found`)];const E={type:"number"};let L=[];for(let V=0;V<f.length;V++)L=L.concat(c.validateSpec({key:`${o}[${V}]`,value:f[V],validateSpec:c.validateSpec,valueSpec:E}));return L}return $p({key:o,value:f,valueSpec:{}})},variableAnchorOffsetCollection:function(c){const o=c.key,f=c.value,E=qa(f),L=c.styleSpec;if(E!=="array"||f.length<1||f.length%2!=0)return[new un(o,f,"variableAnchorOffsetCollection requires a non-empty array of even length")];let V=[];for(let X=0;X<f.length;X+=2)V=V.concat(kh({key:`${o}[${X}]`,value:f[X],valueSpec:L.layout_symbol["text-anchor"]})),V=V.concat(jc({key:`${o}[${X+1}]`,value:f[X+1],valueSpec:{length:2,value:"number"},validateSpec:c.validateSpec,style:c.style,styleSpec:L}));return V},sprite:ih};function cs(c){const o=c.value,f=c.valueSpec,E=c.styleSpec;return c.validateSpec=cs,f.expression&&Hs(Fs(o))?Jh(c):f.expression&&Bs(Tc(o))?Ac(c):f.type&&Sa[f.type]?Sa[f.type](c):Ru(To({},c,{valueSpec:f.type?E[f.type]:f}))}function ku(c){const o=c.value,f=c.key,E=Eh(c);return E.length||(o.indexOf("{fontstack}")===-1&&E.push(new un(f,o,'"glyphs" url must include a "{fontstack}" token')),o.indexOf("{range}")===-1&&E.push(new un(f,o,'"glyphs" url must include a "{range}" token'))),E}function rc(c,o=Ur){let f=[];return f=f.concat(cs({key:"",value:c,valueSpec:o.$root,styleSpec:o,style:c,validateSpec:cs,objectElementValidators:{glyphs:ku,"*":()=>[]}})),c.constants&&(f=f.concat(Ll({key:"constants",value:c.constants,style:c,styleSpec:o,validateSpec:cs}))),oh(f)}function xu(c){return function(o){return c(KS($S({},o),{validateSpec:cs}))}}function oh(c){return[].concat(c).sort((o,f)=>o.line-f.line)}function Cc(c){return function(...o){return oh(c.apply(this,o))}}rc.source=Cc(xu(Ya)),rc.sprite=Cc(xu(ih)),rc.glyphs=Cc(xu(ku)),rc.light=Cc(xu(nh)),rc.terrain=Cc(xu(Gc)),rc.layer=Cc(xu(Hc)),rc.filter=Cc(xu(Iu)),rc.paintProperty=Cc(xu(vp)),rc.layoutProperty=Cc(xu(Kp));const ah=rc,Qh=ah.light,sh=ah.paintProperty,Ul=ah.layoutProperty;function ll(c,o){let f=!1;if(o&&o.length)for(const E of o)c.fire(new Pi(new Error(E.message))),f=!0;return f}class Wc{constructor(o,f,E){const L=this.cells=[];if(o instanceof ArrayBuffer){this.arrayBuffer=o;const X=new Int32Array(this.arrayBuffer);o=X[0],this.d=(f=X[1])+2*(E=X[2]);for(let oe=0;oe<this.d*this.d;oe++){const me=X[3+oe],Me=X[3+oe+1];L.push(me===Me?null:X.subarray(me,Me))}const J=X[3+L.length+1];this.keys=X.subarray(X[3+L.length],J),this.bboxes=X.subarray(J),this.insert=this._insertReadonly}else{this.d=f+2*E;for(let X=0;X<this.d*this.d;X++)L.push([]);this.keys=[],this.bboxes=[]}this.n=f,this.extent=o,this.padding=E,this.scale=f/o,this.uid=0;const V=E/f*o;this.min=-V,this.max=o+V}insert(o,f,E,L,V){this._forEachCell(f,E,L,V,this._insertCell,this.uid++,void 0,void 0),this.keys.push(o),this.bboxes.push(f),this.bboxes.push(E),this.bboxes.push(L),this.bboxes.push(V)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(o,f,E,L,V,X){this.cells[V].push(X)}query(o,f,E,L,V){const X=this.min,J=this.max;if(o<=X&&f<=X&&J<=E&&J<=L&&!V)return Array.prototype.slice.call(this.keys);{const oe=[];return this._forEachCell(o,f,E,L,this._queryCell,oe,{},V),oe}}_queryCell(o,f,E,L,V,X,J,oe){const me=this.cells[V];if(me!==null){const Me=this.keys,De=this.bboxes;for(let Ye=0;Ye<me.length;Ye++){const ot=me[Ye];if(J[ot]===void 0){const lt=4*ot;(oe?oe(De[lt+0],De[lt+1],De[lt+2],De[lt+3]):o<=De[lt+2]&&f<=De[lt+3]&&E>=De[lt+0]&&L>=De[lt+1])?(J[ot]=!0,X.push(Me[ot])):J[ot]=!1}}}}_forEachCell(o,f,E,L,V,X,J,oe){const me=this._convertToCellCoord(o),Me=this._convertToCellCoord(f),De=this._convertToCellCoord(E),Ye=this._convertToCellCoord(L);for(let ot=me;ot<=De;ot++)for(let lt=Me;lt<=Ye;lt++){const Ct=this.d*lt+ot;if((!oe||oe(this._convertFromCellCoord(ot),this._convertFromCellCoord(lt),this._convertFromCellCoord(ot+1),this._convertFromCellCoord(lt+1)))&&V.call(this,o,f,E,L,Ct,X,J,oe))return}}_convertFromCellCoord(o){return(o-this.padding)/this.scale}_convertToCellCoord(o){return Math.max(0,Math.min(this.d-1,Math.floor(o*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const o=this.cells,f=3+this.cells.length+1+1;let E=0;for(let X=0;X<this.cells.length;X++)E+=this.cells[X].length;const L=new Int32Array(f+E+this.keys.length+this.bboxes.length);L[0]=this.extent,L[1]=this.n,L[2]=this.padding;let V=f;for(let X=0;X<o.length;X++){const J=o[X];L[3+X]=V,L.set(J,V),V+=J.length}return L[3+o.length]=V,L.set(this.keys,V),V+=this.keys.length,L[3+o.length+1]=V,L.set(this.bboxes,V),V+=this.bboxes.length,L.buffer}static serialize(o,f){const E=o.toArrayBuffer();return f&&f.push(E),{buffer:E}}static deserialize(o){return new Wc(o.buffer)}}const vl={};function oi(c,o,f={}){if(vl[c])throw new Error(`${c} is already registered.`);Object.defineProperty(o,"_classRegistryKey",{value:c,writeable:!1}),vl[c]={klass:o,omit:f.omit||[],shallow:f.shallow||[]}}oi("Object",Object),oi("TransferableGridIndex",Wc),oi("Color",Yo),oi("Error",Error),oi("AJAXError",Uo),oi("ResolvedImage",Fa),oi("StylePropertyFunction",Xo),oi("StyleExpression",es,{omit:["_evaluator"]}),oi("ZoomDependentExpression",Sc),oi("ZoomConstantExpression",qp),oi("CompoundExpression",Ni,{omit:["_evaluate"]});for(const c in dp)dp[c]._classRegistryKey||oi(`Expression_${c}`,dp[c]);function fi(c){return c&&typeof ArrayBuffer!="undefined"&&(c instanceof ArrayBuffer||c.constructor&&c.constructor.name==="ArrayBuffer")}function tu(c,o){if(c==null||typeof c=="boolean"||typeof c=="number"||typeof c=="string"||c instanceof Boolean||c instanceof Number||c instanceof String||c instanceof Date||c instanceof RegExp||c instanceof Blob)return c;if(fi(c)||Pt(c))return o&&o.push(c),c;if(ArrayBuffer.isView(c)){const f=c;return o&&o.push(f.buffer),f}if(c instanceof ImageData)return o&&o.push(c.data.buffer),c;if(Array.isArray(c)){const f=[];for(const E of c)f.push(tu(E,o));return f}if(typeof c=="object"){const f=c.constructor,E=f._classRegistryKey;if(!E)throw new Error("can't serialize object of unregistered class");if(!vl[E])throw new Error(`${E} is not registered.`);const L=f.serialize?f.serialize(c,o):{};if(f.serialize){if(o&&L===o[o.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const V in c){if(!c.hasOwnProperty(V)||vl[E].omit.indexOf(V)>=0)continue;const X=c[V];L[V]=vl[E].shallow.indexOf(V)>=0?X:tu(X,o)}c instanceof Error&&(L.message=c.message)}if(L.$name)throw new Error("$name property is reserved for worker serialization logic.");return E!=="Object"&&(L.$name=E),L}throw new Error("can't serialize object of type "+typeof c)}function bu(c){if(c==null||typeof c=="boolean"||typeof c=="number"||typeof c=="string"||c instanceof Boolean||c instanceof Number||c instanceof String||c instanceof Date||c instanceof RegExp||c instanceof Blob||fi(c)||Pt(c)||ArrayBuffer.isView(c)||c instanceof ImageData)return c;if(Array.isArray(c))return c.map(bu);if(typeof c=="object"){const o=c.$name||"Object";if(!vl[o])throw new Error(`can't deserialize unregistered class ${o}`);const{klass:f}=vl[o];if(!f)throw new Error(`can't deserialize unregistered class ${o}`);if(f.deserialize)return f.deserialize(c);const E=Object.create(f.prototype);for(const L of Object.keys(c)){if(L==="$name")continue;const V=c[L];E[L]=vl[o].shallow.indexOf(L)>=0?V:bu(V)}return E}throw new Error("can't deserialize object of type "+typeof c)}class Dp{constructor(){this.first=!0}update(o,f){const E=Math.floor(o);return this.first?(this.first=!1,this.lastIntegerZoom=E,this.lastIntegerZoomTime=0,this.lastZoom=o,this.lastFloorZoom=E,!0):(this.lastFloorZoom>E?(this.lastIntegerZoom=E+1,this.lastIntegerZoomTime=f):this.lastFloorZoom<E&&(this.lastIntegerZoom=E,this.lastIntegerZoomTime=f),o!==this.lastZoom&&(this.lastZoom=o,this.lastFloorZoom=E,!0))}}const ai={"Latin-1 Supplement":c=>c>=128&&c<=255,Arabic:c=>c>=1536&&c<=1791,"Arabic Supplement":c=>c>=1872&&c<=1919,"Arabic Extended-A":c=>c>=2208&&c<=2303,"Hangul Jamo":c=>c>=4352&&c<=4607,"Unified Canadian Aboriginal Syllabics":c=>c>=5120&&c<=5759,Khmer:c=>c>=6016&&c<=6143,"Unified Canadian Aboriginal Syllabics Extended":c=>c>=6320&&c<=6399,"General Punctuation":c=>c>=8192&&c<=8303,"Letterlike Symbols":c=>c>=8448&&c<=8527,"Number Forms":c=>c>=8528&&c<=8591,"Miscellaneous Technical":c=>c>=8960&&c<=9215,"Control Pictures":c=>c>=9216&&c<=9279,"Optical Character Recognition":c=>c>=9280&&c<=9311,"Enclosed Alphanumerics":c=>c>=9312&&c<=9471,"Geometric Shapes":c=>c>=9632&&c<=9727,"Miscellaneous Symbols":c=>c>=9728&&c<=9983,"Miscellaneous Symbols and Arrows":c=>c>=11008&&c<=11263,"CJK Radicals Supplement":c=>c>=11904&&c<=12031,"Kangxi Radicals":c=>c>=12032&&c<=12255,"Ideographic Description Characters":c=>c>=12272&&c<=12287,"CJK Symbols and Punctuation":c=>c>=12288&&c<=12351,Hiragana:c=>c>=12352&&c<=12447,Katakana:c=>c>=12448&&c<=12543,Bopomofo:c=>c>=12544&&c<=12591,"Hangul Compatibility Jamo":c=>c>=12592&&c<=12687,Kanbun:c=>c>=12688&&c<=12703,"Bopomofo Extended":c=>c>=12704&&c<=12735,"CJK Strokes":c=>c>=12736&&c<=12783,"Katakana Phonetic Extensions":c=>c>=12784&&c<=12799,"Enclosed CJK Letters and Months":c=>c>=12800&&c<=13055,"CJK Compatibility":c=>c>=13056&&c<=13311,"CJK Unified Ideographs Extension A":c=>c>=13312&&c<=19903,"Yijing Hexagram Symbols":c=>c>=19904&&c<=19967,"CJK Unified Ideographs":c=>c>=19968&&c<=40959,"Yi Syllables":c=>c>=40960&&c<=42127,"Yi Radicals":c=>c>=42128&&c<=42191,"Hangul Jamo Extended-A":c=>c>=43360&&c<=43391,"Hangul Syllables":c=>c>=44032&&c<=55215,"Hangul Jamo Extended-B":c=>c>=55216&&c<=55295,"Private Use Area":c=>c>=57344&&c<=63743,"CJK Compatibility Ideographs":c=>c>=63744&&c<=64255,"Arabic Presentation Forms-A":c=>c>=64336&&c<=65023,"Vertical Forms":c=>c>=65040&&c<=65055,"CJK Compatibility Forms":c=>c>=65072&&c<=65103,"Small Form Variants":c=>c>=65104&&c<=65135,"Arabic Presentation Forms-B":c=>c>=65136&&c<=65279,"Halfwidth and Fullwidth Forms":c=>c>=65280&&c<=65519};function is(c){for(const o of c)if(Mc(o.charCodeAt(0)))return!0;return!1}function ep(c){for(const o of c)if(!mi(o.charCodeAt(0)))return!1;return!0}function mi(c){return!(ai.Arabic(c)||ai["Arabic Supplement"](c)||ai["Arabic Extended-A"](c)||ai["Arabic Presentation Forms-A"](c)||ai["Arabic Presentation Forms-B"](c))}function Mc(c){return!(c!==746&&c!==747&&(c<4352||!(ai["Bopomofo Extended"](c)||ai.Bopomofo(c)||ai["CJK Compatibility Forms"](c)&&!(c>=65097&&c<=65103)||ai["CJK Compatibility Ideographs"](c)||ai["CJK Compatibility"](c)||ai["CJK Radicals Supplement"](c)||ai["CJK Strokes"](c)||!(!ai["CJK Symbols and Punctuation"](c)||c>=12296&&c<=12305||c>=12308&&c<=12319||c===12336)||ai["CJK Unified Ideographs Extension A"](c)||ai["CJK Unified Ideographs"](c)||ai["Enclosed CJK Letters and Months"](c)||ai["Hangul Compatibility Jamo"](c)||ai["Hangul Jamo Extended-A"](c)||ai["Hangul Jamo Extended-B"](c)||ai["Hangul Jamo"](c)||ai["Hangul Syllables"](c)||ai.Hiragana(c)||ai["Ideographic Description Characters"](c)||ai.Kanbun(c)||ai["Kangxi Radicals"](c)||ai["Katakana Phonetic Extensions"](c)||ai.Katakana(c)&&c!==12540||!(!ai["Halfwidth and Fullwidth Forms"](c)||c===65288||c===65289||c===65293||c>=65306&&c<=65310||c===65339||c===65341||c===65343||c>=65371&&c<=65503||c===65507||c>=65512&&c<=65519)||!(!ai["Small Form Variants"](c)||c>=65112&&c<=65118||c>=65123&&c<=65126)||ai["Unified Canadian Aboriginal Syllabics"](c)||ai["Unified Canadian Aboriginal Syllabics Extended"](c)||ai["Vertical Forms"](c)||ai["Yijing Hexagram Symbols"](c)||ai["Yi Syllables"](c)||ai["Yi Radicals"](c))))}function Op(c){return!(Mc(c)||function(o){return!!(ai["Latin-1 Supplement"](o)&&(o===167||o===169||o===174||o===177||o===188||o===189||o===190||o===215||o===247)||ai["General Punctuation"](o)&&(o===8214||o===8224||o===8225||o===8240||o===8241||o===8251||o===8252||o===8258||o===8263||o===8264||o===8265||o===8273)||ai["Letterlike Symbols"](o)||ai["Number Forms"](o)||ai["Miscellaneous Technical"](o)&&(o>=8960&&o<=8967||o>=8972&&o<=8991||o>=8996&&o<=9e3||o===9003||o>=9085&&o<=9114||o>=9150&&o<=9165||o===9167||o>=9169&&o<=9179||o>=9186&&o<=9215)||ai["Control Pictures"](o)&&o!==9251||ai["Optical Character Recognition"](o)||ai["Enclosed Alphanumerics"](o)||ai["Geometric Shapes"](o)||ai["Miscellaneous Symbols"](o)&&!(o>=9754&&o<=9759)||ai["Miscellaneous Symbols and Arrows"](o)&&(o>=11026&&o<=11055||o>=11088&&o<=11097||o>=11192&&o<=11243)||ai["CJK Symbols and Punctuation"](o)||ai.Katakana(o)||ai["Private Use Area"](o)||ai["CJK Compatibility Forms"](o)||ai["Small Form Variants"](o)||ai["Halfwidth and Fullwidth Forms"](o)||o===8734||o===8756||o===8757||o>=9984&&o<=10087||o>=10102&&o<=10131||o===65532||o===65533)}(c))}function Jp(c){return c>=1424&&c<=2303||ai["Arabic Presentation Forms-A"](c)||ai["Arabic Presentation Forms-B"](c)}function Xc(c,o){return!(!o&&Jp(c)||c>=2304&&c<=3583||c>=3840&&c<=4255||ai.Khmer(c))}function hc(c){for(const o of c)if(Jp(o.charCodeAt(0)))return!0;return!1}const wh="deferred",Pc="loading",Xl="loaded";let Rc=null,Eu="unavailable",lh=null;const tp=function(c){c&&typeof c=="string"&&c.indexOf("NetworkError")>-1&&(Eu="error"),Rc&&Rc(c)};function rp(){su.fire(new Vi("pluginStateChange",{pluginStatus:Eu,pluginURL:lh}))}const su=new ds,ql=function(){return Eu},fa=function(){if(Eu!==wh||!lh)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Eu=Pc,rp(),lh&&Mi({url:lh},c=>{c?tp(c):(Eu=Xl,rp())})},Rs={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Eu===Xl||Rs.applyArabicShaping!=null,isLoading:()=>Eu===Pc,setState(c){if(!Dt())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");Eu=c.pluginStatus,lh=c.pluginURL},isParsed(){if(!Dt())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Rs.applyArabicShaping!=null&&Rs.processBidirectionalText!=null&&Rs.processStyledBidirectionalText!=null},getPluginURL(){if(!Dt())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return lh}};class hs{constructor(o,f){this.zoom=o,f?(this.now=f.now,this.fadeDuration=f.fadeDuration,this.zoomHistory=f.zoomHistory,this.transition=f.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Dp,this.transition={})}isSupportedScript(o){return function(f,E){for(const L of f)if(!Xc(L.charCodeAt(0),E))return!1;return!0}(o,Rs.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const o=this.zoom,f=o-Math.floor(o),E=this.crossFadingFactor();return o>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:f+(1-f)*E}:{fromScale:.5,toScale:1,t:1-(1-E)*f}}}class lu{constructor(o,f){this.property=o,this.value=f,this.expression=function(E,L){if(Hs(E))return new Xo(E,L);if(Bs(E)){const V=$h(E,L);if(V.result==="error")throw new Error(V.value.map(X=>`${X.key}: ${X.message}`).join(", "));return V.value}{let V=E;return L.type==="color"&&typeof E=="string"?V=Yo.parse(E):L.type!=="padding"||typeof E!="number"&&!Array.isArray(E)?L.type==="variableAnchorOffsetCollection"&&Array.isArray(E)&&(V=Ba.parse(E)):V=us.parse(E),{kind:"constant",evaluate:()=>V}}}(f===void 0?o.specification.default:f,o.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(o,f,E){return this.property.possiblyEvaluate(this,o,f,E)}}class wu{constructor(o){this.property=o,this.value=new lu(o,void 0)}transitioned(o,f){return new ch(this.property,this.value,f,ki({},o.transition,this.transition),o.now)}untransitioned(){return new ch(this.property,this.value,null,{},0)}}class uh{constructor(o){this._properties=o,this._values=Object.create(o.defaultTransitionablePropertyValues)}getValue(o){return Jr(this._values[o].value.value)}setValue(o,f){Object.prototype.hasOwnProperty.call(this._values,o)||(this._values[o]=new wu(this._values[o].property)),this._values[o].value=new lu(this._values[o].property,f===null?void 0:Jr(f))}getTransition(o){return Jr(this._values[o].transition)}setTransition(o,f){Object.prototype.hasOwnProperty.call(this._values,o)||(this._values[o]=new wu(this._values[o].property)),this._values[o].transition=Jr(f)||void 0}serialize(){const o={};for(const f of Object.keys(this._values)){const E=this.getValue(f);E!==void 0&&(o[f]=E);const L=this.getTransition(f);L!==void 0&&(o[`${f}-transition`]=L)}return o}transitioned(o,f){const E=new Nu(this._properties);for(const L of Object.keys(this._values))E._values[L]=this._values[L].transitioned(o,f._values[L]);return E}untransitioned(){const o=new Nu(this._properties);for(const f of Object.keys(this._values))o._values[f]=this._values[f].untransitioned();return o}}class ch{constructor(o,f,E,L,V){this.property=o,this.value=f,this.begin=V+L.delay||0,this.end=this.begin+L.duration||0,o.specification.transition&&(L.delay||L.duration)&&(this.prior=E)}possiblyEvaluate(o,f,E){const L=o.now||0,V=this.value.possiblyEvaluate(o,f,E),X=this.prior;if(X){if(L>this.end)return this.prior=null,V;if(this.value.isDataDriven())return this.prior=null,V;if(L<this.begin)return X.possiblyEvaluate(o,f,E);{const J=(L-this.begin)/(this.end-this.begin);return this.property.interpolate(X.possiblyEvaluate(o,f,E),V,function(oe){if(oe<=0)return 0;if(oe>=1)return 1;const me=oe*oe,Me=me*oe;return 4*(oe<.5?Me:3*(oe-me)+Me-.75)}(J))}}return V}}class Nu{constructor(o){this._properties=o,this._values=Object.create(o.defaultTransitioningPropertyValues)}possiblyEvaluate(o,f,E){const L=new Si(this._properties);for(const V of Object.keys(this._values))L._values[V]=this._values[V].possiblyEvaluate(o,f,E);return L}hasTransition(){for(const o of Object.keys(this._values))if(this._values[o].prior)return!0;return!1}}class Qp{constructor(o){this._properties=o,this._values=Object.create(o.defaultPropertyValues)}hasValue(o){return this._values[o].value!==void 0}getValue(o){return Jr(this._values[o].value)}setValue(o,f){this._values[o]=new lu(this._values[o].property,f===null?void 0:Jr(f))}serialize(){const o={};for(const f of Object.keys(this._values)){const E=this.getValue(f);E!==void 0&&(o[f]=E)}return o}possiblyEvaluate(o,f,E){const L=new Si(this._properties);for(const V of Object.keys(this._values))L._values[V]=this._values[V].possiblyEvaluate(o,f,E);return L}}class Gi{constructor(o,f,E){this.property=o,this.value=f,this.parameters=E}isConstant(){return this.value.kind==="constant"}constantOr(o){return this.value.kind==="constant"?this.value.value:o}evaluate(o,f,E,L){return this.property.evaluate(this.value,this.parameters,o,f,E,L)}}class Si{constructor(o){this._properties=o,this._values=Object.create(o.defaultPossiblyEvaluatedValues)}get(o){return this._values[o]}}class ji{constructor(o){this.specification=o}possiblyEvaluate(o,f){if(o.isDataDriven())throw new Error("Value should not be data driven");return o.expression.evaluate(f)}interpolate(o,f,E){const L=Tl[this.specification.type];return L?L(o,f,E):o}}class ao{constructor(o,f){this.specification=o,this.overrides=f}possiblyEvaluate(o,f,E,L){return new Gi(this,o.expression.kind==="constant"||o.expression.kind==="camera"?{kind:"constant",value:o.expression.evaluate(f,null,{},E,L)}:o.expression,f)}interpolate(o,f,E){if(o.value.kind!=="constant"||f.value.kind!=="constant")return o;if(o.value.value===void 0||f.value.value===void 0)return new Gi(this,{kind:"constant",value:void 0},o.parameters);const L=Tl[this.specification.type];if(L){const V=L(o.value.value,f.value.value,E);return new Gi(this,{kind:"constant",value:V},o.parameters)}return o}evaluate(o,f,E,L,V,X){return o.kind==="constant"?o.value:o.evaluate(f,E,L,V,X)}}class Ic extends ao{possiblyEvaluate(o,f,E,L){if(o.value===void 0)return new Gi(this,{kind:"constant",value:void 0},f);if(o.expression.kind==="constant"){const V=o.expression.evaluate(f,null,{},E,L),X=o.property.specification.type==="resolvedImage"&&typeof V!="string"?V.name:V,J=this._calculate(X,X,X,f);return new Gi(this,{kind:"constant",value:J},f)}if(o.expression.kind==="camera"){const V=this._calculate(o.expression.evaluate({zoom:f.zoom-1}),o.expression.evaluate({zoom:f.zoom}),o.expression.evaluate({zoom:f.zoom+1}),f);return new Gi(this,{kind:"constant",value:V},f)}return new Gi(this,o.expression,f)}evaluate(o,f,E,L,V,X){if(o.kind==="source"){const J=o.evaluate(f,E,L,V,X);return this._calculate(J,J,J,f)}return o.kind==="composite"?this._calculate(o.evaluate({zoom:Math.floor(f.zoom)-1},E,L),o.evaluate({zoom:Math.floor(f.zoom)},E,L),o.evaluate({zoom:Math.floor(f.zoom)+1},E,L),f):o.value}_calculate(o,f,E,L){return L.zoom>L.zoomHistory.lastIntegerZoom?{from:o,to:f}:{from:E,to:f}}interpolate(o){return o}}class Gs{constructor(o){this.specification=o}possiblyEvaluate(o,f,E,L){if(o.value!==void 0){if(o.expression.kind==="constant"){const V=o.expression.evaluate(f,null,{},E,L);return this._calculate(V,V,V,f)}return this._calculate(o.expression.evaluate(new hs(Math.floor(f.zoom-1),f)),o.expression.evaluate(new hs(Math.floor(f.zoom),f)),o.expression.evaluate(new hs(Math.floor(f.zoom+1),f)),f)}}_calculate(o,f,E,L){return L.zoom>L.zoomHistory.lastIntegerZoom?{from:o,to:f}:{from:E,to:f}}interpolate(o){return o}}class Lc{constructor(o){this.specification=o}possiblyEvaluate(o,f,E,L){return!!o.expression.evaluate(f,null,{},E,L)}interpolate(){return!1}}class ul{constructor(o){this.properties=o,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const f in o){const E=o[f];E.specification.overridable&&this.overridableProperties.push(f);const L=this.defaultPropertyValues[f]=new lu(E,void 0),V=this.defaultTransitionablePropertyValues[f]=new wu(E);this.defaultTransitioningPropertyValues[f]=V.untransitioned(),this.defaultPossiblyEvaluatedValues[f]=L.possiblyEvaluate({})}}}oi("DataDrivenProperty",ao),oi("DataConstantProperty",ji),oi("CrossFadedDataDrivenProperty",Ic),oi("CrossFadedProperty",Gs),oi("ColorRampProperty",Lc);const Nh="-transition";class xa extends ds{constructor(o,f){if(super(),this.id=o.id,this.type=o.type,this._featureFilter={filter:()=>!0,needGeometry:!1},o.type!=="custom"&&(this.metadata=o.metadata,this.minzoom=o.minzoom,this.maxzoom=o.maxzoom,o.type!=="background"&&(this.source=o.source,this.sourceLayer=o["source-layer"],this.filter=o.filter),f.layout&&(this._unevaluatedLayout=new Qp(f.layout)),f.paint)){this._transitionablePaint=new uh(f.paint);for(const E in o.paint)this.setPaintProperty(E,o.paint[E],{validate:!1});for(const E in o.layout)this.setLayoutProperty(E,o.layout[E],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Si(f.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(o){return o==="visibility"?this.visibility:this._unevaluatedLayout.getValue(o)}setLayoutProperty(o,f,E={}){f!=null&&this._validate(Ul,`layers.${this.id}.layout.${o}`,o,f,E)||(o!=="visibility"?this._unevaluatedLayout.setValue(o,f):this.visibility=f)}getPaintProperty(o){return o.endsWith(Nh)?this._transitionablePaint.getTransition(o.slice(0,-11)):this._transitionablePaint.getValue(o)}setPaintProperty(o,f,E={}){if(f!=null&&this._validate(sh,`layers.${this.id}.paint.${o}`,o,f,E))return!1;if(o.endsWith(Nh))return this._transitionablePaint.setTransition(o.slice(0,-11),f||void 0),!1;{const L=this._transitionablePaint._values[o],V=L.property.specification["property-type"]==="cross-faded-data-driven",X=L.value.isDataDriven(),J=L.value;this._transitionablePaint.setValue(o,f),this._handleSpecialPaintPropertyUpdate(o);const oe=this._transitionablePaint._values[o].value;return oe.isDataDriven()||X||V||this._handleOverridablePaintPropertyUpdate(o,J,oe)}}_handleSpecialPaintPropertyUpdate(o){}_handleOverridablePaintPropertyUpdate(o,f,E){return!1}isHidden(o){return!!(this.minzoom&&o<this.minzoom)||!!(this.maxzoom&&o>=this.maxzoom)||this.visibility==="none"}updateTransitions(o){this._transitioningPaint=this._transitionablePaint.transitioned(o,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(o,f){o.getCrossfadeParameters&&(this._crossfadeParameters=o.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(o,void 0,f)),this.paint=this._transitioningPaint.possiblyEvaluate(o,void 0,f)}serialize(){const o={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(o.layout=o.layout||{},o.layout.visibility=this.visibility),jt(o,(f,E)=>!(f===void 0||E==="layout"&&!Object.keys(f).length||E==="paint"&&!Object.keys(f).length))}_validate(o,f,E,L,V={}){return(!V||V.validate!==!1)&&ll(this,o.call(ah,{key:f,layerType:this.type,objectKey:E,value:L,styleSpec:Ur,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const o in this.paint._values){const f=this.paint.get(o);if(f instanceof Gi&&th(f.property.specification)&&(f.value.kind==="source"||f.value.kind==="composite")&&f.value.isStateDependent)return!0}return!1}}const Al={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Lu{constructor(o,f){this._structArray=o,this._pos1=f*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ks{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(o,f){return o._trim(),f&&(o.isTransferred=!0,f.push(o.arrayBuffer)),{length:o.length,arrayBuffer:o.arrayBuffer}}static deserialize(o){const f=Object.create(this.prototype);return f.arrayBuffer=o.arrayBuffer,f.length=o.length,f.capacity=o.arrayBuffer.byteLength/f.bytesPerElement,f._refreshViews(),f}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(o){this.reserve(o),this.length=o}reserve(o){if(o>this.capacity){this.capacity=Math.max(o,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const f=this.uint8;this._refreshViews(),f&&this.uint8.set(f)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function _l(c,o=1){let f=0,E=0;return{members:c.map(L=>{const V=Al[L.type].BYTES_PER_ELEMENT,X=f=pc(f,Math.max(o,V)),J=L.components||1;return E=Math.max(E,V),f+=V*J,{name:L.name,type:L.type,components:J,offset:X}}),size:pc(f,Math.max(E,o)),alignment:o}}function pc(c,o){return Math.ceil(c/o)*o}class Du extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,f){const E=this.length;return this.resize(E+1),this.emplace(E,o,f)}emplace(o,f,E){const L=2*o;return this.int16[L+0]=f,this.int16[L+1]=E,o}}Du.prototype.bytesPerElement=4,oi("StructArrayLayout2i4",Du);class zh extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,f,E){const L=this.length;return this.resize(L+1),this.emplace(L,o,f,E)}emplace(o,f,E,L){const V=3*o;return this.int16[V+0]=f,this.int16[V+1]=E,this.int16[V+2]=L,o}}zh.prototype.bytesPerElement=6,oi("StructArrayLayout3i6",zh);class Su extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,f,E,L){const V=this.length;return this.resize(V+1),this.emplace(V,o,f,E,L)}emplace(o,f,E,L,V){const X=4*o;return this.int16[X+0]=f,this.int16[X+1]=E,this.int16[X+2]=L,this.int16[X+3]=V,o}}Su.prototype.bytesPerElement=8,oi("StructArrayLayout4i8",Su);class qc extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V,X){const J=this.length;return this.resize(J+1),this.emplace(J,o,f,E,L,V,X)}emplace(o,f,E,L,V,X,J){const oe=6*o;return this.int16[oe+0]=f,this.int16[oe+1]=E,this.int16[oe+2]=L,this.int16[oe+3]=V,this.int16[oe+4]=X,this.int16[oe+5]=J,o}}qc.prototype.bytesPerElement=12,oi("StructArrayLayout2i4i12",qc);class Sh extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V,X){const J=this.length;return this.resize(J+1),this.emplace(J,o,f,E,L,V,X)}emplace(o,f,E,L,V,X,J){const oe=4*o,me=8*o;return this.int16[oe+0]=f,this.int16[oe+1]=E,this.uint8[me+4]=L,this.uint8[me+5]=V,this.uint8[me+6]=X,this.uint8[me+7]=J,o}}Sh.prototype.bytesPerElement=8,oi("StructArrayLayout2i4ub8",Sh);class nc extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,f){const E=this.length;return this.resize(E+1),this.emplace(E,o,f)}emplace(o,f,E){const L=2*o;return this.float32[L+0]=f,this.float32[L+1]=E,o}}nc.prototype.bytesPerElement=8,oi("StructArrayLayout2f8",nc);class Yl extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V,X,J,oe,me,Me){const De=this.length;return this.resize(De+1),this.emplace(De,o,f,E,L,V,X,J,oe,me,Me)}emplace(o,f,E,L,V,X,J,oe,me,Me,De){const Ye=10*o;return this.uint16[Ye+0]=f,this.uint16[Ye+1]=E,this.uint16[Ye+2]=L,this.uint16[Ye+3]=V,this.uint16[Ye+4]=X,this.uint16[Ye+5]=J,this.uint16[Ye+6]=oe,this.uint16[Ye+7]=me,this.uint16[Ye+8]=Me,this.uint16[Ye+9]=De,o}}Yl.prototype.bytesPerElement=20,oi("StructArrayLayout10ui20",Yl);class Th extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V,X,J,oe,me,Me,De,Ye){const ot=this.length;return this.resize(ot+1),this.emplace(ot,o,f,E,L,V,X,J,oe,me,Me,De,Ye)}emplace(o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot){const lt=12*o;return this.int16[lt+0]=f,this.int16[lt+1]=E,this.int16[lt+2]=L,this.int16[lt+3]=V,this.uint16[lt+4]=X,this.uint16[lt+5]=J,this.uint16[lt+6]=oe,this.uint16[lt+7]=me,this.int16[lt+8]=Me,this.int16[lt+9]=De,this.int16[lt+10]=Ye,this.int16[lt+11]=ot,o}}Th.prototype.bytesPerElement=24,oi("StructArrayLayout4i4ui4i24",Th);class ba extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,f,E){const L=this.length;return this.resize(L+1),this.emplace(L,o,f,E)}emplace(o,f,E,L){const V=3*o;return this.float32[V+0]=f,this.float32[V+1]=E,this.float32[V+2]=L,o}}ba.prototype.bytesPerElement=12,oi("StructArrayLayout3f12",ba);class z extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(o){const f=this.length;return this.resize(f+1),this.emplace(f,o)}emplace(o,f){return this.uint32[1*o+0]=f,o}}z.prototype.bytesPerElement=4,oi("StructArrayLayout1ul4",z);class s extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V,X,J,oe,me){const Me=this.length;return this.resize(Me+1),this.emplace(Me,o,f,E,L,V,X,J,oe,me)}emplace(o,f,E,L,V,X,J,oe,me,Me){const De=10*o,Ye=5*o;return this.int16[De+0]=f,this.int16[De+1]=E,this.int16[De+2]=L,this.int16[De+3]=V,this.int16[De+4]=X,this.int16[De+5]=J,this.uint32[Ye+3]=oe,this.uint16[De+8]=me,this.uint16[De+9]=Me,o}}s.prototype.bytesPerElement=20,oi("StructArrayLayout6i1ul2ui20",s);class x extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V,X){const J=this.length;return this.resize(J+1),this.emplace(J,o,f,E,L,V,X)}emplace(o,f,E,L,V,X,J){const oe=6*o;return this.int16[oe+0]=f,this.int16[oe+1]=E,this.int16[oe+2]=L,this.int16[oe+3]=V,this.int16[oe+4]=X,this.int16[oe+5]=J,o}}x.prototype.bytesPerElement=12,oi("StructArrayLayout2i2i2i12",x);class I extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V){const X=this.length;return this.resize(X+1),this.emplace(X,o,f,E,L,V)}emplace(o,f,E,L,V,X){const J=4*o,oe=8*o;return this.float32[J+0]=f,this.float32[J+1]=E,this.float32[J+2]=L,this.int16[oe+6]=V,this.int16[oe+7]=X,o}}I.prototype.bytesPerElement=16,oi("StructArrayLayout2f1f2i16",I);class k extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,f,E,L){const V=this.length;return this.resize(V+1),this.emplace(V,o,f,E,L)}emplace(o,f,E,L,V){const X=12*o,J=3*o;return this.uint8[X+0]=f,this.uint8[X+1]=E,this.float32[J+1]=L,this.float32[J+2]=V,o}}k.prototype.bytesPerElement=12,oi("StructArrayLayout2ub2f12",k);class H extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,f,E){const L=this.length;return this.resize(L+1),this.emplace(L,o,f,E)}emplace(o,f,E,L){const V=3*o;return this.uint16[V+0]=f,this.uint16[V+1]=E,this.uint16[V+2]=L,o}}H.prototype.bytesPerElement=6,oi("StructArrayLayout3ui6",H);class ee extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot,lt,Ct,Gt,Kt){const Er=this.length;return this.resize(Er+1),this.emplace(Er,o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot,lt,Ct,Gt,Kt)}emplace(o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot,lt,Ct,Gt,Kt,Er){const cr=24*o,Rr=12*o,Qr=48*o;return this.int16[cr+0]=f,this.int16[cr+1]=E,this.uint16[cr+2]=L,this.uint16[cr+3]=V,this.uint32[Rr+2]=X,this.uint32[Rr+3]=J,this.uint32[Rr+4]=oe,this.uint16[cr+10]=me,this.uint16[cr+11]=Me,this.uint16[cr+12]=De,this.float32[Rr+7]=Ye,this.float32[Rr+8]=ot,this.uint8[Qr+36]=lt,this.uint8[Qr+37]=Ct,this.uint8[Qr+38]=Gt,this.uint32[Rr+10]=Kt,this.int16[cr+22]=Er,o}}ee.prototype.bytesPerElement=48,oi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ee);class ne extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot,lt,Ct,Gt,Kt,Er,cr,Rr,Qr,Fn,Ki,Co,$i,Zi,Ri,vo){const Ii=this.length;return this.resize(Ii+1),this.emplace(Ii,o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot,lt,Ct,Gt,Kt,Er,cr,Rr,Qr,Fn,Ki,Co,$i,Zi,Ri,vo)}emplace(o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot,lt,Ct,Gt,Kt,Er,cr,Rr,Qr,Fn,Ki,Co,$i,Zi,Ri,vo,Ii){const ni=32*o,jo=16*o;return this.int16[ni+0]=f,this.int16[ni+1]=E,this.int16[ni+2]=L,this.int16[ni+3]=V,this.int16[ni+4]=X,this.int16[ni+5]=J,this.int16[ni+6]=oe,this.int16[ni+7]=me,this.uint16[ni+8]=Me,this.uint16[ni+9]=De,this.uint16[ni+10]=Ye,this.uint16[ni+11]=ot,this.uint16[ni+12]=lt,this.uint16[ni+13]=Ct,this.uint16[ni+14]=Gt,this.uint16[ni+15]=Kt,this.uint16[ni+16]=Er,this.uint16[ni+17]=cr,this.uint16[ni+18]=Rr,this.uint16[ni+19]=Qr,this.uint16[ni+20]=Fn,this.uint16[ni+21]=Ki,this.uint16[ni+22]=Co,this.uint32[jo+12]=$i,this.float32[jo+13]=Zi,this.float32[jo+14]=Ri,this.uint16[ni+30]=vo,this.uint16[ni+31]=Ii,o}}ne.prototype.bytesPerElement=64,oi("StructArrayLayout8i15ui1ul2f2ui64",ne);class ue extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o){const f=this.length;return this.resize(f+1),this.emplace(f,o)}emplace(o,f){return this.float32[1*o+0]=f,o}}ue.prototype.bytesPerElement=4,oi("StructArrayLayout1f4",ue);class _e extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,f,E){const L=this.length;return this.resize(L+1),this.emplace(L,o,f,E)}emplace(o,f,E,L){const V=3*o;return this.uint16[6*o+0]=f,this.float32[V+1]=E,this.float32[V+2]=L,o}}_e.prototype.bytesPerElement=12,oi("StructArrayLayout1ui2f12",_e);class h extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,f,E){const L=this.length;return this.resize(L+1),this.emplace(L,o,f,E)}emplace(o,f,E,L){const V=4*o;return this.uint32[2*o+0]=f,this.uint16[V+2]=E,this.uint16[V+3]=L,o}}h.prototype.bytesPerElement=8,oi("StructArrayLayout1ul2ui8",h);class g extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,f){const E=this.length;return this.resize(E+1),this.emplace(E,o,f)}emplace(o,f,E){const L=2*o;return this.uint16[L+0]=f,this.uint16[L+1]=E,o}}g.prototype.bytesPerElement=4,oi("StructArrayLayout2ui4",g);class d extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o){const f=this.length;return this.resize(f+1),this.emplace(f,o)}emplace(o,f){return this.uint16[1*o+0]=f,o}}d.prototype.bytesPerElement=2,oi("StructArrayLayout1ui2",d);class b extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,f,E,L){const V=this.length;return this.resize(V+1),this.emplace(V,o,f,E,L)}emplace(o,f,E,L,V){const X=4*o;return this.float32[X+0]=f,this.float32[X+1]=E,this.float32[X+2]=L,this.float32[X+3]=V,o}}b.prototype.bytesPerElement=16,oi("StructArrayLayout4f16",b);class B extends Lu{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new Ce(this.anchorPointX,this.anchorPointY)}}B.prototype.size=20;class G extends s{get(o){return new B(this,o)}}oi("CollisionBoxArray",G);class q extends Lu{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(o){this._structArray.uint8[this._pos1+37]=o}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(o){this._structArray.uint8[this._pos1+38]=o}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(o){this._structArray.uint32[this._pos4+10]=o}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}q.prototype.size=48;class te extends ee{get(o){return new q(this,o)}}oi("PlacedSymbolArray",te);class fe extends Lu{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(o){this._structArray.uint32[this._pos4+12]=o}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}fe.prototype.size=64;class ce extends ne{get(o){return new fe(this,o)}}oi("SymbolInstanceArray",ce);class Te extends ue{getoffsetX(o){return this.float32[1*o+0]}}oi("GlyphOffsetArray",Te);class Ie extends zh{getx(o){return this.int16[3*o+0]}gety(o){return this.int16[3*o+1]}gettileUnitDistanceFromAnchor(o){return this.int16[3*o+2]}}oi("SymbolLineVertexArray",Ie);class Oe extends Lu{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Oe.prototype.size=12;class Qe extends _e{get(o){return new Oe(this,o)}}oi("TextAnchorOffsetArray",Qe);class nt extends Lu{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}nt.prototype.size=8;class ct extends h{get(o){return new nt(this,o)}}oi("FeatureIndexArray",ct);class tt extends Du{}class Tt extends Du{}class Ut extends Du{}class Nt extends qc{}class pr extends Sh{}class tr extends nc{}class Dr extends Yl{}class Hr extends Th{}class sn extends ba{}class nn extends z{}class Gn extends x{}class di extends k{}class Di extends H{}class Ui extends g{}const ho=_l([{name:"a_pos",components:2,type:"Int16"}],4),{members:gi}=ho;class Wi{constructor(o=[]){this.segments=o}prepareSegment(o,f,E,L){let V=this.segments[this.segments.length-1];return o>Wi.MAX_VERTEX_ARRAY_LENGTH&&rn(`Max vertices per segment is ${Wi.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${o}`),(!V||V.vertexLength+o>Wi.MAX_VERTEX_ARRAY_LENGTH||V.sortKey!==L)&&(V={vertexOffset:f.length,primitiveOffset:E.length,vertexLength:0,primitiveLength:0},L!==void 0&&(V.sortKey=L),this.segments.push(V)),V}get(){return this.segments}destroy(){for(const o of this.segments)for(const f in o.vaos)o.vaos[f].destroy()}static simpleSegment(o,f,E,L){return new Wi([{vertexOffset:o,primitiveOffset:f,vertexLength:E,primitiveLength:L,vaos:{},sortKey:0}])}}function Ko(c,o){return 256*(c=Kn(Math.floor(c),0,255))+Kn(Math.floor(o),0,255)}Wi.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,oi("SegmentVector",Wi);const Mo=_l([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var mo={exports:{}},ko={exports:{}};ko.exports=function(c,o){var f,E,L,V,X,J,oe,me;for(E=c.length-(f=3&c.length),L=o,X=3432918353,J=461845907,me=0;me<E;)oe=255&c.charCodeAt(me)|(255&c.charCodeAt(++me))<<8|(255&c.charCodeAt(++me))<<16|(255&c.charCodeAt(++me))<<24,++me,L=27492+(65535&(V=5*(65535&(L=(L^=oe=(65535&(oe=(oe=(65535&oe)*X+(((oe>>>16)*X&65535)<<16)&4294967295)<<15|oe>>>17))*J+(((oe>>>16)*J&65535)<<16)&4294967295)<<13|L>>>19))+((5*(L>>>16)&65535)<<16)&4294967295))+((58964+(V>>>16)&65535)<<16);switch(oe=0,f){case 3:oe^=(255&c.charCodeAt(me+2))<<16;case 2:oe^=(255&c.charCodeAt(me+1))<<8;case 1:L^=oe=(65535&(oe=(oe=(65535&(oe^=255&c.charCodeAt(me)))*X+(((oe>>>16)*X&65535)<<16)&4294967295)<<15|oe>>>17))*J+(((oe>>>16)*J&65535)<<16)&4294967295}return L^=c.length,L=2246822507*(65535&(L^=L>>>16))+((2246822507*(L>>>16)&65535)<<16)&4294967295,L=3266489909*(65535&(L^=L>>>13))+((3266489909*(L>>>16)&65535)<<16)&4294967295,(L^=L>>>16)>>>0};var xo=ko.exports,qi={exports:{}};qi.exports=function(c,o){for(var f,E=c.length,L=o^E,V=0;E>=4;)f=1540483477*(65535&(f=255&c.charCodeAt(V)|(255&c.charCodeAt(++V))<<8|(255&c.charCodeAt(++V))<<16|(255&c.charCodeAt(++V))<<24))+((1540483477*(f>>>16)&65535)<<16),L=1540483477*(65535&L)+((1540483477*(L>>>16)&65535)<<16)^(f=1540483477*(65535&(f^=f>>>24))+((1540483477*(f>>>16)&65535)<<16)),E-=4,++V;switch(E){case 3:L^=(255&c.charCodeAt(V+2))<<16;case 2:L^=(255&c.charCodeAt(V+1))<<8;case 1:L=1540483477*(65535&(L^=255&c.charCodeAt(V)))+((1540483477*(L>>>16)&65535)<<16)}return L=1540483477*(65535&(L^=L>>>13))+((1540483477*(L>>>16)&65535)<<16),(L^=L>>>15)>>>0};var xs=xo,gs=qi.exports;mo.exports=xs,mo.exports.murmur3=xs,mo.exports.murmur2=gs;var Cl=be(mo.exports);class ts{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(o,f,E,L){this.ids.push(ja(o)),this.positions.push(f,E,L)}getPositions(o){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const f=ja(o);let E=0,L=this.ids.length-1;for(;E<L;){const X=E+L>>1;this.ids[X]>=f?L=X:E=X+1}const V=[];for(;this.ids[E]===f;)V.push({index:this.positions[3*E],start:this.positions[3*E+1],end:this.positions[3*E+2]}),E++;return V}static serialize(o,f){const E=new Float64Array(o.ids),L=new Uint32Array(o.positions);return $a(E,L,0,E.length-1),f&&f.push(E.buffer,L.buffer),{ids:E,positions:L}}static deserialize(o){const f=new ts;return f.ids=o.ids,f.positions=o.positions,f.indexed=!0,f}}function ja(c){const o=+c;return!isNaN(o)&&o<=Number.MAX_SAFE_INTEGER?o:Cl(String(c))}function $a(c,o,f,E){for(;f<E;){const L=c[f+E>>1];let V=f-1,X=E+1;for(;;){do V++;while(c[V]<L);do X--;while(c[X]>L);if(V>=X)break;vs(c,V,X),vs(o,3*V,3*X),vs(o,3*V+1,3*X+1),vs(o,3*V+2,3*X+2)}X-f<E-X?($a(c,o,f,X),f=X+1):($a(c,o,X+1,E),E=X)}}function vs(c,o,f){const E=c[o];c[o]=c[f],c[f]=E}oi("FeaturePositionMap",ts);class Zl{constructor(o,f){this.gl=o.gl,this.location=f}}class zu extends Zl{constructor(o,f){super(o,f),this.current=0}set(o){this.current!==o&&(this.current=o,this.gl.uniform1f(this.location,o))}}class Uu extends Zl{constructor(o,f){super(o,f),this.current=[0,0,0,0]}set(o){o[0]===this.current[0]&&o[1]===this.current[1]&&o[2]===this.current[2]&&o[3]===this.current[3]||(this.current=o,this.gl.uniform4f(this.location,o[0],o[1],o[2],o[3]))}}class hh extends Zl{constructor(o,f){super(o,f),this.current=Yo.transparent}set(o){o.r===this.current.r&&o.g===this.current.g&&o.b===this.current.b&&o.a===this.current.a||(this.current=o,this.gl.uniform4f(this.location,o.r,o.g,o.b,o.a))}}const Yc=new Float32Array(16);function np(c){return[Ko(255*c.r,255*c.g),Ko(255*c.b,255*c.a)]}class pu{constructor(o,f,E){this.value=o,this.uniformNames=f.map(L=>`u_${L}`),this.type=E}setUniform(o,f,E){o.set(E.constantOr(this.value))}getBinding(o,f,E){return this.type==="color"?new hh(o,f):new zu(o,f)}}class Tu{constructor(o,f){this.uniformNames=f.map(E=>`u_${E}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(o,f){this.pixelRatioFrom=f.pixelRatio,this.pixelRatioTo=o.pixelRatio,this.patternFrom=f.tlbr,this.patternTo=o.tlbr}setUniform(o,f,E,L){const V=L==="u_pattern_to"?this.patternTo:L==="u_pattern_from"?this.patternFrom:L==="u_pixel_ratio_to"?this.pixelRatioTo:L==="u_pixel_ratio_from"?this.pixelRatioFrom:null;V&&o.set(V)}getBinding(o,f,E){return E.substr(0,9)==="u_pattern"?new Uu(o,f):new zu(o,f)}}class Zu{constructor(o,f,E,L){this.expression=o,this.type=E,this.maxValue=0,this.paintVertexAttributes=f.map(V=>({name:`a_${V}`,type:"Float32",components:E==="color"?2:1,offset:0})),this.paintVertexArray=new L}populatePaintArray(o,f,E,L,V){const X=this.paintVertexArray.length,J=this.expression.evaluate(new hs(0),f,{},L,[],V);this.paintVertexArray.resize(o),this._setPaintValue(X,o,J)}updatePaintArray(o,f,E,L){const V=this.expression.evaluate({zoom:0},E,L);this._setPaintValue(o,f,V)}_setPaintValue(o,f,E){if(this.type==="color"){const L=np(E);for(let V=o;V<f;V++)this.paintVertexArray.emplace(V,L[0],L[1])}else{for(let L=o;L<f;L++)this.paintVertexArray.emplace(L,E);this.maxValue=Math.max(this.maxValue,Math.abs(E))}}upload(o){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=o.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Dl{constructor(o,f,E,L,V,X){this.expression=o,this.uniformNames=f.map(J=>`u_${J}_t`),this.type=E,this.useIntegerZoom=L,this.zoom=V,this.maxValue=0,this.paintVertexAttributes=f.map(J=>({name:`a_${J}`,type:"Float32",components:E==="color"?4:2,offset:0})),this.paintVertexArray=new X}populatePaintArray(o,f,E,L,V){const X=this.expression.evaluate(new hs(this.zoom),f,{},L,[],V),J=this.expression.evaluate(new hs(this.zoom+1),f,{},L,[],V),oe=this.paintVertexArray.length;this.paintVertexArray.resize(o),this._setPaintValue(oe,o,X,J)}updatePaintArray(o,f,E,L){const V=this.expression.evaluate({zoom:this.zoom},E,L),X=this.expression.evaluate({zoom:this.zoom+1},E,L);this._setPaintValue(o,f,V,X)}_setPaintValue(o,f,E,L){if(this.type==="color"){const V=np(E),X=np(L);for(let J=o;J<f;J++)this.paintVertexArray.emplace(J,V[0],V[1],X[0],X[1])}else{for(let V=o;V<f;V++)this.paintVertexArray.emplace(V,E,L);this.maxValue=Math.max(this.maxValue,Math.abs(E),Math.abs(L))}}upload(o){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=o.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(o,f){const E=this.useIntegerZoom?Math.floor(f.zoom):f.zoom,L=Kn(this.expression.interpolationFactor(E,this.zoom,this.zoom+1),0,1);o.set(L)}getBinding(o,f,E){return new zu(o,f)}}class Vl{constructor(o,f,E,L,V,X){this.expression=o,this.type=f,this.useIntegerZoom=E,this.zoom=L,this.layerId=X,this.zoomInPaintVertexArray=new V,this.zoomOutPaintVertexArray=new V}populatePaintArray(o,f,E){const L=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(o),this.zoomOutPaintVertexArray.resize(o),this._setPaintValues(L,o,f.patterns&&f.patterns[this.layerId],E)}updatePaintArray(o,f,E,L,V){this._setPaintValues(o,f,E.patterns&&E.patterns[this.layerId],V)}_setPaintValues(o,f,E,L){if(!L||!E)return;const{min:V,mid:X,max:J}=E,oe=L[V],me=L[X],Me=L[J];if(oe&&me&&Me)for(let De=o;De<f;De++)this.zoomInPaintVertexArray.emplace(De,me.tl[0],me.tl[1],me.br[0],me.br[1],oe.tl[0],oe.tl[1],oe.br[0],oe.br[1],me.pixelRatio,oe.pixelRatio),this.zoomOutPaintVertexArray.emplace(De,me.tl[0],me.tl[1],me.br[0],me.br[1],Me.tl[0],Me.tl[1],Me.br[0],Me.br[1],me.pixelRatio,Me.pixelRatio)}upload(o){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=o.createVertexBuffer(this.zoomInPaintVertexArray,Mo.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=o.createVertexBuffer(this.zoomOutPaintVertexArray,Mo.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Uh{constructor(o,f,E){this.binders={},this._buffers=[];const L=[];for(const V in o.paint._values){if(!E(V))continue;const X=o.paint.get(V);if(!(X instanceof Gi&&th(X.property.specification)))continue;const J=$l(V,o.type),oe=X.value,me=X.property.specification.type,Me=X.property.useIntegerZoom,De=X.property.specification["property-type"],Ye=De==="cross-faded"||De==="cross-faded-data-driven";if(oe.kind==="constant")this.binders[V]=Ye?new Tu(oe.value,J):new pu(oe.value,J,me),L.push(`/u_${V}`);else if(oe.kind==="source"||Ye){const ot=Vu(V,me,"source");this.binders[V]=Ye?new Vl(oe,me,Me,f,ot,o.id):new Zu(oe,J,me,ot),L.push(`/a_${V}`)}else{const ot=Vu(V,me,"composite");this.binders[V]=new Dl(oe,J,me,Me,f,ot),L.push(`/z_${V}`)}}this.cacheKey=L.sort().join("")}getMaxValue(o){const f=this.binders[o];return f instanceof Zu||f instanceof Dl?f.maxValue:0}populatePaintArrays(o,f,E,L,V){for(const X in this.binders){const J=this.binders[X];(J instanceof Zu||J instanceof Dl||J instanceof Vl)&&J.populatePaintArray(o,f,E,L,V)}}setConstantPatternPositions(o,f){for(const E in this.binders){const L=this.binders[E];L instanceof Tu&&L.setConstantPatternPositions(o,f)}}updatePaintArrays(o,f,E,L,V){let X=!1;for(const J in o){const oe=f.getPositions(J);for(const me of oe){const Me=E.feature(me.index);for(const De in this.binders){const Ye=this.binders[De];if((Ye instanceof Zu||Ye instanceof Dl||Ye instanceof Vl)&&Ye.expression.isStateDependent===!0){const ot=L.paint.get(De);Ye.expression=ot.value,Ye.updatePaintArray(me.start,me.end,Me,o[J],V),X=!0}}}}return X}defines(){const o=[];for(const f in this.binders){const E=this.binders[f];(E instanceof pu||E instanceof Tu)&&o.push(...E.uniformNames.map(L=>`#define HAS_UNIFORM_${L}`))}return o}getBinderAttributes(){const o=[];for(const f in this.binders){const E=this.binders[f];if(E instanceof Zu||E instanceof Dl)for(let L=0;L<E.paintVertexAttributes.length;L++)o.push(E.paintVertexAttributes[L].name);else if(E instanceof Vl)for(let L=0;L<Mo.members.length;L++)o.push(Mo.members[L].name)}return o}getBinderUniforms(){const o=[];for(const f in this.binders){const E=this.binders[f];if(E instanceof pu||E instanceof Tu||E instanceof Dl)for(const L of E.uniformNames)o.push(L)}return o}getPaintVertexBuffers(){return this._buffers}getUniforms(o,f){const E=[];for(const L in this.binders){const V=this.binders[L];if(V instanceof pu||V instanceof Tu||V instanceof Dl){for(const X of V.uniformNames)if(f[X]){const J=V.getBinding(o,f[X],X);E.push({name:X,property:L,binding:J})}}}return E}setUniforms(o,f,E,L){for(const{name:V,property:X,binding:J}of f)this.binders[X].setUniform(J,L,E.get(X),V)}updatePaintBuffers(o){this._buffers=[];for(const f in this.binders){const E=this.binders[f];if(o&&E instanceof Vl){const L=o.fromScale===2?E.zoomInPaintVertexBuffer:E.zoomOutPaintVertexBuffer;L&&this._buffers.push(L)}else(E instanceof Zu||E instanceof Dl)&&E.paintVertexBuffer&&this._buffers.push(E.paintVertexBuffer)}}upload(o){for(const f in this.binders){const E=this.binders[f];(E instanceof Zu||E instanceof Dl||E instanceof Vl)&&E.upload(o)}this.updatePaintBuffers()}destroy(){for(const o in this.binders){const f=this.binders[o];(f instanceof Zu||f instanceof Dl||f instanceof Vl)&&f.destroy()}}}class ml{constructor(o,f,E=()=>!0){this.programConfigurations={};for(const L of o)this.programConfigurations[L.id]=new Uh(L,f,E);this.needsUpload=!1,this._featureMap=new ts,this._bufferOffset=0}populatePaintArrays(o,f,E,L,V,X){for(const J in this.programConfigurations)this.programConfigurations[J].populatePaintArrays(o,f,L,V,X);f.id!==void 0&&this._featureMap.add(f.id,E,this._bufferOffset,o),this._bufferOffset=o,this.needsUpload=!0}updatePaintArrays(o,f,E,L){for(const V of E)this.needsUpload=this.programConfigurations[V.id].updatePaintArrays(o,this._featureMap,f,V,L)||this.needsUpload}get(o){return this.programConfigurations[o]}upload(o){if(this.needsUpload){for(const f in this.programConfigurations)this.programConfigurations[f].upload(o);this.needsUpload=!1}}destroy(){for(const o in this.programConfigurations)this.programConfigurations[o].destroy()}}function $l(c,o){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[c]||[c.replace(`${o}-`,"").replace(/-/g,"_")]}function Vu(c,o,f){const E={color:{source:nc,composite:b},number:{source:ue,composite:nc}},L=function(V){return{"line-pattern":{source:Dr,composite:Dr},"fill-pattern":{source:Dr,composite:Dr},"fill-extrusion-pattern":{source:Dr,composite:Dr}}[V]}(c);return L&&L[f]||E[o][f]}oi("ConstantBinder",pu),oi("CrossFadedConstantBinder",Tu),oi("SourceExpressionBinder",Zu),oi("CrossFadedCompositeBinder",Vl),oi("CompositeExpressionBinder",Dl),oi("ProgramConfiguration",Uh,{omit:["_buffers"]}),oi("ProgramConfigurationSet",ml);const Ws=8192,ju=Math.pow(2,14)-1,os=-ju-1;function yl(c){const o=Ws/c.extent,f=c.loadGeometry();for(let E=0;E<f.length;E++){const L=f[E];for(let V=0;V<L.length;V++){const X=L[V],J=Math.round(X.x*o),oe=Math.round(X.y*o);X.x=Kn(J,os,ju),X.y=Kn(oe,os,ju),(J<X.x||J>X.x+1||oe<X.y||oe>X.y+1)&&rn("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return f}function Ol(c,o){return{type:c.type,id:c.id,properties:c.properties,geometry:o?yl(c):[]}}function ph(c,o,f,E,L){c.emplaceBack(2*o+(E+1)/2,2*f+(L+1)/2)}class _f{constructor(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(f=>f.id),this.index=o.index,this.hasPattern=!1,this.layoutVertexArray=new Tt,this.indexArray=new Di,this.segments=new Wi,this.programConfigurations=new ml(o.layers,o.zoom),this.stateDependentLayerIds=this.layers.filter(f=>f.isStateDependent()).map(f=>f.id)}populate(o,f,E){const L=this.layers[0],V=[];let X=null,J=!1;L.type==="circle"&&(X=L.layout.get("circle-sort-key"),J=!X.isConstant());for(const{feature:oe,id:me,index:Me,sourceLayerIndex:De}of o){const Ye=this.layers[0]._featureFilter.needGeometry,ot=Ol(oe,Ye);if(!this.layers[0]._featureFilter.filter(new hs(this.zoom),ot,E))continue;const lt=J?X.evaluate(ot,{},E):void 0,Ct={id:me,properties:oe.properties,type:oe.type,sourceLayerIndex:De,index:Me,geometry:Ye?ot.geometry:yl(oe),patterns:{},sortKey:lt};V.push(Ct)}J&&V.sort((oe,me)=>oe.sortKey-me.sortKey);for(const oe of V){const{geometry:me,index:Me,sourceLayerIndex:De}=oe,Ye=o[Me].feature;this.addFeature(oe,me,Me,E),f.featureIndex.insert(Ye,me,Me,De,this.index)}}update(o,f,E){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,f,this.stateDependentLayers,E)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,gi),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(o,f,E,L){for(const V of f)for(const X of V){const J=X.x,oe=X.y;if(J<0||J>=Ws||oe<0||oe>=Ws)continue;const me=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,o.sortKey),Me=me.vertexLength;ph(this.layoutVertexArray,J,oe,-1,-1),ph(this.layoutVertexArray,J,oe,1,-1),ph(this.layoutVertexArray,J,oe,1,1),ph(this.layoutVertexArray,J,oe,-1,1),this.indexArray.emplaceBack(Me,Me+1,Me+2),this.indexArray.emplaceBack(Me,Me+3,Me+2),me.vertexLength+=4,me.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,E,{},L)}}function ip(c,o){for(let f=0;f<c.length;f++)if(Ff(o,c[f]))return!0;for(let f=0;f<o.length;f++)if(Ff(c,o[f]))return!0;return!!fc(c,o)}function yf(c,o,f){return!!Ff(c,o)||!!op(o,c,f)}function Hu(c,o){if(c.length===1)return _s(o,c[0]);for(let f=0;f<o.length;f++){const E=o[f];for(let L=0;L<E.length;L++)if(Ff(c,E[L]))return!0}for(let f=0;f<c.length;f++)if(_s(o,c[f]))return!0;for(let f=0;f<o.length;f++)if(fc(c,o[f]))return!0;return!1}function Bp(c,o,f){if(c.length>1){if(fc(c,o))return!0;for(let E=0;E<o.length;E++)if(op(o[E],c,f))return!0}for(let E=0;E<c.length;E++)if(op(c[E],o,f))return!0;return!1}function fc(c,o){if(c.length===0||o.length===0)return!1;for(let f=0;f<c.length-1;f++){const E=c[f],L=c[f+1];for(let V=0;V<o.length-1;V++)if(Wf(E,L,o[V],o[V+1]))return!0}return!1}function Wf(c,o,f,E){return jn(c,f,E)!==jn(o,f,E)&&jn(c,o,f)!==jn(c,o,E)}function op(c,o,f){const E=f*f;if(o.length===1)return c.distSqr(o[0])<E;for(let L=1;L<o.length;L++)if(ef(c,o[L-1],o[L])<E)return!0;return!1}function ef(c,o,f){const E=o.distSqr(f);if(E===0)return c.distSqr(o);const L=((c.x-o.x)*(f.x-o.x)+(c.y-o.y)*(f.y-o.y))/E;return c.distSqr(L<0?o:L>1?f:f.sub(o)._mult(L)._add(o))}function _s(c,o){let f,E,L,V=!1;for(let X=0;X<c.length;X++){f=c[X];for(let J=0,oe=f.length-1;J<f.length;oe=J++)E=f[J],L=f[oe],E.y>o.y!=L.y>o.y&&o.x<(L.x-E.x)*(o.y-E.y)/(L.y-E.y)+E.x&&(V=!V)}return V}function Ff(c,o){let f=!1;for(let E=0,L=c.length-1;E<c.length;L=E++){const V=c[E],X=c[L];V.y>o.y!=X.y>o.y&&o.x<(X.x-V.x)*(o.y-V.y)/(X.y-V.y)+V.x&&(f=!f)}return f}function sd(c,o,f){const E=f[0],L=f[2];if(c.x<E.x&&o.x<E.x||c.x>L.x&&o.x>L.x||c.y<E.y&&o.y<E.y||c.y>L.y&&o.y>L.y)return!1;const V=jn(c,o,f[0]);return V!==jn(c,o,f[1])||V!==jn(c,o,f[2])||V!==jn(c,o,f[3])}function fh(c,o,f){const E=o.paint.get(c).value;return E.kind==="constant"?E.value:f.programConfigurations.get(o.id).getMaxValue(c)}function _d(c){return Math.sqrt(c[0]*c[0]+c[1]*c[1])}function ld(c,o,f,E,L){if(!o[0]&&!o[1])return c;const V=Ce.convert(o)._mult(L);f==="viewport"&&V._rotate(-E);const X=[];for(let J=0;J<c.length;J++)X.push(c[J].sub(V));return X}let ym,Xf;oi("CircleBucket",_f,{omit:["layers"]});var tm={get paint(){return Xf=Xf||new ul({"circle-radius":new ao(Ur.paint_circle["circle-radius"]),"circle-color":new ao(Ur.paint_circle["circle-color"]),"circle-blur":new ao(Ur.paint_circle["circle-blur"]),"circle-opacity":new ao(Ur.paint_circle["circle-opacity"]),"circle-translate":new ji(Ur.paint_circle["circle-translate"]),"circle-translate-anchor":new ji(Ur.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ji(Ur.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ji(Ur.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new ao(Ur.paint_circle["circle-stroke-width"]),"circle-stroke-color":new ao(Ur.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new ao(Ur.paint_circle["circle-stroke-opacity"])})},get layout(){return ym=ym||new ul({"circle-sort-key":new ao(Ur.layout_circle["circle-sort-key"])})}},Gu=1e-6,xf=typeof Float32Array!="undefined"?Float32Array:Array;function tf(c){return c[0]=1,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=1,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=1,c[11]=0,c[12]=0,c[13]=0,c[14]=0,c[15]=1,c}function ud(c,o,f){var E=o[0],L=o[1],V=o[2],X=o[3],J=o[4],oe=o[5],me=o[6],Me=o[7],De=o[8],Ye=o[9],ot=o[10],lt=o[11],Ct=o[12],Gt=o[13],Kt=o[14],Er=o[15],cr=f[0],Rr=f[1],Qr=f[2],Fn=f[3];return c[0]=cr*E+Rr*J+Qr*De+Fn*Ct,c[1]=cr*L+Rr*oe+Qr*Ye+Fn*Gt,c[2]=cr*V+Rr*me+Qr*ot+Fn*Kt,c[3]=cr*X+Rr*Me+Qr*lt+Fn*Er,c[4]=(cr=f[4])*E+(Rr=f[5])*J+(Qr=f[6])*De+(Fn=f[7])*Ct,c[5]=cr*L+Rr*oe+Qr*Ye+Fn*Gt,c[6]=cr*V+Rr*me+Qr*ot+Fn*Kt,c[7]=cr*X+Rr*Me+Qr*lt+Fn*Er,c[8]=(cr=f[8])*E+(Rr=f[9])*J+(Qr=f[10])*De+(Fn=f[11])*Ct,c[9]=cr*L+Rr*oe+Qr*Ye+Fn*Gt,c[10]=cr*V+Rr*me+Qr*ot+Fn*Kt,c[11]=cr*X+Rr*Me+Qr*lt+Fn*Er,c[12]=(cr=f[12])*E+(Rr=f[13])*J+(Qr=f[14])*De+(Fn=f[15])*Ct,c[13]=cr*L+Rr*oe+Qr*Ye+Fn*Gt,c[14]=cr*V+Rr*me+Qr*ot+Fn*Kt,c[15]=cr*X+Rr*Me+Qr*lt+Fn*Er,c}Math.hypot||(Math.hypot=function(){for(var c=0,o=arguments.length;o--;)c+=arguments[o]*arguments[o];return Math.sqrt(c)});var qf,Dd=ud;function Yf(c,o,f){var E=o[0],L=o[1],V=o[2],X=o[3];return c[0]=f[0]*E+f[4]*L+f[8]*V+f[12]*X,c[1]=f[1]*E+f[5]*L+f[9]*V+f[13]*X,c[2]=f[2]*E+f[6]*L+f[10]*V+f[14]*X,c[3]=f[3]*E+f[7]*L+f[11]*V+f[15]*X,c}qf=new xf(4),xf!=Float32Array&&(qf[0]=0,qf[1]=0,qf[2]=0,qf[3]=0);class Kl extends xa{constructor(o){super(o,tm)}createBucket(o){return new _f(o)}queryRadius(o){const f=o;return fh("circle-radius",this,f)+fh("circle-stroke-width",this,f)+_d(this.paint.get("circle-translate"))}queryIntersectsFeature(o,f,E,L,V,X,J,oe){const me=ld(o,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),X.angle,J),Me=this.paint.get("circle-radius").evaluate(f,E)+this.paint.get("circle-stroke-width").evaluate(f,E),De=this.paint.get("circle-pitch-alignment")==="map",Ye=De?me:function(lt,Ct){return lt.map(Gt=>Od(Gt,Ct))}(me,oe),ot=De?Me*J:Me;for(const lt of L)for(const Ct of lt){const Gt=De?Ct:Od(Ct,oe);let Kt=ot;const Er=Yf([],[Ct.x,Ct.y,0,1],oe);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Kt*=Er[3]/X.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Kt*=X.cameraToCenterDistance/Er[3]),yf(Ye,Gt,Kt))return!0}return!1}}function Od(c,o){const f=Yf([],[c.x,c.y,0,1],o);return new Ce(f[0]/f[3],f[1]/f[3])}class Bd extends _f{}let bf;oi("HeatmapBucket",Bd,{omit:["layers"]});var wp={get paint(){return bf=bf||new ul({"heatmap-radius":new ao(Ur.paint_heatmap["heatmap-radius"]),"heatmap-weight":new ao(Ur.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ji(Ur.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Lc(Ur.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ji(Ur.paint_heatmap["heatmap-opacity"])})}};function $f(c,{width:o,height:f},E,L){if(L){if(L instanceof Uint8ClampedArray)L=new Uint8Array(L.buffer);else if(L.length!==o*f*E)throw new RangeError(`mismatched image size. expected: ${L.length} but got: ${o*f*E}`)}else L=new Uint8Array(o*f*E);return c.width=o,c.height=f,c.data=L,c}function ap(c,{width:o,height:f},E){if(o===c.width&&f===c.height)return;const L=$f({},{width:o,height:f},E);kf(c,L,{x:0,y:0},{x:0,y:0},{width:Math.min(c.width,o),height:Math.min(c.height,f)},E),c.width=o,c.height=f,c.data=L.data}function kf(c,o,f,E,L,V){if(L.width===0||L.height===0)return o;if(L.width>c.width||L.height>c.height||f.x>c.width-L.width||f.y>c.height-L.height)throw new RangeError("out of range source coordinates for image copy");if(L.width>o.width||L.height>o.height||E.x>o.width-L.width||E.y>o.height-L.height)throw new RangeError("out of range destination coordinates for image copy");const X=c.data,J=o.data;if(X===J)throw new Error("srcData equals dstData, so image is already copied");for(let oe=0;oe<L.height;oe++){const me=((f.y+oe)*c.width+f.x)*V,Me=((E.y+oe)*o.width+E.x)*V;for(let De=0;De<L.width*V;De++)J[Me+De]=X[me+De]}return o}class xl{constructor(o,f){$f(this,o,1,f)}resize(o){ap(this,o,1)}clone(){return new xl({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(o,f,E,L,V){kf(o,f,E,L,V,1)}}class dc{constructor(o,f){$f(this,o,4,f)}resize(o){ap(this,o,4)}replace(o,f){f?this.data.set(o):this.data=o instanceof Uint8ClampedArray?new Uint8Array(o.buffer):o}clone(){return new dc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(o,f,E,L,V){kf(o,f,E,L,V,4)}}function Fp(c){const o={},f=c.resolution||256,E=c.clips?c.clips.length:1,L=c.image||new dc({width:f,height:E});if(Math.log(f)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${f}`);const V=(X,J,oe)=>{o[c.evaluationKey]=oe;const me=c.expression.evaluate(o);L.data[X+J+0]=Math.floor(255*me.r/me.a),L.data[X+J+1]=Math.floor(255*me.g/me.a),L.data[X+J+2]=Math.floor(255*me.b/me.a),L.data[X+J+3]=Math.floor(255*me.a)};if(c.clips)for(let X=0,J=0;X<E;++X,J+=4*f)for(let oe=0,me=0;oe<f;oe++,me+=4){const Me=oe/(f-1),{start:De,end:Ye}=c.clips[X];V(J,me,De*(1-Me)+Ye*Me)}else for(let X=0,J=0;X<f;X++,J+=4)V(0,J,X/(f-1));return L}oi("AlphaImage",xl),oi("RGBAImage",dc);class Sp extends xa{createBucket(o){return new Bd(o)}constructor(o){super(o,wp),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(o){o==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Fp({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let rf;var nf={get paint(){return rf=rf||new ul({"hillshade-illumination-direction":new ji(Ur.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new ji(Ur.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new ji(Ur.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new ji(Ur.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new ji(Ur.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new ji(Ur.paint_hillshade["hillshade-accent-color"])})}};class Nf extends xa{constructor(o){super(o,nf)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}const zf=_l([{name:"a_pos",components:2,type:"Int16"}],4),{members:of}=zf;var af={exports:{}};function kp(c,o,f){f=f||2;var E,L,V,X,J,oe,me,Me=o&&o.length,De=Me?o[0]*f:c.length,Ye=yd(c,0,De,f,!0),ot=[];if(!Ye||Ye.next===Ye.prev)return ot;if(Me&&(Ye=function(Ct,Gt,Kt,Er){var cr,Rr,Qr,Fn=[];for(cr=0,Rr=Gt.length;cr<Rr;cr++)(Qr=yd(Ct,Gt[cr]*Er,cr<Rr-1?Gt[cr+1]*Er:Ct.length,Er,!1))===Qr.next&&(Qr.steiner=!0),Fn.push(hd(Qr));for(Fn.sort(Tp),cr=0;cr<Fn.length;cr++)Kt=Ef(Fn[cr],Kt);return Kt}(c,o,Ye,f)),c.length>80*f){E=V=c[0],L=X=c[1];for(var lt=f;lt<De;lt+=f)(J=c[lt])<E&&(E=J),(oe=c[lt+1])<L&&(L=oe),J>V&&(V=J),oe>X&&(X=oe);me=(me=Math.max(V-E,X-L))!==0?32767/me:0}return _p(Ye,ot,f,E,L,me,0),ot}function yd(c,o,f,E,L){var V,X;if(L===Wu(c,o,f,E)>0)for(V=o;V<f;V+=E)X=Zf(V,c[V],c[V+1],X);else for(V=f-E;V>=o;V-=E)X=Zf(V,c[V],c[V+1],X);return X&&Zh(X,X.next)&&(zp(X),X=X.next),X}function Dc(c,o){if(!c)return c;o||(o=c);var f,E=c;do if(f=!1,E.steiner||!Zh(E,E.next)&&Ou(E.prev,E,E.next)!==0)E=E.next;else{if(zp(E),(E=o=E.prev)===E.next)break;f=!0}while(f||E!==o);return o}function _p(c,o,f,E,L,V,X){if(c){!X&&V&&function(Me,De,Ye,ot){var lt=Me;do lt.z===0&&(lt.z=cd(lt.x,lt.y,De,Ye,ot)),lt.prevZ=lt.prev,lt.nextZ=lt.next,lt=lt.next;while(lt!==Me);lt.prevZ.nextZ=null,lt.prevZ=null,function(Ct){var Gt,Kt,Er,cr,Rr,Qr,Fn,Ki,Co=1;do{for(Kt=Ct,Ct=null,Rr=null,Qr=0;Kt;){for(Qr++,Er=Kt,Fn=0,Gt=0;Gt<Co&&(Fn++,Er=Er.nextZ);Gt++);for(Ki=Co;Fn>0||Ki>0&&Er;)Fn!==0&&(Ki===0||!Er||Kt.z<=Er.z)?(cr=Kt,Kt=Kt.nextZ,Fn--):(cr=Er,Er=Er.nextZ,Ki--),Rr?Rr.nextZ=cr:Ct=cr,cr.prevZ=Rr,Rr=cr;Kt=Er}Rr.nextZ=null,Co*=2}while(Qr>1)}(lt)}(c,E,L,V);for(var J,oe,me=c;c.prev!==c.next;)if(J=c.prev,oe=c.next,V?xd(c,E,L,V):Kf(c))o.push(J.i/f|0),o.push(c.i/f|0),o.push(oe.i/f|0),zp(c),c=oe.next,me=oe.next;else if((c=oe)===me){X?X===1?_p(c=bd(Dc(c),o,f),o,f,E,L,V,2):X===2&&Ed(c,o,f,E,L,V):_p(Dc(c),o,f,E,L,V,1);break}}}function Kf(c){var o=c.prev,f=c,E=c.next;if(Ou(o,f,E)>=0)return!1;for(var L=o.x,V=f.x,X=E.x,J=o.y,oe=f.y,me=E.y,Me=L<V?L<X?L:X:V<X?V:X,De=J<oe?J<me?J:me:oe<me?oe:me,Ye=L>V?L>X?L:X:V>X?V:X,ot=J>oe?J>me?J:me:oe>me?oe:me,lt=E.next;lt!==o;){if(lt.x>=Me&&lt.x<=Ye&&lt.y>=De&&lt.y<=ot&&Uf(L,J,V,oe,X,me,lt.x,lt.y)&&Ou(lt.prev,lt,lt.next)>=0)return!1;lt=lt.next}return!0}function xd(c,o,f,E){var L=c.prev,V=c,X=c.next;if(Ou(L,V,X)>=0)return!1;for(var J=L.x,oe=V.x,me=X.x,Me=L.y,De=V.y,Ye=X.y,ot=J<oe?J<me?J:me:oe<me?oe:me,lt=Me<De?Me<Ye?Me:Ye:De<Ye?De:Ye,Ct=J>oe?J>me?J:me:oe>me?oe:me,Gt=Me>De?Me>Ye?Me:Ye:De>Ye?De:Ye,Kt=cd(ot,lt,o,f,E),Er=cd(Ct,Gt,o,f,E),cr=c.prevZ,Rr=c.nextZ;cr&&cr.z>=Kt&&Rr&&Rr.z<=Er;){if(cr.x>=ot&&cr.x<=Ct&&cr.y>=lt&&cr.y<=Gt&&cr!==L&&cr!==X&&Uf(J,Me,oe,De,me,Ye,cr.x,cr.y)&&Ou(cr.prev,cr,cr.next)>=0||(cr=cr.prevZ,Rr.x>=ot&&Rr.x<=Ct&&Rr.y>=lt&&Rr.y<=Gt&&Rr!==L&&Rr!==X&&Uf(J,Me,oe,De,me,Ye,Rr.x,Rr.y)&&Ou(Rr.prev,Rr,Rr.next)>=0))return!1;Rr=Rr.nextZ}for(;cr&&cr.z>=Kt;){if(cr.x>=ot&&cr.x<=Ct&&cr.y>=lt&&cr.y<=Gt&&cr!==L&&cr!==X&&Uf(J,Me,oe,De,me,Ye,cr.x,cr.y)&&Ou(cr.prev,cr,cr.next)>=0)return!1;cr=cr.prevZ}for(;Rr&&Rr.z<=Er;){if(Rr.x>=ot&&Rr.x<=Ct&&Rr.y>=lt&&Rr.y<=Gt&&Rr!==L&&Rr!==X&&Uf(J,Me,oe,De,me,Ye,Rr.x,Rr.y)&&Ou(Rr.prev,Rr,Rr.next)>=0)return!1;Rr=Rr.nextZ}return!0}function bd(c,o,f){var E=c;do{var L=E.prev,V=E.next.next;!Zh(L,V)&&lf(L,E,E.next,V)&&pd(L,V)&&pd(V,L)&&(o.push(L.i/f|0),o.push(E.i/f|0),o.push(V.i/f|0),zp(E),zp(E.next),E=c=V),E=E.next}while(E!==c);return Dc(E)}function Ed(c,o,f,E,L,V){var X=c;do{for(var J=X.next.next;J!==X.prev;){if(X.i!==J.i&&sf(X,J)){var oe=yp(X,J);return X=Dc(X,X.next),oe=Dc(oe,oe.next),_p(X,o,f,E,L,V,0),void _p(oe,o,f,E,L,V,0)}J=J.next}X=X.next}while(X!==c)}function Tp(c,o){return c.x-o.x}function Ef(c,o){var f=function(L,V){var X,J=V,oe=L.x,me=L.y,Me=-1/0;do{if(me<=J.y&&me>=J.next.y&&J.next.y!==J.y){var De=J.x+(me-J.y)*(J.next.x-J.x)/(J.next.y-J.y);if(De<=oe&&De>Me&&(Me=De,X=J.x<J.next.x?J:J.next,De===oe))return X}J=J.next}while(J!==V);if(!X)return null;var Ye,ot=X,lt=X.x,Ct=X.y,Gt=1/0;J=X;do oe>=J.x&&J.x>=lt&&oe!==J.x&&Uf(me<Ct?oe:Me,me,lt,Ct,me<Ct?Me:oe,me,J.x,J.y)&&(Ye=Math.abs(me-J.y)/(oe-J.x),pd(J,L)&&(Ye<Gt||Ye===Gt&&(J.x>X.x||J.x===X.x&&wd(X,J)))&&(X=J,Gt=Ye)),J=J.next;while(J!==ot);return X}(c,o);if(!f)return o;var E=yp(f,c);return Dc(E,E.next),Dc(f,f.next)}function wd(c,o){return Ou(c.prev,c,o.prev)<0&&Ou(o.next,c,c.next)<0}function cd(c,o,f,E,L){return(c=1431655765&((c=858993459&((c=252645135&((c=16711935&((c=(c-f)*L|0)|c<<8))|c<<4))|c<<2))|c<<1))|(o=1431655765&((o=858993459&((o=252645135&((o=16711935&((o=(o-E)*L|0)|o<<8))|o<<4))|o<<2))|o<<1))<<1}function hd(c){var o=c,f=c;do(o.x<f.x||o.x===f.x&&o.y<f.y)&&(f=o),o=o.next;while(o!==c);return f}function Uf(c,o,f,E,L,V,X,J){return(L-X)*(o-J)>=(c-X)*(V-J)&&(c-X)*(E-J)>=(f-X)*(o-J)&&(f-X)*(V-J)>=(L-X)*(E-J)}function sf(c,o){return c.next.i!==o.i&&c.prev.i!==o.i&&!function(f,E){var L=f;do{if(L.i!==f.i&&L.next.i!==f.i&&L.i!==E.i&&L.next.i!==E.i&&lf(L,L.next,f,E))return!0;L=L.next}while(L!==f);return!1}(c,o)&&(pd(c,o)&&pd(o,c)&&function(f,E){var L=f,V=!1,X=(f.x+E.x)/2,J=(f.y+E.y)/2;do L.y>J!=L.next.y>J&&L.next.y!==L.y&&X<(L.next.x-L.x)*(J-L.y)/(L.next.y-L.y)+L.x&&(V=!V),L=L.next;while(L!==f);return V}(c,o)&&(Ou(c.prev,c,o.prev)||Ou(c,o.prev,o))||Zh(c,o)&&Ou(c.prev,c,c.next)>0&&Ou(o.prev,o,o.next)>0)}function Ou(c,o,f){return(o.y-c.y)*(f.x-o.x)-(o.x-c.x)*(f.y-o.y)}function Zh(c,o){return c.x===o.x&&c.y===o.y}function lf(c,o,f,E){var L=Np(Ou(c,o,f)),V=Np(Ou(c,o,E)),X=Np(Ou(f,E,c)),J=Np(Ou(f,E,o));return L!==V&&X!==J||!(L!==0||!Ah(c,f,o))||!(V!==0||!Ah(c,E,o))||!(X!==0||!Ah(f,c,E))||!(J!==0||!Ah(f,o,E))}function Ah(c,o,f){return o.x<=Math.max(c.x,f.x)&&o.x>=Math.min(c.x,f.x)&&o.y<=Math.max(c.y,f.y)&&o.y>=Math.min(c.y,f.y)}function Np(c){return c>0?1:c<0?-1:0}function pd(c,o){return Ou(c.prev,c,c.next)<0?Ou(c,o,c.next)>=0&&Ou(c,c.prev,o)>=0:Ou(c,o,c.prev)<0||Ou(c,c.next,o)<0}function yp(c,o){var f=new Oc(c.i,c.x,c.y),E=new Oc(o.i,o.x,o.y),L=c.next,V=o.prev;return c.next=o,o.prev=c,f.next=L,L.prev=f,E.next=f,f.prev=E,V.next=E,E.prev=V,E}function Zf(c,o,f,E){var L=new Oc(c,o,f);return E?(L.next=E.next,L.prev=E,E.next.prev=L,E.next=L):(L.prev=L,L.next=L),L}function zp(c){c.next.prev=c.prev,c.prev.next=c.next,c.prevZ&&(c.prevZ.nextZ=c.nextZ),c.nextZ&&(c.nextZ.prevZ=c.prevZ)}function Oc(c,o,f){this.i=c,this.x=o,this.y=f,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Wu(c,o,f,E){for(var L=0,V=o,X=f-E;V<f;V+=E)L+=(c[X]-c[V])*(c[V+1]+c[X+1]),X=V;return L}af.exports=kp,af.exports.default=kp,kp.deviation=function(c,o,f,E){var L=o&&o.length,V=Math.abs(Wu(c,0,L?o[0]*f:c.length,f));if(L)for(var X=0,J=o.length;X<J;X++)V-=Math.abs(Wu(c,o[X]*f,X<J-1?o[X+1]*f:c.length,f));var oe=0;for(X=0;X<E.length;X+=3){var me=E[X]*f,Me=E[X+1]*f,De=E[X+2]*f;oe+=Math.abs((c[me]-c[De])*(c[Me+1]-c[me+1])-(c[me]-c[Me])*(c[De+1]-c[me+1]))}return V===0&&oe===0?0:Math.abs((oe-V)/V)},kp.flatten=function(c){for(var o=c[0][0].length,f={vertices:[],holes:[],dimensions:o},E=0,L=0;L<c.length;L++){for(var V=0;V<c[L].length;V++)for(var X=0;X<o;X++)f.vertices.push(c[L][V][X]);L>0&&f.holes.push(E+=c[L-1].length)}return f};var Au=be(af.exports);function dh(c,o,f,E,L){rm(c,o,f||0,E||c.length-1,L||nm)}function rm(c,o,f,E,L){for(;E>f;){if(E-f>600){var V=E-f+1,X=o-f+1,J=Math.log(V),oe=.5*Math.exp(2*J/3),me=.5*Math.sqrt(J*oe*(V-oe)/V)*(X-V/2<0?-1:1);rm(c,o,Math.max(f,Math.floor(o-X*oe/V+me)),Math.min(E,Math.floor(o+(V-X)*oe/V+me)),L)}var Me=c[o],De=f,Ye=E;for(Ap(c,f,o),L(c[E],Me)>0&&Ap(c,f,E);De<Ye;){for(Ap(c,De,Ye),De++,Ye--;L(c[De],Me)<0;)De++;for(;L(c[Ye],Me)>0;)Ye--}L(c[f],Me)===0?Ap(c,f,Ye):Ap(c,++Ye,E),Ye<=o&&(f=Ye+1),o<=Ye&&(E=Ye-1)}}function Ap(c,o,f){var E=c[o];c[o]=c[f],c[f]=E}function nm(c,o){return c<o?-1:c>o?1:0}function Fd(c,o){const f=c.length;if(f<=1)return[c];const E=[];let L,V;for(let X=0;X<f;X++){const J=qe(c[X]);J!==0&&(c[X].area=Math.abs(J),V===void 0&&(V=J<0),V===J<0?(L&&E.push(L),L=[c[X]]):L.push(c[X]))}if(L&&E.push(L),o>1)for(let X=0;X<E.length;X++)E[X].length<=o||(dh(E[X],o,1,E[X].length-1,xm),E[X]=E[X].slice(0,o));return E}function xm(c,o){return o.area-c.area}function Jf(c,o,f){const E=f.patternDependencies;let L=!1;for(const V of o){const X=V.paint.get(`${c}-pattern`);X.isConstant()||(L=!0);const J=X.constantOr(null);J&&(L=!0,E[J.to]=!0,E[J.from]=!0)}return L}function kd(c,o,f,E,L){const V=L.patternDependencies;for(const X of o){const J=X.paint.get(`${c}-pattern`).value;if(J.kind!=="constant"){let oe=J.evaluate({zoom:E-1},f,{},L.availableImages),me=J.evaluate({zoom:E},f,{},L.availableImages),Me=J.evaluate({zoom:E+1},f,{},L.availableImages);oe=oe&&oe.name?oe.name:oe,me=me&&me.name?me.name:me,Me=Me&&Me.name?Me.name:Me,V[oe]=!0,V[me]=!0,V[Me]=!0,f.patterns[X.id]={min:oe,mid:me,max:Me}}}return f}class fd{constructor(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(f=>f.id),this.index=o.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ut,this.indexArray=new Di,this.indexArray2=new Ui,this.programConfigurations=new ml(o.layers,o.zoom),this.segments=new Wi,this.segments2=new Wi,this.stateDependentLayerIds=this.layers.filter(f=>f.isStateDependent()).map(f=>f.id)}populate(o,f,E){this.hasPattern=Jf("fill",this.layers,f);const L=this.layers[0].layout.get("fill-sort-key"),V=!L.isConstant(),X=[];for(const{feature:J,id:oe,index:me,sourceLayerIndex:Me}of o){const De=this.layers[0]._featureFilter.needGeometry,Ye=Ol(J,De);if(!this.layers[0]._featureFilter.filter(new hs(this.zoom),Ye,E))continue;const ot=V?L.evaluate(Ye,{},E,f.availableImages):void 0,lt={id:oe,properties:J.properties,type:J.type,sourceLayerIndex:Me,index:me,geometry:De?Ye.geometry:yl(J),patterns:{},sortKey:ot};X.push(lt)}V&&X.sort((J,oe)=>J.sortKey-oe.sortKey);for(const J of X){const{geometry:oe,index:me,sourceLayerIndex:Me}=J;if(this.hasPattern){const De=kd("fill",this.layers,J,this.zoom,f);this.patternFeatures.push(De)}else this.addFeature(J,oe,me,E,{});f.featureIndex.insert(o[me].feature,oe,me,Me,this.index)}}update(o,f,E){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,f,this.stateDependentLayers,E)}addFeatures(o,f,E){for(const L of this.patternFeatures)this.addFeature(L,L.geometry,L.index,f,E)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,of),this.indexBuffer=o.createIndexBuffer(this.indexArray),this.indexBuffer2=o.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(o,f,E,L,V){for(const X of Fd(f,500)){let J=0;for(const ot of X)J+=ot.length;const oe=this.segments.prepareSegment(J,this.layoutVertexArray,this.indexArray),me=oe.vertexLength,Me=[],De=[];for(const ot of X){if(ot.length===0)continue;ot!==X[0]&&De.push(Me.length/2);const lt=this.segments2.prepareSegment(ot.length,this.layoutVertexArray,this.indexArray2),Ct=lt.vertexLength;this.layoutVertexArray.emplaceBack(ot[0].x,ot[0].y),this.indexArray2.emplaceBack(Ct+ot.length-1,Ct),Me.push(ot[0].x),Me.push(ot[0].y);for(let Gt=1;Gt<ot.length;Gt++)this.layoutVertexArray.emplaceBack(ot[Gt].x,ot[Gt].y),this.indexArray2.emplaceBack(Ct+Gt-1,Ct+Gt),Me.push(ot[Gt].x),Me.push(ot[Gt].y);lt.vertexLength+=ot.length,lt.primitiveLength+=ot.length}const Ye=Au(Me,De);for(let ot=0;ot<Ye.length;ot+=3)this.indexArray.emplaceBack(me+Ye[ot],me+Ye[ot+1],me+Ye[ot+2]);oe.vertexLength+=J,oe.primitiveLength+=Ye.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,E,V,L)}}let Bc,im;oi("FillBucket",fd,{omit:["layers","patternFeatures"]});var om={get paint(){return im=im||new ul({"fill-antialias":new ji(Ur.paint_fill["fill-antialias"]),"fill-opacity":new ao(Ur.paint_fill["fill-opacity"]),"fill-color":new ao(Ur.paint_fill["fill-color"]),"fill-outline-color":new ao(Ur.paint_fill["fill-outline-color"]),"fill-translate":new ji(Ur.paint_fill["fill-translate"]),"fill-translate-anchor":new ji(Ur.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ic(Ur.paint_fill["fill-pattern"])})},get layout(){return Bc=Bc||new ul({"fill-sort-key":new ao(Ur.layout_fill["fill-sort-key"])})}};class Nd extends xa{constructor(o){super(o,om)}recalculate(o,f){super.recalculate(o,f);const E=this.paint._values["fill-outline-color"];E.value.kind==="constant"&&E.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(o){return new fd(o)}queryRadius(){return _d(this.paint.get("fill-translate"))}queryIntersectsFeature(o,f,E,L,V,X,J){return Hu(ld(o,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),X.angle,J),L)}isTileClipped(){return!0}}const am=_l([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),uf=_l([{name:"a_centroid",components:2,type:"Int16"}],4),{members:Qf}=am;var cl={},zd=Le,Fc=Pe;function Pe(c,o,f,E,L){this.properties={},this.extent=f,this.type=0,this._pbf=c,this._geometry=-1,this._keys=E,this._values=L,c.readFields(_t,this,o)}function _t(c,o,f){c==1?o.id=f.readVarint():c==2?function(E,L){for(var V=E.readVarint()+E.pos;E.pos<V;){var X=L._keys[E.readVarint()],J=L._values[E.readVarint()];L.properties[X]=J}}(f,o):c==3?o.type=f.readVarint():c==4&&(o._geometry=f.pos)}function Zt(c){for(var o,f,E=0,L=0,V=c.length,X=V-1;L<V;X=L++)E+=((f=c[X]).x-(o=c[L]).x)*(o.y+f.y);return E}Pe.types=["Unknown","Point","LineString","Polygon"],Pe.prototype.loadGeometry=function(){var c=this._pbf;c.pos=this._geometry;for(var o,f=c.readVarint()+c.pos,E=1,L=0,V=0,X=0,J=[];c.pos<f;){if(L<=0){var oe=c.readVarint();E=7&oe,L=oe>>3}if(L--,E===1||E===2)V+=c.readSVarint(),X+=c.readSVarint(),E===1&&(o&&J.push(o),o=[]),o.push(new zd(V,X));else{if(E!==7)throw new Error("unknown command "+E);o&&o.push(o[0].clone())}}return o&&J.push(o),J},Pe.prototype.bbox=function(){var c=this._pbf;c.pos=this._geometry;for(var o=c.readVarint()+c.pos,f=1,E=0,L=0,V=0,X=1/0,J=-1/0,oe=1/0,me=-1/0;c.pos<o;){if(E<=0){var Me=c.readVarint();f=7&Me,E=Me>>3}if(E--,f===1||f===2)(L+=c.readSVarint())<X&&(X=L),L>J&&(J=L),(V+=c.readSVarint())<oe&&(oe=V),V>me&&(me=V);else if(f!==7)throw new Error("unknown command "+f)}return[X,oe,J,me]},Pe.prototype.toGeoJSON=function(c,o,f){var E,L,V=this.extent*Math.pow(2,f),X=this.extent*c,J=this.extent*o,oe=this.loadGeometry(),me=Pe.types[this.type];function Me(ot){for(var lt=0;lt<ot.length;lt++){var Ct=ot[lt];ot[lt]=[360*(Ct.x+X)/V-180,360/Math.PI*Math.atan(Math.exp((180-360*(Ct.y+J)/V)*Math.PI/180))-90]}}switch(this.type){case 1:var De=[];for(E=0;E<oe.length;E++)De[E]=oe[E][0];Me(oe=De);break;case 2:for(E=0;E<oe.length;E++)Me(oe[E]);break;case 3:for(oe=function(ot){var lt=ot.length;if(lt<=1)return[ot];for(var Ct,Gt,Kt=[],Er=0;Er<lt;Er++){var cr=Zt(ot[Er]);cr!==0&&(Gt===void 0&&(Gt=cr<0),Gt===cr<0?(Ct&&Kt.push(Ct),Ct=[ot[Er]]):Ct.push(ot[Er]))}return Ct&&Kt.push(Ct),Kt}(oe),E=0;E<oe.length;E++)for(L=0;L<oe[E].length;L++)Me(oe[E][L])}oe.length===1?oe=oe[0]:me="Multi"+me;var Ye={type:"Feature",geometry:{type:me,coordinates:oe},properties:this.properties};return"id"in this&&(Ye.id=this.id),Ye};var qr=Fc,wn=Yr;function Yr(c,o){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=c,this._keys=[],this._values=[],this._features=[],c.readFields(Or,this,o),this.length=this._features.length}function Or(c,o,f){c===15?o.version=f.readVarint():c===1?o.name=f.readString():c===5?o.extent=f.readVarint():c===2?o._features.push(f.pos):c===3?o._keys.push(f.readString()):c===4&&o._values.push(function(E){for(var L=null,V=E.readVarint()+E.pos;E.pos<V;){var X=E.readVarint()>>3;L=X===1?E.readString():X===2?E.readFloat():X===3?E.readDouble():X===4?E.readVarint64():X===5?E.readVarint():X===6?E.readSVarint():X===7?E.readBoolean():null}return L}(f))}Yr.prototype.feature=function(c){if(c<0||c>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[c];var o=this._pbf.readVarint()+this._pbf.pos;return new qr(this._pbf,o,this.extent,this._keys,this._values)};var Wn=wn;function Bn(c,o,f){if(c===3){var E=new Wn(f,f.readVarint()+f.pos);E.length&&(o[E.name]=E)}}cl.VectorTile=function(c,o){this.layers=c.readFields(Bn,{},o)},cl.VectorTileFeature=Fc,cl.VectorTileLayer=wn;const si=cl.VectorTileFeature.types,Hn=Math.pow(2,13);function qn(c,o,f,E,L,V,X,J){c.emplaceBack(o,f,2*Math.floor(E*Hn)+X,L*Hn*2,V*Hn*2,Math.round(J))}class ci{constructor(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(f=>f.id),this.index=o.index,this.hasPattern=!1,this.layoutVertexArray=new Nt,this.centroidVertexArray=new tt,this.indexArray=new Di,this.programConfigurations=new ml(o.layers,o.zoom),this.segments=new Wi,this.stateDependentLayerIds=this.layers.filter(f=>f.isStateDependent()).map(f=>f.id)}populate(o,f,E){this.features=[],this.hasPattern=Jf("fill-extrusion",this.layers,f);for(const{feature:L,id:V,index:X,sourceLayerIndex:J}of o){const oe=this.layers[0]._featureFilter.needGeometry,me=Ol(L,oe);if(!this.layers[0]._featureFilter.filter(new hs(this.zoom),me,E))continue;const Me={id:V,sourceLayerIndex:J,index:X,geometry:oe?me.geometry:yl(L),properties:L.properties,type:L.type,patterns:{}};this.hasPattern?this.features.push(kd("fill-extrusion",this.layers,Me,this.zoom,f)):this.addFeature(Me,Me.geometry,X,E,{}),f.featureIndex.insert(L,Me.geometry,X,J,this.index,!0)}}addFeatures(o,f,E){for(const L of this.features){const{geometry:V}=L;this.addFeature(L,V,L.index,f,E)}}update(o,f,E){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,f,this.stateDependentLayers,E)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,Qf),this.centroidVertexBuffer=o.createVertexBuffer(this.centroidVertexArray,uf.members,!0),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(o,f,E,L,V){const X={x:0,y:0,vertexCount:0};for(const J of Fd(f,500)){let oe=0;for(const lt of J)oe+=lt.length;let me=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const lt of J){if(lt.length===0||Yn(lt))continue;let Ct=0;for(let Gt=0;Gt<lt.length;Gt++){const Kt=lt[Gt];if(Gt>=1){const Er=lt[Gt-1];if(!Vn(Kt,Er)){me.vertexLength+4>Wi.MAX_VERTEX_ARRAY_LENGTH&&(me=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const cr=Kt.sub(Er)._perp()._unit(),Rr=Er.dist(Kt);Ct+Rr>32768&&(Ct=0),qn(this.layoutVertexArray,Kt.x,Kt.y,cr.x,cr.y,0,0,Ct),qn(this.layoutVertexArray,Kt.x,Kt.y,cr.x,cr.y,0,1,Ct),X.x+=2*Kt.x,X.y+=2*Kt.y,X.vertexCount+=2,Ct+=Rr,qn(this.layoutVertexArray,Er.x,Er.y,cr.x,cr.y,0,0,Ct),qn(this.layoutVertexArray,Er.x,Er.y,cr.x,cr.y,0,1,Ct),X.x+=2*Er.x,X.y+=2*Er.y,X.vertexCount+=2;const Qr=me.vertexLength;this.indexArray.emplaceBack(Qr,Qr+2,Qr+1),this.indexArray.emplaceBack(Qr+1,Qr+2,Qr+3),me.vertexLength+=4,me.primitiveLength+=2}}}}if(me.vertexLength+oe>Wi.MAX_VERTEX_ARRAY_LENGTH&&(me=this.segments.prepareSegment(oe,this.layoutVertexArray,this.indexArray)),si[o.type]!=="Polygon")continue;const Me=[],De=[],Ye=me.vertexLength;for(const lt of J)if(lt.length!==0){lt!==J[0]&&De.push(Me.length/2);for(let Ct=0;Ct<lt.length;Ct++){const Gt=lt[Ct];qn(this.layoutVertexArray,Gt.x,Gt.y,0,0,1,1,0),X.x+=Gt.x,X.y+=Gt.y,X.vertexCount+=1,Me.push(Gt.x),Me.push(Gt.y)}}const ot=Au(Me,De);for(let lt=0;lt<ot.length;lt+=3)this.indexArray.emplaceBack(Ye+ot[lt],Ye+ot[lt+2],Ye+ot[lt+1]);me.primitiveLength+=ot.length/3,me.vertexLength+=oe}for(let J=0;J<X.vertexCount;J++)this.centroidVertexArray.emplaceBack(Math.floor(X.x/X.vertexCount),Math.floor(X.y/X.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,E,V,L)}}function Vn(c,o){return c.x===o.x&&(c.x<0||c.x>Ws)||c.y===o.y&&(c.y<0||c.y>Ws)}function Yn(c){return c.every(o=>o.x<0)||c.every(o=>o.x>Ws)||c.every(o=>o.y<0)||c.every(o=>o.y>Ws)}let Tr;oi("FillExtrusionBucket",ci,{omit:["layers","features"]});var en={get paint(){return Tr=Tr||new ul({"fill-extrusion-opacity":new ji(Ur["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new ao(Ur["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ji(Ur["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ji(Ur["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ic(Ur["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new ao(Ur["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new ao(Ur["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ji(Ur["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Xn extends xa{constructor(o){super(o,en)}createBucket(o){return new ci(o)}queryRadius(){return _d(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(o,f,E,L,V,X,J,oe){const me=ld(o,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),X.angle,J),Me=this.paint.get("fill-extrusion-height").evaluate(f,E),De=this.paint.get("fill-extrusion-base").evaluate(f,E),Ye=function(lt,Ct,Gt,Kt){const Er=[];for(const cr of lt){const Rr=[cr.x,cr.y,0,1];Yf(Rr,Rr,Ct),Er.push(new Ce(Rr[0]/Rr[3],Rr[1]/Rr[3]))}return Er}(me,oe),ot=function(lt,Ct,Gt,Kt){const Er=[],cr=[],Rr=Kt[8]*Ct,Qr=Kt[9]*Ct,Fn=Kt[10]*Ct,Ki=Kt[11]*Ct,Co=Kt[8]*Gt,$i=Kt[9]*Gt,Zi=Kt[10]*Gt,Ri=Kt[11]*Gt;for(const vo of lt){const Ii=[],ni=[];for(const jo of vo){const Do=jo.x,rs=jo.y,iu=Kt[0]*Do+Kt[4]*rs+Kt[12],tl=Kt[1]*Do+Kt[5]*rs+Kt[13],gc=Kt[2]*Do+Kt[6]*rs+Kt[14],Pp=Kt[3]*Do+Kt[7]*rs+Kt[15],sp=gc+Fn,kc=Pp+Ki,gh=iu+Co,lp=tl+$i,vh=gc+Zi,Ys=Pp+Ri,jl=new Ce((iu+Rr)/kc,(tl+Qr)/kc);jl.z=sp/kc,Ii.push(jl);const _h=new Ce(gh/Ys,lp/Ys);_h.z=vh/Ys,ni.push(_h)}Er.push(Ii),cr.push(ni)}return[Er,cr]}(L,De,Me,oe);return function(lt,Ct,Gt){let Kt=1/0;Hu(Gt,Ct)&&(Kt=Rn(Gt,Ct[0]));for(let Er=0;Er<Ct.length;Er++){const cr=Ct[Er],Rr=lt[Er];for(let Qr=0;Qr<cr.length-1;Qr++){const Fn=cr[Qr],Ki=[Fn,cr[Qr+1],Rr[Qr+1],Rr[Qr],Fn];ip(Gt,Ki)&&(Kt=Math.min(Kt,Rn(Gt,Ki)))}}return Kt!==1/0&&Kt}(ot[0],ot[1],Ye)}}function _i(c,o){return c.x*o.x+c.y*o.y}function Rn(c,o){if(c.length===1){let f=0;const E=o[f++];let L;for(;!L||E.equals(L);)if(L=o[f++],!L)return 1/0;for(;f<o.length;f++){const V=o[f],X=c[0],J=L.sub(E),oe=V.sub(E),me=X.sub(E),Me=_i(J,J),De=_i(J,oe),Ye=_i(oe,oe),ot=_i(me,J),lt=_i(me,oe),Ct=Me*Ye-De*De,Gt=(Ye*ot-De*lt)/Ct,Kt=(Me*lt-De*ot)/Ct,Er=E.z*(1-Gt-Kt)+L.z*Gt+V.z*Kt;if(isFinite(Er))return Er}return 1/0}{let f=1/0;for(const E of o)f=Math.min(f,E.z);return f}}const xi=_l([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Un}=xi,Oi=_l([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Ln}=Oi,wi=cl.VectorTileFeature.types,Po=Math.cos(Math.PI/180*37.5),da=Math.pow(2,14)/.5;class bi{constructor(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(f=>f.id),this.index=o.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(f=>{this.gradients[f.id]={}}),this.layoutVertexArray=new pr,this.layoutVertexArray2=new tr,this.indexArray=new Di,this.programConfigurations=new ml(o.layers,o.zoom),this.segments=new Wi,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(f=>f.isStateDependent()).map(f=>f.id)}populate(o,f,E){this.hasPattern=Jf("line",this.layers,f);const L=this.layers[0].layout.get("line-sort-key"),V=!L.isConstant(),X=[];for(const{feature:J,id:oe,index:me,sourceLayerIndex:Me}of o){const De=this.layers[0]._featureFilter.needGeometry,Ye=Ol(J,De);if(!this.layers[0]._featureFilter.filter(new hs(this.zoom),Ye,E))continue;const ot=V?L.evaluate(Ye,{},E):void 0,lt={id:oe,properties:J.properties,type:J.type,sourceLayerIndex:Me,index:me,geometry:De?Ye.geometry:yl(J),patterns:{},sortKey:ot};X.push(lt)}V&&X.sort((J,oe)=>J.sortKey-oe.sortKey);for(const J of X){const{geometry:oe,index:me,sourceLayerIndex:Me}=J;if(this.hasPattern){const De=kd("line",this.layers,J,this.zoom,f);this.patternFeatures.push(De)}else this.addFeature(J,oe,me,E,{});f.featureIndex.insert(o[me].feature,oe,me,Me,this.index)}}update(o,f,E){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,f,this.stateDependentLayers,E)}addFeatures(o,f,E){for(const L of this.patternFeatures)this.addFeature(L,L.geometry,L.index,f,E)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=o.createVertexBuffer(this.layoutVertexArray2,Ln)),this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,Un),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(o){if(o.properties&&Object.prototype.hasOwnProperty.call(o.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(o.properties,"mapbox_clip_end"))return{start:+o.properties.mapbox_clip_start,end:+o.properties.mapbox_clip_end}}addFeature(o,f,E,L,V){const X=this.layers[0].layout,J=X.get("line-join").evaluate(o,{}),oe=X.get("line-cap"),me=X.get("line-miter-limit"),Me=X.get("line-round-limit");this.lineClips=this.lineFeatureClips(o);for(const De of f)this.addLine(De,o,J,oe,me,Me);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,E,V,L)}addLine(o,f,E,L,V,X){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Kt=0;Kt<o.length-1;Kt++)this.totalDistance+=o[Kt].dist(o[Kt+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const J=wi[f.type]==="Polygon";let oe=o.length;for(;oe>=2&&o[oe-1].equals(o[oe-2]);)oe--;let me=0;for(;me<oe-1&&o[me].equals(o[me+1]);)me++;if(oe<(J?3:2))return;E==="bevel"&&(V=1.05);const Me=this.overscaling<=16?15*Ws/(512*this.overscaling):0,De=this.segments.prepareSegment(10*oe,this.layoutVertexArray,this.indexArray);let Ye,ot,lt,Ct,Gt;this.e1=this.e2=-1,J&&(Ye=o[oe-2],Gt=o[me].sub(Ye)._unit()._perp());for(let Kt=me;Kt<oe;Kt++){if(lt=Kt===oe-1?J?o[me+1]:void 0:o[Kt+1],lt&&o[Kt].equals(lt))continue;Gt&&(Ct=Gt),Ye&&(ot=Ye),Ye=o[Kt],Gt=lt?lt.sub(Ye)._unit()._perp():Ct,Ct=Ct||Gt;let Er=Ct.add(Gt);Er.x===0&&Er.y===0||Er._unit();const cr=Ct.x*Gt.x+Ct.y*Gt.y,Rr=Er.x*Gt.x+Er.y*Gt.y,Qr=Rr!==0?1/Rr:1/0,Fn=2*Math.sqrt(2-2*Rr),Ki=Rr<Po&&ot&&lt,Co=Ct.x*Gt.y-Ct.y*Gt.x>0;if(Ki&&Kt>me){const Ri=Ye.dist(ot);if(Ri>2*Me){const vo=Ye.sub(Ye.sub(ot)._mult(Me/Ri)._round());this.updateDistance(ot,vo),this.addCurrentVertex(vo,Ct,0,0,De),ot=vo}}const $i=ot&&lt;let Zi=$i?E:J?"butt":L;if($i&&Zi==="round"&&(Qr<X?Zi="miter":Qr<=2&&(Zi="fakeround")),Zi==="miter"&&Qr>V&&(Zi="bevel"),Zi==="bevel"&&(Qr>2&&(Zi="flipbevel"),Qr<V&&(Zi="miter")),ot&&this.updateDistance(ot,Ye),Zi==="miter")Er._mult(Qr),this.addCurrentVertex(Ye,Er,0,0,De);else if(Zi==="flipbevel"){if(Qr>100)Er=Gt.mult(-1);else{const Ri=Qr*Ct.add(Gt).mag()/Ct.sub(Gt).mag();Er._perp()._mult(Ri*(Co?-1:1))}this.addCurrentVertex(Ye,Er,0,0,De),this.addCurrentVertex(Ye,Er.mult(-1),0,0,De)}else if(Zi==="bevel"||Zi==="fakeround"){const Ri=-Math.sqrt(Qr*Qr-1),vo=Co?Ri:0,Ii=Co?0:Ri;if(ot&&this.addCurrentVertex(Ye,Ct,vo,Ii,De),Zi==="fakeround"){const ni=Math.round(180*Fn/Math.PI/20);for(let jo=1;jo<ni;jo++){let Do=jo/ni;if(Do!==.5){const iu=Do-.5;Do+=Do*iu*(Do-1)*((1.0904+cr*(cr*(3.55645-1.43519*cr)-3.2452))*iu*iu+(.848013+cr*(.215638*cr-1.06021)))}const rs=Gt.sub(Ct)._mult(Do)._add(Ct)._unit()._mult(Co?-1:1);this.addHalfVertex(Ye,rs.x,rs.y,!1,Co,0,De)}}lt&&this.addCurrentVertex(Ye,Gt,-vo,-Ii,De)}else if(Zi==="butt")this.addCurrentVertex(Ye,Er,0,0,De);else if(Zi==="square"){const Ri=ot?1:-1;this.addCurrentVertex(Ye,Er,Ri,Ri,De)}else Zi==="round"&&(ot&&(this.addCurrentVertex(Ye,Ct,0,0,De),this.addCurrentVertex(Ye,Ct,1,1,De,!0)),lt&&(this.addCurrentVertex(Ye,Gt,-1,-1,De,!0),this.addCurrentVertex(Ye,Gt,0,0,De)));if(Ki&&Kt<oe-1){const Ri=Ye.dist(lt);if(Ri>2*Me){const vo=Ye.add(lt.sub(Ye)._mult(Me/Ri)._round());this.updateDistance(Ye,vo),this.addCurrentVertex(vo,Gt,0,0,De),Ye=vo}}}}addCurrentVertex(o,f,E,L,V,X=!1){const J=f.y*L-f.x,oe=-f.y-f.x*L;this.addHalfVertex(o,f.x+f.y*E,f.y-f.x*E,X,!1,E,V),this.addHalfVertex(o,J,oe,X,!0,-L,V),this.distance>da/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(o,f,E,L,V,X))}addHalfVertex({x:o,y:f},E,L,V,X,J,oe){const me=.5*(this.lineClips?this.scaledDistance*(da-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((o<<1)+(V?1:0),(f<<1)+(X?1:0),Math.round(63*E)+128,Math.round(63*L)+128,1+(J===0?0:J<0?-1:1)|(63&me)<<2,me>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const Me=oe.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Me),oe.primitiveLength++),X?this.e2=Me:this.e1=Me}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(o,f){this.distance+=o.dist(f),this.updateScaledDistance()}}let Zn,Sn;oi("LineBucket",bi,{omit:["layers","patternFeatures"]});var Wt={get paint(){return Sn=Sn||new ul({"line-opacity":new ao(Ur.paint_line["line-opacity"]),"line-color":new ao(Ur.paint_line["line-color"]),"line-translate":new ji(Ur.paint_line["line-translate"]),"line-translate-anchor":new ji(Ur.paint_line["line-translate-anchor"]),"line-width":new ao(Ur.paint_line["line-width"]),"line-gap-width":new ao(Ur.paint_line["line-gap-width"]),"line-offset":new ao(Ur.paint_line["line-offset"]),"line-blur":new ao(Ur.paint_line["line-blur"]),"line-dasharray":new Gs(Ur.paint_line["line-dasharray"]),"line-pattern":new Ic(Ur.paint_line["line-pattern"]),"line-gradient":new Lc(Ur.paint_line["line-gradient"])})},get layout(){return Zn=Zn||new ul({"line-cap":new ji(Ur.layout_line["line-cap"]),"line-join":new ao(Ur.layout_line["line-join"]),"line-miter-limit":new ji(Ur.layout_line["line-miter-limit"]),"line-round-limit":new ji(Ur.layout_line["line-round-limit"]),"line-sort-key":new ao(Ur.layout_line["line-sort-key"])})}};class K extends ao{possiblyEvaluate(o,f){return f=new hs(Math.floor(f.zoom),{now:f.now,fadeDuration:f.fadeDuration,zoomHistory:f.zoomHistory,transition:f.transition}),super.possiblyEvaluate(o,f)}evaluate(o,f,E,L){return f=ki({},f,{zoom:Math.floor(f.zoom)}),super.evaluate(o,f,E,L)}}let Ei;class Ee extends xa{constructor(o){super(o,Wt),this.gradientVersion=0,Ei||(Ei=new K(Wt.paint.properties["line-width"].specification),Ei.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(o){if(o==="line-gradient"){const f=this.gradientExpression();this.stepInterpolant=!!function(E){return E._styleExpression!==void 0}(f)&&f._styleExpression.expression instanceof Nl,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(o,f){super.recalculate(o,f),this.paint._values["line-floorwidth"]=Ei.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,o)}createBucket(o){return new bi(o)}queryRadius(o){const f=o,E=sa(fh("line-width",this,f),fh("line-gap-width",this,f)),L=fh("line-offset",this,f);return E/2+Math.abs(L)+_d(this.paint.get("line-translate"))}queryIntersectsFeature(o,f,E,L,V,X,J){const oe=ld(o,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),X.angle,J),me=J/2*sa(this.paint.get("line-width").evaluate(f,E),this.paint.get("line-gap-width").evaluate(f,E)),Me=this.paint.get("line-offset").evaluate(f,E);return Me&&(L=function(De,Ye){const ot=[];for(let lt=0;lt<De.length;lt++){const Ct=De[lt],Gt=[];for(let Kt=0;Kt<Ct.length;Kt++){const Er=Ct[Kt-1],cr=Ct[Kt],Rr=Ct[Kt+1],Qr=Kt===0?new Ce(0,0):cr.sub(Er)._unit()._perp(),Fn=Kt===Ct.length-1?new Ce(0,0):Rr.sub(cr)._unit()._perp(),Ki=Qr._add(Fn)._unit(),Co=Ki.x*Fn.x+Ki.y*Fn.y;Co!==0&&Ki._mult(1/Co),Gt.push(Ki._mult(Ye)._add(cr))}ot.push(Gt)}return ot}(L,Me*J)),function(De,Ye,ot){for(let lt=0;lt<Ye.length;lt++){const Ct=Ye[lt];if(De.length>=3){for(let Gt=0;Gt<Ct.length;Gt++)if(Ff(De,Ct[Gt]))return!0}if(Bp(De,Ct,ot))return!0}return!1}(oe,L,me)}isTileClipped(){return!0}}function sa(c,o){return o>0?o+2*c:c}const Jo=_l([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Es=_l([{name:"a_projected_pos",components:3,type:"Float32"}],4);_l([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Cu=_l([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);_l([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Bl=_l([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),as=_l([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function fu(c,o,f){return c.sections.forEach(E=>{E.text=function(L,V,X){const J=V.layout.get("text-transform").evaluate(X,{});return J==="uppercase"?L=L.toLocaleUpperCase():J==="lowercase"&&(L=L.toLocaleLowerCase()),Rs.applyArabicShaping&&(L=Rs.applyArabicShaping(L)),L}(E.text,o,f)}),c}_l([{name:"triangle",components:3,type:"Uint16"}]),_l([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),_l([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),_l([{type:"Float32",name:"offsetX"}]),_l([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),_l([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Js={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};var ps=24,du=za,ru=function(c,o,f,E,L){var V,X,J=8*L-E-1,oe=(1<<J)-1,me=oe>>1,Me=-7,De=f?L-1:0,Ye=f?-1:1,ot=c[o+De];for(De+=Ye,V=ot&(1<<-Me)-1,ot>>=-Me,Me+=J;Me>0;V=256*V+c[o+De],De+=Ye,Me-=8);for(X=V&(1<<-Me)-1,V>>=-Me,Me+=E;Me>0;X=256*X+c[o+De],De+=Ye,Me-=8);if(V===0)V=1-me;else{if(V===oe)return X?NaN:1/0*(ot?-1:1);X+=Math.pow(2,E),V-=me}return(ot?-1:1)*X*Math.pow(2,V-E)},uu=function(c,o,f,E,L,V){var X,J,oe,me=8*V-L-1,Me=(1<<me)-1,De=Me>>1,Ye=L===23?Math.pow(2,-24)-Math.pow(2,-77):0,ot=E?0:V-1,lt=E?1:-1,Ct=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(J=isNaN(o)?1:0,X=Me):(X=Math.floor(Math.log(o)/Math.LN2),o*(oe=Math.pow(2,-X))<1&&(X--,oe*=2),(o+=X+De>=1?Ye/oe:Ye*Math.pow(2,1-De))*oe>=2&&(X++,oe/=2),X+De>=Me?(J=0,X=Me):X+De>=1?(J=(o*oe-1)*Math.pow(2,L),X+=De):(J=o*Math.pow(2,De-1)*Math.pow(2,L),X=0));L>=8;c[f+ot]=255&J,ot+=lt,J/=256,L-=8);for(X=X<<L|J,me+=L;me>0;c[f+ot]=255&X,ot+=lt,X/=256,me-=8);c[f+ot-lt]|=128*Ct};function za(c){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(c)?c:new Uint8Array(c||0),this.pos=0,this.type=0,this.length=this.buf.length}za.Varint=0,za.Fixed64=1,za.Bytes=2,za.Fixed32=5;var Mu=4294967296,Ca=1/Mu,mu=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");function ss(c){return c.type===za.Bytes?c.readVarint()+c.pos:c.pos+1}function go(c,o,f){return f?4294967296*o+(c>>>0):4294967296*(o>>>0)+(c>>>0)}function ya(c,o,f){var E=o<=16383?1:o<=2097151?2:o<=268435455?3:Math.floor(Math.log(o)/(7*Math.LN2));f.realloc(E);for(var L=f.pos-1;L>=c;L--)f.buf[L+E]=f.buf[L]}function Qo(c,o){for(var f=0;f<c.length;f++)o.writeVarint(c[f])}function Qs(c,o){for(var f=0;f<c.length;f++)o.writeSVarint(c[f])}function Cp(c,o){for(var f=0;f<c.length;f++)o.writeFloat(c[f])}function Ft(c,o){for(var f=0;f<c.length;f++)o.writeDouble(c[f])}function Xr(c,o){for(var f=0;f<c.length;f++)o.writeBoolean(c[f])}function Mr(c,o){for(var f=0;f<c.length;f++)o.writeFixed32(c[f])}function Bi(c,o){for(var f=0;f<c.length;f++)o.writeSFixed32(c[f])}function Ma(c,o){for(var f=0;f<c.length;f++)o.writeFixed64(c[f])}function el(c,o){for(var f=0;f<c.length;f++)o.writeSFixed64(c[f])}function st(c,o){return(c[o]|c[o+1]<<8|c[o+2]<<16)+16777216*c[o+3]}function Et(c,o,f){c[f]=o,c[f+1]=o>>>8,c[f+2]=o>>>16,c[f+3]=o>>>24}function Vt(c,o){return(c[o]|c[o+1]<<8|c[o+2]<<16)+(c[o+3]<<24)}za.prototype={destroy:function(){this.buf=null},readFields:function(c,o,f){for(f=f||this.length;this.pos<f;){var E=this.readVarint(),L=E>>3,V=this.pos;this.type=7&E,c(L,o,this),this.pos===V&&this.skip(E)}return o},readMessage:function(c,o){return this.readFields(c,o,this.readVarint()+this.pos)},readFixed32:function(){var c=st(this.buf,this.pos);return this.pos+=4,c},readSFixed32:function(){var c=Vt(this.buf,this.pos);return this.pos+=4,c},readFixed64:function(){var c=st(this.buf,this.pos)+st(this.buf,this.pos+4)*Mu;return this.pos+=8,c},readSFixed64:function(){var c=st(this.buf,this.pos)+Vt(this.buf,this.pos+4)*Mu;return this.pos+=8,c},readFloat:function(){var c=ru(this.buf,this.pos,!0,23,4);return this.pos+=4,c},readDouble:function(){var c=ru(this.buf,this.pos,!0,52,8);return this.pos+=8,c},readVarint:function(c){var o,f,E=this.buf;return o=127&(f=E[this.pos++]),f<128?o:(o|=(127&(f=E[this.pos++]))<<7,f<128?o:(o|=(127&(f=E[this.pos++]))<<14,f<128?o:(o|=(127&(f=E[this.pos++]))<<21,f<128?o:function(L,V,X){var J,oe,me=X.buf;if(J=(112&(oe=me[X.pos++]))>>4,oe<128||(J|=(127&(oe=me[X.pos++]))<<3,oe<128)||(J|=(127&(oe=me[X.pos++]))<<10,oe<128)||(J|=(127&(oe=me[X.pos++]))<<17,oe<128)||(J|=(127&(oe=me[X.pos++]))<<24,oe<128)||(J|=(1&(oe=me[X.pos++]))<<31,oe<128))return go(L,J,V);throw new Error("Expected varint not more than 10 bytes")}(o|=(15&(f=E[this.pos]))<<28,c,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var c=this.readVarint();return c%2==1?(c+1)/-2:c/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var c=this.readVarint()+this.pos,o=this.pos;return this.pos=c,c-o>=12&&mu?function(f,E,L){return mu.decode(f.subarray(E,L))}(this.buf,o,c):function(f,E,L){for(var V="",X=E;X<L;){var J,oe,me,Me=f[X],De=null,Ye=Me>239?4:Me>223?3:Me>191?2:1;if(X+Ye>L)break;Ye===1?Me<128&&(De=Me):Ye===2?(192&(J=f[X+1]))==128&&(De=(31&Me)<<6|63&J)<=127&&(De=null):Ye===3?(oe=f[X+2],(192&(J=f[X+1]))==128&&(192&oe)==128&&((De=(15&Me)<<12|(63&J)<<6|63&oe)<=2047||De>=55296&&De<=57343)&&(De=null)):Ye===4&&(oe=f[X+2],me=f[X+3],(192&(J=f[X+1]))==128&&(192&oe)==128&&(192&me)==128&&((De=(15&Me)<<18|(63&J)<<12|(63&oe)<<6|63&me)<=65535||De>=1114112)&&(De=null)),De===null?(De=65533,Ye=1):De>65535&&(De-=65536,V+=String.fromCharCode(De>>>10&1023|55296),De=56320|1023&De),V+=String.fromCharCode(De),X+=Ye}return V}(this.buf,o,c)},readBytes:function(){var c=this.readVarint()+this.pos,o=this.buf.subarray(this.pos,c);return this.pos=c,o},readPackedVarint:function(c,o){if(this.type!==za.Bytes)return c.push(this.readVarint(o));var f=ss(this);for(c=c||[];this.pos<f;)c.push(this.readVarint(o));return c},readPackedSVarint:function(c){if(this.type!==za.Bytes)return c.push(this.readSVarint());var o=ss(this);for(c=c||[];this.pos<o;)c.push(this.readSVarint());return c},readPackedBoolean:function(c){if(this.type!==za.Bytes)return c.push(this.readBoolean());var o=ss(this);for(c=c||[];this.pos<o;)c.push(this.readBoolean());return c},readPackedFloat:function(c){if(this.type!==za.Bytes)return c.push(this.readFloat());var o=ss(this);for(c=c||[];this.pos<o;)c.push(this.readFloat());return c},readPackedDouble:function(c){if(this.type!==za.Bytes)return c.push(this.readDouble());var o=ss(this);for(c=c||[];this.pos<o;)c.push(this.readDouble());return c},readPackedFixed32:function(c){if(this.type!==za.Bytes)return c.push(this.readFixed32());var o=ss(this);for(c=c||[];this.pos<o;)c.push(this.readFixed32());return c},readPackedSFixed32:function(c){if(this.type!==za.Bytes)return c.push(this.readSFixed32());var o=ss(this);for(c=c||[];this.pos<o;)c.push(this.readSFixed32());return c},readPackedFixed64:function(c){if(this.type!==za.Bytes)return c.push(this.readFixed64());var o=ss(this);for(c=c||[];this.pos<o;)c.push(this.readFixed64());return c},readPackedSFixed64:function(c){if(this.type!==za.Bytes)return c.push(this.readSFixed64());var o=ss(this);for(c=c||[];this.pos<o;)c.push(this.readSFixed64());return c},skip:function(c){var o=7&c;if(o===za.Varint)for(;this.buf[this.pos++]>127;);else if(o===za.Bytes)this.pos=this.readVarint()+this.pos;else if(o===za.Fixed32)this.pos+=4;else{if(o!==za.Fixed64)throw new Error("Unimplemented type: "+o);this.pos+=8}},writeTag:function(c,o){this.writeVarint(c<<3|o)},realloc:function(c){for(var o=this.length||16;o<this.pos+c;)o*=2;if(o!==this.length){var f=new Uint8Array(o);f.set(this.buf),this.buf=f,this.length=o}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(c){this.realloc(4),Et(this.buf,c,this.pos),this.pos+=4},writeSFixed32:function(c){this.realloc(4),Et(this.buf,c,this.pos),this.pos+=4},writeFixed64:function(c){this.realloc(8),Et(this.buf,-1&c,this.pos),Et(this.buf,Math.floor(c*Ca),this.pos+4),this.pos+=8},writeSFixed64:function(c){this.realloc(8),Et(this.buf,-1&c,this.pos),Et(this.buf,Math.floor(c*Ca),this.pos+4),this.pos+=8},writeVarint:function(c){(c=+c||0)>268435455||c<0?function(o,f){var E,L;if(o>=0?(E=o%4294967296|0,L=o/4294967296|0):(L=~(-o/4294967296),4294967295^(E=~(-o%4294967296))?E=E+1|0:(E=0,L=L+1|0)),o>=18446744073709552e3||o<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");f.realloc(10),function(V,X,J){J.buf[J.pos++]=127&V|128,V>>>=7,J.buf[J.pos++]=127&V|128,V>>>=7,J.buf[J.pos++]=127&V|128,V>>>=7,J.buf[J.pos++]=127&V|128,J.buf[J.pos]=127&(V>>>=7)}(E,0,f),function(V,X){var J=(7&V)<<4;X.buf[X.pos++]|=J|((V>>>=3)?128:0),V&&(X.buf[X.pos++]=127&V|((V>>>=7)?128:0),V&&(X.buf[X.pos++]=127&V|((V>>>=7)?128:0),V&&(X.buf[X.pos++]=127&V|((V>>>=7)?128:0),V&&(X.buf[X.pos++]=127&V|((V>>>=7)?128:0),V&&(X.buf[X.pos++]=127&V)))))}(L,f)}(c,this):(this.realloc(4),this.buf[this.pos++]=127&c|(c>127?128:0),c<=127||(this.buf[this.pos++]=127&(c>>>=7)|(c>127?128:0),c<=127||(this.buf[this.pos++]=127&(c>>>=7)|(c>127?128:0),c<=127||(this.buf[this.pos++]=c>>>7&127))))},writeSVarint:function(c){this.writeVarint(c<0?2*-c-1:2*c)},writeBoolean:function(c){this.writeVarint(!!c)},writeString:function(c){c=String(c),this.realloc(4*c.length),this.pos++;var o=this.pos;this.pos=function(E,L,V){for(var X,J,oe=0;oe<L.length;oe++){if((X=L.charCodeAt(oe))>55295&&X<57344){if(!J){X>56319||oe+1===L.length?(E[V++]=239,E[V++]=191,E[V++]=189):J=X;continue}if(X<56320){E[V++]=239,E[V++]=191,E[V++]=189,J=X;continue}X=J-55296<<10|X-56320|65536,J=null}else J&&(E[V++]=239,E[V++]=191,E[V++]=189,J=null);X<128?E[V++]=X:(X<2048?E[V++]=X>>6|192:(X<65536?E[V++]=X>>12|224:(E[V++]=X>>18|240,E[V++]=X>>12&63|128),E[V++]=X>>6&63|128),E[V++]=63&X|128)}return V}(this.buf,c,this.pos);var f=this.pos-o;f>=128&&ya(o,f,this),this.pos=o-1,this.writeVarint(f),this.pos+=f},writeFloat:function(c){this.realloc(4),uu(this.buf,c,this.pos,!0,23,4),this.pos+=4},writeDouble:function(c){this.realloc(8),uu(this.buf,c,this.pos,!0,52,8),this.pos+=8},writeBytes:function(c){var o=c.length;this.writeVarint(o),this.realloc(o);for(var f=0;f<o;f++)this.buf[this.pos++]=c[f]},writeRawMessage:function(c,o){this.pos++;var f=this.pos;c(o,this);var E=this.pos-f;E>=128&&ya(f,E,this),this.pos=f-1,this.writeVarint(E),this.pos+=E},writeMessage:function(c,o,f){this.writeTag(c,za.Bytes),this.writeRawMessage(o,f)},writePackedVarint:function(c,o){o.length&&this.writeMessage(c,Qo,o)},writePackedSVarint:function(c,o){o.length&&this.writeMessage(c,Qs,o)},writePackedBoolean:function(c,o){o.length&&this.writeMessage(c,Xr,o)},writePackedFloat:function(c,o){o.length&&this.writeMessage(c,Cp,o)},writePackedDouble:function(c,o){o.length&&this.writeMessage(c,Ft,o)},writePackedFixed32:function(c,o){o.length&&this.writeMessage(c,Mr,o)},writePackedSFixed32:function(c,o){o.length&&this.writeMessage(c,Bi,o)},writePackedFixed64:function(c,o){o.length&&this.writeMessage(c,Ma,o)},writePackedSFixed64:function(c,o){o.length&&this.writeMessage(c,el,o)},writeBytesField:function(c,o){this.writeTag(c,za.Bytes),this.writeBytes(o)},writeFixed32Field:function(c,o){this.writeTag(c,za.Fixed32),this.writeFixed32(o)},writeSFixed32Field:function(c,o){this.writeTag(c,za.Fixed32),this.writeSFixed32(o)},writeFixed64Field:function(c,o){this.writeTag(c,za.Fixed64),this.writeFixed64(o)},writeSFixed64Field:function(c,o){this.writeTag(c,za.Fixed64),this.writeSFixed64(o)},writeVarintField:function(c,o){this.writeTag(c,za.Varint),this.writeVarint(o)},writeSVarintField:function(c,o){this.writeTag(c,za.Varint),this.writeSVarint(o)},writeStringField:function(c,o){this.writeTag(c,za.Bytes),this.writeString(o)},writeFloatField:function(c,o){this.writeTag(c,za.Fixed32),this.writeFloat(o)},writeDoubleField:function(c,o){this.writeTag(c,za.Fixed64),this.writeDouble(o)},writeBooleanField:function(c,o){this.writeVarintField(c,!!o)}};var Br=be(du);const Ir=3;function Jt(c,o,f){c===1&&f.readMessage(sr,o)}function sr(c,o,f){if(c===3){const{id:E,bitmap:L,width:V,height:X,left:J,top:oe,advance:me}=f.readMessage(lr,{});o.push({id:E,bitmap:new xl({width:V+2*Ir,height:X+2*Ir},L),metrics:{width:V,height:X,left:J,top:oe,advance:me}})}}function lr(c,o,f){c===1?o.id=f.readVarint():c===2?o.bitmap=f.readBytes():c===3?o.width=f.readVarint():c===4?o.height=f.readVarint():c===5?o.left=f.readSVarint():c===6?o.top=f.readSVarint():c===7&&(o.advance=f.readVarint())}const Mt=Ir;function Xt(c){let o=0,f=0;for(const X of c)o+=X.w*X.h,f=Math.max(f,X.w);c.sort((X,J)=>J.h-X.h);const E=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(o/.95)),f),h:1/0}];let L=0,V=0;for(const X of c)for(let J=E.length-1;J>=0;J--){const oe=E[J];if(!(X.w>oe.w||X.h>oe.h)){if(X.x=oe.x,X.y=oe.y,V=Math.max(V,X.y+X.h),L=Math.max(L,X.x+X.w),X.w===oe.w&&X.h===oe.h){const me=E.pop();J<E.length&&(E[J]=me)}else X.h===oe.h?(oe.x+=X.w,oe.w-=X.w):X.w===oe.w?(oe.y+=X.h,oe.h-=X.h):(E.push({x:oe.x+X.w,y:oe.y,w:oe.w-X.w,h:X.h}),oe.y+=X.h,oe.h-=X.h);break}}return{w:L,h:V,fill:o/(L*V)||0}}const pt=1;class $t{constructor(o,{pixelRatio:f,version:E,stretchX:L,stretchY:V,content:X}){this.paddedRect=o,this.pixelRatio=f,this.stretchX=L,this.stretchY=V,this.content=X,this.version=E}get tl(){return[this.paddedRect.x+pt,this.paddedRect.y+pt]}get br(){return[this.paddedRect.x+this.paddedRect.w-pt,this.paddedRect.y+this.paddedRect.h-pt]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*pt)/this.pixelRatio,(this.paddedRect.h-2*pt)/this.pixelRatio]}}class zr{constructor(o,f){const E={},L={};this.haveRenderCallbacks=[];const V=[];this.addImages(o,E,V),this.addImages(f,L,V);const{w:X,h:J}=Xt(V),oe=new dc({width:X||1,height:J||1});for(const me in o){const Me=o[me],De=E[me].paddedRect;dc.copy(Me.data,oe,{x:0,y:0},{x:De.x+pt,y:De.y+pt},Me.data)}for(const me in f){const Me=f[me],De=L[me].paddedRect,Ye=De.x+pt,ot=De.y+pt,lt=Me.data.width,Ct=Me.data.height;dc.copy(Me.data,oe,{x:0,y:0},{x:Ye,y:ot},Me.data),dc.copy(Me.data,oe,{x:0,y:Ct-1},{x:Ye,y:ot-1},{width:lt,height:1}),dc.copy(Me.data,oe,{x:0,y:0},{x:Ye,y:ot+Ct},{width:lt,height:1}),dc.copy(Me.data,oe,{x:lt-1,y:0},{x:Ye-1,y:ot},{width:1,height:Ct}),dc.copy(Me.data,oe,{x:0,y:0},{x:Ye+lt,y:ot},{width:1,height:Ct})}this.image=oe,this.iconPositions=E,this.patternPositions=L}addImages(o,f,E){for(const L in o){const V=o[L],X={x:0,y:0,w:V.data.width+2*pt,h:V.data.height+2*pt};E.push(X),f[L]=new $t(X,V),V.hasRenderCallback&&this.haveRenderCallbacks.push(L)}}patchUpdatedImages(o,f){o.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const E in o.updatedImages)this.patchUpdatedImage(this.iconPositions[E],o.getImage(E),f),this.patchUpdatedImage(this.patternPositions[E],o.getImage(E),f)}patchUpdatedImage(o,f,E){if(!o||!f||o.version===f.version)return;o.version=f.version;const[L,V]=o.tl;E.update(f.data,void 0,{x:L,y:V})}}var $r;oi("ImagePosition",$t),oi("ImageAtlas",zr),R.ai=void 0,($r=R.ai||(R.ai={}))[$r.none=0]="none",$r[$r.horizontal=1]="horizontal",$r[$r.vertical=2]="vertical",$r[$r.horizontalOnly=3]="horizontalOnly";const Tn=-17;class vn{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(o,f){const E=new vn;return E.scale=o||1,E.fontStack=f,E}static forImage(o){const f=new vn;return f.imageName=o,f}}class _n{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(o,f){const E=new _n;for(let L=0;L<o.sections.length;L++){const V=o.sections[L];V.image?E.addImageSection(V):E.addTextSection(V,f)}return E}length(){return this.text.length}getSection(o){return this.sections[this.sectionIndex[o]]}getSectionIndex(o){return this.sectionIndex[o]}getCharCode(o){return this.text.charCodeAt(o)}verticalizePunctuation(){this.text=function(o){let f="";for(let E=0;E<o.length;E++){const L=o.charCodeAt(E+1)||null,V=o.charCodeAt(E-1)||null;f+=L&&Op(L)&&!Js[o[E+1]]||V&&Op(V)&&!Js[o[E-1]]||!Js[o[E]]?o[E]:Js[o[E]]}return f}(this.text)}trim(){let o=0;for(let E=0;E<this.text.length&&Fi[this.text.charCodeAt(E)];E++)o++;let f=this.text.length;for(let E=this.text.length-1;E>=0&&E>=o&&Fi[this.text.charCodeAt(E)];E--)f--;this.text=this.text.substring(o,f),this.sectionIndex=this.sectionIndex.slice(o,f)}substring(o,f){const E=new _n;return E.text=this.text.substring(o,f),E.sectionIndex=this.sectionIndex.slice(o,f),E.sections=this.sections,E}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((o,f)=>Math.max(o,this.sections[f].scale),0)}addTextSection(o,f){this.text+=o.text,this.sections.push(vn.forText(o.scale,o.fontStack||f));const E=this.sections.length-1;for(let L=0;L<o.text.length;++L)this.sectionIndex.push(E)}addImageSection(o){const f=o.image?o.image.name:"";if(f.length===0)return void rn("Can't add FormattedSection with an empty image.");const E=this.getNextImageSectionCharCode();E?(this.text+=String.fromCharCode(E),this.sections.push(vn.forImage(f)),this.sectionIndex.push(this.sections.length-1)):rn("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Qn(c,o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot,lt,Ct){const Gt=_n.fromFeature(c,L);let Kt;De===R.ai.vertical&&Gt.verticalizePunctuation();const{processBidirectionalText:Er,processStyledBidirectionalText:cr}=Rs;if(Er&&Gt.sections.length===1){Kt=[];const Fn=Er(Gt.toString(),ed(Gt,me,V,o,E,ot,lt));for(const Ki of Fn){const Co=new _n;Co.text=Ki,Co.sections=Gt.sections;for(let $i=0;$i<Ki.length;$i++)Co.sectionIndex.push(0);Kt.push(Co)}}else if(cr){Kt=[];const Fn=cr(Gt.text,Gt.sectionIndex,ed(Gt,me,V,o,E,ot,lt));for(const Ki of Fn){const Co=new _n;Co.text=Ki[0],Co.sectionIndex=Ki[1],Co.sections=Gt.sections,Kt.push(Co)}}else Kt=function(Fn,Ki){const Co=[],$i=Fn.text;let Zi=0;for(const Ri of Ki)Co.push(Fn.substring(Zi,Ri)),Zi=Ri;return Zi<$i.length&&Co.push(Fn.substring(Zi,$i.length)),Co}(Gt,ed(Gt,me,V,o,E,ot,lt));const Rr=[],Qr={positionedLines:Rr,text:Gt.toString(),top:Me[1],bottom:Me[1],left:Me[0],right:Me[0],writingMode:De,iconsInText:!1,verticalizable:!1};return function(Fn,Ki,Co,$i,Zi,Ri,vo,Ii,ni,jo,Do,rs){let iu=0,tl=Tn,gc=0,Pp=0;const sp=Ii==="right"?1:Ii==="left"?0:.5;let kc=0;for(const jl of Zi){jl.trim();const _h=jl.getMaxScale(),vc=(_h-1)*ps,xp={positionedGlyphs:[],lineOffset:0};Fn.positionedLines[kc]=xp;const up=xp.positionedGlyphs;let Mh=0;if(!jl.length()){tl+=Ri,++kc;continue}for(let oc=0;oc<jl.length();oc++){const Ss=jl.getSection(oc),Ph=jl.getSectionIndex(oc),Rh=jl.getCharCode(oc);let Nc=0,Cf=null,Vp=null,Mf=null,md=ps;const Pf=!(ni===R.ai.horizontal||!Do&&!Mc(Rh)||Do&&(Fi[Rh]||(gh=Rh,ai.Arabic(gh)||ai["Arabic Supplement"](gh)||ai["Arabic Extended-A"](gh)||ai["Arabic Presentation Forms-A"](gh)||ai["Arabic Presentation Forms-B"](gh))));if(Ss.imageName){const Rf=$i[Ss.imageName];if(!Rf)continue;Mf=Ss.imageName,Fn.iconsInText=Fn.iconsInText||!0,Vp=Rf.paddedRect;const Rp=Rf.displaySize;Ss.scale=Ss.scale*ps/rs,Cf={width:Rp[0],height:Rp[1],left:pt,top:-Mt,advance:Pf?Rp[1]:Rp[0]},Nc=vc+(ps-Rp[1]*Ss.scale),md=Cf.advance;const $c=Pf?Rp[0]*Ss.scale-ps*_h:Rp[1]*Ss.scale-ps*_h;$c>0&&$c>Mh&&(Mh=$c)}else{const Rf=Co[Ss.fontStack],Rp=Rf&&Rf[Rh];if(Rp&&Rp.rect)Vp=Rp.rect,Cf=Rp.metrics;else{const $c=Ki[Ss.fontStack],Vd=$c&&$c[Rh];if(!Vd)continue;Cf=Vd.metrics}Nc=(_h-Ss.scale)*ps}Pf?(Fn.verticalizable=!0,up.push({glyph:Rh,imageName:Mf,x:iu,y:tl+Nc,vertical:Pf,scale:Ss.scale,fontStack:Ss.fontStack,sectionIndex:Ph,metrics:Cf,rect:Vp}),iu+=md*Ss.scale+jo):(up.push({glyph:Rh,imageName:Mf,x:iu,y:tl+Nc,vertical:Pf,scale:Ss.scale,fontStack:Ss.fontStack,sectionIndex:Ph,metrics:Cf,rect:Vp}),iu+=Cf.advance*Ss.scale+jo)}up.length!==0&&(gc=Math.max(iu-jo,gc),Sd(up,0,up.length-1,sp,Mh)),iu=0;const _c=Ri*_h+Mh;xp.lineOffset=Math.max(Mh,vc),tl+=_c,Pp=Math.max(_c,Pp),++kc}var gh;const lp=tl-Tn,{horizontalAlign:vh,verticalAlign:Ys}=Ch(vo);(function(jl,_h,vc,xp,up,Mh,_c,oc,Ss){const Ph=(_h-vc)*up;let Rh=0;Rh=Mh!==_c?-oc*xp-Tn:(-xp*Ss+.5)*_c;for(const Nc of jl)for(const Cf of Nc.positionedGlyphs)Cf.x+=Ph,Cf.y+=Rh})(Fn.positionedLines,sp,vh,Ys,gc,Pp,Ri,lp,Zi.length),Fn.top+=-Ys*lp,Fn.bottom=Fn.top+lp,Fn.left+=-vh*gc,Fn.right=Fn.left+gc}(Qr,o,f,E,Kt,X,J,oe,De,me,Ye,Ct),!function(Fn){for(const Ki of Fn)if(Ki.positionedGlyphs.length!==0)return!1;return!0}(Rr)&&Qr}const Fi={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Vr={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function po(c,o,f,E,L,V){if(o.imageName){const X=E[o.imageName];return X?X.displaySize[0]*o.scale*ps/V+L:0}{const X=f[o.fontStack],J=X&&X[c];return J?J.metrics.advance*o.scale+L:0}}function la(c,o,f,E){const L=Math.pow(c-o,2);return E?c<o?L/2:2*L:L+Math.abs(f)*f}function Ns(c,o,f){let E=0;return c===10&&(E-=1e4),f&&(E+=150),c!==40&&c!==65288||(E+=50),o!==41&&o!==65289||(E+=50),E}function Fl(c,o,f,E,L,V){let X=null,J=la(o,f,L,V);for(const oe of E){const me=la(o-oe.x,f,L,V)+oe.badness;me<=J&&(X=oe,J=me)}return{index:c,x:o,priorBreak:X,badness:J}}function ic(c){return c?ic(c.priorBreak).concat(c.index):[]}function ed(c,o,f,E,L,V,X){if(V!=="point")return[];if(!c)return[];const J=[],oe=function(Ye,ot,lt,Ct,Gt,Kt){let Er=0;for(let cr=0;cr<Ye.length();cr++){const Rr=Ye.getSection(cr);Er+=po(Ye.getCharCode(cr),Rr,Ct,Gt,ot,Kt)}return Er/Math.max(1,Math.ceil(Er/lt))}(c,o,f,E,L,X),me=c.text.indexOf("\u200B")>=0;let Me=0;for(let Ye=0;Ye<c.length();Ye++){const ot=c.getSection(Ye),lt=c.getCharCode(Ye);if(Fi[lt]||(Me+=po(lt,ot,E,L,o,X)),Ye<c.length()-1){const Ct=!((De=lt)<11904||!(ai["Bopomofo Extended"](De)||ai.Bopomofo(De)||ai["CJK Compatibility Forms"](De)||ai["CJK Compatibility Ideographs"](De)||ai["CJK Compatibility"](De)||ai["CJK Radicals Supplement"](De)||ai["CJK Strokes"](De)||ai["CJK Symbols and Punctuation"](De)||ai["CJK Unified Ideographs Extension A"](De)||ai["CJK Unified Ideographs"](De)||ai["Enclosed CJK Letters and Months"](De)||ai["Halfwidth and Fullwidth Forms"](De)||ai.Hiragana(De)||ai["Ideographic Description Characters"](De)||ai["Kangxi Radicals"](De)||ai["Katakana Phonetic Extensions"](De)||ai.Katakana(De)||ai["Vertical Forms"](De)||ai["Yi Radicals"](De)||ai["Yi Syllables"](De)));(Vr[lt]||Ct||ot.imageName)&&J.push(Fl(Ye+1,Me,oe,J,Ns(lt,c.getCharCode(Ye+1),Ct&&me),!1))}}var De;return ic(Fl(c.length(),Me,oe,J,0,!0))}function Ch(c){let o=.5,f=.5;switch(c){case"right":case"top-right":case"bottom-right":o=1;break;case"left":case"top-left":case"bottom-left":o=0}switch(c){case"bottom":case"bottom-right":case"bottom-left":f=1;break;case"top":case"top-right":case"top-left":f=0}return{horizontalAlign:o,verticalAlign:f}}function Sd(c,o,f,E,L){if(!E&&!L)return;const V=c[f],X=(c[f].x+V.metrics.advance*V.scale)*E;for(let J=o;J<=f;J++)c[J].x-=X,c[J].y+=L}function Up(c,o,f){const{horizontalAlign:E,verticalAlign:L}=Ch(f),V=o[0]-c.displaySize[0]*E,X=o[1]-c.displaySize[1]*L;return{image:c,top:X,bottom:X+c.displaySize[1],left:V,right:V+c.displaySize[0]}}function td(c,o,f,E,L,V){const X=c.image;let J;if(X.content){const Gt=X.content,Kt=X.pixelRatio||1;J=[Gt[0]/Kt,Gt[1]/Kt,X.displaySize[0]-Gt[2]/Kt,X.displaySize[1]-Gt[3]/Kt]}const oe=o.left*V,me=o.right*V;let Me,De,Ye,ot;f==="width"||f==="both"?(ot=L[0]+oe-E[3],De=L[0]+me+E[1]):(ot=L[0]+(oe+me-X.displaySize[0])/2,De=ot+X.displaySize[0]);const lt=o.top*V,Ct=o.bottom*V;return f==="height"||f==="both"?(Me=L[1]+lt-E[0],Ye=L[1]+Ct+E[2]):(Me=L[1]+(lt+Ct-X.displaySize[1])/2,Ye=Me+X.displaySize[1]),{image:X,top:Me,right:De,bottom:Ye,left:ot,collisionPadding:J}}const dd=255,Zp=128,wf=dd*Zp;function Td(c,o){const{expression:f}=o;if(f.kind==="constant")return{kind:"constant",layoutSize:f.evaluate(new hs(c+1))};if(f.kind==="source")return{kind:"source"};{const{zoomStops:E,interpolationType:L}=f;let V=0;for(;V<E.length&&E[V]<=c;)V++;V=Math.max(0,V-1);let X=V;for(;X<E.length&&E[X]<c+1;)X++;X=Math.min(E.length-1,X);const J=E[V],oe=E[X];return f.kind==="composite"?{kind:"composite",minZoom:J,maxZoom:oe,interpolationType:L}:{kind:"camera",minZoom:J,maxZoom:oe,minSize:f.evaluate(new hs(J)),maxSize:f.evaluate(new hs(oe)),interpolationType:L}}}function Sf(c,o,f){let E="never";const L=c.get(o);return L?E=L:c.get(f)&&(E="always"),E}const sm=cl.VectorTileFeature.types,Ud=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Ad(c,o,f,E,L,V,X,J,oe,me,Me,De,Ye){const ot=J?Math.min(wf,Math.round(J[0])):0,lt=J?Math.min(wf,Math.round(J[1])):0;c.emplaceBack(o,f,Math.round(32*E),Math.round(32*L),V,X,(ot<<1)+(oe?1:0),lt,16*me,16*Me,256*De,256*Ye)}function Bu(c,o,f){c.emplaceBack(o.x,o.y,f),c.emplaceBack(o.x,o.y,f),c.emplaceBack(o.x,o.y,f),c.emplaceBack(o.x,o.y,f)}function nu(c){for(const o of c.sections)if(hc(o.text))return!0;return!1}class lm{constructor(o){this.layoutVertexArray=new Hr,this.indexArray=new Di,this.programConfigurations=o,this.segments=new Wi,this.dynamicLayoutVertexArray=new sn,this.opacityVertexArray=new nn,this.hasVisibleVertices=!1,this.placedSymbolArray=new te}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(o,f,E,L){this.isEmpty()||(E&&(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,Jo.members),this.indexBuffer=o.createIndexBuffer(this.indexArray,f),this.dynamicLayoutVertexBuffer=o.createVertexBuffer(this.dynamicLayoutVertexArray,Es.members,!0),this.opacityVertexBuffer=o.createVertexBuffer(this.opacityVertexArray,Ud,!0),this.opacityVertexBuffer.itemSize=1),(E||L)&&this.programConfigurations.upload(o))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}oi("SymbolBuffers",lm);class Cd{constructor(o,f,E){this.layoutVertexArray=new o,this.layoutAttributes=f,this.indexArray=new E,this.segments=new Wi,this.collisionVertexArray=new di}upload(o){this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=o.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=o.createVertexBuffer(this.collisionVertexArray,Cu.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}oi("CollisionBuffers",Cd);class rd{constructor(o){this.collisionBoxArray=o.collisionBoxArray,this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(X=>X.id),this.index=o.index,this.pixelRatio=o.pixelRatio,this.sourceLayerIndex=o.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=tf([]),this.placementViewportMatrix=tf([]);const f=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Td(this.zoom,f["text-size"]),this.iconSizeData=Td(this.zoom,f["icon-size"]);const E=this.layers[0].layout,L=E.get("symbol-sort-key"),V=E.get("symbol-z-order");this.canOverlap=Sf(E,"text-overlap","text-allow-overlap")!=="never"||Sf(E,"icon-overlap","icon-allow-overlap")!=="never"||E.get("text-ignore-placement")||E.get("icon-ignore-placement"),this.sortFeaturesByKey=V!=="viewport-y"&&!L.isConstant(),this.sortFeaturesByY=(V==="viewport-y"||V==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,E.get("symbol-placement")==="point"&&(this.writingModes=E.get("text-writing-mode").map(X=>R.ai[X])),this.stateDependentLayerIds=this.layers.filter(X=>X.isStateDependent()).map(X=>X.id),this.sourceID=o.sourceID}createArrays(){this.text=new lm(new ml(this.layers,this.zoom,o=>/^text/.test(o))),this.icon=new lm(new ml(this.layers,this.zoom,o=>/^icon/.test(o))),this.glyphOffsetArray=new Te,this.lineVertexArray=new Ie,this.symbolInstances=new ce,this.textAnchorOffsets=new Qe}calculateGlyphDependencies(o,f,E,L,V){for(let X=0;X<o.length;X++)if(f[o.charCodeAt(X)]=!0,(E||L)&&V){const J=Js[o.charAt(X)];J&&(f[J.charCodeAt(0)]=!0)}}populate(o,f,E){const L=this.layers[0],V=L.layout,X=V.get("text-font"),J=V.get("text-field"),oe=V.get("icon-image"),me=(J.value.kind!=="constant"||J.value.value instanceof Fo&&!J.value.value.isEmpty()||J.value.value.toString().length>0)&&(X.value.kind!=="constant"||X.value.value.length>0),Me=oe.value.kind!=="constant"||!!oe.value.value||Object.keys(oe.parameters).length>0,De=V.get("symbol-sort-key");if(this.features=[],!me&&!Me)return;const Ye=f.iconDependencies,ot=f.glyphDependencies,lt=f.availableImages,Ct=new hs(this.zoom);for(const{feature:Gt,id:Kt,index:Er,sourceLayerIndex:cr}of o){const Rr=L._featureFilter.needGeometry,Qr=Ol(Gt,Rr);if(!L._featureFilter.filter(Ct,Qr,E))continue;let Fn,Ki;if(Rr||(Qr.geometry=yl(Gt)),me){const $i=L.getValueAndResolveTokens("text-field",Qr,E,lt),Zi=Fo.factory($i);nu(Zi)&&(this.hasRTLText=!0),(!this.hasRTLText||ql()==="unavailable"||this.hasRTLText&&Rs.isParsed())&&(Fn=fu(Zi,L,Qr))}if(Me){const $i=L.getValueAndResolveTokens("icon-image",Qr,E,lt);Ki=$i instanceof Fa?$i:Fa.fromString($i)}if(!Fn&&!Ki)continue;const Co=this.sortFeaturesByKey?De.evaluate(Qr,{},E):void 0;if(this.features.push({id:Kt,text:Fn,icon:Ki,index:Er,sourceLayerIndex:cr,geometry:Qr.geometry,properties:Gt.properties,type:sm[Gt.type],sortKey:Co}),Ki&&(Ye[Ki.name]=!0),Fn){const $i=X.evaluate(Qr,{},E).join(","),Zi=V.get("text-rotation-alignment")!=="viewport"&&V.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(R.ai.vertical)>=0;for(const Ri of Fn.sections)if(Ri.image)Ye[Ri.image.name]=!0;else{const vo=is(Fn.toString()),Ii=Ri.fontStack||$i,ni=ot[Ii]=ot[Ii]||{};this.calculateGlyphDependencies(Ri.text,ni,Zi,this.allowVerticalPlacement,vo)}}}V.get("symbol-placement")==="line"&&(this.features=function(Gt){const Kt={},Er={},cr=[];let Rr=0;function Qr($i){cr.push(Gt[$i]),Rr++}function Fn($i,Zi,Ri){const vo=Er[$i];return delete Er[$i],Er[Zi]=vo,cr[vo].geometry[0].pop(),cr[vo].geometry[0]=cr[vo].geometry[0].concat(Ri[0]),vo}function Ki($i,Zi,Ri){const vo=Kt[Zi];return delete Kt[Zi],Kt[$i]=vo,cr[vo].geometry[0].shift(),cr[vo].geometry[0]=Ri[0].concat(cr[vo].geometry[0]),vo}function Co($i,Zi,Ri){const vo=Ri?Zi[0][Zi[0].length-1]:Zi[0][0];return`${$i}:${vo.x}:${vo.y}`}for(let $i=0;$i<Gt.length;$i++){const Zi=Gt[$i],Ri=Zi.geometry,vo=Zi.text?Zi.text.toString():null;if(!vo){Qr($i);continue}const Ii=Co(vo,Ri),ni=Co(vo,Ri,!0);if(Ii in Er&&ni in Kt&&Er[Ii]!==Kt[ni]){const jo=Ki(Ii,ni,Ri),Do=Fn(Ii,ni,cr[jo].geometry);delete Kt[Ii],delete Er[ni],Er[Co(vo,cr[Do].geometry,!0)]=Do,cr[jo].geometry=null}else Ii in Er?Fn(Ii,ni,Ri):ni in Kt?Ki(Ii,ni,Ri):(Qr($i),Kt[Ii]=Rr-1,Er[ni]=Rr-1)}return cr.filter($i=>$i.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Gt,Kt)=>Gt.sortKey-Kt.sortKey)}update(o,f,E){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(o,f,this.layers,E),this.icon.programConfigurations.updatePaintArrays(o,f,this.layers,E))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(o){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(o),this.iconCollisionBox.upload(o)),this.text.upload(o,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(o,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(o,f){const E=this.lineVertexArray.length;if(o.segment!==void 0){let L=o.dist(f[o.segment+1]),V=o.dist(f[o.segment]);const X={};for(let J=o.segment+1;J<f.length;J++)X[J]={x:f[J].x,y:f[J].y,tileUnitDistanceFromAnchor:L},J<f.length-1&&(L+=f[J+1].dist(f[J]));for(let J=o.segment||0;J>=0;J--)X[J]={x:f[J].x,y:f[J].y,tileUnitDistanceFromAnchor:V},J>0&&(V+=f[J-1].dist(f[J]));for(let J=0;J<f.length;J++){const oe=X[J];this.lineVertexArray.emplaceBack(oe.x,oe.y,oe.tileUnitDistanceFromAnchor)}}return{lineStartIndex:E,lineLength:this.lineVertexArray.length-E}}addSymbols(o,f,E,L,V,X,J,oe,me,Me,De,Ye){const ot=o.indexArray,lt=o.layoutVertexArray,Ct=o.segments.prepareSegment(4*f.length,lt,ot,this.canOverlap?X.sortKey:void 0),Gt=this.glyphOffsetArray.length,Kt=Ct.vertexLength,Er=this.allowVerticalPlacement&&J===R.ai.vertical?Math.PI/2:0,cr=X.text&&X.text.sections;for(let Rr=0;Rr<f.length;Rr++){const{tl:Qr,tr:Fn,bl:Ki,br:Co,tex:$i,pixelOffsetTL:Zi,pixelOffsetBR:Ri,minFontScaleX:vo,minFontScaleY:Ii,glyphOffset:ni,isSDF:jo,sectionIndex:Do}=f[Rr],rs=Ct.vertexLength,iu=ni[1];Ad(lt,oe.x,oe.y,Qr.x,iu+Qr.y,$i.x,$i.y,E,jo,Zi.x,Zi.y,vo,Ii),Ad(lt,oe.x,oe.y,Fn.x,iu+Fn.y,$i.x+$i.w,$i.y,E,jo,Ri.x,Zi.y,vo,Ii),Ad(lt,oe.x,oe.y,Ki.x,iu+Ki.y,$i.x,$i.y+$i.h,E,jo,Zi.x,Ri.y,vo,Ii),Ad(lt,oe.x,oe.y,Co.x,iu+Co.y,$i.x+$i.w,$i.y+$i.h,E,jo,Ri.x,Ri.y,vo,Ii),Bu(o.dynamicLayoutVertexArray,oe,Er),ot.emplaceBack(rs,rs+1,rs+2),ot.emplaceBack(rs+1,rs+2,rs+3),Ct.vertexLength+=4,Ct.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(ni[0]),Rr!==f.length-1&&Do===f[Rr+1].sectionIndex||o.programConfigurations.populatePaintArrays(lt.length,X,X.index,{},Ye,cr&&cr[Do])}o.placedSymbolArray.emplaceBack(oe.x,oe.y,Gt,this.glyphOffsetArray.length-Gt,Kt,me,Me,oe.segment,E?E[0]:0,E?E[1]:0,L[0],L[1],J,0,!1,0,De)}_addCollisionDebugVertex(o,f,E,L,V,X){return f.emplaceBack(0,0),o.emplaceBack(E.x,E.y,L,V,Math.round(X.x),Math.round(X.y))}addCollisionDebugVertices(o,f,E,L,V,X,J){const oe=V.segments.prepareSegment(4,V.layoutVertexArray,V.indexArray),me=oe.vertexLength,Me=V.layoutVertexArray,De=V.collisionVertexArray,Ye=J.anchorX,ot=J.anchorY;this._addCollisionDebugVertex(Me,De,X,Ye,ot,new Ce(o,f)),this._addCollisionDebugVertex(Me,De,X,Ye,ot,new Ce(E,f)),this._addCollisionDebugVertex(Me,De,X,Ye,ot,new Ce(E,L)),this._addCollisionDebugVertex(Me,De,X,Ye,ot,new Ce(o,L)),oe.vertexLength+=4;const lt=V.indexArray;lt.emplaceBack(me,me+1),lt.emplaceBack(me+1,me+2),lt.emplaceBack(me+2,me+3),lt.emplaceBack(me+3,me),oe.primitiveLength+=4}addDebugCollisionBoxes(o,f,E,L){for(let V=o;V<f;V++){const X=this.collisionBoxArray.get(V);this.addCollisionDebugVertices(X.x1,X.y1,X.x2,X.y2,L?this.textCollisionBox:this.iconCollisionBox,X.anchorPoint,E)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Cd(Gn,Bl.members,Ui),this.iconCollisionBox=new Cd(Gn,Bl.members,Ui);for(let o=0;o<this.symbolInstances.length;o++){const f=this.symbolInstances.get(o);this.addDebugCollisionBoxes(f.textBoxStartIndex,f.textBoxEndIndex,f,!0),this.addDebugCollisionBoxes(f.verticalTextBoxStartIndex,f.verticalTextBoxEndIndex,f,!0),this.addDebugCollisionBoxes(f.iconBoxStartIndex,f.iconBoxEndIndex,f,!1),this.addDebugCollisionBoxes(f.verticalIconBoxStartIndex,f.verticalIconBoxEndIndex,f,!1)}}_deserializeCollisionBoxesForSymbol(o,f,E,L,V,X,J,oe,me){const Me={};for(let De=f;De<E;De++){const Ye=o.get(De);Me.textBox={x1:Ye.x1,y1:Ye.y1,x2:Ye.x2,y2:Ye.y2,anchorPointX:Ye.anchorPointX,anchorPointY:Ye.anchorPointY},Me.textFeatureIndex=Ye.featureIndex;break}for(let De=L;De<V;De++){const Ye=o.get(De);Me.verticalTextBox={x1:Ye.x1,y1:Ye.y1,x2:Ye.x2,y2:Ye.y2,anchorPointX:Ye.anchorPointX,anchorPointY:Ye.anchorPointY},Me.verticalTextFeatureIndex=Ye.featureIndex;break}for(let De=X;De<J;De++){const Ye=o.get(De);Me.iconBox={x1:Ye.x1,y1:Ye.y1,x2:Ye.x2,y2:Ye.y2,anchorPointX:Ye.anchorPointX,anchorPointY:Ye.anchorPointY},Me.iconFeatureIndex=Ye.featureIndex;break}for(let De=oe;De<me;De++){const Ye=o.get(De);Me.verticalIconBox={x1:Ye.x1,y1:Ye.y1,x2:Ye.x2,y2:Ye.y2,anchorPointX:Ye.anchorPointX,anchorPointY:Ye.anchorPointY},Me.verticalIconFeatureIndex=Ye.featureIndex;break}return Me}deserializeCollisionBoxes(o){this.collisionArrays=[];for(let f=0;f<this.symbolInstances.length;f++){const E=this.symbolInstances.get(f);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(o,E.textBoxStartIndex,E.textBoxEndIndex,E.verticalTextBoxStartIndex,E.verticalTextBoxEndIndex,E.iconBoxStartIndex,E.iconBoxEndIndex,E.verticalIconBoxStartIndex,E.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(o,f){const E=o.placedSymbolArray.get(f),L=E.vertexStartIndex+4*E.numGlyphs;for(let V=E.vertexStartIndex;V<L;V+=4)o.indexArray.emplaceBack(V,V+1,V+2),o.indexArray.emplaceBack(V+1,V+2,V+3)}getSortedSymbolIndexes(o){if(this.sortedAngle===o&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const f=Math.sin(o),E=Math.cos(o),L=[],V=[],X=[];for(let J=0;J<this.symbolInstances.length;++J){X.push(J);const oe=this.symbolInstances.get(J);L.push(0|Math.round(f*oe.anchorX+E*oe.anchorY)),V.push(oe.featureIndex)}return X.sort((J,oe)=>L[J]-L[oe]||V[oe]-V[J]),X}addToSortKeyRanges(o,f){const E=this.sortKeyRanges[this.sortKeyRanges.length-1];E&&E.sortKey===f?E.symbolInstanceEnd=o+1:this.sortKeyRanges.push({sortKey:f,symbolInstanceStart:o,symbolInstanceEnd:o+1})}sortFeatures(o){if(this.sortFeaturesByY&&this.sortedAngle!==o&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(o),this.sortedAngle=o,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const f of this.symbolInstanceIndexes){const E=this.symbolInstances.get(f);this.featureSortOrder.push(E.featureIndex),[E.rightJustifiedTextSymbolIndex,E.centerJustifiedTextSymbolIndex,E.leftJustifiedTextSymbolIndex].forEach((L,V,X)=>{L>=0&&X.indexOf(L)===V&&this.addIndicesForPlacedSymbol(this.text,L)}),E.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,E.verticalPlacedTextSymbolIndex),E.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,E.placedIconSymbolIndex),E.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,E.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let bm,Nr;oi("SymbolBucket",rd,{omit:["layers","collisionBoxArray","features","compareText"]}),rd.MAX_GLYPHS=65535,rd.addDynamicAttributes=Bu;var um={get paint(){return Nr=Nr||new ul({"icon-opacity":new ao(Ur.paint_symbol["icon-opacity"]),"icon-color":new ao(Ur.paint_symbol["icon-color"]),"icon-halo-color":new ao(Ur.paint_symbol["icon-halo-color"]),"icon-halo-width":new ao(Ur.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ao(Ur.paint_symbol["icon-halo-blur"]),"icon-translate":new ji(Ur.paint_symbol["icon-translate"]),"icon-translate-anchor":new ji(Ur.paint_symbol["icon-translate-anchor"]),"text-opacity":new ao(Ur.paint_symbol["text-opacity"]),"text-color":new ao(Ur.paint_symbol["text-color"],{runtimeType:Za,getOverride:c=>c.textColor,hasOverride:c=>!!c.textColor}),"text-halo-color":new ao(Ur.paint_symbol["text-halo-color"]),"text-halo-width":new ao(Ur.paint_symbol["text-halo-width"]),"text-halo-blur":new ao(Ur.paint_symbol["text-halo-blur"]),"text-translate":new ji(Ur.paint_symbol["text-translate"]),"text-translate-anchor":new ji(Ur.paint_symbol["text-translate-anchor"])})},get layout(){return bm=bm||new ul({"symbol-placement":new ji(Ur.layout_symbol["symbol-placement"]),"symbol-spacing":new ji(Ur.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ji(Ur.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ao(Ur.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ji(Ur.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ji(Ur.layout_symbol["icon-allow-overlap"]),"icon-overlap":new ji(Ur.layout_symbol["icon-overlap"]),"icon-ignore-placement":new ji(Ur.layout_symbol["icon-ignore-placement"]),"icon-optional":new ji(Ur.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ji(Ur.layout_symbol["icon-rotation-alignment"]),"icon-size":new ao(Ur.layout_symbol["icon-size"]),"icon-text-fit":new ji(Ur.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ji(Ur.layout_symbol["icon-text-fit-padding"]),"icon-image":new ao(Ur.layout_symbol["icon-image"]),"icon-rotate":new ao(Ur.layout_symbol["icon-rotate"]),"icon-padding":new ao(Ur.layout_symbol["icon-padding"]),"icon-keep-upright":new ji(Ur.layout_symbol["icon-keep-upright"]),"icon-offset":new ao(Ur.layout_symbol["icon-offset"]),"icon-anchor":new ao(Ur.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ji(Ur.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ji(Ur.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ji(Ur.layout_symbol["text-rotation-alignment"]),"text-field":new ao(Ur.layout_symbol["text-field"]),"text-font":new ao(Ur.layout_symbol["text-font"]),"text-size":new ao(Ur.layout_symbol["text-size"]),"text-max-width":new ao(Ur.layout_symbol["text-max-width"]),"text-line-height":new ji(Ur.layout_symbol["text-line-height"]),"text-letter-spacing":new ao(Ur.layout_symbol["text-letter-spacing"]),"text-justify":new ao(Ur.layout_symbol["text-justify"]),"text-radial-offset":new ao(Ur.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ji(Ur.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new ao(Ur.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new ao(Ur.layout_symbol["text-anchor"]),"text-max-angle":new ji(Ur.layout_symbol["text-max-angle"]),"text-writing-mode":new ji(Ur.layout_symbol["text-writing-mode"]),"text-rotate":new ao(Ur.layout_symbol["text-rotate"]),"text-padding":new ji(Ur.layout_symbol["text-padding"]),"text-keep-upright":new ji(Ur.layout_symbol["text-keep-upright"]),"text-transform":new ao(Ur.layout_symbol["text-transform"]),"text-offset":new ao(Ur.layout_symbol["text-offset"]),"text-allow-overlap":new ji(Ur.layout_symbol["text-allow-overlap"]),"text-overlap":new ji(Ur.layout_symbol["text-overlap"]),"text-ignore-placement":new ji(Ur.layout_symbol["text-ignore-placement"]),"text-optional":new ji(Ur.layout_symbol["text-optional"])})}};class Tf{constructor(o){if(o.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=o.property.overrides?o.property.overrides.runtimeType:wa,this.defaultValue=o}evaluate(o){if(o.formattedSection){const f=this.defaultValue.property.overrides;if(f&&f.hasOverride(o.formattedSection))return f.getOverride(o.formattedSection)}return o.feature&&o.featureState?this.defaultValue.evaluate(o.feature,o.featureState):this.defaultValue.property.specification.default}eachChild(o){this.defaultValue.isConstant()||o(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}oi("FormatSectionOverride",Tf,{omit:["defaultValue"]});class Mp extends xa{constructor(o){super(o,um)}recalculate(o,f){if(super.recalculate(o,f),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const E=this.layout.get("text-writing-mode");if(E){const L=[];for(const V of E)L.indexOf(V)<0&&L.push(V);this.layout._values["text-writing-mode"]=L}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(o,f,E,L){const V=this.layout.get(o).evaluate(f,{},E,L),X=this._unevaluatedLayout._values[o];return X.isDataDriven()||Bs(X.value)||!V?V:function(J,oe){return oe.replace(/{([^{}]+)}/g,(me,Me)=>J&&Me in J?String(J[Me]):"")}(f.properties,V)}createBucket(o){return new rd(o)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const o of um.paint.overridableProperties){if(!Mp.hasPaintOverride(this.layout,o))continue;const f=this.paint.get(o),E=new Tf(f),L=new es(E,f.property.specification);let V=null;V=f.value.kind==="constant"||f.value.kind==="source"?new qp("source",L):new Sc("composite",L,f.value.zoomStops),this.paint._values[o]=new Gi(f.property,V,f.parameters)}}_handleOverridablePaintPropertyUpdate(o,f,E){return!(!this.layout||f.isDataDriven()||E.isDataDriven())&&Mp.hasPaintOverride(this.layout,o)}static hasPaintOverride(o,f){const E=o.get("text-field"),L=um.paint.properties[f];let V=!1;const X=J=>{for(const oe of J)if(L.overrides&&L.overrides.hasOverride(oe))return void(V=!0)};if(E.value.kind==="constant"&&E.value.value instanceof Fo)X(E.value.value.sections);else if(E.value.kind==="source"){const J=me=>{V||(me instanceof il&&oa(me.value)===Lt?X(me.value.sections):me instanceof Uc?X(me.sections):me.eachChild(J))},oe=E.value;oe._styleExpression&&J(oe._styleExpression.expression)}return V}}let Bm;var Kr={get paint(){return Bm=Bm||new ul({"background-color":new ji(Ur.paint_background["background-color"]),"background-pattern":new Gs(Ur.paint_background["background-pattern"]),"background-opacity":new ji(Ur.paint_background["background-opacity"])})}};class cm extends xa{constructor(o){super(o,Kr)}}let Af;var hm={get paint(){return Af=Af||new ul({"raster-opacity":new ji(Ur.paint_raster["raster-opacity"]),"raster-hue-rotate":new ji(Ur.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ji(Ur.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ji(Ur.paint_raster["raster-brightness-max"]),"raster-saturation":new ji(Ur.paint_raster["raster-saturation"]),"raster-contrast":new ji(Ur.paint_raster["raster-contrast"]),"raster-resampling":new ji(Ur.paint_raster["raster-resampling"]),"raster-fade-duration":new ji(Ur.paint_raster["raster-fade-duration"])})}};class Em extends xa{constructor(o){super(o,hm)}}class wm extends xa{constructor(o){super(o,{}),this.onAdd=f=>{this.implementation.onAdd&&this.implementation.onAdd(f,f.painter.context.gl)},this.onRemove=f=>{this.implementation.onRemove&&this.implementation.onRemove(f,f.painter.context.gl)},this.implementation=o}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Md{constructor(o){this._callback=o,this._triggered=!1,typeof MessageChannel!="undefined"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const cf=63710088e-1;class nd{constructor(o,f){if(isNaN(o)||isNaN(f))throw new Error(`Invalid LngLat object: (${o}, ${f})`);if(this.lng=+o,this.lat=+f,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new nd(Jn(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(o){const f=Math.PI/180,E=this.lat*f,L=o.lat*f,V=Math.sin(E)*Math.sin(L)+Math.cos(E)*Math.cos(L)*Math.cos((o.lng-this.lng)*f);return cf*Math.acos(Math.min(V,1))}static convert(o){if(o instanceof nd)return o;if(Array.isArray(o)&&(o.length===2||o.length===3))return new nd(Number(o[0]),Number(o[1]));if(!Array.isArray(o)&&typeof o=="object"&&o!==null)return new nd(Number("lng"in o?o.lng:o.lon),Number(o.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const Sm=2*Math.PI*cf;function qm(c){return Sm*Math.cos(c*Math.PI/180)}function mc(c){return(180+c)/360}function mh(c){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c*Math.PI/360)))/360}function Zd(c,o){return c/qm(o)}function i(c){return 360*c-180}function l(c){return 360/Math.PI*Math.atan(Math.exp((180-360*c)*Math.PI/180))-90}class _{constructor(o,f,E=0){this.x=+o,this.y=+f,this.z=+E}static fromLngLat(o,f=0){const E=nd.convert(o);return new _(mc(E.lng),mh(E.lat),Zd(f,E.lat))}toLngLat(){return new nd(i(this.x),l(this.y))}toAltitude(){return this.z*qm(l(this.y))}meterInMercatorCoordinateUnits(){return 1/Sm*(o=l(this.y),1/Math.cos(o*Math.PI/180));var o}}function S(c,o,f){var E=2*Math.PI*6378137/256/Math.pow(2,f);return[c*E-2*Math.PI*6378137/2,o*E-2*Math.PI*6378137/2]}class F{constructor(o,f,E){if(o<0||o>25||E<0||E>=Math.pow(2,o)||f<0||f>=Math.pow(2,o))throw new Error(`x=${f}, y=${E}, z=${o} outside of bounds. 0<=x<${Math.pow(2,o)}, 0<=y<${Math.pow(2,o)} 0<=z<=25 `);this.z=o,this.x=f,this.y=E,this.key=v(0,o,o,f,E)}equals(o){return this.z===o.z&&this.x===o.x&&this.y===o.y}url(o,f,E){const L=(X=this.y,J=this.z,oe=S(256*(V=this.x),256*(X=Math.pow(2,J)-X-1),J),me=S(256*(V+1),256*(X+1),J),oe[0]+","+oe[1]+","+me[0]+","+me[1]);var V,X,J,oe,me;const Me=function(De,Ye,ot){let lt,Ct="";for(let Gt=De;Gt>0;Gt--)lt=1<<Gt-1,Ct+=(Ye&lt?1:0)+(ot&lt?2:0);return Ct}(this.z,this.x,this.y);return o[(this.x+this.y)%o.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(E==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,f>1?"@2x":"").replace(/{quadkey}/g,Me).replace(/{bbox-epsg-3857}/g,L)}isChildOf(o){const f=this.z-o.z;return f>0&&o.x===this.x>>f&&o.y===this.y>>f}getTilePoint(o){const f=Math.pow(2,this.z);return new Ce((o.x*f-this.x)*Ws,(o.y*f-this.y)*Ws)}toString(){return`${this.z}/${this.x}/${this.y}`}}class j{constructor(o,f){this.wrap=o,this.canonical=f,this.key=v(o,f.z,f.z,f.x,f.y)}}class p{constructor(o,f,E,L,V){if(o<E)throw new Error(`overscaledZ should be >= z; overscaledZ = ${o}; z = ${E}`);this.overscaledZ=o,this.wrap=f,this.canonical=new F(E,+L,+V),this.key=v(f,o,E,L,V)}clone(){return new p(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(o){return this.overscaledZ===o.overscaledZ&&this.wrap===o.wrap&&this.canonical.equals(o.canonical)}scaledTo(o){if(o>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${o}; overscaledZ = ${this.overscaledZ}`);const f=this.canonical.z-o;return o>this.canonical.z?new p(o,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new p(o,this.wrap,o,this.canonical.x>>f,this.canonical.y>>f)}calculateScaledKey(o,f){if(o>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${o}; overscaledZ = ${this.overscaledZ}`);const E=this.canonical.z-o;return o>this.canonical.z?v(this.wrap*+f,o,this.canonical.z,this.canonical.x,this.canonical.y):v(this.wrap*+f,o,o,this.canonical.x>>E,this.canonical.y>>E)}isChildOf(o){if(o.wrap!==this.wrap)return!1;const f=this.canonical.z-o.canonical.z;return o.overscaledZ===0||o.overscaledZ<this.overscaledZ&&o.canonical.x===this.canonical.x>>f&&o.canonical.y===this.canonical.y>>f}children(o){if(this.overscaledZ>=o)return[new p(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const f=this.canonical.z+1,E=2*this.canonical.x,L=2*this.canonical.y;return[new p(f,this.wrap,f,E,L),new p(f,this.wrap,f,E+1,L),new p(f,this.wrap,f,E,L+1),new p(f,this.wrap,f,E+1,L+1)]}isLessThan(o){return this.wrap<o.wrap||!(this.wrap>o.wrap)&&(this.overscaledZ<o.overscaledZ||!(this.overscaledZ>o.overscaledZ)&&(this.canonical.x<o.canonical.x||!(this.canonical.x>o.canonical.x)&&this.canonical.y<o.canonical.y))}wrapped(){return new p(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(o){return new p(this.overscaledZ,o,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new j(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(o){return this.canonical.getTilePoint(new _(o.x-this.wrap,o.y))}}function v(c,o,f,E,L){(c*=2)<0&&(c=-1*c-1);const V=1<<f;return(V*V*c+V*L+E).toString(36)+f.toString(36)+o.toString(36)}oi("CanonicalTileID",F),oi("OverscaledTileID",p,{omit:["posMatrix"]});class m{constructor(o,f,E,L=1,V=1,X=1,J=0){if(this.uid=o,f.height!==f.width)throw new RangeError("DEM tiles must be square");if(E&&!["mapbox","terrarium","custom"].includes(E))return void rn(`"${E}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=f.height;const oe=this.dim=f.height-2;switch(this.data=new Uint32Array(f.data.buffer),E){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=L,this.greenFactor=V,this.blueFactor=X,this.baseShift=J;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let me=0;me<oe;me++)this.data[this._idx(-1,me)]=this.data[this._idx(0,me)],this.data[this._idx(oe,me)]=this.data[this._idx(oe-1,me)],this.data[this._idx(me,-1)]=this.data[this._idx(me,0)],this.data[this._idx(me,oe)]=this.data[this._idx(me,oe-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(oe,-1)]=this.data[this._idx(oe-1,0)],this.data[this._idx(-1,oe)]=this.data[this._idx(0,oe-1)],this.data[this._idx(oe,oe)]=this.data[this._idx(oe-1,oe-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let me=0;me<oe;me++)for(let Me=0;Me<oe;Me++){const De=this.get(me,Me);De>this.max&&(this.max=De),De<this.min&&(this.min=De)}}get(o,f){const E=new Uint8Array(this.data.buffer),L=4*this._idx(o,f);return this.unpack(E[L],E[L+1],E[L+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(o,f){if(o<-1||o>=this.dim+1||f<-1||f>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(f+1)*this.stride+(o+1)}unpack(o,f,E){return o*this.redFactor+f*this.greenFactor+E*this.blueFactor-this.baseShift}getPixels(){return new dc({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(o,f,E){if(this.dim!==o.dim)throw new Error("dem dimension mismatch");let L=f*this.dim,V=f*this.dim+this.dim,X=E*this.dim,J=E*this.dim+this.dim;switch(f){case-1:L=V-1;break;case 1:V=L+1}switch(E){case-1:X=J-1;break;case 1:J=X+1}const oe=-f*this.dim,me=-E*this.dim;for(let Me=X;Me<J;Me++)for(let De=L;De<V;De++)this.data[this._idx(De,Me)]=o.data[this._idx(De+oe,Me+me)]}}oi("DEMData",m);class w{constructor(o){this._stringToNumber={},this._numberToString=[];for(let f=0;f<o.length;f++){const E=o[f];this._stringToNumber[E]=f,this._numberToString[f]=E}}encode(o){return this._stringToNumber[o]}decode(o){if(o>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${o} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[o]}}class D{constructor(o,f,E,L,V){this.type="Feature",this._vectorTileFeature=o,o._z=f,o._x=E,o._y=L,this.properties=o.properties,this.id=V}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(o){this._geometry=o}toJSON(){const o={geometry:this.geometry};for(const f in this)f!=="_geometry"&&f!=="_vectorTileFeature"&&(o[f]=this[f]);return o}}class N{constructor(o,f){this.tileID=o,this.x=o.canonical.x,this.y=o.canonical.y,this.z=o.canonical.z,this.grid=new Wc(Ws,16,0),this.grid3D=new Wc(Ws,16,0),this.featureIndexArray=new ct,this.promoteId=f}insert(o,f,E,L,V,X){const J=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(E,L,V);const oe=X?this.grid3D:this.grid;for(let me=0;me<f.length;me++){const Me=f[me],De=[1/0,1/0,-1/0,-1/0];for(let Ye=0;Ye<Me.length;Ye++){const ot=Me[Ye];De[0]=Math.min(De[0],ot.x),De[1]=Math.min(De[1],ot.y),De[2]=Math.max(De[2],ot.x),De[3]=Math.max(De[3],ot.y)}De[0]<Ws&&De[1]<Ws&&De[2]>=0&&De[3]>=0&&oe.insert(J,De[0],De[1],De[2],De[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new cl.VectorTile(new Br(this.rawTileData)).layers,this.sourceLayerCoder=new w(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(o,f,E,L){this.loadVTLayers();const V=o.params||{},X=Ws/o.tileSize/o.scale,J=bh(V.filter),oe=o.queryGeometry,me=o.queryPadding*X,Me=$(oe),De=this.grid.query(Me.minX-me,Me.minY-me,Me.maxX+me,Me.maxY+me),Ye=$(o.cameraQueryGeometry),ot=this.grid3D.query(Ye.minX-me,Ye.minY-me,Ye.maxX+me,Ye.maxY+me,(Gt,Kt,Er,cr)=>function(Rr,Qr,Fn,Ki,Co){for(const Zi of Rr)if(Qr<=Zi.x&&Fn<=Zi.y&&Ki>=Zi.x&&Co>=Zi.y)return!0;const $i=[new Ce(Qr,Fn),new Ce(Qr,Co),new Ce(Ki,Co),new Ce(Ki,Fn)];if(Rr.length>2){for(const Zi of $i)if(Ff(Rr,Zi))return!0}for(let Zi=0;Zi<Rr.length-1;Zi++)if(sd(Rr[Zi],Rr[Zi+1],$i))return!0;return!1}(o.cameraQueryGeometry,Gt-me,Kt-me,Er+me,cr+me));for(const Gt of ot)De.push(Gt);De.sort(ie);const lt={};let Ct;for(let Gt=0;Gt<De.length;Gt++){const Kt=De[Gt];if(Kt===Ct)continue;Ct=Kt;const Er=this.featureIndexArray.get(Kt);let cr=null;this.loadMatchingFeature(lt,Er.bucketIndex,Er.sourceLayerIndex,Er.featureIndex,J,V.layers,V.availableImages,f,E,L,(Rr,Qr,Fn)=>(cr||(cr=yl(Rr)),Qr.queryIntersectsFeature(oe,Rr,Fn,cr,this.z,o.transform,X,o.pixelPosMatrix)))}return lt}loadMatchingFeature(o,f,E,L,V,X,J,oe,me,Me,De){const Ye=this.bucketLayerIDs[f];if(X&&!function(Gt,Kt){for(let Er=0;Er<Gt.length;Er++)if(Kt.indexOf(Gt[Er])>=0)return!0;return!1}(X,Ye))return;const ot=this.sourceLayerCoder.decode(E),lt=this.vtLayers[ot].feature(L);if(V.needGeometry){const Gt=Ol(lt,!0);if(!V.filter(new hs(this.tileID.overscaledZ),Gt,this.tileID.canonical))return}else if(!V.filter(new hs(this.tileID.overscaledZ),lt))return;const Ct=this.getId(lt,ot);for(let Gt=0;Gt<Ye.length;Gt++){const Kt=Ye[Gt];if(X&&X.indexOf(Kt)<0)continue;const Er=oe[Kt];if(!Er)continue;let cr={};Ct&&Me&&(cr=Me.getState(Er.sourceLayer||"_geojsonTileLayer",Ct));const Rr=ki({},me[Kt]);Rr.paint=W(Rr.paint,Er.paint,lt,cr,J),Rr.layout=W(Rr.layout,Er.layout,lt,cr,J);const Qr=!De||De(lt,Er,cr);if(!Qr)continue;const Fn=new D(lt,this.z,this.x,this.y,Ct);Fn.layer=Rr;let Ki=o[Kt];Ki===void 0&&(Ki=o[Kt]=[]),Ki.push({featureIndex:L,feature:Fn,intersectionZ:Qr})}}lookupSymbolFeatures(o,f,E,L,V,X,J,oe){const me={};this.loadVTLayers();const Me=bh(V);for(const De of o)this.loadMatchingFeature(me,E,L,De,Me,X,J,oe,f);return me}hasLayer(o){for(const f of this.bucketLayerIDs)for(const E of f)if(o===E)return!0;return!1}getId(o,f){let E=o.id;return this.promoteId&&(E=o.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[f]],typeof E=="boolean"&&(E=Number(E))),E}}function W(c,o,f,E,L){return xr(c,(V,X)=>{const J=o instanceof Si?o.get(X):null;return J&&J.evaluate?J.evaluate(f,E,L):J})}function $(c){let o=1/0,f=1/0,E=-1/0,L=-1/0;for(const V of c)o=Math.min(o,V.x),f=Math.min(f,V.y),E=Math.max(E,V.x),L=Math.max(L,V.y);return{minX:o,minY:f,maxX:E,maxY:L}}function ie(c,o){return o-c}function pe(c,o,f,E,L){const V=[];for(let X=0;X<c.length;X++){const J=c[X];let oe;for(let me=0;me<J.length-1;me++){let Me=J[me],De=J[me+1];Me.x<o&&De.x<o||(Me.x<o?Me=new Ce(o,Me.y+(o-Me.x)/(De.x-Me.x)*(De.y-Me.y))._round():De.x<o&&(De=new Ce(o,Me.y+(o-Me.x)/(De.x-Me.x)*(De.y-Me.y))._round()),Me.y<f&&De.y<f||(Me.y<f?Me=new Ce(Me.x+(f-Me.y)/(De.y-Me.y)*(De.x-Me.x),f)._round():De.y<f&&(De=new Ce(Me.x+(f-Me.y)/(De.y-Me.y)*(De.x-Me.x),f)._round()),Me.x>=E&&De.x>=E||(Me.x>=E?Me=new Ce(E,Me.y+(E-Me.x)/(De.x-Me.x)*(De.y-Me.y))._round():De.x>=E&&(De=new Ce(E,Me.y+(E-Me.x)/(De.x-Me.x)*(De.y-Me.y))._round()),Me.y>=L&&De.y>=L||(Me.y>=L?Me=new Ce(Me.x+(L-Me.y)/(De.y-Me.y)*(De.x-Me.x),L)._round():De.y>=L&&(De=new Ce(Me.x+(L-Me.y)/(De.y-Me.y)*(De.x-Me.x),L)._round()),oe&&Me.equals(oe[oe.length-1])||(oe=[Me],V.push(oe)),oe.push(De)))))}}return V}oi("FeatureIndex",N,{omit:["rawTileData","sourceLayerCoder"]});class we extends Ce{constructor(o,f,E,L){super(o,f),this.angle=E,L!==void 0&&(this.segment=L)}clone(){return new we(this.x,this.y,this.angle,this.segment)}}function ke(c,o,f,E,L){if(o.segment===void 0||f===0)return!0;let V=o,X=o.segment+1,J=0;for(;J>-f/2;){if(X--,X<0)return!1;J-=c[X].dist(V),V=c[X]}J+=c[X].dist(c[X+1]),X++;const oe=[];let me=0;for(;J<f/2;){const Me=c[X],De=c[X+1];if(!De)return!1;let Ye=c[X-1].angleTo(Me)-Me.angleTo(De);for(Ye=Math.abs((Ye+3*Math.PI)%(2*Math.PI)-Math.PI),oe.push({distance:J,angleDelta:Ye}),me+=Ye;J-oe[0].distance>E;)me-=oe.shift().angleDelta;if(me>L)return!1;X++,J+=Me.dist(De)}return!0}function Ge(c){let o=0;for(let f=0;f<c.length-1;f++)o+=c[f].dist(c[f+1]);return o}function ht(c,o,f){return c?.6*o*f:0}function mt(c,o){return Math.max(c?c.right-c.left:0,o?o.right-o.left:0)}function St(c,o,f,E,L,V){const X=ht(f,L,V),J=mt(f,E)*V;let oe=0;const me=Ge(c)/2;for(let Me=0;Me<c.length-1;Me++){const De=c[Me],Ye=c[Me+1],ot=De.dist(Ye);if(oe+ot>me){const lt=(me-oe)/ot,Ct=Tl.number(De.x,Ye.x,lt),Gt=Tl.number(De.y,Ye.y,lt),Kt=new we(Ct,Gt,Ye.angleTo(De),Me);return Kt._round(),!X||ke(c,Kt,J,X,o)?Kt:void 0}oe+=ot}}function xt(c,o,f,E,L,V,X,J,oe){const me=ht(E,V,X),Me=mt(E,L),De=Me*X,Ye=c[0].x===0||c[0].x===oe||c[0].y===0||c[0].y===oe;return o-De<o/4&&(o=De+o/4),bt(c,Ye?o/2*J%o:(Me/2+2*V)*X*J%o,o,me,f,De,Ye,!1,oe)}function bt(c,o,f,E,L,V,X,J,oe){const me=V/2,Me=Ge(c);let De=0,Ye=o-f,ot=[];for(let lt=0;lt<c.length-1;lt++){const Ct=c[lt],Gt=c[lt+1],Kt=Ct.dist(Gt),Er=Gt.angleTo(Ct);for(;Ye+f<De+Kt;){Ye+=f;const cr=(Ye-De)/Kt,Rr=Tl.number(Ct.x,Gt.x,cr),Qr=Tl.number(Ct.y,Gt.y,cr);if(Rr>=0&&Rr<oe&&Qr>=0&&Qr<oe&&Ye-me>=0&&Ye+me<=Me){const Fn=new we(Rr,Qr,Er,lt);Fn._round(),E&&!ke(c,Fn,V,E,L)||ot.push(Fn)}}De+=Kt}return J||ot.length||X||(ot=bt(c,De/2,f,E,L,V,X,!0,oe)),ot}oi("Anchor",we);const kt=pt;function ft(c,o,f,E){const L=[],V=c.image,X=V.pixelRatio,J=V.paddedRect.w-2*kt,oe=V.paddedRect.h-2*kt,me=c.right-c.left,Me=c.bottom-c.top,De=V.stretchX||[[0,J]],Ye=V.stretchY||[[0,oe]],ot=(Ri,vo)=>Ri+vo[1]-vo[0],lt=De.reduce(ot,0),Ct=Ye.reduce(ot,0),Gt=J-lt,Kt=oe-Ct;let Er=0,cr=lt,Rr=0,Qr=Ct,Fn=0,Ki=Gt,Co=0,$i=Kt;if(V.content&&E){const Ri=V.content;Er=nr(De,0,Ri[0]),Rr=nr(Ye,0,Ri[1]),cr=nr(De,Ri[0],Ri[2]),Qr=nr(Ye,Ri[1],Ri[3]),Fn=Ri[0]-Er,Co=Ri[1]-Rr,Ki=Ri[2]-Ri[0]-cr,$i=Ri[3]-Ri[1]-Qr}const Zi=(Ri,vo,Ii,ni)=>{const jo=Pr(Ri.stretch-Er,cr,me,c.left),Do=Mn(Ri.fixed-Fn,Ki,Ri.stretch,lt),rs=Pr(vo.stretch-Rr,Qr,Me,c.top),iu=Mn(vo.fixed-Co,$i,vo.stretch,Ct),tl=Pr(Ii.stretch-Er,cr,me,c.left),gc=Mn(Ii.fixed-Fn,Ki,Ii.stretch,lt),Pp=Pr(ni.stretch-Rr,Qr,Me,c.top),sp=Mn(ni.fixed-Co,$i,ni.stretch,Ct),kc=new Ce(jo,rs),gh=new Ce(tl,rs),lp=new Ce(tl,Pp),vh=new Ce(jo,Pp),Ys=new Ce(Do/X,iu/X),jl=new Ce(gc/X,sp/X),_h=o*Math.PI/180;if(_h){const up=Math.sin(_h),Mh=Math.cos(_h),_c=[Mh,-up,up,Mh];kc._matMult(_c),gh._matMult(_c),vh._matMult(_c),lp._matMult(_c)}const vc=Ri.stretch+Ri.fixed,xp=vo.stretch+vo.fixed;return{tl:kc,tr:gh,bl:vh,br:lp,tex:{x:V.paddedRect.x+kt+vc,y:V.paddedRect.y+kt+xp,w:Ii.stretch+Ii.fixed-vc,h:ni.stretch+ni.fixed-xp},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Ys,pixelOffsetBR:jl,minFontScaleX:Ki/X/me,minFontScaleY:$i/X/Me,isSDF:f}};if(E&&(V.stretchX||V.stretchY)){const Ri=br(De,Gt,lt),vo=br(Ye,Kt,Ct);for(let Ii=0;Ii<Ri.length-1;Ii++){const ni=Ri[Ii],jo=Ri[Ii+1];for(let Do=0;Do<vo.length-1;Do++)L.push(Zi(ni,vo[Do],jo,vo[Do+1]))}}else L.push(Zi({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:J+1},{fixed:0,stretch:oe+1}));return L}function nr(c,o,f){let E=0;for(const L of c)E+=Math.max(o,Math.min(f,L[1]))-Math.max(o,Math.min(f,L[0]));return E}function br(c,o,f){const E=[{fixed:-kt,stretch:0}];for(const[L,V]of c){const X=E[E.length-1];E.push({fixed:L-X.stretch,stretch:X.stretch}),E.push({fixed:L-X.stretch,stretch:X.stretch+(V-L)})}return E.push({fixed:o+kt,stretch:f}),E}function Pr(c,o,f,E){return c/o*f+E}function Mn(c,o,f,E){return c-o*f/E}class yn{constructor(o,f,E,L,V,X,J,oe,me,Me){if(this.boxStartIndex=o.length,me){let De=X.top,Ye=X.bottom;const ot=X.collisionPadding;ot&&(De-=ot[1],Ye+=ot[3]);let lt=Ye-De;lt>0&&(lt=Math.max(10,lt),this.circleDiameter=lt)}else{let De=X.top*J-oe[0],Ye=X.bottom*J+oe[2],ot=X.left*J-oe[3],lt=X.right*J+oe[1];const Ct=X.collisionPadding;if(Ct&&(ot-=Ct[0]*J,De-=Ct[1]*J,lt+=Ct[2]*J,Ye+=Ct[3]*J),Me){const Gt=new Ce(ot,De),Kt=new Ce(lt,De),Er=new Ce(ot,Ye),cr=new Ce(lt,Ye),Rr=Me*Math.PI/180;Gt._rotate(Rr),Kt._rotate(Rr),Er._rotate(Rr),cr._rotate(Rr),ot=Math.min(Gt.x,Kt.x,Er.x,cr.x),lt=Math.max(Gt.x,Kt.x,Er.x,cr.x),De=Math.min(Gt.y,Kt.y,Er.y,cr.y),Ye=Math.max(Gt.y,Kt.y,Er.y,cr.y)}o.emplaceBack(f.x,f.y,ot,De,lt,Ye,E,L,V)}this.boxEndIndex=o.length}}class kr{constructor(o=[],f=Ai){if(this.data=o,this.length=this.data.length,this.compare=f,this.length>0)for(let E=(this.length>>1)-1;E>=0;E--)this._down(E)}push(o){this.data.push(o),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const o=this.data[0],f=this.data.pop();return this.length--,this.length>0&&(this.data[0]=f,this._down(0)),o}peek(){return this.data[0]}_up(o){const{data:f,compare:E}=this,L=f[o];for(;o>0;){const V=o-1>>1,X=f[V];if(E(L,X)>=0)break;f[o]=X,o=V}f[o]=L}_down(o){const{data:f,compare:E}=this,L=this.length>>1,V=f[o];for(;o<L;){let X=1+(o<<1),J=f[X];const oe=X+1;if(oe<this.length&&E(f[oe],J)<0&&(X=oe,J=f[oe]),E(J,V)>=0)break;f[o]=J,o=X}f[o]=V}}function Ai(c,o){return c<o?-1:c>o?1:0}function $n(c,o=1,f=!1){let E=1/0,L=1/0,V=-1/0,X=-1/0;const J=c[0];for(let ot=0;ot<J.length;ot++){const lt=J[ot];(!ot||lt.x<E)&&(E=lt.x),(!ot||lt.y<L)&&(L=lt.y),(!ot||lt.x>V)&&(V=lt.x),(!ot||lt.y>X)&&(X=lt.y)}const oe=Math.min(V-E,X-L);let me=oe/2;const Me=new kr([],ti);if(oe===0)return new Ce(E,L);for(let ot=E;ot<V;ot+=oe)for(let lt=L;lt<X;lt+=oe)Me.push(new ri(ot+me,lt+me,me,c));let De=function(ot){let lt=0,Ct=0,Gt=0;const Kt=ot[0];for(let Er=0,cr=Kt.length,Rr=cr-1;Er<cr;Rr=Er++){const Qr=Kt[Er],Fn=Kt[Rr],Ki=Qr.x*Fn.y-Fn.x*Qr.y;Ct+=(Qr.x+Fn.x)*Ki,Gt+=(Qr.y+Fn.y)*Ki,lt+=3*Ki}return new ri(Ct/lt,Gt/lt,0,ot)}(c),Ye=Me.length;for(;Me.length;){const ot=Me.pop();(ot.d>De.d||!De.d)&&(De=ot,f&&console.log("found best %d after %d probes",Math.round(1e4*ot.d)/1e4,Ye)),ot.max-De.d<=o||(me=ot.h/2,Me.push(new ri(ot.p.x-me,ot.p.y-me,me,c)),Me.push(new ri(ot.p.x+me,ot.p.y-me,me,c)),Me.push(new ri(ot.p.x-me,ot.p.y+me,me,c)),Me.push(new ri(ot.p.x+me,ot.p.y+me,me,c)),Ye+=4)}return f&&(console.log(`num probes: ${Ye}`),console.log(`best distance: ${De.d}`)),De.p}function ti(c,o){return o.max-c.max}function ri(c,o,f,E){this.p=new Ce(c,o),this.h=f,this.d=function(L,V){let X=!1,J=1/0;for(let oe=0;oe<V.length;oe++){const me=V[oe];for(let Me=0,De=me.length,Ye=De-1;Me<De;Ye=Me++){const ot=me[Me],lt=me[Ye];ot.y>L.y!=lt.y>L.y&&L.x<(lt.x-ot.x)*(L.y-ot.y)/(lt.y-ot.y)+ot.x&&(X=!X),J=Math.min(J,ef(L,ot,lt))}}return(X?1:-1)*Math.sqrt(J)}(this.p,E),this.max=this.d+this.h*Math.SQRT2}var hn;R.aq=void 0,(hn=R.aq||(R.aq={}))[hn.center=1]="center",hn[hn.left=2]="left",hn[hn.right=3]="right",hn[hn.top=4]="top",hn[hn.bottom=5]="bottom",hn[hn["top-left"]=6]="top-left",hn[hn["top-right"]=7]="top-right",hn[hn["bottom-left"]=8]="bottom-left",hn[hn["bottom-right"]=9]="bottom-right";const An=7,Yi=Number.POSITIVE_INFINITY;function Ci(c,o){return o[1]!==Yi?function(f,E,L){let V=0,X=0;switch(E=Math.abs(E),L=Math.abs(L),f){case"top-right":case"top-left":case"top":X=L-An;break;case"bottom-right":case"bottom-left":case"bottom":X=-L+An}switch(f){case"top-right":case"bottom-right":case"right":V=-E;break;case"top-left":case"bottom-left":case"left":V=E}return[V,X]}(c,o[0],o[1]):function(f,E){let L=0,V=0;E<0&&(E=0);const X=E/Math.SQRT2;switch(f){case"top-right":case"top-left":V=X-An;break;case"bottom-right":case"bottom-left":V=-X+An;break;case"bottom":V=-E+An;break;case"top":V=E-An}switch(f){case"top-right":case"bottom-right":L=-X;break;case"top-left":case"bottom-left":L=X;break;case"left":L=E;break;case"right":L=-E}return[L,V]}(c,o[0])}function fo(c,o,f){var E;const L=c.layout,V=(E=L.get("text-variable-anchor-offset"))===null||E===void 0?void 0:E.evaluate(o,{},f);if(V){const J=V.values,oe=[];for(let me=0;me<J.length;me+=2){const Me=oe[me]=J[me],De=J[me+1].map(Ye=>Ye*ps);Me.startsWith("top")?De[1]-=An:Me.startsWith("bottom")&&(De[1]+=An),oe[me+1]=De}return new Ba(oe)}const X=L.get("text-variable-anchor");if(X){let J;J=c._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[L.get("text-radial-offset").evaluate(o,{},f)*ps,Yi]:L.get("text-offset").evaluate(o,{},f).map(me=>me*ps);const oe=[];for(const me of X)oe.push(me,Ci(me,J));return new Ba(oe)}return null}function Go(c){switch(c){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function hi(c,o,f,E,L,V,X,J,oe,me,Me){let De=V.textMaxSize.evaluate(o,{});De===void 0&&(De=X);const Ye=c.layers[0].layout,ot=Ye.get("icon-offset").evaluate(o,{},Me),lt=Vo(f.horizontal),Ct=X/24,Gt=c.tilePixelRatio*Ct,Kt=c.tilePixelRatio*De/24,Er=c.tilePixelRatio*J,cr=c.tilePixelRatio*Ye.get("symbol-spacing"),Rr=Ye.get("text-padding")*c.tilePixelRatio,Qr=function(ni,jo,Do,rs=1){const iu=ni.get("icon-padding").evaluate(jo,{},Do),tl=iu&&iu.values;return[tl[0]*rs,tl[1]*rs,tl[2]*rs,tl[3]*rs]}(Ye,o,Me,c.tilePixelRatio),Fn=Ye.get("text-max-angle")/180*Math.PI,Ki=Ye.get("text-rotation-alignment")!=="viewport"&&Ye.get("symbol-placement")!=="point",Co=Ye.get("icon-rotation-alignment")==="map"&&Ye.get("symbol-placement")!=="point",$i=Ye.get("symbol-placement"),Zi=cr/2,Ri=Ye.get("icon-text-fit");let vo;E&&Ri!=="none"&&(c.allowVerticalPlacement&&f.vertical&&(vo=td(E,f.vertical,Ri,Ye.get("icon-text-fit-padding"),ot,Ct)),lt&&(E=td(E,lt,Ri,Ye.get("icon-text-fit-padding"),ot,Ct)));const Ii=(ni,jo)=>{jo.x<0||jo.x>=Ws||jo.y<0||jo.y>=Ws||function(Do,rs,iu,tl,gc,Pp,sp,kc,gh,lp,vh,Ys,jl,_h,vc,xp,up,Mh,_c,oc,Ss,Ph,Rh,Nc,Cf){const Vp=Do.addToLineVertexArray(rs,iu);let Mf,md,Pf,Rf,Rp=0,$c=0,Vd=0,Ym=0,Vf=-1,og=-1;const Pd={};let jd=Cl("");if(Do.allowVerticalPlacement&&tl.vertical){const Ih=kc.layout.get("text-rotate").evaluate(Ss,{},Nc)+90;Pf=new yn(gh,rs,lp,vh,Ys,tl.vertical,jl,_h,vc,Ih),sp&&(Rf=new yn(gh,rs,lp,vh,Ys,sp,up,Mh,vc,Ih))}if(gc){const Ih=kc.layout.get("icon-rotate").evaluate(Ss,{}),Hp=kc.layout.get("icon-text-fit")!=="none",Hd=ft(gc,Ih,Rh,Hp),hf=sp?ft(sp,Ih,Rh,Hp):void 0;md=new yn(gh,rs,lp,vh,Ys,gc,up,Mh,!1,Ih),Rp=4*Hd.length;const Gd=Do.iconSizeData;let pf=null;Gd.kind==="source"?(pf=[Zp*kc.layout.get("icon-size").evaluate(Ss,{})],pf[0]>wf&&rn(`${Do.layerIds[0]}: Value for "icon-size" is >= ${dd}. Reduce your "icon-size".`)):Gd.kind==="composite"&&(pf=[Zp*Ph.compositeIconSizes[0].evaluate(Ss,{},Nc),Zp*Ph.compositeIconSizes[1].evaluate(Ss,{},Nc)],(pf[0]>wf||pf[1]>wf)&&rn(`${Do.layerIds[0]}: Value for "icon-size" is >= ${dd}. Reduce your "icon-size".`)),Do.addSymbols(Do.icon,Hd,pf,oc,_c,Ss,R.ai.none,rs,Vp.lineStartIndex,Vp.lineLength,-1,Nc),Vf=Do.icon.placedSymbolArray.length-1,hf&&($c=4*hf.length,Do.addSymbols(Do.icon,hf,pf,oc,_c,Ss,R.ai.vertical,rs,Vp.lineStartIndex,Vp.lineLength,-1,Nc),og=Do.icon.placedSymbolArray.length-1)}const pm=Object.keys(tl.horizontal);for(const Ih of pm){const Hp=tl.horizontal[Ih];if(!Mf){jd=Cl(Hp.text);const hf=kc.layout.get("text-rotate").evaluate(Ss,{},Nc);Mf=new yn(gh,rs,lp,vh,Ys,Hp,jl,_h,vc,hf)}const Hd=Hp.positionedLines.length===1;if(Vd+=zi(Do,rs,Hp,Pp,kc,vc,Ss,xp,Vp,tl.vertical?R.ai.horizontal:R.ai.horizontalOnly,Hd?pm:[Ih],Pd,Vf,Ph,Nc),Hd)break}tl.vertical&&(Ym+=zi(Do,rs,tl.vertical,Pp,kc,vc,Ss,xp,Vp,R.ai.vertical,["vertical"],Pd,og,Ph,Nc));const Tm=Mf?Mf.boxStartIndex:Do.collisionBoxArray.length,fm=Mf?Mf.boxEndIndex:Do.collisionBoxArray.length,Am=Pf?Pf.boxStartIndex:Do.collisionBoxArray.length,Cg=Pf?Pf.boxEndIndex:Do.collisionBoxArray.length,Vg=md?md.boxStartIndex:Do.collisionBoxArray.length,Mg=md?md.boxEndIndex:Do.collisionBoxArray.length,$m=Rf?Rf.boxStartIndex:Do.collisionBoxArray.length,ag=Rf?Rf.boxEndIndex:Do.collisionBoxArray.length;let jp=-1;const cp=(Ih,Hp)=>Ih&&Ih.circleDiameter?Math.max(Ih.circleDiameter,Hp):Hp;jp=cp(Mf,jp),jp=cp(Pf,jp),jp=cp(md,jp),jp=cp(Rf,jp);const dm=jp>-1?1:0;dm&&(jp*=Cf/ps),Do.glyphOffsetArray.length>=rd.MAX_GLYPHS&&rn("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ss.sortKey!==void 0&&Do.addToSortKeyRanges(Do.symbolInstances.length,Ss.sortKey);const Vh=fo(kc,Ss,Nc),[sg,Cm]=function(Ih,Hp){const Hd=Ih.length,hf=Hp==null?void 0:Hp.values;if((hf==null?void 0:hf.length)>0)for(let Gd=0;Gd<hf.length;Gd+=2){const pf=hf[Gd+1];Ih.emplaceBack(R.aq[hf[Gd]],pf[0],pf[1])}return[Hd,Ih.length]}(Do.textAnchorOffsets,Vh);Do.symbolInstances.emplaceBack(rs.x,rs.y,Pd.right>=0?Pd.right:-1,Pd.center>=0?Pd.center:-1,Pd.left>=0?Pd.left:-1,Pd.vertical||-1,Vf,og,jd,Tm,fm,Am,Cg,Vg,Mg,$m,ag,lp,Vd,Ym,Rp,$c,dm,0,jl,jp,sg,Cm)}(c,jo,ni,f,E,L,vo,c.layers[0],c.collisionBoxArray,o.index,o.sourceLayerIndex,c.index,Gt,[Rr,Rr,Rr,Rr],Ki,oe,Er,Qr,Co,ot,o,V,me,Me,X)};if($i==="line")for(const ni of pe(o.geometry,0,0,Ws,Ws)){const jo=xt(ni,cr,Fn,f.vertical||lt,E,24,Kt,c.overscaling,Ws);for(const Do of jo)lt&&Ka(c,lt.text,Zi,Do)||Ii(ni,Do)}else if($i==="line-center"){for(const ni of o.geometry)if(ni.length>1){const jo=St(ni,Fn,f.vertical||lt,E,24,Kt);jo&&Ii(ni,jo)}}else if(o.type==="Polygon")for(const ni of Fd(o.geometry,0)){const jo=$n(ni,16);Ii(ni[0],new we(jo.x,jo.y,0))}else if(o.type==="LineString")for(const ni of o.geometry)Ii(ni,new we(ni[0].x,ni[0].y,0));else if(o.type==="Point")for(const ni of o.geometry)for(const jo of ni)Ii([jo],new we(jo.x,jo.y,0))}function zi(c,o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot,lt){const Ct=function(Er,cr,Rr,Qr,Fn,Ki,Co,$i){const Zi=Qr.layout.get("text-rotate").evaluate(Ki,{})*Math.PI/180,Ri=[];for(const vo of cr.positionedLines)for(const Ii of vo.positionedGlyphs){if(!Ii.rect)continue;const ni=Ii.rect||{};let jo=Mt+1,Do=!0,rs=1,iu=0;const tl=(Fn||$i)&&Ii.vertical,gc=Ii.metrics.advance*Ii.scale/2;if($i&&cr.verticalizable&&(iu=vo.lineOffset/2-(Ii.imageName?-(ps-Ii.metrics.width*Ii.scale)/2:(Ii.scale-1)*ps)),Ii.imageName){const oc=Co[Ii.imageName];Do=oc.sdf,rs=oc.pixelRatio,jo=pt/rs}const Pp=Fn?[Ii.x+gc,Ii.y]:[0,0];let sp=Fn?[0,0]:[Ii.x+gc+Rr[0],Ii.y+Rr[1]-iu],kc=[0,0];tl&&(kc=sp,sp=[0,0]);const gh=Ii.metrics.isDoubleResolution?2:1,lp=(Ii.metrics.left-jo)*Ii.scale-gc+sp[0],vh=(-Ii.metrics.top-jo)*Ii.scale+sp[1],Ys=lp+ni.w/gh*Ii.scale/rs,jl=vh+ni.h/gh*Ii.scale/rs,_h=new Ce(lp,vh),vc=new Ce(Ys,vh),xp=new Ce(lp,jl),up=new Ce(Ys,jl);if(tl){const oc=new Ce(-gc,gc-Tn),Ss=-Math.PI/2,Ph=ps/2-gc,Rh=new Ce(5-Tn-Ph,-(Ii.imageName?Ph:0)),Nc=new Ce(...kc);_h._rotateAround(Ss,oc)._add(Rh)._add(Nc),vc._rotateAround(Ss,oc)._add(Rh)._add(Nc),xp._rotateAround(Ss,oc)._add(Rh)._add(Nc),up._rotateAround(Ss,oc)._add(Rh)._add(Nc)}if(Zi){const oc=Math.sin(Zi),Ss=Math.cos(Zi),Ph=[Ss,-oc,oc,Ss];_h._matMult(Ph),vc._matMult(Ph),xp._matMult(Ph),up._matMult(Ph)}const Mh=new Ce(0,0),_c=new Ce(0,0);Ri.push({tl:_h,tr:vc,bl:xp,br:up,tex:ni,writingMode:cr.writingMode,glyphOffset:Pp,sectionIndex:Ii.sectionIndex,isSDF:Do,pixelOffsetTL:Mh,pixelOffsetBR:_c,minFontScaleX:0,minFontScaleY:0})}return Ri}(0,f,J,L,V,X,E,c.allowVerticalPlacement),Gt=c.textSizeData;let Kt=null;Gt.kind==="source"?(Kt=[Zp*L.layout.get("text-size").evaluate(X,{})],Kt[0]>wf&&rn(`${c.layerIds[0]}: Value for "text-size" is >= ${dd}. Reduce your "text-size".`)):Gt.kind==="composite"&&(Kt=[Zp*ot.compositeTextSizes[0].evaluate(X,{},lt),Zp*ot.compositeTextSizes[1].evaluate(X,{},lt)],(Kt[0]>wf||Kt[1]>wf)&&rn(`${c.layerIds[0]}: Value for "text-size" is >= ${dd}. Reduce your "text-size".`)),c.addSymbols(c.text,Ct,Kt,J,V,X,me,o,oe.lineStartIndex,oe.lineLength,Ye,lt);for(const Er of Me)De[Er]=c.text.placedSymbolArray.length-1;return 4*Ct.length}function Vo(c){for(const o in c)return c[o];return null}function Ka(c,o,f,E){const L=c.compareText;if(o in L){const V=L[o];for(let X=V.length-1;X>=0;X--)if(E.dist(V[X])<f)return!0}else L[o]=[];return L[o].push(E),!1}const ta=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class ka{static from(o){if(!(o instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[f,E]=new Uint8Array(o,0,2);if(f!==219)throw new Error("Data does not appear to be in a KDBush format.");const L=E>>4;if(L!==1)throw new Error(`Got v${L} data when expected v1.`);const V=ta[15&E];if(!V)throw new Error("Unrecognized array type.");const[X]=new Uint16Array(o,2,1),[J]=new Uint32Array(o,4,1);return new ka(J,X,V,o)}constructor(o,f=64,E=Float64Array,L){if(isNaN(o)||o<0)throw new Error(`Unpexpected numItems value: ${o}.`);this.numItems=+o,this.nodeSize=Math.min(Math.max(+f,2),65535),this.ArrayType=E,this.IndexArrayType=o<65536?Uint16Array:Uint32Array;const V=ta.indexOf(this.ArrayType),X=2*o*this.ArrayType.BYTES_PER_ELEMENT,J=o*this.IndexArrayType.BYTES_PER_ELEMENT,oe=(8-J%8)%8;if(V<0)throw new Error(`Unexpected typed array class: ${E}.`);L&&L instanceof ArrayBuffer?(this.data=L,this.ids=new this.IndexArrayType(this.data,8,o),this.coords=new this.ArrayType(this.data,8+J+oe,2*o),this._pos=2*o,this._finished=!0):(this.data=new ArrayBuffer(8+X+J+oe),this.ids=new this.IndexArrayType(this.data,8,o),this.coords=new this.ArrayType(this.data,8+J+oe,2*o),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+V]),new Uint16Array(this.data,2,1)[0]=f,new Uint32Array(this.data,4,1)[0]=o)}add(o,f){const E=this._pos>>1;return this.ids[E]=E,this.coords[this._pos++]=o,this.coords[this._pos++]=f,E}finish(){const o=this._pos>>1;if(o!==this.numItems)throw new Error(`Added ${o} items when expected ${this.numItems}.`);return ca(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(o,f,E,L){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:V,coords:X,nodeSize:J}=this,oe=[0,V.length-1,0],me=[];for(;oe.length;){const Me=oe.pop()||0,De=oe.pop()||0,Ye=oe.pop()||0;if(De-Ye<=J){for(let Gt=Ye;Gt<=De;Gt++){const Kt=X[2*Gt],Er=X[2*Gt+1];Kt>=o&&Kt<=E&&Er>=f&&Er<=L&&me.push(V[Gt])}continue}const ot=Ye+De>>1,lt=X[2*ot],Ct=X[2*ot+1];lt>=o&&lt<=E&&Ct>=f&&Ct<=L&&me.push(V[ot]),(Me===0?o<=lt:f<=Ct)&&(oe.push(Ye),oe.push(ot-1),oe.push(1-Me)),(Me===0?E>=lt:L>=Ct)&&(oe.push(ot+1),oe.push(De),oe.push(1-Me))}return me}within(o,f,E){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:L,coords:V,nodeSize:X}=this,J=[0,L.length-1,0],oe=[],me=E*E;for(;J.length;){const Me=J.pop()||0,De=J.pop()||0,Ye=J.pop()||0;if(De-Ye<=X){for(let Gt=Ye;Gt<=De;Gt++)ha(V[2*Gt],V[2*Gt+1],o,f)<=me&&oe.push(L[Gt]);continue}const ot=Ye+De>>1,lt=V[2*ot],Ct=V[2*ot+1];ha(lt,Ct,o,f)<=me&&oe.push(L[ot]),(Me===0?o-E<=lt:f-E<=Ct)&&(J.push(Ye),J.push(ot-1),J.push(1-Me)),(Me===0?o+E>=lt:f+E>=Ct)&&(J.push(ot+1),J.push(De),J.push(1-Me))}return oe}}function ca(c,o,f,E,L,V){if(L-E<=f)return;const X=E+L>>1;Eo(c,o,X,E,L,V),ca(c,o,f,E,X-1,1-V),ca(c,o,f,X+1,L,1-V)}function Eo(c,o,f,E,L,V){for(;L>E;){if(L-E>600){const me=L-E+1,Me=f-E+1,De=Math.log(me),Ye=.5*Math.exp(2*De/3),ot=.5*Math.sqrt(De*Ye*(me-Ye)/me)*(Me-me/2<0?-1:1);Eo(c,o,f,Math.max(E,Math.floor(f-Me*Ye/me+ot)),Math.min(L,Math.floor(f+(me-Me)*Ye/me+ot)),V)}const X=o[2*f+V];let J=E,oe=L;for(Pa(c,o,E,f),o[2*L+V]>X&&Pa(c,o,E,L);J<oe;){for(Pa(c,o,J,oe),J++,oe--;o[2*J+V]<X;)J++;for(;o[2*oe+V]>X;)oe--}o[2*E+V]===X?Pa(c,o,E,oe):(oe++,Pa(c,o,oe,L)),oe<=f&&(E=oe+1),f<=oe&&(L=oe-1)}}function Pa(c,o,f,E){na(c,f,E),na(o,2*f,2*E),na(o,2*f+1,2*E+1)}function na(c,o,f){const E=c[o];c[o]=c[f],c[f]=E}function ha(c,o,f,E){const L=c-f,V=o-E;return L*L+V*V}var Xs;R.bh=void 0,(Xs=R.bh||(R.bh={})).create="create",Xs.load="load",Xs.fullLoad="fullLoad";let Ls=null,Ea=[];const ws=1e3/60,qs="loadTime",ua="fullLoadTime",cu={mark(c){performance.mark(c)},frame(c){const o=c;Ls!=null&&Ea.push(o-Ls),Ls=o},clearMetrics(){Ls=null,Ea=[],performance.clearMeasures(qs),performance.clearMeasures(ua);for(const c in R.bh)performance.clearMarks(R.bh[c])},getPerformanceMetrics(){performance.measure(qs,R.bh.create,R.bh.load),performance.measure(ua,R.bh.create,R.bh.fullLoad);const c=performance.getEntriesByName(qs)[0].duration,o=performance.getEntriesByName(ua)[0].duration,f=Ea.length,E=1/(Ea.reduce((V,X)=>V+X,0)/f/1e3),L=Ea.filter(V=>V>ws).reduce((V,X)=>V+(X-ws)/ws,0);return{loadTime:c,fullLoadTime:o,fps:E,percentDroppedFrames:L/(f+L)*100,totalFrames:f}}};R.$=function(c,o,f){var E,L,V,X,J,oe,me,Me,De,Ye,ot,lt,Ct=f[0],Gt=f[1],Kt=f[2];return o===c?(c[12]=o[0]*Ct+o[4]*Gt+o[8]*Kt+o[12],c[13]=o[1]*Ct+o[5]*Gt+o[9]*Kt+o[13],c[14]=o[2]*Ct+o[6]*Gt+o[10]*Kt+o[14],c[15]=o[3]*Ct+o[7]*Gt+o[11]*Kt+o[15]):(L=o[1],V=o[2],X=o[3],J=o[4],oe=o[5],me=o[6],Me=o[7],De=o[8],Ye=o[9],ot=o[10],lt=o[11],c[0]=E=o[0],c[1]=L,c[2]=V,c[3]=X,c[4]=J,c[5]=oe,c[6]=me,c[7]=Me,c[8]=De,c[9]=Ye,c[10]=ot,c[11]=lt,c[12]=E*Ct+J*Gt+De*Kt+o[12],c[13]=L*Ct+oe*Gt+Ye*Kt+o[13],c[14]=V*Ct+me*Gt+ot*Kt+o[14],c[15]=X*Ct+Me*Gt+lt*Kt+o[15]),c},R.A=xf,R.B=Tl,R.C=class{constructor(c,o,f){this.receive=E=>{const L=E.data,V=L.id;if(V&&(!L.targetMapId||this.mapId===L.targetMapId))if(L.type==="<cancel>"){delete this.tasks[V];const X=this.cancelCallbacks[V];delete this.cancelCallbacks[V],X&&X()}else Dt()||L.mustQueue?(this.tasks[V]=L,this.taskQueue.push(V),this.invoker.trigger()):this.processTask(V,L)},this.process=()=>{if(!this.taskQueue.length)return;const E=this.taskQueue.shift(),L=this.tasks[E];delete this.tasks[E],this.taskQueue.length&&this.invoker.trigger(),L&&this.processTask(E,L)},this.target=c,this.parent=o,this.mapId=f,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new Md(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Dt()?c:window}send(c,o,f,E,L=!1){const V=Math.round(1e18*Math.random()).toString(36).substring(0,10);f&&(this.callbacks[V]=f);const X=[],J={id:V,type:c,hasCallback:!!f,targetMapId:E,mustQueue:L,sourceMapId:this.mapId,data:tu(o,X)};return this.target.postMessage(J,{transfer:X}),{cancel:()=>{f&&delete this.callbacks[V],this.target.postMessage({id:V,type:"<cancel>",targetMapId:E,sourceMapId:this.mapId})}}}processTask(c,o){if(o.type==="<response>"){const f=this.callbacks[c];delete this.callbacks[c],f&&(o.error?f(bu(o.error)):f(null,bu(o.data)))}else{let f=!1;const E=[],L=o.hasCallback?(J,oe)=>{f=!0,delete this.cancelCallbacks[c];const me={id:c,type:"<response>",sourceMapId:this.mapId,error:J?tu(J):null,data:tu(oe,E)};this.target.postMessage(me,{transfer:E})}:J=>{f=!0};let V=null;const X=bu(o.data);if(this.parent[o.type])V=this.parent[o.type](o.sourceMapId,X,L);else if("getWorkerSource"in this.parent){const J=o.type.split(".");V=this.parent.getWorkerSource(o.sourceMapId,J[0],X.source)[J[1]](X,L)}else L(new Error(`Could not find function ${o.type}`));!f&&V&&V.cancel&&(this.cancelCallbacks[c]=V.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},R.D=ji,R.E=ds,R.F=function(c,o){const f={};for(let E=0;E<o.length;E++){const L=o[E];L in c&&(f[L]=c[L])}return f},R.G=mc,R.H=mh,R.I=$t,R.J=er,R.K=fr,R.L=nd,R.M=rr,R.N=Ws,R.O=p,R.P=Ce,R.Q=_l,R.R=dc,R.S=Wi,R.T=uh,R.U=_,R.V=class extends Su{},R.W=F,R.X=function(c,o){const f=window.document.createElement("video");f.muted=!0,f.onloadstart=function(){o(null,f)};for(let E=0;E<c.length;E++){const L=window.document.createElement("source");qo(c[E])||(f.crossOrigin="Anonymous"),L.src=c[E],f.appendChild(L)}return{cancel:()=>{}}},R.Y=un,R.Z=function(){var c=new xf(16);return xf!=Float32Array&&(c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[11]=0,c[12]=0,c[13]=0,c[14]=0),c[0]=1,c[5]=1,c[10]=1,c[15]=1,c},R._=de,R.a=Pt,R.a$=class extends d{},R.a0=function(c,o,f){var E=f[0],L=f[1],V=f[2];return c[0]=o[0]*E,c[1]=o[1]*E,c[2]=o[2]*E,c[3]=o[3]*E,c[4]=o[4]*L,c[5]=o[5]*L,c[6]=o[6]*L,c[7]=o[7]*L,c[8]=o[8]*V,c[9]=o[9]*V,c[10]=o[10]*V,c[11]=o[11]*V,c[12]=o[12],c[13]=o[13],c[14]=o[14],c[15]=o[15],c},R.a1=ud,R.a2=function(){return pa++},R.a3=G,R.a4=rd,R.a5=function(){Rs.isLoading()||Rs.isLoaded()||ql()!=="deferred"||fa()},R.a6=bh,R.a7=Ol,R.a8=hs,R.a9=D,R.aA=tp,R.aB=function(c){c=c.slice();const o=Object.create(null);for(let f=0;f<c.length;f++)o[c[f].id]=c[f];for(let f=0;f<c.length;f++)"ref"in c[f]&&(c[f]=dr(c[f],o[c[f].ref]));return c},R.aC=function(c){if(c.type==="custom")return new wm(c);switch(c.type){case"background":return new cm(c);case"circle":return new Kl(c);case"fill":return new Nd(c);case"fill-extrusion":return new Xn(c);case"heatmap":return new Sp(c);case"hillshade":return new Nf(c);case"line":return new Ee(c);case"raster":return new Em(c);case"symbol":return new Mp(c)}},R.aD=Jr,R.aE=function(c,o){if(!c)return[{command:We.setStyle,args:[o]}];let f=[];try{if(!he(c.version,o.version))return[{command:We.setStyle,args:[o]}];he(c.center,o.center)||f.push({command:We.setCenter,args:[o.center]}),he(c.zoom,o.zoom)||f.push({command:We.setZoom,args:[o.zoom]}),he(c.bearing,o.bearing)||f.push({command:We.setBearing,args:[o.bearing]}),he(c.pitch,o.pitch)||f.push({command:We.setPitch,args:[o.pitch]}),he(c.sprite,o.sprite)||f.push({command:We.setSprite,args:[o.sprite]}),he(c.glyphs,o.glyphs)||f.push({command:We.setGlyphs,args:[o.glyphs]}),he(c.transition,o.transition)||f.push({command:We.setTransition,args:[o.transition]}),he(c.light,o.light)||f.push({command:We.setLight,args:[o.light]});const E={},L=[];(function(X,J,oe,me){let Me;for(Me in J=J||{},X=X||{})Object.prototype.hasOwnProperty.call(X,Me)&&(Object.prototype.hasOwnProperty.call(J,Me)||Ot(Me,oe,me));for(Me in J)Object.prototype.hasOwnProperty.call(J,Me)&&(Object.prototype.hasOwnProperty.call(X,Me)?he(X[Me],J[Me])||(X[Me].type==="geojson"&&J[Me].type==="geojson"&&Wr(X,J,Me)?oe.push({command:We.setGeoJSONSourceData,args:[Me,J[Me].data]}):or(Me,J,oe,me)):at(Me,J,oe))})(c.sources,o.sources,L,E);const V=[];c.layers&&c.layers.forEach(X=>{E[X.source]?f.push({command:We.removeLayer,args:[X.id]}):V.push(X)}),f=f.concat(L),function(X,J,oe){J=J||[];const me=(X=X||[]).map(kn),Me=J.map(kn),De=X.reduce(eo,{}),Ye=J.reduce(eo,{}),ot=me.slice(),lt=Object.create(null);let Ct,Gt,Kt,Er,cr,Rr,Qr;for(Ct=0,Gt=0;Ct<me.length;Ct++)Kt=me[Ct],Object.prototype.hasOwnProperty.call(Ye,Kt)?Gt++:(oe.push({command:We.removeLayer,args:[Kt]}),ot.splice(ot.indexOf(Kt,Gt),1));for(Ct=0,Gt=0;Ct<Me.length;Ct++)Kt=Me[Me.length-1-Ct],ot[ot.length-1-Ct]!==Kt&&(Object.prototype.hasOwnProperty.call(De,Kt)?(oe.push({command:We.removeLayer,args:[Kt]}),ot.splice(ot.lastIndexOf(Kt,ot.length-Gt),1)):Gt++,Rr=ot[ot.length-Ct],oe.push({command:We.addLayer,args:[Ye[Kt],Rr]}),ot.splice(ot.length-Ct,0,Kt),lt[Kt]=!0);for(Ct=0;Ct<Me.length;Ct++)if(Kt=Me[Ct],Er=De[Kt],cr=Ye[Kt],!lt[Kt]&&!he(Er,cr))if(he(Er.source,cr.source)&&he(Er["source-layer"],cr["source-layer"])&&he(Er.type,cr.type)){for(Qr in In(Er.layout,cr.layout,oe,Kt,null,We.setLayoutProperty),In(Er.paint,cr.paint,oe,Kt,null,We.setPaintProperty),he(Er.filter,cr.filter)||oe.push({command:We.setFilter,args:[Kt,cr.filter]}),he(Er.minzoom,cr.minzoom)&&he(Er.maxzoom,cr.maxzoom)||oe.push({command:We.setLayerZoomRange,args:[Kt,cr.minzoom,cr.maxzoom]}),Er)Object.prototype.hasOwnProperty.call(Er,Qr)&&Qr!=="layout"&&Qr!=="paint"&&Qr!=="filter"&&Qr!=="metadata"&&Qr!=="minzoom"&&Qr!=="maxzoom"&&(Qr.indexOf("paint.")===0?In(Er[Qr],cr[Qr],oe,Kt,Qr.slice(6),We.setPaintProperty):he(Er[Qr],cr[Qr])||oe.push({command:We.setLayerProperty,args:[Kt,Qr,cr[Qr]]}));for(Qr in cr)Object.prototype.hasOwnProperty.call(cr,Qr)&&!Object.prototype.hasOwnProperty.call(Er,Qr)&&Qr!=="layout"&&Qr!=="paint"&&Qr!=="filter"&&Qr!=="metadata"&&Qr!=="minzoom"&&Qr!=="maxzoom"&&(Qr.indexOf("paint.")===0?In(Er[Qr],cr[Qr],oe,Kt,Qr.slice(6),We.setPaintProperty):he(Er[Qr],cr[Qr])||oe.push({command:We.setLayerProperty,args:[Kt,Qr,cr[Qr]]}))}else oe.push({command:We.removeLayer,args:[Kt]}),Rr=ot[ot.lastIndexOf(Kt)+1],oe.push({command:We.addLayer,args:[cr,Rr]})}(V,o.layers,f)}catch(E){console.warn("Unable to compute style diff:",E),f=[{command:We.setStyle,args:[o]}]}return f},R.aF=function(c){const o=[],f=c.id;return f===void 0&&o.push({message:`layers.${f}: missing required property "id"`}),c.render===void 0&&o.push({message:`layers.${f}: missing required method "render"`}),c.renderingMode&&c.renderingMode!=="2d"&&c.renderingMode!=="3d"&&o.push({message:`layers.${f}: property "renderingMode" must be either "2d" or "3d"`}),o},R.aG=function c(o,f){if(Array.isArray(o)){if(!Array.isArray(f)||o.length!==f.length)return!1;for(let E=0;E<o.length;E++)if(!c(o[E],f[E]))return!1;return!0}if(typeof o=="object"&&o!==null&&f!==null){if(typeof f!="object"||Object.keys(o).length!==Object.keys(f).length)return!1;for(const E in o)if(!c(o[E],f[E]))return!1;return!0}return o===f},R.aH=xr,R.aI=jt,R.aJ=su,R.aK=function(c){return c({pluginStatus:Eu,pluginURL:lh}),su.on("pluginStateChange",c),c},R.aL=class extends Zl{constructor(c,o){super(c,o),this.current=0}set(c){this.current!==c&&(this.current=c,this.gl.uniform1i(this.location,c))}},R.aM=zu,R.aN=class extends Zl{constructor(c,o){super(c,o),this.current=Yc}set(c){if(c[12]!==this.current[12]||c[0]!==this.current[0])return this.current=c,void this.gl.uniformMatrix4fv(this.location,!1,c);for(let o=1;o<16;o++)if(c[o]!==this.current[o]){this.current=c,this.gl.uniformMatrix4fv(this.location,!1,c);break}}},R.aO=Uu,R.aP=class extends Zl{constructor(c,o){super(c,o),this.current=[0,0,0]}set(c){c[0]===this.current[0]&&c[1]===this.current[1]&&c[2]===this.current[2]||(this.current=c,this.gl.uniform3f(this.location,c[0],c[1],c[2]))}},R.aQ=class extends Zl{constructor(c,o){super(c,o),this.current=[0,0]}set(c){c[0]===this.current[0]&&c[1]===this.current[1]||(this.current=c,this.gl.uniform2f(this.location,c[0],c[1]))}},R.aR=hh,R.aS=function(c,o,f,E,L,V,X){var J=1/(o-f),oe=1/(E-L),me=1/(V-X);return c[0]=-2*J,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=-2*oe,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=2*me,c[11]=0,c[12]=(o+f)*J,c[13]=(L+E)*oe,c[14]=(X+V)*me,c[15]=1,c},R.aT=Yo,R.aU=Dd,R.aV=class extends I{},R.aW=as,R.aX=class extends H{},R.aY=function(c){return c<=1?1:Math.pow(2,Math.ceil(Math.log(c)/Math.LN2))},R.aZ=Fp,R.a_=tt,R.aa=function(c){const o={};if(c.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(f,E,L,V)=>{const X=L||V;return o[E]=!X||X.toLowerCase(),""}),o["max-age"]){const f=parseInt(o["max-age"],10);isNaN(f)?delete o["max-age"]:o["max-age"]=f}return o},R.ab=function(c,o){const f=[];for(const E in c)E in o||f.push(E);return f},R.ac=function(c){if($e==null){const o=c.navigator?c.navigator.userAgent:null;$e=!!c.safari||!(!o||!(/\b(iPad|iPhone|iPod)\b/.test(o)||o.match("Safari")&&!o.match("Chrome")))}return $e},R.ad=Kn,R.ae=function(c,o,f){var E=Math.sin(f),L=Math.cos(f),V=o[0],X=o[1],J=o[2],oe=o[3],me=o[4],Me=o[5],De=o[6],Ye=o[7];return o!==c&&(c[8]=o[8],c[9]=o[9],c[10]=o[10],c[11]=o[11],c[12]=o[12],c[13]=o[13],c[14]=o[14],c[15]=o[15]),c[0]=V*L+me*E,c[1]=X*L+Me*E,c[2]=J*L+De*E,c[3]=oe*L+Ye*E,c[4]=me*L-V*E,c[5]=Me*L-X*E,c[6]=De*L-J*E,c[7]=Ye*L-oe*E,c},R.af=function(c){var o=new xf(16);return o[0]=c[0],o[1]=c[1],o[2]=c[2],o[3]=c[3],o[4]=c[4],o[5]=c[5],o[6]=c[6],o[7]=c[7],o[8]=c[8],o[9]=c[9],o[10]=c[10],o[11]=c[11],o[12]=c[12],o[13]=c[13],o[14]=c[14],o[15]=c[15],o},R.ag=Yf,R.ah=function(c,o){let f=0,E=0;if(c.kind==="constant")E=c.layoutSize;else if(c.kind!=="source"){const{interpolationType:L,minZoom:V,maxZoom:X}=c,J=L?Kn(Fu.interpolationFactor(L,o,V,X),0,1):0;c.kind==="camera"?E=Tl.number(c.minSize,c.maxSize,J):f=J}return{uSizeT:f,uSize:E}},R.aj=function(c,{uSize:o,uSizeT:f},{lowerSize:E,upperSize:L}){return c.kind==="source"?E/Zp:c.kind==="composite"?Tl.number(E/Zp,L/Zp,f):o},R.ak=Bu,R.al=function(c,o,f,E){const L=o.y-c.y,V=o.x-c.x,X=E.y-f.y,J=E.x-f.x,oe=X*V-J*L;if(oe===0)return null;const me=(J*(c.y-f.y)-X*(c.x-f.x))/oe;return new Ce(c.x+me*V,c.y+me*L)},R.am=pe,R.an=ip,R.ao=tf,R.ap=ps,R.ar=Sf,R.as=function(c,o){var f=o[0],E=o[1],L=o[2],V=o[3],X=o[4],J=o[5],oe=o[6],me=o[7],Me=o[8],De=o[9],Ye=o[10],ot=o[11],lt=o[12],Ct=o[13],Gt=o[14],Kt=o[15],Er=f*J-E*X,cr=f*oe-L*X,Rr=f*me-V*X,Qr=E*oe-L*J,Fn=E*me-V*J,Ki=L*me-V*oe,Co=Me*Ct-De*lt,$i=Me*Gt-Ye*lt,Zi=Me*Kt-ot*lt,Ri=De*Gt-Ye*Ct,vo=De*Kt-ot*Ct,Ii=Ye*Kt-ot*Gt,ni=Er*Ii-cr*vo+Rr*Ri+Qr*Zi-Fn*$i+Ki*Co;return ni?(c[0]=(J*Ii-oe*vo+me*Ri)*(ni=1/ni),c[1]=(L*vo-E*Ii-V*Ri)*ni,c[2]=(Ct*Ki-Gt*Fn+Kt*Qr)*ni,c[3]=(Ye*Fn-De*Ki-ot*Qr)*ni,c[4]=(oe*Zi-X*Ii-me*$i)*ni,c[5]=(f*Ii-L*Zi+V*$i)*ni,c[6]=(Gt*Rr-lt*Ki-Kt*cr)*ni,c[7]=(Me*Ki-Ye*Rr+ot*cr)*ni,c[8]=(X*vo-J*Zi+me*Co)*ni,c[9]=(E*Zi-f*vo-V*Co)*ni,c[10]=(lt*Fn-Ct*Rr+Kt*Er)*ni,c[11]=(De*Rr-Me*Fn-ot*Er)*ni,c[12]=(J*$i-X*Ri-oe*Co)*ni,c[13]=(f*Ri-E*$i+L*Co)*ni,c[14]=(Ct*cr-lt*Qr-Gt*Er)*ni,c[15]=(Me*Qr-De*cr+Ye*Er)*ni,c):null},R.at=Go,R.au=Ch,R.av=ka,R.aw=function(){const c={},o=Ur.$version;for(const f in Ur.$root){const E=Ur.$root[f];if(E.required){let L=null;L=f==="version"?o:E.type==="array"?[]:{},L!=null&&(c[f]=L)}}return c},R.ax=We,R.ay=Dp,R.az=vi,R.b=function(c,o){const f=new Blob([new Uint8Array(c)],{type:"image/png"});createImageBitmap(f).then(E=>{o(null,E)}).catch(E=>{o(new Error(`Could not load image because of ${E.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},R.b0=Di,R.b1=function(c,o){var f=c[0],E=c[1],L=c[2],V=c[3],X=c[4],J=c[5],oe=c[6],me=c[7],Me=c[8],De=c[9],Ye=c[10],ot=c[11],lt=c[12],Ct=c[13],Gt=c[14],Kt=c[15],Er=o[0],cr=o[1],Rr=o[2],Qr=o[3],Fn=o[4],Ki=o[5],Co=o[6],$i=o[7],Zi=o[8],Ri=o[9],vo=o[10],Ii=o[11],ni=o[12],jo=o[13],Do=o[14],rs=o[15];return Math.abs(f-Er)<=Gu*Math.max(1,Math.abs(f),Math.abs(Er))&&Math.abs(E-cr)<=Gu*Math.max(1,Math.abs(E),Math.abs(cr))&&Math.abs(L-Rr)<=Gu*Math.max(1,Math.abs(L),Math.abs(Rr))&&Math.abs(V-Qr)<=Gu*Math.max(1,Math.abs(V),Math.abs(Qr))&&Math.abs(X-Fn)<=Gu*Math.max(1,Math.abs(X),Math.abs(Fn))&&Math.abs(J-Ki)<=Gu*Math.max(1,Math.abs(J),Math.abs(Ki))&&Math.abs(oe-Co)<=Gu*Math.max(1,Math.abs(oe),Math.abs(Co))&&Math.abs(me-$i)<=Gu*Math.max(1,Math.abs(me),Math.abs($i))&&Math.abs(Me-Zi)<=Gu*Math.max(1,Math.abs(Me),Math.abs(Zi))&&Math.abs(De-Ri)<=Gu*Math.max(1,Math.abs(De),Math.abs(Ri))&&Math.abs(Ye-vo)<=Gu*Math.max(1,Math.abs(Ye),Math.abs(vo))&&Math.abs(ot-Ii)<=Gu*Math.max(1,Math.abs(ot),Math.abs(Ii))&&Math.abs(lt-ni)<=Gu*Math.max(1,Math.abs(lt),Math.abs(ni))&&Math.abs(Ct-jo)<=Gu*Math.max(1,Math.abs(Ct),Math.abs(jo))&&Math.abs(Gt-Do)<=Gu*Math.max(1,Math.abs(Gt),Math.abs(Do))&&Math.abs(Kt-rs)<=Gu*Math.max(1,Math.abs(Kt),Math.abs(rs))},R.b2=function(c,o){return c[0]=o[0],c[1]=o[1],c[2]=o[2],c[3]=o[3],c[4]=o[4],c[5]=o[5],c[6]=o[6],c[7]=o[7],c[8]=o[8],c[9]=o[9],c[10]=o[10],c[11]=o[11],c[12]=o[12],c[13]=o[13],c[14]=o[14],c[15]=o[15],c},R.b3=function(c,o,f){return c[0]=o[0]*f[0],c[1]=o[1]*f[1],c[2]=o[2]*f[2],c[3]=o[3]*f[3],c},R.b4=function(c,o){return c[0]*o[0]+c[1]*o[1]+c[2]*o[2]+c[3]*o[3]},R.b5=Jn,R.b6=j,R.b7=Zd,R.b8=function(c,o,f,E,L){var V,X=1/Math.tan(o/2);return c[0]=X/f,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=X,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[11]=-1,c[12]=0,c[13]=0,c[15]=0,L!=null&&L!==1/0?(c[10]=(L+E)*(V=1/(E-L)),c[14]=2*L*E*V):(c[10]=-1,c[14]=-2*E),c},R.b9=function(c,o,f){var E=Math.sin(f),L=Math.cos(f),V=o[4],X=o[5],J=o[6],oe=o[7],me=o[8],Me=o[9],De=o[10],Ye=o[11];return o!==c&&(c[0]=o[0],c[1]=o[1],c[2]=o[2],c[3]=o[3],c[12]=o[12],c[13]=o[13],c[14]=o[14],c[15]=o[15]),c[4]=V*L+me*E,c[5]=X*L+Me*E,c[6]=J*L+De*E,c[7]=oe*L+Ye*E,c[8]=me*L-V*E,c[9]=Me*L-X*E,c[10]=De*L-J*E,c[11]=Ye*L-oe*E,c},R.bA=Le,R.bB=du,R.bC=wc,R.bD=Rs,R.ba=Ar,R.bb=pn,R.bc=function(c,o){return c[0]=o[0],c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=o[1],c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=o[2],c[11]=0,c[12]=0,c[13]=0,c[14]=0,c[15]=1,c},R.bd=class extends zh{},R.be=cf,R.bf=i,R.bg=cu,R.bi=Uo,R.bj=function(c,o,f=!1){if(Eu===wh||Eu===Pc||Eu===Xl)throw new Error("setRTLTextPlugin cannot be called multiple times.");lh=yi.resolveURL(c),Eu=wh,Rc=o,rp(),f||fa()},R.bk=ql,R.bl=function(c,o){const f={};for(let L=0;L<c.length;L++){const V=o&&o[c[L].id]||Fh(c[L]);o&&(o[c[L].id]=V);let X=f[V];X||(X=f[V]=[]),X.push(c[L])}const E=[];for(const L in f)E.push(f[L]);return E},R.bm=oi,R.bn=w,R.bo=N,R.bp=zr,R.bq=function(c){c.bucket.createArrays(),c.bucket.tilePixelRatio=Ws/(512*c.bucket.overscaling),c.bucket.compareText={},c.bucket.iconsNeedLinear=!1;const o=c.bucket.layers[0],f=o.layout,E=o._unevaluatedLayout._values,L={layoutIconSize:E["icon-size"].possiblyEvaluate(new hs(c.bucket.zoom+1),c.canonical),layoutTextSize:E["text-size"].possiblyEvaluate(new hs(c.bucket.zoom+1),c.canonical),textMaxSize:E["text-size"].possiblyEvaluate(new hs(18))};if(c.bucket.textSizeData.kind==="composite"){const{minZoom:me,maxZoom:Me}=c.bucket.textSizeData;L.compositeTextSizes=[E["text-size"].possiblyEvaluate(new hs(me),c.canonical),E["text-size"].possiblyEvaluate(new hs(Me),c.canonical)]}if(c.bucket.iconSizeData.kind==="composite"){const{minZoom:me,maxZoom:Me}=c.bucket.iconSizeData;L.compositeIconSizes=[E["icon-size"].possiblyEvaluate(new hs(me),c.canonical),E["icon-size"].possiblyEvaluate(new hs(Me),c.canonical)]}const V=f.get("text-line-height")*ps,X=f.get("text-rotation-alignment")!=="viewport"&&f.get("symbol-placement")!=="point",J=f.get("text-keep-upright"),oe=f.get("text-size");for(const me of c.bucket.features){const Me=f.get("text-font").evaluate(me,{},c.canonical).join(","),De=oe.evaluate(me,{},c.canonical),Ye=L.layoutTextSize.evaluate(me,{},c.canonical),ot=L.layoutIconSize.evaluate(me,{},c.canonical),lt={horizontal:{},vertical:void 0},Ct=me.text;let Gt,Kt=[0,0];if(Ct){const Rr=Ct.toString(),Qr=f.get("text-letter-spacing").evaluate(me,{},c.canonical)*ps,Fn=ep(Rr)?Qr:0,Ki=f.get("text-anchor").evaluate(me,{},c.canonical),Co=fo(o,me,c.canonical);if(!Co){const Ii=f.get("text-radial-offset").evaluate(me,{},c.canonical);Kt=Ii?Ci(Ki,[Ii*ps,Yi]):f.get("text-offset").evaluate(me,{},c.canonical).map(ni=>ni*ps)}let $i=X?"center":f.get("text-justify").evaluate(me,{},c.canonical);const Zi=f.get("symbol-placement"),Ri=Zi==="point"?f.get("text-max-width").evaluate(me,{},c.canonical)*ps:0,vo=()=>{c.bucket.allowVerticalPlacement&&is(Rr)&&(lt.vertical=Qn(Ct,c.glyphMap,c.glyphPositions,c.imagePositions,Me,Ri,V,Ki,"left",Fn,Kt,R.ai.vertical,!0,Zi,Ye,De))};if(!X&&Co){const Ii=new Set;if($i==="auto")for(let jo=0;jo<Co.values.length;jo+=2)Ii.add(Go(Co.values[jo]));else Ii.add($i);let ni=!1;for(const jo of Ii)if(!lt.horizontal[jo])if(ni)lt.horizontal[jo]=lt.horizontal[0];else{const Do=Qn(Ct,c.glyphMap,c.glyphPositions,c.imagePositions,Me,Ri,V,"center",jo,Fn,Kt,R.ai.horizontal,!1,Zi,Ye,De);Do&&(lt.horizontal[jo]=Do,ni=Do.positionedLines.length===1)}vo()}else{$i==="auto"&&($i=Go(Ki));const Ii=Qn(Ct,c.glyphMap,c.glyphPositions,c.imagePositions,Me,Ri,V,Ki,$i,Fn,Kt,R.ai.horizontal,!1,Zi,Ye,De);Ii&&(lt.horizontal[$i]=Ii),vo(),is(Rr)&&X&&J&&(lt.vertical=Qn(Ct,c.glyphMap,c.glyphPositions,c.imagePositions,Me,Ri,V,Ki,$i,Fn,Kt,R.ai.vertical,!1,Zi,Ye,De))}}let Er=!1;if(me.icon&&me.icon.name){const Rr=c.imageMap[me.icon.name];Rr&&(Gt=Up(c.imagePositions[me.icon.name],f.get("icon-offset").evaluate(me,{},c.canonical),f.get("icon-anchor").evaluate(me,{},c.canonical)),Er=!!Rr.sdf,c.bucket.sdfIcons===void 0?c.bucket.sdfIcons=Er:c.bucket.sdfIcons!==Er&&rn("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Rr.pixelRatio!==c.bucket.pixelRatio||f.get("icon-rotate").constantOr(1)!==0)&&(c.bucket.iconsNeedLinear=!0))}const cr=Vo(lt.horizontal)||lt.vertical;c.bucket.iconsInText=!!cr&&cr.iconsInText,(cr||Gt)&&hi(c.bucket,me,lt,Gt,c.imageMap,L,Ye,ot,Kt,Er,c.canonical)}c.showCollisionBoxes&&c.bucket.generateCollisionDebugBuffers()},R.br=bi,R.bs=fd,R.bt=ci,R.bu=class{constructor(c){this._marks={start:[c.url,"start"].join("#"),end:[c.url,"end"].join("#"),measure:c.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let c=performance.getEntriesByName(this._marks.measure);return c.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),c=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),c}},R.bv=Br,R.bw=cl,R.bx=function(c,o,f,E,L){return de(this,void 0,void 0,function*(){if(fr())try{return yield rr(c,o,f,E,L)}catch(V){}return function(V,X,J,oe,me){const Me=V.width,De=V.height;ar&&wr||(ar=new OffscreenCanvas(Me,De),wr=ar.getContext("2d",{willReadFrequently:!0})),ar.width=Me,ar.height=De,wr.drawImage(V,0,0,Me,De);const Ye=wr.getImageData(X,J,oe,me);return wr.clearRect(0,0,Me,De),Ye.data}(c,o,f,E,L)})},R.by=m,R.bz=be,R.c=li,R.d=function(c,o){const f=new Image;f.onload=()=>{o(null,f),URL.revokeObjectURL(f.src),f.onload=null,window.requestAnimationFrame(()=>{f.src=vt})},f.onerror=()=>o(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const E=new Blob([new Uint8Array(c)],{type:"image/png"});f.src=c.byteLength?URL.createObjectURL(E):vt},R.e=ki,R.f=function(c,o){return Xi(ki(c,{type:"json"}),o)},R.g=bo,R.h=yi,R.i=Dt,R.j=Pi,R.k=Vi,R.l=Mi,R.m=Xi,R.n=function(c){return new Br(c).readFields(Jt,[])},R.o=function(c,o,f){if(!c.length)return f(null,[]);let E=c.length;const L=new Array(c.length);let V=null;c.forEach((X,J)=>{o(X,(oe,me)=>{oe&&(V=oe),L[J]=me,--E==0&&f(V,L)})})},R.p=Xt,R.q=xl,R.r=ul,R.s=qo,R.t=Qh,R.u=ai,R.v=Ur,R.w=rn,R.x=ll,R.y=ah,R.z=function([c,o,f]){return o+=90,o*=Math.PI/180,f*=Math.PI/180,{x:c*Math.cos(o)*Math.sin(f),y:c*Math.sin(o)*Math.sin(f),z:c*Math.cos(f)}}}),Ze(["./shared"],function(R){"use strict";class de{constructor(Ne){this.keyCache={},Ne&&this.replace(Ne)}replace(Ne){this._layerConfigs={},this._layers={},this.update(Ne,[])}update(Ne,re){for(const ge of Ne){this._layerConfigs[ge.id]=ge;const ye=this._layers[ge.id]=R.aC(ge);ye._featureFilter=R.a6(ye.filter),this.keyCache[ge.id]&&delete this.keyCache[ge.id]}for(const ge of re)delete this.keyCache[ge],delete this._layerConfigs[ge],delete this._layers[ge];this.familiesBySource={};const le=R.bl(Object.values(this._layerConfigs),this.keyCache);for(const ge of le){const ye=ge.map(wt=>this._layers[wt.id]),ze=ye[0];if(ze.visibility==="none")continue;const je=ze.source||"";let Ue=this.familiesBySource[je];Ue||(Ue=this.familiesBySource[je]={});const Ae=ze.sourceLayer||"_geojsonTileLayer";let Je=Ue[Ae];Je||(Je=Ue[Ae]=[]),Je.push(ye)}}}class be{constructor(Ne){const re={},le=[];for(const je in Ne){const Ue=Ne[je],Ae=re[je]={};for(const Je in Ue){const wt=Ue[+Je];if(!wt||wt.bitmap.width===0||wt.bitmap.height===0)continue;const Ht={x:0,y:0,w:wt.bitmap.width+2,h:wt.bitmap.height+2};le.push(Ht),Ae[Je]={rect:Ht,metrics:wt.metrics}}}const{w:ge,h:ye}=R.p(le),ze=new R.q({width:ge||1,height:ye||1});for(const je in Ne){const Ue=Ne[je];for(const Ae in Ue){const Je=Ue[+Ae];if(!Je||Je.bitmap.width===0||Je.bitmap.height===0)continue;const wt=re[je][Ae].rect;R.q.copy(Je.bitmap,ze,{x:0,y:0},{x:wt.x+1,y:wt.y+1},Je.bitmap)}}this.image=ze,this.positions=re}}R.bm("GlyphAtlas",be);class Le{constructor(Ne){this.tileID=new R.O(Ne.tileID.overscaledZ,Ne.tileID.wrap,Ne.tileID.canonical.z,Ne.tileID.canonical.x,Ne.tileID.canonical.y),this.uid=Ne.uid,this.zoom=Ne.zoom,this.pixelRatio=Ne.pixelRatio,this.tileSize=Ne.tileSize,this.source=Ne.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Ne.showCollisionBoxes,this.collectResourceTiming=!!Ne.collectResourceTiming,this.returnDependencies=!!Ne.returnDependencies,this.promoteId=Ne.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(Ne,re,le,ge,ye){this.status="parsing",this.data=Ne,this.collisionBoxArray=new R.a3;const ze=new R.bn(Object.keys(Ne.layers).sort()),je=new R.bo(this.tileID,this.promoteId);je.bucketLayerIDs=[];const Ue={},Ae={featureIndex:je,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:le},Je=re.familiesBySource[this.source];for(const bn in Je){const En=Ne.layers[bn];if(!En)continue;En.version===1&&R.w(`Vector tile source "${this.source}" layer "${bn}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const io=ze.encode(bn),On=[];for(let Ao=0;Ao<En.length;Ao++){const ia=En.feature(Ao),Ho=je.getId(ia,bn);On.push({feature:ia,id:Ho,index:Ao,sourceLayerIndex:io})}for(const Ao of Je[bn]){const ia=Ao[0];ia.source!==this.source&&R.w(`layer.source = ${ia.source} does not equal this.source = ${this.source}`),ia.minzoom&&this.zoom<Math.floor(ia.minzoom)||ia.maxzoom&&this.zoom>=ia.maxzoom||ia.visibility!=="none"&&(Re(Ao,this.zoom,le),(Ue[ia.id]=ia.createBucket({index:je.bucketLayerIDs.length,layers:Ao,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:io,sourceID:this.source})).populate(On,Ae,this.tileID.canonical),je.bucketLayerIDs.push(Ao.map(Ho=>Ho.id)))}}let wt,Ht,Fr,mr;const Sr=R.aH(Ae.glyphDependencies,bn=>Object.keys(bn).map(Number));this.inFlightDependencies.forEach(bn=>bn==null?void 0:bn.cancel()),this.inFlightDependencies=[];const fn=++this.dependencySentinel;Object.keys(Sr).length?this.inFlightDependencies.push(ge.send("getGlyphs",{uid:this.uid,stacks:Sr,source:this.source,tileID:this.tileID,type:"glyphs"},(bn,En)=>{fn===this.dependencySentinel&&(wt||(wt=bn,Ht=En,Nn.call(this)))})):Ht={};const xn=Object.keys(Ae.iconDependencies);xn.length?this.inFlightDependencies.push(ge.send("getImages",{icons:xn,source:this.source,tileID:this.tileID,type:"icons"},(bn,En)=>{fn===this.dependencySentinel&&(wt||(wt=bn,Fr=En,Nn.call(this)))})):Fr={};const Lr=Object.keys(Ae.patternDependencies);function Nn(){if(wt)return ye(wt);if(Ht&&Fr&&mr){const bn=new be(Ht),En=new R.bp(Fr,mr);for(const io in Ue){const On=Ue[io];On instanceof R.a4?(Re(On.layers,this.zoom,le),R.bq({bucket:On,glyphMap:Ht,glyphPositions:bn.positions,imageMap:Fr,imagePositions:En.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):On.hasPattern&&(On instanceof R.br||On instanceof R.bs||On instanceof R.bt)&&(Re(On.layers,this.zoom,le),On.addFeatures(Ae,this.tileID.canonical,En.patternPositions))}this.status="done",ye(null,{buckets:Object.values(Ue).filter(io=>!io.isEmpty()),featureIndex:je,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:bn.image,imageAtlas:En,glyphMap:this.returnDependencies?Ht:null,iconMap:this.returnDependencies?Fr:null,glyphPositions:this.returnDependencies?bn.positions:null})}}Lr.length?this.inFlightDependencies.push(ge.send("getImages",{icons:Lr,source:this.source,tileID:this.tileID,type:"patterns"},(bn,En)=>{fn===this.dependencySentinel&&(wt||(wt=bn,mr=En,Nn.call(this)))})):mr={},Nn.call(this)}}function Re(Lt,Ne,re){const le=new R.a8(Ne);for(const ge of Lt)ge.recalculate(le,re)}function Ce(Lt,Ne){const re=R.l(Lt.request,(le,ge,ye,ze)=>{if(le)Ne(le);else if(ge)try{const je=new R.bw.VectorTile(new R.bv(ge));Ne(null,{vectorTile:je,rawData:ge,cacheControl:ye,expires:ze})}catch(je){const Ue=new Uint8Array(ge);let Ae=`Unable to parse the tile at ${Lt.request.url}, `;Ae+=Ue[0]===31&&Ue[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${je.messge}`,Ne(new Error(Ae))}});return()=>{re.cancel(),Ne()}}class He{constructor(Ne,re,le,ge){this.actor=Ne,this.layerIndex=re,this.availableImages=le,this.loadVectorData=ge||Ce,this.fetching={},this.loading={},this.loaded={}}loadTile(Ne,re){const le=Ne.uid;this.loading||(this.loading={});const ge=!!(Ne&&Ne.request&&Ne.request.collectResourceTiming)&&new R.bu(Ne.request),ye=this.loading[le]=new Le(Ne);ye.abort=this.loadVectorData(Ne,(ze,je)=>{if(delete this.loading[le],ze||!je)return ye.status="done",this.loaded[le]=ye,re(ze);const Ue=je.rawData,Ae={};je.expires&&(Ae.expires=je.expires),je.cacheControl&&(Ae.cacheControl=je.cacheControl);const Je={};if(ge){const wt=ge.finish();wt&&(Je.resourceTiming=JSON.parse(JSON.stringify(wt)))}ye.vectorTile=je.vectorTile,ye.parse(je.vectorTile,this.layerIndex,this.availableImages,this.actor,(wt,Ht)=>{if(delete this.fetching[le],wt||!Ht)return re(wt);re(null,R.e({rawTileData:Ue.slice(0)},Ht,Ae,Je))}),this.loaded=this.loaded||{},this.loaded[le]=ye,this.fetching[le]={rawTileData:Ue,cacheControl:Ae,resourceTiming:Je}})}reloadTile(Ne,re){const le=this.loaded,ge=Ne.uid;if(le&&le[ge]){const ye=le[ge];ye.showCollisionBoxes=Ne.showCollisionBoxes,ye.status==="parsing"?ye.parse(ye.vectorTile,this.layerIndex,this.availableImages,this.actor,(ze,je)=>{if(ze||!je)return re(ze,je);let Ue;if(this.fetching[ge]){const{rawTileData:Ae,cacheControl:Je,resourceTiming:wt}=this.fetching[ge];delete this.fetching[ge],Ue=R.e({rawTileData:Ae.slice(0)},je,Je,wt)}else Ue=je;re(null,Ue)}):ye.status==="done"&&(ye.vectorTile?ye.parse(ye.vectorTile,this.layerIndex,this.availableImages,this.actor,re):re())}}abortTile(Ne,re){const le=this.loading,ge=Ne.uid;le&&le[ge]&&le[ge].abort&&(le[ge].abort(),delete le[ge]),re()}removeTile(Ne,re){const le=this.loaded,ge=Ne.uid;le&&le[ge]&&delete le[ge],re()}}class Xe{constructor(){this.loaded={}}loadTile(Ne,re){return R._(this,void 0,void 0,function*(){const{uid:le,encoding:ge,rawImageData:ye,redFactor:ze,greenFactor:je,blueFactor:Ue,baseShift:Ae}=Ne,Je=ye.width+2,wt=ye.height+2,Ht=R.a(ye)?new R.R({width:Je,height:wt},yield R.bx(ye,-1,-1,Je,wt)):ye,Fr=new R.by(le,Ht,ge,ze,je,Ue,Ae);this.loaded=this.loaded||{},this.loaded[le]=Fr,re(null,Fr)})}removeTile(Ne){const re=this.loaded,le=Ne.uid;re&&re[le]&&delete re[le]}}function Ke(Lt,Ne){if(Lt.length!==0){Ve(Lt[0],Ne);for(var re=1;re<Lt.length;re++)Ve(Lt[re],!Ne)}}function Ve(Lt,Ne){for(var re=0,le=0,ge=0,ye=Lt.length,ze=ye-1;ge<ye;ze=ge++){var je=(Lt[ge][0]-Lt[ze][0])*(Lt[ze][1]+Lt[ge][1]),Ue=re+je;le+=Math.abs(re)>=Math.abs(je)?re-Ue+je:je-Ue+re,re=Ue}re+le>=0!=!!Ne&&Lt.reverse()}var et=R.bz(function Lt(Ne,re){var le,ge=Ne&&Ne.type;if(ge==="FeatureCollection")for(le=0;le<Ne.features.length;le++)Lt(Ne.features[le],re);else if(ge==="GeometryCollection")for(le=0;le<Ne.geometries.length;le++)Lt(Ne.geometries[le],re);else if(ge==="Feature")Lt(Ne.geometry,re);else if(ge==="Polygon")Ke(Ne.coordinates,re);else if(ge==="MultiPolygon")for(le=0;le<Ne.coordinates.length;le++)Ke(Ne.coordinates[le],re);return Ne});const er=R.bw.VectorTileFeature.prototype.toGeoJSON;var fr={exports:{}},Ar=R.bA,pn=R.bw.VectorTileFeature,Kn=Jn;function Jn(Lt,Ne){this.options=Ne||{},this.features=Lt,this.length=Lt.length}function ki(Lt,Ne){this.id=typeof Lt.id=="number"?Lt.id:void 0,this.type=Lt.type,this.rawGeometry=Lt.type===1?[Lt.geometry]:Lt.geometry,this.properties=Lt.tags,this.extent=Ne||4096}Jn.prototype.feature=function(Lt){return new ki(this.features[Lt],this.options.extent)},ki.prototype.loadGeometry=function(){var Lt=this.rawGeometry;this.geometry=[];for(var Ne=0;Ne<Lt.length;Ne++){for(var re=Lt[Ne],le=[],ge=0;ge<re.length;ge++)le.push(new Ar(re[ge][0],re[ge][1]));this.geometry.push(le)}return this.geometry},ki.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var Lt=this.geometry,Ne=1/0,re=-1/0,le=1/0,ge=-1/0,ye=0;ye<Lt.length;ye++)for(var ze=Lt[ye],je=0;je<ze.length;je++){var Ue=ze[je];Ne=Math.min(Ne,Ue.x),re=Math.max(re,Ue.x),le=Math.min(le,Ue.y),ge=Math.max(ge,Ue.y)}return[Ne,le,re,ge]},ki.prototype.toGeoJSON=pn.prototype.toGeoJSON;var pa=R.bB,xr=Kn;function jt(Lt){var Ne=new pa;return function(re,le){for(var ge in re.layers)le.writeMessage(3,Jr,re.layers[ge])}(Lt,Ne),Ne.finish()}function Jr(Lt,Ne){var re;Ne.writeVarintField(15,Lt.version||1),Ne.writeStringField(1,Lt.name||""),Ne.writeVarintField(5,Lt.extent||4096);var le={keys:[],values:[],keycache:{},valuecache:{}};for(re=0;re<Lt.length;re++)le.feature=Lt.feature(re),Ne.writeMessage(2,gr,le);var ge=le.keys;for(re=0;re<ge.length;re++)Ne.writeStringField(3,ge[re]);var ye=le.values;for(re=0;re<ye.length;re++)Ne.writeMessage(4,$e,ye[re])}function gr(Lt,Ne){var re=Lt.feature;re.id!==void 0&&Ne.writeVarintField(1,re.id),Ne.writeMessage(2,rn,Lt),Ne.writeVarintField(3,re.type),Ne.writeMessage(4,Dt,re)}function rn(Lt,Ne){var re=Lt.feature,le=Lt.keys,ge=Lt.values,ye=Lt.keycache,ze=Lt.valuecache;for(var je in re.properties){var Ue=re.properties[je],Ae=ye[je];if(Ue!==null){Ae===void 0&&(le.push(je),ye[je]=Ae=le.length-1),Ne.writeVarint(Ae);var Je=typeof Ue;Je!=="string"&&Je!=="boolean"&&Je!=="number"&&(Ue=JSON.stringify(Ue));var wt=Je+":"+Ue,Ht=ze[wt];Ht===void 0&&(ge.push(Ue),ze[wt]=Ht=ge.length-1),Ne.writeVarint(Ht)}}}function jn(Lt,Ne){return(Ne<<3)+(7&Lt)}function qe(Lt){return Lt<<1^Lt>>31}function Dt(Lt,Ne){for(var re=Lt.loadGeometry(),le=Lt.type,ge=0,ye=0,ze=re.length,je=0;je<ze;je++){var Ue=re[je],Ae=1;le===1&&(Ae=Ue.length),Ne.writeVarint(jn(1,Ae));for(var Je=le===3?Ue.length-1:Ue.length,wt=0;wt<Je;wt++){wt===1&&le!==1&&Ne.writeVarint(jn(2,Je-1));var Ht=Ue[wt].x-ge,Fr=Ue[wt].y-ye;Ne.writeVarint(qe(Ht)),Ne.writeVarint(qe(Fr)),ge+=Ht,ye+=Fr}le===3&&Ne.writeVarint(jn(7,1))}}function $e(Lt,Ne){var re=typeof Lt;re==="string"?Ne.writeStringField(1,Lt):re==="boolean"?Ne.writeBooleanField(7,Lt):re==="number"&&(Lt%1!=0?Ne.writeDoubleField(3,Lt):Lt<0?Ne.writeSVarintField(6,Lt):Ne.writeVarintField(5,Lt))}fr.exports=jt,fr.exports.fromVectorTileJs=jt,fr.exports.fromGeojsonVt=function(Lt,Ne){Ne=Ne||{};var re={};for(var le in Lt)re[le]=new xr(Lt[le].features,Ne),re[le].name=le,re[le].version=Ne.version,re[le].extent=Ne.extent;return jt({layers:re})},fr.exports.GeoJSONWrapper=xr;var Pt=R.bz(fr.exports);const vt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:Lt=>Lt},rr=Math.fround||(ar=new Float32Array(1),Lt=>(ar[0]=+Lt,ar[0]));var ar;const wr=3,Cr=5,an=6;class yi{constructor(Ne){this.options=Object.assign(Object.create(vt),Ne),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Ne){const{log:re,minZoom:le,maxZoom:ge}=this.options;re&&console.time("total time");const ye=`prepare ${Ne.length} points`;re&&console.time(ye),this.points=Ne;const ze=[];for(let Ue=0;Ue<Ne.length;Ue++){const Ae=Ne[Ue];if(!Ae.geometry)continue;const[Je,wt]=Ae.geometry.coordinates,Ht=rr(vi(Je)),Fr=rr(bo(wt));ze.push(Ht,Fr,1/0,Ue,-1,1),this.options.reduce&&ze.push(0)}let je=this.trees[ge+1]=this._createTree(ze);re&&console.timeEnd(ye);for(let Ue=ge;Ue>=le;Ue--){const Ae=+Date.now();je=this.trees[Ue]=this._createTree(this._cluster(je,Ue)),re&&console.log("z%d: %d clusters in %dms",Ue,je.numItems,+Date.now()-Ae)}return re&&console.timeEnd("total time"),this}getClusters(Ne,re){let le=((Ne[0]+180)%360+360)%360-180;const ge=Math.max(-90,Math.min(90,Ne[1]));let ye=Ne[2]===180?180:((Ne[2]+180)%360+360)%360-180;const ze=Math.max(-90,Math.min(90,Ne[3]));if(Ne[2]-Ne[0]>=360)le=-180,ye=180;else if(le>ye){const wt=this.getClusters([le,ge,180,ze],re),Ht=this.getClusters([-180,ge,ye,ze],re);return wt.concat(Ht)}const je=this.trees[this._limitZoom(re)],Ue=je.range(vi(le),bo(ze),vi(ye),bo(ge)),Ae=je.data,Je=[];for(const wt of Ue){const Ht=this.stride*wt;Je.push(Ae[Ht+Cr]>1?li(Ae,Ht,this.clusterProps):this.points[Ae[Ht+wr]])}return Je}getChildren(Ne){const re=this._getOriginId(Ne),le=this._getOriginZoom(Ne),ge="No cluster with the specified id.",ye=this.trees[le];if(!ye)throw new Error(ge);const ze=ye.data;if(re*this.stride>=ze.length)throw new Error(ge);const je=this.options.radius/(this.options.extent*Math.pow(2,le-1)),Ue=ye.within(ze[re*this.stride],ze[re*this.stride+1],je),Ae=[];for(const Je of Ue){const wt=Je*this.stride;ze[wt+4]===Ne&&Ae.push(ze[wt+Cr]>1?li(ze,wt,this.clusterProps):this.points[ze[wt+wr]])}if(Ae.length===0)throw new Error(ge);return Ae}getLeaves(Ne,re,le){const ge=[];return this._appendLeaves(ge,Ne,re=re||10,le=le||0,0),ge}getTile(Ne,re,le){const ge=this.trees[this._limitZoom(Ne)],ye=Math.pow(2,Ne),{extent:ze,radius:je}=this.options,Ue=je/ze,Ae=(le-Ue)/ye,Je=(le+1+Ue)/ye,wt={features:[]};return this._addTileFeatures(ge.range((re-Ue)/ye,Ae,(re+1+Ue)/ye,Je),ge.data,re,le,ye,wt),re===0&&this._addTileFeatures(ge.range(1-Ue/ye,Ae,1,Je),ge.data,ye,le,ye,wt),re===ye-1&&this._addTileFeatures(ge.range(0,Ae,Ue/ye,Je),ge.data,-1,le,ye,wt),wt.features.length?wt:null}getClusterExpansionZoom(Ne){let re=this._getOriginZoom(Ne)-1;for(;re<=this.options.maxZoom;){const le=this.getChildren(Ne);if(re++,le.length!==1)break;Ne=le[0].properties.cluster_id}return re}_appendLeaves(Ne,re,le,ge,ye){const ze=this.getChildren(re);for(const je of ze){const Ue=je.properties;if(Ue&&Ue.cluster?ye+Ue.point_count<=ge?ye+=Ue.point_count:ye=this._appendLeaves(Ne,Ue.cluster_id,le,ge,ye):ye<ge?ye++:Ne.push(je),Ne.length===le)break}return ye}_createTree(Ne){const re=new R.av(Ne.length/this.stride|0,this.options.nodeSize,Float32Array);for(let le=0;le<Ne.length;le+=this.stride)re.add(Ne[le],Ne[le+1]);return re.finish(),re.data=Ne,re}_addTileFeatures(Ne,re,le,ge,ye,ze){for(const je of Ne){const Ue=je*this.stride,Ae=re[Ue+Cr]>1;let Je,wt,Ht;if(Ae)Je=Uo(re,Ue,this.clusterProps),wt=re[Ue],Ht=re[Ue+1];else{const Sr=this.points[re[Ue+wr]];Je=Sr.properties;const[fn,xn]=Sr.geometry.coordinates;wt=vi(fn),Ht=bo(xn)}const Fr={type:1,geometry:[[Math.round(this.options.extent*(wt*ye-le)),Math.round(this.options.extent*(Ht*ye-ge))]],tags:Je};let mr;mr=Ae||this.options.generateId?re[Ue+wr]:this.points[re[Ue+wr]].id,mr!==void 0&&(Fr.id=mr),ze.features.push(Fr)}}_limitZoom(Ne){return Math.max(this.options.minZoom,Math.min(Math.floor(+Ne),this.options.maxZoom+1))}_cluster(Ne,re){const{radius:le,extent:ge,reduce:ye,minPoints:ze}=this.options,je=le/(ge*Math.pow(2,re)),Ue=Ne.data,Ae=[],Je=this.stride;for(let wt=0;wt<Ue.length;wt+=Je){if(Ue[wt+2]<=re)continue;Ue[wt+2]=re;const Ht=Ue[wt],Fr=Ue[wt+1],mr=Ne.within(Ue[wt],Ue[wt+1],je),Sr=Ue[wt+Cr];let fn=Sr;for(const xn of mr){const Lr=xn*Je;Ue[Lr+2]>re&&(fn+=Ue[Lr+Cr])}if(fn>Sr&&fn>=ze){let xn,Lr=Ht*Sr,Nn=Fr*Sr,bn=-1;const En=((wt/Je|0)<<5)+(re+1)+this.points.length;for(const io of mr){const On=io*Je;if(Ue[On+2]<=re)continue;Ue[On+2]=re;const Ao=Ue[On+Cr];Lr+=Ue[On]*Ao,Nn+=Ue[On+1]*Ao,Ue[On+4]=En,ye&&(xn||(xn=this._map(Ue,wt,!0),bn=this.clusterProps.length,this.clusterProps.push(xn)),ye(xn,this._map(Ue,On)))}Ue[wt+4]=En,Ae.push(Lr/fn,Nn/fn,1/0,En,-1,fn),ye&&Ae.push(bn)}else{for(let xn=0;xn<Je;xn++)Ae.push(Ue[wt+xn]);if(fn>1)for(const xn of mr){const Lr=xn*Je;if(!(Ue[Lr+2]<=re)){Ue[Lr+2]=re;for(let Nn=0;Nn<Je;Nn++)Ae.push(Ue[Lr+Nn])}}}}return Ae}_getOriginId(Ne){return Ne-this.points.length>>5}_getOriginZoom(Ne){return(Ne-this.points.length)%32}_map(Ne,re,le){if(Ne[re+Cr]>1){const ze=this.clusterProps[Ne[re+an]];return le?Object.assign({},ze):ze}const ge=this.points[Ne[re+wr]].properties,ye=this.options.map(ge);return le&&ye===ge?Object.assign({},ye):ye}}function li(Lt,Ne,re){return{type:"Feature",id:Lt[Ne+wr],properties:Uo(Lt,Ne,re),geometry:{type:"Point",coordinates:[(le=Lt[Ne],360*(le-.5)),So(Lt[Ne+1])]}};var le}function Uo(Lt,Ne,re){const le=Lt[Ne+Cr],ge=le>=1e4?`${Math.round(le/1e3)}k`:le>=1e3?Math.round(le/100)/10+"k":le,ye=Lt[Ne+an],ze=ye===-1?{}:Object.assign({},re[ye]);return Object.assign(ze,{cluster:!0,cluster_id:Lt[Ne+wr],point_count:le,point_count_abbreviated:ge})}function vi(Lt){return Lt/360+.5}function bo(Lt){const Ne=Math.sin(Lt*Math.PI/180),re=.5-.25*Math.log((1+Ne)/(1-Ne))/Math.PI;return re<0?0:re>1?1:re}function So(Lt){const Ne=(180-360*Lt)*Math.PI/180;return 360*Math.atan(Math.exp(Ne))/Math.PI-90}function Xi(Lt,Ne,re,le){for(var ge,ye=le,ze=re-Ne>>1,je=re-Ne,Ue=Lt[Ne],Ae=Lt[Ne+1],Je=Lt[re],wt=Lt[re+1],Ht=Ne+3;Ht<re;Ht+=3){var Fr=Mi(Lt[Ht],Lt[Ht+1],Ue,Ae,Je,wt);if(Fr>ye)ge=Ht,ye=Fr;else if(Fr===ye){var mr=Math.abs(Ht-ze);mr<je&&(ge=Ht,je=mr)}}ye>le&&(ge-Ne>3&&Xi(Lt,Ne,ge,le),Lt[ge+2]=ye,re-ge>3&&Xi(Lt,ge,re,le))}function Mi(Lt,Ne,re,le,ge,ye){var ze=ge-re,je=ye-le;if(ze!==0||je!==0){var Ue=((Lt-re)*ze+(Ne-le)*je)/(ze*ze+je*je);Ue>1?(re=ge,le=ye):Ue>0&&(re+=ze*Ue,le+=je*Ue)}return(ze=Lt-re)*ze+(je=Ne-le)*je}function qo(Lt,Ne,re,le){var ge={id:Lt===void 0?null:Lt,type:Ne,geometry:re,tags:le,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(ye){var ze=ye.geometry,je=ye.type;if(je==="Point"||je==="MultiPoint"||je==="LineString")ui(ye,ze);else if(je==="Polygon"||je==="MultiLineString")for(var Ue=0;Ue<ze.length;Ue++)ui(ye,ze[Ue]);else if(je==="MultiPolygon")for(Ue=0;Ue<ze.length;Ue++)for(var Ae=0;Ae<ze[Ue].length;Ae++)ui(ye,ze[Ue][Ae])}(ge),ge}function ui(Lt,Ne){for(var re=0;re<Ne.length;re+=3)Lt.minX=Math.min(Lt.minX,Ne[re]),Lt.minY=Math.min(Lt.minY,Ne[re+1]),Lt.maxX=Math.max(Lt.maxX,Ne[re]),Lt.maxY=Math.max(Lt.maxY,Ne[re+1])}function Qi(Lt,Ne,re,le){if(Ne.geometry){var ge=Ne.geometry.coordinates,ye=Ne.geometry.type,ze=Math.pow(re.tolerance/((1<<re.maxZoom)*re.extent),2),je=[],Ue=Ne.id;if(re.promoteId?Ue=Ne.properties[re.promoteId]:re.generateId&&(Ue=le||0),ye==="Point")Vi(ge,je);else if(ye==="MultiPoint")for(var Ae=0;Ae<ge.length;Ae++)Vi(ge[Ae],je);else if(ye==="LineString")Pi(ge,je,ze,!1);else if(ye==="MultiLineString"){if(re.lineMetrics){for(Ae=0;Ae<ge.length;Ae++)Pi(ge[Ae],je=[],ze,!1),Lt.push(qo(Ue,"LineString",je,Ne.properties));return}ds(ge,je,ze,!1)}else if(ye==="Polygon")ds(ge,je,ze,!0);else{if(ye!=="MultiPolygon"){if(ye==="GeometryCollection"){for(Ae=0;Ae<Ne.geometry.geometries.length;Ae++)Qi(Lt,{id:Ue,geometry:Ne.geometry.geometries[Ae],properties:Ne.properties},re,le);return}throw new Error("Input data is not a valid GeoJSON object.")}for(Ae=0;Ae<ge.length;Ae++){var Je=[];ds(ge[Ae],Je,ze,!0),je.push(Je)}}Lt.push(qo(Ue,ye,je,Ne.properties))}}function Vi(Lt,Ne){Ne.push(Ur(Lt[0])),Ne.push(ls(Lt[1])),Ne.push(0)}function Pi(Lt,Ne,re,le){for(var ge,ye,ze=0,je=0;je<Lt.length;je++){var Ue=Ur(Lt[je][0]),Ae=ls(Lt[je][1]);Ne.push(Ue),Ne.push(Ae),Ne.push(0),je>0&&(ze+=le?(ge*Ae-Ue*ye)/2:Math.sqrt(Math.pow(Ue-ge,2)+Math.pow(Ae-ye,2))),ge=Ue,ye=Ae}var Je=Ne.length-3;Ne[2]=1,Xi(Ne,0,Je,re),Ne[Je+2]=1,Ne.size=Math.abs(ze),Ne.start=0,Ne.end=Ne.size}function ds(Lt,Ne,re,le){for(var ge=0;ge<Lt.length;ge++){var ye=[];Pi(Lt[ge],ye,re,le),Ne.push(ye)}}function Ur(Lt){return Lt/360+.5}function ls(Lt){var Ne=Math.sin(Lt*Math.PI/180),re=.5-.25*Math.log((1+Ne)/(1-Ne))/Math.PI;return re<0?0:re>1?1:re}function dr(Lt,Ne,re,le,ge,ye,ze,je){if(le/=Ne,ye>=(re/=Ne)&&ze<le)return Lt;if(ze<re||ye>=le)return null;for(var Ue=[],Ae=0;Ae<Lt.length;Ae++){var Je=Lt[Ae],wt=Je.geometry,Ht=Je.type,Fr=ge===0?Je.minX:Je.minY,mr=ge===0?Je.maxX:Je.maxY;if(Fr>=re&&mr<le)Ue.push(Je);else if(!(mr<re||Fr>=le)){var Sr=[];if(Ht==="Point"||Ht==="MultiPoint")he(wt,Sr,re,le,ge);else if(Ht==="LineString")We(wt,Sr,re,le,ge,!1,je.lineMetrics);else if(Ht==="MultiLineString")Ot(wt,Sr,re,le,ge,!1);else if(Ht==="Polygon")Ot(wt,Sr,re,le,ge,!0);else if(Ht==="MultiPolygon")for(var fn=0;fn<wt.length;fn++){var xn=[];Ot(wt[fn],xn,re,le,ge,!0),xn.length&&Sr.push(xn)}if(Sr.length){if(je.lineMetrics&&Ht==="LineString"){for(fn=0;fn<Sr.length;fn++)Ue.push(qo(Je.id,Ht,Sr[fn],Je.tags));continue}Ht!=="LineString"&&Ht!=="MultiLineString"||(Sr.length===1?(Ht="LineString",Sr=Sr[0]):Ht="MultiLineString"),Ht!=="Point"&&Ht!=="MultiPoint"||(Ht=Sr.length===3?"Point":"MultiPoint"),Ue.push(qo(Je.id,Ht,Sr,Je.tags))}}}return Ue.length?Ue:null}function he(Lt,Ne,re,le,ge){for(var ye=0;ye<Lt.length;ye+=3){var ze=Lt[ye+ge];ze>=re&&ze<=le&&(Ne.push(Lt[ye]),Ne.push(Lt[ye+1]),Ne.push(Lt[ye+2]))}}function We(Lt,Ne,re,le,ge,ye,ze){for(var je,Ue,Ae=at(Lt),Je=ge===0?Wr:In,wt=Lt.start,Ht=0;Ht<Lt.length-3;Ht+=3){var Fr=Lt[Ht],mr=Lt[Ht+1],Sr=Lt[Ht+2],fn=Lt[Ht+3],xn=Lt[Ht+4],Lr=ge===0?Fr:mr,Nn=ge===0?fn:xn,bn=!1;ze&&(je=Math.sqrt(Math.pow(Fr-fn,2)+Math.pow(mr-xn,2))),Lr<re?Nn>re&&(Ue=Je(Ae,Fr,mr,fn,xn,re),ze&&(Ae.start=wt+je*Ue)):Lr>le?Nn<le&&(Ue=Je(Ae,Fr,mr,fn,xn,le),ze&&(Ae.start=wt+je*Ue)):or(Ae,Fr,mr,Sr),Nn<re&&Lr>=re&&(Ue=Je(Ae,Fr,mr,fn,xn,re),bn=!0),Nn>le&&Lr<=le&&(Ue=Je(Ae,Fr,mr,fn,xn,le),bn=!0),!ye&&bn&&(ze&&(Ae.end=wt+je*Ue),Ne.push(Ae),Ae=at(Lt)),ze&&(wt+=je)}var En=Lt.length-3;Fr=Lt[En],mr=Lt[En+1],Sr=Lt[En+2],(Lr=ge===0?Fr:mr)>=re&&Lr<=le&&or(Ae,Fr,mr,Sr),En=Ae.length-3,ye&&En>=3&&(Ae[En]!==Ae[0]||Ae[En+1]!==Ae[1])&&or(Ae,Ae[0],Ae[1],Ae[2]),Ae.length&&Ne.push(Ae)}function at(Lt){var Ne=[];return Ne.size=Lt.size,Ne.start=Lt.start,Ne.end=Lt.end,Ne}function Ot(Lt,Ne,re,le,ge,ye){for(var ze=0;ze<Lt.length;ze++)We(Lt[ze],Ne,re,le,ge,ye,!1)}function or(Lt,Ne,re,le){Lt.push(Ne),Lt.push(re),Lt.push(le)}function Wr(Lt,Ne,re,le,ge,ye){var ze=(ye-Ne)/(le-Ne);return Lt.push(ye),Lt.push(re+(ge-re)*ze),Lt.push(1),ze}function In(Lt,Ne,re,le,ge,ye){var ze=(ye-re)/(ge-re);return Lt.push(Ne+(le-Ne)*ze),Lt.push(ye),Lt.push(1),ze}function kn(Lt,Ne){for(var re=[],le=0;le<Lt.length;le++){var ge,ye=Lt[le],ze=ye.type;if(ze==="Point"||ze==="MultiPoint"||ze==="LineString")ge=eo(ye.geometry,Ne);else if(ze==="MultiLineString"||ze==="Polygon"){ge=[];for(var je=0;je<ye.geometry.length;je++)ge.push(eo(ye.geometry[je],Ne))}else if(ze==="MultiPolygon")for(ge=[],je=0;je<ye.geometry.length;je++){for(var Ue=[],Ae=0;Ae<ye.geometry[je].length;Ae++)Ue.push(eo(ye.geometry[je][Ae],Ne));ge.push(Ue)}re.push(qo(ye.id,ze,ge,ye.tags))}return re}function eo(Lt,Ne){var re=[];re.size=Lt.size,Lt.start!==void 0&&(re.start=Lt.start,re.end=Lt.end);for(var le=0;le<Lt.length;le+=3)re.push(Lt[le]+Ne,Lt[le+1],Lt[le+2]);return re}function un(Lt,Ne){if(Lt.transformed)return Lt;var re,le,ge,ye=1<<Lt.z,ze=Lt.x,je=Lt.y;for(re=0;re<Lt.features.length;re++){var Ue=Lt.features[re],Ae=Ue.geometry,Je=Ue.type;if(Ue.geometry=[],Je===1)for(le=0;le<Ae.length;le+=2)Ue.geometry.push(To(Ae[le],Ae[le+1],Ne,ye,ze,je));else for(le=0;le<Ae.length;le++){var wt=[];for(ge=0;ge<Ae[le].length;ge+=2)wt.push(To(Ae[le][ge],Ae[le][ge+1],Ne,ye,ze,je));Ue.geometry.push(wt)}}return Lt.transformed=!0,Lt}function To(Lt,Ne,re,le,ge,ye){return[Math.round(re*(Lt*le-ge)),Math.round(re*(Ne*le-ye))]}function Ti(Lt,Ne,re,le,ge){for(var ye=Ne===ge.maxZoom?0:ge.tolerance/((1<<Ne)*ge.extent),ze={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:re,y:le,z:Ne,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},je=0;je<Lt.length;je++){ze.numFeatures++,Lo(ze,Lt[je],ye,ge);var Ue=Lt[je].minX,Ae=Lt[je].minY,Je=Lt[je].maxX,wt=Lt[je].maxY;Ue<ze.minX&&(ze.minX=Ue),Ae<ze.minY&&(ze.minY=Ae),Je>ze.maxX&&(ze.maxX=Je),wt>ze.maxY&&(ze.maxY=wt)}return ze}function Lo(Lt,Ne,re,le){var ge=Ne.geometry,ye=Ne.type,ze=[];if(ye==="Point"||ye==="MultiPoint")for(var je=0;je<ge.length;je+=3)ze.push(ge[je]),ze.push(ge[je+1]),Lt.numPoints++,Lt.numSimplified++;else if(ye==="LineString")wa(ze,ge,Lt,re,!1,!1);else if(ye==="MultiLineString"||ye==="Polygon")for(je=0;je<ge.length;je++)wa(ze,ge[je],Lt,re,ye==="Polygon",je===0);else if(ye==="MultiPolygon")for(var Ue=0;Ue<ge.length;Ue++){var Ae=ge[Ue];for(je=0;je<Ae.length;je++)wa(ze,Ae[je],Lt,re,!0,je===0)}if(ze.length){var Je=Ne.tags||null;if(ye==="LineString"&&le.lineMetrics){for(var wt in Je={},Ne.tags)Je[wt]=Ne.tags[wt];Je.mapbox_clip_start=ge.start/ge.size,Je.mapbox_clip_end=ge.end/ge.size}var Ht={geometry:ze,type:ye==="Polygon"||ye==="MultiPolygon"?3:ye==="LineString"||ye==="MultiLineString"?2:1,tags:Je};Ne.id!==null&&(Ht.id=Ne.id),Lt.features.push(Ht)}}function wa(Lt,Ne,re,le,ge,ye){var ze=le*le;if(le>0&&Ne.size<(ge?ze:le))re.numPoints+=Ne.length/3;else{for(var je=[],Ue=0;Ue<Ne.length;Ue+=3)(le===0||Ne[Ue+2]>ze)&&(re.numSimplified++,je.push(Ne[Ue]),je.push(Ne[Ue+1])),re.numPoints++;ge&&function(Ae,Je){for(var wt=0,Ht=0,Fr=Ae.length,mr=Fr-2;Ht<Fr;mr=Ht,Ht+=2)wt+=(Ae[Ht]-Ae[mr])*(Ae[Ht+1]+Ae[mr+1]);if(wt>0===Je)for(Ht=0,Fr=Ae.length;Ht<Fr/2;Ht+=2){var Sr=Ae[Ht],fn=Ae[Ht+1];Ae[Ht]=Ae[Fr-2-Ht],Ae[Ht+1]=Ae[Fr-1-Ht],Ae[Fr-2-Ht]=Sr,Ae[Fr-1-Ht]=fn}}(je,ye),Lt.push(je)}}function dn(Lt,Ne){var re=(Ne=this.options=function(ge,ye){for(var ze in ye)ge[ze]=ye[ze];return ge}(Object.create(this.options),Ne)).debug;if(re&&console.time("preprocess data"),Ne.maxZoom<0||Ne.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(Ne.promoteId&&Ne.generateId)throw new Error("promoteId and generateId cannot be used together.");var le=function(ge,ye){var ze=[];if(ge.type==="FeatureCollection")for(var je=0;je<ge.features.length;je++)Qi(ze,ge.features[je],ye,je);else Qi(ze,ge.type==="Feature"?ge:{geometry:ge},ye);return ze}(Lt,Ne);this.tiles={},this.tileCoords=[],re&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",Ne.indexMaxZoom,Ne.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),le=function(ge,ye){var ze=ye.buffer/ye.extent,je=ge,Ue=dr(ge,1,-1-ze,ze,0,-1,2,ye),Ae=dr(ge,1,1-ze,2+ze,0,-1,2,ye);return(Ue||Ae)&&(je=dr(ge,1,-ze,1+ze,0,-1,2,ye)||[],Ue&&(je=kn(Ue,1).concat(je)),Ae&&(je=je.concat(kn(Ae,-1)))),je}(le,Ne),le.length&&this.splitTile(le,0,0,0),re&&(le.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)))}function co(Lt,Ne,re){return 32*((1<<Lt)*re+Ne)+Lt}function no(Lt,Ne){return Ne?Lt.properties[Ne]:Lt.id}function Za(Lt,Ne){if(Lt==null)return!0;if(Lt.type==="Feature")return no(Lt,Ne)!=null;if(Lt.type==="FeatureCollection"){const re=new Set;for(const le of Lt.features){const ge=no(le,Ne);if(ge==null||re.has(ge))return!1;re.add(ge)}return!0}return!1}function ms(Lt,Ne){const re=new Map;if(Lt!=null)if(Lt.type==="Feature")re.set(no(Lt,Ne),Lt);else for(const le of Lt.features)re.set(no(le,Ne),le);return re}dn.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},dn.prototype.splitTile=function(Lt,Ne,re,le,ge,ye,ze){for(var je=[Lt,Ne,re,le],Ue=this.options,Ae=Ue.debug;je.length;){le=je.pop(),re=je.pop(),Ne=je.pop(),Lt=je.pop();var Je=1<<Ne,wt=co(Ne,re,le),Ht=this.tiles[wt];if(!Ht&&(Ae>1&&console.time("creation"),Ht=this.tiles[wt]=Ti(Lt,Ne,re,le,Ue),this.tileCoords.push({z:Ne,x:re,y:le}),Ae)){Ae>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Ne,re,le,Ht.numFeatures,Ht.numPoints,Ht.numSimplified),console.timeEnd("creation"));var Fr="z"+Ne;this.stats[Fr]=(this.stats[Fr]||0)+1,this.total++}if(Ht.source=Lt,ge){if(Ne===Ue.maxZoom||Ne===ge)continue;var mr=1<<ge-Ne;if(re!==Math.floor(ye/mr)||le!==Math.floor(ze/mr))continue}else if(Ne===Ue.indexMaxZoom||Ht.numPoints<=Ue.indexMaxPoints)continue;if(Ht.source=null,Lt.length!==0){Ae>1&&console.time("clipping");var Sr,fn,xn,Lr,Nn,bn,En=.5*Ue.buffer/Ue.extent,io=.5-En,On=.5+En,Ao=1+En;Sr=fn=xn=Lr=null,Nn=dr(Lt,Je,re-En,re+On,0,Ht.minX,Ht.maxX,Ue),bn=dr(Lt,Je,re+io,re+Ao,0,Ht.minX,Ht.maxX,Ue),Lt=null,Nn&&(Sr=dr(Nn,Je,le-En,le+On,1,Ht.minY,Ht.maxY,Ue),fn=dr(Nn,Je,le+io,le+Ao,1,Ht.minY,Ht.maxY,Ue),Nn=null),bn&&(xn=dr(bn,Je,le-En,le+On,1,Ht.minY,Ht.maxY,Ue),Lr=dr(bn,Je,le+io,le+Ao,1,Ht.minY,Ht.maxY,Ue),bn=null),Ae>1&&console.timeEnd("clipping"),je.push(Sr||[],Ne+1,2*re,2*le),je.push(fn||[],Ne+1,2*re,2*le+1),je.push(xn||[],Ne+1,2*re+1,2*le),je.push(Lr||[],Ne+1,2*re+1,2*le+1)}}},dn.prototype.getTile=function(Lt,Ne,re){var le=this.options,ge=le.extent,ye=le.debug;if(Lt<0||Lt>24)return null;var ze=1<<Lt,je=co(Lt,Ne=(Ne%ze+ze)%ze,re);if(this.tiles[je])return un(this.tiles[je],ge);ye>1&&console.log("drilling down to z%d-%d-%d",Lt,Ne,re);for(var Ue,Ae=Lt,Je=Ne,wt=re;!Ue&&Ae>0;)Ae--,Je=Math.floor(Je/2),wt=Math.floor(wt/2),Ue=this.tiles[co(Ae,Je,wt)];return Ue&&Ue.source?(ye>1&&console.log("found parent tile z%d-%d-%d",Ae,Je,wt),ye>1&&console.time("drilling down"),this.splitTile(Ue.source,Ae,Je,wt,Lt,Ne,re),ye>1&&console.timeEnd("drilling down"),this.tiles[je]?un(this.tiles[je],ge):null):null};class Ji extends He{constructor(Ne,re,le,ge){super(Ne,re,le),this._dataUpdateable=new Map,this.loadGeoJSON=(ye,ze)=>{const{promoteId:je}=ye;if(ye.request)return R.f(ye.request,(Ue,Ae,Je,wt)=>{this._dataUpdateable=Za(Ae,je)?ms(Ae,je):void 0,ze(Ue,Ae,Je,wt)});if(typeof ye.data=="string")try{const Ue=JSON.parse(ye.data);this._dataUpdateable=Za(Ue,je)?ms(Ue,je):void 0,ze(null,Ue)}catch(Ue){ze(new Error(`Input data given to '${ye.source}' is not a valid GeoJSON object.`))}else ye.dataDiff?this._dataUpdateable?(function(Ue,Ae,Je){var wt,Ht,Fr,mr;if(Ae.removeAll&&Ue.clear(),Ae.remove)for(const Sr of Ae.remove)Ue.delete(Sr);if(Ae.add)for(const Sr of Ae.add){const fn=no(Sr,Je);fn!=null&&Ue.set(fn,Sr)}if(Ae.update)for(const Sr of Ae.update){let fn=Ue.get(Sr.id);if(fn==null)continue;const xn=!Sr.removeAllProperties&&(((wt=Sr.removeProperties)===null||wt===void 0?void 0:wt.length)>0||((Ht=Sr.addOrUpdateProperties)===null||Ht===void 0?void 0:Ht.length)>0);if((Sr.newGeometry||Sr.removeAllProperties||xn)&&(fn=Object.assign({},fn),Ue.set(Sr.id,fn),xn&&(fn.properties=Object.assign({},fn.properties))),Sr.newGeometry&&(fn.geometry=Sr.newGeometry),Sr.removeAllProperties)fn.properties={};else if(((Fr=Sr.removeProperties)===null||Fr===void 0?void 0:Fr.length)>0)for(const Lr of Sr.removeProperties)Object.prototype.hasOwnProperty.call(fn.properties,Lr)&&delete fn.properties[Lr];if(((mr=Sr.addOrUpdateProperties)===null||mr===void 0?void 0:mr.length)>0)for(const{key:Lr,value:Nn}of Sr.addOrUpdateProperties)fn.properties[Lr]=Nn}}(this._dataUpdateable,ye.dataDiff,je),ze(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):ze(new Error(`Cannot update existing geojson data in ${ye.source}`)):ze(new Error(`Input data given to '${ye.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},this.loadVectorData=this.loadGeoJSONTile,ge&&(this.loadGeoJSON=ge)}loadGeoJSONTile(Ne,re){const le=Ne.tileID.canonical;if(!this._geoJSONIndex)return re(null,null);const ge=this._geoJSONIndex.getTile(le.z,le.x,le.y);if(!ge)return re(null,null);const ye=new class{constructor(je){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=R.N,this.length=je.length,this._features=je}feature(je){return new class{constructor(Ue){this._feature=Ue,this.extent=R.N,this.type=Ue.type,this.properties=Ue.tags,"id"in Ue&&!isNaN(Ue.id)&&(this.id=parseInt(Ue.id,10))}loadGeometry(){if(this._feature.type===1){const Ue=[];for(const Ae of this._feature.geometry)Ue.push([new R.P(Ae[0],Ae[1])]);return Ue}{const Ue=[];for(const Ae of this._feature.geometry){const Je=[];for(const wt of Ae)Je.push(new R.P(wt[0],wt[1]));Ue.push(Je)}return Ue}}toGeoJSON(Ue,Ae,Je){return er.call(this,Ue,Ae,Je)}}(this._features[je])}}(ge.features);let ze=Pt(ye);ze.byteOffset===0&&ze.byteLength===ze.buffer.byteLength||(ze=new Uint8Array(ze)),re(null,{vectorTile:ye,rawData:ze.buffer})}loadData(Ne,re){var le;(le=this._pendingRequest)===null||le===void 0||le.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const ge=!!(Ne&&Ne.request&&Ne.request.collectResourceTiming)&&new R.bu(Ne.request);this._pendingCallback=re,this._pendingRequest=this.loadGeoJSON(Ne,(ye,ze)=>{if(delete this._pendingCallback,delete this._pendingRequest,ye||!ze)return re(ye);if(typeof ze!="object")return re(new Error(`Input data given to '${Ne.source}' is not a valid GeoJSON object.`));{et(ze,!0);try{if(Ne.filter){const Ue=R.bC(Ne.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ue.result==="error")throw new Error(Ue.value.map(Je=>`${Je.key}: ${Je.message}`).join(", "));ze={type:"FeatureCollection",features:ze.features.filter(Je=>Ue.value.evaluate({zoom:0},Je))}}this._geoJSONIndex=Ne.cluster?new yi(function({superclusterOptions:Ue,clusterProperties:Ae}){if(!Ae||!Ue)return Ue;const Je={},wt={},Ht={accumulated:null,zoom:0},Fr={properties:null},mr=Object.keys(Ae);for(const Sr of mr){const[fn,xn]=Ae[Sr],Lr=R.bC(xn),Nn=R.bC(typeof fn=="string"?[fn,["accumulated"],["get",Sr]]:fn);Je[Sr]=Lr.value,wt[Sr]=Nn.value}return Ue.map=Sr=>{Fr.properties=Sr;const fn={};for(const xn of mr)fn[xn]=Je[xn].evaluate(Ht,Fr);return fn},Ue.reduce=(Sr,fn)=>{Fr.properties=fn;for(const xn of mr)Ht.accumulated=Sr[xn],Sr[xn]=wt[xn].evaluate(Ht,Fr)},Ue}(Ne)).load(ze.features):function(Ue,Ae){return new dn(Ue,Ae)}(ze,Ne.geojsonVtOptions)}catch(Ue){return re(Ue)}this.loaded={};const je={};if(ge){const Ue=ge.finish();Ue&&(je.resourceTiming={},je.resourceTiming[Ne.source]=JSON.parse(JSON.stringify(Ue)))}re(null,je)}})}reloadTile(Ne,re){const le=this.loaded;return le&&le[Ne.uid]?super.reloadTile(Ne,re):this.loadTile(Ne,re)}removeSource(Ne,re){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),re()}getClusterExpansionZoom(Ne,re){try{re(null,this._geoJSONIndex.getClusterExpansionZoom(Ne.clusterId))}catch(le){re(le)}}getClusterChildren(Ne,re){try{re(null,this._geoJSONIndex.getChildren(Ne.clusterId))}catch(le){re(le)}}getClusterLeaves(Ne,re){try{re(null,this._geoJSONIndex.getLeaves(Ne.clusterId,Ne.limit,Ne.offset))}catch(le){re(le)}}}class Us{constructor(Ne){this.self=Ne,this.actor=new R.C(Ne,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:He,geojson:Ji},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(re,le)=>{if(this.workerSourceTypes[re])throw new Error(`Worker source with name "${re}" already registered.`);this.workerSourceTypes[re]=le},this.self.registerRTLTextPlugin=re=>{if(R.bD.isParsed())throw new Error("RTL text plugin already registered.");R.bD.applyArabicShaping=re.applyArabicShaping,R.bD.processBidirectionalText=re.processBidirectionalText,R.bD.processStyledBidirectionalText=re.processStyledBidirectionalText}}setReferrer(Ne,re){this.referrer=re}setImages(Ne,re,le){this.availableImages[Ne]=re;for(const ge in this.workerSources[Ne]){const ye=this.workerSources[Ne][ge];for(const ze in ye)ye[ze].availableImages=re}le()}setLayers(Ne,re,le){this.getLayerIndex(Ne).replace(re),le()}updateLayers(Ne,re,le){this.getLayerIndex(Ne).update(re.layers,re.removedIds),le()}loadTile(Ne,re,le){this.getWorkerSource(Ne,re.type,re.source).loadTile(re,le)}loadDEMTile(Ne,re,le){this.getDEMWorkerSource(Ne,re.source).loadTile(re,le)}reloadTile(Ne,re,le){this.getWorkerSource(Ne,re.type,re.source).reloadTile(re,le)}abortTile(Ne,re,le){this.getWorkerSource(Ne,re.type,re.source).abortTile(re,le)}removeTile(Ne,re,le){this.getWorkerSource(Ne,re.type,re.source).removeTile(re,le)}removeDEMTile(Ne,re){this.getDEMWorkerSource(Ne,re.source).removeTile(re)}removeSource(Ne,re,le){if(!this.workerSources[Ne]||!this.workerSources[Ne][re.type]||!this.workerSources[Ne][re.type][re.source])return;const ge=this.workerSources[Ne][re.type][re.source];delete this.workerSources[Ne][re.type][re.source],ge.removeSource!==void 0?ge.removeSource(re,le):le()}loadWorkerSource(Ne,re,le){try{this.self.importScripts(re.url),le()}catch(ge){le(ge.toString())}}syncRTLPluginState(Ne,re,le){try{R.bD.setState(re);const ge=R.bD.getPluginURL();if(R.bD.isLoaded()&&!R.bD.isParsed()&&ge!=null){this.self.importScripts(ge);const ye=R.bD.isParsed();le(ye?void 0:new Error(`RTL Text Plugin failed to import scripts from ${ge}`),ye)}}catch(ge){le(ge.toString())}}getAvailableImages(Ne){let re=this.availableImages[Ne];return re||(re=[]),re}getLayerIndex(Ne){let re=this.layerIndexes[Ne];return re||(re=this.layerIndexes[Ne]=new de),re}getWorkerSource(Ne,re,le){return this.workerSources[Ne]||(this.workerSources[Ne]={}),this.workerSources[Ne][re]||(this.workerSources[Ne][re]={}),this.workerSources[Ne][re][le]||(this.workerSources[Ne][re][le]=new this.workerSourceTypes[re]({send:(ge,ye,ze)=>{this.actor.send(ge,ye,ze,Ne)}},this.getLayerIndex(Ne),this.getAvailableImages(Ne))),this.workerSources[Ne][re][le]}getDEMWorkerSource(Ne,re){return this.demWorkerSources[Ne]||(this.demWorkerSources[Ne]={}),this.demWorkerSources[Ne][re]||(this.demWorkerSources[Ne][re]=new Xe),this.demWorkerSources[Ne][re]}}return R.i()&&(self.worker=new Us(self)),Us}),Ze(["./shared"],function(R){"use strict";var de="3.6.2";class be{static testProp(s){if(!be.docStyle)return s[0];for(let x=0;x<s.length;x++)if(s[x]in be.docStyle)return s[x];return s[0]}static create(s,x,I){const k=window.document.createElement(s);return x!==void 0&&(k.className=x),I&&I.appendChild(k),k}static createNS(s,x){return window.document.createElementNS(s,x)}static disableDrag(){be.docStyle&&be.selectProp&&(be.userSelect=be.docStyle[be.selectProp],be.docStyle[be.selectProp]="none")}static enableDrag(){be.docStyle&&be.selectProp&&(be.docStyle[be.selectProp]=be.userSelect)}static setTransform(s,x){s.style[be.transformProp]=x}static addEventListener(s,x,I,k={}){s.addEventListener(x,I,"passive"in k?k:k.capture)}static removeEventListener(s,x,I,k={}){s.removeEventListener(x,I,"passive"in k?k:k.capture)}static suppressClickInternal(s){s.preventDefault(),s.stopPropagation(),window.removeEventListener("click",be.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",be.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",be.suppressClickInternal,!0)},0)}static mousePos(s,x){const I=s.getBoundingClientRect();return new R.P(x.clientX-I.left-s.clientLeft,x.clientY-I.top-s.clientTop)}static touchPos(s,x){const I=s.getBoundingClientRect(),k=[];for(let H=0;H<x.length;H++)k.push(new R.P(x[H].clientX-I.left-s.clientLeft,x[H].clientY-I.top-s.clientTop));return k}static mouseButton(s){return s.button}static remove(s){s.parentNode&&s.parentNode.removeChild(s)}}be.docStyle=typeof window!="undefined"&&window.document&&window.document.documentElement.style,be.selectProp=be.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),be.transformProp=be.testProp(["transform","WebkitTransform"]);const Le={supported:!1,testSupport:function(z){!He&&Ce&&(Xe?Ke(z):Re=z)}};let Re,Ce,He=!1,Xe=!1;function Ke(z){const s=z.createTexture();z.bindTexture(z.TEXTURE_2D,s);try{if(z.texImage2D(z.TEXTURE_2D,0,z.RGBA,z.RGBA,z.UNSIGNED_BYTE,Ce),z.isContextLost())return;Le.supported=!0}catch(x){}z.deleteTexture(s),He=!0}var Ve,et;typeof document!="undefined"&&(Ce=document.createElement("img"),Ce.onload=function(){Re&&Ke(Re),Re=null,Xe=!0},Ce.onerror=function(){He=!0,Re=null},Ce.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(z){let s,x,I,k;z.resetRequestQueue=()=>{s=[],x=0,I=0,k={}},z.addThrottleControl=_e=>{const h=I++;return k[h]=_e,h},z.removeThrottleControl=_e=>{delete k[_e],ne()},z.getImage=(_e,h,g=!0)=>{Le.supported&&(_e.headers||(_e.headers={}),_e.headers.accept="image/webp,*/*");const d={requestParameters:_e,supportImageRefresh:g,callback:h,cancelled:!1,completed:!1,cancel:()=>{d.completed||d.cancelled||(d.cancelled=!0,d.innerRequest&&(d.innerRequest.cancel(),x--),ne())}};return s.push(d),ne(),d};const H=_e=>{const{requestParameters:h,supportImageRefresh:g,callback:d}=_e;return R.e(h,{type:"image"}),(g!==!1||R.i()||R.g(h.url)||h.headers&&!Object.keys(h.headers).reduce((b,B)=>b&&B==="accept",!0)?R.m:ue)(h,(b,B,G,q)=>{ee(_e,d,b,B,G,q)})},ee=(_e,h,g,d,b,B)=>{g?h(g):d instanceof HTMLImageElement||R.a(d)?h(null,d):d&&((G,q)=>{typeof createImageBitmap=="function"?R.b(G,q):R.d(G,q)})(d,(G,q)=>{G!=null?h(G):q!=null&&h(null,q,{cacheControl:b,expires:B})}),_e.cancelled||(_e.completed=!0,x--,ne())},ne=()=>{const _e=(()=>{const h=Object.keys(k);let g=!1;if(h.length>0){for(const d of h)if(g=k[d](),g)break}return g})()?R.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:R.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let h=x;h<_e&&s.length>0;h++){const g=s.shift();if(g.cancelled){h--;continue}const d=H(g);x++,g.innerRequest=d}},ue=(_e,h)=>{const g=new Image,d=_e.url;let b=!1;const B=_e.credentials;return B&&B==="include"?g.crossOrigin="use-credentials":(B&&B==="same-origin"||!R.s(d))&&(g.crossOrigin="anonymous"),g.fetchPriority="high",g.onload=()=>{h(null,g),g.onerror=g.onload=null},g.onerror=()=>{b||h(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")),g.onerror=g.onload=null},g.src=d,{cancel:()=>{b=!0,g.src=""}}}}(Ve||(Ve={})),Ve.resetRequestQueue(),function(z){z.Glyphs="Glyphs",z.Image="Image",z.Source="Source",z.SpriteImage="SpriteImage",z.SpriteJSON="SpriteJSON",z.Style="Style",z.Tile="Tile",z.Unknown="Unknown"}(et||(et={}));class er{constructor(s){this._transformRequestFn=s}transformRequest(s,x){return this._transformRequestFn&&this._transformRequestFn(s,x)||{url:s}}normalizeSpriteURL(s,x,I){const k=function(H){const ee=H.match(fr);if(!ee)throw new Error(`Unable to parse URL "${H}"`);return{protocol:ee[1],authority:ee[2],path:ee[3]||"/",params:ee[4]?ee[4].split("&"):[]}}(s);return k.path+=`${x}${I}`,function(H){const ee=H.params.length?`?${H.params.join("&")}`:"";return`${H.protocol}://${H.authority}${H.path}${ee}`}(k)}setTransformRequest(s){this._transformRequestFn=s}}const fr=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Ar(z){var s=new R.A(3);return s[0]=z[0],s[1]=z[1],s[2]=z[2],s}var pn,Kn=function(z,s,x){return z[0]=s[0]-x[0],z[1]=s[1]-x[1],z[2]=s[2]-x[2],z};pn=new R.A(3),R.A!=Float32Array&&(pn[0]=0,pn[1]=0,pn[2]=0);var Jn=function(z){var s=z[0],x=z[1];return s*s+x*x};function ki(z){const s=[];if(typeof z=="string")s.push({id:"default",url:z});else if(z&&z.length>0){const x=[];for(const{id:I,url:k}of z){const H=`${I}${k}`;x.indexOf(H)===-1&&(x.push(H),s.push({id:I,url:k}))}}return s}function pa(z,s,x,I,k){if(I)return void z(I);if(k!==Object.values(s).length||k!==Object.values(x).length)return;const H={};for(const ee in s){H[ee]={};const ne=R.h.getImageCanvasContext(x[ee]),ue=s[ee];for(const _e in ue){const{width:h,height:g,x:d,y:b,sdf:B,pixelRatio:G,stretchX:q,stretchY:te,content:fe}=ue[_e];H[ee][_e]={data:null,pixelRatio:G,sdf:B,stretchX:q,stretchY:te,content:fe,spriteData:{width:h,height:g,x:d,y:b,context:ne}}}}z(null,H)}(function(){var z=new R.A(2);R.A!=Float32Array&&(z[0]=0,z[1]=0)})();class xr{constructor(s,x,I,k){this.context=s,this.format=I,this.texture=s.gl.createTexture(),this.update(x,k)}update(s,x,I){const{width:k,height:H}=s,ee=!(this.size&&this.size[0]===k&&this.size[1]===H||I),{context:ne}=this,{gl:ue}=ne;if(this.useMipmap=!!(x&&x.useMipmap),ue.bindTexture(ue.TEXTURE_2D,this.texture),ne.pixelStoreUnpackFlipY.set(!1),ne.pixelStoreUnpack.set(1),ne.pixelStoreUnpackPremultiplyAlpha.set(this.format===ue.RGBA&&(!x||x.premultiply!==!1)),ee)this.size=[k,H],s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement||s instanceof ImageData||R.a(s)?ue.texImage2D(ue.TEXTURE_2D,0,this.format,this.format,ue.UNSIGNED_BYTE,s):ue.texImage2D(ue.TEXTURE_2D,0,this.format,k,H,0,this.format,ue.UNSIGNED_BYTE,s.data);else{const{x:_e,y:h}=I||{x:0,y:0};s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement||s instanceof ImageData||R.a(s)?ue.texSubImage2D(ue.TEXTURE_2D,0,_e,h,ue.RGBA,ue.UNSIGNED_BYTE,s):ue.texSubImage2D(ue.TEXTURE_2D,0,_e,h,k,H,ue.RGBA,ue.UNSIGNED_BYTE,s.data)}this.useMipmap&&this.isSizePowerOfTwo()&&ue.generateMipmap(ue.TEXTURE_2D)}bind(s,x,I){const{context:k}=this,{gl:H}=k;H.bindTexture(H.TEXTURE_2D,this.texture),I!==H.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(I=H.LINEAR),s!==this.filter&&(H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MAG_FILTER,s),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MIN_FILTER,I||s),this.filter=s),x!==this.wrap&&(H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_S,x),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_T,x),this.wrap=x)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:s}=this.context;s.deleteTexture(this.texture),this.texture=null}}function jt(z){const{userImage:s}=z;return!!(s&&s.render&&s.render())&&(z.data.replace(new Uint8Array(s.data.buffer)),!0)}class Jr extends R.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new R.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(s){if(this.loaded!==s&&(this.loaded=s,s)){for(const{ids:x,callback:I}of this.requestors)this._notify(x,I);this.requestors=[]}}getImage(s){const x=this.images[s];if(x&&!x.data&&x.spriteData){const I=x.spriteData;x.data=new R.R({width:I.width,height:I.height},I.context.getImageData(I.x,I.y,I.width,I.height).data),x.spriteData=null}return x}addImage(s,x){if(this.images[s])throw new Error(`Image id ${s} already exist, use updateImage instead`);this._validate(s,x)&&(this.images[s]=x)}_validate(s,x){let I=!0;const k=x.data||x.spriteData;return this._validateStretch(x.stretchX,k&&k.width)||(this.fire(new R.j(new Error(`Image "${s}" has invalid "stretchX" value`))),I=!1),this._validateStretch(x.stretchY,k&&k.height)||(this.fire(new R.j(new Error(`Image "${s}" has invalid "stretchY" value`))),I=!1),this._validateContent(x.content,x)||(this.fire(new R.j(new Error(`Image "${s}" has invalid "content" value`))),I=!1),I}_validateStretch(s,x){if(!s)return!0;let I=0;for(const k of s){if(k[0]<I||k[1]<k[0]||x<k[1])return!1;I=k[1]}return!0}_validateContent(s,x){if(!s)return!0;if(s.length!==4)return!1;const I=x.spriteData,k=I&&I.width||x.data.width,H=I&&I.height||x.data.height;return!(s[0]<0||k<s[0]||s[1]<0||H<s[1]||s[2]<0||k<s[2]||s[3]<0||H<s[3]||s[2]<s[0]||s[3]<s[1])}updateImage(s,x,I=!0){const k=this.getImage(s);if(I&&(k.data.width!==x.data.width||k.data.height!==x.data.height))throw new Error(`size mismatch between old image (${k.data.width}x${k.data.height}) and new image (${x.data.width}x${x.data.height}).`);x.version=k.version+1,this.images[s]=x,this.updatedImages[s]=!0}removeImage(s){const x=this.images[s];delete this.images[s],delete this.patterns[s],x.userImage&&x.userImage.onRemove&&x.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(s,x){let I=!0;if(!this.isLoaded())for(const k of s)this.images[k]||(I=!1);this.isLoaded()||I?this._notify(s,x):this.requestors.push({ids:s,callback:x})}_notify(s,x){const I={};for(const k of s){let H=this.getImage(k);H||(this.fire(new R.k("styleimagemissing",{id:k})),H=this.getImage(k)),H?I[k]={data:H.data.clone(),pixelRatio:H.pixelRatio,sdf:H.sdf,version:H.version,stretchX:H.stretchX,stretchY:H.stretchY,content:H.content,hasRenderCallback:!!(H.userImage&&H.userImage.render)}:R.w(`Image "${k}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}x(null,I)}getPixelSize(){const{width:s,height:x}=this.atlasImage;return{width:s,height:x}}getPattern(s){const x=this.patterns[s],I=this.getImage(s);if(!I)return null;if(x&&x.position.version===I.version)return x.position;if(x)x.position.version=I.version;else{const k={w:I.data.width+2,h:I.data.height+2,x:0,y:0},H=new R.I(k,I);this.patterns[s]={bin:k,position:H}}return this._updatePatternAtlas(),this.patterns[s].position}bind(s){const x=s.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new xr(s,this.atlasImage,x.RGBA),this.atlasTexture.bind(x.LINEAR,x.CLAMP_TO_EDGE)}_updatePatternAtlas(){const s=[];for(const H in this.patterns)s.push(this.patterns[H].bin);const{w:x,h:I}=R.p(s),k=this.atlasImage;k.resize({width:x||1,height:I||1});for(const H in this.patterns){const{bin:ee}=this.patterns[H],ne=ee.x+1,ue=ee.y+1,_e=this.getImage(H).data,h=_e.width,g=_e.height;R.R.copy(_e,k,{x:0,y:0},{x:ne,y:ue},{width:h,height:g}),R.R.copy(_e,k,{x:0,y:g-1},{x:ne,y:ue-1},{width:h,height:1}),R.R.copy(_e,k,{x:0,y:0},{x:ne,y:ue+g},{width:h,height:1}),R.R.copy(_e,k,{x:h-1,y:0},{x:ne-1,y:ue},{width:1,height:g}),R.R.copy(_e,k,{x:0,y:0},{x:ne+h,y:ue},{width:1,height:g})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(s){for(const x of s){if(this.callbackDispatchedThisFrame[x])continue;this.callbackDispatchedThisFrame[x]=!0;const I=this.getImage(x);I||R.w(`Image with ID: "${x}" was not found`),jt(I)&&this.updateImage(x,I)}}}const gr=1e20;function rn(z,s,x,I,k,H,ee,ne,ue){for(let _e=s;_e<s+I;_e++)jn(z,x*H+_e,H,k,ee,ne,ue);for(let _e=x;_e<x+k;_e++)jn(z,_e*H+s,1,I,ee,ne,ue)}function jn(z,s,x,I,k,H,ee){H[0]=0,ee[0]=-gr,ee[1]=gr,k[0]=z[s];for(let ne=1,ue=0,_e=0;ne<I;ne++){k[ne]=z[s+ne*x];const h=ne*ne;do{const g=H[ue];_e=(k[ne]-k[g]+h-g*g)/(ne-g)/2}while(_e<=ee[ue]&&--ue>-1);ue++,H[ue]=ne,ee[ue]=_e,ee[ue+1]=gr}for(let ne=0,ue=0;ne<I;ne++){for(;ee[ue+1]<ne;)ue++;const _e=H[ue],h=ne-_e;z[s+ne*x]=k[_e]+h*h}}class qe{constructor(s,x){this.requestManager=s,this.localIdeographFontFamily=x,this.entries={}}setURL(s){this.url=s}getGlyphs(s,x){const I=[];for(const k in s)for(const H of s[k])I.push({stack:k,id:H});R.o(I,({stack:k,id:H},ee)=>{let ne=this.entries[k];ne||(ne=this.entries[k]={glyphs:{},requests:{},ranges:{}});let ue=ne.glyphs[H];if(ue!==void 0)return void ee(null,{stack:k,id:H,glyph:ue});if(ue=this._tinySDF(ne,k,H),ue)return ne.glyphs[H]=ue,void ee(null,{stack:k,id:H,glyph:ue});const _e=Math.floor(H/256);if(256*_e>65535)return void ee(new Error("glyphs > 65535 not supported"));if(ne.ranges[_e])return void ee(null,{stack:k,id:H,glyph:ue});if(!this.url)return void ee(new Error("glyphsUrl is not set"));let h=ne.requests[_e];h||(h=ne.requests[_e]=[],qe.loadGlyphRange(k,_e,this.url,this.requestManager,(g,d)=>{if(d){for(const b in d)this._doesCharSupportLocalGlyph(+b)||(ne.glyphs[+b]=d[+b]);ne.ranges[_e]=!0}for(const b of h)b(g,d);delete ne.requests[_e]})),h.push((g,d)=>{g?ee(g):d&&ee(null,{stack:k,id:H,glyph:d[H]||null})})},(k,H)=>{if(k)x(k);else if(H){const ee={};for(const{stack:ne,id:ue,glyph:_e}of H)(ee[ne]||(ee[ne]={}))[ue]=_e&&{id:_e.id,bitmap:_e.bitmap.clone(),metrics:_e.metrics};x(null,ee)}})}_doesCharSupportLocalGlyph(s){return!!this.localIdeographFontFamily&&(R.u["CJK Unified Ideographs"](s)||R.u["Hangul Syllables"](s)||R.u.Hiragana(s)||R.u.Katakana(s))}_tinySDF(s,x,I){const k=this.localIdeographFontFamily;if(!k||!this._doesCharSupportLocalGlyph(I))return;let H=s.tinySDF;if(!H){let ne="400";/bold/i.test(x)?ne="900":/medium/i.test(x)?ne="500":/light/i.test(x)&&(ne="200"),H=s.tinySDF=new qe.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:k,fontWeight:ne})}const ee=H.draw(String.fromCharCode(I));return{id:I,bitmap:new R.q({width:ee.width||60,height:ee.height||60},ee.data),metrics:{width:ee.glyphWidth/2||24,height:ee.glyphHeight/2||24,left:ee.glyphLeft/2+.5||0,top:ee.glyphTop/2-27.5||-8,advance:ee.glyphAdvance/2||24,isDoubleResolution:!0}}}}qe.loadGlyphRange=function(z,s,x,I,k){const H=256*s,ee=H+255,ne=I.transformRequest(x.replace("{fontstack}",z).replace("{range}",`${H}-${ee}`),et.Glyphs);R.l(ne,(ue,_e)=>{if(ue)k(ue);else if(_e){const h={};for(const g of R.n(_e))h[g.id]=g;k(null,h)}})},qe.TinySDF=class{constructor({fontSize:z=24,buffer:s=3,radius:x=8,cutoff:I=.25,fontFamily:k="sans-serif",fontWeight:H="normal",fontStyle:ee="normal"}={}){this.buffer=s,this.cutoff=I,this.radius=x;const ne=this.size=z+4*s,ue=this._createCanvas(ne),_e=this.ctx=ue.getContext("2d",{willReadFrequently:!0});_e.font=`${ee} ${H} ${z}px ${k}`,_e.textBaseline="alphabetic",_e.textAlign="left",_e.fillStyle="black",this.gridOuter=new Float64Array(ne*ne),this.gridInner=new Float64Array(ne*ne),this.f=new Float64Array(ne),this.z=new Float64Array(ne+1),this.v=new Uint16Array(ne)}_createCanvas(z){const s=document.createElement("canvas");return s.width=s.height=z,s}draw(z){const{width:s,actualBoundingBoxAscent:x,actualBoundingBoxDescent:I,actualBoundingBoxLeft:k,actualBoundingBoxRight:H}=this.ctx.measureText(z),ee=Math.ceil(x),ne=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(H-k))),ue=Math.min(this.size-this.buffer,ee+Math.ceil(I)),_e=ne+2*this.buffer,h=ue+2*this.buffer,g=Math.max(_e*h,0),d=new Uint8ClampedArray(g),b={data:d,width:_e,height:h,glyphWidth:ne,glyphHeight:ue,glyphTop:ee,glyphLeft:0,glyphAdvance:s};if(ne===0||ue===0)return b;const{ctx:B,buffer:G,gridInner:q,gridOuter:te}=this;B.clearRect(G,G,ne,ue),B.fillText(z,G,G+ee);const fe=B.getImageData(G,G,ne,ue);te.fill(gr,0,g),q.fill(0,0,g);for(let ce=0;ce<ue;ce++)for(let Te=0;Te<ne;Te++){const Ie=fe.data[4*(ce*ne+Te)+3]/255;if(Ie===0)continue;const Oe=(ce+G)*_e+Te+G;if(Ie===1)te[Oe]=0,q[Oe]=gr;else{const Qe=.5-Ie;te[Oe]=Qe>0?Qe*Qe:0,q[Oe]=Qe<0?Qe*Qe:0}}rn(te,0,0,_e,h,_e,this.f,this.v,this.z),rn(q,G,G,ne,ue,_e,this.f,this.v,this.z);for(let ce=0;ce<g;ce++){const Te=Math.sqrt(te[ce])-Math.sqrt(q[ce]);d[ce]=Math.round(255-255*(Te/this.radius+this.cutoff))}return b}};class Dt{constructor(){this.specification=R.v.light.position}possiblyEvaluate(s,x){return R.z(s.expression.evaluate(x))}interpolate(s,x,I){return{x:R.B.number(s.x,x.x,I),y:R.B.number(s.y,x.y,I),z:R.B.number(s.z,x.z,I)}}}let $e;class Pt extends R.E{constructor(s){super(),$e=$e||new R.r({anchor:new R.D(R.v.light.anchor),position:new Dt,color:new R.D(R.v.light.color),intensity:new R.D(R.v.light.intensity)}),this._transitionable=new R.T($e),this.setLight(s),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(s,x={}){if(!this._validate(R.t,s,x))for(const I in s){const k=s[I];I.endsWith("-transition")?this._transitionable.setTransition(I.slice(0,-11),k):this._transitionable.setValue(I,k)}}updateTransitions(s){this._transitioning=this._transitionable.transitioned(s,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(s){this.properties=this._transitioning.possiblyEvaluate(s)}_validate(s,x,I){return(!I||I.validate!==!1)&&R.x(this,s.call(R.y,R.e({value:x,style:{glyphs:!0,sprite:!0},styleSpec:R.v})))}}class vt{constructor(s,x){this.width=s,this.height=x,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(s,x){const I=s.join(",")+String(x);return this.dashEntry[I]||(this.dashEntry[I]=this.addDash(s,x)),this.dashEntry[I]}getDashRanges(s,x,I){const k=[];let H=s.length%2==1?-s[s.length-1]*I:0,ee=s[0]*I,ne=!0;k.push({left:H,right:ee,isDash:ne,zeroLength:s[0]===0});let ue=s[0];for(let _e=1;_e<s.length;_e++){ne=!ne;const h=s[_e];H=ue*I,ue+=h,ee=ue*I,k.push({left:H,right:ee,isDash:ne,zeroLength:h===0})}return k}addRoundDash(s,x,I){const k=x/2;for(let H=-I;H<=I;H++){const ee=this.width*(this.nextRow+I+H);let ne=0,ue=s[ne];for(let _e=0;_e<this.width;_e++){_e/ue.right>1&&(ue=s[++ne]);const h=Math.abs(_e-ue.left),g=Math.abs(_e-ue.right),d=Math.min(h,g);let b;const B=H/I*(k+1);if(ue.isDash){const G=k-Math.abs(B);b=Math.sqrt(d*d+G*G)}else b=k-Math.sqrt(d*d+B*B);this.data[ee+_e]=Math.max(0,Math.min(255,b+128))}}}addRegularDash(s){for(let ne=s.length-1;ne>=0;--ne){const ue=s[ne],_e=s[ne+1];ue.zeroLength?s.splice(ne,1):_e&&_e.isDash===ue.isDash&&(_e.left=ue.left,s.splice(ne,1))}const x=s[0],I=s[s.length-1];x.isDash===I.isDash&&(x.left=I.left-this.width,I.right=x.right+this.width);const k=this.width*this.nextRow;let H=0,ee=s[H];for(let ne=0;ne<this.width;ne++){ne/ee.right>1&&(ee=s[++H]);const ue=Math.abs(ne-ee.left),_e=Math.abs(ne-ee.right),h=Math.min(ue,_e);this.data[k+ne]=Math.max(0,Math.min(255,(ee.isDash?h:-h)+128))}}addDash(s,x){const I=x?7:0,k=2*I+1;if(this.nextRow+k>this.height)return R.w("LineAtlas out of space"),null;let H=0;for(let ne=0;ne<s.length;ne++)H+=s[ne];if(H!==0){const ne=this.width/H,ue=this.getDashRanges(s,this.width,ne);x?this.addRoundDash(ue,ne,I):this.addRegularDash(ue)}const ee={y:(this.nextRow+I+.5)/this.height,height:2*I/this.height,width:H};return this.nextRow+=k,this.dirty=!0,ee}bind(s){const x=s.gl;this.texture?(x.bindTexture(x.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,x.texSubImage2D(x.TEXTURE_2D,0,0,0,this.width,this.height,x.ALPHA,x.UNSIGNED_BYTE,this.data))):(this.texture=x.createTexture(),x.bindTexture(x.TEXTURE_2D,this.texture),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_S,x.REPEAT),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_T,x.REPEAT),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MIN_FILTER,x.LINEAR),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MAG_FILTER,x.LINEAR),x.texImage2D(x.TEXTURE_2D,0,x.ALPHA,this.width,this.height,0,x.ALPHA,x.UNSIGNED_BYTE,this.data))}}class rr{constructor(s,x,I){this.workerPool=s,this.actors=[],this.currentActor=0,this.id=I;const k=this.workerPool.acquire(I);for(let H=0;H<k.length;H++){const ee=new R.C(k[H],x,I);ee.name=`Worker ${H}`,this.actors.push(ee)}if(!this.actors.length)throw new Error("No actors found")}broadcast(s,x,I){R.o(this.actors,(k,H)=>{k.send(s,x,H)},I=I||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(s=!0){this.actors.forEach(x=>{x.remove()}),this.actors=[],s&&this.workerPool.release(this.id)}}function ar(z,s,x){const I=function(k,H){if(k)return x(k);if(H){const ee=R.F(R.e(H,z),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);H.vector_layers&&(ee.vectorLayers=H.vector_layers,ee.vectorLayerIds=ee.vectorLayers.map(ne=>ne.id)),x(null,ee)}};return z.url?R.f(s.transformRequest(z.url,et.Source),I):R.h.frame(()=>I(null,z))}class wr{constructor(s,x){s&&(x?this.setSouthWest(s).setNorthEast(x):Array.isArray(s)&&(s.length===4?this.setSouthWest([s[0],s[1]]).setNorthEast([s[2],s[3]]):this.setSouthWest(s[0]).setNorthEast(s[1])))}setNorthEast(s){return this._ne=s instanceof R.L?new R.L(s.lng,s.lat):R.L.convert(s),this}setSouthWest(s){return this._sw=s instanceof R.L?new R.L(s.lng,s.lat):R.L.convert(s),this}extend(s){const x=this._sw,I=this._ne;let k,H;if(s instanceof R.L)k=s,H=s;else{if(!(s instanceof wr))return Array.isArray(s)?s.length===4||s.every(Array.isArray)?this.extend(wr.convert(s)):this.extend(R.L.convert(s)):s&&("lng"in s||"lon"in s)&&"lat"in s?this.extend(R.L.convert(s)):this;if(k=s._sw,H=s._ne,!k||!H)return this}return x||I?(x.lng=Math.min(k.lng,x.lng),x.lat=Math.min(k.lat,x.lat),I.lng=Math.max(H.lng,I.lng),I.lat=Math.max(H.lat,I.lat)):(this._sw=new R.L(k.lng,k.lat),this._ne=new R.L(H.lng,H.lat)),this}getCenter(){return new R.L((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new R.L(this.getWest(),this.getNorth())}getSouthEast(){return new R.L(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(s){const{lng:x,lat:I}=R.L.convert(s);let k=this._sw.lng<=x&&x<=this._ne.lng;return this._sw.lng>this._ne.lng&&(k=this._sw.lng>=x&&x>=this._ne.lng),this._sw.lat<=I&&I<=this._ne.lat&&k}static convert(s){return s instanceof wr?s:s&&new wr(s)}static fromLngLat(s,x=0){const I=360*x/40075017,k=I/Math.cos(Math.PI/180*s.lat);return new wr(new R.L(s.lng-k,s.lat-I),new R.L(s.lng+k,s.lat+I))}}class Cr{constructor(s,x,I){this.bounds=wr.convert(this.validateBounds(s)),this.minzoom=x||0,this.maxzoom=I||24}validateBounds(s){return Array.isArray(s)&&s.length===4?[Math.max(-180,s[0]),Math.max(-90,s[1]),Math.min(180,s[2]),Math.min(90,s[3])]:[-180,-90,180,90]}contains(s){const x=Math.pow(2,s.z),I=Math.floor(R.G(this.bounds.getWest())*x),k=Math.floor(R.H(this.bounds.getNorth())*x),H=Math.ceil(R.G(this.bounds.getEast())*x),ee=Math.ceil(R.H(this.bounds.getSouth())*x);return s.x>=I&&s.x<H&&s.y>=k&&s.y<ee}}class an extends R.E{constructor(s,x,I,k){if(super(),this.load=()=>{this._loaded=!1,this.fire(new R.k("dataloading",{dataType:"source"})),this._tileJSONRequest=ar(this._options,this.map._requestManager,(H,ee)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),H?this.fire(new R.j(H)):ee&&(R.e(this,ee),ee.bounds&&(this.tileBounds=new Cr(ee.bounds,this.minzoom,this.maxzoom)),this.fire(new R.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new R.k("data",{dataType:"source",sourceDataType:"content"})))})},this.serialize=()=>R.e({},this._options),this.id=s,this.dispatcher=I,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,R.e(this,R.F(x,["url","scheme","tileSize","promoteId"])),this._options=R.e({type:"vector"},x),this._collectResourceTiming=x.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(k)}loaded(){return this._loaded}hasTile(s){return!this.tileBounds||this.tileBounds.contains(s.canonical)}onAdd(s){this.map=s,this.load()}setSourceProperty(s){this._tileJSONRequest&&this._tileJSONRequest.cancel(),s(),this.load()}setTiles(s){return this.setSourceProperty(()=>{this._options.tiles=s}),this}setUrl(s){return this.setSourceProperty(()=>{this.url=s,this._options.url=s}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}loadTile(s,x){const I=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),k={request:this.map._requestManager.transformRequest(I,et.Tile),uid:s.uid,tileID:s.tileID,zoom:s.tileID.overscaledZ,tileSize:this.tileSize*s.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function H(ee,ne){return delete s.request,s.aborted?x(null):ee&&ee.status!==404?x(ee):(ne&&ne.resourceTiming&&(s.resourceTiming=ne.resourceTiming),this.map._refreshExpiredTiles&&ne&&s.setExpiryData(ne),s.loadVectorData(ne,this.map.painter),x(null),void(s.reloadCallback&&(this.loadTile(s,s.reloadCallback),s.reloadCallback=null)))}k.request.collectResourceTiming=this._collectResourceTiming,s.actor&&s.state!=="expired"?s.state==="loading"?s.reloadCallback=x:s.request=s.actor.send("reloadTile",k,H.bind(this)):(s.actor=this.dispatcher.getActor(),s.request=s.actor.send("loadTile",k,H.bind(this)))}abortTile(s){s.request&&(s.request.cancel(),delete s.request),s.actor&&s.actor.send("abortTile",{uid:s.uid,type:this.type,source:this.id},void 0)}unloadTile(s){s.unloadVectorData(),s.actor&&s.actor.send("removeTile",{uid:s.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class yi extends R.E{constructor(s,x,I,k){super(),this.id=s,this.dispatcher=I,this.setEventedParent(k),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=R.e({type:"raster"},x),R.e(this,R.F(x,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new R.k("dataloading",{dataType:"source"})),this._tileJSONRequest=ar(this._options,this.map._requestManager,(s,x)=>{this._tileJSONRequest=null,this._loaded=!0,s?this.fire(new R.j(s)):x&&(R.e(this,x),x.bounds&&(this.tileBounds=new Cr(x.bounds,this.minzoom,this.maxzoom)),this.fire(new R.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new R.k("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(s){this.map=s,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}setSourceProperty(s){this._tileJSONRequest&&this._tileJSONRequest.cancel(),s(),this.load()}setTiles(s){return this.setSourceProperty(()=>{this._options.tiles=s}),this}serialize(){return R.e({},this._options)}hasTile(s){return!this.tileBounds||this.tileBounds.contains(s.canonical)}loadTile(s,x){const I=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);s.request=Ve.getImage(this.map._requestManager.transformRequest(I,et.Tile),(k,H,ee)=>{if(delete s.request,s.aborted)s.state="unloaded",x(null);else if(k)s.state="errored",x(k);else if(H){this.map._refreshExpiredTiles&&ee&&s.setExpiryData(ee);const ne=this.map.painter.context,ue=ne.gl;s.texture=this.map.painter.getTileTexture(H.width),s.texture?s.texture.update(H,{useMipmap:!0}):(s.texture=new xr(ne,H,ue.RGBA,{useMipmap:!0}),s.texture.bind(ue.LINEAR,ue.CLAMP_TO_EDGE,ue.LINEAR_MIPMAP_NEAREST),ne.extTextureFilterAnisotropic&&ue.texParameterf(ue.TEXTURE_2D,ne.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,ne.extTextureFilterAnisotropicMax)),s.state="loaded",x(null)}},this.map._refreshExpiredTiles)}abortTile(s,x){s.request&&(s.request.cancel(),delete s.request),x()}unloadTile(s,x){s.texture&&this.map.painter.saveTileTexture(s.texture),x()}hasTransition(){return!1}}class li extends yi{constructor(s,x,I,k){super(s,x,I,k),this.type="raster-dem",this.maxzoom=22,this._options=R.e({type:"raster-dem"},x),this.encoding=x.encoding||"mapbox",this.redFactor=x.redFactor,this.greenFactor=x.greenFactor,this.blueFactor=x.blueFactor,this.baseShift=x.baseShift}loadTile(s,x){const I=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),k=this.map._requestManager.transformRequest(I,et.Tile);function H(ee,ne){ee&&(s.state="errored",x(ee)),ne&&(s.dem=ne,s.needsHillshadePrepare=!0,s.needsTerrainPrepare=!0,s.state="loaded",x(null))}s.neighboringTiles=this._getNeighboringTiles(s.tileID),s.request=Ve.getImage(k,(ee,ne,ue)=>R._(this,void 0,void 0,function*(){if(delete s.request,s.aborted)s.state="unloaded",x(null);else if(ee)s.state="errored",x(ee);else if(ne){this.map._refreshExpiredTiles&&s.setExpiryData(ue);const _e=R.a(ne)&&R.J()?ne:yield function(g){return R._(this,void 0,void 0,function*(){if(typeof VideoFrame!="undefined"&&R.K()){const d=g.width+2,b=g.height+2;try{return new R.R({width:d,height:b},yield R.M(g,-1,-1,d,b))}catch(B){}}return R.h.getImageData(g,1)})}(ne),h={uid:s.uid,coord:s.tileID,source:this.id,rawImageData:_e,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};s.actor&&s.state!=="expired"||(s.actor=this.dispatcher.getActor(),s.actor.send("loadDEMTile",h,H))}}),this.map._refreshExpiredTiles)}_getNeighboringTiles(s){const x=s.canonical,I=Math.pow(2,x.z),k=(x.x-1+I)%I,H=x.x===0?s.wrap-1:s.wrap,ee=(x.x+1+I)%I,ne=x.x+1===I?s.wrap+1:s.wrap,ue={};return ue[new R.O(s.overscaledZ,H,x.z,k,x.y).key]={backfilled:!1},ue[new R.O(s.overscaledZ,ne,x.z,ee,x.y).key]={backfilled:!1},x.y>0&&(ue[new R.O(s.overscaledZ,H,x.z,k,x.y-1).key]={backfilled:!1},ue[new R.O(s.overscaledZ,s.wrap,x.z,x.x,x.y-1).key]={backfilled:!1},ue[new R.O(s.overscaledZ,ne,x.z,ee,x.y-1).key]={backfilled:!1}),x.y+1<I&&(ue[new R.O(s.overscaledZ,H,x.z,k,x.y+1).key]={backfilled:!1},ue[new R.O(s.overscaledZ,s.wrap,x.z,x.x,x.y+1).key]={backfilled:!1},ue[new R.O(s.overscaledZ,ne,x.z,ee,x.y+1).key]={backfilled:!1}),ue}unloadTile(s){s.demTexture&&this.map.painter.saveTileTexture(s.demTexture),s.fbo&&(s.fbo.destroy(),delete s.fbo),s.dem&&delete s.dem,delete s.neighboringTiles,s.state="unloaded",s.actor&&s.actor.send("removeDEMTile",{uid:s.uid,source:this.id})}}class Uo extends R.E{constructor(s,x,I,k){super(),this.load=()=>{this._updateWorkerData()},this.serialize=()=>R.e({},this._options,{type:this.type,data:this._data}),this.id=s,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=I.getActor(),this.setEventedParent(k),this._data=x.data,this._options=R.e({},x),this._collectResourceTiming=x.collectResourceTiming,x.maxzoom!==void 0&&(this.maxzoom=x.maxzoom),x.type&&(this.type=x.type),x.attribution&&(this.attribution=x.attribution),this.promoteId=x.promoteId;const H=R.N/this.tileSize;this.workerOptions=R.e({source:this.id,cluster:x.cluster||!1,geojsonVtOptions:{buffer:(x.buffer!==void 0?x.buffer:128)*H,tolerance:(x.tolerance!==void 0?x.tolerance:.375)*H,extent:R.N,maxZoom:this.maxzoom,lineMetrics:x.lineMetrics||!1,generateId:x.generateId||!1},superclusterOptions:{maxZoom:x.clusterMaxZoom!==void 0?x.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,x.clusterMinPoints||2),extent:R.N,radius:(x.clusterRadius||50)*H,log:!1,generateId:x.generateId||!1},clusterProperties:x.clusterProperties,filter:x.filter},x.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}onAdd(s){this.map=s,this.load()}setData(s){return this._data=s,this._updateWorkerData(),this}updateData(s){return this._updateWorkerData(s),this}setClusterOptions(s){return this.workerOptions.cluster=s.cluster,s&&(s.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=s.clusterRadius),s.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=s.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(s,x){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:s,source:this.id},x),this}getClusterChildren(s,x){return this.actor.send("geojson.getClusterChildren",{clusterId:s,source:this.id},x),this}getClusterLeaves(s,x,I,k){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:s,limit:x,offset:I},k),this}_updateWorkerData(s){const x=R.e({},this.workerOptions);s?x.dataDiff=s:typeof this._data=="string"?(x.request=this.map._requestManager.transformRequest(R.h.resolveURL(this._data),et.Source),x.request.collectResourceTiming=this._collectResourceTiming):x.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new R.k("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,x,(I,k)=>{if(this._pendingLoads--,this._removed||k&&k.abandoned)return void this.fire(new R.k("dataabort",{dataType:"source"}));let H=null;if(k&&k.resourceTiming&&k.resourceTiming[this.id]&&(H=k.resourceTiming[this.id].slice(0)),I)return void this.fire(new R.j(I));const ee={dataType:"source"};this._collectResourceTiming&&H&&H.length>0&&R.e(ee,{resourceTiming:H}),this.fire(new R.k("data",Object.assign(Object.assign({},ee),{sourceDataType:"metadata"}))),this.fire(new R.k("data",Object.assign(Object.assign({},ee),{sourceDataType:"content"})))})}loaded(){return this._pendingLoads===0}loadTile(s,x){const I=s.actor?"reloadTile":"loadTile";s.actor=this.actor;const k={type:this.type,uid:s.uid,tileID:s.tileID,zoom:s.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};s.request=this.actor.send(I,k,(H,ee)=>(delete s.request,s.unloadVectorData(),s.aborted?x(null):H?x(H):(s.loadVectorData(ee,this.map.painter,I==="reloadTile"),x(null))))}abortTile(s){s.request&&(s.request.cancel(),delete s.request),s.aborted=!0}unloadTile(s){s.unloadVectorData(),this.actor.send("removeTile",{uid:s.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}hasTransition(){return!1}}var vi=R.Q([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class bo extends R.E{constructor(s,x,I,k){super(),this.load=(H,ee)=>{this._loaded=!1,this.fire(new R.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=Ve.getImage(this.map._requestManager.transformRequest(this.url,et.Image),(ne,ue)=>{this._request=null,this._loaded=!0,ne?this.fire(new R.j(ne)):ue&&(this.image=ue,H&&(this.coordinates=H),ee&&ee(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||!this.image)return;const H=this.map.painter.context,ee=H.gl;this.boundsBuffer||(this.boundsBuffer=H.createVertexBuffer(this._boundsArray,vi.members)),this.boundsSegments||(this.boundsSegments=R.S.simpleSegment(0,0,4,2)),this.texture||(this.texture=new xr(H,this.image,ee.RGBA),this.texture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE));let ne=!1;for(const ue in this.tiles){const _e=this.tiles[ue];_e.state!=="loaded"&&(_e.state="loaded",_e.texture=this.texture,ne=!0)}ne&&this.fire(new R.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"image",url:this.options.url,coordinates:this.coordinates}),this.id=s,this.dispatcher=I,this.coordinates=x.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(k),this.options=x}loaded(){return this._loaded}updateImage(s){return s.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=s.url,this.load(s.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new R.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(s){this.map=s,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(s){this.coordinates=s;const x=s.map(R.U.fromLngLat);this.tileID=function(k){let H=1/0,ee=1/0,ne=-1/0,ue=-1/0;for(const d of k)H=Math.min(H,d.x),ee=Math.min(ee,d.y),ne=Math.max(ne,d.x),ue=Math.max(ue,d.y);const _e=Math.max(ne-H,ue-ee),h=Math.max(0,Math.floor(-Math.log(_e)/Math.LN2)),g=Math.pow(2,h);return new R.W(h,Math.floor((H+ne)/2*g),Math.floor((ee+ue)/2*g))}(x),this.minzoom=this.maxzoom=this.tileID.z;const I=x.map(k=>this.tileID.getTilePoint(k)._round());return this._boundsArray=new R.V,this._boundsArray.emplaceBack(I[0].x,I[0].y,0,0),this._boundsArray.emplaceBack(I[1].x,I[1].y,R.N,0),this._boundsArray.emplaceBack(I[3].x,I[3].y,0,R.N),this._boundsArray.emplaceBack(I[2].x,I[2].y,R.N,R.N),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new R.k("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(s,x){this.tileID&&this.tileID.equals(s.tileID.canonical)?(this.tiles[String(s.tileID.wrap)]=s,s.buckets={},x(null)):(s.state="errored",x(null))}hasTransition(){return!1}}class So extends bo{constructor(s,x,I,k){super(s,x,I,k),this.load=()=>{this._loaded=!1;const H=this.options;this.urls=[];for(const ee of H.urls)this.urls.push(this.map._requestManager.transformRequest(ee,et.Source).url);R.X(this.urls,(ee,ne)=>{this._loaded=!0,ee?this.fire(new R.j(ee)):ne&&(this.video=ne,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const H=this.map.painter.context,ee=H.gl;this.boundsBuffer||(this.boundsBuffer=H.createVertexBuffer(this._boundsArray,vi.members)),this.boundsSegments||(this.boundsSegments=R.S.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE),ee.texSubImage2D(ee.TEXTURE_2D,0,0,0,ee.RGBA,ee.UNSIGNED_BYTE,this.video)):(this.texture=new xr(H,this.video,ee.RGBA),this.texture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE));let ne=!1;for(const ue in this.tiles){const _e=this.tiles[ue];_e.state!=="loaded"&&(_e.state="loaded",_e.texture=this.texture,ne=!0)}ne&&this.fire(new R.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"video",urls:this.urls,coordinates:this.coordinates}),this.roundZoom=!0,this.type="video",this.options=x}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(s){if(this.video){const x=this.video.seekable;s<x.start(0)||s>x.end(0)?this.fire(new R.j(new R.Y(`sources.${this.id}`,null,`Playback for this video can be set only between the ${x.start(0)} and ${x.end(0)}-second mark.`))):this.video.currentTime=s}}getVideo(){return this.video}onAdd(s){this.map||(this.map=s,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}hasTransition(){return this.video&&!this.video.paused}}class Xi extends bo{constructor(s,x,I,k){super(s,x,I,k),this.load=()=>{this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new R.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},this.prepare=()=>{let H=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,H=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,H=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const ee=this.map.painter.context,ne=ee.gl;this.boundsBuffer||(this.boundsBuffer=ee.createVertexBuffer(this._boundsArray,vi.members)),this.boundsSegments||(this.boundsSegments=R.S.simpleSegment(0,0,4,2)),this.texture?(H||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new xr(ee,this.canvas,ne.RGBA,{premultiply:!0});let ue=!1;for(const _e in this.tiles){const h=this.tiles[_e];h.state!=="loaded"&&(h.state="loaded",h.texture=this.texture,ue=!0)}ue&&this.fire(new R.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"canvas",coordinates:this.coordinates}),x.coordinates?Array.isArray(x.coordinates)&&x.coordinates.length===4&&!x.coordinates.some(H=>!Array.isArray(H)||H.length!==2||H.some(ee=>typeof ee!="number"))||this.fire(new R.j(new R.Y(`sources.${s}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new R.j(new R.Y(`sources.${s}`,null,'missing required property "coordinates"'))),x.animate&&typeof x.animate!="boolean"&&this.fire(new R.j(new R.Y(`sources.${s}`,null,'optional "animate" property must be a boolean value'))),x.canvas?typeof x.canvas=="string"||x.canvas instanceof HTMLCanvasElement||this.fire(new R.j(new R.Y(`sources.${s}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new R.j(new R.Y(`sources.${s}`,null,'missing required property "canvas"'))),this.options=x,this.animate=x.animate===void 0||x.animate}getCanvas(){return this.canvas}onAdd(s){this.map=s,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const s of[this.canvas.width,this.canvas.height])if(isNaN(s)||s<=0)return!0;return!1}}const Mi={},qo=z=>{switch(z){case"geojson":return Uo;case"image":return bo;case"raster":return yi;case"raster-dem":return li;case"vector":return an;case"video":return So;case"canvas":return Xi}return Mi[z]};function ui(z,s){const x=R.Z();return R.$(x,x,[1,1,0]),R.a0(x,x,[.5*z.width,.5*z.height,1]),R.a1(x,x,z.calculatePosMatrix(s.toUnwrapped()))}function Qi(z,s,x,I,k,H){const ee=function(g,d,b){if(g)for(const B of g){const G=d[B];if(G&&G.source===b&&G.type==="fill-extrusion")return!0}else for(const B in d){const G=d[B];if(G.source===b&&G.type==="fill-extrusion")return!0}return!1}(k&&k.layers,s,z.id),ne=H.maxPitchScaleFactor(),ue=z.tilesIn(I,ne,ee);ue.sort(Vi);const _e=[];for(const g of ue)_e.push({wrappedTileID:g.tileID.wrapped().key,queryResults:g.tile.queryRenderedFeatures(s,x,z._state,g.queryGeometry,g.cameraQueryGeometry,g.scale,k,H,ne,ui(z.transform,g.tileID))});const h=function(g){const d={},b={};for(const B of g){const G=B.queryResults,q=B.wrappedTileID,te=b[q]=b[q]||{};for(const fe in G){const ce=G[fe],Te=te[fe]=te[fe]||{},Ie=d[fe]=d[fe]||[];for(const Oe of ce)Te[Oe.featureIndex]||(Te[Oe.featureIndex]=!0,Ie.push(Oe))}}return d}(_e);for(const g in h)h[g].forEach(d=>{const b=d.feature,B=z.getFeatureState(b.layer["source-layer"],b.id);b.source=b.layer.source,b.layer["source-layer"]&&(b.sourceLayer=b.layer["source-layer"]),b.state=B});return h}function Vi(z,s){const x=z.tileID,I=s.tileID;return x.overscaledZ-I.overscaledZ||x.canonical.y-I.canonical.y||x.wrap-I.wrap||x.canonical.x-I.canonical.x}class Pi{constructor(s,x){this.timeAdded=0,this.fadeEndTime=0,this.tileID=s,this.uid=R.a2(),this.uses=0,this.tileSize=x,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(s){const x=s+this.timeAdded;x<this.fadeEndTime||(this.fadeEndTime=x)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(s){this.demTexture&&s.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(s,x,I){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",s){s.featureIndex&&(this.latestFeatureIndex=s.featureIndex,s.rawTileData?(this.latestRawTileData=s.rawTileData,this.latestFeatureIndex.rawTileData=s.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=s.collisionBoxArray,this.buckets=function(k,H){const ee={};if(!H)return ee;for(const ne of k){const ue=ne.layerIds.map(_e=>H.getLayer(_e)).filter(Boolean);if(ue.length!==0){ne.layers=ue,ne.stateDependentLayerIds&&(ne.stateDependentLayers=ne.stateDependentLayerIds.map(_e=>ue.filter(h=>h.id===_e)[0]));for(const _e of ue)ee[_e.id]=ne}}return ee}(s.buckets,x.style),this.hasSymbolBuckets=!1;for(const k in this.buckets){const H=this.buckets[k];if(H instanceof R.a4){if(this.hasSymbolBuckets=!0,!I)break;H.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const k in this.buckets){const H=this.buckets[k];if(H instanceof R.a4&&H.hasRTLText){this.hasRTLText=!0,R.a5();break}}this.queryPadding=0;for(const k in this.buckets){const H=this.buckets[k];this.queryPadding=Math.max(this.queryPadding,x.style.getLayer(k).queryRadius(H))}s.imageAtlas&&(this.imageAtlas=s.imageAtlas),s.glyphAtlasImage&&(this.glyphAtlasImage=s.glyphAtlasImage)}else this.collisionBoxArray=new R.a3}unloadVectorData(){for(const s in this.buckets)this.buckets[s].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(s){return this.buckets[s.id]}upload(s){for(const I in this.buckets){const k=this.buckets[I];k.uploadPending()&&k.upload(s)}const x=s.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new xr(s,this.imageAtlas.image,x.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new xr(s,this.glyphAtlasImage,x.ALPHA),this.glyphAtlasImage=null)}prepare(s){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(s,this.imageAtlasTexture)}queryRenderedFeatures(s,x,I,k,H,ee,ne,ue,_e,h){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:k,cameraQueryGeometry:H,scale:ee,tileSize:this.tileSize,pixelPosMatrix:h,transform:ue,params:ne,queryPadding:this.queryPadding*_e},s,x,I):{}}querySourceFeatures(s,x){const I=this.latestFeatureIndex;if(!I||!I.rawTileData)return;const k=I.loadVTLayers(),H=x&&x.sourceLayer?x.sourceLayer:"",ee=k._geojsonTileLayer||k[H];if(!ee)return;const ne=R.a6(x&&x.filter),{z:ue,x:_e,y:h}=this.tileID.canonical,g={z:ue,x:_e,y:h};for(let d=0;d<ee.length;d++){const b=ee.feature(d);if(ne.needGeometry){const q=R.a7(b,!0);if(!ne.filter(new R.a8(this.tileID.overscaledZ),q,this.tileID.canonical))continue}else if(!ne.filter(new R.a8(this.tileID.overscaledZ),b))continue;const B=I.getId(b,H),G=new R.a9(b,ue,_e,h,B);G.tile=g,s.push(G)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(s){const x=this.expirationTime;if(s.cacheControl){const I=R.aa(s.cacheControl);I["max-age"]&&(this.expirationTime=Date.now()+1e3*I["max-age"])}else s.expires&&(this.expirationTime=new Date(s.expires).getTime());if(this.expirationTime){const I=Date.now();let k=!1;if(this.expirationTime>I)k=!1;else if(x)if(this.expirationTime<x)k=!0;else{const H=this.expirationTime-x;H?this.expirationTime=I+Math.max(H,3e4):k=!0}else k=!0;k?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(s,x){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(s).length===0)return;const I=this.latestFeatureIndex.loadVTLayers();for(const k in this.buckets){if(!x.style.hasLayer(k))continue;const H=this.buckets[k],ee=H.layers[0].sourceLayer||"_geojsonTileLayer",ne=I[ee],ue=s[ee];if(!ne||!ue||Object.keys(ue).length===0)continue;H.update(ue,ne,this.imageAtlas&&this.imageAtlas.patternPositions||{});const _e=x&&x.style&&x.style.getLayer(k);_e&&(this.queryPadding=Math.max(this.queryPadding,_e.queryRadius(H)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<R.h.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(s){this.symbolFadeHoldUntil=R.h.now()+s}setDependencies(s,x){const I={};for(const k of x)I[k]=!0;this.dependencies[s]=I}hasDependency(s,x){for(const I of s){const k=this.dependencies[I];if(k){for(const H of x)if(k[H])return!0}}return!1}}class ds{constructor(s,x){this.max=s,this.onRemove=x,this.reset()}reset(){for(const s in this.data)for(const x of this.data[s])x.timeout&&clearTimeout(x.timeout),this.onRemove(x.value);return this.data={},this.order=[],this}add(s,x,I){const k=s.wrapped().key;this.data[k]===void 0&&(this.data[k]=[]);const H={value:x,timeout:void 0};if(I!==void 0&&(H.timeout=setTimeout(()=>{this.remove(s,H)},I)),this.data[k].push(H),this.order.push(k),this.order.length>this.max){const ee=this._getAndRemoveByKey(this.order[0]);ee&&this.onRemove(ee)}return this}has(s){return s.wrapped().key in this.data}getAndRemove(s){return this.has(s)?this._getAndRemoveByKey(s.wrapped().key):null}_getAndRemoveByKey(s){const x=this.data[s].shift();return x.timeout&&clearTimeout(x.timeout),this.data[s].length===0&&delete this.data[s],this.order.splice(this.order.indexOf(s),1),x.value}getByKey(s){const x=this.data[s];return x?x[0].value:null}get(s){return this.has(s)?this.data[s.wrapped().key][0].value:null}remove(s,x){if(!this.has(s))return this;const I=s.wrapped().key,k=x===void 0?0:this.data[I].indexOf(x),H=this.data[I][k];return this.data[I].splice(k,1),H.timeout&&clearTimeout(H.timeout),this.data[I].length===0&&delete this.data[I],this.onRemove(H.value),this.order.splice(this.order.indexOf(I),1),this}setMaxSize(s){for(this.max=s;this.order.length>this.max;){const x=this._getAndRemoveByKey(this.order[0]);x&&this.onRemove(x)}return this}filter(s){const x=[];for(const I in this.data)for(const k of this.data[I])s(k.value)||x.push(k);for(const I of x)this.remove(I.value.tileID,I)}}class Ur{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(s,x,I){const k=String(x);if(this.stateChanges[s]=this.stateChanges[s]||{},this.stateChanges[s][k]=this.stateChanges[s][k]||{},R.e(this.stateChanges[s][k],I),this.deletedStates[s]===null){this.deletedStates[s]={};for(const H in this.state[s])H!==k&&(this.deletedStates[s][H]=null)}else if(this.deletedStates[s]&&this.deletedStates[s][k]===null){this.deletedStates[s][k]={};for(const H in this.state[s][k])I[H]||(this.deletedStates[s][k][H]=null)}else for(const H in I)this.deletedStates[s]&&this.deletedStates[s][k]&&this.deletedStates[s][k][H]===null&&delete this.deletedStates[s][k][H]}removeFeatureState(s,x,I){if(this.deletedStates[s]===null)return;const k=String(x);if(this.deletedStates[s]=this.deletedStates[s]||{},I&&x!==void 0)this.deletedStates[s][k]!==null&&(this.deletedStates[s][k]=this.deletedStates[s][k]||{},this.deletedStates[s][k][I]=null);else if(x!==void 0)if(this.stateChanges[s]&&this.stateChanges[s][k])for(I in this.deletedStates[s][k]={},this.stateChanges[s][k])this.deletedStates[s][k][I]=null;else this.deletedStates[s][k]=null;else this.deletedStates[s]=null}getState(s,x){const I=String(x),k=R.e({},(this.state[s]||{})[I],(this.stateChanges[s]||{})[I]);if(this.deletedStates[s]===null)return{};if(this.deletedStates[s]){const H=this.deletedStates[s][x];if(H===null)return{};for(const ee in H)delete k[ee]}return k}initializeTileState(s,x){s.setFeatureState(this.state,x)}coalesceChanges(s,x){const I={};for(const k in this.stateChanges){this.state[k]=this.state[k]||{};const H={};for(const ee in this.stateChanges[k])this.state[k][ee]||(this.state[k][ee]={}),R.e(this.state[k][ee],this.stateChanges[k][ee]),H[ee]=this.state[k][ee];I[k]=H}for(const k in this.deletedStates){this.state[k]=this.state[k]||{};const H={};if(this.deletedStates[k]===null)for(const ee in this.state[k])H[ee]={},this.state[k][ee]={};else for(const ee in this.deletedStates[k]){if(this.deletedStates[k][ee]===null)this.state[k][ee]={};else for(const ne of Object.keys(this.deletedStates[k][ee]))delete this.state[k][ee][ne];H[ee]=this.state[k][ee]}I[k]=I[k]||{},R.e(I[k],H)}if(this.stateChanges={},this.deletedStates={},Object.keys(I).length!==0)for(const k in s)s[k].setFeatureState(I,x)}}class ls extends R.E{constructor(s,x,I){super(),this.id=s,this.dispatcher=I,this.on("data",k=>{k.dataType==="source"&&k.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&k.dataType==="source"&&k.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((k,H,ee,ne)=>{const ue=new(qo(H.type))(k,H,ee,ne);if(ue.id!==k)throw new Error(`Expected Source id to be ${k} instead of ${ue.id}`);return ue})(s,x,I,this),this._tiles={},this._cache=new ds(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ur,this._didEmitContent=!1,this._updated=!1}onAdd(s){this.map=s,this._maxTileCacheSize=s?s._maxTileCacheSize:null,this._maxTileCacheZoomLevels=s?s._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(s)}onRemove(s){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(s)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const s in this._tiles){const x=this._tiles[s];if(x.state!=="loaded"&&x.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const s=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,s&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(s,x){return this._source.loadTile(s,x)}_unloadTile(s){if(this._source.unloadTile)return this._source.unloadTile(s,()=>{})}_abortTile(s){this._source.abortTile&&this._source.abortTile(s,()=>{}),this._source.fire(new R.k("dataabort",{tile:s,coord:s.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(s){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const x in this._tiles){const I=this._tiles[x];I.upload(s),I.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(s=>s.tileID).sort(dr).map(s=>s.key)}getRenderableIds(s){const x=[];for(const I in this._tiles)this._isIdRenderable(I,s)&&x.push(this._tiles[I]);return s?x.sort((I,k)=>{const H=I.tileID,ee=k.tileID,ne=new R.P(H.canonical.x,H.canonical.y)._rotate(this.transform.angle),ue=new R.P(ee.canonical.x,ee.canonical.y)._rotate(this.transform.angle);return H.overscaledZ-ee.overscaledZ||ue.y-ne.y||ue.x-ne.x}).map(I=>I.tileID.key):x.map(I=>I.tileID).sort(dr).map(I=>I.key)}hasRenderableParent(s){const x=this.findLoadedParent(s,0);return!!x&&this._isIdRenderable(x.tileID.key)}_isIdRenderable(s,x){return this._tiles[s]&&this._tiles[s].hasData()&&!this._coveredTiles[s]&&(x||!this._tiles[s].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const s in this._tiles)this._tiles[s].state!=="errored"&&this._reloadTile(s,"reloading")}}_reloadTile(s,x){const I=this._tiles[s];I&&(I.state!=="loading"&&(I.state=x),this._loadTile(I,this._tileLoaded.bind(this,I,s,x)))}_tileLoaded(s,x,I,k){if(k)return s.state="errored",void(k.status!==404?this._source.fire(new R.j(k,{tile:s})):this.update(this.transform,this.terrain));s.timeAdded=R.h.now(),I==="expired"&&(s.refreshedUponExpiration=!0),this._setTileReloadTimer(x,s),this.getSource().type==="raster-dem"&&s.dem&&this._backfillDEM(s),this._state.initializeTileState(s,this.map?this.map.painter:null),s.aborted||this._source.fire(new R.k("data",{dataType:"source",tile:s,coord:s.tileID}))}_backfillDEM(s){const x=this.getRenderableIds();for(let k=0;k<x.length;k++){const H=x[k];if(s.neighboringTiles&&s.neighboringTiles[H]){const ee=this.getTileByID(H);I(s,ee),I(ee,s)}}function I(k,H){k.needsHillshadePrepare=!0,k.needsTerrainPrepare=!0;let ee=H.tileID.canonical.x-k.tileID.canonical.x;const ne=H.tileID.canonical.y-k.tileID.canonical.y,ue=Math.pow(2,k.tileID.canonical.z),_e=H.tileID.key;ee===0&&ne===0||Math.abs(ne)>1||(Math.abs(ee)>1&&(Math.abs(ee+ue)===1?ee+=ue:Math.abs(ee-ue)===1&&(ee-=ue)),H.dem&&k.dem&&(k.dem.backfillBorder(H.dem,ee,ne),k.neighboringTiles&&k.neighboringTiles[_e]&&(k.neighboringTiles[_e].backfilled=!0)))}}getTile(s){return this.getTileByID(s.key)}getTileByID(s){return this._tiles[s]}_retainLoadedChildren(s,x,I,k){for(const H in this._tiles){let ee=this._tiles[H];if(k[H]||!ee.hasData()||ee.tileID.overscaledZ<=x||ee.tileID.overscaledZ>I)continue;let ne=ee.tileID;for(;ee&&ee.tileID.overscaledZ>x+1;){const _e=ee.tileID.scaledTo(ee.tileID.overscaledZ-1);ee=this._tiles[_e.key],ee&&ee.hasData()&&(ne=_e)}let ue=ne;for(;ue.overscaledZ>x;)if(ue=ue.scaledTo(ue.overscaledZ-1),s[ue.key]){k[ne.key]=ne;break}}}findLoadedParent(s,x){if(s.key in this._loadedParentTiles){const I=this._loadedParentTiles[s.key];return I&&I.tileID.overscaledZ>=x?I:null}for(let I=s.overscaledZ-1;I>=x;I--){const k=s.scaledTo(I),H=this._getLoadedTile(k);if(H)return H}}_getLoadedTile(s){const x=this._tiles[s.key];return x&&x.hasData()?x:this._cache.getByKey(s.wrapped().key)}updateCacheSize(s){const x=Math.ceil(s.width/this._source.tileSize)+1,I=Math.ceil(s.height/this._source.tileSize)+1,k=Math.floor(x*I*(this._maxTileCacheZoomLevels===null?R.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),H=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,k):k;this._cache.setMaxSize(H)}handleWrapJump(s){const x=Math.round((s-(this._prevLng===void 0?s:this._prevLng))/360);if(this._prevLng=s,x){const I={};for(const k in this._tiles){const H=this._tiles[k];H.tileID=H.tileID.unwrapTo(H.tileID.wrap+x),I[H.tileID.key]=H}this._tiles=I;for(const k in this._timers)clearTimeout(this._timers[k]),delete this._timers[k];for(const k in this._tiles)this._setTileReloadTimer(k,this._tiles[k])}}update(s,x){if(this.transform=s,this.terrain=x,!this._sourceLoaded||this._paused)return;let I;this.updateCacheSize(s),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?I=s.getVisibleUnwrappedCoordinates(this._source.tileID).map(h=>new R.O(h.canonical.z,h.wrap,h.canonical.z,h.canonical.x,h.canonical.y)):(I=s.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:x}),this._source.hasTile&&(I=I.filter(h=>this._source.hasTile(h)))):I=[];const k=s.coveringZoomLevel(this._source),H=Math.max(k-ls.maxOverzooming,this._source.minzoom),ee=Math.max(k+ls.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const h={};for(const g of I)if(g.canonical.z>this._source.minzoom){const d=g.scaledTo(g.canonical.z-1);h[d.key]=d;const b=g.scaledTo(Math.max(this._source.minzoom,Math.min(g.canonical.z,5)));h[b.key]=b}I=I.concat(Object.values(h))}const ne=I.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,ne&&this.fire(new R.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const ue=this._updateRetainedTiles(I,k);if(he(this._source.type)){const h={},g={},d=Object.keys(ue),b=R.h.now();for(const B of d){const G=ue[B],q=this._tiles[B];if(!q||q.fadeEndTime!==0&&q.fadeEndTime<=b)continue;const te=this.findLoadedParent(G,H);te&&(this._addTile(te.tileID),h[te.tileID.key]=te.tileID),g[B]=G}this._retainLoadedChildren(g,k,ee,ue);for(const B in h)ue[B]||(this._coveredTiles[B]=!0,ue[B]=h[B]);if(x){const B={},G={};for(const q of I)this._tiles[q.key].hasData()?B[q.key]=q:G[q.key]=q;for(const q in G){const te=G[q].children(this._source.maxzoom);this._tiles[te[0].key]&&this._tiles[te[1].key]&&this._tiles[te[2].key]&&this._tiles[te[3].key]&&(B[te[0].key]=ue[te[0].key]=te[0],B[te[1].key]=ue[te[1].key]=te[1],B[te[2].key]=ue[te[2].key]=te[2],B[te[3].key]=ue[te[3].key]=te[3],delete G[q])}for(const q in G){const te=this.findLoadedParent(G[q],this._source.minzoom);if(te){B[te.tileID.key]=ue[te.tileID.key]=te.tileID;for(const fe in B)B[fe].isChildOf(te.tileID)&&delete B[fe]}}for(const q in this._tiles)B[q]||(this._coveredTiles[q]=!0)}}for(const h in ue)this._tiles[h].clearFadeHold();const _e=R.ab(this._tiles,ue);for(const h of _e){const g=this._tiles[h];g.hasSymbolBuckets&&!g.holdingForFade()?g.setHoldDuration(this.map._fadeDuration):g.hasSymbolBuckets&&!g.symbolFadeFinished()||this._removeTile(h)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const s in this._tiles)this._tiles[s].holdingForFade()&&this._removeTile(s)}_updateRetainedTiles(s,x){const I={},k={},H=Math.max(x-ls.maxOverzooming,this._source.minzoom),ee=Math.max(x+ls.maxUnderzooming,this._source.minzoom),ne={};for(const ue of s){const _e=this._addTile(ue);I[ue.key]=ue,_e.hasData()||x<this._source.maxzoom&&(ne[ue.key]=ue)}this._retainLoadedChildren(ne,x,ee,I);for(const ue of s){let _e=this._tiles[ue.key];if(_e.hasData())continue;if(x+1>this._source.maxzoom){const g=ue.children(this._source.maxzoom)[0],d=this.getTile(g);if(d&&d.hasData()){I[g.key]=g;continue}}else{const g=ue.children(this._source.maxzoom);if(I[g[0].key]&&I[g[1].key]&&I[g[2].key]&&I[g[3].key])continue}let h=_e.wasRequested();for(let g=ue.overscaledZ-1;g>=H;--g){const d=ue.scaledTo(g);if(k[d.key])break;if(k[d.key]=!0,_e=this.getTile(d),!_e&&h&&(_e=this._addTile(d)),_e){const b=_e.hasData();if((h||b)&&(I[d.key]=d),h=_e.wasRequested(),b)break}}}return I}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const s in this._tiles){const x=[];let I,k=this._tiles[s].tileID;for(;k.overscaledZ>0;){if(k.key in this._loadedParentTiles){I=this._loadedParentTiles[k.key];break}x.push(k.key);const H=k.scaledTo(k.overscaledZ-1);if(I=this._getLoadedTile(H),I)break;k=H}for(const H of x)this._loadedParentTiles[H]=I}}_addTile(s){let x=this._tiles[s.key];if(x)return x;x=this._cache.getAndRemove(s),x&&(this._setTileReloadTimer(s.key,x),x.tileID=s,this._state.initializeTileState(x,this.map?this.map.painter:null),this._cacheTimers[s.key]&&(clearTimeout(this._cacheTimers[s.key]),delete this._cacheTimers[s.key],this._setTileReloadTimer(s.key,x)));const I=x;return x||(x=new Pi(s,this._source.tileSize*s.overscaleFactor()),this._loadTile(x,this._tileLoaded.bind(this,x,s.key,x.state))),x.uses++,this._tiles[s.key]=x,I||this._source.fire(new R.k("dataloading",{tile:x,coord:x.tileID,dataType:"source"})),x}_setTileReloadTimer(s,x){s in this._timers&&(clearTimeout(this._timers[s]),delete this._timers[s]);const I=x.getExpiryTimeout();I&&(this._timers[s]=setTimeout(()=>{this._reloadTile(s,"expired"),delete this._timers[s]},I))}_removeTile(s){const x=this._tiles[s];x&&(x.uses--,delete this._tiles[s],this._timers[s]&&(clearTimeout(this._timers[s]),delete this._timers[s]),x.uses>0||(x.hasData()&&x.state!=="reloading"?this._cache.add(x.tileID,x,x.getExpiryTimeout()):(x.aborted=!0,this._abortTile(x),this._unloadTile(x))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const s in this._tiles)this._removeTile(s);this._cache.reset()}tilesIn(s,x,I){const k=[],H=this.transform;if(!H)return k;const ee=I?H.getCameraQueryGeometry(s):s,ne=s.map(B=>H.pointCoordinate(B,this.terrain)),ue=ee.map(B=>H.pointCoordinate(B,this.terrain)),_e=this.getIds();let h=1/0,g=1/0,d=-1/0,b=-1/0;for(const B of ue)h=Math.min(h,B.x),g=Math.min(g,B.y),d=Math.max(d,B.x),b=Math.max(b,B.y);for(let B=0;B<_e.length;B++){const G=this._tiles[_e[B]];if(G.holdingForFade())continue;const q=G.tileID,te=Math.pow(2,H.zoom-G.tileID.overscaledZ),fe=x*G.queryPadding*R.N/G.tileSize/te,ce=[q.getTilePoint(new R.U(h,g)),q.getTilePoint(new R.U(d,b))];if(ce[0].x-fe<R.N&&ce[0].y-fe<R.N&&ce[1].x+fe>=0&&ce[1].y+fe>=0){const Te=ne.map(Oe=>q.getTilePoint(Oe)),Ie=ue.map(Oe=>q.getTilePoint(Oe));k.push({tile:G,tileID:q,queryGeometry:Te,cameraQueryGeometry:Ie,scale:te})}}return k}getVisibleCoordinates(s){const x=this.getRenderableIds(s).map(I=>this._tiles[I].tileID);for(const I of x)I.posMatrix=this.transform.calculatePosMatrix(I.toUnwrapped());return x}hasTransition(){if(this._source.hasTransition())return!0;if(he(this._source.type)){const s=R.h.now();for(const x in this._tiles)if(this._tiles[x].fadeEndTime>=s)return!0}return!1}setFeatureState(s,x,I){this._state.updateState(s=s||"_geojsonTileLayer",x,I)}removeFeatureState(s,x,I){this._state.removeFeatureState(s=s||"_geojsonTileLayer",x,I)}getFeatureState(s,x){return this._state.getState(s=s||"_geojsonTileLayer",x)}setDependencies(s,x,I){const k=this._tiles[s];k&&k.setDependencies(x,I)}reloadTilesForDependencies(s,x){for(const I in this._tiles)this._tiles[I].hasDependency(s,x)&&this._reloadTile(I,"reloading");this._cache.filter(I=>!I.hasDependency(s,x))}}function dr(z,s){const x=Math.abs(2*z.wrap)-+(z.wrap<0),I=Math.abs(2*s.wrap)-+(s.wrap<0);return z.overscaledZ-s.overscaledZ||I-x||s.canonical.y-z.canonical.y||s.canonical.x-z.canonical.x}function he(z){return z==="raster"||z==="image"||z==="video"}ls.maxOverzooming=10,ls.maxUnderzooming=3;const We="mapboxgl_preloaded_worker_pool";class at{constructor(){this.active={}}acquire(s){if(!this.workers)for(this.workers=[];this.workers.length<at.workerCount;)this.workers.push(new Worker(R.c.WORKER_URL));return this.active[s]=!0,this.workers.slice()}release(s){delete this.active[s],this.numActive()===0&&(this.workers.forEach(x=>{x.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[We]}numActive(){return Object.keys(this.active).length}}const Ot=Math.floor(R.h.hardwareConcurrency/2);let or;function Wr(){return or||(or=new at),or}at.workerCount=R.ac(globalThis)?Math.max(Math.min(Ot,3),1):1;class In{constructor(s,x){this.reset(s,x)}reset(s,x){this.points=s||[],this._distances=[0];for(let I=1;I<this.points.length;I++)this._distances[I]=this._distances[I-1]+this.points[I].dist(this.points[I-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(x||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(s){if(this.points.length===1)return this.points[0];s=R.ad(s,0,1);let x=1,I=this._distances[x];const k=s*this.paddedLength+this.padding;for(;I<k&&x<this._distances.length;)I=this._distances[++x];const H=x-1,ee=this._distances[H],ne=I-ee,ue=ne>0?(k-ee)/ne:0;return this.points[H].mult(1-ue).add(this.points[x].mult(ue))}}function kn(z,s){let x=!0;return z==="always"||z!=="never"&&s!=="never"||(x=!1),x}class eo{constructor(s,x,I){const k=this.boxCells=[],H=this.circleCells=[];this.xCellCount=Math.ceil(s/I),this.yCellCount=Math.ceil(x/I);for(let ee=0;ee<this.xCellCount*this.yCellCount;ee++)k.push([]),H.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=s,this.height=x,this.xScale=this.xCellCount/s,this.yScale=this.yCellCount/x,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(s,x,I,k,H){this._forEachCell(x,I,k,H,this._insertBoxCell,this.boxUid++),this.boxKeys.push(s),this.bboxes.push(x),this.bboxes.push(I),this.bboxes.push(k),this.bboxes.push(H)}insertCircle(s,x,I,k){this._forEachCell(x-k,I-k,x+k,I+k,this._insertCircleCell,this.circleUid++),this.circleKeys.push(s),this.circles.push(x),this.circles.push(I),this.circles.push(k)}_insertBoxCell(s,x,I,k,H,ee){this.boxCells[H].push(ee)}_insertCircleCell(s,x,I,k,H,ee){this.circleCells[H].push(ee)}_query(s,x,I,k,H,ee,ne){if(I<0||s>this.width||k<0||x>this.height)return[];const ue=[];if(s<=0&&x<=0&&this.width<=I&&this.height<=k){if(H)return[{key:null,x1:s,y1:x,x2:I,y2:k}];for(let _e=0;_e<this.boxKeys.length;_e++)ue.push({key:this.boxKeys[_e],x1:this.bboxes[4*_e],y1:this.bboxes[4*_e+1],x2:this.bboxes[4*_e+2],y2:this.bboxes[4*_e+3]});for(let _e=0;_e<this.circleKeys.length;_e++){const h=this.circles[3*_e],g=this.circles[3*_e+1],d=this.circles[3*_e+2];ue.push({key:this.circleKeys[_e],x1:h-d,y1:g-d,x2:h+d,y2:g+d})}}else this._forEachCell(s,x,I,k,this._queryCell,ue,{hitTest:H,overlapMode:ee,seenUids:{box:{},circle:{}}},ne);return ue}query(s,x,I,k){return this._query(s,x,I,k,!1,null)}hitTest(s,x,I,k,H,ee){return this._query(s,x,I,k,!0,H,ee).length>0}hitTestCircle(s,x,I,k,H){const ee=s-I,ne=s+I,ue=x-I,_e=x+I;if(ne<0||ee>this.width||_e<0||ue>this.height)return!1;const h=[];return this._forEachCell(ee,ue,ne,_e,this._queryCellCircle,h,{hitTest:!0,overlapMode:k,circle:{x:s,y:x,radius:I},seenUids:{box:{},circle:{}}},H),h.length>0}_queryCell(s,x,I,k,H,ee,ne,ue){const{seenUids:_e,hitTest:h,overlapMode:g}=ne,d=this.boxCells[H];if(d!==null){const B=this.bboxes;for(const G of d)if(!_e.box[G]){_e.box[G]=!0;const q=4*G,te=this.boxKeys[G];if(s<=B[q+2]&&x<=B[q+3]&&I>=B[q+0]&&k>=B[q+1]&&(!ue||ue(te))&&(!h||!kn(g,te.overlapMode))&&(ee.push({key:te,x1:B[q],y1:B[q+1],x2:B[q+2],y2:B[q+3]}),h))return!0}}const b=this.circleCells[H];if(b!==null){const B=this.circles;for(const G of b)if(!_e.circle[G]){_e.circle[G]=!0;const q=3*G,te=this.circleKeys[G];if(this._circleAndRectCollide(B[q],B[q+1],B[q+2],s,x,I,k)&&(!ue||ue(te))&&(!h||!kn(g,te.overlapMode))){const fe=B[q],ce=B[q+1],Te=B[q+2];if(ee.push({key:te,x1:fe-Te,y1:ce-Te,x2:fe+Te,y2:ce+Te}),h)return!0}}}return!1}_queryCellCircle(s,x,I,k,H,ee,ne,ue){const{circle:_e,seenUids:h,overlapMode:g}=ne,d=this.boxCells[H];if(d!==null){const B=this.bboxes;for(const G of d)if(!h.box[G]){h.box[G]=!0;const q=4*G,te=this.boxKeys[G];if(this._circleAndRectCollide(_e.x,_e.y,_e.radius,B[q+0],B[q+1],B[q+2],B[q+3])&&(!ue||ue(te))&&!kn(g,te.overlapMode))return ee.push(!0),!0}}const b=this.circleCells[H];if(b!==null){const B=this.circles;for(const G of b)if(!h.circle[G]){h.circle[G]=!0;const q=3*G,te=this.circleKeys[G];if(this._circlesCollide(B[q],B[q+1],B[q+2],_e.x,_e.y,_e.radius)&&(!ue||ue(te))&&!kn(g,te.overlapMode))return ee.push(!0),!0}}}_forEachCell(s,x,I,k,H,ee,ne,ue){const _e=this._convertToXCellCoord(s),h=this._convertToYCellCoord(x),g=this._convertToXCellCoord(I),d=this._convertToYCellCoord(k);for(let b=_e;b<=g;b++)for(let B=h;B<=d;B++)if(H.call(this,s,x,I,k,this.xCellCount*B+b,ee,ne,ue))return}_convertToXCellCoord(s){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(s*this.xScale)))}_convertToYCellCoord(s){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(s*this.yScale)))}_circlesCollide(s,x,I,k,H,ee){const ne=k-s,ue=H-x,_e=I+ee;return _e*_e>ne*ne+ue*ue}_circleAndRectCollide(s,x,I,k,H,ee,ne){const ue=(ee-k)/2,_e=Math.abs(s-(k+ue));if(_e>ue+I)return!1;const h=(ne-H)/2,g=Math.abs(x-(H+h));if(g>h+I)return!1;if(_e<=ue||g<=h)return!0;const d=_e-ue,b=g-h;return d*d+b*b<=I*I}}function un(z,s,x,I,k){const H=R.Z();return s?(R.a0(H,H,[1/k,1/k,1]),x||R.ae(H,H,I.angle)):R.a1(H,I.labelPlaneMatrix,z),H}function To(z,s,x,I,k){if(s){const H=R.af(z);return R.a0(H,H,[k,k,1]),x||R.ae(H,H,-I.angle),H}return I.glCoordMatrix}function Ti(z,s,x){let I;x?(I=[z.x,z.y,x(z.x,z.y),1],R.ag(I,I,s)):(I=[z.x,z.y,0,1],ge(I,I,s));const k=I[3];return{point:new R.P(I[0]/k,I[1]/k),signedDistanceFromCamera:k}}function Lo(z,s){return .5+z/s*.5}function wa(z,s){const x=z[0]/z[3],I=z[1]/z[3];return x>=-s[0]&&x<=s[0]&&I>=-s[1]&&I<=s[1]}function dn(z,s,x,I,k,H,ee,ne,ue,_e){const h=I?z.textSizeData:z.iconSizeData,g=R.ah(h,x.transform.zoom),d=[256/x.width*2+1,256/x.height*2+1],b=I?z.text.dynamicLayoutVertexArray:z.icon.dynamicLayoutVertexArray;b.clear();const B=z.lineVertexArray,G=I?z.text.placedSymbolArray:z.icon.placedSymbolArray,q=x.transform.width/x.transform.height;let te=!1;for(let fe=0;fe<G.length;fe++){const ce=G.get(fe);if(ce.hidden||ce.writingMode===R.ai.vertical&&!te){le(ce.numGlyphs,b);continue}let Te;if(te=!1,_e?(Te=[ce.anchorX,ce.anchorY,_e(ce.anchorX,ce.anchorY),1],R.ag(Te,Te,s)):(Te=[ce.anchorX,ce.anchorY,0,1],ge(Te,Te,s)),!wa(Te,d)){le(ce.numGlyphs,b);continue}const Ie=Lo(x.transform.cameraToCenterDistance,Te[3]),Oe=R.aj(h,g,ce),Qe=ee?Oe/Ie:Oe*Ie,nt=new R.P(ce.anchorX,ce.anchorY),ct=Ti(nt,k,_e).point,tt={projections:{},offsets:{}},Tt=Za(ce,Qe,!1,ne,s,k,H,z.glyphOffsetArray,B,b,ct,nt,tt,q,ue,_e);te=Tt.useVertical,(Tt.notEnoughRoom||te||Tt.needsFlipping&&Za(ce,Qe,!0,ne,s,k,H,z.glyphOffsetArray,B,b,ct,nt,tt,q,ue,_e).notEnoughRoom)&&le(ce.numGlyphs,b)}I?z.text.dynamicLayoutVertexBuffer.updateData(b):z.icon.dynamicLayoutVertexBuffer.updateData(b)}function co(z,s,x,I,k,H,ee,ne,ue,_e,h,g,d){const b=ne.glyphStartIndex+ne.numGlyphs,B=ne.lineStartIndex,G=ne.lineStartIndex+ne.lineLength,q=s.getoffsetX(ne.glyphStartIndex),te=s.getoffsetX(b-1),fe=Ne(z*q,x,I,k,H,ee,ne.segment,B,G,ue,_e,h,g,d);if(!fe)return null;const ce=Ne(z*te,x,I,k,H,ee,ne.segment,B,G,ue,_e,h,g,d);return ce?{first:fe,last:ce}:null}function no(z,s,x,I){return z===R.ai.horizontal&&Math.abs(x.y-s.y)>Math.abs(x.x-s.x)*I?{useVertical:!0}:(z===R.ai.vertical?s.y<x.y:s.x>x.x)?{needsFlipping:!0}:null}function Za(z,s,x,I,k,H,ee,ne,ue,_e,h,g,d,b,B,G){const q=s/24,te=z.lineOffsetX*q,fe=z.lineOffsetY*q;let ce;if(z.numGlyphs>1){const Te=z.glyphStartIndex+z.numGlyphs,Ie=z.lineStartIndex,Oe=z.lineStartIndex+z.lineLength,Qe=co(q,ne,te,fe,x,h,g,z,ue,H,d,B,G);if(!Qe)return{notEnoughRoom:!0};const nt=Ti(Qe.first.point,ee,G).point,ct=Ti(Qe.last.point,ee,G).point;if(I&&!x){const tt=no(z.writingMode,nt,ct,b);if(tt)return tt}ce=[Qe.first];for(let tt=z.glyphStartIndex+1;tt<Te-1;tt++)ce.push(Ne(q*ne.getoffsetX(tt),te,fe,x,h,g,z.segment,Ie,Oe,ue,H,d,B,G));ce.push(Qe.last)}else{if(I&&!x){const Ie=Ti(g,k,G).point,Oe=z.lineStartIndex+z.segment+1,Qe=new R.P(ue.getx(Oe),ue.gety(Oe)),nt=Ti(Qe,k,G),ct=nt.signedDistanceFromCamera>0?nt.point:ms(g,Qe,Ie,1,k,G),tt=no(z.writingMode,Ie,ct,b);if(tt)return tt}const Te=Ne(q*ne.getoffsetX(z.glyphStartIndex),te,fe,x,h,g,z.segment,z.lineStartIndex,z.lineStartIndex+z.lineLength,ue,H,d,B,G);if(!Te)return{notEnoughRoom:!0};ce=[Te]}for(const Te of ce)R.ak(_e,Te.point,Te.angle);return{}}function ms(z,s,x,I,k,H){const ee=Ti(z.add(z.sub(s)._unit()),k,H).point,ne=x.sub(ee);return x.add(ne._mult(I/ne.mag()))}function Ji(z,s){const{projectionCache:x,lineVertexArray:I,labelPlaneMatrix:k,tileAnchorPoint:H,distanceFromAnchor:ee,getElevation:ne,previousVertex:ue,direction:_e,absOffsetX:h}=s;if(x.projections[z])return x.projections[z];const g=new R.P(I.getx(z),I.gety(z)),d=Ti(g,k,ne);if(d.signedDistanceFromCamera>0)return x.projections[z]=d.point,d.point;const b=z-_e;return ms(ee===0?H:new R.P(I.getx(b),I.gety(b)),g,ue,h-ee+1,k,ne)}function Us(z,s,x){return z._unit()._perp()._mult(s*x)}function Lt(z,s,x,I,k,H,ee,ne){const{projectionCache:ue,direction:_e}=ne;if(ue.offsets[z])return ue.offsets[z];const h=x.add(s);if(z+_e<I||z+_e>=k)return ue.offsets[z]=h,h;const g=Ji(z+_e,ne),d=Us(g.sub(x),ee,_e),b=x.add(d),B=g.add(d);return ue.offsets[z]=R.al(H,h,b,B)||h,ue.offsets[z]}function Ne(z,s,x,I,k,H,ee,ne,ue,_e,h,g,d,b){const B=I?z-s:z+s;let G=B>0?1:-1,q=0;I&&(G*=-1,q=Math.PI),G<0&&(q+=Math.PI);let te,fe,ce=G>0?ne+ee:ne+ee+1,Te=k,Ie=k,Oe=0,Qe=0;const nt=Math.abs(B),ct=[];let tt;for(;Oe+Qe<=nt;){if(ce+=G,ce<ne||ce>=ue)return null;Oe+=Qe,Ie=Te,fe=te;const Nt={projectionCache:g,lineVertexArray:_e,labelPlaneMatrix:h,tileAnchorPoint:H,distanceFromAnchor:Oe,getElevation:b,previousVertex:Ie,direction:G,absOffsetX:nt};if(Te=Ji(ce,Nt),x===0)ct.push(Ie),tt=Te.sub(Ie);else{let pr;const tr=Te.sub(Ie);pr=tr.mag()===0?Us(Ji(ce+G,Nt).sub(Te),x,G):Us(tr,x,G),fe||(fe=Ie.add(pr)),te=Lt(ce,pr,Te,ne,ue,fe,x,Nt),ct.push(fe),tt=te.sub(fe)}Qe=tt.mag()}const Tt=tt._mult((nt-Oe)/Qe)._add(fe||Ie),Ut=q+Math.atan2(Te.y-Ie.y,Te.x-Ie.x);return ct.push(Tt),{point:Tt,angle:d?Ut:0,path:ct}}const re=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function le(z,s){for(let x=0;x<z;x++){const I=s.length;s.resize(I+4),s.float32.set(re,3*I)}}function ge(z,s,x){const I=s[0],k=s[1];return z[0]=x[0]*I+x[4]*k+x[12],z[1]=x[1]*I+x[5]*k+x[13],z[3]=x[3]*I+x[7]*k+x[15],z}const ye=100;class ze{constructor(s,x=new eo(s.width+200,s.height+200,25),I=new eo(s.width+200,s.height+200,25)){this.transform=s,this.grid=x,this.ignoredGrid=I,this.pitchfactor=Math.cos(s._pitch)*s.cameraToCenterDistance,this.screenRightBoundary=s.width+ye,this.screenBottomBoundary=s.height+ye,this.gridRightBoundary=s.width+200,this.gridBottomBoundary=s.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(s,x,I,k,H,ee){const ne=this.projectAndGetPerspectiveRatio(k,s.anchorPointX,s.anchorPointY,ee),ue=I*ne.perspectiveRatio,_e=s.x1*ue+ne.point.x,h=s.y1*ue+ne.point.y,g=s.x2*ue+ne.point.x,d=s.y2*ue+ne.point.y;return!this.isInsideGrid(_e,h,g,d)||x!=="always"&&this.grid.hitTest(_e,h,g,d,x,H)||ne.perspectiveRatio<this.perspectiveRatioCutoff?{box:[],offscreen:!1}:{box:[_e,h,g,d],offscreen:this.isOffscreen(_e,h,g,d)}}placeCollisionCircles(s,x,I,k,H,ee,ne,ue,_e,h,g,d,b,B){const G=[],q=new R.P(x.anchorX,x.anchorY),te=Ti(q,ee,B),fe=Lo(this.transform.cameraToCenterDistance,te.signedDistanceFromCamera),ce=(h?H/fe:H*fe)/R.ap,Te=Ti(q,ne,B).point,Ie=co(ce,k,x.lineOffsetX*ce,x.lineOffsetY*ce,!1,Te,q,x,I,ne,{projections:{},offsets:{}},!1,B);let Oe=!1,Qe=!1,nt=!0;if(Ie){const ct=.5*d*fe+b,tt=new R.P(-100,-100),Tt=new R.P(this.screenRightBoundary,this.screenBottomBoundary),Ut=new In,Nt=Ie.first,pr=Ie.last;let tr=[];for(let sn=Nt.path.length-1;sn>=1;sn--)tr.push(Nt.path[sn]);for(let sn=1;sn<pr.path.length;sn++)tr.push(pr.path[sn]);const Dr=2.5*ct;if(ue){const sn=tr.map(nn=>Ti(nn,ue,B));tr=sn.some(nn=>nn.signedDistanceFromCamera<=0)?[]:sn.map(nn=>nn.point)}let Hr=[];if(tr.length>0){const sn=tr[0].clone(),nn=tr[0].clone();for(let Gn=1;Gn<tr.length;Gn++)sn.x=Math.min(sn.x,tr[Gn].x),sn.y=Math.min(sn.y,tr[Gn].y),nn.x=Math.max(nn.x,tr[Gn].x),nn.y=Math.max(nn.y,tr[Gn].y);Hr=sn.x>=tt.x&&nn.x<=Tt.x&&sn.y>=tt.y&&nn.y<=Tt.y?[tr]:nn.x<tt.x||sn.x>Tt.x||nn.y<tt.y||sn.y>Tt.y?[]:R.am([tr],tt.x,tt.y,Tt.x,Tt.y)}for(const sn of Hr){Ut.reset(sn,.25*ct);let nn=0;nn=Ut.length<=.5*ct?1:Math.ceil(Ut.paddedLength/Dr)+1;for(let Gn=0;Gn<nn;Gn++){const di=Gn/Math.max(nn-1,1),Di=Ut.lerp(di),Ui=Di.x+ye,ho=Di.y+ye;G.push(Ui,ho,ct,0);const gi=Ui-ct,Wi=ho-ct,Ko=Ui+ct,Mo=ho+ct;if(nt=nt&&this.isOffscreen(gi,Wi,Ko,Mo),Qe=Qe||this.isInsideGrid(gi,Wi,Ko,Mo),s!=="always"&&this.grid.hitTestCircle(Ui,ho,ct,s,g)&&(Oe=!0,!_e))return{circles:[],offscreen:!1,collisionDetected:Oe}}}}return{circles:!_e&&Oe||!Qe||fe<this.perspectiveRatioCutoff?[]:G,offscreen:nt,collisionDetected:Oe}}queryRenderedSymbols(s){if(s.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const x=[];let I=1/0,k=1/0,H=-1/0,ee=-1/0;for(const h of s){const g=new R.P(h.x+ye,h.y+ye);I=Math.min(I,g.x),k=Math.min(k,g.y),H=Math.max(H,g.x),ee=Math.max(ee,g.y),x.push(g)}const ne=this.grid.query(I,k,H,ee).concat(this.ignoredGrid.query(I,k,H,ee)),ue={},_e={};for(const h of ne){const g=h.key;if(ue[g.bucketInstanceId]===void 0&&(ue[g.bucketInstanceId]={}),ue[g.bucketInstanceId][g.featureIndex])continue;const d=[new R.P(h.x1,h.y1),new R.P(h.x2,h.y1),new R.P(h.x2,h.y2),new R.P(h.x1,h.y2)];R.an(x,d)&&(ue[g.bucketInstanceId][g.featureIndex]=!0,_e[g.bucketInstanceId]===void 0&&(_e[g.bucketInstanceId]=[]),_e[g.bucketInstanceId].push(g.featureIndex))}return _e}insertCollisionBox(s,x,I,k,H,ee){(I?this.ignoredGrid:this.grid).insert({bucketInstanceId:k,featureIndex:H,collisionGroupID:ee,overlapMode:x},s[0],s[1],s[2],s[3])}insertCollisionCircles(s,x,I,k,H,ee){const ne=I?this.ignoredGrid:this.grid,ue={bucketInstanceId:k,featureIndex:H,collisionGroupID:ee,overlapMode:x};for(let _e=0;_e<s.length;_e+=4)ne.insertCircle(ue,s[_e],s[_e+1],s[_e+2])}projectAndGetPerspectiveRatio(s,x,I,k){let H;return k?(H=[x,I,k(x,I),1],R.ag(H,H,s)):(H=[x,I,0,1],ge(H,H,s)),{point:new R.P((H[0]/H[3]+1)/2*this.transform.width+ye,(-H[1]/H[3]+1)/2*this.transform.height+ye),perspectiveRatio:.5+this.transform.cameraToCenterDistance/H[3]*.5}}isOffscreen(s,x,I,k){return I<ye||s>=this.screenRightBoundary||k<ye||x>this.screenBottomBoundary}isInsideGrid(s,x,I,k){return I>=0&&s<this.gridRightBoundary&&k>=0&&x<this.gridBottomBoundary}getViewportMatrix(){const s=R.ao([]);return R.$(s,s,[-100,-100,0]),s}}function je(z,s,x){return s*(R.N/(z.tileSize*Math.pow(2,x-z.tileID.overscaledZ)))}class Ue{constructor(s,x,I,k){this.opacity=s?Math.max(0,Math.min(1,s.opacity+(s.placed?x:-x))):k&&I?1:0,this.placed=I}isHidden(){return this.opacity===0&&!this.placed}}class Ae{constructor(s,x,I,k,H){this.text=new Ue(s?s.text:null,x,I,H),this.icon=new Ue(s?s.icon:null,x,k,H)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Je{constructor(s,x,I){this.text=s,this.icon=x,this.skipFade=I}}class wt{constructor(){this.invProjMatrix=R.Z(),this.viewportMatrix=R.Z(),this.circles=[]}}class Ht{constructor(s,x,I,k,H){this.bucketInstanceId=s,this.featureIndex=x,this.sourceLayerIndex=I,this.bucketIndex=k,this.tileID=H}}class Fr{constructor(s){this.crossSourceCollisions=s,this.maxGroupID=0,this.collisionGroups={}}get(s){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[s]){const x=++this.maxGroupID;this.collisionGroups[s]={ID:x,predicate:I=>I.collisionGroupID===x}}return this.collisionGroups[s]}}function mr(z,s,x,I,k){const{horizontalAlign:H,verticalAlign:ee}=R.au(z);return new R.P(-(H-.5)*s+I[0]*k,-(ee-.5)*x+I[1]*k)}function Sr(z,s,x,I,k,H){const{x1:ee,x2:ne,y1:ue,y2:_e,anchorPointX:h,anchorPointY:g}=z,d=new R.P(s,x);return I&&d._rotate(k?H:-H),{x1:ee+d.x,y1:ue+d.y,x2:ne+d.x,y2:_e+d.y,anchorPointX:h,anchorPointY:g}}class fn{constructor(s,x,I,k,H){this.transform=s.clone(),this.terrain=x,this.collisionIndex=new ze(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=I,this.retainedQueryData={},this.collisionGroups=new Fr(k),this.collisionCircleArrays={},this.prevPlacement=H,H&&(H.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(s,x,I,k){const H=I.getBucket(x),ee=I.latestFeatureIndex;if(!H||!ee||x.id!==H.layerIds[0])return;const ne=I.collisionBoxArray,ue=H.layers[0].layout,_e=Math.pow(2,this.transform.zoom-I.tileID.overscaledZ),h=I.tileSize/R.N,g=this.transform.calculatePosMatrix(I.tileID.toUnwrapped()),d=ue.get("text-pitch-alignment")==="map",b=ue.get("text-rotation-alignment")==="map",B=je(I,1,this.transform.zoom),G=un(g,d,b,this.transform,B);let q=null;if(d){const fe=To(g,d,b,this.transform,B);q=R.a1([],this.transform.labelPlaneMatrix,fe)}this.retainedQueryData[H.bucketInstanceId]=new Ht(H.bucketInstanceId,ee,H.sourceLayerIndex,H.index,I.tileID);const te={bucket:H,layout:ue,posMatrix:g,textLabelPlaneMatrix:G,labelToScreenMatrix:q,scale:_e,textPixelRatio:h,holdingForFade:I.holdingForFade(),collisionBoxArray:ne,partiallyEvaluatedTextSize:R.ah(H.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(H.sourceID)};if(k)for(const fe of H.sortKeyRanges){const{sortKey:ce,symbolInstanceStart:Te,symbolInstanceEnd:Ie}=fe;s.push({sortKey:ce,symbolInstanceStart:Te,symbolInstanceEnd:Ie,parameters:te})}else s.push({symbolInstanceStart:0,symbolInstanceEnd:H.symbolInstances.length,parameters:te})}attemptAnchorPlacement(s,x,I,k,H,ee,ne,ue,_e,h,g,d,b,B,G,q){const te=R.aq[s.textAnchor],fe=[s.textOffset0,s.textOffset1],ce=mr(te,I,k,fe,H),Te=this.collisionIndex.placeCollisionBox(Sr(x,ce.x,ce.y,ee,ne,this.transform.angle),g,ue,_e,h.predicate,q);if((!G||this.collisionIndex.placeCollisionBox(Sr(G,ce.x,ce.y,ee,ne,this.transform.angle),g,ue,_e,h.predicate,q).box.length!==0)&&Te.box.length>0){let Ie;if(this.prevPlacement&&this.prevPlacement.variableOffsets[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID].text&&(Ie=this.prevPlacement.variableOffsets[d.crossTileID].anchor),d.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[d.crossTileID]={textOffset:fe,width:I,height:k,anchor:te,textBoxScale:H,prevAnchor:Ie},this.markUsedJustification(b,te,d,B),b.allowVerticalPlacement&&(this.markUsedOrientation(b,B,d),this.placedOrientations[d.crossTileID]=B),{shift:ce,placedGlyphBoxes:Te}}}placeLayerBucketPart(s,x,I){const{bucket:k,layout:H,posMatrix:ee,textLabelPlaneMatrix:ne,labelToScreenMatrix:ue,textPixelRatio:_e,holdingForFade:h,collisionBoxArray:g,partiallyEvaluatedTextSize:d,collisionGroup:b}=s.parameters,B=H.get("text-optional"),G=H.get("icon-optional"),q=R.ar(H,"text-overlap","text-allow-overlap"),te=q==="always",fe=R.ar(H,"icon-overlap","icon-allow-overlap"),ce=fe==="always",Te=H.get("text-rotation-alignment")==="map",Ie=H.get("text-pitch-alignment")==="map",Oe=H.get("icon-text-fit")!=="none",Qe=H.get("symbol-z-order")==="viewport-y",nt=te&&(ce||!k.hasIconData()||G),ct=ce&&(te||!k.hasTextData()||B);!k.collisionArrays&&g&&k.deserializeCollisionBoxes(g);const tt=this.retainedQueryData[k.bucketInstanceId].tileID,Tt=this.terrain?(Nt,pr)=>this.terrain.getElevation(tt,Nt,pr):null,Ut=(Nt,pr)=>{var tr,Dr;if(x[Nt.crossTileID])return;if(h)return void(this.placements[Nt.crossTileID]=new Je(!1,!1,!1));let Hr=!1,sn=!1,nn=!0,Gn=null,di={box:null,offscreen:null},Di={box:null,offscreen:null},Ui=null,ho=null,gi=null,Wi=0,Ko=0,Mo=0;pr.textFeatureIndex?Wi=pr.textFeatureIndex:Nt.useRuntimeCollisionCircles&&(Wi=Nt.featureIndex),pr.verticalTextFeatureIndex&&(Ko=pr.verticalTextFeatureIndex);const mo=pr.textBox;if(mo){const qi=ts=>{let ja=R.ai.horizontal;if(k.allowVerticalPlacement&&!ts&&this.prevPlacement){const $a=this.prevPlacement.placedOrientations[Nt.crossTileID];$a&&(this.placedOrientations[Nt.crossTileID]=$a,ja=$a,this.markUsedOrientation(k,ja,Nt))}return ja},xs=(ts,ja)=>{if(k.allowVerticalPlacement&&Nt.numVerticalGlyphVertices>0&&pr.verticalTextBox){for(const $a of k.writingModes)if($a===R.ai.vertical?(di=ja(),Di=di):di=ts(),di&&di.box&&di.box.length)break}else di=ts()},gs=Nt.textAnchorOffsetStartIndex,Cl=Nt.textAnchorOffsetEndIndex;if(Cl===gs){const ts=(ja,$a)=>{const vs=this.collisionIndex.placeCollisionBox(ja,q,_e,ee,b.predicate,Tt);return vs&&vs.box&&vs.box.length&&(this.markUsedOrientation(k,$a,Nt),this.placedOrientations[Nt.crossTileID]=$a),vs};xs(()=>ts(mo,R.ai.horizontal),()=>{const ja=pr.verticalTextBox;return k.allowVerticalPlacement&&Nt.numVerticalGlyphVertices>0&&ja?ts(ja,R.ai.vertical):{box:null,offscreen:null}}),qi(di&&di.box&&di.box.length)}else{let ts=R.aq[(Dr=(tr=this.prevPlacement)===null||tr===void 0?void 0:tr.variableOffsets[Nt.crossTileID])===null||Dr===void 0?void 0:Dr.anchor];const ja=(vs,Zl,zu)=>{const Uu=vs.x2-vs.x1,hh=vs.y2-vs.y1,Yc=Nt.textBoxScale,np=Oe&&fe==="never"?Zl:null;let pu={box:[],offscreen:!1},Tu=q==="never"?1:2,Zu="never";ts&&Tu++;for(let Dl=0;Dl<Tu;Dl++){for(let Vl=gs;Vl<Cl;Vl++){const Uh=k.textAnchorOffsets.get(Vl);if(ts&&Uh.textAnchor!==ts)continue;const ml=this.attemptAnchorPlacement(Uh,vs,Uu,hh,Yc,Te,Ie,_e,ee,b,Zu,Nt,k,zu,np,Tt);if(ml&&(pu=ml.placedGlyphBoxes,pu&&pu.box&&pu.box.length))return Hr=!0,Gn=ml.shift,pu}ts?ts=null:Zu=q}return pu};xs(()=>ja(mo,pr.iconBox,R.ai.horizontal),()=>{const vs=pr.verticalTextBox;return k.allowVerticalPlacement&&!(di&&di.box&&di.box.length)&&Nt.numVerticalGlyphVertices>0&&vs?ja(vs,pr.verticalIconBox,R.ai.vertical):{box:null,offscreen:null}}),di&&(Hr=di.box,nn=di.offscreen);const $a=qi(di&&di.box);if(!Hr&&this.prevPlacement){const vs=this.prevPlacement.variableOffsets[Nt.crossTileID];vs&&(this.variableOffsets[Nt.crossTileID]=vs,this.markUsedJustification(k,vs.anchor,Nt,$a))}}}if(Ui=di,Hr=Ui&&Ui.box&&Ui.box.length>0,nn=Ui&&Ui.offscreen,Nt.useRuntimeCollisionCircles){const qi=k.text.placedSymbolArray.get(Nt.centerJustifiedTextSymbolIndex),xs=R.aj(k.textSizeData,d,qi),gs=H.get("text-padding");ho=this.collisionIndex.placeCollisionCircles(q,qi,k.lineVertexArray,k.glyphOffsetArray,xs,ee,ne,ue,I,Ie,b.predicate,Nt.collisionCircleDiameter,gs,Tt),ho.circles.length&&ho.collisionDetected&&!I&&R.w("Collisions detected, but collision boxes are not shown"),Hr=te||ho.circles.length>0&&!ho.collisionDetected,nn=nn&&ho.offscreen}if(pr.iconFeatureIndex&&(Mo=pr.iconFeatureIndex),pr.iconBox){const qi=xs=>{const gs=Oe&&Gn?Sr(xs,Gn.x,Gn.y,Te,Ie,this.transform.angle):xs;return this.collisionIndex.placeCollisionBox(gs,fe,_e,ee,b.predicate,Tt)};Di&&Di.box&&Di.box.length&&pr.verticalIconBox?(gi=qi(pr.verticalIconBox),sn=gi.box.length>0):(gi=qi(pr.iconBox),sn=gi.box.length>0),nn=nn&&gi.offscreen}const ko=B||Nt.numHorizontalGlyphVertices===0&&Nt.numVerticalGlyphVertices===0,xo=G||Nt.numIconVertices===0;if(ko||xo?xo?ko||(sn=sn&&Hr):Hr=sn&&Hr:sn=Hr=sn&&Hr,Hr&&Ui&&Ui.box&&this.collisionIndex.insertCollisionBox(Ui.box,q,H.get("text-ignore-placement"),k.bucketInstanceId,Di&&Di.box&&Ko?Ko:Wi,b.ID),sn&&gi&&this.collisionIndex.insertCollisionBox(gi.box,fe,H.get("icon-ignore-placement"),k.bucketInstanceId,Mo,b.ID),ho&&(Hr&&this.collisionIndex.insertCollisionCircles(ho.circles,q,H.get("text-ignore-placement"),k.bucketInstanceId,Wi,b.ID),I)){const qi=k.bucketInstanceId;let xs=this.collisionCircleArrays[qi];xs===void 0&&(xs=this.collisionCircleArrays[qi]=new wt);for(let gs=0;gs<ho.circles.length;gs+=4)xs.circles.push(ho.circles[gs+0]),xs.circles.push(ho.circles[gs+1]),xs.circles.push(ho.circles[gs+2]),xs.circles.push(ho.collisionDetected?1:0)}if(Nt.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(k.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Nt.crossTileID]=new Je(Hr||nt,sn||ct,nn||k.justReloaded),x[Nt.crossTileID]=!0};if(Qe){if(s.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const Nt=k.getSortedSymbolIndexes(this.transform.angle);for(let pr=Nt.length-1;pr>=0;--pr){const tr=Nt[pr];Ut(k.symbolInstances.get(tr),k.collisionArrays[tr])}}else for(let Nt=s.symbolInstanceStart;Nt<s.symbolInstanceEnd;Nt++)Ut(k.symbolInstances.get(Nt),k.collisionArrays[Nt]);if(I&&k.bucketInstanceId in this.collisionCircleArrays){const Nt=this.collisionCircleArrays[k.bucketInstanceId];R.as(Nt.invProjMatrix,ee),Nt.viewportMatrix=this.collisionIndex.getViewportMatrix()}k.justReloaded=!1}markUsedJustification(s,x,I,k){let H;H=k===R.ai.vertical?I.verticalPlacedTextSymbolIndex:{left:I.leftJustifiedTextSymbolIndex,center:I.centerJustifiedTextSymbolIndex,right:I.rightJustifiedTextSymbolIndex}[R.at(x)];const ee=[I.leftJustifiedTextSymbolIndex,I.centerJustifiedTextSymbolIndex,I.rightJustifiedTextSymbolIndex,I.verticalPlacedTextSymbolIndex];for(const ne of ee)ne>=0&&(s.text.placedSymbolArray.get(ne).crossTileID=H>=0&&ne!==H?0:I.crossTileID)}markUsedOrientation(s,x,I){const k=x===R.ai.horizontal||x===R.ai.horizontalOnly?x:0,H=x===R.ai.vertical?x:0,ee=[I.leftJustifiedTextSymbolIndex,I.centerJustifiedTextSymbolIndex,I.rightJustifiedTextSymbolIndex];for(const ne of ee)s.text.placedSymbolArray.get(ne).placedOrientation=k;I.verticalPlacedTextSymbolIndex&&(s.text.placedSymbolArray.get(I.verticalPlacedTextSymbolIndex).placedOrientation=H)}commit(s){this.commitTime=s,this.zoomAtLastRecencyCheck=this.transform.zoom;const x=this.prevPlacement;let I=!1;this.prevZoomAdjustment=x?x.zoomAdjustment(this.transform.zoom):0;const k=x?x.symbolFadeChange(s):1,H=x?x.opacities:{},ee=x?x.variableOffsets:{},ne=x?x.placedOrientations:{};for(const ue in this.placements){const _e=this.placements[ue],h=H[ue];h?(this.opacities[ue]=new Ae(h,k,_e.text,_e.icon),I=I||_e.text!==h.text.placed||_e.icon!==h.icon.placed):(this.opacities[ue]=new Ae(null,k,_e.text,_e.icon,_e.skipFade),I=I||_e.text||_e.icon)}for(const ue in H){const _e=H[ue];if(!this.opacities[ue]){const h=new Ae(_e,k,!1,!1);h.isHidden()||(this.opacities[ue]=h,I=I||_e.text.placed||_e.icon.placed)}}for(const ue in ee)this.variableOffsets[ue]||!this.opacities[ue]||this.opacities[ue].isHidden()||(this.variableOffsets[ue]=ee[ue]);for(const ue in ne)this.placedOrientations[ue]||!this.opacities[ue]||this.opacities[ue].isHidden()||(this.placedOrientations[ue]=ne[ue]);if(x&&x.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");I?this.lastPlacementChangeTime=s:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=x?x.lastPlacementChangeTime:s)}updateLayerOpacities(s,x){const I={};for(const k of x){const H=k.getBucket(s);H&&k.latestFeatureIndex&&s.id===H.layerIds[0]&&this.updateBucketOpacities(H,I,k.collisionBoxArray)}}updateBucketOpacities(s,x,I){s.hasTextData()&&(s.text.opacityVertexArray.clear(),s.text.hasVisibleVertices=!1),s.hasIconData()&&(s.icon.opacityVertexArray.clear(),s.icon.hasVisibleVertices=!1),s.hasIconCollisionBoxData()&&s.iconCollisionBox.collisionVertexArray.clear(),s.hasTextCollisionBoxData()&&s.textCollisionBox.collisionVertexArray.clear();const k=s.layers[0],H=k.layout,ee=new Ae(null,0,!1,!1,!0),ne=H.get("text-allow-overlap"),ue=H.get("icon-allow-overlap"),_e=k._unevaluatedLayout.hasValue("text-variable-anchor")||k._unevaluatedLayout.hasValue("text-variable-anchor-offset"),h=H.get("text-rotation-alignment")==="map",g=H.get("text-pitch-alignment")==="map",d=H.get("icon-text-fit")!=="none",b=new Ae(null,0,ne&&(ue||!s.hasIconData()||H.get("icon-optional")),ue&&(ne||!s.hasTextData()||H.get("text-optional")),!0);!s.collisionArrays&&I&&(s.hasIconCollisionBoxData()||s.hasTextCollisionBoxData())&&s.deserializeCollisionBoxes(I);const B=(G,q,te)=>{for(let fe=0;fe<q/4;fe++)G.opacityVertexArray.emplaceBack(te);G.hasVisibleVertices=G.hasVisibleVertices||te!==Ho};for(let G=0;G<s.symbolInstances.length;G++){const q=s.symbolInstances.get(G),{numHorizontalGlyphVertices:te,numVerticalGlyphVertices:fe,crossTileID:ce}=q;let Te=this.opacities[ce];x[ce]?Te=ee:Te||(Te=b,this.opacities[ce]=Te),x[ce]=!0;const Ie=q.numIconVertices>0,Oe=this.placedOrientations[q.crossTileID],Qe=Oe===R.ai.vertical,nt=Oe===R.ai.horizontal||Oe===R.ai.horizontalOnly;if(te>0||fe>0){const ct=ia(Te.text);B(s.text,te,Qe?Ho:ct),B(s.text,fe,nt?Ho:ct);const tt=Te.text.isHidden();[q.rightJustifiedTextSymbolIndex,q.centerJustifiedTextSymbolIndex,q.leftJustifiedTextSymbolIndex].forEach(Nt=>{Nt>=0&&(s.text.placedSymbolArray.get(Nt).hidden=tt||Qe?1:0)}),q.verticalPlacedTextSymbolIndex>=0&&(s.text.placedSymbolArray.get(q.verticalPlacedTextSymbolIndex).hidden=tt||nt?1:0);const Tt=this.variableOffsets[q.crossTileID];Tt&&this.markUsedJustification(s,Tt.anchor,q,Oe);const Ut=this.placedOrientations[q.crossTileID];Ut&&(this.markUsedJustification(s,"left",q,Ut),this.markUsedOrientation(s,Ut,q))}if(Ie){const ct=ia(Te.icon),tt=!(d&&q.verticalPlacedIconSymbolIndex&&Qe);q.placedIconSymbolIndex>=0&&(B(s.icon,q.numIconVertices,tt?ct:Ho),s.icon.placedSymbolArray.get(q.placedIconSymbolIndex).hidden=Te.icon.isHidden()),q.verticalPlacedIconSymbolIndex>=0&&(B(s.icon,q.numVerticalIconVertices,tt?Ho:ct),s.icon.placedSymbolArray.get(q.verticalPlacedIconSymbolIndex).hidden=Te.icon.isHidden())}if(s.hasIconCollisionBoxData()||s.hasTextCollisionBoxData()){const ct=s.collisionArrays[G];if(ct){let tt=new R.P(0,0);if(ct.textBox||ct.verticalTextBox){let Ut=!0;if(_e){const Nt=this.variableOffsets[ce];Nt?(tt=mr(Nt.anchor,Nt.width,Nt.height,Nt.textOffset,Nt.textBoxScale),h&&tt._rotate(g?this.transform.angle:-this.transform.angle)):Ut=!1}ct.textBox&&xn(s.textCollisionBox.collisionVertexArray,Te.text.placed,!Ut||Qe,tt.x,tt.y),ct.verticalTextBox&&xn(s.textCollisionBox.collisionVertexArray,Te.text.placed,!Ut||nt,tt.x,tt.y)}const Tt=!!(!nt&&ct.verticalIconBox);ct.iconBox&&xn(s.iconCollisionBox.collisionVertexArray,Te.icon.placed,Tt,d?tt.x:0,d?tt.y:0),ct.verticalIconBox&&xn(s.iconCollisionBox.collisionVertexArray,Te.icon.placed,!Tt,d?tt.x:0,d?tt.y:0)}}}if(s.sortFeatures(this.transform.angle),this.retainedQueryData[s.bucketInstanceId]&&(this.retainedQueryData[s.bucketInstanceId].featureSortOrder=s.featureSortOrder),s.hasTextData()&&s.text.opacityVertexBuffer&&s.text.opacityVertexBuffer.updateData(s.text.opacityVertexArray),s.hasIconData()&&s.icon.opacityVertexBuffer&&s.icon.opacityVertexBuffer.updateData(s.icon.opacityVertexArray),s.hasIconCollisionBoxData()&&s.iconCollisionBox.collisionVertexBuffer&&s.iconCollisionBox.collisionVertexBuffer.updateData(s.iconCollisionBox.collisionVertexArray),s.hasTextCollisionBoxData()&&s.textCollisionBox.collisionVertexBuffer&&s.textCollisionBox.collisionVertexBuffer.updateData(s.textCollisionBox.collisionVertexArray),s.text.opacityVertexArray.length!==s.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${s.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${s.text.layoutVertexArray.length}) / 4`);if(s.icon.opacityVertexArray.length!==s.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${s.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${s.icon.layoutVertexArray.length}) / 4`);if(s.bucketInstanceId in this.collisionCircleArrays){const G=this.collisionCircleArrays[s.bucketInstanceId];s.placementInvProjMatrix=G.invProjMatrix,s.placementViewportMatrix=G.viewportMatrix,s.collisionCircleArray=G.circles,delete this.collisionCircleArrays[s.bucketInstanceId]}}symbolFadeChange(s){return this.fadeDuration===0?1:(s-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(s){return Math.max(0,(this.transform.zoom-s)/1.5)}hasTransitions(s){return this.stale||s-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(s,x){const I=this.zoomAtLastRecencyCheck===x?1-this.zoomAdjustment(x):1;return this.zoomAtLastRecencyCheck=x,this.commitTime+this.fadeDuration*I>s}setStale(){this.stale=!0}}function xn(z,s,x,I,k){z.emplaceBack(s?1:0,x?1:0,I||0,k||0),z.emplaceBack(s?1:0,x?1:0,I||0,k||0),z.emplaceBack(s?1:0,x?1:0,I||0,k||0),z.emplaceBack(s?1:0,x?1:0,I||0,k||0)}const Lr=Math.pow(2,25),Nn=Math.pow(2,24),bn=Math.pow(2,17),En=Math.pow(2,16),io=Math.pow(2,9),On=Math.pow(2,8),Ao=Math.pow(2,1);function ia(z){if(z.opacity===0&&!z.placed)return 0;if(z.opacity===1&&z.placed)return 4294967295;const s=z.placed?1:0,x=Math.floor(127*z.opacity);return x*Lr+s*Nn+x*bn+s*En+x*io+s*On+x*Ao+s}const Ho=0;class Ga{constructor(s){this._sortAcrossTiles=s.layout.get("symbol-z-order")!=="viewport-y"&&!s.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(s,x,I,k,H){const ee=this._bucketParts;for(;this._currentTileIndex<s.length;)if(x.getBucketParts(ee,k,s[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,H())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,ee.sort((ne,ue)=>ne.sortKey-ue.sortKey));this._currentPartIndex<ee.length;)if(x.placeLayerBucketPart(ee[this._currentPartIndex],this._seenCrossTileIDs,I),this._currentPartIndex++,H())return!0;return!1}}class Wo{constructor(s,x,I,k,H,ee,ne,ue){this.placement=new fn(s,x,ee,ne,ue),this._currentPlacementIndex=I.length-1,this._forceFullPlacement=k,this._showCollisionBoxes=H,this._done=!1}isDone(){return this._done}continuePlacement(s,x,I){const k=R.h.now(),H=()=>!this._forceFullPlacement&&R.h.now()-k>2;for(;this._currentPlacementIndex>=0;){const ee=x[s[this._currentPlacementIndex]],ne=this.placement.collisionIndex.transform.zoom;if(ee.type==="symbol"&&(!ee.minzoom||ee.minzoom<=ne)&&(!ee.maxzoom||ee.maxzoom>ne)){if(this._inProgressLayer||(this._inProgressLayer=new Ga(ee)),this._inProgressLayer.continuePlacement(I[ee.source],this.placement,this._showCollisionBoxes,ee,H))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(s){return this.placement.commit(s),this.placement}}const Hl=512/R.N/2;class ns{constructor(s,x,I){this.tileID=s,this.bucketInstanceId=I,this._symbolsByKey={};const k=new Map;for(let H=0;H<x.length;H++){const ee=x.get(H),ne=ee.key,ue=k.get(ne);ue?ue.push(ee):k.set(ne,[ee])}for(const[H,ee]of k){const ne={positions:ee.map(ue=>({x:Math.floor(ue.anchorX*Hl),y:Math.floor(ue.anchorY*Hl)})),crossTileIDs:ee.map(ue=>ue.crossTileID)};if(ne.positions.length>128){const ue=new R.av(ne.positions.length,16,Uint16Array);for(const{x:_e,y:h}of ne.positions)ue.add(_e,h);ue.finish(),delete ne.positions,ne.index=ue}this._symbolsByKey[H]=ne}}getScaledCoordinates(s,x){const{x:I,y:k,z:H}=this.tileID.canonical,{x:ee,y:ne,z:ue}=x.canonical,_e=Hl/Math.pow(2,ue-H),h=(ne*R.N+s.anchorY)*_e,g=k*R.N*Hl;return{x:Math.floor((ee*R.N+s.anchorX)*_e-I*R.N*Hl),y:Math.floor(h-g)}}findMatches(s,x,I){const k=this.tileID.canonical.z<x.canonical.z?1:Math.pow(2,this.tileID.canonical.z-x.canonical.z);for(let H=0;H<s.length;H++){const ee=s.get(H);if(ee.crossTileID)continue;const ne=this._symbolsByKey[ee.key];if(!ne)continue;const ue=this.getScaledCoordinates(ee,x);if(ne.index){const _e=ne.index.range(ue.x-k,ue.y-k,ue.x+k,ue.y+k).sort();for(const h of _e){const g=ne.crossTileIDs[h];if(!I[g]){I[g]=!0,ee.crossTileID=g;break}}}else if(ne.positions)for(let _e=0;_e<ne.positions.length;_e++){const h=ne.positions[_e],g=ne.crossTileIDs[_e];if(Math.abs(h.x-ue.x)<=k&&Math.abs(h.y-ue.y)<=k&&!I[g]){I[g]=!0,ee.crossTileID=g;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:s})=>s)}}class Yo{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class _a{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(s){const x=Math.round((s-this.lng)/360);if(x!==0)for(const I in this.indexes){const k=this.indexes[I],H={};for(const ee in k){const ne=k[ee];ne.tileID=ne.tileID.unwrapTo(ne.tileID.wrap+x),H[ne.tileID.key]=ne}this.indexes[I]=H}this.lng=s}addBucket(s,x,I){if(this.indexes[s.overscaledZ]&&this.indexes[s.overscaledZ][s.key]){if(this.indexes[s.overscaledZ][s.key].bucketInstanceId===x.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(s.overscaledZ,this.indexes[s.overscaledZ][s.key])}for(let H=0;H<x.symbolInstances.length;H++)x.symbolInstances.get(H).crossTileID=0;this.usedCrossTileIDs[s.overscaledZ]||(this.usedCrossTileIDs[s.overscaledZ]={});const k=this.usedCrossTileIDs[s.overscaledZ];for(const H in this.indexes){const ee=this.indexes[H];if(Number(H)>s.overscaledZ)for(const ne in ee){const ue=ee[ne];ue.tileID.isChildOf(s)&&ue.findMatches(x.symbolInstances,s,k)}else{const ne=ee[s.scaledTo(Number(H)).key];ne&&ne.findMatches(x.symbolInstances,s,k)}}for(let H=0;H<x.symbolInstances.length;H++){const ee=x.symbolInstances.get(H);ee.crossTileID||(ee.crossTileID=I.generate(),k[ee.crossTileID]=!0)}return this.indexes[s.overscaledZ]===void 0&&(this.indexes[s.overscaledZ]={}),this.indexes[s.overscaledZ][s.key]=new ns(s,x.symbolInstances,x.bucketInstanceId),!0}removeBucketCrossTileIDs(s,x){for(const I of x.getCrossTileIDsLists())for(const k of I)delete this.usedCrossTileIDs[s][k]}removeStaleBuckets(s){let x=!1;for(const I in this.indexes){const k=this.indexes[I];for(const H in k)s[k[H].bucketInstanceId]||(this.removeBucketCrossTileIDs(I,k[H]),delete k[H],x=!0)}return x}}class $o{constructor(){this.layerIndexes={},this.crossTileIDs=new Yo,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(s,x,I){let k=this.layerIndexes[s.id];k===void 0&&(k=this.layerIndexes[s.id]=new _a);let H=!1;const ee={};k.handleWrapJump(I);for(const ne of x){const ue=ne.getBucket(s);ue&&s.id===ue.layerIds[0]&&(ue.bucketInstanceId||(ue.bucketInstanceId=++this.maxBucketInstanceId),k.addBucket(ne.tileID,ue,this.crossTileIDs)&&(H=!0),ee[ue.bucketInstanceId]=!0)}return k.removeStaleBuckets(ee)&&(H=!0),H}pruneUnusedLayers(s){const x={};s.forEach(I=>{x[I]=!0});for(const I in this.layerIndexes)x[I]||delete this.layerIndexes[I]}}const Fo=(z,s)=>R.x(z,s&&s.filter(x=>x.identifier!=="source.canvas")),us=R.F(R.ax,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),xc=R.F(R.ax,["setCenter","setZoom","setBearing","setPitch"]),Ba=R.aw();class Fa extends R.E{constructor(s,x={}){super(),this.map=s,this.dispatcher=new rr(Wr(),this,s._getMapId()),this.imageManager=new Jr,this.imageManager.setEventedParent(this),this.glyphManager=new qe(s._requestManager,x.localIdeographFontFamily),this.lineAtlas=new vt(256,512),this.crossTileSymbolIndex=new $o,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new R.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",R.az());const I=this;this._rtlTextPluginCallback=Fa.registerForPluginStateChange(k=>{I.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:k.pluginStatus,pluginURL:k.pluginURL},(H,ee)=>{if(R.aA(H),ee&&ee.every(ne=>ne))for(const ne in I.sourceCaches){const ue=I.sourceCaches[ne].getSource().type;ue!=="vector"&&ue!=="geojson"||I.sourceCaches[ne].reload()}})}),this.on("data",k=>{if(k.dataType!=="source"||k.sourceDataType!=="metadata")return;const H=this.sourceCaches[k.sourceId];if(!H)return;const ee=H.getSource();if(ee&&ee.vectorLayerIds)for(const ne in this._layers){const ue=this._layers[ne];ue.source===ee.id&&this._validateLayer(ue)}})}loadURL(s,x={},I){this.fire(new R.k("dataloading",{dataType:"style"})),x.validate=typeof x.validate!="boolean"||x.validate;const k=this.map._requestManager.transformRequest(s,et.Style);this._request=R.f(k,(H,ee)=>{this._request=null,H?this.fire(new R.j(H)):ee&&this._load(ee,x,I)})}loadJSON(s,x={},I){this.fire(new R.k("dataloading",{dataType:"style"})),this._request=R.h.frame(()=>{this._request=null,x.validate=x.validate!==!1,this._load(s,x,I)})}loadEmpty(){this.fire(new R.k("dataloading",{dataType:"style"})),this._load(Ba,{validate:!1})}_load(s,x,I){var k;const H=x.transformStyle?x.transformStyle(I,s):s;if(!x.validate||!Fo(this,R.y(H))){this._loaded=!0,this.stylesheet=H;for(const ee in H.sources)this.addSource(ee,H.sources[ee],{validate:!1});H.sprite?this._loadSprite(H.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(H.glyphs),this._createLayers(),this.light=new Pt(this.stylesheet.light),this.map.setTerrain((k=this.stylesheet.terrain)!==null&&k!==void 0?k:null),this.fire(new R.k("data",{dataType:"style"})),this.fire(new R.k("style.load"))}}_createLayers(){const s=R.aB(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",s),this._order=s.map(x=>x.id),this._layers={},this._serializedLayers=null;for(const x of s){const I=R.aC(x);I.setEventedParent(this,{layer:{id:x.id}}),this._layers[x.id]=I}}_loadSprite(s,x=!1,I=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=function(k,H,ee,ne){const ue=ki(k),_e=ue.length,h=ee>1?"@2x":"",g={},d={},b={};for(const{id:B,url:G}of ue){const q=H.transformRequest(H.normalizeSpriteURL(G,h,".json"),et.SpriteJSON),te=`${B}_${q.url}`;g[te]=R.f(q,(Te,Ie)=>{delete g[te],d[B]=Ie,pa(ne,d,b,Te,_e)});const fe=H.transformRequest(H.normalizeSpriteURL(G,h,".png"),et.SpriteImage),ce=`${B}_${fe.url}`;g[ce]=Ve.getImage(fe,(Te,Ie)=>{delete g[ce],b[B]=Ie,pa(ne,d,b,Te,_e)})}return{cancel(){for(const B of Object.values(g))B.cancel()}}}(s,this.map._requestManager,this.map.getPixelRatio(),(k,H)=>{if(this._spriteRequest=null,k)this.fire(new R.j(k));else if(H)for(const ee in H){this._spritesImagesIds[ee]=[];const ne=this._spritesImagesIds[ee]?this._spritesImagesIds[ee].filter(ue=>!(ue in H)):[];for(const ue of ne)this.imageManager.removeImage(ue),this._changedImages[ue]=!0;for(const ue in H[ee]){const _e=ee==="default"?ue:`${ee}:${ue}`;this._spritesImagesIds[ee].push(_e),_e in this.imageManager.images?this.imageManager.updateImage(_e,H[ee][ue],!1):this.imageManager.addImage(_e,H[ee][ue]),x&&(this._changedImages[_e]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),x&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new R.k("data",{dataType:"style"})),I&&I(k)})}_unloadSprite(){for(const s of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(s),this._changedImages[s]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new R.k("data",{dataType:"style"}))}_validateLayer(s){const x=this.sourceCaches[s.source];if(!x)return;const I=s.sourceLayer;if(!I)return;const k=x.getSource();(k.type==="geojson"||k.vectorLayerIds&&k.vectorLayerIds.indexOf(I)===-1)&&this.fire(new R.j(new Error(`Source layer "${I}" does not exist on source "${k.id}" as specified by style layer "${s.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const s in this.sourceCaches)if(!this.sourceCaches[s].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(s){const x=this._serializedAllLayers();if(!s||s.length===0)return Object.values(x);const I=[];for(const k of s)x[k]&&I.push(x[k]);return I}_serializedAllLayers(){let s=this._serializedLayers;if(s)return s;s=this._serializedLayers={};const x=Object.keys(this._layers);for(const I of x){const k=this._layers[I];k.type!=="custom"&&(s[I]=k.serialize())}return s}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const s in this.sourceCaches)if(this.sourceCaches[s].hasTransition())return!0;for(const s in this._layers)if(this._layers[s].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(s){if(!this._loaded)return;const x=this._changed;if(this._changed){const k=Object.keys(this._updatedLayers),H=Object.keys(this._removedLayers);(k.length||H.length)&&this._updateWorkerLayers(k,H);for(const ee in this._updatedSources){const ne=this._updatedSources[ee];if(ne==="reload")this._reloadSource(ee);else{if(ne!=="clear")throw new Error(`Invalid action ${ne}`);this._clearSource(ee)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const ee in this._updatedPaintProps)this._layers[ee].updateTransitions(s);this.light.updateTransitions(s),this._resetUpdates()}const I={};for(const k in this.sourceCaches){const H=this.sourceCaches[k];I[k]=H.used,H.used=!1}for(const k of this._order){const H=this._layers[k];H.recalculate(s,this._availableImages),!H.isHidden(s.zoom)&&H.source&&(this.sourceCaches[H.source].used=!0)}for(const k in I){const H=this.sourceCaches[k];I[k]!==H.used&&H.fire(new R.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:k}))}this.light.recalculate(s),this.z=s.zoom,x&&this.fire(new R.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const s=Object.keys(this._changedImages);if(s.length){for(const x in this.sourceCaches)this.sourceCaches[x].reloadTilesForDependencies(["icons","patterns"],s);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(s,x){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(s),removedIds:x})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(s,x={}){this._checkLoaded();const I=this.serialize();if(s=x.transformStyle?x.transformStyle(I,s):s,Fo(this,R.y(s)))return!1;(s=R.aD(s)).layers=R.aB(s.layers);const k=R.aE(I,s).filter(ee=>!(ee.command in xc));if(k.length===0)return!1;const H=k.filter(ee=>!(ee.command in us));if(H.length>0)throw new Error(`Unimplemented: ${H.map(ee=>ee.command).join(", ")}.`);for(const ee of k)ee.command!=="setTransition"&&this[ee.command].apply(this,ee.args);return this.stylesheet=s,this._serializedLayers=null,!0}addImage(s,x){if(this.getImage(s))return this.fire(new R.j(new Error(`An image named "${s}" already exists.`)));this.imageManager.addImage(s,x),this._afterImageUpdated(s)}updateImage(s,x){this.imageManager.updateImage(s,x)}getImage(s){return this.imageManager.getImage(s)}removeImage(s){if(!this.getImage(s))return this.fire(new R.j(new Error(`An image named "${s}" does not exist.`)));this.imageManager.removeImage(s),this._afterImageUpdated(s)}_afterImageUpdated(s){this._availableImages=this.imageManager.listImages(),this._changedImages[s]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new R.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(s,x,I={}){if(this._checkLoaded(),this.sourceCaches[s]!==void 0)throw new Error(`Source "${s}" already exists.`);if(!x.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(x).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(x.type)>=0&&this._validate(R.y.source,`sources.${s}`,x,null,I))return;this.map&&this.map._collectResourceTiming&&(x.collectResourceTiming=!0);const k=this.sourceCaches[s]=new ls(s,x,this.dispatcher);k.style=this,k.setEventedParent(this,()=>({isSourceLoaded:k.loaded(),source:k.serialize(),sourceId:s})),k.onAdd(this.map),this._changed=!0}removeSource(s){if(this._checkLoaded(),this.sourceCaches[s]===void 0)throw new Error("There is no source with this ID");for(const I in this._layers)if(this._layers[I].source===s)return this.fire(new R.j(new Error(`Source "${s}" cannot be removed while layer "${I}" is using it.`)));const x=this.sourceCaches[s];delete this.sourceCaches[s],delete this._updatedSources[s],x.fire(new R.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:s})),x.setEventedParent(null),x.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(s,x){if(this._checkLoaded(),this.sourceCaches[s]===void 0)throw new Error(`There is no source with this ID=${s}`);const I=this.sourceCaches[s].getSource();if(I.type!=="geojson")throw new Error(`geojsonSource.type is ${I.type}, which is !== 'geojson`);I.setData(x),this._changed=!0}getSource(s){return this.sourceCaches[s]&&this.sourceCaches[s].getSource()}addLayer(s,x,I={}){this._checkLoaded();const k=s.id;if(this.getLayer(k))return void this.fire(new R.j(new Error(`Layer "${k}" already exists on this map.`)));let H;if(s.type==="custom"){if(Fo(this,R.aF(s)))return;H=R.aC(s)}else{if("source"in s&&typeof s.source=="object"&&(this.addSource(k,s.source),s=R.aD(s),s=R.e(s,{source:k})),this._validate(R.y.layer,`layers.${k}`,s,{arrayIndex:-1},I))return;H=R.aC(s),this._validateLayer(H),H.setEventedParent(this,{layer:{id:k}})}const ee=x?this._order.indexOf(x):this._order.length;if(x&&ee===-1)this.fire(new R.j(new Error(`Cannot add layer "${k}" before non-existing layer "${x}".`)));else{if(this._order.splice(ee,0,k),this._layerOrderChanged=!0,this._layers[k]=H,this._removedLayers[k]&&H.source&&H.type!=="custom"){const ne=this._removedLayers[k];delete this._removedLayers[k],ne.type!==H.type?this._updatedSources[H.source]="clear":(this._updatedSources[H.source]="reload",this.sourceCaches[H.source].pause())}this._updateLayer(H),H.onAdd&&H.onAdd(this.map)}}moveLayer(s,x){if(this._checkLoaded(),this._changed=!0,!this._layers[s])return void this.fire(new R.j(new Error(`The layer '${s}' does not exist in the map's style and cannot be moved.`)));if(s===x)return;const I=this._order.indexOf(s);this._order.splice(I,1);const k=x?this._order.indexOf(x):this._order.length;x&&k===-1?this.fire(new R.j(new Error(`Cannot move layer "${s}" before non-existing layer "${x}".`))):(this._order.splice(k,0,s),this._layerOrderChanged=!0)}removeLayer(s){this._checkLoaded();const x=this._layers[s];if(!x)return void this.fire(new R.j(new Error(`Cannot remove non-existing layer "${s}".`)));x.setEventedParent(null);const I=this._order.indexOf(s);this._order.splice(I,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[s]=x,delete this._layers[s],this._serializedLayers&&delete this._serializedLayers[s],delete this._updatedLayers[s],delete this._updatedPaintProps[s],x.onRemove&&x.onRemove(this.map)}getLayer(s){return this._layers[s]}getLayersOrder(){return[...this._order]}hasLayer(s){return s in this._layers}setLayerZoomRange(s,x,I){this._checkLoaded();const k=this.getLayer(s);k?k.minzoom===x&&k.maxzoom===I||(x!=null&&(k.minzoom=x),I!=null&&(k.maxzoom=I),this._updateLayer(k)):this.fire(new R.j(new Error(`Cannot set the zoom range of non-existing layer "${s}".`)))}setFilter(s,x,I={}){this._checkLoaded();const k=this.getLayer(s);if(k){if(!R.aG(k.filter,x))return x==null?(k.filter=void 0,void this._updateLayer(k)):void(this._validate(R.y.filter,`layers.${k.id}.filter`,x,null,I)||(k.filter=R.aD(x),this._updateLayer(k)))}else this.fire(new R.j(new Error(`Cannot filter non-existing layer "${s}".`)))}getFilter(s){return R.aD(this.getLayer(s).filter)}setLayoutProperty(s,x,I,k={}){this._checkLoaded();const H=this.getLayer(s);H?R.aG(H.getLayoutProperty(x),I)||(H.setLayoutProperty(x,I,k),this._updateLayer(H)):this.fire(new R.j(new Error(`Cannot style non-existing layer "${s}".`)))}getLayoutProperty(s,x){const I=this.getLayer(s);if(I)return I.getLayoutProperty(x);this.fire(new R.j(new Error(`Cannot get style of non-existing layer "${s}".`)))}setPaintProperty(s,x,I,k={}){this._checkLoaded();const H=this.getLayer(s);H?R.aG(H.getPaintProperty(x),I)||(H.setPaintProperty(x,I,k)&&this._updateLayer(H),this._changed=!0,this._updatedPaintProps[s]=!0):this.fire(new R.j(new Error(`Cannot style non-existing layer "${s}".`)))}getPaintProperty(s,x){return this.getLayer(s).getPaintProperty(x)}setFeatureState(s,x){this._checkLoaded();const I=s.source,k=s.sourceLayer,H=this.sourceCaches[I];if(H===void 0)return void this.fire(new R.j(new Error(`The source '${I}' does not exist in the map's style.`)));const ee=H.getSource().type;ee==="geojson"&&k?this.fire(new R.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):ee!=="vector"||k?(s.id===void 0&&this.fire(new R.j(new Error("The feature id parameter must be provided."))),H.setFeatureState(k,s.id,x)):this.fire(new R.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(s,x){this._checkLoaded();const I=s.source,k=this.sourceCaches[I];if(k===void 0)return void this.fire(new R.j(new Error(`The source '${I}' does not exist in the map's style.`)));const H=k.getSource().type,ee=H==="vector"?s.sourceLayer:void 0;H!=="vector"||ee?x&&typeof s.id!="string"&&typeof s.id!="number"?this.fire(new R.j(new Error("A feature id is required to remove its specific state property."))):k.removeFeatureState(ee,s.id,x):this.fire(new R.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(s){this._checkLoaded();const x=s.source,I=s.sourceLayer,k=this.sourceCaches[x];if(k!==void 0)return k.getSource().type!=="vector"||I?(s.id===void 0&&this.fire(new R.j(new Error("The feature id parameter must be provided."))),k.getFeatureState(I,s.id)):void this.fire(new R.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new R.j(new Error(`The source '${x}' does not exist in the map's style.`)))}getTransition(){return R.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const s=R.aH(this.sourceCaches,H=>H.serialize()),x=this._serializeByIds(this._order),I=this.map.getTerrain()||void 0,k=this.stylesheet;return R.aI({version:k.version,name:k.name,metadata:k.metadata,light:k.light,center:k.center,zoom:k.zoom,bearing:k.bearing,pitch:k.pitch,sprite:k.sprite,glyphs:k.glyphs,transition:k.transition,sources:s,layers:x,terrain:I},H=>H!==void 0)}_updateLayer(s){this._updatedLayers[s.id]=!0,s.source&&!this._updatedSources[s.source]&&this.sourceCaches[s.source].getSource().type!=="raster"&&(this._updatedSources[s.source]="reload",this.sourceCaches[s.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(s){const x=ee=>this._layers[ee].type==="fill-extrusion",I={},k=[];for(let ee=this._order.length-1;ee>=0;ee--){const ne=this._order[ee];if(x(ne)){I[ne]=ee;for(const ue of s){const _e=ue[ne];if(_e)for(const h of _e)k.push(h)}}}k.sort((ee,ne)=>ne.intersectionZ-ee.intersectionZ);const H=[];for(let ee=this._order.length-1;ee>=0;ee--){const ne=this._order[ee];if(x(ne))for(let ue=k.length-1;ue>=0;ue--){const _e=k[ue].feature;if(I[_e.layer.id]<ee)break;H.push(_e),k.pop()}else for(const ue of s){const _e=ue[ne];if(_e)for(const h of _e)H.push(h.feature)}}return H}queryRenderedFeatures(s,x,I){x&&x.filter&&this._validate(R.y.filter,"queryRenderedFeatures.filter",x.filter,null,x);const k={};if(x&&x.layers){if(!Array.isArray(x.layers))return this.fire(new R.j(new Error("parameters.layers must be an Array."))),[];for(const ne of x.layers){const ue=this._layers[ne];if(!ue)return this.fire(new R.j(new Error(`The layer '${ne}' does not exist in the map's style and cannot be queried for features.`))),[];k[ue.source]=!0}}const H=[];x.availableImages=this._availableImages;const ee=this._serializedAllLayers();for(const ne in this.sourceCaches)x.layers&&!k[ne]||H.push(Qi(this.sourceCaches[ne],this._layers,ee,s,x,I));return this.placement&&H.push(function(ne,ue,_e,h,g,d,b){const B={},G=d.queryRenderedSymbols(h),q=[];for(const te of Object.keys(G).map(Number))q.push(b[te]);q.sort(Vi);for(const te of q){const fe=te.featureIndex.lookupSymbolFeatures(G[te.bucketInstanceId],ue,te.bucketIndex,te.sourceLayerIndex,g.filter,g.layers,g.availableImages,ne);for(const ce in fe){const Te=B[ce]=B[ce]||[],Ie=fe[ce];Ie.sort((Oe,Qe)=>{const nt=te.featureSortOrder;if(nt){const ct=nt.indexOf(Oe.featureIndex);return nt.indexOf(Qe.featureIndex)-ct}return Qe.featureIndex-Oe.featureIndex});for(const Oe of Ie)Te.push(Oe)}}for(const te in B)B[te].forEach(fe=>{const ce=fe.feature,Te=_e[ne[te].source].getFeatureState(ce.layer["source-layer"],ce.id);ce.source=ce.layer.source,ce.layer["source-layer"]&&(ce.sourceLayer=ce.layer["source-layer"]),ce.state=Te});return B}(this._layers,ee,this.sourceCaches,s,x,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(H)}querySourceFeatures(s,x){x&&x.filter&&this._validate(R.y.filter,"querySourceFeatures.filter",x.filter,null,x);const I=this.sourceCaches[s];return I?function(k,H){const ee=k.getRenderableIds().map(_e=>k.getTileByID(_e)),ne=[],ue={};for(let _e=0;_e<ee.length;_e++){const h=ee[_e],g=h.tileID.canonical.key;ue[g]||(ue[g]=!0,h.querySourceFeatures(ne,H))}return ne}(I,x):[]}addSourceType(s,x,I){return qo(s)?I(new Error(`A source type called "${s}" already exists.`)):(((k,H)=>{Mi[k]=H})(s,x),x.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:s,url:x.workerSourceURL},I):I(null,null))}getLight(){return this.light.getLight()}setLight(s,x={}){this._checkLoaded();const I=this.light.getLight();let k=!1;for(const ee in s)if(!R.aG(s[ee],I[ee])){k=!0;break}if(!k)return;const H={now:R.h.now(),transition:R.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(s,x),this.light.updateTransitions(H)}_validate(s,x,I,k,H={}){return(!H||H.validate!==!1)&&Fo(this,s.call(R.y,R.e({key:x,style:this.serialize(),value:I,styleSpec:R.v},k)))}_remove(s=!0){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),R.aJ.off("pluginStateChange",this._rtlTextPluginCallback);for(const x in this._layers)this._layers[x].setEventedParent(null);for(const x in this.sourceCaches){const I=this.sourceCaches[x];I.setEventedParent(null),I.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(s)}_clearSource(s){this.sourceCaches[s].clearTiles()}_reloadSource(s){this.sourceCaches[s].resume(),this.sourceCaches[s].reload()}_updateSources(s){for(const x in this.sourceCaches)this.sourceCaches[x].update(s,this.map.terrain)}_generateCollisionBoxes(){for(const s in this.sourceCaches)this._reloadSource(s)}_updatePlacement(s,x,I,k,H=!1){let ee=!1,ne=!1;const ue={};for(const _e of this._order){const h=this._layers[_e];if(h.type!=="symbol")continue;if(!ue[h.source]){const d=this.sourceCaches[h.source];ue[h.source]=d.getRenderableIds(!0).map(b=>d.getTileByID(b)).sort((b,B)=>B.tileID.overscaledZ-b.tileID.overscaledZ||(b.tileID.isLessThan(B.tileID)?-1:1))}const g=this.crossTileSymbolIndex.addLayer(h,ue[h.source],s.center.lng);ee=ee||g}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((H=H||this._layerOrderChanged||I===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(R.h.now(),s.zoom))&&(this.pauseablePlacement=new Wo(s,this.map.terrain,this._order,H,x,I,k,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,ue),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(R.h.now()),ne=!0),ee&&this.pauseablePlacement.placement.setStale()),ne||ee)for(const _e of this._order){const h=this._layers[_e];h.type==="symbol"&&this.placement.updateLayerOpacities(h,ue[h.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(R.h.now())}_releaseSymbolFadeTiles(){for(const s in this.sourceCaches)this.sourceCaches[s].releaseSymbolFadeTiles()}getImages(s,x,I){this.imageManager.getImages(x.icons,I),this._updateTilesForChangedImages();const k=this.sourceCaches[x.source];k&&k.setDependencies(x.tileID.key,x.type,x.icons)}getGlyphs(s,x,I){this.glyphManager.getGlyphs(x.stacks,I);const k=this.sourceCaches[x.source];k&&k.setDependencies(x.tileID.key,x.type,[""])}getResource(s,x,I){return R.m(x,I)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(s,x={}){this._checkLoaded(),s&&this._validate(R.y.glyphs,"glyphs",s,null,x)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=s,this.glyphManager.entries={},this.glyphManager.setURL(s))}addSprite(s,x,I={},k){this._checkLoaded();const H=[{id:s,url:x}],ee=[...ki(this.stylesheet.sprite),...H];this._validate(R.y.sprite,"sprite",ee,null,I)||(this.stylesheet.sprite=ee,this._loadSprite(H,!0,k))}removeSprite(s){this._checkLoaded();const x=ki(this.stylesheet.sprite);if(x.find(I=>I.id===s)){if(this._spritesImagesIds[s])for(const I of this._spritesImagesIds[s])this.imageManager.removeImage(I),this._changedImages[I]=!0;x.splice(x.findIndex(I=>I.id===s),1),this.stylesheet.sprite=x.length>0?x:void 0,delete this._spritesImagesIds[s],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new R.k("data",{dataType:"style"}))}else this.fire(new R.j(new Error(`Sprite "${s}" doesn't exists on this map.`)))}getSprite(){return ki(this.stylesheet.sprite)}setSprite(s,x={},I){this._checkLoaded(),s&&this._validate(R.y.sprite,"sprite",s,null,x)||(this.stylesheet.sprite=s,s?this._loadSprite(s,!0,I):(this._unloadSprite(),I&&I(null)))}}Fa.registerForPluginStateChange=R.aK;var sc=R.Q([{name:"a_pos",type:"Int16",components:2}]),Ql="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const oa={prelude:Zo(`#ifdef GL_ES
precision mediump float;
#else
#if !defined(lowp)
#define lowp
#endif
#if !defined(mediump)
#define mediump
#endif
#if !defined(highp)
#define highp
#endif
#endif
`,`#ifdef GL_ES
precision highp float;
#else
#if !defined(lowp)
#define lowp
#endif
#if !defined(mediump)
#define mediump
#endif
#if !defined(highp)
#define highp
#endif
#endif
vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}
#ifdef TERRAIN3D
uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;
#endif
const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {
#ifdef TERRAIN3D
highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));
#else
return 1.0;
#endif
}float calculate_visibility(vec4 pos) {
#ifdef TERRAIN3D
vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;
#else
return 1.0;
#endif
}float ele(vec2 pos) {
#ifdef TERRAIN3D
vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
#else
return 0.0;
#endif
}float get_elevation(vec2 pos) {
#ifdef TERRAIN3D
vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;
#else
return 0.0;
#endif
}`),background:Zo(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Zo(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Zo(`varying vec3 v_data;varying float v_visibility;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define mediump float radius
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define highp vec4 stroke_color
#pragma mapbox: define mediump float stroke_width
#pragma mapbox: define lowp float stroke_opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize mediump float radius
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize highp vec4 stroke_color
#pragma mapbox: initialize mediump float stroke_width
#pragma mapbox: initialize lowp float stroke_opacity
vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define mediump float radius
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define highp vec4 stroke_color
#pragma mapbox: define mediump float stroke_width
#pragma mapbox: define lowp float stroke_opacity
void main(void) {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize mediump float radius
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize highp vec4 stroke_color
#pragma mapbox: initialize mediump float stroke_width
#pragma mapbox: initialize lowp float stroke_opacity
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Zo("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Zo(`uniform highp float u_intensity;varying vec2 v_extrude;
#pragma mapbox: define highp float weight
#define GAUSS_COEF 0.3989422804014327
void main() {
#pragma mapbox: initialize highp float weight
float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;
#pragma mapbox: define highp float weight
#pragma mapbox: define mediump float radius
const highp float ZERO=1.0/255.0/16.0;
#define GAUSS_COEF 0.3989422804014327
void main(void) {
#pragma mapbox: initialize highp float weight
#pragma mapbox: initialize mediump float radius
vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:Zo(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(0.0);
#endif
}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Zo("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Zo("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Zo("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:Zo(`#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float opacity
gl_FragColor=color*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float opacity
gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Zo(`varying vec2 v_pos;
#pragma mapbox: define highp vec4 outline_color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 outline_color
#pragma mapbox: initialize lowp float opacity
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
#pragma mapbox: define highp vec4 outline_color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 outline_color
#pragma mapbox: initialize lowp float opacity
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Zo(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Zo(`#ifdef GL_ES
precision highp float;
#endif
uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Zo(`varying vec4 v_color;void main() {gl_FragColor=v_color;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;
#ifdef TERRAIN3D
attribute vec2 a_centroid;
#endif
varying vec4 v_color;
#pragma mapbox: define highp float base
#pragma mapbox: define highp float height
#pragma mapbox: define highp vec4 color
void main() {
#pragma mapbox: initialize highp float base
#pragma mapbox: initialize highp float height
#pragma mapbox: initialize highp vec4 color
vec3 normal=a_normal_ed.xyz;
#ifdef TERRAIN3D
float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
#else
float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
#endif
base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Zo(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
#pragma mapbox: define lowp float base
#pragma mapbox: define lowp float height
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float base
#pragma mapbox: initialize lowp float height
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;
#ifdef TERRAIN3D
attribute vec2 a_centroid;
#endif
varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
#pragma mapbox: define lowp float base
#pragma mapbox: define lowp float height
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float base
#pragma mapbox: initialize lowp float height
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;
#ifdef TERRAIN3D
float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
#else
float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
#endif
base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
? a_pos
: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Zo(`#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:Zo(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
#define PI 3.141592653589793
void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:Zo(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float width
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float width
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
#ifdef TERRAIN3D
v_gamma_scale=1.0;
#else
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
#endif
v_width2=vec2(outset,inset);}`),lineGradient:Zo(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float width
void main() {
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float width
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
#ifdef TERRAIN3D
v_gamma_scale=1.0;
#else
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
#endif
v_width2=vec2(outset,inset);}`),linePattern:Zo(`#ifdef GL_ES
precision highp float;
#endif
uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
#define LINE_DISTANCE_SCALE 2.0
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define mediump float width
#pragma mapbox: define lowp float floorwidth
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize mediump float width
#pragma mapbox: initialize lowp float floorwidth
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
#ifdef TERRAIN3D
v_gamma_scale=1.0;
#else
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
#endif
v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Zo(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float width
#pragma mapbox: define lowp float floorwidth
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float width
#pragma mapbox: initialize lowp float floorwidth
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
#define LINE_DISTANCE_SCALE 2.0
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float width
#pragma mapbox: define lowp float floorwidth
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float width
#pragma mapbox: initialize lowp float floorwidth
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
#ifdef TERRAIN3D
v_gamma_scale=1.0;
#else
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
#endif
v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Zo(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Zo(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float opacity
lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float opacity
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Zo(`#define SDF_PX 8.0
uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Zo(`#define SDF_PX 8.0
#define SDF 1.0
#define ICON 0.0
uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:Zo("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Ql),terrainDepth:Zo("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",Ql),terrainCoords:Zo("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",Ql)};function Zo(z,s){const x=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,I=s.match(/attribute ([\w]+) ([\w]+)/g),k=z.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),H=s.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),ee=H?H.concat(k):k,ne={};return{fragmentSource:z=z.replace(x,(ue,_e,h,g,d)=>(ne[d]=!0,_e==="define"?`
#ifndef HAS_UNIFORM_u_${d}
varying ${h} ${g} ${d};
#else
uniform ${h} ${g} u_${d};
#endif
`:`
#ifdef HAS_UNIFORM_u_${d}
${h} ${g} ${d} = u_${d};
#endif
`)),vertexSource:s=s.replace(x,(ue,_e,h,g,d)=>{const b=g==="float"?"vec2":"vec4",B=d.match(/color/)?"color":b;return ne[d]?_e==="define"?`
#ifndef HAS_UNIFORM_u_${d}
uniform lowp float u_${d}_t;
attribute ${h} ${b} a_${d};
varying ${h} ${g} ${d};
#else
uniform ${h} ${g} u_${d};
#endif
`:B==="vec4"?`
#ifndef HAS_UNIFORM_u_${d}
${d} = a_${d};
#else
${h} ${g} ${d} = u_${d};
#endif
`:`
#ifndef HAS_UNIFORM_u_${d}
${d} = unpack_mix_${B}(a_${d}, u_${d}_t);
#else
${h} ${g} ${d} = u_${d};
#endif
`:_e==="define"?`
#ifndef HAS_UNIFORM_u_${d}
uniform lowp float u_${d}_t;
attribute ${h} ${b} a_${d};
#else
uniform ${h} ${g} u_${d};
#endif
`:B==="vec4"?`
#ifndef HAS_UNIFORM_u_${d}
${h} ${g} ${d} = a_${d};
#else
${h} ${g} ${d} = u_${d};
#endif
`:`
#ifndef HAS_UNIFORM_u_${d}
${h} ${g} ${d} = unpack_mix_${B}(a_${d}, u_${d}_t);
#else
${h} ${g} ${d} = u_${d};
#endif
`}),staticAttributes:I,staticUniforms:ee}}class il{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(s,x,I,k,H,ee,ne,ue,_e){this.context=s;let h=this.boundPaintVertexBuffers.length!==k.length;for(let g=0;!h&&g<k.length;g++)this.boundPaintVertexBuffers[g]!==k[g]&&(h=!0);!this.vao||this.boundProgram!==x||this.boundLayoutVertexBuffer!==I||h||this.boundIndexBuffer!==H||this.boundVertexOffset!==ee||this.boundDynamicVertexBuffer!==ne||this.boundDynamicVertexBuffer2!==ue||this.boundDynamicVertexBuffer3!==_e?this.freshBind(x,I,k,H,ee,ne,ue,_e):(s.bindVertexArray.set(this.vao),ne&&ne.bind(),H&&H.dynamicDraw&&H.bind(),ue&&ue.bind(),_e&&_e.bind())}freshBind(s,x,I,k,H,ee,ne,ue){const _e=s.numAttributes,h=this.context,g=h.gl;this.vao&&this.destroy(),this.vao=h.createVertexArray(),h.bindVertexArray.set(this.vao),this.boundProgram=s,this.boundLayoutVertexBuffer=x,this.boundPaintVertexBuffers=I,this.boundIndexBuffer=k,this.boundVertexOffset=H,this.boundDynamicVertexBuffer=ee,this.boundDynamicVertexBuffer2=ne,this.boundDynamicVertexBuffer3=ue,x.enableAttributes(g,s);for(const d of I)d.enableAttributes(g,s);ee&&ee.enableAttributes(g,s),ne&&ne.enableAttributes(g,s),ue&&ue.enableAttributes(g,s),x.bind(),x.setVertexAttribPointers(g,s,H);for(const d of I)d.bind(),d.setVertexAttribPointers(g,s,H);ee&&(ee.bind(),ee.setVertexAttribPointers(g,s,H)),k&&k.bind(),ne&&(ne.bind(),ne.setVertexAttribPointers(g,s,H)),ue&&(ue.bind(),ue.setVertexAttribPointers(g,s,H)),h.currentNumAttributes=_e}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}function va(z){const s=[];for(let x=0;x<z.length;x++){if(z[x]===null)continue;const I=z[x].split(" ");s.push(I.pop())}return s}class El{constructor(s,x,I,k,H,ee){const ne=s.gl;this.program=ne.createProgram();const ue=va(x.staticAttributes),_e=I?I.getBinderAttributes():[],h=ue.concat(_e),g=oa.prelude.staticUniforms?va(oa.prelude.staticUniforms):[],d=x.staticUniforms?va(x.staticUniforms):[],b=I?I.getBinderUniforms():[],B=g.concat(d).concat(b),G=[];for(const Oe of B)G.indexOf(Oe)<0&&G.push(Oe);const q=I?I.defines():[];H&&q.push("#define OVERDRAW_INSPECTOR;"),ee&&q.push("#define TERRAIN3D;");const te=q.concat(oa.prelude.fragmentSource,x.fragmentSource).join(`
`),fe=q.concat(oa.prelude.vertexSource,x.vertexSource).join(`
`),ce=ne.createShader(ne.FRAGMENT_SHADER);if(ne.isContextLost())return void(this.failedToCreate=!0);if(ne.shaderSource(ce,te),ne.compileShader(ce),!ne.getShaderParameter(ce,ne.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${ne.getShaderInfoLog(ce)}`);ne.attachShader(this.program,ce);const Te=ne.createShader(ne.VERTEX_SHADER);if(ne.isContextLost())return void(this.failedToCreate=!0);if(ne.shaderSource(Te,fe),ne.compileShader(Te),!ne.getShaderParameter(Te,ne.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${ne.getShaderInfoLog(Te)}`);ne.attachShader(this.program,Te),this.attributes={};const Ie={};this.numAttributes=h.length;for(let Oe=0;Oe<this.numAttributes;Oe++)h[Oe]&&(ne.bindAttribLocation(this.program,Oe,h[Oe]),this.attributes[h[Oe]]=Oe);if(ne.linkProgram(this.program),!ne.getProgramParameter(this.program,ne.LINK_STATUS))throw new Error(`Program failed to link: ${ne.getProgramInfoLog(this.program)}`);ne.deleteShader(Te),ne.deleteShader(ce);for(let Oe=0;Oe<G.length;Oe++){const Qe=G[Oe];if(Qe&&!Ie[Qe]){const nt=ne.getUniformLocation(this.program,Qe);nt&&(Ie[Qe]=nt)}}this.fixedUniforms=k(s,Ie),this.terrainUniforms=((Oe,Qe)=>({u_depth:new R.aL(Oe,Qe.u_depth),u_terrain:new R.aL(Oe,Qe.u_terrain),u_terrain_dim:new R.aM(Oe,Qe.u_terrain_dim),u_terrain_matrix:new R.aN(Oe,Qe.u_terrain_matrix),u_terrain_unpack:new R.aO(Oe,Qe.u_terrain_unpack),u_terrain_exaggeration:new R.aM(Oe,Qe.u_terrain_exaggeration)}))(s,Ie),this.binderUniforms=I?I.getUniforms(s,Ie):[]}draw(s,x,I,k,H,ee,ne,ue,_e,h,g,d,b,B,G,q,te,fe){const ce=s.gl;if(this.failedToCreate)return;if(s.program.set(this.program),s.setDepthMode(I),s.setStencilMode(k),s.setColorMode(H),s.setCullFace(ee),ue){s.activeTexture.set(ce.TEXTURE2),ce.bindTexture(ce.TEXTURE_2D,ue.depthTexture),s.activeTexture.set(ce.TEXTURE3),ce.bindTexture(ce.TEXTURE_2D,ue.texture);for(const Ie in this.terrainUniforms)this.terrainUniforms[Ie].set(ue[Ie])}for(const Ie in this.fixedUniforms)this.fixedUniforms[Ie].set(ne[Ie]);G&&G.setUniforms(s,this.binderUniforms,b,{zoom:B});let Te=0;switch(x){case ce.LINES:Te=2;break;case ce.TRIANGLES:Te=3;break;case ce.LINE_STRIP:Te=1}for(const Ie of d.get()){const Oe=Ie.vaos||(Ie.vaos={});(Oe[_e]||(Oe[_e]=new il)).bind(s,this,h,G?G.getPaintVertexBuffers():[],g,Ie.vertexOffset,q,te,fe),ce.drawElements(x,Ie.primitiveLength*Te,ce.UNSIGNED_SHORT,Ie.primitiveOffset*Te*2)}}}function Wa(z,s,x){const I=1/je(x,1,s.transform.tileZoom),k=Math.pow(2,x.tileID.overscaledZ),H=x.tileSize*Math.pow(2,s.transform.tileZoom)/k,ee=H*(x.tileID.canonical.x+x.tileID.wrap*k),ne=H*x.tileID.canonical.y;return{u_image:0,u_texsize:x.imageAtlasTexture.size,u_scale:[I,z.fromScale,z.toScale],u_fade:z.t,u_pixel_coord_upper:[ee>>16,ne>>16],u_pixel_coord_lower:[65535&ee,65535&ne]}}const Ds=(z,s,x,I)=>{const k=s.style.light,H=k.properties.get("position"),ee=[H.x,H.y,H.z],ne=function(){var _e=new R.A(9);return R.A!=Float32Array&&(_e[1]=0,_e[2]=0,_e[3]=0,_e[5]=0,_e[6]=0,_e[7]=0),_e[0]=1,_e[4]=1,_e[8]=1,_e}();k.properties.get("anchor")==="viewport"&&function(_e,h){var g=Math.sin(h),d=Math.cos(h);_e[0]=d,_e[1]=g,_e[2]=0,_e[3]=-g,_e[4]=d,_e[5]=0,_e[6]=0,_e[7]=0,_e[8]=1}(ne,-s.transform.angle),function(_e,h,g){var d=h[0],b=h[1],B=h[2];_e[0]=d*g[0]+b*g[3]+B*g[6],_e[1]=d*g[1]+b*g[4]+B*g[7],_e[2]=d*g[2]+b*g[5]+B*g[8]}(ee,ee,ne);const ue=k.properties.get("color");return{u_matrix:z,u_lightpos:ee,u_lightintensity:k.properties.get("intensity"),u_lightcolor:[ue.r,ue.g,ue.b],u_vertical_gradient:+x,u_opacity:I}},Rl=(z,s,x,I,k,H,ee)=>R.e(Ds(z,s,x,I),Wa(H,s,ee),{u_height_factor:-Math.pow(2,k.overscaledZ)/ee.tileSize/8}),gu=z=>({u_matrix:z}),gl=(z,s,x,I)=>R.e(gu(z),Wa(x,s,I)),wl=(z,s)=>({u_matrix:z,u_world:s}),ol=(z,s,x,I,k)=>R.e(gl(z,s,x,I),{u_world:k}),Qa=(z,s,x,I)=>{const k=z.transform;let H,ee;if(I.paint.get("circle-pitch-alignment")==="map"){const ne=je(x,1,k.zoom);H=!0,ee=[ne,ne]}else H=!1,ee=k.pixelsToGLUnits;return{u_camera_to_center_distance:k.cameraToCenterDistance,u_scale_with_map:+(I.paint.get("circle-pitch-scale")==="map"),u_matrix:z.translatePosMatrix(s.posMatrix,x,I.paint.get("circle-translate"),I.paint.get("circle-translate-anchor")),u_pitch_with_map:+H,u_device_pixel_ratio:z.pixelRatio,u_extrude_scale:ee}},Gl=(z,s,x)=>{const I=je(x,1,s.zoom),k=Math.pow(2,s.zoom-x.tileID.overscaledZ),H=x.tileID.overscaleFactor();return{u_matrix:z,u_camera_to_center_distance:s.cameraToCenterDistance,u_pixels_to_tile_units:I,u_extrude_scale:[s.pixelsToGLUnits[0]/(I*k),s.pixelsToGLUnits[1]/(I*k)],u_overscale_factor:H}},Wl=(z,s,x=1)=>({u_matrix:z,u_color:s,u_overlay:0,u_overlay_scale:x}),ut=z=>({u_matrix:z}),At=(z,s,x,I)=>({u_matrix:z,u_extrude_scale:je(s,1,x),u_intensity:I});function ir(z,s){const x=Math.pow(2,s.canonical.z),I=s.canonical.y;return[new R.U(0,I/x).toLngLat().lat,new R.U(0,(I+1)/x).toLngLat().lat]}const jr=(z,s,x,I)=>{const k=z.transform;return{u_matrix:kl(z,s,x,I),u_ratio:1/je(s,1,k.zoom),u_device_pixel_ratio:z.pixelRatio,u_units_to_pixels:[1/k.pixelsToGLUnits[0],1/k.pixelsToGLUnits[1]]}},Dn=(z,s,x,I,k)=>R.e(jr(z,s,x,k),{u_image:0,u_image_height:I}),oo=(z,s,x,I,k)=>{const H=z.transform,ee=mn(s,H);return{u_matrix:kl(z,s,x,k),u_texsize:s.imageAtlasTexture.size,u_ratio:1/je(s,1,H.zoom),u_device_pixel_ratio:z.pixelRatio,u_image:0,u_scale:[ee,I.fromScale,I.toScale],u_fade:I.t,u_units_to_pixels:[1/H.pixelsToGLUnits[0],1/H.pixelsToGLUnits[1]]}},Xa=(z,s,x,I,k,H)=>{const ee=z.lineAtlas,ne=mn(s,z.transform),ue=x.layout.get("line-cap")==="round",_e=ee.getDash(I.from,ue),h=ee.getDash(I.to,ue),g=_e.width*k.fromScale,d=h.width*k.toScale;return R.e(jr(z,s,x,H),{u_patternscale_a:[ne/g,-_e.height/2],u_patternscale_b:[ne/d,-h.height/2],u_sdfgamma:ee.width/(256*Math.min(g,d)*z.pixelRatio)/2,u_image:0,u_tex_y_a:_e.y,u_tex_y_b:h.y,u_mix:k.t})};function mn(z,s){return 1/je(z,1,s.tileZoom)}function kl(z,s,x,I){return z.translatePosMatrix(I?I.posMatrix:s.tileID.posMatrix,s,x.paint.get("line-translate"),x.paint.get("line-translate-anchor"))}const Il=(z,s,x,I,k)=>{return{u_matrix:z,u_tl_parent:s,u_scale_parent:x,u_buffer_scale:1,u_fade_t:I.mix,u_opacity:I.opacity*k.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:k.paint.get("raster-brightness-min"),u_brightness_high:k.paint.get("raster-brightness-max"),u_saturation_factor:(ee=k.paint.get("raster-saturation"),ee>0?1-1/(1.001-ee):-ee),u_contrast_factor:(H=k.paint.get("raster-contrast"),H>0?1/(1-H):1+H),u_spin_weights:Ia(k.paint.get("raster-hue-rotate"))};var H,ee};function Ia(z){z*=Math.PI/180;const s=Math.sin(z),x=Math.cos(z);return[(2*x+1)/3,(-Math.sqrt(3)*s-x+1)/3,(Math.sqrt(3)*s-x+1)/3]}const Xh=(z,s,x,I,k,H,ee,ne,ue,_e)=>{const h=k.transform;return{u_is_size_zoom_constant:+(z==="constant"||z==="source"),u_is_size_feature_constant:+(z==="constant"||z==="camera"),u_size_t:s?s.uSizeT:0,u_size:s?s.uSize:0,u_camera_to_center_distance:h.cameraToCenterDistance,u_pitch:h.pitch/360*2*Math.PI,u_rotate_symbol:+x,u_aspect_ratio:h.width/h.height,u_fade_change:k.options.fadeDuration?k.symbolFadeChange:1,u_matrix:H,u_label_plane_matrix:ee,u_coord_matrix:ne,u_is_text:+ue,u_pitch_with_map:+I,u_texsize:_e,u_texture:0}},Sl=(z,s,x,I,k,H,ee,ne,ue,_e,h)=>{const g=k.transform;return R.e(Xh(z,s,x,I,k,H,ee,ne,ue,_e),{u_gamma_scale:I?Math.cos(g._pitch)*g.cameraToCenterDistance:1,u_device_pixel_ratio:k.pixelRatio,u_is_halo:+h})},Va=(z,s,x,I,k,H,ee,ne,ue,_e)=>R.e(Sl(z,s,x,I,k,H,ee,ne,!0,ue,!0),{u_texsize_icon:_e,u_texture_icon:1}),Aa=(z,s,x)=>({u_matrix:z,u_opacity:s,u_color:x}),Ni=(z,s,x,I,k,H)=>R.e(function(ee,ne,ue,_e){const h=ue.imageManager.getPattern(ee.from.toString()),g=ue.imageManager.getPattern(ee.to.toString()),{width:d,height:b}=ue.imageManager.getPixelSize(),B=Math.pow(2,_e.tileID.overscaledZ),G=_e.tileSize*Math.pow(2,ue.transform.tileZoom)/B,q=G*(_e.tileID.canonical.x+_e.tileID.wrap*B),te=G*_e.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:h.tl,u_pattern_br_a:h.br,u_pattern_tl_b:g.tl,u_pattern_br_b:g.br,u_texsize:[d,b],u_mix:ne.t,u_pattern_size_a:h.displaySize,u_pattern_size_b:g.displaySize,u_scale_a:ne.fromScale,u_scale_b:ne.toScale,u_tile_units_to_pixels:1/je(_e,1,ue.transform.tileZoom),u_pixel_coord_upper:[q>>16,te>>16],u_pixel_coord_lower:[65535&q,65535&te]}}(I,H,x,k),{u_matrix:z,u_opacity:s}),lc={fillExtrusion:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_lightpos:new R.aP(z,s.u_lightpos),u_lightintensity:new R.aM(z,s.u_lightintensity),u_lightcolor:new R.aP(z,s.u_lightcolor),u_vertical_gradient:new R.aM(z,s.u_vertical_gradient),u_opacity:new R.aM(z,s.u_opacity)}),fillExtrusionPattern:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_lightpos:new R.aP(z,s.u_lightpos),u_lightintensity:new R.aM(z,s.u_lightintensity),u_lightcolor:new R.aP(z,s.u_lightcolor),u_vertical_gradient:new R.aM(z,s.u_vertical_gradient),u_height_factor:new R.aM(z,s.u_height_factor),u_image:new R.aL(z,s.u_image),u_texsize:new R.aQ(z,s.u_texsize),u_pixel_coord_upper:new R.aQ(z,s.u_pixel_coord_upper),u_pixel_coord_lower:new R.aQ(z,s.u_pixel_coord_lower),u_scale:new R.aP(z,s.u_scale),u_fade:new R.aM(z,s.u_fade),u_opacity:new R.aM(z,s.u_opacity)}),fill:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix)}),fillPattern:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_image:new R.aL(z,s.u_image),u_texsize:new R.aQ(z,s.u_texsize),u_pixel_coord_upper:new R.aQ(z,s.u_pixel_coord_upper),u_pixel_coord_lower:new R.aQ(z,s.u_pixel_coord_lower),u_scale:new R.aP(z,s.u_scale),u_fade:new R.aM(z,s.u_fade)}),fillOutline:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_world:new R.aQ(z,s.u_world)}),fillOutlinePattern:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_world:new R.aQ(z,s.u_world),u_image:new R.aL(z,s.u_image),u_texsize:new R.aQ(z,s.u_texsize),u_pixel_coord_upper:new R.aQ(z,s.u_pixel_coord_upper),u_pixel_coord_lower:new R.aQ(z,s.u_pixel_coord_lower),u_scale:new R.aP(z,s.u_scale),u_fade:new R.aM(z,s.u_fade)}),circle:(z,s)=>({u_camera_to_center_distance:new R.aM(z,s.u_camera_to_center_distance),u_scale_with_map:new R.aL(z,s.u_scale_with_map),u_pitch_with_map:new R.aL(z,s.u_pitch_with_map),u_extrude_scale:new R.aQ(z,s.u_extrude_scale),u_device_pixel_ratio:new R.aM(z,s.u_device_pixel_ratio),u_matrix:new R.aN(z,s.u_matrix)}),collisionBox:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_camera_to_center_distance:new R.aM(z,s.u_camera_to_center_distance),u_pixels_to_tile_units:new R.aM(z,s.u_pixels_to_tile_units),u_extrude_scale:new R.aQ(z,s.u_extrude_scale),u_overscale_factor:new R.aM(z,s.u_overscale_factor)}),collisionCircle:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_inv_matrix:new R.aN(z,s.u_inv_matrix),u_camera_to_center_distance:new R.aM(z,s.u_camera_to_center_distance),u_viewport_size:new R.aQ(z,s.u_viewport_size)}),debug:(z,s)=>({u_color:new R.aR(z,s.u_color),u_matrix:new R.aN(z,s.u_matrix),u_overlay:new R.aL(z,s.u_overlay),u_overlay_scale:new R.aM(z,s.u_overlay_scale)}),clippingMask:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix)}),heatmap:(z,s)=>({u_extrude_scale:new R.aM(z,s.u_extrude_scale),u_intensity:new R.aM(z,s.u_intensity),u_matrix:new R.aN(z,s.u_matrix)}),heatmapTexture:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_world:new R.aQ(z,s.u_world),u_image:new R.aL(z,s.u_image),u_color_ramp:new R.aL(z,s.u_color_ramp),u_opacity:new R.aM(z,s.u_opacity)}),hillshade:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_image:new R.aL(z,s.u_image),u_latrange:new R.aQ(z,s.u_latrange),u_light:new R.aQ(z,s.u_light),u_shadow:new R.aR(z,s.u_shadow),u_highlight:new R.aR(z,s.u_highlight),u_accent:new R.aR(z,s.u_accent)}),hillshadePrepare:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_image:new R.aL(z,s.u_image),u_dimension:new R.aQ(z,s.u_dimension),u_zoom:new R.aM(z,s.u_zoom),u_unpack:new R.aO(z,s.u_unpack)}),line:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_ratio:new R.aM(z,s.u_ratio),u_device_pixel_ratio:new R.aM(z,s.u_device_pixel_ratio),u_units_to_pixels:new R.aQ(z,s.u_units_to_pixels)}),lineGradient:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_ratio:new R.aM(z,s.u_ratio),u_device_pixel_ratio:new R.aM(z,s.u_device_pixel_ratio),u_units_to_pixels:new R.aQ(z,s.u_units_to_pixels),u_image:new R.aL(z,s.u_image),u_image_height:new R.aM(z,s.u_image_height)}),linePattern:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_texsize:new R.aQ(z,s.u_texsize),u_ratio:new R.aM(z,s.u_ratio),u_device_pixel_ratio:new R.aM(z,s.u_device_pixel_ratio),u_image:new R.aL(z,s.u_image),u_units_to_pixels:new R.aQ(z,s.u_units_to_pixels),u_scale:new R.aP(z,s.u_scale),u_fade:new R.aM(z,s.u_fade)}),lineSDF:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_ratio:new R.aM(z,s.u_ratio),u_device_pixel_ratio:new R.aM(z,s.u_device_pixel_ratio),u_units_to_pixels:new R.aQ(z,s.u_units_to_pixels),u_patternscale_a:new R.aQ(z,s.u_patternscale_a),u_patternscale_b:new R.aQ(z,s.u_patternscale_b),u_sdfgamma:new R.aM(z,s.u_sdfgamma),u_image:new R.aL(z,s.u_image),u_tex_y_a:new R.aM(z,s.u_tex_y_a),u_tex_y_b:new R.aM(z,s.u_tex_y_b),u_mix:new R.aM(z,s.u_mix)}),raster:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_tl_parent:new R.aQ(z,s.u_tl_parent),u_scale_parent:new R.aM(z,s.u_scale_parent),u_buffer_scale:new R.aM(z,s.u_buffer_scale),u_fade_t:new R.aM(z,s.u_fade_t),u_opacity:new R.aM(z,s.u_opacity),u_image0:new R.aL(z,s.u_image0),u_image1:new R.aL(z,s.u_image1),u_brightness_low:new R.aM(z,s.u_brightness_low),u_brightness_high:new R.aM(z,s.u_brightness_high),u_saturation_factor:new R.aM(z,s.u_saturation_factor),u_contrast_factor:new R.aM(z,s.u_contrast_factor),u_spin_weights:new R.aP(z,s.u_spin_weights)}),symbolIcon:(z,s)=>({u_is_size_zoom_constant:new R.aL(z,s.u_is_size_zoom_constant),u_is_size_feature_constant:new R.aL(z,s.u_is_size_feature_constant),u_size_t:new R.aM(z,s.u_size_t),u_size:new R.aM(z,s.u_size),u_camera_to_center_distance:new R.aM(z,s.u_camera_to_center_distance),u_pitch:new R.aM(z,s.u_pitch),u_rotate_symbol:new R.aL(z,s.u_rotate_symbol),u_aspect_ratio:new R.aM(z,s.u_aspect_ratio),u_fade_change:new R.aM(z,s.u_fade_change),u_matrix:new R.aN(z,s.u_matrix),u_label_plane_matrix:new R.aN(z,s.u_label_plane_matrix),u_coord_matrix:new R.aN(z,s.u_coord_matrix),u_is_text:new R.aL(z,s.u_is_text),u_pitch_with_map:new R.aL(z,s.u_pitch_with_map),u_texsize:new R.aQ(z,s.u_texsize),u_texture:new R.aL(z,s.u_texture)}),symbolSDF:(z,s)=>({u_is_size_zoom_constant:new R.aL(z,s.u_is_size_zoom_constant),u_is_size_feature_constant:new R.aL(z,s.u_is_size_feature_constant),u_size_t:new R.aM(z,s.u_size_t),u_size:new R.aM(z,s.u_size),u_camera_to_center_distance:new R.aM(z,s.u_camera_to_center_distance),u_pitch:new R.aM(z,s.u_pitch),u_rotate_symbol:new R.aL(z,s.u_rotate_symbol),u_aspect_ratio:new R.aM(z,s.u_aspect_ratio),u_fade_change:new R.aM(z,s.u_fade_change),u_matrix:new R.aN(z,s.u_matrix),u_label_plane_matrix:new R.aN(z,s.u_label_plane_matrix),u_coord_matrix:new R.aN(z,s.u_coord_matrix),u_is_text:new R.aL(z,s.u_is_text),u_pitch_with_map:new R.aL(z,s.u_pitch_with_map),u_texsize:new R.aQ(z,s.u_texsize),u_texture:new R.aL(z,s.u_texture),u_gamma_scale:new R.aM(z,s.u_gamma_scale),u_device_pixel_ratio:new R.aM(z,s.u_device_pixel_ratio),u_is_halo:new R.aL(z,s.u_is_halo)}),symbolTextAndIcon:(z,s)=>({u_is_size_zoom_constant:new R.aL(z,s.u_is_size_zoom_constant),u_is_size_feature_constant:new R.aL(z,s.u_is_size_feature_constant),u_size_t:new R.aM(z,s.u_size_t),u_size:new R.aM(z,s.u_size),u_camera_to_center_distance:new R.aM(z,s.u_camera_to_center_distance),u_pitch:new R.aM(z,s.u_pitch),u_rotate_symbol:new R.aL(z,s.u_rotate_symbol),u_aspect_ratio:new R.aM(z,s.u_aspect_ratio),u_fade_change:new R.aM(z,s.u_fade_change),u_matrix:new R.aN(z,s.u_matrix),u_label_plane_matrix:new R.aN(z,s.u_label_plane_matrix),u_coord_matrix:new R.aN(z,s.u_coord_matrix),u_is_text:new R.aL(z,s.u_is_text),u_pitch_with_map:new R.aL(z,s.u_pitch_with_map),u_texsize:new R.aQ(z,s.u_texsize),u_texsize_icon:new R.aQ(z,s.u_texsize_icon),u_texture:new R.aL(z,s.u_texture),u_texture_icon:new R.aL(z,s.u_texture_icon),u_gamma_scale:new R.aM(z,s.u_gamma_scale),u_device_pixel_ratio:new R.aM(z,s.u_device_pixel_ratio),u_is_halo:new R.aL(z,s.u_is_halo)}),background:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_opacity:new R.aM(z,s.u_opacity),u_color:new R.aR(z,s.u_color)}),backgroundPattern:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_opacity:new R.aM(z,s.u_opacity),u_image:new R.aL(z,s.u_image),u_pattern_tl_a:new R.aQ(z,s.u_pattern_tl_a),u_pattern_br_a:new R.aQ(z,s.u_pattern_br_a),u_pattern_tl_b:new R.aQ(z,s.u_pattern_tl_b),u_pattern_br_b:new R.aQ(z,s.u_pattern_br_b),u_texsize:new R.aQ(z,s.u_texsize),u_mix:new R.aM(z,s.u_mix),u_pattern_size_a:new R.aQ(z,s.u_pattern_size_a),u_pattern_size_b:new R.aQ(z,s.u_pattern_size_b),u_scale_a:new R.aM(z,s.u_scale_a),u_scale_b:new R.aM(z,s.u_scale_b),u_pixel_coord_upper:new R.aQ(z,s.u_pixel_coord_upper),u_pixel_coord_lower:new R.aQ(z,s.u_pixel_coord_lower),u_tile_units_to_pixels:new R.aM(z,s.u_tile_units_to_pixels)}),terrain:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_texture:new R.aL(z,s.u_texture),u_ele_delta:new R.aM(z,s.u_ele_delta)}),terrainDepth:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_ele_delta:new R.aM(z,s.u_ele_delta)}),terrainCoords:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_texture:new R.aL(z,s.u_texture),u_terrain_coords_id:new R.aM(z,s.u_terrain_coords_id),u_ele_delta:new R.aM(z,s.u_ele_delta)})};class Ku{constructor(s,x,I){this.context=s;const k=s.gl;this.buffer=k.createBuffer(),this.dynamicDraw=!!I,this.context.unbindVAO(),s.bindElementBuffer.set(this.buffer),k.bufferData(k.ELEMENT_ARRAY_BUFFER,x.arrayBuffer,this.dynamicDraw?k.DYNAMIC_DRAW:k.STATIC_DRAW),this.dynamicDraw||delete x.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(s){const x=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),x.bufferSubData(x.ELEMENT_ARRAY_BUFFER,0,s.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const lo={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class bs{constructor(s,x,I,k){this.length=x.length,this.attributes=I,this.itemSize=x.bytesPerElement,this.dynamicDraw=k,this.context=s;const H=s.gl;this.buffer=H.createBuffer(),s.bindVertexBuffer.set(this.buffer),H.bufferData(H.ARRAY_BUFFER,x.arrayBuffer,this.dynamicDraw?H.DYNAMIC_DRAW:H.STATIC_DRAW),this.dynamicDraw||delete x.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(s){if(s.length!==this.length)throw new Error(`Length of new data is ${s.length}, which doesn't match current length of ${this.length}`);const x=this.context.gl;this.bind(),x.bufferSubData(x.ARRAY_BUFFER,0,s.arrayBuffer)}enableAttributes(s,x){for(let I=0;I<this.attributes.length;I++){const k=x.attributes[this.attributes[I].name];k!==void 0&&s.enableVertexAttribArray(k)}}setVertexAttribPointers(s,x,I){for(let k=0;k<this.attributes.length;k++){const H=this.attributes[k],ee=x.attributes[H.name];ee!==void 0&&s.vertexAttribPointer(ee,H.components,s[lo[H.type]],!1,this.itemSize,H.offset+this.itemSize*(I||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Os=new WeakMap;function Nl(z){var s;if(Os.has(z))return Os.get(z);{const x=(s=z.getParameter(z.VERSION))===null||s===void 0?void 0:s.startsWith("WebGL 2.0");return Os.set(z,x),x}}class Io{constructor(s){this.gl=s.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(s){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class eu extends Io{getDefault(){return R.aT.transparent}set(s){const x=this.current;(s.r!==x.r||s.g!==x.g||s.b!==x.b||s.a!==x.a||this.dirty)&&(this.gl.clearColor(s.r,s.g,s.b,s.a),this.current=s,this.dirty=!1)}}class Tl extends Io{getDefault(){return 1}set(s){(s!==this.current||this.dirty)&&(this.gl.clearDepth(s),this.current=s,this.dirty=!1)}}class Fu extends Io{getDefault(){return 0}set(s){(s!==this.current||this.dirty)&&(this.gl.clearStencil(s),this.current=s,this.dirty=!1)}}class Ju extends Io{getDefault(){return[!0,!0,!0,!0]}set(s){const x=this.current;(s[0]!==x[0]||s[1]!==x[1]||s[2]!==x[2]||s[3]!==x[3]||this.dirty)&&(this.gl.colorMask(s[0],s[1],s[2],s[3]),this.current=s,this.dirty=!1)}}class al extends Io{getDefault(){return!0}set(s){(s!==this.current||this.dirty)&&(this.gl.depthMask(s),this.current=s,this.dirty=!1)}}class Kc extends Io{getDefault(){return 255}set(s){(s!==this.current||this.dirty)&&(this.gl.stencilMask(s),this.current=s,this.dirty=!1)}}class ou extends Io{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(s){const x=this.current;(s.func!==x.func||s.ref!==x.ref||s.mask!==x.mask||this.dirty)&&(this.gl.stencilFunc(s.func,s.ref,s.mask),this.current=s,this.dirty=!1)}}class Ks extends Io{getDefault(){const s=this.gl;return[s.KEEP,s.KEEP,s.KEEP]}set(s){const x=this.current;(s[0]!==x[0]||s[1]!==x[1]||s[2]!==x[2]||this.dirty)&&(this.gl.stencilOp(s[0],s[1],s[2]),this.current=s,this.dirty=!1)}}class Lp extends Io{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;const x=this.gl;s?x.enable(x.STENCIL_TEST):x.disable(x.STENCIL_TEST),this.current=s,this.dirty=!1}}class gf extends Io{getDefault(){return[0,1]}set(s){const x=this.current;(s[0]!==x[0]||s[1]!==x[1]||this.dirty)&&(this.gl.depthRange(s[0],s[1]),this.current=s,this.dirty=!1)}}class Of extends Io{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;const x=this.gl;s?x.enable(x.DEPTH_TEST):x.disable(x.DEPTH_TEST),this.current=s,this.dirty=!1}}class qh extends Io{getDefault(){return this.gl.LESS}set(s){(s!==this.current||this.dirty)&&(this.gl.depthFunc(s),this.current=s,this.dirty=!1)}}class zc extends Io{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;const x=this.gl;s?x.enable(x.BLEND):x.disable(x.BLEND),this.current=s,this.dirty=!1}}class Oh extends Io{getDefault(){const s=this.gl;return[s.ONE,s.ZERO]}set(s){const x=this.current;(s[0]!==x[0]||s[1]!==x[1]||this.dirty)&&(this.gl.blendFunc(s[0],s[1]),this.current=s,this.dirty=!1)}}class Ms extends Io{getDefault(){return R.aT.transparent}set(s){const x=this.current;(s.r!==x.r||s.g!==x.g||s.b!==x.b||s.a!==x.a||this.dirty)&&(this.gl.blendColor(s.r,s.g,s.b,s.a),this.current=s,this.dirty=!1)}}class Jc extends Io{getDefault(){return this.gl.FUNC_ADD}set(s){(s!==this.current||this.dirty)&&(this.gl.blendEquation(s),this.current=s,this.dirty=!1)}}class Yh extends Io{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;const x=this.gl;s?x.enable(x.CULL_FACE):x.disable(x.CULL_FACE),this.current=s,this.dirty=!1}}class Qc extends Io{getDefault(){return this.gl.BACK}set(s){(s!==this.current||this.dirty)&&(this.gl.cullFace(s),this.current=s,this.dirty=!1)}}class uc extends Io{getDefault(){return this.gl.CCW}set(s){(s!==this.current||this.dirty)&&(this.gl.frontFace(s),this.current=s,this.dirty=!1)}}class eh extends Io{getDefault(){return null}set(s){(s!==this.current||this.dirty)&&(this.gl.useProgram(s),this.current=s,this.dirty=!1)}}class yh extends Io{getDefault(){return this.gl.TEXTURE0}set(s){(s!==this.current||this.dirty)&&(this.gl.activeTexture(s),this.current=s,this.dirty=!1)}}class sl extends Io{getDefault(){const s=this.gl;return[0,0,s.drawingBufferWidth,s.drawingBufferHeight]}set(s){const x=this.current;(s[0]!==x[0]||s[1]!==x[1]||s[2]!==x[2]||s[3]!==x[3]||this.dirty)&&(this.gl.viewport(s[0],s[1],s[2],s[3]),this.current=s,this.dirty=!1)}}class Uc extends Io{getDefault(){return null}set(s){if(s===this.current&&!this.dirty)return;const x=this.gl;x.bindFramebuffer(x.FRAMEBUFFER,s),this.current=s,this.dirty=!1}}class bc extends Io{getDefault(){return null}set(s){if(s===this.current&&!this.dirty)return;const x=this.gl;x.bindRenderbuffer(x.RENDERBUFFER,s),this.current=s,this.dirty=!1}}class fp extends Io{getDefault(){return null}set(s){if(s===this.current&&!this.dirty)return;const x=this.gl;x.bindTexture(x.TEXTURE_2D,s),this.current=s,this.dirty=!1}}class dp extends Io{getDefault(){return null}set(s){if(s===this.current&&!this.dirty)return;const x=this.gl;x.bindBuffer(x.ARRAY_BUFFER,s),this.current=s,this.dirty=!1}}class Ps extends Io{getDefault(){return null}set(s){const x=this.gl;x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,s),this.current=s,this.dirty=!1}}class Gf extends Io{getDefault(){return null}set(s){var x;if(s===this.current&&!this.dirty)return;const I=this.gl;Nl(I)?I.bindVertexArray(s):(x=I.getExtension("OES_vertex_array_object"))===null||x===void 0||x.bindVertexArrayOES(s),this.current=s,this.dirty=!1}}class Xp extends Io{getDefault(){return 4}set(s){if(s===this.current&&!this.dirty)return;const x=this.gl;x.pixelStorei(x.UNPACK_ALIGNMENT,s),this.current=s,this.dirty=!1}}class cc extends Io{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;const x=this.gl;x.pixelStorei(x.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s),this.current=s,this.dirty=!1}}class zl extends Io{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;const x=this.gl;x.pixelStorei(x.UNPACK_FLIP_Y_WEBGL,s),this.current=s,this.dirty=!1}}class Ec extends Io{constructor(s,x){super(s),this.context=s,this.parent=x}getDefault(){return null}}class th extends Ec{setDirty(){this.dirty=!0}set(s){if(s===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const x=this.gl;x.framebufferTexture2D(x.FRAMEBUFFER,x.COLOR_ATTACHMENT0,x.TEXTURE_2D,s,0),this.current=s,this.dirty=!1}}class vu extends Ec{set(s){if(s===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const x=this.gl;x.framebufferRenderbuffer(x.FRAMEBUFFER,x.DEPTH_ATTACHMENT,x.RENDERBUFFER,s),this.current=s,this.dirty=!1}}class xh extends Ec{set(s){if(s===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const x=this.gl;x.framebufferRenderbuffer(x.FRAMEBUFFER,x.DEPTH_STENCIL_ATTACHMENT,x.RENDERBUFFER,s),this.current=s,this.dirty=!1}}class qa{constructor(s,x,I,k,H){this.context=s,this.width=x,this.height=I;const ee=s.gl,ne=this.framebuffer=ee.createFramebuffer();if(this.colorAttachment=new th(s,ne),k)this.depthAttachment=H?new xh(s,ne):new vu(s,ne);else if(H)throw new Error("Stencil cannot be setted without depth");if(ee.checkFramebufferStatus(ee.FRAMEBUFFER)!==ee.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const s=this.context.gl,x=this.colorAttachment.get();if(x&&s.deleteTexture(x),this.depthAttachment){const I=this.depthAttachment.get();I&&s.deleteRenderbuffer(I)}s.deleteFramebuffer(this.framebuffer)}}class Hs{constructor(s,x,I){this.blendFunction=s,this.blendColor=x,this.mask=I}}Hs.Replace=[1,0],Hs.disabled=new Hs(Hs.Replace,R.aT.transparent,[!1,!1,!1,!1]),Hs.unblended=new Hs(Hs.Replace,R.aT.transparent,[!0,!0,!0,!0]),Hs.alphaBlended=new Hs([1,771],R.aT.transparent,[!0,!0,!0,!0]);class Ep{constructor(s){var x,I;if(this.gl=s,this.clearColor=new eu(this),this.clearDepth=new Tl(this),this.clearStencil=new Fu(this),this.colorMask=new Ju(this),this.depthMask=new al(this),this.stencilMask=new Kc(this),this.stencilFunc=new ou(this),this.stencilOp=new Ks(this),this.stencilTest=new Lp(this),this.depthRange=new gf(this),this.depthTest=new Of(this),this.depthFunc=new qh(this),this.blend=new zc(this),this.blendFunc=new Oh(this),this.blendColor=new Ms(this),this.blendEquation=new Jc(this),this.cullFace=new Yh(this),this.cullFaceSide=new Qc(this),this.frontFace=new uc(this),this.program=new eh(this),this.activeTexture=new yh(this),this.viewport=new sl(this),this.bindFramebuffer=new Uc(this),this.bindRenderbuffer=new bc(this),this.bindTexture=new fp(this),this.bindVertexBuffer=new dp(this),this.bindElementBuffer=new Ps(this),this.bindVertexArray=new Gf(this),this.pixelStoreUnpack=new Xp(this),this.pixelStoreUnpackPremultiplyAlpha=new cc(this),this.pixelStoreUnpackFlipY=new zl(this),this.extTextureFilterAnisotropic=s.getExtension("EXT_texture_filter_anisotropic")||s.getExtension("MOZ_EXT_texture_filter_anisotropic")||s.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=s.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=s.getParameter(s.MAX_TEXTURE_SIZE),Nl(s)){this.HALF_FLOAT=s.HALF_FLOAT;const k=s.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(x=s.RGBA16F)!==null&&x!==void 0?x:k==null?void 0:k.RGBA16F_EXT,this.RGB16F=(I=s.RGB16F)!==null&&I!==void 0?I:k==null?void 0:k.RGB16F_EXT,s.getExtension("EXT_color_buffer_float")}else{s.getExtension("EXT_color_buffer_half_float"),s.getExtension("OES_texture_half_float_linear");const k=s.getExtension("OES_texture_half_float");this.HALF_FLOAT=k==null?void 0:k.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(s,x){return new Ku(this,s,x)}createVertexBuffer(s,x,I){return new bs(this,s,x,I)}createRenderbuffer(s,x,I){const k=this.gl,H=k.createRenderbuffer();return this.bindRenderbuffer.set(H),k.renderbufferStorage(k.RENDERBUFFER,s,x,I),this.bindRenderbuffer.set(null),H}createFramebuffer(s,x,I,k){return new qa(this,s,x,I,k)}clear({color:s,depth:x,stencil:I}){const k=this.gl;let H=0;s&&(H|=k.COLOR_BUFFER_BIT,this.clearColor.set(s),this.colorMask.set([!0,!0,!0,!0])),x!==void 0&&(H|=k.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(x),this.depthMask.set(!0)),I!==void 0&&(H|=k.STENCIL_BUFFER_BIT,this.clearStencil.set(I),this.stencilMask.set(255)),k.clear(H)}setCullFace(s){s.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(s.mode),this.frontFace.set(s.frontFace))}setDepthMode(s){s.func!==this.gl.ALWAYS||s.mask?(this.depthTest.set(!0),this.depthFunc.set(s.func),this.depthMask.set(s.mask),this.depthRange.set(s.range)):this.depthTest.set(!1)}setStencilMode(s){s.test.func!==this.gl.ALWAYS||s.mask?(this.stencilTest.set(!0),this.stencilMask.set(s.mask),this.stencilOp.set([s.fail,s.depthFail,s.pass]),this.stencilFunc.set({func:s.test.func,ref:s.ref,mask:s.test.mask})):this.stencilTest.set(!1)}setColorMode(s){R.aG(s.blendFunction,Hs.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(s.blendFunction),this.blendColor.set(s.blendColor)),this.colorMask.set(s.mask)}createVertexArray(){var s;return Nl(this.gl)?this.gl.createVertexArray():(s=this.gl.getExtension("OES_vertex_array_object"))===null||s===void 0?void 0:s.createVertexArrayOES()}deleteVertexArray(s){var x;return Nl(this.gl)?this.gl.deleteVertexArray(s):(x=this.gl.getExtension("OES_vertex_array_object"))===null||x===void 0?void 0:x.deleteVertexArrayOES(s)}unbindVAO(){this.bindVertexArray.set(null)}}class Na{constructor(s,x,I){this.func=s,this.mask=x,this.range=I}}Na.ReadOnly=!1,Na.ReadWrite=!0,Na.disabled=new Na(519,Na.ReadOnly,[0,1]);const Qu=7680;class Is{constructor(s,x,I,k,H,ee){this.test=s,this.ref=x,this.mask=I,this.fail=k,this.depthFail=H,this.pass=ee}}Is.disabled=new Is({func:519,mask:0},0,0,Qu,Qu,Qu);class ys{constructor(s,x,I){this.enable=s,this.mode=x,this.frontFace=I}}let ec;function Bf(z,s,x,I,k,H,ee){const ne=z.context,ue=ne.gl,_e=z.useProgram("collisionBox"),h=[];let g=0,d=0;for(let ce=0;ce<I.length;ce++){const Te=I[ce],Ie=s.getTile(Te),Oe=Ie.getBucket(x);if(!Oe)continue;let Qe=Te.posMatrix;k[0]===0&&k[1]===0||(Qe=z.translatePosMatrix(Te.posMatrix,Ie,k,H));const nt=ee?Oe.textCollisionBox:Oe.iconCollisionBox,ct=Oe.collisionCircleArray;if(ct.length>0){const tt=R.Z(),Tt=Qe;R.aU(tt,Oe.placementInvProjMatrix,z.transform.glCoordMatrix),R.aU(tt,tt,Oe.placementViewportMatrix),h.push({circleArray:ct,circleOffset:d,transform:Tt,invTransform:tt,coord:Te}),g+=ct.length/4,d=g}nt&&_e.draw(ne,ue.LINES,Na.disabled,Is.disabled,z.colorModeForRenderPass(),ys.disabled,Gl(Qe,z.transform,Ie),z.style.map.terrain&&z.style.map.terrain.getTerrainData(Te),x.id,nt.layoutVertexBuffer,nt.indexBuffer,nt.segments,null,z.transform.zoom,null,null,nt.collisionVertexBuffer)}if(!ee||!h.length)return;const b=z.useProgram("collisionCircle"),B=new R.aV;B.resize(4*g),B._trim();let G=0;for(const ce of h)for(let Te=0;Te<ce.circleArray.length/4;Te++){const Ie=4*Te,Oe=ce.circleArray[Ie+0],Qe=ce.circleArray[Ie+1],nt=ce.circleArray[Ie+2],ct=ce.circleArray[Ie+3];B.emplace(G++,Oe,Qe,nt,ct,0),B.emplace(G++,Oe,Qe,nt,ct,1),B.emplace(G++,Oe,Qe,nt,ct,2),B.emplace(G++,Oe,Qe,nt,ct,3)}(!ec||ec.length<2*g)&&(ec=function(ce){const Te=2*ce,Ie=new R.aX;Ie.resize(Te),Ie._trim();for(let Oe=0;Oe<Te;Oe++){const Qe=6*Oe;Ie.uint16[Qe+0]=4*Oe+0,Ie.uint16[Qe+1]=4*Oe+1,Ie.uint16[Qe+2]=4*Oe+2,Ie.uint16[Qe+3]=4*Oe+2,Ie.uint16[Qe+4]=4*Oe+3,Ie.uint16[Qe+5]=4*Oe+0}return Ie}(g));const q=ne.createIndexBuffer(ec,!0),te=ne.createVertexBuffer(B,R.aW.members,!0);for(const ce of h){const Te={u_matrix:ce.transform,u_inv_matrix:ce.invTransform,u_camera_to_center_distance:(fe=z.transform).cameraToCenterDistance,u_viewport_size:[fe.width,fe.height]};b.draw(ne,ue.TRIANGLES,Na.disabled,Is.disabled,z.colorModeForRenderPass(),ys.disabled,Te,z.style.map.terrain&&z.style.map.terrain.getTerrainData(ce.coord),x.id,te,q,R.S.simpleSegment(0,2*ce.circleOffset,ce.circleArray.length,ce.circleArray.length/2),null,z.transform.zoom,null,null,null)}var fe;te.destroy(),q.destroy()}ys.disabled=new ys(!1,1029,2305),ys.backCCW=new ys(!0,1029,2305);const es=R.ao(new Float32Array(16));function Bs(z,s,x,I,k,H){const{horizontalAlign:ee,verticalAlign:ne}=R.au(z);return new R.P((-(ee-.5)*s/k+I[0])*H,(-(ne-.5)*x/k+I[1])*H)}function wc(z,s,x,I,k,H,ee,ne,ue,_e,h){const g=z.text.placedSymbolArray,d=z.text.dynamicLayoutVertexArray,b=z.icon.dynamicLayoutVertexArray,B={};d.clear();for(let G=0;G<g.length;G++){const q=g.get(G),te=q.hidden||!q.crossTileID||z.allowVerticalPlacement&&!q.placedOrientation?null:I[q.crossTileID];if(te){const fe=new R.P(q.anchorX,q.anchorY),ce=Ti(fe,x?ee:H,h),Te=Lo(k.cameraToCenterDistance,ce.signedDistanceFromCamera);let Ie=R.aj(z.textSizeData,ue,q)*Te/R.ap;x&&(Ie*=z.tilePixelRatio/ne);const{width:Oe,height:Qe,anchor:nt,textOffset:ct,textBoxScale:tt}=te,Tt=Bs(nt,Oe,Qe,ct,tt,Ie),Ut=x?Ti(fe.add(Tt),H,h).point:ce.point.add(s?Tt.rotate(-k.angle):Tt),Nt=z.allowVerticalPlacement&&q.placedOrientation===R.ai.vertical?Math.PI/2:0;for(let pr=0;pr<q.numGlyphs;pr++)R.ak(d,Ut,Nt);_e&&q.associatedIconIndex>=0&&(B[q.associatedIconIndex]={shiftedAnchor:Ut,angle:Nt})}else le(q.numGlyphs,d)}if(_e){b.clear();const G=z.icon.placedSymbolArray;for(let q=0;q<G.length;q++){const te=G.get(q);if(te.hidden)le(te.numGlyphs,b);else{const fe=B[q];if(fe)for(let ce=0;ce<te.numGlyphs;ce++)R.ak(b,fe.shiftedAnchor,fe.angle);else le(te.numGlyphs,b)}}z.icon.dynamicLayoutVertexBuffer.updateData(b)}z.text.dynamicLayoutVertexBuffer.updateData(d)}function qp(z,s,x){return x.iconsInText&&s?"symbolTextAndIcon":z?"symbolSDF":"symbolIcon"}function Sc(z,s,x,I,k,H,ee,ne,ue,_e,h,g){const d=z.context,b=d.gl,B=z.transform,G=ne==="map",q=ue==="map",te=ne!=="viewport"&&x.layout.get("symbol-placement")!=="point",fe=G&&!q&&!te,ce=!x.layout.get("symbol-sort-key").isConstant();let Te=!1;const Ie=z.depthModeForSublayer(0,Na.ReadOnly),Oe=x._unevaluatedLayout.hasValue("text-variable-anchor")||x._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Qe=[];for(const nt of I){const ct=s.getTile(nt),tt=ct.getBucket(x);if(!tt)continue;const Tt=k?tt.text:tt.icon;if(!Tt||!Tt.segments.get().length||!Tt.hasVisibleVertices)continue;const Ut=Tt.programConfigurations.get(x.id),Nt=k||tt.sdfIcons,pr=k?tt.textSizeData:tt.iconSizeData,tr=q||B.pitch!==0,Dr=z.useProgram(qp(Nt,k,tt),Ut),Hr=R.ah(pr,B.zoom),sn=z.style.map.terrain&&z.style.map.terrain.getTerrainData(nt);let nn,Gn,di,Di,Ui=[0,0],ho=null;if(k)Gn=ct.glyphAtlasTexture,di=b.LINEAR,nn=ct.glyphAtlasTexture.size,tt.iconsInText&&(Ui=ct.imageAtlasTexture.size,ho=ct.imageAtlasTexture,Di=tr||z.options.rotating||z.options.zooming||pr.kind==="composite"||pr.kind==="camera"?b.LINEAR:b.NEAREST);else{const ts=x.layout.get("icon-size").constantOr(0)!==1||tt.iconsNeedLinear;Gn=ct.imageAtlasTexture,di=Nt||z.options.rotating||z.options.zooming||ts||tr?b.LINEAR:b.NEAREST,nn=ct.imageAtlasTexture.size}const gi=je(ct,1,z.transform.zoom),Wi=un(nt.posMatrix,q,G,z.transform,gi),Ko=To(nt.posMatrix,q,G,z.transform,gi),Mo=Oe&&tt.hasTextData(),mo=x.layout.get("icon-text-fit")!=="none"&&Mo&&tt.hasIconData();if(te){const ts=z.style.map.terrain?($a,vs)=>z.style.map.terrain.getElevation(nt,$a,vs):null,ja=x.layout.get("text-rotation-alignment")==="map";dn(tt,nt.posMatrix,z,k,Wi,Ko,q,_e,ja,ts)}const ko=z.translatePosMatrix(nt.posMatrix,ct,H,ee),xo=te||k&&Oe||mo?es:Wi,qi=z.translatePosMatrix(Ko,ct,H,ee,!0),xs=Nt&&x.paint.get(k?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let gs;gs=Nt?tt.iconsInText?Va(pr.kind,Hr,fe,q,z,ko,xo,qi,nn,Ui):Sl(pr.kind,Hr,fe,q,z,ko,xo,qi,k,nn,!0):Xh(pr.kind,Hr,fe,q,z,ko,xo,qi,k,nn);const Cl={program:Dr,buffers:Tt,uniformValues:gs,atlasTexture:Gn,atlasTextureIcon:ho,atlasInterpolation:di,atlasInterpolationIcon:Di,isSDF:Nt,hasHalo:xs};if(ce&&tt.canOverlap){Te=!0;const ts=Tt.segments.get();for(const ja of ts)Qe.push({segments:new R.S([ja]),sortKey:ja.sortKey,state:Cl,terrainData:sn})}else Qe.push({segments:Tt.segments,sortKey:0,state:Cl,terrainData:sn})}Te&&Qe.sort((nt,ct)=>nt.sortKey-ct.sortKey);for(const nt of Qe){const ct=nt.state;if(d.activeTexture.set(b.TEXTURE0),ct.atlasTexture.bind(ct.atlasInterpolation,b.CLAMP_TO_EDGE),ct.atlasTextureIcon&&(d.activeTexture.set(b.TEXTURE1),ct.atlasTextureIcon&&ct.atlasTextureIcon.bind(ct.atlasInterpolationIcon,b.CLAMP_TO_EDGE)),ct.isSDF){const tt=ct.uniformValues;ct.hasHalo&&(tt.u_is_halo=1,$h(ct.buffers,nt.segments,x,z,ct.program,Ie,h,g,tt,nt.terrainData)),tt.u_is_halo=0}$h(ct.buffers,nt.segments,x,z,ct.program,Ie,h,g,ct.uniformValues,nt.terrainData)}}function $h(z,s,x,I,k,H,ee,ne,ue,_e){const h=I.context;k.draw(h,h.gl.TRIANGLES,H,ee,ne,ys.disabled,ue,_e,x.id,z.layoutVertexBuffer,z.indexBuffer,s,x.paint,I.transform.zoom,z.programConfigurations.get(x.id),z.dynamicLayoutVertexBuffer,z.opacityVertexBuffer)}function Xo(z,s,x,I,k){if(!x||!I||!I.imageAtlas)return;const H=I.imageAtlas.patternPositions;let ee=H[x.to.toString()],ne=H[x.from.toString()];if(!ee&&ne&&(ee=ne),!ne&&ee&&(ne=ee),!ee||!ne){const ue=k.getPaintProperty(s);ee=H[ue],ne=H[ue]}ee&&ne&&z.setConstantPatternPositions(ee,ne)}function au(z,s,x,I,k,H,ee){const ne=z.context.gl,ue="fill-pattern",_e=x.paint.get(ue),h=_e&&_e.constantOr(1),g=x.getCrossfadeParameters();let d,b,B,G,q;ee?(b=h&&!x.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",d=ne.LINES):(b=h?"fillPattern":"fill",d=ne.TRIANGLES);const te=_e.constantOr(null);for(const fe of I){const ce=s.getTile(fe);if(h&&!ce.patternsLoaded())continue;const Te=ce.getBucket(x);if(!Te)continue;const Ie=Te.programConfigurations.get(x.id),Oe=z.useProgram(b,Ie),Qe=z.style.map.terrain&&z.style.map.terrain.getTerrainData(fe);h&&(z.context.activeTexture.set(ne.TEXTURE0),ce.imageAtlasTexture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE),Ie.updatePaintBuffers(g)),Xo(Ie,ue,te,ce,x);const nt=Qe?fe:null,ct=z.translatePosMatrix(nt?nt.posMatrix:fe.posMatrix,ce,x.paint.get("fill-translate"),x.paint.get("fill-translate-anchor"));if(ee){G=Te.indexBuffer2,q=Te.segments2;const tt=[ne.drawingBufferWidth,ne.drawingBufferHeight];B=b==="fillOutlinePattern"&&h?ol(ct,z,g,ce,tt):wl(ct,tt)}else G=Te.indexBuffer,q=Te.segments,B=h?gl(ct,z,g,ce):gu(ct);Oe.draw(z.context,d,k,z.stencilModeForClipping(fe),H,ys.disabled,B,Qe,x.id,Te.layoutVertexBuffer,G,q,x.paint,z.transform.zoom,Ie)}}function dl(z,s,x,I,k,H,ee){const ne=z.context,ue=ne.gl,_e="fill-extrusion-pattern",h=x.paint.get(_e),g=h.constantOr(1),d=x.getCrossfadeParameters(),b=x.paint.get("fill-extrusion-opacity"),B=h.constantOr(null);for(const G of I){const q=s.getTile(G),te=q.getBucket(x);if(!te)continue;const fe=z.style.map.terrain&&z.style.map.terrain.getTerrainData(G),ce=te.programConfigurations.get(x.id),Te=z.useProgram(g?"fillExtrusionPattern":"fillExtrusion",ce);g&&(z.context.activeTexture.set(ue.TEXTURE0),q.imageAtlasTexture.bind(ue.LINEAR,ue.CLAMP_TO_EDGE),ce.updatePaintBuffers(d)),Xo(ce,_e,B,q,x);const Ie=z.translatePosMatrix(G.posMatrix,q,x.paint.get("fill-extrusion-translate"),x.paint.get("fill-extrusion-translate-anchor")),Oe=x.paint.get("fill-extrusion-vertical-gradient"),Qe=g?Rl(Ie,z,Oe,b,G,d,q):Ds(Ie,z,Oe,b);Te.draw(ne,ne.gl.TRIANGLES,k,H,ee,ys.backCCW,Qe,fe,x.id,te.layoutVertexBuffer,te.indexBuffer,te.segments,x.paint,z.transform.zoom,ce,z.style.map.terrain&&te.centroidVertexBuffer)}}function tc(z,s,x,I,k,H,ee){const ne=z.context,ue=ne.gl,_e=x.fbo;if(!_e)return;const h=z.useProgram("hillshade"),g=z.style.map.terrain&&z.style.map.terrain.getTerrainData(s);ne.activeTexture.set(ue.TEXTURE0),ue.bindTexture(ue.TEXTURE_2D,_e.colorAttachment.get()),h.draw(ne,ue.TRIANGLES,k,H,ee,ys.disabled,((d,b,B,G)=>{const q=B.paint.get("hillshade-shadow-color"),te=B.paint.get("hillshade-highlight-color"),fe=B.paint.get("hillshade-accent-color");let ce=B.paint.get("hillshade-illumination-direction")*(Math.PI/180);B.paint.get("hillshade-illumination-anchor")==="viewport"&&(ce-=d.transform.angle);const Te=!d.options.moving;return{u_matrix:G?G.posMatrix:d.transform.calculatePosMatrix(b.tileID.toUnwrapped(),Te),u_image:0,u_latrange:ir(0,b.tileID),u_light:[B.paint.get("hillshade-exaggeration"),ce],u_shadow:q,u_highlight:te,u_accent:fe}})(z,x,I,g?s:null),g,I.id,z.rasterBoundsBuffer,z.quadTriangleIndexBuffer,z.rasterBoundsSegments)}function bh(z,s,x,I,k,H){const ee=z.context,ne=ee.gl,ue=s.dem;if(ue&&ue.data){const _e=ue.dim,h=ue.stride,g=ue.getPixels();if(ee.activeTexture.set(ne.TEXTURE1),ee.pixelStoreUnpackPremultiplyAlpha.set(!1),s.demTexture=s.demTexture||z.getTileTexture(h),s.demTexture){const b=s.demTexture;b.update(g,{premultiply:!1}),b.bind(ne.NEAREST,ne.CLAMP_TO_EDGE)}else s.demTexture=new xr(ee,g,ne.RGBA,{premultiply:!1}),s.demTexture.bind(ne.NEAREST,ne.CLAMP_TO_EDGE);ee.activeTexture.set(ne.TEXTURE0);let d=s.fbo;if(!d){const b=new xr(ee,{width:_e,height:_e,data:null},ne.RGBA);b.bind(ne.LINEAR,ne.CLAMP_TO_EDGE),d=s.fbo=ee.createFramebuffer(_e,_e,!0,!1),d.colorAttachment.set(b.texture)}ee.bindFramebuffer.set(d.framebuffer),ee.viewport.set([0,0,_e,_e]),z.useProgram("hillshadePrepare").draw(ee,ne.TRIANGLES,I,k,H,ys.disabled,((b,B)=>{const G=B.stride,q=R.Z();return R.aS(q,0,R.N,-R.N,0,0,1),R.$(q,q,[0,-R.N,0]),{u_matrix:q,u_image:1,u_dimension:[G,G],u_zoom:b.overscaledZ,u_unpack:B.getUnpackVector()}})(s.tileID,ue),null,x.id,z.rasterBoundsBuffer,z.quadTriangleIndexBuffer,z.rasterBoundsSegments),s.needsHillshadePrepare=!1}}function mp(z,s,x,I,k,H){const ee=I.paint.get("raster-fade-duration");if(!H&&ee>0){const ne=R.h.now(),ue=(ne-z.timeAdded)/ee,_e=s?(ne-s.timeAdded)/ee:-1,h=x.getSource(),g=k.coveringZoomLevel({tileSize:h.tileSize,roundZoom:h.roundZoom}),d=!s||Math.abs(s.tileID.overscaledZ-g)>Math.abs(z.tileID.overscaledZ-g),b=d&&z.refreshedUponExpiration?1:R.ad(d?ue:1-_e,0,1);return z.refreshedUponExpiration&&ue>=1&&(z.refreshedUponExpiration=!1),s?{opacity:1,mix:1-b}:{opacity:b,mix:0}}return{opacity:1,mix:0}}const Kh=new R.aT(1,0,0,1),Zc=new R.aT(0,1,0,1),vf=new R.aT(0,0,1,1),Bh=new R.aT(1,0,1,1),_u=new R.aT(0,1,1,1);function Vc(z,s,x,I){Fh(z,0,s+x/2,z.transform.width,x,I)}function Yp(z,s,x,I){Fh(z,s-x/2,0,x,z.transform.height,I)}function Fh(z,s,x,I,k,H){const ee=z.context,ne=ee.gl;ne.enable(ne.SCISSOR_TEST),ne.scissor(s*z.pixelRatio,x*z.pixelRatio,I*z.pixelRatio,k*z.pixelRatio),ee.clear({color:H}),ne.disable(ne.SCISSOR_TEST)}function Ll(z,s,x){const I=z.context,k=I.gl,H=x.posMatrix,ee=z.useProgram("debug"),ne=Na.disabled,ue=Is.disabled,_e=z.colorModeForRenderPass(),h="$debug",g=z.style.map.terrain&&z.style.map.terrain.getTerrainData(x);I.activeTexture.set(k.TEXTURE0);const d=s.getTileByID(x.key).latestRawTileData,b=Math.floor((d&&d.byteLength||0)/1024),B=s.getTile(x).tileSize,G=512/Math.min(B,512)*(x.overscaledZ/z.transform.zoom)*.5;let q=x.canonical.toString();x.overscaledZ!==x.canonical.z&&(q+=` => ${x.overscaledZ}`),function(te,fe){te.initDebugOverlayCanvas();const ce=te.debugOverlayCanvas,Te=te.context.gl,Ie=te.debugOverlayCanvas.getContext("2d");Ie.clearRect(0,0,ce.width,ce.height),Ie.shadowColor="white",Ie.shadowBlur=2,Ie.lineWidth=1.5,Ie.strokeStyle="white",Ie.textBaseline="top",Ie.font="bold 36px Open Sans, sans-serif",Ie.fillText(fe,5,5),Ie.strokeText(fe,5,5),te.debugOverlayTexture.update(ce),te.debugOverlayTexture.bind(Te.LINEAR,Te.CLAMP_TO_EDGE)}(z,`${q} ${b}kB`),ee.draw(I,k.TRIANGLES,ne,ue,Hs.alphaBlended,ys.disabled,Wl(H,R.aT.transparent,G),null,h,z.debugBuffer,z.quadTriangleIndexBuffer,z.debugSegments),ee.draw(I,k.LINE_STRIP,ne,ue,_e,ys.disabled,Wl(H,R.aT.red),g,h,z.debugBuffer,z.tileBorderIndexBuffer,z.debugSegments)}function Fs(z,s,x){const I=z.context,k=I.gl,H=z.colorModeForRenderPass(),ee=new Na(k.LEQUAL,Na.ReadWrite,z.depthRangeFor3D),ne=z.useProgram("terrain"),ue=s.getTerrainMesh();I.bindFramebuffer.set(null),I.viewport.set([0,0,z.width,z.height]);for(const _e of x){const h=z.renderToTexture.getTexture(_e),g=s.getTerrainData(_e.tileID);I.activeTexture.set(k.TEXTURE0),k.bindTexture(k.TEXTURE_2D,h.texture);const d={u_matrix:z.transform.calculatePosMatrix(_e.tileID.toUnwrapped()),u_texture:0,u_ele_delta:s.getMeshFrameDelta(z.transform.zoom)};ne.draw(I,k.TRIANGLES,ee,Is.disabled,H,ys.backCCW,d,g,"terrain",ue.vertexBuffer,ue.indexBuffer,ue.segments)}}class Tc{constructor(s,x){this.context=new Ep(s),this.transform=x,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:R.Z(),renderTime:0},this.setup(),this.numSublayers=ls.maxUnderzooming+ls.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new $o}resize(s,x,I){if(this.width=Math.floor(s*I),this.height=Math.floor(x*I),this.pixelRatio=I,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const k of this.style._order)this.style._layers[k].resize()}setup(){const s=this.context,x=new R.a_;x.emplaceBack(0,0),x.emplaceBack(R.N,0),x.emplaceBack(0,R.N),x.emplaceBack(R.N,R.N),this.tileExtentBuffer=s.createVertexBuffer(x,sc.members),this.tileExtentSegments=R.S.simpleSegment(0,0,4,2);const I=new R.a_;I.emplaceBack(0,0),I.emplaceBack(R.N,0),I.emplaceBack(0,R.N),I.emplaceBack(R.N,R.N),this.debugBuffer=s.createVertexBuffer(I,sc.members),this.debugSegments=R.S.simpleSegment(0,0,4,5);const k=new R.V;k.emplaceBack(0,0,0,0),k.emplaceBack(R.N,0,R.N,0),k.emplaceBack(0,R.N,0,R.N),k.emplaceBack(R.N,R.N,R.N,R.N),this.rasterBoundsBuffer=s.createVertexBuffer(k,vi.members),this.rasterBoundsSegments=R.S.simpleSegment(0,0,4,2);const H=new R.a_;H.emplaceBack(0,0),H.emplaceBack(1,0),H.emplaceBack(0,1),H.emplaceBack(1,1),this.viewportBuffer=s.createVertexBuffer(H,sc.members),this.viewportSegments=R.S.simpleSegment(0,0,4,2);const ee=new R.a$;ee.emplaceBack(0),ee.emplaceBack(1),ee.emplaceBack(3),ee.emplaceBack(2),ee.emplaceBack(0),this.tileBorderIndexBuffer=s.createIndexBuffer(ee);const ne=new R.b0;ne.emplaceBack(0,1,2),ne.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=s.createIndexBuffer(ne);const ue=this.context.gl;this.stencilClearMode=new Is({func:ue.ALWAYS,mask:0},0,255,ue.ZERO,ue.ZERO,ue.ZERO)}clearStencil(){const s=this.context,x=s.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const I=R.Z();R.aS(I,0,this.width,this.height,0,0,1),R.a0(I,I,[x.drawingBufferWidth,x.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(s,x.TRIANGLES,Na.disabled,this.stencilClearMode,Hs.disabled,ys.disabled,ut(I),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(s,x){if(this.currentStencilSource===s.source||!s.isTileClipped()||!x||!x.length)return;this.currentStencilSource=s.source;const I=this.context,k=I.gl;this.nextStencilID+x.length>256&&this.clearStencil(),I.setColorMode(Hs.disabled),I.setDepthMode(Na.disabled);const H=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const ee of x){const ne=this._tileClippingMaskIDs[ee.key]=this.nextStencilID++,ue=this.style.map.terrain&&this.style.map.terrain.getTerrainData(ee);H.draw(I,k.TRIANGLES,Na.disabled,new Is({func:k.ALWAYS,mask:0},ne,255,k.KEEP,k.KEEP,k.REPLACE),Hs.disabled,ys.disabled,ut(ee.posMatrix),ue,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const s=this.nextStencilID++,x=this.context.gl;return new Is({func:x.NOTEQUAL,mask:255},s,255,x.KEEP,x.KEEP,x.REPLACE)}stencilModeForClipping(s){const x=this.context.gl;return new Is({func:x.EQUAL,mask:255},this._tileClippingMaskIDs[s.key],0,x.KEEP,x.KEEP,x.REPLACE)}stencilConfigForOverlap(s){const x=this.context.gl,I=s.sort((ee,ne)=>ne.overscaledZ-ee.overscaledZ),k=I[I.length-1].overscaledZ,H=I[0].overscaledZ-k+1;if(H>1){this.currentStencilSource=void 0,this.nextStencilID+H>256&&this.clearStencil();const ee={};for(let ne=0;ne<H;ne++)ee[ne+k]=new Is({func:x.GEQUAL,mask:255},ne+this.nextStencilID,255,x.KEEP,x.KEEP,x.REPLACE);return this.nextStencilID+=H,[ee,I]}return[{[k]:Is.disabled},I]}colorModeForRenderPass(){const s=this.context.gl;return this._showOverdrawInspector?new Hs([s.CONSTANT_COLOR,s.ONE],new R.aT(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Hs.unblended:Hs.alphaBlended}depthModeForSublayer(s,x,I){if(!this.opaquePassEnabledForLayer())return Na.disabled;const k=1-((1+this.currentLayer)*this.numSublayers+s)*this.depthEpsilon;return new Na(I||this.context.gl.LEQUAL,x,[k,k])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(s,x){this.style=s,this.options=x,this.lineAtlas=s.lineAtlas,this.imageManager=s.imageManager,this.glyphManager=s.glyphManager,this.symbolFadeChange=s.placement.symbolFadeChange(R.h.now()),this.imageManager.beginFrame();const I=this.style._order,k=this.style.sourceCaches,H={},ee={},ne={};for(const ue in k){const _e=k[ue];_e.used&&_e.prepare(this.context),H[ue]=_e.getVisibleCoordinates(),ee[ue]=H[ue].slice().reverse(),ne[ue]=_e.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let ue=0;ue<I.length;ue++)if(this.style._layers[I[ue]].is3D()){this.opaquePassCutoff=ue;break}if(this.renderToTexture){this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0;const ue=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime);(this.terrainFacilitator.dirty||!R.b1(this.terrainFacilitator.matrix,this.transform.projMatrix)||ue.length)&&(R.b2(this.terrainFacilitator.matrix,this.transform.projMatrix),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(_e,h){const g=_e.context,d=g.gl,b=Hs.unblended,B=new Na(d.LEQUAL,Na.ReadWrite,[0,1]),G=h.getTerrainMesh(),q=h.sourceCache.getRenderableTiles(),te=_e.useProgram("terrainDepth");g.bindFramebuffer.set(h.getFramebuffer("depth").framebuffer),g.viewport.set([0,0,_e.width/devicePixelRatio,_e.height/devicePixelRatio]),g.clear({color:R.aT.transparent,depth:1});for(const fe of q){const ce=h.getTerrainData(fe.tileID),Te={u_matrix:_e.transform.calculatePosMatrix(fe.tileID.toUnwrapped()),u_ele_delta:h.getMeshFrameDelta(_e.transform.zoom)};te.draw(g,d.TRIANGLES,B,Is.disabled,b,ys.backCCW,Te,ce,"terrain",G.vertexBuffer,G.indexBuffer,G.segments)}g.bindFramebuffer.set(null),g.viewport.set([0,0,_e.width,_e.height])}(this,this.style.map.terrain),function(_e,h){const g=_e.context,d=g.gl,b=Hs.unblended,B=new Na(d.LEQUAL,Na.ReadWrite,[0,1]),G=h.getTerrainMesh(),q=h.getCoordsTexture(),te=h.sourceCache.getRenderableTiles(),fe=_e.useProgram("terrainCoords");g.bindFramebuffer.set(h.getFramebuffer("coords").framebuffer),g.viewport.set([0,0,_e.width/devicePixelRatio,_e.height/devicePixelRatio]),g.clear({color:R.aT.transparent,depth:1}),h.coordsIndex=[];for(const ce of te){const Te=h.getTerrainData(ce.tileID);g.activeTexture.set(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,q.texture);const Ie={u_matrix:_e.transform.calculatePosMatrix(ce.tileID.toUnwrapped()),u_terrain_coords_id:(255-h.coordsIndex.length)/255,u_texture:0,u_ele_delta:h.getMeshFrameDelta(_e.transform.zoom)};fe.draw(g,d.TRIANGLES,B,Is.disabled,b,ys.backCCW,Ie,Te,"terrain",G.vertexBuffer,G.indexBuffer,G.segments),h.coordsIndex.push(ce.tileID.key)}g.bindFramebuffer.set(null),g.viewport.set([0,0,_e.width,_e.height])}(this,this.style.map.terrain))}this.renderPass="offscreen";for(const ue of I){const _e=this.style._layers[ue];if(!_e.hasOffscreenPass()||_e.isHidden(this.transform.zoom))continue;const h=ee[_e.source];(_e.type==="custom"||h.length)&&this.renderLayer(this,k[_e.source],_e,h)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:x.showOverdrawInspector?R.aT.black:R.aT.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=x.showOverdrawInspector,this.depthRangeFor3D=[0,1-(s._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=I.length-1;this.currentLayer>=0;this.currentLayer--){const ue=this.style._layers[I[this.currentLayer]],_e=k[ue.source],h=H[ue.source];this._renderTileClippingMasks(ue,h),this.renderLayer(this,_e,ue,h)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<I.length;this.currentLayer++){const ue=this.style._layers[I[this.currentLayer]],_e=k[ue.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(ue))continue;const h=(ue.type==="symbol"?ne:ee)[ue.source];this._renderTileClippingMasks(ue,H[ue.source]),this.renderLayer(this,_e,ue,h)}if(this.options.showTileBoundaries){const ue=function(_e,h){let g=null;const d=Object.values(_e._layers).flatMap(q=>q.source&&!q.isHidden(h)?[_e.sourceCaches[q.source]]:[]),b=d.filter(q=>q.getSource().type==="vector"),B=d.filter(q=>q.getSource().type!=="vector"),G=q=>{(!g||g.getSource().maxzoom<q.getSource().maxzoom)&&(g=q)};return b.forEach(q=>G(q)),g||B.forEach(q=>G(q)),g}(this.style,this.transform.zoom);ue&&function(_e,h,g){for(let d=0;d<g.length;d++)Ll(_e,h,g[d])}(this,ue,ue.getVisibleCoordinates())}this.options.showPadding&&function(ue){const _e=ue.transform.padding;Vc(ue,ue.transform.height-(_e.top||0),3,Kh),Vc(ue,_e.bottom||0,3,Zc),Yp(ue,_e.left||0,3,vf),Yp(ue,ue.transform.width-(_e.right||0),3,Bh);const h=ue.transform.centerPoint;(function(g,d,b,B){Fh(g,d-1,b-10,2,20,B),Fh(g,d-10,b-1,20,2,B)})(ue,h.x,ue.transform.height-h.y,_u)}(this),this.context.setDefault()}renderLayer(s,x,I,k){if(!I.isHidden(this.transform.zoom)&&(I.type==="background"||I.type==="custom"||(k||[]).length))switch(this.id=I.id,I.type){case"symbol":(function(H,ee,ne,ue,_e){if(H.renderPass!=="translucent")return;const h=Is.disabled,g=H.colorModeForRenderPass();(ne._unevaluatedLayout.hasValue("text-variable-anchor")||ne._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(d,b,B,G,q,te,fe){const ce=b.transform,Te=q==="map",Ie=te==="map";for(const Oe of d){const Qe=G.getTile(Oe),nt=Qe.getBucket(B);if(!nt||!nt.text||!nt.text.segments.get().length)continue;const ct=R.ah(nt.textSizeData,ce.zoom),tt=je(Qe,1,b.transform.zoom),Tt=un(Oe.posMatrix,Ie,Te,b.transform,tt),Ut=B.layout.get("icon-text-fit")!=="none"&&nt.hasIconData();if(ct){const Nt=Math.pow(2,ce.zoom-Qe.tileID.overscaledZ);wc(nt,Te,Ie,fe,ce,Tt,Oe.posMatrix,Nt,ct,Ut,b.style.map.terrain?(pr,tr)=>b.style.map.terrain.getElevation(Oe,pr,tr):null)}}}(ue,H,ne,ee,ne.layout.get("text-rotation-alignment"),ne.layout.get("text-pitch-alignment"),_e),ne.paint.get("icon-opacity").constantOr(1)!==0&&Sc(H,ee,ne,ue,!1,ne.paint.get("icon-translate"),ne.paint.get("icon-translate-anchor"),ne.layout.get("icon-rotation-alignment"),ne.layout.get("icon-pitch-alignment"),ne.layout.get("icon-keep-upright"),h,g),ne.paint.get("text-opacity").constantOr(1)!==0&&Sc(H,ee,ne,ue,!0,ne.paint.get("text-translate"),ne.paint.get("text-translate-anchor"),ne.layout.get("text-rotation-alignment"),ne.layout.get("text-pitch-alignment"),ne.layout.get("text-keep-upright"),h,g),ee.map.showCollisionBoxes&&(Bf(H,ee,ne,ue,ne.paint.get("text-translate"),ne.paint.get("text-translate-anchor"),!0),Bf(H,ee,ne,ue,ne.paint.get("icon-translate"),ne.paint.get("icon-translate-anchor"),!1))})(s,x,I,k,this.style.placement.variableOffsets);break;case"circle":(function(H,ee,ne,ue){if(H.renderPass!=="translucent")return;const _e=ne.paint.get("circle-opacity"),h=ne.paint.get("circle-stroke-width"),g=ne.paint.get("circle-stroke-opacity"),d=!ne.layout.get("circle-sort-key").isConstant();if(_e.constantOr(1)===0&&(h.constantOr(1)===0||g.constantOr(1)===0))return;const b=H.context,B=b.gl,G=H.depthModeForSublayer(0,Na.ReadOnly),q=Is.disabled,te=H.colorModeForRenderPass(),fe=[];for(let ce=0;ce<ue.length;ce++){const Te=ue[ce],Ie=ee.getTile(Te),Oe=Ie.getBucket(ne);if(!Oe)continue;const Qe=Oe.programConfigurations.get(ne.id),nt=H.useProgram("circle",Qe),ct=Oe.layoutVertexBuffer,tt=Oe.indexBuffer,Tt=H.style.map.terrain&&H.style.map.terrain.getTerrainData(Te),Ut={programConfiguration:Qe,program:nt,layoutVertexBuffer:ct,indexBuffer:tt,uniformValues:Qa(H,Te,Ie,ne),terrainData:Tt};if(d){const Nt=Oe.segments.get();for(const pr of Nt)fe.push({segments:new R.S([pr]),sortKey:pr.sortKey,state:Ut})}else fe.push({segments:Oe.segments,sortKey:0,state:Ut})}d&&fe.sort((ce,Te)=>ce.sortKey-Te.sortKey);for(const ce of fe){const{programConfiguration:Te,program:Ie,layoutVertexBuffer:Oe,indexBuffer:Qe,uniformValues:nt,terrainData:ct}=ce.state;Ie.draw(b,B.TRIANGLES,G,q,te,ys.disabled,nt,ct,ne.id,Oe,Qe,ce.segments,ne.paint,H.transform.zoom,Te)}})(s,x,I,k);break;case"heatmap":(function(H,ee,ne,ue){if(ne.paint.get("heatmap-opacity")!==0)if(H.renderPass==="offscreen"){const _e=H.context,h=_e.gl,g=Is.disabled,d=new Hs([h.ONE,h.ONE],R.aT.transparent,[!0,!0,!0,!0]);(function(b,B,G){const q=b.gl;b.activeTexture.set(q.TEXTURE1),b.viewport.set([0,0,B.width/4,B.height/4]);let te=G.heatmapFbo;if(te)q.bindTexture(q.TEXTURE_2D,te.colorAttachment.get()),b.bindFramebuffer.set(te.framebuffer);else{const fe=q.createTexture();q.bindTexture(q.TEXTURE_2D,fe),q.texParameteri(q.TEXTURE_2D,q.TEXTURE_WRAP_S,q.CLAMP_TO_EDGE),q.texParameteri(q.TEXTURE_2D,q.TEXTURE_WRAP_T,q.CLAMP_TO_EDGE),q.texParameteri(q.TEXTURE_2D,q.TEXTURE_MIN_FILTER,q.LINEAR),q.texParameteri(q.TEXTURE_2D,q.TEXTURE_MAG_FILTER,q.LINEAR),te=G.heatmapFbo=b.createFramebuffer(B.width/4,B.height/4,!1,!1),function(ce,Te,Ie,Oe){var Qe,nt;const ct=ce.gl,tt=(Qe=ce.HALF_FLOAT)!==null&&Qe!==void 0?Qe:ct.UNSIGNED_BYTE,Tt=(nt=ce.RGBA16F)!==null&&nt!==void 0?nt:ct.RGBA;ct.texImage2D(ct.TEXTURE_2D,0,Tt,Te.width/4,Te.height/4,0,ct.RGBA,tt,null),Oe.colorAttachment.set(Ie)}(b,B,fe,te)}})(_e,H,ne),_e.clear({color:R.aT.transparent});for(let b=0;b<ue.length;b++){const B=ue[b];if(ee.hasRenderableParent(B))continue;const G=ee.getTile(B),q=G.getBucket(ne);if(!q)continue;const te=q.programConfigurations.get(ne.id),fe=H.useProgram("heatmap",te),{zoom:ce}=H.transform;fe.draw(_e,h.TRIANGLES,Na.disabled,g,d,ys.disabled,At(B.posMatrix,G,ce,ne.paint.get("heatmap-intensity")),null,ne.id,q.layoutVertexBuffer,q.indexBuffer,q.segments,ne.paint,H.transform.zoom,te)}_e.viewport.set([0,0,H.width,H.height])}else H.renderPass==="translucent"&&(H.context.setColorMode(H.colorModeForRenderPass()),function(_e,h){const g=_e.context,d=g.gl,b=h.heatmapFbo;if(!b)return;g.activeTexture.set(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,b.colorAttachment.get()),g.activeTexture.set(d.TEXTURE1);let B=h.colorRampTexture;B||(B=h.colorRampTexture=new xr(g,h.colorRamp,d.RGBA)),B.bind(d.LINEAR,d.CLAMP_TO_EDGE),_e.useProgram("heatmapTexture").draw(g,d.TRIANGLES,Na.disabled,Is.disabled,_e.colorModeForRenderPass(),ys.disabled,((G,q,te,fe)=>{const ce=R.Z();R.aS(ce,0,G.width,G.height,0,0,1);const Te=G.context.gl;return{u_matrix:ce,u_world:[Te.drawingBufferWidth,Te.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:q.paint.get("heatmap-opacity")}})(_e,h),null,h.id,_e.viewportBuffer,_e.quadTriangleIndexBuffer,_e.viewportSegments,h.paint,_e.transform.zoom)}(H,ne))})(s,x,I,k);break;case"line":(function(H,ee,ne,ue){if(H.renderPass!=="translucent")return;const _e=ne.paint.get("line-opacity"),h=ne.paint.get("line-width");if(_e.constantOr(1)===0||h.constantOr(1)===0)return;const g=H.depthModeForSublayer(0,Na.ReadOnly),d=H.colorModeForRenderPass(),b=ne.paint.get("line-dasharray"),B=ne.paint.get("line-pattern"),G=B.constantOr(1),q=ne.paint.get("line-gradient"),te=ne.getCrossfadeParameters(),fe=G?"linePattern":b?"lineSDF":q?"lineGradient":"line",ce=H.context,Te=ce.gl;let Ie=!0;for(const Oe of ue){const Qe=ee.getTile(Oe);if(G&&!Qe.patternsLoaded())continue;const nt=Qe.getBucket(ne);if(!nt)continue;const ct=nt.programConfigurations.get(ne.id),tt=H.context.program.get(),Tt=H.useProgram(fe,ct),Ut=Ie||Tt.program!==tt,Nt=H.style.map.terrain&&H.style.map.terrain.getTerrainData(Oe),pr=B.constantOr(null);if(pr&&Qe.imageAtlas){const Hr=Qe.imageAtlas,sn=Hr.patternPositions[pr.to.toString()],nn=Hr.patternPositions[pr.from.toString()];sn&&nn&&ct.setConstantPatternPositions(sn,nn)}const tr=Nt?Oe:null,Dr=G?oo(H,Qe,ne,te,tr):b?Xa(H,Qe,ne,b,te,tr):q?Dn(H,Qe,ne,nt.lineClipsArray.length,tr):jr(H,Qe,ne,tr);if(G)ce.activeTexture.set(Te.TEXTURE0),Qe.imageAtlasTexture.bind(Te.LINEAR,Te.CLAMP_TO_EDGE),ct.updatePaintBuffers(te);else if(b&&(Ut||H.lineAtlas.dirty))ce.activeTexture.set(Te.TEXTURE0),H.lineAtlas.bind(ce);else if(q){const Hr=nt.gradients[ne.id];let sn=Hr.texture;if(ne.gradientVersion!==Hr.version){let nn=256;if(ne.stepInterpolant){const Gn=ee.getSource().maxzoom,di=Oe.canonical.z===Gn?Math.ceil(1<<H.transform.maxZoom-Oe.canonical.z):1;nn=R.ad(R.aY(nt.maxLineLength/R.N*1024*di),256,ce.maxTextureSize)}Hr.gradient=R.aZ({expression:ne.gradientExpression(),evaluationKey:"lineProgress",resolution:nn,image:Hr.gradient||void 0,clips:nt.lineClipsArray}),Hr.texture?Hr.texture.update(Hr.gradient):Hr.texture=new xr(ce,Hr.gradient,Te.RGBA),Hr.version=ne.gradientVersion,sn=Hr.texture}ce.activeTexture.set(Te.TEXTURE0),sn.bind(ne.stepInterpolant?Te.NEAREST:Te.LINEAR,Te.CLAMP_TO_EDGE)}Tt.draw(ce,Te.TRIANGLES,g,H.stencilModeForClipping(Oe),d,ys.disabled,Dr,Nt,ne.id,nt.layoutVertexBuffer,nt.indexBuffer,nt.segments,ne.paint,H.transform.zoom,ct,nt.layoutVertexBuffer2),Ie=!1}})(s,x,I,k);break;case"fill":(function(H,ee,ne,ue){const _e=ne.paint.get("fill-color"),h=ne.paint.get("fill-opacity");if(h.constantOr(1)===0)return;const g=H.colorModeForRenderPass(),d=ne.paint.get("fill-pattern"),b=H.opaquePassEnabledForLayer()&&!d.constantOr(1)&&_e.constantOr(R.aT.transparent).a===1&&h.constantOr(0)===1?"opaque":"translucent";if(H.renderPass===b){const B=H.depthModeForSublayer(1,H.renderPass==="opaque"?Na.ReadWrite:Na.ReadOnly);au(H,ee,ne,ue,B,g,!1)}if(H.renderPass==="translucent"&&ne.paint.get("fill-antialias")){const B=H.depthModeForSublayer(ne.getPaintProperty("fill-outline-color")?2:0,Na.ReadOnly);au(H,ee,ne,ue,B,g,!0)}})(s,x,I,k);break;case"fill-extrusion":(function(H,ee,ne,ue){const _e=ne.paint.get("fill-extrusion-opacity");if(_e!==0&&H.renderPass==="translucent"){const h=new Na(H.context.gl.LEQUAL,Na.ReadWrite,H.depthRangeFor3D);if(_e!==1||ne.paint.get("fill-extrusion-pattern").constantOr(1))dl(H,ee,ne,ue,h,Is.disabled,Hs.disabled),dl(H,ee,ne,ue,h,H.stencilModeFor3D(),H.colorModeForRenderPass());else{const g=H.colorModeForRenderPass();dl(H,ee,ne,ue,h,Is.disabled,g)}}})(s,x,I,k);break;case"hillshade":(function(H,ee,ne,ue){if(H.renderPass!=="offscreen"&&H.renderPass!=="translucent")return;const _e=H.context,h=H.depthModeForSublayer(0,Na.ReadOnly),g=H.colorModeForRenderPass(),[d,b]=H.renderPass==="translucent"?H.stencilConfigForOverlap(ue):[{},ue];for(const B of b){const G=ee.getTile(B);G.needsHillshadePrepare!==void 0&&G.needsHillshadePrepare&&H.renderPass==="offscreen"?bh(H,G,ne,h,Is.disabled,g):H.renderPass==="translucent"&&tc(H,B,G,ne,h,d[B.overscaledZ],g)}_e.viewport.set([0,0,H.width,H.height])})(s,x,I,k);break;case"raster":(function(H,ee,ne,ue){if(H.renderPass!=="translucent"||ne.paint.get("raster-opacity")===0||!ue.length)return;const _e=H.context,h=_e.gl,g=ee.getSource(),d=H.useProgram("raster"),b=H.colorModeForRenderPass(),[B,G]=g instanceof bo?[{},ue]:H.stencilConfigForOverlap(ue),q=G[G.length-1].overscaledZ,te=!H.options.moving;for(const fe of G){const ce=H.depthModeForSublayer(fe.overscaledZ-q,ne.paint.get("raster-opacity")===1?Na.ReadWrite:Na.ReadOnly,h.LESS),Te=ee.getTile(fe);Te.registerFadeDuration(ne.paint.get("raster-fade-duration"));const Ie=ee.findLoadedParent(fe,0),Oe=mp(Te,Ie,ee,ne,H.transform,H.style.map.terrain);let Qe,nt;const ct=ne.paint.get("raster-resampling")==="nearest"?h.NEAREST:h.LINEAR;_e.activeTexture.set(h.TEXTURE0),Te.texture.bind(ct,h.CLAMP_TO_EDGE,h.LINEAR_MIPMAP_NEAREST),_e.activeTexture.set(h.TEXTURE1),Ie?(Ie.texture.bind(ct,h.CLAMP_TO_EDGE,h.LINEAR_MIPMAP_NEAREST),Qe=Math.pow(2,Ie.tileID.overscaledZ-Te.tileID.overscaledZ),nt=[Te.tileID.canonical.x*Qe%1,Te.tileID.canonical.y*Qe%1]):Te.texture.bind(ct,h.CLAMP_TO_EDGE,h.LINEAR_MIPMAP_NEAREST);const tt=H.style.map.terrain&&H.style.map.terrain.getTerrainData(fe),Tt=tt?fe:null,Ut=Tt?Tt.posMatrix:H.transform.calculatePosMatrix(fe.toUnwrapped(),te),Nt=Il(Ut,nt||[0,0],Qe||1,Oe,ne);g instanceof bo?d.draw(_e,h.TRIANGLES,ce,Is.disabled,b,ys.disabled,Nt,tt,ne.id,g.boundsBuffer,H.quadTriangleIndexBuffer,g.boundsSegments):d.draw(_e,h.TRIANGLES,ce,B[fe.overscaledZ],b,ys.disabled,Nt,tt,ne.id,H.rasterBoundsBuffer,H.quadTriangleIndexBuffer,H.rasterBoundsSegments)}})(s,x,I,k);break;case"background":(function(H,ee,ne,ue){const _e=ne.paint.get("background-color"),h=ne.paint.get("background-opacity");if(h===0)return;const g=H.context,d=g.gl,b=H.transform,B=b.tileSize,G=ne.paint.get("background-pattern");if(H.isPatternMissing(G))return;const q=!G&&_e.a===1&&h===1&&H.opaquePassEnabledForLayer()?"opaque":"translucent";if(H.renderPass!==q)return;const te=Is.disabled,fe=H.depthModeForSublayer(0,q==="opaque"?Na.ReadWrite:Na.ReadOnly),ce=H.colorModeForRenderPass(),Te=H.useProgram(G?"backgroundPattern":"background"),Ie=ue||b.coveringTiles({tileSize:B,terrain:H.style.map.terrain});G&&(g.activeTexture.set(d.TEXTURE0),H.imageManager.bind(H.context));const Oe=ne.getCrossfadeParameters();for(const Qe of Ie){const nt=ue?Qe.posMatrix:H.transform.calculatePosMatrix(Qe.toUnwrapped()),ct=G?Ni(nt,h,H,G,{tileID:Qe,tileSize:B},Oe):Aa(nt,h,_e),tt=H.style.map.terrain&&H.style.map.terrain.getTerrainData(Qe);Te.draw(g,d.TRIANGLES,fe,te,ce,ys.disabled,ct,tt,ne.id,H.tileExtentBuffer,H.quadTriangleIndexBuffer,H.tileExtentSegments)}})(s,0,I,k);break;case"custom":(function(H,ee,ne){const ue=H.context,_e=ne.implementation;if(H.renderPass==="offscreen"){const h=_e.prerender;h&&(H.setCustomLayerDefaults(),ue.setColorMode(H.colorModeForRenderPass()),h.call(_e,ue.gl,H.transform.customLayerMatrix()),ue.setDirty(),H.setBaseState())}else if(H.renderPass==="translucent"){H.setCustomLayerDefaults(),ue.setColorMode(H.colorModeForRenderPass()),ue.setStencilMode(Is.disabled);const h=_e.renderingMode==="3d"?new Na(H.context.gl.LEQUAL,Na.ReadWrite,H.depthRangeFor3D):H.depthModeForSublayer(0,Na.ReadOnly);ue.setDepthMode(h),_e.render(ue.gl,H.transform.customLayerMatrix()),ue.setDirty(),H.setBaseState(),ue.bindFramebuffer.set(null)}})(s,0,I)}}translatePosMatrix(s,x,I,k,H){if(!I[0]&&!I[1])return s;const ee=H?k==="map"?this.transform.angle:0:k==="viewport"?-this.transform.angle:0;if(ee){const _e=Math.sin(ee),h=Math.cos(ee);I=[I[0]*h-I[1]*_e,I[0]*_e+I[1]*h]}const ne=[H?I[0]:je(x,I[0],this.transform.zoom),H?I[1]:je(x,I[1],this.transform.zoom),0],ue=new Float32Array(16);return R.$(ue,s,ne),ue}saveTileTexture(s){const x=this._tileTextures[s.size[0]];x?x.push(s):this._tileTextures[s.size[0]]=[s]}getTileTexture(s){const x=this._tileTextures[s];return x&&x.length>0?x.pop():null}isPatternMissing(s){if(!s)return!1;if(!s.from||!s.to)return!0;const x=this.imageManager.getPattern(s.from.toString()),I=this.imageManager.getPattern(s.to.toString());return!x||!I}useProgram(s,x){this.cache=this.cache||{};const I=s+(x?x.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[I]||(this.cache[I]=new El(this.context,oa[s],x,lc[s],this._showOverdrawInspector,this.style.map.terrain)),this.cache[I]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const s=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(s.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new xr(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:s,drawingBufferHeight:x}=this.context.gl;return this.width!==s||this.height!==x}}class Ru{constructor(s,x){this.points=s,this.planes=x}static fromInvProjectionMatrix(s,x,I){const k=Math.pow(2,I),H=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(ne=>{const ue=1/(ne=R.ag([],ne,s))[3]/x*k;return R.b3(ne,ne,[ue,ue,1/ne[3],ue])}),ee=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(ne=>{const ue=function(d,b){var B=b[0],G=b[1],q=b[2],te=B*B+G*G+q*q;return te>0&&(te=1/Math.sqrt(te)),d[0]=b[0]*te,d[1]=b[1]*te,d[2]=b[2]*te,d}([],function(d,b,B){var G=b[0],q=b[1],te=b[2],fe=B[0],ce=B[1],Te=B[2];return d[0]=q*Te-te*ce,d[1]=te*fe-G*Te,d[2]=G*ce-q*fe,d}([],Kn([],H[ne[0]],H[ne[1]]),Kn([],H[ne[2]],H[ne[1]]))),_e=-((h=ue)[0]*(g=H[ne[1]])[0]+h[1]*g[1]+h[2]*g[2]);var h,g;return ue.concat(_e)});return new Ru(H,ee)}}class jc{constructor(s,x){this.min=s,this.max=x,this.center=function(I,k,H){return I[0]=.5*k[0],I[1]=.5*k[1],I[2]=.5*k[2],I}([],function(I,k,H){return I[0]=k[0]+H[0],I[1]=k[1]+H[1],I[2]=k[2]+H[2],I}([],this.min,this.max))}quadrant(s){const x=[s%2==0,s<2],I=Ar(this.min),k=Ar(this.max);for(let H=0;H<x.length;H++)I[H]=x[H]?this.min[H]:this.center[H],k[H]=x[H]?this.center[H]:this.max[H];return k[2]=this.max[2],new jc(I,k)}distanceX(s){return Math.max(Math.min(this.max[0],s[0]),this.min[0])-s[0]}distanceY(s){return Math.max(Math.min(this.max[1],s[1]),this.min[1])-s[1]}intersects(s){const x=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let I=!0;for(let k=0;k<s.planes.length;k++){const H=s.planes[k];let ee=0;for(let ne=0;ne<x.length;ne++)R.b4(H,x[ne])>=0&&ee++;if(ee===0)return 0;ee!==x.length&&(I=!1)}if(I)return 2;for(let k=0;k<3;k++){let H=Number.MAX_VALUE,ee=-Number.MAX_VALUE;for(let ne=0;ne<s.points.length;ne++){const ue=s.points[ne][k]-this.min[k];H=Math.min(H,ue),ee=Math.max(ee,ue)}if(ee<0||H>this.max[k]-this.min[k])return 0}return 1}}class $p{constructor(s=0,x=0,I=0,k=0){if(isNaN(s)||s<0||isNaN(x)||x<0||isNaN(I)||I<0||isNaN(k)||k<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=s,this.bottom=x,this.left=I,this.right=k}interpolate(s,x,I){return x.top!=null&&s.top!=null&&(this.top=R.B.number(s.top,x.top,I)),x.bottom!=null&&s.bottom!=null&&(this.bottom=R.B.number(s.bottom,x.bottom,I)),x.left!=null&&s.left!=null&&(this.left=R.B.number(s.left,x.left,I)),x.right!=null&&s.right!=null&&(this.right=R.B.number(s.right,x.right,I)),this}getCenter(s,x){const I=R.ad((this.left+s-this.right)/2,0,s),k=R.ad((this.top+x-this.bottom)/2,0,x);return new R.P(I,k)}equals(s){return this.top===s.top&&this.bottom===s.bottom&&this.left===s.left&&this.right===s.right}clone(){return new $p(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Jh{constructor(s,x,I,k,H){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=H===void 0||!!H,this._minZoom=s||0,this._maxZoom=x||22,this._minPitch=I==null?0:I,this._maxPitch=k==null?60:k,this.setMaxBounds(),this.width=0,this.height=0,this._center=new R.L(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new $p,this._posMatrixCache={},this._alignedPosMatrixCache={},this._minEleveationForCurrentTile=0}clone(){const s=new Jh(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return s.apply(this),s}apply(s){this.tileSize=s.tileSize,this.latRange=s.latRange,this.width=s.width,this.height=s.height,this._center=s._center,this._elevation=s._elevation,this._minEleveationForCurrentTile=s._minEleveationForCurrentTile,this.zoom=s.zoom,this.angle=s.angle,this._fov=s._fov,this._pitch=s._pitch,this._unmodified=s._unmodified,this._edgeInsets=s._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(s){this._minZoom!==s&&(this._minZoom=s,this.zoom=Math.max(this.zoom,s))}get maxZoom(){return this._maxZoom}set maxZoom(s){this._maxZoom!==s&&(this._maxZoom=s,this.zoom=Math.min(this.zoom,s))}get minPitch(){return this._minPitch}set minPitch(s){this._minPitch!==s&&(this._minPitch=s,this.pitch=Math.max(this.pitch,s))}get maxPitch(){return this._maxPitch}set maxPitch(s){this._maxPitch!==s&&(this._maxPitch=s,this.pitch=Math.min(this.pitch,s))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(s){s===void 0?s=!0:s===null&&(s=!1),this._renderWorldCopies=s}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new R.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(s){const x=-R.b5(s,-180,180)*Math.PI/180;this.angle!==x&&(this._unmodified=!1,this.angle=x,this._calcMatrices(),this.rotationMatrix=function(){var I=new R.A(4);return R.A!=Float32Array&&(I[1]=0,I[2]=0),I[0]=1,I[3]=1,I}(),function(I,k,H){var ee=k[0],ne=k[1],ue=k[2],_e=k[3],h=Math.sin(H),g=Math.cos(H);I[0]=ee*g+ue*h,I[1]=ne*g+_e*h,I[2]=ee*-h+ue*g,I[3]=ne*-h+_e*g}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(s){const x=R.ad(s,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==x&&(this._unmodified=!1,this._pitch=x,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(s){s=Math.max(.01,Math.min(60,s)),this._fov!==s&&(this._unmodified=!1,this._fov=s/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(s){const x=Math.min(Math.max(s,this.minZoom),this.maxZoom);this._zoom!==x&&(this._unmodified=!1,this._zoom=x,this.tileZoom=Math.max(0,Math.floor(x)),this.scale=this.zoomScale(x),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(s){s.lat===this._center.lat&&s.lng===this._center.lng||(this._unmodified=!1,this._center=s,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(s){s!==this._elevation&&(this._elevation=s,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(s){this._edgeInsets.equals(s)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,s,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(s){return this._edgeInsets.equals(s)}interpolatePadding(s,x,I){this._unmodified=!1,this._edgeInsets.interpolate(s,x,I),this._constrain(),this._calcMatrices()}coveringZoomLevel(s){const x=(s.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/s.tileSize));return Math.max(0,x)}getVisibleUnwrappedCoordinates(s){const x=[new R.b6(0,s)];if(this._renderWorldCopies){const I=this.pointCoordinate(new R.P(0,0)),k=this.pointCoordinate(new R.P(this.width,0)),H=this.pointCoordinate(new R.P(this.width,this.height)),ee=this.pointCoordinate(new R.P(0,this.height)),ne=Math.floor(Math.min(I.x,k.x,H.x,ee.x)),ue=Math.floor(Math.max(I.x,k.x,H.x,ee.x)),_e=1;for(let h=ne-_e;h<=ue+_e;h++)h!==0&&x.push(new R.b6(h,s))}return x}coveringTiles(s){var x,I;let k=this.coveringZoomLevel(s);const H=k;if(s.minzoom!==void 0&&k<s.minzoom)return[];s.maxzoom!==void 0&&k>s.maxzoom&&(k=s.maxzoom);const ee=this.pointCoordinate(this.getCameraPoint()),ne=R.U.fromLngLat(this.center),ue=Math.pow(2,k),_e=[ue*ee.x,ue*ee.y,0],h=[ue*ne.x,ue*ne.y,0],g=Ru.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,k);let d=s.minzoom||0;!s.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(d=k);const b=s.terrain?2/Math.min(this.tileSize,s.tileSize)*this.tileSize:3,B=ce=>({aabb:new jc([ce*ue,0,0],[(ce+1)*ue,ue,0]),zoom:0,x:0,y:0,wrap:ce,fullyVisible:!1}),G=[],q=[],te=k,fe=s.reparseOverscaled?H:k;if(this._renderWorldCopies)for(let ce=1;ce<=3;ce++)G.push(B(-ce)),G.push(B(ce));for(G.push(B(0));G.length>0;){const ce=G.pop(),Te=ce.x,Ie=ce.y;let Oe=ce.fullyVisible;if(!Oe){const Tt=ce.aabb.intersects(g);if(Tt===0)continue;Oe=Tt===2}const Qe=s.terrain?_e:h,nt=ce.aabb.distanceX(Qe),ct=ce.aabb.distanceY(Qe),tt=Math.max(Math.abs(nt),Math.abs(ct));if(ce.zoom===te||tt>b+(1<<te-ce.zoom)-2&&ce.zoom>=d){const Tt=te-ce.zoom,Ut=_e[0]-.5-(Te<<Tt),Nt=_e[1]-.5-(Ie<<Tt);q.push({tileID:new R.O(ce.zoom===te?fe:ce.zoom,ce.wrap,ce.zoom,Te,Ie),distanceSq:Jn([h[0]-.5-Te,h[1]-.5-Ie]),tileDistanceToCamera:Math.sqrt(Ut*Ut+Nt*Nt)})}else for(let Tt=0;Tt<4;Tt++){const Ut=(Te<<1)+Tt%2,Nt=(Ie<<1)+(Tt>>1),pr=ce.zoom+1;let tr=ce.aabb.quadrant(Tt);if(s.terrain){const Dr=new R.O(pr,ce.wrap,pr,Ut,Nt),Hr=s.terrain.getMinMaxElevation(Dr),sn=(x=Hr.minElevation)!==null&&x!==void 0?x:this.elevation,nn=(I=Hr.maxElevation)!==null&&I!==void 0?I:this.elevation;tr=new jc([tr.min[0],tr.min[1],sn],[tr.max[0],tr.max[1],nn])}G.push({aabb:tr,zoom:pr,x:Ut,y:Nt,wrap:ce.wrap,fullyVisible:Oe})}}return q.sort((ce,Te)=>ce.distanceSq-Te.distanceSq).map(ce=>ce.tileID)}resize(s,x){this.width=s,this.height=x,this.pixelsToGLUnits=[2/s,-2/x],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(s){return Math.pow(2,s)}scaleZoom(s){return Math.log(s)/Math.LN2}project(s){const x=R.ad(s.lat,-this.maxValidLatitude,this.maxValidLatitude);return new R.P(R.G(s.lng)*this.worldSize,R.H(x)*this.worldSize)}unproject(s){return new R.U(s.x/this.worldSize,s.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(s){const x=this.pointLocation(this.centerPoint,s),I=s.getElevationForLngLatZoom(x,this.tileZoom);if(!(this.elevation-I))return;const k=this.getCameraPosition(),H=R.U.fromLngLat(k.lngLat,k.altitude),ee=R.U.fromLngLat(x,I),ne=H.x-ee.x,ue=H.y-ee.y,_e=H.z-ee.z,h=Math.sqrt(ne*ne+ue*ue+_e*_e),g=this.scaleZoom(this.cameraToCenterDistance/h/this.tileSize);this._elevation=I,this._center=x,this.zoom=g}setLocationAtPoint(s,x){const I=this.pointCoordinate(x),k=this.pointCoordinate(this.centerPoint),H=this.locationCoordinate(s),ee=new R.U(H.x-(I.x-k.x),H.y-(I.y-k.y));this.center=this.coordinateLocation(ee),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(s,x){return x?this.coordinatePoint(this.locationCoordinate(s),x.getElevationForLngLatZoom(s,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(s))}pointLocation(s,x){return this.coordinateLocation(this.pointCoordinate(s,x))}locationCoordinate(s){return R.U.fromLngLat(s)}coordinateLocation(s){return s&&s.toLngLat()}pointCoordinate(s,x){if(x){const d=x.pointCoordinate(s);if(d!=null)return d}const I=[s.x,s.y,0,1],k=[s.x,s.y,1,1];R.ag(I,I,this.pixelMatrixInverse),R.ag(k,k,this.pixelMatrixInverse);const H=I[3],ee=k[3],ne=I[1]/H,ue=k[1]/ee,_e=I[2]/H,h=k[2]/ee,g=_e===h?0:(0-_e)/(h-_e);return new R.U(R.B.number(I[0]/H,k[0]/ee,g)/this.worldSize,R.B.number(ne,ue,g)/this.worldSize)}coordinatePoint(s,x=0,I=this.pixelMatrix){const k=[s.x*this.worldSize,s.y*this.worldSize,x,1];return R.ag(k,k,I),new R.P(k[0]/k[3],k[1]/k[3])}getBounds(){const s=Math.max(0,this.height/2-this.getHorizon());return new wr().extend(this.pointLocation(new R.P(0,s))).extend(this.pointLocation(new R.P(this.width,s))).extend(this.pointLocation(new R.P(this.width,this.height))).extend(this.pointLocation(new R.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new wr([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(s){s?(this.lngRange=[s.getWest(),s.getEast()],this.latRange=[s.getSouth(),s.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(s,x=!1){const I=s.key,k=x?this._alignedPosMatrixCache:this._posMatrixCache;if(k[I])return k[I];const H=s.canonical,ee=this.worldSize/this.zoomScale(H.z),ne=H.x+Math.pow(2,H.z)*s.wrap,ue=R.ao(new Float64Array(16));return R.$(ue,ue,[ne*ee,H.y*ee,0]),R.a0(ue,ue,[ee/R.N,ee/R.N,1]),R.a1(ue,x?this.alignedProjMatrix:this.projMatrix,ue),k[I]=new Float32Array(ue),k[I]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let s,x,I,k,H=-90,ee=90,ne=-180,ue=180;const _e=this.size,h=this._unmodified;if(this.latRange){const b=this.latRange;H=R.H(b[1])*this.worldSize,ee=R.H(b[0])*this.worldSize,s=ee-H<_e.y?_e.y/(ee-H):0}if(this.lngRange){const b=this.lngRange;ne=R.b5(R.G(b[0])*this.worldSize,0,this.worldSize),ue=R.b5(R.G(b[1])*this.worldSize,0,this.worldSize),ue<ne&&(ue+=this.worldSize),x=ue-ne<_e.x?_e.x/(ue-ne):0}const g=this.point,d=Math.max(x||0,s||0);if(d)return this.center=this.unproject(new R.P(x?(ue+ne)/2:g.x,s?(ee+H)/2:g.y)),this.zoom+=this.scaleZoom(d),this._unmodified=h,void(this._constraining=!1);if(this.latRange){const b=g.y,B=_e.y/2;b-B<H&&(k=H+B),b+B>ee&&(k=ee-B)}if(this.lngRange){const b=(ne+ue)/2,B=R.b5(g.x,b-this.worldSize/2,b+this.worldSize/2),G=_e.x/2;B-G<ne&&(I=ne+G),B+G>ue&&(I=ue-G)}I===void 0&&k===void 0||(this.center=this.unproject(new R.P(I!==void 0?I:g.x,k!==void 0?k:g.y)).wrap()),this._unmodified=h,this._constraining=!1}_calcMatrices(){if(!this.height)return;const s=this.centerOffset,x=this.point.x,I=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=R.b7(1,this.center.lat)*this.worldSize;let k=R.ao(new Float64Array(16));R.a0(k,k,[this.width/2,-this.height/2,1]),R.$(k,k,[1,-1,0]),this.labelPlaneMatrix=k,k=R.ao(new Float64Array(16)),R.a0(k,k,[1,-1,1]),R.$(k,k,[-1,-1,0]),R.a0(k,k,[2/this.width,2/this.height,1]),this.glCoordMatrix=k;const H=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),ee=Math.min(this.elevation,this._minEleveationForCurrentTile),ne=H-ee*this._pixelPerMeter/Math.cos(this._pitch),ue=ee<0?ne:H,_e=Math.PI/2+this._pitch,h=this._fov*(.5+s.y/this.height),g=Math.sin(h)*ue/Math.sin(R.ad(Math.PI-_e-h,.01,Math.PI-.01)),d=this.getHorizon(),b=2*Math.atan(d/this.cameraToCenterDistance)*(.5+s.y/(2*d)),B=Math.sin(b)*ue/Math.sin(R.ad(Math.PI-_e-b,.01,Math.PI-.01)),G=Math.min(g,B),q=1.01*(Math.cos(Math.PI/2-this._pitch)*G+ue),te=this.height/50;k=new Float64Array(16),R.b8(k,this._fov,this.width/this.height,te,q),k[8]=2*-s.x/this.width,k[9]=2*s.y/this.height,R.a0(k,k,[1,-1,1]),R.$(k,k,[0,0,-this.cameraToCenterDistance]),R.b9(k,k,this._pitch),R.ae(k,k,this.angle),R.$(k,k,[-x,-I,0]),this.mercatorMatrix=R.a0([],k,[this.worldSize,this.worldSize,this.worldSize]),R.a0(k,k,[1,1,this._pixelPerMeter]),this.pixelMatrix=R.a1(new Float64Array(16),this.labelPlaneMatrix,k),R.$(k,k,[0,0,-this.elevation]),this.projMatrix=k,this.invProjMatrix=R.as([],k),this.pixelMatrix3D=R.a1(new Float64Array(16),this.labelPlaneMatrix,k);const fe=this.width%2/2,ce=this.height%2/2,Te=Math.cos(this.angle),Ie=Math.sin(this.angle),Oe=x-Math.round(x)+Te*fe+Ie*ce,Qe=I-Math.round(I)+Te*ce+Ie*fe,nt=new Float64Array(k);if(R.$(nt,nt,[Oe>.5?Oe-1:Oe,Qe>.5?Qe-1:Qe,0]),this.alignedProjMatrix=nt,k=R.as(new Float64Array(16),this.pixelMatrix),!k)throw new Error("failed to invert matrix");this.pixelMatrixInverse=k,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const s=this.pointCoordinate(new R.P(0,0)),x=[s.x*this.worldSize,s.y*this.worldSize,0,1];return R.ag(x,x,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const s=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new R.P(0,s))}getCameraQueryGeometry(s){const x=this.getCameraPoint();if(s.length===1)return[s[0],x];{let I=x.x,k=x.y,H=x.x,ee=x.y;for(const ne of s)I=Math.min(I,ne.x),k=Math.min(k,ne.y),H=Math.max(H,ne.x),ee=Math.max(ee,ne.y);return[new R.P(I,k),new R.P(H,k),new R.P(H,ee),new R.P(I,ee),new R.P(I,k)]}}}function Ac(z,s){let x,I=!1,k=null,H=null;const ee=()=>{k=null,I&&(z.apply(H,x),k=setTimeout(ee,s),I=!1)};return(...ne)=>(I=!0,H=this,x=ne,k||ee(),k)}class kh{constructor(s){this._getCurrentHash=()=>{const x=window.location.hash.replace("#","");if(this._hashName){let I;return x.split("&").map(k=>k.split("=")).forEach(k=>{k[0]===this._hashName&&(I=k)}),(I&&I[1]||"").split("/")}return x.split("/")},this._onHashChange=()=>{const x=this._getCurrentHash();if(x.length>=3&&!x.some(I=>isNaN(I))){const I=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(x[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+x[2],+x[1]],zoom:+x[0],bearing:I,pitch:+(x[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const x=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,x)}catch(I){}},this._updateHash=Ac(this._updateHashUnthrottled,300),this._hashName=s&&encodeURIComponent(s)}addTo(s){return this._map=s,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(s){const x=this._map.getCenter(),I=Math.round(100*this._map.getZoom())/100,k=Math.ceil((I*Math.LN2+Math.log(512/360/.5))/Math.LN10),H=Math.pow(10,k),ee=Math.round(x.lng*H)/H,ne=Math.round(x.lat*H)/H,ue=this._map.getBearing(),_e=this._map.getPitch();let h="";if(h+=s?`/${ee}/${ne}/${I}`:`${I}/${ne}/${ee}`,(ue||_e)&&(h+="/"+Math.round(10*ue)/10),_e&&(h+=`/${Math.round(_e)}`),this._hashName){const g=this._hashName;let d=!1;const b=window.location.hash.slice(1).split("&").map(B=>{const G=B.split("=")[0];return G===g?(d=!0,`${G}=${h}`):B}).filter(B=>B);return d||b.push(`${g}=${h}`),`#${b.join("&")}`}return`#${h}`}}const Iu={linearity:.3,easing:R.ba(0,0,.3,1)},rh=R.e({deceleration:2500,maxSpeed:1400},Iu),gp=R.e({deceleration:20,maxSpeed:1400},Iu),vp=R.e({deceleration:1e3,maxSpeed:360},Iu),Kp=R.e({deceleration:1e3,maxSpeed:90},Iu);class Hc{constructor(s){this._map=s,this.clear()}clear(){this._inertiaBuffer=[]}record(s){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:R.h.now(),settings:s})}_drainInertiaBuffer(){const s=this._inertiaBuffer,x=R.h.now();for(;s.length>0&&x-s[0].time>160;)s.shift()}_onMoveEnd(s){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const x={zoom:0,bearing:0,pitch:0,pan:new R.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:H}of this._inertiaBuffer)x.zoom+=H.zoomDelta||0,x.bearing+=H.bearingDelta||0,x.pitch+=H.pitchDelta||0,H.panDelta&&x.pan._add(H.panDelta),H.around&&(x.around=H.around),H.pinchAround&&(x.pinchAround=H.pinchAround);const I=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,k={};if(x.pan.mag()){const H=yu(x.pan.mag(),I,R.e({},rh,s||{}));k.offset=x.pan.mult(H.amount/x.pan.mag()),k.center=this._map.transform.center,Eh(k,H)}if(x.zoom){const H=yu(x.zoom,I,gp);k.zoom=this._map.transform.zoom+H.amount,Eh(k,H)}if(x.bearing){const H=yu(x.bearing,I,vp);k.bearing=this._map.transform.bearing+R.ad(H.amount,-179,179),Eh(k,H)}if(x.pitch){const H=yu(x.pitch,I,Kp);k.pitch=this._map.transform.pitch+H.amount,Eh(k,H)}if(k.zoom||k.bearing){const H=x.pinchAround===void 0?x.around:x.pinchAround;k.around=H?this._map.unproject(H):this._map.getCenter()}return this.clear(),R.e(k,{noMoveStart:!0})}}function Eh(z,s){(!z.duration||z.duration<s.duration)&&(z.duration=s.duration,z.easing=s.easing)}function yu(z,s,x){const{maxSpeed:I,linearity:k,deceleration:H}=x,ee=R.ad(z*k/(s/1e3),-I,I),ne=Math.abs(ee)/(H*k);return{easing:x.easing,duration:1e3*ne,amount:ee*(ne/2)}}class Ya extends R.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(s,x,I,k={}){const H=be.mousePos(x.getCanvasContainer(),I),ee=x.unproject(H);super(s,R.e({point:H,lngLat:ee,originalEvent:I},k)),this._defaultPrevented=!1,this.target=x}}class nh extends R.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(s,x,I){const k=s==="touchend"?I.changedTouches:I.touches,H=be.touchPos(x.getCanvasContainer(),k),ee=H.map(ue=>x.unproject(ue)),ne=H.reduce((ue,_e,h,g)=>ue.add(_e.div(g.length)),new R.P(0,0));super(s,{points:H,point:ne,lngLats:ee,lngLat:x.unproject(ne),originalEvent:I}),this._defaultPrevented=!1}}class Gc extends R.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(s,x,I){super(s,{originalEvent:I}),this._defaultPrevented=!1}}class ih{constructor(s,x){this._map=s,this._clickTolerance=x.clickTolerance}reset(){delete this._mousedownPos}wheel(s){return this._firePreventable(new Gc(s.type,this._map,s))}mousedown(s,x){return this._mousedownPos=x,this._firePreventable(new Ya(s.type,this._map,s))}mouseup(s){this._map.fire(new Ya(s.type,this._map,s))}click(s,x){this._mousedownPos&&this._mousedownPos.dist(x)>=this._clickTolerance||this._map.fire(new Ya(s.type,this._map,s))}dblclick(s){return this._firePreventable(new Ya(s.type,this._map,s))}mouseover(s){this._map.fire(new Ya(s.type,this._map,s))}mouseout(s){this._map.fire(new Ya(s.type,this._map,s))}touchstart(s){return this._firePreventable(new nh(s.type,this._map,s))}touchmove(s){this._map.fire(new nh(s.type,this._map,s))}touchend(s){this._map.fire(new nh(s.type,this._map,s))}touchcancel(s){this._map.fire(new nh(s.type,this._map,s))}_firePreventable(s){if(this._map.fire(s),s.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Sa{constructor(s){this._map=s}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(s){this._map.fire(new Ya(s.type,this._map,s))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ya("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(s){this._delayContextMenu?this._contextMenuEvent=s:this._ignoreContextMenu||this._map.fire(new Ya(s.type,this._map,s)),this._map.listens("contextmenu")&&s.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class cs{constructor(s){this._map=s}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(s){return this.transform.pointLocation(R.P.convert(s),this._map.terrain)}}class ku{constructor(s,x){this._map=s,this._tr=new cs(s),this._el=s.getCanvasContainer(),this._container=s.getContainer(),this._clickTolerance=x.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(s,x){this.isEnabled()&&s.shiftKey&&s.button===0&&(be.disableDrag(),this._startPos=this._lastPos=x,this._active=!0)}mousemoveWindow(s,x){if(!this._active)return;const I=x;if(this._lastPos.equals(I)||!this._box&&I.dist(this._startPos)<this._clickTolerance)return;const k=this._startPos;this._lastPos=I,this._box||(this._box=be.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",s));const H=Math.min(k.x,I.x),ee=Math.max(k.x,I.x),ne=Math.min(k.y,I.y),ue=Math.max(k.y,I.y);be.setTransform(this._box,`translate(${H}px,${ne}px)`),this._box.style.width=ee-H+"px",this._box.style.height=ue-ne+"px"}mouseupWindow(s,x){if(!this._active||s.button!==0)return;const I=this._startPos,k=x;if(this.reset(),be.suppressClick(),I.x!==k.x||I.y!==k.y)return this._map.fire(new R.k("boxzoomend",{originalEvent:s})),{cameraAnimation:H=>H.fitScreenCoordinates(I,k,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",s)}keydown(s){this._active&&s.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",s))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(be.remove(this._box),this._box=null),be.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(s,x){return this._map.fire(new R.k(s,{originalEvent:x}))}}function rc(z,s){if(z.length!==s.length)throw new Error(`The number of touches and points are not equal - touches ${z.length}, points ${s.length}`);const x={};for(let I=0;I<z.length;I++)x[z[I].identifier]=s[I];return x}class xu{constructor(s){this.reset(),this.numTouches=s.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(s,x,I){(this.centroid||I.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=s.timeStamp),I.length===this.numTouches&&(this.centroid=function(k){const H=new R.P(0,0);for(const ee of k)H._add(ee);return H.div(k.length)}(x),this.touches=rc(I,x)))}touchmove(s,x,I){if(this.aborted||!this.centroid)return;const k=rc(I,x);for(const H in this.touches){const ee=k[H];(!ee||ee.dist(this.touches[H])>30)&&(this.aborted=!0)}}touchend(s,x,I){if((!this.centroid||s.timeStamp-this.startTime>500)&&(this.aborted=!0),I.length===0){const k=!this.aborted&&this.centroid;if(this.reset(),k)return k}}}class oh{constructor(s){this.singleTap=new xu(s),this.numTaps=s.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(s,x,I){this.singleTap.touchstart(s,x,I)}touchmove(s,x,I){this.singleTap.touchmove(s,x,I)}touchend(s,x,I){const k=this.singleTap.touchend(s,x,I);if(k){const H=s.timeStamp-this.lastTime<500,ee=!this.lastTap||this.lastTap.dist(k)<30;if(H&&ee||this.reset(),this.count++,this.lastTime=s.timeStamp,this.lastTap=k,this.count===this.numTaps)return this.reset(),k}}}class Cc{constructor(s){this._tr=new cs(s),this._zoomIn=new oh({numTouches:1,numTaps:2}),this._zoomOut=new oh({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(s,x,I){this._zoomIn.touchstart(s,x,I),this._zoomOut.touchstart(s,x,I)}touchmove(s,x,I){this._zoomIn.touchmove(s,x,I),this._zoomOut.touchmove(s,x,I)}touchend(s,x,I){const k=this._zoomIn.touchend(s,x,I),H=this._zoomOut.touchend(s,x,I),ee=this._tr;return k?(this._active=!0,s.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:ne=>ne.easeTo({duration:300,zoom:ee.zoom+1,around:ee.unproject(k)},{originalEvent:s})}):H?(this._active=!0,s.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:ne=>ne.easeTo({duration:300,zoom:ee.zoom-1,around:ee.unproject(H)},{originalEvent:s})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ah{constructor(s){this._enabled=!!s.enable,this._moveStateManager=s.moveStateManager,this._clickTolerance=s.clickTolerance||1,this._moveFunction=s.move,this._activateOnStart=!!s.activateOnStart,s.assignEvents(this),this.reset()}reset(s){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(s)}_move(...s){const x=this._moveFunction(...s);if(x.bearingDelta||x.pitchDelta||x.around||x.panDelta)return this._active=!0,x}dragStart(s,x){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(s)&&(this._moveStateManager.startMove(s),this._lastPoint=x.length?x[0]:x,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(s,x){if(!this.isEnabled())return;const I=this._lastPoint;if(!I)return;if(s.preventDefault(),!this._moveStateManager.isValidMoveEvent(s))return void this.reset(s);const k=x.length?x[0]:x;return!this._moved&&k.dist(I)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=k,this._move(I,k))}dragEnd(s){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(s)&&(this._moved&&be.suppressClick(),this.reset(s))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Qh={0:1,2:2};class sh{constructor(s){this._correctEvent=s.checkCorrectEvent}startMove(s){const x=be.mouseButton(s);this._eventButton=x}endMove(s){delete this._eventButton}isValidStartEvent(s){return this._correctEvent(s)}isValidMoveEvent(s){return!function(x,I){const k=Qh[I];return x.buttons===void 0||(x.buttons&k)!==k}(s,this._eventButton)}isValidEndEvent(s){return be.mouseButton(s)===this._eventButton}}class Ul{constructor(){this._firstTouch=void 0}_isOneFingerTouch(s){return s.targetTouches.length===1}_isSameTouchEvent(s){return s.targetTouches[0].identifier===this._firstTouch}startMove(s){this._firstTouch=s.targetTouches[0].identifier}endMove(s){delete this._firstTouch}isValidStartEvent(s){return this._isOneFingerTouch(s)}isValidMoveEvent(s){return this._isOneFingerTouch(s)&&this._isSameTouchEvent(s)}isValidEndEvent(s){return this._isOneFingerTouch(s)&&this._isSameTouchEvent(s)}}const ll=z=>{z.mousedown=z.dragStart,z.mousemoveWindow=z.dragMove,z.mouseup=z.dragEnd,z.contextmenu=function(s){s.preventDefault()}},Wc=({enable:z,clickTolerance:s,bearingDegreesPerPixelMoved:x=.8})=>{const I=new sh({checkCorrectEvent:k=>be.mouseButton(k)===0&&k.ctrlKey||be.mouseButton(k)===2});return new ah({clickTolerance:s,move:(k,H)=>({bearingDelta:(H.x-k.x)*x}),moveStateManager:I,enable:z,assignEvents:ll})},vl=({enable:z,clickTolerance:s,pitchDegreesPerPixelMoved:x=-.5})=>{const I=new sh({checkCorrectEvent:k=>be.mouseButton(k)===0&&k.ctrlKey||be.mouseButton(k)===2});return new ah({clickTolerance:s,move:(k,H)=>({pitchDelta:(H.y-k.y)*x}),moveStateManager:I,enable:z,assignEvents:ll})};class oi{constructor(s,x){this._minTouches=s.cooperativeGestures?2:1,this._clickTolerance=s.clickTolerance||1,this._map=x,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new R.P(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(s,x,I){return this._calculateTransform(s,x,I)}touchmove(s,x,I){if(this._map._cooperativeGestures&&(this._minTouches===2&&I.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(s,!1,I.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(I.length<this._minTouches))return s.preventDefault(),this._calculateTransform(s,x,I)}touchend(s,x,I){this._calculateTransform(s,x,I),this._active&&I.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(s,x,I){I.length>0&&(this._active=!0);const k=rc(I,x),H=new R.P(0,0),ee=new R.P(0,0);let ne=0;for(const _e in k){const h=k[_e],g=this._touches[_e];g&&(H._add(h),ee._add(h.sub(g)),ne++,k[_e]=h)}if(this._touches=k,ne<this._minTouches||!ee.mag())return;const ue=ee.div(ne);return this._sum._add(ue),this._sum.mag()<this._clickTolerance?void 0:{around:H.div(ne),panDelta:ue}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class fi{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(s,x,I){this._firstTwoTouches||I.length<2||(this._firstTwoTouches=[I[0].identifier,I[1].identifier],this._start([x[0],x[1]]))}touchmove(s,x,I){if(!this._firstTwoTouches)return;s.preventDefault();const[k,H]=this._firstTwoTouches,ee=tu(I,x,k),ne=tu(I,x,H);if(!ee||!ne)return;const ue=this._aroundCenter?null:ee.add(ne).div(2);return this._move([ee,ne],ue,s)}touchend(s,x,I){if(!this._firstTwoTouches)return;const[k,H]=this._firstTwoTouches,ee=tu(I,x,k),ne=tu(I,x,H);ee&&ne||(this._active&&be.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(s){this._enabled=!0,this._aroundCenter=!!s&&s.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function tu(z,s,x){for(let I=0;I<z.length;I++)if(z[I].identifier===x)return s[I]}function bu(z,s){return Math.log(z/s)/Math.LN2}class Dp extends fi{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(s){this._startDistance=this._distance=s[0].dist(s[1])}_move(s,x){const I=this._distance;if(this._distance=s[0].dist(s[1]),this._active||!(Math.abs(bu(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:bu(this._distance,I),pinchAround:x}}}function ai(z,s){return 180*z.angleWith(s)/Math.PI}class is extends fi{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(s){this._startVector=this._vector=s[0].sub(s[1]),this._minDiameter=s[0].dist(s[1])}_move(s,x){const I=this._vector;if(this._vector=s[0].sub(s[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ai(this._vector,I),pinchAround:x}}_isBelowThreshold(s){this._minDiameter=Math.min(this._minDiameter,s.mag());const x=25/(Math.PI*this._minDiameter)*360,I=ai(s,this._startVector);return Math.abs(I)<x}}function ep(z){return Math.abs(z.y)>Math.abs(z.x)}class mi extends fi{constructor(s){super(),this._map=s}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(s,x,I){super.touchstart(s,x,I),this._currentTouchCount=I.length}_start(s){this._lastPoints=s,ep(s[0].sub(s[1]))&&(this._valid=!1)}_move(s,x,I){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const k=s[0].sub(this._lastPoints[0]),H=s[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(k,H,I.timeStamp),this._valid?(this._lastPoints=s,this._active=!0,{pitchDelta:(k.y+H.y)/2*-.5}):void 0}gestureBeginsVertically(s,x,I){if(this._valid!==void 0)return this._valid;const k=s.mag()>=2,H=x.mag()>=2;if(!k&&!H)return;if(!k||!H)return this._firstMove===void 0&&(this._firstMove=I),I-this._firstMove<100&&void 0;const ee=s.y>0==x.y>0;return ep(s)&&ep(x)&&ee}}const Mc={panStep:100,bearingStep:15,pitchStep:10};class Op{constructor(s){this._tr=new cs(s);const x=Mc;this._panStep=x.panStep,this._bearingStep=x.bearingStep,this._pitchStep=x.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(s){if(s.altKey||s.ctrlKey||s.metaKey)return;let x=0,I=0,k=0,H=0,ee=0;switch(s.keyCode){case 61:case 107:case 171:case 187:x=1;break;case 189:case 109:case 173:x=-1;break;case 37:s.shiftKey?I=-1:(s.preventDefault(),H=-1);break;case 39:s.shiftKey?I=1:(s.preventDefault(),H=1);break;case 38:s.shiftKey?k=1:(s.preventDefault(),ee=-1);break;case 40:s.shiftKey?k=-1:(s.preventDefault(),ee=1);break;default:return}return this._rotationDisabled&&(I=0,k=0),{cameraAnimation:ne=>{const ue=this._tr;ne.easeTo({duration:300,easeId:"keyboardHandler",easing:Jp,zoom:x?Math.round(ue.zoom)+x*(s.shiftKey?2:1):ue.zoom,bearing:ue.bearing+I*this._bearingStep,pitch:ue.pitch+k*this._pitchStep,offset:[-H*this._panStep,-ee*this._panStep],center:ue.center},{originalEvent:s})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Jp(z){return z*(2-z)}const Xc=4.000244140625;class hc{constructor(s,x){this._onTimeout=I=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(I)},this._map=s,this._tr=new cs(s),this._el=s.getCanvasContainer(),this._triggerRenderFrame=x,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(s){this._defaultZoomRate=s}setWheelZoomRate(s){this._wheelZoomRate=s}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(s){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!s&&s.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(s){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!s[this._map._metaKey])return;s.preventDefault()}let x=s.deltaMode===WheelEvent.DOM_DELTA_LINE?40*s.deltaY:s.deltaY;const I=R.h.now(),k=I-(this._lastWheelEventTime||0);this._lastWheelEventTime=I,x!==0&&x%Xc==0?this._type="wheel":x!==0&&Math.abs(x)<4?this._type="trackpad":k>400?(this._type=null,this._lastValue=x,this._timeout=setTimeout(this._onTimeout,40,s)):this._type||(this._type=Math.abs(k*x)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,x+=this._lastValue)),s.shiftKey&&x&&(x/=4),this._type&&(this._lastWheelEvent=s,this._delta-=x,this._active||this._start(s)),s.preventDefault()}_start(s){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const x=be.mousePos(this._el,s),I=this._tr;this._around=R.L.convert(this._aroundCenter?I.center:I.unproject(x)),this._aroundPoint=I.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const s=this._tr.transform;if(this._delta!==0){const ne=this._type==="wheel"&&Math.abs(this._delta)>Xc?this._wheelZoomRate:this._defaultZoomRate;let ue=2/(1+Math.exp(-Math.abs(this._delta*ne)));this._delta<0&&ue!==0&&(ue=1/ue);const _e=typeof this._targetZoom=="number"?s.zoomScale(this._targetZoom):s.scale;this._targetZoom=Math.min(s.maxZoom,Math.max(s.minZoom,s.scaleZoom(_e*ue))),this._type==="wheel"&&(this._startZoom=s.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const x=typeof this._targetZoom=="number"?this._targetZoom:s.zoom,I=this._startZoom,k=this._easing;let H,ee=!1;if(this._type==="wheel"&&I&&k){const ne=Math.min((R.h.now()-this._lastWheelEventTime)/200,1),ue=k(ne);H=R.B.number(I,x,ue),ne<1?this._frameId||(this._frameId=!0):ee=!0}else H=x,ee=!0;return this._active=!0,ee&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ee,zoomDelta:H-s.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(s){let x=R.bb;if(this._prevEase){const I=this._prevEase,k=(R.h.now()-I.start)/I.duration,H=I.easing(k+.01)-I.easing(k),ee=.27/Math.sqrt(H*H+1e-4)*.01,ne=Math.sqrt(.0729-ee*ee);x=R.ba(ee,ne,.25,1)}return this._prevEase={start:R.h.now(),duration:s,easing:x},x}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class wh{constructor(s,x){this._clickZoom=s,this._tapZoom=x}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Pc{constructor(s){this._tr=new cs(s),this.reset()}reset(){this._active=!1}dblclick(s,x){return s.preventDefault(),{cameraAnimation:I=>{I.easeTo({duration:300,zoom:this._tr.zoom+(s.shiftKey?-1:1),around:this._tr.unproject(x)},{originalEvent:s})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Xl{constructor(){this._tap=new oh({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(s,x,I){if(!this._swipePoint)if(this._tapTime){const k=x[0],H=s.timeStamp-this._tapTime<500,ee=this._tapPoint.dist(k)<30;H&&ee?I.length>0&&(this._swipePoint=k,this._swipeTouch=I[0].identifier):this.reset()}else this._tap.touchstart(s,x,I)}touchmove(s,x,I){if(this._tapTime){if(this._swipePoint){if(I[0].identifier!==this._swipeTouch)return;const k=x[0],H=k.y-this._swipePoint.y;return this._swipePoint=k,s.preventDefault(),this._active=!0,{zoomDelta:H/128}}}else this._tap.touchmove(s,x,I)}touchend(s,x,I){if(this._tapTime)this._swipePoint&&I.length===0&&this.reset();else{const k=this._tap.touchend(s,x,I);k&&(this._tapTime=s.timeStamp,this._tapPoint=k)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Rc{constructor(s,x,I){this._el=s,this._mousePan=x,this._touchPan=I}enable(s){this._inertiaOptions=s||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Eu{constructor(s,x,I){this._pitchWithRotate=s.pitchWithRotate,this._mouseRotate=x,this._mousePitch=I}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class lh{constructor(s,x,I,k){this._el=s,this._touchZoom=x,this._touchRotate=I,this._tapDragZoom=k,this._rotationDisabled=!1,this._enabled=!0}enable(s){this._touchZoom.enable(s),this._rotationDisabled||this._touchRotate.enable(s),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const tp=z=>z.zoom||z.drag||z.pitch||z.rotate;class rp extends R.k{}function su(z){return z.panDelta&&z.panDelta.mag()||z.zoomDelta||z.bearingDelta||z.pitchDelta}class ql{constructor(s,x){this.handleWindowEvent=k=>{this.handleEvent(k,`${k.type}Window`)},this.handleEvent=(k,H)=>{if(k.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const ee=k.type==="renderFrame"?void 0:k,ne={needsRenderFrame:!1},ue={},_e={},h=k.touches,g=h?this._getMapTouches(h):void 0,d=g?be.touchPos(this._el,g):be.mousePos(this._el,k);for(const{handlerName:G,handler:q,allowed:te}of this._handlers){if(!q.isEnabled())continue;let fe;this._blockedByActive(_e,te,G)?q.reset():q[H||k.type]&&(fe=q[H||k.type](k,d,g),this.mergeHandlerResult(ne,ue,fe,G,ee),fe&&fe.needsRenderFrame&&this._triggerRenderFrame()),(fe||q.isActive())&&(_e[G]=q)}const b={};for(const G in this._previousActiveHandlers)_e[G]||(b[G]=ee);this._previousActiveHandlers=_e,(Object.keys(b).length||su(ne))&&(this._changes.push([ne,ue,b]),this._triggerRenderFrame()),(Object.keys(_e).length||su(ne))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:B}=ne;B&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],B(this._map))},this._map=s,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Hc(s),this._bearingSnap=x.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(x);const I=this._el;this._listeners=[[I,"touchstart",{passive:!0}],[I,"touchmove",{passive:!1}],[I,"touchend",void 0],[I,"touchcancel",void 0],[I,"mousedown",void 0],[I,"mousemove",void 0],[I,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[I,"mouseover",void 0],[I,"mouseout",void 0],[I,"dblclick",void 0],[I,"click",void 0],[I,"keydown",{capture:!1}],[I,"keyup",void 0],[I,"wheel",{passive:!1}],[I,"contextmenu",void 0],[window,"blur",void 0]];for(const[k,H,ee]of this._listeners)be.addEventListener(k,H,k===document?this.handleWindowEvent:this.handleEvent,ee)}destroy(){for(const[s,x,I]of this._listeners)be.removeEventListener(s,x,s===document?this.handleWindowEvent:this.handleEvent,I)}_addDefaultHandlers(s){const x=this._map,I=x.getCanvasContainer();this._add("mapEvent",new ih(x,s));const k=x.boxZoom=new ku(x,s);this._add("boxZoom",k),s.interactive&&s.boxZoom&&k.enable();const H=new Cc(x),ee=new Pc(x);x.doubleClickZoom=new wh(ee,H),this._add("tapZoom",H),this._add("clickZoom",ee),s.interactive&&s.doubleClickZoom&&x.doubleClickZoom.enable();const ne=new Xl;this._add("tapDragZoom",ne);const ue=x.touchPitch=new mi(x);this._add("touchPitch",ue),s.interactive&&s.touchPitch&&x.touchPitch.enable(s.touchPitch);const _e=Wc(s),h=vl(s);x.dragRotate=new Eu(s,_e,h),this._add("mouseRotate",_e,["mousePitch"]),this._add("mousePitch",h,["mouseRotate"]),s.interactive&&s.dragRotate&&x.dragRotate.enable();const g=(({enable:te,clickTolerance:fe})=>{const ce=new sh({checkCorrectEvent:Te=>be.mouseButton(Te)===0&&!Te.ctrlKey});return new ah({clickTolerance:fe,move:(Te,Ie)=>({around:Ie,panDelta:Ie.sub(Te)}),activateOnStart:!0,moveStateManager:ce,enable:te,assignEvents:ll})})(s),d=new oi(s,x);x.dragPan=new Rc(I,g,d),this._add("mousePan",g),this._add("touchPan",d,["touchZoom","touchRotate"]),s.interactive&&s.dragPan&&x.dragPan.enable(s.dragPan);const b=new is,B=new Dp;x.touchZoomRotate=new lh(I,B,b,ne),this._add("touchRotate",b,["touchPan","touchZoom"]),this._add("touchZoom",B,["touchPan","touchRotate"]),s.interactive&&s.touchZoomRotate&&x.touchZoomRotate.enable(s.touchZoomRotate);const G=x.scrollZoom=new hc(x,()=>this._triggerRenderFrame());this._add("scrollZoom",G,["mousePan"]),s.interactive&&s.scrollZoom&&x.scrollZoom.enable(s.scrollZoom);const q=x.keyboard=new Op(x);this._add("keyboard",q),s.interactive&&s.keyboard&&x.keyboard.enable(),this._add("blockableMapEvent",new Sa(x))}_add(s,x,I){this._handlers.push({handlerName:s,handler:x,allowed:I}),this._handlersById[s]=x}stop(s){if(!this._updatingCamera){for(const{handler:x}of this._handlers)x.reset();this._inertia.clear(),this._fireEvents({},{},s),this._changes=[]}}isActive(){for(const{handler:s}of this._handlers)if(s.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!tp(this._eventsInProgress)||this.isZooming()}_blockedByActive(s,x,I){for(const k in s)if(k!==I&&(!x||x.indexOf(k)<0))return!0;return!1}_getMapTouches(s){const x=[];for(const I of s)this._el.contains(I.target)&&x.push(I);return x}mergeHandlerResult(s,x,I,k,H){if(!I)return;R.e(s,I);const ee={handlerName:k,originalEvent:I.originalEvent||H};I.zoomDelta!==void 0&&(x.zoom=ee),I.panDelta!==void 0&&(x.drag=ee),I.pitchDelta!==void 0&&(x.pitch=ee),I.bearingDelta!==void 0&&(x.rotate=ee)}_applyChanges(){const s={},x={},I={};for(const[k,H,ee]of this._changes)k.panDelta&&(s.panDelta=(s.panDelta||new R.P(0,0))._add(k.panDelta)),k.zoomDelta&&(s.zoomDelta=(s.zoomDelta||0)+k.zoomDelta),k.bearingDelta&&(s.bearingDelta=(s.bearingDelta||0)+k.bearingDelta),k.pitchDelta&&(s.pitchDelta=(s.pitchDelta||0)+k.pitchDelta),k.around!==void 0&&(s.around=k.around),k.pinchAround!==void 0&&(s.pinchAround=k.pinchAround),k.noInertia&&(s.noInertia=k.noInertia),R.e(x,H),R.e(I,ee);this._updateMapTransform(s,x,I),this._changes=[]}_updateMapTransform(s,x,I){const k=this._map,H=k._getTransformForUpdate(),ee=k.terrain;if(!(su(s)||ee&&this._terrainMovement))return this._fireEvents(x,I,!0);let{panDelta:ne,zoomDelta:ue,bearingDelta:_e,pitchDelta:h,around:g,pinchAround:d}=s;d!==void 0&&(g=d),k._stop(!0),g=g||k.transform.centerPoint;const b=H.pointLocation(ne?g.sub(ne):g);_e&&(H.bearing+=_e),h&&(H.pitch+=h),ue&&(H.zoom+=ue),ee?this._terrainMovement||!x.drag&&!x.zoom?x.drag&&this._terrainMovement?H.center=H.pointLocation(H.centerPoint.sub(ne)):H.setLocationAtPoint(b,g):(this._terrainMovement=!0,this._map._elevationFreeze=!0,H.setLocationAtPoint(b,g),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,H.recalculateZoom(k.terrain)})):H.setLocationAtPoint(b,g),k._applyUpdatedTransform(H),this._map._update(),s.noInertia||this._inertia.record(s),this._fireEvents(x,I,!0)}_fireEvents(s,x,I){const k=tp(this._eventsInProgress),H=tp(s),ee={};for(const h in s){const{originalEvent:g}=s[h];this._eventsInProgress[h]||(ee[`${h}start`]=g),this._eventsInProgress[h]=s[h]}!k&&H&&this._fireEvent("movestart",H.originalEvent);for(const h in ee)this._fireEvent(h,ee[h]);H&&this._fireEvent("move",H.originalEvent);for(const h in s){const{originalEvent:g}=s[h];this._fireEvent(h,g)}const ne={};let ue;for(const h in this._eventsInProgress){const{handlerName:g,originalEvent:d}=this._eventsInProgress[h];this._handlersById[g].isActive()||(delete this._eventsInProgress[h],ue=x[g]||d,ne[`${h}end`]=ue)}for(const h in ne)this._fireEvent(h,ne[h]);const _e=tp(this._eventsInProgress);if(I&&(k||H)&&!_e){this._updatingCamera=!0;const h=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),g=d=>d!==0&&-this._bearingSnap<d&&d<this._bearingSnap;!h||!h.essential&&R.h.prefersReducedMotion?(this._map.fire(new R.k("moveend",{originalEvent:ue})),g(this._map.getBearing())&&this._map.resetNorth()):(g(h.bearing||this._map.getBearing())&&(h.bearing=0),h.freezeElevation=!0,this._map.easeTo(h,{originalEvent:ue})),this._updatingCamera=!1}}_fireEvent(s,x){this._map.fire(new R.k(s,x?{originalEvent:x}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(s=>{delete this._frameId,this.handleEvent(new rp("renderFrame",{timeStamp:s})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class fa extends R.E{constructor(s,x){super(),this._renderFrameCallback=()=>{const I=Math.min((R.h.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(I)),I<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=s,this._bearingSnap=x.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new R.L(this.transform.center.lng,this.transform.center.lat)}setCenter(s,x){return this.jumpTo({center:s},x)}panBy(s,x,I){return s=R.P.convert(s).mult(-1),this.panTo(this.transform.center,R.e({offset:s},x),I)}panTo(s,x,I){return this.easeTo(R.e({center:s},x),I)}getZoom(){return this.transform.zoom}setZoom(s,x){return this.jumpTo({zoom:s},x),this}zoomTo(s,x,I){return this.easeTo(R.e({zoom:s},x),I)}zoomIn(s,x){return this.zoomTo(this.getZoom()+1,s,x),this}zoomOut(s,x){return this.zoomTo(this.getZoom()-1,s,x),this}getBearing(){return this.transform.bearing}setBearing(s,x){return this.jumpTo({bearing:s},x),this}getPadding(){return this.transform.padding}setPadding(s,x){return this.jumpTo({padding:s},x),this}rotateTo(s,x,I){return this.easeTo(R.e({bearing:s},x),I)}resetNorth(s,x){return this.rotateTo(0,R.e({duration:1e3},s),x),this}resetNorthPitch(s,x){return this.easeTo(R.e({bearing:0,pitch:0,duration:1e3},s),x),this}snapToNorth(s,x){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(s,x):this}getPitch(){return this.transform.pitch}setPitch(s,x){return this.jumpTo({pitch:s},x),this}cameraForBounds(s,x){s=wr.convert(s);const I=x&&x.bearing||0;return this._cameraForBoxAndBearing(s.getNorthWest(),s.getSouthEast(),I,x)}_cameraForBoxAndBearing(s,x,I,k){const H={top:0,bottom:0,right:0,left:0};if(typeof(k=R.e({padding:H,offset:[0,0],maxZoom:this.transform.maxZoom},k)).padding=="number"){const Ie=k.padding;k.padding={top:Ie,bottom:Ie,right:Ie,left:Ie}}k.padding=R.e(H,k.padding);const ee=this.transform,ne=ee.padding,ue=ee.project(R.L.convert(s)),_e=ee.project(R.L.convert(x)),h=ue.rotate(-I*Math.PI/180),g=_e.rotate(-I*Math.PI/180),d=new R.P(Math.max(h.x,g.x),Math.max(h.y,g.y)),b=new R.P(Math.min(h.x,g.x),Math.min(h.y,g.y)),B=d.sub(b),G=(ee.width-(ne.left+ne.right+k.padding.left+k.padding.right))/B.x,q=(ee.height-(ne.top+ne.bottom+k.padding.top+k.padding.bottom))/B.y;if(q<0||G<0)return void R.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const te=Math.min(ee.scaleZoom(ee.scale*Math.min(G,q)),k.maxZoom),fe=R.P.convert(k.offset),ce=new R.P((k.padding.left-k.padding.right)/2,(k.padding.top-k.padding.bottom)/2).rotate(I*Math.PI/180),Te=fe.add(ce).mult(ee.scale/ee.zoomScale(te));return{center:ee.unproject(ue.add(_e).div(2).sub(Te)),zoom:te,bearing:I}}fitBounds(s,x,I){return this._fitInternal(this.cameraForBounds(s,x),x,I)}fitScreenCoordinates(s,x,I,k,H){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(R.P.convert(s)),this.transform.pointLocation(R.P.convert(x)),I,k),k,H)}_fitInternal(s,x,I){return s?(delete(x=R.e(s,x)).padding,x.linear?this.easeTo(x,I):this.flyTo(x,I)):this}jumpTo(s,x){this.stop();const I=this._getTransformForUpdate();let k=!1,H=!1,ee=!1;return"zoom"in s&&I.zoom!==+s.zoom&&(k=!0,I.zoom=+s.zoom),s.center!==void 0&&(I.center=R.L.convert(s.center)),"bearing"in s&&I.bearing!==+s.bearing&&(H=!0,I.bearing=+s.bearing),"pitch"in s&&I.pitch!==+s.pitch&&(ee=!0,I.pitch=+s.pitch),s.padding==null||I.isPaddingEqual(s.padding)||(I.padding=s.padding),this._applyUpdatedTransform(I),this.fire(new R.k("movestart",x)).fire(new R.k("move",x)),k&&this.fire(new R.k("zoomstart",x)).fire(new R.k("zoom",x)).fire(new R.k("zoomend",x)),H&&this.fire(new R.k("rotatestart",x)).fire(new R.k("rotate",x)).fire(new R.k("rotateend",x)),ee&&this.fire(new R.k("pitchstart",x)).fire(new R.k("pitch",x)).fire(new R.k("pitchend",x)),this.fire(new R.k("moveend",x))}calculateCameraOptionsFromTo(s,x,I,k=0){const H=R.U.fromLngLat(s,x),ee=R.U.fromLngLat(I,k),ne=ee.x-H.x,ue=ee.y-H.y,_e=ee.z-H.z,h=Math.hypot(ne,ue,_e);if(h===0)throw new Error("Can't calculate camera options with same From and To");const g=Math.hypot(ne,ue),d=this.transform.scaleZoom(this.transform.cameraToCenterDistance/h/this.transform.tileSize),b=180*Math.atan2(ne,-ue)/Math.PI;let B=180*Math.acos(g/h)/Math.PI;return B=_e<0?90-B:90+B,{center:ee.toLngLat(),zoom:d,pitch:B,bearing:b}}easeTo(s,x){this._stop(!1,s.easeId),((s=R.e({offset:[0,0],duration:500,easing:R.bb},s)).animate===!1||!s.essential&&R.h.prefersReducedMotion)&&(s.duration=0);const I=this._getTransformForUpdate(),k=this.getZoom(),H=this.getBearing(),ee=this.getPitch(),ne=this.getPadding(),ue="zoom"in s?+s.zoom:k,_e="bearing"in s?this._normalizeBearing(s.bearing,H):H,h="pitch"in s?+s.pitch:ee,g="padding"in s?s.padding:I.padding,d=R.P.convert(s.offset);let b=I.centerPoint.add(d);const B=I.pointLocation(b),G=R.L.convert(s.center||B);this._normalizeCenter(G);const q=I.project(B),te=I.project(G).sub(q),fe=I.zoomScale(ue-k);let ce,Te;s.around&&(ce=R.L.convert(s.around),Te=I.locationPoint(ce));const Ie={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||ue!==k,this._rotating=this._rotating||H!==_e,this._pitching=this._pitching||h!==ee,this._padding=!I.isPaddingEqual(g),this._easeId=s.easeId,this._prepareEase(x,s.noMoveStart,Ie),this.terrain&&this._prepareElevation(G),this._ease(Oe=>{if(this._zooming&&(I.zoom=R.B.number(k,ue,Oe)),this._rotating&&(I.bearing=R.B.number(H,_e,Oe)),this._pitching&&(I.pitch=R.B.number(ee,h,Oe)),this._padding&&(I.interpolatePadding(ne,g,Oe),b=I.centerPoint.add(d)),this.terrain&&!s.freezeElevation&&this._updateElevation(Oe),ce)I.setLocationAtPoint(ce,Te);else{const Qe=I.zoomScale(I.zoom-k),nt=ue>k?Math.min(2,fe):Math.max(.5,fe),ct=Math.pow(nt,1-Oe),tt=I.unproject(q.add(te.mult(Oe*ct)).mult(Qe));I.setLocationAtPoint(I.renderWorldCopies?tt.wrap():tt,b)}this._applyUpdatedTransform(I),this._fireMoveEvents(x)},Oe=>{this.terrain&&this._finalizeElevation(),this._afterEase(x,Oe)},s),this}_prepareEase(s,x,I={}){this._moving=!0,x||I.moving||this.fire(new R.k("movestart",s)),this._zooming&&!I.zooming&&this.fire(new R.k("zoomstart",s)),this._rotating&&!I.rotating&&this.fire(new R.k("rotatestart",s)),this._pitching&&!I.pitching&&this.fire(new R.k("pitchstart",s))}_prepareElevation(s){this._elevationCenter=s,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(s,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(s){this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const x=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(s<1&&x!==this._elevationTarget){const I=this._elevationTarget-this._elevationStart;this._elevationStart+=s*(I-(x-(I*s+this._elevationStart))/(1-s)),this._elevationTarget=x}this.transform.elevation=R.B.number(this._elevationStart,this._elevationTarget,s)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(s){if(!this.transformCameraUpdate)return;const x=s.clone(),{center:I,zoom:k,pitch:H,bearing:ee,elevation:ne}=this.transformCameraUpdate(x);I&&(x.center=I),k!==void 0&&(x.zoom=k),H!==void 0&&(x.pitch=H),ee!==void 0&&(x.bearing=ee),ne!==void 0&&(x.elevation=ne),this.transform.apply(x)}_fireMoveEvents(s){this.fire(new R.k("move",s)),this._zooming&&this.fire(new R.k("zoom",s)),this._rotating&&this.fire(new R.k("rotate",s)),this._pitching&&this.fire(new R.k("pitch",s))}_afterEase(s,x){if(this._easeId&&x&&this._easeId===x)return;delete this._easeId;const I=this._zooming,k=this._rotating,H=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,I&&this.fire(new R.k("zoomend",s)),k&&this.fire(new R.k("rotateend",s)),H&&this.fire(new R.k("pitchend",s)),this.fire(new R.k("moveend",s))}flyTo(s,x){if(!s.essential&&R.h.prefersReducedMotion){const tr=R.F(s,["center","zoom","bearing","pitch","around"]);return this.jumpTo(tr,x)}this.stop(),s=R.e({offset:[0,0],speed:1.2,curve:1.42,easing:R.bb},s);const I=this._getTransformForUpdate(),k=this.getZoom(),H=this.getBearing(),ee=this.getPitch(),ne=this.getPadding(),ue="zoom"in s?R.ad(+s.zoom,I.minZoom,I.maxZoom):k,_e="bearing"in s?this._normalizeBearing(s.bearing,H):H,h="pitch"in s?+s.pitch:ee,g="padding"in s?s.padding:I.padding,d=I.zoomScale(ue-k),b=R.P.convert(s.offset);let B=I.centerPoint.add(b);const G=I.pointLocation(B),q=R.L.convert(s.center||G);this._normalizeCenter(q);const te=I.project(G),fe=I.project(q).sub(te);let ce=s.curve;const Te=Math.max(I.width,I.height),Ie=Te/d,Oe=fe.mag();if("minZoom"in s){const tr=R.ad(Math.min(s.minZoom,k,ue),I.minZoom,I.maxZoom),Dr=Te/I.zoomScale(tr-k);ce=Math.sqrt(Dr/Oe*2)}const Qe=ce*ce;function nt(tr){const Dr=(Ie*Ie-Te*Te+(tr?-1:1)*Qe*Qe*Oe*Oe)/(2*(tr?Ie:Te)*Qe*Oe);return Math.log(Math.sqrt(Dr*Dr+1)-Dr)}function ct(tr){return(Math.exp(tr)-Math.exp(-tr))/2}function tt(tr){return(Math.exp(tr)+Math.exp(-tr))/2}const Tt=nt(!1);let Ut=function(tr){return tt(Tt)/tt(Tt+ce*tr)},Nt=function(tr){return Te*((tt(Tt)*(ct(Dr=Tt+ce*tr)/tt(Dr))-ct(Tt))/Qe)/Oe;var Dr},pr=(nt(!0)-Tt)/ce;if(Math.abs(Oe)<1e-6||!isFinite(pr)){if(Math.abs(Te-Ie)<1e-6)return this.easeTo(s,x);const tr=Ie<Te?-1:1;pr=Math.abs(Math.log(Ie/Te))/ce,Nt=function(){return 0},Ut=function(Dr){return Math.exp(tr*ce*Dr)}}return s.duration="duration"in s?+s.duration:1e3*pr/("screenSpeed"in s?+s.screenSpeed/ce:+s.speed),s.maxDuration&&s.duration>s.maxDuration&&(s.duration=0),this._zooming=!0,this._rotating=H!==_e,this._pitching=h!==ee,this._padding=!I.isPaddingEqual(g),this._prepareEase(x,!1),this.terrain&&this._prepareElevation(q),this._ease(tr=>{const Dr=tr*pr,Hr=1/Ut(Dr);I.zoom=tr===1?ue:k+I.scaleZoom(Hr),this._rotating&&(I.bearing=R.B.number(H,_e,tr)),this._pitching&&(I.pitch=R.B.number(ee,h,tr)),this._padding&&(I.interpolatePadding(ne,g,tr),B=I.centerPoint.add(b)),this.terrain&&!s.freezeElevation&&this._updateElevation(tr);const sn=tr===1?q:I.unproject(te.add(fe.mult(Nt(Dr))).mult(Hr));I.setLocationAtPoint(I.renderWorldCopies?sn.wrap():sn,B),this._applyUpdatedTransform(I),this._fireMoveEvents(x)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(x)},s),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(s,x){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const I=this._onEaseEnd;delete this._onEaseEnd,I.call(this,x)}if(!s){const I=this.handlers;I&&I.stop(!1)}return this}_ease(s,x,I){I.animate===!1||I.duration===0?(s(1),x()):(this._easeStart=R.h.now(),this._easeOptions=I,this._onEaseFrame=s,this._onEaseEnd=x,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(s,x){s=R.b5(s,-180,180);const I=Math.abs(s-x);return Math.abs(s-360-x)<I&&(s-=360),Math.abs(s+360-x)<I&&(s+=360),s}_normalizeCenter(s){const x=this.transform;if(!x.renderWorldCopies||x.lngRange)return;const I=s.lng-x.center.lng;s.lng+=I>180?-360:I<-180?360:0}queryTerrainElevation(s){return this.terrain?this.terrain.getElevationForLngLatZoom(R.L.convert(s),this.transform.tileZoom)-this.transform.elevation:null}}class Rs{constructor(s={}){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=x=>{!x||x.sourceDataType!=="metadata"&&x.sourceDataType!=="visibility"&&x.dataType!=="style"&&x.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=s}getDefaultPosition(){return"bottom-right"}onAdd(s){return this._map=s,this._compact=this.options&&this.options.compact,this._container=be.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=be.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=be.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){be.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(s,x){const I=this._map._getUIString(`AttributionControl.${x}`);s.title=I,s.setAttribute("aria-label",I)}_updateAttributions(){if(!this._map.style)return;let s=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?s=s.concat(this.options.customAttribution.map(k=>typeof k!="string"?"":k)):typeof this.options.customAttribution=="string"&&s.push(this.options.customAttribution)),this._map.style.stylesheet){const k=this._map.style.stylesheet;this.styleOwner=k.owner,this.styleId=k.id}const x=this._map.style.sourceCaches;for(const k in x){const H=x[k];if(H.used||H.usedForTerrain){const ee=H.getSource();ee.attribution&&s.indexOf(ee.attribution)<0&&s.push(ee.attribution)}}s=s.filter(k=>String(k).trim()),s.sort((k,H)=>k.length-H.length),s=s.filter((k,H)=>{for(let ee=H+1;ee<s.length;ee++)if(s[ee].indexOf(k)>=0)return!1;return!0});const I=s.join(" | ");I!==this._attribHTML&&(this._attribHTML=I,s.length?(this._innerContainer.innerHTML=I,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class hs{constructor(s={}){this._updateCompact=()=>{const x=this._container.children;if(x.length){const I=x[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&I.classList.add("maplibregl-compact"):I.classList.remove("maplibregl-compact")}},this.options=s}getDefaultPosition(){return"bottom-left"}onAdd(s){this._map=s,this._compact=this.options&&this.options.compact,this._container=be.create("div","maplibregl-ctrl");const x=be.create("a","maplibregl-ctrl-logo");return x.target="_blank",x.rel="noopener nofollow",x.href="https://maplibre.org/",x.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),x.setAttribute("rel","noopener nofollow"),this._container.appendChild(x),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){be.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class lu{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(s){const x=++this._id;return this._queue.push({callback:s,id:x,cancelled:!1}),x}remove(s){const x=this._currentlyRunning,I=x?this._queue.concat(x):this._queue;for(const k of I)if(k.id===s)return void(k.cancelled=!0)}run(s=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const x=this._currentlyRunning=this._queue;this._queue=[];for(const I of x)if(!I.cancelled&&(I.callback(s),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const wu={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var uh=R.Q([{name:"a_pos3d",type:"Int16",components:3}]);class ch extends R.E{constructor(s){super(),this.sourceCache=s,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,s.usedForTerrain=!0,s.tileSize=this.tileSize*bp(2,this.deltaZoom)}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(s,x){this.sourceCache.update(s,x),this._renderableTilesKeys=[];const I={};for(const k of s.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:x}))I[k.key]=!0,this._renderableTilesKeys.push(k.key),this._tiles[k.key]||(k.posMatrix=new Float64Array(16),R.aS(k.posMatrix,0,R.N,0,R.N,0,1),this._tiles[k.key]=new Pi(k,this.tileSize));for(const k in this._tiles)I[k]||delete this._tiles[k]}freeRtt(s){for(const x in this._tiles){const I=this._tiles[x];(!s||I.tileID.equals(s)||I.tileID.isChildOf(s)||s.isChildOf(I.tileID))&&(I.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(s=>this.getTileByID(s))}getTileByID(s){return this._tiles[s]}getTerrainCoords(s){const x={};for(const I of this._renderableTilesKeys){const k=this._tiles[I].tileID;if(k.canonical.equals(s.canonical)){const H=s.clone();H.posMatrix=new Float64Array(16),R.aS(H.posMatrix,0,R.N,0,R.N,0,1),x[I]=H}else if(k.canonical.isChildOf(s.canonical)){const H=s.clone();H.posMatrix=new Float64Array(16);const ee=k.canonical.z-s.canonical.z,ne=k.canonical.x-(k.canonical.x>>ee<<ee),ue=k.canonical.y-(k.canonical.y>>ee<<ee),_e=R.N>>ee;R.aS(H.posMatrix,0,_e,0,_e,0,1),R.$(H.posMatrix,H.posMatrix,[-ne*_e,-ue*_e,0]),x[I]=H}else if(s.canonical.isChildOf(k.canonical)){const H=s.clone();H.posMatrix=new Float64Array(16);const ee=s.canonical.z-k.canonical.z,ne=s.canonical.x-(s.canonical.x>>ee<<ee),ue=s.canonical.y-(s.canonical.y>>ee<<ee),_e=R.N>>ee;R.aS(H.posMatrix,0,R.N,0,R.N,0,1),R.$(H.posMatrix,H.posMatrix,[ne*_e,ue*_e,0]),R.a0(H.posMatrix,H.posMatrix,[1/bp(2,ee),1/bp(2,ee),0]),x[I]=H}}return x}getSourceTile(s,x){const I=this.sourceCache._source;let k=s.overscaledZ-this.deltaZoom;if(k>I.maxzoom&&(k=I.maxzoom),k<I.minzoom)return null;this._sourceTileCache[s.key]||(this._sourceTileCache[s.key]=s.scaledTo(k).key);let H=this.sourceCache.getTileByID(this._sourceTileCache[s.key]);if((!H||!H.dem)&&x)for(;k>=I.minzoom&&(!H||!H.dem);)H=this.sourceCache.getTileByID(s.scaledTo(k--).key);return H}tilesAfterTime(s=Date.now()){return Object.values(this._tiles).filter(x=>x.timeAdded>=s)}}class Nu{constructor(s,x,I){this.painter=s,this.sourceCache=new ch(x),this.options=I,this.exaggeration=typeof I.exaggeration=="number"?I.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(s,x,I,k=R.N){var H;if(!(x>=0&&x<k&&I>=0&&I<k))return 0;const ee=this.getTerrainData(s),ne=(H=ee.tile)===null||H===void 0?void 0:H.dem;if(!ne)return 0;const ue=function(B,G,q){var te=G[0],fe=G[1];return B[0]=q[0]*te+q[4]*fe+q[12],B[1]=q[1]*te+q[5]*fe+q[13],B}([],[x/k*R.N,I/k*R.N],ee.u_terrain_matrix),_e=[ue[0]*ne.dim,ue[1]*ne.dim],h=Math.floor(_e[0]),g=Math.floor(_e[1]),d=_e[0]-h,b=_e[1]-g;return ne.get(h,g)*(1-d)*(1-b)+ne.get(h+1,g)*d*(1-b)+ne.get(h,g+1)*(1-d)*b+ne.get(h+1,g+1)*d*b}getElevationForLngLatZoom(s,x){const{tileID:I,mercatorX:k,mercatorY:H}=this._getOverscaledTileIDFromLngLatZoom(s,x);return this.getElevation(I,k%R.N,H%R.N,R.N)}getElevation(s,x,I,k=R.N){return this.getDEMElevation(s,x,I,k)*this.exaggeration}getTerrainData(s){if(!this._emptyDemTexture){const k=this.painter.context,H=new R.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new xr(k,H,k.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new xr(k,new R.R({width:1,height:1}),k.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(k.gl.NEAREST,k.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=R.ao([])}const x=this.sourceCache.getSourceTile(s,!0);if(x&&x.dem&&(!x.demTexture||x.needsTerrainPrepare)){const k=this.painter.context;x.demTexture=this.painter.getTileTexture(x.dem.stride),x.demTexture?x.demTexture.update(x.dem.getPixels(),{premultiply:!1}):x.demTexture=new xr(k,x.dem.getPixels(),k.gl.RGBA,{premultiply:!1}),x.demTexture.bind(k.gl.NEAREST,k.gl.CLAMP_TO_EDGE),x.needsTerrainPrepare=!1}const I=x&&x+x.tileID.key+s.key;if(I&&!this._demMatrixCache[I]){const k=this.sourceCache.sourceCache._source.maxzoom;let H=s.canonical.z-x.tileID.canonical.z;s.overscaledZ>s.canonical.z&&(s.canonical.z>=k?H=s.canonical.z-k:R.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const ee=s.canonical.x-(s.canonical.x>>H<<H),ne=s.canonical.y-(s.canonical.y>>H<<H),ue=R.bc(new Float64Array(16),[1/(R.N<<H),1/(R.N<<H),0]);R.$(ue,ue,[ee*R.N,ne*R.N,0]),this._demMatrixCache[s.key]={matrix:ue,coord:s}}return{u_depth:2,u_terrain:3,u_terrain_dim:x&&x.dem&&x.dem.dim||1,u_terrain_matrix:I?this._demMatrixCache[s.key].matrix:this._emptyDemMatrix,u_terrain_unpack:x&&x.dem&&x.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(x&&x.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:x}}getFramebuffer(s){const x=this.painter,I=x.width/devicePixelRatio,k=x.height/devicePixelRatio;return!this._fbo||this._fbo.width===I&&this._fbo.height===k||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new xr(x.context,{width:I,height:k,data:null},x.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(x.context.gl.NEAREST,x.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new xr(x.context,{width:I,height:k,data:null},x.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(x.context.gl.NEAREST,x.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=x.context.createFramebuffer(I,k,!0,!1),this._fbo.depthAttachment.set(x.context.createRenderbuffer(x.context.gl.DEPTH_COMPONENT16,I,k))),this._fbo.colorAttachment.set(s==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const s=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const x=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let H=0,ee=0;H<this._coordsTextureSize;H++)for(let ne=0;ne<this._coordsTextureSize;ne++,ee+=4)x[ee+0]=255&ne,x[ee+1]=255&H,x[ee+2]=ne>>8<<4|H>>8,x[ee+3]=0;const I=new R.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(x.buffer)),k=new xr(s,I,s.gl.RGBA,{premultiply:!1});return k.bind(s.gl.NEAREST,s.gl.CLAMP_TO_EDGE),this._coordsTexture=k,k}pointCoordinate(s){const x=new Uint8Array(4),I=this.painter.context,k=I.gl;I.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),k.readPixels(s.x,this.painter.height/devicePixelRatio-s.y-1,1,1,k.RGBA,k.UNSIGNED_BYTE,x),I.bindFramebuffer.set(null);const H=x[0]+(x[2]>>4<<8),ee=x[1]+((15&x[2])<<8),ne=this.coordsIndex[255-x[3]],ue=ne&&this.sourceCache.getTileByID(ne);if(!ue)return null;const _e=this._coordsTextureSize,h=(1<<ue.tileID.canonical.z)*_e;return new R.U(this._allowMercatorOverflow(s,(ue.tileID.canonical.x*_e+H)/h),(ue.tileID.canonical.y*_e+ee)/h,this.getElevation(ue.tileID,H,ee,_e))}getTerrainMesh(){if(this._mesh)return this._mesh;const s=this.painter.context,x=new R.bd,I=new R.b0,k=this.meshSize,H=R.N/k,ee=k*k;for(let g=0;g<=k;g++)for(let d=0;d<=k;d++)x.emplaceBack(d*H,g*H,0);for(let g=0;g<ee;g+=k+1)for(let d=0;d<k;d++)I.emplaceBack(d+g,k+d+g+1,k+d+g+2),I.emplaceBack(d+g,k+d+g+2,d+g+1);const ne=x.length,ue=ne+2*(k+1);for(const g of[0,1])for(let d=0;d<=k;d++)for(const b of[0,1])x.emplaceBack(d*H,g*R.N,b);for(let g=0;g<2*k;g+=2)I.emplaceBack(ue+g,ue+g+1,ue+g+3),I.emplaceBack(ue+g,ue+g+3,ue+g+2),I.emplaceBack(ne+g,ne+g+3,ne+g+1),I.emplaceBack(ne+g,ne+g+2,ne+g+3);const _e=x.length,h=_e+2*(k+1);for(const g of[0,1])for(let d=0;d<=k;d++)for(const b of[0,1])x.emplaceBack(g*R.N,d*H,b);for(let g=0;g<2*k;g+=2)I.emplaceBack(_e+g,_e+g+1,_e+g+3),I.emplaceBack(_e+g,_e+g+3,_e+g+2),I.emplaceBack(h+g,h+g+3,h+g+1),I.emplaceBack(h+g,h+g+2,h+g+3);return this._mesh={indexBuffer:s.createIndexBuffer(I),vertexBuffer:s.createVertexBuffer(x,uh.members),segments:R.S.simpleSegment(0,0,x.length,I.length)},this._mesh}getMeshFrameDelta(s){return 2*Math.PI*R.be/Math.pow(2,s)/5}getMinTileElevationForLngLatZoom(s,x){var I;const{tileID:k}=this._getOverscaledTileIDFromLngLatZoom(s,x);return(I=this.getMinMaxElevation(k).minElevation)!==null&&I!==void 0?I:0}getMinMaxElevation(s){const x=this.getTerrainData(s).tile,I={minElevation:null,maxElevation:null};return x&&x.dem&&(I.minElevation=x.dem.min*this.exaggeration,I.maxElevation=x.dem.max*this.exaggeration),I}_getOverscaledTileIDFromLngLatZoom(s,x){const I=R.U.fromLngLat(s.wrap()),k=(1<<x)*R.N,H=I.x*k,ee=I.y*k,ne=Math.floor(H/R.N),ue=Math.floor(ee/R.N);return{tileID:new R.O(x,0,x,ne,ue),mercatorX:H,mercatorY:ee}}_allowMercatorOverflow(s,x){const I=s.x<this.painter.width/2;let k=R.bf(x);const H=this.painter.transform.center.lng;return I&&Math.sign(k)>0&&Math.sign(H)<0||!I&&Math.sign(k)<0&&Math.sign(H)>0?(k=360*Math.sign(H)+k,R.G(k)):x}}class Qp{constructor(s,x,I){this._context=s,this._size=x,this._tileSize=I,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const s of this._objects)s.texture.destroy(),s.fbo.destroy()}_createObject(s){const x=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),I=new xr(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return I.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),x.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),x.colorAttachment.set(I.texture),{id:s,fbo:x,texture:I,stamp:-1,inUse:!1}}getObjectForId(s){return this._objects[s]}useObject(s){s.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(x=>s.id!==x),this._recentlyUsed.push(s.id)}stampObject(s){s.stamp=++this._stamp}getOrCreateFreeObject(){for(const x of this._recentlyUsed)if(!this._objects[x].inUse)return this._objects[x];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const s=this._createObject(this._objects.length);return this._objects.push(s),s}freeObject(s){s.inUse=!1}freeAllObjects(){for(const s of this._objects)this.freeObject(s)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(s=>!s.inUse)===!1}}const Gi={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Si{constructor(s,x){this.painter=s,this.terrain=x,this.pool=new Qp(s.context,30,x.sourceCache.tileSize*x.qualityFactor)}destruct(){this.pool.destruct()}getTexture(s){return this.pool.getObjectForId(s.rtt[this._stacks.length-1].id).texture}prepareForRender(s,x){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=s._order.filter(I=>!s._layers[I].isHidden(x)),this._coordsDescendingInv={};for(const I in s.sourceCaches){this._coordsDescendingInv[I]={};const k=s.sourceCaches[I].getVisibleCoordinates();for(const H of k){const ee=this.terrain.sourceCache.getTerrainCoords(H);for(const ne in ee)this._coordsDescendingInv[I][ne]||(this._coordsDescendingInv[I][ne]=[]),this._coordsDescendingInv[I][ne].push(ee[ne])}}this._coordsDescendingInvStr={};for(const I of s._order){const k=s._layers[I],H=k.source;if(Gi[k.type]&&!this._coordsDescendingInvStr[H]){this._coordsDescendingInvStr[H]={};for(const ee in this._coordsDescendingInv[H])this._coordsDescendingInvStr[H][ee]=this._coordsDescendingInv[H][ee].map(ne=>ne.key).sort().join()}}for(const I of this._renderableTiles)for(const k in this._coordsDescendingInvStr){const H=this._coordsDescendingInvStr[k][I.tileID.key];H&&H!==I.rttCoords[k]&&(I.rtt=[])}}renderLayer(s){if(s.isHidden(this.painter.transform.zoom))return!1;const x=s.type,I=this.painter,k=this._renderableLayerIds[this._renderableLayerIds.length-1]===s.id;if(Gi[x]&&(this._prevType&&Gi[this._prevType]||this._stacks.push([]),this._prevType=x,this._stacks[this._stacks.length-1].push(s.id),!k))return!0;if(Gi[this._prevType]||Gi[x]&&k){this._prevType=x;const H=this._stacks.length-1,ee=this._stacks[H]||[];for(const ne of this._renderableTiles){if(this.pool.isFull()&&(Fs(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(ne),ne.rtt[H]){const _e=this.pool.getObjectForId(ne.rtt[H].id);if(_e.stamp===ne.rtt[H].stamp){this.pool.useObject(_e);continue}}const ue=this.pool.getOrCreateFreeObject();this.pool.useObject(ue),this.pool.stampObject(ue),ne.rtt[H]={id:ue.id,stamp:ue.stamp},I.context.bindFramebuffer.set(ue.fbo.framebuffer),I.context.clear({color:R.aT.transparent,stencil:0}),I.currentStencilSource=void 0;for(let _e=0;_e<ee.length;_e++){const h=I.style._layers[ee[_e]],g=h.source?this._coordsDescendingInv[h.source][ne.tileID.key]:[ne.tileID];I.context.viewport.set([0,0,ue.fbo.width,ue.fbo.height]),I._renderTileClippingMasks(h,g),I.renderLayer(I,I.style.sourceCaches[h.source],h,g),h.source&&(ne.rttCoords[h.source]=this._coordsDescendingInvStr[h.source][ne.tileID.key])}}return Fs(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),Gi[x]}return!1}}const ji=de,ao={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:void 0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:R.c.MAX_TILE_CACHE_ZOOM_LEVELS,localIdeographFontFamily:"sans-serif",transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,validateStyle:!0,maxCanvasSize:[4096,4096]},Ic=z=>{z.touchstart=z.dragStart,z.touchmoveWindow=z.dragMove,z.touchend=z.dragEnd},Gs={showCompass:!0,showZoom:!0,visualizePitch:!1};class Lc{constructor(s,x,I=!1){this.mousedown=ee=>{this.startMouse(R.e({},ee,{ctrlKey:!0,preventDefault:()=>ee.preventDefault()}),be.mousePos(this.element,ee)),be.addEventListener(window,"mousemove",this.mousemove),be.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=ee=>{this.moveMouse(ee,be.mousePos(this.element,ee))},this.mouseup=ee=>{this.mouseRotate.dragEnd(ee),this.mousePitch&&this.mousePitch.dragEnd(ee),this.offTemp()},this.touchstart=ee=>{ee.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=be.touchPos(this.element,ee.targetTouches)[0],this.startTouch(ee,this._startPos),be.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),be.addEventListener(window,"touchend",this.touchend))},this.touchmove=ee=>{ee.targetTouches.length!==1?this.reset():(this._lastPos=be.touchPos(this.element,ee.targetTouches)[0],this.moveTouch(ee,this._lastPos))},this.touchend=ee=>{ee.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const k=s.dragRotate._mouseRotate.getClickTolerance(),H=s.dragRotate._mousePitch.getClickTolerance();this.element=x,this.mouseRotate=Wc({clickTolerance:k,enable:!0}),this.touchRotate=(({enable:ee,clickTolerance:ne,bearingDegreesPerPixelMoved:ue=.8})=>{const _e=new Ul;return new ah({clickTolerance:ne,move:(h,g)=>({bearingDelta:(g.x-h.x)*ue}),moveStateManager:_e,enable:ee,assignEvents:Ic})})({clickTolerance:k,enable:!0}),this.map=s,I&&(this.mousePitch=vl({clickTolerance:H,enable:!0}),this.touchPitch=(({enable:ee,clickTolerance:ne,pitchDegreesPerPixelMoved:ue=-.5})=>{const _e=new Ul;return new ah({clickTolerance:ne,move:(h,g)=>({pitchDelta:(g.y-h.y)*ue}),moveStateManager:_e,enable:ee,assignEvents:Ic})})({clickTolerance:H,enable:!0})),be.addEventListener(x,"mousedown",this.mousedown),be.addEventListener(x,"touchstart",this.touchstart,{passive:!1}),be.addEventListener(x,"touchcancel",this.reset)}startMouse(s,x){this.mouseRotate.dragStart(s,x),this.mousePitch&&this.mousePitch.dragStart(s,x),be.disableDrag()}startTouch(s,x){this.touchRotate.dragStart(s,x),this.touchPitch&&this.touchPitch.dragStart(s,x),be.disableDrag()}moveMouse(s,x){const I=this.map,{bearingDelta:k}=this.mouseRotate.dragMove(s,x)||{};if(k&&I.setBearing(I.getBearing()+k),this.mousePitch){const{pitchDelta:H}=this.mousePitch.dragMove(s,x)||{};H&&I.setPitch(I.getPitch()+H)}}moveTouch(s,x){const I=this.map,{bearingDelta:k}=this.touchRotate.dragMove(s,x)||{};if(k&&I.setBearing(I.getBearing()+k),this.touchPitch){const{pitchDelta:H}=this.touchPitch.dragMove(s,x)||{};H&&I.setPitch(I.getPitch()+H)}}off(){const s=this.element;be.removeEventListener(s,"mousedown",this.mousedown),be.removeEventListener(s,"touchstart",this.touchstart,{passive:!1}),be.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),be.removeEventListener(window,"touchend",this.touchend),be.removeEventListener(s,"touchcancel",this.reset),this.offTemp()}offTemp(){be.enableDrag(),be.removeEventListener(window,"mousemove",this.mousemove),be.removeEventListener(window,"mouseup",this.mouseup),be.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),be.removeEventListener(window,"touchend",this.touchend)}}let ul;function Nh(z,s,x){if(z=new R.L(z.lng,z.lat),s){const I=new R.L(z.lng-360,z.lat),k=new R.L(z.lng+360,z.lat),H=x.locationPoint(z).distSqr(s);x.locationPoint(I).distSqr(s)<H?z=I:x.locationPoint(k).distSqr(s)<H&&(z=k)}for(;Math.abs(z.lng-x.center.lng)>180;){const I=x.locationPoint(z);if(I.x>=0&&I.y>=0&&I.x<=x.width&&I.y<=x.height)break;z.lng>x.center.lng?z.lng-=360:z.lng+=360}return z}const xa={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Al(z,s,x){const I=z.classList;for(const k in xa)I.remove(`maplibregl-${x}-anchor-${k}`);I.add(`maplibregl-${x}-anchor-${s}`)}class Lu extends R.E{constructor(s){if(super(),this._onKeyPress=x=>{const I=x.code,k=x.charCode||x.keyCode;I!=="Space"&&I!=="Enter"&&k!==32&&k!==13||this.togglePopup()},this._onMapClick=x=>{const I=x.originalEvent.target,k=this._element;this._popup&&(I===k||k.contains(I))&&this.togglePopup()},this._update=x=>{if(!this._map)return;const I=this._map.loaded()&&!this._map.isMoving();((x==null?void 0:x.type)==="terrain"||(x==null?void 0:x.type)==="render"&&!I)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=Nh(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let k="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?k=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(k=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let H="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?H="rotateX(0deg)":this._pitchAlignment==="map"&&(H=`rotateX(${this._map.getPitch()}deg)`),x&&x.type!=="moveend"||(this._pos=this._pos.round()),be.setTransform(this._element,`${xa[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${H} ${k}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const ee=this._map.unproject(this._pos),ne=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=ee.distanceTo(this._lngLat)>20*ne?"0.2":"1.0",this._opacityTimeout=null},100))},this._onMove=x=>{if(!this._isDragging){const I=this._clickTolerance||this._map._clickTolerance;this._isDragging=x.point.dist(this._pointerdownPos)>=I}this._isDragging&&(this._pos=x.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new R.k("dragstart"))),this.fire(new R.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new R.k("dragend")),this._state="inactive"},this._addDragHandler=x=>{this._element.contains(x.originalEvent.target)&&(x.preventDefault(),this._positionDelta=x.point.sub(this._pos).add(this._offset),this._pointerdownPos=x.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=s&&s.anchor||"center",this._color=s&&s.color||"#3FB1CE",this._scale=s&&s.scale||1,this._draggable=s&&s.draggable||!1,this._clickTolerance=s&&s.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=s&&s.rotation||0,this._rotationAlignment=s&&s.rotationAlignment||"auto",this._pitchAlignment=s&&s.pitchAlignment&&s.pitchAlignment!=="auto"?s.pitchAlignment:this._rotationAlignment,s&&s.element)this._element=s.element,this._offset=R.P.convert(s&&s.offset||[0,0]);else{this._defaultMarker=!0,this._element=be.create("div"),this._element.setAttribute("aria-label","Map marker");const x=be.createNS("http://www.w3.org/2000/svg","svg"),I=41,k=27;x.setAttributeNS(null,"display","block"),x.setAttributeNS(null,"height",`${I}px`),x.setAttributeNS(null,"width",`${k}px`),x.setAttributeNS(null,"viewBox",`0 0 ${k} ${I}`);const H=be.createNS("http://www.w3.org/2000/svg","g");H.setAttributeNS(null,"stroke","none"),H.setAttributeNS(null,"stroke-width","1"),H.setAttributeNS(null,"fill","none"),H.setAttributeNS(null,"fill-rule","evenodd");const ee=be.createNS("http://www.w3.org/2000/svg","g");ee.setAttributeNS(null,"fill-rule","nonzero");const ne=be.createNS("http://www.w3.org/2000/svg","g");ne.setAttributeNS(null,"transform","translate(3.0, 29.0)"),ne.setAttributeNS(null,"fill","#000000");const ue=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const te of ue){const fe=be.createNS("http://www.w3.org/2000/svg","ellipse");fe.setAttributeNS(null,"opacity","0.04"),fe.setAttributeNS(null,"cx","10.5"),fe.setAttributeNS(null,"cy","5.80029008"),fe.setAttributeNS(null,"rx",te.rx),fe.setAttributeNS(null,"ry",te.ry),ne.appendChild(fe)}const _e=be.createNS("http://www.w3.org/2000/svg","g");_e.setAttributeNS(null,"fill",this._color);const h=be.createNS("http://www.w3.org/2000/svg","path");h.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),_e.appendChild(h);const g=be.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"fill","#000000");const d=be.createNS("http://www.w3.org/2000/svg","path");d.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),g.appendChild(d);const b=be.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"transform","translate(6.0, 7.0)"),b.setAttributeNS(null,"fill","#FFFFFF");const B=be.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"transform","translate(8.0, 8.0)");const G=be.createNS("http://www.w3.org/2000/svg","circle");G.setAttributeNS(null,"fill","#000000"),G.setAttributeNS(null,"opacity","0.25"),G.setAttributeNS(null,"cx","5.5"),G.setAttributeNS(null,"cy","5.5"),G.setAttributeNS(null,"r","5.4999962");const q=be.createNS("http://www.w3.org/2000/svg","circle");q.setAttributeNS(null,"fill","#FFFFFF"),q.setAttributeNS(null,"cx","5.5"),q.setAttributeNS(null,"cy","5.5"),q.setAttributeNS(null,"r","5.4999962"),B.appendChild(G),B.appendChild(q),ee.appendChild(ne),ee.appendChild(_e),ee.appendChild(g),ee.appendChild(b),ee.appendChild(B),x.appendChild(ee),x.setAttributeNS(null,"height",I*this._scale+"px"),x.setAttributeNS(null,"width",k*this._scale+"px"),this._element.appendChild(x),this._offset=R.P.convert(s&&s.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",x=>{x.preventDefault()}),this._element.addEventListener("mousedown",x=>{x.preventDefault()}),Al(this._element,this._anchor,"marker"),s&&s.className)for(const x of s.className.split(" "))this._element.classList.add(x);this._popup=null}addTo(s){return this.remove(),this._map=s,s.getCanvasContainer().appendChild(this._element),s.on("move",this._update),s.on("moveend",this._update),s.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),be.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(s){return this._lngLat=R.L.convert(s),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(s){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),s){if(!("offset"in s.options)){const k=Math.abs(13.5)/Math.SQRT2;s.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[k,-1*(38.1-13.5+k)],"bottom-right":[-k,-1*(38.1-13.5+k)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=s,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){const s=this._popup;return s?(s.isOpen()?s.remove():s.addTo(this._map),this):this}getOffset(){return this._offset}setOffset(s){return this._offset=R.P.convert(s),this._update(),this}addClassName(s){this._element.classList.add(s)}removeClassName(s){this._element.classList.remove(s)}toggleClassName(s){return this._element.classList.toggle(s)}setDraggable(s){return this._draggable=!!s,this._map&&(s?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(s){return this._rotation=s||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(s){return this._rotationAlignment=s||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(s){return this._pitchAlignment=s&&s!=="auto"?s:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const ks={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let _l=0,pc=!1;const Du={maxWidth:100,unit:"metric"};function zh(z,s,x){const I=x&&x.maxWidth||100,k=z._container.clientHeight/2,H=z.unproject([0,k]),ee=z.unproject([I,k]),ne=H.distanceTo(ee);if(x&&x.unit==="imperial"){const ue=3.2808*ne;ue>5280?Su(s,I,ue/5280,z._getUIString("ScaleControl.Miles")):Su(s,I,ue,z._getUIString("ScaleControl.Feet"))}else x&&x.unit==="nautical"?Su(s,I,ne/1852,z._getUIString("ScaleControl.NauticalMiles")):ne>=1e3?Su(s,I,ne/1e3,z._getUIString("ScaleControl.Kilometers")):Su(s,I,ne,z._getUIString("ScaleControl.Meters"))}function Su(z,s,x,I){const k=function(H){const ee=Math.pow(10,`${Math.floor(H)}`.length-1);let ne=H/ee;return ne=ne>=10?10:ne>=5?5:ne>=3?3:ne>=2?2:ne>=1?1:function(ue){const _e=Math.pow(10,Math.ceil(-Math.log(ue)/Math.LN10));return Math.round(ue*_e)/_e}(ne),ee*ne}(x);z.style.width=s*(k/x)+"px",z.innerHTML=`${k}&nbsp;${I}`}const qc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Sh=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function nc(z){if(z){if(typeof z=="number"){const s=Math.round(Math.abs(z)/Math.SQRT2);return{center:new R.P(0,0),top:new R.P(0,z),"top-left":new R.P(s,s),"top-right":new R.P(-s,s),bottom:new R.P(0,-z),"bottom-left":new R.P(s,-s),"bottom-right":new R.P(-s,-s),left:new R.P(z,0),right:new R.P(-z,0)}}if(z instanceof R.P||Array.isArray(z)){const s=R.P.convert(z);return{center:s,top:s,"top-left":s,"top-right":s,bottom:s,"bottom-left":s,"bottom-right":s,left:s,right:s}}return{center:R.P.convert(z.center||[0,0]),top:R.P.convert(z.top||[0,0]),"top-left":R.P.convert(z["top-left"]||[0,0]),"top-right":R.P.convert(z["top-right"]||[0,0]),bottom:R.P.convert(z.bottom||[0,0]),"bottom-left":R.P.convert(z["bottom-left"]||[0,0]),"bottom-right":R.P.convert(z["bottom-right"]||[0,0]),left:R.P.convert(z.left||[0,0]),right:R.P.convert(z.right||[0,0])}}return nc(new R.P(0,0))}const Yl={extend:(z,...s)=>R.e(z,...s),run(z){z()},logToElement(z,s=!1,x="log"){const I=window.document.getElementById(x);I&&(s&&(I.innerHTML=""),I.innerHTML+=`<br>${z}`)}},Th=de;class ba{static get version(){return Th}static get workerCount(){return at.workerCount}static set workerCount(s){at.workerCount=s}static get maxParallelImageRequests(){return R.c.MAX_PARALLEL_IMAGE_REQUESTS}static set maxParallelImageRequests(s){R.c.MAX_PARALLEL_IMAGE_REQUESTS=s}static get workerUrl(){return R.c.WORKER_URL}static set workerUrl(s){R.c.WORKER_URL=s}static addProtocol(s,x){R.c.REGISTERED_PROTOCOLS[s]=x}static removeProtocol(s){delete R.c.REGISTERED_PROTOCOLS[s]}}return ba.Map=class extends fa{constructor(z){if(R.bg.mark(R.bh.create),(z=R.e({},ao,z)).minZoom!=null&&z.maxZoom!=null&&z.minZoom>z.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(z.minPitch!=null&&z.maxPitch!=null&&z.minPitch>z.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(z.minPitch!=null&&z.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(z.maxPitch!=null&&z.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Jh(z.minZoom,z.maxZoom,z.minPitch,z.maxPitch,z.renderWorldCopies),{bearingSnap:z.bearingSnap}),this._cooperativeGesturesOnWheel=s=>{this._onCooperativeGesture(s,s[this._metaKey],1)},this._contextLost=s=>{s.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new R.k("webglcontextlost",{originalEvent:s}))},this._contextRestored=s=>{this._setupPainter(),this.resize(),this._update(),this.fire(new R.k("webglcontextrestored",{originalEvent:s}))},this._onMapScroll=s=>{if(s.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=z.interactive,this._cooperativeGestures=z.cooperativeGestures,this._metaKey=navigator.platform.indexOf("Mac")===0?"metaKey":"ctrlKey",this._maxTileCacheSize=z.maxTileCacheSize,this._maxTileCacheZoomLevels=z.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=z.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=z.preserveDrawingBuffer,this._antialias=z.antialias,this._trackResize=z.trackResize,this._bearingSnap=z.bearingSnap,this._refreshExpiredTiles=z.refreshExpiredTiles,this._fadeDuration=z.fadeDuration,this._crossSourceCollisions=z.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=z.collectResourceTiming,this._renderTaskQueue=new lu,this._controls=[],this._mapId=R.a2(),this._locale=R.e({},wu,z.locale),this._clickTolerance=z.clickTolerance,this._overridePixelRatio=z.pixelRatio,this._maxCanvasSize=z.maxCanvasSize,this.transformCameraUpdate=z.transformCameraUpdate,this._imageQueueHandle=Ve.addThrottleControl(()=>this.isMoving()),this._requestManager=new er(z.transformRequest),typeof z.container=="string"){if(this._container=document.getElementById(z.container),!this._container)throw new Error(`Container '${z.container}' not found.`)}else{if(!(z.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=z.container}if(z.maxBounds&&this.setMaxBounds(z.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window!="undefined"){addEventListener("online",this._onWindowOnline,!1);let s=!1;const x=Ac(I=>{this._trackResize&&!this._removed&&this.resize(I)._update()},50);this._resizeObserver=new ResizeObserver(I=>{s?x(I):s=!0}),this._resizeObserver.observe(this._container)}this.handlers=new ql(this,z),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=z.hash&&new kh(typeof z.hash=="string"&&z.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:z.center,zoom:z.zoom,bearing:z.bearing,pitch:z.pitch}),z.bounds&&(this.resize(),this.fitBounds(z.bounds,R.e({},z.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=z.localIdeographFontFamily,this._validateStyle=z.validateStyle,z.style&&this.setStyle(z.style,{localIdeographFontFamily:z.localIdeographFontFamily}),z.attributionControl&&this.addControl(new Rs({customAttribution:z.customAttribution})),z.maplibreLogo&&this.addControl(new hs,z.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",s=>{this._update(s.dataType==="style"),this.fire(new R.k(`${s.dataType}data`,s))}),this.on("dataloading",s=>{this.fire(new R.k(`${s.dataType}dataloading`,s))}),this.on("dataabort",s=>{this.fire(new R.k("sourcedataabort",s))})}_getMapId(){return this._mapId}addControl(z,s){if(s===void 0&&(s=z.getDefaultPosition?z.getDefaultPosition():"top-right"),!z||!z.onAdd)return this.fire(new R.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const x=z.onAdd(this);this._controls.push(z);const I=this._controlPositions[s];return s.indexOf("bottom")!==-1?I.insertBefore(x,I.firstChild):I.appendChild(x),this}removeControl(z){if(!z||!z.onRemove)return this.fire(new R.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const s=this._controls.indexOf(z);return s>-1&&this._controls.splice(s,1),z.onRemove(this),this}hasControl(z){return this._controls.indexOf(z)>-1}calculateCameraOptionsFromTo(z,s,x,I){return I==null&&this.terrain&&(I=this.terrain.getElevationForLngLatZoom(x,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(z,s,x,I)}resize(z){var s;const x=this._containerDimensions(),I=x[0],k=x[1],H=this._getClampedPixelRatio(I,k);if(this._resizeCanvas(I,k,H),this.painter.resize(I,k,H),this.painter.overLimit()){const ne=this.painter.context.gl;this._maxCanvasSize=[ne.drawingBufferWidth,ne.drawingBufferHeight];const ue=this._getClampedPixelRatio(I,k);this._resizeCanvas(I,k,ue),this.painter.resize(I,k,ue)}this.transform.resize(I,k),(s=this._requestedCameraState)===null||s===void 0||s.resize(I,k);const ee=!this._moving;return ee&&(this.stop(),this.fire(new R.k("movestart",z)).fire(new R.k("move",z))),this.fire(new R.k("resize",z)),ee&&this.fire(new R.k("moveend",z)),this}_getClampedPixelRatio(z,s){const{0:x,1:I}=this._maxCanvasSize,k=this.getPixelRatio(),H=z*k,ee=s*k;return Math.min(H>x?x/H:1,ee>I?I/ee:1)*k}getPixelRatio(){var z;return(z=this._overridePixelRatio)!==null&&z!==void 0?z:devicePixelRatio}setPixelRatio(z){this._overridePixelRatio=z,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(z){return this.transform.setMaxBounds(wr.convert(z)),this._update()}setMinZoom(z){if((z=z==null?-2:z)>=-2&&z<=this.transform.maxZoom)return this.transform.minZoom=z,this._update(),this.getZoom()<z&&this.setZoom(z),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(z){if((z=z==null?22:z)>=this.transform.minZoom)return this.transform.maxZoom=z,this._update(),this.getZoom()>z&&this.setZoom(z),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(z){if((z=z==null?0:z)<0)throw new Error("minPitch must be greater than or equal to 0");if(z>=0&&z<=this.transform.maxPitch)return this.transform.minPitch=z,this._update(),this.getPitch()<z&&this.setPitch(z),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(z){if((z=z==null?60:z)>85)throw new Error("maxPitch must be less than or equal to 85");if(z>=this.transform.minPitch)return this.transform.maxPitch=z,this._update(),this.getPitch()>z&&this.setPitch(z),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(z){return this.transform.renderWorldCopies=z,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(z){return this._cooperativeGestures=z,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(z){return this.transform.locationPoint(R.L.convert(z),this.style&&this.terrain)}unproject(z){return this.transform.pointLocation(R.P.convert(z),this.terrain)}isMoving(){var z;return this._moving||((z=this.handlers)===null||z===void 0?void 0:z.isMoving())}isZooming(){var z;return this._zooming||((z=this.handlers)===null||z===void 0?void 0:z.isZooming())}isRotating(){var z;return this._rotating||((z=this.handlers)===null||z===void 0?void 0:z.isRotating())}_createDelegatedListener(z,s,x){if(z==="mouseenter"||z==="mouseover"){let I=!1;return{layer:s,listener:x,delegates:{mousemove:H=>{const ee=this.getLayer(s)?this.queryRenderedFeatures(H.point,{layers:[s]}):[];ee.length?I||(I=!0,x.call(this,new Ya(z,this,H.originalEvent,{features:ee}))):I=!1},mouseout:()=>{I=!1}}}}if(z==="mouseleave"||z==="mouseout"){let I=!1;return{layer:s,listener:x,delegates:{mousemove:ee=>{(this.getLayer(s)?this.queryRenderedFeatures(ee.point,{layers:[s]}):[]).length?I=!0:I&&(I=!1,x.call(this,new Ya(z,this,ee.originalEvent)))},mouseout:ee=>{I&&(I=!1,x.call(this,new Ya(z,this,ee.originalEvent)))}}}}{const I=k=>{const H=this.getLayer(s)?this.queryRenderedFeatures(k.point,{layers:[s]}):[];H.length&&(k.features=H,x.call(this,k),delete k.features)};return{layer:s,listener:x,delegates:{[z]:I}}}}on(z,s,x){if(x===void 0)return super.on(z,s);const I=this._createDelegatedListener(z,s,x);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[z]=this._delegatedListeners[z]||[],this._delegatedListeners[z].push(I);for(const k in I.delegates)this.on(k,I.delegates[k]);return this}once(z,s,x){if(x===void 0)return super.once(z,s);const I=this._createDelegatedListener(z,s,x);for(const k in I.delegates)this.once(k,I.delegates[k]);return this}off(z,s,x){return x===void 0?super.off(z,s):(this._delegatedListeners&&this._delegatedListeners[z]&&(I=>{const k=this._delegatedListeners[z];for(let H=0;H<k.length;H++){const ee=k[H];if(ee.layer===s&&ee.listener===x){for(const ne in ee.delegates)this.off(ne,ee.delegates[ne]);return k.splice(H,1),this}}})(),this)}queryRenderedFeatures(z,s){if(!this.style)return[];let x;const I=z instanceof R.P||Array.isArray(z),k=I?z:[[0,0],[this.transform.width,this.transform.height]];if(s=s||(I?{}:z)||{},k instanceof R.P||typeof k[0]=="number")x=[R.P.convert(k)];else{const H=R.P.convert(k[0]),ee=R.P.convert(k[1]);x=[H,new R.P(ee.x,H.y),ee,new R.P(H.x,ee.y),H]}return this.style.queryRenderedFeatures(x,s,this.transform)}querySourceFeatures(z,s){return this.style.querySourceFeatures(z,s)}setStyle(z,s){return(s=R.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},s)).diff!==!1&&s.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&z?(this._diffStyle(z,s),this):(this._localIdeographFontFamily=s.localIdeographFontFamily,this._updateStyle(z,s))}setTransformRequest(z){return this._requestManager.setTransformRequest(z),this}_getUIString(z){const s=this._locale[z];if(s==null)throw new Error(`Missing UI string '${z}'`);return s}_updateStyle(z,s){if(s.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(z,s));const x=this.style&&s.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!z)),z?(this.style=new Fa(this,s||{}),this.style.setEventedParent(this,{style:this.style}),typeof z=="string"?this.style.loadURL(z,s,x):this.style.loadJSON(z,s,x),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Fa(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(z,s){if(typeof z=="string"){const x=this._requestManager.transformRequest(z,et.Style);R.f(x,(I,k)=>{I?this.fire(new R.j(I)):k&&this._updateDiff(k,s)})}else typeof z=="object"&&this._updateDiff(z,s)}_updateDiff(z,s){try{this.style.setState(z,s)&&this._update(!0)}catch(x){R.w(`Unable to perform style diff: ${x.message||x.error||x}. Rebuilding the style from scratch.`),this._updateStyle(z,s)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():R.w("There is no style added to the map.")}addSource(z,s){return this._lazyInitEmptyStyle(),this.style.addSource(z,s),this._update(!0)}isSourceLoaded(z){const s=this.style&&this.style.sourceCaches[z];if(s!==void 0)return s.loaded();this.fire(new R.j(new Error(`There is no source with ID '${z}'`)))}setTerrain(z){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),z){const s=this.style.sourceCaches[z.source];if(!s)throw new Error(`cannot load terrain, because there exists no source with ID: ${z.source}`);for(const x in this.style._layers){const I=this.style._layers[x];I.type==="hillshade"&&I.source===z.source&&R.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Nu(this.painter,s,z),this.painter.renderToTexture=new Si(this.painter,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=x=>{x.dataType==="style"?this.terrain.sourceCache.freeRtt():x.dataType==="source"&&x.tile&&(x.sourceId!==z.source||this._elevationFreeze||(this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(x.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0;return this.fire(new R.k("terrain",{terrain:z})),this}getTerrain(){var z,s;return(s=(z=this.terrain)===null||z===void 0?void 0:z.options)!==null&&s!==void 0?s:null}areTilesLoaded(){const z=this.style&&this.style.sourceCaches;for(const s in z){const x=z[s]._tiles;for(const I in x){const k=x[I];if(k.state!=="loaded"&&k.state!=="errored")return!1}}return!0}addSourceType(z,s,x){return this._lazyInitEmptyStyle(),this.style.addSourceType(z,s,x)}removeSource(z){return this.style.removeSource(z),this._update(!0)}getSource(z){return this.style.getSource(z)}addImage(z,s,x={}){const{pixelRatio:I=1,sdf:k=!1,stretchX:H,stretchY:ee,content:ne}=x;if(this._lazyInitEmptyStyle(),!(s instanceof HTMLImageElement||R.a(s))){if(s.width===void 0||s.height===void 0)return this.fire(new R.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:ue,height:_e,data:h}=s,g=s;return this.style.addImage(z,{data:new R.R({width:ue,height:_e},new Uint8Array(h)),pixelRatio:I,stretchX:H,stretchY:ee,content:ne,sdf:k,version:0,userImage:g}),g.onAdd&&g.onAdd(this,z),this}}{const{width:ue,height:_e,data:h}=R.h.getImageData(s);this.style.addImage(z,{data:new R.R({width:ue,height:_e},h),pixelRatio:I,stretchX:H,stretchY:ee,content:ne,sdf:k,version:0})}}updateImage(z,s){const x=this.style.getImage(z);if(!x)return this.fire(new R.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const I=s instanceof HTMLImageElement||R.a(s)?R.h.getImageData(s):s,{width:k,height:H,data:ee}=I;if(k===void 0||H===void 0)return this.fire(new R.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(k!==x.data.width||H!==x.data.height)return this.fire(new R.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const ne=!(s instanceof HTMLImageElement||R.a(s));return x.data.replace(ee,ne),this.style.updateImage(z,x),this}getImage(z){return this.style.getImage(z)}hasImage(z){return z?!!this.style.getImage(z):(this.fire(new R.j(new Error("Missing required image id"))),!1)}removeImage(z){this.style.removeImage(z)}loadImage(z,s){Ve.getImage(this._requestManager.transformRequest(z,et.Image),s)}listImages(){return this.style.listImages()}addLayer(z,s){return this._lazyInitEmptyStyle(),this.style.addLayer(z,s),this._update(!0)}moveLayer(z,s){return this.style.moveLayer(z,s),this._update(!0)}removeLayer(z){return this.style.removeLayer(z),this._update(!0)}getLayer(z){return this.style.getLayer(z)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(z,s,x){return this.style.setLayerZoomRange(z,s,x),this._update(!0)}setFilter(z,s,x={}){return this.style.setFilter(z,s,x),this._update(!0)}getFilter(z){return this.style.getFilter(z)}setPaintProperty(z,s,x,I={}){return this.style.setPaintProperty(z,s,x,I),this._update(!0)}getPaintProperty(z,s){return this.style.getPaintProperty(z,s)}setLayoutProperty(z,s,x,I={}){return this.style.setLayoutProperty(z,s,x,I),this._update(!0)}getLayoutProperty(z,s){return this.style.getLayoutProperty(z,s)}setGlyphs(z,s={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(z,s),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(z,s,x={}){return this._lazyInitEmptyStyle(),this.style.addSprite(z,s,x,I=>{I||this._update(!0)}),this}removeSprite(z){return this._lazyInitEmptyStyle(),this.style.removeSprite(z),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(z,s={}){return this._lazyInitEmptyStyle(),this.style.setSprite(z,s,x=>{x||this._update(!0)}),this}setLight(z,s={}){return this._lazyInitEmptyStyle(),this.style.setLight(z,s),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(z,s){return this.style.setFeatureState(z,s),this._update()}removeFeatureState(z,s){return this.style.removeFeatureState(z,s),this._update()}getFeatureState(z){return this.style.getFeatureState(z)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let z=0,s=0;return this._container&&(z=this._container.clientWidth||400,s=this._container.clientHeight||300),[z,s]}_setupContainer(){const z=this._container;z.classList.add("maplibregl-map");const s=this._canvasContainer=be.create("div","maplibregl-canvas-container",z);this._interactive&&s.classList.add("maplibregl-interactive"),this._canvas=be.create("canvas","maplibregl-canvas",s),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const x=this._containerDimensions(),I=this._getClampedPixelRatio(x[0],x[1]);this._resizeCanvas(x[0],x[1],I);const k=this._controlContainer=be.create("div","maplibregl-control-container",z),H=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(ee=>{H[ee]=be.create("div",`maplibregl-ctrl-${ee} `,k)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){this._cooperativeGesturesScreen=be.create("div","maplibregl-cooperative-gesture-screen",this._container);let z=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(z=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map"),this._cooperativeGesturesScreen.innerHTML=`
<div class="maplibregl-desktop-message">${z}</div>
<div class="maplibregl-mobile-message">${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}</div>
`,this._cooperativeGesturesScreen.setAttribute("aria-hidden","true"),this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){be.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(z,s,x){this._canvas.width=Math.floor(x*z),this._canvas.height=Math.floor(x*s),this._canvas.style.width=`${z}px`,this._canvas.style.height=`${s}px`}_setupPainter(){const z={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let s=null;this._canvas.addEventListener("webglcontextcreationerror",I=>{s={requestedAttributes:z},I&&(s.statusMessage=I.statusMessage,s.type=I.type)},{once:!0});const x=this._canvas.getContext("webgl2",z)||this._canvas.getContext("webgl",z);if(!x){const I="Failed to initialize WebGL";throw s?(s.message=I,new Error(JSON.stringify(s))):new Error(I)}this.painter=new Tc(x,this.transform),Le.testSupport(x)}_onCooperativeGesture(z,s,x){return!s&&x<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(z){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||z,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(z){return this._update(),this._renderTaskQueue.add(z)}_cancelRenderFrame(z){this._renderTaskQueue.remove(z)}_render(z){const s=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(z),this._removed)return;let x=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const k=this.transform.zoom,H=R.h.now();this.style.zoomHistory.update(k,H);const ee=new R.a8(k,{now:H,fadeDuration:s,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),ne=ee.crossFadingFactor();ne===1&&ne===this._crossFadingFactor||(x=!0,this._crossFadingFactor=ne),this.style.update(ee)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,s,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:s,showPadding:this.showPadding}),this.fire(new R.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,R.bg.mark(R.bh.load),this.fire(new R.k("load"))),this.style&&(this.style.hasTransitions()||x)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const I=this._sourcesDirty||this._styleDirty||this._placementDirty;return I||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new R.k("idle")),!this._loaded||this._fullyLoaded||I||(this._fullyLoaded=!0,R.bg.mark(R.bh.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var z;this._hash&&this._hash.remove();for(const x of this._controls)x.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window!="undefined"&&removeEventListener("online",this._onWindowOnline,!1),Ve.removeThrottleControl(this._imageQueueHandle),(z=this._resizeObserver)===null||z===void 0||z.disconnect();const s=this.painter.context.gl.getExtension("WEBGL_lose_context");s&&s.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),be.remove(this._canvasContainer),be.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),R.bg.clearMetrics(),this._removed=!0,this.fire(new R.k("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=R.h.frame(z=>{R.bg.frame(z),this._frame=null,this._render(z)}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(z){this._showTileBoundaries!==z&&(this._showTileBoundaries=z,this._update())}get showPadding(){return!!this._showPadding}set showPadding(z){this._showPadding!==z&&(this._showPadding=z,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(z){this._showCollisionBoxes!==z&&(this._showCollisionBoxes=z,z?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(z){this._showOverdrawInspector!==z&&(this._showOverdrawInspector=z,this._update())}get repaint(){return!!this._repaint}set repaint(z){this._repaint!==z&&(this._repaint=z,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(z){this._vertices=z,this._update()}get version(){return ji}getCameraTargetElevation(){return this.transform.elevation}},ba.NavigationControl=class{constructor(z){this._updateZoomButtons=()=>{const s=this._map.getZoom(),x=s===this._map.getMaxZoom(),I=s===this._map.getMinZoom();this._zoomInButton.disabled=x,this._zoomOutButton.disabled=I,this._zoomInButton.setAttribute("aria-disabled",x.toString()),this._zoomOutButton.setAttribute("aria-disabled",I.toString())},this._rotateCompassArrow=()=>{const s=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=s},this._setButtonTitle=(s,x)=>{const I=this._map._getUIString(`NavigationControl.${x}`);s.title=I,s.setAttribute("aria-label",I)},this.options=R.e({},Gs,z),this._container=be.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",s=>s.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",s=>this._map.zoomIn({},{originalEvent:s})),be.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",s=>this._map.zoomOut({},{originalEvent:s})),be.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",s=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:s}):this._map.resetNorth({},{originalEvent:s})}),this._compassIcon=be.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(z){return this._map=z,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Lc(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){be.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(z,s){const x=be.create("button",z,this._container);return x.type="button",x.addEventListener("click",s),x}},ba.GeolocateControl=class extends R.E{constructor(z){super(),this._onSuccess=s=>{if(this._map){if(this._isOutOfMapMaxBounds(s))return this._setErrorState(),this.fire(new R.k("outofmaxbounds",s)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=s,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(s),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(s),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new R.k("geolocate",s)),this._finish()}},this._updateCamera=s=>{const x=new R.L(s.coords.longitude,s.coords.latitude),I=s.coords.accuracy,k=this._map.getBearing(),H=R.e({bearing:k},this.options.fitBoundsOptions),ee=wr.fromLngLat(x,I);this._map.fitBounds(ee,H,{geolocateSource:!0})},this._updateMarker=s=>{if(s){const x=new R.L(s.coords.longitude,s.coords.latitude);this._accuracyCircleMarker.setLngLat(x).addTo(this._map),this._userLocationDotMarker.setLngLat(x).addTo(this._map),this._accuracy=s.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=s=>{if(this._map){if(this.options.trackUserLocation)if(s.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const x=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=x,this._geolocateButton.setAttribute("aria-label",x),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(s.code===3&&pc)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new R.k("error",s)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=s=>{if(this._map){if(this._container.addEventListener("contextmenu",x=>x.preventDefault()),this._geolocateButton=be.create("button","maplibregl-ctrl-geolocate",this._container),be.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",s===!1){R.w("Geolocation support is not available so the GeolocateControl will be disabled.");const x=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=x,this._geolocateButton.setAttribute("aria-label",x)}else{const x=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=x,this._geolocateButton.setAttribute("aria-label",x)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=be.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Lu({element:this._dotElement}),this._circleElement=be.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Lu({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",x=>{x.geolocateSource||this._watchState!=="ACTIVE_LOCK"||x.originalEvent&&x.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new R.k("trackuserlocationend")))})}},this.options=R.e({},ks,z)}onAdd(z){return this._map=z,this._container=be.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(s,x=!1){ul===void 0||x?window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(I=>{ul=I.state!=="denied",s(ul)}).catch(()=>{ul=!!window.navigator.geolocation,s(ul)}):(ul=!!window.navigator.geolocation,s(ul)):s(ul)}(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),be.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,_l=0,pc=!1}_isOutOfMapMaxBounds(z){const s=this._map.getMaxBounds(),x=z.coords;return s&&(x.longitude<s.getWest()||x.longitude>s.getEast()||x.latitude<s.getSouth()||x.latitude>s.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const z=this._map.getBounds(),s=z.getSouthEast(),x=z.getNorthEast(),I=s.distanceTo(x),k=Math.ceil(this._accuracy/(I/this._map._container.clientHeight)*2);this._circleElement.style.width=`${k}px`,this._circleElement.style.height=`${k}px`}trigger(){if(!this._setup)return R.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new R.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":_l--,pc=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new R.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new R.k("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let z;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),_l++,_l>1?(z={maximumAge:6e5,timeout:0},pc=!0):(z=this.options.positionOptions,pc=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,z)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},ba.AttributionControl=Rs,ba.LogoControl=hs,ba.ScaleControl=class{constructor(z){this._onMove=()=>{zh(this._map,this._container,this.options)},this.setUnit=s=>{this.options.unit=s,zh(this._map,this._container,this.options)},this.options=R.e({},Du,z)}getDefaultPosition(){return"bottom-left"}onAdd(z){return this._map=z,this._container=be.create("div","maplibregl-ctrl maplibregl-ctrl-scale",z.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){be.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},ba.FullscreenControl=class extends R.E{constructor(z={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,z&&z.container&&(z.container instanceof HTMLElement?this._container=z.container:R.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(z){return this._map=z,this._container||(this._container=this._map.getContainer()),this._controlContainer=be.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){be.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const z=this._fullscreenButton=be.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);be.create("span","maplibregl-ctrl-icon",z).setAttribute("aria-hidden","true"),z.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const z=this._getTitle();this._fullscreenButton.setAttribute("aria-label",z),this._fullscreenButton.title=z}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new R.k("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new R.k("fullscreenend")),this._prevCooperativeGestures&&(this._map.setCooperativeGestures(this._prevCooperativeGestures),delete this._prevCooperativeGestures))}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},ba.TerrainControl=class{constructor(z){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))},this.options=z}onAdd(z){return this._map=z,this._container=be.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=be.create("button","maplibregl-ctrl-terrain",this._container),be.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){be.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},ba.Popup=class extends R.E{constructor(z){super(),this.remove=()=>(this._content&&be.remove(this._content),this._container&&(be.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new R.k("close")),this),this._onMouseUp=s=>{this._update(s.point)},this._onMouseMove=s=>{this._update(s.point)},this._onDrag=s=>{this._update(s.point)},this._update=s=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=be.create("div","maplibregl-popup",this._map.getContainer()),this._tip=be.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const ee of this.options.className.split(" "))this._container.classList.add(ee);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Nh(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!s)return;const x=this._pos=this._trackPointer&&s?s:this._map.project(this._lngLat);let I=this.options.anchor;const k=nc(this.options.offset);if(!I){const ee=this._container.offsetWidth,ne=this._container.offsetHeight;let ue;ue=x.y+k.bottom.y<ne?["top"]:x.y>this._map.transform.height-ne?["bottom"]:[],x.x<ee/2?ue.push("left"):x.x>this._map.transform.width-ee/2&&ue.push("right"),I=ue.length===0?"bottom":ue.join("-")}const H=x.add(k[I]).round();be.setTransform(this._container,`${xa[I]} translate(${H.x}px,${H.y}px)`),Al(this._container,I,"popup")},this._onClose=()=>{this.remove()},this.options=R.e(Object.create(qc),z)}addTo(z){return this._map&&this.remove(),this._map=z,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new R.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(z){return this._lngLat=R.L.convert(z),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(z){return this.setDOMContent(document.createTextNode(z))}setHTML(z){const s=document.createDocumentFragment(),x=document.createElement("body");let I;for(x.innerHTML=z;I=x.firstChild,I;)s.appendChild(I);return this.setDOMContent(s)}getMaxWidth(){var z;return(z=this._container)===null||z===void 0?void 0:z.style.maxWidth}setMaxWidth(z){return this.options.maxWidth=z,this._update(),this}setDOMContent(z){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=be.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(z),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(z){this._container&&this._container.classList.add(z)}removeClassName(z){this._container&&this._container.classList.remove(z)}setOffset(z){return this.options.offset=z,this._update(),this}toggleClassName(z){if(this._container)return this._container.classList.toggle(z)}_createCloseButton(){this.options.closeButton&&(this._closeButton=be.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const z=this._container.querySelector(Sh);z&&z.focus()}},ba.Marker=Lu,ba.Style=Fa,ba.LngLat=R.L,ba.LngLatBounds=wr,ba.Point=R.P,ba.MercatorCoordinate=R.U,ba.Evented=R.E,ba.AJAXError=R.bi,ba.config=R.c,ba.CanvasSource=Xi,ba.GeoJSONSource=Uo,ba.ImageSource=bo,ba.RasterDEMTileSource=li,ba.RasterTileSource=yi,ba.VectorTileSource=an,ba.VideoSource=So,ba.setRTLTextPlugin=R.bj,ba.getRTLTextPluginStatus=R.bk,ba.prewarm=function(){Wr().acquire(We)},ba.clearPrewarmedResources=function(){const z=or;z&&(z.isPreloaded()&&z.numActive()===1?(z.release(We),or=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},Yl.extend(ba,{isSafari:R.ac,getPerformanceMetrics:R.bg.getPerformanceMetrics}),ba});var M=ve;return M})},56052:function(Zr,_r){"use strict";var Se=Array.isArray;_r.Z=Se}}]);