!(function(){var Z_=(rr,ee,L)=>new Promise((q,he)=>{var _=fe=>{try{U(L.next(fe))}catch(se){he(se)}},le=fe=>{try{U(L.throw(fe))}catch(se){he(se)}},U=fe=>fe.done?q(fe.value):Promise.resolve(fe.value).then(_,le);U((L=L.apply(rr,ee)).next())});(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3633],{99758:function(rr,ee,L){"use strict";var q=L(79685),he=L(81383),_=function(){return _=Object.assign||function(U){for(var fe,se=1,Qe=arguments.length;se',function(rr){try{let ae=function(){U||(U=!0,_())},et=function(){try{le.documentElement.doScroll("left")}catch(dt){return void setTimeout(et,50)}ae()};var se=ae,Qe=et,L=(L=document.getElementsByTagName("script"))[L.length-1],ee=L.getAttribute("data-injectcss"),L=L.getAttribute("data-disable-injectsvg");if(!L){var q,he,_,le,U,fe=function(Ye,wt){wt.parentNode.insertBefore(Ye,wt)};if(ee&&!rr.__iconfont__svg__cssinject__){rr.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(dt){console&&console.log(dt)}}q=function(){var Ye,wt=document.createElement("div");wt.innerHTML=rr._iconfont_svg_string_3580659,(wt=wt.getElementsByTagName("svg")[0])&&(wt.setAttribute("aria-hidden","true"),wt.style.position="absolute",wt.style.width=0,wt.style.height=0,wt.style.overflow="hidden",wt=wt,(Ye=document.body).firstChild?fe(wt,Ye.firstChild):Ye.appendChild(wt))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(q,0):(he=function(){document.removeEventListener("DOMContentLoaded",he,!1),q()},document.addEventListener("DOMContentLoaded",he,!1)):document.attachEvent&&(_=q,le=rr.document,U=!1,et(),le.onreadystatechange=function(){le.readyState=="complete"&&(le.onreadystatechange=null,ae())})}}catch(ae){}}(window)},60740:function(rr,ee,L){"use strict";L.d(ee,{zP:function(){return _B},JE:function(){return mk},ns:function(){return gB}});var q=L(79685),he=(0,q.createContext)({});function _(){return(0,q.useContext)(he)}var le={},U={},fe=function(r){return U[r]},se=function(r,t){U[r]=t},Qe=function(r){return le[r]},ae=function(r,t){le[r]=t},et={},dt={},Ye=34,wt=10,Xt=13;function Zt(e){return new Function("d","return {"+e.map(function(r,t){return JSON.stringify(r)+": d["+t+'] || ""'}).join(",")+"}")}function nr(e,r){var t=Zt(e);return function(n,i){return r(t(n),i,e)}}function Vt(e){var r=Object.create(null),t=[];return e.forEach(function(n){for(var i in n)i in r||t.push(r[i]=i)}),t}function xt(e,r){var t=e+"",n=t.length;return n9999?"+"+xt(e,6):xt(e,4)}function Tr(e){var r=e.getUTCHours(),t=e.getUTCMinutes(),n=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":bt(e.getUTCFullYear(),4)+"-"+xt(e.getUTCMonth()+1,2)+"-"+xt(e.getUTCDate(),2)+(i?"T"+xt(r,2)+":"+xt(t,2)+":"+xt(n,2)+"."+xt(i,3)+"Z":n?"T"+xt(r,2)+":"+xt(t,2)+":"+xt(n,2)+"Z":t||r?"T"+xt(r,2)+":"+xt(t,2)+"Z":"")}function hr(e){var r=new RegExp('["'+e+` \r]`),t=e.charCodeAt(0);function n(b,T){var M,O,F=i(b,function($,G){if(M)return M($,G-1);O=$,M=T?nr($,T):Zt($)});return F.columns=O||[],F}function i(b,T){var M=[],O=b.length,F=0,$=0,G,ue=O<=0,xe=!1;b.charCodeAt(O-1)===wt&&--O,b.charCodeAt(O-1)===Xt&&--O;function ze(){if(ue)return dt;if(xe)return xe=!1,et;var ht,gt=F,Ot;if(b.charCodeAt(gt)===Ye){for(;F++=O?ue=!0:(Ot=b.charCodeAt(F++))===wt?xe=!0:Ot===Xt&&(xe=!0,b.charCodeAt(F)===wt&&++F),b.slice(gt+1,ht-1).replace(/""/g,'"')}for(;F=0))throw new Error("precision must be a positive number");var t=Math.pow(10,r||0);return Math.round(e*t)/t}function Ri(e,r){r===void 0&&(r="kilometers");var t=Me[r];if(!t)throw new Error(r+" units is invalid");return e*t}function Gn(e,r){r===void 0&&(r="kilometers");var t=Me[r];if(!t)throw new Error(r+" units is invalid");return e/t}function Dn(e,r){return Yi(Gn(e,r))}function Ya(e){var r=e%360;return r<0&&(r+=360),r}function Yi(e){var r=e%(2*Math.PI);return r*180/Math.PI}function Na(e){var r=e%360;return r*Math.PI/180}function Dt(e,r,t){if(r===void 0&&(r="kilometers"),t===void 0&&(t="kilometers"),!(e>=0))throw new Error("length must be a positive number");return Ri(Gn(e,r),t)}function k(e,r,t){if(r===void 0&&(r="meters"),t===void 0&&(t="kilometers"),!(e>=0))throw new Error("area must be a positive number");var n=nt[r];if(!n)throw new Error("invalid original units");var i=nt[t];if(!i)throw new Error("invalid final units");return e/n*i}function ie(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function ve(e){return!!e&&e.constructor===Object}function Ze(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(e.length!==4&&e.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(r){if(!ie(r))throw new Error("bbox must only contain numbers")})}function _t(e){if(!e)throw new Error("id is required");if(["string","number"].indexOf(typeof e)===-1)throw new Error("id must be a number or a string")}function Wt(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if(e.type==="Feature"&&e.geometry!==null&&e.geometry.type==="Point")return e.geometry.coordinates;if(e.type==="Point")return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Sr(e){if(Array.isArray(e))return e;if(e.type==="Feature"){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function He(e){if(e.length>1&&isNumber(e[0])&&isNumber(e[1]))return!0;if(Array.isArray(e[0])&&e[0].length)return He(e[0]);throw new Error("coordinates must only contain numbers")}function Et(e,r,t){if(!r||!t)throw new Error("type and name required");if(!e||e.type!==r)throw new Error("Invalid input to "+t+": must be a "+r+", given "+e.type)}function cr(e,r,t){if(!e)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!e||e.type!=="Feature"||!e.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!e.geometry||e.geometry.type!==r)throw new Error("Invalid input to "+t+": must be a "+r+", given "+e.geometry.type)}function mr(e,r,t){if(!e)throw new Error("No featureCollection passed");if(!t)throw new Error(".collectionOf() requires a name");if(!e||e.type!=="FeatureCollection")throw new Error("Invalid input to "+t+", FeatureCollection required");for(var n=0,i=e.features;nf||O>v||F>y){l=b,f=n,v=O,y=F,o=0;return}var $=lineString([l,b],t.properties);if(r($,n,i,F,o)===!1)return!1;o++,l=b})===!1)return!1}}})}function oe(e,r,t){var n=t,i=!1;return J(e,function(o,s,l,f,v){i===!1&&t===void 0?n=o:n=r(n,o,s,l,f,v),i=!0}),n}function be(e,r){if(!e)throw new Error("geojson is required");hi(e,function(t,n,i){if(t.geometry!==null){var o=t.geometry.type,s=t.geometry.coordinates;switch(o){case"LineString":if(r(t,n,i,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l=200&&t.status<300||t.status===0)&&t.response!==null){var o=t.response;if(e.type==="json")try{o=JSON.parse(t.response)}catch(l){return r(l)}r(null,o,t.getResponseHeader("Cache-Control"),t.getResponseHeader("Expires"),t)}else{var s=new Blob([t.response],{type:t.getResponseHeader("Content-Type")});r(new tn(t.status,t.statusText,n.toString(),s))}},t.cancel=t.abort,t.send(e.body),t}function qi(e){return new Promise(function(r,t){vi(e,function(n,i,o,s,l){n?t({err:n,data:null,xhr:l}):r({err:null,data:i,cacheControl:o,expires:s,xhr:l})})})}function ci(e,r){return vi(e,r)}var zi=function(r,t){var n=pi(r.url)||ci;return n((0,V.Z)((0,V.Z)({},r),{},{type:"json"}),t)},Ai=function(r,t){var n=pi(r.url)||ci;return n((0,V.Z)((0,V.Z)({},r),{},{type:"arrayBuffer"}),t)},Xo=function(r,t){return ci(_objectSpread(_objectSpread({},r),{},{method:"POST"}),t)},Ji=function(r,t){return ci((0,V.Z)((0,V.Z)({},r),{},{method:"GET"}),t)};function Ia(e){var r=window.document.createElement("a");return r.href=e,r.protocol===window.document.location.protocol&&r.host===window.document.location.host}var Ti="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function mi(e,r){var t=new window.Image,n=window.URL||window.webkitURL;t.crossOrigin="anonymous",t.onload=function(){r(null,t),n.revokeObjectURL(t.src),t.onload=null,window.requestAnimationFrame(function(){t.src=Ti})},t.onerror=function(){return r(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 i=new Blob([new Uint8Array(e)],{type:"image/png"});t.src=e.byteLength?n.createObjectURL(i):Ti}function wi(e,r){var t=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(t).then(function(n){r(null,n)}).catch(function(n){r(new Error("Could not load image because of ".concat(n.message,". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")))})}var Pa=function(r,t,n){var i=function(s,l){if(s)t(s);else if(l){var f=typeof createImageBitmap=="function",v=n?n(l):l;f?wi(v,t):mi(v,t)}};return r.type==="json"?zi(r,i):Ai(r,i)},cu=function(r,t){var n=typeof createImageBitmap=="function";n?wi(r,t):mi(r,t)},ma=function(e){return e.CENTER="center",e.TOP="top",e["TOP-LEFT"]="top-left",e["TOP-RIGHT"]="top-right",e.BOTTOM="bottom",e["BOTTOM-LEFT"]="bottom-left",e["BOTTOM-RIGHT"]="bottom-right",e.LEFT="left",e.RIGHT="right",e}({}),Aa={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 $l(e,r,t){var n=e.classList;for(var i in Aa)Aa.hasOwnProperty(i)&&n.remove("l7-".concat(t,"-anchor-").concat(i));n.add("l7-".concat(t,"-anchor-").concat(r))}var os=L(19007);function Ta(e){return typeof e=="string"?!!d3.color(e):!1}function fi(e){var r=os.ZP(e),t=[0,0,0,0];return r!=null&&(t[0]=r.r/255,t[1]=r.g/255,t[2]=r.b/255,t[3]=r.opacity),t}function Oa(e){var r=e&&e[0],t=e&&e[1],n=e&&e[2],i=r+t*256+n*65536-1;return i}function sa(e){return[e+1&255,e+1>>8&255,e+1>>8>>8&255]}function Ao(e){var r=window.document.createElement("canvas"),t=r.getContext("2d");r.width=256,r.height=1;for(var n=null,i=t.createLinearGradient(0,0,256,1),o=e.positions[0],s=e.positions[e.positions.length-1],l=0;l0&&new RegExp("(^|\\s)"+r+"(\\s|$)").test(t)}function Ha(e,r){e instanceof HTMLElement?e.className=r:e.className.baseVal=r}function ef(e){return e instanceof SVGElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}function Vp(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}var xs=rp(["transform","WebkitTransform"]);function Fu(e,r){e.style[xs]=r}function ku(){if(typeof Event=="function")window.dispatchEvent(new Event("resize"));else{var e=window.document.createEvent("UIEvents");e.initUIEvent("resize",!0,!1,window,0),window.dispatchEvent(e)}}function ql(e){var r=["padding: "+(e.height/2-8)+"px "+e.width/2+"px;","line-height: "+e.height+"px;","background-image: url("+e.toDataURL()+");"];console.log(`%c `,r.join(""))}function If(){var e,r=window.document.querySelector('meta[name="viewport"]');if(!r)return 1;var t=(e=r.content)===null||e===void 0?void 0:e.split(","),n=t.find(function(i){var o=i.split("="),s=(0,Sn.Z)(o,1),l=s[0];return l==="initial-scale"});return n?n.split("=")[1]*1:1}var wa=If()<1?1:window.devicePixelRatio;function Qs(e,r){e.setAttribute("style","".concat(e.style.cssText).concat(r))}function Rc(e){return e.split(";").map(function(r){return r.trim()}).filter(function(r){return r})}function Kl(e,r){var t,n=Rc((t=e.getAttribute("style"))!==null&&t!==void 0?t:""),i=Rc(r),o=el.apply(void 0,[n].concat((0,Kt.Z)(i)));e.setAttribute("style",o.join(";"))}function rl(e){return Object.entries(e).map(function(r){var t=(0,Sn.Z)(r,2),n=t[0],i=t[1];return"".concat(n,": ").concat(i)}).join(";")}function gh(e,r){return{left:e.left-r.left,top:e.top-r.top,right:r.left+r.width-e.left-e.width,bottom:r.top+r.height-e.top-e.height}}function Ql(e,r){e.checked=r,r?e.setAttribute("checked","true"):e.removeAttribute("checked")}function ca(e){e.innerHTML=""}function tf(e){e.setAttribute("draggable","false")}function np(e,r){if(typeof r=="string"){var t=document.createElement("div");for(t.innerHTML=r;t.firstChild;)e.append(t.firstChild)}else Array.isArray(r)?e.append.apply(e,(0,Kt.Z)(r)):e.append(r)}function Tl(e,r){for(var t=Array.isArray(r)?r:[r],n=e;n instanceof Element&&n!==window.document.body;){var i,o;if(t.find(function(s){var l;return(l=n)===null||l===void 0?void 0:l.matches(s)}))return n;n=(i=(o=n)===null||o===void 0?void 0:o.parentElement)!==null&&i!==void 0?i:null}}var Jl;function _h(e){return typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap}function Pf(){return typeof importScripts=="function"}var wl=Pf()?function(){return self.worker&&self.worker.referrer}:function(){return(window.location.protocol==="blob:"?window.parent:window).location.href},hu=(Jl=navigator)===null||Jl===void 0?void 0:Jl.userAgent,Mc=!!hu.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),rf=hu.indexOf("Android")>-1||hu.indexOf("Adr")>-1;function ec(){for(var e=hu,r=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"],t=!0,n=0,i=r;n0){t=!1;break}}return t}function tc(e,r){e.forEach(function(t){r[t]&&(r[t]=r[t].bind(r))})}var ip=null;function nl(e){var r=[1/0,1/0,-1/0,-1/0];return En(e,function(t){r[0]>t[0]&&(r[0]=t[0]),r[1]>t[1]&&(r[1]=t[1]),r[2]n&&e.lng<=o&&e.lat>i&&e.lat<=s}function Cl(e){var r=[1/0,1/0,-1/0,-1/0];return e.forEach(function(t){var n=t.coordinates;pu(r,n)}),r}function pu(e,r){return Array.isArray(r[0])?r.forEach(function(t){pu(e,t)}):(e[0]>r[0]&&(e[0]=r[0]),e[1]>r[1]&&(e[1]=r[1]),e[2]1&&arguments[1]!==void 0?arguments[1]:!0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{enable:!0,decimal:1};e=Df(e,r);var n=e[0],i=e[1],o=n*Ic/180,s=Math.log(Math.tan((90+i)*Math.PI/360))/(Math.PI/180);return s=s*Ic/180,t.enable&&(o=Number(o.toFixed(t.decimal)),s=Number(s.toFixed(t.decimal))),e.length===3?[o,s,e[2]]:[o,s]}function Md(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,t=e[0],n=e[1],i=t/Ic*180,o=n/Ic*180;return o=180/Math.PI*(2*Math.atan(Math.exp(o*Math.PI/180))-Math.PI/2),r!=null&&(i=Number(i.toFixed(r)),o=Number(o.toFixed(r))),e.length===3?[i,o,e[2]]:[i,o]}function Of(e){if(e==null)throw new Error("lng is required");return(e>180||e<-180)&&(e=e%360,e>180&&(e=-360+e),e<-180&&(e=360+e),e===0&&(e=0)),e}function xh(e){if(e==null)throw new Error("lat is required");return(e>90||e<-90)&&(e=e%180,e>90&&(e=-180+e),e<-90&&(e=180+e),e===0&&(e=0)),e}function Df(e,r){if(r===!1)return e;var t=Of(e[0]),n=xh(e[1]);return n>85&&(n=85),n<-85&&(n=-85),e.length===3?[t,n,e[2]]:[t,n]}function Fo(e){var r=85.0511287798,t=Math.max(Math.min(r,e[1]),-r),n=256<<20,i=Math.PI/180,o=e[0]*i,s=t*i;s=Math.log(Math.tan(Math.PI/4+s/2));var l=.5/Math.PI,f=.5,v=-.5/Math.PI;return i=.5,o=n*(l*o+f),s=n*(v*s+i),[Math.floor(o),Math.floor(s)]}function bh(e){var r=.5/Math.PI,t=.5,n=-.5/Math.PI,i=.5,o=256<<20,s=_slicedToArray(e,2),l=s[0],f=s[1];l=(l/o-t)/r,f=(f/o-i)/n,f=(Math.atan(Math.pow(Math.E,f))-Math.PI/4)*2,i=Math.PI/180;var v=f/i,y=l/i;return[y,v]}function ap(e,r){var t=85.0511287798,n=Math.PI/180,i=6378137;return r=Math.max(Math.min(t,r),-t),e*=n,r*=n,r=Math.log(Math.tan(Math.PI/4+r/2)),[e*i,r*i]}function Ff(e,r){var t=Math.PI/180,n=6378137,i=e/n/t,o=2*(Math.atan(Math.exp(r/n))-Math.PI/4)/t;return[i,o]}function Eh(e,r,t){var n=Na(r[1]-e[1]),i=Na(r[0]-e[0]),o=Na(e[1]),s=Na(r[1]),l=Math.pow(Math.sin(n/2),2)+Math.pow(Math.sin(i/2),2)*Math.cos(o)*Math.cos(s);return Ri(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),t="meters")}function Oc(e){var r=Math.PI/180,t=85.0511287798,n=6378137,i=Math.max(Math.min(t,e[1]),-t),o=Math.sin(i*r),s=n*e[0]*r,l=n*Math.log((1+o)/(1-o))/2;return[s,l]}function of(e,r){var t=Math.abs(e[1][1]-e[0][1])*r,n=Math.abs(e[1][0]-e[0][0])*r;return[[e[0][0]-n,e[0][1]-t],[e[1][0]+n,e[1][1]+t]]}function il(e,r){return e[0][0]<=r[0][0]&&e[0][1]<=r[0][1]&&e[1][0]>=r[1][0]&&e[1][1]>=r[1][1]}function pa(e){return[[e[0],e[1]],[e[2],e[3]]]}function kf(e){var r=du(e,[0,0]);return[e[0]/r,e[1]/r]}function du(e,r){return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}function Rl(e,r){return e[0]*r[0]+e[1]*r[1]}function Li(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Ca(e,r){return Math.acos(Rl(e,r)/(Li(e)*Li(r)))*180/Math.PI}function Ys(e,r){return r[0]>0?r[1]>0?90-Math.atan(r[1]/r[0])*180/Math.PI:90+Math.atan(-r[1]/r[0])*180/Math.PI:r[1]<0?180+(90-Math.atan(r[1]/r[0])*180/Math.PI):270+Math.atan(r[1]/-r[0])*180/Math.PI}function Bf(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:100;if(!(!e||e.length<2)){for(var t=[0,1],n=0,i=[],o=0;o0){var b=i[o-1].rotation;b-y>360-b+y&&(y=y+360)}i.push({start:s,end:l,dis:f,rotation:y,duration:0})}return i.map(function(T){T.duration=r*(T.dis/n)}),i}}function Fs(e){if(nf(e[0]))return e;if(nf(e[0][0]))throw new Error("\u5F53\u524D\u6570\u636E\u4E0D\u652F\u6301\u6807\u6CE8");if(nf(e[0][0][0])){var r=e,t=0,n=0,i=0;return r.forEach(function(o){o.forEach(function(s){t+=s[0],n+=s[1],i++})}),[t/i,n/i,0]}else throw new Error("\u5F53\u524D\u6570\u636E\u4E0D\u652F\u6301\u6807\u6CE8")}function sf(e){for(var r=e[0],t=e[1],n=e[0],i=e[1],o=0,s=0,l=0,f=0;fi&&(n=Math.floor(n/t)),n=n*r+e.charCodeAt(o);return n}function Lf(e){e=e.toString();for(var r=5381,t=e.length;t;)r=r*33^e.charCodeAt(--t);return r>>>0}function Ml(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var r=Math.random()*16|0,t=e==="x"?r:r&3|8;return t.toString(16)})}var ko=function(e){return e["GAODE1.x"]="GAODE1.x",e["GAODE2.x"]="GAODE2.x",e.MAPBOX="MAPBOX",e.DEFAULT="DEFAUlTMAP",e.SIMPLE="SIMPLE",e.GLOBEL="GLOBEL",e}({});function Wa(e,r,t,n,i){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:30,s=arguments.length>6?arguments[6]:void 0,l=t;return s&&(l=Math.round(t*(o-1))/(o-1)),n?_n(e,r,l,n,i):_n(e,r,l,.314,i)}function al(e,r){var t=1-r;return(e[0]*t+e[1]*r)*t+(e[1]*t+e[2]*r)*r}function Ah(e,r){return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}function Ka(e,r,t){var n=[r[0]-e[0],r[1]-e[1]],i=Ah(n,[0,0]),o=Math.atan2(n[1],n[0]),s=i/2/Math.cos(t),l=o+t,f=[s*Math.cos(l)+e[0],s*Math.sin(l)+e[1]];return f}function _n(e,r,t,n,i){if(i===MapType["GAODE2.x"]){var o=amap2Project(e[0],e[1]),s=amap2Project(r[0],r[1]),l=Ka(o,s,n),f=[o[0],l[0],s[0]],v=[o[1],l[1],s[1]];return[].concat(_toConsumableArray(amap2UnProject(al(f,t),al(v,t))),[0])}else{var y=Ka(e,r,n),b=[e[0],y[0],r[0]],T=[e[1],y[1],r[1]];return[al(b,t),al(T,t),0]}}function ks(e,r,t,n,i){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:30,s=arguments.length>6?arguments[6]:void 0,l=t;return s&&(l=Math.round(t*29)/29),ga(e,r,l,i)}function uf(e,r){var t=[r[0]-e[0],r[1]-e[1]],n=calDistance(t,[0,0]),i=Math.atan2(t[1],t[0]),o=.314,s=n/2/Math.cos(o),l=i+o,f=[s*Math.cos(l)+e[0],s*Math.sin(l)+e[1]];return f}function rc(e,r){var t=1-r;return(e[0]*t+e[1]*r)*t+(e[1]*t+e[2]*r)*r}function us(e,r){var t=[e[0]-r[0],e[1]-r[1]],n=[Math.sin(t[0]/2),Math.sin(t[1]/2)],i=n[1]*n[1]+Math.cos(e[1])*Math.cos(r[1])*n[0]*n[0];return 2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i))}function ga(e,r,t,n){var i=[degreesToRadians(e[0]),degreesToRadians(e[1])],o=[degreesToRadians(r[0]),degreesToRadians(r[1])];if(n==="GAODE2.x"){var s=uf(i,o),l=[i[0],s[0],o[0]],f=[i[1],s[1],o[1]];return[rc(l,t),rc(f,t),0]}else{var v=us(i,o);if(Math.abs(v-Math.PI)<.001)return[(1-t)*i[0]+t*o[0],(1-t)*i[1]+t*o[1]];var y=Math.sin((1-t)*v)/Math.sin(v),b=Math.sin(t*v)/Math.sin(v),T=[Math.sin(i[0]),Math.sin(i[1])],M=[Math.cos(i[0]),Math.cos(i[1])],O=[Math.sin(o[0]),Math.sin(o[1])],F=[Math.cos(o[0]),Math.cos(o[1])],$=y*M[1]*M[0]+b*F[1]*F[0],G=y*M[1]*T[0]+b*F[1]*O[0],ue=y*T[1]+b*O[1];return[radiansToDegrees(Math.atan2(G,$)),radiansToDegrees(Math.atan2(ue,Math.sqrt($*$+G*G)))]}}function Th(e,r){for(var t=0,n=[],i=0;iv){var $=O.p1,G=O.p2,ue=(v-O.lastTotalDistance)/O.distance,xe=qr(G,$,ue);y=xe[0],b=xe[1];break}}return{lng:y,lat:b,height:0}}function qr(e,r,t){return[e[0]*t+r[0]*(1-t),e[1]*t+r[1]*(1-t)]}function ol(e,r){return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}function Dc(e,r){var t=r.featureId,n=e.data.dataArray;return typeof t=="number"&&(n=n.filter(function(i){var o=i.id;return o===t})),n.map(function(i){var o=eu(i,r);return _objectSpread(_objectSpread({},i),o)})}function wh(e,r){return new Promise(function(t){e.inited?t(Dc(e,r)):e.once("update",function(){t(Dc(e,r))})})}function eu(e,r){var t=r.offset,n=r.shape,i=r.thetaOffset,o=r.mapVersion,s=r.segmentNumber,l=s===void 0?30:s,f=r.autoFit,v=f===void 0?!0:f,y=e.coordinates;if(n==="line")return pathLineAtOffset(y,t);var b=y[0],T=y[1],M=typeof i=="string"?e[i]||0:i,O;switch(n){case"arc":O=arcLineAtOffset;break;case"greatcircle":O=greatCircleLineAtOffset;break;default:O=arcLineAtOffset}var F=O(b,T,t,M,o,l,v),$=_slicedToArray(F,3),G=$[0],ue=$[1],xe=$[2];return{lng:G,lat:ue,height:xe}}var Bs=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:50,t=arguments.length>1?arguments[1]:void 0;(0,Q.Z)(this,e),this.limit=r,this.destroy=t||this.defaultDestroy,this.order=[],this.clear()}return(0,j.Z)(e,[{key:"clear",value:function(){var t=this;this.order.forEach(function(n){t.delete(n)}),this.cache={},this.order=[]}},{key:"get",value:function(t){var n=this.cache[t];return n&&(this.deleteOrder(t),this.appendOrder(t)),n}},{key:"set",value:function(t,n){this.cache[t]?(this.delete(t),this.cache[t]=n,this.appendOrder(t)):(Object.keys(this.cache).length===this.limit&&this.delete(this.order[0]),this.cache[t]=n,this.appendOrder(t))}},{key:"delete",value:function(t){var n=this.cache[t];n&&(this.deleteCache(t),this.deleteOrder(t),this.destroy(n,t))}},{key:"deleteCache",value:function(t){delete this.cache[t]}},{key:"deleteOrder",value:function(t){var n=this.order.findIndex(function(i){return i===t});n>=0&&this.order.splice(n,1)}},{key:"appendOrder",value:function(t){this.order.push(t)}},{key:"defaultDestroy",value:function(t,n){return null}}]),e}();function Nf(e){if(e.length===0)throw new Error("max requires at least one data point");for(var r=e[0],t=1;tr&&(r=e[t]);return r*1}function Uf(e){if(e.length===0)throw new Error("min requires at least one data point");for(var r=e[0],t=1;tn&&(n=i,t=r),i=1,r=e[o]):i++;return t*1}var Il={min:Uf,max:Nf,mean:Lu,sum:Yo,mode:sp};function lf(e,r){return e.map(function(t){return t[r]})}function up(e,r){return Il[e](r)}var Pt=L(64632),Fe=L(13547),B=L(6346),qs=L(29972),ge=L.n(qs);function Bo(e,r){r===void 0&&(r={});var t=Number(e[0]),n=Number(e[1]),i=Number(e[2]),o=Number(e[3]);if(e.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[t,n],l=[t,o],f=[i,o],v=[i,n];return Lt([[s,v,f,l,s]],r.properties,{bbox:e,id:r.id})}var io=L(11488),vu=L.n(io),bs=function(e){return e.Realtime="realtime",e.Overlap="overlap",e.Replace="replace",e}({}),Da=function(e){return e.Loading="Loading",e.Loaded="Loaded",e.Failure="Failure",e.Cancelled="Cancelled",e}({}),nc=0,kn=1,yn=2;function Ls(e){e.forEach(function(r){r.isCurrent&&(r.isVisible=r.isLoaded)})}function qo(e){e.forEach(function(r){r.properties.state=nc}),e.forEach(function(r){r.isCurrent&&!Fa(r)&&Ns(r)}),e.forEach(function(r){r.isVisible=!!(r.properties.state&yn)})}function mu(e){e.forEach(function(t){t.properties.state=nc}),e.forEach(function(t){t.isCurrent&&Fa(t)});var r=e.slice().sort(function(t,n){return t.z-n.z});r.forEach(function(t){t.isVisible=!!(t.properties.state&yn),t.children.length&&(t.isVisible||t.properties.state&kn)?t.children.forEach(function(n){n.properties.state=kn}):t.isCurrent&&Ns(t)})}function Fa(e){for(;e;){if(e.isLoaded)return e.properties.state|=yn,!0;e=e.parent}return!1}function Ns(e){e.children.forEach(function(r){r.isLoaded?r.properties.state|=yn:Ns(r)})}var Ks,Fc=256,ra=[-1/0,-1/0,1/0,1/0],wo=.2,Ch=5,Pl=(Ks={},(0,B.Z)(Ks,bs.Realtime,Ls),(0,B.Z)(Ks,bs.Overlap,qo),(0,B.Z)(Ks,bs.Replace,mu),Ks),zf=function(){};function gu(e,r,t){var n=Math.floor((e+180)/360*Math.pow(2,t)),i=Math.floor((1-Math.log(Math.tan(r*Math.PI/180)+1/Math.cos(r*Math.PI/180))/Math.PI)/2*Math.pow(2,t));return[n,i]}function Es(e,r,t){var n=e/Math.pow(2,t)*360-180,i=Math.PI-2*Math.PI*r/Math.pow(2,t),o=180/Math.PI*Math.atan(.5*(Math.exp(i)-Math.exp(-i)));return[n,o]}var ic=function(r,t,n){var i=Es(r,t,n),o=(0,Sn.Z)(i,2),s=o[0],l=o[1],f=Es(r+1,t+1,n),v=(0,Sn.Z)(f,2),y=v[0],b=v[1];return[s,b,y,l]};function Nu(e){var r=e.zoom,t=e.latLonBounds,n=e.maxZoom,i=n===void 0?1/0:n,o=e.minZoom,s=o===void 0?0:o,l=e.zoomOffset,f=l===void 0?0:l,v=e.extent,y=v===void 0?ra:v,b=Math.ceil(r)+f;if(Number.isFinite(s)&&bi&&(b=i);for(var T=(0,Sn.Z)(t,4),M=T[0],O=T[1],F=T[2],$=T[3],G=[Math.max(M,y[0]),Math.max(O,y[1]),Math.min(F,y[2]),Math.min($,y[3])],ue=[],xe=gu(G[0],G[1],b),ze=(0,Sn.Z)(xe,2),Je=ze[0],ht=ze[1],gt=gu(G[2],G[3],b),Ot=(0,Sn.Z)(gt,2),tr=Ot[0],Ir=Ot[1],Er=Je;Er<=tr;Er++)for(var mn=Ir;mn<=ht;mn++)ue.push({x:Er,y:mn,z:b});var Ln=(tr+Je)/2,Fi=(ht+Ir)/2,xa=function(_s,as){return Math.abs(_s-Ln)+Math.abs(as-Fi)};return ue.sort(function(is,_s){return xa(is.x,is.y)-xa(_s.x,_s.y)}),ue}var Zf=function(r,t,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=Math.pow(2,n),s=o-1,l=o,f=r,v=t;return i&&(f<0?f=f+l:f>s&&(f=f%l)),{warpX:f,warpY:v}};function kc(e){var r=cf();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function cf(){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(e){return!1}}var Vf=function(e){(0,Le.Z)(t,e);var r=kc(t);function t(n){var i;(0,Q.Z)(this,t),i=r.call(this),(0,B.Z)((0,Fe.Z)(i),"tileSize",256),(0,B.Z)((0,Fe.Z)(i),"isVisible",!1),(0,B.Z)((0,Fe.Z)(i),"isCurrent",!1),(0,B.Z)((0,Fe.Z)(i),"isVisibleChange",!1),(0,B.Z)((0,Fe.Z)(i),"loadedLayers",0),(0,B.Z)((0,Fe.Z)(i),"isLayerLoaded",!1),(0,B.Z)((0,Fe.Z)(i),"isLoad",!1),(0,B.Z)((0,Fe.Z)(i),"isChildLoad",!1),(0,B.Z)((0,Fe.Z)(i),"parent",null),(0,B.Z)((0,Fe.Z)(i),"children",[]),(0,B.Z)((0,Fe.Z)(i),"data",null),(0,B.Z)((0,Fe.Z)(i),"properties",{}),(0,B.Z)((0,Fe.Z)(i),"loadDataId",0);var o=n.x,s=n.y,l=n.z,f=n.tileSize,v=n.warp,y=v===void 0?!0:v;return i.x=o,i.y=s,i.z=l,i.warp=y||!0,i.tileSize=f,i}return(0,j.Z)(t,[{key:"isLoading",get:function(){return this.loadStatus===Da.Loading}},{key:"isLoaded",get:function(){return this.loadStatus===Da.Loaded}},{key:"isFailure",get:function(){return this.loadStatus===Da.Failure}},{key:"setTileLayerLoaded",value:function(){this.isLayerLoaded=!0}},{key:"isCancelled",get:function(){return this.loadStatus===Da.Cancelled}},{key:"isDone",get:function(){return[Da.Loaded,Da.Cancelled,Da.Failure].includes(this.loadStatus)}},{key:"bounds",get:function(){return ic(this.x,this.y,this.z)}},{key:"bboxPolygon",get:function(){var i=(0,Sn.Z)(this.bounds,4),o=i[0],s=i[1],l=i[2],f=i[3],v=[(l-o)/2,(f-s)/2],y=Bo(this.bounds,{properties:{key:this.key,id:this.key,bbox:this.bounds,center:v,meta:` `.concat(this.key,` `)}});return y}},{key:"key",get:function(){var i="".concat(this.x,"_").concat(this.y,"_").concat(this.z);return i}},{key:"layerLoad",value:function(){this.loadedLayers++,this.emit("layerLoaded")}},{key:"loadData",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s){var l,f,v,y,b,T,M,O,F,$,G,ue,xe,ze,Je,ht,gt;return ge().wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return l=s.getData,f=s.onLoad,v=s.onError,this.loadDataId++,y=this.loadDataId,this.isLoading&&this.abortLoad(),this.abortController=new AbortController,this.loadStatus=Da.Loading,b=null,tr.prev=7,M=this.x,O=this.y,F=this.z,$=this.bounds,G=this.tileSize,ue=this.warp,xe=Zf(M,O,F,ue),ze=xe.warpX,Je=xe.warpY,ht=this.abortController.signal,gt={x:ze,y:Je,z:F,bounds:$,tileSize:G,signal:ht,warp:ue},tr.next=14,l(gt,this);case 14:b=tr.sent,tr.next=20;break;case 17:tr.prev=17,tr.t0=tr.catch(7),T=tr.t0;case 20:if(y===this.loadDataId){tr.next=22;break}return tr.abrupt("return");case 22:if(!(this.isCancelled&&!b)){tr.next=24;break}return tr.abrupt("return");case 24:if(!(T||!b)){tr.next=28;break}return this.loadStatus=Da.Failure,v(T,this),tr.abrupt("return");case 28:this.loadStatus=Da.Loaded,this.data=b,f(this);case 31:case"end":return tr.stop()}},o,this,[[7,17]])}));function i(o){return n.apply(this,arguments)}return i}()},{key:"reloadData",value:function(i){this.isLoading&&this.abortLoad(),this.loadData(i)}},{key:"abortLoad",value:function(){this.isLoaded||this.isCancelled||(this.loadStatus=Da.Cancelled,this.abortController.abort(),this.xhrCancel&&this.xhrCancel())}}]),t}(io.EventEmitter),ac=function(r,t){var n=pa(r),i=of(n,t),o=360*3-180,s=85.0511287798065,l=[Math.max(i[0][0],-o),Math.max(i[0][1],-s),Math.min(i[1][0],o),Math.min(i[1][1],s)];return l},oc=function(r,t){var n=pa(r),i=pa(t),o=il(n,i);return o};function Uu(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=zu(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}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 o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function zu(e,r){if(e){if(typeof e=="string")return tu(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return tu(e,r)}}function tu(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t=0&&b.x0;){var f=i.shift();f.abortLoad()}}},{key:"getTileByLngLat",value:function(i,o,s){var l=this.options.zoomOffset,f=Math.ceil(s)+l,v=gu(i,o,f),y=this.tiles.filter(function(b){return b.key==="".concat(v[0],"_").concat(v[1],"_").concat(f)});return y[0]}},{key:"getTileExtent",value:function(i,o){return this.getTileIndices(o,i)}},{key:"getTileByZXY",value:function(i,o,s){var l=this.tiles.filter(function(f){return f.key==="".concat(o,"_").concat(s,"_").concat(i)});return l[0]}},{key:"clear",value:function(){var i=Uu(this.cacheTiles.values()),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.isLoading?s.abortLoad():this.onTileUnload(s)}}catch(l){i.e(l)}finally{i.f()}this.lastViewStates=void 0,this.cacheTiles.clear(),this.currentTiles=[]}},{key:"destroy",value:function(){this.clear(),this.removeAllListeners()}},{key:"updateTileVisible",value:function(){var i=this.options.updateStrategy,o=new Map,s=Uu(this.cacheTiles.values()),l;try{for(s.s();!(l=s.n()).done;){var f=l.value;o.set(f.key,f.isVisible),f.isCurrent=!1,f.isVisible=!1}}catch(O){s.e(O)}finally{s.f()}var v=Uu(this.currentTiles),y;try{for(v.s();!(y=v.n()).done;){var b=y.value;b.isCurrent=!0,b.isVisible=!0}}catch(O){v.e(O)}finally{v.f()}var T=Array.from(this.cacheTiles.values());typeof i=="function"?i(T):Pl[i](T);var M=!1;Array.from(this.cacheTiles.values()).forEach(function(O){O.isVisible!==o.get(O.key)?(O.isVisibleChange=!0,M=!0):O.isVisibleChange=!1}),M&&this.emit(Dl.TileUpdate)}},{key:"getTileIndices",value:function(i,o){var s=this.options,l=s.tileSize,f=s.extent,v=s.zoomOffset,y=Math.floor(this.options.maxZoom),b=Math.ceil(this.options.minZoom),T=Nu({maxZoom:y,minZoom:b,zoomOffset:v,tileSize:l,zoom:i,latLonBounds:o,extent:f});return T}},{key:"getTileId",value:function(i,o,s){var l="".concat(i,",").concat(o,",").concat(s);return l}},{key:"loadFinished",value:function(){var i=!this.currentTiles.some(function(o){return!o.isDone});return i&&this.emit(Dl.TilesLoadFinished),i}},{key:"getTile",value:function(i,o,s){var l=this.getTileId(i,o,s),f=this.cacheTiles.get(l);return f}},{key:"createTile",value:function(i,o,s){var l=this.getTileId(i,o,s),f=new Vf({x:i,y:o,z:s,tileSize:this.options.tileSize,warp:this.options.warp});return this.cacheTiles.set(l,f),f.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError}),f}},{key:"resizeCacheTiles",value:function(){var i=Ch*this.currentTiles.length,o=this.cacheTiles.size>i;if(o){var s=Uu(this.cacheTiles),l;try{for(s.s();!(l=s.n()).done;){var f=(0,Sn.Z)(l.value,2),v=f[0],y=f[1];if(!y.isVisible&&!this.currentTiles.includes(y)&&(this.cacheTiles.delete(v),this.onTileUnload(y)),this.cacheTiles.size<=i)break}}catch(b){s.e(b)}finally{s.f()}}this.rebuildTileTree()}},{key:"rebuildTileTree",value:function(){var i=Uu(this.cacheTiles.values()),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.parent=null,s.children.length=0}}catch(b){i.e(b)}finally{i.f()}var l=Uu(this.cacheTiles.values()),f;try{for(l.s();!(f=l.n()).done;){var v=f.value,y=this.getNearestAncestor(v.x,v.y,v.z);v.parent=y,y!=null&&y.children&&y.children.push(v)}}catch(b){l.e(b)}finally{l.f()}}},{key:"getNearestAncestor",value:function(i,o,s){for(;s>this.options.minZoom;){i=Math.floor(i/2),o=Math.floor(o/2),s=s-1;var l=this.getTile(i,o,s);if(l)return l}return null}}]),t}(vu());function Rh(e){return/(?=.*{box})(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)}function Hf(e){var r=[],t=/\{([a-z])-([a-z])\}/.exec(e);if(t){var n=t[1].charCodeAt(0),i=t[2].charCodeAt(0),o;for(o=n;o<=i;++o)r.push(e.replace(t[0],String.fromCharCode(o)));return r}if(t=/\{(\d+)-(\d+)\}/.exec(e),t){for(var s=parseInt(t[2],10),l=parseInt(t[1],10);l<=s;l++)r.push(e.replace(t[0],l.toString()));return r}return r.push(e),r}function h(e,r){if(!e||!e.length)throw new Error("url is not allowed to be empty");var t=r.x,n=r.y,i=r.z,o=Hf(e),s=Math.abs(t+n)%o.length,l=pi(o[s])?"".concat(o[s],"/{z}/{x}/{y}"):o[s];return l.replace(/\{x\}/g,t.toString()).replace(/\{y\}/g,n.toString()).replace(/\{z\}/g,i.toString()).replace(/\{bbox\}/g,ic(t,n,i).join(",")).replace(/\{-y\}/g,(Math.pow(2,i)-n-1).toString())}function d(e,r){var t=r.x,n=r.y,i=r.z,o=r.layer,s=r.version,l=s===void 0?"1.0.0":s,f=r.style,v=f===void 0?"default":f,y=r.format,b=r.service,T=b===void 0?"WMTS":b,M=r.tileMatrixset,O="".concat(e,"&SERVICE=").concat(T,"&REQUEST=GetTile&VERSION=").concat(l,"&LAYER=").concat(o,"&STYLE=").concat(v,"&TILEMATRIXSET=").concat(M,"&FORMAT=").concat(y,"&TILECOL=").concat(t,"&TILEROW=").concat(n,"&TILEMATRIX=").concat(i);return O}function p(e,r){if(!e)throw new Error(r||"web worker helper assertion failed.")}var g={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,document:typeof document!="undefined"&&document},S=g.self||g.window||{},w=g.window||g.self||{},C=g.self||g.window||{},P=g.document||{},Z=typeof importScripts=="function",Y=typeof window!="undefined"&&typeof window.orientation!="undefined",pe=function(){function e(r,t){var n=this;this.name=r,this.workerThread=t,this.isRunning=!0,this.resolve=function(){},this.reject=function(){},this.result=new Promise(function(i,o){n.resolve=i,n.reject=o})}return e.prototype.postMessage=function(r,t){this.workerThread.postMessage({source:"Main thread",type:r,payload:t})},e.prototype.done=function(r){p(this.isRunning,"WorkerJob isRunning false."),this.isRunning=!1,this.resolve(r)},e.prototype.error=function(r){p(this.isRunning,"WorkerJob isRunning false."),this.isRunning=!1,this.reject(r)},e}(),_e=pe,ye=new Map;function Ue(e){p(e.source&&!e.url||!e.source&&e.url);var r=ye.get(e.source||e.url);return r||(e.url&&(r=ke(e.url),ye.set(e.url,r)),e.source&&(r=Ke(e.source),ye.set(e.source,r))),p(r),r}function ke(e){if(!e.startsWith("http"))return e;var r=Ie(e);return Ke(r)}function Ke(e){var r=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(r)}function Ie(e){return`try { importScripts('`+e+`'); } catch (error) { console.error(error); throw error; }`}function $e(e,r,t){r===void 0&&(r=!0);var n=t||new Set;if(e){if(vt(e))n.add(e);else if(vt(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(var i in e)$e(e[i],r,n)}}return t===void 0?Array.from(n):[]}function vt(e){return e?e instanceof ArrayBuffer||typeof MessagePort!="undefined"&&e instanceof MessagePort||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas:!1}var Rt=function(){},Jt=function(){function e(r){this.terminated=!1,this.loadableURL="";var t=r.name,n=r.source,i=r.url;p(n||i),this.name=t,this.source=n,this.url=i,this.onMessage=Rt,this.onError=function(o){return console.log(o)},this.worker=this.createBrowserWorker()}return e.isSupported=function(){return typeof Worker!="undefined"},e.prototype.destroy=function(){this.onMessage=Rt,this.onError=Rt,this.worker.terminate(),this.terminated=!0},Object.defineProperty(e.prototype,"isRunning",{get:function(){return!!this.onMessage},enumerable:!1,configurable:!0}),e.prototype.postMessage=function(r,t){t=t||$e(r),this.worker.postMessage(r,t)},e.prototype.getErrorFromErrorEvent=function(r){var t="Failed to load ";return t+="worker "+this.name+" from "+this.url+". ",r.message&&(t+=r.message+" in "),r.lineno&&(t+=":"+r.lineno+":"+r.colno),new Error(t)},e.prototype.createBrowserWorker=function(){var r=this;this.loadableURL=Ue({source:this.source,url:this.url});var t=new Worker(this.loadableURL,{name:this.name});return t.onmessage=function(n){n.data?r.onMessage(n.data):r.onError(new Error("No data received"))},t.onerror=function(n){r.onError(r.getErrorFromErrorEvent(n)),r.terminated=!0},t.onmessageerror=function(n){return console.error("worker "+r.name+", message error: "+n)},t},e}(),zt=Jt,ar=function(){return ar=Object.assign||function(e){for(var r,t=1,n=arguments.length;t0&&o[o.length-1])&&(v[0]===6||v[0]===2)){t=0;continue}if(v[0]===3&&(!o||v[1]>o[0]&&v[1]this.getMaxConcurrency();t?(r.destroy(),this.count--):this.idleQueue.push(r),this.isDestroyed||this.startQueuedJob()},e.prototype.getAvailableWorker=function(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")},Zn={maxConcurrency:3,maxMobileConcurrency:1,onDebug:function(){},reuseWorkers:!0},Wi=function(){function e(r){this.workerPools=new Map,this.props=Pn({},Zn),this.setProps(r),this.workerPools=new Map}return e.isSupported=function(){return zt.isSupported()},e.getWorkerFarm=function(r){return r===void 0&&(r={}),e.workerFarm=e.workerFarm||new e({}),e.workerFarm.setProps(r),e.workerFarm},e.prototype.destroy=function(){var r,t;try{for(var n=zn(this.workerPools.values()),i=n.next();!i.done;i=n.next()){var o=i.value;o.destroy()}}catch(s){r={error:s}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(r)throw r.error}}},e.prototype.setProps=function(r){var t,n;this.props=Pn(Pn({},this.props),r);try{for(var i=zn(this.workerPools.values()),o=i.next();!o.done;o=i.next()){var s=o.value;s.setProps(this.getWorkerPoolProps())}}catch(l){t={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.getWorkerPool=function(r){var t=r.name,n=r.source,i=r.url,o=this.workerPools.get(t);return o||(o=new un({name:t,source:n,url:i}),o.setProps(this.getWorkerPoolProps()),this.workerPools.set(t,o)),o},e.prototype.getWorkerPoolProps=function(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}},e}(),vn=null,ei=new Map,_i=function(){function e(){}return Object.defineProperty(e,"onmessage",{set:function(r){self.onmessage=function(t){if(qn(t)){var n=t.data,i=n.type,o=n.payload;r(i,o)}}},enumerable:!1,configurable:!0}),e.addEventListener=function(r){var t=ei.get(r);t||(t=function(n){if(qn(n)){var i=n.data,o=i.type,s=i.payload;r(o,s)}}),self.addEventListener("message",t)},e.removeEventListener=function(r){var t=ei.get(r);ei.delete(r),self.removeEventListener("message",t)},e.postMessage=function(r,t){if(self){var n={source:"Worker thread",type:r,payload:t},i=$e(t);self.postMessage(n,i)}},e}(),ri=null;function qn(e){var r=e.type,t=e.data;return r==="message"&&t&&typeof t.source=="string"&&t.source==="Main thread"}function di(e){return JSON.parse(Jn(e))}function Jn(e){var r=new Set;return JSON.stringify(e,function(t,n){if(typeof n=="object"&&n!==null){if(r.has(n))try{return JSON.parse(JSON.stringify(n))}catch(i){return}r.add(n)}return n})}function Kn(e){return""+e.name}function Co(e,r){r===void 0&&(r={});var t=r[e.id]||{},n=e.name+".worker.js",i=t.workerUrl;return r._workerType==="test"&&(i=e.module+"/dist/"+n),i||(i="https://unpkg.com/"+e.module+"/dist/"+n),assert(i),i}var Ua=function(e,r,t,n){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function l(y){try{v(n.next(y))}catch(b){s(b)}}function f(y){try{v(n.throw(y))}catch(b){s(b)}}function v(y){y.done?o(y.value):i(y.value).then(l,f)}v((n=n.apply(e,r||[])).next())})},Ro=function(e,r){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(v){return function(y){return f([v,y])}}function f(v){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=v[0]&2?i.return:v[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,v[1])).done)return o;switch(i=0,o&&(v=[v[0]&2,o.value]),v[0]){case 0:case 1:o=v;break;case 4:return t.label++,{value:v[1],done:!1};case 5:t.label++,i=v[1],v=[0];continue;case 7:v=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(v[0]===6||v[0]===2)){t=0;continue}if(v[0]===3&&(!o||v[1]>o[0]&&v[1]0){if(this._values.length>0)throw new Error("Illegal internal state");var t=this._settlers.shift();r instanceof Error?t.reject(r):t.resolve({value:r})}else this._values.push(r)},e.prototype.close=function(){for(;this._settlers.length>0;){var r=this._settlers.shift();r.resolve({done:!0})}this._closed=!0},e.prototype.next=function(){var r=this;if(this._values.length>0){var t=this._values.shift();return t instanceof Error?Promise.reject(t):Promise.resolve({done:!1,value:t})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise(function(n,i){r._settlers.push({resolve:n,reject:i})})},e}(),ls=null,Zu=function(e,r,t,n){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function l(y){try{v(n.next(y))}catch(b){s(b)}}function f(y){try{v(n.throw(y))}catch(b){s(b)}}function v(y){y.done?o(y.value):i(y.value).then(l,f)}v((n=n.apply(e,r||[])).next())})},cs=function(e,r){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(v){return function(y){return f([v,y])}}function f(v){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=v[0]&2?i.return:v[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,v[1])).done)return o;switch(i=0,o&&(v=[v[0]&2,o.value]),v[0]){case 0:case 1:o=v;break;case 4:return t.label++,{value:v[1],done:!1};case 5:t.label++,i=v[1],v=[0];continue;case 7:v=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(v[0]===6||v[0]===2)){t=0;continue}if(v[0]===3&&(!o||v[1]>o[0]&&v[1]0&&o[o.length-1])&&(v[0]===6||v[0]===2)){t=0;continue}if(v[0]===3&&(!o||v[1]>o[0]&&v[1]0&&arguments[0]!==void 0?arguments[0]:{};(0,Q.Z)(this,e),(0,B.Z)(this,"lastFlip",-1),(0,B.Z)(this,"miter",Or.al(0,0)),(0,B.Z)(this,"started",!1),(0,B.Z)(this,"dash",!1),(0,B.Z)(this,"totalDistance",0),(0,B.Z)(this,"currentIndex",0),this.join=r.join||"miter",this.cap=r.cap||"butt",this.miterLimit=r.miterLimit||10,this.thickness=r.thickness||1,this.dash=r.dash||!1,this.complex={positions:[],indices:[],normals:[],startIndex:0,indexes:[]}}return(0,j.Z)(e,[{key:"extrude_gaode2",value:function(t,n){var i=this.complex;if(t.length<=1)return i;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var o=t.length,s=i.startIndex,l=1;lthis.miterLimit&&(mn=!0)}mn?(M.push(this.normal[0],this.normal[1],0),M.push(Ir[0],Ir[1],0),T.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*Er,o[2]|0),this.complex.indexes.push(this.currentIndex),T.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness*Er,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,b.push.apply(b,(0,Kt.Z)(this.lastFlip!==-Er?[n,n+2,n+3]:[n+2,n+1,n+3])),b.push(n+2,n+3,n+4),sc(Wu,Ll),Or.JG(this.normal,Wu),M.push(this.normal[0],this.normal[1],0),T.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*Er,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,y+=3):(this.extrusions(T,M,o,Ir,tr,this.totalDistance),b.push.apply(b,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),Er=-1,Or.JG(this.normal,Ir),y+=2),this.lastFlip=Er}else{if(sc(this.normal,oo),O){var Je=Or.Ue(),ht=Or.Ue();Or.lu(ht,oo,this.normal),Or.IH(Je,oo,this.normal),M.push(ht[0],ht[1],0),M.push(Je[0],Je[1],0),T.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),T.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(T,M,o,this.normal,this.thickness,this.totalDistance);b.push.apply(b,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),y+=2}return y}},{key:"simpleSegment",value:function(t,n,i,o,s){var l=0,f=t.indices,v=t.positions,y=t.normals,b=Fo([o[0],o[1]]),T=Fo([i[0],i[1]]);hf(oo,b,T);var M=0;if(this.dash&&(M=this.lineSegmentDistance(b,T),this.totalDistance+=M),this.normal||(this.normal=Or.Ue(),sc(this.normal,oo)),this.started||(this.started=!0,this.extrusions(v,y,i,this.normal,this.thickness,this.totalDistance-M)),f.push(n+0,n+1,n+2),!s)sc(this.normal,oo),this.extrusions(v,y,o,this.normal,this.thickness,this.totalDistance),f.push.apply(f,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),l+=2;else{var O=Fo([s[0],s[1]]);Lc(b,O)&&Or.IH(O,b,Or.Fv(O,Or.$X(O,b,T))),hf(Ll,O,b);var F=Qo(_u,Or.Ue(),oo,Ll,this.thickness),$=(0,Sn.Z)(F,2),G=$[0],ue=$[1],xe=Or.AK(_u,this.normal)<0?-1:1;this.extrusions(v,y,o,ue,G,this.totalDistance),f.push.apply(f,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),xe=-1,Or.JG(this.normal,ue),l+=2,this.lastFlip=xe}return l}},{key:"segment",value:function(t,n,i,o,s){var l=0,f=t.indices,v=t.positions,y=t.normals,b=this.cap==="square",T=this.join==="bevel",M=Fo([o[0],o[1]]),O=Fo([i[0],i[1]]);hf(oo,M,O);var F=0;if(this.dash&&(F=this.lineSegmentDistance(M,O),this.totalDistance+=F),this.normal||(this.normal=Or.Ue(),sc(this.normal,oo)),!this.started)if(this.started=!0,b){var $=Or.Ue(),G=Or.Ue();Or.IH($,this.normal,oo),Or.IH(G,this.normal,oo),y.push(G[0],G[1],0),y.push($[0],$[1],0),v.push(i[0],i[1],i[2]|0,this.totalDistance-F,-this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),v.push(i[0],i[1],i[2]|0,this.totalDistance-F,this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(v,y,i,this.normal,this.thickness,this.totalDistance-F);if(f.push(n+0,n+1,n+2),s){var ze=Fo([s[0],s[1]]);Lc(M,ze)&&Or.IH(ze,M,Or.Fv(ze,Or.$X(ze,M,O))),hf(Ll,ze,M);var Je=Qo(_u,Or.Ue(),oo,Ll,this.thickness),ht=(0,Sn.Z)(Je,2),gt=ht[0],Ot=ht[1],tr=Or.AK(_u,this.normal)<0?-1:1,Ir=T;if(!Ir&&this.join==="miter"){var Er=gt;Er>this.miterLimit&&(Ir=!0)}Ir?(y.push(this.normal[0],this.normal[1],0),y.push(Ot[0],Ot[1],0),v.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*tr,o[2]|0),this.complex.indexes.push(this.currentIndex),v.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness*tr,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,f.push.apply(f,(0,Kt.Z)(this.lastFlip!==-tr?[n,n+2,n+3]:[n+2,n+1,n+3])),f.push(n+2,n+3,n+4),sc(Wu,Ll),Or.JG(this.normal,Wu),y.push(this.normal[0],this.normal[1],0),v.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*tr,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,l+=3):(this.extrusions(v,y,o,Ot,gt,this.totalDistance),f.push.apply(f,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),tr=-1,Or.JG(this.normal,Ot),l+=2),this.lastFlip=tr}else{if(sc(this.normal,oo),b){var ue=Or.Ue(),xe=Or.Ue();Or.lu(xe,oo,this.normal),Or.IH(ue,oo,this.normal),y.push(xe[0],xe[1],0),y.push(ue[0],ue[1],0),v.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),v.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(v,y,o,this.normal,this.thickness,this.totalDistance);f.push.apply(f,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),l+=2}return l}},{key:"extrusions",value:function(t,n,i,o,s,l){n.push(o[0],o[1],0),n.push(o[0],o[1],0),t.push(i[0],i[1],i[2]|0,l,-s,i[2]|0),this.complex.indexes.push(this.currentIndex),t.push(i[0],i[1],i[2]|0,l,s,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}},{key:"lineSegmentDistance",value:function(t,n){var i=n[0]-t[0],o=n[1]-t[1];return Math.sqrt(i*i+o*o)}}]),e}();function jp(e){var r=e.coordinates,t=e.originCoordinates,n=e.version,i=new Bv({dash:!0,join:"bevel"});if(n==="GAODE2.x"){var o=r;Array.isArray(o[0][0])||(o=[r]);var s=t;Array.isArray(s[0][0])||(s=[t]);for(var l=0;l0}).forEach(function(G,ue){var xe=ll(G[l]);hi(xe,function(ze){var Je=Sr(ze),ht=(0,V.Z)((0,V.Z)({},G),{},{_id:ue,coordinates:Je});f.push(ht)})}),{dataArray:f};for(var v=0;v>>0}function yf(e,r){return r===void 0?null:(0,cl.Z)(e.properties[r])*1==="number"?e.properties[r]*1:e.properties&&e.properties[r]?lc(e.properties[r]+"")%1000019:null}function pp(e,r){var t=[],n={};return e.features?(e.features=e.features.filter(function(i){var o=i.geometry;return i!=null&&o&&o.type&&o.coordinates&&o.coordinates.length>0}),e=ll(e),e.features.length===0?{dataArray:[],featureKeys:n}:(hi(e,function(i,o){var s=yf(i,r==null?void 0:r.featureId);s===null&&(s=o);var l=s,f=Sr(i),v=(0,V.Z)((0,V.Z)({},i.properties),{},{coordinates:f,_id:l});t.push(v)}),{dataArray:t,featureKeys:n})):(e.features=[],{dataArray:[]})}function Ph(e,r,t,n){for(var i=n,o=t-r>>1,s=t-r,l,f=e[r],v=e[r+1],y=e[t],b=e[t+1],T=r+3;Ti)l=T,i=M;else if(M===i){var O=Math.abs(T-o);On&&(l-r>3&&Ph(e,r,l,n),e[l+2]=i,t-l>3&&Ph(e,l,t,n))}function Wp(e,r,t,n,i,o){var s=i-t,l=o-n;if(s!==0||l!==0){var f=((e-t)*s+(r-n)*l)/(s*s+l*l);f>1?(t=i,n=o):f>0&&(t+=s*f,n+=l*f)}return s=e-t,l=r-n,s*s+l*l}function xf(e,r,t,n){var i={id:typeof e=="undefined"?null:e,type:r,geometry:t,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return fl(i),i}function fl(e){var r=e.geometry,t=e.type;if(t==="Point"||t==="MultiPoint"||t==="LineString")Nl(e,r);else if(t==="Polygon"||t==="MultiLineString")for(var n=0;n0&&(n?s+=(i*v-f*o)/2:s+=Math.sqrt(Math.pow(f-i,2)+Math.pow(v-o,2))),i=f,o=v}var y=r.length-3;r[2]=1,Ph(r,0,y,t),r[y+2]=1,r.size=Math.abs(s),r.start=0,r.end=r.size}function cc(e,r,t,n){for(var i=0;i1?1:t}function pl(e,r,t,n,i,o,s,l){if(t/=r,n/=r,o>=t&&s=n)return null;for(var f=[],v=0;v=t&&O=n)continue;var F=[];if(T==="Point"||T==="MultiPoint")bf(b,F,t,n,i);else if(T==="LineString")fc(b,F,t,n,i,!1,l.lineMetrics);else if(T==="MultiLineString")Ul(b,F,t,n,i,!1);else if(T==="Polygon")Ul(b,F,t,n,i,!0);else if(T==="MultiPolygon")for(var $=0;$=t&&s<=n&&(r.push(e[o]),r.push(e[o+1]),r.push(e[o+2]))}}function fc(e,r,t,n,i,o,s){for(var l=Xp(e),f=i===0?vp:Ts,v=e.start,y,b,T=0;Tt&&(b=f(l,M,O,$,G,t),s&&(l.start=v+y*b)):ue>n?xe=t&&(b=f(l,M,O,$,G,t),ze=!0),xe>n&&ue<=n&&(b=f(l,M,O,$,G,n),ze=!0),!o&&ze&&(s&&(l.end=v+y*b),r.push(l),l=Xp(e)),s&&(v+=y)}var Je=e.length-3;M=e[Je],O=e[Je+1],F=e[Je+2],ue=i===0?M:O,ue>=t&&ue<=n&&Gf(l,M,O,F),Je=l.length-3,o&&Je>=3&&(l[Je]!==l[0]||l[Je+1]!==l[1])&&Gf(l,l[0],l[1],l[2]),l.length&&r.push(l)}function Xp(e){var r=[];return r.size=e.size,r.start=e.start,r.end=e.end,r}function Ul(e,r,t,n,i,o){for(var s=0;ss.maxX&&(s.maxX=y),b>s.maxY&&(s.maxY=b)}return s}function Lv(e,r,t,n){var i=r.geometry,o=r.type,s=[];if(o==="Point"||o==="MultiPoint")for(var l=0;l0&&r.size<(i?s:n)){t.numPoints+=r.length/3;return}for(var l=[],f=0;fs)&&(t.numSimplified++,l.push(r[f]),l.push(r[f+1])),t.numPoints++;i&&Nd(l,o),e.push(l)}function Nd(e,r){for(var t=0,n=0,i=e.length,o=i-2;n0===r)for(n=0,i=e.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(r.promoteId&&r.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=kd(e,r);this.tiles={},this.tileCoords=[],t&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",r.indexMaxZoom,r.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=hs(n,r),n.length&&this.splitTile(n,0,0,0),t&&(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)))}Dh.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Dh.prototype.splitTile=function(e,r,t,n,i,o,s){for(var l=[e,r,t,n],f=this.options,v=f.debug;l.length;){n=l.pop(),t=l.pop(),r=l.pop(),e=l.pop();var y=1<1&&console.time("creation"),T=this.tiles[b]=Ld(e,r,t,n,f),this.tileCoords.push({z:r,x:t,y:n}),v)){v>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",r,t,n,T.numFeatures,T.numPoints,T.numSimplified),console.timeEnd("creation"));var M="z"+r;this.stats[M]=(this.stats[M]||0)+1,this.total++}if(T.source=e,i){if(r===f.maxZoom||r===i)continue;var O=1<1&&console.time("clipping");var F=.5*f.buffer/f.extent,$=.5-F,G=.5+F,ue=1+F,xe,ze,Je,ht,gt,Ot;xe=ze=Je=ht=null,gt=pl(e,y,t-F,t+G,0,T.minX,T.maxX,f),Ot=pl(e,y,t+$,t+ue,0,T.minX,T.maxX,f),e=null,gt&&(xe=pl(gt,y,n-F,n+G,1,T.minY,T.maxY,f),ze=pl(gt,y,n+$,n+ue,1,T.minY,T.maxY,f),gt=null),Ot&&(Je=pl(Ot,y,n-F,n+G,1,T.minY,T.maxY,f),ht=pl(Ot,y,n+$,n+ue,1,T.minY,T.maxY,f),Ot=null),v>1&&console.timeEnd("clipping"),l.push(xe||[],r+1,t*2,n*2),l.push(ze||[],r+1,t*2,n*2+1),l.push(Je||[],r+1,t*2+1,n*2),l.push(ht||[],r+1,t*2+1,n*2+1)}}},Dh.prototype.getTile=function(e,r,t){var n=this.options,i=n.extent,o=n.debug;if(e<0||e>24)return null;var s=1<1&&console.log("drilling down to z%d-%d-%d",e,r,t);for(var f=e,v=r,y=t,b;!b&&f>0;)f--,v=Math.floor(v/2),y=Math.floor(y/2),b=this.tiles[Jo(f,v,y)];return!b||!b.source?null:(o>1&&console.log("found parent tile z%d-%d-%d",f,v,y),o>1&&console.time("drilling down"),this.splitTile(b.source,f,v,y,e,r,t),o>1&&console.timeEnd("drilling down"),this.tiles[l]?$p(this.tiles[l],i):null)};function Jo(e,r,t){return((1<0)switch(n[0]){case"band":try{e[i]=r[n[1]][t]}catch(o){console.warn("Raster Data err!"),e[i]=0}break;default:zr(n,r,t)}})}function Tt(e){var r=(0,Sn.Z)(e,3),t=r[0],n=r[1],i=n===void 0?-1:n,o=r[2],s=o===void 0?-1:o;if(t===void 0)return console.warn("Express err!"),["+",0,0];var l=t.replace(/\s+/g,"");return[l,i,s]}function er(e){var r=Tt(e),t=r[0],n=r[1],i=r[2];return Array.isArray(n)&&(n=er(e[1])),Array.isArray(i)&&(i=er(e[2])),Gr(t,n,i)}var Fr={nd:{type:"operation",expression:["/",["-",["band",1],["band",0]],["+",["band",1],["band",0]]]},rgb:{type:"function",method:rn}};function rn(e,r){for(var t=e[0].rasterData,n=e[1].rasterData,i=e[2].rasterData,o=[],s=(r==null?void 0:r.countCut)||[2,98],l=(0,Sn.Z)(s,2),f=l[0],v=l[1],y=(r==null?void 0:r.RMinMax)||yr(t,f,v),b=(r==null?void 0:r.GMinMax)||yr(n,f,v),T=(r==null?void 0:r.BMinMax)||yr(i,f,v),M=0;M"),IRendererService:Symbol.for("IRendererService"),IShaderModuleService:Symbol.for("IShaderModuleService"),IIconService:Symbol.for("IIconService"),IFontService:Symbol.for("IFontService"),IInteractionService:Symbol.for("IInteractionService"),IPickingService:Symbol.for("IPickingService"),IControlService:Symbol.for("IControlService"),IStyleAttributeService:Symbol.for("IStyleAttributeService"),ILayer:Symbol.for("ILayer"),ILayerPlugin:Symbol.for("ILayerPlugin"),INormalPass:Symbol.for("INormalPass"),IPostProcessor:Symbol.for("IPostProcessor"),IPostProcessingPass:Symbol.for("IPostProcessingPass"),IFactoryPostProcessingPass:Symbol.for("Factory"),IFactoryNormalPass:Symbol.for("Factory"),IMultiPassRenderer:Symbol.for("IMultiPassRenderer"),SceneID:Symbol.for("SceneID"),MapConfig:Symbol.for("MapConfig")},Ci=L(45188),ln=L.n(Ci);function yi(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=si(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}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 o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function si(e,r){if(e){if(typeof e=="string")return Qn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Qn(e,r)}}function Qn(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);to&&(M=0,T++),l[F]={x:M,y:b+T*Vi,width:Vi,height:Vi,advance:G},M+=Vi}});var O=n+i*2;return{mapping:l,xOffset:M,yOffset:b+T*O,canvasHeight:fo(b+(T+1)*O)}}function Wo(e,r,t){var n=0,i=0,o=0,s=[],l={},f=yi(e),v;try{for(f.s();!(v=f.n()).done;){var y=v.value;if(!l[y.id]){var b=y.size;n+b+r>t&&(Pi(l,s,i),n=0,i=o+i+r,o=0,s=[]),s.push({icon:y,xOffset:n}),n=n+b+r,o=Math.max(o,b)}}}catch(M){f.e(M)}finally{f.f()}s.length>0&&Pi(l,s,i);var T=fo(o+i+r);return{mapping:l,canvasHeight:T}}function Pi(e,r,t){var n=yi(r),i;try{for(n.s();!(i=n.n()).done;){var o=i.value,s=o.icon,l=o.xOffset;e[s.id]=(0,V.Z)((0,V.Z)({},s),{},{x:l,y:t,image:s.image,width:s.width,height:s.height})}}catch(f){n.e(f)}finally{n.f()}}function fo(e){return Math.pow(2,Math.ceil(Math.log2(e)))}var Sa,yo;function xo(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Ja(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}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 o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function Ja(e,r){if(e){if(typeof e=="string")return Mo(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Mo(e,r)}}function Mo(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}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 o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function xn(e,r){if(e){if(typeof e=="string")return Tn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Tn(e,r)}}function Tn(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t-1&&this.controls.splice(n,1),t.remove(),this}},{key:"addControls",value:function(){var t=this;this.unAddControls.forEach(function(n){n.addTo(t.scene),t.controls.push(n)}),this.unAddControls=[]}},{key:"destroy",value:function(){var t=On(this.controls),n;try{for(t.s();!(n=t.n()).done;){var i=n.value;i.remove()}}catch(o){t.e(o)}finally{t.f()}this.controls=[],this.clearControlPos()}},{key:"initControlPos",value:function(){var t=this.controlCorners={},n="l7-",i=this.controlContainer=ta("div",n+"control-container",this.container);function o(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],f=l.map(function(v){return n+v}).join(" ");t[l.filter(function(v){return!["row","column"].includes(v)}).join("")]=ta("div",f,i)}function s(l){var f=l.replace(/^(top|bottom|left|right|center)/,"$1-").split("-");return[].concat((0,Kt.Z)(f),[$n[l]])}Object.values(xr).forEach(function(l){o(s(l))}),this.checkCornerOverlap()}},{key:"clearControlPos",value:function(){for(var t in this.controlCorners)this.controlCorners[t]&&Ii(this.controlCorners[t]);this.controlContainer&&Ii(this.controlContainer)}},{key:"checkCornerOverlap",value:function(){var t=this,n=window.MutationObserver;if(n)for(var i=function(){var f=s[o],v=f.match(/^(top|bottom)(left|right)$/);if(v){var y=(0,Sn.Z)(v,3),b=y[1],T=y[2],M=t.controlCorners["".concat(b).concat(T)],O=new n(function(F){var $=(0,Sn.Z)(F,1),G=$[0].target;M&&(M.style[b]=G.clientHeight+"px")});O.observe(t.controlCorners["".concat(T).concat(b)],{childList:!0,attributes:!0})}},o=0,s=Object.keys(this.controlCorners);o-1&&this.markerLayers.splice(n,1)}},{key:"addMarker",value:function(t){this.mapsService.map&&this.mapsService.getMarkerContainer()?(this.markers.push(t),t.addTo(this.scene)):this.unAddMarkers.push(t)}},{key:"addMarkers",value:function(){var t=this;this.unAddMarkers.forEach(function(n){n.addTo(t.scene),t.markers.push(n)}),this.unAddMarkers=[]}},{key:"addMarkerLayers",value:function(){var t=this;this.unAddMarkerLayers.forEach(function(n){t.markerLayers.push(n),n.addTo(t.scene)}),this.unAddMarkers=[]}},{key:"removeMarker",value:function(t){t.remove(),this.markers.indexOf(t);var n=this.markers.indexOf(t);n>-1&&this.markers.splice(n,1)}},{key:"removeAllMarkers",value:function(){this.destroy()}},{key:"init",value:function(t){this.scene=t,this.mapsService=t.get(ot.IMapService)}},{key:"destroy",value:function(){this.markers.forEach(function(t){t.remove()}),this.markers=[],this.markerLayers.forEach(function(t){t.destroy()}),this.markerLayers=[]}},{key:"removeMakerLayerMarker",value:function(t){t.destroy()}}]),e}())||Eo),mp,yu,Vd=(mp=(0,yt.b2)(),mp(yu=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"scene",void 0),(0,B.Z)(this,"mapsService",void 0),(0,B.Z)(this,"popups",[]),(0,B.Z)(this,"unAddPopups",[])}return(0,j.Z)(e,[{key:"isMarkerReady",get:function(){return this.mapsService.map&&this.mapsService.getMarkerContainer()}},{key:"removePopup",value:function(t){t!=null&&t.isOpen()&&t.remove();var n=this.popups.indexOf(t);n>-1&&this.popups.splice(n,1);var i=this.unAddPopups.indexOf(t);i>-1&&this.unAddPopups.splice(i,1)}},{key:"destroy",value:function(){this.popups.forEach(function(t){return t.remove()})}},{key:"addPopup",value:function(t){var n=this;t&&t.getOptions().autoClose&&[].concat((0,Kt.Z)(this.popups),(0,Kt.Z)(this.unAddPopups)).forEach(function(i){i.getOptions().autoClose&&n.removePopup(i)}),this.isMarkerReady?(t.addTo(this.scene),this.popups.push(t)):this.unAddPopups.push(t),t.on("close",function(){n.removePopup(t)})}},{key:"initPopup",value:function(){var t=this;this.unAddPopups.length&&this.unAddPopups.forEach(function(n){t.addPopup(n),t.unAddPopups=[]})}},{key:"init",value:function(t){this.scene=t,this.mapsService=t.get(ot.IMapService)}}]),e}())||yu),Zs=function(e){return e.normal="normal",e.additive="additive",e.subtractive="subtractive",e.min="min",e.max="max",e.none="none",e}({}),hc=function(e){return e.MULTIPLE="MULTIPLE",e.SINGLE="SINGLE",e}({}),Qp=function(e){return e.AND="and",e.OR="or",e}({}),ds=function(e){return e.INIT="init",e.UPDATE="update",e}({}),eg={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"},jd=eg,Yf,Hd,gp=oi.merge,tg={id:"map",logoPosition:"bottomleft",logoVisible:!0,antialias:!0,stencil:!0,preserveDrawingBuffer:!1,pickBufferScale:1,fitBoundsOptions:{animate:!1}},No={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:Qp.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},$a=(Yf=(0,yt.b2)(),Yf(Hd=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"sceneConfigCache",{}),(0,B.Z)(this,"layerConfigCache",{}),(0,B.Z)(this,"layerAttributeConfigCache",{})}return(0,j.Z)(e,[{key:"getSceneConfig",value:function(t){return this.sceneConfigCache[t]}},{key:"getSceneWarninfo",value:function(t){return jd[t]}},{key:"setSceneConfig",value:function(t,n){this.sceneConfigCache[t]=(0,V.Z)((0,V.Z)({},tg),n)}},{key:"getLayerConfig",value:function(t){return this.layerConfigCache[t]}},{key:"setLayerConfig",value:function(t,n,i){this.layerConfigCache[n]=(0,V.Z)({},gp({},this.sceneConfigCache[t],No,i))}},{key:"getAttributeConfig",value:function(t){return this.layerAttributeConfigCache[t]}},{key:"setAttributeConfig",value:function(t,n){this.layerAttributeConfigCache[t]=(0,V.Z)((0,V.Z)({},this.layerAttributeConfigCache[t]),n)}},{key:"clean",value:function(){this.sceneConfigCache={},this.layerConfigCache={}}}]),e}())||Hd);function Ni(e,r,t,n){t&&Object.defineProperty(e,r,{enumerable:t.enumerable,configurable:t.configurable,writable:t.writable,value:t.initializer?t.initializer.call(n):void 0})}function ki(e,r,t,n,i){var o={};return Object.keys(n).forEach(function(s){o[s]=n[s]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=t.slice().reverse().reduce(function(s,l){return l(e,r,s)||s},o),i&&o.initializer!==void 0&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),o.initializer===void 0&&(Object.defineProperty(e,r,o),o=null),o}var Fh=L(76126),Wd=Math.PI/180,rg=512,Gd=4003e4;function qf(e){var r=e.latitude,t=r===void 0?0:r,n=e.zoom,i=n===void 0?0:n,o=e.scale,s=e.highPrecision,l=s===void 0?!1:s,f=e.flipY,v=f===void 0?!1:f;o=o!==void 0?o:Math.pow(2,i);var y={},b=rg*o,T=Math.cos(t*Wd),M=b/360,O=M/T,F=b/Gd/T;if(y.pixelsPerMeter=[F,-F,F],y.metersPerPixel=[1/F,-1/F,1/F],y.pixelsPerDegree=[M,-O,F],y.degreesPerPixel=[1/M,-1/O,1/F],l){var $=Wd*Math.tan(t*Wd)/T,G=M*$/2,ue=b/Gd*$,xe=ue/O*F;y.pixelsPerDegree2=[0,-G,ue],y.pixelsPerMeter2=[xe,0,xe],v&&(y.pixelsPerDegree2[1]=-y.pixelsPerDegree2[1],y.pixelsPerMeter2[1]=-y.pixelsPerMeter2[1])}return v&&(y.pixelsPerMeter[1]=-y.pixelsPerMeter[1],y.metersPerPixel[1]=-y.metersPerPixel[1],y.pixelsPerDegree[1]=-y.pixelsPerDegree[1],y.degreesPerPixel[1]=-y.degreesPerPixel[1]),y}var zl=function(e){return e[e.LNGLAT=1]="LNGLAT",e[e.LNGLAT_OFFSET=2]="LNGLAT_OFFSET",e[e.VECTOR_TILE=3]="VECTOR_TILE",e[e.IDENTITY=4]="IDENTITY",e[e.P20=5]="P20",e[e.P20_OFFSET=6]="P20_OFFSET",e[e.METER_OFFSET=7]="METER_OFFSET",e[e.P20_2=8]="P20_2",e}({}),Kf={CoordinateSystem:"u_CoordinateSystem",ViewportCenter:"u_ViewportCenter",ViewportCenterProjection:"u_ViewportCenterProjection",PixelsPerDegree:"u_PixelsPerDegree",PixelsPerDegree2:"u_PixelsPerDegree2",PixelsPerMeter:"u_PixelsPerMeter",Mvp:"u_Mvp"},Po,_p,Vc,yp,Jp,Vv=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],xp=(Po=(0,yt.b2)(),_p=(0,yt.f3)(ot.ICameraService),Po(Vc=(yp=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"needRefresh",!0),Ni(this,"cameraService",Jp,this),(0,B.Z)(this,"coordinateSystem",void 0),(0,B.Z)(this,"viewportCenter",void 0),(0,B.Z)(this,"viewportCenterProjection",void 0),(0,B.Z)(this,"pixelsPerDegree",void 0),(0,B.Z)(this,"pixelsPerDegree2",void 0),(0,B.Z)(this,"pixelsPerMeter",void 0)}return(0,j.Z)(e,[{key:"refresh",value:function(t){var n=this.cameraService.getZoom(),i=this.cameraService.getZoomScale(),o=t||this.cameraService.getCenter(),s=qf({latitude:o[1],zoom:n}),l=s.pixelsPerMeter,f=s.pixelsPerDegree;this.viewportCenter=o,this.viewportCenterProjection=[0,0,0,0],this.pixelsPerMeter=l,this.pixelsPerDegree=f,this.pixelsPerDegree2=[0,0,0],this.coordinateSystem===zl.LNGLAT||this.coordinateSystem===zl.P20?this.cameraService.setViewProjectionMatrix(void 0):this.coordinateSystem===zl.LNGLAT_OFFSET?this.calculateLnglatOffset(o,n):this.coordinateSystem===zl.P20_OFFSET&&this.calculateLnglatOffset(o,n,i,!0),this.needRefresh=!1}},{key:"getCoordinateSystem",value:function(){return this.coordinateSystem}},{key:"setCoordinateSystem",value:function(t){this.coordinateSystem=t}},{key:"getViewportCenter",value:function(){return this.viewportCenter}},{key:"getViewportCenterProjection",value:function(){return this.viewportCenterProjection}},{key:"getPixelsPerDegree",value:function(){return this.pixelsPerDegree}},{key:"getPixelsPerDegree2",value:function(){return this.pixelsPerDegree2}},{key:"getPixelsPerMeter",value:function(){return this.pixelsPerMeter}},{key:"calculateLnglatOffset",value:function(t,n,i,o){var s=qf({latitude:t[1],zoom:n,scale:i,flipY:o,highPrecision:!0}),l=s.pixelsPerMeter,f=s.pixelsPerDegree,v=s.pixelsPerDegree2,y=this.cameraService.getViewMatrix(),b=this.cameraService.getProjectionMatrix(),T=me.multiply([],b,y),M=this.cameraService.projectFlat([Math.fround(t[0]),Math.fround(t[1])],Math.pow(2,n));this.viewportCenterProjection=Fh.fF([],[M[0],M[1],0,1],T),y=this.cameraService.getViewMatrixUncentered()||y,T=me.multiply([],b,y),T=me.multiply([],T,Vv),this.cameraService.setViewProjectionMatrix(T),this.pixelsPerMeter=l,this.pixelsPerDegree=f,this.pixelsPerDegree2=v}}]),e}(),Jp=ki(yp.prototype,"cameraService",[_p],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yp))||Vc),jc,jv;function ng(e){var r=E0();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function E0(){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(e){return!1}}var ts=(jc=(0,yt.b2)(),jc(jv=function(e){(0,Le.Z)(t,e);var r=ng(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;sO-1*wa||xe<0||ze>F-1*wa||ze<0)return!1;var Je=b({x:Math.floor(xe/r.pickBufferScale),y:Math.floor((F-(o+1)*wa)/r.pickBufferScale),width:1,height:1,data:new Uint8Array(1*1*4),framebuffer:r.pickingFBO});if(r.pickedColors=Je,Je[0]!==0||Je[1]!==0||Je[2]!==0){var ht=Oa(Je),gt=t.layerPickService.getFeatureById(ht);ht!==t.getCurrentPickId()&&l==="mousemove"&&(l="mouseenter");var Ot={x:i,y:o,type:l,lngLat:s,featureId:ht,feature:gt,target:f};gt&&(v=!0,t.setCurrentPickId(ht),r.triggerHoverOnLayer(t,Ot))}else{var tr={x:i,y:o,lngLat:s,type:t.getCurrentPickId()!==null&&l==="mousemove"?"mouseout":"un"+l,featureId:null,target:f,feature:null};r.triggerHoverOnLayer(t,(0,V.Z)((0,V.Z)({},tr),{},{type:"unpick"})),r.triggerHoverOnLayer(t,tr),t.setCurrentPickId(null)}if(G&&t.layerPickService.highlightPickedFeature(Je),ue&&l==="click"&&(Je==null?void 0:Je.toString())!==[0,0,0,0].toString()){var Ir=Oa(Je);t.getCurrentSelectedId()===null||Ir!==t.getCurrentSelectedId()?(t.layerPickService.selectFeature(Je),t.setCurrentSelectedId(Ir)):(t.layerPickService.selectFeature(new Uint8Array([0,0,0,0])),t.setCurrentSelectedId(null))}return v})}return(0,j.Z)(e,[{key:"init",value:function(t){var n=this.rendererService,i=n.createTexture2D,o=n.createFramebuffer,s=n.getContainer,l=this.getContainerSize(s()),f=l.width,v=l.height;f*=wa,v*=wa,this.pickBufferScale=this.configService.getSceneConfig(t).pickBufferScale||1,this.pickingFBO=o({color:i({width:Math.round(f/this.pickBufferScale),height:Math.round(v/this.pickBufferScale),wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE})}),this.interactionService.on(a.Hover,this.pickingAllLayer.bind(this))}},{key:"boxPickLayer",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i,o,s){var l=this,f,v,y;return ge().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:f=this.rendererService,v=f.useFramebuffer,y=f.clear,this.resizePickingFBO(),v(this.pickingFBO,function(){y({framebuffer:l.pickingFBO,color:[0,0,0,0],stencil:0,depth:1}),i.hooks.beforePickingEncode.call(),i.renderModels({ispick:!0}),i.hooks.afterPickingEncode.call();var M=l.pickBox(i,o);s(M)});case 3:case"end":return T.stop()}},n,this)}));function t(n,i,o){return r.apply(this,arguments)}return t}()},{key:"pickBox",value:function(t,n){var i=this,o=n.map(function(Ir){var Er=Ir<0?0:Ir;return Math.floor(Er*wa/i.pickBufferScale)}),s=(0,Sn.Z)(o,4),l=s[0],f=s[1],v=s[2],y=s[3],b=this.rendererService,T=b.readPixels,M=b.getContainer,O=this.getContainerSize(M()),F=O.width,$=O.height;if(F*=wa,$*=wa,l>(F-1)*wa/this.pickBufferScale||v<0||f>($-1)*wa/this.pickBufferScale||y<0)return[];for(var G=Math.min(F/this.pickBufferScale,v)-l,ue=Math.min($/this.pickBufferScale,y)-f,xe=T({x:l,y:Math.floor($/this.pickBufferScale-(y+1)),width:G,height:ue,data:new Uint8Array(G*ue*4),framebuffer:this.pickingFBO}),ze=[],Je={},ht=0;ht0&&arguments[0]!==void 0?arguments[0]:!0;(0,Q.Z)(this,e),(0,B.Z)(this,"autoStart",void 0),(0,B.Z)(this,"startTime",0),(0,B.Z)(this,"oldTime",0),(0,B.Z)(this,"running",!1),(0,B.Z)(this,"elapsedTime",0),this.autoStart=r}return(0,j.Z)(e,[{key:"start",value:function(){this.startTime=(typeof performance=="undefined"?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}},{key:"stop",value:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}},{key:"getElapsedTime",value:function(){return this.getDelta(),this.elapsedTime}},{key:"getDelta",value:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var n=(typeof performance=="undefined"?Date:performance).now();t=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=t}return t}}]),e}(),Ei,ti,Rn,Di,gi,Ui,jn,ia,za;function eo(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=uo(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}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 o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function uo(e,r){if(e){if(typeof e=="string")return Za(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Za(e,r)}}function Za(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t-1&&l.layerChildren.splice(f,1)):(v=this.layers.indexOf(s),v>-1&&this.layers.splice(v,1)),s.destroy(),this.reRender(),this.emit("layerChange",this.layers);case 4:case"end":return b.stop()}},o,this)}));function i(o,s){return n.apply(this,arguments)}return i}()},{key:"removeAllLayers",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:this.destroy(),this.reRender();case 2:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"setEnableRender",value:function(i){this.enableRender=i}},{key:"renderLayers",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b;return ge().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(!(this.alreadyInRendering||!this.enableRender)){M.next=2;break}return M.abrupt("return");case 2:this.updateLayerRenderList(),s=this.debugService.generateRenderUid(),this.debugService.renderStart(s),this.alreadyInRendering=!0,this.clear(),this.renderService.beginFrame(),l=eo(this.layerList),M.prev=9,l.s();case 11:if((f=l.n()).done){M.next=24;break}if(v=f.value,y=v.getLayerConfig(),b=y.enableMask,v.masks.filter(function(O){return O.inited}).length>0&&b&&this.renderMask(v.masks),!v.getLayerConfig().enableMultiPassRenderer){M.next=20;break}return M.next=18,v.renderMultiPass();case 18:M.next=22;break;case 20:return M.next=22,v.render();case 22:M.next=11;break;case 24:M.next=29;break;case 26:M.prev=26,M.t0=M.catch(9),l.e(M.t0);case 29:return M.prev=29,l.f(),M.finish(29);case 32:this.renderService.endFrame(),this.debugService.renderEnd(s),this.alreadyInRendering=!1;case 35:case"end":return M.stop()}},o,this,[[9,26,29,32]])}));function i(){return n.apply(this,arguments)}return i}()},{key:"renderMask",value:function(i){var o=0;this.renderService.clear({stencil:0,depth:1,framebuffer:null});var s=i.length>1?hc.MULTIPLE:hc.SINGLE,l=eo(i),f;try{for(l.s();!(f=l.n()).done;){var v=f.value;v.render({isStencil:!0,stencilType:s,stencilIndex:o++})}}catch(y){l.e(y)}finally{l.f()}}},{key:"beforeRenderData",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s){var l;return ge().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,s.hooks.beforeRenderData.promise();case 2:l=v.sent,l&&this.renderLayers();case 4:case"end":return v.stop()}},o,this)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"renderTileLayerMask",value:function(i){var o=0,s=i.getLayerConfig(),l=s.enableMask,f=l===void 0?!0:l,v=i.tileMask?1:0,y=i.masks.filter(function(F){return F.inited});v=v+(f?y.length:1);var b=v>1?hc.MULTIPLE:hc.SINGLE;if((i.tileMask||y.length&&f)&&this.renderService.clear({stencil:0,depth:1,framebuffer:null}),y.length&&f){var T=eo(y),M;try{for(T.s();!(M=T.n()).done;){var O=M.value;O.render({isStencil:!0,stencilType:b,stencilIndex:o++})}}catch(F){T.e(F)}finally{T.f()}}i.tileMask&&i.tileMask.render({isStencil:!0,stencilType:b,stencilIndex:o++,stencilOperation:Qp.OR})}},{key:"renderTileLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s){return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(this.renderTileLayerMask(s),!s.getLayerConfig().enableMultiPassRenderer){f.next=6;break}return f.next=4,s.renderMultiPass();case 4:f.next=8;break;case 6:return f.next=8,s.render();case 8:case"end":return f.stop()}},o,this)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"updateLayerRenderList",value:function(){var i=this;this.layerList=[],this.layers.filter(function(o){return o.inited}).filter(function(o){return o.isVisible()}).sort(function(o,s){return o.zIndex-s.zIndex}).forEach(function(o){i.layerList.push(o)})}},{key:"destroy",value:function(){this.layers.forEach(function(i){i.destroy()}),this.layers=[],this.layerList=[],this.emit("layerChange",this.layers)}},{key:"startAnimate",value:function(){this.animateInstanceCount++===0&&(this.clock.start(),this.runRender())}},{key:"stopAnimate",value:function(){--this.animateInstanceCount===0&&(this.stopRender(),this.clock.stop())}},{key:"getOESTextureFloat",value:function(){return this.renderService.extensionObject.OES_texture_float}},{key:"enableShaderPick",value:function(){this.shaderPicking=!0}},{key:"disableShaderPick",value:function(){this.shaderPicking=!1}},{key:"getShaderPickStat",value:function(){return this.shaderPicking}},{key:"clear",value:function(){var i=fi(this.mapService.bgColor);this.renderService.clear({color:i,depth:1,stencil:0,framebuffer:null})}},{key:"runRender",value:function(){this.renderLayers(),this.layerRenderID=window.requestAnimationFrame(this.runRender.bind(this))}},{key:"stopRender",value:function(){window.cancelAnimationFrame(this.layerRenderID)}}]),t}(io.EventEmitter),jn=ki(Ui.prototype,"renderService",[ti],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ia=ki(Ui.prototype,"mapService",[Rn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),za=ki(Ui.prototype,"debugService",[Di],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ui))||gi),ka=L(98787),js=oi.isNil,So=function(){function e(r){var t=this;(0,Q.Z)(this,e),(0,B.Z)(this,"name",void 0),(0,B.Z)(this,"type",void 0),(0,B.Z)(this,"scale",void 0),(0,B.Z)(this,"descriptor",void 0),(0,B.Z)(this,"featureBufferLayout",[]),(0,B.Z)(this,"needRescale",!1),(0,B.Z)(this,"needRemapping",!1),(0,B.Z)(this,"needRegenerateVertices",!1),(0,B.Z)(this,"featureRange",{startIndex:0,endIndex:1/0}),(0,B.Z)(this,"vertexAttribute",void 0),(0,B.Z)(this,"defaultCallback",function(n){if(n.length===0){var i;return((i=t.scale)===null||i===void 0?void 0:i.defaultValues)||[]}return n.map(function(o,s){var l,f=(l=t.scale)===null||l===void 0?void 0:l.scalers[s].func,v=f(o);return v})}),this.setProps(r)}return(0,j.Z)(e,[{key:"setProps",value:function(t){Object.assign(this,t)}},{key:"mapping",value:function(t){var n;if((n=this.scale)!==null&&n!==void 0&&n.callback){var i,o=(i=this.scale)===null||i===void 0?void 0:i.callback.apply(i,(0,Kt.Z)(t));if(!js(o))return[o]}return this.defaultCallback(t)}},{key:"resetDescriptor",value:function(){this.descriptor&&(this.descriptor.buffer.data=[])}}]),e}(),rs=["buffer","update","name"],ji=["buffer","update","name"],fa,va,$i,Hs,ns,Ba,Oo=(fa={},(0,B.Z)(fa,R.FLOAT,4),(0,B.Z)(fa,R.UNSIGNED_BYTE,1),(0,B.Z)(fa,R.UNSIGNED_SHORT,2),fa),ws=(va=(0,yt.b2)(),$i=(0,yt.f3)(ot.IRendererService),va(Hs=(ns=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"attributesAndIndices",void 0),Ni(this,"rendererService",Ba,this),(0,B.Z)(this,"attributes",[]),(0,B.Z)(this,"triangulation",void 0),(0,B.Z)(this,"featureLayout",{sizePerElement:0,elements:[]})}return(0,j.Z)(e,[{key:"registerStyleAttribute",value:function(t){var n=this.getLayerStyleAttribute(t.name||"");return n?n.setProps(t):(n=new So(t),this.attributes.push(n)),n}},{key:"unRegisterStyleAttribute",value:function(t){var n=this.attributes.findIndex(function(i){return i.name===t});n>-1&&this.attributes.splice(n,1)}},{key:"updateScaleAttribute",value:function(t){this.attributes.forEach(function(n){var i,o=n.name,s=(i=n.scale)===null||i===void 0?void 0:i.field;(t[o]||s&&t[s])&&(n.needRescale=!0,n.needRemapping=!0,n.needRegenerateVertices=!0)})}},{key:"updateStyleAttribute",value:function(t,n,i){var o=this.getLayerStyleAttribute(t);o||(o=this.registerStyleAttribute((0,V.Z)((0,V.Z)({},n),{},{name:t})));var s=n.scale;s&&o&&(o.scale=s,o.needRescale=!0,o.needRemapping=!0,o.needRegenerateVertices=!0,i&&i.featureRange&&(o.featureRange=i.featureRange))}},{key:"getLayerStyleAttributes",value:function(){return this.attributes}},{key:"getLayerStyleAttribute",value:function(t){return this.attributes.find(function(n){return n.name===t})}},{key:"getLayerAttributeScale",value:function(t){var n,i=this.getLayerStyleAttribute(t),o=i==null||(n=i.scale)===null||n===void 0?void 0:n.scalers;return o&&o[0]?o[0].func:null}},{key:"updateAttributeByFeatureRange",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,l=this.attributes.find(function(Je){return Je.name===t});if(l&&l.descriptor){var f=l.descriptor,v=f.update,y=f.buffer,b=f.size,T=b===void 0?0:b,M=Oo[y.type||R.FLOAT];if(v){var O=this.featureLayout,F=O.elements,$=O.sizePerElement,G=F.slice(i,o);if(!G.length)return;var ue=G[0].offset,xe=ue*T*M,ze=G.map(function(Je,ht){for(var gt=Je.featureIdx,Ot=Je.vertices,tr=Je.normals,Ir=Ot.length/$,Er=[],mn=0;mn0&&o[o.length-1])&&(v[0]===6||v[0]===2)){t=0;continue}if(v[0]===3&&(!o||v[1]>o[0]&&v[1]0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(s)throw s.error}}return o}function to(e,r,t){if(t||arguments.length===2)for(var n=0,i=r.length,o;n=0&&n.length%1===0}e.exports=r.default})(pc,pc.exports);var Cs={},dc={exports:{}},Jf={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){return function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];var o=n.pop();return t.call(this,n,o)}},e.exports=r.default})(Jf,Jf.exports);var vc={};Object.defineProperty(vc,"__esModule",{value:!0}),vc.fallback=td,vc.wrap=Hc;var Ep=vc.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,ed=vc.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,Xd=vc.hasNextTick=typeof Ki=="object"&&typeof Ki.nextTick=="function";function td(e){setTimeout(e,0)}function Hc(e){return function(r){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return e(function(){return r.apply(void 0,t)})}}var Sf;Ep?Sf=queueMicrotask:ed?Sf=setImmediate:Xd?Sf=Ki.nextTick:Sf=td,vc.default=Hc(Sf),function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=f;var t=Jf.exports,n=l(t),i=vc,o=l(i),s=Cs;function l(b){return b&&b.__esModule?b:{default:b}}function f(b){return(0,s.isAsync)(b)?function(){for(var T=[],M=arguments.length;M--;)T[M]=arguments[M];var O=T.pop(),F=b.apply(this,T);return v(F,O)}:(0,n.default)(function(T,M){var O;try{O=b.apply(this,T)}catch(F){return M(F)}if(O&&typeof O.then=="function")return v(O,M);M(null,O)})}function v(b,T){return b.then(function(M){y(T,null,M)},function(M){y(T,M&&M.message?M:new Error(M))})}function y(b,T,M){try{b(T,M)}catch(O){(0,o.default)(function(F){throw F},O)}}e.exports=r.default}(dc,dc.exports),Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.isAsyncIterable=Cs.isAsyncGenerator=Cs.isAsync=void 0;var Sp=dc.exports,eh=Ap(Sp);function Ap(e){return e&&e.__esModule?e:{default:e}}function rd(e){return e[Symbol.toStringTag]==="AsyncFunction"}function $d(e){return e[Symbol.toStringTag]==="AsyncGenerator"}function nd(e){return typeof e[Symbol.asyncIterator]=="function"}function id(e){if(typeof e!="function")throw new Error("expected a function");return rd(e)?(0,eh.default)(e):e}Cs.default=id,Cs.isAsync=rd,Cs.isAsyncGenerator=$d,Cs.isAsyncIterable=nd;var Wc={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=t;function t(n,i){if(i===void 0&&(i=n.length),!i)throw new Error("arity is undefined");function o(){for(var s=this,l=[],f=arguments.length;f--;)l[f]=arguments[f];return typeof l[i-1]=="function"?n.apply(this,l):new Promise(function(v,y){l[i-1]=function(b){for(var T=[],M=arguments.length-1;M-- >0;)T[M]=arguments[M+1];if(b)return y(b);v(T.length>1?T:T[0])},n.apply(s,l)})}return o}e.exports=r.default})(Wc,Wc.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t=pc.exports,n=f(t),i=Cs,o=f(i),s=Wc.exports,l=f(s);function f(v){return v&&v.__esModule?v:{default:v}}r.default=(0,l.default)(function(v,y,b){var T=(0,n.default)(y)?[]:{};v(y,function(M,O,F){(0,o.default)(M)(function($){for(var G,ue=[],xe=arguments.length-1;xe-- >0;)ue[xe]=arguments[xe+1];ue.length<2&&(G=ue,ue=G[0]),T[O]=ue,F($)})},function(M){return b(M,T)})},3),e.exports=r.default}(Ef,Ef.exports);var kh={exports:{}},th={exports:{}},Bh={exports:{}},rh={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=t;function t(n){function i(){for(var o=[],s=arguments.length;s--;)o[s]=arguments[s];if(n!==null){var l=n;n=null,l.apply(this,o)}}return Object.assign(i,n),i}e.exports=r.default})(rh,rh.exports);var nh={exports:{}},Tp={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()},e.exports=r.default})(Tp,Tp.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=y;var t=pc.exports,n=s(t),i=Tp.exports,o=s(i);function s(b){return b&&b.__esModule?b:{default:b}}function l(b){var T=-1,M=b.length;return function(){return++T=l||T||y||(T=!0,s.next().then(function(ue){var xe=ue.value,ze=ue.done;if(!(b||y)){if(T=!1,ze){y=!0,M<=0&&v(null);return}M++,f(xe,O,$),O++,F()}}).catch(G))}function $(ue,xe){if(M-=1,!b){if(ue)return G(ue);if(ue===!1){y=!0,b=!0;return}if(xe===n.default||y&&M<=0)return y=!0,v(null);F()}}function G(ue){b||(T=!1,y=!0,v(ue))}F()}e.exports=r.default}(Lh,Lh.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t=rh.exports,n=M(t),i=nh.exports,o=M(i),s=Gc.exports,l=M(s),f=Cs,v=Lh.exports,y=M(v),b=mc.exports,T=M(b);function M(O){return O&&O.__esModule?O:{default:O}}r.default=function(O){return function(F,$,G){if(G=(0,n.default)(G),O<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!F)return G(null);if((0,f.isAsyncGenerator)(F))return(0,y.default)(F,O,$,G);if((0,f.isAsyncIterable)(F))return(0,y.default)(F[Symbol.asyncIterator](),O,$,G);var ue=(0,o.default)(F),xe=!1,ze=!1,Je=0,ht=!1;function gt(tr,Ir){if(!ze)if(Je-=1,tr)xe=!0,G(tr);else if(tr===!1)xe=!0,ze=!0;else{if(Ir===T.default||xe&&Je<=0)return xe=!0,G(null);ht||Ot()}}function Ot(){for(ht=!0;Je0;)ue[xe]=arguments[xe+1];if(G!==!1){if(G||O===T.length)return M.apply(void 0,[G].concat(ue));F(ue)}}F([])}r.default=(0,v.default)(b),e.exports=r.default})(od,od.exports);var ig=Vl(od.exports),qd=function(){function e(){this.tasks=[]}return e.prototype.call=function(){return ig(this.tasks)},e.prototype.tap=function(r,t){this.tasks.length===0?this.tasks.push(function(n){var i=t();n(i?null:!1,i)}):this.tasks.push(function(n,i){var o=t.apply(void 0,to([],vl(n),!1));i(o?null:!1,r)})},e}(),po=function(){function e(){this.tasks=[]}return e.prototype.call=function(){return ih(this.tasks)},e.prototype.tap=function(r,t){this.tasks.push(function(n){var i=t();n(i,r)})},e}(),gc=function(){function e(){this.args=[],this.tasks=[]}return e.prototype.promise=function(){for(var r=arguments,t=[],n=0;n1&&arguments[1]!==void 0?arguments[1]:!1,t={};return e=e.replace(nv,function(n,i,o){var s=o.split(":"),l=s[0].trim(),f="";switch(s.length>1&&(f=s[1].trim()),i){case"bool":f=f==="true";break;case"float":case"int":f=Number(f);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":f?f=f.replace("[","").replace("]","").split(",").reduce(function(v,y){return v.push(Number(y.trim())),v},[]):f=new Array(ug(i)).fill(0);break;default:}return t[l]=f,"".concat(r?"uniform ":"").concat(i," ").concat(l,`; `)}),{content:e,uniforms:t}}function Vh(e){var r=am(e,!0),t=r.content,n=r.uniforms;return t=t.replace(/(\s*uniform\s*.*\s*){((?:\s*.*\s*)*?)};/g,function(i,o,s){s=s.trim().replace(/^.*$/gm,function(y){return"uniform ".concat(y)});var l=am(s),f=l.content,v=l.uniforms;return Object.assign(n,v),"".concat(o,`{ `).concat(f,` };`)}),{content:t,uniforms:n}}function om(e){var r={};return e.replace(nv,function(t,n,i){var o=i.trim();return r[o]?"":(r[o]=!0,"uniform ".concat(n," ").concat(o,`; `))})}var hd,lg,cg=oi.uniq,fg="#define PI 3.14159265359",T0=`#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 ); } `,hg=`layout(std140) uniform SceneUniforms { mat4 u_ViewMatrix; mat4 u_ProjectionMatrix; mat4 u_ViewProjectionMatrix; mat4 u_ModelMatrix; mat4 u_Mvp; 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; vec2 u_sceneCenterMercator; float u_FocalDistance; };`,pg=`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_EnableSelect; float u_activeMix; };`,w0=`#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; } `,C0=`// 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_spot_light(SpotLight light, vec3 normal, vec3 fragPos, vec3 viewDir) { // vec3 lightDir = normalize(light.position - fragPos); // // diffuse shading // float diff = max(dot(normal, lightDir), 0.0); // // specular shading // vec3 reflectDir = reflect(-lightDir, normal); // float spec = pow(max(dot(viewDir, reflectDir), 0.0), SHININESS); // // attenuation // float distance = length(light.position - fragPos); // float attenuation = 1.0 / (light.constant + light.linear * distance + // light.quadratic * (distance * distance)); // vec3 ambient = light.ambient * u_Ambient; // vec3 diffuse = light.diffuse * diff * u_Diffuse; // vec3 specular = light.specular * spec * u_Specular; // float spotEffect = dot(normalize(light.direction), -lightDir); // float spotCosCutoff = cos(light.angle / 180.0 * PI); // float spotCosOuterCutoff = cos((light.angle + light.blur) / 180.0 * PI); // float spotCosInnerCutoff = cos((light.angle - light.blur) / 180.0 * PI); // if (spotEffect > spotCosCutoff) { // spotEffect = pow(smoothstep(spotCosOuterCutoff, spotCosInnerCutoff, spotEffect), light.exponent); // } else { // spotEffect = 0.0; // } // return ambient + attenuation * (spotEffect * 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); } // for (int i = 0; i < MAX_NUM_OF_SPOT_LIGHTS; i++) { // if (i >= u_NumOfSpotLights) { // break; // } // weight += calc_spot_light(u_SpotLights[i], normal, position, viewDir); // } return weight; } `,R0=` 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 selected = v_PickingResult.a; bool selected = bool(v_PickingResult.a); // if (selected == SELECT) { if (selected) { // // \u70B9\u51FB\u9009\u4E2D\u72B6\u6001 // vec4 selectColor = u_SelectColor * COLOR_SCALE; // return selectColor; // } else if (selected == HIGHLIGHT) { // // hover \u9AD8\u4EAE\u72B6\u6001 vec4 highLightColor = u_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)); } } `,M0=`layout(location = 2) 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 v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && isVertexPicked(pickingColor)); // 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.; } `,$c=` #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); }`,pd=`#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); } } `,dg=`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; }`,dd=`/** * 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; } `,sm=/precision\s+(high|low|medium)p\s+float/,V_=`#ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; #else precision mediump float; #endif `,J2=/#pragma include (["^+"]?["[a-zA-Z_0-9](.*)"]*?)/g,eS=/void\s+main\s*\([^)]*\)\s*\{\n?/,WB=/}\n?[^{}]*$/,tS=(hd=(0,yt.b2)(),hd(lg=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"moduleCache",{}),(0,B.Z)(this,"rawContentCache",{})}return(0,j.Z)(e,[{key:"registerBuiltinModules",value:function(){this.destroy(),this.registerModule("common",{vs:fg,fs:fg}),this.registerModule("decode",{vs:T0,fs:""}),this.registerModule("scene_uniforms",{vs:hg,fs:hg}),this.registerModule("picking_uniforms",{vs:pg,fs:pg}),this.registerModule("projection",{vs:pd,fs:pd}),this.registerModule("project",{vs:$c,fs:""}),this.registerModule("sdf_2d",{vs:"",fs:dd}),this.registerModule("lighting",{vs:C0,fs:""}),this.registerModule("light",{vs:w0,fs:""}),this.registerModule("picking",{vs:M0,fs:R0}),this.registerModule("rotation_2d",{vs:dg,fs:""})}},{key:"registerModule",value:function(t,n){n.vs=n.vs.replace(/\r\n/g,` `),n.fs=n.fs.replace(/\r\n/g,` `);var i=n.vs,o=n.fs,s=n.uniforms,l=n.inject,f=Vh(i),v=f.content,y=f.uniforms,b=Vh(o),T=b.content,M=b.uniforms;this.rawContentCache[t]={fs:T,inject:l,uniforms:(0,V.Z)((0,V.Z)((0,V.Z)({},y),M),s),vs:v}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(t){var n=this,i=this.rawContentCache[t].vs,o=this.rawContentCache[t].fs,s=this.rawContentCache[t].inject,l={};s!=null&&s["vs:#decl"]&&(i=(s==null?void 0:s["vs:#decl"])+i,l=Vh(s==null?void 0:s["vs:#decl"]).uniforms),s!=null&&s["vs:#main-start"]&&(i=i.replace(eS,function(G){return G+(s==null?void 0:s["vs:#main-start"])})),s!=null&&s["fs:#decl"]&&(o=(s==null?void 0:s["fs:#decl"])+o);var f=this.processModule(i,[],"vs"),v=f.content,y=f.includeList,b=this.processModule(o,[],"fs"),T=b.content,M=b.includeList,O="",F=cg(y.concat(M).concat(t)).reduce(function(G,ue){return(0,V.Z)((0,V.Z)({},G),n.rawContentCache[ue].uniforms)},(0,V.Z)({},l));sm.test(T)||(O=O+V_),O=O+T;var $="";return sm.test(v)||($=$+V_),$=$+v,this.moduleCache[t]={fs:O.trim(),uniforms:F,vs:$.trim()},this.moduleCache[t]}},{key:"processModule",value:function(t,n,i){var o=this,s=t.replace(J2,function(l,f){var v=f.split(" "),y=v[0].replace(/"/g,"");if(n.indexOf(y)>-1)return"";var b=o.rawContentCache[y][i];n.push(y);var T=o.processModule(b,n,i),M=T.content;return M});return{content:s,includeList:n}}},{key:"injectDefines",value:function(t){var n=Object.keys(t).reduce(function(i,o){return i+"#define ".concat(o.toUpperCase()," ").concat(t[o],`; `)},` `);return n}}]),e}())||lg);function rS(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&(e=(0,Ee.Z)(e),e!==null););return e}function Ra(){return typeof Reflect!="undefined"&&Reflect.get?Ra=Reflect.get.bind():Ra=function(r,t,n){var i=rS(r,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(arguments.length<3?r:n):o.value}},Ra.apply(this,arguments)}var iv=function(e){return e.Normal="normal",e.PostProcessing="post-processing",e}({}),j_,H_,vg=(j_=(0,yt.b2)(),j_(H_=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"shaderModuleService",void 0),(0,B.Z)(this,"rendererService",void 0),(0,B.Z)(this,"cameraService",void 0),(0,B.Z)(this,"mapService",void 0),(0,B.Z)(this,"interactionService",void 0),(0,B.Z)(this,"layerService",void 0),(0,B.Z)(this,"config",void 0)}return(0,j.Z)(e,[{key:"getName",value:function(){return""}},{key:"getType",value:function(){return iv.Normal}},{key:"init",value:function(t,n){this.config=n,this.rendererService=t.getContainer().get(ot.IRendererService),this.cameraService=t.getContainer().get(ot.ICameraService),this.mapService=t.getContainer().get(ot.IMapService),this.interactionService=t.getContainer().get(ot.IInteractionService),this.layerService=t.getContainer().get(ot.ILayerService),this.shaderModuleService=t.getContainer().get(ot.IShaderModuleService)}},{key:"render",value:function(t){}}]),e}())||H_),W_,G_;function nS(e){var r=iS();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function iS(){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(e){return!1}}var aS=(W_=(0,yt.b2)(),W_(G_=function(e){(0,Le.Z)(t,e);var r=nS(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getName",value:function(){return"clear"}},{key:"init",value:function(i,o){Ra((0,Ee.Z)(t.prototype),"init",this).call(this,i,o)}},{key:"render",value:function(){this.rendererService.clear({color:[0,0,0,0],depth:1,framebuffer:null})}}]),t}(vg))||G_),X_,$_,Y_,I0,q_;function oS(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=sS(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}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 o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function sS(e,r){if(e){if(typeof e=="string")return K_(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return K_(e,r)}}function K_(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);tG||ht<0||gt>ue||gt<0)){var Ot;F(n.pickingFBO,function(){var tr;if(Ot=O({x:Math.round(ht),y:Math.round(ue-(v+1)*wa),width:1,height:1,data:new Uint8Array(1*1*4),framebuffer:n.pickingFBO}),Ot[0]!==0||Ot[1]!==0||Ot[2]!==0){var Ir=Oa(Ot),Er=n.layer.getSource().getFeatureById(Ir),mn={x:f,y:v,type:b,lngLat:y,featureId:Ir,feature:Er};Er&&(n.layer.setCurrentPickId(Ir),n.triggerHoverOnLayer(mn))}else{var Ln={x:f,y:v,lngLat:y,type:n.layer.getCurrentPickId()===null?"un"+b:"mouseout",featureId:null,feature:null};n.triggerHoverOnLayer((0,V.Z)((0,V.Z)({},Ln),{},{type:"unpick"})),n.triggerHoverOnLayer(Ln),n.layer.setCurrentPickId(null)}ze&&n.highlightPickedFeature(Ot),Je&&b==="click"&&((tr=Ot)===null||tr===void 0?void 0:tr.toString())!==[0,0,0,0].toString()&&n.selectFeature(Ot)})}}}),n}return(0,j.Z)(t,[{key:"getType",value:function(){return iv.Normal}},{key:"getName",value:function(){return"pixelPicking"}},{key:"init",value:function(i,o){Ra((0,Ee.Z)(t.prototype),"init",this).call(this,i,o),this.layer=i;var s=this.rendererService,l=s.createTexture2D,f=s.createFramebuffer,v=s.getViewportSize,y=v(),b=y.width,T=y.height;this.pickingFBO=f({color:l({width:b,height:T,wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE})}),this.interactionService.on(a.Hover,this.pickFromPickingFBO),this.interactionService.on(a.Select,this.selectFeatureHandle.bind(this)),this.interactionService.on(a.Active,this.highlightFeatureHandle.bind(this))}},{key:"render",value:function(i){var o=this;if(!this.alreadyInRendering){var s=this.rendererService,l=s.getViewportSize,f=s.useFramebuffer,v=s.clear,y=l(),b=y.width,T=y.height;this.alreadyInRendering=!0,(this.width!==b||this.height!==T)&&(this.pickingFBO.resize({width:b,height:T}),this.width=b,this.height=T),f(this.pickingFBO,function(){v({framebuffer:o.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});var M=o.layer.multiPassRenderer.getRenderFlag();o.layer.multiPassRenderer.setRenderFlag(!1),i.hooks.beforePickingEncode.call(),i.render(),i.hooks.afterPickingEncode.call(),o.layer.multiPassRenderer.setRenderFlag(M),o.alreadyInRendering=!1})}}},{key:"triggerHoverOnLayer",value:function(i){this.layer.emit(i.type,i)}},{key:"highlightPickedFeature",value:function(i){var o=(0,Sn.Z)(i,3),s=o[0],l=o[1],f=o[2];this.layer.hooks.beforeHighlight.call([s,l,f]),this.layerService.renderLayers()}},{key:"selectFeature",value:function(i){var o=(0,Sn.Z)(i,3),s=o[0],l=o[1],f=o[2];this.layer.hooks.beforeSelect.call([s,l,f]),this.layerService.renderLayers()}},{key:"selectFeatureHandle",value:function(i){var o=i.featureId,s=sa(o);this.selectFeature(new Uint8Array(s))}},{key:"highlightFeatureHandle",value:function(i){var o=i.featureId,s=sa(o);this.highlightPickedFeature(new Uint8Array(s))}}]),t}(vg))||J_),ey,ty,ry,P0,ny,hS=oi.camelCase,pS=oi.isNil,dS=oi.upperFirst,vS=`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.); }`,jh=(ey=(0,yt.b2)(),ty=(0,yt.f3)(ot.IShaderModuleService),ey(ry=(P0=function(){function e(){(0,Q.Z)(this,e),Ni(this,"shaderModuleService",ny,this),(0,B.Z)(this,"rendererService",void 0),(0,B.Z)(this,"config",void 0),(0,B.Z)(this,"quad",vS),(0,B.Z)(this,"enabled",!0),(0,B.Z)(this,"renderToScreen",!1),(0,B.Z)(this,"model",void 0),(0,B.Z)(this,"name",void 0),(0,B.Z)(this,"optionsToUpdate",{})}return(0,j.Z)(e,[{key:"getName",value:function(){return this.name}},{key:"setName",value:function(t){this.name=t}},{key:"getType",value:function(){return iv.PostProcessing}},{key:"init",value:function(t,n){this.config=n,this.rendererService=t.getContainer().get(ot.IRendererService),this.shaderModuleService=t.getContainer().get(ot.IShaderModuleService);var i=this.rendererService,o=i.createAttribute,s=i.createBuffer,l=i.createModel,f=this.setupShaders(),v=f.vs,y=f.fs,b=f.uniforms;this.model=l({vs:v,fs:y,attributes:{a_Position:o({buffer:s({data:[-4,-4,4,-4,0,4],type:R.FLOAT}),size:2})},uniforms:(0,V.Z)((0,V.Z)({u_Texture:null},b),this.config&&this.convertOptionsToUniforms(this.config)),depth:{enable:!1},count:3,blend:{enable:this.getName()==="copy"}})}},{key:"render",value:function(t,n){var i=this,o=t.multiPassRenderer.getPostProcessor(),s=this.rendererService,l=s.useFramebuffer,f=s.getViewportSize,v=s.clear,y=f(),b=y.width,T=y.height;l(this.renderToScreen?null:o.getWriteFBO(),function(){v({framebuffer:o.getWriteFBO(),color:[0,0,0,0],depth:1,stencil:0});var M=(0,V.Z)({u_BloomFinal:0,u_Texture:o.getReadFBO(),u_ViewportSize:[b,T]},i.convertOptionsToUniforms(i.optionsToUpdate));n&&(M.u_BloomFinal=1,M.u_Texture2=n),i.model.draw({uniforms:M})})}},{key:"isEnabled",value:function(){return this.enabled}},{key:"setEnabled",value:function(t){this.enabled=t}},{key:"setRenderToScreen",value:function(t){this.renderToScreen=t}},{key:"updateOptions",value:function(t){this.optionsToUpdate=(0,V.Z)((0,V.Z)({},this.optionsToUpdate),t)}},{key:"setupShaders",value:function(){throw new Error("Method not implemented.")}},{key:"convertOptionsToUniforms",value:function(t){var n={};return Object.keys(t).forEach(function(i){pS(t[i])||(n["u_".concat(dS(hS(i)))]=t[i])}),n}}]),e}(),ny=ki(P0.prototype,"shaderModuleService",[ty],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),P0))||ry),iy,ay;function mS(e){var r=gS();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function gS(){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(e){return!1}}var _S=`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; } }`,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.); }`,O0=oi.isNil,xS=(iy=(0,yt.b2)(),iy(ay=function(e){(0,Le.Z)(t,e);var r=mS(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("blur-pass",{vs:yS,fs:_S});var i=this.shaderModuleService.getModule("blur-pass"),o=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),v=f.width,y=f.height;return{vs:o,fs:s,uniforms:(0,V.Z)((0,V.Z)({},l),{},{u_ViewportSize:[v,y]})}}},{key:"convertOptionsToUniforms",value:function(i){var o={};return O0(i.bloomRadius)||(o.u_radius=i.bloomRadius),O0(i.bloomIntensity)||(o.u_intensity=i.bloomIntensity),O0(i.bloomBaseRadio)||(o.u_baseRadio=i.bloomBaseRadio),o}}]),t}(jh))||ay),oy,sy;function bS(e){var r=ES();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function ES(){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(e){return!1}}var SS=`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); }`,AS=`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.); }`,TS=oi.isNil,wS=(oy=(0,yt.b2)(),oy(sy=function(e){(0,Le.Z)(t,e);var r=bS(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("blur-pass",{vs:AS,fs:SS});var i=this.shaderModuleService.getModule("blur-pass"),o=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),v=f.width,y=f.height;return{vs:o,fs:s,uniforms:(0,V.Z)((0,V.Z)({},l),{},{u_ViewportSize:[v,y]})}}},{key:"convertOptionsToUniforms",value:function(i){var o={};return TS(i.blurRadius)||(o.u_BlurDir=[i.blurRadius,0]),o}}]),t}(jh))||sy),uy,ly;function CS(e){var r=RS();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function RS(){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(e){return!1}}var MS=`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); }`,IS=`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.); }`,PS=oi.isNil,OS=(uy=(0,yt.b2)(),uy(ly=function(e){(0,Le.Z)(t,e);var r=CS(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("blur-pass",{vs:IS,fs:MS});var i=this.shaderModuleService.getModule("blur-pass"),o=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),v=f.width,y=f.height;return{vs:o,fs:s,uniforms:(0,V.Z)((0,V.Z)({},l),{},{u_ViewportSize:[v,y]})}}},{key:"convertOptionsToUniforms",value:function(i){var o={};return PS(i.blurRadius)||(o.u_BlurDir=[0,i.blurRadius]),o}}]),t}(jh))||ly),cy,fy;function DS(e){var r=FS();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function FS(){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(e){return!1}}var kS=`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); }`,BS=`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.); }`,LS=(cy=(0,yt.b2)(),cy(fy=function(e){(0,Le.Z)(t,e);var r=DS(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("colorhalftone-pass",{vs:BS,fs:kS});var i=this.shaderModuleService.getModule("colorhalftone-pass"),o=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),v=f.width,y=f.height;return{vs:o,fs:s,uniforms:(0,V.Z)((0,V.Z)({},l),{},{u_ViewportSize:[v,y]})}}}]),t}(jh))||fy),hy,py;function NS(e){var r=US();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function US(){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(e){return!1}}var zS=`varying vec2 v_UV; uniform sampler2D u_Texture; void main() { gl_FragColor = vec4(texture2D(u_Texture, v_UV)); }`,ZS=`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.); }`,VS=(hy=(0,yt.b2)(),hy(py=function(e){(0,Le.Z)(t,e);var r=NS(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){return this.shaderModuleService.registerModule("copy-pass",{vs:ZS,fs:zS}),this.shaderModuleService.getModule("copy-pass")}}]),t}(jh))||py),dy,vy;function jS(e){var r=HS();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function HS(){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(e){return!1}}var WS=`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); }`,GS=`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.); }`,XS=(dy=(0,yt.b2)(),dy(vy=function(e){(0,Le.Z)(t,e);var r=jS(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("hexagonalpixelate-pass",{vs:GS,fs:WS});var i=this.shaderModuleService.getModule("hexagonalpixelate-pass"),o=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),v=f.width,y=f.height;return{vs:o,fs:s,uniforms:(0,V.Z)((0,V.Z)({},l),{},{u_ViewportSize:[v,y]})}}}]),t}(jh))||vy),gy,_y;function $S(e){var r=YS();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function YS(){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(e){return!1}}var qS=`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); }`,KS=`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.); }`,QS=(gy=(0,yt.b2)(),gy(_y=function(e){(0,Le.Z)(t,e);var r=$S(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("ink-pass",{vs:KS,fs:qS});var i=this.shaderModuleService.getModule("ink-pass"),o=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),v=f.width,y=f.height;return{vs:o,fs:s,uniforms:(0,V.Z)((0,V.Z)({},l),{},{u_ViewportSize:[v,y]})}}}]),t}(jh))||_y),yy,xy;function JS(e){var r=eA();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function eA(){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(e){return!1}}var tA=`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); }`,rA=`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.); }`,nA=(yy=(0,yt.b2)(),yy(xy=function(e){(0,Le.Z)(t,e);var r=JS(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){return this.shaderModuleService.registerModule("noise-pass",{vs:rA,fs:tA}),this.shaderModuleService.getModule("noise-pass")}}]),t}(jh))||xy),by,Ey;function iA(e){var r=aA();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function aA(){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(e){return!1}}var oA=`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.); }`,sA=`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); }`,uA=(by=(0,yt.b2)(),by(Ey=function(e){(0,Le.Z)(t,e);var r=iA(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){return this.shaderModuleService.registerModule("sepia-pass",{vs:oA,fs:sA}),this.shaderModuleService.getModule("sepia-pass")}}]),t}(jh))||Ey),Sy,Ay,Ty,wy,av,Cy,lA=(Sy=(0,yt.b2)(),Ay=(0,yt.f3)(ot.IRendererService),Ty=(0,yt.zY)(),Sy(wy=(av=function(){function e(){(0,Q.Z)(this,e),Ni(this,"rendererService",Cy,this),(0,B.Z)(this,"passes",[]),(0,B.Z)(this,"readFBO",void 0),(0,B.Z)(this,"writeFBO",void 0)}return(0,j.Z)(e,[{key:"getReadFBO",value:function(){return this.readFBO}},{key:"getWriteFBO",value:function(){return this.writeFBO}},{key:"getCurrentFBOTex",value:function(){var t=this.rendererService,n=t.getViewportSize,i=t.createTexture2D,o=n(),s=o.width,l=o.height;return i({x:0,y:0,width:s,height:l,copy:!0})}},{key:"getReadFBOTex",value:function(){var t=this,n=this.rendererService.useFramebuffer;return new Promise(function(i){n(t.readFBO,(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:i(t.getCurrentFBOTex());case 1:case"end":return l.stop()}},o)})))})}},{key:"renderBloomPass",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i,o){var s,l;return ge().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,this.getReadFBOTex();case 2:s=v.sent,l=0;case 4:if(!(l<4)){v.next=11;break}return v.next=7,o.render(i,s);case 7:this.swap(),l++,v.next=4;break;case 11:case"end":return v.stop()}},n,this)}));function t(n,i){return r.apply(this,arguments)}return t}()},{key:"render",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i){var o,s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:o=0;case 1:if(!(o0;)t=t+n*(i%r),i=Math.floor(i/r),n=n/r;return t}var gA=1,_A=(Iy=(0,yt.b2)(),Py=(0,yt.f3)(ot.IShaderModuleService),Iy(Oy=(D0=function(e){(0,Le.Z)(t,e);var r=pA(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s=1&&(v(this.copyRenderTarget,function(){o.outputModel.draw({uniforms:{u_Texture:o.outputRenderTarget}})}),v(i.multiPassRenderer.getPostProcessor().getReadFBO(),function(){o.copyModel.draw({uniforms:{u_Texture:o.copyRenderTarget}})}),i.multiPassRenderer.getPostProcessor().render(i));var ue=this.prevRenderTarget;this.prevRenderTarget=this.outputRenderTarget,this.outputRenderTarget=ue,this.frame++,this.cameraService.clearJitterProjectionMatrix()}},{key:"isFinished",value:function(){return this.frame>=this.haltonSequence.length}},{key:"resetFrame",value:function(){this.frame=0}},{key:"stopAccumulating",value:function(){this.accumulatingId=0,window.clearTimeout(this.timer)}},{key:"createTriangleModel",value:function(i,o,s){this.shaderModuleService.registerModule(i,{vs:mA,fs:o});var l=this.shaderModuleService.getModule(i),f=l.vs,v=l.fs,y=l.uniforms,b=this.rendererService,T=b.createAttribute,M=b.createBuffer,O=b.createModel;return O((0,V.Z)({vs:f,fs:v,attributes:{a_Position:T({buffer:M({data:[-4,-4,4,-4,0,4],type:R.FLOAT}),size:2})},uniforms:(0,V.Z)({},y),depth:{enable:!1},count:3},s))}}]),t}(vg),Dy=ki(D0.prototype,"shaderModuleService",[Py],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),D0))||Oy),um=new yt.W2;um.bind(ot.IGlobalConfigService).to($a).inSingletonScope(),(0,yt.GW)((0,yt.b2)(),io.EventEmitter),um.bind(ot.IEventEmitter).to(io.EventEmitter);var By=(0,vr.Z)(um,!1),F0=function(r){var t=By.lazyInject(r);return function(n,i,o){t.call(this,n,i),o&&(o.initializer=function(){return n[i]})}},GB=function(r){var t=By.lazyMultiInject(r);return function(n,i,o){t.call(this,n,i),o&&(o.initializer=function(){return n[i]})}},jl=um,yA=0;function xA(){var e=new yt.W2;return e.parent=um,e.bind(ot.SceneID).toConstantValue("".concat(yA++)),e.bind(ot.IShaderModuleService).to(tS).inSingletonScope(),e.bind(ot.ILayerService).to(Vs).inSingletonScope(),e.bind(ot.IDebugService).to(ts).inSingletonScope(),e.bind(ot.ISceneService).to(sg).inSingletonScope(),e.bind(ot.ICameraService).to(ur).inSingletonScope(),e.bind(ot.ICoordinateSystemService).to(xp).inSingletonScope(),e.bind(ot.IInteractionService).to(N).inSingletonScope(),e.bind(ot.IPickingService).to(Vn).inSingletonScope(),e.bind(ot.IControlService).to(ii).inSingletonScope(),e.bind(ot.IMarkerService).to(dl).inSingletonScope(),e.bind(ot.IIconService).to(st).inSingletonScope(),e.bind(ot.IFontService).to(Te).inSingletonScope(),e.bind(ot.IPopupService).to(Vd).inSingletonScope(),e.bind(ot.INormalPass).to(aS).whenTargetNamed("clear"),e.bind(ot.INormalPass).to(fS).whenTargetNamed("pixelPicking"),e.bind(ot.INormalPass).to(hA).whenTargetNamed("render"),e.bind(ot.INormalPass).to(_A).whenTargetNamed("taa"),e.bind(ot.IFactoryNormalPass).toFactory(function(r){return function(t){return r.container.getNamed(ot.INormalPass,t)}}),e.bind(ot.IPostProcessingPass).to(VS).whenTargetNamed("copy"),e.bind(ot.IPostProcessingPass).to(xS).whenTargetNamed("bloom"),e.bind(ot.IPostProcessingPass).to(wS).whenTargetNamed("blurH"),e.bind(ot.IPostProcessingPass).to(OS).whenTargetNamed("blurV"),e.bind(ot.IPostProcessingPass).to(nA).whenTargetNamed("noise"),e.bind(ot.IPostProcessingPass).to(uA).whenTargetNamed("sepia"),e.bind(ot.IPostProcessingPass).to(LS).whenTargetNamed("colorHalftone"),e.bind(ot.IPostProcessingPass).to(XS).whenTargetNamed("hexagonalPixelate"),e.bind(ot.IPostProcessingPass).to(QS).whenTargetNamed("ink"),e.bind(ot.IFactoryPostProcessingPass).toFactory(function(r){return function(t){var n=r.container.getNamed(ot.IPostProcessingPass,t);return n.setName(t),n}}),e}function lm(e){var r=new yt.W2;return r.parent=e,r.bind(ot.IStyleAttributeService).to(ws).inSingletonScope(),r.bind(ot.IMultiPassRenderer).to(uS).inSingletonScope(),r.bind(ot.IPostProcessor).to(lA).inSingletonScope(),r}var bA=null;function XB(e){return bA.indexOf(e)}var Ly=oi.clamp,EA=2,$B=4,SA=64,YB=128,AA=256,TA=512,qB=8192,KB=16384,QB=32768,wA=null,Ny=131072,JB=262144,CA=524288,eL=1048576,RA=2097152,tL=4194304,MA=8388608,IA=16777216,PA=null;function mg(e,r){return e=Ly(Math.floor(e),0,255),r=Ly(Math.floor(r),0,255),256*e+r}function rL(e){var r=e.color,t=e.radius,n=e.tileX,i=e.tileY,o=e.shape,s=e.opacity,l=e.stroke,f=e.strokeWidth,v=e.strokeOpacity,y=[],b=[],T=[],M=[mg(r[0],r[1]),mg(r[2],r[3])],O=[mg(l[0],l[1]),mg(l[2],l[3])];return[[-1,-1],[1,-1],[1,1],[-1,1]].forEach(function(F){var $=_slicedToArray(F,2),G=$[0],ue=$[1];y.push([].concat(M,[(G+1)*MA+(ue+1)*RA+getShapeIndex(o)*Ny+t,(n+512)*CA+(i+512)*SA])),b.push([].concat(O,[f,v])),T.push([s,0,0,0])}),{packedBuffer:y,packedBuffer2:b,packedBuffer3:T}}function nL(e,r){if(e===0&&!r)return 0;if(e===1&&r)return 4294967295;var t=r?1:0,n=Math.floor(e*127);return n*PA+t*IA+n*Ny+t*wA+n*TA+t*AA+n*EA+t}var vd={ProjectionMatrix:"u_ProjectionMatrix",ViewMatrix:"u_ViewMatrix",ViewProjectionMatrix:"u_ViewProjectionMatrix",Zoom:"u_Zoom",ZoomScale:"u_ZoomScale",FocalDistance:"u_FocalDistance",CameraPosition:"u_CameraPosition"},Rs={MapInitStart:"mapInitStart",LayerInitStart:"layerInitStart",LayerInitEnd:"layerInitEnd",SourceInitStart:"sourceInitStart",SourceInitEnd:"sourceInitEnd",ScaleInitStart:"scaleInitStart",ScaleInitEnd:"scaleInitEnd",MappingStart:"mappingStart",MappingEnd:"mappingEnd",BuildModelStart:"buildModelStart",BuildModelEnd:"buildModelEnd"},ro=function(e){return e.LINEAR="linear",e.SEQUENTIAL="sequential",e.POWER="power",e.LOG="log",e.IDENTITY="identity",e.TIME="time",e.QUANTILE="quantile",e.QUANTIZE="quantize",e.THRESHOLD="threshold",e.CAT="cat",e.DIVERGING="diverging",e}({}),ov=function(e){return e.CONSTANT="constant",e.VARIABLE="variable",e}({}),dn=function(e){return e[e.Attribute=0]="Attribute",e[e.InstancedAttribute=1]="InstancedAttribute",e[e.Uniform=2]="Uniform",e}({}),OA=["mapload","mapchange","mapAfterFrameChange"],gg=["loaded","fontloaded","maploaded","resize","destroy","dragstart","dragging","dragend","dragcancel"],Eu=function(e){return e.IMAGE="image",e.CUSTOMIMAGE="customImage",e.ARRAYBUFFER="arraybuffer",e.RGB="rgb",e.TERRAINRGB="terrainRGB",e.CUSTOMRGB="customRGB",e.CUSTOMARRAYBUFFER="customArrayBuffer",e.CUSTOMTERRAINRGB="customTerrainRGB",e}({}),DA=function(){var e=(0,Pt.Z)(ge().mark(function r(t,n,i,o){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",new Promise(function(f,v){n({x:t.x,y:t.y,z:t.z},function(y,b){if(y||b.length===0){v(y);return}b&&$r([{data:b,bands:[0]}],i,o,function(T,M){T?v(T):M&&f(M)})})}));case 1:case"end":return l.stop()}},r)}));return function(t,n,i,o){return e.apply(this,arguments)}}(),FA=function(){var e=(0,Pt.Z)(ge().mark(function r(t,n){return ge().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",new Promise(function(s,l){n({x:t.x,y:t.y,z:t.z},function(f,v){if(f||!v){l(f);return}v instanceof ArrayBuffer?cu(v,function(y,b){y&&l(y),s(b)}):v instanceof HTMLImageElement?s(v):l(f)})}));case 1:case"end":return o.stop()}},r)}));return function(t,n){return e.apply(this,arguments)}}();function kA(e,r){return Array.isArray(e)?typeof e[0]=="string"?e.map(function(t){return h(t,r)}):e.map(function(t){return{url:h(t.url,r),bands:t.bands||[0]}}):h(e,r)}function BA(e){return typeof e=="string"?[{url:e,bands:[0]}]:typeof e[0]=="string"?e.map(function(r){return{url:r,bands:[0]}}):e}function Uy(e,r){e.xhrCancel=function(){r.map(function(t){t.abort()})}}var LA=function(){var e=(0,Pt.Z)(ge().mark(function r(t,n,i,o,s){var l,f,v,y,b,T;return ge().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:if(l=BA(n.url),!(l.length>1)){O.next=15;break}return O.next=4,NA(l,n);case 4:if(f=O.sent,v=f.rasterFiles,y=f.xhrList,b=f.errList,Uy(t,y),!(b.length>0)){O.next=12;break}return i(b,null),O.abrupt("return");case 12:$r(v,o,s,i),O.next=17;break;case 15:T=Ai(n,function(F,$){if(F)i(F);else if($){var G=[{data:$,bands:l[0].bands}];$r(G,o,s,i)}}),Uy(t,[T]);case 17:case"end":return O.stop()}},r)}));return function(t,n,i,o,s){return e.apply(this,arguments)}}();function NA(e,r){return k0.apply(this,arguments)}function k0(){return k0=(0,Pt.Z)(ge().mark(function e(r,t){var n,i,o,s,l,f,v,y,b,T,M;return ge().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:n=[],i=[],o=[],s=0;case 4:if(!(s1&&arguments[1]!==void 0?arguments[1]:{};if(ZA(e))throw new Error("tile server url is error");var t=(r==null?void 0:r.dataType)||Eu.IMAGE;t===Eu.RGB&&(t=Eu.ARRAYBUFFER);var n=function(s,l){switch(t){case Eu.IMAGE:return zy(e,s,l,r);case Eu.CUSTOMIMAGE:case Eu.CUSTOMTERRAINRGB:return FA(l,r==null?void 0:r.getCustomData);case Eu.ARRAYBUFFER:return UA(e,s,l,(r==null?void 0:r.format)||Zy,r==null?void 0:r.operation);case Eu.CUSTOMARRAYBUFFER:case Eu.CUSTOMRGB:return DA(l,r==null?void 0:r.getCustomData,(r==null?void 0:r.format)||Zy,r==null?void 0:r.operation);default:return zy(e,s,l,r)}},i=(0,V.Z)((0,V.Z)((0,V.Z)({},zA),r),{},{getTileData:n});return{data:e,dataArray:[],tilesetOptions:i,isTile:!0}}var jA=["extent","min","max","width","height","format","operation"];function HA(e,r){var t=r.extent,n=r.min,i=r.max,o=r.width,s=r.height,l=r.format,f=r.operation,v=(0,ka.Z)(r,jA),y;if(l===void 0||gf(e))y=Array.from(e);else{var b=Array.isArray(e)?e:[e];y=an(b,l,f)}var T={_id:1,dataArray:[(0,V.Z)((0,V.Z)({_id:1,data:y,width:o,height:s},v),{},{min:n,max:i,coordinates:[[t[0],t[1]],[t[2],t[3]]]})]};return T}var WA={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0},GA=function(){var e=(0,Pt.Z)(ge().mark(function r(t){return ge().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o){var s=(0,Sn.Z)(t.bounds,4),l=s[0],f=s[1],v=s[2],y=s[3],b={layers:{testTile:{features:[{type:"Feature",properties:{key:t.x+"/"+t.y+"/"+t.z,x:(l+v)/2,y:(f+y)/2},geometry:{type:"LineString",coordinates:[[v,y],[v,f],[l,f],[l,f]]}}]}}};o(b)}));case 1:case"end":return i.stop()}},r)}));return function(t){return e.apply(this,arguments)}}();function XA(e,r){var t=function(o){return GA(o)},n=(0,V.Z)((0,V.Z)((0,V.Z)({},WA),r),{},{getTileData:t});return{data:e,dataArray:[],tilesetOptions:n,isTile:!0}}var $A=L(39720),YA=L.n($A);function Vy(e,r){var t=r.radius,n=t===void 0?40:t,i=r.maxZoom,o=i===void 0?18:i,s=r.minZoom,l=s===void 0?0:s,f=r.zoom,v=f===void 0?2:f;if(e.pointIndex){var y=e.pointIndex.getClusters(e.extent,Math.floor(v));return e.dataArray=qA(y),e}var b=new(YA())({radius:n,minZoom:l,maxZoom:o}),T={type:"FeatureCollection",features:[]};return T.features=e.dataArray.map(function(M){return{type:"Feature",geometry:{type:"Point",coordinates:M.coordinates},properties:(0,V.Z)({},M)}}),b.load(T.features),b}function qA(e){return e.map(function(r,t){return(0,V.Z)({coordinates:r.geometry.coordinates,_id:t+1},r.properties)})}function KA(e){if(e.length===0)throw new Error("max requires at least one data point");for(var r=e[0],t=1;tr&&(r=e[t]);return r}function QA(e){if(e.length===0)throw new Error("min requires at least one data point");for(var r=e[0],t=1;t=Math.abs(e[i])?t+=r-n+e[i]:t+=e[i]-n+r,r=n;return r+t*1}function JA(e){if(e.length===0)throw new Error("mean requires at least one data point");return jy(e)/e.length}var eT={min:QA,max:KA,mean:JA,sum:jy};function tT(e){var r=rT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function rT(){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(e){return!1}}var nT=oi.cloneDeep,Hy=oi.isFunction,iT=oi.isString,aT=oi.mergeWith;function oT(e,r){if(Array.isArray(r))return r}var sT=function(e){(0,Le.Z)(t,e);var r=tT(t);function t(n,i){var o;return(0,Q.Z)(this,t),o=r.call(this),(0,B.Z)((0,Fe.Z)(o),"type","source"),(0,B.Z)((0,Fe.Z)(o),"isTile",!1),(0,B.Z)((0,Fe.Z)(o),"inited",!1),(0,B.Z)((0,Fe.Z)(o),"hooks",{init:new xu}),(0,B.Z)((0,Fe.Z)(o),"parser",{type:"geojson"}),(0,B.Z)((0,Fe.Z)(o),"transforms",[]),(0,B.Z)((0,Fe.Z)(o),"cluster",!1),(0,B.Z)((0,Fe.Z)(o),"clusterOptions",{enable:!1,radius:40,maxZoom:20,zoom:-99,method:"count"}),(0,B.Z)((0,Fe.Z)(o),"invalidExtent",!1),(0,B.Z)((0,Fe.Z)(o),"dataArrayChanged",!1),(0,B.Z)((0,Fe.Z)(o),"cfg",{autoRender:!0}),o.originData=n,o.initCfg(i),o.init().then(function(){o.inited=!0,o.emit("update",{type:"inited"})}),o}return(0,j.Z)(t,[{key:"getSourceCfg",value:function(){return this.cfg}},{key:"getClusters",value:function(i){return this.clusterIndex.getClusters(this.caculClusterExtent(2),i)}},{key:"getClustersLeaves",value:function(i){return this.clusterIndex.getLeaves(i,1/0)}},{key:"getParserType",value:function(){return this.parser.type}},{key:"updateClusterData",value:function(i){var o=this,s=this.clusterOptions,l=s.method,f=l===void 0?"sum":l,v=s.field,y=this.clusterIndex.getClusters(this.caculClusterExtent(2),Math.floor(i));this.clusterOptions.zoom=i,y.forEach(function(b){b.id||(b.properties.point_count=1)}),(v||Hy(f))&&(y=y.map(function(b){var T=b.id;if(T){var M=o.clusterIndex.getLeaves(T,1/0),O=M.map(function(G){return G.properties}),F;if(iT(f)&&v){var $=mf(O,v);F=eT[f]($)}Hy(f)&&(F=f(O)),b.properties.stat=F}else b.properties.point_count=1;return b})),this.data=fe("geojson")({type:"FeatureCollection",features:y}),this.executeTrans()}},{key:"getFeatureById",value:function(i){var o=this.parser,s=o.type,l=s===void 0?"geojson":s,f=o.geometry;if(l==="geojson"&&!this.cluster){var v=i=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}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 o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function lT(e,r){if(e){if(typeof e=="string")return Gy(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Gy(e,r)}}function Gy(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);tn?i:n)}}catch(xe){o.e(xe)}finally{o.f()}var f=(t+n)/2,v=hT(r,f);if(v.xOffset<=0||v.yOffset<=0)return{gridHash:{},gridOffset:v};var y={},b=Wy(e),T;try{for(b.s();!(T=b.n()).done;){var M=T.value,O=M.coordinates[1],F=M.coordinates[0];if(Number.isFinite(O)&&Number.isFinite(F)){var $=Math.floor((O+90)/v.yOffset),G=Math.floor((F+180)/v.xOffset),ue="".concat($,"-").concat(G);y[ue]=y[ue]||{count:0,points:[]},y[ue].count+=1,y[ue].points.push(M)}}}catch(xe){b.e(xe)}finally{b.f()}return{gridHash:y,gridOffset:v}}function hT(e,r){var t=pT(e),n=dT(r,e);return{yOffset:t,xOffset:n}}function pT(e){return e/B0*(180/Math.PI)}function dT(e,r){return r/B0*(180/Math.PI)/Math.cos(e*Math.PI/180)}function vT(e,r,t){return Object.keys(e).reduce(function(n,i,o){var s=i.split("-"),l=parseInt(s[0],10),f=parseInt(s[1],10),v={};if(t.field&&t.method){var y=lf(e[i].points,t.field);v[t.method]=Il[t.method](y)}return Object.assign(v,{_id:o,coordinates:Fo([-180+r.xOffset*(f+.5),-90+r.yOffset*(l+.5)]),rawData:e[i].points,count:e[i].count}),n.push(v),n},[])}var sv=Math.PI/3,mT=[0,sv,2*sv,3*sv,4*sv,5*sv];function gT(e){return e[0]}function _T(e){return e[1]}function yT(){var e=0,r=0,t=1,n=1,i=gT,o=_T,s,l,f;function v(b){var T={},M=[],O,F=b.length;for(O=0;O1){var ht=G-ze,gt=ze+(Gtr*tr+Ir*Ir&&(ze=gt+(xe&1?1:-1)/2,xe=Ot)}var Er=ze+"-"+xe,mn=T[Er];mn?mn.push($):(M.push(mn=T[Er]=[$]),mn.x=(ze+(xe&1)/2)*l,mn.y=xe*f)}return M}function y(b){var T=0,M=0;return mT.map(function(O){var F=Math.sin(O)*b,$=-Math.cos(O)*b,G=F-T,ue=$-M;return T=F,M=$,[G,ue]})}return v.hexagon=function(b){return"m"+y(b==null?s:+b).join("l")+"z"},v.centers=function(){for(var b=[],T=Math.round(r/f),M=Math.round(e/l),O=T*f;O180||Math.abs(O[1][0])>180){if(y.x>M){var F=this.mapsService.lngLatToContainer([f-360,v]);y.x=F.x}if(y.x<0){var $=this.mapsService.lngLatToContainer([f+360,v]);y.x=$.x}}(y.x>M||y.x<0||y.y>T||y.y<0)&&(o.style.display="none"),o.style.left=y.x+s[0]+"px",o.style.top=y.y-s[1]+"px"}}}},{key:"init",value:function(){var i=this,o=this.markerOption.element,s=this.markerOption,l=s.color,f=s.anchor;if(!o){this.defaultMarker=!0,o=ta("div"),this.markerOption.element=o;var v=document.createElementNS("http://www.w3.org/2000/svg","svg");v.setAttributeNS(null,"display","block"),v.setAttributeNS(null,"height","48px"),v.setAttributeNS(null,"width","48px"),v.setAttributeNS(null,"viewBox","0 0 1024 1024");var y=document.createElementNS("http://www.w3.org/2000/svg","path");y.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"),y.setAttributeNS(null,"fill",l),v.appendChild(y),o.appendChild(v)}fu(o,"l7-marker"),Object.keys(this.markerOption.style||{}).forEach(function(b){var T,M,O=((T=i.markerOption)===null||T===void 0?void 0:T.style)&&((M=i.markerOption)===null||M===void 0?void 0:M.style[b]);o&&(o.style[b]=O)}),$l(o,f,"marker")}},{key:"registerMarkerEvent",value:function(i){i.addEventListener("click",this.onMapClick),i.addEventListener("mousemove",this.eventHandle),i.addEventListener("click",this.eventHandle),i.addEventListener("mousedown",this.eventHandle),i.addEventListener("mouseup",this.eventHandle),i.addEventListener("dblclick",this.eventHandle),i.addEventListener("contextmenu",this.eventHandle),i.addEventListener("mouseover",this.eventHandle),i.addEventListener("mouseout",this.eventHandle),i.addEventListener("touchstart",this.eventHandle),i.addEventListener("touchend",this.eventHandle)}},{key:"unRegisterMarkerEvent",value:function(){var i=this.getElement();i.removeEventListener("click",this.onMapClick),i.removeEventListener("mousemove",this.eventHandle),i.removeEventListener("click",this.eventHandle),i.removeEventListener("mousedown",this.eventHandle),i.removeEventListener("mouseup",this.eventHandle),i.removeEventListener("dblclick",this.eventHandle),i.removeEventListener("contextmenu",this.eventHandle),i.removeEventListener("mouseover",this.eventHandle),i.removeEventListener("mouseout",this.eventHandle),i.removeEventListener("touchstart",this.eventHandle),i.removeEventListener("touchend",this.eventHandle)}},{key:"polyfillEvent",value:function(i){!this.mapsService||this.mapsService.version!=="GAODE2.x"||ec()||(i.type==="touchstart"&&(this.touchStartTime=Date.now()),i.type==="touchend"&&Date.now()-this.touchStartTime<300&&this.emit("click",{target:i,data:this.markerOption.extData,lngLat:this.lngLat}))}},{key:"addDragHandler",value:function(i){return null}},{key:"onUp",value:function(i){throw new Error("Method not implemented.")}}]),t}(io.EventEmitter);function aL(e){var r=CT();return function(){var n=_getPrototypeOf(e),i;if(r){var o=_getPrototypeOf(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function CT(){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(e){return!1}}var oL=oi.merge,sL=null,uL=L(16604);function RT(e){var r=MT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function MT(){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(e){return!1}}var uv=function(e){(0,Le.Z)(t,e);var r=RT(t);function t(n){var i;return(0,Q.Z)(this,t),i=r.call(this),t.controlCount++,i.controlOption=(0,V.Z)((0,V.Z)({},i.getDefault(n)),n||{}),i}return(0,j.Z)(t,[{key:"getOptions",value:function(){return this.controlOption}},{key:"setOptions",value:function(i){var o=this.getDefault(i);Object.entries(i).forEach(function(s){var l=(0,Sn.Z)(s,2),f=l[0],v=l[1];v===void 0&&(i[f]=o[f])}),"position"in i&&this.setPosition(i.position),"className"in i&&this.setClassName(i.className),"style"in i&&this.setStyle(i.style),this.controlOption=(0,V.Z)((0,V.Z)({},this.controlOption),i)}},{key:"addTo",value:function(i){this.mapsService=i.get(ot.IMapService),this.renderService=i.get(ot.IRendererService),this.layerService=i.get(ot.ILayerService),this.controlService=i.get(ot.IControlService),this.configService=i.get(ot.IGlobalConfigService),this.scene=i.get(ot.ISceneService),this.sceneContainer=i,this.isShow=!0,this.container=this.onAdd(),fu(this.container,"l7-control");var o=this.controlOption,s=o.className,l=o.style;return s&&this.setClassName(s),l&&this.setStyle(l),this.insertContainer(),this.emit("add",this),this}},{key:"remove",value:function(){if(!this.mapsService)return this;Ii(this.container),this.onRemove(),this.emit("remove",this)}},{key:"onAdd",value:function(){return ta("div")}},{key:"onRemove",value:function(){}},{key:"show",value:function(){var i=this.container;Du(i,"l7-control--hide"),this.isShow=!0,this.emit("show",this)}},{key:"hide",value:function(){var i=this.container;fu(i,"l7-control--hide"),this.isShow=!1,this.emit("hide",this)}},{key:"getDefault",value:function(i){return{position:xr.TOPRIGHT,name:"".concat(t.controlCount)}}},{key:"getContainer",value:function(){return this.container}},{key:"getIsShow",value:function(){return this.isShow}},{key:"_refocusOnMap",value:function(i){if(this.mapsService&&i&&i.screenX>0&&i.screenY>0){var o=this.mapsService.getContainer();o!==null&&o.focus()}}},{key:"setPosition",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xr.TOPLEFT,o=this.controlService;return o&&o.removeControl(this),this.controlOption.position=i,o&&o.addControl(this,this.sceneContainer),this}},{key:"setClassName",value:function(i){var o=this.container,s=this.controlOption.className;s&&Du(o,s),i&&fu(o,i)}},{key:"setStyle",value:function(i){var o=this.container;i?o.setAttribute("style",i):o.removeAttribute("style")}},{key:"insertContainer",value:function(){var i=this.controlOption.position,o=this.container;if(i instanceof Element)i.appendChild(o);else{var s=this.controlService.controlCorners[i];["bottomleft","bottomright","righttop","rightbottom"].includes(i)?s.insertBefore(o,s.firstChild):s.appendChild(o)}}},{key:"checkUpdateOption",value:function(i,o){return o.some(function(s){return s in i})}}]),t}(vu());(0,B.Z)(uv,"controlCount",0);function IT(e){var r=PT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function PT(){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(e){return!1}}var _g=function(e){(0,Le.Z)(t,e);var r=IT(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s0&&arguments[0]!==void 0?arguments[0]:"";return ta("button","l7-button-control ".concat(i))}},{key:"onAdd",value:function(){this.button=this.createButton(),this.isDisable=!1;var i=this.controlOption,o=i.title,s=i.btnText,l=i.btnIcon;return this.setBtnTitle(o),this.setBtnText(s),this.setBtnIcon(l),this.button}},{key:"onRemove",value:function(){this.button=this.buttonIcon=this.buttonText=void 0,this.isDisable=!1}},{key:"setOptions",value:function(i){var o=i.title,s=i.btnText,l=i.btnIcon;this.checkUpdateOption(i,["title"])&&this.setBtnTitle(o),this.checkUpdateOption(i,["btnIcon"])&&this.setBtnIcon(l),this.checkUpdateOption(i,["btnText"])&&this.setBtnText(s),Ra((0,Ee.Z)(t.prototype),"setOptions",this).call(this,i)}},{key:"setBtnTitle",value:function(i){var o;(o=this.button)===null||o===void 0||o.setAttribute("title",i!=null?i:"")}},{key:"setBtnIcon",value:function(i){if(this.buttonIcon&&Ii(this.buttonIcon),i){var o,s=(o=this.button)===null||o===void 0?void 0:o.firstChild;if(s){var l;(l=this.button)===null||l===void 0||l.insertBefore(i,s)}else{var f;(f=this.button)===null||f===void 0||f.appendChild(i)}this.buttonIcon=i}}},{key:"setBtnText",value:function(i){if(this.button)if(Du(this.button,"l7-button-control--row"),Du(this.button,"l7-button-control--column"),i){var o=this.buttonText;if(!o){var s;o=ta("div","l7-button-control__text"),(s=this.button)===null||s===void 0||s.appendChild(o),this.buttonText=o}o.innerText=i,fu(this.button,this.controlOption.vertical?"l7-button-control--column":"l7-button-control--row")}else!i&&this.buttonText&&(Ii(this.buttonText),this.buttonText=void 0)}}]),t}(uv);function OT(e){var r=DT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function DT(){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(e){return!1}}var $y=function(e){(0,Le.Z)(t,e);var r=OT(t);function t(n,i){var o;return(0,Q.Z)(this,t),o=r.call(this),(0,B.Z)((0,Fe.Z)(o),"isShow",!1),(0,B.Z)((0,Fe.Z)(o),"timeout",null),(0,B.Z)((0,Fe.Z)(o),"show",function(){return o.isShow||!o.contentDOM.innerHTML||(o.resetPopperPosition(),Du(o.popperDOM,"l7-popper-hide"),o.isShow=!0,o.option.unique&&t.conflictPopperList.forEach(function(s){s!==(0,Fe.Z)(o)&&s.isShow&&s.hide()}),o.emit("show"),window.addEventListener("pointerdown",o.onPopperUnClick)),(0,Fe.Z)(o)}),(0,B.Z)((0,Fe.Z)(o),"hide",function(){return o.isShow&&(fu(o.popperDOM,"l7-popper-hide"),o.isShow=!1,o.emit("hide"),window.removeEventListener("pointerdown",o.onPopperUnClick)),(0,Fe.Z)(o)}),(0,B.Z)((0,Fe.Z)(o),"setHideTimeout",function(){o.timeout||(o.timeout=window.setTimeout(function(){o.isShow&&(o.hide(),o.timeout=null)},300))}),(0,B.Z)((0,Fe.Z)(o),"clearHideTimeout",function(){o.timeout&&(window.clearTimeout(o.timeout),o.timeout=null)}),(0,B.Z)((0,Fe.Z)(o),"onBtnClick",function(){o.isShow?o.hide():o.show()}),(0,B.Z)((0,Fe.Z)(o),"onPopperUnClick",function(s){Tl(s.target,[".l7-button-control",".l7-popper-content"])||o.hide()}),(0,B.Z)((0,Fe.Z)(o),"onBtnMouseLeave",function(){o.setHideTimeout()}),(0,B.Z)((0,Fe.Z)(o),"onBtnMouseMove",function(){o.clearHideTimeout(),!o.isShow&&o.show()}),o.button=n,o.option=i,o.init(),i.unique&&t.conflictPopperList.push((0,Fe.Z)(o)),o}return(0,j.Z)(t,[{key:"buttonRect",get:function(){return this.button.getBoundingClientRect()}},{key:"getPopperDOM",value:function(){return this.popperDOM}},{key:"getIsShow",value:function(){return this.isShow}},{key:"getContent",value:function(){return this.content}},{key:"setContent",value:function(i){typeof i=="string"?this.contentDOM.innerHTML=i:i instanceof HTMLElement&&(ca(this.contentDOM),this.contentDOM.appendChild(i)),this.content=i}},{key:"init",value:function(){var i=this.option.trigger;this.popperDOM=this.createPopper(),i==="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))}},{key:"destroy",value:function(){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),Ii(this.popperDOM)}},{key:"resetPopperPosition",value:function(){var i={},o=this.option,s=o.container,l=o.offset,f=l===void 0?[0,0]:l,v=o.placement,y=(0,Sn.Z)(f,2),b=y[0],T=y[1],M=this.button.getBoundingClientRect(),O=s.getBoundingClientRect(),F=gh(M,O),$=F.left,G=F.right,ue=F.top,xe=F.bottom,ze=!1,Je=!1;/^(left|right)/.test(v)?(v.includes("left")?i.right="".concat(M.width+G,"px"):v.includes("right")&&(i.left="".concat(M.width+$,"px")),v.includes("start")?i.top="".concat(ue,"px"):v.includes("end")?i.bottom="".concat(xe,"px"):(i.top="".concat(ue+M.height/2,"px"),Je=!0,i.transform="translate(".concat(b,"px, calc(").concat(T,"px - 50%))"))):/^(top|bottom)/.test(v)&&(v.includes("top")?i.bottom="".concat(M.height+xe,"px"):v.includes("bottom")&&(i.top="".concat(M.height+ue,"px")),v.includes("start")?i.left="".concat($,"px"):v.includes("end")?i.right="".concat(G,"px"):(i.left="".concat($+M.width/2,"px"),ze=!0,i.transform="translate(calc(".concat(b,"px - 50%), ").concat(T,"px)"))),i.transform="translate(calc(".concat(b,"px - ").concat(ze?"50%":"0%","), calc(").concat(T,"px - ").concat(Je?"50%":"0%",")");var ht=v.split("-");ht.length&&fu(this.popperDOM,ht.map(function(gt){return"l7-popper-".concat(gt)}).join(" ")),Qs(this.popperDOM,rl(i))}},{key:"createPopper",value:function(){var i=this.option,o=i.container,s=i.className,l=s===void 0?"":s,f=i.content,v=ta("div","l7-popper l7-popper-hide ".concat(l)),y=ta("div","l7-popper-content"),b=ta("div","l7-popper-arrow");return v.appendChild(y),v.appendChild(b),o.appendChild(v),this.popperDOM=v,this.contentDOM=y,f&&this.setContent(f),v}}]),t}(io.EventEmitter);(0,B.Z)($y,"conflictPopperList",[]);function FT(e){var r=kT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function kT(){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(e){return!1}}var BT={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"},LT=function(e){(0,Le.Z)(t,e);var r=FT(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getPopper",value:function(){return this.popper}},{key:"hide",value:function(){this.popper.hide(),Ra((0,Ee.Z)(t.prototype),"hide",this).call(this)}},{key:"getDefault",value:function(i){var o,s=Ra((0,Ee.Z)(t.prototype),"getDefault",this).call(this,i),l=(o=i==null?void 0:i.position)!==null&&o!==void 0?o:s.position;return(0,V.Z)((0,V.Z)({},Ra((0,Ee.Z)(t.prototype),"getDefault",this).call(this,i)),{},{popperPlacement:l instanceof Element?"bottom":BT[l],popperTrigger:"click"})}},{key:"onAdd",value:function(){var i=Ra((0,Ee.Z)(t.prototype),"onAdd",this).call(this);return this.initPopper(),i}},{key:"onRemove",value:function(){this.popper.destroy()}},{key:"initPopper",value:function(){var i=this,o=this.controlOption,s=o.popperClassName,l=o.popperPlacement,f=o.popperTrigger,v=this.mapsService.getMapContainer();return this.popper=new $y(this.button,{className:s,placement:l,trigger:f,container:v,unique:!0}),this.popper.on("show",function(){i.emit("popperShow",i)}).on("hide",function(){i.emit("popperHide",i)}),this.popper}},{key:"setOptions",value:function(i){if(Ra((0,Ee.Z)(t.prototype),"setOptions",this).call(this,i),this.checkUpdateOption(i,["popperPlacement","popperTrigger","popperClassName"])){var o=this.popper.getContent();this.popper.destroy(),this.initPopper(),this.popper.setContent(o)}}}]),t}(_g);function NT(e){var r=UT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function UT(){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(e){return!1}}var Rp=function(e){return e.ActiveOptionClassName="l7-select-control-item-active",e.OptionValueAttrKey="data-option-value",e.OptionIndexAttrKey="data-option-index",e}(Rp||{}),Yy=function(e){(0,Le.Z)(t,e);var r=NT(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s-1?n.selectValue.splice(f,1):n.selectValue=[].concat((0,Kt.Z)(n.selectValue),[l.value])}else n.selectValue=[l.value];n.setSelectValue(n.selectValue)}),n}return(0,j.Z)(t,[{key:"setOptions",value:function(i){Ra((0,Ee.Z)(t.prototype),"setOptions",this).call(this,i);var o=i.options;o&&this.popper.setContent(this.getPopperContent(o))}},{key:"onAdd",value:function(){var i=Ra((0,Ee.Z)(t.prototype),"onAdd",this).call(this),o=this.controlOption.defaultValue;return o&&(this.selectValue=this.transSelectValue(o)),this.popper.setContent(this.getPopperContent(this.controlOption.options)),i}},{key:"getSelectValue",value:function(){return this.getIsMultiple()?this.selectValue:this.selectValue[0]}},{key:"setSelectValue",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,l=this.transSelectValue(i);this.optionDOMList.forEach(function(f){var v=f.getAttribute(Rp.OptionValueAttrKey),y=o.getIsMultiple()?f.querySelector("input[type=checkbox]"):void 0;l.includes(v)?(fu(f,Rp.ActiveOptionClassName),y&&Ql(y,!0)):(Du(f,Rp.ActiveOptionClassName),y&&Ql(y,!1))}),this.selectValue=l,s&&this.emit("selectChange",this.getIsMultiple()?l:l[0])}},{key:"getIsMultiple",value:function(){return!1}},{key:"getPopperContent",value:function(i){var o=this,s=this.isImageOptions(),l=ta("div",s?"l7-select-control--image":"l7-select-control--normal");this.getIsMultiple()&&fu(l,"l7-select-control--multiple");var f=i.map(function(v,y){var b=s?o.createImageOption(v):o.createNormalOption(v);return b.setAttribute(Rp.OptionValueAttrKey,v.value),b.setAttribute(Rp.OptionIndexAttrKey,window.String(y)),b.addEventListener("click",o.onItemClick.bind(o,v)),b});return l.append.apply(l,(0,Kt.Z)(f)),this.optionDOMList=f,l}},{key:"createImageOption",value:function(i){var o=this.selectValue.includes(i.value),s=ta("div","l7-select-control-item ".concat(o?Rp.ActiveOptionClassName:"")),l=ta("img");l.setAttribute("src",i.img),tf(l),s.appendChild(l);var f=ta("div","l7-select-control-item-row");this.getIsMultiple()&&s.appendChild(this.createCheckbox(o));var v=ta("span");return v.innerText=i.text,f.appendChild(v),s.appendChild(f),s}},{key:"createCheckbox",value:function(i){var o=ta("input");return o.setAttribute("type","checkbox"),i&&Ql(o,!0),o}},{key:"isImageOptions",value:function(){return!!this.controlOption.options.find(function(i){return i.img})}},{key:"transSelectValue",value:function(i){return Array.isArray(i)?i:[i]}}]),t}(LT),Hh=function(r){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.classList.add("l7-iconfont"),t.setAttribute("aria-hidden","true");var n=document.createElementNS("http://www.w3.org/2000/svg","use");return n.setAttributeNS("http://www.w3.org/1999/xlink","href","#".concat(r)),t.appendChild(n),t};function zT(e){var r=ZT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function ZT(){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(e){return!1}}var VT=function(e){(0,Le.Z)(t,e);var r=zT(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}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 o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function HT(e,r){if(e){if(typeof e=="string")return qy(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return qy(e,r)}}function qy(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t0&&arguments[0]!==void 0?arguments[0]:document.documentElement,t=arguments.length>1?arguments[1]:void 0;return new Promise(function(n,i){var o=function l(){xc.off("change",l),n()};xc.on("change",o);var s=r[Wh.requestFullscreen](t);s instanceof Promise&&s.then(o).catch(i)})},exit:function(){return new Promise(function(r,t){if(!xc.isFullscreen){r();return}var n=function o(){xc.off("change",o),r()};xc.on("change",n);var i=document[Wh.exitFullscreen]();i instanceof Promise&&i.then(n).catch(t)})},toggle:function(r,t){return xc.isFullscreen?xc.exit():xc.request(r,t)},onchange:function(r){xc.on("change",r)},onerror:function(r){xc.on("error",r)},on:function(r,t){var n=Qy[r];n&&document.addEventListener(n,t,!1)},off:function(r,t){var n=Qy[r];n&&document.removeEventListener(n,t,!1)},raw:Wh};Object.defineProperties(xc,{isFullscreen:{get:function(){return!!document[Wh.fullscreenElement]}},element:{enumerable:!0,get:function(){var r;return(r=document[Wh.fullscreenElement])!==null&&r!==void 0?r:void 0}},isEnabled:{enumerable:!0,get:function(){return!!document[Wh.fullscreenEnabled]}}}),Wh||(xc={isEnabled:!1});var L0=xc;function WT(e){var r=GT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function GT(){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(e){return!1}}var XT=function(e){(0,Le.Z)(t,e);var r=WT(t);function t(n){var i;return(0,Q.Z)(this,t),i=r.call(this,n),(0,B.Z)((0,Fe.Z)(i),"isFullscreen",!1),(0,B.Z)((0,Fe.Z)(i),"toggleFullscreen",(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!L0.isEnabled){l.next=3;break}return l.next=3,L0.toggle(i.mapContainer);case 3:case"end":return l.stop()}},o)}))),(0,B.Z)((0,Fe.Z)(i),"onClick",function(){i.toggleFullscreen()}),(0,B.Z)((0,Fe.Z)(i),"onFullscreenChange",function(){i.isFullscreen=!!document.fullscreenElement;var o=i.controlOption,s=o.btnText,l=o.btnIcon,f=o.title,v=o.exitBtnText,y=o.exitBtnIcon,b=o.exitTitle;i.isFullscreen?(i.setBtnTitle(b),i.setBtnText(v),i.setBtnIcon(y)):(i.setBtnTitle(f),i.setBtnText(s),i.setBtnIcon(l)),i.emit("fullscreenChange",i.isFullscreen)}),L0.isEnabled||console.warn("\u5F53\u524D\u6D4F\u89C8\u5668\u73AF\u5883\u4E0D\u652F\u6301\u5BF9\u5730\u56FE\u5168\u5C4F\u5316"),i}return(0,j.Z)(t,[{key:"setOptions",value:function(i){var o=i.exitBtnText,s=i.exitBtnIcon,l=i.exitTitle;this.isFullscreen&&(this.checkUpdateOption(i,["exitBtnIcon"])&&this.setBtnIcon(s),this.checkUpdateOption(i,["exitBtnText"])&&this.setBtnText(o),this.checkUpdateOption(i,["exitTitle"])&&this.setBtnTitle(l)),Ra((0,Ee.Z)(t.prototype),"setOptions",this).call(this,i)}},{key:"onAdd",value:function(){var i=Ra((0,Ee.Z)(t.prototype),"onAdd",this).call(this);return i.addEventListener("click",this.onClick),this.mapContainer=Ds(this.scene.getSceneConfig().id),this.mapContainer.addEventListener("fullscreenchange",this.onFullscreenChange),i}},{key:"onRemove",value:function(){Ra((0,Ee.Z)(t.prototype),"onRemove",this).call(this),this.mapContainer.removeEventListener("fullscreenchange",this.onFullscreenChange)}},{key:"getDefault",value:function(i){return(0,V.Z)((0,V.Z)({},Ra((0,Ee.Z)(t.prototype),"getDefault",this).call(this,i)),{},{title:"\u5168\u5C4F",btnIcon:Hh("l7-icon-fullscreen"),exitTitle:"\u9000\u51FA\u5168\u5C4F",exitBtnIcon:Hh("l7-icon-exit-fullscreen")})}}]),t}(_g);function $T(e){var r=YT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function YT(){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(e){return!1}}var qT=function(e){(0,Le.Z)(t,e);var r=$T(t);function t(n){var i;return(0,Q.Z)(this,t),i=r.call(this,n),(0,B.Z)((0,Fe.Z)(i),"getGeoLocation",function(){return new Promise(function(o,s){window.navigator.geolocation.getCurrentPosition(function(l){var f=l.coords,v=f!=null?f:{},y=v.longitude,b=v.latitude;!isNaN(y)&&!isNaN(b)?o([y,b]):s()},function(l){s(l)})})}),(0,B.Z)((0,Fe.Z)(i),"onClick",(0,Pt.Z)(ge().mark(function o(){var s,l,f;return ge().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(window.navigator.geolocation){y.next=2;break}return y.abrupt("return");case 2:return s=i.controlOption.transform,y.next=5,i.getGeoLocation();case 5:if(l=y.sent,f=i.mapsService.getZoom(),y.t0=i.mapsService,y.t1=f>15?f:15,!s){y.next=15;break}return y.next=12,s(l);case 12:y.t2=y.sent,y.next=16;break;case 15:y.t2=l;case 16:y.t3=y.t2,y.t0.setZoomAndCenter.call(y.t0,y.t1,y.t3);case 18:case"end":return y.stop()}},o)}))),window.navigator.geolocation||console.warn("\u5F53\u524D\u6D4F\u89C8\u5668\u73AF\u5883\u4E0D\u652F\u6301\u83B7\u53D6\u5730\u7406\u5B9A\u4F4D"),i}return(0,j.Z)(t,[{key:"getDefault",value:function(i){return(0,V.Z)((0,V.Z)({},Ra((0,Ee.Z)(t.prototype),"getDefault",this).call(this,i)),{},{title:"\u5B9A\u4F4D",btnIcon:Hh("l7-icon-reposition")})}},{key:"onAdd",value:function(){var i=Ra((0,Ee.Z)(t.prototype),"onAdd",this).call(this);return i.addEventListener("click",this.onClick),i}}]),t}(_g);function KT(e){var r=QT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function QT(){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(e){return!1}}function Jy(e){return Object.keys(e!=null?e:{}).every(function(r){return["layer","name","img"].includes(r)})}var e1=function(e){(0,Le.Z)(t,e);var r=KT(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s=10?10:s>=5?5:s>=3?3:s>=2?2:1,o*s}},{key:"updateMetric",value:function(i){var o=this.getRoundNum(i),s=o<1e3?o+" m":o/1e3+" km";this.updateScale(this.mScale,s,o/i)}},{key:"updateImperial",value:function(i){var o=i*3.2808399,s,l,f;o>5280?(s=o/5280,l=this.getRoundNum(s),this.updateScale(this.iScale,l+" mi",l/s)):(f=this.getRoundNum(o),this.updateScale(this.iScale,f+" ft",f/o))}}]),t}(uv);function hw(e){var r=pw();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function pw(){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(e){return!1}}var dw=function(e){(0,Le.Z)(t,e);var r=hw(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;sn.mapsService.getMinZoom()&&n.mapsService.zoomOut()}),(0,B.Z)((0,Fe.Z)(n),"updateDisabled",function(){var l=n.mapsService;n.zoomInButton.removeAttribute("disabled"),n.zoomOutButton.removeAttribute("disabled"),(n.disabled||l.getZoom()<=l.getMinZoom())&&n.zoomOutButton.setAttribute("disabled","true"),n.controlOption.showZoom&&n.zoomNumDiv&&(n.zoomNumDiv.innerText=String(Math.floor(l.getZoom()))),(n.disabled||l.getZoom()>=l.getMaxZoom())&&n.zoomInButton.setAttribute("disabled","true")}),n}return(0,j.Z)(t,[{key:"getDefault",value:function(i){return(0,V.Z)((0,V.Z)({},Ra((0,Ee.Z)(t.prototype),"getDefault",this).call(this,i)),{},{position:xr.BOTTOMRIGHT,name:"zoom",zoomInText:Hh("l7-icon-enlarge"),zoomInTitle:"Zoom in",zoomOutText:Hh("l7-icon-narrow"),zoomOutTitle:"Zoom out",showZoom:!1})}},{key:"setOptions",value:function(i){Ra((0,Ee.Z)(t.prototype),"setOptions",this).call(this,i),this.checkUpdateOption(i,["zoomInText","zoomInTitle","zoomOutText","zoomOutTitle","showZoom"])&&this.resetButtonGroup(this.container)}},{key:"onAdd",value:function(){var i=ta("div","l7-control-zoom");return this.resetButtonGroup(i),this.mapsService.on("zoomend",this.updateDisabled),this.mapsService.on("zoomchange",this.updateDisabled),i}},{key:"onRemove",value:function(){this.mapsService.off("zoomend",this.updateDisabled),this.mapsService.off("zoomchange",this.updateDisabled)}},{key:"disable",value:function(){return this.disabled=!0,this.updateDisabled(),this}},{key:"enable",value:function(){return this.disabled=!1,this.updateDisabled(),this}},{key:"resetButtonGroup",value:function(i){ca(i),this.zoomInButton=this.createButton(this.controlOption.zoomInText,this.controlOption.zoomInTitle,"l7-button-control",i,this.zoomIn),this.controlOption.showZoom&&(this.zoomNumDiv=this.createButton("0","","l7-button-control l7-control-zoom__number",i)),this.zoomOutButton=this.createButton(this.controlOption.zoomOutText,this.controlOption.zoomOutTitle,"l7-button-control",i,this.zoomOut),this.updateDisabled()}},{key:"createButton",value:function(i,o,s,l,f){var v=ta("button",s,l);return typeof i=="string"?v.innerHTML=i:v.append(i),v.title=o,f&&v.addEventListener("click",f),v}}]),t}(uv);function vw(e){var r=mw();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function mw(){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(e){return!1}}var r1=function(e){(0,Le.Z)(t,e);var r=vw(t);function t(n){var i;(0,Q.Z)(this,t),i=r.call(this),(0,B.Z)((0,Fe.Z)(i),"isShow",!0),(0,B.Z)((0,Fe.Z)(i),"onMouseMove",function(s){var l,f=i.mapsService.getMapContainer(),v=(l=f==null?void 0:f.getBoundingClientRect())!==null&&l!==void 0?l:{},y=v.left,b=y===void 0?0:y,T=v.top,M=T===void 0?0:T;i.setPopupPosition(s.clientX-b,s.clientY-M)}),(0,B.Z)((0,Fe.Z)(i),"updateLngLatPosition",function(){if(!(!i.mapsService||i.popupOption.followCursor)){var s=i.lngLat,l=s.lng,f=s.lat,v=i.mapsService.lngLatToContainer([l,f]),y=v.x,b=v.y;i.setPopupPosition(y,b)}}),(0,B.Z)((0,Fe.Z)(i),"onKeyDown",function(s){s.keyCode===27&&i.remove()}),(0,B.Z)((0,Fe.Z)(i),"onCloseButtonClick",function(s){s.stopPropagation&&s.stopPropagation(),i.hide()}),(0,B.Z)((0,Fe.Z)(i),"update",function(){var s=!!i.lngLat,l=i.popupOption,f=l.className,v=l.style,y=l.maxWidth,b=l.anchor,T=l.stopPropagation;if(!(!i.mapsService||!s||!i.content)){var M=i.mapsService.getMarkerContainer();if(!i.container&&M&&(i.container=ta("div","l7-popup ".concat(f!=null?f:""," ").concat(i.isShow?"":"l7-popup-hide"),M),v&&i.container.setAttribute("style",v),i.tip=ta("div","l7-popup-tip",i.container),i.container.appendChild(i.content),T&&["mousemove","mousedown","mouseup","click","dblclick"].forEach(function($){i.container.addEventListener($,function(G){G.stopPropagation()})}),i.container.style.whiteSpace="nowrap"),i.updateLngLatPosition(),Fu(i.container,"".concat(Aa[b])),$l(i.container,b,"popup"),y){var O=i.container.getBoundingClientRect(),F=O.width;F>parseFloat(y)&&(i.container.style.width=y)}else i.container.style.removeProperty("width")}}),i.popupOption=(0,V.Z)((0,V.Z)({},i.getDefault(n!=null?n:{})),n);var o=i.popupOption.lngLat;return o&&(i.lngLat=o),i}return(0,j.Z)(t,[{key:"lngLat",get:function(){var i;return(i=this.popupOption.lngLat)!==null&&i!==void 0?i:{lng:0,lat:0}},set:function(i){this.popupOption.lngLat=i}},{key:"getIsShow",value:function(){return this.isShow}},{key:"addTo",value:function(i){this.mapsService=i.get(ot.IMapService),this.sceneService=i.get(ot.ISceneService),this.layerService=i.get(ot.ILayerService),this.mapsService.on("camerachange",this.update),this.mapsService.on("viewchange",this.update),this.scene=i,this.update(),this.updateCloseOnClick(),this.updateCloseOnEsc(),this.updateFollowCursor();var o=this.popupOption,s=o.html,l=o.text,f=o.title;return s?this.setHTML(s):l&&this.setText(l),f&&this.setTitle(f),this.emit("open"),this}},{key:"remove",value:function(){if(this!==null&&this!==void 0&&this.isOpen())return this.content&&Ii(this.content),this.container&&(Ii(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}},{key:"getOptions",value:function(){return this.popupOption}},{key:"setOptions",value:function(i){return this.show(),this.popupOption=(0,V.Z)((0,V.Z)({},this.popupOption),i),this.checkUpdateOption(i,["html","text","title","closeButton","closeButtonOffsets","maxWidth","anchor","stopPropagation","className","style","lngLat","offsets"])&&(this.container&&(Ii(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(i,["closeOnEsc"])&&this.updateCloseOnEsc(),this.checkUpdateOption(i,["closeOnClick"])&&this.updateCloseOnClick(),this.checkUpdateOption(i,["followCursor"])&&this.updateFollowCursor(),this.checkUpdateOption(i,["html"])&&i.html?this.setHTML(i.html):this.checkUpdateOption(i,["text"])&&i.text&&this.setText(i.text),this.checkUpdateOption(i,["lngLat"])&&i.lngLat&&this.setLnglat(i.lngLat),this}},{key:"open",value:function(){return this.addTo(this.scene),this}},{key:"close",value:function(){return this.remove(),this}},{key:"show",value:function(){if(!this.isShow)return this.container&&Du(this.container,"l7-popup-hide"),this.isShow=!0,this.emit("show"),this}},{key:"hide",value:function(){if(this.isShow)return this.container&&fu(this.container,"l7-popup-hide"),this.isShow=!1,this.emit("hide"),this}},{key:"setHTML",value:function(i){return this.popupOption.html=i,this.setDOMContent(i)}},{key:"setText",value:function(i){return this.popupOption.text=i,this.setDOMContent(window.document.createTextNode(i))}},{key:"setTitle",value:function(i){this.show(),this.popupOption.title=i,i?(this.contentTitle||(this.contentTitle=ta("div","l7-popup-content__title"),this.content.firstChild?this.content.insertBefore(this.contentTitle,this.content.firstChild):this.content.append(this.contentTitle)),ca(this.contentTitle),np(this.contentTitle,i)):this.contentTitle&&(Ii(this.contentTitle),this.contentTitle=void 0)}},{key:"panToPopup",value:function(){var i=this.lngLat,o=i.lng,s=i.lat;return this.popupOption.autoPan&&this.mapsService.panTo([o,s]),this}},{key:"setLngLat",value:function(i){return this.setLnglat(i)}},{key:"setLnglat",value:function(i){var o=this;return this.show(),this.lngLat=i,Array.isArray(i)&&(this.lngLat={lng:i[0],lat:i[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(function(){o.panToPopup()},0),this}},{key:"getLnglat",value:function(){return this.lngLat}},{key:"setMaxWidth",value:function(i){return this.popupOption.maxWidth=i,this.update(),this}},{key:"isOpen",value:function(){return!!this.mapsService}},{key:"getDefault",value:function(i){return{closeButton:!0,closeOnClick:!1,maxWidth:"240px",offsets:[0,0],anchor:ma.BOTTOM,stopPropagation:!0,autoPan:!1,autoClose:!0,closeOnEsc:!1,followCursor:!1}}},{key:"setDOMContent",value:function(i){return this.show(),this.createContent(),np(this.contentPanel,i),this.update(),this}},{key:"updateCloseOnClick",value:function(i){var o=this,s=this.mapsService;s&&(s==null||s.off("click",this.onCloseButtonClick),this.popupOption.closeOnClick&&!i&&requestAnimationFrame(function(){s==null||s.on("click",o.onCloseButtonClick)}))}},{key:"updateCloseOnEsc",value:function(i){window.removeEventListener("keydown",this.onKeyDown),this.popupOption.closeOnEsc&&!i&&window.addEventListener("keydown",this.onKeyDown)}},{key:"updateFollowCursor",value:function(i){var o,s=(o=this.mapsService)===null||o===void 0?void 0:o.getContainer();s&&(s==null||s.removeEventListener("mousemove",this.onMouseMove),this.popupOption.followCursor&&!i&&(s==null||s.addEventListener("mousemove",this.onMouseMove)))}},{key:"createContent",value:function(){var i=this;if(this.content&&Ii(this.content),this.contentTitle=void 0,this.content=ta("div","l7-popup-content",this.container),this.setTitle(this.popupOption.title),this.popupOption.closeButton){var o=Hh("l7-icon-guanbi");fu(o,"l7-popup-close-button"),this.content.appendChild(o),this.popupOption.closeButtonOffsets&&(o.style.right=this.popupOption.closeButtonOffsets[0]+"px",o.style.top=this.popupOption.closeButtonOffsets[1]+"px"),o.setAttribute("aria-label","Close popup"),o.addEventListener("click",function(){i.hide()}),o.addEventListener("pointerup",function(s){s.stopPropagation()}),o.addEventListener("pointerdown",function(s){s.stopPropagation()}),this.closeButton=o}else this.closeButton=void 0;this.contentPanel=ta("div","l7-popup-content__panel",this.content)}},{key:"setPopupPosition",value:function(i,o){if(this.container){var s=this.popupOption.offsets;this.container.style.left=i+s[0]+"px",this.container.style.top=o-s[1]+"px"}}},{key:"checkUpdateOption",value:function(i,o){return o.some(function(s){return s in i})}}]),t}(io.EventEmitter);function lL(e){var r=gw();return function(){var n=_getPrototypeOf(e),i;if(r){var o=_getPrototypeOf(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function gw(){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(e){return!1}}var cL=oi.get,fL=null;function _w(e,r){var t=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(!(t||n)&&(r||(r=document),!!r)){var i=r.head||r.getElementsByTagName("head")[0];if(!i){i=r.createElement("head");var o=r.body||r.getElementsByTagName("body")[0];o?o.parentNode.insertBefore(i,o):r.documentElement.appendChild(i)}var s=r.createElement("style");return s.type="text/css",s.styleSheet?s.styleSheet.cssText=e:s.appendChild(r.createTextNode(e)),i.appendChild(s),s}}_w(`.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 { -webkit-box-shadow: none; 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; -webkit-box-sizing: border-box; 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: -webkit-box; display: -ms-flexbox; 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: -webkit-box; display: -ms-flexbox; 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: -webkit-box; display: -ms-flexbox; 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: -webkit-box; display: -ms-flexbox; 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: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; 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 { -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; } .l7-control-container .l7-row.l7-top { -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; } .l7-control-container .l7-row.l7-bottom { -webkit-box-align: end; -ms-flex-align: end; align-items: flex-end; } .l7-control-container .l7-column { -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; } .l7-control-container .l7-column.l7-left { -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; } .l7-control-container .l7-column.l7-right { -webkit-box-align: end; -ms-flex-align: end; 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; -webkit-transition: all 0.2s; transition: all 0.2s; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center; padding: 0 6px; -webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15); 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; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; 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: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: 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; -webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15); 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; -webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15); box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15); } .l7-popper.l7-popper-left { -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; } .l7-popper.l7-popper-left .l7-popper-arrow { border-left-color: #fff; margin: 10px 0; } .l7-popper.l7-popper-right { -webkit-box-orient: horizontal; -webkit-box-direction: reverse; -ms-flex-direction: row-reverse; flex-direction: row-reverse; } .l7-popper.l7-popper-right .l7-popper-arrow { border-right-color: #fff; margin: 10px 0; } .l7-popper.l7-popper-top { -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; } .l7-popper.l7-popper-top .l7-popper-arrow { border-top-color: #fff; margin: 0 10px; } .l7-popper.l7-popper-bottom { -webkit-box-orient: vertical; -webkit-box-direction: reverse; -ms-flex-direction: column-reverse; flex-direction: column-reverse; } .l7-popper.l7-popper-bottom .l7-popper-arrow { border-bottom-color: #fff; margin: 0 10px; } .l7-popper.l7-popper-start { -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; } .l7-popper.l7-popper-end { -webkit-box-align: end; -ms-flex-align: end; align-items: flex-end; } .l7-select-control--normal { padding: 4px 0; } .l7-select-control--normal .l7-select-control-item { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; 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: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; -webkit-box-sizing: content-box; 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: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-flex: 0; -ms-flex: 0 0 calc((100% - (12px + 9px) * 2) / 3); flex: 0 0 calc((100% - (12px + 9px) * 2) / 3); -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-sizing: content-box; 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: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: 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; -webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15); 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; -webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15); 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; -webkit-box-shadow: 0 0 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: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; } .l7-control-scale .l7-control-scale-line { -webkit-box-sizing: border-box; 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; -webkit-transition: width 0.1s; 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: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: end; -ms-flex-align: end; 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: -webkit-box; display: -ms-flexbox; 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; -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); 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 { -webkit-box-orient: vertical; -webkit-box-direction: reverse; -ms-flex-direction: column-reverse; 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 { -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; 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 { -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; } .l7-popup.l7-popup-anchor-right { -webkit-box-orient: horizontal; -webkit-box-direction: reverse; -ms-flex-direction: row-reverse; flex-direction: row-reverse; } .l7-popup-anchor-top .l7-popup-tip { position: relative; -webkit-align-self: center; -ms-flex-item-align: center; align-self: center; border-top: none; border-bottom-color: #fff; } .l7-popup-anchor-top-left .l7-popup-tip { -webkit-align-self: flex-start; -ms-flex-item-align: start; align-self: flex-start; border-top: none; border-bottom-color: #fff; border-left: none; } .l7-popup-anchor-top-right .l7-popup-tip { -webkit-align-self: flex-end; -ms-flex-item-align: end; align-self: flex-end; border-top: none; border-right: none; border-bottom-color: #fff; } .l7-popup-anchor-bottom .l7-popup-tip { -webkit-align-self: center; -ms-flex-item-align: center; align-self: center; border-top-color: #fff; border-bottom: none; } .l7-popup-anchor-bottom-left .l7-popup-tip { -webkit-align-self: flex-start; -ms-flex-item-align: start; align-self: flex-start; border-top-color: #fff; border-bottom: none; border-left: none; } .l7-popup-anchor-bottom-right .l7-popup-tip { -webkit-align-self: flex-end; -ms-flex-item-align: end; align-self: flex-end; border-top-color: #fff; border-right: none; border-bottom: none; } .l7-popup-anchor-left .l7-popup-tip { -webkit-align-self: center; -ms-flex-item-align: center; align-self: center; border-right-color: #fff; border-left: none; } .l7-popup-anchor-right .l7-popup-tip { right: 1px; -webkit-align-self: center; -ms-flex-item-align: center; 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: -webkit-box; display: -ms-flexbox; 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; } `);var Mp,n1=(Mp={},(0,B.Z)(Mp,Zs.additive,{enable:!0,func:{srcRGB:R.ONE,dstRGB:R.ONE,srcAlpha:1,dstAlpha:1}}),(0,B.Z)(Mp,Zs.none,{enable:!1}),(0,B.Z)(Mp,Zs.normal,{enable:!0,func:{srcRGB:R.SRC_ALPHA,dstRGB:R.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}}),(0,B.Z)(Mp,Zs.subtractive,{enable:!0,func:{srcRGB:R.ONE,dstRGB:R.ONE,srcAlpha:R.ZERO,dstAlpha:R.ONE_MINUS_SRC_COLOR},equation:{rgb:R.FUNC_SUBTRACT,alpha:R.FUNC_SUBTRACT}}),(0,B.Z)(Mp,Zs.max,{enable:!0,func:{srcRGB:R.ONE,dstRGB:R.ONE},equation:{rgb:R.MAX_EXT}}),(0,B.Z)(Mp,Zs.min,{enable:!0,func:{srcRGB:R.ONE,dstRGB:R.ONE},equation:{rgb:R.MIN_EXT}}),Mp);function i1(e){return e.map(function(r){return typeof r=="string"&&(r=[r,{}]),r})}function a1(e,r,t,n){var i=e.multiPassRenderer,o=e.getLayerConfig(),s=o.enableTAA;return s?i.add(n("taa")):i.add(n("render")),i1(r).forEach(function(l){var f=(0,Sn.Z)(l,2),v=f[0],y=f[1];i.add(t(v),y)}),i.add(t("copy")),i}var yw=function(){function e(r){(0,Q.Z)(this,e),this.layer=r}return(0,j.Z)(e,[{key:"pickRender",value:function(t){var n=this.layer.getContainer(),i=n.get(ot.ILayerService),o=this.layer;if(o.tileLayer)return o.tileLayer.pickRender(t);o.hooks.beforePickingEncode.call(),i.renderTileLayerMask(o),o.renderModels({ispick:!0}),o.hooks.afterPickingEncode.call()}},{key:"pick",value:function(t,n){var i=this.layer.getContainer(),o=i.get(ot.IPickingService);return t.type==="RasterLayer"?this.pickRasterLayer(t,n):(this.pickRender(n),o.pickFromPickingFBO(t,n))}},{key:"pickRasterLayer",value:function(t,n,i){var o=this.layer.getContainer(),s=o.get(ot.IPickingService),l=o.get(ot.IMapService),f=this.layer.getSource().extent,v=yh(n.lngLat,f),y={x:n.x,y:n.y,type:n.type,lngLat:n.lngLat,target:n,rasterValue:null},b=i||t;if(v){var T=this.readRasterValue(t,f,l,n.x,n.y);return y.rasterValue=T,s.triggerHoverOnLayer(b,y),!0}else return y.type=n.type==="mousemove"?"mouseout":"un"+n.type,s.triggerHoverOnLayer(b,(0,V.Z)((0,V.Z)({},y),{},{type:"unpick"})),s.triggerHoverOnLayer(b,y),!1}},{key:"readRasterValue",value:function(t,n,i,o,s){var l=t.getSource().data.dataArray[0],f=(0,Sn.Z)(n,4),v=f[0],y=v===void 0?0:v,b=f[1],T=b===void 0?0:b,M=f[2],O=M===void 0?10:M,F=f[3],$=F===void 0?-10:F,G=i.lngLatToContainer([y,T]),ue=i.lngLatToContainer([O,$]),xe=ue.x-G.x,ze=G.y-ue.y,Je=[(o-G.x)/xe,(s-ue.y)/ze],ht=l.width||1,gt=l.height||1,Ot=Math.floor(Je[0]*ht),tr=Math.floor(Je[1]*gt),Ir=Math.max(0,tr-1)*ht+Ot,Er=l.data[Ir];return Er}},{key:"selectFeature",value:function(t){var n=this.layer,i=(0,Sn.Z)(t,3),o=i[0],s=i[1],l=i[2];n.hooks.beforeSelect.call([o,s,l])}},{key:"highlightPickedFeature",value:function(t){var n=(0,Sn.Z)(t,3),i=n[0],o=n[1],s=n[2];this.layer.hooks.beforeHighlight.call([i,o,s])}},{key:"getFeatureById",value:function(t){return this.layer.getSource().getFeatureById(t)}}]),e}(),xw=function(){function e(r){(0,Q.Z)(this,e),this.layer=r;var t=this.layer.getContainer();this.rendererService=t.get(ot.IRendererService)}return(0,j.Z)(e,[{key:"getColorTexture",value:function(t,n){var i=this.getTextureKey(t,n);return this.key===i?this.colorTexture:(this.createColorTexture(t,n),this.key=i,this.colorTexture)}},{key:"createColorTexture",value:function(t,n){var i=this.rendererService.createTexture2D,o=this.getColorRampBar(t,n),s=i({data:new Uint8Array(o.data),width:o.width,height:o.height,flipY:!1});return this.colorTexture=s,s}},{key:"setColorTexture",value:function(t,n,i){this.key=this.getTextureKey(n,i),this.colorTexture=t}},{key:"destroy",value:function(){var t;(t=this.colorTexture)===null||t===void 0||t.destroy()}},{key:"getColorRampBar",value:function(t,n){switch(t.type){case"cat":return $o(t);case"quantize":return Vo(t);case"custom":return Ru(t,n);case"linear":return ha(t,n);default:return Ao(t)}}},{key:"getTextureKey",value:function(t,n){var i;return"".concat(t.colors.join("_"),"_").concat(t==null||(i=t.positions)===null||i===void 0?void 0:i.join("_"),"_").concat(t.type,"_").concat(n==null?void 0:n.join("_"))}}]),e}(),bw=["passes"],Ew=["moduleName","vertexShader","fragmentShader","inject","triangulation","styleOption"],o1,N0,s1;function Sw(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Aw(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}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 o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function Aw(e,r){if(e){if(typeof e=="string")return u1(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return u1(e,r)}}function u1(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t0&&arguments[0]!==void 0?arguments[0]:{};return(0,Q.Z)(this,t),n=r.call(this),(0,B.Z)((0,Fe.Z)(n),"id","".concat(f1++)),(0,B.Z)((0,Fe.Z)(n),"name","".concat(f1)),(0,B.Z)((0,Fe.Z)(n),"visible",!0),(0,B.Z)((0,Fe.Z)(n),"zIndex",0),(0,B.Z)((0,Fe.Z)(n),"inited",!1),(0,B.Z)((0,Fe.Z)(n),"layerModelNeedUpdate",!1),(0,B.Z)((0,Fe.Z)(n),"pickedFeatureID",null),(0,B.Z)((0,Fe.Z)(n),"selectedFeatureID",null),(0,B.Z)((0,Fe.Z)(n),"styleNeedUpdate",!1),(0,B.Z)((0,Fe.Z)(n),"forceRender",!1),(0,B.Z)((0,Fe.Z)(n),"clusterZoom",0),(0,B.Z)((0,Fe.Z)(n),"defaultSourceConfig",{data:[],options:{parser:{type:"json"}}}),(0,B.Z)((0,Fe.Z)(n),"dataState",{dataSourceNeedUpdate:!1,dataMappingNeedUpdate:!1,filterNeedUpdate:!1,featureScaleNeedUpdate:!1,StyleAttrNeedUpdate:!1}),(0,B.Z)((0,Fe.Z)(n),"hooks",{init:new A0,afterInit:new po,beforeRender:new po,beforeRenderData:new ah,afterRender:new xu,beforePickingEncode:new xu,afterPickingEncode:new xu,beforeHighlight:new xu(["pickedColor"]),afterHighlight:new xu,beforeSelect:new xu(["pickedColor"]),afterSelect:new xu,beforeDestroy:new xu,afterDestroy:new xu}),(0,B.Z)((0,Fe.Z)(n),"models",[]),(0,B.Z)((0,Fe.Z)(n),"startInit",!1),(0,B.Z)((0,Fe.Z)(n),"layerChildren",[]),(0,B.Z)((0,Fe.Z)(n),"masks",[]),Ni((0,Fe.Z)(n),"configService",s1,(0,Fe.Z)(n)),(0,B.Z)((0,Fe.Z)(n),"animateOptions",{enable:!1}),(0,B.Z)((0,Fe.Z)(n),"currentPickId",null),(0,B.Z)((0,Fe.Z)(n),"encodeStyleAttribute",{}),(0,B.Z)((0,Fe.Z)(n),"enableShaderEncodeStyles",[]),(0,B.Z)((0,Fe.Z)(n),"enableDataEncodeStyles",[]),(0,B.Z)((0,Fe.Z)(n),"enablg",[]),(0,B.Z)((0,Fe.Z)(n),"pendingStyleAttributes",[]),(0,B.Z)((0,Fe.Z)(n),"scaleOptions",{}),(0,B.Z)((0,Fe.Z)(n),"animateStatus",!1),(0,B.Z)((0,Fe.Z)(n),"isDestroyed",!1),(0,B.Z)((0,Fe.Z)(n),"encodeDataLength",0),(0,B.Z)((0,Fe.Z)(n),"sourceEvent",function(){n.dataState.dataSourceNeedUpdate=!0;var o=n.getLayerConfig();o&&o.autoFit&&n.fitBounds(o.fitBoundsOptions);var s=n.layerSource.getSourceCfg().autoRender;s&&setTimeout(function(){n.reRender()},10)}),n.name=i.name||n.id,n.zIndex=i.zIndex||0,n.rawConfig=i,n}return(0,j.Z)(t,[{key:"addMask",value:function(i){this.masks.push(i),this.enableMask()}},{key:"removeMask",value:function(i){var o=this.masks.indexOf(i);o>-1&&this.masks.splice(o,1)}},{key:"disableMask",value:function(){this.updateLayerConfig({enableMask:!1})}},{key:"enableMask",value:function(){this.updateLayerConfig({enableMask:!0})}},{key:"addMaskLayer",value:function(i){this.masks.push(i)}},{key:"removeMaskLayer",value:function(i){var o=this.masks.indexOf(i);o>-1&&this.masks.splice(o,1),i.destroy()}},{key:"getAttribute",value:function(i){return this.styleAttributeService.getLayerStyleAttribute(i)}},{key:"getLayerConfig",value:function(){return this.configService.getLayerConfig(this.id)}},{key:"updateLayerConfig",value:function(i){var o=this;if(Object.keys(i).map(function(l){l in o.rawConfig&&(o.rawConfig[l]=i[l])}),!this.startInit)this.needUpdateConfig=(0,V.Z)((0,V.Z)({},this.needUpdateConfig),i);else{var s=this.container.get(ot.SceneID);this.configService.setLayerConfig(s,this.id,(0,V.Z)((0,V.Z)((0,V.Z)({},this.configService.getLayerConfig(this.id)),this.needUpdateConfig),i)),this.needUpdateConfig={}}}},{key:"setContainer",value:function(i,o){this.container=i,this.sceneContainer=o}},{key:"getContainer",value:function(){return this.container}},{key:"addPlugin",value:function(i){return this.plugins.push(i),this}},{key:"init",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s=this,l,f,v,y,b,T,M;return ge().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:l=this.container.get(ot.SceneID),this.startInit=!0,this.configService.setLayerConfig(l,this.id,this.rawConfig),this.layerType=this.rawConfig.layerType,this.iconService=this.container.get(ot.IIconService),this.fontService=this.container.get(ot.IFontService),this.rendererService=this.container.get(ot.IRendererService),this.layerService=this.container.get(ot.ILayerService),this.debugService=this.container.get(ot.IDebugService),this.interactionService=this.container.get(ot.IInteractionService),this.pickingService=this.container.get(ot.IPickingService),this.mapService=this.container.get(ot.IMapService),f=this.getLayerConfig(),v=f.enableMultiPassRenderer,y=f.passes,v&&y!==null&&y!==void 0&&y.length&&y.length>0&&this.mapService.on("mapAfterFrameChange",function(){s.renderLayers()}),this.cameraService=this.container.get(ot.ICameraService),this.coordinateService=this.container.get(ot.ICoordinateSystemService),this.shaderModuleService=this.container.get(ot.IShaderModuleService),this.postProcessingPassFactory=this.container.get(ot.IFactoryPostProcessingPass),this.normalPassFactory=this.container.get(ot.IFactoryNormalPass),this.styleAttributeService=this.container.get(ot.IStyleAttributeService),v&&(this.multiPassRenderer=this.container.get(ot.IMultiPassRenderer),this.multiPassRenderer.setLayer(this)),this.pendingStyleAttributes.forEach(function($){var G=$.attributeName,ue=$.attributeField,xe=$.attributeValues,ze=$.updateOptions;s.styleAttributeService.updateStyleAttribute(G,{scale:(0,V.Z)({field:ue},s.splitValuesAndCallbackInAttribute(xe,ue?void 0:s.getLayerConfig()[G]))},ze)}),this.pendingStyleAttributes=[],this.plugins=this.container.getAll(ot.ILayerPlugin),b=Sw(this.plugins);try{for(b.s();!(T=b.n()).done;)M=T.value,M.apply(this,{rendererService:this.rendererService,mapService:this.mapService,styleAttributeService:this.styleAttributeService,normalPassFactory:this.normalPassFactory,postProcessingPassFactory:this.postProcessingPassFactory})}catch($){b.e($)}finally{b.f()}return this.layerPickService=new yw(this),this.textureService=new xw(this),this.log(Rs.LayerInitStart),F.next=31,this.hooks.init.promise();case 31:this.log(Rs.LayerInitEnd),this.inited=!0,this.emit("inited",{target:this,type:"inited"}),this.emit("add",{target:this,type:"add"}),this.hooks.afterInit.call();case 36:case"end":return F.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"log",value:function(i){var o,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"init";if(!(this.tileLayer||this.isTileLayer)){var l="".concat(this.id,".").concat(s,".").concat(i),f={id:this.id,type:this.type};(o=this.debugService)===null||o===void 0||o.log(l,f)}}},{key:"updateModelData",value:function(i){i.attributes&&i.elements?this.models.map(function(o){o.updateAttributesAndElements(i.attributes,i.elements)}):console.warn("data error")}},{key:"setLayerPickService",value:function(i){this.layerPickService=i}},{key:"prepareBuildModel",value:function(){Object.keys(this.needUpdateConfig||{}).length!==0&&this.updateLayerConfig({});var i=this.getLayerConfig(),o=i.animateOption;o!=null&&o.enable&&(this.layerService.startAnimate(),this.animateStatus=!0)}},{key:"color",value:function(i,o,s){return this.updateStyleAttribute("color",i,o,s),this}},{key:"texture",value:function(i,o,s){return this.updateStyleAttribute("texture",i,o,s),this}},{key:"rotate",value:function(i,o,s){return this.updateStyleAttribute("rotate",i,o,s),this}},{key:"size",value:function(i,o,s){return this.updateStyleAttribute("size",i,o,s),this}},{key:"filter",value:function(i,o,s){var l=this.updateStyleAttribute("filter",i,o,s);return this.dataState.dataSourceNeedUpdate=l&&this.inited,this}},{key:"shape",value:function(i,o,s){this.shapeOption={field:i,values:o};var l=this.updateStyleAttribute("shape",i,o,s);return this.dataState.dataSourceNeedUpdate=l&&this.inited,this}},{key:"label",value:function(i,o,s){return this.pendingStyleAttributes.push({attributeName:"label",attributeField:i,attributeValues:o,updateOptions:s}),this}},{key:"animate",value:function(i){var o={};return Su(i)?(o.enable=!0,o=(0,V.Z)((0,V.Z)({},o),i)):o.enable=i,this.updateLayerConfig({animateOption:o}),this}},{key:"source",value:function(i,o){return(i==null?void 0:i.type)==="source"?(this.setSource(i),this):(this.sourceOption={data:i,options:o},this.clusterZoom=0,this)}},{key:"setData",value:function(i,o){var s=this;return this.inited?(this.log(Rs.SourceInitStart,ds.UPDATE),this.layerSource.setData(i,o),this.log(Rs.SourceInitEnd,ds.UPDATE)):this.on("inited",function(){s.log(Rs.SourceInitStart,ds.UPDATE);var l=s.getSource();l?s.layerSource.setData(i,o):s.source(new Xy(i,o)),s.layerSource.once("update",function(){s.log(Rs.SourceInitEnd,ds.UPDATE)})}),this}},{key:"style",value:function(i){var o=this,s=i.passes,l=(0,ka.Z)(i,bw);s&&i1(s).forEach(function(v){var y=o.multiPassRenderer.getPostProcessor().getPostProcessingPassByName(v[0]);y&&y.updateOptions(v[1])}),l.borderColor&&(l.stroke=l.borderColor),l.borderWidth&&(l.strokeWidth=l.borderWidth);var f=l;return Object.keys(l).forEach(function(v){var y=l[v];Array.isArray(y)&&y.length===2&&!c1(y[0])&&!c1(y[1])&&(f[v]={field:y[0],value:y[1]})}),this.encodeStyle(f),this.updateLayerConfig(f),this}},{key:"encodeStyle",value:function(i){var o=this;Object.keys(i).forEach(function(s){[].concat((0,Kt.Z)(o.enableShaderEncodeStyles),(0,Kt.Z)(o.enableDataEncodeStyles)).includes(s)&&Cw(i[s])&&(i[s].field||i[s].value)&&!U0(o.encodeStyleAttribute[s],i[s])?(o.encodeStyleAttribute[s]=i[s],o.updateStyleAttribute(s,i[s].field,i[s].value),o.inited&&(o.dataState.dataMappingNeedUpdate=!0)):o.encodeStyleAttribute[s]&&(delete o.encodeStyleAttribute[s],o.dataState.dataSourceNeedUpdate=!0)})}},{key:"scale",value:function(i,o){var s=(0,V.Z)({},this.scaleOptions);if(Su(i)?this.scaleOptions=(0,V.Z)((0,V.Z)({},this.scaleOptions),i):this.scaleOptions[i]=o,this.styleAttributeService&&!U0(s,this.scaleOptions)){var l=Su(i)?i:(0,B.Z)({},i,o);this.styleAttributeService.updateScaleAttribute(l)}return this}},{key:"renderLayers",value:function(){this.rendering=!0,this.layerService.reRender(),this.rendering=!1}},{key:"render",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.tileLayer?(this.tileLayer.render(),this):(this.layerService.beforeRenderData(this),this.encodeDataLength<=0&&!this.forceRender?this:(this.renderModels(i),this))}},{key:"renderMultiPass",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!(this.encodeDataLength<=0&&!this.forceRender)){l.next=2;break}return l.abrupt("return");case 2:if(!(this.multiPassRenderer&&this.multiPassRenderer.getRenderFlag())){l.next=7;break}return l.next=5,this.multiPassRenderer.render();case 5:l.next=8;break;case 7:this.multiPassRenderer?this.renderModels():this.renderModels();case 8:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"active",value:function(i){var o={};return o.enableHighlight=Su(i)?!0:i,Su(i)?(o.enableHighlight=!0,i.color&&(o.highlightColor=i.color),i.mix&&(o.activeMix=i.mix)):o.enableHighlight=!!i,this.updateLayerConfig(o),this}},{key:"setActive",value:function(i,o){var s=this;if(Su(i)){var l=i.x,f=l===void 0?0:l,v=i.y,y=v===void 0?0:v;this.updateLayerConfig({highlightColor:Su(o)?o.color:this.getLayerConfig().highlightColor,activeMix:Su(o)?o.mix:this.getLayerConfig().activeMix}),this.pick({x:f,y})}else this.updateLayerConfig({pickedFeatureID:i,highlightColor:Su(o)?o.color:this.getLayerConfig().highlightColor,activeMix:Su(o)?o.mix:this.getLayerConfig().activeMix}),this.hooks.beforeHighlight.call(sa(i)).then(function(){setTimeout(function(){s.reRender()},1)})}},{key:"select",value:function(i){var o={};return o.enableSelect=Su(i)?!0:i,Su(i)?(o.enableSelect=!0,i.color&&(o.selectColor=i.color),i.mix&&(o.selectMix=i.mix)):o.enableSelect=!!i,this.updateLayerConfig(o),this}},{key:"setSelect",value:function(i,o){var s=this;if(Su(i)){var l=i.x,f=l===void 0?0:l,v=i.y,y=v===void 0?0:v;this.updateLayerConfig({selectColor:Su(o)?o.color:this.getLayerConfig().selectColor,selectMix:Su(o)?o.mix:this.getLayerConfig().selectMix}),this.pick({x:f,y})}else this.updateLayerConfig({pickedFeatureID:i,selectColor:Su(o)?o.color:this.getLayerConfig().selectColor,selectMix:Su(o)?o.mix:this.getLayerConfig().selectMix}),this.hooks.beforeSelect.call(sa(i)).then(function(){setTimeout(function(){s.reRender()},1)})}},{key:"setBlend",value:function(i){return this.updateLayerConfig({blend:i}),this.reRender(),this}},{key:"show",value:function(){return this.updateLayerConfig({visible:!0}),this.reRender(),this.emit("show"),this}},{key:"hide",value:function(){return this.updateLayerConfig({visible:!1}),this.reRender(),this.emit("hide"),this}},{key:"setIndex",value:function(i){return this.zIndex=i,this.layerService.updateLayerRenderList(),this.layerService.renderLayers(),this}},{key:"setCurrentPickId",value:function(i){this.currentPickId=i}},{key:"getCurrentPickId",value:function(){return this.currentPickId}},{key:"setCurrentSelectedId",value:function(i){this.selectedFeatureID=i}},{key:"getCurrentSelectedId",value:function(){return this.selectedFeatureID}},{key:"isVisible",value:function(){var i=this.mapService.getZoom(),o=this.getLayerConfig(),s=o.visible,l=o.minZoom,f=l===void 0?-1/0:l,v=o.maxZoom,y=v===void 0?1/0:v;return!!s&&i>=f&&i0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.isDestroyed){(i=this.layerModel)===null||i===void 0||i.uniformBuffers.forEach(function(T){T.destroy()}),this.layerChildren.map(function(T){return T.destroy(!1)}),this.layerChildren=[];var y=this.getLayerConfig(),b=y.maskfence;b&&(this.masks.map(function(T){return T.destroy(!1)}),this.masks=[]),this.hooks.beforeDestroy.call(),this.layerSource.off("update",this.sourceEvent),(o=this.multiPassRenderer)===null||o===void 0||o.destroy(),this.textureService.destroy(),this.styleAttributeService.clearAllAttributes(),this.hooks.afterDestroy.call(),(s=this.layerModel)===null||s===void 0||s.clearModels(v),(l=this.tileLayer)===null||l===void 0||l.destroy(),this.models=[],(f=this.debugService)===null||f===void 0||f.removeLog(this.id),this.emit("remove",{target:this,type:"remove"}),this.emit("destroy",{target:this,type:"destroy"}),this.removeAllListeners(),this.isDestroyed=!0}}},{key:"clear",value:function(){this.styleAttributeService.clearAllAttributes()}},{key:"clearModels",value:function(){var i;this.models.forEach(function(o){return o.destroy()}),(i=this.layerModel)===null||i===void 0||i.clearModels(),this.models=[]}},{key:"isDirty",value:function(){return!!(this.styleAttributeService.getLayerStyleAttributes()||[]).filter(function(i){return i.needRescale||i.needRemapping||i.needRegenerateVertices}).length}},{key:"setSource",value:function(i){var o=this;if(this.layerSource&&this.layerSource.off("update",this.sourceEvent),this.layerSource=i,this.clusterZoom=0,this.inited&&this.layerSource.cluster){var s=this.mapService.getZoom();this.layerSource.updateClusterData(s)}this.layerSource.inited&&this.sourceEvent(),this.layerSource.on("update",function(l){var f=l.type;if(o.coordCenter===void 0){var v,y=o.layerSource.center;o.coordCenter=y,(v=o.mapService)!==null&&v!==void 0&&v.setCoordCenter&&o.mapService.setCoordCenter(y)}if(f==="update"){if(o.tileLayer){o.tileLayer.reload();return}o.sourceEvent()}})}},{key:"getSource",value:function(){return this.layerSource}},{key:"getScaleOptions",value:function(){return this.scaleOptions}},{key:"setEncodedData",value:function(i){this.encodedData=i,this.encodeDataLength=i.length}},{key:"getEncodedData",value:function(){return this.encodedData}},{key:"getScale",value:function(i){return this.styleAttributeService.getLayerAttributeScale(i)}},{key:"getLegend",value:function(i){var o,s,l,f=this.styleAttributeService.getLayerStyleAttribute(i),v=(f==null||(o=f.scale)===null||o===void 0?void 0:o.scalers)||[];return{type:(s=v[0].option)===null||s===void 0?void 0:s.type,field:f==null||(l=f.scale)===null||l===void 0?void 0:l.field,items:this.getLegendItems(i)}}},{key:"getLegendItems",value:function(i){var o=this.styleAttributeService.getLayerAttributeScale(i);if(!o)return[];if(o.invertExtent){var s=o.range().map(function(v){return(0,B.Z)({value:o.invertExtent(v)},i,v)});return s}else if(o.ticks){var l=o.ticks().map(function(v){return(0,B.Z)({value:v},i,o(v))});return l}else if(o!=null&&o.domain){var f=o.domain().filter(function(v){return!Rw(v)}).map(function(v){return(0,B.Z)({value:v},i,o(v))});return f}return[]}},{key:"pick",value:function(i){var o=i.x,s=i.y;this.interactionService.triggerHover({x:o,y:s})}},{key:"boxSelect",value:function(i,o){this.pickingService.boxPickLayer(this,i,o)}},{key:"buildLayerModel",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s){var l=this,f,v,y,b,T,M,O,F,$,G,ue,xe;return ge().wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:return f=s.moduleName,v=s.vertexShader,y=s.fragmentShader,b=s.inject,T=s.triangulation,M=s.styleOption,O=(0,ka.Z)(s,Ew),this.shaderModuleService.registerModule(f,{vs:v,fs:y,inject:b}),F=this.shaderModuleService.getModule(f),$=F.vs,G=F.fs,ue=F.uniforms,xe=this.rendererService.createModel,Je.abrupt("return",new Promise(function(ht){var gt=l.styleAttributeService.createAttributesAndIndices(l.encodedData,T,M),Ot=gt.attributes,tr=gt.elements,Ir=gt.count,Er=(0,V.Z)({attributes:Ot,uniforms:ue,fs:G,vs:$,elements:tr,blend:n1[Zs.normal],uniformBuffers:[].concat((0,Kt.Z)(l.layerModel.uniformBuffers),(0,Kt.Z)(l.rendererService.uniformBuffers)),textures:l.layerModel.textures},O);Ir&&(Er.count=Ir);var mn=xe(Er);ht(mn)}));case 5:case"end":return Je.stop()}},o,this)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"createAttributes",value:function(i){var o=i.triangulation,s=this.styleAttributeService.createAttributes(this.encodedData,o),l=s.attributes;return l}},{key:"getTime",value:function(){return this.layerService.clock.getDelta()}},{key:"setAnimateStartTime",value:function(){this.animateStartTime=this.layerService.clock.getElapsedTime()}},{key:"stopAnimate",value:function(){this.animateStatus&&(this.layerService.stopAnimate(),this.animateStatus=!1,this.updateLayerConfig({animateOption:{enable:!1}}))}},{key:"getLayerAnimateTime",value:function(){return this.layerService.clock.getElapsedTime()-this.animateStartTime}},{key:"needPick",value:function(i){var o=this.getLayerConfig(),s=o.enableHighlight,l=s===void 0?!0:s,f=o.enableSelect,v=f===void 0?!0:f,y=this.eventNames().indexOf(i)!==-1||this.eventNames().indexOf("un"+i)!==-1;return(i==="click"||i==="dblclick")&&v&&(y=!0),i==="mousemove"&&(l||this.eventNames().indexOf("mouseenter")!==-1||this.eventNames().indexOf("unmousemove")!==-1||this.eventNames().indexOf("mouseout")!==-1)&&(y=!0),this.isVisible()&&y}},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return l.stop()}},o)}));function i(){return n.apply(this,arguments)}return i}()},{key:"rebuildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.buildModels();case 2:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"renderMulPass",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s){return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,s.render();case 2:case"end":return f.stop()}},o)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"renderModels",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.encodeDataLength<=0&&!this.forceRender?(this.clearModels(),this):(this.hooks.beforeRender.call(),this.models.forEach(function(s){s.draw({uniforms:i.layerModel.getUninforms(),blend:i.layerModel.getBlend(),stencil:i.layerModel.getStencil(o)},(o==null?void 0:o.ispick)||!1)}),this.hooks.afterRender.call(),this)}},{key:"updateStyleAttribute",value:function(i,o,s,l){var f=this.configService.getAttributeConfig(this.id)||{};return U0(f[i],{field:o,values:s})?!1:(["color","size","texture","rotate","filter","label","shape"].indexOf(i)!==-1&&this.configService.setAttributeConfig(this.id,(0,B.Z)({},i,{field:o,values:s})),this.startInit?this.styleAttributeService.updateStyleAttribute(i,{scale:(0,V.Z)({field:o},this.splitValuesAndCallbackInAttribute(s,this.getLayerConfig()[o]))},l):this.pendingStyleAttributes.push({attributeName:i,attributeField:o,attributeValues:s,updateOptions:l}),!0)}},{key:"getLayerAttributeConfig",value:function(){return this.configService.getAttributeConfig(this.id)}},{key:"getShaderPickStat",value:function(){return this.layerService.getShaderPickStat()}},{key:"setEarthTime",value:function(i){console.warn("empty fn")}},{key:"processData",value:function(i){return i}},{key:"getModelType",value:function(){throw new Error("Method not implemented.")}},{key:"getDefaultConfig",value:function(){return{}}},{key:"initLayerModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.models.forEach(function(f){return f.destroy()}),this.models=[],l.next=4,this.layerModel.initModels();case 4:this.models=l.sent;case 5:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"reRender",value:function(){this.inited&&this.layerService.reRender()}},{key:"splitValuesAndCallbackInAttribute",value:function(i){return{values:l1(i)?void 0:i,callback:l1(i)?i:void 0}}}]),t}(io.EventEmitter),s1=ki(N0.prototype,"configService",[o1],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),N0);function Mw(e,r){return{enable:e,mask:255,func:{cmp:R.EQUAL,ref:r?1:0,mask:1}}}function h1(e){return e.maskOperation===Qp.OR?{enable:!0,mask:255,func:{cmp:R.ALWAYS,ref:1,mask:255},opFront:{fail:R.KEEP,zfail:R.REPLACE,zpass:R.REPLACE}}:{enable:!0,mask:255,func:{cmp:e.stencilType===hc.SINGLE||e.stencilIndex===0?R.ALWAYS:R.LESS,ref:e.stencilType===hc.SINGLE?1:e.stencilIndex===0?2:1,mask:255},opFront:{fail:R.KEEP,zfail:R.REPLACE,zpass:R.REPLACE}}}var Iw={opacity:1,stroke:[1,0,0,1],offsets:[0,0],rotation:0,extrusionBase:0,strokeOpacity:1,thetaOffset:.314},yg={opacity:"float",stroke:"vec4",offsets:"vec2",textOffset:"vec2",rotation:"float",extrusionBase:"float",strokeOpacity:"float",thetaOffset:"float"};function hL(e){var r="";return Object.keys(e).forEach(function(t){var n=e[t];Array.isArray(n)?r+="vec".concat(n.length," ").concat(t,`; `):r+="flot ".concat(t,`; `)}),r}function p1(e){return Math.ceil(e/4)*4}var Ms=function(e){return e[e.POSITION=0]="POSITION",e[e.COLOR=1]="COLOR",e[e.VERTEX_ID=2]="VERTEX_ID",e[e.PICKING_COLOR=3]="PICKING_COLOR",e[e.STROKE=4]="STROKE",e[e.OPACITY=5]="OPACITY",e[e.OFFSETS=6]="OFFSETS",e[e.ROTATION=7]="ROTATION",e[e.EXTRUSION_BASE=8]="EXTRUSION_BASE",e[e.SIZE=9]="SIZE",e[e.SHAPE=10]="SHAPE",e[e.EXTRUDE=11]="EXTRUDE",e[e.MAX=12]="MAX",e[e.NORMAL=13]="NORMAL",e}({});function Pw(e){switch(e){case"rotation":return{name:"Rotation",type:dn.Attribute,descriptor:{name:"a_Rotation",shaderLocation:Ms.ROTATION,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(t){var n=t.rotation,i=n===void 0?0:n;return Array.isArray(i)?[i[0]]:[i]}}};case"stroke":return{name:"stroke",type:dn.Attribute,descriptor:{name:"a_Stroke",shaderLocation:Ms.STROKE,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:4,update:function(t){var n=t.stroke,i=n===void 0?[1,1,1,1]:n;return i}}};case"opacity":return{name:"opacity",type:dn.Attribute,descriptor:{name:"a_Opacity",shaderLocation:Ms.OPACITY,buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(t){var n=t.opacity,i=n===void 0?1:n;return[i]}}};case"extrusionBase":return{name:"extrusionBase",type:dn.Attribute,descriptor:{name:"a_ExtrusionBase",shaderLocation:Ms.EXTRUSION_BASE,buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(t){var n=t.extrusionBase,i=n===void 0?0:n;return[i]}}};case"offsets":return{name:"offsets",type:dn.Attribute,descriptor:{name:"a_Offsets",shaderLocation:Ms.OFFSETS,buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(t){var n=t.offsets;return n}}};case"thetaOffset":return{name:"thetaOffset",type:dn.Attribute,descriptor:{name:"a_ThetaOffset",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(t){var n=t.thetaOffset,i=n===void 0?1:n;return[i]}}};default:return}}var d1,z0,v1,m1={opacity:Ms.OPACITY,stroke:Ms.STROKE,offsets:Ms.OFFSETS,rotation:Ms.ROTATION,extrusionBase:Ms.EXTRUSION_BASE},Ma=(d1=F0(ot.IGlobalConfigService),z0=function(){function e(r){(0,Q.Z)(this,e),(0,B.Z)(this,"uniformBuffers",[]),(0,B.Z)(this,"textures",[]),(0,B.Z)(this,"preStyleAttribute",{}),(0,B.Z)(this,"encodeStyleAttribute",{}),Ni(this,"configService",v1,this),this.layer=r,this.rendererService=r.getContainer().get(ot.IRendererService),this.pickingService=r.getContainer().get(ot.IPickingService),this.shaderModuleService=r.getContainer().get(ot.IShaderModuleService),this.styleAttributeService=r.getContainer().get(ot.IStyleAttributeService),this.mapService=r.getContainer().get(ot.IMapService),this.iconService=r.getContainer().get(ot.IIconService),this.fontService=r.getContainer().get(ot.IFontService),this.cameraService=r.getContainer().get(ot.ICameraService),this.layerService=r.getContainer().get(ot.ILayerService),this.registerStyleAttribute(),this.registerBuiltinAttributes(),this.startModelAnimate();var t=this.rendererService.createTexture2D;this.createTexture2D=t}return(0,j.Z)(e,[{key:"getBlend",value:function(){var t=this.layer.getLayerConfig(),n=t.blend,i=n===void 0?"normal":n;return n1[Zs[i]]}},{key:"getStencil",value:function(t){var n=this.layer.getLayerConfig(),i=n.mask,o=i===void 0?!1:i,s=n.maskInside,l=s===void 0?!0:s,f=n.enableMask,v=n.maskOperation,y=v===void 0?Qp.AND:v;if(this.layer.type==="MaskLayer")return h1({isStencil:!0,stencilType:hc.SINGLE});if(t.isStencil)return h1((0,V.Z)((0,V.Z)({},t),{},{maskOperation:y}));var b=o||f&&this.layer.masks.length!==0||this.layer.tileMask!==void 0;return Mw(b,l)}},{key:"getDefaultStyle",value:function(){return{}}},{key:"getUninforms",value:function(){throw new Error("Method not implemented.")}},{key:"getAnimateUniforms",value:function(){return{}}},{key:"needUpdate",value:function(){var r=(0,Pt.Z)(ge().mark(function n(){return ge().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",!1);case 1:case"end":return o.stop()}},n)}));function t(){return r.apply(this,arguments)}return t}()},{key:"buildModels",value:function(){var r=(0,Pt.Z)(ge().mark(function n(){return ge().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return o.stop()}},n)}));function t(){return r.apply(this,arguments)}return t}()},{key:"initModels",value:function(){var r=(0,Pt.Z)(ge().mark(function n(){return ge().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return o.stop()}},n)}));function t(){return r.apply(this,arguments)}return t}()},{key:"clearModels",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0}},{key:"getAttribute",value:function(){throw new Error("Method not implemented.")}},{key:"render",value:function(t){throw new Error("Method not implemented.")}},{key:"registerBuiltinAttributes",value:function(){throw new Error("Method not implemented.")}},{key:"animateOption2Array",value:function(t){return[t.enable?0:1,t.duration||4,t.interval||.2,t.trailLength||.1]}},{key:"startModelAnimate",value:function(){var t=this.layer.getLayerConfig(),n=t.animateOption;n.enable&&this.layer.setAnimateStartTime()}},{key:"getInject",value:function(){var t=this.layer.encodeStyleAttribute,n="",i=[];this.layer.enableShaderEncodeStyles.forEach(function(l){t[l]?n+="#define USE_ATTRIBUTE_".concat(l.toUpperCase(),` 0.0; `):i.push(" ".concat(yg[l]," u_").concat(l,";")),n+=` #ifdef USE_ATTRIBUTE_`.concat(l.toUpperCase(),` layout(location = `).concat(m1[l],") in ").concat(yg[l]," a_").concat(l.charAt(0).toUpperCase()+l.slice(1),`; #endif `)});var o=i.length?` layout(std140) uniform AttributeUniforms { `.concat(i.join(` `),` }; `):"";n+=o;var s="";return this.layer.enableShaderEncodeStyles.forEach(function(l){s+=` #ifdef USE_ATTRIBUTE_`.concat(l.toUpperCase(),` `).concat(yg[l]," ").concat(l," = a_").concat(l.charAt(0).toUpperCase()+l.slice(1),`; #else `).concat(yg[l]," ").concat(l," = u_").concat(l,`; #endif `)}),{"vs:#decl":n,"fs:#decl":o,"vs:#main-start":s}}},{key:"getStyleAttribute",value:function(){var t=this,n={};return this.layer.enableShaderEncodeStyles.forEach(function(i){if(!t.layer.encodeStyleAttribute[i]){var o=t.layer.getLayerConfig()[i],s=typeof o=="undefined"?Iw[i]:o;i==="stroke"&&(s=fi(s)),n["u_"+i]=s}}),n}},{key:"registerStyleAttribute",value:function(){var t=this;Object.keys(this.layer.encodeStyleAttribute).forEach(function(n){var i=Pw(n);i&&(t.styleAttributeService.registerStyleAttribute(i),i.descriptor&&(i.descriptor.shaderLocation=m1[n]))})}},{key:"updateEncodeAttribute",value:function(t,n){this.encodeStyleAttribute[t]=n}},{key:"initUniformsBuffer",value:function(){var t=this.getUniformsBufferInfo(this.getStyleAttribute()),n=this.getCommonUniformsInfo();this.attributeUnifoms=this.rendererService.createBuffer({data:new Float32Array(p1(t.uniformsLength)),isUBO:!0}),this.commonUnifoms=this.rendererService.createBuffer({data:new Float32Array(p1(n.uniformsLength)),isUBO:!0}),this.uniformBuffers=[this.attributeUnifoms,this.commonUnifoms]}},{key:"getUniformsBufferInfo",value:function(t){var n=0,i=[];return Object.values(t).forEach(function(o){Array.isArray(o)?(i.push.apply(i,(0,Kt.Z)(o)),n+=o.length):(i.push(o),n+=1)}),{uniformsOption:t,uniformsLength:n,uniformsArray:i}}},{key:"getCommonUniformsInfo",value:function(){return{uniformsLength:0,uniformsArray:[],uniformsOption:{}}}},{key:"updateStyleUnifoms",value:function(){var t=this.getUniformsBufferInfo(this.getStyleAttribute()),n=t.uniformsArray,i=this.getCommonUniformsInfo(),o=i.uniformsArray;this.attributeUnifoms.subData({offset:0,data:new Uint8Array(new Float32Array(n).buffer)}),this.commonUnifoms.subData({offset:0,data:new Uint8Array(new Float32Array(o).buffer)})}}]),e}(),v1=ki(z0.prototype,"configService",[d1],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),z0),Z0=100,pL=36,dL=40;function g1(e){return e/180*Math.acos(-1)}function _1(e){var r=g1(e[0])+Math.PI/2,t=g1(e[1]),n=Z0+Math.random()*.4,i=n*Math.cos(t)*Math.cos(r),o=n*Math.cos(t)*Math.sin(r),s=n*Math.sin(t);return[o,s,i]}function vL(e,r){var t=mat4.create(),n=mat4.create(),i=vec3.fromValues(0,1,0),o=vec3.fromValues(0,0,0);r=r||{},e=typeof e!="undefined"?e:1;for(var s=typeof r.segments!="undefined"?r.segments:32,l=2+s,f=2*l,v=[],y=[],b=[],T=[],M=[],O=[],F=0;F<=l;F++){for(var $=F/l,G=$*Math.PI,ue=0;ue<=f;ue++){var xe=ue/f,ze=xe*Math.PI*2;mat4.identity(n),mat4.rotateZ(n,n,-G),mat4.identity(t),mat4.rotateY(t,t,ze),vec3.transformMat4(o,i,n),vec3.transformMat4(o,o,t),vec3.scale(o,o,-e),b.push(o.slice()),T.push.apply(T,_toConsumableArray(o.slice())),vec3.normalize(o,o),M.push.apply(M,_toConsumableArray(o.slice())),O.push([xe,1-$]),T.push(xe,1-$)}if(F>0)for(var Je=b.length,ht=Je-2*(f+1);ht+f+20&&arguments[0]!==void 0?arguments[0]:{};(0,Q.Z)(this,e),(0,B.Z)(this,"lastFlip",-1),(0,B.Z)(this,"miter",Or.al(0,0)),(0,B.Z)(this,"started",!1),(0,B.Z)(this,"dash",!1),(0,B.Z)(this,"totalDistance",0),(0,B.Z)(this,"currentIndex",0),this.join=r.join||"miter",this.cap=r.cap||"butt",this.miterLimit=r.miterLimit||10,this.thickness=r.thickness||1,this.dash=r.dash||!1,this.complex={positions:[],indices:[],normals:[],startIndex:0,indexes:[]}}return(0,j.Z)(e,[{key:"simpleExtrude",value:function(t){var n=this.complex;if(t.length<=1)return n;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var i=t.length,o=n.startIndex,s=1;sthis.miterLimit&&(mn=!0)}mn?(M.push(this.normal[0],this.normal[1],0),M.push(Ir[0],Ir[1],0),T.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*Er,o[2]|0),this.complex.indexes.push(this.currentIndex),T.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness*Er,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,b.push.apply(b,(0,Kt.Z)(this.lastFlip!==-Er?[n,n+2,n+3]:[n+2,n+1,n+3])),b.push(n+2,n+3,n+4),Op(xg,Pp),Or.JG(this.normal,xg),M.push(this.normal[0],this.normal[1],0),T.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*Er,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,y+=3):(this.extrusions(T,M,o,Ir,tr,this.totalDistance),b.push.apply(b,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),Er=-1,Or.JG(this.normal,Ir),y+=2),this.lastFlip=Er}else{if(Op(this.normal,Gs),O){var Je=Or.Ue(),ht=Or.Ue();Or.lu(ht,Gs,this.normal),Or.IH(Je,Gs,this.normal),M.push(ht[0],ht[1],0),M.push(Je[0],Je[1],0),T.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),T.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(T,M,o,this.normal,this.thickness,this.totalDistance);b.push.apply(b,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),y+=2}return y}},{key:"segment",value:function(t,n,i,o,s){var l=0,f=t.indices,v=t.positions,y=t.normals,b=this.cap==="square",T=this.join==="bevel",M=Fo([o[0],o[1]]),O=Fo([i[0],i[1]]);cv(Gs,M,O);var F=0;if(this.dash&&(F=this.lineSegmentDistance(M,O),this.totalDistance+=F),this.normal||(this.normal=Or.Ue(),Op(this.normal,Gs)),!this.started)if(this.started=!0,b){var $=Or.Ue(),G=Or.Ue();Or.IH($,this.normal,Gs),Or.IH(G,this.normal,Gs),y.push(G[0],G[1],0),y.push($[0],$[1],0),v.push(i[0],i[1],i[2]|0,this.totalDistance-F,-this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),v.push(i[0],i[1],i[2]|0,this.totalDistance-F,this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(v,y,i,this.normal,this.thickness,this.totalDistance-F);if(f.push(n+0,n+1,n+2),s){var ze=Fo([s[0],s[1]]);j0(M,ze)&&Or.IH(ze,M,Or.Fv(ze,Or.$X(ze,M,O))),cv(Pp,ze,M);var Je=V0(lv,Or.Ue(),Gs,Pp,this.thickness),ht=(0,Sn.Z)(Je,2),gt=ht[0],Ot=ht[1],tr=Or.AK(lv,this.normal)<0?-1:1,Ir=T;if(!Ir&&this.join==="miter"){var Er=gt;Er>this.miterLimit&&(Ir=!0)}Ir?(y.push(this.normal[0],this.normal[1],0),y.push(Ot[0],Ot[1],0),v.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*tr,o[2]|0),this.complex.indexes.push(this.currentIndex),v.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness*tr,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,f.push.apply(f,(0,Kt.Z)(this.lastFlip!==-tr?[n,n+2,n+3]:[n+2,n+1,n+3])),f.push(n+2,n+3,n+4),Op(xg,Pp),Or.JG(this.normal,xg),y.push(this.normal[0],this.normal[1],0),v.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*tr,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,l+=3):(this.extrusions(v,y,o,Ot,gt,this.totalDistance),f.push.apply(f,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),tr=-1,Or.JG(this.normal,Ot),l+=2),this.lastFlip=tr}else{if(Op(this.normal,Gs),b){var ue=Or.Ue(),xe=Or.Ue();Or.lu(xe,Gs,this.normal),Or.IH(ue,Gs,this.normal),y.push(xe[0],xe[1],0),y.push(ue[0],ue[1],0),v.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),v.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(v,y,o,this.normal,this.thickness,this.totalDistance);f.push.apply(f,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),l+=2}return l}},{key:"extrusions",value:function(t,n,i,o,s,l){n.push(o[0],o[1],0),n.push(o[0],o[1],0),t.push(i[0],i[1],i[2]|0,l,-s,i[2]|0),this.complex.indexes.push(this.currentIndex),t.push(i[0],i[1],i[2]|0,l,s,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}},{key:"lineSegmentDistance",value:function(t,n){var i=n[0]-t[0],o=n[1]-t[1];return Math.sqrt(i*i+o*o)}}]),e}(),La=L(68072);function Dw(e){var r=e[0][0],t=e[0][e[0].length-1];r[0]===t[0]&&r[1]===t[1]&&(e[0]=e[0].slice(0,e[0].length-1));for(var n=e[0].length,i=fs().flatten(e),o=i.vertices,s=i.dimensions,l=[],f=[],v=0;v1&&arguments[1]!==void 0?arguments[1]:!1,t=e[0][0],n=e[0][e[0].length-1];t[0]===n[0]&&t[1]===n[1]&&(e[0]=e[0].slice(0,e[0].length-1));for(var i=e[0].length,o=fs().flatten(e),s=o.vertices,l=o.dimensions,f=[],v=[],y=[],b=0;b3&&arguments[3]!==void 0?arguments[3]:!1,i=La.create(),o=La.create(),s=La.create();n&&(e=Bu(e),r=Bu(r),t=Bu(t));var l=La.fromValues.apply(La,(0,Kt.Z)(e)),f=La.fromValues.apply(La,(0,Kt.Z)(r)),v=La.fromValues.apply(La,(0,Kt.Z)(t));La.sub(i,v,f),La.sub(o,l,f),La.cross(s,i,o);var y=La.create();return La.normalize(y,s),y}var Yc,cm=function(e){return e.CYLINDER="cylinder",e.SQUARECOLUMN="squareColumn",e.TRIANGLECOLUMN="triangleColumn",e.HEXAGONCOLUMN="hexagonColumn",e.PENTAGONCOLUMN="pentagonColumn",e}({}),fm=function(e){return e.CIRCLE="circle",e.SQUARE="square",e.TRIANGLE="triangle",e.HEXAGON="hexagon",e.PENTAGON="pentagon",e}({});function hm(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=Math.PI*2/e,n=[],i=0;i1&&arguments[1]!==void 0?arguments[1]:!1;if(bg&&bg[e])return bg[e];var t=fv[e]?fv[e]():fv.cylinder(),n=y1([t],r);return bg[e]=n,n}function xL(e,r){for(var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:3,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=new Float32Array(e.length/t*3),o,s,l,f=vec3.create(),v=vec3.create(),y=vec3.create(),b=0,T=r.length;b 0.0 && v_worldDis < u_cityMinSize) { float r = fract(((v_worldDis/u_cityMinSize) - u_time * u_circleSweepSpeed) * 2.0); gl_FragColor.rgb += r * r * u_circleSweepColor; } gl_FragColor.a *= u_opacity; gl_FragColor = filterColor(gl_FragColor); } `,$w=`precision highp float; #define ambientRatio 0.5 #define diffuseRatio 0.3 #define specularRatio 0.2 attribute vec4 a_Color; attribute vec3 a_Position; attribute vec3 a_Normal; attribute float a_Size; uniform mat4 u_ModelMatrix; attribute vec2 a_Uv; varying vec2 v_texCoord; varying vec4 v_Color; uniform float u_circleSweep; uniform vec2 u_cityCenter; varying float v_worldDis; #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); } `,Yw=function(e){(0,Le.Z)(t,e);var r=Ww(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.baseColor,f=l===void 0?"rgb(16,16,16)":l,v=i.brightColor,y=v===void 0?"rgb(255,176,38)":v,b=i.windowColor,T=b===void 0?"rgb(30,60,89)":b,M=i.time,O=M===void 0?0:M,F=i.sweep,$=F===void 0?{enable:!1,sweepRadius:1,sweepColor:"rgb(255, 255, 255)",sweepSpeed:.4,sweepCenter:this.cityCenter}:F;return{u_cityCenter:$.sweepCenter||this.cityCenter,u_cityMinSize:this.cityMinSize*$.sweepRadius,u_circleSweep:$.enable?1:0,u_circleSweepColor:fi($.sweepColor).slice(0,3),u_circleSweepSpeed:$.sweepSpeed,u_opacity:s,u_baseColor:fi(f),u_brightColor:fi(y),u_windowColor:fi(T),u_time:this.layer.getLayerAnimateTime()||O}}},{key:"calCityGeo",value:function(){var i=(0,Sn.Z)(this.layer.getSource().extent,4),o=i[0],s=i[1],l=i[2],f=i[3];if(this.mapService.version==="GAODE2.x"){this.cityCenter=this.mapService.lngLatToCoord([(l+o)/2,(f+s)/2]);var v=this.mapService.lngLatToCoord([l,f]),y=this.mapService.lngLatToCoord([o,s]);this.cityMinSize=Math.sqrt(Math.pow(v[0]-y[0],2)+Math.pow(v[1]-y[1],2))/4}else{var b=l-o,T=f-s;this.cityCenter=[(l+o)/2,(f+s)/2],this.cityMinSize=Math.sqrt(Math.pow(b,2)+Math.pow(T,2))/4}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.calCityGeo(),this.startModelAnimate(),l.abrupt("return",this.buildModels());case 3:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"cityBuilding",vertexShader:$w,fragmentShader:Xw,triangulation:$0,depth:{enable:!0},cull:{enable:!0,face:R.BACK}});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"normal",type:dn.Attribute,descriptor:{name:"a_Normal",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o,s,l,f,v){return v}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o){var s=o.size,l=s===void 0?10:s;return Array.isArray(l)?[l[0]]:[l]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_Uv",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o,s,l){return[l[3],l[4]]}}})}}]),t}(Ma);function qw(e){var r=Kw();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function Kw(){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(e){return!1}}var Qw=function(e){(0,Le.Z)(t,e);var r=qw(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s 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 = texture2D(u_texture, v_texCoord).r; fh = toBezier(v_intensity, b).y; gl_Position = u_ViewProjectionMatrixUncentered * vec4(position.xy, fh * project_pixel(50.), 1.0); } `,dC=`uniform sampler2D u_texture; // \u70ED\u529B\u5F3A\u5EA6\u56FE uniform sampler2D u_colorTexture; // \u6839\u636E\u5F3A\u5EA6\u5206\u5E03\u7684\u8272\u5E26 uniform float u_opacity; varying vec2 v_texCoord; uniform vec2 u_ViewportSize; float getBlurIndusty() { float vW = 2.0/u_ViewportSize.x; float vH = 2.0/u_ViewportSize.y; vec2 vUv = v_texCoord; float i11 = texture2D( u_texture, vec2( vUv.x - 1.0 * vW, vUv.y + 1.0 * vH) ).r; float i12 = texture2D( u_texture, vec2( vUv.x - 0.0 * vW, vUv.y + 1.0 * vH) ).r; float i13 = texture2D( u_texture, vec2( vUv.x + 1.0 * vW, vUv.y + 1.0 * vH) ).r; float i21 = texture2D( u_texture, vec2( vUv.x - 1.0 * vW, vUv.y) ).r; float i22 = texture2D( u_texture, vec2( vUv.x , vUv.y) ).r; float i23 = texture2D( u_texture, vec2( vUv.x + 1.0 * vW, vUv.y) ).r; float i31 = texture2D( u_texture, vec2( vUv.x - 1.0 * vW, vUv.y-1.0*vH) ).r; float i32 = texture2D( u_texture, vec2( vUv.x - 0.0 * vW, vUv.y-1.0*vH) ).r; float i33 = texture2D( 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 = texture2D(u_texture, v_texCoord).r; float intensity = getBlurIndusty(); vec4 color = texture2D(u_colorTexture, vec2(intensity, 0.0)); gl_FragColor =color; gl_FragColor.a = color.a * smoothstep(0.,0.1,intensity) * u_opacity; } `,vC=`precision highp float; attribute vec3 a_Position; attribute vec2 a_Uv; varying vec2 v_texCoord; void main() { v_texCoord = a_Uv; gl_Position = vec4(a_Position.xy, 0, 1.); } `,mC=`precision highp float; uniform float u_intensity; varying float v_weight; varying vec2 v_extrude; #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); gl_FragColor = vec4(val, 1., 1., 1.); } `,gC=`precision highp float; attribute vec3 a_Position; attribute float a_Size; attribute vec2 a_Dir; uniform float u_intensity; uniform float u_radius; varying vec2 v_extrude; varying float v_weight; uniform mat4 u_ModelMatrix; #define GAUSS_COEF 0.3989422804014327 #pragma include "projection" void main(){ 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)); } } `,_C=oi.isEqual,I1=(R1=(0,yt.b2)(),R1(M1=function(e){(0,Le.Z)(t,e);var r=cC(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"render",value:function(i){var o=this,s=this.rendererService,l=s.clear,f=s.useFramebuffer,v=this.layer.getLayerConfig(),y=v.rampColors;f(this.heatmapFramerBuffer,function(){l({color:[0,0,0,0],depth:1,stencil:0,framebuffer:o.heatmapFramerBuffer}),o.drawIntensityMode()}),_C(this.preRampColors,y)||this.updateColorTexture(),this.shapeType==="heatmap"?this.drawColorMode(i):this.draw3DHeatMap(i)}},{key:"getUninforms",value:function(){throw new Error("Method not implemented.")}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b,T,M,O,F;return ge().wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return l=this.rendererService,f=l.createFramebuffer,v=l.getViewportSize,y=l.createTexture2D,b=this.styleAttributeService.getLayerStyleAttribute("shape"),T=(b==null||(s=b.scale)===null||s===void 0?void 0:s.field)||"heatmap",this.shapeType=T,G.next=6,this.buildHeatMapIntensity();case 6:return this.intensityModel=G.sent,this.colorModel=T==="heatmap"?this.buildHeatmapColor():this.build3dHeatMap(),M=v(),O=M.width,F=M.height,this.heatmapFramerBuffer=f({color:y({width:Math.floor(O/4),height:Math.floor(F/4),wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE,min:R.LINEAR,mag:R.LINEAR}),depth:!1}),this.updateColorTexture(),G.abrupt("return",[this.intensityModel,this.colorModel]);case 12:case"end":return G.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.initModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"dir",type:dn.Attribute,descriptor:{name:"a_Dir",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o,s,l){return[l[3],l[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o){var s=o.size,l=s===void 0?1:s;return[l]}}})}},{key:"buildHeatMapIntensity",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.layer.triangulation=C1,f.next=3,this.layer.buildLayerModel({moduleName:"heatmapIntensity",vertexShader:gC,fragmentShader:mC,triangulation:C1,depth:{enable:!1},cull:{enable:!0,face:ea(this.mapService.version)}});case 3:return s=f.sent,f.abrupt("return",s);case 5:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildHeatmapColor",value:function(){this.shaderModuleService.registerModule("heatmapColor",{vs:vC,fs:dC});var i=this.shaderModuleService.getModule("heatmapColor"),o=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService,v=f.createAttribute,y=f.createElements,b=f.createBuffer,T=f.createModel;return T({vs:o,fs:s,attributes:{a_Position:v({buffer:b({data:[-1,1,0,1,1,0,-1,-1,0,1,-1,0],type:R.FLOAT}),size:3}),a_Uv:v({buffer:b({data:[0,1,1,1,0,0,1,0],type:R.FLOAT}),size:2})},uniforms:(0,V.Z)({},l),depth:{enable:!1},elements:y({data:[0,2,1,2,3,1],type:R.UNSIGNED_INT,count:6})})}},{key:"drawIntensityMode",value:function(){var i,o=this.layer.getLayerConfig(),s=o.opacity,l=o.intensity,f=l===void 0?10:l,v=o.radius,y=v===void 0?5:v;this.layerService.beforeRenderData(this.layer),this.layer.hooks.beforeRender.call(),(i=this.intensityModel)===null||i===void 0||i.draw({uniforms:{u_opacity:s||1,u_radius:y,u_intensity:f},blend:{enable:!0,func:{srcRGB:R.ONE,srcAlpha:1,dstRGB:R.ONE,dstAlpha:1}},stencil:{enable:!1,mask:255,func:{cmp:514,ref:1,mask:255}}}),this.layer.hooks.afterRender.call()}},{key:"drawColorMode",value:function(i){var o,s=this.layer.getLayerConfig(),l=s.opacity;(o=this.colorModel)===null||o===void 0||o.draw({uniforms:{u_opacity:l||1,u_colorTexture:this.colorTexture,u_texture:this.heatmapFramerBuffer},blend:this.getBlend(),stencil:this.getStencil(i)})}},{key:"draw3DHeatMap",value:function(i){var o,s=this.layer.getLayerConfig(),l=s.opacity,f=me.create();me.invert(f,this.cameraService.getViewProjectionMatrixUncentered()),(o=this.colorModel)===null||o===void 0||o.draw({uniforms:{u_opacity:l||1,u_colorTexture:this.colorTexture,u_texture:this.heatmapFramerBuffer,u_ViewProjectionMatrixUncentered:this.cameraService.getViewProjectionMatrixUncentered(),u_InverseViewProjectionMatrix:(0,Kt.Z)(f)},blend:{enable:!0,func:{srcRGB:R.SRC_ALPHA,srcAlpha:1,dstRGB:R.ONE_MINUS_SRC_ALPHA,dstAlpha:1}},stencil:this.getStencil(i)})}},{key:"build3dHeatMap",value:function(){var i=this.rendererService.getViewportSize,o=i(),s=o.width,l=o.height,f=lC(s/4,l/4);this.shaderModuleService.registerModule("heatmap3dColor",{vs:pC,fs:hC});var v=this.shaderModuleService.getModule("heatmap3dColor"),y=v.vs,b=v.fs,T=v.uniforms,M=this.rendererService,O=M.createAttribute,F=M.createElements,$=M.createBuffer,G=M.createModel;return G({vs:y,fs:b,attributes:{a_Position:O({buffer:$({data:f.vertices,type:R.FLOAT}),size:3}),a_Uv:O({buffer:$({data:f.uvs,type:R.FLOAT}),size:2})},primitive:R.TRIANGLES,uniforms:(0,V.Z)({},T),depth:{enable:!0},blend:{enable:!0,func:{srcRGB:R.SRC_ALPHA,srcAlpha:1,dstRGB:R.ONE_MINUS_SRC_ALPHA,dstAlpha:1}},elements:F({data:f.indices,type:R.UNSIGNED_INT,count:f.indices.length})})}},{key:"updateStyle",value:function(){this.updateColorTexture()}},{key:"updateColorTexture",value:function(){var i=this.rendererService.createTexture2D;this.texture&&this.texture.destroy();var o=this.layer.getLayerConfig(),s=o.rampColors,l=Ao(s);this.colorTexture=i({data:new Uint8Array(l.data),width:l.width,height:l.height,wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE,min:R.NEAREST,mag:R.NEAREST,flipY:!1}),this.preRampColors=s}}]),t}(Ma))||M1);function yC(e){var r=xC();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function xC(){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(e){return!1}}var bC=`precision highp float; varying vec4 v_color; uniform float u_opacity: 1; #pragma include "picking" void main() { gl_FragColor = v_color; gl_FragColor.a *= u_opacity; gl_FragColor = filterColor(gl_FragColor); } `,EC=`precision highp float; // \u591A\u8FB9\u5F62\u9876\u70B9\u5750\u6807 attribute vec3 a_Position; // \u591A\u8FB9\u5F62\u7ECF\u7EAC\u5EA6\u5750\u6807 attribute vec3 a_Pos; attribute float a_Size; attribute vec4 a_Color; uniform vec2 u_radius; uniform float u_coverage: 0.9; uniform float u_angle: 0; uniform mat4 u_ModelMatrix; varying vec4 v_color; uniform vec2 u_sceneCenterMercator; #pragma include "projection" #pragma include "project" #pragma include "picking" void main() { v_color = a_Color; 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); } `,SC=function(e){(0,Le.Z)(t,e);var r=yC(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=i.coverage,l=i.angle;return{u_opacity:o||1,u_coverage:s||.9,u_angle:l||0,u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset]}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"heatmapHexagon",vertexShader:EC,fragmentShader:bC,triangulation:w1,depth:{enable:!1},primitive:R.TRIANGLES});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"pos",type:dn.Attribute,descriptor:{name:"a_Pos",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o){var s=o.version==="GAODE2.x"?o.originCoordinates:o.coordinates;return[s[0],s[1],0]}}})}}]),t}(Ma),AC={heatmap:I1,heatmap3d:I1,grid:nC,grid3d:uC,hexagon:SC},TC=AC;function wC(e){var r=CC();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function CC(){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(e){return!1}}var RC=function(e){(0,Le.Z)(t,e);var r=wC(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s0&&arguments[0]!==void 0?arguments[0]:{},s=this.getModelType();return s==="heatmap"?(this.layerModel&&this.layerModel.render(o),this):this.encodeDataLength<=0&&!this.forceRender?this:(this.hooks.beforeRender.call(),this.models.forEach(function(l){return l.draw({uniforms:i.layerModel.getUninforms(),blend:i.layerModel.getBlend(),stencil:i.layerModel.getStencil(o)})}),this.hooks.afterRender.call(),this)}},{key:"updateModelData",value:function(i){i.attributes&&i.elements?this.models[0].updateAttributesAndElements(i.attributes,i.elements):console.warn("data error")}},{key:"getModelType",value:function(){var i,o=this.styleAttributeService.getLayerStyleAttribute("shape"),s=this.getLayerConfig(),l=s.shape3d,f=this.getSource(),v=f.data.type,y=(o==null||(i=o.scale)===null||i===void 0?void 0:i.field)||"heatmap";return y==="heatmap"||y==="heatmap3d"?"heatmap":v==="hexagon"?(l==null?void 0:l.indexOf(y))===-1?"hexagon":"grid3d":v==="grid"?(l==null?void 0:l.indexOf(y))===-1?"grid":"grid3d":"heatmap"}}]),t}(Ip);function MC(e){var r=IC();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function IC(){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(e){return!1}}var PC=`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; if(gl_FragColor.a < 0.01) discard; } `,OC=`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)); } `,DC=function(e){(0,Le.Z)(t,e);var r=MC(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity;return{u_opacity:o||1,u_texture:this.texture}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.layer.getSource(),l=this.rendererService.createTexture2D,this.texture=l({height:0,width:0}),b.next=5,s.data.images;case 5:return f=b.sent,this.texture=l({data:f[0],width:f[0].width,height:f[0].height,mag:R.LINEAR,min:R.LINEAR}),b.next=9,this.layer.buildLayerModel({moduleName:"rasterImage",vertexShader:OC,fragmentShader:PC,triangulation:Sg,primitive:R.TRIANGLES,blend:{enable:!0},depth:{enable:!1}});case 9:return v=b.sent,b.abrupt("return",[v]);case 11:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy()}},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.initModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_Uv",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o,s,l){return[l[3],l[4]]}}})}}]),t}(Ma),FC={image:DC},kC=FC;function BC(e){var r=LC();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function LC(){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(e){return!1}}var P1=function(e){(0,Le.Z)(t,e);var r=BC(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) { flag = 1.; }; gl_FragColor.a *=flag; gl_FragColor = filterColor(gl_FragColor); }`,ZC=` attribute vec4 a_Color; attribute vec3 a_Position; attribute vec4 a_Instance; attribute float a_Size; uniform mat4 u_ModelMatrix; uniform float segmentNumber; varying vec4 v_color; uniform vec4 u_dash_array: [10.0, 5., 0, 0]; uniform float u_lineDir: 1.0; varying vec4 v_dash_array; varying 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 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() { v_color = vec4(a_Color.xyz, a_Color.w * 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); float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0)); float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir); 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; 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)); gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + offset, 0, 1.0)); gl_PointSize = 5.0; setPickingColor(a_PickingColor); } `,VC=` #define Animate 0.0 #define LineTexture 1.0 uniform float u_textureBlend; uniform float u_blur : 0.9; uniform float u_line_type: 0.0; // varying vec2 v_normal; varying vec4 v_dash_array; varying vec4 v_color; uniform float u_time; uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; uniform float u_line_texture; uniform sampler2D u_texture; uniform vec2 u_textSize; uniform float segmentNumber; varying vec2 v_iconMapUV; varying vec4 v_lineData; #pragma include "picking" void main() { float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6 gl_FragColor = 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); gl_FragColor.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 = texture2D(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; gl_FragColor = filterColor(gl_FragColor + pattern); } else { // replace pattern.a *= v_color.a; if(gl_FragColor.a <= 0.0) { pattern.a = 0.0; } gl_FragColor = filterColor(pattern); } } else { gl_FragColor = filterColor(gl_FragColor); } }`,jC=`#define Animate 0.0 #define LineTexture 1.0 attribute vec4 a_Color; attribute vec3 a_Position; attribute vec4 a_Instance; attribute float a_Size; uniform mat4 u_ModelMatrix; uniform float segmentNumber; uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; varying vec4 v_color; uniform float u_lineDir: 1.0; uniform float u_icon_step: 100; uniform float u_line_texture: 0.0; attribute vec2 a_iconMapUV; varying vec2 v_iconMapUV; varying vec4 v_lineData; varying vec2 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() { 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); 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); } `,HC=`varying vec4 v_color; #pragma include "picking" void main() { // \u5F53\u524D\u9876\u70B9\u5728\u5F27\u7EBF\u4E2D\u6240\u5904\u7684\u5206\u6BB5\u4F4D\u7F6E gl_FragColor = v_color; gl_FragColor = filterColor(gl_FragColor); }`,WC=` attribute vec4 a_Color; attribute vec3 a_Position; attribute vec4 a_Instance; attribute float a_Size; uniform mat4 u_ModelMatrix; uniform float segmentNumber; varying vec4 v_color; varying float v_segmentIndex; uniform float u_lineDir: 1.0; uniform vec4 u_sourceColor; uniform vec4 u_targetColor; #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) { return smoothstep(0.0, 1.0, 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() { v_color = a_Color; vec2 source = a_Instance.rg; // \u8D77\u59CB\u70B9 vec2 target = a_Instance.ba; // \u7EC8\u70B9 float segmentIndex = a_Position.x; float segmentRatio = getSegmentRatio(segmentIndex); float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0)); float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir); float 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)); // v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y); //unProjCustomCoord 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_color = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber); v_color.a *= opacity; gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + offset, 0, 1.0)); setPickingColor(a_PickingColor); } `,GC={solid:0,dash:1},AL=oi.isNumber,XC=function(e){(0,Le.Z)(t,e);var r=NC(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) { flag = 1.; } gl_FragColor.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); gl_FragColor.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 = texture2D(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; gl_FragColor = filterColor(gl_FragColor + pattern); } else { // replace pattern.a *= v_color.a; if(gl_FragColor.a <= 0.0) { pattern.a = 0.0; discard; } else { gl_FragColor = filterColor(pattern); } } } else { gl_FragColor = filterColor(gl_FragColor); } } `,KC=`#define LineTypeSolid 0.0 #define LineTypeDash 1.0 #define Animate 0.0 #define LineTexture 1.0 attribute vec3 a_Position; attribute vec4 a_Instance; attribute vec4 a_Color; attribute float a_Size; uniform float u_globel; uniform float u_globel_radius; uniform float u_global_height: 10; uniform mat4 u_ModelMatrix; uniform float segmentNumber; uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; varying vec4 v_color; uniform float u_line_type: 0.0; uniform vec4 u_dash_array: [10.0, 5., 0, 0]; varying vec4 v_dash_array; uniform float u_icon_step: 100; uniform float u_line_texture: 0.0; varying float v_segmentIndex; attribute vec2 a_iconMapUV; varying vec2 v_iconMapUV; varying 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() { 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); } `,QC=` #define Animate 0.0 uniform float u_time; uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; varying vec4 v_Color; varying float v_distance_ratio; #pragma include "picking" void main() { float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6 gl_FragColor = v_Color; 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); alpha = clamp(alpha, 0.0, 1.0); gl_FragColor.a *= alpha; // u_animate // x enable // y duration // z interval // w trailLength } gl_FragColor = filterColor(gl_FragColor); } `,JC=`#define LineTypeSolid 0.0 #define LineTypeDash 1.0 #define Animate 0.0 #define LineTexture 1.0 attribute vec3 a_Position; attribute vec4 a_Instance; attribute vec4 a_Color; attribute float a_Size; attribute vec2 a_iconMapUV; uniform float u_globel; uniform float u_globel_radius; uniform float u_global_height: 10; uniform mat4 u_ModelMatrix; uniform float segmentNumber; uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; uniform vec4 u_sourceColor; uniform vec4 u_targetColor; uniform float u_line_type: 0.0; uniform vec4 u_dash_array: [10.0, 5., 0, 0]; uniform float u_icon_step: 100; uniform float u_line_texture: 0.0; varying float v_distance_ratio; varying vec4 v_dash_array; varying vec4 v_color; varying vec2 v_iconMapUV; varying vec4 v_Color; #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() { // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97 v_color = a_Color; 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; // float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI; 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) { v_distance_ratio = segmentIndex / segmentNumber; } 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); float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6 v_Color = mix(u_sourceColor, u_targetColor, a_Position.x/segmentNumber); v_Color.a *= opacity; gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + project_pixel(offset), curr.z, 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); } `,e3={solid:0,dash:1},t3=function(e){(0,Le.Z)(t,e);var r=$C(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) { flag = 1.; } gl_FragColor.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); gl_FragColor.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 = texture2D(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; gl_FragColor = filterColor(gl_FragColor + pattern); } else { // replace pattern.a *= v_color.a; if(gl_FragColor.a <= 0.0) { pattern.a = 0.0; discard; } else { gl_FragColor = filterColor(pattern); } } } else { gl_FragColor = filterColor(gl_FragColor); } } `,a3=`#define LineTypeSolid 0.0 #define LineTypeDash 1.0 #define Animate 0.0 #define LineTexture 1.0 attribute vec3 a_Position; attribute vec4 a_Instance; attribute vec4 a_Color; attribute float a_Size; uniform float u_globel; uniform float u_globel_radius; uniform float u_global_height: 10; uniform mat4 u_ModelMatrix; uniform float segmentNumber; uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; varying vec4 v_color; uniform float u_line_type: 0.0; uniform vec4 u_dash_array: [10.0, 5., 0, 0]; varying vec4 v_dash_array; uniform float u_icon_step: 100; uniform float u_line_texture: 0.0; varying float v_segmentIndex; attribute vec2 a_iconMapUV; varying vec2 v_iconMapUV; varying 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() { 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); } `,o3=` #define Animate 0.0 uniform float u_time; uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; varying vec4 v_Color; varying float v_distance_ratio; #pragma include "picking" void main() { float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6 gl_FragColor = v_Color; 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); alpha = clamp(alpha, 0.0, 1.0); gl_FragColor.a *= alpha; // u_animate // x enable // y duration // z interval // w trailLength } gl_FragColor = filterColor(gl_FragColor); } `,s3=`#define LineTypeSolid 0.0 #define LineTypeDash 1.0 #define Animate 0.0 #define LineTexture 1.0 attribute vec3 a_Position; attribute vec4 a_Instance; attribute vec4 a_Color; attribute float a_Size; attribute vec2 a_iconMapUV; uniform float u_globel; uniform float u_globel_radius; uniform float u_global_height: 10; uniform mat4 u_ModelMatrix; uniform float segmentNumber; uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; uniform vec4 u_sourceColor; uniform vec4 u_targetColor; uniform float u_line_type: 0.0; uniform vec4 u_dash_array: [10.0, 5., 0, 0]; uniform float u_icon_step: 100; uniform float u_line_texture: 0.0; varying float v_distance_ratio; varying vec4 v_dash_array; varying vec4 v_color; varying vec2 v_iconMapUV; varying vec4 v_Color; #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() { // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97 v_color = a_Color; 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; // float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI; 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) { v_distance_ratio = segmentIndex / segmentNumber; } 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); float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6 v_Color = mix(u_sourceColor, u_targetColor, a_Position.x/segmentNumber); v_Color.a *= opacity; gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + project_pixel(offset), curr.z, 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); } `,u3={solid:0,dash:1},l3=function(e){(0,Le.Z)(t,e);var r=r3(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s1&&arguments[1]!==void 0?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0,n=(0,cl.Z)(t.source)==="object"?t.source.type:t.source,i=(0,cl.Z)(t.target)==="object"?t.target.type:t.target,o=(0,cl.Z)(t.source)==="object"?t.source:{},s=o.width,l=s===void 0?n?O1[n]:0:s,f=o.height,v=f===void 0?2:f,y=(0,cl.Z)(t.target)==="object"?t.target:{},b=y.width,T=b===void 0?i?O1[i]:0:b,M=y.height,O=M===void 0?2:M;return{vertices:[0,Hl,1*l].concat((0,Kt.Z)(e),[1,Hl,-1*T],(0,Kt.Z)(e),[1,-Hl,-1*T],(0,Kt.Z)(e),[0,-Hl,1*l],(0,Kt.Z)(e),[0,Hl,1*l],(0,Kt.Z)(e),[1,Hl,-1*T],(0,Kt.Z)(e),[1,-Hl,-1*T],(0,Kt.Z)(e),[0,-Hl,1*l],(0,Kt.Z)(e)),outLineIndices:[0,1,2,0,2,3].map(function(F){return F+r}),indices:[4,5,6,4,6,7].map(function(F){return F+r}),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 D1(e,r){var t=(0,cl.Z)(e)==="object"?e.type:e,n=r==="source"?1:-1,i=(0,cl.Z)(e)==="object"?e:{};switch(t){case"circle":return m3(n,i);case"triangle":return f3(n,i);case"diamond":return p3(n,i);case"rect":return h3(n,i);case"classic":return v3(n,i);case"halfTriangle":return c3(n,i);default:return{vertices:[],indices:[],normals:[],dimensions:2,outLineIndices:[],outLineNormals:[]}}}function _3(e){var r=e.coordinates.flat(),t=1,n=1;return{vertices:[1,0,0].concat((0,Kt.Z)(r),[1,2,-3],(0,Kt.Z)(r),[1,1,-3],(0,Kt.Z)(r),[0,1,0],(0,Kt.Z)(r),[0,0,0],(0,Kt.Z)(r),[1,0,0],(0,Kt.Z)(r),[1,2,-3],(0,Kt.Z)(r),[1,1,-3],(0,Kt.Z)(r),[0,1,0],(0,Kt.Z)(r),[0,0,0],(0,Kt.Z)(r)),normals:[-t,2*n,1,2*n,-n,1,n,-n,1,n,-n,1,-t,-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 y3(e,r){return r?x3(e,r):_3(e)}function x3(e,r){var t=e.coordinates.flat(),n=r,i=n.target,o=i===void 0?"classic":i,s=n.source,l=s===void 0?"circle":s,f=F1(D1(l,"source"),t,0,0),v=g3(t,f.vertices.length/7,r),y=F1(D1(o,"target"),t,1,f.vertices.length/7+v.vertices.length/7),b={vertices:[].concat((0,Kt.Z)(f.vertices),(0,Kt.Z)(v.vertices),(0,Kt.Z)(y.vertices)),indices:[].concat((0,Kt.Z)(f.outLineIndices),(0,Kt.Z)(v.outLineIndices),(0,Kt.Z)(y.outLineIndices),(0,Kt.Z)(f.indices),(0,Kt.Z)(v.indices),(0,Kt.Z)(y.indices)),normals:[].concat((0,Kt.Z)(f.normals),(0,Kt.Z)(v.normals),(0,Kt.Z)(y.normals)),size:7};return b}function F1(e,r){for(var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=[],o=e.vertices,s=e.indices,l=e.dimensions,f=e.outLineIndices,v=0;v (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); gl_FragColor.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 = gl_FragColor.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 = texture2D(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; gl_FragColor = filterColor(gl_FragColor + pattern); } else { // replace pattern.a *= v_color.a; if(gl_FragColor.a <= 0.0) { pattern.a = 0.0; } gl_FragColor = filterColor(pattern); } } else { gl_FragColor = filterColor(gl_FragColor); } // gl_FragColor = filterColor(gl_FragColor); }`,M3=`#define LineTypeSolid 0.0 #define LineTypeDash 1.0 #define Animate 0.0 #define LineTexture 1.0 attribute vec4 a_Color; attribute vec3 a_Position; attribute vec4 a_Instance; attribute float a_Size; uniform mat4 u_ModelMatrix; uniform float segmentNumber; uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; varying vec4 v_color; varying float v_distance_ratio; uniform float u_line_type: 0.0; uniform vec4 u_dash_array: [10.0, 5., 0, 0]; varying vec4 v_dash_array; uniform float u_icon_step: 100; uniform float u_line_texture: 0.0; attribute vec2 a_iconMapUV; varying vec2 v_iconMapUV; varying 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 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); } `,I3={solid:0,dash:1},P3=function(e){(0,Le.Z)(t,e);var r=w3(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s (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; }; gl_FragColor = filterColor(gl_FragColor); } `,B3=`#define LineTypeSolid 0.0 #define LineTypeDash 1.0 #define Animate 0.0 attribute float a_Miter; attribute vec4 a_Color; attribute vec2 a_Size; attribute vec3 a_Normal; attribute vec3 a_Position; attribute vec2 a_iconMapUV; // dash line attribute float a_Total_Distance; attribute vec2 a_DistanceAndIndex; uniform float u_raisingHeight: 0.0; uniform float u_heightfixed: 0.0; uniform mat4 u_ModelMatrix; uniform vec4 u_dash_array: [10.0, 5., 0, 0]; uniform float u_vertexScale: 1.0; #pragma include "projection" #pragma include "picking" varying vec4 v_color; varying vec4 v_dash_array; varying float v_d_distance_ratio; void main() { v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance; v_color = vec4(a_Color.xyz, a_Color.w * opacity); vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal); vec2 offset = project_pixel(size.xy); v_d_distance_ratio = a_DistanceAndIndex.x / a_Total_Distance; 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 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 { // mapbox - amap // \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); } `,L3=`#extension GL_OES_standard_derivatives : enable #define Animate 0.0 #define LineTexture 1.0 uniform float u_textureBlend; uniform float u_strokeWidth: 0.0; uniform vec3 u_blur; varying vec4 v_color; varying vec4 v_stroke; // line texture uniform float u_line_texture; uniform sampler2D u_texture; uniform vec2 u_textSize; varying vec2 v_iconMapUV; varying vec4 v_texture_data; #pragma include "picking" uniform float u_time; uniform vec4 u_animate: [ 1, 2., 1.0, 0.2 ]; // \u63A7\u5236\u8FD0\u52A8 // [animate, duration, interval, trailLength], void main() { 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 gl_FragColor = 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); gl_FragColor.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 = texture2D(u_texture, uv); if(u_textureBlend == 0.0) { // normal pattern.a = 0.0; gl_FragColor += pattern; } else { // replace pattern.a *= v_color.a; if(gl_FragColor.a <= 0.0) { pattern.a = 0.0; } gl_FragColor = 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); gl_FragColor.rgb = mix(gl_FragColor.rgb, v_stroke.rgb, linear); } else if(v <= strokeWidth) { float linear = smoothstep(0.0, 1.0, v/strokeWidth); gl_FragColor.rgb = mix(v_stroke.rgb, gl_FragColor.rgb, linear); } } if(v < borderOuterWidth) { gl_FragColor.a = mix(0.0, gl_FragColor.a, v/borderOuterWidth); } else if(v > 1.0 - borderOuterWidth) { gl_FragColor.a = mix(gl_FragColor.a, 0.0, (v - (1.0 - borderOuterWidth))/borderOuterWidth); } } // blur float blurV = v_texture_data.a; if(blurV < 0.5) { gl_FragColor.a *= mix(u_blur.r, u_blur.g, blurV/0.5); } else { gl_FragColor.a *= mix(u_blur.g, u_blur.b, (blurV - 0.5)/0.5); } gl_FragColor = filterColor(gl_FragColor); } `,k1=` #define Animate 0.0 attribute float a_Miter; attribute vec4 a_Color; attribute vec2 a_Size; attribute vec3 a_Normal; attribute vec3 a_Position; attribute vec2 a_iconMapUV; // dash line attribute float a_Total_Distance; attribute vec2 a_DistanceAndIndex; uniform mat4 u_ModelMatrix; uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; uniform float u_icon_step: 100; uniform float u_heightfixed: 0.0; uniform float u_vertexScale: 1.0; uniform float u_raisingHeight: 0.0; #pragma include "projection" #pragma include "picking" varying vec4 v_color; varying vec4 v_stroke; // texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09 varying vec2 v_iconMapUV; uniform float u_linearColor: 0; uniform float u_arrow: 0.0; uniform float u_arrowHeight: 3.0; uniform float u_arrowWidth: 2.0; uniform float u_tailWidth: 1.0; varying vec4 v_texture_data; vec2 calculateArrow(vec2 offset) { /* * \u5728\u652F\u6301\u7BAD\u5934\u7684\u65F6\u5019\uFF0C\u7B2C\u4E8C\u3001\u7B2C\u4E09\u7EC4\u9876\u70B9\u662F\u989D\u5916\u63D2\u5165\u7528\u4E8E\u6784\u5EFA\u9876\u70B9\u7684 */ float arrowFlag = -1.0; if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // \u9AD8\u5FB7 2.0 \u7684\u65CB\u8F6C\u89D2\u5EA6\u4E0D\u540C arrowFlag = 1.0; } float pi = arrowFlag * 3.1415926/2.; if(a_Miter < 0.) { // \u6839\u636E\u7EBF\u7684\u4E24\u4FA7\u504F\u79FB\u4E0D\u540C\u3001\u65CB\u8F6C\u7684\u65B9\u5411\u76F8\u53CD pi = -pi; } highp float angle_sin = sin(pi); highp float angle_cos = cos(pi); // \u8BA1\u7B97\u5782\u76F4\u4E0E\u7EBF\u65B9\u5411\u7684\u65CB\u8F6C\u77E9\u9635 mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos); float arrowWidth = u_arrowWidth; float arrowHeight = u_arrowHeight; vec2 arrowOffset = vec2(0.0); /* * a_DistanceAndIndex.y \u7528\u4E8E\u6807\u8BB0\u5F53\u524D\u9876\u70B9\u5C5E\u4E8E\u54EA\u4E00\u7EC4\uFF08\u4E24\u4E2A\u9876\u70B9\u4E00\u7EC4\uFF0C\u6784\u6210\u7EBF\u7684\u5176\u5B9E\u662F\u77E9\u5F62\uFF0C\u6700\u7B80\u9700\u8981\u56DB\u4E2A\u9876\u70B9\u3001\u4E24\u7EC4\u9876\u70B9\u6784\u6210\uFF09 */ if(a_DistanceAndIndex.y == 0.0) { // \u7BAD\u5934\u5C16\u90E8 offset = vec2(0.0); } else if(a_DistanceAndIndex.y == 1.0) { // \u7BAD\u5934\u4E24\u4FA7 arrowOffset = rotation_matrix*(offset * arrowHeight); offset += arrowOffset; // \u6CBF\u7EBF\u504F\u79FB offset = offset * arrowWidth; // \u5782\u76F4\u7EBF\u5411\u5916\u504F\u79FB\uFF08\u662F\u6784\u5EFA\u7BAD\u5934\u4E24\u4FA7\u7684\u9876\u70B9\uFF09 } else if(a_DistanceAndIndex.y == 2.0 || a_DistanceAndIndex.y == 3.0 || a_DistanceAndIndex.y == 4.0) { // \u504F\u79FB\u5176\u4F59\u7684\u70B9\u4F4D\uFF08\u5C06\u957F\u5EA6\u8BA9\u4F4D\u7ED9\u7BAD\u5934\uFF09 arrowOffset = rotation_matrix*(offset * arrowHeight) * arrowWidth; offset += arrowOffset;// \u6CBF\u7EBF\u504F\u79FB } return offset; } void main() { // 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; if(u_arrow > 0.0) { // \u8BA1\u7B97\u7BAD\u5934 offset = calculateArrow(offset); if(a_DistanceAndIndex.y > 4.0) { offset *= mix(1.0, u_tailWidth, currentLinePointRatio); } } 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 { // mapbox - amap // \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); } `,N3=`varying vec4 v_color; varying vec4 v_texture_data; uniform float u_linearDir: 1.0; uniform float u_linearColor: 0; uniform vec4 u_sourceColor; uniform vec4 u_targetColor; #pragma include "picking" void main() { float linearRadio = v_texture_data.r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B if(u_linearDir < 1.0) { linearRadio = v_texture_data.a; } if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272 gl_FragColor = mix(u_sourceColor, u_targetColor, linearRadio); gl_FragColor.a *= v_color.a; } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272 gl_FragColor = v_color; } gl_FragColor = filterColor(gl_FragColor); } `,U3={solid:0,dash:1},B1=function(e){(0,Le.Z)(t,e);var r=D3(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s 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); } `,CL=oi.isNumber,H3=function(e){(0,Le.Z)(t,e);var r=z3(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s 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 = texture2D(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; gl_FragColor = filterColor(gl_FragColor + pattern); } else { // replace pattern.a *= v_color.a; if(gl_FragColor.a <= 0.0) { pattern.a = 0.0; } gl_FragColor = filterColor(pattern); } } // blur - AA if(v < v_blur) { gl_FragColor.a = mix(0.0, gl_FragColor.a, v/v_blur); } else if(v > 1.0 - v_blur) { gl_FragColor.a = mix(gl_FragColor.a, 0.0, (v - (1.0 - v_blur))/v_blur); } gl_FragColor = filterColor(gl_FragColor); } `,J3=`#define Animate 0.0 attribute float a_Miter; attribute vec4 a_Color; attribute vec2 a_Size; attribute vec3 a_Normal; attribute vec3 a_Position; attribute vec2 a_iconMapUV; attribute float a_Total_Distance; attribute float a_Distance; uniform mat4 u_ModelMatrix; uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; uniform float u_icon_step: 100; uniform float u_heightfixed; uniform float u_linearColor: 0; #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 varying vec2 v_iconMapUV; varying vec4 v_color; varying float v_blur; varying float v_radio; varying 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 { gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, wallHeight, 1.0)); } setPickingColor(a_PickingColor); } `,eR=function(e){(0,Le.Z)(t,e);var r=q3(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s 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) { gl_FragColor = stroke; } else if(fragmengTocenter > v_innerRadius - blurWidth){ float mixR = (fragmengTocenter - (v_innerRadius - blurWidth)) / (blurWidth * 2.0); gl_FragColor = mix(v_color, stroke, mixR); } else { gl_FragColor = v_color; } } else { // \u5F53\u4E0D\u5B58\u5728 stroke \u6216 stroke <= 0.01 gl_FragColor = v_color; } gl_FragColor = filterColor(gl_FragColor); if(u_additive > 0.0) { gl_FragColor *= circleClipOpacity; } else { gl_FragColor.a *= circleClipOpacity; } } `,uR=` attribute vec3 a_Position; uniform mat4 u_ModelMatrix; attribute float a_Size; attribute vec4 a_Color; varying vec4 v_color; uniform float u_opacity : 1; uniform vec2 u_offsets; uniform float u_stroke_width; varying float v_blur; varying float v_innerRadius; #pragma include "projection" #pragma include "picking" #pragma include "project" void main() { v_color = vec4(a_Color.xyz, a_Color.w * u_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 N1(e){var r=e.coordinates;return{vertices:(0,Kt.Z)(r),indices:[0],size:r.length}}var lR=function(e){(0,Le.Z)(t,e);var r=aR(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getDefaultStyle",value:function(){return{blend:"additive"}}},{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.offsets,f=l===void 0?[0,0]:l,v=i.blend,y=i.strokeOpacity,b=y===void 0?1:y,T=i.strokeWidth,M=T===void 0?0:T,O=i.stroke,F=O===void 0?"#fff":O;return{u_additive:v==="additive"?1:0,u_opacity:s,u_offsets:f,u_stroke_opacity:b,u_stroke_width:M,u_stroke_color:fi(F)}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.layer.triangulation=N1,f.next=3,this.layer.buildLayerModel({moduleName:"pointSimple",vertexShader:uR,fragmentShader:sR,triangulation:N1,depth:{enable:!1},primitive:R.POINTS});case 3:return s=f.sent,f.abrupt("return",[s]);case 5:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o){var s=o.size,l=s===void 0?1:s;return Array.isArray(l)?[l[0]]:[l]}}})}}]),t}(Ma);function cR(e){var r=fR();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function fR(){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(e){return!1}}var hR=`varying vec4 v_color; uniform float u_opacity: 1.0; uniform float u_pickLight: 0.0; #pragma include "picking" uniform float u_linearColor: 0; uniform vec4 u_sourceColor; uniform vec4 u_targetColor; uniform float u_opacitylinear: 0.0; uniform float u_opacitylinear_dir: 1.0; varying float v_lightWeight; varying float v_barLinearZ; void main() { gl_FragColor = v_color; // \u5F00\u542F\u900F\u660E\u5EA6\u6E10\u53D8 if(u_opacitylinear > 0.0) { gl_FragColor.a *= u_opacitylinear_dir > 0.0 ? (1.0 - v_barLinearZ): v_barLinearZ; } // picking if(u_pickLight > 0.0) { gl_FragColor = filterColorAlpha(gl_FragColor, v_lightWeight); } else { gl_FragColor = filterColor(gl_FragColor); } } `,pR=`precision highp float; #define pi 3.1415926535 #define ambientRatio 0.5 #define diffuseRatio 0.3 #define specularRatio 0.2 attribute vec3 a_Position; attribute vec3 a_Pos; attribute vec4 a_Color; attribute vec3 a_Size; attribute vec3 a_Normal; uniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A uniform float u_globel; uniform float u_r; uniform mat4 u_ModelMatrix; varying vec4 v_color; uniform float u_opacity : 1; uniform float u_lightEnable: 1; varying float v_lightWeight; varying 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() { float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF textureOffset = opacityAndOffset.g; // 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, 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); } `,dR=oi.isNumber,vR=function(e){(0,Le.Z)(t,e);var r=cR(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s0&&s.enable){var ht=s.speed,gt=ht===void 0?.01:ht;this.raiseCount+=gt,this.raiseCount>=1&&(this.raiseRepeat>1?(this.raiseCount=0,this.raiseRepeat--):this.raiseCount=1)}return{u_pickLight:Number(T),u_heightfixed:Number(O),u_r:s.enable&&this.raiseRepeat>0?this.raiseCount:1,u_opacity:dR(f)?f:1,u_linearColor:xe,u_sourceColor:ze,u_targetColor:Je,u_opacitylinear:Number($.enable),u_opacitylinear_dir:$.dir==="up"?1:0,u_lightEnable:Number(ue)}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.layer.getLayerConfig(),l=s.animateOption.repeat,f=l===void 0?1:l,this.raiseRepeat=f,b.next=4,this.layer.buildLayerModel({moduleName:"pointEarthExtrude",vertexShader:pR,fragmentShader:hR,triangulation:W0,depth:{enable:!0},cull:{enable:!0,face:ea(this.mapService.version)},blend:this.getBlend()});case 4:return v=b.sent,b.abrupt("return",[v]);case 6:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o){var s=o.size;if(s){var l=[];return Array.isArray(s)&&(l=s.length===2?[s[0],s[0],s[1]]:s),Array.isArray(s)||(l=[s,s,s]),l}else return[2,2,2]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:dn.Attribute,descriptor:{name:"a_Normal",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o,s,l,f,v){return v}}}),this.styleAttributeService.registerStyleAttribute({name:"pos",type:dn.Attribute,descriptor:{name:"a_Pos",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o){var s=Fs(o.coordinates);return _1([s[0],s[1]])}}})}}]),t}(Ma);function mR(e){var r=gR();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function gR(){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(e){return!1}}var _R=`uniform float u_additive; uniform float u_opacity : 1; uniform float u_stroke_opacity : 1; uniform float u_stroke_width : 2; varying vec4 v_data; varying vec4 v_color; varying float v_radius; #pragma include "sdf_2d" #pragma include "picking" void main() { int shape = int(floor(v_data.w + 0.5)); vec4 strokeColor = textrueStroke == vec4(0) ? v_color : textrueStroke; lowp float antialiasblur = v_data.z; float r = v_radius / (v_radius + strokeWidth); 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 = strokeWidth < 0.01 ? 0.0 : smoothstep( antialiasblur, 0.0, inner_df ); if(strokeWidth < 0.01) { gl_FragColor = vec4(v_color.rgb, v_color.a * u_opacity); } else { gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), u_stroke_color * u_stroke_opacity, color_t); } if(u_additive > 0.0) { gl_FragColor *= opacity_t; gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a); } else { gl_FragColor.a *= opacity_t; gl_FragColor = filterColor(gl_FragColor); } } `,yR=`attribute vec4 a_Color; attribute vec3 a_Position; attribute vec3 a_Extrude; attribute float a_Size; attribute float a_Shape; uniform mat4 u_ModelMatrix; varying vec4 v_data; varying vec4 v_color; varying float v_radius; uniform float u_opacity : 1; uniform float u_stroke_opacity : 1; uniform float u_stroke_width : 2; uniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0]; uniform vec2 u_offsets; uniform float u_blur : 0.0; #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 + u_offsets, 1.0); setPickingColor(a_PickingColor); } `,xR=function(e){(0,Le.Z)(t,e);var r=mR(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.strokeOpacity,f=l===void 0?1:l,v=i.strokeWidth,y=v===void 0?0:v,b=i.stroke,T=b===void 0?"rgba(0,0,0,0)":b,M=i.blend,O=i.blur,F=O===void 0?0:O;return{u_blur:F,u_additive:M==="additive"?1:0,u_opacity:s,u_stroke_opacity:f,u_stroke_width:y,u_stroke_color:fi(T)}}},{key:"getAnimateUniforms",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption,s=o===void 0?{enable:!1}:o;return{u_animate:this.animateOption2Array(s),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.layer.triangulation=A1,f.next=3,this.layer.buildLayerModel({moduleName:"pointEarthFill",vertexShader:yR,fragmentShader:_R,triangulation:A1,depth:{enable:!0},blend:this.getBlend()});case 3:return s=f.sent,f.abrupt("return",[s]);case 5:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"animateOption2Array",value:function(i){return[i.enable?0:1,i.speed||1,i.rings||3,0]}},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"extrude",type:dn.Attribute,descriptor:{name:"a_Extrude",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(s,l,f,v){var y=(0,Sn.Z)(f,3),b=y[0],T=y[1],M=y[2],O=La.fromValues(0,0,1),F=La.fromValues(b,0,M),$=b>=0?La.angle(O,F):Math.PI*2-La.angle(O,F),G=Math.PI*2-Math.asin(T/100),ue=me.create();me.rotateY(ue,ue,$),me.rotateX(ue,ue,G);var xe=La.fromValues(1,1,0);La.transformMat4(xe,xe,ue),La.normalize(xe,xe);var ze=La.fromValues(-1,1,0);La.transformMat4(ze,ze,ue),La.normalize(ze,ze);var Je=La.fromValues(-1,-1,0);La.transformMat4(Je,Je,ue),La.normalize(Je,Je);var ht=La.fromValues(1,-1,0);La.transformMat4(ht,ht,ue),La.normalize(ht,ht);var gt=[].concat((0,Kt.Z)(xe),(0,Kt.Z)(ze),(0,Kt.Z)(Je),(0,Kt.Z)(ht)),Ot=v%4*3;return[gt[Ot],gt[Ot+1],gt[Ot+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s){var l=s.size,f=l===void 0?5:l;return Array.isArray(f)?[f[0]]:[f]}}}),this.styleAttributeService.registerStyleAttribute({name:"shape",type:dn.Attribute,descriptor:{name:"a_Shape",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s){var l=s.shape,f=l===void 0?2:l,v=i.layer.getLayerConfig().shape2d,y=v.indexOf(f);return[y]}}})}}]),t}(Ma);function bR(e){var r=ER();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function ER(){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(e){return!1}}var SR=`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 "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); } } `,AR=`#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_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; out float v_barLinearZ; #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); } `,U1=function(e){(0,Le.Z)(t,e);var r=bR(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s0&&s.enable){var ze=s.speed,Je=ze===void 0?.01:ze;this.raiseCount+=Je,this.raiseCount>=1&&(this.raiseRepeat>1?(this.raiseCount=0,this.raiseRepeat--):this.raiseCount=1)}var ht={u_pickLight:Number(y),u_heightfixed:Number(T),u_r:s.enable&&this.raiseRepeat>0?this.raiseCount:1,u_linearColor:G,u_sourceColor:ue,u_targetColor:xe,u_opacitylinear:Number(O.enable),u_opacitylinear_dir:O.dir==="up"?1:0,u_lightEnable:Number($)},gt=this.getUniformsBufferInfo(ht);return gt}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b;return ge().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return s=this.layer.getLayerConfig(),l=s.depth,f=l===void 0?!0:l,v=s.animateOption.repeat,y=v===void 0?1:v,this.raiseRepeat=y,this.initUniformsBuffer(),M.next=5,this.layer.buildLayerModel({moduleName:"pointExtrude",vertexShader:AR,fragmentShader:SR,triangulation:W0,inject:this.getInject(),cull:{enable:!0,face:ea(this.mapService.version)},depth:{enable:f}});case 5:return b=M.sent,M.abrupt("return",[b]);case 7:case"end":return M.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",shaderLocation:Ms.SIZE,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o){var s=o.size;if(s){var l=[];return Array.isArray(s)&&(l=s.length===2?[s[0],s[0],s[1]]:s),Array.isArray(s)||(l=[s,s,s]),l}else return[2,2,2]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:dn.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ms.NORMAL,buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o,s,l,f,v){return v}}}),this.styleAttributeService.registerStyleAttribute({name:"extrude",type:dn.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Ms.EXTRUDE,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o){var s=Fs(o.coordinates);return[s[0],s[1],0]}}})}}]),t}(Ma);function TR(e){var r=wR();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function wR(){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(e){return!1}}var z1=` uniform float u_additive; varying vec4 v_data; varying vec4 v_color; varying float v_radius; uniform float u_time; uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; #pragma include "sdf_2d" #pragma include "picking" void main() { lowp float antialiasblur = v_data.z; float r = v_radius / (v_radius); float outer_df; float inner_df; // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica' outer_df = sdCircle(v_data.xy, 1.0); inner_df = sdCircle(v_data.xy, r); float opacity_t = smoothstep(0.0, antialiasblur, outer_df); float color_t = smoothstep( antialiasblur, 0.0, inner_df ); float PI = 3.14159; float N_RINGS = 3.0; float FREQ = 1.0; gl_FragColor = v_color; float d = length(v_data.xy); if(d > 0.5) { discard; } float 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); // \u6839\u636E\u53E0\u52A0\u6A21\u5F0F\u9009\u62E9\u6548\u679C if(u_additive > 0.0) { gl_FragColor *= intensity; // \u4F18\u5316\u6C34\u6CE2\u70B9 blend additive \u6A21\u5F0F\u4E0B\u6709\u7684\u62FE\u53D6\u6548\u679C gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a); } else { gl_FragColor = vec4(gl_FragColor.xyz, gl_FragColor.a * intensity); gl_FragColor = filterColor(gl_FragColor); } } `,CR=` layout(std140) uniform commonUniforms { vec3 u_blur_height_fixed; float u_stroke_width; float u_additive; float u_stroke_opacity; float u_size_unit; }; 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 ); if(u_stroke_width < 0.01) { outputColor = v_color; } else { outputColor = mix(v_color, v_stroke * 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); } // \u4F5C\u4E3A mask \u6A21\u677F\u65F6\u9700\u8981\u4E22\u5F03\u900F\u660E\u7684\u50CF\u7D20 if(outputColor.a < 0.01) { discard; } } `,K0=`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 = 10) in float a_Shape; layout(std140) uniform commonUniforms { vec3 u_blur_height_fixed; float u_stroke_width; float u_additive; float u_stroke_opacity; float u_size_unit; }; 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); } `,Z1=function(e){(0,Le.Z)(t,e);var r=TR(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.strokeOpacity,s=o===void 0?1:o,l=i.strokeWidth,f=l===void 0?0:l,v=i.blend,y=i.blur,b=y===void 0?0:y,T=i.raisingHeight,M=T===void 0?0:T,O=i.heightfixed,F=O===void 0?!1:O,$=i.unit,G=$===void 0?"pixel":$,ue=(0,V.Z)({u_blur_height_fixed:[b,Number(M),Number(F)],u_additive:v==="additive"?1:0,u_stroke_opacity:s,u_stroke_width:f,u_size_unit:Y0[G]},this.getStyleAttribute()),xe=this.getStyleAttribute();return this.uniformBuffers[0].subData({offset:0,data:new Uint8Array(new Float32Array([].concat((0,Kt.Z)(xe.u_stroke),(0,Kt.Z)(xe.u_offsets),[xe.u_opacity,xe.u_rotation])).buffer)}),this.uniformBuffers[1].subData({offset:0,data:new Uint8Array(new Float32Array([].concat((0,Kt.Z)(ue.u_blur_height_fixed),[ue.u_stroke_width,ue.u_stroke_opacity,ue.u_additive,ue.u_size_unit])).buffer)}),ue}},{key:"getAnimateUniforms",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption,s=o===void 0?{enable:!1}:o;return{u_animate:this.animateOption2Array(s),u_time:this.layer.getLayerAnimateTime()}}},{key:"getAttribute",value:function(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),pf)}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b,T,M,O,F;return ge().wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return s=this.layer.getLayerConfig(),l=s.animateOption,f=l===void 0?{enable:!1}:l,v=this.getShaders(f),y=v.frag,b=v.vert,T=v.type,this.layer.triangulation=pf,M=this.rendererService.createBuffer({data:new Float32Array(8),isUBO:!0}),O=this.rendererService.createBuffer({data:new Float32Array(8),isUBO:!0}),this.uniformBuffers.push(M,O),G.next=8,this.layer.buildLayerModel({moduleName:T,vertexShader:b,fragmentShader:y,inject:this.getInject(),triangulation:pf,depth:{enable:!1}});case 8:return F=G.sent,G.abrupt("return",[F]);case 10:case"end":return G.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(i){if(i.enable)switch(i.type){case"wave":return{frag:z1,vert:K0,type:"pointWave"};default:return{frag:z1,vert:K0,type:"pointWave"}}else return{frag:CR,vert:K0,type:"pointFill"}}},{key:"animateOption2Array",value:function(i){return[i.enable?0:1,i.speed||1,i.rings||3,0]}},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getLayerConfig().shape2d;this.styleAttributeService.registerStyleAttribute({name:"extrude",type:dn.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Ms.EXTRUDE,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(s,l,f,v){var y=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],b=v%4*3;return[y[b],y[b+1],y[b+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",shaderLocation:Ms.SIZE,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s){var l=s.size,f=l===void 0?5:l;return Array.isArray(f)?[f[0]]:[f]}}}),this.styleAttributeService.registerStyleAttribute({name:"shape",type:dn.Attribute,descriptor:{name:"a_Shape",shaderLocation:Ms.SHAPE,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s){var l=s.shape,f=l===void 0?2:l,v=i.indexOf(f);return[v]}}})}}]),t}(Ma);function RR(e){var r=MR();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function MR(){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(e){return!1}}var IR=`uniform sampler2D u_texture; uniform vec2 u_textSize; uniform float u_opacity : 1; #pragma include "sdf_2d" #pragma include "picking" varying vec2 v_uv; // \u672C\u8EAB\u7684 uv \u5750\u6807 varying vec2 v_Iconuv; varying float v_opacity; void main() { vec2 pos = v_Iconuv / u_textSize + v_uv / u_textSize * 64.; gl_FragColor = texture2D(u_texture, pos); gl_FragColor.a *= v_opacity; gl_FragColor = filterColor(gl_FragColor); } `,PR=`attribute vec4 a_Color; attribute vec3 a_Position; attribute vec3 a_Extrude; attribute float a_Size; attribute vec2 a_Uv; uniform mat4 u_ModelMatrix; uniform mat2 u_RotateMatrix; uniform int u_size_unit; varying vec2 v_uv; // \u672C\u8EAB\u7684 uv \u5750\u6807 varying vec2 v_Iconuv; // icon \u8D34\u56FE\u7684 uv \u5750\u6807 uniform float u_raisingHeight: 0.0; uniform float u_heightfixed: 0.0; varying float v_opacity; // uniform vec2 u_offsets; // shader \u6CE8\u5165 #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) { 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); } `,OR=function(e){(0,Le.Z)(t,e);var r=RR(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s= 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)){ gl_FragColor= textureColor; }else { gl_FragColor= step(0.01, textureColor.z) * v_color; } gl_FragColor.a *= v_opacity; if (gl_FragColor.a < 0.01) { discard; } gl_FragColor = filterColor(gl_FragColor); } `,BR=`precision highp float; attribute vec3 a_Position; attribute vec4 a_Color; attribute vec2 a_Uv; attribute float a_Size; varying vec4 v_color; varying vec2 v_uv; varying float v_opacity; uniform mat4 u_ModelMatrix; uniform float u_raisingHeight: 0.0; uniform float u_heightfixed: 0.0; #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); } `,V1=function(e){(0,Le.Z)(t,e);var r=DR(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s 0.0) { gl_FragColor *= opacity_t; } else { gl_FragColor.a *= opacity_t; } if(gl_FragColor.a > 0.0) { gl_FragColor = filterColor(gl_FragColor); } vec2 extrude = v_exteude; 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; } gl_FragColor.a *= radar_v; } `,HR=`attribute vec4 a_Color; attribute vec3 a_Position; attribute vec3 a_Extrude; attribute float a_Size; uniform float u_speed: 1.0; uniform float u_time; uniform mat4 u_ModelMatrix; uniform int u_size_unit; varying vec4 v_data; varying vec4 v_color; varying float v_radius; varying vec2 v_exteude; #pragma include "projection" #pragma include "picking" void main() { vec3 extrude = a_Extrude; float newSize = setPickingSize(a_Size); float time = u_time * u_speed; mat2 rotateMatrix = mat2( cos(time), sin(time), -sin(time), cos(time) ); v_exteude = rotateMatrix * a_Extrude.xy; // unpack color(vec2) v_color = a_Color; // anti-alias float blur = 0.0; float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur); if(u_size_unit == 1) { newSize = newSize * u_PixelsPerMeter.z; } // radius(16-bit) v_radius = newSize; vec2 offset = (extrude.xy * (newSize)); vec3 aPosition = a_Position; // \u4E0D\u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D offset = project_pixel(offset); v_data = vec4(extrude.x, 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); } `,WR=function(e){(0,Le.Z)(t,e);var r=ZR(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.blend,f=i.speed,v=f===void 0?1:f,y=i.unit,b=y===void 0?"pixel":y;return{u_size_unit:Y0[b],u_speed:v,u_additive:l==="additive"?1:0,u_opacity:s}}},{key:"getAnimateUniforms",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption,s=o===void 0?{enable:!1}:o;return{u_animate:this.animateOption2Array(s),u_time:this.layer.getLayerAnimateTime()}}},{key:"getAttribute",value:function(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),Eg)}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"pointRadar",vertexShader:HR,fragmentShader:jR,triangulation:Eg,depth:{enable:!1}});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"animateOption2Array",value:function(i){return[i.enable?0:1,i.speed||1,i.rings||3,0]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"extrude",type:dn.Attribute,descriptor:{name:"a_Extrude",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o,s,l,f){var v=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],y=f%4*3;return[v[y],v[y+1],v[y+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o){var s=o.size,l=s===void 0?5:s;return Array.isArray(l)?[l[0]]:[l]}}})}}]),t}(Ma);function GR(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=XR(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}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 o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function XR(e,r){if(e){if(typeof e=="string")return W1(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return W1(e,r)}}function W1(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);tthis.width||o<0||n>this.height)return s?!1:[];var f=[];if(t<=0&&n<=0&&this.width<=i&&this.height<=o){if(s)return!0;for(var v=0;v0:f}},{key:"queryCell",value:function(t,n,i,o,s,l,f,v){var y=f.seenUids,b=this.boxCells[s];if(b!==null){var T=this.bboxes,M=GR(b),O;try{for(M.s();!(O=M.n()).done;){var F=O.value;if(!y.box[F]){y.box[F]=!0;var $=F*4;if(t<=T[$+2]&&n<=T[$+3]&&i>=T[$+0]&&o>=T[$+1]&&(!v||v(this.boxKeys[F]))){if(f.hitTest)return l.push(!0),!0;l.push({key:this.boxKeys[F],x1:T[$],y1:T[$+1],x2:T[$+2],y2:T[$+3]})}}}}catch(G){M.e(G)}finally{M.f()}}return!1}},{key:"forEachCell",value:function(t,n,i,o,s,l,f,v){for(var y=this.convertToXCellCoord(t),b=this.convertToYCellCoord(n),T=this.convertToXCellCoord(i),M=this.convertToYCellCoord(o),O=y;O<=T;O++)for(var F=b;F<=M;F++){var $=this.xCellCount*F+O;if(s.call(this,t,n,i,o,$,l,f,v))return}}},{key:"convertToXCellCoord",value:function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}},{key:"convertToYCellCoord",value:function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}}]),e}(),YR=$R,qR=function(){function e(r,t){(0,Q.Z)(this,e),(0,B.Z)(this,"viewportPadding",100),this.width=r,this.height=t,this.viewportPadding=Math.max(r,t),this.grid=new YR(r+this.viewportPadding,t+this.viewportPadding,25),this.screenRightBoundary=r+this.viewportPadding,this.screenBottomBoundary=t+this.viewportPadding,this.gridRightBoundary=r+2*this.viewportPadding,this.gridBottomBoundary=t+2*this.viewportPadding}return(0,j.Z)(e,[{key:"placeCollisionBox",value:function(t){var n=t.x1+t.anchorPointX+this.viewportPadding,i=t.y1+t.anchorPointY+this.viewportPadding,o=t.x2+t.anchorPointX+this.viewportPadding,s=t.y2+t.anchorPointY+this.viewportPadding;return!this.isInsideGrid(n,i,o,s)||this.grid.hitTest(n,i,o,s)?{box:[]}:{box:[n,i,o,s]}}},{key:"insertCollisionBox",value:function(t,n){var i={featureIndex:n};this.grid.insert(i,t[0],t[1],t[2],t[3])}},{key:"project",value:function(t,n,i){var o=Fh.al(n,i,0,1),s=Fh.Ue(),l=me.fromValues.apply(me,(0,Kt.Z)(t));return Fh.fF(s,o,l),{x:(s[0]/s[3]+1)/2*this.width+this.viewportPadding,y:(-s[1]/s[3]+1)/2*this.height+this.viewportPadding}}},{key:"isInsideGrid",value:function(t,n,i,o){return i>=0&&t=0&&n=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}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 o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function KR(e,r){if(e){if(typeof e=="string")return X1(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return X1(e,r)}}function X1(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t6&&arguments[6]!==void 0?arguments[6]:[0,0],l=arguments.length>7?arguments[7]:void 0,f=e.split(` `),v=[],y={positionedGlyphs:v,top:s[1],bottom:s[1],left:s[0],right:s[0],lineCount:f.length,text:e};return l?JR(y,r,f,t,n,i,o):QR(y,r,f,t,n,i,o),v.length?y:!1}function tM(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0],t=arguments.length>2?arguments[2]:void 0,n=e.positionedGlyphs,i=n===void 0?[]:n,o=[],s=G1(i),l;try{for(s.s();!(l=s.n()).done;){var f=l.value,v=f.metrics,y=4,b=v.advance*f.scale/2,T=t?[f.x+b,f.y]:[0,0],M=t?[0,0]:[f.x+b+r[0],f.y+r[1]],O=(0-y)*f.scale-b+M[0],F=(0-y)*f.scale+M[1],$=O+v.width*f.scale,G=F+v.height*f.scale,ue={x:O,y:F},xe={x:$,y:F},ze={x:O,y:G},Je={x:$,y:G};o.push({tl:ue,tr:xe,bl:ze,br:Je,tex:v,glyphOffset:T})}}catch(ht){s.e(ht)}finally{s.f()}return o}function rM(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=nM(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}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 o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function nM(e,r){if(e){if(typeof e=="string")return K1(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return K1(e,r)}}function K1(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t.5||!G||f!==this.preTextStyle.textAllowOverlap)){xe.next=14;break}return xe.next=13,this.reBuildModel();case 13:return xe.abrupt("return",!0);case 14:return xe.abrupt("return",!1);case 15:case"end":return xe.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.layer.off("remapping",this.mapping)}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"textOffsets",type:dn.Attribute,descriptor:{name:"a_textOffsets",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o,s,l){return[l[5],l[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o){var s=o.size,l=s===void 0?12:s;return Array.isArray(l)?[l[0]]:[l]}}}),this.styleAttributeService.registerStyleAttribute({name:"textUv",type:dn.Attribute,descriptor:{name:"a_tex",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o,s,l){return[l[3],l[4]]}}})}},{key:"bindEvent",value:function(){this.layer.isTileLayer||this.layer.on("remapping",this.mapping)}},{key:"textExtent",value:function(){var i=this.mapService.getBounds();return of(i,.5)}},{key:"initTextFont",value:function(){var i=this.getTextStyle(),o=i.fontWeight,s=i.fontFamily,l=this.rawEncodeData,f=[];l.forEach(function(v){var y=v.shape,b=y===void 0?"":y;b=b.toString();var T=rM(b),M;try{for(T.s();!(M=T.n()).done;){var O=M.value;f.indexOf(O)===-1&&f.push(O)}}catch(F){T.e(F)}finally{T.f()}}),this.fontService.setFontOptions({characterSet:f,fontWeight:o,fontFamily:s,iconfont:!1})}},{key:"initIconFontTex",value:function(){var i=this.getTextStyle(),o=i.fontWeight,s=i.fontFamily,l=this.rawEncodeData,f=[];l.forEach(function(v){var y=v.shape,b=y===void 0?"":y;b="".concat(b),f.indexOf(b)===-1&&f.push(b)}),this.fontService.setFontOptions({characterSet:f,fontWeight:o,fontFamily:s,iconfont:!0})}},{key:"getTextStyle",value:function(){var i=this.layer.getLayerConfig(),o=i.fontWeight,s=o===void 0?"400":o,l=i.fontFamily,f=l===void 0?"sans-serif":l,v=i.textAllowOverlap,y=v===void 0?!1:v,b=i.padding,T=b===void 0?[0,0]:b,M=i.textAnchor,O=M===void 0?"center":M,F=i.textOffset,$=F===void 0?[0,0]:F,G=i.opacity,ue=G===void 0?1:G,xe=i.strokeOpacity,ze=xe===void 0?1:xe,Je=i.strokeWidth,ht=Je===void 0?0:Je,gt=i.stroke,Ot=gt===void 0?"#000":gt;return{fontWeight:s,fontFamily:f,textAllowOverlap:y,padding:T,textAnchor:O,textOffset:$,opacity:ue,strokeOpacity:ze,strokeWidth:ht,stroke:Ot}}},{key:"generateGlyphLayout",value:function(i){var o=this,s=this.getFontServiceMapping(),l=this.layer.getLayerConfig(),f=l.spacing,v=f===void 0?2:f,y=l.textAnchor,b=y===void 0?"center":y,T=l.textOffset,M=this.rawEncodeData;this.glyphInfo=M.map(function(O){var F=O.shape,$=F===void 0?"":F,G=O.id,ue=O.size,xe=ue===void 0?1:ue,ze=O.textOffset?O.textOffset:T||[0,0],Je=O.textAnchor?O.textAnchor:b||"center",ht=eM($.toString(),s,xe,Je,"left",v,ze,i),gt=tM(ht,ze,!1);return O.shaping=ht,O.glyphQuads=gt,O.centroid=Fs(O.coordinates),O.originCentroid=O.version==="GAODE2.x"?Fs(O.originCoordinates):O.originCentroid=O.centroid,o.glyphInfoMap[G]={shaping:ht,glyphQuads:gt,centroid:Fs(O.coordinates)},O})}},{key:"getFontServiceMapping",value:function(){var i=this.layer.getLayerConfig(),o=i.fontWeight,s=o===void 0?"400":o,l=i.fontFamily,f=l===void 0?"sans-serif":l;return this.fontService.getMappingByKey("".concat(f,"_").concat(s))}},{key:"getFontServiceCanvas",value:function(){var i=this.layer.getLayerConfig(),o=i.fontWeight,s=o===void 0?"400":o,l=i.fontFamily,f=l===void 0?"sans-serif":l;return this.fontService.getCanvasByKey("".concat(f,"_").concat(s))}},{key:"filterGlyphs",value:function(){var i=this,o=this.layer.getLayerConfig(),s=o.padding,l=s===void 0?[0,0]:s,f=o.textAllowOverlap,v=f===void 0?!1:f;if(!v){this.glyphInfoMap={},this.currentZoom=this.mapService.getZoom(),this.extent=this.textExtent();var y=this.rendererService.getViewportSize(),b=y.width,T=y.height,M=new qR(b,T),O=this.glyphInfo.filter(function(F){var $=F.shaping,G=F.id,ue=G===void 0?0:G,xe=F.version==="GAODE2.x"?F.originCentroid:F.centroid,ze=F.size,Je=ze/16,ht=i.mapService.lngLatToContainer(xe),gt=M.placeCollisionBox({x1:$.left*Je-l[0],x2:$.right*Je+l[0],y1:$.top*Je-l[1],y2:$.bottom*Je+l[1],anchorPointX:ht.x,anchorPointY:ht.y}),Ot=gt.box;return Ot&&Ot.length?(M.insertCollisionBox(Ot,ue),!0):!1});O.forEach(function(F){i.glyphInfoMap[F.id]=F})}}},{key:"initGlyph",value:function(){var i=this.layer.getLayerConfig(),o=i.iconfont,s=o===void 0?!1:o;s?this.initIconFontTex():this.initTextFont(),this.generateGlyphLayout(s)}},{key:"updateTexture",value:function(){var i=this.rendererService.createTexture2D,o=this.getFontServiceCanvas();this.textureHeight=o.height,this.texture&&this.texture.destroy(),this.texture=i({data:o,mag:R.LINEAR,min:R.LINEAR,width:o.width,height:o.height})}},{key:"reBuildModel",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.filterGlyphs(),f.next=3,this.layer.buildLayerModel({moduleName:"pointText",vertexShader:J1,fragmentShader:Q1,triangulation:ex.bind(this),inject:this.getInject(),depth:{enable:!1}});case 3:s=f.sent,this.layer.models=[s];case 5:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()}]),t}(Ma),oM={fillImage:OR,fill:Z1,radar:WR,image:V1,normal:H1,simplePoint:lR,extrude:U1,text:tx,earthFill:xR,earthExtrude:vR},sM=oM;function uM(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=lM(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}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 o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function lM(e,r){if(e){if(typeof e=="string")return rx(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return rx(e,r)}}function rx(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t 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); } `,mM=`uniform sampler2D u_texture; uniform float u_opacity: 1.0; uniform vec4 u_sourceColor; uniform vec4 u_targetColor; uniform float u_linearColor: 0; uniform float u_topsurface: 1.0; uniform float u_sidesurface: 1.0; varying vec4 v_Color; varying vec3 v_uvs; varying vec2 v_texture_data; #pragma include "picking" 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]; // 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; gl_FragColor = linearColor; } else { gl_FragColor = v_Color; } } else { // top face if(u_topsurface < 1.0) { discard; } gl_FragColor = texture2D(u_texture, vec2(topU, topV)); // gl_FragColor = vec4(1.0, 0., 0., 1.0); } gl_FragColor.a *= opacity; gl_FragColor = filterColor(gl_FragColor); } `,gM=`precision highp float; #define ambientRatio 0.5 #define diffuseRatio 0.3 #define specularRatio 0.2 attribute vec4 a_Color; attribute vec3 a_Position; attribute vec3 a_Normal; attribute float a_Size; attribute vec3 a_uvs; uniform mat4 u_ModelMatrix; uniform sampler2D u_texture; uniform vec4 u_sourceColor; uniform vec4 u_targetColor; uniform float u_topsurface: 1.0; uniform float u_sidesurface: 1.0; varying vec4 v_Color; uniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A uniform float u_raisingHeight: 0.0; uniform float u_linearColor: 0.0; varying vec2 v_texture_data; varying vec3 v_uvs; #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_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); } `,_M=`uniform float u_opacity: 1.0; uniform vec4 u_sourceColor; uniform vec4 u_targetColor; uniform float u_linearColor: 0; uniform float u_topsurface: 1.0; uniform float u_sidesurface: 1.0; varying vec4 v_Color; varying vec3 v_uvs; varying vec2 v_texture_data; #pragma include "picking" void main() { float opacity = u_opacity; 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; gl_FragColor = linearColor; } else { // side notuse linear gl_FragColor = v_Color; } } else { // top face if(u_topsurface < 1.0) { discard; } gl_FragColor = v_Color; } gl_FragColor.a *= opacity; gl_FragColor = filterColorAlpha(gl_FragColor, lightWeight); } `,yM=`precision highp float; #define ambientRatio 0.5 #define diffuseRatio 0.3 #define specularRatio 0.2 attribute vec4 a_Color; attribute vec3 a_Position; attribute vec3 a_Normal; attribute float a_Size; attribute vec3 a_uvs; uniform mat4 u_ModelMatrix; uniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A uniform float u_raisingHeight: 0.0; varying vec2 v_texture_data; varying vec3 v_uvs; varying vec4 v_Color; #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); setPickingColor(a_PickingColor); } `,xM=function(e){(0,Le.Z)(t,e);var r=hM(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.heightfixed,s=o===void 0?!1:o,l=i.raisingHeight,f=l===void 0?0:l,v=i.topsurface,y=v===void 0?!0:v,b=i.sidesurface,T=b===void 0?!0:b,M=i.sourceColor,O=i.targetColor,F=0,$=[1,1,1,1],G=[1,1,1,1];return M&&O&&($=fi(M),G=fi(O),F=1),(0,V.Z)({u_topsurface:Number(y),u_sidesurface:Number(T),u_heightfixed:Number(s),u_raisingHeight:Number(f),u_linearColor:F,u_sourceColor:$,u_targetColor:G,u_texture:this.texture},this.getStyleAttribute())}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.loadTexture();case 2:return l.abrupt("return",this.buildModels());case 3:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y;return ge().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return s=this.getShaders(),l=s.frag,f=s.vert,v=s.type,T.next=3,this.layer.buildLayerModel({moduleName:v,vertexShader:f,fragmentShader:l,inject:this.getInject(),triangulation:$0});case 3:return y=T.sent,T.abrupt("return",[y]);case 5:case"end":return T.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(){var i=this.layer.getLayerConfig(),o=i.pickLight,s=i.mapTexture;return s?{frag:mM,vert:gM,type:"polygonExtrudeTexture"}:o?{frag:_M,vert:yM,type:"polygonExtrudePickLight"}:{frag:dM,vert:vM,type:"polygonExtrude"}}},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy()}},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getSource().extent,o=i,s=this.layer.coordCenter||this.layer.getSource().center,l=o[2]-o[0],f=o[3]-o[1];if(this.mapService.version==="GAODE2.x"){var v=this.mapService.coordToAMap2RelativeCoordinates([i[0],i[1]],s),y=(0,Sn.Z)(v,2),b=y[0],T=y[1],M=this.mapService.coordToAMap2RelativeCoordinates([i[2],i[3]],s),O=(0,Sn.Z)(M,2),F=O[0],$=O[1];l=F-b,f=$-T,o=[b,T,F,$]}this.styleAttributeService.registerStyleAttribute({name:"uvs",type:dn.Attribute,descriptor:{name:"a_uvs",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(ue,xe,ze){var Je=ze[0],ht=ze[1];return[(Je-o[0])/l,(ht-o[1])/f,ze[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:dn.Attribute,descriptor:{name:"a_Normal",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(ue,xe,ze,Je,ht){return ht}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(ue){var xe=ue.size,ze=xe===void 0?10:xe;return Array.isArray(ze)?[ze[0]]:[ze]}}})}},{key:"loadTexture",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s=this,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(l=this.layer.getLayerConfig(),f=l.mapTexture,v=this.rendererService.createTexture2D,this.texture=v({height:0,width:0}),!f){b.next=5;break}return b.abrupt("return",new Promise(function(T,M){var O=new Image;O.crossOrigin="anonymous",O.src=f,O.onload=function(){return s.texture=v({data:O,width:O.width,height:O.height,wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE,min:R.LINEAR,mag:R.LINEAR}),T(null)},O.onerror=function(){M(new Error("image load error"))}}));case 5:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()}]),t}(Ma);function bM(e){var r=EM();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function EM(){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(e){return!1}}var SM=` uniform float u_opacity: 1.0; varying vec4 v_Color; varying vec2 v_texture_data; #pragma include "picking" void main() { gl_FragColor = v_Color; gl_FragColor = filterColor(gl_FragColor); } `,AM=`precision highp float; #define ambientRatio 0.5 #define diffuseRatio 0.3 #define specularRatio 0.2 attribute vec4 a_Color; attribute vec3 a_Position; attribute vec3 a_Normal; attribute float a_Size; uniform mat4 u_ModelMatrix; varying 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); float lightWeight = calc_lighting(pos); vec4 project_pos = project_position(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); } `,TM=function(e){(0,Le.Z)(t,e);var r=bM(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){return(0,V.Z)({},this.getStyleAttribute())}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y;return ge().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return s=this.getShaders(),l=s.frag,f=s.vert,v=s.type,T.next=3,this.layer.buildLayerModel({moduleName:v,vertexShader:f,fragmentShader:l,inject:this.getInject(),triangulation:$0});case 3:return y=T.sent,T.abrupt("return",[y]);case 5:case"end":return T.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(){return{frag:SM,vert:AM,type:"polygonExtrude"}}},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy()}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"normal",type:dn.Attribute,descriptor:{name:"a_Normal",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o,s,l,f,v){return v}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o){var s=o.size,l=s===void 0?10:s;return Array.isArray(l)?[l[0]]:[l]}}})}}]),t}(Ma);function wM(e){var r=CM();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function CM(){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(e){return!1}}var RM=`varying vec4 v_color; #pragma include "picking" void main() { gl_FragColor = v_color; gl_FragColor = filterColor(gl_FragColor); } `,MM=`#pragma include "picking" uniform float u_opacitylinear: 0.0; uniform float u_dir: 1.0; varying vec3 v_linear; varying vec2 v_pos; varying vec4 v_Color; void main() { gl_FragColor = v_Color; if(u_opacitylinear > 0.0) { gl_FragColor.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; } gl_FragColor = filterColor(gl_FragColor); } `,IM=`attribute vec4 a_Color; attribute vec3 a_Position; uniform mat4 u_ModelMatrix; uniform float u_raisingHeight: 0.0; varying vec4 v_Color; #pragma include "projection" #pragma include "picking" uniform float u_opacitylinear: 0.0; attribute vec3 a_linear; varying vec3 v_linear; varying vec2 v_pos; 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=`attribute vec4 a_Color; attribute vec3 a_Position; uniform mat4 u_ModelMatrix; uniform float u_raisingHeight: 0.0; varying 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); } `,OM=function(e){(0,Le.Z)(t,e);var r=wM(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.raisingHeight,s=o===void 0?0:o,l=i.opacityLinear,f=l===void 0?{enable:!1,dir:"in"}:l;return(0,V.Z)({u_raisingHeight:Number(s),u_opacitylinear:Number(f.enable),u_dir:f.dir==="in"?1:0},this.getStyleAttribute())}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b;return ge().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return s=this.getModelParams(),l=s.frag,f=s.vert,v=s.triangulation,y=s.type,this.layer.triangulation=v,M.next=4,this.layer.buildLayerModel({moduleName:y,vertexShader:f,fragmentShader:l,inject:this.getInject(),triangulation:v,primitive:R.TRIANGLES,depth:{enable:!1}});case 4:return b=M.sent,M.abrupt("return",[b]);case 6:case"end":return M.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getLayerConfig(),o=i.opacityLinear,s=o===void 0?{enable:!1,dir:"in"}:o;s.enable&&this.styleAttributeService.registerStyleAttribute({name:"linear",type:dn.Attribute,descriptor:{name:"a_linear",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(f,v,y){return[y[3],y[4],y[5]]}}})}},{key:"getModelParams",value:function(){var i=this.layer.getLayerConfig(),o=i.opacityLinear,s=o===void 0?{enable:!1}:o;return s.enable?{frag:MM,vert:IM,type:"polygonLinear",triangulation:zw}:{frag:RM,vert:PM,type:"polygonFill",triangulation:Id}}}]),t}(Ma);function DM(e){var r=FM();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function FM(){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(e){return!1}}var kM=` uniform float u_time: 0.0; uniform float u_opacity: 1.0; varying vec2 v_uv; 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 watercolor = vec3(0.43, 0.60, 0.66); // 'transparent' low-water color (RGB) // vec3 watercolor2 = vec3(0.06, 0.07, 0.11); // deep-water color (RGB, should be darker than the low-water color) uniform vec4 u_watercolor; uniform vec4 u_watercolor2; 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 texture2D(u_texture2,p*vec2(1./256.)).x; } vec4 highness(vec2 p) { vec4 t = texture2D(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 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); } float opacity = u_opacity; gl_FragColor = vec4(col, opacity); } `,BM=`attribute vec2 a_uv; attribute vec3 a_Position; uniform mat4 u_ModelMatrix; varying vec2 v_uv; #pragma include "projection" void main() { v_uv = a_uv; vec4 project_pos = project_position(vec4(a_Position, 1.0)); gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0)); } `,LM=oi.isNumber,NM=function(e){(0,Le.Z)(t,e);var r=DM(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.watercolor,f=l===void 0?"#6D99A8":l,v=i.watercolor2,y=v===void 0?"#0F121C":v;return{u_texture1:this.texture1,u_texture2:this.texture2,u_texture3:this.texture3,u_watercolor:fi(f),u_watercolor2:fi(y),u_opacity:LM(s)?s:1}}},{key:"getAnimateUniforms",value:function(){return{u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.loadTexture(),l.abrupt("return",this.buildModels());case 2:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"polygonOcean",vertexShader:BM,fragmentShader:kM,triangulation:X0,primitive:R.TRIANGLES,depth:{enable:!1}});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i,o,s;(i=this.texture1)===null||i===void 0||i.destroy(),(o=this.texture2)===null||o===void 0||o.destroy(),(s=this.texture3)===null||s===void 0||s.destroy()}},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getSource().extent,o=(0,Sn.Z)(i,4),s=o[0],l=o[1],f=o[2],v=o[3],y=f-s,b=v-l;this.styleAttributeService.registerStyleAttribute({name:"oceanUv",type:dn.Attribute,descriptor:{name:"a_uv",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(M,O,F,$){var G=M.version==="GAODE2.x"?M.originCoordinates[0][$]:F,ue=(0,Sn.Z)(G,2),xe=ue[0],ze=ue[1];return[(xe-s)/y,(ze-l)/b]}}})}},{key:"loadTexture",value:function(){var i=this,o=this.rendererService.createTexture2D,s={height:0,width:0};this.texture1=o(s),this.texture2=o(s),this.texture3=o(s),l(function(v){i.texture1=f(v[0]),i.texture2=f(v[1]),i.texture3=f(v[2]),i.layerService.reRender()});function l(v){var y=0,b=[],T=["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"];T.map(function(M){var O=new Image;O.crossOrigin="",O.src=M,b.push(O),O.onload=function(){y++,y===3&&v(b)}})}function f(v){return o({data:v,width:v.width,height:v.height,wrapS:R.MIRRORED_REPEAT,wrapT:R.MIRRORED_REPEAT,min:R.LINEAR,mag:R.LINEAR})}}}]),t}(Ma);function UM(e){var r=zM();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function zM(){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(e){return!1}}var ZM=`uniform sampler2D u_texture; uniform float u_time: 0.0; uniform float u_speed: 1.0; uniform float u_opacity: 1.0; varying vec4 v_Color; varying 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 = texture2D(u_texture, p.xz / 30.).xyz; p.z += t * 3.; p.x += t * 0.52; vec3 c2 = texture2D(u_texture, p.xz / 30.).xyz; p.z += t * 4.; p.x += t * 0.8; vec3 c3 = texture2D(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() { float opacity = u_opacity; gl_FragColor = v_Color; gl_FragColor.a *= opacity; float spc = calSpc(); gl_FragColor += spc * 0.4; } `,VM=`attribute vec4 a_Color; attribute vec2 a_uv; attribute vec3 a_Position; uniform mat4 u_ModelMatrix; varying vec4 v_Color; varying vec2 v_uv; uniform float u_opacity: 1.0; #pragma include "projection" void main() { v_uv = a_uv; v_Color = a_Color; vec4 project_pos = project_position(vec4(a_Position, 1.0)); gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0)); } `,jM=oi.isNumber,HM=function(e){(0,Le.Z)(t,e);var r=UM(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.speed,f=l===void 0?.5:l;return{u_texture:this.texture,u_speed:f,u_opacity:jM(s)?s:1}}},{key:"getAnimateUniforms",value:function(){return{u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.loadTexture(),l.abrupt("return",this.buildModels());case 2:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"polygonWater",vertexShader:VM,fragmentShader:ZM,triangulation:X0,primitive:R.TRIANGLES,depth:{enable:!1}});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy()}},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getSource().extent,o=(0,Sn.Z)(i,4),s=o[0],l=o[1],f=o[2],v=o[3],y=f-s,b=v-l;this.styleAttributeService.registerStyleAttribute({name:"waterUv",type:dn.Attribute,descriptor:{name:"a_uv",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(M,O,F,$){var G=M.version==="GAODE2.x"?M.originCoordinates[0][$]:F,ue=(0,Sn.Z)(G,2),xe=ue[0],ze=ue[1];return[(xe-s)/y,(ze-l)/b]}}})}},{key:"loadTexture",value:function(){var i=this,o=this.layer.getLayerConfig(),s=o.waterTexture,l=this.rendererService.createTexture2D;this.texture=l({height:0,width:0});var f=new Image;f.crossOrigin="",s?(console.warn("L7 recommend\uFF1Ahttps://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ"),f.src=s):f.src="https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ",f.onload=function(){i.texture=l({data:f,width:f.width,height:f.height,wrapS:R.MIRRORED_REPEAT,wrapT:R.MIRRORED_REPEAT,min:R.LINEAR,mag:R.LINEAR}),i.layerService.reRender()}}}]),t}(Ma),WM={fill:OM,line:B1,extrude:xM,text:tx,point_fill:Z1,point_image:V1,point_normal:H1,point_extrude:U1,water:HM,ocean:NM,extrusion:TM},GM=WM;function XM(e){var r=$M();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function $M(){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(e){return!1}}var Rg=function(e){(0,Le.Z)(t,e);var r=XM(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s 0.0 || x < 0.0) ? x != x : x != 0.0; } void main() { float value = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y)).r; if (value == u_noDataValue || isnan_emu(value)) discard; else if ((!u_clampLow && value < u_domain[0]) || (!u_clampHigh && value > u_domain[1])) discard; else { float normalisedValue =(value - u_domain[0]) / (u_domain[1] -u_domain[0]); vec4 color = texture2D(u_colorTexture,vec2(normalisedValue, 0)); gl_FragColor = color; gl_FragColor.a = gl_FragColor.a * u_opacity ; if(gl_FragColor.a < 0.01) discard; } } `,QM=`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)); } `,nx=function(e){(0,Le.Z)(t,e);var r=YM(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.clampLow,f=l===void 0?!0:l,v=i.clampHigh,y=v===void 0?!0:v,b=i.noDataValue,T=b===void 0?-9999999:b,M=i.domain,O=i.rampColors,F=M||Cc(O);return this.colorTexture=this.layer.textureService.getColorTexture(O,F),{u_opacity:s||1,u_texture:this.texture,u_domain:F,u_clampLow:f,u_clampHigh:typeof y!="undefined"?y:f,u_noDataValue:T,u_colorTexture:this.colorTexture}}},{key:"getRasterData",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s){var l,f,v,y;return ge().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:if(!Array.isArray(s.data)){T.next=4;break}return T.abrupt("return",{data:s.data,width:s.width,height:s.height});case 4:return T.next=6,s.data;case 6:return l=T.sent,f=l.rasterData,v=l.width,y=l.height,T.abrupt("return",{data:Array.from(f),width:v,height:y});case 11:case"end":return T.stop()}},o)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b,T,M;return ge().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return s=this.layer.getSource(),l=this.rendererService.createTexture2D,f=s.data.dataArray[0],F.next=5,this.getRasterData(f);case 5:return v=F.sent,y=v.data,b=v.width,T=v.height,this.texture=l({data:y,width:b,height:T,format:R.LUMINANCE,type:R.FLOAT}),F.next=12,this.layer.buildLayerModel({moduleName:"rasterImageData",vertexShader:QM,fragmentShader:KM,triangulation:Sg,primitive:R.TRIANGLES,depth:{enable:!1}});case 12:return M=F.sent,F.abrupt("return",[M]);case 14:case"end":return F.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.initModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i,o;(i=this.texture)===null||i===void 0||i.destroy(),(o=this.colorTexture)===null||o===void 0||o.destroy()}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_Uv",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o,s,l){return[l[3],l[4]]}}})}}]),t}(Ma),JM=["data"],eI=["rasterData"];function tI(e){var r=rI();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function rI(){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(e){return!1}}var nI=`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)); } `,iI=`precision mediump float; uniform vec2 u_rminmax: vec2(0,255); uniform vec2 u_gminmax: vec2(0,255); uniform vec2 u_bminmax: vec2(0,255); uniform float u_opacity: 1.0; uniform sampler2D u_texture; uniform float u_noDataValue : 0.0; varying vec2 v_texCoord; void main() { vec3 rgb = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y)).rgb; if(rgb == vec3(u_noDataValue)) { gl_FragColor = vec4(0.0, 0, 0, 0.0); } else { gl_FragColor = 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(gl_FragColor.a < 0.01) discard; }`,aI=function(e){(0,Le.Z)(t,e);var r=tI(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s u_domain[1])) { gl_FragColor = vec4(0.0, 0, 0, 0.0); } else { gl_FragColor = getColor(value); gl_FragColor.a = gl_FragColor.a * u_opacity ; if(gl_FragColor.a < 0.01) discard; } } `,lI=`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)); } `,cI=function(e){(0,Le.Z)(t,e);var r=oI(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=i.clampLow,l=s===void 0?!0:s,f=i.clampHigh,v=f===void 0?!0:f,y=i.noDataValue,b=y===void 0?-9999999:y,T=i.domain,M=i.rampColors,O=i.colorTexture,F=i.rScaler,$=F===void 0?6553.6:F,G=i.gScaler,ue=G===void 0?25.6:G,xe=i.bScaler,ze=xe===void 0?.1:xe,Je=i.offset,ht=Je===void 0?1e4:Je,gt=T||Cc(M),Ot=O;return O?this.layer.textureService.setColorTexture(O,M,gt):Ot=this.layer.textureService.getColorTexture(M,gt),{u_opacity:o||1,u_texture:this.texture,u_domain:gt,u_clampLow:l,u_clampHigh:typeof v!="undefined"?v:l,u_noDataValue:b,u_unpack:[$,ue,ze,ht],u_colorTexture:Ot}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.layer.getSource(),l=this.rendererService.createTexture2D,b.next=4,s.data.images;case 4:return f=b.sent,this.texture=l({data:f[0],width:f[0].width,height:f[0].height,min:R.LINEAR,mag:R.LINEAR}),b.next=8,this.layer.buildLayerModel({moduleName:"RasterTileDataImage",vertexShader:lI,fragmentShader:uI,triangulation:Sg,primitive:R.TRIANGLES,depth:{enable:!1}});case 8:return v=b.sent,b.abrupt("return",[v]);case 10:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy()}},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.initModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_Uv",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o,s,l){return[l[3],l[4]]}}})}}]),t}(Ma),fI={raster:nx,rasterRgb:aI,raster3d:nx,rasterTerrainRgb:cI},hI=fI;function pI(e){var r=dI();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function dI(){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(e){return!1}}var Mg=function(e){(0,Le.Z)(t,e);var r=pI(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s0&&arguments[0]!==void 0?arguments[0]:!0;i&&this.layerService.clear()}},{key:"registerBuiltinAttributes",value:function(){return""}}]),t}(Ma),bI={fill:xI},EI=bI;function SI(e){var r=AI();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function AI(){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(e){return!1}}var ix=function(e){(0,Le.Z)(t,e);var r=SI(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s0&&this.mapService.version==="GAODE2.x"){var o=n.coordCenter||n.getSource().center;t.filter(function(s){return!s.originCoordinates}).map(function(s){s.version="GAODE2.x",s.originCoordinates=TI(s.coordinates),s.coordinates=i.mapService.coordToAMap2RelativeCoordinates(s.coordinates,o)})}}},{key:"adjustData2SimpleCoordinates",value:function(t){var n=this;t.length>0&&this.mapService.version==="SIMPLE"&&t.map(function(i){i.simpleCoordinate||(i.coordinates=n.unProjectCoordinates(i.coordinates),i.simpleCoordinate=!0)})}},{key:"unProjectCoordinates",value:function(t){var n=this;if(typeof t[0]=="number")return this.mapService.simpleMapCoord.unproject(t);if(t[0]&&t[0][0]instanceof Array){var i=[];return t.map(function(s){var l=[];s.map(function(f){l.push(n.mapService.simpleMapCoord.unproject(f))}),i.push(l)}),i}else{var o=[];return t.map(function(s){o.push(n.mapService.simpleMapCoord.unproject(s))}),o}}},{key:"applyAttributeMapping",value:function(t,n){var i;if(!t.scale)return[];var o=(t==null||(i=t.scale)===null||i===void 0?void 0:i.scalers)||[],s=[];o.forEach(function(f){var v,y=f.field;(n.hasOwnProperty(y)||((v=t.scale)===null||v===void 0?void 0:v.type)==="variable")&&s.push(n[y])});var l=t.mapping?t.mapping(s):[];return l}},{key:"getArrowPoints",value:function(t,n){var i=[n[0]-t[0],n[1]-t[1]],o=kf(i),s=[t[0]+o[0]*1e-4,t[1]+o[1]*1e-4];return s}}]),e}(),lx=ki(Ig.prototype,"mapService",[ox],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),cx=ki(Ig.prototype,"fontService",[sx],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ig))||ux),fx,hx,CI=(fx=(0,yt.b2)(),fx(hx=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"apply",value:function(t){var n=this;this.mapService=t.getContainer().get(ot.IMapService),t.hooks.init.tapPromise("DataSourcePlugin",(0,Pt.Z)(ge().mark(function i(){var o,s,l,f;return ge().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(t.log(Rs.SourceInitStart,ds.INIT),o=t.getSource(),o||(s=t.sourceOption||t.defaultSourceConfig,l=s.data,f=s.options,o=new Xy(l,f),t.setSource(o)),!o.inited){y.next=8;break}n.updateClusterData(t),t.log(Rs.SourceInitEnd,ds.INIT),y.next=10;break;case 8:return y.next=10,new Promise(function(b){o.on("update",function(T){T.type==="inited"&&(n.updateClusterData(t),t.log(Rs.SourceInitEnd,ds.INIT)),b(null)})});case 10:case"end":return y.stop()}},i)}))),t.hooks.beforeRenderData.tapPromise("DataSourcePlugin",(0,Pt.Z)(ge().mark(function i(){var o,s,l;return ge().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return o=n.updateClusterData(t),s=t.dataState.dataSourceNeedUpdate,t.dataState.dataSourceNeedUpdate=!1,l=o||s,v.abrupt("return",l);case 5:case"end":return v.stop()}},i)})))}},{key:"updateClusterData",value:function(t){if(t.isTileLayer||t.tileLayer||!t.getSource())return!1;var n=t.getSource(),i=n.cluster,o=n.clusterOptions.zoom,s=o===void 0?0:o,l=this.mapService.getZoom()-1,f=t.dataState.dataSourceNeedUpdate;return i&&f&&n.updateClusterData(Math.floor(l)),i&&Math.abs(t.clusterZoom-l)>=1?(s!==Math.floor(l)&&n.updateClusterData(Math.floor(l)),t.clusterZoom=l,!0):!1}}]),e}())||hx);function Q0(e,r){return er?1:e>=r?0:NaN}function px(e){return e.length===1&&(e=RI(e)),{left:function(r,t,n,i){for(n==null&&(n=0),i==null&&(i=r.length);n>>1;e(r[o],t)<0?n=o+1:i=o}return n},right:function(r,t,n,i){for(n==null&&(n=0),i==null&&(i=r.length);n>>1;e(r[o],t)>0?i=o:n=o+1}return n}}}function RI(e){return function(r,t){return Q0(e(r),t)}}var dx=px(Q0),MI=dx.right,ML=dx.left,Pg=MI;function vx(e,r){var t=e.length,n=-1,i,o,s;if(r==null){for(;++n=i)for(o=s=i;++ni&&(o=i),s=i)for(o=s=i;++ni&&(o=i),s0)return[e];if((n=r0)for(e=Math.ceil(e/l),r=Math.floor(r/l),s=new Array(o=Math.ceil(r-e+1));++i=0?(o>=J0?10:o>=e_?5:o>=t_?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=J0?10:o>=e_?5:o>=t_?2:1)}function r_(e,r,t){var n=Math.abs(r-e)/Math.max(0,t),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),o=n/i;return o>=J0?i*=10:o>=e_?i*=5:o>=t_&&(i*=2),rb;)T.pop(),--M;var O=new Array(M+1),F;for(o=0;o<=M;++o)F=O[o]=[],F.x0=o>0?T[o-1]:y,F.x1=o=1)return+t(e[n-1],n-1,e);var n,i=(n-1)*r,o=Math.floor(i),s=+t(e[o],o,e),l=+t(e[o+1],o+1,e);return s+(l-s)*(i-o)}}function _x(e,r,t,n,i){var o=e*e,s=o*e;return((1-3*e+3*o-s)*r+(4-6*o+3*s)*t+(1+3*e+3*o-3*s)*n+s*i)/6}function OI(e){var r=e.length-1;return function(t){var n=t<=0?t=0:t>=1?(t=1,r-1):Math.floor(t*r),i=e[n],o=e[n+1],s=n>0?e[n-1]:2*i-o,l=n180||t<-180?t-360*Math.round(t/360):t):constant(isNaN(e)?r:e)}function kI(e){return(e=+e)==1?xx:function(r,t){return t-r?FI(r,t,e):n_(isNaN(r)?t:r)}}function xx(e,r){var t=r-e;return t?yx(e,t):n_(isNaN(e)?r:e)}var bx=function e(r){var t=kI(r);function n(i,o){var s=t((i=(0,os.B8)(i)).r,(o=(0,os.B8)(o)).r),l=t(i.g,o.g),f=t(i.b,o.b),v=xx(i.opacity,o.opacity);return function(y){return i.r=s(y),i.g=l(y),i.b=f(y),i.opacity=v(y),i+""}}return n.gamma=e,n}(1);function Ex(e){return function(r){var t=r.length,n=new Array(t),i=new Array(t),o=new Array(t),s,l;for(s=0;s=e.length)return t!=null&&l.sort(t),n!=null?n(l):l;for(var b=-1,T=l.length,M=e[f++],O,F,$=map(),G,ue=v();++be.length)return l;var v,y=r[f-1];return n!=null&&f>=e.length?v=l.entries():(v=[],l.each(function(b,T){v.push({key:T,values:s(b,f)})})),y!=null?v.sort(function(b,T){return y(b.key,T.key)}):v}return i={object:function(l){return o(l,0,LI,NI)},map:function(l){return o(l,0,Ax,Tx)},entries:function(l){return s(o(l,0,Ax,Tx),0)},key:function(l){return e.push(l),i},sortKeys:function(l){return r[e.length-1]=l,i},sortValues:function(l){return t=l,i},rollup:function(l){return n=l,i}}}function LI(){return{}}function NI(e,r,t){e[r]=t}function Ax(){return map()}function Tx(e,r,t){e.set(r,t)}function Fg(){}var md=i_.prototype;Fg.prototype=UI.prototype={constructor:Fg,has:md.has,add:function(e){return e+="",this[qc+e]=e,this},remove:md.remove,clear:md.clear,values:md.keys,size:md.size,empty:md.empty,each:md.each};function UI(e,r){var t=new Fg;if(e instanceof Fg)e.each(function(o){t.add(o)});else if(e){var n=-1,i=e.length;if(r==null)for(;++nt&&(o=r.slice(t,o),l[s]?l[s]+=o:l[++s]=o),(n=n[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,f.push({i:s,x:Bg(n,i)})),t=o_.lastIndex;return tt&&(n=r,r=t,t=n),function(i){return Math.max(r,Math.min(t,i))}}function qI(e,r,t){var n=e[0],i=e[1],o=r[0],s=r[1];return i2?KI:qI,f=v=null,b}function b(T){return isNaN(T=+T)?o:(f||(f=l(e.map(n),r,t)))(n(s(T)))}return b.invert=function(T){return s(i((v||(v=l(r,e.map(n),Bg)))(T)))},b.domain=function(T){return arguments.length?(e=Rx.call(T,YI),s===Yu||(s=kx(e)),y()):e.slice()},b.range=function(T){return arguments.length?(r=gd.call(T),y()):r.slice()},b.rangeRound=function(T){return r=gd.call(T),t=XI,y()},b.clamp=function(T){return arguments.length?(s=T?kx(e):Yu,b):s!==Yu},b.interpolate=function(T){return arguments.length?(t=T,y()):t},b.unknown=function(T){return arguments.length?(o=T,b):o},function(T,M){return n=T,i=M,y()}}function Bx(e,r){return l_()(e,r)}var QI=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ng(e){if(!(r=QI.exec(e)))throw new Error("invalid format: "+e);var r;return new c_({fill:r[1],align:r[2],sign:r[3],symbol:r[4],zero:r[5],width:r[6],comma:r[7],precision:r[8]&&r[8].slice(1),trim:r[9],type:r[10]})}Ng.prototype=c_.prototype;function c_(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}c_.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 JI(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ug(e,r){if((t=(e=r?e.toExponential(r-1):e.toExponential()).indexOf("e"))<0)return null;var t,n=e.slice(0,t);return[n.length>1?n[0]+n.slice(2):n,+e.slice(t+1)]}function pv(e){return e=Ug(Math.abs(e)),e?e[1]:NaN}function eP(e,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(pv(r)/3)))*3-pv(Math.abs(e)))}function tP(e,r){return function(t,n){for(var i=t.length,o=[],s=0,l=e[0],f=0;i>0&&l>0&&(f+l+1>n&&(l=Math.max(1,n-f)),o.push(t.substring(i-=l,i+l)),!((f+=l+1)>n));)l=e[s=(s+1)%e.length];return o.reverse().join(r)}}function rP(e){return function(r){return r.replace(/[0-9]/g,function(t){return e[+t]})}}function nP(e){e:for(var r=e.length,t=1,n=-1,i;t0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var Lx;function iP(e,r){var t=Ug(e,r);if(!t)return e+"";var n=t[0],i=t[1],o=i-(Lx=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return o===s?n:o>s?n+new Array(o-s+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+Ug(e,Math.max(0,r+o-1))[0]}function Nx(e,r){var t=Ug(e,r);if(!t)return e+"";var n=t[0],i=t[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}var Ux={"%":function(e,r){return(e*100).toFixed(r)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:JI,e:function(e,r){return e.toExponential(r)},f:function(e,r){return e.toFixed(r)},g:function(e,r){return e.toPrecision(r)},o:function(e){return Math.round(e).toString(8)},p:function(e,r){return Nx(e*100,r)},r:Nx,s:iP,X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function zx(e){return e}var Zx=Array.prototype.map,Vx=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function aP(e){var r=e.grouping===void 0||e.thousands===void 0?zx:tP(Zx.call(e.grouping,Number),e.thousands+""),t=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?zx:rP(Zx.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"-":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function v(b){b=Ng(b);var T=b.fill,M=b.align,O=b.sign,F=b.symbol,$=b.zero,G=b.width,ue=b.comma,xe=b.precision,ze=b.trim,Je=b.type;Je==="n"?(ue=!0,Je="g"):Ux[Je]||(xe===void 0&&(xe=12),ze=!0,Je="g"),($||T==="0"&&M==="=")&&($=!0,T="0",M="=");var ht=F==="$"?t:F==="#"&&/[boxX]/.test(Je)?"0"+Je.toLowerCase():"",gt=F==="$"?n:/[%p]/.test(Je)?s:"",Ot=Ux[Je],tr=/[defgprs%]/.test(Je);xe=xe===void 0?6:/[gprs]/.test(Je)?Math.max(1,Math.min(21,xe)):Math.max(0,Math.min(20,xe));function Ir(Er){var mn=ht,Ln=gt,Fi,xa,is;if(Je==="c")Ln=Ot(Er)+Ln,Er="";else{Er=+Er;var _s=Er<0||1/Er<0;if(Er=isNaN(Er)?f:Ot(Math.abs(Er),xe),ze&&(Er=nP(Er)),_s&&+Er==0&&O!=="+"&&(_s=!1),mn=(_s?O==="("?O:l:O==="-"||O==="("?"":O)+mn,Ln=(Je==="s"?Vx[8+Lx/3]:"")+Ln+(_s&&O==="("?")":""),tr){for(Fi=-1,xa=Er.length;++Fiis||is>57){Ln=(is===46?i+Er.slice(Fi+1):Er.slice(Fi))+Ln,Er=Er.slice(0,Fi);break}}}ue&&!$&&(Er=r(Er,1/0));var as=mn.length+Er.length+Ln.length,lu=as>1)+mn+Er+Ln+lu.slice(as);break;default:Er=lu+mn+Er+Ln;break}return o(Er)}return Ir.toString=function(){return b+""},Ir}function y(b,T){var M=v((b=Ng(b),b.type="f",b)),O=Math.max(-8,Math.min(8,Math.floor(pv(T)/3)))*3,F=Math.pow(10,-O),$=Vx[8+O/3];return function(G){return M(F*G)+$}}return{format:v,formatPrefix:y}}var zg,f_,jx;oP({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function oP(e){return zg=aP(e),f_=zg.format,jx=zg.formatPrefix,zg}function sP(e,r){return e=Math.abs(e),r=Math.abs(r)-e,Math.max(0,pv(r)-pv(e))+1}function uP(e){return Math.max(0,-pv(Math.abs(e)))}function lP(e,r,t,n){var i=r_(e,r,t),o;switch(n=Ng(n==null?",f":n),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(r));return n.precision==null&&!isNaN(o=eP(i,s))&&(n.precision=o),jx(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=sP(i,Math.max(Math.abs(e),Math.abs(r))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=uP(i))&&(n.precision=o-(n.type==="%")*2);break}}return f_(n)}function dm(e){var r=e.domain;return e.ticks=function(t){var n=r();return gx(n[0],n[n.length-1],t==null?10:t)},e.tickFormat=function(t,n){var i=r();return lP(i[0],i[i.length-1],t==null?10:t,n)},e.nice=function(t){t==null&&(t=10);var n=r(),i=0,o=n.length-1,s=n[i],l=n[o],f;return l0?(s=Math.floor(s/f)*f,l=Math.ceil(l/f)*f,f=Og(s,l,t)):f<0&&(s=Math.ceil(s*f)/f,l=Math.floor(l*f)/f,f=Og(s,l,t)),f>0?(n[i]=Math.floor(s/f)*f,n[o]=Math.ceil(l/f)*f,r(n)):f<0&&(n[i]=Math.ceil(s*f)/f,n[o]=Math.floor(l*f)/f,r(n)),e},e}function Hx(){var e=Bx(Yu,Yu);return e.copy=function(){return Lg(e,Hx())},Dp.apply(e,arguments),dm(e)}function cP(e){var r;function t(n){return isNaN(n=+n)?r:n}return t.invert=t,t.domain=t.range=function(n){return arguments.length?(e=map.call(n,number),t):e.slice()},t.unknown=function(n){return arguments.length?(r=n,t):r},t.copy=function(){return cP(e).unknown(r)},e=arguments.length?map.call(e,number):[0,1],linearish(t)}function Wx(e,r){e=e.slice();var t=0,n=e.length-1,i=e[t],o=e[n],s;return o0){for(;Ty)break;ue.push($)}}else for(;T=1;--F)if($=O*F,!($y)break;ue.push($)}}else ue=gx(T,M,Math.min(M-T,G)).map(o);return b?ue.reverse():ue},r.tickFormat=function(l,f){if(f==null&&(f=n===10?".0e":","),typeof f!="function"&&(f=f_(f)),l===1/0)return f;l==null&&(l=10);var v=Math.max(1,n*l/r.ticks().length);return function(y){var b=y/o(Math.round(i(y)));return b*n0?t[l-1]:e[0],l=t?[n[t-1],r]:[n[v-1],n[v]]},s.unknown=function(f){return arguments.length&&(o=f),s},s.thresholds=function(){return n.slice()},s.copy=function(){return eb().domain([e,r]).range(i).unknown(o)},Dp.apply(dm(s),arguments)}function tb(){var e=[.5],r=[0,1],t,n=1;function i(o){return o<=o?r[Pg(e,o,0,n)]:t}return i.domain=function(o){return arguments.length?(e=gd.call(o),n=Math.min(e.length,r.length-1),i):e.slice()},i.range=function(o){return arguments.length?(r=gd.call(o),n=Math.min(e.length,r.length-1),i):r.slice()},i.invertExtent=function(o){var s=r.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(t=o,i):t},i.copy=function(){return tb().domain(e).range(r).unknown(t)},Dp.apply(i,arguments)}var p_=new Date,d_=new Date;function ml(e,r,t,n){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=function(o){return e(o=new Date(+o)),o},i.ceil=function(o){return e(o=new Date(o-1)),r(o,1),e(o),o},i.round=function(o){var s=i(o),l=i.ceil(o);return o-s0))return f;do f.push(v=new Date(+o)),r(o,l),e(o);while(v=s)for(;e(s),!o(s);)s.setTime(s-1)},function(s,l){if(s>=s)if(l<0)for(;++l<=0;)for(;r(s,-1),!o(s););else for(;--l>=0;)for(;r(s,1),!o(s););})},t&&(i.count=function(o,s){return p_.setTime(+o),d_.setTime(+s),e(p_),e(d_),Math.floor(t(p_,d_))},i.every=function(o){return o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?function(s){return n(s)%o===0}:function(s){return i.count(0,s)%o===0}):i}),i}var v_=ml(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,r){e.setFullYear(e.getFullYear()+r)},function(e,r){return r.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});v_.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:ml(function(r){r.setFullYear(Math.floor(r.getFullYear()/e)*e),r.setMonth(0,1),r.setHours(0,0,0,0)},function(r,t){r.setFullYear(r.getFullYear()+t*e)})};var dv=v_,ZL=v_.range,rb=ml(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,r){e.setMonth(e.getMonth()+r)},function(e,r){return r.getMonth()-e.getMonth()+(r.getFullYear()-e.getFullYear())*12},function(e){return e.getMonth()}),EP=rb,VL=rb.range,Zg=1e3,vm=6e4,nb=36e5,ib=864e5,ab=6048e5;function _d(e){return ml(function(r){r.setDate(r.getDate()-(r.getDay()+7-e)%7),r.setHours(0,0,0,0)},function(r,t){r.setDate(r.getDate()+t*7)},function(r,t){return(t-r-(t.getTimezoneOffset()-r.getTimezoneOffset())*vm)/ab})}var m_=_d(0),Vg=_d(1),SP=_d(2),AP=_d(3),vv=_d(4),TP=_d(5),wP=_d(6),jL=m_.range,HL=Vg.range,WL=SP.range,GL=AP.range,XL=vv.range,$L=TP.range,YL=wP.range,ob=ml(function(e){e.setHours(0,0,0,0)},function(e,r){e.setDate(e.getDate()+r)},function(e,r){return(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*vm)/ib},function(e){return e.getDate()-1}),g_=ob,qL=ob.range,sb=ml(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Zg-e.getMinutes()*vm)},function(e,r){e.setTime(+e+r*nb)},function(e,r){return(r-e)/nb},function(e){return e.getHours()}),CP=sb,KL=sb.range,ub=ml(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Zg)},function(e,r){e.setTime(+e+r*vm)},function(e,r){return(r-e)/vm},function(e){return e.getMinutes()}),RP=ub,QL=ub.range,lb=ml(function(e){e.setTime(e-e.getMilliseconds())},function(e,r){e.setTime(+e+r*Zg)},function(e,r){return(r-e)/Zg},function(e){return e.getUTCSeconds()}),MP=lb,JL=lb.range,jg=ml(function(){},function(e,r){e.setTime(+e+r)},function(e,r){return r-e});jg.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ml(function(r){r.setTime(Math.floor(r/e)*e)},function(r,t){r.setTime(+r+t*e)},function(r,t){return(t-r)/e}):jg};var IP=jg,eN=jg.range;function yd(e){return ml(function(r){r.setUTCDate(r.getUTCDate()-(r.getUTCDay()+7-e)%7),r.setUTCHours(0,0,0,0)},function(r,t){r.setUTCDate(r.getUTCDate()+t*7)},function(r,t){return(t-r)/ab})}var cb=yd(0),Hg=yd(1),PP=yd(2),OP=yd(3),mv=yd(4),DP=yd(5),FP=yd(6),tN=cb.range,rN=Hg.range,nN=PP.range,iN=OP.range,aN=mv.range,oN=DP.range,sN=FP.range,fb=ml(function(e){e.setUTCHours(0,0,0,0)},function(e,r){e.setUTCDate(e.getUTCDate()+r)},function(e,r){return(r-e)/ib},function(e){return e.getUTCDate()-1}),hb=fb,uN=fb.range,__=ml(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r)},function(e,r){return r.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});__.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:ml(function(r){r.setUTCFullYear(Math.floor(r.getUTCFullYear()/e)*e),r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0)},function(r,t){r.setUTCFullYear(r.getUTCFullYear()+t*e)})};var mm=__,lN=__.range;function y_(e){if(0<=e.y&&e.y<100){var r=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return r.setFullYear(e.y),r}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function x_(e){if(0<=e.y&&e.y<100){var r=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return r.setUTCFullYear(e.y),r}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function gm(e,r,t){return{y:e,m:r,d:t,H:0,M:0,S:0,L:0}}function kP(e){var r=e.dateTime,t=e.date,n=e.time,i=e.periods,o=e.days,s=e.shortDays,l=e.months,f=e.shortMonths,v=_m(i),y=ym(i),b=_m(o),T=ym(o),M=_m(s),O=ym(s),F=_m(l),$=ym(l),G=_m(f),ue=ym(f),xe={a:_s,A:as,b:lu,B:Ac,c:null,d:_b,e:_b,f:i5,g:d5,G:m5,H:t5,I:r5,j:n5,L:yb,m:a5,M:o5,p:LB,q:NB,Q:Tb,s:wb,S:s5,u:u5,U:l5,V:c5,w:f5,W:h5,x:null,X:null,y:p5,Y:v5,Z:g5,"%":Ab},ze={a:UB,A:zB,b:ZB,B:VB,c:null,d:bb,e:bb,f:b5,g:P5,G:D5,H:_5,I:y5,j:x5,L:Eb,m:E5,M:S5,p:jB,q:HB,Q:Tb,s:wb,S:A5,u:T5,U:w5,V:C5,w:R5,W:M5,x:null,X:null,y:I5,Y:O5,Z:F5,"%":Ab},Je={a:Ir,A:Er,b:mn,B:Ln,c:Fi,d:mb,e:mb,f:KP,g:vb,G:db,H:gb,I:gb,j:XP,L:qP,m:GP,M:$P,p:tr,q:WP,Q:JP,s:e5,S:YP,u:zP,U:ZP,V:VP,w:UP,W:jP,x:xa,X:is,y:vb,Y:db,Z:HP,"%":QP};xe.x=ht(t,xe),xe.X=ht(n,xe),xe.c=ht(r,xe),ze.x=ht(t,ze),ze.X=ht(n,ze),ze.c=ht(r,ze);function ht(ai,ba){return function(ja){var gn=[],Xl=-1,Do=0,Tc=ai.length,wc,Rd,Q2;for(ja instanceof Date||(ja=new Date(+ja));++Xl53)return null;"w"in gn||(gn.w=1),"Z"in gn?(Do=x_(gm(gn.y,0,1)),Tc=Do.getUTCDay(),Do=Tc>4||Tc===0?Hg.ceil(Do):Hg(Do),Do=hb.offset(Do,(gn.V-1)*7),gn.y=Do.getUTCFullYear(),gn.m=Do.getUTCMonth(),gn.d=Do.getUTCDate()+(gn.w+6)%7):(Do=y_(gm(gn.y,0,1)),Tc=Do.getDay(),Do=Tc>4||Tc===0?Vg.ceil(Do):Vg(Do),Do=g_.offset(Do,(gn.V-1)*7),gn.y=Do.getFullYear(),gn.m=Do.getMonth(),gn.d=Do.getDate()+(gn.w+6)%7)}else("W"in gn||"U"in gn)&&("w"in gn||(gn.w="u"in gn?gn.u%7:"W"in gn?1:0),Tc="Z"in gn?x_(gm(gn.y,0,1)).getUTCDay():y_(gm(gn.y,0,1)).getDay(),gn.m=0,gn.d="W"in gn?(gn.w+6)%7+gn.W*7-(Tc+5)%7:gn.w+gn.U*7-(Tc+6)%7);return"Z"in gn?(gn.H+=gn.Z/100|0,gn.M+=gn.Z%100,x_(gn)):y_(gn)}}function Ot(ai,ba,ja,gn){for(var Xl=0,Do=ba.length,Tc=ja.length,wc,Rd;Xl=Tc)return-1;if(wc=ba.charCodeAt(Xl++),wc===37){if(wc=ba.charAt(Xl++),Rd=Je[wc in pb?ba.charAt(Xl++):wc],!Rd||(gn=Rd(ai,ja,gn))<0)return-1}else if(wc!=ja.charCodeAt(gn++))return-1}return gn}function tr(ai,ba,ja){var gn=v.exec(ba.slice(ja));return gn?(ai.p=y[gn[0].toLowerCase()],ja+gn[0].length):-1}function Ir(ai,ba,ja){var gn=M.exec(ba.slice(ja));return gn?(ai.w=O[gn[0].toLowerCase()],ja+gn[0].length):-1}function Er(ai,ba,ja){var gn=b.exec(ba.slice(ja));return gn?(ai.w=T[gn[0].toLowerCase()],ja+gn[0].length):-1}function mn(ai,ba,ja){var gn=G.exec(ba.slice(ja));return gn?(ai.m=ue[gn[0].toLowerCase()],ja+gn[0].length):-1}function Ln(ai,ba,ja){var gn=F.exec(ba.slice(ja));return gn?(ai.m=$[gn[0].toLowerCase()],ja+gn[0].length):-1}function Fi(ai,ba,ja){return Ot(ai,r,ba,ja)}function xa(ai,ba,ja){return Ot(ai,t,ba,ja)}function is(ai,ba,ja){return Ot(ai,n,ba,ja)}function _s(ai){return s[ai.getDay()]}function as(ai){return o[ai.getDay()]}function lu(ai){return f[ai.getMonth()]}function Ac(ai){return l[ai.getMonth()]}function LB(ai){return i[+(ai.getHours()>=12)]}function NB(ai){return 1+~~(ai.getMonth()/3)}function UB(ai){return s[ai.getUTCDay()]}function zB(ai){return o[ai.getUTCDay()]}function ZB(ai){return f[ai.getUTCMonth()]}function VB(ai){return l[ai.getUTCMonth()]}function jB(ai){return i[+(ai.getUTCHours()>=12)]}function HB(ai){return 1+~~(ai.getUTCMonth()/3)}return{format:function(ai){var ba=ht(ai+="",xe);return ba.toString=function(){return ai},ba},parse:function(ai){var ba=gt(ai+="",!1);return ba.toString=function(){return ai},ba},utcFormat:function(ai){var ba=ht(ai+="",ze);return ba.toString=function(){return ai},ba},utcParse:function(ai){var ba=gt(ai+="",!0);return ba.toString=function(){return ai},ba}}}var pb={"-":"",_:" ",0:"0"},uu=/^\s*\d+/,BP=/^%/,LP=/[\\^$*+?|[\]().{}]/g;function Va(e,r,t){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o68?1900:2e3),t+n[0].length):-1}function HP(e,r,t){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(r.slice(t,t+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),t+n[0].length):-1}function WP(e,r,t){var n=uu.exec(r.slice(t,t+1));return n?(e.q=n[0]*3-3,t+n[0].length):-1}function GP(e,r,t){var n=uu.exec(r.slice(t,t+2));return n?(e.m=n[0]-1,t+n[0].length):-1}function mb(e,r,t){var n=uu.exec(r.slice(t,t+2));return n?(e.d=+n[0],t+n[0].length):-1}function XP(e,r,t){var n=uu.exec(r.slice(t,t+3));return n?(e.m=0,e.d=+n[0],t+n[0].length):-1}function gb(e,r,t){var n=uu.exec(r.slice(t,t+2));return n?(e.H=+n[0],t+n[0].length):-1}function $P(e,r,t){var n=uu.exec(r.slice(t,t+2));return n?(e.M=+n[0],t+n[0].length):-1}function YP(e,r,t){var n=uu.exec(r.slice(t,t+2));return n?(e.S=+n[0],t+n[0].length):-1}function qP(e,r,t){var n=uu.exec(r.slice(t,t+3));return n?(e.L=+n[0],t+n[0].length):-1}function KP(e,r,t){var n=uu.exec(r.slice(t,t+6));return n?(e.L=Math.floor(n[0]/1e3),t+n[0].length):-1}function QP(e,r,t){var n=BP.exec(r.slice(t,t+1));return n?t+n[0].length:-1}function JP(e,r,t){var n=uu.exec(r.slice(t));return n?(e.Q=+n[0],t+n[0].length):-1}function e5(e,r,t){var n=uu.exec(r.slice(t));return n?(e.s=+n[0],t+n[0].length):-1}function _b(e,r){return Va(e.getDate(),r,2)}function t5(e,r){return Va(e.getHours(),r,2)}function r5(e,r){return Va(e.getHours()%12||12,r,2)}function n5(e,r){return Va(1+g_.count(dv(e),e),r,3)}function yb(e,r){return Va(e.getMilliseconds(),r,3)}function i5(e,r){return yb(e,r)+"000"}function a5(e,r){return Va(e.getMonth()+1,r,2)}function o5(e,r){return Va(e.getMinutes(),r,2)}function s5(e,r){return Va(e.getSeconds(),r,2)}function u5(e){var r=e.getDay();return r===0?7:r}function l5(e,r){return Va(m_.count(dv(e)-1,e),r,2)}function xb(e){var r=e.getDay();return r>=4||r===0?vv(e):vv.ceil(e)}function c5(e,r){return e=xb(e),Va(vv.count(dv(e),e)+(dv(e).getDay()===4),r,2)}function f5(e){return e.getDay()}function h5(e,r){return Va(Vg.count(dv(e)-1,e),r,2)}function p5(e,r){return Va(e.getFullYear()%100,r,2)}function d5(e,r){return e=xb(e),Va(e.getFullYear()%100,r,2)}function v5(e,r){return Va(e.getFullYear()%1e4,r,4)}function m5(e,r){var t=e.getDay();return e=t>=4||t===0?vv(e):vv.ceil(e),Va(e.getFullYear()%1e4,r,4)}function g5(e){var r=e.getTimezoneOffset();return(r>0?"-":(r*=-1,"+"))+Va(r/60|0,"0",2)+Va(r%60,"0",2)}function bb(e,r){return Va(e.getUTCDate(),r,2)}function _5(e,r){return Va(e.getUTCHours(),r,2)}function y5(e,r){return Va(e.getUTCHours()%12||12,r,2)}function x5(e,r){return Va(1+hb.count(mm(e),e),r,3)}function Eb(e,r){return Va(e.getUTCMilliseconds(),r,3)}function b5(e,r){return Eb(e,r)+"000"}function E5(e,r){return Va(e.getUTCMonth()+1,r,2)}function S5(e,r){return Va(e.getUTCMinutes(),r,2)}function A5(e,r){return Va(e.getUTCSeconds(),r,2)}function T5(e){var r=e.getUTCDay();return r===0?7:r}function w5(e,r){return Va(cb.count(mm(e)-1,e),r,2)}function Sb(e){var r=e.getUTCDay();return r>=4||r===0?mv(e):mv.ceil(e)}function C5(e,r){return e=Sb(e),Va(mv.count(mm(e),e)+(mm(e).getUTCDay()===4),r,2)}function R5(e){return e.getUTCDay()}function M5(e,r){return Va(Hg.count(mm(e)-1,e),r,2)}function I5(e,r){return Va(e.getUTCFullYear()%100,r,2)}function P5(e,r){return e=Sb(e),Va(e.getUTCFullYear()%100,r,2)}function O5(e,r){return Va(e.getUTCFullYear()%1e4,r,4)}function D5(e,r){var t=e.getUTCDay();return e=t>=4||t===0?mv(e):mv.ceil(e),Va(e.getUTCFullYear()%1e4,r,4)}function F5(){return"+0000"}function Ab(){return"%"}function Tb(e){return+e}function wb(e){return Math.floor(+e/1e3)}var gv,Cb,k5,B5,L5;N5({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 N5(e){return gv=kP(e),Cb=gv.format,k5=gv.parse,B5=gv.utcFormat,L5=gv.utcParse,gv}var xm=1e3,bm=xm*60,Em=bm*60,Sm=Em*24,U5=Sm*7,Rb=Sm*30,b_=Sm*365;function z5(e){return new Date(e)}function Z5(e){return e instanceof Date?+e:+new Date(+e)}function Mb(e,r,t,n,i,o,s,l,f){var v=Bx(Yu,Yu),y=v.invert,b=v.domain,T=f(".%L"),M=f(":%S"),O=f("%I:%M"),F=f("%I %p"),$=f("%a %d"),G=f("%b %d"),ue=f("%B"),xe=f("%Y"),ze=[[s,1,xm],[s,5,5*xm],[s,15,15*xm],[s,30,30*xm],[o,1,bm],[o,5,5*bm],[o,15,15*bm],[o,30,30*bm],[i,1,Em],[i,3,3*Em],[i,6,6*Em],[i,12,12*Em],[n,1,Sm],[n,2,2*Sm],[t,1,U5],[r,1,Rb],[r,3,3*Rb],[e,1,b_]];function Je(gt){return(s(gt)2){var b=v.scale.ticks(s.values.length);v.scale.domain(b)}s.values?v.scale.range(s.values):v.scale.range(v.option.domain);break;case ro.QUANTILE:case ro.QUANTIZE:case ro.THRESHOLD:v.scale.range(s.values);break;case ro.IDENTITY:break;case ro.CAT:s.values?v.scale.range(s.values):v.scale.range(v.option.domain);break;case ro.DIVERGING:case ro.SEQUENTIAL:v.scale.interpolator(BI(s.values));break}}if(s.values==="text"){var T;v.scale.range((T=v.option)===null||T===void 0?void 0:T.domain)}})):(s.type=ov.CONSTANT,s.defaultValues=f.map(function(v,y){return v.scale(s.names[y])})),s.scalers=f.map(function(v){return{field:v.field,func:v.scale,option:v.option}}),o.needRescale=!1}})}},{key:"parseFields",value:function(t){return Array.isArray(t)?t:$5(t)?t.split("*"):[t]}},{key:"createScale",value:function(t,n,i,o){var s,l,f=this.scaleOptions[n]&&((s=this.scaleOptions[n])===null||s===void 0?void 0:s.field)===t?this.scaleOptions[n]:this.scaleOptions[t],v={field:t,scale:void 0,type:ov.VARIABLE,option:f};if(!o||!o.length)return f&&f.type?v.scale=this.createDefaultScale(f):(v.scale=kg([t]),v.type=ov.CONSTANT),v;var y=(l=o.find(function(M){return!E_(M[t])}))===null||l===void 0?void 0:l[t];if(this.isNumber(t)||E_(y)&&!f)v.scale=kg([t]),v.type=ov.CONSTANT;else{var b=f&&f.type||this.getDefaultType(y);i==="text"&&(b=ro.CAT),i===void 0&&(b=ro.IDENTITY);var T=this.createScaleConfig(b,t,f,o);v.scale=this.createDefaultScale(T),v.option=T}return v}},{key:"getDefaultType",value:function(t){var n=ro.LINEAR;return typeof t=="string"&&(n=q5.test(t)?ro.TIME:ro.CAT),n}},{key:"createScaleConfig",value:function(t,n,i,o){var s={type:t},l=(o==null?void 0:o.map(function(y){return y[n]}))||[];if(i!=null&&i.domain)s.domain=i==null?void 0:i.domain;else if(t===ro.CAT||t===ro.IDENTITY)s.domain=Y5(l);else if(t===ro.QUANTILE)s.domain=l;else if(t===ro.DIVERGING){var f=vx(l),v=(i==null?void 0:i.neutral)!==void 0?i==null?void 0:i.neutral:(f[0]+f[1])/2;s.domain=[f[0],v,f[1]]}else s.domain=vx(l);return(0,V.Z)((0,V.Z)({},s),i)}},{key:"createDefaultScale",value:function(t){var n=t.type,i=t.domain,o=t.unknown,s=t.clamp,l=t.nice,f=K5[n]();return i&&f.domain&&f.domain(i),o&&f.unknown(o),s!==void 0&&f.clamp&&f.clamp(s),l!==void 0&&f.nice&&f.nice(l),f}}]),e}())||Bb),Lb,Nb,J5=(Lb=(0,yt.b2)(),Lb(Nb=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"apply",value:function(t){t.hooks.beforeRender.tap("LayerAnimateStylePlugin",function(){var n=t.animateStatus;n&&t.models.forEach(function(i){i.addUniforms((0,V.Z)({},t.layerModel.getAnimateUniforms()))})})}}]),e}())||Nb),Ub,zb,eO=(Ub=(0,yt.b2)(),Ub(zb=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"apply",value:function(t){t.hooks.afterInit.tap("LayerMaskPlugin",function(){var n=t.getLayerConfig(),i=n.maskLayers,o=n.enableMask;if(!t.tileLayer&&i&&i.length>0){var s;(s=t.masks).push.apply(s,(0,Kt.Z)(i)),t.updateLayerConfig({mask:o})}})}}]),e}())||zb),tO=function(){function e(r){var t=r.rendererService,n=r.layerService,i=r.parent;(0,Q.Z)(this,e),(0,B.Z)(this,"tileResource",new Map),(0,B.Z)(this,"layerTiles",[]),this.rendererService=t,this.layerService=n,this.parent=i}return(0,j.Z)(e,[{key:"tiles",get:function(){return this.layerTiles}},{key:"hasTile",value:function(t){return this.layerTiles.some(function(n){return n.key===t})}},{key:"addTile",value:function(t){this.layerTiles.push(t)}},{key:"getTile",value:function(t){return this.layerTiles.find(function(n){return n.key===t})}},{key:"getVisibleTileBylngLat",value:function(t){return this.layerTiles.find(function(n){return n.isLoaded&&n.visible&&n.lnglatInBounds(t)})}},{key:"removeTile",value:function(t){var n=this.layerTiles.findIndex(function(o){return o.key===t}),i=this.layerTiles.splice(n,1);i[0]&&i[0].destroy()}},{key:"updateTileVisible",value:function(t){var n=this.getTile(t.key);if(t.isVisible)if(t.parent){var i=this.isChildrenLoaded(t.parent);n==null||n.updateVisible(i)}else n==null||n.updateVisible(!0);else if(t.parent){var o=this.isChildrenLoaded(t.parent);n==null||n.updateVisible(!o)}else n==null||n.updateVisible(!1)}},{key:"isParentLoaded",value:function(t){var n=t.parent;if(!n)return!0;var i=this.getTile(n==null?void 0:n.key);return!!(i!=null&&i.isLoaded)}},{key:"isChildrenLoaded",value:function(t){var n=this,i=t==null?void 0:t.children;return i.length===0?!0:i.every(function(o){var s=n.getTile(o==null?void 0:o.key);return s?(s==null?void 0:s.isLoaded)===!0:!0})}},{key:"render",value:function(){var r=(0,Pt.Z)(ge().mark(function n(){var i=this,o,s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return o=this.getRenderLayers(),s=o.map(function(){var v=(0,Pt.Z)(ge().mark(function y(b){return ge().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return M.next=2,i.layerService.renderTileLayer(b);case 2:case"end":return M.stop()}},y)}));return function(y){return v.apply(this,arguments)}}()),f.next=4,Promise.all(s);case 4:case"end":return f.stop()}},n,this)}));function t(){return r.apply(this,arguments)}return t}()},{key:"getRenderLayers",value:function(){var t=this.layerTiles.filter(function(i){return i.visible&&i.isLoaded}),n=[];return t.map(function(i){return n.push.apply(n,(0,Kt.Z)(i.getLayers()))}),n}},{key:"getLayers",value:function(){var t=this.layerTiles.filter(function(i){return i.isLoaded}),n=[];return t.map(function(i){return n.push.apply(n,(0,Kt.Z)(i.getLayers()))}),n}},{key:"getTiles",value:function(){return this.layerTiles}},{key:"destroy",value:function(){this.layerTiles.forEach(function(t){return t.destroy()}),this.tileResource.clear()}}]),e}(),rO=L(37824);function nO(e,r,t){t===void 0&&(t={});var n=Zr(e),i=Zr(r),o=rO.union(n.coordinates,i.coordinates);return o.length===0?null:o.length===1?Lt(o[0],t.properties):Kr(o,t.properties)}var iO=nO,aO=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"getCombineFeature",value:function(t){var n=null,i=t[0];return t.map(function(o){var s=Lt(o.coordinates);n===null?n=s:n=iO(n,s)}),i&&(n.properties=(0,V.Z)({},i)),n}}]),e}(),Tm="select",wm="active",oO=function(){function e(r){var t=r.layerService,n=r.tileLayerService,i=r.parent;(0,Q.Z)(this,e),(0,B.Z)(this,"tilePickID",new Map),this.layerService=t,this.tileLayerService=n,this.parent=i,this.tileSourceService=new aO}return(0,j.Z)(e,[{key:"pickRender",value:function(t){var n=this.tileLayerService.getVisibleTileBylngLat(t.lngLat);if(n){var i=n.getMainLayer();i==null||i.layerPickService.pickRender(t)}}},{key:"pick",value:function(t,n){var i=this.parent.getContainer(),o=i.get(ot.IPickingService);if(t.type==="RasterLayer"){var s=this.tileLayerService.getVisibleTileBylngLat(n.lngLat);if(s&&s.getMainLayer()!==void 0){var l=s.getMainLayer();return l.layerPickService.pickRasterLayer(l,n,this.parent)}return!1}return this.pickRender(n),o.pickFromPickingFBO(t,n)}},{key:"selectFeature",value:function(t){var n=(0,Sn.Z)(t,3),i=n[0],o=n[1],s=n[2],l=this.color2PickId(i,o,s);this.tilePickID.set(Tm,l),this.updateHighLight(i,o,s,Tm)}},{key:"highlightPickedFeature",value:function(t){var n=(0,Sn.Z)(t,3),i=n[0],o=n[1],s=n[2],l=this.color2PickId(i,o,s);this.tilePickID.set(wm,l),this.updateHighLight(i,o,s,wm)}},{key:"updateHighLight",value:function(t,n,i,o){this.tileLayerService.tiles.map(function(s){var l=s.getMainLayer();switch(o){case Tm:l==null||l.hooks.beforeSelect.call([t,n,i]);break;case wm:l==null||l.hooks.beforeHighlight.call([t,n,i]);break}})}},{key:"setPickState",value:function(){var t=this.tilePickID.get(Tm),n=this.tilePickID.get(wm);if(t){var i=this.pickId2Color(t),o=(0,Sn.Z)(i,3),s=o[0],l=o[1],f=o[2];this.updateHighLight(s,l,f,Tm);return}if(n){var v=this.pickId2Color(n),y=(0,Sn.Z)(v,3),b=y[0],T=y[1],M=y[2];this.updateHighLight(b,T,M,wm);return}}},{key:"color2PickId",value:function(t,n,i){return Oa(new Uint8Array([t,n,i]))}},{key:"pickId2Color",value:function(t){return sa(t)}},{key:"getFeatureById",value:function(t){var n=this.tileLayerService.getTiles().filter(function(o){return o.visible}),i=[];return n.forEach(function(o){i.push.apply(i,(0,Kt.Z)(o.getFeatureById(t)))}),i}},{key:"pickRasterLayer",value:function(t,n,i){return!1}}]),e}();function sO(e){return e==="PolygonLayer"?Rg:e==="LineLayer"?q0:Cg}function uO(e){return["PolygonLayer","LineLayer"].indexOf(e)!==-1}function lO(e){var r=cO();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function cO(){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(e){return!1}}var xd=function(e){(0,Le.Z)(t,e);var r=lO(t);function t(n,i){var o;return(0,Q.Z)(this,t),o=r.call(this),(0,B.Z)((0,Fe.Z)(o),"visible",!0),(0,B.Z)((0,Fe.Z)(o),"layers",[]),(0,B.Z)((0,Fe.Z)(o),"isLoaded",!1),(0,B.Z)((0,Fe.Z)(o),"tileMaskLayers",[]),o.parent=i,o.sourceTile=n,o.x=n.x,o.y=n.y,o.z=n.z,o.key="".concat(o.x,"_").concat(o.y,"_").concat(o.z),o}return(0,j.Z)(t,[{key:"getLayers",value:function(){return this.layers}},{key:"styleUpdate",value:function(){}},{key:"lnglatInBounds",value:function(i){var o=(0,Sn.Z)(this.sourceTile.bounds,4),s=o[0],l=o[1],f=o[2],v=o[3],y=i.lng,b=i.lat;return y>=s&&y<=f&&b>=l&&b<=v}},{key:"getLayerOptions",value:function(){var i,o=this.parent.getLayerConfig();return(0,V.Z)((0,V.Z)({},o),{},{textAllowOverlap:!0,autoFit:!1,maskLayers:this.getMaskLayer(),tileMask:uO(this.parent.type),mask:o.mask||((i=o.maskLayers)===null||i===void 0?void 0:i.length)!==0&&o.enableMask})}},{key:"getMaskLayer",value:function(){var i=this,o=this.parent.getLayerConfig(),s=o.maskLayers,l=[];return s==null||s.forEach(function(f){if(!f.tileLayer)return l.push(f),f;var v=f.tileLayer,y=v.getTile(i.sourceTile.key),b=y==null?void 0:y.getLayers()[0];b&&l.push(b)}),l}},{key:"addTileMask",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f;return ge().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return s=new Rg({visible:!1,enablePicking:!1}).source({type:"FeatureCollection",features:[this.sourceTile.bboxPolygon]},{parser:{type:"geojson",featureId:"id"}}).shape("fill").style({opacity:.5}),l=lm(this.parent.sceneContainer),s.setContainer(l,this.parent.sceneContainer),y.next=5,s.init();case 5:return this.tileMask=s,f=this.getMainLayer(),f!==void 0&&(f.tileMask=s),y.abrupt("return",s);case 9:case"end":return y.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"addMask",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s,l){var f;return ge().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return f=lm(this.parent.sceneContainer),l.setContainer(f,this.parent.sceneContainer),y.next=4,l.init();case 4:s.addMask(l),this.tileMaskLayers.push(l);case 6:case"end":return y.stop()}},o,this)}));function i(o,s){return n.apply(this,arguments)}return i}()},{key:"addLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s){var l;return ge().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return s.isTileLayer=!0,l=lm(this.parent.sceneContainer),s.setContainer(l,this.parent.sceneContainer),this.layers.push(s),v.next=6,s.init();case 6:case"end":return v.stop()}},o,this)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"updateVisible",value:function(i){this.visible=i,this.updateOptions("visible",i)}},{key:"updateOptions",value:function(i,o){this.layers.forEach(function(s){s.updateLayerConfig((0,B.Z)({},i,o))})}},{key:"getMainLayer",value:function(){return this.layers[0]}},{key:"getFeatures",value:function(i){return[]}},{key:"getFeatureById",value:function(i){return[]}},{key:"destroy",value:function(){var i;(i=this.tileMask)===null||i===void 0||i.destroy(),this.layers.forEach(function(o){return o.destroy()})}}]),t}(io.EventEmitter);function fO(e){var r=hO();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function hO(){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(e){return!1}}var pO=function(e){(0,Le.Z)(t,e);var r=fO(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"initTileLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.getSourceOption(),l=s.data.features[0].properties,f=new q0().source(s.data,s.options).size(1).shape("line").color("red"),v=new Cg({minZoom:this.z-1,maxZoom:this.z+1,textAllowOverlap:!0}).source([l],{parser:{type:"json",x:"x",y:"y"}}).size(20).color("red").shape(this.key).style({stroke:"#fff",strokeWidth:2}),b.next=6,this.addLayer(f);case 6:return b.next=8,this.addLayer(v);case 8:this.isLoaded=!0;case 9:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),o=this.sourceTile.data.layers.testTile.features;return{data:{type:"FeatureCollection",features:o},options:{parser:{type:"geojson"},transforms:i.transforms}}}}]),t}(xd);function dO(e){var r=vO();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function vO(){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(e){return!1}}var mO=function(e){(0,Le.Z)(t,e);var r=dO(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"initTileLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=this.getSourceOption(),v=new P1((0,V.Z)({},l)).source(f.data,f.options),s&&Object.keys(s).forEach(function(T){var M,O,F=T;v[F]((M=s[F])===null||M===void 0?void 0:M.field,(O=s[F])===null||O===void 0?void 0:O.values)}),b.next=7,this.addLayer(v);case 7:this.isLoaded=!0;case 8:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource();return{data:this.sourceTile.data,options:{parser:{type:"image",extent:this.sourceTile.bounds},transforms:i.transforms}}}}]),t}(xd);function gO(e){var r=_O();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function _O(){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(e){return!1}}var yO=function(e){(0,Le.Z)(t,e);var r=gO(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"initTileLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=this.getSourceOption(),v=new ix((0,V.Z)({},l)).source(f.data,f.options),s&&Object.keys(s).forEach(function(T){var M,O,F=T;v[F]((M=s[F])===null||M===void 0?void 0:M.field,(O=s[F])===null||O===void 0?void 0:O.values)}),b.next=7,this.addLayer(v);case 7:this.isLoaded=!0;case 8:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getFeatures",value:function(i){if(!i)return[];var o=this.sourceTile.data;return o.getTileData(i)}},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),o=this.parent.getLayerConfig(),s=o.sourceLayer,l=o.featureId,f=this.getFeatures(s);return{data:{type:"FeatureCollection",features:f},options:{parser:{type:"geojson",featureId:l},transforms:i.transforms}}}}]),t}(xd),xO=["rasterData"];function bO(e){var r=EO();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function EO(){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(e){return!1}}var SO=function(e){(0,Le.Z)(t,e);var r=bO(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"initTileLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=this.getSourceOption(),v=new Mg((0,V.Z)({},l)).source(f.data,f.options),s&&Object.keys(s).forEach(function(T){var M,O,F=T;v[F]((M=s[F])===null||M===void 0?void 0:M.field,(O=s[F])===null||O===void 0?void 0:O.values)}),b.next=7,this.addLayer(v);case 7:this.isLoaded=!0;case 8:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),o=this.sourceTile.data.data,s=o.rasterData,l=(0,ka.Z)(o,xO);return{data:s,options:{parser:(0,V.Z)({type:"rasterRgb",extent:this.sourceTile.bounds},l),transforms:i.transforms}}}}]),t}(xd);function AO(e){var r=TO();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function TO(){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(e){return!1}}var wO=function(e){(0,Le.Z)(t,e);var r=AO(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"initTileLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=this.getSourceOption(),v=new Mg((0,V.Z)({},l)).source(f.data,f.options),s&&Object.keys(s).forEach(function(T){var M,O,F=T;v[F]((M=s[F])===null||M===void 0?void 0:M.field,(O=s[F])===null||O===void 0?void 0:O.values)}),b.next=7,this.addLayer(v);case 7:this.isLoaded=!0;case 8:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource();return{data:this.sourceTile.data,options:{parser:{type:"image",extent:this.sourceTile.bounds},transforms:i.transforms}}}}]),t}(xd),CO=["rasterData"];function RO(e){var r=MO();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function MO(){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(e){return!1}}var IO={positions:[0,1],colors:["#000","#fff"]},PO=function(e){(0,Le.Z)(t,e);var r=RO(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"initTileLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b,T;return ge().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=this.getSourceOption(),v=this.getLayerOptions(),y=v.rampColors,b=v.domain,this.colorTexture=this.parent.textureService.getColorTexture(y,b),T=new Mg((0,V.Z)((0,V.Z)({},l),{},{colorTexture:this.colorTexture})).source(f.data,f.options),s&&Object.keys(s).forEach(function(F){var $,G,ue=F;T[ue](($=s[ue])===null||$===void 0?void 0:$.field,(G=s[ue])===null||G===void 0?void 0:G.values)}),O.next=9,this.addLayer(T);case 9:this.isLoaded=!0;case 10:case"end":return O.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),o=this.sourceTile.data.data,s=o.rasterData,l=(0,ka.Z)(o,CO);return{data:s,options:{parser:(0,V.Z)({type:"raster",extent:this.sourceTile.bounds},l),transforms:i.transforms}}}},{key:"styleUpdate",value:function(){for(var i=this,o=arguments.length,s=new Array(o),l=0;l=2&&!v&&(t.parent.updateLayerConfig({visible:!0}),t.layerService.reRender())}t.lastViewStates&&t.lastViewStates.zoom===l&&t.lastViewStates.latLonBounds.toString()===s.toString()||(t.lastViewStates={zoom:l,latLonBounds:s},(i=t.tilesetManager)===null||i===void 0||i.throttleUpdate(l,s))}}),(0,B.Z)(this,"viewchange",BO(this.mapchange,24)),this.parent=r;var n=this.parent.getContainer();this.rendererService=n.get(ot.IRendererService),this.layerService=n.get(ot.ILayerService),this.mapService=n.get(ot.IMapService),this.pickingService=n.get(ot.IPickingService),this.tileLayerService=new tO({rendererService:this.rendererService,layerService:this.layerService,parent:r}),this.tilePickService=new oO({tileLayerService:this.tileLayerService,layerService:this.layerService,parent:r}),this.parent.setLayerPickService(this.tilePickService),this.proxy(r),this.initTileSetManager()}return(0,j.Z)(e,[{key:"initTileSetManager",value:function(){var t,n=this.parent.getSource();if(this.tilesetManager=n.tileset,this.initedTileset||(this.bindTilesetEvent(),this.initedTileset=!0),this.parent.isVisible()!==!1){var i=this.getCurrentView(),o=i.latLonBounds,s=i.zoom;(t=this.tilesetManager)===null||t===void 0||t.update(s,o)}}},{key:"getCurrentView",value:function(){var t=this.mapService.getBounds(),n=[t[0][0],t[0][1],t[1][0],t[1][1]],i=this.mapService.getZoom();return{latLonBounds:n,zoom:i}}},{key:"bindTilesetEvent",value:function(){var t=this;this.tilesetManager.on("tile-loaded",function(n){}),this.tilesetManager.on("tile-unload",function(n){t.tileUnLoad(n)}),this.tilesetManager.on("tile-error",function(n,i){t.tileError(n)}),this.tilesetManager.on("tile-update",function(){t.tileUpdate()}),this.mapService.on("zoomend",this.mapchange),this.mapService.on("moveend",this.viewchange)}},{key:"render",value:function(){this.tileLayerService.render()}},{key:"getLayers",value:function(){return this.tileLayerService.getLayers()}},{key:"getTiles",value:function(){return this.tileLayerService.getTiles()}},{key:"getTile",value:function(t){return this.tileLayerService.getTile(t)}},{key:"tileLoaded",value:function(t){}},{key:"tileError",value:function(t){console.warn("error:",t)}},{key:"destroy",value:function(){var t;this.mapService.off("zoomend",this.mapchange),this.mapService.off("moveend",this.viewchange),(t=this.tilesetManager)===null||t===void 0||t.destroy(),this.tileLayerService.destroy()}},{key:"reload",value:function(){var t;this.tilesetManager.clear();var n=this.getCurrentView(),i=n.latLonBounds,o=n.zoom;(t=this.tilesetManager)===null||t===void 0||t.update(o,i)}},{key:"tileUnLoad",value:function(t){this.tileLayerService.removeTile(t.key)}},{key:"tileUpdate",value:function(){var r=(0,Pt.Z)(ge().mark(function n(){var i=this,o,s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(this.tilesetManager){f.next=2;break}return f.abrupt("return");case 2:return o=this.parent.getMinZoom(),s=this.parent.getMaxZoom(),f.next=6,Promise.all(this.tilesetManager.tiles.filter(function(v){return v.isLoaded}).filter(function(v){return v.isVisibleChange}).filter(function(v){return v.data}).filter(function(v){return v.z>=o&&v.z>>8&255}function ch(e){return e>>>16&255}function Sv(e){return e&255}function SE(e){switch(e){case Rr.F32:case Rr.U32:case Rr.S32:return 4;case Rr.U16:case Rr.S16:case Rr.F16:return 2;case Rr.U8:case Rr.S8:return 1;default:throw new Error("whoops")}}function AE(e){return SE(ch(e))}function mN(e){return Qg(e)}function p4(e){var r=SE(ch(e)),t=Qg(e);return r*t}function gN(e,r){return e&4294967040|r}function _N(e,r){return e&4294902015|r<<8}function TE(e){var r=Sv(e);if(r&wn.Depth)return zo.Depth;if(r&wn.Normalized)return zo.Float;var t=ch(e);if(t===Rr.F16||t===Rr.F32)return zo.Float;if(t===Rr.U8||t===Rr.U16||t===Rr.U32)return zo.Uint;if(t===Rr.S8||t===Rr.S16||t===Rr.S32)return zo.Sint;throw new Error("whoops")}function Bi(e,r){if(r===void 0&&(r=""),!e)throw new Error("Assert fail: ".concat(r))}function Ad(e){if(e!=null)return e;throw new Error("Missing object")}function wE(e,r){return e.r===r.r&&e.g===r.g&&e.b===r.b&&e.a===r.a}function CE(e,r){e.r=r.r,e.g=r.g,e.b=r.b,e.a=r.a}function RE(e){var r=e.r,t=e.g,n=e.b,i=e.a;return{r,g:t,b:n,a:i}}function Jg(e,r,t,n){return n===void 0&&(n=1),{r:e,g:r,b:t,a:n}}var A_=Jg(0,0,0,0),yN=Jg(0,0,0,1),d4=Jg(1,1,1,0),xN=Jg(1,1,1,1),Av=!0;function bN(e,r){r===void 0&&(r=Av),r&&(e[10]=-e[10],e[14]=-e[14])}function EN(e,r){r===void 0&&(r=Av),r&&(e[10]=-e[10],e[14]=-e[14]+1)}function v4(e,r){if(r===void 0&&(r=Av),r)switch(e){case _a.LESS:return _a.GREATER;case _a.LEQUAL:return _a.GEQUAL;case _a.GEQUAL:return _a.LEQUAL;case _a.GREATER:return _a.LESS;default:return e}else return e}function SN(e,r){return r===void 0&&(r=Av),r?1-e:e}function AN(e,r){return r===void 0&&(r=Av),r?-e:e}function TN(e,r,t,n){if(n===void 0&&(n=Av),t=v4(t,n),t===_a.LESS)return er;if(t===_a.GEQUAL)return e>=r;throw new Error("whoops")}function e0(e){return!!(e&&!(e&e-1))}function Tv(e,r){return e!=null?e:r}function m4(e){return e===void 0?null:e}function wN(e,r,t){e.length=r,e.fill(t)}function t0(e,r){var t=r-1;return e+t&~t}function CN(e,r){return((e+r-1)/r|0)*r}function g4(e,r,t){for(var n=0,i=e.length;n>>1),s=t(r,e[o]);s<0?i=o:n=o+1}return n}function RN(e,r,t){var n=g4(e,r,t);e.splice(n,0,r)}function MN(e,r,t){return t?e|=r:e&=~r,e}function _4(e,r){for(var t=new Array(e),n=0;n-1;if(f=f.replace(";","").replace("[","").trim(),!l.startsWith("#")){if(l){var y=t.find(function(M){return l===M.type});if(y)if(v)for(var b=function(M){y.uniforms.forEach(function(O){r.push("".concat(f,"[").concat(M,"].").concat(O.name))})},T=0;T<5;T++)b(T);else y.uniforms.forEach(function(M){r.push("".concat(f,".").concat(M.name))})}f&&r.push(f)}}),""}),r}function NE(e){if(e===void 0)return null;var r=/binding\s*=\s*(\d+)/.exec(e);if(r!==null){var t=parseInt(r[1],10);if(!Number.isNaN(t))return t}return null}function H4(e){var r="",t=e;return[t,r]}function Np(e,r,t,n,i){var o;n===void 0&&(n=null),i===void 0&&(i=!0);var s=e.glslVersion==="#version 100",l=r==="frag"&&((o=t.match(/^\s*layout\(location\s*=\s*\d*\)\s*out\s+vec4\s*(.*);$/gm))===null||o===void 0?void 0:o.length)>1,f=t.replace(`\r `,` `).split(` `).map(function(ht){return ht.replace(/[/][/].*$/,"")}).filter(function(ht){var gt=!ht||/^\s+$/.test(ht);return!gt}),v="";n!==null&&(v=Object.keys(n).map(function(ht){return Om(ht,n[ht])}).join(` `));var y=f.find(function(ht){return ht.startsWith("precision")})||"precision mediump float;",b=i?f.filter(function(ht){return!ht.startsWith("precision")}).join(` `):f.join(` `),T="";if(e.viewportOrigin===bv.UPPER_LEFT&&(T+="".concat(Om("VIEWPORT_ORIGIN_TL","1"),` `)),e.clipSpaceNearZ===Ev.ZERO&&(T+="".concat(Om("CLIPSPACE_NEAR_ZERO","1"),` `)),e.explicitBindingLocations){var M=0,O=0,F=0;b=b.replace(/^(layout\((.*)\))?\s*uniform(.+{)$/gm,function(ht,gt,Ot,tr){var Ir=Ot?"".concat(Ot,", "):"";return"layout(".concat(Ir,"set = ").concat(M,", binding = ").concat(O++,") uniform ").concat(tr)}),M++,O=0,Bi(e.separateSamplerTextures),b=b.replace(/^(layout\((.*)\))?\s*uniform sampler(\w+) (.*);/gm,function(ht,gt,Ot,tr,Ir){var Er=NE(Ot);Er===null&&(Er=O++);var mn=(0,Mn.CR)(H4(tr),2),Ln=mn[0],Fi=mn[1];return r==="frag"?` layout(set = `.concat(M,", binding = ").concat(Er*2+0,") uniform texture").concat(Ln," T_").concat(Ir,`; layout(set = `).concat(M,", binding = ").concat(Er*2+1,") uniform sampler").concat(Fi," S_").concat(Ir,";").trim():""}),b=b.replace(r==="frag"?/^\s*\b(varying|in)\b/gm:/^\s*\b(varying|out)\b/gm,function(ht,gt){return"layout(location = ".concat(F++,") ").concat(gt)}),T+="".concat(Om("gl_VertexID","gl_VertexIndex"),` `),T+="".concat(Om("gl_InstanceID","gl_InstanceIndex"),` `),y=y.replace(/^precision (.*) sampler(.*);$/gm,"")}else{var $=0;b=b.replace(/^(layout\((.*)\))?\s*uniform sampler(\w+) (.*);/gm,function(ht,gt,Ot,tr,Ir){var Er=NE(Ot);return Er===null&&(Er=$++),"uniform sampler".concat(tr," ").concat(Ir,"; // BINDING=").concat(Er)})}if(e.separateSamplerTextures)b=b.replace(/\bSAMPLER_(\w+)\((.*?)\)/g,function(ht,gt,Ot){return"sampler".concat(gt,"(T_").concat(Ot,", S_").concat(Ot,")")}),b=b.replace(/\bTEXTURE\((.*?)\)/g,function(ht,gt){return"T_".concat(gt)});else{var G=[];b=b.replace(/\bSAMPLER_(\w+)\((.*?)\)/g,function(ht,gt,Ot){return G.push([Ot,gt]),Ot}),s&&G.forEach(function(ht){var gt=(0,Mn.CR)(ht,2),Ot=gt[0],tr=gt[1];b=b.replace(new RegExp("texture\\(".concat(Ot),"g"),function(){return"texture".concat(tr,"(").concat(Ot)})}),b=b.replace(/\bTEXTURE\((.*?)\)/g,function(ht,gt){return gt})}var ue="".concat(s?"":e.glslVersion,` `).concat(s&&l?`#extension GL_EXT_draw_buffers : require `:"",` `).concat(s&&r==="frag"?`#extension GL_OES_standard_derivatives : enable `:"").concat(i?y:"",` `).concat(T||"").concat(v?v+` `:"",` `).concat(b,` `).trim();if(e.explicitBindingLocations&&r==="frag"&&(ue=ue.replace(/^\b(out)\b/g,function(ht,gt){return"layout(location = 0) ".concat(gt)})),s){if(r==="frag"&&(ue=ue.replace(/^\s*in\s+(\S+)\s*(.*);$/gm,function(ht,gt,Ot){return"varying ".concat(gt," ").concat(Ot,`; `)})),r==="vert"&&(ue=ue.replace(/^\s*out\s+(\S+)\s*(.*);$/gm,function(ht,gt,Ot){return"varying ".concat(gt," ").concat(Ot,`; `)}),ue=ue.replace(/^\s*layout\(location\s*=\s*\S*\)\s*in\s+(\S+)\s*(.*);$/gm,function(ht,gt,Ot){return"attribute ".concat(gt," ").concat(Ot,`; `)})),ue=ue.replace(/\s*uniform\s*.*\s*{((?:\s*.*\s*)*?)};/g,function(ht,gt){return gt.trim().replace(/^.*$/gm,function(Ot){var tr=Ot.trim();return tr.startsWith("#")?tr:Ot?"uniform ".concat(tr):""})}),r==="frag")if(l){var xe=[];ue=ue.replace(/^\s*layout\(location\s*=\s*\d*\)\s*out\s+vec4\s*(.*);$/gm,function(ht,gt){return xe.push(gt),"vec4 ".concat(gt,`; `)});var ze=ue.lastIndexOf("}");ue=ue.substring(0,ze)+` `.concat(xe.map(function(ht,gt){return"gl_FragData[".concat(gt,"] = ").concat(ht,`; `)}).join(` `))+ue.substring(ze)}else{var Je;if(ue=ue.replace(/^\s*out\s+(\S+)\s*(.*);$/gm,function(ht,gt,Ot){return Je=Ot,"".concat(gt," ").concat(Ot,`; `)}),Je){var ze=ue.lastIndexOf("}");ue=ue.substring(0,ze)+` gl_FragColor = vec4(`.concat(Je,`); `)+ue.substring(ze)}}ue=ue.replace(/^\s*layout\((.*)\)/gm,"")}return ue}function ZN(e,r,t,n){n===void 0&&(n=null);var i=Np(e,"vert",r,n),o=Np(e,"frag",t,n);return{vert:r,frag:t,preprocessedVert:i,preprocessedFrag:o}}var Tf=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=e.call(this)||this;return o.id=n,o.device=i,o.device.resourceCreationTracker!==null&&o.device.resourceCreationTracker.trackResourceCreated(o),o}return r.prototype.destroy=function(){this.device.resourceCreationTracker!==null&&this.device.resourceCreationTracker.trackResourceDestroyed(this)},r}(bE.Z),W4=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=ya.Bindings;var l=o.uniformBufferBindings,f=o.samplerBindings;return s.uniformBufferBindings=l||[],s.samplerBindings=f||[],s.bindingLayouts=s.createBindingLayouts(),s}return r.prototype.createBindingLayouts=function(){var t=0,n=0,i=[],o=this.uniformBufferBindings.length,s=this.samplerBindings.length;return i.push({firstUniformBuffer:t,numUniformBuffers:o,firstSampler:n,numSamplers:s}),t+=o,n+=s,{numUniformBuffers:t,numSamplers:n,bindingLayoutTables:i}},r}(Tf);function Hn(e){return typeof WebGL2RenderingContext!="undefined"&&e instanceof WebGL2RenderingContext?!0:!!(e&&e._version===2)}function UE(e){var r=ch(e);switch(r){case Rr.BC1:case Rr.BC2:case Rr.BC3:case Rr.BC4_UNORM:case Rr.BC4_SNORM:case Rr.BC5_UNORM:case Rr.BC5_SNORM:return!0;default:return!1}}function zE(e){var r=Sv(e);if(r&wn.Normalized)return!1;var t=ch(e);return t===Rr.S8||t===Rr.S16||t===Rr.S32||t===Rr.U8||t===Rr.U16||t===Rr.U32}function G4(e){switch(e){case Af.STATIC:return We.STATIC_DRAW;case Af.DYNAMIC:return We.DYNAMIC_DRAW}}function ZE(e){if(e&no.INDEX)return We.ELEMENT_ARRAY_BUFFER;if(e&no.VERTEX)return We.ARRAY_BUFFER;if(e&no.UNIFORM)return We.UNIFORM_BUFFER}function X4(e){switch(e){case ms.TRIANGLES:return We.TRIANGLES;case ms.POINTS:return We.POINTS;case ms.TRIANGLE_STRIP:return We.TRIANGLE_STRIP;case ms.LINES:return We.LINES;case ms.LINE_STRIP:return We.LINE_STRIP;default:throw new Error("Unknown primitive topology mode")}}function $4(e){switch(e){case Rr.U8:return We.UNSIGNED_BYTE;case Rr.U16:return We.UNSIGNED_SHORT;case Rr.U32:return We.UNSIGNED_INT;case Rr.S8:return We.BYTE;case Rr.S16:return We.SHORT;case Rr.S32:return We.INT;case Rr.F16:return We.HALF_FLOAT;case Rr.F32:return We.FLOAT;default:throw new Error("whoops")}}function Y4(e){switch(e){case Wn.R:return 1;case Wn.RG:return 2;case Wn.RGB:return 3;case Wn.RGBA:return 4;default:return 1}}function q4(e){var r=ch(e),t=Qg(e),n=Sv(e),i=$4(r),o=Y4(t),s=!!(n&wn.Normalized);return{size:o,type:i,normalized:s}}function K4(e){switch(e){case Mt.U8_R:return We.UNSIGNED_BYTE;case Mt.U16_R:return We.UNSIGNED_SHORT;case Mt.U32_R:return We.UNSIGNED_INT;default:throw new Error("whoops")}}function Dm(e){switch(e){case gl.CLAMP_TO_EDGE:return We.CLAMP_TO_EDGE;case gl.REPEAT:return We.REPEAT;case gl.MIRRORED_REPEAT:return We.MIRRORED_REPEAT;default:throw new Error("whoops")}}function a0(e,r){if(r===Xs.LINEAR&&e===vs.BILINEAR)return We.LINEAR_MIPMAP_LINEAR;if(r===Xs.LINEAR&&e===vs.POINT)return We.NEAREST_MIPMAP_LINEAR;if(r===Xs.NEAREST&&e===vs.BILINEAR)return We.LINEAR_MIPMAP_NEAREST;if(r===Xs.NEAREST&&e===vs.POINT)return We.NEAREST_MIPMAP_NEAREST;if(r===Xs.NO_MIP&&e===vs.BILINEAR)return We.LINEAR;if(r===Xs.NO_MIP&&e===vs.POINT)return We.NEAREST;throw new Error("Unknown texture filter mode")}function Rv(e,r){r===void 0&&(r=0);var t=e;return t.gl_buffer_pages[r/t.pageByteSize|0]}function Mv(e){var r=e;return r.gl_texture}function C_(e){var r=e;return r.gl_sampler}function Fm(e,r){e.name=r,e.__SPECTOR_Metadata={name:r}}function VE(e,r){for(var t=[];;){var n=r.exec(e);if(!n)break;t.push(n)}return t}function Up(e){return e.blendMode==Tu.ADD&&e.blendSrcFactor==la.ONE&&e.blendDstFactor===la.ZERO}function Q4(e){switch(e){case Kg.OcclusionConservative:return We.ANY_SAMPLES_PASSED_CONSERVATIVE;default:throw new Error("whoops")}}function J4(e){if(e===Gi.TEXTURE_2D)return We.TEXTURE_2D;if(e===Gi.TEXTURE_2D_ARRAY)return We.TEXTURE_2D_ARRAY;if(e===Gi.TEXTURE_CUBE_MAP)return We.TEXTURE_CUBE_MAP;if(e===Gi.TEXTURE_3D)return We.TEXTURE_3D;throw new Error("whoops")}function R_(e,r,t,n){return!(e%t!==0||r%n!==0)}var eD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=ya.Buffer;var l=o.viewOrSize,f=o.usage,v=o.hint,y=v===void 0?Af.STATIC:v,b=i.uniformBufferMaxPageByteSize,T=i.gl,M=f&no.UNIFORM;M||(Hn(T)?T.bindVertexArray(null):i.OES_vertex_array_object.bindVertexArrayOES(null));var O=(0,xv.Z)(l)?t0(l,4):t0(l.byteLength,4);s.gl_buffer_pages=[];var F;if(M){for(var $=O;$>0;)s.gl_buffer_pages.push(s.createBufferPage(Math.min($,b),f,y)),$-=b;F=b}else s.gl_buffer_pages.push(s.createBufferPage(O,f,y)),F=O;return s.pageByteSize=F,s.byteSize=O,s.usage=f,s.gl_target=ZE(f),(0,xv.Z)(l)||s.setSubData(0,new Uint8Array(l.buffer)),M||(Hn(T)?T.bindVertexArray(s.device.currentBoundVAO):i.OES_vertex_array_object.bindVertexArrayOES(s.device.currentBoundVAO)),s}return r.prototype.setSubData=function(t,n,i,o){i===void 0&&(i=0),o===void 0&&(o=n.byteLength-i);for(var s=this.device.gl,l=this.pageByteSize,f=t+o,v=t,y=t%l;v=1,!s){y=l.device.ensureResourceExists(f.createTexture());var T=l.device.translateTextureType(o.format),M=l.device.translateTextureInternalFormat(o.format);if(l.device.setActiveTexture(f.TEXTURE0),l.device.currentTextures[0]=null,l.preprocessImage(),o.dimension===Gi.TEXTURE_2D){if(v=We.TEXTURE_2D,f.bindTexture(v,y),l.immutable)if(Hn(f))f.texStorage2D(v,b,M,o.width,o.height);else{var O=(M===We.DEPTH_COMPONENT||l.isNPOT(),0);(l.format===Mt.D32F||l.format===Mt.D24_S8)&&!Hn(f)&&!i.WEBGL_depth_texture||(f.texImage2D(v,O,M,o.width,o.height,0,M,T,null),l.mipmaps&&(l.mipmaps=!1,f.texParameteri(We.TEXTURE_2D,We.TEXTURE_MIN_FILTER,We.LINEAR),f.texParameteri(We.TEXTURE_2D,We.TEXTURE_WRAP_S,We.CLAMP_TO_EDGE),f.texParameteri(We.TEXTURE_2D,We.TEXTURE_WRAP_T,We.CLAMP_TO_EDGE)))}Bi(o.depthOrArrayLayers===1)}else if(o.dimension===Gi.TEXTURE_2D_ARRAY)v=We.TEXTURE_2D_ARRAY,f.bindTexture(v,y),l.immutable&&Hn(f)&&f.texStorage3D(v,b,M,o.width,o.height,o.depthOrArrayLayers);else if(o.dimension===Gi.TEXTURE_3D)v=We.TEXTURE_3D,f.bindTexture(v,y),l.immutable&&Hn(f)&&f.texStorage3D(v,b,M,o.width,o.height,o.depthOrArrayLayers);else if(o.dimension===Gi.TEXTURE_CUBE_MAP)v=We.TEXTURE_CUBE_MAP,f.bindTexture(v,y),l.immutable&&Hn(f)&&f.texStorage2D(v,b,M,o.width,o.height),Bi(o.depthOrArrayLayers===6);else throw new Error("whoops")}return l.gl_texture=y,l.gl_target=v,l.mipLevelCount=b,l}return r.prototype.setImageData=function(t,n){n===void 0&&(n=0);var i=this.device.gl;UE(this.format);var o=this.gl_target===We.TEXTURE_3D||this.gl_target===We.TEXTURE_2D_ARRAY,s=this.gl_target===We.TEXTURE_CUBE_MAP,l=Z4(t[0]);this.device.setActiveTexture(i.TEXTURE0),this.device.currentTextures[0]=null;var f=t[0],v,y;l?(v=this.width,y=this.height):(v=f.width,y=f.height,this.width=v,this.height=y),i.bindTexture(this.gl_target,this.gl_texture);var b=this.device.translateTextureFormat(this.format),T=this.device.translateTextureType(this.format);this.preprocessImage();for(var M=0;M1){var n=ch(t.format);if(n===Rr.BC1)for(var i=t.width,o=t.height,s=0;s1?l.renderbufferStorageMultisample(We.RENDERBUFFER,T,F,v,y):l.renderbufferStorage(We.RENDERBUFFER,F,v,y)}return s.format=f,s.width=v,s.height=y,s.sampleCount=T,s}return r.prototype.destroy=function(){e.prototype.destroy.call(this),this.gl_renderbuffer!==null&&this.device.gl.deleteRenderbuffer(this.gl_renderbuffer),this.texture&&this.texture.destroy()},r}(Tf),Gl;(function(e){e[e.NeedsCompile=0]="NeedsCompile",e[e.Compiling=1]="Compiling",e[e.NeedsBind=2]="NeedsBind",e[e.ReadyToUse=3]="ReadyToUse"})(Gl||(Gl={}));var nD=function(e){(0,Mn.ZT)(r,e);function r(t,n){var i=t.id,o=t.device,s=t.descriptor,l=e.call(this,{id:i,device:o})||this;l.rawVertexGLSL=n,l.type=ya.Program,l.uniformSetters={},l.attributes=[];var f=l.device.gl;return l.descriptor=s,l.gl_program=l.device.ensureResourceExists(f.createProgram()),l.gl_shader_vert=null,l.gl_shader_frag=null,l.compileState=Gl.NeedsCompile,l.tryCompileProgram(),l}return r.prototype.destroy=function(){e.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)},r.prototype.tryCompileProgram=function(){var t,n;Bi(this.compileState===Gl.NeedsCompile);var i=this.descriptor,o=this.device.gl;!((t=i.vertex)===null||t===void 0)&&t.glsl&&(!((n=i.fragment)===null||n===void 0)&&n.glsl)&&(this.gl_shader_vert=this.compileShader(i.vertex.glsl,o.VERTEX_SHADER),this.gl_shader_frag=this.compileShader(i.fragment.glsl,o.FRAGMENT_SHADER),o.attachShader(this.gl_program,this.gl_shader_vert),o.attachShader(this.gl_program,this.gl_shader_frag),o.linkProgram(this.gl_program),this.compileState=Gl.Compiling,Hn(o)||(this.readUniformLocationsFromLinkedProgram(),this.readAttributesFromLinkedProgram()))},r.prototype.readAttributesFromLinkedProgram=function(){for(var t,n=this.device.gl,i=n.getProgramParameter(this.gl_program,n.ACTIVE_ATTRIBUTES),o=V4(this.descriptor.vertex.glsl),s=j4(this.rawVertexGLSL,o),l=function(y){var b=n.getActiveAttrib(f.gl_program,y),T=b.name,M=b.type,O=b.size,F=n.getAttribLocation(f.gl_program,T),$=(t=s.find(function(G){return G.name===T}))===null||t===void 0?void 0:t.location;F>=0&&!(0,Bp.Z)($)&&(f.attributes[$]={name:T,location:F,type:M,size:O})},f=this,v=0;v1)for(var f=0;f1&&f.device.EXT_texture_filter_anisotropic!==null&&(Bi(o.minFilter===vs.BILINEAR&&o.magFilter===vs.BILINEAR&&o.mipmapFilter===Xs.LINEAR),v.samplerParameterf(y,f.device.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT,b)),f.gl_sampler=y}else f.descriptor=o;return f}return r.prototype.setTextureParameters=function(t,n,i){var o,s=this.device.gl,l=this.descriptor;this.isNPOT(n,i)?s.texParameteri(We.TEXTURE_2D,We.TEXTURE_MIN_FILTER,We.LINEAR):s.texParameteri(t,We.TEXTURE_MIN_FILTER,a0(l.minFilter,l.mipmapFilter)),s.texParameteri(We.TEXTURE_2D,We.TEXTURE_WRAP_S,Dm(l.addressModeU)),s.texParameteri(We.TEXTURE_2D,We.TEXTURE_WRAP_T,Dm(l.addressModeV)),s.texParameteri(t,We.TEXTURE_MAG_FILTER,a0(l.magFilter,Xs.NO_MIP));var f=(o=l.maxAnisotropy)!==null&&o!==void 0?o:1;f>1&&this.device.EXT_texture_filter_anisotropic!==null&&(Bi(l.minFilter===vs.BILINEAR&&l.magFilter===vs.BILINEAR&&l.mipmapFilter===Xs.LINEAR),s.texParameteri(t,this.device.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT,f))},r.prototype.destroy=function(){e.prototype.destroy.call(this),Hn(this.device.gl)&&this.device.gl.deleteSampler(C_(this))},r.prototype.isNPOT=function(t,n){return!e0(t)||!e0(n)},r}(Tf),cD=function(){function e(){}return e.prototype.dispatchWorkgroups=function(r,t,n){},e.prototype.dispatchWorkgroupsIndirect=function(r,t){},e.prototype.setPipeline=function(r){},e.prototype.setBindings=function(r){},e.prototype.pushDebugGroup=function(r){},e.prototype.popDebugGroup=function(){},e.prototype.insertDebugMarker=function(r){},e}(),jE=65536,fD=/uniform(?:\s+)(\w+)(?:\s?){([^]*?)}/g,hD=function(){function e(r,t){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=wv(Td),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=bv.LOWER_LEFT,this.clipSpaceNearZ=Ev.NEGATIVE_ONE,this.supportMRT=!1,this.inBlitRenderPass=!1,this.supportedSampleCounts=[],this.occlusionQueriesRecommended=!1,this.computeShadersSupported=!1,this.gl=r,this.contextAttributes=Ad(r.getContextAttributes()),Hn(r)?(this.EXT_texture_norm16=r.getExtension("EXT_texture_norm16"),this.EXT_color_buffer_float=r.getExtension("EXT_color_buffer_float")):(this.OES_vertex_array_object=r.getExtension("OES_vertex_array_object"),this.ANGLE_instanced_arrays=r.getExtension("ANGLE_instanced_arrays"),this.OES_texture_float=r.getExtension("OES_texture_float"),this.WEBGL_draw_buffers=r.getExtension("WEBGL_draw_buffers"),this.WEBGL_depth_texture=r.getExtension("WEBGL_depth_texture"),this.WEBGL_color_buffer_float=r.getExtension("WEBGL_color_buffer_float"),this.EXT_color_buffer_half_float=r.getExtension("EXT_color_buffer_half_float"),r.getExtension("EXT_frag_depth"),r.getExtension("OES_element_index_uint"),r.getExtension("OES_standard_derivatives")),this.WEBGL_compressed_texture_s3tc=r.getExtension("WEBGL_compressed_texture_s3tc"),this.WEBGL_compressed_texture_s3tc_srgb=r.getExtension("WEBGL_compressed_texture_s3tc_srgb"),this.EXT_texture_compression_rgtc=r.getExtension("EXT_texture_compression_rgtc"),this.EXT_texture_filter_anisotropic=r.getExtension("EXT_texture_filter_anisotropic"),this.EXT_texture_norm16=r.getExtension("EXT_texture_norm16"),this.OES_texture_float_linear=r.getExtension("OES_texture_float_linear"),this.OES_texture_half_float_linear=r.getExtension("OES_texture_half_float_linear"),this.KHR_parallel_shader_compile=r.getExtension("KHR_parallel_shader_compile"),Hn(r)?(this.platformString="WebGL2",this.glslVersion="#version 300 es"):(this.platformString="WebGL1",this.glslVersion="#version 100"),this.scTexture=new M_({id:this.getNextUniqueId(),device:this,descriptor:{width:0,height:0,depthOrArrayLayers:1,dimension:Gi.TEXTURE_2D,mipLevelCount:1,usage:Ec.RENDER_TARGET,format:this.contextAttributes.alpha===!1?Mt.U8_RGB_RT:Mt.U8_RGBA_RT},fake:!0}),this.scTexture.formatKind=zo.Float,this.scTexture.gl_target=null,this.scTexture.gl_texture=null,this.resolveColorReadFramebuffer=this.ensureResourceExists(r.createFramebuffer()),this.resolveColorDrawFramebuffer=this.ensureResourceExists(r.createFramebuffer()),this.resolveDepthStencilReadFramebuffer=this.ensureResourceExists(r.createFramebuffer()),this.resolveDepthStencilDrawFramebuffer=this.ensureResourceExists(r.createFramebuffer()),this.renderPassDrawFramebuffer=this.ensureResourceExists(r.createFramebuffer()),this.readbackFramebuffer=this.ensureResourceExists(r.createFramebuffer()),this.fallbackTexture2D=this.createFallbackTexture(Gi.TEXTURE_2D,zo.Float),this.fallbackTexture2DDepth=this.createFallbackTexture(Gi.TEXTURE_2D,zo.Depth),this.fallbackVertexBuffer=this.createBuffer({viewOrSize:1,usage:no.VERTEX,hint:Af.STATIC}),Hn(r)&&(this.fallbackTexture2DArray=this.createFallbackTexture(Gi.TEXTURE_2D_ARRAY,zo.Float),this.fallbackTexture3D=this.createFallbackTexture(Gi.TEXTURE_3D,zo.Float),this.fallbackTextureCube=this.createFallbackTexture(Gi.TEXTURE_CUBE_MAP,zo.Float)),this.currentMegaState.depthCompare=_a.LESS,this.currentMegaState.depthWrite=!1,this.currentMegaState.attachmentsState[0].channelWriteMask=wu.ALL,r.enable(r.DEPTH_TEST),r.enable(r.STENCIL_TEST),this.checkLimits(),t.shaderDebug&&(this.shaderDebug=!0),t.trackResources&&(this.resourceCreationTracker=new uD)}return e.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()},e.prototype.createFallbackTexture=function(r,t){var n=r===Gi.TEXTURE_CUBE_MAP?6:1,i=t===zo.Depth?Mt.D32F:Mt.U8_RGBA_NORM,o=this.createTexture({dimension:r,format:i,usage:Ec.SAMPLED,width:1,height:1,depthOrArrayLayers:n,mipLevelCount:1});return t===zo.Float&&o.setImageData([new Uint8Array(4*n)]),Mv(o)},e.prototype.getNextUniqueId=function(){return++this.resourceUniqueId},e.prototype.checkLimits=function(){var r=this.gl;if(this.maxVertexAttribs=r.getParameter(We.MAX_VERTEX_ATTRIBS),Hn(r)){this.uniformBufferMaxPageByteSize=Math.min(r.getParameter(We.MAX_UNIFORM_BLOCK_SIZE),jE),this.uniformBufferWordAlignment=r.getParameter(r.UNIFORM_BUFFER_OFFSET_ALIGNMENT)/4;var t=r.getInternalformatParameter(r.RENDERBUFFER,r.DEPTH32F_STENCIL8,r.SAMPLES);this.supportedSampleCounts=t?(0,Mn.ev)([],(0,Mn.CR)(t),!1):[],this.occlusionQueriesRecommended=!0}else this.uniformBufferWordAlignment=64,this.uniformBufferMaxPageByteSize=jE;this.uniformBufferMaxPageWordSize=this.uniformBufferMaxPageByteSize/4,this.supportedSampleCounts.includes(1)||this.supportedSampleCounts.push(1),this.supportedSampleCounts.sort(function(n,i){return n-i})},e.prototype.configureSwapChain=function(r,t,n){var i=this.scTexture;i.width=r,i.height=t,this.scPlatformFramebuffer=m4(n)},e.prototype.getDevice=function(){return this},e.prototype.getCanvas=function(){return this.gl.canvas},e.prototype.getOnscreenTexture=function(){return this.scTexture},e.prototype.beginFrame=function(){},e.prototype.endFrame=function(){},e.prototype.translateTextureInternalFormat=function(r,t){switch(t===void 0&&(t=!1),r){case Mt.ALPHA:return We.ALPHA;case Mt.U8_LUMINANCE:case Mt.F16_LUMINANCE:case Mt.F32_LUMINANCE:return We.LUMINANCE;case Mt.F16_R:return We.R16F;case Mt.F16_RG:return We.RG16F;case Mt.F16_RGB:return We.RGB16F;case Mt.F16_RGBA:return We.RGBA16F;case Mt.F32_R:return We.R32F;case Mt.F32_RG:return We.RG32F;case Mt.F32_RGB:return We.RGB32F;case Mt.F32_RGBA:return Hn(this.gl)?We.RGBA32F:t?this.WEBGL_color_buffer_float.RGBA32F_EXT:We.RGBA;case Mt.U8_R_NORM:return We.R8;case Mt.U8_RG_NORM:return We.RG8;case Mt.U8_RGB_NORM:case Mt.U8_RGB_RT:return We.RGB8;case Mt.U8_RGB_SRGB:return We.SRGB8;case Mt.U8_RGBA_NORM:case Mt.U8_RGBA_RT:return Hn(this.gl)?We.RGBA8:t?We.RGBA4:We.RGBA;case Mt.U8_RGBA:return We.RGBA;case Mt.U8_RGBA_SRGB:case Mt.U8_RGBA_RT_SRGB:return We.SRGB8_ALPHA8;case Mt.U16_R:return We.R16UI;case Mt.U16_R_NORM:return this.EXT_texture_norm16.R16_EXT;case Mt.U16_RG_NORM:return this.EXT_texture_norm16.RG16_EXT;case Mt.U16_RGBA_NORM:return this.EXT_texture_norm16.RGBA16_EXT;case Mt.U16_RGBA_5551:return We.RGB5_A1;case Mt.U16_RGB_565:return We.RGB565;case Mt.U32_R:return We.R32UI;case Mt.S8_RGBA_NORM:return We.RGBA8_SNORM;case Mt.S8_RG_NORM:return We.RG8_SNORM;case Mt.BC1:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT;case Mt.BC1_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;case Mt.BC2:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT;case Mt.BC2_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;case Mt.BC3:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT;case Mt.BC3_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;case Mt.BC4_UNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_RED_RGTC1_EXT;case Mt.BC4_SNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT;case Mt.BC5_UNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT;case Mt.BC5_SNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;case Mt.D32F_S8:return Hn(this.gl)?We.DEPTH32F_STENCIL8:this.WEBGL_depth_texture?We.DEPTH_STENCIL:We.DEPTH_COMPONENT16;case Mt.D24_S8:return Hn(this.gl)?We.DEPTH24_STENCIL8:this.WEBGL_depth_texture?We.DEPTH_STENCIL:We.DEPTH_COMPONENT16;case Mt.D32F:return Hn(this.gl)?We.DEPTH_COMPONENT32F:this.WEBGL_depth_texture?We.DEPTH_COMPONENT:We.DEPTH_COMPONENT16;case Mt.D24:return Hn(this.gl)?We.DEPTH_COMPONENT24:this.WEBGL_depth_texture?We.DEPTH_COMPONENT:We.DEPTH_COMPONENT16;default:throw new Error("whoops")}},e.prototype.translateTextureType=function(r){var t=ch(r);switch(t){case Rr.U8:return We.UNSIGNED_BYTE;case Rr.U16:return We.UNSIGNED_SHORT;case Rr.U32:return We.UNSIGNED_INT;case Rr.S8:return We.BYTE;case Rr.F16:return We.HALF_FLOAT;case Rr.F32:return We.FLOAT;case Rr.U16_PACKED_5551:return We.UNSIGNED_SHORT_5_5_5_1;case Rr.D32F:return Hn(this.gl)?We.FLOAT:this.WEBGL_depth_texture?We.UNSIGNED_INT:We.UNSIGNED_BYTE;case Rr.D24:return Hn(this.gl)?We.UNSIGNED_INT_24_8:this.WEBGL_depth_texture?We.UNSIGNED_SHORT:We.UNSIGNED_BYTE;case Rr.D24S8:return Hn(this.gl)?We.UNSIGNED_INT_24_8:this.WEBGL_depth_texture?We.UNSIGNED_INT_24_8_WEBGL:We.UNSIGNED_BYTE;case Rr.D32FS8:return We.FLOAT_32_UNSIGNED_INT_24_8_REV;default:throw new Error("whoops")}},e.prototype.translateTextureFormat=function(r){if(UE(r)||r===Mt.F32_LUMINANCE||r===Mt.U8_LUMINANCE)return this.translateTextureInternalFormat(r);var t=Hn(this.gl)||!Hn(this.gl)&&!!this.WEBGL_depth_texture;switch(r){case Mt.D24_S8:case Mt.D32F_S8:return t?We.DEPTH_STENCIL:We.RGBA;case Mt.D24:case Mt.D32F:return t?We.DEPTH_COMPONENT:We.RGBA}var n=zE(r),i=Qg(r);switch(i){case Wn.A:return We.ALPHA;case Wn.R:return n?We.RED_INTEGER:We.RED;case Wn.RG:return n?We.RG_INTEGER:We.RG;case Wn.RGB:return n?We.RGB_INTEGER:We.RGB;case Wn.RGBA:return We.RGBA}},e.prototype.setActiveTexture=function(r){this.currentActiveTexture!==r&&(this.gl.activeTexture(r),this.currentActiveTexture=r)},e.prototype.bindVAO=function(r){this.currentBoundVAO!==r&&(Hn(this.gl)?this.gl.bindVertexArray(r):this.OES_vertex_array_object.bindVertexArrayOES(r),this.currentBoundVAO=r)},e.prototype.programCompiled=function(r){Bi(r.compileState!==Gl.NeedsCompile),r.compileState===Gl.Compiling&&(r.compileState=Gl.NeedsBind,this.shaderDebug&&this.checkProgramCompilationForErrors(r))},e.prototype.useProgram=function(r){this.currentProgram!==r&&(this.programCompiled(r),this.gl.useProgram(r.gl_program),this.currentProgram=r)},e.prototype.ensureResourceExists=function(r){if(r===null){var t=this.gl.getError();throw new Error("Created resource is null; GL error encountered: ".concat(t))}else return r},e.prototype.createBuffer=function(r){return new eD({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createTexture=function(r){return new M_({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createSampler=function(r){return new lD({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createRenderTarget=function(r){return new rD({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createRenderTargetFromTexture=function(r){var t=r,n=t.format,i=t.width,o=t.height,s=t.mipLevelCount;return Bi(s===1),this.createRenderTarget({format:n,width:i,height:o,sampleCount:1,texture:r})},e.prototype.createProgram=function(r){var t,n,i,o=(t=r.vertex)===null||t===void 0?void 0:t.glsl;return!((n=r.vertex)===null||n===void 0)&&n.glsl&&(r.vertex.glsl=Np(this.queryVendorInfo(),"vert",r.vertex.glsl)),!((i=r.fragment)===null||i===void 0)&&i.glsl&&(r.fragment.glsl=Np(this.queryVendorInfo(),"frag",r.fragment.glsl)),this.createProgramSimple(r,o)},e.prototype.createProgramSimple=function(r,t){var n=new nD({id:this.getNextUniqueId(),device:this,descriptor:r},t);return n},e.prototype.createBindings=function(r){return new W4({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createInputLayout=function(r){return new tD({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createRenderPipeline=function(r){return new oD({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createComputePass=function(){return new cD},e.prototype.createComputePipeline=function(r){return new sD({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createReadback=function(){return new aD({id:this.getNextUniqueId(),device:this})},e.prototype.createQueryPool=function(r,t){return new iD({id:this.getNextUniqueId(),device:this,descriptor:{type:r,elemCount:t}})},e.prototype.formatRenderPassDescriptor=function(r){var t,n,i,o,s,l,f=r.colorAttachment;r.depthClearValue=(t=r.depthClearValue)!==null&&t!==void 0?t:"load",r.stencilClearValue=(n=r.stencilClearValue)!==null&&n!==void 0?n:"load";for(var v=0;v=0;t--)this.debugGroupStack[t].drawCallCount+=r},e.prototype.debugGroupStatisticsBufferUpload=function(r){r===void 0&&(r=1);for(var t=this.debugGroupStack.length-1;t>=0;t--)this.debugGroupStack[t].bufferUploadCount+=r},e.prototype.debugGroupStatisticsTextureBind=function(r){r===void 0&&(r=1);for(var t=this.debugGroupStack.length-1;t>=0;t--)this.debugGroupStack[t].textureBindCount+=r},e.prototype.debugGroupStatisticsTriangles=function(r){for(var t=this.debugGroupStack.length-1;t>=0;t--)this.debugGroupStack[t].triangleCount+=r},e.prototype.reportShaderError=function(r,t){var n=this.gl,i=n.getShaderParameter(r,n.COMPILE_STATUS);if(!i){console.error(y4(t));var o=n.getExtension("WEBGL_debug_shaders");o&&console.error(o.getTranslatedShaderSource(r)),console.error(n.getShaderInfoLog(r))}return i},e.prototype.checkProgramCompilationForErrors=function(r){var t=this.gl,n=r.gl_program;if(!t.getProgramParameter(n,t.LINK_STATUS)){var i=r.descriptor;if(!this.reportShaderError(r.gl_shader_vert,i.vertex.glsl)||!this.reportShaderError(r.gl_shader_frag,i.fragment.glsl))return;console.error(t.getProgramInfoLog(r.gl_program))}},e.prototype.bindFramebufferAttachment=function(r,t,n,i){var o=this.gl;if((0,Bp.Z)(n))o.framebufferRenderbuffer(r,t,o.RENDERBUFFER,null);else if(n.type===ya.RenderTarget)n.gl_renderbuffer!==null?o.framebufferRenderbuffer(r,t,o.RENDERBUFFER,n.gl_renderbuffer):n.texture!==null&&o.framebufferTexture2D(r,t,We.TEXTURE_2D,Mv(n.texture),i);else if(n.type===ya.Texture){var s=Mv(n);n.dimension===Gi.TEXTURE_2D?o.framebufferTexture2D(r,t,We.TEXTURE_2D,s,i):Hn(o)&&(n.dimension,Gi.TEXTURE_2D_ARRAY)}},e.prototype.bindFramebufferDepthStencilAttachment=function(r,t){var n=this.gl,i=(0,Bp.Z)(t)?wn.Depth|wn.Stencil:Sv(t.format),o=!!(i&wn.Depth),s=!!(i&wn.Stencil);if(o&&s){var l=Hn(this.gl)||!Hn(this.gl)&&!!this.WEBGL_depth_texture;l?this.bindFramebufferAttachment(r,n.DEPTH_STENCIL_ATTACHMENT,t,0):this.bindFramebufferAttachment(r,n.DEPTH_ATTACHMENT,t,0)}else o?(this.bindFramebufferAttachment(r,n.DEPTH_ATTACHMENT,t,0),this.bindFramebufferAttachment(r,n.STENCIL_ATTACHMENT,null,0)):s&&(this.bindFramebufferAttachment(r,n.STENCIL_ATTACHMENT,t,0),this.bindFramebufferAttachment(r,n.DEPTH_ATTACHMENT,null,0))},e.prototype.validateCurrentAttachments=function(){for(var r=-1,t=-1,n=-1,i=0;i=f.numUniformBuffers),Bi(s.length>=f.numSamplers);for(var v=0;v{throw Error("TextDecoder not available")}};typeof TextDecoder!="undefined"&&HE.decode();let km=null;function o0(){return(km===null||km.byteLength===0)&&(km=new Uint8Array(gs.memory.buffer)),km}function s0(e,r){return e=e>>>0,HE.decode(o0().subarray(e,e+r))}const $h=new Array(128).fill(void 0);$h.push(void 0,null,!0,!1);let Bm=$h.length;function dD(e){Bm===$h.length&&$h.push($h.length+1);const r=Bm;return Bm=$h[r],$h[r]=e,r}function u0(e){return $h[e]}function vD(e){e<132||($h[e]=Bm,Bm=e)}function mD(e){const r=u0(e);return vD(e),r}let Lm=0;const l0=typeof TextEncoder!="undefined"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},gD=typeof l0.encodeInto=="function"?function(e,r){return l0.encodeInto(e,r)}:function(e,r){const t=l0.encode(e);return r.set(t),{read:e.length,written:t.length}};function I_(e,r,t){if(t===void 0){const l=l0.encode(e),f=r(l.length,1)>>>0;return o0().subarray(f,f+l.length).set(l),Lm=l.length,f}let n=e.length,i=r(n,1)>>>0;const o=o0();let s=0;for(;s127)break;o[i+s]=l}if(s!==n){s!==0&&(e=e.slice(s)),i=t(i,n,n=s+e.length*3,1)>>>0;const l=o0().subarray(i+s,i+n),f=gD(e,l);s+=f.written}return Lm=s,i}let Nm=null;function c0(){return(Nm===null||Nm.byteLength===0)&&(Nm=new Int32Array(gs.memory.buffer)),Nm}function _D(e,r,t){let n,i;try{const l=gs.__wbindgen_add_to_stack_pointer(-16),f=I_(e,gs.__wbindgen_malloc,gs.__wbindgen_realloc),v=Lm,y=I_(r,gs.__wbindgen_malloc,gs.__wbindgen_realloc),b=Lm;gs.glsl_compile(l,f,v,y,b,t);var o=c0()[l/4+0],s=c0()[l/4+1];return n=o,i=s,s0(o,s)}finally{gs.__wbindgen_add_to_stack_pointer(16),gs.__wbindgen_free(n,i,1)}}class Um{static __wrap(r){r=r>>>0;const t=Object.create(Um.prototype);return t.__wbg_ptr=r,t}__destroy_into_raw(){const r=this.__wbg_ptr;return this.__wbg_ptr=0,r}free(){const r=this.__destroy_into_raw();gs.__wbg_wgslcomposer_free(r)}constructor(){const r=gs.wgslcomposer_new();return Um.__wrap(r)}wgsl_compile(r){let t,n;try{const s=gs.__wbindgen_add_to_stack_pointer(-16),l=I_(r,gs.__wbindgen_malloc,gs.__wbindgen_realloc),f=Lm;gs.wgslcomposer_wgsl_compile(s,this.__wbg_ptr,l,f);var i=c0()[s/4+0],o=c0()[s/4+1];return t=i,n=o,s0(i,o)}finally{gs.__wbindgen_add_to_stack_pointer(16),gs.__wbindgen_free(t,n,1)}}}function yD(e,r){return Z_(this,null,function*(){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return yield WebAssembly.instantiateStreaming(e,r)}catch(n){if(e.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 t=yield e.arrayBuffer();return yield WebAssembly.instantiate(t,r)}else{const t=yield WebAssembly.instantiate(e,r);return t instanceof WebAssembly.Instance?{instance:t,module:e}:t}})}function xD(){const e={};return e.wbg={},e.wbg.__wbindgen_string_new=function(r,t){const n=s0(r,t);return dD(n)},e.wbg.__wbindgen_object_drop_ref=function(r){mD(r)},e.wbg.__wbg_log_1d3ae0273d8f4f8a=function(r){console.log(u0(r))},e.wbg.__wbg_log_576ca876af0d4a77=function(r,t){console.log(u0(r),u0(t))},e.wbg.__wbindgen_throw=function(r,t){throw new Error(s0(r,t))},e}function bD(e,r){return gs=e.exports,WE.__wbindgen_wasm_module=r,Nm=null,km=null,gs}function WE(e){return Z_(this,null,function*(){if(gs!==void 0)return gs;const r=xD();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));const{instance:t,module:n}=yield yD(yield e,r);return bD(t,n)})}var yl;(function(e){e[e.COPY_SRC=1]="COPY_SRC",e[e.COPY_DST=2]="COPY_DST",e[e.TEXTURE_BINDING=4]="TEXTURE_BINDING",e[e.STORAGE_BINDING=8]="STORAGE_BINDING",e[e.STORAGE=8]="STORAGE",e[e.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"})(yl||(yl={}));var P_;(function(e){e[e.READ=1]="READ",e[e.WRITE=2]="WRITE"})(P_||(P_={}));function ED(e){var r=0;return e&Ec.SAMPLED&&(r|=yl.TEXTURE_BINDING|yl.COPY_DST),e&Ec.RENDER_TARGET&&(r|=yl.RENDER_ATTACHMENT|yl.TEXTURE_BINDING|yl.COPY_SRC|yl.COPY_DST),r}function O_(e){if(e===Mt.U8_R_NORM)return"r8unorm";if(e===Mt.U8_RG_NORM)return"rg8unorm";if(e===Mt.U8_RGBA_RT)return"bgra8unorm";if(e===Mt.U8_RGBA_RT_SRGB)return"bgra8unorm-srgb";if(e===Mt.U8_RGBA_NORM)return"rgba8unorm";if(e===Mt.U8_RGBA_SRGB)return"rgba8unorm-srgb";if(e===Mt.S8_R_NORM)return"r8snorm";if(e===Mt.S8_RG_NORM)return"rg8snorm";if(e===Mt.S8_RGBA_NORM)return"rgba8snorm";if(e===Mt.U32_R)return"r32uint";if(e===Mt.F16_RGBA)return"rgba16float";if(e===Mt.F32_RGBA)return"rgba32float";if(e===Mt.D24)return"depth24plus";if(e===Mt.D24_S8)return"depth24plus-stencil8";if(e===Mt.D32F)return"depth32float";if(e===Mt.D32F_S8)return"depth32float-stencil8";if(e===Mt.BC1)return"bc1-rgba-unorm";if(e===Mt.BC1_SRGB)return"bc1-rgba-unorm-srgb";if(e===Mt.BC2)return"bc2-rgba-unorm";if(e===Mt.BC2_SRGB)return"bc2-rgba-unorm-srgb";if(e===Mt.BC3)return"bc3-rgba-unorm";if(e===Mt.BC3_SRGB)return"bc3-rgba-unorm-srgb";if(e===Mt.BC4_SNORM)return"bc4-r-snorm";if(e===Mt.BC4_UNORM)return"bc4-r-unorm";if(e===Mt.BC5_SNORM)return"bc5-rg-snorm";if(e===Mt.BC5_UNORM)return"bc5-rg-unorm";throw"whoops"}function SD(e){if(e===Gi.TEXTURE_2D)return"2d";if(e===Gi.TEXTURE_CUBE_MAP)return"2d";if(e===Gi.TEXTURE_2D_ARRAY)return"2d";if(e===Gi.TEXTURE_3D)return"3d";throw new Error("whoops")}function AD(e){if(e===Gi.TEXTURE_2D)return"2d";if(e===Gi.TEXTURE_CUBE_MAP)return"cube";if(e===Gi.TEXTURE_2D_ARRAY)return"2d-array";if(e===Gi.TEXTURE_3D)return"3d";throw new Error("whoops")}function TD(e){var r=0;return e&no.INDEX&&(r|=GPUBufferUsage.INDEX),e&no.VERTEX&&(r|=GPUBufferUsage.VERTEX),e&no.UNIFORM&&(r|=GPUBufferUsage.UNIFORM),e&no.STORAGE&&(r|=GPUBufferUsage.STORAGE),e&no.COPY_SRC&&(r|=GPUBufferUsage.COPY_SRC),r|=GPUBufferUsage.COPY_DST,r}function D_(e){if(e===gl.CLAMP_TO_EDGE)return"clamp-to-edge";if(e===gl.REPEAT)return"repeat";if(e===gl.MIRRORED_REPEAT)return"mirror-repeat";throw new Error("whoops")}function GE(e){if(e===vs.BILINEAR)return"linear";if(e===vs.POINT)return"nearest";throw new Error("whoops")}function wD(e){if(e===Xs.LINEAR)return"linear";if(e===Xs.NEAREST)return"nearest";if(e===Xs.NO_MIP)return"nearest";throw new Error("whoops")}function Iv(e){var r=e;return r.gpuBuffer}function CD(e){var r=e;return r.gpuSampler}function RD(e){var r=e;return r.querySet}function MD(e){if(e===Kg.OcclusionConservative)return"occlusion";throw new Error("whoops")}function ID(e){switch(e){case ms.TRIANGLES:return"triangle-list";case ms.POINTS:return"point-list";case ms.TRIANGLE_STRIP:return"triangle-strip";case ms.LINES:return"line-list";case ms.LINE_STRIP:return"line-strip";default:throw new Error("Unknown primitive topology mode")}}function PD(e){if(e===Wl.NONE)return"none";if(e===Wl.FRONT)return"front";if(e===Wl.BACK)return"back";throw new Error("whoops")}function OD(e){if(e===Im.CCW)return"ccw";if(e===Im.CW)return"cw";throw new Error("whoops")}function DD(e,r){return{topology:ID(e),cullMode:PD(r.cullMode),frontFace:OD(r.frontFace)}}function XE(e){if(e===la.ZERO)return"zero";if(e===la.ONE)return"one";if(e===la.SRC)return"src";if(e===la.ONE_MINUS_SRC)return"one-minus-src";if(e===la.DST)return"dst";if(e===la.ONE_MINUS_DST)return"one-minus-dst";if(e===la.SRC_ALPHA)return"src-alpha";if(e===la.ONE_MINUS_SRC_ALPHA)return"one-minus-src-alpha";if(e===la.DST_ALPHA)return"dst-alpha";if(e===la.ONE_MINUS_DST_ALPHA)return"one-minus-dst-alpha";if(e===la.CONST)return"constant";if(e===la.ONE_MINUS_CONSTANT)return"one-minus-constant";if(e===la.SRC_ALPHA_SATURATE)return"src-alpha-saturated";throw new Error("whoops")}function FD(e){if(e===Tu.ADD)return"add";if(e===Tu.SUBSTRACT)return"subtract";if(e===Tu.REVERSE_SUBSTRACT)return"reverse-subtract";if(e===Tu.MIN)return"min";if(e===Tu.MAX)return"max";throw new Error("whoops")}function $E(e){return{operation:FD(e.blendMode),srcFactor:XE(e.blendSrcFactor),dstFactor:XE(e.blendDstFactor)}}function YE(e){return e.blendMode===Tu.ADD&&e.blendSrcFactor===la.ONE&&e.blendDstFactor===la.ZERO}function kD(e){if(!(YE(e.rgbBlendState)&&YE(e.alphaBlendState)))return{color:$E(e.rgbBlendState),alpha:$E(e.alphaBlendState)}}function BD(e,r){return{format:O_(r),blend:kD(e),writeMask:e.channelWriteMask}}function LD(e,r){return r.attachmentsState.map(function(t,n){return BD(t,e[n])})}function f0(e){if(e===_a.NEVER)return"never";if(e===_a.LESS)return"less";if(e===_a.EQUAL)return"equal";if(e===_a.LEQUAL)return"less-equal";if(e===_a.GREATER)return"greater";if(e===_a.NOTEQUAL)return"not-equal";if(e===_a.GEQUAL)return"greater-equal";if(e===_a.ALWAYS)return"always";throw new Error("whoops")}function Pv(e){if(e===qu.KEEP)return"keep";if(e===qu.REPLACE)return"replace";if(e===qu.ZERO)return"zero";if(e===qu.DECREMENT_CLAMP)return"decrement-clamp";if(e===qu.DECREMENT_WRAP)return"decrement-wrap";if(e===qu.INCREMENT_CLAMP)return"increment-clamp";if(e===qu.INCREMENT_WRAP)return"increment-wrap";if(e===qu.INVERT)return"invert";throw new Error("whoops")}function ND(e,r){if(!(0,Bp.Z)(e))return{format:O_(e),depthWriteEnabled:!!r.depthWrite,depthCompare:f0(r.depthCompare),depthBias:r.polygonOffset?1:0,depthBiasSlopeScale:r.polygonOffset?1:0,stencilFront:{compare:f0(r.stencilFront.compare),passOp:Pv(r.stencilFront.passOp),failOp:Pv(r.stencilFront.failOp),depthFailOp:Pv(r.stencilFront.depthFailOp)},stencilBack:{compare:f0(r.stencilBack.compare),passOp:Pv(r.stencilBack.passOp),failOp:Pv(r.stencilBack.failOp),depthFailOp:Pv(r.stencilBack.depthFailOp)},stencilReadMask:1,stencilWriteMask:1}}function UD(e){if(e!==null){if(e===Mt.U16_R)return"uint16";if(e===Mt.U32_R)return"uint32";throw new Error("whoops")}}function zD(e){if(e===Sd.VERTEX)return"vertex";if(e===Sd.INSTANCE)return"instance";throw new Error("whoops")}function ZD(e){if(e===Mt.U8_R)return"uint8x2";if(e===Mt.U8_RG)return"uint8x2";if(e===Mt.U8_RGB)return"uint8x4";if(e===Mt.U8_RGBA)return"uint8x4";if(e===Mt.U8_RG_NORM)return"unorm8x2";if(e===Mt.U8_RGBA_NORM)return"unorm8x4";if(e===Mt.S8_RGB_NORM)return"snorm8x4";if(e===Mt.S8_RGBA_NORM)return"snorm8x4";if(e===Mt.U16_RG_NORM)return"unorm16x2";if(e===Mt.U16_RGBA_NORM)return"unorm16x4";if(e===Mt.S16_RG_NORM)return"snorm16x2";if(e===Mt.S16_RGBA_NORM)return"snorm16x4";if(e===Mt.S16_RG)return"uint16x2";if(e===Mt.F16_RG)return"float16x2";if(e===Mt.F16_RGBA)return"float16x4";if(e===Mt.F32_R)return"float32";if(e===Mt.F32_RG)return"float32x2";if(e===Mt.F32_RGB)return"float32x3";if(e===Mt.F32_RGBA)return"float32x4";throw"whoops"}function VD(e){var r=ch(e);switch(r){case Rr.BC1:case Rr.BC2:case Rr.BC3:case Rr.BC4_SNORM:case Rr.BC4_UNORM:case Rr.BC5_SNORM:case Rr.BC5_UNORM:return!0;default:return!1}}function jD(e){var r=ch(e);switch(r){case Rr.BC1:case Rr.BC2:case Rr.BC3:case Rr.BC4_SNORM:case Rr.BC4_UNORM:case Rr.BC5_SNORM:case Rr.BC5_UNORM:return 4;default:return 1}}function qE(e,r,t,n){switch(t===void 0&&(t=!1),e){case Mt.S8_R:case Mt.S8_R_NORM:case Mt.S8_RG_NORM:case Mt.S8_RGB_NORM:case Mt.S8_RGBA_NORM:{var i=r instanceof ArrayBuffer?new Int8Array(r):new Int8Array(r);return n&&i.set(new Int8Array(n)),i}case Mt.U8_R:case Mt.U8_R_NORM:case Mt.U8_RG:case Mt.U8_RG_NORM:case Mt.U8_RGB:case Mt.U8_RGB_NORM:case Mt.U8_RGB_SRGB:case Mt.U8_RGBA:case Mt.U8_RGBA_NORM:case Mt.U8_RGBA_SRGB:{var o=r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r);return n&&o.set(new Uint8Array(n)),o}case Mt.S16_R:case Mt.S16_RG:case Mt.S16_RG_NORM:case Mt.S16_RGB_NORM:case Mt.S16_RGBA:case Mt.S16_RGBA_NORM:{var s=r instanceof ArrayBuffer?new Int16Array(r):new Int16Array(t?r/2:r);return n&&s.set(new Int16Array(n)),s}case Mt.U16_R:case Mt.U16_RGB:case Mt.U16_RGBA_5551:case Mt.U16_RGBA_NORM:case Mt.U16_RG_NORM:case Mt.U16_R_NORM:{var l=r instanceof ArrayBuffer?new Uint16Array(r):new Uint16Array(t?r/2:r);return n&&l.set(new Uint16Array(n)),l}case Mt.S32_R:{var f=r instanceof ArrayBuffer?new Int32Array(r):new Int32Array(t?r/4:r);return n&&f.set(new Int32Array(n)),f}case Mt.U32_R:case Mt.U32_RG:{var v=r instanceof ArrayBuffer?new Uint32Array(r):new Uint32Array(t?r/4:r);return n&&v.set(new Uint32Array(n)),v}case Mt.F32_R:case Mt.F32_RG:case Mt.F32_RGB:case Mt.F32_RGBA:{var y=r instanceof ArrayBuffer?new Float32Array(r):new Float32Array(t?r/4:r);return n&&y.set(new Float32Array(n)),y}}var b=r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r);return n&&b.set(new Uint8Array(n)),b}function HD(e){var r=(e&32768)>>15,t=(e&31744)>>10,n=e&1023;return t===0?(r?-1:1)*Math.pow(2,-14)*(n/Math.pow(2,10)):t==31?n?NaN:(r?-1:1)*(1/0):(r?-1:1)*Math.pow(2,t-15)*(1+n/Math.pow(2,10))}var fh=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=e.call(this)||this;return o.id=n,o.device=i,o}return r.prototype.destroy=function(){},r}(bE.Z),WD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=ya.Bindings;var l=o.pipeline;Bi(!!l);var f=o.uniformBufferBindings,v=o.storageBufferBindings,y=o.samplerBindings;s.numUniformBuffers=(f==null?void 0:f.length)||0;var b=[[],[]],T=0;if(v&&v.length)for(var M=0;M0}).map(function(Ir,Er){return s.device.device.createBindGroup({layout:l.getBindGroupLayout(Er),entries:Ir})}),s}return r}(fh),GD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=ya.Buffer;var l=o.usage,f=o.viewOrSize,v=!!(l&no.MAP_READ);s.usage=TD(l),v&&(s.usage=no.MAP_READ|no.COPY_DST);var y=!(0,xv.Z)(f);if(s.view=(0,xv.Z)(f)?null:f,s.size=(0,xv.Z)(f)?t0(f,4):t0(f.byteLength,4),(0,xv.Z)(f))s.gpuBuffer=s.device.device.createBuffer({usage:s.usage,size:s.size,mappedAtCreation:v?y:!1});else{s.gpuBuffer=s.device.device.createBuffer({usage:s.usage,size:s.size,mappedAtCreation:!0});var b=f&&f.constructor||Float32Array;new b(s.gpuBuffer.getMappedRange()).set(f),s.gpuBuffer.unmap()}return s}return r.prototype.setSubData=function(t,n,i,o){i===void 0&&(i=0),o===void 0&&(o=0);var s=this.gpuBuffer;o=o||n.byteLength,o=Math.min(o,this.size-t);var l=n.byteOffset+i,f=l+o,v=o+3&-4;if(v!==o){var y=new Uint8Array(n.buffer.slice(l,f));n=new Uint8Array(v),n.set(y),i=0,l=0,f=v,o=v}for(var b=1024*1024*15,T=0;f-(l+T)>b;)this.device.device.queue.writeBuffer(s,t+T,n.buffer,l+T,b),T+=b;this.device.device.queue.writeBuffer(s,t+T,n.buffer,l+T,o-T)},r.prototype.destroy=function(){e.prototype.destroy.call(this),this.gpuBuffer.destroy()},r}(fh),XD=function(){function e(){this.commandEncoder=null,this.gpuComputePassEncoder=null}return e.prototype.dispatchWorkgroups=function(r,t,n){this.gpuComputePassEncoder.dispatchWorkgroups(r,t,n)},e.prototype.dispatchWorkgroupsIndirect=function(r,t){this.gpuComputePassEncoder.dispatchWorkgroupsIndirect(r.gpuBuffer,t)},e.prototype.finish=function(){return this.gpuComputePassEncoder.end(),this.gpuComputePassEncoder=null,this.commandEncoder.finish()},e.prototype.beginComputePass=function(){Bi(this.gpuComputePassEncoder===null),this.gpuComputePassEncoder=this.commandEncoder.beginComputePass(this.gpuComputePassDescriptor)},e.prototype.setPipeline=function(r){var t=r,n=Ad(t.gpuComputePipeline);this.gpuComputePassEncoder.setPipeline(n)},e.prototype.setBindings=function(r){var t=r;this.gpuComputePassEncoder.setBindGroup(0,t.gpuBindGroup[0])},e.prototype.pushDebugGroup=function(r){this.gpuComputePassEncoder.pushDebugGroup(r)},e.prototype.popDebugGroup=function(){this.gpuComputePassEncoder.popDebugGroup()},e.prototype.insertDebugMarker=function(r){this.gpuComputePassEncoder.insertDebugMarker(r)},e}(),$D=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=ya.ComputePipeline,s.gpuComputePipeline=null,s.descriptor=o;var l=o.program,f=l.computeStage;if(f===null)return s;var v={layout:"auto",compute:(0,Mn.pi)({},f)};return s.gpuComputePipeline=s.device.device.createComputePipeline(v),s.name!==void 0&&(s.gpuComputePipeline.label=s.name),s}return r.prototype.getBindGroupLayout=function(t){return this.gpuComputePipeline.getBindGroupLayout(t)},r}(fh),YD=function(e){(0,Mn.ZT)(r,e);function r(t){var n,i,o,s,l=t.id,f=t.device,v=t.descriptor,y=e.call(this,{id:l,device:f})||this;y.type=ya.InputLayout;var b=[];try{for(var T=(0,Mn.XA)(v.vertexBufferDescriptors),M=T.next();!M.done;M=T.next()){var O=M.value,F=O.arrayStride,$=O.stepMode,G=O.attributes;b.push({arrayStride:F,stepMode:zD($),attributes:[]});try{for(var ue=(o=void 0,(0,Mn.XA)(G)),xe=ue.next();!xe.done;xe=ue.next()){var ze=xe.value,Je=ze.shaderLocation,ht=ze.format,gt=ze.offset;b[b.length-1].attributes.push({shaderLocation:Je,format:ZD(ht),offset:gt})}}catch(Ot){o={error:Ot}}finally{try{xe&&!xe.done&&(s=ue.return)&&s.call(ue)}finally{if(o)throw o.error}}}}catch(Ot){n={error:Ot}}finally{try{M&&!M.done&&(i=T.return)&&i.call(T)}finally{if(n)throw n.error}}return y.indexFormat=UD(v.indexBufferFormat),y.buffers=b,y}return r}(fh),KE=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;return s.type=ya.Program,s.vertexStage=null,s.fragmentStage=null,s.computeStage=null,s.descriptor=o,o.vertex&&(s.vertexStage=s.createShaderStage(o.vertex,"vertex")),o.fragment&&(s.fragmentStage=s.createShaderStage(o.fragment,"fragment")),o.compute&&(s.computeStage=s.createShaderStage(o.compute,"compute")),s}return r.prototype.setUniformsLegacy=function(t){},r.prototype.createShaderStage=function(t,n){var i,o,s=t.glsl,l=t.wgsl,f=t.entryPoint,v=!1,y=l;if(!y)try{y=this.device.glsl_compile(s,n,v)}catch($){throw console.error($,s),new Error("whoops")}var b=function($){if(!y.includes($))return"continue";y=y.replace("var T_".concat($,": texture_2d;"),"var T_".concat($,": texture_depth_2d;")),y=y.replace(new RegExp("textureSample\\(T_".concat($,"(.*)\\);$"),"gm"),function(G,ue){return"vec4(textureSample(T_".concat($).concat(ue,"), 0.0, 0.0, 0.0);")})};try{for(var T=(0,Mn.XA)(["u_TextureFramebufferDepth"]),M=T.next();!M.done;M=T.next()){var O=M.value;b(O)}}catch($){i={error:$}}finally{try{M&&!M.done&&(o=T.return)&&o.call(T)}finally{if(i)throw i.error}}var F=this.device.device.createShaderModule({code:y});return{module:F,entryPoint:f||"main"}},r}(fh),qD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=ya.QueryPool;var l=o.elemCount,f=o.type;return s.querySet=s.device.device.createQuerySet({type:MD(f),count:l}),s.resolveBuffer=s.device.device.createBuffer({size:l*8,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),s.cpuBuffer=s.device.device.createBuffer({size:l*8,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),s.results=null,s}return r.prototype.queryResultOcclusion=function(t){return this.results===null?null:this.results[t]!==BigInt(0)},r.prototype.destroy=function(){e.prototype.destroy.call(this),this.querySet.destroy(),this.resolveBuffer.destroy(),this.cpuBuffer.destroy()},r}(fh),KD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=e.call(this,{id:n,device:i})||this;return o.type=ya.Readback,o}return r.prototype.readTexture=function(t,n,i,o,s,l,f,v){return f===void 0&&(f=0),(0,Mn.mG)(this,void 0,void 0,function(){var y,b,T,M,O,F,$,G;return(0,Mn.Jh)(this,function(ue){return y=t,b=0,T=this.getBlockInformationFromFormat(y.gpuTextureformat),M=Math.ceil(o/T.width)*T.length,O=Math.ceil(M/256)*256,F=O*s,$=this.device.createBuffer({usage:no.STORAGE|no.MAP_READ|no.COPY_DST,hint:Af.STATIC,viewOrSize:F}),G=this.device.device.createCommandEncoder(),G.copyTextureToBuffer({texture:y.gpuTexture,mipLevel:0,origin:{x:n,y:i,z:Math.max(b,0)}},{buffer:$.gpuBuffer,offset:0,bytesPerRow:O},{width:o,height:s,depthOrArrayLayers:1}),this.device.device.queue.submit([G.finish()]),[2,this.readBuffer($,0,l.byteLength===F?l:null,f,F,y.format)]})})},r.prototype.readTextureSync=function(t,n,i,o,s,l,f,v){throw new Error("ERROR_MSG_METHOD_NOT_IMPLEMENTED")},r.prototype.readBuffer=function(t,n,i,o,s,l,f,v){var y=this;n===void 0&&(n=0),i===void 0&&(i=null),s===void 0&&(s=0),l===void 0&&(l=Mt.U8_RGB),f===void 0&&(f=!1);var b=t,T=s||b.size,M=i||b.view,O=M&&M.constructor&&M.constructor.BYTES_PER_ELEMENT||AE(l),F=b;if(!(b.usage&no.MAP_READ&&b.usage&no.COPY_DST)){var $=this.device.device.createCommandEncoder();F=this.device.createBuffer({usage:no.STORAGE|no.MAP_READ|no.COPY_DST,hint:Af.STATIC,viewOrSize:T}),$.copyBufferToBuffer(b.gpuBuffer,n,F.gpuBuffer,0,T),this.device.device.queue.submit([$.finish()])}return new Promise(function(G,ue){F.gpuBuffer.mapAsync(P_.READ,n,T).then(function(){var xe=F.gpuBuffer.getMappedRange(n,T),ze=M;if(f)ze===null?ze=qE(l,T,!0,xe):ze=qE(l,ze.buffer,void 0,xe);else if(ze===null)switch(O){case 1:ze=new Uint8Array(T),ze.set(new Uint8Array(xe));break;case 2:ze=y.getHalfFloatAsFloatRGBAArrayBuffer(T/2,xe);break;case 4:ze=new Float32Array(T/4),ze.set(new Float32Array(xe));break}else switch(O){case 1:ze=new Uint8Array(ze.buffer),ze.set(new Uint8Array(xe));break;case 2:ze=y.getHalfFloatAsFloatRGBAArrayBuffer(T/2,xe,M);break;case 4:var Je=M&&M.constructor||Float32Array;ze=new Je(ze.buffer),ze.set(new Je(xe));break}F.gpuBuffer.unmap(),G(ze)},function(xe){return ue(xe)})})},r.prototype.getHalfFloatAsFloatRGBAArrayBuffer=function(t,n,i){i||(i=new Float32Array(t));for(var o=new Uint16Array(n);t--;)i[t]=HD(o[t]);return i},r.prototype.getBlockInformationFromFormat=function(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}}},r}(fh),QD=function(){function e(r){this.device=r,this.commandEncoder=null,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 e.prototype.getTextureView=function(r,t){return Bi(t1?T.resolveTarget=this.getTextureView(b,this.gfxColorResolveToLevel[v]):T.storeOp="store")}else{this.gpuColorAttachments.length=v,this.gfxColorAttachment.length=v,this.gfxColorResolveTo.length=v;break}}if(this.gfxDepthStencilAttachment=r.depthStencilAttachment,this.gfxDepthStencilResolveTo=r.depthStencilResolveTo,r.depthStencilAttachment){var O=r.depthStencilAttachment,T=this.gpuDepthStencilAttachment;T.view=O.gpuTextureView;var F=!!(Sv(O.format)&wn.Depth);F?(r.depthClearValue==="load"?T.depthLoadOp="load":(T.depthLoadOp="clear",T.depthClearValue=r.depthClearValue),r.depthStencilStore||this.gfxDepthStencilResolveTo!==null?T.depthStoreOp="store":T.depthStoreOp="discard"):(T.depthLoadOp=void 0,T.depthStoreOp=void 0);var $=!!(Sv(O.format)&wn.Stencil);$?(r.stencilClearValue==="load"?T.stencilLoadOp="load":(T.stencilLoadOp="clear",T.stencilClearValue=r.stencilClearValue),r.depthStencilStore||this.gfxDepthStencilResolveTo!==null?T.stencilStoreOp="store":T.stencilStoreOp="discard"):(T.stencilLoadOp=void 0,T.stencilStoreOp=void 0),this.gpuRenderPassDescriptor.depthStencilAttachment=this.gpuDepthStencilAttachment}else this.gpuRenderPassDescriptor.depthStencilAttachment=void 0;this.gpuRenderPassDescriptor.occlusionQuerySet=(0,Bp.Z)(r.occlusionQueryPool)?void 0:RD(r.occlusionQueryPool)},e.prototype.beginRenderPass=function(r){Bi(this.gpuRenderPassEncoder===null),this.setRenderPassDescriptor(r),this.gpuRenderPassEncoder=this.commandEncoder.beginRenderPass(this.gpuRenderPassDescriptor)},e.prototype.flipY=function(r,t){var n=this.device.swapChainHeight;return n-r-t},e.prototype.setViewport=function(r,t,n,i,o,s){o===void 0&&(o=0),s===void 0&&(s=1),this.gpuRenderPassEncoder.setViewport(r,this.flipY(t,i),n,i,o,s)},e.prototype.setScissorRect=function(r,t,n,i){this.gpuRenderPassEncoder.setScissorRect(r,this.flipY(t,i),n,i)},e.prototype.setPipeline=function(r){var t=r,n=Ad(t.gpuRenderPipeline);this.gpuRenderPassEncoder.setPipeline(n)},e.prototype.setVertexInput=function(r,t,n){if(r!==null){var i=r;n!==null&&this.gpuRenderPassEncoder.setIndexBuffer(Iv(n.buffer),Ad(i.indexFormat),n.offset);for(var o=0;o1||this.copyAttachment(this.gfxDepthStencilResolveTo,0,this.gfxDepthStencilAttachment,0)),this.commandEncoder.finish()},e.prototype.copyAttachment=function(r,t,n,i){Bi(n.sampleCount===1);var o={texture:n.gpuTexture,mipLevel:i},s={texture:r.gpuTexture,mipLevel:t};Bi(n.width>>>i===r.width>>>t),Bi(n.height>>>i===r.height>>>t),Bi(!!(n.usage&yl.COPY_SRC)),Bi(!!(r.usage&yl.COPY_DST)),this.commandEncoder.copyTextureToTexture(o,s,[r.width,r.height,1])},e}(),JD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;return s.type=ya.RenderPipeline,s.isCreatingAsync=!1,s.gpuRenderPipeline=null,s.descriptor=o,s.device.createRenderPipelineInternal(s,!1),s}return r.prototype.getBindGroupLayout=function(t){return this.gpuRenderPipeline.getBindGroupLayout(t)},r}(fh),eF=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s,l,f=e.call(this,{id:n,device:i})||this;f.type=ya.Sampler;var v=o.lodMinClamp,y=o.mipmapFilter===Xs.NO_MIP?o.lodMinClamp:o.lodMaxClamp,b=(s=o.maxAnisotropy)!==null&&s!==void 0?s:1;return b>1&&Bi(o.minFilter===vs.BILINEAR&&o.magFilter===vs.BILINEAR&&o.mipmapFilter===Xs.LINEAR),f.gpuSampler=f.device.device.createSampler({addressModeU:D_(o.addressModeU),addressModeV:D_(o.addressModeV),addressModeW:D_((l=o.addressModeW)!==null&&l!==void 0?l:o.addressModeU),lodMinClamp:v,lodMaxClamp:y,minFilter:GE(o.minFilter),magFilter:GE(o.magFilter),mipmapFilter:wD(o.mipmapFilter),compare:o.compareFunction!==void 0?f0(o.compareFunction):void 0,maxAnisotropy:b}),f}return r}(fh),h0=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=t.skipCreate,l=t.sampleCount,f=e.call(this,{id:n,device:i})||this;f.type=ya.Texture;var v=o.format,y=o.dimension,b=o.width,T=o.height,M=o.depthOrArrayLayers,O=o.mipLevelCount,F=o.usage;return f.device.createTextureShared({format:v,dimension:y!=null?y:Gi.TEXTURE_2D,width:b,height:T,depthOrArrayLayers:M!=null?M:1,mipLevelCount:O!=null?O:1,usage:F,sampleCount:l!=null?l:1},f,s),f}return r.prototype.textureFromImageBitmapOrCanvas=function(t,n,i){for(var o=n[0].width,s=n[0].height,l={size:{width:o,height:s,depthOrArrayLayers:i},format:"rgba8unorm",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT},f=t.createTexture(l),v=0;v>>2,uniformBufferWordAlignment:this.device.limits.minUniformBufferOffsetAlignment>>>2,supportedSampleCounts:[1],occlusionQueriesRecommended:!0,computeShadersSupported:!0}},e.prototype.queryTextureFormatSupported=function(r,t,n){if(VD(r)){if(!this.featureTextureCompressionBC)return!1;var i=jD(r);return t%i!==0||n%i!==0?!1:this.featureTextureCompressionBC}switch(r){case Mt.U16_RGBA_NORM:return!1;case Mt.F32_RGBA:return!1}return!0},e.prototype.queryPlatformAvailable=function(){return!0},e.prototype.queryVendorInfo=function(){return this},e.prototype.queryRenderPass=function(r){var t=r;return t.descriptor},e.prototype.queryRenderTarget=function(r){var t=r;return t},e.prototype.setResourceName=function(r,t){if(r.name=t,r.type===ya.Buffer){var n=r;n.gpuBuffer.label=t}else if(r.type===ya.Texture){var n=r;n.gpuTexture.label=t,n.gpuTextureView.label=t}else if(r.type===ya.RenderTarget){var n=r;n.gpuTexture.label=t,n.gpuTextureView.label=t}else if(r.type===ya.Sampler){var n=r;n.gpuSampler.label=t}else if(r.type===ya.RenderPipeline){var n=r;n.gpuRenderPipeline!==null&&(n.gpuRenderPipeline.label=t)}},e.prototype.setResourceLeakCheck=function(r,t){},e.prototype.checkForLeaks=function(){},e.prototype.programPatched=function(r){},e.prototype.pipelineQueryReady=function(r){var t=r;return t.gpuRenderPipeline!==null},e.prototype.pipelineForceReady=function(r){var t=r;this.createRenderPipelineInternal(t,!1)},e}(),rF=function(){function e(r){this.pluginOptions=r}return e.prototype.createSwapChain=function(r){return(0,Mn.mG)(this,void 0,void 0,function(){var t,n,i,o,s,l,f,v;return(0,Mn.Jh)(this,function(y){switch(y.label){case 0:if(globalThis.navigator.gpu===void 0)return[2,null];t=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 t=y.sent(),[3,4];case 3:return i=y.sent(),console.log(i),[3,4];case 4:return t===null?[2,null]:(o=["depth32float-stencil8","texture-compression-bc"],s=o.filter(function(b){return t.features.has(b)}),[4,t.requestDevice({requiredFeatures:s})]);case 5:if(l=y.sent(),l&&(f=this.pluginOptions.onContextLost,l.lost.then(function(){f&&f()})),l===null)return[2,null];if(v=r.getContext("webgpu"),!v)return[2,null];y.label=6;case 6:return y.trys.push([6,8,,9]),[4,WE(this.pluginOptions.shaderCompilerPath)];case 7:return y.sent(),[3,9];case 8:return y.sent(),[3,9];case 9:return[2,new tF(t,l,r,v,_D,Um&&new Um)]}})})},e}(),nF=oi.isPlainObject,iF=oi.isTypedArray,aF=function(){function e(r,t){(0,Q.Z)(this,e),(0,B.Z)(this,"destroyed",!1),(0,B.Z)(this,"uniforms",{}),this.reGl=r;var n=t.vs,i=t.fs,o=t.attributes,s=t.uniforms,l=t.primitive,f=t.count,v=t.elements,y=t.depth,b=t.cull,T=t.instances,M={platformString:"WebGL1",glslVersion:"#version 100",explicitBindingLocations:!1,separateSamplerTextures:!1,viewportOrigin:bv.LOWER_LEFT,clipSpaceNearZ:Ev.NEGATIVE_ONE,supportMRT:!1},O={};this.options=t,s&&(this.uniforms=this.extractUniforms(s),Object.keys(s).forEach(function(G){O[G]=r.prop(G)}));var F={};Object.keys(o).forEach(function(G){F[G]=o[G].get()});var $={attributes:F,frag:om(Np(M,"frag",i,null,!1)),uniforms:O,vert:om(Np(M,"vert",n,null,!1)),colorMask:r.prop("colorMask"),lineWidth:1,blend:{enable:r.prop("blend.enable"),func:r.prop("blend.func"),equation:r.prop("blend.equation"),color:r.prop("blend.color")},stencil:{enable:r.prop("stencil.enable"),mask:r.prop("stencil.mask"),func:r.prop("stencil.func"),opFront:r.prop("stencil.opFront"),opBack:r.prop("stencil.opBack")},primitive:r4[l===void 0?R.TRIANGLES:l]};T&&($.instances=T),f?$.count=f:v&&($.elements=v.get()),this.initDepthDrawParams({depth:y},$),this.initCullDrawParams({cull:b},$),this.drawCommand=r($),this.drawParams=$}return(0,j.Z)(e,[{key:"updateAttributesAndElements",value:function(t,n){var i={};Object.keys(t).forEach(function(o){i[o]=t[o].get()}),this.drawParams.attributes=i,this.drawParams.elements=n.get(),this.drawCommand=this.reGl(this.drawParams)}},{key:"updateAttributes",value:function(t){var n={};Object.keys(t).forEach(function(i){n[i]=t[i].get()}),this.drawParams.attributes=n,this.drawCommand=this.reGl(this.drawParams)}},{key:"addUniforms",value:function(t){this.uniforms=(0,V.Z)((0,V.Z)({},this.uniforms),this.extractUniforms(t))}},{key:"draw",value:function(t,n){if(!(this.drawParams.attributes&&Object.keys(this.drawParams.attributes).length===0)){var i=(0,V.Z)((0,V.Z)({},this.uniforms),this.extractUniforms(t.uniforms||{})),o={};Object.keys(i).forEach(function(s){var l=(0,cl.Z)(i[s]);l==="boolean"||l==="number"||Array.isArray(i[s])||i[s].BYTES_PER_ELEMENT?o[s]=i[s]:o[s]=i[s].get()}),o.blend=n?this.getBlendDrawParams({blend:{enable:!1}}):this.getBlendDrawParams(t),o.stencil=this.getStencilDrawParams(t),o.colorMask=this.getColorMaskDrawParams(t,n),this.drawCommand(o)}}},{key:"destroy",value:function(){var t;(t=this.drawParams)===null||t===void 0||(t=t.elements)===null||t===void 0||t.destroy(),this.options.attributes&&Object.values(this.options.attributes).forEach(function(n){n==null||n.destroy()}),this.destroyed=!0}},{key:"initDepthDrawParams",value:function(t,n){var i=t.depth;i&&(n.depth={enable:i.enable===void 0?!0:!!i.enable,mask:i.mask===void 0?!0:!!i.mask,func:o4[i.func||R.LESS],range:i.range||[0,1]})}},{key:"getBlendDrawParams",value:function(t){var n=t.blend,i=n||{},o=i.enable,s=i.func,l=i.equation,f=i.color,v=f===void 0?[0,0,0,0]:f;return{enable:!!o,func:{srcRGB:qg[s&&s.srcRGB||R.SRC_ALPHA],srcAlpha:qg[s&&s.srcAlpha||R.SRC_ALPHA],dstRGB:qg[s&&s.dstRGB||R.ONE_MINUS_SRC_ALPHA],dstAlpha:qg[s&&s.dstAlpha||R.ONE_MINUS_SRC_ALPHA]},equation:{rgb:xE[l&&l.rgb||R.FUNC_ADD],alpha:xE[l&&l.alpha||R.FUNC_ADD]},color:v}}},{key:"getStencilDrawParams",value:function(t){var n=t.stencil,i=n||{},o=i.enable,s=i.mask,l=s===void 0?-1:s,f=i.func,v=f===void 0?{cmp:R.ALWAYS,ref:0,mask:-1}:f,y=i.opFront,b=y===void 0?{fail:R.KEEP,zfail:R.KEEP,zpass:R.KEEP}:y,T=i.opBack,M=T===void 0?{fail:R.KEEP,zfail:R.KEEP,zpass:R.KEEP}:T;return{enable:!!o,mask:l,func:(0,V.Z)((0,V.Z)({},v),{},{cmp:s4[v.cmp]}),opFront:{fail:yv[b.fail],zfail:yv[b.zfail],zpass:yv[b.zpass]},opBack:{fail:yv[M.fail],zfail:yv[M.zfail],zpass:yv[M.zpass]}}}},{key:"getColorMaskDrawParams",value:function(t,n){var i=t.stencil,o=i!=null&&i.enable&&i.opFront&&!n?[!1,!1,!1,!1]:[!0,!0,!0,!0];return o}},{key:"initCullDrawParams",value:function(t,n){var i=t.cull;if(i){var o=i.enable,s=i.face,l=s===void 0?R.BACK:s;n.cull={enable:!!o,face:u4[l]}}}},{key:"extractUniforms",value:function(t){var n=this,i={};return Object.keys(t).forEach(function(o){n.extractUniformsRecursively(o,t[o],i,"")}),i}},{key:"extractUniformsRecursively",value:function(t,n,i,o){var s=this;if(n===null||typeof n=="number"||typeof n=="boolean"||Array.isArray(n)&&typeof n[0]=="number"||iF(n)||n===""||"resize"in n){i["".concat(o&&o+".").concat(t)]=n;return}nF(n)&&Object.keys(n).forEach(function(l){s.extractUniformsRecursively(l,n[l],i,"".concat(o&&o+".").concat(t))}),Array.isArray(n)&&n.forEach(function(l,f){Object.keys(l).forEach(function(v){s.extractUniformsRecursively(v,l[v],i,"".concat(o&&o+".").concat(t,"[").concat(f,"]"))})})}}]),e}(),oF=function(){function e(r,t){(0,Q.Z)(this,e),(0,B.Z)(this,"isDestroy",!1);var n=t.data,i=t.type,o=i===void 0?R.UNSIGNED_BYTE:i,s=t.width,l=t.height,f=t.flipY,v=f===void 0?!1:f,y=t.format,b=y===void 0?R.RGBA:y,T=t.mipmap,M=T===void 0?!1:T,O=t.wrapS,F=O===void 0?R.CLAMP_TO_EDGE:O,$=t.wrapT,G=$===void 0?R.CLAMP_TO_EDGE:$,ue=t.aniso,xe=ue===void 0?0:ue,ze=t.alignment,Je=ze===void 0?1:ze,ht=t.premultiplyAlpha,gt=ht===void 0?!1:ht,Ot=t.mag,tr=Ot===void 0?R.NEAREST:Ot,Ir=t.min,Er=Ir===void 0?R.NEAREST:Ir,mn=t.colorSpace,Ln=mn===void 0?R.BROWSER_DEFAULT_WEBGL:mn,Fi=t.x,xa=Fi===void 0?0:Fi,is=t.y,_s=is===void 0?0:is,as=t.copy,lu=as===void 0?!1:as;this.width=s,this.height=l;var Ac={width:s,height:l,type:S_[o],format:n4[b],wrapS:yE[F],wrapT:yE[G],mag:_E[tr],min:_E[Er],alignment:Je,flipY:v,colorSpace:a4[Ln],premultiplyAlpha:gt,aniso:xe,x:xa,y:_s,copy:lu};n&&(Ac.data=n),typeof M=="number"?Ac.mipmap=i4[M]:typeof M=="boolean"&&(Ac.mipmap=M),this.texture=r.texture(Ac)}return(0,j.Z)(e,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.texture(t)}},{key:"bind",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(t){var n=t.width,i=t.height;this.texture.resize(n,i),this.width=n,this.height=i}},{key:"getSize",value:function(){return[this.width,this.height]}},{key:"destroy",value:function(){if(!this.isDestroy){var t;(t=this.texture)===null||t===void 0||t.destroy()}this.isDestroy=!0}}]),e}(),QE,JE,sF=(QE=(0,yt.b2)(),QE(JE=function(){function e(){var r=this;(0,Q.Z)(this,e),(0,B.Z)(this,"uniformBuffers",[]),(0,B.Z)(this,"createModel",function(t){return new aF(r.gl,t)}),(0,B.Z)(this,"createAttribute",function(t){return new t4(r.gl,t)}),(0,B.Z)(this,"createBuffer",function(t){return new l4(r.gl,t)}),(0,B.Z)(this,"createElements",function(t){return new c4(r.gl,t)}),(0,B.Z)(this,"createTexture2D",function(t){return new oF(r.gl,t)}),(0,B.Z)(this,"createFramebuffer",function(t){return new f4(r.gl,t)}),(0,B.Z)(this,"useFramebuffer",function(t,n){r.gl({framebuffer:t?t.get():null})(n)}),(0,B.Z)(this,"clear",function(t){var n,i=t.color,o=t.depth,s=t.stencil,l=t.framebuffer,f=l===void 0?null:l,v={color:i,depth:o,stencil:s};v.framebuffer=f===null?f:f.get(),(n=r.gl)===null||n===void 0||n.clear(v)}),(0,B.Z)(this,"viewport",function(t){var n=t.x,i=t.y,o=t.width,s=t.height;r.gl._gl.viewport(n,i,o,s),r.width=o,r.height=s,r.gl._refresh()}),(0,B.Z)(this,"readPixels",function(t){var n=t.framebuffer,i=t.x,o=t.y,s=t.width,l=t.height,f={x:i,y:o,width:s,height:l};return n&&(f.framebuffer=n.get()),r.gl.read(f)}),(0,B.Z)(this,"getViewportSize",function(){return{width:r.gl._gl.drawingBufferWidth,height:r.gl._gl.drawingBufferHeight}}),(0,B.Z)(this,"getContainer",function(){var t;return(t=r.canvas)===null||t===void 0?void 0:t.parentElement}),(0,B.Z)(this,"getCanvas",function(){return r.canvas}),(0,B.Z)(this,"getGLContext",function(){return r.gl._gl}),(0,B.Z)(this,"destroy",function(){var t;r.canvas=null,(t=r.gl)===null||t===void 0||(t=t._gl)===null||t===void 0||(t=t.getExtension("WEBGL_lose_context"))===null||t===void 0||t.loseContext(),r.gl.destroy(),r.gl=null})}return(0,j.Z)(e,[{key:"init",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i,o,s){var l=this;return ge().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(this.canvas=i,!s){v.next=5;break}this.gl=s,v.next=8;break;case 5:return v.next=7,new Promise(function(y,b){e4()({canvas:l.canvas,attributes:{alpha:!0,antialias:o.antialias,premultipliedAlpha:!0,preserveDrawingBuffer:o.preserveDrawingBuffer,stencil:o.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:function(M,O){(M||!O)&&b(M),y(O)}})});case 7:this.gl=v.sent;case 8:this.extensionObject={OES_texture_float:this.testExtension("OES_texture_float")};case 9:case"end":return v.stop()}},n,this)}));function t(n,i,o){return r.apply(this,arguments)}return t}()},{key:"getPointSizeRange",value:function(){return this.gl._gl.getParameter(this.gl._gl.ALIASED_POINT_SIZE_RANGE)}},{key:"testExtension",value:function(t){return!!this.getGLContext().getExtension(t)}},{key:"setState",value:function(){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()}},{key:"setBaseState",value:function(){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()}},{key:"setCustomLayerDefaults",value:function(){var t=this.getGLContext();t.disable(t.CULL_FACE)}},{key:"setDirty",value:function(t){this.isDirty=t}},{key:"getDirty",value:function(){return this.isDirty}},{key:"beginFrame",value:function(){}},{key:"endFrame",value:function(){}}]),e}())||JE),uF=function(){function e(r,t){(0,Q.Z)(this,e);var n=t.buffer,i=t.offset,o=t.stride,s=t.normalized,l=t.size,f=t.divisor,v=t.shaderLocation;this.buffer=n,this.attribute={shaderLocation:v,buffer:n.get(),offset:i||0,stride:o||0,normalized:s||!1,divisor:f||0},l&&(this.attribute.size=l)}return(0,j.Z)(e,[{key:"get",value:function(){return this.buffer}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),e}(),zp,Yh,Ov,zm,Zm,hh,p0,wd,Cu,d0=(zp={},(0,B.Z)(zp,R.FLOAT,Float32Array),(0,B.Z)(zp,R.UNSIGNED_BYTE,Uint8Array),(0,B.Z)(zp,R.SHORT,Int16Array),(0,B.Z)(zp,R.UNSIGNED_SHORT,Uint16Array),(0,B.Z)(zp,R.INT,Int32Array),(0,B.Z)(zp,R.UNSIGNED_INT,Uint32Array),zp),lF=(Yh={},(0,B.Z)(Yh,R.POINTS,ms.POINTS),(0,B.Z)(Yh,R.LINES,ms.LINES),(0,B.Z)(Yh,R.LINE_LOOP,ms.LINES),(0,B.Z)(Yh,R.LINE_STRIP,ms.LINE_STRIP),(0,B.Z)(Yh,R.TRIANGLES,ms.TRIANGLES),(0,B.Z)(Yh,R.TRIANGLE_FAN,ms.TRIANGLES),(0,B.Z)(Yh,R.TRIANGLE_STRIP,ms.TRIANGLE_STRIP),Yh),cF=(Ov={},(0,B.Z)(Ov,1,Mt.F32_R),(0,B.Z)(Ov,2,Mt.F32_RG),(0,B.Z)(Ov,3,Mt.F32_RGB),(0,B.Z)(Ov,4,Mt.F32_RGBA),Ov),fF=(zm={},(0,B.Z)(zm,R.STATIC_DRAW,Af.STATIC),(0,B.Z)(zm,R.DYNAMIC_DRAW,Af.DYNAMIC),(0,B.Z)(zm,R.STREAM_DRAW,Af.DYNAMIC),zm),e2=(Zm={},(0,B.Z)(Zm,R.REPEAT,gl.REPEAT),(0,B.Z)(Zm,R.CLAMP_TO_EDGE,gl.CLAMP_TO_EDGE),(0,B.Z)(Zm,R.MIRRORED_REPEAT,gl.MIRRORED_REPEAT),Zm),hF=(hh={},(0,B.Z)(hh,R.NEVER,_a.NEVER),(0,B.Z)(hh,R.ALWAYS,_a.ALWAYS),(0,B.Z)(hh,R.LESS,_a.LESS),(0,B.Z)(hh,R.LEQUAL,_a.LEQUAL),(0,B.Z)(hh,R.GREATER,_a.GREATER),(0,B.Z)(hh,R.GEQUAL,_a.GEQUAL),(0,B.Z)(hh,R.EQUAL,_a.EQUAL),(0,B.Z)(hh,R.NOTEQUAL,_a.NOTEQUAL),hh),pF=(p0={},(0,B.Z)(p0,R.FRONT,Wl.FRONT),(0,B.Z)(p0,R.BACK,Wl.BACK),p0),t2=(wd={},(0,B.Z)(wd,R.FUNC_ADD,Tu.ADD),(0,B.Z)(wd,R.MIN_EXT,Tu.MIN),(0,B.Z)(wd,R.MAX_EXT,Tu.MAX),(0,B.Z)(wd,R.FUNC_SUBTRACT,Tu.SUBSTRACT),(0,B.Z)(wd,R.FUNC_REVERSE_SUBTRACT,Tu.REVERSE_SUBSTRACT),wd),v0=(Cu={},(0,B.Z)(Cu,R.ZERO,la.ZERO),(0,B.Z)(Cu,R.ONE,la.ONE),(0,B.Z)(Cu,R.SRC_COLOR,la.SRC),(0,B.Z)(Cu,R.ONE_MINUS_SRC_COLOR,la.ONE_MINUS_SRC),(0,B.Z)(Cu,R.SRC_ALPHA,la.SRC_ALPHA),(0,B.Z)(Cu,R.ONE_MINUS_SRC_ALPHA,la.ONE_MINUS_SRC_ALPHA),(0,B.Z)(Cu,R.DST_COLOR,la.DST),(0,B.Z)(Cu,R.ONE_MINUS_DST_COLOR,la.ONE_MINUS_DST),(0,B.Z)(Cu,R.DST_ALPHA,la.DST_ALPHA),(0,B.Z)(Cu,R.ONE_MINUS_DST_ALPHA,la.ONE_MINUS_DST_ALPHA),(0,B.Z)(Cu,R.CONSTANT_COLOR,la.CONST),(0,B.Z)(Cu,R.ONE_MINUS_CONSTANT_COLOR,la.ONE_MINUS_CONSTANT),(0,B.Z)(Cu,R.CONSTANT_ALPHA,la.CONST),(0,B.Z)(Cu,R.ONE_MINUS_CONSTANT_ALPHA,la.ONE_MINUS_CONSTANT),(0,B.Z)(Cu,R.SRC_ALPHA_SATURATE,la.SRC_ALPHA_SATURATE),Cu),dF={"[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 m0(e){return Object.prototype.toString.call(e)in dF}var vF=function(){function e(r,t){(0,Q.Z)(this,e),(0,B.Z)(this,"isDestroyed",!1);var n=t.data,i=t.usage,o=t.type,s=t.isUBO,l;m0(n)?l=n:l=new d0[this.type||R.FLOAT](n),this.type=o,this.size=l.byteLength,this.buffer=r.createBuffer({viewOrSize:l,usage:s?no.UNIFORM:no.VERTEX,hint:fF[i||R.STATIC_DRAW]})}return(0,j.Z)(e,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.isDestroyed||this.buffer.destroy(),this.isDestroyed=!0}},{key:"subData",value:function(t){var n=t.data,i=t.offset,o;m0(n)?o=n:o=new d0[this.type||R.FLOAT](n),this.buffer.setSubData(i,new Uint8Array(o.buffer))}}]),e}(),mF=function(){function e(r,t){(0,Q.Z)(this,e);var n=t.data,i=t.type,o=t.count,s=o===void 0?0:o,l;m0(n)?l=n:l=new d0[this.type||R.UNSIGNED_INT](n),this.type=i,this.count=s,this.indexBuffer=r.createBuffer({viewOrSize:l,usage:no.INDEX})}return(0,j.Z)(e,[{key:"get",value:function(){return this.indexBuffer}},{key:"subData",value:function(t){var n=t.data,i;m0(n)?i=n:i=new d0[this.type||R.UNSIGNED_INT](n),this.indexBuffer.setSubData(0,new Uint8Array(i.buffer))}},{key:"destroy",value:function(){this.indexBuffer.destroy()}}]),e}();function gF(e){return!1}var _F=function(){function e(r,t){(0,Q.Z)(this,e),(0,B.Z)(this,"isDestroy",!1);var n=t.data,i=t.type,o=i===void 0?R.UNSIGNED_BYTE:i,s=t.width,l=t.height,f=t.flipY,v=f===void 0?!1:f,y=t.format,b=y===void 0?R.RGBA:y,T=t.wrapS,M=T===void 0?R.CLAMP_TO_EDGE:T,O=t.wrapT,F=O===void 0?R.CLAMP_TO_EDGE:O,$=t.alignment,G=$===void 0?1:$;this.width=s,this.height=l;var ue=Mt.U8_RGBA_RT;if(o===R.UNSIGNED_BYTE&&b===R.RGBA)ue=Mt.U8_RGBA_RT;else if(b===R.LUMINANCE&&o===R.FLOAT)ue=Mt.F32_LUMINANCE;else if(b===R.LUMINANCE&&o===R.UNSIGNED_BYTE)ue=Mt.U8_LUMINANCE;else throw new Error("create texture error, type: ".concat(o,", format: ").concat(b));this.texture=r.createTexture({format:ue,width:s,height:l,usage:Ec.SAMPLED,pixelStore:{unpackFlipY:v,packAlignment:G}}),n&&this.texture.setImageData([n]),this.sampler=r.createSampler({addressModeU:e2[M],addressModeV:e2[F],minFilter:vs.POINT,magFilter:vs.BILINEAR,mipmapFilter:Xs.NO_MIP,lodMinClamp:0,lodMaxClamp:0})}return(0,j.Z)(e,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(t){var n=t.data;this.texture.setImageData([n])}},{key:"bind",value:function(){}},{key:"resize",value:function(t){var n=t.width,i=t.height;this.width=n,this.height=i}},{key:"getSize",value:function(){return[this.width,this.height]}},{key:"destroy",value:function(){if(!this.isDestroy){var t;(t=this.texture)===null||t===void 0||t.destroy()}this.isDestroy=!0}}]),e}(),yF=function(){function e(r,t){(0,Q.Z)(this,e),this.device=r;var n=t.width,i=t.height,o=t.color;gF(o)?(this.renderTarget=r.createRenderTargetFromTexture(o.get()),this.width=o.width,this.height=o.height):n&&i&&(this.renderTarget=r.createRenderTarget({format:Mt.U8_RGBA_RT,width:n,height:i}),this.width=n,this.height=i)}return(0,j.Z)(e,[{key:"get",value:function(){return this.renderTarget}},{key:"destroy",value:function(){this.renderTarget.destroy()}},{key:"resize",value:function(t){var n=t.width,i=t.height;(this.width!==n||this.height!==i)&&(this.renderTarget&&this.renderTarget.destroy(),this.renderTarget=this.device.createRenderTarget({format:Mt.U8_RGBA_RT,width:n,height:i}),this.width=n,this.height=i)}}]),e}(),xF=oi.isPlainObject,bF=oi.isTypedArray,EF=function(){function e(r,t){var n=this;(0,Q.Z)(this,e),(0,B.Z)(this,"destroyed",!1),(0,B.Z)(this,"uniforms",{}),(0,B.Z)(this,"vertexBuffers",[]),this.device=r,this.options=t;var i=t.vs,o=t.fs,s=t.attributes,l=t.uniforms,f=t.count,v=t.elements;this.options=t;var y=r.createProgram({vertex:{glsl:i},fragment:{glsl:o}});this.program=y,l&&(this.uniforms=this.extractUniforms(l));var b=[],T=0;Object.keys(s).forEach(function(O){var F=s[O],$=F.get();n.vertexBuffers.push($.get());var G=F.attribute,ue=G.offset,xe=ue===void 0?0:ue,ze=G.stride,Je=ze===void 0?0:ze,ht=G.size,gt=ht===void 0?1:ht,Ot=G.divisor,tr=Ot===void 0?0:Ot,Ir=G.shaderLocation,Er=Ir===void 0?0:Ir;b.push({arrayStride:Je||gt*4,stepMode:Sd.VERTEX,attributes:[{format:cF[gt],shaderLocation:Er,offset:xe,divisor:tr}]}),T=$.size/gt}),f||(this.options.count=T),v&&(this.indexBuffer=v.get());var M=r.createInputLayout({vertexBufferDescriptors:b,indexBufferFormat:v?Mt.U32_R:null,program:y});this.inputLayout=M,this.pipeline=this.createPipeline(t)}return(0,j.Z)(e,[{key:"createPipeline",value:function(t){var n=t.primitive,i=n===void 0?R.TRIANGLES:n,o=t.depth,s=t.cull,l=t.blend,f=this.initDepthDrawParams({depth:o}),v=!!(f&&f.enable),y=this.initCullDrawParams({cull:s}),b=!!(y&&y.enable),T=this.getBlendDrawParams({blend:l}),M=!!(T&&T.enable);return this.device.createRenderPipeline({inputLayout:this.inputLayout,program:this.program,topology:lF[i],colorAttachmentFormats:[Mt.U8_RGBA_RT],depthStencilAttachmentFormat:Mt.D24_S8,megaStateDescriptor:{attachmentsState:[{channelWriteMask:wu.ALL,rgbBlendState:{blendMode:M&&T.equation.rgb||Tu.ADD,blendSrcFactor:M&&T.func.srcRGB||la.SRC_ALPHA,blendDstFactor:M&&T.func.dstRGB||la.ONE_MINUS_SRC_ALPHA},alphaBlendState:{blendMode:M&&T.equation.alpha||Tu.ADD,blendSrcFactor:M&&T.func.srcAlpha||la.ONE,blendDstFactor:M&&T.func.dstAlpha||la.ONE_MINUS_SRC_ALPHA}}],blendConstant:A_,depthWrite:v,depthCompare:v&&f.func||_a.LESS,cullMode:b&&y.face||Wl.NONE,stencilWrite:!1}})}},{key:"updateAttributesAndElements",value:function(){}},{key:"updateAttributes",value:function(){}},{key:"addUniforms",value:function(t){this.uniforms=(0,V.Z)((0,V.Z)({},this.uniforms),this.extractUniforms(t))}},{key:"draw",value:function(t){var n=(0,V.Z)((0,V.Z)({},this.options),t),i=n.count,o=i===void 0?0:i,s=n.instances,l=n.elements,f=n.uniforms,v=f===void 0?{}:f,y=n.uniformBuffers,b=n.textures;this.uniforms=(0,V.Z)((0,V.Z)({},this.uniforms),this.extractUniforms(v));var T=this.device,M=T.width,O=T.height,F=this.device.renderPass;if(this.pipeline=this.createPipeline(n),F.setPipeline(this.pipeline),F.setVertexInput(this.inputLayout,this.vertexBuffers.map(function(G){return{buffer:G}}),l?{buffer:this.indexBuffer,offset:0}:null),F.setViewport(0,0,M,O),y&&(this.bindings=this.device.createBindings({pipeline:this.pipeline,uniformBufferBindings:y.map(function(G,ue){var xe=G;return{binding:ue,buffer:xe.get(),size:xe.size}}),samplerBindings:b==null?void 0:b.map(function(G){return{texture:G.texture,sampler:G.sampler}})})),this.bindings&&(F.setBindings(this.bindings),this.program.setUniformsLegacy(this.uniforms)),l){var $=l.count;$===0?F.draw(o,s):F.drawIndexed($,s)}else F.draw(o,s)}},{key:"destroy",value:function(){var t,n,i;this.program.destroy(),(t=this.vertexBuffers)===null||t===void 0||t.forEach(function(o){return o.destroy()}),(n=this.indexBuffer)===null||n===void 0||n.destroy(),(i=this.bindings)===null||i===void 0||i.destroy(),this.inputLayout.destroy(),this.pipeline.destroy(),this.destroyed=!0}},{key:"initDepthDrawParams",value:function(t){var n=t.depth;if(n)return{enable:n.enable===void 0?!0:!!n.enable,mask:n.mask===void 0?!0:!!n.mask,func:hF[n.func||R.LESS],range:n.range||[0,1]}}},{key:"getBlendDrawParams",value:function(t){var n=t.blend,i=n||{},o=i.enable,s=i.func,l=i.equation,f=i.color,v=f===void 0?[0,0,0,0]:f;return{enable:!!o,func:{srcRGB:v0[s&&s.srcRGB||R.SRC_ALPHA],srcAlpha:v0[s&&s.srcAlpha||R.SRC_ALPHA],dstRGB:v0[s&&s.dstRGB||R.ONE_MINUS_SRC_ALPHA],dstAlpha:v0[s&&s.dstAlpha||R.ONE_MINUS_SRC_ALPHA]},equation:{rgb:t2[l&&l.rgb||R.FUNC_ADD],alpha:t2[l&&l.alpha||R.FUNC_ADD]},color:v}}},{key:"initCullDrawParams",value:function(t){var n=t.cull;if(n){var i=n.enable,o=n.face,s=o===void 0?R.BACK:o;return{enable:!!i,face:pF[s]}}}},{key:"extractUniforms",value:function(t){var n=this,i={};return Object.keys(t).forEach(function(o){n.extractUniformsRecursively(o,t[o],i,"")}),i}},{key:"extractUniformsRecursively",value:function(t,n,i,o){var s=this;if(n===null||typeof n=="number"||typeof n=="boolean"||Array.isArray(n)&&typeof n[0]=="number"||bF(n)||n===""||"resize"in n){i["".concat(o&&o+".").concat(t)]=n;return}xF(n)&&Object.keys(n).forEach(function(l){s.extractUniformsRecursively(l,n[l],i,"".concat(o&&o+".").concat(t))}),Array.isArray(n)&&n.forEach(function(l,f){Object.keys(l).forEach(function(v){s.extractUniformsRecursively(v,l[v],i,"".concat(o&&o+".").concat(t,"[").concat(f,"]"))})})}}]),e}();function SF(e){return typeof WebGL2RenderingContext!="undefined"&&e instanceof WebGL2RenderingContext?!0:!!(e&&e._version===2)}var r2,n2,AF=(r2=(0,yt.b2)(),r2(n2=function(){function e(){var r=this;(0,Q.Z)(this,e),(0,B.Z)(this,"uniformBuffers",[]),(0,B.Z)(this,"createModel",function(t){return new EF(r.device,t)}),(0,B.Z)(this,"createAttribute",function(t){return new uF(r.device,t)}),(0,B.Z)(this,"createBuffer",function(t){return new vF(r.device,t)}),(0,B.Z)(this,"createElements",function(t){return new mF(r.device,t)}),(0,B.Z)(this,"createTexture2D",function(t){return new _F(r.device,t)}),(0,B.Z)(this,"createFramebuffer",function(t){return new yF(r.device,t)}),(0,B.Z)(this,"useFramebuffer",function(){}),(0,B.Z)(this,"clear",function(){}),(0,B.Z)(this,"viewport",function(t){var n=t.width,i=t.height;r.width=n,r.height=i,r.device.width=n,r.device.height=i}),(0,B.Z)(this,"readPixels",function(){return new Uint8Array}),(0,B.Z)(this,"getViewportSize",function(){return{width:r.device.width,height:r.device.height}}),(0,B.Z)(this,"getContainer",function(){var t;return(t=r.canvas)===null||t===void 0?void 0:t.parentElement}),(0,B.Z)(this,"getCanvas",function(){return r.canvas}),(0,B.Z)(this,"getGLContext",function(){return r.device.gl}),(0,B.Z)(this,"destroy",function(){var t;r.canvas=null,(t=r.uniformBuffers)===null||t===void 0||t.forEach(function(n){n.destroy()}),r.device.destroy()})}return(0,j.Z)(e,[{key:"init",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i,o){var s,l,f,v,y,b;return ge().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return s=o.enableWebGPU,l=o.shaderCompilerPath,this.canvas=i,f=s?new rF({shaderCompilerPath:l}):new pD({targets:["webgl2","webgl1"],onContextLost:function(F){console.warn("context lost",F)},onContextCreationError:function(F){console.warn("context creation error",F)},onContextRestored:function(F){console.warn("context restored",F)}}),M.next=5,f.createSwapChain(i);case 5:v=M.sent,v.configureSwapChain(i.width,i.height),this.device=v.getDevice(),this.swapChain=v,y=this.device.gl,this.extensionObject={OES_texture_float:!SF(y)&&this.device.OES_texture_float},b=this.device.createTexture({format:Mt.U8_RGBA_RT,width:i.width,height:i.height,usage:Ec.RENDER_TARGET}),this.renderTarget=this.device.createRenderTargetFromTexture(b),this.mainDepthRT=this.device.createRenderTargetFromTexture(this.device.createTexture({format:Mt.D24_S8,width:i.width,height:i.height,usage:Ec.RENDER_TARGET}));case 14:case"end":return M.stop()}},n,this)}));function t(n,i){return r.apply(this,arguments)}return t}()},{key:"beginFrame",value:function(){var t=this.swapChain.getOnscreenTexture();this.renderPass=this.device.createRenderPass({colorAttachment:[this.renderTarget],colorResolveTo:[t],colorClearColor:[A_],depthStencilAttachment:this.mainDepthRT,depthClearValue:1}),this.device.renderPass=this.renderPass}},{key:"endFrame",value:function(){this.device.submitPass(this.renderPass)}},{key:"getPointSizeRange",value:function(){var t=this.device.gl;return t.getParameter(t.ALIASED_POINT_SIZE_RANGE)}},{key:"testExtension",value:function(t){return!!this.getGLContext().getExtension(t)}},{key:"setState",value:function(){}},{key:"setBaseState",value:function(){}},{key:"setCustomLayerDefaults",value:function(){}},{key:"setDirty",value:function(t){this.isDirty=t}},{key:"getDirty",value:function(){return this.isDirty}}]),e}())||n2);function TF(e){var r=wF();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function wF(){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(e){return!1}}var F_=["selectstart","selecting","selectend"],CF=function(e){(0,Le.Z)(t,e);var r=TF(t);function t(n){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(0,Q.Z)(this,t),i=r.call(this),(0,B.Z)((0,Fe.Z)(i),"isEnable",!1),(0,B.Z)((0,Fe.Z)(i),"onDragStart",function(s){i.box.style.display="block",i.startEvent=i.endEvent=s,i.syncBoxBound(),i.emit("selectstart",i.getLngLatBox(),i.startEvent,i.endEvent)}),(0,B.Z)((0,Fe.Z)(i),"onDragging",function(s){i.endEvent=s,i.syncBoxBound(),i.emit("selecting",i.getLngLatBox(),i.startEvent,i.endEvent)}),(0,B.Z)((0,Fe.Z)(i),"onDragEnd",function(s){i.endEvent=s,i.box.style.display="none",i.emit("selectend",i.getLngLatBox(),i.startEvent,i.endEvent)}),i.scene=n,i.options=o,i}return(0,j.Z)(t,[{key:"container",get:function(){return this.scene.getMapService().getMarkerContainer()}},{key:"enable",value:function(){if(!this.isEnable){var i=this.options.className;if(this.scene.setMapStatus({dragEnable:!1}),this.container.style.cursor="crosshair",!this.box){var o=ta("div",void 0,this.container);o.classList.add("l7-select-box"),i&&o.classList.add(i),o.style.display="none",this.box=o}this.scene.on("dragstart",this.onDragStart),this.scene.on("dragging",this.onDragging),this.scene.on("dragend",this.onDragEnd),this.isEnable=!0}}},{key:"disable",value:function(){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)}},{key:"syncBoxBound",value:function(){var i=this.startEvent,o=i.x,s=i.y,l=this.endEvent,f=l.x,v=l.y,y=Math.min(o,f),b=Math.min(s,v),T=Math.abs(o-f),M=Math.abs(s-v);this.box.style.top="".concat(b,"px"),this.box.style.left="".concat(y,"px"),this.box.style.width="".concat(T,"px"),this.box.style.height="".concat(M,"px")}},{key:"getLngLatBox",value:function(){var i=this.startEvent.lngLat,o=i.lng,s=i.lat,l=this.endEvent.lngLat,f=l.lng,v=l.lat;return op([[o,s],[f,v]])}}]),t}(io.EventEmitter),RF=function(){function e(r){(0,Q.Z)(this,e);var t=r.id,n=r.map,i=r.canvas,o=r.hasBaseMap,s=r.renderer,l=s===void 0?"regl":s,f=xA();this.container=f,n.setContainer(f,t,i,o),f.bind(ot.IRendererService).to(l==="regl"?sF:AF).inSingletonScope(),this.sceneService=f.get(ot.ISceneService),this.mapService=f.get(ot.IMapService),this.iconService=f.get(ot.IIconService),this.fontService=f.get(ot.IFontService),this.controlService=f.get(ot.IControlService),this.layerService=f.get(ot.ILayerService),this.debugService=f.get(ot.IDebugService),this.debugService.setEnable(r.debug),this.markerService=f.get(ot.IMarkerService),this.interactionService=f.get(ot.IInteractionService),this.popupService=f.get(ot.IPopupService),this.boxSelect=new CF(this,{}),this.initComponent(t),this.sceneService.init(r),this.initControl()}return(0,j.Z)(e,[{key:"map",get:function(){return this.mapService.map}},{key:"loaded",get:function(){return this.sceneService.loaded}},{key:"getServiceContainer",value:function(){return this.container}},{key:"getSize",value:function(){return this.mapService.getSize()}},{key:"getMinZoom",value:function(){return this.mapService.getMinZoom()}},{key:"getMaxZoom",value:function(){return this.mapService.getMaxZoom()}},{key:"getType",value:function(){return this.mapService.getType()}},{key:"getMapContainer",value:function(){return this.mapService.getMapContainer()}},{key:"getMapCanvasContainer",value:function(){return this.mapService.getMapCanvasContainer()}},{key:"getMapService",value:function(){return this.mapService}},{key:"getDebugService",value:function(){return this.debugService}},{key:"exportPng",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i){return ge().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",this.sceneService.exportPng(i));case 1:case"end":return s.stop()}},n,this)}));function t(n){return r.apply(this,arguments)}return t}()},{key:"exportMap",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i){return ge().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",this.sceneService.exportPng(i));case 1:case"end":return s.stop()}},n,this)}));function t(n){return r.apply(this,arguments)}return t}()},{key:"registerRenderService",value:function(t){var n=this;if(this.sceneService.loaded){var i=new t(this);i.init()}else this.on("loaded",function(){var o=new t(n);o.init()})}},{key:"setBgColor",value:function(t){this.mapService.setBgColor(t)}},{key:"addLayer",value:function(t){var n=this,i=lm(this.container);if(t.setContainer(i,this.container),this.sceneService.addLayer(t),t.inited){var o=this.initMask(t);this.addMask(o,t.id)}else t.on("inited",function(){var s=n.initMask(t);n.addMask(s,t.id)})}},{key:"initMask",value:function(t){var n=t.getLayerConfig(),i=n.mask,o=n.maskfence,s=n.maskColor,l=s===void 0?"#000":s,f=n.maskOpacity,v=f===void 0?0:f;if(!(!i||!o)){var y=new ix().source(o).shape("fill").style({color:l,opacity:v});return y}}},{key:"addMask",value:function(t,n){if(t){var i=this.getLayer(n);if(i){var o=lm(this.container);t.setContainer(o,this.container),i.addMaskLayer(t),this.sceneService.addMask(t)}else console.warn("parent layer not find!")}}},{key:"getPickedLayer",value:function(){return this.layerService.pickedLayerId}},{key:"getLayers",value:function(){return this.layerService.getLayers()}},{key:"getLayer",value:function(t){return this.layerService.getLayer(t)}},{key:"getLayerByName",value:function(t){return this.layerService.getLayerByName(t)}},{key:"removeLayer",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i,o){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.layerService.remove(i,o);case 2:case"end":return l.stop()}},n,this)}));function t(n,i){return r.apply(this,arguments)}return t}()},{key:"removeAllLayer",value:function(){var r=(0,Pt.Z)(ge().mark(function n(){return ge().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.layerService.removeAllLayers();case 2:case"end":return o.stop()}},n,this)}));function t(){return r.apply(this,arguments)}return t}()},{key:"render",value:function(){this.sceneService.render()}},{key:"setEnableRender",value:function(t){this.layerService.setEnableRender(t)}},{key:"addIconFont",value:function(t,n){this.fontService.addIconFont(t,n)}},{key:"addIconFonts",value:function(t){var n=this;t.forEach(function(i){var o=(0,Sn.Z)(i,2),s=o[0],l=o[1];n.fontService.addIconFont(s,l)})}},{key:"addFontFace",value:function(t,n){var i=this;this.fontService.once("fontloaded",function(o){i.emit("fontloaded",o)}),this.fontService.addFontFace(t,n)}},{key:"addImage",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i,o){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.iconService.addImage(i,o);case 2:case"end":return l.stop()}},n,this)}));function t(n,i){return r.apply(this,arguments)}return t}()},{key:"hasImage",value:function(t){return this.iconService.hasImage(t)}},{key:"removeImage",value:function(t){this.iconService.removeImage(t)}},{key:"addIconFontGlyphs",value:function(t,n){this.fontService.addIconGlyphs(n)}},{key:"addControl",value:function(t){this.controlService.addControl(t,this.container)}},{key:"removeControl",value:function(t){this.controlService.removeControl(t)}},{key:"getControlByName",value:function(t){return this.controlService.getControlByName(t)}},{key:"addMarker",value:function(t){this.markerService.addMarker(t)}},{key:"addMarkerLayer",value:function(t){this.markerService.addMarkerLayer(t)}},{key:"removeMarkerLayer",value:function(t){this.markerService.removeMarkerLayer(t)}},{key:"removeAllMarkers",value:function(){this.markerService.removeAllMarkers()}},{key:"removeAllMakers",value:function(){console.warn("removeAllMakers \u5DF2\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 removeAllMarkers"),this.markerService.removeAllMarkers()}},{key:"addPopup",value:function(t){this.popupService.addPopup(t)}},{key:"removePopup",value:function(t){this.popupService.removePopup(t)}},{key:"on",value:function(t,n){if(F_.includes(t)){var i;(i=this.boxSelect)===null||i===void 0||i.on(t,n)}else gg.includes(t)?this.sceneService.on(t,n):this.mapService.on(t,n)}},{key:"once",value:function(t,n){if(F_.includes(t)){var i;(i=this.boxSelect)===null||i===void 0||i.once(t,n)}else gg.includes(t)?this.sceneService.once(t,n):this.mapService.once(t,n)}},{key:"emit",value:function(t,n){gg.indexOf(t)===-1?this.mapService.on(t,n):this.sceneService.emit(t,n)}},{key:"off",value:function(t,n){if(F_.includes(t)){var i;(i=this.boxSelect)===null||i===void 0||i.off(t,n)}else gg.includes(t)?this.sceneService.off(t,n):this.mapService.off(t,n)}},{key:"getZoom",value:function(){return this.mapService.getZoom()}},{key:"getCenter",value:function(t){return this.mapService.getCenter(t)}},{key:"setCenter",value:function(t,n){return this.mapService.setCenter(t,n)}},{key:"getPitch",value:function(){return this.mapService.getPitch()}},{key:"setPitch",value:function(t){return this.mapService.setPitch(t)}},{key:"getRotation",value:function(){return this.mapService.getRotation()}},{key:"getBounds",value:function(){return this.mapService.getBounds()}},{key:"setRotation",value:function(t){this.mapService.setRotation(t)}},{key:"zoomIn",value:function(){this.mapService.zoomIn()}},{key:"zoomOut",value:function(){this.mapService.zoomOut()}},{key:"panTo",value:function(t){this.mapService.panTo(t)}},{key:"panBy",value:function(t,n){this.mapService.panBy(t,n)}},{key:"getContainer",value:function(){return this.mapService.getContainer()}},{key:"setZoom",value:function(t){this.mapService.setZoom(t)}},{key:"fitBounds",value:function(t,n){var i=this.sceneService.getSceneConfig(),o=i.fitBoundsOptions,s=i.animate;this.mapService.fitBounds(t,n||(0,V.Z)((0,V.Z)({},o),{},{animate:s}))}},{key:"setZoomAndCenter",value:function(t,n){this.mapService.setZoomAndCenter(t,n)}},{key:"setMapStyle",value:function(t){this.mapService.setMapStyle(t)}},{key:"setMapStatus",value:function(t){this.mapService.setMapStatus(t)}},{key:"pixelToLngLat",value:function(t){return this.mapService.pixelToLngLat(t)}},{key:"lngLatToPixel",value:function(t){return this.mapService.lngLatToPixel(t)}},{key:"containerToLngLat",value:function(t){return this.mapService.containerToLngLat(t)}},{key:"lngLatToContainer",value:function(t){return this.mapService.lngLatToContainer(t)}},{key:"destroy",value:function(){this.sceneService.destroy()}},{key:"registerPostProcessingPass",value:function(t,n){this.container.bind(ot.IPostProcessingPass).to(t).whenTargetNamed(n)}},{key:"enableShaderPick",value:function(){this.layerService.enableShaderPick()}},{key:"diasbleShaderPick",value:function(){this.layerService.disableShaderPick()}},{key:"enableBoxSelect",value:function(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.boxSelect.enable(),n&&this.boxSelect.once("selectend",function(){t.disableBoxSelect()})}},{key:"disableBoxSelect",value:function(){this.boxSelect.disable()}},{key:"getProtocol",value:function(t){return en.REGISTERED_PROTOCOLS[t]}},{key:"getPointSizeRange",value:function(){return this.sceneService.getPointSizeRange()}},{key:"initComponent",value:function(t){this.controlService.init({container:Ds(t)},this.container),this.markerService.init(this.container),this.popupService.init(this.container)}},{key:"initControl",value:function(){var t=this.sceneService.getSceneConfig(),n=t.logoVisible,i=t.logoPosition;n&&this.addControl(new t1({position:i}))}}],[{key:"addProtocol",value:function(t,n){en.REGISTERED_PROTOCOLS[t]=n}},{key:"removeProtocol",value:function(t){delete en.REGISTERED_PROTOCOLS[t]}}]),e}(),VN="2.20.5";function Vm(e){"@babel/helpers - typeof";return Vm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Vm(e)}function i2(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function jN(e){for(var r=1;re.length)&&(r=e.length);for(var t=0,n=new Array(r);t0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.map.panBy([t,n])}},{key:"fitBounds",value:function(t,n){this.map.fitBounds(t,n)}},{key:"setMaxZoom",value:function(t){this.map.setMaxZoom(t)}},{key:"setMinZoom",value:function(t){this.map.setMinZoom(t)}},{key:"setMapStatus",value:function(t){t.doubleClickZoom===!0&&this.map.doubleClickZoom.enable(),t.doubleClickZoom===!1&&this.map.doubleClickZoom.disable(),t.dragEnable===!1&&this.map.dragPan.disable(),t.dragEnable===!0&&this.map.dragPan.enable(),t.rotateEnable===!1&&this.map.dragRotate.disable(),t.dragEnable===!0&&this.map.dragRotate.enable(),t.keyboardEnable===!1&&this.map.keyboard.disable(),t.keyboardEnable===!0&&this.map.keyboard.enable(),t.zoomEnable===!1&&this.map.scrollZoom.disable(),t.zoomEnable===!0&&this.map.scrollZoom.enable()}},{key:"setZoomAndCenter",value:function(t,n){this.map.flyTo({zoom:t,center:n})}},{key:"setMapStyle",value:function(t){this.map.setStyle(this.getMapStyleValue(t))}},{key:"meterToCoord",value:function(t,n){return 1}},{key:"pixelToLngLat",value:function(t){return this.map.unproject(t)}},{key:"lngLatToPixel",value:function(t){return this.map.project(t)}},{key:"containerToLngLat",value:function(t){return this.map.unproject(t)}},{key:"lngLatToContainer",value:function(t){return this.map.project(t)}},{key:"getMapStyle",value:function(){try{var t,n=(t=this.map.getStyle().sprite)!==null&&t!==void 0?t:"";return/^mapbox:\/\/sprites\/zcxduo\/\w+\/\w+$/.test(n)?n==null?void 0:n.replace(/\/\w+$/,"").replace(/sprites/,"styles"):n}catch(i){return""}}},{key:"getMapStyleConfig",value:function(){return UF}},{key:"getMapStyleValue",value:function(t){var n;return(n=this.getMapStyleConfig()[t])!==null&&n!==void 0?n:t}},{key:"destroy",value:function(){this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}},{key:"emit",value:function(t){for(var n,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s1?i-1:0),s=1;szF&&n?this.coordinateSystemService.setCoordinateSystem(zl.LNGLAT_OFFSET):this.coordinateSystemService.setCoordinateSystem(zl.LNGLAT)}}]),e}(),d2=ki(Dv.prototype,"config",[l2],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),v2=ki(Dv.prototype,"configService",[c2],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),m2=ki(Dv.prototype,"coordinateSystemService",[f2],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),g2=ki(Dv.prototype,"eventEmitter",[h2],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Dv))||p2);function Hm(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function g0(e,r){var t=Fh.fF([],r,e);return Fh.bA(t,t,1/t[3]),t}function XN(e,r){var t=e%r;return t<0?r+t:t}function $N(e,r,t){return t*r+(1-t)*e}function Cd(e,r){if(!e)throw new Error(r||"viewport-mercator-project: assertion failed.")}var wf=Math.PI,y2=wf/4,qh=wf/180,x2=180/wf,B_=512,L_=4003e4,VF=1.5;function b2(e){return Math.pow(2,e)}function jF(e){return Math.log2(e)}function _0(e,r){var t=(0,Sn.Z)(e,2),n=t[0],i=t[1];Cd(Number.isFinite(n)&&Number.isFinite(r)),Cd(Number.isFinite(i)&&i>=-90&&i<=90,"invalid latitude"),r*=B_;var o=n*qh,s=i*qh,l=r*(o+wf)/(2*wf),f=r*(wf-Math.log(Math.tan(y2+s*.5)))/(2*wf);return[l,f]}function N_(e,r){var t=(0,Sn.Z)(e,2),n=t[0],i=t[1];r*=B_;var o=n/r*(2*wf)-wf,s=2*(Math.atan(Math.exp(wf-i/r*(2*wf)))-y2);return[o*x2,s*x2]}function YN(e){var r=e.latitude;assert(Number.isFinite(r));var t=Math.cos(r*qh);return jF(L_*t)-9}function E2(e){var r=e.latitude,t=e.longitude,n=e.zoom,i=e.scale,o=e.highPrecision,s=o===void 0?!1:o;i=i!==void 0?i:b2(n),Cd(Number.isFinite(r)&&Number.isFinite(t)&&Number.isFinite(i));var l={},f=B_*i,v=Math.cos(r*qh),y=f/360,b=y/v,T=f/L_/v;if(l.pixelsPerMeter=[T,-T,T],l.metersPerPixel=[1/T,-1/T,1/T],l.pixelsPerDegree=[y,-b,T],l.degreesPerPixel=[1/y,-1/b,1/T],s){var M=qh*Math.tan(r*qh)/v,O=y*M/2,F=f/L_*M,$=F/b*T;l.pixelsPerDegree2=[0,-O,F],l.pixelsPerMeter2=[$,0,$]}return l}function qN(e,r){var t=_slicedToArray(e,3),n=t[0],i=t[1],o=t[2],s=_slicedToArray(r,3),l=s[0],f=s[1],v=s[2],y=1,b=E2({longitude:n,latitude:i,scale:y,highPrecision:!0}),T=b.pixelsPerMeter,M=b.pixelsPerMeter2,O=_0(e,y);O[0]+=l*(T[0]+M[0]*f),O[1]+=f*(T[1]+M[1]*f);var F=N_(O,y),$=(o||0)+(v||0);return Number.isFinite(o)||Number.isFinite(v)?[F[0],F[1],$]:F}function HF(e){var r=e.height,t=e.pitch,n=e.bearing,i=e.altitude,o=e.center,s=o===void 0?null:o,l=e.flipY,f=l===void 0?!1:l,v=Hm();return me.translate(v,v,[0,0,-i]),me.scale(v,v,[1,1,1/r]),me.rotateX(v,v,-t*qh),me.rotateZ(v,v,n*qh),f&&me.scale(v,v,[1,-1,1]),s&&me.translate(v,v,La.negate([],s)),v}function WF(e){var r=e.width,t=e.height,n=e.altitude,i=n===void 0?VF:n,o=e.pitch,s=o===void 0?0:o,l=e.nearZMultiplier,f=l===void 0?1:l,v=e.farZMultiplier,y=v===void 0?1:v,b=s*qh,T=Math.atan(.5/i),M=Math.sin(T)*i/Math.sin(Math.PI/2-b-T),O=Math.cos(Math.PI/2-b)*M+i;return{fov:2*Math.atan(t/2/i),aspect:r/t,focalDistance:i,near:f,far:O*y}}function GF(e){var r=e.width,t=e.height,n=e.pitch,i=e.altitude,o=e.nearZMultiplier,s=e.farZMultiplier,l=WF({width:r,height:t,altitude:i,pitch:n,nearZMultiplier:o,farZMultiplier:s}),f=l.fov,v=l.aspect,y=l.near,b=l.far,T=me.perspective([],f,v,y,b);return T}function XF(e,r){var t=(0,Sn.Z)(e,3),n=t[0],i=t[1],o=t[2],s=o===void 0?0:o;return Cd(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(s)),g0(r,[n,i,s,1])}function S2(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(0,Sn.Z)(e,3),i=n[0],o=n[1],s=n[2];if(Cd(Number.isFinite(i)&&Number.isFinite(o),"invalid pixel coordinate"),Number.isFinite(s)){var l=g0(r,[i,o,s,1]);return l}var f=g0(r,[i,o,0,1]),v=g0(r,[i,o,1,1]),y=f[2],b=v[2],T=y===b?0:((t||0)-y)/(b-y);return Or.t7([],f,v,T)}var A2=Hm(),$F=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.width,n=r.height,i=r.viewMatrix,o=i===void 0?A2:i,s=r.projectionMatrix,l=s===void 0?A2:s;(0,Q.Z)(this,e),this.width=t||1,this.height=n||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=l;var f=Hm();me.multiply(f,f,this.projectionMatrix),me.multiply(f,f,this.viewMatrix),this.viewProjectionMatrix=f;var v=Hm();me.scale(v,v,[this.width/2,-this.height/2,1]),me.translate(v,v,[1,-1,0]),me.multiply(v,v,this.viewProjectionMatrix);var y=me.invert(Hm(),v);if(!y)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=v,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,j.Z)(e,[{key:"equals",value:function(t){return t instanceof e?t.width===this.width&&t.height===this.height&&me.equals(t.projectionMatrix,this.projectionMatrix)&&me.equals(t.viewMatrix,this.viewMatrix):!1}},{key:"project",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.topLeft,o=i===void 0?!0:i,s=this.projectPosition(t),l=XF(s,this.pixelProjectionMatrix),f=(0,Sn.Z)(l,2),v=f[0],y=f[1],b=o?y:this.height-y;return t.length===2?[v,b]:[v,b,l[2]]}},{key:"unproject",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.topLeft,o=i===void 0?!0:i,s=n.targetZ,l=(0,Sn.Z)(t,3),f=l[0],v=l[1],y=l[2],b=o?v:this.height-v,T=s&&s*this.pixelsPerMeter,M=S2([f,b,y],this.pixelUnprojectionMatrix,T),O=this.unprojectPosition(M),F=(0,Sn.Z)(O,3),$=F[0],G=F[1],ue=F[2];return Number.isFinite(y)?[$,G,ue]:Number.isFinite(s)?[$,G,s]:[$,G]}},{key:"projectPosition",value:function(t){var n=this.projectFlat(t),i=(0,Sn.Z)(n,2),o=i[0],s=i[1],l=(t[2]||0)*this.pixelsPerMeter;return[o,s,l]}},{key:"unprojectPosition",value:function(t){var n=this.unprojectFlat(t),i=(0,Sn.Z)(n,2),o=i[0],s=i[1],l=(t[2]||0)/this.pixelsPerMeter;return[o,s,l]}},{key:"projectFlat",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return t}},{key:"unprojectFlat",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return t}}]),e}();function YF(e){var r=e.width,t=e.height,n=e.bounds,i=e.minExtent,o=i===void 0?0:i,s=e.maxZoom,l=s===void 0?24:s,f=e.padding,v=f===void 0?0:f,y=e.offset,b=y===void 0?[0,0]:y,T=(0,Sn.Z)(n,2),M=(0,Sn.Z)(T[0],2),O=M[0],F=M[1],$=(0,Sn.Z)(T[1],2),G=$[0],ue=$[1];if(Number.isFinite(v)){var xe=v;v={top:xe,bottom:xe,left:xe,right:xe}}else Cd(Number.isFinite(v.top)&&Number.isFinite(v.bottom)&&Number.isFinite(v.left)&&Number.isFinite(v.right));var ze=new T2({width:r,height:t,longitude:0,latitude:0,zoom:0}),Je=ze.project([O,ue]),ht=ze.project([G,F]),gt=[Math.max(Math.abs(ht[0]-Je[0]),o),Math.max(Math.abs(ht[1]-Je[1]),o)],Ot=[r-v.left-v.right-Math.abs(b[0])*2,t-v.top-v.bottom-Math.abs(b[1])*2];Cd(Ot[0]>0&&Ot[1]>0);var tr=Ot[0]/gt[0],Ir=Ot[1]/gt[1],Er=(v.right-v.left)/2/tr,mn=(v.bottom-v.top)/2/Ir,Ln=[(ht[0]+Je[0])/2+Er,(ht[1]+Je[1])/2+mn],Fi=ze.unproject(Ln),xa=ze.zoom+Math.log2(Math.abs(Math.min(tr,Ir)));return{longitude:Fi[0],latitude:Fi[1],zoom:Math.min(xa,l)}}var T2=function(e){(0,Le.Z)(r,e);function r(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.width,o=n.height,s=n.latitude,l=s===void 0?0:s,f=n.longitude,v=f===void 0?0:f,y=n.zoom,b=y===void 0?0:y,T=n.pitch,M=T===void 0?0:T,O=n.bearing,F=O===void 0?0:O,$=n.altitude,G=$===void 0?1.5:$,ue=n.nearZMultiplier,xe=n.farZMultiplier;(0,Q.Z)(this,r),i=i||1,o=o||1;var ze=b2(b);G=Math.max(.75,G);var Je=_0([v,l],ze);Je[2]=0;var ht=GF({width:i,height:o,pitch:M,bearing:F,altitude:G,nearZMultiplier:ue||1/o,farZMultiplier:xe||1.01}),gt=HF({height:o,center:Je,pitch:M,bearing:F,altitude:G,flipY:!0});return t=(0,at.Z)(this,(0,Ee.Z)(r).call(this,{width:i,height:o,viewMatrix:gt,projectionMatrix:ht})),t.latitude=l,t.longitude=v,t.zoom=b,t.pitch=M,t.bearing=F,t.altitude=G,t.scale=ze,t.center=Je,t.pixelsPerMeter=E2((0,Fe.Z)((0,Fe.Z)(t))).pixelsPerMeter[2],Object.freeze((0,Fe.Z)((0,Fe.Z)(t))),t}return(0,j.Z)(r,[{key:"projectFlat",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return _0(n,i)}},{key:"unprojectFlat",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return N_(n,i)}},{key:"getMapCenterByLngLatPosition",value:function(n){var i=n.lngLat,o=n.pos,s=S2(o,this.pixelUnprojectionMatrix),l=_0(i,this.scale),f=Or.IH([],l,Or.tk([],s)),v=Or.IH([],this.center,f);return N_(v,this.scale)}},{key:"getLocationAtPoint",value:function(n){var i=n.lngLat,o=n.pos;return this.getMapCenterByLngLatPosition({lngLat:i,pos:o})}},{key:"fitBounds",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.width,s=this.height,l=YF(Object.assign({width:o,height:s,bounds:n},i)),f=l.longitude,v=l.latitude,y=l.zoom;return new r({width:o,height:s,longitude:f,latitude:v,zoom:y})}}]),r}($F),qF=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"syncWithMapCamera",value:function(t){var n=t.center,i=t.zoom,o=t.pitch,s=t.bearing,l=t.viewportHeight,f=t.viewportWidth;this.viewport=new T2({width:f,height:l,longitude:n&&n[0],latitude:n&&n[1],zoom:i,pitch:o,bearing:s})}},{key:"getZoom",value:function(){return this.viewport.zoom}},{key:"getZoomScale",value:function(){return Math.pow(2,this.getZoom())}},{key:"getCenter",value:function(){return[this.viewport.longitude,this.viewport.latitude]}},{key:"getProjectionMatrix",value:function(){return this.viewport.projectionMatrix}},{key:"getModelMatrix",value:function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}},{key:"getViewMatrix",value:function(){return this.viewport.viewMatrix}},{key:"getViewMatrixUncentered",value:function(){return this.viewport.viewMatrixUncentered}},{key:"getViewProjectionMatrix",value:function(){return this.viewport.viewProjectionMatrix}},{key:"getViewProjectionMatrixUncentered",value:function(){return this.viewport.viewProjectionMatrix}},{key:"getFocalDistance",value:function(){return 1}},{key:"projectFlat",value:function(t,n){return this.viewport.projectFlat(t,n)}}]),e}(),KF=["id","attributionControl","style","token","rotation","mapInstance"],w2,C2;function QF(e){var r=JF();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function JF(){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(e){return!1}}function ek(e,r){var t=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(!(t||n)&&(r||(r=document),!!r)){var i=r.head||r.getElementsByTagName("head")[0];if(!i){i=r.createElement("head");var o=r.body||r.getElementsByTagName("body")[0];o?o.parentNode.insertBefore(i,o):r.documentElement.appendChild(i)}var s=r.createElement("style");return s.type="text/css",s.styleSheet?s.styleSheet.cssText=e:s.appendChild(r.createTextNode(e)),i.appendChild(s),s}}ek(`.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:-webkit-grab;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:-webkit-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{-ms-touch-action:pinch-zoom;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{-ms-touch-action:none;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){-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){-webkit-box-shadow:0 0 0 2px ButtonText;box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;-webkit-box-sizing:border-box;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{-webkit-box-shadow:0 0 2px 2px #0096ff;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{-webkit-box-shadow:0 0 2px 2px #0096ff;box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){-webkit-box-shadow:none;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;-webkit-box-sizing:border-box;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;-webkit-box-sizing:border-box;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-box;display:-ms-flexbox;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;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{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;-ms-flex-item-align:center;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;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.1);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:-webkit-box;display:-ms-flexbox;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;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 0 3px rgba(0,0,0,.35);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=jm();var tk=0,R2="101MlGsZ2AmmA&access_token=pk.eyJ1IjoiZXhhbXBsZXMiLCJhIjoiY2p0MG01MXRqMW45cjQzb2R6b2ptc3J4MSJ9.zA2W0IkI0c6KaAhJfk9bWg",rk=(w2=(0,yt.b2)(),w2(C2=function(e){(0,Le.Z)(t,e);var r=QF(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s1&&arguments[1]!==void 0?arguments[1]:{x:0,y:0,z:0},s=this.lngLatToMercator(i,0),l=s.x,f=s.y;return[l-o.x,f-o.y]}},{key:"lngLatToMercator",value:function(i,o){var s=window.mapboxgl.MercatorCoordinate.fromLngLat(i,o),l=s.x,f=l===void 0?0:l,v=s.y,y=v===void 0?0:v,b=s.z,T=b===void 0?0:b;return{x:f,y,z:T}}},{key:"getModelMatrix",value:function(i,o,s){var l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[1,1,1],f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{x:0,y:0,z:0},v=window.mapboxgl.MercatorCoordinate.fromLngLat(i,o),y=v.meterInMercatorCoordinateUnits(),b=me.create();return me.translate(b,b,La.fromValues(v.x-f.x,v.y-f.y,v.z||0-f.z)),me.scale(b,b,La.fromValues(y*l[0],-y*l[1],y*l[2])),me.rotateX(b,b,s[0]),me.rotateY(b,b,s[1]),me.rotateZ(b,b,s[2]),b}},{key:"init",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s=this,l,f,v,y,b,T,M,O,F,$,G,ue,xe;return ge().wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:l=this.config,f=l.id,v=f===void 0?"map":f,y=l.attributionControl,b=y===void 0?!1:y,T=l.style,M=T===void 0?"light":T,O=l.token,F=O===void 0?R2:O,$=l.rotation,G=$===void 0?0:$,ue=l.mapInstance,xe=(0,ka.Z)(l,KF),this.viewport=new qF,!ue&&!window.mapboxgl&&console.error(this.configService.getSceneWarninfo("SDK")),F===R2&&M!=="blank"&&!window.mapboxgl.accessToken&&!ue&&console.warn(this.configService.getSceneWarninfo("MapToken")),!ue&&!window.mapboxgl.accessToken&&(window.mapboxgl.accessToken=F),ue?(this.map=ue,this.$mapContainer=this.map.getContainer()):(this.$mapContainer=this.creatMapContainer(v),this.map=new window.mapboxgl.Map((0,V.Z)({container:this.$mapContainer,style:this.getMapStyleValue(M),attributionControl:b,bearing:G},xe))),this.map.on("load",function(){s.handleCameraChanged()}),this.map.on("move",this.handleCameraChanged),this.handleCameraChanged();case 9:case"end":return Je.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"destroy",value:function(){var i;(i=this.$mapContainer)===null||i===void 0||(i=i.parentNode)===null||i===void 0||i.removeChild(this.$mapContainer),this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}},{key:"emit",value:function(i){for(var o,s=arguments.length,l=new Array(s>1?s-1:0),f=1;f1?s-1:0),f=1;fe.length)&&(r=e.length);for(var t=0,n=new Array(r);te.length)&&(r=e.length);for(var t=0,n=new Array(r);te.length)&&(r=e.length);for(var t=0,n=new Array(r);te.length)&&(r=e.length);for(var t=0,n=new Array(r);te.length)&&(r=e.length);for(var t=0,n=new Array(r);t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function Wk(e,r){if(e==null)return{};var t={},n=Object.keys(e),i,o;for(o=0;o=0)&&(t[i]=e[i]);return t}var d6={exportImage:VT,fullscreen:XT,geoLocate:qT,layer:e1,layerSwitch:e1,logo:t1,mapTheme:aw,mouseLocation:uw,zoom:dw,scale:fw},v6=null,z2=L(50374);function Z2(e,r){return Yk(e)||$k(e,r)||Xk(e,r)||Gk()}function Gk(){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 Xk(e,r){if(e){if(typeof e=="string")return V2(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return V2(e,r)}}function V2(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function uB(e,r){if(e==null)return{};var t={},n=Object.keys(e),i,o;for(o=0;o=0)&&(t[i]=e[i]);return t}var lB=q.memo(function(r){var t=r.layer,n=r.source,i=n.data,o=sB(n,oB);return t.inited?t.setData(i,o):t.source(i,o),o.autoFit&&t.fitBounds(o&&o.fitBoundsOptions),null},ys()),_6=q.useEffect,cB=q.memo(function(r){var t=r.layer,n=r.style;return t.style(n),null},ys());function fB(e,r){return vB(e)||dB(e,r)||pB(e,r)||hB()}function hB(){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 pB(e,r){if(e){if(typeof e=="string")return G2(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return G2(e,r)}}function G2(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t=Math.abs(ae)?le-et+ae:ae-et+le,le=et}le+U>=0!=!!_&&he.reverse()}},56834:function(rr){"use strict";rr.exports=ee;function ee(L,q){this.x=L,this.y=q}ee.prototype={clone:function(){return new ee(this.x,this.y)},add:function(L){return this.clone()._add(L)},sub:function(L){return this.clone()._sub(L)},multByPoint:function(L){return this.clone()._multByPoint(L)},divByPoint:function(L){return this.clone()._divByPoint(L)},mult:function(L){return this.clone()._mult(L)},div:function(L){return this.clone()._div(L)},rotate:function(L){return this.clone()._rotate(L)},rotateAround:function(L,q){return this.clone()._rotateAround(L,q)},matMult:function(L){return this.clone()._matMult(L)},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(L){return this.x===L.x&&this.y===L.y},dist:function(L){return Math.sqrt(this.distSqr(L))},distSqr:function(L){var q=L.x-this.x,he=L.y-this.y;return q*q+he*he},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(L){return Math.atan2(this.y-L.y,this.x-L.x)},angleWith:function(L){return this.angleWithSep(L.x,L.y)},angleWithSep:function(L,q){return Math.atan2(this.x*q-this.y*L,this.x*L+this.y*q)},_matMult:function(L){var q=L[0]*this.x+L[1]*this.y,he=L[2]*this.x+L[3]*this.y;return this.x=q,this.y=he,this},_add:function(L){return this.x+=L.x,this.y+=L.y,this},_sub:function(L){return this.x-=L.x,this.y-=L.y,this},_mult:function(L){return this.x*=L,this.y*=L,this},_div:function(L){return this.x/=L,this.y/=L,this},_multByPoint:function(L){return this.x*=L.x,this.y*=L.y,this},_divByPoint:function(L){return this.x/=L.x,this.y/=L.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var L=this.y;return this.y=this.x,this.x=-L,this},_rotate:function(L){var q=Math.cos(L),he=Math.sin(L),_=q*this.x-he*this.y,le=he*this.x+q*this.y;return this.x=_,this.y=le,this},_rotateAround:function(L,q){var he=Math.cos(L),_=Math.sin(L),le=q.x+he*(this.x-q.x)-_*(this.y-q.y),U=q.y+_*(this.x-q.x)+he*(this.y-q.y);return this.x=le,this.y=U,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ee.convert=function(L){return L instanceof ee?L:Array.isArray(L)?new ee(L[0],L[1]):L}},45188:function(rr){"use strict";rr.exports=L,rr.exports.default=L;var ee=1e20;function L(U,fe,se,Qe,ae,et){this.fontSize=U||24,this.buffer=fe===void 0?3:fe,this.cutoff=Qe||.25,this.fontFamily=ae||"sans-serif",this.fontWeight=et||"normal",this.radius=se||8;var dt=this.size=this.fontSize+this.buffer*2,Ye=dt+this.buffer*2;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=dt,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(Ye*Ye),this.gridInner=new Float64Array(Ye*Ye),this.f=new Float64Array(Ye),this.z=new Float64Array(Ye+1),this.v=new Uint16Array(Ye),this.useMetrics=this.ctx.measureText("A").actualBoundingBoxLeft!==void 0,this.middle=Math.round(dt/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function q(U,fe,se,Qe,ae,et,dt){et.fill(ee,0,fe*se),dt.fill(0,0,fe*se);for(var Ye=(fe-Qe)/2,wt=0;wt-1);wt++,et[wt]=Ye,dt[wt]=Xt,dt[wt+1]=ee}for(Ye=0,wt=0;Ye>3}if(et--,ae===1||ae===2)dt+=se.readSVarint(),Ye+=se.readSVarint(),ae===1&&(Xt&&wt.push(Xt),Xt=[]),Xt.push(new q(dt,Ye));else if(ae===7)Xt&&Xt.push(Xt[0].clone());else throw new Error("unknown command "+ae)}return Xt&&wt.push(Xt),wt},he.prototype.bbox=function(){var se=this._pbf;se.pos=this._geometry;for(var Qe=se.readVarint()+se.pos,ae=1,et=0,dt=0,Ye=0,wt=1/0,Xt=-1/0,Zt=1/0,nr=-1/0;se.pos>3}if(et--,ae===1||ae===2)dt+=se.readSVarint(),Ye+=se.readSVarint(),dtXt&&(Xt=dt),Yenr&&(nr=Ye);else if(ae!==7)throw new Error("unknown command "+ae)}return[wt,Zt,Xt,nr]},he.prototype.toGeoJSON=function(se,Qe,ae){var et=this.extent*Math.pow(2,ae),dt=this.extent*se,Ye=this.extent*Qe,wt=this.loadGeometry(),Xt=he.types[this.type],Zt,nr;function Vt(Tr){for(var hr=0;hr>3;fe=Qe===1?U.readString():Qe===2?U.readFloat():Qe===3?U.readDouble():Qe===4?U.readVarint64():Qe===5?U.readVarint():Qe===6?U.readSVarint():Qe===7?U.readBoolean():null}return fe}he.prototype.feature=function(U){if(U<0||U>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[U];var fe=this._pbf.readVarint()+this._pbf.pos;return new q(this._pbf,fe,this.extent,this._keys,this._values)}},18283:function(rr,ee,L){"use strict";L.d(ee,{Z:function(){return nt}});var q=L(79685),he=L(68591),_=L.n(he),le=L(3139),U=L(99248),fe=L(73064),se=L(57196),Qe=L(55095),ae=function(te,Ce){var we={};for(var Xe in te)Object.prototype.hasOwnProperty.call(te,Xe)&&Ce.indexOf(Xe)<0&&(we[Xe]=te[Xe]);if(te!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Lt=0,Xe=Object.getOwnPropertySymbols(te);Lt{var{prefixCls:Ce,className:we,hoverable:Xe=!0}=te,Lt=ae(te,["prefixCls","className","hoverable"]);const{getPrefixCls:Ht}=q.useContext(U.E_),on=Ht("card",Ce),Jr=_()(`${on}-grid`,we,{[`${on}-grid-hoverable`]:Xe});return q.createElement("div",Object.assign({},Lt,{className:Jr}))},Ye=L(26477),wt=L(4614),Xt=L(44244),Zt=L(25830);const nr=te=>{const{antCls:Ce,componentCls:we,headerHeight:Xe,cardPaddingBase:Lt,tabsMarginBottom:Ht}=te;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:Xe,marginBottom:-1,padding:`0 ${(0,Ye.bf)(Lt)}`,color:te.colorTextHeading,fontWeight:te.fontWeightStrong,fontSize:te.headerFontSize,background:te.headerBg,borderBottom:`${(0,Ye.bf)(te.lineWidth)} ${te.lineType} ${te.colorBorderSecondary}`,borderRadius:`${(0,Ye.bf)(te.borderRadiusLG)} ${(0,Ye.bf)(te.borderRadiusLG)} 0 0`},(0,wt.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},wt.vS),{[` > ${we}-typography, > ${we}-typography-edit-content `]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${Ce}-tabs-top`]:{clear:"both",marginBottom:Ht,color:te.colorText,fontWeight:"normal",fontSize:te.fontSize,"&-bar":{borderBottom:`${(0,Ye.bf)(te.lineWidth)} ${te.lineType} ${te.colorBorderSecondary}`}}})},Vt=te=>{const{cardPaddingBase:Ce,colorBorderSecondary:we,cardShadow:Xe,lineWidth:Lt}=te;return{width:"33.33%",padding:Ce,border:0,borderRadius:0,boxShadow:` ${(0,Ye.bf)(Lt)} 0 0 0 ${we}, 0 ${(0,Ye.bf)(Lt)} 0 0 ${we}, ${(0,Ye.bf)(Lt)} ${(0,Ye.bf)(Lt)} 0 0 ${we}, ${(0,Ye.bf)(Lt)} 0 0 0 ${we} inset, 0 ${(0,Ye.bf)(Lt)} 0 0 ${we} inset; `,transition:`all ${te.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:Xe}}},xt=te=>{const{componentCls:Ce,iconCls:we,actionsLiMargin:Xe,cardActionsIconSize:Lt,colorBorderSecondary:Ht,actionsBg:on}=te;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:on,borderTop:`${(0,Ye.bf)(te.lineWidth)} ${te.lineType} ${Ht}`,display:"flex",borderRadius:`0 0 ${(0,Ye.bf)(te.borderRadiusLG)} ${(0,Ye.bf)(te.borderRadiusLG)}`},(0,wt.dF)()),{"& > li":{margin:Xe,color:te.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:te.calc(te.cardActionsIconSize).mul(2).equal(),fontSize:te.fontSize,lineHeight:te.lineHeight,cursor:"pointer","&:hover":{color:te.colorPrimary,transition:`color ${te.motionDurationMid}`},[`a:not(${Ce}-btn), > ${we}`]:{display:"inline-block",width:"100%",color:te.colorTextDescription,lineHeight:(0,Ye.bf)(te.fontHeight),transition:`color ${te.motionDurationMid}`,"&:hover":{color:te.colorPrimary}},[`> ${we}`]:{fontSize:Lt,lineHeight:(0,Ye.bf)(te.calc(Lt).mul(te.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${(0,Ye.bf)(te.lineWidth)} ${te.lineType} ${Ht}`}}})},bt=te=>Object.assign(Object.assign({margin:`${(0,Ye.bf)(te.calc(te.marginXXS).mul(-1).equal())} 0`,display:"flex"},(0,wt.dF)()),{"&-avatar":{paddingInlineEnd:te.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:te.marginXS}},"&-title":Object.assign({color:te.colorTextHeading,fontWeight:te.fontWeightStrong,fontSize:te.fontSizeLG},wt.vS),"&-description":{color:te.colorTextDescription}}),Tr=te=>{const{componentCls:Ce,cardPaddingBase:we,colorFillAlter:Xe}=te;return{[`${Ce}-head`]:{padding:`0 ${(0,Ye.bf)(we)}`,background:Xe,"&-title":{fontSize:te.fontSize}},[`${Ce}-body`]:{padding:`${(0,Ye.bf)(te.padding)} ${(0,Ye.bf)(we)}`}}},hr=te=>{const{componentCls:Ce}=te;return{overflow:"hidden",[`${Ce}-body`]:{userSelect:"none"}}},lr=te=>{const{antCls:Ce,componentCls:we,cardShadow:Xe,cardHeadPadding:Lt,colorBorderSecondary:Ht,boxShadowTertiary:on,cardPaddingBase:Jr,extraColor:Hr}=te;return{[we]:Object.assign(Object.assign({},(0,wt.Wf)(te)),{position:"relative",background:te.colorBgContainer,borderRadius:te.borderRadiusLG,[`&:not(${we}-bordered)`]:{boxShadow:on},[`${we}-head`]:nr(te),[`${we}-extra`]:{marginInlineStart:"auto",color:Hr,fontWeight:"normal",fontSize:te.fontSize},[`${we}-body`]:Object.assign({padding:Jr,borderRadius:` 0 0 ${(0,Ye.bf)(te.borderRadiusLG)} ${(0,Ye.bf)(te.borderRadiusLG)}`},(0,wt.dF)()),[`${we}-grid`]:Vt(te),[`${we}-cover`]:{"> *":{display:"block",width:"100%"},[`img, img + ${Ce}-image-mask`]:{borderRadius:`${(0,Ye.bf)(te.borderRadiusLG)} ${(0,Ye.bf)(te.borderRadiusLG)} 0 0`}},[`${we}-actions`]:xt(te),[`${we}-meta`]:bt(te)}),[`${we}-bordered`]:{border:`${(0,Ye.bf)(te.lineWidth)} ${te.lineType} ${Ht}`,[`${we}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${we}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${te.motionDurationMid}, border-color ${te.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:Xe}},[`${we}-contain-grid`]:{borderRadius:`${(0,Ye.bf)(te.borderRadiusLG)} ${(0,Ye.bf)(te.borderRadiusLG)} 0 0 `,[`${we}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${we}-loading) ${we}-body`]:{marginBlockStart:te.calc(te.lineWidth).mul(-1).equal(),marginInlineStart:te.calc(te.lineWidth).mul(-1).equal(),padding:0}},[`${we}-contain-tabs`]:{[`> ${we}-head`]:{minHeight:0,[`${we}-head-title, ${we}-extra`]:{paddingTop:Lt}}},[`${we}-type-inner`]:Tr(te),[`${we}-loading`]:hr(te),[`${we}-rtl`]:{direction:"rtl"}}},At=te=>{const{componentCls:Ce,cardPaddingSM:we,headerHeightSM:Xe,headerFontSizeSM:Lt}=te;return{[`${Ce}-small`]:{[`> ${Ce}-head`]:{minHeight:Xe,padding:`0 ${(0,Ye.bf)(we)}`,fontSize:Lt,[`> ${Ce}-head-wrapper`]:{[`> ${Ce}-extra`]:{fontSize:te.fontSize}}},[`> ${Ce}-body`]:{padding:we}},[`${Ce}-small${Ce}-contain-tabs`]:{[`> ${Ce}-head`]:{[`${Ce}-head-title, ${Ce}-extra`]:{paddingTop:0,display:"flex",alignItems:"center"}}}}},ut=te=>({headerBg:"transparent",headerFontSize:te.fontSizeLG,headerFontSizeSM:te.fontSize,headerHeight:te.fontSizeLG*te.lineHeightLG+te.padding*2,headerHeightSM:te.fontSize*te.lineHeight+te.paddingXS*2,actionsBg:te.colorBgContainer,actionsLiMargin:`${te.paddingSM}px 0`,tabsMarginBottom:-te.padding-te.lineWidth,extraColor:te.colorText});var It=(0,Xt.I$)("Card",te=>{const Ce=(0,Zt.TS)(te,{cardShadow:te.boxShadowCard,cardHeadPadding:te.padding,cardPaddingBase:te.paddingLG,cardActionsIconSize:te.fontSize,cardPaddingSM:12});return[lr(Ce),At(Ce)]},ut),qe=function(te,Ce){var we={};for(var Xe in te)Object.prototype.hasOwnProperty.call(te,Xe)&&Ce.indexOf(Xe)<0&&(we[Xe]=te[Xe]);if(te!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Lt=0,Xe=Object.getOwnPropertySymbols(te);Lt{const{prefixCls:Ce,actions:we=[]}=te;return q.createElement("ul",{className:`${Ce}-actions`},we.map((Xe,Lt)=>{const Ht=`action-${Lt}`;return q.createElement("li",{style:{width:`${100/we.length}%`},key:Ht},q.createElement("span",null,Xe))}))};var re=q.forwardRef((te,Ce)=>{const{prefixCls:we,className:Xe,rootClassName:Lt,style:Ht,extra:on,headStyle:Jr={},bodyStyle:Hr={},title:Un,loading:bn,bordered:Kr=!0,size:Mi,type:Si,cover:Ri,actions:Gn,tabList:Dn,children:Ya,activeTabKey:Yi,defaultActiveTabKey:Na,tabBarExtraContent:Dt,hoverable:k,tabProps:ie={}}=te,ve=qe(te,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps"]),{getPrefixCls:Ze,direction:_t,card:Wt}=q.useContext(U.E_),Sr=J=>{var oe;(oe=te.onTabChange)===null||oe===void 0||oe.call(te,J)},He=q.useMemo(()=>{let J=!1;return q.Children.forEach(Ya,oe=>{oe&&oe.type&&oe.type===dt&&(J=!0)}),J},[Ya]),Et=Ze("card",we),[cr,mr]=It(Et),Zr=q.createElement(se.Z,{loading:!0,active:!0,paragraph:{rows:4},title:!1},Ya),Fn=Yi!==void 0,En=Object.assign(Object.assign({},ie),{[Fn?"activeKey":"defaultActiveKey"]:Fn?Yi:Na,tabBarExtraContent:Dt});let Cn;const fn=(0,fe.Z)(Mi),ni=!fn||fn==="default"?"large":fn,Yn=Dn?q.createElement(Qe.Z,Object.assign({size:ni},En,{className:`${Et}-head-tabs`,onChange:Sr,items:Dn.map(J=>{var{tab:oe}=J,be=qe(J,["tab"]);return Object.assign({label:oe},be)})})):null;(Un||on||Yn)&&(Cn=q.createElement("div",{className:`${Et}-head`,style:Jr},q.createElement("div",{className:`${Et}-head-wrapper`},Un&&q.createElement("div",{className:`${Et}-head-title`},Un),on&&q.createElement("div",{className:`${Et}-extra`},on)),Yn));const oa=Ri?q.createElement("div",{className:`${Et}-cover`},Ri):null,Qi=q.createElement("div",{className:`${Et}-body`,style:Hr},bn?Zr:Ya),lo=Gn&&Gn.length?q.createElement(Ct,{prefixCls:Et,actions:Gn}):null,Is=(0,le.Z)(ve,["onTabChange"]),hi=_()(Et,Wt==null?void 0:Wt.className,{[`${Et}-loading`]:bn,[`${Et}-bordered`]:Kr,[`${Et}-hoverable`]:k,[`${Et}-contain-grid`]:He,[`${Et}-contain-tabs`]:Dn&&Dn.length,[`${Et}-${fn}`]:fn,[`${Et}-type-${Si}`]:!!Si,[`${Et}-rtl`]:_t==="rtl"},Xe,Lt,mr),W=Object.assign(Object.assign({},Wt==null?void 0:Wt.style),Ht);return cr(q.createElement("div",Object.assign({ref:Ce},Is,{className:hi,style:W}),Cn,oa,Qi,lo))}),V=function(te,Ce){var we={};for(var Xe in te)Object.prototype.hasOwnProperty.call(te,Xe)&&Ce.indexOf(Xe)<0&&(we[Xe]=te[Xe]);if(te!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Lt=0,Xe=Object.getOwnPropertySymbols(te);Lt{const{prefixCls:Ce,className:we,avatar:Xe,title:Lt,description:Ht}=te,on=V(te,["prefixCls","className","avatar","title","description"]),{getPrefixCls:Jr}=q.useContext(U.E_),Hr=Jr("card",Ce),Un=_()(`${Hr}-meta`,we),bn=Xe?q.createElement("div",{className:`${Hr}-meta-avatar`},Xe):null,Kr=Lt?q.createElement("div",{className:`${Hr}-meta-title`},Lt):null,Mi=Ht?q.createElement("div",{className:`${Hr}-meta-description`},Ht):null,Si=Kr||Mi?q.createElement("div",{className:`${Hr}-meta-detail`},Kr,Mi):null;return q.createElement("div",Object.assign({},on,{className:Un}),bn,Si)};const Se=re;Se.Grid=dt,Se.Meta=Me;var nt=Se},45161:function(rr,ee,L){"use strict";L.d(ee,{Z:function(){return It}});var q=L(79685),he=L(28120),_=L(23196),le=L(68591),U=L.n(le),fe=L(99248),se=L(57196),ae=qe=>{const{value:Ct,formatter:fr,precision:re,decimalSeparator:V,groupSeparator:K="",prefixCls:Me}=qe;let Se;if(typeof fr=="function")Se=fr(Ct);else{const nt=String(Ct),te=nt.match(/^(-?)(\d*)(\.(\d+))?$/);if(!te||nt==="-")Se=nt;else{const Ce=te[1];let we=te[2]||"0",Xe=te[4]||"";we=we.replace(/\B(?=(\d{3})+(?!\d))/g,K),typeof re=="number"&&(Xe=Xe.padEnd(re,"0").slice(0,re>0?re:0)),Xe&&(Xe=`${V}${Xe}`),Se=[q.createElement("span",{key:"int",className:`${Me}-content-value-int`},Ce,we),Xe&&q.createElement("span",{key:"decimal",className:`${Me}-content-value-decimal`},Xe)]}}return q.createElement("span",{className:`${Me}-content-value`},Se)},et=L(4614),dt=L(44244),Ye=L(25830);const wt=qe=>{const{componentCls:Ct,marginXXS:fr,padding:re,colorTextDescription:V,titleFontSize:K,colorTextHeading:Me,contentFontSize:Se,fontFamily:nt}=qe;return{[`${Ct}`]:Object.assign(Object.assign({},(0,et.Wf)(qe)),{[`${Ct}-title`]:{marginBottom:fr,color:V,fontSize:K},[`${Ct}-skeleton`]:{paddingTop:re},[`${Ct}-content`]:{color:Me,fontSize:Se,fontFamily:nt,[`${Ct}-content-value`]:{display:"inline-block",direction:"ltr"},[`${Ct}-content-prefix, ${Ct}-content-suffix`]:{display:"inline-block"},[`${Ct}-content-prefix`]:{marginInlineEnd:fr},[`${Ct}-content-suffix`]:{marginInlineStart:fr}}})}},Xt=qe=>{const{fontSizeHeading3:Ct,fontSize:fr}=qe;return{titleFontSize:fr,contentFontSize:Ct}};var Zt=(0,dt.I$)("Statistic",qe=>{const Ct=(0,Ye.TS)(qe,{});return[wt(Ct)]},Xt),Vt=qe=>{const{prefixCls:Ct,className:fr,rootClassName:re,style:V,valueStyle:K,value:Me=0,title:Se,valueRender:nt,prefix:te,suffix:Ce,loading:we=!1,onMouseEnter:Xe,onMouseLeave:Lt,decimalSeparator:Ht=".",groupSeparator:on=","}=qe,{getPrefixCls:Jr,direction:Hr,statistic:Un}=q.useContext(fe.E_),bn=Jr("statistic",Ct),[Kr,Mi]=Zt(bn),Si=q.createElement(ae,Object.assign({decimalSeparator:Ht,groupSeparator:on,prefixCls:bn},qe,{value:Me})),Ri=U()(bn,{[`${bn}-rtl`]:Hr==="rtl"},Un==null?void 0:Un.className,fr,re,Mi);return Kr(q.createElement("div",{className:Ri,style:Object.assign(Object.assign({},Un==null?void 0:Un.style),V),onMouseEnter:Xe,onMouseLeave:Lt},Se&&q.createElement("div",{className:`${bn}-title`},Se),q.createElement(se.Z,{paragraph:!1,loading:we,className:`${bn}-skeleton`},q.createElement("div",{style:K,className:`${bn}-content`},te&&q.createElement("span",{className:`${bn}-content-prefix`},te),nt?nt(Si):Si,Ce&&q.createElement("span",{className:`${bn}-content-suffix`},Ce)))))};const xt=[["Y",1e3*60*60*24*365],["M",1e3*60*60*24*30],["D",1e3*60*60*24],["H",1e3*60*60],["m",1e3*60],["s",1e3],["S",1]];function bt(qe,Ct){let fr=qe;const re=/\[[^\]]*]/g,V=(Ct.match(re)||[]).map(nt=>nt.slice(1,-1)),K=Ct.replace(re,"[]"),Me=xt.reduce((nt,te)=>{let[Ce,we]=te;if(nt.includes(Ce)){const Xe=Math.floor(fr/we);return fr-=Xe*we,nt.replace(new RegExp(`${Ce}+`,"g"),Lt=>{const Ht=Lt.length;return Xe.toString().padStart(Ht,"0")})}return nt},K);let Se=0;return Me.replace(re,()=>{const nt=V[Se];return Se+=1,nt})}function Tr(qe,Ct){const{format:fr=""}=Ct,re=new Date(qe).getTime(),V=Date.now(),K=Math.max(re-V,0);return bt(K,fr)}const hr=1e3/30;function lr(qe){return new Date(qe).getTime()}const At=qe=>{const{value:Ct,format:fr="HH:mm:ss",onChange:re,onFinish:V}=qe,K=(0,he.Z)(),Me=q.useRef(null),Se=()=>{V==null||V(),Me.current&&(clearInterval(Me.current),Me.current=null)},nt=()=>{const we=lr(Ct);we>=Date.now()&&(Me.current=setInterval(()=>{K(),re==null||re(we-Date.now()),we(nt(),()=>{Me.current&&(clearInterval(Me.current),Me.current=null)}),[Ct]);const te=(we,Xe)=>Tr(we,Object.assign(Object.assign({},Xe),{format:fr})),Ce=we=>(0,_.Tm)(we,{title:void 0});return q.createElement(Vt,Object.assign({},qe,{valueRender:Ce,formatter:te}))};var ut=q.memo(At);Vt.Countdown=ut;var It=Vt},89675:function(rr){"use strict";rr.exports=ee,rr.exports.default=ee;function ee(K,Me,Se){Se=Se||2;var nt=Me&&Me.length,te=nt?Me[0]*Se:K.length,Ce=L(K,0,te,Se,!0),we=[];if(!Ce||Ce.next===Ce.prev)return we;var Xe,Lt,Ht,on,Jr,Hr,Un;if(nt&&(Ce=se(K,Me,Ce,Se)),K.length>80*Se){Xe=Ht=K[0],Lt=on=K[1];for(var bn=Se;bnHt&&(Ht=Jr),Hr>on&&(on=Hr);Un=Math.max(Ht-Xe,on-Lt),Un=Un!==0?32767/Un:0}return he(Ce,we,Se,Xe,Lt,Un,0),we}function L(K,Me,Se,nt,te){var Ce,we;if(te===V(K,Me,Se,nt)>0)for(Ce=Me;Ce=Me;Ce-=nt)we=Ct(Ce,K[Ce],K[Ce+1],we);return we&&bt(we,we.next)&&(fr(we),we=we.next),we}function q(K,Me){if(!K)return K;Me||(Me=K);var Se=K,nt;do if(nt=!1,!Se.steiner&&(bt(Se,Se.next)||xt(Se.prev,Se,Se.next)===0)){if(fr(Se),Se=Me=Se.prev,Se===Se.next)break;nt=!0}else Se=Se.next;while(nt||Se!==Me);return Me}function he(K,Me,Se,nt,te,Ce,we){if(K){!we&&Ce&&Ye(K,nt,te,Ce);for(var Xe=K,Lt,Ht;K.prev!==K.next;){if(Lt=K.prev,Ht=K.next,Ce?le(K,nt,te,Ce):_(K)){Me.push(Lt.i/Se|0),Me.push(K.i/Se|0),Me.push(Ht.i/Se|0),fr(K),K=Ht.next,Xe=Ht.next;continue}if(K=Ht,K===Xe){we?we===1?(K=U(q(K),Me,Se),he(K,Me,Se,nt,te,Ce,2)):we===2&&fe(K,Me,Se,nt,te,Ce):he(q(K),Me,Se,nt,te,Ce,1);break}}}}function _(K){var Me=K.prev,Se=K,nt=K.next;if(xt(Me,Se,nt)>=0)return!1;for(var te=Me.x,Ce=Se.x,we=nt.x,Xe=Me.y,Lt=Se.y,Ht=nt.y,on=teCe?te>we?te:we:Ce>we?Ce:we,Un=Xe>Lt?Xe>Ht?Xe:Ht:Lt>Ht?Lt:Ht,bn=nt.next;bn!==Me;){if(bn.x>=on&&bn.x<=Hr&&bn.y>=Jr&&bn.y<=Un&&nr(te,Xe,Ce,Lt,we,Ht,bn.x,bn.y)&&xt(bn.prev,bn,bn.next)>=0)return!1;bn=bn.next}return!0}function le(K,Me,Se,nt){var te=K.prev,Ce=K,we=K.next;if(xt(te,Ce,we)>=0)return!1;for(var Xe=te.x,Lt=Ce.x,Ht=we.x,on=te.y,Jr=Ce.y,Hr=we.y,Un=XeLt?Xe>Ht?Xe:Ht:Lt>Ht?Lt:Ht,Mi=on>Jr?on>Hr?on:Hr:Jr>Hr?Jr:Hr,Si=Xt(Un,bn,Me,Se,nt),Ri=Xt(Kr,Mi,Me,Se,nt),Gn=K.prevZ,Dn=K.nextZ;Gn&&Gn.z>=Si&&Dn&&Dn.z<=Ri;){if(Gn.x>=Un&&Gn.x<=Kr&&Gn.y>=bn&&Gn.y<=Mi&&Gn!==te&&Gn!==we&&nr(Xe,on,Lt,Jr,Ht,Hr,Gn.x,Gn.y)&&xt(Gn.prev,Gn,Gn.next)>=0||(Gn=Gn.prevZ,Dn.x>=Un&&Dn.x<=Kr&&Dn.y>=bn&&Dn.y<=Mi&&Dn!==te&&Dn!==we&&nr(Xe,on,Lt,Jr,Ht,Hr,Dn.x,Dn.y)&&xt(Dn.prev,Dn,Dn.next)>=0))return!1;Dn=Dn.nextZ}for(;Gn&&Gn.z>=Si;){if(Gn.x>=Un&&Gn.x<=Kr&&Gn.y>=bn&&Gn.y<=Mi&&Gn!==te&&Gn!==we&&nr(Xe,on,Lt,Jr,Ht,Hr,Gn.x,Gn.y)&&xt(Gn.prev,Gn,Gn.next)>=0)return!1;Gn=Gn.prevZ}for(;Dn&&Dn.z<=Ri;){if(Dn.x>=Un&&Dn.x<=Kr&&Dn.y>=bn&&Dn.y<=Mi&&Dn!==te&&Dn!==we&&nr(Xe,on,Lt,Jr,Ht,Hr,Dn.x,Dn.y)&&xt(Dn.prev,Dn,Dn.next)>=0)return!1;Dn=Dn.nextZ}return!0}function U(K,Me,Se){var nt=K;do{var te=nt.prev,Ce=nt.next.next;!bt(te,Ce)&&Tr(te,nt,nt.next,Ce)&&ut(te,Ce)&&ut(Ce,te)&&(Me.push(te.i/Se|0),Me.push(nt.i/Se|0),Me.push(Ce.i/Se|0),fr(nt),fr(nt.next),nt=K=Ce),nt=nt.next}while(nt!==K);return q(nt)}function fe(K,Me,Se,nt,te,Ce){var we=K;do{for(var Xe=we.next.next;Xe!==we.prev;){if(we.i!==Xe.i&&Vt(we,Xe)){var Lt=qe(we,Xe);we=q(we,we.next),Lt=q(Lt,Lt.next),he(we,Me,Se,nt,te,Ce,0),he(Lt,Me,Se,nt,te,Ce,0);return}Xe=Xe.next}we=we.next}while(we!==K)}function se(K,Me,Se,nt){var te=[],Ce,we,Xe,Lt,Ht;for(Ce=0,we=Me.length;Ce=Se.next.y&&Se.next.y!==Se.y){var Xe=Se.x+(te-Se.y)*(Se.next.x-Se.x)/(Se.next.y-Se.y);if(Xe<=nt&&Xe>Ce&&(Ce=Xe,we=Se.x=Se.x&&Se.x>=Ht&&nt!==Se.x&&nr(tewe.x||Se.x===we.x&&dt(we,Se)))&&(we=Se,Jr=Hr)),Se=Se.next;while(Se!==Lt);return we}function dt(K,Me){return xt(K.prev,K,Me.prev)<0&&xt(Me.next,K,K.next)<0}function Ye(K,Me,Se,nt){var te=K;do te.z===0&&(te.z=Xt(te.x,te.y,Me,Se,nt)),te.prevZ=te.prev,te.nextZ=te.next,te=te.next;while(te!==K);te.prevZ.nextZ=null,te.prevZ=null,wt(te)}function wt(K){var Me,Se,nt,te,Ce,we,Xe,Lt,Ht=1;do{for(Se=K,K=null,Ce=null,we=0;Se;){for(we++,nt=Se,Xe=0,Me=0;Me0||Lt>0&&nt;)Xe!==0&&(Lt===0||!nt||Se.z<=nt.z)?(te=Se,Se=Se.nextZ,Xe--):(te=nt,nt=nt.nextZ,Lt--),Ce?Ce.nextZ=te:K=te,te.prevZ=Ce,Ce=te;Se=nt}Ce.nextZ=null,Ht*=2}while(we>1);return K}function Xt(K,Me,Se,nt,te){return K=(K-Se)*te|0,Me=(Me-nt)*te|0,K=(K|K<<8)&16711935,K=(K|K<<4)&252645135,K=(K|K<<2)&858993459,K=(K|K<<1)&1431655765,Me=(Me|Me<<8)&16711935,Me=(Me|Me<<4)&252645135,Me=(Me|Me<<2)&858993459,Me=(Me|Me<<1)&1431655765,K|Me<<1}function Zt(K){var Me=K,Se=K;do(Me.x=(K-we)*(Ce-Xe)&&(K-we)*(nt-Xe)>=(Se-we)*(Me-Xe)&&(Se-we)*(Ce-Xe)>=(te-we)*(nt-Xe)}function Vt(K,Me){return K.next.i!==Me.i&&K.prev.i!==Me.i&&!At(K,Me)&&(ut(K,Me)&&ut(Me,K)&&It(K,Me)&&(xt(K.prev,K,Me.prev)||xt(K,Me.prev,Me))||bt(K,Me)&&xt(K.prev,K,K.next)>0&&xt(Me.prev,Me,Me.next)>0)}function xt(K,Me,Se){return(Me.y-K.y)*(Se.x-Me.x)-(Me.x-K.x)*(Se.y-Me.y)}function bt(K,Me){return K.x===Me.x&&K.y===Me.y}function Tr(K,Me,Se,nt){var te=lr(xt(K,Me,Se)),Ce=lr(xt(K,Me,nt)),we=lr(xt(Se,nt,K)),Xe=lr(xt(Se,nt,Me));return!!(te!==Ce&&we!==Xe||te===0&&hr(K,Se,Me)||Ce===0&&hr(K,nt,Me)||we===0&&hr(Se,K,nt)||Xe===0&&hr(Se,Me,nt))}function hr(K,Me,Se){return Me.x<=Math.max(K.x,Se.x)&&Me.x>=Math.min(K.x,Se.x)&&Me.y<=Math.max(K.y,Se.y)&&Me.y>=Math.min(K.y,Se.y)}function lr(K){return K>0?1:K<0?-1:0}function At(K,Me){var Se=K;do{if(Se.i!==K.i&&Se.next.i!==K.i&&Se.i!==Me.i&&Se.next.i!==Me.i&&Tr(Se,Se.next,K,Me))return!0;Se=Se.next}while(Se!==K);return!1}function ut(K,Me){return xt(K.prev,K,K.next)<0?xt(K,Me,K.next)>=0&&xt(K,K.prev,Me)>=0:xt(K,Me,K.prev)<0||xt(K,K.next,Me)<0}function It(K,Me){var Se=K,nt=!1,te=(K.x+Me.x)/2,Ce=(K.y+Me.y)/2;do Se.y>Ce!=Se.next.y>Ce&&Se.next.y!==Se.y&&te<(Se.next.x-Se.x)*(Ce-Se.y)/(Se.next.y-Se.y)+Se.x&&(nt=!nt),Se=Se.next;while(Se!==K);return nt}function qe(K,Me){var Se=new re(K.i,K.x,K.y),nt=new re(Me.i,Me.x,Me.y),te=K.next,Ce=Me.prev;return K.next=Me,Me.prev=K,Se.next=te,te.prev=Se,nt.next=Se,Se.prev=nt,Ce.next=nt,nt.prev=Ce,nt}function Ct(K,Me,Se,nt){var te=new re(K,Me,Se);return nt?(te.next=nt.next,te.prev=nt,nt.next.prev=te,nt.next=te):(te.prev=te,te.next=te),te}function fr(K){K.next.prev=K.prev,K.prev.next=K.next,K.prevZ&&(K.prevZ.nextZ=K.nextZ),K.nextZ&&(K.nextZ.prevZ=K.prevZ)}function re(K,Me,Se){this.i=K,this.x=Me,this.y=Se,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}ee.deviation=function(K,Me,Se,nt){var te=Me&&Me.length,Ce=te?Me[0]*Se:K.length,we=Math.abs(V(K,0,Ce,Se));if(te)for(var Xe=0,Lt=Me.length;Xe0&&(nt+=K[te-1].length,Se.holes.push(nt))}return Se}},73827:function(rr){function ee(q){var he=q.target||q.srcElement;he.__resizeRAF__&&cancelAnimationFrame(he.__resizeRAF__),he.__resizeRAF__=requestAnimationFrame(function(){var _=he.__resizeTrigger__,le=_&&_.__resizeListeners__;le&&le.forEach(function(U){U.call(_,q)})})}var L=function(he,_){var le=this,U=le.document,fe,se=U.attachEvent;typeof navigator!="undefined"&&(fe=navigator.userAgent.match(/Trident/)||navigator.userAgent.match(/Edge/));function Qe(){this.contentDocument.defaultView.__resizeTrigger__=this.__resizeElement__,this.contentDocument.defaultView.addEventListener("resize",ee)}if(!he.__resizeListeners__)if(he.__resizeListeners__=[],se)he.__resizeTrigger__=he,he.attachEvent("onresize",ee);else{getComputedStyle(he).position==="static"&&(he.style.position="relative");var ae=he.__resizeTrigger__=U.createElement("object");ae.setAttribute("style","position: absolute; top: 0; left: 0; height: 100%; width: 100%; pointer-events: none; z-index: -1; opacity: 0;"),ae.setAttribute("class","resize-sensor"),ae.setAttribute("tabindex","-1"),ae.setAttribute("title",""),ae.__resizeElement__=he,ae.onload=Qe,ae.type="text/html",fe&&he.appendChild(ae),ae.data="about:blank",fe||he.appendChild(ae)}he.__resizeListeners__.push(_)};rr.exports=typeof window=="undefined"?L:L.bind(window),rr.exports.unbind=function(q,he){var _=document.attachEvent,le=q.__resizeListeners__||[];if(he){var U=le.indexOf(he);U!==-1&&le.splice(U,1)}else le=q.__resizeListeners__=[];if(!le.length){if(_)q.detachEvent("onresize",ee);else if(q.__resizeTrigger__){var fe=q.__resizeTrigger__.contentDocument,se=fe&&fe.defaultView;se&&(se.removeEventListener("resize",ee),delete se.__resizeTrigger__),q.__resizeTrigger__=!q.removeChild(q.__resizeTrigger__)}delete q.__resizeListeners__}}},11488:function(rr){"use strict";var ee=Object.prototype.hasOwnProperty,L="~";function q(){}Object.create&&(q.prototype=Object.create(null),new q().__proto__||(L=!1));function he(fe,se,Qe){this.fn=fe,this.context=se,this.once=Qe||!1}function _(fe,se,Qe,ae,et){if(typeof Qe!="function")throw new TypeError("The listener must be a function");var dt=new he(Qe,ae||fe,et),Ye=L?L+se:se;return fe._events[Ye]?fe._events[Ye].fn?fe._events[Ye]=[fe._events[Ye],dt]:fe._events[Ye].push(dt):(fe._events[Ye]=dt,fe._eventsCount++),fe}function le(fe,se){--fe._eventsCount===0?fe._events=new q:delete fe._events[se]}function U(){this._events=new q,this._eventsCount=0}U.prototype.eventNames=function(){var se=[],Qe,ae;if(this._eventsCount===0)return se;for(ae in Qe=this._events)ee.call(Qe,ae)&&se.push(L?ae.slice(1):ae);return Object.getOwnPropertySymbols?se.concat(Object.getOwnPropertySymbols(Qe)):se},U.prototype.listeners=function(se){var Qe=L?L+se:se,ae=this._events[Qe];if(!ae)return[];if(ae.fn)return[ae.fn];for(var et=0,dt=ae.length,Ye=new Array(dt);et\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Hi=he.console&&(he.console.warn||he.console.log);return Hi&&Hi.call(he.console,or,In),de.apply(this,arguments)}}var nr;typeof Object.assign!="function"?nr=function(Re){if(Re===U||Re===null)throw new TypeError("Cannot convert undefined or null to object");for(var ct=Object(Re),or=1;or-1}function Ct(de){return de.trim().split(/\s+/g)}function fr(de,Re,ct){if(de.indexOf&&!ct)return de.indexOf(Re);for(var or=0;orco[Re]}):or=or.sort()),or}function K(de,Re){for(var ct,or,jr=Re[0].toUpperCase()+Re.slice(1),In=0;In1&&!ct.firstMultiple?ct.firstMultiple=Et(Re):jr===1&&(ct.firstMultiple=!1);var In=ct.firstInput,Hi=ct.firstMultiple,vo=Hi?Hi.center:In.center,To=Re.center=cr(or);Re.timeStamp=dt(),Re.deltaTime=Re.timeStamp-In.timeStamp,Re.angle=En(vo,To),Re.distance=Fn(vo,To),Sr(ct,Re),Re.offsetDirection=Zr(Re.deltaX,Re.deltaY);var co=mr(Re.deltaTime,Re.deltaX,Re.deltaY);Re.overallVelocityX=co.x,Re.overallVelocityY=co.y,Re.overallVelocity=et(co.x)>et(co.y)?co.x:co.y,Re.scale=Hi?fn(Hi.pointers,or):1,Re.rotation=Hi?Cn(Hi.pointers,or):0,Re.maxPointers=ct.prevInput?Re.pointers.length>ct.prevInput.maxPointers?Re.pointers.length:ct.prevInput.maxPointers:Re.pointers.length,He(ct,Re);var Ps=de.element;It(Re.srcEvent.target,Ps)&&(Ps=Re.srcEvent.target),Re.target=Ps}function Sr(de,Re){var ct=Re.center,or=de.offsetDelta||{},jr=de.prevDelta||{},In=de.prevInput||{};(Re.eventType===Un||In.eventType===Kr)&&(jr=de.prevDelta={x:In.deltaX||0,y:In.deltaY||0},or=de.offsetDelta={x:ct.x,y:ct.y}),Re.deltaX=jr.x+(ct.x-or.x),Re.deltaY=jr.y+(ct.y-or.y)}function He(de,Re){var ct=de.lastInterval||Re,or=Re.timeStamp-ct.timeStamp,jr,In,Hi,vo;if(Re.eventType!=Mi&&(or>Hr||ct.velocity===U)){var To=Re.deltaX-ct.deltaX,co=Re.deltaY-ct.deltaY,Ps=mr(or,To,co);In=Ps.x,Hi=Ps.y,jr=et(Ps.x)>et(Ps.y)?Ps.x:Ps.y,vo=Zr(To,co),de.lastInterval=Re}else jr=ct.velocity,In=ct.velocityX,Hi=ct.velocityY,vo=ct.direction;Re.velocity=jr,Re.velocityX=In,Re.velocityY=Hi,Re.direction=vo}function Et(de){for(var Re=[],ct=0;ct=et(Re)?de<0?Ri:Gn:Re<0?Dn:Ya}function Fn(de,Re,ct){ct||(ct=k);var or=Re[ct[0]]-de[ct[0]],jr=Re[ct[1]]-de[ct[1]];return Math.sqrt(or*or+jr*jr)}function En(de,Re,ct){ct||(ct=k);var or=Re[ct[0]]-de[ct[0]],jr=Re[ct[1]]-de[ct[1]];return Math.atan2(jr,or)*180/Math.PI}function Cn(de,Re){return En(Re[1],Re[0],ie)+En(de[1],de[0],ie)}function fn(de,Re){return Fn(Re[0],Re[1],ie)/Fn(de[0],de[1],ie)}var ni={mousedown:Un,mousemove:bn,mouseup:Kr},Yn="mousedown",oa="mousemove mouseup";function Qi(){this.evEl=Yn,this.evWin=oa,this.pressed=!1,ve.apply(this,arguments)}bt(Qi,ve,{handler:function(Re){var ct=ni[Re.type];ct&Un&&Re.button===0&&(this.pressed=!0),ct&bn&&Re.which!==1&&(ct=Kr),this.pressed&&(ct&Kr&&(this.pressed=!1),this.callback(this.manager,ct,{pointers:[Re],changedPointers:[Re],pointerType:on,srcEvent:Re}))}});var lo={pointerdown:Un,pointermove:bn,pointerup:Kr,pointercancel:Mi,pointerout:Mi},Is={2:Lt,3:Ht,4:on,5:Jr},hi="pointerdown",W="pointermove pointerup pointercancel";he.MSPointerEvent&&!he.PointerEvent&&(hi="MSPointerDown",W="MSPointerMove MSPointerUp MSPointerCancel");function J(){this.evEl=hi,this.evWin=W,ve.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}bt(J,ve,{handler:function(Re){var ct=this.store,or=!1,jr=Re.type.toLowerCase().replace("ms",""),In=lo[jr],Hi=Is[Re.pointerType]||Re.pointerType,vo=Hi==Lt,To=fr(ct,Re.pointerId,"pointerId");In&Un&&(Re.button===0||vo)?To<0&&(ct.push(Re),To=ct.length-1):In&(Kr|Mi)&&(or=!0),!(To<0)&&(ct[To]=Re,this.callback(this.manager,In,{pointers:ct,changedPointers:[Re],pointerType:Hi,srcEvent:Re}),or&&ct.splice(To,1))}});var oe={touchstart:Un,touchmove:bn,touchend:Kr,touchcancel:Mi},be="touchstart",Oe="touchstart touchmove touchend touchcancel";function it(){this.evTarget=be,this.evWin=Oe,this.started=!1,ve.apply(this,arguments)}bt(it,ve,{handler:function(Re){var ct=oe[Re.type];if(ct===Un&&(this.started=!0),!!this.started){var or=pt.call(this,Re,ct);ct&(Kr|Mi)&&or[0].length-or[1].length===0&&(this.started=!1),this.callback(this.manager,ct,{pointers:or[0],changedPointers:or[1],pointerType:Lt,srcEvent:Re})}}});function pt(de,Re){var ct=re(de.touches),or=re(de.changedTouches);return Re&(Kr|Mi)&&(ct=V(ct.concat(or),"identifier",!0)),[ct,or]}var j={touchstart:Un,touchmove:bn,touchend:Kr,touchcancel:Mi},Q="touchstart touchmove touchend touchcancel";function Le(){this.evTarget=Q,this.targetIds={},ve.apply(this,arguments)}bt(Le,ve,{handler:function(Re){var ct=j[Re.type],or=at.call(this,Re,ct);or&&this.callback(this.manager,ct,{pointers:or[0],changedPointers:or[1],pointerType:Lt,srcEvent:Re})}});function at(de,Re){var ct=re(de.touches),or=this.targetIds;if(Re&(Un|bn)&&ct.length===1)return or[ct[0].identifier]=!0,[ct,ct];var jr,In,Hi=re(de.changedTouches),vo=[],To=this.target;if(In=ct.filter(function(co){return It(co.target,To)}),Re===Un)for(jr=0;jr-1&&or.splice(In,1)};setTimeout(jr,Ee)}}function sr(de){for(var Re=de.srcEvent.clientX,ct=de.srcEvent.clientY,or=0;or-1&&this.requireFail.splice(Re,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(de){return!!this.simultaneous[de.id]},emit:function(de){var Re=this,ct=this.state;function or(jr){Re.manager.emit(jr,de)}ct=wi&&or(Re.options.event+$l(ct))},tryEmit:function(de){if(this.canEmit())return this.emit(de);this.state=ma},canEmit:function(){for(var de=0;deRe.threshold&&jr&Re.direction},attrTest:function(de){return fi.prototype.attrTest.call(this,de)&&(this.state&Ti||!(this.state&Ti)&&this.directionTest(de))},emit:function(de){this.pX=de.deltaX,this.pY=de.deltaY;var Re=os(de.direction);Re&&(de.additionalEvent=this.options.event+Re),this._super.emit.call(this,de)}});function sa(){fi.apply(this,arguments)}bt(sa,fi,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[vi]},attrTest:function(de){return this._super.attrTest.call(this,de)&&(Math.abs(de.scale-1)>this.options.threshold||this.state&Ti)},emit:function(de){if(de.scale!==1){var Re=de.scale<1?"in":"out";de.additionalEvent=this.options.event+Re}this._super.emit.call(this,de)}});function Ao(){Aa.apply(this,arguments),this._timer=null,this._input=null}bt(Ao,Aa,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[pi]},process:function(de){var Re=this.options,ct=de.pointers.length===Re.pointers,or=de.distanceRe.time;if(this._input=de,!or||!ct||de.eventType&(Kr|Mi)&&!jr)this.reset();else if(de.eventType&Un)this.reset(),this._timer=Ye(function(){this.state=Pa,this.tryEmit()},Re.time,this);else if(de.eventType&Kr)return Pa;return ma},reset:function(){clearTimeout(this._timer)},emit:function(de){this.state===Pa&&(de&&de.eventType&Kr?this.manager.emit(this.options.event+"up",de):(this._input.timeStamp=dt(),this.manager.emit(this.options.event,this._input)))}});function ha(){fi.apply(this,arguments)}bt(ha,fi,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[vi]},attrTest:function(de){return this._super.attrTest.call(this,de)&&(Math.abs(de.rotation)>this.options.threshold||this.state&Ti)}});function $o(){fi.apply(this,arguments)}bt($o,fi,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Yi|Na,pointers:1},getTouchAction:function(){return Oa.prototype.getTouchAction.call(this)},attrTest:function(de){var Re=this.options.direction,ct;return Re&(Yi|Na)?ct=de.overallVelocity:Re&Yi?ct=de.overallVelocityX:Re&Na&&(ct=de.overallVelocityY),this._super.attrTest.call(this,de)&&Re&de.offsetDirection&&de.distance>this.options.threshold&&de.maxPointers==this.options.pointers&&et(ct)>this.options.velocity&&de.eventType&Kr},emit:function(de){var Re=os(de.offsetDirection);Re&&this.manager.emit(this.options.event+Re,de),this.manager.emit(this.options.event,de)}});function Vo(){Aa.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}bt(Vo,Aa,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[tn]},process:function(de){var Re=this.options,ct=de.pointers.length===Re.pointers,or=de.distance= than the number of constructor arguments of its base class.")};ee.ARGUMENTS_LENGTH_MISMATCH=q,ee.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",ee.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",ee.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",ee.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",ee.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";var he=function(){for(var le=[],U=0;U0&&lr[lr.length-1])&&(qe[0]===6||qe[0]===2)){bt=0;continue}if(qe[0]===3&&(!lr||qe[1]>lr[0]&&qe[1]0?U._map.set(se,Qe):U._map.delete(se)})},_.prototype.hasKey=function(le){if(le==null)throw new Error(q.NULL_ARGUMENT);return this._map.has(le)},_.prototype.clone=function(){var le=new _;return this._map.forEach(function(U,fe){U.forEach(function(se){return le.add(fe,se.clone())})}),le},_.prototype.traverse=function(le){this._map.forEach(function(U,fe){le(fe,U)})},_}();ee.Lookup=he},31331:function(rr,ee,L){"use strict";var q;q={value:!0},q=q=q=q=q=q=ee.GW=q=q=ee.zY=q=q=q=q=q=ee.f3=q=q=ee.b2=q=q=q=q=q=ee.W2=q=void 0;var he=L(91193);q=he;var _=L(46769);Object.defineProperty(ee,"W2",{enumerable:!0,get:function(){return _.Container}});var le=L(88795);q={enumerable:!0,get:function(){return le.BindingScopeEnum}},q={enumerable:!0,get:function(){return le.BindingTypeEnum}},q={enumerable:!0,get:function(){return le.TargetTypeEnum}};var U=L(69377);q={enumerable:!0,get:function(){return U.AsyncContainerModule}},q={enumerable:!0,get:function(){return U.ContainerModule}};var fe=L(9719);Object.defineProperty(ee,"b2",{enumerable:!0,get:function(){return fe.injectable}});var se=L(97404);q={enumerable:!0,get:function(){return se.tagged}};var Qe=L(69481);q={enumerable:!0,get:function(){return Qe.named}};var ae=L(70105);Object.defineProperty(ee,"f3",{enumerable:!0,get:function(){return ae.inject}}),q={enumerable:!0,get:function(){return ae.LazyServiceIdentifer}};var et=L(35231);q={enumerable:!0,get:function(){return et.optional}};var dt=L(8814);q={enumerable:!0,get:function(){return dt.unmanaged}};var Ye=L(81623);q={enumerable:!0,get:function(){return Ye.multiInject}};var wt=L(11580);q={enumerable:!0,get:function(){return wt.targetName}};var Xt=L(17419);Object.defineProperty(ee,"zY",{enumerable:!0,get:function(){return Xt.postConstruct}});var Zt=L(54594);q={enumerable:!0,get:function(){return Zt.MetadataReader}};var nr=L(18576);q={enumerable:!0,get:function(){return nr.id}};var Vt=L(90333);Object.defineProperty(ee,"GW",{enumerable:!0,get:function(){return Vt.decorate}});var xt=L(18307);q={enumerable:!0,get:function(){return xt.traverseAncerstors}},q={enumerable:!0,get:function(){return xt.taggedConstraint}},q={enumerable:!0,get:function(){return xt.namedConstraint}},q={enumerable:!0,get:function(){return xt.typeConstraint}};var bt=L(80030);q={enumerable:!0,get:function(){return bt.getServiceIdentifierAsString}};var Tr=L(55605);q={enumerable:!0,get:function(){return Tr.multiBindToService}}},52887:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.Context=void 0;var q=L(18576),he=function(){function _(le){this.id=q.id(),this.container=le}return _.prototype.addPlan=function(le){this.plan=le},_.prototype.setCurrentRequest=function(le){this.currentRequest=le},_}();ee.Context=he},55650:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.Metadata=void 0;var q=L(91193),he=function(){function _(le,U){this.key=le,this.value=U}return _.prototype.toString=function(){return this.key===q.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},_}();ee.Metadata=he},54594:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.MetadataReader=void 0;var q=L(91193),he=function(){function _(){}return _.prototype.getConstructorMetadata=function(le){var U=Reflect.getMetadata(q.PARAM_TYPES,le),fe=Reflect.getMetadata(q.TAGGED,le);return{compilerGeneratedMetadata:U,userGeneratedMetadata:fe||{}}},_.prototype.getPropertiesMetadata=function(le){var U=Reflect.getMetadata(q.TAGGED_PROP,le)||[];return U},_}();ee.MetadataReader=he},21800:function(rr,ee){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.Plan=void 0;var L=function(){function q(he,_){this.parentContext=he,this.rootRequest=_}return q}();ee.Plan=L},53353:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.getBindingDictionary=ee.createMockRequest=ee.plan=void 0;var q=L(44276),he=L(52050),_=L(88795),le=L(91193),U=L(83817),fe=L(80030),se=L(52887),Qe=L(55650),ae=L(21800),et=L(73630),dt=L(13571),Ye=L(79060);function wt(hr){return hr._bindingDictionary}ee.getBindingDictionary=wt;function Xt(hr,lr,At,ut,It,qe){var Ct=hr?le.MULTI_INJECT_TAG:le.INJECT_TAG,fr=new Qe.Metadata(Ct,At),re=new Ye.Target(lr,ut,At,fr);if(It!==void 0){var V=new Qe.Metadata(It,qe);re.metadata.push(V)}return re}function Zt(hr,lr,At,ut,It){var qe=xt(At.container,It.serviceIdentifier),Ct=[];return qe.length===q.BindingCount.NoBindingsAvailable&&At.container.options.autoBindInjectable&&typeof It.serviceIdentifier=="function"&&hr.getConstructorMetadata(It.serviceIdentifier).compilerGeneratedMetadata&&(At.container.bind(It.serviceIdentifier).toSelf(),qe=xt(At.container,It.serviceIdentifier)),lr?Ct=qe:Ct=qe.filter(function(fr){var re=new dt.Request(fr.serviceIdentifier,At,ut,fr,It);return fr.constraint(re)}),nr(It.serviceIdentifier,Ct,It,At.container),Ct}function nr(hr,lr,At,ut){switch(lr.length){case q.BindingCount.NoBindingsAvailable:if(At.isOptional())return lr;var It=fe.getServiceIdentifierAsString(hr),qe=he.NOT_REGISTERED;throw qe+=fe.listMetadataForTarget(It,At),qe+=fe.listRegisteredBindingsForServiceIdentifier(ut,It,xt),new Error(qe);case q.BindingCount.OnlyOneBindingAvailable:if(!At.isArray())return lr;case q.BindingCount.MultipleBindingsAvailable:default:if(At.isArray())return lr;var It=fe.getServiceIdentifierAsString(hr),qe=he.AMBIGUOUS_MATCH+" "+It;throw qe+=fe.listRegisteredBindingsForServiceIdentifier(ut,It,xt),new Error(qe)}}function Vt(hr,lr,At,ut,It,qe){var Ct,fr;if(It===null){Ct=Zt(hr,lr,ut,null,qe),fr=new dt.Request(At,ut,null,Ct,qe);var re=new ae.Plan(ut,fr);ut.addPlan(re)}else Ct=Zt(hr,lr,ut,It,qe),fr=It.addChildRequest(qe.serviceIdentifier,Ct,qe);Ct.forEach(function(V){var K=null;if(qe.isArray())K=fr.addChildRequest(V.serviceIdentifier,V,qe);else{if(V.cache)return;K=fr}if(V.type===_.BindingTypeEnum.Instance&&V.implementationType!==null){var Me=et.getDependencies(hr,V.implementationType);if(!ut.container.options.skipBaseClassChecks){var Se=et.getBaseClassDependencyCount(hr,V.implementationType);if(Me.length0,It=At.length>Vt.length,qe=ut||It?At.length:Vt.length,Ct=dt(xt,nr,Tr,lr,qe),fr=Ye(Zt,Vt),re=q(q([],Ct),fr);return re}function et(Zt,nr,Vt,xt,bt){var Tr=bt[Zt.toString()]||[],hr=Xt(Tr),lr=hr.unmanaged!==!0,At=xt[Zt],ut=hr.inject||hr.multiInject;if(At=ut||At,At instanceof he.LazyServiceIdentifer&&(At=At.unwrap()),lr){var It=At===Object,qe=At===Function,Ct=At===void 0,fr=It||qe||Ct;if(!nr&&fr){var re=_.MISSING_INJECT_ANNOTATION+" argument "+Zt+" in class "+Vt+".";throw new Error(re)}var V=new se.Target(le.TargetTypeEnum.ConstructorArgument,hr.targetName,At);return V.metadata=Tr,V}return null}function dt(Zt,nr,Vt,xt,bt){for(var Tr=[],hr=0;hr0?lr:wt(Zt,Vt)}else return 0}ee.getBaseClassDependencyCount=wt;function Xt(Zt){var nr={};return Zt.forEach(function(Vt){nr[Vt.key.toString()]=Vt.value}),{inject:nr[U.INJECT_TAG],multiInject:nr[U.MULTI_INJECT_TAG],targetName:nr[U.NAME_TAG],unmanaged:nr[U.UNMANAGED_TAG]}}},13571:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.Request=void 0;var q=L(18576),he=function(){function _(le,U,fe,se,Qe){this.id=q.id(),this.serviceIdentifier=le,this.parentContext=U,this.parentRequest=fe,this.target=Qe,this.childRequests=[],this.bindings=Array.isArray(se)?se:[se],this.requestScope=fe===null?new Map:null}return _.prototype.addChildRequest=function(le,U,fe){var se=new _(le,this.parentContext,this,U,fe);return this.childRequests.push(se),se},_}();ee.Request=he},79060:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.Target=void 0;var q=L(91193),he=L(18576),_=L(55650),le=L(83925),U=function(){function fe(se,Qe,ae,et){this.id=he.id(),this.type=se,this.serviceIdentifier=ae,this.name=new le.QueryableString(Qe||""),this.metadata=new Array;var dt=null;typeof et=="string"?dt=new _.Metadata(q.NAMED_TAG,et):et instanceof _.Metadata&&(dt=et),dt!==null&&this.metadata.push(dt)}return fe.prototype.hasTag=function(se){for(var Qe=0,ae=this.metadata;Qe0){var wt=et.filter(function(Zt){return Zt.target!==null&&Zt.target.type===_.TargetTypeEnum.ConstructorArgument}),Xt=wt.map(dt);Ye=fe(ae,Xt),Ye=U(Ye,et,dt)}else Ye=new ae;return se(ae,Ye),Ye}ee.resolveInstance=Qe},87536:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.resolve=void 0;var q=L(52050),he=L(88795),_=L(83817),le=L(80030),U=L(10003),fe=function(ae,et,dt){try{return dt()}catch(Ye){throw _.isStackOverflowExeption(Ye)?new Error(q.CIRCULAR_DEPENDENCY_IN_FACTORY(ae,et.toString())):Ye}},se=function(ae){return function(et){et.parentContext.setCurrentRequest(et);var dt=et.bindings,Ye=et.childRequests,wt=et.target&&et.target.isArray(),Xt=!et.parentRequest||!et.parentRequest.target||!et.target||!et.parentRequest.target.matchesArray(et.target.serviceIdentifier);if(wt&&Xt)return Ye.map(function(Tr){var hr=se(ae);return hr(Tr)});var Zt=null;if(et.target.isOptional()&&dt.length===0)return;var nr=dt[0],Vt=nr.scope===he.BindingScopeEnum.Singleton,xt=nr.scope===he.BindingScopeEnum.Request;if(Vt&&nr.activated)return nr.cache;if(xt&&ae!==null&&ae.has(nr.id))return ae.get(nr.id);if(nr.type===he.BindingTypeEnum.ConstantValue)Zt=nr.cache,nr.activated=!0;else if(nr.type===he.BindingTypeEnum.Function)Zt=nr.cache,nr.activated=!0;else if(nr.type===he.BindingTypeEnum.Constructor)Zt=nr.implementationType;else if(nr.type===he.BindingTypeEnum.DynamicValue&&nr.dynamicValue!==null)Zt=fe("toDynamicValue",nr.serviceIdentifier,function(){return nr.dynamicValue(et.parentContext)});else if(nr.type===he.BindingTypeEnum.Factory&&nr.factory!==null)Zt=fe("toFactory",nr.serviceIdentifier,function(){return nr.factory(et.parentContext)});else if(nr.type===he.BindingTypeEnum.Provider&&nr.provider!==null)Zt=fe("toProvider",nr.serviceIdentifier,function(){return nr.provider(et.parentContext)});else if(nr.type===he.BindingTypeEnum.Instance&&nr.implementationType!==null)Zt=U.resolveInstance(nr.implementationType,Ye,se(ae));else{var bt=le.getServiceIdentifierAsString(et.serviceIdentifier);throw new Error(q.INVALID_BINDING_TYPE+" "+bt)}return typeof nr.onActivation=="function"&&(Zt=nr.onActivation(et.parentContext,Zt)),Vt&&(nr.cache=Zt,nr.activated=!0),xt&&ae!==null&&!ae.has(nr.id)&&ae.set(nr.id,Zt),Zt}};function Qe(ae){var et=se(ae.plan.rootRequest.requestScope);return et(ae.plan.rootRequest)}ee.resolve=Qe},55404:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.BindingInSyntax=void 0;var q=L(88795),he=L(65408),_=function(){function le(U){this._binding=U}return le.prototype.inRequestScope=function(){return this._binding.scope=q.BindingScopeEnum.Request,new he.BindingWhenOnSyntax(this._binding)},le.prototype.inSingletonScope=function(){return this._binding.scope=q.BindingScopeEnum.Singleton,new he.BindingWhenOnSyntax(this._binding)},le.prototype.inTransientScope=function(){return this._binding.scope=q.BindingScopeEnum.Transient,new he.BindingWhenOnSyntax(this._binding)},le}();ee.BindingInSyntax=_},48971:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.BindingInWhenOnSyntax=void 0;var q=L(55404),he=L(37326),_=L(64957),le=function(){function U(fe){this._binding=fe,this._bindingWhenSyntax=new _.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new he.BindingOnSyntax(this._binding),this._bindingInSyntax=new q.BindingInSyntax(fe)}return U.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},U.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},U.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},U.prototype.when=function(fe){return this._bindingWhenSyntax.when(fe)},U.prototype.whenTargetNamed=function(fe){return this._bindingWhenSyntax.whenTargetNamed(fe)},U.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},U.prototype.whenTargetTagged=function(fe,se){return this._bindingWhenSyntax.whenTargetTagged(fe,se)},U.prototype.whenInjectedInto=function(fe){return this._bindingWhenSyntax.whenInjectedInto(fe)},U.prototype.whenParentNamed=function(fe){return this._bindingWhenSyntax.whenParentNamed(fe)},U.prototype.whenParentTagged=function(fe,se){return this._bindingWhenSyntax.whenParentTagged(fe,se)},U.prototype.whenAnyAncestorIs=function(fe){return this._bindingWhenSyntax.whenAnyAncestorIs(fe)},U.prototype.whenNoAncestorIs=function(fe){return this._bindingWhenSyntax.whenNoAncestorIs(fe)},U.prototype.whenAnyAncestorNamed=function(fe){return this._bindingWhenSyntax.whenAnyAncestorNamed(fe)},U.prototype.whenAnyAncestorTagged=function(fe,se){return this._bindingWhenSyntax.whenAnyAncestorTagged(fe,se)},U.prototype.whenNoAncestorNamed=function(fe){return this._bindingWhenSyntax.whenNoAncestorNamed(fe)},U.prototype.whenNoAncestorTagged=function(fe,se){return this._bindingWhenSyntax.whenNoAncestorTagged(fe,se)},U.prototype.whenAnyAncestorMatches=function(fe){return this._bindingWhenSyntax.whenAnyAncestorMatches(fe)},U.prototype.whenNoAncestorMatches=function(fe){return this._bindingWhenSyntax.whenNoAncestorMatches(fe)},U.prototype.onActivation=function(fe){return this._bindingOnSyntax.onActivation(fe)},U}();ee.BindingInWhenOnSyntax=le},37326:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.BindingOnSyntax=void 0;var q=L(64957),he=function(){function _(le){this._binding=le}return _.prototype.onActivation=function(le){return this._binding.onActivation=le,new q.BindingWhenSyntax(this._binding)},_}();ee.BindingOnSyntax=he},43085:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.BindingToSyntax=void 0;var q=L(52050),he=L(88795),_=L(48971),le=L(65408),U=function(){function fe(se){this._binding=se}return fe.prototype.to=function(se){return this._binding.type=he.BindingTypeEnum.Instance,this._binding.implementationType=se,new _.BindingInWhenOnSyntax(this._binding)},fe.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+q.INVALID_TO_SELF_VALUE);var se=this._binding.serviceIdentifier;return this.to(se)},fe.prototype.toConstantValue=function(se){return this._binding.type=he.BindingTypeEnum.ConstantValue,this._binding.cache=se,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=he.BindingScopeEnum.Singleton,new le.BindingWhenOnSyntax(this._binding)},fe.prototype.toDynamicValue=function(se){return this._binding.type=he.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=se,this._binding.implementationType=null,new _.BindingInWhenOnSyntax(this._binding)},fe.prototype.toConstructor=function(se){return this._binding.type=he.BindingTypeEnum.Constructor,this._binding.implementationType=se,this._binding.scope=he.BindingScopeEnum.Singleton,new le.BindingWhenOnSyntax(this._binding)},fe.prototype.toFactory=function(se){return this._binding.type=he.BindingTypeEnum.Factory,this._binding.factory=se,this._binding.scope=he.BindingScopeEnum.Singleton,new le.BindingWhenOnSyntax(this._binding)},fe.prototype.toFunction=function(se){if(typeof se!="function")throw new Error(q.INVALID_FUNCTION_BINDING);var Qe=this.toConstantValue(se);return this._binding.type=he.BindingTypeEnum.Function,this._binding.scope=he.BindingScopeEnum.Singleton,Qe},fe.prototype.toAutoFactory=function(se){return this._binding.type=he.BindingTypeEnum.Factory,this._binding.factory=function(Qe){var ae=function(){return Qe.container.get(se)};return ae},this._binding.scope=he.BindingScopeEnum.Singleton,new le.BindingWhenOnSyntax(this._binding)},fe.prototype.toProvider=function(se){return this._binding.type=he.BindingTypeEnum.Provider,this._binding.provider=se,this._binding.scope=he.BindingScopeEnum.Singleton,new le.BindingWhenOnSyntax(this._binding)},fe.prototype.toService=function(se){this.toDynamicValue(function(Qe){return Qe.container.get(se)})},fe}();ee.BindingToSyntax=U},65408:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.BindingWhenOnSyntax=void 0;var q=L(37326),he=L(64957),_=function(){function le(U){this._binding=U,this._bindingWhenSyntax=new he.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new q.BindingOnSyntax(this._binding)}return le.prototype.when=function(U){return this._bindingWhenSyntax.when(U)},le.prototype.whenTargetNamed=function(U){return this._bindingWhenSyntax.whenTargetNamed(U)},le.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},le.prototype.whenTargetTagged=function(U,fe){return this._bindingWhenSyntax.whenTargetTagged(U,fe)},le.prototype.whenInjectedInto=function(U){return this._bindingWhenSyntax.whenInjectedInto(U)},le.prototype.whenParentNamed=function(U){return this._bindingWhenSyntax.whenParentNamed(U)},le.prototype.whenParentTagged=function(U,fe){return this._bindingWhenSyntax.whenParentTagged(U,fe)},le.prototype.whenAnyAncestorIs=function(U){return this._bindingWhenSyntax.whenAnyAncestorIs(U)},le.prototype.whenNoAncestorIs=function(U){return this._bindingWhenSyntax.whenNoAncestorIs(U)},le.prototype.whenAnyAncestorNamed=function(U){return this._bindingWhenSyntax.whenAnyAncestorNamed(U)},le.prototype.whenAnyAncestorTagged=function(U,fe){return this._bindingWhenSyntax.whenAnyAncestorTagged(U,fe)},le.prototype.whenNoAncestorNamed=function(U){return this._bindingWhenSyntax.whenNoAncestorNamed(U)},le.prototype.whenNoAncestorTagged=function(U,fe){return this._bindingWhenSyntax.whenNoAncestorTagged(U,fe)},le.prototype.whenAnyAncestorMatches=function(U){return this._bindingWhenSyntax.whenAnyAncestorMatches(U)},le.prototype.whenNoAncestorMatches=function(U){return this._bindingWhenSyntax.whenNoAncestorMatches(U)},le.prototype.onActivation=function(U){return this._bindingOnSyntax.onActivation(U)},le}();ee.BindingWhenOnSyntax=_},64957:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.BindingWhenSyntax=void 0;var q=L(37326),he=L(18307),_=function(){function le(U){this._binding=U}return le.prototype.when=function(U){return this._binding.constraint=U,new q.BindingOnSyntax(this._binding)},le.prototype.whenTargetNamed=function(U){return this._binding.constraint=he.namedConstraint(U),new q.BindingOnSyntax(this._binding)},le.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(U){var fe=U.target!==null&&!U.target.isNamed()&&!U.target.isTagged();return fe},new q.BindingOnSyntax(this._binding)},le.prototype.whenTargetTagged=function(U,fe){return this._binding.constraint=he.taggedConstraint(U)(fe),new q.BindingOnSyntax(this._binding)},le.prototype.whenInjectedInto=function(U){return this._binding.constraint=function(fe){return he.typeConstraint(U)(fe.parentRequest)},new q.BindingOnSyntax(this._binding)},le.prototype.whenParentNamed=function(U){return this._binding.constraint=function(fe){return he.namedConstraint(U)(fe.parentRequest)},new q.BindingOnSyntax(this._binding)},le.prototype.whenParentTagged=function(U,fe){return this._binding.constraint=function(se){return he.taggedConstraint(U)(fe)(se.parentRequest)},new q.BindingOnSyntax(this._binding)},le.prototype.whenAnyAncestorIs=function(U){return this._binding.constraint=function(fe){return he.traverseAncerstors(fe,he.typeConstraint(U))},new q.BindingOnSyntax(this._binding)},le.prototype.whenNoAncestorIs=function(U){return this._binding.constraint=function(fe){return!he.traverseAncerstors(fe,he.typeConstraint(U))},new q.BindingOnSyntax(this._binding)},le.prototype.whenAnyAncestorNamed=function(U){return this._binding.constraint=function(fe){return he.traverseAncerstors(fe,he.namedConstraint(U))},new q.BindingOnSyntax(this._binding)},le.prototype.whenNoAncestorNamed=function(U){return this._binding.constraint=function(fe){return!he.traverseAncerstors(fe,he.namedConstraint(U))},new q.BindingOnSyntax(this._binding)},le.prototype.whenAnyAncestorTagged=function(U,fe){return this._binding.constraint=function(se){return he.traverseAncerstors(se,he.taggedConstraint(U)(fe))},new q.BindingOnSyntax(this._binding)},le.prototype.whenNoAncestorTagged=function(U,fe){return this._binding.constraint=function(se){return!he.traverseAncerstors(se,he.taggedConstraint(U)(fe))},new q.BindingOnSyntax(this._binding)},le.prototype.whenAnyAncestorMatches=function(U){return this._binding.constraint=function(fe){return he.traverseAncerstors(fe,U)},new q.BindingOnSyntax(this._binding)},le.prototype.whenNoAncestorMatches=function(U){return this._binding.constraint=function(fe){return!he.traverseAncerstors(fe,U)},new q.BindingOnSyntax(this._binding)},le}();ee.BindingWhenSyntax=_},18307:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.typeConstraint=ee.namedConstraint=ee.taggedConstraint=ee.traverseAncerstors=void 0;var q=L(91193),he=L(55650),_=function(se,Qe){var ae=se.parentRequest;return ae!==null?Qe(ae)?!0:_(ae,Qe):!1};ee.traverseAncerstors=_;var le=function(se){return function(Qe){var ae=function(et){return et!==null&&et.target!==null&&et.target.matchesTag(se)(Qe)};return ae.metaData=new he.Metadata(se,Qe),ae}};ee.taggedConstraint=le;var U=le(q.NAMED_TAG);ee.namedConstraint=U;var fe=function(se){return function(Qe){var ae=null;if(Qe!==null)if(ae=Qe.bindings[0],typeof se=="string"){var et=ae.serviceIdentifier;return et===se}else{var dt=Qe.bindings[0].implementationType;return se===dt}return!1}};ee.typeConstraint=fe},55605:function(rr,ee){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.multiBindToService=void 0;var L=function(q){return function(he){return function(){for(var _=[],le=0;le ")}function fe(ae){ae.childRequests.forEach(function(et){if(le(et,et.serviceIdentifier)){var dt=U(et);throw new Error(q.CIRCULAR_DEPENDENCY+" "+dt)}else fe(et)})}ee.circularDependencyToException=fe;function se(ae,et){if(et.isTagged()||et.isNamed()){var dt="",Ye=et.getNamedTag(),wt=et.getCustomTags();return Ye!==null&&(dt+=Ye.toString()+` `),wt!==null&&wt.forEach(function(Xt){dt+=Xt.toString()+` `})," "+ae+` `+ae+" - "+dt}else return" "+ae}ee.listMetadataForTarget=se;function Qe(ae){if(ae.name)return ae.name;var et=ae.toString(),dt=et.match(/^function\s*([^\s(]+)/);return dt?dt[1]:"Anonymous function: "+et}ee.getFunctionName=Qe},91746:function(rr,ee,L){var q=L(28889);function he(_,le){var U=_==null?0:_.length;return!!U&&q(_,le,0)>-1}rr.exports=he},88416:function(rr){function ee(L,q,he){for(var _=-1,le=L==null?0:L.length;++_=q?L:q)),L}rr.exports=ee},31187:function(rr){function ee(L,q,he,_){for(var le=L.length,U=he+(_?1:-1);_?U--:++U-1;)nr!==ae&&se.call(nr,Vt,1),se.call(ae,Vt,1);return ae}rr.exports=Qe},90798:function(rr,ee,L){var q=L(89023),he=L(91746),_=L(88416),le=L(32959),U=L(51407),fe=L(13772),se=200;function Qe(ae,et,dt){var Ye=-1,wt=he,Xt=ae.length,Zt=!0,nr=[],Vt=nr;if(dt)Zt=!1,wt=_;else if(Xt>=se){var xt=et?null:U(ae);if(xt)return fe(xt);Zt=!1,wt=le,Vt=new q}else Vt=et?[]:nr;e:for(;++Ye(m=1))return m;for(;cE?c=x:m=x,x=.5*(m-c)+c}return x},fe.prototype.solve=function(a,u){return this.sampleCurveY(this.solveCurveX(a,u))};var se=Qe;function Qe(a,u){this.x=a,this.y=u}Qe.prototype={clone:function(){return new Qe(this.x,this.y)},add:function(a){return this.clone()._add(a)},sub:function(a){return this.clone()._sub(a)},multByPoint:function(a){return this.clone()._multByPoint(a)},divByPoint:function(a){return this.clone()._divByPoint(a)},mult:function(a){return this.clone()._mult(a)},div:function(a){return this.clone()._div(a)},rotate:function(a){return this.clone()._rotate(a)},rotateAround:function(a,u){return this.clone()._rotateAround(a,u)},matMult:function(a){return this.clone()._matMult(a)},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(a){return this.x===a.x&&this.y===a.y},dist:function(a){return Math.sqrt(this.distSqr(a))},distSqr:function(a){var u=a.x-this.x,c=a.y-this.y;return u*u+c*c},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(a){return Math.atan2(this.y-a.y,this.x-a.x)},angleWith:function(a){return this.angleWithSep(a.x,a.y)},angleWithSep:function(a,u){return Math.atan2(this.x*u-this.y*a,this.x*a+this.y*u)},_matMult:function(a){var u=a[2]*this.x+a[3]*this.y;return this.x=a[0]*this.x+a[1]*this.y,this.y=u,this},_add:function(a){return this.x+=a.x,this.y+=a.y,this},_sub:function(a){return this.x-=a.x,this.y-=a.y,this},_mult:function(a){return this.x*=a,this.y*=a,this},_div:function(a){return this.x/=a,this.y/=a,this},_multByPoint:function(a){return this.x*=a.x,this.y*=a.y,this},_divByPoint:function(a){return this.x/=a.x,this.y/=a.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var a=this.y;return this.y=this.x,this.x=-a,this},_rotate:function(a){var u=Math.cos(a),c=Math.sin(a),m=c*this.x+u*this.y;return this.x=u*this.x-c*this.y,this.y=m,this},_rotateAround:function(a,u){var c=Math.cos(a),m=Math.sin(a),x=u.y+m*(this.x-u.x)+c*(this.y-u.y);return this.x=u.x+c*(this.x-u.x)-m*(this.y-u.y),this.y=x,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Qe.convert=function(a){return a instanceof Qe?a:Array.isArray(a)?new Qe(a[0],a[1]):a};var ae=typeof self!="undefined"?self:{},et=Math.pow(2,53)-1;function dt(a,u,c,m){var x=new U(a,u,c,m);return function(E){return x.solve(E)}}var Ye=dt(.25,.1,.25,1);function wt(a,u,c){return Math.min(c,Math.max(u,a))}function Xt(a,u,c){var m=c-u,x=((a-u)%m+m)%m+u;return x===u?c:x}function Zt(a){for(var u=[],c=arguments.length-1;c-- >0;)u[c]=arguments[c+1];for(var m=0,x=u;m>u/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,a)}()}function bt(a){return!!a&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(a)}function Tr(a,u){a.forEach(function(c){u[c]&&(u[c]=u[c].bind(u))})}function hr(a,u){return a.indexOf(u,a.length-u.length)!==-1}function lr(a,u,c){var m={};for(var x in a)m[x]=u.call(c||this,a[x],x,a);return m}function At(a,u,c){var m={};for(var x in a)u.call(c||this,a[x],x,a)&&(m[x]=a[x]);return m}function ut(a){return Array.isArray(a)?a.map(ut):typeof a=="object"&&a?lr(a,ut):a}var It={};function qe(a){It[a]||(typeof console!="undefined"&&console.warn(a),It[a]=!0)}function Ct(a,u,c){return(c.y-a.y)*(u.x-a.x)>(u.y-a.y)*(c.x-a.x)}function fr(a){for(var u=0,c=0,m=a.length,x=m-1,E=void 0,A=void 0;c@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(m,x,E,A){var I=E||A;return u[x]=!I||I.toLowerCase(),""}),u["max-age"]){var c=parseInt(u["max-age"],10);isNaN(c)?delete u["max-age"]:u["max-age"]=c}return u}var K=null;function Me(a){if(K==null){var u=a.navigator?a.navigator.userAgent:null;K=!!a.safari||!(!u||!(/\b(iPad|iPhone|iPod)\b/.test(u)||u.match("Safari")&&!u.match("Chrome")))}return K}function Se(a){try{var u=ae[a];return u.setItem("_mapbox_test_",1),u.removeItem("_mapbox_test_"),!0}catch(c){return!1}}var nt,te,Ce,we,Xe=ae.performance&&ae.performance.now?ae.performance.now.bind(ae.performance):Date.now.bind(Date),Lt=ae.requestAnimationFrame||ae.mozRequestAnimationFrame||ae.webkitRequestAnimationFrame||ae.msRequestAnimationFrame,Ht=ae.cancelAnimationFrame||ae.mozCancelAnimationFrame||ae.webkitCancelAnimationFrame||ae.msCancelAnimationFrame,on={now:Xe,frame:function(a){var u=Lt(a);return{cancel:function(){return Ht(u)}}},getImageData:function(a,u){u===void 0&&(u=0);var c=ae.document.createElement("canvas"),m=c.getContext("2d");if(!m)throw new Error("failed to create canvas 2d context");return c.width=a.width,c.height=a.height,m.drawImage(a,0,0,a.width,a.height),m.getImageData(-u,-u,a.width+2*u,a.height+2*u)},resolveURL:function(a){return nt||(nt=ae.document.createElement("a")),nt.href=a,nt.href},hardwareConcurrency:ae.navigator&&ae.navigator.hardwareConcurrency||4,get devicePixelRatio(){return ae.devicePixelRatio},get prefersReducedMotion(){return!!ae.matchMedia&&(te==null&&(te=ae.matchMedia("(prefers-reduced-motion: reduce)")),te.matches)}},Jr={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},Hr={supported:!1,testSupport:function(a){!Un&&we&&(bn?Kr(a):Ce=a)}},Un=!1,bn=!1;function Kr(a){var u=a.createTexture();a.bindTexture(a.TEXTURE_2D,u);try{if(a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,we),a.isContextLost())return;Hr.supported=!0}catch(c){}a.deleteTexture(u),Un=!0}ae.document&&((we=ae.document.createElement("img")).onload=function(){Ce&&Kr(Ce),Ce=null,bn=!0},we.onerror=function(){Un=!0,Ce=null},we.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var Mi="01",Si=function(a,u){this._transformRequestFn=a,this._customAccessToken=u,this._createSkuToken()};function Ri(a){return a.indexOf("mapbox:")===0}Si.prototype._createSkuToken=function(){var a=function(){for(var u="",c=0;c<10;c++)u+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",Mi,u].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=a.token,this._skuTokenExpiresAt=a.tokenExpiresAt},Si.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Si.prototype.transformRequest=function(a,u){return this._transformRequestFn&&this._transformRequestFn(a,u)||{url:a}},Si.prototype.normalizeStyleURL=function(a,u){if(!Ri(a))return a;var c=Yi(a);return c.path="/styles/v1"+c.path,this._makeAPIURL(c,this._customAccessToken||u)},Si.prototype.normalizeGlyphsURL=function(a,u){if(!Ri(a))return a;var c=Yi(a);return c.path="/fonts/v1"+c.path,this._makeAPIURL(c,this._customAccessToken||u)},Si.prototype.normalizeSourceURL=function(a,u){if(!Ri(a))return a;var c=Yi(a);return c.path="/v4/"+c.authority+".json",c.params.push("secure"),this._makeAPIURL(c,this._customAccessToken||u)},Si.prototype.normalizeSpriteURL=function(a,u,c,m){var x=Yi(a);return Ri(a)?(x.path="/styles/v1"+x.path+"/sprite"+u+c,this._makeAPIURL(x,this._customAccessToken||m)):(x.path+=""+u+c,Na(x))},Si.prototype.normalizeTileURL=function(a,u){if(this._isSkuTokenExpired()&&this._createSkuToken(),a&&!Ri(a))return a;var c=Yi(a);c.path=c.path.replace(/(\.(png|jpg)\d*)(?=$)/,(on.devicePixelRatio>=2||u===512?"@2x":"")+(Hr.supported?".webp":"$1")),c.path=c.path.replace(/^.+\/v4\//,"/"),c.path="/v4"+c.path;var m=this._customAccessToken||function(x){for(var E=0,A=x;E=0&&a.params.splice(x,1)}if(m.path!=="/"&&(a.path=""+m.path+a.path),!Jr.REQUIRE_ACCESS_TOKEN)return Na(a);if(!(u=u||Jr.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+c);if(u[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+c);return a.params=a.params.filter(function(E){return E.indexOf("access_token")===-1}),a.params.push("access_token="+u),Na(a)};var Gn=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Dn(a){return Gn.test(a)}var Ya=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Yi(a){var u=a.match(Ya);if(!u)throw new Error("Unable to parse URL object");return{protocol:u[1],authority:u[2],path:u[3]||"/",params:u[4]?u[4].split("&"):[]}}function Na(a){var u=a.params.length?"?"+a.params.join("&"):"";return a.protocol+"://"+a.authority+a.path+u}function Dt(a){if(!a)return null;var u=a.split(".");if(!u||u.length!==3)return null;try{return JSON.parse(decodeURIComponent(ae.atob(u[1]).split("").map(function(c){return"%"+("00"+c.charCodeAt(0).toString(16)).slice(-2)}).join("")))}catch(c){return null}}var k=function(a){this.type=a,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};k.prototype.getStorageKey=function(a){var u,c=Dt(Jr.ACCESS_TOKEN);return u=c&&c.u?ae.btoa(encodeURIComponent(c.u).replace(/%([0-9A-F]{2})/g,function(m,x){return String.fromCharCode(+("0x"+x))})):Jr.ACCESS_TOKEN||"",a?"mapbox.eventData."+a+":"+u:"mapbox.eventData:"+u},k.prototype.fetchEventData=function(){var a=Se("localStorage"),u=this.getStorageKey(),c=this.getStorageKey("uuid");if(a)try{var m=ae.localStorage.getItem(u);m&&(this.eventData=JSON.parse(m));var x=ae.localStorage.getItem(c);x&&(this.anonId=x)}catch(E){qe("Unable to read from LocalStorage")}},k.prototype.saveEventData=function(){var a=Se("localStorage"),u=this.getStorageKey(),c=this.getStorageKey("uuid");if(a)try{ae.localStorage.setItem(c,this.anonId),Object.keys(this.eventData).length>=1&&ae.localStorage.setItem(u,JSON.stringify(this.eventData))}catch(m){qe("Unable to write to LocalStorage")}},k.prototype.processRequests=function(a){},k.prototype.postEvent=function(a,u,c,m){var x=this;if(Jr.EVENTS_URL){var E=Yi(Jr.EVENTS_URL);E.params.push("access_token="+(m||Jr.ACCESS_TOKEN||""));var A={event:this.type,created:new Date(a).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:Mi,userId:this.anonId},I=u?Zt(A,u):A,D={url:Na(E),headers:{"Content-Type":"text/plain"},body:JSON.stringify([I])};this.pendingRequest=hi(D,function(N){x.pendingRequest=null,c(N),x.saveEventData(),x.processRequests(m)})}},k.prototype.queueRequest=function(a,u){this.queue.push(a),this.processRequests(u)};var ie,ve,Ze=function(a){function u(){a.call(this,"map.load"),this.success={},this.skuToken=""}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.postMapLoadEvent=function(c,m,x,E){this.skuToken=x;var A=!(!E&&!Jr.ACCESS_TOKEN),I=Array.isArray(c)&&c.some(function(D){return Ri(D)||Dn(D)});Jr.EVENTS_URL&&A&&I&&this.queueRequest({id:m,timestamp:Date.now()},E)},u.prototype.processRequests=function(c){var m=this;if(!this.pendingRequest&&this.queue.length!==0){var x=this.queue.shift(),E=x.id,A=x.timestamp;E&&this.success[E]||(this.anonId||this.fetchEventData(),bt(this.anonId)||(this.anonId=xt()),this.postEvent(A,{skuToken:this.skuToken},function(I){I||E&&(m.success[E]=!0)},c))}},u}(k),_t=new(function(a){function u(c){a.call(this,"appUserTurnstile"),this._customAccessToken=c}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.postTurnstileEvent=function(c,m){Jr.EVENTS_URL&&Jr.ACCESS_TOKEN&&Array.isArray(c)&&c.some(function(x){return Ri(x)||Dn(x)})&&this.queueRequest(Date.now(),m)},u.prototype.processRequests=function(c){var m=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var x=Dt(Jr.ACCESS_TOKEN),E=x?x.u:Jr.ACCESS_TOKEN,A=E!==this.eventData.tokenU;bt(this.anonId)||(this.anonId=xt(),A=!0);var I=this.queue.shift();if(this.eventData.lastSuccess){var D=new Date(this.eventData.lastSuccess),N=new Date(I),H=(I-this.eventData.lastSuccess)/864e5;A=A||H>=1||H<-1||D.getDate()!==N.getDate()}else A=!0;if(!A)return this.processRequests();this.postEvent(I,{"enabled.telemetry":!1},function(X){X||(m.eventData.lastSuccess=I,m.eventData.tokenU=E)},c)}},u}(k)),Wt=_t.postTurnstileEvent.bind(_t),Sr=new Ze,He=Sr.postMapLoadEvent.bind(Sr),Et=500,cr=50;function mr(){ae.caches&&!ie&&(ie=ae.caches.open("mapbox-tiles"))}function Zr(a){var u=a.indexOf("?");return u<0?a:a.slice(0,u)}var Fn,En=1/0;function Cn(){return Fn==null&&(Fn=ae.OffscreenCanvas&&new ae.OffscreenCanvas(1,1).getContext("2d")&&typeof ae.createImageBitmap=="function"),Fn}var fn={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(fn);var ni=function(a){function u(c,m,x){m===401&&Dn(x)&&(c+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),a.call(this,c),this.status=m,this.url=x,this.name=this.constructor.name,this.message=c}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},u}(Error),Yn=re()?function(){return self.worker&&self.worker.referrer}:function(){return(ae.location.protocol==="blob:"?ae.parent:ae).location.href},oa,Qi,lo=function(a,u){if(!(/^file:/.test(c=a.url)||/^file:/.test(Yn())&&!/^\w+:/.test(c))){if(ae.fetch&&ae.Request&&ae.AbortController&&ae.Request.prototype.hasOwnProperty("signal"))return function(m,x){var E,A=new ae.AbortController,I=new ae.Request(m.url,{method:m.method||"GET",body:m.body,credentials:m.credentials,headers:m.headers,referrer:Yn(),signal:A.signal}),D=!1,N=!1,H=(E=I.url).indexOf("sku=")>0&&Dn(E);m.type==="json"&&I.headers.set("Accept","application/json");var X=function(R,Pe,Be){if(!N){if(R&&R.message!=="SecurityError"&&qe(R),Pe&&Be)return ne(Pe);var rt=Date.now();ae.fetch(I).then(function(Ge){if(Ge.ok){var St=H?Ge.clone():null;return ne(Ge,St,rt)}return x(new ni(Ge.statusText,Ge.status,m.url))}).catch(function(Ge){Ge.code!==20&&x(new Error(Ge.message))})}},ne=function(R,Pe,Be){(m.type==="arrayBuffer"?R.arrayBuffer():m.type==="json"?R.json():R.text()).then(function(rt){N||(Pe&&Be&&function(Ge,St,Ft){if(mr(),ie){var Yt={status:St.status,statusText:St.statusText,headers:new ae.Headers};St.headers.forEach(function(dr,Lr){return Yt.headers.set(Lr,dr)});var qt=V(St.headers.get("Cache-Control")||"");qt["no-store"]||(qt["max-age"]&&Yt.headers.set("Expires",new Date(Ft+1e3*qt["max-age"]).toUTCString()),new Date(Yt.headers.get("Expires")).getTime()-Ft<42e4||function(dr,Lr){if(ve===void 0)try{new Response(new ReadableStream),ve=!0}catch(Xr){ve=!1}ve?Lr(dr.body):dr.blob().then(Lr)}(St,function(dr){var Lr=new ae.Response(dr,Yt);mr(),ie&&ie.then(function(Xr){return Xr.put(Zr(Ge.url),Lr)}).catch(function(Xr){return qe(Xr.message)})}))}}(I,Pe,Be),D=!0,x(null,rt,R.headers.get("Cache-Control"),R.headers.get("Expires")))}).catch(function(rt){N||x(new Error(rt.message))})};return H?function(R,Pe){if(mr(),!ie)return Pe(null);var Be=Zr(R.url);ie.then(function(rt){rt.match(Be).then(function(Ge){var St=function(Ft){if(!Ft)return!1;var Yt=new Date(Ft.headers.get("Expires")||0),qt=V(Ft.headers.get("Cache-Control")||"");return Yt>Date.now()&&!qt["no-cache"]}(Ge);rt.delete(Be),St&&rt.put(Be,Ge.clone()),Pe(null,Ge,St)}).catch(Pe)}).catch(Pe)}(I,X):X(null,null),{cancel:function(){N=!0,D||A.abort()}}}(a,u);if(re()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",a,u,void 0,!0)}var c;return function(m,x){var E=new ae.XMLHttpRequest;for(var A in E.open(m.method||"GET",m.url,!0),m.type==="arrayBuffer"&&(E.responseType="arraybuffer"),m.headers)E.setRequestHeader(A,m.headers[A]);return m.type==="json"&&(E.responseType="text",E.setRequestHeader("Accept","application/json")),E.withCredentials=m.credentials==="include",E.onerror=function(){x(new Error(E.statusText))},E.onload=function(){if((E.status>=200&&E.status<300||E.status===0)&&E.response!==null){var I=E.response;if(m.type==="json")try{I=JSON.parse(E.response)}catch(D){return x(D)}x(null,I,E.getResponseHeader("Cache-Control"),E.getResponseHeader("Expires"))}else x(new ni(E.statusText,E.status,m.url))},E.send(m.body),{cancel:function(){return E.abort()}}}(a,u)},Is=function(a,u){return lo(Zt(a,{type:"arrayBuffer"}),u)},hi=function(a,u){return lo(Zt(a,{method:"POST"}),u)},W="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";oa=[],Qi=0;var J=function(a,u){if(Hr.supported&&(a.headers||(a.headers={}),a.headers.accept="image/webp,*/*"),Qi>=Jr.MAX_PARALLEL_IMAGE_REQUESTS){var c={requestParameters:a,callback:u,cancelled:!1,cancel:function(){this.cancelled=!0}};return oa.push(c),c}Qi++;var m=!1,x=function(){if(!m)for(m=!0,Qi--;oa.length&&Qi0||this._oneTimeListeners&&this._oneTimeListeners[a]&&this._oneTimeListeners[a].length>0||this._eventedParent&&this._eventedParent.listens(a)},pt.prototype.setEventedParent=function(a,u){return this._eventedParent=a,this._eventedParentData=u,this};var j={$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"}}},Q=function(a,u,c,m){this.message=(a?a+": ":"")+c,m&&(this.identifier=m),u!=null&&u.__line__&&(this.line=u.__line__)};function Le(a){var u=a.value;return u?[new Q(a.key,u,"constants have been deprecated as of v8")]:[]}function at(a){for(var u=[],c=arguments.length-1;c-- >0;)u[c]=arguments[c+1];for(var m=0,x=u;m":a.itemType.kind==="value"?"array":"array<"+u+">"}return a.kind}var Xo=[sn,sr,en,Wr,Yr,qi,pi,zi(tn),ci];function Ji(a,u){if(u.kind==="error")return null;if(a.kind==="array"){if(u.kind==="array"&&(u.N===0&&u.itemType.kind==="value"||!Ji(a.itemType,u.itemType))&&(typeof a.N!="number"||a.N===u.N))return null}else{if(a.kind===u.kind)return null;if(a.kind==="value"){for(var c=0,m=Xo;c255?255:I}function x(I){return m(I[I.length-1]==="%"?parseFloat(I)/100*255:parseInt(I))}function E(I){return(D=I[I.length-1]==="%"?parseFloat(I)/100:parseFloat(I))<0?0:D>1?1:D;var D}function A(I,D,N){return N<0?N+=1:N>1&&(N-=1),6*N<1?I+(D-I)*N*6:2*N<1?D:3*N<2?I+(D-I)*(2/3-N)*6:I}try{u.parseCSSColor=function(I){var D,N=I.replace(/ /g,"").toLowerCase();if(N in c)return c[N].slice();if(N[0]==="#")return N.length===4?(D=parseInt(N.substr(1),16))>=0&&D<=4095?[(3840&D)>>4|(3840&D)>>8,240&D|(240&D)>>4,15&D|(15&D)<<4,1]:null:N.length===7&&(D=parseInt(N.substr(1),16))>=0&&D<=16777215?[(16711680&D)>>16,(65280&D)>>8,255&D,1]:null;var H=N.indexOf("("),X=N.indexOf(")");if(H!==-1&&X+1===N.length){var ne=N.substr(0,H),R=N.substr(H+1,X-(H+1)).split(","),Pe=1;switch(ne){case"rgba":if(R.length!==4)return null;Pe=E(R.pop());case"rgb":return R.length!==3?null:[x(R[0]),x(R[1]),x(R[2]),Pe];case"hsla":if(R.length!==4)return null;Pe=E(R.pop());case"hsl":if(R.length!==3)return null;var Be=(parseFloat(R[0])%360+360)%360/360,rt=E(R[1]),Ge=E(R[2]),St=Ge<=.5?Ge*(rt+1):Ge+rt-Ge*rt,Ft=2*Ge-St;return[m(255*A(Ft,St,Be+1/3)),m(255*A(Ft,St,Be)),m(255*A(Ft,St,Be-1/3)),Pe];default:return null}}return null}}catch(I){}}).parseCSSColor,wi=function(a,u,c,m){m===void 0&&(m=1),this.r=a,this.g=u,this.b=c,this.a=m};wi.parse=function(a){if(a){if(a instanceof wi)return a;if(typeof a=="string"){var u=mi(a);if(u)return new wi(u[0]/255*u[3],u[1]/255*u[3],u[2]/255*u[3],u[3])}}},wi.prototype.toString=function(){var a=this.toArray(),u=a[1],c=a[2],m=a[3];return"rgba("+Math.round(a[0])+","+Math.round(u)+","+Math.round(c)+","+m+")"},wi.prototype.toArray=function(){var a=this.a;return a===0?[0,0,0,0]:[255*this.r/a,255*this.g/a,255*this.b/a,a]},wi.black=new wi(0,0,0,1),wi.white=new wi(1,1,1,1),wi.transparent=new wi(0,0,0,0),wi.red=new wi(1,0,0,1);var Pa=function(a,u,c){this.sensitivity=a?u?"variant":"case":u?"accent":"base",this.locale=c,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Pa.prototype.compare=function(a,u){return this.collator.compare(a,u)},Pa.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var cu=function(a,u,c,m,x){this.text=a,this.image=u,this.scale=c,this.fontStack=m,this.textColor=x},ma=function(a){this.sections=a};ma.fromString=function(a){return new ma([new cu(a,null,null,null,null)])},ma.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some(function(a){return a.text.length!==0||a.image&&a.image.name.length!==0})},ma.factory=function(a){return a instanceof ma?a:ma.fromString(a)},ma.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(a){return a.text}).join("")},ma.prototype.serialize=function(){for(var a=["format"],u=0,c=this.sections;u=0&&a<=255&&typeof u=="number"&&u>=0&&u<=255&&typeof c=="number"&&c>=0&&c<=255?m===void 0||typeof m=="number"&&m>=0&&m<=1?null:"Invalid rgba value ["+[a,u,c,m].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof m=="number"?[a,u,c,m]:[a,u,c]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function os(a){if(a===null||typeof a=="string"||typeof a=="boolean"||typeof a=="number"||a instanceof wi||a instanceof Pa||a instanceof ma||a instanceof Aa)return!0;if(Array.isArray(a)){for(var u=0,c=a;u2){var I=a[1];if(typeof I!="string"||!(I in Ao)||I==="object")return u.error('The item type argument of "array" must be one of string, number, boolean',1);E=Ao[I],m++}else E=tn;if(a.length>3){if(a[2]!==null&&(typeof a[2]!="number"||a[2]<0||a[2]!==Math.floor(a[2])))return u.error('The length argument to "array" must be a positive integer literal',2);A=a[2],m++}c=zi(E,A)}else c=Ao[x];for(var D=[];m1)&&u.push(m)}}return u.concat(this.args.map(function(x){return x.serialize()}))};var $o=function(a){this.type=qi,this.sections=a};$o.parse=function(a,u){if(a.length<2)return u.error("Expected at least one argument.");var c=a[1];if(!Array.isArray(c)&&typeof c=="object")return u.error("First argument must be an image or text section.");for(var m=[],x=!1,E=1;E<=a.length-1;++E){var A=a[E];if(x&&typeof A=="object"&&!Array.isArray(A)){x=!1;var I=null;if(A["font-scale"]&&!(I=u.parse(A["font-scale"],1,sr)))return null;var D=null;if(A["text-font"]&&!(D=u.parse(A["text-font"],1,zi(en))))return null;var N=null;if(A["text-color"]&&!(N=u.parse(A["text-color"],1,Yr)))return null;var H=m[m.length-1];H.scale=I,H.font=D,H.textColor=N}else{var X=u.parse(a[E],1,tn);if(!X)return null;var ne=X.type.kind;if(ne!=="string"&&ne!=="value"&&ne!=="null"&&ne!=="resolvedImage")return u.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");x=!0,m.push({content:X,scale:null,font:null,textColor:null})}}return new $o(m)},$o.prototype.evaluate=function(a){return new ma(this.sections.map(function(u){var c=u.content.evaluate(a);return Ta(c)===ci?new cu("",c,null,null,null):new cu(fi(c),null,u.scale?u.scale.evaluate(a):null,u.font?u.font.evaluate(a).join(","):null,u.textColor?u.textColor.evaluate(a):null)}))},$o.prototype.eachChild=function(a){for(var u=0,c=this.sections;u-1),c},Vo.prototype.eachChild=function(a){a(this.input)},Vo.prototype.outputDefined=function(){return!1},Vo.prototype.serialize=function(){return["image",this.input.serialize()]};var Ru={"to-boolean":Wr,"to-color":Yr,"to-number":sr,"to-string":en},ss=function(a,u){this.type=a,this.args=u};ss.parse=function(a,u){if(a.length<2)return u.error("Expected at least one argument.");var c=a[0];if((c==="to-boolean"||c==="to-string")&&a.length!==2)return u.error("Expected one argument.");for(var m=Ru[c],x=[],E=1;E4?"Invalid rbga value "+JSON.stringify(u)+": expected an array containing either three or four numeric values.":$l(u[0],u[1],u[2],u[3])))return new wi(u[0]/255,u[1]/255,u[2]/255,u[3])}throw new sa(c||"Could not parse color from value '"+(typeof u=="string"?u:String(JSON.stringify(u)))+"'")}if(this.type.kind==="number"){for(var A=null,I=0,D=this.args;I=u[2]||a[1]<=u[1]||a[3]>=u[3])}function Re(a,u){var c=(180+a[0])/360,m=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a[1]*Math.PI/360)))/360,x=Math.pow(2,u.z);return[Math.round(c*x*8192),Math.round(m*x*8192)]}function ct(a,u,c){return u[1]>a[1]!=c[1]>a[1]&&a[0]<(c[0]-u[0])*(a[1]-u[1])/(c[1]-u[1])+u[0]}function or(a,u){for(var c,m,x,E,A,I,D,N=!1,H=0,X=u.length;H0&&I<0||A<0&&I>0}function Hi(a,u,c){for(var m=0,x=c;mc[2]){var x=.5*m,E=a[0]-c[0]>x?-m:c[0]-a[0]>x?m:0;E===0&&(E=a[0]-c[2]>x?-m:c[2]-a[0]>x?m:0),a[0]+=E}Sn(u,a)}function Kh(a,u,c,m){for(var x=8192*Math.pow(2,m.z),E=[8192*m.x,8192*m.y],A=[],I=0,D=a;I=0)return!1;var c=!0;return a.eachChild(function(m){c&&!Mu(m,u)&&(c=!1)}),c}jo.parse=function(a,u){if(a.length!==2)return u.error("'within' expression requires exactly one argument, but found "+(a.length-1)+" instead.");if(os(a[1])){var c=a[1];if(c.type==="FeatureCollection")for(var m=0;mu))throw new sa("Input is not a number.");E=A-1}return 0}Qu.prototype.parse=function(a,u,c,m,x){return x===void 0&&(x={}),u?this.concat(u,c,m)._parse(a,x):this._parse(a,x)},Qu.prototype._parse=function(a,u){function c(N,H,X){return X==="assert"?new ha(H,[N]):X==="coerce"?new ss(H,[N]):N}if(a!==null&&typeof a!="string"&&typeof a!="boolean"&&typeof a!="number"||(a=["literal",a]),Array.isArray(a)){if(a.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var m=a[0];if(typeof m!="string")return this.error("Expression name must be a string, but found "+typeof m+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var x=this.registry[m];if(x){var E=x.parse(a,this);if(!E)return null;if(this.expectedType){var A=this.expectedType,I=E.type;if(A.kind!=="string"&&A.kind!=="number"&&A.kind!=="boolean"&&A.kind!=="object"&&A.kind!=="array"||I.kind!=="value")if(A.kind!=="color"&&A.kind!=="formatted"&&A.kind!=="resolvedImage"||I.kind!=="value"&&I.kind!=="string"){if(this.checkSubtype(A,I))return null}else E=c(E,A,u.typeAnnotation||"coerce");else E=c(E,A,u.typeAnnotation||"assert")}if(!(E instanceof Oa)&&E.type.kind!=="resolvedImage"&&function N(H){if(H instanceof Iu)return N(H.boundExpression);if(H instanceof ea&&H.name==="error"||H instanceof Kt||H instanceof jo)return!1;var X=H instanceof ss||H instanceof ha,ne=!0;return H.eachChild(function(R){ne=X?ne&&N(R):ne&&R instanceof Oa}),!!ne&&xl(H)&&Mu(H,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(E)){var D=new Ea;try{E=new Oa(E.type,E.evaluate(D))}catch(N){return this.error(N.message),null}}return E}return this.error('Unknown expression "'+m+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(a===void 0?"'undefined' value invalid. Use null instead.":typeof a=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof a+" instead.")},Qu.prototype.concat=function(a,u,c){var m=typeof a=="number"?this.path.concat(a):this.path,x=c?this.scope.concat(c):this.scope;return new Qu(this.registry,m,u||null,x,this.errors)},Qu.prototype.error=function(a){for(var u=[],c=arguments.length-1;c-- >0;)u[c]=arguments[c+1];var m=""+this.key+u.map(function(x){return"["+x+"]"}).join("");this.errors.push(new wr(m,a))},Qu.prototype.checkSubtype=function(a,u){var c=Ji(a,u);return c&&this.error(c),c};var Os=function(a,u,c){this.type=a,this.input=u,this.labels=[],this.outputs=[];for(var m=0,x=c;m=A)return u.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',D);var H=u.parse(I,N,x);if(!H)return null;x=x||H.type,m.push([A,H])}return new Os(x,c,m)},Os.prototype.evaluate=function(a){var u=this.labels,c=this.outputs;if(u.length===1)return c[0].evaluate(a);var m=this.input.evaluate(a);if(m<=u[0])return c[0].evaluate(a);var x=u.length;return m>=u[x-1]?c[x-1].evaluate(a):c[Qc(u,m)].evaluate(a)},Os.prototype.eachChild=function(a){a(this.input);for(var u=0,c=this.outputs;u0&&a.push(this.labels[u]),a.push(this.outputs[u].serialize());return a};var El=Object.freeze({__proto__:null,number:qa,color:function(a,u,c){return new wi(qa(a.r,u.r,c),qa(a.g,u.g,c),qa(a.b,u.b,c),qa(a.a,u.a,c))},array:function(a,u,c){return a.map(function(m,x){return qa(m,u[x],c)})}}),Ju=6/29*3*(6/29),Rf=Math.PI/180,Qh=180/Math.PI;function Mf(a){return a>.008856451679035631?Math.pow(a,1/3):a/Ju+4/29}function ph(a){return a>6/29?a*a*a:Ju*(a-4/29)}function dh(a){return 255*(a<=.0031308?12.92*a:1.055*Math.pow(a,1/2.4)-.055)}function vh(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function Jh(a){var u=vh(a.r),c=vh(a.g),m=vh(a.b),x=Mf((.4124564*u+.3575761*c+.1804375*m)/.95047),E=Mf((.2126729*u+.7151522*c+.072175*m)/1);return{l:116*E-16,a:500*(x-E),b:200*(E-Mf((.0193339*u+.119192*c+.9503041*m)/1.08883)),alpha:a.a}}function ep(a){var u=(a.l+16)/116,c=isNaN(a.a)?u:u+a.a/500,m=isNaN(a.b)?u:u-a.b/200;return u=1*ph(u),c=.95047*ph(c),m=1.08883*ph(m),new wi(dh(3.2404542*c-1.5371385*u-.4985314*m),dh(-.969266*c+1.8760108*u+.041556*m),dh(.0556434*c-.2040259*u+1.0572252*m),a.alpha)}function Zp(a,u,c){var m=u-a;return a+c*(m>180||m<-180?m-360*Math.round(m/360):m)}var Jc={forward:Jh,reverse:ep,interpolate:function(a,u,c){return{l:qa(a.l,u.l,c),a:qa(a.a,u.a,c),b:qa(a.b,u.b,c),alpha:qa(a.alpha,u.alpha,c)}}},Pu={forward:function(a){var u=Jh(a),c=u.l,m=u.a,x=u.b,E=Math.atan2(x,m)*Qh;return{h:E<0?E+360:E,c:Math.sqrt(m*m+x*x),l:c,alpha:a.a}},reverse:function(a){var u=a.h*Rf,c=a.c;return ep({l:a.l,a:Math.cos(u)*c,b:Math.sin(u)*c,alpha:a.alpha})},interpolate:function(a,u,c){return{h:Zp(a.h,u.h,c),c:qa(a.c,u.c,c),l:qa(a.l,u.l,c),alpha:qa(a.alpha,u.alpha,c)}}},tp=Object.freeze({__proto__:null,lab:Jc,hcl:Pu}),Ho=function(a,u,c,m,x){this.type=a,this.operator=u,this.interpolation=c,this.input=m,this.labels=[],this.outputs=[];for(var E=0,A=x;E1}))return u.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);m={name:"cubic-bezier",controlPoints:I}}if(a.length-1<4)return u.error("Expected at least 4 arguments, but found only "+(a.length-1)+".");if((a.length-1)%2!=0)return u.error("Expected an even number of arguments.");if(!(x=u.parse(x,2,sr)))return null;var D=[],N=null;c==="interpolate-hcl"||c==="interpolate-lab"?N=Yr:u.expectedType&&u.expectedType.kind!=="value"&&(N=u.expectedType);for(var H=0;H=X)return u.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',R);var Be=u.parse(ne,Pe,N);if(!Be)return null;N=N||Be.type,D.push([X,Be])}return N.kind==="number"||N.kind==="color"||N.kind==="array"&&N.itemType.kind==="number"&&typeof N.N=="number"?new Ho(N,c,m,x,D):u.error("Type "+Ai(N)+" is not interpolatable.")},Ho.prototype.evaluate=function(a){var u=this.labels,c=this.outputs;if(u.length===1)return c[0].evaluate(a);var m=this.input.evaluate(a);if(m<=u[0])return c[0].evaluate(a);var x=u.length;if(m>=u[x-1])return c[x-1].evaluate(a);var E=Qc(u,m),A=Ho.interpolationFactor(this.interpolation,m,u[E],u[E+1]),I=c[E].evaluate(a),D=c[E+1].evaluate(a);return this.operator==="interpolate"?El[this.type.kind.toLowerCase()](I,D,A):this.operator==="interpolate-hcl"?Pu.reverse(Pu.interpolate(Pu.forward(I),Pu.forward(D),A)):Jc.reverse(Jc.interpolate(Jc.forward(I),Jc.forward(D),A))},Ho.prototype.eachChild=function(a){a(this.input);for(var u=0,c=this.outputs;u=c.length)throw new sa("Array index out of bounds: "+u+" > "+(c.length-1)+".");if(u!==Math.floor(u))throw new sa("Array index must be an integer, but found "+u+" instead.");return c[u]},Al.prototype.eachChild=function(a){a(this.index),a(this.input)},Al.prototype.outputDefined=function(){return!1},Al.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var oi=function(a,u){this.type=Wr,this.needle=a,this.haystack=u};oi.parse=function(a,u){if(a.length!==3)return u.error("Expected 2 arguments, but found "+(a.length-1)+" instead.");var c=u.parse(a[1],1,tn),m=u.parse(a[2],2,tn);return c&&m?Ia(c.type,[Wr,en,sr,sn,tn])?new oi(c,m):u.error("Expected first argument to be of type boolean, string, number or null, but found "+Ai(c.type)+" instead"):null},oi.prototype.evaluate=function(a){var u=this.needle.evaluate(a),c=this.haystack.evaluate(a);if(!c)return!1;if(!Ti(u,["boolean","string","number","null"]))throw new sa("Expected first argument to be of type boolean, string, number or null, but found "+Ai(Ta(u))+" instead.");if(!Ti(c,["string","array"]))throw new sa("Expected second argument to be of type array or string, but found "+Ai(Ta(c))+" instead.");return c.indexOf(u)>=0},oi.prototype.eachChild=function(a){a(this.needle),a(this.haystack)},oi.prototype.outputDefined=function(){return!0},oi.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var el=function(a,u,c){this.type=sr,this.needle=a,this.haystack=u,this.fromIndex=c};el.parse=function(a,u){if(a.length<=2||a.length>=5)return u.error("Expected 3 or 4 arguments, but found "+(a.length-1)+" instead.");var c=u.parse(a[1],1,tn),m=u.parse(a[2],2,tn);if(!c||!m)return null;if(!Ia(c.type,[Wr,en,sr,sn,tn]))return u.error("Expected first argument to be of type boolean, string, number or null, but found "+Ai(c.type)+" instead");if(a.length===4){var x=u.parse(a[3],3,sr);return x?new el(c,m,x):null}return new el(c,m)},el.prototype.evaluate=function(a){var u=this.needle.evaluate(a),c=this.haystack.evaluate(a);if(!Ti(u,["boolean","string","number","null"]))throw new sa("Expected first argument to be of type boolean, string, number or null, but found "+Ai(Ta(u))+" instead.");if(!Ti(c,["string","array"]))throw new sa("Expected second argument to be of type array or string, but found "+Ai(Ta(c))+" instead.");if(this.fromIndex){var m=this.fromIndex.evaluate(a);return c.indexOf(u,m)}return c.indexOf(u)},el.prototype.eachChild=function(a){a(this.needle),a(this.haystack),this.fromIndex&&a(this.fromIndex)},el.prototype.outputDefined=function(){return!1},el.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var a=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),a]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Ds=function(a,u,c,m,x,E){this.inputType=a,this.type=u,this.input=c,this.cases=m,this.outputs=x,this.otherwise=E};Ds.parse=function(a,u){if(a.length<5)return u.error("Expected at least 4 arguments, but found only "+(a.length-1)+".");if(a.length%2!=1)return u.error("Expected an even number of arguments.");var c,m;u.expectedType&&u.expectedType.kind!=="value"&&(m=u.expectedType);for(var x={},E=[],A=2;ANumber.MAX_SAFE_INTEGER)return N.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof ne=="number"&&Math.floor(ne)!==ne)return N.error("Numeric branch labels must be integer values.");if(c){if(N.checkSubtype(c,Ta(ne)))return null}else c=Ta(ne);if(x[String(ne)]!==void 0)return N.error("Branch labels must be unique.");x[String(ne)]=E.length}var R=u.parse(D,A,m);if(!R)return null;m=m||R.type,E.push(R)}var Pe=u.parse(a[1],1,tn);if(!Pe)return null;var Be=u.parse(a[a.length-1],a.length-1,m);return Be?Pe.type.kind!=="value"&&u.concat(1).checkSubtype(c,Pe.type)?null:new Ds(c,m,Pe,x,E,Be):null},Ds.prototype.evaluate=function(a){var u=this.input.evaluate(a);return(Ta(u)===this.inputType&&this.outputs[this.cases[u]]||this.otherwise).evaluate(a)},Ds.prototype.eachChild=function(a){a(this.input),this.outputs.forEach(a),a(this.otherwise)},Ds.prototype.outputDefined=function(){return this.outputs.every(function(a){return a.outputDefined()})&&this.otherwise.outputDefined()},Ds.prototype.serialize=function(){for(var a=this,u=["match",this.input.serialize()],c=[],m={},x=0,E=Object.keys(this.cases).sort();x=5)return u.error("Expected 3 or 4 arguments, but found "+(a.length-1)+" instead.");var c=u.parse(a[1],1,tn),m=u.parse(a[2],2,sr);if(!c||!m)return null;if(!Ia(c.type,[zi(tn),en,tn]))return u.error("Expected first argument to be of type array or string, but found "+Ai(c.type)+" instead");if(a.length===4){var x=u.parse(a[3],3,sr);return x?new tl(c.type,c,m,x):null}return new tl(c.type,c,m)},tl.prototype.evaluate=function(a){var u=this.input.evaluate(a),c=this.beginIndex.evaluate(a);if(!Ti(u,["string","array"]))throw new sa("Expected first argument to be of type array or string, but found "+Ai(Ta(u))+" instead.");if(this.endIndex){var m=this.endIndex.evaluate(a);return u.slice(c,m)}return u.slice(c)},tl.prototype.eachChild=function(a){a(this.input),a(this.beginIndex),this.endIndex&&a(this.endIndex)},tl.prototype.outputDefined=function(){return!1},tl.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var a=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),a]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var fu=Ii("==",function(a,u,c){return u===c},ta),Du=Ii("!=",function(a,u,c){return u!==c},function(a,u,c,m){return!ta(0,u,c,m)}),mh=Ii("<",function(a,u,c){return u",function(a,u,c){return u>c},function(a,u,c,m){return m.compare(u,c)>0}),ef=Ii("<=",function(a,u,c){return u<=c},function(a,u,c,m){return m.compare(u,c)<=0}),Vp=Ii(">=",function(a,u,c){return u>=c},function(a,u,c,m){return m.compare(u,c)>=0}),xs=function(a,u,c,m,x){this.type=en,this.number=a,this.locale=u,this.currency=c,this.minFractionDigits=m,this.maxFractionDigits=x};xs.parse=function(a,u){if(a.length!==3)return u.error("Expected two arguments.");var c=u.parse(a[1],1,sr);if(!c)return null;var m=a[2];if(typeof m!="object"||Array.isArray(m))return u.error("NumberFormat options argument must be an object.");var x=null;if(m.locale&&!(x=u.parse(m.locale,1,en)))return null;var E=null;if(m.currency&&!(E=u.parse(m.currency,1,en)))return null;var A=null;if(m["min-fraction-digits"]&&!(A=u.parse(m["min-fraction-digits"],1,sr)))return null;var I=null;return m["max-fraction-digits"]&&!(I=u.parse(m["max-fraction-digits"],1,sr))?null:new xs(c,x,E,A,I)},xs.prototype.evaluate=function(a){return new Intl.NumberFormat(this.locale?this.locale.evaluate(a):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(a):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(a):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(a):void 0}).format(this.number.evaluate(a))},xs.prototype.eachChild=function(a){a(this.number),this.locale&&a(this.locale),this.currency&&a(this.currency),this.minFractionDigits&&a(this.minFractionDigits),this.maxFractionDigits&&a(this.maxFractionDigits)},xs.prototype.outputDefined=function(){return!1},xs.prototype.serialize=function(){var a={};return this.locale&&(a.locale=this.locale.serialize()),this.currency&&(a.currency=this.currency.serialize()),this.minFractionDigits&&(a["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(a["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),a]};var Fu=function(a){this.type=sr,this.input=a};Fu.parse=function(a,u){if(a.length!==2)return u.error("Expected 1 argument, but found "+(a.length-1)+" instead.");var c=u.parse(a[1],1);return c?c.type.kind!=="array"&&c.type.kind!=="string"&&c.type.kind!=="value"?u.error("Expected argument of type string or array, but found "+Ai(c.type)+" instead."):new Fu(c):null},Fu.prototype.evaluate=function(a){var u=this.input.evaluate(a);if(typeof u=="string"||Array.isArray(u))return u.length;throw new sa("Expected value to be of type string or array, but found "+Ai(Ta(u))+" instead.")},Fu.prototype.eachChild=function(a){a(this.input)},Fu.prototype.outputDefined=function(){return!1},Fu.prototype.serialize=function(){var a=["length"];return this.eachChild(function(u){a.push(u.serialize())}),a};var ku={"==":fu,"!=":Du,">":Ha,"<":mh,">=":Vp,"<=":ef,array:ha,at:Al,boolean:ha,case:Ou,coalesce:Sl,collator:Kt,format:$o,image:Vo,in:oi,"index-of":el,interpolate:Ho,"interpolate-hcl":Ho,"interpolate-lab":Ho,length:Fu,let:$s,literal:Oa,match:Ds,number:ha,"number-format":xs,object:ha,slice:tl,step:Os,string:ha,"to-boolean":ss,"to-color":ss,"to-number":ss,"to-string":ss,var:Iu,within:jo};function ql(a,u){var c=u[0],m=u[1],x=u[2],E=u[3];c=c.evaluate(a),m=m.evaluate(a),x=x.evaluate(a);var A=E?E.evaluate(a):1,I=$l(c,m,x,A);if(I)throw new sa(I);return new wi(c/255*A,m/255*A,x/255*A,A)}function If(a,u){return a in u}function wa(a,u){var c=u[a];return c===void 0?null:c}function Qs(a){return{type:a}}function Rc(a){return{result:"success",value:a}}function Kl(a){return{result:"error",value:a}}function rl(a){return a["property-type"]==="data-driven"||a["property-type"]==="cross-faded-data-driven"}function gh(a){return!!a.expression&&a.expression.parameters.indexOf("zoom")>-1}function Ql(a){return!!a.expression&&a.expression.interpolated}function ca(a){return a instanceof Number?"number":a instanceof String?"string":a instanceof Boolean?"boolean":Array.isArray(a)?"array":a===null?"null":typeof a}function tf(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function np(a){return a}function Tl(a,u,c){return a!==void 0?a:u!==void 0?u:c!==void 0?c:void 0}function Jl(a,u,c,m,x){return Tl(typeof c===x?m[c]:void 0,a.default,u.default)}function _h(a,u,c){if(ca(c)!=="number")return Tl(a.default,u.default);var m=a.stops.length;if(m===1||c<=a.stops[0][0])return a.stops[0][1];if(c>=a.stops[m-1][0])return a.stops[m-1][1];var x=Qc(a.stops.map(function(E){return E[0]}),c);return a.stops[x][1]}function Pf(a,u,c){var m=a.base!==void 0?a.base:1;if(ca(c)!=="number")return Tl(a.default,u.default);var x=a.stops.length;if(x===1||c<=a.stops[0][0])return a.stops[0][1];if(c>=a.stops[x-1][0])return a.stops[x-1][1];var E=Qc(a.stops.map(function(X){return X[0]}),c),A=function(X,ne,R,Pe){var Be=Pe-R,rt=X-R;return Be===0?0:ne===1?rt/Be:(Math.pow(ne,rt)-1)/(Math.pow(ne,Be)-1)}(c,m,a.stops[E][0],a.stops[E+1][0]),I=a.stops[E][1],D=a.stops[E+1][1],N=El[u.type]||np;if(a.colorSpace&&a.colorSpace!=="rgb"){var H=tp[a.colorSpace];N=function(X,ne){return H.reverse(H.interpolate(H.forward(X),H.forward(ne),A))}}return typeof I.evaluate=="function"?{evaluate:function(){for(var X=[],ne=arguments.length;ne--;)X[ne]=arguments[ne];var R=I.evaluate.apply(void 0,X),Pe=D.evaluate.apply(void 0,X);if(R!==void 0&&Pe!==void 0)return N(R,Pe,A)}}:N(I,D,A)}function wl(a,u,c){return u.type==="color"?c=wi.parse(c):u.type==="formatted"?c=ma.fromString(c.toString()):u.type==="resolvedImage"?c=Aa.fromString(c.toString()):ca(c)===u.type||u.type==="enum"&&u.values[c]||(c=void 0),Tl(c,a.default,u.default)}ea.register(ku,{error:[{kind:"error"},[en],function(a,u){throw new sa(u[0].evaluate(a))}],typeof:[en,[tn],function(a,u){return Ai(Ta(u[0].evaluate(a)))}],"to-rgba":[zi(sr,4),[Yr],function(a,u){return u[0].evaluate(a).toArray()}],rgb:[Yr,[sr,sr,sr],ql],rgba:[Yr,[sr,sr,sr,sr],ql],has:{type:Wr,overloads:[[[en],function(a,u){return If(u[0].evaluate(a),a.properties())}],[[en,pi],function(a,u){var c=u[1];return If(u[0].evaluate(a),c.evaluate(a))}]]},get:{type:tn,overloads:[[[en],function(a,u){return wa(u[0].evaluate(a),a.properties())}],[[en,pi],function(a,u){var c=u[1];return wa(u[0].evaluate(a),c.evaluate(a))}]]},"feature-state":[tn,[en],function(a,u){return wa(u[0].evaluate(a),a.featureState||{})}],properties:[pi,[],function(a){return a.properties()}],"geometry-type":[en,[],function(a){return a.geometryType()}],id:[tn,[],function(a){return a.id()}],zoom:[sr,[],function(a){return a.globals.zoom}],"heatmap-density":[sr,[],function(a){return a.globals.heatmapDensity||0}],"line-progress":[sr,[],function(a){return a.globals.lineProgress||0}],accumulated:[tn,[],function(a){return a.globals.accumulated===void 0?null:a.globals.accumulated}],"+":[sr,Qs(sr),function(a,u){for(var c=0,m=0,x=u;m":[Wr,[en,tn],function(a,u){var c=u[0],m=u[1],x=a.properties()[c.value],E=m.value;return typeof x==typeof E&&x>E}],"filter-id->":[Wr,[tn],function(a,u){var c=u[0],m=a.id(),x=c.value;return typeof m==typeof x&&m>x}],"filter-<=":[Wr,[en,tn],function(a,u){var c=u[0],m=u[1],x=a.properties()[c.value],E=m.value;return typeof x==typeof E&&x<=E}],"filter-id-<=":[Wr,[tn],function(a,u){var c=u[0],m=a.id(),x=c.value;return typeof m==typeof x&&m<=x}],"filter->=":[Wr,[en,tn],function(a,u){var c=u[0],m=u[1],x=a.properties()[c.value],E=m.value;return typeof x==typeof E&&x>=E}],"filter-id->=":[Wr,[tn],function(a,u){var c=u[0],m=a.id(),x=c.value;return typeof m==typeof x&&m>=x}],"filter-has":[Wr,[tn],function(a,u){return u[0].value in a.properties()}],"filter-has-id":[Wr,[],function(a){return a.id()!==null&&a.id()!==void 0}],"filter-type-in":[Wr,[zi(en)],function(a,u){return u[0].value.indexOf(a.geometryType())>=0}],"filter-id-in":[Wr,[zi(tn)],function(a,u){return u[0].value.indexOf(a.id())>=0}],"filter-in-small":[Wr,[en,zi(tn)],function(a,u){var c=u[0];return u[1].value.indexOf(a.properties()[c.value])>=0}],"filter-in-large":[Wr,[en,zi(tn)],function(a,u){var c=u[0],m=u[1];return function(x,E,A,I){for(;A<=I;){var D=A+I>>1;if(E[D]===x)return!0;E[D]>x?I=D-1:A=D+1}return!1}(a.properties()[c.value],m.value,0,m.value.length-1)}],all:{type:Wr,overloads:[[[Wr,Wr],function(a,u){var c=u[1];return u[0].evaluate(a)&&c.evaluate(a)}],[Qs(Wr),function(a,u){for(var c=0,m=u;c0&&typeof a[0]=="string"&&a[0]in ku}function rf(a,u){var c=new Qu(ku,[],u?function(x){var E={color:Yr,string:en,number:sr,enum:en,boolean:Wr,formatted:qi,resolvedImage:ci};return x.type==="array"?zi(E[x.value]||tn,x.length):E[x.type]}(u):void 0),m=c.parse(a,void 0,void 0,void 0,u&&u.type==="string"?{typeAnnotation:"coerce"}:void 0);return m?Rc(new hu(m,u)):Kl(c.errors)}hu.prototype.evaluateWithoutErrorHandling=function(a,u,c,m,x,E){return this._evaluator.globals=a,this._evaluator.feature=u,this._evaluator.featureState=c,this._evaluator.canonical=m,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=E,this.expression.evaluate(this._evaluator)},hu.prototype.evaluate=function(a,u,c,m,x,E){this._evaluator.globals=a,this._evaluator.feature=u||null,this._evaluator.featureState=c||null,this._evaluator.canonical=m,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=E||null;try{var A=this.expression.evaluate(this._evaluator);if(A==null||typeof A=="number"&&A!=A)return this._defaultValue;if(this._enumValues&&!(A in this._enumValues))throw new sa("Expected value to be one of "+Object.keys(this._enumValues).map(function(I){return JSON.stringify(I)}).join(", ")+", but found "+JSON.stringify(A)+" instead.");return A}catch(I){return this._warningHistory[I.message]||(this._warningHistory[I.message]=!0,typeof console!="undefined"&&console.warn(I.message)),this._defaultValue}};var ec=function(a,u){this.kind=a,this._styleExpression=u,this.isStateDependent=a!=="constant"&&!bl(u.expression)};ec.prototype.evaluateWithoutErrorHandling=function(a,u,c,m,x,E){return this._styleExpression.evaluateWithoutErrorHandling(a,u,c,m,x,E)},ec.prototype.evaluate=function(a,u,c,m,x,E){return this._styleExpression.evaluate(a,u,c,m,x,E)};var tc=function(a,u,c,m){this.kind=a,this.zoomStops=c,this._styleExpression=u,this.isStateDependent=a!=="camera"&&!bl(u.expression),this.interpolationType=m};function ip(a,u){if((a=rf(a,u)).result==="error")return a;var c=a.value.expression,m=xl(c);if(!m&&!rl(u))return Kl([new wr("","data expressions not supported")]);var x=Mu(c,["zoom"]);if(!x&&!gh(u))return Kl([new wr("","zoom expressions not supported")]);var E=function A(I){var D=null;if(I instanceof $s)D=A(I.result);else if(I instanceof Sl)for(var N=0,H=I.args;Nm.maximum?[new Q(u,c,c+" is greater than the maximum value "+m.maximum)]:[]}function yh(a){var u,c,m,x=a.valueSpec,E=Ee(a.value.type),A={},I=E!=="categorical"&&a.value.property===void 0,D=!I,N=ca(a.value.stops)==="array"&&ca(a.value.stops[0])==="array"&&ca(a.value.stops[0][0])==="object",H=Js({key:a.key,value:a.value,valueSpec:a.styleSpec.function,style:a.style,styleSpec:a.styleSpec,objectElementValidators:{stops:function(R){if(E==="identity")return[new Q(R.key,R.value,'identity function may not have a "stops" property')];var Pe=[],Be=R.value;return Pe=Pe.concat(nf({key:R.key,value:Be,valueSpec:R.valueSpec,style:R.style,styleSpec:R.styleSpec,arrayElementValidator:X})),ca(Be)==="array"&&Be.length===0&&Pe.push(new Q(R.key,Be,"array must have at least one stop")),Pe},default:function(R){return Li({key:R.key,value:R.value,valueSpec:x,style:R.style,styleSpec:R.styleSpec})}}});return E==="identity"&&I&&H.push(new Q(a.key,a.value,'missing required property "property"')),E==="identity"||a.value.stops||H.push(new Q(a.key,a.value,'missing required property "stops"')),E==="exponential"&&a.valueSpec.expression&&!Ql(a.valueSpec)&&H.push(new Q(a.key,a.value,"exponential functions not supported")),a.styleSpec.$version>=8&&(D&&!rl(a.valueSpec)?H.push(new Q(a.key,a.value,"property functions not supported")):I&&!gh(a.valueSpec)&&H.push(new Q(a.key,a.value,"zoom functions not supported"))),E!=="categorical"&&!N||a.value.property!==void 0||H.push(new Q(a.key,a.value,'"property" property is required')),H;function X(R){var Pe=[],Be=R.value,rt=R.key;if(ca(Be)!=="array")return[new Q(rt,Be,"array expected, "+ca(Be)+" found")];if(Be.length!==2)return[new Q(rt,Be,"array length 2 expected, length "+Be.length+" found")];if(N){if(ca(Be[0])!=="object")return[new Q(rt,Be,"object expected, "+ca(Be[0])+" found")];if(Be[0].zoom===void 0)return[new Q(rt,Be,"object stop key must have zoom")];if(Be[0].value===void 0)return[new Q(rt,Be,"object stop key must have value")];if(m&&m>Ee(Be[0].zoom))return[new Q(rt,Be[0].zoom,"stop zoom values must appear in ascending order")];Ee(Be[0].zoom)!==m&&(m=Ee(Be[0].zoom),c=void 0,A={}),Pe=Pe.concat(Js({key:rt+"[0]",value:Be[0],valueSpec:{zoom:{}},style:R.style,styleSpec:R.styleSpec,objectElementValidators:{zoom:Ic,value:ne}}))}else Pe=Pe.concat(ne({key:rt+"[0]",value:Be[0],valueSpec:{},style:R.style,styleSpec:R.styleSpec},Be));return Mc(ir(Be[1]))?Pe.concat([new Q(rt+"[1]",Be[1],"expressions are not allowed in function stops.")]):Pe.concat(Li({key:rt+"[1]",value:Be[1],valueSpec:x,style:R.style,styleSpec:R.styleSpec}))}function ne(R,Pe){var Be=ca(R.value),rt=Ee(R.value),Ge=R.value!==null?R.value:Pe;if(u){if(Be!==u)return[new Q(R.key,Ge,Be+" stop domain type must match previous stop domain type "+u)]}else u=Be;if(Be!=="number"&&Be!=="string"&&Be!=="boolean")return[new Q(R.key,Ge,"stop domain value must be a number, string, or boolean")];if(Be!=="number"&&E!=="categorical"){var St="number expected, "+Be+" found";return rl(x)&&E===void 0&&(St+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Q(R.key,Ge,St)]}return E!=="categorical"||Be!=="number"||isFinite(rt)&&Math.floor(rt)===rt?E!=="categorical"&&Be==="number"&&c!==void 0&&rt=2&&a[1]!=="$id"&&a[1]!=="$type";case"in":return a.length>=3&&(typeof a[1]!="string"||Array.isArray(a[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return a.length!==3||Array.isArray(a[1])||Array.isArray(a[2]);case"any":case"all":for(var u=0,c=a.slice(1);uu?1:0}function Of(a){if(!a)return!0;var u,c=a[0];return a.length<=1?c!=="any":c==="=="?xh(a[1],a[2],"=="):c==="!="?bh(xh(a[1],a[2],"==")):c==="<"||c===">"||c==="<="||c===">="?xh(a[1],a[2],c):c==="any"?(u=a.slice(1),["any"].concat(u.map(Of))):c==="all"?["all"].concat(a.slice(1).map(Of)):c==="none"?["all"].concat(a.slice(1).map(Of).map(bh)):c==="in"?Df(a[1],a.slice(2)):c==="!in"?bh(Df(a[1],a.slice(2))):c==="has"?Fo(a[1]):c==="!has"?bh(Fo(a[1])):c!=="within"||a}function xh(a,u,c){switch(a){case"$type":return["filter-type-"+c,u];case"$id":return["filter-id-"+c,u];default:return["filter-"+c,a,u]}}function Df(a,u){if(u.length===0)return!1;switch(a){case"$type":return["filter-type-in",["literal",u]];case"$id":return["filter-id-in",["literal",u]];default:return u.length>200&&!u.some(function(c){return typeof c!=typeof u[0]})?["filter-in-large",a,["literal",u.sort(Md)]]:["filter-in-small",a,["literal",u]]}}function Fo(a){switch(a){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",a]}}function bh(a){return["!",a]}function ap(a){return af(ir(a.value))?Cl(at({},a,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function u(c){var m=c.value,x=c.key;if(ca(m)!=="array")return[new Q(x,m,"array expected, "+ca(m)+" found")];var E,A=c.styleSpec,I=[];if(m.length<1)return[new Q(x,m,"filter array must have at least 1 element")];switch(I=I.concat(pu({key:x+"[0]",value:m[0],valueSpec:A.filter_operator,style:c.style,styleSpec:c.styleSpec})),Ee(m[0])){case"<":case"<=":case">":case">=":m.length>=2&&Ee(m[1])==="$type"&&I.push(new Q(x,m,'"$type" cannot be use with operator "'+m[0]+'"'));case"==":case"!=":m.length!==3&&I.push(new Q(x,m,'filter array for operator "'+m[0]+'" must have 3 elements'));case"in":case"!in":m.length>=2&&(E=ca(m[1]))!=="string"&&I.push(new Q(x+"[1]",m[1],"string expected, "+E+" found"));for(var D=2;D=H[R+0]&&m>=H[R+1])?(A[ne]=!0,E.push(N[ne])):A[ne]=!1}}},Wa.prototype._forEachCell=function(a,u,c,m,x,E,A,I){for(var D=this._convertToCellCoord(a),N=this._convertToCellCoord(u),H=this._convertToCellCoord(c),X=this._convertToCellCoord(m),ne=D;ne<=H;ne++)for(var R=N;R<=X;R++){var Pe=this.d*R+ne;if((!I||I(this._convertFromCellCoord(ne),this._convertFromCellCoord(R),this._convertFromCellCoord(ne+1),this._convertFromCellCoord(R+1)))&&x.call(this,a,u,c,m,Pe,E,A,I))return}},Wa.prototype._convertFromCellCoord=function(a){return(a-this.padding)/this.scale},Wa.prototype._convertToCellCoord=function(a){return Math.max(0,Math.min(this.d-1,Math.floor(a*this.scale)+this.padding))},Wa.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var a=this.cells,u=3+this.cells.length+1+1,c=0,m=0;m=0)){var H=a[N];D[N]=Ka[I].shallow.indexOf(N)>=0?H:us(H,u)}a instanceof Error&&(D.message=a.message)}if(D.$name)throw new Error("$name property is reserved for worker serialization logic.");return I!=="Object"&&(D.$name=I),D}throw new Error("can't serialize object of type "+typeof a)}function ga(a){if(a==null||typeof a=="boolean"||typeof a=="number"||typeof a=="string"||a instanceof Boolean||a instanceof Number||a instanceof String||a instanceof Date||a instanceof RegExp||uf(a)||rc(a)||ArrayBuffer.isView(a)||a instanceof al)return a;if(Array.isArray(a))return a.map(ga);if(typeof a=="object"){var u=a.$name||"Object",c=Ka[u].klass;if(!c)throw new Error("can't deserialize unregistered class "+u);if(c.deserialize)return c.deserialize(a);for(var m=Object.create(c.prototype),x=0,E=Object.keys(a);x=0?I:ga(I)}}return m}throw new Error("can't deserialize object of type "+typeof a)}var Th=function(){this.first=!0};Th.prototype.update=function(a,u){var c=Math.floor(a);return this.first?(this.first=!1,this.lastIntegerZoom=c,this.lastIntegerZoomTime=0,this.lastZoom=a,this.lastFloorZoom=c,!0):(this.lastFloorZoom>c?(this.lastIntegerZoom=c+1,this.lastIntegerZoomTime=u):this.lastFloorZoom=128&&a<=255},Arabic:function(a){return a>=1536&&a<=1791},"Arabic Supplement":function(a){return a>=1872&&a<=1919},"Arabic Extended-A":function(a){return a>=2208&&a<=2303},"Hangul Jamo":function(a){return a>=4352&&a<=4607},"Unified Canadian Aboriginal Syllabics":function(a){return a>=5120&&a<=5759},Khmer:function(a){return a>=6016&&a<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(a){return a>=6320&&a<=6399},"General Punctuation":function(a){return a>=8192&&a<=8303},"Letterlike Symbols":function(a){return a>=8448&&a<=8527},"Number Forms":function(a){return a>=8528&&a<=8591},"Miscellaneous Technical":function(a){return a>=8960&&a<=9215},"Control Pictures":function(a){return a>=9216&&a<=9279},"Optical Character Recognition":function(a){return a>=9280&&a<=9311},"Enclosed Alphanumerics":function(a){return a>=9312&&a<=9471},"Geometric Shapes":function(a){return a>=9632&&a<=9727},"Miscellaneous Symbols":function(a){return a>=9728&&a<=9983},"Miscellaneous Symbols and Arrows":function(a){return a>=11008&&a<=11263},"CJK Radicals Supplement":function(a){return a>=11904&&a<=12031},"Kangxi Radicals":function(a){return a>=12032&&a<=12255},"Ideographic Description Characters":function(a){return a>=12272&&a<=12287},"CJK Symbols and Punctuation":function(a){return a>=12288&&a<=12351},Hiragana:function(a){return a>=12352&&a<=12447},Katakana:function(a){return a>=12448&&a<=12543},Bopomofo:function(a){return a>=12544&&a<=12591},"Hangul Compatibility Jamo":function(a){return a>=12592&&a<=12687},Kanbun:function(a){return a>=12688&&a<=12703},"Bopomofo Extended":function(a){return a>=12704&&a<=12735},"CJK Strokes":function(a){return a>=12736&&a<=12783},"Katakana Phonetic Extensions":function(a){return a>=12784&&a<=12799},"Enclosed CJK Letters and Months":function(a){return a>=12800&&a<=13055},"CJK Compatibility":function(a){return a>=13056&&a<=13311},"CJK Unified Ideographs Extension A":function(a){return a>=13312&&a<=19903},"Yijing Hexagram Symbols":function(a){return a>=19904&&a<=19967},"CJK Unified Ideographs":function(a){return a>=19968&&a<=40959},"Yi Syllables":function(a){return a>=40960&&a<=42127},"Yi Radicals":function(a){return a>=42128&&a<=42191},"Hangul Jamo Extended-A":function(a){return a>=43360&&a<=43391},"Hangul Syllables":function(a){return a>=44032&&a<=55215},"Hangul Jamo Extended-B":function(a){return a>=55216&&a<=55295},"Private Use Area":function(a){return a>=57344&&a<=63743},"CJK Compatibility Ideographs":function(a){return a>=63744&&a<=64255},"Arabic Presentation Forms-A":function(a){return a>=64336&&a<=65023},"Vertical Forms":function(a){return a>=65040&&a<=65055},"CJK Compatibility Forms":function(a){return a>=65072&&a<=65103},"Small Form Variants":function(a){return a>=65104&&a<=65135},"Arabic Presentation Forms-B":function(a){return a>=65136&&a<=65279},"Halfwidth and Fullwidth Forms":function(a){return a>=65280&&a<=65519}};function ol(a){for(var u=0,c=a;u=65097&&a<=65103)||qr["CJK Compatibility Ideographs"](a)||qr["CJK Compatibility"](a)||qr["CJK Radicals Supplement"](a)||qr["CJK Strokes"](a)||!(!qr["CJK Symbols and Punctuation"](a)||a>=12296&&a<=12305||a>=12308&&a<=12319||a===12336)||qr["CJK Unified Ideographs Extension A"](a)||qr["CJK Unified Ideographs"](a)||qr["Enclosed CJK Letters and Months"](a)||qr["Hangul Compatibility Jamo"](a)||qr["Hangul Jamo Extended-A"](a)||qr["Hangul Jamo Extended-B"](a)||qr["Hangul Jamo"](a)||qr["Hangul Syllables"](a)||qr.Hiragana(a)||qr["Ideographic Description Characters"](a)||qr.Kanbun(a)||qr["Kangxi Radicals"](a)||qr["Katakana Phonetic Extensions"](a)||qr.Katakana(a)&&a!==12540||!(!qr["Halfwidth and Fullwidth Forms"](a)||a===65288||a===65289||a===65293||a>=65306&&a<=65310||a===65339||a===65341||a===65343||a>=65371&&a<=65503||a===65507||a>=65512&&a<=65519)||!(!qr["Small Form Variants"](a)||a>=65112&&a<=65118||a>=65123&&a<=65126)||qr["Unified Canadian Aboriginal Syllabics"](a)||qr["Unified Canadian Aboriginal Syllabics Extended"](a)||qr["Vertical Forms"](a)||qr["Yijing Hexagram Symbols"](a)||qr["Yi Syllables"](a)||qr["Yi Radicals"](a))))}function wh(a){return!(Dc(a)||function(u){return!!(qr["Latin-1 Supplement"](u)&&(u===167||u===169||u===174||u===177||u===188||u===189||u===190||u===215||u===247)||qr["General Punctuation"](u)&&(u===8214||u===8224||u===8225||u===8240||u===8241||u===8251||u===8252||u===8258||u===8263||u===8264||u===8265||u===8273)||qr["Letterlike Symbols"](u)||qr["Number Forms"](u)||qr["Miscellaneous Technical"](u)&&(u>=8960&&u<=8967||u>=8972&&u<=8991||u>=8996&&u<=9e3||u===9003||u>=9085&&u<=9114||u>=9150&&u<=9165||u===9167||u>=9169&&u<=9179||u>=9186&&u<=9215)||qr["Control Pictures"](u)&&u!==9251||qr["Optical Character Recognition"](u)||qr["Enclosed Alphanumerics"](u)||qr["Geometric Shapes"](u)||qr["Miscellaneous Symbols"](u)&&!(u>=9754&&u<=9759)||qr["Miscellaneous Symbols and Arrows"](u)&&(u>=11026&&u<=11055||u>=11088&&u<=11097||u>=11192&&u<=11243)||qr["CJK Symbols and Punctuation"](u)||qr.Katakana(u)||qr["Private Use Area"](u)||qr["CJK Compatibility Forms"](u)||qr["Small Form Variants"](u)||qr["Halfwidth and Fullwidth Forms"](u)||u===8734||u===8756||u===8757||u>=9984&&u<=10087||u>=10102&&u<=10131||u===65532||u===65533)}(a))}function eu(a){return a>=1424&&a<=2303||qr["Arabic Presentation Forms-A"](a)||qr["Arabic Presentation Forms-B"](a)}function Bs(a,u){return!(!u&&eu(a)||a>=2304&&a<=3583||a>=3840&&a<=4255||qr.Khmer(a))}function Nf(a){for(var u=0,c=a;u-1&&(Yo="error"),Uf&&Uf(a)};function Il(){lf.fire(new Oe("pluginStateChange",{pluginStatus:Yo,pluginURL:Lu}))}var lf=new pt,up=function(){return Yo},Pt=function(){if(Yo!=="deferred"||!Lu)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Yo="loading",Il(),Lu&&Is({url:Lu},function(a){a?sp(a):(Yo="loaded",Il())})},Fe={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Yo==="loaded"||Fe.applyArabicShaping!=null},isLoading:function(){return Yo==="loading"},setState:function(a){Yo=a.pluginStatus,Lu=a.pluginURL},isParsed:function(){return Fe.applyArabicShaping!=null&&Fe.processBidirectionalText!=null&&Fe.processStyledBidirectionalText!=null},getPluginURL:function(){return Lu}},B=function(a,u){this.zoom=a,u?(this.now=u.now,this.fadeDuration=u.fadeDuration,this.zoomHistory=u.zoomHistory,this.transition=u.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Th,this.transition={})};B.prototype.isSupportedScript=function(a){return function(u,c){for(var m=0,x=u;mthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:u+(1-u)*c}:{fromScale:.5,toScale:1,t:1-(1-c)*u}};var qs=function(a,u){this.property=a,this.value=u,this.expression=function(c,m){if(tf(c))return new nl(c,m);if(Mc(c)){var x=ip(c,m);if(x.result==="error")throw new Error(x.value.map(function(A){return A.key+": "+A.message}).join(", "));return x.value}var E=c;return typeof c=="string"&&m.type==="color"&&(E=wi.parse(c)),{kind:"constant",evaluate:function(){return E}}}(u===void 0?a.specification.default:u,a.specification)};qs.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},qs.prototype.possiblyEvaluate=function(a,u,c){return this.property.possiblyEvaluate(this,a,u,c)};var ge=function(a){this.property=a,this.value=new qs(a,void 0)};ge.prototype.transitioned=function(a,u){return new io(this.property,this.value,u,Zt({},a.transition,this.transition),a.now)},ge.prototype.untransitioned=function(){return new io(this.property,this.value,null,{},0)};var Bo=function(a){this._properties=a,this._values=Object.create(a.defaultTransitionablePropertyValues)};Bo.prototype.getValue=function(a){return ut(this._values[a].value.value)},Bo.prototype.setValue=function(a,u){this._values.hasOwnProperty(a)||(this._values[a]=new ge(this._values[a].property)),this._values[a].value=new qs(this._values[a].property,u===null?void 0:ut(u))},Bo.prototype.getTransition=function(a){return ut(this._values[a].transition)},Bo.prototype.setTransition=function(a,u){this._values.hasOwnProperty(a)||(this._values[a]=new ge(this._values[a].property)),this._values[a].transition=ut(u)||void 0},Bo.prototype.serialize=function(){for(var a={},u=0,c=Object.keys(this._values);uthis.end)return this.prior=null,x;if(this.value.isDataDriven())return this.prior=null,x;if(m=1)return 1;var D=I*I,N=D*I;return 4*(I<.5?N:3*(I-D)+N-.75)}(A))}return x};var vu=function(a){this._properties=a,this._values=Object.create(a.defaultTransitioningPropertyValues)};vu.prototype.possiblyEvaluate=function(a,u,c){for(var m=new nc(this._properties),x=0,E=Object.keys(this._values);xE.zoomHistory.lastIntegerZoom?{from:c,to:m}:{from:x,to:m}},u.prototype.interpolate=function(c){return c},u}(yn),qo=function(a){this.specification=a};qo.prototype.possiblyEvaluate=function(a,u,c,m){if(a.value!==void 0){if(a.expression.kind==="constant"){var x=a.expression.evaluate(u,null,{},c,m);return this._calculate(x,x,x,u)}return this._calculate(a.expression.evaluate(new B(Math.floor(u.zoom-1),u)),a.expression.evaluate(new B(Math.floor(u.zoom),u)),a.expression.evaluate(new B(Math.floor(u.zoom+1),u)),u)}},qo.prototype._calculate=function(a,u,c,m){return m.zoom>m.zoomHistory.lastIntegerZoom?{from:a,to:u}:{from:c,to:u}},qo.prototype.interpolate=function(a){return a};var mu=function(a){this.specification=a};mu.prototype.possiblyEvaluate=function(a,u,c,m){return!!a.expression.evaluate(u,null,{},c,m)},mu.prototype.interpolate=function(){return!1};var Fa=function(a){for(var u in this.properties=a,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],a){var c=a[u];c.specification.overridable&&this.overridableProperties.push(u);var m=this.defaultPropertyValues[u]=new qs(c,void 0),x=this.defaultTransitionablePropertyValues[u]=new ge(c);this.defaultTransitioningPropertyValues[u]=x.untransitioned(),this.defaultPossiblyEvaluatedValues[u]=m.possiblyEvaluate({})}};_n("DataDrivenProperty",yn),_n("DataConstantProperty",kn),_n("CrossFadedDataDrivenProperty",Ls),_n("CrossFadedProperty",qo),_n("ColorRampProperty",mu);var Ns=function(a){function u(c,m){if(a.call(this),this.id=c.id,this.type=c.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},c.type!=="custom"&&(this.metadata=(c=c).metadata,this.minzoom=c.minzoom,this.maxzoom=c.maxzoom,c.type!=="background"&&(this.source=c.source,this.sourceLayer=c["source-layer"],this.filter=c.filter),m.layout&&(this._unevaluatedLayout=new bs(m.layout)),m.paint)){for(var x in this._transitionablePaint=new Bo(m.paint),c.paint)this.setPaintProperty(x,c.paint[x],{validate:!1});for(var E in c.layout)this.setLayoutProperty(E,c.layout[E],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new nc(m.paint)}}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},u.prototype.getLayoutProperty=function(c){return c==="visibility"?this.visibility:this._unevaluatedLayout.getValue(c)},u.prototype.setLayoutProperty=function(c,m,x){x===void 0&&(x={}),m!=null&&this._validate(Lf,"layers."+this.id+".layout."+c,c,m,x)||(c!=="visibility"?this._unevaluatedLayout.setValue(c,m):this.visibility=m)},u.prototype.getPaintProperty=function(c){return hr(c,"-transition")?this._transitionablePaint.getTransition(c.slice(0,-11)):this._transitionablePaint.getValue(c)},u.prototype.setPaintProperty=function(c,m,x){if(x===void 0&&(x={}),m!=null&&this._validate(Sh,"layers."+this.id+".paint."+c,c,m,x))return!1;if(hr(c,"-transition"))return this._transitionablePaint.setTransition(c.slice(0,-11),m||void 0),!1;var E=this._transitionablePaint._values[c],A=E.property.specification["property-type"]==="cross-faded-data-driven",I=E.value.isDataDriven(),D=E.value;this._transitionablePaint.setValue(c,m),this._handleSpecialPaintPropertyUpdate(c);var N=this._transitionablePaint._values[c].value;return N.isDataDriven()||I||A||this._handleOverridablePaintPropertyUpdate(c,D,N)},u.prototype._handleSpecialPaintPropertyUpdate=function(c){},u.prototype._handleOverridablePaintPropertyUpdate=function(c,m,x){return!1},u.prototype.isHidden=function(c){return!!(this.minzoom&&c=this.maxzoom)||this.visibility==="none"},u.prototype.updateTransitions=function(c){this._transitioningPaint=this._transitionablePaint.transitioned(c,this._transitioningPaint)},u.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},u.prototype.recalculate=function(c,m){c.getCrossfadeParameters&&(this._crossfadeParameters=c.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(c,void 0,m)),this.paint=this._transitioningPaint.possiblyEvaluate(c,void 0,m)},u.prototype.serialize=function(){var c={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&&(c.layout=c.layout||{},c.layout.visibility=this.visibility),At(c,function(m,x){return!(m===void 0||x==="layout"&&!Object.keys(m).length||x==="paint"&&!Object.keys(m).length)})},u.prototype._validate=function(c,m,x,E,A){return A===void 0&&(A={}),(!A||A.validate!==!1)&&Ml(this,c.call(sf,{key:m,layerType:this.type,objectKey:x,value:E,styleSpec:j,style:{glyphs:!0,sprite:!0}}))},u.prototype.is3D=function(){return!1},u.prototype.isTileClipped=function(){return!1},u.prototype.hasOffscreenPass=function(){return!1},u.prototype.resize=function(){},u.prototype.isStateDependent=function(){for(var c in this.paint._values){var m=this.paint.get(c);if(m instanceof Da&&rl(m.property.specification)&&(m.value.kind==="source"||m.value.kind==="composite")&&m.value.isStateDependent)return!0}return!1},u}(pt),Ks={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Fc=function(a,u){this._structArray=a,this._pos1=u*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},ra=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function wo(a,u){u===void 0&&(u=1);var c=0,m=0;return{members:a.map(function(x){var E=Ks[x.type].BYTES_PER_ELEMENT,A=c=Ch(c,Math.max(u,E)),I=x.components||1;return m=Math.max(m,E),c+=E*I,{name:x.name,type:x.type,components:I,offset:A}}),size:Ch(c,Math.max(m,u)),alignment:u}}function Ch(a,u){return Math.ceil(a/u)*u}ra.serialize=function(a,u){return a._trim(),u&&(a.isTransferred=!0,u.push(a.arrayBuffer)),{length:a.length,arrayBuffer:a.arrayBuffer}},ra.deserialize=function(a){var u=Object.create(this.prototype);return u.arrayBuffer=a.arrayBuffer,u.length=a.length,u.capacity=a.arrayBuffer.byteLength/u.bytesPerElement,u._refreshViews(),u},ra.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},ra.prototype.clear=function(){this.length=0},ra.prototype.resize=function(a){this.reserve(a),this.length=a},ra.prototype.reserve=function(a){if(a>this.capacity){this.capacity=Math.max(a,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var u=this.uint8;this._refreshViews(),u&&this.uint8.set(u)}},ra.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Pl=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m){var x=this.length;return this.resize(x+1),this.emplace(x,c,m)},u.prototype.emplace=function(c,m,x){var E=2*c;return this.int16[E+0]=m,this.int16[E+1]=x,c},u}(ra);Pl.prototype.bytesPerElement=4,_n("StructArrayLayout2i4",Pl);var zf=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E){var A=this.length;return this.resize(A+1),this.emplace(A,c,m,x,E)},u.prototype.emplace=function(c,m,x,E,A){var I=4*c;return this.int16[I+0]=m,this.int16[I+1]=x,this.int16[I+2]=E,this.int16[I+3]=A,c},u}(ra);zf.prototype.bytesPerElement=8,_n("StructArrayLayout4i8",zf);var gu=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E,A,I){var D=this.length;return this.resize(D+1),this.emplace(D,c,m,x,E,A,I)},u.prototype.emplace=function(c,m,x,E,A,I,D){var N=6*c;return this.int16[N+0]=m,this.int16[N+1]=x,this.int16[N+2]=E,this.int16[N+3]=A,this.int16[N+4]=I,this.int16[N+5]=D,c},u}(ra);gu.prototype.bytesPerElement=12,_n("StructArrayLayout2i4i12",gu);var Es=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E,A,I){var D=this.length;return this.resize(D+1),this.emplace(D,c,m,x,E,A,I)},u.prototype.emplace=function(c,m,x,E,A,I,D){var N=4*c,H=8*c;return this.int16[N+0]=m,this.int16[N+1]=x,this.uint8[H+4]=E,this.uint8[H+5]=A,this.uint8[H+6]=I,this.uint8[H+7]=D,c},u}(ra);Es.prototype.bytesPerElement=8,_n("StructArrayLayout2i4ub8",Es);var ic=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m){var x=this.length;return this.resize(x+1),this.emplace(x,c,m)},u.prototype.emplace=function(c,m,x){var E=2*c;return this.float32[E+0]=m,this.float32[E+1]=x,c},u}(ra);ic.prototype.bytesPerElement=8,_n("StructArrayLayout2f8",ic);var Nu=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E,A,I,D,N,H,X){var ne=this.length;return this.resize(ne+1),this.emplace(ne,c,m,x,E,A,I,D,N,H,X)},u.prototype.emplace=function(c,m,x,E,A,I,D,N,H,X,ne){var R=10*c;return this.uint16[R+0]=m,this.uint16[R+1]=x,this.uint16[R+2]=E,this.uint16[R+3]=A,this.uint16[R+4]=I,this.uint16[R+5]=D,this.uint16[R+6]=N,this.uint16[R+7]=H,this.uint16[R+8]=X,this.uint16[R+9]=ne,c},u}(ra);Nu.prototype.bytesPerElement=20,_n("StructArrayLayout10ui20",Nu);var Zf=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E,A,I,D,N,H,X,ne,R){var Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,c,m,x,E,A,I,D,N,H,X,ne,R)},u.prototype.emplace=function(c,m,x,E,A,I,D,N,H,X,ne,R,Pe){var Be=12*c;return this.int16[Be+0]=m,this.int16[Be+1]=x,this.int16[Be+2]=E,this.int16[Be+3]=A,this.uint16[Be+4]=I,this.uint16[Be+5]=D,this.uint16[Be+6]=N,this.uint16[Be+7]=H,this.int16[Be+8]=X,this.int16[Be+9]=ne,this.int16[Be+10]=R,this.int16[Be+11]=Pe,c},u}(ra);Zf.prototype.bytesPerElement=24,_n("StructArrayLayout4i4ui4i24",Zf);var kc=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x){var E=this.length;return this.resize(E+1),this.emplace(E,c,m,x)},u.prototype.emplace=function(c,m,x,E){var A=3*c;return this.float32[A+0]=m,this.float32[A+1]=x,this.float32[A+2]=E,c},u}(ra);kc.prototype.bytesPerElement=12,_n("StructArrayLayout3f12",kc);var cf=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c){var m=this.length;return this.resize(m+1),this.emplace(m,c)},u.prototype.emplace=function(c,m){return this.uint32[1*c+0]=m,c},u}(ra);cf.prototype.bytesPerElement=4,_n("StructArrayLayout1ul4",cf);var Vf=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.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)},u.prototype.emplaceBack=function(c,m,x,E,A,I,D,N,H){var X=this.length;return this.resize(X+1),this.emplace(X,c,m,x,E,A,I,D,N,H)},u.prototype.emplace=function(c,m,x,E,A,I,D,N,H,X){var ne=10*c,R=5*c;return this.int16[ne+0]=m,this.int16[ne+1]=x,this.int16[ne+2]=E,this.int16[ne+3]=A,this.int16[ne+4]=I,this.int16[ne+5]=D,this.uint32[R+3]=N,this.uint16[ne+8]=H,this.uint16[ne+9]=X,c},u}(ra);Vf.prototype.bytesPerElement=20,_n("StructArrayLayout6i1ul2ui20",Vf);var ac=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E,A,I){var D=this.length;return this.resize(D+1),this.emplace(D,c,m,x,E,A,I)},u.prototype.emplace=function(c,m,x,E,A,I,D){var N=6*c;return this.int16[N+0]=m,this.int16[N+1]=x,this.int16[N+2]=E,this.int16[N+3]=A,this.int16[N+4]=I,this.int16[N+5]=D,c},u}(ra);ac.prototype.bytesPerElement=12,_n("StructArrayLayout2i2i2i12",ac);var oc=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E,A){var I=this.length;return this.resize(I+1),this.emplace(I,c,m,x,E,A)},u.prototype.emplace=function(c,m,x,E,A,I){var D=4*c,N=8*c;return this.float32[D+0]=m,this.float32[D+1]=x,this.float32[D+2]=E,this.int16[N+6]=A,this.int16[N+7]=I,c},u}(ra);oc.prototype.bytesPerElement=16,_n("StructArrayLayout2f1f2i16",oc);var Uu=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E){var A=this.length;return this.resize(A+1),this.emplace(A,c,m,x,E)},u.prototype.emplace=function(c,m,x,E,A){var I=12*c,D=3*c;return this.uint8[I+0]=m,this.uint8[I+1]=x,this.float32[D+1]=E,this.float32[D+2]=A,c},u}(ra);Uu.prototype.bytesPerElement=12,_n("StructArrayLayout2ub2f12",Uu);var zu=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x){var E=this.length;return this.resize(E+1),this.emplace(E,c,m,x)},u.prototype.emplace=function(c,m,x,E){var A=3*c;return this.uint16[A+0]=m,this.uint16[A+1]=x,this.uint16[A+2]=E,c},u}(ra);zu.prototype.bytesPerElement=6,_n("StructArrayLayout3ui6",zu);var tu=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.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)},u.prototype.emplaceBack=function(c,m,x,E,A,I,D,N,H,X,ne,R,Pe,Be,rt,Ge,St){var Ft=this.length;return this.resize(Ft+1),this.emplace(Ft,c,m,x,E,A,I,D,N,H,X,ne,R,Pe,Be,rt,Ge,St)},u.prototype.emplace=function(c,m,x,E,A,I,D,N,H,X,ne,R,Pe,Be,rt,Ge,St,Ft){var Yt=24*c,qt=12*c,dr=48*c;return this.int16[Yt+0]=m,this.int16[Yt+1]=x,this.uint16[Yt+2]=E,this.uint16[Yt+3]=A,this.uint32[qt+2]=I,this.uint32[qt+3]=D,this.uint32[qt+4]=N,this.uint16[Yt+10]=H,this.uint16[Yt+11]=X,this.uint16[Yt+12]=ne,this.float32[qt+7]=R,this.float32[qt+8]=Pe,this.uint8[dr+36]=Be,this.uint8[dr+37]=rt,this.uint8[dr+38]=Ge,this.uint32[qt+10]=St,this.int16[Yt+22]=Ft,c},u}(ra);tu.prototype.bytesPerElement=48,_n("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",tu);var jf=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.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)},u.prototype.emplaceBack=function(c,m,x,E,A,I,D,N,H,X,ne,R,Pe,Be,rt,Ge,St,Ft,Yt,qt,dr,Lr,Xr,Bn,cn,Vn,pn,Ei){var ti=this.length;return this.resize(ti+1),this.emplace(ti,c,m,x,E,A,I,D,N,H,X,ne,R,Pe,Be,rt,Ge,St,Ft,Yt,qt,dr,Lr,Xr,Bn,cn,Vn,pn,Ei)},u.prototype.emplace=function(c,m,x,E,A,I,D,N,H,X,ne,R,Pe,Be,rt,Ge,St,Ft,Yt,qt,dr,Lr,Xr,Bn,cn,Vn,pn,Ei,ti){var Rn=34*c,Di=17*c;return this.int16[Rn+0]=m,this.int16[Rn+1]=x,this.int16[Rn+2]=E,this.int16[Rn+3]=A,this.int16[Rn+4]=I,this.int16[Rn+5]=D,this.int16[Rn+6]=N,this.int16[Rn+7]=H,this.uint16[Rn+8]=X,this.uint16[Rn+9]=ne,this.uint16[Rn+10]=R,this.uint16[Rn+11]=Pe,this.uint16[Rn+12]=Be,this.uint16[Rn+13]=rt,this.uint16[Rn+14]=Ge,this.uint16[Rn+15]=St,this.uint16[Rn+16]=Ft,this.uint16[Rn+17]=Yt,this.uint16[Rn+18]=qt,this.uint16[Rn+19]=dr,this.uint16[Rn+20]=Lr,this.uint16[Rn+21]=Xr,this.uint16[Rn+22]=Bn,this.uint32[Di+12]=cn,this.float32[Di+13]=Vn,this.float32[Di+14]=pn,this.float32[Di+15]=Ei,this.float32[Di+16]=ti,c},u}(ra);jf.prototype.bytesPerElement=68,_n("StructArrayLayout8i15ui1ul4f68",jf);var Ol=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c){var m=this.length;return this.resize(m+1),this.emplace(m,c)},u.prototype.emplace=function(c,m){return this.float32[1*c+0]=m,c},u}(ra);Ol.prototype.bytesPerElement=4,_n("StructArrayLayout1f4",Ol);var ru=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x){var E=this.length;return this.resize(E+1),this.emplace(E,c,m,x)},u.prototype.emplace=function(c,m,x,E){var A=3*c;return this.int16[A+0]=m,this.int16[A+1]=x,this.int16[A+2]=E,c},u}(ra);ru.prototype.bytesPerElement=6,_n("StructArrayLayout3i6",ru);var Dl=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x){var E=this.length;return this.resize(E+1),this.emplace(E,c,m,x)},u.prototype.emplace=function(c,m,x,E){var A=4*c;return this.uint32[2*c+0]=m,this.uint16[A+2]=x,this.uint16[A+3]=E,c},u}(ra);Dl.prototype.bytesPerElement=8,_n("StructArrayLayout1ul2ui8",Dl);var ff=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m){var x=this.length;return this.resize(x+1),this.emplace(x,c,m)},u.prototype.emplace=function(c,m,x){var E=2*c;return this.uint16[E+0]=m,this.uint16[E+1]=x,c},u}(ra);ff.prototype.bytesPerElement=4,_n("StructArrayLayout2ui4",ff);var Rh=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c){var m=this.length;return this.resize(m+1),this.emplace(m,c)},u.prototype.emplace=function(c,m){return this.uint16[1*c+0]=m,c},u}(ra);Rh.prototype.bytesPerElement=2,_n("StructArrayLayout1ui2",Rh);var Hf=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E){var A=this.length;return this.resize(A+1),this.emplace(A,c,m,x,E)},u.prototype.emplace=function(c,m,x,E,A){var I=4*c;return this.float32[I+0]=m,this.float32[I+1]=x,this.float32[I+2]=E,this.float32[I+3]=A,c},u}(ra);Hf.prototype.bytesPerElement=16,_n("StructArrayLayout4f16",Hf);var h=function(a){function u(){a.apply(this,arguments)}a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var c={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 c.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},c.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},c.x1.get=function(){return this._structArray.int16[this._pos2+2]},c.y1.get=function(){return this._structArray.int16[this._pos2+3]},c.x2.get=function(){return this._structArray.int16[this._pos2+4]},c.y2.get=function(){return this._structArray.int16[this._pos2+5]},c.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},c.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},c.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},c.anchorPoint.get=function(){return new se(this.anchorPointX,this.anchorPointY)},Object.defineProperties(u.prototype,c),u}(Fc);h.prototype.size=20;var d=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.get=function(c){return new h(this,c)},u}(Vf);_n("CollisionBoxArray",d);var p=function(a){function u(){a.apply(this,arguments)}a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var c={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 c.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},c.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},c.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},c.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},c.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},c.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},c.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},c.segment.get=function(){return this._structArray.uint16[this._pos2+10]},c.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},c.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},c.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},c.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},c.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},c.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},c.placedOrientation.set=function(m){this._structArray.uint8[this._pos1+37]=m},c.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},c.hidden.set=function(m){this._structArray.uint8[this._pos1+38]=m},c.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},c.crossTileID.set=function(m){this._structArray.uint32[this._pos4+10]=m},c.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(u.prototype,c),u}(Fc);p.prototype.size=48;var g=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.get=function(c){return new p(this,c)},u}(tu);_n("PlacedSymbolArray",g);var S=function(a){function u(){a.apply(this,arguments)}a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var c={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 c.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},c.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},c.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},c.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},c.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},c.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},c.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},c.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},c.key.get=function(){return this._structArray.uint16[this._pos2+8]},c.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},c.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},c.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},c.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},c.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},c.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},c.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},c.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},c.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},c.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},c.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},c.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},c.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},c.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},c.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},c.crossTileID.set=function(m){this._structArray.uint32[this._pos4+12]=m},c.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},c.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},c.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},c.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(u.prototype,c),u}(Fc);S.prototype.size=68;var w=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.get=function(c){return new S(this,c)},u}(jf);_n("SymbolInstanceArray",w);var C=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.getoffsetX=function(c){return this.float32[1*c+0]},u}(Ol);_n("GlyphOffsetArray",C);var P=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.getx=function(c){return this.int16[3*c+0]},u.prototype.gety=function(c){return this.int16[3*c+1]},u.prototype.gettileUnitDistanceFromAnchor=function(c){return this.int16[3*c+2]},u}(ru);_n("SymbolLineVertexArray",P);var Z=function(a){function u(){a.apply(this,arguments)}a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var c={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return c.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},c.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},c.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(u.prototype,c),u}(Fc);Z.prototype.size=8;var Y=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.get=function(c){return new Z(this,c)},u}(Dl);_n("FeatureIndexArray",Y);var pe=wo([{name:"a_pos",components:2,type:"Int16"}],4).members,_e=function(a){a===void 0&&(a=[]),this.segments=a};function ye(a,u){return 256*(a=wt(Math.floor(a),0,255))+wt(Math.floor(u),0,255)}_e.prototype.prepareSegment=function(a,u,c,m){var x=this.segments[this.segments.length-1];return a>_e.MAX_VERTEX_ARRAY_LENGTH&&qe("Max vertices per segment is "+_e.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+a),(!x||x.vertexLength+a>_e.MAX_VERTEX_ARRAY_LENGTH||x.sortKey!==m)&&(x={vertexOffset:u.length,primitiveOffset:c.length,vertexLength:0,primitiveLength:0},m!==void 0&&(x.sortKey=m),this.segments.push(x)),x},_e.prototype.get=function(){return this.segments},_e.prototype.destroy=function(){for(var a=0,u=this.segments;a>>16)*I&65535)<<16)&4294967295)<<15|N>>>17))*D+(((N>>>16)*D&65535)<<16)&4294967295)<<13|E>>>19))+((5*(E>>>16)&65535)<<16)&4294967295))+((58964+(A>>>16)&65535)<<16);switch(N=0,m){case 3:N^=(255&u.charCodeAt(H+2))<<16;case 2:N^=(255&u.charCodeAt(H+1))<<8;case 1:E^=N=(65535&(N=(N=(65535&(N^=255&u.charCodeAt(H)))*I+(((N>>>16)*I&65535)<<16)&4294967295)<<15|N>>>17))*D+(((N>>>16)*D&65535)<<16)&4294967295}return E^=u.length,E=2246822507*(65535&(E^=E>>>16))+((2246822507*(E>>>16)&65535)<<16)&4294967295,E=3266489909*(65535&(E^=E>>>13))+((3266489909*(E>>>16)&65535)<<16)&4294967295,(E^=E>>>16)>>>0}}),Ke=le(function(a){a.exports=function(u,c){for(var m,x=u.length,E=c^x,A=0;x>=4;)m=1540483477*(65535&(m=255&u.charCodeAt(A)|(255&u.charCodeAt(++A))<<8|(255&u.charCodeAt(++A))<<16|(255&u.charCodeAt(++A))<<24))+((1540483477*(m>>>16)&65535)<<16),E=1540483477*(65535&E)+((1540483477*(E>>>16)&65535)<<16)^(m=1540483477*(65535&(m^=m>>>24))+((1540483477*(m>>>16)&65535)<<16)),x-=4,++A;switch(x){case 3:E^=(255&u.charCodeAt(A+2))<<16;case 2:E^=(255&u.charCodeAt(A+1))<<8;case 1:E=1540483477*(65535&(E^=255&u.charCodeAt(A)))+((1540483477*(E>>>16)&65535)<<16)}return E=1540483477*(65535&(E^=E>>>13))+((1540483477*(E>>>16)&65535)<<16),(E^=E>>>15)>>>0}}),Ie=ke,$e=Ke;Ie.murmur3=ke,Ie.murmur2=$e;var vt=function(){this.ids=[],this.positions=[],this.indexed=!1};vt.prototype.add=function(a,u,c,m){this.ids.push(Jt(a)),this.positions.push(u,c,m)},vt.prototype.getPositions=function(a){for(var u=Jt(a),c=0,m=this.ids.length-1;c>1;this.ids[x]>=u?m=x:c=x+1}for(var E=[];this.ids[c]===u;)E.push({index:this.positions[3*c],start:this.positions[3*c+1],end:this.positions[3*c+2]}),c++;return E},vt.serialize=function(a,u){var c=new Float64Array(a.ids),m=new Uint32Array(a.positions);return function x(E,A,I,D){for(;I>1],H=I-1,X=D+1;;){do H++;while(E[H]N);if(H>=X)break;zt(E,H,X),zt(A,3*H,3*X),zt(A,3*H+1,3*X+1),zt(A,3*H+2,3*X+2)}X-IA.x+1||DA.y+1)&&qe("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return c}function Xa(a,u){return{type:a.type,id:a.id,properties:a.properties,geometry:u?Ga(a):[]}}function Ss(a,u,c,m,x){a.emplaceBack(2*u+(m+1)/2,2*c+(x+1)/2)}var ls=function(a){this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(function(u){return u.id}),this.index=a.index,this.hasPattern=!1,this.layoutVertexArray=new Pl,this.indexArray=new zu,this.segments=new _e,this.programConfigurations=new Kn(a.layers,a.zoom),this.stateDependentLayerIds=this.layers.filter(function(u){return u.isStateDependent()}).map(function(u){return u.id})};function Zu(a,u){for(var c=0;c1){if(sl(a,u))return!0;for(var m=0;m1?c:c.sub(u)._mult(x)._add(u))}function Vu(a,u){for(var c,m,x,E=!1,A=0;Au.y!=(x=c[D]).y>u.y&&u.x<(x.x-m.x)*(u.y-m.y)/(x.y-m.y)+m.x&&(E=!E);return E}function iu(a,u){for(var c=!1,m=0,x=a.length-1;mu.y!=A.y>u.y&&u.x<(A.x-E.x)*(u.y-E.y)/(A.y-E.y)+E.x&&(c=!c)}return c}function ju(a,u,c){var m=c[0],x=c[2];if(a.xx.x&&u.x>x.x||a.yx.y&&u.y>x.y)return!1;var E=Ct(a,u,c[0]);return E!==Ct(a,u,c[1])||E!==Ct(a,u,c[2])||E!==Ct(a,u,c[3])}function Ko(a,u,c){var m=u.paint.get(a).value;return m.kind==="constant"?m.value:c.programConfigurations.get(u.id).getMaxValue(a)}function Qa(a){return Math.sqrt(a[0]*a[0]+a[1]*a[1])}function As(a,u,c,m,x){if(!u[0]&&!u[1])return a;var E=se.convert(u)._mult(x);c==="viewport"&&E._rotate(-m);for(var A=[],I=0;I=8192||H<0||H>=8192)){var X=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,a.sortKey),ne=X.vertexLength;Ss(this.layoutVertexArray,N,H,-1,-1),Ss(this.layoutVertexArray,N,H,1,-1),Ss(this.layoutVertexArray,N,H,1,1),Ss(this.layoutVertexArray,N,H,-1,1),this.indexArray.emplaceBack(ne,ne+1,ne+2),this.indexArray.emplaceBack(ne,ne+3,ne+2),X.vertexLength+=4,X.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,a,c,{},m)},_n("CircleBucket",ls,{omit:["layers"]});var au=new Fa({"circle-sort-key":new yn(j.layout_circle["circle-sort-key"])}),Hu={paint:new Fa({"circle-radius":new yn(j.paint_circle["circle-radius"]),"circle-color":new yn(j.paint_circle["circle-color"]),"circle-blur":new yn(j.paint_circle["circle-blur"]),"circle-opacity":new yn(j.paint_circle["circle-opacity"]),"circle-translate":new kn(j.paint_circle["circle-translate"]),"circle-translate-anchor":new kn(j.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new kn(j.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new kn(j.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new yn(j.paint_circle["circle-stroke-width"]),"circle-stroke-color":new yn(j.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new yn(j.paint_circle["circle-stroke-opacity"])}),layout:au},Zi=typeof Float32Array!="undefined"?Float32Array:Array;function mo(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}function ao(a,u,c){var m=u[0],x=u[1],E=u[2],A=u[3],I=u[4],D=u[5],N=u[6],H=u[7],X=u[8],ne=u[9],R=u[10],Pe=u[11],Be=u[12],rt=u[13],Ge=u[14],St=u[15],Ft=c[0],Yt=c[1],qt=c[2],dr=c[3];return a[0]=Ft*m+Yt*I+qt*X+dr*Be,a[1]=Ft*x+Yt*D+qt*ne+dr*rt,a[2]=Ft*E+Yt*N+qt*R+dr*Ge,a[3]=Ft*A+Yt*H+qt*Pe+dr*St,a[4]=(Ft=c[4])*m+(Yt=c[5])*I+(qt=c[6])*X+(dr=c[7])*Be,a[5]=Ft*x+Yt*D+qt*ne+dr*rt,a[6]=Ft*E+Yt*N+qt*R+dr*Ge,a[7]=Ft*A+Yt*H+qt*Pe+dr*St,a[8]=(Ft=c[8])*m+(Yt=c[9])*I+(qt=c[10])*X+(dr=c[11])*Be,a[9]=Ft*x+Yt*D+qt*ne+dr*rt,a[10]=Ft*E+Yt*N+qt*R+dr*Ge,a[11]=Ft*A+Yt*H+qt*Pe+dr*St,a[12]=(Ft=c[12])*m+(Yt=c[13])*I+(qt=c[14])*X+(dr=c[15])*Be,a[13]=Ft*x+Yt*D+qt*ne+dr*rt,a[14]=Ft*E+Yt*N+qt*R+dr*Ge,a[15]=Ft*A+Yt*H+qt*Pe+dr*St,a}Math.hypot||(Math.hypot=function(){for(var a=arguments,u=0,c=arguments.length;c--;)u+=a[c]*a[c];return Math.sqrt(u)});var ou,Bc=ao;function Bl(a,u,c){var m=u[0],x=u[1],E=u[2],A=u[3];return a[0]=c[0]*m+c[4]*x+c[8]*E+c[12]*A,a[1]=c[1]*m+c[5]*x+c[9]*E+c[13]*A,a[2]=c[2]*m+c[6]*x+c[10]*E+c[14]*A,a[3]=c[3]*m+c[7]*x+c[11]*E+c[15]*A,a}ou=new Zi(3),Zi!=Float32Array&&(ou[0]=0,ou[1]=0,ou[2]=0),function(){var a=new Zi(4);Zi!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0,a[3]=0)}();var fs=(function(){var a=new Zi(2);Zi!=Float32Array&&(a[0]=0,a[1]=0)}(),function(a){function u(c){a.call(this,c,Hu)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.createBucket=function(c){return new ls(c)},u.prototype.queryRadius=function(c){var m=c;return Ko("circle-radius",this,m)+Ko("circle-stroke-width",this,m)+Qa(this.paint.get("circle-translate"))},u.prototype.queryIntersectsFeature=function(c,m,x,E,A,I,D,N){for(var H=As(c,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),I.angle,D),X=this.paint.get("circle-radius").evaluate(m,x)+this.paint.get("circle-stroke-width").evaluate(m,x),ne=this.paint.get("circle-pitch-alignment")==="map",R=ne?H:function(Lr,Xr){return Lr.map(function(Bn){return Or(Bn,Xr)})}(H,N),Pe=ne?X*D:X,Be=0,rt=E;Bea.width||x.height>a.height||c.x>a.width-x.width||c.y>a.height-x.height)throw new RangeError("out of range source coordinates for image copy");if(x.width>u.width||x.height>u.height||m.x>u.width-x.width||m.y>u.height-x.height)throw new RangeError("out of range destination coordinates for image copy");for(var A=a.data,I=u.data,D=0;D80*c){m=E=a[0],x=A=a[1];for(var Pe=c;PeE&&(E=I),D>A&&(A=D);N=(N=Math.max(E-m,A-x))!==0?1/N:0}return Mh(ne,R,c,m,x,N),R}function Pd(a,u,c,m,x){var E,A;if(x===_f(a,u,c,m)>0)for(E=u;E=u;E-=m)A=gf(E,a[E],a[E+1],A);return A&&uc(A,A.next)&&(ll(A),A=A.next),A}function Nc(a,u){if(!a)return a;u||(u=a);var c,m=a;do if(c=!1,m.steiner||!uc(m,m.next)&&so(m.prev,m,m.next)!==0)m=m.next;else{if(ll(m),(m=u=m.prev)===m.next)break;c=!0}while(c||m!==u);return u}function Mh(a,u,c,m,x,E,A){if(a){!A&&E&&function(H,X,ne,R){var Pe=H;do Pe.z===null&&(Pe.z=Wf(Pe.x,Pe.y,X,ne,R)),Pe.prevZ=Pe.prev,Pe.nextZ=Pe.next,Pe=Pe.next;while(Pe!==H);Pe.prevZ.nextZ=null,Pe.prevZ=null,function(Be){var rt,Ge,St,Ft,Yt,qt,dr,Lr,Xr=1;do{for(Ge=Be,Be=null,Yt=null,qt=0;Ge;){for(qt++,St=Ge,dr=0,rt=0;rt0||Lr>0&&St;)dr!==0&&(Lr===0||!St||Ge.z<=St.z)?(Ft=Ge,Ge=Ge.nextZ,dr--):(Ft=St,St=St.nextZ,Lr--),Yt?Yt.nextZ=Ft:Be=Ft,Ft.prevZ=Yt,Yt=Ft;Ge=St}Yt.nextZ=null,Xr*=2}while(qt>1)}(Pe)}(a,m,x,E);for(var I,D,N=a;a.prev!==a.next;)if(I=a.prev,D=a.next,E?Qm(a,m,x,E):Od(a))u.push(I.i/c),u.push(a.i/c),u.push(D.i/c),ll(a),a=D.next,N=D.next;else if((a=D)===N){A?A===1?Mh(a=Hp(Nc(a),u,c),u,c,m,x,E,2):A===2&&Dd(a,u,c,m,x,E):Mh(Nc(a),u,c,m,x,E,1);break}}}function Od(a){var u=a.prev,c=a,m=a.next;if(so(u,c,m)>=0)return!1;for(var x=a.next.next;x!==a.prev;){if(df(u.x,u.y,c.x,c.y,m.x,m.y,x.x,x.y)&&so(x.prev,x,x.next)>=0)return!1;x=x.next}return!0}function Qm(a,u,c,m){var x=a.prev,E=a,A=a.next;if(so(x,E,A)>=0)return!1;for(var I=x.x>E.x?x.x>A.x?x.x:A.x:E.x>A.x?E.x:A.x,D=x.y>E.y?x.y>A.y?x.y:A.y:E.y>A.y?E.y:A.y,N=Wf(x.x=N&&ne&&ne.z<=H;){if(X!==a.prev&&X!==a.next&&df(x.x,x.y,E.x,E.y,A.x,A.y,X.x,X.y)&&so(X.prev,X,X.next)>=0||(X=X.prevZ,ne!==a.prev&&ne!==a.next&&df(x.x,x.y,E.x,E.y,A.x,A.y,ne.x,ne.y)&&so(ne.prev,ne,ne.next)>=0))return!1;ne=ne.nextZ}for(;X&&X.z>=N;){if(X!==a.prev&&X!==a.next&&df(x.x,x.y,E.x,E.y,A.x,A.y,X.x,X.y)&&so(X.prev,X,X.next)>=0)return!1;X=X.prevZ}for(;ne&&ne.z<=H;){if(ne!==a.prev&&ne!==a.next&&df(x.x,x.y,E.x,E.y,A.x,A.y,ne.x,ne.y)&&so(ne.prev,ne,ne.next)>=0)return!1;ne=ne.nextZ}return!0}function Hp(a,u,c){var m=a;do{var x=m.prev,E=m.next.next;!uc(x,E)&&hp(x,m,m.next,E)&&zc(x,E)&&zc(E,x)&&(u.push(x.i/c),u.push(m.i/c),u.push(E.i/c),ll(m),ll(m.next),m=a=E),m=m.next}while(m!==a);return Nc(m)}function Dd(a,u,c,m,x,E){var A=a;do{for(var I=A.next.next;I!==A.prev;){if(A.i!==I.i&&fp(A,I)){var D=Ih(A,I);return A=Nc(A,A.next),D=Nc(D,D.next),Mh(A,u,c,m,x,E),void Mh(D,u,c,m,x,E)}I=I.next}A=A.next}while(A!==a)}function Jm(a,u){return a.x-u.x}function Fd(a,u){if(u=function(m,x){var E,A=x,I=m.x,D=m.y,N=-1/0;do{if(D<=A.y&&D>=A.next.y&&A.next.y!==A.y){var H=A.x+(D-A.y)*(A.next.x-A.x)/(A.next.y-A.y);if(H<=I&&H>N){if(N=H,H===I){if(D===A.y)return A;if(D===A.next.y)return A.next}E=A.x=A.x&&A.x>=R&&I!==A.x&&df(DE.x||A.x===E.x&&Uc(E,A)))&&(E=A,Be=X)),A=A.next;while(A!==ne);return E}(a,u)){var c=Ih(u,a);Nc(u,u.next),Nc(c,c.next)}}function Uc(a,u){return so(a.prev,a,u.prev)<0&&so(u.next,a,a.next)<0}function Wf(a,u,c,m,x){return(a=1431655765&((a=858993459&((a=252645135&((a=16711935&((a=32767*(a-c)*x)|a<<8))|a<<4))|a<<2))|a<<1))|(u=1431655765&((u=858993459&((u=252645135&((u=16711935&((u=32767*(u-m)*x)|u<<8))|u<<4))|u<<2))|u<<1))<<1}function cp(a){var u=a,c=a;do(u.x=0&&(a-A)*(m-I)-(c-A)*(u-I)>=0&&(c-A)*(E-I)-(x-A)*(m-I)>=0}function fp(a,u){return a.next.i!==u.i&&a.prev.i!==u.i&&!function(c,m){var x=c;do{if(x.i!==c.i&&x.next.i!==c.i&&x.i!==m.i&&x.next.i!==m.i&&hp(x,x.next,c,m))return!0;x=x.next}while(x!==c);return!1}(a,u)&&(zc(a,u)&&zc(u,a)&&function(c,m){var x=c,E=!1,A=(c.x+m.x)/2,I=(c.y+m.y)/2;do x.y>I!=x.next.y>I&&x.next.y!==x.y&&A<(x.next.x-x.x)*(I-x.y)/(x.next.y-x.y)+x.x&&(E=!E),x=x.next;while(x!==c);return E}(a,u)&&(so(a.prev,a,u.prev)||so(a,u.prev,u))||uc(a,u)&&so(a.prev,a,a.next)>0&&so(u.prev,u,u.next)>0)}function so(a,u,c){return(u.y-a.y)*(c.x-u.x)-(u.x-a.x)*(c.y-u.y)}function uc(a,u){return a.x===u.x&&a.y===u.y}function hp(a,u,c,m){var x=mf(so(a,u,c)),E=mf(so(a,u,m)),A=mf(so(c,m,a)),I=mf(so(c,m,u));return x!==E&&A!==I||!(x!==0||!vf(a,c,u))||!(E!==0||!vf(a,m,u))||!(A!==0||!vf(c,a,m))||!(I!==0||!vf(c,u,m))}function vf(a,u,c){return u.x<=Math.max(a.x,c.x)&&u.x>=Math.min(a.x,c.x)&&u.y<=Math.max(a.y,c.y)&&u.y>=Math.min(a.y,c.y)}function mf(a){return a>0?1:a<0?-1:0}function zc(a,u){return so(a.prev,a,a.next)<0?so(a,u,a.next)>=0&&so(a,a.prev,u)>=0:so(a,u,a.prev)<0||so(a,a.next,u)<0}function Ih(a,u){var c=new Zc(a.i,a.x,a.y),m=new Zc(u.i,u.x,u.y),x=a.next,E=u.prev;return a.next=u,u.prev=a,c.next=x,x.prev=c,m.next=c,c.prev=m,E.next=m,m.prev=E,m}function gf(a,u,c,m){var x=new Zc(a,u,c);return m?(x.next=m.next,x.prev=m,m.next.prev=x,m.next=x):(x.prev=x,x.next=x),x}function ll(a){a.next.prev=a.prev,a.prev.next=a.next,a.prevZ&&(a.prevZ.nextZ=a.nextZ),a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function Zc(a,u,c){this.i=a,this.x=u,this.y=c,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _f(a,u,c,m){for(var x=0,E=u,A=c-m;ED;){if(N-D>600){var X=N-D+1,ne=I-D+1,R=Math.log(X),Pe=.5*Math.exp(2*R/3),Be=.5*Math.sqrt(R*Pe*(X-Pe)/X)*(ne-X/2<0?-1:1);E(A,I,Math.max(D,Math.floor(I-ne*Pe/X+Be)),Math.min(N,Math.floor(I+(X-ne)*Pe/X+Be)),H)}var rt=A[I],Ge=D,St=N;for(lc(A,D,I),H(A[N],rt)>0&&lc(A,D,N);Ge0;)St--}H(A[D],rt)===0?lc(A,D,St):lc(A,++St,N),St<=I&&(D=St+1),I<=St&&(N=St-1)}})(a,u,c||0,m||a.length-1,x||yf)}function lc(a,u,c){var m=a[u];a[u]=a[c],a[c]=m}function yf(a,u){return au?1:0}function pp(a,u){var c=a.length;if(c<=1)return[a];for(var m,x,E=[],A=0;A1)for(var D=0;D0&&c.holes.push(m+=a[x-1].length)}return c},pf.default=Id;var fl=function(a){this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(function(u){return u.id}),this.index=a.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Pl,this.indexArray=new zu,this.indexArray2=new ff,this.programConfigurations=new Kn(a.layers,a.zoom),this.segments=new _e,this.segments2=new _e,this.stateDependentLayerIds=this.layers.filter(function(u){return u.isStateDependent()}).map(function(u){return u.id})};fl.prototype.populate=function(a,u,c){this.hasPattern=Wp("fill",this.layers,u);for(var m=this.layers[0].layout.get("fill-sort-key"),x=[],E=0,A=a;E>3}if(x--,m===1||m===2)E+=a.readSVarint(),A+=a.readSVarint(),m===1&&(u&&I.push(u),u=[]),u.push(new se(E,A));else{if(m!==7)throw new Error("unknown command "+m);u&&u.push(u[0].clone())}}return u&&I.push(u),I},cc.prototype.bbox=function(){var a=this._pbf;a.pos=this._geometry;for(var u=a.readVarint()+a.pos,c=1,m=0,x=0,E=0,A=1/0,I=-1/0,D=1/0,N=-1/0;a.pos>3}if(m--,c===1||c===2)(x+=a.readSVarint())I&&(I=x),(E+=a.readSVarint())N&&(N=E);else if(c!==7)throw new Error("unknown command "+c)}return[A,D,I,N]},cc.prototype.toGeoJSON=function(a,u,c){var m,x,E=this.extent*Math.pow(2,c),A=this.extent*a,I=this.extent*u,D=this.loadGeometry(),N=cc.types[this.type];function H(R){for(var Pe=0;Pe>3;x=A===1?m.readString():A===2?m.readFloat():A===3?m.readDouble():A===4?m.readVarint64():A===5?m.readVarint():A===6?m.readSVarint():A===7?m.readBoolean():null}return x}(c))}function Xp(a,u,c){if(a===3){var m=new pl(c,c.readVarint()+c.pos);m.length&&(u[m.name]=m)}}bf.prototype.feature=function(a){if(a<0||a>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[a];var u=this._pbf.readVarint()+this._pbf.pos;return new dp(this._pbf,u,this.extent,this._keys,this._values)};var Ul={VectorTile:function(a,u){this.layers=a.readFields(Xp,{},u)},VectorTileFeature:dp,VectorTileLayer:pl},Gf=Ul.VectorTileFeature.types,vp=Math.pow(2,13);function Ts(a,u,c,m,x,E,A,I){a.emplaceBack(u,c,2*Math.floor(m*vp)+A,x*vp*2,E*vp*2,Math.round(I))}var hs=function(a){this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(function(u){return u.id}),this.index=a.index,this.hasPattern=!1,this.layoutVertexArray=new gu,this.indexArray=new zu,this.programConfigurations=new Kn(a.layers,a.zoom),this.segments=new _e,this.stateDependentLayerIds=this.layers.filter(function(u){return u.isStateDependent()}).map(function(u){return u.id})};function go(a,u){return a.x===u.x&&(a.x<0||a.x>8192)||a.y===u.y&&(a.y<0||a.y>8192)}hs.prototype.populate=function(a,u,c){this.features=[],this.hasPattern=Wp("fill-extrusion",this.layers,u);for(var m=0,x=a;m8192})||Di.every(function(gi){return gi.y<0})||Di.every(function(gi){return gi.y>8192})))for(var Be=0,rt=0;rt=1){var St=Pe[rt-1];if(!go(Ge,St)){X.vertexLength+4>_e.MAX_VERTEX_ARRAY_LENGTH&&(X=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Ft=Ge.sub(St)._perp()._unit(),Yt=St.dist(Ge);Be+Yt>32768&&(Be=0),Ts(this.layoutVertexArray,Ge.x,Ge.y,Ft.x,Ft.y,0,0,Be),Ts(this.layoutVertexArray,Ge.x,Ge.y,Ft.x,Ft.y,0,1,Be),Ts(this.layoutVertexArray,St.x,St.y,Ft.x,Ft.y,0,0,Be+=Yt),Ts(this.layoutVertexArray,St.x,St.y,Ft.x,Ft.y,0,1,Be);var qt=X.vertexLength;this.indexArray.emplaceBack(qt,qt+2,qt+1),this.indexArray.emplaceBack(qt+1,qt+2,qt+3),X.vertexLength+=4,X.primitiveLength+=2}}}}if(X.vertexLength+D>_e.MAX_VERTEX_ARRAY_LENGTH&&(X=this.segments.prepareSegment(D,this.layoutVertexArray,this.indexArray)),Gf[a.type]==="Polygon"){for(var dr=[],Lr=[],Xr=X.vertexLength,Bn=0,cn=I;Bn=2&&a[D-1].equals(a[D-2]);)D--;for(var N=0;N0;if(Lr&&Ge>N){var Bn=H.dist(R);if(Bn>2*X){var cn=H.sub(H.sub(R)._mult(X/Bn)._round());this.updateDistance(R,cn),this.addCurrentVertex(cn,Be,0,0,ne),R=cn}}var Vn=R&&Pe,pn=Vn?c:I?"butt":m;if(Vn&&pn==="round"&&(qtx&&(pn="bevel"),pn==="bevel"&&(qt>2&&(pn="flipbevel"),qt100)St=rt.mult(-1);else{var Ei=qt*Be.add(rt).mag()/Be.sub(rt).mag();St._perp()._mult(Ei*(Xr?-1:1))}this.addCurrentVertex(H,St,0,0,ne),this.addCurrentVertex(H,St.mult(-1),0,0,ne)}else if(pn==="bevel"||pn==="fakeround"){var ti=-Math.sqrt(qt*qt-1),Rn=Xr?ti:0,Di=Xr?0:ti;if(R&&this.addCurrentVertex(H,Be,Rn,Di,ne),pn==="fakeround")for(var gi=Math.round(180*dr/Math.PI/20),Ui=1;Ui2*X){var Za=H.add(Pe.sub(H)._mult(X/uo)._round());this.updateDistance(H,Za),this.addCurrentVertex(Za,rt,0,0,ne),H=Za}}}}},Jo.prototype.addCurrentVertex=function(a,u,c,m,x,E){E===void 0&&(E=!1);var A=u.y*m-u.x,I=-u.y-u.x*m;this.addHalfVertex(a,u.x+u.y*c,u.y-u.x*c,E,!1,c,x),this.addHalfVertex(a,A,I,E,!0,-m,x),this.distance>Dh/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(a,u,c,m,x,E))},Jo.prototype.addHalfVertex=function(a,u,c,m,x,E,A){var I=.5*(this.lineClips?this.scaledDistance*(Dh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((a.x<<1)+(m?1:0),(a.y<<1)+(x?1:0),Math.round(63*u)+128,Math.round(63*c)+128,1+(E===0?0:E<0?-1:1)|(63&I)<<2,I>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var D=A.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,D),A.primitiveLength++),x?this.e2=D:this.e1=D},Jo.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Jo.prototype.updateDistance=function(a,u){this.distance+=a.dist(u),this.updateScaledDistance()},_n("LineBucket",Jo,{omit:["layers","patternFeatures"]});var Uv=new Fa({"line-cap":new kn(j.layout_line["line-cap"]),"line-join":new yn(j.layout_line["line-join"]),"line-miter-limit":new kn(j.layout_line["line-miter-limit"]),"line-round-limit":new kn(j.layout_line["line-round-limit"]),"line-sort-key":new yn(j.layout_line["line-sort-key"])}),$f={paint:new Fa({"line-opacity":new yn(j.paint_line["line-opacity"]),"line-color":new yn(j.paint_line["line-color"]),"line-translate":new kn(j.paint_line["line-translate"]),"line-translate-anchor":new kn(j.paint_line["line-translate-anchor"]),"line-width":new yn(j.paint_line["line-width"]),"line-gap-width":new yn(j.paint_line["line-gap-width"]),"line-offset":new yn(j.paint_line["line-offset"]),"line-blur":new yn(j.paint_line["line-blur"]),"line-dasharray":new qo(j.paint_line["line-dasharray"]),"line-pattern":new Ls(j.paint_line["line-pattern"]),"line-gradient":new mu(j.paint_line["line-gradient"])}),layout:Uv},qp=new(function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.possiblyEvaluate=function(c,m){return m=new B(Math.floor(m.zoom),{now:m.now,fadeDuration:m.fadeDuration,zoomHistory:m.zoomHistory,transition:m.transition}),a.prototype.possiblyEvaluate.call(this,c,m)},u.prototype.evaluate=function(c,m,x,E){return m=Zt({},m,{zoom:Math.floor(m.zoom)}),a.prototype.evaluate.call(this,c,m,x,E)},u}(yn))($f.paint.properties["line-width"].specification);qp.useIntegerZoom=!0;var Ud=function(a){function u(c){a.call(this,c,$f),this.gradientVersion=0}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._handleSpecialPaintPropertyUpdate=function(c){c==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Os,this.gradientVersion=(this.gradientVersion+1)%et)},u.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},u.prototype.recalculate=function(c,m){a.prototype.recalculate.call(this,c,m),this.paint._values["line-floorwidth"]=qp.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,c)},u.prototype.createBucket=function(c){return new Jo(c)},u.prototype.queryRadius=function(c){var m=c,x=Kp(Ko("line-width",this,m),Ko("line-gap-width",this,m)),E=Ko("line-offset",this,m);return x/2+Math.abs(E)+Qa(this.paint.get("line-translate"))},u.prototype.queryIntersectsFeature=function(c,m,x,E,A,I,D){var N=As(c,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),I.angle,D),H=D/2*Kp(this.paint.get("line-width").evaluate(m,x),this.paint.get("line-gap-width").evaluate(m,x)),X=this.paint.get("line-offset").evaluate(m,x);return X&&(E=function(ne,R){for(var Pe=[],Be=new se(0,0),rt=0;rt=3){for(var Ge=0;Ge0?u+2*a:a}var zv=wo([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Zv=wo([{name:"a_projected_pos",components:3,type:"Float32"}],4),zd=(wo([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),wo([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Zd=(wo([{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"}]),wo([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),z=wo([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ae(a,u,c){return a.sections.forEach(function(m){m.text=function(x,E,A){var I=E.layout.get("text-transform").evaluate(A,{});return I==="uppercase"?x=x.toLocaleUpperCase():I==="lowercase"&&(x=x.toLocaleLowerCase()),Fe.applyArabicShaping&&(x=Fe.applyArabicShaping(x)),x}(m.text,u,c)}),a}wo([{name:"triangle",components:3,type:"Uint16"}]),wo([{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"}]),wo([{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"}]),wo([{type:"Float32",name:"offsetX"}]),wo([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var je={"!":"\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"},jt=function(a,u,c,m,x){var E,A,I=8*x-m-1,D=(1<>1,H=-7,X=c?x-1:0,ne=c?-1:1,R=a[u+X];for(X+=ne,E=R&(1<<-H)-1,R>>=-H,H+=I;H>0;E=256*E+a[u+X],X+=ne,H-=8);for(A=E&(1<<-H)-1,E>>=-H,H+=m;H>0;A=256*A+a[u+X],X+=ne,H-=8);if(E===0)E=1-N;else{if(E===D)return A?NaN:1/0*(R?-1:1);A+=Math.pow(2,m),E-=N}return(R?-1:1)*A*Math.pow(2,E-m)},pr=function(a,u,c,m,x,E){var A,I,D,N=8*E-x-1,H=(1<>1,ne=x===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=m?0:E-1,Pe=m?1:-1,Be=u<0||u===0&&1/u<0?1:0;for(u=Math.abs(u),isNaN(u)||u===1/0?(I=isNaN(u)?1:0,A=H):(A=Math.floor(Math.log(u)/Math.LN2),u*(D=Math.pow(2,-A))<1&&(A--,D*=2),(u+=A+X>=1?ne/D:ne*Math.pow(2,1-X))*D>=2&&(A++,D/=2),A+X>=H?(I=0,A=H):A+X>=1?(I=(u*D-1)*Math.pow(2,x),A+=X):(I=u*Math.pow(2,X-1)*Math.pow(2,x),A=0));x>=8;a[c+R]=255&I,R+=Pe,I/=256,x-=8);for(A=A<0;a[c+R]=255&A,R+=Pe,A/=256,N-=8);a[c+R-Pe]|=128*Be},Gt=kt;function kt(a){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(a)?a:new Uint8Array(a||0),this.pos=0,this.type=0,this.length=this.buf.length}kt.Varint=0,kt.Fixed64=1,kt.Bytes=2,kt.Fixed32=5;var Dr=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");function Cr(a){return a.type===kt.Bytes?a.readVarint()+a.pos:a.pos+1}function Vr(a,u,c){return c?4294967296*u+(a>>>0):4294967296*(u>>>0)+(a>>>0)}function Br(a,u,c){var m=u<=16383?1:u<=2097151?2:u<=268435455?3:Math.floor(Math.log(u)/(7*Math.LN2));c.realloc(m);for(var x=c.pos-1;x>=a;x--)c.buf[x+m]=c.buf[x]}function Ur(a,u){for(var c=0;c>>8,a[c+2]=u>>>16,a[c+3]=u>>>24}function nn(a,u){return(a[u]|a[u+1]<<8|a[u+2]<<16)+(a[u+3]<<24)}function br(a,u,c){a===1&&c.readMessage($r,u)}function $r(a,u,c){if(a===3){var m=c.readMessage(Nn,{}),x=m.width,E=m.height,A=m.left,I=m.top,D=m.advance;u.push({id:m.id,bitmap:new _u({width:x+6,height:E+6},m.bitmap),metrics:{width:x,height:E,left:A,top:I,advance:D}})}}function Nn(a,u,c){a===1?u.id=c.readVarint():a===2?u.bitmap=c.readBytes():a===3?u.width=c.readVarint():a===4?u.height=c.readVarint():a===5?u.left=c.readSVarint():a===6?u.top=c.readSVarint():a===7&&(u.advance=c.readVarint())}function ui(a){for(var u=0,c=0,m=0,x=a;m=0;ne--){var R=A[ne];if(!(X.w>R.w||X.h>R.h)){if(X.x=R.x,X.y=R.y,D=Math.max(D,X.y+X.h),I=Math.max(I,X.x+X.w),X.w===R.w&&X.h===R.h){var Pe=A.pop();ne>3,E=this.pos;this.type=7&m,a(x,u,this),this.pos===E&&this.skip(m)}return u},readMessage:function(a,u){return this.readFields(a,u,this.readVarint()+this.pos)},readFixed32:function(){var a=an(this.buf,this.pos);return this.pos+=4,a},readSFixed32:function(){var a=nn(this.buf,this.pos);return this.pos+=4,a},readFixed64:function(){var a=an(this.buf,this.pos)+4294967296*an(this.buf,this.pos+4);return this.pos+=8,a},readSFixed64:function(){var a=an(this.buf,this.pos)+4294967296*nn(this.buf,this.pos+4);return this.pos+=8,a},readFloat:function(){var a=jt(this.buf,this.pos,!0,23,4);return this.pos+=4,a},readDouble:function(){var a=jt(this.buf,this.pos,!0,52,8);return this.pos+=8,a},readVarint:function(a){var u,c,m=this.buf;return u=127&(c=m[this.pos++]),c<128?u:(u|=(127&(c=m[this.pos++]))<<7,c<128?u:(u|=(127&(c=m[this.pos++]))<<14,c<128?u:(u|=(127&(c=m[this.pos++]))<<21,c<128?u:function(x,E,A){var I,D,N=A.buf;if(I=(112&(D=N[A.pos++]))>>4,D<128||(I|=(127&(D=N[A.pos++]))<<3,D<128)||(I|=(127&(D=N[A.pos++]))<<10,D<128)||(I|=(127&(D=N[A.pos++]))<<17,D<128)||(I|=(127&(D=N[A.pos++]))<<24,D<128)||(I|=(1&(D=N[A.pos++]))<<31,D<128))return Vr(x,I,E);throw new Error("Expected varint not more than 10 bytes")}(u|=(15&(c=m[this.pos]))<<28,a,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var a=this.readVarint();return a%2==1?(a+1)/-2:a/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var a=this.readVarint()+this.pos,u=this.pos;return this.pos=a,a-u>=12&&Dr?function(c,m,x){return Dr.decode(c.subarray(m,x))}(this.buf,u,a):function(c,m,x){for(var E="",A=m;A239?4:H>223?3:H>191?2:1;if(A+ne>x)break;ne===1?H<128&&(X=H):ne===2?(192&(I=c[A+1]))==128&&(X=(31&H)<<6|63&I)<=127&&(X=null):ne===3?(D=c[A+2],(192&(I=c[A+1]))==128&&(192&D)==128&&((X=(15&H)<<12|(63&I)<<6|63&D)<=2047||X>=55296&&X<=57343)&&(X=null)):ne===4&&(D=c[A+2],N=c[A+3],(192&(I=c[A+1]))==128&&(192&D)==128&&(192&N)==128&&((X=(15&H)<<18|(63&I)<<12|(63&D)<<6|63&N)<=65535||X>=1114112)&&(X=null)),X===null?(X=65533,ne=1):X>65535&&(X-=65536,E+=String.fromCharCode(X>>>10&1023|55296),X=56320|1023&X),E+=String.fromCharCode(X),A+=ne}return E}(this.buf,u,a)},readBytes:function(){var a=this.readVarint()+this.pos,u=this.buf.subarray(this.pos,a);return this.pos=a,u},readPackedVarint:function(a,u){if(this.type!==kt.Bytes)return a.push(this.readVarint(u));var c=Cr(this);for(a=a||[];this.pos127;);else if(u===kt.Bytes)this.pos=this.readVarint()+this.pos;else if(u===kt.Fixed32)this.pos+=4;else{if(u!==kt.Fixed64)throw new Error("Unimplemented type: "+u);this.pos+=8}},writeTag:function(a,u){this.writeVarint(a<<3|u)},realloc:function(a){for(var u=this.length||16;u268435455||a<0?function(u,c){var m,x;if(u>=0?(m=u%4294967296|0,x=u/4294967296|0):(x=~(-u/4294967296),4294967295^(m=~(-u%4294967296))?m=m+1|0:(m=0,x=x+1|0)),u>=18446744073709552e3||u<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");c.realloc(10),function(E,A,I){I.buf[I.pos++]=127&E|128,E>>>=7,I.buf[I.pos++]=127&E|128,E>>>=7,I.buf[I.pos++]=127&E|128,E>>>=7,I.buf[I.pos++]=127&E|128,I.buf[I.pos]=127&(E>>>=7)}(m,0,c),function(E,A){var I=(7&E)<<4;A.buf[A.pos++]|=I|((E>>>=3)?128:0),E&&(A.buf[A.pos++]=127&E|((E>>>=7)?128:0),E&&(A.buf[A.pos++]=127&E|((E>>>=7)?128:0),E&&(A.buf[A.pos++]=127&E|((E>>>=7)?128:0),E&&(A.buf[A.pos++]=127&E|((E>>>=7)?128:0),E&&(A.buf[A.pos++]=127&E)))))}(x,c)}(a,this):(this.realloc(4),this.buf[this.pos++]=127&a|(a>127?128:0),a<=127||(this.buf[this.pos++]=127&(a>>>=7)|(a>127?128:0),a<=127||(this.buf[this.pos++]=127&(a>>>=7)|(a>127?128:0),a<=127||(this.buf[this.pos++]=a>>>7&127))))},writeSVarint:function(a){this.writeVarint(a<0?2*-a-1:2*a)},writeBoolean:function(a){this.writeVarint(!!a)},writeString:function(a){a=String(a),this.realloc(4*a.length),this.pos++;var u=this.pos;this.pos=function(m,x,E){for(var A,I,D=0;D55295&&A<57344){if(!I){A>56319||D+1===x.length?(m[E++]=239,m[E++]=191,m[E++]=189):I=A;continue}if(A<56320){m[E++]=239,m[E++]=191,m[E++]=189,I=A;continue}A=I-55296<<10|A-56320|65536,I=null}else I&&(m[E++]=239,m[E++]=191,m[E++]=189,I=null);A<128?m[E++]=A:(A<2048?m[E++]=A>>6|192:(A<65536?m[E++]=A>>12|224:(m[E++]=A>>18|240,m[E++]=A>>12&63|128),m[E++]=A>>6&63|128),m[E++]=63&A|128)}return E}(this.buf,a,this.pos);var c=this.pos-u;c>=128&&Br(u,c,this),this.pos=u-1,this.writeVarint(c),this.pos+=c},writeFloat:function(a){this.realloc(4),pr(this.buf,a,this.pos,!0,23,4),this.pos+=4},writeDouble:function(a){this.realloc(8),pr(this.buf,a,this.pos,!0,52,8),this.pos+=8},writeBytes:function(a){var u=a.length;this.writeVarint(u),this.realloc(u);for(var c=0;c=128&&Br(c,m,this),this.pos=c-1,this.writeVarint(m),this.pos+=m},writeMessage:function(a,u,c){this.writeTag(a,kt.Bytes),this.writeRawMessage(u,c)},writePackedVarint:function(a,u){u.length&&this.writeMessage(a,Ur,u)},writePackedSVarint:function(a,u){u.length&&this.writeMessage(a,Gr,u)},writePackedBoolean:function(a,u){u.length&&this.writeMessage(a,Tt,u)},writePackedFloat:function(a,u){u.length&&this.writeMessage(a,Ar,u)},writePackedDouble:function(a,u){u.length&&this.writeMessage(a,zr,u)},writePackedFixed32:function(a,u){u.length&&this.writeMessage(a,er,u)},writePackedSFixed32:function(a,u){u.length&&this.writeMessage(a,Fr,u)},writePackedFixed64:function(a,u){u.length&&this.writeMessage(a,rn,u)},writePackedSFixed64:function(a,u){u.length&&this.writeMessage(a,yr,u)},writeBytesField:function(a,u){this.writeTag(a,kt.Bytes),this.writeBytes(u)},writeFixed32Field:function(a,u){this.writeTag(a,kt.Fixed32),this.writeFixed32(u)},writeSFixed32Field:function(a,u){this.writeTag(a,kt.Fixed32),this.writeSFixed32(u)},writeFixed64Field:function(a,u){this.writeTag(a,kt.Fixed64),this.writeFixed64(u)},writeSFixed64Field:function(a,u){this.writeTag(a,kt.Fixed64),this.writeSFixed64(u)},writeVarintField:function(a,u){this.writeTag(a,kt.Varint),this.writeVarint(u)},writeSVarintField:function(a,u){this.writeTag(a,kt.Varint),this.writeSVarint(u)},writeStringField:function(a,u){this.writeTag(a,kt.Bytes),this.writeString(u)},writeFloatField:function(a,u){this.writeTag(a,kt.Fixed32),this.writeFloat(u)},writeDoubleField:function(a,u){this.writeTag(a,kt.Fixed64),this.writeDouble(u)},writeBooleanField:function(a,u){this.writeVarintField(a,!!u)}};var Qr=function(a,u){var c=u.pixelRatio,m=u.version,x=u.stretchX,E=u.stretchY,A=u.content;this.paddedRect=a,this.pixelRatio=c,this.stretchX=x,this.stretchY=E,this.content=A,this.version=m},yt={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};yt.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},yt.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},yt.tlbr.get=function(){return this.tl.concat(this.br)},yt.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Qr.prototype,yt);var vr=function(a,u){var c={},m={};this.haveRenderCallbacks=[];var x=[];this.addImages(a,c,x),this.addImages(u,m,x);var E=ui(x),A=new Qo({width:E.w||1,height:E.h||1});for(var I in a){var D=a[I],N=c[I].paddedRect;Qo.copy(D.data,A,{x:0,y:0},{x:N.x+1,y:N.y+1},D.data)}for(var H in u){var X=u[H],ne=m[H].paddedRect,R=ne.x+1,Pe=ne.y+1,Be=X.data.width,rt=X.data.height;Qo.copy(X.data,A,{x:0,y:0},{x:R,y:Pe},X.data),Qo.copy(X.data,A,{x:0,y:rt-1},{x:R,y:Pe-1},{width:Be,height:1}),Qo.copy(X.data,A,{x:0,y:0},{x:R,y:Pe+rt},{width:Be,height:1}),Qo.copy(X.data,A,{x:Be-1,y:0},{x:R-1,y:Pe},{width:1,height:rt}),Qo.copy(X.data,A,{x:0,y:0},{x:R+Be,y:Pe},{width:1,height:rt})}this.image=A,this.iconPositions=c,this.patternPositions=m};vr.prototype.addImages=function(a,u,c){for(var m in a){var x=a[m],E={x:0,y:0,w:x.data.width+2,h:x.data.height+2};c.push(E),u[m]=new Qr(E,x),x.hasRenderCallback&&this.haveRenderCallbacks.push(m)}},vr.prototype.patchUpdatedImages=function(a,u){for(var c in a.dispatchRenderCallbacks(this.haveRenderCallbacks),a.updatedImages)this.patchUpdatedImage(this.iconPositions[c],a.getImage(c),u),this.patchUpdatedImage(this.patternPositions[c],a.getImage(c),u)},vr.prototype.patchUpdatedImage=function(a,u,c){if(a&&u&&a.version!==u.version){a.version=u.version;var m=a.tl;c.update(u.data,void 0,{x:m[0],y:m[1]})}},_n("ImagePosition",Qr),_n("ImageAtlas",vr);var ot={horizontal:1,vertical:2,horizontalOnly:3},Ci=function(){this.scale=1,this.fontStack="",this.imageName=null};Ci.forText=function(a,u){var c=new Ci;return c.scale=a||1,c.fontStack=u,c},Ci.forImage=function(a){var u=new Ci;return u.imageName=a,u};var ln=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function yi(a,u,c,m,x,E,A,I,D,N,H,X,ne,R,Pe,Be){var rt,Ge=ln.fromFeature(a,x);X===ot.vertical&&Ge.verticalizePunctuation();var St=Fe.processBidirectionalText,Ft=Fe.processStyledBidirectionalText;if(St&&Ge.sections.length===1){rt=[];for(var Yt=0,qt=St(Ge.toString(),fo(Ge,N,E,u,m,R,Pe));Yt0&&Jf>Oo&&(Oo=Jf)}else{var vc=gi[Ki.fontStack],Ep=vc&&vc[su];if(Ep&&Ep.rect)Vl=Ep.rect,to=Ep.metrics;else{var ed=Di[Ki.fontStack],Xd=ed&&ed[su];if(!Xd)continue;to=Xd.metrics}vl=24*($i-Ki.scale)}pc?(Rn.verticalizable=!0,Ba.push({glyph:su,imageName:$u,x:Uo,y:Vs+vl,vertical:pc,scale:Ki.scale,fontStack:Ki.fontStack,sectionIndex:Zl,metrics:to,rect:Vl}),Uo+=Ef*Ki.scale+Za):(Ba.push({glyph:su,imageName:$u,x:Uo,y:Vs+vl,vertical:pc,scale:Ki.scale,fontStack:Ki.fontStack,sectionIndex:Zl,metrics:to,rect:Vl}),Uo+=to.advance*Ki.scale+Za)}Ba.length!==0&&(ka=Math.max(Uo-Za,ka),yo(Ba,0,Ba.length-1,So,Oo)),Uo=0;var td=ia*$i+Oo;ns.lineOffset=Math.max(Oo,Hs),Vs+=td,js=Math.max(td,js),++rs}else Vs+=ia,++rs}var Hc,Sf=Vs- -17,Sp=Sa(za),eh=Sp.horizontalAlign,Ap=Sp.verticalAlign;(function(rd,$d,nd,id,Wc,kh,th,Bh,rh){var nh,Tp=($d-nd)*Wc;nh=kh!==th?-Bh*id- -17:(-id*rh+.5)*th;for(var Gc=0,Lh=rd;Gc=0&&m>=a&&si[this.text.charCodeAt(m)];m--)c--;this.text=this.text.substring(a,c),this.sectionIndex=this.sectionIndex.slice(a,c)},ln.prototype.substring=function(a,u){var c=new ln;return c.text=this.text.substring(a,u),c.sectionIndex=this.sectionIndex.slice(a,u),c.sections=this.sections,c},ln.prototype.toString=function(){return this.text},ln.prototype.getMaxScale=function(){var a=this;return this.sectionIndex.reduce(function(u,c){return Math.max(u,a.sections[c].scale)},0)},ln.prototype.addTextSection=function(a,u){this.text+=a.text,this.sections.push(Ci.forText(a.scale,a.fontStack||u));for(var c=this.sections.length-1,m=0;m=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var si={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Qn={};function Vi(a,u,c,m,x,E){if(u.imageName){var A=m[u.imageName];return A?A.displaySize[0]*u.scale*24/E+x:0}var I=c[u.fontStack],D=I&&I[a];return D?D.metrics.advance*u.scale+x:0}function _o(a,u,c,m){var x=Math.pow(a-u,2);return m?a=0,X=0,ne=0;ne-c/2;){if(--A<0)return!1;I-=a[A].dist(E),E=a[A]}I+=a[A].dist(a[A+1]),A++;for(var D=[],N=0;Im;)N-=D.shift().angleDelta;if(N>x)return!1;A++,I+=H.dist(X)}return!0}function ua(a){for(var u=0,c=0;cN){var Pe=(N-D)/R,Be=qa(X.x,ne.x,Pe),rt=qa(X.y,ne.y,Pe),Ge=new Ja(Be,rt,ne.angleTo(X),H);return Ge._round(),!A||es(a,Ge,I,A,u)?Ge:void 0}D+=R}}function bo(a,u,c,m,x,E,A,I,D){var N=Xn(m,E,A),H=Oi(m,x),X=H*A,ne=a[0].x===0||a[0].x===D||a[0].y===0||a[0].y===D;return u-X=0&&Ui=0&&jn=0&&cn+Lr<=Xr){var ia=new Ja(Ui,jn,Di,pn);ia._round(),Ge&&!es(Pe,ia,Ft,Ge,St)||Vn.push(ia)}}Bn+=Rn}return qt||Vn.length||Yt||(Vn=R(Pe,Bn/2,rt,Ge,St,Ft,Yt,!0,dr)),Vn}(a,ne?u/2*I%u:(H/2+2*E)*A*I%u,u,N,c,X,ne,!1,D)}function Xu(a,u,c,m,x){for(var E=[],A=0;A=m&&X.x>=m||(H.x>=m?H=new se(m,H.y+(m-H.x)/(X.x-H.x)*(X.y-H.y))._round():X.x>=m&&(X=new se(m,H.y+(m-H.x)/(X.x-H.x)*(X.y-H.y))._round()),H.y>=x&&X.y>=x||(H.y>=x?H=new se(H.x+(x-H.y)/(X.y-H.y)*(X.x-H.x),x)._round():X.y>=x&&(X=new se(H.x+(x-H.y)/(X.y-H.y)*(X.x-H.x),x)._round()),D&&H.equals(D[D.length-1])||E.push(D=[H]),D.push(X)))))}return E}function Ne(a,u,c,m){var x=[],E=a.image,A=E.pixelRatio,I=E.paddedRect.w-2,D=E.paddedRect.h-2,N=a.right-a.left,H=a.bottom-a.top,X=E.stretchX||[[0,I]],ne=E.stretchY||[[0,D]],R=function(Ui,jn){return Ui+jn[1]-jn[0]},Pe=X.reduce(R,0),Be=ne.reduce(R,0),rt=I-Pe,Ge=D-Be,St=0,Ft=Pe,Yt=0,qt=Be,dr=0,Lr=rt,Xr=0,Bn=Ge;if(E.content&&m){var cn=E.content;St=$t(X,0,cn[0]),Yt=$t(ne,0,cn[1]),Ft=$t(X,cn[0],cn[2]),qt=$t(ne,cn[1],cn[3]),dr=cn[0]-St,Xr=cn[1]-Yt,Lr=cn[2]-cn[0]-Ft,Bn=cn[3]-cn[1]-qt}var Vn=function(Ui,jn,ia,za){var eo=hn(Ui.stretch-St,Ft,N,a.left),uo=bi(Ui.fixed-dr,Lr,Ui.stretch,Pe),Za=hn(jn.stretch-Yt,qt,H,a.top),ho=bi(jn.fixed-Xr,Bn,jn.stretch,Be),Go=hn(ia.stretch-St,Ft,N,a.left),Uo=bi(ia.fixed-dr,Lr,ia.stretch,Pe),Vs=hn(za.stretch-Yt,qt,H,a.top),ka=bi(za.fixed-Xr,Bn,za.stretch,Be),js=new se(eo,Za),So=new se(Go,Za),rs=new se(Go,Vs),ji=new se(eo,Vs),fa=new se(uo/A,ho/A),va=new se(Uo/A,ka/A),$i=u*Math.PI/180;if($i){var Hs=Math.sin($i),ns=Math.cos($i),Ba=[ns,-Hs,Hs,ns];js._matMult(Ba),So._matMult(Ba),ji._matMult(Ba),rs._matMult(Ba)}var Oo=Ui.stretch+Ui.fixed,ws=jn.stretch+jn.fixed;return{tl:js,tr:So,bl:ji,br:rs,tex:{x:E.paddedRect.x+1+Oo,y:E.paddedRect.y+1+ws,w:ia.stretch+ia.fixed-Oo,h:za.stretch+za.fixed-ws},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:fa,pixelOffsetBR:va,minFontScaleX:Lr/A/N,minFontScaleY:Bn/A/H,isSDF:c}};if(m&&(E.stretchX||E.stretchY))for(var pn=Nt(X,rt,Pe),Ei=Nt(ne,Ge,Be),ti=0;ti0&&(R=Math.max(10,R),this.circleDiameter=R)}else{var Pe=E.top*A-I,Be=E.bottom*A+I,rt=E.left*A-I,Ge=E.right*A+I,St=E.collisionPadding;if(St&&(rt-=St[0]*A,Pe-=St[1]*A,Ge+=St[2]*A,Be+=St[3]*A),N){var Ft=new se(rt,Pe),Yt=new se(Ge,Pe),qt=new se(rt,Be),dr=new se(Ge,Be),Lr=N*Math.PI/180;Ft._rotate(Lr),Yt._rotate(Lr),qt._rotate(Lr),dr._rotate(Lr),rt=Math.min(Ft.x,Yt.x,qt.x,dr.x),Ge=Math.max(Ft.x,Yt.x,qt.x,dr.x),Pe=Math.min(Ft.y,Yt.y,qt.y,dr.y),Be=Math.max(Ft.y,Yt.y,qt.y,dr.y)}a.emplaceBack(u.x,u.y,rt,Pe,Ge,Be,c,m,x)}this.boxEndIndex=a.length},ce=function(a,u){if(a===void 0&&(a=[]),u===void 0&&(u=Te),this.data=a,this.length=this.data.length,this.compare=u,this.length>0)for(var c=(this.length>>1)-1;c>=0;c--)this._down(c)};function Te(a,u){return au?1:0}function Ve(a,u,c){u===void 0&&(u=1),c===void 0&&(c=!1);for(var m=1/0,x=1/0,E=-1/0,A=-1/0,I=a[0],D=0;DE)&&(E=N.x),(!D||N.y>A)&&(A=N.y)}var H=Math.min(E-m,A-x),X=H/2,ne=new ce([],Ut);if(H===0)return new se(m,x);for(var R=m;RBe.d||!Be.d)&&(Be=Ge,c&&console.log("found best %d after %d probes",Math.round(1e4*Ge.d)/1e4,rt)),Ge.max-Be.d<=u||(ne.push(new Bt(Ge.p.x-(X=Ge.h/2),Ge.p.y-X,X,a)),ne.push(new Bt(Ge.p.x+X,Ge.p.y-X,X,a)),ne.push(new Bt(Ge.p.x-X,Ge.p.y+X,X,a)),ne.push(new Bt(Ge.p.x+X,Ge.p.y+X,X,a)),rt+=4)}return c&&(console.log("num probes: "+rt),console.log("best distance: "+Be.d)),Be.p}function Ut(a,u){return u.max-a.max}function Bt(a,u,c,m){this.p=new se(a,u),this.h=c,this.d=function(x,E){for(var A=!1,I=1/0,D=0;Dx.y!=Pe.y>x.y&&x.x<(Pe.x-R.x)*(x.y-R.y)/(Pe.y-R.y)+R.x&&(A=!A),I=Math.min(I,kl(x,R,Pe))}return(A?1:-1)*Math.sqrt(I)}(this.p,m),this.max=this.d+this.h*Math.SQRT2}ce.prototype.push=function(a){this.data.push(a),this.length++,this._up(this.length-1)},ce.prototype.pop=function(){if(this.length!==0){var a=this.data[0],u=this.data.pop();return this.length--,this.length>0&&(this.data[0]=u,this._down(0)),a}},ce.prototype.peek=function(){return this.data[0]},ce.prototype._up=function(a){for(var u=this.data,c=this.compare,m=u[a];a>0;){var x=a-1>>1,E=u[x];if(c(m,E)>=0)break;u[a]=E,a=x}u[a]=m},ce.prototype._down=function(a){for(var u=this.data,c=this.compare,m=this.length>>1,x=u[a];a=0)break;u[a]=A,a=E}u[a]=x};var tt=Number.POSITIVE_INFINITY;function ft(a,u){return u[1]!==tt?function(c,m,x){var E=0,A=0;switch(m=Math.abs(m),x=Math.abs(x),c){case"top-right":case"top-left":case"top":A=x-7;break;case"bottom-right":case"bottom-left":case"bottom":A=7-x}switch(c){case"top-right":case"bottom-right":case"right":E=-m;break;case"top-left":case"bottom-left":case"left":E=m}return[E,A]}(a,u[0],u[1]):function(c,m){var x=0,E=0;m<0&&(m=0);var A=m/Math.sqrt(2);switch(c){case"top-right":case"top-left":E=A-7;break;case"bottom-right":case"bottom-left":E=7-A;break;case"bottom":E=7-m;break;case"top":E=m-7}switch(c){case"top-right":case"bottom-right":x=-A;break;case"top-left":case"bottom-left":x=A;break;case"left":x=m;break;case"right":x=-m}return[x,E]}(a,u[0])}function mt(a){switch(a){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function De(a,u,c,m,x,E,A,I,D,N,H,X,ne,R,Pe){var Be=function(Yt,qt,dr,Lr,Xr,Bn,cn,Vn){for(var pn=Lr.layout.get("text-rotate").evaluate(Bn,{})*Math.PI/180,Ei=[],ti=0,Rn=qt.positionedLines;ti32640&&qe(a.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):rt.kind==="composite"&&((Ge=[128*R.compositeTextSizes[0].evaluate(A,{},Pe),128*R.compositeTextSizes[1].evaluate(A,{},Pe)])[0]>32640||Ge[1]>32640)&&qe(a.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),a.addSymbols(a.text,Be,Ge,I,E,A,N,u,D.lineStartIndex,D.lineLength,ne,Pe);for(var St=0,Ft=H;St=0;A--)if(m.dist(E[A])0)&&(E.value.kind!=="constant"||E.value.value.length>0),N=I.value.kind!=="constant"||!!I.value.value||Object.keys(I.parameters).length>0,H=x.get("symbol-sort-key");if(this.features=[],D||N){for(var X=u.iconDependencies,ne=u.glyphDependencies,R=u.availableImages,Pe=new B(this.zoom),Be=0,rt=a;Be=0;for(var Di=0,gi=Xr.sections;Di=0;I--)E[I]={x:u[I].x,y:u[I].y,tileUnitDistanceFromAnchor:x},I>0&&(x+=u[I-1].dist(u[I]));for(var D=0;D0},xn.prototype.hasIconData=function(){return this.icon.segments.get().length>0},xn.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},xn.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},xn.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},xn.prototype.addIndicesForPlacedSymbol=function(a,u){for(var c=a.placedSymbolArray.get(u),m=c.vertexStartIndex+4*c.numGlyphs,x=c.vertexStartIndex;x1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(a),this.sortedAngle=a,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var c=0,m=this.symbolInstanceIndexes;c=0&&I.indexOf(E)===A&&u.addIndicesForPlacedSymbol(u.text,E)}),x.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,x.verticalPlacedTextSymbolIndex),x.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,x.placedIconSymbolIndex),x.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,x.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},_n("SymbolBucket",xn,{omit:["layers","collisionBoxArray","features","compareText"]}),xn.MAX_GLYPHS=65535,xn.addDynamicAttributes=xr;var Tn=new Fa({"symbol-placement":new kn(j.layout_symbol["symbol-placement"]),"symbol-spacing":new kn(j.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new kn(j.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new yn(j.layout_symbol["symbol-sort-key"]),"symbol-z-order":new kn(j.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new kn(j.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new kn(j.layout_symbol["icon-ignore-placement"]),"icon-optional":new kn(j.layout_symbol["icon-optional"]),"icon-rotation-alignment":new kn(j.layout_symbol["icon-rotation-alignment"]),"icon-size":new yn(j.layout_symbol["icon-size"]),"icon-text-fit":new kn(j.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new kn(j.layout_symbol["icon-text-fit-padding"]),"icon-image":new yn(j.layout_symbol["icon-image"]),"icon-rotate":new yn(j.layout_symbol["icon-rotate"]),"icon-padding":new kn(j.layout_symbol["icon-padding"]),"icon-keep-upright":new kn(j.layout_symbol["icon-keep-upright"]),"icon-offset":new yn(j.layout_symbol["icon-offset"]),"icon-anchor":new yn(j.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new kn(j.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new kn(j.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new kn(j.layout_symbol["text-rotation-alignment"]),"text-field":new yn(j.layout_symbol["text-field"]),"text-font":new yn(j.layout_symbol["text-font"]),"text-size":new yn(j.layout_symbol["text-size"]),"text-max-width":new yn(j.layout_symbol["text-max-width"]),"text-line-height":new kn(j.layout_symbol["text-line-height"]),"text-letter-spacing":new yn(j.layout_symbol["text-letter-spacing"]),"text-justify":new yn(j.layout_symbol["text-justify"]),"text-radial-offset":new yn(j.layout_symbol["text-radial-offset"]),"text-variable-anchor":new kn(j.layout_symbol["text-variable-anchor"]),"text-anchor":new yn(j.layout_symbol["text-anchor"]),"text-max-angle":new kn(j.layout_symbol["text-max-angle"]),"text-writing-mode":new kn(j.layout_symbol["text-writing-mode"]),"text-rotate":new yn(j.layout_symbol["text-rotate"]),"text-padding":new kn(j.layout_symbol["text-padding"]),"text-keep-upright":new kn(j.layout_symbol["text-keep-upright"]),"text-transform":new yn(j.layout_symbol["text-transform"]),"text-offset":new yn(j.layout_symbol["text-offset"]),"text-allow-overlap":new kn(j.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new kn(j.layout_symbol["text-ignore-placement"]),"text-optional":new kn(j.layout_symbol["text-optional"])}),$n={paint:new Fa({"icon-opacity":new yn(j.paint_symbol["icon-opacity"]),"icon-color":new yn(j.paint_symbol["icon-color"]),"icon-halo-color":new yn(j.paint_symbol["icon-halo-color"]),"icon-halo-width":new yn(j.paint_symbol["icon-halo-width"]),"icon-halo-blur":new yn(j.paint_symbol["icon-halo-blur"]),"icon-translate":new kn(j.paint_symbol["icon-translate"]),"icon-translate-anchor":new kn(j.paint_symbol["icon-translate-anchor"]),"text-opacity":new yn(j.paint_symbol["text-opacity"]),"text-color":new yn(j.paint_symbol["text-color"],{runtimeType:Yr,getOverride:function(a){return a.textColor},hasOverride:function(a){return!!a.textColor}}),"text-halo-color":new yn(j.paint_symbol["text-halo-color"]),"text-halo-width":new yn(j.paint_symbol["text-halo-width"]),"text-halo-blur":new yn(j.paint_symbol["text-halo-blur"]),"text-translate":new kn(j.paint_symbol["text-translate"]),"text-translate-anchor":new kn(j.paint_symbol["text-translate-anchor"])}),layout:Tn},ii=function(a){this.type=a.property.overrides?a.property.overrides.runtimeType:sn,this.defaultValue=a};ii.prototype.evaluate=function(a){if(a.formattedSection){var u=this.defaultValue.property.overrides;if(u&&u.hasOverride(a.formattedSection))return u.getOverride(a.formattedSection)}return a.feature&&a.featureState?this.defaultValue.evaluate(a.feature,a.featureState):this.defaultValue.property.specification.default},ii.prototype.eachChild=function(a){this.defaultValue.isConstant()||a(this.defaultValue.value._styleExpression.expression)},ii.prototype.outputDefined=function(){return!1},ii.prototype.serialize=function(){return null},_n("FormatSectionOverride",ii,{omit:["defaultValue"]});var na=function(a){function u(c){a.call(this,c,$n)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.recalculate=function(c,m){if(a.prototype.recalculate.call(this,c,m),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 x=this.layout.get("text-writing-mode");if(x){for(var E=[],A=0,I=x;A",targetMapId:m,sourceMapId:E.mapId})}}},gp.prototype.receive=function(a){var u=a.data,c=u.id;if(c&&(!u.targetMapId||this.mapId===u.targetMapId))if(u.type===""){delete this.tasks[c];var m=this.cancelCallbacks[c];delete this.cancelCallbacks[c],m&&m()}else re()||u.mustQueue?(this.tasks[c]=u,this.taskQueue.push(c),this.invoker.trigger()):this.processTask(c,u)},gp.prototype.process=function(){if(this.taskQueue.length){var a=this.taskQueue.shift(),u=this.tasks[a];delete this.tasks[a],this.taskQueue.length&&this.invoker.trigger(),u&&this.processTask(a,u)}},gp.prototype.processTask=function(a,u){var c=this;if(u.type===""){var m=this.callbacks[a];delete this.callbacks[a],m&&(u.error?m(ga(u.error)):m(null,ga(u.data)))}else{var x=!1,E=Me(this.globalScope)?void 0:[],A=u.hasCallback?function(H,X){x=!0,delete c.cancelCallbacks[a],c.target.postMessage({id:a,type:"",sourceMapId:c.mapId,error:H?us(H):null,data:us(X,E)},E)}:function(H){x=!0},I=null,D=ga(u.data);if(this.parent[u.type])I=this.parent[u.type](u.sourceMapId,D,A);else if(this.parent.getWorkerSource){var N=u.type.split(".");I=this.parent.getWorkerSource(u.sourceMapId,N[0],D.source)[N[1]](D,A)}else A(new Error("Could not find function "+u.type));!x&&I&&I.cancel&&(this.cancelCallbacks[a]=I.cancel)}},gp.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var No=function(a,u){a&&(u?this.setSouthWest(a).setNorthEast(u):a.length===4?this.setSouthWest([a[0],a[1]]).setNorthEast([a[2],a[3]]):this.setSouthWest(a[0]).setNorthEast(a[1]))};No.prototype.setNorthEast=function(a){return this._ne=a instanceof $a?new $a(a.lng,a.lat):$a.convert(a),this},No.prototype.setSouthWest=function(a){return this._sw=a instanceof $a?new $a(a.lng,a.lat):$a.convert(a),this},No.prototype.extend=function(a){var u,c,m=this._sw,x=this._ne;if(a instanceof $a)u=a,c=a;else{if(!(a instanceof No))return Array.isArray(a)?a.length===4||a.every(Array.isArray)?this.extend(No.convert(a)):this.extend($a.convert(a)):this;if(c=a._ne,!(u=a._sw)||!c)return this}return m||x?(m.lng=Math.min(u.lng,m.lng),m.lat=Math.min(u.lat,m.lat),x.lng=Math.max(c.lng,x.lng),x.lat=Math.max(c.lat,x.lat)):(this._sw=new $a(u.lng,u.lat),this._ne=new $a(c.lng,c.lat)),this},No.prototype.getCenter=function(){return new $a((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},No.prototype.getSouthWest=function(){return this._sw},No.prototype.getNorthEast=function(){return this._ne},No.prototype.getNorthWest=function(){return new $a(this.getWest(),this.getNorth())},No.prototype.getSouthEast=function(){return new $a(this.getEast(),this.getSouth())},No.prototype.getWest=function(){return this._sw.lng},No.prototype.getSouth=function(){return this._sw.lat},No.prototype.getEast=function(){return this._ne.lng},No.prototype.getNorth=function(){return this._ne.lat},No.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},No.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},No.prototype.isEmpty=function(){return!(this._sw&&this._ne)},No.prototype.contains=function(a){var u=$a.convert(a),c=u.lng,m=u.lat,x=this._sw.lng<=c&&c<=this._ne.lng;return this._sw.lng>this._ne.lng&&(x=this._sw.lng>=c&&c>=this._ne.lng),this._sw.lat<=m&&m<=this._ne.lat&&x},No.convert=function(a){return!a||a instanceof No?a:new No(a)};var $a=function(a,u){if(isNaN(a)||isNaN(u))throw new Error("Invalid LngLat object: ("+a+", "+u+")");if(this.lng=+a,this.lat=+u,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};$a.prototype.wrap=function(){return new $a(Xt(this.lng,-180,180),this.lat)},$a.prototype.toArray=function(){return[this.lng,this.lat]},$a.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},$a.prototype.distanceTo=function(a){var u=Math.PI/180,c=this.lat*u,m=a.lat*u,x=Math.sin(c)*Math.sin(m)+Math.cos(c)*Math.cos(m)*Math.cos((a.lng-this.lng)*u);return 63710088e-1*Math.acos(Math.min(x,1))},$a.prototype.toBounds=function(a){a===void 0&&(a=0);var u=360*a/40075017,c=u/Math.cos(Math.PI/180*this.lat);return new No(new $a(this.lng-c,this.lat-u),new $a(this.lng+c,this.lat+u))},$a.convert=function(a){if(a instanceof $a)return a;if(Array.isArray(a)&&(a.length===2||a.length===3))return new $a(Number(a[0]),Number(a[1]));if(!Array.isArray(a)&&typeof a=="object"&&a!==null)return new $a(Number("lng"in a?a.lng:a.lon),Number(a.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var Ni=2*Math.PI*63710088e-1;function ki(a){return Ni*Math.cos(a*Math.PI/180)}function Fh(a){return(180+a)/360}function Wd(a){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a*Math.PI/360)))/360}function rg(a,u){return a/ki(u)}function Gd(a){return 360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90}var qf=function(a,u,c){c===void 0&&(c=0),this.x=+a,this.y=+u,this.z=+c};qf.fromLngLat=function(a,u){u===void 0&&(u=0);var c=$a.convert(a);return new qf(Fh(c.lng),Wd(c.lat),rg(u,c.lat))},qf.prototype.toLngLat=function(){return new $a(360*this.x-180,Gd(this.y))},qf.prototype.toAltitude=function(){return this.z*ki(Gd(this.y))},qf.prototype.meterInMercatorCoordinateUnits=function(){return 1/Ni*(a=Gd(this.y),1/Math.cos(a*Math.PI/180));var a};var zl=function(a,u,c){this.z=a,this.x=u,this.y=c,this.key=_p(0,a,a,u,c)};zl.prototype.equals=function(a){return this.z===a.z&&this.x===a.x&&this.y===a.y},zl.prototype.url=function(a,u){var c,m,x,E,A,I=(m=this.y,x=this.z,E=tg(256*(c=this.x),256*(m=Math.pow(2,x)-m-1),x),A=tg(256*(c+1),256*(m+1),x),E[0]+","+E[1]+","+A[0]+","+A[1]),D=function(N,H,X){for(var ne,R="",Pe=N;Pe>0;Pe--)R+=(H&(ne=1<this.canonical.z?new Po(a,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Po(a,this.wrap,a,this.canonical.x>>u,this.canonical.y>>u)},Po.prototype.calculateScaledKey=function(a,u){var c=this.canonical.z-a;return a>this.canonical.z?_p(this.wrap*+u,a,this.canonical.z,this.canonical.x,this.canonical.y):_p(this.wrap*+u,a,a,this.canonical.x>>c,this.canonical.y>>c)},Po.prototype.isChildOf=function(a){if(a.wrap!==this.wrap)return!1;var u=this.canonical.z-a.canonical.z;return a.overscaledZ===0||a.overscaledZ>u&&a.canonical.y===this.canonical.y>>u},Po.prototype.children=function(a){if(this.overscaledZ>=a)return[new Po(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var u=this.canonical.z+1,c=2*this.canonical.x,m=2*this.canonical.y;return[new Po(u,this.wrap,u,c,m),new Po(u,this.wrap,u,c+1,m),new Po(u,this.wrap,u,c,m+1),new Po(u,this.wrap,u,c+1,m+1)]},Po.prototype.isLessThan=function(a){return this.wrapa.wrap)&&(this.overscaledZa.overscaledZ)&&(this.canonical.xa.canonical.x)&&this.canonical.y=this.dim+1||u<-1||u>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(u+1)*this.stride+(a+1)},Vc.prototype._unpackMapbox=function(a,u,c){return(256*a*256+256*u+c)/10-1e4},Vc.prototype._unpackTerrarium=function(a,u,c){return 256*a+u+c/256-32768},Vc.prototype.getPixels=function(){return new Qo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Vc.prototype.backfillBorder=function(a,u,c){if(this.dim!==a.dim)throw new Error("dem dimension mismatch");var m=u*this.dim,x=u*this.dim+this.dim,E=c*this.dim,A=c*this.dim+this.dim;switch(u){case-1:m=x-1;break;case 1:x=m+1}switch(c){case-1:E=A-1;break;case 1:A=E+1}for(var I=-u*this.dim,D=-c*this.dim,N=E;N=0&&H[3]>=0&&I.insert(A,H[0],H[1],H[2],H[3])}},jc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ul.VectorTile(new Gt(this.rawTileData)).layers,this.sourceLayerCoder=new yp(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},jc.prototype.query=function(a,u,c,m){var x=this;this.loadVTLayers();for(var E=a.params||{},A=8192/a.tileSize/a.scale,I=Bu(E.filter),D=a.queryGeometry,N=a.queryPadding*A,H=ng(D),X=this.grid.query(H.minX-N,H.minY-N,H.maxX+N,H.maxY+N),ne=ng(a.cameraQueryGeometry),R=this.grid3D.query(ne.minX-N,ne.minY-N,ne.maxX+N,ne.maxY+N,function(Yt,qt,dr,Lr){return function(Xr,Bn,cn,Vn,pn){for(var Ei=0,ti=Xr;Ei=Rn.x&&pn>=Rn.y)return!0}var Di=[new se(Bn,cn),new se(Bn,pn),new se(Vn,pn),new se(Vn,cn)];if(Xr.length>2){for(var gi=0,Ui=Di;gi=0)return!0;return!1}(E,X)){var ne=this.sourceLayerCoder.decode(c),R=this.vtLayers[ne].feature(m);if(x.needGeometry){var Pe=Xa(R,!0);if(!x.filter(new B(this.tileID.overscaledZ),Pe,this.tileID.canonical))return}else if(!x.filter(new B(this.tileID.overscaledZ),R))return;for(var Be=this.getId(R,ne),rt=0;rtm)x=!1;else if(u)if(this.expirationTimecr&&(a.getActor().send("enforceCacheSizeLimit",Et),En=0)},_.clamp=wt,_.clearTileCache=function(a){var u=ae.caches.delete("mapbox-tiles");a&&u.catch(a).then(function(){return a()})},_.clipLine=Xu,_.clone=function(a){var u=new Zi(16);return u[0]=a[0],u[1]=a[1],u[2]=a[2],u[3]=a[3],u[4]=a[4],u[5]=a[5],u[6]=a[6],u[7]=a[7],u[8]=a[8],u[9]=a[9],u[10]=a[10],u[11]=a[11],u[12]=a[12],u[13]=a[13],u[14]=a[14],u[15]=a[15],u},_.clone$1=ut,_.clone$2=function(a){var u=new Zi(3);return u[0]=a[0],u[1]=a[1],u[2]=a[2],u},_.collisionCircleLayout=z,_.config=Jr,_.create=function(){var a=new Zi(16);return Zi!=Float32Array&&(a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[11]=0,a[12]=0,a[13]=0,a[14]=0),a[0]=1,a[5]=1,a[10]=1,a[15]=1,a},_.create$1=function(){var a=new Zi(9);return Zi!=Float32Array&&(a[1]=0,a[2]=0,a[3]=0,a[5]=0,a[6]=0,a[7]=0),a[0]=1,a[4]=1,a[8]=1,a},_.create$2=function(){var a=new Zi(4);return Zi!=Float32Array&&(a[1]=0,a[2]=0),a[0]=1,a[3]=1,a},_.createCommonjsModule=le,_.createExpression=rf,_.createLayout=wo,_.createStyleLayer=function(a){return a.type==="custom"?new Vd(a):new Zs[a.type](a)},_.cross=function(a,u,c){var m=u[0],x=u[1],E=u[2],A=c[0],I=c[1],D=c[2];return a[0]=x*D-E*I,a[1]=E*A-m*D,a[2]=m*I-x*A,a},_.deepEqual=function a(u,c){if(Array.isArray(u)){if(!Array.isArray(c)||u.length!==c.length)return!1;for(var m=0;m0&&(E=1/Math.sqrt(E)),a[0]=u[0]*E,a[1]=u[1]*E,a[2]=u[2]*E,a},_.number=qa,_.offscreenCanvasSupported=Cn,_.ortho=function(a,u,c,m,x,E,A){var I=1/(u-c),D=1/(m-x),N=1/(E-A);return a[0]=-2*I,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*D,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*N,a[11]=0,a[12]=(u+c)*I,a[13]=(x+m)*D,a[14]=(A+E)*N,a[15]=1,a},_.parseGlyphPBF=function(a){return new Gt(a).readFields(br,[])},_.pbf=Gt,_.performSymbolLayout=function(a,u,c,m,x,E,A){a.createArrays(),a.tilePixelRatio=8192/(512*a.overscaling),a.compareText={},a.iconsNeedLinear=!1;var I=a.layers[0].layout,D=a.layers[0]._unevaluatedLayout._values,N={};if(a.textSizeData.kind==="composite"){var H=a.textSizeData,X=H.maxZoom;N.compositeTextSizes=[D["text-size"].possiblyEvaluate(new B(H.minZoom),A),D["text-size"].possiblyEvaluate(new B(X),A)]}if(a.iconSizeData.kind==="composite"){var ne=a.iconSizeData,R=ne.maxZoom;N.compositeIconSizes=[D["icon-size"].possiblyEvaluate(new B(ne.minZoom),A),D["icon-size"].possiblyEvaluate(new B(R),A)]}N.layoutTextSize=D["text-size"].possiblyEvaluate(new B(a.zoom+1),A),N.layoutIconSize=D["icon-size"].possiblyEvaluate(new B(a.zoom+1),A),N.textMaxSize=D["text-size"].possiblyEvaluate(new B(18));for(var Pe=24*I.get("text-line-height"),Be=I.get("text-rotation-alignment")==="map"&&I.get("symbol-placement")!=="point",rt=I.get("text-keep-upright"),Ge=I.get("text-size"),St=function(){var qt=Yt[Ft],dr=I.get("text-font").evaluate(qt,{},A).join(","),Lr=Ge.evaluate(qt,{},A),Xr=N.layoutTextSize.evaluate(qt,{},A),Bn=N.layoutIconSize.evaluate(qt,{},A),cn={horizontal:{},vertical:void 0},Vn=qt.text,pn=[0,0];if(Vn){var Ei=Vn.toString(),ti=24*I.get("text-letter-spacing").evaluate(qt,{},A),Rn=function(ji){for(var fa=0,va=ji;fa=8192||qd.y<0||qd.y>=8192||function(po,gc,A0,ah,Kd,ag,sd,_c,ud,wp,ld,cd,Qd,Wv,Cp,Gv,Xv,$v,Yv,qv,bu,fd,Kv,yc,Ws){var Qv,oh,Nh,Uh,zh,Zh=po.addToLineVertexArray(gc,A0),Jv=0,em=0,tm=0,rm=0,Jd=-1,ev=-1,Xc={},nm=Ie(""),tv=0,rv=0;if(_c._unevaluatedLayout.getValue("text-radial-offset")===void 0?(tv=(Qv=_c.layout.get("text-offset").evaluate(bu,{},yc).map(function(dd){return 24*dd}))[0],rv=Qv[1]):(tv=24*_c.layout.get("text-radial-offset").evaluate(bu,{},yc),rv=tt),po.allowVerticalPlacement&&ah.vertical){var og=_c.layout.get("text-rotate").evaluate(bu,{},yc)+90;Uh=new da(ud,gc,wp,ld,cd,ah.vertical,Qd,Wv,Cp,og),sd&&(zh=new da(ud,gc,wp,ld,cd,sd,Xv,$v,Cp,og))}if(Kd){var im=_c.layout.get("icon-rotate").evaluate(bu,{}),sg=_c.layout.get("icon-text-fit")!=="none",ug=Ne(Kd,im,Kv,sg),nv=sd?Ne(sd,im,Kv,sg):void 0;Nh=new da(ud,gc,wp,ld,cd,Kd,Xv,$v,!1,im),Jv=4*ug.length;var am=po.iconSizeData,Vh=null;am.kind==="source"?(Vh=[128*_c.layout.get("icon-size").evaluate(bu,{})])[0]>32640&&qe(po.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):am.kind==="composite"&&((Vh=[128*fd.compositeIconSizes[0].evaluate(bu,{},yc),128*fd.compositeIconSizes[1].evaluate(bu,{},yc)])[0]>32640||Vh[1]>32640)&&qe(po.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),po.addSymbols(po.icon,ug,Vh,qv,Yv,bu,!1,gc,Zh.lineStartIndex,Zh.lineLength,-1,yc),Jd=po.icon.placedSymbolArray.length-1,nv&&(em=4*nv.length,po.addSymbols(po.icon,nv,Vh,qv,Yv,bu,ot.vertical,gc,Zh.lineStartIndex,Zh.lineLength,-1,yc),ev=po.icon.placedSymbolArray.length-1)}for(var om in ah.horizontal){var hd=ah.horizontal[om];if(!oh){nm=Ie(hd.text);var lg=_c.layout.get("text-rotate").evaluate(bu,{},yc);oh=new da(ud,gc,wp,ld,cd,hd,Qd,Wv,Cp,lg)}var cg=hd.positionedLines.length===1;if(tm+=De(po,gc,hd,ag,_c,Cp,bu,Gv,Zh,ah.vertical?ot.horizontal:ot.horizontalOnly,cg?Object.keys(ah.horizontal):[om],Xc,Jd,fd,yc),cg)break}ah.vertical&&(rm+=De(po,gc,ah.vertical,ag,_c,Cp,bu,Gv,Zh,ot.vertical,["vertical"],Xc,ev,fd,yc));var fg=oh?oh.boxStartIndex:po.collisionBoxArray.length,T0=oh?oh.boxEndIndex:po.collisionBoxArray.length,hg=Uh?Uh.boxStartIndex:po.collisionBoxArray.length,pg=Uh?Uh.boxEndIndex:po.collisionBoxArray.length,w0=Nh?Nh.boxStartIndex:po.collisionBoxArray.length,C0=Nh?Nh.boxEndIndex:po.collisionBoxArray.length,R0=zh?zh.boxStartIndex:po.collisionBoxArray.length,M0=zh?zh.boxEndIndex:po.collisionBoxArray.length,$c=-1,pd=function(dd,sm){return dd&&dd.circleDiameter?Math.max(dd.circleDiameter,sm):sm};$c=pd(oh,$c),$c=pd(Uh,$c),$c=pd(Nh,$c);var dg=($c=pd(zh,$c))>-1?1:0;dg&&($c*=Ws/24),po.glyphOffsetArray.length>=xn.MAX_GLYPHS&&qe("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),bu.sortKey!==void 0&&po.addToSortKeyRanges(po.symbolInstances.length,bu.sortKey),po.symbolInstances.emplaceBack(gc.x,gc.y,Xc.right>=0?Xc.right:-1,Xc.center>=0?Xc.center:-1,Xc.left>=0?Xc.left:-1,Xc.vertical||-1,Jd,ev,nm,fg,T0,hg,pg,w0,C0,R0,M0,wp,tm,rm,Jv,em,dg,0,Qd,tv,rv,$c)}(ji,qd,ig,va,$i,Hs,vl,ji.layers[0],ji.collisionBoxArray,fa.index,fa.sourceLayerIndex,ji.index,pc,vc,Xd,ws,dc,Ep,td,Vl,fa,ns,Ki,Zl,Ba)};if(Hc==="line")for(var Ap=0,rd=Xu(fa.geometry,0,0,8192,8192);Ap1){var rh=Xi(Bh,ed,va.vertical||$u,$i,24,Cs);rh&&eh(Bh,rh)}}else if(fa.type==="Polygon")for(var nh=0,Tp=pp(fa.geometry,0);nh=zi.maxzoom||zi.visibility!=="none"&&(ae(ci,this.zoom,oe),(ir[zi.id]=zi.createBucket({index:j.bucketLayerIDs.length,layers:ci,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:en,sourceID:this.source})).populate(Wr,wr,this.tileID.canonical),j.bucketLayerIDs.push(ci.map(function(Ti){return Ti.id})))}}}var Ai=_.mapObject(wr.glyphDependencies,function(Ti){return Object.keys(Ti).map(Number)});Object.keys(Ai).length?be.send("getGlyphs",{uid:this.uid,stacks:Ai},function(Ti,mi){Q||(Q=Ti,Le=mi,Ia.call(it))}):Le={};var Xo=Object.keys(wr.iconDependencies);Xo.length?be.send("getImages",{icons:Xo,source:this.source,tileID:this.tileID,type:"icons"},function(Ti,mi){Q||(Q=Ti,at=mi,Ia.call(it))}):at={};var Ji=Object.keys(wr.patternDependencies);function Ia(){if(Q)return Oe(Q);if(Le&&at&&Ee){var Ti=new se(Le),mi=new _.ImageAtlas(at,Ee);for(var wi in ir){var Pa=ir[wi];Pa instanceof _.SymbolBucket?(ae(Pa.layers,this.zoom,oe),_.performSymbolLayout(Pa,Le,Ti.positions,at,mi.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Pa.hasPattern&&(Pa instanceof _.LineBucket||Pa instanceof _.FillBucket||Pa instanceof _.FillExtrusionBucket)&&(ae(Pa.layers,this.zoom,oe),Pa.addFeatures(wr,this.tileID.canonical,mi.patternPositions))}this.status="done",Oe(null,{buckets:_.values(ir).filter(function(cu){return!cu.isEmpty()}),featureIndex:j,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Ti.image,imageAtlas:mi,glyphMap:this.returnDependencies?Le:null,iconMap:this.returnDependencies?at:null,glyphPositions:this.returnDependencies?Ti.positions:null})}}Ji.length?be.send("getImages",{icons:Ji,source:this.source,tileID:this.tileID,type:"patterns"},function(Ti,mi){Q||(Q=Ti,Ee=mi,Ia.call(it))}):Ee={},Ia.call(this)};var dt=function(W,J,oe,be){this.actor=W,this.layerIndex=J,this.availableImages=oe,this.loadVectorData=be||et,this.loading={},this.loaded={}};dt.prototype.loadTile=function(W,J){var oe=this,be=W.uid;this.loading||(this.loading={});var Oe=!!(W&&W.request&&W.request.collectResourceTiming)&&new _.RequestPerformance(W.request),it=this.loading[be]=new Qe(W);it.abort=this.loadVectorData(W,function(pt,j){if(delete oe.loading[be],pt||!j)return it.status="done",oe.loaded[be]=it,J(pt);var Q=j.rawData,Le={};j.expires&&(Le.expires=j.expires),j.cacheControl&&(Le.cacheControl=j.cacheControl);var at={};if(Oe){var Ee=Oe.finish();Ee&&(at.resourceTiming=JSON.parse(JSON.stringify(Ee)))}it.vectorTile=j.vectorTile,it.parse(j.vectorTile,oe.layerIndex,oe.availableImages,oe.actor,function(ir,wr){if(ir||!wr)return J(ir);J(null,_.extend({rawTileData:Q.slice(0)},wr,Le,at))}),oe.loaded=oe.loaded||{},oe.loaded[be]=it})},dt.prototype.reloadTile=function(W,J){var oe=this,be=this.loaded,Oe=W.uid,it=this;if(be&&be[Oe]){var pt=be[Oe];pt.showCollisionBoxes=W.showCollisionBoxes;var j=function(Q,Le){var at=pt.reloadCallback;at&&(delete pt.reloadCallback,pt.parse(pt.vectorTile,it.layerIndex,oe.availableImages,it.actor,at)),J(Q,Le)};pt.status==="parsing"?pt.reloadCallback=j:pt.status==="done"&&(pt.vectorTile?pt.parse(pt.vectorTile,this.layerIndex,this.availableImages,this.actor,j):j())}},dt.prototype.abortTile=function(W,J){var oe=this.loading,be=W.uid;oe&&oe[be]&&oe[be].abort&&(oe[be].abort(),delete oe[be]),J()},dt.prototype.removeTile=function(W,J){var oe=this.loaded,be=W.uid;oe&&oe[be]&&delete oe[be],J()};var Ye=_.window.ImageBitmap,wt=function(){this.loaded={}};function Xt(W,J){if(W.length!==0){Zt(W[0],J);for(var oe=1;oe=Math.abs(j)?oe-Q+j:j-Q+oe,oe=Q}oe+be>=0!=!!J&&W.reverse()}wt.prototype.loadTile=function(W,J){var oe=W.uid,be=W.encoding,Oe=W.rawImageData,it=Ye&&Oe instanceof Ye?this.getImageData(Oe):Oe,pt=new _.DEMData(oe,it,be);this.loaded=this.loaded||{},this.loaded[oe]=pt,J(null,pt)},wt.prototype.getImageData=function(W){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(W.width,W.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=W.width,this.offscreenCanvas.height=W.height,this.offscreenCanvasContext.drawImage(W,0,0,W.width,W.height);var J=this.offscreenCanvasContext.getImageData(-1,-1,W.width+2,W.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new _.RGBAImage({width:J.width,height:J.height},J.data)},wt.prototype.removeTile=function(W){var J=this.loaded,oe=W.uid;J&&J[oe]&&delete J[oe]};var nr=_.vectorTile.VectorTileFeature.prototype.toGeoJSON,Vt=function(W){this._feature=W,this.extent=_.EXTENT,this.type=W.type,this.properties=W.tags,"id"in W&&!isNaN(W.id)&&(this.id=parseInt(W.id,10))};Vt.prototype.loadGeometry=function(){if(this._feature.type===1){for(var W=[],J=0,oe=this._feature.geometry;J>31}function K(W,J){for(var oe=W.loadGeometry(),be=W.type,Oe=0,it=0,pt=oe.length,j=0;j>1;(function en(Wr,Yr,pi,tn,vi,qi){for(;vi>tn;){if(vi-tn>600){var ci=vi-tn+1,zi=pi-tn+1,Ai=Math.log(ci),Xo=.5*Math.exp(2*Ai/3),Ji=.5*Math.sqrt(Ai*Xo*(ci-Xo)/ci)*(zi-ci/2<0?-1:1);en(Wr,Yr,pi,Math.max(tn,Math.floor(pi-zi*Xo/ci+Ji)),Math.min(vi,Math.floor(pi+(ci-zi)*Xo/ci+Ji)),qi)}var Ia=Yr[2*pi+qi],Ti=tn,mi=vi;for(Se(Wr,Yr,tn,pi),Yr[2*vi+qi]>Ia&&Se(Wr,Yr,tn,vi);TiIa;)mi--}Yr[2*tn+qi]===Ia?Se(Wr,Yr,tn,mi):Se(Wr,Yr,++mi,vi),mi<=pi&&(tn=mi+1),pi<=mi&&(vi=mi-1)}})(at,Ee,sr,wr,An,sn%2),Le(at,Ee,ir,wr,sr-1,sn+1),Le(at,Ee,ir,sr+1,An,sn+1)}})(pt,j,be,0,pt.length-1,0)};Xe.prototype.range=function(W,J,oe,be){return function(Oe,it,pt,j,Q,Le,at){for(var Ee,ir,wr=[0,Oe.length-1,0],An=[];wr.length;){var sn=wr.pop(),sr=wr.pop(),en=wr.pop();if(sr-en<=at)for(var Wr=en;Wr<=sr;Wr++)ir=it[2*Wr+1],(Ee=it[2*Wr])>=pt&&Ee<=Q&&ir>=j&&ir<=Le&&An.push(Oe[Wr]);else{var Yr=Math.floor((en+sr)/2);ir=it[2*Yr+1],(Ee=it[2*Yr])>=pt&&Ee<=Q&&ir>=j&&ir<=Le&&An.push(Oe[Yr]);var pi=(sn+1)%2;(sn===0?pt<=Ee:j<=ir)&&(wr.push(en),wr.push(Yr-1),wr.push(pi)),(sn===0?Q>=Ee:Le>=ir)&&(wr.push(Yr+1),wr.push(sr),wr.push(pi))}}return An}(this.ids,this.coords,W,J,oe,be,this.nodeSize)},Xe.prototype.within=function(W,J,oe){return function(be,Oe,it,pt,j,Q){for(var Le=[0,be.length-1,0],at=[],Ee=j*j;Le.length;){var ir=Le.pop(),wr=Le.pop(),An=Le.pop();if(wr-An<=Q)for(var sn=An;sn<=wr;sn++)te(Oe[2*sn],Oe[2*sn+1],it,pt)<=Ee&&at.push(be[sn]);else{var sr=Math.floor((An+wr)/2),en=Oe[2*sr],Wr=Oe[2*sr+1];te(en,Wr,it,pt)<=Ee&&at.push(be[sr]);var Yr=(ir+1)%2;(ir===0?it-j<=en:pt-j<=Wr)&&(Le.push(An),Le.push(sr-1),Le.push(Yr)),(ir===0?it+j>=en:pt+j>=Wr)&&(Le.push(sr+1),Le.push(wr),Le.push(Yr))}}return at}(this.ids,this.coords,W,J,oe,this.nodeSize)};var Lt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(W){return W}},Ht=function(W){this.options=Mi(Object.create(Lt),W),this.trees=new Array(this.options.maxZoom+1)};function on(W,J,oe,be,Oe){return{x:W,y:J,zoom:1/0,id:oe,parentId:-1,numPoints:be,properties:Oe}}function Jr(W,J){var oe=W.geometry.coordinates,be=oe[1];return{x:bn(oe[0]),y:Kr(be),zoom:1/0,index:J,parentId:-1}}function Hr(W){return{type:"Feature",id:W.id,properties:Un(W),geometry:{type:"Point",coordinates:[(be=W.x,360*(be-.5)),(J=W.y,oe=(180-360*J)*Math.PI/180,360*Math.atan(Math.exp(oe))/Math.PI-90)]}};var J,oe,be}function Un(W){var J=W.numPoints,oe=J>=1e4?Math.round(J/1e3)+"k":J>=1e3?Math.round(J/100)/10+"k":J;return Mi(Mi({},W.properties),{cluster:!0,cluster_id:W.id,point_count:J,point_count_abbreviated:oe})}function bn(W){return W/360+.5}function Kr(W){var J=Math.sin(W*Math.PI/180),oe=.5-.25*Math.log((1+J)/(1-J))/Math.PI;return oe<0?0:oe>1?1:oe}function Mi(W,J){for(var oe in J)W[oe]=J[oe];return W}function Si(W){return W.x}function Ri(W){return W.y}function Gn(W,J,oe,be,Oe,it){var pt=Oe-oe,j=it-be;if(pt!==0||j!==0){var Q=((W-oe)*pt+(J-be)*j)/(pt*pt+j*j);Q>1?(oe=Oe,be=it):Q>0&&(oe+=pt*Q,be+=j*Q)}return(pt=W-oe)*pt+(j=J-be)*j}function Dn(W,J,oe,be){var Oe={id:W===void 0?null:W,type:J,geometry:oe,tags:be,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(it){var pt=it.geometry,j=it.type;if(j==="Point"||j==="MultiPoint"||j==="LineString")Ya(it,pt);else if(j==="Polygon"||j==="MultiLineString")for(var Q=0;Q0&&(pt+=be?(Oe*Le-Q*it)/2:Math.sqrt(Math.pow(Q-Oe,2)+Math.pow(Le-it,2))),Oe=Q,it=Le}var at=J.length-3;J[2]=1,function Ee(ir,wr,An,sn){for(var sr,en=sn,Wr=An-wr>>1,Yr=An-wr,pi=ir[wr],tn=ir[wr+1],vi=ir[An],qi=ir[An+1],ci=wr+3;cien)sr=ci,en=zi;else if(zi===en){var Ai=Math.abs(ci-Wr);Aisn&&(sr-wr>3&&Ee(ir,wr,sr,sn),ir[sr+2]=en,An-sr>3&&Ee(ir,sr,An,sn))}(J,0,at,oe),J[at+2]=1,J.size=Math.abs(pt),J.start=0,J.end=J.size}function k(W,J,oe,be){for(var Oe=0;Oe1?1:oe}function Ze(W,J,oe,be,Oe,it,pt,j){if(be/=J,it>=(oe/=J)&&pt=be)return null;for(var Q=[],Le=0;Le=oe&&An=be)){var sn=[];if(ir==="Point"||ir==="MultiPoint")_t(Ee,sn,oe,be,Oe);else if(ir==="LineString")Wt(Ee,sn,oe,be,Oe,!1,j.lineMetrics);else if(ir==="MultiLineString")He(Ee,sn,oe,be,Oe,!1);else if(ir==="Polygon")He(Ee,sn,oe,be,Oe,!0);else if(ir==="MultiPolygon")for(var sr=0;sr=oe&&pt<=be&&(J.push(W[it]),J.push(W[it+1]),J.push(W[it+2]))}}function Wt(W,J,oe,be,Oe,it,pt){for(var j,Q,Le=Sr(W),at=Oe===0?cr:mr,Ee=W.start,ir=0;iroe&&(Q=at(Le,wr,An,sr,en,oe),pt&&(Le.start=Ee+j*Q)):Wr>be?Yr=oe&&(Q=at(Le,wr,An,sr,en,oe),pi=!0),Yr>be&&Wr<=be&&(Q=at(Le,wr,An,sr,en,be),pi=!0),!it&&pi&&(pt&&(Le.end=Ee+j*Q),J.push(Le),Le=Sr(W)),pt&&(Ee+=j)}var tn=W.length-3;wr=W[tn],An=W[tn+1],sn=W[tn+2],(Wr=Oe===0?wr:An)>=oe&&Wr<=be&&Et(Le,wr,An,sn),tn=Le.length-3,it&&tn>=3&&(Le[tn]!==Le[0]||Le[tn+1]!==Le[1])&&Et(Le,Le[0],Le[1],Le[2]),Le.length&&J.push(Le)}function Sr(W){var J=[];return J.size=W.size,J.start=W.start,J.end=W.end,J}function He(W,J,oe,be,Oe,it){for(var pt=0;ptpt.maxX&&(pt.maxX=at),Ee>pt.maxY&&(pt.maxY=Ee)}return pt}function ni(W,J,oe,be){var Oe=J.geometry,it=J.type,pt=[];if(it==="Point"||it==="MultiPoint")for(var j=0;j0&&J.size<(Oe?pt:be))oe.numPoints+=J.length/3;else{for(var j=[],Q=0;Qpt)&&(oe.numSimplified++,j.push(J[Q]),j.push(J[Q+1])),oe.numPoints++;Oe&&function(Le,at){for(var Ee=0,ir=0,wr=Le.length,An=wr-2;ir0===at)for(ir=0,wr=Le.length;ir24)throw new Error("maxZoom should be in the 0-24 range");if(J.promoteId&&J.generateId)throw new Error("promoteId and generateId cannot be used together.");var be=function(Oe,it){var pt=[];if(Oe.type==="FeatureCollection")for(var j=0;j=be;Le--){var at=+Date.now();j=this._cluster(j,Le),this.trees[Le]=new Xe(j,Si,Ri,it,Float32Array),oe&&console.log("z%d: %d clusters in %dms",Le,j.length,+Date.now()-at)}return oe&&console.timeEnd("total time"),this},Ht.prototype.getClusters=function(W,J){var oe=((W[0]+180)%360+360)%360-180,be=Math.max(-90,Math.min(90,W[1])),Oe=W[2]===180?180:((W[2]+180)%360+360)%360-180,it=Math.max(-90,Math.min(90,W[3]));if(W[2]-W[0]>=360)oe=-180,Oe=180;else if(oe>Oe){var pt=this.getClusters([oe,be,180,it],J),j=this.getClusters([-180,be,Oe,it],J);return pt.concat(j)}for(var Q=this.trees[this._limitZoom(J)],Le=[],at=0,Ee=Q.range(bn(oe),Kr(it),bn(Oe),Kr(be));atJ&&(ir+=sn.numPoints||1)}if(ir>=it){for(var sr=Q.x*Ee,en=Q.y*Ee,Wr=Oe&&Ee>1?this._map(Q,!0):null,Yr=(j<<5)+(J+1)+this.points.length,pi=0,tn=at;pi1)for(var ci=0,zi=at;ci>5},Ht.prototype._getOriginZoom=function(W){return(W-this.points.length)%32},Ht.prototype._map=function(W,J){if(W.numPoints)return J?Mi({},W.properties):W.properties;var oe=this.points[W.index].properties,be=this.options.map(oe);return J&&be===oe?Mi({},be):be},oa.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},oa.prototype.splitTile=function(W,J,oe,be,Oe,it,pt){for(var j=[W,J,oe,be],Q=this.options,Le=Q.debug;j.length;){be=j.pop(),oe=j.pop(),J=j.pop(),W=j.pop();var at=1<1&&console.time("creation"),ir=this.tiles[Ee]=fn(W,J,oe,be,Q),this.tileCoords.push({z:J,x:oe,y:be}),Le)){Le>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",J,oe,be,ir.numFeatures,ir.numPoints,ir.numSimplified),console.timeEnd("creation"));var wr="z"+J;this.stats[wr]=(this.stats[wr]||0)+1,this.total++}if(ir.source=W,Oe){if(J===Q.maxZoom||J===Oe)continue;var An=1<1&&console.time("clipping");var sn,sr,en,Wr,Yr,pi,tn=.5*Q.buffer/Q.extent,vi=.5-tn,qi=.5+tn,ci=1+tn;sn=sr=en=Wr=null,Yr=Ze(W,at,oe-tn,oe+qi,0,ir.minX,ir.maxX,Q),pi=Ze(W,at,oe+vi,oe+ci,0,ir.minX,ir.maxX,Q),W=null,Yr&&(sn=Ze(Yr,at,be-tn,be+qi,1,ir.minY,ir.maxY,Q),sr=Ze(Yr,at,be+vi,be+ci,1,ir.minY,ir.maxY,Q),Yr=null),pi&&(en=Ze(pi,at,be-tn,be+qi,1,ir.minY,ir.maxY,Q),Wr=Ze(pi,at,be+vi,be+ci,1,ir.minY,ir.maxY,Q),pi=null),Le>1&&console.timeEnd("clipping"),j.push(sn||[],J+1,2*oe,2*be),j.push(sr||[],J+1,2*oe,2*be+1),j.push(en||[],J+1,2*oe+1,2*be),j.push(Wr||[],J+1,2*oe+1,2*be+1)}}},oa.prototype.getTile=function(W,J,oe){var be=this.options,Oe=be.extent,it=be.debug;if(W<0||W>24)return null;var pt=1<1&&console.log("drilling down to z%d-%d-%d",W,J,oe);for(var Q,Le=W,at=J,Ee=oe;!Q&&Le>0;)Le--,at=Math.floor(at/2),Ee=Math.floor(Ee/2),Q=this.tiles[Qi(Le,at,Ee)];return Q&&Q.source?(it>1&&console.log("found parent tile z%d-%d-%d",Le,at,Ee),it>1&&console.time("drilling down"),this.splitTile(Q.source,Le,at,Ee,W,J,oe),it>1&&console.timeEnd("drilling down"),this.tiles[j]?En(this.tiles[j],Oe):null):null};var Is=function(W){function J(oe,be,Oe,it){W.call(this,oe,be,Oe,lo),it&&(this.loadGeoJSON=it)}return W&&(J.__proto__=W),(J.prototype=Object.create(W&&W.prototype)).constructor=J,J.prototype.loadData=function(oe,be){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=be,this._pendingLoadDataParams=oe,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},J.prototype._loadData=function(){var oe=this;if(this._pendingCallback&&this._pendingLoadDataParams){var be=this._pendingCallback,Oe=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var it=!!(Oe&&Oe.request&&Oe.request.collectResourceTiming)&&new _.RequestPerformance(Oe.request);this.loadGeoJSON(Oe,function(pt,j){if(pt||!j)return be(pt);if(typeof j!="object")return be(new Error("Input data given to '"+Oe.source+"' is not a valid GeoJSON object."));(function ir(wr,An){var sn,sr=wr&&wr.type;if(sr==="FeatureCollection")for(sn=0;sn=0?0:h.button},U.remove=function(h){h.parentNode&&h.parentNode.removeChild(h)};var Zt=function(h){function d(){h.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new _.RGBAImage({width:1,height:1}),this.dirty=!0}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.isLoaded=function(){return this.loaded},d.prototype.setLoaded=function(p){if(this.loaded!==p&&(this.loaded=p,p)){for(var g=0,S=this.requestors;g=0?1.2:1))}function Tr(h,d,p,g,S,w,C){for(var P=0;P65535)Z(new Error("glyphs > 65535 not supported"));else if(_e.ranges[Ue])Z(null,{stack:Y,id:pe,glyph:ye});else{var ke=_e.requests[Ue];ke||(ke=_e.requests[Ue]=[],lr.loadGlyphRange(Y,Ue,p.url,p.requestManager,function(Ke,Ie){if(Ie){for(var $e in Ie)p._doesCharSupportLocalGlyph(+$e)||(_e.glyphs[+$e]=Ie[+$e]);_e.ranges[Ue]=!0}for(var vt=0,Rt=ke;vt1&&(P=h[++C]);var Y=Math.abs(Z-P.left),pe=Math.abs(Z-P.right),_e=Math.min(Y,pe),ye=void 0,Ue=S/p*(g+1);if(P.isDash){var ke=g-Math.abs(Ue);ye=Math.sqrt(_e*_e+ke*ke)}else ye=g-Math.sqrt(_e*_e+Ue*Ue);this.data[w+Z]=Math.max(0,Math.min(255,ye+128))}},qe.prototype.addRegularDash=function(h){for(var d=h.length-1;d>=0;--d){var p=h[d],g=h[d+1];p.zeroLength?h.splice(d,1):g&&g.isDash===p.isDash&&(g.left=p.left,h.splice(d,1))}var S=h[0],w=h[h.length-1];S.isDash===w.isDash&&(S.left=w.left-this.width,w.right=S.right+this.width);for(var C=this.width*this.nextRow,P=0,Z=h[P],Y=0;Y1&&(Z=h[++P]);var pe=Math.abs(Y-Z.left),_e=Math.abs(Y-Z.right),ye=Math.min(pe,_e);this.data[C+Y]=Math.max(0,Math.min(255,(Z.isDash?ye:-ye)+128))}},qe.prototype.addDash=function(h,d){var p=d?7:0,g=2*p+1;if(this.nextRow+g>this.height)return _.warnOnce("LineAtlas out of space"),null;for(var S=0,w=0;w=p&&h.x=g&&h.y0&&(Y[new _.OverscaledTileID(p.overscaledZ,C,g.z,w,g.y-1).key]={backfilled:!1},Y[new _.OverscaledTileID(p.overscaledZ,p.wrap,g.z,g.x,g.y-1).key]={backfilled:!1},Y[new _.OverscaledTileID(p.overscaledZ,Z,g.z,P,g.y-1).key]={backfilled:!1}),g.y+10&&(S.resourceTiming=p._resourceTiming,p._resourceTiming=[]),p.fire(new _.Event("data",S))}})},d.prototype.onAdd=function(p){this.map=p,this.load()},d.prototype.setData=function(p){var g=this;return this._data=p,this.fire(new _.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(S){if(S)g.fire(new _.ErrorEvent(S));else{var w={dataType:"source",sourceDataType:"content"};g._collectResourceTiming&&g._resourceTiming&&g._resourceTiming.length>0&&(w.resourceTiming=g._resourceTiming,g._resourceTiming=[]),g.fire(new _.Event("data",w))}}),this},d.prototype.getClusterExpansionZoom=function(p,g){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:p,source:this.id},g),this},d.prototype.getClusterChildren=function(p,g){return this.actor.send("geojson.getClusterChildren",{clusterId:p,source:this.id},g),this},d.prototype.getClusterLeaves=function(p,g,S,w){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:p,limit:g,offset:S},w),this},d.prototype._updateWorkerData=function(p){var g=this;this._loaded=!1;var S=_.extend({},this.workerOptions),w=this._data;typeof w=="string"?(S.request=this.map._requestManager.transformRequest(_.browser.resolveURL(w),_.ResourceType.Source),S.request.collectResourceTiming=this._collectResourceTiming):S.data=JSON.stringify(w),this.actor.send(this.type+".loadData",S,function(C,P){g._removed||P&&P.abandoned||(g._loaded=!0,P&&P.resourceTiming&&P.resourceTiming[g.id]&&(g._resourceTiming=P.resourceTiming[g.id].slice(0)),g.actor.send(g.type+".coalesce",{source:S.source},null),p(C))})},d.prototype.loaded=function(){return this._loaded},d.prototype.loadTile=function(p,g){var S=this,w=p.actor?"reloadTile":"loadTile";p.actor=this.actor,p.request=this.actor.send(w,{type:this.type,uid:p.uid,tileID:p.tileID,zoom:p.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:_.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},function(C,P){return delete p.request,p.unloadVectorData(),p.aborted?g(null):C?g(C):(p.loadVectorData(P,S.map.painter,w==="reloadTile"),g(null))})},d.prototype.abortTile=function(p){p.request&&(p.request.cancel(),delete p.request),p.aborted=!0},d.prototype.unloadTile=function(p){p.unloadVectorData(),this.actor.send("removeTile",{uid:p.uid,type:this.type,source:this.id})},d.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},d.prototype.serialize=function(){return _.extend({},this._options,{type:this.type,data:this._data})},d.prototype.hasTransition=function(){return!1},d}(_.Evented),nt=_.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),te=function(h){function d(p,g,S,w){h.call(this),this.id=p,this.dispatcher=S,this.coordinates=g.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(w),this.options=g}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.load=function(p,g){var S=this;this._loaded=!1,this.fire(new _.Event("dataloading",{dataType:"source"})),this.url=this.options.url,_.getImage(this.map._requestManager.transformRequest(this.url,_.ResourceType.Image),function(w,C){S._loaded=!0,w?S.fire(new _.ErrorEvent(w)):C&&(S.image=C,p&&(S.coordinates=p),g&&g(),S._finishLoading())})},d.prototype.loaded=function(){return this._loaded},d.prototype.updateImage=function(p){var g=this;return this.image&&p.url?(this.options.url=p.url,this.load(p.coordinates,function(){g.texture=null}),this):this},d.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new _.Event("data",{dataType:"source",sourceDataType:"metadata"})))},d.prototype.onAdd=function(p){this.map=p,this.load()},d.prototype.setCoordinates=function(p){var g=this;this.coordinates=p;var S=p.map(_.MercatorCoordinate.fromLngLat);this.tileID=function(C){for(var P=1/0,Z=1/0,Y=-1/0,pe=-1/0,_e=0,ye=C;_eg.end(0)?this.fire(new _.ErrorEvent(new _.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+g.start(0)+" and "+g.end(0)+"-second mark."))):this.video.currentTime=p}},d.prototype.getVideo=function(){return this.video},d.prototype.onAdd=function(p){this.map||(this.map=p,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},d.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var p=this.map.painter.context,g=p.gl;for(var S in this.boundsBuffer||(this.boundsBuffer=p.createVertexBuffer(this._boundsArray,nt.members)),this.boundsSegments||(this.boundsSegments=_.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE),g.texSubImage2D(g.TEXTURE_2D,0,0,0,g.RGBA,g.UNSIGNED_BYTE,this.video)):(this.texture=new _.Texture(p,this.video,g.RGBA),this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE)),this.tiles){var w=this.tiles[S];w.state!=="loaded"&&(w.state="loaded",w.texture=this.texture)}}},d.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},d.prototype.hasTransition=function(){return this.video&&!this.video.paused},d}(te),we=function(h){function d(p,g,S,w){h.call(this,p,g,S,w),g.coordinates?Array.isArray(g.coordinates)&&g.coordinates.length===4&&!g.coordinates.some(function(C){return!Array.isArray(C)||C.length!==2||C.some(function(P){return typeof P!="number"})})||this.fire(new _.ErrorEvent(new _.ValidationError("sources."+p,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new _.ErrorEvent(new _.ValidationError("sources."+p,null,'missing required property "coordinates"'))),g.animate&&typeof g.animate!="boolean"&&this.fire(new _.ErrorEvent(new _.ValidationError("sources."+p,null,'optional "animate" property must be a boolean value'))),g.canvas?typeof g.canvas=="string"||g.canvas instanceof _.window.HTMLCanvasElement||this.fire(new _.ErrorEvent(new _.ValidationError("sources."+p,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 _.ErrorEvent(new _.ValidationError("sources."+p,null,'missing required property "canvas"'))),this.options=g,this.animate=g.animate===void 0||g.animate}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof _.window.HTMLCanvasElement?this.options.canvas:_.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new _.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())},d.prototype.getCanvas=function(){return this.canvas},d.prototype.onAdd=function(p){this.map=p,this.load(),this.canvas&&this.animate&&this.play()},d.prototype.onRemove=function(){this.pause()},d.prototype.prepare=function(){var p=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,p=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,p=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var g=this.map.painter.context,S=g.gl;for(var w in this.boundsBuffer||(this.boundsBuffer=g.createVertexBuffer(this._boundsArray,nt.members)),this.boundsSegments||(this.boundsSegments=_.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(p||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new _.Texture(g,this.canvas,S.RGBA,{premultiply:!0}),this.tiles){var C=this.tiles[w];C.state!=="loaded"&&(C.state="loaded",C.texture=this.texture)}}},d.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},d.prototype.hasTransition=function(){return this._playing},d.prototype._hasInvalidDimensions=function(){for(var p=0,g=[this.canvas.width,this.canvas.height];pthis.max){var C=this._getAndRemoveByKey(this.order[0]);C&&this.onRemove(C)}return this},Jr.prototype.has=function(h){return h.wrapped().key in this.data},Jr.prototype.getAndRemove=function(h){return this.has(h)?this._getAndRemoveByKey(h.wrapped().key):null},Jr.prototype._getAndRemoveByKey=function(h){var d=this.data[h].shift();return d.timeout&&clearTimeout(d.timeout),this.data[h].length===0&&delete this.data[h],this.order.splice(this.order.indexOf(h),1),d.value},Jr.prototype.getByKey=function(h){var d=this.data[h];return d?d[0].value:null},Jr.prototype.get=function(h){return this.has(h)?this.data[h.wrapped().key][0].value:null},Jr.prototype.remove=function(h,d){if(!this.has(h))return this;var p=h.wrapped().key,g=d===void 0?0:this.data[p].indexOf(d),S=this.data[p][g];return this.data[p].splice(g,1),S.timeout&&clearTimeout(S.timeout),this.data[p].length===0&&delete this.data[p],this.onRemove(S.value),this.order.splice(this.order.indexOf(p),1),this},Jr.prototype.setMaxSize=function(h){for(this.max=h;this.order.length>this.max;){var d=this._getAndRemoveByKey(this.order[0]);d&&this.onRemove(d)}return this},Jr.prototype.filter=function(h){var d=[];for(var p in this.data)for(var g=0,S=this.data[p];g1||(Math.abs(pe)>1&&(Math.abs(pe+ye)===1?pe+=ye:Math.abs(pe-ye)===1&&(pe-=ye)),Y.dem&&Z.dem&&(Z.dem.backfillBorder(Y.dem,pe,_e),Z.neighboringTiles&&Z.neighboringTiles[Ue]&&(Z.neighboringTiles[Ue].backfilled=!0)))}},d.prototype.getTile=function(p){return this.getTileByID(p.key)},d.prototype.getTileByID=function(p){return this._tiles[p]},d.prototype._retainLoadedChildren=function(p,g,S,w){for(var C in this._tiles){var P=this._tiles[C];if(!(w[C]||!P.hasData()||P.tileID.overscaledZ<=g||P.tileID.overscaledZ>S)){for(var Z=P.tileID;P&&P.tileID.overscaledZ>g+1;){var Y=P.tileID.scaledTo(P.tileID.overscaledZ-1);(P=this._tiles[Y.key])&&P.hasData()&&(Z=Y)}for(var pe=Z;pe.overscaledZ>g;)if(p[(pe=pe.scaledTo(pe.overscaledZ-1)).key]){w[Z.key]=Z;break}}}},d.prototype.findLoadedParent=function(p,g){if(p.key in this._loadedParentTiles){var S=this._loadedParentTiles[p.key];return S&&S.tileID.overscaledZ>=g?S:null}for(var w=p.overscaledZ-1;w>=g;w--){var C=p.scaledTo(w),P=this._getLoadedTile(C);if(P)return P}},d.prototype._getLoadedTile=function(p){var g=this._tiles[p.key];return g&&g.hasData()?g:this._cache.getByKey(p.wrapped().key)},d.prototype.updateCacheSize=function(p){var g=Math.ceil(p.width/this._source.tileSize)+1,S=Math.ceil(p.height/this._source.tileSize)+1,w=Math.floor(g*S*5),C=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,w):w;this._cache.setMaxSize(C)},d.prototype.handleWrapJump=function(p){var g=Math.round((p-(this._prevLng===void 0?p:this._prevLng))/360);if(this._prevLng=p,g){var S={};for(var w in this._tiles){var C=this._tiles[w];C.tileID=C.tileID.unwrapTo(C.tileID.wrap+g),S[C.tileID.key]=C}for(var P in this._tiles=S,this._timers)clearTimeout(this._timers[P]),delete this._timers[P];for(var Z in this._tiles)this._setTileReloadTimer(Z,this._tiles[Z])}},d.prototype.update=function(p){var g=this;if(this.transform=p,this._sourceLoaded&&!this._paused){var S;this.updateCacheSize(p),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?S=p.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(_r){return new _.OverscaledTileID(_r.canonical.z,_r.wrap,_r.canonical.z,_r.canonical.x,_r.canonical.y)}):(S=p.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(S=S.filter(function(_r){return g._source.hasTile(_r)}))):S=[];var w=p.coveringZoomLevel(this._source),C=Math.max(w-d.maxOverzooming,this._source.minzoom),P=Math.max(w+d.maxUnderzooming,this._source.minzoom),Z=this._updateRetainedTiles(S,w);if(at(this._source.type)){for(var Y={},pe={},_e=0,ye=Object.keys(Z);_ethis._source.maxzoom){var $e=Ke.children(this._source.maxzoom)[0],vt=this.getTile($e);if(vt&&vt.hasData()){S[$e.key]=$e;continue}}else{var Rt=Ke.children(this._source.maxzoom);if(S[Rt[0].key]&&S[Rt[1].key]&&S[Rt[2].key]&&S[Rt[3].key])continue}for(var Jt=Ie.wasRequested(),zt=Ke.overscaledZ-1;zt>=C;--zt){var ar=Ke.scaledTo(zt);if(w[ar.key]||(w[ar.key]=!0,!(Ie=this.getTile(ar))&&Jt&&(Ie=this._addTile(ar)),Ie&&(S[ar.key]=ar,Jt=Ie.wasRequested(),Ie.hasData())))break}}}return S},d.prototype._updateLoadedParentTileCache=function(){for(var p in this._loadedParentTiles={},this._tiles){for(var g=[],S=void 0,w=this._tiles[p].tileID;w.overscaledZ>0;){if(w.key in this._loadedParentTiles){S=this._loadedParentTiles[w.key];break}g.push(w.key);var C=w.scaledTo(w.overscaledZ-1);if(S=this._getLoadedTile(C))break;w=C}for(var P=0,Z=g;P0||(g.hasData()&&g.state!=="reloading"?this._cache.add(g.tileID,g,g.getExpiryTimeout()):(g.aborted=!0,this._abortTile(g),this._unloadTile(g))))},d.prototype.clearTiles=function(){for(var p in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(p);this._cache.reset()},d.prototype.tilesIn=function(p,g,S){var w=this,C=[],P=this.transform;if(!P)return C;for(var Z=S?P.getCameraQueryGeometry(p):p,Y=p.map(function(zt){return P.pointCoordinate(zt)}),pe=Z.map(function(zt){return P.pointCoordinate(zt)}),_e=this.getIds(),ye=1/0,Ue=1/0,ke=-1/0,Ke=-1/0,Ie=0,$e=pe;Ie<$e.length;Ie+=1){var vt=$e[Ie];ye=Math.min(ye,vt.x),Ue=Math.min(Ue,vt.y),ke=Math.max(ke,vt.x),Ke=Math.max(Ke,vt.y)}for(var Rt=function(zt){var ar=w._tiles[_e[zt]];if(!ar.holdingForFade()){var _r=ar.tileID,Nr=Math.pow(2,P.zoom-ar.tileID.overscaledZ),kr=g*ar.queryPadding*_.EXTENT/ar.tileSize/Nr,un=[_r.getTilePoint(new _.MercatorCoordinate(ye,Ue)),_r.getTilePoint(new _.MercatorCoordinate(ke,Ke))];if(un[0].x-kr<_.EXTENT&&un[0].y-kr<_.EXTENT&&un[1].x+kr>=0&&un[1].y+kr>=0){var Pn=Y.map(function(Zn){return _r.getTilePoint(Zn)}),zn=pe.map(function(Zn){return _r.getTilePoint(Zn)});C.push({tile:ar,tileID:_r,queryGeometry:Pn,cameraQueryGeometry:zn,scale:Nr})}}},Jt=0;Jt<_e.length;Jt++)Rt(Jt);return C},d.prototype.getVisibleCoordinates=function(p){for(var g=this,S=this.getRenderableIds(p).map(function(Z){return g._tiles[Z].tileID}),w=0,C=S;w=_.browser.now())return!0}return!1},d.prototype.setFeatureState=function(p,g,S){this._state.updateState(p=p||"_geojsonTileLayer",g,S)},d.prototype.removeFeatureState=function(p,g,S){this._state.removeFeatureState(p=p||"_geojsonTileLayer",g,S)},d.prototype.getFeatureState=function(p,g){return this._state.getState(p=p||"_geojsonTileLayer",g)},d.prototype.setDependencies=function(p,g,S){var w=this._tiles[p];w&&w.setDependencies(g,S)},d.prototype.reloadTilesForDependencies=function(p,g){for(var S in this._tiles)this._tiles[S].hasDependency(p,g)&&this._reloadTile(S,"reloading");this._cache.filter(function(w){return!w.hasDependency(p,g)})},d}(_.Evented);function Le(h,d){var p=Math.abs(2*h.wrap)-+(h.wrap<0),g=Math.abs(2*d.wrap)-+(d.wrap<0);return h.overscaledZ-d.overscaledZ||g-p||d.canonical.y-h.canonical.y||d.canonical.x-h.canonical.x}function at(h){return h==="raster"||h==="image"||h==="video"}function Ee(){return new _.window.Worker(Hf.workerUrl)}Q.maxOverzooming=10,Q.maxUnderzooming=3;var ir="mapboxgl_preloaded_worker_pool",wr=function(){this.active={}};wr.prototype.acquire=function(h){if(!this.workers)for(this.workers=[];this.workers.length0?(g-w)/C:0;return this.points[S].mult(1-P).add(this.points[d].mult(P))};var Ji=function(h,d,p){var g=this.boxCells=[],S=this.circleCells=[];this.xCellCount=Math.ceil(h/p),this.yCellCount=Math.ceil(d/p);for(var w=0;w=-d[0]&&p<=d[0]&&g>=-d[1]&&g<=d[1]}function cu(h,d,p,g,S,w,C,P){var Z=g?h.textSizeData:h.iconSizeData,Y=_.evaluateSizeForZoom(Z,p.transform.zoom),pe=[256/p.width*2+1,256/p.height*2+1],_e=g?h.text.dynamicLayoutVertexArray:h.icon.dynamicLayoutVertexArray;_e.clear();for(var ye=h.lineVertexArray,Ue=g?h.text.placedSymbolArray:h.icon.placedSymbolArray,ke=p.transform.width/p.transform.height,Ke=!1,Ie=0;IeMath.abs(p.x-d.x)*g?{useVertical:!0}:(h===_.WritingMode.vertical?d.yp.x)?{needsFlipping:!0}:null}function $l(h,d,p,g,S,w,C,P,Z,Y,pe,_e,ye,Ue){var ke,Ke=d/24,Ie=h.lineOffsetX*Ke,$e=h.lineOffsetY*Ke;if(h.numGlyphs>1){var vt=h.glyphStartIndex+h.numGlyphs,Rt=h.lineStartIndex,Jt=h.lineStartIndex+h.lineLength,zt=ma(Ke,P,Ie,$e,p,pe,_e,h,Z,w,ye);if(!zt)return{notEnoughRoom:!0};var ar=mi(zt.first.point,C).point,_r=mi(zt.last.point,C).point;if(g&&!p){var Nr=Aa(h.writingMode,ar,_r,Ue);if(Nr)return Nr}ke=[zt.first];for(var kr=h.glyphStartIndex+1;kr0?Zn.point:os(_e,zn,un,1,S),vn=Aa(h.writingMode,un,Wi,Ue);if(vn)return vn}var ei=Ta(Ke*P.getoffsetX(h.glyphStartIndex),Ie,$e,p,pe,_e,h.segment,h.lineStartIndex,h.lineStartIndex+h.lineLength,Z,w,ye);if(!ei)return{notEnoughRoom:!0};ke=[ei]}for(var _i=0,ri=ke;_i0?1:-1,ke=0;g&&(Ue*=-1,ke=Math.PI),Ue<0&&(ke+=Math.PI);for(var Ke=Ue>0?P+C:P+C+1,Ie=S,$e=S,vt=0,Rt=0,Jt=Math.abs(ye),zt=[];vt+Rt<=Jt;){if((Ke+=Ue)=Z)return null;if($e=Ie,zt.push(Ie),(Ie=_e[Ke])===void 0){var ar=new _.Point(Y.getx(Ke),Y.gety(Ke)),_r=mi(ar,pe);if(_r.signedDistanceFromCamera>0)Ie=_e[Ke]=_r.point;else{var Nr=Ke-Ue;Ie=os(vt===0?w:new _.Point(Y.getx(Nr),Y.gety(Nr)),ar,$e,Jt-vt+1,pe)}}vt+=Rt,Rt=$e.dist(Ie)}var kr=(Jt-vt)/Rt,un=Ie.sub($e),Pn=un.mult(kr)._add($e);Pn._add(un._unit()._perp()._mult(p*Ue));var zn=ke+Math.atan2(Ie.y-$e.y,Ie.x-$e.x);return zt.push(Pn),{point:Pn,angle:zn,path:zt}}Ji.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Ji.prototype.insert=function(h,d,p,g,S){this._forEachCell(d,p,g,S,this._insertBoxCell,this.boxUid++),this.boxKeys.push(h),this.bboxes.push(d),this.bboxes.push(p),this.bboxes.push(g),this.bboxes.push(S)},Ji.prototype.insertCircle=function(h,d,p,g){this._forEachCell(d-g,p-g,d+g,p+g,this._insertCircleCell,this.circleUid++),this.circleKeys.push(h),this.circles.push(d),this.circles.push(p),this.circles.push(g)},Ji.prototype._insertBoxCell=function(h,d,p,g,S,w){this.boxCells[S].push(w)},Ji.prototype._insertCircleCell=function(h,d,p,g,S,w){this.circleCells[S].push(w)},Ji.prototype._query=function(h,d,p,g,S,w){if(p<0||h>this.width||g<0||d>this.height)return!S&&[];var C=[];if(h<=0&&d<=0&&this.width<=p&&this.height<=g){if(S)return!0;for(var P=0;P0:C},Ji.prototype._queryCircle=function(h,d,p,g,S){var w=h-p,C=h+p,P=d-p,Z=d+p;if(C<0||w>this.width||Z<0||P>this.height)return!g&&[];var Y=[];return this._forEachCell(w,P,C,Z,this._queryCellCircle,Y,{hitTest:g,circle:{x:h,y:d,radius:p},seenUids:{box:{},circle:{}}},S),g?Y.length>0:Y},Ji.prototype.query=function(h,d,p,g,S){return this._query(h,d,p,g,!1,S)},Ji.prototype.hitTest=function(h,d,p,g,S){return this._query(h,d,p,g,!0,S)},Ji.prototype.hitTestCircle=function(h,d,p,g){return this._queryCircle(h,d,p,!0,g)},Ji.prototype._queryCell=function(h,d,p,g,S,w,C,P){var Z=C.seenUids,Y=this.boxCells[S];if(Y!==null)for(var pe=this.bboxes,_e=0,ye=Y;_e=pe[ke+0]&&g>=pe[ke+1]&&(!P||P(this.boxKeys[Ue]))){if(C.hitTest)return w.push(!0),!0;w.push({key:this.boxKeys[Ue],x1:pe[ke],y1:pe[ke+1],x2:pe[ke+2],y2:pe[ke+3]})}}}var Ke=this.circleCells[S];if(Ke!==null)for(var Ie=this.circles,$e=0,vt=Ke;$eC*C+P*P},Ji.prototype._circleAndRectCollide=function(h,d,p,g,S,w,C){var P=(w-g)/2,Z=Math.abs(h-(g+P));if(Z>P+p)return!1;var Y=(C-S)/2,pe=Math.abs(d-(S+Y));if(pe>Y+p)return!1;if(Z<=P||pe<=Y)return!0;var _e=Z-P,ye=pe-Y;return _e*_e+ye*ye<=p*p};var fi=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Oa(h,d){for(var p=0;p=1;Wi--)Zn.push(Pn.path[Wi]);for(var vn=1;vn0){for(var qn=Zn[0].clone(),di=Zn[0].clone(),Jn=1;Jn=Nr.x&&di.x<=kr.x&&qn.y>=Nr.y&&di.y<=kr.y?[Zn]:di.xkr.x||di.ykr.y?[]:_.clipLine([Zn],Nr.x,Nr.y,kr.x,kr.y)}for(var Kn=0,Co=ri;Kn=this.screenRightBoundary||g<100||d>this.screenBottomBoundary},Ao.prototype.isInsideGrid=function(h,d,p,g){return p>=0&&h=0&&d0?(this.prevPlacement&&this.prevPlacement.variableOffsets[_e.crossTileID]&&this.prevPlacement.placements[_e.crossTileID]&&this.prevPlacement.placements[_e.crossTileID].text&&(Ke=this.prevPlacement.variableOffsets[_e.crossTileID].anchor),this.variableOffsets[_e.crossTileID]={textOffset:Ie,width:p,height:g,anchor:h,textBoxScale:S,prevAnchor:Ke},this.markUsedJustification(ye,h,_e,Ue),ye.allowVerticalPlacement&&(this.markUsedOrientation(ye,Ue,_e),this.placedOrientations[_e.crossTileID]=Ue),{shift:$e,placedGlyphBoxes:vt}):void 0},Sn.prototype.placeLayerBucketPart=function(h,d,p){var g=this,S=h.parameters,w=S.bucket,C=S.layout,P=S.posMatrix,Z=S.textLabelPlaneMatrix,Y=S.labelToScreenMatrix,pe=S.textPixelRatio,_e=S.holdingForFade,ye=S.collisionBoxArray,Ue=S.partiallyEvaluatedTextSize,ke=S.collisionGroup,Ke=C.get("text-optional"),Ie=C.get("icon-optional"),$e=C.get("text-allow-overlap"),vt=C.get("icon-allow-overlap"),Rt=C.get("text-rotation-alignment")==="map",Jt=C.get("text-pitch-alignment")==="map",zt=C.get("icon-text-fit")!=="none",ar=C.get("symbol-z-order")==="viewport-y",_r=$e&&(vt||!w.hasIconData()||Ie),Nr=vt&&($e||!w.hasTextData()||Ke);!w.collisionArrays&&ye&&w.deserializeCollisionBoxes(ye);var kr=function(vn,ei){if(!d[vn.crossTileID])if(_e)g.placements[vn.crossTileID]=new Ru(!1,!1,!1);else{var _i,ri=!1,qn=!1,di=!0,Jn=null,Kn={box:null,offscreen:null},Co={box:null,offscreen:null},Ua=null,Ro=null,Lo=0,Ga=0,Xa=0;ei.textFeatureIndex?Lo=ei.textFeatureIndex:vn.useRuntimeCollisionCircles&&(Lo=vn.featureIndex),ei.verticalTextFeatureIndex&&(Ga=ei.verticalTextFeatureIndex);var Ss=ei.textBox;if(Ss){var ls=function(Zi){var mo=_.WritingMode.horizontal;if(w.allowVerticalPlacement&&!Zi&&g.prevPlacement){var ao=g.prevPlacement.placedOrientations[vn.crossTileID];ao&&(g.placedOrientations[vn.crossTileID]=ao,g.markUsedOrientation(w,mo=ao,vn))}return mo},Zu=function(Zi,mo){if(w.allowVerticalPlacement&&vn.numVerticalGlyphVertices>0&&ei.verticalTextBox)for(var ao=0,ou=w.writingModes;ao0&&(cs=cs.filter(function(Zi){return Zi!==nu.anchor})).unshift(nu.anchor)}var Us=function(Zi,mo,ao){for(var ou=Zi.x2-Zi.x1,Bc=Zi.y2-Zi.y1,Bl=vn.textBoxScale,fs=zt&&!vt?mo:null,Or={box:[],offscreen:!1},Wu=$e?2*cs.length:cs.length,Gu=0;Gu=cs.length,vn,w,ao,fs);if(oo&&(Or=oo.placedGlyphBoxes)&&Or.box&&Or.box.length){ri=!0,Jn=oo.shift;break}}return Or};Zu(function(){return Us(Ss,ei.iconBox,_.WritingMode.horizontal)},function(){var Zi=ei.verticalTextBox;return w.allowVerticalPlacement&&!(Kn&&Kn.box&&Kn.box.length)&&vn.numVerticalGlyphVertices>0&&Zi?Us(Zi,ei.verticalIconBox,_.WritingMode.vertical):{box:null,offscreen:null}}),Kn&&(ri=Kn.box,di=Kn.offscreen);var sl=ls(Kn&&Kn.box);if(!ri&&g.prevPlacement){var Fl=g.prevPlacement.variableOffsets[vn.crossTileID];Fl&&(g.variableOffsets[vn.crossTileID]=Fl,g.markUsedJustification(w,Fl.anchor,vn,sl))}}else{var ul=function(Zi,mo){var ao=g.collisionIndex.placeCollisionBox(Zi,$e,pe,P,ke.predicate);return ao&&ao.box&&ao.box.length&&(g.markUsedOrientation(w,mo,vn),g.placedOrientations[vn.crossTileID]=mo),ao};Zu(function(){return ul(Ss,_.WritingMode.horizontal)},function(){var Zi=ei.verticalTextBox;return w.allowVerticalPlacement&&vn.numVerticalGlyphVertices>0&&Zi?ul(Zi,_.WritingMode.vertical):{box:null,offscreen:null}}),ls(Kn&&Kn.box&&Kn.box.length)}}if(ri=(_i=Kn)&&_i.box&&_i.box.length>0,di=_i&&_i.offscreen,vn.useRuntimeCollisionCircles){var kl=w.text.placedSymbolArray.get(vn.centerJustifiedTextSymbolIndex),Vu=_.evaluateSizeForFeature(w.textSizeData,Ue,kl),iu=C.get("text-padding");Ua=g.collisionIndex.placeCollisionCircles($e,kl,w.lineVertexArray,w.glyphOffsetArray,Vu,P,Z,Y,p,Jt,ke.predicate,vn.collisionCircleDiameter,iu),ri=$e||Ua.circles.length>0&&!Ua.collisionDetected,di=di&&Ua.offscreen}if(ei.iconFeatureIndex&&(Xa=ei.iconFeatureIndex),ei.iconBox){var ju=function(Zi){var mo=zt&&Jn?Kt(Zi,Jn.x,Jn.y,Rt,Jt,g.transform.angle):Zi;return g.collisionIndex.placeCollisionBox(mo,vt,pe,P,ke.predicate)};qn=Co&&Co.box&&Co.box.length&&ei.verticalIconBox?(Ro=ju(ei.verticalIconBox)).box.length>0:(Ro=ju(ei.iconBox)).box.length>0,di=di&&Ro.offscreen}var Ko=Ke||vn.numHorizontalGlyphVertices===0&&vn.numVerticalGlyphVertices===0,Qa=Ie||vn.numIconVertices===0;if(Ko||Qa?Qa?Ko||(qn=qn&&ri):ri=qn&&ri:qn=ri=qn&&ri,ri&&_i&&_i.box&&g.collisionIndex.insertCollisionBox(_i.box,C.get("text-ignore-placement"),w.bucketInstanceId,Co&&Co.box&&Ga?Ga:Lo,ke.ID),qn&&Ro&&g.collisionIndex.insertCollisionBox(Ro.box,C.get("icon-ignore-placement"),w.bucketInstanceId,Xa,ke.ID),Ua&&(ri&&g.collisionIndex.insertCollisionCircles(Ua.circles,C.get("text-ignore-placement"),w.bucketInstanceId,Lo,ke.ID),p)){var As=w.bucketInstanceId,au=g.collisionCircleArrays[As];au===void 0&&(au=g.collisionCircleArrays[As]=new ss);for(var Hu=0;Hu=0;--Pn){var zn=un[Pn];kr(w.symbolInstances.get(zn),w.collisionArrays[zn])}else for(var Zn=h.symbolInstanceStart;Zn=0&&(h.text.placedSymbolArray.get(P).crossTileID=S>=0&&P!==S?0:p.crossTileID)}},Sn.prototype.markUsedOrientation=function(h,d,p){for(var g=d===_.WritingMode.horizontal||d===_.WritingMode.horizontalOnly?d:0,S=d===_.WritingMode.vertical?d:0,w=0,C=[p.leftJustifiedTextSymbolIndex,p.centerJustifiedTextSymbolIndex,p.rightJustifiedTextSymbolIndex];w0,Nr=g.placedOrientations[vt.crossTileID],kr=Nr===_.WritingMode.vertical,un=Nr===_.WritingMode.horizontal||Nr===_.WritingMode.horizontalOnly;if(Rt>0||Jt>0){var Pn=To(ar.text);Ue(h.text,Rt,kr?co:Pn),Ue(h.text,Jt,un?co:Pn);var zn=ar.text.isHidden();[vt.rightJustifiedTextSymbolIndex,vt.centerJustifiedTextSymbolIndex,vt.leftJustifiedTextSymbolIndex].forEach(function(Kn){Kn>=0&&(h.text.placedSymbolArray.get(Kn).hidden=zn||kr?1:0)}),vt.verticalPlacedTextSymbolIndex>=0&&(h.text.placedSymbolArray.get(vt.verticalPlacedTextSymbolIndex).hidden=zn||un?1:0);var Zn=g.variableOffsets[vt.crossTileID];Zn&&g.markUsedJustification(h,Zn.anchor,vt,Nr);var Wi=g.placedOrientations[vt.crossTileID];Wi&&(g.markUsedJustification(h,"left",vt,Wi),g.markUsedOrientation(h,Wi,vt))}if(_r){var vn=To(ar.icon),ei=!(_e&&vt.verticalPlacedIconSymbolIndex&&kr);vt.placedIconSymbolIndex>=0&&(Ue(h.icon,vt.numIconVertices,ei?vn:co),h.icon.placedSymbolArray.get(vt.placedIconSymbolIndex).hidden=ar.icon.isHidden()),vt.verticalPlacedIconSymbolIndex>=0&&(Ue(h.icon,vt.numVerticalIconVertices,ei?co:vn),h.icon.placedSymbolArray.get(vt.verticalPlacedIconSymbolIndex).hidden=ar.icon.isHidden())}if(h.hasIconCollisionBoxData()||h.hasTextCollisionBoxData()){var _i=h.collisionArrays[$e];if(_i){var ri=new _.Point(0,0);if(_i.textBox||_i.verticalTextBox){var qn=!0;if(Z){var di=g.variableOffsets[zt];di?(ri=ea(di.anchor,di.width,di.height,di.textOffset,di.textBoxScale),Y&&ri._rotate(pe?g.transform.angle:-g.transform.angle)):qn=!1}_i.textBox&&de(h.textCollisionBox.collisionVertexArray,ar.text.placed,!qn||kr,ri.x,ri.y),_i.verticalTextBox&&de(h.textCollisionBox.collisionVertexArray,ar.text.placed,!qn||un,ri.x,ri.y)}var Jn=!!(!un&&_i.verticalIconBox);_i.iconBox&&de(h.iconCollisionBox.collisionVertexArray,ar.icon.placed,Jn,_e?ri.x:0,_e?ri.y:0),_i.verticalIconBox&&de(h.iconCollisionBox.collisionVertexArray,ar.icon.placed,!Jn,_e?ri.x:0,_e?ri.y:0)}}},Ke=0;Keh},Sn.prototype.setStale=function(){this.stale=!0};var Re=Math.pow(2,25),ct=Math.pow(2,24),or=Math.pow(2,17),jr=Math.pow(2,16),In=Math.pow(2,9),Hi=Math.pow(2,8),vo=Math.pow(2,1);function To(h){if(h.opacity===0&&!h.placed)return 0;if(h.opacity===1&&h.placed)return 4294967295;var d=h.placed?1:0,p=Math.floor(127*h.opacity);return p*Re+d*ct+p*or+d*jr+p*In+d*Hi+p*vo+d}var co=0,Ps=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=[]};Ps.prototype.continuePlacement=function(h,d,p,g,S){for(var w=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var C=d[h[this._currentPlacementIndex]],P=this.placement.collisionIndex.transform.zoom;if(C.type==="symbol"&&(!C.minzoom||C.minzoom<=P)&&(!C.maxzoom||C.maxzoom>P)){if(this._inProgressLayer||(this._inProgressLayer=new Ps(C)),this._inProgressLayer.continuePlacement(p[C.source],this.placement,this._showCollisionBoxes,C,w))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ys.prototype.commit=function(h){return this.placement.commit(h),this.placement};var Kh=512/_.EXTENT/2,Cf=function(h,d,p){this.tileID=h,this.indexedSymbolInstances={},this.bucketInstanceId=p;for(var g=0;gh.overscaledZ)for(var P in C){var Z=C[P];Z.tileID.isChildOf(h)&&Z.findMatches(d.symbolInstances,h,S)}else{var Y=C[h.scaledTo(Number(w)).key];Y&&Y.findMatches(d.symbolInstances,h,S)}}for(var pe=0;pe1?"@2x":"",_e=_.getJSON(w.transformRequest(w.normalizeSpriteURL(S,pe,".json"),_.ResourceType.SpriteJSON),function(ke,Ke){_e=null,Y||(Y=ke,P=Ke,Ue())}),ye=_.getImage(w.transformRequest(w.normalizeSpriteURL(S,pe,".png"),_.ResourceType.SpriteImage),function(ke,Ke){ye=null,Y||(Y=ke,Z=Ke,Ue())});function Ue(){if(Y)C(Y);else if(P&&Z){var ke=_.browser.getImageData(Z),Ke={};for(var Ie in P){var $e=P[Ie],vt=$e.width,Rt=$e.height,Jt=$e.x,zt=$e.y,ar=$e.sdf,_r=$e.pixelRatio,Nr=$e.stretchX,kr=$e.stretchY,un=$e.content,Pn=new _.RGBAImage({width:vt,height:Rt});_.RGBAImage.copy(ke,Pn,{x:Jt,y:zt},{x:0,y:0},{width:vt,height:Rt}),Ke[Ie]={data:Pn,pixelRatio:_r,sdf:ar,stretchX:Nr,stretchY:kr,content:un}}C(null,Ke)}}return{cancel:function(){_e&&(_e.cancel(),_e=null),ye&&(ye.cancel(),ye=null)}}}(p,this.map._requestManager,function(S,w){if(g._spriteRequest=null,S)g.fire(new _.ErrorEvent(S));else if(w)for(var C in w)g.imageManager.addImage(C,w[C]);g.imageManager.setLoaded(!0),g._availableImages=g.imageManager.listImages(),g.dispatcher.broadcast("setImages",g._availableImages),g.fire(new _.Event("data",{dataType:"style"}))})},d.prototype._validateLayer=function(p){var g=this.sourceCaches[p.source];if(g){var S=p.sourceLayer;if(S){var w=g.getSource();(w.type==="geojson"||w.vectorLayerIds&&w.vectorLayerIds.indexOf(S)===-1)&&this.fire(new _.ErrorEvent(new Error('Source layer "'+S+'" does not exist on source "'+w.id+'" as specified by style layer "'+p.id+'"')))}}},d.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var p in this.sourceCaches)if(!this.sourceCaches[p].loaded())return!1;return!!this.imageManager.isLoaded()},d.prototype._serializeLayers=function(p){for(var g=[],S=0,w=p;S0)throw new Error("Unimplemented: "+w.map(function(C){return C.command}).join(", ")+".");return S.forEach(function(C){C.command!=="setTransition"&&g[C.command].apply(g,C.args)}),this.stylesheet=p,!0},d.prototype.addImage=function(p,g){if(this.getImage(p))return this.fire(new _.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(p,g),this._afterImageUpdated(p)},d.prototype.updateImage=function(p,g){this.imageManager.updateImage(p,g)},d.prototype.getImage=function(p){return this.imageManager.getImage(p)},d.prototype.removeImage=function(p){if(!this.getImage(p))return this.fire(new _.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(p),this._afterImageUpdated(p)},d.prototype._afterImageUpdated=function(p){this._availableImages=this.imageManager.listImages(),this._changedImages[p]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new _.Event("data",{dataType:"style"}))},d.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},d.prototype.addSource=function(p,g,S){var w=this;if(S===void 0&&(S={}),this._checkLoaded(),this.sourceCaches[p]!==void 0)throw new Error("There is already a source with this ID");if(!g.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(g).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(g.type)>=0&&this._validate(_.validateStyle.source,"sources."+p,g,null,S))){this.map&&this.map._collectResourceTiming&&(g.collectResourceTiming=!0);var C=this.sourceCaches[p]=new Q(p,g,this.dispatcher);C.style=this,C.setEventedParent(this,function(){return{isSourceLoaded:w.loaded(),source:C.serialize(),sourceId:p}}),C.onAdd(this.map),this._changed=!0}},d.prototype.removeSource=function(p){if(this._checkLoaded(),this.sourceCaches[p]===void 0)throw new Error("There is no source with this ID");for(var g in this._layers)if(this._layers[g].source===p)return this.fire(new _.ErrorEvent(new Error('Source "'+p+'" cannot be removed while layer "'+g+'" is using it.')));var S=this.sourceCaches[p];delete this.sourceCaches[p],delete this._updatedSources[p],S.fire(new _.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:p})),S.setEventedParent(null),S.clearTiles(),S.onRemove&&S.onRemove(this.map),this._changed=!0},d.prototype.setGeoJSONSourceData=function(p,g){this._checkLoaded(),this.sourceCaches[p].getSource().setData(g),this._changed=!0},d.prototype.getSource=function(p){return this.sourceCaches[p]&&this.sourceCaches[p].getSource()},d.prototype.addLayer=function(p,g,S){S===void 0&&(S={}),this._checkLoaded();var w=p.id;if(this.getLayer(w))this.fire(new _.ErrorEvent(new Error('Layer with id "'+w+'" already exists on this map')));else{var C;if(p.type==="custom"){if(Mu(this,_.validateCustomStyleLayer(p)))return;C=_.createStyleLayer(p)}else{if(typeof p.source=="object"&&(this.addSource(w,p.source),p=_.clone$1(p),p=_.extend(p,{source:w})),this._validate(_.validateStyle.layer,"layers."+w,p,{arrayIndex:-1},S))return;C=_.createStyleLayer(p),this._validateLayer(C),C.setEventedParent(this,{layer:{id:w}}),this._serializedLayers[C.id]=C.serialize()}var P=g?this._order.indexOf(g):this._order.length;if(g&&P===-1)this.fire(new _.ErrorEvent(new Error('Layer with id "'+g+'" does not exist on this map.')));else{if(this._order.splice(P,0,w),this._layerOrderChanged=!0,this._layers[w]=C,this._removedLayers[w]&&C.source&&C.type!=="custom"){var Z=this._removedLayers[w];delete this._removedLayers[w],Z.type!==C.type?this._updatedSources[C.source]="clear":(this._updatedSources[C.source]="reload",this.sourceCaches[C.source].pause())}this._updateLayer(C),C.onAdd&&C.onAdd(this.map)}}},d.prototype.moveLayer=function(p,g){if(this._checkLoaded(),this._changed=!0,this._layers[p]){if(p!==g){var S=this._order.indexOf(p);this._order.splice(S,1);var w=g?this._order.indexOf(g):this._order.length;g&&w===-1?this.fire(new _.ErrorEvent(new Error('Layer with id "'+g+'" does not exist on this map.'))):(this._order.splice(w,0,p),this._layerOrderChanged=!0)}}else this.fire(new _.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot be moved.")))},d.prototype.removeLayer=function(p){this._checkLoaded();var g=this._layers[p];if(g){g.setEventedParent(null);var S=this._order.indexOf(p);this._order.splice(S,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[p]=g,delete this._layers[p],delete this._serializedLayers[p],delete this._updatedLayers[p],delete this._updatedPaintProps[p],g.onRemove&&g.onRemove(this.map)}else this.fire(new _.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot be removed.")))},d.prototype.getLayer=function(p){return this._layers[p]},d.prototype.hasLayer=function(p){return p in this._layers},d.prototype.setLayerZoomRange=function(p,g,S){this._checkLoaded();var w=this.getLayer(p);w?w.minzoom===g&&w.maxzoom===S||(g!=null&&(w.minzoom=g),S!=null&&(w.maxzoom=S),this._updateLayer(w)):this.fire(new _.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot have zoom extent.")))},d.prototype.setFilter=function(p,g,S){S===void 0&&(S={}),this._checkLoaded();var w=this.getLayer(p);if(w){if(!_.deepEqual(w.filter,g))return g==null?(w.filter=void 0,void this._updateLayer(w)):void(this._validate(_.validateStyle.filter,"layers."+w.id+".filter",g,null,S)||(w.filter=_.clone$1(g),this._updateLayer(w)))}else this.fire(new _.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot be filtered.")))},d.prototype.getFilter=function(p){return _.clone$1(this.getLayer(p).filter)},d.prototype.setLayoutProperty=function(p,g,S,w){w===void 0&&(w={}),this._checkLoaded();var C=this.getLayer(p);C?_.deepEqual(C.getLayoutProperty(g),S)||(C.setLayoutProperty(g,S,w),this._updateLayer(C)):this.fire(new _.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot be styled.")))},d.prototype.getLayoutProperty=function(p,g){var S=this.getLayer(p);if(S)return S.getLayoutProperty(g);this.fire(new _.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style.")))},d.prototype.setPaintProperty=function(p,g,S,w){w===void 0&&(w={}),this._checkLoaded();var C=this.getLayer(p);C?_.deepEqual(C.getPaintProperty(g),S)||(C.setPaintProperty(g,S,w)&&this._updateLayer(C),this._changed=!0,this._updatedPaintProps[p]=!0):this.fire(new _.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot be styled.")))},d.prototype.getPaintProperty=function(p,g){return this.getLayer(p).getPaintProperty(g)},d.prototype.setFeatureState=function(p,g){this._checkLoaded();var S=p.source,w=p.sourceLayer,C=this.sourceCaches[S];if(C!==void 0){var P=C.getSource().type;P==="geojson"&&w?this.fire(new _.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):P!=="vector"||w?(p.id===void 0&&this.fire(new _.ErrorEvent(new Error("The feature id parameter must be provided."))),C.setFeatureState(w,p.id,g)):this.fire(new _.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new _.ErrorEvent(new Error("The source '"+S+"' does not exist in the map's style.")))},d.prototype.removeFeatureState=function(p,g){this._checkLoaded();var S=p.source,w=this.sourceCaches[S];if(w!==void 0){var C=w.getSource().type,P=C==="vector"?p.sourceLayer:void 0;C!=="vector"||P?g&&typeof p.id!="string"&&typeof p.id!="number"?this.fire(new _.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):w.removeFeatureState(P,p.id,g):this.fire(new _.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new _.ErrorEvent(new Error("The source '"+S+"' does not exist in the map's style.")))},d.prototype.getFeatureState=function(p){this._checkLoaded();var g=p.source,S=p.sourceLayer,w=this.sourceCaches[g];if(w!==void 0){if(w.getSource().type!=="vector"||S)return p.id===void 0&&this.fire(new _.ErrorEvent(new Error("The feature id parameter must be provided."))),w.getFeatureState(S,p.id);this.fire(new _.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new _.ErrorEvent(new Error("The source '"+g+"' does not exist in the map's style.")))},d.prototype.getTransition=function(){return _.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},d.prototype.serialize=function(){return _.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:_.mapObject(this.sourceCaches,function(p){return p.serialize()}),layers:this._serializeLayers(this._order)},function(p){return p!==void 0})},d.prototype._updateLayer=function(p){this._updatedLayers[p.id]=!0,p.source&&!this._updatedSources[p.source]&&this.sourceCaches[p.source].getSource().type!=="raster"&&(this._updatedSources[p.source]="reload",this.sourceCaches[p.source].pause()),this._changed=!0},d.prototype._flattenAndSortRenderedFeatures=function(p){for(var g=this,S=function(Nr){return g._layers[Nr].type==="fill-extrusion"},w={},C=[],P=this._order.length-1;P>=0;P--){var Z=this._order[P];if(S(Z)){w[Z]=P;for(var Y=0,pe=p;Y=0;Ke--){var Ie=this._order[Ke];if(S(Ie))for(var $e=C.length-1;$e>=0;$e--){var vt=C[$e].feature;if(w[vt.layer.id] 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;}"),Jh=Ii("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);}"),ep=Ii("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);}"),Zp=Ii(`#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);}`),Jc=Ii(`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;}`),Pu=Ii(`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;}`),tp=Ii(`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);}`),Ho=Ii(`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;}`),Yl=Ii(`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;}`),Sl=Ii(`#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;}"),$s=Ii(`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;}"),Al=Ii(`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);}`),oi=Ii(`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);}`),el=Ii(`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;}`),Ds=Ii(`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);}`),Ou=Ii(`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;}"),tl=Ii(`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));}`),rp=Ii(`#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);}`),ta=Ii(`#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 Ii(h,d){var p=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,g=d.match(/attribute ([\w]+) ([\w]+)/g),S=h.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),w=d.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),C=w?w.concat(S):S,P={};return{fragmentSource:h=h.replace(p,function(Z,Y,pe,_e,ye){return P[ye]=!0,Y==="define"?` #ifndef HAS_UNIFORM_u_`+ye+` varying `+pe+" "+_e+" "+ye+`; #else uniform `+pe+" "+_e+" u_"+ye+`; #endif `:` #ifdef HAS_UNIFORM_u_`+ye+` `+pe+" "+_e+" "+ye+" = u_"+ye+`; #endif `}),vertexSource:d=d.replace(p,function(Z,Y,pe,_e,ye){var Ue=_e==="float"?"vec2":"vec4",ke=ye.match(/color/)?"color":Ue;return P[ye]?Y==="define"?` #ifndef HAS_UNIFORM_u_`+ye+` uniform lowp float u_`+ye+`_t; attribute `+pe+" "+Ue+" a_"+ye+`; varying `+pe+" "+_e+" "+ye+`; #else uniform `+pe+" "+_e+" u_"+ye+`; #endif `:ke==="vec4"?` #ifndef HAS_UNIFORM_u_`+ye+` `+ye+" = a_"+ye+`; #else `+pe+" "+_e+" "+ye+" = u_"+ye+`; #endif `:` #ifndef HAS_UNIFORM_u_`+ye+` `+ye+" = unpack_mix_"+ke+"(a_"+ye+", u_"+ye+`_t); #else `+pe+" "+_e+" "+ye+" = u_"+ye+`; #endif `:Y==="define"?` #ifndef HAS_UNIFORM_u_`+ye+` uniform lowp float u_`+ye+`_t; attribute `+pe+" "+Ue+" a_"+ye+`; #else uniform `+pe+" "+_e+" u_"+ye+`; #endif `:ke==="vec4"?` #ifndef HAS_UNIFORM_u_`+ye+` `+pe+" "+_e+" "+ye+" = a_"+ye+`; #else `+pe+" "+_e+" "+ye+" = u_"+ye+`; #endif `:` #ifndef HAS_UNIFORM_u_`+ye+` `+pe+" "+_e+" "+ye+" = unpack_mix_"+ke+"(a_"+ye+", u_"+ye+`_t); #else `+pe+" "+_e+" "+ye+" = u_"+ye+`; #endif `}),staticAttributes:g,staticUniforms:C}}var fu=Object.freeze({__proto__:null,prelude:El,background:Ju,backgroundPattern:Rf,circle:Qh,clippingMask:Mf,heatmap:ph,heatmapTexture:dh,collisionBox:vh,collisionCircle:Jh,debug:ep,fill:Zp,fillOutline:Jc,fillOutlinePattern:Pu,fillPattern:tp,fillExtrusion:Ho,fillExtrusionPattern:Yl,hillshadePrepare:Sl,hillshade:$s,line:Al,lineGradient:oi,linePattern:el,lineSDF:Ds,raster:Ou,symbolIcon:tl,symbolSDF:rp,symbolTextAndIcon:ta}),Du=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function mh(h){for(var d=[],p=0;p>16,P>>16],u_pixel_coord_lower:[65535&C,65535&P]}}Ha.prototype.draw=function(h,d,p,g,S,w,C,P,Z,Y,pe,_e,ye,Ue,ke,Ke){var Ie,$e=h.gl;if(!this.failedToCreate){for(var vt in h.program.set(this.program),h.setDepthMode(p),h.setStencilMode(g),h.setColorMode(S),h.setCullFace(w),this.fixedUniforms)this.fixedUniforms[vt].set(C[vt]);Ue&&Ue.setUniforms(h,this.binderUniforms,_e,{zoom:ye});for(var Rt=(Ie={},Ie[$e.LINES]=2,Ie[$e.TRIANGLES]=3,Ie[$e.LINE_STRIP]=1,Ie)[d],Jt=0,zt=pe.get();Jt0?1-1/(1.001-C):-C),u_contrast_factor:(w=S.paint.get("raster-contrast"),w>0?1/(1-w):1+w),u_spin_weights:Pf(S.paint.get("raster-hue-rotate"))};var w,C};function Pf(h){h*=Math.PI/180;var d=Math.sin(h),p=Math.cos(h);return[(2*p+1)/3,(-Math.sqrt(3)*d-p+1)/3,(Math.sqrt(3)*d-p+1)/3]}var wl,hu=function(h,d,p,g,S,w,C,P,Z,Y){var pe=S.transform;return{u_is_size_zoom_constant:+(h==="constant"||h==="source"),u_is_size_feature_constant:+(h==="constant"||h==="camera"),u_size_t:d?d.uSizeT:0,u_size:d?d.uSize:0,u_camera_to_center_distance:pe.cameraToCenterDistance,u_pitch:pe.pitch/360*2*Math.PI,u_rotate_symbol:+p,u_aspect_ratio:pe.width/pe.height,u_fade_change:S.options.fadeDuration?S.symbolFadeChange:1,u_matrix:w,u_label_plane_matrix:C,u_coord_matrix:P,u_is_text:+Z,u_pitch_with_map:+g,u_texsize:Y,u_texture:0}},Mc=function(h,d,p,g,S,w,C,P,Z,Y,pe){var _e=S.transform;return _.extend(hu(h,d,p,g,S,w,C,P,Z,Y),{u_gamma_scale:g?Math.cos(_e._pitch)*_e.cameraToCenterDistance:1,u_device_pixel_ratio:_.browser.devicePixelRatio,u_is_halo:+pe})},rf=function(h,d,p,g,S,w,C,P,Z,Y){return _.extend(Mc(h,d,p,g,S,w,C,P,!0,Z,!0),{u_texsize_icon:Y,u_texture_icon:1})},ec=function(h,d,p){return{u_matrix:h,u_opacity:d,u_color:p}},tc=function(h,d,p,g,S,w){return _.extend(function(C,P,Z,Y){var pe=Z.imageManager.getPattern(C.from.toString()),_e=Z.imageManager.getPattern(C.to.toString()),ye=Z.imageManager.getPixelSize(),Ue=ye.width,ke=ye.height,Ke=Math.pow(2,Y.tileID.overscaledZ),Ie=Y.tileSize*Math.pow(2,Z.transform.tileZoom)/Ke,$e=Ie*(Y.tileID.canonical.x+Y.tileID.wrap*Ke),vt=Ie*Y.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:pe.tl,u_pattern_br_a:pe.br,u_pattern_tl_b:_e.tl,u_pattern_br_b:_e.br,u_texsize:[Ue,ke],u_mix:P.t,u_pattern_size_a:pe.displaySize,u_pattern_size_b:_e.displaySize,u_scale_a:P.fromScale,u_scale_b:P.toScale,u_tile_units_to_pixels:1/ha(Y,1,Z.transform.tileZoom),u_pixel_coord_upper:[$e>>16,vt>>16],u_pixel_coord_lower:[65535&$e,65535&vt]}}(g,w,p,S),{u_matrix:h,u_opacity:d})},ip={fillExtrusion:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_lightpos:new _.Uniform3f(h,d.u_lightpos),u_lightintensity:new _.Uniform1f(h,d.u_lightintensity),u_lightcolor:new _.Uniform3f(h,d.u_lightcolor),u_vertical_gradient:new _.Uniform1f(h,d.u_vertical_gradient),u_opacity:new _.Uniform1f(h,d.u_opacity)}},fillExtrusionPattern:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_lightpos:new _.Uniform3f(h,d.u_lightpos),u_lightintensity:new _.Uniform1f(h,d.u_lightintensity),u_lightcolor:new _.Uniform3f(h,d.u_lightcolor),u_vertical_gradient:new _.Uniform1f(h,d.u_vertical_gradient),u_height_factor:new _.Uniform1f(h,d.u_height_factor),u_image:new _.Uniform1i(h,d.u_image),u_texsize:new _.Uniform2f(h,d.u_texsize),u_pixel_coord_upper:new _.Uniform2f(h,d.u_pixel_coord_upper),u_pixel_coord_lower:new _.Uniform2f(h,d.u_pixel_coord_lower),u_scale:new _.Uniform3f(h,d.u_scale),u_fade:new _.Uniform1f(h,d.u_fade),u_opacity:new _.Uniform1f(h,d.u_opacity)}},fill:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix)}},fillPattern:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_image:new _.Uniform1i(h,d.u_image),u_texsize:new _.Uniform2f(h,d.u_texsize),u_pixel_coord_upper:new _.Uniform2f(h,d.u_pixel_coord_upper),u_pixel_coord_lower:new _.Uniform2f(h,d.u_pixel_coord_lower),u_scale:new _.Uniform3f(h,d.u_scale),u_fade:new _.Uniform1f(h,d.u_fade)}},fillOutline:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_world:new _.Uniform2f(h,d.u_world)}},fillOutlinePattern:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_world:new _.Uniform2f(h,d.u_world),u_image:new _.Uniform1i(h,d.u_image),u_texsize:new _.Uniform2f(h,d.u_texsize),u_pixel_coord_upper:new _.Uniform2f(h,d.u_pixel_coord_upper),u_pixel_coord_lower:new _.Uniform2f(h,d.u_pixel_coord_lower),u_scale:new _.Uniform3f(h,d.u_scale),u_fade:new _.Uniform1f(h,d.u_fade)}},circle:function(h,d){return{u_camera_to_center_distance:new _.Uniform1f(h,d.u_camera_to_center_distance),u_scale_with_map:new _.Uniform1i(h,d.u_scale_with_map),u_pitch_with_map:new _.Uniform1i(h,d.u_pitch_with_map),u_extrude_scale:new _.Uniform2f(h,d.u_extrude_scale),u_device_pixel_ratio:new _.Uniform1f(h,d.u_device_pixel_ratio),u_matrix:new _.UniformMatrix4f(h,d.u_matrix)}},collisionBox:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_camera_to_center_distance:new _.Uniform1f(h,d.u_camera_to_center_distance),u_pixels_to_tile_units:new _.Uniform1f(h,d.u_pixels_to_tile_units),u_extrude_scale:new _.Uniform2f(h,d.u_extrude_scale),u_overscale_factor:new _.Uniform1f(h,d.u_overscale_factor)}},collisionCircle:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_inv_matrix:new _.UniformMatrix4f(h,d.u_inv_matrix),u_camera_to_center_distance:new _.Uniform1f(h,d.u_camera_to_center_distance),u_viewport_size:new _.Uniform2f(h,d.u_viewport_size)}},debug:function(h,d){return{u_color:new _.UniformColor(h,d.u_color),u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_overlay:new _.Uniform1i(h,d.u_overlay),u_overlay_scale:new _.Uniform1f(h,d.u_overlay_scale)}},clippingMask:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix)}},heatmap:function(h,d){return{u_extrude_scale:new _.Uniform1f(h,d.u_extrude_scale),u_intensity:new _.Uniform1f(h,d.u_intensity),u_matrix:new _.UniformMatrix4f(h,d.u_matrix)}},heatmapTexture:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_world:new _.Uniform2f(h,d.u_world),u_image:new _.Uniform1i(h,d.u_image),u_color_ramp:new _.Uniform1i(h,d.u_color_ramp),u_opacity:new _.Uniform1f(h,d.u_opacity)}},hillshade:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_image:new _.Uniform1i(h,d.u_image),u_latrange:new _.Uniform2f(h,d.u_latrange),u_light:new _.Uniform2f(h,d.u_light),u_shadow:new _.UniformColor(h,d.u_shadow),u_highlight:new _.UniformColor(h,d.u_highlight),u_accent:new _.UniformColor(h,d.u_accent)}},hillshadePrepare:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_image:new _.Uniform1i(h,d.u_image),u_dimension:new _.Uniform2f(h,d.u_dimension),u_zoom:new _.Uniform1f(h,d.u_zoom),u_unpack:new _.Uniform4f(h,d.u_unpack)}},line:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_ratio:new _.Uniform1f(h,d.u_ratio),u_device_pixel_ratio:new _.Uniform1f(h,d.u_device_pixel_ratio),u_units_to_pixels:new _.Uniform2f(h,d.u_units_to_pixels)}},lineGradient:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_ratio:new _.Uniform1f(h,d.u_ratio),u_device_pixel_ratio:new _.Uniform1f(h,d.u_device_pixel_ratio),u_units_to_pixels:new _.Uniform2f(h,d.u_units_to_pixels),u_image:new _.Uniform1i(h,d.u_image),u_image_height:new _.Uniform1f(h,d.u_image_height)}},linePattern:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_texsize:new _.Uniform2f(h,d.u_texsize),u_ratio:new _.Uniform1f(h,d.u_ratio),u_device_pixel_ratio:new _.Uniform1f(h,d.u_device_pixel_ratio),u_image:new _.Uniform1i(h,d.u_image),u_units_to_pixels:new _.Uniform2f(h,d.u_units_to_pixels),u_scale:new _.Uniform3f(h,d.u_scale),u_fade:new _.Uniform1f(h,d.u_fade)}},lineSDF:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_ratio:new _.Uniform1f(h,d.u_ratio),u_device_pixel_ratio:new _.Uniform1f(h,d.u_device_pixel_ratio),u_units_to_pixels:new _.Uniform2f(h,d.u_units_to_pixels),u_patternscale_a:new _.Uniform2f(h,d.u_patternscale_a),u_patternscale_b:new _.Uniform2f(h,d.u_patternscale_b),u_sdfgamma:new _.Uniform1f(h,d.u_sdfgamma),u_image:new _.Uniform1i(h,d.u_image),u_tex_y_a:new _.Uniform1f(h,d.u_tex_y_a),u_tex_y_b:new _.Uniform1f(h,d.u_tex_y_b),u_mix:new _.Uniform1f(h,d.u_mix)}},raster:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_tl_parent:new _.Uniform2f(h,d.u_tl_parent),u_scale_parent:new _.Uniform1f(h,d.u_scale_parent),u_buffer_scale:new _.Uniform1f(h,d.u_buffer_scale),u_fade_t:new _.Uniform1f(h,d.u_fade_t),u_opacity:new _.Uniform1f(h,d.u_opacity),u_image0:new _.Uniform1i(h,d.u_image0),u_image1:new _.Uniform1i(h,d.u_image1),u_brightness_low:new _.Uniform1f(h,d.u_brightness_low),u_brightness_high:new _.Uniform1f(h,d.u_brightness_high),u_saturation_factor:new _.Uniform1f(h,d.u_saturation_factor),u_contrast_factor:new _.Uniform1f(h,d.u_contrast_factor),u_spin_weights:new _.Uniform3f(h,d.u_spin_weights)}},symbolIcon:function(h,d){return{u_is_size_zoom_constant:new _.Uniform1i(h,d.u_is_size_zoom_constant),u_is_size_feature_constant:new _.Uniform1i(h,d.u_is_size_feature_constant),u_size_t:new _.Uniform1f(h,d.u_size_t),u_size:new _.Uniform1f(h,d.u_size),u_camera_to_center_distance:new _.Uniform1f(h,d.u_camera_to_center_distance),u_pitch:new _.Uniform1f(h,d.u_pitch),u_rotate_symbol:new _.Uniform1i(h,d.u_rotate_symbol),u_aspect_ratio:new _.Uniform1f(h,d.u_aspect_ratio),u_fade_change:new _.Uniform1f(h,d.u_fade_change),u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_label_plane_matrix:new _.UniformMatrix4f(h,d.u_label_plane_matrix),u_coord_matrix:new _.UniformMatrix4f(h,d.u_coord_matrix),u_is_text:new _.Uniform1i(h,d.u_is_text),u_pitch_with_map:new _.Uniform1i(h,d.u_pitch_with_map),u_texsize:new _.Uniform2f(h,d.u_texsize),u_texture:new _.Uniform1i(h,d.u_texture)}},symbolSDF:function(h,d){return{u_is_size_zoom_constant:new _.Uniform1i(h,d.u_is_size_zoom_constant),u_is_size_feature_constant:new _.Uniform1i(h,d.u_is_size_feature_constant),u_size_t:new _.Uniform1f(h,d.u_size_t),u_size:new _.Uniform1f(h,d.u_size),u_camera_to_center_distance:new _.Uniform1f(h,d.u_camera_to_center_distance),u_pitch:new _.Uniform1f(h,d.u_pitch),u_rotate_symbol:new _.Uniform1i(h,d.u_rotate_symbol),u_aspect_ratio:new _.Uniform1f(h,d.u_aspect_ratio),u_fade_change:new _.Uniform1f(h,d.u_fade_change),u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_label_plane_matrix:new _.UniformMatrix4f(h,d.u_label_plane_matrix),u_coord_matrix:new _.UniformMatrix4f(h,d.u_coord_matrix),u_is_text:new _.Uniform1i(h,d.u_is_text),u_pitch_with_map:new _.Uniform1i(h,d.u_pitch_with_map),u_texsize:new _.Uniform2f(h,d.u_texsize),u_texture:new _.Uniform1i(h,d.u_texture),u_gamma_scale:new _.Uniform1f(h,d.u_gamma_scale),u_device_pixel_ratio:new _.Uniform1f(h,d.u_device_pixel_ratio),u_is_halo:new _.Uniform1i(h,d.u_is_halo)}},symbolTextAndIcon:function(h,d){return{u_is_size_zoom_constant:new _.Uniform1i(h,d.u_is_size_zoom_constant),u_is_size_feature_constant:new _.Uniform1i(h,d.u_is_size_feature_constant),u_size_t:new _.Uniform1f(h,d.u_size_t),u_size:new _.Uniform1f(h,d.u_size),u_camera_to_center_distance:new _.Uniform1f(h,d.u_camera_to_center_distance),u_pitch:new _.Uniform1f(h,d.u_pitch),u_rotate_symbol:new _.Uniform1i(h,d.u_rotate_symbol),u_aspect_ratio:new _.Uniform1f(h,d.u_aspect_ratio),u_fade_change:new _.Uniform1f(h,d.u_fade_change),u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_label_plane_matrix:new _.UniformMatrix4f(h,d.u_label_plane_matrix),u_coord_matrix:new _.UniformMatrix4f(h,d.u_coord_matrix),u_is_text:new _.Uniform1i(h,d.u_is_text),u_pitch_with_map:new _.Uniform1i(h,d.u_pitch_with_map),u_texsize:new _.Uniform2f(h,d.u_texsize),u_texsize_icon:new _.Uniform2f(h,d.u_texsize_icon),u_texture:new _.Uniform1i(h,d.u_texture),u_texture_icon:new _.Uniform1i(h,d.u_texture_icon),u_gamma_scale:new _.Uniform1f(h,d.u_gamma_scale),u_device_pixel_ratio:new _.Uniform1f(h,d.u_device_pixel_ratio),u_is_halo:new _.Uniform1i(h,d.u_is_halo)}},background:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_opacity:new _.Uniform1f(h,d.u_opacity),u_color:new _.UniformColor(h,d.u_color)}},backgroundPattern:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_opacity:new _.Uniform1f(h,d.u_opacity),u_image:new _.Uniform1i(h,d.u_image),u_pattern_tl_a:new _.Uniform2f(h,d.u_pattern_tl_a),u_pattern_br_a:new _.Uniform2f(h,d.u_pattern_br_a),u_pattern_tl_b:new _.Uniform2f(h,d.u_pattern_tl_b),u_pattern_br_b:new _.Uniform2f(h,d.u_pattern_br_b),u_texsize:new _.Uniform2f(h,d.u_texsize),u_mix:new _.Uniform1f(h,d.u_mix),u_pattern_size_a:new _.Uniform2f(h,d.u_pattern_size_a),u_pattern_size_b:new _.Uniform2f(h,d.u_pattern_size_b),u_scale_a:new _.Uniform1f(h,d.u_scale_a),u_scale_b:new _.Uniform1f(h,d.u_scale_b),u_pixel_coord_upper:new _.Uniform2f(h,d.u_pixel_coord_upper),u_pixel_coord_lower:new _.Uniform2f(h,d.u_pixel_coord_lower),u_tile_units_to_pixels:new _.Uniform1f(h,d.u_tile_units_to_pixels)}}};function nl(h,d,p,g,S,w,C){for(var P=h.context,Z=P.gl,Y=h.useProgram("collisionBox"),pe=[],_e=0,ye=0,Ue=0;Ue0){var Jt=_.create(),zt=$e;_.mul(Jt,Ie.placementInvProjMatrix,h.transform.glCoordMatrix),_.mul(Jt,Jt,Ie.placementViewportMatrix),pe.push({circleArray:Rt,circleOffset:ye,transform:zt,invTransform:Jt}),ye=_e+=Rt.length/4}vt&&Y.draw(P,Z.LINES,be.disabled,Oe.disabled,h.colorModeForRenderPass(),pt.disabled,Qs($e,h.transform,Ke),p.id,vt.layoutVertexBuffer,vt.indexBuffer,vt.segments,null,h.transform.zoom,null,null,vt.collisionVertexBuffer)}}if(C&&pe.length){var ar=h.useProgram("collisionCircle"),_r=new _.StructArrayLayout2f1f2i16;_r.resize(4*_e),_r._trim();for(var Nr=0,kr=0,un=pe;kr=0&&(ke[Ie.associatedIconIndex]={shiftedAnchor:_r,angle:Nr})}else Oa(Ie.numGlyphs,ye)}if(pe){Ue.clear();for(var un=h.icon.placedSymbolArray,Pn=0;Pn0){var C=_.browser.now(),P=(C-h.timeAdded)/w,Z=d?(C-d.timeAdded)/w:-1,Y=p.getSource(),pe=S.coveringZoomLevel({tileSize:Y.tileSize,roundZoom:Y.roundZoom}),_e=!d||Math.abs(d.tileID.overscaledZ-pe)>Math.abs(h.tileID.overscaledZ-pe),ye=_e&&h.refreshedUponExpiration?1:_.clamp(_e?P:1-Z,0,1);return h.refreshedUponExpiration&&P>=1&&(h.refreshedUponExpiration=!1),d?{opacity:1,mix:1-ye}:{opacity:ye,mix:0}}return{opacity:1,mix:0}}var xh=new _.Color(1,0,0,1),Df=new _.Color(0,1,0,1),Fo=new _.Color(0,0,1,1),bh=new _.Color(1,0,1,1),ap=new _.Color(0,1,1,1);function Ff(h,d,p,g){Oc(h,0,d+p/2,h.transform.width,p,g)}function Eh(h,d,p,g){Oc(h,d-p/2,0,p,h.transform.height,g)}function Oc(h,d,p,g,S,w){var C=h.context,P=C.gl;P.enable(P.SCISSOR_TEST),P.scissor(d*_.browser.devicePixelRatio,p*_.browser.devicePixelRatio,g*_.browser.devicePixelRatio,S*_.browser.devicePixelRatio),C.clear({color:w}),P.disable(P.SCISSOR_TEST)}function of(h,d,p){var g=h.context,S=g.gl,w=p.posMatrix,C=h.useProgram("debug"),P=be.disabled,Z=Oe.disabled,Y=h.colorModeForRenderPass();g.activeTexture.set(S.TEXTURE0),h.emptyTexture.bind(S.LINEAR,S.CLAMP_TO_EDGE),C.draw(g,S.LINE_STRIP,P,Z,Y,pt.disabled,Kl(w,_.Color.red),"$debug",h.debugBuffer,h.tileBorderIndexBuffer,h.debugSegments);var pe=d.getTileByID(p.key).latestRawTileData,_e=Math.floor((pe&&pe.byteLength||0)/1024),ye=d.getTile(p).tileSize,Ue=512/Math.min(ye,512)*(p.overscaledZ/h.transform.zoom)*.5,ke=p.canonical.toString();p.overscaledZ!==p.canonical.z&&(ke+=" => "+p.overscaledZ),function(Ke,Ie){Ke.initDebugOverlayCanvas();var $e=Ke.debugOverlayCanvas,vt=Ke.context.gl,Rt=Ke.debugOverlayCanvas.getContext("2d");Rt.clearRect(0,0,$e.width,$e.height),Rt.shadowColor="white",Rt.shadowBlur=2,Rt.lineWidth=1.5,Rt.strokeStyle="white",Rt.textBaseline="top",Rt.font="bold 36px Open Sans, sans-serif",Rt.fillText(Ie,5,5),Rt.strokeText(Ie,5,5),Ke.debugOverlayTexture.update($e),Ke.debugOverlayTexture.bind(vt.LINEAR,vt.CLAMP_TO_EDGE)}(h,ke+" "+_e+"kb"),C.draw(g,S.TRIANGLES,P,Z,it.alphaBlended,pt.disabled,Kl(w,_.Color.transparent,Ue),"$debug",h.debugBuffer,h.quadTriangleIndexBuffer,h.debugSegments)}var il={symbol:function(h,d,p,g,S){if(h.renderPass==="translucent"){var w=Oe.disabled,C=h.colorModeForRenderPass();p.layout.get("text-variable-anchor")&&function(P,Z,Y,pe,_e,ye,Ue){for(var ke=Z.transform,Ke=_e==="map",Ie=ye==="map",$e=0,vt=P;$e256&&this.clearStencil(),p.setColorMode(it.disabled),p.setDepthMode(be.disabled);var S=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var w=0,C=d;w256&&this.clearStencil();var h=this.nextStencilID++,d=this.context.gl;return new Oe({func:d.NOTEQUAL,mask:255},h,255,d.KEEP,d.KEEP,d.REPLACE)},pa.prototype.stencilModeForClipping=function(h){var d=this.context.gl;return new Oe({func:d.EQUAL,mask:255},this._tileClippingMaskIDs[h.key],0,d.KEEP,d.KEEP,d.REPLACE)},pa.prototype.stencilConfigForOverlap=function(h){var d,p=this.context.gl,g=h.sort(function(Z,Y){return Y.overscaledZ-Z.overscaledZ}),S=g[g.length-1].overscaledZ,w=g[0].overscaledZ-S+1;if(w>1){this.currentStencilSource=void 0,this.nextStencilID+w>256&&this.clearStencil();for(var C={},P=0;P=0;this.currentLayer--){var Rt=this.style._layers[g[this.currentLayer]],Jt=S[Rt.source],zt=Y[Rt.source];this._renderTileClippingMasks(Rt,zt),this.renderLayer(this,Jt,Rt,zt)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?d.pop():null},pa.prototype.isPatternMissing=function(h){if(!h)return!1;if(!h.from||!h.to)return!0;var d=this.imageManager.getPattern(h.from.toString()),p=this.imageManager.getPattern(h.to.toString());return!d||!p},pa.prototype.useProgram=function(h,d){this.cache=this.cache||{};var p=""+h+(d?d.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[p]||(this.cache[p]=new Ha(this.context,h,fu[h],d,ip[h],this._showOverdrawInspector)),this.cache[p]},pa.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()},pa.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)},pa.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=_.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new _.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},pa.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var kf=function(h,d){this.points=h,this.planes=d};kf.fromInvProjectionMatrix=function(h,d,p){var g=Math.pow(2,p),S=[[-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(C){return _.transformMat4([],C,h)}).map(function(C){return _.scale$1([],C,1/C[3]/d*g)}),w=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(C){var P=_.sub([],S[C[0]],S[C[1]]),Z=_.sub([],S[C[2]],S[C[1]]),Y=_.normalize([],_.cross([],P,Z)),pe=-_.dot(Y,S[C[1]]);return Y.concat(pe)});return new kf(S,w)};var du=function(h,d){this.min=h,this.max=d,this.center=_.scale$2([],_.add([],this.min,this.max),.5)};du.prototype.quadrant=function(h){for(var d=[h%2==0,h<2],p=_.clone$2(this.min),g=_.clone$2(this.max),S=0;S=0;if(w===0)return 0;w!==d.length&&(p=!1)}if(p)return 2;for(var P=0;P<3;P++){for(var Z=Number.MAX_VALUE,Y=-Number.MAX_VALUE,pe=0;pethis.max[P]-this.min[P])return 0}return 1};var Rl=function(h,d,p,g){if(h===void 0&&(h=0),d===void 0&&(d=0),p===void 0&&(p=0),g===void 0&&(g=0),isNaN(h)||h<0||isNaN(d)||d<0||isNaN(p)||p<0||isNaN(g)||g<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=h,this.bottom=d,this.left=p,this.right=g};Rl.prototype.interpolate=function(h,d,p){return d.top!=null&&h.top!=null&&(this.top=_.number(h.top,d.top,p)),d.bottom!=null&&h.bottom!=null&&(this.bottom=_.number(h.bottom,d.bottom,p)),d.left!=null&&h.left!=null&&(this.left=_.number(h.left,d.left,p)),d.right!=null&&h.right!=null&&(this.right=_.number(h.right,d.right,p)),this},Rl.prototype.getCenter=function(h,d){var p=_.clamp((this.left+h-this.right)/2,0,h),g=_.clamp((this.top+d-this.bottom)/2,0,d);return new _.Point(p,g)},Rl.prototype.equals=function(h){return this.top===h.top&&this.bottom===h.bottom&&this.left===h.left&&this.right===h.right},Rl.prototype.clone=function(){return new Rl(this.top,this.bottom,this.left,this.right)},Rl.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Li=function(h,d,p,g,S){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=S===void 0||S,this._minZoom=h||0,this._maxZoom=d||22,this._minPitch=p==null?0:p,this._maxPitch=g==null?60:g,this.setMaxBounds(),this.width=0,this.height=0,this._center=new _.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Rl,this._posMatrixCache={},this._alignedPosMatrixCache={}},Ca={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}};Li.prototype.clone=function(){var h=new Li(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},Ca.minZoom.get=function(){return this._minZoom},Ca.minZoom.set=function(h){this._minZoom!==h&&(this._minZoom=h,this.zoom=Math.max(this.zoom,h))},Ca.maxZoom.get=function(){return this._maxZoom},Ca.maxZoom.set=function(h){this._maxZoom!==h&&(this._maxZoom=h,this.zoom=Math.min(this.zoom,h))},Ca.minPitch.get=function(){return this._minPitch},Ca.minPitch.set=function(h){this._minPitch!==h&&(this._minPitch=h,this.pitch=Math.max(this.pitch,h))},Ca.maxPitch.get=function(){return this._maxPitch},Ca.maxPitch.set=function(h){this._maxPitch!==h&&(this._maxPitch=h,this.pitch=Math.min(this.pitch,h))},Ca.renderWorldCopies.get=function(){return this._renderWorldCopies},Ca.renderWorldCopies.set=function(h){h===void 0?h=!0:h===null&&(h=!1),this._renderWorldCopies=h},Ca.worldSize.get=function(){return this.tileSize*this.scale},Ca.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Ca.size.get=function(){return new _.Point(this.width,this.height)},Ca.bearing.get=function(){return-this.angle/Math.PI*180},Ca.bearing.set=function(h){var d=-_.wrap(h,-180,180)*Math.PI/180;this.angle!==d&&(this._unmodified=!1,this.angle=d,this._calcMatrices(),this.rotationMatrix=_.create$2(),_.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Ca.pitch.get=function(){return this._pitch/Math.PI*180},Ca.pitch.set=function(h){var d=_.clamp(h,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==d&&(this._unmodified=!1,this._pitch=d,this._calcMatrices())},Ca.fov.get=function(){return this._fov/Math.PI*180},Ca.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())},Ca.zoom.get=function(){return this._zoom},Ca.zoom.set=function(h){var d=Math.min(Math.max(h,this.minZoom),this.maxZoom);this._zoom!==d&&(this._unmodified=!1,this._zoom=d,this.scale=this.zoomScale(d),this.tileZoom=Math.floor(d),this.zoomFraction=d-this.tileZoom,this._constrain(),this._calcMatrices())},Ca.center.get=function(){return this._center},Ca.center.set=function(h){h.lat===this._center.lat&&h.lng===this._center.lng||(this._unmodified=!1,this._center=h,this._constrain(),this._calcMatrices())},Ca.padding.get=function(){return this._edgeInsets.toJSON()},Ca.padding.set=function(h){this._edgeInsets.equals(h)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,h,1),this._calcMatrices())},Ca.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Li.prototype.isPaddingEqual=function(h){return this._edgeInsets.equals(h)},Li.prototype.interpolatePadding=function(h,d,p){this._unmodified=!1,this._edgeInsets.interpolate(h,d,p),this._constrain(),this._calcMatrices()},Li.prototype.coveringZoomLevel=function(h){var d=(h.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/h.tileSize));return Math.max(0,d)},Li.prototype.getVisibleUnwrappedCoordinates=function(h){var d=[new _.UnwrappedTileID(0,h)];if(this._renderWorldCopies)for(var p=this.pointCoordinate(new _.Point(0,0)),g=this.pointCoordinate(new _.Point(this.width,0)),S=this.pointCoordinate(new _.Point(this.width,this.height)),w=this.pointCoordinate(new _.Point(0,this.height)),C=Math.floor(Math.min(p.x,g.x,S.x,w.x)),P=Math.floor(Math.max(p.x,g.x,S.x,w.x)),Z=C-1;Z<=P+1;Z++)Z!==0&&d.push(new _.UnwrappedTileID(Z,h));return d},Li.prototype.coveringTiles=function(h){var d=this.coveringZoomLevel(h),p=d;if(h.minzoom!==void 0&&dh.maxzoom&&(d=h.maxzoom);var g=_.MercatorCoordinate.fromLngLat(this.center),S=Math.pow(2,d),w=[S*g.x,S*g.y,0],C=kf.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,d),P=h.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(P=d);var Z=function(kr){return{aabb:new du([kr*S,0,0],[(kr+1)*S,S,0]),zoom:0,x:0,y:0,wrap:kr,fullyVisible:!1}},Y=[],pe=[],_e=d,ye=h.reparseOverscaled?p:d;if(this._renderWorldCopies)for(var Ue=1;Ue<=3;Ue++)Y.push(Z(-Ue)),Y.push(Z(Ue));for(Y.push(Z(0));Y.length>0;){var ke=Y.pop(),Ke=ke.x,Ie=ke.y,$e=ke.fullyVisible;if(!$e){var vt=ke.aabb.intersects(C);if(vt===0)continue;$e=vt===2}var Rt=ke.aabb.distanceX(w),Jt=ke.aabb.distanceY(w),zt=Math.max(Math.abs(Rt),Math.abs(Jt));if(ke.zoom===_e||zt>3+(1<<_e-ke.zoom)-2&&ke.zoom>=P)pe.push({tileID:new _.OverscaledTileID(ke.zoom===_e?ye:ke.zoom,ke.wrap,ke.zoom,Ke,Ie),distanceSq:_.sqrLen([w[0]-.5-Ke,w[1]-.5-Ie])});else for(var ar=0;ar<4;ar++){var _r=(Ke<<1)+ar%2,Nr=(Ie<<1)+(ar>>1);Y.push({aabb:ke.aabb.quadrant(ar),zoom:ke.zoom+1,x:_r,y:Nr,wrap:ke.wrap,fullyVisible:$e})}}return pe.sort(function(kr,un){return kr.distanceSq-un.distanceSq}).map(function(kr){return kr.tileID})},Li.prototype.resize=function(h,d){this.width=h,this.height=d,this.pixelsToGLUnits=[2/h,-2/d],this._constrain(),this._calcMatrices()},Ca.unmodified.get=function(){return this._unmodified},Li.prototype.zoomScale=function(h){return Math.pow(2,h)},Li.prototype.scaleZoom=function(h){return Math.log(h)/Math.LN2},Li.prototype.project=function(h){var d=_.clamp(h.lat,-this.maxValidLatitude,this.maxValidLatitude);return new _.Point(_.mercatorXfromLng(h.lng)*this.worldSize,_.mercatorYfromLat(d)*this.worldSize)},Li.prototype.unproject=function(h){return new _.MercatorCoordinate(h.x/this.worldSize,h.y/this.worldSize).toLngLat()},Ca.point.get=function(){return this.project(this.center)},Li.prototype.setLocationAtPoint=function(h,d){var p=this.pointCoordinate(d),g=this.pointCoordinate(this.centerPoint),S=this.locationCoordinate(h),w=new _.MercatorCoordinate(S.x-(p.x-g.x),S.y-(p.y-g.y));this.center=this.coordinateLocation(w),this._renderWorldCopies&&(this.center=this.center.wrap())},Li.prototype.locationPoint=function(h){return this.coordinatePoint(this.locationCoordinate(h))},Li.prototype.pointLocation=function(h){return this.coordinateLocation(this.pointCoordinate(h))},Li.prototype.locationCoordinate=function(h){return _.MercatorCoordinate.fromLngLat(h)},Li.prototype.coordinateLocation=function(h){return h.toLngLat()},Li.prototype.pointCoordinate=function(h){var d=[h.x,h.y,0,1],p=[h.x,h.y,1,1];_.transformMat4(d,d,this.pixelMatrixInverse),_.transformMat4(p,p,this.pixelMatrixInverse);var g=d[3],S=p[3],w=d[1]/g,C=p[1]/S,P=d[2]/g,Z=p[2]/S,Y=P===Z?0:(0-P)/(Z-P);return new _.MercatorCoordinate(_.number(d[0]/g,p[0]/S,Y)/this.worldSize,_.number(w,C,Y)/this.worldSize)},Li.prototype.coordinatePoint=function(h){var d=[h.x*this.worldSize,h.y*this.worldSize,0,1];return _.transformMat4(d,d,this.pixelMatrix),new _.Point(d[0]/d[3],d[1]/d[3])},Li.prototype.getBounds=function(){return new _.LngLatBounds().extend(this.pointLocation(new _.Point(0,0))).extend(this.pointLocation(new _.Point(this.width,0))).extend(this.pointLocation(new _.Point(this.width,this.height))).extend(this.pointLocation(new _.Point(0,this.height)))},Li.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new _.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Li.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])},Li.prototype.calculatePosMatrix=function(h,d){d===void 0&&(d=!1);var p=h.key,g=d?this._alignedPosMatrixCache:this._posMatrixCache;if(g[p])return g[p];var S=h.canonical,w=this.worldSize/this.zoomScale(S.z),C=S.x+Math.pow(2,S.z)*h.wrap,P=_.identity(new Float64Array(16));return _.translate(P,P,[C*w,S.y*w,0]),_.scale(P,P,[w/_.EXTENT,w/_.EXTENT,1]),_.multiply(P,d?this.alignedProjMatrix:this.projMatrix,P),g[p]=new Float32Array(P),g[p]},Li.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Li.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var h,d,p,g,S=-90,w=90,C=-180,P=180,Z=this.size,Y=this._unmodified;if(this.latRange){var pe=this.latRange;S=_.mercatorYfromLat(pe[1])*this.worldSize,h=(w=_.mercatorYfromLat(pe[0])*this.worldSize)-Sw&&(g=w-Ke)}if(this.lngRange){var Ie=ye.x,$e=Z.x/2;Ie-$eP&&(p=P-$e)}p===void 0&&g===void 0||(this.center=this.unproject(new _.Point(p!==void 0?p:ye.x,g!==void 0?g:ye.y))),this._unmodified=Y,this._constraining=!1}},Li.prototype._calcMatrices=function(){if(this.height){var h=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var d=Math.PI/2+this._pitch,p=this._fov*(.5+h.y/this.height),g=Math.sin(p)*this.cameraToCenterDistance/Math.sin(_.clamp(Math.PI-d-p,.01,Math.PI-.01)),S=this.point,w=S.x,C=S.y,P=1.01*(Math.cos(Math.PI/2-this._pitch)*g+this.cameraToCenterDistance),Z=this.height/50,Y=new Float64Array(16);_.perspective(Y,this._fov,this.width/this.height,Z,P),Y[8]=2*-h.x/this.width,Y[9]=2*h.y/this.height,_.scale(Y,Y,[1,-1,1]),_.translate(Y,Y,[0,0,-this.cameraToCenterDistance]),_.rotateX(Y,Y,this._pitch),_.rotateZ(Y,Y,this.angle),_.translate(Y,Y,[-w,-C,0]),this.mercatorMatrix=_.scale([],Y,[this.worldSize,this.worldSize,this.worldSize]),_.scale(Y,Y,[1,1,_.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=Y,this.invProjMatrix=_.invert([],this.projMatrix);var pe=this.width%2/2,_e=this.height%2/2,ye=Math.cos(this.angle),Ue=Math.sin(this.angle),ke=w-Math.round(w)+ye*pe+Ue*_e,Ke=C-Math.round(C)+ye*_e+Ue*pe,Ie=new Float64Array(Y);if(_.translate(Ie,Ie,[ke>.5?ke-1:ke,Ke>.5?Ke-1:Ke,0]),this.alignedProjMatrix=Ie,Y=_.create(),_.scale(Y,Y,[this.width/2,-this.height/2,1]),_.translate(Y,Y,[1,-1,0]),this.labelPlaneMatrix=Y,Y=_.create(),_.scale(Y,Y,[1,-1,1]),_.translate(Y,Y,[-1,-1,0]),_.scale(Y,Y,[2/this.width,2/this.height,1]),this.glCoordMatrix=Y,this.pixelMatrix=_.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(Y=_.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=Y,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Li.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var h=this.pointCoordinate(new _.Point(0,0)),d=[h.x*this.worldSize,h.y*this.worldSize,0,1];return _.transformMat4(d,d,this.pixelMatrix)[3]/this.cameraToCenterDistance},Li.prototype.getCameraPoint=function(){var h=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new _.Point(0,h))},Li.prototype.getCameraQueryGeometry=function(h){var d=this.getCameraPoint();if(h.length===1)return[h[0],d];for(var p=d.x,g=d.y,S=d.x,w=d.y,C=0,P=h;C=3&&!h.some(function(p){return isNaN(p)})){var d=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:d,pitch:+(h[4]||0)}),!0}return!1},Ys.prototype._updateHashUnthrottled=function(){var h=_.window.location.href.replace(/(#.+)?$/,this.getHashString());try{_.window.history.replaceState(_.window.history.state,null,h)}catch(d){}};var Bf={linearity:.3,easing:_.bezier(0,0,.3,1)},Fs=_.extend({deceleration:2500,maxSpeed:1400},Bf),sf=_.extend({deceleration:20,maxSpeed:1400},Bf),op=_.extend({deceleration:1e3,maxSpeed:360},Bf),Sh=_.extend({deceleration:1e3,maxSpeed:90},Bf),Lf=function(h){this._map=h,this.clear()};function Ml(h,d){(!h.duration||h.duration0&&d-h[0].time>160;)h.shift()},Lf.prototype._onMoveEnd=function(h){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var d={zoom:0,bearing:0,pitch:0,pan:new _.Point(0,0),pinchAround:void 0,around:void 0},p=0,g=this._inertiaBuffer;p=this._clickTolerance||this._map.fire(new Wa(h.type,this._map,h))},Ka.prototype.dblclick=function(h){return this._firePreventable(new Wa(h.type,this._map,h))},Ka.prototype.mouseover=function(h){this._map.fire(new Wa(h.type,this._map,h))},Ka.prototype.mouseout=function(h){this._map.fire(new Wa(h.type,this._map,h))},Ka.prototype.touchstart=function(h){return this._firePreventable(new al(h.type,this._map,h))},Ka.prototype.touchmove=function(h){this._map.fire(new al(h.type,this._map,h))},Ka.prototype.touchend=function(h){this._map.fire(new al(h.type,this._map,h))},Ka.prototype.touchcancel=function(h){this._map.fire(new al(h.type,this._map,h))},Ka.prototype._firePreventable=function(h){if(this._map.fire(h),h.defaultPrevented)return{}},Ka.prototype.isEnabled=function(){return!0},Ka.prototype.isActive=function(){return!1},Ka.prototype.enable=function(){},Ka.prototype.disable=function(){};var _n=function(h){this._map=h};_n.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},_n.prototype.mousemove=function(h){this._map.fire(new Wa(h.type,this._map,h))},_n.prototype.mousedown=function(){this._delayContextMenu=!0},_n.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Wa("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},_n.prototype.contextmenu=function(h){this._delayContextMenu?this._contextMenuEvent=h:this._map.fire(new Wa(h.type,this._map,h)),this._map.listens("contextmenu")&&h.preventDefault()},_n.prototype.isEnabled=function(){return!0},_n.prototype.isActive=function(){return!1},_n.prototype.enable=function(){},_n.prototype.disable=function(){};var ks=function(h,d){this._map=h,this._el=h.getCanvasContainer(),this._container=h.getContainer(),this._clickTolerance=d.clickTolerance||1};function uf(h,d){for(var p={},g=0;gthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=h.timeStamp),p.length===this.numTouches&&(this.centroid=function(g){for(var S=new _.Point(0,0),w=0,C=g;w30)&&(this.aborted=!0)}}},rc.prototype.touchend=function(h,d,p){if((!this.centroid||h.timeStamp-this.startTime>500)&&(this.aborted=!0),p.length===0){var g=!this.aborted&&this.centroid;if(this.reset(),g)return g}};var us=function(h){this.singleTap=new rc(h),this.numTaps=h.numTaps,this.reset()};us.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},us.prototype.touchstart=function(h,d,p){this.singleTap.touchstart(h,d,p)},us.prototype.touchmove=function(h,d,p){this.singleTap.touchmove(h,d,p)},us.prototype.touchend=function(h,d,p){var g=this.singleTap.touchend(h,d,p);if(g){var S=h.timeStamp-this.lastTime<500,w=!this.lastTap||this.lastTap.dist(g)<30;if(S&&w||this.reset(),this.count++,this.lastTime=h.timeStamp,this.lastTap=g,this.count===this.numTaps)return this.reset(),g}};var ga=function(){this._zoomIn=new us({numTouches:1,numTaps:2}),this._zoomOut=new us({numTouches:2,numTaps:1}),this.reset()};ga.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},ga.prototype.touchstart=function(h,d,p){this._zoomIn.touchstart(h,d,p),this._zoomOut.touchstart(h,d,p)},ga.prototype.touchmove=function(h,d,p){this._zoomIn.touchmove(h,d,p),this._zoomOut.touchmove(h,d,p)},ga.prototype.touchend=function(h,d,p){var g=this,S=this._zoomIn.touchend(h,d,p),w=this._zoomOut.touchend(h,d,p);return S?(this._active=!0,h.preventDefault(),setTimeout(function(){return g.reset()},0),{cameraAnimation:function(C){return C.easeTo({duration:300,zoom:C.getZoom()+1,around:C.unproject(S)},{originalEvent:h})}}):w?(this._active=!0,h.preventDefault(),setTimeout(function(){return g.reset()},0),{cameraAnimation:function(C){return C.easeTo({duration:300,zoom:C.getZoom()-1,around:C.unproject(w)},{originalEvent:h})}}):void 0},ga.prototype.touchcancel=function(){this.reset()},ga.prototype.enable=function(){this._enabled=!0},ga.prototype.disable=function(){this._enabled=!1,this.reset()},ga.prototype.isEnabled=function(){return this._enabled},ga.prototype.isActive=function(){return this._active};var Th={0:1,2:2},qr=function(h){this.reset(),this._clickTolerance=h.clickTolerance||1};qr.prototype.blur=function(){this.reset()},qr.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},qr.prototype._correctButton=function(h,d){return!1},qr.prototype._move=function(h,d){return{}},qr.prototype.mousedown=function(h,d){if(!this._lastPoint){var p=U.mouseButton(h);this._correctButton(h,p)&&(this._lastPoint=d,this._eventButton=p)}},qr.prototype.mousemoveWindow=function(h,d){var p=this._lastPoint;if(p){if(h.preventDefault(),function(g,S){var w=Th[S];return g.buttons===void 0||(g.buttons&w)!==w}(h,this._eventButton))this.reset();else if(this._moved||!(d.dist(p)0&&(this._active=!0);var g=uf(p,d),S=new _.Point(0,0),w=new _.Point(0,0),C=0;for(var P in g){var Z=g[P],Y=this._touches[P];Y&&(S._add(Z),w._add(Z.sub(Y)),C++,g[P]=Z)}if(this._touches=g,!(CMath.abs(h.x)}var lf=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.reset=function(){h.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},d.prototype._start=function(p){this._lastPoints=p,Il(p[0].sub(p[1]))&&(this._valid=!1)},d.prototype._move=function(p,g,S){var w=p[0].sub(this._lastPoints[0]),C=p[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(w,C,S.timeStamp),this._valid)return this._lastPoints=p,this._active=!0,{pitchDelta:(w.y+C.y)/2*-.5}},d.prototype.gestureBeginsVertically=function(p,g,S){if(this._valid!==void 0)return this._valid;var w=p.mag()>=2,C=g.mag()>=2;if(w||C){if(!w||!C)return this._firstMove===void 0&&(this._firstMove=S),S-this._firstMove<100&&void 0;var P=p.y>0==g.y>0;return Il(p)&&Il(g)&&P}},d}(Bs),up={panStep:100,bearingStep:15,pitchStep:10},Pt=function(){var h=up;this._panStep=h.panStep,this._bearingStep=h.bearingStep,this._pitchStep=h.pitchStep,this._rotationDisabled=!1};function Fe(h){return h*(2-h)}Pt.prototype.blur=function(){this.reset()},Pt.prototype.reset=function(){this._active=!1},Pt.prototype.keydown=function(h){var d=this;if(!(h.altKey||h.ctrlKey||h.metaKey)){var p=0,g=0,S=0,w=0,C=0;switch(h.keyCode){case 61:case 107:case 171:case 187:p=1;break;case 189:case 109:case 173:p=-1;break;case 37:h.shiftKey?g=-1:(h.preventDefault(),w=-1);break;case 39:h.shiftKey?g=1:(h.preventDefault(),w=1);break;case 38:h.shiftKey?S=1:(h.preventDefault(),C=-1);break;case 40:h.shiftKey?S=-1:(h.preventDefault(),C=1);break;default:return}return this._rotationDisabled&&(g=0,S=0),{cameraAnimation:function(P){var Z=P.getZoom();P.easeTo({duration:300,easeId:"keyboardHandler",easing:Fe,zoom:p?Math.round(Z)+p*(h.shiftKey?2:1):Z,bearing:P.getBearing()+g*d._bearingStep,pitch:P.getPitch()+S*d._pitchStep,offset:[-w*d._panStep,-C*d._panStep],center:P.getCenter()},{originalEvent:h})}}}},Pt.prototype.enable=function(){this._enabled=!0},Pt.prototype.disable=function(){this._enabled=!1,this.reset()},Pt.prototype.isEnabled=function(){return this._enabled},Pt.prototype.isActive=function(){return this._active},Pt.prototype.disableRotation=function(){this._rotationDisabled=!0},Pt.prototype.enableRotation=function(){this._rotationDisabled=!1};var B=function(h,d){this._map=h,this._el=h.getCanvasContainer(),this._handler=d,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,_.bindAll(["_onTimeout"],this)};B.prototype.setZoomRate=function(h){this._defaultZoomRate=h},B.prototype.setWheelZoomRate=function(h){this._wheelZoomRate=h},B.prototype.isEnabled=function(){return!!this._enabled},B.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},B.prototype.isZooming=function(){return!!this._zooming},B.prototype.enable=function(h){this.isEnabled()||(this._enabled=!0,this._aroundCenter=h&&h.around==="center")},B.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},B.prototype.wheel=function(h){if(this.isEnabled()){var d=h.deltaMode===_.window.WheelEvent.DOM_DELTA_LINE?40*h.deltaY:h.deltaY,p=_.browser.now(),g=p-(this._lastWheelEventTime||0);this._lastWheelEventTime=p,d!==0&&d%4.000244140625==0?this._type="wheel":d!==0&&Math.abs(d)<4?this._type="trackpad":g>400?(this._type=null,this._lastValue=d,this._timeout=setTimeout(this._onTimeout,40,h)):this._type||(this._type=Math.abs(g*d)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,d+=this._lastValue)),h.shiftKey&&d&&(d/=4),this._type&&(this._lastWheelEvent=h,this._delta-=d,this._active||this._start(h)),h.preventDefault()}},B.prototype._onTimeout=function(h){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(h)},B.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 d=U.mousePos(this._el,h);this._around=_.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(d)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},B.prototype.renderFrame=function(){var h=this;if(this._frameId&&(this._frameId=null,this.isActive())){var d=this._map.transform;if(this._delta!==0){var p=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,g=2/(1+Math.exp(-Math.abs(this._delta*p)));this._delta<0&&g!==0&&(g=1/g);var S=typeof this._targetZoom=="number"?d.zoomScale(this._targetZoom):d.scale;this._targetZoom=Math.min(d.maxZoom,Math.max(d.minZoom,d.scaleZoom(S*g))),this._type==="wheel"&&(this._startZoom=d.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var w,C=typeof this._targetZoom=="number"?this._targetZoom:d.zoom,P=this._startZoom,Z=this._easing,Y=!1;if(this._type==="wheel"&&P&&Z){var pe=Math.min((_.browser.now()-this._lastWheelEventTime)/200,1),_e=Z(pe);w=_.number(P,C,_e),pe<1?this._frameId||(this._frameId=!0):Y=!0}else w=C,Y=!0;return this._active=!0,Y&&(this._active=!1,this._finishTimeout=setTimeout(function(){h._zooming=!1,h._handler._triggerRenderFrame(),delete h._targetZoom,delete h._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!Y,zoomDelta:w-d.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},B.prototype._smoothOutEasing=function(h){var d=_.ease;if(this._prevEase){var p=this._prevEase,g=(_.browser.now()-p.start)/p.duration,S=p.easing(g+.01)-p.easing(g),w=.27/Math.sqrt(S*S+1e-4)*.01,C=Math.sqrt(.0729-w*w);d=_.bezier(w,C,.25,1)}return this._prevEase={start:_.browser.now(),duration:h,easing:d},d},B.prototype.blur=function(){this.reset()},B.prototype.reset=function(){this._active=!1};var qs=function(h,d){this._clickZoom=h,this._tapZoom=d};qs.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},qs.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},qs.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},qs.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ge=function(){this.reset()};ge.prototype.reset=function(){this._active=!1},ge.prototype.blur=function(){this.reset()},ge.prototype.dblclick=function(h,d){return h.preventDefault(),{cameraAnimation:function(p){p.easeTo({duration:300,zoom:p.getZoom()+(h.shiftKey?-1:1),around:p.unproject(d)},{originalEvent:h})}}},ge.prototype.enable=function(){this._enabled=!0},ge.prototype.disable=function(){this._enabled=!1,this.reset()},ge.prototype.isEnabled=function(){return this._enabled},ge.prototype.isActive=function(){return this._active};var Bo=function(){this._tap=new us({numTouches:1,numTaps:1}),this.reset()};Bo.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Bo.prototype.touchstart=function(h,d,p){this._swipePoint||(this._tapTime&&h.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?p.length>0&&(this._swipePoint=d[0],this._swipeTouch=p[0].identifier):this._tap.touchstart(h,d,p))},Bo.prototype.touchmove=function(h,d,p){if(this._tapTime){if(this._swipePoint){if(p[0].identifier!==this._swipeTouch)return;var g=d[0],S=g.y-this._swipePoint.y;return this._swipePoint=g,h.preventDefault(),this._active=!0,{zoomDelta:S/128}}}else this._tap.touchmove(h,d,p)},Bo.prototype.touchend=function(h,d,p){this._tapTime?this._swipePoint&&p.length===0&&this.reset():this._tap.touchend(h,d,p)&&(this._tapTime=h.timeStamp)},Bo.prototype.touchcancel=function(){this.reset()},Bo.prototype.enable=function(){this._enabled=!0},Bo.prototype.disable=function(){this._enabled=!1,this.reset()},Bo.prototype.isEnabled=function(){return this._enabled},Bo.prototype.isActive=function(){return this._active};var io=function(h,d,p){this._el=h,this._mousePan=d,this._touchPan=p};io.prototype.enable=function(h){this._inertiaOptions=h||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},io.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},io.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},io.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var vu=function(h,d,p){this._pitchWithRotate=h.pitchWithRotate,this._mouseRotate=d,this._mousePitch=p};vu.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},vu.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},vu.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},vu.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var bs=function(h,d,p,g){this._el=h,this._touchZoom=d,this._touchRotate=p,this._tapDragZoom=g,this._rotationDisabled=!1,this._enabled=!0};bs.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")},bs.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},bs.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},bs.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},bs.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},bs.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Da=function(h){return h.zoom||h.drag||h.pitch||h.rotate},nc=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d}(_.Event);function kn(h){return h.panDelta&&h.panDelta.mag()||h.zoomDelta||h.bearingDelta||h.pitchDelta}var yn=function(h,d){this._map=h,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Lf(h),this._bearingSnap=d.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(d),_.bindAll(["handleEvent","handleWindowEvent"],this);var p=this._el;this._listeners=[[p,"touchstart",{passive:!0}],[p,"touchmove",{passive:!1}],[p,"touchend",void 0],[p,"touchcancel",void 0],[p,"mousedown",void 0],[p,"mousemove",void 0],[p,"mouseup",void 0],[_.window.document,"mousemove",{capture:!0}],[_.window.document,"mouseup",void 0],[p,"mouseover",void 0],[p,"mouseout",void 0],[p,"dblclick",void 0],[p,"click",void 0],[p,"keydown",{capture:!1}],[p,"keyup",void 0],[p,"wheel",{passive:!1}],[p,"contextmenu",void 0],[_.window,"blur",void 0]];for(var g=0,S=this._listeners;gC?Math.min(2,ar):Math.max(.5,ar),Pn=Math.pow(un,1-Nr),zn=w.unproject(Jt.add(zt.mult(Nr*Pn)).mult(kr));w.setLocationAtPoint(w.renderWorldCopies?zn.wrap():zn,Ke)}S._fireMoveEvents(g)},function(Nr){S._afterEase(g,Nr)},p),this},d.prototype._prepareEase=function(p,g,S){S===void 0&&(S={}),this._moving=!0,g||S.moving||this.fire(new _.Event("movestart",p)),this._zooming&&!S.zooming&&this.fire(new _.Event("zoomstart",p)),this._rotating&&!S.rotating&&this.fire(new _.Event("rotatestart",p)),this._pitching&&!S.pitching&&this.fire(new _.Event("pitchstart",p))},d.prototype._fireMoveEvents=function(p){this.fire(new _.Event("move",p)),this._zooming&&this.fire(new _.Event("zoom",p)),this._rotating&&this.fire(new _.Event("rotate",p)),this._pitching&&this.fire(new _.Event("pitch",p))},d.prototype._afterEase=function(p,g){if(!this._easeId||!g||this._easeId!==g){delete this._easeId;var S=this._zooming,w=this._rotating,C=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,S&&this.fire(new _.Event("zoomend",p)),w&&this.fire(new _.Event("rotateend",p)),C&&this.fire(new _.Event("pitchend",p)),this.fire(new _.Event("moveend",p))}},d.prototype.flyTo=function(p,g){var S=this;if(!p.essential&&_.browser.prefersReducedMotion){var w=_.pick(p,["center","zoom","bearing","pitch","around"]);return this.jumpTo(w,g)}this.stop(),p=_.extend({offset:[0,0],speed:1.2,curve:1.42,easing:_.ease},p);var C=this.transform,P=this.getZoom(),Z=this.getBearing(),Y=this.getPitch(),pe=this.getPadding(),_e="zoom"in p?_.clamp(+p.zoom,C.minZoom,C.maxZoom):P,ye="bearing"in p?this._normalizeBearing(p.bearing,Z):Z,Ue="pitch"in p?+p.pitch:Y,ke="padding"in p?p.padding:C.padding,Ke=C.zoomScale(_e-P),Ie=_.Point.convert(p.offset),$e=C.centerPoint.add(Ie),vt=C.pointLocation($e),Rt=_.LngLat.convert(p.center||vt);this._normalizeCenter(Rt);var Jt=C.project(vt),zt=C.project(Rt).sub(Jt),ar=p.curve,_r=Math.max(C.width,C.height),Nr=_r/Ke,kr=zt.mag();if("minZoom"in p){var un=_.clamp(Math.min(p.minZoom,P,_e),C.minZoom,C.maxZoom),Pn=_r/C.zoomScale(un-P);ar=Math.sqrt(Pn/kr*2)}var zn=ar*ar;function Zn(Jn){var Kn=(Nr*Nr-_r*_r+(Jn?-1:1)*zn*zn*kr*kr)/(2*(Jn?Nr:_r)*zn*kr);return Math.log(Math.sqrt(Kn*Kn+1)-Kn)}function Wi(Jn){return(Math.exp(Jn)-Math.exp(-Jn))/2}function vn(Jn){return(Math.exp(Jn)+Math.exp(-Jn))/2}var ei=Zn(0),_i=function(Jn){return vn(ei)/vn(ei+ar*Jn)},ri=function(Jn){return _r*((vn(ei)*(Wi(Kn=ei+ar*Jn)/vn(Kn))-Wi(ei))/zn)/kr;var Kn},qn=(Zn(1)-ei)/ar;if(Math.abs(kr)<1e-6||!isFinite(qn)){if(Math.abs(_r-Nr)<1e-6)return this.easeTo(p,g);var di=Nr<_r?-1:1;qn=Math.abs(Math.log(Nr/_r))/ar,ri=function(){return 0},_i=function(Jn){return Math.exp(di*ar*Jn)}}return p.duration="duration"in p?+p.duration:1e3*qn/("screenSpeed"in p?+p.screenSpeed/ar:+p.speed),p.maxDuration&&p.duration>p.maxDuration&&(p.duration=0),this._zooming=!0,this._rotating=Z!==ye,this._pitching=Ue!==Y,this._padding=!C.isPaddingEqual(ke),this._prepareEase(g,!1),this._ease(function(Jn){var Kn=Jn*qn,Co=1/_i(Kn);C.zoom=Jn===1?_e:P+C.scaleZoom(Co),S._rotating&&(C.bearing=_.number(Z,ye,Jn)),S._pitching&&(C.pitch=_.number(Y,Ue,Jn)),S._padding&&(C.interpolatePadding(pe,ke,Jn),$e=C.centerPoint.add(Ie));var Ua=Jn===1?Rt:C.unproject(Jt.add(zt.mult(ri(Kn))).mult(Co));C.setLocationAtPoint(C.renderWorldCopies?Ua.wrap():Ua,$e),S._fireMoveEvents(g)},function(){return S._afterEase(g)},p),this},d.prototype.isEasing=function(){return!!this._easeFrameId},d.prototype.stop=function(){return this._stop()},d.prototype._stop=function(p,g){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var S=this._onEaseEnd;delete this._onEaseEnd,S.call(this,g)}if(!p){var w=this.handlers;w&&w.stop(!1)}return this},d.prototype._ease=function(p,g,S){S.animate===!1||S.duration===0?(p(1),g()):(this._easeStart=_.browser.now(),this._easeOptions=S,this._onEaseFrame=p,this._onEaseEnd=g,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},d.prototype._renderFrameCallback=function(){var p=Math.min((_.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(p)),p<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},d.prototype._normalizeBearing=function(p,g){p=_.wrap(p,-180,180);var S=Math.abs(p-g);return Math.abs(p-360-g)180?-360:S<-180?360:0}},d}(_.Evented),qo=function(h){h===void 0&&(h={}),this.options=h,_.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};qo.prototype.getDefaultPosition=function(){return"bottom-right"},qo.prototype.onAdd=function(h){var d=this.options&&this.options.compact;return this._map=h,this._container=U.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=U.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=U.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),d&&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),d===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},qo.prototype.onRemove=function(){U.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},qo.prototype._setElementTitle=function(h,d){var p=this._map._getUIString("AttributionControl."+d);h.title=p,h.setAttribute("aria-label",p)},qo.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"))},qo.prototype._updateEditLink=function(){var h=this._editLink;h||(h=this._editLink=this._container.querySelector(".mapbox-improve-map"));var d=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||_.config.ACCESS_TOKEN}];if(h){var p=d.reduce(function(g,S,w){return S.value&&(g+=S.key+"="+S.value+(w=0)return!1;return!0})).join(" | ");C!==this._attribHTML&&(this._attribHTML=C,h.length?(this._innerContainer.innerHTML=C,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},qo.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var mu=function(){_.bindAll(["_updateLogo"],this),_.bindAll(["_updateCompact"],this)};mu.prototype.onAdd=function(h){this._map=h,this._container=U.create("div","mapboxgl-ctrl");var d=U.create("a","mapboxgl-ctrl-logo");return d.target="_blank",d.rel="noopener nofollow",d.href="https://www.mapbox.com/",d.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),d.setAttribute("rel","noopener nofollow"),this._container.appendChild(d),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},mu.prototype.onRemove=function(){U.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},mu.prototype.getDefaultPosition=function(){return"bottom-left"},mu.prototype._updateLogo=function(h){h&&h.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},mu.prototype._logoRequired=function(){if(this._map.style){var h=this._map.style.sourceCaches;for(var d in h)if(h[d].getSource().mapbox_logo)return!0;return!1}},mu.prototype._updateCompact=function(){var h=this._container.children;if(h.length){var d=h[0];this._map.getCanvasContainer().offsetWidth<250?d.classList.add("mapboxgl-compact"):d.classList.remove("mapboxgl-compact")}};var Fa=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Fa.prototype.add=function(h){var d=++this._id;return this._queue.push({callback:h,id:d,cancelled:!1}),d},Fa.prototype.remove=function(h){for(var d=this._currentlyRunning,p=0,g=d?this._queue.concat(d):this._queue;pg.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(g.minPitch!=null&&g.maxPitch!=null&&g.minPitch>g.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(g.minPitch!=null&&g.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(g.maxPitch!=null&&g.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var w=new Li(g.minZoom,g.maxZoom,g.minPitch,g.maxPitch,g.renderWorldCopies);if(h.call(this,w,g),this._interactive=g.interactive,this._maxTileCacheSize=g.maxTileCacheSize,this._failIfMajorPerformanceCaveat=g.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=g.preserveDrawingBuffer,this._antialias=g.antialias,this._trackResize=g.trackResize,this._bearingSnap=g.bearingSnap,this._refreshExpiredTiles=g.refreshExpiredTiles,this._fadeDuration=g.fadeDuration,this._crossSourceCollisions=g.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=g.collectResourceTiming,this._renderTaskQueue=new Fa,this._controls=[],this._mapId=_.uniqueId(),this._locale=_.extend({},Ns,g.locale),this._clickTolerance=g.clickTolerance,this._requestManager=new _.RequestManager(g.transformRequest,g.accessToken),typeof g.container=="string"){if(this._container=_.window.document.getElementById(g.container),!this._container)throw new Error("Container '"+g.container+"' not found.")}else{if(!(g.container instanceof Fc))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=g.container}if(g.maxBounds&&this.setMaxBounds(g.maxBounds),_.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 S._update(!1)}),this.on("moveend",function(){return S._update(!1)}),this.on("zoom",function(){return S._update(!0)}),_.window!==void 0&&(_.window.addEventListener("online",this._onWindowOnline,!1),_.window.addEventListener("resize",this._onWindowResize,!1),_.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new yn(this,g),this._hash=g.hash&&new Ys(typeof g.hash=="string"&&g.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:g.center,zoom:g.zoom,bearing:g.bearing,pitch:g.pitch}),g.bounds&&(this.resize(),this.fitBounds(g.bounds,_.extend({},g.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=g.localIdeographFontFamily,g.style&&this.setStyle(g.style,{localIdeographFontFamily:g.localIdeographFontFamily}),g.attributionControl&&this.addControl(new qo({customAttribution:g.customAttribution})),this.addControl(new mu,g.logoPosition),this.on("style.load",function(){S.transform.unmodified&&S.jumpTo(S.style.stylesheet)}),this.on("data",function(C){S._update(C.dataType==="style"),S.fire(new _.Event(C.dataType+"data",C))}),this.on("dataloading",function(C){S.fire(new _.Event(C.dataType+"dataloading",C))})}h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d;var p={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return d.prototype._getMapId=function(){return this._mapId},d.prototype.addControl=function(g,S){if(S===void 0&&(S=g.getDefaultPosition?g.getDefaultPosition():"top-right"),!g||!g.onAdd)return this.fire(new _.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var w=g.onAdd(this);this._controls.push(g);var C=this._controlPositions[S];return S.indexOf("bottom")!==-1?C.insertBefore(w,C.firstChild):C.appendChild(w),this},d.prototype.removeControl=function(g){if(!g||!g.onRemove)return this.fire(new _.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var S=this._controls.indexOf(g);return S>-1&&this._controls.splice(S,1),g.onRemove(this),this},d.prototype.hasControl=function(g){return this._controls.indexOf(g)>-1},d.prototype.resize=function(g){var S=this._containerDimensions(),w=S[0],C=S[1];if(w===this.transform.width&&C===this.transform.height)return this;this._resizeCanvas(w,C),this.transform.resize(w,C),this.painter.resize(w,C);var P=!this._moving;return P&&this.fire(new _.Event("movestart",g)).fire(new _.Event("move",g)),this.fire(new _.Event("resize",g)),P&&this.fire(new _.Event("moveend",g)),this},d.prototype.getBounds=function(){return this.transform.getBounds()},d.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},d.prototype.setMaxBounds=function(g){return this.transform.setMaxBounds(_.LngLatBounds.convert(g)),this._update()},d.prototype.setMinZoom=function(g){if((g=g==null?-2:g)>=-2&&g<=this.transform.maxZoom)return this.transform.minZoom=g,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=g,this._update(),this.getZoom()>g&&this.setZoom(g),this;throw new Error("maxZoom must be greater than the current minZoom")},d.prototype.getMaxZoom=function(){return this.transform.maxZoom},d.prototype.setMinPitch=function(g){if((g=g==null?0:g)<0)throw new Error("minPitch must be greater than or equal to 0");if(g>=0&&g<=this.transform.maxPitch)return this.transform.minPitch=g,this._update(),this.getPitch()60)throw new Error("maxPitch must be less than or equal to 60");if(g>=this.transform.minPitch)return this.transform.maxPitch=g,this._update(),this.getPitch()>g&&this.setPitch(g),this;throw new Error("maxPitch must be greater than the current minPitch")},d.prototype.getMaxPitch=function(){return this.transform.maxPitch},d.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},d.prototype.setRenderWorldCopies=function(g){return this.transform.renderWorldCopies=g,this._update()},d.prototype.project=function(g){return this.transform.locationPoint(_.LngLat.convert(g))},d.prototype.unproject=function(g){return this.transform.pointLocation(_.Point.convert(g))},d.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},d.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},d.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},d.prototype._createDelegatedListener=function(g,S,w){var C,P=this;if(g==="mouseenter"||g==="mouseover"){var Z=!1;return{layer:S,listener:w,delegates:{mousemove:function(pe){var _e=P.getLayer(S)?P.queryRenderedFeatures(pe.point,{layers:[S]}):[];_e.length?Z||(Z=!0,w.call(P,new Wa(g,P,pe.originalEvent,{features:_e}))):Z=!1},mouseout:function(){Z=!1}}}}if(g==="mouseleave"||g==="mouseout"){var Y=!1;return{layer:S,listener:w,delegates:{mousemove:function(pe){(P.getLayer(S)?P.queryRenderedFeatures(pe.point,{layers:[S]}):[]).length?Y=!0:Y&&(Y=!1,w.call(P,new Wa(g,P,pe.originalEvent)))},mouseout:function(pe){Y&&(Y=!1,w.call(P,new Wa(g,P,pe.originalEvent)))}}}}return{layer:S,listener:w,delegates:(C={},C[g]=function(pe){var _e=P.getLayer(S)?P.queryRenderedFeatures(pe.point,{layers:[S]}):[];_e.length&&(pe.features=_e,w.call(P,pe),delete pe.features)},C)}},d.prototype.on=function(g,S,w){if(w===void 0)return h.prototype.on.call(this,g,S);var C=this._createDelegatedListener(g,S,w);for(var P in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[g]=this._delegatedListeners[g]||[],this._delegatedListeners[g].push(C),C.delegates)this.on(P,C.delegates[P]);return this},d.prototype.once=function(g,S,w){if(w===void 0)return h.prototype.once.call(this,g,S);var C=this._createDelegatedListener(g,S,w);for(var P in C.delegates)this.once(P,C.delegates[P]);return this},d.prototype.off=function(g,S,w){var C=this;return w===void 0?h.prototype.off.call(this,g,S):(this._delegatedListeners&&this._delegatedListeners[g]&&function(P){for(var Z=P[g],Y=0;Y180;){var C=p.locationPoint(h);if(C.x>=0&&C.y>=0&&C.x<=p.width&&C.y<=p.height)break;h.lng>p.center.lng?h.lng-=360:h.lng+=360}return h}Es.prototype.down=function(h,d){this.mouseRotate.mousedown(h,d),this.mousePitch&&this.mousePitch.mousedown(h,d),U.disableDrag()},Es.prototype.move=function(h,d){var p=this.map,g=this.mouseRotate.mousemoveWindow(h,d);if(g&&g.bearingDelta&&p.setBearing(p.getBearing()+g.bearingDelta),this.mousePitch){var S=this.mousePitch.mousemoveWindow(h,d);S&&S.pitchDelta&&p.setPitch(p.getPitch()+S.pitchDelta)}},Es.prototype.off=function(){var h=this.element;U.removeEventListener(h,"mousedown",this.mousedown),U.removeEventListener(h,"touchstart",this.touchstart,{passive:!1}),U.removeEventListener(h,"touchmove",this.touchmove),U.removeEventListener(h,"touchend",this.touchend),U.removeEventListener(h,"touchcancel",this.reset),this.offTemp()},Es.prototype.offTemp=function(){U.enableDrag(),U.removeEventListener(_.window,"mousemove",this.mousemove),U.removeEventListener(_.window,"mouseup",this.mouseup)},Es.prototype.mousedown=function(h){this.down(_.extend({},h,{ctrlKey:!0,preventDefault:function(){return h.preventDefault()}}),U.mousePos(this.element,h)),U.addEventListener(_.window,"mousemove",this.mousemove),U.addEventListener(_.window,"mouseup",this.mouseup)},Es.prototype.mousemove=function(h){this.move(h,U.mousePos(this.element,h))},Es.prototype.mouseup=function(h){this.mouseRotate.mouseupWindow(h),this.mousePitch&&this.mousePitch.mouseupWindow(h),this.offTemp()},Es.prototype.touchstart=function(h){h.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=U.touchPos(this.element,h.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return h.preventDefault()}},this._startPos))},Es.prototype.touchmove=function(h){h.targetTouches.length!==1?this.reset():(this._lastPos=U.touchPos(this.element,h.targetTouches)[0],this.move({preventDefault:function(){return h.preventDefault()}},this._lastPos))},Es.prototype.touchend=function(h){h.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=g}this._isDragging&&(this._pos=p.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 _.Event("dragstart"))),this.fire(new _.Event("drag")))},d.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 _.Event("dragend")),this._state="inactive"},d.prototype._addDragHandler=function(p){this._element.contains(p.originalEvent.target)&&(p.preventDefault(),this._positionDelta=p.point.sub(this._pos).add(this._offset),this._pointerdownPos=p.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))},d.prototype.setDraggable=function(p){return this._draggable=!!p,this._map&&(p?(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},d.prototype.isDraggable=function(){return this._draggable},d.prototype.setRotation=function(p){return this._rotation=p||0,this._update(),this},d.prototype.getRotation=function(){return this._rotation},d.prototype.setRotationAlignment=function(p){return this._rotationAlignment=p||"auto",this._update(),this},d.prototype.getRotationAlignment=function(){return this._rotationAlignment},d.prototype.setPitchAlignment=function(p){return this._pitchAlignment=p&&p!=="auto"?p:this._rotationAlignment,this._update(),this},d.prototype.getPitchAlignment=function(){return this._pitchAlignment},d}(_.Evented),Vf={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ac=0,oc=!1,Uu=function(h){function d(p){h.call(this),this.options=_.extend({},Vf,p),_.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.onAdd=function(p){var g;return this._map=p,this._container=U.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),g=this._setupUI,kc!==void 0?g(kc):_.window.navigator.permissions!==void 0?_.window.navigator.permissions.query({name:"geolocation"}).then(function(S){g(kc=S.state!=="denied")}):g(kc=!!_.window.navigator.geolocation),this._container},d.prototype.onRemove=function(){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(),U.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ac=0,oc=!1},d.prototype._isOutOfMapMaxBounds=function(p){var g=this._map.getMaxBounds(),S=p.coords;return g&&(S.longitudeg.getEast()||S.latitudeg.getNorth())},d.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")}},d.prototype._onSuccess=function(p){if(this._map){if(this._isOutOfMapMaxBounds(p))return this._setErrorState(),this.fire(new _.Event("outofmaxbounds",p)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=p,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(p),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(p),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new _.Event("geolocate",p)),this._finish()}},d.prototype._updateCamera=function(p){var g=new _.LngLat(p.coords.longitude,p.coords.latitude),S=p.coords.accuracy,w=this._map.getBearing(),C=_.extend({bearing:w},this.options.fitBoundsOptions);this._map.fitBounds(g.toBounds(S),C,{geolocateSource:!0})},d.prototype._updateMarker=function(p){if(p){var g=new _.LngLat(p.coords.longitude,p.coords.latitude);this._accuracyCircleMarker.setLngLat(g).addTo(this._map),this._userLocationDotMarker.setLngLat(g).addTo(this._map),this._accuracy=p.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},d.prototype._updateCircleRadius=function(){var p=this._map._container.clientHeight/2,g=this._map.unproject([0,p]),S=this._map.unproject([1,p]),w=g.distanceTo(S),C=Math.ceil(2*this._accuracy/w);this._circleElement.style.width=C+"px",this._circleElement.style.height=C+"px"},d.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},d.prototype._onError=function(p){if(this._map){if(this.options.trackUserLocation)if(p.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 g=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=g,this._geolocateButton.setAttribute("aria-label",g),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(p.code===3&&oc)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new _.Event("error",p)),this._finish()}},d.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},d.prototype._setupUI=function(p){var g=this;if(this._container.addEventListener("contextmenu",function(C){return C.preventDefault()}),this._geolocateButton=U.create("button","mapboxgl-ctrl-geolocate",this._container),U.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",p===!1){_.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var S=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=S,this._geolocateButton.setAttribute("aria-label",S)}else{var w=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=w,this._geolocateButton.setAttribute("aria-label",w)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=U.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new cf(this._dotElement),this._circleElement=U.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new cf({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(C){C.geolocateSource||g._watchState!=="ACTIVE_LOCK"||C.originalEvent&&C.originalEvent.type==="resize"||(g._watchState="BACKGROUND",g._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),g._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),g.fire(new _.Event("trackuserlocationend")))})},d.prototype.trigger=function(){if(!this._setup)return _.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 _.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ac--,oc=!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 _.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 _.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 p;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++ac>1?(p={maximumAge:6e5,timeout:0},oc=!0):(p=this.options.positionOptions,oc=!1),this._geolocationWatchID=_.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,p)}}else _.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},d.prototype._clearWatch=function(){_.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)},d}(_.Evented),zu={maxWidth:100,unit:"metric"},tu=function(h){this.options=_.extend({},zu,h),_.bindAll(["_onMove","setUnit"],this)};function jf(h,d,p){var g=p&&p.maxWidth||100,S=h._container.clientHeight/2,w=h.unproject([0,S]),C=h.unproject([g,S]),P=w.distanceTo(C);if(p&&p.unit==="imperial"){var Z=3.2808*P;Z>5280?Ol(d,g,Z/5280,h._getUIString("ScaleControl.Miles")):Ol(d,g,Z,h._getUIString("ScaleControl.Feet"))}else p&&p.unit==="nautical"?Ol(d,g,P/1852,h._getUIString("ScaleControl.NauticalMiles")):P>=1e3?Ol(d,g,P/1e3,h._getUIString("ScaleControl.Kilometers")):Ol(d,g,P,h._getUIString("ScaleControl.Meters"))}function Ol(h,d,p,g){var S,w,C,P=(S=p,(w=Math.pow(10,(""+Math.floor(S)).length-1))*(C=(C=S/w)>=10?10:C>=5?5:C>=3?3:C>=2?2:C>=1?1:function(Z){var Y=Math.pow(10,Math.ceil(-Math.log(Z)/Math.LN10));return Math.round(Z*Y)/Y}(C)));h.style.width=d*(P/p)+"px",h.innerHTML=P+" "+g}tu.prototype.getDefaultPosition=function(){return"bottom-left"},tu.prototype._onMove=function(){jf(this._map,this._container,this.options)},tu.prototype.onAdd=function(h){return this._map=h,this._container=U.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",h.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},tu.prototype.onRemove=function(){U.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},tu.prototype.setUnit=function(h){this.options.unit=h,jf(this._map,this._container,this.options)};var ru=function(h){this._fullscreen=!1,h&&h.container&&(h.container instanceof _.window.HTMLElement?this._container=h.container:_.warnOnce("Full screen control 'container' must be a DOM element.")),_.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in _.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in _.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in _.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in _.window.document&&(this._fullscreenchange="MSFullscreenChange")};ru.prototype.onAdd=function(h){return this._map=h,this._container||(this._container=this._map.getContainer()),this._controlContainer=U.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",_.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},ru.prototype.onRemove=function(){U.remove(this._controlContainer),this._map=null,_.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},ru.prototype._checkFullscreenSupport=function(){return!!(_.window.document.fullscreenEnabled||_.window.document.mozFullScreenEnabled||_.window.document.msFullscreenEnabled||_.window.document.webkitFullscreenEnabled)},ru.prototype._setupUI=function(){var h=this._fullscreenButton=U.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);U.create("span","mapboxgl-ctrl-icon",h).setAttribute("aria-hidden",!0),h.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),_.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},ru.prototype._updateTitle=function(){var h=this._getTitle();this._fullscreenButton.setAttribute("aria-label",h),this._fullscreenButton.title=h},ru.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},ru.prototype._isFullscreen=function(){return this._fullscreen},ru.prototype._changeIcon=function(){(_.window.document.fullscreenElement||_.window.document.mozFullScreenElement||_.window.document.webkitFullscreenElement||_.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())},ru.prototype._onClickFullscreen=function(){this._isFullscreen()?_.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._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Dl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ff=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Rh=function(h){function d(p){h.call(this),this.options=_.extend(Object.create(Dl),p),_.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.addTo=function(p){return this._map&&this.remove(),this._map=p,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 _.Event("open")),this},d.prototype.isOpen=function(){return!!this._map},d.prototype.remove=function(){return this._content&&U.remove(this._content),this._container&&(U.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 _.Event("close")),this},d.prototype.getLngLat=function(){return this._lngLat},d.prototype.setLngLat=function(p){return this._lngLat=_.LngLat.convert(p),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},d.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},d.prototype.getElement=function(){return this._container},d.prototype.setText=function(p){return this.setDOMContent(_.window.document.createTextNode(p))},d.prototype.setHTML=function(p){var g,S=_.window.document.createDocumentFragment(),w=_.window.document.createElement("body");for(w.innerHTML=p;g=w.firstChild;)S.appendChild(g);return this.setDOMContent(S)},d.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},d.prototype.setMaxWidth=function(p){return this.options.maxWidth=p,this._update(),this},d.prototype.setDOMContent=function(p){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=U.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(p),this._createCloseButton(),this._update(),this._focusFirstElement(),this},d.prototype.addClassName=function(p){this._container&&this._container.classList.add(p)},d.prototype.removeClassName=function(p){this._container&&this._container.classList.remove(p)},d.prototype.setOffset=function(p){return this.options.offset=p,this._update(),this},d.prototype.toggleClassName=function(p){if(this._container)return this._container.classList.toggle(p)},d.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=U.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},d.prototype._onMouseUp=function(p){this._update(p.point)},d.prototype._onMouseMove=function(p){this._update(p.point)},d.prototype._onDrag=function(p){this._update(p.point)},d.prototype._update=function(p){var g=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=U.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=U.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(_e){return g._container.classList.add(_e)}),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=ic(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||p)){var S=this._pos=this._trackPointer&&p?p:this._map.project(this._lngLat),w=this.options.anchor,C=function _e(ye){if(ye){if(typeof ye=="number"){var Ue=Math.round(Math.sqrt(.5*Math.pow(ye,2)));return{center:new _.Point(0,0),top:new _.Point(0,ye),"top-left":new _.Point(Ue,Ue),"top-right":new _.Point(-Ue,Ue),bottom:new _.Point(0,-ye),"bottom-left":new _.Point(Ue,-Ue),"bottom-right":new _.Point(-Ue,-Ue),left:new _.Point(ye,0),right:new _.Point(-ye,0)}}if(ye instanceof _.Point||Array.isArray(ye)){var ke=_.Point.convert(ye);return{center:ke,top:ke,"top-left":ke,"top-right":ke,bottom:ke,"bottom-left":ke,"bottom-right":ke,left:ke,right:ke}}return{center:_.Point.convert(ye.center||[0,0]),top:_.Point.convert(ye.top||[0,0]),"top-left":_.Point.convert(ye["top-left"]||[0,0]),"top-right":_.Point.convert(ye["top-right"]||[0,0]),bottom:_.Point.convert(ye.bottom||[0,0]),"bottom-left":_.Point.convert(ye["bottom-left"]||[0,0]),"bottom-right":_.Point.convert(ye["bottom-right"]||[0,0]),left:_.Point.convert(ye.left||[0,0]),right:_.Point.convert(ye.right||[0,0])}}return _e(new _.Point(0,0))}(this.options.offset);if(!w){var P,Z=this._container.offsetWidth,Y=this._container.offsetHeight;P=S.y+C.bottom.ythis._map.transform.height-Y?["bottom"]:[],S.xthis._map.transform.width-Z/2&&P.push("right"),w=P.length===0?"bottom":P.join("-")}var pe=S.add(C[w]).round();U.setTransform(this._container,Nu[w]+" translate("+pe.x+"px,"+pe.y+"px)"),Zf(this._container,w,"popup")}},d.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var p=this._container.querySelector(ff);p&&p.focus()}},d.prototype._onClose=function(){this.remove()},d}(_.Evented),Hf={version:_.version,supported:le,setRTLTextPlugin:_.setRTLTextPlugin,getRTLTextPluginStatus:_.getRTLTextPluginStatus,Map:Ch,NavigationControl:gu,GeolocateControl:Uu,AttributionControl:qo,ScaleControl:tu,FullscreenControl:ru,Popup:Rh,Marker:cf,Style:Os,LngLat:_.LngLat,LngLatBounds:_.LngLatBounds,Point:_.Point,MercatorCoordinate:_.MercatorCoordinate,Evented:_.Evented,config:_.config,prewarm:function(){sr().acquire(ir)},clearPrewarmedResources:function(){var h=An;h&&(h.isPreloaded()&&h.numActive()===1?(h.release(ir),An=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 _.config.ACCESS_TOKEN},set accessToken(h){_.config.ACCESS_TOKEN=h},get baseApiUrl(){return _.config.API_URL},set baseApiUrl(h){_.config.API_URL=h},get workerCount(){return wr.workerCount},set workerCount(h){wr.workerCount=h},get maxParallelImageRequests(){return _.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(h){_.config.MAX_PARALLEL_IMAGE_REQUESTS=h},clearStorage:function(h){_.clearTileCache(h)},workerUrl:""};return Hf}),q})},43548:function(rr,ee,L){"use strict";rr.exports=he;var q=L(11542);function he(re){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(re)?re:new Uint8Array(re||0),this.pos=0,this.type=0,this.length=this.buf.length}he.Varint=0,he.Fixed64=1,he.Bytes=2,he.Fixed32=5;var _=65536*65536,le=1/_,U=12,fe=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");he.prototype={destroy:function(){this.buf=null},readFields:function(re,V,K){for(K=K||this.length;this.pos>3,nt=this.pos;this.type=Me&7,re(Se,V,this),this.pos===nt&&this.skip(Me)}return V},readMessage:function(re,V){return this.readFields(re,V,this.readVarint()+this.pos)},readFixed32:function(){var re=At(this.buf,this.pos);return this.pos+=4,re},readSFixed32:function(){var re=It(this.buf,this.pos);return this.pos+=4,re},readFixed64:function(){var re=At(this.buf,this.pos)+At(this.buf,this.pos+4)*_;return this.pos+=8,re},readSFixed64:function(){var re=At(this.buf,this.pos)+It(this.buf,this.pos+4)*_;return this.pos+=8,re},readFloat:function(){var re=q.read(this.buf,this.pos,!0,23,4);return this.pos+=4,re},readDouble:function(){var re=q.read(this.buf,this.pos,!0,52,8);return this.pos+=8,re},readVarint:function(re){var V=this.buf,K,Me;return Me=V[this.pos++],K=Me&127,Me<128||(Me=V[this.pos++],K|=(Me&127)<<7,Me<128)||(Me=V[this.pos++],K|=(Me&127)<<14,Me<128)||(Me=V[this.pos++],K|=(Me&127)<<21,Me<128)?K:(Me=V[this.pos],K|=(Me&15)<<28,se(K,re,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var re=this.readVarint();return re%2===1?(re+1)/-2:re/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var re=this.readVarint()+this.pos,V=this.pos;return this.pos=re,re-V>=U&&fe?Ct(this.buf,V,re):qe(this.buf,V,re)},readBytes:function(){var re=this.readVarint()+this.pos,V=this.buf.subarray(this.pos,re);return this.pos=re,V},readPackedVarint:function(re,V){if(this.type!==he.Bytes)return re.push(this.readVarint(V));var K=Qe(this);for(re=re||[];this.pos127;);else if(V===he.Bytes)this.pos=this.readVarint()+this.pos;else if(V===he.Fixed32)this.pos+=4;else if(V===he.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+V)},writeTag:function(re,V){this.writeVarint(re<<3|V)},realloc:function(re){for(var V=this.length||16;V268435455||re<0){et(re,this);return}this.realloc(4),this.buf[this.pos++]=re&127|(re>127?128:0),!(re<=127)&&(this.buf[this.pos++]=(re>>>=7)&127|(re>127?128:0),!(re<=127)&&(this.buf[this.pos++]=(re>>>=7)&127|(re>127?128:0),!(re<=127)&&(this.buf[this.pos++]=re>>>7&127)))},writeSVarint:function(re){this.writeVarint(re<0?-re*2-1:re*2)},writeBoolean:function(re){this.writeVarint(!!re)},writeString:function(re){re=String(re),this.realloc(re.length*4),this.pos++;var V=this.pos;this.pos=fr(this.buf,re,this.pos);var K=this.pos-V;K>=128&&wt(V,K,this),this.pos=V-1,this.writeVarint(K),this.pos+=K},writeFloat:function(re){this.realloc(4),q.write(this.buf,re,this.pos,!0,23,4),this.pos+=4},writeDouble:function(re){this.realloc(8),q.write(this.buf,re,this.pos,!0,52,8),this.pos+=8},writeBytes:function(re){var V=re.length;this.writeVarint(V),this.realloc(V);for(var K=0;K=128&&wt(K,Me,this),this.pos=K-1,this.writeVarint(Me),this.pos+=Me},writeMessage:function(re,V,K){this.writeTag(re,he.Bytes),this.writeRawMessage(V,K)},writePackedVarint:function(re,V){V.length&&this.writeMessage(re,Xt,V)},writePackedSVarint:function(re,V){V.length&&this.writeMessage(re,Zt,V)},writePackedBoolean:function(re,V){V.length&&this.writeMessage(re,xt,V)},writePackedFloat:function(re,V){V.length&&this.writeMessage(re,nr,V)},writePackedDouble:function(re,V){V.length&&this.writeMessage(re,Vt,V)},writePackedFixed32:function(re,V){V.length&&this.writeMessage(re,bt,V)},writePackedSFixed32:function(re,V){V.length&&this.writeMessage(re,Tr,V)},writePackedFixed64:function(re,V){V.length&&this.writeMessage(re,hr,V)},writePackedSFixed64:function(re,V){V.length&&this.writeMessage(re,lr,V)},writeBytesField:function(re,V){this.writeTag(re,he.Bytes),this.writeBytes(V)},writeFixed32Field:function(re,V){this.writeTag(re,he.Fixed32),this.writeFixed32(V)},writeSFixed32Field:function(re,V){this.writeTag(re,he.Fixed32),this.writeSFixed32(V)},writeFixed64Field:function(re,V){this.writeTag(re,he.Fixed64),this.writeFixed64(V)},writeSFixed64Field:function(re,V){this.writeTag(re,he.Fixed64),this.writeSFixed64(V)},writeVarintField:function(re,V){this.writeTag(re,he.Varint),this.writeVarint(V)},writeSVarintField:function(re,V){this.writeTag(re,he.Varint),this.writeSVarint(V)},writeStringField:function(re,V){this.writeTag(re,he.Bytes),this.writeString(V)},writeFloatField:function(re,V){this.writeTag(re,he.Fixed32),this.writeFloat(V)},writeDoubleField:function(re,V){this.writeTag(re,he.Fixed64),this.writeDouble(V)},writeBooleanField:function(re,V){this.writeVarintField(re,!!V)}};function se(re,V,K){var Me=K.buf,Se,nt;if(nt=Me[K.pos++],Se=(nt&112)>>4,nt<128||(nt=Me[K.pos++],Se|=(nt&127)<<3,nt<128)||(nt=Me[K.pos++],Se|=(nt&127)<<10,nt<128)||(nt=Me[K.pos++],Se|=(nt&127)<<17,nt<128)||(nt=Me[K.pos++],Se|=(nt&127)<<24,nt<128)||(nt=Me[K.pos++],Se|=(nt&1)<<31,nt<128))return ae(re,Se,V);throw new Error("Expected varint not more than 10 bytes")}function Qe(re){return re.type===he.Bytes?re.readVarint()+re.pos:re.pos+1}function ae(re,V,K){return K?V*4294967296+(re>>>0):(V>>>0)*4294967296+(re>>>0)}function et(re,V){var K,Me;if(re>=0?(K=re%4294967296|0,Me=re/4294967296|0):(K=~(-re%4294967296),Me=~(-re/4294967296),K^4294967295?K=K+1|0:(K=0,Me=Me+1|0)),re>=18446744073709552e3||re<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");V.realloc(10),dt(K,Me,V),Ye(Me,V)}function dt(re,V,K){K.buf[K.pos++]=re&127|128,re>>>=7,K.buf[K.pos++]=re&127|128,re>>>=7,K.buf[K.pos++]=re&127|128,re>>>=7,K.buf[K.pos++]=re&127|128,re>>>=7,K.buf[K.pos]=re&127}function Ye(re,V){var K=(re&7)<<4;V.buf[V.pos++]|=K|((re>>>=3)?128:0),re&&(V.buf[V.pos++]=re&127|((re>>>=7)?128:0),re&&(V.buf[V.pos++]=re&127|((re>>>=7)?128:0),re&&(V.buf[V.pos++]=re&127|((re>>>=7)?128:0),re&&(V.buf[V.pos++]=re&127|((re>>>=7)?128:0),re&&(V.buf[V.pos++]=re&127)))))}function wt(re,V,K){var Me=V<=16383?1:V<=2097151?2:V<=268435455?3:Math.floor(Math.log(V)/(Math.LN2*7));K.realloc(Me);for(var Se=K.pos-1;Se>=re;Se--)K.buf[Se+Me]=K.buf[Se]}function Xt(re,V){for(var K=0;K>>8,re[K+2]=V>>>16,re[K+3]=V>>>24}function It(re,V){return(re[V]|re[V+1]<<8|re[V+2]<<16)+(re[V+3]<<24)}function qe(re,V,K){for(var Me="",Se=V;Se239?4:nt>223?3:nt>191?2:1;if(Se+Ce>K)break;var we,Xe,Lt;Ce===1?nt<128&&(te=nt):Ce===2?(we=re[Se+1],(we&192)===128&&(te=(nt&31)<<6|we&63,te<=127&&(te=null))):Ce===3?(we=re[Se+1],Xe=re[Se+2],(we&192)===128&&(Xe&192)===128&&(te=(nt&15)<<12|(we&63)<<6|Xe&63,(te<=2047||te>=55296&&te<=57343)&&(te=null))):Ce===4&&(we=re[Se+1],Xe=re[Se+2],Lt=re[Se+3],(we&192)===128&&(Xe&192)===128&&(Lt&192)===128&&(te=(nt&15)<<18|(we&63)<<12|(Xe&63)<<6|Lt&63,(te<=65535||te>=1114112)&&(te=null))),te===null?(te=65533,Ce=1):te>65535&&(te-=65536,Me+=String.fromCharCode(te>>>10&1023|55296),te=56320|te&1023),Me+=String.fromCharCode(te),Se+=Ce}return Me}function Ct(re,V,K){return fe.decode(re.subarray(V,K))}function fr(re,V,K){for(var Me=0,Se,nt;Me55295&&Se<57344)if(nt)if(Se<56320){re[K++]=239,re[K++]=191,re[K++]=189,nt=Se;continue}else Se=nt-55296<<10|Se-56320|65536,nt=null;else{Se>56319||Me+1===V.length?(re[K++]=239,re[K++]=191,re[K++]=189):nt=Se;continue}else nt&&(re[K++]=239,re[K++]=191,re[K++]=189,nt=null);Se<128?re[K++]=Se:(Se<2048?re[K++]=Se>>6|192:(Se<65536?re[K++]=Se>>12|224:(re[K++]=Se>>18|240,re[K++]=Se>>12&63|128),re[K++]=Se>>6&63|128),re[K++]=Se&63|128)}return K}},37824:function(rr,ee,L){var q=L(93738);(function(he,_){rr.exports=_()})(this,function(){"use strict";function he(Dt,k){if(!(Dt instanceof k))throw new TypeError("Cannot call a class as a function")}function _(Dt,k){for(var ie=0;iek?1:Dt0){if(k.right===null)break;if(ie(Dt,k.right.key)>0){var Sr=k.right;if(k.right=Sr.left,Sr.left=k,k=Sr,k.right===null)break}Ze.right=k,Ze=k,k=k.right}else break}return Ze.right=k.left,_t.left=k.right,k.left=ve.right,k.right=ve.left,k}function Qe(Dt,k,ie,ve){var Ze=new U(Dt,k);if(ie===null)return Ze.left=Ze.right=null,Ze;ie=se(Dt,ie,ve);var _t=ve(Dt,ie.key);return _t<0?(Ze.left=ie.left,Ze.right=ie,ie.left=null):_t>=0&&(Ze.right=ie.right,Ze.left=ie,ie.right=null),Ze}function ae(Dt,k,ie){var ve=null,Ze=null;if(k){k=se(Dt,k,ie);var _t=ie(k.key,Dt);_t===0?(ve=k.left,Ze=k.right):_t<0?(Ze=k.right,k.right=null,ve=k):(ve=k.left,k.left=null,Ze=k)}return{left:ve,right:Ze}}function et(Dt,k,ie){return k===null?Dt:(Dt===null||(k=se(Dt.key,k,ie),k.left=Dt),k)}function dt(Dt,k,ie,ve,Ze){if(Dt){ve(""+k+(ie?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+Ze(Dt)+` `);var _t=k+(ie?" ":"\u2502 ");Dt.left&&dt(Dt.left,_t,!1,ve,Ze),Dt.right&&dt(Dt.right,_t,!0,ve,Ze)}}var Ye=function(){function Dt(k){k===void 0&&(k=fe),this._root=null,this._size=0,this._comparator=k}return Dt.prototype.insert=function(k,ie){return this._size++,this._root=Qe(k,ie,this._root,this._comparator)},Dt.prototype.add=function(k,ie){var ve=new U(k,ie);this._root===null&&(ve.left=ve.right=null,this._size++,this._root=ve);var Ze=this._comparator,_t=se(k,this._root,Ze),Wt=Ze(k,_t.key);return Wt===0?this._root=_t:(Wt<0?(ve.left=_t.left,ve.right=_t,_t.left=null):Wt>0&&(ve.right=_t.right,ve.left=_t,_t.right=null),this._size++,this._root=ve),this._root},Dt.prototype.remove=function(k){this._root=this._remove(k,this._root,this._comparator)},Dt.prototype._remove=function(k,ie,ve){var Ze;if(ie===null)return null;ie=se(k,ie,ve);var _t=ve(k,ie.key);return _t===0?(ie.left===null?Ze=ie.right:(Ze=se(k,ie.left,ve),Ze.right=ie.right),this._size--,Ze):ie},Dt.prototype.pop=function(){var k=this._root;if(k){for(;k.left;)k=k.left;return this._root=se(k.key,this._root,this._comparator),this._root=this._remove(k.key,this._root,this._comparator),{key:k.key,data:k.data}}return null},Dt.prototype.findStatic=function(k){for(var ie=this._root,ve=this._comparator;ie;){var Ze=ve(k,ie.key);if(Ze===0)return ie;Ze<0?ie=ie.left:ie=ie.right}return null},Dt.prototype.find=function(k){return this._root&&(this._root=se(k,this._root,this._comparator),this._comparator(k,this._root.key)!==0)?null:this._root},Dt.prototype.contains=function(k){for(var ie=this._root,ve=this._comparator;ie;){var Ze=ve(k,ie.key);if(Ze===0)return!0;Ze<0?ie=ie.left:ie=ie.right}return!1},Dt.prototype.forEach=function(k,ie){for(var ve=this._root,Ze=[],_t=!1;!_t;)ve!==null?(Ze.push(ve),ve=ve.left):Ze.length!==0?(ve=Ze.pop(),k.call(ie,ve),ve=ve.right):_t=!0;return this},Dt.prototype.range=function(k,ie,ve,Ze){for(var _t=[],Wt=this._comparator,Sr=this._root,He;_t.length!==0||Sr;)if(Sr)_t.push(Sr),Sr=Sr.left;else{if(Sr=_t.pop(),He=Wt(Sr.key,ie),He>0)break;if(Wt(Sr.key,k)>=0&&ve.call(Ze,Sr))return this;Sr=Sr.right}return this},Dt.prototype.keys=function(){var k=[];return this.forEach(function(ie){var ve=ie.key;return k.push(ve)}),k},Dt.prototype.values=function(){var k=[];return this.forEach(function(ie){var ve=ie.data;return k.push(ve)}),k},Dt.prototype.min=function(){return this._root?this.minNode(this._root).key:null},Dt.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},Dt.prototype.minNode=function(k){if(k===void 0&&(k=this._root),k)for(;k.left;)k=k.left;return k},Dt.prototype.maxNode=function(k){if(k===void 0&&(k=this._root),k)for(;k.right;)k=k.right;return k},Dt.prototype.at=function(k){for(var ie=this._root,ve=!1,Ze=0,_t=[];!ve;)if(ie)_t.push(ie),ie=ie.left;else if(_t.length>0){if(ie=_t.pop(),Ze===k)return ie;Ze++,ie=ie.right}else ve=!0;return null},Dt.prototype.next=function(k){var ie=this._root,ve=null;if(k.right){for(ve=k.right;ve.left;)ve=ve.left;return ve}for(var Ze=this._comparator;ie;){var _t=Ze(k.key,ie.key);if(_t===0)break;_t<0?(ve=ie,ie=ie.left):ie=ie.right}return ve},Dt.prototype.prev=function(k){var ie=this._root,ve=null;if(k.left!==null){for(ve=k.left;ve.right;)ve=ve.right;return ve}for(var Ze=this._comparator;ie;){var _t=Ze(k.key,ie.key);if(_t===0)break;_t<0?ie=ie.left:(ve=ie,ie=ie.right)}return ve},Dt.prototype.clear=function(){return this._root=null,this._size=0,this},Dt.prototype.toList=function(){return Zt(this._root)},Dt.prototype.load=function(k,ie,ve){ie===void 0&&(ie=[]),ve===void 0&&(ve=!1);var Ze=k.length,_t=this._comparator;if(ve&&xt(k,ie,0,Ze-1,_t),this._root===null)this._root=wt(k,ie,0,Ze),this._size=Ze;else{var Wt=Vt(this.toList(),Xt(k,ie),_t);Ze=this._size+Ze,this._root=nr({head:Wt},0,Ze)}return this},Dt.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(Dt.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(Dt.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),Dt.prototype.toString=function(k){k===void 0&&(k=function(Ze){return String(Ze.key)});var ie=[];return dt(this._root,"",!0,function(ve){return ie.push(ve)},k),ie.join("")},Dt.prototype.update=function(k,ie,ve){var Ze=this._comparator,_t=ae(k,this._root,Ze),Wt=_t.left,Sr=_t.right;Ze(k,ie)<0?Sr=Qe(ie,ve,Sr,Ze):Wt=Qe(ie,ve,Wt,Ze),this._root=et(Wt,Sr,Ze)},Dt.prototype.split=function(k){return ae(k,this._root,this._comparator)},Dt}();function wt(Dt,k,ie,ve){var Ze=ve-ie;if(Ze>0){var _t=ie+Math.floor(Ze/2),Wt=Dt[_t],Sr=k[_t],He=new U(Wt,Sr);return He.left=wt(Dt,k,ie,_t),He.right=wt(Dt,k,_t+1,ve),He}return null}function Xt(Dt,k){for(var ie=new U(null,null),ve=ie,Ze=0;Ze0?(k=_t=_t.next=ie.pop(),k=k.right):ve=!0;return _t.next=null,Ze.next}function nr(Dt,k,ie){var ve=ie-k;if(ve>0){var Ze=k+Math.floor(ve/2),_t=nr(Dt,k,Ze),Wt=Dt.head;return Wt.left=_t,Dt.head=Dt.head.next,Wt.right=nr(Dt,Ze+1,ie),Wt}return null}function Vt(Dt,k,ie){for(var ve=new U(null,null),Ze=ve,_t=Dt,Wt=k;_t!==null&&Wt!==null;)ie(_t.key,Wt.key)<0?(Ze.next=_t,_t=_t.next):(Ze.next=Wt,Wt=Wt.next),Ze=Ze.next;return _t!==null?Ze.next=_t:Wt!==null&&(Ze.next=Wt),ve.next}function xt(Dt,k,ie,ve,Ze){if(!(ie>=ve)){for(var _t=Dt[ie+ve>>1],Wt=ie-1,Sr=ve+1;;){do Wt++;while(Ze(Dt[Wt],_t)<0);do Sr--;while(Ze(Dt[Sr],_t)>0);if(Wt>=Sr)break;var He=Dt[Wt];Dt[Wt]=Dt[Sr],Dt[Sr]=He,He=k[Wt],k[Wt]=k[Sr],k[Sr]=He}xt(Dt,k,ie,Sr,Ze),xt(Dt,k,Sr+1,ve,Ze)}}var bt=function(k,ie){return k.ll.x<=ie.x&&ie.x<=k.ur.x&&k.ll.y<=ie.y&&ie.y<=k.ur.y},Tr=function(k,ie){if(ie.ur.xve.x?1:ie.yve.y?1:0}}]);function Dt(k,ie){he(this,Dt),k.events===void 0?k.events=[this]:k.events.push(this),this.point=k,this.isLeft=ie}return le(Dt,[{key:"link",value:function(ie){if(ie.point===this.point)throw new Error("Tried to link already linked events");for(var ve=ie.point.events,Ze=0,_t=ve.length;Ze<_t;Ze++){var Wt=ve[Ze];this.point.events.push(Wt),Wt.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var ie=this.point.events.length,ve=0;ve=0&&Zr>=0?crFn?-1:0:Et<0&&Zr<0?crFn?1:0:ZrEt?1:0}}}]),Dt}(),we=0,Xe=function(){le(Dt,null,[{key:"compare",value:function(ie,ve){var Ze=ie.leftSE.point.x,_t=ve.leftSE.point.x,Wt=ie.rightSE.point.x,Sr=ve.rightSE.point.x;if(SrHe&&Et>cr)return-1;var Zr=ie.comparePoint(ve.leftSE.point);if(Zr<0)return 1;if(Zr>0)return-1;var Fn=ve.comparePoint(ie.rightSE.point);return Fn!==0?Fn:-1}if(Ze>_t){if(HeEt&&He>mr)return 1;var En=ve.comparePoint(ie.leftSE.point);if(En!==0)return En;var Cn=ie.comparePoint(ve.rightSE.point);return Cn<0?1:Cn>0?-1:1}if(HeEt)return 1;if(WtSr){var ni=ie.comparePoint(ve.rightSE.point);if(ni<0)return 1;if(ni>0)return-1}if(Wt!==Sr){var Yn=cr-He,oa=Wt-Ze,Qi=mr-Et,lo=Sr-_t;if(Yn>oa&&Qilo)return-1}return Wt>Sr?1:Wtmr?1:ie.idve.id?1:0}}]);function Dt(k,ie,ve,Ze){he(this,Dt),this.id=++we,this.leftSE=k,k.segment=this,k.otherSE=ie,this.rightSE=ie,ie.segment=this,ie.otherSE=k,this.rings=ve,this.windings=Ze}return le(Dt,[{key:"replaceRightSE",value:function(ie){this.rightSE=ie,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var ie=this.leftSE.point.y,ve=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:ieve?ie:ve}}}},{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(ie){return ie.x===this.leftSE.point.x&&ie.y===this.leftSE.point.y||ie.x===this.rightSE.point.x&&ie.y===this.rightSE.point.y}},{key:"comparePoint",value:function(ie){if(this.isAnEndpoint(ie))return 0;var ve=this.leftSE.point,Ze=this.rightSE.point,_t=this.vector();if(ve.x===Ze.x)return ie.x===ve.x?0:ie.x0&&He.swapEvents(),Ce.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),Ze&&(_t.checkForConsuming(),Wt.checkForConsuming()),ve}},{key:"swapEvents",value:function(){var ie=this.rightSE;this.rightSE=this.leftSE,this.leftSE=ie,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var ve=0,Ze=this.windings.length;ve0){var Wt=ve;ve=Ze,Ze=Wt}if(ve.prev===Ze){var Sr=ve;ve=Ze,Ze=Sr}for(var He=0,Et=Ze.rings.length;He0)_t=ve,Wt=ie,Sr=-1;else throw new Error("Tried to create degenerate segment at [".concat(ie.x,", ").concat(ie.y,"]"));var Et=new Ce(_t,!0),cr=new Ce(Wt,!1);return new Dt(Et,cr,[Ze],[Sr])}}]),Dt}(),Lt=function(){function Dt(k,ie,ve){if(he(this,Dt),!Array.isArray(k)||k.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=ie,this.isExterior=ve,this.segments=[],typeof k[0][0]!="number"||typeof k[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var Ze=qe.round(k[0][0],k[0][1]);this.bbox={ll:{x:Ze.x,y:Ze.y},ur:{x:Ze.x,y:Ze.y}};for(var _t=Ze,Wt=1,Sr=k.length;Wtthis.bbox.ur.x&&(this.bbox.ur.x=He.x),He.y>this.bbox.ur.y&&(this.bbox.ur.y=He.y),_t=He)}(Ze.x!==_t.x||Ze.y!==_t.y)&&this.segments.push(Xe.fromRing(_t,Ze,this))}return le(Dt,[{key:"getSweepEvents",value:function(){for(var ie=[],ve=0,Ze=this.segments.length;vethis.bbox.ur.x&&(this.bbox.ur.x=_t.bbox.ur.x),_t.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=_t.bbox.ur.y),this.interiorRings.push(_t)}this.multiPoly=ie}return le(Dt,[{key:"getSweepEvents",value:function(){for(var ie=this.exteriorRing.getSweepEvents(),ve=0,Ze=this.interiorRings.length;vethis.bbox.ur.x&&(this.bbox.ur.x=_t.bbox.ur.x),_t.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=_t.bbox.ur.y),this.polys.push(_t)}this.isSubject=ie}return le(Dt,[{key:"getSweepEvents",value:function(){for(var ie=[],ve=0,Ze=this.polys.length;ve0&&(ie=_t)}for(var Wt=ie.segment.prevInResult(),Sr=Wt?Wt.prevInResult():null;;){if(!Wt)return null;if(!Sr)return Wt.ringOut;if(Sr.ringOut!==Wt.ringOut)return Sr.ringOut.enclosingRing()!==Wt.ringOut?Wt.ringOut:Wt.ringOut.enclosingRing();Wt=Sr.prevInResult(),Sr=Wt?Wt.prevInResult():null}}}]),Dt}(),Hr=function(){function Dt(k){he(this,Dt),this.exteriorRing=k,k.poly=this,this.interiorRings=[]}return le(Dt,[{key:"addInterior",value:function(ie){this.interiorRings.push(ie),ie.poly=this}},{key:"getGeom",value:function(){var ie=[this.exteriorRing.getGeom()];if(ie[0]===null)return null;for(var ve=0,Ze=this.interiorRings.length;ve1&&arguments[1]!==void 0?arguments[1]:Xe.compare;he(this,Dt),this.queue=k,this.tree=new Ye(ie),this.segments=[]}return le(Dt,[{key:"process",value:function(ie){var ve=ie.segment,Ze=[];if(ie.consumedBy)return ie.isLeft?this.queue.remove(ie.otherSE):this.tree.remove(ve),Ze;var _t=ie.isLeft?this.tree.insert(ve):this.tree.find(ve);if(!_t)throw new Error("Unable to find segment #".concat(ve.id," ")+"[".concat(ve.leftSE.point.x,", ").concat(ve.leftSE.point.y,"] -> ")+"[".concat(ve.rightSE.point.x,", ").concat(ve.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var Wt=_t,Sr=_t,He=void 0,Et=void 0;He===void 0;)Wt=this.tree.prev(Wt),Wt===null?He=null:Wt.key.consumedBy===void 0&&(He=Wt.key);for(;Et===void 0;)Sr=this.tree.next(Sr),Sr===null?Et=null:Sr.key.consumedBy===void 0&&(Et=Sr.key);if(ie.isLeft){var cr=null;if(He){var mr=He.getIntersection(ve);if(mr!==null&&(ve.isAnEndpoint(mr)||(cr=mr),!He.isAnEndpoint(mr)))for(var Zr=this._splitSafely(He,mr),Fn=0,En=Zr.length;Fn0?(this.tree.remove(ve),Ze.push(ie)):(this.segments.push(ve),ve.prev=He)}else{if(He&&Et){var J=He.getIntersection(Et);if(J!==null){if(!He.isAnEndpoint(J))for(var oe=this._splitSafely(He,J),be=0,Oe=oe.length;beKr)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var lo=new bn(Cn),Is=Cn.size,hi=Cn.pop();hi;){var W=hi.key;if(Cn.size===Is){var J=W.segment;throw new Error("Unable to pop() ".concat(W.isLeft?"left":"right"," SweepEvent ")+"[".concat(W.point.x,", ").concat(W.point.y,"] from segment #").concat(J.id," ")+"[".concat(J.leftSE.point.x,", ").concat(J.leftSE.point.y,"] -> ")+"[".concat(J.rightSE.point.x,", ").concat(J.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(Cn.size>Kr)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(lo.segments.length>Mi)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var oe=lo.process(W),be=0,Oe=oe.length;be1?ie-1:0),Ze=1;Ze1?ie-1:0),Ze=1;Ze1?ie-1:0),Ze=1;Ze1?ie-1:0),Ze=1;Ze0)return!0;var Zr=xt.get(Et);return Zr.delete(cr),Zr.size>0||xt.delete(Et),!0}le("deleteMetadata",fr);function re(He,Et){for(var cr=He.length-1;cr>=0;--cr){var mr=He[cr],Zr=mr(Et);if(!Ht(Zr)&&!on(Zr)){if(!Dn(Zr))throw new TypeError;Et=Zr}}return Et}function V(He,Et,cr,mr){for(var Zr=He.length-1;Zr>=0;--Zr){var Fn=He[Zr],En=Fn(Et,cr,mr);if(!Ht(En)&&!on(En)){if(!Hr(En))throw new TypeError;mr=En}}return mr}function K(He,Et,cr){var mr=xt.get(He);if(Ht(mr)){if(!cr)return;mr=new Zt,xt.set(He,mr)}var Zr=mr.get(Et);if(Ht(Zr)){if(!cr)return;Zr=new Zt,mr.set(Et,Zr)}return Zr}function Me(He,Et,cr){var mr=Se(He,Et,cr);if(mr)return!0;var Zr=ve(Et);return on(Zr)?!1:Me(He,Zr,cr)}function Se(He,Et,cr){var mr=K(Et,cr,!1);return Ht(mr)?!1:Kr(mr.has(He))}function nt(He,Et,cr){var mr=Se(He,Et,cr);if(mr)return te(He,Et,cr);var Zr=ve(Et);if(!on(Zr))return nt(He,Zr,cr)}function te(He,Et,cr){var mr=K(Et,cr,!1);if(!Ht(mr))return mr.get(He)}function Ce(He,Et,cr,mr){var Zr=K(cr,mr,!0);Zr.set(He,Et)}function we(He,Et){var cr=Xe(He,Et),mr=ve(He);if(mr===null)return cr;var Zr=we(mr,Et);if(Zr.length<=0)return cr;if(cr.length<=0)return Zr;for(var Fn=new nr,En=[],Cn=0,fn=cr;Cn=0&&Cn=this._keys.length?(this._index=-1,this._keys=Et,this._values=Et):this._index++,{value:fn,done:!1}}return{value:void 0,done:!0}},En.prototype.throw=function(Cn){throw this._index>=0&&(this._index=-1,this._keys=Et,this._values=Et),Cn},En.prototype.return=function(Cn){return this._index>=0&&(this._index=-1,this._keys=Et,this._values=Et),{value:Cn,done:!0}},En}();return function(){function En(){this._keys=[],this._values=[],this._cacheKey=He,this._cacheIndex=-2}return Object.defineProperty(En.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),En.prototype.has=function(Cn){return this._find(Cn,!1)>=0},En.prototype.get=function(Cn){var fn=this._find(Cn,!1);return fn>=0?this._values[fn]:void 0},En.prototype.set=function(Cn,fn){var ni=this._find(Cn,!0);return this._values[ni]=fn,this},En.prototype.delete=function(Cn){var fn=this._find(Cn,!1);if(fn>=0){for(var ni=this._keys.length,Yn=fn+1;Yn=0&&(z|0)===z||_("invalid parameter type, ("+z+")"+U(Ae)+". must be a nonnegative integer")}function dt(z,Ae,je){Ae.indexOf(z)<0&&_("invalid value"+U(je)+". must be one of: "+Ae)}var Ye=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function wt(z){Object.keys(z).forEach(function(Ae){Ye.indexOf(Ae)<0&&_('invalid regl constructor argument "'+Ae+'". must be one of '+Ye)})}function Xt(z,Ae){for(z=z+"";z.length0&&Ae.push(new Vt("unknown",0,je))}}),Ae}function lr(z,Ae){Ae.forEach(function(je){var jt=z[je.file];if(jt){var pr=jt.index[je.line];if(pr){pr.errors.push(je),jt.hasErrors=!0;return}}z.unknown.hasErrors=!0,z.unknown.lines[0].errors.push(je)})}function At(z,Ae,je,jt,pr){if(!z.getShaderParameter(Ae,z.COMPILE_STATUS)){var Gt=z.getShaderInfoLog(Ae),kt=jt===z.FRAGMENT_SHADER?"fragment":"vertex";V(je,"string",kt+" shader source must be a string",pr);var Dr=Tr(je,pr),Cr=hr(Gt);lr(Dr,Cr),Object.keys(Dr).forEach(function(Vr){var Br=Dr[Vr];if(!Br.hasErrors)return;var Ur=[""],Gr=[""];function Ar(zr,Tt){Ur.push(zr),Gr.push(Tt||"")}Ar("file number "+Vr+": "+Br.name+` `,"color:red;text-decoration:underline;font-weight:bold"),Br.lines.forEach(function(zr){if(zr.errors.length>0){Ar(Xt(zr.number,4)+"| ","background-color:yellow; font-weight:bold"),Ar(zr.line+q,"color:red; background-color:yellow; font-weight:bold");var Tt=0;zr.errors.forEach(function(er){var Fr=er.message,rn=/^\s*'(.*)'\s*:\s*(.*)$/.exec(Fr);if(rn){var yr=rn[1];switch(Fr=rn[2],yr){case"assign":yr="=";break}Tt=Math.max(zr.line.indexOf(yr,Tt),0)}else Tt=0;Ar(Xt("| ",6)),Ar(Xt("^^^",Tt+3)+q,"font-weight:bold"),Ar(Xt("| ",6)),Ar(Fr+q,"font-weight:bold")}),Ar(Xt("| ",6)+q)}else Ar(Xt(zr.number,4)+"| "),Ar(zr.line+q,"color:red")}),typeof document!="undefined"&&!window.chrome?(Gr[0]=Ur.join("%c"),console.log.apply(console,Gr)):console.log(Ur.join(""))}),le.raise("Error compiling "+kt+" shader, "+Dr[0].name)}}function ut(z,Ae,je,jt,pr){if(!z.getProgramParameter(Ae,z.LINK_STATUS)){var Gt=z.getProgramInfoLog(Ae),kt=Tr(je,pr),Dr=Tr(jt,pr),Cr='Error linking program with vertex shader, "'+Dr[0].name+'", and fragment shader "'+kt[0].name+'"';typeof document!="undefined"?console.log("%c"+Cr+q+"%c"+Gt,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(Cr+q+Gt),le.raise(Cr)}}function It(z){z._commandRef=xt()}function qe(z,Ae,je,jt){It(z);function pr(Cr){return Cr?jt.id(Cr):0}z._fragId=pr(z.static.frag),z._vertId=pr(z.static.vert);function Gt(Cr,Vr){Object.keys(Vr).forEach(function(Br){Cr[jt.id(Br)]=!0})}var kt=z._uniformSet={};Gt(kt,Ae.static),Gt(kt,Ae.dynamic);var Dr=z._attributeSet={};Gt(Dr,je.static),Gt(Dr,je.dynamic),z._hasCount="count"in z.static||"count"in z.dynamic||"elements"in z.static||"elements"in z.dynamic}function Ct(z,Ae){var je=bt();_(z+" in command "+(Ae||xt())+(je==="unknown"?"":" called from "+je))}function fr(z,Ae,je){z||Ct(Ae,je||xt())}function re(z,Ae,je,jt){z in Ae||Ct("unknown parameter ("+z+")"+U(je)+". possible values: "+Object.keys(Ae).join(),jt||xt())}function V(z,Ae,je,jt){Qe(z,Ae)||Ct("invalid parameter type"+U(je)+". expected "+Ae+", got "+typeof z,jt||xt())}function K(z){z()}function Me(z,Ae,je){z.texture?dt(z.texture._texture.internalformat,Ae,"unsupported texture format for attachment"):dt(z.renderbuffer._renderbuffer.format,je,"unsupported renderbuffer format for attachment")}var Se=33071,nt=9728,te=9984,Ce=9985,we=9986,Xe=9987,Lt=5120,Ht=5121,on=5122,Jr=5123,Hr=5124,Un=5125,bn=5126,Kr=32819,Mi=32820,Si=33635,Ri=34042,Gn=36193,Dn={};Dn[Lt]=Dn[Ht]=1,Dn[on]=Dn[Jr]=Dn[Gn]=Dn[Si]=Dn[Kr]=Dn[Mi]=2,Dn[Hr]=Dn[Un]=Dn[bn]=Dn[Ri]=4;function Ya(z,Ae){return z===Mi||z===Kr||z===Si?2:z===Ri?4:Dn[z]*Ae}function Yi(z){return!(z&z-1)&&!!z}function Na(z,Ae,je){var jt,pr=Ae.width,Gt=Ae.height,kt=Ae.channels;le(pr>0&&pr<=je.maxTextureSize&&Gt>0&&Gt<=je.maxTextureSize,"invalid texture shape"),(z.wrapS!==Se||z.wrapT!==Se)&&le(Yi(pr)&&Yi(Gt),"incompatible wrap mode for texture, both width and height must be power of 2"),Ae.mipmask===1?pr!==1&&Gt!==1&&le(z.minFilter!==te&&z.minFilter!==we&&z.minFilter!==Ce&&z.minFilter!==Xe,"min filter requires mipmap"):(le(Yi(pr)&&Yi(Gt),"texture must be a square power of 2 to support mipmapping"),le(Ae.mipmask===(pr<<1)-1,"missing or incomplete mipmap data")),Ae.type===bn&&(je.extensions.indexOf("oes_texture_float_linear")<0&&le(z.minFilter===nt&&z.magFilter===nt,"filter not supported, must enable oes_texture_float_linear"),le(!z.genMipmaps,"mipmap generation not supported with float textures"));var Dr=Ae.images;for(jt=0;jt<16;++jt)if(Dr[jt]){var Cr=pr>>jt,Vr=Gt>>jt;le(Ae.mipmask&1<0&&pr<=jt.maxTextureSize&&Gt>0&&Gt<=jt.maxTextureSize,"invalid texture shape"),le(pr===Gt,"cube map must be square"),le(Ae.wrapS===Se&&Ae.wrapT===Se,"wrap mode not supported by cube map");for(var Dr=0;Dr>Br,Ar=Gt>>Br;le(Cr.mipmask&1<1&&Ae===je&&(Ae==='"'||Ae==="'"))return['"'+_t(z.substr(1,z.length-2))+'"'];var jt=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(z);if(jt)return Wt(z.substr(0,jt.index)).concat(Wt(jt[1])).concat(Wt(z.substr(jt.index+jt[0].length)));var pr=z.split(".");if(pr.length===1)return['"'+_t(z)+'"'];for(var Gt=[],kt=0;kt0,"invalid pixel ratio"))):k.raise("invalid arguments to regl"),je&&(je.nodeName.toLowerCase()==="canvas"?pr=je:jt=je),!Gt){if(!pr){k(typeof document!="undefined","must manually specify webgl context outside of DOM environments");var Ar=Cn(jt||document.body,Ur,Vr);if(!Ar)return null;pr=Ar.canvas,Gr=Ar.onDestroy}kt.premultipliedAlpha===void 0&&(kt.premultipliedAlpha=!0),Gt=fn(pr,kt)}return Gt?{gl:Gt,canvas:pr,container:jt,extensions:Dr,optionalExtensions:Cr,pixelRatio:Vr,profile:Br,onDone:Ur,onDestroy:Gr}:(Gr(),Ur("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function Is(z,Ae){var je={};function jt(kt){k.type(kt,"string","extension name must be string");var Dr=kt.toLowerCase(),Cr;try{Cr=je[Dr]=z.getExtension(Dr)}catch(Vr){}return!!Cr}for(var pr=0;pr65535)<<4,z>>>=Ae,je=(z>255)<<3,z>>>=je,Ae|=je,je=(z>15)<<2,z>>>=je,Ae|=je,je=(z>3)<<1,z>>>=je,Ae|=je,Ae|z>>1}function Le(){var z=hi(8,function(){return[]});function Ae(Gt){var kt=j(Gt),Dr=z[Q(kt)>>2];return Dr.length>0?Dr.pop():new ArrayBuffer(kt)}function je(Gt){z[Q(Gt.byteLength)>>2].push(Gt)}function jt(Gt,kt){var Dr=null;switch(Gt){case W:Dr=new Int8Array(Ae(kt),0,kt);break;case J:Dr=new Uint8Array(Ae(kt),0,kt);break;case oe:Dr=new Int16Array(Ae(2*kt),0,kt);break;case be:Dr=new Uint16Array(Ae(2*kt),0,kt);break;case Oe:Dr=new Int32Array(Ae(4*kt),0,kt);break;case it:Dr=new Uint32Array(Ae(4*kt),0,kt);break;case pt:Dr=new Float32Array(Ae(4*kt),0,kt);break;default:return null}return Dr.length!==kt?Dr.subarray(0,kt):Dr}function pr(Gt){je(Gt.buffer)}return{alloc:Ae,free:je,allocType:jt,freeType:pr}}var at=Le();at.zero=Le();var Ee=3408,ir=3410,wr=3411,An=3412,sn=3413,sr=3414,en=3415,Wr=33901,Yr=33902,pi=3379,tn=3386,vi=34921,qi=36347,ci=36348,zi=35661,Ai=35660,Xo=34930,Ji=36349,Ia=34076,Ti=34024,mi=7936,wi=7937,Pa=7938,cu=35724,ma=34047,Aa=36063,$l=34852,os=3553,Ta=34067,fi=34069,Oa=33984,sa=6408,Ao=5126,ha=5121,$o=36160,Vo=36053,Ru=36064,ss=16384,Cc=function(z,Ae){var je=1;Ae.ext_texture_filter_anisotropic&&(je=z.getParameter(ma));var jt=1,pr=1;Ae.webgl_draw_buffers&&(jt=z.getParameter($l),pr=z.getParameter(Aa));var Gt=!!Ae.oes_texture_float;if(Gt){var kt=z.createTexture();z.bindTexture(os,kt),z.texImage2D(os,0,sa,1,1,0,sa,Ao,null);var Dr=z.createFramebuffer();if(z.bindFramebuffer($o,Dr),z.framebufferTexture2D($o,Ru,os,kt,0),z.bindTexture(os,null),z.checkFramebufferStatus($o)!==Vo)Gt=!1;else{z.viewport(0,0,1,1),z.clearColor(1,0,0,1),z.clear(ss);var Cr=at.allocType(Ao,4);z.readPixels(0,0,1,1,sa,Ao,Cr),z.getError()?Gt=!1:(z.deleteFramebuffer(Dr),z.deleteTexture(kt),Gt=Cr[0]===1),at.freeType(Cr)}}var Vr=typeof navigator!="undefined"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Br=!0;if(!Vr){var Ur=z.createTexture(),Gr=at.allocType(ha,36);z.activeTexture(Oa),z.bindTexture(Ta,Ur),z.texImage2D(fi,0,sa,3,3,0,sa,ha,Gr),at.freeType(Gr),z.bindTexture(Ta,null),z.deleteTexture(Ur),Br=!z.getError()}return{colorBits:[z.getParameter(ir),z.getParameter(wr),z.getParameter(An),z.getParameter(sn)],depthBits:z.getParameter(sr),stencilBits:z.getParameter(en),subpixelBits:z.getParameter(Ee),extensions:Object.keys(Ae).filter(function(Ar){return!!Ae[Ar]}),maxAnisotropic:je,maxDrawbuffers:jt,maxColorAttachments:pr,pointSizeDims:z.getParameter(Wr),lineWidthDims:z.getParameter(Yr),maxViewportDims:z.getParameter(tn),maxCombinedTextureUnits:z.getParameter(zi),maxCubeMapSize:z.getParameter(Ia),maxRenderbufferSize:z.getParameter(Ti),maxTextureUnits:z.getParameter(Xo),maxTextureSize:z.getParameter(pi),maxAttributes:z.getParameter(vi),maxVertexUniforms:z.getParameter(qi),maxVertexTextureUnits:z.getParameter(Ai),maxVaryingVectors:z.getParameter(ci),maxFragmentUniforms:z.getParameter(Ji),glsl:z.getParameter(cu),renderer:z.getParameter(wi),vendor:z.getParameter(mi),version:z.getParameter(Pa),readFloat:Gt,npotTextureCube:Br}};function Ea(z){return!!z&&typeof z=="object"&&Array.isArray(z.shape)&&Array.isArray(z.stride)&&typeof z.offset=="number"&&z.shape.length===z.stride.length&&(Array.isArray(z.data)||ee(z.data))}var ea=function(z){return Object.keys(z).map(function(Ae){return z[Ae]})},Kt={shape:jr,flatten:or};function Sn(z,Ae,je){for(var jt=0;jt0){var nn;if(Array.isArray(er[0])){Pr=Qu(er);for(var br=1,$r=1;$r0)if(typeof br[0]=="number"){var Qr=at.allocType(yr.dtype,br.length);Qh(Qr,br),Pr(Qr,Nn),at.freeType(Qr)}else if(Array.isArray(br[0])||ee(br[0])){ui=Qu(br);var yt=Iu(br,ui,yr.dtype);Pr(yt,Nn),at.freeType(yt)}else k.raise("invalid buffer data")}else if(Ea(br)){ui=br.shape;var vr=br.stride,ot=0,Ci=0,ln=0,yi=0;ui.length===1?(ot=ui[0],Ci=1,ln=vr[0],yi=0):ui.length===2?(ot=ui[0],Ci=ui[1],ln=vr[0],yi=vr[1]):k.raise("invalid shape");var si=Array.isArray(br.data)?yr.dtype:Rf(br.data),Qn=at.allocType(si,ot*Ci);Mf(Qn,br.data,ot,Ci,ln,yi,br.offset),Pr(Qn,Nn),at.freeType(Qn)}else k.raise("invalid data for buffer subdata");return an}return Fr||an(Tt),an._reglType="buffer",an._buffer=yr,an.subdata=nn,je.profile&&(an.stats=yr.stats),an.destroy=function(){Gr(yr)},an}function zr(){ea(Gt).forEach(function(Tt){Tt.buffer=z.createBuffer(),z.bindBuffer(Tt.type,Tt.buffer),z.bufferData(Tt.type,Tt.persistentData||Tt.byteLength,Tt.usage)})}return je.profile&&(Ae.getTotalBufferSize=function(){var Tt=0;return Object.keys(Gt).forEach(function(er){Tt+=Gt[er].stats.size}),Tt}),{create:Ar,createStream:Cr,destroyStream:Vr,clear:function(){ea(Gt).forEach(Gr),Dr.forEach(Gr)},getBuffer:function(Tt){return Tt&&Tt._buffer instanceof kt?Tt._buffer:null},restore:zr,_initBuffer:Ur}}var dh=0,vh=0,Jh=1,ep=1,Zp=4,Jc=4,Pu={points:dh,point:vh,lines:Jh,line:ep,triangles:Zp,triangle:Jc,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},tp=0,Ho=1,Yl=4,Sl=5120,$s=5121,Al=5122,oi=5123,el=5124,Ds=5125,Ou=34963,tl=35040,rp=35044;function ta(z,Ae,je,jt){var pr={},Gt=0,kt={uint8:$s,uint16:oi};Ae.oes_element_index_uint&&(kt.uint32=Ds);function Dr(zr){this.id=Gt++,pr[this.id]=this,this.buffer=zr,this.primType=Yl,this.vertCount=0,this.type=0}Dr.prototype.bind=function(){this.buffer.bind()};var Cr=[];function Vr(zr){var Tt=Cr.pop();return Tt||(Tt=new Dr(je.create(null,Ou,!0,!1)._buffer)),Ur(Tt,zr,tl,-1,-1,0,0),Tt}function Br(zr){Cr.push(zr)}function Ur(zr,Tt,er,Fr,rn,yr,an){zr.buffer.bind();var Pr;if(Tt){var nn=an;!an&&(!ee(Tt)||Ea(Tt)&&!ee(Tt.data))&&(nn=Ae.oes_element_index_uint?Ds:oi),je._initBuffer(zr.buffer,Tt,er,nn,3)}else z.bufferData(Ou,yr,er),zr.buffer.dtype=Pr||$s,zr.buffer.usage=er,zr.buffer.dimension=3,zr.buffer.byteLength=yr;if(Pr=an,!an){switch(zr.buffer.dtype){case $s:case Sl:Pr=$s;break;case oi:case Al:Pr=oi;break;case Ds:case el:Pr=Ds;break;default:k.raise("unsupported type for element array")}zr.buffer.dtype=Pr}zr.type=Pr,k(Pr!==Ds||!!Ae.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var br=rn;br<0&&(br=zr.buffer.byteLength,Pr===oi?br>>=1:Pr===Ds&&(br>>=2)),zr.vertCount=br;var $r=Fr;if(Fr<0){$r=Yl;var Nn=zr.buffer.dimension;Nn===1&&($r=tp),Nn===2&&($r=Ho),Nn===3&&($r=Yl)}zr.primType=$r}function Gr(zr){jt.elementsCount--,k(zr.buffer!==null,"must not double destroy elements"),delete pr[zr.id],zr.buffer.destroy(),zr.buffer=null}function Ar(zr,Tt){var er=je.create(null,Ou,!0),Fr=new Dr(er._buffer);jt.elementsCount++;function rn(yr){if(!yr)er(),Fr.primType=Yl,Fr.vertCount=0,Fr.type=$s;else if(typeof yr=="number")er(yr),Fr.primType=Yl,Fr.vertCount=yr|0,Fr.type=$s;else{var an=null,Pr=rp,nn=-1,br=-1,$r=0,Nn=0;Array.isArray(yr)||ee(yr)||Ea(yr)?an=yr:(k.type(yr,"object","invalid arguments for elements"),"data"in yr&&(an=yr.data,k(Array.isArray(an)||ee(an)||Ea(an),"invalid data for element buffer")),"usage"in yr&&(k.parameter(yr.usage,Mu,"invalid element buffer usage"),Pr=Mu[yr.usage]),"primitive"in yr&&(k.parameter(yr.primitive,Pu,"invalid element buffer primitive"),nn=Pu[yr.primitive]),"count"in yr&&(k(typeof yr.count=="number"&&yr.count>=0,"invalid vertex count for elements"),br=yr.count|0),"type"in yr&&(k.parameter(yr.type,kt,"invalid buffer type"),Nn=kt[yr.type]),"length"in yr?$r=yr.length|0:($r=br,Nn===oi||Nn===Al?$r*=2:(Nn===Ds||Nn===el)&&($r*=4))),Ur(Fr,an,Pr,nn,br,$r,Nn)}return rn}return rn(zr),rn._reglType="elements",rn._elements=Fr,rn.subdata=function(yr,an){return er.subdata(yr,an),rn},rn.destroy=function(){Gr(Fr)},rn}return{create:Ar,createStream:Vr,destroyStream:Br,getElements:function(zr){return typeof zr=="function"&&zr._elements instanceof Dr?zr._elements:null},clear:function(){ea(pr).forEach(Gr)}}}var Ii=new Float32Array(1),fu=new Uint32Array(Ii.buffer),Du=5123;function mh(z){for(var Ae=at.allocType(Du,z.length),je=0;je>>31<<15,Gt=(jt<<1>>>24)-127,kt=jt>>13&1024-1;if(Gt<-24)Ae[je]=pr;else if(Gt<-14){var Dr=-14-Gt;Ae[je]=pr+(kt+1024>>Dr)}else Gt>15?Ae[je]=pr+31744:Ae[je]=pr+(Gt+15<<10)+kt}return Ae}function Ha(z){return Array.isArray(z)||ee(z)}var ef=function(z){return!(z&z-1)&&!!z},Vp=34467,xs=3553,Fu=34067,ku=34069,ql=6408,If=6406,wa=6407,Qs=6409,Rc=6410,Kl=32854,rl=32855,gh=36194,Ql=32819,ca=32820,tf=33635,np=34042,Tl=6402,Jl=34041,_h=35904,Pf=35906,wl=36193,hu=33776,Mc=33777,rf=33778,ec=33779,tc=35986,ip=35987,nl=34798,Js=35840,nf=35841,Ic=35842,yh=35843,Cl=36196,pu=5121,af=5123,Pc=5125,Bu=5126,Md=10242,Of=10243,xh=10497,Df=33071,Fo=33648,bh=10240,ap=10241,Ff=9728,Eh=9729,Oc=9984,of=9985,il=9986,pa=9987,kf=33170,du=4352,Rl=4353,Li=4354,Ca=34046,Ys=3317,Bf=37440,Fs=37441,sf=37443,op=37444,Sh=33984,Lf=[Oc,il,of,pa],Ml=[0,Qs,Rc,wa,ql],ko={};ko[Qs]=ko[If]=ko[Tl]=1,ko[Jl]=ko[Rc]=2,ko[wa]=ko[_h]=3,ko[ql]=ko[Pf]=4;function Wa(z){return"[object "+z+"]"}var al=Wa("HTMLCanvasElement"),Ah=Wa("OffscreenCanvas"),Ka=Wa("CanvasRenderingContext2D"),_n=Wa("ImageBitmap"),ks=Wa("HTMLImageElement"),uf=Wa("HTMLVideoElement"),rc=Object.keys(In).concat([al,Ah,Ka,_n,ks,uf]),us=[];us[pu]=1,us[Bu]=4,us[wl]=2,us[af]=2,us[Pc]=4;var ga=[];ga[Kl]=2,ga[rl]=2,ga[gh]=2,ga[Jl]=4,ga[hu]=.5,ga[Mc]=.5,ga[rf]=1,ga[ec]=1,ga[tc]=.5,ga[ip]=1,ga[nl]=1,ga[Js]=.5,ga[nf]=.25,ga[Ic]=.5,ga[yh]=.25,ga[Cl]=.5;function Th(z){return Array.isArray(z)&&(z.length===0||typeof z[0]=="number")}function qr(z){if(!Array.isArray(z))return!1;var Ae=z.length;return!(Ae===0||!Ha(z[0]))}function ol(z){return Object.prototype.toString.call(z)}function Dc(z){return ol(z)===al}function wh(z){return ol(z)===Ah}function eu(z){return ol(z)===Ka}function Bs(z){return ol(z)===_n}function Nf(z){return ol(z)===ks}function Uf(z){return ol(z)===uf}function Yo(z){if(!z)return!1;var Ae=ol(z);return rc.indexOf(Ae)>=0?!0:Th(z)||qr(z)||Ea(z)}function Lu(z){return In[Object.prototype.toString.call(z)]|0}function sp(z,Ae){var je=Ae.length;switch(z.type){case pu:case af:case Pc:case Bu:var jt=at.allocType(z.type,je);jt.set(Ae),z.data=jt;break;case wl:z.data=mh(Ae);break;default:k.raise("unsupported texture type, must specify a typed array")}}function Il(z,Ae){return at.allocType(z.type===wl?Bu:z.type,Ae)}function lf(z,Ae){z.type===wl?(z.data=mh(Ae),at.freeType(Ae)):z.data=Ae}function up(z,Ae,je,jt,pr,Gt){for(var kt=z.width,Dr=z.height,Cr=z.channels,Vr=kt*Dr*Cr,Br=Il(z,Vr),Ur=0,Gr=0;Gr=1;)Dr+=kt*Cr*Cr,Cr/=2;return Dr}else return kt*je*jt}function Fe(z,Ae,je,jt,pr,Gt,kt){var Dr={"don't care":du,"dont care":du,nice:Li,fast:Rl},Cr={repeat:xh,clamp:Df,mirror:Fo},Vr={nearest:Ff,linear:Eh},Br=L({mipmap:pa,"nearest mipmap nearest":Oc,"linear mipmap nearest":of,"nearest mipmap linear":il,"linear mipmap linear":pa},Vr),Ur={none:0,browser:op},Gr={uint8:pu,rgba4:Ql,rgb565:tf,"rgb5 a1":ca},Ar={alpha:If,luminance:Qs,"luminance alpha":Rc,rgb:wa,rgba:ql,rgba4:Kl,"rgb5 a1":rl,rgb565:gh},zr={};Ae.ext_srgb&&(Ar.srgb=_h,Ar.srgba=Pf),Ae.oes_texture_float&&(Gr.float32=Gr.float=Bu),Ae.oes_texture_half_float&&(Gr.float16=Gr["half float"]=wl),Ae.webgl_depth_texture&&(L(Ar,{depth:Tl,"depth stencil":Jl}),L(Gr,{uint16:af,uint32:Pc,"depth stencil":np})),Ae.webgl_compressed_texture_s3tc&&L(zr,{"rgb s3tc dxt1":hu,"rgba s3tc dxt1":Mc,"rgba s3tc dxt3":rf,"rgba s3tc dxt5":ec}),Ae.webgl_compressed_texture_atc&&L(zr,{"rgb atc":tc,"rgba atc explicit alpha":ip,"rgba atc interpolated alpha":nl}),Ae.webgl_compressed_texture_pvrtc&&L(zr,{"rgb pvrtc 4bppv1":Js,"rgb pvrtc 2bppv1":nf,"rgba pvrtc 4bppv1":Ic,"rgba pvrtc 2bppv1":yh}),Ae.webgl_compressed_texture_etc1&&(zr["rgb etc1"]=Cl);var Tt=Array.prototype.slice.call(z.getParameter(Vp));Object.keys(zr).forEach(function(Ne){var $t=zr[Ne];Tt.indexOf($t)>=0&&(Ar[Ne]=$t)});var er=Object.keys(Ar);je.textureFormats=er;var Fr=[];Object.keys(Ar).forEach(function(Ne){var $t=Ar[Ne];Fr[$t]=Ne});var rn=[];Object.keys(Gr).forEach(function(Ne){var $t=Gr[Ne];rn[$t]=Ne});var yr=[];Object.keys(Vr).forEach(function(Ne){var $t=Vr[Ne];yr[$t]=Ne});var an=[];Object.keys(Br).forEach(function(Ne){var $t=Br[Ne];an[$t]=Ne});var Pr=[];Object.keys(Cr).forEach(function(Ne){var $t=Cr[Ne];Pr[$t]=Ne});var nn=er.reduce(function(Ne,$t){var Nt=Ar[$t];return Nt===Qs||Nt===If||Nt===Qs||Nt===Rc||Nt===Tl||Nt===Jl||Ae.ext_srgb&&(Nt===_h||Nt===Pf)?Ne[Nt]=Nt:Nt===rl||$t.indexOf("rgba")>=0?Ne[Nt]=ql:Ne[Nt]=wa,Ne},{});function br(){this.internalformat=ql,this.format=ql,this.type=pu,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=op,this.width=0,this.height=0,this.channels=0}function $r(Ne,$t){Ne.internalformat=$t.internalformat,Ne.format=$t.format,Ne.type=$t.type,Ne.compressed=$t.compressed,Ne.premultiplyAlpha=$t.premultiplyAlpha,Ne.flipY=$t.flipY,Ne.unpackAlignment=$t.unpackAlignment,Ne.colorSpace=$t.colorSpace,Ne.width=$t.width,Ne.height=$t.height,Ne.channels=$t.channels}function Nn(Ne,$t){if(!(typeof $t!="object"||!$t)){if("premultiplyAlpha"in $t&&(k.type($t.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),Ne.premultiplyAlpha=$t.premultiplyAlpha),"flipY"in $t&&(k.type($t.flipY,"boolean","invalid texture flip"),Ne.flipY=$t.flipY),"alignment"in $t&&(k.oneOf($t.alignment,[1,2,4,8],"invalid texture unpack alignment"),Ne.unpackAlignment=$t.alignment),"colorSpace"in $t&&(k.parameter($t.colorSpace,Ur,"invalid colorSpace"),Ne.colorSpace=Ur[$t.colorSpace]),"type"in $t){var Nt=$t.type;k(Ae.oes_texture_float||!(Nt==="float"||Nt==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),k(Ae.oes_texture_half_float||!(Nt==="half float"||Nt==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),k(Ae.webgl_depth_texture||!(Nt==="uint16"||Nt==="uint32"||Nt==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),k.parameter(Nt,Gr,"invalid texture type"),Ne.type=Gr[Nt]}var hn=Ne.width,bi=Ne.height,da=Ne.channels,ce=!1;"shape"in $t?(k(Array.isArray($t.shape)&&$t.shape.length>=2,"shape must be an array"),hn=$t.shape[0],bi=$t.shape[1],$t.shape.length===3&&(da=$t.shape[2],k(da>0&&da<=4,"invalid number of channels"),ce=!0),k(hn>=0&&hn<=je.maxTextureSize,"invalid width"),k(bi>=0&&bi<=je.maxTextureSize,"invalid height")):("radius"in $t&&(hn=bi=$t.radius,k(hn>=0&&hn<=je.maxTextureSize,"invalid radius")),"width"in $t&&(hn=$t.width,k(hn>=0&&hn<=je.maxTextureSize,"invalid width")),"height"in $t&&(bi=$t.height,k(bi>=0&&bi<=je.maxTextureSize,"invalid height")),"channels"in $t&&(da=$t.channels,k(da>0&&da<=4,"invalid number of channels"),ce=!0)),Ne.width=hn|0,Ne.height=bi|0,Ne.channels=da|0;var Te=!1;if("format"in $t){var Ve=$t.format;k(Ae.webgl_depth_texture||!(Ve==="depth"||Ve==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),k.parameter(Ve,Ar,"invalid texture format");var Ut=Ne.internalformat=Ar[Ve];Ne.format=nn[Ut],Ve in Gr&&("type"in $t||(Ne.type=Gr[Ve])),Ve in zr&&(Ne.compressed=!0),Te=!0}!ce&&Te?Ne.channels=ko[Ne.format]:ce&&!Te?Ne.channels!==Ml[Ne.format]&&(Ne.format=Ne.internalformat=Ml[Ne.channels]):Te&&ce&&k(Ne.channels===ko[Ne.format],"number of channels inconsistent with specified format")}}function ui(Ne){z.pixelStorei(Bf,Ne.flipY),z.pixelStorei(Fs,Ne.premultiplyAlpha),z.pixelStorei(sf,Ne.colorSpace),z.pixelStorei(Ys,Ne.unpackAlignment)}function Qr(){br.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function yt(Ne,$t){var Nt=null;if(Yo($t)?Nt=$t:$t&&(k.type($t,"object","invalid pixel data type"),Nn(Ne,$t),"x"in $t&&(Ne.xOffset=$t.x|0),"y"in $t&&(Ne.yOffset=$t.y|0),Yo($t.data)&&(Nt=$t.data)),k(!Ne.compressed||Nt instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),$t.copy){k(!Nt,"can not specify copy and data field for the same texture");var hn=pr.viewportWidth,bi=pr.viewportHeight;Ne.width=Ne.width||hn-Ne.xOffset,Ne.height=Ne.height||bi-Ne.yOffset,Ne.needsCopy=!0,k(Ne.xOffset>=0&&Ne.xOffset=0&&Ne.yOffset0&&Ne.width<=hn&&Ne.height>0&&Ne.height<=bi,"copy texture read out of bounds")}else if(!Nt)Ne.width=Ne.width||1,Ne.height=Ne.height||1,Ne.channels=Ne.channels||4;else if(ee(Nt))Ne.channels=Ne.channels||4,Ne.data=Nt,!("type"in $t)&&Ne.type===pu&&(Ne.type=Lu(Nt));else if(Th(Nt))Ne.channels=Ne.channels||4,sp(Ne,Nt),Ne.alignment=1,Ne.needsFree=!0;else if(Ea(Nt)){var da=Nt.data;!Array.isArray(da)&&Ne.type===pu&&(Ne.type=Lu(da));var ce=Nt.shape,Te=Nt.stride,Ve,Ut,Bt,tt,ft,mt;ce.length===3?(Bt=ce[2],mt=Te[2]):(k(ce.length===2,"invalid ndarray pixel data, must be 2 or 3D"),Bt=1,mt=1),Ve=ce[0],Ut=ce[1],tt=Te[0],ft=Te[1],Ne.alignment=1,Ne.width=Ve,Ne.height=Ut,Ne.channels=Bt,Ne.format=Ne.internalformat=Ml[Bt],Ne.needsFree=!0,up(Ne,da,tt,ft,mt,Nt.offset)}else if(Dc(Nt)||wh(Nt)||eu(Nt))Dc(Nt)||wh(Nt)?Ne.element=Nt:Ne.element=Nt.canvas,Ne.width=Ne.element.width,Ne.height=Ne.element.height,Ne.channels=4;else if(Bs(Nt))Ne.element=Nt,Ne.width=Nt.width,Ne.height=Nt.height,Ne.channels=4;else if(Nf(Nt))Ne.element=Nt,Ne.width=Nt.naturalWidth,Ne.height=Nt.naturalHeight,Ne.channels=4;else if(Uf(Nt))Ne.element=Nt,Ne.width=Nt.videoWidth,Ne.height=Nt.videoHeight,Ne.channels=4;else if(qr(Nt)){var De=Ne.width||Nt[0].length,st=Ne.height||Nt.length,me=Ne.channels;Ha(Nt[0][0])?me=me||Nt[0][0].length:me=me||1;for(var lt=Kt.shape(Nt),Qt=1,ur=0;ur=0,"oes_texture_float extension not enabled"):Ne.type===wl&&k(je.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function vr(Ne,$t,Nt){var hn=Ne.element,bi=Ne.data,da=Ne.internalformat,ce=Ne.format,Te=Ne.type,Ve=Ne.width,Ut=Ne.height;ui(Ne),hn?z.texImage2D($t,Nt,ce,ce,Te,hn):Ne.compressed?z.compressedTexImage2D($t,Nt,da,Ve,Ut,0,bi):Ne.needsCopy?(jt(),z.copyTexImage2D($t,Nt,ce,Ne.xOffset,Ne.yOffset,Ve,Ut,0)):z.texImage2D($t,Nt,ce,Ve,Ut,0,ce,Te,bi||null)}function ot(Ne,$t,Nt,hn,bi){var da=Ne.element,ce=Ne.data,Te=Ne.internalformat,Ve=Ne.format,Ut=Ne.type,Bt=Ne.width,tt=Ne.height;ui(Ne),da?z.texSubImage2D($t,bi,Nt,hn,Ve,Ut,da):Ne.compressed?z.compressedTexSubImage2D($t,bi,Nt,hn,Te,Bt,tt,ce):Ne.needsCopy?(jt(),z.copyTexSubImage2D($t,bi,Nt,hn,Ne.xOffset,Ne.yOffset,Bt,tt)):z.texSubImage2D($t,bi,Nt,hn,Bt,tt,Ve,Ut,ce)}var Ci=[];function ln(){return Ci.pop()||new Qr}function yi(Ne){Ne.needsFree&&at.freeType(Ne.data),Qr.call(Ne),Ci.push(Ne)}function si(){br.call(this),this.genMipmaps=!1,this.mipmapHint=du,this.mipmask=0,this.images=Array(16)}function Qn(Ne,$t,Nt){var hn=Ne.images[0]=ln();Ne.mipmask=1,hn.width=Ne.width=$t,hn.height=Ne.height=Nt,hn.channels=Ne.channels=4}function Vi(Ne,$t){var Nt=null;if(Yo($t))Nt=Ne.images[0]=ln(),$r(Nt,Ne),yt(Nt,$t),Ne.mipmask=1;else if(Nn(Ne,$t),Array.isArray($t.mipmap))for(var hn=$t.mipmap,bi=0;bi>=bi,Nt.height>>=bi,yt(Nt,hn[bi]),Ne.mipmask|=1<=0&&!("faces"in $t)&&(Ne.genMipmaps=!0)}if("mag"in $t){var hn=$t.mag;k.parameter(hn,Vr),Ne.magFilter=Vr[hn]}var bi=Ne.wrapS,da=Ne.wrapT;if("wrap"in $t){var ce=$t.wrap;typeof ce=="string"?(k.parameter(ce,Cr),bi=da=Cr[ce]):Array.isArray(ce)&&(k.parameter(ce[0],Cr),k.parameter(ce[1],Cr),bi=Cr[ce[0]],da=Cr[ce[1]])}else{if("wrapS"in $t){var Te=$t.wrapS;k.parameter(Te,Cr),bi=Cr[Te]}if("wrapT"in $t){var Ve=$t.wrapT;k.parameter(Ve,Cr),da=Cr[Ve]}}if(Ne.wrapS=bi,Ne.wrapT=da,"anisotropic"in $t){var Ut=$t.anisotropic;k(typeof Ut=="number"&&Ut>=1&&Ut<=je.maxAnisotropic,"aniso samples must be between 1 and "),Ne.anisotropic=$t.anisotropic}if("mipmap"in $t){var Bt=!1;switch(typeof $t.mipmap){case"string":k.parameter($t.mipmap,Dr,"invalid mipmap hint"),Ne.mipmapHint=Dr[$t.mipmap],Ne.genMipmaps=!0,Bt=!0;break;case"boolean":Bt=Ne.genMipmaps=$t.mipmap;break;case"object":k(Array.isArray($t.mipmap),"invalid mipmap type"),Ne.genMipmaps=!1,Bt=!0;break;default:k.raise("invalid mipmap type")}Bt&&!("min"in $t)&&(Ne.minFilter=Oc)}}function xo(Ne,$t){z.texParameteri($t,ap,Ne.minFilter),z.texParameteri($t,bh,Ne.magFilter),z.texParameteri($t,Md,Ne.wrapS),z.texParameteri($t,Of,Ne.wrapT),Ae.ext_texture_filter_anisotropic&&z.texParameteri($t,Ca,Ne.anisotropic),Ne.genMipmaps&&(z.hint(kf,Ne.mipmapHint),z.generateMipmap($t))}var Ja=0,Mo={},ps=je.maxTextureUnits,Io=Array(ps).map(function(){return null});function xi(Ne){br.call(this),this.mipmask=0,this.internalformat=ql,this.id=Ja++,this.refCount=1,this.target=Ne,this.texture=z.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Sa,kt.profile&&(this.stats={size:0})}function es(Ne){z.activeTexture(Sh),z.bindTexture(Ne.target,Ne.texture)}function ua(){var Ne=Io[0];Ne?z.bindTexture(Ne.target,Ne.texture):z.bindTexture(xs,null)}function Xn(Ne){var $t=Ne.texture;k($t,"must not double destroy texture");var Nt=Ne.unit,hn=Ne.target;Nt>=0&&(z.activeTexture(Sh+Nt),z.bindTexture(hn,null),Io[Nt]=null),z.deleteTexture($t),Ne.texture=null,Ne.params=null,Ne.pixels=null,Ne.refCount=0,delete Mo[Ne.id],Gt.textureCount--}L(xi.prototype,{bind:function(){var Ne=this;Ne.bindCount+=1;var $t=Ne.unit;if($t<0){for(var Nt=0;Nt0)continue;hn.unit=-1}Io[Nt]=Ne,$t=Nt;break}$t>=ps&&k.raise("insufficient number of texture units"),kt.profile&&Gt.maxTextureUnits<$t+1&&(Gt.maxTextureUnits=$t+1),Ne.unit=$t,z.activeTexture(Sh+$t),z.bindTexture(Ne.target,Ne.texture)}return $t},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&Xn(this)}});function Oi(Ne,$t){var Nt=new xi(xs);Mo[Nt.id]=Nt,Gt.textureCount++;function hn(ce,Te){var Ve=Nt.texInfo;Sa.call(Ve);var Ut=Pi();return typeof ce=="number"?typeof Te=="number"?Qn(Ut,ce|0,Te|0):Qn(Ut,ce|0,ce|0):ce?(k.type(ce,"object","invalid arguments to regl.texture"),yo(Ve,ce),Vi(Ut,ce)):Qn(Ut,1,1),Ve.genMipmaps&&(Ut.mipmask=(Ut.width<<1)-1),Nt.mipmask=Ut.mipmask,$r(Nt,Ut),k.texture2D(Ve,Ut,je),Nt.internalformat=Ut.internalformat,hn.width=Ut.width,hn.height=Ut.height,es(Nt),_o(Ut,xs),xo(Ve,xs),ua(),fo(Ut),kt.profile&&(Nt.stats.size=Pt(Nt.internalformat,Nt.type,Ut.width,Ut.height,Ve.genMipmaps,!1)),hn.format=Fr[Nt.internalformat],hn.type=rn[Nt.type],hn.mag=yr[Ve.magFilter],hn.min=an[Ve.minFilter],hn.wrapS=Pr[Ve.wrapS],hn.wrapT=Pr[Ve.wrapT],hn}function bi(ce,Te,Ve,Ut){k(!!ce,"must specify image data");var Bt=Te|0,tt=Ve|0,ft=Ut|0,mt=ln();return $r(mt,Nt),mt.width=0,mt.height=0,yt(mt,ce),mt.width=mt.width||(Nt.width>>ft)-Bt,mt.height=mt.height||(Nt.height>>ft)-tt,k(Nt.type===mt.type&&Nt.format===mt.format&&Nt.internalformat===mt.internalformat,"incompatible format for texture.subimage"),k(Bt>=0&&tt>=0&&Bt+mt.width<=Nt.width&&tt+mt.height<=Nt.height,"texture.subimage write out of bounds"),k(Nt.mipmask&1<>Bt;++Bt){var tt=Ve>>Bt,ft=Ut>>Bt;if(!tt||!ft)break;z.texImage2D(xs,Bt,Nt.format,tt,ft,0,Nt.format,Nt.type,null)}return ua(),kt.profile&&(Nt.stats.size=Pt(Nt.internalformat,Nt.type,Ve,Ut,!1,!1)),hn}return hn(Ne,$t),hn.subimage=bi,hn.resize=da,hn._reglType="texture2d",hn._texture=Nt,kt.profile&&(hn.stats=Nt.stats),hn.destroy=function(){Nt.decRef()},hn}function Xi(Ne,$t,Nt,hn,bi,da){var ce=new xi(Fu);Mo[ce.id]=ce,Gt.cubeCount++;var Te=new Array(6);function Ve(tt,ft,mt,De,st,me){var lt,Qt=ce.texInfo;for(Sa.call(Qt),lt=0;lt<6;++lt)Te[lt]=Pi();if(typeof tt=="number"||!tt){var ur=tt|0||1;for(lt=0;lt<6;++lt)Qn(Te[lt],ur,ur)}else if(typeof tt=="object")if(ft)Vi(Te[0],tt),Vi(Te[1],ft),Vi(Te[2],mt),Vi(Te[3],De),Vi(Te[4],st),Vi(Te[5],me);else if(yo(Qt,tt),Nn(ce,tt),"faces"in tt){var xr=tt.faces;for(k(Array.isArray(xr)&&xr.length===6,"cube faces must be a length 6 array"),lt=0;lt<6;++lt)k(typeof xr[lt]=="object"&&!!xr[lt],"invalid input for cube map face"),$r(Te[lt],ce),Vi(Te[lt],xr[lt])}else for(lt=0;lt<6;++lt)Vi(Te[lt],tt);else k.raise("invalid arguments to cube map");for($r(ce,Te[0]),je.npotTextureCube||k(ef(ce.width)&&ef(ce.height),"your browser does not support non power or two texture dimensions"),Qt.genMipmaps?ce.mipmask=(Te[0].width<<1)-1:ce.mipmask=Te[0].mipmask,k.textureCube(ce,Qt,Te,je),ce.internalformat=Te[0].internalformat,Ve.width=Te[0].width,Ve.height=Te[0].height,es(ce),lt=0;lt<6;++lt)_o(Te[lt],ku+lt);for(xo(Qt,Fu),ua(),kt.profile&&(ce.stats.size=Pt(ce.internalformat,ce.type,Ve.width,Ve.height,Qt.genMipmaps,!0)),Ve.format=Fr[ce.internalformat],Ve.type=rn[ce.type],Ve.mag=yr[Qt.magFilter],Ve.min=an[Qt.minFilter],Ve.wrapS=Pr[Qt.wrapS],Ve.wrapT=Pr[Qt.wrapT],lt=0;lt<6;++lt)fo(Te[lt]);return Ve}function Ut(tt,ft,mt,De,st){k(!!ft,"must specify image data"),k(typeof tt=="number"&&tt===(tt|0)&&tt>=0&&tt<6,"invalid face");var me=mt|0,lt=De|0,Qt=st|0,ur=ln();return $r(ur,ce),ur.width=0,ur.height=0,yt(ur,ft),ur.width=ur.width||(ce.width>>Qt)-me,ur.height=ur.height||(ce.height>>Qt)-lt,k(ce.type===ur.type&&ce.format===ur.format&&ce.internalformat===ur.internalformat,"incompatible format for texture.subimage"),k(me>=0&<>=0&&me+ur.width<=ce.width&<+ur.height<=ce.height,"texture.subimage write out of bounds"),k(ce.mipmask&1<>De;++De)z.texImage2D(ku+mt,De,ce.format,ft>>De,ft>>De,0,ce.format,ce.type,null);return ua(),kt.profile&&(ce.stats.size=Pt(ce.internalformat,ce.type,Ve.width,Ve.height,!1,!0)),Ve}}return Ve(Ne,$t,Nt,hn,bi,da),Ve.subimage=Ut,Ve.resize=Bt,Ve._reglType="textureCube",Ve._texture=ce,kt.profile&&(Ve.stats=ce.stats),Ve.destroy=function(){ce.decRef()},Ve}function bo(){for(var Ne=0;Ne>hn,Nt.height>>hn,0,Nt.internalformat,Nt.type,null);else for(var bi=0;bi<6;++bi)z.texImage2D(ku+bi,hn,Nt.internalformat,Nt.width>>hn,Nt.height>>hn,0,Nt.internalformat,Nt.type,null);xo(Nt.texInfo,Nt.target)})}return{create2D:Oi,createCube:Xi,clear:bo,getTexture:function(Ne){return null},restore:Xu}}var B=36161,qs=32854,ge=32855,Bo=36194,io=33189,vu=36168,bs=34041,Da=35907,nc=34836,kn=34842,yn=34843,Ls=[];Ls[qs]=2,Ls[ge]=2,Ls[Bo]=2,Ls[io]=2,Ls[vu]=1,Ls[bs]=4,Ls[Da]=4,Ls[nc]=16,Ls[kn]=8,Ls[yn]=6;function qo(z,Ae,je){return Ls[z]*Ae*je}var mu=function(z,Ae,je,jt,pr){var Gt={rgba4:qs,rgb565:Bo,"rgb5 a1":ge,depth:io,stencil:vu,"depth stencil":bs};Ae.ext_srgb&&(Gt.srgba=Da),Ae.ext_color_buffer_half_float&&(Gt.rgba16f=kn,Gt.rgb16f=yn),Ae.webgl_color_buffer_float&&(Gt.rgba32f=nc);var kt=[];Object.keys(Gt).forEach(function(Ar){var zr=Gt[Ar];kt[zr]=Ar});var Dr=0,Cr={};function Vr(Ar){this.id=Dr++,this.refCount=1,this.renderbuffer=Ar,this.format=qs,this.width=0,this.height=0,pr.profile&&(this.stats={size:0})}Vr.prototype.decRef=function(){--this.refCount<=0&&Br(this)};function Br(Ar){var zr=Ar.renderbuffer;k(zr,"must not double destroy renderbuffer"),z.bindRenderbuffer(B,null),z.deleteRenderbuffer(zr),Ar.renderbuffer=null,Ar.refCount=0,delete Cr[Ar.id],jt.renderbufferCount--}function Ur(Ar,zr){var Tt=new Vr(z.createRenderbuffer());Cr[Tt.id]=Tt,jt.renderbufferCount++;function er(rn,yr){var an=0,Pr=0,nn=qs;if(typeof rn=="object"&&rn){var br=rn;if("shape"in br){var $r=br.shape;k(Array.isArray($r)&&$r.length>=2,"invalid renderbuffer shape"),an=$r[0]|0,Pr=$r[1]|0}else"radius"in br&&(an=Pr=br.radius|0),"width"in br&&(an=br.width|0),"height"in br&&(Pr=br.height|0);"format"in br&&(k.parameter(br.format,Gt,"invalid renderbuffer format"),nn=Gt[br.format])}else typeof rn=="number"?(an=rn|0,typeof yr=="number"?Pr=yr|0:Pr=an):rn?k.raise("invalid arguments to renderbuffer constructor"):an=Pr=1;if(k(an>0&&Pr>0&&an<=je.maxRenderbufferSize&&Pr<=je.maxRenderbufferSize,"invalid renderbuffer size"),!(an===Tt.width&&Pr===Tt.height&&nn===Tt.format))return er.width=Tt.width=an,er.height=Tt.height=Pr,Tt.format=nn,z.bindRenderbuffer(B,Tt.renderbuffer),z.renderbufferStorage(B,nn,an,Pr),k(z.getError()===0,"invalid render buffer format"),pr.profile&&(Tt.stats.size=qo(Tt.format,Tt.width,Tt.height)),er.format=kt[Tt.format],er}function Fr(rn,yr){var an=rn|0,Pr=yr|0||an;return an===Tt.width&&Pr===Tt.height||(k(an>0&&Pr>0&&an<=je.maxRenderbufferSize&&Pr<=je.maxRenderbufferSize,"invalid renderbuffer size"),er.width=Tt.width=an,er.height=Tt.height=Pr,z.bindRenderbuffer(B,Tt.renderbuffer),z.renderbufferStorage(B,Tt.format,an,Pr),k(z.getError()===0,"invalid render buffer format"),pr.profile&&(Tt.stats.size=qo(Tt.format,Tt.width,Tt.height))),er}return er(Ar,zr),er.resize=Fr,er._reglType="renderbuffer",er._renderbuffer=Tt,pr.profile&&(er.stats=Tt.stats),er.destroy=function(){Tt.decRef()},er}pr.profile&&(jt.getTotalRenderbufferSize=function(){var Ar=0;return Object.keys(Cr).forEach(function(zr){Ar+=Cr[zr].stats.size}),Ar});function Gr(){ea(Cr).forEach(function(Ar){Ar.renderbuffer=z.createRenderbuffer(),z.bindRenderbuffer(B,Ar.renderbuffer),z.renderbufferStorage(B,Ar.format,Ar.width,Ar.height)}),z.bindRenderbuffer(B,null)}return{create:Ur,clear:function(){ea(Cr).forEach(Br)},restore:Gr}},Fa=36160,Ns=36161,Ks=3553,Fc=34069,ra=36064,wo=36096,Ch=36128,Pl=33306,zf=36053,gu=36054,Es=36055,ic=36057,Nu=36061,Zf=36193,kc=5121,cf=5126,Vf=6407,ac=6408,oc=6402,Uu=[Vf,ac],zu=[];zu[ac]=4,zu[Vf]=3;var tu=[];tu[kc]=1,tu[cf]=4,tu[Zf]=2;var jf=32854,Ol=32855,ru=36194,Dl=33189,ff=36168,Rh=34041,Hf=35907,h=34836,d=34842,p=34843,g=[jf,Ol,ru,Hf,d,p,h],S={};S[zf]="complete",S[gu]="incomplete attachment",S[ic]="incomplete dimensions",S[Es]="incomplete, missing attachment",S[Nu]="unsupported";function w(z,Ae,je,jt,pr,Gt){var kt={cur:null,next:null,dirty:!1,setFBO:null},Dr=["rgba"],Cr=["rgba4","rgb565","rgb5 a1"];Ae.ext_srgb&&Cr.push("srgba"),Ae.ext_color_buffer_half_float&&Cr.push("rgba16f","rgb16f"),Ae.webgl_color_buffer_float&&Cr.push("rgba32f");var Vr=["uint8"];Ae.oes_texture_half_float&&Vr.push("half float","float16"),Ae.oes_texture_float&&Vr.push("float","float32");function Br(Qr,yt,vr){this.target=Qr,this.texture=yt,this.renderbuffer=vr;var ot=0,Ci=0;yt?(ot=yt.width,Ci=yt.height):vr&&(ot=vr.width,Ci=vr.height),this.width=ot,this.height=Ci}function Ur(Qr){Qr&&(Qr.texture&&Qr.texture._texture.decRef(),Qr.renderbuffer&&Qr.renderbuffer._renderbuffer.decRef())}function Gr(Qr,yt,vr){if(Qr)if(Qr.texture){var ot=Qr.texture._texture,Ci=Math.max(1,ot.width),ln=Math.max(1,ot.height);k(Ci===yt&&ln===vr,"inconsistent width/height for supplied texture"),ot.refCount+=1}else{var yi=Qr.renderbuffer._renderbuffer;k(yi.width===yt&&yi.height===vr,"inconsistent width/height for renderbuffer"),yi.refCount+=1}}function Ar(Qr,yt){yt&&(yt.texture?z.framebufferTexture2D(Fa,Qr,yt.target,yt.texture._texture.texture,0):z.framebufferRenderbuffer(Fa,Qr,Ns,yt.renderbuffer._renderbuffer.renderbuffer))}function zr(Qr){var yt=Ks,vr=null,ot=null,Ci=Qr;typeof Qr=="object"&&(Ci=Qr.data,"target"in Qr&&(yt=Qr.target|0)),k.type(Ci,"function","invalid attachment data");var ln=Ci._reglType;return ln==="texture2d"?(vr=Ci,k(yt===Ks)):ln==="textureCube"?(vr=Ci,k(yt>=Fc&&yt=2,"invalid shape for framebuffer"),Qn=es[0],Vi=es[1]}else"radius"in xi&&(Qn=Vi=xi.radius),"width"in xi&&(Qn=xi.width),"height"in xi&&(Vi=xi.height);("color"in xi||"colors"in xi)&&(Pi=xi.color||xi.colors,Array.isArray(Pi)&&k(Pi.length===1||Ae.webgl_draw_buffers,"multiple render targets not supported")),Pi||("colorCount"in xi&&(xo=xi.colorCount|0,k(xo>0,"invalid color buffer count")),"colorTexture"in xi&&(fo=!!xi.colorTexture,Sa="rgba4"),"colorType"in xi&&(yo=xi.colorType,fo?(k(Ae.oes_texture_float||!(yo==="float"||yo==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),k(Ae.oes_texture_half_float||!(yo==="half float"||yo==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):yo==="half float"||yo==="float16"?(k(Ae.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),Sa="rgba16f"):(yo==="float"||yo==="float32")&&(k(Ae.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),Sa="rgba32f"),k.oneOf(yo,Vr,"invalid color type")),"colorFormat"in xi&&(Sa=xi.colorFormat,Dr.indexOf(Sa)>=0?fo=!0:Cr.indexOf(Sa)>=0?fo=!1:fo?k.oneOf(xi.colorFormat,Dr,"invalid color format for texture"):k.oneOf(xi.colorFormat,Cr,"invalid color format for renderbuffer"))),("depthTexture"in xi||"depthStencilTexture"in xi)&&(Io=!!(xi.depthTexture||xi.depthStencilTexture),k(!Io||Ae.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in xi&&(typeof xi.depth=="boolean"?_o=xi.depth:(Ja=xi.depth,Wo=!1)),"stencil"in xi&&(typeof xi.stencil=="boolean"?Wo=xi.stencil:(Mo=xi.stencil,_o=!1)),"depthStencil"in xi&&(typeof xi.depthStencil=="boolean"?_o=Wo=xi.depthStencil:(ps=xi.depthStencil,_o=!1,Wo=!1))}var ua=null,Xn=null,Oi=null,Xi=null;if(Array.isArray(Pi))ua=Pi.map(zr);else if(Pi)ua=[zr(Pi)];else for(ua=new Array(xo),si=0;si=0||ua[si].renderbuffer&&g.indexOf(ua[si].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+si+" is invalid"),ua[si]&&ua[si].texture){var Xu=zu[ua[si].texture._texture.format]*tu[ua[si].texture._texture.type];bo===null?bo=Xu:k(bo===Xu,"all color attachments much have the same number of bits per pixel.")}return Gr(Xn,Qn,Vi),k(!Xn||Xn.texture&&Xn.texture._texture.format===oc||Xn.renderbuffer&&Xn.renderbuffer._renderbuffer.format===Dl,"invalid depth attachment for framebuffer object"),Gr(Oi,Qn,Vi),k(!Oi||Oi.renderbuffer&&Oi.renderbuffer._renderbuffer.format===ff,"invalid stencil attachment for framebuffer object"),Gr(Xi,Qn,Vi),k(!Xi||Xi.texture&&Xi.texture._texture.format===Rh||Xi.renderbuffer&&Xi.renderbuffer._renderbuffer.format===Rh,"invalid depth-stencil attachment for framebuffer object"),Pr(vr),vr.width=Qn,vr.height=Vi,vr.colorAttachments=ua,vr.depthAttachment=Xn,vr.stencilAttachment=Oi,vr.depthStencilAttachment=Xi,ot.color=ua.map(er),ot.depth=er(Xn),ot.stencil=er(Oi),ot.depthStencil=er(Xi),ot.width=vr.width,ot.height=vr.height,br(vr),ot}function Ci(ln,yi){k(kt.next!==vr,"can not resize a framebuffer which is currently in use");var si=Math.max(ln|0,1),Qn=Math.max(yi|0||si,1);if(si===vr.width&&Qn===vr.height)return ot;for(var Vi=vr.colorAttachments,_o=0;_o=2,"invalid shape for framebuffer"),k(fo[0]===fo[1],"cube framebuffer must be square"),si=fo[0]}else"radius"in Pi&&(si=Pi.radius|0),"width"in Pi?(si=Pi.width|0,"height"in Pi&&k(Pi.height===si,"must be square")):"height"in Pi&&(si=Pi.height|0);("color"in Pi||"colors"in Pi)&&(Qn=Pi.color||Pi.colors,Array.isArray(Qn)&&k(Qn.length===1||Ae.webgl_draw_buffers,"multiple render targets not supported")),Qn||("colorCount"in Pi&&(Wo=Pi.colorCount|0,k(Wo>0,"invalid color buffer count")),"colorType"in Pi&&(k.oneOf(Pi.colorType,Vr,"invalid color type"),_o=Pi.colorType),"colorFormat"in Pi&&(Vi=Pi.colorFormat,k.oneOf(Pi.colorFormat,Dr,"invalid color format for texture"))),"depth"in Pi&&(yi.depth=Pi.depth),"stencil"in Pi&&(yi.stencil=Pi.stencil),"depthStencil"in Pi&&(yi.depthStencil=Pi.depthStencil)}var Sa;if(Qn)if(Array.isArray(Qn))for(Sa=[],ln=0;ln0&&(yi.depth=yt[0].depth,yi.stencil=yt[0].stencil,yi.depthStencil=yt[0].depthStencil),yt[ln]?yt[ln](yi):yt[ln]=$r(yi)}return L(vr,{width:si,height:si,color:Sa})}function ot(Ci){var ln,yi=Ci|0;if(k(yi>0&&yi<=je.maxCubeMapSize,"invalid radius for cube fbo"),yi===vr.width)return vr;var si=vr.color;for(ln=0;ln0,"must specify at least one attribute");for(var Nn=0;Nn=1&&vr.size<=4,"size must be between 1 and 4"),k(vr.offset>=0,"invalid offset"),k(vr.stride>=0&&vr.stride<=255,"stride must be between 0 and 255"),k(vr.divisor>=0,"divisor must be positive"),k(!vr.divisor||!!Ae.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in yt?(k(Qr>0,"first attribute must not be a constant"),vr.x=+yt.x||0,vr.y=+yt.y||0,vr.z=+yt.z||0,vr.w=+yt.w||0,vr.state=2):k(!1,"invalid attribute spec for location "+Qr)}return nn.refresh(),br}return br.destroy=function(){nn.destroy()},br._vao=nn,br._reglType="vao",br(Pr)}return Br}var pe=35632,_e=35633,ye=35718,Ue=35721;function ke(z,Ae,je,jt){var pr={},Gt={};function kt(Tt,er,Fr,rn){this.name=Tt,this.id=er,this.location=Fr,this.info=rn}function Dr(Tt,er){for(var Fr=0;Fr1)for(var ui=0;uiTt&&(Tt=er.stats.uniformsCount)}),Tt},je.getMaxAttributesCount=function(){var Tt=0;return Br.forEach(function(er){er.stats.attributesCount>Tt&&(Tt=er.stats.attributesCount)}),Tt});function zr(){pr={},Gt={};for(var Tt=0;Tt=0,"missing vertex shader",Fr),k.command(er>=0,"missing fragment shader",Fr);var yr=Vr[er];yr||(yr=Vr[er]={});var an=yr[Tt];if(an&&!rn)return an;var Pr=new Gr(er,Tt);return je.shaderCount++,Ar(Pr,Fr,rn),an||(yr[Tt]=Pr),Br.push(Pr),Pr},restore:zr,shader:Cr,frag:-1,vert:-1}}var Ke=6408,Ie=5121,$e=3333,vt=5126;function Rt(z,Ae,je,jt,pr,Gt,kt){function Dr(Br){var Ur;Ae.next===null?(k(pr.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),Ur=Ie):(k(Ae.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),Ur=Ae.next.colorAttachments[0].texture._texture.type,Gt.oes_texture_float?(k(Ur===Ie||Ur===vt,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),Ur===vt&&k(kt.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):k(Ur===Ie,"Reading from a framebuffer is only allowed for the type 'uint8'"));var Gr=0,Ar=0,zr=jt.framebufferWidth,Tt=jt.framebufferHeight,er=null;ee(Br)?er=Br:Br&&(k.type(Br,"object","invalid arguments to regl.read()"),Gr=Br.x|0,Ar=Br.y|0,k(Gr>=0&&Gr=0&&Ar0&&zr+Gr<=jt.framebufferWidth,"invalid width for read pixels"),k(Tt>0&&Tt+Ar<=jt.framebufferHeight,"invalid height for read pixels"),je();var Fr=zr*Tt*4;return er||(Ur===Ie?er=new Uint8Array(Fr):Ur===vt&&(er=er||new Float32Array(Fr))),k.isTypedArray(er,"data buffer for regl.read() must be a typedarray"),k(er.byteLength>=Fr,"data buffer for regl.read() too small"),z.pixelStorei($e,4),z.readPixels(Gr,Ar,zr,Tt,Ke,Ur,er),er}function Cr(Br){var Ur;return Ae.setFBO({framebuffer:Br.framebuffer},function(){Ur=Dr(Br)}),Ur}function Vr(Br){return!Br||!("framebuffer"in Br)?Dr(Br):Cr(Br)}return Vr}function Jt(z){return Array.prototype.slice.call(z)}function zt(z){return Jt(z).join("")}function ar(){var z=0,Ae=[],je=[];function jt(Ur){for(var Gr=0;Gr0&&(Ur.push(Tt,"="),Ur.push.apply(Ur,Jt(arguments)),Ur.push(";")),Tt}return L(Gr,{def:zr,toString:function(){return zt([Ar.length>0?"var "+Ar.join(",")+";":"",zt(Ur)])}})}function Gt(){var Ur=pr(),Gr=pr(),Ar=Ur.toString,zr=Gr.toString;function Tt(er,Fr){Gr(er,Fr,"=",Ur.def(er,Fr),";")}return L(function(){Ur.apply(Ur,Jt(arguments))},{def:Ur.def,entry:Ur,exit:Gr,save:Tt,set:function(er,Fr,rn){Tt(er,Fr),Ur(er,Fr,"=",rn,";")},toString:function(){return Ar()+zr()}})}function kt(){var Ur=zt(arguments),Gr=Gt(),Ar=Gt(),zr=Gr.toString,Tt=Ar.toString;return L(Gr,{then:function(){return Gr.apply(Gr,Jt(arguments)),this},else:function(){return Ar.apply(Ar,Jt(arguments)),this},toString:function(){var er=Tt();return er&&(er="else{"+er+"}"),zt(["if(",Ur,"){",zr(),"}",er])}})}var Dr=pr(),Cr={};function Vr(Ur,Gr){var Ar=[];function zr(){var yr="a"+Ar.length;return Ar.push(yr),yr}Gr=Gr||0;for(var Tt=0;Tt":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},fc={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Xp={frag:Bv,vert:jp},Ul={cw:pp,ccw:Ph};function Gf(z){return Array.isArray(z)||ee(z)||Ea(z)}function vp(z){return z.sort(function(Ae,je){return Ae===Ko?-1:je===Ko?1:Ae=1,jt>=2,Ae)}else if(je===vn){var pr=z.data;return new Ts(pr.thisDep,pr.contextDep,pr.propDep,Ae)}else return new Ts(je===Wi,je===Zn,je===zn,Ae)}var $p=new Ts(!1,!1,!1,function(){});function Xf(z,Ae,je,jt,pr,Gt,kt,Dr,Cr,Vr,Br,Ur,Gr,Ar,zr){var Tt=Vr.Record,er={add:32774,subtract:32778,"reverse subtract":32779};je.ext_blend_minmax&&(er.min=Wp,er.max=xf);var Fr=je.angle_instanced_arrays,rn=je.webgl_draw_buffers,yr={dirty:!0,profile:zr.profile},an={},Pr=[],nn={},br={};function $r(ce){return ce.replace(".","_")}function Nn(ce,Te,Ve){var Ut=$r(ce);Pr.push(ce),an[Ut]=yr[Ut]=!!Ve,nn[Ut]=Te}function ui(ce,Te,Ve){var Ut=$r(ce);Pr.push(ce),Array.isArray(Ve)?(yr[Ut]=Ve.slice(),an[Ut]=Ve.slice()):yr[Ut]=an[Ut]=Ve,br[Ut]=Te}Nn(ei,Nc),Nn(_i,Pd),ui(ri,"blendColor",[0,0,0,0]),ui(qn,"blendEquationSeparate",[Gp,Gp]),ui(di,"blendFuncSeparate",[Oh,kd,Oh,kd]),Nn(Jn,Od,!0),ui(Kn,"depthFunc",dp),ui(Co,"depthRange",[0,1]),ui(Ua,"depthMask",!0),ui(Ro,Ro,[!0,!0,!0,!0]),Nn(Lo,lp),ui(Ga,"cullFace",yf),ui(Xa,Xa,Ph),ui(Ss,Ss,1),Nn(ls,Hp),ui(Zu,"polygonOffset",[0,0]),Nn(cs,Dd),Nn(nu,Jm),ui(Us,"sampleCoverage",[1,!1]),Nn(sl,Mh),ui(Fl,"stencilMask",-1),ui(ul,"stencilFunc",[fl,0,-1]),ui(kl,"stencilOpSeparate",[lc,Nl,Nl,Nl]),ui(Vu,"stencilOpSeparate",[yf,Nl,Nl,Nl]),Nn(iu,Qm),ui(ju,"scissor",[0,0,z.drawingBufferWidth,z.drawingBufferHeight]),ui(Ko,Ko,[0,0,z.drawingBufferWidth,z.drawingBufferHeight]);var Qr={gl:z,context:Gr,strings:Ae,next:an,current:yr,draw:Ur,elements:Gt,buffer:pr,shader:Br,attributes:Vr.state,vao:Vr,uniforms:Cr,framebuffer:Dr,extensions:je,timer:Ar,isBufferArgs:Gf},yt={primTypes:Pu,compareFuncs:bf,blendFuncs:hl,blendEquations:er,stencilOps:fc,glTypes:jo,orientationType:Ul};k.optional(function(){Qr.isArrayLike=Ha}),rn&&(yt.backBuffer=[yf],yt.drawBuffer=hi(jt.maxDrawbuffers,function(ce){return ce===0?[0]:hi(ce,function(Te){return Bd+Te})}));var vr=0;function ot(){var ce=ar(),Te=ce.link,Ve=ce.global;ce.id=vr++,ce.batchId="0";var Ut=Te(Qr),Bt=ce.shared={props:"a0"};Object.keys(Qr).forEach(function(st){Bt[st]=Ve.def(Ut,".",st)}),k.optional(function(){ce.CHECK=Te(k),ce.commandStr=k.guessCommand(),ce.command=Te(ce.commandStr),ce.assert=function(st,me,lt){st("if(!(",me,"))",this.CHECK,".commandRaise(",Te(lt),",",this.command,");")},yt.invalidBlendCombinations=pl});var tt=ce.next={},ft=ce.current={};Object.keys(br).forEach(function(st){Array.isArray(yr[st])&&(tt[st]=Ve.def(Bt.next,".",st),ft[st]=Ve.def(Bt.current,".",st))});var mt=ce.constants={};Object.keys(yt).forEach(function(st){mt[st]=Ve.def(JSON.stringify(yt[st]))}),ce.invoke=function(st,me){switch(me.type){case Pn:var lt=["this",Bt.context,Bt.props,ce.batchId];return st.def(Te(me.data),".call(",lt.slice(0,Math.max(me.data.length+1,4)),")");case zn:return st.def(Bt.props,me.data);case Zn:return st.def(Bt.context,me.data);case Wi:return st.def("this",me.data);case vn:return me.data.append(ce,st),me.data.ref}},ce.attribCache={};var De={};return ce.scopeAttrib=function(st){var me=Ae.id(st);if(me in De)return De[me];var lt=Vr.scope[me];lt||(lt=Vr.scope[me]=new Tt);var Qt=De[me]=Te(lt);return Qt},ce}function Ci(ce){var Te=ce.static,Ve=ce.dynamic,Ut;if(Qa in Te){var Bt=!!Te[Qa];Ut=go(function(ft,mt){return Bt}),Ut.enable=Bt}else if(Qa in Ve){var tt=Ve[Qa];Ut=zs(tt,function(ft,mt){return ft.invoke(mt,tt)})}return Ut}function ln(ce,Te){var Ve=ce.static,Ut=ce.dynamic;if(As in Ve){var Bt=Ve[As];return Bt?(Bt=Dr.getFramebuffer(Bt),k.command(Bt,"invalid framebuffer object"),go(function(ft,mt){var De=ft.link(Bt),st=ft.shared;mt.set(st.framebuffer,".next",De);var me=st.context;return mt.set(me,"."+Wu,De+".width"),mt.set(me,"."+Gu,De+".height"),De})):go(function(ft,mt){var De=ft.shared;mt.set(De.framebuffer,".next","null");var st=De.context;return mt.set(st,"."+Wu,st+"."+Qo),mt.set(st,"."+Gu,st+"."+sc),"null"})}else if(As in Ut){var tt=Ut[As];return zs(tt,function(ft,mt){var De=ft.invoke(mt,tt),st=ft.shared,me=st.framebuffer,lt=mt.def(me,".getFramebuffer(",De,")");k.optional(function(){ft.assert(mt,"!"+De+"||"+lt,"invalid framebuffer object")}),mt.set(me,".next",lt);var Qt=st.context;return mt.set(Qt,"."+Wu,lt+"?"+lt+".width:"+Qt+"."+Qo),mt.set(Qt,"."+Gu,lt+"?"+lt+".height:"+Qt+"."+sc),lt})}else return null}function yi(ce,Te,Ve){var Ut=ce.static,Bt=ce.dynamic;function tt(De){if(De in Ut){var st=Ut[De];k.commandType(st,"object","invalid "+De,Ve.commandStr);var me=!0,lt=st.x|0,Qt=st.y|0,ur,xr;return"width"in st?(ur=st.width|0,k.command(ur>=0,"invalid "+De,Ve.commandStr)):me=!1,"height"in st?(xr=st.height|0,k.command(xr>=0,"invalid "+De,Ve.commandStr)):me=!1,new Ts(!me&&Te&&Te.thisDep,!me&&Te&&Te.contextDep,!me&&Te&&Te.propDep,function(On,xn){var Tn=On.shared.context,$n=ur;"width"in st||($n=xn.def(Tn,".",Wu,"-",lt));var ii=xr;return"height"in st||(ii=xn.def(Tn,".",Gu,"-",Qt)),[lt,Qt,$n,ii]})}else if(De in Bt){var gr=Bt[De],Mr=zs(gr,function(On,xn){var Tn=On.invoke(xn,gr);k.optional(function(){On.assert(xn,Tn+"&&typeof "+Tn+'==="object"',"invalid "+De)});var $n=On.shared.context,ii=xn.def(Tn,".x|0"),na=xn.def(Tn,".y|0"),Eo=xn.def('"width" in ',Tn,"?",Tn,".width|0:","(",$n,".",Wu,"-",ii,")"),dl=xn.def('"height" in ',Tn,"?",Tn,".height|0:","(",$n,".",Gu,"-",na,")");return k.optional(function(){On.assert(xn,Eo+">=0&&"+dl+">=0","invalid "+De)}),[ii,na,Eo,dl]});return Te&&(Mr.thisDep=Mr.thisDep||Te.thisDep,Mr.contextDep=Mr.contextDep||Te.contextDep,Mr.propDep=Mr.propDep||Te.propDep),Mr}else return Te?new Ts(Te.thisDep,Te.contextDep,Te.propDep,function(On,xn){var Tn=On.shared.context;return[0,0,xn.def(Tn,".",Wu),xn.def(Tn,".",Gu)]}):null}var ft=tt(Ko);if(ft){var mt=ft;ft=new Ts(ft.thisDep,ft.contextDep,ft.propDep,function(De,st){var me=mt.append(De,st),lt=De.shared.context;return st.set(lt,"."+oo,me[2]),st.set(lt,"."+Ll,me[3]),me})}return{viewport:ft,scissor_box:tt(ju)}}function si(ce,Te){var Ve=ce.static,Ut=typeof Ve[Hu]=="string"&&typeof Ve[au]=="string";if(Ut){if(Object.keys(Te.dynamic).length>0)return null;var Bt=Te.static,tt=Object.keys(Bt);if(tt.length>0&&typeof Bt[tt[0]]=="number"){for(var ft=[],mt=0;mt=0,"invalid "+me,Te.commandStr),go(function(xr,gr){return lt&&(xr.OFFSET=Qt),Qt})}else if(me in Ut){var ur=Ut[me];return zs(ur,function(xr,gr){var Mr=xr.invoke(gr,ur);return lt&&(xr.OFFSET=Mr,k.optional(function(){xr.assert(gr,Mr+">=0","invalid "+me)})),Mr})}else if(lt&&tt)return go(function(xr,gr){return xr.OFFSET="0",0});return null}var De=mt(ou,!0);function st(){if(ao in Ve){var me=Ve[ao]|0;return k.command(typeof me=="number"&&me>=0,"invalid vertex count",Te.commandStr),go(function(){return me})}else if(ao in Ut){var lt=Ut[ao];return zs(lt,function(xr,gr){var Mr=xr.invoke(gr,lt);return k.optional(function(){xr.assert(gr,"typeof "+Mr+'==="number"&&'+Mr+">=0&&"+Mr+"===("+Mr+"|0)","invalid vertex count")}),Mr})}else if(tt)if(hs(tt)){if(tt)return De?new Ts(De.thisDep,De.contextDep,De.propDep,function(xr,gr){var Mr=gr.def(xr.ELEMENTS,".vertCount-",xr.OFFSET);return k.optional(function(){xr.assert(gr,Mr+">=0","invalid vertex offset/element buffer too small")}),Mr}):go(function(xr,gr){return gr.def(xr.ELEMENTS,".vertCount")});var Qt=go(function(){return-1});return k.optional(function(){Qt.MISSING=!0}),Qt}else{var ur=new Ts(tt.thisDep||De.thisDep,tt.contextDep||De.contextDep,tt.propDep||De.propDep,function(xr,gr){var Mr=xr.ELEMENTS;return xr.OFFSET?gr.def(Mr,"?",Mr,".vertCount-",xr.OFFSET,":-1"):gr.def(Mr,"?",Mr,".vertCount:-1")});return k.optional(function(){ur.DYNAMIC=!0}),ur}return null}return{elements:tt,primitive:ft(),count:st(),instances:mt(Bc,!1),offset:De}}function _o(ce,Te){var Ve=ce.static,Ut=ce.dynamic,Bt={};return Pr.forEach(function(tt){var ft=$r(tt);function mt(De,st){if(tt in Ve){var me=De(Ve[tt]);Bt[ft]=go(function(){return me})}else if(tt in Ut){var lt=Ut[tt];Bt[ft]=zs(lt,function(Qt,ur){return st(Qt,ur,Qt.invoke(ur,lt))})}}switch(tt){case Lo:case _i:case ei:case sl:case Jn:case iu:case ls:case cs:case nu:case Ua:return mt(function(De){return k.commandType(De,"boolean",tt,Te.commandStr),De},function(De,st,me){return k.optional(function(){De.assert(st,"typeof "+me+'==="boolean"',"invalid flag "+tt,De.commandStr)}),me});case Kn:return mt(function(De){return k.commandParameter(De,bf,"invalid "+tt,Te.commandStr),bf[De]},function(De,st,me){var lt=De.constants.compareFuncs;return k.optional(function(){De.assert(st,me+" in "+lt,"invalid "+tt+", must be one of "+Object.keys(bf))}),st.def(lt,"[",me,"]")});case Co:return mt(function(De){return k.command(Ha(De)&&De.length===2&&typeof De[0]=="number"&&typeof De[1]=="number"&&De[0]<=De[1],"depth range is 2d array",Te.commandStr),De},function(De,st,me){k.optional(function(){De.assert(st,De.shared.isArrayLike+"("+me+")&&"+me+".length===2&&typeof "+me+'[0]==="number"&&typeof '+me+'[1]==="number"&&'+me+"[0]<="+me+"[1]","depth range must be a 2d array")});var lt=st.def("+",me,"[0]"),Qt=st.def("+",me,"[1]");return[lt,Qt]});case di:return mt(function(De){k.commandType(De,"object","blend.func",Te.commandStr);var st="srcRGB"in De?De.srcRGB:De.src,me="srcAlpha"in De?De.srcAlpha:De.src,lt="dstRGB"in De?De.dstRGB:De.dst,Qt="dstAlpha"in De?De.dstAlpha:De.dst;return k.commandParameter(st,hl,ft+".srcRGB",Te.commandStr),k.commandParameter(me,hl,ft+".srcAlpha",Te.commandStr),k.commandParameter(lt,hl,ft+".dstRGB",Te.commandStr),k.commandParameter(Qt,hl,ft+".dstAlpha",Te.commandStr),k.command(pl.indexOf(st+", "+lt)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+st+", "+lt+")",Te.commandStr),[hl[st],hl[lt],hl[me],hl[Qt]]},function(De,st,me){var lt=De.constants.blendFuncs;k.optional(function(){De.assert(st,me+"&&typeof "+me+'==="object"',"invalid blend func, must be an object")});function Qt(Tn,$n){var ii=st.def('"',Tn,$n,'" in ',me,"?",me,".",Tn,$n,":",me,".",Tn);return k.optional(function(){De.assert(st,ii+" in "+lt,"invalid "+tt+"."+Tn+$n+", must be one of "+Object.keys(hl))}),ii}var ur=Qt("src","RGB"),xr=Qt("dst","RGB");k.optional(function(){var Tn=De.constants.invalidBlendCombinations;De.assert(st,Tn+".indexOf("+ur+'+", "+'+xr+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var gr=st.def(lt,"[",ur,"]"),Mr=st.def(lt,"[",Qt("src","Alpha"),"]"),On=st.def(lt,"[",xr,"]"),xn=st.def(lt,"[",Qt("dst","Alpha"),"]");return[gr,On,Mr,xn]});case qn:return mt(function(De){if(typeof De=="string")return k.commandParameter(De,er,"invalid "+tt,Te.commandStr),[er[De],er[De]];if(typeof De=="object")return k.commandParameter(De.rgb,er,tt+".rgb",Te.commandStr),k.commandParameter(De.alpha,er,tt+".alpha",Te.commandStr),[er[De.rgb],er[De.alpha]];k.commandRaise("invalid blend.equation",Te.commandStr)},function(De,st,me){var lt=De.constants.blendEquations,Qt=st.def(),ur=st.def(),xr=De.cond("typeof ",me,'==="string"');return k.optional(function(){function gr(Mr,On,xn){De.assert(Mr,xn+" in "+lt,"invalid "+On+", must be one of "+Object.keys(er))}gr(xr.then,tt,me),De.assert(xr.else,me+"&&typeof "+me+'==="object"',"invalid "+tt),gr(xr.else,tt+".rgb",me+".rgb"),gr(xr.else,tt+".alpha",me+".alpha")}),xr.then(Qt,"=",ur,"=",lt,"[",me,"];"),xr.else(Qt,"=",lt,"[",me,".rgb];",ur,"=",lt,"[",me,".alpha];"),st(xr),[Qt,ur]});case ri:return mt(function(De){return k.command(Ha(De)&&De.length===4,"blend.color must be a 4d array",Te.commandStr),hi(4,function(st){return+De[st]})},function(De,st,me){return k.optional(function(){De.assert(st,De.shared.isArrayLike+"("+me+")&&"+me+".length===4","blend.color must be a 4d array")}),hi(4,function(lt){return st.def("+",me,"[",lt,"]")})});case Fl:return mt(function(De){return k.commandType(De,"number",ft,Te.commandStr),De|0},function(De,st,me){return k.optional(function(){De.assert(st,"typeof "+me+'==="number"',"invalid stencil.mask")}),st.def(me,"|0")});case ul:return mt(function(De){k.commandType(De,"object",ft,Te.commandStr);var st=De.cmp||"keep",me=De.ref||0,lt="mask"in De?De.mask:-1;return k.commandParameter(st,bf,tt+".cmp",Te.commandStr),k.commandType(me,"number",tt+".ref",Te.commandStr),k.commandType(lt,"number",tt+".mask",Te.commandStr),[bf[st],me,lt]},function(De,st,me){var lt=De.constants.compareFuncs;k.optional(function(){function gr(){De.assert(st,Array.prototype.join.call(arguments,""),"invalid stencil.func")}gr(me+"&&typeof ",me,'==="object"'),gr('!("cmp" in ',me,")||(",me,".cmp in ",lt,")")});var Qt=st.def('"cmp" in ',me,"?",lt,"[",me,".cmp]",":",Nl),ur=st.def(me,".ref|0"),xr=st.def('"mask" in ',me,"?",me,".mask|0:-1");return[Qt,ur,xr]});case kl:case Vu:return mt(function(De){k.commandType(De,"object",ft,Te.commandStr);var st=De.fail||"keep",me=De.zfail||"keep",lt=De.zpass||"keep";return k.commandParameter(st,fc,tt+".fail",Te.commandStr),k.commandParameter(me,fc,tt+".zfail",Te.commandStr),k.commandParameter(lt,fc,tt+".zpass",Te.commandStr),[tt===Vu?yf:lc,fc[st],fc[me],fc[lt]]},function(De,st,me){var lt=De.constants.stencilOps;k.optional(function(){De.assert(st,me+"&&typeof "+me+'==="object"',"invalid "+tt)});function Qt(ur){return k.optional(function(){De.assert(st,'!("'+ur+'" in '+me+")||("+me+"."+ur+" in "+lt+")","invalid "+tt+"."+ur+", must be one of "+Object.keys(fc))}),st.def('"',ur,'" in ',me,"?",lt,"[",me,".",ur,"]:",Nl)}return[tt===Vu?yf:lc,Qt("fail"),Qt("zfail"),Qt("zpass")]});case Zu:return mt(function(De){k.commandType(De,"object",ft,Te.commandStr);var st=De.factor|0,me=De.units|0;return k.commandType(st,"number",ft+".factor",Te.commandStr),k.commandType(me,"number",ft+".units",Te.commandStr),[st,me]},function(De,st,me){k.optional(function(){De.assert(st,me+"&&typeof "+me+'==="object"',"invalid "+tt)});var lt=st.def(me,".factor|0"),Qt=st.def(me,".units|0");return[lt,Qt]});case Ga:return mt(function(De){var st=0;return De==="front"?st=lc:De==="back"&&(st=yf),k.command(!!st,ft,Te.commandStr),st},function(De,st,me){return k.optional(function(){De.assert(st,me+'==="front"||'+me+'==="back"',"invalid cull.face")}),st.def(me,'==="front"?',lc,":",yf)});case Ss:return mt(function(De){return k.command(typeof De=="number"&&De>=jt.lineWidthDims[0]&&De<=jt.lineWidthDims[1],"invalid line width, must be a positive number between "+jt.lineWidthDims[0]+" and "+jt.lineWidthDims[1],Te.commandStr),De},function(De,st,me){return k.optional(function(){De.assert(st,"typeof "+me+'==="number"&&'+me+">="+jt.lineWidthDims[0]+"&&"+me+"<="+jt.lineWidthDims[1],"invalid line width")}),me});case Xa:return mt(function(De){return k.commandParameter(De,Ul,ft,Te.commandStr),Ul[De]},function(De,st,me){return k.optional(function(){De.assert(st,me+'==="cw"||'+me+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),st.def(me+'==="cw"?'+pp+":"+Ph)});case Ro:return mt(function(De){return k.command(Ha(De)&&De.length===4,"color.mask must be length 4 array",Te.commandStr),De.map(function(st){return!!st})},function(De,st,me){return k.optional(function(){De.assert(st,De.shared.isArrayLike+"("+me+")&&"+me+".length===4","invalid color.mask")}),hi(4,function(lt){return"!!"+me+"["+lt+"]"})});case Us:return mt(function(De){k.command(typeof De=="object"&&De,ft,Te.commandStr);var st="value"in De?De.value:1,me=!!De.invert;return k.command(typeof st=="number"&&st>=0&&st<=1,"sample.coverage.value must be a number between 0 and 1",Te.commandStr),[st,me]},function(De,st,me){k.optional(function(){De.assert(st,me+"&&typeof "+me+'==="object"',"invalid sample.coverage")});var lt=st.def('"value" in ',me,"?+",me,".value:1"),Qt=st.def("!!",me,".invert");return[lt,Qt]})}}),Bt}function Wo(ce,Te){var Ve=ce.static,Ut=ce.dynamic,Bt={};return Object.keys(Ve).forEach(function(tt){var ft=Ve[tt],mt;if(typeof ft=="number"||typeof ft=="boolean")mt=go(function(){return ft});else if(typeof ft=="function"){var De=ft._reglType;De==="texture2d"||De==="textureCube"?mt=go(function(st){return st.link(ft)}):De==="framebuffer"||De==="framebufferCube"?(k.command(ft.color.length>0,'missing color attachment for framebuffer sent to uniform "'+tt+'"',Te.commandStr),mt=go(function(st){return st.link(ft.color[0])})):k.commandRaise('invalid data for uniform "'+tt+'"',Te.commandStr)}else Ha(ft)?mt=go(function(st){var me=st.global.def("[",hi(ft.length,function(lt){return k.command(typeof ft[lt]=="number"||typeof ft[lt]=="boolean","invalid uniform "+tt,st.commandStr),ft[lt]}),"]");return me}):k.commandRaise('invalid or missing data for uniform "'+tt+'"',Te.commandStr);mt.value=ft,Bt[tt]=mt}),Object.keys(Ut).forEach(function(tt){var ft=Ut[tt];Bt[tt]=zs(ft,function(mt,De){return mt.invoke(De,ft)})}),Bt}function Pi(ce,Te){var Ve=ce.static,Ut=ce.dynamic,Bt={};return Object.keys(Ve).forEach(function(tt){var ft=Ve[tt],mt=Ae.id(tt),De=new Tt;if(Gf(ft))De.state=kr,De.buffer=pr.getBuffer(pr.create(ft,Lc,!1,!0)),De.type=0;else{var st=pr.getBuffer(ft);if(st)De.state=kr,De.buffer=st,De.type=0;else if(k.command(typeof ft=="object"&&ft,"invalid data for attribute "+tt,Te.commandStr),"constant"in ft){var me=ft.constant;De.buffer="null",De.state=un,typeof me=="number"?De.x=me:(k.command(Ha(me)&&me.length>0&&me.length<=4,"invalid constant for attribute "+tt,Te.commandStr),_r.forEach(function(On,xn){xn=0,'invalid offset for attribute "'+tt+'"',Te.commandStr);var Qt=ft.stride|0;k.command(Qt>=0&&Qt<256,'invalid stride for attribute "'+tt+'", must be integer betweeen [0, 255]',Te.commandStr);var ur=ft.size|0;k.command(!("size"in ft)||ur>0&&ur<=4,'invalid size for attribute "'+tt+'", must be 1,2,3,4',Te.commandStr);var xr=!!ft.normalized,gr=0;"type"in ft&&(k.commandParameter(ft.type,jo,"invalid type for attribute "+tt,Te.commandStr),gr=jo[ft.type]);var Mr=ft.divisor|0;"divisor"in ft&&(k.command(Mr===0||Fr,'cannot specify divisor for attribute "'+tt+'", instancing not supported',Te.commandStr),k.command(Mr>=0,'invalid divisor for attribute "'+tt+'"',Te.commandStr)),k.optional(function(){var On=Te.commandStr,xn=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(ft).forEach(function(Tn){k.command(xn.indexOf(Tn)>=0,'unknown parameter "'+Tn+'" for attribute pointer "'+tt+'" (valid parameters are '+xn+")",On)})}),De.buffer=st,De.state=kr,De.size=ur,De.normalized=xr,De.type=gr||st.dtype,De.offset=lt,De.stride=Qt,De.divisor=Mr}}Bt[tt]=go(function(On,xn){var Tn=On.attribCache;if(mt in Tn)return Tn[mt];var $n={isStream:!1};return Object.keys(De).forEach(function(ii){$n[ii]=De[ii]}),De.buffer&&($n.buffer=On.link(De.buffer),$n.type=$n.type||$n.buffer+".dtype"),Tn[mt]=$n,$n})}),Object.keys(Ut).forEach(function(tt){var ft=Ut[tt];function mt(De,st){var me=De.invoke(st,ft),lt=De.shared,Qt=De.constants,ur=lt.isBufferArgs,xr=lt.buffer;k.optional(function(){De.assert(st,me+"&&(typeof "+me+'==="object"||typeof '+me+'==="function")&&('+ur+"("+me+")||"+xr+".getBuffer("+me+")||"+xr+".getBuffer("+me+".buffer)||"+ur+"("+me+'.buffer)||("constant" in '+me+"&&(typeof "+me+'.constant==="number"||'+lt.isArrayLike+"("+me+".constant))))",'invalid dynamic attribute "'+tt+'"')});var gr={isStream:st.def(!1)},Mr=new Tt;Mr.state=kr,Object.keys(Mr).forEach(function($n){gr[$n]=st.def(""+Mr[$n])});var On=gr.buffer,xn=gr.type;st("if(",ur,"(",me,")){",gr.isStream,"=true;",On,"=",xr,".createStream(",Lc,",",me,");",xn,"=",On,".dtype;","}else{",On,"=",xr,".getBuffer(",me,");","if(",On,"){",xn,"=",On,".dtype;",'}else if("constant" in ',me,"){",gr.state,"=",un,";","if(typeof "+me+'.constant === "number"){',gr[_r[0]],"=",me,".constant;",_r.slice(1).map(function($n){return gr[$n]}).join("="),"=0;","}else{",_r.map(function($n,ii){return gr[$n]+"="+me+".constant.length>"+ii+"?"+me+".constant["+ii+"]:0;"}).join(""),"}}else{","if(",ur,"(",me,".buffer)){",On,"=",xr,".createStream(",Lc,",",me,".buffer);","}else{",On,"=",xr,".getBuffer(",me,".buffer);","}",xn,'="type" in ',me,"?",Qt.glTypes,"[",me,".type]:",On,".dtype;",gr.normalized,"=!!",me,".normalized;");function Tn($n){st(gr[$n],"=",me,".",$n,"|0;")}return Tn("size"),Tn("offset"),Tn("stride"),Tn("divisor"),st("}}"),st.exit("if(",gr.isStream,"){",xr,".destroyStream(",On,");","}"),gr}Bt[tt]=zs(ft,mt)}),Bt}function fo(ce,Te){var Ve=ce.static,Ut=ce.dynamic;if(Bl in Ve){var Bt=Ve[Bl];return Bt!==null&&Vr.getVAO(Bt)===null&&(Bt=Vr.createVAO(Bt)),go(function(ft){return ft.link(Vr.getVAO(Bt))})}else if(Bl in Ut){var tt=Ut[Bl];return zs(tt,function(ft,mt){var De=ft.invoke(mt,tt);return mt.def(ft.shared.vao+".getVAO("+De+")")})}return null}function Sa(ce){var Te=ce.static,Ve=ce.dynamic,Ut={};return Object.keys(Te).forEach(function(Bt){var tt=Te[Bt];Ut[Bt]=go(function(ft,mt){return typeof tt=="number"||typeof tt=="boolean"?""+tt:ft.link(tt)})}),Object.keys(Ve).forEach(function(Bt){var tt=Ve[Bt];Ut[Bt]=zs(tt,function(ft,mt){return ft.invoke(mt,tt)})}),Ut}function yo(ce,Te,Ve,Ut,Bt){var tt=ce.static,ft=ce.dynamic;k.optional(function(){var Tn=[As,au,Hu,Zi,mo,ou,ao,Bc,Qa,Bl].concat(Pr);function $n(ii){Object.keys(ii).forEach(function(na){k.command(Tn.indexOf(na)>=0,'unknown parameter "'+na+'"',Bt.commandStr)})}$n(tt),$n(ft)});var mt=si(ce,Te),De=ln(ce,Bt),st=yi(ce,De,Bt),me=Vi(ce,Bt),lt=_o(ce,Bt),Qt=Qn(ce,Bt,mt);function ur(Tn){var $n=st[Tn];$n&&(lt[Tn]=$n)}ur(Ko),ur($r(ju));var xr=Object.keys(lt).length>0,gr={framebuffer:De,draw:me,shader:Qt,state:lt,dirty:xr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(gr.profile=Ci(ce,Bt),gr.uniforms=Wo(Ve,Bt),gr.drawVAO=gr.scopeVAO=fo(ce,Bt),!gr.drawVAO&&Qt.program&&!mt&&je.angle_instanced_arrays){var Mr=!0,On=Qt.program.attributes.map(function(Tn){var $n=Te.static[Tn];return Mr=Mr&&!!$n,$n});if(Mr&&On.length>0){var xn=Vr.getVAO(Vr.createVAO(On));gr.drawVAO=new Ts(null,null,null,function(Tn,$n){return Tn.link(xn)}),gr.useVAO=!0}}return mt?gr.useVAO=!0:gr.attributes=Pi(Te,Bt),gr.context=Sa(Ut,Bt),gr}function xo(ce,Te,Ve){var Ut=ce.shared,Bt=Ut.context,tt=ce.scope();Object.keys(Ve).forEach(function(ft){Te.save(Bt,"."+ft);var mt=Ve[ft];tt(Bt,".",ft,"=",mt.append(ce,Te),";")}),Te(tt)}function Ja(ce,Te,Ve,Ut){var Bt=ce.shared,tt=Bt.gl,ft=Bt.framebuffer,mt;rn&&(mt=Te.def(Bt.extensions,".webgl_draw_buffers"));var De=ce.constants,st=De.drawBuffer,me=De.backBuffer,lt;Ve?lt=Ve.append(ce,Te):lt=Te.def(ft,".next"),Ut||Te("if(",lt,"!==",ft,".cur){"),Te("if(",lt,"){",tt,".bindFramebuffer(",cc,",",lt,".framebuffer);"),rn&&Te(mt,".drawBuffersWEBGL(",st,"[",lt,".colorAttachments.length]);"),Te("}else{",tt,".bindFramebuffer(",cc,",null);"),rn&&Te(mt,".drawBuffersWEBGL(",me,");"),Te("}",ft,".cur=",lt,";"),Ut||Te("}")}function Mo(ce,Te,Ve){var Ut=ce.shared,Bt=Ut.gl,tt=ce.current,ft=ce.next,mt=Ut.current,De=Ut.next,st=ce.cond(mt,".dirty");Pr.forEach(function(me){var lt=$r(me);if(!(lt in Ve.state)){var Qt,ur;if(lt in ft){Qt=ft[lt],ur=tt[lt];var xr=hi(yr[lt].length,function(Mr){return st.def(Qt,"[",Mr,"]")});st(ce.cond(xr.map(function(Mr,On){return Mr+"!=="+ur+"["+On+"]"}).join("||")).then(Bt,".",br[lt],"(",xr,");",xr.map(function(Mr,On){return ur+"["+On+"]="+Mr}).join(";"),";"))}else{Qt=st.def(De,".",lt);var gr=ce.cond(Qt,"!==",mt,".",lt);st(gr),lt in nn?gr(ce.cond(Qt).then(Bt,".enable(",nn[lt],");").else(Bt,".disable(",nn[lt],");"),mt,".",lt,"=",Qt,";"):gr(Bt,".",br[lt],"(",Qt,");",mt,".",lt,"=",Qt,";")}}}),Object.keys(Ve.state).length===0&&st(mt,".dirty=false;"),Te(st)}function ps(ce,Te,Ve,Ut){var Bt=ce.shared,tt=ce.current,ft=Bt.current,mt=Bt.gl;vp(Object.keys(Ve)).forEach(function(De){var st=Ve[De];if(!(Ut&&!Ut(st))){var me=st.append(ce,Te);if(nn[De]){var lt=nn[De];hs(st)?me?Te(mt,".enable(",lt,");"):Te(mt,".disable(",lt,");"):Te(ce.cond(me).then(mt,".enable(",lt,");").else(mt,".disable(",lt,");")),Te(ft,".",De,"=",me,";")}else if(Ha(me)){var Qt=tt[De];Te(mt,".",br[De],"(",me,");",me.map(function(ur,xr){return Qt+"["+xr+"]="+ur}).join(";"),";")}else Te(mt,".",br[De],"(",me,");",ft,".",De,"=",me,";")}})}function Io(ce,Te){Fr&&(ce.instancing=Te.def(ce.shared.extensions,".angle_instanced_arrays"))}function xi(ce,Te,Ve,Ut,Bt){var tt=ce.shared,ft=ce.stats,mt=tt.current,De=tt.timer,st=Ve.profile;function me(){return typeof performance=="undefined"?"Date.now()":"performance.now()"}var lt,Qt;function ur(Tn){lt=Te.def(),Tn(lt,"=",me(),";"),typeof Bt=="string"?Tn(ft,".count+=",Bt,";"):Tn(ft,".count++;"),Ar&&(Ut?(Qt=Te.def(),Tn(Qt,"=",De,".getNumPendingQueries();")):Tn(De,".beginQuery(",ft,");"))}function xr(Tn){Tn(ft,".cpuTime+=",me(),"-",lt,";"),Ar&&(Ut?Tn(De,".pushScopeStats(",Qt,",",De,".getNumPendingQueries(),",ft,");"):Tn(De,".endQuery();"))}function gr(Tn){var $n=Te.def(mt,".profile");Te(mt,".profile=",Tn,";"),Te.exit(mt,".profile=",$n,";")}var Mr;if(st){if(hs(st)){st.enable?(ur(Te),xr(Te.exit),gr("true")):gr("false");return}Mr=st.append(ce,Te),gr(Mr)}else Mr=Te.def(mt,".profile");var On=ce.block();ur(On),Te("if(",Mr,"){",On,"}");var xn=ce.block();xr(xn),Te.exit("if(",Mr,"){",xn,"}")}function es(ce,Te,Ve,Ut,Bt){var tt=ce.shared;function ft(De){switch(De){case Uc:case fp:case vf:return 2;case Wf:case so:case mf:return 3;case cp:case uc:case zc:return 4;default:return 1}}function mt(De,st,me){var lt=tt.gl,Qt=Te.def(De,".location"),ur=Te.def(tt.attributes,"[",Qt,"]"),xr=me.state,gr=me.buffer,Mr=[me.x,me.y,me.z,me.w],On=["buffer","normalized","offset","stride"];function xn(){Te("if(!",ur,".buffer){",lt,".enableVertexAttribArray(",Qt,");}");var $n=me.type,ii;if(me.size?ii=Te.def(me.size,"||",st):ii=st,Te("if(",ur,".type!==",$n,"||",ur,".size!==",ii,"||",On.map(function(Eo){return ur+"."+Eo+"!=="+me[Eo]}).join("||"),"){",lt,".bindBuffer(",Lc,",",gr,".buffer);",lt,".vertexAttribPointer(",[Qt,ii,$n,me.normalized,me.stride,me.offset],");",ur,".type=",$n,";",ur,".size=",ii,";",On.map(function(Eo){return ur+"."+Eo+"="+me[Eo]+";"}).join(""),"}"),Fr){var na=me.divisor;Te("if(",ur,".divisor!==",na,"){",ce.instancing,".vertexAttribDivisorANGLE(",[Qt,na],");",ur,".divisor=",na,";}")}}function Tn(){Te("if(",ur,".buffer){",lt,".disableVertexAttribArray(",Qt,");",ur,".buffer=null;","}if(",_r.map(function($n,ii){return ur+"."+$n+"!=="+Mr[ii]}).join("||"),"){",lt,".vertexAttrib4f(",Qt,",",Mr,");",_r.map(function($n,ii){return ur+"."+$n+"="+Mr[ii]+";"}).join(""),"}")}xr===kr?xn():xr===un?Tn():(Te("if(",xr,"===",kr,"){"),xn(),Te("}else{"),Tn(),Te("}"))}Ut.forEach(function(De){var st=De.name,me=Ve.attributes[st],lt;if(me){if(!Bt(me))return;lt=me.append(ce,Te)}else{if(!Bt($p))return;var Qt=ce.scopeAttrib(st);k.optional(function(){ce.assert(Te,Qt+".state","missing attribute "+st)}),lt={},Object.keys(new Tt).forEach(function(ur){lt[ur]=Te.def(Qt,".",ur)})}mt(ce.link(De),ft(De.info.type),lt)})}function ua(ce,Te,Ve,Ut,Bt){for(var tt=ce.shared,ft=tt.gl,mt,De=0;De1?Te(hi($n,function(dl){return gr+"["+dl+"]"})):Te(gr);Te(");")}}function Xn(ce,Te,Ve,Ut){var Bt=ce.shared,tt=Bt.gl,ft=Bt.draw,mt=Ut.draw;function De(){var ii=mt.elements,na,Eo=Te;return ii?((ii.contextDep&&Ut.contextDynamic||ii.propDep)&&(Eo=Ve),na=ii.append(ce,Eo)):na=Eo.def(ft,".",Zi),na&&Eo("if("+na+")"+tt+".bindBuffer("+Km+","+na+".buffer.buffer);"),na}function st(){var ii=mt.count,na,Eo=Te;return ii?((ii.contextDep&&Ut.contextDynamic||ii.propDep)&&(Eo=Ve),na=ii.append(ce,Eo),k.optional(function(){ii.MISSING&&ce.assert(Te,"false","missing vertex count"),ii.DYNAMIC&&ce.assert(Eo,na+">=0","missing vertex count")})):(na=Eo.def(ft,".",ao),k.optional(function(){ce.assert(Eo,na+">=0","missing vertex count")})),na}var me=De();function lt(ii){var na=mt[ii];return na?na.contextDep&&Ut.contextDynamic||na.propDep?na.append(ce,Ve):na.append(ce,Te):Te.def(ft,".",ii)}var Qt=lt(mo),ur=lt(ou),xr=st();if(typeof xr=="number"){if(xr===0)return}else Ve("if(",xr,"){"),Ve.exit("}");var gr,Mr;Fr&&(gr=lt(Bc),Mr=ce.instancing);var On=me+".type",xn=mt.elements&&hs(mt.elements);function Tn(){function ii(){Ve(Mr,".drawElementsInstancedANGLE(",[Qt,xr,On,ur+"<<(("+On+"-"+Nr+")>>1)",gr],");")}function na(){Ve(Mr,".drawArraysInstancedANGLE(",[Qt,ur,xr,gr],");")}me?xn?ii():(Ve("if(",me,"){"),ii(),Ve("}else{"),na(),Ve("}")):na()}function $n(){function ii(){Ve(tt+".drawElements("+[Qt,xr,On,ur+"<<(("+On+"-"+Nr+")>>1)"]+");")}function na(){Ve(tt+".drawArrays("+[Qt,ur,xr]+");")}me?xn?ii():(Ve("if(",me,"){"),ii(),Ve("}else{"),na(),Ve("}")):na()}Fr&&(typeof gr!="number"||gr>=0)?typeof gr=="string"?(Ve("if(",gr,">0){"),Tn(),Ve("}else if(",gr,"<0){"),$n(),Ve("}")):Tn():$n()}function Oi(ce,Te,Ve,Ut,Bt){var tt=ot(),ft=tt.proc("body",Bt);return k.optional(function(){tt.commandStr=Te.commandStr,tt.command=tt.link(Te.commandStr)}),Fr&&(tt.instancing=ft.def(tt.shared.extensions,".angle_instanced_arrays")),ce(tt,ft,Ve,Ut),tt.compile().body}function Xi(ce,Te,Ve,Ut){Io(ce,Te),Ve.useVAO?Ve.drawVAO?Te(ce.shared.vao,".setVAO(",Ve.drawVAO.append(ce,Te),");"):Te(ce.shared.vao,".setVAO(",ce.shared.vao,".targetVAO);"):(Te(ce.shared.vao,".setVAO(null);"),es(ce,Te,Ve,Ut.attributes,function(){return!0})),ua(ce,Te,Ve,Ut.uniforms,function(){return!0}),Xn(ce,Te,Te,Ve)}function bo(ce,Te){var Ve=ce.proc("draw",1);Io(ce,Ve),xo(ce,Ve,Te.context),Ja(ce,Ve,Te.framebuffer),Mo(ce,Ve,Te),ps(ce,Ve,Te.state),xi(ce,Ve,Te,!1,!0);var Ut=Te.shader.progVar.append(ce,Ve);if(Ve(ce.shared.gl,".useProgram(",Ut,".program);"),Te.shader.program)Xi(ce,Ve,Te,Te.shader.program);else{Ve(ce.shared.vao,".setVAO(null);");var Bt=ce.global.def("{}"),tt=Ve.def(Ut,".id"),ft=Ve.def(Bt,"[",tt,"]");Ve(ce.cond(ft).then(ft,".call(this,a0);").else(ft,"=",Bt,"[",tt,"]=",ce.link(function(mt){return Oi(Xi,ce,Te,mt,1)}),"(",Ut,");",ft,".call(this,a0);"))}Object.keys(Te.state).length>0&&Ve(ce.shared.current,".dirty=true;")}function Xu(ce,Te,Ve,Ut){ce.batchId="a1",Io(ce,Te);function Bt(){return!0}es(ce,Te,Ve,Ut.attributes,Bt),ua(ce,Te,Ve,Ut.uniforms,Bt),Xn(ce,Te,Te,Ve)}function Ne(ce,Te,Ve,Ut){Io(ce,Te);var Bt=Ve.contextDep,tt=Te.def(),ft="a0",mt="a1",De=Te.def();ce.shared.props=De,ce.batchId=tt;var st=ce.scope(),me=ce.scope();Te(st.entry,"for(",tt,"=0;",tt,"<",mt,";++",tt,"){",De,"=",ft,"[",tt,"];",me,"}",st.exit);function lt(On){return On.contextDep&&Bt||On.propDep}function Qt(On){return!lt(On)}if(Ve.needsContext&&xo(ce,me,Ve.context),Ve.needsFramebuffer&&Ja(ce,me,Ve.framebuffer),ps(ce,me,Ve.state,lt),Ve.profile&<(Ve.profile)&&xi(ce,me,Ve,!1,!0),Ut)Ve.useVAO?Ve.drawVAO?lt(Ve.drawVAO)?me(ce.shared.vao,".setVAO(",Ve.drawVAO.append(ce,me),");"):st(ce.shared.vao,".setVAO(",Ve.drawVAO.append(ce,st),");"):st(ce.shared.vao,".setVAO(",ce.shared.vao,".targetVAO);"):(st(ce.shared.vao,".setVAO(null);"),es(ce,st,Ve,Ut.attributes,Qt),es(ce,me,Ve,Ut.attributes,lt)),ua(ce,st,Ve,Ut.uniforms,Qt),ua(ce,me,Ve,Ut.uniforms,lt),Xn(ce,st,me,Ve);else{var ur=ce.global.def("{}"),xr=Ve.shader.progVar.append(ce,me),gr=me.def(xr,".id"),Mr=me.def(ur,"[",gr,"]");me(ce.shared.gl,".useProgram(",xr,".program);","if(!",Mr,"){",Mr,"=",ur,"[",gr,"]=",ce.link(function(On){return Oi(Xu,ce,Ve,On,2)}),"(",xr,");}",Mr,".call(this,a0[",tt,"],",tt,");")}}function $t(ce,Te){var Ve=ce.proc("batch",2);ce.batchId="0",Io(ce,Ve);var Ut=!1,Bt=!0;Object.keys(Te.context).forEach(function(ur){Ut=Ut||Te.context[ur].propDep}),Ut||(xo(ce,Ve,Te.context),Bt=!1);var tt=Te.framebuffer,ft=!1;tt?(tt.propDep?Ut=ft=!0:tt.contextDep&&Ut&&(ft=!0),ft||Ja(ce,Ve,tt)):Ja(ce,Ve,null),Te.state.viewport&&Te.state.viewport.propDep&&(Ut=!0);function mt(ur){return ur.contextDep&&Ut||ur.propDep}Mo(ce,Ve,Te),ps(ce,Ve,Te.state,function(ur){return!mt(ur)}),(!Te.profile||!mt(Te.profile))&&xi(ce,Ve,Te,!1,"a1"),Te.contextDep=Ut,Te.needsContext=Bt,Te.needsFramebuffer=ft;var De=Te.shader.progVar;if(De.contextDep&&Ut||De.propDep)Ne(ce,Ve,Te,null);else{var st=De.append(ce,Ve);if(Ve(ce.shared.gl,".useProgram(",st,".program);"),Te.shader.program)Ne(ce,Ve,Te,Te.shader.program);else{Ve(ce.shared.vao,".setVAO(null);");var me=ce.global.def("{}"),lt=Ve.def(st,".id"),Qt=Ve.def(me,"[",lt,"]");Ve(ce.cond(Qt).then(Qt,".call(this,a0,a1);").else(Qt,"=",me,"[",lt,"]=",ce.link(function(ur){return Oi(Ne,ce,Te,ur,2)}),"(",st,");",Qt,".call(this,a0,a1);"))}}Object.keys(Te.state).length>0&&Ve(ce.shared.current,".dirty=true;")}function Nt(ce,Te){var Ve=ce.proc("scope",3);ce.batchId="a2";var Ut=ce.shared,Bt=Ut.current;xo(ce,Ve,Te.context),Te.framebuffer&&Te.framebuffer.append(ce,Ve),vp(Object.keys(Te.state)).forEach(function(ft){var mt=Te.state[ft],De=mt.append(ce,Ve);Ha(De)?De.forEach(function(st,me){Ve.set(ce.next[ft],"["+me+"]",st)}):Ve.set(Ut.next,"."+ft,De)}),xi(ce,Ve,Te,!0,!0),[Zi,ou,ao,Bc,mo].forEach(function(ft){var mt=Te.draw[ft];mt&&Ve.set(Ut.draw,"."+ft,""+mt.append(ce,Ve))}),Object.keys(Te.uniforms).forEach(function(ft){Ve.set(Ut.uniforms,"["+Ae.id(ft)+"]",Te.uniforms[ft].append(ce,Ve))}),Object.keys(Te.attributes).forEach(function(ft){var mt=Te.attributes[ft].append(ce,Ve),De=ce.scopeAttrib(ft);Object.keys(new Tt).forEach(function(st){Ve.set(De,"."+st,mt[st])})}),Te.scopeVAO&&Ve.set(Ut.vao,".targetVAO",Te.scopeVAO.append(ce,Ve));function tt(ft){var mt=Te.shader[ft];mt&&Ve.set(Ut.shader,"."+ft,mt.append(ce,Ve))}tt(au),tt(Hu),Object.keys(Te.state).length>0&&(Ve(Bt,".dirty=true;"),Ve.exit(Bt,".dirty=true;")),Ve("a1(",ce.shared.context,",a0,",ce.batchId,");")}function hn(ce){if(!(typeof ce!="object"||Ha(ce))){for(var Te=Object.keys(ce),Ve=0;Ve=0;--Xn){var Oi=vr[Xn];Oi&&Oi(Ar,null,0)}je.flush(),Vr&&Vr.update()}function Qn(){!yi&&vr.length>0&&(yi=Zr.next(si))}function Vi(){yi&&(Zr.cancel(si),yi=null)}function _o(Xn){Xn.preventDefault(),pr=!0,Vi(),ot.forEach(function(Oi){Oi()})}function Wo(Xn){je.getError(),pr=!1,Gt.restore(),Pr.restore(),Fr.restore(),nn.restore(),br.restore(),$r.restore(),rn.restore(),Vr&&Vr.restore(),Nn.procs.refresh(),Qn(),Ci.forEach(function(Oi){Oi()})}yt&&(yt.addEventListener(qp,_o,!1),yt.addEventListener(Ud,Wo,!1));function Pi(){vr.length=0,Vi(),yt&&(yt.removeEventListener(qp,_o),yt.removeEventListener(Ud,Wo)),Pr.clear(),$r.clear(),br.clear(),nn.clear(),an.clear(),Fr.clear(),rn.clear(),Vr&&Vr.clear(),ln.forEach(function(Xn){Xn()})}function fo(Xn){k(!!Xn,"invalid args to regl({...})"),k.type(Xn,"object","invalid args to regl({...})");function Oi(Bt){var tt=L({},Bt);delete tt.uniforms,delete tt.attributes,delete tt.context,delete tt.vao,"stencil"in tt&&tt.stencil.op&&(tt.stencil.opBack=tt.stencil.opFront=tt.stencil.op,delete tt.stencil.op);function ft(mt){if(mt in tt){var De=tt[mt];delete tt[mt],Object.keys(De).forEach(function(st){tt[mt+"."+st]=De[st]})}}return ft("blend"),ft("depth"),ft("cull"),ft("stencil"),ft("polygonOffset"),ft("scissor"),ft("sample"),"vao"in Bt&&(tt.vao=Bt.vao),tt}function Xi(Bt){var tt={},ft={};return Object.keys(Bt).forEach(function(mt){var De=Bt[mt];mr.isDynamic(De)?ft[mt]=mr.unbox(De,mt):tt[mt]=De}),{dynamic:ft,static:tt}}var bo=Xi(Xn.context||{}),Xu=Xi(Xn.uniforms||{}),Ne=Xi(Xn.attributes||{}),$t=Xi(Oi(Xn)),Nt={gpuTime:0,cpuTime:0,count:0},hn=Nn.compile($t,Ne,Xu,bo,Nt),bi=hn.draw,da=hn.batch,ce=hn.scope,Te=[];function Ve(Bt){for(;Te.length0)return da.call(this,Ve(Bt|0),Bt|0)}else if(Array.isArray(Bt)){if(Bt.length)return da.call(this,Bt,Bt.length)}else return bi.call(this,Bt)}return L(Ut,{stats:Nt})}var Sa=$r.setFBO=fo({framebuffer:mr.define.call(null,Kp,"framebuffer")});function yo(Xn,Oi){var Xi=0;Nn.procs.poll();var bo=Oi.color;bo&&(je.clearColor(+bo[0]||0,+bo[1]||0,+bo[2]||0,+bo[3]||0),Xi|=Dh),"depth"in Oi&&(je.clearDepth(+Oi.depth),Xi|=Jo),"stencil"in Oi&&(je.clearStencil(Oi.stencil|0),Xi|=Uv),k(!!Xi,"called regl.clear with no buffer specified"),je.clear(Xi)}function xo(Xn){if(k(typeof Xn=="object"&&Xn,"regl.clear() takes an object as input"),"framebuffer"in Xn)if(Xn.framebuffer&&Xn.framebuffer_reglType==="framebufferCube")for(var Oi=0;Oi<6;++Oi)Sa(L({framebuffer:Xn.framebuffer.faces[Oi]},Xn),yo);else Sa(Xn,yo);else yo(null,Xn)}function Ja(Xn){k.type(Xn,"function","regl.frame() callback must be a function"),vr.push(Xn);function Oi(){var Xi=zd(vr,Xn);k(Xi>=0,"cannot cancel a frame twice");function bo(){var Xu=zd(vr,bo);vr[Xu]=vr[vr.length-1],vr.length-=1,vr.length<=0&&Vi()}vr[Xi]=bo}return Qn(),{cancel:Oi}}function Mo(){var Xn=Qr.viewport,Oi=Qr.scissor_box;Xn[0]=Xn[1]=Oi[0]=Oi[1]=0,Ar.viewportWidth=Ar.framebufferWidth=Ar.drawingBufferWidth=Xn[2]=Oi[2]=je.drawingBufferWidth,Ar.viewportHeight=Ar.framebufferHeight=Ar.drawingBufferHeight=Xn[3]=Oi[3]=je.drawingBufferHeight}function ps(){Ar.tick+=1,Ar.time=xi(),Mo(),Nn.procs.poll()}function Io(){Mo(),Nn.procs.refresh(),Vr&&Vr.update()}function xi(){return(Fn()-Br)/1e3}Io();function es(Xn,Oi){k.type(Oi,"function","listener callback must be a function");var Xi;switch(Xn){case"frame":return Ja(Oi);case"lost":Xi=ot;break;case"restore":Xi=Ci;break;case"destroy":Xi=ln;break;default:k.raise("invalid event, must be one of frame,lost,restore,destroy")}return Xi.push(Oi),{cancel:function(){for(var bo=0;bo=0},read:ui,destroy:Pi,_gl:je,_refresh:Io,poll:function(){ps(),Vr&&Vr.update()},now:xi,stats:Dr});return Ae.onDone(null,ua),ua}return Zd})},39720:function(rr){(function(ee,L){rr.exports=L()})(this,function(){"use strict";function ee(At,ut,It,qe,Ct,fr){if(!(Ct-qe<=It)){var re=qe+Ct>>1;L(At,ut,re,qe,Ct,fr%2),ee(At,ut,It,qe,re-1,fr+1),ee(At,ut,It,re+1,Ct,fr+1)}}function L(At,ut,It,qe,Ct,fr){for(;Ct>qe;){if(Ct-qe>600){var re=Ct-qe+1,V=It-qe+1,K=Math.log(re),Me=.5*Math.exp(2*K/3),Se=.5*Math.sqrt(K*Me*(re-Me)/re)*(V-re/2<0?-1:1),nt=Math.max(qe,Math.floor(It-V*Me/re+Se)),te=Math.min(Ct,Math.floor(It+(re-V)*Me/re+Se));L(At,ut,It,nt,te,fr)}var Ce=ut[2*It+fr],we=qe,Xe=Ct;for(q(At,ut,qe,It),ut[2*Ct+fr]>Ce&&q(At,ut,qe,Ct);weCe;)Xe--}ut[2*qe+fr]===Ce?q(At,ut,qe,Xe):(Xe++,q(At,ut,Xe,Ct)),Xe<=It&&(qe=Xe+1),It<=Xe&&(Ct=Xe-1)}}function q(At,ut,It,qe){he(At,It,qe),he(ut,2*It,2*qe),he(ut,2*It+1,2*qe+1)}function he(At,ut,It){var qe=At[ut];At[ut]=At[It],At[It]=qe}function _(At,ut,It,qe,Ct,fr,re){for(var V=[0,At.length-1,0],K=[],Me,Se;V.length;){var nt=V.pop(),te=V.pop(),Ce=V.pop();if(te-Ce<=re){for(var we=Ce;we<=te;we++)Me=ut[2*we],Se=ut[2*we+1],Me>=It&&Me<=Ct&&Se>=qe&&Se<=fr&&K.push(At[we]);continue}var Xe=Math.floor((Ce+te)/2);Me=ut[2*Xe],Se=ut[2*Xe+1],Me>=It&&Me<=Ct&&Se>=qe&&Se<=fr&&K.push(At[Xe]);var Lt=(nt+1)%2;(nt===0?It<=Me:qe<=Se)&&(V.push(Ce),V.push(Xe-1),V.push(Lt)),(nt===0?Ct>=Me:fr>=Se)&&(V.push(Xe+1),V.push(te),V.push(Lt))}return K}function le(At,ut,It,qe,Ct,fr){for(var re=[0,At.length-1,0],V=[],K=Ct*Ct;re.length;){var Me=re.pop(),Se=re.pop(),nt=re.pop();if(Se-nt<=fr){for(var te=nt;te<=Se;te++)U(ut[2*te],ut[2*te+1],It,qe)<=K&&V.push(At[te]);continue}var Ce=Math.floor((nt+Se)/2),we=ut[2*Ce],Xe=ut[2*Ce+1];U(we,Xe,It,qe)<=K&&V.push(At[Ce]);var Lt=(Me+1)%2;(Me===0?It-Ct<=we:qe-Ct<=Xe)&&(re.push(nt),re.push(Ce-1),re.push(Lt)),(Me===0?It+Ct>=we:qe+Ct>=Xe)&&(re.push(Ce+1),re.push(Se),re.push(Lt))}return V}function U(At,ut,It,qe){var Ct=At-It,fr=ut-qe;return Ct*Ct+fr*fr}var fe=function(At){return At[0]},se=function(At){return At[1]},Qe=function(ut,It,qe,Ct,fr){It===void 0&&(It=fe),qe===void 0&&(qe=se),Ct===void 0&&(Ct=64),fr===void 0&&(fr=Float64Array),this.nodeSize=Ct,this.points=ut;for(var re=ut.length<65536?Uint16Array:Uint32Array,V=this.ids=new re(ut.length),K=this.coords=new fr(ut.length*2),Me=0;Me=Ct;Se--){var nt=+Date.now();K=this._cluster(K,Se),this.trees[Se]=new Qe(K,hr,lr,re,Float32Array),qe&&console.log("z%d: %d clusters in %dms",Se,K.length,+Date.now()-nt)}return qe&&console.timeEnd("total time"),this},dt.prototype.getClusters=function(ut,It){var qe=((ut[0]+180)%360+360)%360-180,Ct=Math.max(-90,Math.min(90,ut[1])),fr=ut[2]===180?180:((ut[2]+180)%360+360)%360-180,re=Math.max(-90,Math.min(90,ut[3]));if(ut[2]-ut[0]>=360)qe=-180,fr=180;else if(qe>fr){var V=this.getClusters([qe,Ct,180,re],It),K=this.getClusters([-180,Ct,fr,re],It);return V.concat(K)}for(var Me=this.trees[this._limitZoom(It)],Se=Me.range(nr(qe),Vt(re),nr(fr),Vt(Ct)),nt=[],te=0,Ce=Se;teIt&&(Xe+=Jr.numPoints||1)}if(Xe>we&&Xe>=K){for(var Hr=nt.x*we,Un=nt.y*we,bn=V&&we>1?this._map(nt,!0):null,Kr=(Se<<5)+(It+1)+this.points.length,Mi=0,Si=Ce;Mi1)for(var Ya=0,Yi=Ce;Ya>5},dt.prototype._getOriginZoom=function(ut){return(ut-this.points.length)%32},dt.prototype._map=function(ut,It){if(ut.numPoints)return It?Tr({},ut.properties):ut.properties;var qe=this.points[ut.index].properties,Ct=this.options.map(qe);return It&&Ct===qe?Tr({},Ct):Ct};function Ye(At,ut,It,qe,Ct){return{x:et(At),y:et(ut),zoom:1/0,id:It,parentId:-1,numPoints:qe,properties:Ct}}function wt(At,ut){var It=At.geometry.coordinates,qe=It[0],Ct=It[1];return{x:et(nr(qe)),y:et(Vt(Ct)),zoom:1/0,index:ut,parentId:-1}}function Xt(At){return{type:"Feature",id:At.id,properties:Zt(At),geometry:{type:"Point",coordinates:[xt(At.x),bt(At.y)]}}}function Zt(At){var ut=At.numPoints,It=ut>=1e4?Math.round(ut/1e3)+"k":ut>=1e3?Math.round(ut/100)/10+"k":ut;return Tr(Tr({},At.properties),{cluster:!0,cluster_id:At.id,point_count:ut,point_count_abbreviated:It})}function nr(At){return At/360+.5}function Vt(At){var ut=Math.sin(At*Math.PI/180),It=.5-.25*Math.log((1+ut)/(1-ut))/Math.PI;return It<0?0:It>1?1:It}function xt(At){return(At-.5)*360}function bt(At){var ut=(180-At*360)*Math.PI/180;return 360*Math.atan(Math.exp(ut))/Math.PI-90}function Tr(At,ut){for(var It in ut)At[It]=ut[It];return At}function hr(At){return At.x}function lr(At){return At.y}return dt})},58576:function(rr,ee,L){var q=L(85057).default;function he(){"use strict";rr.exports=he=function(){return le},rr.exports.__esModule=!0,rr.exports.default=rr.exports;var _,le={},U=Object.prototype,fe=U.hasOwnProperty,se=Object.defineProperty||function(te,Ce,we){te[Ce]=we.value},Qe=typeof Symbol=="function"?Symbol:{},ae=Qe.iterator||"@@iterator",et=Qe.asyncIterator||"@@asyncIterator",dt=Qe.toStringTag||"@@toStringTag";function Ye(te,Ce,we){return Object.defineProperty(te,Ce,{value:we,enumerable:!0,configurable:!0,writable:!0}),te[Ce]}try{Ye({},"")}catch(te){Ye=function(we,Xe,Lt){return we[Xe]=Lt}}function wt(te,Ce,we,Xe){var Lt=Ce&&Ce.prototype instanceof Tr?Ce:Tr,Ht=Object.create(Lt.prototype),on=new Se(Xe||[]);return se(Ht,"_invoke",{value:re(te,we,on)}),Ht}function Xt(te,Ce,we){try{return{type:"normal",arg:te.call(Ce,we)}}catch(Xe){return{type:"throw",arg:Xe}}}le.wrap=wt;var Zt="suspendedStart",nr="suspendedYield",Vt="executing",xt="completed",bt={};function Tr(){}function hr(){}function lr(){}var At={};Ye(At,ae,function(){return this});var ut=Object.getPrototypeOf,It=ut&&ut(ut(nt([])));It&&It!==U&&fe.call(It,ae)&&(At=It);var qe=lr.prototype=Tr.prototype=Object.create(At);function Ct(te){["next","throw","return"].forEach(function(Ce){Ye(te,Ce,function(we){return this._invoke(Ce,we)})})}function fr(te,Ce){function we(Lt,Ht,on,Jr){var Hr=Xt(te[Lt],te,Ht);if(Hr.type!=="throw"){var Un=Hr.arg,bn=Un.value;return bn&&q(bn)=="object"&&fe.call(bn,"__await")?Ce.resolve(bn.__await).then(function(Kr){we("next",Kr,on,Jr)},function(Kr){we("throw",Kr,on,Jr)}):Ce.resolve(bn).then(function(Kr){Un.value=Kr,on(Un)},function(Kr){return we("throw",Kr,on,Jr)})}Jr(Hr.arg)}var Xe;se(this,"_invoke",{value:function(Ht,on){function Jr(){return new Ce(function(Hr,Un){we(Ht,on,Hr,Un)})}return Xe=Xe?Xe.then(Jr,Jr):Jr()}})}function re(te,Ce,we){var Xe=Zt;return function(Lt,Ht){if(Xe===Vt)throw new Error("Generator is already running");if(Xe===xt){if(Lt==="throw")throw Ht;return{value:_,done:!0}}for(we.method=Lt,we.arg=Ht;;){var on=we.delegate;if(on){var Jr=V(on,we);if(Jr){if(Jr===bt)continue;return Jr}}if(we.method==="next")we.sent=we._sent=we.arg;else if(we.method==="throw"){if(Xe===Zt)throw Xe=xt,we.arg;we.dispatchException(we.arg)}else we.method==="return"&&we.abrupt("return",we.arg);Xe=Vt;var Hr=Xt(te,Ce,we);if(Hr.type==="normal"){if(Xe=we.done?xt:nr,Hr.arg===bt)continue;return{value:Hr.arg,done:we.done}}Hr.type==="throw"&&(Xe=xt,we.method="throw",we.arg=Hr.arg)}}}function V(te,Ce){var we=Ce.method,Xe=te.iterator[we];if(Xe===_)return Ce.delegate=null,we==="throw"&&te.iterator.return&&(Ce.method="return",Ce.arg=_,V(te,Ce),Ce.method==="throw")||we!=="return"&&(Ce.method="throw",Ce.arg=new TypeError("The iterator does not provide a '"+we+"' method")),bt;var Lt=Xt(Xe,te.iterator,Ce.arg);if(Lt.type==="throw")return Ce.method="throw",Ce.arg=Lt.arg,Ce.delegate=null,bt;var Ht=Lt.arg;return Ht?Ht.done?(Ce[te.resultName]=Ht.value,Ce.next=te.nextLoc,Ce.method!=="return"&&(Ce.method="next",Ce.arg=_),Ce.delegate=null,bt):Ht:(Ce.method="throw",Ce.arg=new TypeError("iterator result is not an object"),Ce.delegate=null,bt)}function K(te){var Ce={tryLoc:te[0]};1 in te&&(Ce.catchLoc=te[1]),2 in te&&(Ce.finallyLoc=te[2],Ce.afterLoc=te[3]),this.tryEntries.push(Ce)}function Me(te){var Ce=te.completion||{};Ce.type="normal",delete Ce.arg,te.completion=Ce}function Se(te){this.tryEntries=[{tryLoc:"root"}],te.forEach(K,this),this.reset(!0)}function nt(te){if(te||te===""){var Ce=te[ae];if(Ce)return Ce.call(te);if(typeof te.next=="function")return te;if(!isNaN(te.length)){var we=-1,Xe=function Lt(){for(;++we=0;--Lt){var Ht=this.tryEntries[Lt],on=Ht.completion;if(Ht.tryLoc==="root")return Xe("end");if(Ht.tryLoc<=this.prev){var Jr=fe.call(Ht,"catchLoc"),Hr=fe.call(Ht,"finallyLoc");if(Jr&&Hr){if(this.prev=0;--Xe){var Lt=this.tryEntries[Xe];if(Lt.tryLoc<=this.prev&&fe.call(Lt,"finallyLoc")&&this.prev=0;--we){var Xe=this.tryEntries[we];if(Xe.finallyLoc===Ce)return this.complete(Xe.completion,Xe.afterLoc),Me(Xe),bt}},catch:function(Ce){for(var we=this.tryEntries.length-1;we>=0;--we){var Xe=this.tryEntries[we];if(Xe.tryLoc===Ce){var Lt=Xe.completion;if(Lt.type==="throw"){var Ht=Lt.arg;Me(Xe)}return Ht}}throw new Error("illegal catch attempt")},delegateYield:function(Ce,we,Xe){return this.delegate={iterator:nt(Ce),resultName:we,nextLoc:Xe},this.method==="next"&&(this.arg=_),bt}},le}rr.exports=he,rr.exports.__esModule=!0,rr.exports.default=rr.exports},85057:function(rr){function ee(L){"@babel/helpers - typeof";return rr.exports=ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},rr.exports.__esModule=!0,rr.exports.default=rr.exports,ee(L)}rr.exports=ee,rr.exports.__esModule=!0,rr.exports.default=rr.exports},29972:function(rr,ee,L){var q=L(58576)();rr.exports=q;try{regeneratorRuntime=q}catch(he){typeof globalThis=="object"?globalThis.regeneratorRuntime=q:Function("r","regeneratorRuntime = r")(q)}}}]); }());