var JD=Object.defineProperty,QD=Object.defineProperties;var eO=Object.getOwnPropertyDescriptors;var qS=Object.getOwnPropertySymbols;var tO=Object.prototype.hasOwnProperty,rO=Object.prototype.propertyIsEnumerable;var bp=Math.pow,YS=(Zr,_r,Se)=>_r in Zr?JD(Zr,_r,{enumerable:!0,configurable:!0,writable:!0,value:Se}):Zr[_r]=Se,$S=(Zr,_r)=>{for(var Se in _r||(_r={}))tO.call(_r,Se)&&YS(Zr,Se,_r[Se]);if(qS)for(var Se of qS(_r))rO.call(_r,Se)&&YS(Zr,Se,_r[Se]);return Zr},KS=(Zr,_r)=>QD(Zr,eO(_r));var oE=(Zr,_r,Se)=>new Promise((ve,Ze)=>{var M=be=>{try{de(Se.next(be))}catch(Le){Ze(Le)}},R=be=>{try{de(Se.throw(be))}catch(Le){Ze(Le)}},de=be=>be.done?ve(be.value):Promise.resolve(be.value).then(M,R);de((Se=Se.apply(Zr,_r)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[5855],{41978:function(Zr){"use strict";(function(_r,Se){Zr.exports=Se()})(this,function(){function _r(Re){var Ce=[];return Re.AMapUI&&Ce.push(Se(Re.AMapUI)),Re.Loca&&Ce.push(ve(Re.Loca)),Promise.all(Ce)}function Se(Re){return new Promise(function(Ce,He){var Xe=[];if(Re.plugins)for(var Ke=0;Ke',function(Zr){try{let Ce=function(){de||(de=!0,M())},He=function(){try{R.documentElement.doScroll("left")}catch(Xe){return void setTimeout(He,50)}Ce()};var Le=Ce,Re=He,Se=(Se=document.getElementsByTagName("script"))[Se.length-1],_r=Se.getAttribute("data-injectcss"),Se=Se.getAttribute("data-disable-injectsvg");if(!Se){var ve,Ze,M,R,de,be=function(Xe,Ke){Ke.parentNode.insertBefore(Xe,Ke)};if(_r&&!Zr.__iconfont__svg__cssinject__){Zr.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(Xe){console&&console.log(Xe)}}ve=function(){var Xe,Ke=document.createElement("div");Ke.innerHTML=Zr._iconfont_svg_string_3580659,(Ke=Ke.getElementsByTagName("svg")[0])&&(Ke.setAttribute("aria-hidden","true"),Ke.style.position="absolute",Ke.style.width=0,Ke.style.height=0,Ke.style.overflow="hidden",Ke=Ke,(Xe=document.body).firstChild?be(Ke,Xe.firstChild):Xe.appendChild(Ke))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(ve,0):(Ze=function(){document.removeEventListener("DOMContentLoaded",Ze,!1),ve()},document.addEventListener("DOMContentLoaded",Ze,!1)):document.attachEvent&&(M=ve,R=Zr.document,de=!1,He(),R.onreadystatechange=function(){R.readyState=="complete"&&(R.onreadystatechange=null,Ce())})}}catch(Ce){}}(window)},46236:function(Zr,_r,Se){(function(ve,Ze){Ze(_r,Se(5527))})(this,function(ve,Ze){"use strict";var M={draw:"crosshair",pointHover:"pointer",pointDrag:"move",lineHover:"pointer",lineDrag:"move",polygonHover:"pointer",polygonDrag:"move"},R={point:[],line:[],polygon:[],midPoint:[],dashLine:[],text:[]},de="top",be="bottom",Le="right",Re="left",Ce="auto",He=[de,be,Le,Re],Xe="start",Ke="end",Ve="clippingParents",et="viewport",er="popper",fr="reference",Ar=He.reduce(function(p,v){return p.concat([v+"-"+Xe,v+"-"+Ke])},[]),pn=[].concat(He,[Ce]).reduce(function(p,v){return p.concat([v,v+"-"+Xe,v+"-"+Ke])},[]),Kn=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Jn(p){return p?(p.nodeName||"").toLowerCase():null}function ki(p){if(p==null)return window;if(""+p!="[object Window]"){var v=p.ownerDocument;return v&&v.defaultView||window}return p}function pa(p){return p instanceof ki(p).Element||p instanceof Element}function xr(p){return p instanceof ki(p).HTMLElement||p instanceof HTMLElement}function jt(p){return typeof ShadowRoot!="undefined"&&(p instanceof ki(p).ShadowRoot||p instanceof ShadowRoot)}var Jr={name:"applyStyles",enabled:!0,phase:"write",fn:function(p){var v=p.state;Object.keys(v.elements).forEach(function(m){var w=v.styles[m]||{},D=v.attributes[m]||{},N=v.elements[m];xr(N)&&Jn(N)&&(Object.assign(N.style,w),Object.keys(D).forEach(function(W){var $=D[W];$===!1?N.removeAttribute(W):N.setAttribute(W,$===!0?"":$)}))})},effect:function(p){var v=p.state,m={popper:{position:v.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(v.elements.popper.style,m.popper),v.styles=m,v.elements.arrow&&Object.assign(v.elements.arrow.style,m.arrow),function(){Object.keys(v.elements).forEach(function(w){var D=v.elements[w],N=v.attributes[w]||{},W=Object.keys(v.styles.hasOwnProperty(w)?v.styles[w]:m[w]).reduce(function($,ie){return $[ie]="",$},{});xr(D)&&Jn(D)&&(Object.assign(D.style,W),Object.keys(N).forEach(function($){D.removeAttribute($)}))})}},requires:["computeStyles"]};function gr(p){return p.split("-")[0]}var rn=Math.max,jn=Math.min,qe=Math.round;function Dt(){var p=navigator.userAgentData;return p!=null&&p.brands&&Array.isArray(p.brands)?p.brands.map(function(v){return v.brand+"/"+v.version}).join(" "):navigator.userAgent}function $e(){return!/^((?!chrome|android).)*safari/i.test(Dt())}function Pt(p,v,m){v===void 0&&(v=!1),m===void 0&&(m=!1);var w=p.getBoundingClientRect(),D=1,N=1;v&&xr(p)&&(D=p.offsetWidth>0&&qe(w.width)/p.offsetWidth||1,N=p.offsetHeight>0&&qe(w.height)/p.offsetHeight||1);var W=(pa(p)?ki(p):window).visualViewport,$=!$e()&&m,ie=(w.left+($&&W?W.offsetLeft:0))/D,pe=(w.top+($&&W?W.offsetTop:0))/N,we=w.width/D,ke=w.height/N;return{width:we,height:ke,top:pe,right:ie+we,bottom:pe+ke,left:ie,x:ie,y:pe}}function vt(p){var v=Pt(p),m=p.offsetWidth,w=p.offsetHeight;return Math.abs(v.width-m)>1||(m=v.width),Math.abs(v.height-w)>1||(w=v.height),{x:p.offsetLeft,y:p.offsetTop,width:m,height:w}}function rr(p,v){var m=v.getRootNode&&v.getRootNode();if(p.contains(v))return!0;if(m&&jt(m)){var w=v;do{if(w&&p.isSameNode(w))return!0;w=w.parentNode||w.host}while(w)}return!1}function ar(p){return ki(p).getComputedStyle(p)}function wr(p){return["table","td","th"].indexOf(Jn(p))>=0}function Cr(p){return((pa(p)?p.ownerDocument:p.document)||window.document).documentElement}function an(p){return Jn(p)==="html"?p:p.assignedSlot||p.parentNode||(jt(p)?p.host:null)||Cr(p)}function yi(p){return xr(p)&&ar(p).position!=="fixed"?p.offsetParent:null}function li(p){for(var v=ki(p),m=yi(p);m&&wr(m)&&ar(m).position==="static";)m=yi(m);return m&&(Jn(m)==="html"||Jn(m)==="body"&&ar(m).position==="static")?v:m||function(w){var D=/firefox/i.test(Dt());if(/Trident/i.test(Dt())&&xr(w)&&ar(w).position==="fixed")return null;var N=an(w);for(jt(N)&&(N=N.host);xr(N)&&0>["html","body"].indexOf(Jn(N));){var W=ar(N);if(W.transform!=="none"||W.perspective!=="none"||W.contain==="paint"||["transform","perspective"].indexOf(W.willChange)!==-1||D&&W.willChange==="filter"||D&&W.filter&&W.filter!=="none")return N;N=N.parentNode}return null}(p)||v}function Uo(p){return 0>["top","bottom"].indexOf(p)?"y":"x"}function vi(p,v,m){return rn(p,jn(v,m))}function bo(p){return Object.assign({},{top:0,right:0,bottom:0,left:0},p)}function So(p,v){return v.reduce(function(m,w){return m[w]=p,m},{})}var Xi={name:"arrow",enabled:!0,phase:"main",fn:function(p){var v,m=p.state,w=p.name,D=p.options,N=m.elements.arrow,W=m.modifiersData.popperOffsets,$=gr(m.placement),ie=Uo($),pe=[Re,Le].indexOf($)>=0?"height":"width";if(N&&W){var we=function(nr,br){return bo(typeof(nr=typeof nr=="function"?nr(Object.assign({},br.rects,{placement:br.placement})):nr)!="number"?nr:So(nr,He))}(D.padding,m),ke=vt(N),Ge=ie==="y"?de:Re,ht=ie==="y"?be:Le,mt=m.rects.reference[pe]+m.rects.reference[ie]-W[ie]-m.rects.popper[pe],St=W[ie]-m.rects.reference[ie],xt=li(N),bt=xt?ie==="y"?xt.clientHeight||0:xt.clientWidth||0:0,kt=bt/2-ke[pe]/2+(mt/2-St/2),ft=vi(we[Ge],kt,bt-ke[pe]-we[ht]);m.modifiersData[w]=((v={})[ie]=ft,v.centerOffset=ft-kt,v)}},effect:function(p){var v=p.state,m=p.options.element,w=m===void 0?"[data-popper-arrow]":m;w!=null&&(typeof w!="string"||(w=v.elements.popper.querySelector(w)))&&rr(v.elements.popper,w)&&(v.elements.arrow=w)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Mi(p){return p.split("-")[1]}var qo={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ui(p){var v,m=p.popper,w=p.popperRect,D=p.placement,N=p.variation,W=p.offsets,$=p.position,ie=p.gpuAcceleration,pe=p.adaptive,we=p.roundOffsets,ke=p.isFixed,Ge=W.x,ht=Ge===void 0?0:Ge,mt=W.y,St=mt===void 0?0:mt,xt=typeof we=="function"?we({x:ht,y:St}):{x:ht,y:St};ht=xt.x,St=xt.y;var bt=W.hasOwnProperty("x"),kt=W.hasOwnProperty("y"),ft=Re,nr=de,br=window;if(pe){var Pr=li(m),Mn="clientHeight",yn="clientWidth";Pr===ki(m)&&ar(Pr=Cr(m)).position!=="static"&&$==="absolute"&&(Mn="scrollHeight",yn="scrollWidth"),(D===de||(D===Re||D===Le)&&N===Ke)&&(nr=be,St-=(ke&&Pr===br&&br.visualViewport?br.visualViewport.height:Pr[Mn])-w.height,St*=ie?1:-1),(D===Re||(D===de||D===be)&&N===Ke)&&(ft=Le,ht-=(ke&&Pr===br&&br.visualViewport?br.visualViewport.width:Pr[yn])-w.width,ht*=ie?1:-1)}var kr,Ai=Object.assign({position:$},pe&&qo),$n=we===!0?function(ti,ri){var hn=ti.y,An=ri.devicePixelRatio||1;return{x:qe(ti.x*An)/An||0,y:qe(hn*An)/An||0}}({x:ht,y:St},ki(m)):{x:ht,y:St};return ht=$n.x,St=$n.y,Object.assign({},Ai,ie?((kr={})[nr]=kt?"0":"",kr[ft]=bt?"0":"",kr.transform=(br.devicePixelRatio||1)>1?"translate3d("+ht+"px, "+St+"px, 0)":"translate("+ht+"px, "+St+"px)",kr):((v={})[nr]=kt?St+"px":"",v[ft]=bt?ht+"px":"",v.transform="",v))}var Qi={passive:!0},Vi={left:"right",right:"left",bottom:"top",top:"bottom"};function Pi(p){return p.replace(/left|right|bottom|top/g,function(v){return Vi[v]})}var ds={start:"end",end:"start"};function Ur(p){return p.replace(/start|end/g,function(v){return ds[v]})}function ls(p){var v=ki(p);return{scrollLeft:v.pageXOffset,scrollTop:v.pageYOffset}}function dr(p){return Pt(Cr(p)).left+ls(p).scrollLeft}function he(p){var v=ar(p);return/auto|scroll|overlay|hidden/.test(v.overflow+v.overflowY+v.overflowX)}function We(p){return 0>["html","body","#document"].indexOf(Jn(p))?xr(p)&&he(p)?p:We(an(p)):p.ownerDocument.body}function at(p,v){var m;v===void 0&&(v=[]);var w=We(p),D=w===((m=p.ownerDocument)==null?void 0:m.body),N=ki(w),W=D?[N].concat(N.visualViewport||[],he(w)?w:[]):w,$=v.concat(W);return D?$:$.concat(at(an(W)))}function Ot(p){return Object.assign({},p,{left:p.x,top:p.y,right:p.x+p.width,bottom:p.y+p.height})}function or(p,v,m){return v===et?Ot(function(w,D){var N=ki(w),W=Cr(w),$=N.visualViewport,ie=W.clientWidth,pe=W.clientHeight,we=0,ke=0;if($){ie=$.width,pe=$.height;var Ge=$e();(Ge||!Ge&&D==="fixed")&&(we=$.offsetLeft,ke=$.offsetTop)}return{width:ie,height:pe,x:we+dr(w),y:ke}}(p,m)):pa(v)?function(w,D){var N=Pt(w,!1,D==="fixed");return N.top=N.top+w.clientTop,N.left=N.left+w.clientLeft,N.bottom=N.top+w.clientHeight,N.right=N.left+w.clientWidth,N.width=w.clientWidth,N.height=w.clientHeight,N.x=N.left,N.y=N.top,N}(v,m):Ot(function(w){var D,N=Cr(w),W=ls(w),$=(D=w.ownerDocument)==null?void 0:D.body,ie=rn(N.scrollWidth,N.clientWidth,$?$.scrollWidth:0,$?$.clientWidth:0),pe=rn(N.scrollHeight,N.clientHeight,$?$.scrollHeight:0,$?$.clientHeight:0),we=-W.scrollLeft+dr(w),ke=-W.scrollTop;return ar($||N).direction==="rtl"&&(we+=rn(N.clientWidth,$?$.clientWidth:0)-ie),{width:ie,height:pe,x:we,y:ke}}(Cr(p)))}function Wr(p,v,m,w){var D=v==="clippingParents"?function($){var ie=at(an($)),pe=["absolute","fixed"].indexOf(ar($).position)>=0&&xr($)?li($):$;return pa(pe)?ie.filter(function(we){return pa(we)&&rr(we,pe)&&Jn(we)!=="body"}):[]}(p):[].concat(v),N=[].concat(D,[m]),W=N.reduce(function($,ie){var pe=or(p,ie,w);return $.top=rn(pe.top,$.top),$.right=jn(pe.right,$.right),$.bottom=jn(pe.bottom,$.bottom),$.left=rn(pe.left,$.left),$},or(p,N[0],w));return W.width=W.right-W.left,W.height=W.bottom-W.top,W.x=W.left,W.y=W.top,W}function In(p){var v,m=p.reference,w=p.element,D=p.placement,N=D?gr(D):null,W=D?Mi(D):null,$=m.x+m.width/2-w.width/2,ie=m.y+m.height/2-w.height/2;switch(N){case de:v={x:$,y:m.y-w.height};break;case be:v={x:$,y:m.y+m.height};break;case Le:v={x:m.x+m.width,y:ie};break;case Re:v={x:m.x-w.width,y:ie};break;default:v={x:m.x,y:m.y}}var pe=N?Uo(N):null;if(pe!=null){var we=pe==="y"?"height":"width";switch(W){case Xe:v[pe]=v[pe]-(m[we]/2-w[we]/2);break;case Ke:v[pe]=v[pe]+(m[we]/2-w[we]/2)}}return v}function kn(p,v){v===void 0&&(v={});var m=v.placement,w=m===void 0?p.placement:m,D=v.strategy,N=D===void 0?p.strategy:D,W=v.boundary,$=W===void 0?Ve:W,ie=v.rootBoundary,pe=ie===void 0?et:ie,we=v.elementContext,ke=we===void 0?er:we,Ge=v.altBoundary,ht=Ge!==void 0&&Ge,mt=v.padding,St=mt===void 0?0:mt,xt=bo(typeof St!="number"?St:So(St,He)),bt=p.rects.popper,kt=p.elements[ht?ke===er?fr:er:ke],ft=Wr(pa(kt)?kt:kt.contextElement||Cr(p.elements.popper),$,pe,N),nr=Pt(p.elements.reference),br=In({reference:nr,element:bt,strategy:"absolute",placement:w}),Pr=Ot(Object.assign({},bt,br)),Mn=ke===er?Pr:nr,yn={top:ft.top-Mn.top+xt.top,bottom:Mn.bottom-ft.bottom+xt.bottom,left:ft.left-Mn.left+xt.left,right:Mn.right-ft.right+xt.right},kr=p.modifiersData.offset;if(ke===er&&kr){var Ai=kr[w];Object.keys(yn).forEach(function($n){var ti=0>[Le,be].indexOf($n)?-1:1;yn[$n]+=Ai[0>[de,be].indexOf($n)?"x":"y"]*ti})}return yn}function eo(p,v){v===void 0&&(v={});var m=v.boundary,w=v.rootBoundary,D=v.padding,N=v.flipVariations,W=v.allowedAutoPlacements,$=W===void 0?pn:W,ie=Mi(v.placement),pe=ie?N?Ar:Ar.filter(function(Ge){return Mi(Ge)===ie}):He,we=pe.filter(function(Ge){return $.indexOf(Ge)>=0});we.length===0&&(we=pe);var ke=we.reduce(function(Ge,ht){return Ge[ht]=kn(p,{placement:ht,boundary:m,rootBoundary:w,padding:D})[gr(ht)],Ge},{});return Object.keys(ke).sort(function(Ge,ht){return ke[Ge]-ke[ht]})}var un={name:"flip",enabled:!0,phase:"main",fn:function(p){var v=p.state,m=p.options,w=p.name;if(!v.modifiersData[w]._skip){for(var D=m.mainAxis,N=D===void 0||D,W=m.altAxis,$=W===void 0||W,ie=m.fallbackPlacements,pe=m.padding,we=m.boundary,ke=m.rootBoundary,Ge=m.altBoundary,ht=m.flipVariations,mt=ht===void 0||ht,St=m.allowedAutoPlacements,xt=v.options.placement,bt=gr(xt),kt=ie||(bt===xt||!mt?[Pi(xt)]:function(zi){if(gr(zi)===Ce)return[];var Vo=Pi(zi);return[Ur(zi),Vo,Ur(Vo)]}(xt)),ft=[xt].concat(kt).reduce(function(zi,Vo){return zi.concat(gr(Vo)===Ce?eo(v,{placement:Vo,boundary:we,rootBoundary:ke,padding:pe,flipVariations:mt,allowedAutoPlacements:St}):Vo)},[]),nr=v.rects.reference,br=v.rects.popper,Pr=new Map,Mn=!0,yn=ft[0],kr=0;ft.length>kr;kr++){var Ai=ft[kr],$n=gr(Ai),ti=Mi(Ai)===Xe,ri=[de,be].indexOf($n)>=0,hn=ri?"width":"height",An=kn(v,{placement:Ai,boundary:we,rootBoundary:ke,altBoundary:Ge,padding:pe}),Yi=ri?ti?Le:Re:ti?be:de;nr[hn]>br[hn]&&(Yi=Pi(Yi));var Ci=Pi(Yi),fo=[];if(N&&fo.push(0>=An[$n]),$&&fo.push(0>=An[Yi],0>=An[Ci]),fo.every(function(zi){return zi})){yn=Ai,Mn=!1;break}Pr.set(Ai,fo)}if(Mn)for(var Go=function(zi){var Vo=ft.find(function(Ka){var ta=Pr.get(Ka);if(ta)return ta.slice(0,zi).every(function(ka){return ka})});if(Vo)return yn=Vo,"break"},hi=mt?3:1;hi>0&&Go(hi)!=="break";hi--);v.placement!==yn&&(v.modifiersData[w]._skip=!0,v.placement=yn,v.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function To(p,v,m){return m===void 0&&(m={x:0,y:0}),{top:p.top-v.height-m.y,right:p.right-v.width+m.x,bottom:p.bottom-v.height+m.y,left:p.left-v.width-m.x}}function Ti(p){return[de,Le,be,Re].some(function(v){return p[v]>=0})}var Lo={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(p){var v=p.state,m=p.name,w=p.options.offset,D=w===void 0?[0,0]:w,N=pn.reduce(function(ie,pe){return ie[pe]=function(we,ke,Ge){var ht=gr(we),mt=0>[Re,de].indexOf(ht)?1:-1,St=typeof Ge=="function"?Ge(Object.assign({},ke,{placement:we})):Ge,xt=St[0],bt=St[1];return xt=xt||0,bt=(bt||0)*mt,0>[Re,Le].indexOf(ht)?{x:xt,y:bt}:{x:bt,y:xt}}(pe,v.rects,D),ie},{}),W=N[v.placement],$=W.y;v.modifiersData.popperOffsets!=null&&(v.modifiersData.popperOffsets.x+=W.x,v.modifiersData.popperOffsets.y+=$),v.modifiersData[m]=N}},wa={name:"preventOverflow",enabled:!0,phase:"main",fn:function(p){var v=p.state,m=p.options,w=p.name,D=m.mainAxis,N=D===void 0||D,W=m.altAxis,$=W!==void 0&&W,ie=m.tether,pe=ie===void 0||ie,we=m.tetherOffset,ke=we===void 0?0:we,Ge=kn(v,{boundary:m.boundary,rootBoundary:m.rootBoundary,padding:m.padding,altBoundary:m.altBoundary}),ht=gr(v.placement),mt=Mi(v.placement),St=!mt,xt=Uo(ht),bt=xt==="x"?"y":"x",kt=v.modifiersData.popperOffsets,ft=v.rects.reference,nr=v.rects.popper,br=typeof ke=="function"?ke(Object.assign({},v.rects,{placement:v.placement})):ke,Pr=typeof br=="number"?{mainAxis:br,altAxis:br}:Object.assign({mainAxis:0,altAxis:0},br),Mn=v.modifiersData.offset?v.modifiersData.offset[v.placement]:null,yn={x:0,y:0};if(kt){if(N){var kr,Ai=xt==="y"?de:Re,$n=xt==="y"?be:Le,ti=xt==="y"?"height":"width",ri=kt[xt],hn=ri+Ge[Ai],An=ri-Ge[$n],Yi=pe?-nr[ti]/2:0,Ci=mt===Xe?ft[ti]:nr[ti],fo=mt===Xe?-nr[ti]:-ft[ti],Go=v.elements.arrow,hi=pe&&Go?vt(Go):{width:0,height:0},zi=v.modifiersData["arrow#persistent"]?v.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Vo=zi[Ai],Ka=zi[$n],ta=vi(0,ft[ti],hi[ti]),ka=St?ft[ti]/2-Yi-ta-Vo-Pr.mainAxis:Ci-ta-Vo-Pr.mainAxis,ca=St?-ft[ti]/2+Yi+ta+Ka+Pr.mainAxis:fo+ta+Ka+Pr.mainAxis,Eo=v.elements.arrow&&li(v.elements.arrow),Pa=(kr=Mn==null?void 0:Mn[xt])!=null?kr:0,na=ri+ca-Pa,ha=vi(pe?jn(hn,ri+ka-Pa-(Eo?xt==="y"?Eo.clientTop||0:Eo.clientLeft||0:0)):hn,ri,pe?rn(An,na):An);kt[xt]=ha,yn[xt]=ha-ri}if($){var Xs,Ls=kt[bt],Ea=bt==="y"?"height":"width",ws=Ls+Ge[xt==="x"?de:Re],qs=Ls-Ge[xt==="x"?be:Le],ua=[de,Re].indexOf(ht)!==-1,cu=(Xs=Mn==null?void 0:Mn[bt])!=null?Xs:0,c=ua?ws:Ls-ft[Ea]-nr[Ea]-cu+Pr.altAxis,o=ua?Ls+ft[Ea]+nr[Ea]-cu-Pr.altAxis:qs,f=pe&&ua?function(E,L,V){var X=vi(E,L,V);return X>V?V:X}(c,Ls,o):vi(pe?c:ws,Ls,pe?o:qs);kt[bt]=f,yn[bt]=f-Ls}v.modifiersData[w]=yn}},requiresIfExists:["offset"]};function dn(p,v,m){m===void 0&&(m=!1);var w,D,N=xr(v),W=xr(v)&&function(ke){var Ge=ke.getBoundingClientRect(),ht=qe(Ge.width)/ke.offsetWidth||1,mt=qe(Ge.height)/ke.offsetHeight||1;return ht!==1||mt!==1}(v),$=Cr(v),ie=Pt(p,W,m),pe={scrollLeft:0,scrollTop:0},we={x:0,y:0};return(N||!N&&!m)&&((Jn(v)!=="body"||he($))&&(pe=(w=v)!==ki(w)&&xr(w)?{scrollLeft:(D=w).scrollLeft,scrollTop:D.scrollTop}:ls(w)),xr(v)?((we=Pt(v,!0)).x+=v.clientLeft,we.y+=v.clientTop):$&&(we.x=dr($))),{x:ie.left+pe.scrollLeft-we.x,y:ie.top+pe.scrollTop-we.y,width:ie.width,height:ie.height}}function co(p){var v=new Map,m=new Set,w=[];function D(N){m.add(N.name),[].concat(N.requires||[],N.requiresIfExists||[]).forEach(function(W){if(!m.has(W)){var $=v.get(W);$&&D($)}}),w.push(N)}return p.forEach(function(N){v.set(N.name,N)}),p.forEach(function(N){m.has(N.name)||D(N)}),w}var no={placement:"bottom",modifiers:[],strategy:"absolute"};function Za(){for(var p=arguments.length,v=Array(p),m=0;p>m;m++)v[m]=arguments[m];return!v.some(function(w){return!(w&&typeof w.getBoundingClientRect=="function")})}function ms(p){p===void 0&&(p={});var v=p.defaultModifiers,m=v===void 0?[]:v,w=p.defaultOptions,D=w===void 0?no:w;return function(N,W,$){$===void 0&&($=D);var ie,pe,we={placement:"bottom",orderedModifiers:[],options:Object.assign({},no,D),modifiersData:{},elements:{reference:N,popper:W},attributes:{},styles:{}},ke=[],Ge=!1,ht={state:we,setOptions:function(St){var xt=typeof St=="function"?St(we.options):St;mt(),we.options=Object.assign({},D,we.options,xt),we.scrollParents={reference:pa(N)?at(N):N.contextElement?at(N.contextElement):[],popper:at(W)};var bt,kt,ft=function(nr){var br=co(nr);return Kn.reduce(function(Pr,Mn){return Pr.concat(br.filter(function(yn){return yn.phase===Mn}))},[])}((bt=[].concat(m,we.options.modifiers),kt=bt.reduce(function(nr,br){var Pr=nr[br.name];return nr[br.name]=Pr?Object.assign({},Pr,br,{options:Object.assign({},Pr.options,br.options),data:Object.assign({},Pr.data,br.data)}):br,nr},{}),Object.keys(kt).map(function(nr){return kt[nr]})));return we.orderedModifiers=ft.filter(function(nr){return nr.enabled}),we.orderedModifiers.forEach(function(nr){var br=nr.options,Pr=nr.effect;if(typeof Pr=="function"){var Mn=Pr({state:we,name:nr.name,instance:ht,options:br===void 0?{}:br});ke.push(Mn||function(){})}}),ht.update()},forceUpdate:function(){if(!Ge){var St=we.elements,xt=St.reference,bt=St.popper;if(Za(xt,bt)){we.rects={reference:dn(xt,li(bt),we.options.strategy==="fixed"),popper:vt(bt)},we.reset=!1,we.placement=we.options.placement,we.orderedModifiers.forEach(function(Pr){return we.modifiersData[Pr.name]=Object.assign({},Pr.data)});for(var kt=0;we.orderedModifiers.length>kt;kt++)if(we.reset!==!0){var ft=we.orderedModifiers[kt],nr=ft.fn,br=ft.options;typeof nr=="function"&&(we=nr({state:we,options:br===void 0?{}:br,name:ft.name,instance:ht})||we)}else we.reset=!1,kt=-1}}},update:(ie=function(){return new Promise(function(St){ht.forceUpdate(),St(we)})},function(){return pe||(pe=new Promise(function(St){Promise.resolve().then(function(){pe=void 0,St(ie())})})),pe}),destroy:function(){mt(),Ge=!0}};if(!Za(N,W))return ht;function mt(){ke.forEach(function(St){return St()}),ke=[]}return ht.setOptions($).then(function(St){!Ge&&$.onFirstUpdate&&$.onFirstUpdate(St)}),ht}}var Ji=ms({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(p){var v=p.state,m=p.instance,w=p.options,D=w.scroll,N=D===void 0||D,W=w.resize,$=W===void 0||W,ie=ki(v.elements.popper),pe=[].concat(v.scrollParents.reference,v.scrollParents.popper);return N&&pe.forEach(function(we){we.addEventListener("scroll",m.update,Qi)}),$&&ie.addEventListener("resize",m.update,Qi),function(){N&&pe.forEach(function(we){we.removeEventListener("scroll",m.update,Qi)}),$&&ie.removeEventListener("resize",m.update,Qi)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(p){var v=p.state;v.modifiersData[p.name]=In({reference:v.rects.reference,element:v.rects.popper,strategy:"absolute",placement:v.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(p){var v=p.state,m=p.options,w=m.gpuAcceleration,D=w===void 0||w,N=m.adaptive,W=N===void 0||N,$=m.roundOffsets,ie=$===void 0||$,pe={placement:gr(v.placement),variation:Mi(v.placement),popper:v.elements.popper,popperRect:v.rects.popper,gpuAcceleration:D,isFixed:v.options.strategy==="fixed"};v.modifiersData.popperOffsets!=null&&(v.styles.popper=Object.assign({},v.styles.popper,ui(Object.assign({},pe,{offsets:v.modifiersData.popperOffsets,position:v.options.strategy,adaptive:W,roundOffsets:ie})))),v.modifiersData.arrow!=null&&(v.styles.arrow=Object.assign({},v.styles.arrow,ui(Object.assign({},pe,{offsets:v.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:ie})))),v.attributes.popper=Object.assign({},v.attributes.popper,{"data-popper-placement":v.placement})},data:{}},Jr,Lo,un,wa,Xi,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(p){var v=p.state,m=p.name,w=v.rects.reference,D=v.rects.popper,N=v.modifiersData.preventOverflow,W=kn(v,{elementContext:"reference"}),$=kn(v,{altBoundary:!0}),ie=To(W,w),pe=To($,D,N),we=Ti(ie),ke=Ti(pe);v.modifiersData[m]={referenceClippingOffsets:ie,popperEscapeOffsets:pe,isReferenceHidden:we,hasPopperEscaped:ke},v.attributes.popper=Object.assign({},v.attributes.popper,{"data-popper-reference-hidden":we,"data-popper-escaped":ke})}}]}),Us="tippy-content",Lt="tippy-backdrop",Ne="tippy-arrow",re="tippy-svg-arrow",le={passive:!0,capture:!0},ge=function(){return document.body};function ye(p,v,m){if(Array.isArray(p)){var w=p[v];return w==null?Array.isArray(m)?m[v]:m:w}return p}function ze(p,v){var m={}.toString.call(p);return m.indexOf("[object")===0&&m.indexOf(v+"]")>-1}function je(p,v){return typeof p=="function"?p.apply(void 0,v):p}function Ue(p,v){return v===0?p:function(w){clearTimeout(m),m=setTimeout(function(){p(w)},v)};var m}function Ae(p){return[].concat(p)}function Je(p,v){p.indexOf(v)===-1&&p.push(v)}function wt(p){return[].slice.call(p)}function Ht(p){return Object.keys(p).reduce(function(v,m){return p[m]!==void 0&&(v[m]=p[m]),v},{})}function Fr(){return document.createElement("div")}function mr(p){return["Element","Fragment"].some(function(v){return ze(p,v)})}function Sr(p){return ze(p,"MouseEvent")}function fn(p){return mr(p)?[p]:function(v){return ze(v,"NodeList")}(p)?wt(p):Array.isArray(p)?p:wt(document.querySelectorAll(p))}function xn(p,v){p.forEach(function(m){m&&(m.style.transitionDuration=v+"ms")})}function Lr(p,v){p.forEach(function(m){m&&m.setAttribute("data-state",v)})}function Nn(p){var v,m=Ae(p)[0];return m!=null&&(v=m.ownerDocument)!=null&&v.body?m.ownerDocument:document}function bn(p,v,m){var w=v+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(D){p[w](D,m)})}function En(p,v){for(var m=v;m;){var w;if(p.contains(m))return!0;m=m.getRootNode==null||(w=m.getRootNode())==null?void 0:w.host}return!1}var io={isTouch:!1},On=0;function Ao(){io.isTouch||(io.isTouch=!0,window.performance&&document.addEventListener("mousemove",ia))}function ia(){var p=performance.now();20>p-On&&(io.isTouch=!1,document.removeEventListener("mousemove",ia)),On=p}function Ho(){var p,v=document.activeElement;(p=v)&&p._tippy&&p._tippy.reference===p&&v.blur&&!v._tippy.state.isVisible&&v.blur()}var Ga=typeof window!="undefined"&&typeof document!="undefined"&&!!window.msCrypto,Wo=Object.assign({appendTo:ge,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Hl=Object.keys(Wo);function ns(p){var v=(p.plugins||[]).reduce(function(m,w){var D,N=w.name;return N&&(m[N]=p[N]!==void 0?p[N]:(D=Wo[N])!=null?D:w.defaultValue),m},{});return Object.assign({},p,v)}function Yo(p,v){var m=Object.assign({},v,{content:je(v.content,[p])},v.ignoreAttributes?{}:function(w,D){return(D?Object.keys(ns(Object.assign({},Wo,{plugins:D}))):Hl).reduce(function(N,W){var $=(w.getAttribute("data-tippy-"+W)||"").trim();if(!$)return N;if(W==="content")N[W]=$;else try{N[W]=JSON.parse($)}catch(ie){N[W]=$}return N},{})}(p,v.plugins));return m.aria=Object.assign({},Wo.aria,m.aria),m.aria={expanded:m.aria.expanded==="auto"?v.interactive:m.aria.expanded,content:m.aria.content==="auto"?v.interactive?null:"describedby":m.aria.content},m}var _a=function(){return"innerHTML"};function $o(p,v){p[_a()]=v}function Fo(p){var v=Fr();return p===!0?v.className=Ne:(v.className=re,mr(p)?v.appendChild(p):$o(v,p)),v}function us(p,v){mr(v.content)?($o(p,""),p.appendChild(v.content)):typeof v.content!="function"&&(v.allowHTML?$o(p,v.content):p.textContent=v.content)}function xc(p){var v=p.firstElementChild,m=wt(v.children);return{box:v,content:m.find(function(w){return w.classList.contains(Us)}),arrow:m.find(function(w){return w.classList.contains(Ne)||w.classList.contains(re)}),backdrop:m.find(function(w){return w.classList.contains(Lt)})}}function Ba(p){var v=Fr(),m=Fr();m.className="tippy-box",m.setAttribute("data-state","hidden"),m.setAttribute("tabindex","-1");var w=Fr();function D(N,W){var $=xc(v),ie=$.box,pe=$.content,we=$.arrow;W.theme?ie.setAttribute("data-theme",W.theme):ie.removeAttribute("data-theme"),typeof W.animation=="string"?ie.setAttribute("data-animation",W.animation):ie.removeAttribute("data-animation"),W.inertia?ie.setAttribute("data-inertia",""):ie.removeAttribute("data-inertia"),ie.style.maxWidth=typeof W.maxWidth=="number"?W.maxWidth+"px":W.maxWidth,W.role?ie.setAttribute("role",W.role):ie.removeAttribute("role"),N.content===W.content&&N.allowHTML===W.allowHTML||us(pe,p.props),W.arrow?we?N.arrow!==W.arrow&&(ie.removeChild(we),ie.appendChild(Fo(W.arrow))):ie.appendChild(Fo(W.arrow)):we&&ie.removeChild(we)}return w.className=Us,w.setAttribute("data-state","hidden"),us(w,p.props),v.appendChild(m),m.appendChild(w),D(p.props,p.props),{popper:v,onUpdate:D}}Ba.$$tippy=!0;var Fa=1,sc=[],Ql=[];function oa(p,v){var m,w,D,N,W,$,ie,pe,we=Yo(p,Object.assign({},Wo,ns(Ht(v)))),ke=!1,Ge=!1,ht=!1,mt=!1,St=[],xt=Ue(Xs,we.interactiveDebounce),bt=Fa++,kt=(pe=we.plugins).filter(function(f,E){return pe.indexOf(f)===E}),ft={id:bt,reference:p,popper:Fr(),popperInstance:null,props:we,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:kt,clearDelayTimeouts:function(){clearTimeout(m),clearTimeout(w),cancelAnimationFrame(D)},setProps:function(f){if(!ft.state.isDestroyed){Ci("onBeforeUpdate",[ft,f]),na();var E=ft.props,L=Yo(p,Object.assign({},E,Ht(f),{ignoreAttributes:!0}));ft.props=L,Pa(),E.interactiveDebounce!==L.interactiveDebounce&&(hi(),xt=Ue(Xs,L.interactiveDebounce)),E.triggerTarget&&!L.triggerTarget?Ae(E.triggerTarget).forEach(function(V){V.removeAttribute("aria-expanded")}):L.triggerTarget&&p.removeAttribute("aria-expanded"),Go(),Yi(),Pr&&Pr(E,L),ft.popperInstance&&(qs(),cu().forEach(function(V){requestAnimationFrame(V._tippy.popperInstance.forceUpdate)})),Ci("onAfterUpdate",[ft,f])}},setContent:function(f){ft.setProps({content:f})},show:function(){var f=ft.state.isVisible,E=ft.state.isDestroyed,L=!ft.state.isEnabled,V=io.isTouch&&!ft.props.touch,X=ye(ft.props.duration,0,Wo.duration);if(!(f||E||L||V)&&!ti().hasAttribute("disabled")&&(Ci("onShow",[ft],!1),ft.props.onShow(ft)!==!1)){if(ft.state.isVisible=!0,$n()&&(br.style.visibility="visible"),Yi(),ta(),ft.state.isMounted||(br.style.transition="none"),$n()){var J=hn();xn([J.box,J.content],0)}$=function(){var oe;if(ft.state.isVisible&&!mt){if(mt=!0,br.style.transition=ft.props.moveTransition,$n()&&ft.props.animation){var me=hn(),Me=me.box,De=me.content;xn([Me,De],X),Lr([Me,De],"visible")}fo(),Go(),Je(Ql,ft),(oe=ft.popperInstance)==null||oe.forceUpdate(),Ci("onMount",[ft]),ft.props.animation&&$n()&&function(Ye,ot){ca(Ye,ot)}(X,function(){ft.state.isShown=!0,Ci("onShown",[ft])})}},function(){var oe,me=ft.props.appendTo,Me=ti();oe=ft.props.interactive&&me===ge||me==="parent"?Me.parentNode:je(me,[Me]),oe.contains(br)||oe.appendChild(br),ft.state.isMounted=!0,qs()}()}},hide:function(){var f=!ft.state.isVisible,E=ft.state.isDestroyed,L=!ft.state.isEnabled,V=ye(ft.props.duration,1,Wo.duration);if(!(f||E||L)&&(Ci("onHide",[ft],!1),ft.props.onHide(ft)!==!1)){if(ft.state.isVisible=!1,ft.state.isShown=!1,mt=!1,ke=!1,$n()&&(br.style.visibility="hidden"),hi(),ka(),Yi(!0),$n()){var X=hn(),J=X.box,oe=X.content;ft.props.animation&&(xn([J,oe],V),Lr([J,oe],"hidden"))}fo(),Go(),ft.props.animation?$n()&&function(me,Me){ca(me,function(){!ft.state.isVisible&&br.parentNode&&br.parentNode.contains(br)&&Me()})}(V,ft.unmount):ft.unmount()}},hideWithInteractivity:function(f){ri().addEventListener("mousemove",xt),Je(sc,xt),xt(f)},enable:function(){ft.state.isEnabled=!0},disable:function(){ft.hide(),ft.state.isEnabled=!1},unmount:function(){ft.state.isVisible&&ft.hide(),ft.state.isMounted&&(ua(),cu().forEach(function(f){f._tippy.unmount()}),br.parentNode&&br.parentNode.removeChild(br),Ql=Ql.filter(function(f){return f!==ft}),ft.state.isMounted=!1,Ci("onHidden",[ft]))},destroy:function(){ft.state.isDestroyed||(ft.clearDelayTimeouts(),ft.unmount(),na(),delete p._tippy,ft.state.isDestroyed=!0,Ci("onDestroy",[ft]))}};if(!we.render)return ft;var nr=we.render(ft),br=nr.popper,Pr=nr.onUpdate;br.setAttribute("data-tippy-root",""),br.id="tippy-"+ft.id,ft.popper=br,p._tippy=ft,br._tippy=ft;var Mn=kt.map(function(f){return f.fn(ft)}),yn=p.hasAttribute("aria-expanded");return Pa(),Go(),Yi(),Ci("onCreate",[ft]),we.showOnCreate&&c(),br.addEventListener("mouseenter",function(){ft.props.interactive&&ft.state.isVisible&&ft.clearDelayTimeouts()}),br.addEventListener("mouseleave",function(){ft.props.interactive&&ft.props.trigger.indexOf("mouseenter")>=0&&ri().addEventListener("mousemove",xt)}),ft;function kr(){var f=ft.props.touch;return Array.isArray(f)?f:[f,0]}function Ai(){return kr()[0]==="hold"}function $n(){var f;return!((f=ft.props.render)==null||!f.$$tippy)}function ti(){return ie||p}function ri(){var f=ti().parentNode;return f?Nn(f):document}function hn(){return xc(br)}function An(f){return ft.state.isMounted&&!ft.state.isVisible||io.isTouch||N&&N.type==="focus"?0:ye(ft.props.delay,f?0:1,Wo.delay)}function Yi(f){f===void 0&&(f=!1),br.style.pointerEvents=ft.props.interactive&&!f?"":"none",br.style.zIndex=""+ft.props.zIndex}function Ci(f,E,L){var V;L===void 0&&(L=!0),Mn.forEach(function(X){X[f]&&X[f].apply(X,E)}),L&&(V=ft.props)[f].apply(V,E)}function fo(){var f=ft.props.aria;if(f.content){var E="aria-"+f.content,L=br.id;Ae(ft.props.triggerTarget||p).forEach(function(V){var X=V.getAttribute(E);if(ft.state.isVisible)V.setAttribute(E,X?X+" "+L:L);else{var J=X&&X.replace(L,"").trim();J?V.setAttribute(E,J):V.removeAttribute(E)}})}}function Go(){!yn&&ft.props.aria.expanded&&Ae(ft.props.triggerTarget||p).forEach(function(f){ft.props.interactive?f.setAttribute("aria-expanded",ft.state.isVisible&&f===ti()?"true":"false"):f.removeAttribute("aria-expanded")})}function hi(){ri().removeEventListener("mousemove",xt),sc=sc.filter(function(f){return f!==xt})}function zi(f){if(!io.isTouch||!ht&&f.type!=="mousedown"){var E=f.composedPath&&f.composedPath()[0]||f.target;if(!ft.props.interactive||!En(br,E)){if(Ae(ft.props.triggerTarget||p).some(function(L){return En(L,E)})){if(io.isTouch||ft.state.isVisible&&ft.props.trigger.indexOf("click")>=0)return}else Ci("onClickOutside",[ft,f]);ft.props.hideOnClick===!0&&(ft.clearDelayTimeouts(),ft.hide(),Ge=!0,setTimeout(function(){Ge=!1}),ft.state.isMounted||ka())}}}function Vo(){ht=!0}function Ka(){ht=!1}function ta(){var f=ri();f.addEventListener("mousedown",zi,!0),f.addEventListener("touchend",zi,le),f.addEventListener("touchstart",Ka,le),f.addEventListener("touchmove",Vo,le)}function ka(){var f=ri();f.removeEventListener("mousedown",zi,!0),f.removeEventListener("touchend",zi,le),f.removeEventListener("touchstart",Ka,le),f.removeEventListener("touchmove",Vo,le)}function ca(f,E){var L=hn().box;function V(X){X.target===L&&(bn(L,"remove",V),E())}if(f===0)return E();bn(L,"remove",W),bn(L,"add",V),W=V}function Eo(f,E,L){L===void 0&&(L=!1),Ae(ft.props.triggerTarget||p).forEach(function(V){V.addEventListener(f,E,L),St.push({node:V,eventType:f,handler:E,options:L})})}function Pa(){var f;Ai()&&(Eo("touchstart",ha,{passive:!0}),Eo("touchend",Ls,{passive:!0})),(f=ft.props.trigger,f.split(/\s+/).filter(Boolean)).forEach(function(E){if(E!=="manual")switch(Eo(E,ha),E){case"mouseenter":Eo("mouseleave",Ls);break;case"focus":Eo(Ga?"focusout":"blur",Ea);break;case"focusin":Eo("focusout",Ea)}})}function na(){St.forEach(function(f){f.node.removeEventListener(f.eventType,f.handler,f.options)}),St=[]}function ha(f){var E,L=!1;if(ft.state.isEnabled&&!ws(f)&&!Ge){var V=((E=N)==null?void 0:E.type)==="focus";N=f,ie=f.currentTarget,Go(),!ft.state.isVisible&&Sr(f)&&sc.forEach(function(X){return X(f)}),f.type==="click"&&(0>ft.props.trigger.indexOf("mouseenter")||ke)&&ft.props.hideOnClick!==!1&&ft.state.isVisible?L=!0:c(f),f.type==="click"&&(ke=!L),L&&!V&&o(f)}}function Xs(f){var E=f.target,L=ti().contains(E)||br.contains(E);if(f.type!=="mousemove"||!L){var V=cu().concat(br).map(function(X){var J,oe=(J=X._tippy.popperInstance)==null?void 0:J.state;return oe?{popperRect:X.getBoundingClientRect(),popperState:oe,props:we}:null}).filter(Boolean);(function(X,J){var oe=J.clientX,me=J.clientY;return X.every(function(Me){var De=Me.popperRect,Ye=Me.popperState,ot=Me.props.interactiveBorder,lt=Ye.placement.split("-")[0],Ct=Ye.modifiersData.offset;return!Ct||De.top-me+(lt==="bottom"?Ct.top.y:0)>ot||me-De.bottom-(lt==="top"?Ct.bottom.y:0)>ot||De.left-oe+(lt==="right"?Ct.left.x:0)>ot||oe-De.right-(lt==="left"?Ct.right.x:0)>ot})})(V,f)&&(hi(),o(f))}}function Ls(f){ws(f)||ft.props.trigger.indexOf("click")>=0&&ke||(ft.props.interactive?ft.hideWithInteractivity(f):o(f))}function Ea(f){0>ft.props.trigger.indexOf("focusin")&&f.target!==ti()||ft.props.interactive&&f.relatedTarget&&br.contains(f.relatedTarget)||o(f)}function ws(f){return!!io.isTouch&&Ai()!==f.type.indexOf("touch")>=0}function qs(){ua();var f=ft.props,E=f.popperOptions,L=f.placement,V=f.offset,X=f.getReferenceClientRect,J=f.moveTransition,oe=$n()?xc(br).arrow:null,me=X?{getBoundingClientRect:X,contextElement:X.contextElement||ti()}:p,Me={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ye){var ot=Ye.state;if($n()){var lt=hn().box;["placement","reference-hidden","escaped"].forEach(function(Ct){Ct==="placement"?lt.setAttribute("data-placement",ot.placement):ot.attributes.popper["data-popper-"+Ct]?lt.setAttribute("data-"+Ct,""):lt.removeAttribute("data-"+Ct)}),ot.attributes.popper={}}}},De=[{name:"offset",options:{offset:V}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!J}},Me];$n()&&oe&&De.push({name:"arrow",options:{element:oe,padding:3}}),De.push.apply(De,(E==null?void 0:E.modifiers)||[]),ft.popperInstance=Ji(me,br,Object.assign({},E,{placement:L,onFirstUpdate:$,modifiers:De}))}function ua(){ft.popperInstance&&(ft.popperInstance.destroy(),ft.popperInstance=null)}function cu(){return wt(br.querySelectorAll("[data-tippy-root]"))}function c(f){ft.clearDelayTimeouts(),f&&Ci("onTrigger",[ft,f]),ta();var E=An(!0),L=kr(),V=L[1];io.isTouch&&L[0]==="hold"&&V&&(E=V),E?m=setTimeout(function(){ft.show()},E):ft.show()}function o(f){if(ft.clearDelayTimeouts(),Ci("onUntrigger",[ft,f]),ft.state.isVisible){if(0>ft.props.trigger.indexOf("mouseenter")||0>ft.props.trigger.indexOf("click")||0>["mouseleave","mousemove"].indexOf(f.type)||!ke){var E=An(!1);E?w=setTimeout(function(){ft.state.isVisible&&ft.hide()},E):D=requestAnimationFrame(function(){ft.hide()})}}else ka()}}function Zo(p,v){v===void 0&&(v={});var m=Wo.plugins.concat(v.plugins||[]);document.addEventListener("touchstart",Ao,le),window.addEventListener("blur",Ho);var w=Object.assign({},v,{plugins:m}),D=fn(p).reduce(function(N,W){var $=W&&oa(W,w);return $&&N.push($),N},[]);return mr(p)?D[0]:D}Zo.defaultProps=Wo,Zo.setDefaultProps=function(p){Object.keys(p).forEach(function(v){Wo[v]=p[v]})},Zo.currentInput=io,Object.assign({},Jr,{effect:function(p){var v=p.state,m={popper:{position:v.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(v.elements.popper.style,m.popper),v.styles=m,v.elements.arrow&&Object.assign(v.elements.arrow.style,m.arrow)}});var il={clientX:0,clientY:0},va=[];function El(p){il={clientX:p.clientX,clientY:p.clientY}}var Wa={name:"followCursor",defaultValue:!1,fn:function(p){var v=p.reference,m=Nn(p.props.triggerTarget||v),w=!1,D=!1,N=!0,W=p.props;function $(){return p.props.followCursor==="initial"&&p.state.isVisible}function ie(){m.addEventListener("mousemove",ke)}function pe(){m.removeEventListener("mousemove",ke)}function we(){w=!0,p.setProps({getReferenceClientRect:null}),w=!1}function ke(mt){var St=!mt.target||v.contains(mt.target),xt=p.props.followCursor,bt=mt.clientX,kt=mt.clientY,ft=v.getBoundingClientRect(),nr=bt-ft.left,br=kt-ft.top;!St&&p.props.interactive||p.setProps({getReferenceClientRect:function(){var Pr=v.getBoundingClientRect(),Mn=bt,yn=kt;xt==="initial"&&(Mn=Pr.left+nr,yn=Pr.top+br);var kr=xt==="horizontal"?Pr.top:yn,Ai=xt==="vertical"?Pr.right:Mn,$n=xt==="horizontal"?Pr.bottom:yn,ti=xt==="vertical"?Pr.left:Mn;return{width:Ai-ti,height:$n-kr,top:kr,right:Ai,bottom:$n,left:ti}}})}function Ge(){p.props.followCursor&&(va.push({instance:p,doc:m}),function(mt){mt.addEventListener("mousemove",El)}(m))}function ht(){(va=va.filter(function(mt){return mt.instance!==p})).filter(function(mt){return mt.doc===m}).length===0&&function(mt){mt.removeEventListener("mousemove",El)}(m)}return{onCreate:Ge,onDestroy:ht,onBeforeUpdate:function(){W=p.props},onAfterUpdate:function(mt,St){var xt=St.followCursor;w||xt!==void 0&&W.followCursor!==xt&&(ht(),xt?(Ge(),!p.state.isMounted||D||$()||ie()):(pe(),we()))},onMount:function(){p.props.followCursor&&!D&&(N&&(ke(il),N=!1),$()||ie())},onTrigger:function(mt,St){Sr(St)&&(il={clientX:St.clientX,clientY:St.clientY}),D=St.type==="focus"},onHidden:function(){p.props.followCursor&&(we(),pe(),N=!0)}}}};Zo.setDefaultProps({render:Ba});var Ds,Rl,gu,gl,wl,ol,Qa={showTotalDistance:!1,showDashDistance:!0,showWhen:["normal","active"],format:function(p){return 1e3>p?+p.toFixed(2)+"m":+(p/1e3).toFixed(2)+"km"}},Gl={showWhen:["normal","active"],format:function(p){return p>1e6?"".concat(+(p/1e6).toFixed(2),"km\xB2"):"".concat(+p.toFixed(2),"m\xB2")}},Wl={maxSize:100},ut={remove:["del","backspace"],revert:["command+z","ctrl+z"],redo:["command+shift+z","ctrl+shift+z"]},At={allowHTML:!0,followCursor:!0,placement:"bottom-start",offset:[-10,20],plugins:[Wa],trigger:"manual",hideOnClick:!1,theme:"light"},ir={data:"drawData",pointAdsorbPixel:12,lineAdsorbPixel:10},jr={dotDuration:100,dotDistance:30};function Dn(p,v,m){return v=Ni(v),function(w,D){if(D&&(typeof D=="object"||typeof D=="function"))return D;if(D!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ku(w)}(p,oo()?Reflect.construct(v,m||[],Ni(p).constructor):v.apply(p,m))}function oo(){try{var p=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(v){}return(oo=function(){return!!p})()}function Xa(p,v){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(p);v&&(w=w.filter(function(D){return Object.getOwnPropertyDescriptor(p,D).enumerable})),m.push.apply(m,w)}return m}function mn(p){for(var v=1;arguments.length>v;v++){var m=arguments[v]!=null?arguments[v]:{};v%2?Xa(Object(m),!0).forEach(function(w){Va(p,w,m[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):Xa(Object(m)).forEach(function(w){Object.defineProperty(p,w,Object.getOwnPropertyDescriptor(m,w))})}return p}function kl(p){var v=function(m,w){if(typeof m!="object"||!m)return m;var D=m[Symbol.toPrimitive];if(D!==void 0){var N=D.call(m,w||"default");if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(m)}(p,"string");return typeof v=="symbol"?v:v+""}function Il(p){return Il=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},Il(p)}function Ia(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function Xh(p,v){for(var m=0;v.length>m;m++){var w=v[m];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(p,kl(w.key),w)}}function Sl(p,v,m){return v&&Xh(p.prototype,v),m&&Xh(p,m),Object.defineProperty(p,"prototype",{writable:!1}),p}function Va(p,v,m){return(v=kl(v))in p?Object.defineProperty(p,v,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[v]=m,p}function Aa(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),Object.defineProperty(p,"prototype",{writable:!1}),v&&lc(p,v)}function Ni(p){return Ni=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(v){return v.__proto__||Object.getPrototypeOf(v)},Ni(p)}function lc(p,v){return lc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,w){return m.__proto__=w,m},lc(p,v)}function Ku(p){if(p===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p}function lo(){return lo=typeof Reflect!="undefined"&&Reflect.get?Reflect.get.bind():function(p,v,m){var w=function(N,W){for(;!Object.prototype.hasOwnProperty.call(N,W)&&(N=Ni(N))!==null;);return N}(p,v);if(w){var D=Object.getOwnPropertyDescriptor(w,v);return D.get?D.get.call(3>arguments.length?p:m):D.value}},lo.apply(this,arguments)}function bs(p,v){return function(m){if(Array.isArray(m))return m}(p)||function(m,w){var D=m==null?null:typeof Symbol!="undefined"&&m[Symbol.iterator]||m["@@iterator"];if(D!=null){var N,W,$,ie,pe=[],we=!0,ke=!1;try{if($=(D=D.call(m)).next,w===0){if(Object(D)!==D)return;we=!1}else for(;!(we=(N=$.call(D)).done)&&(pe.push(N.value),pe.length!==w);we=!0);}catch(Ge){ke=!0,W=Ge}finally{try{if(!we&&D.return!=null&&(ie=D.return(),Object(ie)!==ie))return}finally{if(ke)throw W}}return pe}}(p,v)||Nl(p,v)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Os(p){return function(v){if(Array.isArray(v))return Io(v)}(p)||function(v){if(typeof Symbol!="undefined"&&v[Symbol.iterator]!=null||v["@@iterator"]!=null)return Array.from(v)}(p)||Nl(p)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Nl(p,v){if(p){if(typeof p=="string")return Io(p,v);var m=Object.prototype.toString.call(p).slice(8,-1);return m==="Object"&&p.constructor&&(m=p.constructor.name),m==="Map"||m==="Set"?Array.from(p):m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m)?Io(p,v):void 0}}function Io(p,v){(v==null||v>p.length)&&(v=p.length);for(var m=0,w=Array(v);v>m;m++)w[m]=p[m];return w}(Ds=ve.DrawEvent||(ve.DrawEvent={})).Init="init",Ds.Destroy="destroy",Ds.Enable="enable",Ds.Disable="disable",Ds.Add="add",Ds.Edit="edit",Ds.Remove="remove",Ds.Clear="clear",Ds.Change="change",Ds.DragStart="dragStart",Ds.Dragging="dragging",Ds.DragEnd="dragEnd",Ds.Select="select",Ds.AddNode="addNode",Ds.RemoveNode="removeNode",(Rl=ve.SourceEvent||(ve.SourceEvent={})).Change="change",Rl.Update="update",(gu=ve.RenderEvent||(ve.RenderEvent={})).Click="click",gu.UnClick="unclick",gu.Dragstart="dragstart",gu.Mousemove="mousemove",gu.Mouseout="mouseout",gu.Dragging="dragging",gu.Dragend="dragend",gu.DblClick="dblClick",gu.Contextmenu="contextmenu",(gl=ve.LayerEvent||(ve.LayerEvent={})).Mousedown="mousedown",gl.Mouseup="mouseup",gl.Click="click",gl.UnClick="unclick",gl.Dblclick="dblclick",gl.Mousemove="mousemove",gl.Mouseover="mouseover",gl.Mouseenter="mouseenter",gl.Mouseleave="mouseleave",gl.Mouseout="mouseout",gl.Contextmenu="contextmenu",(wl=ve.SceneEvent||(ve.SceneEvent={})).Loaded="loaded",wl.MapMove="mapmove",wl.MoveStart="movestart",wl.MoveEnd="moveend",wl.ZoomChange="zoomchange",wl.ZoomStart="zoomstart",wl.ZoomEnd="zoomend",wl.Click="click",wl.Dblclick="dblclick",wl.Mousemove="mousemove",wl.Mousewheel="mousewheel",wl.Mouseover="mouseover",wl.Mouseout="mouseout",wl.Mouseup="mouseup",wl.Mousedown="mousedown",wl.Contextmenu="contextmenu",wl.Dragstart="dragstart",wl.Dragging="dragging",wl.Dragend="dragend",(ol=ve.ControlEvent||(ve.ControlEvent={})).DrawChange="drawchange",ol.DataChange="datachange",ol.DrawSelect="drawselect",ol.DrawClear="drawclear";var eu=63710088e-1,Tl={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260511392e-6,inches:39.37*eu,kilometers:6371.0088,kilometres:6371.0088,meters:eu,metres:eu,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:eu/1852,radians:1,yards:6967335223679999e-9},Fu={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Ju(p,v,m){m===void 0&&(m={});var w={type:"Feature"};return(m.id===0||m.id)&&(w.id=m.id),m.bbox&&(w.bbox=m.bbox),w.properties=v||{},w.geometry=p,w}function al(p,v,m){if(m===void 0&&(m={}),!p)throw Error("coordinates is required");if(!Array.isArray(p))throw Error("coordinates must be an Array");if(2>p.length)throw Error("coordinates must be at least 2 numbers long");if(!Jc(p[0])||!Jc(p[1]))throw Error("coordinates must contain numbers");return Ju({type:"Point",coordinates:p},v,m)}function Kc(p,v,m){m===void 0&&(m={});for(var w=0,D=p;D.length>w;w++){var N=D[w];if(4>N.length)throw Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var W=0;N[N.length-1].length>W;W++)if(N[N.length-1][W]!==N[0][W])throw Error("First and last Position are not equivalent.")}return Ju({type:"Polygon",coordinates:p},v,m)}function ou(p,v,m){if(m===void 0&&(m={}),2>p.length)throw Error("coordinates must be an array of two or more positions");return Ju({type:"LineString",coordinates:p},v,m)}function Ks(p,v){v===void 0&&(v={});var m={type:"FeatureCollection"};return v.id&&(m.id=v.id),v.bbox&&(m.bbox=v.bbox),m.features=p,m}function Lp(p,v,m){return m===void 0&&(m={}),Ju({type:"MultiLineString",coordinates:p},v,m)}function gf(p,v,m){return m===void 0&&(m={}),Ju({type:"MultiPoint",coordinates:p},v,m)}function Of(p,v,m){return m===void 0&&(m={}),Ju({type:"MultiPolygon",coordinates:p},v,m)}function qh(p,v){v===void 0&&(v="kilometers");var m=Tl[v];if(!m)throw Error(v+" units is invalid");return p*m}function zc(p,v){v===void 0&&(v="kilometers");var m=Tl[v];if(!m)throw Error(v+" units is invalid");return p/m}function Oh(p){return 180*(p%(2*Math.PI))/Math.PI}function Ms(p){return p%360*Math.PI/180}function Jc(p){return!isNaN(p)&&p!==null&&!Array.isArray(p)}function Yh(p){return!!p&&p.constructor===Object}var Qc=Object.freeze({__proto__:null,earthRadius:eu,factors:Tl,unitsFactors:{centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/eu,yards:1.0936133},areaFactors:Fu,feature:Ju,geometry:function(p,v,m){switch(p){case"Point":return al(v).geometry;case"LineString":return ou(v).geometry;case"Polygon":return Kc(v).geometry;case"MultiPoint":return gf(v).geometry;case"MultiLineString":return Lp(v).geometry;case"MultiPolygon":return Of(v).geometry;default:throw Error(p+" is invalid")}},point:al,points:function(p,v,m){return m===void 0&&(m={}),Ks(p.map(function(w){return al(w,v)}),m)},polygon:Kc,polygons:function(p,v,m){return m===void 0&&(m={}),Ks(p.map(function(w){return Kc(w,v)}),m)},lineString:ou,lineStrings:function(p,v,m){return m===void 0&&(m={}),Ks(p.map(function(w){return ou(w,v)}),m)},featureCollection:Ks,multiLineString:Lp,multiPoint:gf,multiPolygon:Of,geometryCollection:function(p,v,m){return m===void 0&&(m={}),Ju({type:"GeometryCollection",geometries:p},v,m)},round:function(p,v){if(v===void 0&&(v=0),v&&v<0)throw Error("precision must be a positive number");var m=Math.pow(10,v||0);return Math.round(p*m)/m},radiansToLength:qh,lengthToRadians:zc,lengthToDegrees:function(p,v){return Oh(zc(p,v))},bearingToAzimuth:function(p){var v=p%360;return 0>v&&(v+=360),v},radiansToDegrees:Oh,degreesToRadians:Ms,convertLength:function(p,v,m){if(v===void 0&&(v="kilometers"),m===void 0&&(m="kilometers"),p<0)throw Error("length must be a positive number");return qh(zc(p,v),m)},convertArea:function(p,v,m){if(v===void 0&&(v="meters"),m===void 0&&(m="kilometers"),p<0)throw Error("area must be a positive number");var w=Fu[v];if(!w)throw Error("invalid original units");var D=Fu[m];if(!D)throw Error("invalid final units");return p/w*D},isNumber:Jc,isObject:Yh,validateBBox:function(p){if(!p)throw Error("bbox is required");if(!Array.isArray(p))throw Error("bbox must be an Array");if(p.length!==4&&p.length!==6)throw Error("bbox must be an Array of 4 or 6 numbers");p.forEach(function(v){if(!Jc(v))throw Error("bbox must only contain numbers")})},validateId:function(p){if(!p)throw Error("id is required");if(["string","number"].indexOf(typeof p)===-1)throw Error("id must be a number or a string")}});function uc(p,v,m){if(p!==null)for(var w,D,N,W,$,ie,pe,we,ke=0,Ge=0,ht=p.type,mt=ht==="FeatureCollection",St=ht==="Feature",xt=mt?p.features.length:1,bt=0;xt>bt;bt++){$=(we=!!(pe=mt?p.features[bt].geometry:St?p.geometry:p)&&pe.type==="GeometryCollection")?pe.geometries.length:1;for(var kt=0;$>kt;kt++){var ft=0,nr=0;if((W=we?pe.geometries[kt]:pe)!==null){ie=W.coordinates;var br=W.type;switch(ke=!m||br!=="Polygon"&&br!=="MultiPolygon"?0:1,br){case null:break;case"Point":if(v(ie,Ge,bt,ft,nr)===!1)return!1;Ge++,ft++;break;case"LineString":case"MultiPoint":for(w=0;ie.length>w;w++){if(v(ie[w],Ge,bt,ft,nr)===!1)return!1;Ge++,br==="MultiPoint"&&ft++}br==="LineString"&&ft++;break;case"Polygon":case"MultiLineString":for(w=0;ie.length>w;w++){for(D=0;ie[w].length-ke>D;D++){if(v(ie[w][D],Ge,bt,ft,nr)===!1)return!1;Ge++}br==="MultiLineString"&&ft++,br==="Polygon"&&nr++}br==="Polygon"&&ft++;break;case"MultiPolygon":for(w=0;ie.length>w;w++){for(nr=0,D=0;ie[w].length>D;D++){for(N=0;ie[w][D].length-ke>N;N++){if(v(ie[w][D][N],Ge,bt,ft,nr)===!1)return!1;Ge++}nr++}ft++}break;case"GeometryCollection":for(w=0;W.geometries.length>w;w++)if(uc(W.geometries[w],v,m)===!1)return!1;break;default:throw Error("Unknown Geometry Type")}}}}}function eh(p,v){var m;switch(p.type){case"FeatureCollection":for(m=0;p.features.length>m&&v(p.features[m].properties,m)!==!1;m++);break;case"Feature":v(p.properties,0)}}function yh(p,v){if(p.type==="Feature")v(p,0);else if(p.type==="FeatureCollection")for(var m=0;p.features.length>m&&v(p.features[m],m)!==!1;m++);}function sl(p){var v=[];return uc(p,function(m){v.push(m)}),v}function Uc(p,v){var m,w,D,N,W,$,ie,pe,we,ke,Ge=0,ht=p.type==="FeatureCollection",mt=p.type==="Feature",St=ht?p.features.length:1;for(m=0;St>m;m++){for(pe=ht?p.features[m].properties:mt?p.properties:{},we=ht?p.features[m].bbox:mt?p.bbox:void 0,ke=ht?p.features[m].id:mt?p.id:void 0,W=(ie=!!($=ht?p.features[m].geometry:mt?p.geometry:p)&&$.type==="GeometryCollection")?$.geometries.length:1,D=0;W>D;D++)if((N=ie?$.geometries[D]:$)!==null)switch(N.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(v(N,Ge,pe,we,ke)===!1)return!1;break;case"GeometryCollection":for(w=0;N.geometries.length>w;w++)if(v(N.geometries[w],Ge,pe,we,ke)===!1)return!1;break;default:throw Error("Unknown Geometry Type")}else if(v(null,Ge,pe,we,ke)===!1)return!1;Ge++}}function bc(p,v,m){var w=m;return Uc(p,function(D,N,W,$,ie){w=N===0&&m===void 0?D:v(w,D,N,W,$,ie)}),w}function fp(p,v){Uc(p,function(m,w,D,N,W){var $,ie=m===null?null:m.type;switch(ie){case null:case"Point":case"LineString":case"Polygon":return v(Ju(m,D,{bbox:N,id:W}),w,0)!==!1&&void 0}switch(ie){case"MultiPoint":$="Point";break;case"MultiLineString":$="LineString";break;case"MultiPolygon":$="Polygon"}for(var pe=0;m.coordinates.length>pe;pe++)if(v(Ju({type:$,coordinates:m.coordinates[pe]},D),w,pe)===!1)return!1})}function dp(p,v){fp(p,function(m,w,D){var N=0;if(m.geometry){var W=m.geometry.type;if(W!=="Point"&&W!=="MultiPoint"){var $,ie=0,pe=0,we=0;return uc(m,function(ke,Ge,ht,mt,St){if($===void 0||w>ie||mt>pe||St>we)return $=ke,ie=w,pe=mt,we=St,void(N=0);var xt=ou([$,ke],m.properties);if(v(xt,w,D,St,N)===!1)return!1;N++,$=ke})!==!1&&void 0}}})}function Ps(p,v,m){var w=m,D=!1;return dp(p,function(N,W,$,ie,pe){w=D===!1&&m===void 0?N:v(w,N,W,$,ie,pe),D=!0}),w}function Gf(p,v){if(!p)throw Error("geojson is required");fp(p,function(m,w,D){if(m.geometry!==null){var N=m.geometry.coordinates;switch(m.geometry.type){case"LineString":if(v(m,w,D,0,0)===!1)return!1;break;case"Polygon":for(var W=0;N.length>W;W++)if(v(ou(N[W],m.properties),w,D,W)===!1)return!1}}})}var Xp=Object.freeze({__proto__:null,coordAll:sl,coordEach:uc,coordReduce:function(p,v,m,w){var D=m;return uc(p,function(N,W,$,ie,pe){D=W===0&&m===void 0?N:v(D,N,W,$,ie,pe)},w),D},featureEach:yh,featureReduce:function(p,v,m){var w=m;return yh(p,function(D,N){w=N===0&&m===void 0?D:v(w,D,N)}),w},findPoint:function(p,v){if(!Yh(v=v||{}))throw Error("options is invalid");var m,w=v.featureIndex||0,D=v.multiFeatureIndex||0,N=v.geometryIndex||0,W=v.coordIndex||0,$=v.properties;switch(p.type){case"FeatureCollection":0>w&&(w=p.features.length+w),$=$||p.features[w].properties,m=p.features[w].geometry;break;case"Feature":$=$||p.properties,m=p.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":m=p;break;default:throw Error("geojson is invalid")}if(m===null)return null;var ie=m.coordinates;switch(m.type){case"Point":return al(ie,$,v);case"MultiPoint":return 0>D&&(D=ie.length+D),al(ie[D],$,v);case"LineString":return 0>W&&(W=ie.length+W),al(ie[W],$,v);case"Polygon":return 0>N&&(N=ie.length+N),0>W&&(W=ie[N].length+W),al(ie[N][W],$,v);case"MultiLineString":return 0>D&&(D=ie.length+D),0>W&&(W=ie[D].length+W),al(ie[D][W],$,v);case"MultiPolygon":return 0>D&&(D=ie.length+D),0>N&&(N=ie[D].length+N),0>W&&(W=ie[D][N].length-W),al(ie[D][N][W],$,v)}throw Error("geojson is invalid")},findSegment:function(p,v){if(!Yh(v=v||{}))throw Error("options is invalid");var m,w=v.featureIndex||0,D=v.multiFeatureIndex||0,N=v.geometryIndex||0,W=v.segmentIndex||0,$=v.properties;switch(p.type){case"FeatureCollection":0>w&&(w=p.features.length+w),$=$||p.features[w].properties,m=p.features[w].geometry;break;case"Feature":$=$||p.properties,m=p.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":m=p;break;default:throw Error("geojson is invalid")}if(m===null)return null;var ie=m.coordinates;switch(m.type){case"Point":case"MultiPoint":return null;case"LineString":return 0>W&&(W=ie.length+W-1),ou([ie[W],ie[W+1]],$,v);case"Polygon":return 0>N&&(N=ie.length+N),0>W&&(W=ie[N].length+W-1),ou([ie[N][W],ie[N][W+1]],$,v);case"MultiLineString":return 0>D&&(D=ie.length+D),0>W&&(W=ie[D].length+W-1),ou([ie[D][W],ie[D][W+1]],$,v);case"MultiPolygon":return 0>D&&(D=ie.length+D),0>N&&(N=ie[D].length+N),0>W&&(W=ie[D][N].length-W-1),ou([ie[D][N][W],ie[D][N][W+1]],$,v)}throw Error("geojson is invalid")},flattenEach:fp,flattenReduce:function(p,v,m){var w=m;return fp(p,function(D,N,W){w=N===0&&W===0&&m===void 0?D:v(w,D,N,W)}),w},geomEach:Uc,geomReduce:bc,lineEach:Gf,lineReduce:function(p,v,m){var w=m;return Gf(p,function(D,N,W,$){w=N===0&&m===void 0?D:v(w,D,N,W,$)}),w},propEach:eh,propReduce:function(p,v,m){var w=m;return eh(p,function(D,N){w=N===0&&m===void 0?D:v(w,D,N)}),w},segmentEach:dp,segmentReduce:Ps});function cc(p){var v=[1/0,1/0,-1/0,-1/0];return uc(p,function(m){v[0]>m[0]&&(v[0]=m[0]),v[1]>m[1]&&(v[1]=m[1]),m[0]>v[2]&&(v[2]=m[0]),m[1]>v[3]&&(v[3]=m[1])}),v}cc.default=cc;var zl=Object.freeze({__proto__:null,default:cc});function Ec(p){if(!p)throw Error("coord is required");if(!Array.isArray(p)){if(p.type==="Feature"&&p.geometry!==null&&p.geometry.type==="Point")return p.geometry.coordinates;if(p.type==="Point")return p.coordinates}if(Array.isArray(p)&&p.length>=2&&!Array.isArray(p[0])&&!Array.isArray(p[1]))return p;throw Error("coord must be GeoJSON Point or an Array of numbers")}function th(p){if(Array.isArray(p))return p;if(p.type==="Feature"){if(p.geometry!==null)return p.geometry.coordinates}else if(p.coordinates)return p.coordinates;throw Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function vu(p){return p.type==="Feature"?p.geometry:p}function xh(p,v){return p.type==="FeatureCollection"?"FeatureCollection":p.type==="GeometryCollection"?"GeometryCollection":p.type==="Feature"&&p.geometry!==null?p.geometry.type:p.type}function qa(p,v,m,w,D){Hs(p,v,m||0,w||p.length-1,D||Na)}function Hs(p,v,m,w,D){for(;w>m;){if(w-m>600){var N=w-m+1,W=v-m+1,$=Math.log(N),ie=.5*Math.exp(2*$/3),pe=.5*Math.sqrt($*ie*(N-ie)/N)*(0>W-N/2?-1:1);Hs(p,v,Math.max(m,Math.floor(v-W*ie/N+pe)),Math.min(w,Math.floor(v+(N-W)*ie/N+pe)),D)}var we=p[v],ke=m,Ge=w;for(Ep(p,m,v),D(p[w],we)>0&&Ep(p,m,w);Ge>ke;){for(Ep(p,ke,Ge),ke++,Ge--;0>D(p[ke],we);)ke++;for(;D(p[Ge],we)>0;)Ge--}D(p[m],we)===0?Ep(p,m,Ge):Ep(p,++Ge,w),Ge>v||(m=Ge+1),v>Ge||(w=Ge-1)}}function Ep(p,v,m){var w=p[v];p[v]=p[m],p[m]=w}function Na(p,v){return v>p?-1:p>v?1:0}function Qu(p,v,m){if(!m)return v.indexOf(p);for(let w=0;v.length>w;w++)if(m(p,v[w]))return w;return-1}function Is(p,v){ys(p,0,p.children.length,v,p)}function ys(p,v,m,w,D){D||(D=Xo(null)),D.minX=1/0,D.minY=1/0,D.maxX=-1/0,D.maxY=-1/0;for(let N=v;m>N;N++){const W=p.children[N];ec(D,p.leaf?w(W):W)}return D}function ec(p,v){return p.minX=Math.min(p.minX,v.minX),p.minY=Math.min(p.minY,v.minY),p.maxX=Math.max(p.maxX,v.maxX),p.maxY=Math.max(p.maxY,v.maxY),p}function Bf(p,v){return p.minX-v.minX}function es(p,v){return p.minY-v.minY}function Bs(p){return(p.maxX-p.minX)*(p.maxY-p.minY)}function wc(p){return p.maxX-p.minX+(p.maxY-p.minY)}function qp(p,v){const m=Math.max(p.minX,v.minX),w=Math.max(p.minY,v.minY),D=Math.min(p.maxX,v.maxX),N=Math.min(p.maxY,v.maxY);return Math.max(0,D-m)*Math.max(0,N-w)}function Sc(p,v){return!(p.minX>v.minX||p.minY>v.minY||v.maxX>p.maxX||v.maxY>p.maxY)}function $h(p,v){return!(v.minX>p.maxX||v.minY>p.maxY||p.minX>v.maxX||p.minY>v.maxY)}function Xo(p){return{children:p,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function au(p,v,m,w,D){const N=[v,m];for(;N.length;){if(w>=(m=N.pop())-(v=N.pop()))continue;const W=v+Math.ceil((m-v)/w/2)*w;qa(p,W,v,m,D),N.push(v,W,W,m)}}var dl=Object.freeze({__proto__:null,default:class{constructor(p=9){this._maxEntries=Math.max(4,p),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(p){let v=this.data;const m=[];if(!$h(p,v))return m;const w=this.toBBox,D=[];for(;v;){for(let N=0;v.children.length>N;N++){const W=v.children[N],$=v.leaf?w(W):W;$h(p,$)&&(v.leaf?m.push(W):Sc(p,$)?this._all(W,m):D.push(W))}v=D.pop()}return m}collides(p){let v=this.data;if(!$h(p,v))return!1;const m=[];for(;v;){for(let w=0;v.children.length>w;w++){const D=v.children[w],N=v.leaf?this.toBBox(D):D;if($h(p,N)){if(v.leaf||Sc(p,N))return!0;m.push(D)}}v=m.pop()}return!1}load(p){if(!p||!p.length)return this;if(this._minEntries>p.length){for(let m=0;p.length>m;m++)this.insert(p[m]);return this}let v=this._build(p.slice(),0,p.length-1,0);if(this.data.children.length)if(this.data.height===v.height)this._splitRoot(this.data,v);else{if(v.height>this.data.height){const m=this.data;this.data=v,v=m}this._insert(v,this.data.height-v.height-1,!0)}else this.data=v;return this}insert(p){return p&&this._insert(p,this.data.height-1),this}clear(){return this.data=Xo([]),this}remove(p,v){if(!p)return this;let m=this.data;const w=this.toBBox(p),D=[],N=[];let W,$,ie;for(;m||D.length;){if(m||(m=D.pop(),$=D[D.length-1],W=N.pop(),ie=!0),m.leaf){const pe=Qu(p,m.children,v);if(pe!==-1)return m.children.splice(pe,1),D.push(m),this._condense(D),this}ie||m.leaf||!Sc(m,w)?$?(W++,m=$.children[W],ie=!1):m=null:(D.push(m),N.push(W),W=0,$=m,m=m.children[0])}return this}toBBox(p){return p}compareMinX(p,v){return p.minX-v.minX}compareMinY(p,v){return p.minY-v.minY}toJSON(){return this.data}fromJSON(p){return this.data=p,this}_all(p,v){const m=[];for(;p;)p.leaf?v.push(...p.children):m.push(...p.children),p=m.pop();return v}_build(p,v,m,w){const D=m-v+1;let N,W=this._maxEntries;if(W>=D)return N=Xo(p.slice(v,m+1)),Is(N,this.toBBox),N;w||(W=Math.ceil(D/Math.pow(W,(w=Math.ceil(Math.log(D)/Math.log(W)))-1))),N=Xo([]),N.leaf=!1,N.height=w;const $=Math.ceil(D/W),ie=$*Math.ceil(Math.sqrt(W));au(p,v,m,ie,this.compareMinX);for(let pe=v;m>=pe;pe+=ie){const we=Math.min(pe+ie-1,m);au(p,pe,we,$,this.compareMinY);for(let ke=pe;we>=ke;ke+=$)N.children.push(this._build(p,ke,Math.min(ke+$-1,we),w-1))}return Is(N,this.toBBox),N}_chooseSubtree(p,v,m,w){for(;w.push(v),!v.leaf&&w.length-1!==m;){let W,$=1/0,ie=1/0;for(let pe=0;v.children.length>pe;pe++){const we=v.children[pe],ke=Bs(we),Ge=(Math.max((N=we).maxX,(D=p).maxX)-Math.min(N.minX,D.minX))*(Math.max(N.maxY,D.maxY)-Math.min(N.minY,D.minY))-ke;ie>Ge?(ie=Ge,$=$>ke?ke:$,W=we):Ge===ie&&$>ke&&($=ke,W=we)}v=W||v.children[0]}var D,N;return v}_insert(p,v,m){const w=m?p:this.toBBox(p),D=[],N=this._chooseSubtree(w,this.data,v,D);for(N.children.push(p),ec(N,w);v>=0&&D[v].children.length>this._maxEntries;)this._split(D,v),v--;this._adjustParentBBoxes(w,D,v)}_split(p,v){const m=p[v],w=m.children.length,D=this._minEntries;this._chooseSplitAxis(m,D,w);const N=this._chooseSplitIndex(m,D,w),W=Xo(m.children.splice(N,m.children.length-N));W.height=m.height,W.leaf=m.leaf,Is(m,this.toBBox),Is(W,this.toBBox),v?p[v-1].children.push(W):this._splitRoot(m,W)}_splitRoot(p,v){this.data=Xo([p,v]),this.data.height=p.height+1,this.data.leaf=!1,Is(this.data,this.toBBox)}_chooseSplitIndex(p,v,m){let w,D=1/0,N=1/0;for(let W=v;m-v>=W;W++){const $=ys(p,0,W,this.toBBox),ie=ys(p,W,m,this.toBBox),pe=qp($,ie),we=Bs($)+Bs(ie);D>pe?(D=pe,w=W,N=N>we?we:N):pe===D&&N>we&&(N=we,w=W)}return w||m-v}_chooseSplitAxis(p,v,m){const w=p.leaf?this.compareMinX:Bf,D=p.leaf?this.compareMinY:es,N=this._allDistMargin(p,v,m,w);this._allDistMargin(p,v,m,D)>N&&p.children.sort(w)}_allDistMargin(p,v,m,w){p.children.sort(w);const D=this.toBBox,N=ys(p,0,v,D),W=ys(p,m-v,m,D);let $=wc(N)+wc(W);for(let ie=v;m-v>ie;ie++){const pe=p.children[ie];ec(N,p.leaf?D(pe):pe),$+=wc(N)}for(let ie=m-v-1;ie>=v;ie--){const pe=p.children[ie];ec(W,p.leaf?D(pe):pe),$+=wc(W)}return $}_adjustParentBBoxes(p,v,m){for(let w=m;w>=0;w--)ec(v[w],p)}_condense(p){for(let v,m=p.length-1;m>=0;m--)p[m].children.length===0?m>0?(v=p[m-1].children,v.splice(v.indexOf(p[m]),1)):this.clear():Is(p[m],this.toBBox)}}});function tc(p,v){return v>p?-1:p>v?1:0}var bh=Object.freeze({__proto__:null,default:class{constructor(p=[],v=tc){if(this.data=p,this.length=this.data.length,this.compare=v,this.length>0)for(let m=(this.length>>1)-1;m>=0;m--)this._down(m)}push(p){this.data.push(p),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const p=this.data[0],v=this.data.pop();return this.length--,this.length>0&&(this.data[0]=v,this._down(0)),p}peek(){return this.data[0]}_up(p){const{data:v,compare:m}=this,w=v[p];for(;p>0;){const D=p-1>>1,N=v[D];if(m(w,N)>=0)break;v[p]=N,p=D}v[p]=w}_down(p){const{data:v,compare:m}=this,w=this.length>>1,D=v[p];for(;w>p;){let N=1+(p<<1),W=v[N];const $=N+1;if(this.length>$&&0>m(v[$],W)&&(N=$,W=v[$]),m(W,D)>=0)break;v[p]=W,p=N}v[p]=D}}}),mp=function(p,v,m,w){var D=p[0],N=p[1],W=!1;m===void 0&&(m=0),w===void 0&&(w=v.length);for(var $=(w-m)/2,ie=0,pe=$-1;$>ie;pe=ie++){var we=v[m+2*ie+0],ke=v[m+2*ie+1],Ge=v[m+2*pe+1];ke>N!=Ge>N&&(v[m+2*pe+0]-we)*(N-ke)/(Ge-ke)+we>D&&(W=!W)}return W},Kh=function(p,v,m,w){var D=p[0],N=p[1],W=!1;m===void 0&&(m=0),w===void 0&&(w=v.length);for(var $=w-m,ie=0,pe=$-1;$>ie;pe=ie++){var we=v[ie+m][0],ke=v[ie+m][1],Ge=v[pe+m][1];ke>N!=Ge>N&&(v[pe+m][0]-we)*(N-ke)/(Ge-ke)+we>D&&(W=!W)}return W},Zc=function(p,v,m,w){return v.length>0&&Array.isArray(v[0])?Kh(p,v,m,w):mp(p,v,m,w)},vf=mp;Zc.nested=Kh,Zc.flat=vf;var Bh=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof Se.g!="undefined"?Se.g:typeof self!="undefined"?self:{};function _u(p,v,m){return p(m={path:v,exports:{},require:function(w,D){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},m.exports),m.exports}function Vc(p){if(p.__esModule)return p;var v=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(p).forEach(function(m){var w=Object.getOwnPropertyDescriptor(p,m);Object.defineProperty(v,m,w.get?w:{enumerable:!0,get:function(){return p[m]}})}),v}var Yp=_u(function(p,v){(function(m){const D=33306690738754706e-32;function N(St,xt,bt,kt,ft){let nr,br,Pr,Mn,yn=xt[0],kr=kt[0],Ai=0,$n=0;kr>yn==kr>-yn?(nr=yn,yn=xt[++Ai]):(nr=kr,kr=kt[++$n]);let ti=0;if(St>Ai&&bt>$n)for(kr>yn==kr>-yn?(Pr=nr-((br=yn+nr)-yn),yn=xt[++Ai]):(Pr=nr-((br=kr+nr)-kr),kr=kt[++$n]),nr=br,Pr!==0&&(ft[ti++]=Pr);St>Ai&&bt>$n;)kr>yn==kr>-yn?(Pr=nr-((br=nr+yn)-(Mn=br-nr))+(yn-Mn),yn=xt[++Ai]):(Pr=nr-((br=nr+kr)-(Mn=br-nr))+(kr-Mn),kr=kt[++$n]),nr=br,Pr!==0&&(ft[ti++]=Pr);for(;St>Ai;)Pr=nr-((br=nr+yn)-(Mn=br-nr))+(yn-Mn),yn=xt[++Ai],nr=br,Pr!==0&&(ft[ti++]=Pr);for(;bt>$n;)Pr=nr-((br=nr+kr)-(Mn=br-nr))+(kr-Mn),kr=kt[++$n],nr=br,Pr!==0&&(ft[ti++]=Pr);return nr===0&&ti!==0||(ft[ti++]=nr),ti}function W(St){return new Float64Array(St)}const $=33306690738754716e-32,ie=22204460492503146e-32,pe=11093356479670487e-47,we=W(4),ke=W(8),Ge=W(12),ht=W(16),mt=W(4);m.orient2d=function(St,xt,bt,kt,ft,nr){const br=(xt-nr)*(bt-ft),Pr=(St-ft)*(kt-nr),Mn=br-Pr;if(br===0||Pr===0||br>0!=Pr>0)return Mn;const yn=Math.abs(br+Pr);return $*yn>Math.abs(Mn)?-function(kr,Ai,$n,ti,ri,hn,An){let Yi,Ci,fo,Go,hi,zi,Vo,Ka,ta,ka,ca,Eo,Pa,na,ha,Xs,Ls,Ea;const ws=kr-ri,qs=$n-ri,ua=Ai-hn,cu=ti-hn;hi=(ha=(Ka=ws-(Vo=(zi=134217729*ws)-(zi-ws)))*(ka=cu-(ta=(zi=134217729*cu)-(zi-cu)))-((na=ws*cu)-Vo*ta-Ka*ta-Vo*ka))-(ca=ha-(Ls=(Ka=ua-(Vo=(zi=134217729*ua)-(zi-ua)))*(ka=qs-(ta=(zi=134217729*qs)-(zi-qs)))-((Xs=ua*qs)-Vo*ta-Ka*ta-Vo*ka))),we[0]=ha-(ca+hi)+(hi-Ls),hi=(Pa=na-((Eo=na+ca)-(hi=Eo-na))+(ca-hi))-(ca=Pa-Xs),we[1]=Pa-(ca+hi)+(hi-Xs),hi=(Ea=Eo+ca)-Eo,we[2]=Eo-(Ea-hi)+(ca-hi),we[3]=Ea;let c=function(V,X){let J=X[0];for(let oe=1;V>oe;oe++)J+=X[oe];return J}(4,we),o=ie*An;if(c>=o||-c>=o||(Yi=kr-(ws+(hi=kr-ws))+(hi-ri),fo=$n-(qs+(hi=$n-qs))+(hi-ri),Ci=Ai-(ua+(hi=Ai-ua))+(hi-hn),Go=ti-(cu+(hi=ti-cu))+(hi-hn),Yi===0&&Ci===0&&fo===0&&Go===0)||(o=pe*An+D*Math.abs(c),(c+=ws*Go+cu*Yi-(ua*fo+qs*Ci))>=o||-c>=o))return c;hi=(ha=(Ka=Yi-(Vo=(zi=134217729*Yi)-(zi-Yi)))*(ka=cu-(ta=(zi=134217729*cu)-(zi-cu)))-((na=Yi*cu)-Vo*ta-Ka*ta-Vo*ka))-(ca=ha-(Ls=(Ka=Ci-(Vo=(zi=134217729*Ci)-(zi-Ci)))*(ka=qs-(ta=(zi=134217729*qs)-(zi-qs)))-((Xs=Ci*qs)-Vo*ta-Ka*ta-Vo*ka))),mt[0]=ha-(ca+hi)+(hi-Ls),hi=(Pa=na-((Eo=na+ca)-(hi=Eo-na))+(ca-hi))-(ca=Pa-Xs),mt[1]=Pa-(ca+hi)+(hi-Xs),hi=(Ea=Eo+ca)-Eo,mt[2]=Eo-(Ea-hi)+(ca-hi),mt[3]=Ea;const f=N(4,we,4,mt,ke);hi=(ha=(Ka=ws-(Vo=(zi=134217729*ws)-(zi-ws)))*(ka=Go-(ta=(zi=134217729*Go)-(zi-Go)))-((na=ws*Go)-Vo*ta-Ka*ta-Vo*ka))-(ca=ha-(Ls=(Ka=ua-(Vo=(zi=134217729*ua)-(zi-ua)))*(ka=fo-(ta=(zi=134217729*fo)-(zi-fo)))-((Xs=ua*fo)-Vo*ta-Ka*ta-Vo*ka))),mt[0]=ha-(ca+hi)+(hi-Ls),hi=(Pa=na-((Eo=na+ca)-(hi=Eo-na))+(ca-hi))-(ca=Pa-Xs),mt[1]=Pa-(ca+hi)+(hi-Xs),hi=(Ea=Eo+ca)-Eo,mt[2]=Eo-(Ea-hi)+(ca-hi),mt[3]=Ea;const E=N(f,ke,4,mt,Ge);hi=(ha=(Ka=Yi-(Vo=(zi=134217729*Yi)-(zi-Yi)))*(ka=Go-(ta=(zi=134217729*Go)-(zi-Go)))-((na=Yi*Go)-Vo*ta-Ka*ta-Vo*ka))-(ca=ha-(Ls=(Ka=Ci-(Vo=(zi=134217729*Ci)-(zi-Ci)))*(ka=fo-(ta=(zi=134217729*fo)-(zi-fo)))-((Xs=Ci*fo)-Vo*ta-Ka*ta-Vo*ka))),mt[0]=ha-(ca+hi)+(hi-Ls),hi=(Pa=na-((Eo=na+ca)-(hi=Eo-na))+(ca-hi))-(ca=Pa-Xs),mt[1]=Pa-(ca+hi)+(hi-Xs),hi=(Ea=Eo+ca)-Eo,mt[2]=Eo-(Ea-hi)+(ca-hi),mt[3]=Ea;const L=N(E,Ge,4,mt,ht);return ht[L-1]}(St,xt,bt,kt,ft,nr,yn):Mn},m.orient2dfast=function(St,xt,bt,kt,ft,nr){return(xt-nr)*(bt-ft)-(St-ft)*(kt-nr)},Object.defineProperty(m,"__esModule",{value:!0})})(v)}),Fh=Vc(dl),Ll=Vc(bh),Fs=Yp.orient2d;Ll.default&&(Ll=Ll.default);var Tc=Ru;function Ru(p,v,m){v=Math.max(0,v===void 0?2:v),m=m||0;var w=function(kt){for(var ft=kt[0],nr=kt[0],br=kt[0],Pr=kt[0],Mn=0;kt.length>Mn;Mn++){var yn=kt[Mn];ft[0]>yn[0]&&(ft=yn),yn[0]>br[0]&&(br=yn),nr[1]>yn[1]&&(nr=yn),yn[1]>Pr[1]&&(Pr=yn)}var kr=[ft,nr,br,Pr],Ai=kr.slice();for(Mn=0;kt.length>Mn;Mn++)Zc(kt[Mn],kr)||Ai.push(kt[Mn]);return function($n){$n.sort(Eh);for(var ti=[],ri=0;$n.length>ri;ri++){for(;ti.length>=2&&0>=Iu(ti[ti.length-2],ti[ti.length-1],$n[ri]);)ti.pop();ti.push($n[ri])}for(var hn=[],An=$n.length-1;An>=0;An--){for(;hn.length>=2&&0>=Iu(hn[hn.length-2],hn[hn.length-1],$n[An]);)hn.pop();hn.push($n[An])}return hn.pop(),ti.pop(),ti.concat(hn)}(Ai)}(p),D=new Fh(16);D.toBBox=function(kt){return{minX:kt[0],minY:kt[1],maxX:kt[0],maxY:kt[1]}},D.compareMinX=function(kt,ft){return kt[0]-ft[0]},D.compareMinY=function(kt,ft){return kt[1]-ft[1]},D.load(p);for(var N,W=[],$=0;w.length>$;$++){var ie=w[$];D.remove(ie),N=gp(ie,N),W.push(N)}var pe=new Fh(16);for($=0;W.length>$;$++)pe.insert(rh(W[$]));for(var we=v*v,ke=m*m;W.length;){var Ge=W.shift(),ht=Ge.p,mt=Ge.next.p,St=vp(ht,mt);if(St>=ke){var xt=St/we;(ie=jc(D,Ge.prev.p,ht,mt,Ge.next.next.p,xt,pe))&&Math.min(vp(ie,ht),vp(ie,mt))<=xt&&(W.push(Ge),W.push(gp(ie,Ge)),D.remove(ie),pe.remove(Ge),pe.insert(rh(Ge)),pe.insert(rh(Ge.next)))}}Ge=N;var bt=[];do bt.push(Ge.p),Ge=Ge.next;while(Ge!==N);return bt.push(Ge.p),bt}function jc(p,v,m,w,D,N,W){for(var $=new Ll([],$p),ie=p.data;ie;){for(var pe=0;ie.children.length>pe;pe++){var we=ie.children[pe],ke=ie.leaf?Kp(we,m,w):Jh(m,w,we);NGe.dist&&St>Ge.dist&&kh(m,ht,W)&&kh(w,ht,W))return ht}(ie=$.pop())&&(ie=ie.node)}return null}function $p(p,v){return p.dist-v.dist}function Jh(p,v,m){if(Ac(p,m)||Ac(v,m))return 0;var w=Hc(p[0],p[1],v[0],v[1],m.minX,m.minY,m.maxX,m.minY);if(w===0)return 0;var D=Hc(p[0],p[1],v[0],v[1],m.minX,m.minY,m.minX,m.maxY);if(D===0)return 0;var N=Hc(p[0],p[1],v[0],v[1],m.maxX,m.minY,m.maxX,m.maxY);if(N===0)return 0;var W=Hc(p[0],p[1],v[0],v[1],m.minX,m.maxY,m.maxX,m.maxY);return W===0?0:Math.min(w,D,N,W)}function Ac(p,v){return!(v.minX>p[0]||p[0]>v.maxX||v.minY>p[1]||p[1]>v.maxY)}function kh(p,v,m){for(var w,D,N,W,$=m.search({minX:Math.min(p[0],v[0]),minY:Math.min(p[1],v[1]),maxX:Math.max(p[0],v[0]),maxY:Math.max(p[1],v[1])}),ie=0;$.length>ie;ie++)if(D=$[ie].next.p,N=p,(w=$[ie].p)!==(W=v)&&D!==N&&Iu(w,D,N)>0!=Iu(w,D,W)>0&&Iu(N,W,w)>0!=Iu(N,W,D)>0)return!1;return!0}function Iu(p,v,m){return Fs(p[0],p[1],v[0],v[1],m[0],m[1])}function rh(p){var v=p.p,m=p.next.p;return p.minX=Math.min(v[0],m[0]),p.minY=Math.min(v[1],m[1]),p.maxX=Math.max(v[0],m[0]),p.maxY=Math.max(v[1],m[1]),p}function gp(p,v){var m={p,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return v?(m.next=v.next,m.prev=v,v.next.prev=m,v.next=m):(m.prev=m,m.next=m),m}function vp(p,v){var m=p[0]-v[0],w=p[1]-v[1];return m*m+w*w}function Kp(p,v,m){var w=v[0],D=v[1],N=m[0]-w,W=m[1]-D;if(N!==0||W!==0){var $=((p[0]-w)*N+(p[1]-D)*W)/(N*N+W*W);$>1?(w=m[0],D=m[1]):$>0&&(w+=N*$,D+=W*$)}return(N=p[0]-w)*N+(W=p[1]-D)*W}function Hc(p,v,m,w,D,N,W,$){var ie,pe,we,ke,Ge=m-p,ht=w-v,mt=W-D,St=$-N,xt=p-D,bt=v-N,kt=Ge*Ge+ht*ht,ft=Ge*mt+ht*St,nr=mt*mt+St*St,br=Ge*xt+ht*bt,Pr=mt*xt+St*bt,Mn=kt*nr-ft*ft,yn=Mn,kr=Mn;Mn===0?(pe=0,yn=1,ke=Pr,kr=nr):(ke=kt*Pr-ft*br,0>(pe=ft*Pr-nr*br)?(pe=0,ke=Pr,kr=nr):pe>yn&&(pe=yn,ke=Pr+ft,kr=nr)),0>ke?(ke=0,0>-br?pe=0:-br>kt?pe=yn:(pe=-br,yn=kt)):ke>kr&&(ke=kr,0>-br+ft?pe=0:-br+ft>kt?pe=yn:(pe=-br+ft,yn=kt));var Ai=(1-(we=ke===0?0:ke/kr))*D+we*W-((1-(ie=pe===0?0:pe/yn))*p+ie*m),$n=(1-we)*N+we*$-((1-ie)*v+ie*w);return Ai*Ai+$n*$n}function Eh(p,v){return p[0]===v[0]?p[1]-v[1]:p[0]-v[0]}function yu(p,v,m){m===void 0&&(m={});var w=Ec(p),D=Ec(v),N=Ms(D[1]-w[1]),W=Ms(D[0]-w[0]),$=Ms(w[1]),ie=Ms(D[1]),pe=Math.pow(Math.sin(N/2),2)+Math.pow(Math.sin(W/2),2)*Math.cos($)*Math.cos(ie);return qh(2*Math.atan2(Math.sqrt(pe),Math.sqrt(1-pe)),m.units)}function Ya(p){return function(v,m){m===void 0&&(m={});var w=Number(v[0]),D=Number(v[1]),N=Number(v[2]),W=Number(v[3]);if(v.length===6)throw Error("@turf/bbox-polygon does not support BBox with 6 positions");var $=[w,D];return Kc([[$,[N,D],[N,W],[w,W],$]],m.properties,{bbox:v,id:m.id})}(cc(p))}function nh(p,v,m,w){w===void 0&&(w={});var D=Ec(p),N=Ms(D[0]),W=Ms(D[1]),$=Ms(m),ie=zc(v,w.units),pe=Math.asin(Math.sin(W)*Math.cos(ie)+Math.cos(W)*Math.sin(ie)*Math.cos($));return al([Oh(N+Math.atan2(Math.sin($)*Math.sin(ie)*Math.cos(W),Math.cos(ie)-Math.sin(W)*Math.sin(pe))),Oh(pe)],w.properties)}function Gc(p,v,m){if(m===void 0&&(m={}),m.final===!0)return function(pe,we){var ke=Gc(we,pe);return ke=(ke+180)%360}(p,v);var w=Ec(p),D=Ec(v),N=Ms(w[0]),W=Ms(D[0]),$=Ms(w[1]),ie=Ms(D[1]);return Oh(Math.atan2(Math.sin(W-N)*Math.cos(ie),Math.cos($)*Math.sin(ie)-Math.sin($)*Math.cos(ie)*Math.cos(W-N)))}function ih(p,v){v===void 0&&(v={});var m=cc(p);return al([(m[0]+m[2])/2,(m[1]+m[3])/2],v.properties,v)}function Sa(p,v){v===void 0&&(v={});var m=0,w=0,D=0;return uc(p,function(N){m+=N[0],w+=N[1],D++},!0),al([m/D,w/D],v.properties)}function cs(p,v){switch(v===void 0&&(v={}),xh(p)){case"Point":return al(Ec(p),v.properties);case"Polygon":var m=[];uc(p,function(ft){m.push(ft)});var w,D,N,W,$,ie,pe,we,ke=Sa(p,{properties:v.properties}),Ge=ke.geometry.coordinates,ht=0,mt=0,St=0,xt=m.map(function(ft){return[ft[0]-Ge[0],ft[1]-Ge[1]]});for(w=0;m.length-1>w;w++)St+=we=(W=(D=xt[w])[0])*(pe=(N=xt[w+1])[1])-($=N[0])*(ie=D[1]),ht+=(W+$)*we,mt+=(ie+pe)*we;if(St===0)return ke;var bt=1/(6*(.5*St));return al([Ge[0]+bt*ht,Ge[1]+bt*mt],v.properties);default:var kt=function(ft,nr){nr===void 0&&(nr={}),nr.concavity=nr.concavity||1/0;var br=[];if(uc(ft,function(Mn){br.push([Mn[0],Mn[1]])}),!br.length)return null;var Pr=Tc(br,nr.concavity);return Pr.length>3?Kc([Pr]):null}(p);return kt?cs(kt,{properties:v.properties}):Sa(p,{properties:v.properties})}}function ku(p){if(!p)throw Error("geojson is required");var v=[];return fp(p,function(m){(function(w,D){var N=[],W=w.geometry;if(W!==null){switch(W.type){case"Polygon":N=th(W);break;case"LineString":N=[th(W)]}N.forEach(function($){var ie=function(pe,we){var ke=[];return pe.reduce(function(Ge,ht){var mt,St,xt,bt,kt,ft,nr=ou([Ge,ht],we);return nr.bbox=[(kt=(St=ht)[0])>(xt=(mt=Ge)[0])?xt:kt,(ft=St[1])>(bt=mt[1])?bt:ft,xt>kt?xt:kt,bt>ft?bt:ft],ke.push(nr),ht}),ke}($,w.properties);ie.forEach(function(pe){pe.id=D.length,D.push(pe)})})}})(m,v)}),Ks(v)}Tc.default=Ru;function rc(p,v,m){if(!m)return v.indexOf(p);for(let w=0;v.length>w;w++)if(m(p,v[w]))return w;return-1}function xu(p,v){oh(p,0,p.children.length,v,p)}function oh(p,v,m,w,D){D||(D=oi(null)),D.minX=1/0,D.minY=1/0,D.maxX=-1/0,D.maxY=-1/0;for(let N=v;m>N;N++){const W=p.children[N];Cc(D,p.leaf?w(W):W)}return D}function Cc(p,v){return p.minX=Math.min(p.minX,v.minX),p.minY=Math.min(p.minY,v.minY),p.maxX=Math.max(p.maxX,v.maxX),p.maxY=Math.max(p.maxY,v.maxY),p}function ah(p,v){return p.minX-v.minX}function Qh(p,v){return p.minY-v.minY}function sh(p){return(p.maxX-p.minX)*(p.maxY-p.minY)}function Ul(p){return p.maxX-p.minX+(p.maxY-p.minY)}function ll(p,v){const m=Math.max(p.minX,v.minX),w=Math.max(p.minY,v.minY),D=Math.min(p.maxX,v.maxX),N=Math.min(p.maxY,v.maxY);return Math.max(0,D-m)*Math.max(0,N-w)}function Wc(p,v){return!(p.minX>v.minX||p.minY>v.minY||v.maxX>p.maxX||v.maxY>p.maxY)}function vl(p,v){return!(v.minX>p.maxX||v.minY>p.maxY||p.minX>v.maxX||p.minY>v.maxY)}function oi(p){return{children:p,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function fi(p,v,m,w,D){const N=[v,m];for(;N.length;){if(w>=(m=N.pop())-(v=N.pop()))continue;const W=v+Math.ceil((m-v)/w/2)*w;qa(p,W,v,m,D),N.push(v,W,W,m)}}var tu=Object.freeze({__proto__:null,default:class{constructor(p=9){this._maxEntries=Math.max(4,p),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(p){let v=this.data;const m=[];if(!vl(p,v))return m;const w=this.toBBox,D=[];for(;v;){for(let N=0;v.children.length>N;N++){const W=v.children[N],$=v.leaf?w(W):W;vl(p,$)&&(v.leaf?m.push(W):Wc(p,$)?this._all(W,m):D.push(W))}v=D.pop()}return m}collides(p){let v=this.data;if(!vl(p,v))return!1;const m=[];for(;v;){for(let w=0;v.children.length>w;w++){const D=v.children[w],N=v.leaf?this.toBBox(D):D;if(vl(p,N)){if(v.leaf||Wc(p,N))return!0;m.push(D)}}v=m.pop()}return!1}load(p){if(!p||!p.length)return this;if(this._minEntries>p.length){for(let m=0;p.length>m;m++)this.insert(p[m]);return this}let v=this._build(p.slice(),0,p.length-1,0);if(this.data.children.length)if(this.data.height===v.height)this._splitRoot(this.data,v);else{if(v.height>this.data.height){const m=this.data;this.data=v,v=m}this._insert(v,this.data.height-v.height-1,!0)}else this.data=v;return this}insert(p){return p&&this._insert(p,this.data.height-1),this}clear(){return this.data=oi([]),this}remove(p,v){if(!p)return this;let m=this.data;const w=this.toBBox(p),D=[],N=[];let W,$,ie;for(;m||D.length;){if(m||(m=D.pop(),$=D[D.length-1],W=N.pop(),ie=!0),m.leaf){const pe=rc(p,m.children,v);if(pe!==-1)return m.children.splice(pe,1),D.push(m),this._condense(D),this}ie||m.leaf||!Wc(m,w)?$?(W++,m=$.children[W],ie=!1):m=null:(D.push(m),N.push(W),W=0,$=m,m=m.children[0])}return this}toBBox(p){return p}compareMinX(p,v){return p.minX-v.minX}compareMinY(p,v){return p.minY-v.minY}toJSON(){return this.data}fromJSON(p){return this.data=p,this}_all(p,v){const m=[];for(;p;)p.leaf?v.push(...p.children):m.push(...p.children),p=m.pop();return v}_build(p,v,m,w){const D=m-v+1;let N,W=this._maxEntries;if(W>=D)return N=oi(p.slice(v,m+1)),xu(N,this.toBBox),N;w||(W=Math.ceil(D/Math.pow(W,(w=Math.ceil(Math.log(D)/Math.log(W)))-1))),N=oi([]),N.leaf=!1,N.height=w;const $=Math.ceil(D/W),ie=$*Math.ceil(Math.sqrt(W));fi(p,v,m,ie,this.compareMinX);for(let pe=v;m>=pe;pe+=ie){const we=Math.min(pe+ie-1,m);fi(p,pe,we,$,this.compareMinY);for(let ke=pe;we>=ke;ke+=$)N.children.push(this._build(p,ke,Math.min(ke+$-1,we),w-1))}return xu(N,this.toBBox),N}_chooseSubtree(p,v,m,w){for(;w.push(v),!v.leaf&&w.length-1!==m;){let W,$=1/0,ie=1/0;for(let pe=0;v.children.length>pe;pe++){const we=v.children[pe],ke=sh(we),Ge=(Math.max((N=we).maxX,(D=p).maxX)-Math.min(N.minX,D.minX))*(Math.max(N.maxY,D.maxY)-Math.min(N.minY,D.minY))-ke;ie>Ge?(ie=Ge,$=$>ke?ke:$,W=we):Ge===ie&&$>ke&&($=ke,W=we)}v=W||v.children[0]}var D,N;return v}_insert(p,v,m){const w=m?p:this.toBBox(p),D=[],N=this._chooseSubtree(w,this.data,v,D);for(N.children.push(p),Cc(N,w);v>=0&&D[v].children.length>this._maxEntries;)this._split(D,v),v--;this._adjustParentBBoxes(w,D,v)}_split(p,v){const m=p[v],w=m.children.length,D=this._minEntries;this._chooseSplitAxis(m,D,w);const N=this._chooseSplitIndex(m,D,w),W=oi(m.children.splice(N,m.children.length-N));W.height=m.height,W.leaf=m.leaf,xu(m,this.toBBox),xu(W,this.toBBox),v?p[v-1].children.push(W):this._splitRoot(m,W)}_splitRoot(p,v){this.data=oi([p,v]),this.data.height=p.height+1,this.data.leaf=!1,xu(this.data,this.toBBox)}_chooseSplitIndex(p,v,m){let w,D=1/0,N=1/0;for(let W=v;m-v>=W;W++){const $=oh(p,0,W,this.toBBox),ie=oh(p,W,m,this.toBBox),pe=ll($,ie),we=sh($)+sh(ie);D>pe?(D=pe,w=W,N=N>we?we:N):pe===D&&N>we&&(N=we,w=W)}return w||m-v}_chooseSplitAxis(p,v,m){const w=p.leaf?this.compareMinX:ah,D=p.leaf?this.compareMinY:Qh,N=this._allDistMargin(p,v,m,w);this._allDistMargin(p,v,m,D)>N&&p.children.sort(w)}_allDistMargin(p,v,m,w){p.children.sort(w);const D=this.toBBox,N=oh(p,0,v,D),W=oh(p,m-v,m,D);let $=Ul(N)+Ul(W);for(let ie=v;m-v>ie;ie++){const pe=p.children[ie];Cc(N,p.leaf?D(pe):pe),$+=Ul(N)}for(let ie=m-v-1;ie>=v;ie--){const pe=p.children[ie];Cc(W,p.leaf?D(pe):pe),$+=Ul(W)}return $}_adjustParentBBoxes(p,v,m){for(let w=m;w>=0;w--)Cc(v[w],p)}_condense(p){for(let v,m=p.length-1;m>=0;m--)p[m].children.length===0?m>0?(v=p[m-1].children,v.splice(v.indexOf(p[m]),1)):this.clear():xu(p[m],this.toBBox)}}}),bu=Vc(tu),Dp=Vc(Qc),ai=Vc(Xp),is=Vc(zl).default,ep=ai.featureEach,mi=Dp.featureCollection;function Mc(p){var v=new bu(p);return v.insert=function(m){if(m.type!=="Feature")throw Error("invalid feature");return m.bbox=m.bbox?m.bbox:is(m),bu.prototype.insert.call(this,m)},v.load=function(m){var w=[];return Array.isArray(m)?m.forEach(function(D){if(D.type!=="Feature")throw Error("invalid features");D.bbox=D.bbox?D.bbox:is(D),w.push(D)}):ep(m,function(D){if(D.type!=="Feature")throw Error("invalid features");D.bbox=D.bbox?D.bbox:is(D),w.push(D)}),bu.prototype.load.call(this,w)},v.remove=function(m,w){if(m.type!=="Feature")throw Error("invalid feature");return m.bbox=m.bbox?m.bbox:is(m),bu.prototype.remove.call(this,m,w)},v.clear=function(){return bu.prototype.clear.call(this)},v.search=function(m){var w=bu.prototype.search.call(this,this.toBBox(m));return mi(w)},v.collides=function(m){return bu.prototype.collides.call(this,this.toBBox(m))},v.all=function(){var m=bu.prototype.all.call(this);return mi(m)},v.toJSON=function(){return bu.prototype.toJSON.call(this)},v.fromJSON=function(m){return bu.prototype.fromJSON.call(this,m)},v.toBBox=function(m){var w;if(m.bbox)w=m.bbox;else if(Array.isArray(m)&&m.length===4)w=m;else if(Array.isArray(m)&&m.length===6)w=[m[0],m[1],m[3],m[4]];else if(m.type==="Feature")w=is(m);else{if(m.type!=="FeatureCollection")throw Error("invalid geojson");w=is(m)}return{minX:w[0],minY:w[1],maxX:w[2],maxY:w[3]}},v}var Op=Mc;function Jp(p,v){var m={},w=[];if(p.type==="LineString"&&(p=Ju(p)),v.type==="LineString"&&(v=Ju(v)),p.type==="Feature"&&v.type==="Feature"&&p.geometry!==null&&v.geometry!==null&&p.geometry.type==="LineString"&&v.geometry.type==="LineString"&&p.geometry.coordinates.length===2&&v.geometry.coordinates.length===2){var D=Xc(p,v);return D&&w.push(D),Ks(w)}var N=Op();return N.load(ku(v)),yh(ku(p),function(W){yh(N.search(W),function($){var ie=Xc(W,$);if(ie){var pe=th(ie).join(",");m[pe]||(m[pe]=!0,w.push(ie))}})}),Ks(w)}function Xc(p,v){var m=th(p),w=th(v);if(m.length!==2)throw Error(" line1 must only contain 2 coordinates");if(w.length!==2)throw Error(" line2 must only contain 2 coordinates");var D=m[0][0],N=m[0][1],W=m[1][0],$=m[1][1],ie=w[0][0],pe=w[0][1],we=w[1][0],ke=w[1][1],Ge=(ke-pe)*(W-D)-(we-ie)*($-N),ht=(we-ie)*(N-pe)-(ke-pe)*(D-ie),mt=(W-D)*(N-pe)-($-N)*(D-ie);if(Ge===0)return null;var St=ht/Ge,xt=mt/Ge;return 0>St||St>1||0>xt||xt>1?null:al([D+St*(W-D),N+St*($-N)])}Op.default=Mc;var hc=6378137;function wh(p){return bc(p,function(v,m){return v+function(w){var D,N=0;switch(w.type){case"Polygon":return Pc(w.coordinates);case"MultiPolygon":for(D=0;w.coordinates.length>D;D++)N+=Pc(w.coordinates[D]);return N;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(m)},0)}function Pc(p){var v=0;if(p&&p.length>0){v+=Math.abs(Xl(p[0]));for(var m=1;p.length>m;m++)v-=Math.abs(Xl(p[m]))}return v}function Xl(p){var v,m,w,D,N,W,$=0,ie=p.length;if(ie>2){for(W=0;ie>W;W++)W===ie-2?(w=ie-2,D=ie-1,N=0):W===ie-1?(w=ie-1,D=0,N=1):(w=W,D=W+1,N=W+2),v=p[w],m=p[D],$+=(Rc(p[N][0])-Rc(v[0]))*Math.sin(Rc(m[1]));$=$*hc*hc/2}return $}function Rc(p){return p*Math.PI/180}function Eu(p,v){return v===void 0&&(v={}),Ps(p,function(m,w){var D=w.geometry.coordinates;return m+yu(D[0],D[1],v)},0)}function lh(p,v){v===void 0&&(v={});var m=vu(p);switch(v.properties||p.type!=="Feature"||(v.properties=p.properties),m.type){case"Polygon":return function(w,D){D===void 0&&(D={});var N=vu(w),W=N.coordinates,$=D.properties?D.properties:w.type==="Feature"?w.properties:{};return tp(W,$)}(m,v);case"MultiPolygon":return function(w,D){D===void 0&&(D={});var N=vu(w),W=N.coordinates,$=D.properties?D.properties:w.type==="Feature"?w.properties:{},ie=[];return W.forEach(function(pe){ie.push(tp(pe,$))}),Ks(ie)}(m,v);default:throw Error("invalid poly")}}function tp(p,v){return p.length>1?Lp(p,v):ou(p[0],v)}function rp(p){for(var v,m,w=th(p),D=0,N=1;w.length>N;)v=m||w[0],D+=((m=w[N])[0]-v[0])*(m[1]+v[1]),N++;return D>0}var su=_u(function(p){var v=Object.prototype.hasOwnProperty,m="~";function w(){}function D(ie,pe,we){this.fn=ie,this.context=pe,this.once=we||!1}function N(ie,pe,we,ke,Ge){if(typeof we!="function")throw new TypeError("The listener must be a function");var ht=new D(we,ke||ie,Ge),mt=m?m+pe:pe;return ie._events[mt]?ie._events[mt].fn?ie._events[mt]=[ie._events[mt],ht]:ie._events[mt].push(ht):(ie._events[mt]=ht,ie._eventsCount++),ie}function W(ie,pe){--ie._eventsCount==0?ie._events=new w:delete ie._events[pe]}function $(){this._events=new w,this._eventsCount=0}Object.create&&(w.prototype=Object.create(null),new w().__proto__||(m=!1)),$.prototype.eventNames=function(){var ie,pe,we=[];if(this._eventsCount===0)return we;for(pe in ie=this._events)v.call(ie,pe)&&we.push(m?pe.slice(1):pe);return Object.getOwnPropertySymbols?we.concat(Object.getOwnPropertySymbols(ie)):we},$.prototype.listeners=function(ie){var pe=this._events[m?m+ie:ie];if(!pe)return[];if(pe.fn)return[pe.fn];for(var we=0,ke=pe.length,Ge=Array(ke);ke>we;we++)Ge[we]=pe[we].fn;return Ge},$.prototype.listenerCount=function(ie){var pe=this._events[m?m+ie:ie];return pe?pe.fn?1:pe.length:0},$.prototype.emit=function(ie,pe,we,ke,Ge,ht){var mt=m?m+ie:ie;if(!this._events[mt])return!1;var St,xt,bt=this._events[mt],kt=arguments.length;if(bt.fn){switch(bt.once&&this.removeListener(ie,bt.fn,void 0,!0),kt){case 1:return bt.fn.call(bt.context),!0;case 2:return bt.fn.call(bt.context,pe),!0;case 3:return bt.fn.call(bt.context,pe,we),!0;case 4:return bt.fn.call(bt.context,pe,we,ke),!0;case 5:return bt.fn.call(bt.context,pe,we,ke,Ge),!0;case 6:return bt.fn.call(bt.context,pe,we,ke,Ge,ht),!0}for(xt=1,St=Array(kt-1);kt>xt;xt++)St[xt-1]=arguments[xt];bt.fn.apply(bt.context,St)}else{var ft,nr=bt.length;for(xt=0;nr>xt;xt++)switch(bt[xt].once&&this.removeListener(ie,bt[xt].fn,void 0,!0),kt){case 1:bt[xt].fn.call(bt[xt].context);break;case 2:bt[xt].fn.call(bt[xt].context,pe);break;case 3:bt[xt].fn.call(bt[xt].context,pe,we);break;case 4:bt[xt].fn.call(bt[xt].context,pe,we,ke);break;default:if(!St)for(ft=1,St=Array(kt-1);kt>ft;ft++)St[ft-1]=arguments[ft];bt[xt].fn.apply(bt[xt].context,St)}}return!0},$.prototype.on=function(ie,pe,we){return N(this,ie,pe,we,!1)},$.prototype.once=function(ie,pe,we){return N(this,ie,pe,we,!0)},$.prototype.removeListener=function(ie,pe,we,ke){var Ge=m?m+ie:ie;if(!this._events[Ge])return this;if(!pe)return W(this,Ge),this;var ht=this._events[Ge];if(ht.fn)ht.fn!==pe||ke&&!ht.once||we&&ht.context!==we||W(this,Ge);else{for(var mt=0,St=[],xt=ht.length;xt>mt;mt++)(ht[mt].fn!==pe||ke&&!ht[mt].once||we&&ht[mt].context!==we)&&St.push(ht[mt]);St.length?this._events[Ge]=St.length===1?St[0]:St:W(this,Ge)}return this},$.prototype.removeAllListeners=function(ie){var pe;return ie?this._events[pe=m?m+ie:ie]&&W(this,pe):(this._events=new w,this._eventsCount=0),this},$.prototype.off=$.prototype.removeListener,$.prototype.addListener=$.prototype.on,$.prefixed=m,$.EventEmitter=$,p.exports=$}),ql=function(p){function v(m,w){var D,N=w.style;return Ia(this,v),(D=Dn(this,v)).scene=void 0,D.style=void 0,D.layers=void 0,D.data=[],D.scene=m,D.style=N,D.layers=D.initLayers(),D.layers.forEach(function(W){m.addLayer(W)}),N.callback instanceof Function&&N.callback(D.layers),D}return Aa(v,p),Sl(v,[{key:"getLayers",value:function(){return this.layers}},{key:"show",value:function(){this.layers.forEach(function(m){m.show()})}},{key:"hide",value:function(){this.layers.forEach(function(m){m.hide()})}},{key:"setData",value:function(m){var w=Os(m).sort(function(D,N){return+D.properties.isActive-+N.properties.isActive});this.data=w,this.layers.forEach(function(D){D.setData(Ks(w))})}},{key:"destroy",value:function(){var m=this;this.layers.forEach(function(w){m.scene.removeLayer(w)})}}]),v}(su.EventEmitter),fa=function(p){function v(){return Ia(this,v),Dn(this,v,arguments)}return Aa(v,p),Sl(v,[{key:"initLayers",value:function(){var m=this.style,w=m.normal,D=m.style,N=m.options;return[new Ze.LineLayer(N!=null?N:{}).source(Ks([])).size(w.size).color(w.color).shape("line").style(D)]}}]),v}(ql),Rs=function(p){var v=typeof p;return p!=null&&(v=="object"||v=="function")},hs=typeof Bh=="object"&&Bh&&Bh.Object===Object&&Bh,lu=typeof self=="object"&&self&&self.Object===Object&&self,wu=hs||lu||Function("return this")(),uh=function(){return wu.Date.now()},ch=/\s/,Nu=function(p){for(var v=p.length;v--&&ch.test(p.charAt(v)););return v},Qp=/^\s+/,Gi=function(p){return p&&p.slice(0,Nu(p)+1).replace(Qp,"")},Si=wu.Symbol,ji=Object.prototype,ao=ji.hasOwnProperty,Ic=ji.toString,Gs=Si?Si.toStringTag:void 0,Lc=function(p){var v=ao.call(p,Gs),m=p[Gs];try{p[Gs]=void 0;var w=!0}catch(N){}var D=Ic.call(p);return w&&(v?p[Gs]=m:delete p[Gs]),D},ul=Object.prototype.toString,Nh=function(p){return ul.call(p)},xa=Si?Si.toStringTag:void 0,Al=function(p){return p==null?p===void 0?"[object Undefined]":"[object Null]":xa&&xa in Object(p)?Lc(p):Nh(p)},Lu=function(p){return p!=null&&typeof p=="object"},ks=function(p){return typeof p=="symbol"||Lu(p)&&Al(p)=="[object Symbol]"},_l=/^[-+]0x[0-9a-f]+$/i,pc=/^0b[01]+$/i,Du=/^0o[0-7]+$/i,zh=parseInt,Su=function(p){if(typeof p=="number")return p;if(ks(p))return NaN;if(Rs(p)){var v=typeof p.valueOf=="function"?p.valueOf():p;p=Rs(v)?v+"":v}if(typeof p!="string")return p===0?p:+p;p=Gi(p);var m=pc.test(p);return m||Du.test(p)?zh(p.slice(2),m?2:8):_l.test(p)?NaN:+p},qc=Math.max,Sh=Math.min,nc=function(p,v,m){var w,D,N,W,$,ie,pe=0,we=!1,ke=!1,Ge=!0;if(typeof p!="function")throw new TypeError("Expected a function");function ht(kt){var ft=w,nr=D;return w=D=void 0,pe=kt,W=p.apply(nr,ft)}function mt(kt){var ft=kt-ie;return ie===void 0||ft>=v||0>ft||ke&&kt-pe>=N}function St(){var kt=uh();if(mt(kt))return xt(kt);$=setTimeout(St,function(ft){var nr=v-(ft-ie);return ke?Sh(nr,N-(ft-pe)):nr}(kt))}function xt(kt){return $=void 0,Ge&&w?ht(kt):(w=D=void 0,W)}function bt(){var kt=uh(),ft=mt(kt);if(w=arguments,D=this,ie=kt,ft){if($===void 0)return function(nr){return pe=nr,$=setTimeout(St,v),we?ht(nr):W}(ie);if(ke)return clearTimeout($),$=setTimeout(St,v),ht(ie)}return $===void 0&&($=setTimeout(St,v)),W}return v=Su(v)||0,Rs(m)&&(we=!!m.leading,N=(ke="maxWait"in m)?qc(Su(m.maxWait)||0,v):N,Ge="trailing"in m?!!m.trailing:Ge),bt.cancel=function(){$!==void 0&&clearTimeout($),pe=0,w=ie=D=$=void 0},bt.flush=function(){return $===void 0?W:xt(uh())},bt},Yl=function(p){function v(){var m;Ia(this,v);for(var w=arguments.length,D=Array(w),N=0;w>N;N++)D[N]=arguments[N];return(m=Dn(this,v,[].concat(D))).onMouseMove=function(W){m.emit(ve.RenderEvent.Mousemove,W)},m.onMouseOut=function(W){m.emit(ve.RenderEvent.Mouseout,W)},m.onMouseDown=function(W){m.emit(ve.RenderEvent.Dragstart,W)},m.onDragging=function(W){m.emit(ve.RenderEvent.Dragging,W)},m.onDragEnd=nc(function(W){m.emit(ve.RenderEvent.Dragend,W)},0),m.onUnClick=function(W){m.emit(ve.RenderEvent.UnClick,W)},m.enableHover=function(){var W,$;m.disableHover(),(W=m.layers[0])===null||W===void 0||W.on(ve.LayerEvent.Mousemove,m.onMouseMove),($=m.layers[0])===null||$===void 0||$.on(ve.LayerEvent.Mouseout,m.onMouseOut)},m.disableHover=function(){var W,$;(W=m.layers[0])===null||W===void 0||W.off(ve.LayerEvent.Mousemove,m.onMouseMove),($=m.layers[0])===null||$===void 0||$.off(ve.LayerEvent.Mouseout,m.onMouseOut)},m}return Aa(v,p),Sl(v,[{key:"initLayers",value:function(){var m=this.style,w=m.normal,D=m.hover,N=m.active,W=m.style,$=m.options;return[new Ze.LineLayer($!=null?$:{}).source(Ks([])).size("isHover*isActive",function(ie,pe){return pe?N.size:ie?D.size:w.size}).color("isHover*isActive",function(ie,pe){return pe?N.color:ie?D.color:w.color}).shape("line").style(W)]}},{key:"enableDrag",value:function(){this.disableDrag(),this.layers[0].on(ve.LayerEvent.Mousedown,this.onMouseDown),this.scene.on(ve.SceneEvent.Dragging,this.onDragging),this.scene.on(ve.SceneEvent.Mouseup,this.onDragEnd),this.scene.on(ve.SceneEvent.Dragend,this.onDragEnd)}},{key:"disableDrag",value:function(){this.layers[0].off(ve.LayerEvent.Mousedown,this.onMouseDown),this.scene.off(ve.SceneEvent.Dragging,this.onDragging),this.scene.off(ve.SceneEvent.Mouseup,this.onDragEnd),this.scene.off(ve.SceneEvent.Dragend,this.onDragEnd)}},{key:"enableUnClick",value:function(){this.disableUnClick(),this.layers[0].on(ve.LayerEvent.UnClick,this.onUnClick)}},{key:"disableUnClick",value:function(){this.layers[0].off(ve.LayerEvent.UnClick,this.onUnClick)}}]),v}(ql),Th=function(p){function v(){var m;Ia(this,v);for(var w=arguments.length,D=Array(w),N=0;w>N;N++)D[N]=arguments[N];return(m=Dn(this,v,[].concat(D))).onMouseMove=function(W){m.emit(ve.RenderEvent.Mousemove,W)},m.onMouseOut=function(W){m.emit(ve.RenderEvent.Mouseout,W)},m.onMouseDown=function(W){m.emit(ve.RenderEvent.Click,W)},m}return Aa(v,p),Sl(v,[{key:"initLayers",value:function(){var m=this.style,w=m.normal,D=m.style,N=D===void 0?{}:D,W=m.options,$=w.shape,ie=w.size,pe=w.color;return[new Ze.PointLayer(W!=null?W:{}).source(Ks([])).size(ie).color(pe).shape($).style(N)]}},{key:"enableClick",value:function(){this.disableClick(),this.layers[0].on(ve.LayerEvent.Mousedown,this.onMouseDown)}},{key:"disableClick",value:function(){this.layers[0].off(ve.LayerEvent.Mousedown,this.onMouseDown)}},{key:"enableHover",value:function(){var m,w;this.disableHover(),(m=this.layers[0])===null||m===void 0||m.on(ve.LayerEvent.Mousemove,this.onMouseMove),(w=this.layers[0])===null||w===void 0||w.on(ve.LayerEvent.Mouseout,this.onMouseOut)}},{key:"disableHover",value:function(){var m,w;(m=this.layers[0])===null||m===void 0||m.off(ve.LayerEvent.Mousemove,this.onMouseMove),(w=this.layers[0])===null||w===void 0||w.off(ve.LayerEvent.Mouseout,this.onMouseOut)}}]),v}(ql),ba=function(p){function v(){var m;Ia(this,v);for(var w=arguments.length,D=Array(w),N=0;w>N;N++)D[N]=arguments[N];return(m=Dn(this,v,[].concat(D))).onCreate=function(W){m.emit(ve.RenderEvent.UnClick,W)},m.onMouseMove=function(W){m.emit(ve.RenderEvent.Mousemove,W)},m.onMouseOut=function(W){m.emit(ve.RenderEvent.Mouseout,W)},m.onMouseDown=function(W){m.emit(ve.RenderEvent.Dragstart,W)},m.onDragging=function(W){m.emit(ve.RenderEvent.Dragging,W)},m.onDragEnd=nc(function(W){m.emit(ve.RenderEvent.Dragend,W)},0),m.onClick=function(W){m.emit(ve.RenderEvent.Click,W)},m.onContextmenu=function(W){m.emit(ve.RenderEvent.Contextmenu,W)},m}return Aa(v,p),Sl(v,[{key:"initLayers",value:function(){var m=this.style,w=m.normal,D=m.hover,N=m.active,W=m.style,$=W===void 0?{}:W,ie=m.options;return[new Ze.PointLayer(ie!=null?ie:{}).source(Ks([])).size("isHover*isActive",function(pe,we){return we?N.size:pe?D.size:w.size}).color("isHover*isActive",function(pe,we){return we?N.color:pe?D.color:w.color}).shape("isHover*isActive",function(pe,we){return we?N.shape:pe?D.shape:w.shape}).style($)]}},{key:"enableCreate",value:function(){this.disableCreate(),this.layers[0].on(ve.LayerEvent.UnClick,this.onCreate)}},{key:"disableCreate",value:function(){this.layers[0].off(ve.LayerEvent.UnClick,this.onCreate)}},{key:"enableHover",value:function(){var m,w;this.disableHover(),(m=this.layers[0])===null||m===void 0||m.on(ve.LayerEvent.Mousemove,this.onMouseMove),(w=this.layers[0])===null||w===void 0||w.on(ve.LayerEvent.Mouseout,this.onMouseOut)}},{key:"disableHover",value:function(){var m,w;(m=this.layers[0])===null||m===void 0||m.off(ve.LayerEvent.Mousemove,this.onMouseMove),(w=this.layers[0])===null||w===void 0||w.off(ve.LayerEvent.Mouseout,this.onMouseOut)}},{key:"enableDrag",value:function(){this.disableDrag(),this.layers[0].on(ve.LayerEvent.Mousedown,this.onMouseDown),this.scene.on(ve.SceneEvent.Dragging,this.onDragging),this.scene.on(ve.SceneEvent.Mouseup,this.onDragEnd),this.scene.on(ve.SceneEvent.Dragend,this.onDragEnd)}},{key:"disableDrag",value:function(){this.layers[0].off(ve.LayerEvent.Mousedown,this.onMouseDown),this.scene.off(ve.SceneEvent.Dragging,this.onDragging),this.scene.off(ve.SceneEvent.Mouseup,this.onDragEnd),this.scene.off(ve.SceneEvent.Dragend,this.onDragEnd)}},{key:"enableClick",value:function(){this.disableClick(),this.layers[0].on(ve.LayerEvent.Click,this.onClick)}},{key:"disableClick",value:function(){this.layers[0].off(ve.LayerEvent.Click,this.onClick)}},{key:"enableContextMenu",value:function(){this.disableContextMenu(),this.layers[0].on(ve.LayerEvent.Contextmenu,this.onContextmenu)}},{key:"disableContextMenu",value:function(){this.layers[0].off(ve.LayerEvent.Contextmenu,this.onContextmenu)}}]),v}(ql),z=function(p){function v(){var m;Ia(this,v);for(var w=arguments.length,D=Array(w),N=0;w>N;N++)D[N]=arguments[N];return(m=Dn(this,v,[].concat(D))).onMouseMove=function(W){m.emit(ve.RenderEvent.Mousemove,W)},m.onMouseOut=function(W){m.emit(ve.RenderEvent.Mouseout,W)},m.onMouseDown=function(W){m.emit(ve.RenderEvent.Dragstart,W)},m.onDragging=function(W){m.emit(ve.RenderEvent.Dragging,W)},m.onDragEnd=nc(function(W){m.emit(ve.RenderEvent.Dragend,W)},0),m.onUnClick=function(W){m.emit(ve.RenderEvent.UnClick,W)},m.enableHover=function(){var W,$;m.disableHover(),(W=m.layers[0])===null||W===void 0||W.on(ve.LayerEvent.Mousemove,m.onMouseMove),($=m.layers[0])===null||$===void 0||$.on(ve.LayerEvent.Mouseout,m.onMouseOut)},m.disableHover=function(){var W,$;(W=m.layers[0])===null||W===void 0||W.off(ve.LayerEvent.Mousemove,m.onMouseMove),($=m.layers[0])===null||$===void 0||$.off(ve.LayerEvent.Mouseout,m.onMouseOut)},m}return Aa(v,p),Sl(v,[{key:"initLayers",value:function(){var m=this.style,w=m.normal,D=m.hover,N=m.active,W=m.style,$=m.options,ie=new Ze.PolygonLayer($!=null?$:{});return ie.source(Ks([])).color("isHover*isActive",function(pe,we){return we?N.color:pe?D.color:w.color}).style(W),[ie]}},{key:"enableDrag",value:function(){this.disableDrag(),this.layers[0].on(ve.LayerEvent.Mousedown,this.onMouseDown),this.scene.on(ve.SceneEvent.Dragging,this.onDragging),this.scene.on(ve.SceneEvent.Mouseup,this.onDragEnd),this.scene.on(ve.SceneEvent.Dragend,this.onDragEnd)}},{key:"disableDrag",value:function(){this.layers[0].off(ve.LayerEvent.Mousedown,this.onMouseDown),this.scene.off(ve.SceneEvent.Dragging,this.onDragging),this.scene.off(ve.SceneEvent.Mouseup,this.onDragEnd),this.scene.off(ve.SceneEvent.Dragend,this.onDragEnd)}},{key:"enableUnClick",value:function(){this.disableUnClick(),this.layers[0].on(ve.LayerEvent.UnClick,this.onUnClick)}},{key:"disableUnClick",value:function(){this.layers[0].off(ve.LayerEvent.UnClick,this.onUnClick)}}]),v}(ql),s=function(p){function v(m){var w;return Ia(this,v),(w=Dn(this,v)).scene=void 0,w.previousClick=void 0,w.onDblClick=function(D){var N,W,$=(N=(W=D.pixel)!==null&&W!==void 0?W:D.point)!==null&&N!==void 0?N:{},ie=$.x,pe=ie===void 0?0:ie,we=$.y,ke=we===void 0?0:we,Ge=Date.now();if(w.previousClick){var ht=w.previousClick,mt=ht.y;300>Ge-ht.time&&5>Math.abs(pe-ht.x)&&5>Math.abs(ke-mt)&&w.emit(ve.RenderEvent.DblClick,D)}w.previousClick={x:pe,y:ke,time:Ge}},w.onMouseMove=function(D){w.emit(ve.RenderEvent.Mousemove,D)},w.onMouseDown=function(D){w.emit(ve.RenderEvent.Dragstart,D)},w.onDragging=function(D){w.emit(ve.RenderEvent.Dragging,D)},w.onDragEnd=nc(function(D){w.emit(ve.RenderEvent.Dragend,D)},0),w.scene=m,w}return Aa(v,p),Sl(v,[{key:"enableDrag",value:function(){this.disableDrag(),this.scene.on(ve.SceneEvent.Mousedown,this.onMouseDown),this.scene.on(ve.SceneEvent.Dragging,this.onDragging),this.scene.on(ve.SceneEvent.Mouseup,this.onDragEnd),this.scene.on(ve.SceneEvent.Dragend,this.onDragEnd)}},{key:"disableDrag",value:function(){this.scene.off(ve.SceneEvent.Mousedown,this.onMouseDown),this.scene.off(ve.SceneEvent.Dragging,this.onDragging),this.scene.off(ve.SceneEvent.Mouseup,this.onDragEnd),this.scene.off(ve.SceneEvent.Dragend,this.onDragEnd)}},{key:"enableMouseMove",value:function(){this.disableMouseMove(),this.scene.on(ve.SceneEvent.Mousemove,this.onMouseMove)}},{key:"disableMouseMove",value:function(){this.scene.off(ve.SceneEvent.Mousemove,this.onMouseMove)}},{key:"enableDblClick",value:function(){this.disableDblClick(),this.scene.on(ve.SceneEvent.Mousedown,this.onDblClick)}},{key:"disableDblClick",value:function(){this.scene.off(ve.SceneEvent.Mousedown,this.onDblClick)}}]),v}(su),x=function(p){function v(){return Ia(this,v),Dn(this,v,arguments)}return Aa(v,p),Sl(v,[{key:"initLayers",value:function(){var m=this.style,w=m.normal,D=m.active,N=m.style,W=N===void 0?{}:N,$=m.options;return[new Ze.PointLayer($!=null?$:{}).source(Ks([])).size("isActive",function(ie){return ie?D.size:w.size}).color("isActive",function(ie){return ie?D.color:w.color}).shape("text","text").style(W)]}}]),v}(ql),I={point:ba,line:Yl,dashLine:fa,midPoint:Th,text:x,polygon:z},k="#1990FF",H="#ED9D48",ee={blend:"normal",pickingBuffer:5},ne={color:k,shape:"circle",size:6},ue={color:H,shape:"circle",size:6},_e={shape:"circle",size:6,color:H},h={options:ee,normal:ne,hover:mn(mn({},ne),{},{size:8}),active:mn(mn({},ne),{},{size:8,color:H}),style:{stroke:"#ffffff",strokeWidth:2}},g={options:ee,normal:ue,hover:mn(mn({},ue),{},{size:8}),active:mn(mn({},ue),{},{size:8}),style:{stroke:"#ffffff",strokeWidth:2}},d={color:k,size:12},b={point:g,line:{options:ee,normal:{color:k,size:2},hover:{color:k,size:2},active:{color:H,size:2},style:{}},polygon:{options:ee,normal:{color:k},hover:{color:k},active:{color:H},style:{opacity:.15}},midPoint:{options:ee,normal:_e},dashLine:{options:ee,normal:{color:H,size:2},style:{lineType:"dash",dashArray:[6,6]}},text:{options:ee,normal:d,active:mn(mn({},d),{},{color:H}),style:{fontWeight:"800",textOffset:[0,d.size+6],textAllowOverlap:!0,stroke:"#ffffff",strokeWidth:2}}},B={draw:"\u5355\u51FB\u7ED8\u5236\u70B9",pointHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u70B9\u4F4D\u7F6E",pointDrag:null},G={draw:"\u5355\u51FB\u7ED8\u5236\u9996\u4E2A\u8282\u70B9",pointHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u8282\u70B9\u4F4D\u7F6E",pointDrag:null,lineHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u7EBF\u4F4D\u7F6E",lineDrag:null,midPointHover:"\u5355\u51FB\u5728\u8BE5\u4F4D\u7F6E\u65B0\u589E\u8282\u70B9",drawFinish:"\u5355\u51FB\u7EE7\u7EED\u7ED8\u5236\uFF0C\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236"},q={draw:"\u5355\u51FB\u7ED8\u5236\u9996\u4E2A\u8282\u70B9",drawContinue:"\u5355\u51FB\u7EE7\u7EED\u7ED8\u5236",drawFinish:"\u5355\u51FB\u7EE7\u7EED\u7ED8\u5236\uFF0C\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236",midPointHover:"\u5355\u51FB\u5728\u8BE5\u4F4D\u7F6E\u65B0\u589E\u8282\u70B9",pointHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u8282\u70B9\u4F4D\u7F6E",pointDrag:null,lineHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u9762\u4F4D\u7F6E",lineDrag:null,polygonHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u9762\u4F4D\u7F6E",polygonDrag:null},te=mn(mn({},q),{},{draw:"\u5355\u51FB\u7ED8\u5236\u9996\u4E2A\u8282\u70B9",drawFinish:"\u5355\u51FB\u7ED3\u675F\u7ED8\u5236"}),fe={draw:"\u62D6\u62FD\u5F00\u59CB\u7ED8\u5236",drawFinish:"\u677E\u5F00\u9F20\u6807\u7ED3\u675F\u7ED8\u5236"},ce={lineHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u77E9\u5F62\u4F4D\u7F6E",polygonHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u77E9\u5F62\u4F4D\u7F6E"},Te={lineHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u5706\u4F4D\u7F6E",polygonHover:"\u53EF\u62D6\u62FD\u8C03\u6574\u5706\u4F4D\u7F6E"},Ie=function(p,v){return p===v||p!=p&&v!=v},Oe=function(p,v){for(var m=p.length;m--;)if(Ie(p[m][0],v))return m;return-1},Qe=Array.prototype.splice,nt=function(p){var v=this.__data__,m=Oe(v,p);return m>=0&&(m==v.length-1?v.pop():Qe.call(v,m,1),--this.size,!0)},ct=function(p){var v=this.__data__,m=Oe(v,p);return 0>m?void 0:v[m][1]},tt=function(p){return Oe(this.__data__,p)>-1},Tt=function(p,v){var m=this.__data__,w=Oe(m,p);return 0>w?(++this.size,m.push([p,v])):m[w][1]=v,this};function Ut(p){var v=-1,m=p==null?0:p.length;for(this.clear();++vw.length)return w.push([p,v]),this.size=++m.size,this;m=this.__data__=new Tu(w)}return m.set(p,v),this.size=m.size,this};function Dl(p){var v=this.__data__=new Nt(p);this.size=v.size}Dl.prototype.clear=pr,Dl.prototype.delete=tr,Dl.prototype.get=Dr,Dl.prototype.has=Hr,Dl.prototype.set=Zu;var Vl=Dl,Uh=function(p,v){for(var m=-1,w=p==null?0:p.length;++m-1&&p%1==0&&v>p},ef=function(p){return typeof p=="number"&&p>-1&&p%1==0&&9007199254740991>=p},_s={};_s["[object Float32Array]"]=_s["[object Float64Array]"]=_s["[object Int8Array]"]=_s["[object Int16Array]"]=_s["[object Int32Array]"]=_s["[object Uint8Array]"]=_s["[object Uint8ClampedArray]"]=_s["[object Uint16Array]"]=_s["[object Uint32Array]"]=!0,_s["[object Arguments]"]=_s["[object Array]"]=_s["[object ArrayBuffer]"]=_s["[object Boolean]"]=_s["[object DataView]"]=_s["[object Date]"]=_s["[object Error]"]=_s["[object Function]"]=_s["[object Map]"]=_s["[object Number]"]=_s["[object Object]"]=_s["[object RegExp]"]=_s["[object Set]"]=_s["[object String]"]=_s["[object WeakMap]"]=!1;var Ff=function(p){return Lu(p)&&ef(p.length)&&!!_s[Al(p)]},sd=function(p){return function(v){return p(v)}},fh=_u(function(p,v){var m=v&&!v.nodeType&&v,w=m&&p&&!p.nodeType&&p,D=w&&w.exports===m&&hs.process,N=function(){try{var W=w&&w.require&&w.require("util").types;return W||D&&D.binding&&D.binding("util")}catch($){}}();p.exports=N}),_d=fh&&fh.isTypedArray,ld=_d?sd(_d):Ff,ym=Object.prototype.hasOwnProperty,Xf=function(p,v){var m=Hu(p),w=!m&&yf(p),D=!m&&!w&&fc(p),N=!m&&!w&&!D&&ld(p),W=m||w||D||N,$=W?os(p.length,String):[],ie=$.length;for(var pe in p)!v&&!ym.call(p,pe)||W&&(pe=="length"||D&&(pe=="offset"||pe=="parent")||N&&(pe=="buffer"||pe=="byteLength"||pe=="byteOffset")||op(pe,ie))||$.push(pe);return $},tm=Object.prototype,Gu=function(p){var v=p&&p.constructor;return p===(typeof v=="function"&&v.prototype||tm)},xf=function(p,v){return function(m){return p(v(m))}},tf=xf(Object.keys,Object),ud=Object.prototype.hasOwnProperty,qf=function(p){if(!Gu(p))return tf(p);var v=[];for(var m in Object(p))ud.call(p,m)&&m!="constructor"&&v.push(m);return v},Dd=function(p){return p!=null&&ef(p.length)&&!nn(p)},Yf=function(p){return Dd(p)?Xf(p):qf(p)},Kl=function(p,v){return p&&ju(v,Yf(v),p)},Od=function(p){var v=[];if(p!=null)for(var m in Object(p))v.push(m);return v},Bd=Object.prototype.hasOwnProperty,bf=function(p){if(!Rs(p))return Od(p);var v=Gu(p),m=[];for(var w in p)(w!="constructor"||!v&&Bd.call(p,w))&&m.push(w);return m},wp=function(p){return Dd(p)?Xf(p,!0):bf(p)},$f=function(p,v){return p&&ju(v,wp(v),p)},ap=_u(function(p,v){var m=v&&!v.nodeType&&v,w=m&&p&&!p.nodeType&&p,D=w&&w.exports===m?wu.Buffer:void 0,N=D?D.allocUnsafe:void 0;p.exports=function(W,$){if($)return W.slice();var ie=W.length,pe=N?N(ie):new W.constructor(ie);return W.copy(pe),pe}}),kf=function(p,v){var m=-1,w=p.length;for(v||(v=Array(w));++m$))return!1;var pe=N.get(p),we=N.get(v);if(pe&&we)return pe==v&&we==p;var ke=-1,Ge=!0,ht=2&m?new qr:void 0;for(N.set(p,v),N.set(v,p);++ke<$;){var mt=p[ke],St=v[ke];if(w)var xt=W?w(St,mt,ke,v,p,N):w(mt,St,ke,p,v,N);if(xt!==void 0){if(xt)continue;Ge=!1;break}if(ht){if(!wn(v,function(bt,kt){if(!Yr(ht,kt)&&(mt===bt||D(mt,bt,m,w,N)))return ht.push(kt)})){Ge=!1;break}}else if(mt!==St&&!D(mt,St,m,w,N)){Ge=!1;break}}return N.delete(p),N.delete(v),Ge},Wn=function(p){var v=-1,m=Array(p.size);return p.forEach(function(w,D){m[++v]=[D,w]}),m},Bn=function(p){var v=-1,m=Array(p.size);return p.forEach(function(w){m[++v]=w}),m},si=Si?Si.prototype:void 0,Hn=si?si.valueOf:void 0,qn=function(p,v,m,w,D,N,W){switch(m){case"[object DataView]":if(p.byteLength!=v.byteLength||p.byteOffset!=v.byteOffset)return!1;p=p.buffer,v=v.buffer;case"[object ArrayBuffer]":return!(p.byteLength!=v.byteLength||!N(new yp(p),new yp(v)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ie(+p,+v);case"[object Error]":return p.name==v.name&&p.message==v.message;case"[object RegExp]":case"[object String]":return p==v+"";case"[object Map]":var $=Wn;case"[object Set]":if($||($=Bn),p.size!=v.size&&!(1&w))return!1;var ie=W.get(p);if(ie)return ie==v;w|=2,W.set(p,v);var pe=Or($(p),$(v),w,D,N,W);return W.delete(p),pe;case"[object Symbol]":if(Hn)return Hn.call(p)==Hn.call(v)}return!1},ci=Object.prototype.hasOwnProperty,Vn=function(p,v,m,w,D,N){var W=1&m,$=yd(p),ie=$.length;if(ie!=yd(v).length&&!W)return!1;for(var pe=ie;pe--;){var we=$[pe];if(!(W?we in v:ci.call(v,we)))return!1}var ke=N.get(p),Ge=N.get(v);if(ke&&Ge)return ke==v&&Ge==p;var ht=!0;N.set(p,v),N.set(v,p);for(var mt=W;++pe0){if(++v>=800)return arguments[0]}else v=0;return p.apply(void 0,arguments)}},fu=as(ml?function(p,v){return ml(p,"toString",{configurable:!0,enumerable:!1,value:Cu(v),writable:!0})}:Ee),Js=function(p,v){return fu(Es(p,v,Ee),p+"")},ps=function(p,v,m){if(!Rs(m))return!1;var w=typeof v;return!!(w=="number"?Dd(m)&&op(v,m.length):w=="string"&&v in m)&&Ie(m[v],p)},du=function(p){return Js(function(v,m){var w=-1,D=m.length,N=D>1?m[D-1]:void 0,W=D>2?m[2]:void 0;for(N=p.length>3&&typeof N=="function"?(D--,N):void 0,W&&ps(m[0],m[1],W)&&(N=3>D?void 0:N,D=1),v=Object(v);++w":".","?":"/","|":"\\"},ie={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},pe=1;20>pe;++pe)N[111+pe]="f"+pe;for(pe=0;9>=pe;++pe)N[pe+96]=""+pe;xt.prototype.bind=function(bt,kt,ft){var nr=this;return nr._bindMultiple.call(nr,bt=bt instanceof Array?bt:[bt],kt,ft),nr},xt.prototype.unbind=function(bt,kt){return this.bind.call(this,bt,function(){},kt)},xt.prototype.trigger=function(bt,kt){var ft=this;return ft._directMap[bt+":"+kt]&&ft._directMap[bt+":"+kt]({},bt),ft},xt.prototype.reset=function(){var bt=this;return bt._callbacks={},bt._directMap={},bt},xt.prototype.stopCallback=function(bt,kt){if((" "+kt.className+" ").indexOf(" mousetrap ")>-1||St(kt,this.target))return!1;if("composedPath"in bt&&typeof bt.composedPath=="function"){var ft=bt.composedPath()[0];ft!==bt.target&&(kt=ft)}return kt.tagName=="INPUT"||kt.tagName=="SELECT"||kt.tagName=="TEXTAREA"||kt.isContentEditable},xt.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},xt.addKeycodes=function(bt){for(var kt in bt)bt.hasOwnProperty(kt)&&(N[kt]=bt[kt]);D=null},xt.init=function(){var bt=xt(m);for(var kt in bt)kt.charAt(0)!=="_"&&(xt[kt]=function(ft){return function(){return bt[ft].apply(bt,arguments)}}(kt))},xt.init(),v.Mousetrap=xt,p.exports&&(p.exports=xt)}function we(bt,kt,ft){bt.addEventListener?bt.addEventListener(kt,ft,!1):bt.attachEvent("on"+kt,ft)}function ke(bt){if(bt.type=="keypress"){var kt=String.fromCharCode(bt.which);return bt.shiftKey||(kt=kt.toLowerCase()),kt}return N[bt.which]?N[bt.which]:W[bt.which]?W[bt.which]:String.fromCharCode(bt.which).toLowerCase()}function Ge(bt){return bt=="shift"||bt=="ctrl"||bt=="alt"||bt=="meta"}function ht(bt,kt,ft){return ft||(ft=function(){if(!D)for(var nr in D={},N)nr>95&&112>nr||N.hasOwnProperty(nr)&&(D[N[nr]]=nr);return D}()[bt]?"keydown":"keypress"),ft=="keypress"&&kt.length&&(ft="keydown"),ft}function mt(bt,kt){var ft,nr,br,Pr=[];for(ft=function(Mn){return Mn==="+"?["+"]:(Mn=Mn.replace(/\+{2}/g,"+plus")).split("+")}(bt),br=0;ft.length>br;++br)ie[nr=ft[br]]&&(nr=ie[nr]),kt&&kt!="keypress"&&$[nr]&&(nr=$[nr],Pr.push("shift")),Ge(nr)&&Pr.push(nr);return{key:nr,modifiers:Pr,action:kt=ht(nr,Pr,kt)}}function St(bt,kt){return bt!==null&&bt!==m&&(bt===kt||St(bt.parentNode,kt))}function xt(bt){var kt=this;if(bt=bt||m,!(kt instanceof xt))return new xt(bt);kt.target=bt,kt._callbacks={},kt._directMap={};var ft,nr={},br=!1,Pr=!1,Mn=!1;function yn(hn){hn=hn||{};var An,Yi=!1;for(An in nr)hn[An]?Yi=!0:nr[An]=0;Yi||(Mn=!1)}function kr(hn,An,Yi,Ci,fo,Go){var hi,zi,Vo,Ka=[],ta=Yi.type;if(!kt._callbacks[hn])return[];for(ta=="keyup"&&Ge(hn)&&(An=[hn]),hi=0;kt._callbacks[hn].length>hi;++hi)zi=kt._callbacks[hn][hi],(Ci||!zi.seq||nr[zi.seq]==zi.level)&&ta==zi.action&&(ta=="keypress"&&!Yi.metaKey&&!Yi.ctrlKey||(Vo=zi.modifiers,An.sort().join(",")===Vo.sort().join(",")))&&((!Ci&&zi.combo==fo||Ci&&zi.seq==Ci&&zi.level==Go)&&kt._callbacks[hn].splice(hi,1),Ka.push(zi));return Ka}function Ai(hn,An,Yi,Ci){kt.stopCallback(An,An.target||An.srcElement,Yi,Ci)||hn(An,Yi)===!1&&(function(fo){fo.preventDefault?fo.preventDefault():fo.returnValue=!1}(An),function(fo){fo.stopPropagation?fo.stopPropagation():fo.cancelBubble=!0}(An))}function $n(hn){typeof hn.which!="number"&&(hn.which=hn.keyCode);var An=ke(hn);An&&(hn.type!="keyup"||br!==An?kt.handleKey(An,function(Yi){var Ci=[];return Yi.shiftKey&&Ci.push("shift"),Yi.altKey&&Ci.push("alt"),Yi.ctrlKey&&Ci.push("ctrl"),Yi.metaKey&&Ci.push("meta"),Ci}(hn),hn):br=!1)}function ti(hn,An,Yi,Ci){function fo(Vo){return function(){Mn=Vo,++nr[hn],clearTimeout(ft),ft=setTimeout(yn,1e3)}}function Go(Vo){Ai(Yi,Vo,hn),Ci!=="keyup"&&(br=ke(Vo)),setTimeout(yn,10)}nr[hn]=0;for(var hi=0;An.length>hi;++hi){var zi=hi+1===An.length?Go:fo(Ci||mt(An[hi+1]).action);ri(An[hi],zi,Ci,hn,hi)}}function ri(hn,An,Yi,Ci,fo){kt._directMap[hn+":"+Yi]=An;var Go,hi=(hn=hn.replace(/\s+/g," ")).split(" ");hi.length>1?ti(hn,hi,An,Yi):(Go=mt(hn,Yi),kt._callbacks[Go.key]=kt._callbacks[Go.key]||[],kr(Go.key,Go.modifiers,{type:Go.action},Ci,hn,fo),kt._callbacks[Go.key][Ci?"unshift":"push"]({callback:An,modifiers:Go.modifiers,action:Go.action,seq:Ci,level:fo,combo:hn}))}kt._handleKey=function(hn,An,Yi){var Ci,fo=kr(hn,An,Yi),Go={},hi=0,zi=!1;for(Ci=0;fo.length>Ci;++Ci)fo[Ci].seq&&(hi=Math.max(hi,fo[Ci].level));for(Ci=0;fo.length>Ci;++Ci)if(fo[Ci].seq){if(fo[Ci].level!=hi)continue;zi=!0,Go[fo[Ci].seq]=1,Ai(fo[Ci].callback,Yi,fo[Ci].combo,fo[Ci].seq)}else zi||Ai(fo[Ci].callback,Yi,fo[Ci].combo);var Vo=Yi.type=="keypress"&⪻Yi.type!=Mn||Ge(hn)||Vo||yn(Go),Pr=zi&&Yi.type=="keydown"},kt._bindMultiple=function(hn,An,Yi){for(var Ci=0;hn.length>Ci;++Ci)ri(hn[Ci],An,Yi)},we(bt,"keypress",$n),we(bt,"keydown",$n),we(bt,"keyup",$n)}})(typeof window!="undefined"?window:null,typeof window!="undefined"?document:null)}),ss,go=function(p){return p&&p.length?p[0]:void 0},ya=(ss=1,function(p){return"".concat(p,"-").concat(ss++)}),Qo=function(p,v){var m,w;return!(!p||!v||((m=p.properties)===null||m===void 0?void 0:m.id)!==((w=v.properties)===null||w===void 0?void 0:w.id))},Qs=function(p){var v=p.target,m=p.targetHandler,w=p.otherHandler;return p.data.map(function(D,N){var W,$=Qo(D,v)?m:w;return(W=$==null?void 0:$(D,N))!==null&&W!==void 0?W:D})},Cp=function(){return{id:ya("point"),isHover:!1,isActive:!1,isDrag:!1,createTime:Date.now()}},Ft=function(){return{id:ya("line"),isHover:!1,isActive:!1,isDrag:!1,isDraw:!1,createTime:Date.now()}},Xr=function(){return{id:ya("polygon"),isHover:!1,isActive:!1,isDrag:!1,isDraw:!1,createTime:Date.now()}},Mr=function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return al(p,mn(mn({},Cp()),v))},Bi=function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return{type:"Feature",properties:mn(mn({},Ft()),{},{nodes:p},v),geometry:{type:"LineString",coordinates:sl(Ks(p))}}},Ma=function(p){return ou(p,{id:ya("dashLine")})},el=function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return{type:"Feature",properties:mn(mn({},Xr()),{},{nodes:p},v),geometry:{type:"Polygon",coordinates:[sl(Ks([].concat(Os(p),[go(p)])))]}}},st=function(p){return p.forEach(function(v){v.bbox=cc(v)}),p},Et=function(p){return p.map(function(v,m){if(v.geometry.type.startsWith("Multi")){var w=v.geometry.type.replace("Multi","");return v.geometry.coordinates.map(function(D){return{type:"Feature",properties:mn(mn({},v.properties),{},{multiIndex:m}),geometry:{type:w,coordinates:D}}})}return v}).flat()},Vt=function(p){var v=[],m={};return p.forEach(function(w){var D,N=(D=w.properties)===null||D===void 0?void 0:D.multiIndex;if(typeof N=="number"){var W=m[N];if(W)W.geometry.coordinates.push(w.geometry.coordinates);else{var $="Multi".concat(w.geometry.type),ie={type:"Feature",properties:mn({},w.properties),geometry:{type:$,coordinates:[w.geometry.coordinates]}};m[N]=ie,v.push(ie)}}else v.push(w)}),v},Br=function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6;return Math.round(p*Math.pow(10,v))/Math.pow(10,v)},Ir=function(p){return function(v,m,w){w===void 0&&(w={});for(var D=vu(v).coordinates,N=0,W=0;D.length>W&&(N>m||W!==D.length-1);W++){if(N>=m){var $=m-N;if($){var ie=Gc(D[W],D[W-1])-180;return nh(D[W],$,ie,w)}return al(D[W])}N+=yu(D[W],D[W+1],w)}return al(D[D.length-1])}(p,Eu(p,{units:"meters"})/2,{units:"meters"})},Jt=function(p,v){var m=v.format,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=[];if(v.showTotalDistance){var N=Ir(p),W=Eu(p,{units:"meters"}),$=sl(p).map(function(mt){return al(mt)});N.properties=mn({id:ya("text"),isActive:!1,meters:W,text:m(W,$),type:"totalDistance"},w),D.push(N)}else for(var ie=p.geometry.coordinates,pe=0;ie.length-1>pe;pe++){var we=al(ie[pe]),ke=al(ie[pe+1]),Ge=yu(we,ke,{units:"meters"}),ht=ih(Ks([we,ke]));ht.properties=mn({id:ya("text"),isActive:!1,meters:Ge,text:m(Ge,[we,ke]),type:"distance"},w),D.push(ht)}return D},sr=function(p,v){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},w=v.format,D=wh(p);return cs(p,{properties:mn({meters:D,text:w(D,p),type:"area",isActive:!1},m)})},lr=function(p){var v,m,w,D,N,W,$=p.getContainer();return(v=(m=(w=(D=(N=(W=$==null?void 0:$.querySelector(".l7-marker-container"))!==null&&W!==void 0?W:$==null?void 0:$.querySelector(".BMap_mask"))!==null&&N!==void 0?N:p.getMapCanvasContainer())!==null&&D!==void 0?D:$==null?void 0:$.querySelector(".l7-scene"))!==null&&w!==void 0?w:$==null?void 0:$.querySelector(".l7-control-container"))!==null&&m!==void 0?m:$==null?void 0:$.querySelector(".l7-marker-container2"))!==null&&v!==void 0?v:null},Mt=function(p){return p.lngLat||p.lnglat},Xt=function(p){var v=Mt(p);return[v.lng,v.lat]},pt=function(p){return[p.lng,p.lat]},$t=function(p){for(var v=Number.MAX_SAFE_INTEGER,m=0,w=p.length,D=0;w>D;D++)v>p[D]&&(v=p[D],m=D);return m},zr=function(p,v){var m=[],w=[];return p.forEach(function(D){xi(D,v)?w.length&&(m.push(w),w=[]):w.push(D)}),w.length&&m.push(w),m},$r=function(p,v,m,w){var D=[];D=v.map(function(ht){var mt,St,xt=(mt=ht.properties)===null||mt===void 0?void 0:mt.line;return!((St=ht.properties)===null||St===void 0)&&St.isActive&&xt?zr(xt.properties.nodes.map(function(bt){return bt.geometry.coordinates}),p).filter(function(bt){return bt.length>1}).map(function(bt){return ou(bt)}):[xt]}).flat().filter(function(ht){return ht}),D.length||v.forEach(function(ht){var mt=xh(ht);if(/linestring/i.test(mt)&&D.push(ht),/polygon/i.test(mt)){var St,xt,bt=lh(ht);return(St=D).push.apply(St,Os((xt=bt==null?void 0:bt.features)!==null&&xt!==void 0?xt:[bt]))}});var N=m.lineAdsorbPixel,W=bs(p,2),$=w.lngLatToPixel([W[0],W[1]]),ie=$.x,pe=$.y,we=D.filter(function(ht){return sl(ht).length>1}).map(function(ht){return function(mt,St,xt){xt===void 0&&(xt={});var bt=al([1/0,1/0],{dist:1/0}),kt=0;return fp(mt,function(ft){for(var nr=th(ft),br=0;nr.length-1>br;br++){var Pr=al(nr[br]);Pr.properties.dist=yu(St,Pr,xt);var Mn=al(nr[br+1]);Mn.properties.dist=yu(St,Mn,xt);var yn=yu(Pr,Mn,xt),kr=Math.max(Pr.properties.dist,Mn.properties.dist),Ai=Gc(Pr,Mn),$n=nh(St,kr,Ai+90,xt),ti=nh(St,kr,Ai-90,xt),ri=Jp(ou([$n.geometry.coordinates,ti.geometry.coordinates]),ou([Pr.geometry.coordinates,Mn.geometry.coordinates])),hn=null;ri.features.length>0&&((hn=ri.features[0]).properties.dist=yu(St,hn,xt),hn.properties.location=kt+yu(Pr,hn,xt)),bt.properties.dist>Pr.properties.dist&&((bt=Pr).properties.index=br,bt.properties.location=kt),bt.properties.dist>Mn.properties.dist&&((bt=Mn).properties.index=br+1,bt.properties.location=kt+yn),hn&&bt.properties.dist>hn.properties.dist&&((bt=hn).properties.index=br),kt+=yn}}),bt}(ht,p)});if(!we.length)return null;var ke=we.map(function(ht){var mt=bs(ht.geometry.coordinates,2),St=w.lngLatToPixel([mt[0],mt[1]]),xt=St.y;return Math.pow(ie-St.x,2)+Math.pow(pe-xt,2)}),Ge=$t(ke);return Math.pow(ke[Ge],.5)>N?null:we[Ge].geometry.coordinates},Tn=function(p,v,m){var w,D=bs((w=p.bbox)!==null&&w!==void 0?w:st([p])[0].bbox,4),N=D[2],W=D[3],$=v.lngLatToContainer([D[0],D[1]]),ie=$.x,pe=$.y,we=v.lngLatToContainer([N,W]),ke=we.x,Ge=we.y,ht=v.containerToLngLat([ie-m,pe+m]),mt=ht.lng,St=ht.lat,xt=v.containerToLngLat([ke+m,Ge-m]),bt=xt.lng,kt=xt.lat;return[Math.min(mt,bt),Math.min(St,kt),Math.max(mt,bt),Math.max(St,kt)]},vn=function(p,v){var m=bs(v,4),w=m[0],D=m[1],N=m[2],W=m[3],$=bs(p,2),ie=$[0],pe=$[1];return!(w>ie||ie>N||D>pe||pe>W)},_n=function(p){var v=p.adsorbOptions,m=p.draw,w=p.position,D=p.scene,N=v.data,W=v.pointAdsorbPixel,$=v.lineAdsorbPixel,ie=[];if(ie=N==="allDrawData"?Fl.instances.map(function(ke){return ke.getData(!0)}).flat():N==="drawData"?m.getData(!0):N instanceof Function?N(w):N,ie=ie.filter(function(ke){var Ge;if(!((Ge=ke.properties)===null||Ge===void 0)&&Ge.isActive)return!0;var ht=Tn(ke,D,W);if(vn(w,ht))return!0;var mt=Tn(ke,D,$);return!!vn(w,mt)}),v.pointAdsorbPixel>0){var pe=function(ke,Ge,ht,mt){var St=ht.pointAdsorbPixel,xt=[];Ge.length&&(xt=Ge.map(function(Mn){var yn,kr=(yn=Mn.properties)!==null&&yn!==void 0?yn:{},Ai=kr.nodes,$n=Ai===void 0?[]:Ai,ti=kr.isActive;return ti!==void 0&&ti?$n.filter(function(ri){return!xi(ri.geometry.coordinates,ke)}):$n}).flat().filter(function(Mn){return Mn})),xt.length||(xt=sl(Ks(Ge)).map(function(Mn){return al(Mn)})),xt=xt.filter(function(Mn){var yn=Tn(Mn,mt,St);return vn(ke,yn)});var bt=bs(ke,2),kt=mt.lngLatToPixel([bt[0],bt[1]]),ft=kt.x,nr=kt.y,br=xt.map(function(Mn){var yn=bs(Mn.geometry.coordinates,2),kr=mt.lngLatToPixel([yn[0],yn[1]]),Ai=kr.y;return Math.pow(ft-kr.x,2)+Math.pow(nr-Ai,2)}),Pr=$t(br);return Math.pow(br[Pr],.5)>St?null:xt[Pr].geometry.coordinates}(w,ie,v,D);if(pe)return pe}if(v.lineAdsorbPixel>0){var we=$r(w,ie,v,D);if(we)return we}return w},Qn=function(p,v){var m=bs(v,2),w=m[0],D=m[1];p.lngLat&&(p.lngLat={lng:w,lat:D}),p.lnglat&&(p.lnglat={lng:w,lat:D})},Fi=function(){function p(v,m){Ia(this,p),this.container=void 0,this.cursor=null,this.options=void 0,this.container=lr(v),this.options=m}return Sl(p,[{key:"setCursor",value:function(v){v!==this.cursor&&this.container&&(this.container.style.cursor=v?this.options[v]:"",this.cursor=v)}},{key:"destroy",value:function(){this.setCursor(null)}}]),p}();function Vr(p,v){v===void 0&&(v={});var m=v.insertAt;if(p&&typeof document!="undefined"){var w=document.head||document.getElementsByTagName("head")[0],D=document.createElement("style");D.type="text/css",m==="top"&&w.firstChild?w.insertBefore(D,w.firstChild):w.appendChild(D),D.styleSheet?D.styleSheet.cssText=p:D.appendChild(document.createTextNode(p))}}Vr('.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}'),Vr(".tippy-box[data-theme~=light]{color:#26323d;box-shadow:0 0 20px 4px rgba(154,161,177,.15),0 4px 80px -8px rgba(36,40,47,.25),0 4px 4px -2px rgba(91,94,105,.15);background-color:#fff}.tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff}.tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff}.tippy-box[data-theme~=light]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light]>.tippy-svg-arrow{fill:#fff}");var po=function(){function p(v,m){var w=this;Ia(this,p),this.content="",this.tippy=void 0,this.scene=void 0,this.isMouseInner=!1,this.onMouseMove=function(){w.isMouseInner=!0,w.checkTippyShow()},this.onMouseOut=function(){w.isMouseInner=!1,w.checkTippyShow()},this.setContent=nc(function(N){var W;w.content=N!=null?N:"",(W=w.tippy)===null||W===void 0||W.setContent(N!=null?N:""),w.checkTippyShow()},16,{maxWait:16});var D=lr(v);this.scene=v,D&&(this.tippy=Zo(lr(v),mn(mn({},At),m)),this.tippy.hide(),v.on(ve.SceneEvent.Mousemove,this.onMouseMove),v.on(ve.SceneEvent.Mouseout,this.onMouseOut))}return Sl(p,[{key:"getContent",value:function(){return this.content}},{key:"checkTippyShow",value:function(){var v,m;this.content&&this.isMouseInner?(v=this.tippy)===null||v===void 0||v.show():(m=this.tippy)===null||m===void 0||m.hide()}},{key:"destroy",value:function(){var v;this.scene.off(ve.SceneEvent.Mousemove,this.onMouseMove),this.scene.off(ve.SceneEvent.Mouseout,this.onMouseOut),(v=this.tippy)===null||v===void 0||v.destroy()}}]),p}(),la=function(){function p(v){var m=v.config;Ia(this,p),this.historyList=[],this.historyIndex=0,this.config=void 0,this.config=m}return Sl(p,[{key:"save",value:function(v){if(this.config){var m=this.config.maxSize;this.historyIndex&&(this.historyList=this.historyList.slice(this.historyIndex),this.historyIndex=0),m>this.historyList.length||this.historyList.pop();var w=Fc(v);return this.historyList.unshift(w),w}}},{key:"revert",value:function(){if(this.historyList.length&&this.historyList.length-1>this.historyIndex){var v=this.historyList[++this.historyIndex];return v?Fc(v):void 0}}},{key:"redo",value:function(){if(this.historyList.length&&this.historyIndex>0){var v=this.historyList[--this.historyIndex];return v?Fc(v):void 0}}}]),p}(),Ns=function(p){function v(m){var w,D=m.data,N=m.render,W=m.history,$=m.scene,ie=m.bbox;return Ia(this,v),(w=Dn(this,v)).scene=void 0,w.render=void 0,w.data=Fc(R),w.timeout=null,w.diffData={},w.enableBBox=void 0,w.featureType=void 0,w.history=void 0,w.scene=$,w.render=N,W&&(w.history=new la({config:W})),D&&w.setData(D),w.featureType=N.polygon?"polygon":N.line?"line":"point",w.enableBBox=ie,w}return Aa(v,p),Sl(v,[{key:"saveHistory",value:function(){var m;return(m=this.history)===null||m===void 0?void 0:m.save(this.data)}},{key:"revertHistory",value:function(){var m,w=(m=this.history)===null||m===void 0?void 0:m.revert();if(w)return this.setData(w),w}},{key:"redoHistory",value:function(){var m,w=(m=this.history)===null||m===void 0?void 0:m.redo();if(w)return this.setData(w),w}},{key:"setData",value:function(m){var w,D=this;return Object.keys(m).length&&(this.enableBBox&&(!((w=m[this.featureType])===null||w===void 0)&&w.length)&&(m[this.featureType]=st(m[this.featureType])),this.data=mn(mn({},this.data),m),this.diffData=mn(mn({},this.diffData),m),this.timeout||(this.timeout=requestAnimationFrame(function(){return D.updateDiffData()})),this.emit(ve.SourceEvent.Change,{data:this.data})),this.data}},{key:"getData",value:function(){return this.data}},{key:"getRenderData",value:function(m){return this.data[m]}},{key:"setRenderData",value:function(m,w){var D=typeof w=="function"?w(this.getRenderData(m)):w;return this.setData(Va({},m,D)),this.emit(ve.SourceEvent.Change,this.data),D}},{key:"updateDiffData",value:function(){var m=this,w=Object.entries(this.diffData);w.length&&(w.forEach(function(D){var N,W=bs(D,2),$=W[0],ie=W[1];Array.isArray(ie)&&((N=m.getRender($))===null||N===void 0||N.setData(ie))}),this.emit(ve.SourceEvent.Update,this.data,this.diffData),this.diffData={},this.timeout=null,requestAnimationFrame(function(){m.scene.render()}))}},{key:"getRender",value:function(m){return this.render[m]}},{key:"clear",value:function(){this.setData(Pe(Object.keys(this.render).map(function(m){return[m,[]]})))}}]),v}(su),Fl=function(p){function v(m,w){var D,N;Ia(this,v),(N=Dn(this,v)).scene=void 0,N.source=void 0,N.render=void 0,N.cursor=void 0,N.options=void 0,N.enabled=!1,N.allowCreate=!1,N.sceneRender=void 0,N.mouseLngLat={lng:0,lat:0},N.popup=void 0,N.addCount=0,N.saveMouseLngLat=nc(function(pe){N.mouseLngLat=Mt(pe)},100,{maxWait:100}),N.saveHistory=nc(function(){N.options.history&&N.source.saveHistory()},100),N.bindThis(),N.scene=m,N.sceneRender=new s(m),N.options=ru({},N.getDefaultOptions(w),w),N.render=N.initRender(),N.source=new Ns({render:N.render,history:N.options.history||void 0,scene:m,bbox:(D=N.options.bbox)!==null&&D!==void 0&&D}),N.cursor=new Fi(m,N.options.cursor);var W=N.options,$=W.initialData,ie=W.popup;return $&&N.setData($),ie&&(N.popup=new po(m,ie instanceof Object?ie:{})),N.saveHistory(),N.bindCommonEvent(),N.emit(ve.DrawEvent.Init,Ku(N)),N.bindEnableEvent(),v.instances.push(Ku(N)),N}return Aa(v,p),Sl(v,[{key:"addable",get:function(){var m=this.getData(),w=this.options,D=w.multiple,N=w.maxCount,W=m.find(function($){var ie;return(ie=$.properties)===null||ie===void 0?void 0:ie.isDraw});return!(!this.enabled||!this.allowCreate)&&(!!(D&&0>=N||W)||!(!D&&this.addCount>=1)&&(0>=N||N>m.length))}},{key:"getOptions",value:function(){return this.options}},{key:"getEditItem",value:function(){return this.editItem}},{key:"getDragItem",value:function(){return this.dragItem}},{key:"setHelper",value:function(m){var w,D,N=this.options.helper;if(N){var W=(w=m in N?N[m]:m)!==null&&w!==void 0?w:null;(D=this.popup)===null||D===void 0||D.setContent(W)}}},{key:"isEnable",value:function(){return this.enabled}},{key:"bindThis",value:function(){this.initRender=this.initRender.bind(this),this.getData=this.getData.bind(this),this.setData=this.setData.bind(this),this.emitChangeEvent=this.emitChangeEvent.bind(this),this.saveHistory=this.saveHistory.bind(this),this.onSceneMouseMove=this.onSceneMouseMove.bind(this),this.revertHistory=this.revertHistory.bind(this),this.redoHistory=this.redoHistory.bind(this),this.removeActiveFeature=this.removeActiveFeature.bind(this),this.bindCommonEvent=this.bindCommonEvent.bind(this),this.bindEnableEvent=this.bindEnableEvent.bind(this),this.unbindEnableEvent=this.unbindEnableEvent.bind(this),this.setActiveFeature=this.setActiveFeature.bind(this)}},{key:"bindCommonEvent",value:function(){var m=this;this.on(ve.DrawEvent.Add,this.emitChangeEvent),this.on(ve.DrawEvent.Add,function(){m.addCount++}),this.on(ve.DrawEvent.Edit,this.emitChangeEvent),this.on(ve.DrawEvent.Remove,this.emitChangeEvent),this.on(ve.DrawEvent.Clear,this.emitChangeEvent),this.on(ve.DrawEvent.AddNode,this.saveHistory),this.on(ve.DrawEvent.RemoveNode,this.emitChangeEvent),this.bindEmitSelectEvent(!0)}},{key:"bindEmitSelectEvent",value:function(){var m=this,w=arguments.length>0&&arguments[0]!==void 0&&arguments[0],D=null,N=function(){var W,$,ie,pe=m.getData(!0).find(function(we){var ke;return(ke=we.properties)===null||ke===void 0?void 0:ke.isActive})||null;((W=D)===null||W===void 0||($=W.properties)===null||$===void 0?void 0:$.id)!==(pe==null||(ie=pe.properties)===null||ie===void 0?void 0:ie.id)&&(D=pe,m.emit(ve.DrawEvent.Select,pe))};this.source.on(ve.SourceEvent.Change,N),w&&N()}},{key:"bindEnableEvent",value:function(){this.unbindKeyboardEvent(),this.scene.setMapStatus({doubleClickZoom:!1}),this.scene.on(ve.SceneEvent.Mousemove,this.saveMouseLngLat),this.bindKeyboardEvent()}},{key:"unbindEnableEvent",value:function(){this.scene.setMapStatus({doubleClickZoom:!0}),this.scene.off(ve.SceneEvent.Mousemove,this.saveMouseLngLat),this.unbindKeyboardEvent()}},{key:"bindKeyboardEvent",value:function(){var m=this,w=this.options.keyboard||{},D=w.revert,N=w.redo,W=w.remove;W&&mu.bind(W,function(){m.removeActiveFeature()}),this.options.history&&(D&&mu.bind(D,this.revertHistory),N&&mu.bind(N,this.redoHistory))}},{key:"unbindKeyboardEvent",value:function(){var m=this.options.keyboard||{},w=m.revert,D=m.redo,N=m.remove;N&&mu.unbind(N),this.options.history&&(w&&mu.unbind(w),D&&mu.unbind(D))}},{key:"emitChangeEvent",value:function(){this.emit(ve.DrawEvent.Change,this.getData()),this.saveHistory()}},{key:"revertHistory",value:function(){this.enabled&&this.options.history&&this.source.revertHistory()&&(this.correctDrawItem(),this.emit(ve.DrawEvent.Change,this.getData()))}},{key:"redoHistory",value:function(){this.enabled&&this.options.history&&this.source.redoHistory()&&(this.correctDrawItem(),this.emit(ve.DrawEvent.Change,this.getData()))}},{key:"getRenderLayers",value:function(){return Pe(Ca(this.render).map(function(m){var w=bs(m,2);return[w[0],w[1].getLayers()]}))}},{key:"getTargetFeature",value:function(m){var w,D,N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getData(!0),W=null;return m&&(W=(w=N.find(function($){var ie,pe;return((ie=$.properties)===null||ie===void 0?void 0:ie.id)===(typeof m=="string"?m:(pe=m.properties)===null||pe===void 0?void 0:pe.id)}))!==null&&w!==void 0?w:null,!W&&m instanceof Object&&(W=(D=N.find(function($){return xi(m.geometry,$.geometry)}))!==null&&D!==void 0?D:null)),W}},{key:"removeActiveFeature",value:function(){var m=this.getData(!0).find(function(w){var D,N=(D=w.properties)!==null&&D!==void 0?D:{};return N.isActive||N.isDraw});return m&&this.removeFeature(m),m}},{key:"removeFeature",value:function(m){var w=this.getData(!0),D=this.getTargetFeature(m);D&&(this.setData(w.filter(function(N){return!Qo(D,N)})),this.emit(ve.DrawEvent.Remove,m,this.getData()))}},{key:"correctDrawItem",value:function(){this.getData(!0).find(function(m){var w;return(w=m.properties)===null||w===void 0?void 0:w.isDraw})&&this.onSceneMouseMove({type:"mousemove",lnglat:this.mouseLngLat,lngLat:this.mouseLngLat})}},{key:"initRender",value:function(){var m,w={},D=function(W,$){var ie=typeof Symbol!="undefined"&&W[Symbol.iterator]||W["@@iterator"];if(!ie){if(Array.isArray(W)||(ie=Nl(W))||$&&W&&typeof W.length=="number"){ie&&(W=ie);var pe=0,we=function(){};return{s:we,n:function(){return W.length>pe?{done:!1,value:W[pe++]}:{done:!0}},e:function(mt){throw mt},f:we}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ke,Ge=!0,ht=!1;return{s:function(){ie=ie.call(W)},n:function(){var mt=ie.next();return Ge=mt.done,mt},e:function(mt){ht=!0,ke=mt},f:function(){try{Ge||ie.return==null||ie.return()}finally{if(ht)throw ke}}}}(this.getRenderTypes());try{for(D.s();!(m=D.n()).done;){var N=m.value;w[N]=new I[N](this.scene,{style:this.options.style[N]})}}catch(W){D.e(W)}finally{D.f()}return w}},{key:"getCommonOptions",value:function(m){return{initialData:[],autoActive:!0,cursor:Fc(M),editable:!0,style:Fc(b),multiple:!0,history:Fc(Wl),keyboard:Fc(ut),popup:!0,helper:{},maxCount:-1}}},{key:"setCursor",value:function(m){this.cursor.setCursor(m)}},{key:"resetCursor",value:function(){this.setCursor(this.addable?"draw":null)}},{key:"enable",value:function(){var m=this;this.allowCreate=0>=arguments.length||arguments[0]===void 0||arguments[0],this.addCount=0,this.enabled=!0,this.bindEnableEvent(),this.resetCursor(),this.setHelper(this.addable?"draw":null),setTimeout(function(){m.emit(ve.DrawEvent.Enable,m)},0)}},{key:"disable",value:function(){var m=this;this.resetFeatures(),this.enabled=!1,this.setCursor(null),this.unbindEnableEvent(),this.addCount=0,this.setHelper(null),setTimeout(function(){m.emit(ve.DrawEvent.Disable,m)},0)}},{key:"clear",value:function(){var m=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this.source.clear(),this.emit(ve.DrawEvent.Clear,this),m&&this.disable()}},{key:"show",value:function(){return Object.values(this.render).forEach(function(m){m.show()})}},{key:"hide",value:function(){return Object.values(this.render).forEach(function(m){m.hide()})}},{key:"destroy",value:function(){var m,w=this;Object.values(this.render).forEach(function(N){N.destroy()}),Object.values(ve.RenderEvent).forEach(function(N){Object.values(w.render).forEach(function(W){W.removeAllListeners(N)}),w.sceneRender.removeAllListeners(N)}),setTimeout(function(){Object.values(ve.DrawEvent).forEach(function(N){w.removeAllListeners(N)})},0),(m=this.popup)===null||m===void 0||m.destroy(),this.cursor.destroy(),this.emit(ve.DrawEvent.Destroy,this);var D=v.instances.indexOf(this);D>-1&&v.instances.splice(D,1)}}]),v}(su);Fl.instances=[];var ic=function(p){var v=p==null?0:p.length;return v?p[v-1]:void 0},ed=function(p){function v(){return Ia(this,v),Dn(this,v,arguments)}return Aa(v,p),Sl(v,[{key:"pointRender",get:function(){return this.render.point}},{key:"dragPoint",get:function(){return this.getPointData().find(function(m){return m.properties.isDrag})}},{key:"editPoint",get:function(){return this.getPointData().find(function(m){return m.properties.isActive})}},{key:"hoverPoint",get:function(){return this.getPointData().find(function(m){return m.properties.isHover})}},{key:"getDragPoint",value:function(){return this.dragPoint}},{key:"getEditPoint",value:function(){return this.editPoint}},{key:"getPointData",value:function(){return this.source.getRenderData("point")}},{key:"setPointData",value:function(m){return this.source.setRenderData("point",m)}},{key:"bindPointRenderEvent",value:function(){var m,w,D,N,W,$;(m=this.pointRender)===null||m===void 0||m.on(ve.RenderEvent.UnClick,this.onPointCreate.bind(this)),(w=this.pointRender)===null||w===void 0||w.on(ve.RenderEvent.Mousemove,this.onPointMouseMove.bind(this)),(D=this.pointRender)===null||D===void 0||D.on(ve.RenderEvent.Mouseout,this.onPointMouseOut.bind(this)),(N=this.pointRender)===null||N===void 0||N.on(ve.RenderEvent.Dragstart,this.onPointDragStart.bind(this)),(W=this.pointRender)===null||W===void 0||W.on(ve.RenderEvent.Dragging,this.onPointDragging.bind(this)),($=this.pointRender)===null||$===void 0||$.on(ve.RenderEvent.Dragend,this.onPointDragEnd.bind(this))}},{key:"handleCreatePoint",value:function(m){var w=this.options,D=w.autoActive,N=w.editable,W=Mr(m);return this.setPointData(function($){return Qs({target:W,data:[].concat(Os($),[W]),targetHandler:function(ie){ie.properties=mn(mn({},ie.properties),{},{isHover:N,isActive:D&&N})},otherHandler:function(ie){ie.properties=mn(mn({},ie.properties),{},{isHover:!1,isActive:!1,isDrag:!1})}})}),W}},{key:"handlePointHover",value:function(m){return this.setCursor("pointHover"),Qo(m,this.hoverPoint)||this.setPointData(function(w){return Qs({target:m,data:w,targetHandler:function(D){D.properties.isHover=!0},otherHandler:function(D){D.properties.isHover=!1}})}),m}},{key:"handlePointUnHover",value:function(m){return this.resetCursor(),this.setPointData(function(w){return w.map(function(D){return D.properties.isHover=!1,D})}),m}},{key:"handlePointDragStart",value:function(m){return this.setPointData(function(w){return Qs({target:m,data:w,targetHandler:function(D){D.properties=mn(mn({},D.properties),{},{isDrag:!0,isActive:!0})},otherHandler:function(D){D.properties=mn(mn({},D.properties),{},{isDrag:!1,isActive:!1})}})}),this.scene.setMapStatus({dragEnable:!1}),this.setCursor("pointDrag"),m}},{key:"handlePointDragging",value:function(m,w){return this.setPointData(function(D){return Qs({target:m,data:D,targetHandler:function(N){N.geometry.coordinates=pt(w)}})}),this.scene.setMapStatus({dragEnable:!1}),this.setCursor("pointDrag"),m}},{key:"handlePointDragEnd",value:function(m){return this.setPointData(function(w){return Qs({target:m,data:w,targetHandler:function(D){D.properties.isDrag=!1}})}),this.scene.setMapStatus({dragEnable:!0}),this.setCursor("pointHover"),m}},{key:"onPointCreate",value:function(m){return this.handleCreatePoint(pt(Mt(m)))}},{key:"onPointMouseMove",value:function(m){return this.handlePointHover(m.feature)}},{key:"onPointMouseOut",value:function(m){return this.handlePointUnHover(m.feature)}},{key:"onPointDragStart",value:function(m){if(this.options.editable)return this.handlePointDragStart(m.feature)}},{key:"onPointDragging",value:function(m){var w=this.dragPoint;if(this.options.editable&&w)return this.handlePointDragging(w,Mt(m))}},{key:"onPointDragEnd",value:function(m){var w=this.dragPoint;if(this.options.editable&&w)return this.handlePointDragEnd(w)}},{key:"enablePointRenderAction",value:function(){var m,w,D,N,W=this.options.editable;this.enabled&&((w=this.pointRender)===null||w===void 0||w.enableCreate()),(m=this.pointRender)===null||m===void 0||m.enableClick(),W&&((D=this.pointRender)===null||D===void 0||D.enableHover(),(N=this.pointRender)===null||N===void 0||N.enableDrag())}},{key:"disablePointRenderAction",value:function(){var m,w,D,N;(m=this.pointRender)===null||m===void 0||m.disableCreate(),(w=this.pointRender)===null||w===void 0||w.disableHover(),(D=this.pointRender)===null||D===void 0||D.disableDrag(),(N=this.pointRender)===null||N===void 0||N.disableClick()}}]),v}(Fl),Ch=function(p){function v(){return Ia(this,v),Dn(this,v,arguments)}return Aa(v,p),Sl(v,[{key:"midPointRender",get:function(){return this.render.midPoint}},{key:"getCommonOptions",value:function(m){return mn(mn({},lo(Ni(v.prototype),"getCommonOptions",this).call(this,m)),{},{showMidPoint:!0})}},{key:"bindMidPointRenderEvent",value:function(){var m,w,D;(m=this.midPointRender)===null||m===void 0||m.on(ve.RenderEvent.Click,this.onMidPointClick.bind(this)),(w=this.midPointRender)===null||w===void 0||w.on(ve.RenderEvent.Mousemove,this.onMidPointHover.bind(this)),(D=this.midPointRender)===null||D===void 0||D.on(ve.RenderEvent.Mouseout,this.onMidPointUnHover.bind(this))}},{key:"getMidPointData",value:function(){return this.source.getRenderData("midPoint")}},{key:"setMidPointData",value:function(m){return this.source.setRenderData("midPoint",m)}},{key:"getMidPointsByLine",value:function(m){var w=m.properties.nodes;if(!this.options.showMidPoint||2>w.length)return[];for(var D=[],N=0;w.length-1>N;N++){var W,$,ie,pe,we=ih(Ks([w[N],w[N+1]]),{properties:{id:ya("midPoint"),startId:(W=($=w[N].properties)===null||$===void 0?void 0:$.id)!==null&&W!==void 0?W:"",endId:(ie=(pe=w[N+1].properties)===null||pe===void 0?void 0:pe.id)!==null&&ie!==void 0?ie:""}});D.push(we)}return D}},{key:"onMidPointHover",value:function(m){this.setCursor("pointHover")}},{key:"onMidPointUnHover",value:function(m){this.resetCursor()}},{key:"enableMidPointRenderAction",value:function(){var m,w;(m=this.midPointRender)===null||m===void 0||m.enableClick(),(w=this.midPointRender)===null||w===void 0||w.enableHover()}},{key:"disableMidPointRenderAction",value:function(){var m,w;(m=this.midPointRender)===null||m===void 0||m.disableClick(),(w=this.midPointRender)===null||w===void 0||w.disableHover()}}]),v}(ed),Sd=function(p){function v(){var m;Ia(this,v);for(var w=arguments.length,D=Array(w),N=0;w>N;N++)D[N]=arguments[N];return(m=Dn(this,v,[].concat(D))).prevCreateTime=Date.now(),m.previousPosition=[0,0],m}return Aa(v,p),Sl(v,[{key:"isDragTrigger",get:function(){return this.options.trigger==="drag"}},{key:"isClickTrigger",get:function(){return this.options.trigger==="click"}},{key:"editLine",get:function(){return this.getLineData().find(function(m){var w=m.properties;return!w.isDraw&&w.isActive})}},{key:"lineRender",get:function(){return this.render.line}},{key:"dragLine",get:function(){return this.getLineData().find(function(m){return m.properties.isDrag})}},{key:"drawLine",get:function(){return this.getLineData().find(function(m){return m.properties.isDraw})}},{key:"hoverLine",get:function(){return this.getLineData().find(function(m){return m.properties.isHover})}},{key:"getDragLine",value:function(){return this.dragLine}},{key:"getDrawLine",value:function(){return this.drawLine}},{key:"getEditLine",value:function(){return this.editLine}},{key:"getDefaultOptions",value:function(m){var w=mn(mn({},this.getCommonOptions(m)),{},{showMidPoint:!0,distanceOptions:!1,helper:Fc(G),dragOptions:Fc(jr)});return m.distanceOptions&&(w.distanceOptions=mn(mn({},Qa),w.distanceOptions)),m.adsorbOptions&&(w.adsorbOptions=mn(mn({},ir),w.adsorbOptions),w.bbox=!0),m.trigger==="drag"&&(w.autoActive=!1,w.helper=mn(mn({},w.helper),fe)),w}},{key:"getAdsorbPosition",value:function(m){var w=this.options.adsorbOptions;return typeof w=="boolean"?m:_n({adsorbOptions:w,position:m,scene:this.scene,draw:this})}},{key:"bindSceneEvent",value:function(){this.sceneRender.on(ve.RenderEvent.Mousemove,this.onSceneMouseMove.bind(this))}},{key:"bindPointRenderEvent",value:function(){var m;lo(Ni(v.prototype),"bindPointRenderEvent",this).call(this),(m=this.pointRender)===null||m===void 0||m.on(ve.RenderEvent.Click,this.onPointClick.bind(this))}},{key:"bindLineRenderEvent",value:function(){var m,w,D,N,W,$;(m=this.lineRender)===null||m===void 0||m.on(ve.RenderEvent.UnClick,this.onLineUnClick.bind(this)),(w=this.lineRender)===null||w===void 0||w.on(ve.RenderEvent.Mousemove,this.onLineMouseMove.bind(this)),(D=this.lineRender)===null||D===void 0||D.on(ve.RenderEvent.Mouseout,this.onLineMouseOut.bind(this)),(N=this.lineRender)===null||N===void 0||N.on(ve.RenderEvent.Dragstart,this.onLineDragStart.bind(this)),(W=this.lineRender)===null||W===void 0||W.on(ve.RenderEvent.Dragging,this.onLineDragging.bind(this)),($=this.lineRender)===null||$===void 0||$.on(ve.RenderEvent.Dragend,this.onLineDragEnd.bind(this))}},{key:"getDashLineDistanceTexts",value:function(m,w){var D=w.showTotalDistance,N=w.format;return w.showDashDistance?m.map(function(W){return Jt(W,{showTotalDistance:D,format:N},{isActive:!0,type:"dash"})}).flat():[]}},{key:"getLineDistanceTexts",value:function(m,w){var D=w.showTotalDistance,N=w.format,W=w.showWhen,$=[];if(W.includes("active")){var ie=m.filter(function(we){return we.properties.isActive&&we.properties.nodes.length>1});$.push.apply($,Os(ie.map(function(we){return Jt(we,{showTotalDistance:D,format:N},{isActive:!0})}).flat()))}if(W.includes("normal")){var pe=m.filter(function(we){return!we.properties.isActive&&we.properties.nodes.length>1});$.push.apply($,Os(pe.map(function(we){return Jt(we,{showTotalDistance:D,format:N})}).flat()))}return $}},{key:"getDistanceTexts",value:function(){var m=this.options.distanceOptions;if(!m)return[];var w=[],D=m.showWhen,N=m.showDashDistance,W=m.format,$=m.showTotalDistance;return w.push.apply(w,Os(this.getDashLineDistanceTexts(this.getDashLineData(),{showTotalDistance:!1,format:W,showDashDistance:N})).concat(Os(this.getLineDistanceTexts(this.getLineData(),{showTotalDistance:$,format:W,showWhen:D})))),w}},{key:"getAllTexts",value:function(){return this.getDistanceTexts()}},{key:"handleCreateLine",value:function(m){var w=Bi([m],{isActive:!0,isDraw:!0});return this.setLineData(function(D){return Qs({target:w,data:[].concat(Os(D),[w]),otherHandler:function(N){N.properties.isActive=!1}})}),this.setPointData([m]),this.setTextData(this.getAllTexts()),w}},{key:"syncLineNodes",value:function(m,w){return m.properties.nodes=w,m.geometry.coordinates=sl(Ks(w)),this.setLineData(function(D){return D.map(function(N){return Qo(N,m)?m:N})}),Qo(this.editLine,m)&&this.setMidPointData(this.getMidPointsByLine(m)),this.setPointData(m.properties.nodes),this.setTextData(this.getAllTexts()),m}},{key:"setActiveLine",value:function(m){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.setLineData(function(D){return Qs({target:m,data:D,targetHandler:function(N){N.properties=mn(mn({},N.properties),{},{isDraw:!1,isActive:!0,isDrag:!1,isHover:!1},w)},otherHandler:function(N){N.properties=mn(mn({},N.properties),{},{isDraw:!1,isActive:!1,isDrag:!1})}})}),this.setPointData(m.properties.nodes.map(function(D){return D.properties=mn(mn({},D.properties),{},{isHover:!1,isActive:!1}),D})),this.setMidPointData(this.getMidPointsByLine(m)),this.setDashLineData([]),this.setTextData(this.getAllTexts()),m}},{key:"clearActiveLine",value:function(){this.source.setData({point:[],line:this.getLineData().map(function(m){return m.properties=mn(mn({},m.properties),{},{isDrag:!1,isActive:!1,isHover:!1}),m}),midPoint:[],text:this.getAllTexts()})}},{key:"handleLineUnClick",value:function(m){return this.clearActiveLine(),m}},{key:"handleLineHover",value:function(m){if(!this.drawLine)return this.setCursor("lineHover"),Qo(m,this.hoverLine)||this.setLineData(function(w){return Qs({target:m,data:w,targetHandler:function(D){D.properties.isHover=!0},otherHandler:function(D){D.properties.isHover=!1}})}),m}},{key:"handleLineUnHover",value:function(m){if(!this.drawLine)return this.resetCursor(),this.setLineData(function(w){return w.map(function(D){return D.properties.isHover=!1,D})}),m}},{key:"handleLineDragStart",value:function(m){return this.setActiveLine(m,{isDrag:!0,isActive:!0}),this.scene.setMapStatus({dragEnable:!1}),this.setCursor("lineDrag"),m}},{key:"handleLineDragging",value:function(m,w){var D=w.lng,N=w.lat,W=m.properties.nodes,$=bs(this.previousPosition,2),ie=$[0],pe=$[1];return W.forEach(function(we){var ke=we.geometry.coordinates;we.geometry.coordinates=[Br(ke[0]+D-ie),Br(ke[1]+N-pe)]}),this.syncLineNodes(m,W),this.setActiveLine(m,{isDrag:!0}),this.setCursor("lineDrag"),this.previousPosition=[D,N],m}},{key:"handleLineDragEnd",value:function(m){return m.properties.isDrag=!1,this.setLineData(function(w){return w}),this.scene.setMapStatus({dragEnable:!0}),m}},{key:"resetAdsorbLngLat",value:function(m){if(this.options.adsorbOptions){var w=this.getAdsorbPosition(pt(Mt(m)));return w&&Qn(m,w),w}}},{key:"onPointCreate",value:function(m){if(!this.editLine){this.resetAdsorbLngLat(m);var w=lo(Ni(v.prototype),"onPointCreate",this).call(this,m),D=this.drawLine;if(w)return D?(this.syncLineNodes(D,[].concat(Os(D.properties.nodes),[w])),this.setDashLineData([])):this.handleCreateLine(w),w}}},{key:"onPointDragStart",value:function(m){if(this.editLine)return this.setHelper("pointDrag"),lo(Ni(v.prototype),"onPointDragStart",this).call(this,m)}},{key:"onPointDragging",value:function(m){var w=lo(Ni(v.prototype),"onPointDragging",this).call(this,m);if(w){var D=this.resetAdsorbLngLat(m);D&&(w.geometry.coordinates=Fc(D))}var N=this.editLine;return N&&w&&(this.syncLineNodes(N,N.properties.nodes.map(function(W){return Qo(w,W)?w:W})),this.setActiveLine(N)),w}},{key:"onPointDragEnd",value:function(m){if(this.editLine){var w=lo(Ni(v.prototype),"onPointDragEnd",this).call(this,m);return this.setPointData(function(D){return D.map(function(N){return N.properties.isActive=!1,N})}),this.setHelper("pointHover"),w}}},{key:"onLineUnClick",value:function(m){var w=this.editLine;if(w)return this.handleLineUnClick(w)}},{key:"onLineMouseMove",value:function(m){if(!this.drawLine)return this.dragLine||this.drawLine||!this.options.editable||this.setHelper("lineHover"),this.handleLineHover(m.feature)}},{key:"onLineMouseOut",value:function(m){if(!this.drawLine)return this.dragLine||this.drawLine||this.setHelper(this.addable?"draw":null),this.handleLineUnHover(m.feature)}},{key:"onLineDragStart",value:function(m){if(this.options.editable&&!this.drawLine)return this.previousPosition=Xt(m),this.setHelper("lineDrag"),this.handleLineDragStart(m.feature)}},{key:"onLineDragging",value:function(m){var w=this.dragLine;if(w)return this.handleLineDragging(w,Mt(m))}},{key:"onLineDragEnd",value:function(m){var w=this.dragLine;if(w)return this.setHelper("lineHover"),this.handleLineDragEnd(w)}},{key:"onPointMouseMove",value:function(m){var w=lo(Ni(v.prototype),"onPointMouseMove",this).call(this,m);return this.dragLine||this.drawLine||this.dragPoint||this.setHelper("pointHover"),w}},{key:"onPointMouseOut",value:function(m){var w=lo(Ni(v.prototype),"onPointMouseOut",this).call(this,m);return this.dragLine||this.drawLine||this.dragPoint||this.setHelper(this.addable?"draw":null),w}},{key:"onMidPointHover",value:function(m){lo(Ni(v.prototype),"onMidPointHover",this).call(this,m),this.setHelper("midPointHover")}},{key:"onMidPointUnHover",value:function(m){lo(Ni(v.prototype),"onMidPointUnHover",this).call(this,m),this.setHelper(null)}},{key:"onPointClick",value:function(m){}},{key:"getLineData",value:function(){return this.source.getRenderData("line")}},{key:"setLineData",value:function(m){return this.source.setRenderData("line",m)}},{key:"getTextData",value:function(){return this.source.getRenderData("text")}},{key:"setTextData",value:function(m){return this.source.setRenderData("text",m)}},{key:"getDashLineData",value:function(){return this.source.getRenderData("dashLine")}},{key:"setDashLineData",value:function(m){return this.source.setRenderData("dashLine",m)}},{key:"onMidPointClick",value:function(m){var w=this.editLine,D=m.feature;if(w&&D&&!this.dragPoint){var N=w.properties.nodes,W=D.properties,$=W.startId,ie=W.endId,pe=N.findIndex(function(Ge){return Ge.properties.id===$}),we=N.findIndex(function(Ge){return Ge.properties.id===ie});if(pe>-1&&we>-1){var ke=Mr(D.geometry.coordinates,{isDrag:!0,isHover:!0});return this.setHelper("pointDrag"),N.splice(we,0,ke),w.geometry.coordinates=sl(Ks(N)),this.syncLineNodes(w,N),this.setActiveLine(w),ke}}}},{key:"enableSceneRenderAction",value:function(){this.sceneRender.enableDrag(),this.sceneRender.enableMouseMove(),this.sceneRender.enableDblClick()}},{key:"disableSceneRenderAction",value:function(){this.sceneRender.disableDrag(),this.sceneRender.disableMouseMove(),this.sceneRender.disableDblClick()}},{key:"enableLineRenderAction",value:function(){var m,w,D,N=this.options.editable;(m=this.lineRender)===null||m===void 0||m.enableUnClick(),N&&((w=this.lineRender)===null||w===void 0||w.enableHover(),(D=this.lineRender)===null||D===void 0||D.enableDrag())}},{key:"disableLineRenderAction",value:function(){var m,w,D;(m=this.lineRender)===null||m===void 0||m.disableUnClick(),(w=this.lineRender)===null||w===void 0||w.disableHover(),(D=this.lineRender)===null||D===void 0||D.disableDrag()}},{key:"onSceneDragStart",value:function(m){this.isDragTrigger&&this.addable&&!this.dragPoint&&!this.editLine&&(this.scene.setMapStatus({dragEnable:!1}),this.onPointCreate(m),this.prevCreateTime=Date.now(),this.sceneRender.on(ve.RenderEvent.Dragging,this.onSceneDragging))}},{key:"onSceneDragging",value:function(m){var w=this.drawLine,D=Date.now(),N=mn(mn({},jr),this.options.dragOptions),W=N.dotDistance,$=N.dotDuration;if(this.isDragTrigger&&this.addable&&w&&(!$||D-this.prevCreateTime>=$)){var ie=Mt(m),pe=ie.lng,we=ie.lat,ke=ic(w.properties.nodes).geometry.coordinates,Ge=this.scene.lngLatToPixel([ke[0],ke[1]]),ht=Ge.x,mt=Ge.y,St=this.scene.lngLatToPixel([pe,we]),xt=St.x,bt=St.y;W&&Math.pow(W,2)>=Math.pow(xt-ht,2)+Math.pow(bt-mt,2)||(this.onPointCreate(m),this.prevCreateTime=D)}}},{key:"onSceneDragEnd",value:function(m){}},{key:"bindSceneDragEvent",value:function(){this.unbindSceneDragEvent(),this.sceneRender.on(ve.RenderEvent.Dragstart,this.onSceneDragStart),this.sceneRender.on(ve.RenderEvent.Dragging,this.onSceneDragging),this.sceneRender.on(ve.RenderEvent.Dragend,this.onSceneDragEnd),this.scene.setMapStatus({dragEnable:!1})}},{key:"unbindSceneDragEvent",value:function(){this.sceneRender.off(ve.RenderEvent.Dragstart,this.onSceneDragStart),this.sceneRender.off(ve.RenderEvent.Dragging,this.onSceneDragging),this.sceneRender.off(ve.RenderEvent.Dragend,this.onSceneDragEnd),this.scene.setMapStatus({dragEnable:!0})}},{key:"bindEnableEvent",value:function(){lo(Ni(v.prototype),"bindEnableEvent",this).call(this),this.isDragTrigger&&this.bindSceneDragEvent()}},{key:"unbindEnableEvent",value:function(){lo(Ni(v.prototype),"unbindEnableEvent",this).call(this),this.isDragTrigger&&this.unbindSceneDragEvent()}},{key:"bindThis",value:function(){lo(Ni(v.prototype),"bindThis",this).call(this),this.onSceneDragStart=this.onSceneDragStart.bind(this),this.onSceneDragging=this.onSceneDragging.bind(this),this.onSceneDragEnd=this.onSceneDragEnd.bind(this)}}]),v}(Ch),Up=function(p){function v(){return Ia(this,v),Dn(this,v,arguments)}return Aa(v,p),Sl(v,[{key:"dragItem",get:function(){return this.dragPolygon}},{key:"editItem",get:function(){return this.editPolygon}},{key:"polygonRender",get:function(){return this.render.polygon}},{key:"dragPolygon",get:function(){return this.getPolygonData().find(function(m){return m.properties.isDrag})}},{key:"drawPolygon",get:function(){return this.getPolygonData().find(function(m){return m.properties.isDraw})}},{key:"editPolygon",get:function(){return this.getPolygonData().find(function(m){var w=m.properties;return!w.isDraw&&w.isActive})}},{key:"hoverPolygon",get:function(){return this.getPolygonData().find(function(m){return m.properties.isHover})}},{key:"getDragPolygon",value:function(){return this.dragPolygon}},{key:"getDrawPolygon",value:function(){return this.drawPolygon}},{key:"getEditPolygon",value:function(){return this.editPolygon}},{key:"getRenderTypes",value:function(){return["polygon","line","dashLine","midPoint","point","text"]}},{key:"getData",value:function(){var m=arguments.length>0&&arguments[0]!==void 0&&arguments[0],w=this.getPolygonData();return m?w:Vt(w)}},{key:"getMainLayer",value:function(){var m,w;return(m=(w=this.render.polygon)===null||w===void 0?void 0:w.getLayers())!==null&&m!==void 0?m:[]}},{key:"getDefaultOptions",value:function(m){var w=mn(mn({},lo(Ni(v.prototype),"getDefaultOptions",this).call(this,m)),{},{areaOptions:!1,helper:Fc(q)});return m.areaOptions&&(w.areaOptions=mn(mn({},Gl),m.areaOptions)),w}},{key:"getAreaTexts",value:function(m){var w=this.options.areaOptions;if(!w)return[];var D=w.format,N=w.showWhen,W=[],$=m.filter(function(ie){return ie.geometry.coordinates[0].length>=4});return N.includes("active")&&$.filter(function(ie){return ie.properties.isActive}).forEach(function(ie){W.push(sr(ie,{format:D},{isActive:!0}))}),N.includes("normal")&&$.filter(function(ie){return!ie.properties.isActive}).forEach(function(ie){W.push(sr(ie,{format:D},{isActive:!1}))}),W}},{key:"getAllTexts",value:function(){return[].concat(Os(lo(Ni(v.prototype),"getAllTexts",this).call(this)),Os(this.getAreaTexts(this.getPolygonData())))}},{key:"getPolygonData",value:function(){return this.source.getRenderData("polygon")}},{key:"setPolygonData",value:function(m){return this.source.setRenderData("polygon",m)}},{key:"handleCreatePolygon",value:function(m,w){var D=el(m,{nodes:m,line:w,isActive:!0,isDraw:!0});return this.setPolygonData(function(N){return Qs({target:D,data:[].concat(Os(N),[D]),otherHandler:function(W){W.properties.isActive=!1}})}),D}},{key:"handlePolygonUnClick",value:function(m){return this.clearActivePolygon(),m}},{key:"handlePolygonHover",value:function(m){return this.setCursor("polygonHover"),Qo(m,this.hoverPolygon)||this.setPolygonData(function(w){return Qs({target:m,data:w,targetHandler:function(D){D.properties.isHover=!0},otherHandler:function(D){D.properties.isHover=!1}})}),m}},{key:"handlePolygonUnHover",value:function(){this.resetCursor(),this.setPolygonData(function(m){return m.map(function(w){return w.properties.isHover=!1,w})})}},{key:"handlePolygonDragStart",value:function(m){return this.setActivePolygon(m,{isDrag:!0}),this.scene.setMapStatus({dragEnable:!1}),this.setCursor("polygonDrag"),m}},{key:"bindPolygonRenderEvent",value:function(){var m,w,D,N;(m=this.polygonRender)===null||m===void 0||m.on(ve.RenderEvent.UnClick,this.onPolygonUnClick.bind(this)),(w=this.polygonRender)===null||w===void 0||w.on(ve.RenderEvent.Mousemove,this.onPolygonHover.bind(this)),(D=this.polygonRender)===null||D===void 0||D.on(ve.RenderEvent.Mouseout,this.onPolygonUnHover.bind(this)),(N=this.polygonRender)===null||N===void 0||N.on(ve.RenderEvent.Dragstart,this.onPolygonDragStart.bind(this))}},{key:"syncPolygonNodes",value:function(m,w){var D=sl(Ks([].concat(Os(w),[go(w)]))),N=m.properties,W=N.line;if(m.properties.nodes=w,m.geometry.coordinates=[rp(ou(D))?D:D.reverse()],this.setPolygonData(function(ke){return ke.map(function(Ge){return Qo(Ge,m)?m:Ge})}),!Qo(this.drawPolygon,m)){var $=W.properties.nodes,ie=Os(w),pe=go(ie);ie.push($.length===w.length?Mr(pe.geometry.coordinates):ic($));var we=ic(ie);xi(pe.geometry.coordinates,we.geometry.coordinates)||(we.geometry.coordinates=Fc(pe.geometry.coordinates)),this.syncLineNodes(W,ie)}return m}},{key:"setActivePolygon",value:function(m){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.setActiveLine(m.properties.line,w),this.setPolygonData(function(D){return Qs({target:m,data:D,targetHandler:function(N){N.properties=mn(mn({},N.properties),{},{isDraw:!1,isActive:!0,isDrag:!1,isHover:!1},w)},otherHandler:function(N){N.properties=mn(mn({},N.properties),{},{isDraw:!1,isActive:!1,isDrag:!1})}})}),this.setTextData(this.getAllTexts()),m}},{key:"clearActivePolygon",value:function(){this.setPolygonData(function(m){return m.map(function(w){return w.properties=mn(mn({},w.properties),{},{isDrag:!1,isActive:!1,isHover:!1}),w})}),this.clearActiveLine()}},{key:"onLineDragStart",value:function(m){var w=lo(Ni(v.prototype),"onLineDragStart",this).call(this,m),D=this.getPolygonData().find(function(N){return Qo(N.properties.line,w)});return D&&(this.setActivePolygon(D,{isDrag:!0}),this.emit(ve.DrawEvent.DragStart,D,this.getPolygonData())),w}},{key:"onLineUnClick",value:function(m){return this.editLine}},{key:"onLineDragEnd",value:function(m){var w=lo(Ni(v.prototype),"onLineDragEnd",this).call(this,m),D=this.dragPolygon;return w&&D&&(D.properties.isDrag=!1,this.emit(ve.DrawEvent.DragEnd,D,this.getPolygonData()),this.emit(ve.DrawEvent.Edit,D,this.getPolygonData())),w}},{key:"onPolygonUnClick",value:function(m){var w=this.editPolygon;if(w)return this.handlePolygonUnClick(w)}},{key:"onPolygonHover",value:function(m){if(!this.drawPolygon)return this.dragPolygon||this.setHelper("polygonHover"),this.handlePolygonHover(m.feature)}},{key:"onPolygonUnHover",value:function(m){if(!this.drawPolygon)return this.setHelper(this.addable?"draw":null),this.handlePolygonUnHover()}},{key:"onPolygonDragStart",value:function(m){if(this.options.editable&&!this.drawPolygon){var w=m.feature;return this.previousPosition=Xt(m),this.setHelper("polygonDrag"),this.emit(ve.DrawEvent.DragStart,w,this.getPolygonData()),this.handlePolygonDragStart(w)}}},{key:"onMidPointClick",value:function(m){var w=this.editPolygon,D=lo(Ni(v.prototype),"onMidPointClick",this).call(this,m);if(D&&w){var N=w.properties.line.properties.nodes;this.syncPolygonNodes(w,N.slice(0,N.length-1)),this.setActivePolygon(w)}return D}},{key:"onPointDragEnd",value:function(m){var w=this.editPolygon,D=lo(Ni(v.prototype),"onPointDragEnd",this).call(this,m);return D&&w&&this.emit(ve.DrawEvent.Edit,w,this.getPolygonData()),D}},{key:"enablePolygonRenderAction",value:function(){var m,w,D,N=this.options.editable;(m=this.polygonRender)===null||m===void 0||m.enableUnClick(),N&&((w=this.polygonRender)===null||w===void 0||w.enableHover(),(D=this.polygonRender)===null||D===void 0||D.enableDrag())}},{key:"disablePolygonRenderAction",value:function(){var m,w,D;(m=this.polygonRender)===null||m===void 0||m.disableUnClick(),(w=this.polygonRender)===null||w===void 0||w.disableHover(),(D=this.polygonRender)===null||D===void 0||D.disableDrag()}},{key:"bindEnableEvent",value:function(){lo(Ni(v.prototype),"bindEnableEvent",this).call(this),this.enableSceneRenderAction(),this.enablePointRenderAction(),this.enableLineRenderAction(),this.enableMidPointRenderAction(),this.enablePolygonRenderAction()}},{key:"unbindEnableEvent",value:function(){lo(Ni(v.prototype),"unbindEnableEvent",this).call(this),this.disableSceneRenderAction(),this.disablePointRenderAction(),this.disableLineRenderAction(),this.disableMidPointRenderAction(),this.disablePolygonRenderAction()}},{key:"bindThis",value:function(){lo(Ni(v.prototype),"bindThis",this).call(this),this.bindPointRenderEvent=this.bindPointRenderEvent.bind(this),this.bindSceneEvent=this.bindSceneEvent.bind(this),this.bindLineRenderEvent=this.bindLineRenderEvent.bind(this),this.bindMidPointRenderEvent=this.bindMidPointRenderEvent.bind(this),this.bindPolygonRenderEvent=this.bindPolygonRenderEvent.bind(this)}},{key:"setActiveFeature",value:function(m){var w=this.getTargetFeature(m);w?this.setActivePolygon(w):this.clearActivePolygon()}},{key:"resetFeatures",value:function(){var m=this.getPolygonData();this.drawPolygon&&(m=m.filter(function(w){return!w.properties.isDraw}),this.source.setData({point:[],dashLine:[],midPoint:[]}),this.setLineData(function(w){return w.filter(function(D){return!D.properties.isDraw})}),this.setTextData(function(w){return w.filter(function(D){return!D.properties.isActive})})),this.editPolygon&&this.handlePolygonUnClick(this.editPolygon),this.setPolygonData(m.map(function(w){return w.properties=mn(mn({},w.properties),{},{isDrag:!1,isActive:!1,isHover:!1}),w}))}}]),v}(Sd),td=function(p){function v(){return Ia(this,v),Dn(this,v,arguments)}return Aa(v,p),Sl(v,[{key:"drawLine",get:function(){var m;return(m=this.drawPolygon)===null||m===void 0?void 0:m.properties.line}},{key:"getDefaultOptions",value:function(m){var w=mn(mn({},lo(Ni(v.prototype),"getDefaultOptions",this).call(this,m)),{},{showMidPoint:!1,trigger:"click",autoActive:!1,helper:Fc(te)});return m.trigger==="drag"&&(w.helper=mn(mn({},w.helper),fe)),w}},{key:"getMidPointsByLine",value:function(m){return[]}},{key:"handleCreatePolygon",value:function(m,w){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},N=w.properties.nodes;return el(N.slice(0,N.length-1),mn({nodes:m,line:w},D))}},{key:"handleFirstNodeCreate",value:function(m){var w=Mr(m.geometry.coordinates),D=this.handleCreatePolygonLine(m,w,{isDraw:!0,isActive:!0}),N=this.handleCreatePolygon([m,w],D,{isDraw:!0,isActive:!0});return this.setPolygonData(function(W){return Qs({target:N,data:[].concat(Os(W),[N]),targetHandler:function($){$.properties=mn(mn({},$.properties),{},{isDraw:!0,isActive:!0})}})}),this.emit(ve.DrawEvent.AddNode,m,this.drawPolygon,this.getPolygonData()),this.setHelper("drawFinish"),m}},{key:"handleLastNodeCreate",value:function(m){var w=this.options,D=w.autoActive,N=w.editable,W=this.drawPolygon;return W&&(this.setLineData(function($){return[].concat(Os($),[W.properties.line])}),this.setActivePolygon(W),D&&N||this.handlePolygonUnClick(W),this.emit(ve.DrawEvent.Add,W,this.getPolygonData()),this.emit(ve.DrawEvent.AddNode,W.properties.nodes[1],this.drawPolygon,this.getPolygonData()),this.setHelper(N?D?"pointHover":"polygonHover":this.addable?"draw":null)),m}},{key:"onPointCreate",value:function(m){var w=this;if(this.addable&&!this.dragPoint&&!this.editLine&&this.isClickTrigger){var D=this.drawPolygon,N=Xt(m),W=this.handleCreatePoint(N);return D?requestAnimationFrame(function(){w.handleLastNodeCreate(W)}):this.handleFirstNodeCreate(W),W}}},{key:"setActivePolygon",value:function(m){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.setActiveLine(m.properties.line,w),this.setPolygonData(function(N){return Qs({target:m,data:N,targetHandler:function(W){W.properties=mn(mn({},W.properties),{},{isDraw:!1,isActive:!0,isDrag:!1,isHover:!1},w)},otherHandler:function(W){W.properties=mn(mn({},W.properties),{},{isDraw:!1,isActive:!1,isDrag:!1})}})}),this.setPointData(m.properties.nodes),this.setDashLineData([]);var D=this.getAllTexts();return this.setTextData(D),m}},{key:"onPointDragging",value:function(m){var w=this.dragPoint;if(w){var D=this.handlePointDragging(w,Mt(m)),N=this.editPolygon;return D&&N&&(this.syncPolygonNodes(N,N.properties.nodes.map(function(W){return Qo(W,D)?D:W})),this.setActivePolygon(N)),D}}},{key:"onSceneDragStart",value:function(m){this.isDragTrigger&&this.addable&&!this.dragPoint&&!this.editLine&&(this.scene.setMapStatus({dragEnable:!1}),this.handleFirstNodeCreate(this.handleCreatePoint(Xt(m))))}},{key:"onSceneDragEnd",value:function(m){this.isDragTrigger&&this.addable&&!this.dragPoint&&!this.editLine&&this.drawPolygon&&(this.scene.setMapStatus({dragEnable:!1}),this.handleLastNodeCreate(this.handleCreatePoint(Xt(m))))}},{key:"onSceneMouseMove",value:function(m){var w=this.drawPolygon;if(w){var D=w.properties.nodes,N=go(D),W=ic(D);W.geometry.coordinates=Xt(m),this.syncPolygonNodes(w,[N,W]),this.setDashLineData([w.properties.line]),this.setTextData(this.getAllTexts()),this.resetCursor()}}}]),v}(Up),dd=function(p){function v(m,w){var D;return Ia(this,v),(D=Dn(this,v,[m,w])).bindPointRenderEvent(),D.bindSceneEvent(),D.bindMidPointRenderEvent(),D.bindLineRenderEvent(),D.bindPolygonRenderEvent(),D}return Aa(v,p),Sl(v,[{key:"getDefaultOptions",value:function(m){var w=mn(mn({},lo(Ni(v.prototype),"getDefaultOptions",this).call(this,m)),{},{showMidPoint:!1,circleSteps:60});return w.distanceOptions&&(w.distanceOptions.showTotalDistance=!0,w.distanceOptions.showOnRadius===void 0&&(w.distanceOptions.showOnRadius=!0)),w.helper&&(w.helper=mn(mn({},w.helper),Te)),w}},{key:"getDistanceTexts",value:function(){var m=this.options.distanceOptions;if(!m)return[];var w=[],D=m.showWhen,N=m.showDashDistance,W=m.format,$=m.showTotalDistance;return w.push.apply(w,Os(this.getDashLineDistanceTexts(this.getDashLineData(),{showTotalDistance:!0,format:W,showDashDistance:N})).concat(Os(this.getLineDistanceTexts(this.getLineData(),{showTotalDistance:$,format:W,showWhen:D})))),w}},{key:"setData",value:function(m){var w=this,D=m.map(function(N){var W,$,ie;N.properties=mn(mn({},Xr()),N.properties);var pe=(W=N.properties)===null||W===void 0?void 0:W.nodes;if((($=pe)===null||$===void 0?void 0:$.length)!==2){var we=bs(ih(N).geometry.coordinates,2),ke=we[0],Ge=we[1],ht=cc(N),mt=ht[2],St=(ht[1]+ht[3])/2;pe=[Mr([ke,Ge]),Mr([mt,St])],N.properties.nodes=pe}var xt=pe[0],bt=pe[1],kt=!!(!((ie=N.properties)===null||ie===void 0)&&ie.isActive),ft=N.properties.line;return ft||(ft=w.handleCreatePolygonLine(xt,bt,{isActive:kt}),N.properties.line=ft),w.handleCreatePolygon([xt,bt],ft,mn(mn({},N.properties),{},{isActive:kt}))});this.source.setData({point:[],midPoint:[],dashLine:[],polygon:D,line:D.map(function(N){return N.properties.line})}),this.setTextData(this.getAllTexts()),this.editPolygon&&this.setActivePolygon(this.editPolygon)}},{key:"handleCreatePolygonLine",value:function(m,w){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},N=this.getBoundaryPositions(m,w).map(function(W){return Mr(W)});return Bi(N,D)}},{key:"syncPolygonNodes",value:function(m,w){var D=m.properties.line,N=this.getBoundaryPositions(w[0],w[1]);return m.properties.nodes=w,m.geometry.coordinates=[N],this.setPolygonData(function(W){return W.map(function($){return Qo($,m)?m:$})}),this.setPointData(m.properties.isDraw?[w[0]]:w),D.properties.nodes.forEach(function(W,$){W.geometry.coordinates=N[$]}),D.geometry.coordinates=N,m}},{key:"onLineDragging",value:function(m){var w=this.dragPolygon,D=bs(this.previousPosition,2),N=D[0],W=D[1],$=lo(Ni(v.prototype),"onLineDragging",this).call(this,m);if(w){var ie=bs(Xt(m),2),pe=ie[0],we=ie[1];w.properties.nodes.forEach(function(ke){var Ge=bs(ke.geometry.coordinates,2),ht=Ge[1];ke.geometry.coordinates=[Br(Ge[0]+pe-N),Br(ht+we-W)]}),this.syncPolygonNodes(w,w.properties.nodes),this.setActivePolygon(w,{isDrag:!0}),this.emit(ve.DrawEvent.Dragging,w,this.getPolygonData())}return $}},{key:"getBoundaryPositions",value:function(m,w){for(var D=this.options.circleSteps,N=yu(m,w,{units:"meters"}),W=[],$=0;D>$;$++)W.push(nh(m,N,-360*$/D,{units:"meters"}).geometry.coordinates.map(function(ie){return Br(ie,6)}));return W.push(W[0]),W}}]),v}(td),Zp=function(p){function v(m,w){var D;return Ia(this,v),(D=Dn(this,v,[m,w])).drawLineFinish=function(){var N,W=D.drawLine,$=(N=W==null?void 0:W.properties.nodes)!==null&&N!==void 0?N:[];if(W&&($==null?void 0:$.length)>1){D.setActiveLine(W);var ie=D.options,pe=ie.autoActive,we=ie.editable;pe&&we||D.handleLineUnClick(W),D.setHelper(we&&pe?"pointHover":D.addable?"draw":null),D.emit(ve.DrawEvent.Add,W,D.getLineData())}},D.sceneRender.on(ve.RenderEvent.DblClick,D.drawLineFinish),D.bindPointRenderEvent(),D.bindSceneEvent(),D.bindMidPointRenderEvent(),D.bindLineRenderEvent(),D}return Aa(v,p),Sl(v,[{key:"dragItem",get:function(){return this.dragLine}},{key:"editItem",get:function(){return this.editLine}},{key:"getMainLayer",value:function(){var m,w;return(m=(w=this.render.line)===null||w===void 0?void 0:w.getLayers())!==null&&m!==void 0?m:[]}},{key:"setData",value:function(m){var w=Et(m).map(function(D){var N,W;return D.properties=mn(mn({},Ft()),(N=D.properties)!==null&&N!==void 0?N:{}),!((W=D.properties.nodes)===null||W===void 0)&&W.length||(D.properties.nodes=sl(D).map(function($){return Mr($)})),D});this.source.setData({point:[],midPoint:[],dashLine:[],line:w}),this.setTextData(this.getAllTexts()),this.editLine&&this.setActiveLine(this.editLine)}},{key:"getData",value:function(){var m=arguments.length>0&&arguments[0]!==void 0&&arguments[0],w=this.getLineData();return m?w:Vt(w)}},{key:"getRenderTypes",value:function(){return["line","dashLine","midPoint","point","text"]}},{key:"bindPointRenderEvent",value:function(){var m;lo(Ni(v.prototype),"bindPointRenderEvent",this).call(this),(m=this.pointRender)===null||m===void 0||m.on(ve.RenderEvent.Contextmenu,this.onPointContextMenu.bind(this))}},{key:"onPointClick",value:function(m){var w,D=this,N=this.drawLine,W=(w=N==null?void 0:N.properties.nodes)!==null&&w!==void 0?w:[],$=m.feature;if(Qo($,ic(W)))requestAnimationFrame(function(){D.drawLineFinish()});else{var ie=bs($.geometry.coordinates,2);m.lngLat={lng:ie[0],lat:ie[1]},this.onPointCreate(m)}}},{key:"removeNode",value:function(m,w){var D,N=this.getTargetFeature(w),W=this.getTargetFeature(m,(D=N==null?void 0:N.properties.nodes)!==null&&D!==void 0?D:[]);if(N&&W){var $,ie=($=N==null?void 0:N.properties.nodes)!==null&&$!==void 0?$:[];if(3>ie.length)return;this.syncLineNodes(N,ie.filter(function(pe){return!Qo(W,pe)})),this.emit(ve.DrawEvent.RemoveNode,W,N,this.getLineData()),this.emit(ve.DrawEvent.Edit,N,this.getLineData())}}},{key:"onPointContextMenu",value:function(m){var w,D=this.editLine,N=m.feature,W=(w=D==null?void 0:D.properties.nodes)!==null&&w!==void 0?w:[];if(D&&W.length>=3)return this.removeNode(N,D),this.scene.setMapStatus({dragEnable:!0}),N}},{key:"onPointCreate",value:function(m){if(this.addable){var w=lo(Ni(v.prototype),"onPointCreate",this).call(this,m);return w&&(this.setHelper("drawFinish"),this.emit(ve.DrawEvent.AddNode,w,this.drawLine,this.getLineData())),w}}},{key:"onPointDragEnd",value:function(m){var w=this.editLine,D=lo(Ni(v.prototype),"onPointDragEnd",this).call(this,m);return w&&D&&this.emit(ve.DrawEvent.Edit,w,this.getLineData()),D}},{key:"onLineDragStart",value:function(m){var w=lo(Ni(v.prototype),"onLineDragStart",this).call(this,m);return w&&this.emit(ve.DrawEvent.DragStart,w,this.getLineData()),w}},{key:"onLineDragging",value:function(m){var w=lo(Ni(v.prototype),"onLineDragging",this).call(this,m);return w&&this.emit(ve.DrawEvent.Dragging,w,this.getLineData()),w}},{key:"onLineDragEnd",value:function(m){var w=lo(Ni(v.prototype),"onLineDragEnd",this).call(this,m);return w&&(this.emit(ve.DrawEvent.DragEnd,w,this.getLineData()),this.emit(ve.DrawEvent.Edit,w,this.getLineData())),w}},{key:"onMidPointClick",value:function(m){var w=this.editLine,D=lo(Ni(v.prototype),"onMidPointClick",this).call(this,m);return w&&D&&(this.emit(ve.DrawEvent.Edit,w,this.getLineData()),this.emit(ve.DrawEvent.AddNode,D,w,this.getLineData())),D}},{key:"onSceneMouseMove",value:function(m){var w=this.drawLine;if(w){var D,N=ic(w.properties.nodes),W=Xt(m);this.options.adsorbOptions&&(W=(D=this.getAdsorbPosition(W))!==null&&D!==void 0?D:W),this.setDashLineData([Ma([W,N.geometry.coordinates])]),this.setTextData(this.getAllTexts())}}},{key:"onSceneDragEnd",value:function(m){this.isDragTrigger&&this.addable&&this.drawLine&&this.drawLineFinish()}},{key:"setActiveFeature",value:function(m){var w=this.getTargetFeature(m);w?this.setActiveLine(w):this.clearActiveLine()}},{key:"resetFeatures",value:function(){var m=this.getLineData();this.drawLine&&(m=m.filter(function(w){return!w.properties.isDraw}),this.source.setData({point:[],dashLine:[],midPoint:[]}),this.setTextData(function(w){return w.filter(function(D){return!D.properties.isActive})})),this.editLine&&this.handleLineUnClick(this.editLine),this.setLineData(m.map(function(w){return w.properties=mn(mn({},w.properties),{},{isDrag:!1,isActive:!1,isHover:!1}),w}))}},{key:"enablePointRenderAction",value:function(){var m;lo(Ni(v.prototype),"enablePointRenderAction",this).call(this),this.options.editable&&((m=this.pointRender)===null||m===void 0||m.enableContextMenu())}},{key:"disablePointRenderAction",value:function(){var m;lo(Ni(v.prototype),"disablePointRenderAction",this).call(this),(m=this.pointRender)===null||m===void 0||m.disableContextMenu()}},{key:"bindEnableEvent",value:function(){lo(Ni(v.prototype),"bindEnableEvent",this).call(this),this.enableSceneRenderAction(),this.enablePointRenderAction(),this.enableLineRenderAction(),this.enableMidPointRenderAction(),this.sceneRender.enableDblClick()}},{key:"unbindEnableEvent",value:function(){lo(Ni(v.prototype),"unbindEnableEvent",this).call(this),this.disableSceneRenderAction(),this.disablePointRenderAction(),this.disableLineRenderAction(),this.disableMidPointRenderAction(),this.sceneRender.disableDblClick()}},{key:"bindThis",value:function(){lo(Ni(v.prototype),"bindThis",this).call(this),this.bindPointRenderEvent=this.bindPointRenderEvent.bind(this),this.bindSceneEvent=this.bindSceneEvent.bind(this),this.bindLineRenderEvent=this.bindLineRenderEvent.bind(this),this.bindMidPointRenderEvent=this.bindMidPointRenderEvent.bind(this)}}]),v}(Sd),wf=function(p){function v(m,w){var D;return Ia(this,v),(D=Dn(this,v,[m,w])).bindPointRenderEvent(),D}return Aa(v,p),Sl(v,[{key:"dragItem",get:function(){return this.dragPoint}},{key:"editItem",get:function(){return this.editPoint}},{key:"getDefaultOptions",value:function(m){var w=mn(mn({},this.getCommonOptions(m)),{},{helper:Fc(B),initialData:m.initialData});return w.style.point=h,w}},{key:"bindEnableEvent",value:function(){lo(Ni(v.prototype),"bindEnableEvent",this).call(this),this.enablePointRenderAction()}},{key:"unbindEnableEvent",value:function(){lo(Ni(v.prototype),"unbindEnableEvent",this).call(this),this.disablePointRenderAction()}},{key:"getRenderTypes",value:function(){return["point"]}},{key:"getMainLayer",value:function(){var m,w;return(m=(w=this.render.point)===null||w===void 0?void 0:w.getLayers())!==null&&m!==void 0?m:[]}},{key:"setData",value:function(m){this.setPointData(Et(m).map(function(w){return w.properties=mn(mn({},Cp()),w.properties),w}))}},{key:"getData",value:function(){var m=arguments.length>0&&arguments[0]!==void 0&&arguments[0],w=this.getPointData();return m?w:Vt(w)}},{key:"onPointCreate",value:function(m){if(this.addable){var w=lo(Ni(v.prototype),"onPointCreate",this).call(this,m);if(w)return this.options.editable&&this.setHelper("pointHover"),this.emit(ve.DrawEvent.Add,w,this.getData()),w}else this.setPointData(function(D){return D.map(function(N){return N.properties=mn(mn({},N.properties),{},{isHover:!1,isActive:!1}),N})})}},{key:"onPointMouseMove",value:function(m){var w=lo(Ni(v.prototype),"onPointMouseMove",this).call(this,m);return this.options.editable&&!this.dragPoint&&this.setHelper("pointHover"),w}},{key:"onPointMouseOut",value:function(m){var w=lo(Ni(v.prototype),"onPointMouseOut",this).call(this,m);return this.setHelper(this.addable?"draw":null),w}},{key:"onPointDragStart",value:function(m){var w=lo(Ni(v.prototype),"onPointDragStart",this).call(this,m);return this.setHelper("pointDrag"),this.emit(ve.DrawEvent.DragStart,w,this.getData()),w}},{key:"onPointDragging",value:function(m){var w=lo(Ni(v.prototype),"onPointDragging",this).call(this,m);return w&&this.options.editable&&this.emit(ve.DrawEvent.Dragging,w,this.getData()),w}},{key:"onPointDragEnd",value:function(m){var w=lo(Ni(v.prototype),"onPointDragEnd",this).call(this,m);return w&&this.options.editable&&(this.setHelper("pointHover"),this.emit(ve.DrawEvent.DragEnd,w,this.getData()),this.emit(ve.DrawEvent.Edit,w,this.getData())),w}},{key:"bindThis",value:function(){lo(Ni(v.prototype),"bindThis",this).call(this),this.bindPointRenderEvent=this.bindPointRenderEvent.bind(this)}},{key:"onSceneMouseMove",value:function(m){}},{key:"setActiveFeature",value:function(m){var w=this.getTargetFeature(m);this.setPointData(function(D){return D.map(function(N){return N.properties.isActive=Qo(w,N),N})})}},{key:"resetFeatures",value:function(){this.setPointData(function(m){return m.map(function(w){return w.properties=mn(mn({},w.properties),{},{isDrag:!1,isActive:!1,isHover:!1}),w})})}}]),v}(ed),Td=function(p){function v(m,w){var D;return Ia(this,v),(D=Dn(this,v,[m,w])).drawPolygonFinish=function(){var N,W=D.drawPolygon,$=(N=W==null?void 0:W.properties.nodes)!==null&&N!==void 0?N:[];if(W&&$.length>=3){W.properties.isDraw=!1,D.syncPolygonNodes(W,$),D.setActivePolygon(W);var ie=D.options,pe=ie.autoActive,we=ie.editable;pe&&we||D.handlePolygonUnClick(W),D.setHelper(we?pe?"pointHover":"polygonHover":D.addable?"draw":null),D.emit(ve.DrawEvent.Add,W,D.getPolygonData())}},D.sceneRender.on(ve.RenderEvent.DblClick,D.drawPolygonFinish),D.bindPointRenderEvent(),D.bindSceneEvent(),D.bindMidPointRenderEvent(),D.bindLineRenderEvent(),D.bindPolygonRenderEvent(),D}return Aa(v,p),Sl(v,[{key:"getDefaultOptions",value:function(m){return mn(mn({},lo(Ni(v.prototype),"getDefaultOptions",this).call(this,m)),{},{liveUpdate:!1})}},{key:"setData",value:function(m){var w=Et(m).map(function(D){var N,W;if(D.properties=mn(mn({},Xr()),(N=D.properties)!==null&&N!==void 0?N:{}),!(!((W=D.properties.nodes)===null||W===void 0)&&W.length)){var $=sl(D);$=$.slice(0,$.length-1),D.properties.nodes=$.map(function(pe){return Mr(pe)})}if(!D.properties.line){var ie=D.properties.nodes;D.properties.line=Bi([].concat(Os(ie),[Mr(go(ie).geometry.coordinates)]))}return D});this.source.setData({point:[],midPoint:[],dashLine:[],polygon:w,line:w.map(function(D){return D.properties.line})}),this.setTextData(this.getAllTexts()),this.editPolygon&&this.setActivePolygon(this.editPolygon)}},{key:"onPointCreate",value:function(m){if(this.addable&&!this.dragPoint){var w=lo(Ni(v.prototype),"onPointCreate",this).call(this,m),D=this.drawPolygon,N=this.drawLine;return w&&(D?(this.syncPolygonNodes(D,[].concat(Os(D.properties.nodes),[w])),this.setDashLineData([Ma([Xt(m),D.properties.nodes[0].geometry.coordinates])]),D.properties.nodes.length>1&&this.setHelper("drawFinish")):N&&(this.handleCreatePolygon([w],N),this.setHelper("drawContinue")),this.emit(ve.DrawEvent.AddNode,w,D,this.getPolygonData())),w}}},{key:"onPointClick",value:function(m){var w=this,D=this.drawPolygon,N=m.feature;if(D){var W=D.properties.nodes;if(W.length<3||!Qo(go(W),N)&&!Qo(ic(W),N)){var $=bs(N.geometry.coordinates,2);m.lngLat={lng:$[0],lat:$[1]},this.onPointCreate(m)}else requestAnimationFrame(function(){w.drawPolygonFinish()})}}},{key:"onPointDragging",value:function(m){var w=this.dragPoint,D=this.editPolygon;if(w&&D){var N=D.properties.line;N.properties.nodes=N.properties.nodes.map(function(Ge){return Qo(Ge,w)?w:Ge});var W=N.properties.nodes,$=W.slice(0,W.length-1),ie=go(W),pe=ic(W),we=Qo(ie,w)||Qo(pe,w);if(we&&(ie.geometry.coordinates=pe.geometry.coordinates=Xt(m)),this.options.adsorbOptions&&we){var ke=this.resetAdsorbLngLat(m);ke&&(ie.geometry.coordinates=pe.geometry.coordinates=ke)}lo(Ni(v.prototype),"onPointDragging",this).call(this,m),this.syncPolygonNodes(D,$),this.setActivePolygon(D)}return w}},{key:"onLineDragging",value:function(m){var w=this.dragPolygon,D=lo(Ni(v.prototype),"onLineDragging",this).call(this,m);if(D&&w){var N=D.properties.nodes;this.syncPolygonNodes(w,N.slice(0,N.length-1)),this.emit(ve.DrawEvent.Dragging,w,this.getPolygonData())}return D}},{key:"onMidPointClick",value:function(m){var w=lo(Ni(v.prototype),"onMidPointClick",this).call(this,m),D=this.editPolygon;return w&&D&&(this.emit(ve.DrawEvent.Edit,D,this.getPolygonData()),this.emit(ve.DrawEvent.AddNode,w,D,this.getPolygonData())),w}},{key:"onSceneMouseMove",value:function(m){var w,D=this.drawPolygon,N=(w=D==null?void 0:D.properties.nodes)!==null&&w!==void 0?w:[];if(D&&N.length){this.options.adsorbOptions&&this.resetAdsorbLngLat(m);var W=Xt(m),$=[];if($.push(Ma([W,go(N).geometry.coordinates])),N.length>1&&$.push(Ma([W,ic(N).geometry.coordinates])),this.options.liveUpdate&&N.length>=2){var ie=sl(Ks(N));D.geometry.coordinates=[[].concat(Os(ie),[W,ie[0]])],this.setPolygonData(this.getPolygonData())}this.setDashLineData($),this.setTextData(this.getAllTexts())}}},{key:"onSceneDragEnd",value:function(m){this.isDragTrigger&&this.addable&&this.drawLine&&this.drawPolygonFinish()}},{key:"removeNode",value:function(m,w){var D,N=this.getTargetFeature(w),W=this.getTargetFeature(m,(D=N==null?void 0:N.properties.nodes)!==null&&D!==void 0?D:[]);if(N&&W){var $,ie=($=N==null?void 0:N.properties.nodes)!==null&&$!==void 0?$:[];if(4>ie.length)return;this.syncPolygonNodes(N,ie.filter(function(pe){return!Qo(W,pe)})),this.emit(ve.DrawEvent.RemoveNode,W,N,this.getLineData()),this.emit(ve.DrawEvent.Edit,N,this.getPolygonData())}}},{key:"onPointContextMenu",value:function(m){var w,D=this.editPolygon,N=m.feature,W=(w=D==null?void 0:D.properties.nodes)!==null&&w!==void 0?w:[];if(D&&W.length>=4)return W.find(function($){return Qo($,N)})||(N=W[0]),this.removeNode(N,D),N}},{key:"bindPointRenderEvent",value:function(){var m;lo(Ni(v.prototype),"bindPointRenderEvent",this).call(this),(m=this.pointRender)===null||m===void 0||m.on(ve.RenderEvent.Contextmenu,this.onPointContextMenu.bind(this))}},{key:"enablePointRenderAction",value:function(){var m;lo(Ni(v.prototype),"enablePointRenderAction",this).call(this),this.options.editable&&((m=this.pointRender)===null||m===void 0||m.enableContextMenu())}},{key:"disablePointRenderAction",value:function(){var m;lo(Ni(v.prototype),"disablePointRenderAction",this).call(this),(m=this.pointRender)===null||m===void 0||m.disableContextMenu()}}]),v}(Up),Sf=function(p){function v(m,w){var D;return Ia(this,v),(D=Dn(this,v,[m,w])).bindPointRenderEvent(),D.bindSceneEvent(),D.bindMidPointRenderEvent(),D.bindLineRenderEvent(),D.bindPolygonRenderEvent(),D}return Aa(v,p),Sl(v,[{key:"getDefaultOptions",value:function(m){var w=lo(Ni(v.prototype),"getDefaultOptions",this).call(this,m);return w.helper&&(w.helper=mn(mn({},w.helper),ce)),w}},{key:"setData",value:function(m){var w=this,D=m.map(function(N){var W,$,ie;N.properties=mn(mn({},Xr()),(W=N.properties)!==null&&W!==void 0?W:{});var pe=N.properties.nodes;if((($=pe)===null||$===void 0?void 0:$.length)!==2){var we=bs(cc(N),4),ke=we[2],Ge=we[3];pe=[Mr([we[0],we[1]]),Mr([ke,Ge])],N.properties.nodes=pe}var ht=bs(pe,2),mt=ht[0],St=ht[1],xt=!!(!((ie=N.properties)===null||ie===void 0)&&ie.isActive),bt=N.properties.line;return bt||(bt=w.handleCreatePolygonLine(mt,St,{isActive:xt}),N.properties.line=bt),w.handleCreatePolygon([mt,St],bt,mn(mn({},N.properties),{},{isActive:xt}))});this.source.setData({point:[],midPoint:[],dashLine:[],polygon:D,line:D.map(function(N){return N.properties.line})}),this.setTextData(this.getAllTexts()),this.editPolygon&&this.setActivePolygon(this.editPolygon)}},{key:"handleCreatePolygonLine",value:function(m,w){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},N=sl(Ya(Ks([m,w]))).map(function(W,$){return $===0?m:$===2?w:Mr(W)});return Bi(N,D)}},{key:"syncPolygonNodes",value:function(m,w){var D=m.properties.line,N=sl(Ya(Ks(w)));m.properties.nodes=w,m.geometry.coordinates=[N],this.setPolygonData(function(ie){return ie.map(function(pe){return Qo(pe,m)?m:pe})}),this.setPointData(m.properties.isDraw?[w[0]]:w);var W=D.properties.nodes,$=N.filter(function(ie){return!xi(ie,w[0].geometry.coordinates)&&!xi(ie,w[1].geometry.coordinates)});return W.forEach(function(ie,pe){var we=[0,0];switch(pe){case 0:we=w[0].geometry.coordinates;break;case 1:we=$[0];break;case 2:we=w[1].geometry.coordinates;break;case 3:we=$[1];break;case 4:we=Fc(w[0].geometry.coordinates)}ie.geometry.coordinates=we}),D.geometry.coordinates=N,m}},{key:"onLineDragging",value:function(m){var w=lo(Ni(v.prototype),"onLineDragging",this).call(this,m),D=this.dragPolygon;if(w&&D){var N=D.properties.line.properties.nodes;this.syncPolygonNodes(D,[N[0],N[2]]),this.setActivePolygon(D,{isDrag:!0}),this.emit(ve.DrawEvent.Dragging,D,this.getPolygonData())}return w}}]),v}(td),sm=function(p,v){for(var m=p;m&&!Array.from(m.classList).includes(v);)m=m.parentElement;return m},Ud=["point","line","polygon","rect","circle","clear"],Ad={point:"#l7draw-point",line:"#l7draw-line",polygon:"#l7draw-polygon",rect:"#l7draw-rect",circle:"#l7draw-circle",clear:"#l7draw-qingkong"},Bu={point:wf,line:Zp,polygon:Td,rect:Sf,circle:dd},nu="data-draw-type",lm="l7-draw-control",Cd="".concat(lm,"__btn"),rd="".concat(Cd,"--active");(function(p){var v,m,w,D,N,W='',$=($=document.getElementsByTagName("script"))[$.length-1].getAttribute("data-injectcss");if($&&!p.__iconfont__svg__cssinject__){p.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(pe){console&&console.log(pe)}}function ie(){N||(N=!0,w())}v=function(){var pe,we=document.createElement("div");we.innerHTML=W,W=null,(we=we.getElementsByTagName("svg")[0])&&(we.setAttribute("aria-hidden","true"),we.style.position="absolute",we.style.width=0,we.style.height=0,we.style.overflow="hidden",(pe=document.body).firstChild?function(ke,Ge){Ge.parentNode.insertBefore(ke,Ge)}(we,pe.firstChild):pe.appendChild(we))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(v,0):(m=function(){document.removeEventListener("DOMContentLoaded",m,!1),v()},document.addEventListener("DOMContentLoaded",m,!1)):document.attachEvent&&(w=v,D=p.document,N=!1,function pe(){try{D.documentElement.doScroll("left")}catch(we){return void setTimeout(pe,50)}ie()}(),D.onreadystatechange=function(){D.readyState=="complete"&&(D.onreadystatechange=null,ie())})})(window),Vr(".l7-draw-control{display:flex;overflow:hidden;background:#fff;border-radius:2px;box-shadow:0 0 20px rgba(0,0,0,.14901960784313725)}.l7-draw-control__btn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;text-align:center;background:transparent;border-width:0;border-right:1px solid #e0e0e0;outline:0;cursor:pointer;transition:background-color .3s}.l7-draw-control__btn svg{transition:color .3s}.l7-draw-control__btn:hover{background-color:#e5e5e5}.l7-draw-control__btn:hover svg{color:#000}.l7-draw-control__btn:last-child{border-right:0;border-bottom:0}.l7-draw-control__btn .l7-draw-icon{width:26px;height:26px;overflow:hidden;fill:currentColor}.l7-draw-control__btn--active,.l7-draw-control__btn--active:hover{background-color:#0370fe}.l7-draw-control__btn--active:hover svg,.l7-draw-control__btn--active svg{color:#fff}");var bm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Nr=/^\w*$/,um=function(p,v){if(Hu(p))return!1;var m=typeof p;return!(m!="number"&&m!="symbol"&&m!="boolean"&&p!=null&&!ks(p))||Nr.test(p)||!bm.test(p)||v!=null&&p in Object(v)};function Tf(p,v){if(typeof p!="function"||v!=null&&typeof v!="function")throw new TypeError("Expected a function");var m=function(){var w=arguments,D=v?v.apply(this,w):w[0],N=m.cache;if(N.has(D))return N.get(D);var W=p.apply(this,w);return m.cache=N.set(D,W)||N,W};return m.cache=new(Tf.Cache||Tu),m}Tf.Cache=Tu;var Mp=Tf,Bm=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Kr=/\\(\\)?/g,cm=function(p){var v=Mp(p,function(w){return m.size===500&&m.clear(),w}),m=v.cache;return v}(function(p){var v=[];return p.charCodeAt(0)===46&&v.push(""),p.replace(Bm,function(m,w,D,N){v.push(D?N.replace(Kr,"$1"):w||m)}),v}),Af=Si?Si.prototype:void 0,hm=Af?Af.toString:void 0,Em=function p(v){if(typeof v=="string")return v;if(Hu(v))return uu(v,p)+"";if(ks(v))return hm?hm.call(v):"";var m=v+"";return m=="0"&&1/v==-1/0?"-0":m},wm=function(p){return p==null?"":Em(p)},Md=function(p,v){return Hu(p)?p:um(p,v)?[p]:cm(wm(p))},cf=function(p){if(typeof p=="string"||ks(p))return p;var v=p+"";return v=="0"&&1/p==-1/0?"-0":v},nd=function(p,v){for(var m=0,w=(v=Md(v,p)).length;p!=null&&w>m;)p=p[cf(v[m++])];return m&&m==w?p:void 0},Sm=function(p,v,m){var w=-1,D=p.length;0>v&&(v=-v>D?0:D+v),0>(m=m>D?D:m)&&(m+=D),D=v>m?0:m-v>>>0,v>>>=0;for(var N=Array(D);++wv.length?p:nd(p,Sm(v,0,-1))},mc=function(p,v){return v=Md(v,p),(p=qm(p,v))==null||delete p[cf(ic(v))]},mh=function(p){return Zn(p)?void 0:p},Zd=Si?Si.isConcatSpreadable:void 0,i=function(p){return Hu(p)||yf(p)||!!(Zd&&p&&p[Zd])},l=function p(v,m,w,D,N){var W=-1,$=v.length;for(w||(w=i),N||(N=[]);++W<$;){var ie=v[W];m>0&&w(ie)?m>1?p(ie,m-1,w,D,N):Nf(N,ie):D||(N[N.length]=ie)}return N},_=function(p){return p!=null&&p.length?l(p,1):[]},S=function(p){return fu(Es(p,void 0,_),p+"")}(function(p,v){var m={};if(p==null)return m;var w=!1;v=uu(v,function(N){return N=Md(N,p),w||(w=N.length>1),N}),ju(p,Dc(p),m),w&&(m=zd(m,7,mh));for(var D=v.length;D--;)mc(m,v[D]);return m}),F=S,j=function(p){function v(m){var w,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ia(this,v),(w=Dn(this,v,[D])).controlOption=void 0,w.sceneInstance=void 0,w.drawMap={},w.btnMap={},w.activeType=null,w.emitDataChange=nc(function(){w.emit(ve.ControlEvent.DataChange,w.getDrawData())},16),w.emitDrawSelect=function(N,W){w.emit(ve.ControlEvent.DrawSelect,N,W)},w.sceneInstance=m,w.controlOption=mn(mn({},w.getDefault()),D||{}),w.onBtnClick=w.onBtnClick.bind(Ku(w)),w}return Aa(v,p),Sl(v,[{key:"getActiveType",value:function(){return this.activeType}},{key:"getDefault",value:function(){return mn(mn({},lo(Ni(v.prototype),"getDefault",this).call(this)),{},{className:"",buttonClassName:"",activeButtonClassName:"",style:"",position:"topleft",commonDrawOptions:{},drawConfig:{point:!0,line:!0,polygon:!0,rect:!0,circle:!0,clear:!0}})}},{key:"addTo",value:function(m){return lo(Ni(v.prototype),"addTo",this).call(this,m),this.init(),this}},{key:"onAdd",value:function(){var m=this.controlOption,w=m.className,D=m.style,N=Ze.DOM.create("div","".concat(lm," ").concat(w));return D&&N.setAttribute("style",D),N}},{key:"onRemove",value:function(){Object.values(this.drawMap).forEach(function(m){m.clear(!0)})}},{key:"init",value:function(){var m,w=this,D=[];Object.entries(this.controlOption.drawConfig).filter(function(N){var W=bs(N,2);return W[1]}).sort(function(N,W){var $=bs(N,2)[1],ie=bs(W,2)[1],pe=Number.MAX_SAFE_INTEGER;return(typeof $=="boolean"?pe:$.order)-(typeof ie=="boolean"?pe:ie.order)}).map(function(N){var W=bs(N,2),$=W[1];return[W[0],Il($)==="object"?F($,"order"):$]}).forEach(function(N){var W=bs(N,2),$=W[0],ie=W[1];if(Il(ie)==="object"&&ie.button){var pe=ie.button;pe.classList.contains("l7-draw-control__btn")||pe.classList.add("l7-draw-control__btn"),w.btnMap[$]=pe,D.push(pe)}else if(ie&&Ud.includes($)){var we=w.initBtn($);we.addEventListener("click",w.onBtnClick),D.push(we),w.btnMap[$]=we;var ke=Bu[$];if(ke&&w.sceneInstance){var Ge=new ke(w.sceneInstance,mn(mn({},w.controlOption.commonDrawOptions),typeof ie=="boolean"?{}:ie));Ge.on(ve.DrawEvent.Change,w.emitDataChange),Ge.on(ve.DrawEvent.Select,function(ht){w.emitDrawSelect($,ht),ht&&Object.values(w.drawMap).forEach(function(mt){mt!==Ge&&mt.setActiveFeature(null)})}),w.drawMap[$]=Ge}}}),(m=this.container).append.apply(m,D),this.controlOption.defaultActiveType&&this.onDrawClick(this.controlOption.defaultActiveType)}},{key:"getDrawData",value:function(){return Pe(Ca(this.drawMap).map(function(m){var w=bs(m,2);return[w[0],w[1].getData()]}))}},{key:"getTypeDraw",value:function(m){var w;return(w=this.drawMap[m])!==null&&w!==void 0?w:null}},{key:"onBtnClick",value:function(m){var w=sm(m.target,Cd);if(w){var D=w.getAttribute(nu);D==="clear"?this.clearDrawData():this.onDrawClick(D)}}},{key:"setActiveType",value:function(m){var w=null,D=this.activeType;if(D){var N,W=this.btnMap[D];if(W){Ze.DOM.removeClass(W,rd);var $=this.controlOption.activeButtonClassName;$&&Ze.DOM.removeClass(W,$)}(N=this.drawMap[D])===null||N===void 0||N.disable(),w=null}if(D!==m&&m){var ie;(ie=this.drawMap[m])===null||ie===void 0||ie.enable();var pe=this.btnMap[m];pe&&Ze.DOM.addClass(pe,"".concat(rd," ").concat(this.controlOption.activeButtonClassName)),w=m}this.activeType=w,this.emit(ve.ControlEvent.DrawChange,w)}},{key:"onDrawClick",value:function(m){this.setActiveType(m)}},{key:"clearDrawData",value:function(){Object.values(this.drawMap).forEach(function(m){m==null||m.clear()}),this.emit(ve.ControlEvent.DrawClear)}},{key:"initBtn",value:function(m){var w=Ze.DOM.create("button","".concat(Cd," ").concat(this.controlOption.buttonClassName));return w.innerHTML=``),w.setAttribute(nu,m),w}}]),v}(Ze.Control);ve.ACTIVE_COLOR=H,ve.BaseMode=Fl,ve.CircleDrawer=dd,ve.DEFAULT_ADSORB_CONFIG=ir,ve.DEFAULT_AREA_OPTIONS=Gl,ve.DEFAULT_CIRCLE_HELPER_CONFIG=Te,ve.DEFAULT_COMMON_OPTIONS=ee,ve.DEFAULT_CURSOR_MAP=M,ve.DEFAULT_DISTANCE_OPTIONS=Qa,ve.DEFAULT_DRAG_OPTIONS=jr,ve.DEFAULT_DRAG_POLYGON_HELPER_CONFIg=te,ve.DEFAULT_HISTORY_CONFIG=Wl,ve.DEFAULT_KEYBOARD_CONFIG=ut,ve.DEFAULT_LINE_HELPER_CONFIG=G,ve.DEFAULT_MID_POINT_STYLE=_e,ve.DEFAULT_NODE_NORMAL_STYLE=ue,ve.DEFAULT_NODE_STYLE=g,ve.DEFAULT_POINT_HELPER_CONFIG=B,ve.DEFAULT_POINT_NORMAL_STYLE=ne,ve.DEFAULT_POINT_STYLE=h,ve.DEFAULT_POLYGON_HELPER_CONFIG=q,ve.DEFAULT_POPUP_CONFIG=At,ve.DEFAULT_RECT_HELPER_CONFIG=ce,ve.DEFAULT_SOURCE_DATA=R,ve.DEFAULT_STYLE=b,ve.DEFAULT_TEXT_NORMAL_STYLE=d,ve.DEFAULT_TRIGGER_DRAG_HELPER_CONFIG=fe,ve.DashLineRender=fa,ve.DragPolygonMode=td,ve.DrawCircle=dd,ve.DrawControl=j,ve.DrawLine=Zp,ve.DrawPoint=wf,ve.DrawPolygon=Td,ve.DrawRect=Sf,ve.LayerRender=ql,ve.LineDrawer=Zp,ve.LineMode=Sd,ve.LineRender=Yl,ve.MidPointMode=Ch,ve.MidPointRender=Th,ve.NORMAL_COLOR=k,ve.PointDrawer=wf,ve.PointMode=ed,ve.PointRender=ba,ve.PolygonDrawer=Td,ve.PolygonMode=Up,ve.PolygonRender=z,ve.RENDER_MAP=I,ve.RectDrawer=Sf,ve.SceneRender=s,ve.Source=Ns,ve.TextRender=x,ve.calcAreaText=sr,ve.calcDistanceTextsByLine=Jt,ve.createDashLine=Ma,ve.createLineFeature=Bi,ve.createPointFeature=Mr,ve.createPolygonFeature=el,ve.findMinIndex=$t,ve.getAdsorbPosition=_n,ve.getDefaultLineProperties=Ft,ve.getDefaultPointProperties=Cp,ve.getDefaultPolygonProperties=Xr,ve.getLineCenterPoint=Ir,ve.getLngLat=Mt,ve.getMapDom=lr,ve.getParentByClassName=sm,ve.getPixelExpandBBox=Tn,ve.getPosition=Xt,ve.getPrecisionNumber=Br,ve.getSingleColorStyle=function(p){return{point:{normal:{color:p},hover:{color:p},active:{color:p}},line:{normal:{color:p},hover:{color:p},active:{color:p}},polygon:{normal:{color:p},hover:{color:p},active:{color:p},style:{opacity:.2}},text:{normal:{color:p},active:{color:p}},midPoint:{normal:{color:p}},dashLine:{normal:{color:p}}}},ve.getUuid=ya,ve.injectFeaturesBBox=st,ve.isDev=!1,ve.isPositionInBBox=vn,ve.isSameFeature=Qo,ve.joinMultiFeatures=Vt,ve.resetEventLngLat=Qn,ve.splitByPosition=zr,ve.splitMultiFeatures=Et,ve.transLngLat2Position=pt,ve.updateTargetFeature=Qs,Object.defineProperty(ve,"__esModule",{value:!0})})},20446:function(){},5527:function(Zr,_r,Se){"use strict";Se.r(_r),Se.d(_r,{AJAXError:function(){return Lr},AttributeType:function(){return Vr},BKDRHash:function(){return Eu},BaiduMap:function(){return zP},BaseLayer:function(){return Yd},BaseMapService:function(){return _g},BaseMapWrapper:function(){return Nm},BaseModel:function(){return Ml},BasePostProcessingPass:function(){return Bl},BlendType:function(){return $r},ButtonControl:function(){return hg},CameraUniform:function(){return lr},CanvasLayer:function(){return nC},CanvasUpdateType:function(){return cw},CityBuildingLayer:function(){return wC},Control:function(){return Xd},CoordinateSystem:function(){return Xt},CoordinateUniform:function(){return pt},DOM:function(){return ve},Earth:function(){return tI},EarthLayer:function(){return D4},ExportImage:function(){return fg},FrequencyController:function(){return Gc},Fullscreen:function(){return yy},GaodeMap:function(){return v3},GaodeMapV1:function(){return MP},GaodeMapV2:function(){return v3},GeoLocate:function(){return xy},GeometryLayer:function(){return OC},GoogleMap:function(){return sI},HeatmapLayer:function(){return QC},IDebugLog:function(){return $t},ILayerStage:function(){return _n},ImageLayer:function(){return Cw},InteractionEvent:function(){return zr},LRUCache:function(){return Lu},LayerPopup:function(){return K4},LayerSwitch:function(){return bb},LineLayer:function(){return m2},LinearDir:function(){return s2},LoadTileDataStatus:function(){return z},Logo:function(){return Ey},Map:function(){return cI},MapLibre:function(){return wI},MapServiceEvent:function(){return po},MapTheme:function(){return y0},MapType:function(){return rp},Mapbox:function(){return vI},Marker:function(){return Tv},MarkerLayer:function(){return vy},MaskLayer:function(){return v2},MaskOperation:function(){return vn},MouseLocation:function(){return wb},PassType:function(){return Ei},PointLayer:function(){return l1},PolygonLayer:function(){return u1},PopperControl:function(){return Av},Popup:function(){return Jw},PositionType:function(){return Mt},RasterLayer:function(){return c1},RasterTileType:function(){return Vh},Satistics:function(){return Ze},Scale:function(){return Sy},ScaleTypes:function(){return Qn},Scene:function(){return VD},SceneConifg:function(){return je},SceneEventList:function(){return dm},SelectControl:function(){return Cv},SizeUnitType:function(){return r1},Source:function(){return gy},SourceTile:function(){return Ie},StencilType:function(){return Tn},StyleScaleType:function(){return Fi},Swipe:function(){return q4},TMap:function(){return CI},TencentMap:function(){return OI},TextureBlend:function(){return uw},TextureUsage:function(){return $},TileDebugLayer:function(){return y4},TileLayer:function(){return Xw},TilesetManager:function(){return nn},UpdateTileStrategy:function(){return ba},Viewport:function(){return Fg},WindLayer:function(){return X4},Zoom:function(){return Y4},aProjectFlat:function(){return vl},amap2Project:function(){return fi},amap2UnProject:function(){return tu},anchorTranslate:function(){return $o},anchorType:function(){return _a},applyAnchorClass:function(){return Fo},bBoxToBounds:function(){return ep},bindAll:function(){return nh},boundsContains:function(){return is},calAngle:function(){return Xc},calDistance:function(){return Mc},calculateCentroid:function(){return Pc},calculatePointsCenterAndRadius:function(){return Xl},createLayerContainer:function(){return cp},createSceneContainer:function(){return jp},decodePickingColor:function(){return Aa},defaultValue:function(){return ho},djb2hash:function(){return lh},encodePickingColor:function(){return Ni},expandUrl:function(){return di},extent:function(){return xu},flow:function(){return wh},formatImage:function(){return Yo},generateCatRamp:function(){return lo},generateColorRamp:function(){return lc},generateCustomRamp:function(){return Os},generateLinearRamp:function(){return Ku},generateQuantizeRamp:function(){return bs},getAngle:function(){return hc},getArrayBuffer:function(){return On},getBBoxFromPoints:function(){return Rc},getCullFace:function(){return Tl},getData:function(){return ia},getDefaultDomain:function(){return Io},getImage:function(){return ns},getJSON:function(){return io},getProtocolAction:function(){return xn},getReferrer:function(){return Kp},getTileIndices:function(){return fe},getTileWarpXY:function(){return ce},getURLFromTemplate:function(){return Di},getWMTSURLFromTemplate:function(){return Ui},gl:function(){return Ee},globalConfigService:function(){return $m},guid:function(){return tp},isAndroid:function(){return yu},isColor:function(){return Sl},isImageBitmap:function(){return gp},isPC:function(){return Ya},isURLTemplate:function(){return Gn},isWorker:function(){return vp},isiOS:function(){return Eh},latitude:function(){return ll},lineAtOffset:function(){return Nh},lineAtOffsetAsyc:function(){return xa},lineStyleType:function(){return eC},lngLatInExtent:function(){return rc},lngLatToMeters:function(){return Qh},lnglatDistance:function(){return bu},lodashUtil:function(){return es},longitude:function(){return Ul},makeXMLHttpRequestPromise:function(){return bn},metersToLngLat:function(){return sh},normalize:function(){return mi},osmLonLat2TileXY:function(){return G},osmTileXY2LonLat:function(){return q},packCircleVertex:function(){return Jt},padBounds:function(){return ai},postData:function(){return Ao},project:function(){return Dp},removeDuplicateUniforms:function(){return du},rgb2arr:function(){return Va},sameOrigin:function(){return Ho},tileToBounds:function(){return te},tranfrormCoord:function(){return Cc},unProjectFlat:function(){return oi},validateLngLat:function(){return Wc},version:function(){return jD}});var ve={};Se.r(ve),Se.d(ve,{DPR:function(){return Ll},addClass:function(){return dl},addStyle:function(){return Fs},appendElementType:function(){return Iu},clearChildren:function(){return Ac},create:function(){return Xo},css2Style:function(){return jc},empty:function(){return vf},findParentElement:function(){return rh},getClass:function(){return Zc},getContainer:function(){return wc},getDiffRect:function(){return $p},getStyleList:function(){return Tc},getViewPortScale:function(){return Fh},hasClass:function(){return bh},printCanvas:function(){return Yp},remove:function(){return au},removeClass:function(){return tc},removeStyle:function(){return Ru},setChecked:function(){return Jh},setClass:function(){return mp},setTransform:function(){return _u},setUnDraggable:function(){return kh},splitWords:function(){return Sc},toggleClass:function(){return Kh},triggerResize:function(){return Vc},trim:function(){return qp}});var Ze={};Se.r(Ze),Se.d(Ze,{getColumn:function(){return qc},getSatByColumn:function(){return Sh},max:function(){return ks},mean:function(){return Du},min:function(){return _l},mode:function(){return zh},statMap:function(){return Su},sum:function(){return pc}});var M={},R={},de=t=>R[t],be=(t,e)=>{R[t]=e},Le=t=>M[t],Re=(t,e)=>{M[t]=e},Ce={},He={},Xe=34,Ke=10,Ve=13;function et(t){return new Function("d","return {"+t.map(function(e,r){return JSON.stringify(e)+": d["+r+'] || ""'}).join(",")+"}")}function er(t,e){var r=et(t);return function(n,a){return e(r(n),a,t)}}function fr(t){var e=Object.create(null),r=[];return t.forEach(function(n){for(var a in n)a in e||r.push(e[a]=a)}),r}function Ar(t,e){var r=t+"",n=r.length;return n9999?"+"+Ar(t,6):Ar(t,4)}function Kn(t){var e=t.getUTCHours(),r=t.getUTCMinutes(),n=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":pn(t.getUTCFullYear(),4)+"-"+Ar(t.getUTCMonth()+1,2)+"-"+Ar(t.getUTCDate(),2)+(a?"T"+Ar(e,2)+":"+Ar(r,2)+":"+Ar(n,2)+"."+Ar(a,3)+"Z":n?"T"+Ar(e,2)+":"+Ar(r,2)+":"+Ar(n,2)+"Z":r||e?"T"+Ar(e,2)+":"+Ar(r,2)+"Z":"")}function Jn(t){var e=new RegExp('["'+t+` \r]`),r=t.charCodeAt(0);function n(Q,ae){var xe,Be,it=a(Q,function(gt,Bt){if(xe)return xe(gt,Bt-1);Be=gt,xe=ae?er(gt,ae):et(gt)});return it.columns=Be||[],it}function a(Q,ae){var xe=[],Be=Q.length,it=0,gt=0,Bt,Rt=Be<=0,Yt=!1;Q.charCodeAt(Be-1)===Ke&&--Be,Q.charCodeAt(Be-1)===Ve&&--Be;function vr(){if(Rt)return He;if(Yt)return Yt=!1,Ce;var cn,Gr=it,Pn;if(Q.charCodeAt(Gr)===Xe){for(;it++=Be?Rt=!0:(Pn=Q.charCodeAt(it++))===Ke?Yt=!0:Pn===Ve&&(Yt=!0,Q.charCodeAt(it)===Ke&&++it),Q.slice(Gr+1,cn-1).replace(/""/g,'"')}for(;it=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r}function qo(t,e){e===void 0&&(e="kilometers");var r=Dt[e];if(!r)throw new Error(e+" units is invalid");return t*r}function ui(t,e){e===void 0&&(e="kilometers");var r=Dt[e];if(!r)throw new Error(e+" units is invalid");return t/r}function Qi(t,e){return Pi(ui(t,e))}function Vi(t){var e=t%360;return e<0&&(e+=360),e}function Pi(t){var e=t%(2*Math.PI);return e*180/Math.PI}function ds(t){var e=t%360;return e*Math.PI/180}function Ur(t,e,r){if(e===void 0&&(e="kilometers"),r===void 0&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return qo(ui(t,e),r)}function ls(t,e,r){if(e===void 0&&(e="meters"),r===void 0&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var n=Pt[e];if(!n)throw new Error("invalid original units");var a=Pt[r];if(!a)throw new Error("invalid final units");return t/n*a}function dr(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function he(t){return!!t&&t.constructor===Object}function We(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(e){if(!dr(e))throw new Error("bbox must only contain numbers")})}function at(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}function Ot(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function or(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Wr(t){if(t.length>1&&isNumber(t[0])&&isNumber(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return Wr(t[0]);throw new Error("coordinates must only contain numbers")}function In(t,e,r){if(!e||!r)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.type)}function kn(t,e,r){if(!t)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!t||t.type!=="Feature"||!t.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.geometry.type)}function eo(t,e,r){if(!t)throw new Error("No featureCollection passed");if(!r)throw new Error(".collectionOf() requires a name");if(!t||t.type!=="FeatureCollection")throw new Error("Invalid input to "+r+", FeatureCollection required");for(var n=0,a=t.features;nO||Be>Z||it>Y){A=Q,O=n,Z=Be,Y=it,u=0;return}var gt=lineString([A,Q],r.properties);if(e(gt,n,a,it,u)===!1)return!1;u++,A=Q})===!1)return!1}}})}function re(t,e,r){var n=r,a=!1;return Ne(t,function(u,y,A,O,Z){a===!1&&r===void 0?n=u:n=e(n,u,y,A,O,Z),a=!0}),n}function le(t,e){if(!t)throw new Error("geojson is required");Us(t,function(r,n,a){if(r.geometry!==null){var u=r.geometry.type,y=r.geometry.coordinates;switch(u){case"LineString":if(e(r,n,a,0,0)===!1)return!1;break;case"Polygon":for(var A=0;Ae in t?Ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sr=(t,e)=>{for(var r in e||(e={}))Ht.call(e,r)&&mr(t,r,e[r]);if(wt)for(var r of wt(e))Fr.call(e,r)&&mr(t,r,e[r]);return t},fn=(t,e)=>Ae(t,Je(e)),xn=t=>je.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))],Lr=class extends Error{constructor(t,e,r,n){super(`AJAXError: ${e} (${t}): ${r}`),this.status=t,this.statusText=e,this.url=r,this.body=n}};function Nn(t,e){const r=new XMLHttpRequest,n=Array.isArray(t.url)?t.url[0]:t.url;r.open(t.method||"GET",n,!0),t.type==="arrayBuffer"&&(r.responseType="arraybuffer");for(const a in t.headers)t.headers.hasOwnProperty(a)&&r.setRequestHeader(a,t.headers[a]);return t.type==="json"&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials=t.credentials==="include",r.onerror=()=>{e(new Error(r.statusText))},r.onload=()=>{if((r.status>=200&&r.status<300||r.status===0)&&r.response!==null){let a=r.response;if(t.type==="json")try{a=JSON.parse(r.response)}catch(u){return e(u)}e(null,a,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"),r)}else{const a=new Blob([r.response],{type:r.getResponseHeader("Content-Type")});e(new Lr(r.status,r.statusText,n.toString(),a))}},r.cancel=r.abort,r.send(t.body),r}function bn(t){return new Promise((e,r)=>{Nn(t,(n,a,u,y,A)=>{n?r({err:n,data:null,xhr:A}):e({err:null,data:a,cacheControl:u,expires:y,xhr:A})})})}function En(t,e){return Nn(t,e)}var io=(t,e)=>(xn(t.url)||En)(fn(Sr({},t),{type:"json"}),e),On=(t,e)=>(xn(t.url)||En)(fn(Sr({},t),{type:"arrayBuffer"}),e),Ao=(t,e)=>En(fn(Sr({},t),{method:"POST"}),e),ia=(t,e)=>En(fn(Sr({},t),{method:"GET"}),e);function Ho(t){const e=window.document.createElement("a");return e.href=t,e.protocol===window.document.location.protocol&&e.host===window.document.location.host}var Ga="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Wo(t,e){const r=new window.Image,n=window.URL||window.webkitURL;r.crossOrigin="anonymous",r.onload=()=>{e(null,r),n.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>{r.src=Ga})},r.onerror=()=>e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const a=new Blob([new Uint8Array(t)],{type:"image/png"});r.src=t.byteLength?n.createObjectURL(a):Ga}function Hl(t,e){const r=new Blob([new Uint8Array(t)],{type:"image/png"});createImageBitmap(r).then(n=>{e(null,n)}).catch(n=>{e(new Error(`Could not load image because of ${n.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}var ns=(t,e,r)=>{const n=(a,u)=>{if(a)e(a);else if(u){const y=typeof createImageBitmap=="function",A=r?r(u):u;y?Hl(A,e):Wo(A,e)}};return t.type==="json"?io(t,n):On(t,n)},Yo=(t,e)=>{typeof createImageBitmap=="function"?Hl(t,e):Wo(t,e)},_a=(t=>(t.CENTER="center",t.TOP="top",t["TOP-LEFT"]="top-left",t["TOP-RIGHT"]="top-right",t.BOTTOM="bottom",t["BOTTOM-LEFT"]="bottom-left",t["BOTTOM-RIGHT"]="bottom-right",t.LEFT="left",t.RIGHT="right",t))(_a||{}),$o={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Fo(t,e,r){const n=t.classList;for(const a in $o)$o.hasOwnProperty(a)&&n.remove(`l7-${r}-anchor-${a}`);n.add(`l7-${r}-anchor-${e}`)}function us(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function xc(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Ba(){}var Fa=.7,sc=1/Fa,Ql="\\s*([+-]?\\d+)\\s*",oa="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zo="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",il=/^#([0-9a-f]{3,8})$/,va=new RegExp("^rgb\\("+[Ql,Ql,Ql]+"\\)$"),El=new RegExp("^rgb\\("+[Zo,Zo,Zo]+"\\)$"),Wa=new RegExp("^rgba\\("+[Ql,Ql,Ql,oa]+"\\)$"),Ds=new RegExp("^rgba\\("+[Zo,Zo,Zo,oa]+"\\)$"),Rl=new RegExp("^hsl\\("+[oa,Zo,Zo]+"\\)$"),gu=new RegExp("^hsla\\("+[oa,Zo,Zo,oa]+"\\)$"),gl={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};us(Ba,Gl,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:wl,formatHex:wl,formatHsl:ol,formatRgb:Qa,toString:Qa});function wl(){return this.rgb().formatHex()}function ol(){return kl(this).formatHsl()}function Qa(){return this.rgb().formatRgb()}function Gl(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=il.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?Wl(e):r===3?new jr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?ut(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?ut(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=va.exec(t))?new jr(e[1],e[2],e[3],1):(e=El.exec(t))?new jr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Wa.exec(t))?ut(e[1],e[2],e[3],e[4]):(e=Ds.exec(t))?ut(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Rl.exec(t))?mn(e[1],e[2]/100,e[3]/100,1):(e=gu.exec(t))?mn(e[1],e[2]/100,e[3]/100,e[4]):gl.hasOwnProperty(t)?Wl(gl[t]):t==="transparent"?new jr(NaN,NaN,NaN,0):null}function Wl(t){return new jr(t>>16&255,t>>8&255,t&255,1)}function ut(t,e,r,n){return n<=0&&(t=e=r=NaN),new jr(t,e,r,n)}function At(t){return t instanceof Ba||(t=Gl(t)),t?(t=t.rgb(),new jr(t.r,t.g,t.b,t.opacity)):new jr}function ir(t,e,r,n){return arguments.length===1?At(t):new jr(t,e,r,n==null?1:n)}function jr(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}us(jr,ir,xc(Ba,{brighter:function(t){return t=t==null?sc:Math.pow(sc,t),new jr(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=t==null?Fa:Math.pow(Fa,t),new jr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Dn,formatHex:Dn,formatRgb:oo,toString:oo}));function Dn(){return"#"+Xa(this.r)+Xa(this.g)+Xa(this.b)}function oo(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(t===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(t===1?")":", "+t+")")}function Xa(t){return t=Math.max(0,Math.min(255,Math.round(t)||0)),(t<16?"0":"")+t.toString(16)}function mn(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Ia(t,e,r,n)}function kl(t){if(t instanceof Ia)return new Ia(t.h,t.s,t.l,t.opacity);if(t instanceof Ba||(t=Gl(t)),!t)return new Ia;if(t instanceof Ia)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,a=Math.min(e,r,n),u=Math.max(e,r,n),y=NaN,A=u-a,O=(u+a)/2;return A?(e===u?y=(r-n)/A+(r0&&O<1?0:y,new Ia(y,A,O,t.opacity)}function Il(t,e,r,n){return arguments.length===1?kl(t):new Ia(t,e,r,n==null?1:n)}function Ia(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}us(Ia,Il,xc(Ba,{brighter:function(t){return t=t==null?sc:Math.pow(sc,t),new Ia(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=t==null?Fa:Math.pow(Fa,t),new Ia(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,a=2*r-n;return new jr(Xh(t>=240?t-240:t+120,a,n),Xh(t,a,n),Xh(t<120?t+240:t-120,a,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(t===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(t===1?")":", "+t+")")}}));function Xh(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}function Sl(t){return typeof t=="string"?!!Gl(t):!1}function Va(t){const e=Gl(t),r=[0,0,0,0];return e!=null&&(r[0]=e.r/255,r[1]=e.g/255,r[2]=e.b/255,r[3]=e.opacity),r}function Aa(t){const e=t&&t[0],r=t&&t[1],n=t&&t[2];return e+r*256+n*65536-1}function Ni(t){return[t+1&255,t+1>>8&255,t+1>>8>>8&255]}function lc(t){let e=window.document.createElement("canvas"),r=e.getContext("2d");e.width=256,e.height=1;let n=null;const a=r.createLinearGradient(0,0,256,1),u=t.positions[0],y=t.positions[t.positions.length-1];for(let A=0;A{const y=Va(t.colors[u]);n.data[a*4+0]=y[0]*255,n.data[a*4+1]=y[1]*255,n.data[a*4+2]=y[2]*255,n.data[a*4+3]=y[3]*255}),e=null,r=null,n}function bs(t){let e=window.document.createElement("canvas"),r=e.getContext("2d");r.globalAlpha=1,e.width=256,e.height=1;const n=256/t.colors.length;for(let y=0;y{t.classList.remove(n)}):mp(t,qp((" "+Zc(t)+" ").replace(" "+e+" "," ")))}function bh(t,e){if(t.classList!==void 0)return t.classList.contains(e);const r=Zc(t);return r.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(r)}function mp(t,e){t instanceof HTMLElement?t.className=e:t.className.baseVal=e}function Kh(t,e,r){r===void 0?bh(t,e)?tc(t,e):dl(t,e):r?dl(t,e):tc(t,e)}function Zc(t){return t instanceof SVGElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}function vf(t){for(;t&&t.firstChild;)t.removeChild(t.firstChild)}var Bh=$h(["transform","WebkitTransform"]);function _u(t,e){t.style[Bh]=e}function Vc(){if(typeof Event=="function")window.dispatchEvent(new Event("resize"));else{const t=window.document.createEvent("UIEvents");t.initUIEvent("resize",!0,!1,window,0),window.dispatchEvent(t)}}function Yp(t){const e=["padding: "+(t.height/2-8)+"px "+t.width/2+"px;","line-height: "+t.height+"px;","background-image: url("+t.toDataURL()+");"];console.log(`%c `,e.join(""))}function Fh(){var t;const e=window.document.querySelector('meta[name="viewport"]');if(!e)return 1;const n=((t=e.content)==null?void 0:t.split(",")).find(a=>{const[u]=a.split("=");return u==="initial-scale"});return n?n.split("=")[1]*1:1}var Ll=Fh()<1?1:window.devicePixelRatio;function Fs(t,e){t.setAttribute("style",`${t.style.cssText}${e}`)}function Tc(t){return t.split(";").map(e=>e.trim()).filter(e=>e)}function Ru(t,e){var r;const n=Tc((r=t.getAttribute("style"))!=null?r:""),a=Tc(e),u=Bs(n,...a);t.setAttribute("style",u.join(";"))}function jc(t){return Object.entries(t).map(([e,r])=>`${e}: ${r}`).join(";")}function $p(t,e){return{left:t.left-e.left,top:t.top-e.top,right:e.left+e.width-t.left-t.width,bottom:e.top+e.height-t.top-t.height}}function Jh(t,e){t.checked=e,e?t.setAttribute("checked","true"):t.removeAttribute("checked")}function Ac(t){t.innerHTML=""}function kh(t){t.setAttribute("draggable","false")}function Iu(t,e){if(typeof e=="string"){const r=document.createElement("div");for(r.innerHTML=e;r.firstChild;)t.append(r.firstChild)}else Array.isArray(e)?t.append(...e):t.append(e)}function rh(t,e){var r;const n=Array.isArray(e)?e:[e];let a=t;for(;a instanceof Element&&a!==window.document.body;){if(n.find(u=>a==null?void 0:a.matches(u)))return a;a=(r=a==null?void 0:a.parentElement)!=null?r:null}}function gp(t){return typeof ImageBitmap!="undefined"&&t instanceof ImageBitmap}function vp(){return typeof importScripts=="function"}var Kp=vp()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,Hc=navigator==null?void 0:navigator.userAgent,Eh=!!Hc.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),yu=Hc.indexOf("Android")>-1||Hc.indexOf("Adr")>-1;function Ya(){const t=Hc,e=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"];let r=!0;for(const n of e)if(t.indexOf(n)>0){r=!1;break}return r}function nh(t,e){t.forEach(r=>{e[r]&&(e[r]=e[r].bind(e))})}var Gc=class{constructor(t=16){this.duration=16,this.timestamp=new Date().getTime(),this.duration=t}run(t){const e=new Date().getTime(),r=e-this.timestamp;this.timestamp=e,r>=this.duration&&t()}};function ih(t){var e=[1/0,1/0,-1/0,-1/0];return Ti(t,function(r){e[0]>r[0]&&(e[0]=r[0]),e[1]>r[1]&&(e[1]=r[1]),e[2]r&&t.lng<=a&&t.lat>n&&t.lat<=u}function xu(t){const e=[1/0,1/0,-1/0,-1/0];return t.forEach(r=>{const{coordinates:n}=r;oh(e,n)}),e}function oh(t,e){return Array.isArray(e[0])?e.forEach(r=>{oh(t,r)}):(t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]ah(r,e)):e(t)}function Qh(t,e=!0,r={enable:!0,decimal:1}){t=Wc(t,e);const n=t[0],a=t[1];let u=n*ku/180,y=Math.log(Math.tan((90+a)*Math.PI/360))/(Math.PI/180);return y=y*ku/180,r.enable&&(u=Number(u.toFixed(r.decimal)),y=Number(y.toFixed(r.decimal))),t.length===3?[u,y,t[2]]:[u,y]}function sh(t,e=6){const r=t[0],n=t[1];let a=r/ku*180,u=n/ku*180;return u=180/Math.PI*(2*Math.atan(Math.exp(u*Math.PI/180))-Math.PI/2),e!=null&&(a=Number(a.toFixed(e)),u=Number(u.toFixed(e))),t.length===3?[a,u,t[2]]:[a,u]}function Ul(t){if(t==null)throw new Error("lng is required");return(t>180||t<-180)&&(t=t%360,t>180&&(t=-360+t),t<-180&&(t=360+t),t===0&&(t=0)),t}function ll(t){if(t==null)throw new Error("lat is required");return(t>90||t<-90)&&(t=t%180,t>90&&(t=-180+t),t<-90&&(t=180+t),t===0&&(t=0)),t}function Wc(t,e){if(e===!1)return t;const r=Ul(t[0]);let n=ll(t[1]);return n>85&&(n=85),n<-85&&(n=-85),t.length===3?[r,n,t[2]]:[r,n]}function vl(t){const e=85.0511287798,r=Math.max(Math.min(e,t[1]),-e),n=256<<20;let a=Math.PI/180,u=t[0]*a,y=r*a;y=Math.log(Math.tan(Math.PI/4+y/2));const A=.5/Math.PI,O=.5,Z=-.5/Math.PI;return a=.5,u=n*(A*u+O),y=n*(Z*y+a),[Math.floor(u),Math.floor(y)]}function oi(t){const e=.5/Math.PI,r=.5,n=-.5/Math.PI;let a=.5;const u=256<<20;let[y,A]=t;y=(y/u-r)/e,A=(A/u-a)/n,A=(Math.atan(Math.pow(Math.E,A))-Math.PI/4)*2,a=Math.PI/180;const O=A/a;return[y/a,O]}function fi(t,e){const r=85.0511287798,n=Math.PI/180,a=6378137;return e=Math.max(Math.min(r,e),-r),t*=n,e*=n,e=Math.log(Math.tan(Math.PI/4+e/2)),[t*a,e*a]}function tu(t,e){const r=Math.PI/180,n=6378137,a=t/n/r,u=2*(Math.atan(Math.exp(e/n))-Math.PI/4)/r;return[a,u]}function bu(t,e,r){const n=ds(e[1]-t[1]),a=ds(e[0]-t[0]),u=ds(t[1]),y=ds(e[1]),A=Math.pow(Math.sin(n/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(u)*Math.cos(y);return qo(2*Math.atan2(Math.sqrt(A),Math.sqrt(1-A)),r="meters")}function Dp(t){const e=Math.PI/180,r=85.0511287798,n=6378137,a=Math.max(Math.min(r,t[1]),-r),u=Math.sin(a*e),y=n*t[0]*e,A=n*Math.log((1+u)/(1-u))/2;return[y,A]}function ai(t,e){const r=Math.abs(t[1][1]-t[0][1])*e,n=Math.abs(t[1][0]-t[0][0])*e;return[[t[0][0]-n,t[0][1]-r],[t[1][0]+n,t[1][1]+r]]}function is(t,e){return t[0][0]<=e[0][0]&&t[0][1]<=e[0][1]&&t[1][0]>=e[1][0]&&t[1][1]>=e[1][1]}function ep(t){return[[t[0],t[1]],[t[2],t[3]]]}function mi(t){const e=Mc(t,[0,0]);return[t[0]/e,t[1]/e]}function Mc(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Op(t,e){return t[0]*e[0]+t[1]*e[1]}function Jp(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Xc(t,e){return Math.acos(Op(t,e)/(Jp(t)*Jp(e)))*180/Math.PI}function hc(t,e){return e[0]>0?e[1]>0?90-Math.atan(e[1]/e[0])*180/Math.PI:90+Math.atan(-e[1]/e[0])*180/Math.PI:e[1]<0?180+(90-Math.atan(e[1]/e[0])*180/Math.PI):270+Math.atan(e[1]/-e[0])*180/Math.PI}function wh(t,e=100){if(!t||t.length<2)return;const r=[0,1];let n=0;const a=[];for(let u=0;u0){const Q=a[u-1].rotation;Q-Y>360-Q+Y&&(Y=Y+360)}a.push({start:y,end:A,dis:O,rotation:Y,duration:0})}return a.map(u=>{u.duration=e*(u.dis/n)}),a}function Pc(t){if(cs(t[0]))return t;if(cs(t[0][0]))throw new Error("\u5F53\u524D\u6570\u636E\u4E0D\u652F\u6301\u6807\u6CE8");if(cs(t[0][0][0])){const e=t;let r=0,n=0,a=0;return e.forEach(u=>{u.forEach(y=>{r+=y[0],n+=y[1],a++})}),[r/a,n/a,0]}else throw new Error("\u5F53\u524D\u6570\u636E\u4E0D\u652F\u6301\u6807\u6CE8")}function Xl(t){let e=t[0],r=t[1],n=t[0],a=t[1],u=0,y=0,A=0;for(let O=0;Oa&&(n=Math.floor(n/137)),n=n*131+t.charCodeAt(u);return n}function lh(t){t=t.toString();let e=5381,r=t.length;for(;r;)e=e*33^t.charCodeAt(--r);return e>>>0}function tp(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var rp=(t=>(t["GAODE1.x"]="GAODE1.x",t["GAODE2.x"]="GAODE2.x",t.MAPBOX="MAPBOX",t.DEFAULT="DEFAUlTMAP",t.SIMPLE="SIMPLE",t.GLOBEL="GLOBEL",t))(rp||{});function su(t,e,r,n,a,u=30,y){let A=r;return y&&(A=Math.round(r*(u-1))/(u-1)),n?hs(t,e,A,n,a):hs(t,e,A,.314,a)}function ql(t,e){const r=1-e;return(t[0]*r+t[1]*e)*r+(t[1]*r+t[2]*e)*e}function fa(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Rs(t,e,r){const n=[e[0]-t[0],e[1]-t[1]],a=fa(n,[0,0]),u=Math.atan2(n[1],n[0]),y=a/2/Math.cos(r),A=u+r;return[y*Math.cos(A)+t[0],y*Math.sin(A)+t[1]]}function hs(t,e,r,n,a){if(a===rp["GAODE2.x"]){const u=fi(t[0],t[1]),y=fi(e[0],e[1]),A=Rs(u,y,n),O=[u[0],A[0],y[0]],Z=[u[1],A[1],y[1]];return[...tu(ql(O,r),ql(Z,r)),0]}else{const u=Rs(t,e,n),y=[t[0],u[0],e[0]],A=[t[1],u[1],e[1]];return[ql(y,r),ql(A,r),0]}}function lu(t,e,r,n,a,u=30,y){let A=r;return y&&(A=Math.round(r*29)/29),Nu(t,e,A,a)}function wu(t,e){const r=[e[0]-t[0],e[1]-t[1]],n=Mc(r,[0,0]),a=Math.atan2(r[1],r[0]),u=.314,y=n/2/Math.cos(u),A=a+u;return[y*Math.cos(A)+t[0],y*Math.sin(A)+t[1]]}function uh(t,e){const r=1-e;return(t[0]*r+t[1]*e)*r+(t[1]*r+t[2]*e)*e}function ch(t,e){const r=[t[0]-e[0],t[1]-e[1]],n=[Math.sin(r[0]/2),Math.sin(r[1]/2)],a=n[1]*n[1]+Math.cos(t[1])*Math.cos(e[1])*n[0]*n[0];return 2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function Nu(t,e,r,n){const a=[ds(t[0]),ds(t[1])],u=[ds(e[0]),ds(e[1])];if(n==="GAODE2.x"){const y=wu(a,u),A=[a[0],y[0],u[0]],O=[a[1],y[1],u[1]];return[uh(A,r),uh(O,r),0]}else{const y=ch(a,u);if(Math.abs(y-Math.PI)<.001)return[(1-r)*a[0]+r*u[0],(1-r)*a[1]+r*u[1]];const A=Math.sin((1-r)*y)/Math.sin(y),O=Math.sin(r*y)/Math.sin(y),Z=[Math.sin(a[0]),Math.sin(a[1])],Y=[Math.cos(a[0]),Math.cos(a[1])],Q=[Math.sin(u[0]),Math.sin(u[1])],ae=[Math.cos(u[0]),Math.cos(u[1])],xe=A*Y[1]*Y[0]+O*ae[1]*ae[0],Be=A*Y[1]*Z[0]+O*ae[1]*Q[0],it=A*Z[1]+O*Q[1];return[Pi(Math.atan2(Be,xe)),Pi(Math.atan2(it,Math.sqrt(xe*xe+Be*Be)))]}}function Qp(t,e){let r=0;const n=[];for(let A=0;Aa){const Z=A.p1,Y=A.p2,Q=(a-A.lastTotalDistance)/A.distance,ae=Gi(Y,Z,Q);u=ae[0],y=ae[1];break}return{lng:u,lat:y,height:0}}function Gi(t,e,r){return[t[0]*r+e[0]*(1-r),t[1]*r+e[1]*(1-r)]}function Si(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}var ji=Object.defineProperty,ao=Object.getOwnPropertySymbols,Ic=Object.prototype.hasOwnProperty,Gs=Object.prototype.propertyIsEnumerable,Lc=(t,e,r)=>e in t?ji(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ul=(t,e)=>{for(var r in e||(e={}))Ic.call(e,r)&&Lc(t,r,e[r]);if(ao)for(var r of ao(e))Gs.call(e,r)&&Lc(t,r,e[r]);return t};function Nh(t,e){const{featureId:r}=e;let n=t.data.dataArray;return typeof r=="number"&&(n=n.filter(({id:a})=>a===r)),n.map(a=>{const u=Al(a,e);return ul(ul({},a),u)})}function xa(t,e){return new Promise(r=>{t.inited?r(Nh(t,e)):t.once("update",()=>{r(Nh(t,e))})})}function Al(t,e){const{offset:r,shape:n,thetaOffset:a,mapVersion:u,segmentNumber:y=30,autoFit:A=!0}=e,{coordinates:O}=t;if(n==="line")return Qp(O,r);const Z=O[0],Y=O[1],Q=typeof a=="string"?t[a]||0:a;let ae;switch(n){case"arc":ae=su;break;case"greatcircle":ae=lu;break;default:ae=su}const[xe,Be,it]=ae(Z,Y,r,Q,u,y,A);return{lng:xe,lat:Be,height:it}}var Lu=class{constructor(t=50,e){this.limit=t,this.destroy=e||this.defaultDestroy,this.order=[],this.clear()}clear(){this.order.forEach(t=>{this.delete(t)}),this.cache={},this.order=[]}get(t){const e=this.cache[t];return e&&(this.deleteOrder(t),this.appendOrder(t)),e}set(t,e){this.cache[t]?(this.delete(t),this.cache[t]=e,this.appendOrder(t)):(Object.keys(this.cache).length===this.limit&&this.delete(this.order[0]),this.cache[t]=e,this.appendOrder(t))}delete(t){const e=this.cache[t];e&&(this.deleteCache(t),this.deleteOrder(t),this.destroy(e,t))}deleteCache(t){delete this.cache[t]}deleteOrder(t){const e=this.order.findIndex(r=>r===t);e>=0&&this.order.splice(e,1)}appendOrder(t){this.order.push(t)}defaultDestroy(t,e){return null}};function ks(t){if(t.length===0)throw new Error("max requires at least one data point");let e=t[0];for(let r=1;re&&(e=t[r]);return e*1}function _l(t){if(t.length===0)throw new Error("min requires at least one data point");let e=t[0];for(let r=1;rn&&(n=a,r=e),a=1,e=t[u]):a++;return r*1}var Su={min:_l,max:ks,mean:Du,sum:pc,mode:zh};function qc(t,e){return t.map(r=>r[e])}function Sh(t,e){return Su[t](e)}function nc(t,e){e===void 0&&(e={});var r=Number(t[0]),n=Number(t[1]),a=Number(t[2]),u=Number(t[3]);if(t.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var y=[r,n],A=[r,u],O=[a,u],Z=[a,n];return Cr([[y,Z,O,A,y]],e.properties,{bbox:t,id:e.id})}var Yl=Se(11312),Th=Se.n(Yl),ba=(t=>(t.Realtime="realtime",t.Overlap="overlap",t.Replace="replace",t))(ba||{}),z=(t=>(t.Loading="Loading",t.Loaded="Loaded",t.Failure="Failure",t.Cancelled="Cancelled",t))(z||{}),s=0,x=1,I=2;function k(t){t.forEach(e=>{e.isCurrent&&(e.isVisible=e.isLoaded)})}function H(t){t.forEach(e=>{e.properties.state=s}),t.forEach(e=>{e.isCurrent&&!ne(e)&&ue(e)}),t.forEach(e=>{e.isVisible=!!(e.properties.state&I)})}function ee(t){t.forEach(r=>{r.properties.state=s}),t.forEach(r=>{r.isCurrent&&ne(r)}),t.slice().sort((r,n)=>r.z-n.z).forEach(r=>{r.isVisible=!!(r.properties.state&I),r.children.length&&(r.isVisible||r.properties.state&x)?r.children.forEach(n=>{n.properties.state=x}):r.isCurrent&&ue(r)})}function ne(t){for(;t;){if(t.isLoaded)return t.properties.state|=I,!0;t=t.parent}return!1}function ue(t){t.children.forEach(e=>{e.isLoaded?e.properties.state|=I:ue(e)})}var _e=256,h=[-1/0,-1/0,1/0,1/0],g=.2,d=5,b={[ba.Realtime]:k,[ba.Overlap]:H,[ba.Replace]:ee},B=()=>{};function G(t,e,r){const n=Math.floor((t+180)/360*Math.pow(2,r)),a=Math.floor((1-Math.log(Math.tan(e*Math.PI/180)+1/Math.cos(e*Math.PI/180))/Math.PI)/2*Math.pow(2,r));return[n,a]}function q(t,e,r){const n=t/Math.pow(2,r)*360-180,a=Math.PI-2*Math.PI*e/Math.pow(2,r),u=180/Math.PI*Math.atan(.5*(Math.exp(a)-Math.exp(-a)));return[n,u]}var te=(t,e,r)=>{const[n,a]=q(t,e,r),[u,y]=q(t+1,e+1,r);return[n,y,u,a]};function fe({zoom:t,latLonBounds:e,maxZoom:r=1/0,minZoom:n=0,zoomOffset:a=0,extent:u=h}){let y=Math.ceil(t)+a;if(Number.isFinite(n)&&yr&&(y=r);const[A,O,Z,Y]=e,Q=[Math.max(A,u[0]),Math.max(O,u[1]),Math.min(Z,u[2]),Math.min(Y,u[3])],ae=[],[xe,Be]=G(Q[0],Q[1],y),[it,gt]=G(Q[2],Q[3],y);for(let vr=xe;vr<=it;vr++)for(let ln=gt;ln<=Be;ln++)ae.push({x:vr,y:ln,z:y});const Bt=(it+xe)/2,Rt=(Be+gt)/2,Yt=(vr,ln)=>Math.abs(vr-Bt)+Math.abs(ln-Rt);return ae.sort((vr,ln)=>Yt(vr.x,vr.y)-Yt(ln.x,ln.y)),ae}var ce=(t,e,r,n=!0)=>{const a=Math.pow(2,r),u=a-1,y=a;let A=t;const O=e;return n&&(A<0?A=A+y:A>u&&(A=A%y)),{warpX:A,warpY:O}},Te=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),Ie=class extends Yl.EventEmitter{constructor(t){super(),this.tileSize=256,this.isVisible=!1,this.isCurrent=!1,this.isVisibleChange=!1,this.loadedLayers=0,this.isLayerLoaded=!1,this.isLoad=!1,this.isChildLoad=!1,this.parent=null,this.children=[],this.data=null,this.properties={},this.loadDataId=0;const{x:e,y:r,z:n,tileSize:a,warp:u=!0}=t;this.x=e,this.y=r,this.z=n,this.warp=u||!0,this.tileSize=a}get isLoading(){return this.loadStatus===z.Loading}get isLoaded(){return this.loadStatus===z.Loaded}get isFailure(){return this.loadStatus===z.Failure}setTileLayerLoaded(){this.isLayerLoaded=!0}get isCancelled(){return this.loadStatus===z.Cancelled}get isDone(){return[z.Loaded,z.Cancelled,z.Failure].includes(this.loadStatus)}get bounds(){return te(this.x,this.y,this.z)}get bboxPolygon(){const[t,e,r,n]=this.bounds,a=[(r-t)/2,(n-e)/2];return nc(this.bounds,{properties:{key:this.key,id:this.key,bbox:this.bounds,center:a,meta:` ${this.key} `}})}get key(){return`${this.x}_${this.y}_${this.z}`}layerLoad(){this.loadedLayers++,this.emit("layerLoaded")}loadData(t){return Te(this,arguments,function*({getData:e,onLoad:r,onError:n}){this.loadDataId++;const a=this.loadDataId;this.isLoading&&this.abortLoad(),this.abortController=new AbortController,this.loadStatus=z.Loading;let u=null,y;try{const{x:A,y:O,z:Z,bounds:Y,tileSize:Q,warp:ae}=this,{warpX:xe,warpY:Be}=ce(A,O,Z,ae),{signal:it}=this.abortController;u=yield e({x:xe,y:Be,z:Z,bounds:Y,tileSize:Q,signal:it,warp:ae},this)}catch(A){y=A}if(a===this.loadDataId&&!(this.isCancelled&&!u)){if(y||!u){this.loadStatus=z.Failure,n(y,this);return}this.loadStatus=z.Loaded,this.data=u,r(this)}})}reloadData(t){this.isLoading&&this.abortLoad(),this.loadData(t)}abortLoad(){this.isLoaded||this.isCancelled||(this.loadStatus=z.Cancelled,this.abortController.abort(),this.xhrCancel&&this.xhrCancel())}},Oe=(t,e)=>{const r=ep(t),n=ai(r,e),a=360*3-180,u=85.0511287798065;return[Math.max(n[0][0],-a),Math.max(n[0][1],-u),Math.min(n[1][0],a),Math.min(n[1][1],u)]},Qe=(t,e)=>{const r=ep(t),n=ep(e);return is(r,n)},nt=Object.defineProperty,ct=Object.defineProperties,tt=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertySymbols,Ut=Object.prototype.hasOwnProperty,Nt=Object.prototype.propertyIsEnumerable,pr=(t,e,r)=>e in t?nt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,tr=(t,e)=>{for(var r in e||(e={}))Ut.call(e,r)&&pr(t,r,e[r]);if(Tt)for(var r of Tt(e))Nt.call(e,r)&&pr(t,r,e[r]);return t},Dr=(t,e)=>ct(t,tt(e)),{throttle:Hr}=es,sn=(t=>(t.TilesLoadStart="tiles-load-start",t.TileLoaded="tile-loaded",t.TileError="tile-error",t.TileUnload="tile-unload",t.TileUpdate="tile-update",t.TilesLoadFinished="tiles-load-finished",t))(sn||{}),nn=class extends Th(){constructor(t){super(),this.currentTiles=[],this.cacheTiles=new Map,this.throttleUpdate=Hr((e,r)=>{this.update(e,r)},16),this.onTileLoad=e=>{this.emit("tile-loaded",e),this.updateTileVisible(),this.loadFinished()},this.onTileError=(e,r)=>{this.emit("tile-error",{error:e,tile:r}),this.updateTileVisible(),this.loadFinished()},this.onTileUnload=e=>{this.emit("tile-unload",e),this.loadFinished()},this.options={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,extent:h,getTileData:B,warp:!0,updateStrategy:ba.Replace},this.updateOptions(t)}get isLoaded(){return this.currentTiles.every(t=>t.isDone)}get tiles(){return Array.from(this.cacheTiles.values()).sort((e,r)=>e.z-r.z)}updateOptions(t){const e=t.minZoom===void 0?this.options.minZoom:Math.ceil(t.minZoom),r=t.maxZoom===void 0?this.options.maxZoom:Math.floor(t.maxZoom);this.options=Dr(tr(tr({},this.options),t),{minZoom:e,maxZoom:r})}update(t,e){const r=Math.max(0,Math.ceil(t));if(this.lastViewStates&&this.lastViewStates.zoom===r&&Qe(this.lastViewStates.latLonBoundsBuffer,e))return;const n=Oe(e,g);this.lastViewStates={zoom:r,latLonBounds:e,latLonBoundsBuffer:n},this.currentZoom=r;let a=!1;const u=this.getTileIndices(r,n).filter(y=>this.options.warp||y.x>=0&&y.x{let Z=this.getTile(y,A,O);return Z?(((Z==null?void 0:Z.isFailure)||(Z==null?void 0:Z.isCancelled))&&Z.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError}),Z):(Z=this.createTile(y,A,O),a=!0,Z)}),a&&this.resizeCacheTiles(),this.updateTileVisible(),this.pruneRequests()}reloadAll(){for(const[t,e]of this.cacheTiles){if(!this.currentTiles.includes(e)){this.cacheTiles.delete(t),this.onTileUnload(e);return}this.onTileUnload(e),e.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError})}}reloadTileById(t,e,r){const n=this.cacheTiles.get(`${e},${r},${t}`);n&&(this.onTileUnload(n),n.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError}))}reloadTileByLnglat(t,e,r){const n=this.getTileByLngLat(t,e,r);n&&this.reloadTileById(n.z,n.x,n.y)}reloadTileByExtent(t,e){this.getTileIndices(e,t).forEach(n=>{this.reloadTileById(n.z,n.x,n.y)})}pruneRequests(){const t=[];for(const e of this.cacheTiles.values())e.isLoading&&!e.isCurrent&&!e.isVisible&&t.push(e);for(;t.length>0;)t.shift().abortLoad()}getTileByLngLat(t,e,r){const{zoomOffset:n}=this.options,a=Math.ceil(r)+n,u=G(t,e,a);return this.tiles.filter(A=>A.key===`${u[0]}_${u[1]}_${a}`)[0]}getTileExtent(t,e){return this.getTileIndices(e,t)}getTileByZXY(t,e,r){return this.tiles.filter(a=>a.key===`${e}_${r}_${t}`)[0]}clear(){for(const t of this.cacheTiles.values())t.isLoading?t.abortLoad():this.onTileUnload(t);this.lastViewStates=void 0,this.cacheTiles.clear(),this.currentTiles=[]}destroy(){this.clear(),this.removeAllListeners()}updateTileVisible(){const t=this.options.updateStrategy,e=new Map;for(const a of this.cacheTiles.values())e.set(a.key,a.isVisible),a.isCurrent=!1,a.isVisible=!1;for(const a of this.currentTiles)a.isCurrent=!0,a.isVisible=!0;const r=Array.from(this.cacheTiles.values());typeof t=="function"?t(r):b[t](r);let n=!1;Array.from(this.cacheTiles.values()).forEach(a=>{a.isVisible!==e.get(a.key)?(a.isVisibleChange=!0,n=!0):a.isVisibleChange=!1}),n&&this.emit("tile-update")}getTileIndices(t,e){const{tileSize:r,extent:n,zoomOffset:a}=this.options,u=Math.floor(this.options.maxZoom),y=Math.ceil(this.options.minZoom);return fe({maxZoom:u,minZoom:y,zoomOffset:a,tileSize:r,zoom:t,latLonBounds:e,extent:n})}getTileId(t,e,r){return`${t},${e},${r}`}loadFinished(){const t=!this.currentTiles.some(e=>!e.isDone);return t&&this.emit("tiles-load-finished"),t}getTile(t,e,r){const n=this.getTileId(t,e,r);return this.cacheTiles.get(n)}createTile(t,e,r){const n=this.getTileId(t,e,r),a=new Ie({x:t,y:e,z:r,tileSize:this.options.tileSize,warp:this.options.warp});return this.cacheTiles.set(n,a),a.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError}),a}resizeCacheTiles(){const t=d*this.currentTiles.length;if(this.cacheTiles.size>t){for(const[r,n]of this.cacheTiles)if(!n.isVisible&&!this.currentTiles.includes(n)&&(this.cacheTiles.delete(r),this.onTileUnload(n)),this.cacheTiles.size<=t)break}this.rebuildTileTree()}rebuildTileTree(){for(const t of this.cacheTiles.values())t.parent=null,t.children.length=0;for(const t of this.cacheTiles.values()){const e=this.getNearestAncestor(t.x,t.y,t.z);t.parent=e,e!=null&&e.children&&e.children.push(t)}}getNearestAncestor(t,e,r){for(;r>this.options.minZoom;){t=Math.floor(t/2),e=Math.floor(e/2),r=r-1;const n=this.getTile(t,e,r);if(n)return n}return null}};function Gn(t){return/(?=.*{box})(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(t)}function di(t){const e=[];let r=/\{([a-z])-([a-z])\}/.exec(t);if(r){const n=r[1].charCodeAt(0),a=r[2].charCodeAt(0);let u;for(u=n;u<=a;++u)e.push(t.replace(r[0],String.fromCharCode(u)));return e}if(r=/\{(\d+)-(\d+)\}/.exec(t),r){const n=parseInt(r[2],10);for(let a=parseInt(r[1],10);a<=n;a++)e.push(t.replace(r[0],a.toString()));return e}return e.push(t),e}function Di(t,e){if(!t||!t.length)throw new Error("url is not allowed to be empty");const{x:r,y:n,z:a}=e,u=di(t),y=Math.abs(r+n)%u.length;return(xn(u[y])?`${u[y]}/{z}/{x}/{y}`:u[y]).replace(/\{x\}/g,r.toString()).replace(/\{y\}/g,n.toString()).replace(/\{z\}/g,a.toString()).replace(/\{bbox\}/g,te(r,n,a).join(",")).replace(/\{-y\}/g,(Math.pow(2,a)-n-1).toString())}function Ui(t,e){const{x:r,y:n,z:a,layer:u,version:y="1.0.0",style:A="default",format:O,service:Z="WMTS",tileMatrixset:Y}=e,Q=di(t),ae=Math.abs(r+n)%Q.length;return`${Q[ae]}&SERVICE=${Z}&REQUEST=GetTile&VERSION=${y}&LAYER=${u}&STYLE=${A}&TILEMATRIXSET=${Y}&FORMAT=${O}&TILECOL=${r}&TILEROW=${n}&TILEMATRIX=${a}`}function ho(t,e){return t==null?e:t}var gi=Se(47903),Wi=Se.n(gi);function Ko(t,e){return t.map(r=>r[e]*1)}function Mo(t){return t===void 0?!1:!Array.isArray(t)&&t.data!==void 0}function mo(t){return Array.isArray(t)?t.length===0?!1:!!Mo(t[0]):!1}function ko(t){return Array.isArray(t)?t.length===0||typeof t[0]=="number":!1}function xo(t){const e=Object.isFrozen(t)?es.cloneDeep(t):t;return Wi()(e,!0),e}function qi(t,e){return t||[[e[0],e[3]],[e[2],e[3]],[e[2],e[1]],[e[0],e[1]]]}var xs=Object.defineProperty,gs=Object.defineProperties,Cl=Object.getOwnPropertyDescriptors,ts=Object.getOwnPropertySymbols,ja=Object.prototype.hasOwnProperty,$a=Object.prototype.propertyIsEnumerable,vs=(t,e,r)=>e in t?xs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zl=(t,e)=>{for(var r in e||(e={}))ja.call(e,r)&&vs(t,r,e[r]);if(ts)for(var r of ts(e))$a.call(e,r)&&vs(t,r,e[r]);return t},zu=(t,e)=>gs(t,Cl(e));function Uu(t,e){const{x:r,y:n,x1:a,y1:u,coordinates:y,geometry:A}=e,O=[];if(!Array.isArray(t))return{dataArray:[]};if(A)return t.filter(Z=>Z[A]&&Z[A].type&&Z[A].coordinates&&Z[A].coordinates.length>0).forEach((Z,Y)=>{const Q=xo(Z[A]);Us(Q,ae=>{const xe=or(ae),Be=zu(Zl({},Z),{_id:Y,coordinates:xe});O.push(Be)})}),{dataArray:O};for(let Z=0;Ze in t?Yc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Uh=(t,e)=>{for(var r in e||(e={}))Zu.call(e,r)&&Vl(t,r,e[r]);if(Tu)for(var r of Tu(e))Dl.call(e,r)&&Vl(t,r,e[r]);return t},ml=(t,e)=>np(t,pu(e));function $l(t){const e=t.toString();let r=5381,n=e.length;for(;n;)r=r*33^e.charCodeAt(--n);return r>>>0}function Vu(t,e){return e===void 0?null:typeof(t.properties[e]*1)=="number"?t.properties[e]*1:t.properties&&t.properties[e]?$l(t.properties[e]+"")%1000019:null}function Ws(t,e){const r=[],n={};return t.features?(t.features=t.features.filter(a=>{const u=a.geometry;return a!=null&&u&&u.type&&u.coordinates&&u.coordinates.length>0}),t=xo(t),t.features.length===0?{dataArray:[],featureKeys:n}:(Us(t,(a,u)=>{let y=Vu(a,e==null?void 0:e.featureId);y===null&&(y=u);const A=y,O=or(a),Z=ml(Uh({},a.properties),{coordinates:O,_id:A});r.push(Z)}),{dataArray:r,featureKeys:n})):(t.features=[],{dataArray:[]})}function ju(t,e,r,n){for(var a=n,u=r-e>>1,y=r-e,A,O=t[e],Z=t[e+1],Y=t[r],Q=t[r+1],ae=e+3;aea)A=ae,a=xe;else if(xe===a){var Be=Math.abs(ae-u);Ben&&(A-e>3&&ju(t,e,A,n),t[A+2]=a,r-A>3&&ju(t,A,r,n))}function os(t,e,r,n,a,u){var y=a-r,A=u-n;if(y!==0||A!==0){var O=((t-r)*y+(e-n)*A)/(y*y+A*A);O>1?(r=a,n=u):O>0&&(r+=y*O,n+=A*O)}return y=t-r,A=e-n,y*y+A*A}function yl(t,e,r,n){var a={id:typeof t=="undefined"?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Ol(a),a}function Ol(t){var e=t.geometry,r=t.type;if(r==="Point"||r==="MultiPoint"||r==="LineString")ph(t,e);else if(r==="Polygon"||r==="MultiLineString")for(var n=0;n0&&(n?y+=(a*Z-O*u)/2:y+=Math.sqrt(Math.pow(O-a,2)+Math.pow(Z-u,2))),a=O,u=Z}var Y=e.length-3;e[2]=1,ju(e,0,Y,r),e[Y+2]=1,e.size=Math.abs(y),e.start=0,e.end=e.size}function Bp(t,e,r,n){for(var a=0;a1?1:r}function op(t,e,r,n,a,u,y,A){if(r/=e,n/=e,u>=r&&y=n)return null;for(var O=[],Z=0;Z=r&&Be=n)continue;var it=[];if(ae==="Point"||ae==="MultiPoint")ef(Q,it,r,n,a);else if(ae==="LineString")_s(Q,it,r,n,a,!1,A.lineMetrics);else if(ae==="MultiLineString")sd(Q,it,r,n,a,!1);else if(ae==="Polygon")sd(Q,it,r,n,a,!0);else if(ae==="MultiPolygon")for(var gt=0;gt=r&&y<=n&&(e.push(t[u]),e.push(t[u+1]),e.push(t[u+2]))}}function _s(t,e,r,n,a,u,y){for(var A=Ff(t),O=a===0?_d:ld,Z=t.start,Y,Q,ae=0;aer&&(Q=O(A,xe,Be,gt,Bt,r),y&&(A.start=Z+Y*Q)):Rt>n?Yt=r&&(Q=O(A,xe,Be,gt,Bt,r),vr=!0),Yt>n&&Rt<=n&&(Q=O(A,xe,Be,gt,Bt,n),vr=!0),!u&&vr&&(y&&(A.end=Z+Y*Q),e.push(A),A=Ff(t)),y&&(Z+=Y)}var ln=t.length-3;xe=t[ln],Be=t[ln+1],it=t[ln+2],Rt=a===0?xe:Be,Rt>=r&&Rt<=n&&fh(A,xe,Be,it),ln=A.length-3,u&&ln>=3&&(A[ln]!==A[0]||A[ln+1]!==A[1])&&fh(A,A[0],A[1],A[2]),A.length&&e.push(A)}function Ff(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function sd(t,e,r,n,a,u){for(var y=0;yy.maxX&&(y.maxX=Y),Q>y.maxY&&(y.maxY=Q)}return y}function ud(t,e,r,n){var a=e.geometry,u=e.type,y=[];if(u==="Point"||u==="MultiPoint")for(var A=0;A0&&e.size<(a?y:n)){r.numPoints+=e.length/3;return}for(var A=[],O=0;Oy)&&(r.numSimplified++,A.push(e[O]),A.push(e[O+1])),r.numPoints++;a&&Dd(A,u),t.push(A)}function Dd(t,e){for(var r=0,n=0,a=t.length,u=a-2;n0===e)for(n=0,a=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=_f(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=ym(n,e),n.length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}Kl.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Kl.prototype.splitTile=function(t,e,r,n,a,u,y){for(var A=[t,e,r,n],O=this.options,Z=O.debug;A.length;){n=A.pop(),r=A.pop(),e=A.pop(),t=A.pop();var Y=1<1&&console.time("creation"),ae=this.tiles[Q]=tf(t,e,r,n,O),this.tileCoords.push({z:e,x:r,y:n}),Z)){Z>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,ae.numFeatures,ae.numPoints,ae.numSimplified),console.timeEnd("creation"));var xe="z"+e;this.stats[xe]=(this.stats[xe]||0)+1,this.total++}if(ae.source=t,a){if(e===O.maxZoom||e===a)continue;var Be=1<1&&console.time("clipping");var it=.5*O.buffer/O.extent,gt=.5-it,Bt=.5+it,Rt=1+it,Yt,vr,ln,cn,Gr,Pn;Yt=vr=ln=cn=null,Gr=op(t,Y,r-it,r+Bt,0,ae.minX,ae.maxX,O),Pn=op(t,Y,r+gt,r+Rt,0,ae.minX,ae.maxX,O),t=null,Gr&&(Yt=op(Gr,Y,n-it,n+Bt,1,ae.minY,ae.maxY,O),vr=op(Gr,Y,n+gt,n+Rt,1,ae.minY,ae.maxY,O),Gr=null),Pn&&(ln=op(Pn,Y,n-it,n+Bt,1,ae.minY,ae.maxY,O),cn=op(Pn,Y,n+gt,n+Rt,1,ae.minY,ae.maxY,O),Pn=null),Z>1&&console.timeEnd("clipping"),A.push(Yt||[],e+1,r*2,n*2),A.push(vr||[],e+1,r*2,n*2+1),A.push(ln||[],e+1,r*2+1,n*2),A.push(cn||[],e+1,r*2+1,n*2+1)}}},Kl.prototype.getTile=function(t,e,r){var n=this.options,a=n.extent,u=n.debug;if(t<0||t>24)return null;var y=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var O=t,Z=e,Y=r,Q;!Q&&O>0;)O--,Z=Math.floor(Z/2),Y=Math.floor(Y/2),Q=this.tiles[Od(O,Z,Y)];return!Q||!Q.source?null:(u>1&&console.log("found parent tile z%d-%d-%d",O,Z,Y),u>1&&console.time("drilling down"),this.splitTile(Q.source,O,Z,Y,t,e,r),u>1&&console.timeEnd("drilling down"),this.tiles[A]?Gu(this.tiles[A],a):null)};function Od(t,e,r){return((1<e in t?wp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sp=(t,e)=>{for(var r in e||(e={}))xl.call(e,r)&&Fp(t,r,e[r]);if(kf)for(var r of kf(e))dc.call(e,r)&&Fp(t,r,e[r]);return t},rf=(t,e)=>$f(t,ap(e)),nf=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),Nf={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0};function zf(t){let e=0;for(let r=0,n=t.length,a=n-1,u,y;rnf(void 0,null,function*(){return new Promise(a=>{const u=e.getTile(t.z,t.x,t.y),A={layers:{defaultLayer:{features:u?u.features.map(Z=>kp(n,r.x,r.y,r.z,Z)):[]}}},O=new bf(A,t.x,t.y,t.z);a(O)})});function Dc(t){const e={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!0,debug:0};return t===void 0||typeof t.geojsonvtOptions=="undefined"?e:Sp(Sp({},e),t.geojsonvtOptions)}function _p(t,e){const r=Dc(e),n=r.extent||4096,a=Yf(t,r),u=(A,O)=>yd(O,a,A,n),y=rf(Sp(Sp({},Nf),e),{getTileData:u});return{data:t,dataArray:[],tilesetOptions:y,isTile:!0}}var Kf=Object.defineProperty,xd=Object.defineProperties,bd=Object.getOwnPropertyDescriptors,Ed=Object.getOwnPropertySymbols,Tp=Object.prototype.hasOwnProperty,Ef=Object.prototype.propertyIsEnumerable,wd=(t,e,r)=>e in t?Kf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cd=(t,e)=>{for(var r in e||(e={}))Tp.call(e,r)&&wd(t,r,e[r]);if(Ed)for(var r of Ed(e))Ef.call(e,r)&&wd(t,r,e[r]);return t},hd=(t,e)=>xd(t,bd(e));function Uf(t,e){const{extent:r=[121.168,30.2828,121.384,30.4219],coordinates:n,requestParameters:a={}}=e,u=new Promise(O=>{t instanceof HTMLImageElement||gp(t)?O([t]):sf(t,a,Z=>{O(Z)})}),y=qi(n,r);return{originData:t,images:u,_id:1,dataArray:[{_id:0,coordinates:y}]}}function sf(t,e,r){const n=[];if(typeof t=="string")ns(hd(cd({},e),{url:t}),(a,u)=>{u&&(n.push(u),r(n))});else{const a=t.length;let u=0;t.forEach(y=>{ns(hd(cd({},e),{url:y}),(A,O)=>{u++,O&&n.push(O),u===a&&r(n)})})}return Uf}var Ou=Object.defineProperty,Zh=Object.defineProperties,lf=Object.getOwnPropertyDescriptors,Ah=Object.getOwnPropertySymbols,Np=Object.prototype.hasOwnProperty,pd=Object.prototype.propertyIsEnumerable,yp=(t,e,r)=>e in t?Ou(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zf=(t,e)=>{for(var r in e||(e={}))Np.call(e,r)&&yp(t,r,e[r]);if(Ah)for(var r of Ah(e))pd.call(e,r)&&yp(t,r,e[r]);return t},zp=(t,e)=>Zh(t,lf(e)),Oc=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),Wu=(t,e,r,n)=>Oc(void 0,null,function*(){const a={x:e.x,y:e.y,z:e.z},u=Di(t,a);return new Promise(y=>{n?n(a,(A,O)=>{if(A||!O){const Z={layers:{defaultLayer:{features:[]}}},Y=new bf(Z,e.x,e.y,e.z);y(Y)}else{const Z={layers:{defaultLayer:{features:O.features}}},Y=new bf(Z,e.x,e.y,e.z);y(Y)}}):ia(zp(Zf({},r),{url:u}),(A,O)=>{if(A||!O){const Z={layers:{defaultLayer:{features:[]}}},Y=new bf(Z,e.x,e.y,e.z);y(Y)}else{const Y={layers:{defaultLayer:{features:JSON.parse(O)}}},Q=new bf(Y,e.x,e.y,e.z);y(Q)}})})});function Au(t,e){const r=(a,u)=>Wu(t,u,e==null?void 0:e.requestParameters,e.getCustomData),n=zp(Zf({},e),{getTileData:r});return{dataArray:[],tilesetOptions:n,isTile:!0}}var dh=Se(99996),rm=Se(63713),Ap=Se.n(rm),nm=Object.defineProperty,Fd=Object.defineProperties,xm=Object.getOwnPropertyDescriptors,Jf=Object.getOwnPropertySymbols,kd=Object.prototype.hasOwnProperty,fd=Object.prototype.propertyIsEnumerable,Bc=(t,e,r)=>e in t?nm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,im=(t,e)=>{for(var r in e||(e={}))kd.call(e,r)&&Bc(t,r,e[r]);if(Jf)for(var r of Jf(e))fd.call(e,r)&&Bc(t,r,e[r]);return t},om=(t,e)=>Fd(t,xm(e)),Nd=class{constructor(t,e,r,n){this.vectorLayerCache={},this.x=e,this.y=r,this.z=n,this.vectorTile=new dh.VectorTile(new(Ap())(t))}getTileData(t){if(!t||!this.vectorTile.layers[t])return[];if(this.vectorLayerCache[t])return this.vectorLayerCache[t];const e=this.vectorTile.layers[t];if(Array.isArray(e.features))return this.vectorLayerCache[t]=e.features,e.features;const r=[];for(let n=0;ne in t?am(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_t=(t,e)=>{for(var r in e||(e={}))zd.call(e,r)&&Pe(t,r,e[r]);if(cl)for(var r of cl(e))Fc.call(e,r)&&Pe(t,r,e[r]);return t},Zt=(t,e)=>uf(t,Qf(e)),qr=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),wn={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,warp:!0},Yr=(t,e,r,n,a)=>qr(void 0,null,function*(){const u=Di(t,e);return new Promise(y=>{if(a)a({x:r.x,y:r.y,z:r.z},(A,O)=>{if(A||!O)y(void 0);else{const Z=new Nd(O,r.x,r.y,r.z);y(Z)}});else{const A=On(Zt(_t({},n),{url:u}),(O,Z)=>{if(O||!Z)y(void 0);else{const Y=new Nd(Z,r.x,r.y,r.z);y(Y)}});r.xhrCancel=()=>A.cancel()}})});function Or(t,e){const r=Array.isArray(t)?t[0]:t,n=(u,y)=>Yr(r,u,y,e==null?void 0:e.requestParameters,e==null?void 0:e.getCustomData),a=Zt(_t(_t({},wn),e),{getTileData:n});return{data:r,dataArray:[],tilesetOptions:a,isTile:!0}}function Wn(t,e,r){switch(t){case"+":return e+r;case"-":return e-r;case"*":return e*r;case"/":return e/r;case"%":return e%r;case"^":return Math.pow(e,r);case"abs":return Math.abs(e);case"floor":return Math.floor(e);case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"sin":return Math.sin(e);case"cos":return Math.cos(e);case"atan":return r===-1?Math.atan(e):Math.atan2(e,r);case"min":return Math.min(e,r);case"max":return Math.max(e,r);case"log10":return Math.log(e);case"log2":return Math.log2(e);default:return console.warn("Calculate symbol err! Return default 0"),0}}function Bn(t,e){const{width:r,height:n}=e[0],a=e.map(O=>O.rasterData),u=r*n,y=[],A=JSON.stringify(t);for(let O=0;O{if(Array.isArray(n)&&n.length>0)switch(n[0]){case"band":try{t[a]=e[n[1]][r]}catch(u){console.warn("Raster Data err!"),t[a]=0}break;default:si(n,e,r)}})}function Hn(t){const[e,r=-1,n=-1]=t;return e===void 0?(console.warn("Express err!"),["+",0,0]):[e.replace(/\s+/g,""),r,n]}function qn(t){const e=Hn(t),r=e[0];let n=e[1],a=e[2];return Array.isArray(n)&&(n=qn(t[1])),Array.isArray(a)&&(a=qn(t[2])),Wn(r,n,a)}var ci={nd:{type:"operation",expression:["/",["-",["band",1],["band",0]],["+",["band",1],["band",0]]]},rgb:{type:"function",method:Vn}};function Vn(t,e){const r=t[0].rasterData,n=t[1].rasterData,a=t[2].rasterData,u=[],[y,A]=(e==null?void 0:e.countCut)||[2,98],O=(e==null?void 0:e.RMinMax)||Yn(r,y,A),Z=(e==null?void 0:e.GMinMax)||Yn(n,y,A),Y=(e==null?void 0:e.BMinMax)||Yn(a,y,A);for(let Q=0;QA-O),a=n.length,u=n[Math.ceil(a*e/100)],y=n[Math.ceil(a*r/100)];return[u,y]}var Tr=Object.defineProperty,en=Object.defineProperties,Xn=Object.getOwnPropertyDescriptors,_i=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,xi=Object.prototype.propertyIsEnumerable,Un=(t,e,r)=>e in t?Tr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Oi=(t,e)=>{for(var r in e||(e={}))Rn.call(e,r)&&Un(t,r,e[r]);if(_i)for(var r of _i(e))xi.call(e,r)&&Un(t,r,e[r]);return t},Ln=(t,e)=>en(t,Xn(e)),wi=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())});function Po(t,e,r){return wi(this,null,function*(){if(t.length===0)return{rasterData:[0],width:1,heigh:1};const n=yield Promise.all(t.map(({data:O,bands:Z=[0]})=>e(O,Z))),a=[];n.forEach(O=>{Array.isArray(O)?a.push(...O):a.push(O)});const{width:u,height:y}=a[0];let A;switch(typeof r){case"function":A=r(a);break;case"object":Array.isArray(r)?A={rasterData:Bn(r,a)}:A=da(r,a);break;default:A={rasterData:a[0].rasterData}}return Ln(Oi({},A),{width:u,height:y})})}function da(t,e){const r=ci[t.type];if(r.type==="function")return r.method(e,t==null?void 0:t.options);if(r.type==="operation")return t.type==="rgb"?bi(r.expression,e):{rasterData:Bn(r.expression,e)}}function bi(t,e){t.r===void 0&&console.warn("Channel R lost in Operation! Use band[0] to fill!"),t.g===void 0&&console.warn("Channel G lost in Operation! Use band[0] to fill!"),t.b===void 0&&console.warn("Channel B lost in Operation! Use band[0] to fill!");const r=Bn(t.r||["band",0],e),n=Bn(t.g||["band",0],e),a=Bn(t.b||["band",0],e);return[r,n,a]}function Zn(t,e,r,n){return wi(this,null,function*(){const a=yield Po(t,e,r);n(null,{data:a})})}function Sn(t,e){const{extent:r=[121.168,30.2828,121.384,30.4219],coordinates:n,width:a,height:u,min:y,max:A,format:O,operation:Z}=e;let Y,Q,ae;if(O===void 0||ko(t))Y=Array.from(t),Q=a,ae=u;else{const it=Array.isArray(t)?t:[t];Y=Po(it,O,Z)}const xe=qi(n,r);return{_id:1,dataArray:[{_id:1,data:Y,width:Q,height:ae,min:y,max:A,coordinates:xe}]}}var Wt=Se(88351),K=Se(40749);let Ei=function(t){return t.Normal="normal",t.PostProcessing="post-processing",t}({}),Ee=function(t){return t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.CULL_FACE=2884]="CULL_FACE",t[t.BLEND=3042]="BLEND",t[t.DITHER=3024]="DITHER",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.RED=6403]="RED",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.TEXTURE1=33985]="TEXTURE1",t[t.TEXTURE2=33986]="TEXTURE2",t[t.TEXTURE3=33987]="TEXTURE3",t[t.TEXTURE4=33988]="TEXTURE4",t[t.TEXTURE5=33989]="TEXTURE5",t[t.TEXTURE6=33990]="TEXTURE6",t[t.TEXTURE7=33991]="TEXTURE7",t[t.TEXTURE8=33992]="TEXTURE8",t[t.TEXTURE9=33993]="TEXTURE9",t[t.TEXTURE10=33994]="TEXTURE10",t[t.TEXTURE11=33995]="TEXTURE11",t[t.TEXTURE12=33996]="TEXTURE12",t[t.TEXTURE13=33997]="TEXTURE13",t[t.TEXTURE14=33998]="TEXTURE14",t[t.TEXTURE15=33999]="TEXTURE15",t[t.TEXTURE16=34e3]="TEXTURE16",t[t.TEXTURE17=34001]="TEXTURE17",t[t.TEXTURE18=34002]="TEXTURE18",t[t.TEXTURE19=34003]="TEXTURE19",t[t.TEXTURE20=34004]="TEXTURE20",t[t.TEXTURE21=34005]="TEXTURE21",t[t.TEXTURE22=34006]="TEXTURE22",t[t.TEXTURE23=34007]="TEXTURE23",t[t.TEXTURE24=34008]="TEXTURE24",t[t.TEXTURE25=34009]="TEXTURE25",t[t.TEXTURE26=34010]="TEXTURE26",t[t.TEXTURE27=34011]="TEXTURE27",t[t.TEXTURE28=34012]="TEXTURE28",t[t.TEXTURE29=34013]="TEXTURE29",t[t.TEXTURE30=34014]="TEXTURE30",t[t.TEXTURE31=34015]="TEXTURE31",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t}({});const sa=`attribute vec2 a_Position; varying vec2 v_UV; void main() { v_UV = 0.5 * (a_Position + 1.0); gl_Position = vec4(a_Position, 0., 1.); }`,{camelCase:Jo,isNil:Es,upperFirst:Cu}=es;class Bl{constructor(){(0,K.Z)(this,"shaderModuleService",void 0),(0,K.Z)(this,"rendererService",void 0),(0,K.Z)(this,"config",void 0),(0,K.Z)(this,"quad",sa),(0,K.Z)(this,"enabled",!0),(0,K.Z)(this,"renderToScreen",!1),(0,K.Z)(this,"model",void 0),(0,K.Z)(this,"name",void 0),(0,K.Z)(this,"optionsToUpdate",{})}getName(){return this.name}setName(e){this.name=e}getType(){return Ei.PostProcessing}init(e,r){this.config=r,this.rendererService=e.getContainer().rendererService,this.shaderModuleService=e.getContainer().shaderModuleService;const{createAttribute:n,createBuffer:a,createModel:u}=this.rendererService,{vs:y,fs:A,uniforms:O}=this.setupShaders();this.model=u({vs:y,fs:A,attributes:{a_Position:n({buffer:a({data:[-4,-4,4,-4,0,4],type:Ee.FLOAT}),size:2})},uniforms:(0,Wt.Z)((0,Wt.Z)({u_Texture:null},O),this.config&&this.convertOptionsToUniforms(this.config)),depth:{enable:!1},count:3,blend:{enable:this.getName()==="copy"}})}render(e,r){const n=e.multiPassRenderer.getPostProcessor(),{useFramebuffer:a,getViewportSize:u,clear:y}=this.rendererService,{width:A,height:O}=u();a(this.renderToScreen?null:n.getWriteFBO(),()=>{y({framebuffer:n.getWriteFBO(),color:[0,0,0,0],depth:1,stencil:0});const Z=(0,Wt.Z)({u_BloomFinal:0,u_Texture:n.getReadFBO(),u_ViewportSize:[A,O]},this.convertOptionsToUniforms(this.optionsToUpdate));r&&(Z.u_BloomFinal=1,Z.u_Texture2=r),this.model.draw({uniforms:Z})})}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}setRenderToScreen(e){this.renderToScreen=e}updateOptions(e){this.optionsToUpdate=(0,Wt.Z)((0,Wt.Z)({},this.optionsToUpdate),e)}setupShaders(){throw new Error("Method not implemented.")}convertOptionsToUniforms(e){const r={};return Object.keys(e).forEach(n=>{Es(e[n])||(r[`u_${Cu(Jo(n))}`]=e[n])}),r}}function as(t){let e=0;switch(t){case"vec2":case"ivec2":e=2;break;case"vec3":case"ivec3":e=3;break;case"vec4":case"ivec4":case"mat2":e=4;break;case"mat3":e=9;break;case"mat4":e=16;break;default:}return e}const fu=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function Js(t,e=!1){const r={};return t=t.replace(fu,(n,a,u)=>{const y=u.split(":"),A=y[0].trim();let O="";switch(y.length>1&&(O=y[1].trim()),a){case"bool":O=O==="true";break;case"float":case"int":O=Number(O);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":O?O=O.replace("[","").replace("]","").split(",").reduce((Z,Y)=>(Z.push(Number(Y.trim())),Z),[]):O=new Array(as(a)).fill(0);break;default:}return r[A]=O,`${e?"uniform ":""}${a} ${A}; `}),{content:t,uniforms:r}}function ps(t){let{content:e,uniforms:r}=Js(t,!0);return e=e.replace(/(\s*uniform\s*.*\s*){((?:\s*.*\s*)*?)};/g,(n,a,u)=>{u=u.trim().replace(/^.*$/gm,O=>`uniform ${O}`);const{content:y,uniforms:A}=Js(u);return Object.assign(r,A),`${a}{ ${y} };`}),{content:e,uniforms:r}}function du(t){const e={};return t.replace(fu,(r,n,a)=>{const u=a.trim();return e[u]?"":(e[u]=!0,`uniform ${n} ${u}; `)})}const ru=["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"];function uu(t){return ru.indexOf(t)}const{clamp:za}=es,Mu=2,Ca=4,mu=64,ss=128,go=256,ya=512,Qo=8192,Qs=16384,Cp=32768,Ft=null,Xr=131072,Mr=262144,Bi=524288,Ma=1048576,el=2097152,st=4194304,Et=8388608,Vt=16777216,Br=null;function Ir(t,e){return t=za(Math.floor(t),0,255),e=za(Math.floor(e),0,255),256*t+e}function Jt(t){const{color:e,radius:r,tileX:n,tileY:a,shape:u,opacity:y,stroke:A,strokeWidth:O,strokeOpacity:Z}=t,Y=[],Q=[],ae=[],xe=[Ir(e[0],e[1]),Ir(e[2],e[3])],Be=[Ir(A[0],A[1]),Ir(A[2],A[3])];return[[-1,-1],[1,-1],[1,1],[-1,1]].forEach(([it,gt])=>{Y.push([...xe,(it+1)*Et+(gt+1)*el+uu(u)*Xr+r,(n+512)*Bi+(a+512)*mu]),Q.push([...Be,O,Z]),ae.push([y,0,0,0])}),{packedBuffer:Y,packedBuffer2:Q,packedBuffer3:ae}}function sr(t,e){if(t===0&&!e)return 0;if(t===1&&e)return 4294967295;const r=e?1:0,n=Math.floor(t*127);return n*Br+r*Vt+n*Xr+r*Ft+n*ya+r*go+n*Mu+r}const lr={ProjectionMatrix:"u_ProjectionMatrix",ViewMatrix:"u_ViewMatrix",ViewProjectionMatrix:"u_ViewProjectionMatrix",Zoom:"u_Zoom",ZoomScale:"u_ZoomScale",FocalDistance:"u_FocalDistance",CameraPosition:"u_CameraPosition"};let Mt=function(t){return t.TOPRIGHT="topright",t.TOPLEFT="topleft",t.BOTTOMRIGHT="bottomright",t.BOTTOMLEFT="bottomleft",t.TOPCENTER="topcenter",t.BOTTOMCENTER="bottomcenter",t.LEFTCENTER="leftcenter",t.RIGHTCENTER="rightcenter",t.LEFTTOP="lefttop",t.RIGHTTOP="righttop",t.LEFTBOTTOM="leftbottom",t.RIGHTBOTTOM="rightbottom",t}({}),Xt=function(t){return t[t.LNGLAT=1]="LNGLAT",t[t.LNGLAT_OFFSET=2]="LNGLAT_OFFSET",t[t.VECTOR_TILE=3]="VECTOR_TILE",t[t.IDENTITY=4]="IDENTITY",t[t.P20=5]="P20",t[t.P20_OFFSET=6]="P20_OFFSET",t[t.METER_OFFSET=7]="METER_OFFSET",t[t.P20_2=8]="P20_2",t}({});const pt={CoordinateSystem:"u_CoordinateSystem",ViewportCenter:"u_ViewportCenter",ViewportCenterProjection:"u_ViewportCenterProjection",PixelsPerDegree:"u_PixelsPerDegree",PixelsPerDegree2:"u_PixelsPerDegree2",PixelsPerMeter:"u_PixelsPerMeter",Mvp:"u_Mvp"};var $t={MapInitStart:"mapInitStart",LayerInitStart:"layerInitStart",LayerInitEnd:"layerInitEnd",SourceInitStart:"sourceInitStart",SourceInitEnd:"sourceInitEnd",ScaleInitStart:"scaleInitStart",ScaleInitEnd:"scaleInitEnd",MappingStart:"mappingStart",MappingEnd:"mappingEnd",BuildModelStart:"buildModelStart",BuildModelEnd:"buildModelEnd"};let zr=function(t){return t.Hover="hover",t.Click="click",t.Select="select",t.Active="active",t.Drag="drag",t}({}),$r=function(t){return t.normal="normal",t.additive="additive",t.subtractive="subtractive",t.min="min",t.max="max",t.none="none",t}({}),Tn=function(t){return t.MULTIPLE="MULTIPLE",t.SINGLE="SINGLE",t}({}),vn=function(t){return t.AND="and",t.OR="or",t}({}),_n=function(t){return t.INIT="init",t.UPDATE="update",t}({}),Qn=function(t){return t.LINEAR="linear",t.SEQUENTIAL="sequential",t.POWER="power",t.LOG="log",t.IDENTITY="identity",t.TIME="time",t.QUANTILE="quantile",t.QUANTIZE="quantize",t.THRESHOLD="threshold",t.CAT="cat",t.DIVERGING="diverging",t.CUSTOM="threshold",t}({}),Fi=function(t){return t.CONSTANT="constant",t.VARIABLE="variable",t}({}),Vr=function(t){return t[t.Attribute=0]="Attribute",t[t.InstancedAttribute=1]="InstancedAttribute",t[t.Uniform=2]="Uniform",t}({});const po=["mapload","mapchange","mapAfterFrameChange"];var la=Se(25865),Ns=Se.n(la);const Fl=30;function ic({characterSet:t,getFontWidth:e,fontHeight:r,buffer:n,maxCanvasWidth:a,mapping:u={},xOffset:y=0,yOffset:A=0}){let O=0,Z=y;Array.from(t).forEach((Q,ae)=>{if(!u[Q]){const xe=e(Q,ae);Z+Fl>a&&(Z=0,O++),u[Q]={x:Z,y:A+O*Fl,width:Fl,height:Fl,advance:xe},Z+=Fl}});const Y=r+n*2;return{mapping:u,xOffset:Z,yOffset:A+O*Y,canvasHeight:Sd(A+(O+1)*Y)}}function ed(t,e,r){let n=0,a=0,u=0,y=[];const A={};for(const Z of t)if(!A[Z.id]){const{size:Y}=Z;n+Y+e>r&&(Ch(A,y,a),n=0,a=u+a+e,u=0,y=[]),y.push({icon:Z,xOffset:n}),n=n+Y+e,u=Math.max(u,Y)}y.length>0&&Ch(A,y,a);const O=Sd(u+a+e);return{mapping:A,canvasHeight:O}}function Ch(t,e,r){for(const n of e){const{icon:a,xOffset:u}=n;t[a.id]=(0,Wt.Z)((0,Wt.Z)({},a),{},{x:u,y:r,image:a.image,width:a.width,height:a.height})}}function Sd(t){return Math.pow(2,Math.ceil(Math.log2(t)))}const Up=lm(),td="sans-serif",dd="normal",Zp=24,wf=3,Td=.25,Sf=8,sm=1024,Ud=1,Ad=1,Bu=3,nu=null;function lm(){const t=[];for(let e=32;e<128;e++)t.push(String.fromCharCode(e));return t}function Cd(t,e,r,n){t.font=`${n} ${r}px ${e}`,t.fillStyle="black",t.textBaseline="middle"}function rd(t,e){for(let r=0;r{this.iconFontGlyphs[r.name]=r.unicode})}addIconFont(e,r){this.iconFontMap.set(e,r)}getIconFontKey(e){return this.iconFontMap.get(e)||e}getGlyph(e){return this.iconFontGlyphs[e]?String.fromCharCode(parseInt(this.iconFontGlyphs[e],16)):""}setFontOptions(e){this.fontOptions=(0,Wt.Z)((0,Wt.Z)({},this.fontOptions),e),this.key=this.getKey();const r=this.getNewChars(this.key,this.fontOptions.characterSet),n=this.cache.get(this.key);if(n&&r.length===0)return;const a=this.generateFontAtlas(this.key,r,n);this.fontAtlas=a,this.cache.set(this.key,a)}addFontFace(e,r){const n=document.createElement("style");n.type="text/css",n.innerText=` @font-face{ font-family: '${e}'; src: url('${r}') format('woff2'), url('${r}') format('woff'), url('${r}') format('truetype'); }`,n.onload=()=>{if(document.fonts)try{document.fonts.load(`24px ${e}`,"L7text"),document.fonts.ready.then(()=>{this.emit("fontloaded",{fontFamily:e})})}catch(a){console.warn("\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301 document.fonts !"),console.warn("\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301 iconfont !"),console.warn(a)}},document.getElementsByTagName("head")[0].appendChild(n)}destroy(){this.cache.clear(),this.iconFontMap.clear()}generateFontAtlas(e,r,n){const{fontFamily:a,fontWeight:u,fontSize:y,buffer:A,sdf:O,radius:Z,cutoff:Y,iconfont:Q}=this.fontOptions;let ae=n&&n.data;ae||(ae=window.document.createElement("canvas"),ae.width=sm);const xe=ae.getContext("2d",{willReadFrequently:!0});Cd(xe,a,y,u);const{mapping:Be,canvasHeight:it,xOffset:gt,yOffset:Bt}=ic((0,Wt.Z)({getFontWidth:Yt=>xe.measureText(Yt).width,fontHeight:y*Ad,buffer:A,characterSet:r,maxCanvasWidth:sm},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),Rt=xe.getImageData(0,0,ae.width,ae.height);if(ae.height=it,xe.putImageData(Rt,0,0),Cd(xe,a,y,u),O){const Yt=new(Ns())(y,A,Z,Y,a,u),vr=xe.getImageData(0,0,Yt.size,Yt.size);for(const ln of r){if(Q){const cn=String.fromCharCode(parseInt(ln.replace("&#x","").replace(";",""),16)),Gr=Yt.draw(cn);rd(Gr,vr)}else rd(Yt.draw(ln),vr);xe.putImageData(vr,Be[ln].x,Be[ln].y)}}else for(const Yt of r)xe.fillText(Yt,Be[Yt].x,Be[Yt].y+y*Ud);return{xOffset:gt,yOffset:Bt,mapping:Be,data:ae,width:ae.width,height:ae.height}}getKey(){const{fontFamily:e,fontWeight:r}=this.fontOptions;return`${e}_${r}`}getNewChars(e,r){const n=this.cache.get(e);if(!n)return r;const a=[],u=n.mapping,y=new Set(Object.keys(u));return new Set(r).forEach(O=>{y.has(O)||a.push(O)}),a}}var Nr=Se(42700);const um=3,Tf=1024,Mp=64;class Bm extends Yl.EventEmitter{constructor(...e){super(...e),(0,K.Z)(this,"canvasHeight",128),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"canvas",void 0),(0,K.Z)(this,"iconData",void 0),(0,K.Z)(this,"iconMap",void 0),(0,K.Z)(this,"ctx",void 0),(0,K.Z)(this,"loadingImageCount",0)}isLoading(){return this.loadingImageCount===0}init(){this.iconData=[],this.iconMap={},this.canvas=window.document.createElement("canvas"),this.canvas.width=128,this.canvas.height=128,this.ctx=this.canvas.getContext("2d")}addImage(e,r){var n=this;return(0,Nr.Z)(function*(){let a=new Image;n.loadingImageCount++,n.hasImage(e)?console.warn("Image Id already exists"):n.iconData.push({id:e,size:Mp}),n.updateIconMap(),a=yield n.loadImage(r);const u=n.iconData.find(y=>y.id===e);u&&(u.image=a,u.width=a.width,u.height=a.height),n.update()})()}addImageMini(e,r,n){const a=n.getSceneConfig().canvas;let u=a.createImage();if(this.loadingImageCount++,this.hasImage(e))throw new Error("Image Id already exists");this.iconData.push({id:e,size:Mp}),this.updateIconMap(),this.loadImageMini(r,a).then(y=>{u=y;const A=this.iconData.find(O=>O.id===e);A&&(A.image=u,A.width=u.width,A.height=u.height),this.update()})}getTexture(){return this.texture}getIconMap(){return this.iconMap}getCanvas(){return this.canvas}hasImage(e){return this.iconMap.hasOwnProperty(e)}removeImage(e){this.hasImage(e)&&(this.iconData=this.iconData.filter(r=>r.id!==e),delete this.iconMap[e],this.update())}destroy(){this.removeAllListeners("imageUpdate"),this.iconData=[],this.iconMap={}}loadImage(e){return new Promise((r,n)=>{if(e instanceof HTMLImageElement){r(e);return}const a=new Image;a.crossOrigin="anonymous",a.onload=()=>{r(a)},a.onerror=()=>{n(new Error("Could not load image at "+e))},a.src=e instanceof File?URL.createObjectURL(e):e})}update(){this.updateIconMap(),this.updateIconAtlas(),this.loadingImageCount--,this.loadingImageCount===0&&this.emit("imageUpdate")}updateIconAtlas(){this.canvas.width=Tf,this.canvas.height=this.canvasHeight,Object.keys(this.iconMap).forEach(e=>{const{x:r,y:n,image:a,width:u=64,height:y=64}=this.iconMap[e],O=Math.max(u,y)/Mp,Z=y/O,Y=u/O;a&&this.ctx.drawImage(a,r+(Mp-Y)/2,n+(Mp-Z)/2,Y,Z)})}updateIconMap(){const{mapping:e,canvasHeight:r}=ed(this.iconData,um,Tf);this.iconMap=e,this.canvasHeight=r}loadImageMini(e,r){return new Promise((n,a)=>{const u=r.createImage();u.crossOrigin="anonymous",u.onload=()=>{n(u)},u.onerror=()=>{a(new Error("Could not load image at "+e))},u.src=e})}}var Kr=Se(39536);class cm{constructor(){(0,K.Z)(this,"viewport",void 0),(0,K.Z)(this,"overridedViewProjectionMatrix",void 0),(0,K.Z)(this,"jitteredViewProjectionMatrix",void 0),(0,K.Z)(this,"jitteredProjectionMatrix",void 0),(0,K.Z)(this,"viewMatrixInverse",void 0),(0,K.Z)(this,"cameraPosition",void 0)}init(){}update(e){this.viewport=e,this.viewMatrixInverse=Kr.create(),Kr.invert(this.viewMatrixInverse,e.getViewMatrix()),this.cameraPosition=[this.viewMatrixInverse[12],this.viewMatrixInverse[13],this.viewMatrixInverse[14]]}getProjectionMatrix(){return this.jitteredProjectionMatrix||this.viewport.getProjectionMatrix()}getModelMatrix(){return this.viewport.getModelMatrix()}getViewMatrix(){return this.viewport.getViewMatrix()}getViewMatrixUncentered(){return this.viewport.getViewMatrixUncentered()}getViewProjectionMatrixUncentered(){return this.viewport.getViewProjectionMatrixUncentered()}getViewProjectionMatrix(){return this.overridedViewProjectionMatrix||this.jitteredViewProjectionMatrix||this.viewport.getViewProjectionMatrix()}getZoom(){return this.viewport.getZoom()}getZoomScale(){return this.viewport.getZoomScale()}getCenter(){const[e,r]=this.viewport.getCenter();return[e,r]}getFocalDistance(){return this.viewport.getFocalDistance()}getCameraPosition(){return this.cameraPosition}projectFlat(e,r){return this.viewport.projectFlat(e,r)}setViewProjectionMatrix(e){this.overridedViewProjectionMatrix=e}jitterProjectionMatrix(e,r){const n=Kr.fromTranslation(Kr.create(),[e,r,0]);this.jitteredProjectionMatrix=Kr.multiply(Kr.create(),n,this.viewport.getProjectionMatrix()),this.jitteredViewProjectionMatrix=Kr.multiply(Kr.create(),this.jitteredProjectionMatrix,this.viewport.getViewMatrix())}clearJitterProjectionMatrix(){this.jitteredProjectionMatrix=void 0,this.jitteredViewProjectionMatrix=void 0}}const Af={topleft:"column",topright:"column",bottomright:"column",bottomleft:"column",leftcenter:"column",rightcenter:"column",topcenter:"row",bottomcenter:"row",lefttop:"row",righttop:"row",leftbottom:"row",rightbottom:"row"};class hm{constructor(){(0,K.Z)(this,"container",void 0),(0,K.Z)(this,"controlCorners",void 0),(0,K.Z)(this,"controlContainer",void 0),(0,K.Z)(this,"scene",void 0),(0,K.Z)(this,"mapsService",void 0),(0,K.Z)(this,"controls",[]),(0,K.Z)(this,"unAddControls",[])}init(e,r){this.container=e.container,this.scene=r,this.mapsService=r.mapService,this.initControlPos()}addControl(e,r){r.mapService.map?(e.addTo(this.scene),this.controls.push(e)):this.unAddControls.push(e)}getControlByName(e){return this.controls.find(r=>r.controlOption.name===e)}removeControl(e){const r=this.controls.indexOf(e);return r>-1&&this.controls.splice(r,1),e.remove(),this}addControls(){this.unAddControls.forEach(e=>{e.addTo(this.scene),this.controls.push(e)}),this.unAddControls=[]}destroy(){for(const e of this.controls)e.remove();this.controls=[],this.clearControlPos()}initControlPos(){const e=this.controlCorners={},r="l7-",n=this.controlContainer=Xo("div",r+"control-container",this.container);function a(y=[]){const A=y.map(O=>r+O).join(" ");e[y.filter(O=>!["row","column"].includes(O)).join("")]=Xo("div",A,n)}function u(y){return[...y.replace(/^(top|bottom|left|right|center)/,"$1-").split("-"),Af[y]]}Object.values(Mt).forEach(y=>{a(u(y))}),this.checkCornerOverlap()}clearControlPos(){for(const e in this.controlCorners)this.controlCorners[e]&&au(this.controlCorners[e]);this.controlContainer&&au(this.controlContainer)}checkCornerOverlap(){const e=window.MutationObserver;if(e)for(const r of Object.keys(this.controlCorners)){const n=r.match(/^(top|bottom)(left|right)$/);if(n){const[,a,u]=n,y=this.controlCorners[`${a}${u}`];new e(([{target:O}])=>{y&&(y.style[a]=O.clientHeight+"px")}).observe(this.controlCorners[`${u}${a}`],{childList:!0,attributes:!0})}}}}class Em{constructor(){(0,K.Z)(this,"container",void 0),(0,K.Z)(this,"scene",void 0),(0,K.Z)(this,"mapsService",void 0),(0,K.Z)(this,"markers",[]),(0,K.Z)(this,"markerLayers",[]),(0,K.Z)(this,"unAddMarkers",[]),(0,K.Z)(this,"unAddMarkerLayers",[])}addMarkerLayer(e){this.mapsService.map&&this.mapsService.getMarkerContainer()?(this.markerLayers.push(e),e.addTo(this.scene)):this.unAddMarkerLayers.push(e)}removeMarkerLayer(e){e.destroy(),this.markerLayers.indexOf(e);const r=this.markerLayers.indexOf(e);r>-1&&this.markerLayers.splice(r,1)}addMarker(e){this.mapsService.map&&this.mapsService.getMarkerContainer()?(this.markers.push(e),e.addTo(this.scene)):this.unAddMarkers.push(e)}addMarkers(){this.unAddMarkers.forEach(e=>{e.addTo(this.scene),this.markers.push(e)}),this.unAddMarkers=[]}addMarkerLayers(){this.unAddMarkerLayers.forEach(e=>{this.markerLayers.push(e),e.addTo(this.scene)}),this.unAddMarkers=[]}removeMarker(e){e.remove(),this.markers.indexOf(e);const r=this.markers.indexOf(e);r>-1&&this.markers.splice(r,1)}removeAllMarkers(){this.destroy()}init(e){this.scene=e,this.mapsService=e.mapService}destroy(){this.markers.forEach(e=>{e.remove()}),this.markers=[],this.markerLayers.forEach(e=>{e.destroy()}),this.markerLayers=[]}removeMakerLayerMarker(e){e.destroy()}}class wm{constructor(){(0,K.Z)(this,"scene",void 0),(0,K.Z)(this,"mapsService",void 0),(0,K.Z)(this,"popups",[]),(0,K.Z)(this,"unAddPopups",[])}get isMarkerReady(){return this.mapsService.map&&this.mapsService.getMarkerContainer()}removePopup(e){e!=null&&e.isOpen()&&e.remove();const r=this.popups.indexOf(e);r>-1&&this.popups.splice(r,1);const n=this.unAddPopups.indexOf(e);n>-1&&this.unAddPopups.splice(n,1)}destroy(){this.popups.forEach(e=>e.remove())}addPopup(e){e&&e.getOptions().autoClose&&[...this.popups,...this.unAddPopups].forEach(r=>{r.getOptions().autoClose&&this.removePopup(r)}),this.isMarkerReady?(e.addTo(this.scene),this.popups.push(e)):this.unAddPopups.push(e),e.on("close",()=>{this.removePopup(e)})}initPopup(){this.unAddPopups.length&&this.unAddPopups.forEach(e=>{this.addPopup(e),this.unAddPopups=[]})}init(e){this.scene=e,this.mapsService=e.mapService}}var cf={MapToken:"\u60A8\u6B63\u5728\u4F7F\u7528 Demo \u6D4B\u8BD5 Token, \u751F\u4EA7\u73AF\u5883\u52A1\u5FC5\u81EA\u884C\u6CE8\u518C Token \u786E\u4FDD\u670D\u52A1\u7A33\u5B9A \u9AD8\u5FB7\u5730\u56FE\u7533\u8BF7\u5730\u5740 https://lbs.amap.com/api/javascript-api/guide/abc/prepare Mapbox\u5730\u56FE\u7533\u8BF7\u5730\u5740 https://docs.mapbox.com/help/glossary/access-token/",SDK:"\u8BF7\u786E\u8BA4\u5F15\u5165\u4E86mapbox-gl api\u4E14\u5728L7\u4E4B\u524D\u5F15\u5165"};const{merge:nd}=es,Sm={id:"map",logoPosition:"bottomleft",logoVisible:!0,antialias:!0,stencil:!0,preserveDrawingBuffer:!1,pickBufferScale:1,fitBoundsOptions:{animate:!1}},qm={colors:["rgb(103,0,31)","rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(247,247,247)","rgb(209,229,240)","rgb(146,197,222)","rgb(67,147,195)","rgb(33,102,172)","rgb(5,48,97)"],size:10,shape:"circle",scales:{},shape2d:["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],shape3d:["cylinder","triangleColumn","hexagonColumn","squareColumn"],minZoom:-1,maxZoom:24,visible:!0,autoFit:!1,pickingBuffer:0,enablePropagation:!1,zIndex:0,blend:"normal",maskLayers:[],enableMask:!0,maskOperation:vn.AND,pickedFeatureID:-1,enableMultiPassRenderer:!1,enablePicking:!0,active:!1,activeColor:"#2f54eb",enableHighlight:!1,enableSelect:!1,highlightColor:"#2f54eb",activeMix:0,selectColor:"blue",selectMix:0,enableTAA:!1,jitterScale:1,enableLighting:!1,animateOption:{enable:!1,interval:.2,duration:4,trailLength:.15},forward:!0};class mc{constructor(){(0,K.Z)(this,"sceneConfigCache",{}),(0,K.Z)(this,"layerConfigCache",{}),(0,K.Z)(this,"layerAttributeConfigCache",{})}getSceneConfig(e){return this.sceneConfigCache[e]}getSceneWarninfo(e){return cf[e]}setSceneConfig(e,r){this.sceneConfigCache[e]=(0,Wt.Z)((0,Wt.Z)({},Sm),r)}getLayerConfig(e){return this.layerConfigCache[e]}setLayerConfig(e,r,n){this.layerConfigCache[r]=(0,Wt.Z)({},nd({},this.sceneConfigCache[e],qm,n))}getAttributeConfig(e){return this.layerAttributeConfigCache[e]}setAttributeConfig(e,r){this.layerAttributeConfigCache[e]=(0,Wt.Z)((0,Wt.Z)({},this.layerAttributeConfigCache[e]),r)}clean(){this.sceneConfigCache={},this.layerConfigCache={}}}var mh=Se(49953);const Zd=Math.PI/180,i=512,l=4003e4;function _({latitude:t=0,zoom:e=0,scale:r,highPrecision:n=!1,flipY:a=!1}){r=r!==void 0?r:Math.pow(2,e);const u={},y=i*r,A=Math.cos(t*Zd),O=y/360,Z=O/A,Y=y/l/A;if(u.pixelsPerMeter=[Y,-Y,Y],u.metersPerPixel=[1/Y,-1/Y,1/Y],u.pixelsPerDegree=[O,-Z,Y],u.degreesPerPixel=[1/O,-1/Z,1/Y],n){const Q=Zd*Math.tan(t*Zd)/A,ae=O*Q/2,xe=y/l*Q,Be=xe/Z*Y;u.pixelsPerDegree2=[0,-ae,xe],u.pixelsPerMeter2=[Be,0,Be],a&&(u.pixelsPerDegree2[1]=-u.pixelsPerDegree2[1],u.pixelsPerMeter2[1]=-u.pixelsPerMeter2[1])}return a&&(u.pixelsPerMeter[1]=-u.pixelsPerMeter[1],u.metersPerPixel[1]=-u.metersPerPixel[1],u.pixelsPerDegree[1]=-u.pixelsPerDegree[1],u.degreesPerPixel[1]=-u.degreesPerPixel[1]),u}const S=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];class F{constructor(e){(0,K.Z)(this,"needRefresh",!0),(0,K.Z)(this,"coordinateSystem",void 0),(0,K.Z)(this,"viewportCenter",void 0),(0,K.Z)(this,"viewportCenterProjection",void 0),(0,K.Z)(this,"pixelsPerDegree",void 0),(0,K.Z)(this,"pixelsPerDegree2",void 0),(0,K.Z)(this,"pixelsPerMeter",void 0),this.cameraService=e}refresh(e){const r=this.cameraService.getZoom(),n=this.cameraService.getZoomScale(),a=e||this.cameraService.getCenter(),{pixelsPerMeter:u,pixelsPerDegree:y}=_({latitude:a[1],zoom:r});this.viewportCenter=a,this.viewportCenterProjection=[0,0,0,0],this.pixelsPerMeter=u,this.pixelsPerDegree=y,this.pixelsPerDegree2=[0,0,0],this.coordinateSystem===Xt.LNGLAT||this.coordinateSystem===Xt.P20?this.cameraService.setViewProjectionMatrix(void 0):this.coordinateSystem===Xt.LNGLAT_OFFSET?this.calculateLnglatOffset(a,r):this.coordinateSystem===Xt.P20_OFFSET&&this.calculateLnglatOffset(a,r,n,!0),this.needRefresh=!1}getCoordinateSystem(){return this.coordinateSystem}setCoordinateSystem(e){this.coordinateSystem=e}getViewportCenter(){return this.viewportCenter}getViewportCenterProjection(){return this.viewportCenterProjection}getPixelsPerDegree(){return this.pixelsPerDegree}getPixelsPerDegree2(){return this.pixelsPerDegree2}getPixelsPerMeter(){return this.pixelsPerMeter}calculateLnglatOffset(e,r,n,a){const{pixelsPerMeter:u,pixelsPerDegree:y,pixelsPerDegree2:A}=_({latitude:e[1],zoom:r,scale:n,flipY:a,highPrecision:!0});let O=this.cameraService.getViewMatrix();const Z=this.cameraService.getProjectionMatrix();let Y=Kr.multiply([],Z,O);const Q=this.cameraService.projectFlat([Math.fround(e[0]),Math.fround(e[1])],Math.pow(2,r));this.viewportCenterProjection=mh.transformMat4([],[Q[0],Q[1],0,1],Y),O=this.cameraService.getViewMatrixUncentered()||O,Y=Kr.multiply([],Z,O),Y=Kr.multiply([],Y,S),this.cameraService.setViewProjectionMatrix(Y),this.pixelsPerMeter=u,this.pixelsPerDegree=y,this.pixelsPerDegree2=A}}class j extends Yl.EventEmitter{constructor(...e){super(...e),(0,K.Z)(this,"renderMap",new Map),(0,K.Z)(this,"enable",!1),(0,K.Z)(this,"renderEnable",!1),(0,K.Z)(this,"cacheLogs",{})}setEnable(e){this.enable=!!e}log(e,r){if(!this.enable)return;const n=e.split(".");let a=null;n.forEach((u,y)=>{a!==null?(a[u]||(a[u]={}),y!==n.length-1&&(a=a[u])):(this.cacheLogs[u]||(this.cacheLogs[u]={}),y!==n.length-1&&(a=this.cacheLogs[u])),y===n.length-1&&(a[u]=(0,Wt.Z)((0,Wt.Z)({time:Date.now()},a[u]),r))})}getLog(e){switch(typeof e){case"string":return this.cacheLogs[e];case"object":return e.map(r=>this.cacheLogs[r]).filter(r=>r!==void 0);case"undefined":return this.cacheLogs}}removeLog(e){delete this.cacheLogs[e]}generateRenderUid(){return this.renderEnable?tp():""}renderDebug(e){this.renderEnable=e}renderStart(e){if(!this.renderEnable||!this.enable)return;const r=this.renderMap.get(e)||{};this.renderMap.set(e,(0,Wt.Z)((0,Wt.Z)({},r),{},{renderUid:e,renderStart:Date.now()}))}renderEnd(e){if(!this.renderEnable||!this.enable)return;const r=this.renderMap.get(e);if(r){const n=r.renderStart,a=Date.now();this.emit("renderEnd",(0,Wt.Z)((0,Wt.Z)({},r),{},{renderEnd:a,renderDuration:a-n})),this.renderMap.delete(e)}}destroy(){this.cacheLogs=null,this.renderMap.clear()}}var p=Se(11553),v=Se.n(p);const m={panstart:"dragstart",panmove:"dragging",panend:"dragend",pancancel:"dragcancel"};class w extends Th(){get mapService(){return this.container.mapService}constructor(e){super(),(0,K.Z)(this,"indragging",!1),(0,K.Z)(this,"hammertime",void 0),(0,K.Z)(this,"lastClickTime",0),(0,K.Z)(this,"lastClickXY",[-1,-1]),(0,K.Z)(this,"clickTimer",void 0),(0,K.Z)(this,"$containter",void 0),(0,K.Z)(this,"onDrag",r=>{const n=this.interactionEvent(r);n.type=m[n.type],n.type==="dragging"?this.indragging=!0:this.indragging=!1,this.emit(zr.Drag,n)}),(0,K.Z)(this,"onHammer",r=>{r.srcEvent.stopPropagation();const n=this.interactionEvent(r);this.emit(zr.Hover,n)}),(0,K.Z)(this,"onTouch",r=>{const n=r.touches[0];this.onHover({clientX:n.clientX,clientY:n.clientY,type:"touchstart"})}),(0,K.Z)(this,"onTouchEnd",r=>{if(r.changedTouches.length>0){const n=r.changedTouches[0];this.onHover({clientX:n.clientX,clientY:n.clientY,type:"touchend"})}}),(0,K.Z)(this,"onTouchMove",r=>{const n=r.changedTouches[0];this.onHover({clientX:n.clientX,clientY:n.clientY,type:"touchmove"})}),(0,K.Z)(this,"onHover",r=>{const{clientX:n,clientY:a}=r;let u=n,y=a;const A=r.type,O=this.mapService.getMapContainer();if(O){const{top:Y,left:Q}=O.getBoundingClientRect();u=u-Q-O.clientLeft,y=y-Y-O.clientTop}const Z=this.mapService.containerToLngLat([u,y]);if(A==="click"){this.isDoubleTap(u,y,Z);return}if(A==="touch"){this.isDoubleTap(u,y,Z);return}A!=="click"&&A!=="dblclick"&&this.emit(zr.Hover,{x:u,y,lngLat:Z,type:A,target:r})}),this.container=e}init(){this.addEventListenerOnMap(),this.$containter=this.mapService.getMapContainer()}destroy(){this.hammertime&&this.hammertime.destroy(),this.removeEventListenerOnMap(),this.off(zr.Hover)}triggerHover({x:e,y:r}){this.emit(zr.Hover,{x:e,y:r})}triggerSelect(e){this.emit(zr.Select,{featureId:e})}triggerActive(e){this.emit(zr.Active,{featureId:e})}addEventListenerOnMap(){const e=this.mapService.getMapContainer();if(e){const r=new(v()).Manager(e);r.add(new(v()).Tap({event:"dblclick",taps:2})),r.add(new(v()).Tap({event:"click"})),r.add(new(v()).Pan({threshold:0,pointers:0})),r.add(new(v()).Press({})),r.on("dblclick click",this.onHammer),r.on("panstart panmove panend pancancel",this.onDrag),e.addEventListener("touchstart",this.onTouch),e.addEventListener("touchend",this.onTouchEnd),e.addEventListener("mousemove",this.onHover),e.addEventListener("touchmove",this.onTouchMove),e.addEventListener("mousedown",this.onHover,!0),e.addEventListener("mouseup",this.onHover),e.addEventListener("contextmenu",this.onHover),this.hammertime=r}}removeEventListenerOnMap(){const e=this.mapService.getMapContainer();e&&(e.removeEventListener("mousemove",this.onHover),this.hammertime.off("dblclick click",this.onHammer),this.hammertime.off("panstart panmove panend pancancel",this.onDrag),e.removeEventListener("touchstart",this.onTouch),e.removeEventListener("touchend",this.onTouchEnd),e.removeEventListener("mousedown",this.onHover),e.removeEventListener("mouseup",this.onHover),e.removeEventListener("contextmenu",this.onHover))}interactionEvent(e){const{type:r,pointerType:n}=e;let a,u;n==="touch"?(u=Math.floor(e.pointers[0].clientY),a=Math.floor(e.pointers[0].clientX)):(u=Math.floor(e.srcEvent.y),a=Math.floor(e.srcEvent.x));const y=this.mapService.getMapContainer();if(y){const{top:O,left:Z}=y.getBoundingClientRect();a-=Z,u-=O}const A=this.mapService.containerToLngLat([a,u]);return{x:a,y:u,lngLat:A,type:r,target:e.srcEvent}}isDoubleTap(e,r,n){const a=new Date().getTime();let u="click";a-this.lastClickTime<400&&Math.abs(this.lastClickXY[0]-e)<10&&Math.abs(this.lastClickXY[1]-r)<10?(this.lastClickTime=0,this.lastClickXY=[-1,-1],this.clickTimer&&clearTimeout(this.clickTimer),u="dblclick",this.emit(zr.Hover,{x:e,y:r,lngLat:n,type:u})):(this.lastClickTime=a,this.lastClickXY=[e,r],this.clickTimer=setTimeout(()=>{u="click",this.emit(zr.Hover,{x:e,y:r,lngLat:n,type:u})},400))}}let D=0;function N(t){let e=t;if(typeof t=="string"&&(e=document.getElementById(t)),e){const r=document.createElement("div");return r.style.cssText+=` position: absolute; z-index:2; height: 100%; width: 100%; pointer-events: none; `,r.id=`l7-scene-${D++}`,r.classList.add("l7-scene"),e.appendChild(r),r}return null}function W(t){var e;let r=!0;if((t==null||(e=t.target)===null||e===void 0?void 0:e.target)instanceof HTMLElement){var n;let u=t==null||(n=t.target)===null||n===void 0?void 0:n.target;for(;u;){var a;const y=Array.from(u.classList);if(y.includes("l7-marker")||y.includes("l7-popup")){r=!1;break}u=(a=u)===null||a===void 0?void 0:a.parentElement}}return r}let $=function(t){return t[t.SAMPLED=0]="SAMPLED",t[t.RENDER_TARGET=1]="RENDER_TARGET",t}({});class ie{constructor(e){var r=this;(0,K.Z)(this,"pickedColors",void 0),(0,K.Z)(this,"pickedTileLayers",[]),(0,K.Z)(this,"pickingFBO",void 0),(0,K.Z)(this,"width",0),(0,K.Z)(this,"height",0),(0,K.Z)(this,"alreadyInPicking",!1),(0,K.Z)(this,"pickBufferScale",1),(0,K.Z)(this,"pickFromPickingFBO",function(){var n=(0,Nr.Z)(function*(a,{x:u,y,lngLat:A,type:O,target:Z}){let Y=!1;const{readPixelsAsync:Q,getViewportSize:ae}=r.rendererService,{width:xe,height:Be}=ae(),{enableHighlight:it,enableSelect:gt}=a.getLayerConfig(),Bt=u*Ll,Rt=y*Ll;if(Bt>xe-1*Ll||Bt<0||Rt>Be-1*Ll||Rt<0)return!1;const Yt=yield Q({x:Math.floor(Bt/r.pickBufferScale),y:Math.floor((Be-(y+1)*Ll)/r.pickBufferScale),width:1,height:1,data:new Uint8Array(1*1*4),framebuffer:r.pickingFBO});if(r.pickedColors=Yt,Yt[0]!==0||Yt[1]!==0||Yt[2]!==0){const vr=Aa(Yt),ln=a.layerPickService.getFeatureById(vr);vr!==a.getCurrentPickId()&&O==="mousemove"&&(O="mouseenter");const cn={x:u,y,type:O,lngLat:A,featureId:vr,feature:ln,target:Z};ln&&(Y=!0,a.setCurrentPickId(vr),r.triggerHoverOnLayer(a,cn))}else{const vr={x:u,y,lngLat:A,type:a.getCurrentPickId()!==null&&O==="mousemove"?"mouseout":"un"+O,featureId:null,target:Z,feature:null};r.triggerHoverOnLayer(a,(0,Wt.Z)((0,Wt.Z)({},vr),{},{type:"unpick"})),r.triggerHoverOnLayer(a,vr),a.setCurrentPickId(null)}if(it&&a.layerPickService.highlightPickedFeature(Yt),gt&&O==="click"&&(Yt==null?void 0:Yt.toString())!==[0,0,0,0].toString()){const vr=Aa(Yt);a.getCurrentSelectedId()===null||vr!==a.getCurrentSelectedId()?(a.layerPickService.selectFeature(Yt),a.setCurrentSelectedId(vr)):(a.layerPickService.selectFeature(new Uint8Array([0,0,0,0])),a.setCurrentSelectedId(null))}return Y});return function(a,u){return n.apply(this,arguments)}}()),this.container=e}get mapService(){return this.container.mapService}get rendererService(){return this.container.rendererService}get configService(){return this.container.globalConfigService}get interactionService(){return this.container.interactionService}get layerService(){return this.container.layerService}init(e){const{createTexture2D:r,createFramebuffer:n,getViewportSize:a}=this.rendererService;let{width:u,height:y}=a();this.pickBufferScale=this.configService.getSceneConfig(e).pickBufferScale||1,u=Math.round(u/this.pickBufferScale),y=Math.round(y/this.pickBufferScale);const A=r({width:u,height:y,usage:$.RENDER_TARGET,label:"Picking Texture"});this.pickingFBO=n({color:A,depth:!0,width:u,height:y}),this.interactionService.on(zr.Hover,this.pickingAllLayer.bind(this))}boxPickLayer(e,r,n){var a=this;return(0,Nr.Z)(function*(){const{useFramebufferAsync:u,clear:y}=a.rendererService;a.resizePickingFBO(),e.hooks.beforePickingEncode.call(),yield u(a.pickingFBO,(0,Nr.Z)(function*(){y({framebuffer:a.pickingFBO,color:[0,0,0,0],stencil:0,depth:1}),e.renderModels({ispick:!0})})),e.hooks.afterPickingEncode.call();const A=yield a.pickBox(e,r);n(A)})()}pickBox(e,r){var n=this;return(0,Nr.Z)(function*(){const[a,u,y,A]=r.map(Bt=>{const Rt=Bt<0?0:Bt;return Math.floor(Rt*Ll/n.pickBufferScale)}),{readPixelsAsync:O,getViewportSize:Z}=n.rendererService,{width:Y,height:Q}=Z();if(a>(Y-1)*Ll/n.pickBufferScale||y<0||u>(Q-1)*Ll/n.pickBufferScale||A<0)return[];const ae=Math.min(Y/n.pickBufferScale,y)-a,xe=Math.min(Q/n.pickBufferScale,A)-u,Be=yield O({x:a,y:Math.floor(Q/n.pickBufferScale-(A+1)),width:ae,height:xe,data:new Uint8Array(ae*xe*4),framebuffer:n.pickingFBO}),it=[],gt={};for(let Bt=0;BtA.needPick(e.type)).reverse()){yield a(r.pickingFBO,(0,Nr.Z)(function*(){n({framebuffer:r.pickingFBO,color:[0,0,0,0],stencil:0,depth:1}),y.layerPickService.pickRender(e)}));const A=yield r.pickFromPickingFBO(y,e);if(r.layerService.pickedLayerId=A?+y.id:-1,A&&!y.getLayerConfig().enablePropagation)break}})()}triggerHoverOnLayer(e,r){W(r)&&(this.handleCursor(e,r.type),e.emit(r.type,r))}}class pe{constructor(e=!0){(0,K.Z)(this,"autoStart",void 0),(0,K.Z)(this,"startTime",0),(0,K.Z)(this,"oldTime",0),(0,K.Z)(this,"running",!1),(0,K.Z)(this,"elapsedTime",0),this.autoStart=e}start(){this.startTime=(typeof performance=="undefined"?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const r=(typeof performance=="undefined"?Date:performance).now();e=(r-this.oldTime)/1e3,this.oldTime=r,this.elapsedTime+=e}return e}}const{throttle:we}=es;class ke extends Yl.EventEmitter{get renderService(){return this.container.rendererService}get mapService(){return this.container.mapService}get debugService(){return this.container.debugService}constructor(e){super(),(0,K.Z)(this,"pickedLayerId",-1),(0,K.Z)(this,"clock",new pe),(0,K.Z)(this,"alreadyInRendering",!1),(0,K.Z)(this,"layers",[]),(0,K.Z)(this,"layerList",[]),(0,K.Z)(this,"layerRenderID",void 0),(0,K.Z)(this,"sceneInited",!1),(0,K.Z)(this,"animateInstanceCount",0),(0,K.Z)(this,"shaderPicking",!0),(0,K.Z)(this,"enableRender",!0),(0,K.Z)(this,"reRender",we(()=>{this.renderLayers()},32)),(0,K.Z)(this,"throttleRenderLayers",we(()=>{this.renderLayers()},16)),this.container=e}needPick(e){return this.updateLayerRenderList(),this.layerList.some(r=>r.needPick(e))}add(e){this.layers.push(e),this.sceneInited&&e.init().then(()=>{this.renderLayers()})}addMask(e){this.sceneInited&&e.init().then(()=>{this.renderLayers()})}initLayers(){var e=this;return(0,Nr.Z)(function*(){e.sceneInited=!0,e.layers.forEach(function(){var r=(0,Nr.Z)(function*(n){n.startInit||(yield n.init(),e.updateLayerRenderList())});return function(n){return r.apply(this,arguments)}}())})()}getSceneInited(){return this.sceneInited}getRenderList(){return this.layerList}getLayers(){return this.layers}getLayer(e){return this.layers.find(r=>r.id===e)}getLayerByName(e){return this.layers.find(r=>r.name===e)}remove(e,r){var n=this;return(0,Nr.Z)(function*(){r?r.layerChildren=r.layerChildren.filter(a=>a!==e):n.layers=n.layers.filter(a=>a!==e),e.destroy(),n.reRender(),n.emit("layerChange",n.layers)})()}removeAllLayers(){var e=this;return(0,Nr.Z)(function*(){e.destroy(),e.reRender()})()}setEnableRender(e){this.enableRender=e}renderLayers(){var e=this;return(0,Nr.Z)(function*(){if(e.alreadyInRendering||!e.enableRender)return;e.updateLayerRenderList();const r=e.debugService.generateRenderUid();e.debugService.renderStart(r),e.alreadyInRendering=!0,e.clear();for(const n of e.layerList)n.prerender();e.renderService.beginFrame();for(const n of e.layerList){const{enableMask:a}=n.getLayerConfig();n.masks.filter(u=>u.inited).length>0&&a&&e.renderMask(n.masks),n.getLayerConfig().enableMultiPassRenderer?yield n.renderMultiPass():n.render()}e.renderService.endFrame(),e.debugService.renderEnd(r),e.alreadyInRendering=!1})()}renderMask(e){let r=0;this.renderService.clear({stencil:0,depth:1,framebuffer:null});const n=e.length>1?Tn.MULTIPLE:Tn.SINGLE;for(const a of e)a.render({isStencil:!0,stencilType:n,stencilIndex:r++})}beforeRenderData(e){var r=this;return(0,Nr.Z)(function*(){(yield e.hooks.beforeRenderData.promise())&&r.renderLayers()})()}renderTileLayerMask(e){let r=0;const{enableMask:n=!0}=e.getLayerConfig();let a=e.tileMask?1:0;const u=e.masks.filter(A=>A.inited);a=a+(n?u.length:1);const y=a>1?Tn.MULTIPLE:Tn.SINGLE;if((e.tileMask||u.length&&n)&&this.renderService.clear({stencil:0,depth:1,framebuffer:null}),u.length&&n)for(const A of u)A.render({isStencil:!0,stencilType:y,stencilIndex:r++});e.tileMask&&e.tileMask.render({isStencil:!0,stencilType:y,stencilIndex:r++,stencilOperation:vn.OR})}renderTileLayer(e){var r=this;return(0,Nr.Z)(function*(){r.renderTileLayerMask(e),e.getLayerConfig().enableMultiPassRenderer?yield e.renderMultiPass():yield e.render()})()}updateLayerRenderList(){this.layerList=[],this.layers.filter(e=>e.inited).filter(e=>e.isVisible()).sort((e,r)=>e.zIndex-r.zIndex).forEach(e=>{this.layerList.push(e)})}destroy(){this.layers.forEach(e=>{e.destroy()}),this.layers=[],this.layerList=[],this.emit("layerChange",this.layers)}startAnimate(){this.animateInstanceCount++===0&&(this.clock.start(),this.runRender())}stopAnimate(){--this.animateInstanceCount===0&&(this.stopRender(),this.clock.stop())}getOESTextureFloat(){return this.renderService.extensionObject.OES_texture_float}enableShaderPick(){this.shaderPicking=!0}disableShaderPick(){this.shaderPicking=!1}getShaderPickStat(){return this.shaderPicking}clear(){const e=Va(this.mapService.bgColor);this.renderService.clear({color:e,depth:1,stencil:0,framebuffer:null})}runRender(){this.renderLayers(),this.layerRenderID=window.requestAnimationFrame(this.runRender.bind(this))}stopRender(){window.cancelAnimationFrame(this.layerRenderID)}}var Ge=Se(87841);const{isNil:ht}=es;class mt{constructor(e){(0,K.Z)(this,"name",void 0),(0,K.Z)(this,"type",void 0),(0,K.Z)(this,"scale",void 0),(0,K.Z)(this,"descriptor",void 0),(0,K.Z)(this,"featureBufferLayout",[]),(0,K.Z)(this,"needRescale",!1),(0,K.Z)(this,"needRemapping",!1),(0,K.Z)(this,"needRegenerateVertices",!1),(0,K.Z)(this,"featureRange",{startIndex:0,endIndex:1/0}),(0,K.Z)(this,"vertexAttribute",void 0),(0,K.Z)(this,"defaultCallback",r=>{if(r.length===0){var n;return((n=this.scale)===null||n===void 0?void 0:n.defaultValues)||[]}return r.map((a,u)=>{var y;return((y=this.scale)===null||y===void 0?void 0:y.scalers[u].func)(a)})}),this.setProps(e)}setProps(e){Object.assign(this,e)}mapping(e){var r;if((r=this.scale)!==null&&r!==void 0&&r.callback){var n;const a=(n=this.scale)===null||n===void 0?void 0:n.callback(...e);if(!ht(a))return[a]}return this.defaultCallback(e)}resetDescriptor(){this.descriptor&&(this.descriptor.buffer.data=[])}}const St=["buffer","update","name"],xt=["buffer","update","name"],bt={[Ee.FLOAT]:4,[Ee.UNSIGNED_BYTE]:1,[Ee.UNSIGNED_SHORT]:2};class kt{constructor(e){(0,K.Z)(this,"attributesAndIndices",void 0),(0,K.Z)(this,"attributes",[]),(0,K.Z)(this,"triangulation",void 0),(0,K.Z)(this,"featureLayout",{sizePerElement:0,elements:[]}),this.rendererService=e}registerStyleAttribute(e){let r=this.getLayerStyleAttribute(e.name||"");return r?r.setProps(e):(r=new mt(e),this.attributes.push(r)),r}unRegisterStyleAttribute(e){const r=this.attributes.findIndex(n=>n.name===e);r>-1&&this.attributes.splice(r,1)}updateScaleAttribute(e){this.attributes.forEach(r=>{var n;const a=r.name,u=(n=r.scale)===null||n===void 0?void 0:n.field;(e[a]||u&&e[u])&&(r.needRescale=!0,r.needRemapping=!0,r.needRegenerateVertices=!0)})}updateStyleAttribute(e,r,n){let a=this.getLayerStyleAttribute(e);a||(a=this.registerStyleAttribute((0,Wt.Z)((0,Wt.Z)({},r),{},{name:e})));const{scale:u}=r;u&&a&&(a.scale=u,a.needRescale=!0,a.needRemapping=!0,a.needRegenerateVertices=!0,n&&n.featureRange&&(a.featureRange=n.featureRange))}getLayerStyleAttributes(){return this.attributes}getLayerStyleAttribute(e){return this.attributes.find(r=>r.name===e)}getLayerAttributeScale(e){var r;const n=this.getLayerStyleAttribute(e),a=n==null||(r=n.scale)===null||r===void 0?void 0:r.scalers;return a&&a[0]?a[0].func:null}updateAttributeByFeatureRange(e,r,n=0,a,u){const y=this.attributes.find(A=>A.name===e);if(y&&y.descriptor){const{descriptor:A}=y,{update:O,buffer:Z,size:Y=0}=A,Q=bt[Z.type||Ee.FLOAT];if(O){const{elements:ae,sizePerElement:xe}=this.featureLayout,Be=ae.slice(n,a);if(!Be.length)return;const{offset:it}=Be[0],gt=it*Y*Q,Bt=Be.map(({featureIdx:Rt,vertices:Yt,normals:vr},ln)=>{const cn=Yt.length/xe,Gr=[];for(let Pn=0;Pn(it.resetDescriptor(),it.descriptor));let y=0,A=0;const O=[];let Z=3;e.forEach((it,gt)=>{const{indices:Bt,vertices:Rt,normals:Yt,size:vr,indexes:ln,count:cn}=this.triangulation(it,n);typeof cn=="number"&&(A+=cn),Bt.forEach(Pn=>{O.push(Pn+y)}),Z=vr;const Gr=Rt.length/vr;this.featureLayout.sizePerElement=Z,this.featureLayout.elements.push({featureIdx:gt,vertices:Rt,normals:Yt,offset:y}),y+=Gr;for(let Pn=0;Pn{Oa&&Oa.update&&Oa.buffer.data.push(...Oa.update(it,gt,Da,Pn,Oo,Bo))})}});const{createAttribute:Y,createBuffer:Q,createElements:ae}=this.rendererService,xe={};u.forEach((it,gt)=>{if(it){const{buffer:Bt,update:Rt,name:Yt}=it,vr=(0,Ge.Z)(it,St),ln=Y((0,Wt.Z)({buffer:Q(Bt)},vr));xe[it.name||""]=ln,this.attributes[gt].vertexAttribute=ln}});const Be=ae({data:O,type:Ee.UNSIGNED_INT,count:O.length});return this.attributesAndIndices={attributes:xe,elements:Be,count:A},Object.values(this.attributes).filter(it=>it.scale).forEach(it=>{const gt=it.name;a==null||a.emit(`legend:${gt}`,a.getLegend(gt))}),this.attributesAndIndices}createAttributes(e,r){this.featureLayout={sizePerElement:0,elements:[]},r&&(this.triangulation=r);const n=this.attributes.map(Y=>(Y.resetDescriptor(),Y.descriptor));let a=0;const u=[];let y=3;e.forEach((Y,Q)=>{const{indices:ae,vertices:xe,normals:Be,size:it,indexes:gt}=this.triangulation(Y);ae.forEach(Rt=>{u.push(Rt+a)}),y=it;const Bt=xe.length/it;this.featureLayout.sizePerElement=y,this.featureLayout.elements.push({featureIdx:Q,vertices:xe,normals:Be,offset:a}),a+=Bt;for(let Rt=0;Rt{cn&&cn.update&&cn.buffer.data.push(...cn.update(Y,Q,vr,Rt,Yt,ln))})}});const{createAttribute:A,createBuffer:O}=this.rendererService,Z={};return n.forEach((Y,Q)=>{if(Y){const{buffer:ae,update:xe,name:Be}=Y,it=(0,Ge.Z)(Y,xt),gt=A((0,Wt.Z)({buffer:O(ae)},it));Z[Y.name||""]=gt,this.attributes[Q].vertexAttribute=gt}}),{attributes:Z}}clearAllAttributes(){var e;this.attributes.forEach(r=>{r.vertexAttribute&&r.vertexAttribute.destroy()}),(e=this.attributesAndIndices)===null||e===void 0||e.elements.destroy(),this.attributes=[]}}var ft=Se(14224);function nr(t,e,r,n){function a(u){return u instanceof r?u:new r(function(y){y(u)})}return new(r||(r=Promise))(function(u,y){function A(Y){try{Z(n.next(Y))}catch(Q){y(Q)}}function O(Y){try{Z(n.throw(Y))}catch(Q){y(Q)}}function Z(Y){Y.done?u(Y.value):a(Y.value).then(A,O)}Z((n=n.apply(t,e||[])).next())})}function br(t,e){var r={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},n,a,u,y;return y={next:A(0),throw:A(1),return:A(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function A(Z){return function(Y){return O([Z,Y])}}function O(Z){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(u=Z[0]&2?a.return:Z[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,Z[1])).done)return u;switch(a=0,u&&(Z=[Z[0]&2,u.value]),Z[0]){case 0:case 1:u=Z;break;case 4:return r.label++,{value:Z[1],done:!1};case 5:r.label++,a=Z[1],Z=[0];continue;case 7:Z=r.ops.pop(),r.trys.pop();continue;default:if(u=r.trys,!(u=u.length>0&&u[u.length-1])&&(Z[0]===6||Z[0]===2)){r=0;continue}if(Z[0]===3&&(!u||Z[1]>u[0]&&Z[1]0)&&!(a=n.next()).done;)u.push(a.value)}catch(A){y={error:A}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(y)throw y.error}}return u}function Mn(t,e,r){if(r||arguments.length===2)for(var n=0,a=e.length,u;n=0&&n.length%1===0}t.exports=e.default})($n,$n.exports);var ti={},ri={exports:{}},hn={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(r){return function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];var u=n.pop();return r.call(this,n,u)}},t.exports=e.default})(hn,hn.exports);var An={};Object.defineProperty(An,"__esModule",{value:!0}),An.fallback=Go,An.wrap=hi;var Yi=An.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,Ci=An.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,fo=An.hasNextTick=typeof ft=="object"&&typeof ft.nextTick=="function";function Go(t){setTimeout(t,0)}function hi(t){return function(e){for(var r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return t(function(){return e.apply(void 0,r)})}}var zi;Yi?zi=queueMicrotask:Ci?zi=setImmediate:fo?zi=ft.nextTick:zi=Go,An.default=hi(zi),function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=O;var r=hn.exports,n=A(r),a=An,u=A(a),y=ti;function A(Q){return Q&&Q.__esModule?Q:{default:Q}}function O(Q){return(0,y.isAsync)(Q)?function(){for(var ae=[],xe=arguments.length;xe--;)ae[xe]=arguments[xe];var Be=ae.pop(),it=Q.apply(this,ae);return Z(it,Be)}:(0,n.default)(function(ae,xe){var Be;try{Be=Q.apply(this,ae)}catch(it){return xe(it)}if(Be&&typeof Be.then=="function")return Z(Be,xe);xe(null,Be)})}function Z(Q,ae){return Q.then(function(xe){Y(ae,null,xe)},function(xe){Y(ae,xe&&xe.message?xe:new Error(xe))})}function Y(Q,ae,xe){try{Q(ae,xe)}catch(Be){(0,u.default)(function(it){throw it},Be)}}t.exports=e.default}(ri,ri.exports),Object.defineProperty(ti,"__esModule",{value:!0}),ti.isAsyncIterable=ti.isAsyncGenerator=ti.isAsync=void 0;var Vo=ri.exports,Ka=ta(Vo);function ta(t){return t&&t.__esModule?t:{default:t}}function ka(t){return t[Symbol.toStringTag]==="AsyncFunction"}function ca(t){return t[Symbol.toStringTag]==="AsyncGenerator"}function Eo(t){return typeof t[Symbol.asyncIterator]=="function"}function Pa(t){if(typeof t!="function")throw new Error("expected a function");return ka(t)?(0,Ka.default)(t):t}ti.default=Pa,ti.isAsync=ka,ti.isAsyncGenerator=ca,ti.isAsyncIterable=Eo;var na={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;function r(n,a){if(a===void 0&&(a=n.length),!a)throw new Error("arity is undefined");function u(){for(var y=this,A=[],O=arguments.length;O--;)A[O]=arguments[O];return typeof A[a-1]=="function"?n.apply(this,A):new Promise(function(Z,Y){A[a-1]=function(Q){for(var ae=[],xe=arguments.length-1;xe-- >0;)ae[xe]=arguments[xe+1];if(Q)return Y(Q);Z(ae.length>1?ae:ae[0])},n.apply(y,A)})}return u}t.exports=e.default})(na,na.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=$n.exports,n=O(r),a=ti,u=O(a),y=na.exports,A=O(y);function O(Z){return Z&&Z.__esModule?Z:{default:Z}}e.default=(0,A.default)(function(Z,Y,Q){var ae=(0,n.default)(Y)?[]:{};Z(Y,function(xe,Be,it){(0,u.default)(xe)(function(gt){for(var Bt,Rt=[],Yt=arguments.length-1;Yt-- >0;)Rt[Yt]=arguments[Yt+1];Rt.length<2&&(Bt=Rt,Rt=Bt[0]),ae[Be]=Rt,it(gt)})},function(xe){return Q(xe,ae)})},3),t.exports=e.default}(Ai,Ai.exports);var ha={exports:{}},Xs={exports:{}},Ls={exports:{}},Ea={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;function r(n){function a(){for(var u=[],y=arguments.length;y--;)u[y]=arguments[y];if(n!==null){var A=n;n=null,A.apply(this,u)}}return Object.assign(a,n),a}t.exports=e.default})(Ea,Ea.exports);var ws={exports:{}},qs={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(r){return r[Symbol.iterator]&&r[Symbol.iterator]()},t.exports=e.default})(qs,qs.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Y;var r=$n.exports,n=y(r),a=qs.exports,u=y(a);function y(Q){return Q&&Q.__esModule?Q:{default:Q}}function A(Q){var ae=-1,xe=Q.length;return function(){return++ae=A||ae||Y||(ae=!0,y.next().then(function(Rt){var Yt=Rt.value,vr=Rt.done;if(!(Q||Y)){if(ae=!1,vr){Y=!0,xe<=0&&Z(null);return}xe++,O(Yt,Be,gt),Be++,it()}}).catch(Bt))}function gt(Rt,Yt){if(xe-=1,!Q){if(Rt)return Bt(Rt);if(Rt===!1){Y=!0,Q=!0;return}if(Yt===n.default||Y&&xe<=0)return Y=!0,Z(null);it()}}function Bt(Rt){Q||(ae=!1,Y=!0,Z(Rt))}it()}t.exports=e.default}(cu,cu.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=Ea.exports,n=xe(r),a=ws.exports,u=xe(a),y=ua.exports,A=xe(y),O=ti,Z=cu.exports,Y=xe(Z),Q=c.exports,ae=xe(Q);function xe(Be){return Be&&Be.__esModule?Be:{default:Be}}e.default=function(Be){return function(it,gt,Bt){if(Bt=(0,n.default)(Bt),Be<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!it)return Bt(null);if((0,O.isAsyncGenerator)(it))return(0,Y.default)(it,Be,gt,Bt);if((0,O.isAsyncIterable)(it))return(0,Y.default)(it[Symbol.asyncIterator](),Be,gt,Bt);var Rt=(0,u.default)(it),Yt=!1,vr=!1,ln=0,cn=!1;function Gr(Oo,Da){if(!vr)if(ln-=1,Oo)Yt=!0,Bt(Oo);else if(Oo===!1)Yt=!0,vr=!0;else{if(Da===ae.default||Yt&&ln<=0)return Yt=!0,Bt(null);cn||Pn()}}function Pn(){for(cn=!0;ln0;)Rt[Yt]=arguments[Yt+1];if(Bt!==!1){if(Bt||Be===ae.length)return xe.apply(void 0,[Bt].concat(Rt));it(Rt)}}it([])}e.default=(0,Z.default)(Q),t.exports=e.default})(J,J.exports);var oe=yn(J.exports),me=function(){function t(){this.tasks=[]}return t.prototype.call=function(){return oe(this.tasks)},t.prototype.tap=function(e,r){this.tasks.length===0?this.tasks.push(function(n){var a=r();n(a?null:!1,a)}):this.tasks.push(function(n,a){var u=r.apply(void 0,Mn([],Pr(n),!1));a(u?null:!1,e)})},t}(),Me=function(){function t(){this.tasks=[]}return t.prototype.call=function(){return o(this.tasks)},t.prototype.tap=function(e,r){this.tasks.push(function(n){var a=r();n(a,e)})},t}(),De=function(){function t(){this.args=[],this.tasks=[]}return t.prototype.promise=function(){for(var e=arguments,r=[],n=0;n{this.emit("resize"),this.$container&&(this.initContainer(),this.coordinateSystemService.needRefresh=!0,this.render())}),(0,K.Z)(this,"handleMapCameraChanged",r=>{this.cameraService.update(r),this.render()}),this.container=e,this.hooks={init:new De},this.id=e.id}init(e){var r=this;this.configService.setSceneConfig(this.id,e),this.shaderModuleService.registerBuiltinModules(),this.iconService.init(),this.iconService.on("imageUpdate",()=>this.render()),this.fontService.init(),this.hooks.init.tapPromise("initMap",(0,Nr.Z)(function*(){r.debugService.log("map.mapInitStart",{type:r.map.version}),yield new Promise(n=>{r.map.onCameraChanged(a=>{r.cameraService.init(),r.cameraService.update(a),n()}),r.map.init()}),r.map.onCameraChanged(r.handleMapCameraChanged),r.map.addMarkerContainer(),r.markerService.addMarkers(),r.markerService.addMarkerLayers(),r.popupService.initPopup(),r.interactionService.init(),r.interactionService.on(zr.Drag,r.addSceneEvent.bind(r))})),this.hooks.init.tapPromise("initRenderer",(0,Nr.Z)(function*(){var n;const a=((n=r.map)===null||n===void 0?void 0:n.getOverlayContainer())||void 0;if(a?r.$container=a:r.$container=N(r.configService.getSceneConfig(r.id).id||""),r.$container){if(r.canvas=Xo("canvas","",r.$container),r.setCanvas(),yield r.rendererService.init(r.canvas,r.configService.getSceneConfig(r.id),e.gl),r.registerContextLost(),r.initContainer(),r.resizeDetector=Ct()({strategy:"scroll"}),r.resizeDetector.listenTo(r.$container,r.handleWindowResized),window.matchMedia){var u;(u=window.matchMedia("screen and (-webkit-min-device-pixel-ratio: 1.5)"))===null||u===void 0||u.addListener(r.handleWindowResized.bind("screen"))}}else console.error("\u5BB9\u5668 id \u4E0D\u5B58\u5728");r.pickingService.init(r.id)})),this.render()}registerContextLost(){const e=this.rendererService.getCanvas();e&&e.addEventListener("webglcontextlost",()=>this.emit("webglcontextlost"))}addLayer(e){this.layerService.sceneService=this,this.layerService.add(e)}addMask(e){this.layerService.sceneService=this,this.layerService.addMask(e)}render(){var e=this;return(0,Nr.Z)(function*(){e.rendering||e.destroyed||(e.rendering=!0,e.inited?(yield e.layerService.initLayers(),yield e.layerService.renderLayers()):(yield e.hooks.init.promise(),e.destroyed&&e.destroy(),yield e.layerService.initLayers(),e.layerService.renderLayers(),e.controlService.addControls(),e.loaded=!0,e.emit("loaded"),e.inited=!0),e.rendering=!1)})()}addFontFace(e,r){this.fontService.addFontFace(e,r)}getSceneContainer(){return this.$container}exportPng(e){var r=this;return(0,Nr.Z)(function*(){var n;const a=(n=r.$container)===null||n===void 0?void 0:n.getElementsByTagName("canvas")[0];return yield r.render(),e==="jpg"?a==null?void 0:a.toDataURL("image/jpeg"):a==null?void 0:a.toDataURL("image/png")})()}getSceneConfig(){return this.configService.getSceneConfig(this.id)}getPointSizeRange(){return this.rendererService.getPointSizeRange()}addMarkerContainer(){const e=this.$container.parentElement;e!==null&&(this.markerContainer=Xo("div","l7-marker-container",e))}getMarkerContainer(){return this.markerContainer}destroy(){var e;if(!this.inited){this.destroyed=!0;return}this.resizeDetector.removeListener(this.$container,this.handleWindowResized),this.pickingService.destroy(),this.layerService.destroy(),this.interactionService.destroy(),this.controlService.destroy(),this.markerService.destroy(),this.fontService.destroy(),this.iconService.destroy(),this.removeAllListeners(),this.inited=!1,this.map.destroy(),setTimeout(()=>{var r;(r=this.$container)===null||r===void 0||r.removeChild(this.canvas),this.canvas=null,this.rendererService.destroy()}),(e=this.$container)===null||e===void 0||(e=e.parentNode)===null||e===void 0||e.removeChild(this.$container),this.emit("destroy")}initContainer(){var e,r;const n=Ll,a=((e=this.$container)===null||e===void 0?void 0:e.clientWidth)||400,u=((r=this.$container)===null||r===void 0?void 0:r.clientHeight)||300,y=this.canvas;y&&(y.width=a*n,y.height=u*n),this.rendererService.viewport({x:0,y:0,width:n*a,height:n*u})}setCanvas(){var e,r;const n=Ll,a=((e=this.$container)===null||e===void 0?void 0:e.clientWidth)||400,u=((r=this.$container)===null||r===void 0?void 0:r.clientHeight)||300,y=this.canvas;y.width=a*n,y.height=u*n,y.style.width="100%",y.style.height="100%"}addSceneEvent(e){this.emit(e.type,e)}}const{uniq:Kt}=es,Er="#define PI 3.14159265359",cr=`#define ambientRatio 0.5 #define diffuseRatio 0.3 #define specularRatio 0.2 float calc_lighting(vec4 pos) { vec3 worldPos = vec3(pos * u_ModelMatrix); vec3 worldNormal = a_Normal; // //cal light weight vec3 viewDir = normalize(u_CameraPosition - worldPos); vec3 lightDir = normalize(vec3(1, -10.5, 12)); vec3 halfDir = normalize(viewDir+lightDir); // //lambert float lambert = dot(worldNormal, lightDir); //specular float specular = pow(max(0.0, dot(worldNormal, halfDir)), 32.0); //sum to light weight float lightWeight = ambientRatio + diffuseRatio * lambert + specularRatio * specular; return lightWeight; } `,Rr=`#define SHIFT_RIGHT17 1.0 / 131072.0 #define SHIFT_RIGHT18 1.0 / 262144.0 #define SHIFT_RIGHT19 1.0 / 524288.0 #define SHIFT_RIGHT20 1.0 / 1048576.0 #define SHIFT_RIGHT21 1.0 / 2097152.0 #define SHIFT_RIGHT22 1.0 / 4194304.0 #define SHIFT_RIGHT23 1.0 / 8388608.0 #define SHIFT_RIGHT24 1.0 / 16777216.0 #define SHIFT_LEFT17 131072.0 #define SHIFT_LEFT18 262144.0 #define SHIFT_LEFT19 524288.0 #define SHIFT_LEFT20 1048576.0 #define SHIFT_LEFT21 2097152.0 #define SHIFT_LEFT22 4194304.0 #define SHIFT_LEFT23 8388608.0 #define SHIFT_LEFT24 16777216.0 vec2 unpack_float(float packedValue) { int packedIntValue = int(packedValue); int v0 = packedIntValue / 256; return vec2(v0, packedIntValue - v0 * 256); } vec4 decode_color(vec2 encodedColor) { return vec4( unpack_float(encodedColor[0]) / 255.0, unpack_float(encodedColor[1]) / 255.0 ); } `,Qr=`// Blinn-Phong model // apply lighting in vertex shader instead of fragment shader // @see https://learnopengl.com/Advanced-Lighting/Advanced-Lighting uniform float u_Ambient : 1.0; uniform float u_Diffuse : 1.0; uniform float u_Specular : 1.0; uniform int u_NumOfDirectionalLights : 1; uniform int u_NumOfSpotLights : 0; #define SHININESS 32.0 #define MAX_NUM_OF_DIRECTIONAL_LIGHTS 3 #define MAX_NUM_OF_SPOT_LIGHTS 3 struct DirectionalLight { vec3 direction; vec3 ambient; vec3 diffuse; vec3 specular; }; struct SpotLight { vec3 position; vec3 direction; vec3 ambient; vec3 diffuse; vec3 specular; float constant; float linear; float quadratic; float angle; float blur; float exponent; }; uniform DirectionalLight u_DirectionalLights[MAX_NUM_OF_DIRECTIONAL_LIGHTS]; uniform SpotLight u_SpotLights[MAX_NUM_OF_SPOT_LIGHTS]; vec3 calc_directional_light(DirectionalLight light, vec3 normal, vec3 viewDir) { vec3 lightDir = normalize(light.direction); // diffuse shading float diff = max(dot(normal, lightDir), 0.0); // Blinn-Phong specular shading vec3 halfwayDir = normalize(lightDir + viewDir); float spec = pow(max(dot(normal, halfwayDir), 0.0), SHININESS); vec3 ambient = light.ambient * u_Ambient; vec3 diffuse = light.diffuse * diff * u_Diffuse; vec3 specular = light.specular * spec * u_Specular; return ambient + diffuse + specular; } vec3 calc_lighting(vec3 position, vec3 normal, vec3 viewDir) { vec3 weight = vec3(0.0); for (int i = 0; i < MAX_NUM_OF_DIRECTIONAL_LIGHTS; i++) { if (i >= u_NumOfDirectionalLights) { break; } weight += calc_directional_light(u_DirectionalLights[i], normal, viewDir); } return weight; } `,Fn=` in vec4 v_PickingResult; #pragma include "picking_uniforms" #define PICKING_NONE 0.0 #define PICKING_ENCODE 1.0 #define PICKING_HIGHLIGHT 2.0 #define COLOR_SCALE 1. / 255. #define HIGHLIGHT 1.0 #define SELECT 2.0 /* * Returns highlight color if this item is selected. */ vec4 filterHighlightColor(vec4 color, float weight) { float activeType = v_PickingResult.a; if(activeType > 0.0) { vec4 highLightColor = activeType > 1.5 ? u_SelectColor : u_HighlightColor; highLightColor = highLightColor * COLOR_SCALE; float highLightAlpha = highLightColor.a; float highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha)); vec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio); return vec4(mix(resultRGB * weight, color.rgb, u_activeMix), color.a); } else { return color; } } /* * Returns picking color if picking enabled else unmodified argument. */ vec4 filterPickingColor(vec4 color) { vec3 pickingColor = v_PickingResult.rgb; if (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) { discard; } return u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color; } /* * Returns picking color if picking is enabled if not * highlight color if this item is selected, otherwise unmodified argument. */ vec4 filterColor(vec4 color) { // \u8FC7\u6EE4\u591A\u4F59\u7684 shader \u8BA1\u7B97 // return color; if(u_shaderPick < 0.5) { return color; // \u6682\u65F6\u53BB\u9664 \u76F4\u63A5\u53D6\u6D88\u8BA1\u7B97\u5728\u9009\u4E2D\u65F6\u62D6\u62FD\u5730\u56FE\u4F1A\u6709\u95EE\u9898 } else { return filterPickingColor(filterHighlightColor(color, 1.0)); } } vec4 filterColorAlpha(vec4 color, float alpha) { // \u8FC7\u6EE4\u591A\u4F59\u7684 shader \u8BA1\u7B97 // return color; if(u_shaderPick < 0.5) { return color; // \u6682\u65F6\u53BB\u9664 \u76F4\u63A5\u53D6\u6D88\u8BA1\u7B97\u5728\u9009\u4E2D\u65F6\u62D6\u62FD\u5730\u56FE\u4F1A\u6709\u95EE\u9898 } else { return filterPickingColor(filterHighlightColor(color, alpha)); } } `,Ki=`layout(location = 3) in vec3 a_PickingColor; out vec4 v_PickingResult; #pragma include "picking_uniforms" #define PICKING_NONE 0.0 #define PICKING_ENCODE 1.0 #define PICKING_HIGHLIGHT 2.0 #define COLOR_SCALE 1. / 255. #define NORMAL 0.0 #define HIGHLIGHT 1.0 #define SELECT 2.0 bool isVertexPicked(vec3 vertexColor) { return distance(vertexColor,u_PickingColor.rgb) < 0.01; } // \u5224\u65AD\u5F53\u524D\u70B9\u662F\u5426\u5DF2\u7ECF\u88AB select \u9009\u4E2D bool isVertexSelected(vec3 vertexColor) { return distance(vertexColor,u_CurrentSelectedId.rgb) < 0.01; } void setPickingColor(vec3 pickingColor) { if(u_shaderPick < 0.5) { return; } // compares only in highlight stage if(u_PickingStage == PICKING_HIGHLIGHT) { if(isVertexPicked(pickingColor)) { v_PickingResult = vec4(pickingColor.rgb * COLOR_SCALE,HIGHLIGHT); return; } if(isVertexSelected(pickingColor)) { v_PickingResult = vec4(u_CurrentSelectedId.rgb * COLOR_SCALE,SELECT); return; } } else { v_PickingResult= vec4(pickingColor.rgb * COLOR_SCALE,NORMAL); return; } // // v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && (isVertexPicked(pickingColor) || isVertexPicked(u_CurrentSelectedId))); // // Stores the picking color so that the fragment shader can render it during picking // v_PickingResult.rgb = pickingColor * COLOR_SCALE; } float setPickingSize(float x) { return u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x; } float setPickingOrder(float z) { bool selected = bool(v_PickingResult.a); return selected ? z + 1. : 0.; } `,Co=`layout(std140) uniform PickingUniforms { vec4 u_HighlightColor; vec4 u_SelectColor; vec3 u_PickingColor; float u_PickingStage; vec3 u_CurrentSelectedId; float u_PickingThreshold; float u_PickingBuffer; float u_shaderPick; float u_activeMix; };`,$i=` #define E 2.718281828459045 vec2 ProjectFlat(vec2 lnglat){ float maxs=85.0511287798; float lat=max(min(maxs,lnglat.y),-maxs); float scale= 268435456.; float d=PI/180.; float x=lnglat.x*d; float y=lat*d; y=log(tan((PI/4.)+(y/2.))); float a=.5/PI, b=.5, c=-.5/PI; d=.5; x=scale*(a*x+b); y=scale*(c*y+d); return vec2(x,y); } vec2 unProjectFlat(vec2 px){ float a=.5/PI; float b=.5; float c=-.5/PI; float d=.5; float scale = 268435456.; float x=(px.x/scale-b)/a; float y=(px.y/scale-d)/c; y=(atan(pow(E,y))-(PI/4.))*2.; d=PI/180.; float lat=y/d; float lng=x/d; return vec2(lng,lat); } float pixelDistance(vec2 from, vec2 to) { vec2 a1 = ProjectFlat(from); vec2 b1 = ProjectFlat(to); return distance(a1, b1); } // gaode2.0 vec2 customProject(vec2 lnglat) { // \u7ECF\u7EAC\u5EA6 => \u5E73\u9762\u5750\u6807 float t = lnglat.x; float e = lnglat.y; float Sm = 180.0 / PI; float Tm = 6378137.0; float Rm = PI / 180.0; float r = 85.0511287798; e = max(min(r, e), -r); t *= Rm; e *= Rm; e = log(tan(PI / 4.0 + e / 2.0)); return vec2(t * Tm, e * Tm); } vec2 unProjCustomCoord(vec2 point) { // \u5E73\u9762\u5750\u6807 => \u7ECF\u7EAC\u5EA6 float Sm = 57.29577951308232; //180 / Math.PI float Tm = 6378137.0; float t = point.x; float e = point.y; return vec2(t / Tm * Sm, (2.0 * atan(exp(e / Tm)) - PI / 2.0) * Sm); } float customPixelDistance(vec2 from, vec2 to) { vec2 a1 = ProjectFlat(from); vec2 b1 = ProjectFlat(to); return distance(a1, b1); }`,Zi=`#define TILE_SIZE 512.0 #define PI 3.1415926536 #define WORLD_SCALE TILE_SIZE / (PI * 2.0) #define EARTH_CIRCUMFERENCE 40.03e6 #define COORDINATE_SYSTEM_LNGLAT 1.0 // mapbox #define COORDINATE_SYSTEM_LNGLAT_OFFSET 2.0 // mapbox offset #define COORDINATE_SYSTEM_VECTOR_TILE 3.0 #define COORDINATE_SYSTEM_IDENTITY 4.0 #define COORDINATE_SYSTEM_P20 5.0 // amap #define COORDINATE_SYSTEM_P20_OFFSET 6.0 // amap offset #define COORDINATE_SYSTEM_METER_OFFSET 7.0 #define COORDINATE_SYSTEM_P20_2 8.0 // amap2.0 #pragma include "scene_uniforms" // web mercator coords -> world coords vec2 project_mercator(vec2 lnglat) { if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.0 return lnglat; } float x = lnglat.x; return vec2( radians(x) + PI, PI - log(tan(PI * 0.25 + radians(lnglat.y) * 0.5)) ); } float project_scale(float meters) { return meters * u_PixelsPerMeter.z; } // offset coords -> world coords vec4 project_offset(vec4 offset) { float dy = offset.y; dy = clamp(dy, -1., 1.); vec3 pixels_per_unit = u_PixelsPerDegree + u_PixelsPerDegree2 * dy; return vec4(offset.xyz * pixels_per_unit, offset.w); } vec3 project_normal(vec3 normal) { vec4 normal_modelspace = u_ModelMatrix * vec4(normal, 0.0); return normalize(normal_modelspace.xyz * u_PixelsPerMeter); } vec3 project_offset_normal(vec3 vector) { if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01 || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // normals generated by the polygon tesselator are in lnglat offsets instead of meters return normalize(vector * u_PixelsPerDegree); } return project_normal(vector); } // || u_CoordinateSystem < COORDINATE_SYSTEM_P20_OFFSET + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_P20_OFFSET - 0.01 // reverse Y vec3 reverse_offset_normal(vec3 vector) { if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 ||u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET ) { return vector * vec3(1.0, -1.0, 1.0); } if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.0 return vector; } return vector; } vec4 project_mvt_offset_position(vec4 position) { float a = COORDINATE_SYSTEM_LNGLAT_OFFSET; float b = COORDINATE_SYSTEM_P20_OFFSET; float c = COORDINATE_SYSTEM_LNGLAT; if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) { return project_offset(vec4(0.0, 0.0, position.z, position.w)); } if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01) { return vec4( project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale, project_scale(position.z), position.w ); } return position; } vec4 project_position(vec4 position) { float a = COORDINATE_SYSTEM_LNGLAT_OFFSET; float b = COORDINATE_SYSTEM_P20_OFFSET; float c = COORDINATE_SYSTEM_LNGLAT; if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) { float X = position.x - u_ViewportCenter.x; float Y = position.y - u_ViewportCenter.y; return project_offset(vec4(X, Y, position.z, position.w)); } if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01) { return vec4( project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale, project_scale(position.z), position.w ); } if (u_CoordinateSystem == COORDINATE_SYSTEM_P20) { return vec4( (project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale - vec2(215440491., 106744817.)) * vec2(1., -1.), project_scale(position.z), position.w ); } // if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // return vec4( // position.xy, // project_scale(position.z), // position.w); // } return position; // TODO: \u74E6\u7247\u5750\u6807\u7CFB & \u5E38\u89C4\u4E16\u754C\u5750\u6807\u7CFB } vec2 project_pixel_size_to_clipspace(vec2 pixels) { vec2 offset = pixels / u_ViewportSize * u_DevicePixelRatio * 2.0; return offset * u_FocalDistance; } float project_pixel_allmap(float pixel) { if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT) { return pixel * pow(2.0, u_Zoom); } return pixel * u_FocalDistance ; } // \u9002\u914D\u7EB9\u7406\u8D34\u56FE\u7684\u7B49\u50CF\u7D20\u5927\u5C0F float project_pixel_texture(float pixel) { // mapbox zoom > 12 if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { return pixel * pow(0.5, u_Zoom) * u_FocalDistance ; } // amap2 zoom > 12 if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom))* u_FocalDistance ; } // amap zoom > 12 if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) { return pixel * pow(0.5, u_Zoom)* u_FocalDistance ; } // amap zoom < 12 if (u_CoordinateSystem == COORDINATE_SYSTEM_P20) { return pixel * pow(2.0, (20.0 - u_Zoom))* u_FocalDistance ; } return pixel * 2.0 * u_FocalDistance;; } // \u5728\u4E0D\u8BBA\u4EC0\u4E48\u5E95\u56FE\u4E0B\u9700\u8981\u7EDF\u4E00\u5904\u7406\u7684\u65F6\u5019\u4F7F\u7528 float project_float_pixel(float pixel) { if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // mapbox P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1 return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ; } if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) { // amap P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1 return pixel * pow(2.0, (19.0 - u_Zoom)); } if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // amap2 P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3 return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom))* u_FocalDistance ; } return pixel * u_FocalDistance; } // Project meter into the unit of pixel which used in the camera world space float project_float_meter(float meter) { if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // Since the zoom level uniform is updated by mapservice and it's alread been subtracted by 1 // Not sure if we are supposed to do that again return meter; } else { return project_float_pixel(meter); } // TODO: change the following code to make adaptations for amap // return u_FocalDistance * TILE_SIZE * pow(2.0, u_Zoom) * meter / EARTH_CIRCUMFERENCE; } float project_pixel(float pixel) { if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) { // amap P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1 return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ; } if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // amap2 P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3 return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom)) * u_FocalDistance ; } return pixel * u_FocalDistance; } vec2 project_pixel(vec2 pixel) { if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) { // P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1 return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ; } if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3 return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom)) * u_FocalDistance ; } return pixel * -1. * u_FocalDistance; } vec3 project_pixel(vec3 pixel) { if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) { // P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1 return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ; } if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3 return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom)) * u_FocalDistance ; } return pixel * -1. * u_FocalDistance; } vec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) { if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // Needs to be divided with project_uCommonUnitsPerMeter position.w *= u_PixelsPerMeter.z; } return viewProjectionMatrix * position + center; } // Projects from common space coordinates to clip space vec4 project_common_position_to_clipspace(vec4 position) { return project_common_position_to_clipspace( position, u_ViewProjectionMatrix, u_ViewportCenterProjection ); } vec4 unproject_clipspace_to_position(vec4 clipspacePos, mat4 u_InverseViewProjectionMatrix) { vec4 pos = u_InverseViewProjectionMatrix * (clipspacePos - u_ViewportCenterProjection); if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // Needs to be divided with project_uCommonUnitsPerMeter pos.w = pos.w / u_PixelsPerMeter.z; } return pos; } bool isEqual( float a, float b) { return a< b + 0.001 && a > b - 0.001; } // \u652F\u6301 GaodeV2\u3001Mapbox vec4 project_common_position_to_clipspace_v2(vec4 position) { if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x return u_Mvp * position; } else { return project_common_position_to_clipspace(position); } } `,Ri=`vec2 rotate_matrix(vec2 v, float a) { float b = a / 180.0 * 3.1415926535897932384626433832795; float s = sin(b); float c = cos(b); mat2 m = mat2(c, s, -s, c); return m * v; }`,vo=`layout(std140) uniform SceneUniforms { mat4 u_ViewMatrix; mat4 u_ProjectionMatrix; mat4 u_ViewProjectionMatrix; mat4 u_ModelMatrix; vec4 u_ViewportCenterProjection; vec3 u_PixelsPerDegree; float u_Zoom; vec3 u_PixelsPerDegree2; float u_ZoomScale; vec3 u_PixelsPerMeter; float u_CoordinateSystem; vec3 u_CameraPosition; float u_DevicePixelRatio; vec2 u_ViewportCenter; vec2 u_ViewportSize; float u_FocalDistance; }; layout(std140) uniform LayerUniforms { mat4 u_Mvp; vec2 u_sceneCenterMercator; }; `,Ii=`/** * 2D signed distance field functions * @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm */ float ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; } float sdCircle(vec2 p, float r) { return length(p) - r; } float sdEquilateralTriangle(vec2 p) { float k = sqrt(3.0); p.x = abs(p.x) - 1.0; p.y = p.y + 1.0/k; if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0; p.x -= clamp( p.x, -2.0, 0.0 ); return -length(p)*sign(p.y); } float sdBox(vec2 p, vec2 b) { vec2 d = abs(p)-b; return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0); } float sdPentagon(vec2 p, float r) { vec3 k = vec3(0.809016994,0.587785252,0.726542528); p.x = abs(p.x); p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y); p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y); p -= vec2(clamp(p.x,-r*k.z,r*k.z),r); return length(p)*sign(p.y); } float sdHexagon(vec2 p, float r) { vec3 k = vec3(-0.866025404,0.5,0.577350269); p = abs(p); p -= 2.0*min(dot(k.xy,p),0.0)*k.xy; p -= vec2(clamp(p.x, -k.z*r, k.z*r), r); return length(p)*sign(p.y); } float sdOctogon(vec2 p, float r) { vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 ); p = abs(p); p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y); p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y); p -= vec2(clamp(p.x, -k.z*r, k.z*r), r); return length(p)*sign(p.y); } float sdHexagram(vec2 p, float r) { vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076); p = abs(p); p -= 2.0*min(dot(k.xy,p),0.0)*k.xy; p -= 2.0*min(dot(k.yx,p),0.0)*k.yx; p -= vec2(clamp(p.x,r*k.z,r*k.w),r); return length(p)*sign(p.y); } float sdRhombus(vec2 p, vec2 b) { vec2 q = abs(p); float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0); float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) ); return d * sign( q.x*b.y + q.y*b.x - b.x*b.y ); } float sdVesica(vec2 p, float r, float d) { p = abs(p); float b = sqrt(r*r-d*d); // can delay this sqrt return ((p.y-b)*d>p.x*b) ? length(p-vec2(0.0,b)) : length(p-vec2(-d,0.0))-r; } `,ni=/precision\s+(high|low|medium)p\s+float/,jo=`#ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; #else precision mediump float; #endif `,Do=/#pragma include (["^+"]?["[a-zA-Z_0-9](.*)"]*?)/g,rs=/void\s+main\s*\([^)]*\)\s*\{\n?/;class iu{constructor(){(0,K.Z)(this,"moduleCache",{}),(0,K.Z)(this,"rawContentCache",{})}registerBuiltinModules(){this.destroy(),this.registerModule("common",{vs:Er,fs:Er}),this.registerModule("decode",{vs:Rr,fs:""}),this.registerModule("scene_uniforms",{vs:vo,fs:vo}),this.registerModule("picking_uniforms",{vs:Co,fs:Co}),this.registerModule("projection",{vs:Zi,fs:Zi}),this.registerModule("project",{vs:$i,fs:""}),this.registerModule("sdf_2d",{vs:"",fs:Ii}),this.registerModule("lighting",{vs:Qr,fs:""}),this.registerModule("light",{vs:cr,fs:""}),this.registerModule("picking",{vs:Ki,fs:Fn}),this.registerModule("rotation_2d",{vs:Ri,fs:""})}registerModule(e,r){r.vs=r.vs.replace(/\r\n/g,` `),r.fs=r.fs.replace(/\r\n/g,` `);const{vs:n,fs:a,uniforms:u,inject:y}=r,{content:A,uniforms:O}=ps(n),{content:Z,uniforms:Y}=ps(a);this.rawContentCache[e]={fs:Z,inject:y,uniforms:(0,Wt.Z)((0,Wt.Z)((0,Wt.Z)({},O),Y),u),vs:A}}destroy(){this.moduleCache={},this.rawContentCache={}}getModule(e){let r=this.rawContentCache[e].vs,n=this.rawContentCache[e].fs;const a=this.rawContentCache[e].inject;let u={};a!=null&&a["vs:#decl"]&&(r=(a==null?void 0:a["vs:#decl"])+r,u=ps(a==null?void 0:a["vs:#decl"]).uniforms),a!=null&&a["vs:#main-start"]&&(r=r.replace(rs,xe=>xe+(a==null?void 0:a["vs:#main-start"]))),a!=null&&a["fs:#decl"]&&(n=(a==null?void 0:a["fs:#decl"])+n);const{content:y,includeList:A}=this.processModule(r,[],"vs"),{content:O,includeList:Z}=this.processModule(n,[],"fs");let Y="";const Q=Kt(A.concat(Z).concat(e)).reduce((xe,Be)=>(0,Wt.Z)((0,Wt.Z)({},xe),this.rawContentCache[Be].uniforms),(0,Wt.Z)({},u));ni.test(O)||(Y=Y+jo),Y=Y+O;let ae="";return ni.test(y)||(ae=ae+jo),ae=ae+y,this.moduleCache[e]={fs:Y.trim(),uniforms:Q,vs:ae.trim()},this.moduleCache[e]}processModule(e,r,n){return{content:e.replace(Do,(u,y)=>{const O=y.split(" ")[0].replace(/"/g,"");if(r.indexOf(O)>-1)return"";const Z=this.rawContentCache[O][n];r.push(O);const{content:Y}=this.processModule(Z,r,n);return Y}),includeList:r}}injectDefines(e){return Object.keys(e).reduce((n,a)=>n+`#define ${a.toUpperCase()} ${e[a]}; `,` `)}}class tl{constructor(){(0,K.Z)(this,"shaderModuleService",void 0),(0,K.Z)(this,"rendererService",void 0),(0,K.Z)(this,"cameraService",void 0),(0,K.Z)(this,"mapService",void 0),(0,K.Z)(this,"interactionService",void 0),(0,K.Z)(this,"layerService",void 0),(0,K.Z)(this,"config",void 0)}getName(){return""}getType(){return Ei.Normal}init(e,r){this.config=r,this.rendererService=e.getContainer().rendererService,this.cameraService=e.getContainer().cameraService,this.mapService=e.getContainer().mapService,this.interactionService=e.getContainer().interactionService,this.layerService=e.getContainer().layerService,this.shaderModuleService=e.getContainer().shaderModuleService}render(e){}}class gc extends tl{getName(){return"clear"}init(e,r){super.init(e,r)}render(){this.rendererService.clear({color:[0,0,0,0],depth:1,framebuffer:null})}}class Pp{constructor(e){(0,K.Z)(this,"passes",[]),(0,K.Z)(this,"layer",void 0),(0,K.Z)(this,"renderFlag",void 0),(0,K.Z)(this,"width",0),(0,K.Z)(this,"height",0),this.postProcessor=e}setLayer(e){this.layer=e}setRenderFlag(e){this.renderFlag=e}getRenderFlag(){return this.renderFlag}getPostProcessor(){return this.postProcessor}render(){var e=this;return(0,Nr.Z)(function*(){for(const r of e.passes)yield r.render(e.layer);yield e.postProcessor.render(e.layer)})()}resize(e,r){(this.width!==e||this.height!==r)&&(this.postProcessor.resize(e,r),this.width=e,this.height=r)}add(e,r){e.getType()===Ei.PostProcessing?this.postProcessor.add(e,this.layer,r):(e.init(this.layer,r),this.passes.push(e))}insert(e,r,n){e.init(this.layer,r),this.passes.splice(n,0,e)}destroy(){this.passes.length=0}}class sp extends tl{constructor(...e){var r;super(...e),r=this,(0,K.Z)(this,"pickingFBO",void 0),(0,K.Z)(this,"layer",void 0),(0,K.Z)(this,"width",0),(0,K.Z)(this,"height",0),(0,K.Z)(this,"alreadyInRendering",!1),(0,K.Z)(this,"pickFromPickingFBO",({x:n,y:a,lngLat:u,type:y})=>{if(!this.layer.isVisible()||!this.layer.needPick(y))return;const{getViewportSize:A,readPixelsAsync:O,useFramebuffer:Z}=this.rendererService,{width:Y,height:Q}=A(),{enableHighlight:ae,enableSelect:xe}=this.layer.getLayerConfig(),Be=n*Ll,it=a*Ll;if(Be>Y||Be<0||it>Q||it<0)return;let gt;Z(this.pickingFBO,(0,Nr.Z)(function*(){var Bt;if(gt=yield O({x:Math.round(Be),y:Math.round(Q-(a+1)*Ll),width:1,height:1,data:new Uint8Array(1*1*4),framebuffer:r.pickingFBO}),gt[0]!==0||gt[1]!==0||gt[2]!==0){const Rt=Aa(gt),Yt=r.layer.getSource().getFeatureById(Rt),vr={x:n,y:a,type:y,lngLat:u,featureId:Rt,feature:Yt};Yt&&(r.layer.setCurrentPickId(Rt),r.triggerHoverOnLayer(vr))}else{const Rt={x:n,y:a,lngLat:u,type:r.layer.getCurrentPickId()===null?"un"+y:"mouseout",featureId:null,feature:null};r.triggerHoverOnLayer((0,Wt.Z)((0,Wt.Z)({},Rt),{},{type:"unpick"})),r.triggerHoverOnLayer(Rt),r.layer.setCurrentPickId(null)}ae&&r.highlightPickedFeature(gt),xe&&y==="click"&&((Bt=gt)===null||Bt===void 0?void 0:Bt.toString())!==[0,0,0,0].toString()&&r.selectFeature(gt)}))})}getType(){return Ei.Normal}getName(){return"pixelPicking"}init(e,r){super.init(e,r),this.layer=e;const{createTexture2D:n,createFramebuffer:a,getViewportSize:u}=this.rendererService,{width:y,height:A}=u(),O=n({width:y,height:A,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE,label:"Picking Texture"});this.pickingFBO=a({color:O}),this.interactionService.on(zr.Hover,this.pickFromPickingFBO),this.interactionService.on(zr.Select,this.selectFeatureHandle.bind(this)),this.interactionService.on(zr.Active,this.highlightFeatureHandle.bind(this))}render(e){if(this.alreadyInRendering)return;const{getViewportSize:r,useFramebuffer:n,clear:a}=this.rendererService,{width:u,height:y}=r();this.alreadyInRendering=!0,(this.width!==u||this.height!==y)&&(this.pickingFBO.resize({width:u,height:y}),this.width=u,this.height=y),n(this.pickingFBO,()=>{a({framebuffer:this.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});const A=this.layer.multiPassRenderer.getRenderFlag();this.layer.multiPassRenderer.setRenderFlag(!1),e.hooks.beforePickingEncode.call(),e.render(),e.hooks.afterPickingEncode.call(),this.layer.multiPassRenderer.setRenderFlag(A),this.alreadyInRendering=!1})}triggerHoverOnLayer(e){this.layer.emit(e.type,e)}highlightPickedFeature(e){const[r,n,a]=e;this.layer.hooks.beforeHighlight.call([r,n,a]),this.layerService.renderLayers()}selectFeature(e){const[r,n,a]=e;this.layer.hooks.beforeSelect.call([r,n,a]),this.layerService.renderLayers()}selectFeatureHandle({featureId:e}){const r=Ni(e);this.selectFeature(new Uint8Array(r))}highlightFeatureHandle({featureId:e}){const r=Ni(e);this.highlightPickedFeature(new Uint8Array(r))}}class kc{constructor(e){(0,K.Z)(this,"passes",[]),(0,K.Z)(this,"readFBO",void 0),(0,K.Z)(this,"writeFBO",void 0),this.rendererService=e,this.init()}getReadFBO(){return this.readFBO}getWriteFBO(){return this.writeFBO}getCurrentFBOTex(){const{getViewportSize:e,createTexture2D:r}=this.rendererService,{width:n,height:a}=e();return r({x:0,y:0,width:n,height:a,copy:!0})}getReadFBOTex(){var e=this;const{useFramebuffer:r}=this.rendererService;return new Promise(n=>{r(this.readFBO,(0,Nr.Z)(function*(){n(e.getCurrentFBOTex())}))})}renderBloomPass(e,r){var n=this;return(0,Nr.Z)(function*(){const a=yield n.getReadFBOTex();let u=0;for(;u<4;)yield r.render(e,a),n.swap(),u++})()}render(e){var r=this;return(0,Nr.Z)(function*(){for(let n=0;nr.getName()===e)}init(){const{createFramebuffer:e,createTexture2D:r}=this.rendererService;this.readFBO=e({color:r({width:1,height:1,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE})}),this.writeFBO=e({color:r({width:1,height:1,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE})})}isLastEnabledPass(e){for(let r=e+1;r{n({color:[0,0,0,0],depth:1,stencil:0,framebuffer:a}),e.multiPassRenderer.setRenderFlag(!1),e.models.forEach(u=>{u.draw({uniforms:e.layerModel.getUninforms()})}),e.multiPassRenderer.setRenderFlag(!0)})}}const lp=`uniform float u_opacity : 1.0; uniform float u_MixRatio : 0.5; uniform sampler2D u_Diffuse1; uniform sampler2D u_Diffuse2; varying vec2 v_UV; void main() { vec4 texel1 = texture2D(u_Diffuse1, v_UV); vec4 texel2 = texture2D(u_Diffuse2, v_UV); gl_FragColor = u_opacity * mix(texel1, texel2, u_MixRatio); } `,vh=`varying vec2 v_UV; uniform sampler2D u_Texture; void main() { gl_FragColor = vec4(texture2D(u_Texture, v_UV)); }`,Ys=`attribute vec2 a_Position; varying vec2 v_UV; void main() { v_UV = 0.5 * (a_Position + 1.0); gl_Position = vec4(a_Position, 0., 1.); }`;function jl(t,e){let r=0,n=1/e,a=t;for(;a>0;)r=r+n*(a%e),a=Math.floor(a/e),n=n/e;return r}let _h=1;class vc extends tl{constructor(e){super(),(0,K.Z)(this,"haltonSequence",[]),(0,K.Z)(this,"accumulatingId",0),(0,K.Z)(this,"frame",0),(0,K.Z)(this,"timer",void 0),(0,K.Z)(this,"sampleRenderTarget",void 0),(0,K.Z)(this,"prevRenderTarget",void 0),(0,K.Z)(this,"outputRenderTarget",void 0),(0,K.Z)(this,"copyRenderTarget",void 0),(0,K.Z)(this,"blendModel",void 0),(0,K.Z)(this,"outputModel",void 0),(0,K.Z)(this,"copyModel",void 0),this.shaderModuleService=e}getType(){return Ei.Normal}getName(){return"taa"}init(e,r){super.init(e,r);const{createFramebuffer:n,createTexture2D:a}=this.rendererService;this.sampleRenderTarget=n({color:a({width:1,height:1,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE})}),this.prevRenderTarget=n({color:a({width:1,height:1,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE})}),this.outputRenderTarget=n({color:a({width:1,height:1,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE})}),this.copyRenderTarget=n({color:a({width:1,height:1,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE})});for(let u=0;u<30;u++)this.haltonSequence.push([jl(u,2),jl(u,3)]);this.blendModel=this.createTriangleModel("blend-pass",lp),this.outputModel=this.createTriangleModel("copy-pass",vh,{blend:{enable:!0,func:{srcRGB:Ee.ONE,dstRGB:Ee.ONE_MINUS_SRC_ALPHA,srcAlpha:Ee.ONE,dstAlpha:Ee.ONE_MINUS_SRC_ALPHA},equation:{rgb:Ee.FUNC_ADD,alpha:Ee.FUNC_ADD}}}),this.copyModel=this.createTriangleModel("copy-pass",vh)}render(e){const{clear:r,getViewportSize:n,useFramebuffer:a}=this.rendererService,{width:u,height:y}=n();this.sampleRenderTarget.resize({width:u,height:y}),this.prevRenderTarget.resize({width:u,height:y}),this.outputRenderTarget.resize({width:u,height:y}),this.copyRenderTarget.resize({width:u,height:y}),this.resetFrame(),this.stopAccumulating();const A=e.multiPassRenderer.getPostProcessor().getReadFBO();a(A,()=>{r({color:[0,0,0,0],depth:1,stencil:0,framebuffer:A}),e.multiPassRenderer.setRenderFlag(!1),e.render(),e.multiPassRenderer.setRenderFlag(!0)});const O=Z=>{!this.accumulatingId||Z!==this.accumulatingId||this.isFinished()||(this.doRender(e),window.requestAnimationFrame(()=>{O(Z)}))};this.accumulatingId=_h++,this.timer=window.setTimeout(()=>{O(this.accumulatingId)},50)}doRender(e){const{clear:r,getViewportSize:n,useFramebuffer:a}=this.rendererService,{width:u,height:y}=n(),{jitterScale:A=1}=e.getLayerConfig(),O=this.haltonSequence[this.frame%this.haltonSequence.length];this.cameraService.jitterProjectionMatrix((O[0]*2-1)/u*A,(O[1]*2-1)/y*A),e.multiPassRenderer.setRenderFlag(!1),e.hooks.beforeRender.call(),a(this.sampleRenderTarget,()=>{r({color:[0,0,0,0],depth:1,stencil:0,framebuffer:this.sampleRenderTarget}),e.render()}),e.hooks.afterRender.call(),e.multiPassRenderer.setRenderFlag(!0);const Z=e.getLayerConfig();a(this.outputRenderTarget,()=>{this.blendModel.draw({uniforms:{u_opacity:Z.opacity||1,u_MixRatio:this.frame===0?1:.9,u_Diffuse1:this.sampleRenderTarget,u_Diffuse2:this.frame===0?e.multiPassRenderer.getPostProcessor().getReadFBO():this.prevRenderTarget}})}),this.frame===0&&r({color:[0,0,0,0],depth:1,stencil:0,framebuffer:this.copyRenderTarget}),this.frame>=1&&(a(this.copyRenderTarget,()=>{this.outputModel.draw({uniforms:{u_Texture:this.outputRenderTarget}})}),a(e.multiPassRenderer.getPostProcessor().getReadFBO(),()=>{this.copyModel.draw({uniforms:{u_Texture:this.copyRenderTarget}})}),e.multiPassRenderer.getPostProcessor().render(e));const Y=this.prevRenderTarget;this.prevRenderTarget=this.outputRenderTarget,this.outputRenderTarget=Y,this.frame++,this.cameraService.clearJitterProjectionMatrix()}isFinished(){return this.frame>=this.haltonSequence.length}resetFrame(){this.frame=0}stopAccumulating(){this.accumulatingId=0,window.clearTimeout(this.timer)}createTriangleModel(e,r,n){this.shaderModuleService.registerModule(e,{vs:Ys,fs:r});const{vs:a,fs:u,uniforms:y}=this.shaderModuleService.getModule(e),{createAttribute:A,createBuffer:O,createModel:Z}=this.rendererService;return Z((0,Wt.Z)({vs:a,fs:u,attributes:{a_Position:A({buffer:O({data:[-4,-4,4,-4,0,4],type:Ee.FLOAT}),size:2})},uniforms:(0,Wt.Z)({},y),depth:{enable:!1},count:3},n))}}const xp=`varying vec2 v_UV; uniform float u_BloomFinal: 0.0; uniform sampler2D u_Texture; uniform sampler2D u_Texture2; uniform vec2 u_ViewportSize: [1.0, 1.0]; uniform float u_radius: 5.0; uniform float u_intensity: 0.3; uniform float u_baseRadio: 0.5; // https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl vec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) { vec4 color = vec4(0.0); vec2 off1 = vec2(1.3846153846) * direction; vec2 off2 = vec2(3.2307692308) * direction; color += texture2D(image, uv) * 0.2270270270; color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162; color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162; color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703; color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703; return color; } float luminance(vec4 color) { return 0.2125 * color.r + 0.7154 * color.g + 0.0721 * color.b; } void main() { // vec4 baseColor = texture2D(u_Texture, v_UV); float r = sqrt(u_radius); vec4 c1 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(u_radius, 0.0)); // c1 *= luminance(c1); vec4 c2 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(0.0, u_radius)); // c2 *= luminance(c2); vec4 c3 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(r, r)); // c3 *= luminance(c3); vec4 c4 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(r, -r)); // c4 *= luminance(c4); vec4 inbloomColor = (c1 + c2 + c3 + c4) * 0.25; // float lum = luminance(inbloomColor); // inbloomColor.rgb *= lum; if(u_BloomFinal > 0.0) { vec4 baseColor = texture2D(u_Texture2, v_UV); float baselum = luminance(baseColor); gl_FragColor = mix(inbloomColor, baseColor, u_baseRadio); if(baselum <= 0.2) { gl_FragColor = inbloomColor * u_intensity; } } else { gl_FragColor = inbloomColor; } }`,up=`attribute vec2 a_Position; varying vec2 v_UV; void main() { v_UV = 0.5 * (a_Position + 1.0); gl_Position = vec4(a_Position, 0., 1.); }`,{isNil:Mh}=es;class _c extends Bl{setupShaders(){this.shaderModuleService.registerModule("blur-pass",{vs:up,fs:xp});const{vs:e,fs:r,uniforms:n}=this.shaderModuleService.getModule("blur-pass"),{width:a,height:u}=this.rendererService.getViewportSize();return{vs:e,fs:r,uniforms:(0,Wt.Z)((0,Wt.Z)({},n),{},{u_ViewportSize:[a,u]})}}convertOptionsToUniforms(e){const r={};return Mh(e.bloomRadius)||(r.u_radius=e.bloomRadius),Mh(e.bloomIntensity)||(r.u_intensity=e.bloomIntensity),Mh(e.bloomBaseRadio)||(r.u_baseRadio=e.bloomBaseRadio),r}}const oc=`varying vec2 v_UV; uniform sampler2D u_Texture; uniform vec2 u_ViewportSize: [1.0, 1.0]; uniform vec2 u_BlurDir: [1.0, 0.0]; // https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl vec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) { vec4 color = vec4(0.0); vec2 off1 = vec2(1.3846153846) * direction; vec2 off2 = vec2(3.2307692308) * direction; color += texture2D(image, uv) * 0.2270270270; color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162; color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162; color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703; color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703; return color; } void main() { gl_FragColor = blur9(u_Texture, v_UV, u_ViewportSize, u_BlurDir); }`,Ss=`attribute vec2 a_Position; varying vec2 v_UV; void main() { v_UV = 0.5 * (a_Position + 1.0); gl_Position = vec4(a_Position, 0., 1.); }`,{isNil:Ph}=es;class Rh extends Bl{setupShaders(){this.shaderModuleService.registerModule("blur-pass",{vs:Ss,fs:oc});const{vs:e,fs:r,uniforms:n}=this.shaderModuleService.getModule("blur-pass"),{width:a,height:u}=this.rendererService.getViewportSize();return{vs:e,fs:r,uniforms:(0,Wt.Z)((0,Wt.Z)({},n),{},{u_ViewportSize:[a,u]})}}convertOptionsToUniforms(e){const r={};return Ph(e.blurRadius)||(r.u_BlurDir=[e.blurRadius,0]),r}}const Nc=`varying vec2 v_UV; uniform sampler2D u_Texture; uniform vec2 u_ViewportSize: [1.0, 1.0]; uniform vec2 u_BlurDir: [1.0, 0.0]; // https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl vec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) { vec4 color = vec4(0.0); vec2 off1 = vec2(1.3846153846) * direction; vec2 off2 = vec2(3.2307692308) * direction; color += texture2D(image, uv) * 0.2270270270; color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162; color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162; color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703; color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703; return color; } void main() { gl_FragColor = blur9(u_Texture, v_UV, u_ViewportSize, u_BlurDir); }`,Cf=`attribute vec2 a_Position; varying vec2 v_UV; void main() { v_UV = 0.5 * (a_Position + 1.0); gl_Position = vec4(a_Position, 0., 1.); }`,{isNil:Vp}=es;class Mf extends Bl{setupShaders(){this.shaderModuleService.registerModule("blur-pass",{vs:Cf,fs:Nc});const{vs:e,fs:r,uniforms:n}=this.shaderModuleService.getModule("blur-pass"),{width:a,height:u}=this.rendererService.getViewportSize();return{vs:e,fs:r,uniforms:(0,Wt.Z)((0,Wt.Z)({},n),{},{u_ViewportSize:[a,u]})}}convertOptionsToUniforms(e){const r={};return Vp(e.blurRadius)||(r.u_BlurDir=[0,e.blurRadius]),r}}const md=`varying vec2 v_UV; uniform sampler2D u_Texture; uniform vec2 u_ViewportSize: [1.0, 1.0]; uniform vec2 u_Center : [0.5, 0.5]; uniform float u_Angle : 0; uniform float u_Size : 8; #pragma include "common" float scale = PI / u_Size; float pattern(float u_Angle, vec2 texSize, vec2 texCoord) { float s = sin(u_Angle), c = cos(u_Angle); vec2 tex = texCoord * texSize - u_Center * texSize; vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale; return (sin(point.x) * sin(point.y)) * 4.0; } // https://github.com/evanw/glfx.js/blob/master/src/filters/fun/colorhalftone.js vec4 colorHalftone_filterColor(vec4 color, vec2 texSize, vec2 texCoord) { vec3 cmy = 1.0 - color.rgb; float k = min(cmy.x, min(cmy.y, cmy.z)); cmy = (cmy - k) / (1.0 - k); cmy = clamp( cmy * 10.0 - 3.0 + vec3( pattern(u_Angle + 0.26179, texSize, texCoord), pattern(u_Angle + 1.30899, texSize, texCoord), pattern(u_Angle, texSize, texCoord) ), 0.0, 1.0 ); k = clamp(k * 10.0 - 5.0 + pattern(u_Angle + 0.78539, texSize, texCoord), 0.0, 1.0); return vec4(1.0 - cmy - k, color.a); } void main() { gl_FragColor = vec4(texture2D(u_Texture, v_UV)); gl_FragColor = colorHalftone_filterColor(gl_FragColor, u_ViewportSize, v_UV); }`,Pf=`attribute vec2 a_Position; varying vec2 v_UV; void main() { v_UV = 0.5 * (a_Position + 1.0); gl_Position = vec4(a_Position, 0., 1.); }`;class Rf extends Bl{setupShaders(){this.shaderModuleService.registerModule("colorhalftone-pass",{vs:Pf,fs:md});const{vs:e,fs:r,uniforms:n}=this.shaderModuleService.getModule("colorhalftone-pass"),{width:a,height:u}=this.rendererService.getViewportSize();return{vs:e,fs:r,uniforms:(0,Wt.Z)((0,Wt.Z)({},n),{},{u_ViewportSize:[a,u]})}}}const Rp=`varying vec2 v_UV; uniform sampler2D u_Texture; void main() { gl_FragColor = vec4(texture2D(u_Texture, v_UV)); }`,$c=`attribute vec2 a_Position; varying vec2 v_UV; void main() { v_UV = 0.5 * (a_Position + 1.0); gl_Position = vec4(a_Position, 0., 1.); }`;class Vd extends Bl{setupShaders(){return this.shaderModuleService.registerModule("copy-pass",{vs:$c,fs:Rp}),this.shaderModuleService.getModule("copy-pass")}}const Ym=`varying vec2 v_UV; uniform sampler2D u_Texture; uniform vec2 u_ViewportSize: [1.0, 1.0]; uniform vec2 u_Center : [0.5, 0.5]; uniform float u_Scale : 10; // https://github.com/evanw/glfx.js/blob/master/src/filters/fun/hexagonalpixelate.js vec4 hexagonalPixelate_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) { vec2 tex = (texCoord * texSize - u_Center * texSize) / u_Scale; tex.y /= 0.866025404; tex.x -= tex.y * 0.5; vec2 a; if (tex.x + tex.y - floor(tex.x) - floor(tex.y) < 1.0) { a = vec2(floor(tex.x), floor(tex.y)); } else a = vec2(ceil(tex.x), ceil(tex.y)); vec2 b = vec2(ceil(tex.x), floor(tex.y)); vec2 c = vec2(floor(tex.x), ceil(tex.y)); vec3 TEX = vec3(tex.x, tex.y, 1.0 - tex.x - tex.y); vec3 A = vec3(a.x, a.y, 1.0 - a.x - a.y); vec3 B = vec3(b.x, b.y, 1.0 - b.x - b.y); vec3 C = vec3(c.x, c.y, 1.0 - c.x - c.y); float alen = length(TEX - A); float blen = length(TEX - B); float clen = length(TEX - C); vec2 choice; if (alen < blen) { if (alen < clen) choice = a; else choice = c; } else { if (blen < clen) choice = b; else choice = c; } choice.x += choice.y * 0.5; choice.y *= 0.866025404; choice *= u_Scale / texSize; return texture2D(texture, choice + u_Center); } void main() { gl_FragColor = vec4(texture2D(u_Texture, v_UV)); gl_FragColor = hexagonalPixelate_sampleColor(u_Texture, u_ViewportSize, v_UV); }`,Vf=`attribute vec2 a_Position; varying vec2 v_UV; void main() { v_UV = 0.5 * (a_Position + 1.0); gl_Position = vec4(a_Position, 0., 1.); }`;class og extends Bl{setupShaders(){this.shaderModuleService.registerModule("hexagonalpixelate-pass",{vs:Vf,fs:Ym});const{vs:e,fs:r,uniforms:n}=this.shaderModuleService.getModule("hexagonalpixelate-pass"),{width:a,height:u}=this.rendererService.getViewportSize();return{vs:e,fs:r,uniforms:(0,Wt.Z)((0,Wt.Z)({},n),{},{u_ViewportSize:[a,u]})}}}const Pd=`varying vec2 v_UV; uniform sampler2D u_Texture; uniform vec2 u_ViewportSize: [1.0, 1.0]; uniform float u_Strength : 0.6; vec4 ink_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) { vec2 dx = vec2(1.0 / texSize.x, 0.0); vec2 dy = vec2(0.0, 1.0 / texSize.y); vec4 color = texture2D(texture, texCoord); float bigTotal = 0.0; float smallTotal = 0.0; vec3 bigAverage = vec3(0.0); vec3 smallAverage = vec3(0.0); for (float x = -2.0; x <= 2.0; x += 1.0) { for (float y = -2.0; y <= 2.0; y += 1.0) { vec3 sample = texture2D(texture, texCoord + dx * x + dy * y).rgb; bigAverage += sample; bigTotal += 1.0; if (abs(x) + abs(y) < 2.0) { smallAverage += sample; smallTotal += 1.0; } } } vec3 edge = max(vec3(0.0), bigAverage / bigTotal - smallAverage / smallTotal); float power = u_Strength * u_Strength * u_Strength * u_Strength * u_Strength; return vec4(color.rgb - dot(edge, edge) * power * 100000.0, color.a); } void main() { gl_FragColor = vec4(texture2D(u_Texture, v_UV)); gl_FragColor = ink_sampleColor(u_Texture, u_ViewportSize, v_UV); }`,jd=`attribute vec2 a_Position; varying vec2 v_UV; void main() { v_UV = 0.5 * (a_Position + 1.0); gl_Position = vec4(a_Position, 0., 1.); }`;class pm extends Bl{setupShaders(){this.shaderModuleService.registerModule("ink-pass",{vs:jd,fs:Pd});const{vs:e,fs:r,uniforms:n}=this.shaderModuleService.getModule("ink-pass"),{width:a,height:u}=this.rendererService.getViewportSize();return{vs:e,fs:r,uniforms:(0,Wt.Z)((0,Wt.Z)({},n),{},{u_ViewportSize:[a,u]})}}}const Tm=`varying vec2 v_UV; uniform sampler2D u_Texture; uniform float u_Amount : 0.5; float rand(vec2 co) { return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); } // https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js vec4 noise_filterColor(vec4 color, vec2 texCoord) { float diff = (rand(texCoord) - 0.5) * u_Amount; color.r += diff; color.g += diff; color.b += diff; return color; } void main() { gl_FragColor = vec4(texture2D(u_Texture, v_UV)); gl_FragColor = noise_filterColor(gl_FragColor, v_UV); }`,fm=`attribute vec2 a_Position; varying vec2 v_UV; void main() { v_UV = 0.5 * (a_Position + 1.0); gl_Position = vec4(a_Position, 0., 1.); }`;class Am extends Bl{setupShaders(){return this.shaderModuleService.registerModule("noise-pass",{vs:fm,fs:Tm}),this.shaderModuleService.getModule("noise-pass")}}const Cg=`attribute vec2 a_Position; varying vec2 v_UV; void main() { v_UV = 0.5 * (a_Position + 1.0); gl_Position = vec4(a_Position, 0., 1.); }`,Vg=`varying vec2 v_UV; uniform sampler2D u_Texture; uniform float u_Amount : 0.5; // https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/sepia.js vec4 sepia_filterColor(vec4 color) { float r = color.r; float g = color.g; float b = color.b; color.r = min(1.0, (r * (1.0 - (0.607 * u_Amount))) + (g * (0.769 * u_Amount)) + (b * (0.189 * u_Amount))); color.g = min(1.0, (r * 0.349 * u_Amount) + (g * (1.0 - (0.314 * u_Amount))) + (b * 0.168 * u_Amount)); color.b = min(1.0, (r * 0.272 * u_Amount) + (g * 0.534 * u_Amount) + (b * (1.0 - (0.869 * u_Amount)))); return color; } void main() { gl_FragColor = vec4(texture2D(u_Texture, v_UV)); gl_FragColor = sepia_filterColor(gl_FragColor); }`;class Mg extends Bl{setupShaders(){return this.shaderModuleService.registerModule("sepia-pass",{vs:Cg,fs:Vg}),this.shaderModuleService.getModule("sepia-pass")}}const $m=new mc;let ag=0;function jp(){const t=new iu,e=new j,r=new cm,n=new F(r),a=new bm,u=new Bm,y=new Em,A=new wm,O=new hm,Z={id:`${ag++}`,globalConfigService:$m,shaderModuleService:t,debugService:e,cameraService:r,coordinateSystemService:n,fontService:a,iconService:u,markerService:y,popupService:A,controlService:O,customRenderService:{}},Y=new ke(Z);Z.layerService=Y;const Q=new Gt(Z);Z.sceneService=Q;const ae=new w(Z);Z.interactionService=ae;const xe=new ie(Z);Z.pickingService=xe;const Be={clear:new gc,pixelPicking:new sp,render:new gh,taa:new vc(t)};Z.normalPassFactory=gt=>Be[gt];const it={copy:new Vd,bloom:new _c,blurH:new Rh,blurV:new Mf,noise:new Am,sepia:new Mg,colorHalftone:new Rf,hexagonalPixelate:new og,ink:new pm};return Z.postProcessingPass=it,Z.postProcessingPassFactory=gt=>it[gt],Z}function cp(t){const e=(0,Wt.Z)({},t);return e.postProcessor=new kc(e.rendererService),e.multiPassRenderer=new Pp(e.postProcessor),e.styleAttributeService=new kt(e.rendererService),e}const dm=["loaded","fontloaded","maploaded","resize","destroy","dragstart","dragging","dragend","dragcancel"];let Vh=function(t){return t.IMAGE="image",t.CUSTOMIMAGE="customImage",t.ARRAYBUFFER="arraybuffer",t.RGB="rgb",t.TERRAINRGB="terrainRGB",t.CUSTOMRGB="customRGB",t.CUSTOMARRAYBUFFER="customArrayBuffer",t.CUSTOMTERRAINRGB="customTerrainRGB",t}({});var sg=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),Cm=(t,e,r,n)=>sg(void 0,null,function*(){return new Promise((a,u)=>{e({x:t.x,y:t.y,z:t.z},(y,A)=>{if(y||A.length===0){u(y);return}A&&Zn([{data:A,bands:[0]}],r,n,(O,Z)=>{O?u(O):Z&&a(Z)})})})}),Ih=(t,e)=>sg(void 0,null,function*(){return new Promise((r,n)=>{e({x:t.x,y:t.y,z:t.z},(a,u)=>{if(a||!u){n(a);return}u instanceof ArrayBuffer?Yo(u,(y,A)=>{y&&n(y),r(A)}):u instanceof HTMLImageElement?r(u):n(a)})})});function Hp(t,e){return Array.isArray(t)?typeof t[0]=="string"?t.map(r=>Di(r,e)):t.map(r=>({url:Di(r.url,e),bands:r.bands||[0]})):Di(t,e)}function Hd(t){return typeof t=="string"?[{url:t,bands:[0]}]:typeof t[0]=="string"?t.map(e=>({url:e,bands:[0]})):t}function hf(t,e){t.xhrCancel=()=>{e.map(r=>{r.abort()})}}var Gd=Object.defineProperty,pf=Object.defineProperties,h0=Object.getOwnPropertyDescriptors,lg=Object.getOwnPropertySymbols,av=Object.prototype.hasOwnProperty,jg=Object.prototype.propertyIsEnumerable,p0=(t,e,r)=>e in t?Gd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,f0=(t,e)=>{for(var r in e||(e={}))av.call(e,r)&&p0(t,r,e[r]);if(lg)for(var r of lg(e))jg.call(e,r)&&p0(t,r,e[r]);return t},sv=(t,e)=>pf(t,h0(e)),lv=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),uv=(t,e,r,n,a)=>lv(void 0,null,function*(){const u=Hd(e.url);if(u.length>1){const{rasterFiles:y,xhrList:A,errList:O}=yield cv(u,e);if(hf(t,A),O.length>0){r(O,null);return}Zn(y,n,a,r)}else{const y=On(e,(A,O)=>{if(A)r(A);else if(O){const Z=[{data:O,bands:u[0].bands}];Zn(Z,n,a,r)}});hf(t,[y])}});function cv(t,e){return lv(this,null,function*(){const r=[],n=[],a=[];for(let u=0;ue in t?hv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,d0=(t,e)=>{for(var r in e||(e={}))Hg.call(e,r)&&Gg(t,r,e[r]);if(ug)for(var r of ug(e))Fm.call(e,r)&&Gg(t,r,e[r]);return t},ax=(t,e)=>pv(t,Wd(e)),fv=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),sx=(t,e,r,n)=>fv(void 0,null,function*(){const{format:a=D_,operation:u,requestParameters:y={}}=n,A=ax(d0({},y),{url:Hp(t,e)});return new Promise((O,Z)=>{uv(r,A,(Y,Q)=>{Y?Z(Y):Q&&O(Q)},a,u)})}),L_=(t,e,r,n)=>fv(void 0,null,function*(){let a;const u=Array.isArray(t)?t[0]:t;return n.wmtsOptions?a=((n==null?void 0:n.getURLFromTemplate)||Ui)(u,d0(d0({},e),n.wmtsOptions)):a=((n==null?void 0:n.getURLFromTemplate)||Di)(u,e),new Promise((y,A)=>{var O;const Z=ns(ax(d0({},n==null?void 0:n.requestParameters),{url:a,type:((O=n==null?void 0:n.requestParameters)==null?void 0:O.type)||"arrayBuffer"}),(Y,Q)=>{Y?A(Y):Q&&y(Q)},n.transformResponse);r.xhrCancel=()=>Z.cancel()})}),D_=()=>({rasterData:new Uint8Array([0]),width:1,height:1}),lx=Object.defineProperty,ux=Object.defineProperties,cx=Object.getOwnPropertyDescriptors,O_=Object.getOwnPropertySymbols,hx=Object.prototype.hasOwnProperty,px=Object.prototype.propertyIsEnumerable,B_=(t,e,r)=>e in t?lx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,dv=(t,e)=>{for(var r in e||(e={}))hx.call(e,r)&&B_(t,r,e[r]);if(O_)for(var r of O_(e))px.call(e,r)&&B_(t,r,e[r]);return t},fx=(t,e)=>ux(t,cx(e)),dx={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,warp:!0},aE=[Vh.ARRAYBUFFER,Vh.RGB];function mx(t){return!!(Array.isArray(t)&&t.length===0||!Array.isArray(t)&&typeof t!="string")}function gx(t,e={}){if(mx(t))throw new Error("tile server url is error");let r=(e==null?void 0:e.dataType)||Vh.IMAGE;r===Vh.RGB&&(r=Vh.ARRAYBUFFER);const n=(u,y)=>{switch(r){case Vh.IMAGE:return L_(t,u,y,e);case Vh.CUSTOMIMAGE:case Vh.CUSTOMTERRAINRGB:return Ih(y,e==null?void 0:e.getCustomData);case Vh.ARRAYBUFFER:return sx(t,u,y,e);case Vh.CUSTOMARRAYBUFFER:case Vh.CUSTOMRGB:return Cm(y,e==null?void 0:e.getCustomData,(e==null?void 0:e.format)||D_,e==null?void 0:e.operation);default:return L_(t,u,y,e)}},a=fx(dv(dv({},dx),e),{getTileData:n});return{data:t,dataArray:[],tilesetOptions:a,isTile:!0}}var vx=Object.defineProperty,F_=Object.defineProperties,_x=Object.getOwnPropertyDescriptors,m0=Object.getOwnPropertySymbols,k_=Object.prototype.hasOwnProperty,N_=Object.prototype.propertyIsEnumerable,z_=(t,e,r)=>e in t?vx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mv=(t,e)=>{for(var r in e||(e={}))k_.call(e,r)&&z_(t,r,e[r]);if(m0)for(var r of m0(e))N_.call(e,r)&&z_(t,r,e[r]);return t},yx=(t,e)=>F_(t,_x(e)),xx=(t,e)=>{var r={};for(var n in t)k_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&m0)for(var n of m0(t))e.indexOf(n)<0&&N_.call(t,n)&&(r[n]=t[n]);return r};function bx(t,e){const r=e,{extent:n=[121.168,30.2828,121.384,30.4219],coordinates:a,width:u,height:y}=r,A=xx(r,["extent","coordinates","width","height"]);t.length<2&&console.warn("RGB\u89E3\u6790\u9700\u89812\u4E2A\u6CE2\u6BB5\u7684\u6570\u636E");const[O,Z]=A.bands||[0,1],Y=[t[O],t[Z]],Q=[];for(let Be=0;Bee in t?Ex(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ax=(t,e)=>{for(var r in e||(e={}))U_.call(e,r)&&V_(t,r,e[r]);if(Pg)for(var r of Pg(e))Z_.call(e,r)&&V_(t,r,e[r]);return t},Cx=(t,e)=>Sx(t,Tx(e)),Mx=(t,e)=>{var r={};for(var n in t)U_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Pg)for(var n of Pg(t))e.indexOf(n)<0&&Z_.call(t,n)&&(r[n]=t[n]);return r};function Px(t,e){const r=e,{extent:n,coordinates:a,width:u,height:y}=r,A=Mx(r,["extent","coordinates","width","height"]);t.length<3&&console.warn("RGB\u89E3\u6790\u9700\u8981\u4E09\u4E2A\u6CE2\u6BB5\u7684\u6570\u636E");const[O,Z,Y]=A.bands||[0,1,2],Q=[t[O],t[Z],t[Y]],ae=[],[xe,Be]=(A==null?void 0:A.countCut)||[2,98],it=(A==null?void 0:A.RMinMax)||Yn(Q[0],xe,Be),gt=(A==null?void 0:A.GMinMax)||Yn(Q[1],xe,Be),Bt=(A==null?void 0:A.BMinMax)||Yn(Q[2],xe,Be);for(let vr=0;vre in t?Rx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,W_=(t,e)=>{for(var r in e||(e={}))j_.call(e,r)&&G_(t,r,e[r]);if(g0)for(var r of g0(e))H_.call(e,r)&&G_(t,r,e[r]);return t},Lx=(t,e)=>Ix(t,gv(e)),Dx=(t,e)=>{var r={};for(var n in t)j_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&g0)for(var n of g0(t))e.indexOf(n)<0&&H_.call(t,n)&&(r[n]=t[n]);return r};function Ox(t,e){const r=e,{extent:n,coordinates:a,min:u,max:y,width:A,height:O,format:Z,operation:Y}=r,Q=Dx(r,["extent","coordinates","min","max","width","height","format","operation"]);let ae;if(Z===void 0||ko(t))ae=Array.from(t);else{const it=Array.isArray(t)?t:[t];ae=Po(it,Z,Y)}const xe=qi(a,n);return{_id:1,dataArray:[Lx(W_({_id:1,data:ae,width:A,height:O},Q),{min:u,max:y,coordinates:xe})]}}var Bx=Object.defineProperty,Fx=Object.defineProperties,kx=Object.getOwnPropertyDescriptors,X_=Object.getOwnPropertySymbols,Nx=Object.prototype.hasOwnProperty,zx=Object.prototype.propertyIsEnumerable,q_=(t,e,r)=>e in t?Bx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Y_=(t,e)=>{for(var r in e||(e={}))Nx.call(e,r)&&q_(t,r,e[r]);if(X_)for(var r of X_(e))zx.call(e,r)&&q_(t,r,e[r]);return t},$_=(t,e)=>Fx(t,kx(e)),Ux=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),Zx={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0},Vx=t=>Ux(void 0,null,function*(){return new Promise(e=>{const[r,n,a,u]=t.bounds,y={layers:{testTile:{features:[{type:"Feature",properties:{key:t.x+"/"+t.y+"/"+t.z,x:(r+a)/2,y:(n+u)/2},geometry:{type:"LineString",coordinates:[[a,u],[a,n],[r,n],[r,n]]}}]}}};e(y)})});function jx(t,e){const r=a=>Vx(a),n=$_(Y_(Y_({},Zx),e),{getTileData:r});return{data:t,dataArray:[],tilesetOptions:n,isTile:!0}}var Hx=Se(48096),K_=Se.n(Hx),J_=Object.defineProperty,Q_=Object.getOwnPropertySymbols,Gx=Object.prototype.hasOwnProperty,ey=Object.prototype.propertyIsEnumerable,ty=(t,e,r)=>e in t?J_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ry=(t,e)=>{for(var r in e||(e={}))Gx.call(e,r)&&ty(t,r,e[r]);if(Q_)for(var r of Q_(e))ey.call(e,r)&&ty(t,r,e[r]);return t};function ny(t,e){const{radius:r=40,maxZoom:n=18,minZoom:a=0,zoom:u=2}=e;if(t.pointIndex){const O=t.pointIndex.getClusters(t.extent,Math.floor(u));return t.dataArray=Wx(O),t}const y=new(K_())({radius:r,minZoom:a,maxZoom:n}),A={type:"FeatureCollection",features:[]};return A.features=t.dataArray.map(O=>({type:"Feature",geometry:{type:"Point",coordinates:O.coordinates},properties:ry({},O)})),y.load(A.features),y}function Wx(t){return t.map((e,r)=>ry({coordinates:e.geometry.coordinates,_id:r+1},e.properties))}function Xx(t){if(t.length===0)throw new Error("max requires at least one data point");let e=t[0];for(let r=1;re&&(e=t[r]);return e}function iy(t){if(t.length===0)throw new Error("min requires at least one data point");let e=t[0];for(let r=1;r=Math.abs(t[a])?r+=e-n+t[a]:r+=t[a]-n+e,e=n;return e+r*1}function qx(t){if(t.length===0)throw new Error("mean requires at least one data point");return oy(t)/t.length}var Yx={min:iy,max:Xx,mean:qx,sum:oy},$x=Object.defineProperty,ay=Object.getOwnPropertySymbols,sy=Object.prototype.hasOwnProperty,Kx=Object.prototype.propertyIsEnumerable,ly=(t,e,r)=>e in t?$x(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wg=(t,e)=>{for(var r in e||(e={}))sy.call(e,r)&&ly(t,r,e[r]);if(ay)for(var r of ay(e))Kx.call(e,r)&&ly(t,r,e[r]);return t},uy=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),{cloneDeep:Jx,isFunction:cy,isString:Qx,mergeWith:eb}=es;function tb(t,e){if(Array.isArray(e))return e}var rb=class extends Yl.EventEmitter{constructor(t,e){super(),this.type="source",this.isTile=!1,this.inited=!1,this.hooks={init:new f},this.parser={type:"geojson"},this.transforms=[],this.cluster=!1,this.clusterOptions={enable:!1,radius:40,maxZoom:20,zoom:-99,method:"count"},this.invalidExtent=!1,this.dataArrayChanged=!1,this.cfg={autoRender:!0},this.originData=t,this.initCfg(e),this.init().then(()=>{this.inited=!0,this.emit("update",{type:"inited"})})}getSourceCfg(){return this.cfg}getClusters(t){return this.clusterIndex.getClusters(this.caculClusterExtent(2),t)}getClustersLeaves(t){return this.clusterIndex.getLeaves(t,1/0)}getParserType(){return this.parser.type}updateClusterData(t){const{method:e="sum",field:r}=this.clusterOptions;let n=this.clusterIndex.getClusters(this.caculClusterExtent(2),Math.floor(t));this.clusterOptions.zoom=t,n.forEach(a=>{a.id||(a.properties.point_count=1)}),(r||cy(e))&&(n=n.map(a=>{const u=a.id;if(u){const A=this.clusterIndex.getLeaves(u,1/0).map(Z=>Z.properties);let O;if(Qx(e)&&r){const Z=Ko(A,r);O=Yx[e](Z)}cy(e)&&(O=e(A)),a.properties.stat=O}else a.properties.point_count=1;return a})),this.data=de("geojson")({type:"FeatureCollection",features:n}),this.executeTrans()}getFeatureById(t){const{type:e="geojson",geometry:r}=this.parser;if(e==="geojson"&&!this.cluster){const n=ty._id===t);a.properties=u}return a}else return e==="json"&&r?this.data.dataArray.find(n=>n._id===t):tr._id===t?Wg(Wg({},r),e):r),this.dataArrayChanged=!0,this.emit("update",{type:"update"})}getFeatureId(t,e){const r=this.data.dataArray.find(n=>n[t]===e);return r==null?void 0:r._id}setData(t,e){this.originData=t,this.dataArrayChanged=!1,this.initCfg(e),this.init().then(()=>{this.emit("update",{type:"update"})})}reloadAllTile(){var t;(t=this.tileset)==null||t.reloadAll()}reloadTilebyId(t,e,r){var n;(n=this.tileset)==null||n.reloadTileById(t,e,r)}reloadTileByLnglat(t,e,r){var n;(n=this.tileset)==null||n.reloadTileByLnglat(t,e,r)}getTileExtent(t,e){var r;return(r=this.tileset)==null?void 0:r.getTileExtent(t,e)}getTileByZXY(t,e,r){var n;return(n=this.tileset)==null?void 0:n.getTileByZXY(t,e,r)}reloadTileByExtent(t,e){var r;(r=this.tileset)==null||r.reloadTileByExtent(t,e)}destroy(){var t;this.removeAllListeners(),this.originData=null,this.clusterIndex=null,this.data=null,(t=this.tileset)==null||t.destroy()}processData(){return uy(this,null,function*(){return new Promise((t,e)=>{try{this.excuteParser(),this.initCluster(),this.executeTrans(),t({})}catch(r){e(r)}})})}initCfg(t){this.cfg=eb(this.cfg,t,tb);const e=this.cfg;e&&(e.parser&&(this.parser=e.parser),e.transforms&&(this.transforms=e.transforms),this.cluster=e.cluster||!1,e.clusterOptions&&(this.cluster=!0,this.clusterOptions=Wg(Wg({},this.clusterOptions),e.clusterOptions)))}init(){return uy(this,null,function*(){this.inited=!1,yield this.processData(),this.inited=!0})}excuteParser(){const t=this.parser,e=t.type||"geojson",r=de(e);this.data=r(this.originData,t),this.tileset=this.initTileset(),!t.cancelExtent&&(this.extent=xu(this.data.dataArray),this.setCenter(this.extent),this.invalidExtent=this.extent[0]===this.extent[2]||this.extent[1]===this.extent[3])}setCenter(t){this.center=[(t[0]+t[2])/2,(t[1]+t[3])/2],(isNaN(this.center[0])||isNaN(this.center[1]))&&(this.center=[108.92361111111111,34.54083333333333])}initTileset(){const{tilesetOptions:t}=this.data;return t?(this.isTile=!0,this.tileset?(this.tileset.updateOptions(t),this.tileset):new nn(Wg({},t))):void 0}executeTrans(){this.transforms.forEach(e=>{const{type:r}=e,n=Le(r)(this.data,e);Object.assign(this.data,n)})}initCluster(){if(!this.cluster)return;const t=this.clusterOptions||{};this.clusterIndex=ny(this.data,t)}caculClusterExtent(t){let e=[[-1/0,-1/0],[1/0,1/0]];return this.invalidExtent||(e=ai(ep(this.extent),t)),e[0].concat(e[1])}};function nb(t,e){const{callback:r}=e;return r&&(t.dataArray=t.dataArray.filter(r)),t}var vv=6378e3;function ib(t,e){const r=t.dataArray,{size:n=10}=e,a=n/(2*Math.PI*vv)*(256<<20)/2,{gridHash:u,gridOffset:y}=ob(r,n),A=Xg(u,y,e);return{yOffset:a,xOffset:a,radius:a,type:"grid",dataArray:A}}function ob(t,e){let r=1/0,n=-1/0,a;for(const O of t)a=O.coordinates[1],Number.isFinite(a)&&(r=an?a:n);const u=(r+n)/2,y=ab(e,u);if(y.xOffset<=0||y.yOffset<=0)return{gridHash:{},gridOffset:y};const A={};for(const O of t){const Z=O.coordinates[1],Y=O.coordinates[0];if(Number.isFinite(Z)&&Number.isFinite(Y)){const Q=Math.floor((Z+90)/y.yOffset),ae=Math.floor((Y+180)/y.xOffset),xe=`${Q}-${ae}`;A[xe]=A[xe]||{count:0,points:[]},A[xe].count+=1,A[xe].points.push(O)}}return{gridHash:A,gridOffset:y}}function ab(t,e){const r=sb(t),n=_v(e,t);return{yOffset:r,xOffset:n}}function sb(t){return t/vv*(180/Math.PI)}function _v(t,e){return e/vv*(180/Math.PI)/Math.cos(t*Math.PI/180)}function Xg(t,e,r){return Object.keys(t).reduce((n,a,u)=>{const y=a.split("-"),A=parseInt(y[0],10),O=parseInt(y[1],10),Z={};if(r.field&&r.method){const Y=qc(t[a].points,r.field);Z[r.method]=Su[r.method](Y)}return Object.assign(Z,{_id:u,coordinates:vl([-180+e.xOffset*(O+.5),-90+e.yOffset*(A+.5)]),rawData:t[a].points,count:t[a].count}),n.push(Z),n},[])}var Rg=Math.PI/3,yv=[0,Rg,2*Rg,3*Rg,4*Rg,5*Rg];function lb(t){return t[0]}function ub(t){return t[1]}function cb(){var t=0,e=0,r=1,n=1,a=lb,u=ub,y,A,O;function Z(Q){var ae={},xe=[],Be,it=Q.length;for(Be=0;Be1){var cn=Bt-vr,Gr=vr+(BtOo*Oo+Da*Da&&(vr=Gr+(Yt&1?1:-1)/2,Yt=Pn)}var Bo=vr+"-"+Yt,Oa=ae[Bo];Oa?Oa.push(gt):(xe.push(Oa=ae[Bo]=[gt]),Oa.x=(vr+(Yt&1)/2)*A,Oa.y=Yt*O)}return xe}function Y(Q){var ae=0,xe=0;return yv.map(function(Be){var it=Math.sin(Be)*Q,gt=-Math.cos(Be)*Q,Bt=it-ae,Rt=gt-xe;return ae=it,xe=gt,[Bt,Rt]})}return Z.hexagon=function(Q){return"m"+Y(Q==null?y:+Q).join("l")+"z"},Z.centers=function(){for(var Q=[],ae=Math.round(e/O),xe=Math.round(t/A),Be=ae*O;Bee in t?hb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cg=(t,e)=>{for(var r in e||(e={}))fb.call(e,r)&&bv(t,r,e[r]);if(xv)for(var r of xv(e))v0.call(e,r)&&bv(t,r,e[r]);return t},db=(t,e)=>pb(t,hy(e)),mb=6378e3;function Ev(t,e){const r=t.dataArray,{size:n=10,method:a="sum"}=e,u=n/(2*Math.PI*mb)*(256<<20)/2,y=r.map(Y=>{const[Q,ae]=vl(Y.coordinates);return db(cg({},Y),{coordinates:[Q,ae]})});return{dataArray:cb().radius(u).x(Y=>Y.coordinates[0]).y(Y=>Y.coordinates[1])(y).map((Y,Q)=>{if(e.field&&a){const ae=qc(Y,e.field);Y[a]=Su[a](ae)}return{[e.method]:Y[a],count:Y.length,rawData:Y,coordinates:[Y.x,Y.y],_id:Q}}),radius:u,xOffset:u,yOffset:u,type:"hexagon"}}var wv=Object.defineProperty,py=Object.getOwnPropertySymbols,gb=Object.prototype.hasOwnProperty,vb=Object.prototype.propertyIsEnumerable,fy=(t,e,r)=>e in t?wv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sv=(t,e)=>{for(var r in e||(e={}))gb.call(e,r)&&fy(t,r,e[r]);if(py)for(var r of py(e))vb.call(e,r)&&fy(t,r,e[r]);return t};function dy(t,e){const{sourceField:r,targetField:n,data:a}=e,u={};return a.forEach(y=>{u[y[r]]=y}),t.dataArray=t.dataArray.map(y=>{const A=y[n];return Sv(Sv({},y),u[A])}),t}function _b(t,e){const{callback:r}=e;return r&&(t.dataArray=t.dataArray.map(r)),t}var sE=Se(20446);be("rasterTile",gx),be("mvt",Or),be("geojsonvt",_p),be("testTile",jx),be("geojson",Ws),be("jsonTile",Au),be("image",Uf),be("csv",hh),be("json",Uu),be("raster",Sn),be("rasterRgb",Ox),be("rgb",Px),be("ndi",bx),Re("cluster",ny),Re("filter",nb),Re("join",dy),Re("map",_b),Re("grid",ib),Re("hexagon",Ev);var gy=rb;class Tv extends Yl.EventEmitter{getMarkerLayerContainerSize(){}constructor(e){super(),(0,K.Z)(this,"markerOption",void 0),(0,K.Z)(this,"popup",void 0),(0,K.Z)(this,"mapsService",void 0),(0,K.Z)(this,"lngLat",void 0),(0,K.Z)(this,"scene",void 0),(0,K.Z)(this,"added",!1),(0,K.Z)(this,"preLngLat",{lng:0,lat:0}),(0,K.Z)(this,"onMarkerDragStart",r=>{const n=this.mapsService.getContainer();if(!n)return;this.mapsService.setMapStatus({dragEnable:!1,zoomEnable:!1});const{left:a,top:u}=n.getClientRects()[0],{x:y,y:A}=r;this.preLngLat=this.mapsService.containerToLngLat([y-a,A-u]),this.mapsService.on("mousemove",this.onMarkerDragMove),document.addEventListener("mouseup",this.onMarkerDragEnd),this.emit("dragstart",this.lngLat)}),(0,K.Z)(this,"onMarkerDragMove",r=>{const{lng:n,lat:a}=this.preLngLat,{lng:u,lat:y}=r.lnglat,A={lng:this.lngLat.lng+u-n,lat:this.lngLat.lat+y-a};this.setLnglat(A),this.preLngLat=r.lnglat,this.emit("dragging",A)}),(0,K.Z)(this,"onMarkerDragEnd",()=>{this.mapsService.setMapStatus({dragEnable:!0,zoomEnable:!0}),this.mapsService.off("mousemove",this.onMarkerDragMove),document.removeEventListener("mouseup",this.onMarkerDragEnd),this.emit("dragend",this.lngLat)}),(0,K.Z)(this,"eventHandle",r=>{this.polyfillEvent(r),this.emit(r.type,{target:r,data:this.markerOption.extData,lngLat:this.lngLat})}),(0,K.Z)(this,"touchStartTime",void 0),this.markerOption=(0,Wt.Z)((0,Wt.Z)({},this.getDefault()),e),nh(["update","onMove","onMapClick","updatePositionWhenZoom"],this),this.init()}getDefault(){return{element:void 0,anchor:_a.BOTTOM,offsets:[0,0],color:"#5B8FF9",draggable:!1}}addTo(e){this.scene=e,this.mapsService=e.mapService;const{element:r}=this.markerOption;return this.mapsService.getMarkerContainer().appendChild(r),this.registerMarkerEvent(r),this.mapsService.on("camerachange",this.update),this.update(),this.updateDraggable(),this.added=!0,this.emit("added"),this}remove(){this.mapsService&&(this.mapsService.off("click",this.onMapClick),this.mapsService.off("move",this.update),this.mapsService.off("moveend",this.update),this.mapsService.off("camerachange",this.update)),this.unRegisterMarkerEvent(),this.removeAllListeners();const{element:e}=this.markerOption;return e&&au(e),this.popup&&this.popup.remove(),this}setLnglat(e){return this.lngLat=e,Array.isArray(e)&&(this.lngLat={lng:e[0],lat:e[1]}),this.popup&&this.popup.setLnglat(this.lngLat),this.update(),this}getLnglat(){return this.lngLat}getElement(){return this.markerOption.element}setElement(e){if(!this.added)return this.once("added",()=>{this.setElement(e)}),this;const{element:r}=this.markerOption;return r&&au(r),this.markerOption.element=e,this.init(),this.mapsService.getMarkerContainer().appendChild(e),this.registerMarkerEvent(e),this.updateDraggable(),this.update(),this}openPopup(){if(!this.added)return this.once("added",()=>{this.openPopup()}),this;const e=this.popup;return e?(e.isOpen()||e.addTo(this.scene),this):this}closePopup(){this.added||this.once("added",()=>{this.closePopup()});const e=this.popup;return e&&e.remove(),this}setPopup(e){return this.popup=e,this.lngLat&&this.popup.setLnglat(this.lngLat),this}togglePopup(){const e=this.popup;if(e)e.isOpen()?e.remove():e.addTo(this.scene);else return this;return this}getPopup(){return this.popup}getOffset(){return this.markerOption.offsets}setDraggable(e){this.markerOption.draggable=e,this.updateDraggable()}getDraggable(){return this.markerOption.draggable}getExtData(){return this.markerOption.extData}setExtData(e){this.markerOption.extData=e}update(){if(!this.mapsService)return;const{element:e,anchor:r}=this.markerOption;this.updatePosition(),_u(e,`${$o[r]}`)}updatePositionWhenZoom(e){if(!this.mapsService)return;const{element:r,offsets:n}=this.markerOption,{lng:a,lat:u}=this.lngLat;if(r){r.style.display="block",r.style.whiteSpace="nowrap";const{containerHeight:y,containerWidth:A,bounds:O}=this.getMarkerLayerContainerSize()||this.getCurrentContainerSize();if(!O)return;const Z=e.map,Y=e.center,Q=e.zoom,ae=Z.DE(this.lngLat,Q,Y);if(ae.x=Math.round(ae.x+n[0]),ae.y=Math.round(ae.y-n[1]),Math.abs(O[0][0])>180||Math.abs(O[1][0])>180){if(ae.x>A){const xe=this.mapsService.lngLatToContainer([a-360,u]);ae.x=xe.x}if(ae.x<0){const xe=this.mapsService.lngLatToContainer([a+360,u]);ae.x=xe.x}}(ae.x>A||ae.x<0||ae.y>y||ae.y<0)&&(r.style.display="none"),r.style.left=ae.x+"px",r.style.top=ae.y+"px",r.style.transition="left 0.25s cubic-bezier(0,0,0.25,1), top 0.25s cubic-bezier(0,0,0.25,1)"}}onMapClick(e){const{element:r}=this.markerOption;this.popup&&r&&this.togglePopup()}getCurrentContainerSize(){const e=this.mapsService.getContainer();return{containerHeight:(e==null?void 0:e.scrollHeight)||0,containerWidth:(e==null?void 0:e.scrollWidth)||0,bounds:this.mapsService.getBounds()}}updateDraggable(){const{element:e}=this.markerOption;e==null||e.removeEventListener("mousedown",this.onMarkerDragStart),this.mapsService.off("mousemove",this.onMarkerDragMove),document.removeEventListener("mouseup",this.onMarkerDragEnd),this.markerOption.draggable&&(e==null||e.addEventListener("mousedown",this.onMarkerDragStart))}updatePosition(){if(!this.mapsService)return;const{element:e,offsets:r}=this.markerOption,{lng:n,lat:a}=this.lngLat,u=this.mapsService.lngLatToContainer([n,a]);if(e){e.style.display="block",e.style.whiteSpace="nowrap";const{containerHeight:y,containerWidth:A,bounds:O}=this.getMarkerLayerContainerSize()||this.getCurrentContainerSize();if(!O)return;if(Math.abs(O[0][0])>180||Math.abs(O[1][0])>180){if(u.x>A){const Z=this.mapsService.lngLatToContainer([n-360,a]);u.x=Z.x}if(u.x<0){const Z=this.mapsService.lngLatToContainer([n+360,a]);u.x=Z.x}}(u.x>A||u.x<0||u.y>y||u.y<0)&&(e.style.display="none"),e.style.left=u.x+r[0]+"px",e.style.top=u.y-r[1]+"px"}}init(){let{element:e}=this.markerOption;const{color:r,anchor:n}=this.markerOption;if(!e){e=Xo("div"),this.markerOption.element=e;const a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height","48px"),a.setAttributeNS(null,"width","48px"),a.setAttributeNS(null,"viewBox","0 0 1024 1024");const u=document.createElementNS("http://www.w3.org/2000/svg","path");u.setAttributeNS(null,"d","M512 490.666667C453.12 490.666667 405.333333 442.88 405.333333 384 405.333333 325.12 453.12 277.333333 512 277.333333 570.88 277.333333 618.666667 325.12 618.666667 384 618.666667 442.88 570.88 490.666667 512 490.666667M512 85.333333C346.88 85.333333 213.333333 218.88 213.333333 384 213.333333 608 512 938.666667 512 938.666667 512 938.666667 810.666667 608 810.666667 384 810.666667 218.88 677.12 85.333333 512 85.333333Z"),u.setAttributeNS(null,"fill",r),a.appendChild(u),e.appendChild(a)}dl(e,"l7-marker"),Object.keys(this.markerOption.style||{}).forEach(a=>{var u,y;const A=((u=this.markerOption)===null||u===void 0?void 0:u.style)&&((y=this.markerOption)===null||y===void 0?void 0:y.style[a]);e&&(e.style[a]=A)}),Fo(e,n,"marker")}registerMarkerEvent(e){e.addEventListener("click",this.onMapClick),e.addEventListener("mousemove",this.eventHandle),e.addEventListener("click",this.eventHandle),e.addEventListener("mousedown",this.eventHandle),e.addEventListener("mouseup",this.eventHandle),e.addEventListener("dblclick",this.eventHandle),e.addEventListener("contextmenu",this.eventHandle),e.addEventListener("mouseover",this.eventHandle),e.addEventListener("mouseout",this.eventHandle),e.addEventListener("touchstart",this.eventHandle),e.addEventListener("touchend",this.eventHandle)}unRegisterMarkerEvent(){const e=this.getElement();e.removeEventListener("click",this.onMapClick),e.removeEventListener("mousemove",this.eventHandle),e.removeEventListener("click",this.eventHandle),e.removeEventListener("mousedown",this.eventHandle),e.removeEventListener("mouseup",this.eventHandle),e.removeEventListener("dblclick",this.eventHandle),e.removeEventListener("contextmenu",this.eventHandle),e.removeEventListener("mouseover",this.eventHandle),e.removeEventListener("mouseout",this.eventHandle),e.removeEventListener("touchstart",this.eventHandle),e.removeEventListener("touchend",this.eventHandle)}polyfillEvent(e){!this.mapsService||this.mapsService.version!=="GAODE2.x"||Ya()||(e.type==="touchstart"&&(this.touchStartTime=Date.now()),e.type==="touchend"&&Date.now()-this.touchStartTime<300&&this.emit("click",{target:e,data:this.markerOption.extData,lngLat:this.lngLat}))}addDragHandler(e){return null}onUp(e){throw new Error("Method not implemented.")}}const{merge:yb}=es;class vy extends Yl.EventEmitter{constructor(e){var r;super(),(0,K.Z)(this,"markers",[]),(0,K.Z)(this,"markerLayerOption",void 0),(0,K.Z)(this,"clusterIndex",void 0),(0,K.Z)(this,"points",[]),(0,K.Z)(this,"clusterMarkers",[]),(0,K.Z)(this,"mapsService",void 0),(0,K.Z)(this,"scene",void 0),(0,K.Z)(this,"zoom",void 0),(0,K.Z)(this,"bbox",void 0),(0,K.Z)(this,"inited",void 0),(0,K.Z)(this,"containerSize",void 0),this.markerLayerOption=yb(this.getDefault(),e),nh(["update"],this),this.zoom=((r=this.markerLayerOption.clusterOption)===null||r===void 0?void 0:r.zoom)||-99}getDefault(){return{cluster:!1,clusterOption:{radius:80,maxZoom:20,minZoom:0,zoom:-99,style:{},className:""}}}addTo(e){return this.scene=e,this.mapsService=e.mapService,this.markerLayerOption.cluster&&(this.initCluster(),this.update(),this.mapsService.on("camerachange",this.update),this.mapsService.on("viewchange",this.update)),this.mapsService.on("camerachange",this.setContainerSize.bind(this)),this.mapsService.on("viewchange",this.setContainerSize.bind(this)),this.addMarkers(),this.inited=!0,this}setContainerSize(){if(!this.mapsService)return;const e=this.mapsService.getContainer();this.containerSize={containerWidth:(e==null?void 0:e.scrollWidth)||0,containerHeight:(e==null?void 0:e.scrollHeight)||0,bounds:this.mapsService.getBounds()}}getContainerSize(){return this.containerSize}addMarker(e){const r=this.markerLayerOption.cluster;if(e.getMarkerLayerContainerSize=this.getContainerSize.bind(this),r&&(this.addPoint(e,this.markers.length),this.mapsService)){const n=this.mapsService.getZoom(),a=this.mapsService.getBounds();this.bbox=ai(a,.5),this.zoom=Math.floor(n),this.getClusterMarker(this.bbox,this.zoom)}this.markers.push(e)}removeMarker(e){this.markers.indexOf(e);const r=this.markers.indexOf(e);r>-1&&(this.markers.splice(r,1),this.markerLayerOption.cluster&&(this.removePoint(r),this.mapsService&&this.getClusterMarker(this.bbox,this.zoom)))}hide(){this.markers.map(e=>{e.getElement().style.opacity="0"}),this.clusterMarkers.map(e=>{e.getElement().style.opacity="0"})}show(){this.markers.map(e=>{e.getElement().style.opacity="1"}),this.clusterMarkers.map(e=>{e.getElement().style.opacity="1"})}getMarkers(){return this.markerLayerOption.cluster?this.clusterMarkers:this.markers}getOriginMarkers(){return this.markers}addMarkers(){this.getMarkers().forEach(e=>{e.addTo(this.scene)})}clear(){this.markers.forEach(e=>{e.remove()}),this.clusterMarkers.forEach(e=>{e.remove()}),this.markers=[],this.points=[],this.clusterMarkers=[]}destroy(){this.clear(),this.removeAllListeners(),this.mapsService.off("camerachange",this.update),this.mapsService.off("viewchange",this.update),this.mapsService.off("camerachange",this.setContainerSize.bind(this)),this.mapsService.off("viewchange",this.setContainerSize.bind(this))}addPoint(e,r){const{lng:n,lat:a}=e.getLnglat(),u={geometry:{type:"Point",coordinates:[n,a]},properties:(0,Wt.Z)((0,Wt.Z)({},e.getExtData()),{},{marker_id:r})};this.points.push(u),this.clusterIndex&&this.clusterIndex.load(this.points)}removePoint(e){const r=this.points.findIndex(n=>n.properties.marker_id===e);r>-1&&this.points.splice(r,1),this.clusterIndex&&this.clusterIndex.load(this.points)}initCluster(){if(!this.markerLayerOption.cluster)return;const{radius:e,minZoom:r=0,maxZoom:n}=this.markerLayerOption.clusterOption;this.clusterIndex=new(K_())({radius:e,minZoom:r,maxZoom:n}),this.clusterIndex.load(this.points)}getClusterMarker(e,r){const n=e[0].concat(e[1]),a=this.clusterIndex.getClusters(n,r);this.clusterMarkers.forEach(u=>{u.remove()}),this.clusterMarkers=[],a.forEach(u=>{var y;const{field:A,method:O}=this.markerLayerOption.clusterOption;if((y=u.properties)!==null&&y!==void 0&&y.cluster_id){var Z;const Q=this.getLeaves((Z=u.properties)===null||Z===void 0?void 0:Z.cluster_id);if(u.properties.clusterData=Q,A&&O){const ae=Q==null?void 0:Q.map(gt=>({[A]:gt.properties[A]})),xe=qc(ae,A),Be=Sh(O,xe),it="point_"+O;u.properties[it]=Be.toFixed(2)}}const Y=this.clusterMarker(u);this.clusterMarkers.push(Y),Y.addTo(this.scene)})}getLeaves(e,r=1/0,n=0){return e?this.clusterIndex.getLeaves(e,r,n):null}clusterMarker(e){const r=this.markerLayerOption.clusterOption,{element:n=this.generateElement.bind(this)}=r;return new Tv({element:n(e)}).setLnglat({lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]})}normalMarker(e){const r=e.properties.marker_id;return this.markers[r]}update(){if(!this.mapsService||this.markers.length===0)return;const e=this.mapsService.getZoom(),r=this.mapsService.getBounds();(!this.bbox||Math.abs(e-this.zoom)>=1||!is(this.bbox,r))&&(this.bbox=ai(r,.5),this.zoom=Math.floor(e),this.getClusterMarker(this.bbox,this.zoom))}generateElement(e){const r=Xo("div","l7-marker-cluster"),n=Xo("div","",r),a=Xo("span","",n),{field:u,method:y}=this.markerLayerOption.clusterOption;e.properties.point_count=e.properties.point_count||1;const A=u&&y?e.properties["point_"+y]||e.properties[u]:e.properties.point_count;return a.textContent=A,r}}var lE=Se(61227);class Xd extends Th(){constructor(e){super(),(0,K.Z)(this,"controlOption",void 0),(0,K.Z)(this,"container",void 0),(0,K.Z)(this,"isShow",void 0),(0,K.Z)(this,"sceneContainer",void 0),(0,K.Z)(this,"scene",void 0),(0,K.Z)(this,"mapsService",void 0),(0,K.Z)(this,"renderService",void 0),(0,K.Z)(this,"layerService",void 0),(0,K.Z)(this,"controlService",void 0),(0,K.Z)(this,"configService",void 0),Xd.controlCount++,this.controlOption=(0,Wt.Z)((0,Wt.Z)({},this.getDefault(e)),e||{})}getOptions(){return this.controlOption}setOptions(e){const r=this.getDefault(e);Object.entries(e).forEach(([n,a])=>{a===void 0&&(e[n]=r[n])}),"position"in e&&this.setPosition(e.position),"className"in e&&this.setClassName(e.className),"style"in e&&this.setStyle(e.style),this.controlOption=(0,Wt.Z)((0,Wt.Z)({},this.controlOption),e)}addTo(e){this.mapsService=e.mapService,this.renderService=e.rendererService,this.layerService=e.layerService,this.controlService=e.controlService,this.configService=e.globalConfigService,this.scene=e.sceneService,this.sceneContainer=e,this.isShow=!0,this.container=this.onAdd(),dl(this.container,"l7-control");const{className:r,style:n}=this.controlOption;return r&&this.setClassName(r),n&&this.setStyle(n),this.insertContainer(),this.emit("add",this),this}remove(){if(!this.mapsService)return this;au(this.container),this.onRemove(),this.emit("remove",this)}onAdd(){return Xo("div")}onRemove(){}show(){const e=this.container;tc(e,"l7-control--hide"),this.isShow=!0,this.emit("show",this)}hide(){const e=this.container;dl(e,"l7-control--hide"),this.isShow=!1,this.emit("hide",this)}getDefault(e){return{position:Mt.TOPRIGHT,name:`${Xd.controlCount}`}}getContainer(){return this.container}getIsShow(){return this.isShow}_refocusOnMap(e){if(this.mapsService&&e&&e.screenX>0&&e.screenY>0){const r=this.mapsService.getContainer();r!==null&&r.focus()}}setPosition(e=Mt.TOPLEFT){const r=this.controlService;return r&&r.removeControl(this),this.controlOption.position=e,r&&r.addControl(this,this.sceneContainer),this}setClassName(e){const r=this.container,{className:n}=this.controlOption;n&&tc(r,n),e&&dl(r,e)}setStyle(e){const r=this.container;e?r.setAttribute("style",e):r.removeAttribute("style")}insertContainer(){const e=this.controlOption.position,r=this.container;if(e instanceof Element)e.appendChild(r);else{const n=this.controlService.controlCorners[e];["bottomleft","bottomright","righttop","rightbottom"].includes(e)?n.insertBefore(r,n.firstChild):n.appendChild(r)}}checkUpdateOption(e,r){return r.some(n=>n in e)}}(0,K.Z)(Xd,"controlCount",0);class hg extends Xd{constructor(...e){super(...e),(0,K.Z)(this,"isDisable",!1),(0,K.Z)(this,"button",void 0),(0,K.Z)(this,"buttonText",void 0),(0,K.Z)(this,"buttonIcon",void 0)}setIsDisable(e){if(this.isDisable=e,e){var r;(r=this.button)===null||r===void 0||r.setAttribute("disabled","true")}else{var n;(n=this.button)===null||n===void 0||n.removeAttribute("disabled")}}createButton(e=""){return Xo("button",`l7-button-control ${e}`)}onAdd(){this.button=this.createButton(),this.isDisable=!1;const{title:e,btnText:r,btnIcon:n}=this.controlOption;return this.setBtnTitle(e),this.setBtnText(r),this.setBtnIcon(n),this.button}onRemove(){this.button=this.buttonIcon=this.buttonText=void 0,this.isDisable=!1}setOptions(e){const{title:r,btnText:n,btnIcon:a}=e;this.checkUpdateOption(e,["title"])&&this.setBtnTitle(r),this.checkUpdateOption(e,["btnIcon"])&&this.setBtnIcon(a),this.checkUpdateOption(e,["btnText"])&&this.setBtnText(n),super.setOptions(e)}setBtnTitle(e){var r;(r=this.button)===null||r===void 0||r.setAttribute("title",e!=null?e:"")}setBtnIcon(e){if(this.buttonIcon&&au(this.buttonIcon),e){var r;const u=(r=this.button)===null||r===void 0?void 0:r.firstChild;if(u){var n;(n=this.button)===null||n===void 0||n.insertBefore(e,u)}else{var a;(a=this.button)===null||a===void 0||a.appendChild(e)}this.buttonIcon=e}}setBtnText(e){if(this.button)if(tc(this.button,"l7-button-control--row"),tc(this.button,"l7-button-control--column"),e){let n=this.buttonText;if(!n){var r;n=Xo("div","l7-button-control__text"),(r=this.button)===null||r===void 0||r.appendChild(n),this.buttonText=n}n.innerText=e,dl(this.button,this.controlOption.vertical?"l7-button-control--column":"l7-button-control--row")}else!e&&this.buttonText&&(au(this.buttonText),this.buttonText=void 0)}}class qg extends Yl.EventEmitter{get buttonRect(){return this.button.getBoundingClientRect()}constructor(e,r){super(),(0,K.Z)(this,"popperDOM",void 0),(0,K.Z)(this,"contentDOM",void 0),(0,K.Z)(this,"button",void 0),(0,K.Z)(this,"option",void 0),(0,K.Z)(this,"isShow",!1),(0,K.Z)(this,"content",void 0),(0,K.Z)(this,"timeout",null),(0,K.Z)(this,"show",()=>this.isShow||!this.contentDOM.innerHTML?this:(this.resetPopperPosition(),tc(this.popperDOM,"l7-popper-hide"),this.isShow=!0,this.option.unique&&qg.conflictPopperList.forEach(n=>{n!==this&&n.isShow&&n.hide()}),this.emit("show"),window.addEventListener("pointerdown",this.onPopperUnClick),this)),(0,K.Z)(this,"hide",()=>this.isShow?(dl(this.popperDOM,"l7-popper-hide"),this.isShow=!1,this.emit("hide"),window.removeEventListener("pointerdown",this.onPopperUnClick),this):this),(0,K.Z)(this,"setHideTimeout",()=>{this.timeout||(this.timeout=window.setTimeout(()=>{this.isShow&&(this.hide(),this.timeout=null)},300))}),(0,K.Z)(this,"clearHideTimeout",()=>{this.timeout&&(window.clearTimeout(this.timeout),this.timeout=null)}),(0,K.Z)(this,"onBtnClick",()=>{this.isShow?this.hide():this.show()}),(0,K.Z)(this,"onPopperUnClick",n=>{rh(n.target,[".l7-button-control",".l7-popper-content"])||this.hide()}),(0,K.Z)(this,"onBtnMouseLeave",()=>{this.setHideTimeout()}),(0,K.Z)(this,"onBtnMouseMove",()=>{this.clearHideTimeout(),!this.isShow&&this.show()}),this.button=e,this.option=r,this.init(),r.unique&&qg.conflictPopperList.push(this)}getPopperDOM(){return this.popperDOM}getIsShow(){return this.isShow}getContent(){return this.content}setContent(e){typeof e=="string"?this.contentDOM.innerHTML=e:e instanceof HTMLElement&&(Ac(this.contentDOM),this.contentDOM.appendChild(e)),this.content=e}init(){const{trigger:e}=this.option;this.popperDOM=this.createPopper(),e==="click"?this.button.addEventListener("click",this.onBtnClick):(this.button.addEventListener("mousemove",this.onBtnMouseMove),this.button.addEventListener("mouseleave",this.onBtnMouseLeave),this.popperDOM.addEventListener("mousemove",this.onBtnMouseMove),this.popperDOM.addEventListener("mouseleave",this.onBtnMouseLeave))}destroy(){this.button.removeEventListener("click",this.onBtnClick),this.button.removeEventListener("mousemove",this.onBtnMouseMove),this.button.removeEventListener("mousemove",this.onBtnMouseLeave),this.popperDOM.removeEventListener("mousemove",this.onBtnMouseMove),this.popperDOM.removeEventListener("mouseleave",this.onBtnMouseLeave),au(this.popperDOM)}resetPopperPosition(){const e={},{container:r,offset:n=[0,0],placement:a}=this.option,[u,y]=n,A=this.button.getBoundingClientRect(),O=r.getBoundingClientRect(),{left:Z,right:Y,top:Q,bottom:ae}=$p(A,O);let xe=!1,Be=!1;/^(left|right)/.test(a)?(a.includes("left")?e.right=`${A.width+Y}px`:a.includes("right")&&(e.left=`${A.width+Z}px`),a.includes("start")?e.top=`${Q}px`:a.includes("end")?e.bottom=`${ae}px`:(e.top=`${Q+A.height/2}px`,Be=!0,e.transform=`translate(${u}px, calc(${y}px - 50%))`)):/^(top|bottom)/.test(a)&&(a.includes("top")?e.bottom=`${A.height+ae}px`:a.includes("bottom")&&(e.top=`${A.height+Q}px`),a.includes("start")?e.left=`${Z}px`:a.includes("end")?e.right=`${Y}px`:(e.left=`${Z+A.width/2}px`,xe=!0,e.transform=`translate(calc(${u}px - 50%), ${y}px)`)),e.transform=`translate(calc(${u}px - ${xe?"50%":"0%"}), calc(${y}px - ${Be?"50%":"0%"})`;const it=a.split("-");it.length&&dl(this.popperDOM,it.map(gt=>`l7-popper-${gt}`).join(" ")),Fs(this.popperDOM,jc(e))}createPopper(){const{container:e,className:r="",content:n}=this.option,a=Xo("div",`l7-popper l7-popper-hide ${r}`),u=Xo("div","l7-popper-content"),y=Xo("div","l7-popper-arrow");return a.appendChild(u),a.appendChild(y),e.appendChild(a),this.popperDOM=a,this.contentDOM=u,n&&this.setContent(n),a}}(0,K.Z)(qg,"conflictPopperList",[]);const xb={topleft:"right-start",topcenter:"bottom",topright:"left-start",bottomleft:"right-end",bottomcenter:"top",bottomright:"left-end",lefttop:"bottom-start",leftcenter:"right",leftbottom:"top-start",righttop:"bottom-end",rightcenter:"left",rightbottom:"top-end"};class Av extends hg{constructor(...e){super(...e),(0,K.Z)(this,"popper",void 0)}getPopper(){return this.popper}hide(){this.popper.hide(),super.hide()}getDefault(e){var r;const n=super.getDefault(e),a=(r=e==null?void 0:e.position)!==null&&r!==void 0?r:n.position;return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{popperPlacement:a instanceof Element?"bottom":xb[a],popperTrigger:"click"})}onAdd(){const e=super.onAdd();return this.initPopper(),e}onRemove(){this.popper.destroy()}initPopper(){const{popperClassName:e,popperPlacement:r,popperTrigger:n}=this.controlOption,a=this.mapsService.getMapContainer();return this.popper=new qg(this.button,{className:e,placement:r,trigger:n,container:a,unique:!0}),this.popper.on("show",()=>{this.emit("popperShow",this)}).on("hide",()=>{this.emit("popperHide",this)}),this.popper}setOptions(e){if(super.setOptions(e),this.checkUpdateOption(e,["popperPlacement","popperTrigger","popperClassName"])){const r=this.popper.getContent();this.popper.destroy(),this.initPopper(),this.popper.setContent(r)}}}var pg=function(t){return t.ActiveOptionClassName="l7-select-control-item-active",t.OptionValueAttrKey="data-option-value",t.OptionIndexAttrKey="data-option-index",t}(pg||{});class Cv extends Av{constructor(...e){super(...e),(0,K.Z)(this,"selectValue",[]),(0,K.Z)(this,"optionDOMList",void 0),(0,K.Z)(this,"createNormalOption",r=>{const n=this.selectValue.includes(r.value),a=Xo("div",`l7-select-control-item ${n?pg.ActiveOptionClassName:""}`);this.getIsMultiple()?a.appendChild(this.createCheckbox(n)):a.appendChild(this.createRadio(n)),r.icon&&a.appendChild(r.icon);const u=Xo("span");return u.innerText=r.text,a.appendChild(u),a}),(0,K.Z)(this,"onItemClick",r=>{if(this.getIsMultiple()){const n=this.selectValue.findIndex(a=>a===r.value);n>-1?this.selectValue.splice(n,1):this.selectValue=[...this.selectValue,r.value]}else this.selectValue=[r.value];this.setSelectValue(this.selectValue)})}setOptions(e){super.setOptions(e);const{options:r}=e;r&&this.popper.setContent(this.getPopperContent(r))}onAdd(){const e=super.onAdd(),{defaultValue:r}=this.controlOption;return r&&(this.selectValue=this.transSelectValue(r)),this.popper.setContent(this.getPopperContent(this.controlOption.options)),e}getSelectValue(){return this.getIsMultiple()?this.selectValue:this.selectValue[0]}setSelectValue(e,r=!0){const n=this.transSelectValue(e);this.optionDOMList.forEach(a=>{const u=a.getAttribute(pg.OptionValueAttrKey),y=a.querySelector("input[type=checkbox]"),A=a.querySelector("input[type=radio]"),O=n.includes(u),Z=(Y,Q)=>{Kh(a,pg.ActiveOptionClassName,Q),Y&&Jh(Y,Q)};Z(y,O),Z(A,O)}),this.selectValue=n,r&&this.emit("selectChange",this.getIsMultiple()?n:n[0])}getIsMultiple(){return!1}getPopperContent(e){const r=this.isImageOptions(),n=Xo("div",r?"l7-select-control--image":"l7-select-control--normal");this.getIsMultiple()&&dl(n,"l7-select-control--multiple");const a=e.map((u,y)=>{const A=r?this.createImageOption(u):this.createNormalOption(u);return A.setAttribute(pg.OptionValueAttrKey,u.value),A.setAttribute(pg.OptionIndexAttrKey,window.String(y)),A.addEventListener("click",this.onItemClick.bind(this,u)),A});return n.append(...a),this.optionDOMList=a,n}createImageOption(e){const r=this.selectValue.includes(e.value),n=Xo("div",`l7-select-control-item ${r?pg.ActiveOptionClassName:""}`),a=Xo("img");a.setAttribute("src",e.img),kh(a),n.appendChild(a);const u=Xo("div","l7-select-control-item-row");this.getIsMultiple()&&n.appendChild(this.createCheckbox(r));const y=Xo("span");return y.innerText=e.text,u.appendChild(y),n.appendChild(u),n}createCheckbox(e){const r=Xo("input");return r.setAttribute("type","checkbox"),e&&Jh(r,!0),r}createRadio(e){const r=Xo("input");return r.setAttribute("type","radio"),e&&Jh(r,!0),r}isImageOptions(){return!!this.controlOption.options.find(e=>e.img)}transSelectValue(e){return Array.isArray(e)?e:[e]}}const km=t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.classList.add("l7-iconfont"),e.setAttribute("aria-hidden","true");const r=document.createElementNS("http://www.w3.org/2000/svg","use");return r.setAttributeNS("http://www.w3.org/1999/xlink","href",`#${t}`),e.appendChild(r),e};class fg extends hg{constructor(...e){var r;super(...e),r=this,(0,K.Z)(this,"onClick",(0,Nr.Z)(function*(){const{onExport:n}=r.controlOption;n==null||n(yield r.getImage())})),(0,K.Z)(this,"mergeImage",(0,Nr.Z)(function*(...n){var a,u;const{imageType:y}=r.controlOption,{width:A=0,height:O=0}=(a=(u=r.mapsService.getContainer())===null||u===void 0?void 0:u.getBoundingClientRect())!==null&&a!==void 0?a:{},Z=document.createElement("canvas");Z.width=A,Z.height=O;const Y=Z.getContext("2d");return(yield Promise.all(n.map(ae=>new Promise(xe=>{const Be=new Image;Be.onload=()=>{xe(Be)},Be.src=ae})))).forEach(ae=>{Y==null||Y.drawImage(ae,0,0,A,O)}),Z.toDataURL(`image/${y}`)}))}onAdd(){const e=super.onAdd();return e.addEventListener("click",this.onClick),e}getDefault(e){return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{title:"\u5BFC\u51FA\u56FE\u7247",btnIcon:km("l7-icon-export-picture"),imageType:"png"})}getImage(){var e=this;return(0,Nr.Z)(function*(){const r=yield e.mapsService.exportMap("png"),n=yield e.scene.exportPng("png");return e.mergeImage(...[r,n].filter(a=>a))})()}}const _0=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],Mm=(()=>{if(typeof document=="undefined")return!1;const t=_0[0],e={};for(const r of _0)if((r==null?void 0:r[1])in document){for(const[a,u]of r.entries())e[t[a]]=u;return e}return!1})(),_y={change:Mm.fullscreenchange,error:Mm.fullscreenerror};let Rd={request(t=document.documentElement,e){return new Promise((r,n)=>{const a=()=>{Rd.off("change",a),r()};Rd.on("change",a);const u=t[Mm.requestFullscreen](e);u instanceof Promise&&u.then(a).catch(n)})},exit(){return new Promise((t,e)=>{if(!Rd.isFullscreen){t();return}const r=()=>{Rd.off("change",r),t()};Rd.on("change",r);const n=document[Mm.exitFullscreen]();n instanceof Promise&&n.then(r).catch(e)})},toggle(t,e){return Rd.isFullscreen?Rd.exit():Rd.request(t,e)},onchange(t){Rd.on("change",t)},onerror(t){Rd.on("error",t)},on(t,e){const r=_y[t];r&&document.addEventListener(r,e,!1)},off(t,e){const r=_y[t];r&&document.removeEventListener(r,e,!1)},raw:Mm};Object.defineProperties(Rd,{isFullscreen:{get:()=>!!document[Mm.fullscreenElement]},element:{enumerable:!0,get:()=>{var t;return(t=document[Mm.fullscreenElement])!==null&&t!==void 0?t:void 0}},isEnabled:{enumerable:!0,get:()=>!!document[Mm.fullscreenEnabled]}}),Mm||(Rd={isEnabled:!1});var Mv=Rd;class yy extends hg{constructor(e){var r;super(e),r=this,(0,K.Z)(this,"isFullscreen",!1),(0,K.Z)(this,"mapContainer",void 0),(0,K.Z)(this,"toggleFullscreen",(0,Nr.Z)(function*(){Mv.isEnabled&&(yield Mv.toggle(r.mapContainer))})),(0,K.Z)(this,"onClick",()=>{this.toggleFullscreen()}),(0,K.Z)(this,"onFullscreenChange",()=>{this.isFullscreen=!!document.fullscreenElement;const{btnText:n,btnIcon:a,title:u,exitBtnText:y,exitBtnIcon:A,exitTitle:O}=this.controlOption;this.isFullscreen?(this.setBtnTitle(O),this.setBtnText(y),this.setBtnIcon(A)):(this.setBtnTitle(u),this.setBtnText(n),this.setBtnIcon(a)),this.emit("fullscreenChange",this.isFullscreen)}),Mv.isEnabled||console.warn("\u5F53\u524D\u6D4F\u89C8\u5668\u73AF\u5883\u4E0D\u652F\u6301\u5BF9\u5730\u56FE\u5168\u5C4F\u5316")}setOptions(e){const{exitBtnText:r,exitBtnIcon:n,exitTitle:a}=e;this.isFullscreen&&(this.checkUpdateOption(e,["exitBtnIcon"])&&this.setBtnIcon(n),this.checkUpdateOption(e,["exitBtnText"])&&this.setBtnText(r),this.checkUpdateOption(e,["exitTitle"])&&this.setBtnTitle(a)),super.setOptions(e)}onAdd(){const e=super.onAdd();return e.addEventListener("click",this.onClick),this.mapContainer=wc(this.scene.getSceneConfig().id),this.mapContainer.addEventListener("fullscreenchange",this.onFullscreenChange),e}onRemove(){super.onRemove(),this.mapContainer.removeEventListener("fullscreenchange",this.onFullscreenChange)}getDefault(e){return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{title:"\u5168\u5C4F",btnIcon:km("l7-icon-fullscreen"),exitTitle:"\u9000\u51FA\u5168\u5C4F",exitBtnIcon:km("l7-icon-exit-fullscreen")})}}class xy extends hg{constructor(e){var r;super(e),r=this,(0,K.Z)(this,"getGeoLocation",()=>new Promise((n,a)=>{window.navigator.geolocation.getCurrentPosition(({coords:u})=>{const{longitude:y,latitude:A}=u!=null?u:{};!isNaN(y)&&!isNaN(A)?n([y,A]):a()},u=>{a(u)})})),(0,K.Z)(this,"onClick",(0,Nr.Z)(function*(){if(!window.navigator.geolocation)return;const{transform:n}=r.controlOption,a=yield r.getGeoLocation(),u=r.mapsService.getZoom();r.mapsService.setZoomAndCenter(u>15?u:15,n?yield n(a):a)})),window.navigator.geolocation||console.warn("\u5F53\u524D\u6D4F\u89C8\u5668\u73AF\u5883\u4E0D\u652F\u6301\u83B7\u53D6\u5730\u7406\u5B9A\u4F4D")}getDefault(e){return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{title:"\u5B9A\u4F4D",btnIcon:km("l7-icon-reposition")})}onAdd(){const e=super.onAdd();return e.addEventListener("click",this.onClick),e}}function by(t){return Object.keys(t!=null?t:{}).every(e=>["layer","name","img"].includes(e))}class bb extends Cv{constructor(...e){super(...e),(0,K.Z)(this,"onLayerChange",()=>{var r;(r=this.controlOption.layers)!==null&&r!==void 0&&r.length||(this.selectValue=this.getLayerVisible(),this.setOptions({options:this.getLayerOptions()}))}),(0,K.Z)(this,"onLayerVisibleChane",()=>{this.setSelectValue(this.getLayerVisible())}),(0,K.Z)(this,"onSelectChange",()=>{this.layers.forEach(r=>{const n=this.selectValue.includes(r.name),a=r.isVisible();n&&!a&&r.show(),!n&&a&&r.hide()})})}get layers(){const e=this.layerService,{layers:r}=this.controlOption;if(Array.isArray(r)&&r.length){const n=[];return r.forEach(a=>{if(a instanceof Object&&(by(a)?n.push(a.layer):n.push(a)),typeof a=="string"){const u=e.getLayer(a)||e.getLayerByName(a);u&&n.push(u)}}),n}return e.getLayers()||[]}getDefault(e){var r;return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{title:"\u56FE\u5C42\u63A7\u5236",btnIcon:km("l7-icon-layer"),options:[],multiple:(r=e==null?void 0:e.multiple)!==null&&r!==void 0?r:!0})}getLayerVisible(){return this.layers.filter(e=>e.isVisible()).map(e=>e.name)}getLayerOptions(){const{layers:e}=this.controlOption,r=e==null?void 0:e.every(n=>n.img);return e?e==null?void 0:e.map(n=>{if(by(n))return{text:n.name||n.layer.name,value:n.layer.name,img:r?n.img:void 0};if(typeof n=="string"){const a=this.layerService.getLayer(n)||this.layerService.getLayerByName(n);return{text:a==null?void 0:a.name,value:a==null?void 0:a.name}}return{text:n.name,value:n.name}}):this.layers.map(n=>({text:n.name,value:n.name}))}setOptions(e){const r=this.checkUpdateOption(e,["layers","multiple"]);super.setOptions(e),r&&(this.controlOption.multiple===!1&&this.handleSingleSelection(),this.selectValue=this.getLayerVisible(),this.controlOption.options=this.getLayerOptions(),this.popper.setContent(this.getPopperContent(this.controlOption.options)))}handleSingleSelection(){this.layers.forEach((e,r)=>{r===0?e.show():e.hide()})}onAdd(){var e;return this.controlOption.multiple===!1&&this.handleSingleSelection(),(e=this.controlOption.options)!==null&&e!==void 0&&e.length||(this.controlOption.options=this.getLayerOptions()),this.controlOption.defaultValue||(this.controlOption.defaultValue=this.getLayerVisible()),this.on("selectChange",this.onSelectChange),this.layerService.on("layerChange",this.onLayerChange),super.onAdd()}onRemove(){this.off("selectChange",this.onSelectChange),this.layerService.off("layerChange",this.onLayerChange)}getIsMultiple(){return this.controlOption.multiple}}class Ey extends Xd{getDefault(){return{position:Mt.BOTTOMLEFT,name:"logo",href:"https://l7.antv.antgroup.com/",img:"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*GRb1TKp4HcMAAAAAAAAAAAAAARQnAQ"}}onAdd(){const e=Xo("div","l7-control-logo");return this.setLogoContent(e),e}onRemove(){return null}setOptions(e){super.setOptions(e),this.checkUpdateOption(e,["img","href"])&&(Ac(this.container),this.setLogoContent(this.container))}setLogoContent(e){const{href:r,img:n}=this.controlOption,a=Xo("img");if(a.setAttribute("src",n),a.setAttribute("aria-label","AntV logo"),kh(a),r){const u=Xo("a","l7-control-logo-link");u.target="_blank",u.href=r,u.rel="noopener nofollow",u.setAttribute("rel","noopener nofollow"),u.appendChild(a),e.appendChild(u)}else e.appendChild(a)}}const wy={normal:{text:"\u6807\u51C6",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*qdFDSbvIalgAAAAAAAAAAAAADmJ7AQ/original"},light:{text:"\u6708\u5149\u94F6",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*d-vcRLzu8WIAAAAAAAAAAAAADmJ7AQ/original"},dark:{text:"\u5E7B\u5F71\u9ED1",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*HMbRTI3XnpIAAAAAAAAAAAAADmJ7AQ/original"},fresh:{text:"\u8349\u8272\u9752",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*kqaGQ5kjSiAAAAAAAAAAAAAADmJ7AQ/original"},grey:{text:"\u96C5\u58EB\u7070",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*XegrTpZIbqAAAAAAAAAAAAAADmJ7AQ/original"},graffiti:{text:"\u6D82\u9E26",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*G5g9SZ_Jg4cAAAAAAAAAAAAADmJ7AQ/original"},macaron:{text:"\u9A6C\u5361\u9F99",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*irVvQbDpQMwAAAAAAAAAAAAADmJ7AQ/original"},darkblue:{text:"\u6781\u591C\u84DD",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*lKRzQYB4iR0AAAAAAAAAAAAADmJ7AQ/original"},wine:{text:"\u9171\u7C7D",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*orY0T7QL-lwAAAAAAAAAAAAADmJ7AQ/original"}},Eb={normal:{text:"\u6807\u51C6",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*kIyZTok4Uk0AAAAAAAAAAAAADmJ7AQ/original"},light:{text:"\u4EAE",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*Z3JRQKDI-cIAAAAAAAAAAAAADmJ7AQ/original"},dark:{text:"\u6697",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*d7HCQbfmyaoAAAAAAAAAAAAADmJ7AQ/original"},satellite:{text:"\u536B\u661F",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*TytUT6pS9okAAAAAAAAAAAAADmJ7AQ/original"},outdoors:{text:"\u6237\u5916",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*hWwFSYJEFWsAAAAAAAAAAAAADmJ7AQ/original"}};class y0 extends Cv{constructor(...e){super(...e),(0,K.Z)(this,"onMapThemeChange",()=>{this.mapsService.setMapStyle(this.selectValue[0])})}getDefault(e){return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{title:"\u5730\u56FE\u6837\u5F0F",btnIcon:km("l7-icon-color"),options:[]})}getStyleOptions(){const e=this.mapsService.getType()==="mapbox"?Eb:wy;return Object.entries(this.mapsService.getMapStyleConfig()).filter(([r,n])=>typeof n=="string"&&r!=="blank").map(([r,n])=>{var a;const{text:u,img:y}=(a=e[r])!==null&&a!==void 0?a:{};return{text:u!=null?u:r,value:n,img:y,key:r}})}getMapStyle(){return this.mapsService.getMapStyle()}onAdd(){var e;if((e=this.controlOption.options)!==null&&e!==void 0&&e.length||(this.controlOption.options=this.getStyleOptions()),this.controlOption.defaultValue){var r,n;const a=this.controlOption.defaultValue;this.controlOption.defaultValue=(r=(n=this.controlOption.options.find(u=>u.key===a))===null||n===void 0?void 0:n.value)!==null&&r!==void 0?r:a}else{const a=this.getMapStyle();a?this.controlOption.defaultValue=a:this.mapsService.map.once("styledata",()=>{const u=this.mapsService.getMapStyle();this.controlOption.defaultValue=u,this.setSelectValue(u,!1)})}return this.on("selectChange",this.onMapThemeChange),super.onAdd()}getIsMultiple(){return!1}}class wb extends Xd{constructor(...e){super(...e),(0,K.Z)(this,"location",[0,0]),(0,K.Z)(this,"onMouseMove",r=>{let n=this.location;const a=r.lngLat||r.lnglat,{transform:u}=this.controlOption;a&&(n=[a.lng,a.lat]),this.location=n,u&&(n=u(n)),this.insertLocation2HTML(n),this.emit("locationChange",n)})}getLocation(){return this.location}getDefault(e){return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{position:Mt.BOTTOMLEFT,transform:([r,n])=>[+(+r).toFixed(6),+(+n).toFixed(6)]})}onAdd(){const e=Xo("div","l7-control-mouse-location");return e.innerHTML=" ",this.mapsService.on("mousemove",this.onMouseMove),e}onRemove(){this.mapsService.off("mousemove",this.onMouseMove)}insertLocation2HTML(e){this.container.innerText=e.join(", ")}}class Sy extends Xd{constructor(...e){super(...e),(0,K.Z)(this,"mScale",void 0),(0,K.Z)(this,"iScale",void 0),(0,K.Z)(this,"update",()=>{const r=this.mapsService,{maxWidth:n}=this.controlOption,a=r.getSize()[1]/2,u=r.containerToLngLat([0,a]),y=r.containerToLngLat([n,a]),A=bu([u.lng,u.lat],[y.lng,y.lat]);this.updateScales(A)})}getDefault(e){return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{name:"scale",position:Mt.BOTTOMLEFT,maxWidth:100,metric:!0,updateWhenIdle:!1,imperial:!1,lockWidth:!0})}onAdd(){const r=Xo("div","l7-control-scale");this.resetScaleLines(r);const{updateWhenIdle:n}=this.controlOption;return this.mapsService.on(n?"moveend":"mapmove",this.update),this.mapsService.on(n?"zoomend":"zoomchange",this.update),r}onRemove(){const{updateWhenIdle:e}=this.controlOption;this.mapsService.off(e?"zoomend":"zoomchange",this.update),this.mapsService.off(e?"moveend":"mapmove",this.update)}setOptions(e){super.setOptions(e),this.checkUpdateOption(e,["lockWidth","maxWidth","metric","updateWhenIdle","imperial"])&&this.resetScaleLines(this.container)}updateScales(e){const{metric:r,imperial:n}=this.controlOption;r&&e&&this.updateMetric(e),n&&e&&this.updateImperial(e)}resetScaleLines(e){Ac(e);const{metric:r,imperial:n,maxWidth:a,lockWidth:u}=this.controlOption;u&&Fs(e,`width: ${a}px`),r&&(this.mScale=Xo("div","l7-control-scale-line",e)),n&&(this.iScale=Xo("div","l7-control-scale-line",e)),this.update()}updateScale(e,r,n){const{maxWidth:a}=this.controlOption;e.style.width=Math.round(a*n)+"px",e.innerHTML=r}getRoundNum(e){const r=Math.pow(10,(Math.floor(e)+"").length-1);let n=e/r;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,r*n}updateMetric(e){const r=this.getRoundNum(e),n=r<1e3?r+" m":r/1e3+" km";this.updateScale(this.mScale,n,r/e)}updateImperial(e){const r=e*3.2808399;let n,a,u;r>5280?(n=r/5280,a=this.getRoundNum(n),this.updateScale(this.iScale,a+" mi",a/n)):(u=this.getRoundNum(r),this.updateScale(this.iScale,u+" ft",u/r))}}const{cloneDeep:Pv}=es;class Sb{constructor(){(0,K.Z)(this,"mapService",void 0),(0,K.Z)(this,"fontService",void 0)}apply(e,{styleAttributeService:r,mapService:n,fontService:a}){var u=this;this.mapService=n,this.fontService=a,e.hooks.init.tapPromise("DataMappingPlugin",(0,Nr.Z)(function*(){e.log($t.MappingStart,_n.INIT),u.generateMaping(e,{styleAttributeService:r}),e.log($t.MappingEnd,_n.INIT)})),e.hooks.beforeRenderData.tapPromise("DataMappingPlugin",function(){var y=(0,Nr.Z)(function*(A){if(!A)return A;e.dataState.dataMappingNeedUpdate=!1,e.log($t.MappingStart,_n.UPDATE);const O=u.generateMaping(e,{styleAttributeService:r});return e.log($t.MappingEnd,_n.UPDATE),O});return function(A){return y.apply(this,arguments)}}()),e.hooks.beforeRender.tap("DataMappingPlugin",()=>{const y=e.getSource();if(e.layerModelNeedUpdate||!y||!y.inited)return;const A=r.getLayerStyleAttributes()||[],O=r.getLayerStyleAttribute("filter"),{dataArray:Z}=y.data;if(Array.isArray(Z)&&Z.length===0)return;const Y=A.filter(ae=>ae.needRemapping);let Q=Z;if(O!=null&&O.needRemapping&&O!==null&&O!==void 0&&O.scale&&(Q=Z.filter(ae=>this.applyAttributeMapping(O,ae)[0])),Y.length){const ae=this.mapping(e,Y,Q,e.getEncodedData());e.setEncodedData(ae)}})}generateMaping(e,{styleAttributeService:r}){const n=r.getLayerStyleAttributes()||[],a=r.getLayerStyleAttribute("filter"),{dataArray:u}=e.getSource().data;let y=u;a!=null&&a.scale&&(y=u.filter(O=>this.applyAttributeMapping(a,O)[0])),y=e.processData(y);const A=this.mapping(e,n,y,void 0);return e.setEncodedData(A),e.emit("dataUpdate",null),!0}mapping(e,r,n,a){const u=r.filter(A=>A.scale!==void 0).filter(A=>A.name!=="filter"),y=n.map((A,O)=>{const Z=a?a[O]:{},Y=(0,Wt.Z)({id:A._id,coordinates:A.coordinates},Z);return u.forEach(Q=>{let ae=this.applyAttributeMapping(Q,A);(Q.name==="color"||Q.name==="stroke")&&(ae=ae.map(xe=>Va(xe))),Y[Q.name]=Array.isArray(ae)&&ae.length===1?ae[0]:ae,Q.name==="shape"&&(Y.shape=this.fontService.getIconFontKey(Y[Q.name]))}),Y});return r.forEach(A=>{A.needRemapping=!1}),this.adjustData2Amap2Coordinates(y,e),this.adjustData2SimpleCoordinates(y),y}adjustData2Amap2Coordinates(e,r){if(e.length>0&&this.mapService.version==="GAODE2.x"){const n=r.coordCenter||r.getSource().center;e.filter(a=>!a.originCoordinates).map(a=>{a.version="GAODE2.x",a.originCoordinates=Pv(a.coordinates),a.coordinates=this.mapService.coordToAMap2RelativeCoordinates(a.coordinates,n)})}}adjustData2SimpleCoordinates(e){e.length>0&&this.mapService.version==="SIMPLE"&&e.map(r=>{r.simpleCoordinate||(r.coordinates=this.unProjectCoordinates(r.coordinates),r.simpleCoordinate=!0)})}unProjectCoordinates(e){if(typeof e[0]=="number")return this.mapService.simpleMapCoord.unproject(e);if(e[0]&&e[0][0]instanceof Array){const r=[];return e.map(n=>{const a=[];n.map(u=>{a.push(this.mapService.simpleMapCoord.unproject(u))}),r.push(a)}),r}else{const r=[];return e.map(n=>{r.push(this.mapService.simpleMapCoord.unproject(n))}),r}}applyAttributeMapping(e,r){var n;if(!e.scale)return[];const a=(e==null||(n=e.scale)===null||n===void 0?void 0:n.scalers)||[],u=[];return a.forEach(({field:A})=>{var O;(r.hasOwnProperty(A)||((O=e.scale)===null||O===void 0?void 0:O.type)==="variable")&&u.push(r[A])}),e.mapping?e.mapping(u):[]}getArrowPoints(e,r){const n=[r[0]-e[0],r[1]-e[1]],a=mi(n);return[e[0]+a[0]*1e-4,e[1]+a[1]*1e-4]}}class Tb{constructor(){(0,K.Z)(this,"mapService",void 0)}apply(e){var r=this;this.mapService=e.getContainer().mapService,e.hooks.init.tapPromise("DataSourcePlugin",(0,Nr.Z)(function*(){e.log($t.SourceInitStart,_n.INIT);let n=e.getSource();if(!n){const{data:a,options:u}=e.sourceOption||e.defaultSourceConfig;n=new gy(a,u),e.setSource(n)}n.inited?(r.updateClusterData(e),e.log($t.SourceInitEnd,_n.INIT)):yield new Promise(a=>{n.on("update",u=>{u.type==="inited"&&(r.updateClusterData(e),e.log($t.SourceInitEnd,_n.INIT)),a(null)})})})),e.hooks.beforeRenderData.tapPromise("DataSourcePlugin",(0,Nr.Z)(function*(){const n=r.updateClusterData(e),a=e.dataState.dataSourceNeedUpdate;return e.dataState.dataSourceNeedUpdate=!1,n||a}))}updateClusterData(e){if(e.isTileLayer||e.tileLayer||!e.getSource())return!1;const r=e.getSource(),n=r.cluster,{zoom:a=0}=r.clusterOptions,u=this.mapService.getZoom()-1,y=e.dataState.dataSourceNeedUpdate;return n&&y&&r.updateClusterData(Math.floor(u)),n&&Math.abs(e.clusterZoom-u)>=1?(a!==Math.floor(u)&&r.updateClusterData(Math.floor(u)),e.clusterZoom=u,!0):!1}}function Ty(t,e){return te?1:t>=e?0:NaN}function Rv(t){return t.length===1&&(t=uE(t)),{left:function(e,r,n,a){for(n==null&&(n=0),a==null&&(a=e.length);n>>1;t(e[u],r)<0?n=u+1:a=u}return n},right:function(e,r,n,a){for(n==null&&(n=0),a==null&&(a=e.length);n>>1;t(e[u],r)>0?a=u:n=u+1}return n}}}function uE(t){return function(e,r){return Ty(t(e),r)}}var Ay=Rv(Ty),Cy=Ay.right,cE=Ay.left,x0=Cy;function My(t,e){var r=t.length,n=-1,a,u,y;if(e==null){for(;++n=a)for(u=y=a;++na&&(u=a),y=a)for(u=y=a;++na&&(u=a),y0)return[t];if((n=e0)for(t=Math.ceil(t/A),e=Math.floor(e/A),y=new Array(u=Math.ceil(e-t+1));++a=0?(u>=Iv?10:u>=Lv?5:u>=Dv?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(u>=Iv?10:u>=Lv?5:u>=Dv?2:1)}function Bv(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),a=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),u=n/a;return u>=Iv?a*=10:u>=Lv?a*=5:u>=Dv&&(a*=2),eQ;)ae.pop(),--xe;var Be=new Array(xe+1),it;for(u=0;u<=xe;++u)it=Be[u]=[],it.x0=u>0?ae[u-1]:Y,it.x1=u=1)return+r(t[n-1],n-1,t);var n,a=(n-1)*e,u=Math.floor(a),y=+r(t[u],u,t),A=+r(t[u+1],u+1,t);return y+(A-y)*(a-u)}}function b0(t,e,r,n,a){var u=t*t,y=u*t;return((1-3*t+3*u-y)*e+(4-6*u+3*y)*r+(1+3*t+3*u-3*y)*n+y*a)/6}function Mb(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),a=t[n],u=t[n+1],y=n>0?t[n-1]:2*a-u,A=n180||r<-180?r-360*Math.round(r/360):r):constant(isNaN(t)?e:t)}function Ib(t){return(t=+t)==1?Iy:function(e,r){return r-e?Rb(e,r,t):kv(isNaN(e)?r:e)}}function Iy(t,e){var r=e-t;return r?Ry(t,r):kv(isNaN(t)?e:t)}var Ly=function t(e){var r=Ib(e);function n(a,u){var y=r((a=ir(a)).r,(u=ir(u)).r),A=r(a.g,u.g),O=r(a.b,u.b),Z=Iy(a.opacity,u.opacity);return function(Y){return a.r=y(Y),a.g=A(Y),a.b=O(Y),a.opacity=Z(Y),a+""}}return n.gamma=t,n}(1);function Dy(t){return function(e){var r=e.length,n=new Array(r),a=new Array(r),u=new Array(r),y,A;for(y=0;y=t.length)return r!=null&&A.sort(r),n!=null?n(A):A;for(var Q=-1,ae=A.length,xe=t[O++],Be,it,gt=map(),Bt,Rt=Z();++Qt.length)return A;var Z,Y=e[O-1];return n!=null&&O>=t.length?Z=A.entries():(Z=[],A.each(function(Q,ae){Z.push({key:ae,values:y(Q,O)})})),Y!=null?Z.sort(function(Q,ae){return Y(Q.key,ae.key)}):Z}return a={object:function(A){return u(A,0,Db,Ob)},map:function(A){return u(A,0,By,zv)},entries:function(A){return y(u(A,0,By,zv),0)},key:function(A){return t.push(A),a},sortKeys:function(A){return e[t.length-1]=A,a},sortValues:function(A){return r=A,a},rollup:function(A){return n=A,a}}}function Db(){return{}}function Ob(t,e,r){t[e]=r}function By(){return map()}function zv(t,e,r){t.set(e,r)}function w0(){}var dg=Nv.prototype;w0.prototype=Bb.prototype={constructor:w0,has:dg.has,add:function(t){return t+="",this[qd+t]=t,this},remove:dg.remove,clear:dg.clear,values:dg.keys,size:dg.size,empty:dg.empty,each:dg.each};function Bb(t,e){var r=new w0;if(t instanceof w0)t.each(function(u){r.add(u)});else if(t){var n=-1,a=t.length;if(e==null)for(;++nr&&(u=e.slice(r,u),A[y]?A[y]+=u:A[++y]=u),(n=n[0])===(a=a[0])?A[y]?A[y]+=a:A[++y]=a:(A[++y]=null,O.push({i:y,x:Lg(n,a)})),r=Zv.lastIndex;return rr&&(n=e,e=r,r=n),function(a){return Math.max(e,Math.min(r,a))}}function jb(t,e,r){var n=t[0],a=t[1],u=e[0],y=e[1];return a2?Hb:jb,O=Z=null,Q}function Q(ae){return isNaN(ae=+ae)?u:(O||(O=A(t.map(n),e,r)))(n(y(ae)))}return Q.invert=function(ae){return y(a((Z||(Z=A(e,t.map(n),Lg)))(ae)))},Q.domain=function(ae){return arguments.length?(t=Uv.call(ae,jv),y===jf||(y=jy(t)),Y()):t.slice()},Q.range=function(ae){return arguments.length?(e=Km.call(ae),Y()):e.slice()},Q.rangeRound=function(ae){return e=Km.call(ae),r=Vb,Y()},Q.clamp=function(ae){return arguments.length?(y=ae?jy(t):jf,Q):y!==jf},Q.interpolate=function(ae){return arguments.length?(r=ae,Y()):r},Q.unknown=function(ae){return arguments.length?(u=ae,Q):u},function(ae,xe){return n=ae,a=xe,Y()}}function Hy(t,e){return Gv()(t,e)}var Gb=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function C0(t){if(!(e=Gb.exec(t)))throw new Error("invalid format: "+t);var e;return new Pm({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}C0.prototype=Pm.prototype;function Pm(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Pm.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function xE(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function M0(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function Dg(t){return t=M0(Math.abs(t)),t?t[1]:NaN}function Wb(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Dg(e)/3)))*3-Dg(Math.abs(t)))}function $g(t,e){return function(r,n){for(var a=r.length,u=[],y=0,A=t[0],O=0;a>0&&A>0&&(O+A+1>n&&(A=Math.max(1,n-O)),u.push(r.substring(a-=A,a+A)),!((O+=A+1)>n));)A=t[y=(y+1)%t.length];return u.reverse().join(e)}}function bE(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}function Kg(t){e:for(var e=t.length,r=1,n=-1,a;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(a+1):t}var Wv;function Xv(t,e){var r=M0(t,e);if(!r)return t+"";var n=r[0],a=r[1],u=a-(Wv=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,y=n.length;return u===y?n:u>y?n+new Array(u-y+1).join("0"):u>0?n.slice(0,u)+"."+n.slice(u):"0."+new Array(1-u).join("0")+M0(t,Math.max(0,e+u-1))[0]}function Gy(t,e){var r=M0(t,e);if(!r)return t+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}var Wy={"%":function(t,e){return(t*100).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:xE,e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return Gy(t*100,e)},r:Gy,s:Xv,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function Xy(t){return t}var qv=Array.prototype.map,qy=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function Xb(t){var e=t.grouping===void 0||t.thousands===void 0?Xy:$g(qv.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",a=t.decimal===void 0?".":t.decimal+"",u=t.numerals===void 0?Xy:bE(qv.call(t.numerals,String)),y=t.percent===void 0?"%":t.percent+"",A=t.minus===void 0?"-":t.minus+"",O=t.nan===void 0?"NaN":t.nan+"";function Z(Q){Q=C0(Q);var ae=Q.fill,xe=Q.align,Be=Q.sign,it=Q.symbol,gt=Q.zero,Bt=Q.width,Rt=Q.comma,Yt=Q.precision,vr=Q.trim,ln=Q.type;ln==="n"?(Rt=!0,ln="g"):Wy[ln]||(Yt===void 0&&(Yt=12),vr=!0,ln="g"),(gt||ae==="0"&&xe==="=")&&(gt=!0,ae="0",xe="=");var cn=it==="$"?r:it==="#"&&/[boxX]/.test(ln)?"0"+ln.toLowerCase():"",Gr=it==="$"?n:/[%p]/.test(ln)?y:"",Pn=Wy[ln],Oo=/[defgprs%]/.test(ln);Yt=Yt===void 0?6:/[gprs]/.test(ln)?Math.max(1,Math.min(21,Yt)):Math.max(0,Math.min(20,Yt));function Da(Bo){var Oa=cn,fl=Gr,Gp,Wp,nl;if(ln==="c")fl=Pn(Bo)+fl,Bo="";else{Bo=+Bo;var Df=Bo<0||1/Bo<0;if(Bo=isNaN(Bo)?O:Pn(Math.abs(Bo),Yt),vr&&(Bo=Kg(Bo)),Df&&+Bo==0&&Be!=="+"&&(Df=!1),Oa=(Df?Be==="("?Be:A:Be==="-"||Be==="("?"":Be)+Oa,fl=(ln==="s"?qy[8+Wv/3]:"")+fl+(Df&&Be==="("?")":""),Oo){for(Gp=-1,Wp=Bo.length;++Gpnl||nl>57){fl=(nl===46?a+Bo.slice(Gp+1):Bo.slice(Gp))+fl,Bo=Bo.slice(0,Gp);break}}}Rt&&!gt&&(Bo=e(Bo,1/0));var Xm=Oa.length+Bo.length+fl.length,vd=Xm>1)+Oa+Bo+fl+vd.slice(Xm);break;default:Bo=vd+Oa+Bo+fl;break}return u(Bo)}return Da.toString=function(){return Q+""},Da}function Y(Q,ae){var xe=Z((Q=C0(Q),Q.type="f",Q)),Be=Math.max(-8,Math.min(8,Math.floor(Dg(ae)/3)))*3,it=Math.pow(10,-Be),gt=qy[8+Be/3];return function(Bt){return xe(it*Bt)+gt}}return{format:Z,formatPrefix:Y}}var Jg,Yv,Yy;EE({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function EE(t){return Jg=Xb(t),Yv=Jg.format,Yy=Jg.formatPrefix,Jg}function Qg(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Dg(e)-Dg(t))+1}function P0(t){return Math.max(0,-Dg(Math.abs(t)))}function qb(t,e,r,n){var a=Bv(t,e,r),u;switch(n=C0(n==null?",f":n),n.type){case"s":{var y=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(u=Wb(a,y))&&(n.precision=u),Yy(n,y)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(u=Qg(a,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=u-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(u=P0(a))&&(n.precision=u-(n.type==="%")*2);break}}return Yv(n)}function e0(t){var e=t.domain;return t.ticks=function(r){var n=e();return Ov(n[0],n[n.length-1],r==null?10:r)},t.tickFormat=function(r,n){var a=e();return qb(a[0],a[a.length-1],r==null?10:r,n)},t.nice=function(r){r==null&&(r=10);var n=e(),a=0,u=n.length-1,y=n[a],A=n[u],O;return A0?(y=Math.floor(y/O)*O,A=Math.ceil(A/O)*O,O=Ig(y,A,r)):O<0&&(y=Math.ceil(y*O)/O,A=Math.floor(A*O)/O,O=Ig(y,A,r)),O>0?(n[a]=Math.floor(y/O)*O,n[u]=Math.ceil(A/O)*O,e(n)):O<0&&(n[a]=Math.ceil(y*O)/O,n[u]=Math.floor(A*O)/O,e(n)),t},t}function $v(){var t=Hy(jf,jf);return t.copy=function(){return A0(t,$v())},Jm.apply(t,arguments),e0(t)}function Yb(t){var e;function r(n){return isNaN(n=+n)?e:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(t=map.call(n,number),r):t.slice()},r.unknown=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return Yb(t).unknown(e)},t=arguments.length?map.call(t,number):[0,1],linearish(r)}function $y(t,e){t=t.slice();var r=0,n=t.length-1,a=t[r],u=t[n],y;return u0){for(;aeY)break;Rt.push(gt)}}else for(;ae=1;--it)if(gt=Be*it,!(gtY)break;Rt.push(gt)}}else Rt=Ov(ae,xe,Math.min(xe-ae,Bt)).map(u);return Q?Rt.reverse():Rt},e.tickFormat=function(A,O){if(O==null&&(O=n===10?".0e":","),typeof O!="function"&&(O=Yv(O)),A===1/0)return O;A==null&&(A=10);var Z=Math.max(1,n*A/e.ticks().length);return function(Y){var Q=Y/u(Math.round(a(Y)));return Q*n0?r[A-1]:t[0],A=r?[n[r-1],e]:[n[Z-1],n[Z]]},y.unknown=function(O){return arguments.length&&(u=O),y},y.thresholds=function(){return n.slice()},y.copy=function(){return uo().domain([t,e]).range(a).unknown(u)},Jm.apply(e0(y),arguments)}function ei(){var t=[.5],e=[0,1],r,n=1;function a(u){return u<=u?e[x0(t,u,0,n)]:r}return a.domain=function(u){return arguments.length?(t=Km.call(u),n=Math.min(t.length,e.length-1),a):t.slice()},a.range=function(u){return arguments.length?(e=Km.call(u),n=Math.min(t.length,e.length-1),a):e.slice()},a.invertExtent=function(u){var y=e.indexOf(u);return[t[y-1],t[y]]},a.unknown=function(u){return arguments.length?(r=u,a):r},a.copy=function(){return ei().domain(t).range(e).unknown(r)},Jm.apply(a,arguments)}var ii=new Date,_o=new Date;function Li(t,e,r,n){function a(u){return t(u=arguments.length===0?new Date:new Date(+u)),u}return a.floor=function(u){return t(u=new Date(+u)),u},a.ceil=function(u){return t(u=new Date(u-1)),e(u,1),t(u),u},a.round=function(u){var y=a(u),A=a.ceil(u);return u-y0))return O;do O.push(Z=new Date(+u)),e(u,A),t(u);while(Z=y)for(;t(y),!u(y);)y.setTime(y-1)},function(y,A){if(y>=y)if(A<0)for(;++A<=0;)for(;e(y,-1),!u(y););else for(;--A>=0;)for(;e(y,1),!u(y););})},r&&(a.count=function(u,y){return ii.setTime(+u),_o.setTime(+y),t(ii),t(_o),Math.floor(r(ii,_o))},a.every=function(u){return u=Math.floor(u),!isFinite(u)||!(u>0)?null:u>1?a.filter(n?function(y){return n(y)%u===0}:function(y){return a.count(0,y)%u===0}):a}),a}var yo=Li(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});yo.every=function(t){return!isFinite(t=Math.floor(t))||!(t>0)?null:Li(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,r){e.setFullYear(e.getFullYear()+r*t)})};var Ta=yo,Ha=yo.range,Ua=Li(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12},function(t){return t.getMonth()}),ma=Ua,Zs=Ua.range,Ts=1e3,aa=6e4,La=36e5,hl=864e5,As=6048e5;function zs(t){return Li(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(e,r){e.setDate(e.getDate()+r*7)},function(e,r){return(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*aa)/As})}var $s=zs(0),hr=zs(1),It=zs(2),Qt=zs(3),tn=zs(4),Cn=zs(5),gn=zs(6),zo=$s.range,fs=hr.range,Vs=It.range,Lh=Qt.range,yc=tn.range,hp=Cn.range,nO=gn.range,TE=Li(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*aa)/hl},function(t){return t.getDate()-1}),Qb=TE,iO=TE.range,AE=Li(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ts-t.getMinutes()*aa)},function(t,e){t.setTime(+t+e*La)},function(t,e){return(e-t)/La},function(t){return t.getHours()}),QS=AE,oO=AE.range,CE=Li(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ts)},function(t,e){t.setTime(+t+e*aa)},function(t,e){return(e-t)/aa},function(t){return t.getMinutes()}),eT=CE,aO=CE.range,ME=Li(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+e*Ts)},function(t,e){return(e-t)/Ts},function(t){return t.getUTCSeconds()}),tT=ME,sO=ME.range,Ky=Li(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});Ky.every=function(t){return t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Li(function(e){e.setTime(Math.floor(e/t)*t)},function(e,r){e.setTime(+e+r*t)},function(e,r){return(r-e)/t}):Ky};var rT=Ky,lO=Ky.range;function t0(t){return Li(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(e,r){e.setUTCDate(e.getUTCDate()+r*7)},function(e,r){return(r-e)/As})}var PE=t0(0),Jy=t0(1),nT=t0(2),iT=t0(3),R0=t0(4),oT=t0(5),aT=t0(6),uO=PE.range,cO=Jy.range,hO=nT.range,pO=iT.range,fO=R0.range,dO=oT.range,mO=aT.range,RE=Li(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/hl},function(t){return t.getUTCDate()-1}),IE=RE,gO=RE.range,e2=Li(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});e2.every=function(t){return!isFinite(t=Math.floor(t))||!(t>0)?null:Li(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})};var Qv=e2,vO=e2.range;function t2(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function r2(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function e_(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function sT(t){var e=t.dateTime,r=t.date,n=t.time,a=t.periods,u=t.days,y=t.shortDays,A=t.months,O=t.shortMonths,Z=t_(a),Y=r_(a),Q=t_(u),ae=r_(u),xe=t_(y),Be=r_(y),it=t_(A),gt=r_(A),Bt=t_(O),Rt=r_(O),Yt={a:Df,A:Xm,b:vd,B:I_,c:null,d:kE,e:kE,f:RT,g:UT,G:VT,H:CT,I:MT,j:PT,L:NE,m:IT,M:LT,p:HD,q:GD,Q:HE,s:GE,S:DT,u:OT,U:BT,V:FT,w:kT,W:NT,x:null,X:null,y:zT,Y:ZT,Z:jT,"%":jE},vr={a:WD,A:XD,b:qD,B:YD,c:null,d:UE,e:UE,f:XT,g:nA,G:oA,H:HT,I:GT,j:WT,L:ZE,m:qT,M:YT,p:$D,q:KD,Q:HE,s:GE,S:$T,u:KT,U:JT,V:QT,w:eA,W:tA,x:null,X:null,y:rA,Y:iA,Z:aA,"%":jE},ln={a:Da,A:Bo,b:Oa,B:fl,c:Gp,d:BE,e:BE,f:wT,g:OE,G:DE,H:FE,I:FE,j:yT,L:ET,m:_T,M:xT,p:Oo,q:vT,Q:TT,s:AT,S:bT,u:pT,U:fT,V:dT,w:hT,W:mT,x:Wp,X:nl,y:OE,Y:DE,Z:gT,"%":ST};Yt.x=cn(r,Yt),Yt.X=cn(n,Yt),Yt.c=cn(e,Yt),vr.x=cn(r,vr),vr.X=cn(n,vr),vr.c=cn(e,vr);function cn(Ra,hu){return function($u){var ro=[],em=-1,Dh=0,vm=Ra.length,_m,c0,XS;for($u instanceof Date||($u=new Date(+$u));++em53)return null;"w"in ro||(ro.w=1),"Z"in ro?(Dh=r2(e_(ro.y,0,1)),vm=Dh.getUTCDay(),Dh=vm>4||vm===0?Jy.ceil(Dh):Jy(Dh),Dh=IE.offset(Dh,(ro.V-1)*7),ro.y=Dh.getUTCFullYear(),ro.m=Dh.getUTCMonth(),ro.d=Dh.getUTCDate()+(ro.w+6)%7):(Dh=t2(e_(ro.y,0,1)),vm=Dh.getDay(),Dh=vm>4||vm===0?hr.ceil(Dh):hr(Dh),Dh=Qb.offset(Dh,(ro.V-1)*7),ro.y=Dh.getFullYear(),ro.m=Dh.getMonth(),ro.d=Dh.getDate()+(ro.w+6)%7)}else("W"in ro||"U"in ro)&&("w"in ro||(ro.w="u"in ro?ro.u%7:"W"in ro?1:0),vm="Z"in ro?r2(e_(ro.y,0,1)).getUTCDay():t2(e_(ro.y,0,1)).getDay(),ro.m=0,ro.d="W"in ro?(ro.w+6)%7+ro.W*7-(vm+5)%7:ro.w+ro.U*7-(vm+6)%7);return"Z"in ro?(ro.H+=ro.Z/100|0,ro.M+=ro.Z%100,r2(ro)):t2(ro)}}function Pn(Ra,hu,$u,ro){for(var em=0,Dh=hu.length,vm=$u.length,_m,c0;em=vm)return-1;if(_m=hu.charCodeAt(em++),_m===37){if(_m=hu.charAt(em++),c0=ln[_m in LE?hu.charAt(em++):_m],!c0||(ro=c0(Ra,$u,ro))<0)return-1}else if(_m!=$u.charCodeAt(ro++))return-1}return ro}function Oo(Ra,hu,$u){var ro=Z.exec(hu.slice($u));return ro?(Ra.p=Y[ro[0].toLowerCase()],$u+ro[0].length):-1}function Da(Ra,hu,$u){var ro=xe.exec(hu.slice($u));return ro?(Ra.w=Be[ro[0].toLowerCase()],$u+ro[0].length):-1}function Bo(Ra,hu,$u){var ro=Q.exec(hu.slice($u));return ro?(Ra.w=ae[ro[0].toLowerCase()],$u+ro[0].length):-1}function Oa(Ra,hu,$u){var ro=Bt.exec(hu.slice($u));return ro?(Ra.m=Rt[ro[0].toLowerCase()],$u+ro[0].length):-1}function fl(Ra,hu,$u){var ro=it.exec(hu.slice($u));return ro?(Ra.m=gt[ro[0].toLowerCase()],$u+ro[0].length):-1}function Gp(Ra,hu,$u){return Pn(Ra,e,hu,$u)}function Wp(Ra,hu,$u){return Pn(Ra,r,hu,$u)}function nl(Ra,hu,$u){return Pn(Ra,n,hu,$u)}function Df(Ra){return y[Ra.getDay()]}function Xm(Ra){return u[Ra.getDay()]}function vd(Ra){return O[Ra.getMonth()]}function I_(Ra){return A[Ra.getMonth()]}function HD(Ra){return a[+(Ra.getHours()>=12)]}function GD(Ra){return 1+~~(Ra.getMonth()/3)}function WD(Ra){return y[Ra.getUTCDay()]}function XD(Ra){return u[Ra.getUTCDay()]}function qD(Ra){return O[Ra.getUTCMonth()]}function YD(Ra){return A[Ra.getUTCMonth()]}function $D(Ra){return a[+(Ra.getUTCHours()>=12)]}function KD(Ra){return 1+~~(Ra.getUTCMonth()/3)}return{format:function(Ra){var hu=cn(Ra+="",Yt);return hu.toString=function(){return Ra},hu},parse:function(Ra){var hu=Gr(Ra+="",!1);return hu.toString=function(){return Ra},hu},utcFormat:function(Ra){var hu=cn(Ra+="",vr);return hu.toString=function(){return Ra},hu},utcParse:function(Ra){var hu=Gr(Ra+="",!0);return hu.toString=function(){return Ra},hu}}}var LE={"-":"",_:" ",0:"0"},Hf=/^\s*\d+/,lT=/^%/,uT=/[\\^$*+?|[\]().{}]/g;function Xu(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",u=a.length;return n+(u68?1900:2e3),r+n[0].length):-1}function gT(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function vT(t,e,r){var n=Hf.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function _T(t,e,r){var n=Hf.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function BE(t,e,r){var n=Hf.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function yT(t,e,r){var n=Hf.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function FE(t,e,r){var n=Hf.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function xT(t,e,r){var n=Hf.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function bT(t,e,r){var n=Hf.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function ET(t,e,r){var n=Hf.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function wT(t,e,r){var n=Hf.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function ST(t,e,r){var n=lT.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function TT(t,e,r){var n=Hf.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function AT(t,e,r){var n=Hf.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function kE(t,e){return Xu(t.getDate(),e,2)}function CT(t,e){return Xu(t.getHours(),e,2)}function MT(t,e){return Xu(t.getHours()%12||12,e,2)}function PT(t,e){return Xu(1+Qb.count(Ta(t),t),e,3)}function NE(t,e){return Xu(t.getMilliseconds(),e,3)}function RT(t,e){return NE(t,e)+"000"}function IT(t,e){return Xu(t.getMonth()+1,e,2)}function LT(t,e){return Xu(t.getMinutes(),e,2)}function DT(t,e){return Xu(t.getSeconds(),e,2)}function OT(t){var e=t.getDay();return e===0?7:e}function BT(t,e){return Xu($s.count(Ta(t)-1,t),e,2)}function zE(t){var e=t.getDay();return e>=4||e===0?tn(t):tn.ceil(t)}function FT(t,e){return t=zE(t),Xu(tn.count(Ta(t),t)+(Ta(t).getDay()===4),e,2)}function kT(t){return t.getDay()}function NT(t,e){return Xu(hr.count(Ta(t)-1,t),e,2)}function zT(t,e){return Xu(t.getFullYear()%100,e,2)}function UT(t,e){return t=zE(t),Xu(t.getFullYear()%100,e,2)}function ZT(t,e){return Xu(t.getFullYear()%1e4,e,4)}function VT(t,e){var r=t.getDay();return t=r>=4||r===0?tn(t):tn.ceil(t),Xu(t.getFullYear()%1e4,e,4)}function jT(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Xu(e/60|0,"0",2)+Xu(e%60,"0",2)}function UE(t,e){return Xu(t.getUTCDate(),e,2)}function HT(t,e){return Xu(t.getUTCHours(),e,2)}function GT(t,e){return Xu(t.getUTCHours()%12||12,e,2)}function WT(t,e){return Xu(1+IE.count(Qv(t),t),e,3)}function ZE(t,e){return Xu(t.getUTCMilliseconds(),e,3)}function XT(t,e){return ZE(t,e)+"000"}function qT(t,e){return Xu(t.getUTCMonth()+1,e,2)}function YT(t,e){return Xu(t.getUTCMinutes(),e,2)}function $T(t,e){return Xu(t.getUTCSeconds(),e,2)}function KT(t){var e=t.getUTCDay();return e===0?7:e}function JT(t,e){return Xu(PE.count(Qv(t)-1,t),e,2)}function VE(t){var e=t.getUTCDay();return e>=4||e===0?R0(t):R0.ceil(t)}function QT(t,e){return t=VE(t),Xu(R0.count(Qv(t),t)+(Qv(t).getUTCDay()===4),e,2)}function eA(t){return t.getUTCDay()}function tA(t,e){return Xu(Jy.count(Qv(t)-1,t),e,2)}function rA(t,e){return Xu(t.getUTCFullYear()%100,e,2)}function nA(t,e){return t=VE(t),Xu(t.getUTCFullYear()%100,e,2)}function iA(t,e){return Xu(t.getUTCFullYear()%1e4,e,4)}function oA(t,e){var r=t.getUTCDay();return t=r>=4||r===0?R0(t):R0.ceil(t),Xu(t.getUTCFullYear()%1e4,e,4)}function aA(){return"+0000"}function jE(){return"%"}function HE(t){return+t}function GE(t){return Math.floor(+t/1e3)}var I0,WE,sA,lA,uA;cA({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function cA(t){return I0=sT(t),WE=I0.format,sA=I0.parse,lA=I0.utcFormat,uA=I0.utcParse,I0}var n_=1e3,i_=n_*60,o_=i_*60,a_=o_*24,hA=a_*7,XE=a_*30,n2=a_*365;function pA(t){return new Date(t)}function fA(t){return t instanceof Date?+t:+new Date(+t)}function qE(t,e,r,n,a,u,y,A,O){var Z=Hy(jf,jf),Y=Z.invert,Q=Z.domain,ae=O(".%L"),xe=O(":%S"),Be=O("%I:%M"),it=O("%I %p"),gt=O("%a %d"),Bt=O("%b %d"),Rt=O("%B"),Yt=O("%Y"),vr=[[y,1,n_],[y,5,5*n_],[y,15,15*n_],[y,30,30*n_],[u,1,i_],[u,5,5*i_],[u,15,15*i_],[u,30,30*i_],[a,1,o_],[a,3,3*o_],[a,6,6*o_],[a,12,12*o_],[n,1,a_],[n,2,2*a_],[r,1,hA],[e,1,XE],[e,3,3*XE],[t,1,n2]];function ln(Gr){return(y(Gr)a?(r=a,a):r,n.unknown=a=>a?(e=a,a):e,n.copy=()=>QE(t).unknown(e),n}const{isNil:i2,isString:xA,uniq:bA}=es,EA=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/,wA={[Qn.LINEAR]:$v,[Qn.POWER]:pi,[Qn.LOG]:U,[Qn.IDENTITY]:QE,[Qn.SEQUENTIAL]:YE,[Qn.TIME]:dA,[Qn.QUANTILE]:so,[Qn.QUANTIZE]:uo,[Qn.THRESHOLD]:ei,[Qn.CAT]:S0,[Qn.DIVERGING]:KE};class SA{constructor(){(0,K.Z)(this,"scaleOptions",{})}apply(e,{styleAttributeService:r}){var n=this;e.hooks.init.tapPromise("FeatureScalePlugin",(0,Nr.Z)(function*(){var a;e.log($t.ScaleInitStart,_n.INIT),n.scaleOptions=e.getScaleOptions();const u=r.getLayerStyleAttributes(),y=(a=e.getSource())===null||a===void 0?void 0:a.data.dataArray;Array.isArray(y)&&y.length===0||(n.caculateScalesForAttributes(u||[],y),e.log($t.ScaleInitEnd,_n.INIT))})),e.hooks.beforeRenderData.tapPromise("FeatureScalePlugin",function(){var a=(0,Nr.Z)(function*(u){if(!u)return u;e.log($t.ScaleInitStart,_n.UPDATE),n.scaleOptions=e.getScaleOptions();const y=r.getLayerStyleAttributes(),A=e.getSource().data.dataArray;return Array.isArray(A)&&A.length===0||(n.caculateScalesForAttributes(y||[],A),e.log($t.ScaleInitEnd,_n.UPDATE),e.layerModelNeedUpdate=!0),!0});return function(u){return a.apply(this,arguments)}}()),e.hooks.beforeRender.tap("FeatureScalePlugin",()=>{if(e.layerModelNeedUpdate)return;this.scaleOptions=e.getScaleOptions();const a=r.getLayerStyleAttributes(),u=e.getSource().data.dataArray;if(!(Array.isArray(u)&&u.length===0)&&a){const y=a.filter(A=>A.needRescale);y.length&&this.caculateScalesForAttributes(y,u)}})}isNumber(e){return!isNaN(parseFloat(e))&&isFinite(e)}caculateScalesForAttributes(e,r){e.forEach(n=>{if(n.scale){const a=n.scale,u=n.scale.field;a.names=this.parseFields(i2(u)?[]:u);const y=[];a.names.forEach(A=>{var O;y.push(this.createScale(A,n.name,(O=n.scale)===null||O===void 0?void 0:O.values,r))}),y.some(A=>A.type===Fi.VARIABLE)?(a.type=Fi.VARIABLE,y.forEach(A=>{if(!a.callback&&a.values!=="text"){var O;switch((O=A.option)===null||O===void 0?void 0:O.type){case Qn.LOG:case Qn.LINEAR:case Qn.POWER:if(a.values&&a.values.length>2){const Y=A.scale.ticks(a.values.length);A.scale.domain(Y)}a.values?A.scale.range(a.values):A.scale.range(A.option.domain);break;case Qn.QUANTILE:case Qn.QUANTIZE:case Qn.THRESHOLD:A.scale.range(a.values);break;case Qn.IDENTITY:break;case Qn.CAT:a.values?A.scale.range(a.values):A.scale.range(A.option.domain);break;case Qn.DIVERGING:case Qn.SEQUENTIAL:A.scale.interpolator(Lb(a.values));break}}if(a.values==="text"){var Z;A.scale.range((Z=A.option)===null||Z===void 0?void 0:Z.domain)}})):(a.type=Fi.CONSTANT,a.defaultValues=y.map((A,O)=>A.scale(a.names[O]))),a.scalers=y.map(A=>({field:A.field,func:A.scale,option:A.option})),n.needRescale=!1}})}parseFields(e){return Array.isArray(e)?e:xA(e)?e.split("*"):[e]}createScale(e,r,n,a){var u,y;const A=this.scaleOptions[r]&&((u=this.scaleOptions[r])===null||u===void 0?void 0:u.field)===e?this.scaleOptions[r]:this.scaleOptions[e],O={field:e,scale:void 0,type:Fi.VARIABLE,option:A};if(!a||!a.length)return A&&A.type?O.scale=this.createDefaultScale(A):(O.scale=S0([e]),O.type=Fi.CONSTANT),O;const Z=(y=a.find(Y=>!i2(Y[e])))===null||y===void 0?void 0:y[e];if(this.isNumber(e)||i2(Z)&&!A)O.scale=S0([e]),O.type=Fi.CONSTANT;else{let Y=A&&A.type||this.getDefaultType(Z);n==="text"&&(Y=Qn.CAT),n===void 0&&(Y=Qn.IDENTITY);const Q=this.createScaleConfig(Y,e,A,a);O.scale=this.createDefaultScale(Q),O.option=Q}return O}getDefaultType(e){let r=Qn.LINEAR;return typeof e=="string"&&(r=EA.test(e)?Qn.TIME:Qn.CAT),r}createScaleConfig(e,r,n,a){const u={type:e};let y=[];if(e===Qn.QUANTILE){const A=new Map;a==null||a.forEach(O=>{A.set(O._id,O[r])}),y=Array.from(A.values())}else y=(a==null?void 0:a.map(A=>A[r]))||[];if(n!=null&&n.domain)u.domain=n==null?void 0:n.domain;else if(e===Qn.CAT||e===Qn.IDENTITY)u.domain=bA(y);else if(e===Qn.QUANTILE)u.domain=y;else if(e===Qn.DIVERGING){const A=My(y),O=(n==null?void 0:n.neutral)!==void 0?n==null?void 0:n.neutral:(A[0]+A[1])/2;u.domain=[A[0],O,A[1]]}else u.domain=My(y);return(0,Wt.Z)((0,Wt.Z)({},u),n)}createDefaultScale({type:e,domain:r,unknown:n,clamp:a,nice:u}){const y=wA[e]();return r&&y.domain&&y.domain(r),n&&y.unknown(n),a!==void 0&&y.clamp&&y.clamp(a),u!==void 0&&y.nice&&y.nice(u),y}}class TA{apply(e){e.hooks.beforeRender.tap("LayerAnimateStylePlugin",()=>{e.animateStatus&&e.models.forEach(n=>{n.addUniforms((0,Wt.Z)({},e.layerModel.getAnimateUniforms()))})})}}class AA{apply(e){e.hooks.afterInit.tap("LayerMaskPlugin",()=>{const{maskLayers:r,enableMask:n}=e.getLayerConfig();!e.tileLayer&&r&&r.length>0&&e.updateLayerConfig({mask:n})})}}class CA{build(e){return(0,Nr.Z)(function*(){e.prepareBuildModel(),yield e.buildModels()})()}initLayerModel(e){var r=this;return(0,Nr.Z)(function*(){yield r.build(e),e.styleNeedUpdate=!1})()}prepareLayerModel(e){var r=this;return(0,Nr.Z)(function*(){yield r.build(e),e.styleNeedUpdate=!1})()}apply(e){var r=this;e.hooks.init.tapPromise("LayerModelPlugin",(0,Nr.Z)(function*(){if(e.getSource().isTile){e.prepareBuildModel();return}e.log($t.BuildModelStart,_n.INIT),yield r.initLayerModel(e),e.log($t.BuildModelEnd,_n.INIT)})),e.hooks.beforeRenderData.tapPromise("LayerModelPlugin",function(){var n=(0,Nr.Z)(function*(a){return!a||e.getSource().isTile?!1:(e.log($t.BuildModelStart,_n.UPDATE),yield r.prepareLayerModel(e),e.log($t.BuildModelEnd,_n.UPDATE),!0)});return function(a){return n.apply(this,arguments)}}())}}class MA{apply(e){e.hooks.afterInit.tap("LayerStylePlugin",()=>{const{autoFit:r,fitBoundsOptions:n}=e.getLayerConfig();r&&e.fitBounds(n),e.styleNeedUpdate=!1})}}const PA=["type"],ew={directional:{lights:"u_DirectionalLights",num:"u_NumOfDirectionalLights"},spot:{lights:"u_SpotLights",num:"u_NumOfSpotLights"}},RA={type:"directional",direction:[1,10.5,12],ambient:[.2,.2,.2],diffuse:[.6,.6,.6],specular:[.1,.1,.1]},IA={direction:[0,0,0],ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0]},LA={position:[0,0,0],direction:[0,0,0],ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],constant:1,linear:0,quadratic:0,angle:14,exponent:40,blur:5};function DA(t){const e={u_DirectionalLights:new Array(3).fill((0,Wt.Z)({},IA)),u_NumOfDirectionalLights:0,u_SpotLights:new Array(3).fill((0,Wt.Z)({},LA)),u_NumOfSpotLights:0};return(!t||!t.length)&&(t=[RA]),t.forEach(r=>{let{type:n="directional"}=r,a=(0,Ge.Z)(r,PA);const u=ew[n].lights,y=ew[n].num,A=e[y];e[u][A]=(0,Wt.Z)((0,Wt.Z)({},e[u][A]),a),e[y]++}),e}class OA{apply(e){e.hooks.beforeRender.tap("LightingPlugin",()=>{const{enableLighting:r}=e.getLayerConfig();r&&e.models.forEach(n=>n.addUniforms((0,Wt.Z)({},DA())))})}}function tw(t){return t.map(e=>(typeof e=="string"&&(e=[e,{}]),e))}function rw(t,e,r,n){const a=t.multiPassRenderer,{enableTAA:u}=t.getLayerConfig();return u?a.add(n("taa")):a.add(n("render")),tw(e).forEach(y=>{const[A,O]=y;a.add(r(A),O)}),a.add(r("copy")),a}class BA{constructor(){(0,K.Z)(this,"enabled",void 0)}apply(e,{rendererService:r,postProcessingPassFactory:n,normalPassFactory:a}){e.hooks.init.tapPromise("MultiPassRendererPlugin",()=>{const{enableMultiPassRenderer:u,passes:y=[]}=e.getLayerConfig();this.enabled=!!u&&e.getLayerConfig().enableMultiPassRenderer!==!1,this.enabled&&(e.multiPassRenderer=rw(e,y,n,a),e.multiPassRenderer.setRenderFlag(!0))}),e.hooks.beforeRender.tap("MultiPassRendererPlugin",()=>{if(this.enabled){const{width:u,height:y}=r.getViewportSize();e.multiPassRenderer.resize(u,y)}})}}let Ro=function(t){return t[t.POSITION=0]="POSITION",t[t.COLOR=1]="COLOR",t[t.VERTEX_ID=2]="VERTEX_ID",t[t.PICKING_COLOR=3]="PICKING_COLOR",t[t.STROKE=4]="STROKE",t[t.OPACITY=5]="OPACITY",t[t.OFFSETS=6]="OFFSETS",t[t.ROTATION=7]="ROTATION",t[t.EXTRUSION_BASE=8]="EXTRUSION_BASE",t[t.SIZE=9]="SIZE",t[t.SHAPE=10]="SHAPE",t[t.EXTRUDE=11]="EXTRUDE",t[t.MAX=12]="MAX",t[t.NORMAL=13]="NORMAL",t[t.UV=14]="UV",t[t.LINEAR=15]="LINEAR",t}({});function FA(t){switch(t){case"rotation":return{name:"Rotation",type:Vr.Attribute,descriptor:{name:"a_Rotation",shaderLocation:Ro.ROTATION,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{rotation:r=0}=e;return Array.isArray(r)?[r[0]]:[r]}}};case"stroke":return{name:"stroke",type:Vr.Attribute,descriptor:{name:"a_Stroke",shaderLocation:Ro.STROKE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:4,update:e=>{const{stroke:r=[1,1,1,1]}=e;return r}}};case"opacity":return{name:"opacity",type:Vr.Attribute,descriptor:{name:"a_Opacity",shaderLocation:Ro.OPACITY,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{opacity:r=1}=e;return[r]}}};case"extrusionBase":return{name:"extrusionBase",type:Vr.Attribute,descriptor:{name:"a_ExtrusionBase",shaderLocation:Ro.EXTRUSION_BASE,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{extrusionBase:r=0}=e;return[r]}}};case"offsets":return{name:"offsets",type:Vr.Attribute,descriptor:{name:"a_Offsets",shaderLocation:Ro.OFFSETS,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const{offsets:r}=e;return r}}};case"thetaOffset":return{name:"thetaOffset",type:Vr.Attribute,descriptor:{name:"a_ThetaOffset",shaderLocation:15,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{thetaOffset:r=1}=e;return[r]}}};default:return}}const{isNumber:kA}=es,L0={NONE:0,ENCODE:1,HIGHLIGHT:2};class NA{constructor(){(0,K.Z)(this,"pickingUniformMap",void 0)}pickOption2Array(){const e=[];return this.pickingUniformMap.forEach(r=>{kA(r)?e.push(r):e.push(...r)}),e}updatePickOption(e,r){Object.keys(e).forEach(y=>{this.pickingUniformMap.set(y,e[y])});const n=r.getLayerConfig().pickingBuffer||0,a=Number(r.getShaderPickStat());this.pickingUniformMap.set("u_PickingBuffer",n),this.pickingUniformMap.set("u_shaderPick",a),r.getPickingUniformBuffer().subData({offset:0,data:this.pickOption2Array()})}apply(e,{styleAttributeService:r}){this.pickingUniformMap=new Map([["u_HighlightColor",[1,0,0,1]],["u_SelectColor",[1,0,0,1]],["u_PickingColor",[0,0,0]],["u_PickingStage",0],["u_CurrentSelectedId",[0,0,0]],["u_PickingThreshold",10],["u_PickingBuffer",0],["u_shaderPick",0],["u_activeMix",0]]),e.hooks.init.tapPromise("PixelPickingPlugin",()=>{const{enablePicking:n}=e.getLayerConfig();r.registerStyleAttribute({name:"pickingColor",type:Vr.Attribute,descriptor:{name:"a_PickingColor",shaderLocation:Ro.PICKING_COLOR,buffer:{data:[],type:Ee.FLOAT},size:3,update:a=>{const{id:u}=a;return n?Ni(u):[0,0,0]}}})}),e.hooks.beforePickingEncode.tap("PixelPickingPlugin",()=>{const{enablePicking:n}=e.getLayerConfig();n&&e.isVisible()&&(this.updatePickOption({u_PickingStage:L0.ENCODE},e),e.models.forEach(a=>a.addUniforms({u_PickingStage:L0.ENCODE})))}),e.hooks.afterPickingEncode.tap("PixelPickingPlugin",()=>{const{enablePicking:n}=e.getLayerConfig();n&&e.isVisible()&&(this.updatePickOption({u_PickingStage:L0.HIGHLIGHT},e),e.models.forEach(a=>a.addUniforms({u_PickingStage:L0.HIGHLIGHT})))}),e.hooks.beforeHighlight.tap("PixelPickingPlugin",n=>{const{highlightColor:a,activeMix:u=0}=e.getLayerConfig(),y=typeof a=="string"?Va(a):a||[1,0,0,1];e.updateLayerConfig({pickedFeatureID:Aa(new Uint8Array(n))});const A={u_PickingStage:L0.HIGHLIGHT,u_PickingColor:n,u_HighlightColor:y.map(O=>O*255),u_activeMix:u};this.updatePickOption(A,e),e.models.forEach(O=>O.addUniforms(A))}),e.hooks.beforeSelect.tap("PixelPickingPlugin",n=>{const{selectColor:a,selectMix:u=0}=e.getLayerConfig(),y=typeof a=="string"?Va(a):a||[1,0,0,1];e.updateLayerConfig({pickedFeatureID:Aa(new Uint8Array(n))});const A={u_PickingStage:L0.HIGHLIGHT,u_PickingColor:n,u_HighlightColor:y.map(O=>O*255),u_activeMix:u,u_CurrentSelectedId:n,u_SelectColor:y.map(O=>O*255)};this.updatePickOption(A,e),e.models.forEach(O=>O.addUniforms(A))})}}const zA=["mvt","geojsonvt","testTile"];function UA(t){const e=t.getSource();return zA.includes(e.parser.type)}class ZA{apply(e,{styleAttributeService:r}){e.hooks.init.tapPromise("RegisterStyleAttributePlugin",()=>{UA(e)||this.registerBuiltinAttributes(r,e)})}registerBuiltinAttributes(e,r){if(r.type==="MaskLayer"){this.registerPositionAttribute(e);return}this.registerPositionAttribute(e),this.registerColorAttribute(e),this.registerVertexIdAttribute(e)}registerPositionAttribute(e){e.registerStyleAttribute({name:"position",type:Vr.Attribute,descriptor:{name:"a_Position",shaderLocation:Ro.POSITION,buffer:{data:[],type:Ee.FLOAT},size:3,update:(r,n,a)=>a.length===2?[a[0],a[1],0]:[a[0],a[1],a[2]]}})}registerColorAttribute(e){e.registerStyleAttribute({name:"color",type:Vr.Attribute,descriptor:{name:"a_Color",shaderLocation:Ro.COLOR,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:4,update:r=>{const{color:n}=r;return!n||!n.length?[1,1,1,1]:n}}})}registerVertexIdAttribute(e){e.registerStyleAttribute({name:"vertexId",type:Vr.Attribute,descriptor:{name:"a_vertexId",shaderLocation:Ro.VERTEX_ID,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:(r,n)=>[n]}})}}class VA{constructor(){(0,K.Z)(this,"cameraService",void 0),(0,K.Z)(this,"coordinateSystemService",void 0),(0,K.Z)(this,"rendererService",void 0),(0,K.Z)(this,"mapService",void 0),(0,K.Z)(this,"layerService",void 0)}apply(e,{rendererService:r,mapService:n,layerService:a,coordinateSystemService:u,cameraService:y}){this.rendererService=r,this.mapService=n,this.layerService=a,this.coordinateSystemService=u,this.cameraService=y;const A=this.mapService.version;let O=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],Z=[0,0],Y;this.rendererService.uniformBuffers[0]||(Y=this.rendererService.createBuffer({data:new Float32Array(16*4+4*7),isUBO:!0}),this.rendererService.uniformBuffers[0]=Y),e.hooks.beforeRender.tap("ShaderUniformPlugin",()=>{const Q=e.getLayerConfig().tileOrigin;this.coordinateSystemService.refresh(Q),A==="GAODE2.x"&&(this.setLayerCenter(e),O=this.mapService.map.customCoords.getMVPMatrix(),Z=this.mapService.getCustomCoordCenter(),e.getLayerUniformBuffer().subData({offset:0,data:new Uint8Array(new Float32Array([...O,...Z]).buffer)}));const{width:ae,height:xe}=this.rendererService.getViewportSize(),{data:Be,uniforms:it}=this.generateUBO(O,Z,ae,xe);this.layerService.alreadyInRendering&&this.rendererService.uniformBuffers[0]&&this.rendererService.uniformBuffers[0].subData({offset:0,data:Be}),this.rendererService.queryVerdorInfo()==="WebGL1"&&e.models.forEach(Bt=>{Bt.addUniforms((0,Wt.Z)((0,Wt.Z)({},it),{},{u_PickingBuffer:e.getLayerConfig().pickingBuffer||0,u_shaderPick:Number(e.getShaderPickStat())}))})})}setLayerCenter(e){e.coordCenter===void 0&&(e.coordCenter=e.getSource().center),this.mapService.setCoordCenter&&this.mapService.setCoordCenter(e.coordCenter)}generateUBO(e,r,n,a){const u=this.cameraService.getProjectionMatrix(),y=this.cameraService.getViewMatrix(),A=this.cameraService.getViewProjectionMatrix(),O=this.cameraService.getModelMatrix(),Z=this.coordinateSystemService.getViewportCenterProjection(),Y=this.coordinateSystemService.getPixelsPerDegree(),Q=this.cameraService.getZoom(),ae=this.coordinateSystemService.getPixelsPerDegree2(),xe=this.cameraService.getZoomScale(),Be=this.coordinateSystemService.getPixelsPerMeter(),it=this.coordinateSystemService.getCoordinateSystem(),gt=this.cameraService.getCameraPosition(),Bt=window.devicePixelRatio,Rt=this.coordinateSystemService.getViewportCenter(),Yt=[n,a],vr=this.cameraService.getFocalDistance();return{data:[...y,...u,...A,...O,...Z,...Y,Q,...ae,xe,...Be,it,...gt,Bt,...Rt,...Yt,vr,0,0,0],uniforms:{[lr.ProjectionMatrix]:u,[lr.ViewMatrix]:y,[lr.ViewProjectionMatrix]:A,[lr.Zoom]:Q,[lr.ZoomScale]:xe,[lr.FocalDistance]:vr,[lr.CameraPosition]:gt,[pt.CoordinateSystem]:it,[pt.ViewportCenter]:Rt,[pt.ViewportCenterProjection]:Z,[pt.PixelsPerDegree]:Y,[pt.PixelsPerDegree2]:ae,[pt.PixelsPerMeter]:Be,[pt.Mvp]:e,u_sceneCenterMercator:r,u_ViewportSize:Yt,u_ModelMatrix:O,u_DevicePixelRatio:Bt}}}}class jA{apply(e){e.hooks.beforeRender.tap("UpdateModelPlugin",()=>{e.layerModel&&e.layerModel.needUpdate().then(r=>{r&&e.renderLayers()})}),e.hooks.afterRender.tap("UpdateModelPlugin",()=>{e.layerModelNeedUpdate=!1})}}class HA{apply(e,{styleAttributeService:r}){e.hooks.init.tapPromise("UpdateStyleAttributePlugin",()=>{this.initStyleAttribute(e,{styleAttributeService:r})}),e.hooks.beforeRender.tap("UpdateStyleAttributePlugin",()=>{e.layerModelNeedUpdate||e.inited&&this.updateStyleAttribute(e,{styleAttributeService:r})})}updateStyleAttribute(e,{styleAttributeService:r}){const n=r.getLayerStyleAttributes()||[],a=r.getLayerStyleAttribute("filter");if(a&&a.needRegenerateVertices){e.layerModelNeedUpdate=!0,n.forEach(u=>u.needRegenerateVertices=!1);return}n.filter(u=>u.needRegenerateVertices).forEach(u=>{r.updateAttributeByFeatureRange(u.name,e.getEncodedData(),u.featureRange.startIndex,u.featureRange.endIndex,e),u.needRegenerateVertices=!1})}initStyleAttribute(e,{styleAttributeService:r}){(r.getLayerStyleAttributes()||[]).filter(a=>a.needRegenerateVertices).forEach(a=>{r.updateAttributeByFeatureRange(a.name,e.getEncodedData(),a.featureRange.startIndex,a.featureRange.endIndex),a.needRegenerateVertices=!1})}}function GA(){return[new Tb,new ZA,new SA,new Sb,new MA,new AA,new HA,new jA,new BA,new VA,new TA,new OA,new NA,new CA]}const nw={[$r.additive]:{enable:!0,func:{srcRGB:Ee.ONE,dstRGB:Ee.ONE,srcAlpha:1,dstAlpha:1}},[$r.none]:{enable:!1},[$r.normal]:{enable:!0,func:{srcRGB:Ee.SRC_ALPHA,dstRGB:Ee.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}},[$r.subtractive]:{enable:!0,func:{srcRGB:Ee.ONE,dstRGB:Ee.ONE,srcAlpha:Ee.ZERO,dstAlpha:Ee.ONE_MINUS_SRC_COLOR},equation:{rgb:Ee.FUNC_SUBTRACT,alpha:Ee.FUNC_SUBTRACT}},[$r.max]:{enable:!0,func:{srcRGB:Ee.ONE,dstRGB:Ee.ONE},equation:{rgb:Ee.MAX_EXT}},[$r.min]:{enable:!0,func:{srcRGB:Ee.ONE,dstRGB:Ee.ONE},equation:{rgb:Ee.MIN_EXT}}};class WA{constructor(e){(0,K.Z)(this,"layer",void 0),this.layer=e}pickRender(e){const n=this.layer.getContainer().layerService,a=this.layer;if(a.tileLayer)return a.tileLayer.pickRender(e);a.hooks.beforePickingEncode.call(),n.renderTileLayerMask(a),a.renderModels({ispick:!0}),a.hooks.afterPickingEncode.call()}pick(e,r){var n=this;return(0,Nr.Z)(function*(){const u=n.layer.getContainer().pickingService;return e.type==="RasterLayer"?n.pickRasterLayer(e,r):(n.pickRender(r),u.pickFromPickingFBO(e,r))})()}pickRasterLayer(e,r,n){const a=this.layer.getContainer(),u=a.pickingService,y=a.mapService,A=this.layer.getSource().extent,O=rc(r.lngLat,A),Z={x:r.x,y:r.y,type:r.type,lngLat:r.lngLat,target:r,rasterValue:null},Y=n||e;if(O){const Q=this.readRasterValue(e,A,y,r.x,r.y);return Z.rasterValue=Q,u.triggerHoverOnLayer(Y,Z),!0}else return Z.type=r.type==="mousemove"?"mouseout":"un"+r.type,u.triggerHoverOnLayer(Y,(0,Wt.Z)((0,Wt.Z)({},Z),{},{type:"unpick"})),u.triggerHoverOnLayer(Y,Z),!1}readRasterValue(e,r,n,a,u){const y=e.getSource().data.dataArray[0],[A=0,O=0,Z=10,Y=-10]=r,Q=n.lngLatToContainer([A,O]),ae=n.lngLatToContainer([Z,Y]),xe=ae.x-Q.x,Be=Q.y-ae.y,it=[(a-Q.x)/xe,(u-ae.y)/Be],gt=y.width||1,Bt=y.height||1,Rt=Math.floor(it[0]*gt),Yt=Math.floor(it[1]*Bt),vr=Math.max(0,Yt-1)*gt+Rt;return y.data[vr]}selectFeature(e){const r=this.layer,[n,a,u]=e;r.hooks.beforeSelect.call([n,a,u])}highlightPickedFeature(e){const[r,n,a]=e;this.layer.hooks.beforeHighlight.call([r,n,a])}getFeatureById(e){return this.layer.getSource().getFeatureById(e)}}class XA{constructor(e){(0,K.Z)(this,"layer",void 0),(0,K.Z)(this,"rendererService",void 0),(0,K.Z)(this,"colorTexture",void 0),(0,K.Z)(this,"key",void 0),this.layer=e;const r=this.layer.getContainer();this.rendererService=r.rendererService}getColorTexture(e,r){const n=this.getTextureKey(e,r);return this.key===n?this.colorTexture:(this.createColorTexture(e,r),this.key=n,this.colorTexture)}createColorTexture(e,r){const{createTexture2D:n}=this.rendererService,a=this.getColorRampBar(e,r),u=n({data:new Uint8Array(a.data),width:a.width,height:a.height,flipY:!1,unorm:!0});return this.colorTexture=u,u}setColorTexture(e,r,n){this.key=this.getTextureKey(r,n),this.colorTexture=e}destroy(){var e;(e=this.colorTexture)===null||e===void 0||e.destroy()}getColorRampBar(e,r){switch(e.type){case"cat":return lo(e);case"quantize":return bs(e);case"custom":return Os(e,r);case"linear":return Ku(e,r);default:return lc(e)}}getTextureKey(e,r){var n;return`${e.colors.join("_")}_${e==null||(n=e.positions)===null||n===void 0?void 0:n.join("_")}_${e.type}_${r==null?void 0:r.join("_")}`}}const qA=["passes"],YA=["moduleName","vertexShader","fragmentShader","inject","triangulation","styleOption","pickingEnabled"],{isEqual:o2,isFunction:iw,isNumber:ow,isObject:id,isPlainObject:$A,isUndefined:KA}=es;let aw=0;class Yd extends Yl.EventEmitter{get shaderModuleService(){return this.container.shaderModuleService}get cameraService(){return this.container.cameraService}get coordinateService(){return this.container.coordinateSystemService}get iconService(){return this.container.iconService}get fontService(){return this.container.fontService}get pickingService(){return this.container.pickingService}get rendererService(){return this.container.rendererService}get layerService(){return this.container.layerService}get debugService(){return this.container.debugService}get interactionService(){return this.container.interactionService}get mapService(){return this.container.mapService}get normalPassFactory(){return this.container.normalPassFactory}constructor(e={}){super(),(0,K.Z)(this,"id",`${aw++}`),(0,K.Z)(this,"name",`${aw}`),(0,K.Z)(this,"parent",void 0),(0,K.Z)(this,"coordCenter",void 0),(0,K.Z)(this,"type",void 0),(0,K.Z)(this,"visible",!0),(0,K.Z)(this,"zIndex",0),(0,K.Z)(this,"minZoom",void 0),(0,K.Z)(this,"maxZoom",void 0),(0,K.Z)(this,"inited",!1),(0,K.Z)(this,"layerModelNeedUpdate",!1),(0,K.Z)(this,"pickedFeatureID",null),(0,K.Z)(this,"selectedFeatureID",null),(0,K.Z)(this,"styleNeedUpdate",!1),(0,K.Z)(this,"rendering",void 0),(0,K.Z)(this,"forceRender",!1),(0,K.Z)(this,"clusterZoom",0),(0,K.Z)(this,"layerType",void 0),(0,K.Z)(this,"triangulation",void 0),(0,K.Z)(this,"layerPickService",void 0),(0,K.Z)(this,"textureService",void 0),(0,K.Z)(this,"defaultSourceConfig",{data:[],options:{parser:{type:"json"}}}),(0,K.Z)(this,"dataState",{dataSourceNeedUpdate:!1,dataMappingNeedUpdate:!1,filterNeedUpdate:!1,featureScaleNeedUpdate:!1,StyleAttrNeedUpdate:!1}),(0,K.Z)(this,"hooks",{init:new Ye,afterInit:new Me,beforeRender:new Me,beforeRenderData:new ot,afterRender:new f,beforePickingEncode:new f,afterPickingEncode:new f,beforeHighlight:new f(["pickedColor"]),afterHighlight:new f,beforeSelect:new f(["pickedColor"]),afterSelect:new f,beforeDestroy:new f,afterDestroy:new f}),(0,K.Z)(this,"models",[]),(0,K.Z)(this,"multiPassRenderer",void 0),(0,K.Z)(this,"plugins",void 0),(0,K.Z)(this,"startInit",!1),(0,K.Z)(this,"sourceOption",void 0),(0,K.Z)(this,"layerModel",void 0),(0,K.Z)(this,"shapeOption",void 0),(0,K.Z)(this,"tileLayer",void 0),(0,K.Z)(this,"layerChildren",[]),(0,K.Z)(this,"masks",[]),(0,K.Z)(this,"configService",$m),(0,K.Z)(this,"styleAttributeService",void 0),(0,K.Z)(this,"layerSource",void 0),(0,K.Z)(this,"postProcessingPassFactory",void 0),(0,K.Z)(this,"animateOptions",{enable:!1}),(0,K.Z)(this,"container",void 0),(0,K.Z)(this,"encodedData",void 0),(0,K.Z)(this,"currentPickId",null),(0,K.Z)(this,"rawConfig",void 0),(0,K.Z)(this,"needUpdateConfig",void 0),(0,K.Z)(this,"encodeStyleAttribute",{}),(0,K.Z)(this,"enableShaderEncodeStyles",[]),(0,K.Z)(this,"enableDataEncodeStyles",[]),(0,K.Z)(this,"pendingStyleAttributes",[]),(0,K.Z)(this,"scaleOptions",{}),(0,K.Z)(this,"animateStartTime",void 0),(0,K.Z)(this,"animateStatus",!1),(0,K.Z)(this,"isDestroyed",!1),(0,K.Z)(this,"uniformBuffers",[]),(0,K.Z)(this,"encodeDataLength",0),(0,K.Z)(this,"sourceEvent",()=>{this.dataState.dataSourceNeedUpdate=!0;const r=this.getLayerConfig();r&&r.autoFit&&this.fitBounds(r.fitBoundsOptions),this.layerSource.getSourceCfg().autoRender&&setTimeout(()=>{this.reRender()},10)}),this.name=e.name||this.id,this.zIndex=e.zIndex||0,this.rawConfig=e,this.masks=e.maskLayers||[]}addMask(e){this.masks.push(e),this.updateLayerConfig({maskLayers:this.masks}),this.enableMask()}removeMask(e){const r=this.masks.indexOf(e);r>-1&&this.masks.splice(r,1),this.updateLayerConfig({maskLayers:this.masks})}disableMask(){this.updateLayerConfig({enableMask:!1})}enableMask(){this.updateLayerConfig({enableMask:!0})}addMaskLayer(e){this.masks.push(e)}removeMaskLayer(e){const r=this.masks.indexOf(e);r>-1&&this.masks.splice(r,1),e.destroy()}getAttribute(e){return this.styleAttributeService.getLayerStyleAttribute(e)}getLayerConfig(){return this.configService.getLayerConfig(this.id)}updateLayerConfig(e){if(Object.keys(e).map(r=>{r in this.rawConfig&&(this.rawConfig[r]=e[r])}),!this.startInit)this.needUpdateConfig=(0,Wt.Z)((0,Wt.Z)({},this.needUpdateConfig),e);else{const r=this.container.id;this.configService.setLayerConfig(r,this.id,(0,Wt.Z)((0,Wt.Z)((0,Wt.Z)({},this.configService.getLayerConfig(this.id)),this.needUpdateConfig),e)),this.needUpdateConfig={}}}setContainer(e){this.container=e}getContainer(){return this.container}addPlugin(e){return this.plugins.push(e),this}init(){var e=this;return(0,Nr.Z)(function*(){const r=e.container.id;e.startInit=!0,e.configService.setLayerConfig(r,e.id,e.rawConfig),e.layerType=e.rawConfig.layerType;const{enableMultiPassRenderer:n,passes:a}=e.getLayerConfig();n&&a!==null&&a!==void 0&&a.length&&a.length>0&&e.mapService.on("mapAfterFrameChange",()=>{e.renderLayers()}),e.postProcessingPassFactory=e.container.postProcessingPassFactory,e.styleAttributeService=e.container.styleAttributeService,n&&(e.multiPassRenderer=e.container.multiPassRenderer,e.multiPassRenderer.setLayer(e)),e.pendingStyleAttributes.forEach(({attributeName:u,attributeField:y,attributeValues:A,updateOptions:O})=>{e.styleAttributeService.updateStyleAttribute(u,{scale:(0,Wt.Z)({field:y},e.splitValuesAndCallbackInAttribute(A,y?void 0:e.getLayerConfig()[u]))},O)}),e.pendingStyleAttributes=[],e.plugins=GA();for(const u of e.plugins)u.apply(e,e.container);e.layerPickService=new WA(e),e.textureService=new XA(e),e.log($t.LayerInitStart),yield e.hooks.init.promise(),e.log($t.LayerInitEnd),e.inited=!0,e.emit("inited",{target:e,type:"inited"}),e.emit("add",{target:e,type:"add"}),e.hooks.afterInit.call()})()}log(e,r="init"){var n;if(this.tileLayer||this.isTileLayer)return;const a=`${this.id}.${r}.${e}`,u={id:this.id,type:this.type};(n=this.debugService)===null||n===void 0||n.log(a,u)}updateModelData(e){e.attributes&&e.elements?this.models.map(r=>{r.updateAttributesAndElements(e.attributes,e.elements)}):console.warn("data error")}setLayerPickService(e){this.layerPickService=e}prepareBuildModel(){Object.keys(this.needUpdateConfig||{}).length!==0&&this.updateLayerConfig({});const{animateOption:e}=this.getLayerConfig();e!=null&&e.enable&&(this.layerService.startAnimate(),this.animateStatus=!0)}color(e,r,n){return this.updateStyleAttribute("color",e,r,n),this}texture(e,r,n){return this.updateStyleAttribute("texture",e,r,n),this}rotate(e,r,n){return this.updateStyleAttribute("rotate",e,r,n),this}size(e,r,n){return this.updateStyleAttribute("size",e,r,n),this}filter(e,r,n){const a=this.updateStyleAttribute("filter",e,r,n);return this.dataState.dataSourceNeedUpdate=a&&this.inited,this}shape(e,r,n){this.shapeOption={field:e,values:r};const a=this.updateStyleAttribute("shape",e,r,n);return this.dataState.dataSourceNeedUpdate=a&&this.inited,this}label(e,r,n){return this.pendingStyleAttributes.push({attributeName:"label",attributeField:e,attributeValues:r,updateOptions:n}),this}animate(e){let r={};return id(e)?(r.enable=!0,r=(0,Wt.Z)((0,Wt.Z)({},r),e)):r.enable=e,this.updateLayerConfig({animateOption:r}),this}source(e,r){return(e==null?void 0:e.type)==="source"?(this.setSource(e),this):(this.sourceOption={data:e,options:r},this.clusterZoom=0,this)}setData(e,r){return this.inited?(this.dataUpdatelog(),this.layerSource.setData(e,r)):this.on("inited",()=>{this.dataUpdatelog(),this.layerSource.setData(e,r)}),this}dataUpdatelog(){this.log($t.SourceInitStart,_n.UPDATE),this.layerSource.once("update",()=>{this.log($t.SourceInitEnd,_n.UPDATE)})}style(e){const{passes:r}=e,n=(0,Ge.Z)(e,qA);r&&tw(r).forEach(u=>{const y=this.multiPassRenderer.getPostProcessor().getPostProcessingPassByName(u[0]);y&&y.updateOptions(u[1])}),n.borderColor&&(n.stroke=n.borderColor),n.borderWidth&&(n.strokeWidth=n.borderWidth);const a=n;return Object.keys(n).forEach(u=>{const y=n[u];Array.isArray(y)&&y.length===2&&!ow(y[0])&&!ow(y[1])&&(a[u]={field:y[0],value:y[1]})}),this.encodeStyle(a),this.updateLayerConfig(a),this}encodeStyle(e){Object.keys(e).forEach(r=>{[...this.enableShaderEncodeStyles,...this.enableDataEncodeStyles].includes(r)&&$A(e[r])&&(e[r].field||e[r].value)&&!o2(this.encodeStyleAttribute[r],e[r])?(this.encodeStyleAttribute[r]=e[r],this.updateStyleAttribute(r,e[r].field,e[r].value),this.inited&&(this.dataState.dataMappingNeedUpdate=!0)):this.encodeStyleAttribute[r]&&(delete this.encodeStyleAttribute[r],this.dataState.dataSourceNeedUpdate=!0)})}scale(e,r){const n=(0,Wt.Z)({},this.scaleOptions);if(id(e)?this.scaleOptions=(0,Wt.Z)((0,Wt.Z)({},this.scaleOptions),e):this.scaleOptions[e]=r,this.styleAttributeService&&!o2(n,this.scaleOptions)){const a=id(e)?e:{[e]:r};this.styleAttributeService.updateScaleAttribute(a)}return this}renderLayers(){this.rendering=!0,this.layerService.reRender(),this.rendering=!1}prerender(){}render(e={}){return this.tileLayer?(this.tileLayer.render(),this):(this.layerService.beforeRenderData(this),this.encodeDataLength<=0&&!this.forceRender?this:(this.renderModels(e),this))}renderMultiPass(){var e=this;return(0,Nr.Z)(function*(){e.encodeDataLength<=0&&!e.forceRender||(e.multiPassRenderer&&e.multiPassRenderer.getRenderFlag()?yield e.multiPassRenderer.render():(e.multiPassRenderer,e.renderModels()))})()}active(e){const r={};return r.enableHighlight=id(e)?!0:e,id(e)?(r.enableHighlight=!0,e.color&&(r.highlightColor=e.color),e.mix&&(r.activeMix=e.mix)):r.enableHighlight=!!e,this.updateLayerConfig(r),this}setActive(e,r){if(id(e)){const{x:n=0,y:a=0}=e;this.updateLayerConfig({highlightColor:id(r)?r.color:this.getLayerConfig().highlightColor,activeMix:id(r)?r.mix:this.getLayerConfig().activeMix}),this.pick({x:n,y:a})}else this.updateLayerConfig({pickedFeatureID:e,highlightColor:id(r)?r.color:this.getLayerConfig().highlightColor,activeMix:id(r)?r.mix:this.getLayerConfig().activeMix}),this.hooks.beforeHighlight.call(Ni(e)).then(()=>{setTimeout(()=>{this.reRender()},1)})}select(e){const r={};return r.enableSelect=id(e)?!0:e,id(e)?(r.enableSelect=!0,e.color&&(r.selectColor=e.color),e.mix&&(r.selectMix=e.mix)):r.enableSelect=!!e,this.updateLayerConfig(r),this}setSelect(e,r){if(id(e)){const{x:n=0,y:a=0}=e;this.updateLayerConfig({selectColor:id(r)?r.color:this.getLayerConfig().selectColor,selectMix:id(r)?r.mix:this.getLayerConfig().selectMix}),this.pick({x:n,y:a})}else this.updateLayerConfig({pickedFeatureID:e,selectColor:id(r)?r.color:this.getLayerConfig().selectColor,selectMix:id(r)?r.mix:this.getLayerConfig().selectMix}),this.hooks.beforeSelect.call(Ni(e)).then(()=>{setTimeout(()=>{this.reRender()},1)})}setBlend(e){return this.updateLayerConfig({blend:e}),this.reRender(),this}show(){return this.updateLayerConfig({visible:!0}),this.reRender(),this.emit("show"),this}hide(){return this.updateLayerConfig({visible:!1}),this.reRender(),this.emit("hide"),this}setIndex(e){return this.zIndex=e,this.layerService.updateLayerRenderList(),this.layerService.renderLayers(),this}setCurrentPickId(e){this.currentPickId=e}getCurrentPickId(){return this.currentPickId}setCurrentSelectedId(e){this.selectedFeatureID=e}getCurrentSelectedId(){return this.selectedFeatureID}isVisible(){const e=this.mapService.getZoom(),{visible:r,minZoom:n=-1/0,maxZoom:a=1/0}=this.getLayerConfig();return!!r&&e>=n&&eMath.abs(u)===1/0)?this:(this.mapService.fitBounds([[n[0],n[1]],[n[2],n[3]]],e),this)}destroy(e=!0){var r,n,a,u,y;if(this.isDestroyed)return;(r=this.layerModel)===null||r===void 0||r.uniformBuffers.forEach(O=>{O.destroy()}),this.layerChildren.map(O=>O.destroy(!1)),this.layerChildren=[];const{maskfence:A}=this.getLayerConfig();A&&(this.masks.map(O=>O.destroy(!1)),this.masks=[]),this.hooks.beforeDestroy.call(),this.layerSource.off("update",this.sourceEvent),(n=this.multiPassRenderer)===null||n===void 0||n.destroy(),this.textureService.destroy(),this.styleAttributeService.clearAllAttributes(),this.hooks.afterDestroy.call(),(a=this.layerModel)===null||a===void 0||a.clearModels(e),(u=this.tileLayer)===null||u===void 0||u.destroy(),this.models=[],(y=this.debugService)===null||y===void 0||y.removeLog(this.id),this.emit("remove",{target:this,type:"remove"}),this.emit("destroy",{target:this,type:"destroy"}),this.removeAllListeners(),this.isDestroyed=!0}clear(){this.styleAttributeService.clearAllAttributes()}clearModels(){var e;this.models.forEach(r=>r.destroy()),(e=this.layerModel)===null||e===void 0||e.clearModels(),this.models=[]}isDirty(){return!!(this.styleAttributeService.getLayerStyleAttributes()||[]).filter(e=>e.needRescale||e.needRemapping||e.needRegenerateVertices).length}setSource(e){if(this.layerSource&&this.layerSource.off("update",this.sourceEvent),this.layerSource=e,this.clusterZoom=0,this.inited&&this.layerSource.cluster){const r=this.mapService.getZoom();this.layerSource.updateClusterData(r)}this.layerSource.inited&&this.sourceEvent(),this.layerSource.on("update",({type:r})=>{if(this.coordCenter===void 0){var n;const a=this.layerSource.center;this.coordCenter=a,(n=this.mapService)!==null&&n!==void 0&&n.setCoordCenter&&this.mapService.setCoordCenter(a)}if(r==="update"){if(this.tileLayer){this.tileLayer.reload();return}this.sourceEvent()}})}getSource(){return this.layerSource}getScaleOptions(){return this.scaleOptions}setEncodedData(e){this.encodedData=e,this.encodeDataLength=e.length}getEncodedData(){return this.encodedData}getScale(e){return this.styleAttributeService.getLayerAttributeScale(e)}getLegend(e){var r,n,a;const u=this.styleAttributeService.getLayerStyleAttribute(e);return{type:(n=((u==null||(r=u.scale)===null||r===void 0?void 0:r.scalers)||[])[0])===null||n===void 0||(n=n.option)===null||n===void 0?void 0:n.type,field:u==null||(a=u.scale)===null||a===void 0?void 0:a.field,items:this.getLegendItems(e)}}getLegendItems(e){const r=this.styleAttributeService.getLayerAttributeScale(e);return r?r.invertExtent?r.range().map(a=>({value:r.invertExtent(a),[e]:a})):r.ticks?r.ticks().map(a=>({value:a,[e]:r(a)})):r!=null&&r.domain?r.domain().filter(a=>!KA(a)).map(a=>({value:a,[e]:r(a)})):[]:[]}pick({x:e,y:r}){this.interactionService.triggerHover({x:e,y:r})}boxSelect(e,r){this.pickingService.boxPickLayer(this,e,r)}buildLayerModel(e){var r=this;return(0,Nr.Z)(function*(){const{moduleName:n,vertexShader:a,fragmentShader:u,inject:y,triangulation:A,styleOption:O,pickingEnabled:Z=!0}=e,Y=(0,Ge.Z)(e,YA);r.shaderModuleService.registerModule(n,{vs:a,fs:u,inject:y});const{vs:Q,fs:ae,uniforms:xe}=r.shaderModuleService.getModule(n),{createModel:Be}=r.rendererService;return new Promise(it=>{const{attributes:gt,elements:Bt,count:Rt}=r.styleAttributeService.createAttributesAndIndices(r.encodedData,A,O,r),Yt=[...r.layerModel.uniformBuffers,...r.rendererService.uniformBuffers,r.getLayerUniformBuffer()];Z&&Yt.push(r.getPickingUniformBuffer());const vr=(0,Wt.Z)({attributes:gt,uniforms:xe,fs:ae,vs:Q,elements:Bt,blend:nw[$r.normal],uniformBuffers:Yt,textures:r.layerModel.textures},Y);Rt&&(vr.count=Rt);const ln=Be(vr);it(ln)})})()}createAttributes(e){const{triangulation:r}=e,{attributes:n}=this.styleAttributeService.createAttributes(this.encodedData,r);return n}getTime(){return this.layerService.clock.getDelta()}setAnimateStartTime(){this.animateStartTime=this.layerService.clock.getElapsedTime()}stopAnimate(){this.animateStatus&&(this.layerService.stopAnimate(),this.animateStatus=!1,this.updateLayerConfig({animateOption:{enable:!1}}))}getLayerAnimateTime(){return this.layerService.clock.getElapsedTime()-this.animateStartTime}needPick(e){const{enableHighlight:r=!0,enableSelect:n=!0}=this.getLayerConfig();let a=this.eventNames().indexOf(e)!==-1||this.eventNames().indexOf("un"+e)!==-1;return(e==="click"||e==="dblclick")&&n&&(a=!0),e==="mousemove"&&(r||this.eventNames().indexOf("mouseenter")!==-1||this.eventNames().indexOf("unmousemove")!==-1||this.eventNames().indexOf("mouseout")!==-1)&&(a=!0),this.isVisible()&&a}buildModels(){return(0,Nr.Z)(function*(){throw new Error("Method not implemented.")})()}rebuildModels(){var e=this;return(0,Nr.Z)(function*(){yield e.buildModels()})()}renderMulPass(e){return(0,Nr.Z)(function*(){yield e.render()})()}renderModels(e={}){return this.encodeDataLength<=0&&!this.forceRender?(this.clearModels(),this):(this.hooks.beforeRender.call(),this.models.forEach(r=>{r.draw({uniforms:this.layerModel.getUninforms(),blend:this.layerModel.getBlend(),stencil:this.layerModel.getStencil(e),textures:this.layerModel.textures},(e==null?void 0:e.ispick)||!1)}),this.hooks.afterRender.call(),this)}updateStyleAttribute(e,r,n,a){const u=this.configService.getAttributeConfig(this.id)||{};return o2(u[e],{field:r,values:n})?!1:(["color","size","texture","rotate","filter","label","shape"].indexOf(e)!==-1&&this.configService.setAttributeConfig(this.id,{[e]:{field:r,values:n}}),this.startInit?this.styleAttributeService.updateStyleAttribute(e,{scale:(0,Wt.Z)({field:r},this.splitValuesAndCallbackInAttribute(n,this.getLayerConfig()[r]))},a):this.pendingStyleAttributes.push({attributeName:e,attributeField:r,attributeValues:n,updateOptions:a}),!0)}getLayerAttributeConfig(){return this.configService.getAttributeConfig(this.id)}getShaderPickStat(){return this.layerService.getShaderPickStat()}setEarthTime(e){console.warn("empty fn")}processData(e){return e}getModelType(){throw new Error("Method not implemented.")}getDefaultConfig(){return{}}initLayerModels(){var e=this;return(0,Nr.Z)(function*(){e.models.forEach(a=>a.destroy()),e.models=[],e.uniformBuffers.forEach(a=>{a.destroy()}),e.uniformBuffers=[];const r=e.rendererService.createBuffer({data:new Float32Array(16+4).fill(0),isUBO:!0});e.uniformBuffers.push(r);const n=e.rendererService.createBuffer({data:new Float32Array(20).fill(0),isUBO:!0});e.uniformBuffers.push(n),e.models=yield e.layerModel.initModels()})()}getLayerUniformBuffer(){return this.uniformBuffers[0]}getPickingUniformBuffer(){return this.uniformBuffers[1]}reRender(){this.inited&&this.layerService.reRender()}splitValuesAndCallbackInAttribute(e){return{values:iw(e)?void 0:e,callback:iw(e)?e:void 0}}}function JA(t,e){return{enable:t,mask:255,func:{cmp:Ee.EQUAL,ref:e?1:0,mask:1}}}function sw(t){return t.maskOperation===vn.OR?{enable:!0,mask:255,func:{cmp:Ee.ALWAYS,ref:1,mask:255},opFront:{fail:Ee.KEEP,zfail:Ee.REPLACE,zpass:Ee.REPLACE}}:{enable:!0,mask:255,func:{cmp:t.stencilType===Tn.SINGLE||t.stencilIndex===0?Ee.ALWAYS:Ee.LESS,ref:t.stencilType===Tn.SINGLE?1:t.stencilIndex===0?2:1,mask:255},opFront:{fail:Ee.KEEP,zfail:Ee.REPLACE,zpass:Ee.REPLACE}}}const QA={opacity:1,stroke:[1,0,0,1],offsets:[0,0],rotation:0,extrusionBase:0,strokeOpacity:1,thetaOffset:.314},t1={opacity:"float",stroke:"vec4",offsets:"vec2",textOffset:"vec2",rotation:"float",extrusionBase:"float",strokeOpacity:"float",thetaOffset:"float"};function lw(t){return Math.max(Math.ceil(t/4)*4,4)}const a2={opacity:Ro.OPACITY,stroke:Ro.STROKE,offsets:Ro.OFFSETS,rotation:Ro.ROTATION,extrusionBase:Ro.EXTRUSION_BASE,thetaOffset:15};class Ml{constructor(e){(0,K.Z)(this,"triangulation",void 0),(0,K.Z)(this,"uniformBuffers",[]),(0,K.Z)(this,"textures",[]),(0,K.Z)(this,"createTexture2D",void 0),(0,K.Z)(this,"preStyleAttribute",{}),(0,K.Z)(this,"encodeStyleAttribute",{}),(0,K.Z)(this,"layer",void 0),(0,K.Z)(this,"dataTexture",void 0),(0,K.Z)(this,"DATA_TEXTURE_WIDTH",void 0),(0,K.Z)(this,"dataTextureTest",void 0),(0,K.Z)(this,"configService",void 0),(0,K.Z)(this,"shaderModuleService",void 0),(0,K.Z)(this,"rendererService",void 0),(0,K.Z)(this,"iconService",void 0),(0,K.Z)(this,"fontService",void 0),(0,K.Z)(this,"styleAttributeService",void 0),(0,K.Z)(this,"mapService",void 0),(0,K.Z)(this,"cameraService",void 0),(0,K.Z)(this,"layerService",void 0),(0,K.Z)(this,"pickingService",void 0),(0,K.Z)(this,"attributeUnifoms",void 0),(0,K.Z)(this,"commonUnifoms",void 0),this.layer=e,this.configService=e.getContainer().globalConfigService,this.rendererService=e.getContainer().rendererService,this.pickingService=e.getContainer().pickingService,this.shaderModuleService=e.getContainer().shaderModuleService,this.styleAttributeService=e.getContainer().styleAttributeService,this.mapService=e.getContainer().mapService,this.iconService=e.getContainer().iconService,this.fontService=e.getContainer().fontService,this.cameraService=e.getContainer().cameraService,this.layerService=e.getContainer().layerService,this.registerStyleAttribute(),this.registerBuiltinAttributes(),this.startModelAnimate();const{createTexture2D:r}=this.rendererService;this.createTexture2D=r}getBlend(){const{blend:e="normal"}=this.layer.getLayerConfig();return nw[$r[e]]}getStencil(e){const{mask:r=!1,maskInside:n=!0,enableMask:a,maskOperation:u=vn.AND}=this.layer.getLayerConfig();if(this.layer.type==="MaskLayer")return sw({isStencil:!0,stencilType:Tn.SINGLE});if(e.isStencil)return sw((0,Wt.Z)((0,Wt.Z)({},e),{},{maskOperation:u}));const y=r||a&&this.layer.masks.length!==0||this.layer.tileMask!==void 0;return JA(y,n)}getDefaultStyle(){return{}}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());this.updateStyleUnifoms();const n=(0,Wt.Z)((0,Wt.Z)({},r.uniformsOption),e.uniformsOption);return Object.keys(n).forEach(a=>{typeof n[a]=="boolean"&&(n[a]=n[a]?1:0)}),!this.rendererService.hasOwnProperty("device")&&this.textures&&this.textures.length===1&&(n.u_texture=this.textures[0]),n}getAnimateUniforms(){return{}}needUpdate(){return(0,Nr.Z)(function*(){return!1})()}buildModels(){return(0,Nr.Z)(function*(){throw new Error("Method not implemented.")})()}initModels(){return(0,Nr.Z)(function*(){throw new Error("Method not implemented.")})()}clearModels(e=!0){}getAttribute(){throw new Error("Method not implemented.")}prerender(){}render(e){throw new Error("Method not implemented.")}registerBuiltinAttributes(){throw new Error("Method not implemented.")}animateOption2Array(e){return[e.enable?0:1,e.duration||4,e.interval||.2,e.trailLength||.1]}startModelAnimate(){const{animateOption:e}=this.layer.getLayerConfig();e.enable&&this.layer.setAnimateStartTime()}getInject(){const e=this.layer.encodeStyleAttribute;let r="";const n=[];this.layer.enableShaderEncodeStyles.forEach(y=>{e[y]?r+=`#define USE_ATTRIBUTE_${y.toUpperCase()} 0.0; `:n.push(` ${t1[y]} u_${y};`);let A=a2[y];!A&&y==="THETA_OFFSET"&&(A=15),r+=` #ifdef USE_ATTRIBUTE_${y.toUpperCase()} layout(location = ${a2[y]}) in ${t1[y]} a_${y.charAt(0).toUpperCase()+y.slice(1)}; #endif `});const a=n.length?` layout(std140) uniform AttributeUniforms { ${n.join(` `)} }; `:"";r+=a;let u="";return this.layer.enableShaderEncodeStyles.forEach(y=>{u+=` #ifdef USE_ATTRIBUTE_${y.toUpperCase()} ${t1[y]} ${y} = a_${y.charAt(0).toUpperCase()+y.slice(1)}; #else ${t1[y]} ${y} = u_${y}; #endif `}),{"vs:#decl":r,"fs:#decl":a,"vs:#main-start":u}}getStyleAttribute(){const e={};return this.layer.enableShaderEncodeStyles.forEach(r=>{if(!this.layer.encodeStyleAttribute[r]){const n=this.layer.getLayerConfig()[r];let a=typeof n=="undefined"?QA[r]:n;r==="stroke"&&(a=Va(a)),e["u_"+r]=a}}),e}registerStyleAttribute(){Object.keys(this.layer.encodeStyleAttribute).forEach(e=>{const r=FA(e);r&&(this.styleAttributeService.registerStyleAttribute(r),r.descriptor&&(r.descriptor.shaderLocation=a2[e]))})}updateEncodeAttribute(e,r){this.encodeStyleAttribute[e]=r}initUniformsBuffer(){const e=this.getUniformsBufferInfo(this.getStyleAttribute()),r=this.getCommonUniformsInfo();e.uniformsLength!==0&&(this.attributeUnifoms=this.rendererService.createBuffer({data:new Float32Array(lw(e.uniformsLength)).fill(0),isUBO:!0}),this.uniformBuffers.push(this.attributeUnifoms)),r.uniformsLength!==0&&(this.commonUnifoms=this.rendererService.createBuffer({data:new Float32Array(lw(r.uniformsLength)).fill(0),isUBO:!0}),this.uniformBuffers.push(this.commonUnifoms))}getUniformsBufferInfo(e){let r=0;const n=[];return Object.values(e).forEach(a=>{Array.isArray(a)?(n.push(...a),r+=a.length):typeof a=="number"?(n.push(a),r+=1):typeof a=="boolean"&&(n.push(Number(a)),r+=1)}),{uniformsOption:e,uniformsLength:r,uniformsArray:n}}getCommonUniformsInfo(){return{uniformsLength:0,uniformsArray:[],uniformsOption:{}}}updateStyleUnifoms(){var e,r;const{uniformsArray:n}=this.getUniformsBufferInfo(this.getStyleAttribute()),{uniformsArray:a}=this.getCommonUniformsInfo();(e=this.attributeUnifoms)===null||e===void 0||e.subData({offset:0,data:new Uint8Array(new Float32Array(n).buffer)}),(r=this.commonUnifoms)===null||r===void 0||r.subData({offset:0,data:new Uint8Array(new Float32Array(a).buffer)})}}let eC=function(t){return t[t.solid=0]="solid",t[t.dash=1]="dash",t}({}),s2=function(t){return t.VERTICAL="vertical",t.HORIZONTAL="horizontal",t}({}),uw=function(t){return t.NORMAL="normal",t.REPLACE="replace",t}({}),r1=function(t){return t[t.pixel=0]="pixel",t[t.meter=1]="meter",t}({}),cw=function(t){return t.ALWAYS="always",t.DRAGEND="dragend",t}({});const tC={canvas2d:"2d",webgl:"webgl",webgl2:"webgl2",webgpu:"webgpu"};class rC extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"canvas",null),(0,K.Z)(this,"ctx",void 0),(0,K.Z)(this,"ctxType",void 0),(0,K.Z)(this,"viewportSize",void 0),(0,K.Z)(this,"initCanvas",()=>{var r,n,a,u,y;const{zIndex:A,getContext:O}=this.layerConfig,Z=document.createElement("canvas"),Y=this.layer.getModelType();this.canvas=Z,Z.classList.add("l7-canvas-layer"),Z.style.position="absolute",Z.style.top="0",Z.style.left="0",Z.style.zIndex=String(A),this.resetCanvasSize();const Q=(r=(n=(a=this.mapService).getCanvasOverlays)===null||n===void 0?void 0:n.call(a))!==null&&r!==void 0?r:(u=(y=this.mapService).getMapCanvasContainer)===null||u===void 0?void 0:u.call(y);Q==null||Q.appendChild(Z),this.ctx=O?O(Z):Z.getContext(tC[Y]),this.ctx||console.error("Failed to get rendering context for canvas"),this.bindListeners()}),(0,K.Z)(this,"resetViewportSize",()=>{const{width:r,height:n}=this.rendererService.getViewportSize();this.viewportSize=[r,n]}),(0,K.Z)(this,"resetCanvasSize",()=>{const r=this.canvas;if(!r)return;this.resetViewportSize();const[n,a]=this.mapService.getSize(),[u,y]=this.viewportSize;r.width=u,r.height=y,r.style.width=n+"px",r.style.height=a+"px"}),(0,K.Z)(this,"renderCanvas",()=>{var r;this.canvas||this.initCanvas();const{draw:n,drawingOnCanvas:a}=this.layerConfig,[u,y]=this.viewportSize,A=this.mapService.getBounds();(r=n!=null?n:a)===null||r===void 0||r({canvas:this.canvas,ctx:this.ctx,container:{width:u,height:y,bounds:A},size:[u,y],utils:{lngLatToContainer:this.lngLatToContainer},mapService:this.mapService})}),(0,K.Z)(this,"removeCanvas",()=>{if(this.canvas){var r;(r=this.canvas.parentElement)===null||r===void 0||r.removeChild(this.canvas),this.canvas=null}this.unbindListeners()}),(0,K.Z)(this,"onMapResize",()=>{requestAnimationFrame(()=>{this.resetCanvasSize(),this.renderCanvas()})}),(0,K.Z)(this,"lngLatToContainer",r=>{const{x:n,y:a}=this.mapService.lngLatToContainer(r);return{x:n*window.devicePixelRatio,y:a*window.devicePixelRatio}})}get layerConfig(){return this.layer.getLayerConfig()}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.renderCanvas(),[]})()}bindListeners(){this.mapService.on("resize",this.onMapResize);const{trigger:e,update:r}=this.layerConfig;r===cw.ALWAYS||e==="change"?this.mapService.on("mapchange",this.renderCanvas):(this.mapService.on("zoomstart",this.removeCanvas),this.mapService.on("zoomend",this.renderCanvas),this.mapService.on("movestart",this.removeCanvas),this.mapService.on("moveend",this.renderCanvas))}unbindListeners(){this.mapService.off("resize",this.onMapResize),this.mapService.off("mapchange",this.renderCanvas),this.mapService.off("zoomstart",this.removeCanvas),this.mapService.off("zoomend",this.renderCanvas),this.mapService.off("movestart",this.removeCanvas),this.mapService.off("moveend",this.renderCanvas)}registerBuiltinAttributes(){}}class nC extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","CanvasLayer")}getDefaultConfig(){return{zIndex:3,contextType:"canvas2d",trigger:"change"}}buildModels(){var e=this;return(0,Nr.Z)(function*(){e.layerModel=new rC(e),yield e.initLayerModels()})()}getModelType(){return this.getLayerConfig().contextType||"canvas2d"}draw(e){return this.updateLayerConfig({draw:e}),this.render(),this}getLayerConfig(){const e=(0,Wt.Z)((0,Wt.Z)({},this.getDefaultConfig()),super.getLayerConfig());return e.zIndex<3&&(e.zIndex=3),e}render(){var e;return(e=this.layerModel)===null||e===void 0||e.renderCanvas(),this}getCanvas(){var e;return(e=this.layerModel)===null||e===void 0?void 0:e.canvas}show(){const e=this.getCanvas();return e&&(e.style.display="unset"),this}hide(){const e=this.getCanvas();return e&&(e.style.display="none"),this}destroy(){this.layerModel.removeCanvas(),super.destroy()}}var iC=Se(75734),Rm=Se.n(iC),ra=Se(54442);const n1=100,hw=36,oC=40;function pw(t){return t/180*Math.acos(-1)}function fw(t){const e=pw(t[0])+Math.PI/2,r=pw(t[1]),n=n1+Math.random()*.4,a=n*Math.cos(r)*Math.cos(e),u=n*Math.cos(r)*Math.sin(e),y=n*Math.sin(r);return[u,y,a]}function dw(t,e){const r=Kr.create(),n=Kr.create(),a=ra.fromValues(0,1,0),u=ra.fromValues(0,0,0);e=e||{},t=typeof t!="undefined"?t:1;const A=2+(typeof e.segments!="undefined"?e.segments:32),O=2*A,Z=[],Y=[],Q=[],ae=[],xe=[],Be=[];for(let it=0;it<=A;it++){const gt=it/A,Bt=gt*Math.PI;for(let Rt=0;Rt<=O;Rt++){const Yt=Rt/O,vr=Yt*Math.PI*2;Kr.identity(n),Kr.rotateZ(n,n,-Bt),Kr.identity(r),Kr.rotateY(r,r,vr),ra.transformMat4(u,a,n),ra.transformMat4(u,u,r),ra.scale(u,u,-t),Q.push(u.slice()),ae.push(...u.slice()),ra.normalize(u,u),xe.push(...u.slice()),Be.push([Yt,1-gt]),ae.push(Yt,1-gt)}if(it>0){const Rt=Q.length;let Yt=Rt-2*(O+1);for(;Yt+O+2this.miterLimit&&(ln=!0),ln?(ae.push(this.normal[0],this.normal[1],0),ae.push(Yt[0],Yt[1],0),Q.push(a[0],a[1],a[2]|0,this.totalDistance,-this.thickness*vr,a[2]|0),this.complex.indexes.push(this.currentIndex),Q.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness*vr,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,Y.push(...this.lastFlip!==-vr?[r,r+2,r+3]:[r+2,r+1,r+3]),Y.push(r+2,r+3,r+4),Bg(i1,Og),Ja.copy(this.normal,i1),ae.push(this.normal[0],this.normal[1],0),Q.push(a[0],a[1],a[2]|0,this.totalDistance,-this.thickness*vr,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,Z+=3):(this.extrusions(Q,ae,a,Yt,Rt,this.totalDistance),Y.push(...this.lastFlip===1?[r,r+2,r+3]:[r+2,r+1,r+3]),vr=-1,Ja.copy(this.normal,Yt),Z+=2),this.lastFlip=vr}else{if(Bg(this.normal,ff),xe){const Rt=Ja.create(),Yt=Ja.create();Ja.sub(Yt,ff,this.normal),Ja.add(Rt,ff,this.normal),ae.push(Yt[0],Yt[1],0),ae.push(Rt[0],Rt[1],0),Q.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness,a[2]|0),this.complex.indexes.push(this.currentIndex),Q.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(Q,ae,a,this.normal,this.thickness,this.totalDistance);Y.push(...this.lastFlip===1?[r,r+2,r+3]:[r+2,r+1,r+3]),Z+=2}return Z}segment(e,r,n,a,u){let y=0;const A=e.indices,O=e.positions,Z=e.normals,Y=this.cap==="square",Q=this.join==="bevel",ae=vl([a[0],a[1]]),xe=vl([n[0],n[1]]);O0(ff,ae,xe);let Be=0;if(this.dash&&(Be=this.lineSegmentDistance(ae,xe),this.totalDistance+=Be),this.normal||(this.normal=Ja.create(),Bg(this.normal,ff)),!this.started)if(this.started=!0,Y){const it=Ja.create(),gt=Ja.create();Ja.add(it,this.normal,ff),Ja.add(gt,this.normal,ff),Z.push(gt[0],gt[1],0),Z.push(it[0],it[1],0),O.push(n[0],n[1],n[2]|0,this.totalDistance-Be,-this.thickness,n[2]|0),this.complex.indexes.push(this.currentIndex),O.push(n[0],n[1],n[2]|0,this.totalDistance-Be,this.thickness,n[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(O,Z,n,this.normal,this.thickness,this.totalDistance-Be);if(A.push(r+0,r+1,r+2),u){const it=vl([u[0],u[1]]);u2(ae,it)&&Ja.add(it,ae,Ja.normalize(it,Ja.subtract(it,ae,xe))),O0(Og,it,ae);const[gt,Bt]=l2(D0,Ja.create(),ff,Og,this.thickness);let Rt=Ja.dot(D0,this.normal)<0?-1:1,Yt=Q;!Yt&&this.join==="miter"&>>this.miterLimit&&(Yt=!0),Yt?(Z.push(this.normal[0],this.normal[1],0),Z.push(Bt[0],Bt[1],0),O.push(a[0],a[1],a[2]|0,this.totalDistance,-this.thickness*Rt,a[2]|0),this.complex.indexes.push(this.currentIndex),O.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness*Rt,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,A.push(...this.lastFlip!==-Rt?[r,r+2,r+3]:[r+2,r+1,r+3]),A.push(r+2,r+3,r+4),Bg(i1,Og),Ja.copy(this.normal,i1),Z.push(this.normal[0],this.normal[1],0),O.push(a[0],a[1],a[2]|0,this.totalDistance,-this.thickness*Rt,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,y+=3):(this.extrusions(O,Z,a,Bt,gt,this.totalDistance),A.push(...this.lastFlip===1?[r,r+2,r+3]:[r+2,r+1,r+3]),Rt=-1,Ja.copy(this.normal,Bt),y+=2),this.lastFlip=Rt}else{if(Bg(this.normal,ff),Y){const it=Ja.create(),gt=Ja.create();Ja.sub(gt,ff,this.normal),Ja.add(it,ff,this.normal),Z.push(gt[0],gt[1],0),Z.push(it[0],it[1],0),O.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness,a[2]|0),this.complex.indexes.push(this.currentIndex),O.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(O,Z,a,this.normal,this.thickness,this.totalDistance);A.push(...this.lastFlip===1?[r,r+2,r+3]:[r+2,r+1,r+3]),y+=2}return y}extrusions(e,r,n,a,u,y){r.push(a[0],a[1],0),r.push(a[0],a[1],0),e.push(n[0],n[1],n[2]|0,y,-u,n[2]|0),this.complex.indexes.push(this.currentIndex),e.push(n[0],n[1],n[2]|0,y,u,n[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}lineSegmentDistance(e,r){const n=r[0]-e[0],a=r[1]-e[1];return Math.sqrt(n*n+a*a)}}function sC(t){const e=t[0][0],r=t[0][t[0].length-1];e[0]===r[0]&&e[1]===r[1]&&(t[0]=t[0].slice(0,t[0].length-1));const n=t[0].length,a=Rm().flatten(t),{vertices:u,dimensions:y}=a,A=[],O=[];for(let Y=0;YBe+xe))}return{positions:A,index:O}}function lC(t){const e=Rm().flatten(t),r=Rm()(e.vertices,e.holes,e.dimensions);return{positions:e.vertices,index:r}}function mw(t,e=!1){const r=t[0][0],n=t[0][t[0].length-1];r[0]===n[0]&&r[1]===n[1]&&(t[0]=t[0].slice(0,t[0].length-1));const a=t[0].length,u=Rm().flatten(t),{vertices:y,dimensions:A}=u,O=[],Z=[],Y=[];for(let ae=0;aeBt+it))}return{positions:O,index:Z,normals:Y}}function uC(t,e,r,n=!1){const a=ra.create(),u=ra.create(),y=ra.create();n&&(t=Qh(t),e=Qh(e),r=Qh(r));const A=ra.fromValues(...t),O=ra.fromValues(...e),Z=ra.fromValues(...r);ra.sub(a,Z,O),ra.sub(u,A,O),ra.cross(y,a,u);const Y=ra.create();return ra.normalize(Y,y),Y}let l_=function(t){return t.CYLINDER="cylinder",t.SQUARECOLUMN="squareColumn",t.TRIANGLECOLUMN="triangleColumn",t.HEXAGONCOLUMN="hexagonColumn",t.PENTAGONCOLUMN="pentagonColumn",t}({}),u_=function(t){return t.CIRCLE="circle",t.SQUARE="square",t.TRIANGLE="triangle",t.HEXAGON="hexagon",t.PENTAGON="pentagon",t}({});function c_(t,e=0){const r=Math.PI*2/t,n=[];for(let u=0;u{const y=Math.sin(u+Math.PI/4),A=Math.cos(u+Math.PI/4);return[y,A,0]})}function c2(){return c_(30)}function gw(){return c_(4)}function vw(){return c_(3)}function _w(){return c_(6,1)}function yw(){return c_(5)}const B0={[u_.CIRCLE]:c2,[u_.HEXAGON]:_w,[u_.TRIANGLE]:vw,[u_.SQUARE]:gw,[u_.PENTAGON]:yw,[l_.CYLINDER]:c2,[l_.HEXAGONCOLUMN]:_w,[l_.TRIANGLECOLUMN]:vw,[l_.SQUARECOLUMN]:gw,[l_.PENTAGONCOLUMN]:yw},o1={};function r0(t){const e=Pc(t.coordinates);return{vertices:[...e,...e,...e,...e],indices:[0,1,2,2,3,0],size:e.length}}function xw(t){const e=Pc(t.coordinates),r=fw(e);return{vertices:[...r,...r,...r,...r],indices:[0,1,2,2,3,0],size:r.length}}function h2(t){const{shape:e}=t,{positions:r,index:n,normals:a}=gC(e,!1);return{vertices:r,indices:n,normals:a,size:5}}function cC(t){const e=Pc(t.coordinates);return{vertices:[...e],indices:[0],size:e.length}}function p2(t){const{coordinates:e,originCoordinates:r,version:n}=t,a=new aC({dash:!0,join:"bevel"});if(n==="GAODE2.x"){let y=e;Array.isArray(y[0][0])||(y=[e]);let A=r;Array.isArray(A[0][0])||(A=[r]);for(let O=0;O{a.extrude(A)})}const u=a.complex;return{vertices:u.positions,indices:u.indices,normals:u.normals,indexes:u.indexes,size:6}}function wO(t){const e=t.coordinates.flat(),r=1,n=1;return{vertices:[1,0,0,...e,1,2,-3,...e,1,1,-3,...e,0,1,0,...e,0,0,0,...e,1,0,0,...e,1,2,-3,...e,1,1,-3,...e,0,1,0,...e,0,0,0,...e],normals:[-r,2*n,1,2*n,-n,1,n,-n,1,n,-n,1,-r,-n,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],indices:[0,1,2,0,2,3,0,3,4,5,6,7,5,7,8,5,8,9],size:7}}function hC(t){const{coordinates:e,originCoordinates:r}=t,n=[];if(!Array.isArray(e[0]))return{vertices:[],indices:[],normals:[],size:6,count:0};const{results:a,totalDistance:u}=pC(e,r);return a.map(y=>{n.push(y[0],y[1],y[2],y[3],0,u)}),{vertices:n,indices:[],normals:[],size:6,count:a.length}}function SO(t){const{coordinates:e}=t,r=[];if(!Array.isArray(e[0]))return{vertices:[],indices:[],size:4,count:0};const{results:n}=fC(e);return n.map(a=>{r.push(a[0],a[1],a[2],a[3])}),{vertices:r,indices:[],size:4,count:n.length}}function bw(t,e){const r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)}function F0(t,e){return t.length<3&&t.push(0),e!==void 0&&t.push(e),t}function pC(t,e){let r=t,n=e||t;Array.isArray(r)&&Array.isArray(r[0])&&Array.isArray(r[0][0])&&(r=e.flat(),n=e.flat());let a=0;if(r.length<2)return{results:r,totalDistance:0};{const u=[],y=F0(r[0],a);u.push(y);for(let O=1;Oy*2+A));return{vertices:a,indices:u,size:7}}function ww(t){const e=t.coordinates;e.length===2&&e.push(0);const r=s1(-1,1),n=s1(1,1),a=s1(-1,-1),u=s1(1,-1);return{vertices:[...e,...r,...e,...a,...e,...u,...e,...n],indices:[0,1,2,3,0,2],size:5}}function gC(t,e=!1){if(o1&&o1[t])return o1[t];const r=B0[t]?B0[t]():B0.cylinder(),n=mw([r],e);return o1[t]=n,n}function TO(t,e,r=3,n=!1){const a=new Float32Array(t.length/r*3);let u,y,A;const O=vec3.create(),Z=vec3.create(),Y=vec3.create();for(let Q=0,ae=e.length;Q 0.0 && v_worldDis < u_cityMinSize) { float r = fract(((v_worldDis/u_cityMinSize) - u_time * u_circleSweepSpeed) * 2.0); outputColor.rgb += r * r * u_circleSweepColor.rgb; } outputColor.a *= u_opacity; outputColor = filterColor(outputColor); } `,bC=`precision highp float; #define ambientRatio 0.5 #define diffuseRatio 0.3 #define specularRatio 0.2 layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(location = 13) in vec3 a_Normal; layout(location = 14) in vec2 a_Uv; out vec2 v_texCoord; out vec4 v_Color; out float v_worldDis; layout(std140) uniform commonUniforms { vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ]; vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ]; vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ]; vec4 u_circleSweepColor; vec2 u_cityCenter; float u_circleSweep; float u_cityMinSize; float u_circleSweepSpeed; float u_opacity: 1.0; float u_near : 0; float u_far : 1; float u_time; }; #pragma include "projection" #pragma include "light" #pragma include "picking" void main() { vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0); vec4 project_pos = project_position(pos); v_texCoord = a_Uv; if(u_circleSweep > 0.0) { vec2 lnglatscale = vec2(0.0); if(u_CoordinateSystem != COORDINATE_SYSTEM_P20_2) { lnglatscale = (a_Position.xy - u_cityCenter) * vec2(0.0, 0.135); } v_worldDis = length(a_Position.xy + lnglatscale - u_cityCenter); } if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0)); } else { gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0)); } float lightWeight = calc_lighting(pos); // v_Color = a_Color; v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w); setPickingColor(a_PickingColor); } `;class EC extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"cityCenter",void 0),(0,K.Z)(this,"cityMinSize",void 0)}getCommonUniformsInfo(){const{opacity:e=1,baseColor:r="rgb(16,16,16)",brightColor:n="rgb(255,176,38)",windowColor:a="rgb(30,60,89)",time:u=0,sweep:y={enable:!1,sweepRadius:1,sweepColor:"rgb(255, 255, 255)",sweepSpeed:.4,sweepCenter:this.cityCenter}}=this.layer.getLayerConfig(),A={u_baseColor:Va(r),u_brightColor:Va(n),u_windowColor:Va(a),u_circleSweepColor:[...Va(y.sweepColor).slice(0,3),1],u_cityCenter:y.sweepCenter||this.cityCenter,u_circleSweep:y.enable?1:0,u_cityMinSize:this.cityMinSize*y.sweepRadius,u_circleSweepSpeed:y.sweepSpeed,u_opacity:e,u_near:0,u_far:1,u_time:this.layer.getLayerAnimateTime()||u};return this.getUniformsBufferInfo(A)}calCityGeo(){const[e,r,n,a]=this.layer.getSource().extent;if(this.mapService.version==="GAODE2.x"){this.cityCenter=this.mapService.lngLatToCoord([(n+e)/2,(a+r)/2]);const u=this.mapService.lngLatToCoord([n,a]),y=this.mapService.lngLatToCoord([e,r]);this.cityMinSize=Math.sqrt(Math.pow(u[0]-y[0],2)+Math.pow(u[1]-y[1],2))/4}else{const u=n-e,y=a-r;this.cityCenter=[(n+e)/2,(a+r)/2],this.cityMinSize=Math.sqrt(Math.pow(u,2)+Math.pow(y,2))/4}}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.calCityGeo(),e.initUniformsBuffer(),e.startModelAnimate(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return[yield e.layer.buildLayerModel({moduleName:"cityBuilding",vertexShader:bC,fragmentShader:xC,triangulation:f2,depth:{enable:!0},inject:e.getInject(),cull:{enable:!0,face:Ee.BACK}})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=10}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}class wC extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","CityBuildingLayer")}buildModels(){var e=this;return(0,Nr.Z)(function*(){e.layerModel=new EC(e),yield e.initLayerModels()})()}setLight(e){this.updateLayerConfig({time:e})}getModelType(){return"citybuilding"}}const SC=`layout(std140) uniform commonUniforms { vec2 u_size; float u_raisingHeight; float u_rotation; float u_opacity; }; uniform sampler2D u_texture; in vec2 v_uv; out vec4 outputColor; #pragma include "picking" void main() { outputColor = texture(SAMPLER_2D(u_texture), vec2(v_uv.x, 1.0 - v_uv.y)); outputColor.a *= u_opacity; outputColor = filterColor(outputColor); } `,TC=`layout(location = 0) in vec3 a_Position; layout(location = 11) in vec3 a_Extrude; layout(location = 14) in vec2 a_Uv; layout(std140) uniform commonUniforms { vec2 u_size; float u_raisingHeight; float u_rotation; float u_opacity; }; out vec2 v_uv; #pragma include "projection" #pragma include "picking" #pragma include "rotation_2d" void main() { vec3 extrude = a_Extrude; v_uv = a_Uv; float raiseHeight = u_raisingHeight; if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom); raiseHeight = u_raisingHeight * mapboxZoomScale; } // \u8BA1\u7B97\u7ECF\u7EAC\u5EA6\u70B9\u4F4D\u5750\u6807 vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0)); // \u8BA1\u7B97\u7ED5 z \u8F74\u65CB\u8F6C\u540E\u7684\u504F\u79FB vec2 offsetXY = project_pixel(rotate_matrix(vec2(extrude.x * u_size.x, 0.0),u_rotation)); // \u7ED5 z \u8F74\u65CB\u8F6C float x = project_pos.x + offsetXY.x; float y = project_pos.y + offsetXY.y; // z \u8F74\u4E0D\u53C2\u4E0E\u65CB\u8F6C float z = project_pixel(extrude.y * u_size.y + raiseHeight); gl_Position = project_common_position_to_clipspace_v2(vec4(x , y, z , 1.0)); setPickingColor(a_PickingColor); } `;class AC extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"radian",0),(0,K.Z)(this,"planeGeometryTriangulation",()=>{const{center:r=[120,30]}=this.layer.getLayerConfig();return{size:4,indices:[0,1,2,2,3,0],vertices:[...r,1,1,...r,0,1,...r,0,0,...r,1,0]}})}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{opacity:e,width:r=1,height:n=1,raisingHeight:a=0}=this.layer.getLayerConfig();let u=1;(this.mapService.version==="GAODE2.x"||this.mapService.version==="GAODE1.x")&&(u=-1),this.radian=u*Math.PI*(this.mapService.getRotation()%360)/180;const y={u_size:[r,n],u_raisingHeight:Number(a),u_rotation:this.radian,u_opacity:e||1,u_texture:this.texture};return this.textures=[this.texture],this.getUniformsBufferInfo(y)}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy()}initModels(){var e=this;return(0,Nr.Z)(function*(){const{drawCanvas:r}=e.layer.getLayerConfig(),{createTexture2D:n}=e.rendererService;return e.texture=n({height:0,width:0}),r&&e.updateTexture(r),e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"geometryBillboard",vertexShader:TC,fragmentShader:SC,triangulation:e.planeGeometryTriangulation,inject:e.getInject(),primitive:Ee.TRIANGLES,depth:{enable:!0}})]})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initModels()})()}updateTexture(e){const{createTexture2D:r}=this.rendererService,{canvasWidth:n=1,canvasHeight:a=1}=this.layer.getLayerConfig(),u=document.createElement("canvas");u.width=n,u.height=a,u.getContext("2d")&&(e(u),this.texture=r({data:u,width:u.width,height:u.height,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE}),this.layerService.reRender())}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Vr.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Ro.EXTRUDE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a)=>{const u=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],y=a%4*3;return[u[y],u[y+1],u[y+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[2],n[3]]}})}}const CC=` uniform sampler2D u_texture; layout(std140) uniform commonUniforms { float u_opacity; float u_mapFlag; float u_terrainClipHeight; }; in vec3 v_Color; in vec2 v_uv; in float v_clip; out vec4 outputColor; #pragma include "picking" void main() { // gl_FragColor = vec4(v_Color, u_opacity); if(u_mapFlag > 0.0) { outputColor = texture(SAMPLER_2D(u_texture), vec2(v_uv.x, 1.0 - v_uv.y)); outputColor.a *= u_opacity; } else { // gl_FragColor = vec4(v_uv, 0.0, u_opacity); outputColor = vec4(v_Color, u_opacity); } outputColor.a *= v_clip; outputColor = filterColor(outputColor); } `,MC=` layout(location = 0) in vec3 a_Position; layout(location = 1) in vec3 a_Color; layout(location = 14) in vec2 a_Uv; layout(std140) uniform commonUniforms { float u_opacity; float u_mapFlag; float u_terrainClipHeight; }; out vec3 v_Color; out vec2 v_uv; out float v_clip; #pragma include "projection" #pragma include "picking" void main() { v_Color = a_Color; v_uv = a_Uv; vec4 project_pos = project_position(vec4(a_Position, 1.0)); v_clip = 1.0; if(a_Position.z < u_terrainClipHeight) { v_clip = 0.0; } gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy, a_Position.z, 1.0)); setPickingColor(a_PickingColor); } `;class PC extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"terrainImage",void 0),(0,K.Z)(this,"terrainImageLoaded",!1),(0,K.Z)(this,"mapTexture",void 0),(0,K.Z)(this,"planeGeometryTriangulation",()=>{const{width:r=1,height:n=1,widthSegments:a=1,heightSegments:u=1,center:y=[120,30],terrainTexture:A}=this.layer.getLayerConfig(),{indices:O,positions:Z}=this.initPlane(r,n,a,u,...y);return A&&this.loadTerrainTexture(Z,O),{vertices:Z,indices:O,size:5}})}initPlane(e=1,r=1,n=1,a=1,u=120,y=30){const A=e/2,O=r/2,Z=Math.floor(n),Y=Math.floor(a),Q=Z+1,ae=Y+1,xe=e/Z,Be=r/Y,it=[],gt=[];for(let Bt=0;Bt{this.texture=r({data:n,width:n.width,height:n.height,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE}),this.layerService.reRender()},n.src=e}else this.texture=r({width:0,height:0})}getImageData(e){const r=document.createElement("canvas"),n=r.getContext("2d"),{width:a,height:u}=e;return r.width=a,r.height=u,n.drawImage(e,0,0,a,u),n.getImageData(0,0,a,u)}translateVertex(e,r,n,a,u,y){const A=n.width,O=n.height,Z=this.getImageData(n).data,Y=Math.floor(a),Q=Math.floor(u),ae=Y+1,xe=Q+1,Be=A/Y,it=O/Q;for(let Rt=0;Rt({vertices:e,indices:r,size:5}));this.layer.updateModelData(Bt),this.layerService.throttleRenderLayers()}loadTerrainTexture(e,r){const{widthSegments:n=1,heightSegments:a=1,terrainTexture:u,rgb2height:y=(A,O,Z)=>A+O+Z}=this.layer.getLayerConfig();if(this.terrainImage)this.terrainImageLoaded?this.translateVertex(e,r,this.terrainImage,n,a,y):this.terrainImage.onload=()=>{this.translateVertex(e,r,this.terrainImage,n,a,y)};else{const A=new Image;this.terrainImage=A,A.crossOrigin="anonymous",A.onload=()=>{this.terrainImageLoaded=!0,setTimeout(()=>this.layer.emit("terrainImageLoaded",null)),this.translateVertex(e,r,A,n,a,y)},A.src=u}}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}const RC=` layout(std140) uniform commonUniforms { float u_opacity; float u_mapFlag; float u_Scale; }; uniform sampler2D u_texture; in vec3 v_Color; in float v_d; out vec4 outputColor; void main() { if(v_d < 0.0) { discard; } if(u_mapFlag > 0.0) { outputColor = texture(SAMPLER_2D(u_texture), gl_PointCoord); outputColor.a *= u_opacity; } else { outputColor = vec4(v_Color, u_opacity); } } `,IC=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec3 a_Color; layout(std140) uniform commonUniforms { float u_opacity; float u_mapFlag; float u_Scale; }; out vec3 v_Color; out float v_d; #pragma include "projection" void main() { v_Color = a_Color.xyz; vec4 project_pos = project_position(vec4(a_Position, 1.0)); v_d = a_Position.z; gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy, a_Position.z, 1.0)); gl_PointSize = pow((u_Zoom - 1.0), 2.0) * u_Scale; } `;var k0=function(t){return t.UP="up",t.DOWN="down",t}(k0||{});class LC extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"mapTexture",void 0),(0,K.Z)(this,"positions",void 0),(0,K.Z)(this,"indices",void 0),(0,K.Z)(this,"timer",void 0),(0,K.Z)(this,"spriteTop",void 0),(0,K.Z)(this,"spriteUpdate",void 0),(0,K.Z)(this,"spriteAnimate",void 0),(0,K.Z)(this,"planeGeometryUpdateTriangulation",()=>{const{spriteBottom:r=-1e5}=this.layer.getLayerConfig(),n=this.spriteUpdate,a=r,u=this.spriteTop;for(let y=0;yu&&(this.positions[y+2]=a)):(this.positions[y+2]-=n,this.positions[y+2]{var r;this.planeGeometryUpdateTriangulation();const n=(r=this.styleAttributeService.getLayerStyleAttribute("position"))===null||r===void 0?void 0:r.vertexAttribute;if(n){const a=[];for(let u=0;u{const{center:r=[120,30],spriteCount:n=100,spriteRadius:a=10}=this.layer.getLayerConfig(),{indices:u,positions:y}=this.initSprite(a,n,...r);return this.positions=y,this.indices=u,{vertices:y,indices:u,size:5}})}initSprite(e=10,r=100,n=120,a=30){const u=[],y=[],A=this.mapService,O=this.spriteAnimate===k0.UP?-this.spriteTop:this.spriteTop;for(let Y=0;Y{e.updatePosition()},100),[yield e.layer.buildLayerModel({moduleName:"geometrySprite",vertexShader:IC,fragmentShader:RC,triangulation:e.planeGeometryTriangulation,inject:e.getInject(),primitive:Ee.POINTS,depth:{enable:!1},blend:e.getBlend()})]})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initModels()})()}updateTexture(e){const{createTexture2D:r}=this.rendererService;if(e){const n=new Image;n.crossOrigin="anonymous",n.onload=()=>{this.texture=r({data:n,width:n.width,height:n.height,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE}),this.layerService.reRender()},n.src=e}else this.texture=r({width:1,height:1})}registerBuiltinAttributes(){return""}}var DC={plane:PC,sprite:LC,billboard:AC};class OC extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","GeometryLayer"),(0,K.Z)(this,"defaultSourceConfig",{data:[{x:0,y:0}],options:{parser:{type:"json",x:"x",y:"y"}}})}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new DC[r](e),yield e.initLayerModels()})()}getDefaultConfig(){const e=this.getModelType();return{plane:{},sprite:{},billboard:{}}[e]}getModelType(){var e;const r=this.styleAttributeService.getLayerStyleAttribute("shape"),n=r==null||(e=r.scale)===null||e===void 0?void 0:e.field;return n==="plane"?"plane":n==="sprite"?"sprite":n==="billboard"?"billboard":"plane"}}function Tw(t,e){return{type:t.type,field:"value",items:t.positions.map((r,n)=>({[e]:n>=t.colors.length?null:t.colors[n],value:r}))}}const BC=`in vec4 v_color; #pragma include "scene_uniforms" #pragma include "picking" out vec4 outputColor; void main() { outputColor = v_color; outputColor = filterColor(outputColor); } `,FC=`layout(location = 0) in vec3 a_Position;\r layout(location = 1) in vec4 a_Color;\r layout(location = 10) in vec3 a_Pos;\r \r layout(std140) uniform commonUniforms {\r vec2 u_radius;\r float u_opacity;\r float u_coverage;\r float u_angle;\r };\r \r \r out vec4 v_color;\r \r \r #pragma include "projection"\r #pragma include "project"\r #pragma include "picking"\r \r void main() {\r v_color = a_Color;\r v_color.a *= u_opacity;\r \r mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\r vec2 offset = a_Position.xy * u_radius * rotationMatrix * u_coverage ;\r // vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r // vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r // gl_Position = project_common_position_to_clipspace(project_pos);\r \r if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\r vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator; // \u5C06\u7ECF\u7EAC\u5EA6\u8F6C\u6362\u4E3A\u9AD8\u5FB72.0\u9700\u8981\u7684\u5E73\u9762\u5750\u6807\r vec4 project_pos = project_position(vec4(customLnglat, 0, 1.0));\r gl_Position = u_Mvp * (project_pos);\r } else {\r vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r gl_Position = project_common_position_to_clipspace(project_pos);\r }\r \r setPickingColor(a_PickingColor);\r }\r `;class kC extends Ml{getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{opacity:e,coverage:r,angle:n}=this.layer.getLayerConfig(),a={u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset],u_opacity:e||1,u_coverage:r||.9,u_angle:n||0};return this.getUniformsBufferInfo(a)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"heatmapGrid",vertexShader:FC,fragmentShader:BC,triangulation:Ew,primitive:Ee.TRIANGLES,depth:{enable:!1}})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"pos",type:Vr.Attribute,descriptor:{shaderLocation:10,name:"a_Pos",buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:e=>{const r=e.version==="GAODE2.x"?e.originCoordinates:e.coordinates;return[r[0],r[1],0]}}})}}const NC=`in vec4 v_color; layout(std140) uniform commonUniforms { vec2 u_radius; float u_opacity; float u_coverage; float u_angle; }; #pragma include "scene_uniforms" #pragma include "picking" out vec4 outputColor; void main() { outputColor = v_color; outputColor = filterColor(outputColor); } `,zC=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(location = 10) in vec3 a_Pos; layout(location = 13) in vec3 a_Normal; layout(std140) uniform commonUniforms { vec2 u_radius; float u_opacity; float u_coverage; float u_angle; }; out vec4 v_color; #pragma include "projection" #pragma include "project" #pragma include "light" #pragma include "picking" void main() { mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle)); vec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage)); if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // \u7ECF\u7EAC\u5EA6 vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator; // \u5C06\u7ECF\u7EAC\u5EA6\u8F6C\u6362\u4E3A\u9AD8\u5FB72.0\u9700\u8981\u7684\u5E73\u9762\u5750\u6807 vec4 project_pos = project_position(vec4(customLnglat, a_Position.z * a_Size, 1.0)); float lightWeight = calc_lighting(project_pos); v_color =vec4(a_Color.rgb*lightWeight, a_Color.w * u_opacity); gl_Position = u_Mvp * vec4(customLnglat , a_Position.z * a_Size, 1.0); } else { vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // \u5B9E\u9645\u7684\u7ECF\u7EAC\u5EA6 vec4 project_pos = project_position(vec4(lnglat, a_Position.z * a_Size, 1.0)); float lightWeight = calc_lighting(project_pos); v_color =vec4(a_Color.rgb*lightWeight, a_Color.w); gl_Position = project_common_position_to_clipspace(project_pos); } setPickingColor(a_PickingColor); } `;class UC extends Ml{getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{opacity:e,coverage:r,angle:n}=this.layer.getLayerConfig(),a={u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset],u_opacity:e||1,u_coverage:r||.9,u_angle:n||0};return this.getUniformsBufferInfo(a)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"heatmapGrid3d",vertexShader:zC,fragmentShader:NC,triangulation:h2,primitive:Ee.TRIANGLES,depth:{enable:!0}})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{shaderLocation:Ro.SIZE,name:"a_Size",buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"pos",type:Vr.Attribute,descriptor:{name:"a_Pos",shaderLocation:10,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:e=>{const r=e.version==="GAODE2.x"?e.originCoordinates:e.coordinates;return[r[0],r[1],0]}}})}}function ZC(t,e){const r=[],n=[],a=[],u=t+1,y=e+1,A=t/2,O=e/2;for(let Z=0;Z 1 \u7684 uv \u8F6C\u6362\u4E3A -1 -> 1 \u7684\u6807\u51C6\u5750\u6807\u7A7A\u95F4\uFF08NDC\uFF09 vec4 p1 = vec4(pos, 0.0, 1.0); // x/y \u5E73\u9762\u4E0A\u7684\u70B9\uFF08z == 0\uFF09\u53EF\u4EE5\u8BA4\u4E3A\u662F\u4E09\u7EF4\u4E0A\u7684\u70B9\u88AB\u6295\u5F71\u5230\u5E73\u9762\u540E\u7684\u70B9 vec4 p2 = vec4(pos, 1.0, 1.0); // \u5E73\u884C\u4E8Ex/y\u5E73\u9762\u3001z==1 \u7684\u5E73\u9762\u4E0A\u7684\u70B9 vec4 inverseP1 = u_InverseViewProjectionMatrix * p1; // \u6839\u636E\u89C6\u56FE\u6295\u5F71\u77E9\u9635\u7684\u9006\u77E9\u9635\u5E73\u9762\u4E0A\u7684\u53CD\u7B97\u51FA\u4E09\u7EF4\u7A7A\u95F4\u4E2D\u7684\u70B9\uFF08p1\u5E73\u9762\u4E0A\u7684\u70B9\uFF09 vec4 inverseP2 = u_InverseViewProjectionMatrix * p2; inverseP1 = inverseP1 / inverseP1.w; // \u5F52\u4E00\u5316\u64CD\u4F5C\uFF08\u5F52\u4E00\u5316\u540E\u4E3A\u4E16\u754C\u5750\u6807\uFF09 inverseP2 = inverseP2 / inverseP2.w; float zPos = (0.0 - inverseP1.z) / (inverseP2.z - inverseP1.z); // ?? vec4 position = inverseP1 + zPos * (inverseP2 - inverseP1); vec4 b= vec4(0.5000, 0.0, 1.0, 0.5000); float fh; v_intensity = texture(SAMPLER_2D(u_texture), v_texCoord).r; fh = toBezier(v_intensity, b).y; gl_Position = u_ViewProjectionMatrixUncentered * vec4(position.xy, fh * project_pixel(50.), 1.0); } `,HC=`uniform sampler2D u_texture; // \u70ED\u529B\u5F3A\u5EA6\u56FE uniform sampler2D u_colorTexture; // \u6839\u636E\u5F3A\u5EA6\u5206\u5E03\u7684\u8272\u5E26 layout(std140) uniform commonUniforms { float u_opacity; float u_common_uniforms_padding1; float u_common_uniforms_padding2; float u_common_uniforms_padding3; }; in vec2 v_texCoord; out vec4 outputColor; #pragma include "scene_uniforms" float getBlurIndusty() { float vW = 2.0/ u_ViewportSize.x; float vH = 2.0/ u_ViewportSize.y; vec2 vUv = v_texCoord; float i11 = texture(SAMPLER_2D(u_texture), vec2( vUv.x - 1.0 * vW, vUv.y + 1.0 * vH) ).r; float i12 = texture(SAMPLER_2D(u_texture), vec2( vUv.x - 0.0 * vW, vUv.y + 1.0 * vH) ).r; float i13 = texture(SAMPLER_2D(u_texture), vec2( vUv.x + 1.0 * vW, vUv.y + 1.0 * vH) ).r; float i21 = texture(SAMPLER_2D(u_texture), vec2( vUv.x - 1.0 * vW, vUv.y) ).r; float i22 = texture(SAMPLER_2D(u_texture), vec2( vUv.x , vUv.y) ).r; float i23 = texture(SAMPLER_2D(u_texture), vec2( vUv.x + 1.0 * vW, vUv.y) ).r; float i31 = texture(SAMPLER_2D(u_texture), vec2( vUv.x - 1.0 * vW, vUv.y-1.0*vH) ).r; float i32 = texture(SAMPLER_2D(u_texture), vec2( vUv.x - 0.0 * vW, vUv.y-1.0*vH) ).r; float i33 = texture(SAMPLER_2D(u_texture), vec2( vUv.x + 1.0 * vW, vUv.y-1.0*vH) ).r; return( i11 + i12 + i13 + i21 + i21 + i22 + i23 + i31 + i32 + i33 )/9.0; } void main(){ // float intensity = texture(u_texture, v_texCoord).r; float intensity = getBlurIndusty(); vec4 color = texture(SAMPLER_2D(u_colorTexture), vec2(intensity, 0.0)); outputColor = color; outputColor.a = color.a * smoothstep(0.,0.1,intensity) * u_opacity; } `,GC=` layout(location = 0) in vec3 a_Position; layout(location = 14) in vec2 a_Uv; layout(std140) uniform commonUniforms { float u_opacity; float u_common_uniforms_padding1; float u_common_uniforms_padding2; float u_common_uniforms_padding3; }; #pragma include "scene_uniforms" out vec2 v_texCoord; void main() { v_texCoord = a_Uv; #ifdef VIEWPORT_ORIGIN_TL v_texCoord.y = 1.0 - v_texCoord.y; #endif gl_Position = vec4(a_Position.xy, 0, 1.); } `,WC=`layout(std140) uniform commonUniforms { float u_radius; float u_intensity; float u_common_uniforms_padding1; float u_common_uniforms_padding2; }; in vec2 v_extrude; in float v_weight; out vec4 outputColor; #define GAUSS_COEF 0.3989422804014327 void main(){ float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude); float val = v_weight * u_intensity * GAUSS_COEF * exp(d); outputColor = vec4(val, 1., 1., 1.); } `,XC=`layout(location = 0) in vec3 a_Position; layout(location = 9) in float a_Size; layout(location = 10) in vec2 a_Dir; layout(std140) uniform commonUniforms { float u_radius; float u_intensity; float u_common_uniforms_padding1; float u_common_uniforms_padding2; }; out vec2 v_extrude; out float v_weight; #define GAUSS_COEF 0.3989422804014327 #pragma include "projection" #pragma include "picking" void main(){ vec3 picking_color_placeholder = u_PickingColor; v_weight = a_Size; float ZERO = 1.0 / 255.0 / 16.0; float extrude_x = a_Dir.x * 2.0 -1.0; float extrude_y = a_Dir.y * 2.0 -1.0; vec2 extrude_dir = normalize(vec2(extrude_x,extrude_y)); float S = sqrt(-2.0 * log(ZERO / a_Size / u_intensity / GAUSS_COEF)) / 2.5; v_extrude = extrude_dir * S; vec2 offset = project_pixel(v_extrude * u_radius); vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0)); // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0)); if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x gl_Position = u_Mvp * (vec4(project_pos.xy + offset, 0.0, 1.0)); } else { gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0)); } } `,{isEqual:qC}=es;class Aw extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"colorTexture",void 0),(0,K.Z)(this,"heatmapFramerBuffer",void 0),(0,K.Z)(this,"heatmapTexture",void 0),(0,K.Z)(this,"intensityModel",void 0),(0,K.Z)(this,"colorModel",void 0),(0,K.Z)(this,"shapeType",void 0),(0,K.Z)(this,"preRampColors",void 0),(0,K.Z)(this,"colorModelUniformBuffer",[]),(0,K.Z)(this,"heat3DModelUniformBuffer",[])}prerender(){const{clear:e,useFramebuffer:r}=this.rendererService;r(this.heatmapFramerBuffer,()=>{e({color:[0,0,0,0],depth:1,stencil:0,framebuffer:this.heatmapFramerBuffer}),this.drawIntensityMode()})}render(e){const{rampColors:r}=this.layer.getLayerConfig();qC(this.preRampColors,r)||this.updateColorTexture(),this.shapeType==="heatmap"?this.drawHeatMap(e):this.draw3DHeatMap(e)}getUninforms(){throw new Error("Method not implemented.")}initModels(){var e=this;return(0,Nr.Z)(function*(){var r;const{createFramebuffer:n,getViewportSize:a,createTexture2D:u}=e.rendererService,y=e.styleAttributeService.getLayerStyleAttribute("shape"),A=(y==null||(r=y.scale)===null||r===void 0?void 0:r.field)||"heatmap";e.shapeType=A,e.intensityModel=yield e.buildHeatMapIntensity(),e.colorModel=A==="heatmap"?e.buildHeatmap():e.build3dHeatMap();const{width:O,height:Z}=a();return e.heatmapTexture=u({width:Math.floor(O/4),height:Math.floor(Z/4),wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE,min:Ee.LINEAR,mag:Ee.LINEAR,usage:$.RENDER_TARGET}),e.heatmapFramerBuffer=n({color:e.heatmapTexture,depth:!0,width:Math.floor(O/4),height:Math.floor(Z/4)}),e.updateColorTexture(),[e.intensityModel,e.colorModel]})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initModels()})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"dir",type:Vr.Attribute,descriptor:{name:"a_Dir",shaderLocation:10,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return[r]}}})}buildHeatMapIntensity(){var e=this;return(0,Nr.Z)(function*(){return e.uniformBuffers=[e.rendererService.createBuffer({data:new Float32Array(4).fill(0),isUBO:!0})],e.layer.triangulation=ww,yield e.layer.buildLayerModel({moduleName:"heatmapIntensity",vertexShader:XC,fragmentShader:WC,triangulation:ww,depth:{enable:!1},cull:{enable:!0,face:Tl(e.mapService.version)}})})()}buildHeatmap(){this.shaderModuleService.registerModule("heatmapColor",{vs:GC,fs:HC}),this.colorModelUniformBuffer=[this.rendererService.createBuffer({data:new Float32Array(4).fill(0),isUBO:!0})];const{vs:e,fs:r,uniforms:n}=this.shaderModuleService.getModule("heatmapColor"),{createAttribute:a,createElements:u,createBuffer:y,createModel:A}=this.rendererService;return A({vs:e,fs:r,uniformBuffers:[...this.colorModelUniformBuffer,...this.rendererService.uniformBuffers],attributes:{a_Position:a({shaderLocation:Ro.POSITION,buffer:y({data:[-1,1,0,1,1,0,-1,-1,0,1,-1,0],type:Ee.FLOAT}),size:3}),a_Uv:a({shaderLocation:Ro.UV,buffer:y({data:[0,1,1,1,0,0,1,0],type:Ee.FLOAT}),size:2})},uniforms:(0,Wt.Z)({},n),depth:{enable:!1},elements:u({data:[0,2,1,2,3,1],type:Ee.UNSIGNED_INT,count:6})})}drawIntensityMode(){var e;const{intensity:r=10,radius:n=5}=this.layer.getLayerConfig(),a={u_radius:n,u_intensity:r};this.uniformBuffers[0].subData({offset:0,data:[n,r]}),this.layerService.beforeRenderData(this.layer),this.layer.hooks.beforeRender.call(),(e=this.intensityModel)===null||e===void 0||e.draw({uniforms:a,blend:{enable:!0,func:{srcRGB:Ee.ONE,srcAlpha:1,dstRGB:Ee.ONE,dstAlpha:1}},stencil:{enable:!1,mask:255,func:{cmp:514,ref:1,mask:255}}}),this.layer.hooks.afterRender.call()}drawHeatMap(e){var r;const{opacity:n=1}=this.layer.getLayerConfig(),a={u_opacity:n,u_colorTexture:this.colorTexture,u_texture:this.heatmapFramerBuffer},u=[this.heatmapTexture,this.colorTexture];this.colorModelUniformBuffer[0].subData({offset:0,data:[n]}),(r=this.colorModel)===null||r===void 0||r.draw({uniforms:a,textures:u,blend:this.getBlend(),stencil:this.getStencil(e)})}draw3DHeatMap(e){var r;const{opacity:n=1}=this.layer.getLayerConfig(),a=Kr.create();Kr.invert(a,this.cameraService.getViewProjectionMatrixUncentered());const u={u_opacity:n,u_colorTexture:this.colorTexture,u_texture:this.heatmapFramerBuffer,u_ViewProjectionMatrixUncentered:this.cameraService.getViewProjectionMatrixUncentered(),u_InverseViewProjectionMatrix:[...a]};this.heat3DModelUniformBuffer[0].subData({offset:0,data:[...u.u_ViewProjectionMatrixUncentered,...u.u_InverseViewProjectionMatrix,n]});const y=[this.heatmapTexture,this.colorTexture];(r=this.colorModel)===null||r===void 0||r.draw({uniforms:u,textures:y,blend:{enable:!0,func:{srcRGB:Ee.SRC_ALPHA,srcAlpha:1,dstRGB:Ee.ONE_MINUS_SRC_ALPHA,dstAlpha:1}},stencil:this.getStencil(e)})}build3dHeatMap(){const{getViewportSize:e}=this.rendererService,{width:r,height:n}=e(),a=ZC(r/4,n/4);this.shaderModuleService.registerModule("heatmap3dColor",{vs:jC,fs:VC}),this.heat3DModelUniformBuffer=[this.rendererService.createBuffer({data:new Float32Array(16*2+4).fill(0),isUBO:!0})];const{vs:u,fs:y,uniforms:A}=this.shaderModuleService.getModule("heatmap3dColor"),{createAttribute:O,createElements:Z,createBuffer:Y,createModel:Q}=this.rendererService;return Q({vs:u,fs:y,attributes:{a_Position:O({shaderLocation:Ro.POSITION,buffer:Y({data:a.vertices,type:Ee.FLOAT}),size:3}),a_Uv:O({shaderLocation:Ro.UV,buffer:Y({data:a.uvs,type:Ee.FLOAT}),size:2})},primitive:Ee.TRIANGLES,uniformBuffers:[...this.heat3DModelUniformBuffer,...this.rendererService.uniformBuffers],uniforms:(0,Wt.Z)({},A),depth:{enable:!0},blend:{enable:!0,func:{srcRGB:Ee.SRC_ALPHA,srcAlpha:1,dstRGB:Ee.ONE_MINUS_SRC_ALPHA,dstAlpha:1}},elements:Z({data:a.indices,type:Ee.UNSIGNED_INT,count:a.indices.length})})}updateColorTexture(){const{createTexture2D:e}=this.rendererService;this.texture&&this.texture.destroy();const{rampColors:r}=this.layer.getLayerConfig(),n=lc(r);this.colorTexture=e({data:n.data,usage:$.SAMPLED,width:n.width,height:n.height,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE,min:Ee.NEAREST,mag:Ee.NEAREST,flipY:!1,unorm:!0}),this.preRampColors=r}}const YC=`in vec4 v_color; #pragma include "picking" out vec4 outputColor; void main() { outputColor = v_color; outputColor = filterColor(outputColor); } `,$C=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 10) in vec3 a_Pos; layout(std140) uniform commonUniforms { vec2 u_radius; float u_opacity; float u_coverage; float u_angle; }; out vec4 v_color; #pragma include "projection" #pragma include "project" #pragma include "picking" void main() { v_color = a_Color; v_color.a *= u_opacity; mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle)); vec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage)); vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // vec4 project_pos = project_position(vec4(lnglat, 0, 1.0)); // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0., 1.0)); if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x // gl_Position = u_Mvp * (vec4(project_pos.xy, 0., 1.0)); // gl_Position = u_Mvp * (vec4(a_Pos.xy + offset, 0., 1.0)); vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator; vec4 project_pos = project_position(vec4(customLnglat, 0, 1.0)); gl_Position = u_Mvp * vec4(project_pos.xy, 0.0, 1.0); } else { vec4 project_pos = project_position(vec4(lnglat, 0, 1.0)); gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0., 1.0)); } setPickingColor(a_PickingColor); } `;class KC extends Ml{getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{opacity:e,coverage:r,angle:n}=this.layer.getLayerConfig(),a={u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset],u_opacity:e||1,u_coverage:r||.9,u_angle:n||0};return this.getUniformsBufferInfo(a)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"heatmapHexagon",vertexShader:$C,fragmentShader:YC,triangulation:Ew,depth:{enable:!1},primitive:Ee.TRIANGLES})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"pos",type:Vr.Attribute,descriptor:{name:"a_Pos",shaderLocation:10,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:e=>{const r=e.version==="GAODE2.x"?e.originCoordinates:e.coordinates;return[r[0],r[1],0]}}})}}var JC={heatmap:Aw,heatmap3d:Aw,grid:kC,grid3d:UC,hexagon:KC};class QC extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","HeatMapLayer")}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new JC[r](e),yield e.initLayerModels()})()}prerender(){this.getModelType()==="heatmap"&&this.layerModel&&this.layerModel.prerender()}renderModels(e={}){return this.getModelType()==="heatmap"?(this.layerModel&&this.layerModel.render(e),this):this.encodeDataLength<=0&&!this.forceRender?this:(this.hooks.beforeRender.call(),this.models.forEach(n=>n.draw({uniforms:this.layerModel.getUninforms(),blend:this.layerModel.getBlend(),stencil:this.layerModel.getStencil(e)})),this.hooks.afterRender.call(),this)}updateModelData(e){e.attributes&&e.elements?this.models[0].updateAttributesAndElements(e.attributes,e.elements):console.warn("data error")}getModelType(){var e;const r=this.styleAttributeService.getLayerStyleAttribute("shape"),{shape3d:n}=this.getLayerConfig(),u=this.getSource().data.type,y=(r==null||(e=r.scale)===null||e===void 0?void 0:e.field)||"heatmap";return y==="heatmap"||y==="heatmap3d"?"heatmap":u==="hexagon"?(n==null?void 0:n.indexOf(y))===-1?"hexagon":"grid3d":u==="grid"?(n==null?void 0:n.indexOf(y))===-1?"grid":"grid3d":"heatmap"}getLegend(e){if(this.getModelType()==="heatmap"){if(e!=="color")return{type:void 0,field:void 0,items:[]};const r=this.getLayerConfig().rampColors;return Tw(r,e)}else return super.getLegend(e)}}const e5=`uniform sampler2D u_texture; layout(std140) uniform commonUniforms { float u_opacity:1.0; float u_brightness:1.0; float u_contrast:1.0; float u_saturation:1.0; float u_gamma:1.0; }; in vec2 v_texCoord; out vec4 outputColor; vec3 setContrast(vec3 rgb, float contrast) { vec3 color = mix(vec3(0.5), rgb, contrast); color = clamp(color, 0.0, 1.0); return color; } vec3 setSaturation(vec3 rgb, float adjustment) { const vec3 grayVector = vec3(0.2125, 0.7154, 0.0721); vec3 intensity = vec3(dot(rgb, grayVector)); vec3 color = mix(intensity, rgb, adjustment); color = clamp(color, 0.0, 1.0); return color; } void main() { vec4 color = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y)); //brightness color.rgb = mix(vec3(0.0, 0.0, 0.0), color.rgb, u_brightness); //contrast color.rgb = setContrast(color.rgb, u_contrast); // saturation color.rgb = setSaturation(color.rgb, u_saturation); // gamma color.rgb = pow(color.rgb, vec3(u_gamma)); outputColor = color; outputColor.a *= u_opacity; if(outputColor.a < 0.01) discard; } `,t5=`layout(location = 0) in vec3 a_Position; layout(location = 14) in vec2 a_Uv; layout(std140) uniform commonUniforms { float u_opacity:1.0; float u_brightness:1.0; float u_contrast:1.0; float u_saturation:1.0; float u_gamma:1.0; }; out vec2 v_texCoord; #pragma include "projection" void main() { v_texCoord = a_Uv; vec4 project_pos = project_position(vec4(a_Position, 1.0)); gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0)); } `;class r5 extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0)}getCommonUniformsInfo(){const{opacity:e,brightness:r,contrast:n,saturation:a,gamma:u}=this.layer.getLayerConfig(),y={u_opacity:ho(e,1),u_brightness:ho(r,1),u_contrast:ho(n,1),u_saturation:ho(a,1),u_gamma:ho(u,1)};return this.textures=[this.texture],this.getUniformsBufferInfo(y)}initModels(){var e=this;return(0,Nr.Z)(function*(){return yield e.loadTexture(),e.buildModels()})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy()}loadTexture(){var e=this;return(0,Nr.Z)(function*(){const{createTexture2D:r}=e.rendererService;e.texture=r({height:1,width:1});const a=yield e.layer.getSource().data.images;e.texture=r({data:a[0],width:a[0].width,height:a[0].height,mag:Ee.LINEAR,min:Ee.LINEAR})})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"rasterImage",vertexShader:t5,fragmentShader:e5,triangulation:h_,primitive:Ee.TRIANGLES,blend:{enable:!0},depth:{enable:!1},pickingEnabled:!1})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}var n5={image:r5};class Cw extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","ImageLayer")}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new n5[r](e),yield e.initLayerModels()})()}getDefaultConfig(){const e=this.getModelType();return{image:{}}[e]}getModelType(){return"image"}}const i5=` #define Animate 0.0 #define LineTexture 1.0 uniform sampler2D u_texture; layout(std140) uniform commonUniorm { vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; vec4 u_dash_array; vec4 u_sourceColor; vec4 u_targetColor; vec2 u_textSize; float segmentNumber; float u_lineDir: 1.0; float u_icon_step: 100; float u_line_texture: 0.0; float u_textureBlend; float u_blur : 0.9; float u_line_type: 0.0; float u_time; float u_linearColor: 0.0; }; in vec4 v_color; in vec2 v_iconMapUV; in vec4 v_lineData; //dash in vec4 v_dash_array; in float v_distance_ratio; out vec4 outputColor; #pragma include "picking" void main() { if(u_dash_array!=vec4(0.0)){ float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w); if(!(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z))) { discard; }; } float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6 outputColor = v_color; if(u_animate.x == Animate && u_line_texture != LineTexture) { animateSpeed = u_time / u_animate.y; float alpha =1.0 - fract( mod(1.0- v_lineData.b, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y); alpha = (alpha + u_animate.w -1.0) / u_animate.w; // alpha = smoothstep(0., 1., alpha); alpha = clamp(alpha, 0.0, 1.0); outputColor.a *= alpha; } // \u5F53\u5B58\u5728\u8D34\u56FE\u65F6\u5728\u5E95\u8272\u4E0A\u8D34\u4E0A\u8D34\u56FE if(u_line_texture == LineTexture) { // while load texture float arcRadio = smoothstep( 0.0, 1.0, (v_lineData.r / segmentNumber)); // float arcRadio = smoothstep( 0.0, 1.0, d_distance_ratio); float count = v_lineData.g; // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF float time = 0.0; if(u_animate.x == Animate) { time = u_time / u_animate.y; } float redioCount = arcRadio * count; float u = fract(redioCount - time); float v = v_lineData.a; // \u6A2A\u5411 v vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.; vec4 pattern = texture(SAMPLER_2D(u_texture), uv); if(u_animate.x == Animate) { float currentPlane = floor(redioCount - time); float textureStep = floor(count * u_animate.z); float a = mod(currentPlane, textureStep); if(a < textureStep - 1.0) { pattern = vec4(0.0); } } if(u_textureBlend == 0.0) { // normal pattern.a = 0.0; outputColor = filterColor(outputColor + pattern); } else { // replace pattern.a *= v_color.a; if(outputColor.a <= 0.0) { pattern.a = 0.0; } outputColor = filterColor(pattern); } } else { outputColor = filterColor(outputColor); } }`,o5=`#define Animate 0.0 #define LineTexture 1.0 layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(location = 12) in vec4 a_Instance; layout(location = 14) in vec2 a_iconMapUV; layout(std140) uniform commonUniorm { vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; vec4 u_dash_array; vec4 u_sourceColor; vec4 u_targetColor; vec2 u_textSize; float segmentNumber; float u_lineDir: 1.0; float u_icon_step: 100; float u_line_texture: 0.0; float u_textureBlend; float u_blur : 0.9; float u_line_type: 0.0; float u_time; float u_linearColor: 0.0; }; out vec4 v_color; out vec2 v_iconMapUV; out vec4 v_lineData; //dash out vec4 v_dash_array; out float v_distance_ratio; #pragma include "projection" #pragma include "project" #pragma include "picking" float bezier3(vec3 arr, float t) { float ut = 1. - t; return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t; } vec2 midPoint(vec2 source, vec2 target, float arcThetaOffset) { vec2 center = target - source; float r = length(center); float theta = atan(center.y, center.x); float thetaOffset = arcThetaOffset; float r2 = r / 2.0 / cos(thetaOffset); float theta2 = theta + thetaOffset; vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y); if(u_lineDir == 1.0) { // \u6B63\u5411 return mid; } else { // \u9006\u5411 // (mid + vmin)/2 = (s + t)/2 vec2 vmid = source + target - mid; return vmid; } // return mid; } float getSegmentRatio(float index) { // dash: index / (segmentNumber - 1.); // normal: smoothstep(0.0, 1.0, index / (segmentNumber - 1.)); return smoothstep(0.0, 1.0, index / (segmentNumber - 1.)); // return index / (segmentNumber - 1.); } vec2 interpolate (vec2 source, vec2 target, float t, float arcThetaOffset) { // if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation vec2 mid = midPoint(source, target, arcThetaOffset); vec3 x = vec3(source.x, mid.x, target.x); vec3 y = vec3(source.y, mid.y, target.y); return vec2(bezier3(x ,t), bezier3(y,t)); } vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) { // normalized direction of the line vec2 dir_screenspace = normalize(line_clipspace); // rotate by 90 degrees dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x); vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0; return offset; } vec2 getNormal(vec2 line_clipspace, float offset_direction) { // normalized direction of the line vec2 dir_screenspace = normalize(line_clipspace); // rotate by 90 degrees dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x); return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction); } void main() { //vs\u4E2D\u8BA1\u7B97\u6E10\u53D8\u8272 if(u_linearColor==1.0){ float d_segmentIndex = a_Position.x + 1.0; // \u5F53\u524D\u9876\u70B9\u5728\u5F27\u7EBF\u4E2D\u6240\u5904\u7684\u5206\u6BB5\u4F4D\u7F6E v_color = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber); } else{ v_color = a_Color; } v_color.a = v_color.a * opacity; vec2 source = a_Instance.rg; // \u8D77\u59CB\u70B9 vec2 target = a_Instance.ba; // \u7EC8\u70B9 float segmentIndex = a_Position.x; float segmentRatio = getSegmentRatio(segmentIndex); //\u8BA1\u7B97dashArray\u548CdistanceRatio \u8F93\u51FA\u5230\u7247\u5143 vec2 s = source; vec2 t = target; if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x s = unProjCustomCoord(source); t = unProjCustomCoord(target); } float total_Distance = pixelDistance(s, t) / 2.0 * PI; v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance; v_distance_ratio = segmentIndex / segmentNumber; float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0)); float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir); float d_distance_ratio; if(u_animate.x == Animate) { d_distance_ratio = segmentIndex / segmentNumber; if(u_lineDir != 1.0) { d_distance_ratio = 1.0 - d_distance_ratio; } } v_lineData.b = d_distance_ratio; vec4 curr = project_position(vec4(interpolate(source, target, segmentRatio, thetaOffset), 0.0, 1.0)); vec4 next = project_position(vec4(interpolate(source, target, nextSegmentRatio, thetaOffset), 0.0, 1.0)); vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y)); float d_segmentIndex = a_Position.x + 1.0; // \u5F53\u524D\u9876\u70B9\u5728\u5F27\u7EBF\u4E2D\u6240\u5904\u7684\u5206\u6BB5\u4F4D\u7F6E v_lineData.r = d_segmentIndex; if(LineTexture == u_line_texture) { // \u5F00\u542F\u8D34\u56FE\u6A21\u5F0F float arcDistrance = length(source - target); // \u8D77\u59CB\u70B9\u548C\u7EC8\u70B9\u7684\u8DDD\u79BB if(u_CoordinateSystem == COORDINATE_SYSTEM_P20) { // amap arcDistrance *= 1000000.0; } if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // mapbox // arcDistrance *= 8.0; arcDistrance = project_pixel_allmap(arcDistrance); } v_iconMapUV = a_iconMapUV; float pixelLen = project_pixel_texture(u_icon_step); // \u8D34\u56FE\u6CBF\u5F27\u7EBF\u65B9\u5411\u7684\u957F\u5EA6 - \u968F\u5730\u56FE\u7F29\u653E\u6539\u53D8 float texCount = floor(arcDistrance/pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF v_lineData.g = texCount; float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB v_lineData.a = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C } gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + offset, 0, 1.0)); setPickingColor(a_PickingColor); } `,a5={solid:0,dash:1};class s5 extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"updateTexture",()=>{const{createTexture2D:r}=this.rendererService;if(this.texture){this.texture.update({data:this.iconService.getCanvas()}),this.layer.render();return}this.texture=r({data:this.iconService.getCanvas(),mag:Ee.NEAREST,min:Ee.NEAREST,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128}),this.textures=[this.texture]})}getCommonUniformsInfo(){const{sourceColor:e,targetColor:r,textureBlend:n="normal",lineType:a="solid",dashArray:u=[10,5],forward:y=!0,lineTexture:A=!1,iconStep:O=100,segmentNumber:Z=30}=this.layer.getLayerConfig(),{animateOption:Y}=this.layer.getLayerConfig();let Q=u;a!=="dash"&&(Q=[0,0]),Q.length===2&&Q.push(0,0);let ae=0,xe=[0,0,0,0],Be=[0,0,0,0];if(e&&r&&(xe=Va(e),Be=Va(r),ae=1),this.rendererService.getDirty()){var it;(it=this.texture)===null||it===void 0||it.bind()}const gt={u_animate:this.animateOption2Array(Y),u_dash_array:Q,u_sourceColor:xe,u_targetColor:Be,u_textSize:[1024,this.iconService.canvasHeight||128],segmentNumber:Z,u_lineDir:y?1:-1,u_icon_step:O,u_line_texture:A?1:0,u_textureBlend:n==="normal"?0:1,u_blur:.9,u_line_type:a5[a||"solid"],u_time:this.layer.getLayerAnimateTime()||0,u_linearColor:ae};return this.getUniformsBufferInfo(gt)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.updateTexture(),e.iconService.on("imageUpdate",e.updateTexture),e.buildModels()})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}getShaders(){return{frag:i5,vert:o5,type:""}}buildModels(){var e=this;return(0,Nr.Z)(function*(){e.initUniformsBuffer();const{segmentNumber:r=30}=e.layer.getLayerConfig(),{frag:n,vert:a,type:u}=e.getShaders();return[yield e.layer.buildLayerModel({moduleName:"lineArc2d"+u,vertexShader:a,fragmentShader:n,inject:e.getInject(),triangulation:d2,depth:{enable:!1},styleOption:{segmentNumber:r}})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:Vr.Attribute,descriptor:{name:"a_Instance",shaderLocation:12,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:4,update:(e,r,n)=>[n[3],n[4],n[5],n[6]]}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:14,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const r=this.iconService.getIconMap(),{texture:n}=e,{x:a,y:u}=r[n]||{x:0,y:0};return[a,u]}}})}}const l5=`#define LineTypeSolid 0.0 #define LineTypeDash 1.0 #define Animate 0.0 #define LineTexture 1.0 uniform sampler2D u_texture; layout(std140) uniform commonUniorm { vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; vec4 u_dash_array: [10.0, 5., 0, 0]; vec4 u_sourceColor; vec4 u_targetColor; vec2 u_textSize; float u_globel; float u_globel_radius; float u_global_height: 10; float segmentNumber; float u_line_type: 0.0; float u_icon_step: 100; float u_line_texture: 0.0; float u_textureBlend; float u_time; float u_linearColor: 0.0; }; // varying vec2 v_normal; in vec4 v_dash_array; in vec4 v_color; in vec4 v_line_data; in float v_segmentIndex; in vec2 v_iconMapUV; out vec4 outputColor; #pragma include "picking" void main() { float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6 float d_distance_ratio = v_line_data.g; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B outputColor = v_color; if(u_line_type == LineTypeDash) { float flag = 0.; float dashLength = mod(d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w); if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) { flag = 1.; } outputColor.a *=flag; } if(u_animate.x == Animate && u_line_texture != LineTexture) { animateSpeed = u_time / u_animate.y; float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y); alpha = (alpha + u_animate.w -1.0) / u_animate.w; // alpha = smoothstep(0., 1., alpha); alpha = clamp(alpha, 0.0, 1.0); outputColor.a *= alpha; // u_animate // x enable // y duration // z interval // w trailLength } if(u_line_texture == LineTexture && u_line_type != LineTypeDash) { // while load texture // float arcRadio = smoothstep( 0.0, 1.0, (v_segmentIndex / segmentNumber)); float arcRadio = v_segmentIndex / (segmentNumber - 1.0); float count = v_line_data.b; // // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF float time = 0.0; if(u_animate.x == Animate) { time = u_time / u_animate.y; } float redioCount = arcRadio * count; float u = fract(redioCount - time); float v = v_line_data.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.; vec4 pattern = texture(SAMPLER_2D(u_texture), uv); if(u_animate.x == Animate) { float currentPlane = floor(redioCount - time); float textureStep = floor(count * u_animate.z); float a = mod(currentPlane, textureStep); if(a < textureStep - 1.0) { pattern = vec4(0.0); } } if(u_textureBlend == 0.0) { // normal pattern.a = 0.0; outputColor = filterColor(outputColor + pattern); } else { // replace pattern.a *= v_color.a; if(outputColor.a <= 0.0) { pattern.a = 0.0; discard; } else { outputColor = filterColor(pattern); } } } else { outputColor = filterColor(outputColor); } } `,u5=`#define LineTypeSolid 0.0 #define LineTypeDash 1.0 #define Animate 0.0 #define LineTexture 1.0 layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(location = 12) in vec4 a_Instance; layout(location = 14) in vec2 a_iconMapUV; layout(std140) uniform commonUniorm { vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; vec4 u_dash_array: [10.0, 5., 0, 0]; vec4 u_sourceColor; vec4 u_targetColor; vec2 u_textSize; float u_globel; float u_globel_radius; float u_global_height: 10; float segmentNumber; float u_line_type: 0.0; float u_icon_step: 100; float u_line_texture: 0.0; float u_textureBlend; float u_time; float u_linearColor: 0.0; }; out vec4 v_color; out vec4 v_dash_array; out float v_segmentIndex; out vec2 v_iconMapUV; out vec4 v_line_data; #pragma include "projection" #pragma include "project" #pragma include "picking" float maps (float value, float start1, float stop1, float start2, float stop2) { return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1)); } float getSegmentRatio(float index) { return smoothstep(0.0, 1.0, index / (segmentNumber - 1.0)); } float paraboloid(vec2 source, vec2 target, float ratio) { vec2 x = mix(source, target, ratio); vec2 center = mix(source, target, 0.5); float dSourceCenter = distance(source, center); float dXCenter = distance(x, center); return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter); } vec3 getPos(vec2 source, vec2 target, float segmentRatio) { float vertex_height = paraboloid(source, target, segmentRatio); return vec3( mix(source, target, segmentRatio), sqrt(max(0.0, vertex_height)) ); } vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) { // normalized direction of the line vec2 dir_screenspace = normalize(line_clipspace); // rotate by 90 degrees dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x); vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0; return offset; } vec2 getNormal(vec2 line_clipspace, float offset_direction) { // normalized direction of the line vec2 dir_screenspace = normalize(line_clipspace); // rotate by 90 degrees dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x); return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction); } float torad(float deg) { return (deg / 180.0) * acos(-1.0); } vec3 lglt2xyz(vec2 lnglat) { float pi = 3.1415926; // + Math.PI/2 \u662F\u4E3A\u4E86\u5BF9\u9F50\u5750\u6807 float lng = torad(lnglat.x) + pi / 2.0; float lat = torad(lnglat.y); // \u624B\u52A8\u589E\u52A0\u4E00\u4E9B\u504F\u79FB\uFF0C\u51CF\u8F7B\u9762\u7684\u51B2\u7A81 float radius = u_globel_radius; float z = radius * cos(lat) * cos(lng); float x = radius * cos(lat) * sin(lng); float y = radius * sin(lat); return vec3(x, y, z); } void main() { //vs\u4E2D\u8BA1\u7B97\u6E10\u53D8\u8272 if(u_linearColor==1.0){ float d_segmentIndex = a_Position.x + 1.0; // \u5F53\u524D\u9876\u70B9\u5728\u5F27\u7EBF\u4E2D\u6240\u5904\u7684\u5206\u6BB5\u4F4D\u7F6E v_color = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber); } else{ v_color = a_Color; } v_color.a = v_color.a * opacity; vec2 source = project_position(vec4(a_Instance.rg, 0, 0)).xy; vec2 target = project_position(vec4(a_Instance.ba, 0, 0)).xy; float segmentIndex = a_Position.x; float segmentRatio = getSegmentRatio(segmentIndex); float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0)); float d_distance_ratio; if(u_line_type == LineTypeDash) { d_distance_ratio = segmentIndex / segmentNumber; vec2 s = source; vec2 t = target; if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x s = unProjCustomCoord(source); t = unProjCustomCoord(target); } float total_Distance = pixelDistance(s, t) / 2.0 * PI; v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex); } if(u_animate.x == Animate) { d_distance_ratio = segmentIndex / segmentNumber; } v_line_data.g = d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir); vec3 curr = getPos(source, target, segmentRatio); vec3 next = getPos(source, target, nextSegmentRatio); vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y); // v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y); v_segmentIndex = a_Position.x; if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { // \u5F00\u542F\u8D34\u56FE\u6A21\u5F0F float arcDistrance = length(source - target); float pixelLen = project_pixel_texture(u_icon_step); v_line_data.b = floor(arcDistrance/pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF vec2 projectOffset = project_pixel(offset); float lineOffsetWidth = length(projectOffset + projectOffset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB v_line_data.a = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C v_iconMapUV = a_iconMapUV; } gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + project_pixel(offset), curr.z * thetaOffset, 1.0)); // \u5730\u7403\u6A21\u5F0F if(u_globel > 0.0) { vec3 startLngLat = lglt2xyz(a_Instance.rg); vec3 endLngLat = lglt2xyz(a_Instance.ba); float globalRadius = length(startLngLat); vec3 lineDir = normalize(endLngLat - startLngLat); vec3 midPointDir = normalize((startLngLat + endLngLat)/2.0); // \u7EBF\u7684\u504F\u79FB vec3 lnglatOffset = cross(lineDir, midPointDir) * a_Position.y; // \u8BA1\u7B97\u8D77\u59CB\u70B9\u548C\u7EC8\u6B62\u70B9\u7684\u8DDD\u79BB float lnglatLength = length(a_Instance.rg - a_Instance.ba)/50.0; // \u8BA1\u7B97\u98DE\u7EBF\u5404\u4E2A\u8282\u70B9\u76F8\u5E94\u7684\u9AD8\u5EA6 float lineHeight = u_global_height * (-4.0*segmentRatio*segmentRatio + 4.0 * segmentRatio) * lnglatLength; // \u5730\u7403\u70B9\u4F4D vec3 globalPoint = normalize(mix(startLngLat, endLngLat, segmentRatio)) * (globalRadius + lineHeight) + lnglatOffset * a_Size; gl_Position = u_ViewProjectionMatrix * vec4(globalPoint, 1.0); } setPickingColor(a_PickingColor); } `,c5={solid:0,dash:1};class Mw extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"updateTexture",()=>{const{createTexture2D:r}=this.rendererService;if(this.texture){this.texture.update({data:this.iconService.getCanvas()}),this.layer.render();return}this.texture=r({data:this.iconService.getCanvas(),mag:Ee.NEAREST,min:Ee.NEAREST,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128}),this.textures=[this.texture]})}getCommonUniformsInfo(){const{sourceColor:e,targetColor:r,textureBlend:n="normal",lineType:a="solid",dashArray:u=[10,5],lineTexture:y=!1,iconStep:A=100,segmentNumber:O=30,globalArcHeight:Z=10}=this.layer.getLayerConfig(),{animateOption:Y}=this.layer.getLayerConfig();u.length===2&&u.push(0,0);let Q=0,ae=[0,0,0,0],xe=[0,0,0,0];if(e&&r&&(ae=Va(e),xe=Va(r),Q=1),this.rendererService.getDirty()){var Be;(Be=this.texture)===null||Be===void 0||Be.bind()}const it={u_animate:this.animateOption2Array(Y),u_dash_array:u,u_sourceColor:ae,u_targetColor:xe,u_textSize:[1024,this.iconService.canvasHeight||128],u_globel:this.mapService.version==="GLOBEL"?1:0,u_globel_radius:n1,u_global_height:Z,segmentNumber:O,u_line_type:c5[a]||0,u_icon_step:A,u_line_texture:y?1:0,u_textureBlend:n==="normal"?0:1,u_time:this.layer.getLayerAnimateTime()||0,u_linearColor:Q};return this.getUniformsBufferInfo(it)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.updateTexture(),e.iconService.on("imageUpdate",e.updateTexture),e.buildModels()})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}getShaders(){return{frag:l5,vert:u5,type:""}}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{segmentNumber:r=30}=e.layer.getLayerConfig(),{frag:n,vert:a,type:u}=e.getShaders();return[yield e.layer.buildLayerModel({moduleName:"lineArc3d"+u,vertexShader:a,fragmentShader:n,inject:e.getInject(),triangulation:d2,styleOption:{segmentNumber:r}})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:Vr.Attribute,descriptor:{name:"a_Instance",shaderLocation:12,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:4,update:(e,r,n)=>[n[3],n[4],n[5],n[6]]}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:14,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const r=this.iconService.getIconMap(),{texture:n}=e,{x:a,y:u}=r[n]||{x:0,y:0};return[a,u]}}})}}const Pw={circle:2,triangle:2,diamond:4,rect:2,classic:3,halfTriangle:2,none:0},$d=1/2;function h5(t,e){const{width:r=2,height:n=1}=e;return{vertices:[0,$d*t,1*t*r,-(n+$d)*t,1*t*r,(n-$d)*t,0,$d*t,1*t*r,-(n+$d)*t,1*t*r,(n-$d)*t],indices:[3,4,5],outLineIndices:[0,1,2],normals:[1*t,-2*t,1,-2*t,1.5*t,1,1*t,1.5*t,1,0,0,0,0,0,0,0,0,0],dimensions:2}}function p5(t,e){const{width:r=2,height:n=3}=e;return{vertices:[0,0,1*t*r,1*n,1*t*r,-1*n,0,0,1*t*r,1*n,1*t*r,-1*n],outLineIndices:[0,1,2],indices:[3,4,5],normals:[0,-1.5*t,1,2,1*t,1,-2,1*t,1,0,0,0,0,0,0,0,0,0],dimensions:2}}function f5(t,e){const{width:r=2,height:n=2}=e;return{vertices:[0,n/2,t*r*1,n/2,t*r*1,-n/2,0,-n/2,0,n/2,t*r*1,n/2,t*r*1,-n/2,0,-n/2],dimensions:2,indices:[4,5,6,4,6,7],outLineIndices:[0,1,2,0,2,3],normals:[0,-t,1,1,0,1,0,-t,1,-1,-0,1,0,0,0,0,0,0,0,0,0,0,0,0]}}function d5(t,e){const{width:r=2,height:n=3}=e;return{vertices:[0,0,1*r*t,.5*n,2*r*t,0,1*r*t,-.5*n,0,0,1*r*t,.5*n,2*r*t,0,1*r*t,-.5*n],dimensions:2,indices:[4,5,6,4,6,7],outLineIndices:[0,1,2,0,2,3],normals:[0,-t,1,1,0,1,0,-t,1,-1,-0,1,0,0,0,0,0,0,0,0,0,0,0,0]}}function m5(t,e){const{width:r=2,height:n=3}=e;return{vertices:[0,0,2*t*r,1*n,1.5*t*r,0,2*t*r,-1*n,0,0,2*t*r,1*n,1.5*t*r,0,2*t*r,-1*n],dimensions:2,indices:[4,5,6,4,6,7],outLineIndices:[0,1,2,0,2,3],normals:[0,-t,1,1,0,1,0,-t,1,-1,-0,1,0,0,0,0,0,0,0,0,0,0,0,0]}}function g5(t,e){const{width:r=2,height:n=2}=e,a=c2(),u=Rm().flatten([a]),y=Rm()(u.vertices,u.holes,u.dimensions),A=a.map(O=>[O[0]*r*t,O[1]*n]).flat();return{vertices:[...A,...A],dimensions:2,indices:y.map(O=>O+a.length),outLineIndices:y,normals:[...a.map(O=>[O[1]*n,O[0]*r*t,1]).flat(),...new Array(a.length*3).fill(0)]}}function v5(t,e=0,r){const n=typeof r.source=="object"?r.source.type:r.source,a=typeof r.target=="object"?r.target.type:r.target,{width:u=n?Pw[n]:0}=typeof r.source=="object"?r.source:{},{width:y=a?Pw[a]:0}=typeof r.target=="object"?r.target:{};return{vertices:[0,$d,1*u,...t,1,$d,-1*y,...t,1,-$d,-1*y,...t,0,-$d,1*u,...t,0,$d,1*u,...t,1,$d,-1*y,...t,1,-$d,-1*y,...t,0,-$d,1*u,...t],outLineIndices:[0,1,2,0,2,3].map(A=>A+e),indices:[4,5,6,4,6,7].map(A=>A+e),normals:[1,-1,1,1,1,1,-1,0,1,-1,0,1,0,0,0,0,0,0,0,0,0,0,0,0],dimensions:2}}function Rw(t,e){const r=typeof t=="object"?t.type:t,n=e==="source"?1:-1,a=typeof t=="object"?t:{};switch(r){case"circle":return g5(n,a);case"triangle":return p5(n,a);case"diamond":return d5(n,a);case"rect":return f5(n,a);case"classic":return m5(n,a);case"halfTriangle":return h5(n,a);default:return{vertices:[],indices:[],normals:[],dimensions:2,outLineIndices:[],outLineNormals:[]}}}function _5(t){const e=t.coordinates.flat(),r=1,n=1;return{vertices:[1,0,0,...e,1,2,-3,...e,1,1,-3,...e,0,1,0,...e,0,0,0,...e,1,0,0,...e,1,2,-3,...e,1,1,-3,...e,0,1,0,...e,0,0,0,...e],normals:[-r,2*n,1,2*n,-n,1,n,-n,1,n,-n,1,-r,-n,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],indices:[0,1,2,0,2,3,0,3,4,5,6,7,5,7,8,5,8,9],size:7}}function y5(t,e){return e?x5(t,e):_5(t)}function x5(t,e){const r=t.coordinates.flat(),{target:n="classic",source:a="circle"}=e,u=Iw(Rw(a,"source"),r,0,0),y=v5(r,u.vertices.length/7,e),A=Iw(Rw(n,"target"),r,1,u.vertices.length/7+y.vertices.length/7);return{vertices:[...u.vertices,...y.vertices,...A.vertices],indices:[...u.outLineIndices,...y.outLineIndices,...A.outLineIndices,...u.indices,...y.indices,...A.indices],normals:[...u.normals,...y.normals,...A.normals],size:7}}function Iw(t,e,r=1,n=0){const a=[],{vertices:u,indices:y,dimensions:A,outLineIndices:O}=t;for(let Z=0;ZZ+n),outLineIndices:O.map(Z=>Z+n)})}const b5=`// #extension GL_OES_standard_derivatives : enable in vec4 v_color; out vec4 outputColor; // line texture #pragma include "picking" void main() { outputColor = v_color; outputColor = filterColor(outputColor); } `,E5=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in vec2 a_Size; layout(location = 12) in vec4 a_Instance; layout(location = 13) in vec3 a_Normal; layout(std140) uniform commonUniorm { float u_gap_width: 1.0; float u_stroke_width: 1.0; float u_stroke_opacity: 1.0; }; #pragma include "projection" #pragma include "project" #pragma include "picking" out vec4 v_color; vec2 project_pixel_offset(vec2 offsets) { vec2 data = project_pixel(offsets); if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3 return data; } return vec2(data.x, -data.y);; } vec2 line_dir(vec2 target, vec2 source) { if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3 return normalize(target - source); } return normalize(ProjectFlat(target) - ProjectFlat(source)); } float flag_gap() { if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3 return 1.; } return -1.; } void main() { // \u900F\u660E\u5EA6\u8BA1\u7B97 vec2 source = a_Instance.rg; // \u8D77\u59CB\u70B9 vec2 target = a_Instance.ba; // \u7EC8\u70B9 vec2 flowlineDir = line_dir(target,source); vec2 perpendicularDir = vec2(-flowlineDir.y, flowlineDir.x); // mapbox || \u9AD8\u5FB7 vec2 position = mix(source, target, a_Position.x); float lengthCommon = length(project_position(vec4(target,0,1)) - project_position(vec4(source,0,1))); // vec2 offsetDistances = a_Size.x * project_pixel_offset(vec2(a_Position.y, a_Position.z)); // Mapbox || \u9AD8\u5FB7 vec2 limitedOffsetDistances = clamp( offsetDistances, project_pixel(-lengthCommon*.2), project_pixel(lengthCommon*.2) ); float startOffsetCommon = project_pixel(offsets[0]); float endOffsetCommon = project_pixel(offsets[1]); float endpointOffset = mix( clamp(startOffsetCommon, 0.0, lengthCommon*.2), -clamp(endOffsetCommon, 0.0, lengthCommon*.2), a_Position.x ); vec2 normalsCommon = u_stroke_width * project_pixel_offset(vec2(a_Normal.x, a_Normal.y)); // mapbox || \u9AD8\u5FB7 float gapCommon = flag_gap() * project_pixel(u_gap_width); vec3 offsetCommon = vec3( flowlineDir * (limitedOffsetDistances[1] + normalsCommon.y + endpointOffset * 1.05) - perpendicularDir * (limitedOffsetDistances[0] + gapCommon + normalsCommon.x), 0.0 ); vec4 project_pos = project_position(vec4(position.xy, 0, 1.0)); vec4 fillColor = vec4(a_Color.rgb, a_Color.a * opacity); v_color = mix(fillColor, vec4(u_stroke.xyz, u_stroke.w * fillColor.w * u_stroke_opacity), a_Normal.z); gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offsetCommon.xy, 0., 1.0)); setPickingColor(a_PickingColor); } `;class w5 extends Ml{getCommonUniformsInfo(){const{gapWidth:e=2,strokeWidth:r=1,strokeOpacity:n=1}=this.layer.getLayerConfig(),a={u_gap_width:e,u_stroke_width:r,u_stroke_opacity:n};return this.getUniformsBufferInfo(a)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return[yield e.layer.buildLayerModel({moduleName:"flow_line",vertexShader:E5,fragmentShader:b5,inject:e.getInject(),triangulation:y5,styleOption:e.layer.getLayerConfig().symbol,primitive:Ee.TRIANGLES,depth:{enable:!1},pick:!1})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0],r[1]]:[r,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:Vr.Attribute,descriptor:{name:"a_Instance",shaderLocation:12,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:4,update:(e,r,n)=>[n[3],n[4],n[5],n[6]]}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}})}}const S5=`#define LineTypeSolid 0.0 #define LineTypeDash 1.0 #define Animate 0.0 #define LineTexture 1.0 uniform sampler2D u_texture; layout(std140) uniform commonUniorm { vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; vec4 u_dash_array: [10.0, 5., 0, 0]; vec4 u_sourceColor; vec4 u_targetColor; vec2 u_textSize; float segmentNumber; float u_line_type: 0.0; float u_icon_step: 100; float u_line_texture: 0.0; float u_textureBlend; float u_time; float u_linearColor: 0; }; in vec4 v_line_data; in vec2 v_iconMapUV; in vec4 v_dash_array; in float v_distance_ratio; in vec4 v_color; out vec4 outputColor; #pragma include "picking" #pragma include "project" #pragma include "projection" void main() { float animateSpeed = 0.0; float d_segmentIndex = v_line_data.g; // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u5E95\u8272 if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272 outputColor = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber); outputColor.a *= v_color.a; } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272 outputColor = v_color; } // float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy)); // float blur = smoothstep(1.0, u_blur, length(v_normal.xy)); if(u_line_type == LineTypeDash) { float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w); if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) { // \u5B9E\u7EBF\u90E8\u5206 } else { // \u865A\u7EBF\u90E8\u5206 discard; }; } // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u52A8\u753B\u6A21\u5F0F if(u_animate.x == Animate) { animateSpeed = u_time / u_animate.y; float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y); alpha = (alpha + u_animate.w -1.0) / u_animate.w; alpha = smoothstep(0., 1., alpha); outputColor.a *= alpha; } // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u8D34\u56FE if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { float arcRadio = smoothstep( 0.0, 1.0, (d_segmentIndex / (segmentNumber - 1.0))); // float arcRadio = d_segmentIndex / (segmentNumber - 1.0); float count = v_line_data.b; // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF float u = fract(arcRadio * count - animateSpeed * count); // float u = fract(arcRadio * count - animateSpeed); if(u_animate.x == Animate) { u = outputColor.a/v_color.a; } float v = v_line_data.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.; vec4 pattern = texture(SAMPLER_2D(u_texture), uv); // \u8BBE\u7F6E\u8D34\u56FE\u548C\u5E95\u8272\u7684\u53E0\u52A0\u6A21\u5F0F if(u_textureBlend == 0.0) { // normal pattern.a = 0.0; outputColor = filterColor(outputColor + pattern); } else { // replace pattern.a *= v_color.a; if(outputColor.a <= 0.0) { pattern.a = 0.0; } outputColor = filterColor(pattern); } } else { outputColor = filterColor(outputColor); } // gl_FragColor = filterColor(gl_FragColor); }`,T5=`#define LineTypeSolid 0.0 #define LineTypeDash 1.0 #define Animate 0.0 #define LineTexture 1.0 layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(location = 12) in vec4 a_Instance; layout(location = 14) in vec2 a_iconMapUV; layout(std140) uniform commonUniorm { vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; vec4 u_dash_array: [10.0, 5., 0, 0]; vec4 u_sourceColor; vec4 u_targetColor; vec2 u_textSize; float segmentNumber; float u_line_type: 0.0; float u_icon_step: 100; float u_line_texture: 0.0; float u_textureBlend; float u_time; float u_linearColor: 0; }; out vec4 v_dash_array; out vec4 v_color; out vec2 v_iconMapUV; out vec4 v_line_data; out float v_distance_ratio; #pragma include "projection" #pragma include "project" #pragma include "picking" float maps (float value, float start1, float stop1, float start2, float stop2) { return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1)); } float getSegmentRatio(float index) { return index / (segmentNumber - 1.); } float paraboloid(vec2 source, vec2 target, float ratio) { vec2 x = mix(source, target, ratio); vec2 center = mix(source, target, 0.5); float dSourceCenter = distance(source, center); float dXCenter = distance(x, center); return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter); } vec3 getPos(vec2 source, vec2 target, float segmentRatio) { float vertex_height = paraboloid(source, target, segmentRatio); return vec3( mix(source, target, segmentRatio), sqrt(max(0.0, vertex_height)) ); } vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) { // normalized direction of the line vec2 dir_screenspace = normalize(line_clipspace); // rotate by 90 degrees dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x); vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size)/ 2.0; return offset; } vec2 getNormal(vec2 line_clipspace, float offset_direction) { // normalized direction of the line vec2 dir_screenspace = normalize(line_clipspace); // rotate by 90 degrees dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x); return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction); } float getAngularDist (vec2 source, vec2 target) { vec2 delta = source - target; vec2 sin_half_delta = sin(delta / 2.0); float a = sin_half_delta.y * sin_half_delta.y + cos(source.y) * cos(target.y) * sin_half_delta.x * sin_half_delta.x; return 2.0 * atan(sqrt(a), sqrt(1.0 - a)); } vec2 midPoint(vec2 source, vec2 target) { vec2 center = target - source; float r = length(center); float theta = atan(center.y, center.x); float thetaOffset = 0.314; float r2 = r / 2.0 / cos(thetaOffset); float theta2 = theta + thetaOffset; vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y); return mid; } float bezier3(vec3 arr, float t) { float ut = 1. - t; return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t; } vec2 interpolate (vec2 source, vec2 target, float angularDist, float t) { // if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x vec2 mid = midPoint(source, target); vec3 x = vec3(source.x, mid.x, target.x); vec3 y = vec3(source.y, mid.y, target.y); return vec2(bezier3(x ,t), bezier3(y,t)); } else { if(abs(angularDist - PI) < 0.001) { return (1.0 - t) * source + t * target; } float a = sin((1.0 - t) * angularDist) / sin(angularDist); float b = sin(t * angularDist) / sin(angularDist); vec2 sin_source = sin(source); vec2 cos_source = cos(source); vec2 sin_target = sin(target); vec2 cos_target = cos(target); float x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x; float y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x; float z = a * sin_source.y + b * sin_target.y; return vec2(atan(y, x), atan(z, sqrt(x * x + y * y))); } } void main() { v_color = a_Color; v_color.a = v_color.a * opacity; vec2 source = radians(a_Instance.rg); vec2 target = radians(a_Instance.ba); float angularDist = getAngularDist(source, target); float segmentIndex = a_Position.x; float segmentRatio = getSegmentRatio(segmentIndex); float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0)); if(u_line_type == LineTypeDash) { v_distance_ratio = segmentIndex / segmentNumber; vec2 s = source; vec2 t = target; if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x s = unProjCustomCoord(source); t = unProjCustomCoord(target); } float total_Distance = pixelDistance(s, t) / 2.0 * PI; total_Distance = total_Distance*16.0; // total_Distance*16.0 \u8C03\u6574\u9ED8\u8BA4\u7684\u6548\u679C v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance; } if(u_animate.x == Animate) { v_distance_ratio = segmentIndex / segmentNumber; } float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir); v_distance_ratio = segmentIndex / segmentNumber; vec4 curr = project_position(vec4(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0, 1.0)); vec4 next = project_position(vec4(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0, 1.0)); // v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y); vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y)); // vec4 project_pos = project_position(vec4(curr.xy, 0, 1.0)); // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0)); v_line_data.g = a_Position.x; // \u8BE5\u9876\u70B9\u5728\u5F27\u7EBF\u4E0A\u7684\u5206\u6BB5\u6392\u5E8F if(LineTexture == u_line_texture) { // \u5F00\u542F\u8D34\u56FE\u6A21\u5F0F // float mapZoomScale = u_CoordinateSystem !== COORDINATE_SYSTEM_P20_2?10000000.0:1.0; float d_arcDistrance = length(source - target); if(u_CoordinateSystem == COORDINATE_SYSTEM_P20) { // amap d_arcDistrance = d_arcDistrance * 1000000.0; } if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // mapbox d_arcDistrance = project_pixel_allmap(d_arcDistrance); } float d_pixelLen = project_pixel(u_icon_step)/8.0; v_line_data.b = floor(d_arcDistrance/d_pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB v_line_data.a = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C v_iconMapUV = a_iconMapUV; } gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + offset, 0, 1.0)); setPickingColor(a_PickingColor); } `,A5={solid:0,dash:1};class C5 extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"updateTexture",()=>{const{createTexture2D:r}=this.rendererService;if(this.texture){this.texture.update({data:this.iconService.getCanvas()}),this.layer.render();return}this.texture=r({data:this.iconService.getCanvas(),mag:Ee.NEAREST,min:Ee.NEAREST,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128}),this.textures=[this.texture]})}getCommonUniformsInfo(){const{sourceColor:e,targetColor:r,textureBlend:n="normal",lineType:a="solid",dashArray:u=[10,5],lineTexture:y=!1,iconStep:A=100,segmentNumber:O=30}=this.layer.getLayerConfig(),{animateOption:Z}=this.layer.getLayerConfig();if(u.length===2&&u.push(0,0),this.rendererService.getDirty()){var Y;(Y=this.texture)===null||Y===void 0||Y.bind()}let Q=0,ae=[0,0,0,0],xe=[0,0,0,0];e&&r&&(ae=Va(e),xe=Va(r),Q=1);let Be=this.layer.getLayerAnimateTime();isNaN(Be)&&(Be=0);const it={u_animate:this.animateOption2Array(Z),u_dash_array:u,u_sourceColor:ae,u_targetColor:xe,u_textSize:[1024,this.iconService.canvasHeight||128],segmentNumber:O,u_line_type:A5[a]||0,u_icon_step:A,u_line_texture:y?1:0,u_textureBlend:n==="normal"?0:1,u_time:Be,u_linearColor:Q};return this.getUniformsBufferInfo(it)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.updateTexture(),e.iconService.on("imageUpdate",e.updateTexture),e.buildModels()})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{segmentNumber:r=30}=e.layer.getLayerConfig();return[yield e.layer.buildLayerModel({moduleName:"lineGreatCircle",vertexShader:T5,fragmentShader:S5,triangulation:d2,styleOption:{segmentNumber:r},inject:e.getInject(),depth:{enable:!1}})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:Vr.Attribute,descriptor:{name:"a_Instance",shaderLocation:12,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:4,update:(e,r,n)=>[n[3],n[4],n[5],n[6]]}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:14,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const r=this.iconService.getIconMap(),{texture:n}=e,{x:a,y:u}=r[n]||{x:0,y:0};return[a,u]}}})}}const M5=`// #extension GL_OES_standard_derivatives : enable #define Animate 0.0 #define LineTexture 1.0 uniform sampler2D u_texture; layout(std140) uniform commonUniorm { vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; vec4 u_dash_array; vec4 u_blur; vec4 u_sourceColor; vec4 u_targetColor; vec2 u_textSize; float u_icon_step: 100; float u_heightfixed: 0.0; float u_vertexScale: 1.0; float u_raisingHeight: 0.0; float u_strokeWidth: 0.0; float u_textureBlend; float u_line_texture; float u_linearDir: 1.0; float u_linearColor: 0; float u_time; }; in vec4 v_color; in vec4 v_stroke; // dash in vec4 v_dash_array; in float v_d_distance_ratio; in vec2 v_iconMapUV; in vec4 v_texture_data; out vec4 outputColor; #pragma include "picking" // [animate, duration, interval, trailLength], void main() { if(u_dash_array!=vec4(0.0)){ float dashLength = mod(v_d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w); if(!(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z))) { // \u865A\u7EBF\u90E8\u5206 discard; }; } float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6 float d_distance_ratio = v_texture_data.r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B if(u_linearDir < 1.0) { d_distance_ratio = v_texture_data.a; } if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272 outputColor = mix(u_sourceColor, u_targetColor, d_distance_ratio); outputColor.a *= v_color.a; } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272 outputColor = v_color; } // anti-alias // float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy)); if(u_animate.x == Animate) { animateSpeed = u_time / u_animate.y; float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed); alpha = (alpha + u_animate.w -1.0) / u_animate.w; alpha = smoothstep(0., 1., alpha); outputColor.a *= alpha; } if(u_line_texture == LineTexture) { // while load texture float aDistance = v_texture_data.g; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB float d_texPixelLen = v_texture_data.b; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed); float v = v_texture_data.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C // v = max(smoothstep(0.95, 1.0, v), v); vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.; vec4 pattern = texture(SAMPLER_2D(u_texture), uv); if(u_textureBlend == 0.0) { // normal pattern.a = 0.0; outputColor += pattern; } else { // replace pattern.a *= v_color.a; if(outputColor.a <= 0.0) { pattern.a = 0.0; } outputColor = pattern; } } float v = v_texture_data.a; float strokeWidth = min(0.5, u_strokeWidth); // \u7ED8\u5236 border if(strokeWidth > 0.01) { float borderOuterWidth = strokeWidth / 2.0; if(v >= 1.0 - strokeWidth || v <= strokeWidth) { if(v > strokeWidth) { // \u5916\u4FA7 float linear = smoothstep(0.0, 1.0, (v - (1.0 - strokeWidth))/strokeWidth); // float linear = step(0.0, (v - (1.0 - borderWidth))/borderWidth); outputColor.rgb = mix(outputColor.rgb, v_stroke.rgb, linear); } else if(v <= strokeWidth) { float linear = smoothstep(0.0, 1.0, v/strokeWidth); outputColor.rgb = mix(v_stroke.rgb, outputColor.rgb, linear); } } if(v < borderOuterWidth) { outputColor.a = mix(0.0, outputColor.a, v/borderOuterWidth); } else if(v > 1.0 - borderOuterWidth) { outputColor.a = mix(outputColor.a, 0.0, (v - (1.0 - borderOuterWidth))/borderOuterWidth); } } // blur float blurV = v_texture_data.a; if(blurV < 0.5) { outputColor.a *= mix(u_blur.r, u_blur.g, blurV/0.5); } else { outputColor.a *= mix(u_blur.g, u_blur.b, (blurV - 0.5)/0.5); } outputColor = filterColor(outputColor); } `,P5=` #define Animate 0.0 layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in vec2 a_Size; layout(location = 10) in vec3 a_DistanceAndIndexAndMiter; layout(location = 13) in vec4 a_Normal_Total_Distance; layout(location = 14) in vec2 a_iconMapUV; layout(std140) uniform commonUniorm { vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; vec4 u_dash_array; vec4 u_blur; vec4 u_sourceColor; vec4 u_targetColor; vec2 u_textSize; float u_icon_step: 100; float u_heightfixed: 0.0; float u_vertexScale: 1.0; float u_raisingHeight: 0.0; float u_strokeWidth: 0.0; float u_textureBlend; float u_line_texture; float u_linearDir: 1.0; float u_linearColor: 0; float u_time; }; out vec4 v_color; out vec4 v_stroke; //dash out vec4 v_dash_array; out float v_d_distance_ratio; // texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09 out vec2 v_iconMapUV; out vec4 v_texture_data; #pragma include "projection" #pragma include "picking" void main() { vec2 a_DistanceAndIndex = a_DistanceAndIndexAndMiter.xy; float a_Miter = a_DistanceAndIndexAndMiter.z; vec3 a_Normal = a_Normal_Total_Distance.xyz; float a_Total_Distance = a_Normal_Total_Distance.w; //dash\u8F93\u51FA v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance; v_d_distance_ratio = a_DistanceAndIndex.x / a_Total_Distance; // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97 float d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E v_iconMapUV = a_iconMapUV; d_texPixelLen = project_float_pixel(u_icon_step); if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { d_texPixelLen *= 10.0; } v_color = a_Color; v_color.a *= opacity; v_stroke = stroke; vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal); vec2 offset = project_pixel(size.xy); float lineDistance = a_DistanceAndIndex.x; float currentLinePointRatio = lineDistance / a_Total_Distance; float lineOffsetWidth = length(offset + offset * sign(a_Miter)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB\uFF08\u5411\u4E24\u4FA7\u504F\u79FB\u7684\u548C\uFF09 float linePixelSize = project_pixel(a_Size.x) * 2.0; // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB \u5355\u4FA7 * 2 float texV = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C v_texture_data = vec4(currentLinePointRatio, lineDistance, d_texPixelLen, texV); // \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570 vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0)); // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0)); float h = float(a_Position.z) * u_vertexScale; // \u7EBF\u9876\u70B9\u7684\u9AD8\u5EA6 - \u517C\u5BB9\u4E0D\u5B58\u5728\u7B2C\u4E09\u4E2A\u6570\u503C\u7684\u60C5\u51B5 vertex height float lineHeight = a_Size.y; // size \u7B2C\u4E8C\u4E2A\u53C2\u6570\u4EE3\u8868\u7684\u9AD8\u5EA6 [linewidth, lineheight] if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x lineHeight *= 0.2; // \u4FDD\u6301\u548C amap/mapbox \u4E00\u81F4\u7684\u6548\u679C h *= 0.2; if(u_heightfixed < 1.0) { lineHeight = project_pixel(a_Size.y); } gl_Position = u_Mvp * (vec4(project_pos.xy + offset, lineHeight + h + u_raisingHeight, 1.0)); } else { // \u517C\u5BB9 mapbox \u5728\u7EBF\u9AD8\u5EA6\u4E0A\u7684\u6548\u679C\u8868\u73B0\u57FA\u672C\u4E00\u81F4 if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // mapbox // \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8 float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom); h *= mapboxZoomScale; h += u_raisingHeight * mapboxZoomScale; if(u_heightfixed > 0.0) { lineHeight *= mapboxZoomScale; } } else { // amap h += u_raisingHeight; // lineHeight \u9876\u70B9\u504F\u79FB\u9AD8\u5EA6 if(u_heightfixed < 1.0) { lineHeight *= pow(2.0, 20.0 - u_Zoom); } } gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, lineHeight + h, 1.0)); } setPickingColor(a_PickingColor); } `;class Lw extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"textureEventFlag",!1),(0,K.Z)(this,"texture",this.createTexture2D({data:new Uint8Array([0,0,0,0]),width:1,height:1})),(0,K.Z)(this,"updateTexture",()=>{const{createTexture2D:r}=this.rendererService;if(this.textures.length===0&&(this.textures=[this.texture]),this.texture){this.texture.update({data:this.iconService.getCanvas()}),this.layer.render();return}this.texture=r({data:this.iconService.getCanvas(),mag:Ee.NEAREST,min:Ee.NEAREST,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128})})}getCommonUniformsInfo(){const{sourceColor:e,targetColor:r,textureBlend:n="normal",lineType:a="solid",dashArray:u=[10,5,0,0],lineTexture:y=!1,iconStep:A=100,vertexHeightScale:O=20,strokeWidth:Z=0,raisingHeight:Y=0,heightfixed:Q=!1,linearDir:ae=s2.VERTICAL,blur:xe=[1,1,1,0]}=this.layer.getLayerConfig();let Be=u;if(a!=="dash"&&(Be=[0,0,0,0]),Be.length===2&&Be.push(0,0),this.rendererService.getDirty()&&this.texture){var it;(it=this.texture)===null||it===void 0||it.bind()}const{animateOption:gt}=this.layer.getLayerConfig();let Bt=0,Rt=[0,0,0,0],Yt=[0,0,0,0];e&&r&&(Rt=Va(e),Yt=Va(r),Bt=1);const vr={u_animate:this.animateOption2Array(gt),u_dash_array:Be,u_blur:xe,u_sourceColor:Rt,u_targetColor:Yt,u_textSize:[1024,this.iconService.canvasHeight||128],u_icon_step:A,u_heightfixed:Number(Q),u_vertexScale:O,u_raisingHeight:Number(Y),u_strokeWidth:Z,u_textureBlend:n===uw.NORMAL?0:1,u_line_texture:y?1:0,u_linearDir:ae===s2.VERTICAL?1:0,u_linearColor:Bt,u_time:this.layer.getLayerAnimateTime()||0};return this.getUniformsBufferInfo(vr)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.textureEventFlag||(e.textureEventFlag=!0,e.updateTexture(),e.iconService.on("imageUpdate",e.updateTexture)),e.buildModels()})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{depth:r=!1}=e.layer.getLayerConfig(),{frag:n,vert:a,type:u}=e.getShaders();return e.layer.triangulation=p2,[yield e.layer.buildLayerModel({moduleName:"line"+u,vertexShader:a,fragmentShader:n,triangulation:p2,inject:e.getInject(),depth:{enable:r}})]})()}getShaders(){return{frag:M5,vert:P5,type:""}}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"distanceAndIndex",type:Vr.Attribute,descriptor:{name:"a_DistanceAndIndexAndMiter",shaderLocation:10,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u,y)=>y===void 0?[n[3],10,n[4]]:[n[3],y,n[4]]}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0],r[1]]:[r,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal_total_distance",type:Vr.Attribute,descriptor:{name:"a_Normal_Total_Distance",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:4,update:(e,r,n,a,u)=>[...u,n[5]]}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const r=this.iconService.getIconMap(),{texture:n}=e,{x:a,y:u}=r[n]||{x:0,y:0};return[a,u]}}})}}const R5=` layout(std140) uniform commonUniorm { vec4 u_sourceColor; vec4 u_targetColor; vec4 u_dash_array; float u_vertexScale: 1.0; float u_linearColor: 0; }; in float v_distanceScale; in vec4 v_color; //dash in vec4 v_dash_array; out vec4 outputColor; void main() { if(u_dash_array!=vec4(0.0)){ float dashLength = mod(v_distanceScale, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w); if(!(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z))) { // \u865A\u7EBF\u90E8\u5206 discard; }; } if(u_linearColor==1.0){ outputColor = mix(u_sourceColor, u_targetColor, v_distanceScale); outputColor.a *= v_color.a; // \u5168\u5C40\u900F\u660E\u5EA6 } else{ outputColor = v_color; } } `,I5=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in vec4 a_SizeDistanceAndTotalDistance; layout(std140) uniform commonUniorm { vec4 u_sourceColor; vec4 u_targetColor; vec4 u_dash_array; float u_vertexScale: 1.0; float u_linearColor: 0; }; #pragma include "projection" #pragma include "picking" out vec4 v_color; out float v_distanceScale; out vec4 v_dash_array; void main() { //dash\u8F93\u51FA v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_SizeDistanceAndTotalDistance.a; v_color = a_Color; v_distanceScale = a_SizeDistanceAndTotalDistance.b / a_SizeDistanceAndTotalDistance.a; v_color.a = v_color.a * opacity; vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0)); float h = float(a_Position.z) * u_vertexScale; // \u7EBF\u9876\u70B9\u7684\u9AD8\u5EA6 - \u517C\u5BB9\u4E0D\u5B58\u5728\u7B2C\u4E09\u4E2A\u6570\u503C\u7684\u60C5\u51B5 if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x gl_Position = u_Mvp * (vec4(project_pos.xy, project_pixel(a_SizeDistanceAndTotalDistance.y) + h * 0.2, 1.0)); } else { float lineHeight = a_SizeDistanceAndTotalDistance.y; // \u517C\u5BB9 mapbox \u5728\u7EBF\u9AD8\u5EA6\u4E0A\u7684\u6548\u679C\u8868\u73B0\u57FA\u672C\u4E00\u81F4 if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8 h *= 2.0/pow(2.0, 20.0 - u_Zoom); } // amap1.x if(u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) { // \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8 lineHeight *= pow(2.0, 20.0 - u_Zoom); } gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, lineHeight + h, 1.0)); gl_PointSize = 10.0; } } `;class L5 extends Ml{getCommonUniformsInfo(){const{sourceColor:e,targetColor:r,lineType:n="solid",dashArray:a=[10,5,0,0],vertexHeightScale:u=20}=this.layer.getLayerConfig();let y=a;n!=="dash"&&(y=[0,0,0,0]),y.length===2&&y.push(0,0);let A=0,O=[0,0,0,0],Z=[0,0,0,0];e&&r&&(O=Va(e),Z=Va(r),A=1);const Y={u_sourceColor:O,u_targetColor:Z,u_dash_array:y,u_vertexScale:u,u_linearColor:A};return this.getUniformsBufferInfo(Y)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}getShaders(){return{frag:R5,vert:I5,type:"lineSimpleNormal"}}buildModels(){var e=this;return(0,Nr.Z)(function*(){e.initUniformsBuffer();const{frag:r,vert:n,type:a}=e.getShaders();return[yield e.layer.buildLayerModel({moduleName:a,vertexShader:n,fragmentShader:r,triangulation:hC,inject:e.getInject(),primitive:Ee.LINES,depth:{enable:!1},pick:!1})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"sizeDistanceAndTotalDistance",type:Vr.Attribute,descriptor:{name:"a_SizeDistanceAndTotalDistance",shaderLocation:Ro.SIZE,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:4,update:(e,r,n)=>{const{size:a=1}=e,u=Array.isArray(a)?[a[0],a[1]]:[a,0];return[u[0],u[1],n[3],n[5]]}}})}}const D5=`#define Animate 0.0 #define LineTexture 1.0 // line texture uniform sampler2D u_texture; layout(std140) uniform commonUniorm { vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; vec4 u_sourceColor; vec4 u_targetColor; vec2 u_textSize; float u_icon_step: 100; float u_heightfixed; float u_linearColor: 0; float u_line_texture; float u_textureBlend; float u_iconStepCount; float u_time; }; in vec2 v_iconMapUV; in float v_blur; in float v_radio; in vec4 v_color; in vec4 v_dataset; out vec4 outputColor; #pragma include "picking" void main() { float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6 float d_distance_ratio = v_dataset.r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B float v = v_dataset.a; if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272 outputColor = mix(u_sourceColor, u_targetColor, v); } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272 outputColor = v_color; } outputColor.a *= v_color.a; // \u5168\u5C40\u900F\u660E\u5EA6 if(u_animate.x == Animate) { animateSpeed = u_time / u_animate.y; float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed); alpha = (alpha + u_animate.w -1.0) / u_animate.w; alpha = smoothstep(0., 1., alpha); outputColor.a *= alpha; } if(u_line_texture == LineTexture) { // while load texture float aDistance = v_dataset.g; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB float d_texPixelLen = v_dataset.b; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed); float v = v_dataset.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C // \u8BA1\u7B97\u7EB9\u7406\u95F4\u9694 start float flag = 0.0; if(u > 1.0/u_iconStepCount) { flag = 1.0; } u = fract(u*u_iconStepCount); // \u8BA1\u7B97\u7EB9\u7406\u95F4\u9694 end vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.; vec4 pattern = texture(SAMPLER_2D(u_texture), uv); // Tip: \u5224\u65AD\u7EB9\u7406\u95F4\u9694 if(flag > 0.0) { pattern = vec4(0.0); } if(u_textureBlend == 0.0) { // normal pattern.a = 0.0; outputColor = filterColor(outputColor + pattern); } else { // replace pattern.a *= v_color.a; if(outputColor.a <= 0.0) { pattern.a = 0.0; } outputColor = filterColor(pattern); } } // blur - AA if(v < v_blur) { outputColor.a = mix(0.0, outputColor.a, v/v_blur); } else if(v > 1.0 - v_blur) { outputColor.a = mix(outputColor.a, 0.0, (v - (1.0 - v_blur))/v_blur); } outputColor = filterColor(outputColor); } `,O5=`#define Animate 0.0 layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in vec2 a_Size; layout(location = 10) in float a_Miter; layout(location = 11) in float a_Total_Distance; layout(location = 12) in vec4 a_Instance; layout(location = 13) in vec3 a_Normal; layout(location = 14) in vec2 a_iconMapUV; layout(location = 15) in float a_Distance; layout(std140) uniform commonUniorm { vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; vec4 u_sourceColor; vec4 u_targetColor; vec2 u_textSize; float u_icon_step: 100; float u_heightfixed; float u_linearColor: 0; float u_line_texture; float u_textureBlend; float u_iconStepCount; float u_time; }; #pragma include "projection" #pragma include "light" #pragma include "picking" // texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09 out vec2 v_iconMapUV; out vec4 v_color; out float v_blur; out float v_radio; out vec4 v_dataset; void main() { float d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B float d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E v_iconMapUV = a_iconMapUV; if(u_heightfixed < 1.0) { // \u9AD8\u5EA6\u968F zoom \u8C03\u6574 d_texPixelLen = project_pixel(u_icon_step); } else { d_texPixelLen = u_icon_step; } if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { d_texPixelLen *= 10.0; } if(u_animate.x == Animate || u_linearColor == 1.0) { d_distance_ratio = a_Distance / a_Total_Distance; } float miter = (a_Miter + 1.0)/2.0; // \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570 v_dataset[0] = d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B v_dataset[1] = a_Distance; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB v_dataset[2] = d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E v_dataset[3] = miter; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C 0 - 1 vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0)); float originSize = a_Size.x; // \u56FA\u5B9A\u9AD8\u5EA6 if(u_heightfixed < 1.0) { originSize = project_float_meter(a_Size.x); // \u9AD8\u5EA6\u968F zoom \u8C03\u6574 } float wallHeight = originSize * miter; float lightWeight = calc_lighting(vec4(project_pos.xy, wallHeight, 1.0)); v_blur = min(project_float_pixel(2.0) / originSize, 0.05); v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity); if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x gl_Position = u_Mvp * (vec4(project_pos.xy, wallHeight, 1.0)); } else { // \u517C\u5BB9 mapbox \u5728\u7EBF\u9AD8\u5EA6\u4E0A\u7684\u6548\u679C\u8868\u73B0\u57FA\u672C\u4E00\u81F4 if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // mapbox // \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8 float mapboxZoomScale = 4.0 / pow(2.0, 21.0 - u_Zoom); if(u_heightfixed > 0.0) { wallHeight *= mapboxZoomScale; } } else { // lineHeight \u9876\u70B9\u504F\u79FB\u9AD8\u5EA6 if(u_heightfixed < 1.0) { wallHeight *= pow(2.0, 20.0 - u_Zoom); } } gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, wallHeight, 1.0)); } setPickingColor(a_PickingColor); } `;class B5 extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"updateTexture",()=>{const{createTexture2D:r}=this.rendererService;if(this.texture){this.texture.update({data:this.iconService.getCanvas()}),this.layer.render();return}this.texture=r({data:this.iconService.getCanvas(),mag:Ee.NEAREST,min:Ee.NEAREST,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128}),this.textures=[this.texture]})}getCommonUniformsInfo(){const{sourceColor:e,targetColor:r,textureBlend:n="normal",heightfixed:a=!1,lineTexture:u=!1,iconStep:y=100,iconStepCount:A=1}=this.layer.getLayerConfig(),{animateOption:O}=this.layer.getLayerConfig();if(this.rendererService.getDirty()){var Z;(Z=this.texture)===null||Z===void 0||Z.bind()}let Y=0,Q=[0,0,0,0],ae=[0,0,0,0];e&&r&&(Q=Va(e),ae=Va(r),Y=1);const xe={u_animate:this.animateOption2Array(O),u_sourceColor:Q,u_targetColor:ae,u_textSize:[1024,this.iconService.canvasHeight||128],u_icon_step:y,u_heightfixed:Number(a),u_linearColor:Y,u_line_texture:u?1:0,u_textureBlend:n==="normal"?0:1,u_iconStepCount:A,u_time:this.layer.getLayerAnimateTime()||0};return this.getUniformsBufferInfo(xe)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.updateTexture(),e.iconService.on("imageUpdate",e.updateTexture),e.buildModels()})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}buildModels(){var e=this;return(0,Nr.Z)(function*(){return[yield e.layer.buildLayerModel({moduleName:"lineWall",vertexShader:O5,fragmentShader:D5,triangulation:p2,inject:e.getInject(),depth:{enable:!1},blend:e.getBlend()})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"distance",type:Vr.Attribute,descriptor:{name:"a_Distance",shaderLocation:15,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:(e,r,n)=>[n[3]]}}),this.styleAttributeService.registerStyleAttribute({name:"total_distance",type:Vr.Attribute,descriptor:{name:"a_Total_Distance",shaderLocation:11,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:(e,r,n)=>[n[5]]}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0],r[1]]:[r,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"miter",type:Vr.Attribute,descriptor:{name:"a_Miter",shaderLocation:10,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:(e,r,n)=>[n[4]]}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:14,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const r=this.iconService.getIconMap(),{texture:n}=e,{x:a,y:u}=r[n]||{x:0,y:0};return[a,u]}}})}}var F5={arc:s5,arc3d:Mw,greatcircle:C5,wall:B5,line:Lw,simple:L5,flowline:w5,earthArc3d:Mw};class m2 extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","LineLayer"),(0,K.Z)(this,"enableShaderEncodeStyles",["stroke","offsets","opacity","thetaOffset"]),(0,K.Z)(this,"arrowInsertCount",0),(0,K.Z)(this,"defaultSourceConfig",{data:[{lng1:100,lat1:30,lng2:130,lat2:30}],options:{parser:{type:"json",x:"lng1",y:"lat1",x1:"lng2",y1:"lat2"}}})}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new F5[r](e),yield e.initLayerModels()})()}getDefaultConfig(){const e=this.getModelType();return{line:{},linearline:{},simple:{},wall:{},arc3d:{blend:"additive"},arc:{blend:"additive"},greatcircle:{blend:"additive"},tileLine:{},earthArc3d:{},flowline:{},arrow:{}}[e]}getModelType(){var e;if(this.layerType)return this.layerType;const r=this.styleAttributeService.getLayerStyleAttribute("shape");return(r==null||(e=r.scale)===null||e===void 0?void 0:e.field)||"line"}processData(e){if(this.getModelType()!=="simple")return e;const r=[];return e.map(n=>{if(Array.isArray(n.coordinates)&&Array.isArray(n.coordinates[0])&&Array.isArray(n.coordinates[0][0])){const a=(0,Wt.Z)({},n);n.coordinates.map(u=>{r.push((0,Wt.Z)((0,Wt.Z)({},a),{},{coordinates:u}))})}else r.push(n)}),r}}const k5=` layout(std140) uniform commonUniorm { vec4 u_stroke_color; float u_additive; float u_stroke_opacity; float u_stroke_width; }; in vec4 v_color; in float v_blur; in float v_innerRadius; out vec4 outputColor; #pragma include "picking" void main() { vec2 center = vec2(0.5); // Tip: \u7247\u5143\u5230\u4E2D\u5FC3\u70B9\u7684\u8DDD\u79BB 0 - 1 float fragmengTocenter = distance(center, gl_PointCoord) * 2.0; // Tip: \u7247\u5143\u7684\u526A\u5207\u6210\u5706\u5F62 float circleClipOpacity = 1.0 - smoothstep(v_blur, 1.0, fragmengTocenter); if(v_innerRadius < 0.99) { // \u5F53\u5B58\u5728 stroke \u4E14 stroke > 0.01 float blurWidth = (1.0 - v_blur)/2.0; vec4 stroke = vec4(u_stroke_color.rgb, u_stroke_opacity); if(fragmengTocenter > v_innerRadius + blurWidth) { outputColor = stroke; } else if(fragmengTocenter > v_innerRadius - blurWidth){ float mixR = (fragmengTocenter - (v_innerRadius - blurWidth)) / (blurWidth * 2.0); outputColor = mix(v_color, stroke, mixR); } else { outputColor = v_color; } } else { // \u5F53\u4E0D\u5B58\u5728 stroke \u6216 stroke <= 0.01 outputColor = v_color; } outputColor = filterColor(outputColor); if(u_additive > 0.0) { outputColor *= circleClipOpacity; } else { outputColor.a *= circleClipOpacity; } } `,N5=` layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(std140) uniform commonUniorm { vec4 u_stroke_color; float u_additive; float u_stroke_opacity; float u_stroke_width; }; out vec4 v_color; out float v_blur; out float v_innerRadius; #pragma include "projection" #pragma include "picking" #pragma include "project" void main() { v_color = vec4(a_Color.xyz, a_Color.w * opacity); v_blur = 1.0 - max(2.0/a_Size, 0.05); v_innerRadius = max((a_Size - u_stroke_width) / a_Size, 0.0); vec2 offset = project_pixel(u_offsets); if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x gl_Position = u_Mvp * vec4(a_Position.xy + offset, a_Position.z, 1.0); } else { // else vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.); gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w)); } gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio; setPickingColor(a_PickingColor); } `;function Dw(t){const e=t.coordinates;return{vertices:[...e],indices:[0],size:e.length}}class z5 extends Ml{getDefaultStyle(){return{blend:"additive"}}getCommonUniformsInfo(){const{blend:e,strokeOpacity:r=1,strokeWidth:n=0,stroke:a="#fff"}=this.layer.getLayerConfig(),u={u_stroke_color:Va(a),u_additive:e==="additive"?1:0,u_stroke_opacity:r,u_stroke_width:n};return this.getUniformsBufferInfo(u)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.layer.triangulation=Dw,e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointSimple",vertexShader:N5,fragmentShader:k5,inject:e.getInject(),triangulation:Dw,depth:{enable:!1},primitive:Ee.POINTS})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0]]:[r]}}})}}const U5=`precision highp float; in vec4 v_color; #pragma include "picking" layout(std140) uniform commonUniform { vec4 u_sourceColor; vec4 u_targetColor; float u_linearColor: 0; float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A float u_globel; float u_r; float u_pickLight: 0.0; float u_opacitylinear: 0.0; float u_opacitylinear_dir: 1.0; float u_lightEnable: 1.0; }; in float v_lightWeight; in float v_barLinearZ; out vec4 outputColor; void main() { outputColor = v_color; // \u5F00\u542F\u900F\u660E\u5EA6\u6E10\u53D8 if(u_opacitylinear > 0.0) { outputColor.a *= u_opacitylinear_dir > 0.0 ? (1.0 - v_barLinearZ): v_barLinearZ; } // picking if(u_pickLight > 0.0) { outputColor = filterColorAlpha(outputColor, v_lightWeight); } else { outputColor = filterColor(outputColor); } } `,Z5=`precision highp float; #define pi 3.1415926535 #define ambientRatio 0.5 #define diffuseRatio 0.3 #define specularRatio 0.2 layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in vec3 a_Size; layout(location = 11) in vec3 a_Pos; layout(location = 13) in vec3 a_Normal; layout(std140) uniform commonUniform { vec4 u_sourceColor; vec4 u_targetColor; float u_linearColor: 0; float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A float u_globel; float u_r; float u_pickLight: 0.0; float u_opacitylinear: 0.0; float u_opacitylinear_dir: 1.0; float u_lightEnable: 1.0; }; out vec4 v_color; out float v_lightWeight; out float v_barLinearZ; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143 #pragma include "projection" #pragma include "light" #pragma include "picking" float getYRadian(float x, float z) { if(x > 0.0 && z > 0.0) { return atan(x/z); } else if(x > 0.0 && z <= 0.0){ return atan(-z/x) + pi/2.0; } else if(x <= 0.0 && z <= 0.0) { return pi + atan(x/z); //atan(x/z) + } else { return atan(z/-x) + pi*3.0/2.0; } } float getXRadian(float y, float r) { return atan(y/r); } void main() { // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97 vec3 size = a_Size * a_Position; // a_Position.z \u662F\u5728\u6784\u5EFA\u7F51\u683C\u7684\u65F6\u5019\u4F20\u5165\u7684\u6807\u51C6\u503C 0 - 1\uFF0C\u5728\u63D2\u503C\u5668\u63D2\u503C\u53EF\u4EE5\u83B7\u53D6 0\uFF5E1 \u7EBF\u6027\u6E10\u53D8\u7684\u503C v_barLinearZ = a_Position.z; vec3 offset = size; // \u63A7\u5236\u5706\u67F1\u4F53\u7684\u5927\u5C0F - \u4ECE\u6807\u51C6\u5355\u4F4D\u5706\u67F1\u4F53\u8FDB\u884C\u504F\u79FB if(u_heightfixed < 1.0) { // \u5706\u67F1\u4F53\u4E0D\u56FA\u5B9A\u9AD8\u5EA6 if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) { // P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1 offset = offset * pow(2.0, (19.0 - u_Zoom)); } if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3 offset = offset * pow(2.0, (19.0 - 3.0 - u_Zoom)); } } else {// \u5706\u67F1\u4F53\u56FA\u5B9A\u9AD8\u5EA6 \uFF08 \u5904\u7406 mapbox \uFF09 if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { offset *= 4.0/pow(2.0, 21.0 - u_Zoom); } } vec4 project_pos = project_position(vec4(a_Pos.xy, 0., 1.0)); // u_r \u63A7\u5236\u5706\u67F1\u7684\u751F\u957F vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0); // \u5706\u67F1\u5149\u7167\u6548\u679C float lightWeight = 1.0; if(u_lightEnable > 0.0) { // \u53D6\u6D88\u4E09\u5143\u8868\u8FBE\u5F0F\uFF0C\u589E\u5F3A\u5065\u58EE\u6027 lightWeight = calc_lighting(pos); } v_lightWeight = lightWeight; // \u8BBE\u7F6E\u5706\u67F1\u7684\u5E95\u8272 if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272 v_color = mix(u_sourceColor, u_targetColor, v_barLinearZ); v_color.rgb *= lightWeight; } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272 v_color = a_Color; } v_color.a *= u_opacity; // \u5728\u5730\u7403\u6A21\u5F0F\u4E0B\uFF0C\u5C06\u539F\u672C\u5782\u76F4\u4E8E xy \u5E73\u9762\u7684\u5706\u67F1\u8C03\u6574\u59FF\u6001\u5230\u9002\u5E94\u5706\u7684\u89D2\u5EA6 //\u65CB\u8F6C\u77E9\u9635mx\uFF0C\u521B\u5EFA\u7ED5x\u8F74\u65CB\u8F6C\u77E9\u9635 float r = sqrt(a_Pos.z*a_Pos.z + a_Pos.x*a_Pos.x); float xRadian = getXRadian(a_Pos.y, r); float xcos = cos(xRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u4F59\u5F26\u503C float xsin = sin(xRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u6B63\u5F26\u503C mat4 mx = mat4( 1,0,0,0, 0,xcos,-xsin,0, 0,xsin,xcos,0, 0,0,0,1); //\u65CB\u8F6C\u77E9\u9635my\uFF0C\u521B\u5EFA\u7ED5y\u8F74\u65CB\u8F6C\u77E9\u9635 float yRadian = getYRadian(a_Pos.x, a_Pos.z); float ycos = cos(yRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u4F59\u5F26\u503C float ysin = sin(yRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u6B63\u5F26\u503C mat4 my = mat4( ycos,0,-ysin,0, 0,1,0,0, ysin,0,ycos,0, 0,0,0,1); gl_Position = u_ViewProjectionMatrix * vec4(( my * mx * vec4(a_Position * a_Size, 1.0)).xyz + a_Pos, 1.0); setPickingColor(a_PickingColor); } `,{isNumber:V5}=es;class j5 extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"raiseCount",0),(0,K.Z)(this,"raiseRepeat",0)}getCommonUniformsInfo(){const{animateOption:e={enable:!1,speed:.01,repeat:!1},opacity:r=1,sourceColor:n,targetColor:a,pickLight:u=!1,heightfixed:y=!0,opacityLinear:A={enable:!1,dir:"up"},lightEnable:O=!0}=this.layer.getLayerConfig();let Z=0,Y=[0,0,0,0],Q=[0,0,0,0];if(n&&a&&(Y=Va(n),Q=Va(a),Z=1),this.raiseCount<1&&this.raiseRepeat>0&&e.enable){const{speed:Be=.01}=e;this.raiseCount+=Be,this.raiseCount>=1&&(this.raiseRepeat>1?(this.raiseCount=0,this.raiseRepeat--):this.raiseCount=1)}const ae={u_sourceColor:Y,u_targetColor:Q,u_linearColor:Z,u_pickLight:Number(u),u_heightfixed:Number(y),u_r:e.enable&&this.raiseRepeat>0?this.raiseCount:1,u_opacity:V5(r)?r:1,u_opacitylinear:Number(A.enable),u_opacitylinear_dir:A.dir==="up"?1:0,u_lightEnable:Number(O)};return this.getUniformsBufferInfo(ae)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{animateOption:{repeat:r=1}}=e.layer.getLayerConfig();return e.raiseRepeat=r,[yield e.layer.buildLayerModel({moduleName:"pointEarthExtrude",vertexShader:Z5,fragmentShader:U5,triangulation:h2,depth:{enable:!0},inject:e.getInject(),cull:{enable:!0,face:Tl(e.mapService.version)},blend:e.getBlend()})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:e=>{const{size:r}=e;if(r){let n=[];return Array.isArray(r)&&(n=r.length===2?[r[0],r[0],r[1]]:r),Array.isArray(r)||(n=[r,r,r]),n}else return[2,2,2]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"pos",type:Vr.Attribute,descriptor:{name:"a_Pos",shaderLocation:15,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:e=>{const r=Pc(e.coordinates);return fw([r[0],r[1]])}}})}}const H5=`in vec4 v_data; in vec4 v_color; in float v_radius; layout(std140) uniform commonUniform { float u_additive; float u_stroke_opacity : 1; float u_stroke_width : 2; float u_blur : 0.0; }; #pragma include "sdf_2d" #pragma include "picking" out vec4 outputColor; void main() { int shape = int(floor(v_data.w + 0.5)); vec4 strokeColor = u_stroke == vec4(0.0) ? v_color : u_stroke; lowp float antialiasblur = v_data.z; float r = v_radius / (v_radius + u_stroke_width); float outer_df; float inner_df; // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica' if (shape == 0) { outer_df = sdCircle(v_data.xy, 1.0); inner_df = sdCircle(v_data.xy, r); } else if (shape == 1) { outer_df = sdEquilateralTriangle(1.1 * v_data.xy); inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy); } else if (shape == 2) { outer_df = sdBox(v_data.xy, vec2(1.)); inner_df = sdBox(v_data.xy, vec2(r)); } else if (shape == 3) { outer_df = sdPentagon(v_data.xy, 0.8); inner_df = sdPentagon(v_data.xy, r * 0.8); } else if (shape == 4) { outer_df = sdHexagon(v_data.xy, 0.8); inner_df = sdHexagon(v_data.xy, r * 0.8); } else if (shape == 5) { outer_df = sdOctogon(v_data.xy, 1.0); inner_df = sdOctogon(v_data.xy, r); } else if (shape == 6) { outer_df = sdHexagram(v_data.xy, 0.52); inner_df = sdHexagram(v_data.xy, r * 0.52); } else if (shape == 7) { outer_df = sdRhombus(v_data.xy, vec2(1.0)); inner_df = sdRhombus(v_data.xy, vec2(r)); } else if (shape == 8) { outer_df = sdVesica(v_data.xy, 1.1, 0.8); inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8); } if(outer_df > antialiasblur + 0.018) discard; float opacity_t = smoothstep(0.0, antialiasblur, outer_df); float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep( antialiasblur, 0.0, inner_df ); if(u_stroke_width < 0.01) { outputColor = vec4(v_color.rgb, v_color.a * u_opacity); } else { outputColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t); } if(u_additive > 0.0) { outputColor *= opacity_t; outputColor = filterColorAlpha(outputColor, outputColor.a); } else { outputColor.a *= opacity_t; outputColor = filterColor(outputColor); } } `,G5=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(location = 10) in float a_Shape; layout(location = 11) in vec3 a_Extrude; layout(std140) uniform commonUniform { float u_additive; float u_stroke_opacity : 1; float u_stroke_width : 2; float u_blur : 0.0; }; out vec4 v_data; out vec4 v_color; out float v_radius; #pragma include "projection" #pragma include "picking" void main() { vec3 extrude = a_Extrude; float shape_type = a_Shape; /* * setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F */ float newSize = setPickingSize(a_Size); // float newSize = setPickingSize(a_Size) * 0.00001038445708445579; // unpack color(vec2) v_color = a_Color; // radius(16-bit) v_radius = newSize; // anti-alias // float antialiased_blur = -max(u_blur, antialiasblur); float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur); // TODP: /abs(extrude.x) \u662F\u4E3A\u4E86\u517C\u5BB9\u5730\u7403\u6A21\u5F0F v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type); gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1 + vec3(u_offsets,0.0), 1.0); setPickingColor(a_PickingColor); }`;class W5 extends Ml{getCommonUniformsInfo(){const{strokeOpacity:e=1,strokeWidth:r=0,blend:n,blur:a=0}=this.layer.getLayerConfig();this.layer.getLayerConfig();const u={u_additive:n==="additive"?1:0,u_stroke_opacity:e,u_stroke_width:r,u_blur:a};return this.getUniformsBufferInfo(u)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.layer.triangulation=xw,[yield e.layer.buildLayerModel({moduleName:"pointEarthFill",vertexShader:G5,fragmentShader:H5,triangulation:xw,inject:e.getInject(),depth:{enable:!0},blend:e.getBlend()})]})()}animateOption2Array(e){return[e.enable?0:1,e.speed||1,e.rings||3,0]}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Vr.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Ro.EXTRUDE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a)=>{const[u,y,A]=n,O=ra.fromValues(0,0,1),Z=ra.fromValues(u,0,A),Y=u>=0?ra.angle(O,Z):Math.PI*2-ra.angle(O,Z),Q=Math.PI*2-Math.asin(y/100),ae=Kr.create();Kr.rotateY(ae,ae,Y),Kr.rotateX(ae,ae,Q);const xe=ra.fromValues(1,1,0);ra.transformMat4(xe,xe,ae),ra.normalize(xe,xe);const Be=ra.fromValues(-1,1,0);ra.transformMat4(Be,Be,ae),ra.normalize(Be,Be);const it=ra.fromValues(-1,-1,0);ra.transformMat4(it,it,ae),ra.normalize(it,it);const gt=ra.fromValues(1,-1,0);ra.transformMat4(gt,gt,ae),ra.normalize(gt,gt);const Bt=[...xe,...Be,...it,...gt],Rt=a%4*3;return[Bt[Rt],Bt[Rt+1],Bt[Rt+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=5}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"shape",type:Vr.Attribute,descriptor:{name:"a_Shape",shaderLocation:Ro.SHAPE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{shape:r=2}=e;return[this.layer.getLayerConfig().shape2d.indexOf(r)]}}})}}const X5=` in vec4 v_color; in float v_lightWeight; out vec4 outputColor; layout(std140) uniform commonUniforms { float u_pickLight; float u_heightfixed; float u_r; float u_linearColor; vec4 u_sourceColor; vec4 u_targetColor; float u_opacitylinear; float u_opacitylinear_dir; float u_lightEnable; }; #pragma include "scene_uniforms" #pragma include "picking" void main() { outputColor = v_color; // \u5F00\u542F\u900F\u660E\u5EA6\u6E10\u53D8 // picking if(u_pickLight > 0.0) { outputColor = filterColorAlpha(outputColor, v_lightWeight); } else { outputColor = filterColor(outputColor); } } `,q5=`#define pi 3.1415926535 layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in vec3 a_Size; layout(location = 11) in vec3 a_Extrude; layout(location = 13) in vec3 a_Normal; layout(std140) uniform commonUniforms { float u_pickLight; float u_heightfixed; float u_r; float u_linearColor; vec4 u_sourceColor; vec4 u_targetColor; float u_opacitylinear; float u_opacitylinear_dir; float u_lightEnable; }; out vec4 v_color; out float v_lightWeight; #pragma include "projection" #pragma include "light" #pragma include "picking" float getYRadian(float x, float z) { if(x > 0.0 && z > 0.0) { return atan(x/z); } else if(x > 0.0 && z <= 0.0){ return atan(-z/x) + pi/2.0; } else if(x <= 0.0 && z <= 0.0) { return pi + atan(x/z); //atan(x/z) + } else { return atan(z/-x) + pi*3.0/2.0; } } float getXRadian(float y, float r) { return atan(y/r); } void main() { vec3 size = a_Size * a_Position; vec3 offset = size; // \u63A7\u5236\u5706\u67F1\u4F53\u7684\u5927\u5C0F - \u4ECE\u6807\u51C6\u5355\u4F4D\u5706\u67F1\u4F53\u8FDB\u884C\u504F\u79FB if(u_heightfixed < 1.0) { // \u5706\u67F1\u4F53\u4E0D\u56FA\u5B9A\u9AD8\u5EA6 if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) { // P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1 offset = offset * pow(2.0, (19.0 - u_Zoom)); } if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3 offset = offset * pow(2.0, (19.0 - 3.0 - u_Zoom)); } } else {// \u5706\u67F1\u4F53\u56FA\u5B9A\u9AD8\u5EA6 \uFF08 \u5904\u7406 mapbox \uFF09 if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { offset *= 4.0/pow(2.0, 21.0 - u_Zoom); } } vec4 project_pos = project_position(vec4(a_Extrude.xy, 0., 1.0)); // u_r \u63A7\u5236\u5706\u67F1\u7684\u751F\u957F vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0); // // \u5706\u67F1\u5149\u7167\u6548\u679C float lightWeight = 1.0; if(u_lightEnable > 0.0) { // \u53D6\u6D88\u4E09\u5143\u8868\u8FBE\u5F0F\uFF0C\u589E\u5F3A\u5065\u58EE\u6027 lightWeight = calc_lighting(pos); } v_lightWeight = lightWeight; v_color = a_Color; // \u8BBE\u7F6E\u5706\u67F1\u7684\u5E95\u8272 if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272 v_color = mix(u_sourceColor, u_targetColor, a_Position.z); v_color.a = v_color.a * opacity; } else { v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity); } if(u_opacitylinear > 0.0) { v_color.a *= u_opacitylinear_dir > 0.0 ? (1.0 - a_Position.z): a_Position.z; } gl_Position = project_common_position_to_clipspace_v2(pos); setPickingColor(a_PickingColor); } `;class Ow extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"raiseCount",0),(0,K.Z)(this,"raiseRepeat",0)}getCommonUniformsInfo(){const{animateOption:e={enable:!1,speed:.01,repeat:!1},sourceColor:r,targetColor:n,pickLight:a=!1,heightfixed:u=!1,opacityLinear:y={enable:!1,dir:"up"},lightEnable:A=!0}=this.layer.getLayerConfig();let O=0,Z=[0,0,0,0],Y=[0,0,0,0];if(r&&n&&(Z=Va(r),Y=Va(n),O=1),this.raiseCount<1&&this.raiseRepeat>0&&e.enable){const{speed:xe=.01}=e;this.raiseCount+=xe,this.raiseCount>=1&&(this.raiseRepeat>1?(this.raiseCount=0,this.raiseRepeat--):this.raiseCount=1)}const Q={u_pickLight:Number(a),u_heightfixed:Number(u),u_r:e.enable&&this.raiseRepeat>0?this.raiseCount:1,u_linearColor:O,u_sourceColor:Z,u_targetColor:Y,u_opacitylinear:Number(y.enable),u_opacitylinear_dir:y.dir==="up"?1:0,u_lightEnable:Number(A)};return this.getUniformsBufferInfo(Q)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{depth:r=!0,animateOption:{repeat:n=1}}=e.layer.getLayerConfig();return e.raiseRepeat=n,e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointExtrude",vertexShader:q5,fragmentShader:X5,triangulation:h2,inject:e.getInject(),cull:{enable:!0,face:Tl(e.mapService.version)},depth:{enable:r}})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:e=>{const{size:r}=e;if(r){let n=[];return Array.isArray(r)&&(n=r.length===2?[r[0],r[0],r[1]]:r),Array.isArray(r)||(n=[r,r,r]),n}else return[2,2,2]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Vr.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Ro.EXTRUDE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:e=>{const r=Pc(e.coordinates);return[r[0],r[1],0]}}})}}const Y5=` layout(std140) uniform commonUniforms { vec3 u_blur_height_fixed; float u_stroke_width; float u_additive; float u_stroke_opacity; float u_size_unit; float u_time; vec4 u_animate; }; in vec4 v_color; in vec4 v_stroke; in vec4 v_data; in float v_radius; #pragma include "scene_uniforms" #pragma include "sdf_2d" #pragma include "picking" out vec4 outputColor; void main() { int shape = int(floor(v_data.w + 0.5)); lowp float antialiasblur = v_data.z; float r = v_radius / (v_radius + u_stroke_width); float outer_df; float inner_df; // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica' if (shape == 0) { outer_df = sdCircle(v_data.xy, 1.0); inner_df = sdCircle(v_data.xy, r); } else if (shape == 1) { outer_df = sdEquilateralTriangle(1.1 * v_data.xy); inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy); } else if (shape == 2) { outer_df = sdBox(v_data.xy, vec2(1.)); inner_df = sdBox(v_data.xy, vec2(r)); } else if (shape == 3) { outer_df = sdPentagon(v_data.xy, 0.8); inner_df = sdPentagon(v_data.xy, r * 0.8); } else if (shape == 4) { outer_df = sdHexagon(v_data.xy, 0.8); inner_df = sdHexagon(v_data.xy, r * 0.8); } else if (shape == 5) { outer_df = sdOctogon(v_data.xy, 1.0); inner_df = sdOctogon(v_data.xy, r); } else if (shape == 6) { outer_df = sdHexagram(v_data.xy, 0.52); inner_df = sdHexagram(v_data.xy, r * 0.52); } else if (shape == 7) { outer_df = sdRhombus(v_data.xy, vec2(1.0)); inner_df = sdRhombus(v_data.xy, vec2(r)); } else if (shape == 8) { outer_df = sdVesica(v_data.xy, 1.1, 0.8); inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8); } float opacity_t = smoothstep(0.0, antialiasblur, outer_df); float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep( antialiasblur, 0.0, inner_df ); float PI = 3.14159; float N_RINGS = 3.0; float FREQ = 1.0; if(u_stroke_width < 0.01) { outputColor = v_color; } else { outputColor = mix(v_color, v_stroke * u_stroke_opacity, color_t); } float intensity = 1.0; if(u_time!=-1.0){ //wave\u76F8\u5173\u903B\u8F91 float d = length(v_data.xy); if(d > 0.5) { discard; } intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_animate.z - u_animate.y * u_time)), 0.0, 1.0); } if(u_additive > 0.0) { outputColor *= opacity_t; outputColor *= intensity;//wave outputColor = filterColorAlpha(outputColor, outputColor.a); } else { outputColor.a *= opacity_t; outputColor.a *= intensity;//wave outputColor = filterColor(outputColor); } // \u4F5C\u4E3A mask \u6A21\u677F\u65F6\u9700\u8981\u4E22\u5F03\u900F\u660E\u7684\u50CF\u7D20 if(outputColor.a < 0.01) { discard; } } `,$5=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(location = 10) in float a_Shape; layout(location = 11) in vec3 a_Extrude; layout(std140) uniform commonUniforms { vec3 u_blur_height_fixed; float u_stroke_width; float u_additive; float u_stroke_opacity; float u_size_unit; float u_time; vec4 u_animate; }; out vec4 v_color; out vec4 v_stroke; out vec4 v_data; out float v_radius; #pragma include "projection" #pragma include "picking" #pragma include "rotation_2d" void main() { // \u900F\u660E\u5EA6\u8BA1\u7B97 v_stroke = stroke; vec3 extrude = a_Extrude; float shape_type = a_Shape; /* * setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F * u_meter2coord \u5728\u7B49\u9762\u79EF\u5927\u5C0F\u7684\u65F6\u5019\u8BBE\u7F6E\u5355\u4F4D */ float newSize = setPickingSize(a_Size); // float newSize = setPickingSize(a_Size) * 0.00001038445708445579; // unpack color(vec2) v_color = vec4(a_Color.xyz, a_Color.w * opacity); if(u_size_unit == 1.0) { newSize = newSize * u_PixelsPerMeter.z; } v_radius = newSize; // anti-alias // float antialiased_blur = -max(u_blur, antialiasblur); float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur_height_fixed.x); vec2 offset = (extrude.xy * (newSize + u_stroke_width) + u_offsets); vec3 aPosition = a_Position; offset = project_pixel(offset); offset = rotate_matrix(offset,rotation); // TODP: /abs(extrude.x) \u662F\u4E3A\u4E86\u517C\u5BB9\u5730\u7403\u6A21\u5F0F v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type); // vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0)); vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0)); // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0)); float raisingHeight = u_blur_height_fixed.y; if(u_blur_height_fixed.z < 1.0) { // false raisingHeight = project_pixel(u_blur_height_fixed.y); } else { if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom); raisingHeight = u_blur_height_fixed.y * mapboxZoomScale; } } gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, raisingHeight, 1.0)); setPickingColor(a_PickingColor); } `;class Bw extends Ml{getCommonUniformsInfo(){const{strokeOpacity:e=1,strokeWidth:r=0,blend:n,blur:a=0,raisingHeight:u=0,heightfixed:y=!1,unit:A="pixel"}=this.layer.getLayerConfig();let O=this.getAnimateUniforms().u_time;isNaN(O)&&(O=-1);const Z={u_blur_height_fixed:[a,Number(u),Number(y)],u_stroke_width:r,u_additive:n==="additive"?1:0,u_stroke_opacity:e,u_size_unit:r1[A],u_time:O,u_animate:this.getAnimateUniforms().u_animate};return this.getUniformsBufferInfo(Z)}getAnimateUniforms(){const{animateOption:e={enable:!1}}=this.layer.getLayerConfig();return{u_animate:this.animateOption2Array(e),u_time:this.layer.getLayerAnimateTime()}}getAttribute(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),r0)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{frag:r,vert:n,type:a}=e.getShaders();return e.layer.triangulation=r0,e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:a,vertexShader:n,fragmentShader:r,inject:e.getInject(),triangulation:r0,depth:{enable:!1}})]})()}getShaders(){return{frag:Y5,vert:$5,type:"pointFill"}}animateOption2Array(e){return[e.enable?0:1,e.speed||1,e.rings||3,0]}registerBuiltinAttributes(){const e=this.layer.getLayerConfig().shape2d;this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Vr.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Ro.EXTRUDE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(r,n,a,u)=>{const y=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],A=u%4*3;return[y[A],y[A+1],y[A+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:r=>{const{size:n=5}=r;return Array.isArray(n)?[n[0]]:[n]}}}),this.styleAttributeService.registerStyleAttribute({name:"shape",type:Vr.Attribute,descriptor:{name:"a_Shape",shaderLocation:Ro.SHAPE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:r=>{const{shape:n=2}=r;return[e.indexOf(n)]}}})}}const K5=`in vec2 v_uv;// \u672C\u8EAB\u7684 uv \u5750\u6807 in vec2 v_Iconuv; in float v_opacity; out vec4 outputColor; uniform sampler2D u_texture; layout(std140) uniform commonUniform { vec2 u_textSize; float u_heightfixed: 0.0; float u_raisingHeight: 0.0; float u_size_unit; }; #pragma include "scene_uniforms" #pragma include "sdf_2d" #pragma include "picking" void main() { vec2 pos = v_Iconuv / u_textSize + v_uv / u_textSize * 64.; outputColor = texture(SAMPLER_2D(u_texture), pos); outputColor.a *= v_opacity; outputColor = filterColor(outputColor); } `,J5=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(location = 11) in vec3 a_Extrude; layout(location = 14) in vec2 a_Uv; layout(std140) uniform commonUniform { vec2 u_textSize; float u_heightfixed: 0.0; float u_raisingHeight: 0.0; float u_size_unit; }; out vec2 v_uv; out vec2 v_Iconuv; out float v_opacity; #pragma include "projection" #pragma include "picking" #pragma include "rotation_2d" void main() { vec3 extrude = a_Extrude; v_uv = (a_Extrude.xy + 1.0)/2.0; v_uv.y = 1.0 - v_uv.y; v_Iconuv = a_Uv; v_opacity = opacity; float newSize = a_Size; if(u_size_unit == 1.0) { newSize = newSize * u_PixelsPerMeter.z; } // vec2 offset = (u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets); vec2 offset = (extrude.xy * (newSize) + offsets); offset = rotate_matrix(offset,rotation); vec3 aPosition = a_Position; offset = project_pixel(offset); vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0)); float raisingHeight = u_raisingHeight; if(u_heightfixed < 1.0) { // height fixed raisingHeight = project_pixel(u_raisingHeight); } else { if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom); raisingHeight = u_raisingHeight * mapboxZoomScale; } } gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, 0.0, 1.0)); setPickingColor(a_PickingColor); } `;class Q5 extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"meter2coord",1),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"isMeter",!1),(0,K.Z)(this,"radian",0),(0,K.Z)(this,"updateTexture",()=>{const{createTexture2D:r}=this.rendererService;if(this.texture){this.texture.update({data:this.iconService.getCanvas(),mag:"linear",min:"linear mipmap nearest",mipmap:!0}),this.layerService.throttleRenderLayers();return}this.texture=r({data:this.iconService.getCanvas(),mag:Ee.LINEAR,min:Ee.LINEAR_MIPMAP_LINEAR,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128,mipmap:!0}),this.textures=[this.texture]})}getCommonUniformsInfo(){const{raisingHeight:e=0,heightfixed:r=!1,unit:n="pixel"}=this.layer.getLayerConfig();if(this.rendererService.getDirty()){var a;(a=this.texture)===null||a===void 0||a.bind()}const u={u_textSize:[1024,this.iconService.canvasHeight||128],u_heightfixed:Number(r),u_raisingHeight:Number(e),u_size_unit:r1[n]};return this.getUniformsBufferInfo(u)}getAttribute(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),r0)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.iconService.on("imageUpdate",e.updateTexture),e.updateTexture(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointFillImage",vertexShader:J5,fragmentShader:K5,triangulation:r0,depth:{enable:!1},inject:e.getInject(),cull:{enable:!0,face:Tl(e.mapService.version)}})]})()}clearModels(){var e;this.iconService.off("imageUpdate",this.updateTexture),(e=this.texture)===null||e===void 0||e.destroy()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const r=this.iconService.getIconMap(),{shape:n}=e,{x:a,y:u}=r[n]||{x:-64,y:-64};return[a,u]}}}),this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Vr.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Ro.EXTRUDE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a)=>{const u=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],y=a%4*3;return[u[y],u[y+1],u[y+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=5}=e;return Array.isArray(r)?[r[0]]:[r]}}})}}const eM=`layout(std140) uniform commonUniforms { vec2 u_textSize; float u_raisingHeight; float u_heightfixed; }; uniform sampler2D u_texture; in vec4 v_color; in vec2 v_uv; in float v_opacity; #pragma include "picking" out vec4 outputColor; void main(){ vec2 pos = v_uv / u_textSize + gl_PointCoord / u_textSize * 64.; vec4 textureColor; // Y = 0.299R + 0.587G + 0.114B // \u4EAE\u5EA6\u63D0\u53D6 textureColor = texture(SAMPLER_2D(u_texture), pos); // Tip: \u53BB\u9664\u8FB9\u7F18\u90E8\u5206 mipmap \u5BFC\u81F4\u7684\u6DF7\u5408\u53D8\u6697 float fragmengTocenter = distance(vec2(0.5), gl_PointCoord); if(fragmengTocenter >= 0.5) { float luma = 0.299 * textureColor.r + 0.587 * textureColor.g + 0.114 * textureColor.b; textureColor.a *= luma; } if(all(lessThan(v_color, vec4(1.0+0.00001))) && all(greaterThan(v_color, vec4(1.0-0.00001))) || v_color==vec4(1.0)){ outputColor= textureColor; }else { outputColor= step(0.01, textureColor.z) * v_color; } outputColor.a *= v_opacity; if (outputColor.a < 0.01) { discard; } outputColor = filterColor(outputColor); } `,tM=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(location = 14) in vec2 a_Uv; layout(std140) uniform commonUniforms { vec2 u_textSize; float u_raisingHeight; float u_heightfixed; }; out vec4 v_color; out vec2 v_uv; out float v_opacity; #pragma include "projection" #pragma include "picking" void main() { // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97 v_color = a_Color; v_opacity = opacity; v_uv = a_Uv; vec4 project_pos = project_position(vec4(a_Position, 1.0)); vec2 offset = project_pixel(offsets); float raisingHeight = u_raisingHeight; if(u_heightfixed < 1.0) { // false raisingHeight = project_pixel(u_raisingHeight); } else { if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom); raisingHeight = u_raisingHeight * mapboxZoomScale; } } gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, raisingHeight, 1.0)); gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio; setPickingColor(a_PickingColor); } `;class Fw extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"updateTexture",()=>{const{createTexture2D:r}=this.rendererService;if(this.texture){this.texture.update({data:this.iconService.getCanvas(),mag:"linear",min:"linear mipmap nearest",mipmap:!0}),setTimeout(()=>{this.layerService.throttleRenderLayers()});return}this.texture=r({data:this.iconService.getCanvas(),mag:Ee.LINEAR,min:Ee.LINEAR_MIPMAP_LINEAR,premultiplyAlpha:!1,width:1024,height:this.iconService.canvasHeight||128,mipmap:!0})})}getUninforms(){if(this.rendererService.getDirty()){var e;(e=this.texture)===null||e===void 0||e.bind()}const r=this.getCommonUniformsInfo(),n=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},r.uniformsOption),n.uniformsOption)}getCommonUniformsInfo(){const{raisingHeight:e=0,heightfixed:r=!1}=this.layer.getLayerConfig(),n={u_textSize:[1024,this.iconService.canvasHeight||128],u_raisingHeight:Number(e),u_heightfixed:Number(r),u_texture:this.texture};return this.textures=[this.texture],this.getUniformsBufferInfo(n)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.iconService.on("imageUpdate",e.updateTexture),e.updateTexture(),e.buildModels()})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointImage",vertexShader:tM,fragmentShader:eM,triangulation:cC,inject:e.getInject(),depth:{enable:!1},primitive:Ee.POINTS})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=5}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:e=>{const r=this.iconService.getIconMap(),{shape:n}=e,{x:a,y:u}=r[n]||{x:-64,y:-64};return[a,u]}}})}}const rM=`in vec4 v_color; out vec4 outputColor; void main() { outputColor = v_color; }`,nM=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(std140) uniform u_Common { float u_size_scale; }; out vec4 v_color; #pragma include "projection" #pragma include "project" void main() { v_color = vec4(a_Color.xyz, a_Color.w * opacity); if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x gl_Position = u_Mvp * vec4(a_Position, 1.0); } else { vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2., -a_Size /2., 0., 0.); gl_Position = project_common_position_to_clipspace(project_pos); } gl_PointSize = a_Size * u_size_scale * 2.0 * u_DevicePixelRatio; } `;function kw(t){const e=t.coordinates;return{vertices:[...e],indices:[0],size:e.length}}class Nw extends Ml{getDefaultStyle(){return{blend:"additive"}}getCommonUniformsInfo(){const e={u_size_scale:.5};return this.getUniformsBufferInfo(e)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.layer.triangulation=kw,e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointNormal",vertexShader:nM,fragmentShader:rM,triangulation:kw,inject:e.getInject(),depth:{enable:!1},primitive:Ee.POINTS,pick:!1})]})()}clearModels(){}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0]]:[r]}}})}}const iM=` layout(std140) uniform commonUniorm{ float u_additive; float u_size_unit; float u_speed: 1.0; float u_time; }; in vec4 v_data; in vec4 v_color; in float v_radius; in vec2 v_extrude; #pragma include "sdf_2d" #pragma include "picking" out vec4 outputColor; void main() { lowp float antialiasblur = v_data.z; float r = v_radius / (v_radius); float outer_df = sdCircle(v_data.xy, 1.0); float inner_df = sdCircle(v_data.xy, r); float opacity_t = smoothstep(0.0, antialiasblur, outer_df); outputColor = vec4(v_color.rgb, v_color.a); if(u_additive > 0.0) { outputColor *= opacity_t; } else { outputColor.a *= opacity_t; } if(outputColor.a > 0.0) { outputColor = filterColor(outputColor); } vec2 extrude = v_extrude; vec2 dir = normalize(extrude); vec2 baseDir = vec2(1.0, 0.0); float pi = 3.14159265359; float flag = sign(dir.y); float rades = dot(dir, baseDir); float radar_v = (flag - 1.0) * -0.5 * acos(rades)/pi; // simple AA if(radar_v > 0.99) { radar_v = 1.0 - (radar_v - 0.99)/0.01; } outputColor.a *= radar_v; } `,oM=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(location = 11) in vec3 a_Extrude; layout(std140) uniform commonUniorm { float u_additive; float u_size_unit; float u_speed: 1.0; float u_time; }; out vec4 v_data; out vec4 v_color; out float v_radius; out vec2 v_extrude; #pragma include "projection" #pragma include "picking" void main() { float newSize = setPickingSize(a_Size); float time = u_time * u_speed; mat2 rotateMatrix = mat2( cos(time), sin(time), -sin(time), cos(time) ); v_extrude = rotateMatrix * a_Extrude.xy; v_color = a_Color; v_color.a *= opacity; float blur = 0.0; float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur); if(u_size_unit == 1.) { newSize = newSize * u_PixelsPerMeter.z; } v_radius = newSize; vec2 offset = (a_Extrude.xy * (newSize)); vec3 aPosition = a_Position; offset = project_pixel(offset); v_data = vec4(a_Extrude.x, a_Extrude.y, antialiasblur, -1.0); vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0)); gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0)); setPickingColor(a_PickingColor); } `;class aM extends Ml{getCommonUniformsInfo(){const{blend:e,speed:r=1,unit:n="pixel"}=this.layer.getLayerConfig(),a={u_additive:e==="additive"?1:0,u_size_unit:r1[n],u_speed:r,u_time:this.layer.getLayerAnimateTime()};return this.getUniformsBufferInfo(a)}getAnimateUniforms(){return{}}getAttribute(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),r0)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"pointRadar",vertexShader:oM,fragmentShader:iM,triangulation:r0,inject:e.getInject(),depth:{enable:!1}})]})()}animateOption2Array(e){return[e.enable?0:1,e.speed||1,e.rings||3,0]}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"extrude",type:Vr.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Ro.EXTRUDE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a)=>{const u=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],y=a%4*3;return[u[y],u[y+1],u[y+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{shaderLocation:Ro.SIZE,name:"a_Size",buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=5}=e;return Array.isArray(r)?[r[0]]:[r]}}})}}class sM{constructor(e,r,n){(0,K.Z)(this,"boxCells",[]),(0,K.Z)(this,"xCellCount",void 0),(0,K.Z)(this,"yCellCount",void 0),(0,K.Z)(this,"boxKeys",void 0),(0,K.Z)(this,"bboxes",void 0),(0,K.Z)(this,"width",void 0),(0,K.Z)(this,"height",void 0),(0,K.Z)(this,"xScale",void 0),(0,K.Z)(this,"yScale",void 0),(0,K.Z)(this,"boxUid",void 0);const a=this.boxCells;this.xCellCount=Math.ceil(e/n),this.yCellCount=Math.ceil(r/n);for(let u=0;uthis.width||a<0||r>this.height)return u?!1:[];const A=[];if(e<=0&&r<=0&&this.width<=n&&this.height<=a){if(u)return!0;for(let Z=0;Z0:A}queryCell(e,r,n,a,u,y,A,O){const Z=A.seenUids,Y=this.boxCells[u];if(Y!==null){const Q=this.bboxes;for(const ae of Y)if(!Z.box[ae]){Z.box[ae]=!0;const xe=ae*4;if(e<=Q[xe+2]&&r<=Q[xe+3]&&n>=Q[xe+0]&&a>=Q[xe+1]&&(!O||O(this.boxKeys[ae]))){if(A.hitTest)return y.push(!0),!0;y.push({key:this.boxKeys[ae],x1:Q[xe],y1:Q[xe+1],x2:Q[xe+2],y2:Q[xe+3]})}}}return!1}forEachCell(e,r,n,a,u,y,A,O){const Z=this.convertToXCellCoord(e),Y=this.convertToYCellCoord(r),Q=this.convertToXCellCoord(n),ae=this.convertToYCellCoord(a);for(let xe=Z;xe<=Q;xe++)for(let Be=Y;Be<=ae;Be++){const it=this.xCellCount*Be+xe;if(u.call(this,e,r,n,a,it,y,A,O))return}}convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}}var lM=sM;class uM{constructor(e,r){(0,K.Z)(this,"width",void 0),(0,K.Z)(this,"height",void 0),(0,K.Z)(this,"grid",void 0),(0,K.Z)(this,"viewportPadding",100),(0,K.Z)(this,"screenRightBoundary",void 0),(0,K.Z)(this,"screenBottomBoundary",void 0),(0,K.Z)(this,"gridRightBoundary",void 0),(0,K.Z)(this,"gridBottomBoundary",void 0),this.width=e,this.height=r,this.viewportPadding=Math.max(e,r),this.grid=new lM(e+this.viewportPadding,r+this.viewportPadding,25),this.screenRightBoundary=e+this.viewportPadding,this.screenBottomBoundary=r+this.viewportPadding,this.gridRightBoundary=e+2*this.viewportPadding,this.gridBottomBoundary=r+2*this.viewportPadding}placeCollisionBox(e){const r=e.x1+e.anchorPointX+this.viewportPadding,n=e.y1+e.anchorPointY+this.viewportPadding,a=e.x2+e.anchorPointX+this.viewportPadding,u=e.y2+e.anchorPointY+this.viewportPadding;return!this.isInsideGrid(r,n,a,u)||this.grid.hitTest(r,n,a,u)?{box:[]}:{box:[r,n,a,u]}}insertCollisionBox(e,r){const n={featureIndex:r};this.grid.insert(n,e[0],e[1],e[2],e[3])}project(e,r,n){const a=mh.fromValues(r,n,0,1),u=mh.create(),y=Kr.fromValues(...e);return mh.transformMat4(u,a,y),{x:(u[0]/u[3]+1)/2*this.width+this.viewportPadding,y:(-u[1]/u[3]+1)/2*this.height+this.viewportPadding}}isInsideGrid(e,r,n,a){return n>=0&&e=0&&r{if(Bt.split("").forEach(Rt=>{const Yt=e[Rt],vr=0;Yt&&(Q.push({glyph:Rt,x:O,y:Z+vr,vertical:!1,scale:1,metrics:Yt}),O+=Yt.advance+y)}),Q.length!==xe){const Rt=O-y;Y=Math.max(Rt,Y),Uw(Q,e,xe,Q.length-1,ae)}O=0,Z-=n+5});const{horizontalAlign:Be,verticalAlign:it}=zw(a);Zw(Q,ae,Be,it,Y,n,r.length);const gt=Z- -8;t.top+=-it*gt,t.bottom=t.top-gt,t.left+=-Be*Y,t.right=t.left+Y}function hM(t,e,r,n,a,u,y){let O=0,Z=-8,Y=0;const Q=t.positionedGlyphs,ae=u==="right"?1:u==="left"?0:.5,xe=Q.length;r.forEach(Bt=>{const Rt=e[Bt],Yt=0;if(Rt&&(Q.push({glyph:Bt,x:Rt.advance/2,y:Z+Yt,vertical:!1,scale:1,metrics:Rt}),O+=Rt.advance+y),Q.length!==xe){const vr=O-y;Y=Math.max(vr,Y),Uw(Q,e,xe,Q.length-1,ae)}O=0,Z-=n+5});const{horizontalAlign:Be,verticalAlign:it}=zw(a);Zw(Q,ae,Be,it,Y,n,r.length);const gt=Z- -8;t.top+=-it*gt,t.bottom=t.top-gt,t.left+=-Be*Y,t.right=t.left+Y}function pM(t,e,r,n,a,u,y=[0,0],A){const O=t.split(` `),Z=[],Y={positionedGlyphs:Z,top:y[1],bottom:y[1],left:y[0],right:y[0],lineCount:O.length,text:t};return A?hM(Y,e,O,r,n,a,u):cM(Y,e,O,r,n,a,u),Z.length?Y:!1}function fM(t,e=[0,0],r){const{positionedGlyphs:n=[]}=t,a=[];for(const u of n){const y=u.metrics,A=4,O=y.advance*u.scale/2,Z=r?[u.x+O,u.y]:[0,0],Y=r?[0,0]:[u.x+O+e[0],u.y+e[1]],Q=(0-A)*u.scale-O+Y[0],ae=(0-A)*u.scale+Y[1],xe=Q+y.width*u.scale,Be=ae+y.height*u.scale,it={x:Q,y:ae},gt={x:xe,y:ae},Bt={x:Q,y:Be},Rt={x:xe,y:Be};a.push({tl:it,tr:gt,bl:Bt,br:Rt,tex:y,glyphOffset:Z})}return a}const Vw=`#define SDF_PX 8.0 #define EDGE_GAMMA 0.105 #define FONT_SIZE 48.0 uniform sampler2D u_sdf_map; layout(std140) uniform commonUniforms { vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0]; vec2 u_sdf_map_size; float u_raisingHeight: 0.0; float u_stroke_width : 2; float u_gamma_scale : 0.5; float u_halo_blur : 0.5; }; in vec2 v_uv; in float v_gamma_scale; in vec4 v_color; in vec4 v_stroke_color; in float v_fontScale; out vec4 outputColor; #pragma include "picking" void main() { // get style data mapping // get sdf from atlas float dist = texture(SAMPLER_2D(u_sdf_map), v_uv).a; lowp float buff = (6.0 - u_stroke_width / v_fontScale) / SDF_PX; highp float gamma = (u_halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (v_fontScale * u_gamma_scale) / 1.0; highp float gamma_scaled = gamma * v_gamma_scale; highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist); outputColor = mix(v_color, v_stroke_color, smoothstep(0., 0.5, 1.- dist)); outputColor.a *= alpha; // \u4F5C\u4E3A mask \u6A21\u677F\u65F6\u9700\u8981\u4E22\u5F03\u900F\u660E\u7684\u50CF\u7D20 if (outputColor.a < 0.01) { discard; } outputColor = filterColor(outputColor); } `,jw=`#define SDF_PX 8.0 #define EDGE_GAMMA 0.105 #define FONT_SIZE 24.0 layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(location = 10) in vec2 a_textOffsets; layout(location = 14) in vec2 a_tex; layout(std140) uniform commonUniforms { vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0]; vec2 u_sdf_map_size; float u_raisingHeight: 0.0; float u_stroke_width : 2; float u_gamma_scale : 0.5; float u_halo_blur : 0.5; }; out vec2 v_uv; out float v_gamma_scale; out vec4 v_color; out vec4 v_stroke_color; out float v_fontScale; #pragma include "projection" #pragma include "picking" #pragma include "rotation_2d" void main() { // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97 v_uv = a_tex / u_sdf_map_size; v_color = vec4(a_Color.xyz, a_Color.w * opacity); v_stroke_color = vec4(u_stroke_color.xyz, u_stroke_color.w * opacity); // \u6587\u672C\u7F29\u653E\u6BD4\u4F8B float fontScale = a_Size / FONT_SIZE; v_fontScale = fontScale; vec4 project_pos = project_position(vec4(a_Position, 1.0)); // vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0)); vec2 offset = rotate_matrix(a_textOffsets,rotation); // gl_Position = vec4(projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0); float raiseHeight = u_raisingHeight; if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom); raiseHeight = u_raisingHeight * mapboxZoomScale; } vec4 projected_position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0)); gl_Position = vec4( projected_position.xy / projected_position.w + offset * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0); v_gamma_scale = gl_Position.w; setPickingColor(a_PickingColor); } `,{isEqual:p_}=es;function Hw(t){const e=this,r=t.id,n=[],a=[];if(!e.glyphInfoMap||!e.glyphInfoMap[r])return{vertices:[],indices:[],size:7};const u=e.glyphInfoMap[r].centroid,y=u.length===2?[u[0],u[1],0]:u;return e.glyphInfoMap[r].glyphQuads.forEach((A,O)=>{n.push(...y,A.tex.x,A.tex.y+A.tex.height,A.tl.x,A.tl.y,...y,A.tex.x+A.tex.width,A.tex.y+A.tex.height,A.tr.x,A.tr.y,...y,A.tex.x+A.tex.width,A.tex.y,A.br.x,A.br.y,...y,A.tex.x,A.tex.y,A.bl.x,A.bl.y),a.push(0+O*4,1+O*4,2+O*4,2+O*4,3+O*4,0+O*4)}),{vertices:n,indices:a,size:7}}class Gw extends Ml{constructor(...e){var r;super(...e),r=this,(0,K.Z)(this,"glyphInfo",void 0),(0,K.Z)(this,"glyphInfoMap",{}),(0,K.Z)(this,"rawEncodeData",void 0),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"currentZoom",-1),(0,K.Z)(this,"extent",void 0),(0,K.Z)(this,"textureHeight",0),(0,K.Z)(this,"textCount",0),(0,K.Z)(this,"preTextStyle",{}),(0,K.Z)(this,"mapping",(0,Nr.Z)(function*(){r.initGlyph(),r.updateTexture(),yield r.reBuildModel()}))}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption),{u_sdf_map:this.textures[0]})}getCommonUniformsInfo(){const{stroke:e="#fff",strokeWidth:r=0,halo:n=.5,gamma:a=2,raisingHeight:u=0}=this.layer.getLayerConfig(),y=this.getFontServiceMapping(),A=this.getFontServiceCanvas();y&&Object.keys(y).length!==this.textCount&&A&&(this.updateTexture(),this.textCount=Object.keys(y).length),this.preTextStyle=this.getTextStyle();const O={u_stroke_color:Va(e),u_sdf_map_size:[(A==null?void 0:A.width)||1,(A==null?void 0:A.height)||1],u_raisingHeight:Number(u),u_stroke_width:r,u_gamma_scale:a,u_halo_blur:n};return this.getUniformsBufferInfo(O)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.bindEvent(),e.extent=e.textExtent(),e.rawEncodeData=e.layer.getEncodedData(),e.preTextStyle=e.getTextStyle(),e.initUniformsBuffer(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{textAllowOverlap:r=!1}=e.layer.getLayerConfig();return e.initGlyph(),e.updateTexture(),r||e.filterGlyphs(),[yield e.layer.buildLayerModel({moduleName:"pointText",vertexShader:jw,fragmentShader:Vw,inject:e.getInject(),triangulation:Hw.bind(e),depth:{enable:!1}})]})()}needUpdate(){var e=this;return(0,Nr.Z)(function*(){const{textAllowOverlap:r=!1,textAnchor:n="center",textOffset:a,padding:u,fontFamily:y,fontWeight:A}=e.getTextStyle();if(!p_(u,e.preTextStyle.padding)||!p_(a,e.preTextStyle.textOffset)||!p_(n,e.preTextStyle.textAnchor)||!p_(y,e.preTextStyle.fontFamily)||!p_(A,e.preTextStyle.fontWeight))return yield e.mapping(),!0;if(r)return!1;const O=e.mapService.getZoom(),Z=e.mapService.getBounds(),Y=is(e.extent,Z);return Math.abs(e.currentZoom-O)>.5||!Y||r!==e.preTextStyle.textAllowOverlap?(yield e.reBuildModel(),!0):!1})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy(),this.layer.off("remapping",this.mapping)}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"textOffsets",type:Vr.Attribute,descriptor:{shaderLocation:10,name:"a_textOffsets",buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[5],n[6]]}}),this.styleAttributeService.registerStyleAttribute({name:"textUv",type:Vr.Attribute,descriptor:{name:"a_tex",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=12}=e;return Array.isArray(r)?[r[0]]:[r]}}})}bindEvent(){this.layer.isTileLayer||this.layer.on("remapping",this.mapping)}textExtent(){const e=this.mapService.getBounds();return ai(e,.5)}initTextFont(){const{fontWeight:e,fontFamily:r}=this.getTextStyle(),n=this.rawEncodeData,a=[];n.forEach(u=>{let{shape:y=""}=u;y=y.toString();for(const A of y)a.indexOf(A)===-1&&a.push(A)}),this.fontService.setFontOptions({characterSet:a,fontWeight:e,fontFamily:r,iconfont:!1})}initIconFontTex(){const{fontWeight:e,fontFamily:r}=this.getTextStyle(),n=this.rawEncodeData,a=[];n.forEach(u=>{let{shape:y=""}=u;y=`${y}`,a.indexOf(y)===-1&&a.push(y)}),this.fontService.setFontOptions({characterSet:a,fontWeight:e,fontFamily:r,iconfont:!0})}getTextStyle(){const{fontWeight:e="400",fontFamily:r="sans-serif",textAllowOverlap:n=!1,padding:a=[0,0],textAnchor:u="center",textOffset:y=[0,0],opacity:A=1,strokeOpacity:O=1,strokeWidth:Z=0,stroke:Y="#000"}=this.layer.getLayerConfig();return{fontWeight:e,fontFamily:r,textAllowOverlap:n,padding:a,textAnchor:u,textOffset:y,opacity:A,strokeOpacity:O,strokeWidth:Z,stroke:Y}}generateGlyphLayout(e){const r=this.getFontServiceMapping(),{spacing:n=2,textAnchor:a="center",textOffset:u}=this.layer.getLayerConfig(),y=this.rawEncodeData;this.glyphInfo=y.map(A=>{const{shape:O="",id:Z,size:Y=1}=A,Q=A.textOffset?A.textOffset:u||[0,0],ae=A.textAnchor?A.textAnchor:a||"center",xe=pM(O.toString(),r,Y,ae,"left",n,Q,e),Be=fM(xe,Q,!1);return A.shaping=xe,A.glyphQuads=Be,A.centroid=Pc(A.coordinates),A.originCentroid=A.version==="GAODE2.x"?Pc(A.originCoordinates):A.originCentroid=A.centroid,this.glyphInfoMap[Z]={shaping:xe,glyphQuads:Be,centroid:Pc(A.coordinates)},A})}getFontServiceMapping(){const{fontWeight:e="400",fontFamily:r="sans-serif"}=this.layer.getLayerConfig();return this.fontService.getMappingByKey(`${r}_${e}`)}getFontServiceCanvas(){const{fontWeight:e="400",fontFamily:r="sans-serif"}=this.layer.getLayerConfig();return this.fontService.getCanvasByKey(`${r}_${e}`)}filterGlyphs(){const{padding:e=[0,0],textAllowOverlap:r=!1}=this.layer.getLayerConfig();if(r)return;this.glyphInfoMap={},this.currentZoom=this.mapService.getZoom(),this.extent=this.textExtent();const{width:n,height:a}=this.rendererService.getViewportSize(),u=new uM(n,a);this.glyphInfo.filter(A=>{const{shaping:O,id:Z=0}=A,Y=A.version==="GAODE2.x"?A.originCentroid:A.centroid,ae=A.size/16,xe=this.mapService.lngLatToContainer(Y),{box:Be}=u.placeCollisionBox({x1:O.left*ae-e[0],x2:O.right*ae+e[0],y1:O.top*ae-e[1],y2:O.bottom*ae+e[1],anchorPointX:xe.x,anchorPointY:xe.y});return Be&&Be.length?(u.insertCollisionBox(Be,Z),!0):!1}).forEach(A=>{this.glyphInfoMap[A.id]=A})}initGlyph(){const{iconfont:e=!1}=this.layer.getLayerConfig();e?this.initIconFontTex():this.initTextFont(),this.generateGlyphLayout(e)}updateTexture(){const{createTexture2D:e}=this.rendererService,r=this.getFontServiceCanvas();this.textureHeight=r.height,this.texture&&this.texture.destroy(),this.texture=e({data:r,mag:Ee.LINEAR,min:Ee.LINEAR,width:r.width,height:r.height}),this.textures=[this.texture]}reBuildModel(){var e=this;return(0,Nr.Z)(function*(){e.filterGlyphs();const r=yield e.layer.buildLayerModel({moduleName:"pointText",vertexShader:jw,fragmentShader:Vw,triangulation:Hw.bind(e),inject:e.getInject(),depth:{enable:!1}});e.layer.models=[r]})()}}var dM={fillImage:Q5,fill:Bw,radar:aM,image:Fw,normal:Nw,simplePoint:z5,extrude:Ow,text:Gw,earthFill:W5,earthExtrude:j5};class l1 extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","PointLayer"),(0,K.Z)(this,"enableShaderEncodeStyles",["stroke","offsets","opacity","rotation"]),(0,K.Z)(this,"enableDataEncodeStyles",["textOffset","textAnchor"]),(0,K.Z)(this,"defaultSourceConfig",{data:[],options:{parser:{type:"json",x:"lng",y:"lat"}}})}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel&&e.layerModel.clearModels(),e.layerModel=new dM[r](e),yield e.initLayerModels()})()}rebuildModels(){var e=this;return(0,Nr.Z)(function*(){yield e.buildModels()})()}getModelTypeWillEmptyData(){if(this.shapeOption){const{field:e,values:r}=this.shapeOption,{shape2d:n}=this.getLayerConfig(),a=this.iconService.getIconMap();if(e&&(n==null?void 0:n.indexOf(e))!==-1)return"fill";if(r==="text")return"text";if(r&&r instanceof Array){for(const u of r)if(typeof u=="string"&&a.hasOwnProperty(u))return"image"}}return"normal"}getDefaultConfig(){const e=this.getModelType();return{fillImage:{},normal:{blend:"additive"},radar:{},simplePoint:{},fill:{blend:"normal"},extrude:{},image:{},text:{blend:"normal"},tile:{},tileText:{},earthFill:{},earthExtrude:{}}[e]}getModelType(){const e=this.getEncodedData(),{shape2d:r,shape3d:n,billboard:a=!0}=this.getLayerConfig(),u=this.iconService.getIconMap(),y=e.find(A=>A.hasOwnProperty("shape"));if(y){const A=y.shape;return A==="dot"?"normal":A==="simple"?"simplePoint":A==="radar"?"radar":this.layerType==="fillImage"||a===!1?"fillImage":(r==null?void 0:r.indexOf(A))!==-1?this.mapService.version==="GLOBEL"?"earthFill":"fill":(n==null?void 0:n.indexOf(A))!==-1?this.mapService.version==="GLOBEL"?"earthExtrude":"extrude":u.hasOwnProperty(A)?"image":"text"}else return this.getModelTypeWillEmptyData()}}function mM(t){return g2.apply(this,arguments)}function g2(){return g2=(0,Nr.Z)(function*(t){if(window.createImageBitmap){const e=yield fetch(t);return yield createImageBitmap(yield e.blob())}else{const e=new window.Image;return new Promise(r=>{e.onload=()=>r(e),e.src=t,e.crossOrigin="Anonymous"})}}),g2.apply(this,arguments)}const gM=`layout(std140) uniform commonUniforms { vec4 u_sourceColor; vec4 u_targetColor; float u_linearColor; float u_topsurface; float u_sidesurface; float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A float u_raisingHeight; }; in vec4 v_Color; #pragma include "scene_uniforms" #pragma include "picking" out vec4 outputColor; void main() { // top face if(u_topsurface < 1.0) { discard; } outputColor = v_Color; outputColor = filterColor(outputColor); } `,vM=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(location = 13) in vec3 a_Normal; layout(location = 14) in vec3 a_uvs; layout(std140) uniform commonUniforms { vec4 u_sourceColor; vec4 u_targetColor; float u_linearColor; float u_topsurface; float u_sidesurface; float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A float u_raisingHeight; }; out vec4 v_Color; #pragma include "projection" #pragma include "light" #pragma include "picking" void main() { float isSide = a_Position.z; float topU = a_uvs[0]; float topV = 1.0 - a_uvs[1]; float sidey = a_uvs[2]; vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0); float lightWeight = calc_lighting(pos); vec4 project_pos = project_position(pos); if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6 project_pos.z = a_Position.z * a_Size; project_pos.z += u_raisingHeight; if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom); project_pos.z *= mapboxZoomScale; project_pos.z += u_raisingHeight * mapboxZoomScale; } } gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0)); // Tip: \u90E8\u5206\u673A\u578B GPU \u8BA1\u7B97\u7CBE\u5EA6\u517C\u5BB9 if(isSide < 0.999) { // side face // if(u_sidesurface < 1.0) { // discard; // } if(u_linearColor == 1.0) { vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey); linearColor.rgb *= lightWeight; v_Color = linearColor; } else { v_Color = a_Color; } } else { v_Color = a_Color; } v_Color = vec4(v_Color.rgb * lightWeight, v_Color.w * opacity); setPickingColor(a_PickingColor); } `,_M=`uniform sampler2D u_texture; layout(std140) uniform commonUniforms { vec4 u_sourceColor; vec4 u_targetColor; float u_linearColor; float u_topsurface; float u_sidesurface; float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A float u_raisingHeight; }; in vec4 v_Color; in vec3 v_uvs; in vec2 v_texture_data; #pragma include "scene_uniforms" #pragma include "picking" out vec4 outputColor; void main() { float opacity = u_opacity; float isSide = v_texture_data.x; float lightWeight = v_texture_data.y; float topU = v_uvs[0]; float topV = 1.0 - v_uvs[1]; float sidey = v_uvs[2]; outputColor = texture(SAMPLER_2D(u_texture), vec2(topU, topV)); // Tip: \u90E8\u5206\u673A\u578B GPU \u8BA1\u7B97\u7CBE\u5EA6\u517C\u5BB9 if (isSide < 0.999) {// \u662F\u5426\u662F\u8FB9\u7F18 // side face if (u_sidesurface < 1.0) { discard; } if (u_linearColor == 1.0) { vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey); linearColor.rgb *= lightWeight; outputColor = linearColor; } else { outputColor = v_Color; } } else { // top face if (u_topsurface < 1.0) { discard; } } outputColor.a *= opacity; outputColor = filterColor(outputColor); } `,yM=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(location = 13) in vec3 a_Normal; layout(location = 14) in vec3 a_uvs; layout(std140) uniform commonUniforms { vec4 u_sourceColor; vec4 u_targetColor; float u_linearColor; float u_topsurface; float u_sidesurface; float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A float u_raisingHeight; }; out vec4 v_Color; out vec3 v_uvs; out vec2 v_texture_data; #pragma include "projection" #pragma include "light" #pragma include "picking" void main() { vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0); float lightWeight = calc_lighting(pos); vec4 project_pos = project_position(pos); v_uvs = a_uvs; v_Color = a_Color; v_Color.a *= opacity; v_texture_data = vec2(a_Position.z, lightWeight); if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6 project_pos.z = a_Position.z * a_Size; project_pos.z += u_raisingHeight; if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom); project_pos.z *= mapboxZoomScale; project_pos.z += u_raisingHeight * mapboxZoomScale; } } gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0)); setPickingColor(a_PickingColor); } `,xM=` layout(std140) uniform commonUniforms { vec4 u_sourceColor; vec4 u_targetColor; float u_linearColor; float u_topsurface; float u_sidesurface; float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A float u_raisingHeight; }; in vec4 v_Color; in vec3 v_uvs; in vec2 v_texture_data; out vec4 outputColor; #pragma include "scene_uniforms" #pragma include "picking" void main() { float isSide = v_texture_data.x; float sidey = v_uvs[2]; float lightWeight = v_texture_data.y; // Tip: \u90E8\u5206\u673A\u578B GPU \u8BA1\u7B97\u7CBE\u5EA6\u517C\u5BB9 if(isSide < 0.999) { // side face if(u_sidesurface < 1.0) { discard; } if( u_linearColor == 1.0) { // side use linear vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey); linearColor.rgb *= lightWeight; outputColor = linearColor; } else { // side notuse linear outputColor = v_Color; } } else { // top face if(u_topsurface < 1.0) { discard; } outputColor = v_Color; } outputColor = filterColorAlpha(outputColor, lightWeight); } `,bM=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(location = 13) in vec3 a_Normal; layout(location = 14) in vec3 a_uvs; layout(std140) uniform commonUniforms { vec4 u_sourceColor; vec4 u_targetColor; float u_linearColor; float u_topsurface; float u_sidesurface; float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A float u_raisingHeight; }; out vec4 v_Color; out vec3 v_uvs; out vec2 v_texture_data; #pragma include "projection" #pragma include "light" #pragma include "picking" void main() { v_uvs = a_uvs; // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97 vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0); vec4 project_pos = project_position(pos); if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6 project_pos.z = a_Position.z * a_Size; project_pos.z += u_raisingHeight; if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom); project_pos.z *= mapboxZoomScale; project_pos.z += u_raisingHeight * mapboxZoomScale; } } gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0)); float lightWeight = calc_lighting(pos); v_texture_data = vec2(a_Position.z,lightWeight); v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity); setPickingColor(a_PickingColor); } `;class EM extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0)}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{mapTexture:e,heightfixed:r=!1,raisingHeight:n=0,topsurface:a=!0,sidesurface:u=!0,sourceColor:y,targetColor:A}=this.layer.getLayerConfig();let O=0,Z=[1,1,1,1],Y=[1,1,1,1];y&&A&&(Z=Va(y),Y=Va(A),O=1);const Q={u_sourceColor:Z,u_targetColor:Y,u_linearColor:O,u_topsurface:Number(a),u_sidesurface:Number(u),u_heightfixed:Number(r),u_raisingHeight:Number(n)};return e&&this.texture&&(Q.u_texture=this.texture,this.textures=[this.texture]),this.getUniformsBufferInfo(Q)}initModels(){var e=this;return(0,Nr.Z)(function*(){return yield e.loadTexture(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{frag:r,vert:n,type:a}=e.getShaders();return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:a,vertexShader:n,fragmentShader:r,depth:{enable:!0},inject:e.getInject(),triangulation:f2})]})()}getShaders(){const{pickLight:e,mapTexture:r}=this.layer.getLayerConfig();return r?{frag:_M,vert:yM,type:"polygonExtrudeTexture"}:e?{frag:xM,vert:bM,type:"polygonExtrudePickLight"}:{frag:gM,vert:vM,type:"polygonExtrude"}}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy(),this.textures=[]}registerBuiltinAttributes(){const e=this.layer.getSource().extent;let r=e;const n=this.layer.coordCenter||this.layer.getSource().center;let a=r[2]-r[0],u=r[3]-r[1];if(this.mapService.version==="GAODE2.x"){const[y,A]=this.mapService.coordToAMap2RelativeCoordinates([e[0],e[1]],n),[O,Z]=this.mapService.coordToAMap2RelativeCoordinates([e[2],e[3]],n);a=O-y,u=Z-A,r=[y,A,O,Z]}this.styleAttributeService.registerStyleAttribute({name:"uvs",type:Vr.Attribute,descriptor:{name:"a_uvs",shaderLocation:Ro.UV,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(y,A,O)=>{const Z=O[0],Y=O[1];return[(Z-r[0])/a,(Y-r[1])/u,O[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(y,A,O,Z,Y)=>Y}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:y=>{const{size:A=10}=y;return Array.isArray(A)?[A[0]]:[A]}}})}loadTexture(){var e=this;return(0,Nr.Z)(function*(){const{mapTexture:r}=e.layer.getLayerConfig(),{createTexture2D:n}=e.rendererService;if(e.texture=n({height:1,width:1}),r){const a=yield mM(r);e.texture=n({data:a,width:a.width,height:a.height,wrapS:Ee.CLAMP_TO_EDGE,wrapT:Ee.CLAMP_TO_EDGE,min:Ee.LINEAR,mag:Ee.LINEAR})}})()}}const wM=` in vec4 v_Color; #pragma include "scene_uniforms" #pragma include "picking" out vec4 outputColor; void main() { outputColor = v_Color; outputColor = filterColor(outputColor); } `,SM=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 9) in float a_Size; layout(location = 13) in vec3 a_Normal; out vec4 v_Color; #pragma include "projection" #pragma include "light" #pragma include "picking" void main() { vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size + (1.0 - a_Position.z) * extrusionBase, 1.0); vec4 project_pos = project_position(pos); float lightWeight = calc_lighting(project_pos); v_Color = a_Color; v_Color = vec4(v_Color.rgb * lightWeight, v_Color.w * opacity); gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0)); setPickingColor(a_PickingColor); } `;class TM extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0)}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const e={};return this.getUniformsBufferInfo(e)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{frag:r,vert:n,type:a}=e.getShaders();return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:a,vertexShader:n,fragmentShader:r,inject:e.getInject(),triangulation:f2,depth:{enable:!0}})]})()}getShaders(){return{frag:wM,vert:SM,type:"polygonExtrude"}}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=10}=e;return Array.isArray(r)?[r[0]]:[r]}}})}}const AM=`in vec4 v_color; #pragma include "scene_uniforms" #pragma include "picking" out vec4 outputColor; void main() { outputColor = v_color; outputColor = filterColor(outputColor); } `,CM=` layout(std140) uniform commonUniforms { float u_raisingHeight; float u_opacitylinear; float u_dir; }; in vec4 v_color; in vec3 v_linear; in vec2 v_pos; out vec4 outputColor; #pragma include "scene_uniforms" #pragma include "picking" void main() { outputColor = v_color; if (u_opacitylinear > 0.0) { outputColor.a *= u_dir == 1.0 ? 1.0 - length(v_pos - v_linear.xy)/v_linear.z : length(v_pos - v_linear.xy)/v_linear.z; } outputColor = filterColor(outputColor); } `,MM=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 15) in vec3 a_linear; layout(std140) uniform commonUniforms { float u_raisingHeight; float u_opacitylinear; float u_dir; }; out vec4 v_color; out vec3 v_linear; out vec2 v_pos; #pragma include "projection" #pragma include "picking" void main() { if (u_opacitylinear > 0.0) { v_linear = a_linear; v_pos = a_Position.xy; } v_color = vec4(a_Color.xyz, a_Color.w * opacity); vec4 project_pos = project_position(vec4(a_Position, 1.0)); project_pos.z += u_raisingHeight; if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom); project_pos.z *= mapboxZoomScale; project_pos.z += u_raisingHeight * mapboxZoomScale; } gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0)); setPickingColor(a_PickingColor); }`,PM=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(std140) uniform commonUniforms { float u_raisingHeight; }; out vec4 v_color; #pragma include "projection" #pragma include "picking" void main() { // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97 // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97 v_color = vec4(a_Color.xyz, a_Color.w * opacity); vec4 project_pos = project_position(vec4(a_Position, 1.0)); // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0)); project_pos.z += u_raisingHeight; if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom); project_pos.z *= mapboxZoomScale; project_pos.z += u_raisingHeight * mapboxZoomScale; } gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0)); setPickingColor(a_PickingColor); } `;class RM extends Ml{getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{raisingHeight:e=0,opacityLinear:r={enable:!1,dir:"in"}}=this.layer.getLayerConfig(),n={u_raisingHeight:Number(e),u_opacitylinear:Number(r.enable),u_dir:r.dir==="in"?1:0};return this.getUniformsBufferInfo(n)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){const{frag:r,vert:n,triangulation:a,type:u}=e.getModelParams();return e.initUniformsBuffer(),e.layer.triangulation=a,[yield e.layer.buildLayerModel({moduleName:u,vertexShader:n,fragmentShader:r,inject:e.getInject(),triangulation:a,primitive:Ee.TRIANGLES,depth:{enable:!1}})]})()}registerBuiltinAttributes(){const{opacityLinear:e={enable:!1,dir:"in"}}=this.layer.getLayerConfig();e.enable&&this.styleAttributeService.registerStyleAttribute({name:"linear",type:Vr.Attribute,descriptor:{name:"a_linear",shaderLocation:Ro.LINEAR,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(r,n,a)=>[a[3],a[4],a[5]]}})}getModelParams(){const{opacityLinear:e={enable:!1}}=this.layer.getLayerConfig();return e.enable?{frag:CM,vert:MM,type:"polygonLinear",triangulation:dC}:{frag:AM,vert:PM,type:"polygonFill",triangulation:a1}}}const IM=` layout(std140) uniform commonUniforms { vec4 u_watercolor; vec4 u_watercolor2; float u_time; }; in vec2 v_uv; in float v_opacity; out vec4 outputColor; float coast2water_fadedepth = 0.10; float large_waveheight = .750; // change to adjust the "heavy" waves float large_wavesize = 3.4; // factor to adjust the large wave size float small_waveheight = 0.6; // change to adjust the small random waves float small_wavesize = 0.5; // factor to ajust the small wave size float water_softlight_fact = 15.; // range [1..200] (should be << smaller than glossy-fact) float water_glossylight_fact= 120.; // range [1..200] float particle_amount = 70.; vec3 water_specularcolor = vec3(1.3, 1.3, 0.9); // specular Color (RGB) of the water-highlights #define light vec3(-0., sin(u_time*0.5)*.5 + .35, 2.8) // position of the sun uniform sampler2D u_texture1; uniform sampler2D u_texture2; uniform sampler2D u_texture3; float hash( float n ) { return fract(sin(n)*43758.5453123); } // 2d noise function float noise1( in vec2 x ) { vec2 p = floor(x); vec2 f = smoothstep(0.0, 1.0, fract(x)); float n = p.x + p.y*57.0; return mix(mix( hash(n+ 0.0), hash(n+ 1.0),f.x), mix( hash(n+ 57.0), hash(n+ 58.0),f.x),f.y); } float noise(vec2 p) { return texture(SAMPLER_2D(u_texture2),p*vec2(1./256.)).x; } vec4 highness(vec2 p) { vec4 t = texture(SAMPLER_2D(u_texture1),fract(p)); float clipped = -2.0-smoothstep(3.,10.,t.a)*6.9-smoothstep(10.,100.,t.a)*89.9-smoothstep(0.,10000.,t.a)*10000.0; return clamp(t, 0.0,3.0)+clamp(t/3.0-1.0, 0.0,1.0)+clamp(t/16.0-1.0, 0.0,1.0); } float height_map( vec2 p ) { vec4 height=highness(p); /* height = -0.5+ 0.5*smoothstep(-100.,0.,-height)+ 2.75*smoothstep(0.,2.,height)+ 1.75*smoothstep(2.,4.,height)+ 2.75*smoothstep(4.,16.,height)+ 1.5*smoothstep(16.,1000.,height); */ mat2 m = mat2( 0.9563*1.4, -0.2924*1.4, 0.2924*1.4, 0.9563*1.4 ); //p = p*6.; float f = 0.6000*noise1( p ); p = m*p*1.1*6.; f += 0.2500*noise( p ); p = m*p*1.32; f += 0.1666*noise( p ); p = m*p*1.11; f += 0.0834*noise( p ); p = m*p*1.12; f += 0.0634*noise( p ); p = m*p*1.13; f += 0.0444*noise( p ); p = m*p*1.14; f += 0.0274*noise( p ); p = m*p*1.15; f += 0.0134*noise( p ); p = m*p*1.16; f += 0.0104*noise( p ); p = m*p*1.17; f += 0.0084*noise( p ); f = .25*f+dot(height,vec4(-.03125,-.125,.25,.25))*.5; const float FLAT_LEVEL = 0.92525; //f = f*0.25+height*0.75; if (f level) { col = CalcTerrain(uv, height); } if (height <= level) { vec2 dif = vec2(.0, .01); vec2 pos = uv*15. + vec2(u_time*.01); float h1 = water_map(pos-dif,waveheight); float h2 = water_map(pos+dif,waveheight); float h3 = water_map(pos-dif.yx,waveheight); float h4 = water_map(pos+dif.yx,waveheight); vec3 normwater = normalize(vec3(h3-h4, h1-h2, .125)); // norm-vector of the 'bumpy' water-plane uv += normwater.xy*.002*(level-height); col = CalcTerrain(uv, height); float coastfade = clamp((level-height)/coast2water_fadedepth, 0., 1.); float coastfade2= clamp((level-height)/deepwater_fadedepth, 0., 1.); float intensity = col.r*.2126+col.g*.7152+col.b*.0722; watercolor = mix(watercolor*intensity, watercolor2, smoothstep(0., 1., coastfade2)); vec3 r0 = vec3(uv, WATER_LEVEL); vec3 rd = normalize( light - r0 ); // ray-direction to the light from water-position float grad = dot(normwater, rd); // dot-product of norm-vector and light-direction float specular = pow(grad, water_softlight_fact); // used for soft highlights float specular2= pow(grad, water_glossylight_fact); // used for glossy highlights float gradpos = dot(vec3(0., 0., 1.), rd); float specular1= smoothstep(0., 1., pow(gradpos, 5.)); // used for diffusity (some darker corona around light's specular reflections...) float watershade = test_shadow( uv, level ); watercolor *= 2.2+watershade; watercolor += (.2+.8*watershade) * ((grad-1.0)*.5+specular) * .25; watercolor /= (1.+specular1*1.25); watercolor += watershade*specular2*water_specularcolor; watercolor += watershade*coastfade*(1.-coastfade2)*(vec3(.5, .6, .7)*nautic(uv)+vec3(1., 1., 1.)*particles(uv)); col = mix(col, watercolor, coastfade); } outputColor = vec4(col, v_opacity); } `,LM=`layout(location = 0) in vec3 a_Position; layout(location = 14) in vec2 a_uv; layout(std140) uniform commonUniforms { vec4 u_watercolor; vec4 u_watercolor2; float u_time; }; out vec2 v_uv; out float v_opacity; #pragma include "projection" void main() { v_uv = a_uv; v_opacity = opacity; vec4 project_pos = project_position(vec4(a_Position, 1.0)); gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0)); } `;class DM extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture1",void 0),(0,K.Z)(this,"texture2",void 0),(0,K.Z)(this,"texture3",void 0)}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{watercolor:e="#6D99A8",watercolor2:r="#0F121C"}=this.layer.getLayerConfig(),n={u_watercolor:Va(e),u_watercolor2:Va(r),u_time:this.layer.getLayerAnimateTime(),u_texture1:this.texture1,u_texture2:this.texture2,u_texture3:this.texture3};return this.textures=[this.texture1,this.texture2,this.texture3],this.getUniformsBufferInfo(n)}getAnimateUniforms(){return{u_time:this.layer.getLayerAnimateTime()}}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.loadTexture(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"polygonOcean",vertexShader:LM,fragmentShader:IM,inject:e.getInject(),triangulation:a1,primitive:Ee.TRIANGLES,depth:{enable:!1}})]})()}clearModels(){var e,r,n;(e=this.texture1)===null||e===void 0||e.destroy(),(r=this.texture2)===null||r===void 0||r.destroy(),(n=this.texture3)===null||n===void 0||n.destroy()}registerBuiltinAttributes(){const e=this.layer.getSource().extent,[r,n,a,u]=e,y=a-r,A=u-n;this.styleAttributeService.registerStyleAttribute({name:"oceanUv",type:Vr.Attribute,descriptor:{name:"a_uv",shaderLocation:Ro.UV,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(O,Z,Y,Q)=>{const ae=O.version==="GAODE2.x"?O.originCoordinates[0][Q]:Y,[xe,Be]=ae;return[(xe-r)/y,(Be-n)/A]}}})}loadTexture(){const{createTexture2D:e}=this.rendererService,r={height:0,width:0};this.texture1=e(r),this.texture2=e(r),this.texture3=e(r),n(u=>{this.texture1=a(u[0]),this.texture2=a(u[1]),this.texture3=a(u[2]),this.layerService.reRender()});function n(u){let y=0;const A=[];["https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ","https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*MJ22QbpuCzIAAAAAAAAAAAAAARQnAQ","https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*-z2HSIVDsHIAAAAAAAAAAAAAARQnAQ"].map(Z=>{const Y=new Image;Y.crossOrigin="",Y.src=Z,A.push(Y),Y.onload=()=>{y++,y===3&&u(A)}})}function a(u){return e({data:u,width:u.width,height:u.height,wrapS:Ee.MIRRORED_REPEAT,wrapT:Ee.MIRRORED_REPEAT,min:Ee.LINEAR,mag:Ee.LINEAR})}}}const OM=`uniform sampler2D u_texture; layout(std140) uniform commonUniforms { float u_speed; float u_time; }; out vec4 outputColor; in vec4 v_Color; in vec2 v_uv; float rand(vec2 n) { return 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453); } float water(vec3 p) { float t = u_time * u_speed; p.z += t * 2.; p.x += t * 2.; vec3 c1 = texture(SAMPLER_2D(u_texture), p.xz / 30.).xyz; p.z += t * 3.; p.x += t * 0.52; vec3 c2 = texture(SAMPLER_2D(u_texture), p.xz / 30.).xyz; p.z += t * 4.; p.x += t * 0.8; vec3 c3 = texture(SAMPLER_2D(u_texture), p.xz / 30.).xyz; c1 += c2 - c3; float z = (c1.x + c1.y + c1.z) / 3.; return p.y + z / 4.; } float map(vec3 p) { float d = 100.0; d = water(p); return d; } float intersect(vec3 ro, vec3 rd) { float d = 0.0; for (int i = 0; i <= 100; i++) { float h = map(ro + rd * d); if (h < 0.1) return d; d += h; } return 0.0; } vec3 norm(vec3 p) { float eps = .1; return normalize(vec3( map(p + vec3(eps, 0, 0)) - map(p + vec3(-eps, 0, 0)), map(p + vec3(0, eps, 0)) - map(p + vec3(0, -eps, 0)), map(p + vec3(0, 0, eps)) - map(p + vec3(0, 0, -eps)) )); } float calSpc() { vec3 l1 = normalize(vec3(1, 1, 1)); vec3 ro = vec3(-3, 20, -8); vec3 rc = vec3(0, 0, 0); vec3 ww = normalize(rc - ro); vec3 uu = normalize(cross(vec3(0,1,0), ww)); vec3 vv = normalize(cross(rc - ro, uu)); vec3 rd = normalize(uu * v_uv.x + vv * v_uv.y + ww); float d = intersect(ro, rd); vec3 p = ro + rd * d; vec3 n = norm(p); float spc = pow(max(0.0, dot(reflect(l1, n), rd)), 30.0); return spc; } void main() { outputColor = v_Color; float spc = calSpc(); outputColor += spc * 0.4; } `,BM=`layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 14) in vec2 a_uv; layout(std140) uniform commonUniforms { float u_speed; float u_time; }; out vec4 v_Color; out vec2 v_uv; #pragma include "projection" void main() { v_uv = a_uv; v_Color = a_Color; v_Color.a *= opacity; vec4 project_pos = project_position(vec4(a_Position, 1.0)); gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0)); } `;class FM extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0)}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{speed:e=.5}=this.layer.getLayerConfig(),r={u_speed:e,u_time:this.layer.getLayerAnimateTime(),u_texture:this.texture};return this.textures=[this.texture],this.getUniformsBufferInfo(r)}getAnimateUniforms(){return{u_time:this.layer.getLayerAnimateTime()}}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.loadTexture(),e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"polygonWater",vertexShader:BM,fragmentShader:OM,triangulation:a1,inject:e.getInject(),primitive:Ee.TRIANGLES,depth:{enable:!1},pickingEnabled:!1,diagnosticDerivativeUniformityEnabled:!1})]})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy()}registerBuiltinAttributes(){const e=this.layer.getSource().extent,[r,n,a,u]=e,y=a-r,A=u-n;this.styleAttributeService.registerStyleAttribute({name:"waterUv",type:Vr.Attribute,descriptor:{name:"a_uv",shaderLocation:Ro.UV,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(O,Z,Y,Q)=>{const ae=O.version==="GAODE2.x"?O.originCoordinates[0][Q]:Y,[xe,Be]=ae;return[(xe-r)/y,(Be-n)/A]}}})}loadTexture(){const{waterTexture:e}=this.layer.getLayerConfig(),{createTexture2D:r}=this.rendererService;this.texture=r({height:1,width:1});const n=new Image;n.crossOrigin="",e?(console.warn("L7 recommend\uFF1Ahttps://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ"),n.src=e):n.src="https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ",n.onload=()=>{this.texture=r({data:n,width:n.width,height:n.height,wrapS:Ee.MIRRORED_REPEAT,wrapT:Ee.MIRRORED_REPEAT,min:Ee.LINEAR,mag:Ee.LINEAR}),this.layerService.reRender()}}}var kM={fill:RM,line:Lw,extrude:EM,text:Gw,point_fill:Bw,point_image:Fw,point_normal:Nw,point_extrude:Ow,water:FM,ocean:DM,extrusion:TM};class u1 extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","PolygonLayer"),(0,K.Z)(this,"enableShaderEncodeStyles",["opacity","extrusionBase","rotation","offsets","stroke"])}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new kM[r](e),yield e.initLayerModels()})()}getModelType(){var e;const r=this.styleAttributeService.getLayerStyleAttribute("shape"),n=r==null||(e=r.scale)===null||e===void 0?void 0:e.field;return n==="fill"||!n?"fill":n==="extrude"?"extrude":n==="extrusion"?"extrusion":n==="water"?"water":n==="ocean"?"ocean":n==="line"?"line":this.getPointModelType()}getPointModelType(){const e=this.getEncodedData(),{shape2d:r,shape3d:n}=this.getLayerConfig(),a=this.iconService.getIconMap(),u=e.find(y=>y.hasOwnProperty("shape"));if(u){const y=u.shape;return y==="dot"?"point_normal":(r==null?void 0:r.indexOf(y))!==-1?"point_fill":(n==null?void 0:n.indexOf(y))!==-1?"point_extrude":a.hasOwnProperty(y)?"point_image":"text"}else return"fill"}}const NM=`layout(std140) uniform commonUniforms { vec2 u_domain; float u_opacity; float u_noDataValue; float u_clampLow; float u_clampHigh; }; uniform sampler2D u_rasterTexture; uniform sampler2D u_colorTexture; in vec2 v_texCoord; bool isnan_emu(float x) { return (x > 0.0 || x < 0.0) ? x != x : x != 0.0; } out vec4 outputColor; void main() { // Can use any component here since u_rasterTexture is under luminance format. float value = texture(SAMPLER_2D(u_rasterTexture), vec2(v_texCoord.x, v_texCoord.y)).r; if (value == u_noDataValue || isnan_emu(value)) { discard; } else if ((u_clampLow < 0.5 && value < u_domain[0]) || (u_clampHigh < 0.5 && value > u_domain[1])) { discard; } else { float normalisedValue =(value - u_domain[0]) / (u_domain[1] - u_domain[0]); vec4 color = texture(SAMPLER_2D(u_colorTexture), vec2(normalisedValue, 0)); outputColor = color; outputColor.a = outputColor.a * u_opacity ; if (outputColor.a < 0.01) discard; } } `,zM=` layout(location = 0) in vec3 a_Position; layout(location = 14) in vec2 a_Uv; layout(std140) uniform commonUniforms { vec2 u_domain; float u_opacity; float u_noDataValue; float u_clampLow; float u_clampHigh; }; out vec2 v_texCoord; #pragma include "projection" void main() { v_texCoord = a_Uv; vec4 project_pos = project_position(vec4(a_Position, 1.0)); gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0)); } `;class Ww extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"colorTexture",void 0)}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{opacity:e=1,clampLow:r=!0,clampHigh:n=!0,noDataValue:a=-9999999,domain:u,rampColors:y}=this.layer.getLayerConfig(),A=u||Io(y);this.colorTexture=this.layer.textureService.getColorTexture(y,A);const O={u_domain:A,u_opacity:e||1,u_noDataValue:a,u_clampLow:r?1:0,u_clampHigh:(typeof n!="undefined"?n:r)?1:0,u_rasterTexture:this.texture,u_colorTexture:this.colorTexture};return this.textures=[this.texture,this.colorTexture],this.getUniformsBufferInfo(O)}getRasterData(e){return(0,Nr.Z)(function*(){if(Array.isArray(e.data))return{data:e.data,width:e.width,height:e.height};{const{rasterData:r,width:n,height:a}=yield e.data;return{data:Array.from(r),width:n,height:a}}})()}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){e.initUniformsBuffer();const r=e.layer.getSource(),{createTexture2D:n,queryVerdorInfo:a}=e.rendererService,u=r.data.dataArray[0],{data:y,width:A,height:O}=yield e.getRasterData(u);return e.texture=n({data:new Float32Array(y),width:A,height:O,format:a()==="WebGL1"?Ee.LUMINANCE:Ee.RED,type:Ee.FLOAT,alignment:1}),[yield e.layer.buildLayerModel({moduleName:"rasterImageData",vertexShader:zM,fragmentShader:NM,triangulation:h_,primitive:Ee.TRIANGLES,depth:{enable:!1},pickingEnabled:!1})]})()}clearModels(){var e,r;(e=this.texture)===null||e===void 0||e.destroy(),(r=this.colorTexture)===null||r===void 0||r.destroy()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{shaderLocation:Ro.UV,name:"a_Uv",buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}const UM=["data"],ZM=["rasterData"],VM=`uniform sampler2D u_texture; layout(std140) uniform commonUniforms { vec2 u_rminmax; vec2 u_gminmax; vec2 u_bminmax; float u_opacity; float u_noDataValue; }; in vec2 v_texCoord; out vec4 outputColor; void main() { vec3 rgb = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y)).rgb; if(rgb == vec3(u_noDataValue)) { outputColor = vec4(0.0, 0, 0, 0.0); } else { outputColor = vec4(rgb.r / (u_rminmax.y -u_rminmax.x), rgb.g /(u_gminmax.y -u_gminmax.x), rgb.b/ (u_bminmax.y - u_bminmax.x), u_opacity); } if(outputColor.a < 0.01) discard; }`,jM=` layout(location = 0) in vec3 a_Position; layout(location = 14) in vec2 a_Uv; layout(std140) uniform commonUniforms { vec2 u_rminmax; vec2 u_gminmax; vec2 u_bminmax; float u_opacity; float u_noDataValue; }; out vec2 v_texCoord; #pragma include "projection" void main() { v_texCoord = a_Uv; vec4 project_pos = project_position(vec4(a_Position, 1.0)); gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0)); } `;class HM extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"dataOption",{})}getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{opacity:e=1,noDataValue:r=0}=this.layer.getLayerConfig(),{rMinMax:n=[0,255],gMinMax:a=[0,255],bMinMax:u=[0,255]}=this.dataOption,y={u_rminmax:n,u_gminmax:a,u_bminmax:u,u_opacity:e||1,u_noDataValue:r,u_texture:this.texture};return this.textures=[this.texture],this.getUniformsBufferInfo(y)}getRasterData(e){var r=this;return(0,Nr.Z)(function*(){if(Array.isArray(e.data)){const{data:y}=e,A=(0,Ge.Z)(e,UM);return r.dataOption=A,(0,Wt.Z)({data:y},A)}const n=yield e.data,{rasterData:a}=n,u=(0,Ge.Z)(n,ZM);return r.dataOption=u,Array.isArray(a)?(0,Wt.Z)({data:a},u):(0,Wt.Z)({data:Array.from(a)},u)})()}initModels(){var e=this;return(0,Nr.Z)(function*(){e.initUniformsBuffer();const r=e.layer.getSource(),{createTexture2D:n}=e.rendererService,a=r.data.dataArray[0],{data:u,width:y,height:A}=yield e.getRasterData(a);return e.texture=n({data:new Float32Array(u),width:y,height:A,format:Ee.RGB,type:Ee.FLOAT}),[yield e.layer.buildLayerModel({moduleName:"rasterImageDataRGBA",vertexShader:jM,fragmentShader:VM,triangulation:h_,primitive:Ee.TRIANGLES,depth:{enable:!1},pickingEnabled:!1})]})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initModels()})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}const GM=`uniform sampler2D u_texture; uniform sampler2D u_colorTexture; layout(std140) uniform commonUniforms { vec4 u_unpack; vec2 u_domain; float u_opacity; float u_noDataValue; float u_clampLow; float u_clampHigh; }; in vec2 v_texCoord; out vec4 outputColor; float getElevation(vec2 coord, float bias) { // Convert encoded elevation value to meters vec4 data = texture(SAMPLER_2D(u_texture), coord,bias) * 255.0; data.a = -1.0; return dot(data, u_unpack); } vec4 getColor(float value) { float normalisedValue =(value- u_domain[0]) / (u_domain[1] - u_domain[0]); vec2 coord = vec2(normalisedValue, 0); return texture(SAMPLER_2D(u_colorTexture), coord); } void main() { float value = getElevation(v_texCoord,0.0); if (value == u_noDataValue) { outputColor = vec4(0.0, 0, 0, 0.0); } else if ((u_clampLow < 0.5 && value < u_domain[0]) || (u_clampHigh < 0.5 && value > u_domain[1])) { outputColor = vec4(0.0, 0, 0, 0.0); } else { outputColor = getColor(value); outputColor.a = outputColor.a * u_opacity ; if(outputColor.a < 0.01) discard; } } `,WM=`layout(location = 0) in vec3 a_Position; layout(location = 14) in vec2 a_Uv; layout(std140) uniform commonUniforms { vec4 u_unpack; vec2 u_domain; float u_opacity; float u_noDataValue; float u_clampLow; float u_clampHigh; }; out vec2 v_texCoord; #pragma include "projection" void main() { v_texCoord = a_Uv; vec4 project_pos = project_position(vec4(a_Position, 1.0)); gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0)); } `;class XM extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0)}getCommonUniformsInfo(){const{opacity:e,clampLow:r=!0,clampHigh:n=!0,noDataValue:a=-9999999,domain:u,rampColors:y,colorTexture:A,rScaler:O=6553.6,gScaler:Z=25.6,bScaler:Y=.1,offset:Q=1e4}=this.layer.getLayerConfig(),ae=u||Io(y);let xe=A;A?this.layer.textureService.setColorTexture(A,y,ae):xe=this.layer.textureService.getColorTexture(y,ae);const Be={u_unpack:[O,Z,Y,Q],u_domain:ae,u_opacity:e||1,u_noDataValue:a,u_clampLow:r,u_clampHigh:typeof n!="undefined"?n:r,u_texture:this.texture,u_colorTexture:xe};return this.textures=[this.texture,xe],this.getUniformsBufferInfo(Be)}initModels(){var e=this;return(0,Nr.Z)(function*(){e.initUniformsBuffer();const r=e.layer.getSource(),{createTexture2D:n}=e.rendererService,a=yield r.data.images;return e.texture=n({data:a[0],width:a[0].width,height:a[0].height,min:Ee.LINEAR,mag:Ee.LINEAR}),[yield e.layer.buildLayerModel({moduleName:"RasterTileDataImage",vertexShader:WM,fragmentShader:GM,triangulation:h_,primitive:Ee.TRIANGLES,depth:{enable:!1}})]})()}clearModels(){var e;(e=this.texture)===null||e===void 0||e.destroy()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initModels()})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}var qM={raster:Ww,rasterRgb:HM,raster3d:Ww,rasterTerrainRgb:XM};class c1 extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","RasterLayer")}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new qM[r](e),yield e.initLayerModels()})()}getDefaultConfig(){const e=this.getModelType();return{raster:{},rasterRgb:{},raster3d:{},rasterTerrainRgb:{}}[e]}getModelType(){switch(this.layerSource.getParserType()){case"raster":return"raster";case"rasterRgb":return"rasterRgb";case"rgb":return"rasterRgb";case"image":return"rasterTerrainRgb";default:return"raster"}}getLegend(e){if(e!=="color")return{type:void 0,field:void 0,items:[]};const r=this.getLayerConfig().rampColors;return Tw(r,e)}}class YM{constructor({rendererService:e,layerService:r,parent:n}){(0,K.Z)(this,"tileResource",new Map),(0,K.Z)(this,"rendererService",void 0),(0,K.Z)(this,"layerService",void 0),(0,K.Z)(this,"parent",void 0),(0,K.Z)(this,"layerTiles",[]),this.rendererService=e,this.layerService=r,this.parent=n}get tiles(){return this.layerTiles}hasTile(e){return this.layerTiles.some(r=>r.key===e)}addTile(e){this.layerTiles.push(e)}getTile(e){return this.layerTiles.find(r=>r.key===e)}getVisibleTileBylngLat(e){return this.layerTiles.find(r=>r.isLoaded&&r.visible&&r.lnglatInBounds(e))}removeTile(e){const r=this.layerTiles.findIndex(a=>a.key===e),n=this.layerTiles.splice(r,1);n[0]&&n[0].destroy()}updateTileVisible(e){const r=this.getTile(e.key);if(e.isVisible)if(e.parent){const n=this.isChildrenLoaded(e.parent);r==null||r.updateVisible(n)}else r==null||r.updateVisible(!0);else if(e.parent){const n=this.isChildrenLoaded(e.parent);r==null||r.updateVisible(!n)}else r==null||r.updateVisible(!1)}isParentLoaded(e){const r=e.parent;if(!r)return!0;const n=this.getTile(r==null?void 0:r.key);return!!(n!=null&&n.isLoaded)}isChildrenLoaded(e){const r=e==null?void 0:e.children;return r.length===0?!0:r.every(n=>{const a=this.getTile(n==null?void 0:n.key);return a?(a==null?void 0:a.isLoaded)===!0:!0})}render(){var e=this;return(0,Nr.Z)(function*(){const n=e.getRenderLayers().map(function(){var a=(0,Nr.Z)(function*(u){yield e.layerService.renderTileLayer(u)});return function(u){return a.apply(this,arguments)}}());yield Promise.all(n)})()}getRenderLayers(){const e=this.layerTiles.filter(n=>n.visible&&n.isLoaded),r=[];return e.map(n=>r.push(...n.getLayers())),r}getLayers(){const e=this.layerTiles.filter(n=>n.isLoaded),r=[];return e.map(n=>r.push(...n.getLayers())),r}getTiles(){return this.layerTiles}destroy(){this.layerTiles.forEach(e=>e.destroy()),this.tileResource.clear()}}var $M=Se(23167);function KM(t,e,r){r===void 0&&(r={});var n=un(t),a=un(e),u=$M.union(n.coordinates,a.coordinates);return u.length===0?null:u.length===1?Cr(u[0],r.properties):So(u,r.properties)}var JM=KM;class QM{getCombineFeature(e){let r=null;const n=e[0];return e.map(a=>{const u=Cr(a.coordinates);r===null?r=u:r=JM(r,u)}),n&&(r.properties=(0,Wt.Z)({},n)),r}}const f_="select",d_="active";class e4{constructor({layerService:e,tileLayerService:r,parent:n}){(0,K.Z)(this,"layerService",void 0),(0,K.Z)(this,"tileLayerService",void 0),(0,K.Z)(this,"tileSourceService",void 0),(0,K.Z)(this,"parent",void 0),(0,K.Z)(this,"tilePickID",new Map),this.layerService=e,this.tileLayerService=r,this.parent=n,this.tileSourceService=new QM}pickRender(e){const r=this.tileLayerService.getVisibleTileBylngLat(e.lngLat);if(r){const n=r.getMainLayer();n==null||n.layerPickService.pickRender(e)}}pick(e,r){var n=this;return(0,Nr.Z)(function*(){const u=n.parent.getContainer().pickingService;if(e.type==="RasterLayer"){const y=n.tileLayerService.getVisibleTileBylngLat(r.lngLat);if(y&&y.getMainLayer()!==void 0){const A=y.getMainLayer();return A.layerPickService.pickRasterLayer(A,r,n.parent)}return!1}return n.pickRender(r),u.pickFromPickingFBO(e,r)})()}selectFeature(e){const[r,n,a]=e,u=this.color2PickId(r,n,a);this.tilePickID.set(f_,u),this.updateHighLight(r,n,a,f_)}highlightPickedFeature(e){const[r,n,a]=e,u=this.color2PickId(r,n,a);this.tilePickID.set(d_,u),this.updateHighLight(r,n,a,d_)}updateHighLight(e,r,n,a){this.tileLayerService.tiles.map(u=>{const y=u.getMainLayer();switch(a){case f_:y==null||y.hooks.beforeSelect.call([e,r,n]);break;case d_:y==null||y.hooks.beforeHighlight.call([e,r,n]);break}})}setPickState(){const e=this.tilePickID.get(f_),r=this.tilePickID.get(d_);if(e){const[n,a,u]=this.pickId2Color(e);this.updateHighLight(n,a,u,f_);return}if(r){const[n,a,u]=this.pickId2Color(r);this.updateHighLight(n,a,u,d_);return}}color2PickId(e,r,n){return Aa(new Uint8Array([e,r,n]))}pickId2Color(e){return Ni(e)}getFeatureById(e){const r=this.tileLayerService.getTiles().filter(a=>a.visible),n=[];return r.forEach(a=>{n.push(...a.getFeatureById(e))}),n}pickRasterLayer(){return!1}}function t4(t){return t==="PolygonLayer"?u1:t==="LineLayer"?m2:l1}function r4(t){return["PolygonLayer","LineLayer"].indexOf(t)!==-1}class n0 extends Yl.EventEmitter{constructor(e,r){super(),(0,K.Z)(this,"x",void 0),(0,K.Z)(this,"y",void 0),(0,K.Z)(this,"z",void 0),(0,K.Z)(this,"key",void 0),(0,K.Z)(this,"parent",void 0),(0,K.Z)(this,"sourceTile",void 0),(0,K.Z)(this,"visible",!0),(0,K.Z)(this,"layers",[]),(0,K.Z)(this,"isLoaded",!1),(0,K.Z)(this,"tileMaskLayers",[]),(0,K.Z)(this,"tileMask",void 0),this.parent=r,this.sourceTile=e,this.x=e.x,this.y=e.y,this.z=e.z,this.key=`${this.x}_${this.y}_${this.z}`}getLayers(){return this.layers}styleUpdate(...e){}lnglatInBounds(e){const[r,n,a,u]=this.sourceTile.bounds,{lng:y,lat:A}=e;return y>=r&&y<=a&&A>=n&&A<=u}getLayerOptions(){var e;const r=this.parent.getLayerConfig();return(0,Wt.Z)((0,Wt.Z)({},r),{},{textAllowOverlap:!0,autoFit:!1,maskLayers:this.getMaskLayer(),tileMask:r4(this.parent.type),mask:r.mask||((e=r.maskLayers)===null||e===void 0?void 0:e.length)!==0&&r.enableMask})}getMaskLayer(){const{maskLayers:e}=this.parent.getLayerConfig(),r=[];return e==null||e.forEach(n=>{if(!n.tileLayer)return r.push(n),n;const u=n.tileLayer.getTile(this.sourceTile.key),y=u==null?void 0:u.getLayers()[0];y&&r.push(y)}),r}addTileMask(){var e=this;return(0,Nr.Z)(function*(){const r=new u1({name:"mask",visible:!0,enablePicking:!1}).source({type:"FeatureCollection",features:[e.sourceTile.bboxPolygon]},{parser:{type:"geojson",featureId:"id"}}).shape("fill").color("#0f0").style({opacity:.5}),n=cp(e.parent.container);r.setContainer(n),yield r.init(),e.tileMask=r;const a=e.getMainLayer();return a!==void 0&&(a.tileMask=r),r})()}addMask(e,r){var n=this;return(0,Nr.Z)(function*(){const a=cp(n.parent.container);r.setContainer(a),yield r.init(),e.addMask(r),n.tileMaskLayers.push(r)})()}addLayer(e){var r=this;return(0,Nr.Z)(function*(){e.isTileLayer=!0;const n=cp(r.parent.container);e.setContainer(n),r.layers.push(e),yield e.init()})()}updateVisible(e){this.visible=e,this.updateOptions("visible",e)}updateOptions(e,r){this.layers.forEach(n=>{n.updateLayerConfig({[e]:r})})}getMainLayer(){return this.layers[0]}getFeatures(e){return[]}getFeatureById(e){return[]}destroy(){var e;(e=this.tileMask)===null||e===void 0||e.destroy(),this.layers.forEach(r=>r.destroy())}}class n4 extends n0{initTileLayer(){var e=this;return(0,Nr.Z)(function*(){const r=e.getSourceOption(),n=r.data.features[0].properties,a=new m2().source(r.data,r.options).size(1).shape("line").color("red"),u=new l1({minZoom:e.z-1,maxZoom:e.z+1,textAllowOverlap:!0}).source([n],{parser:{type:"json",x:"x",y:"y"}}).size(20).color("red").shape(e.key).style({stroke:"#fff",strokeWidth:2});yield e.addLayer(a),yield e.addLayer(u),e.isLoaded=!0})()}getSourceOption(){const e=this.parent.getSource();return{data:{type:"FeatureCollection",features:this.sourceTile.data.layers.testTile.features},options:{parser:{type:"geojson"},transforms:e.transforms}}}}class i4 extends n0{initTileLayer(){var e=this;return(0,Nr.Z)(function*(){const r=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),a=e.getSourceOption(),u=new Cw((0,Wt.Z)({},n)).source(a.data,a.options);r&&Object.keys(r).forEach(y=>{var A,O;const Z=y;u[Z]((A=r[Z])===null||A===void 0?void 0:A.field,(O=r[Z])===null||O===void 0?void 0:O.values)}),yield e.addLayer(u),e.isLoaded=!0})()}getSourceOption(){const e=this.parent.getSource();return{data:this.sourceTile.data,options:{parser:{type:"image",extent:this.sourceTile.bounds},transforms:e.transforms}}}}const o4=`layout(std140) uniform commonUniorm { vec4 u_color; float u_opacity; }; out vec4 outputColor; void main() { outputColor = u_color; outputColor.a *= u_opacity; } `,a4=`layout(location = 0) in vec3 a_Position; layout(std140) uniform commonUniorm { vec4 u_color; float u_opacity; }; #pragma include "projection" void main() { vec4 project_pos = project_position(vec4(a_Position, 1.0)); if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0)); } else { gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0)); } } `;class s4 extends Ml{getUninforms(){const e=this.getCommonUniformsInfo(),r=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,Wt.Z)((0,Wt.Z)({},e.uniformsOption),r.uniformsOption)}getCommonUniformsInfo(){const{opacity:e=1,color:r="#000"}=this.layer.getLayerConfig(),n={u_color:Va(r),u_opacity:e||1};return this.getUniformsBufferInfo(n)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.buildModels()})()}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),[yield e.layer.buildLayerModel({moduleName:"mask",vertexShader:a4,fragmentShader:o4,triangulation:a1,depth:{enable:!1},pick:!1})]})()}clearModels(e=!0){e&&this.layerService.clear()}registerBuiltinAttributes(){return""}}var l4={fill:s4};class v2 extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","MaskLayer")}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new l4[r](e),yield e.initLayerModels()})()}getModelType(){return"fill"}}class u4 extends n0{initTileLayer(){var e=this;return(0,Nr.Z)(function*(){const r=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),a=e.getSourceOption(),u=new v2((0,Wt.Z)({},n)).source(a.data,a.options);r&&Object.keys(r).forEach(y=>{var A,O;const Z=y;u[Z]((A=r[Z])===null||A===void 0?void 0:A.field,(O=r[Z])===null||O===void 0?void 0:O.values)}),yield e.addLayer(u),e.isLoaded=!0})()}getFeatures(e){return e?this.sourceTile.data.getTileData(e):[]}getSourceOption(){const e=this.parent.getSource(),{sourceLayer:r,featureId:n}=this.parent.getLayerConfig();return{data:{type:"FeatureCollection",features:this.getFeatures(r)},options:{parser:{type:"geojson",featureId:n},transforms:e.transforms}}}}const c4=["rasterData"];class h4 extends n0{initTileLayer(){var e=this;return(0,Nr.Z)(function*(){const r=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),a=e.getSourceOption(),u=new c1((0,Wt.Z)({},n)).source(a.data,a.options);r&&Object.keys(r).forEach(y=>{var A,O;const Z=y;u[Z]((A=r[Z])===null||A===void 0?void 0:A.field,(O=r[Z])===null||O===void 0?void 0:O.values)}),yield e.addLayer(u),e.isLoaded=!0})()}getSourceOption(){const e=this.parent.getSource(),r=this.sourceTile.data.data,{rasterData:n}=r,a=(0,Ge.Z)(r,c4);return{data:n,options:{parser:(0,Wt.Z)({type:"rasterRgb",extent:this.sourceTile.bounds},a),transforms:e.transforms}}}}class p4 extends n0{initTileLayer(){var e=this;return(0,Nr.Z)(function*(){const r=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),a=e.getSourceOption(),u=new c1((0,Wt.Z)({},n)).source(a.data,a.options);r&&Object.keys(r).forEach(y=>{var A,O;const Z=y;u[Z]((A=r[Z])===null||A===void 0?void 0:A.field,(O=r[Z])===null||O===void 0?void 0:O.values)}),yield e.addLayer(u),e.isLoaded=!0})()}getSourceOption(){const e=this.parent.getSource();return{data:this.sourceTile.data,options:{parser:{type:"image",extent:this.sourceTile.bounds},transforms:e.transforms}}}}const f4=["rasterData"],d4={positions:[0,1],colors:["#000","#fff"]};class m4 extends n0{constructor(...e){super(...e),(0,K.Z)(this,"colorTexture",void 0)}initTileLayer(){var e=this;return(0,Nr.Z)(function*(){const r=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),a=e.getSourceOption(),{rampColors:u,domain:y}=e.getLayerOptions();e.colorTexture=e.parent.textureService.getColorTexture(u,y);const A=new c1((0,Wt.Z)((0,Wt.Z)({},n),{},{colorTexture:e.colorTexture})).source(a.data,a.options);r&&Object.keys(r).forEach(O=>{var Z,Y;const Q=O;A[Q]((Z=r[Q])===null||Z===void 0?void 0:Z.field,(Y=r[Q])===null||Y===void 0?void 0:Y.values)}),yield e.addLayer(A),e.isLoaded=!0})()}getSourceOption(){const e=this.parent.getSource(),r=this.sourceTile.data.data,{rasterData:n}=r,a=(0,Ge.Z)(r,f4);return{data:n,options:{parser:(0,Wt.Z)({type:"raster",extent:this.sourceTile.bounds},a),transforms:e.transforms}}}styleUpdate(...e){const{rampColors:r=d4,domain:n}=e;this.colorTexture=this.parent.textureService.getColorTexture(r,n||Io(r)),this.layers.forEach(a=>a.style({colorTexture:this.colorTexture}))}destroy(){this.layers.forEach(e=>e.destroy())}}class h1 extends n0{initTileLayer(){var e=this;return(0,Nr.Z)(function*(){const r=e.parent.getLayerAttributeConfig(),n=e.getLayerOptions(),a=t4(e.parent.type),u=e.getSourceOption();if(!u){e.isLoaded=!0,e.emit("loaded");return}const y=new a((0,Wt.Z)({},n)).source(u.data,u.options);Object.keys(r).forEach(A=>{var O,Z;const Y=A;y[Y]((O=r[Y])===null||O===void 0?void 0:O.field,(Z=r[Y])===null||Z===void 0?void 0:Z.values)}),yield e.addLayer(y),n.tileMask&&(yield e.addTileMask()),e.setLayerMinMaxZoom(y),e.isLoaded=!0,e.emit("loaded")})()}getSourceOption(){const e=this.parent.getSource(),{sourceLayer:r="defaultLayer",featureId:n="id"}=this.parent.getLayerConfig();return{data:{type:"FeatureCollection",features:this.getFeatures(r)},options:{parser:{type:"geojson",featureId:n},transforms:e.transforms}}}setLayerMinMaxZoom(e){e.getModelType()==="text"&&e.updateLayerConfig({maxZoom:this.z+1,minZoom:this.z-1})}getFeatures(e){return this.sourceTile.data.getTileData(e)}getFeatureById(e){const r=this.getMainLayer();return r?r.getSource().data.dataArray.filter(a=>a._id===e):[]}}function g4(t){switch(t.type){case"PolygonLayer":return h1;case"LineLayer":return h1;case"PointLayer":return h1;case"TileDebugLayer":return n4;case"MaskLayer":return u4;case"RasterLayer":const{dataType:r}=t.getSource().parser;switch(r){case Vh.RGB:case Vh.CUSTOMRGB:return h4;case Vh.ARRAYBUFFER:case Vh.CUSTOMARRAYBUFFER:return m4;case Vh.TERRAINRGB:case Vh.CUSTOMTERRAINRGB:return p4;default:return i4}default:return h1}}const v4=["shape","color","size","style","animate","filter","rotate","scale","setBlend","setSelect","setActive","disableMask","enableMask","addMask","removeMask"],{debounce:_4}=es;class Xw{constructor(e){(0,K.Z)(this,"parent",void 0),(0,K.Z)(this,"tileLayerService",void 0),(0,K.Z)(this,"mapService",void 0),(0,K.Z)(this,"layerService",void 0),(0,K.Z)(this,"rendererService",void 0),(0,K.Z)(this,"pickingService",void 0),(0,K.Z)(this,"tilePickService",void 0),(0,K.Z)(this,"tilesetManager",void 0),(0,K.Z)(this,"initedTileset",!1),(0,K.Z)(this,"lastViewStates",void 0),(0,K.Z)(this,"mapchange",()=>{var n;if(this.parent.isVisible()===!1)return;const{latLonBounds:a,zoom:u}=this.getCurrentView();if(this.mapService.version==="GAODE1.x"){const{visible:y}=this.parent.getLayerConfig();u<2&&y?(this.parent.updateLayerConfig({visible:!1}),this.layerService.reRender()):u>=2&&!y&&(this.parent.updateLayerConfig({visible:!0}),this.layerService.reRender())}this.lastViewStates&&this.lastViewStates.zoom===u&&this.lastViewStates.latLonBounds.toString()===a.toString()||(this.lastViewStates={zoom:u,latLonBounds:a},(n=this.tilesetManager)===null||n===void 0||n.throttleUpdate(u,a))}),(0,K.Z)(this,"viewchange",_4(this.mapchange,24)),this.parent=e;const r=this.parent.getContainer();this.rendererService=r.rendererService,this.layerService=r.layerService,this.mapService=r.mapService,this.pickingService=r.pickingService,this.tileLayerService=new YM({rendererService:this.rendererService,layerService:this.layerService,parent:e}),this.tilePickService=new e4({tileLayerService:this.tileLayerService,layerService:this.layerService,parent:e}),this.parent.setLayerPickService(this.tilePickService),this.proxy(e),this.initTileSetManager()}initTileSetManager(){var e;const r=this.parent.getSource();if(this.tilesetManager=r.tileset,this.initedTileset||(this.bindTilesetEvent(),this.initedTileset=!0),this.parent.isVisible()===!1)return;const{latLonBounds:n,zoom:a}=this.getCurrentView();(e=this.tilesetManager)===null||e===void 0||e.update(a,n)}getCurrentView(){const e=this.mapService.getBounds(),r=[e[0][0],e[0][1],e[1][0],e[1][1]],n=this.mapService.getZoom();return{latLonBounds:r,zoom:n}}bindTilesetEvent(){this.tilesetManager.on("tile-loaded",e=>{}),this.tilesetManager.on("tile-unload",e=>{this.tileUnLoad(e)}),this.tilesetManager.on("tile-error",(e,r)=>{this.tileError(e)}),this.tilesetManager.on("tile-update",()=>{this.tileUpdate()}),this.mapService.on("zoomend",this.mapchange),this.mapService.on("moveend",this.viewchange)}render(){this.tileLayerService.render()}getLayers(){return this.tileLayerService.getLayers()}getTiles(){return this.tileLayerService.getTiles()}getTile(e){return this.tileLayerService.getTile(e)}tileLoaded(e){}tileError(e){console.warn("error:",e)}destroy(){var e;this.mapService.off("zoomend",this.mapchange),this.mapService.off("moveend",this.viewchange),(e=this.tilesetManager)===null||e===void 0||e.destroy(),this.tileLayerService.destroy()}reload(){var e;this.tilesetManager.clear();const{latLonBounds:r,zoom:n}=this.getCurrentView();(e=this.tilesetManager)===null||e===void 0||e.update(n,r)}tileUnLoad(e){this.tileLayerService.removeTile(e.key)}tileUpdate(){var e=this;return(0,Nr.Z)(function*(){if(!e.tilesetManager)return;const r=e.parent.getMinZoom(),n=e.parent.getMaxZoom(),a=e.tilesetManager.tiles.filter(u=>u.isLoaded).filter(u=>u.isVisibleChange).filter(u=>u.data).filter(u=>u.z>=r&&u.z{const n=e[r].bind(e);e[r]=(...a)=>(n(...a),this.getLayers().map(u=>{u[r](...a)}),r==="style"&&this.getTiles().forEach(u=>u.styleUpdate(...a)),e)})}}class y4 extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","TileDebugLayer"),(0,K.Z)(this,"zIndex",1e4),(0,K.Z)(this,"defaultSourceConfig",{data:[],options:{parser:{type:"testTile"}}})}buildModels(){return(0,Nr.Z)(function*(){})()}}const x4=` layout(std140) uniform commonUniforms { float u_opacity; }; in vec3 vVertexNormal; in float v_offset; in vec4 v_Color; #pragma include "scene_uniforms" out vec4 outputColor; void main() { // float intensity = pow(0.5 + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0); float intensity = pow(v_offset + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0); // \u53BB\u9664\u80CC\u9762 if(intensity > 1.0) intensity = 0.0; outputColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity); } `,b4=`layout(location = 0) in vec3 a_Position; layout(location = 1) vec4 a_Color; layout(location = 13) in vec3 a_Normal; layout(location = 14) in vec2 a_Uv; layout(std140) uniform commonUniforms { float u_opacity; }; #pragma include "scene_uniforms" out vec3 vVertexNormal; out vec4 v_Color; out float v_offset; void main() { float EARTH_RADIUS = 100.0; v_Color = a_Color; v_offset = min(((length(u_CameraPosition) - EARTH_RADIUS)/600.0) * 0.5 + 0.4, 1.0); vVertexNormal = a_Normal; gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0); } `,{isNumber:E4}=es;class w4 extends Ml{getCommonUniformsInfo(){const{opacity:e=1}=this.layer.getLayerConfig(),r={u_opacity:E4(e)?e:1};return this.getUniformsBufferInfo(r)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.buildModels()})()}clearModels(){return""}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.layer.zIndex=-997,[yield e.layer.buildLayerModel({moduleName:"earthAtmoSphere",vertexShader:b4,fragmentShader:x4,triangulation:Sw,depth:{enable:!1},blend:e.getBlend()})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}const S4=`uniform sampler2D u_texture; in vec2 v_texCoord; in float v_lightWeight; out vec4 outputColor; void main() { vec4 color = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y)); color.xyz = color.xyz * v_lightWeight; outputColor = color; } `,T4=`// attribute vec4 a_Color; layout(location = 0) in vec3 a_Position; layout(location = 13) in vec3 a_Normal; layout(location = 14) in vec2 a_Uv; // attribute vec2 a_Extrude; // attribute float a_Size; // attribute float a_Shape; layout(std140) uniform commonUniforms { vec4 u_sunLight: [1.0, -10.5, 12.0,0.0]; float u_ambientRatio : 0.5; float u_diffuseRatio : 0.3; float u_specularRatio : 0.2; }; #pragma include "scene_uniforms" out vec2 v_texCoord; out float v_lightWeight; float calc_lighting(vec4 pos) { vec3 worldPos = vec3(pos * u_ModelMatrix); vec3 worldNormal = a_Normal; // cal light weight vec3 viewDir = normalize(u_CameraPosition - worldPos); vec3 lightDir = normalize(u_sunLight.xyz); vec3 halfDir = normalize(viewDir+lightDir); // lambert float lambert = dot(worldNormal, lightDir); // specular float specular = pow(max(0.0, dot(worldNormal, halfDir)), 32.0); //sum to light weight float lightWeight = u_ambientRatio + u_diffuseRatio * lambert + u_specularRatio * specular; return lightWeight; } void main() { v_texCoord = a_Uv; float lightWeight = calc_lighting(vec4(a_Position, 1.0)); v_lightWeight = lightWeight; gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0); } `;class A4 extends Ml{constructor(...e){super(...e),(0,K.Z)(this,"texture",void 0),(0,K.Z)(this,"earthTime",3.4),(0,K.Z)(this,"sunX",1e3),(0,K.Z)(this,"sunY",1e3),(0,K.Z)(this,"sunZ",1e3),(0,K.Z)(this,"sunRadius",Math.sqrt(this.sunX*this.sunX+this.sunY*this.sunY+this.sunZ*this.sunZ))}getCommonUniformsInfo(){const{animateOption:e,globalOptions:r}=this.layer.getLayerConfig();e!=null&&e.enable&&(this.mapService.rotateY({reg:.002}),this.earthTime+=.02,this.sunY=10,this.sunX=Math.cos(this.earthTime)*(this.sunRadius-this.sunY),this.sunZ=Math.sin(this.earthTime)*(this.sunRadius-this.sunY));const n={u_sunLight:[this.sunX,this.sunY,this.sunZ,0],u_ambientRatio:(r==null?void 0:r.ambientRatio)||.6,u_diffuseRatio:(r==null?void 0:r.diffuseRatio)||.4,u_specularRatio:(r==null?void 0:r.specularRatio)||.1};return this.textures=[this.texture],this.getUniformsBufferInfo(n)}setEarthTime(e){this.earthTime=e,this.sunY=10,this.sunX=Math.cos(this.earthTime)*(this.sunRadius-this.sunY),this.sunZ=Math.sin(this.earthTime)*(this.sunRadius-this.sunY),this.layerService.throttleRenderLayers()}initModels(){var e=this;return(0,Nr.Z)(function*(){const{globalOptions:r}=e.layer.getLayerConfig();(r==null?void 0:r.earthTime)!==void 0&&e.setEarthTime(r.earthTime);const n=e.layer.getSource(),{createTexture2D:a}=e.rendererService;return e.texture=a({height:0,width:0}),n.data.images.then(u=>{e.texture=a({data:u[0],width:u[0].width,height:u[0].height}),e.textures=[e.texture],e.layerService.reRender()}),e.initUniformsBuffer(),e.buildModels()})()}clearModels(){return""}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.layer.zIndex=-998,[yield e.layer.buildLayerModel({moduleName:"earthBase",vertexShader:T4,fragmentShader:S4,triangulation:Sw,depth:{enable:!0},blend:e.getBlend()})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}const C4=` in vec3 vVertexNormal; in vec4 v_Color; layout(std140) uniform commonUniforms { float u_opacity; }; out vec4 outputColor; #pragma include "scene_uniforms" void main() { float intensity = - dot(normalize(vVertexNormal), normalize(u_CameraPosition)); // \u53BB\u9664\u80CC\u9762 if(intensity > 1.0) intensity = 0.0; outputColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity); } `,M4=`layout(location = 0) in vec3 a_Position; layout(location = 1) vec4 a_Color; layout(location = 13) in vec3 a_Normal; layout(location = 14) in vec2 a_Uv; layout(std140) uniform commonUniforms { float u_opacity; }; #pragma include "scene_uniforms" out vec3 vVertexNormal; out vec4 v_Color; void main() { v_Color = a_Color; vVertexNormal = a_Normal; gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0); } `,{isNumber:P4}=es;class R4 extends Ml{getCommonUniformsInfo(){const{opacity:e=1}=this.layer.getLayerConfig(),r={u_opacity:P4(e)?e:1};return this.getUniformsBufferInfo(r)}initModels(){var e=this;return(0,Nr.Z)(function*(){return e.initUniformsBuffer(),e.buildModels()})()}clearModels(){return""}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.layer.zIndex=-999,[yield e.layer.buildLayerModel({moduleName:"earthBloom",vertexShader:M4,fragmentShader:C4,triangulation:yC,depth:{enable:!1},blend:e.getBlend()})]})()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"size",type:Vr.Attribute,descriptor:{name:"a_Size",shaderLocation:Ro.SIZE,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:1,update:e=>{const{size:r=1}=e;return Array.isArray(r)?[r[0]]:[r]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:Vr.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ro.NORMAL,buffer:{usage:Ee.STATIC_DRAW,data:[],type:Ee.FLOAT},size:3,update:(e,r,n,a,u)=>u}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",shaderLocation:Ro.UV,buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}}const I4={base:A4,atomSphere:w4,bloomSphere:R4},L4=["base","atomSphere","bloomSphere"];class D4 extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","EarthLayer"),(0,K.Z)(this,"defaultSourceConfig",{data:[],options:{parser:{type:"json"}}})}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new I4[r](e),yield e.initLayerModels()})()}setEarthTime(e){this.layerModel&&this.layerModel.setEarthTime?this.layerModel.setEarthTime(e):console.warn("\u8BF7\u5728 scene loaded \u4E4B\u540E\u6267\u884C\u8BE5\u65B9\u6CD5\uFF01")}getModelType(){var e;const r=this.styleAttributeService.getLayerStyleAttribute("shape");let n=(r==null||(e=r.scale)===null||e===void 0?void 0:e.field)||"base";return L4.indexOf(n)<0&&(n="base"),n}}function _2(t,e,r){const n=qw(t,t.VERTEX_SHADER,e),a=qw(t,t.FRAGMENT_SHADER,r);if(!n||!a)return null;const u=t.createProgram();if(!u)return null;if(t.attachShader(u,n),t.attachShader(u,a),t.linkProgram(u),!t.getProgramParameter(u,t.LINK_STATUS)){const Z=t.getProgramInfoLog(u);return console.warn("Failed to link program: "+Z),t.deleteProgram(u),t.deleteShader(a),t.deleteShader(n),null}const A=t.getProgramParameter(u,t.ACTIVE_ATTRIBUTES);for(let Z=0;Z{this.drawWind()})}getUninforms(){throw new Error("Method not implemented.")}initModels(){var e=this;return(0,Nr.Z)(function*(){var r,n;const{uMin:a=-21.32,uMax:u=26.8,vMin:y=-21.57,vMax:A=21.42,fadeOpacity:O=.996,speedFactor:Z=.25,dropRate:Y=.003,dropRateBump:Q=.01,rampColors:ae=Kw,sizeScale:xe=.5}=e.layer.getLayerConfig(),{createTexture2D:Be}=e.rendererService,it=e.layer.getSource();e.texture=Be({height:0,width:0}),e.cacheZoom=Math.floor(e.mapService.getZoom());const gt=e.rendererService.getGLContext();e.imageCoords=(r=it.data)===null||r===void 0?void 0:r.dataArray[0].coordinates,(n=it.data)===null||n===void 0||(n=n.images)===null||n===void 0||n.then(Rt=>{var Yt;e.sizeScale=xe*e.getZoomScale();const{imageWidth:vr,imageHeight:ln}=e.getWindSize(),cn={glContext:gt,imageWidth:vr,imageHeight:ln,fadeOpacity:O,speedFactor:Z,dropRate:Y,dropRateBump:Q,rampColors:ae};e.wind=new V4(cn),e.wind.setWind({uMin:a,uMax:u,vMin:y,vMax:A,image:Rt[0]}),(Yt=e.texture)===null||Yt===void 0||Yt.destroy(),e.texture=Be({width:vr,height:ln}),e.layerService.reRender()});const Bt=yield e.layer.buildLayerModel({moduleName:"wind",vertexShader:H4,fragmentShader:j4,triangulation:h_,primitive:Ee.TRIANGLES,depth:{enable:!1}});return e.colorModel=Bt,[Bt]})()}getWindSize(){const e=this.mapService.lngLatToPixel(this.imageCoords[0]),r=this.mapService.lngLatToPixel(this.imageCoords[1]),n=Math.min(Math.floor((r.x-e.x)*this.sizeScale),2048),a=Math.min(Math.floor((e.y-r.y)*this.sizeScale),2048);return{imageWidth:n,imageHeight:a}}buildModels(){var e=this;return(0,Nr.Z)(function*(){return e.initModels()})()}clearModels(){var e,r;(e=this.texture)===null||e===void 0||e.destroy(),(r=this.wind)===null||r===void 0||r.destroy()}registerBuiltinAttributes(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:Vr.Attribute,descriptor:{name:"a_Uv",buffer:{usage:Ee.DYNAMIC_DRAW,data:[],type:Ee.FLOAT},size:2,update:(e,r,n)=>[n[3],n[4]]}})}getZoomScale(){return Math.min((this.cacheZoom+4)/30*2,2)}drawWind(){if(this.wind){const{uMin:e=-21.32,uMax:r=26.8,vMin:n=-21.57,vMax:a=21.42,numParticles:u=65535,fadeOpacity:y=.996,speedFactor:A=.25,dropRate:O=.003,dropRateBump:Z=.01,rampColors:Y=Kw,sizeScale:Q=.5}=this.layer.getLayerConfig();let ae=u;const xe=Math.floor(this.mapService.getZoom());if(typeof Q=="number"&&Q!==this.sizeScale||xe!==this.cacheZoom){const Bt=this.getZoomScale();this.sizeScale=Q,ae*=Bt;const{imageWidth:Rt,imageHeight:Yt}=this.getWindSize();this.wind.reSize(Rt,Yt),this.cacheZoom=xe}this.wind.updateWindDir(e,r,n,a),this.wind.updateParticelNum(ae),this.wind.updateColorRampTexture(Y),this.wind.fadeOpacity=y,this.wind.speedFactor=A,this.wind.dropRate=O,this.wind.dropRateBump=Z;const{d:Be,w:it,h:gt}=this.wind.draw();this.rendererService.setBaseState(),this.texture.update({data:Be,width:it,height:gt})}}drawColorMode(e={}){var r;const{opacity:n}=this.layer.getLayerConfig();this.layerService.beforeRenderData(this.layer),this.layer.hooks.beforeRender.call(),this.layerService.renderMask(this.layer.masks),(r=this.colorModel)===null||r===void 0||r.draw({uniforms:{u_opacity:n||1,u_texture:this.texture},blend:this.getBlend(),stencil:this.getStencil(e)}),this.layer.hooks.afterRender.call()}}var W4={wind:G4};class X4 extends Yd{constructor(...e){super(...e),(0,K.Z)(this,"type","WindLayer")}buildModels(){var e=this;return(0,Nr.Z)(function*(){const r=e.getModelType();e.layerModel=new W4[r](e),yield e.initLayerModels()})()}renderModels(e={}){return this.layerModel&&this.layerModel.render(e),this}getDefaultConfig(){const e=this.getModelType();return{wind:{}}[e]}getModelType(){return"wind"}}class q4 extends Xd{constructor(...e){super(...e),(0,K.Z)(this,"isMoving",!1),(0,K.Z)(this,"maskLayer",void 0),(0,K.Z)(this,"move",r=>{switch(r.stopPropagation(),r.type){case"touchcancel":case"touchend":case"mouseup":{var n;this.isMoving=!1,["mouseup","mousemove","touchend","touchcancel","touchmove"].forEach(a=>{document.removeEventListener(a,this.move)}),(n=this.scene)===null||n===void 0||n.render();break}case"mousedown":case"touchstart":this.isMoving=!0,["mouseup","mousemove","touchend","touchcancel","touchmove"].forEach(a=>{document.addEventListener(a,this.move)});case"mousemove":case"touchmove":{if(this.isMoving)if(this.controlOption.orientation==="vertical"){let a;if("pageX"in r?a=r.pageX:r.touches&&r.touches.length&&r.touches[0].pageX?a=r.touches[0].pageX:r.changedTouches&&r.changedTouches.length&&(a=r.changedTouches[0].pageX),!a)break;const u=this.getContainerDOMRect(),y=this.getContainerSize(),A=y[0],O=(u==null?void 0:u.left)||0,Z=a-O+window.scrollX-document.documentElement.clientLeft,Y=A-Math.min(Math.max(0,A-Z),A),Q=Y/A;this.setOptions({ratio:Q}),this.emit("moving",{size:[Y,y[1]],ratio:[Q,0]})}else{let a;if("pageY"in r?a=r.pageY:r.touches&&r.touches.length&&r.touches[0].pageY?a=r.touches[0].pageY:r.changedTouches&&r.changedTouches.length&&(a=r.changedTouches[0].pageY),!a)break;const u=this.getContainerDOMRect(),y=this.getContainerSize(),A=y[1],O=(u==null?void 0:u.top)||0,Z=a-O+window.scrollY-document.documentElement.clientTop,Y=A-Math.min(Math.max(0,A-Z),A),Q=Y/A;this.setOptions({ratio:Q}),this.emit("moving",{size:[y[0],Y],ratio:[0,Q]})}break}default:break}}),(0,K.Z)(this,"getMaskLayer",()=>(console.log(this.getMaskGeoData()),new u1({visible:!1}).source(this.getMaskGeoData()).shape("fill").color("red").style({opacity:.1}))),(0,K.Z)(this,"updateMask",()=>{var r;if(!this.mapsService)return;const n=this.getMaskGeoData();(r=this.maskLayer)===null||r===void 0||r.setData(n)})}getDefault(){return(0,Wt.Z)((0,Wt.Z)({},super.getDefault()),{},{layers:[],rightLayers:[],ratio:.5,orientation:"vertical"})}onAdd(){const e=Xo("div","l7-control-swipe");Xo("button","l7-control-swipe__button",e);const{orientation:r="vertical",ratio:n=.5}=this.controlOption;return r==="horizontal"?(e.style.top=n*100+"%",e.style.left=""):(e.style.left=n*100+"%",e.style.top=""),e.classList.add(r),e}addTo(e){this.mapsService=e.mapService,this.renderService=e.rendererService,this.layerService=e.layerService,this.controlService=e.controlService,this.configService=e.globalConfigService,this.scene=e.sceneService,this.sceneContainer=e,this.isShow=!0,this.container=this.onAdd();const{className:r,style:n,layers:a,rightLayers:u}=this.controlOption;r&&this.setClassName(r),n&&this.setStyle(n),this.mapsService.getMarkerContainer().appendChild(this.container),this.maskLayer=this.getMaskLayer(),this.registerEvent();const y=cp(e);return this.maskLayer.setContainer(y),this.scene.addLayer(this.maskLayer),this.addMaskToLayers(a,!1),this.addMaskToLayers(u,!0),this.emit("add",this),this}onRemove(){if(this.maskLayer){var e;const{layers:r,rightLayers:n}=this.controlOption;this.removeMaskFromLayers(r),this.removeMaskFromLayers(n),(e=this.layerService)===null||e===void 0||e.remove(this.maskLayer)}this.unRegisterEvent(),this.removeAllListeners()}show(){var e;const r=this.container;tc(r,"l7-control-swipe_hide");const{layers:n,rightLayers:a}=this.controlOption;n.forEach(u=>u.enableMask()),a.forEach(u=>u.enableMask()),(e=this.scene)===null||e===void 0||e.render(),this.isShow=!0,this.emit("show",this)}hide(){var e;const r=this.container;dl(r,"l7-control-swipe_hide");const{layers:n,rightLayers:a}=this.controlOption;n.forEach(u=>u.disableMask()),a.forEach(u=>u.disableMask()),(e=this.scene)===null||e===void 0||e.render(),this.isShow=!1,this.emit("hide",this)}setOptions(e){const r=(0,Wt.Z)((0,Wt.Z)({},this.controlOption),e);if(e.className&&this.setClassName(e.className),e.style&&this.setStyle(e.style),(e.orientation||e.ratio!==void 0)&&this.setOrientationAndRatio(r.orientation,r.ratio),e.layers){const n=e.layers,a=this.controlOption.layers;this.setLayers(n,a,!1)}if(e.rightLayers){const n=e.rightLayers,a=this.controlOption.rightLayers;this.setLayers(n,a,!0)}this.controlOption=r,this.updateMask()}registerEvent(){this.container.addEventListener("mousedown",this.move),this.container.addEventListener("touchstart",this.move),this.mapsService.on("camerachange",this.updateMask)}unRegisterEvent(){var e;this.container.removeEventListener("mousedown",this.move),this.container.removeEventListener("touchstart",this.move),(e=this.mapsService)===null||e===void 0||e.off("camerachange",this.updateMask)}setOrientationAndRatio(e="vertical",r=.5){this.container.classList.remove("horizontal","vertical"),this.container.classList.add(e),e==="horizontal"?(this.container.style.top=r*100+"%",this.container.style.left=""):(this.container.style.left=r*100+"%",this.container.style.top="")}setLayers(e,r,n=!1){const a=e.filter(y=>r.includes(y)===!1),u=r.filter(y=>e.includes(y)===!1);this.addMaskToLayers(a,n),this.removeMaskFromLayers(u)}addMaskToLayers(e,r){e.forEach(n=>{n.updateLayerConfig({maskInside:!r}),n.addMask(this.maskLayer)})}removeMaskFromLayers(e){e.forEach(r=>{r.updateLayerConfig({maskInside:!0}),r.removeMask(this.maskLayer)})}getMaskGeoData(){const{ratio:e=.5,orientation:r="vertical"}=this.controlOption,n=r==="vertical",[a,u]=this.getBounds(),[y,A]=a,[O,Z]=u;let Y;if(n){const ae=y+(O-y)*e;Y=[[y,Z],[ae,Z],[ae,A],a,[y,Z]]}else{const ae=this.getContainerSize(),Be=this.mapsService.containerToLngLat([ae[0],ae[1]*e]).lat;Y=[[y,Z],u,[O,Be],[y,Be],[y,Z]]}return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[Y]}}]}}getContainerDOMRect(){var e;return(e=this.mapsService.getContainer())===null||e===void 0?void 0:e.getBoundingClientRect()}getContainerSize(){return this.mapsService.getSize()}getBounds(){return this.mapsService.getBounds()}addLayer(e,r=!1){const n=Array.isArray(e)?e:[e];if(r){const a=this.controlOption.rightLayers.concat(...n);this.setOptions({rightLayers:a})}else{const a=this.controlOption.layers.concat(...n);this.setOptions({layers:a})}}removeLayer(e){const r=Array.isArray(e)?e:[e],n=this.controlOption.layers.filter(u=>r.includes(u)),a=this.controlOption.rightLayers.filter(u=>r.includes(u));this.setOptions({layers:n,rightLayers:a})}removeLayers(){this.setOptions({layers:[],rightLayers:[]})}}class Y4 extends Xd{constructor(...e){super(...e),(0,K.Z)(this,"disabled",void 0),(0,K.Z)(this,"zoomInButton",void 0),(0,K.Z)(this,"zoomOutButton",void 0),(0,K.Z)(this,"zoomNumDiv",void 0),(0,K.Z)(this,"zoomIn",()=>{!this.disabled&&this.mapsService.getZoom(){!this.disabled&&this.mapsService.getZoom()>this.mapsService.getMinZoom()&&this.mapsService.zoomOut()}),(0,K.Z)(this,"updateDisabled",()=>{const r=this.mapsService;this.zoomInButton.removeAttribute("disabled"),this.zoomOutButton.removeAttribute("disabled"),(this.disabled||r.getZoom()<=r.getMinZoom())&&this.zoomOutButton.setAttribute("disabled","true"),this.controlOption.showZoom&&this.zoomNumDiv&&(this.zoomNumDiv.innerText=String(Math.floor(r.getZoom()))),(this.disabled||r.getZoom()>=r.getMaxZoom())&&this.zoomInButton.setAttribute("disabled","true")})}getDefault(e){return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{position:Mt.BOTTOMRIGHT,name:"zoom",zoomInText:km("l7-icon-enlarge"),zoomInTitle:"Zoom in",zoomOutText:km("l7-icon-narrow"),zoomOutTitle:"Zoom out",showZoom:!1})}setOptions(e){super.setOptions(e),this.checkUpdateOption(e,["zoomInText","zoomInTitle","zoomOutText","zoomOutTitle","showZoom"])&&this.resetButtonGroup(this.container)}onAdd(){const e=Xo("div","l7-control-zoom");return this.resetButtonGroup(e),this.mapsService.on("zoomend",this.updateDisabled),this.mapsService.on("zoomchange",this.updateDisabled),e}onRemove(){this.mapsService.off("zoomend",this.updateDisabled),this.mapsService.off("zoomchange",this.updateDisabled)}disable(){return this.disabled=!0,this.updateDisabled(),this}enable(){return this.disabled=!1,this.updateDisabled(),this}resetButtonGroup(e){Ac(e),this.zoomInButton=this.createButton(this.controlOption.zoomInText,this.controlOption.zoomInTitle,"l7-button-control",e,this.zoomIn),this.controlOption.showZoom&&(this.zoomNumDiv=this.createButton("0","","l7-button-control l7-control-zoom__number",e)),this.zoomOutButton=this.createButton(this.controlOption.zoomOutText,this.controlOption.zoomOutTitle,"l7-button-control",e,this.zoomOut),this.updateDisabled()}createButton(e,r,n,a,u){const y=Xo("button",n,a);return typeof e=="string"?y.innerHTML=e:y.append(e),y.title=r,u&&y.addEventListener("click",u),y}}class Jw extends Yl.EventEmitter{get lngLat(){var e;return(e=this.popupOption.lngLat)!==null&&e!==void 0?e:{lng:0,lat:0}}set lngLat(e){this.popupOption.lngLat=e}constructor(e){super(),(0,K.Z)(this,"popupOption",void 0),(0,K.Z)(this,"mapsService",void 0),(0,K.Z)(this,"sceneService",void 0),(0,K.Z)(this,"layerService",void 0),(0,K.Z)(this,"scene",void 0),(0,K.Z)(this,"closeButton",void 0),(0,K.Z)(this,"container",void 0),(0,K.Z)(this,"content",void 0),(0,K.Z)(this,"contentTitle",void 0),(0,K.Z)(this,"contentPanel",void 0),(0,K.Z)(this,"tip",void 0),(0,K.Z)(this,"isShow",!0),(0,K.Z)(this,"onMouseMove",n=>{var a;const u=this.mapsService.getMapContainer(),{left:y=0,top:A=0}=(a=u==null?void 0:u.getBoundingClientRect())!==null&&a!==void 0?a:{};this.setPopupPosition(n.clientX-y,n.clientY-A)}),(0,K.Z)(this,"updateLngLatPosition",()=>{if(!this.mapsService||this.popupOption.followCursor)return;const{lng:n,lat:a}=this.lngLat,{x:u,y}=this.mapsService.lngLatToContainer([n,a]);this.setPopupPosition(u,y)}),(0,K.Z)(this,"updateLngLatPositionWhenZoom",n=>{if(!this.mapsService||this.popupOption.followCursor)return;const a=n.map,u=a.getSize();u.x=u.x/2,u.y=u.y/2;const y=n.center,A=n.zoom,O=a.DE(this.lngLat,A,y);O.x=Math.round(O.x),O.y=Math.round(O.y),this.setPopupPosition(O.x,O.y,!0)}),(0,K.Z)(this,"onKeyDown",n=>{n.keyCode===27&&this.remove()}),(0,K.Z)(this,"onCloseButtonClick",n=>{n.stopPropagation&&n.stopPropagation(),this.hide()}),(0,K.Z)(this,"updatePosition",(n,a=!0)=>{const u=!!this.lngLat,{className:y,style:A,maxWidth:O,anchor:Z,stopPropagation:Y}=this.popupOption;if(!this.mapsService||!u||!this.content)return;const Q=this.mapsService.getMarkerContainer();if(!this.container&&Q&&(this.container=Xo("div",`l7-popup ${y!=null?y:""} ${this.isShow?"":"l7-popup-hide"}`,Q),A&&this.container.setAttribute("style",A),this.tip=Xo("div","l7-popup-tip",this.container),this.container.appendChild(this.content),Y&&["mousemove","mousedown","mouseup","click","dblclick"].forEach(ae=>{this.container.addEventListener(ae,xe=>{xe.stopPropagation()})}),this.container.style.whiteSpace="nowrap"),a?this.updateLngLatPositionWhenZoom(n):this.updateLngLatPosition(),_u(this.container,`${$o[Z]}`),Fo(this.container,Z,"popup"),O){const{width:ae}=this.container.getBoundingClientRect();ae>parseFloat(O)&&(this.container.style.width=O)}else this.container.style.removeProperty("width")}),(0,K.Z)(this,"updateWhenZoom",n=>{this.updatePosition(n,!0)}),(0,K.Z)(this,"update",()=>{this.updatePosition(null,!1)}),this.popupOption=(0,Wt.Z)((0,Wt.Z)({},this.getDefault(e!=null?e:{})),e);const{lngLat:r}=this.popupOption;r&&(this.lngLat=r)}getIsShow(){return this.isShow}addTo(e){this.mapsService=e.mapService,this.sceneService=e.sceneService,this.layerService=e.layerService,this.mapsService.on("camerachange",this.update),this.mapsService.on("viewchange",this.update),this.scene=e,this.update(),this.updateCloseOnClick(),this.updateCloseOnEsc(),this.updateFollowCursor();const{html:r,text:n,title:a}=this.popupOption;return r?this.setHTML(r):n&&this.setText(n),a&&this.setTitle(a),this.emit("open"),this}remove(){if(this!==null&&this!==void 0&&this.isOpen())return this.content&&au(this.content),this.container&&(au(this.container),delete this.container),this.mapsService&&(this.mapsService.off("camerachange",this.update),this.mapsService.off("viewchange",this.update),this.updateCloseOnClick(!0),this.updateCloseOnEsc(!0),this.updateFollowCursor(!0),delete this.mapsService),this.emit("close"),this}getOptions(){return this.popupOption}setOptions(e){return this.show(),this.popupOption=(0,Wt.Z)((0,Wt.Z)({},this.popupOption),e),this.checkUpdateOption(e,["html","text","title","closeButton","closeButtonOffsets","maxWidth","anchor","stopPropagation","className","style","lngLat","offsets"])&&(this.container&&(au(this.container),this.container=void 0),this.popupOption.html?this.setHTML(this.popupOption.html):this.popupOption.text&&this.setText(this.popupOption.text),this.popupOption.title&&this.setTitle(this.popupOption.title)),this.checkUpdateOption(e,["closeOnEsc"])&&this.updateCloseOnEsc(),this.checkUpdateOption(e,["closeOnClick"])&&this.updateCloseOnClick(),this.checkUpdateOption(e,["followCursor"])&&this.updateFollowCursor(),this.checkUpdateOption(e,["html"])&&e.html?this.setHTML(e.html):this.checkUpdateOption(e,["text"])&&e.text&&this.setText(e.text),this.checkUpdateOption(e,["lngLat"])&&e.lngLat&&this.setLnglat(e.lngLat),this}open(){return this.addTo(this.scene),this}close(){return this.remove(),this}show(){if(!this.isShow)return this.container&&tc(this.container,"l7-popup-hide"),this.isShow=!0,this.emit("show"),this}hide(){if(this.isShow)return this.container&&dl(this.container,"l7-popup-hide"),this.isShow=!1,this.emit("hide"),this}setHTML(e){return this.popupOption.html=e,this.setDOMContent(e)}setText(e){return this.popupOption.text=e,this.setDOMContent(window.document.createTextNode(e))}setTitle(e){this.show(),this.popupOption.title=e,e?(this.contentTitle||(this.contentTitle=Xo("div","l7-popup-content__title"),this.content.firstChild?this.content.insertBefore(this.contentTitle,this.content.firstChild):this.content.append(this.contentTitle)),Ac(this.contentTitle),Iu(this.contentTitle,e)):this.contentTitle&&(au(this.contentTitle),this.contentTitle=void 0)}panToPopup(){const{lng:e,lat:r}=this.lngLat;return this.popupOption.autoPan&&this.mapsService.panTo([e,r]),this}setLngLat(e){return this.setLnglat(e)}setLnglat(e){return this.show(),this.lngLat=e,Array.isArray(e)&&(this.lngLat={lng:e[0],lat:e[1]}),this.mapsService&&(this.mapsService.off("camerachange",this.update),this.mapsService.off("viewchange",this.update),this.mapsService.on("camerachange",this.update),this.mapsService.on("viewchange",this.update)),this.update(),this.popupOption.autoPan&&setTimeout(()=>{this.panToPopup()},0),this}getLnglat(){return this.lngLat}setMaxWidth(e){return this.popupOption.maxWidth=e,this.update(),this}isOpen(){return!!this.mapsService}getDefault(e){return{closeButton:!0,closeOnClick:!1,maxWidth:"240px",offsets:[0,0],anchor:_a.BOTTOM,stopPropagation:!0,autoPan:!1,autoClose:!0,closeOnEsc:!1,followCursor:!1}}setDOMContent(e){return this.show(),this.createContent(),Iu(this.contentPanel,e),this.update(),this}updateCloseOnClick(e){const r=this.mapsService;r&&(r==null||r.off("click",this.onCloseButtonClick),this.popupOption.closeOnClick&&!e&&requestAnimationFrame(()=>{r==null||r.on("click",this.onCloseButtonClick)}))}updateCloseOnEsc(e){window.removeEventListener("keydown",this.onKeyDown),this.popupOption.closeOnEsc&&!e&&window.addEventListener("keydown",this.onKeyDown)}updateFollowCursor(e){var r;const n=(r=this.mapsService)===null||r===void 0?void 0:r.getContainer();n&&(n==null||n.removeEventListener("mousemove",this.onMouseMove),this.popupOption.followCursor&&!e&&(n==null||n.addEventListener("mousemove",this.onMouseMove)))}createContent(){if(this.content&&au(this.content),this.contentTitle=void 0,this.content=Xo("div","l7-popup-content",this.container),this.setTitle(this.popupOption.title),this.popupOption.closeButton){const e=km("l7-icon-guanbi");dl(e,"l7-popup-close-button"),this.content.appendChild(e),this.popupOption.closeButtonOffsets&&(e.style.right=this.popupOption.closeButtonOffsets[0]+"px",e.style.top=this.popupOption.closeButtonOffsets[1]+"px"),e.setAttribute("aria-label","Close popup"),e.addEventListener("click",()=>{this.hide()}),e.addEventListener("pointerup",r=>{r.stopPropagation()}),e.addEventListener("pointerdown",r=>{r.stopPropagation()}),this.closeButton=e}else this.closeButton=void 0;this.contentPanel=Xo("div","l7-popup-content__panel",this.content)}setPopupPosition(e,r,n=!1){if(this.container){const{offsets:a}=this.popupOption;this.container.style.left=e+a[0]+"px",this.container.style.top=r-a[1]+"px",n?this.container.style.transition="left 0.25s cubic-bezier(0,0,0.25,1), top 0.25s cubic-bezier(0,0,0.25,1)":this.container.style.transition=""}}checkUpdateOption(e,r){return r.some(n=>n in e)}}const{get:$4}=es;class K4 extends Jw{constructor(...e){super(...e),(0,K.Z)(this,"layerClickCountByFrame",0),(0,K.Z)(this,"layerConfigMap",new WeakMap),(0,K.Z)(this,"displayFeatureInfo",void 0),(0,K.Z)(this,"onLayerClick",(r,n)=>{requestAnimationFrame(()=>{if(this.popupOption.closeOnClick&&this.layerClickCountByFrame++,this.isShow&&this.isSameFeature(r,n.featureId))this.hide();else{const{title:a,content:u}=this.getLayerInfoFrag(r,n);this.setDOMContent(u),this.setLnglat(n.lngLat),this.setTitle(a),this.setDisplayFeatureInfo({layer:r,featureId:n.featureId}),this.show()}})}),(0,K.Z)(this,"onSceneClick",()=>{this.layerClickCountByFrame=0,requestAnimationFrame(()=>{this.layerClickCountByFrame||this.hide()})}),(0,K.Z)(this,"onLayerHide",()=>{this.hide(),this.setDisplayFeatureInfo(void 0)}),(0,K.Z)(this,"updateCloseOnClick",()=>{})}get layerConfigItems(){var e;const{config:r,items:n}=this.popupOption;return(e=r!=null?r:n)!==null&&e!==void 0?e:[]}addTo(e){return super.addTo(e),this.bindLayerEvent(),this.hide(),this}remove(){return super.remove(),this.unbindLayerEvent(),this}setOptions(e){this.unbindLayerEvent();const r=(0,Wt.Z)({},e),n=r.trigger||this.popupOption.trigger,a=r.items||this.popupOption.items,u=(a==null?void 0:a.length)===0;r.followCursor=n==="hover"&&!u;const y=this.isShow;return super.setOptions(r),this.bindLayerEvent(),(u||!y)&&this.hide(),this}getDefault(e){const r=e.trigger==="hover";return(0,Wt.Z)((0,Wt.Z)({},super.getDefault(e)),{},{trigger:"hover",followCursor:r,lngLat:{lng:0,lat:0},offsets:[0,10],closeButton:!1,closeOnClick:!0,autoClose:!1,closeOnEsc:!1})}bindLayerEvent(){const{trigger:e,closeOnClick:r}=this.popupOption;this.layerConfigItems.forEach(n=>{var a;const u=this.getLayerByConfig(n);if(!u)return;const y=(0,Wt.Z)({},n);if(e==="hover"){const Y=this.onLayerMouseMove.bind(this,u),Q=this.onLayerMouseOut.bind(this,u);y.onMouseMove=Y,y.onMouseOut=Q,u==null||u.on("mousemove",Y),u==null||u.on("mouseout",Q)}else{var A;const Y=this.onLayerClick.bind(this,u);y.onClick=Y,u==null||u.on("click",Y);const Q=(A=this.mapsService)===null||A===void 0?void 0:A.getMapContainer();Q&&r&&Q.addEventListener("click",this.onSceneClick)}const O=u==null||(a=u.getSource)===null||a===void 0?void 0:a.call(u),Z=this.onSourceUpdate.bind(this);O==null||O.on("update",Z),y.onSourceUpdate=Z,this.layerConfigMap.set(u,y)})}unbindLayerEvent(){this.layerConfigItems.forEach(e=>{var r;const n=this.getLayerByConfig(e),a=n&&this.layerConfigMap.get(n);if(!a)return;const{onMouseMove:u,onMouseOut:y,onClick:A,onSourceUpdate:O}=a;if(u&&n.off("mousemove",u),y&&n.off("mouseout",y),A&&n.off("click",A),O){var Z;n==null||(Z=n.getSource())===null||Z===void 0||Z.off("update",O)}const Y=(r=this.mapsService)===null||r===void 0?void 0:r.getMapContainer();Y&&Y.removeEventListener("click",this.onSceneClick)})}onLayerMouseMove(e,r){if(!this.isSameFeature(e,r.featureId)){const{title:n,content:a}=this.getLayerInfoFrag(e,r);this.setDOMContent(a),this.setTitle(n),this.setDisplayFeatureInfo({layer:e,featureId:r.featureId}),this.show()}}onLayerMouseOut(e,r){this.setDisplayFeatureInfo(void 0),this.isShow&&this.hide()}onSourceUpdate(){this.hide(),this.setDisplayFeatureInfo(void 0)}getLayerInfoFrag(e,r){const n=this.layerConfigMap.get(e);let a;const u=document.createDocumentFragment();if(n){let y=r.feature;y.type==="Feature"&&"properties"in y&&"geometry"in y&&(y=y.properties);const{title:A,fields:O,customContent:Z}=n;if(A){a=document.createDocumentFragment();const Y=A instanceof Function?A(y):A;Iu(a,Y)}if(Z){const Y=Z instanceof Function?Z(y):Z;Iu(u,Y)}else O!=null&&O.length&&(O==null||O.forEach(Y=>{var Q,ae;const{field:xe,formatField:Be,formatValue:it,getValue:gt}=typeof Y=="string"?{field:Y}:Y,Bt=Xo("div","l7-layer-popup__row"),Rt=gt?gt(r.feature):$4(y,xe),Yt=(Q=Be instanceof Function?Be(xe,y):Be)!==null&&Q!==void 0?Q:xe;let vr=(ae=it instanceof Function?it(Rt,y):it)!==null&&ae!==void 0?ae:Rt;const ln=Xo("span","l7-layer-popup__key",Bt);Iu(ln,Yt),Iu(ln,document.createTextNode("\uFF1A"));const cn=Xo("span","l7-layer-popup__value",Bt);Array.isArray(vr)&&vr.every(Gr=>!(Gr instanceof Object))&&(vr=vr.map(Gr=>String(Gr)).join(",")),Iu(cn,vr),u.appendChild(Bt)}))}return{title:a,content:u}}getLayerByConfig(e){const r=e.layer;if(r instanceof Object)return r;if(typeof r=="string")return this.layerService.getLayer(r)||this.layerService.getLayerByName(r)}isSameFeature(e,r){const n=this.displayFeatureInfo;return n&&e===n.layer&&r===n.featureId}setDisplayFeatureInfo(e){const r=this.displayFeatureInfo;r&&r.layer.off("hide",this.onLayerHide),e&&e.layer.on("hide",this.onLayerHide),this.displayFeatureInfo=e}}function J4(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}J4(`.l7-marker-container { position: absolute; width: 100%; height: 100%; overflow: hidden; } .l7-marker { position: absolute !important; top: 0; left: 0; z-index: 5; cursor: pointer; } .l7-marker-cluster { width: 40px; height: 40px; background-color: rgba(181, 226, 140, 0.6); background-clip: padding-box; border-radius: 20px; } .l7-marker-cluster div { width: 30px; height: 30px; margin-top: 5px; margin-left: 5px; font: 12px 'Helvetica Neue', Arial, Helvetica, sans-serif; text-align: center; background-color: rgba(110, 204, 57, 0.6); border-radius: 15px; } .l7-marker-cluster span { line-height: 30px; } .l7-touch .l7-control-attribution, .l7-touch .l7-control-layers, .l7-touch .l7-bar { box-shadow: none; } .l7-touch .l7-control-layers, .l7-touch .l7-bar { background-clip: padding-box; border: 2px solid rgba(0, 0, 0, 0.2); } .mapboxgl-ctrl-logo, .amap-logo { display: none !important; } .l7-select-box { border: 3px dashed gray; border-radius: 2px; position: absolute; z-index: 999; box-sizing: border-box; } .l7-control-container { font: 12px/1.5 'Helvetica Neue', Arial, Helvetica, sans-serif; } .l7-control-container .l7-control { position: relative; z-index: 999; float: left; clear: both; color: #595959; font-size: 12px; pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ pointer-events: auto; } .l7-control-container .l7-control.l7-control--hide { display: none; } .l7-control-container .l7-top { top: 0; display: flex; position: absolute; z-index: 999; pointer-events: none; } .l7-control-container .l7-top .l7-control:not(.l7-control--hide) { margin-top: 8px; } .l7-control-container .l7-right { right: 0; display: flex; position: absolute; z-index: 999; pointer-events: none; } .l7-control-container .l7-right .l7-control:not(.l7-control--hide) { margin-right: 8px; } .l7-control-container .l7-bottom { bottom: 0; display: flex; position: absolute; z-index: 999; pointer-events: none; } .l7-control-container .l7-bottom .l7-control:not(.l7-control--hide) { margin-bottom: 8px; } .l7-control-container .l7-left { left: 0; display: flex; position: absolute; z-index: 999; pointer-events: none; } .l7-control-container .l7-left .l7-control:not(.l7-control--hide) { margin-left: 8px; } .l7-control-container .l7-center { position: absolute; display: flex; justify-content: center; } .l7-control-container .l7-center.l7-top, .l7-control-container .l7-center.l7-bottom { width: 100%; } .l7-control-container .l7-center.l7-left, .l7-control-container .l7-center.l7-right { height: 100%; } .l7-control-container .l7-center .l7-control { margin-right: 8px; margin-bottom: 8px; } .l7-control-container .l7-row { flex-direction: row; } .l7-control-container .l7-row.l7-top { align-items: flex-start; } .l7-control-container .l7-row.l7-bottom { align-items: flex-end; } .l7-control-container .l7-column { flex-direction: column; } .l7-control-container .l7-column.l7-left { align-items: flex-start; } .l7-control-container .l7-column.l7-right { align-items: flex-end; } .l7-button-control { min-width: 28px; height: 28px; background-color: #fff; border-width: 0; border-radius: 2px; outline: 0; cursor: pointer; transition: all 0.2s; display: flex; justify-content: center; align-items: center; padding: 0 6px; box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15); line-height: 16px; } .l7-button-control .l7-iconfont { fill: #595959; color: #595959; width: 16px; height: 16px; } .l7-button-control.l7-button-control--row { padding: 0 16px 0 13px; } .l7-button-control.l7-button-control--row * + .l7-button-control__text { margin-left: 8px; } .l7-button-control.l7-button-control--column { height: 44px; flex-direction: column; } .l7-button-control.l7-button-control--column .l7-iconfont { margin-top: 3px; } .l7-button-control.l7-button-control--column .l7-button-control__text { margin-top: 3px; font-size: 10px; -webkit-transform: scale(0.83333); transform: scale(0.83333); } .l7-button-control:not(:disabled):hover { background-color: #f3f3f3; } .l7-button-control:not(:disabled):active { background-color: #f3f3f3; } .l7-button-control:disabled { background-color: #fafafa; color: #bdbdbd; cursor: not-allowed; } .l7-button-control:disabled .l7-iconfont { fill: #bdbdbd; color: #bdbdbd; } .l7-button-control:disabled:hover { background-color: #fafafa; } .l7-button-control:disabled:active { background-color: #fafafa; } .l7-popper { position: absolute; display: flex; justify-content: center; align-items: center; z-index: 5; color: #595959; } .l7-popper.l7-popper-hide { display: none; } .l7-popper .l7-popper-content { min-height: 28px; background: #fff; border-radius: 2px; box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15); } .l7-popper .l7-popper-arrow { width: 0; height: 0; border-width: 4px; border-style: solid; border-top-color: transparent; border-bottom-color: transparent; border-left-color: transparent; border-right-color: transparent; box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15); } .l7-popper.l7-popper-left { flex-direction: row; } .l7-popper.l7-popper-left .l7-popper-arrow { border-left-color: #fff; margin: 10px 0; } .l7-popper.l7-popper-right { flex-direction: row-reverse; } .l7-popper.l7-popper-right .l7-popper-arrow { border-right-color: #fff; margin: 10px 0; } .l7-popper.l7-popper-top { flex-direction: column; } .l7-popper.l7-popper-top .l7-popper-arrow { border-top-color: #fff; margin: 0 10px; } .l7-popper.l7-popper-bottom { flex-direction: column-reverse; } .l7-popper.l7-popper-bottom .l7-popper-arrow { border-bottom-color: #fff; margin: 0 10px; } .l7-popper.l7-popper-start { align-items: flex-start; } .l7-popper.l7-popper-end { align-items: flex-end; } .l7-select-control--normal { padding: 4px 0; } .l7-select-control--normal .l7-select-control-item { display: flex; align-items: center; height: 24px; padding: 0 16px; font-size: 12px; line-height: 24px; } .l7-select-control--normal .l7-select-control-item > * + * { margin-left: 6px; } .l7-select-control--normal .l7-select-control-item input[type='checkbox'] { width: 14px; height: 14px; } .l7-select-control--normal .l7-select-control-item:hover { background-color: #f3f3f3; } .l7-select-control--image { display: flex; flex-wrap: wrap; align-items: flex-start; box-sizing: content-box; max-width: 460px; max-height: 400px; margin: 12px 0 0 12px; overflow-x: hidden; overflow-y: auto; } .l7-select-control--image .l7-select-control-item { position: relative; display: flex; flex: 0 0 calc((100% - (12px + 9px) * 2) / 3); flex-direction: column; justify-content: center; box-sizing: content-box; margin-right: 12px; margin-bottom: 12px; overflow: hidden; font-size: 12px; border: 1px solid #fff; border-radius: 2px; } .l7-select-control--image .l7-select-control-item img { width: 100%; height: 80px; } .l7-select-control--image .l7-select-control-item input[type='checkbox'] { position: absolute; top: 0; right: 0; } .l7-select-control--image .l7-select-control-item .l7-select-control-item-row { display: flex; align-items: center; justify-content: center; line-height: 26px; } .l7-select-control--image .l7-select-control-item .l7-select-control-item-row > * + * { margin-left: 8px; } .l7-select-control--image .l7-select-control-item.l7-select-control-item-active { border-color: #0370fe; } .l7-select-control-item { cursor: pointer; } .l7-select-control-item input[type='checkbox'] { margin: 0; cursor: pointer; } .l7-select-control--multiple .l7-select-control-item:hover { background-color: transparent; } .l7-control-logo { width: 89px; height: 16px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .l7-control-logo img { height: 100%; width: 100%; } .l7-control-logo .l7-control-logo-link { display: block; cursor: pointer; } .l7-control-logo .l7-control-logo-link img { cursor: pointer; } .l7-control-mouse-location { background-color: #fff; border-radius: 2px; box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15); padding: 2px 4px; min-width: 130px; } .l7-control-zoom { overflow: hidden; border-radius: 2px; box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15); } .l7-control-zoom .l7-button-control { font-size: 16px; border-bottom: 1px solid #f0f0f0; border-radius: 0; box-shadow: 0 0 0; } .l7-control-zoom .l7-button-control .l7-iconfont { width: 14px; height: 14px; } .l7-control-zoom .l7-button-control:last-child { border-bottom: 0; } .l7-control-zoom .l7-control-zoom__number { color: #595959; padding: 0; } .l7-control-zoom .l7-control-zoom__number:hover { background-color: #fff; } .l7-control-scale { display: flex; flex-direction: column; } .l7-control-scale .l7-control-scale-line { box-sizing: border-box; padding: 2px 5px 1px; overflow: hidden; color: #595959; font-size: 10px; line-height: 1.1; white-space: nowrap; background: #fff; border: 2px solid #000; border-top: 0; transition: width 0.1s; } .l7-control-scale .l7-control-scale-line + .l7-control-scale .l7-control-scale-line { margin-top: -2px; border-top: 2px solid #777; border-bottom: none; } .l7-right .l7-control-scale { display: flex; align-items: flex-end; } .l7-right .l7-control-scale .l7-control-scale-line { text-align: right; } .l7-popup { position: absolute; top: 0; left: 0; z-index: 5; display: flex; will-change: transform; pointer-events: none; } .l7-popup.l7-popup-hide { display: none; } .l7-popup .l7-popup-content { position: relative; padding: 16px; font-size: 14px; background: #fff; border-radius: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); } .l7-popup .l7-popup-content .l7-popup-content__title { margin-bottom: 8px; font-weight: bold; } .l7-popup .l7-popup-content .l7-popup-close-button, .l7-popup .l7-popup-content .l7-popup-content__title, .l7-popup .l7-popup-content .l7-popup-content__panel { white-space: normal; -webkit-user-select: text; -moz-user-select: text; -ms-user-select: text; user-select: text; pointer-events: initial; } .l7-popup .l7-popup-content .l7-popup-close-button { position: absolute; top: 0; right: 0; width: 18px; height: 18px; padding: 0; font-size: 14px; line-height: 18px; text-align: center; background-color: transparent; border: 0; border-radius: 0 3px 0 0; cursor: pointer; } .l7-popup .l7-popup-tip { position: relative; z-index: 1; width: 0; height: 0; border: 10px solid transparent; } .l7-popup.l7-popup-anchor-bottom, .l7-popup.l7-popup-anchor-bottom-left, .l7-popup.l7-popup-anchor-bottom-right { flex-direction: column-reverse; } .l7-popup.l7-popup-anchor-bottom .l7-popup-tip, .l7-popup.l7-popup-anchor-bottom-left .l7-popup-tip, .l7-popup.l7-popup-anchor-bottom-right .l7-popup-tip { bottom: 1px; } .l7-popup.l7-popup-anchor-top, .l7-popup.l7-popup-anchor-top-left, .l7-popup.l7-popup-anchor-top-right { flex-direction: column; } .l7-popup.l7-popup-anchor-top .l7-popup-tip, .l7-popup.l7-popup-anchor-top-left .l7-popup-tip, .l7-popup.l7-popup-anchor-top-right .l7-popup-tip { top: 1px; } .l7-popup.l7-popup-anchor-left { flex-direction: row; } .l7-popup.l7-popup-anchor-right { flex-direction: row-reverse; } .l7-popup-anchor-top .l7-popup-tip { position: relative; align-self: center; border-top: none; border-bottom-color: #fff; } .l7-popup-anchor-top-left .l7-popup-tip { align-self: flex-start; border-top: none; border-bottom-color: #fff; border-left: none; } .l7-popup-anchor-top-right .l7-popup-tip { align-self: flex-end; border-top: none; border-right: none; border-bottom-color: #fff; } .l7-popup-anchor-bottom .l7-popup-tip { align-self: center; border-top-color: #fff; border-bottom: none; } .l7-popup-anchor-bottom-left .l7-popup-tip { align-self: flex-start; border-top-color: #fff; border-bottom: none; border-left: none; } .l7-popup-anchor-bottom-right .l7-popup-tip { align-self: flex-end; border-top-color: #fff; border-right: none; border-bottom: none; } .l7-popup-anchor-left .l7-popup-tip { align-self: center; border-right-color: #fff; border-left: none; } .l7-popup-anchor-right .l7-popup-tip { right: 1px; align-self: center; border-right: none; border-left-color: #fff; } .l7-popup-anchor-top-left .l7-popup-content { border-top-left-radius: 0; } .l7-popup-anchor-top-right .l7-popup-content { border-top-right-radius: 0; } .l7-popup-anchor-bottom-left .l7-popup-content { border-bottom-left-radius: 0; } .l7-popup-anchor-bottom-right .l7-popup-content { border-bottom-right-radius: 0; } .l7-popup-track-pointer { display: none; } .l7-popup-track-pointer * { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; pointer-events: none; } .l7-map:hover .l7-popup-track-pointer { display: flex; } .l7-map:active .l7-popup-track-pointer { display: none; } .l7-layer-popup__row { font-size: 12px; } .l7-layer-popup__row + .l7-layer-popup__row { margin-top: 4px; } .l7-control-swipe { position: absolute; top: 50%; left: 50%; z-index: 6; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); touch-action: none; } .l7-control-swipe_hide { display: none; } .l7-control-swipe:before { position: absolute; top: -5000px; bottom: -5000px; left: 50%; z-index: -1; width: 4px; background: #fff; -webkit-transform: translate(-2px, 0); transform: translate(-2px, 0); content: ''; } .l7-control-swipe.horizontal:before { top: 50%; right: -5000px; bottom: auto; left: -5000px; width: auto; height: 4px; } .l7-control-swipe__button { display: block; width: 28px; height: 28px; margin: 0; padding: 0; color: #595959; font-weight: bold; font-size: inherit; text-align: center; text-decoration: none; background-color: #fff; border: none; border-radius: 2px; outline: none; } .l7-control-swipe, .l7-control-swipe__button { cursor: ew-resize; } .l7-control-swipe.horizontal, .l7-control-swipe.horizontal button { cursor: ns-resize; } .l7-control-swipe:after, .l7-control-swipe__button:before, .l7-control-swipe__button:after { position: absolute; top: 25%; bottom: 25%; left: 50%; width: 2px; background: currentColor; -webkit-transform: translate(-1px, 0); transform: translate(-1px, 0); content: ''; } .l7-control-swipe__button:after { -webkit-transform: translateX(4px); transform: translateX(4px); } .l7-control-swipe__button:before { -webkit-transform: translateX(-6px); transform: translateX(-6px); } `);class Nm{constructor(e){(0,K.Z)(this,"configService",void 0),(0,K.Z)(this,"config",void 0),this.config=e}setContainer(e,r,n){this.configService=e.globalConfigService,e.mapConfig=(0,Wt.Z)((0,Wt.Z)({},this.config),{},{id:r,canvas:n}),e.mapService=new(this.getServiceConstructor())(e)}getServiceConstructor(){throw new Error("Method not implemented.")}}var Q4=Se(41978),Qw=Se.n(Q4),e3=Se(92711),t3=Se(37678),eP=Se(40962),tP=Se(95311),rP=Se(64003),d1=Se(28419),Im=Se(67654);function m_(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function m1(t,e){var r=mh.transformMat4([],e,t);return mh.scale(r,r,1/r[3]),r}function UO(t,e){var r=t%e;return r<0?e+r:r}function ZO(t,e,r){return r*e+(1-r)*t}function i0(t,e){if(!t)throw new Error(e||"viewport-mercator-project: assertion failed.")}var zm=Math.PI,r3=zm/4,gg=zm/180,n3=180/zm,x2=512,b2=4003e4,nP=1.5;function i3(t){return Math.pow(2,t)}function iP(t){return Math.log2(t)}function g1(t,e){var r=(0,Im.Z)(t,2),n=r[0],a=r[1];i0(Number.isFinite(n)&&Number.isFinite(e)),i0(Number.isFinite(a)&&a>=-90&&a<=90,"invalid latitude"),e*=x2;var u=n*gg,y=a*gg,A=e*(u+zm)/(2*zm),O=e*(zm-Math.log(Math.tan(r3+y*.5)))/(2*zm);return[A,O]}function E2(t,e){var r=(0,Im.Z)(t,2),n=r[0],a=r[1];e*=x2;var u=n/e*(2*zm)-zm,y=2*(Math.atan(Math.exp(zm-a/e*(2*zm)))-r3);return[u*n3,y*n3]}function VO(t){var e=t.latitude;assert(Number.isFinite(e));var r=Math.cos(e*gg);return iP(b2*r)-9}function o3(t){var e=t.latitude,r=t.longitude,n=t.zoom,a=t.scale,u=t.highPrecision,y=u===void 0?!1:u;a=a!==void 0?a:i3(n),i0(Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(a));var A={},O=x2*a,Z=Math.cos(e*gg),Y=O/360,Q=Y/Z,ae=O/b2/Z;if(A.pixelsPerMeter=[ae,-ae,ae],A.metersPerPixel=[1/ae,-1/ae,1/ae],A.pixelsPerDegree=[Y,-Q,ae],A.degreesPerPixel=[1/Y,-1/Q,1/ae],y){var xe=gg*Math.tan(e*gg)/Z,Be=Y*xe/2,it=O/b2*xe,gt=it/Q*ae;A.pixelsPerDegree2=[0,-Be,it],A.pixelsPerMeter2=[gt,0,gt]}return A}function jO(t,e){var r=_slicedToArray(t,3),n=r[0],a=r[1],u=r[2],y=_slicedToArray(e,3),A=y[0],O=y[1],Z=y[2],Y=1,Q=o3({longitude:n,latitude:a,scale:Y,highPrecision:!0}),ae=Q.pixelsPerMeter,xe=Q.pixelsPerMeter2,Be=g1(t,Y);Be[0]+=A*(ae[0]+xe[0]*O),Be[1]+=O*(ae[1]+xe[1]*O);var it=E2(Be,Y),gt=(u||0)+(Z||0);return Number.isFinite(u)||Number.isFinite(Z)?[it[0],it[1],gt]:it}function oP(t){var e=t.height,r=t.pitch,n=t.bearing,a=t.altitude,u=t.center,y=u===void 0?null:u,A=t.flipY,O=A===void 0?!1:A,Z=m_();return Kr.translate(Z,Z,[0,0,-a]),Kr.scale(Z,Z,[1,1,1/e]),Kr.rotateX(Z,Z,-r*gg),Kr.rotateZ(Z,Z,n*gg),O&&Kr.scale(Z,Z,[1,-1,1]),y&&Kr.translate(Z,Z,ra.negate([],y)),Z}function aP(t){var e=t.width,r=t.height,n=t.altitude,a=n===void 0?nP:n,u=t.pitch,y=u===void 0?0:u,A=t.nearZMultiplier,O=A===void 0?1:A,Z=t.farZMultiplier,Y=Z===void 0?1:Z,Q=y*gg,ae=Math.atan(.5/a),xe=Math.sin(ae)*a/Math.sin(Math.PI/2-Q-ae),Be=Math.cos(Math.PI/2-Q)*xe+a;return{fov:2*Math.atan(r/2/a),aspect:e/r,focalDistance:a,near:O,far:Be*Y}}function sP(t){var e=t.width,r=t.height,n=t.pitch,a=t.altitude,u=t.nearZMultiplier,y=t.farZMultiplier,A=aP({width:e,height:r,altitude:a,pitch:n,nearZMultiplier:u,farZMultiplier:y}),O=A.fov,Z=A.aspect,Y=A.near,Q=A.far,ae=Kr.perspective([],O,Z,Y,Q);return ae}function lP(t,e){var r=(0,Im.Z)(t,3),n=r[0],a=r[1],u=r[2],y=u===void 0?0:u;return i0(Number.isFinite(n)&&Number.isFinite(a)&&Number.isFinite(y)),m1(e,[n,a,y,1])}function a3(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(0,Im.Z)(t,3),a=n[0],u=n[1],y=n[2];if(i0(Number.isFinite(a)&&Number.isFinite(u),"invalid pixel coordinate"),Number.isFinite(y)){var A=m1(e,[a,u,y,1]);return A}var O=m1(e,[a,u,0,1]),Z=m1(e,[a,u,1,1]),Y=O[2],Q=Z[2],ae=Y===Q?0:((r||0)-Y)/(Q-Y);return Ja.lerp([],O,Z,ae)}var s3=m_(),uP=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.width,n=e.height,a=e.viewMatrix,u=a===void 0?s3:a,y=e.projectionMatrix,A=y===void 0?s3:y;(0,e3.Z)(this,t),this.width=r||1,this.height=n||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=u,this.projectionMatrix=A;var O=m_();Kr.multiply(O,O,this.projectionMatrix),Kr.multiply(O,O,this.viewMatrix),this.viewProjectionMatrix=O;var Z=m_();Kr.scale(Z,Z,[this.width/2,-this.height/2,1]),Kr.translate(Z,Z,[1,-1,0]),Kr.multiply(Z,Z,this.viewProjectionMatrix);var Y=Kr.invert(m_(),Z);if(!Y)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=Z,this.pixelUnprojectionMatrix=Y,this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}return(0,t3.Z)(t,[{key:"equals",value:function(r){return r instanceof t?r.width===this.width&&r.height===this.height&&Kr.equals(r.projectionMatrix,this.projectionMatrix)&&Kr.equals(r.viewMatrix,this.viewMatrix):!1}},{key:"project",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.topLeft,u=a===void 0?!0:a,y=this.projectPosition(r),A=lP(y,this.pixelProjectionMatrix),O=(0,Im.Z)(A,2),Z=O[0],Y=O[1],Q=u?Y:this.height-Y;return r.length===2?[Z,Q]:[Z,Q,A[2]]}},{key:"unproject",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.topLeft,u=a===void 0?!0:a,y=n.targetZ,A=(0,Im.Z)(r,3),O=A[0],Z=A[1],Y=A[2],Q=u?Z:this.height-Z,ae=y&&y*this.pixelsPerMeter,xe=a3([O,Q,Y],this.pixelUnprojectionMatrix,ae),Be=this.unprojectPosition(xe),it=(0,Im.Z)(Be,3),gt=it[0],Bt=it[1],Rt=it[2];return Number.isFinite(Y)?[gt,Bt,Rt]:Number.isFinite(y)?[gt,Bt,y]:[gt,Bt]}},{key:"projectPosition",value:function(r){var n=this.projectFlat(r),a=(0,Im.Z)(n,2),u=a[0],y=a[1],A=(r[2]||0)*this.pixelsPerMeter;return[u,y,A]}},{key:"unprojectPosition",value:function(r){var n=this.unprojectFlat(r),a=(0,Im.Z)(n,2),u=a[0],y=a[1],A=(r[2]||0)/this.pixelsPerMeter;return[u,y,A]}},{key:"projectFlat",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return r}},{key:"unprojectFlat",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return r}}]),t}();function cP(t){var e=t.width,r=t.height,n=t.bounds,a=t.minExtent,u=a===void 0?0:a,y=t.maxZoom,A=y===void 0?24:y,O=t.padding,Z=O===void 0?0:O,Y=t.offset,Q=Y===void 0?[0,0]:Y,ae=(0,Im.Z)(n,2),xe=(0,Im.Z)(ae[0],2),Be=xe[0],it=xe[1],gt=(0,Im.Z)(ae[1],2),Bt=gt[0],Rt=gt[1];if(Number.isFinite(Z)){var Yt=Z;Z={top:Yt,bottom:Yt,left:Yt,right:Yt}}else i0(Number.isFinite(Z.top)&&Number.isFinite(Z.bottom)&&Number.isFinite(Z.left)&&Number.isFinite(Z.right));var vr=new w2({width:e,height:r,longitude:0,latitude:0,zoom:0}),ln=vr.project([Be,Rt]),cn=vr.project([Bt,it]),Gr=[Math.max(Math.abs(cn[0]-ln[0]),u),Math.max(Math.abs(cn[1]-ln[1]),u)],Pn=[e-Z.left-Z.right-Math.abs(Q[0])*2,r-Z.top-Z.bottom-Math.abs(Q[1])*2];i0(Pn[0]>0&&Pn[1]>0);var Oo=Pn[0]/Gr[0],Da=Pn[1]/Gr[1],Bo=(Z.right-Z.left)/2/Oo,Oa=(Z.bottom-Z.top)/2/Da,fl=[(cn[0]+ln[0])/2+Bo,(cn[1]+ln[1])/2+Oa],Gp=vr.unproject(fl),Wp=vr.zoom+Math.log2(Math.abs(Math.min(Oo,Da)));return{longitude:Gp[0],latitude:Gp[1],zoom:Math.min(Wp,A)}}var w2=function(t){(0,rP.Z)(e,t);function e(){var r,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=n.width,u=n.height,y=n.latitude,A=y===void 0?0:y,O=n.longitude,Z=O===void 0?0:O,Y=n.zoom,Q=Y===void 0?0:Y,ae=n.pitch,xe=ae===void 0?0:ae,Be=n.bearing,it=Be===void 0?0:Be,gt=n.altitude,Bt=gt===void 0?1.5:gt,Rt=n.nearZMultiplier,Yt=n.farZMultiplier;(0,e3.Z)(this,e),a=a||1,u=u||1;var vr=i3(Q);Bt=Math.max(.75,Bt);var ln=g1([Z,A],vr);ln[2]=0;var cn=sP({width:a,height:u,pitch:xe,bearing:it,altitude:Bt,nearZMultiplier:Rt||1/u,farZMultiplier:Yt||1.01}),Gr=oP({height:u,center:ln,pitch:xe,bearing:it,altitude:Bt,flipY:!0});return r=(0,eP.Z)(this,(0,tP.Z)(e).call(this,{width:a,height:u,viewMatrix:Gr,projectionMatrix:cn})),r.latitude=A,r.longitude=Z,r.zoom=Q,r.pitch=xe,r.bearing=it,r.altitude=Bt,r.scale=vr,r.center=ln,r.pixelsPerMeter=o3((0,d1.Z)((0,d1.Z)(r))).pixelsPerMeter[2],Object.freeze((0,d1.Z)((0,d1.Z)(r))),r}return(0,t3.Z)(e,[{key:"projectFlat",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return g1(n,a)}},{key:"unprojectFlat",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return E2(n,a)}},{key:"getMapCenterByLngLatPosition",value:function(n){var a=n.lngLat,u=n.pos,y=a3(u,this.pixelUnprojectionMatrix),A=g1(a,this.scale),O=Ja.add([],A,Ja.negate([],y)),Z=Ja.add([],this.center,O);return E2(Z,this.scale)}},{key:"getLocationAtPoint",value:function(n){var a=n.lngLat,u=n.pos;return this.getMapCenterByLngLatPosition({lngLat:a,pos:u})}},{key:"fitBounds",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=this.width,y=this.height,A=cP(Object.assign({width:u,height:y,bounds:n},a)),O=A.longitude,Z=A.latitude,Y=A.zoom;return new e({width:u,height:y,longitude:O,latitude:Z,zoom:Y})}}]),e}(uP);class Fg{constructor(){(0,K.Z)(this,"viewport",void 0)}syncWithMapCamera(e){const{center:r,zoom:n,pitch:a,bearing:u,viewportHeight:y,viewportWidth:A}=e,O=this.viewport?{width:this.viewport.width,height:this.viewport.height,longitude:this.viewport.center[0],latitude:this.viewport.center[1],zoom:this.viewport.zoom,pitch:this.viewport.pitch,bearing:this.viewport.bearing}:{};this.viewport=new w2((0,Wt.Z)((0,Wt.Z)({},O),{},{width:A,height:y,longitude:r&&r[0],latitude:r&&r[1],zoom:n,pitch:a,bearing:u}))}getZoom(){return this.viewport.zoom}getZoomScale(){return Math.pow(2,this.getZoom())}getCenter(){return[this.viewport.longitude,this.viewport.latitude]}getProjectionMatrix(){return this.viewport.projectionMatrix}getModelMatrix(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}getViewMatrix(){return this.viewport.viewMatrix}getViewMatrixUncentered(){return this.viewport.viewMatrixUncentered}getViewProjectionMatrix(){return this.viewport.viewProjectionMatrix}getViewProjectionMatrixUncentered(){return this.viewport.viewProjectionMatrix}getFocalDistance(){return 1}projectFlat(e,r){return this.viewport.projectFlat(e,r)}}class l3{constructor(e){(0,K.Z)(this,"size",1e4),this.size=e||1e4}setSize(e){this.size=e}getSize(){return[this.size,this.size]}mercatorXfromLng(e){return(180+e)/360*this.size}mercatorYfromLat(e){return(1-(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360)*this.size}lngFromMercatorX(e){return e/this.size*360-180}latFromMercatorY(e){const r=180-(1-e/this.size)*360;return 360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90}project(e){const r=this.mercatorXfromLng(e[0]),n=this.mercatorYfromLat(e[1]);return[r,n]}unproject(e){const r=this.lngFromMercatorX(e[0]),n=this.latFromMercatorY(e[1]);return[r,n]}}function v1(t={}){const e={top:0,right:0,bottom:0,left:0};if(typeof t=="number")return{top:t,right:t,bottom:t,left:t};if(Array.isArray(t)){if(t.length===4)return{top:t[0],right:t[1],bottom:t[2],left:t[3]};if(t.length===2)return{top:t[0],right:t[1],bottom:t[0],left:t[1]}}return(0,Wt.Z)((0,Wt.Z)({},e),t)}const hP={normal:"amap://styles/normal",light:"amap://styles/c422f5c0cfced5be9fe3a83f05f28a68?isPublic=true",dark:"amap://styles/c9f1d10cae34f8ab05e425462c5a58d7?isPublic=true",blank:"amap://styles/07c17002b38775b32a7a76c66cf90e99?isPublic=true",fresh:"amap://styles/fresh",grey:"amap://styles/grey",graffiti:"amap://styles/graffiti",macaron:"amap://styles/macaron",darkblue:"amap://styles/darkblue",wine:"amap://styles/wine"},pP=["id","style","minZoom","maxZoom","token","mapInstance","plugin"];function fP(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}fP(`.amap-logo { display: none !important; } .amap-copyright { display: none !important; } `);const u3={"GAODE1.x":{contextmenu:"rightclick"},"GAODE2.x":{contextmenu:"rightclick",camerachange:"viewchange"}};let dP=0;window.forceWebGL=!0;const c3="15cd8a57710d40c9b7c0e3cc120f1200",mP="1.4.15",gP="amap-script";let S2=!1,_1=[];const vP=12;class h3{constructor(e){(0,K.Z)(this,"version",rp["GAODE1.x"]),(0,K.Z)(this,"simpleMapCoord",new l3),(0,K.Z)(this,"map",void 0),(0,K.Z)(this,"bgColor","rgba(0, 0, 0, 0)"),(0,K.Z)(this,"configService",void 0),(0,K.Z)(this,"config",void 0),(0,K.Z)(this,"coordinateSystemService",void 0),(0,K.Z)(this,"eventEmitter",void 0),(0,K.Z)(this,"markerContainer",void 0),(0,K.Z)(this,"$mapContainer",void 0),(0,K.Z)(this,"cameraChangedCallback",void 0),(0,K.Z)(this,"handleCameraChanged",r=>{const{fov:n,near:a,far:u,height:y,pitch:A,rotation:O,aspect:Z,position:Y}=r.camera,{lng:Q,lat:ae}=this.getCenter();if(this.emit("mapchange"),this.cameraChangedCallback){this.viewport.syncWithMapCamera({aspect:Z,bearing:360-O,far:u,fov:n,cameraHeight:y,near:a,pitch:A,zoom:this.map.getZoom()-1,center:[Q,ae],offsetOrigin:[Y.x,Y.y]});const{offsetZoom:xe=vP}=this.config;this.viewport.getZoom()>xe?this.coordinateSystemService.setCoordinateSystem(Xt.P20_OFFSET):this.coordinateSystemService.setCoordinateSystem(Xt.P20),this.cameraChangedCallback(this.viewport)}}),this.config=e.mapConfig,this.configService=e.globalConfigService,this.coordinateSystemService=e.coordinateSystemService,this.eventEmitter=new Yl.EventEmitter}setBgColor(e){this.bgColor=e}addMarkerContainer(){const e=this.map.getContainer();if(e!==null){const r=e.getElementsByClassName("amap-maps")[0];this.markerContainer=Xo("div","l7-marker-container",r)}}getMarkerContainer(){return this.markerContainer}on(e,r){po.indexOf(e)!==-1?this.eventEmitter.on(e,r):this.map.on(u3[this.version][e]||e,r)}off(e,r){po.indexOf(e)!==-1?this.eventEmitter.off(e,r):this.map.off(u3[this.version][e]||e,r)}getContainer(){return this.map.getContainer()}getMapCanvasContainer(){var e;return(e=this.map.getContainer())===null||e===void 0?void 0:e.getElementsByClassName("amap-maps")[0]}getCanvasOverlays(){var e;return(e=this.$mapContainer)===null||e===void 0?void 0:e.querySelector(".amap-overlays")}getSize(){const e=this.map.getSize();return[e.getWidth(),e.getHeight()]}getType(){return"amap"}getZoom(){return this.map.getZoom()-1}setZoom(e){return this.map.setZoom(e+1)}getCenter(e){if(e!=null&&e.padding){const n=this.getCenter(),a=v1(e.padding),u=this.lngLatToPixel([n.lng,n.lat]),y=[(a.right-a.left)/2,(a.bottom-a.top)/2];return this.pixelToLngLat([u.x-y[0],u.y-y[1]])}const r=this.map.getCenter();return{lng:r.getLng(),lat:r.getLat()}}setCenter(e,r){if(r!=null&&r.padding){const n=v1(r.padding),a=this.lngLatToPixel(e),u=[(n.right-n.left)/2,(n.bottom-n.top)/2],y=this.pixelToLngLat([a.x+u[0],a.y+u[1]]);this.map.setCenter([y.lng,y.lat])}else this.map.setCenter(e)}getPitch(){return this.map.getPitch()}getRotation(){return 360-this.map.getRotation()}getBounds(){const e=this.map.getBounds().toBounds(),r=e.getNorthEast(),n=e.getSouthWest(),a=this.getCenter(),u=a.lng>r.getLng()||a.lng{const ae=()=>{if(O)e.map=O,e.$mapContainer=e.map.getContainer(),setTimeout(()=>{e.map.on("camerachange",e.handleCameraChanged),Q()},30);else{e.$mapContainer=e.creatMapContainer(n);const xe=(0,Wt.Z)({mapStyle:e.getMapStyleValue(a),zooms:[u,y],viewMode:"3D"},Y);xe.zoom&&(xe.zoom+=1);const Be=new AMap.Map(e.$mapContainer,xe);Be.on("camerachange",e.handleCameraChanged),Be.on("camerachange",()=>{setTimeout(()=>e.handleAfterMapChange())}),e.map=Be,setTimeout(()=>{Q()},10)}};!S2&&!O?(A===c3&&console.warn(`%c${e.configService.getSceneWarninfo("MapToken")}!`,"color: #873bf4;font-weigh:900;font-size: 16px;"),S2=!0,Z.push("Map3D"),Qw().load({key:A,version:mP,plugins:Z}).then(()=>{ae(),_1.length&&(_1.forEach(xe=>xe()),_1=[])}).catch(xe=>{throw new Error(xe)})):S2&&window.AMap||O?ae():_1.push(ae)}),e.viewport=new Fg})()}meterToCoord(e,r){const n=AMap.GeometryUtil.distance(new AMap.LngLat(...e),new AMap.LngLat(...r)),[a,u]=this.lngLatToCoord(e),[y,A]=this.lngLatToCoord(r);return Math.sqrt(Math.pow(a-y,2)+Math.pow(u-A,2))/n}updateView(e){}getOverlayContainer(){}exportMap(e){var r;const n=(r=this.getContainer())===null||r===void 0?void 0:r.getElementsByClassName("amap-layer")[0];return e==="jpg"?n==null?void 0:n.toDataURL("image/jpeg"):n==null?void 0:n.toDataURL("image/png")}emit(e,...r){this.eventEmitter.emit(e,...r)}once(e,...r){this.eventEmitter.once(e,...r)}destroy(){var e;(e=this.$mapContainer)===null||e===void 0||(e=e.parentNode)===null||e===void 0||e.removeChild(this.$mapContainer),delete window.initAMap;const r=document.getElementById(gP);r&&document.head.removeChild(r),this.map.destroy()}getMapContainer(){return this.$mapContainer}onCameraChanged(e){this.cameraChangedCallback=e}handleAfterMapChange(){this.emit("mapAfterFrameChange")}creatMapContainer(e){let r=e;typeof e=="string"&&(r=document.getElementById(e));const n=document.createElement("div");return n.style.cssText+=` position: absolute; top: 0; height: 100%; width: 100%; `,n.id="l7_amap_div"+dP++,r.appendChild(n),n}}if(!window)throw Error("AMap JSAPI can only be used in Browser.");var Um=function(t){return t.notload="notload",t.loading="loading",t.loaded="loaded",t.failed="failed",t}(Um||{});let Kd={key:"",AMap:{version:"2.0",plugins:[]}},vg={AMap:Um.notload};const _P=[],yP=t=>{if(typeof t=="function"){if(vg.AMap===Um.loaded){t(window.AMap);return}_P.push(t)}},xP=function(){var t=(0,Nr.Z)(function*(e){return new Promise((r,n)=>{if(vg.AMap===Um.failed)n("");else if(vg.AMap===Um.notload){const{key:a,version:u,plugins:y}=e;if(!a){n("\u8BF7\u586B\u5199key");return}window.AMap&&location.host!=="lbs.amap.com"&&n("\u7981\u6B62\u591A\u79CDAPI\u52A0\u8F7D\u65B9\u5F0F\u6DF7\u7528"),Kd.key=a,Kd.AMap.version=u||Kd.AMap.version,Kd.AMap.plugins=y||Kd.AMap.plugins,vg.AMap=Um.loading;const A=document.body||document.head;window._onAPILoaded=Z=>{Z?(vg.AMap=Um.failed,n(Z)):(vg.AMap=Um.loaded,r(null))};const O=document.createElement("script");O.type="text/javascript",O.async=!1,O.src="https://webapi.amap.com/maps?callback=_onAPILoaded&v="+Kd.AMap.version+"&key="+a+"&plugin="+Kd.AMap.plugins.join(","),O.onerror=Z=>{vg.AMap=Um.failed,n(Z)},A.appendChild(O)}else if(vg.AMap===Um.loaded){if(e.key&&e.key!==Kd.key){n("\u591A\u4E2A\u4E0D\u4E00\u81F4\u7684 key");return}if(e.version&&e.version!==Kd.AMap.version){n("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C JSAPI \u6DF7\u7528");return}const a=[];e.plugins&&e.plugins.forEach(u=>{Kd.AMap.plugins.indexOf(u)===-1&&a.push(u)}),a.length&&window.AMap.plugin(a,()=>{r(window.AMap)})}else{if(e.key&&e.key!==Kd.key){n("\u591A\u4E2A\u4E0D\u4E00\u81F4\u7684 key");return}if(e.version&&e.version!==Kd.AMap.version){n("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C JSAPI \u6DF7\u7528");return}const a=[];e.plugins&&e.plugins.forEach(u=>{Kd.AMap.plugins.indexOf(u)===-1&&a.push(u)}),yP(()=>{a.length&&window.AMap.plugin(a,()=>{r(window.AMap)})})}})});return function(r){return t.apply(this,arguments)}}();function bP(){delete window.AMap,Kd={key:"",AMap:{version:"1.4.15",plugins:[]}},vg={AMap:Um.notload}}var EP={load:xP,reset:bP};const p3=Math.PI/180;class wP{constructor(){(0,K.Z)(this,"projectionMatrix",Kr.create()),(0,K.Z)(this,"viewMatrix",Kr.create()),(0,K.Z)(this,"viewProjectionMatrix",Kr.create()),(0,K.Z)(this,"ViewProjectionMatrixUncentered",Kr.create()),(0,K.Z)(this,"viewUncenteredMatrix",Kr.create()),(0,K.Z)(this,"zoom",void 0),(0,K.Z)(this,"center",void 0)}syncWithMapCamera(e){const{zoom:r=1,pitch:n=0,bearing:a=0,center:u=[0,0],offsetOrigin:y=[0,0],cameraHeight:A=1,aspect:O=1,near:Z=.1,far:Y=1e3,fov:Q=0}=e;this.zoom=r,this.center=u;const ae=n*p3,xe=(360-a)*p3;Kr.perspective(this.projectionMatrix,Q,O,Z,Y);const Be=ra.fromValues(A*Math.sin(ae)*Math.sin(xe),-A*Math.sin(ae)*Math.cos(xe),A*Math.cos(ae)),it=ra.fromValues(-Math.cos(ae)*Math.sin(xe),Math.cos(ae)*Math.cos(xe),Math.sin(ae));Kr.lookAt(this.viewMatrix,Be,ra.fromValues(0,0,0),it),this.viewUncenteredMatrix=Kr.clone(this.viewMatrix),Kr.translate(this.viewMatrix,this.viewMatrix,ra.fromValues(-y[0],y[1],0)),Kr.multiply(this.viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),Kr.multiply(this.ViewProjectionMatrixUncentered,this.projectionMatrix,this.viewMatrix)}getZoom(){return this.zoom}getZoomScale(){return 524288}getCenter(){const[e,r]=this.center;return[e,r]}getProjectionMatrix(){return this.projectionMatrix}getModelMatrix(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}getViewMatrix(){return this.viewMatrix}getViewMatrixUncentered(){return this.viewUncenteredMatrix}getViewProjectionMatrix(){return this.viewProjectionMatrix}getViewProjectionMatrixUncentered(){return this.ViewProjectionMatrixUncentered}getFocalDistance(){return 1}projectFlat(e){const r=85.0511287798,n=Math.max(Math.min(r,e[1]),-r),a=256<<20;let u=Math.PI/180,y=e[0]*u,A=n*u;A=Math.log(Math.tan(Math.PI/4+A/2));const O=.5/Math.PI,Z=.5,Y=-.5/Math.PI;return u=.5,y=a*(O*y+Z)-215440491,A=-(a*(Y*A+u)-106744817),[y,A]}}const SP=["id","style","minZoom","maxZoom","token","mapInstance","plugin"];window.forceWebGL=!0;const f3="15cd8a57710d40c9b7c0e3cc120f1200",TP="1.4.15";let T2=!1,y1=[];const AP=12;class CP extends h3{constructor(...e){super(...e),(0,K.Z)(this,"version","GAODE1.x"),(0,K.Z)(this,"viewport",void 0),(0,K.Z)(this,"handleCameraChanged",r=>{const{fov:n,near:a,far:u,height:y,pitch:A,rotation:O,aspect:Z,position:Y}=r.camera,{lng:Q,lat:ae}=this.getCenter();if(this.emit("mapchange"),this.cameraChangedCallback){this.viewport.syncWithMapCamera({aspect:Z,bearing:360-O,far:u,fov:n,cameraHeight:y,near:a,pitch:A,zoom:this.map.getZoom()-1,center:[Q,ae],offsetOrigin:[Y.x,Y.y]});const{offsetZoom:xe=AP}=this.config;this.viewport.getZoom()>xe?this.coordinateSystemService.setCoordinateSystem(Xt.P20_OFFSET):this.coordinateSystemService.setCoordinateSystem(Xt.P20),this.cameraChangedCallback(this.viewport)}})}getModelMatrix(e,r,n,a=[1,1,1]){const u=this.viewport.projectFlat(e),y=Kr.create();return Kr.translate(y,y,ra.fromValues(u[0],u[1],r)),Kr.scale(y,y,ra.fromValues(a[0],a[1],a[2])),Kr.rotateX(y,y,n[0]),Kr.rotateY(y,y,n[1]),Kr.rotateZ(y,y,n[2]),y}init(){var e=this;return(0,Nr.Z)(function*(){const r=e.config,{id:n,style:a="light",minZoom:u=0,maxZoom:y=18,token:A=f3,mapInstance:O,plugin:Z=[]}=r,Y=(0,Ge.Z)(r,SP);yield new Promise(Q=>{const ae=()=>{if(O)e.map=O,e.$mapContainer=e.map.getContainer(),setTimeout(()=>{e.map.on("camerachange",e.handleCameraChanged),Q()},30);else{e.$mapContainer=e.creatMapContainer(n);const xe=(0,Wt.Z)({mapStyle:e.getMapStyleValue(a),zooms:[u,y],viewMode:"3D"},Y);xe.zoom&&(xe.zoom+=1);const Be=new AMap.Map(e.$mapContainer,xe);Be.on("camerachange",e.handleCameraChanged),Be.on("camerachange",()=>{setTimeout(()=>e.handleAfterMapChange())}),e.map=Be,setTimeout(()=>{Q()},10)}};!T2&&!O?(A===f3&&console.warn(e.configService.getSceneWarninfo("MapToken")),T2=!0,Z.push("Map3D"),EP.load({key:A,version:TP,plugins:Z}).then(xe=>{ae(),y1.length&&(y1.forEach(Be=>Be()),y1=[])}).catch(xe=>{throw new Error(xe)})):T2&&window.AMap||O?ae():y1.push(ae)}),e.viewport=new wP})()}meterToCoord(e,r){const n=AMap.GeometryUtil.distance(new AMap.LngLat(...e),new AMap.LngLat(...r)),[a,u]=this.lngLatToCoord(e),[y,A]=this.lngLatToCoord(r);return Math.sqrt(Math.pow(a-y,2)+Math.pow(u-A,2))/n}updateView(e){}getOverlayContainer(){}exportMap(e){var r;const n=(r=this.getContainer())===null||r===void 0?void 0:r.getElementsByClassName("amap-layer")[0];return e==="jpg"?n==null?void 0:n.toDataURL("image/jpeg"):n==null?void 0:n.toDataURL("image/png")}onCameraChanged(e){this.cameraChangedCallback=e}}class MP extends Nm{getServiceConstructor(){return CP}}class PP{constructor(){(0,K.Z)(this,"projectionMatrix",Kr.create()),(0,K.Z)(this,"viewMatrix",Kr.create()),(0,K.Z)(this,"viewProjectionMatrix",Kr.create()),(0,K.Z)(this,"ViewProjectionMatrixUncentered",Kr.create()),(0,K.Z)(this,"viewUncenteredMatrix",Kr.create()),(0,K.Z)(this,"zoom",void 0),(0,K.Z)(this,"center",void 0)}syncWithMapCamera(e){const{zoom:r=1,center:n=[0,0],offsetOrigin:a=[0,0],cameraPosition:u=[0,0,0],up:y=[0,1,0],lookAt:A=[0,0,0],aspect:O=1,near:Z=.1,far:Y=1e3,fov:Q=45}=e;this.zoom=r,this.center=n,Kr.perspective(this.projectionMatrix,Q/180*Math.PI,O,Z,Y);const ae=ra.fromValues(...u),xe=ra.fromValues(...A),Be=ra.fromValues(...y);Kr.lookAt(this.viewMatrix,ae,xe,Be),this.viewUncenteredMatrix=Kr.clone(this.viewMatrix),Kr.translate(this.viewMatrix,this.viewMatrix,ra.fromValues(-a[0],a[1],0)),Kr.multiply(this.viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),Kr.multiply(this.ViewProjectionMatrixUncentered,this.projectionMatrix,this.viewMatrix)}getZoom(){return this.zoom}getZoomScale(){return 1048576}getCenter(){const[e,r]=this.center;return[e,r]}getProjectionMatrix(){return this.projectionMatrix}getModelMatrix(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}getViewMatrix(){return this.viewMatrix}getViewMatrixUncentered(){return this.viewUncenteredMatrix}getViewProjectionMatrix(){return this.viewProjectionMatrix}getViewProjectionMatrixUncentered(){return this.ViewProjectionMatrixUncentered}getFocalDistance(){return 1.2}projectFlat(e){const r=85.0511287798,n=Math.max(Math.min(r,e[1]),-r),a=256<<20;let u=Math.PI/180,y=e[0]*u,A=n*u;A=Math.log(Math.tan(Math.PI/4+A/2));const O=.5/Math.PI,Z=.5,Y=-.5/Math.PI;return u=.5,y=a*(O*y+Z)-215440491,A=-(a*(Y*A+u)-106744817),[y,A]}}const RP=["id","style","minZoom","maxZoom","token","mapInstance","plugin","version"];function IP(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}IP(`.amap-logo { display: none !important; } .amap-copyright { display: none !important; } .amap-overlays { z-index: 3 !important; } `);const d3=[108.92361,34.54083];window.forceWebGL=!0;const m3="f59bcf249433f8b05caaee19f349b3d7",g3="2.0",WO=!1,XO=null;class LP extends h3{constructor(...e){super(...e),(0,K.Z)(this,"version","GAODE2.x"),(0,K.Z)(this,"sceneCenter",void 0),(0,K.Z)(this,"sceneCenterMercator",void 0),(0,K.Z)(this,"viewport",void 0),(0,K.Z)(this,"handleViewChanged",r=>{const{fov:n,near:a,far:u,aspect:y,position:A,lookAt:O,up:Z}=this.map.customCoords.getCameraParams();this.emit("mapchange");const Y=this.map.customCoords.getCenter();this.cameraChangedCallback&&(this.viewport.syncWithMapCamera({aspect:y,far:u,fov:n,cameraPosition:A,lookAt:O,up:Z,near:a,zoom:this.map.getZoom()-1,center:Y,offsetOrigin:[A[0],A[1]]}),this.coordinateSystemService.setCoordinateSystem(Xt.P20_2),this.cameraChangedCallback(this.viewport))})}setCustomCoordCenter(e){this.sceneCenter=e,this.sceneCenterMercator=fi(...e)}getCustomCoordCenter(){return this.sceneCenterMercator}lngLatToCoordByLayer(e,r){const n=r||this.sceneCenterMercator,a=this._sub(fi(e[0],e[1]),n);return e[2]&&a.push(e[2]),a}coordToAMap2RelativeCoordinates(e,r){const n=fi(r[0],r[1]);return typeof e[0]=="number"?this.lngLatToCoordByLayer(e,n):e.map(a=>Array.isArray(a)&&typeof a[0]=="number"?this.lngLatToCoordByLayer(a,n):a.map(u=>this.lngLatToCoordByLayer(u,n)))}setCoordCenter(e){this.map.customCoords.setCenter(e||d3),this.setCustomCoordCenter(e||d3)}lngLatToCoord(e){return this.sceneCenter||(this.map.customCoords.setCenter(e),this.setCustomCoordCenter(e)),this._sub(fi(e[0],e[1]),this.sceneCenterMercator)}lngLatToCoords(e){return e.map(r=>typeof r[0]=="number"?this.lngLatToCoord(r):r.map(n=>this.lngLatToCoord(n)))}addMarkerContainer(){if(!this.map)return;const e=this.map.getContainer();if(e!==null){const r=e.getElementsByClassName("amap-maps")[0];r.style.zIndex="auto",this.markerContainer=Xo("div","l7-marker-container2",r)}}updateView(e){}getOverlayContainer(){}getType(){return"amap2"}getBounds(){const e=this.map.getBounds(),r=e.getNorthEast(),n=e.getSouthWest(),a=this.getCenter(),u=a.lng>r.getLng()||a.lng{const{lat:n,lng:a}=this.map.getCenter();this.emit("mapchange"),this.viewport.syncWithMapCamera({bearing:this.map.getBearing(),center:[a,n],viewportHeight:this.map.transform.height,pitch:this.map.getPitch(),viewportWidth:this.map.transform.width,zoom:this.map.getZoom(),cameraHeight:0}),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport)}),this.config=e.mapConfig,this.configService=e.globalConfigService,this.coordinateSystemService=e.coordinateSystemService,this.eventEmitter=new Yl.EventEmitter}setBgColor(e){this.bgColor=e}addMarkerContainer(){const e=this.map.getCanvasContainer();this.markerContainer=Xo("div","l7-marker-container",e),this.markerContainer.setAttribute("tabindex","-1")}getMarkerContainer(){return this.markerContainer}getOverlayContainer(){}getCanvasOverlays(){}on(e,r){po.indexOf(e)!==-1?this.eventEmitter.on(e,r):this.map.on(_3[e]||e,r)}off(e,r){this.map.off(_3[e]||e,r),this.eventEmitter.off(e,r)}getContainer(){return this.map.getContainer()}getMapCanvasContainer(){return this.map.getCanvasContainer()}getSize(){if(this.version==="SIMPLE")return this.simpleMapCoord.getSize();const e=this.map.transform;return[e.width,e.height]}getType(){return"default"}getZoom(){return this.map.getZoom()}setZoom(e){return this.map.setZoom(e)}getCenter(){return this.map.getCenter()}setCenter(e){this.map.setCenter(e)}getPitch(){return this.map.getPitch()}getRotation(){return this.map.getBearing()}getBounds(){return this.map.getBounds().toArray()}getMinZoom(){return this.map.getMinZoom()}getMaxZoom(){return this.map.getMaxZoom()}setRotation(e){this.map.setBearing(e)}zoomIn(e,r){this.map.zoomIn(e,r)}zoomOut(e,r){this.map.zoomOut(e,r)}setPitch(e){return this.map.setPitch(e)}panTo(e){this.map.panTo(e)}panBy(e=0,r=0){this.map.panBy([e,r])}fitBounds(e,r){this.map.fitBounds(e,r)}setMaxZoom(e){this.map.setMaxZoom(e)}setMinZoom(e){this.map.setMinZoom(e)}setMapStatus(e){e.doubleClickZoom===!0&&this.map.doubleClickZoom.enable(),e.doubleClickZoom===!1&&this.map.doubleClickZoom.disable(),e.dragEnable===!1&&this.map.dragPan.disable(),e.dragEnable===!0&&this.map.dragPan.enable(),e.rotateEnable===!1&&this.map.dragRotate.disable(),e.dragEnable===!0&&this.map.dragRotate.enable(),e.keyboardEnable===!1&&this.map.keyboard.disable(),e.keyboardEnable===!0&&this.map.keyboard.enable(),e.zoomEnable===!1&&this.map.scrollZoom.disable(),e.zoomEnable===!0&&this.map.scrollZoom.enable()}setZoomAndCenter(e,r){this.map.flyTo({zoom:e,center:r})}setMapStyle(e){this.map.setStyle(this.getMapStyleValue(e))}meterToCoord(e,r){return 1}pixelToLngLat(e){return this.map.unproject(e)}lngLatToPixel(e){return this.map.project(e)}containerToLngLat(e){return this.map.unproject(e)}lngLatToContainer(e){return this.map.project(e)}getMapStyle(){try{var e;const r=(e=this.map.getStyle().sprite)!==null&&e!==void 0?e:"";return/^mapbox:\/\/sprites\/zcxduo\/\w+\/\w+$/.test(r)?r==null?void 0:r.replace(/\/\w+$/,"").replace(/sprites/,"styles"):r}catch(r){return""}}getMapStyleConfig(){return DP}getMapStyleValue(e){var r;return(r=this.getMapStyleConfig()[e])!==null&&r!==void 0?r:e}destroy(){this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}emit(e,...r){this.eventEmitter.emit(e,...r)}once(e,...r){this.eventEmitter.once(e,...r)}getMapContainer(){return this.$mapContainer}exportMap(e){const r=this.map.getCanvas();return e==="jpg"?r==null?void 0:r.toDataURL("image/jpeg"):r==null?void 0:r.toDataURL("image/png")}onCameraChanged(e){this.cameraChangedCallback=e}creatMapContainer(e){let r=e;return typeof e=="string"&&(r=document.getElementById(e)),r}updateView(e){this.emit("mapchange"),this.viewport.syncWithMapCamera({bearing:e.bearing,center:e.center,viewportHeight:e.viewportHeight,pitch:e.pitch,viewportWidth:e.viewportWidth,zoom:e.zoom,cameraHeight:0}),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport)}updateCoordinateSystemService(){const{offsetCoordinate:e=!0}=this.config;this.viewport.getZoom()>OP&&e?this.coordinateSystemService.setCoordinateSystem(Xt.LNGLAT_OFFSET):this.coordinateSystemService.setCoordinateSystem(Xt.LNGLAT)}}if(!window)throw Error("BMapGL JSAPI can only be used in Browser.");var Zm=function(t){return t.notload="notload",t.loading="loading",t.loaded="loaded",t.failed="failed",t}(Zm||{});let eg={key:"",BMapGL:{version:"1.0"}},yg={BMapGL:Zm.notload};const A2=[],y3=t=>{if(typeof t=="function"){if(yg.BMapGL===Zm.loaded){t(window.BMapGL);return}A2.push(t)}};var BP={load:t=>new Promise((e,r)=>{if(yg.BMapGL===Zm.failed)r("");else if(yg.BMapGL===Zm.notload){const{key:n,version:a}=t;if(!n){r("\u8BF7\u586B\u5199key");return}eg.key=n,eg.BMapGL.version=a||eg.BMapGL.version,yg.BMapGL=Zm.loading;const u=document.body||document.head;window.___onBMapGLAPILoaded=A=>{if(delete window.___onBMapGLAPILoaded,A)yg.BMapGL=Zm.failed,r(A);else for(yg.BMapGL=Zm.loaded;A2.length;)A2.splice(0,1)[0](window.BMapGL)};const y=document.createElement("script");y.type="text/javascript",y.src=`https://api.map.baidu.com/api?type=webgl&v=${eg.BMapGL.version}&ak=${eg.key}&callback=___onBMapGLAPILoaded`,y.onerror=A=>{yg.BMapGL=Zm.failed,r(A)},u.appendChild(y),y3(e)}else if(yg.BMapGL===Zm.loaded){if(t.key&&t.key!==eg.key){r("\u591A\u4E2A\u4E0D\u4E00\u81F4\u7684 key");return}if(t.version&&t.version!==eg.BMapGL.version){r("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C JSAPI \u6DF7\u7528");return}e(window.BMapGL)}else{if(t.key&&t.key!==eg.key){r("\u591A\u4E2A\u4E0D\u4E00\u81F4\u7684 key");return}if(t.version&&t.version!==eg.BMapGL.version){r("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C JSAPI \u6DF7\u7528");return}y3(e)}}),reset:()=>{delete window.BMapGL,eg={key:"",BMapGL:{version:"1.0"}},yg={BMapGL:Zm.notload}}};const FP=["id","center","zoom","token","mapInstance","version","mapSize","minZoom","maxZoom"];function kP(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}kP(`.BMap_cpyCtrl .anchorBL { display: none !important; } .anchorBL { display: none !important; } `);const x3={mapmove:"moving",contextmenu:"rightclick",camerachange:"update",zoomchange:"zoomend"},b3="zLhopYPPERGtpGOgimcdKcCimGRyyIsh",E3="1.0";class NP extends _g{constructor(...e){super(...e),(0,K.Z)(this,"viewport",void 0),(0,K.Z)(this,"styleConfig",{normal:[]}),(0,K.Z)(this,"currentStyle","normal"),(0,K.Z)(this,"evtCbProxyMap",new Map),(0,K.Z)(this,"handleCameraChanged",()=>{this.emit("mapchange");const r=this.getMap(),{lng:n,lat:a}=r.getCenter(),u={center:[n,a],viewportHeight:r.getContainer().clientHeight,viewportWidth:r.getContainer().clientWidth,bearing:360-r.getHeading(),pitch:r.getTilt(),zoom:r.getZoom()-1.75};this.viewport.syncWithMapCamera(u),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport)})}getMap(){return this.map}setBgColor(e){this.bgColor=e}init(){var e=this;return(0,Nr.Z)(function*(){e.viewport=new Fg;const r=e.config,{id:n,center:a=[121.30654632240122,31.25744185633306],zoom:u=12,token:y=b3,mapInstance:A,version:O=E3,mapSize:Z=1e4,minZoom:Y=0,maxZoom:Q=21}=r,ae=(0,Ge.Z)(r,FP);if(e.viewport=new Fg,e.version=O,e.simpleMapCoord.setSize(Z),window.BMapGL||A||(yield BP.load({key:y,version:E3})),A){e.map=A,e.$mapContainer=e.map.getContainer();const xe=new BMapGL.Point(a[0],a[1]);e.map.isLoaded()||e.map.centerAndZoom(xe,u),e.initMapByConfig(e.config),e.map.on("update",e.handleCameraChanged)}else{const xe=(0,Wt.Z)({enableWheelZoom:!0,minZoom:Y,maxZoom:Q},ae);if(y===b3&&console.warn(`%c${e.configService.getSceneWarninfo("MapToken")}!`,"color: #873bf4;font-weigh:900;font-size: 16px;"),!n)throw Error("No container id specified");const Be=wc(n);let it=[...Be.childNodes];const gt=new BMapGL.Map(Be,xe);e.$mapContainer=gt.getContainer(),it.forEach(Rt=>{e.$mapContainer.appendChild(Rt)}),it=null,e.map=gt;const Bt=new BMapGL.Point(a[0],a[1]);e.map.centerAndZoom(Bt,u),e.initMapByConfig(e.config),gt.on("update",e.handleCameraChanged)}})()}destroy(){this.getMap().destroy()}onCameraChanged(e){this.cameraChangedCallback=e}addMarkerContainer(){}getMarkerContainer(){return this.map.getPanes().markerPane}getCanvasOverlays(){var e;return(e=this.getMap().getContainer().querySelector("#platform"))===null||e===void 0?void 0:e.lastChild}on(e,r){if(po.indexOf(e)!==-1){this.eventEmitter.on(e,r);return}let n=this.evtCbProxyMap.get(e);if(n||this.evtCbProxyMap.set(e,n=new Map),n.get(r))return;const a=(...u)=>{u[0]&&typeof u[0]=="object"&&!u[0].lngLat&&!u[0].lnglat&&(u[0].lngLat=u[0].latlng||u[0].latLng),r(...u)};n.set(r,a),this.map.on(x3[e]||e,a)}off(e,r){var n,a;if(po.indexOf(e)!==-1){this.eventEmitter.off(e,r);return}const u=(n=this.evtCbProxyMap.get(e))===null||n===void 0?void 0:n.get(r);u&&((a=this.evtCbProxyMap.get(e))===null||a===void 0||a.delete(r),this.map.off(x3[e]||e,u))}once(e,r){this.eventEmitter.once(e,r)}getContainer(){return this.getMap().getContainer()}getSize(){const e=this.getMap().getSize();return[e.width,e.height]}getMinZoom(){return this.map.getMinZoom()}getMaxZoom(){return this.map.getMaxZoom()}getType(){return"bmap"}getZoom(){return this.getMap().getZoom()}getCenter(e){if(e!=null&&e.padding){const n=this.getCenter(),a=v1(e.padding),u=this.lngLatToPixel([n.lng,n.lat]),y=[(a.right-a.left)/2,(a.bottom-a.top)/2];return this.pixelToLngLat([u.x-y[0],u.y-y[1]])}const r=this.map.getCenter();return{lng:r.lng,lat:r.lat}}getPitch(){return this.getMap().getTilt()}getRotation(){return 360-this.getMap().getHeading()}getBounds(){const e=this.getMap().getBounds(),r=e.getNorthEast(),n=e.getSouthWest();return[[n.lng,n.lat],[r.lng,r.lat]]}getMapContainer(){return this.getMap().getContainer()}getMapCanvasContainer(){return this.getMap().getContainer()}getMapStyleConfig(){return this.styleConfig}getMapStyleValue(e){return this.styleConfig[e]}setMapStyle(e){if(this.currentStyle===e)return;const r=Array.isArray(e)?e:this.styleConfig[e]||e;if(Array.isArray(r)){this.map.setMapStyleV2({styleJson:r}),this.currentStyle=e;return}if(typeof r=="string"){this.map.setMapStyleV2({styleId:r}),this.currentStyle=e;return}}setRotation(e){this.getMap().setHeading(e)}zoomIn(){this.getMap().zoomIn()}zoomOut(){this.getMap().zoomOut()}panTo(e){this.getMap().panTo(new BMapGL.Point(e[0],e[1]))}panBy(e,r){this.getMap().panBy(e,r)}fitBounds(e,r){this.map.setViewport(e.map(n=>new BMapGL.Point(n[0],n[1])),r)}setZoomAndCenter(e,[r,n]){this.getMap().centerAndZoom(new BMapGL.Point(r,n),e+1.75)}setCenter([e,r],n){let a={lng:e,lat:r};if(n!=null&&n.padding){const u=v1(n.padding),y=this.lngLatToPixel([e,r]),A=[(u.right-u.left)/2,(u.bottom-u.top)/2];a=this.pixelToLngLat([y.x+A[0],y.y+A[1]])}this.getMap().setCenter(new BMapGL.Point(a.lng,a.lat))}setPitch(e){this.getMap().setTilt(e)}setZoom(e){this.getMap().setZoom(e)}setMapStatus(e){const r=this.getMap();Object.keys(e).map(n=>{switch(n){case"doubleClickZoom":e.doubleClickZoom?r.enableDoubleClickZoom():r.disableDoubleClickZoom();break;case"dragEnable":e.dragEnable?r.enableDragging():r.disableDragging();break;case"keyboardEnable":e.keyboardEnable?r.enableKeyboard():r.disableKeyboard();break;case"resizeEnable":e.resizeEnable?r.enableAutoResize():r.disableAutoResize();break;case"rotateEnable":e.rotateEnable?(r.enableRotate(),r.enableRotateGestures()):(r.disableRotate(),r.disableRotateGestures());break;case"zoomEnable":e.zoomEnable?(this.map.enableDoubleClickZoom(),this.map.enableScrollWheelZoom(),this.map.enablePinchToZoom()):(this.map.disableDoubleClickZoom(),this.map.disableScrollWheelZoom(),this.map.disablePinchToZoom());break;case"showIndoorMap":r.setDisplayOptions({indoor:!!e.showIndoorMap});break;default:}})}meterToCoord(e,r){const n=this.getMap().getDistance(new BMapGL.Point(...e),new BMapGL.Point(...r)),[a,u]=this.lngLatToCoord(e),[y,A]=this.lngLatToCoord(r);return Math.sqrt(Math.pow(a-y,2)+Math.pow(u-A,2))/n}pixelToLngLat([e,r]){const n=this.getMap().pixelToPoint(new BMapGL.Pixel(e,r));return{lng:n.lng,lat:n.lat}}lngLatToPixel([e,r]){const n=this.getMap().pointToPixel(new BMapGL.Point(e,r));return{x:n.x,y:n.y}}containerToLngLat([e,r]){const n=this.getMap().overlayPixelToPoint(new BMapGL.Pixel(e,r));return{lng:n.lng,lat:n.lat}}lngLatToContainer([e,r]){const n=this.getMap().pointToOverlayPixel(new BMapGL.Point(e,r));return{x:n.x,y:n.y}}lngLatToCoord([e,r]){const{x:n,y:a}=this.getMap().pointToPixel(new BMapGL.Point(e,r));return[n,-a]}lngLatToCoords(e){return e.map(r=>Array.isArray(r[0])?this.lngLatToCoords(r):this.lngLatToCoord(r))}lngLatToMercator([e,r],n){const[a,u]=this.getMap().lnglatToMercator(e,r);return{x:a,y:u,z:n}}getModelMatrix(e,r,n,a=[1,1,1]){const u=this.viewport.projectFlat(e),y=Kr.create();return Kr.translate(y,y,ra.fromValues(u[0],u[1],r)),Kr.scale(y,y,ra.fromValues(a[0],a[1],a[2])),Kr.rotateX(y,y,n[0]),Kr.rotateY(y,y,n[1]),Kr.rotateZ(y,y,n[2]),y}getCustomCoordCenter(){throw new Error("Method not implemented.")}exportMap(e){const r=this.getMap()._webglPainter._canvas;return e==="jpg"?r==null?void 0:r.toDataURL("image/jpeg"):r==null?void 0:r.toDataURL("image/png")}hideLogo(){const e=this.map.getContainer();e&&dl(e,"bmap-contianer--hide-logo")}initMapByConfig(e){const{style:r,pitch:n=0,rotation:a=0,logoVisible:u=!0}=e;r&&this.setMapStyle(r),n&&this.setPitch(n),a&&this.setRotation(a),u===!1&&this.hideLogo()}}class zP extends Nm{getServiceConstructor(){return NP}}var UP=Se(545),ZP=Se.n(UP);let C2;function M2(t,e,r){const n=r-e,a=((t-e)%n+n)%n+e;return a===e?r:a}function xg(t,e,r){return Math.min(r,Math.max(e,t))}function Lm(t,e,r){return t*(1-r)+e*r}function P2(t,e,r,n){const a=new(ZP())(t,e,r,n);return u=>a.solve(u)}const R2=P2(.25,.1,.25,1);function w3(){var t;return C2==null&&typeof window!="undefined"&&window.matchMedia&&(C2=window.matchMedia("(prefers-reduced-motion: reduce)")),(t=C2)===null||t===void 0?void 0:t.matches}function VP(t,e){const r={};for(const n of e)n in t&&(r[n]=t[n]);return r}const kg=window.performance&&window.performance.now?window.performance.now.bind(window.performance):Date.now.bind(Date),jP=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,HP=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame;function x1(t){const e=jP(t);return{cancel:()=>HP(e)}}function GP(t,...e){for(const r of e)for(const n in r)r[n]!==void 0&&(t[n]=r[n]);return t}const S3=63710088e-1;class qu{static convert(e){if(e instanceof qu)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new qu(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null){const r="lng"in e?e.lng:e.lon;return new qu(Number(r),Number(e.lat))}throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}constructor(e,r){if((0,K.Z)(this,"lng",void 0),(0,K.Z)(this,"lat",void 0),isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new qu(M2(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,n=this.lat*r,a=e.lat*r,u=Math.sin(n)*Math.sin(a)+Math.cos(n)*Math.cos(a)*Math.cos((e.lng-this.lng)*r);return S3*Math.acos(Math.min(u,1))}}class tg{static convert(e){return e instanceof tg?e:new tg(e)}constructor(e,r){(0,K.Z)(this,"ne",void 0),(0,K.Z)(this,"sw",void 0),e&&(r?this.setSouthWest(e).setNorthEast(r):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this.ne=e instanceof qu?new qu(e.lng,e.lat):qu.convert(e),this}setSouthWest(e){return this.sw=e instanceof qu?new qu(e.lng,e.lat):qu.convert(e),this}extend(e){const r=this.sw,n=this.ne;let a,u;if(e instanceof qu)a=e,u=e;else if(e instanceof tg){if(a=e.sw,u=e.ne,!a||!u)return this}else{if(Array.isArray(e))if(e.length===4||e.every(Array.isArray)){const y=e;return this.extend(tg.convert(y))}else{const y=e;return this.extend(qu.convert(y))}return this}return!r&&!n?(this.sw=new qu(a.lng,a.lat),this.ne=new qu(u.lng,u.lat)):(r.lng=Math.min(a.lng,r.lng),r.lat=Math.min(a.lat,r.lat),n.lng=Math.max(u.lng,n.lng),n.lat=Math.max(u.lat,n.lat)),this}getCenter(){return new qu((this.sw.lng+this.ne.lng)/2,(this.sw.lat+this.ne.lat)/2)}getSouthWest(){return this.sw}getNorthEast(){return this.ne}getNorthWest(){return new qu(this.getWest(),this.getNorth())}getSouthEast(){return new qu(this.getEast(),this.getSouth())}getWest(){return this.sw.lng}getSouth(){return this.sw.lat}getEast(){return this.ne.lng}getNorth(){return this.ne.lat}toArray(){return[this.sw.toArray(),this.ne.toArray()]}toString(){return`LngLatBounds(${this.sw.toString()}, ${this.ne.toString()})`}isEmpty(){return!(this.sw&&this.ne)}contains(e){const{lng:r,lat:n}=qu.convert(e),a=this.sw.lat<=n&&n<=this.ne.lat;let u=this.sw.lng<=r&&r<=this.ne.lng;return this.sw.lng>this.ne.lng&&(u=this.sw.lng>=r&&r>=this.ne.lng),a&&u}}class Pl{static convert(e){return e instanceof Pl?e:Array.isArray(e)?new Pl(e[0],e[1]):e}constructor(e,r){(0,K.Z)(this,"x",void 0),(0,K.Z)(this,"y",void 0),this.x=e,this.y=r}clone(){return new Pl(this.x,this.y)}_add(e){return this.x+=e.x,this.y+=e.y,this}add(e){return this.clone()._add(e)}_sub(e){return this.x-=e.x,this.y-=e.y,this}sub(e){return this.clone()._sub(e)}_multByPoint(e){return this.x*=e.x,this.y*=e.y,this}multByPoint(e){return this.clone()._multByPoint(e)}_divByPoint(e){return this.x/=e.x,this.y/=e.y,this}divByPoint(e){return this.clone()._divByPoint(e)}_mult(e){return this.x*=e,this.y*=e,this}mult(e){return this.clone()._mult(e)}_div(e){return this.x/=e,this.y/=e,this}div(e){return this.clone()._div(e)}_rotate(e){const r=Math.cos(e),n=Math.sin(e),a=r*this.x-n*this.y,u=n*this.x+r*this.y;return this.x=a,this.y=u,this}rotate(e){return this.clone()._rotate(e)}_rotateAround(e,r){const n=Math.cos(e),a=Math.sin(e),u=r.x+n*(this.x-r.x)-a*(this.y-r.y),y=r.y+a*(this.x-r.x)+n*(this.y-r.y);return this.x=u,this.y=y,this}roateAround(e,r){return this.clone()._rotateAround(e,r)}_matMult(e){const r=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=r,this.y=n,this}matMult(e){return this.clone()._matMult(e)}_unit(){return this.div(this.mag()),this}unit(){return this.clone()._unit()}_perp(){const e=this.y;return this.y=this.x,this.x=-e,this}perp(){return this.clone()._perp()}_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}round(){return this.clone()._round()}mag(){return Math.sqrt(this.x*this.x+this.y*this.y)}equals(e){return this.x===e.x&&this.y===e.y}dist(e){return Math.sqrt(this.distSqr(e))}distSqr(e){const r=e.x-this.x,n=e.y-this.y;return r*r+n*n}angle(){return Math.atan2(this.y,this.x)}angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)}angleWith(e){return this.angleWithSep(e.x,e.y)}angleWithSep(e,r){return Math.atan2(this.x*r-this.y*e,this.x*e+this.y*r)}}var T3=Se(76406);class I2{constructor(e=0,r=0,n=0,a=0){if((0,K.Z)(this,"top",void 0),(0,K.Z)(this,"bottom",void 0),(0,K.Z)(this,"left",void 0),(0,K.Z)(this,"right",void 0),isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0||isNaN(a)||a<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=r,this.left=n,this.right=a}interpolate(e,r,n){return r.top!=null&&e.top!=null&&(this.top=Lm(e.top,r.top,n)),r.bottom!=null&&e.bottom!=null&&(this.bottom=Lm(e.bottom,r.bottom,n)),r.left!=null&&e.left!=null&&(this.left=Lm(e.left,r.left,n)),r.right!=null&&e.right!=null&&(this.right=Lm(e.right,r.right,n)),this}getCenter(e,r){const n=xg((this.left+e-this.right)/2,0,e),a=xg((this.top+r-this.bottom)/2,0,r);return new Pl(n,a)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new I2(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const A3=2*Math.PI*S3;function C3(t){return A3*Math.cos(t*Math.PI/180)}function b1(t){return(180+t)/360}function E1(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function M3(t,e){return t/C3(e)}function WP(t){return t*360-180}function L2(t){const e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function XP(t,e){return t*C3(L2(e))}function qP(t){return 1/Math.cos(t*Math.PI/180)}class Vm{static fromLngLat(e,r=0){const n=qu.convert(e);return new Vm(b1(n.lng),E1(n.lat),M3(r,n.lat))}constructor(e,r,n=0){(0,K.Z)(this,"x",void 0),(0,K.Z)(this,"y",void 0),(0,K.Z)(this,"z",void 0),this.x=+e,this.y=+r,this.z=+n}toLngLat(){return new qu(WP(this.x),L2(this.y))}toAltitude(){return XP(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/A3*qP(L2(this.y))}}const $O=8192;class D2{get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this._pitch=Math.max(this._pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this._pitch=Math.min(this._pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new Pl(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){const r=-M2(e,-180,180)*Math.PI/180;this.angle!==r&&(this.unmodified=!1,this.angle=r,this.calcMatrices(),this.rotationMatrix=T3.create(),T3.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const r=xg(e,this._minPitch,this._maxPitch)/180*Math.PI;this._pitch!==r&&(this.unmodified=!1,this._pitch=r,this.calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this.unmodified=!1,this._fov=e/180*Math.PI,this.calcMatrices())}get zoom(){return this._zoom}set zoom(e){const r=Math.min(Math.max(e,this._minZoom),this._maxZoom);this._zoom!==r&&(this.unmodified=!1,this._zoom=r,this.scale=this.zoomScale(r),this.tileZoom=Math.floor(r),this.zoomFraction=r-this.tileZoom,this.constrain(),this.calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this.unmodified=!1,this._center=e,this.constrain(),this.calcMatrices())}get padding(){return this.edgeInsets.toJSON()}set padding(e){this.edgeInsets.equals(e)||(this.unmodified=!1,this.edgeInsets.interpolate(this.edgeInsets,e,1),this.calcMatrices())}get centerPoint(){return this.edgeInsets.getCenter(this.width,this.height)}get point(){return this.project(this.center)}constructor(e,r,n,a,u){(0,K.Z)(this,"tileSize",void 0),(0,K.Z)(this,"tileZoom",void 0),(0,K.Z)(this,"lngRange",void 0),(0,K.Z)(this,"latRange",void 0),(0,K.Z)(this,"maxValidLatitude",void 0),(0,K.Z)(this,"scale",void 0),(0,K.Z)(this,"width",void 0),(0,K.Z)(this,"height",void 0),(0,K.Z)(this,"angle",void 0),(0,K.Z)(this,"rotationMatrix",void 0),(0,K.Z)(this,"pixelsToGLUnits",void 0),(0,K.Z)(this,"cameraToCenterDistance",void 0),(0,K.Z)(this,"mercatorMatrix",void 0),(0,K.Z)(this,"projMatrix",void 0),(0,K.Z)(this,"invProjMatrix",void 0),(0,K.Z)(this,"alignedProjMatrix",void 0),(0,K.Z)(this,"pixelMatrix",void 0),(0,K.Z)(this,"pixelMatrixInverse",void 0),(0,K.Z)(this,"glCoordMatrix",void 0),(0,K.Z)(this,"labelPlaneMatrix",void 0),(0,K.Z)(this,"_fov",void 0),(0,K.Z)(this,"_pitch",void 0),(0,K.Z)(this,"_zoom",void 0),(0,K.Z)(this,"_renderWorldCopies",void 0),(0,K.Z)(this,"_minZoom",void 0),(0,K.Z)(this,"_maxZoom",void 0),(0,K.Z)(this,"_minPitch",void 0),(0,K.Z)(this,"_maxPitch",void 0),(0,K.Z)(this,"_center",void 0),(0,K.Z)(this,"zoomFraction",void 0),(0,K.Z)(this,"unmodified",void 0),(0,K.Z)(this,"edgeInsets",void 0),(0,K.Z)(this,"constraining",void 0),(0,K.Z)(this,"posMatrixCache",void 0),(0,K.Z)(this,"alignedPosMatrixCache",void 0),this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=u===void 0?!0:u,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=n==null?0:n,this._maxPitch=a==null?60:a,this.setMaxBounds(),this.width=0,this.height=0,this._center=new qu(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this.unmodified=!0,this.edgeInsets=new I2,this.posMatrixCache={},this.alignedPosMatrixCache={}}clone(){const e=new D2(this._minZoom,this._maxZoom,this._minPitch,this._maxPitch,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e.center=this._center,e.zoom=this.zoom,e.angle=this.angle,e.fov=this._fov,e.pitch=this._pitch,e.unmodified=this.unmodified,e.edgeInsets=this.edgeInsets.clone(),e.calcMatrices(),e}isPaddingEqual(e){return this.edgeInsets.equals(e)}interpolatePadding(e,r,n){this.unmodified=!1,this.edgeInsets.interpolate(e,r,n),this.constrain(),this.calcMatrices()}coveringZoomLevel(e){const r=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,r)}resize(e,r){this.width=e,this.height=r,this.pixelsToGLUnits=[2/e,-2/r],this.constrain(),this.calcMatrices()}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){const r=xg(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new Pl(b1(e.lng)*this.worldSize,E1(r)*this.worldSize)}unproject(e){return new Vm(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}setLocationAtPoint(e,r){const n=this.pointCoordinate(r),a=this.pointCoordinate(this.centerPoint),u=this.locationCoordinate(e),y=new Vm(u.x-(n.x-a.x),u.y-(n.y-a.y));this.center=this.coordinateLocation(y),this._renderWorldCopies&&(this.center=this.center.wrap())}pointCoordinate(e){const n=new Float64Array([e.x,e.y,0,1]),a=new Float64Array([e.x,e.y,1,1]);mh.transformMat4(n,n,this.pixelMatrixInverse),mh.transformMat4(a,a,this.pixelMatrixInverse);const u=n[3],y=a[3],A=n[0]/u,O=a[0]/y,Z=n[1]/u,Y=a[1]/y,Q=n[2]/u,ae=a[2]/y,xe=Q===ae?0:(0-Q)/(ae-Q);return new Vm(Lm(A,O,xe)/this.worldSize,Lm(Z,Y,xe)/this.worldSize)}getBounds(){return new tg().extend(this.pointLocation(new Pl(0,0))).extend(this.pointLocation(new Pl(this.width,0))).extend(this.pointLocation(new Pl(this.width,this.height))).extend(this.pointLocation(new Pl(0,this.height)))}getMaxBounds(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new tg([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this.constrain()):(this.lngRange=void 0,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}customLayerMatrix(){return this.mercatorMatrix.slice()}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const e=this.pointCoordinate(new Pl(0,0)),r=new Float32Array([e.x*this.worldSize,e.y*this.worldSize,0,1]);return mh.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new Pl(0,r))}getCameraQueryGeometry(e){const r=this.getCameraPoint();if(e.length===1)return[e[0],r];{let n=r.x,a=r.y,u=r.x,y=r.y;for(const A of e)n=Math.min(n,A.x),a=Math.min(a,A.y),u=Math.max(u,A.x),y=Math.max(y,A.y);return[new Pl(n,a),new Pl(u,a),new Pl(u,y),new Pl(n,y),new Pl(n,a)]}}coordinatePoint(e){const r=mh.fromValues(e.x*this.worldSize,e.y*this.worldSize,0,1);return mh.transformMat4(r,r,this.pixelMatrix),new Pl(r[0]/r[3],r[1]/r[3])}locationPoint(e){return this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e){return this.coordinateLocation(this.pointCoordinate(e))}locationCoordinate(e){return Vm.fromLngLat(e)}coordinateLocation(e){return e.toLngLat()}getProjectionMatrix(){return this.projMatrix}constrain(){if(!this.center||!this.width||!this.height||this.constraining)return;this.constraining=!0;let e=-90,r=90,n=-180,a=180,u,y,A,O;const Z=this.size,Y=this.unmodified;if(this.latRange){const xe=this.latRange;e=E1(xe[1])*this.worldSize,r=E1(xe[0])*this.worldSize,u=r-er&&(O=r-Be)}if(this.lngRange){const xe=Q.x,Be=Z.x/2;xe-Bea&&(A=a-Be)}(A!==void 0||O!==void 0)&&(this.center=this.unproject(new Pl(A!==void 0?A:Q.x,O!==void 0?O:Q.y))),this.unmodified=Y,this.constraining=!1}calcMatrices(){if(!this.height)return;const e=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(e)*this.height;const n=Math.PI/2+this._pitch,a=this._fov*(.5+r.y/this.height),u=Math.sin(a)*this.cameraToCenterDistance/Math.sin(xg(Math.PI-n-a,.01,Math.PI-.01)),y=this.point,A=y.x,O=y.y,Y=(Math.cos(Math.PI/2-this._pitch)*u+this.cameraToCenterDistance)*1.01,Q=this.height/50;let ae=new Float64Array(16);Kr.perspective(ae,this._fov,this.width/this.height,Q,Y),ae[8]=-r.x*2/this.width,ae[9]=r.y*2/this.height,Kr.scale(ae,ae,[1,-1,1]),Kr.translate(ae,ae,[0,0,-this.cameraToCenterDistance]),Kr.rotateX(ae,ae,this._pitch),Kr.rotateZ(ae,ae,this.angle),Kr.translate(ae,ae,[-A,-O,0]),this.mercatorMatrix=Kr.scale([],ae,[this.worldSize,this.worldSize,this.worldSize]),Kr.scale(ae,ae,[1,1,M3(1,this.center.lat)*this.worldSize,1]),this.projMatrix=ae,this.invProjMatrix=Kr.invert([],this.projMatrix);const xe=this.width%2/2,Be=this.height%2/2,it=Math.cos(this.angle),gt=Math.sin(this.angle),Bt=A-Math.round(A)+it*xe+gt*Be,Rt=O-Math.round(O)+it*Be+gt*xe,Yt=new Float64Array(ae);if(Kr.translate(Yt,Yt,[Bt>.5?Bt-1:Bt,Rt>.5?Rt-1:Rt,0]),this.alignedProjMatrix=Yt,ae=Kr.create(),Kr.scale(ae,ae,[this.width/2,-this.height/2,1]),Kr.translate(ae,ae,[1,-1,0]),this.labelPlaneMatrix=ae,ae=Kr.create(),Kr.scale(ae,ae,[1,-1,1]),Kr.translate(ae,ae,[-1,-1,0]),Kr.scale(ae,ae,[2/this.width,2/this.height,1]),this.glCoordMatrix=ae,this.pixelMatrix=Kr.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),ae=Kr.invert(new Float64Array(16),this.pixelMatrix),!ae)throw new Error("failed to invert matrix");this.pixelMatrixInverse=ae,this.posMatrixCache={},this.alignedPosMatrixCache={}}}const{merge:YP}=es;class Yu{constructor(e,r={}){(0,K.Z)(this,"type",void 0),YP(this,r),this.type=e}}const{merge:rg}=es;class P3 extends Yl.EventEmitter{constructor(e){super(),(0,K.Z)(this,"transform",void 0),(0,K.Z)(this,"options",void 0),(0,K.Z)(this,"moving",void 0),(0,K.Z)(this,"zooming",void 0),(0,K.Z)(this,"rotating",void 0),(0,K.Z)(this,"pitching",void 0),(0,K.Z)(this,"padding",void 0),(0,K.Z)(this,"bearingSnap",void 0),(0,K.Z)(this,"easeEndTimeoutID",void 0),(0,K.Z)(this,"easeStart",void 0),(0,K.Z)(this,"easeOptions",void 0),(0,K.Z)(this,"easeId",void 0),(0,K.Z)(this,"onEaseFrame",void 0),(0,K.Z)(this,"onEaseEnd",void 0),(0,K.Z)(this,"easeFrameId",void 0),(0,K.Z)(this,"pitchEnabled",void 0),(0,K.Z)(this,"rotateEnabled",void 0),(0,K.Z)(this,"renderFrameCallback",()=>{const A=Math.min((kg()-this.easeStart)/this.easeOptions.duration,1);this.onEaseFrame(this.easeOptions.easing(A)),A<1?this.easeFrameId=this.requestRenderFrame(this.renderFrameCallback):this.stop()}),this.options=e;const{minZoom:r,maxZoom:n,minPitch:a,maxPitch:u,renderWorldCopies:y}=e;this.moving=!1,this.zooming=!1,this.bearingSnap=e.bearingSnap,this.pitchEnabled=e.pitchEnabled,this.rotateEnabled=e.rotateEnabled,this.transform=new D2(r,n,a,u,y)}requestRenderFrame(e){return 0}cancelRenderFrame(e){}getCenter(){const{lng:e,lat:r}=this.transform.center;return new qu(e,r)}getZoom(){return this.transform.zoom}getPitch(){return this.transform.pitch}setCenter(e,r){return this.jumpTo({center:e},r)}setPitch(e,r){return this.jumpTo({pitch:e},r),this}getBearing(){return this.transform.bearing}panTo(e,r,n){return this.easeTo(rg({center:e},r),n)}panBy(e,r,n){return e=Pl.convert(e).mult(-1),this.panTo(this.transform.center,GP({offset:e},r||{}),n)}zoomOut(e,r){return this.zoomTo(this.getZoom()-1,e,r),this}setBearing(e,r){return this.jumpTo({bearing:e},r),this}setZoom(e,r){return this.jumpTo({zoom:e},r),this}zoomIn(e,r){return this.zoomTo(this.getZoom()+1,e,r),this}zoomTo(e,r,n){return this.easeTo(rg({zoom:e},r),n)}getPadding(){return this.transform.padding}setPadding(e,r){return this.jumpTo({padding:e},r),this}rotateTo(e,r,n){return this.easeTo(rg({bearing:e},r),n)}resetNorth(e,r){return this.rotateTo(0,rg({duration:1e3},e),r),this}resetNorthPitch(e,r){return this.easeTo(rg({bearing:0,pitch:0,duration:1e3},e),r),this}fitBounds(e,r,n){return this.fitInternal(this.cameraForBounds(e,r),r,n)}cameraForBounds(e,r){return e=tg.convert(e),this.cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),0,r)}snapToNorth(e,r){return Math.abs(this.getBearing()){if(this.zooming&&(n.zoom=Lm(a,O,cn)),this.rotating&&this.rotateEnabled&&(n.bearing=Lm(u,Z,cn)),this.pitching&&this.pitchEnabled&&(n.pitch=Lm(y,Y,cn)),this.padding&&(n.interpolatePadding(A,Q,cn),xe=n.centerPoint.add(ae)),Yt)n.setLocationAtPoint(Yt,vr);else{const Gr=n.zoomScale(n.zoom-a),Pn=O>a?Math.min(2,Rt):Math.max(.5,Rt),Oo=Math.pow(Pn,1-cn),Da=n.unproject(gt.add(Bt.mult(cn*Oo)).mult(Gr));n.setLocationAtPoint(n.renderWorldCopies?Da.wrap():Da,xe)}this.fireMoveEvents(r)},cn=>{this.afterEase(r,cn)},e),this}flyTo(e={},r){if(!e.essential&&w3()){const nl=VP(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(nl,r)}this.stop(),e=rg({offset:[0,0],speed:1.2,curve:1.42,easing:R2},e);const n=this.transform,a=this.getZoom(),u=this.getBearing(),y=this.getPitch(),A=this.getPadding(),O=e.zoom?xg(+e.zoom,n.minZoom,n.maxZoom):a,Z=e.bearing?this.normalizeBearing(e.bearing,u):u,Y=e.pitch?+e.pitch:y,Q="padding"in e?e.padding:n.padding,ae=n.zoomScale(O-a),xe=Pl.convert(e.offset);let Be=n.centerPoint.add(xe);const it=n.pointLocation(Be),gt=qu.convert(e.center||it);this.normalizeCenter(gt);const Bt=n.project(it),Rt=n.project(gt).sub(Bt);let Yt=e.curve;const vr=Math.max(n.width,n.height),ln=vr/ae,cn=Rt.mag();if("minZoom"in e){const nl=xg(Math.min(e.minZoom,a,O),n.minZoom,n.maxZoom),Df=vr/n.zoomScale(nl-a);Yt=Math.sqrt(Df/cn*2)}const Gr=Yt*Yt;function Pn(nl){const Df=(ln*ln-vr*vr+(nl?-1:1)*Gr*Gr*cn*cn)/(2*(nl?ln:vr)*Gr*cn);return Math.log(Math.sqrt(Df*Df+1)-Df)}function Oo(nl){return(Math.exp(nl)-Math.exp(-nl))/2}function Da(nl){return(Math.exp(nl)+Math.exp(-nl))/2}function Bo(nl){return Oo(nl)/Da(nl)}const Oa=Pn(0);let fl=nl=>Da(Oa)/Da(Oa+Yt*nl),Gp=nl=>vr*((Da(Oa)*Bo(Oa+Yt*nl)-Oo(Oa))/Gr)/cn,Wp=(Pn(1)-Oa)/Yt;if(Math.abs(cn)<1e-6||!isFinite(Wp)){if(Math.abs(vr-ln)<1e-6)return this.easeTo(e,r);const nl=ln0,fl=Df=>Math.exp(nl*Yt*Df)}if("duration"in e)e.duration=+e.duration;else{const nl="screenSpeed"in e?+e.screenSpeed/Yt:+e.speed;e.duration=1e3*Wp/nl}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this.zooming=!0,this.rotating=u!==Z,this.pitching=Y!==y,this.padding=!n.isPaddingEqual(Q),this.prepareEase(r,!1),this.ease(nl=>{const Df=nl*Wp,Xm=1/fl(Df);n.zoom=nl===1?O:a+n.scaleZoom(Xm),this.rotating&&(n.bearing=Lm(u,Z,nl)),this.pitching&&(n.pitch=Lm(y,Y,nl)),this.padding&&(n.interpolatePadding(A,Q,nl),Be=n.centerPoint.add(xe));const vd=nl===1?gt:n.unproject(Bt.add(Rt.mult(Gp(Df))).mult(Xm));n.setLocationAtPoint(n.renderWorldCopies?vd.wrap():vd,Be),this.fireMoveEvents(r)},()=>this.afterEase(r),e),this}fitScreenCoordinates(e,r,n,a,u){return this.fitInternal(this.cameraForBoxAndBearing(this.transform.pointLocation(Pl.convert(e)),this.transform.pointLocation(Pl.convert(r)),n,a),a,u)}stop(e,r){if(this.easeFrameId&&(this.cancelRenderFrame(this.easeFrameId),delete this.easeFrameId,delete this.onEaseFrame),this.onEaseEnd){const n=this.onEaseEnd;delete this.onEaseEnd,n.call(this,r)}return this}normalizeBearing(e,r){e=M2(e,-180,180);const n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:n<-180?360:0}fireMoveEvents(e){this.emit("move",new Yu("move",e)),this.zooming&&this.emit("zoom",new Yu("zoom",e)),this.rotating&&this.emit("rotate",new Yu("rotate",e)),this.pitching&&this.emit("rotate",new Yu("pitch",e))}prepareEase(e,r=!1,n={}){this.moving=!0,!r&&!n.moving&&this.emit("movestart",new Yu("movestart",e)),this.zooming&&!n.zooming&&this.emit("zoomstart",new Yu("zoomstart",e)),this.rotating&&!n.rotating&&this.emit("rotatestart",new Yu("rotatestart",e)),this.pitching&&!n.pitching&&this.emit("pitchstart",new Yu("pitchstart",e))}afterEase(e,r){if(this.easeId&&r&&this.easeId===r)return;delete this.easeId;const n=this.zooming,a=this.rotating,u=this.pitching;this.moving=!1,this.zooming=!1,this.rotating=!1,this.pitching=!1,this.padding=!1,n&&this.emit("zoomend",new Yu("zoomend",e)),a&&this.emit("rotateend",new Yu("rotateend",e)),u&&this.emit("pitchend",new Yu("pitchend",e)),this.emit("moveend",new Yu("moveend",e))}ease(e,r,n){n.animate===!1||n.duration===0?(e(1),r()):(this.easeStart=kg(),this.easeOptions=n,this.onEaseFrame=e,this.onEaseEnd=r,this.easeFrameId=this.requestRenderFrame(this.renderFrameCallback))}cameraForBoxAndBearing(e,r,n,a){const u={top:0,bottom:0,right:0,left:0};if(a=rg({padding:u,offset:[0,0],maxZoom:this.transform.maxZoom},a),typeof a.padding=="number"){const Pn=a.padding;a.padding={top:Pn,bottom:Pn,right:Pn,left:Pn}}a.padding=rg(u,a.padding);const y=this.transform,A=y.padding,O=y.project(qu.convert(e)),Z=y.project(qu.convert(r)),Y=O.rotate(-n*Math.PI/180),Q=Z.rotate(-n*Math.PI/180),ae=new Pl(Math.max(Y.x,Q.x),Math.max(Y.y,Q.y)),xe=new Pl(Math.min(Y.x,Q.x),Math.min(Y.y,Q.y)),Be=ae.sub(xe),it=(y.width-(A.left+A.right+a.padding.left+a.padding.right))/Be.x,gt=(y.height-(A.top+A.bottom+a.padding.top+a.padding.bottom))/Be.y;if(gt<0||it<0)return;const Bt=Math.min(y.scaleZoom(y.scale*Math.min(it,gt)),a.maxZoom),Rt=Pl.convert(a.offset),Yt=(a.padding.left-a.padding.right)/2,vr=(a.padding.top-a.padding.bottom)/2,cn=new Pl(Rt.x+Yt,Rt.y+vr).mult(y.scale/y.zoomScale(Bt));return{center:y.unproject(O.add(Z).div(2).sub(cn)),zoom:Bt,bearing:n}}fitInternal(e,r,n){return e?(r=rg(e,r),delete r.padding,r.linear?this.easeTo(r,n):this.flyTo(r,n)):this}}const mm={};var od=mm;mm.create=(t,e,r)=>{const n=window.document.createElement(t);return e!==void 0&&(n.className=e),r&&r.appendChild(n),n},mm.createNS=(t,e)=>window.document.createElementNS(t,e);const o0=window.document&&window.document.documentElement.style;function R3(t){if(!o0)return t[0];for(const e of t)if(e in o0)return e;return t[0]}const g_=R3(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);let I3;mm.disableDrag=()=>{o0&&g_&&(I3=o0[g_],o0[g_]="none")},mm.enableDrag=()=>{o0&&g_&&(o0[g_]=I3)};const $P=R3(["transform","WebkitTransform"]);mm.setTransform=(t,e)=>{t.style[$P]=e};let w1=!1;try{const t=Object.defineProperty({},"passive",{get(){w1=!0}});window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){w1=!1}mm.addEventListener=(t,e,r,n={})=>{"passive"in n&&w1?t.addEventListener(e,r,n):t.addEventListener(e,r,n.capture)},mm.removeEventListener=(t,e,r,n={})=>{"passive"in n&&w1?t.removeEventListener(e,r,n):t.removeEventListener(e,r,n.capture)};const O2=t=>{t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",O2,!0)};mm.suppressClick=()=>{window.addEventListener("click",O2,!0),setTimeout(()=>{window.removeEventListener("click",O2,!0)},0)},mm.mousePos=(t,e)=>{const r=t.getBoundingClientRect();return new Pl(e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop)},mm.touchPos=(t,e)=>{const r=t.getBoundingClientRect(),n=[];for(const a of e)n.push(new Pl(a.clientX-r.left-t.clientLeft,a.clientY-r.top-t.clientTop));return n},mm.mouseButton=t=>t.button,mm.remove=t=>{t.parentNode&&t.parentNode.removeChild(t)};class bg extends Yu{constructor(e,r,n){super(e),(0,K.Z)(this,"target",void 0),(0,K.Z)(this,"originalEvent",void 0),(0,K.Z)(this,"point",void 0),(0,K.Z)(this,"lngLat",void 0),(0,K.Z)(this,"defaultPrevented",void 0);const a=od.mousePos(r.getCanvasContainer(),n),u=r.unproject(a);this.point=a,this.lngLat=u,this.originalEvent=n,this.defaultPrevented=!1,this.target=r}preventDefault(){this.defaultPrevented=!0}}class S1 extends Yu{constructor(e,r,n){super(e),(0,K.Z)(this,"target",void 0),(0,K.Z)(this,"originalEvent",void 0),(0,K.Z)(this,"lngLat",void 0),(0,K.Z)(this,"point",void 0),(0,K.Z)(this,"points",void 0),(0,K.Z)(this,"lngLats",void 0),(0,K.Z)(this,"defaultPrevented",void 0);const a=e==="touchend"?n.changedTouches:n.touches,u=od.touchPos(r.getCanvasContainer(),a),y=u.map(Z=>r.unproject(Z)),A=u.reduce((Z,Y,Q,ae)=>Z.add(Y.div(ae.length)),new Pl(0,0)),O=r.unproject(A);this.points=u,this.point=A,this.lngLats=y,this.lngLat=O,this.originalEvent=n,this.defaultPrevented=!1}preventDefault(){this.defaultPrevented=!0}}class KP extends Yu{constructor(e,r,n){super(e),(0,K.Z)(this,"originalEvent",void 0),(0,K.Z)(this,"defaultPrevented",void 0),(0,K.Z)(this,"target",void 0),this.originalEvent=n,this.defaultPrevented=!1}preventDefault(){this.defaultPrevented=!0}}class JP{constructor(e){(0,K.Z)(this,"map",void 0),(0,K.Z)(this,"delayContextMenu",void 0),(0,K.Z)(this,"contextMenuEvent",void 0),this.map=e}reset(){this.delayContextMenu=!1,delete this.contextMenuEvent}mousemove(e){this.map.emit(e.type,new bg(e.type,this.map,e))}mousedown(){this.delayContextMenu=!0}mouseup(){this.delayContextMenu=!1,this.contextMenuEvent&&(this.map.emit("contextmenu",new bg("contextmenu",this.map,this.contextMenuEvent)),delete this.contextMenuEvent)}contextmenu(e){this.delayContextMenu?this.contextMenuEvent=e:this.map.emit(e.type,new bg(e.type,this.map,e)),this.map.listeners("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){return!0}disable(){return!1}}class QP{constructor(e,r){(0,K.Z)(this,"map",void 0),(0,K.Z)(this,"el",void 0),(0,K.Z)(this,"container",void 0),(0,K.Z)(this,"enabled",void 0),(0,K.Z)(this,"active",void 0),(0,K.Z)(this,"startPos",void 0),(0,K.Z)(this,"lastPos",void 0),(0,K.Z)(this,"box",void 0),(0,K.Z)(this,"clickTolerance",void 0),this.map=e,this.el=e.getCanvasContainer(),this.container=e.getContainer(),this.clickTolerance=r.clickTolerance||1}isEnabled(){return!!this.enabled}isActive(){return!!this.active}enable(){this.isEnabled()||(this.enabled=!0)}disable(){this.isEnabled()&&(this.enabled=!1)}mousedown(e,r){this.isEnabled()&&e.shiftKey&&e.button===0&&(od.disableDrag(),this.startPos=this.lastPos=r,this.active=!0)}mousemoveWindow(e,r){if(!this.active)return;const n=r;if(this.lastPos.equals(n)||!this.box&&n.dist(this.startPos)u.fitScreenCoordinates(n,a,this.map.getBearing(),{linear:!0})}}keydown(e){this.active&&e.keyCode===27&&(this.reset(),this.fireEvent("boxzoomcancel",e))}reset(){this.active=!1,this.container.classList.remove("l7-crosshair"),this.box&&(od.remove(this.box),this.box=null),od.enableDrag(),delete this.startPos,delete this.lastPos}fireEvent(e,r){return this.map.emit(e,new Yu(e,{originalEvent:r}))}}var eR=QP;class tR{constructor(){(0,K.Z)(this,"enabled",void 0),(0,K.Z)(this,"active",void 0),this.reset()}reset(){this.active=!1}dblclick(e,r){return e.preventDefault(),{cameraAnimation:n=>{n.easeTo({duration:300,zoom:n.getZoom()+(e.shiftKey?-1:1),around:n.unproject(r)},{originalEvent:e})}}}enable(){this.enabled=!0}disable(){this.enabled=!1,this.reset()}isEnabled(){return this.enabled}isActive(){return this.active}}class rR extends Yu{constructor(e,r){super(e),(0,K.Z)(this,"type","renderFrame"),(0,K.Z)(this,"timeStamp",void 0),this.timeStamp=r}}const{merge:N0}=es,T1={linearity:.3,easing:P2(0,0,.3,1)},nR=N0({deceleration:2500,maxSpeed:1400},T1),iR=N0({deceleration:20,maxSpeed:1400},T1),oR=N0({deceleration:1e3,maxSpeed:360},T1),aR=N0({deceleration:1e3,maxSpeed:90},T1);class sR{constructor(e){(0,K.Z)(this,"map",void 0),(0,K.Z)(this,"inertiaBuffer",void 0),this.map=e,this.clear()}clear(){this.inertiaBuffer=[]}record(e){this.drainInertiaBuffer(),this.inertiaBuffer.push({time:kg(),settings:e})}drainInertiaBuffer(){const e=this.inertiaBuffer,r=kg(),n=160;for(;e.length>0&&r-e[0].time>n;)e.shift()}onMoveEnd(e){if(this.drainInertiaBuffer(),this.inertiaBuffer.length<2)return;const r={zoom:0,bearing:0,pitch:0,pan:new Pl(0,0),pinchAround:void 0,around:void 0};for(const{settings:y}of this.inertiaBuffer)r.zoom+=y.zoomDelta||0,r.bearing+=y.bearingDelta||0,r.pitch+=y.pitchDelta||0,y.panDelta&&r.pan._add(y.panDelta),y.around&&(r.around=y.around),y.pinchAround&&(r.pinchAround=y.pinchAround);const a=this.inertiaBuffer[this.inertiaBuffer.length-1].time-this.inertiaBuffer[0].time,u={};if(r.pan.mag()){const y=C1(r.pan.mag(),a,N0({},nR,e||{}));u.offset=r.pan.mult(y.amount/r.pan.mag()),u.center=this.map.transform.center,A1(u,y)}if(r.zoom){const y=C1(r.zoom,a,iR);u.zoom=this.map.transform.zoom+y.amount,A1(u,y)}if(r.bearing){const y=C1(r.bearing,a,oR);u.bearing=this.map.transform.bearing+xg(y.amount,-179,179),A1(u,y)}if(r.pitch){const y=C1(r.pitch,a,aR);u.pitch=this.map.transform.pitch+y.amount,A1(u,y)}if(u.zoom||u.bearing){const y=r.pinchAround===void 0?r.around:r.pinchAround;u.around=y?this.map.unproject(y):this.map.getCenter()}return this.clear(),N0(u,{noMoveStart:!0})}}function A1(t,e){(!t.duration||t.duration{const O=A.getZoom();A.easeTo({duration:300,easeId:"keyboardHandler",easing:cR,zoom:r?Math.round(O)+r*(e.shiftKey?2:1):O,bearing:A.getBearing()+n*this.bearingStep,pitch:A.getPitch()+a*this.pitchStep,offset:[-u*this.panStep,-y*this.panStep],center:A.getCenter()},{originalEvent:e})}}}enable(){this.enabled=!0}disable(){this.enabled=!1,this.reset()}isEnabled(){return this.enabled}isActive(){return this.active}}function cR(t){return t*(2-t)}var hR=uR;class pR{constructor(e,r){(0,K.Z)(this,"mousedownPos",void 0),(0,K.Z)(this,"clickTolerance",void 0),(0,K.Z)(this,"map",void 0),this.map=e,this.clickTolerance=r.clickTolerance}reset(){delete this.mousedownPos}wheel(e){return this.firePreventable(new KP(e.type,this.map,e))}mousedown(e,r){return this.mousedownPos=r,this.firePreventable(new bg(e.type,this.map,e))}mouseup(e){this.map.emit(e.type,new bg(e.type,this.map,e))}click(e,r){this.mousedownPos&&this.mousedownPos.dist(r)>=this.clickTolerance||this.map.emit(e.type,new bg(e.type,this.map,e))}dblclick(e){return this.firePreventable(new bg(e.type,this.map,e))}mouseover(e){this.map.emit(e.type,new bg(e.type,this.map,e))}mouseout(e){this.map.emit(e.type,new bg(e.type,this.map,e))}touchstart(e){return this.firePreventable(new S1(e.type,this.map,e))}touchmove(e){this.map.emit(e.type,new S1(e.type,this.map,e))}touchend(e){this.map.emit(e.type,new S1(e.type,this.map,e))}touchcancel(e){this.map.emit(e.type,new S1(e.type,this.map,e))}firePreventable(e){if(this.map.emit(e.type,e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){return!1}disable(){return!1}}const M1=0,B2=2,fR={[M1]:1,[B2]:2};function dR(t,e){const r=fR[e];return t.buttons===void 0||(t.buttons&r)!==r}class F2{constructor(e){(0,K.Z)(this,"enabled",void 0),(0,K.Z)(this,"active",void 0),(0,K.Z)(this,"lastPoint",void 0),(0,K.Z)(this,"eventButton",void 0),(0,K.Z)(this,"moved",void 0),(0,K.Z)(this,"clickTolerance",void 0),this.reset(),this.clickTolerance=e.clickTolerance||1}reset(){this.active=!1,this.moved=!1,delete this.lastPoint,delete this.eventButton}mousedown(e,r){if(this.lastPoint)return;const n=od.mouseButton(e);this.correctButton(e,n)&&(this.lastPoint=r,this.eventButton=n)}mousemoveWindow(e,r){const n=this.lastPoint;if(n){if(e.preventDefault(),dR(e,this.eventButton)){this.reset();return}if(!(!this.moved&&r.dist(n){if(!this.frameId||(this.frameId=null,!this.isActive()))return;const n=this.map.transform;if(this.delta!==0){const Z=this.type==="wheel"&&Math.abs(this.delta)>L3?this.wheelZoomRate:this.defaultZoomRate;let Y=xR/(1+Math.exp(-Math.abs(this.delta*Z)));this.delta<0&&Y!==0&&(Y=1/Y);const Q=typeof this.targetZoom=="number"?n.zoomScale(this.targetZoom):n.scale;this.targetZoom=Math.min(n.maxZoom,Math.max(n.minZoom,n.scaleZoom(Q*Y))),this.type==="wheel"&&(this.startZoom=n.zoom,this.easing=this.smoothOutEasing(200)),this.delta=0}const a=typeof this.targetZoom=="number"?this.targetZoom:n.zoom,u=this.startZoom,y=this.easing;let A=!1,O;if(this.type==="wheel"&&u&&y){const Z=Math.min((kg()-this.lastWheelEventTime)/200,1),Y=y(Z);O=Lm(u,a,Y),Z<1?this.frameId||(this.frameId=!0):A=!0}else O=a,A=!0;return this.active=!0,A&&(this.active=!1,this.finishTimeout=setTimeout(()=>{this.zooming=!1,this.handler.triggerRenderFrame(),delete this.targetZoom,delete this.finishTimeout},200)),{noInertia:!0,needsRenderFrame:!A,zoomDelta:O-n.zoom,around:this.aroundPoint,originalEvent:this.lastWheelEvent}}),this.map=e,this.el=e.getCanvasContainer(),this.handler=r,this.delta=0,this.defaultZoomRate=_R,this.wheelZoomRate=yR}setZoomRate(e){this.defaultZoomRate=e}setWheelZoomRate(e){this.wheelZoomRate=e}isEnabled(){return!!this.enabled}isActive(){return!!this.active||this.finishTimeout!==void 0}isZooming(){return!!this.zooming}enable(e){this.isEnabled()||(this.enabled=!0,this.aroundCenter=e&&e.around==="center")}disable(){this.isEnabled()&&(this.enabled=!1)}wheel(e){if(!this.isEnabled())return;let r=e.deltaMode===window.WheelEvent.DOM_DELTA_LINE?e.deltaY*40:e.deltaY;const n=kg(),a=n-(this.lastWheelEventTime||0);this.lastWheelEventTime=n,r!==0&&r%L3===0?this.type="wheel":r!==0&&Math.abs(r)<4?this.type="trackpad":a>400?(this.type=null,this.lastValue=r,this.timeout=setTimeout(this.onTimeout,40,e)):this.type||(this.type=Math.abs(a*r)<200?"trackpad":"wheel",this.timeout&&(clearTimeout(this.timeout),this.timeout=null,r+=this.lastValue)),e.shiftKey&&r&&(r=r/4),this.type&&(this.lastWheelEvent=e,this.delta-=r,this.active||this.start(e)),e.preventDefault()}renderFrame(){return this.onScrollFrame()}reset(){this.active=!1}onTimeout(e){this.type="wheel",this.delta-=this.lastValue,!this.active&&this.start&&this.start(e)}start(e){if(!this.delta)return;this.frameId&&(this.frameId=null),this.active=!0,this.isZooming()||(this.zooming=!0),this.finishTimeout&&(clearTimeout(this.finishTimeout),delete this.finishTimeout);const r=od.mousePos(this.el,e);this.around=qu.convert(this.aroundCenter?this.map.getCenter():this.map.unproject(r)),this.aroundPoint=this.map.transform.locationPoint(this.around),this.frameId||(this.frameId=!0,this.handler.triggerRenderFrame())}smoothOutEasing(e){let r=R2;if(this.prevEase){const n=this.prevEase,a=(kg()-n.start)/n.duration,u=n.easing(a+.01)-n.easing(a),y=.27/Math.sqrt(u*u+1e-4)*.01,A=Math.sqrt(.27*.27-y*y);r=P2(y,A,.25,1)}return this.prevEase={start:kg(),duration:e,easing:r},r}}var ER=bR;class wR{constructor(e,r){(0,K.Z)(this,"clickZoom",void 0),(0,K.Z)(this,"tapZoom",void 0),this.clickZoom=e,this.tapZoom=r}enable(){this.clickZoom.enable(),this.tapZoom.enable()}disable(){this.clickZoom.disable(),this.tapZoom.disable()}isEnabled(){return this.clickZoom.isEnabled()&&this.tapZoom.isEnabled()}isActive(){return this.clickZoom.isActive()||this.tapZoom.isActive()}}class SR{constructor(e,r,n){(0,K.Z)(this,"inertiaOptions",void 0),(0,K.Z)(this,"el",void 0),(0,K.Z)(this,"mousePan",void 0),(0,K.Z)(this,"touchPan",void 0),this.el=e,this.mousePan=r,this.touchPan=n}enable(e){this.inertiaOptions=e||{},this.mousePan.enable(),this.touchPan.enable(),this.el.classList.add("l7-touch-drag-pan")}disable(){this.mousePan.disable(),this.touchPan.disable(),this.el.classList.remove("l7-touch-drag-pan")}isEnabled(){return this.mousePan.isEnabled()&&this.touchPan.isEnabled()}isActive(){return this.mousePan.isActive()||this.touchPan.isActive()}}class TR{constructor(e,r,n){(0,K.Z)(this,"mouseRotate",void 0),(0,K.Z)(this,"mousePitch",void 0),(0,K.Z)(this,"pitchWithRotate",void 0),this.pitchWithRotate=e.pitchWithRotate,this.mouseRotate=r,this.mousePitch=n}enable(){this.mouseRotate.enable(),this.pitchWithRotate&&this.mousePitch.enable()}disable(){this.mouseRotate.disable(),this.mousePitch.disable()}isEnabled(){return this.mouseRotate.isEnabled()&&(!this.pitchWithRotate||this.mousePitch.isEnabled())}isActive(){return this.mouseRotate.isActive()||this.mousePitch.isActive()}}class AR{constructor(e,r,n,a){(0,K.Z)(this,"el",void 0),(0,K.Z)(this,"touchZoom",void 0),(0,K.Z)(this,"touchRotate",void 0),(0,K.Z)(this,"tapDragZoom",void 0),(0,K.Z)(this,"rotationDisabled",void 0),(0,K.Z)(this,"enabled",void 0),this.el=e,this.touchZoom=r,this.touchRotate=n,this.tapDragZoom=a,this.rotationDisabled=!1,this.enabled=!0}enable(e){this.touchZoom.enable(e),this.rotationDisabled||this.touchRotate.enable(e),this.tapDragZoom.enable(),this.el.classList.add("l7-touch-zoom-rotate")}disable(){this.touchZoom.disable(),this.touchRotate.disable(),this.tapDragZoom.disable(),this.el.classList.remove("l7-touch-zoom-rotate")}isEnabled(){return this.touchZoom.isEnabled()&&(this.rotationDisabled||this.touchRotate.isEnabled())&&this.tapDragZoom.isEnabled()}isActive(){return this.touchZoom.isActive()||this.touchRotate.isActive()||this.tapDragZoom.isActive()}disableRotation(){this.rotationDisabled=!0,this.touchRotate.disable()}enableRotation(){this.rotationDisabled=!1,this.touchZoom.isEnabled()&&this.touchRotate.enable()}}function k2(t,e){const r={};for(let n=0;nthis.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=CR(r),this.touches=k2(n,r)))}touchmove(e,r,n){if(this.aborted||!this.centroid)return;const a=k2(n,r);for(const u in this.touches)if(this.touches[u]){const y=this.touches[u],A=a[u];(!A||A.dist(y)>O3)&&(this.aborted=!0)}}touchend(e,r,n){if((!this.centroid||e.timeStamp-this.startTime>MR)&&(this.aborted=!0),n.length===0){const a=!this.aborted&&this.centroid;if(this.reset(),a)return a}}}class N2{constructor(e){(0,K.Z)(this,"singleTap",void 0),(0,K.Z)(this,"numTaps",void 0),(0,K.Z)(this,"lastTime",void 0),(0,K.Z)(this,"lastTap",void 0),(0,K.Z)(this,"count",void 0),this.singleTap=new PR(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,r,n){this.singleTap.touchstart(e,r,n)}touchmove(e,r,n){this.singleTap.touchmove(e,r,n)}touchend(e,r,n){const a=this.singleTap.touchend(e,r,n);if(a){const u=e.timeStamp-this.lastTimeD3&&this.reset(),this.tapTime?n.length>0&&(this.swipePoint=r[0],this.swipeTouch=n[0].identifier):this.tap.touchstart(e,r,n))}touchmove(e,r,n){if(!this.tapTime)this.tap.touchmove(e,r,n);else if(this.swipePoint){if(n[0].identifier!==this.swipeTouch)return;const a=r[0],u=a.y-this.swipePoint.y;return this.swipePoint=a,e.preventDefault(),this.active=!0,{zoomDelta:u/128}}}touchend(e,r,n){this.tapTime?this.swipePoint&&n.length===0&&this.reset():this.tap.touchend(e,r,n)&&(this.tapTime=e.timeStamp)}touchcancel(){this.reset()}enable(){this.enabled=!0}disable(){this.enabled=!1,this.reset()}isEnabled(){return this.enabled}isActive(){return this.active}}class IR{constructor(){(0,K.Z)(this,"enabled",void 0),(0,K.Z)(this,"active",void 0),(0,K.Z)(this,"zoomIn",void 0),(0,K.Z)(this,"zoomOut",void 0),this.zoomIn=new N2({numTouches:1,numTaps:2}),this.zoomOut=new N2({numTouches:2,numTaps:1}),this.reset()}reset(){this.active=!1,this.zoomIn.reset(),this.zoomOut.reset()}touchstart(e,r,n){this.zoomIn.touchstart(e,r,n),this.zoomOut.touchstart(e,r,n)}touchmove(e,r,n){this.zoomIn.touchmove(e,r,n),this.zoomOut.touchmove(e,r,n)}touchend(e,r,n){const a=this.zoomIn.touchend(e,r,n),u=this.zoomOut.touchend(e,r,n);if(a)return this.active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:y=>y.easeTo({duration:300,zoom:y.getZoom()+1,around:y.unproject(a)},{originalEvent:e})};if(u)return this.active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:y=>y.easeTo({duration:300,zoom:y.getZoom()-1,around:y.unproject(u)},{originalEvent:e})}}touchcancel(){this.reset()}enable(){this.enabled=!0}disable(){this.enabled=!1,this.reset()}isEnabled(){return this.enabled}isActive(){return this.active}}class LR{constructor(e){(0,K.Z)(this,"enabled",void 0),(0,K.Z)(this,"active",void 0),(0,K.Z)(this,"touches",void 0),(0,K.Z)(this,"minTouches",void 0),(0,K.Z)(this,"clickTolerance",void 0),(0,K.Z)(this,"sum",void 0),this.minTouches=1,this.clickTolerance=e.clickTolerance||1,this.reset()}reset(){this.active=!1,this.touches={},this.sum=new Pl(0,0)}touchstart(e,r,n){return this.calculateTransform(e,r,n)}touchmove(e,r,n){if(this.active)return e.preventDefault(),this.calculateTransform(e,r,n)}touchend(e,r,n){this.calculateTransform(e,r,n),this.active&&n.length0&&(this.active=!0);const a=k2(n,r),u=new Pl(0,0),y=new Pl(0,0);let A=0;for(const Y in a)if(a[Y]){const Q=a[Y],ae=this.touches[Y];ae&&(u._add(Q),y._add(Q.sub(ae)),A++,a[Y]=Q)}if(this.touches=a,AMath.abs(t.x)}const DR=100;class OR extends z2{constructor(...e){super(...e),(0,K.Z)(this,"valid",void 0),(0,K.Z)(this,"firstMove",void 0),(0,K.Z)(this,"lastPoints",void 0)}reset(){super.reset(),this.valid=void 0,delete this.firstMove,delete this.lastPoints}start(e){this.lastPoints=e,U2(e[0].sub(e[1]))&&(this.valid=!1)}move(e,r,n){const a=e[0].sub(this.lastPoints[0]),u=e[1].sub(this.lastPoints[1]);return this.valid=this.gestureBeginsVertically(a,u,n.timeStamp),this.valid?(this.lastPoints=e,this.active=!0,{pitchDelta:(a.y+u.y)/2*-.5}):void 0}gestureBeginsVertically(e,r,n){if(this.valid!==void 0)return this.valid;const a=2,u=e.mag()>=a,y=r.mag()>=a;if(!u&&!y)return;if(!u||!y)return this.firstMove===void 0&&(this.firstMove=n),n-this.firstMove0==r.y>0;return U2(e)&&U2(r)&&A}}const BR=25;function B3(t,e){return t.angleWith(e)*180/Math.PI}class FR extends z2{constructor(...e){super(...e),(0,K.Z)(this,"minDiameter",void 0)}reset(){super.reset(),delete this.minDiameter,delete this.startVector,delete this.vector}start(e){this.startVector=this.vector=e[0].sub(e[1]),this.minDiameter=e[0].dist(e[1])}move(e,r){const n=this.vector;if(this.vector=e[0].sub(e[1]),!(!this.active&&this.isBelowThreshold(this.vector)))return this.active=!0,{bearingDelta:B3(this.vector,n),pinchAround:r}}isBelowThreshold(e){this.minDiameter=Math.min(this.minDiameter,e.mag());const r=Math.PI*this.minDiameter,n=BR/r*360,a=B3(e,this.startVector);return Math.abs(a)t.zoom||t.drag||t.pitch||t.rotate;function V2(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}class zR{constructor(e,r){(0,K.Z)(this,"map",void 0),(0,K.Z)(this,"el",void 0),(0,K.Z)(this,"handlers",void 0),(0,K.Z)(this,"eventsInProgress",void 0),(0,K.Z)(this,"frameId",void 0),(0,K.Z)(this,"inertia",void 0),(0,K.Z)(this,"bearingSnap",void 0),(0,K.Z)(this,"handlersById",void 0),(0,K.Z)(this,"updatingCamera",void 0),(0,K.Z)(this,"changes",void 0),(0,K.Z)(this,"previousActiveHandlers",void 0),(0,K.Z)(this,"bearingChanged",void 0),(0,K.Z)(this,"rotateEnabled",void 0),(0,K.Z)(this,"pitchEnabled",void 0),(0,K.Z)(this,"listeners",void 0),(0,K.Z)(this,"handleWindowEvent",a=>{this.handleEvent(a,`${a.type}Window`)}),(0,K.Z)(this,"handleEvent",(a,u)=>{if(a.type==="blur"){this.stop();return}this.updatingCamera=!0;const y=a.type==="renderFrame"?void 0:a,A={needsRenderFrame:!1},O={},Z={},Y=a.touches?this.getMapTouches(a.touches):void 0,Q=Y?od.touchPos(this.el,Y):od.mousePos(this.el,a);for(const{handlerName:Be,handler:it,allowed:gt}of this.handlers){if(!it.isEnabled())continue;let Bt;if(this.blockedByActive(Z,gt,Be))it.reset();else{const Rt=u||a.type;it&&it[Rt]&&(Bt=it[Rt](a,Q,Y),this.mergeIHandlerResult(A,O,Bt,Be,y),Bt&&Bt.needsRenderFrame&&this.triggerRenderFrame())}(Bt||it.isActive())&&(Z[Be]=it)}const ae={};for(const Be in this.previousActiveHandlers)Z[Be]||(ae[Be]=y);this.previousActiveHandlers=Z,(Object.keys(ae).length||V2(A))&&(this.changes.push([A,O,ae]),this.triggerRenderFrame()),(Object.keys(Z).length||V2(A))&&this.map.stop(!0),this.updatingCamera=!1;const{cameraAnimation:xe}=A;xe&&(this.inertia.clear(),this.fireEvents({},{}),this.changes=[],xe(this.map))}),this.map=e,this.el=this.map.getCanvasContainer(),this.handlers=[],this.handlersById={},this.changes=[],this.inertia=new sR(e),this.bearingSnap=r.bearingSnap,this.rotateEnabled=r.rotateEnabled,this.pitchEnabled=r.pitchEnabled,this.previousActiveHandlers={},this.eventsInProgress={},this.addDefaultHandlers(r);const n=this.el;this.listeners=[],this.listeners=[[n,"touchstart",{passive:!1}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[window.document,"mousemove",{capture:!0}],[window.document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[window,"blur",void 0]];for(const[a,u,y]of this.listeners)od.addEventListener(a,u,a===window.document?this.handleWindowEvent:this.handleEvent,y)}destroy(){for(const[e,r,n]of this.listeners)od.removeEventListener(e,r,e===window.document?this.handleWindowEvent:this.handleEvent,n)}stop(){if(!this.updatingCamera){for(const{handler:e}of this.handlers)e.reset();this.inertia.clear(),this.fireEvents({},{}),this.changes=[]}}isActive(){for(const{handler:e}of this.handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this.eventsInProgress.zoom||this.map.scrollZoom.isZooming()}isRotating(){return!!this.eventsInProgress.rotate}isMoving(){return!!R1(this.eventsInProgress)||this.isZooming()}mergeIHandlerResult(e,r,n,a,u){if(!n)return;Z2(e,n);const y={handlerName:a,originalEvent:n.originalEvent||u};n.zoomDelta!==void 0&&(r.zoom=y),n.panDelta!==void 0&&(r.drag=y),n.pitchDelta!==void 0&&(r.pitch=y),n.bearingDelta!==void 0&&(r.rotate=y)}triggerRenderFrame(){this.frameId===void 0&&(this.frameId=this.map.requestRenderFrame(e=>{delete this.frameId,this.handleEvent(new rR("renderFrame",e)),this.applyChanges()}))}addDefaultHandlers(e){const r=this.map,n=r.getCanvasContainer();this.add("mapEvent",new pR(r,e));const a=r.boxZoom=new eR(r,e);this.add("boxZoom",a);const u=new IR,y=new tR;r.doubleClickZoom=new wR(y,u),this.add("tapZoom",u),this.add("clickZoom",y);const A=new RR;this.add("tapDragZoom",A);const O=r.touchPitch=new OR;this.add("touchPitch",O);const Z=new gR(e),Y=new vR(e);r.dragRotate=new TR(e,Z,Y),this.add("mouseRotate",Z,["mousePitch"]),this.add("mousePitch",Y,["mouseRotate"]);const Q=new mR(e),ae=new LR(e);r.dragPan=new SR(n,Q,ae),this.add("mousePan",Q),this.add("touchPan",ae,["touchZoom","touchRotate"]);const xe=new FR,Be=new NR;r.touchZoomRotate=new AR(n,Be,xe,A),this.add("touchRotate",xe,["touchPan","touchZoom"]),this.add("touchZoom",Be,["touchPan","touchRotate"]);const it=r.scrollZoom=new ER(r,this);this.add("scrollZoom",it,["mousePan"]);const gt=r.keyboard=new hR;this.add("keyboard",gt),this.add("blockableMapEvent",new JP(r));for(const Bt of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])e.interactive&&e[Bt]&&r[Bt].enable(e[Bt])}add(e,r,n){this.handlers.push({handlerName:e,handler:r,allowed:n}),this.handlersById[e]=r}blockedByActive(e,r,n){for(const a in e)if(a!==n&&(!r||r.indexOf(a)<0))return!0;return!1}getMapTouches(e){const r=[];for(const n of e){const a=n.target;this.el.contains(a)&&r.push(n)}return r}applyChanges(){const e={},r={},n={};for(const[a,u,y]of this.changes)a.panDelta&&(e.panDelta=(e.panDelta||new Pl(0,0))._add(a.panDelta)),a.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+a.zoomDelta),a.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+a.bearingDelta),a.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+a.pitchDelta),a.around!==void 0&&(e.around=a.around),a.pinchAround!==void 0&&(e.pinchAround=a.pinchAround),a.noInertia&&(e.noInertia=a.noInertia),Z2(r,u),Z2(n,y);this.updateMapTransform(e,r,n),this.changes=[]}updateMapTransform(e,r,n){const a=this.map,u=a.transform;if(!V2(e))return this.fireEvents(r,n);const{panDelta:y,zoomDelta:A,bearingDelta:O,pitchDelta:Z,pinchAround:Y}=e;let{around:Q}=e;Y!==void 0&&(Q=Y),a.stop(!0),Q=Q||a.transform.centerPoint;const ae=u.pointLocation(y?Q.sub(y):Q);O&&this.rotateEnabled&&(u.bearing+=O),Z&&this.pitchEnabled&&(u.pitch+=Z),A&&(u.zoom+=A),u.setLocationAtPoint(ae,Q),this.map.update(),e.noInertia||this.inertia.record(e),this.fireEvents(r,n)}fireEvents(e,r){const n=R1(this.eventsInProgress),a=R1(e),u={};for(const Z in e)if(e[Z]){const{originalEvent:Y}=e[Z];this.eventsInProgress[Z]||(u[`${Z}start`]=Y),this.eventsInProgress[Z]=e[Z]}!n&&a&&this.fireEvent("movestart",a.originalEvent);for(const Z in u)u[Z]&&this.fireEvent(Z,u[Z]);e.rotate&&(this.bearingChanged=!0),a&&this.fireEvent("move",a.originalEvent);for(const Z in e)if(e[Z]){const{originalEvent:Y}=e[Z];this.fireEvent(Z,Y)}const y={};let A;for(const Z in this.eventsInProgress)if(this.eventsInProgress[Z]){const{handlerName:Y,originalEvent:Q}=this.eventsInProgress[Z];this.handlersById[Y].isActive()||(delete this.eventsInProgress[Z],A=r[Y]||Q,y[`${Z}end`]=A)}for(const Z in y)y[Z]&&this.fireEvent(Z,y[Z]);const O=R1(this.eventsInProgress);if((n||a)&&!O){this.updatingCamera=!0;const Z=this.inertia.onMoveEnd(this.map.dragPan.inertiaOptions),Y=Q=>Q!==0&&-this.bearingSnapA+O,0)/r/1e3),u=v_.filter(A=>A>j2).reduce((A,O)=>A+(O-j2)/j2,0),y=u/(r+u)*100;return{loadTime:t,fullLoadTime:e,fps:a,percentDroppedFrames:y}}};class UR{constructor(){(0,K.Z)(this,"queue",void 0),(0,K.Z)(this,"id",void 0),(0,K.Z)(this,"cleared",void 0),(0,K.Z)(this,"currentlyRunning",void 0),this.queue=[],this.id=0,this.cleared=!1,this.currentlyRunning=!1}add(e){const r=++this.id;return this.queue.push({callback:e,id:r,cancelled:!1}),r}remove(e){const r=this.currentlyRunning,n=r?this.queue.concat(r):this.queue;for(const a of n)if(a.id===e){a.cancelled=!0;return}}run(e=0){const r=this.currentlyRunning=this.queue;this.queue=[];for(const n of r)if(!n.cancelled&&(n.callback(e),this.cleared))break;this.cleared=!1,this.currentlyRunning=!1}clear(){this.currentlyRunning&&(this.cleared=!0),this.queue=[]}}var N3=UR;function ZR(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}ZR(`.l7-map { font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif; overflow: hidden; position: relative; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .l7-canvas { position: absolute; left: 0; top: 0; } .l7-map:-webkit-full-screen { width: 100%; height: 100%; } .l7-canary { background-color: salmon; } .l7-canvas-container.l7-interactive, .l7-ctrl-group button.l7-ctrl-compass { cursor: grab; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .l7-canvas-container.l7-interactive.l7-track-pointer { cursor: pointer; } .l7-canvas-container.l7-interactive:active, .l7-ctrl-group button.l7-ctrl-compass:active { cursor: grabbing; } .l7-canvas-container.l7-touch-zoom-rotate, .l7-canvas-container.l7-touch-zoom-rotate .l7-canvas { touch-action: pan-x pan-y; } .l7-canvas-container.l7-touch-drag-pan, .l7-canvas-container.l7-touch-drag-pan .l7-canvas { touch-action: pinch-zoom; } .l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan, .l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan .l7-canvas { touch-action: none; } .l7-ctrl-top-left, .l7-ctrl-top-right, .l7-ctrl-bottom-left, .l7-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; } .l7-ctrl-top-left { top: 0; left: 0; } .l7-ctrl-top-right { top: 0; right: 0; } .l7-ctrl-bottom-left { bottom: 0; left: 0; } .l7-ctrl-bottom-right { right: 0; bottom: 0; } .l7-ctrl { clear: both; pointer-events: auto; /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */ -webkit-transform: translate(0, 0); transform: translate(0, 0); } .l7-ctrl-top-left .l7-ctrl { margin: 10px 0 0 10px; float: left; } .l7-ctrl-top-right .l7-ctrl { margin: 10px 10px 0 0; float: right; } .l7-ctrl-bottom-left .l7-ctrl { margin: 0 0 10px 10px; float: left; } .l7-ctrl-bottom-right .l7-ctrl { margin: 0 10px 10px 0; float: right; } .l7-crosshair, .l7-crosshair .l7-interactive, .l7-crosshair .l7-interactive:active { cursor: crosshair; } .l7-boxzoom { position: absolute; top: 0; left: 0; width: 0; height: 0; background: #fff; border: 2px dotted #202020; opacity: 0.5; z-index: 10; } `);const D1=-2,z3=22,{merge:VR}=es,Z0=0,O1=60,jR={hash:!1,zoom:-1,center:[112,32],pitch:0,bearing:0,interactive:!0,minZoom:D1,maxZoom:z3,minPitch:Z0,maxPitch:O1,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,trackResize:!0,renderWorldCopies:!0,pitchEnabled:!0,rotateEnabled:!0};class HR extends P3{constructor(e){super(VR({},jR,e)),(0,K.Z)(this,"doubleClickZoom",void 0),(0,K.Z)(this,"dragRotate",void 0),(0,K.Z)(this,"dragPan",void 0),(0,K.Z)(this,"touchZoomRotate",void 0),(0,K.Z)(this,"scrollZoom",void 0),(0,K.Z)(this,"keyboard",void 0),(0,K.Z)(this,"touchPitch",void 0),(0,K.Z)(this,"boxZoom",void 0),(0,K.Z)(this,"handlers",void 0),(0,K.Z)(this,"container",void 0),(0,K.Z)(this,"canvas",void 0),(0,K.Z)(this,"canvasContainer",void 0),(0,K.Z)(this,"renderTaskQueue",new N3),(0,K.Z)(this,"frame",void 0),(0,K.Z)(this,"trackResize",!0),(0,K.Z)(this,"onWindowOnline",()=>{this.update()}),(0,K.Z)(this,"onWindowResize",r=>{this.trackResize&&this.resize({originalEvent:r}).update()}),this.initContainer(),this.resize(),this.handlers=new k3(this,this.options),typeof window!="undefined"&&(window.addEventListener("online",this.onWindowOnline,!1),window.addEventListener("resize",this.onWindowResize,!1),window.addEventListener("orientationchange",this.onWindowResize,!1))}resize(e){const r=this.containerDimensions(),n=r[0],a=r[1];this.transform.resize(n,a);const u=!this.moving;return u&&(this.stop(),this.emit("movestart",new Event("movestart",e)),this.emit("move",new Event("move",e))),this.emit("resize",new Event("resize",e)),u&&this.emit("moveend",new Event("moveend",e)),this}getContainer(){return this.container}getCanvas(){return this.canvas}getCanvasContainer(){return this.canvasContainer}project(e){return this.transform.locationPoint(qu.convert(e))}unproject(e){return this.transform.pointLocation(Pl.convert(e))}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(e){this.transform.setMaxBounds(tg.convert(e))}setStyle(e){}setMinZoom(e){if(e=e==null?D1:e,e>=D1&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=e,this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if(e=e==null?Z0:e,e=Z0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this.getPitch()O1)throw new Error(`maxPitch must be less than or equal to ${O1}`);if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){this.transform.renderWorldCopies=!!e}remove(){this.frame&&(this.frame.cancel(),this.frame=null),this.renderTaskQueue.clear(),this.handlers.destroy(),typeof window!="undefined"&&(window.removeEventListener("online",this.onWindowOnline,!1),window.removeEventListener("resize",this.onWindowResize,!1),window.removeEventListener("orientationchange",this.onWindowResize,!1))}requestRenderFrame(e){return this.update(),this.renderTaskQueue.add(e)}cancelRenderFrame(e){return this.renderTaskQueue.remove(e)}triggerRepaint(){this.frame||(this.frame=x1(e=>{L1.frame(e),this.frame=null,this.update(e)}))}update(e){this.frame||(this.frame=x1(r=>{L1.frame(r),this.frame=null,this.renderTaskQueue.run(e)}))}initContainer(){if(typeof this.options.container=="string"){if(this.container=window.document.getElementById(this.options.container),!this.container)throw new Error(`Container '${this.options.container}' not found.`)}else if(this.options.container instanceof HTMLElement)this.container=this.options.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");const e=this.container;e.classList.add("l7-map");const r=this.canvasContainer=Xo("div","l7-canvas-container",e);this.options.interactive&&r.classList.add("l7-interactive")}containerDimensions(){let e=0,r=0;return this.container&&(e=this.container.clientWidth||400,r=this.container.clientHeight||300),[e,r]}resizeCanvas(e,r){const n=Ll||1;this.canvas.width=n*e,this.canvas.height=n*r,this.canvas.style.width=`${e}px`,this.canvas.style.height=`${r}px`}}const{throttle:GR}=es;class WR{constructor(e){(0,K.Z)(this,"map",void 0),(0,K.Z)(this,"updateHash",void 0),(0,K.Z)(this,"hashName",void 0),(0,K.Z)(this,"onHashChange",()=>{const r=this.getCurrentHash();if(r.length>=3&&!r.some(n=>isNaN(+n))){const n=this.map.dragRotate.isEnabled()&&this.map.touchZoomRotate.isEnabled()?+(r[3]||0):this.map.getBearing();return this.map.jumpTo({center:[+r[2],+r[1]],zoom:+r[0],bearing:n,pitch:+(r[4]||0)}),!0}return!1}),(0,K.Z)(this,"getCurrentHash",()=>{const r=window.location.hash.replace("#","");if(this.hashName){let n;return r.split("&").map(a=>a.split("=")).forEach(a=>{a[0]===this.hashName&&(n=a)}),(n&&n[1]||"").split("/")}return r.split("/")}),(0,K.Z)(this,"updateHashUnthrottled",()=>{const r=this.getHashString();try{window.history.replaceState(window.history.state,"",r)}catch(n){}}),this.hashName=e&&encodeURIComponent(e),this.updateHash=GR(this.updateHashUnthrottled,30*1e3/100)}addTo(e){return this.map=e,window.addEventListener("hashchange",this.onHashChange,!1),this.map.on("moveend",this.updateHash),this}remove(){return window.removeEventListener("hashchange",this.onHashChange,!1),this.map.off("moveend",this.updateHash),delete this.map,this}getHashString(e){const r=this.map.getCenter(),n=Math.round(this.map.getZoom()*100)/100,a=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),u=Math.pow(10,a),y=Math.round(r.lng*u)/u,A=Math.round(r.lat*u)/u,O=this.map.getBearing(),Z=this.map.getPitch();let Y="";if(e?Y+=`/${y}/${A}/${n}`:Y+=`${n}/${A}/${y}`,(O||Z)&&(Y+=`/${Math.round(O*10)/10}`),Z&&(Y+=`/${Math.round(Z)}`),this.hashName){const Q=this.hashName;let ae=!1;const xe=window.location.hash.slice(1).split("&").map(Be=>{const it=Be.split("=")[0];return it===Q?(ae=!0,`${it}=${Y}`):Be}).filter(Be=>Be);return ae||xe.push(`${Q}=${Y}`),`#${xe.join("&")}`}return`#${Y}`}}var XR=WR;function qR(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}qR(`.l7-map { font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif; overflow: hidden; position: relative; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .l7-canvas { position: absolute; left: 0; top: 0; } .l7-map:-webkit-full-screen { width: 100%; height: 100%; } .l7-canary { background-color: salmon; } .l7-canvas-container.l7-interactive, .l7-ctrl-group button.l7-ctrl-compass { cursor: grab; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .l7-canvas-container.l7-interactive.l7-track-pointer { cursor: pointer; } .l7-canvas-container.l7-interactive:active, .l7-ctrl-group button.l7-ctrl-compass:active { cursor: grabbing; } .l7-canvas-container.l7-touch-zoom-rotate, .l7-canvas-container.l7-touch-zoom-rotate .l7-canvas { touch-action: pan-x pan-y; } .l7-canvas-container.l7-touch-drag-pan, .l7-canvas-container.l7-touch-drag-pan .l7-canvas { touch-action: pinch-zoom; } .l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan, .l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan .l7-canvas { touch-action: none; } .l7-ctrl-top-left, .l7-ctrl-top-right, .l7-ctrl-bottom-left, .l7-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; } .l7-ctrl-top-left { top: 0; left: 0; } .l7-ctrl-top-right { top: 0; right: 0; } .l7-ctrl-bottom-left { bottom: 0; left: 0; } .l7-ctrl-bottom-right { right: 0; bottom: 0; } .l7-ctrl { clear: both; pointer-events: auto; /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */ -webkit-transform: translate(0, 0); transform: translate(0, 0); } .l7-ctrl-top-left .l7-ctrl { margin: 10px 0 0 10px; float: left; } .l7-ctrl-top-right .l7-ctrl { margin: 10px 10px 0 0; float: right; } .l7-ctrl-bottom-left .l7-ctrl { margin: 0 0 10px 10px; float: left; } .l7-ctrl-bottom-right .l7-ctrl { margin: 0 10px 10px 0; float: right; } .l7-crosshair, .l7-crosshair .l7-interactive, .l7-crosshair .l7-interactive:active { cursor: crosshair; } .l7-boxzoom { position: absolute; top: 0; left: 0; width: 0; height: 0; background: #fff; border: 2px dotted #202020; opacity: 0.5; z-index: 10; } `),function(){if(typeof window.CustomEvent=="function")return!1;function t(e,r){r=r||{bubbles:!1,cancelable:!1,detail:void 0};const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,r.bubbles,r.cancelable,r.detail),n}t.prototype=window.Event.prototype,window.CustomEvent=t}();const B1=-2,U3=22,{merge:Z3}=es,V0=0,F1=60,YR={hash:!1,zoom:-1,center:[112,32],pitch:0,bearing:0,interactive:!0,minZoom:B1,maxZoom:U3,minPitch:V0,maxPitch:F1,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,trackResize:!0,renderWorldCopies:!0,pitchEnabled:!0,rotateEnabled:!0};class $R extends P3{constructor(e){super(Z3({},YR,e)),(0,K.Z)(this,"doubleClickZoom",void 0),(0,K.Z)(this,"dragRotate",void 0),(0,K.Z)(this,"dragPan",void 0),(0,K.Z)(this,"touchZoomRotate",void 0),(0,K.Z)(this,"scrollZoom",void 0),(0,K.Z)(this,"keyboard",void 0),(0,K.Z)(this,"touchPitch",void 0),(0,K.Z)(this,"boxZoom",void 0),(0,K.Z)(this,"handlers",void 0),(0,K.Z)(this,"container",void 0),(0,K.Z)(this,"canvas",void 0),(0,K.Z)(this,"canvasContainer",void 0),(0,K.Z)(this,"renderTaskQueue",new N3),(0,K.Z)(this,"frame",void 0),(0,K.Z)(this,"trackResize",!0),(0,K.Z)(this,"hash",void 0),(0,K.Z)(this,"onWindowOnline",()=>{this.update()}),(0,K.Z)(this,"onWindowResize",n=>{this.trackResize&&this.resize({originalEvent:n}).update()}),this.initContainer(),this.resize(),this.handlers=new k3(this,this.options),typeof window!="undefined"&&(window.addEventListener("online",this.onWindowOnline,!1),window.addEventListener("resize",this.onWindowResize,!1),window.addEventListener("orientationchange",this.onWindowResize,!1));const r=typeof e.hash=="string"&&e.hash||void 0;e.hash&&(this.hash=new XR(r).addTo(this)),(!this.hash||!this.hash.onHashChange())&&(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,Z3({},e.fitBoundsOptions,{duration:0}))))}resize(e){const[r,n]=this.containerDimensions();this.transform.resize(r,n);const a=!this.moving;return a&&(this.stop(),this.emit("movestart",new window.CustomEvent("movestart",e)),this.emit("move",new window.CustomEvent("move",e))),this.emit("resize",new window.CustomEvent("resize",e)),a&&this.emit("moveend",new window.CustomEvent("moveend",e)),this}getContainer(){return this.container}getCanvas(){return this.canvas}getCanvasContainer(){return this.canvasContainer}getCanvasOverlays(){return this.getCanvasContainer()}project(e){return this.transform.locationPoint(qu.convert(e))}unproject(e){return this.transform.pointLocation(Pl.convert(e))}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(e){this.transform.setMaxBounds(tg.convert(e))}setStyle(e){}setMinZoom(e){if(e=e==null?B1:e,e>=B1&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=e,this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if(e=e==null?V0:e,e=V0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this.getPitch()F1)throw new Error(`maxPitch must be less than or equal to ${F1}`);if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){this.transform.renderWorldCopies=!!e}remove(){this.container.removeChild(this.canvasContainer),this.canvasContainer=null,this.frame&&(this.frame.cancel(),this.frame=null),this.renderTaskQueue.clear(),this.handlers.destroy(),typeof window!="undefined"&&(window.removeEventListener("online",this.onWindowOnline,!1),window.removeEventListener("resize",this.onWindowResize,!1),window.removeEventListener("orientationchange",this.onWindowResize,!1))}requestRenderFrame(e){return this.update(),this.renderTaskQueue.add(e)}cancelRenderFrame(e){return this.renderTaskQueue.remove(e)}triggerRepaint(){this.frame||(this.frame=x1(e=>{L1.frame(e),this.frame=null,this.update(e)}))}update(e){this.frame||(this.frame=x1(r=>{L1.frame(r),this.frame=null,this.renderTaskQueue.run(e)}))}initContainer(){if(typeof this.options.container=="string"){if(this.container=window.document.getElementById(this.options.container),!this.container)throw new Error(`Container '${this.options.container}' not found.`)}else if(this.options.container instanceof HTMLElement)this.container=this.options.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");const e=this.container;e.classList.add("l7-map");const r=this.canvasContainer=Xo("div","l7-canvas-container",e);this.options.interactive&&r.classList.add("l7-interactive")}containerDimensions(){let e=0,r=0;return this.container&&(e=this.container.clientWidth,r=this.container.clientHeight,e=e===0?400:e,r=r===0?300:r),[e,r]}}class KR{constructor(){(0,K.Z)(this,"xzReg",-Math.PI*.6),(0,K.Z)(this,"yReg",Math.PI*.2),(0,K.Z)(this,"earthCameraRadius",200),(0,K.Z)(this,"earthCameraZoom",1),(0,K.Z)(this,"cameraPosition",ra.create()),(0,K.Z)(this,"viewport",void 0),(0,K.Z)(this,"projectionMatrix",Kr.create()),(0,K.Z)(this,"modelMatrix",Kr.create()),(0,K.Z)(this,"viewMatrix",Kr.create()),(0,K.Z)(this,"viewProjectionMatrix",Kr.create()),(0,K.Z)(this,"ViewProjectionMatrixUncentered",Kr.create()),(0,K.Z)(this,"viewUncenteredMatrix",Kr.create())}syncWithMapCamera(e){const{viewportHeight:r=1,viewportWidth:n=1}=e,a=n/r,u=.1,y=1e4,A=20;Kr.perspective(this.projectionMatrix,A,a,u,y);const O=this.earthCameraRadius*Math.cos(this.xzReg),Z=this.earthCameraRadius*Math.sin(this.xzReg),Y=this.earthCameraRadius*Math.sin(this.yReg);this.cameraPosition=ra.fromValues(O,Y,Z),ra.normalize(this.cameraPosition,this.cameraPosition),ra.multiply(this.cameraPosition,this.cameraPosition,ra.fromValues(this.earthCameraRadius,this.earthCameraRadius,this.earthCameraRadius)),ra.scale(this.cameraPosition,this.cameraPosition,this.earthCameraZoom);const Q=ra.create();ra.cross(Q,this.cameraPosition,ra.fromValues(0,1,0));const ae=ra.fromValues(0,1,0);ra.cross(ae,Q,this.cameraPosition);const xe=ra.fromValues(0,0,0);Kr.lookAt(this.viewMatrix,this.cameraPosition,xe,ae),this.viewUncenteredMatrix=Kr.clone(this.viewMatrix),Kr.multiply(this.viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),Kr.multiply(this.ViewProjectionMatrixUncentered,this.projectionMatrix,this.viewMatrix)}rotateY(e){this.xzReg+=e*Math.min(this.earthCameraZoom*this.earthCameraZoom,1)}rotateX(e){this.yReg+=e*Math.min(this.earthCameraZoom*this.earthCameraZoom,1)}scaleZoom(e){this.earthCameraZoom+=e,this.earthCameraZoom=Math.max(this.earthCameraZoom,.6)}getZoom(){return 4}getZoomScale(){return Math.pow(2,this.getZoom())}getCenter(){return[0,0]}getProjectionMatrix(){return this.projectionMatrix}getModelMatrix(){return this.modelMatrix}getViewMatrix(){return this.viewMatrix}getViewMatrixUncentered(){return this.viewMatrix}getViewProjectionMatrix(){return this.viewProjectionMatrix}getViewProjectionMatrixUncentered(){return this.viewProjectionMatrix}getFocalDistance(){return 1}projectFlat(e,r){return this.viewport.projectFlat(e,r)}}const JR=["id","style","rotation"],V3={mapmove:"move",camerachange:"move",zoomchange:"zoom",dragging:"drag"},QR=12;class eI extends _g{constructor(...e){super(...e),(0,K.Z)(this,"version","GLOBEL"),(0,K.Z)(this,"dragging",!1),(0,K.Z)(this,"viewport",void 0),(0,K.Z)(this,"handleCameraChanging",void 0),(0,K.Z)(this,"handleCameraTimer",void 0),(0,K.Z)(this,"handleCameraChanged",r=>{this.emit("mapchange");const n=2e3;this.handleCameraChanging=!0,this.handleCameraTimer&&clearTimeout(this.handleCameraTimer),this.handleCameraTimer=setTimeout(()=>{this.handleCameraChanging=!1},n);const a=.02;r.type&&r.originalEvent&&(r.originalEvent.type==="wheel"&&this.viewport.scaleZoom(.01*Math.sign(r.originalEvent.wheelDelta)*-1),Math.abs(r.originalEvent.movementX)>Math.abs(r.originalEvent.movementY)?r.originalEvent.movementX>0?this.viewport.rotateY(a):r.originalEvent.movementX<0&&this.viewport.rotateY(-a):r.originalEvent.movementY>0?this.viewport.rotateX(a):r.originalEvent.movementY<0&&this.viewport.rotateX(-a));const{offsetCoordinate:u=!0}=this.config;this.viewport.syncWithMapCamera({viewportHeight:this.map.transform.height,viewportWidth:this.map.transform.width}),this.viewport.getZoom()>QR&&u?this.coordinateSystemService.setCoordinateSystem(Xt.LNGLAT_OFFSET):this.coordinateSystemService.setCoordinateSystem(Xt.LNGLAT),this.cameraChangedCallback(this.viewport)})}lngLatToMercator(e,r){throw new Error("Method not implemented.")}getModelMatrix(e,r,n,a,u){throw new Error("Method not implemented.")}on(e,r){po.indexOf(e)!==-1?this.eventEmitter.on(e,r):this.map.on(V3[e]||e,r)}off(e,r){this.map.off(V3[e]||e,r),this.eventEmitter.off(e,r)}getMapCanvasContainer(){return this.map.getCanvasContainer()}getSize(){const e=this.map.transform;return[e.width,e.height]}getType(){return"earth"}init(){var e=this;return(0,Nr.Z)(function*(){const r=e.config,{id:n="map",style:a="light",rotation:u=0}=r,y=(0,Ge.Z)(r,JR);e.viewport=new KR,e.$mapContainer=e.creatMapContainer(n),e.map=new HR((0,Wt.Z)({container:e.$mapContainer,style:e.getMapStyleValue(a),bearing:u},y)),e.map.on("load",e.handleCameraChanged),e.map.on("move",e.handleCameraChanged),e.handleCameraChanged({})})()}destroy(){var e;(e=this.$mapContainer)===null||e===void 0||(e=e.parentNode)===null||e===void 0||e.removeChild(this.$mapContainer),this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}emit(e,...r){this.eventEmitter.emit(e,...r)}once(e,...r){this.eventEmitter.once(e,...r)}getMapContainer(){return this.$mapContainer}getCanvasOverlays(){}onCameraChanged(e){this.cameraChangedCallback=e}rotateY(e){const{force:r=!1,reg:n=.01}=e||{};this.handleCameraChanging&&!r||this.viewport&&(this.viewport.rotateY(n),this.viewport.syncWithMapCamera({viewportHeight:this.map.transform.height,viewportWidth:this.map.transform.width}),this.cameraChangedCallback(this.viewport))}}class tI extends Nm{getServiceConstructor(){return eI}}if(!window)throw Error("Google Map JSAPI can only be used in Browser.");var jm=function(t){return t.notload="notload",t.loading="loading",t.loaded="loaded",t.failed="failed",t}(jm||{});const H2={key:""};let Eg={GMap:jm.notload};const G2=[],j3=t=>{if(typeof t=="function"){if(Eg.GMap===jm.loaded){t(window.google.maps.Map);return}G2.push(t)}};var rI={load:t=>new Promise((e,r)=>{if(Eg.GMap===jm.failed)r("");else if(Eg.GMap===jm.notload){const{key:n}=t;if(!n){r("\u8BF7\u586B\u5199key");return}H2.key=n,Eg.GMap=jm.loading,window.initMap=y=>{if(delete window.initMap,y)Eg.GMap=jm.failed,r(y);else for(Eg.GMap=jm.loaded;G2.length;)G2.splice(0,1)[0](window.google.maps.Map)};const a=document.createElement("script");a.type="text/javascript",a.async=!1,a.src=`https://maps.googleapis.com/maps/api/js?key=${H2.key}&callback=initMap`,a.onerror=y=>{Eg.GMap=jm.failed,r(y)},(document.body||document.head).appendChild(a),j3(e)}else if(Eg.GMap===jm.loaded){if(t.key&&t.key!==H2.key){r("\u591A\u4E2A\u4E0D\u4E00\u81F4\u7684 key");return}j3(e)}}),reset:()=>{delete window.google,Eg={GMap:jm.notload}}};const nI=["id","mapInstance","center","token","minZoom","maxZoom","logoVisible"];function iI(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}iI(`img[src*='//mapapi.qq.com/web/jsapi/logo/logo_def.png'],.logo-text { display: none !important; } `);const oI="AIzaSyDBDCfl4pvuDtaazdCog3LmhA7CQLhmcRE",j0={mapmove:"center_changed",camerachange:["drag","pan","rotate","tilt","zoom_changed"],zoomchange:"zoom_changed",dragging:"drag"};class aI extends _g{constructor(...e){super(...e),(0,K.Z)(this,"viewport",null),(0,K.Z)(this,"evtCbProxyMap",new Map),(0,K.Z)(this,"handleCameraChanged",()=>{this.emit("mapchange");const r=this.map,{lng:n,lat:a}=r.getCenter(),u={center:[n(),a()],viewportHeight:r.getDiv().clientHeight,viewportWidth:r.getDiv().clientWidth,bearing:r.getHeading(),pitch:r.getTilt(),zoom:r.getZoom()-1};this.viewport.syncWithMapCamera(u),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport)})}init(){var e=this;return(0,Nr.Z)(function*(){var r;e.viewport=new Fg;const n=e.config,{id:a,mapInstance:u,center:y=[121.30654632240122,31.25744185633306],token:A=oI,minZoom:O=3,maxZoom:Z=18,logoVisible:Y=!0}=n,Q=(0,Ge.Z)(n,nI);if((r=window.google)!==null&&r!==void 0&&(r=r.maps)!==null&&r!==void 0&&r.Map||u||(yield rI.load({key:A})),u)e.map=u,e.$mapContainer=e.map.getDiv(),Y===!1&&e.hideLogo();else{if(!a)throw Error("No container id specified");const ae=wc(a),xe=new google.maps.Map(ae,(0,Wt.Z)({maxZoom:Z,minZoom:O,zoomControl:!1,fullscreenControl:!1,center:new google.maps.LatLng(y[1],y[0])},Q));e.map=xe,e.$mapContainer=xe.getDiv(),Y===!1&&e.hideLogo()}google.maps.event.addListener(e.map,"drag",e.handleCameraChanged),google.maps.event.addListener(e.map,"pan",e.handleCameraChanged),google.maps.event.addListener(e.map,"rotate",e.handleCameraChanged),google.maps.event.addListener(e.map,"idle",e.handleCameraChanged),google.maps.event.addListener(e.map,"zoom_changed",e.handleCameraChanged),e.handleCameraChanged()})()}destroy(){this.map.setMap(null)}onCameraChanged(e){this.cameraChangedCallback=e}addMarkerContainer(){}getMarkerContainer(){return this.markerContainer}getCanvasOverlays(){return this.map.getDiv()}on(e,r){if(po.indexOf(e)!==-1)this.eventEmitter.on(e,r);else{const n=a=>{let u=this.evtCbProxyMap.get(a);if(u||this.evtCbProxyMap.set(a,u=new Map),u.get(r))return;const y=(...A)=>{A[0]&&typeof A[0]=="object"&&!A[0].lngLat&&!A[0].lnglat&&(A[0].lngLat=A[0].latlng||A[0].latLng),r(...A)};u.set(r,y),this.map.on(a,y)};Array.isArray(j0[e])?j0[e].forEach(a=>{n(a||e)}):n(j0[e]||e)}}off(e,r){if(po.indexOf(e)!==-1){this.eventEmitter.off(e,r);return}const n=a=>{var u,y;const A=(u=this.evtCbProxyMap.get(e))===null||u===void 0?void 0:u.get(r);A&&((y=this.evtCbProxyMap.get(a))===null||y===void 0||y.delete(r),this.map.off(a,A))};Array.isArray(j0[e])?j0[e].forEach(a=>{n(a||e)}):n(j0[e]||e)}once(){throw new Error("Method not implemented.")}getContainer(){return this.map.getDiv()}getSize(){return[this.map.width,this.map.height]}getMinZoom(){return this.map.transform._minZoom}getMaxZoom(){return this.map.transform._maxZoom}getType(){return"googlemap"}getZoom(){return this.map.getZoom()}getCenter(){const{lng:e,lat:r}=this.map.getCenter();return{lng:e(),lat:r()}}getPitch(){return this.map.getTilt()}getRotation(){return this.map.getHeading()}getBounds(){const e=this.map.getBounds(),r=e==null?void 0:e.getNorthEast(),n=e==null?void 0:e.getSouthWest();return[[n.lng(),n.lat()],[r.lng(),r.lat()]]}getMapContainer(){return this.map.getDiv()}getMapCanvasContainer(){var e;return(e=this.map.getDiv())===null||e===void 0?void 0:e.getElementsByTagName("canvas")[0]}getMapStyleConfig(){throw new Error("Method not implemented.")}setBgColor(e){this.bgColor=e}setMapStyle(e){this.map.setMapStyleId(e)}setRotation(e){this.map.setHeading(e)}zoomIn(){const e=this.map.getZoom();this.map.setZoom(e+1)}zoomOut(){const e=this.map.getZoom();this.map.setZoom(e-1)}panTo([e,r]){this.map.panTo({lat:r,lng:e})}panBy(e,r){this.map.panBy(e,r)}fitBounds(e,r){const[n,a]=e,u=new google.maps.LatLngBounds({lat:n[1],lng:n[0]},{lat:a[1],lng:a[0]});this.map.fitBounds(u,r)}setZoomAndCenter(e,[r,n]){this.map.setZoom(e),this.map.setCenter({lat:n,lng:r})}setCenter([e,r]){this.map.setCenter({lat:r,lng:e})}setPitch(e){this.map.setTilt(e)}setZoom(e){this.map.setZoom(e)}setMapStatus(e){Object.keys(e).map(r=>{switch(r){case"doubleClickZoom":this.map.setOptions({gestureHandling:e.doubleClickZoom?"auto":"none"});break;case"dragEnable":this.map.setOptions({draggable:e.dragEnable});break;case"rotateEnable":break;case"zoomEnable":this.map.setOptions({zoomControl:e.zoomEnable});break;case"keyboardEnable":case"resizeEnable":case"showIndoorMap":throw Error("Options may not be supported");default:}})}meterToCoord([e,r],[n,a]){const u=google.maps.geometry.spherical.computeDistanceBetween([new google.maps.LatLng(r,e),new google.maps.LatLng(a,n)]),[y,A]=this.lngLatToCoord([e,r]),[O,Z]=this.lngLatToCoord([n,a]);return Math.sqrt(Math.pow(y-O,2)+Math.pow(A-Z,2))/u}pixelToLngLat([e,r]){const{lng:n,lat:a}=this.map.getCenter(),{x:u,y}=this.lngLatToPixel([n(),a()]),{x:A,y:O}=this.lngLatToContainer([n(),a()]),{lng:Z,lat:Y}=this.map.unprojectFromContainer(new google.maps.Point(A+(e-u),O+(r-y)));return this.containerToLngLat([Z,Y])}lngLatToPixel([e,r]){const n=new google.maps.LatLng(r,e),a=this.map.getProjection().fromLatLngToPoint(n);return{x:a.x,y:a.y}}containerToLngLat([e,r]){var n;const a=new google.maps.Point(e,r),u=(n=this.map.getProjection())===null||n===void 0?void 0:n.fromPointToLatLng(a);return{lng:u.lng(),lat:u.lat()}}lngLatToContainer([e,r]){var n,a;const u=new google.maps.LatLng(r,e),y=(n=this.map.getProjection())===null||n===void 0||(a=n.fromLatLngToContainerPixel)===null||a===void 0?void 0:a.call(n,u);return{x:y.x,y:y.y}}lngLatToCoord([e,r]){const{x:n,y:a}=this.lngLatToPixel([e,r]);return[n,-a]}lngLatToCoords(e){return e.map(r=>Array.isArray(r[0])?this.lngLatToCoords(r):this.lngLatToCoord(r))}lngLatToMercator(e,r){const{x:n=0,y:a=0,z:u=0}=Vm.fromLngLat(e,r);return{x:n,y:a,z:u}}getModelMatrix(e,r,n,a=[1,1,1]){const u=this.viewport.projectFlat(e),y=Kr.create();return Kr.translate(y,y,ra.fromValues(u[0],u[1],r)),Kr.scale(y,y,ra.fromValues(a[0],a[1],a[2])),Kr.rotateX(y,y,n[0]),Kr.rotateY(y,y,n[1]),Kr.rotateZ(y,y,n[2]),y}getCustomCoordCenter(){throw new Error("Method not implemented.")}exportMap(e){const r=this.getMapCanvasContainer();return e==="jpg"?r==null?void 0:r.toDataURL("image/jpeg"):r==null?void 0:r.toDataURL("image/png")}rotateY(){throw new Error("Method not implemented.")}hideLogo(){const e=this.map.getDiv();e&&dl(e,"tmap-contianer--hide-logo")}}class sI extends Nm{getServiceConstructor(){return aI}}const lI=["id","style","rotation","mapInstance","version","mapSize","interactive"];class uI extends _g{constructor(...e){super(...e),(0,K.Z)(this,"version",rp.DEFAULT),(0,K.Z)(this,"viewport",void 0)}lngLatToCoord(e,r={x:0,y:0,z:0}){const{x:n,y:a}=this.lngLatToMercator(e,0);return[n-r.x,a-r.y]}lngLatToMercator(e,r){const{x:n=0,y:a=0,z:u=0}=Vm.fromLngLat(e,r);return{x:n,y:a,z:u}}getModelMatrix(e,r,n,a=[1,1,1],u={x:0,y:0,z:0}){const y=Vm.fromLngLat(e,r),A=y.meterInMercatorCoordinateUnits(),O=Kr.create();return Kr.translate(O,O,ra.fromValues(y.x-u.x,y.y-u.y,y.z||0-u.z)),Kr.scale(O,O,ra.fromValues(A*a[0],-A*a[1],A*a[2])),Kr.rotateX(O,O,n[0]),Kr.rotateY(O,O,n[1]),Kr.rotateZ(O,O,n[2]),O}init(){var e=this;return(0,Nr.Z)(function*(){const r=e.config,{id:n="map",style:a="light",rotation:u=0,mapInstance:y,version:A="DEFAULTMAP",mapSize:O=1e4,interactive:Z=!0}=r,Y=(0,Ge.Z)(r,lI);e.viewport=new Fg,e.version=A,e.simpleMapCoord.setSize(O),A==="SIMPLE"&&Y.center&&(Y.center=e.simpleMapCoord.unproject(Y.center)),y?(e.map=y,e.$mapContainer=e.map.getContainer()):(e.$mapContainer=e.creatMapContainer(n),e.map=new $R((0,Wt.Z)({container:e.$mapContainer,style:e.getMapStyleValue(a),bearing:u},Y))),e.map.on("load",()=>{e.handleCameraChanged()}),Z&&e.map.on("move",e.handleCameraChanged),setTimeout(()=>{e.handleCameraChanged()},100),e.handleCameraChanged()})()}exportMap(e){const r=this.map.getCanvas();return e==="jpg"?r==null?void 0:r.toDataURL("image/jpeg"):r==null?void 0:r.toDataURL("image/png")}getCanvasOverlays(){return this.getContainer()}}class cI extends Nm{getServiceConstructor(){return uI}}var hI=Se(86463),__=Se.n(hI);class H3{constructor(){(0,K.Z)(this,"viewport",void 0)}syncWithMapCamera(e){const{center:r,zoom:n,pitch:a,bearing:u,viewportHeight:y,viewportWidth:A}=e;this.viewport=new w2({width:A,height:y,longitude:r&&r[0],latitude:r&&r[1],zoom:n,pitch:a,bearing:u})}getZoom(){return this.viewport.zoom}getZoomScale(){return Math.pow(2,this.getZoom())}getCenter(){return[this.viewport.longitude,this.viewport.latitude]}getProjectionMatrix(){return this.viewport.projectionMatrix}getModelMatrix(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}getViewMatrix(){return this.viewport.viewMatrix}getViewMatrixUncentered(){return this.viewport.viewMatrixUncentered}getViewProjectionMatrix(){return this.viewport.viewProjectionMatrix}getViewProjectionMatrixUncentered(){return this.viewport.viewProjectionMatrix}getFocalDistance(){return 1}projectFlat(e,r){return this.viewport.projectFlat(e,r)}}const pI=["id","attributionControl","style","token","rotation","mapInstance"];function fI(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}fI(`.mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mapboxgl-canvas{position:absolute;left:0;top:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;-webkit-transform:translate(0);transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:"";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);transform:scale(3);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}`),window.mapboxgl=__();let dI=0;const G3="101MlGsZ2AmmA&access_token=pk.eyJ1IjoiZXhhbXBsZXMiLCJhIjoiY2p0MG01MXRqMW45cjQzb2R6b2ptc3J4MSJ9.zA2W0IkI0c6KaAhJfk9bWg";class mI extends _g{constructor(...e){super(...e),(0,K.Z)(this,"version","MAPBOX"),(0,K.Z)(this,"viewport",void 0)}getType(){return"mapbox"}lngLatToCoord(e,r={x:0,y:0,z:0}){const{x:n,y:a}=this.lngLatToMercator(e,0);return[n-r.x,a-r.y]}lngLatToMercator(e,r){const{x:n=0,y:a=0,z:u=0}=window.mapboxgl.MercatorCoordinate.fromLngLat(e,r);return{x:n,y:a,z:u}}getModelMatrix(e,r,n,a=[1,1,1],u={x:0,y:0,z:0}){const y=window.mapboxgl.MercatorCoordinate.fromLngLat(e,r),A=y.meterInMercatorCoordinateUnits(),O=Kr.create();return Kr.translate(O,O,ra.fromValues(y.x-u.x,y.y-u.y,y.z||0-u.z)),Kr.scale(O,O,ra.fromValues(A*a[0],-A*a[1],A*a[2])),Kr.rotateX(O,O,n[0]),Kr.rotateY(O,O,n[1]),Kr.rotateZ(O,O,n[2]),O}init(){var e=this;return(0,Nr.Z)(function*(){const r=e.config,{id:n="map",attributionControl:a=!1,style:u="light",token:y=G3,rotation:A=0,mapInstance:O}=r,Z=(0,Ge.Z)(r,pI);e.viewport=new H3,!O&&!window.mapboxgl&&console.error(e.configService.getSceneWarninfo("SDK")),y===G3&&u!=="blank"&&!window.mapboxgl.accessToken&&!O&&console.warn(e.configService.getSceneWarninfo("MapToken")),!O&&!window.mapboxgl.accessToken&&(window.mapboxgl.accessToken=y),O?(e.map=O,e.$mapContainer=e.map.getContainer()):(e.$mapContainer=e.creatMapContainer(n),e.map=new window.mapboxgl.Map((0,Wt.Z)({container:e.$mapContainer,style:e.getMapStyleValue(u),attributionControl:a,bearing:A},Z))),e.map.on("load",()=>{e.handleCameraChanged()}),e.map.on("move",e.handleCameraChanged),e.handleCameraChanged()})()}destroy(){var e;(e=this.$mapContainer)===null||e===void 0||(e=e.parentNode)===null||e===void 0||e.removeChild(this.$mapContainer),this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}emit(e,...r){this.eventEmitter.emit(e,...r)}once(e,...r){this.eventEmitter.once(e,...r)}getMapContainer(){return this.$mapContainer}getCanvasOverlays(){var e;return(e=this.getMapContainer())===null||e===void 0?void 0:e.querySelector(".mapboxgl-canvas-container")}meterToCoord(e,r){const n=new(__()).LngLat(e[0],e[1]),a=new(__()).LngLat(r[0],r[1]),u=n.distanceTo(a),y=__().MercatorCoordinate.fromLngLat({lng:e[0],lat:e[1]}),A=__().MercatorCoordinate.fromLngLat({lng:r[0],lat:r[1]}),{x:O,y:Z}=y,{x:Y,y:Q}=A;return Math.sqrt(Math.pow(O-Y,2)+Math.pow(Z-Q,2))*4194304*2/u}exportMap(e){const r=this.map.getCanvas();return e==="jpg"?r==null?void 0:r.toDataURL("image/jpeg"):r==null?void 0:r.toDataURL("image/png")}creatMapContainer(e){let r=e;typeof e=="string"&&(r=document.getElementById(e));const n=document.createElement("div");return n.style.cssText+=` position: absolute; top: 0; height: 100%; width: 100%; `,n.id="l7_mapbox_div"+dI++,r.appendChild(n),n}}function gI(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}gI(`.mapboxgl-ctrl-logo { display: none !important; } `);class vI extends Nm{getServiceConstructor(){return mI}}var _I=Se(68974),y_=Se.n(_I);const yI=["id","attributionControl","style","rotation","mapInstance"];function xI(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}xI(`.maplibregl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:-moz-full-screen{height:100%;width:100%}.maplibregl-map:-ms-fullscreen{height:100%;width:100%}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;-webkit-transform:translate(0);transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23999' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{-webkit-animation:maplibregl-spin 2s linear infinite;animation:maplibregl-spin 2s linear infinite}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}}@-webkit-keyframes maplibregl-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes maplibregl-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (-ms-high-contrast:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{-webkit-animation:maplibregl-user-location-dot-pulse 2s infinite;animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@-webkit-keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}70%{opacity:0;-webkit-transform:scale(3);transform:scale(3)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}70%{opacity:0;-webkit-transform:scale(3);transform:scale(3)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`),window.maplibregl=y_();let bI=0;class EI extends _g{constructor(...e){super(...e),(0,K.Z)(this,"version",rp.MAPBOX),(0,K.Z)(this,"viewport",void 0)}getType(){return"mapbox"}lngLatToCoord(e,r={x:0,y:0,z:0}){const{x:n,y:a}=this.lngLatToMercator(e,0);return[n-r.x,a-r.y]}lngLatToMercator(e,r){const{x:n=0,y:a=0,z:u=0}=window.maplibregl.MercatorCoordinate.fromLngLat(e,r);return{x:n,y:a,z:u}}getModelMatrix(e,r,n,a=[1,1,1],u={x:0,y:0,z:0}){const y=window.maplibregl.MercatorCoordinate.fromLngLat(e,r),A=y.meterInMercatorCoordinateUnits(),O=Kr.create();return Kr.translate(O,O,ra.fromValues(y.x-u.x,y.y-u.y,y.z||0-u.z)),Kr.scale(O,O,ra.fromValues(A*a[0],-A*a[1],A*a[2])),Kr.rotateX(O,O,n[0]),Kr.rotateY(O,O,n[1]),Kr.rotateZ(O,O,n[2]),O}init(){var e=this;return(0,Nr.Z)(function*(){const r=e.config,{id:n="map",attributionControl:a=!1,style:u="light",rotation:y=0,mapInstance:A}=r,O=(0,Ge.Z)(r,yI);e.viewport=new H3,!A&&!window.maplibregl&&console.error(e.configService.getSceneWarninfo("SDK")),A?(e.map=A,e.$mapContainer=e.map.getContainer()):(e.$mapContainer=e.creatMapContainer(n),e.map=new window.maplibregl.Map((0,Wt.Z)({container:e.$mapContainer,style:e.getMapStyleValue(u),attributionControl:a,bearing:y},O))),e.map.on("load",()=>{e.handleCameraChanged()}),e.map.on("move",e.handleCameraChanged),e.handleCameraChanged()})()}destroy(){var e;(e=this.$mapContainer)===null||e===void 0||(e=e.parentNode)===null||e===void 0||e.removeChild(this.$mapContainer),this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}emit(e,...r){this.eventEmitter.emit(e,...r)}once(e,...r){this.eventEmitter.once(e,...r)}getMapContainer(){return this.$mapContainer}getCanvasOverlays(){var e;return(e=this.getMapContainer())===null||e===void 0?void 0:e.querySelector(".maplibregl-canvas-container")}meterToCoord(e,r){const n=new(y_()).LngLat(e[0],e[1]),a=new(y_()).LngLat(r[0],r[1]),u=n.distanceTo(a),y=y_().MercatorCoordinate.fromLngLat({lng:e[0],lat:e[1]}),A=y_().MercatorCoordinate.fromLngLat({lng:r[0],lat:r[1]}),{x:O,y:Z}=y,{x:Y,y:Q}=A;return Math.sqrt(Math.pow(O-Y,2)+Math.pow(Z-Q,2))*4194304*2/u}exportMap(e){const r=this.map.getCanvas();return e==="jpg"?r==null?void 0:r.toDataURL("image/jpeg"):r==null?void 0:r.toDataURL("image/png")}creatMapContainer(e){let r=e;typeof e=="string"&&(r=document.getElementById(e));const n=document.createElement("div");return n.style.cssText+=` position: absolute; top: 0; height: 100%; width: 100%; `,n.id="l7_mapbox_div"+bI++,r.appendChild(n),n}}class wI extends Nm{getServiceConstructor(){return EI}}const SI=t=>{const{tk:e}=t;return new Promise(r=>{const n=document.createElement("script");n.type="text/javascript",n.src=`https://api.tianditu.gov.cn/api?v=4.0&tk=${e}`,n.onload=function(){console.log("TianDiTu API script loaded."),r(!0)},n.onerror=function(){console.error("Failed to load TianDiTu API script."),r(!1)},document.head.appendChild(n)})},e7=()=>{};let TI=0;const H0={zoomchange:["Ge"]};class AI extends _g{constructor(...e){super(...e),(0,K.Z)(this,"viewport",null),(0,K.Z)(this,"evtCbProxyMap",new Map),(0,K.Z)(this,"sceneContainer",void 0),(0,K.Z)(this,"handleCameraChanged",()=>{this.emit("mapchange");const r=this.map,{lng:n,lat:a}=this.map.getCenter(),u={center:[n,a],viewportHeight:r.getContainer().clientHeight,viewportWidth:r.getContainer().clientWidth,bearing:360,pitch:0,zoom:r.getZoom()-1};this.viewport&&(this.viewport.syncWithMapCamera(u),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport))})}addMarkerContainer(){const e=this.map.getContainer(),r=this.markerContainer=document.createElement("div");e.appendChild(r),r.setAttribute("tabindex","-1"),r.id="tdt-L7-marker",r.style.position="absolute",r.style.left="",r.style.top="",r.style.zIndex="600",r.style.width="0px",r.style.height="0px",r.style.overflow="visible"}getMarkerContainer(){return this.markerContainer}onCameraChanged(e){this.cameraChangedCallback=e}resize(e){this.sceneContainer.style.width=e.newSize.x+"px",this.sceneContainer.style.height=e.newSize.y+"px"}update(){const e=this.map.getBounds(),{x:r,y:n}=this.map.lngLatToLayerPoint({lng:e.getSouthWest().lng,lat:e.getNorthEast().lat});this.sceneContainer.style.transition="",this.sceneContainer.style.transformOrigin="center",this.sceneContainer.style.transform=`translate3d(${r}px, ${n}px, 0px) scale(1)`,this.markerContainer.style.transition="",this.markerContainer.style.transformOrigin="center",this.markerContainer.style.transform=`translate3d(${-r}px, ${-n}px, 0px) scale(1)`,this.sceneContainer._tdt_pos=new T.Point(r,n),this.handleCameraChanged()}getZoomScale(e,r){const n=this.map.options.IW;return r=r===void 0?this.map.getZoom():r,n.scale(e)/n.scale(r)}zoomStartUpdate(e){const r=e.center,n=e.zoom,a=this.getZoomScale(n,this.map.getZoom()),u=T._Q.getPosition(this.sceneContainer),y=this.map.getSize().GQ(.5),A=this.map.options.IW.qW(this.map.getCenter(),n),Z=this.map.options.IW.qW(r,n).DQ(A),Y=new T.Point(y.x,y.y).GQ(-a);Y.aQ(u),Y.aQ(y),Y.DQ(Z),this.sceneContainer.style.transform=`translate3d(${Y.x}px,${Y.y}px,0px) scale(${a})`,this.sceneContainer.style.transformOrigin="0 0",this.sceneContainer.style.transition="transform 0.25s cubic-bezier(0,0,0.25,1)",this.handleCameraChanged()}getOverlayContainer(){var e;const r=(e=this.map.getPanes())===null||e===void 0?void 0:e.overlayPane,n=document.createElement("div");r.parentElement.appendChild(n),n.id="tdt-L7";const a=this.map.getSize();return n.style.zIndex="200",n.style.width=`${a.x}px`,n.style.height=`${a.y}px`,this.sceneContainer=n,n}init(){var e=this;return(0,Nr.Z)(function*(){e.viewport=new Fg;const{id:r,mapInstance:n,center:a=[121.30654632240122,31.25744185633306],token:u="b15e548080c79819617367d3f6095c69",minZoom:y=1,maxZoom:A=18,zoom:O=3}=e.config;if(window.T||(yield SI({tk:u})),n){e.map=n,e.map.centerAndZoom(new window.T.LngLat(a[0],a[1]),O),e.$mapContainer=e.map.getContainer();const Q=new window.T.LngLat(a[0],a[1]);e.map.centerAndZoom(Q,O),e.setMinZoom(y),e.setMaxZoom(A)}else{if(!r)throw Error("No container id specified");e.$mapContainer=e.creatMapContainer(r);const Q=new T.Map(e.$mapContainer,{center:window.T.LngLat(a[0],a[1]),minZoom:y,maxZoom:A,zoom:O,projection:"EPSG:900913"});e.map=Q;const ae=new window.T.Control.Zoom;Q.addControl(ae)}const Y=e.map.getContainer().querySelector(".tdt-pane");Y.style.zIndex=1,e.handleCameraChanged(),e.map.on("move",e.update,e),e.map.on("Ge",e.zoomStartUpdate,e),e.map.on("resize",e.resize,e)})()}destroy(){}on(e,r){if(po.indexOf(e)!==-1)this.eventEmitter.on(e,r);else{const n=a=>{let u=this.evtCbProxyMap.get(a);if(u||this.evtCbProxyMap.set(a,u=new Map),u.get(r))return;const y=(...A)=>{A[0]&&typeof A[0]=="object"&&!A[0].lngLat&&!A[0].lnglat&&(A[0].lngLat=A[0].latlng||A[0].latLng,A[0].map=this.map),r(...A)};u.set(r,y),this.map.on(a,y)};Array.isArray(H0[e])?H0[e].forEach(a=>{n(a||e)}):n(H0[e]||e)}}off(e,r){if(po.indexOf(e)!==-1){this.eventEmitter.off(e,r);return}const n=a=>{var u,y;const A=(u=this.evtCbProxyMap.get(e))===null||u===void 0?void 0:u.get(r);A&&((y=this.evtCbProxyMap.get(a))===null||y===void 0||y.delete(r),this.map.off(a,A))};Array.isArray(H0[e])?H0[e].forEach(a=>{n(a||e)}):n(H0[e]||e)}once(e,r){throw new Error("Method not implemented.")}getMapContainer(){return this.map.getContainer()}getType(){return"tdtmap"}getMapCanvasContainer(){var e;return(e=this.map.getContainer())===null||e===void 0?void 0:e.getElementsByClassName("tdt-container")[0]}getSize(){const e=this.map.getSize();return[e.x,e.y]}getZoom(){return this.map.getZoom()}setZoom(e){return this.map.setZoom(e)}getCenter(){return this.map.getCenter()}setCenter(e){this.map.setCenter(e)}getPitch(){return 0}getRotation(){return 0}setRotation(e){this.map.setBearing(e)}zoomIn(e,r){this.map.zoomIn(e,r)}zoomOut(e,r){this.map.zoomOut(e,r)}panTo(e){this.map.panTo(e)}panBy(e=0,r=0){this.map.panBy([e,r])}fitBounds(e){const[r,n]=e;this.map.setViewport([new window.T.LngLat(r[0],r[1]),new window.T.LngLat(n[0],n[1])])}setMaxZoom(e){this.map.setMaxZoom(e)}setMinZoom(e){this.map.setMinZoom(e)}setMapStatus(e){e.doubleClickZoom===!0&&this.map.enableDoubleClickZoom(),e.doubleClickZoom===!1&&this.map.disableDoubleClickZoom(),e.dragEnable===!1&&this.map.disableDrag(),e.dragEnable===!0&&this.map.enableDrag(),e.keyboardEnable===!1&&this.map.disableKeyboard(),e.keyboardEnable===!0&&this.map.enableKeyboard(),e.zoomEnable===!1&&this.map.disableScrollWheelZoom(),e.zoomEnable===!0&&this.map.enableScrollWheelZoom()}getModelMatrix(){throw new Error("Method not implemented.")}pixelToLngLat([e,r]){const n=this.map.layerPointToLngLat({x:e,y:r});return{lng:n.lng,lat:n.lat}}lngLatToPixel([e,r]){const n=this.map.lngLatToLayerPoint({lng:e,lat:r});return{x:n.x,y:n.y}}containerToLngLat([e,r]){const n=this.map.containerPointToLngLat({x:e,y:r});return{lng:n.lng,lat:n.lat}}lngLatToContainer([e,r]){const n=this.map.lngLatToContainerPoint({lat:r,lng:e});return{x:n.x,y:n.y}}lngLatToCoord([e,r]){const n=this.lngLatToPixel([e,r]);return[n.x,n.y]}lngLatToCoords(e){return e.map(r=>Array.isArray(r[0])?this.lngLatToCoords(r):this.lngLatToCoord(r))}getBounds(){const e=this.map.getBounds(),r=e.getSouthWest(),n=e.getNorthEast();return[[r.lng,r.lat],[n.lng,n.lat]]}lngLatToMercator(e,r){const{x:n=0,y:a=0,z:u=0}=Vm.fromLngLat(e,r);return{x:n,y:a,z:u}}getCustomCoordCenter(){throw new Error("Method not implemented.")}creatMapContainer(e){let r=e;typeof e=="string"&&(r=document.getElementById(e));const n=document.createElement("div");return n.style.cssText+=` position: absolute; top: 0; height: 100%; width: 100%; `,n.id="l7_tdt_div"+TI++,r.appendChild(n),n}}class CI extends Nm{getServiceConstructor(){return AI}}if(!window)throw Error("TMap JSAPI can only be used in Browser.");var Hm=function(t){return t.notload="notload",t.loading="loading",t.loaded="loaded",t.failed="failed",t}(Hm||{});const wg={key:"",version:"1.exp",libraries:[]};let Sg={TMap:Hm.notload};const W2=[],W3=t=>{if(typeof t=="function"){if(Sg.TMap===Hm.loaded){t(window.TMap);return}W2.push(t)}};var MI={load:t=>new Promise((e,r)=>{if(Sg.TMap===Hm.failed)r("");else if(Sg.TMap===Hm.notload){const{key:n,version:a,libraries:u}=t;if(!n){r("\u8BF7\u586B\u5199key");return}wg.key=n,wg.version=a||wg.version,wg.libraries=u||wg.libraries,Sg.TMap=Hm.loading,window._onTMapAPILoaded=O=>{if(delete window._onTMapAPILoaded,O)Sg.TMap=Hm.failed,r(O);else for(Sg.TMap=Hm.loaded;W2.length;)W2.splice(0,1)[0](window.TMap)};const y=document.createElement("script");y.type="text/javascript",y.async=!1,y.src="https://map.qq.com/api/gljs?callback=_onTMapAPILoaded&v="+wg.version+"&key="+n+"&plugin="+wg.libraries.join(","),y.onerror=O=>{Sg.TMap=Hm.failed,r(O)},(document.body||document.head).appendChild(y),W3(e)}else if(Sg.TMap===Hm.loaded){if(t.key&&t.key!==wg.key){r("\u591A\u4E2A\u4E0D\u4E00\u81F4\u7684 key");return}if(t.version&&t.version!==wg.version){r("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C JSAPI \u6DF7\u7528");return}W3(e)}}),reset:()=>{delete window.TMap,Sg={TMap:Hm.notload}}};const PI=["id","mapInstance","center","token","version","libraries","minZoom","maxZoom","rotation","pitch","mapSize","logoVisible"];function RI(t,e){var r=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(r||n)&&(e||(e=document),!!e)){var a=e.head||e.getElementsByTagName("head")[0];if(!a){a=e.createElement("head");var u=e.body||e.getElementsByTagName("body")[0];u?u.parentNode.insertBefore(a,u):e.documentElement.appendChild(a)}var y=e.createElement("style");return y.type="text/css",y.styleSheet?y.styleSheet.cssText=t:y.appendChild(e.createTextNode(t)),a.appendChild(y),y}}RI(`img[src*='//mapapi.qq.com/web/jsapi/logo/logo_def.png'],.logo-text { display: none !important; } .tencent-map > canvas + div { z-index: 3 !important; } `);const II="OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77",LI="1.exp",G0={mapmove:"center_changed",camerachange:["drag","pan","rotate","pitch","zoom"],zoomchange:"zoom",dragging:"drag"};class DI extends _g{constructor(...e){super(...e),(0,K.Z)(this,"viewport",null),(0,K.Z)(this,"evtCbProxyMap",new Map),(0,K.Z)(this,"handleCameraChanged",()=>{this.emit("mapchange");const r=this.map,{lng:n,lat:a}=r.getCenter(),u={center:[n,a],viewportHeight:r.getContainer().clientHeight,viewportWidth:r.getContainer().clientWidth,bearing:r.getHeading(),pitch:r.getPitch(),zoom:r.getZoom()-1};this.viewport.syncWithMapCamera(u),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport)})}init(){var e=this;return(0,Nr.Z)(function*(){var r;e.viewport=new Fg;const n=e.config,{id:a,mapInstance:u,center:y=[121.30654632240122,31.25744185633306],token:A=II,version:O=LI,libraries:Z=[],minZoom:Y=3,maxZoom:Q=18,rotation:ae=0,pitch:xe=0,mapSize:Be=1e4,logoVisible:it=!0}=n,gt=(0,Ge.Z)(n,PI);if(window.TMap||u||(yield MI.load({key:A,version:O,libraries:Z})),u)e.map=u,e.$mapContainer=e.map.getContainer(),it===!1&&e.hideLogo();else{if(!a)throw Error("No container id specified");const Rt=wc(a),Yt=new TMap.Map(Rt,(0,Wt.Z)({maxZoom:Q,minZoom:Y,rotation:ae,pitch:xe,showControl:!1,center:new TMap.LatLng(y[1],y[0])},gt));e.map=Yt,e.$mapContainer=Yt.getContainer(),it===!1&&e.hideLogo()}e.map.canvasContainer.style.position="absolute",e.map.drawContainer.classList.add("tencent-map");const Bt=(r=e.map.controlManager.controlContainer)===null||r===void 0?void 0:r.parentNode;Bt&&(Bt.style.zIndex=2),e.simpleMapCoord.setSize(Be),e.map.on("drag",e.handleCameraChanged),e.map.on("pan",e.handleCameraChanged),e.map.on("rotate",e.handleCameraChanged),e.map.on("pitch",e.handleCameraChanged),e.map.on("zoom",e.handleCameraChanged),e.handleCameraChanged()})()}destroy(){this.map.destroy()}onCameraChanged(e){this.cameraChangedCallback=e}addMarkerContainer(){const e=this.map.getContainer();this.markerContainer=Xo("div","l7-marker-container",e),this.markerContainer.setAttribute("tabindex","-1"),this.markerContainer.style.zIndex="2"}getMarkerContainer(){return this.markerContainer}on(e,r){if(po.indexOf(e)!==-1)this.eventEmitter.on(e,r);else{const n=a=>{let u=this.evtCbProxyMap.get(a);if(u||this.evtCbProxyMap.set(a,u=new Map),u.get(r))return;const y=(...A)=>{A[0]&&typeof A[0]=="object"&&!A[0].lngLat&&!A[0].lnglat&&(A[0].lngLat=A[0].latlng||A[0].latLng),r(...A)};u.set(r,y),this.map.on(a,y)};Array.isArray(G0[e])?G0[e].forEach(a=>{n(a||e)}):n(G0[e]||e)}}off(e,r){if(po.indexOf(e)!==-1){this.eventEmitter.off(e,r);return}const n=a=>{var u,y;const A=(u=this.evtCbProxyMap.get(e))===null||u===void 0?void 0:u.get(r);A&&((y=this.evtCbProxyMap.get(a))===null||y===void 0||y.delete(r),this.map.off(a,A))};Array.isArray(G0[e])?G0[e].forEach(a=>{n(a||e)}):n(G0[e]||e)}once(){throw new Error("Method not implemented.")}getContainer(){return this.map.getContainer()}getSize(){return[this.map.width,this.map.height]}getMinZoom(){return this.map.transform._minZoom}getMaxZoom(){return this.map.transform._maxZoom}getType(){return"tmap"}getZoom(){return this.map.getZoom()}getCenter(){const{lng:e,lat:r}=this.map.getCenter();return{lng:e,lat:r}}getPitch(){return this.map.getPitch()}getRotation(){return this.map.getRotation()}getBounds(){const e=this.map.getBounds().getNorthEast(),r=this.map.getBounds().getSouthWest();return[[r.lng,r.lat],[e.lng,e.lat]]}getMapContainer(){return this.map.getContainer()}getMapCanvasContainer(){var e;return(e=this.map.getContainer())===null||e===void 0?void 0:e.getElementsByTagName("canvas")[0]}getCanvasOverlays(){var e;return(e=this.getMapCanvasContainer())===null||e===void 0||(e=e.nextSibling)===null||e===void 0?void 0:e.firstChild}getMapStyleConfig(){throw new Error("Method not implemented.")}setBgColor(e){this.bgColor=e}setMapStyle(e){this.map.setMapStyleId(e)}setRotation(e){this.map.setRotation(e)}zoomIn(){this.map.setZoom(this.getZoom()+1)}zoomOut(){this.map.setZoom(this.getZoom()-1)}panTo([e,r]){this.map.panTo(new TMap.LatLng(r,e))}panBy(e,r){this.map.panBy([e,r])}fitBounds(e,r){const[n,a]=e,u=new TMap.LatLng(n[1],n[0]),y=new TMap.LatLng(a[1],a[0]),A=new TMap.LatLngBounds(u,y);this.map.fitBounds(A,r)}setZoomAndCenter(e,[r,n]){this.map.setCenter(new TMap.LatLng(n,r)),this.map.setZoom(e)}setCenter([e,r]){this.map.setCenter(new TMap.LatLng(r,e))}setPitch(e){this.map.setPitch(e)}setZoom(e){this.map.setZoom(e)}setMapStatus(e){Object.keys(e).map(r=>{switch(r){case"doubleClickZoom":this.map.setDoubleClickZoom(!!e.doubleClickZoom);break;case"dragEnable":this.map.setDraggable(!!e.dragEnable);break;case"rotateEnable":this.map.setRotatable(!!e.rotateEnable);break;case"zoomEnable":this.map.setDoubleClickZoom(!!e.zoomEnable),this.map.setScrollable(!!e.zoomEnable);break;case"keyboardEnable":case"resizeEnable":case"showIndoorMap":throw Error("Options may bot be supported");default:}})}meterToCoord([e,r],[n,a]){const u=TMap.geometry.computeDistance([new TMap.LatLng(r,e),new TMap.LatLng(a,n)]),[y,A]=this.lngLatToCoord([e,r]),[O,Z]=this.lngLatToCoord([n,a]);return Math.sqrt(Math.pow(y-O,2)+Math.pow(A-Z,2))/u}pixelToLngLat([e,r]){const{lng:n,lat:a}=this.map.getCenter(),{x:u,y}=this.lngLatToPixel([n,a]),{x:A,y:O}=this.lngLatToContainer([n,a]),{lng:Z,lat:Y}=this.map.unprojectFromContainer(new TMap.Point(A+(e-u),O+(r-y)));return this.containerToLngLat([Z,Y])}lngLatToPixel([e,r]){const{x:n,y:a}=this.map.projectToWorldPlane(new TMap.LatLng(r,e));return{x:n,y:a}}containerToLngLat([e,r]){const{lng:n,lat:a}=this.map.unprojectFromContainer(new TMap.Point(e,r));return{lng:n,lat:a}}lngLatToContainer([e,r]){const{x:n,y:a}=this.map.projectToContainer(new TMap.LatLng(r,e));return{x:n,y:a}}lngLatToCoord([e,r]){const{x:n,y:a}=this.lngLatToPixel([e,r]);return[n,-a]}lngLatToCoords(e){return e.map(r=>Array.isArray(r[0])?this.lngLatToCoords(r):this.lngLatToCoord(r))}lngLatToMercator(e,r){const{x:n=0,y:a=0,z:u=0}=Vm.fromLngLat(e,r);return{x:n,y:a,z:u}}getModelMatrix(e,r,n,a=[1,1,1]){const u=this.viewport.projectFlat(e),y=Kr.create();return Kr.translate(y,y,ra.fromValues(u[0],u[1],r)),Kr.scale(y,y,ra.fromValues(a[0],a[1],a[2])),Kr.rotateX(y,y,n[0]),Kr.rotateY(y,y,n[1]),Kr.rotateZ(y,y,n[2]),y}getCustomCoordCenter(){throw new Error("Method not implemented.")}exportMap(e){const r=this.getMapCanvasContainer();return e==="jpg"?r==null?void 0:r.toDataURL("image/jpeg"):r==null?void 0:r.toDataURL("image/png")}rotateY(){throw new Error("Method not implemented.")}hideLogo(){const e=this.map.getContainer();e&&dl(e,"tmap-contianer--hide-logo")}}class OI extends Nm{getServiceConstructor(){return DI}}var BI=Se(79801),FI=Se.n(BI),kI=class{constructor(t,e){const{buffer:r,offset:n,stride:a,normalized:u,size:y,divisor:A}=e;this.buffer=r,this.attribute={buffer:r.get(),offset:n||0,stride:a||0,normalized:u||!1,divisor:A||0},y&&(this.attribute.size=y)}get(){return this.attribute}updateBuffer(t){this.buffer.subData(t)}destroy(){this.buffer.destroy()}},NI={[Ee.POINTS]:"points",[Ee.LINES]:"lines",[Ee.LINE_LOOP]:"line loop",[Ee.LINE_STRIP]:"line strip",[Ee.TRIANGLES]:"triangles",[Ee.TRIANGLE_FAN]:"triangle fan",[Ee.TRIANGLE_STRIP]:"triangle strip"},X3={[Ee.STATIC_DRAW]:"static",[Ee.DYNAMIC_DRAW]:"dynamic",[Ee.STREAM_DRAW]:"stream"},X2={[Ee.BYTE]:"int8",[Ee.INT]:"int32",[Ee.UNSIGNED_BYTE]:"uint8",[Ee.UNSIGNED_SHORT]:"uint16",[Ee.UNSIGNED_INT]:"uint32",[Ee.FLOAT]:"float"},zI={[Ee.ALPHA]:"alpha",[Ee.LUMINANCE]:"luminance",[Ee.LUMINANCE_ALPHA]:"luminance alpha",[Ee.RGB]:"rgb",[Ee.RGBA]:"rgba",[Ee.RGBA4]:"rgba4",[Ee.RGB5_A1]:"rgb5 a1",[Ee.RGB565]:"rgb565",[Ee.DEPTH_COMPONENT]:"depth",[Ee.DEPTH_STENCIL]:"depth stencil"},UI={[Ee.DONT_CARE]:"dont care",[Ee.NICEST]:"nice",[Ee.FASTEST]:"fast"},q3={[Ee.NEAREST]:"nearest",[Ee.LINEAR]:"linear",[Ee.LINEAR_MIPMAP_LINEAR]:"mipmap",[Ee.NEAREST_MIPMAP_LINEAR]:"nearest mipmap linear",[Ee.LINEAR_MIPMAP_NEAREST]:"linear mipmap nearest",[Ee.NEAREST_MIPMAP_NEAREST]:"nearest mipmap nearest"},Y3={[Ee.REPEAT]:"repeat",[Ee.CLAMP_TO_EDGE]:"clamp",[Ee.MIRRORED_REPEAT]:"mirror"},ZI={[Ee.NONE]:"none",[Ee.BROWSER_DEFAULT_WEBGL]:"browser"},VI={[Ee.NEVER]:"never",[Ee.ALWAYS]:"always",[Ee.LESS]:"less",[Ee.LEQUAL]:"lequal",[Ee.GREATER]:"greater",[Ee.GEQUAL]:"gequal",[Ee.EQUAL]:"equal",[Ee.NOTEQUAL]:"notequal"},$3={[Ee.FUNC_ADD]:"add",[Ee.MIN_EXT]:"min",[Ee.MAX_EXT]:"max",[Ee.FUNC_SUBTRACT]:"subtract",[Ee.FUNC_REVERSE_SUBTRACT]:"reverse subtract"},k1={[Ee.ZERO]:"zero",[Ee.ONE]:"one",[Ee.SRC_COLOR]:"src color",[Ee.ONE_MINUS_SRC_COLOR]:"one minus src color",[Ee.SRC_ALPHA]:"src alpha",[Ee.ONE_MINUS_SRC_ALPHA]:"one minus src alpha",[Ee.DST_COLOR]:"dst color",[Ee.ONE_MINUS_DST_COLOR]:"one minus dst color",[Ee.DST_ALPHA]:"dst alpha",[Ee.ONE_MINUS_DST_ALPHA]:"one minus dst alpha",[Ee.CONSTANT_COLOR]:"constant color",[Ee.ONE_MINUS_CONSTANT_COLOR]:"one minus constant color",[Ee.CONSTANT_ALPHA]:"constant alpha",[Ee.ONE_MINUS_CONSTANT_ALPHA]:"one minus constant alpha",[Ee.SRC_ALPHA_SATURATE]:"src alpha saturate"},jI={[Ee.NEVER]:"never",[Ee.ALWAYS]:"always",[Ee.LESS]:"less",[Ee.LEQUAL]:"lequal",[Ee.GREATER]:"greater",[Ee.GEQUAL]:"gequal",[Ee.EQUAL]:"equal",[Ee.NOTEQUAL]:"notequal"},W0={[Ee.ZERO]:"zero",[Ee.KEEP]:"keep",[Ee.REPLACE]:"replace",[Ee.INVERT]:"invert",[Ee.INCR]:"increment",[Ee.DECR]:"decrement",[Ee.INCR_WRAP]:"increment wrap",[Ee.DECR_WRAP]:"decrement wrap"},HI={[Ee.FRONT]:"front",[Ee.BACK]:"back"},GI=class{constructor(t,e){this.isDestroyed=!1;const{data:r,usage:n,type:a}=e;this.buffer=t.buffer({data:r,usage:X3[n||Ee.STATIC_DRAW],type:X2[a||Ee.UNSIGNED_BYTE]})}get(){return this.buffer}destroy(){this.isDestroyed||this.buffer.destroy(),this.isDestroyed=!0}subData({data:t,offset:e}){this.buffer.subdata(t,e)}},WI=class{constructor(t,e){const{data:r,usage:n,type:a,count:u}=e;this.elements=t.elements({data:r,usage:X3[n||Ee.STATIC_DRAW],type:X2[a||Ee.UNSIGNED_BYTE],count:u})}get(){return this.elements}subData({data:t}){this.elements.subdata(t)}destroy(){}},XI=class{constructor(t,e){const{width:r,height:n,color:a,colors:u}=e,y={width:r,height:n};Array.isArray(u)&&(y.colors=u.map(A=>A.get())),a&&typeof a!="boolean"&&(y.color=a.get()),this.framebuffer=t.framebuffer(y)}get(){return this.framebuffer}destroy(){this.framebuffer.destroy()}resize({width:t,height:e}){this.framebuffer.resize(t,e)}},Dm=Se(58622),X0=Se(39696),qI=Se(39083),wo=Se(99938),YI=Se(2337),K3=YI,qt;(function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",t[t.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.CULL_FACE=2884]="CULL_FACE",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.BLEND=3042]="BLEND",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.DITHER=3024]="DITHER",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DOUBLE=5130]="DOUBLE",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.ALWAYS=519]="ALWAYS",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.GEQUAL=518]="GEQUAL",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",t[t.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.READ_BUFFER=3074]="READ_BUFFER",t[t.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",t[t.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",t[t.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",t[t.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",t[t.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",t[t.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",t[t.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",t[t.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",t[t.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",t[t.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",t[t.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",t[t.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",t[t.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",t[t.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",t[t.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",t[t.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",t[t.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",t[t.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",t[t.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",t[t.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",t[t.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",t[t.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",t[t.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",t[t.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",t[t.RED=6403]="RED",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB10_A2=32857]="RGB10_A2",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",t[t.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",t[t.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",t[t.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",t[t.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",t[t.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",t[t.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",t[t.SRGB=35904]="SRGB",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",t[t.RGBA32F=34836]="RGBA32F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.RGB16F=34843]="RGB16F",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R16F=33325]="R16F",t[t.R32F=33326]="R32F",t[t.RG16F=33327]="RG16F",t[t.RG32F=33328]="RG32F",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2UI=36975]="RGB10_A2UI",t[t.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",t[t.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.RG=33319]="RG",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",t[t.CURRENT_QUERY=34917]="CURRENT_QUERY",t[t.QUERY_RESULT=34918]="QUERY_RESULT",t[t.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",t[t.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",t[t.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",t[t.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",t[t.DRAW_BUFFER0=34853]="DRAW_BUFFER0",t[t.DRAW_BUFFER1=34854]="DRAW_BUFFER1",t[t.DRAW_BUFFER2=34855]="DRAW_BUFFER2",t[t.DRAW_BUFFER3=34856]="DRAW_BUFFER3",t[t.DRAW_BUFFER4=34857]="DRAW_BUFFER4",t[t.DRAW_BUFFER5=34858]="DRAW_BUFFER5",t[t.DRAW_BUFFER6=34859]="DRAW_BUFFER6",t[t.DRAW_BUFFER7=34860]="DRAW_BUFFER7",t[t.DRAW_BUFFER8=34861]="DRAW_BUFFER8",t[t.DRAW_BUFFER9=34862]="DRAW_BUFFER9",t[t.DRAW_BUFFER10=34863]="DRAW_BUFFER10",t[t.DRAW_BUFFER11=34864]="DRAW_BUFFER11",t[t.DRAW_BUFFER12=34865]="DRAW_BUFFER12",t[t.DRAW_BUFFER13=34866]="DRAW_BUFFER13",t[t.DRAW_BUFFER14=34867]="DRAW_BUFFER14",t[t.DRAW_BUFFER15=34868]="DRAW_BUFFER15",t[t.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",t[t.MAX_SAMPLES=36183]="MAX_SAMPLES",t[t.SAMPLER_BINDING=35097]="SAMPLER_BINDING",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",t[t.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",t[t.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",t[t.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",t[t.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",t[t.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",t[t.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",t[t.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",t[t.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",t[t.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",t[t.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",t[t.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",t[t.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",t[t.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",t[t.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",t[t.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",t[t.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",t[t.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",t[t.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",t[t.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",t[t.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",t[t.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",t[t.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",t[t.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",t[t.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",t[t.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",t[t.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",t[t.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",t[t.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",t[t.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",t[t.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",t[t.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",t[t.UNIFORM_TYPE=35383]="UNIFORM_TYPE",t[t.UNIFORM_SIZE=35384]="UNIFORM_SIZE",t[t.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",t[t.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",t[t.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",t[t.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",t[t.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",t[t.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",t[t.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",t[t.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",t[t.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS",t[t.SYNC_FENCE=37142]="SYNC_FENCE",t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED",t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED",t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",t[t.COLOR=6144]="COLOR",t[t.DEPTH=6145]="DEPTH",t[t.STENCIL=6146]="STENCIL",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STREAM_COPY=35042]="STREAM_COPY",t[t.STATIC_READ=35045]="STATIC_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",t[t.INVALID_INDEX=4294967295]="INVALID_INDEX",t[t.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",t[t.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",t[t.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",t[t.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",t[t.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",t[t.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.UNSIGNED_INT_24_8_WEBGL=34042]="UNSIGNED_INT_24_8_WEBGL",t[t.HALF_FLOAT_OES=36193]="HALF_FLOAT_OES",t[t.RGBA32F_EXT=34836]="RGBA32F_EXT",t[t.RGB32F_EXT=34837]="RGB32F_EXT",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",t[t.UNSIGNED_NORMALIZED_EXT=35863]="UNSIGNED_NORMALIZED_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.SRGB_EXT=35904]="SRGB_EXT",t[t.SRGB_ALPHA_EXT=35906]="SRGB_ALPHA_EXT",t[t.SRGB8_ALPHA8_EXT=35907]="SRGB8_ALPHA8_EXT",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT_OES=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT_OES",t[t.COLOR_ATTACHMENT0_WEBGL=36064]="COLOR_ATTACHMENT0_WEBGL",t[t.COLOR_ATTACHMENT1_WEBGL=36065]="COLOR_ATTACHMENT1_WEBGL",t[t.COLOR_ATTACHMENT2_WEBGL=36066]="COLOR_ATTACHMENT2_WEBGL",t[t.COLOR_ATTACHMENT3_WEBGL=36067]="COLOR_ATTACHMENT3_WEBGL",t[t.COLOR_ATTACHMENT4_WEBGL=36068]="COLOR_ATTACHMENT4_WEBGL",t[t.COLOR_ATTACHMENT5_WEBGL=36069]="COLOR_ATTACHMENT5_WEBGL",t[t.COLOR_ATTACHMENT6_WEBGL=36070]="COLOR_ATTACHMENT6_WEBGL",t[t.COLOR_ATTACHMENT7_WEBGL=36071]="COLOR_ATTACHMENT7_WEBGL",t[t.COLOR_ATTACHMENT8_WEBGL=36072]="COLOR_ATTACHMENT8_WEBGL",t[t.COLOR_ATTACHMENT9_WEBGL=36073]="COLOR_ATTACHMENT9_WEBGL",t[t.COLOR_ATTACHMENT10_WEBGL=36074]="COLOR_ATTACHMENT10_WEBGL",t[t.COLOR_ATTACHMENT11_WEBGL=36075]="COLOR_ATTACHMENT11_WEBGL",t[t.COLOR_ATTACHMENT12_WEBGL=36076]="COLOR_ATTACHMENT12_WEBGL",t[t.COLOR_ATTACHMENT13_WEBGL=36077]="COLOR_ATTACHMENT13_WEBGL",t[t.COLOR_ATTACHMENT14_WEBGL=36078]="COLOR_ATTACHMENT14_WEBGL",t[t.COLOR_ATTACHMENT15_WEBGL=36079]="COLOR_ATTACHMENT15_WEBGL",t[t.DRAW_BUFFER0_WEBGL=34853]="DRAW_BUFFER0_WEBGL",t[t.DRAW_BUFFER1_WEBGL=34854]="DRAW_BUFFER1_WEBGL",t[t.DRAW_BUFFER2_WEBGL=34855]="DRAW_BUFFER2_WEBGL",t[t.DRAW_BUFFER3_WEBGL=34856]="DRAW_BUFFER3_WEBGL",t[t.DRAW_BUFFER4_WEBGL=34857]="DRAW_BUFFER4_WEBGL",t[t.DRAW_BUFFER5_WEBGL=34858]="DRAW_BUFFER5_WEBGL",t[t.DRAW_BUFFER6_WEBGL=34859]="DRAW_BUFFER6_WEBGL",t[t.DRAW_BUFFER7_WEBGL=34860]="DRAW_BUFFER7_WEBGL",t[t.DRAW_BUFFER8_WEBGL=34861]="DRAW_BUFFER8_WEBGL",t[t.DRAW_BUFFER9_WEBGL=34862]="DRAW_BUFFER9_WEBGL",t[t.DRAW_BUFFER10_WEBGL=34863]="DRAW_BUFFER10_WEBGL",t[t.DRAW_BUFFER11_WEBGL=34864]="DRAW_BUFFER11_WEBGL",t[t.DRAW_BUFFER12_WEBGL=34865]="DRAW_BUFFER12_WEBGL",t[t.DRAW_BUFFER13_WEBGL=34866]="DRAW_BUFFER13_WEBGL",t[t.DRAW_BUFFER14_WEBGL=34867]="DRAW_BUFFER14_WEBGL",t[t.DRAW_BUFFER15_WEBGL=34868]="DRAW_BUFFER15_WEBGL",t[t.MAX_COLOR_ATTACHMENTS_WEBGL=36063]="MAX_COLOR_ATTACHMENTS_WEBGL",t[t.MAX_DRAW_BUFFERS_WEBGL=34852]="MAX_DRAW_BUFFERS_WEBGL",t[t.VERTEX_ARRAY_BINDING_OES=34229]="VERTEX_ARRAY_BINDING_OES",t[t.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",t[t.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",t[t.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",t[t.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",t[t.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",t[t.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",t[t.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT"})(qt||(qt={}));var Jl;(function(t){t[t.Buffer=0]="Buffer",t[t.Texture=1]="Texture",t[t.RenderTarget=2]="RenderTarget",t[t.Sampler=3]="Sampler",t[t.Program=4]="Program",t[t.Bindings=5]="Bindings",t[t.InputLayout=6]="InputLayout",t[t.RenderPipeline=7]="RenderPipeline",t[t.ComputePipeline=8]="ComputePipeline",t[t.Readback=9]="Readback",t[t.QueryPool=10]="QueryPool",t[t.RenderBundle=11]="RenderBundle"})(Jl||(Jl={}));var js;(function(t){t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS"})(js||(js={}));var x_;(function(t){t[t.CCW=2305]="CCW",t[t.CW=2304]="CW"})(x_||(x_={}));var Jd;(function(t){t[t.NONE=0]="NONE",t[t.FRONT=1]="FRONT",t[t.BACK=2]="BACK",t[t.FRONT_AND_BACK=3]="FRONT_AND_BACK"})(Jd||(Jd={}));var pl;(function(t){t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC=768]="SRC",t[t.ONE_MINUS_SRC=769]="ONE_MINUS_SRC",t[t.DST=774]="DST",t[t.ONE_MINUS_DST=775]="ONE_MINUS_DST",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.CONST=32769]="CONST",t[t.ONE_MINUS_CONSTANT=32770]="ONE_MINUS_CONSTANT",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE"})(pl||(pl={}));var If;(function(t){t[t.ADD=32774]="ADD",t[t.SUBSTRACT=32778]="SUBSTRACT",t[t.REVERSE_SUBSTRACT=32779]="REVERSE_SUBSTRACT",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX"})(If||(If={}));var Id;(function(t){t[t.CLAMP_TO_EDGE=0]="CLAMP_TO_EDGE",t[t.REPEAT=1]="REPEAT",t[t.MIRRORED_REPEAT=2]="MIRRORED_REPEAT"})(Id||(Id={}));var pp;(function(t){t[t.POINT=0]="POINT",t[t.BILINEAR=1]="BILINEAR"})(pp||(pp={}));var df;(function(t){t[t.NO_MIP=0]="NO_MIP",t[t.NEAREST=1]="NEAREST",t[t.LINEAR=2]="LINEAR"})(df||(df={}));var Ip;(function(t){t[t.POINTS=0]="POINTS",t[t.TRIANGLES=1]="TRIANGLES",t[t.TRIANGLE_STRIP=2]="TRIANGLE_STRIP",t[t.LINES=3]="LINES",t[t.LINE_STRIP=4]="LINE_STRIP"})(Ip||(Ip={}));var ac;(function(t){t[t.MAP_READ=1]="MAP_READ",t[t.MAP_WRITE=2]="MAP_WRITE",t[t.COPY_SRC=4]="COPY_SRC",t[t.COPY_DST=8]="COPY_DST",t[t.INDEX=16]="INDEX",t[t.VERTEX=32]="VERTEX",t[t.UNIFORM=64]="UNIFORM",t[t.STORAGE=128]="STORAGE",t[t.INDIRECT=256]="INDIRECT",t[t.QUERY_RESOLVE=512]="QUERY_RESOLVE"})(ac||(ac={}));var Gm;(function(t){t[t.STATIC=1]="STATIC",t[t.DYNAMIC=2]="DYNAMIC"})(Gm||(Gm={}));var a0;(function(t){t[t.VERTEX=1]="VERTEX",t[t.INSTANCE=2]="INSTANCE"})(a0||(a0={}));var J3;(function(t){t.LOADED="loaded"})(J3||(J3={}));var rl;(function(t){t[t.TEXTURE_2D=0]="TEXTURE_2D",t[t.TEXTURE_2D_ARRAY=1]="TEXTURE_2D_ARRAY",t[t.TEXTURE_3D=2]="TEXTURE_3D",t[t.TEXTURE_CUBE_MAP=3]="TEXTURE_CUBE_MAP"})(rl||(rl={}));var ad;(function(t){t[t.SAMPLED=1]="SAMPLED",t[t.RENDER_TARGET=2]="RENDER_TARGET",t[t.STORAGE=4]="STORAGE"})(ad||(ad={}));var Lf;(function(t){t[t.NONE=0]="NONE",t[t.RED=1]="RED",t[t.GREEN=2]="GREEN",t[t.BLUE=4]="BLUE",t[t.ALPHA=8]="ALPHA",t[t.RGB=7]="RGB",t[t.ALL=15]="ALL"})(Lf||(Lf={}));var jh;(function(t){t[t.KEEP=7680]="KEEP",t[t.ZERO=0]="ZERO",t[t.REPLACE=7681]="REPLACE",t[t.INVERT=5386]="INVERT",t[t.INCREMENT_CLAMP=7682]="INCREMENT_CLAMP",t[t.DECREMENT_CLAMP=7683]="DECREMENT_CLAMP",t[t.INCREMENT_WRAP=34055]="INCREMENT_WRAP",t[t.DECREMENT_WRAP=34056]="DECREMENT_WRAP"})(jh||(jh={}));function n7(t,e,r,n){var a=rl.TEXTURE_2D,u=1,y=ad.SAMPLED;return{dimension:a,format:t,width:e,height:r,depthOrArrayLayers:u,mipLevelCount:n,usage:y}}var Hh;(function(t){t[t.Float=0]="Float",t[t.UnfilterableFloat=1]="UnfilterableFloat",t[t.Uint=2]="Uint",t[t.Sint=3]="Sint",t[t.Depth=4]="Depth"})(Hh||(Hh={}));var ng;(function(t){t[t.LOWER_LEFT=0]="LOWER_LEFT",t[t.UPPER_LEFT=1]="UPPER_LEFT"})(ng||(ng={}));var q0;(function(t){t[t.NEGATIVE_ONE=0]="NEGATIVE_ONE",t[t.ZERO=1]="ZERO"})(q0||(q0={}));var N1;(function(t){t[t.OcclusionConservative=0]="OcclusionConservative"})(N1||(N1={}));var zn;(function(t){t[t.U8=1]="U8",t[t.U16=2]="U16",t[t.U32=3]="U32",t[t.S8=4]="S8",t[t.S16=5]="S16",t[t.S32=6]="S32",t[t.F16=7]="F16",t[t.F32=8]="F32",t[t.BC1=65]="BC1",t[t.BC2=66]="BC2",t[t.BC3=67]="BC3",t[t.BC4_UNORM=68]="BC4_UNORM",t[t.BC4_SNORM=69]="BC4_SNORM",t[t.BC5_UNORM=70]="BC5_UNORM",t[t.BC5_SNORM=71]="BC5_SNORM",t[t.U16_PACKED_5551=97]="U16_PACKED_5551",t[t.U16_PACKED_565=98]="U16_PACKED_565",t[t.D24=129]="D24",t[t.D32F=130]="D32F",t[t.D24S8=131]="D24S8",t[t.D32FS8=132]="D32FS8"})(zn||(zn={}));var No;(function(t){t[t.R=1]="R",t[t.RG=2]="RG",t[t.RGB=3]="RGB",t[t.RGBA=4]="RGBA",t[t.A=5]="A"})(No||(No={}));function i7(t){return t}var to;(function(t){t[t.None=0]="None",t[t.Normalized=1]="Normalized",t[t.sRGB=2]="sRGB",t[t.Depth=4]="Depth",t[t.Stencil=8]="Stencil",t[t.RenderTarget=16]="RenderTarget",t[t.Luminance=32]="Luminance"})(to||(to={}));function ga(t,e,r){return t<<16|e<<8|r}var yr;(function(t){t[t.ALPHA=ga(zn.U8,No.A,to.None)]="ALPHA",t[t.U8_LUMINANCE=ga(zn.U8,No.A,to.Luminance)]="U8_LUMINANCE",t[t.F16_LUMINANCE=ga(zn.F16,No.A,to.Luminance)]="F16_LUMINANCE",t[t.F32_LUMINANCE=ga(zn.F32,No.A,to.Luminance)]="F32_LUMINANCE",t[t.F16_R=ga(zn.F16,No.R,to.None)]="F16_R",t[t.F16_RG=ga(zn.F16,No.RG,to.None)]="F16_RG",t[t.F16_RGB=ga(zn.F16,No.RGB,to.None)]="F16_RGB",t[t.F16_RGBA=ga(zn.F16,No.RGBA,to.None)]="F16_RGBA",t[t.F32_R=ga(zn.F32,No.R,to.None)]="F32_R",t[t.F32_RG=ga(zn.F32,No.RG,to.None)]="F32_RG",t[t.F32_RGB=ga(zn.F32,No.RGB,to.None)]="F32_RGB",t[t.F32_RGBA=ga(zn.F32,No.RGBA,to.None)]="F32_RGBA",t[t.U8_R=ga(zn.U8,No.R,to.None)]="U8_R",t[t.U8_R_NORM=ga(zn.U8,No.R,to.Normalized)]="U8_R_NORM",t[t.U8_RG=ga(zn.U8,No.RG,to.None)]="U8_RG",t[t.U8_RG_NORM=ga(zn.U8,No.RG,to.Normalized)]="U8_RG_NORM",t[t.U8_RGB=ga(zn.U8,No.RGB,to.None)]="U8_RGB",t[t.U8_RGB_NORM=ga(zn.U8,No.RGB,to.Normalized)]="U8_RGB_NORM",t[t.U8_RGB_SRGB=ga(zn.U8,No.RGB,to.sRGB|to.Normalized)]="U8_RGB_SRGB",t[t.U8_RGBA=ga(zn.U8,No.RGBA,to.None)]="U8_RGBA",t[t.U8_RGBA_NORM=ga(zn.U8,No.RGBA,to.Normalized)]="U8_RGBA_NORM",t[t.U8_RGBA_SRGB=ga(zn.U8,No.RGBA,to.sRGB|to.Normalized)]="U8_RGBA_SRGB",t[t.U16_R=ga(zn.U16,No.R,to.None)]="U16_R",t[t.U16_R_NORM=ga(zn.U16,No.R,to.Normalized)]="U16_R_NORM",t[t.U16_RG_NORM=ga(zn.U16,No.RG,to.Normalized)]="U16_RG_NORM",t[t.U16_RGBA_NORM=ga(zn.U16,No.RGBA,to.Normalized)]="U16_RGBA_NORM",t[t.U16_RGBA=ga(zn.U16,No.RGBA,to.None)]="U16_RGBA",t[t.U16_RGB=ga(zn.U16,No.RGB,to.None)]="U16_RGB",t[t.U16_RG=ga(zn.U16,No.RG,to.None)]="U16_RG",t[t.U32_R=ga(zn.U32,No.R,to.None)]="U32_R",t[t.U32_RG=ga(zn.U32,No.RG,to.None)]="U32_RG",t[t.U32_RGB=ga(zn.U32,No.RGB,to.None)]="U32_RGB",t[t.U32_RGBA=ga(zn.U32,No.RGBA,to.None)]="U32_RGBA",t[t.S8_R=ga(zn.S8,No.R,to.None)]="S8_R",t[t.S8_R_NORM=ga(zn.S8,No.R,to.Normalized)]="S8_R_NORM",t[t.S8_RG_NORM=ga(zn.S8,No.RG,to.Normalized)]="S8_RG_NORM",t[t.S8_RGB_NORM=ga(zn.S8,No.RGB,to.Normalized)]="S8_RGB_NORM",t[t.S8_RGBA_NORM=ga(zn.S8,No.RGBA,to.Normalized)]="S8_RGBA_NORM",t[t.S16_R=ga(zn.S16,No.R,to.None)]="S16_R",t[t.S16_RG=ga(zn.S16,No.RG,to.None)]="S16_RG",t[t.S16_RG_NORM=ga(zn.S16,No.RG,to.Normalized)]="S16_RG_NORM",t[t.S16_RGB_NORM=ga(zn.S16,No.RGB,to.Normalized)]="S16_RGB_NORM",t[t.S16_RGBA=ga(zn.S16,No.RGBA,to.None)]="S16_RGBA",t[t.S16_RGBA_NORM=ga(zn.S16,No.RGBA,to.Normalized)]="S16_RGBA_NORM",t[t.S32_R=ga(zn.S32,No.R,to.None)]="S32_R",t[t.S32_RG=ga(zn.S32,No.RG,to.None)]="S32_RG",t[t.S32_RGB=ga(zn.S32,No.RGB,to.None)]="S32_RGB",t[t.S32_RGBA=ga(zn.S32,No.RGBA,to.None)]="S32_RGBA",t[t.U16_RGBA_5551=ga(zn.U16_PACKED_5551,No.RGBA,to.Normalized)]="U16_RGBA_5551",t[t.U16_RGB_565=ga(zn.U16_PACKED_565,No.RGB,to.Normalized)]="U16_RGB_565",t[t.BC1=ga(zn.BC1,No.RGBA,to.Normalized)]="BC1",t[t.BC1_SRGB=ga(zn.BC1,No.RGBA,to.Normalized|to.sRGB)]="BC1_SRGB",t[t.BC2=ga(zn.BC2,No.RGBA,to.Normalized)]="BC2",t[t.BC2_SRGB=ga(zn.BC2,No.RGBA,to.Normalized|to.sRGB)]="BC2_SRGB",t[t.BC3=ga(zn.BC3,No.RGBA,to.Normalized)]="BC3",t[t.BC3_SRGB=ga(zn.BC3,No.RGBA,to.Normalized|to.sRGB)]="BC3_SRGB",t[t.BC4_UNORM=ga(zn.BC4_UNORM,No.R,to.Normalized)]="BC4_UNORM",t[t.BC4_SNORM=ga(zn.BC4_SNORM,No.R,to.Normalized)]="BC4_SNORM",t[t.BC5_UNORM=ga(zn.BC5_UNORM,No.RG,to.Normalized)]="BC5_UNORM",t[t.BC5_SNORM=ga(zn.BC5_SNORM,No.RG,to.Normalized)]="BC5_SNORM",t[t.D24=ga(zn.D24,No.R,to.Depth)]="D24",t[t.D24_S8=ga(zn.D24S8,No.RG,to.Depth|to.Stencil)]="D24_S8",t[t.D32F=ga(zn.D32F,No.R,to.Depth)]="D32F",t[t.D32F_S8=ga(zn.D32FS8,No.RG,to.Depth|to.Stencil)]="D32F_S8",t[t.U8_RGB_RT=ga(zn.U8,No.RGB,to.RenderTarget|to.Normalized)]="U8_RGB_RT",t[t.U8_RGBA_RT=ga(zn.U8,No.RGBA,to.RenderTarget|to.Normalized)]="U8_RGBA_RT",t[t.U8_RGBA_RT_SRGB=ga(zn.U8,No.RGBA,to.RenderTarget|to.Normalized|to.sRGB)]="U8_RGBA_RT_SRGB"})(yr||(yr={}));function z1(t){return t>>>8&255}function ig(t){return t>>>16&255}function Y0(t){return t&255}function Q3(t){switch(t){case zn.F32:case zn.U32:case zn.S32:return 4;case zn.U16:case zn.S16:case zn.F16:return 2;case zn.U8:case zn.S8:return 1;default:throw new Error("whoops")}}function eS(t){return Q3(ig(t))}function o7(t){return z1(t)}function $I(t){var e=Q3(ig(t)),r=z1(t);return e*r}function a7(t,e){return t&4294967040|e}function s7(t,e){return t&4294902015|e<<8}function tS(t){var e=Y0(t);if(e&to.Depth)return Hh.Depth;if(e&to.Normalized)return Hh.Float;var r=ig(t);if(r===zn.F16||r===zn.F32)return Hh.Float;if(r===zn.U8||r===zn.U16||r===zn.U32)return Hh.Uint;if(r===zn.S8||r===zn.S16||r===zn.S32)return Hh.Sint;throw new Error("whoops")}function Cs(t,e){if(e===void 0&&(e=""),!t)throw new Error("Assert fail: ".concat(e))}function s0(t){if(t!=null)return t;throw new Error("Missing object")}function rS(t,e){return t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a}function nS(t,e){t.r=e.r,t.g=e.g,t.b=e.b,t.a=e.a}function iS(t){var e=t.r,r=t.g,n=t.b,a=t.a;return{r:e,g:r,b:n,a}}function b_(t,e,r,n){return n===void 0&&(n=1),{r:t,g:e,b:r,a:n}}var U1=b_(0,0,0,0),l7=b_(0,0,0,1),KI=b_(1,1,1,0),u7=b_(1,1,1,1),$0=!0;function c7(t,e){e===void 0&&(e=$0),e&&(t[10]=-t[10],t[14]=-t[14])}function h7(t,e){e===void 0&&(e=$0),e&&(t[10]=-t[10],t[14]=-t[14]+1)}function JI(t,e){if(e===void 0&&(e=$0),e)switch(t){case js.LESS:return js.GREATER;case js.LEQUAL:return js.GEQUAL;case js.GEQUAL:return js.LEQUAL;case js.GREATER:return js.LESS;default:return t}else return t}function p7(t,e){return e===void 0&&(e=$0),e?1-t:t}function f7(t,e){return e===void 0&&(e=$0),e?-t:t}function d7(t,e,r,n){if(n===void 0&&(n=$0),r=JI(r,n),r===js.LESS)return te;if(r===js.GEQUAL)return t>=e;throw new Error("whoops")}function Z1(t){return!!(t&&!(t&t-1))}function K0(t,e){return t!=null?t:e}function QI(t){return t===void 0?null:t}function m7(t,e,r){t.length=e,t.fill(r)}function V1(t,e){var r=e-1;return t+r&~r}function g7(t,e){return((t+e-1)/e|0)*e}function e6(t,e,r){for(var n=0,a=t.length;n>>1),y=r(e,t[u]);y<0?a=u:n=u+1}return n}function v7(t,e,r){var n=e6(t,e,r);t.splice(n,0,e)}function _7(t,e,r){return r?t|=e:t&=~e,t}function t6(t,e){for(var r=new Array(t),n=0;n-1;if(O=O.replace(";","").replace("[","").trim(),!A.startsWith("#")){if(A){var Y=r.find(function(xe){return A===xe.type});if(Y)if(Z)for(var Q=function(xe){Y.uniforms.forEach(function(Be){e.push("".concat(O,"[").concat(xe,"].").concat(Be.name))})},ae=0;ae<5;ae++)Q(ae);else Y.uniforms.forEach(function(xe){e.push("".concat(O,".").concat(xe.name))})}O&&e.push(O)}}),""}),e}function mS(t){if(t===void 0)return null;var e=/binding\s*=\s*(\d+)/.exec(t);if(e!==null){var r=parseInt(e[1],10);if(!Number.isNaN(r))return r}return null}function gS(t){var e="",r=t;return[r,e]}function Ug(t,e,r,n,a){var u;n===void 0&&(n=null),a===void 0&&(a=!0);var y=t.glslVersion==="#version 100",A=e==="frag"&&((u=r.match(/^\s*layout\(location\s*=\s*\d*\)\s*out\s+vec4\s*(.*);$/gm))===null||u===void 0?void 0:u.length)>1,O=r.replace(`\r `,` `).split(` `).map(function(cn){return cn.replace(/[/][/].*$/,"")}).filter(function(cn){var Gr=!cn||/^\s+$/.test(cn);return!Gr}),Z="";n!==null&&(Z=Object.keys(n).map(function(cn){return E_(cn,n[cn])}).join(` `));var Y=O.find(function(cn){return cn.startsWith("precision")})||"precision mediump float;",Q=a?O.filter(function(cn){return!cn.startsWith("precision")}).join(` `):O.join(` `),ae="";if(t.viewportOrigin===ng.UPPER_LEFT&&(ae+="".concat(E_("VIEWPORT_ORIGIN_TL","1"),` `)),t.clipSpaceNearZ===q0.ZERO&&(ae+="".concat(E_("CLIPSPACE_NEAR_ZERO","1"),` `)),t.explicitBindingLocations){var xe=0,Be=0,it=0;Q=Q.replace(/^\s*(layout\((.*)\))?\s*uniform(.+{)$/gm,function(cn,Gr,Pn,Oo){var Da=Pn?"".concat(Pn,", "):"";return"layout(".concat(Da,"set = ").concat(xe,", binding = ").concat(Be++,") uniform ").concat(Oo)}),xe++,Be=0,Cs(t.separateSamplerTextures),Q=Q.replace(/^\s*(layout\((.*)\))?\s*uniform sampler(\w+) (.*);/gm,function(cn,Gr,Pn,Oo,Da){var Bo=mS(Pn);Bo===null&&(Bo=Be++);var Oa=(0,wo.__read)(gS(Oo),2),fl=Oa[0],Gp=Oa[1];return e==="frag"?` layout(set = `.concat(xe,", binding = ").concat(Bo*2+0,") uniform texture").concat(fl," T_").concat(Da,`; layout(set = `).concat(xe,", binding = ").concat(Bo*2+1,") uniform sampler").concat(Gp," S_").concat(Da,";").trim():""}),Q=Q.replace(e==="frag"?/^\s*\b(varying|in)\b/gm:/^\s*\b(varying|out)\b/gm,function(cn,Gr){return"layout(location = ".concat(it++,") ").concat(Gr)}),ae+="".concat(E_("gl_VertexID","gl_VertexIndex"),` `),ae+="".concat(E_("gl_InstanceID","gl_InstanceIndex"),` `),Y=Y.replace(/^precision (.*) sampler(.*);$/gm,"")}else{var gt=0;Q=Q.replace(/^\s*(layout\((.*)\))?\s*uniform sampler(\w+) (.*);/gm,function(cn,Gr,Pn,Oo,Da){var Bo=mS(Pn);return Bo===null&&(Bo=gt++),"uniform sampler".concat(Oo," ").concat(Da,"; // BINDING=").concat(Bo)})}if(Q=Q.replace(/\bPU_SAMPLER_(\w+)\((.*?)\)/g,function(cn,Gr,Pn){return"SAMPLER_".concat(Gr,"(P_").concat(Pn,")")}),Q=Q.replace(/\bPF_SAMPLER_(\w+)\((.*?)\)/g,function(cn,Gr,Pn){return"PP_SAMPLER_".concat(Gr,"(P_").concat(Pn,")")}),Q=Q.replace(/\bPU_TEXTURE\((.*?)\)/g,function(cn,Gr){return"TEXTURE(P_".concat(Gr,")")}),t.separateSamplerTextures)Q=Q.replace(/\bPD_SAMPLER_(\w+)\((.*?)\)/g,function(cn,Gr,Pn){var Oo=(0,wo.__read)(gS(Gr),2),Da=Oo[0],Bo=Oo[1];return"texture".concat(Da," T_P_").concat(Pn,", sampler").concat(Bo," S_P_").concat(Pn)}),Q=Q.replace(/\bPP_SAMPLER_(\w+)\((.*?)\)/g,function(cn,Gr,Pn){return"T_".concat(Pn,", S_").concat(Pn)}),Q=Q.replace(/\bSAMPLER_(\w+)\((.*?)\)/g,function(cn,Gr,Pn){return"sampler".concat(Gr,"(T_").concat(Pn,", S_").concat(Pn,")")}),Q=Q.replace(/\bTEXTURE\((.*?)\)/g,function(cn,Gr){return"T_".concat(Gr)});else{var Bt=[];Q=Q.replace(/\bPD_SAMPLER_(\w+)\((.*?)\)/g,function(cn,Gr,Pn){return"sampler".concat(Gr," P_").concat(Pn)}),Q=Q.replace(/\bPP_SAMPLER_(\w+)\((.*?)\)/g,function(cn,Gr,Pn){return Pn}),Q=Q.replace(/\bSAMPLER_(\w+)\((.*?)\)/g,function(cn,Gr,Pn){return Bt.push([Pn,Gr]),Pn}),y&&Bt.forEach(function(cn){var Gr=(0,wo.__read)(cn,2),Pn=Gr[0],Oo=Gr[1];Q=Q.replace(new RegExp("texture\\(".concat(Pn),"g"),function(){return"texture".concat(Oo,"(").concat(Pn)})}),Q=Q.replace(/\bTEXTURE\((.*?)\)/g,function(cn,Gr){return Gr})}var Rt="".concat(y?"":t.glslVersion,` `).concat(y&&A?`#extension GL_EXT_draw_buffers : require `:"",` `).concat(y&&e==="frag"?`#extension GL_OES_standard_derivatives : enable `:"").concat(a?Y:"",` `).concat(ae||"").concat(Z?Z+` `:"",` `).concat(Q,` `).trim();if(t.explicitBindingLocations&&e==="frag"&&(Rt=Rt.replace(/^\b(out)\b/g,function(cn,Gr){return"layout(location = 0) ".concat(Gr)})),y){if(e==="frag"&&(Rt=Rt.replace(/^\s*in\s+(\S+)\s*(.*);$/gm,function(cn,Gr,Pn){return"varying ".concat(Gr," ").concat(Pn,`; `)})),e==="vert"&&(Rt=Rt.replace(/^\s*out\s+(\S+)\s*(.*);$/gm,function(cn,Gr,Pn){return"varying ".concat(Gr," ").concat(Pn,`; `)}),Rt=Rt.replace(/^\s*layout\(location\s*=\s*\S*\)\s*in\s+(\S+)\s*(.*);$/gm,function(cn,Gr,Pn){return"attribute ".concat(Gr," ").concat(Pn,`; `)})),Rt=Rt.replace(/\s*uniform\s*.*\s*{((?:\s*.*\s*)*?)};/g,function(cn,Gr){return Gr.trim().replace(/^.*$/gm,function(Pn){var Oo=Pn.trim();return Oo.startsWith("#")?Oo:Pn?"uniform ".concat(Oo):""})}),e==="frag")if(A){var Yt=[];Rt=Rt.replace(/^\s*layout\(location\s*=\s*\d*\)\s*out\s+vec4\s*(.*);$/gm,function(cn,Gr){return Yt.push(Gr),"vec4 ".concat(Gr,`; `)});var vr=Rt.lastIndexOf("}");Rt=Rt.substring(0,vr)+` `.concat(Yt.map(function(cn,Gr){return"gl_FragData[".concat(Gr,"] = ").concat(cn,`; `)}).join(` `))+Rt.substring(vr)}else{var ln;if(Rt=Rt.replace(/^\s*out\s+(\S+)\s*(.*);$/gm,function(cn,Gr,Pn){return ln=Pn,"".concat(Gr," ").concat(Pn,`; `)}),ln){var vr=Rt.lastIndexOf("}");Rt=Rt.substring(0,vr)+` gl_FragColor = vec4(`.concat(ln,`); `)+Rt.substring(vr)}}Rt=Rt.replace(/^\s*layout\((.*)\)/gm,"")}return Rt}function S7(t,e,r,n){n===void 0&&(n=null);var a=Ug(t,"vert",e,n),u=Ug(t,"frag",r,n);return{vert:e,frag:r,preprocessedVert:a,preprocessedFrag:u}}var Om=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=t.call(this)||this;return u.id=n,u.device=a,u.device.resourceCreationTracker!==null&&u.device.resourceCreationTracker.trackResourceCreated(u),u}return e.prototype.destroy=function(){this.device.resourceCreationTracker!==null&&this.device.resourceCreationTracker.trackResourceDestroyed(this)},e}(K3),O6=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=t.call(this,{id:n,device:a})||this;y.type=Jl.Bindings;var A=u.uniformBufferBindings,O=u.samplerBindings;return y.uniformBufferBindings=A||[],y.samplerBindings=O||[],y.bindingLayouts=y.createBindingLayouts(),y}return e.prototype.createBindingLayouts=function(){var r=0,n=0,a=[],u=this.uniformBufferBindings.length,y=this.samplerBindings.length;return a.push({firstUniformBuffer:r,numUniformBuffers:u,firstSampler:n,numSamplers:y}),r+=u,n+=y,{numUniformBuffers:r,numSamplers:n,bindingLayoutTables:a}},e}(Om);function ea(t){return typeof WebGL2RenderingContext!="undefined"&&t instanceof WebGL2RenderingContext?!0:!!(t&&t._version===2)}function vS(t){var e=ig(t);switch(e){case zn.BC1:case zn.BC2:case zn.BC3:case zn.BC4_UNORM:case zn.BC4_SNORM:case zn.BC5_UNORM:case zn.BC5_SNORM:return!0;default:return!1}}function _S(t){var e=Y0(t);if(e&to.Normalized)return!1;var r=ig(t);return r===zn.S8||r===zn.S16||r===zn.S32||r===zn.U8||r===zn.U16||r===zn.U32}function B6(t){switch(t){case Gm.STATIC:return qt.STATIC_DRAW;case Gm.DYNAMIC:return qt.DYNAMIC_DRAW}}function yS(t){if(t&ac.INDEX)return qt.ELEMENT_ARRAY_BUFFER;if(t&ac.VERTEX)return qt.ARRAY_BUFFER;if(t&ac.UNIFORM)return qt.UNIFORM_BUFFER}function F6(t){switch(t){case Ip.TRIANGLES:return qt.TRIANGLES;case Ip.POINTS:return qt.POINTS;case Ip.TRIANGLE_STRIP:return qt.TRIANGLE_STRIP;case Ip.LINES:return qt.LINES;case Ip.LINE_STRIP:return qt.LINE_STRIP;default:throw new Error("Unknown primitive topology mode")}}function k6(t){switch(t){case zn.U8:return qt.UNSIGNED_BYTE;case zn.U16:return qt.UNSIGNED_SHORT;case zn.U32:return qt.UNSIGNED_INT;case zn.S8:return qt.BYTE;case zn.S16:return qt.SHORT;case zn.S32:return qt.INT;case zn.F16:return qt.HALF_FLOAT;case zn.F32:return qt.FLOAT;default:throw new Error("whoops")}}function N6(t){switch(t){case No.R:return 1;case No.RG:return 2;case No.RGB:return 3;case No.RGBA:return 4;default:return 1}}function z6(t){var e=ig(t),r=z1(t),n=Y0(t),a=k6(e),u=N6(r),y=!!(n&to.Normalized);return{size:u,type:a,normalized:y}}function U6(t){switch(t){case yr.U8_R:return qt.UNSIGNED_BYTE;case yr.U16_R:return qt.UNSIGNED_SHORT;case yr.U32_R:return qt.UNSIGNED_INT;default:throw new Error("whoops")}}function w_(t){switch(t){case Id.CLAMP_TO_EDGE:return qt.CLAMP_TO_EDGE;case Id.REPEAT:return qt.REPEAT;case Id.MIRRORED_REPEAT:return qt.MIRRORED_REPEAT;default:throw new Error("whoops")}}function W1(t,e){if(e===df.LINEAR&&t===pp.BILINEAR)return qt.LINEAR_MIPMAP_LINEAR;if(e===df.LINEAR&&t===pp.POINT)return qt.NEAREST_MIPMAP_LINEAR;if(e===df.NEAREST&&t===pp.BILINEAR)return qt.LINEAR_MIPMAP_NEAREST;if(e===df.NEAREST&&t===pp.POINT)return qt.NEAREST_MIPMAP_NEAREST;if(e===df.NO_MIP&&t===pp.BILINEAR)return qt.LINEAR;if(e===df.NO_MIP&&t===pp.POINT)return qt.NEAREST;throw new Error("Unknown texture filter mode")}function ev(t,e){e===void 0&&(e=0);var r=t;return r.gl_buffer_pages[e/r.pageByteSize|0]}function tv(t){var e=t;return e.gl_texture}function $2(t){var e=t;return e.gl_sampler}function S_(t,e){t.name=e,t.__SPECTOR_Metadata={name:e}}function xS(t,e){for(var r=[];;){var n=e.exec(t);if(!n)break;r.push(n)}return r}function Zg(t){return t.blendMode==If.ADD&&t.blendSrcFactor==pl.ONE&&t.blendDstFactor===pl.ZERO}function Z6(t){switch(t){case N1.OcclusionConservative:return qt.ANY_SAMPLES_PASSED_CONSERVATIVE;default:throw new Error("whoops")}}function V6(t){if(t===rl.TEXTURE_2D)return qt.TEXTURE_2D;if(t===rl.TEXTURE_2D_ARRAY)return qt.TEXTURE_2D_ARRAY;if(t===rl.TEXTURE_CUBE_MAP)return qt.TEXTURE_CUBE_MAP;if(t===rl.TEXTURE_3D)return qt.TEXTURE_3D;throw new Error("whoops")}function K2(t,e,r,n){return!(t%r!==0||e%n!==0)}var j6=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=t.call(this,{id:n,device:a})||this;y.type=Jl.Buffer;var A=u.viewOrSize,O=u.usage,Z=u.hint,Y=Z===void 0?Gm.STATIC:Z,Q=a.uniformBufferMaxPageByteSize,ae=a.gl,xe=O&ac.UNIFORM;xe||(ea(ae)?ae.bindVertexArray(null):a.OES_vertex_array_object.bindVertexArrayOES(null));var Be=(0,X0.Z)(A)?V1(A,4):V1(A.byteLength,4);y.gl_buffer_pages=[];var it;if(xe){for(var gt=Be;gt>0;)y.gl_buffer_pages.push(y.createBufferPage(Math.min(gt,Q),O,Y)),gt-=Q;it=Q}else y.gl_buffer_pages.push(y.createBufferPage(Be,O,Y)),it=Be;return y.pageByteSize=it,y.byteSize=Be,y.usage=O,y.gl_target=yS(O),(0,X0.Z)(A)||y.setSubData(0,new Uint8Array(A.buffer)),xe||(ea(ae)?ae.bindVertexArray(y.device.currentBoundVAO):a.OES_vertex_array_object.bindVertexArrayOES(y.device.currentBoundVAO)),y}return e.prototype.setSubData=function(r,n,a,u){a===void 0&&(a=0),u===void 0&&(u=n.byteLength-a);for(var y=this.device.gl,A=this.pageByteSize,O=r+u,Z=r,Y=r%A;Z=1,!y){Y=A.device.ensureResourceExists(O.createTexture());var ae=A.device.translateTextureType(u.format),xe=A.device.translateTextureInternalFormat(u.format);if(A.device.setActiveTexture(O.TEXTURE0),A.device.currentTextures[0]=null,A.preprocessImage(),u.dimension===rl.TEXTURE_2D){if(Z=qt.TEXTURE_2D,O.bindTexture(Z,Y),A.immutable)if(ea(O))O.texStorage2D(Z,Q,xe,u.width,u.height);else{var Be=(xe===qt.DEPTH_COMPONENT||A.isNPOT(),0);(A.format===yr.D32F||A.format===yr.D24_S8)&&!ea(O)&&!a.WEBGL_depth_texture||(O.texImage2D(Z,Be,xe,u.width,u.height,0,xe,ae,null),A.mipmaps&&(A.mipmaps=!1,O.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_MIN_FILTER,qt.LINEAR),O.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_WRAP_S,qt.CLAMP_TO_EDGE),O.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_WRAP_T,qt.CLAMP_TO_EDGE)))}Cs(u.depthOrArrayLayers===1)}else if(u.dimension===rl.TEXTURE_2D_ARRAY)Z=qt.TEXTURE_2D_ARRAY,O.bindTexture(Z,Y),A.immutable&&ea(O)&&O.texStorage3D(Z,Q,xe,u.width,u.height,u.depthOrArrayLayers);else if(u.dimension===rl.TEXTURE_3D)Z=qt.TEXTURE_3D,O.bindTexture(Z,Y),A.immutable&&ea(O)&&O.texStorage3D(Z,Q,xe,u.width,u.height,u.depthOrArrayLayers);else if(u.dimension===rl.TEXTURE_CUBE_MAP)Z=qt.TEXTURE_CUBE_MAP,O.bindTexture(Z,Y),A.immutable&&ea(O)&&O.texStorage2D(Z,Q,xe,u.width,u.height),Cs(u.depthOrArrayLayers===6);else throw new Error("whoops")}return A.gl_texture=Y,A.gl_target=Z,A.mipLevelCount=Q,A}return e.prototype.setImageData=function(r,n){n===void 0&&(n=0);var a=this.device.gl;vS(this.format);var u=this.gl_target===qt.TEXTURE_3D||this.gl_target===qt.TEXTURE_2D_ARRAY,y=this.gl_target===qt.TEXTURE_CUBE_MAP,A=I6(r[0]);this.device.setActiveTexture(a.TEXTURE0),this.device.currentTextures[0]=null;var O=r[0],Z,Y;A?(Z=this.width,Y=this.height):(Z=O.width,Y=O.height,this.width=Z,this.height=Y),a.bindTexture(this.gl_target,this.gl_texture);var Q=this.device.translateTextureFormat(this.format),ae=ea(a)?this.device.translateInternalTextureFormat(this.format):Q,xe=this.device.translateTextureType(this.format);this.preprocessImage();for(var Be=0;Be1){var n=ig(r.format);if(n===zn.BC1)for(var a=r.width,u=r.height,y=0;y1?A.renderbufferStorageMultisample(qt.RENDERBUFFER,ae,it,Z,Y):A.renderbufferStorage(qt.RENDERBUFFER,it,Z,Y)}return y.format=O,y.width=Z,y.height=Y,y.sampleCount=ae,y}return e.prototype.destroy=function(){t.prototype.destroy.call(this),this.gl_renderbuffer!==null&&this.device.gl.deleteRenderbuffer(this.gl_renderbuffer),this.texture&&this.texture.destroy()},e}(Om),Qd;(function(t){t[t.NeedsCompile=0]="NeedsCompile",t[t.Compiling=1]="Compiling",t[t.NeedsBind=2]="NeedsBind",t[t.ReadyToUse=3]="ReadyToUse"})(Qd||(Qd={}));var W6=function(t){(0,wo.__extends)(e,t);function e(r,n){var a=r.id,u=r.device,y=r.descriptor,A=t.call(this,{id:a,device:u})||this;A.rawVertexGLSL=n,A.type=Jl.Program,A.uniformSetters={},A.attributes=[];var O=A.device.gl;return A.descriptor=y,A.gl_program=A.device.ensureResourceExists(O.createProgram()),A.gl_shader_vert=null,A.gl_shader_frag=null,A.compileState=Qd.NeedsCompile,A.tryCompileProgram(),A}return e.prototype.destroy=function(){t.prototype.destroy.call(this),this.device.gl.deleteProgram(this.gl_program),this.device.gl.deleteShader(this.gl_shader_vert),this.device.gl.deleteShader(this.gl_shader_frag)},e.prototype.tryCompileProgram=function(){Cs(this.compileState===Qd.NeedsCompile);var r=this.descriptor,n=r.vertex,a=r.fragment,u=this.device.gl;n!=null&&n.glsl&&(a!=null&&a.glsl)&&(this.gl_shader_vert=this.compileShader(n.postprocess?n.postprocess(n.glsl):n.glsl,u.VERTEX_SHADER),this.gl_shader_frag=this.compileShader(a.postprocess?a.postprocess(a.glsl):a.glsl,u.FRAGMENT_SHADER),u.attachShader(this.gl_program,this.gl_shader_vert),u.attachShader(this.gl_program,this.gl_shader_frag),u.linkProgram(this.gl_program),this.compileState=Qd.Compiling,ea(u)||(this.readUniformLocationsFromLinkedProgram(),this.readAttributesFromLinkedProgram()))},e.prototype.readAttributesFromLinkedProgram=function(){for(var r,n=this.device.gl,a=n.getProgramParameter(this.gl_program,n.ACTIVE_ATTRIBUTES),u=L6(this.descriptor.vertex.glsl),y=D6(this.rawVertexGLSL,u),A=function(Y){var Q=n.getActiveAttrib(O.gl_program,Y),ae=Q.name,xe=Q.type,Be=Q.size,it=n.getAttribLocation(O.gl_program,ae),gt=(r=y.find(function(Bt){return Bt.name===ae}))===null||r===void 0?void 0:r.location;it>=0&&!(0,Dm.Z)(gt)&&(O.attributes[gt]={name:ae,location:it,type:xe,size:Be})},O=this,Z=0;Z1)for(var O=0;O1&&O.device.EXT_texture_filter_anisotropic!==null&&(Cs(u.minFilter===pp.BILINEAR&&u.magFilter===pp.BILINEAR&&u.mipmapFilter===df.LINEAR),Z.samplerParameterf(Y,O.device.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Q)),O.gl_sampler=Y}else O.descriptor=u;return O}return e.prototype.setTextureParameters=function(r,n,a){var u,y=this.device.gl,A=this.descriptor;this.isNPOT(n,a)?y.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_MIN_FILTER,qt.LINEAR):y.texParameteri(r,qt.TEXTURE_MIN_FILTER,W1(A.minFilter,A.mipmapFilter)),y.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_WRAP_S,w_(A.addressModeU)),y.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_WRAP_T,w_(A.addressModeV)),y.texParameteri(r,qt.TEXTURE_MAG_FILTER,W1(A.magFilter,df.NO_MIP));var O=(u=A.maxAnisotropy)!==null&&u!==void 0?u:1;O>1&&this.device.EXT_texture_filter_anisotropic!==null&&(Cs(A.minFilter===pp.BILINEAR&&A.magFilter===pp.BILINEAR&&A.mipmapFilter===df.LINEAR),y.texParameteri(r,this.device.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT,O))},e.prototype.destroy=function(){t.prototype.destroy.call(this),ea(this.device.gl)&&this.device.gl.deleteSampler($2(this))},e.prototype.isNPOT=function(r,n){return!Z1(r)||!Z1(n)},e}(Om),Q6=function(){function t(){}return t.prototype.dispatchWorkgroups=function(e,r,n){},t.prototype.dispatchWorkgroupsIndirect=function(e,r){},t.prototype.setPipeline=function(e){},t.prototype.setBindings=function(e){},t.prototype.pushDebugGroup=function(e){},t.prototype.popDebugGroup=function(){},t.prototype.insertDebugMarker=function(e){},t}(),eL=function(t){(0,wo.__extends)(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Jl.RenderBundle,r.commands=[],r}return e.prototype.push=function(r){this.commands.push(r)},e.prototype.replay=function(){this.commands.forEach(function(r){return r()})},e}(Om),bS=65536,tL=/uniform(?:\s+)(\w+)(?:\s?){([^]*?)}/g,rL=function(){function t(e,r){r===void 0&&(r={}),this.shaderDebug=!1,this.OES_vertex_array_object=null,this.ANGLE_instanced_arrays=null,this.OES_texture_float=null,this.OES_draw_buffers_indexed=null,this.WEBGL_draw_buffers=null,this.WEBGL_depth_texture=null,this.WEBGL_color_buffer_float=null,this.EXT_color_buffer_half_float=null,this.WEBGL_compressed_texture_s3tc=null,this.WEBGL_compressed_texture_s3tc_srgb=null,this.EXT_texture_compression_rgtc=null,this.EXT_texture_filter_anisotropic=null,this.KHR_parallel_shader_compile=null,this.EXT_texture_norm16=null,this.EXT_color_buffer_float=null,this.OES_texture_float_linear=null,this.OES_texture_half_float_linear=null,this.scTexture=null,this.scPlatformFramebuffer=null,this.currentActiveTexture=null,this.currentBoundVAO=null,this.currentProgram=null,this.resourceCreationTracker=null,this.resourceUniqueId=0,this.currentColorAttachments=[],this.currentColorAttachmentLevels=[],this.currentColorResolveTos=[],this.currentColorResolveToLevels=[],this.currentSampleCount=-1,this.currentIndexBufferByteOffset=null,this.currentMegaState=J0(l0),this.currentSamplers=[],this.currentTextures=[],this.currentUniformBuffers=[],this.currentUniformBufferByteOffsets=[],this.currentUniformBufferByteSizes=[],this.currentScissorEnabled=!1,this.currentStencilRef=null,this.currentRenderPassDescriptor=null,this.currentRenderPassDescriptorStack=[],this.debugGroupStack=[],this.resolveColorAttachmentsChanged=!1,this.resolveDepthStencilAttachmentsChanged=!1,this.explicitBindingLocations=!1,this.separateSamplerTextures=!1,this.viewportOrigin=ng.LOWER_LEFT,this.clipSpaceNearZ=q0.NEGATIVE_ONE,this.supportMRT=!1,this.inBlitRenderPass=!1,this.supportedSampleCounts=[],this.occlusionQueriesRecommended=!1,this.computeShadersSupported=!1,this.gl=e,this.contextAttributes=s0(e.getContextAttributes()),ea(e)?(this.EXT_texture_norm16=e.getExtension("EXT_texture_norm16"),this.EXT_color_buffer_float=e.getExtension("EXT_color_buffer_float")):(this.OES_vertex_array_object=e.getExtension("OES_vertex_array_object"),this.ANGLE_instanced_arrays=e.getExtension("ANGLE_instanced_arrays"),this.OES_texture_float=e.getExtension("OES_texture_float"),this.WEBGL_draw_buffers=e.getExtension("WEBGL_draw_buffers"),this.WEBGL_depth_texture=e.getExtension("WEBGL_depth_texture"),this.WEBGL_color_buffer_float=e.getExtension("WEBGL_color_buffer_float"),this.EXT_color_buffer_half_float=e.getExtension("EXT_color_buffer_half_float"),e.getExtension("EXT_frag_depth"),e.getExtension("OES_element_index_uint"),e.getExtension("OES_standard_derivatives")),this.WEBGL_compressed_texture_s3tc=e.getExtension("WEBGL_compressed_texture_s3tc"),this.WEBGL_compressed_texture_s3tc_srgb=e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),this.EXT_texture_compression_rgtc=e.getExtension("EXT_texture_compression_rgtc"),this.EXT_texture_filter_anisotropic=e.getExtension("EXT_texture_filter_anisotropic"),this.EXT_texture_norm16=e.getExtension("EXT_texture_norm16"),this.OES_texture_float_linear=e.getExtension("OES_texture_float_linear"),this.OES_texture_half_float_linear=e.getExtension("OES_texture_half_float_linear"),this.KHR_parallel_shader_compile=e.getExtension("KHR_parallel_shader_compile"),ea(e)?(this.platformString="WebGL2",this.glslVersion="#version 300 es"):(this.platformString="WebGL1",this.glslVersion="#version 100"),this.scTexture=new J2({id:this.getNextUniqueId(),device:this,descriptor:{width:0,height:0,depthOrArrayLayers:1,dimension:rl.TEXTURE_2D,mipLevelCount:1,usage:ad.RENDER_TARGET,format:this.contextAttributes.alpha===!1?yr.U8_RGB_RT:yr.U8_RGBA_RT},fake:!0}),this.scTexture.formatKind=Hh.Float,this.scTexture.gl_target=null,this.scTexture.gl_texture=null,this.resolveColorReadFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.resolveColorDrawFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.resolveDepthStencilReadFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.resolveDepthStencilDrawFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.renderPassDrawFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.readbackFramebuffer=this.ensureResourceExists(e.createFramebuffer()),this.fallbackTexture2D=this.createFallbackTexture(rl.TEXTURE_2D,Hh.Float),this.fallbackTexture2DDepth=this.createFallbackTexture(rl.TEXTURE_2D,Hh.Depth),this.fallbackVertexBuffer=this.createBuffer({viewOrSize:1,usage:ac.VERTEX,hint:Gm.STATIC}),ea(e)&&(this.fallbackTexture2DArray=this.createFallbackTexture(rl.TEXTURE_2D_ARRAY,Hh.Float),this.fallbackTexture3D=this.createFallbackTexture(rl.TEXTURE_3D,Hh.Float),this.fallbackTextureCube=this.createFallbackTexture(rl.TEXTURE_CUBE_MAP,Hh.Float)),this.currentMegaState.depthCompare=js.LESS,this.currentMegaState.depthWrite=!1,this.currentMegaState.attachmentsState[0].channelWriteMask=Lf.ALL,e.enable(e.DEPTH_TEST),e.enable(e.STENCIL_TEST),this.checkLimits(),r.shaderDebug&&(this.shaderDebug=!0),r.trackResources&&(this.resourceCreationTracker=new K6)}return t.prototype.destroy=function(){this.blitBindings&&this.blitBindings.destroy(),this.blitInputLayout&&this.blitInputLayout.destroy(),this.blitRenderPipeline&&this.blitRenderPipeline.destroy(),this.blitVertexBuffer&&this.blitVertexBuffer.destroy(),this.blitProgram&&this.blitProgram.destroy()},t.prototype.createFallbackTexture=function(e,r){var n=e===rl.TEXTURE_CUBE_MAP?6:1,a=r===Hh.Depth?yr.D32F:yr.U8_RGBA_NORM,u=this.createTexture({dimension:e,format:a,usage:ad.SAMPLED,width:1,height:1,depthOrArrayLayers:n,mipLevelCount:1});return r===Hh.Float&&u.setImageData([new Uint8Array(4*n)]),tv(u)},t.prototype.getNextUniqueId=function(){return++this.resourceUniqueId},t.prototype.checkLimits=function(){var e=this.gl;if(this.maxVertexAttribs=e.getParameter(qt.MAX_VERTEX_ATTRIBS),ea(e)){this.uniformBufferMaxPageByteSize=Math.min(e.getParameter(qt.MAX_UNIFORM_BLOCK_SIZE),bS),this.uniformBufferWordAlignment=e.getParameter(e.UNIFORM_BUFFER_OFFSET_ALIGNMENT)/4;var r=e.getInternalformatParameter(e.RENDERBUFFER,e.DEPTH32F_STENCIL8,e.SAMPLES);this.supportedSampleCounts=r?(0,wo.__spreadArray)([],(0,wo.__read)(r),!1):[],this.occlusionQueriesRecommended=!0}else this.uniformBufferWordAlignment=64,this.uniformBufferMaxPageByteSize=bS;this.uniformBufferMaxPageWordSize=this.uniformBufferMaxPageByteSize/4,this.supportedSampleCounts.includes(1)||this.supportedSampleCounts.push(1),this.supportedSampleCounts.sort(function(n,a){return n-a})},t.prototype.configureSwapChain=function(e,r,n){var a=this.scTexture;a.width=e,a.height=r,this.scPlatformFramebuffer=QI(n)},t.prototype.getDevice=function(){return this},t.prototype.getCanvas=function(){return this.gl.canvas},t.prototype.getOnscreenTexture=function(){return this.scTexture},t.prototype.beginFrame=function(){},t.prototype.endFrame=function(){},t.prototype.translateTextureInternalFormat=function(e,r){switch(r===void 0&&(r=!1),e){case yr.ALPHA:return qt.ALPHA;case yr.U8_LUMINANCE:case yr.F16_LUMINANCE:case yr.F32_LUMINANCE:return qt.LUMINANCE;case yr.F16_R:return qt.R16F;case yr.F16_RG:return qt.RG16F;case yr.F16_RGB:return qt.RGB16F;case yr.F16_RGBA:return qt.RGBA16F;case yr.F32_R:return qt.R32F;case yr.F32_RG:return qt.RG32F;case yr.F32_RGB:return qt.RGB32F;case yr.F32_RGBA:return ea(this.gl)?qt.RGBA32F:r?this.WEBGL_color_buffer_float.RGBA32F_EXT:qt.RGBA;case yr.U8_R_NORM:return qt.R8;case yr.U8_RG_NORM:return qt.RG8;case yr.U8_RGB_NORM:case yr.U8_RGB_RT:return qt.RGB8;case yr.U8_RGB_SRGB:return qt.SRGB8;case yr.U8_RGBA_NORM:case yr.U8_RGBA_RT:return ea(this.gl)?qt.RGBA8:r?qt.RGBA4:qt.RGBA;case yr.U8_RGBA:return qt.RGBA;case yr.U8_RGBA_SRGB:case yr.U8_RGBA_RT_SRGB:return qt.SRGB8_ALPHA8;case yr.U16_R:return qt.R16UI;case yr.U16_R_NORM:return this.EXT_texture_norm16.R16_EXT;case yr.U16_RG_NORM:return this.EXT_texture_norm16.RG16_EXT;case yr.U16_RGBA_NORM:return this.EXT_texture_norm16.RGBA16_EXT;case yr.U16_RGBA_5551:return qt.RGB5_A1;case yr.U16_RGB_565:return qt.RGB565;case yr.U32_R:return qt.R32UI;case yr.S8_RGBA_NORM:return qt.RGBA8_SNORM;case yr.S8_RG_NORM:return qt.RG8_SNORM;case yr.BC1:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT;case yr.BC1_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;case yr.BC2:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT;case yr.BC2_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;case yr.BC3:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT;case yr.BC3_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;case yr.BC4_UNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_RED_RGTC1_EXT;case yr.BC4_SNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT;case yr.BC5_UNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT;case yr.BC5_SNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;case yr.D32F_S8:return ea(this.gl)?qt.DEPTH32F_STENCIL8:this.WEBGL_depth_texture?qt.DEPTH_STENCIL:qt.DEPTH_COMPONENT16;case yr.D24_S8:return ea(this.gl)?qt.DEPTH24_STENCIL8:this.WEBGL_depth_texture?qt.DEPTH_STENCIL:qt.DEPTH_COMPONENT16;case yr.D32F:return ea(this.gl)?qt.DEPTH_COMPONENT32F:this.WEBGL_depth_texture?qt.DEPTH_COMPONENT:qt.DEPTH_COMPONENT16;case yr.D24:return ea(this.gl)?qt.DEPTH_COMPONENT24:this.WEBGL_depth_texture?qt.DEPTH_COMPONENT:qt.DEPTH_COMPONENT16;default:throw new Error("whoops")}},t.prototype.translateTextureType=function(e){var r=ig(e);switch(r){case zn.U8:return qt.UNSIGNED_BYTE;case zn.U16:return qt.UNSIGNED_SHORT;case zn.U32:return qt.UNSIGNED_INT;case zn.S8:return qt.BYTE;case zn.F16:return qt.HALF_FLOAT;case zn.F32:return qt.FLOAT;case zn.U16_PACKED_5551:return qt.UNSIGNED_SHORT_5_5_5_1;case zn.D32F:return ea(this.gl)?qt.FLOAT:this.WEBGL_depth_texture?qt.UNSIGNED_INT:qt.UNSIGNED_BYTE;case zn.D24:return ea(this.gl)?qt.UNSIGNED_INT_24_8:this.WEBGL_depth_texture?qt.UNSIGNED_SHORT:qt.UNSIGNED_BYTE;case zn.D24S8:return ea(this.gl)?qt.UNSIGNED_INT_24_8:this.WEBGL_depth_texture?qt.UNSIGNED_INT_24_8_WEBGL:qt.UNSIGNED_BYTE;case zn.D32FS8:return qt.FLOAT_32_UNSIGNED_INT_24_8_REV;default:throw new Error("whoops")}},t.prototype.translateInternalTextureFormat=function(e){switch(e){case yr.F32_R:return qt.R32F;case yr.F32_RG:return qt.RG32F;case yr.F32_RGB:return qt.RGB32F;case yr.F32_RGBA:return qt.RGBA32F;case yr.F16_R:return qt.R16F;case yr.F16_RG:return qt.RG16F;case yr.F16_RGB:return qt.RGB16F;case yr.F16_RGBA:return qt.RGBA16F}return this.translateTextureFormat(e)},t.prototype.translateTextureFormat=function(e){if(vS(e)||e===yr.F32_LUMINANCE||e===yr.U8_LUMINANCE)return this.translateTextureInternalFormat(e);var r=ea(this.gl)||!ea(this.gl)&&!!this.WEBGL_depth_texture;switch(e){case yr.D24_S8:case yr.D32F_S8:return r?qt.DEPTH_STENCIL:qt.RGBA;case yr.D24:case yr.D32F:return r?qt.DEPTH_COMPONENT:qt.RGBA}var n=_S(e),a=z1(e);switch(a){case No.A:return qt.ALPHA;case No.R:return n?qt.RED_INTEGER:qt.RED;case No.RG:return n?qt.RG_INTEGER:qt.RG;case No.RGB:return n?qt.RGB_INTEGER:qt.RGB;case No.RGBA:return qt.RGBA}},t.prototype.setActiveTexture=function(e){this.currentActiveTexture!==e&&(this.gl.activeTexture(e),this.currentActiveTexture=e)},t.prototype.bindVAO=function(e){this.currentBoundVAO!==e&&(ea(this.gl)?this.gl.bindVertexArray(e):this.OES_vertex_array_object.bindVertexArrayOES(e),this.currentBoundVAO=e)},t.prototype.programCompiled=function(e){Cs(e.compileState!==Qd.NeedsCompile),e.compileState===Qd.Compiling&&(e.compileState=Qd.NeedsBind,this.shaderDebug&&this.checkProgramCompilationForErrors(e))},t.prototype.useProgram=function(e){this.currentProgram!==e&&(this.programCompiled(e),this.gl.useProgram(e.gl_program),this.currentProgram=e)},t.prototype.ensureResourceExists=function(e){if(e===null){var r=this.gl.getError();throw new Error("Created resource is null; GL error encountered: ".concat(r))}else return e},t.prototype.createBuffer=function(e){return new j6({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createTexture=function(e){return new J2({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createSampler=function(e){return new J6({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createRenderTarget=function(e){return new G6({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createRenderTargetFromTexture=function(e){var r=e,n=r.format,a=r.width,u=r.height,y=r.mipLevelCount;return Cs(y===1),this.createRenderTarget({format:n,width:a,height:u,sampleCount:1,texture:e})},t.prototype.createProgram=function(e){var r,n,a,u=(r=e.vertex)===null||r===void 0?void 0:r.glsl;return!((n=e.vertex)===null||n===void 0)&&n.glsl&&(e.vertex.glsl=Ug(this.queryVendorInfo(),"vert",e.vertex.glsl)),!((a=e.fragment)===null||a===void 0)&&a.glsl&&(e.fragment.glsl=Ug(this.queryVendorInfo(),"frag",e.fragment.glsl)),this.createProgramSimple(e,u)},t.prototype.createProgramSimple=function(e,r){var n=new W6({id:this.getNextUniqueId(),device:this,descriptor:e},r);return n},t.prototype.createBindings=function(e){return new O6({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createInputLayout=function(e){return new H6({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createRenderPipeline=function(e){return new Y6({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createComputePass=function(){return new Q6},t.prototype.createComputePipeline=function(e){return new $6({id:this.getNextUniqueId(),device:this,descriptor:e})},t.prototype.createReadback=function(){return new q6({id:this.getNextUniqueId(),device:this})},t.prototype.createQueryPool=function(e,r){return new X6({id:this.getNextUniqueId(),device:this,descriptor:{type:e,elemCount:r}})},t.prototype.formatRenderPassDescriptor=function(e){var r,n,a,u,y,A,O=e.colorAttachment;e.depthClearValue=(r=e.depthClearValue)!==null&&r!==void 0?r:"load",e.stencilClearValue=(n=e.stencilClearValue)!==null&&n!==void 0?n:"load";for(var Z=0;Z=0;r--)this.debugGroupStack[r].drawCallCount+=e},t.prototype.debugGroupStatisticsBufferUpload=function(e){e===void 0&&(e=1);for(var r=this.debugGroupStack.length-1;r>=0;r--)this.debugGroupStack[r].bufferUploadCount+=e},t.prototype.debugGroupStatisticsTextureBind=function(e){e===void 0&&(e=1);for(var r=this.debugGroupStack.length-1;r>=0;r--)this.debugGroupStack[r].textureBindCount+=e},t.prototype.debugGroupStatisticsTriangles=function(e){for(var r=this.debugGroupStack.length-1;r>=0;r--)this.debugGroupStack[r].triangleCount+=e},t.prototype.reportShaderError=function(e,r){var n=this.gl,a=n.getShaderParameter(e,n.COMPILE_STATUS);if(!a){console.error(r6(r));var u=n.getExtension("WEBGL_debug_shaders");u&&console.error(u.getTranslatedShaderSource(e)),console.error(n.getShaderInfoLog(e))}return a},t.prototype.checkProgramCompilationForErrors=function(e){var r=this.gl,n=e.gl_program;if(!r.getProgramParameter(n,r.LINK_STATUS)){var a=e.descriptor;if(!this.reportShaderError(e.gl_shader_vert,a.vertex.glsl)||!this.reportShaderError(e.gl_shader_frag,a.fragment.glsl))return;console.error(r.getProgramInfoLog(e.gl_program))}},t.prototype.bindFramebufferAttachment=function(e,r,n,a){var u=this.gl;if((0,Dm.Z)(n))u.framebufferRenderbuffer(e,r,u.RENDERBUFFER,null);else if(n.type===Jl.RenderTarget)n.gl_renderbuffer!==null?u.framebufferRenderbuffer(e,r,u.RENDERBUFFER,n.gl_renderbuffer):n.texture!==null&&u.framebufferTexture2D(e,r,qt.TEXTURE_2D,tv(n.texture),a);else if(n.type===Jl.Texture){var y=tv(n);n.dimension===rl.TEXTURE_2D?u.framebufferTexture2D(e,r,qt.TEXTURE_2D,y,a):ea(u)&&(n.dimension,rl.TEXTURE_2D_ARRAY)}},t.prototype.bindFramebufferDepthStencilAttachment=function(e,r){var n=this.gl,a=(0,Dm.Z)(r)?to.Depth|to.Stencil:Y0(r.format),u=!!(a&to.Depth),y=!!(a&to.Stencil);if(u&&y){var A=ea(this.gl)||!ea(this.gl)&&!!this.WEBGL_depth_texture;A?this.bindFramebufferAttachment(e,n.DEPTH_STENCIL_ATTACHMENT,r,0):this.bindFramebufferAttachment(e,n.DEPTH_ATTACHMENT,r,0)}else u?(this.bindFramebufferAttachment(e,n.DEPTH_ATTACHMENT,r,0),this.bindFramebufferAttachment(e,n.STENCIL_ATTACHMENT,null,0)):y&&(this.bindFramebufferAttachment(e,n.STENCIL_ATTACHMENT,r,0),this.bindFramebufferAttachment(e,n.DEPTH_ATTACHMENT,null,0))},t.prototype.validateCurrentAttachments=function(){for(var e=-1,r=-1,n=-1,a=0;a=Z.numUniformBuffers),Cs(A.length>=Z.numSamplers);for(var Y=0;Y{throw Error("TextDecoder not available")}};typeof TextDecoder!="undefined"&&ES.decode();let T_=null;function X1(){return(T_===null||T_.byteLength===0)&&(T_=new Uint8Array(Wh.memory.buffer)),T_}function q1(t,e){return t=t>>>0,ES.decode(X1().subarray(t,t+e))}const Ag=new Array(128).fill(void 0);Ag.push(void 0,null,!0,!1);let A_=Ag.length;function iL(t){A_===Ag.length&&Ag.push(Ag.length+1);const e=A_;return A_=Ag[e],Ag[e]=t,e}function Y1(t){return Ag[t]}function oL(t){t<132||(Ag[t]=A_,A_=t)}function aL(t){const e=Y1(t);return oL(t),e}let rv=0;const $1=typeof TextEncoder!="undefined"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},sL=typeof $1.encodeInto=="function"?function(t,e){return $1.encodeInto(t,e)}:function(t,e){const r=$1.encode(t);return e.set(r),{read:t.length,written:r.length}};function K1(t,e,r){if(r===void 0){const A=$1.encode(t),O=e(A.length,1)>>>0;return X1().subarray(O,O+A.length).set(A),rv=A.length,O}let n=t.length,a=e(n,1)>>>0;const u=X1();let y=0;for(;y127)break;u[a+y]=A}if(y!==n){y!==0&&(t=t.slice(y)),a=r(a,n,n=y+t.length*3,1)>>>0;const A=X1().subarray(a+y,a+n),O=sL(t,A);y+=O.written}return rv=y,a}let C_=null;function J1(){return(C_===null||C_.byteLength===0)&&(C_=new Int32Array(Wh.memory.buffer)),C_}function lL(t,e,r){let n,a;try{const A=Wh.__wbindgen_add_to_stack_pointer(-16),O=K1(t,Wh.__wbindgen_malloc,Wh.__wbindgen_realloc),Z=rv,Y=K1(e,Wh.__wbindgen_malloc,Wh.__wbindgen_realloc),Q=rv;Wh.glsl_compile(A,O,Z,Y,Q,r);var u=J1()[A/4+0],y=J1()[A/4+1];return n=u,a=y,q1(u,y)}finally{Wh.__wbindgen_add_to_stack_pointer(16),Wh.__wbindgen_free(n,a,1)}}class M_{static __wrap(e){e=e>>>0;const r=Object.create(M_.prototype);return r.__wbg_ptr=e,r}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,e}free(){const e=this.__destroy_into_raw();Wh.__wbg_wgslcomposer_free(e)}constructor(){const e=Wh.wgslcomposer_new();return M_.__wrap(e)}load_composable(e){const r=K1(e,Wh.__wbindgen_malloc,Wh.__wbindgen_realloc),n=rv;Wh.wgslcomposer_load_composable(this.__wbg_ptr,r,n)}wgsl_compile(e){let r,n;try{const y=Wh.__wbindgen_add_to_stack_pointer(-16),A=K1(e,Wh.__wbindgen_malloc,Wh.__wbindgen_realloc),O=rv;Wh.wgslcomposer_wgsl_compile(y,this.__wbg_ptr,A,O);var a=J1()[y/4+0],u=J1()[y/4+1];return r=a,n=u,q1(a,u)}finally{Wh.__wbindgen_add_to_stack_pointer(16),Wh.__wbindgen_free(r,n,1)}}}function uL(t,e){return oE(this,null,function*(){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return yield WebAssembly.instantiateStreaming(t,e)}catch(n){if(t.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}const r=yield t.arrayBuffer();return yield WebAssembly.instantiate(r,e)}else{const r=yield WebAssembly.instantiate(t,e);return r instanceof WebAssembly.Instance?{instance:r,module:t}:r}})}function cL(){const t={};return t.wbg={},t.wbg.__wbindgen_string_new=function(e,r){const n=q1(e,r);return iL(n)},t.wbg.__wbindgen_object_drop_ref=function(e){aL(e)},t.wbg.__wbg_log_1d3ae0273d8f4f8a=function(e){console.log(Y1(e))},t.wbg.__wbg_log_576ca876af0d4a77=function(e,r){console.log(Y1(e),Y1(r))},t.wbg.__wbindgen_throw=function(e,r){throw new Error(q1(e,r))},t}function hL(t,e){return Wh=t.exports,wS.__wbindgen_wasm_module=e,C_=null,T_=null,Wh}function wS(t){return oE(this,null,function*(){if(Wh!==void 0)return Wh;const e=cL();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));const{instance:r,module:n}=yield uL(yield t,e);return hL(r,n)})}var mf;(function(t){t[t.COPY_SRC=1]="COPY_SRC",t[t.COPY_DST=2]="COPY_DST",t[t.TEXTURE_BINDING=4]="TEXTURE_BINDING",t[t.STORAGE_BINDING=8]="STORAGE_BINDING",t[t.STORAGE=8]="STORAGE",t[t.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"})(mf||(mf={}));var Q2;(function(t){t[t.READ=1]="READ",t[t.WRITE=2]="WRITE"})(Q2||(Q2={}));function pL(t){var e=0;return t&ad.SAMPLED&&(e|=mf.TEXTURE_BINDING|mf.COPY_DST|mf.COPY_SRC),t&ad.STORAGE&&(e|=mf.TEXTURE_BINDING|mf.STORAGE_BINDING|mf.COPY_SRC|mf.COPY_DST),t&ad.RENDER_TARGET&&(e|=mf.RENDER_ATTACHMENT|mf.TEXTURE_BINDING|mf.COPY_SRC|mf.COPY_DST),e}function eE(t){if(t===yr.U8_R_NORM)return"r8unorm";if(t===yr.S8_R_NORM)return"r8snorm";if(t===yr.U8_RG_NORM)return"rg8unorm";if(t===yr.S8_RG_NORM)return"rg8snorm";if(t===yr.U32_R)return"r32uint";if(t===yr.S32_R)return"r32sint";if(t===yr.F32_R)return"r32float";if(t===yr.U16_RG)return"rg16uint";if(t===yr.S16_RG)return"rg16sint";if(t===yr.F16_RG)return"rg16float";if(t===yr.U8_RGBA_RT)return"bgra8unorm";if(t===yr.U8_RGBA_RT_SRGB)return"bgra8unorm-srgb";if(t===yr.U8_RGBA_NORM)return"rgba8unorm";if(t===yr.U8_RGBA_SRGB)return"rgba8unorm-srgb";if(t===yr.S8_RGBA_NORM)return"rgba8snorm";if(t===yr.U32_RG)return"rg32uint";if(t===yr.S32_RG)return"rg32sint";if(t===yr.F32_RG)return"rg32float";if(t===yr.U16_RGBA)return"rgba16uint";if(t===yr.S16_RGBA)return"rgba16sint";if(t===yr.F16_RGBA)return"rgba16float";if(t===yr.F32_RGBA)return"rgba32float";if(t===yr.U32_RGBA)return"rgba32uint";if(t===yr.S32_RGBA)return"rgba32sint";if(t===yr.D24)return"depth24plus";if(t===yr.D24_S8)return"depth24plus-stencil8";if(t===yr.D32F)return"depth32float";if(t===yr.D32F_S8)return"depth32float-stencil8";if(t===yr.BC1)return"bc1-rgba-unorm";if(t===yr.BC1_SRGB)return"bc1-rgba-unorm-srgb";if(t===yr.BC2)return"bc2-rgba-unorm";if(t===yr.BC2_SRGB)return"bc2-rgba-unorm-srgb";if(t===yr.BC3)return"bc3-rgba-unorm";if(t===yr.BC3_SRGB)return"bc3-rgba-unorm-srgb";if(t===yr.BC4_SNORM)return"bc4-r-snorm";if(t===yr.BC4_UNORM)return"bc4-r-unorm";if(t===yr.BC5_SNORM)return"bc5-rg-snorm";if(t===yr.BC5_UNORM)return"bc5-rg-unorm";throw"whoops"}function fL(t){if(t===rl.TEXTURE_2D)return"2d";if(t===rl.TEXTURE_CUBE_MAP)return"2d";if(t===rl.TEXTURE_2D_ARRAY)return"2d";if(t===rl.TEXTURE_3D)return"3d";throw new Error("whoops")}function dL(t){if(t===rl.TEXTURE_2D)return"2d";if(t===rl.TEXTURE_CUBE_MAP)return"cube";if(t===rl.TEXTURE_2D_ARRAY)return"2d-array";if(t===rl.TEXTURE_3D)return"3d";throw new Error("whoops")}function mL(t){var e=0;return t&ac.INDEX&&(e|=GPUBufferUsage.INDEX),t&ac.VERTEX&&(e|=GPUBufferUsage.VERTEX),t&ac.UNIFORM&&(e|=GPUBufferUsage.UNIFORM),t&ac.STORAGE&&(e|=GPUBufferUsage.STORAGE),t&ac.COPY_SRC&&(e|=GPUBufferUsage.COPY_SRC),t&ac.INDIRECT&&(e|=GPUBufferUsage.INDIRECT),e|=GPUBufferUsage.COPY_DST,e}function tE(t){if(t===Id.CLAMP_TO_EDGE)return"clamp-to-edge";if(t===Id.REPEAT)return"repeat";if(t===Id.MIRRORED_REPEAT)return"mirror-repeat";throw new Error("whoops")}function SS(t){if(t===pp.BILINEAR)return"linear";if(t===pp.POINT)return"nearest";throw new Error("whoops")}function gL(t){if(t===df.LINEAR)return"linear";if(t===df.NEAREST)return"nearest";if(t===df.NO_MIP)return"nearest";throw new Error("whoops")}function nv(t){var e=t;return e.gpuBuffer}function vL(t){var e=t;return e.gpuSampler}function _L(t){var e=t;return e.querySet}function yL(t){if(t===N1.OcclusionConservative)return"occlusion";throw new Error("whoops")}function xL(t){switch(t){case Ip.TRIANGLES:return"triangle-list";case Ip.POINTS:return"point-list";case Ip.TRIANGLE_STRIP:return"triangle-strip";case Ip.LINES:return"line-list";case Ip.LINE_STRIP:return"line-strip";default:throw new Error("Unknown primitive topology mode")}}function bL(t){if(t===Jd.NONE)return"none";if(t===Jd.FRONT)return"front";if(t===Jd.BACK)return"back";throw new Error("whoops")}function EL(t){if(t===x_.CCW)return"ccw";if(t===x_.CW)return"cw";throw new Error("whoops")}function wL(t,e){return{topology:xL(t),cullMode:bL(e.cullMode),frontFace:EL(e.frontFace)}}function TS(t){if(t===pl.ZERO)return"zero";if(t===pl.ONE)return"one";if(t===pl.SRC)return"src";if(t===pl.ONE_MINUS_SRC)return"one-minus-src";if(t===pl.DST)return"dst";if(t===pl.ONE_MINUS_DST)return"one-minus-dst";if(t===pl.SRC_ALPHA)return"src-alpha";if(t===pl.ONE_MINUS_SRC_ALPHA)return"one-minus-src-alpha";if(t===pl.DST_ALPHA)return"dst-alpha";if(t===pl.ONE_MINUS_DST_ALPHA)return"one-minus-dst-alpha";if(t===pl.CONST)return"constant";if(t===pl.ONE_MINUS_CONSTANT)return"one-minus-constant";if(t===pl.SRC_ALPHA_SATURATE)return"src-alpha-saturated";throw new Error("whoops")}function SL(t){if(t===If.ADD)return"add";if(t===If.SUBSTRACT)return"subtract";if(t===If.REVERSE_SUBSTRACT)return"reverse-subtract";if(t===If.MIN)return"min";if(t===If.MAX)return"max";throw new Error("whoops")}function AS(t){return{operation:SL(t.blendMode),srcFactor:TS(t.blendSrcFactor),dstFactor:TS(t.blendDstFactor)}}function CS(t){return t.blendMode===If.ADD&&t.blendSrcFactor===pl.ONE&&t.blendDstFactor===pl.ZERO}function TL(t){if(!(CS(t.rgbBlendState)&&CS(t.alphaBlendState)))return{color:AS(t.rgbBlendState),alpha:AS(t.alphaBlendState)}}function AL(t,e){return{format:eE(e),blend:TL(t),writeMask:t.channelWriteMask}}function CL(t,e){return e.attachmentsState.map(function(r,n){return AL(r,t[n])})}function Q1(t){if(t===js.NEVER)return"never";if(t===js.LESS)return"less";if(t===js.EQUAL)return"equal";if(t===js.LEQUAL)return"less-equal";if(t===js.GREATER)return"greater";if(t===js.NOTEQUAL)return"not-equal";if(t===js.GEQUAL)return"greater-equal";if(t===js.ALWAYS)return"always";throw new Error("whoops")}function iv(t){if(t===jh.KEEP)return"keep";if(t===jh.REPLACE)return"replace";if(t===jh.ZERO)return"zero";if(t===jh.DECREMENT_CLAMP)return"decrement-clamp";if(t===jh.DECREMENT_WRAP)return"decrement-wrap";if(t===jh.INCREMENT_CLAMP)return"increment-clamp";if(t===jh.INCREMENT_WRAP)return"increment-wrap";if(t===jh.INVERT)return"invert";throw new Error("whoops")}function ML(t,e){if(!(0,Dm.Z)(t))return{format:eE(t),depthWriteEnabled:!!e.depthWrite,depthCompare:Q1(e.depthCompare),depthBias:e.polygonOffset?1:0,depthBiasSlopeScale:e.polygonOffset?1:0,stencilFront:{compare:Q1(e.stencilFront.compare),passOp:iv(e.stencilFront.passOp),failOp:iv(e.stencilFront.failOp),depthFailOp:iv(e.stencilFront.depthFailOp)},stencilBack:{compare:Q1(e.stencilBack.compare),passOp:iv(e.stencilBack.passOp),failOp:iv(e.stencilBack.failOp),depthFailOp:iv(e.stencilBack.depthFailOp)},stencilReadMask:4294967295,stencilWriteMask:4294967295}}function PL(t){if(t!==null){if(t===yr.U16_R)return"uint16";if(t===yr.U32_R)return"uint32";throw new Error("whoops")}}function RL(t){if(t===a0.VERTEX)return"vertex";if(t===a0.INSTANCE)return"instance";throw new Error("whoops")}function IL(t){if(t===yr.U8_R)return"uint8x2";if(t===yr.U8_RG)return"uint8x2";if(t===yr.U8_RGB)return"uint8x4";if(t===yr.U8_RGBA)return"uint8x4";if(t===yr.U8_RG_NORM)return"unorm8x2";if(t===yr.U8_RGBA_NORM)return"unorm8x4";if(t===yr.S8_RGB_NORM)return"snorm8x4";if(t===yr.S8_RGBA_NORM)return"snorm8x4";if(t===yr.U16_RG_NORM)return"unorm16x2";if(t===yr.U16_RGBA_NORM)return"unorm16x4";if(t===yr.S16_RG_NORM)return"snorm16x2";if(t===yr.S16_RGBA_NORM)return"snorm16x4";if(t===yr.S16_RG)return"uint16x2";if(t===yr.F16_RG)return"float16x2";if(t===yr.F16_RGBA)return"float16x4";if(t===yr.F32_R)return"float32";if(t===yr.F32_RG)return"float32x2";if(t===yr.F32_RGB)return"float32x3";if(t===yr.F32_RGBA)return"float32x4";throw"whoops"}function LL(t){var e=ig(t);switch(e){case zn.BC1:case zn.BC2:case zn.BC3:case zn.BC4_SNORM:case zn.BC4_UNORM:case zn.BC5_SNORM:case zn.BC5_UNORM:return!0;default:return!1}}function DL(t){var e=ig(t);switch(e){case zn.BC1:case zn.BC2:case zn.BC3:case zn.BC4_SNORM:case zn.BC4_UNORM:case zn.BC5_SNORM:case zn.BC5_UNORM:return 4;default:return 1}}function MS(t,e,r,n){switch(r===void 0&&(r=!1),t){case yr.S8_R:case yr.S8_R_NORM:case yr.S8_RG_NORM:case yr.S8_RGB_NORM:case yr.S8_RGBA_NORM:{var a=e instanceof ArrayBuffer?new Int8Array(e):new Int8Array(e);return n&&a.set(new Int8Array(n)),a}case yr.U8_R:case yr.U8_R_NORM:case yr.U8_RG:case yr.U8_RG_NORM:case yr.U8_RGB:case yr.U8_RGB_NORM:case yr.U8_RGB_SRGB:case yr.U8_RGBA:case yr.U8_RGBA_NORM:case yr.U8_RGBA_SRGB:{var u=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e);return n&&u.set(new Uint8Array(n)),u}case yr.S16_R:case yr.S16_RG:case yr.S16_RG_NORM:case yr.S16_RGB_NORM:case yr.S16_RGBA:case yr.S16_RGBA_NORM:{var y=e instanceof ArrayBuffer?new Int16Array(e):new Int16Array(r?e/2:e);return n&&y.set(new Int16Array(n)),y}case yr.U16_R:case yr.U16_RGB:case yr.U16_RGBA_5551:case yr.U16_RGBA_NORM:case yr.U16_RG_NORM:case yr.U16_R_NORM:{var A=e instanceof ArrayBuffer?new Uint16Array(e):new Uint16Array(r?e/2:e);return n&&A.set(new Uint16Array(n)),A}case yr.S32_R:{var O=e instanceof ArrayBuffer?new Int32Array(e):new Int32Array(r?e/4:e);return n&&O.set(new Int32Array(n)),O}case yr.U32_R:case yr.U32_RG:{var Z=e instanceof ArrayBuffer?new Uint32Array(e):new Uint32Array(r?e/4:e);return n&&Z.set(new Uint32Array(n)),Z}case yr.F32_R:case yr.F32_RG:case yr.F32_RGB:case yr.F32_RGBA:{var Y=e instanceof ArrayBuffer?new Float32Array(e):new Float32Array(r?e/4:e);return n&&Y.set(new Float32Array(n)),Y}}var Q=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e);return n&&Q.set(new Uint8Array(n)),Q}function OL(t){var e=(t&32768)>>15,r=(t&31744)>>10,n=t&1023;return r===0?(e?-1:1)*Math.pow(2,-14)*(n/Math.pow(2,10)):r==31?n?NaN:(e?-1:1)*(1/0):(e?-1:1)*Math.pow(2,r-15)*(1+n/Math.pow(2,10))}function PS(t){switch(t){case"r8unorm":case"r8snorm":case"r8uint":case"r8sint":return{width:1,height:1,length:1};case"r16uint":case"r16sint":case"r16float":case"rg8unorm":case"rg8snorm":case"rg8uint":case"rg8sint":return{width:1,height:1,length:2};case"r32uint":case"r32sint":case"r32float":case"rg16uint":case"rg16sint":case"rg16float":case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8snorm":case"rgba8uint":case"rgba8sint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgb9e5ufloat":case"rgb10a2unorm":case"rg11b10ufloat":return{width:1,height:1,length:4};case"rg32uint":case"rg32sint":case"rg32float":case"rgba16uint":case"rgba16sint":case"rgba16float":return{width:1,height:1,length:8};case"rgba32uint":case"rgba32sint":case"rgba32float":return{width:1,height:1,length:16};case"stencil8":throw new Error("No fixed size for Stencil8 format!");case"depth16unorm":return{width:1,height:1,length:2};case"depth24plus":throw new Error("No fixed size for Depth24Plus format!");case"depth24plus-stencil8":throw new Error("No fixed size for Depth24PlusStencil8 format!");case"depth32float":return{width:1,height:1,length:4};case"depth32float-stencil8":return{width:1,height:1,length:5};case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc6h-rgb-ufloat":case"bc6h-rgb-float":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc5-rg-unorm":case"bc5-rg-snorm":return{width:4,height:4,length:16};case"bc4-r-unorm":case"bc4-r-snorm":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":return{width:4,height:4,length:8};default:return{width:1,height:1,length:4}}}var Wm=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=t.call(this)||this;return u.id=n,u.device=a,u}return e.prototype.destroy=function(){},e}(K3),BL=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y,A,O=t.call(this,{id:n,device:a})||this;O.type=Jl.Bindings;var Z=u.pipeline;Cs(!!Z);var Y=u.uniformBufferBindings,Q=u.storageBufferBindings,ae=u.samplerBindings,xe=u.storageTextureBindings;O.numUniformBuffers=(Y==null?void 0:Y.length)||0;var Be=[[],[],[],[]],it=0;if(Y&&Y.length)for(var gt=0;gtQ;)this.device.device.queue.writeBuffer(y,r+ae,n.buffer,A+ae,Q),ae+=Q;this.device.device.queue.writeBuffer(y,r+ae,n.buffer,A+ae,u-ae)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.gpuBuffer.destroy()},e}(Wm),RS=function(){function t(){this.gpuComputePassEncoder=null}return t.prototype.dispatchWorkgroups=function(e,r,n){this.gpuComputePassEncoder.dispatchWorkgroups(e,r,n)},t.prototype.dispatchWorkgroupsIndirect=function(e,r){this.gpuComputePassEncoder.dispatchWorkgroupsIndirect(e.gpuBuffer,r)},t.prototype.finish=function(){this.gpuComputePassEncoder.end(),this.gpuComputePassEncoder=null,this.frameCommandEncoder=null},t.prototype.beginComputePass=function(e){Cs(this.gpuComputePassEncoder===null),this.frameCommandEncoder=e,this.gpuComputePassEncoder=this.frameCommandEncoder.beginComputePass(this.gpuComputePassDescriptor)},t.prototype.setPipeline=function(e){var r=e,n=s0(r.gpuComputePipeline);this.gpuComputePassEncoder.setPipeline(n)},t.prototype.setBindings=function(e){var r=this,n=e;n.gpuBindGroup.forEach(function(a,u){a&&r.gpuComputePassEncoder.setBindGroup(u,n.gpuBindGroup[u])})},t.prototype.pushDebugGroup=function(e){this.gpuComputePassEncoder.pushDebugGroup(e)},t.prototype.popDebugGroup=function(){this.gpuComputePassEncoder.popDebugGroup()},t.prototype.insertDebugMarker=function(e){this.gpuComputePassEncoder.insertDebugMarker(e)},t}(),kL=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=t.call(this,{id:n,device:a})||this;y.type=Jl.ComputePipeline,y.gpuComputePipeline=null,y.descriptor=u;var A=u.program,O=A.computeStage;if(O===null)return y;var Z={layout:"auto",compute:(0,wo.__assign)({},O)};return y.gpuComputePipeline=y.device.device.createComputePipeline(Z),y.name!==void 0&&(y.gpuComputePipeline.label=y.name),y}return e.prototype.getBindGroupLayout=function(r){return this.gpuComputePipeline.getBindGroupLayout(r)},e}(Wm),NL=function(t){(0,wo.__extends)(e,t);function e(r){var n,a,u,y,A=r.id,O=r.device,Z=r.descriptor,Y=t.call(this,{id:A,device:O})||this;Y.type=Jl.InputLayout;var Q=[];try{for(var ae=(0,wo.__values)(Z.vertexBufferDescriptors),xe=ae.next();!xe.done;xe=ae.next()){var Be=xe.value,it=Be.arrayStride,gt=Be.stepMode,Bt=Be.attributes;Q.push({arrayStride:it,stepMode:RL(gt),attributes:[]});try{for(var Rt=(u=void 0,(0,wo.__values)(Bt)),Yt=Rt.next();!Yt.done;Yt=Rt.next()){var vr=Yt.value,ln=vr.shaderLocation,cn=vr.format,Gr=vr.offset;Q[Q.length-1].attributes.push({shaderLocation:ln,format:IL(cn),offset:Gr})}}catch(Pn){u={error:Pn}}finally{try{Yt&&!Yt.done&&(y=Rt.return)&&y.call(Rt)}finally{if(u)throw u.error}}}}catch(Pn){n={error:Pn}}finally{try{xe&&!xe.done&&(a=ae.return)&&a.call(ae)}finally{if(n)throw n.error}}return Y.indexFormat=PL(Z.indexBufferFormat),Y.buffers=Q,Y}return e}(Wm),IS=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=t.call(this,{id:n,device:a})||this;return y.type=Jl.Program,y.vertexStage=null,y.fragmentStage=null,y.computeStage=null,y.descriptor=u,u.vertex&&(y.vertexStage=y.createShaderStage(u.vertex,"vertex")),u.fragment&&(y.fragmentStage=y.createShaderStage(u.fragment,"fragment")),u.compute&&(y.computeStage=y.createShaderStage(u.compute,"compute")),y}return e.prototype.setUniformsLegacy=function(r){},e.prototype.createShaderStage=function(r,n){var a,u,y=r.glsl,A=r.wgsl,O=r.entryPoint,Z=r.postprocess,Y=!1,Q=A;if(!Q)try{Q=this.device.glsl_compile(y,n,Y)}catch(Bt){throw console.error(Bt,y),new Error("whoops")}var ae=function(Bt){if(!Q.includes(Bt))return"continue";Q=Q.replace("var T_".concat(Bt,": texture_2d;"),"var T_".concat(Bt,": texture_depth_2d;")),Q=Q.replace(new RegExp("textureSample\\(T_".concat(Bt,"(.*)\\);$"),"gm"),function(Rt,Yt){return"vec4(textureSample(T_".concat(Bt).concat(Yt,"), 0.0, 0.0, 0.0);")})};try{for(var xe=(0,wo.__values)(["u_TextureFramebufferDepth"]),Be=xe.next();!Be.done;Be=xe.next()){var it=Be.value;ae(it)}}catch(Bt){a={error:Bt}}finally{try{Be&&!Be.done&&(u=xe.return)&&u.call(xe)}finally{if(a)throw a.error}}Z&&(Q=Z(Q));var gt=this.device.device.createShaderModule({code:Q});return{module:gt,entryPoint:O||"main"}},e}(Wm),zL=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=t.call(this,{id:n,device:a})||this;y.type=Jl.QueryPool;var A=u.elemCount,O=u.type;return y.querySet=y.device.device.createQuerySet({type:yL(O),count:A}),y.resolveBuffer=y.device.device.createBuffer({size:A*8,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),y.cpuBuffer=y.device.device.createBuffer({size:A*8,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),y.results=null,y}return e.prototype.queryResultOcclusion=function(r){return this.results===null?null:this.results[r]!==BigInt(0)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.querySet.destroy(),this.resolveBuffer.destroy(),this.cpuBuffer.destroy()},e}(Wm),UL=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=t.call(this,{id:n,device:a})||this;return u.type=Jl.Readback,u}return e.prototype.readTexture=function(r,n,a,u,y,A,O,Z){return O===void 0&&(O=0),(0,wo.__awaiter)(this,void 0,void 0,function(){var Y,Q,ae,xe,Be,it,gt,Bt;return(0,wo.__generator)(this,function(Rt){return Y=r,Q=0,ae=PS(Y.gpuTextureformat),xe=Math.ceil(u/ae.width)*ae.length,Be=Math.ceil(xe/256)*256,it=Be*y,gt=this.device.createBuffer({usage:ac.STORAGE|ac.MAP_READ|ac.COPY_DST,hint:Gm.STATIC,viewOrSize:it}),Bt=this.device.device.createCommandEncoder(),Bt.copyTextureToBuffer({texture:Y.gpuTexture,mipLevel:0,origin:{x:n,y:a,z:Math.max(Q,0)}},{buffer:gt.gpuBuffer,offset:0,bytesPerRow:Be},{width:u,height:y,depthOrArrayLayers:1}),this.device.device.queue.submit([Bt.finish()]),[2,this.readBuffer(gt,0,A.byteLength===it?A:null,O,it,Y.format,!0,!1,xe,Be,y)]})})},e.prototype.readTextureSync=function(r,n,a,u,y,A,O,Z){throw new Error("ERROR_MSG_METHOD_NOT_IMPLEMENTED")},e.prototype.readBuffer=function(r,n,a,u,y,A,O,Z,Y,Q,ae){var xe=this;n===void 0&&(n=0),a===void 0&&(a=null),y===void 0&&(y=0),A===void 0&&(A=yr.U8_RGB),O===void 0&&(O=!1),Y===void 0&&(Y=0),Q===void 0&&(Q=0),ae===void 0&&(ae=0);var Be=r,it=y||Be.size,gt=a||Be.view,Bt=gt&>.constructor&>.constructor.BYTES_PER_ELEMENT||eS(A),Rt=Be;if(!(Be.usage&ac.MAP_READ&&Be.usage&ac.COPY_DST)){var Yt=this.device.device.createCommandEncoder();Rt=this.device.createBuffer({usage:ac.STORAGE|ac.MAP_READ|ac.COPY_DST,hint:Gm.STATIC,viewOrSize:it}),Yt.copyBufferToBuffer(Be.gpuBuffer,n,Rt.gpuBuffer,0,it),this.device.device.queue.submit([Yt.finish()])}return new Promise(function(vr,ln){Rt.gpuBuffer.mapAsync(Q2.READ,n,it).then(function(){var cn=Rt.gpuBuffer.getMappedRange(n,it),Gr=gt;if(O)Gr===null?Gr=MS(A,it,!0,cn):Gr=MS(A,Gr.buffer,void 0,cn);else if(Gr===null)switch(Bt){case 1:Gr=new Uint8Array(it),Gr.set(new Uint8Array(cn));break;case 2:Gr=xe.getHalfFloatAsFloatRGBAArrayBuffer(it/2,cn);break;case 4:Gr=new Float32Array(it/4),Gr.set(new Float32Array(cn));break}else switch(Bt){case 1:Gr=new Uint8Array(Gr.buffer),Gr.set(new Uint8Array(cn));break;case 2:Gr=xe.getHalfFloatAsFloatRGBAArrayBuffer(it/2,cn,gt);break;case 4:var Pn=gt&>.constructor||Float32Array;Gr=new Pn(Gr.buffer),Gr.set(new Pn(cn));break}if(Y!==Q){Bt===1&&!O&&(Y*=2,Q*=2);for(var Oo=new Uint8Array(Gr.buffer),Da=Y,Bo=0,Oa=1;Oa1?ae.resolveTarget=this.getTextureView(Q,this.gfxColorResolveToLevel[Z]):ae.storeOp="store")}else{this.gpuColorAttachments.length=Z,this.gfxColorAttachment.length=Z,this.gfxColorResolveTo.length=Z;break}}if(this.gfxDepthStencilAttachment=e.depthStencilAttachment,this.gfxDepthStencilResolveTo=e.depthStencilResolveTo,e.depthStencilAttachment){var Be=e.depthStencilAttachment,ae=this.gpuDepthStencilAttachment;ae.view=Be.gpuTextureView;var it=!!(Y0(Be.format)&to.Depth);it?(e.depthClearValue==="load"?ae.depthLoadOp="load":(ae.depthLoadOp="clear",ae.depthClearValue=e.depthClearValue),e.depthStencilStore||this.gfxDepthStencilResolveTo!==null?ae.depthStoreOp="store":ae.depthStoreOp="discard"):(ae.depthLoadOp=void 0,ae.depthStoreOp=void 0);var gt=!!(Y0(Be.format)&to.Stencil);gt?(e.stencilClearValue==="load"?ae.stencilLoadOp="load":(ae.stencilLoadOp="clear",ae.stencilClearValue=e.stencilClearValue),e.depthStencilStore||this.gfxDepthStencilResolveTo!==null?ae.stencilStoreOp="store":ae.stencilStoreOp="discard"):(ae.stencilLoadOp=void 0,ae.stencilStoreOp=void 0),this.gpuRenderPassDescriptor.depthStencilAttachment=this.gpuDepthStencilAttachment}else this.gpuRenderPassDescriptor.depthStencilAttachment=void 0;this.gpuRenderPassDescriptor.occlusionQuerySet=(0,Dm.Z)(e.occlusionQueryPool)?void 0:_L(e.occlusionQueryPool)},t.prototype.beginRenderPass=function(e,r){Cs(this.gpuRenderPassEncoder===null),this.setRenderPassDescriptor(r),this.frameCommandEncoder=e,this.gpuRenderPassEncoder=this.frameCommandEncoder.beginRenderPass(this.gpuRenderPassDescriptor)},t.prototype.flipY=function(e,r){var n=this.device.swapChainHeight;return n-e-r},t.prototype.setViewport=function(e,r,n,a,u,y){u===void 0&&(u=0),y===void 0&&(y=1),this.gpuRenderPassEncoder.setViewport(e,this.flipY(r,a),n,a,u,y)},t.prototype.setScissorRect=function(e,r,n,a){this.gpuRenderPassEncoder.setScissorRect(e,this.flipY(r,a),n,a)},t.prototype.setPipeline=function(e){var r=e,n=s0(r.gpuRenderPipeline);this.getEncoder().setPipeline(n)},t.prototype.setVertexInput=function(e,r,n){if(e!==null){var a=this.getEncoder(),u=e;n!==null&&a.setIndexBuffer(nv(n.buffer),s0(u.indexFormat),n.offset);for(var y=0;y1||this.copyAttachment(this.gfxDepthStencilResolveTo,0,this.gfxDepthStencilAttachment,0)),this.frameCommandEncoder=null},t.prototype.copyAttachment=function(e,r,n,a){Cs(n.sampleCount===1);var u={texture:n.gpuTexture,mipLevel:a},y={texture:e.gpuTexture,mipLevel:r};Cs(n.width>>>a===e.width>>>r),Cs(n.height>>>a===e.height>>>r),Cs(!!(n.usage&mf.COPY_SRC)),Cs(!!(e.usage&mf.COPY_DST)),this.frameCommandEncoder.copyTextureToTexture(u,y,[e.width,e.height,1])},t}(),ZL=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=t.call(this,{id:n,device:a})||this;return y.type=Jl.RenderPipeline,y.isCreatingAsync=!1,y.gpuRenderPipeline=null,y.descriptor=u,y.device.createRenderPipelineInternal(y,!1),y}return e.prototype.getBindGroupLayout=function(r){return this.gpuRenderPipeline.getBindGroupLayout(r)},e}(Wm),VL=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y,A,O=t.call(this,{id:n,device:a})||this;O.type=Jl.Sampler;var Z=u.lodMinClamp,Y=u.mipmapFilter===df.NO_MIP?u.lodMinClamp:u.lodMaxClamp,Q=(y=u.maxAnisotropy)!==null&&y!==void 0?y:1;return Q>1&&Cs(u.minFilter===pp.BILINEAR&&u.magFilter===pp.BILINEAR&&u.mipmapFilter===df.LINEAR),O.gpuSampler=O.device.device.createSampler({addressModeU:tE(u.addressModeU),addressModeV:tE(u.addressModeV),addressModeW:tE((A=u.addressModeW)!==null&&A!==void 0?A:u.addressModeU),lodMinClamp:Z,lodMaxClamp:Y,minFilter:SS(u.minFilter),magFilter:SS(u.magFilter),mipmapFilter:gL(u.mipmapFilter),compare:u.compareFunction!==void 0?Q1(u.compareFunction):void 0,maxAnisotropy:Q}),O}return e}(Wm),ex=function(t){(0,wo.__extends)(e,t);function e(r){var n=r.id,a=r.device,u=r.descriptor,y=r.skipCreate,A=r.sampleCount,O=t.call(this,{id:n,device:a})||this;O.type=Jl.Texture,O.flipY=!1;var Z=u.format,Y=u.dimension,Q=u.width,ae=u.height,xe=u.depthOrArrayLayers,Be=u.mipLevelCount,it=u.usage,gt=u.pixelStore;return O.flipY=!!(gt!=null&>.unpackFlipY),O.device.createTextureShared({format:Z,dimension:Y!=null?Y:rl.TEXTURE_2D,width:Q,height:ae,depthOrArrayLayers:xe!=null?xe:1,mipLevelCount:Be!=null?Be:1,usage:it,sampleCount:A!=null?A:1},O,y),O}return e.prototype.textureFromImageBitmapOrCanvas=function(r,n,a){for(var u=n[0].width,y=n[0].height,A={size:{width:u,height:y,depthOrArrayLayers:a},format:"rgba8unorm",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT},O=r.createTexture(A),Z=0;Z>>2,uniformBufferWordAlignment:this.device.limits.minUniformBufferOffsetAlignment>>>2,supportedSampleCounts:[1],occlusionQueriesRecommended:!0,computeShadersSupported:!0}},t.prototype.queryTextureFormatSupported=function(e,r,n){if(LL(e)){if(!this.featureTextureCompressionBC)return!1;var a=DL(e);return r%a!==0||n%a!==0?!1:this.featureTextureCompressionBC}switch(e){case yr.U16_RGBA_NORM:return!1;case yr.F32_RGBA:return!1}return!0},t.prototype.queryPlatformAvailable=function(){return!0},t.prototype.queryVendorInfo=function(){return this},t.prototype.queryRenderPass=function(e){var r=e;return r.descriptor},t.prototype.queryRenderTarget=function(e){var r=e;return r},t.prototype.setResourceName=function(e,r){if(e.name=r,e.type===Jl.Buffer){var n=e;n.gpuBuffer.label=r}else if(e.type===Jl.Texture){var n=e;n.gpuTexture.label=r,n.gpuTextureView.label=r}else if(e.type===Jl.RenderTarget){var n=e;n.gpuTexture.label=r,n.gpuTextureView.label=r}else if(e.type===Jl.Sampler){var n=e;n.gpuSampler.label=r}else if(e.type===Jl.RenderPipeline){var n=e;n.gpuRenderPipeline!==null&&(n.gpuRenderPipeline.label=r)}},t.prototype.setResourceLeakCheck=function(e,r){},t.prototype.checkForLeaks=function(){},t.prototype.programPatched=function(e){},t.prototype.pipelineQueryReady=function(e){var r=e;return r.gpuRenderPipeline!==null},t.prototype.pipelineForceReady=function(e){var r=e;this.createRenderPipelineInternal(r,!1)},t}(),GL=function(){function t(e){this.pluginOptions=e}return t.prototype.createSwapChain=function(e){return(0,wo.__awaiter)(this,void 0,void 0,function(){var r,n,a,u,y,A,O,Z;return(0,wo.__generator)(this,function(Y){switch(Y.label){case 0:if(globalThis.navigator.gpu===void 0)return[2,null];r=null,Y.label=1;case 1:return Y.trys.push([1,3,,4]),n=this.pluginOptions.xrCompatible,[4,globalThis.navigator.gpu.requestAdapter({xrCompatible:n})];case 2:return r=Y.sent(),[3,4];case 3:return a=Y.sent(),console.log(a),[3,4];case 4:return r===null?[2,null]:(u=["depth32float-stencil8","texture-compression-bc","float32-filterable"],y=u.filter(function(Q){return r.features.has(Q)}),[4,r.requestDevice({requiredFeatures:y})]);case 5:if(A=Y.sent(),A&&(O=this.pluginOptions.onContextLost,A.lost.then(function(){O&&O()})),A===null)return[2,null];if(Z=e.getContext("webgpu"),!Z)return[2,null];Y.label=6;case 6:return Y.trys.push([6,8,,9]),[4,wS(this.pluginOptions.shaderCompilerPath)];case 7:return Y.sent(),[3,9];case 8:return Y.sent(),[3,9];case 9:return[2,new HL(r,A,e,Z,lL,M_&&new M_)]}})})},t}(),WL=Object.defineProperty,XL=Object.defineProperties,qL=Object.getOwnPropertyDescriptors,DS=Object.getOwnPropertySymbols,YL=Object.prototype.hasOwnProperty,$L=Object.prototype.propertyIsEnumerable,OS=(t,e,r)=>e in t?WL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,P_=(t,e)=>{for(var r in e||(e={}))YL.call(e,r)&&OS(t,r,e[r]);if(DS)for(var r of DS(e))$L.call(e,r)&&OS(t,r,e[r]);return t},KL=(t,e)=>XL(t,qL(e)),{isPlainObject:JL,isTypedArray:QL}=es,eD=class{constructor(t,e){this.destroyed=!1,this.uniforms={},this.reGl=t;const{vs:r,fs:n,attributes:a,uniforms:u,primitive:y,count:A,elements:O,depth:Z,cull:Y,instances:Q}=e,ae={platformString:"WebGL1",glslVersion:"#version 100",explicitBindingLocations:!1,separateSamplerTextures:!1,viewportOrigin:ng.LOWER_LEFT,clipSpaceNearZ:q0.NEGATIVE_ONE,supportMRT:!1},xe={};this.options=e,u&&(this.uniforms=this.extractUniforms(u),Object.keys(u).forEach(Rt=>{xe[Rt]=t.prop(Rt)}));const Be={};Object.keys(a).forEach(Rt=>{Be[Rt]=a[Rt].get()});const it=du(Ug(ae,"frag",n,null,!1)),gt=du(Ug(ae,"vert",r,null,!1)),Bt={attributes:Be,frag:it,uniforms:xe,vert:gt,colorMask:t.prop("colorMask"),lineWidth:1,blend:{enable:t.prop("blend.enable"),func:t.prop("blend.func"),equation:t.prop("blend.equation"),color:t.prop("blend.color")},stencil:{enable:t.prop("stencil.enable"),mask:t.prop("stencil.mask"),func:t.prop("stencil.func"),opFront:t.prop("stencil.opFront"),opBack:t.prop("stencil.opBack")},primitive:NI[y===void 0?Ee.TRIANGLES:y]};Q&&(Bt.instances=Q),A?Bt.count=A:O&&(Bt.elements=O.get()),this.initDepthDrawParams({depth:Z},Bt),this.initCullDrawParams({cull:Y},Bt),this.drawCommand=t(Bt),this.drawParams=Bt}updateAttributesAndElements(t,e){const r={};Object.keys(t).forEach(n=>{r[n]=t[n].get()}),this.drawParams.attributes=r,this.drawParams.elements=e.get(),this.drawCommand=this.reGl(this.drawParams)}updateAttributes(t){const e={};Object.keys(t).forEach(r=>{e[r]=t[r].get()}),this.drawParams.attributes=e,this.drawCommand=this.reGl(this.drawParams)}addUniforms(t){this.uniforms=P_(P_({},this.uniforms),this.extractUniforms(t))}draw(t,e){if(this.drawParams.attributes&&Object.keys(this.drawParams.attributes).length===0)return;const r=P_(P_({},this.uniforms),this.extractUniforms(t.uniforms||{})),n={};Object.keys(r).forEach(a=>{const u=typeof r[a];u==="boolean"||u==="number"||Array.isArray(r[a])||r[a].BYTES_PER_ELEMENT?n[a]=r[a]:n[a]=r[a].get()}),n.blend=e?this.getBlendDrawParams({blend:{enable:!1}}):this.getBlendDrawParams(t),n.stencil=this.getStencilDrawParams(t),n.colorMask=this.getColorMaskDrawParams(t,e),this.drawCommand(n)}destroy(){var t,e;(e=(t=this.drawParams)==null?void 0:t.elements)==null||e.destroy(),this.options.attributes&&Object.values(this.options.attributes).forEach(r=>{r==null||r.destroy()}),this.destroyed=!0}initDepthDrawParams({depth:t},e){t&&(e.depth={enable:t.enable===void 0?!0:!!t.enable,mask:t.mask===void 0?!0:!!t.mask,func:VI[t.func||Ee.LESS],range:t.range||[0,1]})}getBlendDrawParams({blend:t}){const{enable:e,func:r,equation:n,color:a=[0,0,0,0]}=t||{};return{enable:!!e,func:{srcRGB:k1[r&&r.srcRGB||Ee.SRC_ALPHA],srcAlpha:k1[r&&r.srcAlpha||Ee.SRC_ALPHA],dstRGB:k1[r&&r.dstRGB||Ee.ONE_MINUS_SRC_ALPHA],dstAlpha:k1[r&&r.dstAlpha||Ee.ONE_MINUS_SRC_ALPHA]},equation:{rgb:$3[n&&n.rgb||Ee.FUNC_ADD],alpha:$3[n&&n.alpha||Ee.FUNC_ADD]},color:a}}getStencilDrawParams({stencil:t}){const{enable:e,mask:r=-1,func:n={cmp:Ee.ALWAYS,ref:0,mask:-1},opFront:a={fail:Ee.KEEP,zfail:Ee.KEEP,zpass:Ee.KEEP},opBack:u={fail:Ee.KEEP,zfail:Ee.KEEP,zpass:Ee.KEEP}}=t||{};return{enable:!!e,mask:r,func:KL(P_({},n),{cmp:jI[n.cmp]}),opFront:{fail:W0[a.fail],zfail:W0[a.zfail],zpass:W0[a.zpass]},opBack:{fail:W0[u.fail],zfail:W0[u.zfail],zpass:W0[u.zpass]}}}getColorMaskDrawParams({stencil:t},e){return t!=null&&t.enable&&t.opFront&&!e?[!1,!1,!1,!1]:[!0,!0,!0,!0]}initCullDrawParams({cull:t},e){if(t){const{enable:r,face:n=Ee.BACK}=t;e.cull={enable:!!r,face:HI[n]}}}extractUniforms(t){const e={};return Object.keys(t).forEach(r=>{this.extractUniformsRecursively(r,t[r],e,"")}),e}extractUniformsRecursively(t,e,r,n){if(e===null||typeof e=="number"||typeof e=="boolean"||Array.isArray(e)&&typeof e[0]=="number"||QL(e)||e===""||"resize"in e){r[`${n&&n+"."}${t}`]=e;return}JL(e)&&Object.keys(e).forEach(a=>{this.extractUniformsRecursively(a,e[a],r,`${n&&n+"."}${t}`)}),Array.isArray(e)&&e.forEach((a,u)=>{Object.keys(a).forEach(y=>{this.extractUniformsRecursively(y,a[y],r,`${n&&n+"."}${t}[${u}]`)})})}},tD=class{constructor(t,e){this.isDestroy=!1;const{data:r,type:n=Ee.UNSIGNED_BYTE,width:a,height:u,flipY:y=!1,format:A=Ee.RGBA,mipmap:O=!1,wrapS:Z=Ee.CLAMP_TO_EDGE,wrapT:Y=Ee.CLAMP_TO_EDGE,aniso:Q=0,alignment:ae=1,premultiplyAlpha:xe=!1,mag:Be=Ee.NEAREST,min:it=Ee.NEAREST,colorSpace:gt=Ee.BROWSER_DEFAULT_WEBGL,x:Bt=0,y:Rt=0,copy:Yt=!1}=e;this.width=a,this.height=u;const vr={width:a,height:u,type:X2[n],format:zI[A],wrapS:Y3[Z],wrapT:Y3[Y],mag:q3[Be],min:q3[it],alignment:ae,flipY:y,colorSpace:ZI[gt],premultiplyAlpha:xe,aniso:Q,x:Bt,y:Rt,copy:Yt};r&&(vr.data=r),typeof O=="number"?vr.mipmap=UI[O]:typeof O=="boolean"&&(vr.mipmap=O),this.texture=t.texture(vr)}get(){return this.texture}update(t={}){this.texture(t)}bind(){this.texture._texture.bind()}resize({width:t,height:e}){this.texture.resize(t,e),this.width=t,this.height=e}getSize(){return[this.width,this.height]}destroy(){var t;this.isDestroy||(t=this.texture)==null||t.destroy(),this.isDestroy=!0}},rE=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),rD=class{constructor(){this.uniformBuffers=[],this.queryVerdorInfo=()=>"WebGL1",this.createModel=t=>new eD(this.gl,t),this.createAttribute=t=>new kI(this.gl,t),this.createBuffer=t=>new GI(this.gl,t),this.createElements=t=>new WI(this.gl,t),this.createTexture2D=t=>new tD(this.gl,t),this.createFramebuffer=t=>new XI(this.gl,t),this.useFramebuffer=(t,e)=>{this.gl({framebuffer:t?t.get():null})(e)},this.useFramebufferAsync=(t,e)=>rE(this,null,function*(){this.gl({framebuffer:t?t.get():null})(e)}),this.clear=t=>{var e;const{color:r,depth:n,stencil:a,framebuffer:u=null}=t,y={color:r,depth:n,stencil:a};y.framebuffer=u===null?u:u.get(),(e=this.gl)==null||e.clear(y)},this.viewport=({x:t,y:e,width:r,height:n})=>{this.gl._gl.viewport(t,e,r,n),this.width=r,this.height=n,this.gl._refresh()},this.readPixels=t=>{const{framebuffer:e,x:r,y:n,width:a,height:u}=t,y={x:r,y:n,width:a,height:u};return e&&(y.framebuffer=e.get()),this.gl.read(y)},this.readPixelsAsync=t=>rE(this,null,function*(){return this.readPixels(t)}),this.getViewportSize=()=>({width:this.gl._gl.drawingBufferWidth,height:this.gl._gl.drawingBufferHeight}),this.getContainer=()=>{var t;return(t=this.canvas)==null?void 0:t.parentElement},this.getCanvas=()=>this.canvas,this.getGLContext=()=>this.gl._gl,this.destroy=()=>{var t,e,r;this.canvas=null,(r=(e=(t=this.gl)==null?void 0:t._gl)==null?void 0:e.getExtension("WEBGL_lose_context"))==null||r.loseContext(),this.gl.destroy(),this.gl=null}}init(t,e,r){return rE(this,null,function*(){this.canvas=t,r?this.gl=r:this.gl=yield new Promise((n,a)=>{FI()({canvas:this.canvas,attributes:{alpha:!0,antialias:e.antialias,premultipliedAlpha:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,stencil:e.stencil},extensions:["OES_element_index_uint","OES_standard_derivatives","ANGLE_instanced_arrays"],optionalExtensions:["oes_texture_float_linear","OES_texture_float","EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture","WEBGL_lose_context"],profile:!0,onDone:(u,y)=>{(u||!y)&&a(u),n(y)}})}),this.extensionObject={OES_texture_float:this.testExtension("OES_texture_float")}})}getPointSizeRange(){return this.gl._gl.getParameter(this.gl._gl.ALIASED_POINT_SIZE_RANGE)}testExtension(t){return!!this.getGLContext().getExtension(t)}setState(){this.gl({cull:{enable:!1,face:"back"},viewport:{x:0,y:0,height:this.width,width:this.height},blend:{enable:!0,equation:"add"},framebuffer:null}),this.gl._refresh()}setBaseState(){this.gl({cull:{enable:!1,face:"back"},viewport:{x:0,y:0,height:this.width,width:this.height},blend:{enable:!1,equation:"add"},framebuffer:null}),this.gl._refresh()}setCustomLayerDefaults(){const t=this.getGLContext();t.disable(t.CULL_FACE)}setDirty(t){this.isDirty=t}getDirty(){return this.isDirty}beginFrame(){}endFrame(){}},nD=class{constructor(t,e){const{buffer:r,offset:n,stride:a,normalized:u,size:y,divisor:A,shaderLocation:O}=e;this.buffer=r,this.attribute={shaderLocation:O,buffer:r.get(),offset:n||0,stride:a||0,normalized:u||!1,divisor:A||0},y&&(this.attribute.size=y)}get(){return this.buffer}updateBuffer(t){this.buffer.subData(t)}destroy(){this.buffer.destroy()}},tx={[Ee.FLOAT]:Float32Array,[Ee.UNSIGNED_BYTE]:Uint8Array,[Ee.SHORT]:Int16Array,[Ee.UNSIGNED_SHORT]:Uint16Array,[Ee.INT]:Int32Array,[Ee.UNSIGNED_INT]:Uint32Array},iD={[Ee.POINTS]:Ip.POINTS,[Ee.LINES]:Ip.LINES,[Ee.LINE_LOOP]:Ip.LINES,[Ee.LINE_STRIP]:Ip.LINE_STRIP,[Ee.TRIANGLES]:Ip.TRIANGLES,[Ee.TRIANGLE_FAN]:Ip.TRIANGLES,[Ee.TRIANGLE_STRIP]:Ip.TRIANGLE_STRIP},oD={[1]:yr.F32_R,[2]:yr.F32_RG,[3]:yr.F32_RGB,[4]:yr.F32_RGBA},aD={[Ee.STATIC_DRAW]:Gm.STATIC,[Ee.DYNAMIC_DRAW]:Gm.DYNAMIC,[Ee.STREAM_DRAW]:Gm.DYNAMIC},BS={[Ee.REPEAT]:Id.REPEAT,[Ee.CLAMP_TO_EDGE]:Id.CLAMP_TO_EDGE,[Ee.MIRRORED_REPEAT]:Id.MIRRORED_REPEAT},sD={[Ee.NEVER]:js.NEVER,[Ee.ALWAYS]:js.ALWAYS,[Ee.LESS]:js.LESS,[Ee.LEQUAL]:js.LEQUAL,[Ee.GREATER]:js.GREATER,[Ee.GEQUAL]:js.GEQUAL,[Ee.EQUAL]:js.EQUAL,[Ee.NOTEQUAL]:js.NOTEQUAL},lD={[Ee.FRONT]:Jd.FRONT,[Ee.BACK]:Jd.BACK},FS={[Ee.FUNC_ADD]:If.ADD,[Ee.MIN_EXT]:If.MIN,[Ee.MAX_EXT]:If.MAX,[Ee.FUNC_SUBTRACT]:If.SUBSTRACT,[Ee.FUNC_REVERSE_SUBTRACT]:If.REVERSE_SUBSTRACT},rx={[Ee.ZERO]:pl.ZERO,[Ee.ONE]:pl.ONE,[Ee.SRC_COLOR]:pl.SRC,[Ee.ONE_MINUS_SRC_COLOR]:pl.ONE_MINUS_SRC,[Ee.SRC_ALPHA]:pl.SRC_ALPHA,[Ee.ONE_MINUS_SRC_ALPHA]:pl.ONE_MINUS_SRC_ALPHA,[Ee.DST_COLOR]:pl.DST,[Ee.ONE_MINUS_DST_COLOR]:pl.ONE_MINUS_DST,[Ee.DST_ALPHA]:pl.DST_ALPHA,[Ee.ONE_MINUS_DST_ALPHA]:pl.ONE_MINUS_DST_ALPHA,[Ee.CONSTANT_COLOR]:pl.CONST,[Ee.ONE_MINUS_CONSTANT_COLOR]:pl.ONE_MINUS_CONSTANT,[Ee.CONSTANT_ALPHA]:pl.CONST,[Ee.ONE_MINUS_CONSTANT_ALPHA]:pl.ONE_MINUS_CONSTANT,[Ee.SRC_ALPHA_SATURATE]:pl.SRC_ALPHA_SATURATE},ov={[Ee.REPLACE]:jh.REPLACE,[Ee.KEEP]:jh.KEEP,[Ee.ZERO]:jh.ZERO,[Ee.INVERT]:jh.INVERT,[Ee.INCR]:jh.INCREMENT_CLAMP,[Ee.DECR]:jh.DECREMENT_CLAMP,[Ee.INCR_WRAP]:jh.INCREMENT_WRAP,[Ee.DECR_WRAP]:jh.DECREMENT_WRAP},uD={[Ee.ALWAYS]:js.ALWAYS,[Ee.EQUAL]:js.EQUAL,[Ee.GEQUAL]:js.GEQUAL,[Ee.GREATER]:js.GREATER,[Ee.LEQUAL]:js.LEQUAL,[Ee.LESS]:js.LESS,[Ee.NEVER]:js.NEVER,[Ee.NOTEQUAL]:js.NOTEQUAL},cD={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121};function nx(t){return Object.prototype.toString.call(t)in cD}function hD(t,e){const r=t.length,n=Math.ceil(r/3),a=r+n,u=new Float32Array(a);for(let y=0;y>>6,t>>>0}function kS(t){return t+=t<<3,t^=t>>>11,t+=t<<15,t>>>0}function NS(){return 0}var fD=class{constructor(){this.keys=[],this.values=[]}},ix=class{constructor(t,e){this.keyEqualFunc=t,this.keyHashFunc=e,this.buckets=new Map}findBucketIndex(t,e){for(let r=0;r=0;e--)yield t.values[e]}};function zS(t,e){return t=Pu(t,e.blendMode),t=Pu(t,e.blendSrcFactor),t=Pu(t,e.blendDstFactor),t}function dD(t,e){return t=zS(t,e.rgbBlendState),t=zS(t,e.alphaBlendState),t=Pu(t,e.channelWriteMask),t}function mD(t,e){return t=Pu(t,e.r<<24|e.g<<16|e.b<<8|e.a),t}function gD(t,e){var r,n,a,u,y,A,O,Z;for(let Y=0;Ya&&a>0),r=this.device.createBindings(n),this.bindingsCache.add(n,r)}return r}createRenderPipeline(t){let e=this.renderPipelinesCache.get(t);if(e===null){const r=x6(t);r.colorAttachmentFormats=r.colorAttachmentFormats.filter(n=>n),e=this.device.createRenderPipeline(r),this.renderPipelinesCache.add(r,e)}return e}createInputLayout(t){t.vertexBufferDescriptors=t.vertexBufferDescriptors.filter(r=>!!r);let e=this.inputLayoutsCache.get(t);if(e===null){const r=w6(t);e=this.device.createInputLayout(r),this.inputLayoutsCache.add(r,e)}return e}createProgram(t){let e=this.programCache.get(t);if(e===null){const r=xD(t);e=this.device.createProgram(t),this.programCache.add(r,e)}return e}destroy(){for(const t of this.bindingsCache.values())t.destroy();for(const t of this.renderPipelinesCache.values())t.destroy();for(const t of this.inputLayoutsCache.values())t.destroy();for(const t of this.programCache.values())t.destroy();this.bindingsCache.clear(),this.renderPipelinesCache.clear(),this.inputLayoutsCache.clear(),this.programCache.clear()}},ED=class{constructor(t,e){const{data:r,type:n,count:a=0}=e;let u;nx(r)?u=r:u=new tx[this.type||Ee.UNSIGNED_INT](r),this.type=n,this.count=a,this.indexBuffer=t.createBuffer({viewOrSize:u,usage:ac.INDEX})}get(){return this.indexBuffer}subData({data:t}){let e;nx(t)?e=t:e=new tx[this.type||Ee.UNSIGNED_INT](t),this.indexBuffer.setSubData(0,new Uint8Array(e.buffer))}destroy(){this.indexBuffer.destroy()}};function US(t){return!!(t&&t.texture)}var ZS=class{constructor(t,e){this.device=t,this.options=e,this.isDestroy=!1;const{wrapS:r=Ee.CLAMP_TO_EDGE,wrapT:n=Ee.CLAMP_TO_EDGE,aniso:a,mag:u=Ee.NEAREST,min:y=Ee.NEAREST}=e;this.createTexture(e),this.sampler=t.createSampler({addressModeU:BS[r],addressModeV:BS[n],minFilter:y===Ee.NEAREST?pp.POINT:pp.BILINEAR,magFilter:u===Ee.NEAREST?pp.POINT:pp.BILINEAR,mipmapFilter:df.NO_MIP,maxAnisotropy:a})}createTexture(t){const{type:e=Ee.UNSIGNED_BYTE,width:r,height:n,flipY:a=!1,format:u=Ee.RGBA,alignment:y=1,usage:A=$.SAMPLED,unorm:O=!1,label:Z}=t;let{data:Y}=t;this.width=r,this.height=n;let Q=yr.U8_RGBA_RT;if(e===Ee.UNSIGNED_BYTE&&u===Ee.RGBA)Q=O?yr.U8_RGBA_NORM:yr.U8_RGBA_RT;else if(e===Ee.UNSIGNED_BYTE&&u===Ee.LUMINANCE)Q=yr.U8_LUMINANCE;else if(e===Ee.FLOAT&&u===Ee.RGB)this.device.queryVendorInfo().platformString==="WebGPU"?(Y&&(Y=hD(Y,0)),Q=yr.F32_RGBA):Q=yr.F32_RGB;else if(e===Ee.FLOAT&&u===Ee.RGBA)Q=yr.F32_RGBA;else if(e===Ee.FLOAT&&u===Ee.RED)Q=yr.F32_R;else throw new Error(`create texture error, type: ${e}, format: ${u}`);this.texture=this.device.createTexture({format:Q,width:r,height:n,usage:A===$.SAMPLED?ad.SAMPLED:ad.RENDER_TARGET,pixelStore:{unpackFlipY:a,packAlignment:y},mipLevelCount:1}),Z&&this.device.setResourceName(this.texture,Z),Y&&this.texture.setImageData([Y])}get(){return this.texture}update(t){const{data:e}=t;this.texture.setImageData([e])}bind(){}resize({width:t,height:e}){(this.width!==t||this.height!==e)&&this.destroy(),this.options.width=t,this.options.height=e,this.createTexture(this.options),this.isDestroy=!1}getSize(){return[this.width,this.height]}destroy(){var t;!this.isDestroy&&!this.texture.destroyed&&((t=this.texture)==null||t.destroy()),this.isDestroy=!0}},VS=class{constructor(t,e){this.device=t,this.options=e,this.createColorRenderTarget(),this.createDepthRenderTarget()}createColorRenderTarget(t=!1){const{width:e,height:r,color:n}=this.options;n&&(US(n)?(t&&n.resize({width:e,height:r}),this.colorTexture=n.get(),this.colorRenderTarget=this.device.createRenderTargetFromTexture(this.colorTexture),this.width=n.width,this.height=n.height):e&&r&&(this.colorTexture=this.device.createTexture({format:yr.U8_RGBA_RT,usage:ad.RENDER_TARGET,width:e,height:r}),this.colorRenderTarget=this.device.createRenderTargetFromTexture(this.colorTexture),this.width=e,this.height=r))}createDepthRenderTarget(t=!1){const{width:e,height:r,depth:n}=this.options;n&&(US(n)?(t&&n.resize({width:e,height:r}),this.depthTexture=n.get(),this.depthRenderTarget=this.device.createRenderTargetFromTexture(this.depthTexture),this.width=n.width,this.height=n.height):e&&r&&(this.depthTexture=this.device.createTexture({format:yr.D24_S8,usage:ad.RENDER_TARGET,width:e,height:r}),this.depthRenderTarget=this.device.createRenderTargetFromTexture(this.depthTexture),this.width=e,this.height=r))}get(){return this.colorRenderTarget}destroy(){var t,e;(t=this.colorRenderTarget)==null||t.destroy(),(e=this.depthRenderTarget)==null||e.destroy()}resize({width:t,height:e}){(this.width!==t||this.height!==e)&&(this.destroy(),this.colorTexture.destroyed=!0,this.depthTexture.destroyed=!0,this.options.width=t,this.options.height=e,this.createColorRenderTarget(!0),this.createDepthRenderTarget(!0))}},wD=Object.defineProperty,SD=Object.defineProperties,TD=Object.getOwnPropertyDescriptors,jS=Object.getOwnPropertySymbols,AD=Object.prototype.hasOwnProperty,CD=Object.prototype.propertyIsEnumerable,HS=(t,e,r)=>e in t?wD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,u0=(t,e)=>{for(var r in e||(e={}))AD.call(e,r)&&HS(t,r,e[r]);if(jS)for(var r of jS(e))CD.call(e,r)&&HS(t,r,e[r]);return t},MD=(t,e)=>SD(t,TD(e)),{isPlainObject:PD,isTypedArray:RD}=es,ID=class{constructor(t,e,r){this.device=t,this.options=e,this.service=r,this.destroyed=!1,this.uniforms={},this.vertexBuffers=[];const{vs:n,fs:a,attributes:u,uniforms:y,count:A,elements:O,diagnosticDerivativeUniformityEnabled:Z}=e;this.options=e;const Y=Z?"":this.service.viewportOrigin===ng.UPPER_LEFT?"diagnostic(off,derivative_uniformity);":"";this.program=r.renderCache.createProgram({vertex:{glsl:n},fragment:{glsl:a,postprocess:Be=>Y+Be}}),y&&(this.uniforms=this.extractUniforms(y));const Q=[];let ae=0;Object.keys(u).forEach(Be=>{const it=u[Be],gt=it.get();this.vertexBuffers.push(gt.get());const{offset:Bt=0,stride:Rt=0,size:Yt=1,divisor:vr=0,shaderLocation:ln=0}=it.attribute;Q.push({arrayStride:Rt||Yt*4,stepMode:a0.VERTEX,attributes:[{format:oD[Yt],shaderLocation:ln,offset:Bt,divisor:vr}]}),ae=gt.size/Yt}),A||(this.options.count=ae),O&&(this.indexBuffer=O.get());const xe=r.renderCache.createInputLayout({vertexBufferDescriptors:Q,indexBufferFormat:O?yr.U32_R:null,program:this.program});this.inputLayout=xe,this.pipeline=this.createPipeline(e)}createPipeline(t,e){const{primitive:r=Ee.TRIANGLES,depth:n,cull:a,blend:u,stencil:y}=t,A=this.initDepthDrawParams({depth:n}),O=!!(A&&A.enable),Z=this.initCullDrawParams({cull:a}),Y=!!(Z&&Z.enable),Q=this.getBlendDrawParams({blend:u}),ae=!!(Q&&Q.enable),xe=this.getStencilDrawParams({stencil:y}),Be=!!(xe&&xe.enable);return this.device.createRenderPipeline({inputLayout:this.inputLayout,program:this.program,topology:iD[r],colorAttachmentFormats:[yr.U8_RGBA_RT],depthStencilAttachmentFormat:yr.D24_S8,megaStateDescriptor:{attachmentsState:[e?{channelWriteMask:Lf.ALL,rgbBlendState:{blendMode:If.ADD,blendSrcFactor:pl.ONE,blendDstFactor:pl.ZERO},alphaBlendState:{blendMode:If.ADD,blendSrcFactor:pl.ONE,blendDstFactor:pl.ZERO}}:{channelWriteMask:Be&&xe.opFront.zpass===jh.REPLACE?Lf.NONE:Lf.ALL,rgbBlendState:{blendMode:ae&&Q.equation.rgb||If.ADD,blendSrcFactor:ae&&Q.func.srcRGB||pl.SRC_ALPHA,blendDstFactor:ae&&Q.func.dstRGB||pl.ONE_MINUS_SRC_ALPHA},alphaBlendState:{blendMode:ae&&Q.equation.alpha||If.ADD,blendSrcFactor:ae&&Q.func.srcAlpha||pl.ONE,blendDstFactor:ae&&Q.func.dstAlpha||pl.ONE}}],blendConstant:ae?U1:void 0,depthWrite:O,depthCompare:O&&A.func||js.LESS,cullMode:Y&&Z.face||Jd.NONE,stencilWrite:Be,stencilFront:{compare:Be?xe.func.cmp:js.ALWAYS,passOp:xe.opFront.zpass,failOp:xe.opFront.fail,depthFailOp:xe.opFront.zfail,mask:xe.opFront.mask},stencilBack:{compare:Be?xe.func.cmp:js.ALWAYS,passOp:xe.opBack.zpass,failOp:xe.opBack.fail,depthFailOp:xe.opBack.zfail,mask:xe.opBack.mask}}})}updateAttributesAndElements(){}updateAttributes(){}addUniforms(t){this.uniforms=u0(u0({},this.uniforms),this.extractUniforms(t))}draw(t,e){const r=u0(u0({},this.options),t),{count:n=0,instances:a,elements:u,uniforms:y={},uniformBuffers:A,textures:O}=r;this.uniforms=u0(u0({},this.uniforms),this.extractUniforms(y));const{renderPass:Z,currentFramebuffer:Y,width:Q,height:ae,renderCache:xe}=this.service;this.pipeline=this.createPipeline(r,e);const Be=this.service.device,it=Be.swapChainHeight;if(Be.swapChainHeight=(Y==null?void 0:Y.height)||ae,Z.setViewport(0,0,(Y==null?void 0:Y.width)||Q,(Y==null?void 0:Y.height)||ae),Be.swapChainHeight=it,Z.setPipeline(this.pipeline),Z.setStencilReference(1),Z.setVertexInput(this.inputLayout,this.vertexBuffers.map(gt=>({buffer:gt})),u?{buffer:this.indexBuffer,offset:0}:null),A&&(this.bindings=xe.createBindings({pipeline:this.pipeline,uniformBufferBindings:A.map((gt,Bt)=>{const Rt=gt;return{binding:Bt,buffer:Rt.get(),size:Rt.size}}),samplerBindings:O==null?void 0:O.map(gt=>({texture:gt.texture,sampler:gt.sampler}))})),this.bindings&&(Z.setBindings(this.bindings),Object.keys(this.uniforms).forEach(gt=>{const Bt=this.uniforms[gt];Bt instanceof ZS?this.uniforms[gt]=Bt.get():Bt instanceof VS&&(this.uniforms[gt]=Bt.get().texture)}),this.program.setUniformsLegacy(this.uniforms)),u){const gt=u.count;gt===0?Z.draw(n,a):Z.drawIndexed(gt,a)}else Z.draw(n,a)}destroy(){var t,e,r;this.program.destroy(),(t=this.vertexBuffers)==null||t.forEach(n=>n.destroy()),(e=this.indexBuffer)==null||e.destroy(),(r=this.bindings)==null||r.destroy(),this.inputLayout.destroy(),this.pipeline.destroy(),this.destroyed=!0}initDepthDrawParams({depth:t}){if(t)return{enable:t.enable===void 0?!0:!!t.enable,mask:t.mask===void 0?!0:!!t.mask,func:sD[t.func||Ee.LESS],range:t.range||[0,1]}}getBlendDrawParams({blend:t}){const{enable:e,func:r,equation:n,color:a=[0,0,0,0]}=t||{};return{enable:!!e,func:{srcRGB:rx[r&&r.srcRGB||Ee.SRC_ALPHA],srcAlpha:rx[r&&r.srcAlpha||Ee.SRC_ALPHA],dstRGB:rx[r&&r.dstRGB||Ee.ONE_MINUS_SRC_ALPHA],dstAlpha:rx[r&&r.dstAlpha||Ee.ONE_MINUS_SRC_ALPHA]},equation:{rgb:FS[n&&n.rgb||Ee.FUNC_ADD],alpha:FS[n&&n.alpha||Ee.FUNC_ADD]},color:a}}getStencilDrawParams({stencil:t}){const{enable:e,mask:r=4294967295,func:n={cmp:Ee.ALWAYS,ref:0,mask:4294967295},opFront:a={fail:Ee.KEEP,zfail:Ee.KEEP,zpass:Ee.KEEP},opBack:u={fail:Ee.KEEP,zfail:Ee.KEEP,zpass:Ee.KEEP}}=t||{};return{enable:!!e,mask:r,func:MD(u0({},n),{cmp:uD[n.cmp]}),opFront:{fail:ov[a.fail],zfail:ov[a.zfail],zpass:ov[a.zpass],mask:n.mask},opBack:{fail:ov[u.fail],zfail:ov[u.zfail],zpass:ov[u.zpass],mask:n.mask}}}initCullDrawParams({cull:t}){if(t){const{enable:e,face:r=Ee.BACK}=t;return{enable:!!e,face:lD[r]}}}extractUniforms(t){const e={};return Object.keys(t).forEach(r=>{this.extractUniformsRecursively(r,t[r],e,"")}),e}extractUniformsRecursively(t,e,r,n){if(e===null||typeof e=="number"||typeof e=="boolean"||Array.isArray(e)&&typeof e[0]=="number"||RD(e)||e===""||"resize"in e){r[`${n&&n+"."}${t}`]=e;return}PD(e)&&Object.keys(e).forEach(a=>{this.extractUniformsRecursively(a,e[a],r,`${n&&n+"."}${t}`)}),Array.isArray(e)&&e.forEach((a,u)=>{Object.keys(a).forEach(y=>{this.extractUniformsRecursively(y,a[y],r,`${n&&n+"."}${t}[${u}]`)})})}};function LD(t){return typeof WebGL2RenderingContext!="undefined"&&t instanceof WebGL2RenderingContext?!0:!!(t&&t._version===2)}var nE=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),{isUndefined:ox}=es,DD=class{constructor(){this.uniformBuffers=[],this.queryVerdorInfo=()=>this.device.queryVendorInfo().platformString,this.createModel=t=>new ID(this.device,t,this),this.createAttribute=t=>new nD(this.device,t),this.createBuffer=t=>new pD(this.device,t),this.createElements=t=>new ED(this.device,t),this.createTexture2D=t=>new ZS(this.device,t),this.createFramebuffer=t=>new VS(this.device,t),this.useFramebuffer=(t,e)=>{this.currentFramebuffer=t,this.beginFrame(),e(),this.endFrame(),this.currentFramebuffer=null},this.useFramebufferAsync=(t,e)=>nE(this,null,function*(){this.currentFramebuffer=t,this.preRenderPass=this.renderPass,this.beginFrame(),yield e(),this.endFrame(),this.currentFramebuffer=null,this.renderPass=this.preRenderPass}),this.clear=t=>{const{color:e,depth:r,stencil:n,framebuffer:a=null}=t;if(a)a.clearOptions={color:e,depth:r,stencil:n};else{const u=this.queryVerdorInfo();if(u==="WebGL1"){const y=this.getGLContext();ox(n)?ox(r)||(y.clearDepth(r),y.clear(y.DEPTH_BUFFER_BIT)):(y.clearStencil(n),y.clear(y.STENCIL_BUFFER_BIT))}else if(u==="WebGL2"){const y=this.getGLContext();ox(n)?ox(r)||y.clearBufferfv(y.DEPTH,0,[r]):y.clearBufferiv(y.STENCIL,0,[n])}}},this.viewport=({width:t,height:e})=>{this.swapChain.configureSwapChain(t,e),this.createMainColorDepthRT(t,e),this.width=t,this.height=e},this.readPixels=t=>{const{framebuffer:e,x:r,y:n,width:a,height:u}=t,y=this.device.createReadback(),A=e.colorTexture,O=y.readTextureSync(A,r,this.viewportOrigin===ng.LOWER_LEFT?n:this.height-n,a,u,new Uint8Array(a*u*4));return y.destroy(),O},this.readPixelsAsync=t=>nE(this,null,function*(){const{framebuffer:e,x:r,y:n,width:a,height:u}=t,y=this.device.createReadback(),A=e.colorTexture,O=yield y.readTexture(A,r,this.viewportOrigin===ng.LOWER_LEFT?n:this.height-n,a,u,new Uint8Array(a*u*4));if(this.viewportOrigin!==ng.LOWER_LEFT)for(let Z=0;Z({width:this.width,height:this.height}),this.getContainer=()=>{var t;return(t=this.canvas)==null?void 0:t.parentElement},this.getCanvas=()=>this.canvas,this.getGLContext=()=>this.device.gl,this.destroy=()=>{var t;this.canvas=null,(t=this.uniformBuffers)==null||t.forEach(e=>{e.destroy()}),this.device.destroy(),this.renderCache.destroy()}}init(t,e){return nE(this,null,function*(){const{enableWebGPU:r,shaderCompilerPath:n}=e;this.canvas=t;const u=yield(r?new GL({shaderCompilerPath:n}):new nL({targets:["webgl2","webgl1"],onContextLost(A){console.warn("context lost",A)},onContextCreationError(A){console.warn("context creation error",A)},onContextRestored(A){console.warn("context restored",A)}})).createSwapChain(t);u.configureSwapChain(t.width,t.height),this.device=u.getDevice(),this.swapChain=u,this.renderCache=new bD(this.device),this.currentFramebuffer=null,this.viewportOrigin=this.device.queryVendorInfo().viewportOrigin;const y=this.device.gl;this.extensionObject={OES_texture_float:!LD(y)&&this.device.OES_texture_float},this.createMainColorDepthRT(t.width,t.height)})}createMainColorDepthRT(t,e){this.mainColorRT&&this.mainColorRT.destroy(),this.mainDepthRT&&this.mainDepthRT.destroy(),this.mainColorRT=this.device.createRenderTargetFromTexture(this.device.createTexture({format:yr.U8_RGBA_RT,width:t,height:e,usage:ad.RENDER_TARGET})),this.mainDepthRT=this.device.createRenderTargetFromTexture(this.device.createTexture({format:yr.D24_S8,width:t,height:e,usage:ad.RENDER_TARGET}))}beginFrame(){this.device.beginFrame();const{currentFramebuffer:t,swapChain:e,mainColorRT:r,mainDepthRT:n}=this,a=t?t.colorRenderTarget:r,u=t?null:e.getOnscreenTexture(),y=t?t.depthRenderTarget:n,{color:A=[0,0,0,0],depth:O=1,stencil:Z=0}=(t==null?void 0:t.clearOptions)||{},Y=a?b_(A[0]*255,A[1]*255,A[2]*255,A[3]):U1,Q=y?O:void 0,ae=y?Z:void 0,xe=this.device.createRenderPass({colorAttachment:[a],colorResolveTo:[u],colorClearColor:[Y],colorStore:[!0],depthStencilAttachment:y,depthClearValue:Q,stencilClearValue:ae});this.renderPass=xe}endFrame(){this.device.submitPass(this.renderPass),this.device.endFrame()}getPointSizeRange(){const t=this.device.gl;return t.getParameter(t.ALIASED_POINT_SIZE_RANGE)}testExtension(t){return!!this.getGLContext().getExtension(t)}setState(){}setBaseState(){}setCustomLayerDefaults(){}setDirty(t){this.isDirty=t}getDirty(){return this.isDirty}},iE=["selectstart","selecting","selectend"],OD=class extends Yl.EventEmitter{constructor(t,e={}){super(),this.isEnable=!1,this.onDragStart=r=>{this.box.style.display="block",this.startEvent=this.endEvent=r,this.syncBoxBound(),this.emit("selectstart",this.getLngLatBox(),this.startEvent,this.endEvent)},this.onDragging=r=>{this.endEvent=r,this.syncBoxBound(),this.emit("selecting",this.getLngLatBox(),this.startEvent,this.endEvent)},this.onDragEnd=r=>{this.endEvent=r,this.box.style.display="none",this.emit("selectend",this.getLngLatBox(),this.startEvent,this.endEvent)},this.scene=t,this.options=e}get container(){return this.scene.getMapService().getMarkerContainer()}enable(){if(this.isEnable)return;const{className:t}=this.options;if(this.scene.setMapStatus({dragEnable:!1}),this.container.style.cursor="crosshair",!this.box){const e=Xo("div",void 0,this.container);e.classList.add("l7-select-box"),t&&e.classList.add(t),e.style.display="none",this.box=e}this.scene.on("dragstart",this.onDragStart),this.scene.on("dragging",this.onDragging),this.scene.on("dragend",this.onDragEnd),this.isEnable=!0}disable(){this.isEnable&&(this.scene.setMapStatus({dragEnable:!0}),this.container.style.cursor="auto",this.scene.off("dragstart",this.onDragStart),this.scene.off("dragging",this.onDragging),this.scene.off("dragend",this.onDragEnd),this.isEnable=!1)}syncBoxBound(){const{x:t,y:e}=this.startEvent,{x:r,y:n}=this.endEvent,a=Math.min(t,r),u=Math.min(e,n),y=Math.abs(t-r),A=Math.abs(e-n);this.box.style.top=`${u}px`,this.box.style.left=`${a}px`,this.box.style.width=`${y}px`,this.box.style.height=`${A}px`}getLngLatBox(){const{lngLat:{lng:t,lat:e}}=this.startEvent,{lngLat:{lng:r,lat:n}}=this.endEvent;return Rc([[t,e],[r,n]])}},BD=Object.defineProperty,FD=Object.defineProperties,kD=Object.getOwnPropertyDescriptors,GS=Object.getOwnPropertySymbols,ND=Object.prototype.hasOwnProperty,zD=Object.prototype.propertyIsEnumerable,WS=(t,e,r)=>e in t?BD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,UD=(t,e)=>{for(var r in e||(e={}))ND.call(e,r)&&WS(t,r,e[r]);if(GS)for(var r of GS(e))zD.call(e,r)&&WS(t,r,e[r]);return t},ZD=(t,e)=>FD(t,kD(e)),R_=(t,e,r)=>new Promise((n,a)=>{var u=O=>{try{A(r.next(O))}catch(Z){a(Z)}},y=O=>{try{A(r.throw(O))}catch(Z){a(Z)}},A=O=>O.done?n(O.value):Promise.resolve(O.value).then(u,y);A((r=r.apply(t,e)).next())}),VD=class{constructor(t){const{id:e,map:r,canvas:n,renderer:a="regl"}=t,u=jp();this.container=u,r.setContainer(u,e,n),a==="regl"?u.rendererService=new rD:u.rendererService=new DD,this.sceneService=u.sceneService,this.mapService=u.mapService,this.iconService=u.iconService,this.fontService=u.fontService,this.controlService=u.controlService,this.layerService=u.layerService,this.debugService=u.debugService,this.debugService.setEnable(t.debug),this.markerService=u.markerService,this.interactionService=u.interactionService,this.popupService=u.popupService,this.boxSelect=new OD(this,{}),this.initComponent(e),this.sceneService.init(t),this.initControl()}get map(){return this.mapService.map}get loaded(){return this.sceneService.loaded}getServiceContainer(){return this.container}getSize(){return this.mapService.getSize()}getMinZoom(){return this.mapService.getMinZoom()}getMaxZoom(){return this.mapService.getMaxZoom()}getType(){return this.mapService.getType()}getMapContainer(){return this.mapService.getMapContainer()}getMapCanvasContainer(){return this.mapService.getMapCanvasContainer()}getMapService(){return this.mapService}getDebugService(){return this.debugService}exportPng(t){return R_(this,null,function*(){return this.sceneService.exportPng(t)})}exportMap(t){return R_(this,null,function*(){return this.sceneService.exportPng(t)})}registerRenderService(t){this.sceneService.loaded?new t(this).init():this.on("loaded",()=>{new t(this).init()})}setBgColor(t){this.mapService.setBgColor(t)}addLayer(t){this.loaded?this.preAddLayer(t):this.once("loaded",()=>{this.preAddLayer(t)})}preAddLayer(t){const e=cp(this.container);if(t.setContainer(e),this.sceneService.addLayer(t),t.inited){this.initTileLayer(t);const r=this.initMask(t);this.addMask(r,t.id)}else t.on("inited",()=>{this.initTileLayer(t);const r=this.initMask(t);this.addMask(r,t.id)})}initMask(t){const{mask:e,maskfence:r,maskColor:n="#000",maskOpacity:a=0}=t.getLayerConfig();return!e||!r?void 0:new v2().source(r).shape("fill").style({color:n,opacity:a})}addMask(t,e){if(!t)return;const r=this.getLayer(e);if(r){const n=cp(this.container);t.setContainer(n),r.addMaskLayer(t),this.sceneService.addMask(t)}else console.warn("parent layer not find!")}getPickedLayer(){return this.layerService.pickedLayerId}getLayers(){return this.layerService.getLayers()}getLayer(t){return this.layerService.getLayer(t)}getLayerByName(t){return this.layerService.getLayerByName(t)}removeLayer(t,e){return R_(this,null,function*(){yield this.layerService.remove(t,e)})}removeAllLayer(){return R_(this,null,function*(){yield this.layerService.removeAllLayers()})}render(){this.sceneService.render()}setEnableRender(t){this.layerService.setEnableRender(t)}addIconFont(t,e){this.fontService.addIconFont(t,e)}addIconFonts(t){t.forEach(([e,r])=>{this.fontService.addIconFont(e,r)})}addFontFace(t,e){this.fontService.once("fontloaded",r=>{this.emit("fontloaded",r)}),this.fontService.addFontFace(t,e)}addImage(t,e){return R_(this,null,function*(){yield this.iconService.addImage(t,e)})}hasImage(t){return this.iconService.hasImage(t)}removeImage(t){this.iconService.removeImage(t)}addIconFontGlyphs(t,e){this.fontService.addIconGlyphs(e)}addControl(t){this.controlService.addControl(t,this.container)}removeControl(t){this.controlService.removeControl(t)}getControlByName(t){return this.controlService.getControlByName(t)}addMarker(t){this.markerService.addMarker(t)}addMarkerLayer(t){this.markerService.addMarkerLayer(t)}removeMarkerLayer(t){this.markerService.removeMarkerLayer(t)}removeAllMarkers(){this.markerService.removeAllMarkers()}removeAllMakers(){console.warn("removeAllMakers \u5DF2\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 removeAllMarkers"),this.markerService.removeAllMarkers()}addPopup(t){this.popupService.addPopup(t)}removePopup(t){this.popupService.removePopup(t)}on(t,e){var r;iE.includes(t)?(r=this.boxSelect)==null||r.on(t,e):dm.includes(t)?this.sceneService.on(t,e):this.mapService.on(t,e)}once(t,e){var r;iE.includes(t)?(r=this.boxSelect)==null||r.once(t,e):dm.includes(t)?this.sceneService.once(t,e):this.mapService.once(t,e)}emit(t,e){dm.indexOf(t)===-1?this.mapService.on(t,e):this.sceneService.emit(t,e)}off(t,e){var r;iE.includes(t)?(r=this.boxSelect)==null||r.off(t,e):dm.includes(t)?this.sceneService.off(t,e):this.mapService.off(t,e)}getZoom(){return this.mapService.getZoom()}getCenter(t){return this.mapService.getCenter(t)}setCenter(t,e){return this.mapService.setCenter(t,e)}getPitch(){return this.mapService.getPitch()}setPitch(t){return this.mapService.setPitch(t)}getRotation(){return this.mapService.getRotation()}getBounds(){return this.mapService.getBounds()}setRotation(t){this.mapService.setRotation(t)}zoomIn(){this.mapService.zoomIn()}zoomOut(){this.mapService.zoomOut()}panTo(t){this.mapService.panTo(t)}panBy(t,e){this.mapService.panBy(t,e)}getContainer(){return this.mapService.getContainer()}setZoom(t){this.mapService.setZoom(t)}fitBounds(t,e){const{fitBoundsOptions:r,animate:n}=this.sceneService.getSceneConfig();this.mapService.fitBounds(t,e||ZD(UD({},r),{animate:n}))}setZoomAndCenter(t,e){this.mapService.setZoomAndCenter(t,e)}setMapStyle(t){this.mapService.setMapStyle(t)}setMapStatus(t){this.mapService.setMapStatus(t)}pixelToLngLat(t){return this.mapService.pixelToLngLat(t)}lngLatToPixel(t){return this.mapService.lngLatToPixel(t)}containerToLngLat(t){return this.mapService.containerToLngLat(t)}lngLatToContainer(t){return this.mapService.lngLatToContainer(t)}destroy(){this.sceneService.destroy()}registerPostProcessingPass(t){this.container.postProcessingPass.name=new t}enableShaderPick(){this.layerService.enableShaderPick()}diasbleShaderPick(){this.layerService.disableShaderPick()}enableBoxSelect(t=!0){this.boxSelect.enable(),t&&this.boxSelect.once("selectend",()=>{this.disableBoxSelect()})}disableBoxSelect(){this.boxSelect.disable()}static addProtocol(t,e){je.REGISTERED_PROTOCOLS[t]=e}static removeProtocol(t){delete je.REGISTERED_PROTOCOLS[t]}getProtocol(t){return je.REGISTERED_PROTOCOLS[t]}startAnimate(){this.layerService.startAnimate()}stopAnimate(){this.layerService.stopAnimate()}getPointSizeRange(){return this.sceneService.getPointSizeRange()}initComponent(t){this.controlService.init({container:wc(t)},this.container),this.markerService.init(this.container),this.popupService.init(this.container)}initControl(){const{logoVisible:t,logoPosition:e}=this.sceneService.getSceneConfig();t&&this.addControl(new Ey({position:e}))}initTileLayer(t){t.getSource().isTile&&(t.tileLayer=new Xw(t))}},jD="2.21.8"},35855:function(Zr,_r,Se){"use strict";Se.d(_r,{$2:function(){return Qu},ns:function(){return na}});var ve=Se(5527),Ze=Se(93236),M=Se(31223),R=Se.n(M),de=function(C,P){return C===void 0&&(C=[]),P===void 0&&(P=[]),R()(C,P)},be=function(C){return function(P,U){var se=(0,Ze.useRef)(),Fe=(0,Ze.useRef)(0);(U===void 0||!de(U,se.current))&&(se.current=U,Fe.current+=1),C(P,[Fe.current])}},Le=be(Ze.useEffect),Re=Se(84875),Ce=Se.n(Re);function He(C){return C===void 0}var Xe=He;function Ke(C){return C===null}var Ve=Ke,et=typeof global=="object"&&global&&global.Object===Object&&global,er=et,fr=typeof self=="object"&&self&&self.Object===Object&&self,Ar=er||fr||Function("return this")(),pn=Ar,Kn=pn.Symbol,Jn=Kn,ki=Object.prototype,pa=ki.hasOwnProperty,xr=ki.toString,jt=Jn?Jn.toStringTag:void 0;function Jr(C){var P=pa.call(C,jt),U=C[jt];try{C[jt]=void 0;var se=!0}catch(rt){}var Fe=xr.call(C);return se&&(P?C[jt]=U:delete C[jt]),Fe}var gr=Jr,rn=Object.prototype,jn=rn.toString;function qe(C){return jn.call(C)}var Dt=qe,$e="[object Null]",Pt="[object Undefined]",vt=Jn?Jn.toStringTag:void 0;function rr(C){return C==null?C===void 0?Pt:$e:vt&&vt in Object(C)?gr(C):Dt(C)}var ar=rr;function wr(C){return C!=null&&typeof C=="object"}var Cr=wr,an="[object Number]";function yi(C){return typeof C=="number"||Cr(C)&&ar(C)==an}var li=yi,Uo=Se(80216);function vi(C){"@babel/helpers - typeof";return vi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},vi(C)}function bo(C,P){var U=typeof Symbol!="undefined"&&C[Symbol.iterator]||C["@@iterator"];if(!U){if(Array.isArray(C)||(U=So(C))||P&&C&&typeof C.length=="number"){U&&(C=U);var se=0,Fe=function(){};return{s:Fe,n:function(){return se>=C.length?{done:!0}:{done:!1,value:C[se++]}},e:function(ur){throw ur},f:Fe}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var rt=!0,yt=!1,dt;return{s:function(){U=U.call(C)},n:function(){var ur=U.next();return rt=ur.done,ur},e:function(ur){yt=!0,dt=ur},f:function(){try{!rt&&U.return!=null&&U.return()}finally{if(yt)throw dt}}}}function So(C,P){if(C){if(typeof C=="string")return Xi(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return Xi(C,P)}}function Xi(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);U0&&arguments[0]!==void 0?arguments[0]:{};return Object.entries(P!=null?P:{}).map(function(U){var se=Va(U,2),Fe=se[0],rt=se[1],yt=Sl(Fe),dt=rt;return typeof dt=="number"?dt="".concat(dt,"px"):typeof dt=="string"&&(dt=dt.replace("'","")),"".concat(yt," :").concat(dt)}).join("; ")};function Os(C,P){return Fu(C)||Tl(C,P)||Io(C,P)||Nl()}function Nl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Io(C,P){if(C){if(typeof C=="string")return eu(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return eu(C,P)}}function eu(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);U1&&arguments[1]!==void 0?arguments[1]:!1;return Object.entries(C).sort(function(U,se){var Fe=Os(U,1),rt=Fe[0],yt=Os(se,1),dt=yt[0];return rt.localeCompare(dt)}).map(function(U){var se=Os(U,2),Fe=se[0],rt=se[1],yt=String(rt);return P&&(yt=window.encodeURI(String(rt))),"".concat(Fe,"=").concat(yt)}).join("&")}function al(C,P){return"".concat(C,"?").concat(Ju(P,!0))}function Kc(C){"@babel/helpers - typeof";return Kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},Kc(C)}function ou(){"use strict";ou=function(){return P};var C,P={},U=Object.prototype,se=U.hasOwnProperty,Fe=Object.defineProperty||function(hr,It,Qt){hr[It]=Qt.value},rt=typeof Symbol=="function"?Symbol:{},yt=rt.iterator||"@@iterator",dt=rt.asyncIterator||"@@asyncIterator",zt=rt.toStringTag||"@@toStringTag";function ur(hr,It,Qt){return Object.defineProperty(hr,It,{value:Qt,enumerable:!0,configurable:!0,writable:!0}),hr[It]}try{ur({},"")}catch(hr){ur=function(Qt,tn,Cn){return Qt[tn]=Cn}}function on(hr,It,Qt,tn){var Cn=It&&It.prototype instanceof _o?It:_o,gn=Object.create(Cn.prototype),zo=new zs(tn||[]);return Fe(gn,"_invoke",{value:aa(hr,Qt,zo)}),gn}function pi(hr,It,Qt){try{return{type:"normal",arg:hr.call(It,Qt)}}catch(tn){return{type:"throw",arg:tn}}}P.wrap=on;var Hi="suspendedStart",so="suspendedYield",uo="executing",ei="completed",ii={};function _o(){}function Li(){}function yo(){}var Ta={};ur(Ta,yt,function(){return this});var Ha=Object.getPrototypeOf,Ua=Ha&&Ha(Ha($s([])));Ua&&Ua!==U&&se.call(Ua,yt)&&(Ta=Ua);var ma=yo.prototype=_o.prototype=Object.create(Ta);function Zs(hr){["next","throw","return"].forEach(function(It){ur(hr,It,function(Qt){return this._invoke(It,Qt)})})}function Ts(hr,It){function Qt(Cn,gn,zo,fs){var Vs=pi(hr[Cn],hr,gn);if(Vs.type!=="throw"){var Lh=Vs.arg,yc=Lh.value;return yc&&Kc(yc)=="object"&&se.call(yc,"__await")?It.resolve(yc.__await).then(function(hp){Qt("next",hp,zo,fs)},function(hp){Qt("throw",hp,zo,fs)}):It.resolve(yc).then(function(hp){Lh.value=hp,zo(Lh)},function(hp){return Qt("throw",hp,zo,fs)})}fs(Vs.arg)}var tn;Fe(this,"_invoke",{value:function(gn,zo){function fs(){return new It(function(Vs,Lh){Qt(gn,zo,Vs,Lh)})}return tn=tn?tn.then(fs,fs):fs()}})}function aa(hr,It,Qt){var tn=Hi;return function(Cn,gn){if(tn===uo)throw new Error("Generator is already running");if(tn===ei){if(Cn==="throw")throw gn;return{value:C,done:!0}}for(Qt.method=Cn,Qt.arg=gn;;){var zo=Qt.delegate;if(zo){var fs=La(zo,Qt);if(fs){if(fs===ii)continue;return fs}}if(Qt.method==="next")Qt.sent=Qt._sent=Qt.arg;else if(Qt.method==="throw"){if(tn===Hi)throw tn=ei,Qt.arg;Qt.dispatchException(Qt.arg)}else Qt.method==="return"&&Qt.abrupt("return",Qt.arg);tn=uo;var Vs=pi(hr,It,Qt);if(Vs.type==="normal"){if(tn=Qt.done?ei:so,Vs.arg===ii)continue;return{value:Vs.arg,done:Qt.done}}Vs.type==="throw"&&(tn=ei,Qt.method="throw",Qt.arg=Vs.arg)}}}function La(hr,It){var Qt=It.method,tn=hr.iterator[Qt];if(tn===C)return It.delegate=null,Qt==="throw"&&hr.iterator.return&&(It.method="return",It.arg=C,La(hr,It),It.method==="throw")||Qt!=="return"&&(It.method="throw",It.arg=new TypeError("The iterator does not provide a '"+Qt+"' method")),ii;var Cn=pi(tn,hr.iterator,It.arg);if(Cn.type==="throw")return It.method="throw",It.arg=Cn.arg,It.delegate=null,ii;var gn=Cn.arg;return gn?gn.done?(It[hr.resultName]=gn.value,It.next=hr.nextLoc,It.method!=="return"&&(It.method="next",It.arg=C),It.delegate=null,ii):gn:(It.method="throw",It.arg=new TypeError("iterator result is not an object"),It.delegate=null,ii)}function hl(hr){var It={tryLoc:hr[0]};1 in hr&&(It.catchLoc=hr[1]),2 in hr&&(It.finallyLoc=hr[2],It.afterLoc=hr[3]),this.tryEntries.push(It)}function As(hr){var It=hr.completion||{};It.type="normal",delete It.arg,hr.completion=It}function zs(hr){this.tryEntries=[{tryLoc:"root"}],hr.forEach(hl,this),this.reset(!0)}function $s(hr){if(hr||hr===""){var It=hr[yt];if(It)return It.call(hr);if(typeof hr.next=="function")return hr;if(!isNaN(hr.length)){var Qt=-1,tn=function Cn(){for(;++Qt=0;--Cn){var gn=this.tryEntries[Cn],zo=gn.completion;if(gn.tryLoc==="root")return tn("end");if(gn.tryLoc<=this.prev){var fs=se.call(gn,"catchLoc"),Vs=se.call(gn,"finallyLoc");if(fs&&Vs){if(this.prev=0;--tn){var Cn=this.tryEntries[tn];if(Cn.tryLoc<=this.prev&&se.call(Cn,"finallyLoc")&&this.prev=0;--Qt){var tn=this.tryEntries[Qt];if(tn.finallyLoc===It)return this.complete(tn.completion,tn.afterLoc),As(tn),ii}},catch:function(It){for(var Qt=this.tryEntries.length-1;Qt>=0;--Qt){var tn=this.tryEntries[Qt];if(tn.tryLoc===It){var Cn=tn.completion;if(Cn.type==="throw"){var gn=Cn.arg;As(tn)}return gn}}throw new Error("illegal catch attempt")},delegateYield:function(It,Qt,tn){return this.delegate={iterator:$s(It),resultName:Qt,nextLoc:tn},this.method==="next"&&(this.arg=C),ii}},P}function Ks(C,P,U,se,Fe,rt,yt){try{var dt=C[rt](yt),zt=dt.value}catch(ur){U(ur);return}dt.done?P(zt):Promise.resolve(zt).then(se,Fe)}function Lp(C){return function(){var P=this,U=arguments;return new Promise(function(se,Fe){var rt=C.apply(P,U);function yt(zt){Ks(rt,se,Fe,yt,dt,"next",zt)}function dt(zt){Ks(rt,se,Fe,yt,dt,"throw",zt)}yt(void 0)})}}var gf=function(){var C=Lp(ou().mark(function P(U,se){return ou().wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:if(U!=="Map"){rt.next=2;break}return rt.abrupt("return",new ve.Map(se));case 2:if(U!=="Gaode"){rt.next=6;break}return rt.abrupt("return",new ve.GaodeMap(se));case 6:if(U!=="GaodeV1"){rt.next=10;break}return rt.abrupt("return",new ve.GaodeMapV1(se));case 10:if(U!=="GaodeV2"){rt.next=12;break}return rt.abrupt("return",new ve.GaodeMapV2(se));case 12:if(U!=="Tencent"){rt.next=14;break}return rt.abrupt("return",Promise.resolve(Promise.resolve().then(Se.bind(Se,5527))).then(function(yt){var dt=yt.TencentMap;return new dt(se)}));case 14:if(U!=="Baidu"){rt.next=16;break}return rt.abrupt("return",Promise.resolve(Promise.resolve().then(Se.bind(Se,5527))).then(function(yt){var dt=yt.BaiduMap;return new dt(se)}));case 16:return rt.abrupt("return",Promise.resolve(Promise.resolve().then(Se.bind(Se,5527))).then(function(yt){var dt=yt.Mapbox;return new dt(se)}));case 17:case"end":return rt.stop()}},P)}));return function(U,se){return C.apply(this,arguments)}}(),Of=function(C,P){return C?C.map(function(U,se){return Object.is(C[se],P==null?void 0:P[se])?-1:se}).filter(function(U){return U>=0}):P?P.map(function(U,se){return se}):[]},qh=function(C,P){var U=(0,Ze.useRef)();(0,Ze.useEffect)(function(){var se=Of(U.current,P),Fe=U.current;return U.current=P,C(se,Fe,P)},P)},zc=qh,Oh=Se(91168),Ms={onLoaded:"loaded",onDestroy:"destroy",onResize:"resize",onMapMove:"mapmove",onMoveStart:"movestart",onMoveEnd:"moveend",onZoomChange:"zoomchange",onZoomStart:"zoomstart",onZoomEnd:"zoomend",onClick:"click",onDblclick:"dblclick",onContextMenu:"contextmenu",onMouseMove:"mousemove",onMouseWheel:"mousewheel",onMouseDown:"mousedown",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseUp:"mouseup",onDragStart:"dragstart",onDragging:"dragging",onDragEnd:"dragend"},Jc=Object.keys(Ms);function Yh(C){return yh(C)||eh(C)||uc(C)||Qc()}function Qc(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uc(C,P){if(C){if(typeof C=="string")return sl(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return sl(C,P)}}function eh(C){if(typeof Symbol!="undefined"&&C[Symbol.iterator]!=null||C["@@iterator"]!=null)return Array.from(C)}function yh(C){if(Array.isArray(C))return sl(C)}function sl(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);U=0)&&Object.prototype.propertyIsEnumerable.call(C,se)&&(U[se]=C[se])}return U}function Ep(C,P){if(C==null)return{};var U={},se=Object.keys(C),Fe,rt;for(rt=0;rt=0)&&(U[Fe]=C[Fe]);return U}var Na=Ze.createContext(null),Qu=(0,Ze.memo)((0,Ze.forwardRef)(function(P,U){var se=P.id,Fe=P.style,rt=P.className,yt=P.map,dt=P.mapType,zt=dt===void 0?"Gaode":dt,ur=P.mapOptions,on=ur===void 0?{}:ur,pi=P.onLayerManagerCreated,Hi=P.onSceneLoaded,so=P.children,uo=Hs(P,fp),ei=(0,Ze.useRef)(),ii=(0,Ze.useState)(null),_o=zl(ii,2),Li=_o[0],yo=_o[1],Ta=(0,Ze.useRef)({scene:null,layerManager:null}),Ha=Ta.current;(0,Ze.useEffect)(function(){var ma,Zs=!0,Ts=Xe(yt)?gf(zt,on):typeof yt=="function"?yt():yt;return Promise.resolve(Ts).then(function(aa){if(Zs){ma=new ve.Scene(Ps(Ps({},uo),{},{id:ei.current,map:aa}));var La=new or({scene:ma});Ha.scene=ma,Ha.layerManager=La,ma.once("loaded",function(){Hi&&Hi(ma),pi&&pi(La),yo(ma)})}}).catch(function(aa){console.error(aa)}),function(){Zs=!1,ma&&(Ha.scene=null,Ha.layerManager=null,ma.destroy())}},[]),Uc(Li,P),(0,Ze.useImperativeHandle)(U,function(){return{getScene:function(){return Li},getMap:function(){return Li.map}}},[Li]),(0,Ze.useEffect)(function(){Li&&on.style&&Li.setMapStyle(on.style)},[on.style]),Le(function(){Ve(Li)||(on.center&&li(on.zoom)?Li.setZoomAndCenter(on.zoom,on.center):li(on.zoom)?Li.setZoom(on.zoom):on.center&&Li.setCenter(on.center))},[on.zoom,on.center]),(0,Ze.useEffect)(function(){Li&&li(on.pitch)&&Li.setPitch(on.pitch)},[on.pitch]),(0,Ze.useEffect)(function(){Li&&li(on.rotation)&&Li.setRotation(on.rotation)},[on.rotation]);var Ua=(0,Ze.useMemo)(function(){return Ps({position:"relative"},Fe)},[Fe]);return Ze.createElement("div",{id:se,ref:ei,style:Ua,className:Ce()("larkmap",rt)},Li&&Ze.createElement(Na.Provider,{value:Ha},so))})),Is=Se(8573),ys=function(){var P=(0,Ze.useContext)(Na);if(!P)throw new Error("The useScene must be used in the LarkMap container");var U=P.scene;return U},ec=function(P,U,se){var Fe=ys(),rt=(0,Ze.useRef)();(0,Ze.useEffect)(function(){var yt=new ve.Control(se);return yt.onAdd=function(){return P(Fe)},yt.onRemove=function(){},rt.current=yt,Fe.addControl(yt),function(){typeof U=="function"&&U(Fe),rt.current=null,Fe.removeControl(yt)}},[]),(0,Is.Z)(function(){var yt;(yt=rt.current)===null||yt===void 0||yt.setOptions(se)},[se])},Bf=function(){var P=(0,Ze.useContext)(Na);if(!P)throw new Error("The useLayerManager must be used in the LarkMap container");var U=P.layerManager;return U};function es(C,P){return $h(C)||Sc(C,P)||wc(C,P)||Bs()}function Bs(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wc(C,P){if(C){if(typeof C=="string")return qp(C,P);var U=Object.prototype.toString.call(C).slice(8,-1);if(U==="Object"&&C.constructor&&(U=C.constructor.name),U==="Map"||U==="Set")return Array.from(C);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return qp(C,P)}}function qp(C,P){(P==null||P>C.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);U-1}var Ac=Jh;function kh(C,P){var U=this.__data__,se=Fh(U,C);return se<0?(++this.size,U.push([C,P])):U[se][1]=P,this}var Iu=kh;function rh(C){var P=-1,U=C==null?0:C.length;for(this.clear();++Pdt))return!1;var ur=rt.get(C),on=rt.get(P);if(ur&&on)return ur==P&&on==C;var pi=-1,Hi=!0,so=U&b?new ne:void 0;for(rt.set(C,P),rt.set(P,C);++pi-1&&C%1==0&&C-1&&C%1==0&&C<=Ol}var _f=ph,ip="[object Arguments]",yf="[object Array]",Hu="[object Boolean]",Bp="[object Date]",fc="[object Error]",Wf="[object Function]",op="[object Map]",ef="[object Number]",_s="[object Object]",Ff="[object RegExp]",sd="[object Set]",fh="[object String]",_d="[object WeakMap]",ld="[object ArrayBuffer]",ym="[object DataView]",Xf="[object Float32Array]",tm="[object Float64Array]",Gu="[object Int8Array]",xf="[object Int16Array]",tf="[object Int32Array]",ud="[object Uint8Array]",qf="[object Uint8ClampedArray]",Dd="[object Uint16Array]",Yf="[object Uint32Array]",Kl={};Kl[Xf]=Kl[tm]=Kl[Gu]=Kl[xf]=Kl[tf]=Kl[ud]=Kl[qf]=Kl[Dd]=Kl[Yf]=!0,Kl[ip]=Kl[yf]=Kl[ld]=Kl[Hu]=Kl[ym]=Kl[Bp]=Kl[fc]=Kl[Wf]=Kl[op]=Kl[ef]=Kl[_s]=Kl[Ff]=Kl[sd]=Kl[fh]=Kl[_d]=!1;function Od(C){return Cr(C)&&_f(C.length)&&!!Kl[ar(C)]}var Bd=Od;function bf(C){return function(P){return C(P)}}var wp=bf,$f=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ap=$f&&typeof module=="object"&&module&&!module.nodeType&&module,kf=ap&&ap.exports===$f,xl=kf&&er.process,dc=function(){try{var C=ap&&ap.require&&ap.require("util").types;return C||xl&&xl.binding&&xl.binding("util")}catch(P){}}(),Fp=dc,Sp=Fp&&Fp.isTypedArray,rf=Sp?wp(Sp):Bd,nf=rf,Nf=Object.prototype,zf=Nf.hasOwnProperty;function of(C,P){var U=(0,dn.Z)(C),se=!U&&np(C),Fe=!U&&!se&&Vu(C),rt=!U&&!se&&!Fe&&nf(C),yt=U||se||Fe||rt,dt=yt?ja(C.length,String):[],zt=dt.length;for(var ur in C)(P||zf.call(C,ur))&&!(yt&&(ur=="length"||Fe&&(ur=="offset"||ur=="parent")||rt&&(ur=="buffer"||ur=="byteLength"||ur=="byteOffset")||yl(ur,zt)))&&dt.push(ur);return dt}var af=of,kp=Object.prototype;function yd(C){var P=C&&C.constructor,U=typeof P=="function"&&P.prototype||kp;return C===U}var Dc=yd;function _p(C,P){return function(U){return C(P(U))}}var Kf=_p,xd=Kf(Object.keys,Object),bd=xd,Ed=Object.prototype,Tp=Ed.hasOwnProperty;function Ef(C){if(!Dc(C))return bd(C);var P=[];for(var U in Object(C))Tp.call(C,U)&&U!="constructor"&&P.push(U);return P}var wd=Ef;function cd(C){return C!=null&&_f(C.length)&&!Cc(C)}var hd=cd;function Uf(C){return hd(C)?af(C):wd(C)}var sf=Uf;function Ou(C){return Wi(C,sf,Cl)}var Zh=Ou,lf=1,Ah=Object.prototype,Np=Ah.hasOwnProperty;function pd(C,P,U,se,Fe,rt){var yt=U&lf,dt=Zh(C),zt=dt.length,ur=Zh(P),on=ur.length;if(zt!=on&&!yt)return!1;for(var pi=zt;pi--;){var Hi=dt[pi];if(!(yt?Hi in P:Np.call(P,Hi)))return!1}var so=rt.get(C),uo=rt.get(P);if(so&&uo)return so==P&&uo==C;var ei=!0;rt.set(C,P),rt.set(P,C);for(var ii=yt;++pi=0)&&Object.prototype.propertyIsEnumerable.call(C,se)&&(U[se]=C[se])}return U}function Mn(C,P){if(C==null)return{};var U={},se=Object.keys(C),Fe,rt;for(rt=0;rt=0)&&(U[Fe]=C[Fe]);return U}var yn=function(P,U){var se=U.onCreated,Fe=U.source,rt=Pr(U,mt),yt=Bf(),dt=(0,Ze.useRef)(),zt=(0,Ze.useRef)(rt),ur=(0,Ze.useRef)(Fe);return dt.current||(dt.current=new P(U),se&&dt.current.once("inited",function(){return se(dt.current)}),yt.addLayer(dt.current)),(0,Is.Z)(function(){if(dt.current){var on=!Bn(zt.current,rt);on&&(dt.current.update(rt),zt.current=Ge(rt))}},[rt]),(0,Is.Z)(function(){if(dt.current){var on=Fe.data,pi=Pr(Fe,St),Hi=ur.current,so=Hi.data,uo=Pr(Hi,xt),ei=on!==so||!Bn(pi,uo);ei&&(dt.current.changeData(Fe),ur.current=kt({},Fe))}},[Fe]),(0,Ze.useEffect)(function(){return function(){dt.current&&(yt.removeLayer(dt.current),dt.current=null)}},[]),dt},kr={onRemove:"remove",onShow:"show",onHide:"hide",onDataUpdate:"dataUpdate",onLegend:"legend",onLegendColor:"legend:color",onLegendSize:"legend:size",onClick:"click",onUnClick:"unclick",onDblClick:"dblclick",onUndblclick:"undblclick",onContextMenu:"contextmenu",onUnContextMenu:"uncontextmenu",onMouseEnter:"mouseenter",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseUp:"mouseup",onMouseDown:"mousedown",onUnMousemove:"unmousemove",onUnMouseup:"unmouseup",onUnMousedown:"unmousedown",onUnPick:"unpick"},Ai=function(P,U){var se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:kr,Fe=(0,Ze.useMemo)(function(){return Object.keys(se)},[se]),rt=function(on){Fe.forEach(function(pi){var Hi=se[pi],so=U[pi];pi&&so&&P[on](Hi,so)})},yt=function(){return rt("on")},dt=function(){return rt("off")},zt=(0,Ze.useRef)(!0);zt.current&&yt(),(0,Ze.useEffect)(function(){return zt.current?zt.current=!1:yt(),function(){dt()}},Fe.map(function(ur){return U[ur]})),(0,Oh.Z)(function(){dt()})},$n=null,ti=null,ri=null,hn=Se(13206),An=Se(13526);function Yi(C,P){return function(){for(var U=[],se=0;seC.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);UFe?0:Fe+P),U=U>Fe?Fe:U,U<0&&(U+=Fe),Fe=P>U?0:U-P>>>0,P>>>=0;for(var rt=Array(Fe);++se0&&U(dt)?P>1?ey(dt,P-1,U,se,Fe):ho(Fe,dt):se||(Fe[Fe.length]=dt)}return Fe}var ty=ey;function ry(C){var P=C==null?0:C.length;return P?ty(C,1):[]}var ny=ry;function Wx(C,P,U){switch(U.length){case 0:return C.call(P);case 1:return C.call(P,U[0]);case 2:return C.call(P,U[0],U[1]);case 3:return C.call(P,U[0],U[1],U[2])}return C.apply(P,U)}var Xx=Wx,iy=Math.max;function oy(C,P,U){return P=iy(P===void 0?C.length-1:P,0),function(){for(var se=arguments,Fe=-1,rt=iy(se.length-P,0),yt=Array(rt);++Fe0){if(++P>=Wg)return arguments[0]}else P=0;return C.apply(void 0,arguments)}}var Qx=cy,eb=Qx(ly),tb=eb;function rb(C){return tb(qx(C,void 0,ny),C+"")}var nb=rb,vv=1,ib=2,ob=4,ab=nb(function(C,P){var U={};if(C==null)return U;var se=!1;P=wa(P,function(rt){return rt=gv(rt,C),se||(se=rt.length>1),rt}),xi(C,ya(C),U),se&&(U=ie(U,vv|ib|ob,K_));for(var Fe=P.length;Fe--;)Nx(U,P[Fe]);return U}),sb=ab,_v=Se(77374);function Xg(C){"@babel/helpers - typeof";return Xg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},Xg(C)}var Rg=["prefixCls","bordered","className","getPopupContainer","dropdownClassName","popupClassName","listHeight","placement","listItemHeight","disabled","notFoundContent"];function yv(){return yv=Object.assign?Object.assign.bind():function(C){for(var P=1;P=0)&&Object.prototype.propertyIsEnumerable.call(C,se)&&(U[se]=C[se])}return U}function pb(C,P){if(C==null)return{};var U={},se=Object.keys(C),Fe,rt;for(rt=0;rt=0)&&(U[Fe]=C[Fe]);return U}var hy="SECRET_COMBOBOX_MODE_DO_NOT_USE",xv="larkmap-select",fb=function(P,U){var se=P.prefixCls,Fe=P.bordered,rt=Fe===void 0?!0:Fe,yt=P.className,dt=P.getPopupContainer,zt=P.dropdownClassName,ur=P.popupClassName,on=P.listHeight,pi=on===void 0?256:on,Hi=P.placement,so=P.listItemHeight,uo=so===void 0?24:so,ei=P.disabled,ii=P.notFoundContent,_o=hb(P,Rg),Li=Ze.useMemo(function(){var Ha=_o,Ua=Ha.mode;if(Ua!=="combobox")return Ua===hy?"combobox":Ua},[_o]),yo=sb(_o,"suffixIcon","itemIcon"),Ta=Ce()(lb({},"".concat(xv,"-borderless"),!rt),yt);return Ze.createElement(_v.ZP,yv({ref:U},yo,{listHeight:pi,listItemHeight:uo,mode:Li,prefixCls:xv,placement:Hi,notFoundContent:ii!=null?ii:"\u5F53\u524D\u65E0\u6570\u636E",className:Ta,getPopupContainer:dt,dropdownClassName:ur,disabled:ei}))},v0=Ze.forwardRef(fb);v0.SECRET_COMBOBOX_MODE_DO_NOT_USE=hy,v0.Option=_v.Wx,v0.OptGroup=_v.Xo;var bv=v0;function cg(C){"@babel/helpers - typeof";return cg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},cg(C)}var db=["searchParams","showDistrict","showAddress","onSearchFinish","onChange"],mb=["keywords","privateKey"];function Ev(){return Ev=Object.assign?Object.assign.bind():function(C){for(var P=1;P=0;--Cn){var gn=this.tryEntries[Cn],zo=gn.completion;if(gn.tryLoc==="root")return tn("end");if(gn.tryLoc<=this.prev){var fs=se.call(gn,"catchLoc"),Vs=se.call(gn,"finallyLoc");if(fs&&Vs){if(this.prev=0;--tn){var Cn=this.tryEntries[tn];if(Cn.tryLoc<=this.prev&&se.call(Cn,"finallyLoc")&&this.prev=0;--Qt){var tn=this.tryEntries[Qt];if(tn.finallyLoc===It)return this.complete(tn.completion,tn.afterLoc),As(tn),ii}},catch:function(It){for(var Qt=this.tryEntries.length-1;Qt>=0;--Qt){var tn=this.tryEntries[Qt];if(tn.tryLoc===It){var Cn=tn.completion;if(Cn.type==="throw"){var gn=Cn.arg;As(tn)}return gn}}throw new Error("illegal catch attempt")},delegateYield:function(It,Qt,tn){return this.delegate={iterator:$s(It),resultName:Qt,nextLoc:tn},this.method==="next"&&(this.arg=C),ii}},P}function py(C){return fy(C)||vb(C)||Xd(C)||gb()}function gb(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vb(C){if(typeof Symbol!="undefined"&&C[Symbol.iterator]!=null||C["@@iterator"]!=null)return Array.from(C)}function fy(C){if(Array.isArray(C))return hg(C)}function Sv(C,P){var U=Object.keys(C);if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(C);P&&(se=se.filter(function(Fe){return Object.getOwnPropertyDescriptor(C,Fe).enumerable})),U.push.apply(U,se)}return U}function dy(C){for(var P=1;PC.length)&&(P=C.length);for(var U=0,se=new Array(P);U=0)&&Object.prototype.propertyIsEnumerable.call(C,se)&&(U[se]=C[se])}return U}function pg(C,P){if(C==null)return{};var U={},se=Object.keys(C),Fe,rt;for(rt=0;rt=0)&&(U[Fe]=C[Fe]);return U}var Cv=bv.Option,km=function(P){var U=P.searchParams,se=P.showDistrict,Fe=P.showAddress,rt=P.onSearchFinish,yt=P.onChange,dt=Av(P,db),zt=(0,Ze.useState)([]),ur=vy(zt,2),on=ur[0],pi=ur[1];(0,Ze.useEffect)(function(){rt==null||rt(on)},[rt,on]);var Hi=k_(function(){var ei=yb(wv().mark(function ii(_o){var Li,yo,Ta,Ha,Ua,ma,Zs;return wv().wrap(function(aa){for(;;)switch(aa.prev=aa.next){case 0:if(_o){aa.next=3;break}return pi([]),aa.abrupt("return");case 3:return yo=U.keywords,Ta=U.privateKey,Ha=Av(U,mb),Ua=dy(dy({},Ha),{},{keywords:[].concat(py((yo!=null?yo:"").split("|")),[_o]).filter(function(La){return!!La}).join("|")}),Ta&&(Ua.sig=z_()(Ju(Ua,!1)+Ta)),ma="".concat(yx,"?").concat(Ju(Ua,!0)),aa.next=9,fetch(ma);case 9:return aa.next=11,aa.sent.json();case 11:Zs=aa.sent,pi(((Li=Zs==null?void 0:Zs.tips)!==null&&Li!==void 0?Li:[]).filter(function(La){return La.location&&La.location.length}).map(function(La){var hl=La.location.split(","),As=vy(hl,2),zs=As[0],$s=As[1];return La.longitude=+zs,La.latitude=+$s,La}));case 13:case"end":return aa.stop()}},ii)}));return function(ii){return ei.apply(this,arguments)}}(),{wait:1e3}),so=Hi.run,uo=(0,Ze.useCallback)(function(ei){var ii=ei&&on.find(function(_o){return _o.name===ei});yt==null||yt(ei||void 0,ii||void 0)},[yt,on]);return Ze.createElement(bv,Ev({className:"".concat(mv),onSearch:so,onChange:uo,clearIcon:function(){return null}},dt),on.map(function(ei){var ii="".concat(se?ei.district:"").concat(Fe?ei.address:"");return Ze.createElement(Cv,{key:ei.id,value:ei.name},Ze.createElement("div",{title:ei.name,className:"".concat(mv,"__option-name")},ei.name),ii&&Ze.createElement("div",{title:ii,className:"".concat(mv,"__option-tip")},ii))}))};km.defaultProps={placeholder:"\u8BF7\u8F93\u5165\u8981\u641C\u7D22\u5730\u540D",showSearch:!0,allowClear:!0,filterOption:!1,defaultActiveFirstOption:!1,showAddress:!0,showDistrict:!0};function fg(C){"@babel/helpers - typeof";return fg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},fg(C)}function _0(){"use strict";_0=function(){return P};var C,P={},U=Object.prototype,se=U.hasOwnProperty,Fe=Object.defineProperty||function(hr,It,Qt){hr[It]=Qt.value},rt=typeof Symbol=="function"?Symbol:{},yt=rt.iterator||"@@iterator",dt=rt.asyncIterator||"@@asyncIterator",zt=rt.toStringTag||"@@toStringTag";function ur(hr,It,Qt){return Object.defineProperty(hr,It,{value:Qt,enumerable:!0,configurable:!0,writable:!0}),hr[It]}try{ur({},"")}catch(hr){ur=function(Qt,tn,Cn){return Qt[tn]=Cn}}function on(hr,It,Qt,tn){var Cn=It&&It.prototype instanceof _o?It:_o,gn=Object.create(Cn.prototype),zo=new zs(tn||[]);return Fe(gn,"_invoke",{value:aa(hr,Qt,zo)}),gn}function pi(hr,It,Qt){try{return{type:"normal",arg:hr.call(It,Qt)}}catch(tn){return{type:"throw",arg:tn}}}P.wrap=on;var Hi="suspendedStart",so="suspendedYield",uo="executing",ei="completed",ii={};function _o(){}function Li(){}function yo(){}var Ta={};ur(Ta,yt,function(){return this});var Ha=Object.getPrototypeOf,Ua=Ha&&Ha(Ha($s([])));Ua&&Ua!==U&&se.call(Ua,yt)&&(Ta=Ua);var ma=yo.prototype=_o.prototype=Object.create(Ta);function Zs(hr){["next","throw","return"].forEach(function(It){ur(hr,It,function(Qt){return this._invoke(It,Qt)})})}function Ts(hr,It){function Qt(Cn,gn,zo,fs){var Vs=pi(hr[Cn],hr,gn);if(Vs.type!=="throw"){var Lh=Vs.arg,yc=Lh.value;return yc&&fg(yc)=="object"&&se.call(yc,"__await")?It.resolve(yc.__await).then(function(hp){Qt("next",hp,zo,fs)},function(hp){Qt("throw",hp,zo,fs)}):It.resolve(yc).then(function(hp){Lh.value=hp,zo(Lh)},function(hp){return Qt("throw",hp,zo,fs)})}fs(Vs.arg)}var tn;Fe(this,"_invoke",{value:function(gn,zo){function fs(){return new It(function(Vs,Lh){Qt(gn,zo,Vs,Lh)})}return tn=tn?tn.then(fs,fs):fs()}})}function aa(hr,It,Qt){var tn=Hi;return function(Cn,gn){if(tn===uo)throw new Error("Generator is already running");if(tn===ei){if(Cn==="throw")throw gn;return{value:C,done:!0}}for(Qt.method=Cn,Qt.arg=gn;;){var zo=Qt.delegate;if(zo){var fs=La(zo,Qt);if(fs){if(fs===ii)continue;return fs}}if(Qt.method==="next")Qt.sent=Qt._sent=Qt.arg;else if(Qt.method==="throw"){if(tn===Hi)throw tn=ei,Qt.arg;Qt.dispatchException(Qt.arg)}else Qt.method==="return"&&Qt.abrupt("return",Qt.arg);tn=uo;var Vs=pi(hr,It,Qt);if(Vs.type==="normal"){if(tn=Qt.done?ei:so,Vs.arg===ii)continue;return{value:Vs.arg,done:Qt.done}}Vs.type==="throw"&&(tn=ei,Qt.method="throw",Qt.arg=Vs.arg)}}}function La(hr,It){var Qt=It.method,tn=hr.iterator[Qt];if(tn===C)return It.delegate=null,Qt==="throw"&&hr.iterator.return&&(It.method="return",It.arg=C,La(hr,It),It.method==="throw")||Qt!=="return"&&(It.method="throw",It.arg=new TypeError("The iterator does not provide a '"+Qt+"' method")),ii;var Cn=pi(tn,hr.iterator,It.arg);if(Cn.type==="throw")return It.method="throw",It.arg=Cn.arg,It.delegate=null,ii;var gn=Cn.arg;return gn?gn.done?(It[hr.resultName]=gn.value,It.next=hr.nextLoc,It.method!=="return"&&(It.method="next",It.arg=C),It.delegate=null,ii):gn:(It.method="throw",It.arg=new TypeError("iterator result is not an object"),It.delegate=null,ii)}function hl(hr){var It={tryLoc:hr[0]};1 in hr&&(It.catchLoc=hr[1]),2 in hr&&(It.finallyLoc=hr[2],It.afterLoc=hr[3]),this.tryEntries.push(It)}function As(hr){var It=hr.completion||{};It.type="normal",delete It.arg,hr.completion=It}function zs(hr){this.tryEntries=[{tryLoc:"root"}],hr.forEach(hl,this),this.reset(!0)}function $s(hr){if(hr||hr===""){var It=hr[yt];if(It)return It.call(hr);if(typeof hr.next=="function")return hr;if(!isNaN(hr.length)){var Qt=-1,tn=function Cn(){for(;++Qt=0;--Cn){var gn=this.tryEntries[Cn],zo=gn.completion;if(gn.tryLoc==="root")return tn("end");if(gn.tryLoc<=this.prev){var fs=se.call(gn,"catchLoc"),Vs=se.call(gn,"finallyLoc");if(fs&&Vs){if(this.prev=0;--tn){var Cn=this.tryEntries[tn];if(Cn.tryLoc<=this.prev&&se.call(Cn,"finallyLoc")&&this.prev=0;--Qt){var tn=this.tryEntries[Qt];if(tn.finallyLoc===It)return this.complete(tn.completion,tn.afterLoc),As(tn),ii}},catch:function(It){for(var Qt=this.tryEntries.length-1;Qt>=0;--Qt){var tn=this.tryEntries[Qt];if(tn.tryLoc===It){var Cn=tn.completion;if(Cn.type==="throw"){var gn=Cn.arg;As(tn)}return gn}}throw new Error("illegal catch attempt")},delegateYield:function(It,Qt,tn){return this.delegate={iterator:$s(It),resultName:Qt,nextLoc:tn},this.method==="next"&&(this.arg=C),ii}},P}function Mm(C){return Mv(C)||Rd(C)||Sy(C)||_y()}function _y(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rd(C){if(typeof Symbol!="undefined"&&C[Symbol.iterator]!=null||C["@@iterator"]!=null)return Array.from(C)}function Mv(C){if(Array.isArray(C))return Pv(C)}function yy(C,P){var U=Object.keys(C);if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(C);P&&(se=se.filter(function(Fe){return Object.getOwnPropertyDescriptor(C,Fe).enumerable})),U.push.apply(U,se)}return U}function xy(C){for(var P=1;PC.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);U2&&arguments[2]!==void 0?arguments[2]:5,Fe=[P],rt=b0()(P).object(),yt=b0()(U).object();if(se<2)return se<1?[]:Fe;var dt={r:(rt.r-yt.r)/(se-1),g:(rt.g-yt.g)/(se-1),b:(rt.b-yt.b)/(se-1)};return E0(new Array(se-2),function(zt,ur){return Fe.push(b0()({r:Lg(rt.r-dt.r*(ur+1),0),g:Lg(rt.g-dt.g*(ur+1),0),b:Lg(rt.b-dt.b*(ur+1),0)}).hex())}),Fe.push(U),Fe};function mg(C){"@babel/helpers - typeof";return mg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},mg(C)}function Zv(C,P,U){return P=Nb(P),P in C?Object.defineProperty(C,P,{value:U,enumerable:!0,configurable:!0,writable:!0}):C[P]=U,C}function Nb(C){var P=zb(C,"string");return mg(P)=="symbol"?P:String(P)}function zb(C,P){if(mg(C)!="object"||!C)return C;var U=C[Symbol.toPrimitive];if(U!==void 0){var se=U.call(C,P||"default");if(mg(se)!="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(C)}var Yg="larkmap-legend-category";function Ub(C){var P=C.labels,U=C.colors,se=C.geometryType,Fe=se===void 0?"circle":se,rt=C.isStrokeColor,yt=C.style,dt=C.className;function zt(pi){return rt?{border:"2px solid ".concat(pi)}:{background:pi}}function ur(pi){return Ze.createElement("div",{className:Ce()(Yg,dt),style:yt},P.map(function(Hi,so){return Ze.createElement("div",{className:"".concat(Yg,"__content"),key:Hi},Ze.createElement("div",{className:Ce()("".concat(Yg,"__content__shape"),Zv({},"".concat(Yg,"__content__").concat(Fe),Fe)),style:zt(pi[so])}),Ze.createElement("div",{className:"".concat(Yg,"labels")},Hi))}))}function on(){if(Array.isArray(U))return ur(U);var pi=kb(U.startColor,U.endColor,P.length);return ur(pi)}return Ze.createElement(on,null)}Ub.defaultProps={geometryType:"circle",isStrokeColor:!1};var Zb=Se(73023);function Vv(C){var P=(0,Ze.useRef)(0),U=(0,hn.CR)((0,Ze.useState)(C),2),se=U[0],Fe=U[1],rt=(0,Ze.useCallback)(function(yt){cancelAnimationFrame(P.current),P.current=requestAnimationFrame(function(){Fe(yt)})},[]);return(0,Oh.Z)(function(){cancelAnimationFrame(P.current)}),[se,rt]}var Vb=Vv,Vy=Se(70941);function jv(C,P){if(Vy.Z){if(!C)return P;var U;return(0,F_.mf)(C)?U=C():"current"in C?U=C.current:U=C,U}}var Hv=Se(41523),jf=function(C){var P=function(U,se,Fe){var rt=(0,Ze.useRef)(!1),yt=(0,Ze.useRef)([]),dt=(0,Ze.useRef)([]),zt=(0,Ze.useRef)();C(function(){var ur,on=Array.isArray(Fe)?Fe:[Fe],pi=on.map(function(Hi){return jv(Hi)});if(!rt.current){rt.current=!0,yt.current=pi,dt.current=se,zt.current=U();return}(pi.length!==yt.current.length||!(0,Hv.Z)(pi,yt.current)||!(0,Hv.Z)(se,dt.current))&&((ur=zt.current)===null||ur===void 0||ur.call(zt),yt.current=pi,dt.current=se,zt.current=U())}),(0,Oh.Z)(function(){var ur;(ur=zt.current)===null||ur===void 0||ur.call(zt),rt.current=!1})};return P},T0=jf,jy=T0(Ze.useEffect),jb=jy,Hb=T0(Ze.useLayoutEffect),A0=Hb,Gv=Vy.Z?A0:jb,Hy=Gv;function Gb(C){var P=(0,hn.CR)(Vb(function(){var Fe=jv(C);return Fe?{width:Fe.clientWidth,height:Fe.clientHeight}:void 0}),2),U=P[0],se=P[1];return Hy(function(){var Fe=jv(C);if(Fe){var rt=new Zb.Z(function(yt){yt.forEach(function(dt){var zt=dt.target,ur=zt.clientWidth,on=zt.clientHeight;se({width:ur,height:on})})});return rt.observe(Fe),function(){rt.disconnect()}}},[],C),U}var C0=Gb,Pm="larkmap-legend-ramp",xE=function(P){var U=P[P.length-1],se=P[0];return Number.isFinite(se)||(se=parseInt(se,10)),Number.isFinite(U)||(U=parseInt(U,10)),[se,U]};function M0(C){var P=C.labels,U=C.labelUnit,se=U===void 0?"":U,Fe=C.colors,rt=P[0]+se,yt=P[P.length-1]+se;return Ze.createElement(Ze.Fragment,null,Ze.createElement("div",{className:"".concat(Pm,"__continuous"),style:{background:"linear-gradient(to right,".concat(Fe,")")}}),Ze.createElement("div",{className:"".concat(Pm,"__continuous-labelbar")},Ze.createElement("span",null,rt),Ze.createElement("span",null,yt)))}function Dg(C){var P=C.labels,U=C.labelUnit,se=U===void 0?"":U,Fe=C.colors,rt=(0,Ze.useRef)(null),yt=C0(rt),dt=(yt==null?void 0:yt.width)/(Fe.length+1),zt=P;if(P.length+1===Fe.length){var ur="< "+P[0],on="\u2265 "+P[P.length-1];zt.unshift(ur),zt.push(on)}var pi=function(so){var uo="".concat(P[so]).concat(se," - ").concat(P[so+1]).concat(se);return uo};return Ze.createElement("div",{className:"".concat(Pm,"__dis-continuous"),ref:rt},Number.isNaN(dt)?null:Ze.createElement(Ze.Fragment,null,Ze.createElement("div",{className:"".concat(Pm,"__dis-continuous__colors"),style:{paddingLeft:dt/2}},Fe==null?void 0:Fe.map(function(Hi,so){return Ze.createElement("div",{key:Hi,title:pi(so),className:"".concat(Pm,"__dis-continuous__color"),style:{background:Hi,width:dt}})})),Ze.createElement("div",{className:"".concat(Pm,"__dis-continuous__labels")},P==null?void 0:P.map(function(Hi){var so=Hi+se;return Ze.createElement("span",{key:Hi,className:"".concat(Pm,"__dis-continuous__label")},so)}))))}function Wb(C){var P=C.isContinuous,U=C.labels,se=C.colors,Fe=C.labelUnit,rt=C.className,yt=C.style;return Ze.createElement("div",{className:Ce()("".concat(Pm),rt),style:yt},P?Ze.createElement(M0,{labels:U,labelUnit:Fe,colors:se}):Ze.createElement(Dg,{labels:U,labelUnit:Fe,colors:se}))}Wb.defaultProps={isContinuous:!1,labelUnit:""};var $g=Se(46236),bE={point:$g.DrawPoint,line:$g.DrawLine,polygon:$g.DrawPolygon,rect:$g.DrawRect,circle:$g.DrawCircle};function Kg(C){"@babel/helpers - typeof";return Kg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},Kg(C)}function Wv(C,P){var U=Object.keys(C);if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(C);P&&(se=se.filter(function(Fe){return Object.getOwnPropertyDescriptor(C,Fe).enumerable})),U.push.apply(U,se)}return U}function Xv(C){for(var P=1;PC.length)&&(P=C.length);for(var U=0,se=new Array(P);UC.length)&&(P=C.length);for(var U=0,se=new Array(P);U=Math.abs(Ce)?R-He+Ce:Ce-He+R,R=He}R+de>=0!=!!M&&Ze.reverse()}},96542:function(Zr){"use strict";Zr.exports=_r;function _r(Se,ve){this.x=Se,this.y=ve}_r.prototype={clone:function(){return new _r(this.x,this.y)},add:function(Se){return this.clone()._add(Se)},sub:function(Se){return this.clone()._sub(Se)},multByPoint:function(Se){return this.clone()._multByPoint(Se)},divByPoint:function(Se){return this.clone()._divByPoint(Se)},mult:function(Se){return this.clone()._mult(Se)},div:function(Se){return this.clone()._div(Se)},rotate:function(Se){return this.clone()._rotate(Se)},rotateAround:function(Se,ve){return this.clone()._rotateAround(Se,ve)},matMult:function(Se){return this.clone()._matMult(Se)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(Se){return this.x===Se.x&&this.y===Se.y},dist:function(Se){return Math.sqrt(this.distSqr(Se))},distSqr:function(Se){var ve=Se.x-this.x,Ze=Se.y-this.y;return ve*ve+Ze*Ze},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(Se){return Math.atan2(this.y-Se.y,this.x-Se.x)},angleWith:function(Se){return this.angleWithSep(Se.x,Se.y)},angleWithSep:function(Se,ve){return Math.atan2(this.x*ve-this.y*Se,this.x*Se+this.y*ve)},_matMult:function(Se){var ve=Se[0]*this.x+Se[1]*this.y,Ze=Se[2]*this.x+Se[3]*this.y;return this.x=ve,this.y=Ze,this},_add:function(Se){return this.x+=Se.x,this.y+=Se.y,this},_sub:function(Se){return this.x-=Se.x,this.y-=Se.y,this},_mult:function(Se){return this.x*=Se,this.y*=Se,this},_div:function(Se){return this.x/=Se,this.y/=Se,this},_multByPoint:function(Se){return this.x*=Se.x,this.y*=Se.y,this},_divByPoint:function(Se){return this.x/=Se.x,this.y/=Se.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var Se=this.y;return this.y=this.x,this.x=-Se,this},_rotate:function(Se){var ve=Math.cos(Se),Ze=Math.sin(Se),M=ve*this.x-Ze*this.y,R=Ze*this.x+ve*this.y;return this.x=M,this.y=R,this},_rotateAround:function(Se,ve){var Ze=Math.cos(Se),M=Math.sin(Se),R=ve.x+Ze*(this.x-ve.x)-M*(this.y-ve.y),de=ve.y+M*(this.x-ve.x)+Ze*(this.y-ve.y);return this.x=R,this.y=de,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},_r.convert=function(Se){return Se instanceof _r?Se:Array.isArray(Se)?new _r(Se[0],Se[1]):Se}},25865:function(Zr){"use strict";Zr.exports=Se,Zr.exports.default=Se;var _r=1e20;function Se(de,be,Le,Re,Ce,He){this.fontSize=de||24,this.buffer=be===void 0?3:be,this.cutoff=Re||.25,this.fontFamily=Ce||"sans-serif",this.fontWeight=He||"normal",this.radius=Le||8;var Xe=this.size=this.fontSize+this.buffer*2,Ke=Xe+this.buffer*2;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=Xe,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(Ke*Ke),this.gridInner=new Float64Array(Ke*Ke),this.f=new Float64Array(Ke),this.z=new Float64Array(Ke+1),this.v=new Uint16Array(Ke),this.useMetrics=this.ctx.measureText("A").actualBoundingBoxLeft!==void 0,this.middle=Math.round(Xe/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function ve(de,be,Le,Re,Ce,He,Xe){He.fill(_r,0,be*Le),Xe.fill(0,0,be*Le);for(var Ke=(be-Re)/2,Ve=0;Ve-1);Ve++,He[Ve]=Ke,Xe[Ve]=et,Xe[Ve+1]=_r}for(Ke=0,Ve=0;KeM)return M;for(;Zede?Ze=R:M=R,R=(M-Ze)*.5+Ze}return R},_r.prototype.solve=function(Se,ve){return this.sampleCurveY(this.solveCurveX(Se,ve))}},99996:function(Zr,_r,Se){Zr.exports.VectorTile=Se(14253),Se(35752),Se(143)},14253:function(Zr,_r,Se){"use strict";var ve=Se(143);Zr.exports=Ze;function Ze(R,de){this.layers=R.readFields(M,{},de)}function M(R,de,be){if(R===3){var Le=new ve(be,be.readVarint()+be.pos);Le.length&&(de[Le.name]=Le)}}},35752:function(Zr,_r,Se){"use strict";var ve=Se(96542);Zr.exports=Ze;function Ze(Le,Re,Ce,He,Xe){this.properties={},this.extent=Ce,this.type=0,this._pbf=Le,this._geometry=-1,this._keys=He,this._values=Xe,Le.readFields(M,this,Re)}function M(Le,Re,Ce){Le==1?Re.id=Ce.readVarint():Le==2?R(Ce,Re):Le==3?Re.type=Ce.readVarint():Le==4&&(Re._geometry=Ce.pos)}function R(Le,Re){for(var Ce=Le.readVarint()+Le.pos;Le.pos>3}if(He--,Ce===1||Ce===2)Xe+=Le.readSVarint(),Ke+=Le.readSVarint(),Ce===1&&(et&&Ve.push(et),et=[]),et.push(new ve(Xe,Ke));else if(Ce===7)et&&et.push(et[0].clone());else throw new Error("unknown command "+Ce)}return et&&Ve.push(et),Ve},Ze.prototype.bbox=function(){var Le=this._pbf;Le.pos=this._geometry;for(var Re=Le.readVarint()+Le.pos,Ce=1,He=0,Xe=0,Ke=0,Ve=1/0,et=-1/0,er=1/0,fr=-1/0;Le.pos>3}if(He--,Ce===1||Ce===2)Xe+=Le.readSVarint(),Ke+=Le.readSVarint(),Xeet&&(et=Xe),Kefr&&(fr=Ke);else if(Ce!==7)throw new Error("unknown command "+Ce)}return[Ve,er,et,fr]},Ze.prototype.toGeoJSON=function(Le,Re,Ce){var He=this.extent*Math.pow(2,Ce),Xe=this.extent*Le,Ke=this.extent*Re,Ve=this.loadGeometry(),et=Ze.types[this.type],er,fr;function Ar(Jn){for(var ki=0;ki>3;be=Re===1?de.readString():Re===2?de.readFloat():Re===3?de.readDouble():Re===4?de.readVarint64():Re===5?de.readVarint():Re===6?de.readSVarint():Re===7?de.readBoolean():null}return be}Ze.prototype.feature=function(de){if(de<0||de>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[de];var be=this._pbf.readVarint()+this._pbf.pos;return new ve(this._pbf,be,this.extent,this._keys,this._values)}},20300:function(Zr,_r,Se){"use strict";var ve=Se(56906);Zr.exports=function(R){R=R||{};var de=R.reporter,be=ve.getOption(R,"async",!0),Le=ve.getOption(R,"auto",!0);Le&&!be&&(de&&de.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),be=!0);var Re=Ze(),Ce,He=!1;function Xe(pn,Kn){!He&&Le&&be&&Re.size()===0&&et(),Re.add(pn,Kn)}function Ke(){for(He=!0;Re.size();){var pn=Re;Re=Ze(),pn.process()}He=!1}function Ve(pn){He||(pn===void 0&&(pn=be),Ce&&(fr(Ce),Ce=null),pn?et():Ke())}function et(){Ce=Ar(Ke)}function er(){Re={},batchSize=0,topLevel=0,bottomLevel=0}function fr(pn){var Kn=clearTimeout;return Kn(pn)}function Ar(pn){var Kn=function(Jn){return setTimeout(Jn,0)};return Kn(pn)}return{add:Xe,force:Ve}};function Ze(){var M={},R=0,de=0,be=0;function Le(He,Xe){Xe||(Xe=He,He=0),He>de?de=He:He1&&(Ce-=1)),[Ce*360,He*100,et*100]},M.rgb.hwb=function(de){const be=de[0],Le=de[1];let Re=de[2];const Ce=M.rgb.hsl(de)[0],He=1/255*Math.min(be,Math.min(Le,Re));return Re=1-1/255*Math.max(be,Math.max(Le,Re)),[Ce,He*100,Re*100]},M.rgb.cmyk=function(de){const be=de[0]/255,Le=de[1]/255,Re=de[2]/255,Ce=Math.min(1-be,1-Le,1-Re),He=(1-be-Ce)/(1-Ce)||0,Xe=(1-Le-Ce)/(1-Ce)||0,Ke=(1-Re-Ce)/(1-Ce)||0;return[He*100,Xe*100,Ke*100,Ce*100]};function R(de,be){return bp(de[0]-be[0],2)+bp(de[1]-be[1],2)+bp(de[2]-be[2],2)}M.rgb.keyword=function(de){const be=Ze[de];if(be)return be;let Le=1/0,Re;for(const Ce of Object.keys(ve)){const He=ve[Ce],Xe=R(de,He);Xe.04045?bp((be+.055)/1.055,2.4):be/12.92,Le=Le>.04045?bp((Le+.055)/1.055,2.4):Le/12.92,Re=Re>.04045?bp((Re+.055)/1.055,2.4):Re/12.92;const Ce=be*.4124+Le*.3576+Re*.1805,He=be*.2126+Le*.7152+Re*.0722,Xe=be*.0193+Le*.1192+Re*.9505;return[Ce*100,He*100,Xe*100]},M.rgb.lab=function(de){const be=M.rgb.xyz(de);let Le=be[0],Re=be[1],Ce=be[2];Le/=95.047,Re/=100,Ce/=108.883,Le=Le>.008856?bp(Le,1/3):7.787*Le+16/116,Re=Re>.008856?bp(Re,1/3):7.787*Re+16/116,Ce=Ce>.008856?bp(Ce,1/3):7.787*Ce+16/116;const He=116*Re-16,Xe=500*(Le-Re),Ke=200*(Re-Ce);return[He,Xe,Ke]},M.hsl.rgb=function(de){const be=de[0]/360,Le=de[1]/100,Re=de[2]/100;let Ce,He,Xe;if(Le===0)return Xe=Re*255,[Xe,Xe,Xe];Re<.5?Ce=Re*(1+Le):Ce=Re+Le-Re*Le;const Ke=2*Re-Ce,Ve=[0,0,0];for(let et=0;et<3;et++)He=be+1/3*-(et-1),He<0&&He++,He>1&&He--,6*He<1?Xe=Ke+(Ce-Ke)*6*He:2*He<1?Xe=Ce:3*He<2?Xe=Ke+(Ce-Ke)*(2/3-He)*6:Xe=Ke,Ve[et]=Xe*255;return Ve},M.hsl.hsv=function(de){const be=de[0];let Le=de[1]/100,Re=de[2]/100,Ce=Le;const He=Math.max(Re,.01);Re*=2,Le*=Re<=1?Re:2-Re,Ce*=He<=1?He:2-He;const Xe=(Re+Le)/2,Ke=Re===0?2*Ce/(He+Ce):2*Le/(Re+Le);return[be,Ke*100,Xe*100]},M.hsv.rgb=function(de){const be=de[0]/60,Le=de[1]/100;let Re=de[2]/100;const Ce=Math.floor(be)%6,He=be-Math.floor(be),Xe=255*Re*(1-Le),Ke=255*Re*(1-Le*He),Ve=255*Re*(1-Le*(1-He));switch(Re*=255,Ce){case 0:return[Re,Ve,Xe];case 1:return[Ke,Re,Xe];case 2:return[Xe,Re,Ve];case 3:return[Xe,Ke,Re];case 4:return[Ve,Xe,Re];case 5:return[Re,Xe,Ke]}},M.hsv.hsl=function(de){const be=de[0],Le=de[1]/100,Re=de[2]/100,Ce=Math.max(Re,.01);let He,Xe;Xe=(2-Le)*Re;const Ke=(2-Le)*Ce;return He=Le*Ce,He/=Ke<=1?Ke:2-Ke,He=He||0,Xe/=2,[be,He*100,Xe*100]},M.hwb.rgb=function(de){const be=de[0]/360;let Le=de[1]/100,Re=de[2]/100;const Ce=Le+Re;let He;Ce>1&&(Le/=Ce,Re/=Ce);const Xe=Math.floor(6*be),Ke=1-Re;He=6*be-Xe,Xe&1&&(He=1-He);const Ve=Le+He*(Ke-Le);let et,er,fr;switch(Xe){default:case 6:case 0:et=Ke,er=Ve,fr=Le;break;case 1:et=Ve,er=Ke,fr=Le;break;case 2:et=Le,er=Ke,fr=Ve;break;case 3:et=Le,er=Ve,fr=Ke;break;case 4:et=Ve,er=Le,fr=Ke;break;case 5:et=Ke,er=Le,fr=Ve;break}return[et*255,er*255,fr*255]},M.cmyk.rgb=function(de){const be=de[0]/100,Le=de[1]/100,Re=de[2]/100,Ce=de[3]/100,He=1-Math.min(1,be*(1-Ce)+Ce),Xe=1-Math.min(1,Le*(1-Ce)+Ce),Ke=1-Math.min(1,Re*(1-Ce)+Ce);return[He*255,Xe*255,Ke*255]},M.xyz.rgb=function(de){const be=de[0]/100,Le=de[1]/100,Re=de[2]/100;let Ce,He,Xe;return Ce=be*3.2406+Le*-1.5372+Re*-.4986,He=be*-.9689+Le*1.8758+Re*.0415,Xe=be*.0557+Le*-.204+Re*1.057,Ce=Ce>.0031308?1.055*bp(Ce,1/2.4)-.055:Ce*12.92,He=He>.0031308?1.055*bp(He,1/2.4)-.055:He*12.92,Xe=Xe>.0031308?1.055*bp(Xe,1/2.4)-.055:Xe*12.92,Ce=Math.min(Math.max(0,Ce),1),He=Math.min(Math.max(0,He),1),Xe=Math.min(Math.max(0,Xe),1),[Ce*255,He*255,Xe*255]},M.xyz.lab=function(de){let be=de[0],Le=de[1],Re=de[2];be/=95.047,Le/=100,Re/=108.883,be=be>.008856?bp(be,1/3):7.787*be+16/116,Le=Le>.008856?bp(Le,1/3):7.787*Le+16/116,Re=Re>.008856?bp(Re,1/3):7.787*Re+16/116;const Ce=116*Le-16,He=500*(be-Le),Xe=200*(Le-Re);return[Ce,He,Xe]},M.lab.xyz=function(de){const be=de[0],Le=de[1],Re=de[2];let Ce,He,Xe;He=(be+16)/116,Ce=Le/500+He,Xe=He-Re/200;const Ke=bp(He,3),Ve=bp(Ce,3),et=bp(Xe,3);return He=Ke>.008856?Ke:(He-16/116)/7.787,Ce=Ve>.008856?Ve:(Ce-16/116)/7.787,Xe=et>.008856?et:(Xe-16/116)/7.787,Ce*=95.047,He*=100,Xe*=108.883,[Ce,He,Xe]},M.lab.lch=function(de){const be=de[0],Le=de[1],Re=de[2];let Ce;Ce=Math.atan2(Re,Le)*360/2/Math.PI,Ce<0&&(Ce+=360);const Xe=Math.sqrt(Le*Le+Re*Re);return[be,Xe,Ce]},M.lch.lab=function(de){const be=de[0],Le=de[1],Ce=de[2]/360*2*Math.PI,He=Le*Math.cos(Ce),Xe=Le*Math.sin(Ce);return[be,He,Xe]},M.rgb.ansi16=function(de,be=null){const[Le,Re,Ce]=de;let He=be===null?M.rgb.hsv(de)[2]:be;if(He=Math.round(He/50),He===0)return 30;let Xe=30+(Math.round(Ce/255)<<2|Math.round(Re/255)<<1|Math.round(Le/255));return He===2&&(Xe+=60),Xe},M.hsv.ansi16=function(de){return M.rgb.ansi16(M.hsv.rgb(de),de[2])},M.rgb.ansi256=function(de){const be=de[0],Le=de[1],Re=de[2];return be===Le&&Le===Re?be<8?16:be>248?231:Math.round((be-8)/247*24)+232:16+36*Math.round(be/255*5)+6*Math.round(Le/255*5)+Math.round(Re/255*5)},M.ansi16.rgb=function(de){let be=de%10;if(be===0||be===7)return de>50&&(be+=3.5),be=be/10.5*255,[be,be,be];const Le=(~~(de>50)+1)*.5,Re=(be&1)*Le*255,Ce=(be>>1&1)*Le*255,He=(be>>2&1)*Le*255;return[Re,Ce,He]},M.ansi256.rgb=function(de){if(de>=232){const He=(de-232)*10+8;return[He,He,He]}de-=16;let be;const Le=Math.floor(de/36)/5*255,Re=Math.floor((be=de%36)/6)/5*255,Ce=be%6/5*255;return[Le,Re,Ce]},M.rgb.hex=function(de){const Le=(((Math.round(de[0])&255)<<16)+((Math.round(de[1])&255)<<8)+(Math.round(de[2])&255)).toString(16).toUpperCase();return"000000".substring(Le.length)+Le},M.hex.rgb=function(de){const be=de.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!be)return[0,0,0];let Le=be[0];be[0].length===3&&(Le=Le.split("").map(Ke=>Ke+Ke).join(""));const Re=parseInt(Le,16),Ce=Re>>16&255,He=Re>>8&255,Xe=Re&255;return[Ce,He,Xe]},M.rgb.hcg=function(de){const be=de[0]/255,Le=de[1]/255,Re=de[2]/255,Ce=Math.max(Math.max(be,Le),Re),He=Math.min(Math.min(be,Le),Re),Xe=Ce-He;let Ke,Ve;return Xe<1?Ke=He/(1-Xe):Ke=0,Xe<=0?Ve=0:Ce===be?Ve=(Le-Re)/Xe%6:Ce===Le?Ve=2+(Re-be)/Xe:Ve=4+(be-Le)/Xe,Ve/=6,Ve%=1,[Ve*360,Xe*100,Ke*100]},M.hsl.hcg=function(de){const be=de[1]/100,Le=de[2]/100,Re=Le<.5?2*be*Le:2*be*(1-Le);let Ce=0;return Re<1&&(Ce=(Le-.5*Re)/(1-Re)),[de[0],Re*100,Ce*100]},M.hsv.hcg=function(de){const be=de[1]/100,Le=de[2]/100,Re=be*Le;let Ce=0;return Re<1&&(Ce=(Le-Re)/(1-Re)),[de[0],Re*100,Ce*100]},M.hcg.rgb=function(de){const be=de[0]/360,Le=de[1]/100,Re=de[2]/100;if(Le===0)return[Re*255,Re*255,Re*255];const Ce=[0,0,0],He=be%1*6,Xe=He%1,Ke=1-Xe;let Ve=0;switch(Math.floor(He)){case 0:Ce[0]=1,Ce[1]=Xe,Ce[2]=0;break;case 1:Ce[0]=Ke,Ce[1]=1,Ce[2]=0;break;case 2:Ce[0]=0,Ce[1]=1,Ce[2]=Xe;break;case 3:Ce[0]=0,Ce[1]=Ke,Ce[2]=1;break;case 4:Ce[0]=Xe,Ce[1]=0,Ce[2]=1;break;default:Ce[0]=1,Ce[1]=0,Ce[2]=Ke}return Ve=(1-Le)*Re,[(Le*Ce[0]+Ve)*255,(Le*Ce[1]+Ve)*255,(Le*Ce[2]+Ve)*255]},M.hcg.hsv=function(de){const be=de[1]/100,Le=de[2]/100,Re=be+Le*(1-be);let Ce=0;return Re>0&&(Ce=be/Re),[de[0],Ce*100,Re*100]},M.hcg.hsl=function(de){const be=de[1]/100,Re=de[2]/100*(1-be)+.5*be;let Ce=0;return Re>0&&Re<.5?Ce=be/(2*Re):Re>=.5&&Re<1&&(Ce=be/(2*(1-Re))),[de[0],Ce*100,Re*100]},M.hcg.hwb=function(de){const be=de[1]/100,Le=de[2]/100,Re=be+Le*(1-be);return[de[0],(Re-be)*100,(1-Re)*100]},M.hwb.hcg=function(de){const be=de[1]/100,Re=1-de[2]/100,Ce=Re-be;let He=0;return Ce<1&&(He=(Re-Ce)/(1-Ce)),[de[0],Ce*100,He*100]},M.apple.rgb=function(de){return[de[0]/65535*255,de[1]/65535*255,de[2]/65535*255]},M.rgb.apple=function(de){return[de[0]/255*65535,de[1]/255*65535,de[2]/255*65535]},M.gray.rgb=function(de){return[de[0]/100*255,de[0]/100*255,de[0]/100*255]},M.gray.hsl=function(de){return[0,0,de[0]]},M.gray.hsv=M.gray.hsl,M.gray.hwb=function(de){return[0,100,de[0]]},M.gray.cmyk=function(de){return[0,0,0,de[0]]},M.gray.lab=function(de){return[de[0],0,0]},M.gray.hex=function(de){const be=Math.round(de[0]/100*255)&255,Re=((be<<16)+(be<<8)+be).toString(16).toUpperCase();return"000000".substring(Re.length)+Re},M.rgb.gray=function(de){return[(de[0]+de[1]+de[2])/3/255*100]}},2771:function(Zr,_r,Se){const ve=Se(5101),Ze=Se(3153),M={},R=Object.keys(ve);function de(Le){const Re=function(...Ce){const He=Ce[0];return He==null?He:(He.length>1&&(Ce=He),Le(Ce))};return"conversion"in Le&&(Re.conversion=Le.conversion),Re}function be(Le){const Re=function(...Ce){const He=Ce[0];if(He==null)return He;He.length>1&&(Ce=He);const Xe=Le(Ce);if(typeof Xe=="object")for(let Ke=Xe.length,Ve=0;Ve{M[Le]={},Object.defineProperty(M[Le],"channels",{value:ve[Le].channels}),Object.defineProperty(M[Le],"labels",{value:ve[Le].labels});const Re=Ze(Le);Object.keys(Re).forEach(He=>{const Xe=Re[He];M[Le][He]=be(Xe),M[Le][He].raw=de(Xe)})}),Zr.exports=M},3153:function(Zr,_r,Se){const ve=Se(5101);function Ze(){const be={},Le=Object.keys(ve);for(let Re=Le.length,Ce=0;Ce0){this.model=et||"rgb",fr=Ze[this.model].channels;const Ar=Array.prototype.slice.call(Ve,0,fr);this.color=Ke(Ar,fr),this.valpha=typeof Ve[fr]=="number"?Ve[fr]:1}else if(typeof Ve=="number")this.model="rgb",this.color=[Ve>>16&255,Ve>>8&255,Ve&255],this.valpha=1;else{this.valpha=1;const Ar=Object.keys(Ve);"alpha"in Ve&&(Ar.splice(Ar.indexOf("alpha"),1),this.valpha=typeof Ve.alpha=="number"?Ve.alpha:0);const pn=Ar.sort().join("");if(!(pn in R))throw new Error("Unable to parse color from object: "+JSON.stringify(Ve));this.model=R[pn];const{labels:Kn}=Ze[this.model],Jn=[];for(er=0;er(Ve%360+360)%360),saturationl:Ce("hsl",1,He(100)),lightness:Ce("hsl",2,He(100)),saturationv:Ce("hsv",1,He(100)),value:Ce("hsv",2,He(100)),chroma:Ce("hcg",1,He(100)),gray:Ce("hcg",2,He(100)),white:Ce("hwb",1,He(100)),wblack:Ce("hwb",2,He(100)),cyan:Ce("cmyk",0,He(100)),magenta:Ce("cmyk",1,He(100)),yellow:Ce("cmyk",2,He(100)),black:Ce("cmyk",3,He(100)),x:Ce("xyz",0,He(95.047)),y:Ce("xyz",1,He(100)),z:Ce("xyz",2,He(108.833)),l:Ce("lab",0,He(100)),a:Ce("lab",1),b:Ce("lab",2),keyword(Ve){return Ve!==void 0?new be(Ve):Ze[this.model].keyword(this.color)},hex(Ve){return Ve!==void 0?new be(Ve):ve.to.hex(this.rgb().round().color)},hexa(Ve){if(Ve!==void 0)return new be(Ve);const et=this.rgb().round().color;let er=Math.round(this.valpha*255).toString(16).toUpperCase();return er.length===1&&(er="0"+er),ve.to.hex(et)+er},rgbNumber(){const Ve=this.rgb().color;return(Ve[0]&255)<<16|(Ve[1]&255)<<8|Ve[2]&255},luminosity(){const Ve=this.rgb().color,et=[];for(const[er,fr]of Ve.entries()){const Ar=fr/255;et[er]=Ar<=.04045?Ar/12.92:bp((Ar+.055)/1.055,2.4)}return .2126*et[0]+.7152*et[1]+.0722*et[2]},contrast(Ve){const et=this.luminosity(),er=Ve.luminosity();return et>er?(et+.05)/(er+.05):(er+.05)/(et+.05)},level(Ve){const et=this.contrast(Ve);return et>=7?"AAA":et>=4.5?"AA":""},isDark(){const Ve=this.rgb().color;return(Ve[0]*2126+Ve[1]*7152+Ve[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const Ve=this.rgb();for(let et=0;et<3;et++)Ve.color[et]=255-Ve.color[et];return Ve},lighten(Ve){const et=this.hsl();return et.color[2]+=et.color[2]*Ve,et},darken(Ve){const et=this.hsl();return et.color[2]-=et.color[2]*Ve,et},saturate(Ve){const et=this.hsl();return et.color[1]+=et.color[1]*Ve,et},desaturate(Ve){const et=this.hsl();return et.color[1]-=et.color[1]*Ve,et},whiten(Ve){const et=this.hwb();return et.color[1]+=et.color[1]*Ve,et},blacken(Ve){const et=this.hwb();return et.color[2]+=et.color[2]*Ve,et},grayscale(){const Ve=this.rgb().color,et=Ve[0]*.3+Ve[1]*.59+Ve[2]*.11;return be.rgb(et,et,et)},fade(Ve){return this.alpha(this.valpha-this.valpha*Ve)},opaquer(Ve){return this.alpha(this.valpha+this.valpha*Ve)},rotate(Ve){const et=this.hsl();let er=et.color[0];return er=(er+Ve)%360,er=er<0?360+er:er,et.color[0]=er,et},mix(Ve,et){if(!Ve||!Ve.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof Ve);const er=Ve.rgb(),fr=this.rgb(),Ar=et===void 0?.5:et,pn=2*Ar-1,Kn=er.alpha()-fr.alpha(),Jn=((pn*Kn===-1?pn:(pn+Kn)/(1+pn*Kn))+1)/2,ki=1-Jn;return be.rgb(Jn*er.red()+ki*fr.red(),Jn*er.green()+ki*fr.green(),Jn*er.blue()+ki*fr.blue(),er.alpha()*Ar+fr.alpha()*(1-Ar))}};for(const Ve of Object.keys(Ze)){if(M.includes(Ve))continue;const{channels:et}=Ze[Ve];be.prototype[Ve]=function(...er){return this.model===Ve?new be(this):er.length>0?new be(er,Ve):new be([...Xe(Ze[this.model][Ve].raw(this.color)),this.valpha],Ve)},be[Ve]=function(...er){let fr=er[0];return typeof fr=="number"&&(fr=Ke(er,et)),new be(fr,Ve)}}function Le(Ve,et){return Number(Ve.toFixed(et))}function Re(Ve){return function(et){return Le(et,Ve)}}function Ce(Ve,et,er){Ve=Array.isArray(Ve)?Ve:[Ve];for(const fr of Ve)(de[fr]||(de[fr]=[]))[et]=er;return Ve=Ve[0],function(fr){let Ar;return fr!==void 0?(er&&(fr=er(fr)),Ar=this[Ve](),Ar.color[et]=fr,Ar):(Ar=this[Ve]().color[et],er&&(Ar=er(Ar)),Ar)}}function He(Ve){return function(et){return Math.max(0,Math.min(Ve,et))}}function Xe(Ve){return Array.isArray(Ve)?Ve:[Ve]}function Ke(Ve,et){for(let er=0;er>>32-Ze},rotr:function(ve,Ze){return ve<<32-Ze|ve>>>Ze},endian:function(ve){if(ve.constructor==Number)return Se.rotl(ve,8)&16711935|Se.rotl(ve,24)&4278255360;for(var Ze=0;Ze0;ve--)Ze.push(Math.floor(Math.random()*256));return Ze},bytesToWords:function(ve){for(var Ze=[],M=0,R=0;M>>5]|=ve[M]<<24-R%32;return Ze},wordsToBytes:function(ve){for(var Ze=[],M=0;M>>5]>>>24-M%32&255);return Ze},bytesToHex:function(ve){for(var Ze=[],M=0;M>>4).toString(16)),Ze.push((ve[M]&15).toString(16));return Ze.join("")},hexToBytes:function(ve){for(var Ze=[],M=0;M>>6*(3-de)&63)):Ze.push("=");return Ze.join("")},base64ToBytes:function(ve){ve=ve.replace(/[^A-Z0-9+\/]/ig,"");for(var Ze=[],M=0,R=0;M>>6-R*2);return Ze}};Zr.exports=Se})()},75734:function(Zr){"use strict";Zr.exports=_r,Zr.exports.default=_r;function _r($e,Pt,vt){vt=vt||2;var rr=Pt&&Pt.length,ar=rr?Pt[0]*vt:$e.length,wr=Se($e,0,ar,vt,!0),Cr=[];if(!wr||wr.next===wr.prev)return Cr;var an,yi,li,Uo,vi,bo,So;if(rr&&(wr=Le($e,Pt,wr,vt)),$e.length>80*vt){an=li=$e[0],yi=Uo=$e[1];for(var Xi=vt;Xili&&(li=vi),bo>Uo&&(Uo=bo);So=Math.max(li-an,Uo-yi),So=So!==0?32767/So:0}return Ze(wr,Cr,vt,an,yi,So,0),Cr}function Se($e,Pt,vt,rr,ar){var wr,Cr;if(ar===Dt($e,Pt,vt,rr)>0)for(wr=Pt;wr=Pt;wr-=rr)Cr=rn(wr,$e[wr],$e[wr+1],Cr);return Cr&&Kn(Cr,Cr.next)&&(jn(Cr),Cr=Cr.next),Cr}function ve($e,Pt){if(!$e)return $e;Pt||(Pt=$e);var vt=$e,rr;do if(rr=!1,!vt.steiner&&(Kn(vt,vt.next)||pn(vt.prev,vt,vt.next)===0)){if(jn(vt),vt=Pt=vt.prev,vt===vt.next)break;rr=!0}else vt=vt.next;while(rr||vt!==Pt);return Pt}function Ze($e,Pt,vt,rr,ar,wr,Cr){if($e){!Cr&&wr&&Ke($e,rr,ar,wr);for(var an=$e,yi,li;$e.prev!==$e.next;){if(yi=$e.prev,li=$e.next,wr?R($e,rr,ar,wr):M($e)){Pt.push(yi.i/vt|0),Pt.push($e.i/vt|0),Pt.push(li.i/vt|0),jn($e),$e=li.next,an=li.next;continue}if($e=li,$e===an){Cr?Cr===1?($e=de(ve($e),Pt,vt),Ze($e,Pt,vt,rr,ar,wr,2)):Cr===2&&be($e,Pt,vt,rr,ar,wr):Ze(ve($e),Pt,vt,rr,ar,wr,1);break}}}}function M($e){var Pt=$e.prev,vt=$e,rr=$e.next;if(pn(Pt,vt,rr)>=0)return!1;for(var ar=Pt.x,wr=vt.x,Cr=rr.x,an=Pt.y,yi=vt.y,li=rr.y,Uo=arwr?ar>Cr?ar:Cr:wr>Cr?wr:Cr,So=an>yi?an>li?an:li:yi>li?yi:li,Xi=rr.next;Xi!==Pt;){if(Xi.x>=Uo&&Xi.x<=bo&&Xi.y>=vi&&Xi.y<=So&&fr(ar,an,wr,yi,Cr,li,Xi.x,Xi.y)&&pn(Xi.prev,Xi,Xi.next)>=0)return!1;Xi=Xi.next}return!0}function R($e,Pt,vt,rr){var ar=$e.prev,wr=$e,Cr=$e.next;if(pn(ar,wr,Cr)>=0)return!1;for(var an=ar.x,yi=wr.x,li=Cr.x,Uo=ar.y,vi=wr.y,bo=Cr.y,So=anyi?an>li?an:li:yi>li?yi:li,qo=Uo>vi?Uo>bo?Uo:bo:vi>bo?vi:bo,ui=et(So,Xi,Pt,vt,rr),Qi=et(Mi,qo,Pt,vt,rr),Vi=$e.prevZ,Pi=$e.nextZ;Vi&&Vi.z>=ui&&Pi&&Pi.z<=Qi;){if(Vi.x>=So&&Vi.x<=Mi&&Vi.y>=Xi&&Vi.y<=qo&&Vi!==ar&&Vi!==Cr&&fr(an,Uo,yi,vi,li,bo,Vi.x,Vi.y)&&pn(Vi.prev,Vi,Vi.next)>=0||(Vi=Vi.prevZ,Pi.x>=So&&Pi.x<=Mi&&Pi.y>=Xi&&Pi.y<=qo&&Pi!==ar&&Pi!==Cr&&fr(an,Uo,yi,vi,li,bo,Pi.x,Pi.y)&&pn(Pi.prev,Pi,Pi.next)>=0))return!1;Pi=Pi.nextZ}for(;Vi&&Vi.z>=ui;){if(Vi.x>=So&&Vi.x<=Mi&&Vi.y>=Xi&&Vi.y<=qo&&Vi!==ar&&Vi!==Cr&&fr(an,Uo,yi,vi,li,bo,Vi.x,Vi.y)&&pn(Vi.prev,Vi,Vi.next)>=0)return!1;Vi=Vi.prevZ}for(;Pi&&Pi.z<=Qi;){if(Pi.x>=So&&Pi.x<=Mi&&Pi.y>=Xi&&Pi.y<=qo&&Pi!==ar&&Pi!==Cr&&fr(an,Uo,yi,vi,li,bo,Pi.x,Pi.y)&&pn(Pi.prev,Pi,Pi.next)>=0)return!1;Pi=Pi.nextZ}return!0}function de($e,Pt,vt){var rr=$e;do{var ar=rr.prev,wr=rr.next.next;!Kn(ar,wr)&&Jn(ar,rr,rr.next,wr)&&jt(ar,wr)&&jt(wr,ar)&&(Pt.push(ar.i/vt|0),Pt.push(rr.i/vt|0),Pt.push(wr.i/vt|0),jn(rr),jn(rr.next),rr=$e=wr),rr=rr.next}while(rr!==$e);return ve(rr)}function be($e,Pt,vt,rr,ar,wr){var Cr=$e;do{for(var an=Cr.next.next;an!==Cr.prev;){if(Cr.i!==an.i&&Ar(Cr,an)){var yi=gr(Cr,an);Cr=ve(Cr,Cr.next),yi=ve(yi,yi.next),Ze(Cr,Pt,vt,rr,ar,wr,0),Ze(yi,Pt,vt,rr,ar,wr,0);return}an=an.next}Cr=Cr.next}while(Cr!==$e)}function Le($e,Pt,vt,rr){var ar=[],wr,Cr,an,yi,li;for(wr=0,Cr=Pt.length;wr=vt.next.y&&vt.next.y!==vt.y){var an=vt.x+(ar-vt.y)*(vt.next.x-vt.x)/(vt.next.y-vt.y);if(an<=rr&&an>wr&&(wr=an,Cr=vt.x=vt.x&&vt.x>=li&&rr!==vt.x&&fr(arCr.x||vt.x===Cr.x&&Xe(Cr,vt)))&&(Cr=vt,vi=bo)),vt=vt.next;while(vt!==yi);return Cr}function Xe($e,Pt){return pn($e.prev,$e,Pt.prev)<0&&pn(Pt.next,$e,$e.next)<0}function Ke($e,Pt,vt,rr){var ar=$e;do ar.z===0&&(ar.z=et(ar.x,ar.y,Pt,vt,rr)),ar.prevZ=ar.prev,ar.nextZ=ar.next,ar=ar.next;while(ar!==$e);ar.prevZ.nextZ=null,ar.prevZ=null,Ve(ar)}function Ve($e){var Pt,vt,rr,ar,wr,Cr,an,yi,li=1;do{for(vt=$e,$e=null,wr=null,Cr=0;vt;){for(Cr++,rr=vt,an=0,Pt=0;Pt0||yi>0&&rr;)an!==0&&(yi===0||!rr||vt.z<=rr.z)?(ar=vt,vt=vt.nextZ,an--):(ar=rr,rr=rr.nextZ,yi--),wr?wr.nextZ=ar:$e=ar,ar.prevZ=wr,wr=ar;vt=rr}wr.nextZ=null,li*=2}while(Cr>1);return $e}function et($e,Pt,vt,rr,ar){return $e=($e-vt)*ar|0,Pt=(Pt-rr)*ar|0,$e=($e|$e<<8)&16711935,$e=($e|$e<<4)&252645135,$e=($e|$e<<2)&858993459,$e=($e|$e<<1)&1431655765,Pt=(Pt|Pt<<8)&16711935,Pt=(Pt|Pt<<4)&252645135,Pt=(Pt|Pt<<2)&858993459,Pt=(Pt|Pt<<1)&1431655765,$e|Pt<<1}function er($e){var Pt=$e,vt=$e;do(Pt.x=($e-Cr)*(wr-an)&&($e-Cr)*(rr-an)>=(vt-Cr)*(Pt-an)&&(vt-Cr)*(wr-an)>=(ar-Cr)*(rr-an)}function Ar($e,Pt){return $e.next.i!==Pt.i&&$e.prev.i!==Pt.i&&!xr($e,Pt)&&(jt($e,Pt)&&jt(Pt,$e)&&Jr($e,Pt)&&(pn($e.prev,$e,Pt.prev)||pn($e,Pt.prev,Pt))||Kn($e,Pt)&&pn($e.prev,$e,$e.next)>0&&pn(Pt.prev,Pt,Pt.next)>0)}function pn($e,Pt,vt){return(Pt.y-$e.y)*(vt.x-Pt.x)-(Pt.x-$e.x)*(vt.y-Pt.y)}function Kn($e,Pt){return $e.x===Pt.x&&$e.y===Pt.y}function Jn($e,Pt,vt,rr){var ar=pa(pn($e,Pt,vt)),wr=pa(pn($e,Pt,rr)),Cr=pa(pn(vt,rr,$e)),an=pa(pn(vt,rr,Pt));return!!(ar!==wr&&Cr!==an||ar===0&&ki($e,vt,Pt)||wr===0&&ki($e,rr,Pt)||Cr===0&&ki(vt,$e,rr)||an===0&&ki(vt,Pt,rr))}function ki($e,Pt,vt){return Pt.x<=Math.max($e.x,vt.x)&&Pt.x>=Math.min($e.x,vt.x)&&Pt.y<=Math.max($e.y,vt.y)&&Pt.y>=Math.min($e.y,vt.y)}function pa($e){return $e>0?1:$e<0?-1:0}function xr($e,Pt){var vt=$e;do{if(vt.i!==$e.i&&vt.next.i!==$e.i&&vt.i!==Pt.i&&vt.next.i!==Pt.i&&Jn(vt,vt.next,$e,Pt))return!0;vt=vt.next}while(vt!==$e);return!1}function jt($e,Pt){return pn($e.prev,$e,$e.next)<0?pn($e,Pt,$e.next)>=0&&pn($e,$e.prev,Pt)>=0:pn($e,Pt,$e.prev)<0||pn($e,$e.next,Pt)<0}function Jr($e,Pt){var vt=$e,rr=!1,ar=($e.x+Pt.x)/2,wr=($e.y+Pt.y)/2;do vt.y>wr!=vt.next.y>wr&&vt.next.y!==vt.y&&ar<(vt.next.x-vt.x)*(wr-vt.y)/(vt.next.y-vt.y)+vt.x&&(rr=!rr),vt=vt.next;while(vt!==$e);return rr}function gr($e,Pt){var vt=new qe($e.i,$e.x,$e.y),rr=new qe(Pt.i,Pt.x,Pt.y),ar=$e.next,wr=Pt.prev;return $e.next=Pt,Pt.prev=$e,vt.next=ar,ar.prev=vt,rr.next=vt,vt.prev=rr,wr.next=rr,rr.prev=wr,rr}function rn($e,Pt,vt,rr){var ar=new qe($e,Pt,vt);return rr?(ar.next=rr.next,ar.prev=rr,rr.next.prev=ar,rr.next=ar):(ar.prev=ar,ar.next=ar),ar}function jn($e){$e.next.prev=$e.prev,$e.prev.next=$e.next,$e.prevZ&&($e.prevZ.nextZ=$e.nextZ),$e.nextZ&&($e.nextZ.prevZ=$e.prevZ)}function qe($e,Pt,vt){this.i=$e,this.x=Pt,this.y=vt,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}_r.deviation=function($e,Pt,vt,rr){var ar=Pt&&Pt.length,wr=ar?Pt[0]*vt:$e.length,Cr=Math.abs(Dt($e,0,wr,vt));if(ar)for(var an=0,yi=Pt.length;an0&&(rr+=$e[ar-1].length,vt.holes.push(rr))}return vt}},91895:function(Zr){"use strict";var _r=Zr.exports={};_r.isIE=function(Se){function ve(){var M=navigator.userAgent.toLowerCase();return M.indexOf("msie")!==-1||M.indexOf("trident")!==-1||M.indexOf(" edge/")!==-1}if(!ve())return!1;if(!Se)return!0;var Ze=function(){var M,R=3,de=document.createElement("div"),be=de.getElementsByTagName("i");do de.innerHTML="";while(be[0]);return R>4?R:M}();return Se===Ze},_r.isLegacyOpera=function(){return!!window.opera}},10219:function(Zr){"use strict";var _r=Zr.exports={};_r.forEach=function(Se,ve){for(var Ze=0;Ze div::-webkit-scrollbar { "+Ke(["display: none"])+` } `,qe+="."+jn+" { "+Ke(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+rn,"animation-name: "+rn])+` } `,qe+="@-webkit-keyframes "+rn+` { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } } `,qe+="@keyframes "+rn+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }",gr(qe)}}function er(xr){xr.className+=" "+He+"_animation_active"}function fr(xr,jt,Jr){if(xr.addEventListener)xr.addEventListener(jt,Jr);else if(xr.attachEvent)xr.attachEvent("on"+jt,Jr);else return M.error("[scroll] Don't know how to add event listeners.")}function Ar(xr,jt,Jr){if(xr.removeEventListener)xr.removeEventListener(jt,Jr);else if(xr.detachEvent)xr.detachEvent("on"+jt,Jr);else return M.error("[scroll] Don't know how to remove event listeners.")}function pn(xr){return de(xr).container.childNodes[0].childNodes[0].childNodes[0]}function Kn(xr){return de(xr).container.childNodes[0].childNodes[0].childNodes[1]}function Jn(xr,jt){var Jr=de(xr).listeners;if(!Jr.push)throw new Error("Cannot add listener to an element that is not detectable.");de(xr).listeners.push(jt)}function ki(xr,jt,Jr){Jr||(Jr=jt,jt=xr,xr=null),xr=xr||{};function gr(){if(xr.debug){var ui=Array.prototype.slice.call(arguments);if(ui.unshift(Le.get(jt),"Scroll: "),M.log.apply)M.log.apply(null,ui);else for(var Qi=0;Qi\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Xa=Ze.console&&(Ze.console.warn||Ze.console.log);return Xa&&Xa.call(Ze.console,jr,oo),ut.apply(this,arguments)}}var fr;typeof Object.assign!="function"?fr=function(At){if(At===de||At===null)throw new TypeError("Cannot convert undefined or null to object");for(var ir=Object(At),jr=1;jr-1}function rn(ut){return ut.trim().split(/\s+/g)}function jn(ut,At,ir){if(ut.indexOf&&!ir)return ut.indexOf(At);for(var jr=0;jrIl[At]}):jr=jr.sort()),jr}function $e(ut,At){for(var ir,jr,Dn=At[0].toUpperCase()+At.slice(1),oo=0;oo1&&!ir.firstMultiple?ir.firstMultiple=eo(At):Dn===1&&(ir.firstMultiple=!1);var oo=ir.firstInput,Xa=ir.firstMultiple,mn=Xa?Xa.center:oo.center,kl=At.center=un(jr);At.timeStamp=Xe(),At.deltaTime=At.timeStamp-oo.timeStamp,At.angle=wa(mn,kl),At.distance=Lo(mn,kl),In(ir,At),At.offsetDirection=Ti(At.deltaX,At.deltaY);var Il=To(At.deltaTime,At.deltaX,At.deltaY);At.overallVelocityX=Il.x,At.overallVelocityY=Il.y,At.overallVelocity=He(Il.x)>He(Il.y)?Il.x:Il.y,At.scale=Xa?co(Xa.pointers,jr):1,At.rotation=Xa?dn(Xa.pointers,jr):0,At.maxPointers=ir.prevInput?At.pointers.length>ir.prevInput.maxPointers?At.pointers.length:ir.prevInput.maxPointers:At.pointers.length,kn(ir,At);var Ia=ut.element;Jr(At.srcEvent.target,Ia)&&(Ia=At.srcEvent.target),At.target=Ia}function In(ut,At){var ir=At.center,jr=ut.offsetDelta||{},Dn=ut.prevDelta||{},oo=ut.prevInput||{};(At.eventType===So||oo.eventType===Mi)&&(Dn=ut.prevDelta={x:oo.deltaX||0,y:oo.deltaY||0},jr=ut.offsetDelta={x:ir.x,y:ir.y}),At.deltaX=Dn.x+(ir.x-jr.x),At.deltaY=Dn.y+(ir.y-jr.y)}function kn(ut,At){var ir=ut.lastInterval||At,jr=At.timeStamp-ir.timeStamp,Dn,oo,Xa,mn;if(At.eventType!=qo&&(jr>bo||ir.velocity===de)){var kl=At.deltaX-ir.deltaX,Il=At.deltaY-ir.deltaY,Ia=To(jr,kl,Il);oo=Ia.x,Xa=Ia.y,Dn=He(Ia.x)>He(Ia.y)?Ia.x:Ia.y,mn=Ti(kl,Il),ut.lastInterval=At}else Dn=ir.velocity,oo=ir.velocityX,Xa=ir.velocityY,mn=ir.direction;At.velocity=Dn,At.velocityX=oo,At.velocityY=Xa,At.direction=mn}function eo(ut){for(var At=[],ir=0;ir=He(At)?ut<0?Qi:Vi:At<0?Pi:ds}function Lo(ut,At,ir){ir||(ir=he);var jr=At[ir[0]]-ut[ir[0]],Dn=At[ir[1]]-ut[ir[1]];return Math.sqrt(jr*jr+Dn*Dn)}function wa(ut,At,ir){ir||(ir=he);var jr=At[ir[0]]-ut[ir[0]],Dn=At[ir[1]]-ut[ir[1]];return Math.atan2(Dn,jr)*180/Math.PI}function dn(ut,At){return wa(At[1],At[0],We)+wa(ut[1],ut[0],We)}function co(ut,At){return Lo(At[0],At[1],We)/Lo(ut[0],ut[1],We)}var no={mousedown:So,mousemove:Xi,mouseup:Mi},Za="mousedown",ms="mousemove mouseup";function Ji(){this.evEl=Za,this.evWin=ms,this.pressed=!1,at.apply(this,arguments)}Kn(Ji,at,{handler:function(At){var ir=no[At.type];ir&So&&At.button===0&&(this.pressed=!0),ir&Xi&&At.which!==1&&(ir=Mi),this.pressed&&(ir&Mi&&(this.pressed=!1),this.callback(this.manager,ir,{pointers:[At],changedPointers:[At],pointerType:Uo,srcEvent:At}))}});var Us={pointerdown:So,pointermove:Xi,pointerup:Mi,pointercancel:qo,pointerout:qo},Lt={2:yi,3:li,4:Uo,5:vi},Ne="pointerdown",re="pointermove pointerup pointercancel";Ze.MSPointerEvent&&!Ze.PointerEvent&&(Ne="MSPointerDown",re="MSPointerMove MSPointerUp MSPointerCancel");function le(){this.evEl=Ne,this.evWin=re,at.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}Kn(le,at,{handler:function(At){var ir=this.store,jr=!1,Dn=At.type.toLowerCase().replace("ms",""),oo=Us[Dn],Xa=Lt[At.pointerType]||At.pointerType,mn=Xa==yi,kl=jn(ir,At.pointerId,"pointerId");oo&So&&(At.button===0||mn)?kl<0&&(ir.push(At),kl=ir.length-1):oo&(Mi|qo)&&(jr=!0),!(kl<0)&&(ir[kl]=At,this.callback(this.manager,oo,{pointers:ir,changedPointers:[At],pointerType:Xa,srcEvent:At}),jr&&ir.splice(kl,1))}});var ge={touchstart:So,touchmove:Xi,touchend:Mi,touchcancel:qo},ye="touchstart",ze="touchstart touchmove touchend touchcancel";function je(){this.evTarget=ye,this.evWin=ze,this.started=!1,at.apply(this,arguments)}Kn(je,at,{handler:function(At){var ir=ge[At.type];if(ir===So&&(this.started=!0),!!this.started){var jr=Ue.call(this,At,ir);ir&(Mi|qo)&&jr[0].length-jr[1].length===0&&(this.started=!1),this.callback(this.manager,ir,{pointers:jr[0],changedPointers:jr[1],pointerType:yi,srcEvent:At})}}});function Ue(ut,At){var ir=qe(ut.touches),jr=qe(ut.changedTouches);return At&(Mi|qo)&&(ir=Dt(ir.concat(jr),"identifier",!0)),[ir,jr]}var Ae={touchstart:So,touchmove:Xi,touchend:Mi,touchcancel:qo},Je="touchstart touchmove touchend touchcancel";function wt(){this.evTarget=Je,this.targetIds={},at.apply(this,arguments)}Kn(wt,at,{handler:function(At){var ir=Ae[At.type],jr=Ht.call(this,At,ir);jr&&this.callback(this.manager,ir,{pointers:jr[0],changedPointers:jr[1],pointerType:yi,srcEvent:At})}});function Ht(ut,At){var ir=qe(ut.touches),jr=this.targetIds;if(At&(So|Xi)&&ir.length===1)return jr[ir[0].identifier]=!0,[ir,ir];var Dn,oo,Xa=qe(ut.changedTouches),mn=[],kl=this.target;if(oo=ir.filter(function(Il){return Jr(Il.target,kl)}),At===So)for(Dn=0;Dn-1&&jr.splice(oo,1)};setTimeout(Dn,Fr)}}function Lr(ut){for(var At=ut.srcEvent.clientX,ir=ut.srcEvent.clientY,jr=0;jr-1&&this.requireFail.splice(At,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(ut){return!!this.simultaneous[ut.id]},emit:function(ut){var At=this,ir=this.state;function jr(Dn){At.manager.emit(Dn,ut)}ir=Fo&&jr(At.options.event+sc(ir))},tryEmit:function(ut){if(this.canEmit())return this.emit(ut);this.state=Ba},canEmit:function(){for(var ut=0;utAt.threshold&&Dn&At.direction},attrTest:function(ut){return Zo.prototype.attrTest.call(this,ut)&&(this.state&_a||!(this.state&_a)&&this.directionTest(ut))},emit:function(ut){this.pX=ut.deltaX,this.pY=ut.deltaY;var At=Ql(ut.direction);At&&(ut.additionalEvent=this.options.event+At),this._super.emit.call(this,ut)}});function va(){Zo.apply(this,arguments)}Kn(va,Zo,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ao]},attrTest:function(ut){return this._super.attrTest.call(this,ut)&&(Math.abs(ut.scale-1)>this.options.threshold||this.state&_a)},emit:function(ut){if(ut.scale!==1){var At=ut.scale<1?"in":"out";ut.additionalEvent=this.options.event+At}this._super.emit.call(this,ut)}});function El(){Fa.apply(this,arguments),this._timer=null,this._input=null}Kn(El,Fa,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[io]},process:function(ut){var At=this.options,ir=ut.pointers.length===At.pointers,jr=ut.distanceAt.time;if(this._input=ut,!jr||!ir||ut.eventType&(Mi|qo)&&!Dn)this.reset();else if(ut.eventType&So)this.reset(),this._timer=Ke(function(){this.state=us,this.tryEmit()},At.time,this);else if(ut.eventType&Mi)return us;return Ba},reset:function(){clearTimeout(this._timer)},emit:function(ut){this.state===us&&(ut&&ut.eventType&Mi?this.manager.emit(this.options.event+"up",ut):(this._input.timeStamp=Xe(),this.manager.emit(this.options.event,this._input)))}});function Wa(){Zo.apply(this,arguments)}Kn(Wa,Zo,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ao]},attrTest:function(ut){return this._super.attrTest.call(this,ut)&&(Math.abs(ut.rotation)>this.options.threshold||this.state&_a)}});function Ds(){Zo.apply(this,arguments)}Kn(Ds,Zo,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ur|ls,pointers:1},getTouchAction:function(){return il.prototype.getTouchAction.call(this)},attrTest:function(ut){var At=this.options.direction,ir;return At&(Ur|ls)?ir=ut.overallVelocity:At&Ur?ir=ut.overallVelocityX:At&ls&&(ir=ut.overallVelocityY),this._super.attrTest.call(this,ut)&&At&ut.offsetDirection&&ut.distance>this.options.threshold&&ut.maxPointers==this.options.pointers&&He(ir)>this.options.velocity&&ut.eventType&Mi},emit:function(ut){var At=Ql(ut.offsetDirection);At&&this.manager.emit(this.options.event+At,ut),this.manager.emit(this.options.event,ut)}});function Rl(){Fa.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}Kn(Rl,Fa,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[On]},process:function(ut){var At=this.options,ir=ut.pointers.length===At.pointers,jr=ut.distance-1}Zr.exports=Ze},94936:function(Zr){function _r(Se,ve,Ze){for(var M=-1,R=Se==null?0:Se.length;++M=ve?Se:ve)),Se}Zr.exports=_r},92504:function(Zr){function _r(Se,ve,Ze,M){for(var R=Se.length,de=Ze+(M?1:-1);M?de--:++de-1;)fr!==Ce&&Le.call(fr,Ar,1),Le.call(Ce,Ar,1);return Ce}Zr.exports=Re},43846:function(Zr){function _r(Se,ve,Ze){var M=-1,R=Se.length;ve<0&&(ve=-ve>R?0:R+ve),Ze=Ze>R?R:Ze,Ze<0&&(Ze+=R),R=ve>Ze?0:Ze-ve>>>0,ve>>>=0;for(var de=Array(R);++M=Le){var pn=He?null:de(Ce);if(pn)return be(pn);er=!1,Ve=R,Ar=new ve}else Ar=He?[]:fr;e:for(;++Ke=be?M:ve(M,R,de)}Zr.exports=Ze},23684:function(Zr,_r,Se){var ve=Se(20167),Ze=Se(30080),M=Se(30078),R=Se(8389);function de(be){return function(Le){Le=R(Le);var Re=Ze(Le)?M(Le):void 0,Ce=Re?Re[0]:Le.charAt(0),He=Re?ve(Re,1).join(""):Le.slice(1);return Ce[be]()+He}}Zr.exports=de},51471:function(Zr,_r,Se){var ve=Se(30695),Ze=Se(26357),M=Se(71055),R="['\u2019]",de=RegExp(R,"g");function be(Le){return function(Re){return ve(M(Ze(Re).replace(de,"")),Le,"")}}Zr.exports=be},17319:function(Zr,_r,Se){var ve=Se(81956),Ze=Se(43226),M=Se(79967),R=1/0,de=ve&&1/M(new ve([,-0]))[1]==R?function(be){return new ve(be)}:Ze;Zr.exports=de},92523:function(Zr,_r,Se){var ve=Se(243),Ze={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},M=ve(Ze);Zr.exports=M},30080:function(Zr){var _r="\\ud800-\\udfff",Se="\\u0300-\\u036f",ve="\\ufe20-\\ufe2f",Ze="\\u20d0-\\u20ff",M=Se+ve+Ze,R="\\ufe0e\\ufe0f",de="\\u200d",be=RegExp("["+de+_r+M+R+"]");function Le(Re){return be.test(Re)}Zr.exports=Le},37854:function(Zr){var _r=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Se(ve){return _r.test(ve)}Zr.exports=Se},3729:function(Zr){function _r(Se,ve,Ze){for(var M=Ze-1,R=Se.length;++M(S=1))return S;for(;_j?_=F:S=F,F=.5*(S-_)+_}return F},be.prototype.solve=function(i,l){return this.sampleCurveY(this.solveCurveX(i,l))};var Le=Re;function Re(i,l){this.x=i,this.y=l}Re.prototype={clone:function(){return new Re(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,l){return this.clone()._rotateAround(i,l)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var l=i.x-this.x,_=i.y-this.y;return l*l+_*_},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,l){return Math.atan2(this.x*l-this.y*i,this.x*i+this.y*l)},_matMult:function(i){var l=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=l,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var l=Math.cos(i),_=Math.sin(i),S=_*this.x+l*this.y;return this.x=l*this.x-_*this.y,this.y=S,this},_rotateAround:function(i,l){var _=Math.cos(i),S=Math.sin(i),F=l.y+S*(this.x-l.x)+_*(this.y-l.y);return this.x=l.x+_*(this.x-l.x)-S*(this.y-l.y),this.y=F,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Re.convert=function(i){return i instanceof Re?i:Array.isArray(i)?new Re(i[0],i[1]):i};var Ce=typeof self!="undefined"?self:{},He=Math.pow(2,53)-1;function Xe(i,l,_,S){var F=new de(i,l,_,S);return function(j){return F.solve(j)}}var Ke=Xe(.25,.1,.25,1);function Ve(i,l,_){return Math.min(_,Math.max(l,i))}function et(i,l,_){var S=_-l,F=((i-l)%S+S)%S+l;return F===l?_:F}function er(i){for(var l=[],_=arguments.length-1;_-- >0;)l[_]=arguments[_+1];for(var S=0,F=l;S>l/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,i)}()}function Kn(i){return!!i&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(i)}function Jn(i,l){i.forEach(function(_){l[_]&&(l[_]=l[_].bind(l))})}function ki(i,l){return i.indexOf(l,i.length-l.length)!==-1}function pa(i,l,_){var S={};for(var F in i)S[F]=l.call(_||this,i[F],F,i);return S}function xr(i,l,_){var S={};for(var F in i)l.call(_||this,i[F],F,i)&&(S[F]=i[F]);return S}function jt(i){return Array.isArray(i)?i.map(jt):typeof i=="object"&&i?pa(i,jt):i}var Jr={};function gr(i){Jr[i]||(typeof console!="undefined"&&console.warn(i),Jr[i]=!0)}function rn(i,l,_){return(_.y-i.y)*(l.x-i.x)>(l.y-i.y)*(_.x-i.x)}function jn(i){for(var l=0,_=0,S=i.length,F=S-1,j=void 0,p=void 0;_@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(S,F,j,p){var v=j||p;return l[F]=!v||v.toLowerCase(),""}),l["max-age"]){var _=parseInt(l["max-age"],10);isNaN(_)?delete l["max-age"]:l["max-age"]=_}return l}var $e=null;function Pt(i){if($e==null){var l=i.navigator?i.navigator.userAgent:null;$e=!!i.safari||!(!l||!(/\b(iPad|iPhone|iPod)\b/.test(l)||l.match("Safari")&&!l.match("Chrome")))}return $e}function vt(i){try{var l=Ce[i];return l.setItem("_mapbox_test_",1),l.removeItem("_mapbox_test_"),!0}catch(_){return!1}}var rr,ar,wr,Cr,an=Ce.performance&&Ce.performance.now?Ce.performance.now.bind(Ce.performance):Date.now.bind(Date),yi=Ce.requestAnimationFrame||Ce.mozRequestAnimationFrame||Ce.webkitRequestAnimationFrame||Ce.msRequestAnimationFrame,li=Ce.cancelAnimationFrame||Ce.mozCancelAnimationFrame||Ce.webkitCancelAnimationFrame||Ce.msCancelAnimationFrame,Uo={now:an,frame:function(i){var l=yi(i);return{cancel:function(){return li(l)}}},getImageData:function(i,l){l===void 0&&(l=0);var _=Ce.document.createElement("canvas"),S=_.getContext("2d");if(!S)throw new Error("failed to create canvas 2d context");return _.width=i.width,_.height=i.height,S.drawImage(i,0,0,i.width,i.height),S.getImageData(-l,-l,i.width+2*l,i.height+2*l)},resolveURL:function(i){return rr||(rr=Ce.document.createElement("a")),rr.href=i,rr.href},hardwareConcurrency:Ce.navigator&&Ce.navigator.hardwareConcurrency||4,get devicePixelRatio(){return Ce.devicePixelRatio},get prefersReducedMotion(){return!!Ce.matchMedia&&(ar==null&&(ar=Ce.matchMedia("(prefers-reduced-motion: reduce)")),ar.matches)}},vi={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},bo={supported:!1,testSupport:function(i){!So&&Cr&&(Xi?Mi(i):wr=i)}},So=!1,Xi=!1;function Mi(i){var l=i.createTexture();i.bindTexture(i.TEXTURE_2D,l);try{if(i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,Cr),i.isContextLost())return;bo.supported=!0}catch(_){}i.deleteTexture(l),So=!0}Ce.document&&((Cr=Ce.document.createElement("img")).onload=function(){wr&&Mi(wr),wr=null,Xi=!0},Cr.onerror=function(){So=!0,wr=null},Cr.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var qo="01",ui=function(i,l){this._transformRequestFn=i,this._customAccessToken=l,this._createSkuToken()};function Qi(i){return i.indexOf("mapbox:")===0}ui.prototype._createSkuToken=function(){var i=function(){for(var l="",_=0;_<10;_++)l+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",qo,l].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=i.token,this._skuTokenExpiresAt=i.tokenExpiresAt},ui.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},ui.prototype.transformRequest=function(i,l){return this._transformRequestFn&&this._transformRequestFn(i,l)||{url:i}},ui.prototype.normalizeStyleURL=function(i,l){if(!Qi(i))return i;var _=Ur(i);return _.path="/styles/v1"+_.path,this._makeAPIURL(_,this._customAccessToken||l)},ui.prototype.normalizeGlyphsURL=function(i,l){if(!Qi(i))return i;var _=Ur(i);return _.path="/fonts/v1"+_.path,this._makeAPIURL(_,this._customAccessToken||l)},ui.prototype.normalizeSourceURL=function(i,l){if(!Qi(i))return i;var _=Ur(i);return _.path="/v4/"+_.authority+".json",_.params.push("secure"),this._makeAPIURL(_,this._customAccessToken||l)},ui.prototype.normalizeSpriteURL=function(i,l,_,S){var F=Ur(i);return Qi(i)?(F.path="/styles/v1"+F.path+"/sprite"+l+_,this._makeAPIURL(F,this._customAccessToken||S)):(F.path+=""+l+_,ls(F))},ui.prototype.normalizeTileURL=function(i,l){if(this._isSkuTokenExpired()&&this._createSkuToken(),i&&!Qi(i))return i;var _=Ur(i);_.path=_.path.replace(/(\.(png|jpg)\d*)(?=$)/,(Uo.devicePixelRatio>=2||l===512?"@2x":"")+(bo.supported?".webp":"$1")),_.path=_.path.replace(/^.+\/v4\//,"/"),_.path="/v4"+_.path;var S=this._customAccessToken||function(F){for(var j=0,p=F;j=0&&i.params.splice(F,1)}if(S.path!=="/"&&(i.path=""+S.path+i.path),!vi.REQUIRE_ACCESS_TOKEN)return ls(i);if(!(l=l||vi.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+_);if(l[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+_);return i.params=i.params.filter(function(j){return j.indexOf("access_token")===-1}),i.params.push("access_token="+l),ls(i)};var Vi=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Pi(i){return Vi.test(i)}var ds=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Ur(i){var l=i.match(ds);if(!l)throw new Error("Unable to parse URL object");return{protocol:l[1],authority:l[2],path:l[3]||"/",params:l[4]?l[4].split("&"):[]}}function ls(i){var l=i.params.length?"?"+i.params.join("&"):"";return i.protocol+"://"+i.authority+i.path+l}function dr(i){if(!i)return null;var l=i.split(".");if(!l||l.length!==3)return null;try{return JSON.parse(decodeURIComponent(Ce.atob(l[1]).split("").map(function(_){return"%"+("00"+_.charCodeAt(0).toString(16)).slice(-2)}).join("")))}catch(_){return null}}var he=function(i){this.type=i,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};he.prototype.getStorageKey=function(i){var l,_=dr(vi.ACCESS_TOKEN);return l=_&&_.u?Ce.btoa(encodeURIComponent(_.u).replace(/%([0-9A-F]{2})/g,function(S,F){return String.fromCharCode(+("0x"+F))})):vi.ACCESS_TOKEN||"",i?"mapbox.eventData."+i+":"+l:"mapbox.eventData:"+l},he.prototype.fetchEventData=function(){var i=vt("localStorage"),l=this.getStorageKey(),_=this.getStorageKey("uuid");if(i)try{var S=Ce.localStorage.getItem(l);S&&(this.eventData=JSON.parse(S));var F=Ce.localStorage.getItem(_);F&&(this.anonId=F)}catch(j){gr("Unable to read from LocalStorage")}},he.prototype.saveEventData=function(){var i=vt("localStorage"),l=this.getStorageKey(),_=this.getStorageKey("uuid");if(i)try{Ce.localStorage.setItem(_,this.anonId),Object.keys(this.eventData).length>=1&&Ce.localStorage.setItem(l,JSON.stringify(this.eventData))}catch(S){gr("Unable to write to LocalStorage")}},he.prototype.processRequests=function(i){},he.prototype.postEvent=function(i,l,_,S){var F=this;if(vi.EVENTS_URL){var j=Ur(vi.EVENTS_URL);j.params.push("access_token="+(S||vi.ACCESS_TOKEN||""));var p={event:this.type,created:new Date(i).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:qo,userId:this.anonId},v=l?er(p,l):p,m={url:ls(j),headers:{"Content-Type":"text/plain"},body:JSON.stringify([v])};this.pendingRequest=Ne(m,function(w){F.pendingRequest=null,_(w),F.saveEventData(),F.processRequests(S)})}},he.prototype.queueRequest=function(i,l){this.queue.push(i),this.processRequests(l)};var We,at,Ot=function(i){function l(){i.call(this,"map.load"),this.success={},this.skuToken=""}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.postMapLoadEvent=function(_,S,F,j){this.skuToken=F;var p=!(!j&&!vi.ACCESS_TOKEN),v=Array.isArray(_)&&_.some(function(m){return Qi(m)||Pi(m)});vi.EVENTS_URL&&p&&v&&this.queueRequest({id:S,timestamp:Date.now()},j)},l.prototype.processRequests=function(_){var S=this;if(!this.pendingRequest&&this.queue.length!==0){var F=this.queue.shift(),j=F.id,p=F.timestamp;j&&this.success[j]||(this.anonId||this.fetchEventData(),Kn(this.anonId)||(this.anonId=pn()),this.postEvent(p,{skuToken:this.skuToken},function(v){v||j&&(S.success[j]=!0)},_))}},l}(he),or=new(function(i){function l(_){i.call(this,"appUserTurnstile"),this._customAccessToken=_}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.postTurnstileEvent=function(_,S){vi.EVENTS_URL&&vi.ACCESS_TOKEN&&Array.isArray(_)&&_.some(function(F){return Qi(F)||Pi(F)})&&this.queueRequest(Date.now(),S)},l.prototype.processRequests=function(_){var S=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var F=dr(vi.ACCESS_TOKEN),j=F?F.u:vi.ACCESS_TOKEN,p=j!==this.eventData.tokenU;Kn(this.anonId)||(this.anonId=pn(),p=!0);var v=this.queue.shift();if(this.eventData.lastSuccess){var m=new Date(this.eventData.lastSuccess),w=new Date(v),D=(v-this.eventData.lastSuccess)/864e5;p=p||D>=1||D<-1||m.getDate()!==w.getDate()}else p=!0;if(!p)return this.processRequests();this.postEvent(v,{"enabled.telemetry":!1},function(N){N||(S.eventData.lastSuccess=v,S.eventData.tokenU=j)},_)}},l}(he)),Wr=or.postTurnstileEvent.bind(or),In=new Ot,kn=In.postMapLoadEvent.bind(In),eo=500,un=50;function To(){Ce.caches&&!We&&(We=Ce.caches.open("mapbox-tiles"))}function Ti(i){var l=i.indexOf("?");return l<0?i:i.slice(0,l)}var Lo,wa=1/0;function dn(){return Lo==null&&(Lo=Ce.OffscreenCanvas&&new Ce.OffscreenCanvas(1,1).getContext("2d")&&typeof Ce.createImageBitmap=="function"),Lo}var co={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(co);var no=function(i){function l(_,S,F){S===401&&Pi(F)&&(_+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),i.call(this,_),this.status=S,this.url=F,this.name=this.constructor.name,this.message=_}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},l}(Error),Za=qe()?function(){return self.worker&&self.worker.referrer}:function(){return(Ce.location.protocol==="blob:"?Ce.parent:Ce).location.href},ms,Ji,Us=function(i,l){if(!(/^file:/.test(_=i.url)||/^file:/.test(Za())&&!/^\w+:/.test(_))){if(Ce.fetch&&Ce.Request&&Ce.AbortController&&Ce.Request.prototype.hasOwnProperty("signal"))return function(S,F){var j,p=new Ce.AbortController,v=new Ce.Request(S.url,{method:S.method||"GET",body:S.body,credentials:S.credentials,headers:S.headers,referrer:Za(),signal:p.signal}),m=!1,w=!1,D=(j=v.url).indexOf("sku=")>0&&Pi(j);S.type==="json"&&v.headers.set("Accept","application/json");var N=function($,ie,pe){if(!w){if($&&$.message!=="SecurityError"&&gr($),ie&&pe)return W(ie);var we=Date.now();Ce.fetch(v).then(function(ke){if(ke.ok){var Ge=D?ke.clone():null;return W(ke,Ge,we)}return F(new no(ke.statusText,ke.status,S.url))}).catch(function(ke){ke.code!==20&&F(new Error(ke.message))})}},W=function($,ie,pe){(S.type==="arrayBuffer"?$.arrayBuffer():S.type==="json"?$.json():$.text()).then(function(we){w||(ie&&pe&&function(ke,Ge,ht){if(To(),We){var mt={status:Ge.status,statusText:Ge.statusText,headers:new Ce.Headers};Ge.headers.forEach(function(xt,bt){return mt.headers.set(bt,xt)});var St=Dt(Ge.headers.get("Cache-Control")||"");St["no-store"]||(St["max-age"]&&mt.headers.set("Expires",new Date(ht+1e3*St["max-age"]).toUTCString()),new Date(mt.headers.get("Expires")).getTime()-ht<42e4||function(xt,bt){if(at===void 0)try{new Response(new ReadableStream),at=!0}catch(kt){at=!1}at?bt(xt.body):xt.blob().then(bt)}(Ge,function(xt){var bt=new Ce.Response(xt,mt);To(),We&&We.then(function(kt){return kt.put(Ti(ke.url),bt)}).catch(function(kt){return gr(kt.message)})}))}}(v,ie,pe),m=!0,F(null,we,$.headers.get("Cache-Control"),$.headers.get("Expires")))}).catch(function(we){w||F(new Error(we.message))})};return D?function($,ie){if(To(),!We)return ie(null);var pe=Ti($.url);We.then(function(we){we.match(pe).then(function(ke){var Ge=function(ht){if(!ht)return!1;var mt=new Date(ht.headers.get("Expires")||0),St=Dt(ht.headers.get("Cache-Control")||"");return mt>Date.now()&&!St["no-cache"]}(ke);we.delete(pe),Ge&&we.put(pe,ke.clone()),ie(null,ke,Ge)}).catch(ie)}).catch(ie)}(v,N):N(null,null),{cancel:function(){w=!0,m||p.abort()}}}(i,l);if(qe()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,l,void 0,!0)}var _;return function(S,F){var j=new Ce.XMLHttpRequest;for(var p in j.open(S.method||"GET",S.url,!0),S.type==="arrayBuffer"&&(j.responseType="arraybuffer"),S.headers)j.setRequestHeader(p,S.headers[p]);return S.type==="json"&&(j.responseType="text",j.setRequestHeader("Accept","application/json")),j.withCredentials=S.credentials==="include",j.onerror=function(){F(new Error(j.statusText))},j.onload=function(){if((j.status>=200&&j.status<300||j.status===0)&&j.response!==null){var v=j.response;if(S.type==="json")try{v=JSON.parse(j.response)}catch(m){return F(m)}F(null,v,j.getResponseHeader("Cache-Control"),j.getResponseHeader("Expires"))}else F(new no(j.statusText,j.status,S.url))},j.send(S.body),{cancel:function(){return j.abort()}}}(i,l)},Lt=function(i,l){return Us(er(i,{type:"arrayBuffer"}),l)},Ne=function(i,l){return Us(er(i,{method:"POST"}),l)},re="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";ms=[],Ji=0;var le=function(i,l){if(bo.supported&&(i.headers||(i.headers={}),i.headers.accept="image/webp,*/*"),Ji>=vi.MAX_PARALLEL_IMAGE_REQUESTS){var _={requestParameters:i,callback:l,cancelled:!1,cancel:function(){this.cancelled=!0}};return ms.push(_),_}Ji++;var S=!1,F=function(){if(!S)for(S=!0,Ji--;ms.length&&Ji0||this._oneTimeListeners&&this._oneTimeListeners[i]&&this._oneTimeListeners[i].length>0||this._eventedParent&&this._eventedParent.listens(i)},Ue.prototype.setEventedParent=function(i,l){return this._eventedParent=i,this._eventedParentData=l,this};var Ae={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Je=function(i,l,_,S){this.message=(i?i+": ":"")+_,S&&(this.identifier=S),l!=null&&l.__line__&&(this.line=l.__line__)};function wt(i){var l=i.value;return l?[new Je(i.key,l,"constants have been deprecated as of v8")]:[]}function Ht(i){for(var l=[],_=arguments.length-1;_-- >0;)l[_]=arguments[_+1];for(var S=0,F=l;S":i.itemType.kind==="value"?"array":"array<"+l+">"}return i.kind}var Hl=[xn,Lr,Nn,bn,En,ia,io,Ga(On),Ho];function ns(i,l){if(l.kind==="error")return null;if(i.kind==="array"){if(l.kind==="array"&&(l.N===0&&l.itemType.kind==="value"||!ns(i.itemType,l.itemType))&&(typeof i.N!="number"||i.N===l.N))return null}else{if(i.kind===l.kind)return null;if(i.kind==="value"){for(var _=0,S=Hl;_255?255:v}function F(v){return S(v[v.length-1]==="%"?parseFloat(v)/100*255:parseInt(v))}function j(v){return(m=v[v.length-1]==="%"?parseFloat(v)/100:parseFloat(v))<0?0:m>1?1:m;var m}function p(v,m,w){return w<0?w+=1:w>1&&(w-=1),6*w<1?v+(m-v)*w*6:2*w<1?m:3*w<2?v+(m-v)*(2/3-w)*6:v}try{l.parseCSSColor=function(v){var m,w=v.replace(/ /g,"").toLowerCase();if(w in _)return _[w].slice();if(w[0]==="#")return w.length===4?(m=parseInt(w.substr(1),16))>=0&&m<=4095?[(3840&m)>>4|(3840&m)>>8,240&m|(240&m)>>4,15&m|(15&m)<<4,1]:null:w.length===7&&(m=parseInt(w.substr(1),16))>=0&&m<=16777215?[(16711680&m)>>16,(65280&m)>>8,255&m,1]:null;var D=w.indexOf("("),N=w.indexOf(")");if(D!==-1&&N+1===w.length){var W=w.substr(0,D),$=w.substr(D+1,N-(D+1)).split(","),ie=1;switch(W){case"rgba":if($.length!==4)return null;ie=j($.pop());case"rgb":return $.length!==3?null:[F($[0]),F($[1]),F($[2]),ie];case"hsla":if($.length!==4)return null;ie=j($.pop());case"hsl":if($.length!==3)return null;var pe=(parseFloat($[0])%360+360)%360/360,we=j($[1]),ke=j($[2]),Ge=ke<=.5?ke*(we+1):ke+we-ke*we,ht=2*ke-Ge;return[S(255*p(ht,Ge,pe+1/3)),S(255*p(ht,Ge,pe)),S(255*p(ht,Ge,pe-1/3)),ie];default:return null}}return null}}catch(v){}}).parseCSSColor,Fo=function(i,l,_,S){S===void 0&&(S=1),this.r=i,this.g=l,this.b=_,this.a=S};Fo.parse=function(i){if(i){if(i instanceof Fo)return i;if(typeof i=="string"){var l=$o(i);if(l)return new Fo(l[0]/255*l[3],l[1]/255*l[3],l[2]/255*l[3],l[3])}}},Fo.prototype.toString=function(){var i=this.toArray(),l=i[1],_=i[2],S=i[3];return"rgba("+Math.round(i[0])+","+Math.round(l)+","+Math.round(_)+","+S+")"},Fo.prototype.toArray=function(){var i=this.a;return i===0?[0,0,0,0]:[255*this.r/i,255*this.g/i,255*this.b/i,i]},Fo.black=new Fo(0,0,0,1),Fo.white=new Fo(1,1,1,1),Fo.transparent=new Fo(0,0,0,0),Fo.red=new Fo(1,0,0,1);var us=function(i,l,_){this.sensitivity=i?l?"variant":"case":l?"accent":"base",this.locale=_,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};us.prototype.compare=function(i,l){return this.collator.compare(i,l)},us.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var xc=function(i,l,_,S,F){this.text=i,this.image=l,this.scale=_,this.fontStack=S,this.textColor=F},Ba=function(i){this.sections=i};Ba.fromString=function(i){return new Ba([new xc(i,null,null,null,null)])},Ba.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some(function(i){return i.text.length!==0||i.image&&i.image.name.length!==0})},Ba.factory=function(i){return i instanceof Ba?i:Ba.fromString(i)},Ba.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(i){return i.text}).join("")},Ba.prototype.serialize=function(){for(var i=["format"],l=0,_=this.sections;l<_.length;l+=1){var S=_[l];if(S.image)i.push(["image",S.image.name]);else{i.push(S.text);var F={};S.fontStack&&(F["text-font"]=["literal",S.fontStack.split(",")]),S.scale&&(F["font-scale"]=S.scale),S.textColor&&(F["text-color"]=["rgba"].concat(S.textColor.toArray())),i.push(F)}}return i};var Fa=function(i){this.name=i.name,this.available=i.available};function sc(i,l,_,S){return typeof i=="number"&&i>=0&&i<=255&&typeof l=="number"&&l>=0&&l<=255&&typeof _=="number"&&_>=0&&_<=255?S===void 0||typeof S=="number"&&S>=0&&S<=1?null:"Invalid rgba value ["+[i,l,_,S].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof S=="number"?[i,l,_,S]:[i,l,_]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Ql(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof Fo||i instanceof us||i instanceof Ba||i instanceof Fa)return!0;if(Array.isArray(i)){for(var l=0,_=i;l<_.length;l+=1)if(!Ql(_[l]))return!1;return!0}if(typeof i=="object"){for(var S in i)if(!Ql(i[S]))return!1;return!0}return!1}function oa(i){if(i===null)return xn;if(typeof i=="string")return Nn;if(typeof i=="boolean")return bn;if(typeof i=="number")return Lr;if(i instanceof Fo)return En;if(i instanceof us)return Ao;if(i instanceof Ba)return ia;if(i instanceof Fa)return Ho;if(Array.isArray(i)){for(var l,_=i.length,S=0,F=i;S2){var v=i[1];if(typeof v!="string"||!(v in El)||v==="object")return l.error('The item type argument of "array" must be one of string, number, boolean',1);j=El[v],S++}else j=On;if(i.length>3){if(i[2]!==null&&(typeof i[2]!="number"||i[2]<0||i[2]!==Math.floor(i[2])))return l.error('The length argument to "array" must be a positive integer literal',2);p=i[2],S++}_=Ga(j,p)}else _=El[F];for(var m=[];S1)&&l.push(S)}}return l.concat(this.args.map(function(F){return F.serialize()}))};var Ds=function(i){this.type=ia,this.sections=i};Ds.parse=function(i,l){if(i.length<2)return l.error("Expected at least one argument.");var _=i[1];if(!Array.isArray(_)&&typeof _=="object")return l.error("First argument must be an image or text section.");for(var S=[],F=!1,j=1;j<=i.length-1;++j){var p=i[j];if(F&&typeof p=="object"&&!Array.isArray(p)){F=!1;var v=null;if(p["font-scale"]&&!(v=l.parse(p["font-scale"],1,Lr)))return null;var m=null;if(p["text-font"]&&!(m=l.parse(p["text-font"],1,Ga(Nn))))return null;var w=null;if(p["text-color"]&&!(w=l.parse(p["text-color"],1,En)))return null;var D=S[S.length-1];D.scale=v,D.font=m,D.textColor=w}else{var N=l.parse(i[j],1,On);if(!N)return null;var W=N.type.kind;if(W!=="string"&&W!=="value"&&W!=="null"&&W!=="resolvedImage")return l.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");F=!0,S.push({content:N,scale:null,font:null,textColor:null})}}return new Ds(S)},Ds.prototype.evaluate=function(i){return new Ba(this.sections.map(function(l){var _=l.content.evaluate(i);return oa(_)===Ho?new xc("",_,null,null,null):new xc(Zo(_),null,l.scale?l.scale.evaluate(i):null,l.font?l.font.evaluate(i).join(","):null,l.textColor?l.textColor.evaluate(i):null)}))},Ds.prototype.eachChild=function(i){for(var l=0,_=this.sections;l<_.length;l+=1){var S=_[l];i(S.content),S.scale&&i(S.scale),S.font&&i(S.font),S.textColor&&i(S.textColor)}},Ds.prototype.outputDefined=function(){return!1},Ds.prototype.serialize=function(){for(var i=["format"],l=0,_=this.sections;l<_.length;l+=1){var S=_[l];i.push(S.content.serialize());var F={};S.scale&&(F["font-scale"]=S.scale.serialize()),S.font&&(F["text-font"]=S.font.serialize()),S.textColor&&(F["text-color"]=S.textColor.serialize()),i.push(F)}return i};var Rl=function(i){this.type=Ho,this.input=i};Rl.parse=function(i,l){if(i.length!==2)return l.error("Expected two arguments.");var _=l.parse(i[1],1,Nn);return _?new Rl(_):l.error("No image name provided.")},Rl.prototype.evaluate=function(i){var l=this.input.evaluate(i),_=Fa.fromString(l);return _&&i.availableImages&&(_.available=i.availableImages.indexOf(l)>-1),_},Rl.prototype.eachChild=function(i){i(this.input)},Rl.prototype.outputDefined=function(){return!1},Rl.prototype.serialize=function(){return["image",this.input.serialize()]};var gu={"to-boolean":bn,"to-color":En,"to-number":Lr,"to-string":Nn},gl=function(i,l){this.type=i,this.args=l};gl.parse=function(i,l){if(i.length<2)return l.error("Expected at least one argument.");var _=i[0];if((_==="to-boolean"||_==="to-string")&&i.length!==2)return l.error("Expected one argument.");for(var S=gu[_],F=[],j=1;j4?"Invalid rbga value "+JSON.stringify(l)+": expected an array containing either three or four numeric values.":sc(l[0],l[1],l[2],l[3])))return new Fo(l[0]/255,l[1]/255,l[2]/255,l[3])}throw new va(_||"Could not parse color from value '"+(typeof l=="string"?l:String(JSON.stringify(l)))+"'")}if(this.type.kind==="number"){for(var p=null,v=0,m=this.args;v=l[2]||i[1]<=l[1]||i[3]>=l[3])}function At(i,l){var _=(180+i[0])/360,S=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,F=Math.pow(2,l.z);return[Math.round(_*F*8192),Math.round(S*F*8192)]}function ir(i,l,_){return l[1]>i[1]!=_[1]>i[1]&&i[0]<(_[0]-l[0])*(i[1]-l[1])/(_[1]-l[1])+l[0]}function jr(i,l){for(var _,S,F,j,p,v,m,w=!1,D=0,N=l.length;D0&&v<0||p<0&&v>0}function Xa(i,l,_){for(var S=0,F=_;S_[2]){var F=.5*S,j=i[0]-_[0]>F?-S:_[0]-i[0]>F?S:0;j===0&&(j=i[0]-_[2]>F?-S:_[2]-i[0]>F?S:0),i[0]+=j}Wl(l,i)}function Sl(i,l,_,S){for(var F=8192*Math.pow(2,S.z),j=[8192*S.x,8192*S.y],p=[],v=0,m=i;v=0)return!1;var _=!0;return i.eachChild(function(S){_&&!Ku(S,l)&&(_=!1)}),_}Aa.parse=function(i,l){if(i.length!==2)return l.error("'within' expression requires exactly one argument, but found "+(i.length-1)+" instead.");if(Ql(i[1])){var _=i[1];if(_.type==="FeatureCollection")for(var S=0;S<_.features.length;++S){var F=_.features[S].geometry.type;if(F==="Polygon"||F==="MultiPolygon")return new Aa(_,_.features[S].geometry)}else if(_.type==="Feature"){var j=_.geometry.type;if(j==="Polygon"||j==="MultiPolygon")return new Aa(_,_.geometry)}else if(_.type==="Polygon"||_.type==="MultiPolygon")return new Aa(_,_)}return l.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Aa.prototype.evaluate=function(i){if(i.geometry()!=null&&i.canonicalID()!=null){if(i.geometryType()==="Point")return function(l,_){var S=[1/0,1/0,-1/0,-1/0],F=[1/0,1/0,-1/0,-1/0],j=l.canonicalID();if(_.type==="Polygon"){var p=Il(_.coordinates,F,j),v=Sl(l.geometry(),S,F,j);if(!ut(S,F))return!1;for(var m=0,w=v;ml))throw new va("Input is not a number.");j=p-1}return 0}bs.prototype.parse=function(i,l,_,S,F){return F===void 0&&(F={}),l?this.concat(l,_,S)._parse(i,F):this._parse(i,F)},bs.prototype._parse=function(i,l){function _(w,D,N){return N==="assert"?new Wa(D,[w]):N==="coerce"?new gl(D,[w]):w}if(i!==null&&typeof i!="string"&&typeof i!="boolean"&&typeof i!="number"||(i=["literal",i]),Array.isArray(i)){if(i.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var S=i[0];if(typeof S!="string")return this.error("Expression name must be a string, but found "+typeof S+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var F=this.registry[S];if(F){var j=F.parse(i,this);if(!j)return null;if(this.expectedType){var p=this.expectedType,v=j.type;if(p.kind!=="string"&&p.kind!=="number"&&p.kind!=="boolean"&&p.kind!=="object"&&p.kind!=="array"||v.kind!=="value")if(p.kind!=="color"&&p.kind!=="formatted"&&p.kind!=="resolvedImage"||v.kind!=="value"&&v.kind!=="string"){if(this.checkSubtype(p,v))return null}else j=_(j,p,l.typeAnnotation||"coerce");else j=_(j,p,l.typeAnnotation||"assert")}if(!(j instanceof il)&&j.type.kind!=="resolvedImage"&&function w(D){if(D instanceof lo)return w(D.boundExpression);if(D instanceof Qa&&D.name==="error"||D instanceof Gl||D instanceof Aa)return!1;var N=D instanceof gl||D instanceof Wa,W=!0;return D.eachChild(function($){W=N?W&&w($):W&&$ instanceof il}),!!W&&Ni(D)&&Ku(D,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(j)){var m=new ol;try{j=new il(j.type,j.evaluate(m))}catch(w){return this.error(w.message),null}}return j}return this.error('Unknown expression "'+S+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(i===void 0?"'undefined' value invalid. Use null instead.":typeof i=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof i+" instead.")},bs.prototype.concat=function(i,l,_){var S=typeof i=="number"?this.path.concat(i):this.path,F=_?this.scope.concat(_):this.scope;return new bs(this.registry,S,l||null,F,this.errors)},bs.prototype.error=function(i){for(var l=[],_=arguments.length-1;_-- >0;)l[_]=arguments[_+1];var S=""+this.key+l.map(function(F){return"["+F+"]"}).join("");this.errors.push(new Sr(S,i))},bs.prototype.checkSubtype=function(i,l){var _=ns(i,l);return _&&this.error(_),_};var Nl=function(i,l,_){this.type=i,this.input=l,this.labels=[],this.outputs=[];for(var S=0,F=_;S=p)return l.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',m);var D=l.parse(v,w,F);if(!D)return null;F=F||D.type,S.push([p,D])}return new Nl(F,_,S)},Nl.prototype.evaluate=function(i){var l=this.labels,_=this.outputs;if(l.length===1)return _[0].evaluate(i);var S=this.input.evaluate(i);if(S<=l[0])return _[0].evaluate(i);var F=l.length;return S>=l[F-1]?_[F-1].evaluate(i):_[Os(l,S)].evaluate(i)},Nl.prototype.eachChild=function(i){i(this.input);for(var l=0,_=this.outputs;l<_.length;l+=1)i(_[l])},Nl.prototype.outputDefined=function(){return this.outputs.every(function(i){return i.outputDefined()})},Nl.prototype.serialize=function(){for(var i=["step",this.input.serialize()],l=0;l0&&i.push(this.labels[l]),i.push(this.outputs[l].serialize());return i};var eu=Object.freeze({__proto__:null,number:Io,color:function(i,l,_){return new Fo(Io(i.r,l.r,_),Io(i.g,l.g,_),Io(i.b,l.b,_),Io(i.a,l.a,_))},array:function(i,l,_){return i.map(function(S,F){return Io(S,l[F],_)})}}),Tl=6/29*3*(6/29),Fu=Math.PI/180,Ju=180/Math.PI;function al(i){return i>.008856451679035631?Math.pow(i,1/3):i/Tl+4/29}function Kc(i){return i>6/29?i*i*i:Tl*(i-4/29)}function ou(i){return 255*(i<=.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055)}function Ks(i){return(i/=255)<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Lp(i){var l=Ks(i.r),_=Ks(i.g),S=Ks(i.b),F=al((.4124564*l+.3575761*_+.1804375*S)/.95047),j=al((.2126729*l+.7151522*_+.072175*S)/1);return{l:116*j-16,a:500*(F-j),b:200*(j-al((.0193339*l+.119192*_+.9503041*S)/1.08883)),alpha:i.a}}function gf(i){var l=(i.l+16)/116,_=isNaN(i.a)?l:l+i.a/500,S=isNaN(i.b)?l:l-i.b/200;return l=1*Kc(l),_=.95047*Kc(_),S=1.08883*Kc(S),new Fo(ou(3.2404542*_-1.5371385*l-.4985314*S),ou(-.969266*_+1.8760108*l+.041556*S),ou(.0556434*_-.2040259*l+1.0572252*S),i.alpha)}function Of(i,l,_){var S=l-i;return i+_*(S>180||S<-180?S-360*Math.round(S/360):S)}var qh={forward:Lp,reverse:gf,interpolate:function(i,l,_){return{l:Io(i.l,l.l,_),a:Io(i.a,l.a,_),b:Io(i.b,l.b,_),alpha:Io(i.alpha,l.alpha,_)}}},zc={forward:function(i){var l=Lp(i),_=l.l,S=l.a,F=l.b,j=Math.atan2(F,S)*Ju;return{h:j<0?j+360:j,c:Math.sqrt(S*S+F*F),l:_,alpha:i.a}},reverse:function(i){var l=i.h*Fu,_=i.c;return gf({l:i.l,a:Math.cos(l)*_,b:Math.sin(l)*_,alpha:i.alpha})},interpolate:function(i,l,_){return{h:Of(i.h,l.h,_),c:Io(i.c,l.c,_),l:Io(i.l,l.l,_),alpha:Io(i.alpha,l.alpha,_)}}},Oh=Object.freeze({__proto__:null,lab:qh,hcl:zc}),Ms=function(i,l,_,S,F){this.type=i,this.operator=l,this.interpolation=_,this.input=S,this.labels=[],this.outputs=[];for(var j=0,p=F;j1}))return l.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);S={name:"cubic-bezier",controlPoints:v}}if(i.length-1<4)return l.error("Expected at least 4 arguments, but found only "+(i.length-1)+".");if((i.length-1)%2!=0)return l.error("Expected an even number of arguments.");if(!(F=l.parse(F,2,Lr)))return null;var m=[],w=null;_==="interpolate-hcl"||_==="interpolate-lab"?w=En:l.expectedType&&l.expectedType.kind!=="value"&&(w=l.expectedType);for(var D=0;D=N)return l.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',$);var pe=l.parse(W,ie,w);if(!pe)return null;w=w||pe.type,m.push([N,pe])}return w.kind==="number"||w.kind==="color"||w.kind==="array"&&w.itemType.kind==="number"&&typeof w.N=="number"?new Ms(w,_,S,F,m):l.error("Type "+Wo(w)+" is not interpolatable.")},Ms.prototype.evaluate=function(i){var l=this.labels,_=this.outputs;if(l.length===1)return _[0].evaluate(i);var S=this.input.evaluate(i);if(S<=l[0])return _[0].evaluate(i);var F=l.length;if(S>=l[F-1])return _[F-1].evaluate(i);var j=Os(l,S),p=Ms.interpolationFactor(this.interpolation,S,l[j],l[j+1]),v=_[j].evaluate(i),m=_[j+1].evaluate(i);return this.operator==="interpolate"?eu[this.type.kind.toLowerCase()](v,m,p):this.operator==="interpolate-hcl"?zc.reverse(zc.interpolate(zc.forward(v),zc.forward(m),p)):qh.reverse(qh.interpolate(qh.forward(v),qh.forward(m),p))},Ms.prototype.eachChild=function(i){i(this.input);for(var l=0,_=this.outputs;l<_.length;l+=1)i(_[l])},Ms.prototype.outputDefined=function(){return this.outputs.every(function(i){return i.outputDefined()})},Ms.prototype.serialize=function(){var i;i=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var l=[this.operator,i,this.input.serialize()],_=0;_=_.length)throw new va("Array index out of bounds: "+l+" > "+(_.length-1)+".");if(l!==Math.floor(l))throw new va("Array index must be an integer, but found "+l+" instead.");return _[l]},uc.prototype.eachChild=function(i){i(this.index),i(this.input)},uc.prototype.outputDefined=function(){return!1},uc.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var eh=function(i,l){this.type=bn,this.needle=i,this.haystack=l};eh.parse=function(i,l){if(i.length!==3)return l.error("Expected 2 arguments, but found "+(i.length-1)+" instead.");var _=l.parse(i[1],1,On),S=l.parse(i[2],2,On);return _&&S?Yo(_.type,[bn,Nn,Lr,xn,On])?new eh(_,S):l.error("Expected first argument to be of type boolean, string, number or null, but found "+Wo(_.type)+" instead"):null},eh.prototype.evaluate=function(i){var l=this.needle.evaluate(i),_=this.haystack.evaluate(i);if(!_)return!1;if(!_a(l,["boolean","string","number","null"]))throw new va("Expected first argument to be of type boolean, string, number or null, but found "+Wo(oa(l))+" instead.");if(!_a(_,["string","array"]))throw new va("Expected second argument to be of type array or string, but found "+Wo(oa(_))+" instead.");return _.indexOf(l)>=0},eh.prototype.eachChild=function(i){i(this.needle),i(this.haystack)},eh.prototype.outputDefined=function(){return!0},eh.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var yh=function(i,l,_){this.type=Lr,this.needle=i,this.haystack=l,this.fromIndex=_};yh.parse=function(i,l){if(i.length<=2||i.length>=5)return l.error("Expected 3 or 4 arguments, but found "+(i.length-1)+" instead.");var _=l.parse(i[1],1,On),S=l.parse(i[2],2,On);if(!_||!S)return null;if(!Yo(_.type,[bn,Nn,Lr,xn,On]))return l.error("Expected first argument to be of type boolean, string, number or null, but found "+Wo(_.type)+" instead");if(i.length===4){var F=l.parse(i[3],3,Lr);return F?new yh(_,S,F):null}return new yh(_,S)},yh.prototype.evaluate=function(i){var l=this.needle.evaluate(i),_=this.haystack.evaluate(i);if(!_a(l,["boolean","string","number","null"]))throw new va("Expected first argument to be of type boolean, string, number or null, but found "+Wo(oa(l))+" instead.");if(!_a(_,["string","array"]))throw new va("Expected second argument to be of type array or string, but found "+Wo(oa(_))+" instead.");if(this.fromIndex){var S=this.fromIndex.evaluate(i);return _.indexOf(l,S)}return _.indexOf(l)},yh.prototype.eachChild=function(i){i(this.needle),i(this.haystack),this.fromIndex&&i(this.fromIndex)},yh.prototype.outputDefined=function(){return!1},yh.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var i=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),i]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var sl=function(i,l,_,S,F,j){this.inputType=i,this.type=l,this.input=_,this.cases=S,this.outputs=F,this.otherwise=j};sl.parse=function(i,l){if(i.length<5)return l.error("Expected at least 4 arguments, but found only "+(i.length-1)+".");if(i.length%2!=1)return l.error("Expected an even number of arguments.");var _,S;l.expectedType&&l.expectedType.kind!=="value"&&(S=l.expectedType);for(var F={},j=[],p=2;pNumber.MAX_SAFE_INTEGER)return w.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof W=="number"&&Math.floor(W)!==W)return w.error("Numeric branch labels must be integer values.");if(_){if(w.checkSubtype(_,oa(W)))return null}else _=oa(W);if(F[String(W)]!==void 0)return w.error("Branch labels must be unique.");F[String(W)]=j.length}var $=l.parse(m,p,S);if(!$)return null;S=S||$.type,j.push($)}var ie=l.parse(i[1],1,On);if(!ie)return null;var pe=l.parse(i[i.length-1],i.length-1,S);return pe?ie.type.kind!=="value"&&l.concat(1).checkSubtype(_,ie.type)?null:new sl(_,S,ie,F,j,pe):null},sl.prototype.evaluate=function(i){var l=this.input.evaluate(i);return(oa(l)===this.inputType&&this.outputs[this.cases[l]]||this.otherwise).evaluate(i)},sl.prototype.eachChild=function(i){i(this.input),this.outputs.forEach(i),i(this.otherwise)},sl.prototype.outputDefined=function(){return this.outputs.every(function(i){return i.outputDefined()})&&this.otherwise.outputDefined()},sl.prototype.serialize=function(){for(var i=this,l=["match",this.input.serialize()],_=[],S={},F=0,j=Object.keys(this.cases).sort();F=5)return l.error("Expected 3 or 4 arguments, but found "+(i.length-1)+" instead.");var _=l.parse(i[1],1,On),S=l.parse(i[2],2,Lr);if(!_||!S)return null;if(!Yo(_.type,[Ga(On),Nn,On]))return l.error("Expected first argument to be of type array or string, but found "+Wo(_.type)+" instead");if(i.length===4){var F=l.parse(i[3],3,Lr);return F?new bc(_.type,_,S,F):null}return new bc(_.type,_,S)},bc.prototype.evaluate=function(i){var l=this.input.evaluate(i),_=this.beginIndex.evaluate(i);if(!_a(l,["string","array"]))throw new va("Expected first argument to be of type array or string, but found "+Wo(oa(l))+" instead.");if(this.endIndex){var S=this.endIndex.evaluate(i);return l.slice(_,S)}return l.slice(_)},bc.prototype.eachChild=function(i){i(this.input),i(this.beginIndex),this.endIndex&&i(this.endIndex)},bc.prototype.outputDefined=function(){return!1},bc.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var i=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),i]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Gf=Ps("==",function(i,l,_){return l===_},dp),Xp=Ps("!=",function(i,l,_){return l!==_},function(i,l,_,S){return!dp(0,l,_,S)}),cc=Ps("<",function(i,l,_){return l<_},function(i,l,_,S){return S.compare(l,_)<0}),zl=Ps(">",function(i,l,_){return l>_},function(i,l,_,S){return S.compare(l,_)>0}),Ec=Ps("<=",function(i,l,_){return l<=_},function(i,l,_,S){return S.compare(l,_)<=0}),th=Ps(">=",function(i,l,_){return l>=_},function(i,l,_,S){return S.compare(l,_)>=0}),vu=function(i,l,_,S,F){this.type=Nn,this.number=i,this.locale=l,this.currency=_,this.minFractionDigits=S,this.maxFractionDigits=F};vu.parse=function(i,l){if(i.length!==3)return l.error("Expected two arguments.");var _=l.parse(i[1],1,Lr);if(!_)return null;var S=i[2];if(typeof S!="object"||Array.isArray(S))return l.error("NumberFormat options argument must be an object.");var F=null;if(S.locale&&!(F=l.parse(S.locale,1,Nn)))return null;var j=null;if(S.currency&&!(j=l.parse(S.currency,1,Nn)))return null;var p=null;if(S["min-fraction-digits"]&&!(p=l.parse(S["min-fraction-digits"],1,Lr)))return null;var v=null;return S["max-fraction-digits"]&&!(v=l.parse(S["max-fraction-digits"],1,Lr))?null:new vu(_,F,j,p,v)},vu.prototype.evaluate=function(i){return new Intl.NumberFormat(this.locale?this.locale.evaluate(i):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(i):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(i):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(i):void 0}).format(this.number.evaluate(i))},vu.prototype.eachChild=function(i){i(this.number),this.locale&&i(this.locale),this.currency&&i(this.currency),this.minFractionDigits&&i(this.minFractionDigits),this.maxFractionDigits&&i(this.maxFractionDigits)},vu.prototype.outputDefined=function(){return!1},vu.prototype.serialize=function(){var i={};return this.locale&&(i.locale=this.locale.serialize()),this.currency&&(i.currency=this.currency.serialize()),this.minFractionDigits&&(i["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(i["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),i]};var xh=function(i){this.type=Lr,this.input=i};xh.parse=function(i,l){if(i.length!==2)return l.error("Expected 1 argument, but found "+(i.length-1)+" instead.");var _=l.parse(i[1],1);return _?_.type.kind!=="array"&&_.type.kind!=="string"&&_.type.kind!=="value"?l.error("Expected argument of type string or array, but found "+Wo(_.type)+" instead."):new xh(_):null},xh.prototype.evaluate=function(i){var l=this.input.evaluate(i);if(typeof l=="string"||Array.isArray(l))return l.length;throw new va("Expected value to be of type string or array, but found "+Wo(oa(l))+" instead.")},xh.prototype.eachChild=function(i){i(this.input)},xh.prototype.outputDefined=function(){return!1},xh.prototype.serialize=function(){var i=["length"];return this.eachChild(function(l){i.push(l.serialize())}),i};var qa={"==":Gf,"!=":Xp,">":zl,"<":cc,">=":th,"<=":Ec,array:Wa,at:uc,boolean:Wa,case:Uc,coalesce:Yh,collator:Gl,format:Ds,image:Rl,in:eh,"index-of":yh,interpolate:Ms,"interpolate-hcl":Ms,"interpolate-lab":Ms,length:xh,let:Qc,literal:il,match:sl,number:Wa,"number-format":vu,object:Wa,slice:bc,step:Nl,string:Wa,"to-boolean":gl,"to-color":gl,"to-number":gl,"to-string":gl,var:lo,within:Aa};function Hs(i,l){var _=l[0],S=l[1],F=l[2],j=l[3];_=_.evaluate(i),S=S.evaluate(i),F=F.evaluate(i);var p=j?j.evaluate(i):1,v=sc(_,S,F,p);if(v)throw new va(v);return new Fo(_/255*p,S/255*p,F/255*p,p)}function Ep(i,l){return i in l}function Na(i,l){var _=l[i];return _===void 0?null:_}function Qu(i){return{type:i}}function Is(i){return{result:"success",value:i}}function ys(i){return{result:"error",value:i}}function ec(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function Bf(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function es(i){return!!i.expression&&i.expression.interpolated}function Bs(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function wc(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function qp(i){return i}function Sc(i,l,_){return i!==void 0?i:l!==void 0?l:_!==void 0?_:void 0}function $h(i,l,_,S,F){return Sc(typeof _===F?S[_]:void 0,i.default,l.default)}function Xo(i,l,_){if(Bs(_)!=="number")return Sc(i.default,l.default);var S=i.stops.length;if(S===1||_<=i.stops[0][0])return i.stops[0][1];if(_>=i.stops[S-1][0])return i.stops[S-1][1];var F=Os(i.stops.map(function(j){return j[0]}),_);return i.stops[F][1]}function au(i,l,_){var S=i.base!==void 0?i.base:1;if(Bs(_)!=="number")return Sc(i.default,l.default);var F=i.stops.length;if(F===1||_<=i.stops[0][0])return i.stops[0][1];if(_>=i.stops[F-1][0])return i.stops[F-1][1];var j=Os(i.stops.map(function(N){return N[0]}),_),p=function(N,W,$,ie){var pe=ie-$,we=N-$;return pe===0?0:W===1?we/pe:(Math.pow(W,we)-1)/(Math.pow(W,pe)-1)}(_,S,i.stops[j][0],i.stops[j+1][0]),v=i.stops[j][1],m=i.stops[j+1][1],w=eu[l.type]||qp;if(i.colorSpace&&i.colorSpace!=="rgb"){var D=Oh[i.colorSpace];w=function(N,W){return D.reverse(D.interpolate(D.forward(N),D.forward(W),p))}}return typeof v.evaluate=="function"?{evaluate:function(){for(var N=[],W=arguments.length;W--;)N[W]=arguments[W];var $=v.evaluate.apply(void 0,N),ie=m.evaluate.apply(void 0,N);if($!==void 0&&ie!==void 0)return w($,ie,p)}}:w(v,m,p)}function dl(i,l,_){return l.type==="color"?_=Fo.parse(_):l.type==="formatted"?_=Ba.fromString(_.toString()):l.type==="resolvedImage"?_=Fa.fromString(_.toString()):Bs(_)===l.type||l.type==="enum"&&l.values[_]||(_=void 0),Sc(_,i.default,l.default)}Qa.register(qa,{error:[{kind:"error"},[Nn],function(i,l){throw new va(l[0].evaluate(i))}],typeof:[Nn,[On],function(i,l){return Wo(oa(l[0].evaluate(i)))}],"to-rgba":[Ga(Lr,4),[En],function(i,l){return l[0].evaluate(i).toArray()}],rgb:[En,[Lr,Lr,Lr],Hs],rgba:[En,[Lr,Lr,Lr,Lr],Hs],has:{type:bn,overloads:[[[Nn],function(i,l){return Ep(l[0].evaluate(i),i.properties())}],[[Nn,io],function(i,l){var _=l[1];return Ep(l[0].evaluate(i),_.evaluate(i))}]]},get:{type:On,overloads:[[[Nn],function(i,l){return Na(l[0].evaluate(i),i.properties())}],[[Nn,io],function(i,l){var _=l[1];return Na(l[0].evaluate(i),_.evaluate(i))}]]},"feature-state":[On,[Nn],function(i,l){return Na(l[0].evaluate(i),i.featureState||{})}],properties:[io,[],function(i){return i.properties()}],"geometry-type":[Nn,[],function(i){return i.geometryType()}],id:[On,[],function(i){return i.id()}],zoom:[Lr,[],function(i){return i.globals.zoom}],"heatmap-density":[Lr,[],function(i){return i.globals.heatmapDensity||0}],"line-progress":[Lr,[],function(i){return i.globals.lineProgress||0}],accumulated:[On,[],function(i){return i.globals.accumulated===void 0?null:i.globals.accumulated}],"+":[Lr,Qu(Lr),function(i,l){for(var _=0,S=0,F=l;S":[bn,[Nn,On],function(i,l){var _=l[0],S=l[1],F=i.properties()[_.value],j=S.value;return typeof F==typeof j&&F>j}],"filter-id->":[bn,[On],function(i,l){var _=l[0],S=i.id(),F=_.value;return typeof S==typeof F&&S>F}],"filter-<=":[bn,[Nn,On],function(i,l){var _=l[0],S=l[1],F=i.properties()[_.value],j=S.value;return typeof F==typeof j&&F<=j}],"filter-id-<=":[bn,[On],function(i,l){var _=l[0],S=i.id(),F=_.value;return typeof S==typeof F&&S<=F}],"filter->=":[bn,[Nn,On],function(i,l){var _=l[0],S=l[1],F=i.properties()[_.value],j=S.value;return typeof F==typeof j&&F>=j}],"filter-id->=":[bn,[On],function(i,l){var _=l[0],S=i.id(),F=_.value;return typeof S==typeof F&&S>=F}],"filter-has":[bn,[On],function(i,l){return l[0].value in i.properties()}],"filter-has-id":[bn,[],function(i){return i.id()!==null&&i.id()!==void 0}],"filter-type-in":[bn,[Ga(Nn)],function(i,l){return l[0].value.indexOf(i.geometryType())>=0}],"filter-id-in":[bn,[Ga(On)],function(i,l){return l[0].value.indexOf(i.id())>=0}],"filter-in-small":[bn,[Nn,Ga(On)],function(i,l){var _=l[0];return l[1].value.indexOf(i.properties()[_.value])>=0}],"filter-in-large":[bn,[Nn,Ga(On)],function(i,l){var _=l[0],S=l[1];return function(F,j,p,v){for(;p<=v;){var m=p+v>>1;if(j[m]===F)return!0;j[m]>F?v=m-1:p=m+1}return!1}(i.properties()[_.value],S.value,0,S.value.length-1)}],all:{type:bn,overloads:[[[bn,bn],function(i,l){var _=l[1];return l[0].evaluate(i)&&_.evaluate(i)}],[Qu(bn),function(i,l){for(var _=0,S=l;_0&&typeof i[0]=="string"&&i[0]in qa}function mp(i,l){var _=new bs(qa,[],l?function(F){var j={color:En,string:Nn,number:Lr,enum:Nn,boolean:bn,formatted:ia,resolvedImage:Ho};return F.type==="array"?Ga(j[F.value]||On,F.length):j[F.type]}(l):void 0),S=_.parse(i,void 0,void 0,void 0,l&&l.type==="string"?{typeAnnotation:"coerce"}:void 0);return S?Is(new tc(S,l)):ys(_.errors)}tc.prototype.evaluateWithoutErrorHandling=function(i,l,_,S,F,j){return this._evaluator.globals=i,this._evaluator.feature=l,this._evaluator.featureState=_,this._evaluator.canonical=S,this._evaluator.availableImages=F||null,this._evaluator.formattedSection=j,this.expression.evaluate(this._evaluator)},tc.prototype.evaluate=function(i,l,_,S,F,j){this._evaluator.globals=i,this._evaluator.feature=l||null,this._evaluator.featureState=_||null,this._evaluator.canonical=S,this._evaluator.availableImages=F||null,this._evaluator.formattedSection=j||null;try{var p=this.expression.evaluate(this._evaluator);if(p==null||typeof p=="number"&&p!=p)return this._defaultValue;if(this._enumValues&&!(p in this._enumValues))throw new va("Expected value to be one of "+Object.keys(this._enumValues).map(function(v){return JSON.stringify(v)}).join(", ")+", but found "+JSON.stringify(p)+" instead.");return p}catch(v){return this._warningHistory[v.message]||(this._warningHistory[v.message]=!0,typeof console!="undefined"&&console.warn(v.message)),this._defaultValue}};var Kh=function(i,l){this.kind=i,this._styleExpression=l,this.isStateDependent=i!=="constant"&&!lc(l.expression)};Kh.prototype.evaluateWithoutErrorHandling=function(i,l,_,S,F,j){return this._styleExpression.evaluateWithoutErrorHandling(i,l,_,S,F,j)},Kh.prototype.evaluate=function(i,l,_,S,F,j){return this._styleExpression.evaluate(i,l,_,S,F,j)};var Zc=function(i,l,_,S){this.kind=i,this.zoomStops=_,this._styleExpression=l,this.isStateDependent=i!=="camera"&&!lc(l.expression),this.interpolationType=S};function vf(i,l){if((i=mp(i,l)).result==="error")return i;var _=i.value.expression,S=Ni(_);if(!S&&!ec(l))return ys([new Sr("","data expressions not supported")]);var F=Ku(_,["zoom"]);if(!F&&!Bf(l))return ys([new Sr("","zoom expressions not supported")]);var j=function p(v){var m=null;if(v instanceof Qc)m=p(v.result);else if(v instanceof Yh)for(var w=0,D=v.args;wS.maximum?[new Je(l,_,_+" is greater than the maximum value "+S.maximum)]:[]}function Fh(i){var l,_,S,F=i.valueSpec,j=Fr(i.value.type),p={},v=j!=="categorical"&&i.value.property===void 0,m=!v,w=Bs(i.value.stops)==="array"&&Bs(i.value.stops[0])==="array"&&Bs(i.value.stops[0][0])==="object",D=_u({key:i.key,value:i.value,valueSpec:i.styleSpec.function,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function($){if(j==="identity")return[new Je($.key,$.value,'identity function may not have a "stops" property')];var ie=[],pe=$.value;return ie=ie.concat(Vc({key:$.key,value:pe,valueSpec:$.valueSpec,style:$.style,styleSpec:$.styleSpec,arrayElementValidator:N})),Bs(pe)==="array"&&pe.length===0&&ie.push(new Je($.key,pe,"array must have at least one stop")),ie},default:function($){return Sa({key:$.key,value:$.value,valueSpec:F,style:$.style,styleSpec:$.styleSpec})}}});return j==="identity"&&v&&D.push(new Je(i.key,i.value,'missing required property "property"')),j==="identity"||i.value.stops||D.push(new Je(i.key,i.value,'missing required property "stops"')),j==="exponential"&&i.valueSpec.expression&&!es(i.valueSpec)&&D.push(new Je(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(m&&!ec(i.valueSpec)?D.push(new Je(i.key,i.value,"property functions not supported")):v&&!Bf(i.valueSpec)&&D.push(new Je(i.key,i.value,"zoom functions not supported"))),j!=="categorical"&&!w||i.value.property!==void 0||D.push(new Je(i.key,i.value,'"property" property is required')),D;function N($){var ie=[],pe=$.value,we=$.key;if(Bs(pe)!=="array")return[new Je(we,pe,"array expected, "+Bs(pe)+" found")];if(pe.length!==2)return[new Je(we,pe,"array length 2 expected, length "+pe.length+" found")];if(w){if(Bs(pe[0])!=="object")return[new Je(we,pe,"object expected, "+Bs(pe[0])+" found")];if(pe[0].zoom===void 0)return[new Je(we,pe,"object stop key must have zoom")];if(pe[0].value===void 0)return[new Je(we,pe,"object stop key must have value")];if(S&&S>Fr(pe[0].zoom))return[new Je(we,pe[0].zoom,"stop zoom values must appear in ascending order")];Fr(pe[0].zoom)!==S&&(S=Fr(pe[0].zoom),_=void 0,p={}),ie=ie.concat(_u({key:we+"[0]",value:pe[0],valueSpec:{zoom:{}},style:$.style,styleSpec:$.styleSpec,objectElementValidators:{zoom:Yp,value:W}}))}else ie=ie.concat(W({key:we+"[0]",value:pe[0],valueSpec:{},style:$.style,styleSpec:$.styleSpec},pe));return bh(mr(pe[1]))?ie.concat([new Je(we+"[1]",pe[1],"expressions are not allowed in function stops.")]):ie.concat(Sa({key:we+"[1]",value:pe[1],valueSpec:F,style:$.style,styleSpec:$.styleSpec}))}function W($,ie){var pe=Bs($.value),we=Fr($.value),ke=$.value!==null?$.value:ie;if(l){if(pe!==l)return[new Je($.key,ke,pe+" stop domain type must match previous stop domain type "+l)]}else l=pe;if(pe!=="number"&&pe!=="string"&&pe!=="boolean")return[new Je($.key,ke,"stop domain value must be a number, string, or boolean")];if(pe!=="number"&&j!=="categorical"){var Ge="number expected, "+pe+" found";return ec(F)&&j===void 0&&(Ge+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Je($.key,ke,Ge)]}return j!=="categorical"||pe!=="number"||isFinite(we)&&Math.floor(we)===we?j!=="categorical"&&pe==="number"&&_!==void 0&&we<_?[new Je($.key,ke,"stop domain values must appear in ascending order")]:(_=we,j==="categorical"&&we in p?[new Je($.key,ke,"stop domain values must be unique")]:(p[we]=!0,[])):[new Je($.key,ke,"integer expected, found "+we)]}}function Ll(i){var l=(i.expressionContext==="property"?vf:mp)(mr(i.value),i.valueSpec);if(l.result==="error")return l.value.map(function(S){return new Je(""+i.key+S.key,i.value,S.message)});var _=l.value.expression||l.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!_.outputDefined())return[new Je(i.key,i.value,'Invalid data expression for "'+i.propertyKey+'". Output values must be contained as literals within the expression.')];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!lc(_))return[new Je(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!lc(_))return[new Je(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!Ku(_,["zoom","feature-state"]))return[new Je(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Ni(_))return[new Je(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Fs(i){var l=i.key,_=i.value,S=i.valueSpec,F=[];return Array.isArray(S.values)?S.values.indexOf(Fr(_))===-1&&F.push(new Je(l,_,"expected one of ["+S.values.join(", ")+"], "+JSON.stringify(_)+" found")):Object.keys(S.values).indexOf(Fr(_))===-1&&F.push(new Je(l,_,"expected one of ["+Object.keys(S.values).join(", ")+"], "+JSON.stringify(_)+" found")),F}function Tc(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(var l=0,_=i.slice(1);l<_.length;l+=1){var S=_[l];if(!Tc(S)&&typeof S!="boolean")return!1}return!0;default:return!0}}Bh.deserialize=function(i){return new Bh(i._parameters,i._specification)},Bh.serialize=function(i){return{_parameters:i._parameters,_specification:i._specification}};var Ru={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function jc(i){if(i==null)return{filter:function(){return!0},needGeometry:!1};Tc(i)||(i=Jh(i));var l=mp(i,Ru);if(l.result==="error")throw new Error(l.value.map(function(_){return _.key+": "+_.message}).join(", "));return{filter:function(_,S,F){return l.value.evaluate(_,S,{},F)},needGeometry:function _(S){if(!Array.isArray(S))return!1;if(S[0]==="within")return!0;for(var F=1;Fl?1:0}function Jh(i){if(!i)return!0;var l,_=i[0];return i.length<=1?_!=="any":_==="=="?Ac(i[1],i[2],"=="):_==="!="?rh(Ac(i[1],i[2],"==")):_==="<"||_===">"||_==="<="||_===">="?Ac(i[1],i[2],_):_==="any"?(l=i.slice(1),["any"].concat(l.map(Jh))):_==="all"?["all"].concat(i.slice(1).map(Jh)):_==="none"?["all"].concat(i.slice(1).map(Jh).map(rh)):_==="in"?kh(i[1],i.slice(2)):_==="!in"?rh(kh(i[1],i.slice(2))):_==="has"?Iu(i[1]):_==="!has"?rh(Iu(i[1])):_!=="within"||i}function Ac(i,l,_){switch(i){case"$type":return["filter-type-"+_,l];case"$id":return["filter-id-"+_,l];default:return["filter-"+_,i,l]}}function kh(i,l){if(l.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",l]];case"$id":return["filter-id-in",["literal",l]];default:return l.length>200&&!l.some(function(_){return typeof _!=typeof l[0]})?["filter-in-large",i,["literal",l.sort($p)]]:["filter-in-small",i,["literal",l]]}}function Iu(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function rh(i){return["!",i]}function gp(i){return Tc(mr(i.value))?Ll(Ht({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function l(_){var S=_.value,F=_.key;if(Bs(S)!=="array")return[new Je(F,S,"array expected, "+Bs(S)+" found")];var j,p=_.styleSpec,v=[];if(S.length<1)return[new Je(F,S,"filter array must have at least 1 element")];switch(v=v.concat(Fs({key:F+"[0]",value:S[0],valueSpec:p.filter_operator,style:_.style,styleSpec:_.styleSpec})),Fr(S[0])){case"<":case"<=":case">":case">=":S.length>=2&&Fr(S[1])==="$type"&&v.push(new Je(F,S,'"$type" cannot be use with operator "'+S[0]+'"'));case"==":case"!=":S.length!==3&&v.push(new Je(F,S,'filter array for operator "'+S[0]+'" must have 3 elements'));case"in":case"!in":S.length>=2&&(j=Bs(S[1]))!=="string"&&v.push(new Je(F+"[1]",S[1],"string expected, "+j+" found"));for(var m=2;m=D[$+0]&&S>=D[$+1])?(p[W]=!0,j.push(w[W])):p[W]=!1}}},ll.prototype._forEachCell=function(i,l,_,S,F,j,p,v){for(var m=this._convertToCellCoord(i),w=this._convertToCellCoord(l),D=this._convertToCellCoord(_),N=this._convertToCellCoord(S),W=m;W<=D;W++)for(var $=w;$<=N;$++){var ie=this.d*$+W;if((!v||v(this._convertFromCellCoord(W),this._convertFromCellCoord($),this._convertFromCellCoord(W+1),this._convertFromCellCoord($+1)))&&F.call(this,i,l,_,S,ie,j,p,v))return}},ll.prototype._convertFromCellCoord=function(i){return(i-this.padding)/this.scale},ll.prototype._convertToCellCoord=function(i){return Math.max(0,Math.min(this.d-1,Math.floor(i*this.scale)+this.padding))},ll.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var i=this.cells,l=3+this.cells.length+1+1,_=0,S=0;S=0)){var D=i[w];m[w]=oi[v].shallow.indexOf(w)>=0?D:ai(D,l)}i instanceof Error&&(m.message=i.message)}if(m.$name)throw new Error("$name property is reserved for worker serialization logic.");return v!=="Object"&&(m.$name=v),m}throw new Error("can't serialize object of type "+typeof i)}function is(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||bu(i)||Dp(i)||ArrayBuffer.isView(i)||i instanceof Wc)return i;if(Array.isArray(i))return i.map(is);if(typeof i=="object"){var l=i.$name||"Object",_=oi[l].klass;if(!_)throw new Error("can't deserialize unregistered class "+l);if(_.deserialize)return _.deserialize(i);for(var S=Object.create(_.prototype),F=0,j=Object.keys(i);F=0?v:is(v)}}return S}throw new Error("can't deserialize object of type "+typeof i)}var ep=function(){this.first=!0};ep.prototype.update=function(i,l){var _=Math.floor(i);return this.first?(this.first=!1,this.lastIntegerZoom=_,this.lastIntegerZoomTime=0,this.lastZoom=i,this.lastFloorZoom=_,!0):(this.lastFloorZoom>_?(this.lastIntegerZoom=_+1,this.lastIntegerZoomTime=l):this.lastFloorZoom<_&&(this.lastIntegerZoom=_,this.lastIntegerZoomTime=l),i!==this.lastZoom&&(this.lastZoom=i,this.lastFloorZoom=_,!0))};var mi={"Latin-1 Supplement":function(i){return i>=128&&i<=255},Arabic:function(i){return i>=1536&&i<=1791},"Arabic Supplement":function(i){return i>=1872&&i<=1919},"Arabic Extended-A":function(i){return i>=2208&&i<=2303},"Hangul Jamo":function(i){return i>=4352&&i<=4607},"Unified Canadian Aboriginal Syllabics":function(i){return i>=5120&&i<=5759},Khmer:function(i){return i>=6016&&i<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(i){return i>=6320&&i<=6399},"General Punctuation":function(i){return i>=8192&&i<=8303},"Letterlike Symbols":function(i){return i>=8448&&i<=8527},"Number Forms":function(i){return i>=8528&&i<=8591},"Miscellaneous Technical":function(i){return i>=8960&&i<=9215},"Control Pictures":function(i){return i>=9216&&i<=9279},"Optical Character Recognition":function(i){return i>=9280&&i<=9311},"Enclosed Alphanumerics":function(i){return i>=9312&&i<=9471},"Geometric Shapes":function(i){return i>=9632&&i<=9727},"Miscellaneous Symbols":function(i){return i>=9728&&i<=9983},"Miscellaneous Symbols and Arrows":function(i){return i>=11008&&i<=11263},"CJK Radicals Supplement":function(i){return i>=11904&&i<=12031},"Kangxi Radicals":function(i){return i>=12032&&i<=12255},"Ideographic Description Characters":function(i){return i>=12272&&i<=12287},"CJK Symbols and Punctuation":function(i){return i>=12288&&i<=12351},Hiragana:function(i){return i>=12352&&i<=12447},Katakana:function(i){return i>=12448&&i<=12543},Bopomofo:function(i){return i>=12544&&i<=12591},"Hangul Compatibility Jamo":function(i){return i>=12592&&i<=12687},Kanbun:function(i){return i>=12688&&i<=12703},"Bopomofo Extended":function(i){return i>=12704&&i<=12735},"CJK Strokes":function(i){return i>=12736&&i<=12783},"Katakana Phonetic Extensions":function(i){return i>=12784&&i<=12799},"Enclosed CJK Letters and Months":function(i){return i>=12800&&i<=13055},"CJK Compatibility":function(i){return i>=13056&&i<=13311},"CJK Unified Ideographs Extension A":function(i){return i>=13312&&i<=19903},"Yijing Hexagram Symbols":function(i){return i>=19904&&i<=19967},"CJK Unified Ideographs":function(i){return i>=19968&&i<=40959},"Yi Syllables":function(i){return i>=40960&&i<=42127},"Yi Radicals":function(i){return i>=42128&&i<=42191},"Hangul Jamo Extended-A":function(i){return i>=43360&&i<=43391},"Hangul Syllables":function(i){return i>=44032&&i<=55215},"Hangul Jamo Extended-B":function(i){return i>=55216&&i<=55295},"Private Use Area":function(i){return i>=57344&&i<=63743},"CJK Compatibility Ideographs":function(i){return i>=63744&&i<=64255},"Arabic Presentation Forms-A":function(i){return i>=64336&&i<=65023},"Vertical Forms":function(i){return i>=65040&&i<=65055},"CJK Compatibility Forms":function(i){return i>=65072&&i<=65103},"Small Form Variants":function(i){return i>=65104&&i<=65135},"Arabic Presentation Forms-B":function(i){return i>=65136&&i<=65279},"Halfwidth and Fullwidth Forms":function(i){return i>=65280&&i<=65519}};function Mc(i){for(var l=0,_=i;l<_.length;l+=1)if(Op(_[l].charCodeAt(0)))return!0;return!1}function Op(i){return!(i!==746&&i!==747&&(i<4352||!(mi["Bopomofo Extended"](i)||mi.Bopomofo(i)||mi["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||mi["CJK Compatibility Ideographs"](i)||mi["CJK Compatibility"](i)||mi["CJK Radicals Supplement"](i)||mi["CJK Strokes"](i)||!(!mi["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||mi["CJK Unified Ideographs Extension A"](i)||mi["CJK Unified Ideographs"](i)||mi["Enclosed CJK Letters and Months"](i)||mi["Hangul Compatibility Jamo"](i)||mi["Hangul Jamo Extended-A"](i)||mi["Hangul Jamo Extended-B"](i)||mi["Hangul Jamo"](i)||mi["Hangul Syllables"](i)||mi.Hiragana(i)||mi["Ideographic Description Characters"](i)||mi.Kanbun(i)||mi["Kangxi Radicals"](i)||mi["Katakana Phonetic Extensions"](i)||mi.Katakana(i)&&i!==12540||!(!mi["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!mi["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||mi["Unified Canadian Aboriginal Syllabics"](i)||mi["Unified Canadian Aboriginal Syllabics Extended"](i)||mi["Vertical Forms"](i)||mi["Yijing Hexagram Symbols"](i)||mi["Yi Syllables"](i)||mi["Yi Radicals"](i))))}function Jp(i){return!(Op(i)||function(l){return!!(mi["Latin-1 Supplement"](l)&&(l===167||l===169||l===174||l===177||l===188||l===189||l===190||l===215||l===247)||mi["General Punctuation"](l)&&(l===8214||l===8224||l===8225||l===8240||l===8241||l===8251||l===8252||l===8258||l===8263||l===8264||l===8265||l===8273)||mi["Letterlike Symbols"](l)||mi["Number Forms"](l)||mi["Miscellaneous Technical"](l)&&(l>=8960&&l<=8967||l>=8972&&l<=8991||l>=8996&&l<=9e3||l===9003||l>=9085&&l<=9114||l>=9150&&l<=9165||l===9167||l>=9169&&l<=9179||l>=9186&&l<=9215)||mi["Control Pictures"](l)&&l!==9251||mi["Optical Character Recognition"](l)||mi["Enclosed Alphanumerics"](l)||mi["Geometric Shapes"](l)||mi["Miscellaneous Symbols"](l)&&!(l>=9754&&l<=9759)||mi["Miscellaneous Symbols and Arrows"](l)&&(l>=11026&&l<=11055||l>=11088&&l<=11097||l>=11192&&l<=11243)||mi["CJK Symbols and Punctuation"](l)||mi.Katakana(l)||mi["Private Use Area"](l)||mi["CJK Compatibility Forms"](l)||mi["Small Form Variants"](l)||mi["Halfwidth and Fullwidth Forms"](l)||l===8734||l===8756||l===8757||l>=9984&&l<=10087||l>=10102&&l<=10131||l===65532||l===65533)}(i))}function Xc(i){return i>=1424&&i<=2303||mi["Arabic Presentation Forms-A"](i)||mi["Arabic Presentation Forms-B"](i)}function hc(i,l){return!(!l&&Xc(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||mi.Khmer(i))}function wh(i){for(var l=0,_=i;l<_.length;l+=1)if(Xc(_[l].charCodeAt(0)))return!0;return!1}var Pc=null,Xl="unavailable",Rc=null,Eu=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(Xl="error"),Pc&&Pc(i)};function lh(){tp.fire(new ze("pluginStateChange",{pluginStatus:Xl,pluginURL:Rc}))}var tp=new Ue,rp=function(){return Xl},su=function(){if(Xl!=="deferred"||!Rc)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Xl="loading",lh(),Rc&&Lt({url:Rc},function(i){i?Eu(i):(Xl="loaded",lh())})},ql={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Xl==="loaded"||ql.applyArabicShaping!=null},isLoading:function(){return Xl==="loading"},setState:function(i){Xl=i.pluginStatus,Rc=i.pluginURL},isParsed:function(){return ql.applyArabicShaping!=null&&ql.processBidirectionalText!=null&&ql.processStyledBidirectionalText!=null},getPluginURL:function(){return Rc}},fa=function(i,l){this.zoom=i,l?(this.now=l.now,this.fadeDuration=l.fadeDuration,this.zoomHistory=l.zoomHistory,this.transition=l.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ep,this.transition={})};fa.prototype.isSupportedScript=function(i){return function(l,_){for(var S=0,F=l;Sthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:l+(1-l)*_}:{fromScale:.5,toScale:1,t:1-(1-_)*l}};var Rs=function(i,l){this.property=i,this.value=l,this.expression=function(_,S){if(wc(_))return new Bh(_,S);if(bh(_)){var F=vf(_,S);if(F.result==="error")throw new Error(F.value.map(function(p){return p.key+": "+p.message}).join(", "));return F.value}var j=_;return typeof _=="string"&&S.type==="color"&&(j=Fo.parse(_)),{kind:"constant",evaluate:function(){return j}}}(l===void 0?i.specification.default:l,i.specification)};Rs.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},Rs.prototype.possiblyEvaluate=function(i,l,_){return this.property.possiblyEvaluate(this,i,l,_)};var hs=function(i){this.property=i,this.value=new Rs(i,void 0)};hs.prototype.transitioned=function(i,l){return new wu(this.property,this.value,l,er({},i.transition,this.transition),i.now)},hs.prototype.untransitioned=function(){return new wu(this.property,this.value,null,{},0)};var lu=function(i){this._properties=i,this._values=Object.create(i.defaultTransitionablePropertyValues)};lu.prototype.getValue=function(i){return jt(this._values[i].value.value)},lu.prototype.setValue=function(i,l){this._values.hasOwnProperty(i)||(this._values[i]=new hs(this._values[i].property)),this._values[i].value=new Rs(this._values[i].property,l===null?void 0:jt(l))},lu.prototype.getTransition=function(i){return jt(this._values[i].transition)},lu.prototype.setTransition=function(i,l){this._values.hasOwnProperty(i)||(this._values[i]=new hs(this._values[i].property)),this._values[i].transition=jt(l)||void 0},lu.prototype.serialize=function(){for(var i={},l=0,_=Object.keys(this._values);l<_.length;l+=1){var S=_[l],F=this.getValue(S);F!==void 0&&(i[S]=F);var j=this.getTransition(S);j!==void 0&&(i[S+"-transition"]=j)}return i},lu.prototype.transitioned=function(i,l){for(var _=new uh(this._properties),S=0,F=Object.keys(this._values);Sthis.end)return this.prior=null,F;if(this.value.isDataDriven())return this.prior=null,F;if(S=1)return 1;var m=v*v,w=m*v;return 4*(v<.5?w:3*(v-m)+w-.75)}(p))}return F};var uh=function(i){this._properties=i,this._values=Object.create(i.defaultTransitioningPropertyValues)};uh.prototype.possiblyEvaluate=function(i,l,_){for(var S=new Qp(this._properties),F=0,j=Object.keys(this._values);Fj.zoomHistory.lastIntegerZoom?{from:_,to:S}:{from:F,to:S}},l.prototype.interpolate=function(_){return _},l}(Si),ao=function(i){this.specification=i};ao.prototype.possiblyEvaluate=function(i,l,_,S){if(i.value!==void 0){if(i.expression.kind==="constant"){var F=i.expression.evaluate(l,null,{},_,S);return this._calculate(F,F,F,l)}return this._calculate(i.expression.evaluate(new fa(Math.floor(l.zoom-1),l)),i.expression.evaluate(new fa(Math.floor(l.zoom),l)),i.expression.evaluate(new fa(Math.floor(l.zoom+1),l)),l)}},ao.prototype._calculate=function(i,l,_,S){return S.zoom>S.zoomHistory.lastIntegerZoom?{from:i,to:l}:{from:_,to:l}},ao.prototype.interpolate=function(i){return i};var Ic=function(i){this.specification=i};Ic.prototype.possiblyEvaluate=function(i,l,_,S){return!!i.expression.evaluate(l,null,{},_,S)},Ic.prototype.interpolate=function(){return!1};var Gs=function(i){for(var l in this.properties=i,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],i){var _=i[l];_.specification.overridable&&this.overridableProperties.push(l);var S=this.defaultPropertyValues[l]=new Rs(_,void 0),F=this.defaultTransitionablePropertyValues[l]=new hs(_);this.defaultTransitioningPropertyValues[l]=F.untransitioned(),this.defaultPossiblyEvaluatedValues[l]=S.possiblyEvaluate({})}};fi("DataDrivenProperty",Si),fi("DataConstantProperty",Gi),fi("CrossFadedDataDrivenProperty",ji),fi("CrossFadedProperty",ao),fi("ColorRampProperty",Ic);var Lc=function(i){function l(_,S){if(i.call(this),this.id=_.id,this.type=_.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},_.type!=="custom"&&(this.metadata=(_=_).metadata,this.minzoom=_.minzoom,this.maxzoom=_.maxzoom,_.type!=="background"&&(this.source=_.source,this.sourceLayer=_["source-layer"],this.filter=_.filter),S.layout&&(this._unevaluatedLayout=new ch(S.layout)),S.paint)){for(var F in this._transitionablePaint=new lu(S.paint),_.paint)this.setPaintProperty(F,_.paint[F],{validate:!1});for(var j in _.layout)this.setLayoutProperty(j,_.layout[j],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Qp(S.paint)}}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},l.prototype.getLayoutProperty=function(_){return _==="visibility"?this.visibility:this._unevaluatedLayout.getValue(_)},l.prototype.setLayoutProperty=function(_,S,F){F===void 0&&(F={}),S!=null&&this._validate(Qh,"layers."+this.id+".layout."+_,_,S,F)||(_!=="visibility"?this._unevaluatedLayout.setValue(_,S):this.visibility=S)},l.prototype.getPaintProperty=function(_){return ki(_,"-transition")?this._transitionablePaint.getTransition(_.slice(0,-11)):this._transitionablePaint.getValue(_)},l.prototype.setPaintProperty=function(_,S,F){if(F===void 0&&(F={}),S!=null&&this._validate(ah,"layers."+this.id+".paint."+_,_,S,F))return!1;if(ki(_,"-transition"))return this._transitionablePaint.setTransition(_.slice(0,-11),S||void 0),!1;var j=this._transitionablePaint._values[_],p=j.property.specification["property-type"]==="cross-faded-data-driven",v=j.value.isDataDriven(),m=j.value;this._transitionablePaint.setValue(_,S),this._handleSpecialPaintPropertyUpdate(_);var w=this._transitionablePaint._values[_].value;return w.isDataDriven()||v||p||this._handleOverridablePaintPropertyUpdate(_,m,w)},l.prototype._handleSpecialPaintPropertyUpdate=function(_){},l.prototype._handleOverridablePaintPropertyUpdate=function(_,S,F){return!1},l.prototype.isHidden=function(_){return!!(this.minzoom&&_=this.maxzoom)||this.visibility==="none"},l.prototype.updateTransitions=function(_){this._transitioningPaint=this._transitionablePaint.transitioned(_,this._transitioningPaint)},l.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},l.prototype.recalculate=function(_,S){_.getCrossfadeParameters&&(this._crossfadeParameters=_.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(_,void 0,S)),this.paint=this._transitioningPaint.possiblyEvaluate(_,void 0,S)},l.prototype.serialize=function(){var _={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(_.layout=_.layout||{},_.layout.visibility=this.visibility),xr(_,function(S,F){return!(S===void 0||F==="layout"&&!Object.keys(S).length||F==="paint"&&!Object.keys(S).length)})},l.prototype._validate=function(_,S,F,j,p){return p===void 0&&(p={}),(!p||p.validate!==!1)&&sh(this,_.call(oh,{key:S,layerType:this.type,objectKey:F,value:j,styleSpec:Ae,style:{glyphs:!0,sprite:!0}}))},l.prototype.is3D=function(){return!1},l.prototype.isTileClipped=function(){return!1},l.prototype.hasOffscreenPass=function(){return!1},l.prototype.resize=function(){},l.prototype.isStateDependent=function(){for(var _ in this.paint._values){var S=this.paint.get(_);if(S instanceof Nu&&ec(S.property.specification)&&(S.value.kind==="source"||S.value.kind==="composite")&&S.value.isStateDependent)return!0}return!1},l}(Ue),ul={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Nh=function(i,l){this._structArray=i,this._pos1=l*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},xa=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Al(i,l){l===void 0&&(l=1);var _=0,S=0;return{members:i.map(function(F){var j=ul[F.type].BYTES_PER_ELEMENT,p=_=Lu(_,Math.max(l,j)),v=F.components||1;return S=Math.max(S,j),_+=j*v,{name:F.name,type:F.type,components:v,offset:p}}),size:Lu(_,Math.max(S,l)),alignment:l}}function Lu(i,l){return Math.ceil(i/l)*l}xa.serialize=function(i,l){return i._trim(),l&&(i.isTransferred=!0,l.push(i.arrayBuffer)),{length:i.length,arrayBuffer:i.arrayBuffer}},xa.deserialize=function(i){var l=Object.create(this.prototype);return l.arrayBuffer=i.arrayBuffer,l.length=i.length,l.capacity=i.arrayBuffer.byteLength/l.bytesPerElement,l._refreshViews(),l},xa.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},xa.prototype.clear=function(){this.length=0},xa.prototype.resize=function(i){this.reserve(i),this.length=i},xa.prototype.reserve=function(i){if(i>this.capacity){this.capacity=Math.max(i,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var l=this.uint8;this._refreshViews(),l&&this.uint8.set(l)}},xa.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var ks=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S){var F=this.length;return this.resize(F+1),this.emplace(F,_,S)},l.prototype.emplace=function(_,S,F){var j=2*_;return this.int16[j+0]=S,this.int16[j+1]=F,_},l}(xa);ks.prototype.bytesPerElement=4,fi("StructArrayLayout2i4",ks);var _l=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j){var p=this.length;return this.resize(p+1),this.emplace(p,_,S,F,j)},l.prototype.emplace=function(_,S,F,j,p){var v=4*_;return this.int16[v+0]=S,this.int16[v+1]=F,this.int16[v+2]=j,this.int16[v+3]=p,_},l}(xa);_l.prototype.bytesPerElement=8,fi("StructArrayLayout4i8",_l);var pc=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p,v){var m=this.length;return this.resize(m+1),this.emplace(m,_,S,F,j,p,v)},l.prototype.emplace=function(_,S,F,j,p,v,m){var w=6*_;return this.int16[w+0]=S,this.int16[w+1]=F,this.int16[w+2]=j,this.int16[w+3]=p,this.int16[w+4]=v,this.int16[w+5]=m,_},l}(xa);pc.prototype.bytesPerElement=12,fi("StructArrayLayout2i4i12",pc);var Du=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p,v){var m=this.length;return this.resize(m+1),this.emplace(m,_,S,F,j,p,v)},l.prototype.emplace=function(_,S,F,j,p,v,m){var w=4*_,D=8*_;return this.int16[w+0]=S,this.int16[w+1]=F,this.uint8[D+4]=j,this.uint8[D+5]=p,this.uint8[D+6]=v,this.uint8[D+7]=m,_},l}(xa);Du.prototype.bytesPerElement=8,fi("StructArrayLayout2i4ub8",Du);var zh=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S){var F=this.length;return this.resize(F+1),this.emplace(F,_,S)},l.prototype.emplace=function(_,S,F){var j=2*_;return this.float32[j+0]=S,this.float32[j+1]=F,_},l}(xa);zh.prototype.bytesPerElement=8,fi("StructArrayLayout2f8",zh);var Su=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p,v,m,w,D,N){var W=this.length;return this.resize(W+1),this.emplace(W,_,S,F,j,p,v,m,w,D,N)},l.prototype.emplace=function(_,S,F,j,p,v,m,w,D,N,W){var $=10*_;return this.uint16[$+0]=S,this.uint16[$+1]=F,this.uint16[$+2]=j,this.uint16[$+3]=p,this.uint16[$+4]=v,this.uint16[$+5]=m,this.uint16[$+6]=w,this.uint16[$+7]=D,this.uint16[$+8]=N,this.uint16[$+9]=W,_},l}(xa);Su.prototype.bytesPerElement=20,fi("StructArrayLayout10ui20",Su);var qc=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p,v,m,w,D,N,W,$){var ie=this.length;return this.resize(ie+1),this.emplace(ie,_,S,F,j,p,v,m,w,D,N,W,$)},l.prototype.emplace=function(_,S,F,j,p,v,m,w,D,N,W,$,ie){var pe=12*_;return this.int16[pe+0]=S,this.int16[pe+1]=F,this.int16[pe+2]=j,this.int16[pe+3]=p,this.uint16[pe+4]=v,this.uint16[pe+5]=m,this.uint16[pe+6]=w,this.uint16[pe+7]=D,this.int16[pe+8]=N,this.int16[pe+9]=W,this.int16[pe+10]=$,this.int16[pe+11]=ie,_},l}(xa);qc.prototype.bytesPerElement=24,fi("StructArrayLayout4i4ui4i24",qc);var Sh=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F){var j=this.length;return this.resize(j+1),this.emplace(j,_,S,F)},l.prototype.emplace=function(_,S,F,j){var p=3*_;return this.float32[p+0]=S,this.float32[p+1]=F,this.float32[p+2]=j,_},l}(xa);Sh.prototype.bytesPerElement=12,fi("StructArrayLayout3f12",Sh);var nc=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_){var S=this.length;return this.resize(S+1),this.emplace(S,_)},l.prototype.emplace=function(_,S){return this.uint32[1*_+0]=S,_},l}(xa);nc.prototype.bytesPerElement=4,fi("StructArrayLayout1ul4",nc);var Yl=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p,v,m,w,D){var N=this.length;return this.resize(N+1),this.emplace(N,_,S,F,j,p,v,m,w,D)},l.prototype.emplace=function(_,S,F,j,p,v,m,w,D,N){var W=10*_,$=5*_;return this.int16[W+0]=S,this.int16[W+1]=F,this.int16[W+2]=j,this.int16[W+3]=p,this.int16[W+4]=v,this.int16[W+5]=m,this.uint32[$+3]=w,this.uint16[W+8]=D,this.uint16[W+9]=N,_},l}(xa);Yl.prototype.bytesPerElement=20,fi("StructArrayLayout6i1ul2ui20",Yl);var Th=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p,v){var m=this.length;return this.resize(m+1),this.emplace(m,_,S,F,j,p,v)},l.prototype.emplace=function(_,S,F,j,p,v,m){var w=6*_;return this.int16[w+0]=S,this.int16[w+1]=F,this.int16[w+2]=j,this.int16[w+3]=p,this.int16[w+4]=v,this.int16[w+5]=m,_},l}(xa);Th.prototype.bytesPerElement=12,fi("StructArrayLayout2i2i2i12",Th);var ba=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p){var v=this.length;return this.resize(v+1),this.emplace(v,_,S,F,j,p)},l.prototype.emplace=function(_,S,F,j,p,v){var m=4*_,w=8*_;return this.float32[m+0]=S,this.float32[m+1]=F,this.float32[m+2]=j,this.int16[w+6]=p,this.int16[w+7]=v,_},l}(xa);ba.prototype.bytesPerElement=16,fi("StructArrayLayout2f1f2i16",ba);var z=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j){var p=this.length;return this.resize(p+1),this.emplace(p,_,S,F,j)},l.prototype.emplace=function(_,S,F,j,p){var v=12*_,m=3*_;return this.uint8[v+0]=S,this.uint8[v+1]=F,this.float32[m+1]=j,this.float32[m+2]=p,_},l}(xa);z.prototype.bytesPerElement=12,fi("StructArrayLayout2ub2f12",z);var s=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F){var j=this.length;return this.resize(j+1),this.emplace(j,_,S,F)},l.prototype.emplace=function(_,S,F,j){var p=3*_;return this.uint16[p+0]=S,this.uint16[p+1]=F,this.uint16[p+2]=j,_},l}(xa);s.prototype.bytesPerElement=6,fi("StructArrayLayout3ui6",s);var x=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p,v,m,w,D,N,W,$,ie,pe,we,ke,Ge){var ht=this.length;return this.resize(ht+1),this.emplace(ht,_,S,F,j,p,v,m,w,D,N,W,$,ie,pe,we,ke,Ge)},l.prototype.emplace=function(_,S,F,j,p,v,m,w,D,N,W,$,ie,pe,we,ke,Ge,ht){var mt=24*_,St=12*_,xt=48*_;return this.int16[mt+0]=S,this.int16[mt+1]=F,this.uint16[mt+2]=j,this.uint16[mt+3]=p,this.uint32[St+2]=v,this.uint32[St+3]=m,this.uint32[St+4]=w,this.uint16[mt+10]=D,this.uint16[mt+11]=N,this.uint16[mt+12]=W,this.float32[St+7]=$,this.float32[St+8]=ie,this.uint8[xt+36]=pe,this.uint8[xt+37]=we,this.uint8[xt+38]=ke,this.uint32[St+10]=Ge,this.int16[mt+22]=ht,_},l}(xa);x.prototype.bytesPerElement=48,fi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",x);var I=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j,p,v,m,w,D,N,W,$,ie,pe,we,ke,Ge,ht,mt,St,xt,bt,kt,ft,nr,br,Pr,Mn){var yn=this.length;return this.resize(yn+1),this.emplace(yn,_,S,F,j,p,v,m,w,D,N,W,$,ie,pe,we,ke,Ge,ht,mt,St,xt,bt,kt,ft,nr,br,Pr,Mn)},l.prototype.emplace=function(_,S,F,j,p,v,m,w,D,N,W,$,ie,pe,we,ke,Ge,ht,mt,St,xt,bt,kt,ft,nr,br,Pr,Mn,yn){var kr=34*_,Ai=17*_;return this.int16[kr+0]=S,this.int16[kr+1]=F,this.int16[kr+2]=j,this.int16[kr+3]=p,this.int16[kr+4]=v,this.int16[kr+5]=m,this.int16[kr+6]=w,this.int16[kr+7]=D,this.uint16[kr+8]=N,this.uint16[kr+9]=W,this.uint16[kr+10]=$,this.uint16[kr+11]=ie,this.uint16[kr+12]=pe,this.uint16[kr+13]=we,this.uint16[kr+14]=ke,this.uint16[kr+15]=Ge,this.uint16[kr+16]=ht,this.uint16[kr+17]=mt,this.uint16[kr+18]=St,this.uint16[kr+19]=xt,this.uint16[kr+20]=bt,this.uint16[kr+21]=kt,this.uint16[kr+22]=ft,this.uint32[Ai+12]=nr,this.float32[Ai+13]=br,this.float32[Ai+14]=Pr,this.float32[Ai+15]=Mn,this.float32[Ai+16]=yn,_},l}(xa);I.prototype.bytesPerElement=68,fi("StructArrayLayout8i15ui1ul4f68",I);var k=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_){var S=this.length;return this.resize(S+1),this.emplace(S,_)},l.prototype.emplace=function(_,S){return this.float32[1*_+0]=S,_},l}(xa);k.prototype.bytesPerElement=4,fi("StructArrayLayout1f4",k);var H=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F){var j=this.length;return this.resize(j+1),this.emplace(j,_,S,F)},l.prototype.emplace=function(_,S,F,j){var p=3*_;return this.int16[p+0]=S,this.int16[p+1]=F,this.int16[p+2]=j,_},l}(xa);H.prototype.bytesPerElement=6,fi("StructArrayLayout3i6",H);var ee=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F){var j=this.length;return this.resize(j+1),this.emplace(j,_,S,F)},l.prototype.emplace=function(_,S,F,j){var p=4*_;return this.uint32[2*_+0]=S,this.uint16[p+2]=F,this.uint16[p+3]=j,_},l}(xa);ee.prototype.bytesPerElement=8,fi("StructArrayLayout1ul2ui8",ee);var ne=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S){var F=this.length;return this.resize(F+1),this.emplace(F,_,S)},l.prototype.emplace=function(_,S,F){var j=2*_;return this.uint16[j+0]=S,this.uint16[j+1]=F,_},l}(xa);ne.prototype.bytesPerElement=4,fi("StructArrayLayout2ui4",ne);var ue=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_){var S=this.length;return this.resize(S+1),this.emplace(S,_)},l.prototype.emplace=function(_,S){return this.uint16[1*_+0]=S,_},l}(xa);ue.prototype.bytesPerElement=2,fi("StructArrayLayout1ui2",ue);var _e=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},l.prototype.emplaceBack=function(_,S,F,j){var p=this.length;return this.resize(p+1),this.emplace(p,_,S,F,j)},l.prototype.emplace=function(_,S,F,j,p){var v=4*_;return this.float32[v+0]=S,this.float32[v+1]=F,this.float32[v+2]=j,this.float32[v+3]=p,_},l}(xa);_e.prototype.bytesPerElement=16,fi("StructArrayLayout4f16",_e);var h=function(i){function l(){i.apply(this,arguments)}i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l;var _={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return _.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},_.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},_.x1.get=function(){return this._structArray.int16[this._pos2+2]},_.y1.get=function(){return this._structArray.int16[this._pos2+3]},_.x2.get=function(){return this._structArray.int16[this._pos2+4]},_.y2.get=function(){return this._structArray.int16[this._pos2+5]},_.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},_.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},_.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},_.anchorPoint.get=function(){return new Le(this.anchorPointX,this.anchorPointY)},Object.defineProperties(l.prototype,_),l}(Nh);h.prototype.size=20;var g=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.get=function(_){return new h(this,_)},l}(Yl);fi("CollisionBoxArray",g);var d=function(i){function l(){i.apply(this,arguments)}i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l;var _={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return _.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},_.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},_.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},_.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},_.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},_.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},_.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},_.segment.get=function(){return this._structArray.uint16[this._pos2+10]},_.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},_.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},_.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},_.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},_.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},_.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},_.placedOrientation.set=function(S){this._structArray.uint8[this._pos1+37]=S},_.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},_.hidden.set=function(S){this._structArray.uint8[this._pos1+38]=S},_.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},_.crossTileID.set=function(S){this._structArray.uint32[this._pos4+10]=S},_.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(l.prototype,_),l}(Nh);d.prototype.size=48;var b=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.get=function(_){return new d(this,_)},l}(x);fi("PlacedSymbolArray",b);var B=function(i){function l(){i.apply(this,arguments)}i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l;var _={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return _.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},_.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},_.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},_.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},_.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},_.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},_.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},_.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},_.key.get=function(){return this._structArray.uint16[this._pos2+8]},_.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},_.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},_.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},_.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},_.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},_.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},_.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},_.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},_.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},_.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},_.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},_.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},_.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},_.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},_.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},_.crossTileID.set=function(S){this._structArray.uint32[this._pos4+12]=S},_.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},_.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},_.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},_.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(l.prototype,_),l}(Nh);B.prototype.size=68;var G=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.get=function(_){return new B(this,_)},l}(I);fi("SymbolInstanceArray",G);var q=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.getoffsetX=function(_){return this.float32[1*_+0]},l}(k);fi("GlyphOffsetArray",q);var te=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.getx=function(_){return this.int16[3*_+0]},l.prototype.gety=function(_){return this.int16[3*_+1]},l.prototype.gettileUnitDistanceFromAnchor=function(_){return this.int16[3*_+2]},l}(H);fi("SymbolLineVertexArray",te);var fe=function(i){function l(){i.apply(this,arguments)}i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l;var _={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return _.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},_.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},_.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(l.prototype,_),l}(Nh);fe.prototype.size=8;var ce=function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.get=function(_){return new fe(this,_)},l}(ee);fi("FeatureIndexArray",ce);var Te=Al([{name:"a_pos",components:2,type:"Int16"}],4).members,Ie=function(i){i===void 0&&(i=[]),this.segments=i};function Oe(i,l){return 256*(i=Ve(Math.floor(i),0,255))+Ve(Math.floor(l),0,255)}Ie.prototype.prepareSegment=function(i,l,_,S){var F=this.segments[this.segments.length-1];return i>Ie.MAX_VERTEX_ARRAY_LENGTH&&gr("Max vertices per segment is "+Ie.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+i),(!F||F.vertexLength+i>Ie.MAX_VERTEX_ARRAY_LENGTH||F.sortKey!==S)&&(F={vertexOffset:l.length,primitiveOffset:_.length,vertexLength:0,primitiveLength:0},S!==void 0&&(F.sortKey=S),this.segments.push(F)),F},Ie.prototype.get=function(){return this.segments},Ie.prototype.destroy=function(){for(var i=0,l=this.segments;i>>16)*v&65535)<<16)&4294967295)<<15|w>>>17))*m+(((w>>>16)*m&65535)<<16)&4294967295)<<13|j>>>19))+((5*(j>>>16)&65535)<<16)&4294967295))+((58964+(p>>>16)&65535)<<16);switch(w=0,S){case 3:w^=(255&l.charCodeAt(D+2))<<16;case 2:w^=(255&l.charCodeAt(D+1))<<8;case 1:j^=w=(65535&(w=(w=(65535&(w^=255&l.charCodeAt(D)))*v+(((w>>>16)*v&65535)<<16)&4294967295)<<15|w>>>17))*m+(((w>>>16)*m&65535)<<16)&4294967295}return j^=l.length,j=2246822507*(65535&(j^=j>>>16))+((2246822507*(j>>>16)&65535)<<16)&4294967295,j=3266489909*(65535&(j^=j>>>13))+((3266489909*(j>>>16)&65535)<<16)&4294967295,(j^=j>>>16)>>>0}}),ct=R(function(i){i.exports=function(l,_){for(var S,F=l.length,j=_^F,p=0;F>=4;)S=1540483477*(65535&(S=255&l.charCodeAt(p)|(255&l.charCodeAt(++p))<<8|(255&l.charCodeAt(++p))<<16|(255&l.charCodeAt(++p))<<24))+((1540483477*(S>>>16)&65535)<<16),j=1540483477*(65535&j)+((1540483477*(j>>>16)&65535)<<16)^(S=1540483477*(65535&(S^=S>>>24))+((1540483477*(S>>>16)&65535)<<16)),F-=4,++p;switch(F){case 3:j^=(255&l.charCodeAt(p+2))<<16;case 2:j^=(255&l.charCodeAt(p+1))<<8;case 1:j=1540483477*(65535&(j^=255&l.charCodeAt(p)))+((1540483477*(j>>>16)&65535)<<16)}return j=1540483477*(65535&(j^=j>>>13))+((1540483477*(j>>>16)&65535)<<16),(j^=j>>>15)>>>0}}),tt=nt,Tt=ct;tt.murmur3=nt,tt.murmur2=Tt;var Ut=function(){this.ids=[],this.positions=[],this.indexed=!1};Ut.prototype.add=function(i,l,_,S){this.ids.push(pr(i)),this.positions.push(l,_,S)},Ut.prototype.getPositions=function(i){for(var l=pr(i),_=0,S=this.ids.length-1;_>1;this.ids[F]>=l?S=F:_=F+1}for(var j=[];this.ids[_]===l;)j.push({index:this.positions[3*_],start:this.positions[3*_+1],end:this.positions[3*_+2]}),_++;return j},Ut.serialize=function(i,l){var _=new Float64Array(i.ids),S=new Uint32Array(i.positions);return function F(j,p,v,m){for(;v>1],D=v-1,N=m+1;;){do D++;while(j[D]w);if(D>=N)break;tr(j,D,N),tr(p,3*D,3*N),tr(p,3*D+1,3*N+1),tr(p,3*D+2,3*N+2)}N-vp.x+1||mp.y+1)&&gr("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return _}function $a(i,l){return{type:i.type,id:i.id,properties:i.properties,geometry:l?ja(i):[]}}function vs(i,l,_,S,F){i.emplaceBack(2*l+(S+1)/2,2*_+(F+1)/2)}var Zl=function(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(function(l){return l.id}),this.index=i.index,this.hasPattern=!1,this.layoutVertexArray=new ks,this.indexArray=new s,this.segments=new Ie,this.programConfigurations=new qi(i.layers,i.zoom),this.stateDependentLayerIds=this.layers.filter(function(l){return l.isStateDependent()}).map(function(l){return l.id})};function zu(i,l){for(var _=0;_1){if(np(i,l))return!0;for(var S=0;S1?_:_.sub(l)._mult(F)._add(l))}function Dl(i,l){for(var _,S,F,j=!1,p=0;pl.y!=(F=_[m]).y>l.y&&l.x<(F.x-S.x)*(l.y-S.y)/(F.y-S.y)+S.x&&(j=!j);return j}function Vl(i,l){for(var _=!1,S=0,F=i.length-1;Sl.y!=p.y>l.y&&l.x<(p.x-j.x)*(l.y-j.y)/(p.y-j.y)+j.x&&(_=!_)}return _}function Uh(i,l,_){var S=_[0],F=_[2];if(i.xF.x&&l.x>F.x||i.yF.y&&l.y>F.y)return!1;var j=rn(i,l,_[0]);return j!==rn(i,l,_[1])||j!==rn(i,l,_[2])||j!==rn(i,l,_[3])}function ml(i,l,_){var S=l.paint.get(i).value;return S.kind==="constant"?S.value:_.programConfigurations.get(l.id).getMaxValue(i)}function $l(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function Vu(i,l,_,S,F){if(!l[0]&&!l[1])return i;var j=Le.convert(l)._mult(F);_==="viewport"&&j._rotate(-S);for(var p=[],v=0;v=8192||D<0||D>=8192)){var N=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,i.sortKey),W=N.vertexLength;vs(this.layoutVertexArray,w,D,-1,-1),vs(this.layoutVertexArray,w,D,1,-1),vs(this.layoutVertexArray,w,D,1,1),vs(this.layoutVertexArray,w,D,-1,1),this.indexArray.emplaceBack(W,W+1,W+2),this.indexArray.emplaceBack(W,W+3,W+2),N.vertexLength+=4,N.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,_,{},S)},fi("CircleBucket",Zl,{omit:["layers"]});var Ws=new Gs({"circle-sort-key":new Si(Ae.layout_circle["circle-sort-key"])}),ju={paint:new Gs({"circle-radius":new Si(Ae.paint_circle["circle-radius"]),"circle-color":new Si(Ae.paint_circle["circle-color"]),"circle-blur":new Si(Ae.paint_circle["circle-blur"]),"circle-opacity":new Si(Ae.paint_circle["circle-opacity"]),"circle-translate":new Gi(Ae.paint_circle["circle-translate"]),"circle-translate-anchor":new Gi(Ae.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Gi(Ae.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Gi(Ae.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Si(Ae.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Si(Ae.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Si(Ae.paint_circle["circle-stroke-opacity"])}),layout:Ws},os=typeof Float32Array!="undefined"?Float32Array:Array;function yl(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function Ol(i,l,_){var S=l[0],F=l[1],j=l[2],p=l[3],v=l[4],m=l[5],w=l[6],D=l[7],N=l[8],W=l[9],$=l[10],ie=l[11],pe=l[12],we=l[13],ke=l[14],Ge=l[15],ht=_[0],mt=_[1],St=_[2],xt=_[3];return i[0]=ht*S+mt*v+St*N+xt*pe,i[1]=ht*F+mt*m+St*W+xt*we,i[2]=ht*j+mt*w+St*$+xt*ke,i[3]=ht*p+mt*D+St*ie+xt*Ge,i[4]=(ht=_[4])*S+(mt=_[5])*v+(St=_[6])*N+(xt=_[7])*pe,i[5]=ht*F+mt*m+St*W+xt*we,i[6]=ht*j+mt*w+St*$+xt*ke,i[7]=ht*p+mt*D+St*ie+xt*Ge,i[8]=(ht=_[8])*S+(mt=_[9])*v+(St=_[10])*N+(xt=_[11])*pe,i[9]=ht*F+mt*m+St*W+xt*we,i[10]=ht*j+mt*w+St*$+xt*ke,i[11]=ht*p+mt*D+St*ie+xt*Ge,i[12]=(ht=_[12])*S+(mt=_[13])*v+(St=_[14])*N+(xt=_[15])*pe,i[13]=ht*F+mt*m+St*W+xt*we,i[14]=ht*j+mt*w+St*$+xt*ke,i[15]=ht*p+mt*D+St*ie+xt*Ge,i}Math.hypot||(Math.hypot=function(){for(var i=arguments,l=0,_=arguments.length;_--;)l+=i[_]*i[_];return Math.sqrt(l)});var ph,_f=Ol;function ip(i,l,_){var S=l[0],F=l[1],j=l[2],p=l[3];return i[0]=_[0]*S+_[4]*F+_[8]*j+_[12]*p,i[1]=_[1]*S+_[5]*F+_[9]*j+_[13]*p,i[2]=_[2]*S+_[6]*F+_[10]*j+_[14]*p,i[3]=_[3]*S+_[7]*F+_[11]*j+_[15]*p,i}ph=new os(3),os!=Float32Array&&(ph[0]=0,ph[1]=0,ph[2]=0),function(){var i=new os(4);os!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0,i[3]=0)}();var yf=(function(){var i=new os(2);os!=Float32Array&&(i[0]=0,i[1]=0)}(),function(i){function l(_){i.call(this,_,ju)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.createBucket=function(_){return new Zl(_)},l.prototype.queryRadius=function(_){var S=_;return ml("circle-radius",this,S)+ml("circle-stroke-width",this,S)+$l(this.paint.get("circle-translate"))},l.prototype.queryIntersectsFeature=function(_,S,F,j,p,v,m,w){for(var D=Vu(_,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),v.angle,m),N=this.paint.get("circle-radius").evaluate(S,F)+this.paint.get("circle-stroke-width").evaluate(S,F),W=this.paint.get("circle-pitch-alignment")==="map",$=W?D:function(bt,kt){return bt.map(function(ft){return Hu(ft,kt)})}(D,w),ie=W?N*m:N,pe=0,we=j;pei.width||F.height>i.height||_.x>i.width-F.width||_.y>i.height-F.height)throw new RangeError("out of range source coordinates for image copy");if(F.width>l.width||F.height>l.height||S.x>l.width-F.width||S.y>l.height-F.height)throw new RangeError("out of range destination coordinates for image copy");for(var p=i.data,v=l.data,m=0;m80*_){S=j=i[0],F=p=i[1];for(var ie=_;iej&&(j=v),m>p&&(p=m);w=(w=Math.max(j-S,p-F))!==0?1/w:0}return ud(W,$,_,S,F,w),$}function xf(i,l,_,S,F){var j,p;if(F===kp(i,l,_,S)>0)for(j=l;j<_;j+=S)p=zf(j,i[j],i[j+1],p);else for(j=_-S;j>=l;j-=S)p=zf(j,i[j],i[j+1],p);return p&&dc(p,p.next)&&(of(p),p=p.next),p}function tf(i,l){if(!i)return i;l||(l=i);var _,S=i;do if(_=!1,S.steiner||!dc(S,S.next)&&xl(S.prev,S,S.next)!==0)S=S.next;else{if(of(S),(S=l=S.prev)===S.next)break;_=!0}while(_||S!==l);return l}function ud(i,l,_,S,F,j,p){if(i){!p&&j&&function(D,N,W,$){var ie=D;do ie.z===null&&(ie.z=wp(ie.x,ie.y,N,W,$)),ie.prevZ=ie.prev,ie.nextZ=ie.next,ie=ie.next;while(ie!==D);ie.prevZ.nextZ=null,ie.prevZ=null,function(pe){var we,ke,Ge,ht,mt,St,xt,bt,kt=1;do{for(ke=pe,pe=null,mt=null,St=0;ke;){for(St++,Ge=ke,xt=0,we=0;we0||bt>0&&Ge;)xt!==0&&(bt===0||!Ge||ke.z<=Ge.z)?(ht=ke,ke=ke.nextZ,xt--):(ht=Ge,Ge=Ge.nextZ,bt--),mt?mt.nextZ=ht:pe=ht,ht.prevZ=mt,mt=ht;ke=Ge}mt.nextZ=null,kt*=2}while(St>1)}(ie)}(i,S,F,j);for(var v,m,w=i;i.prev!==i.next;)if(v=i.prev,m=i.next,j?Dd(i,S,F,j):qf(i))l.push(v.i/_),l.push(i.i/_),l.push(m.i/_),of(i),i=m.next,w=m.next;else if((i=m)===w){p?p===1?ud(i=Yf(tf(i),l,_),l,_,S,F,j,2):p===2&&Kl(i,l,_,S,F,j):ud(tf(i),l,_,S,F,j,1);break}}}function qf(i){var l=i.prev,_=i,S=i.next;if(xl(l,_,S)>=0)return!1;for(var F=i.next.next;F!==i.prev;){if(ap(l.x,l.y,_.x,_.y,S.x,S.y,F.x,F.y)&&xl(F.prev,F,F.next)>=0)return!1;F=F.next}return!0}function Dd(i,l,_,S){var F=i.prev,j=i,p=i.next;if(xl(F,j,p)>=0)return!1;for(var v=F.x>j.x?F.x>p.x?F.x:p.x:j.x>p.x?j.x:p.x,m=F.y>j.y?F.y>p.y?F.y:p.y:j.y>p.y?j.y:p.y,w=wp(F.x=w&&W&&W.z<=D;){if(N!==i.prev&&N!==i.next&&ap(F.x,F.y,j.x,j.y,p.x,p.y,N.x,N.y)&&xl(N.prev,N,N.next)>=0||(N=N.prevZ,W!==i.prev&&W!==i.next&&ap(F.x,F.y,j.x,j.y,p.x,p.y,W.x,W.y)&&xl(W.prev,W,W.next)>=0))return!1;W=W.nextZ}for(;N&&N.z>=w;){if(N!==i.prev&&N!==i.next&&ap(F.x,F.y,j.x,j.y,p.x,p.y,N.x,N.y)&&xl(N.prev,N,N.next)>=0)return!1;N=N.prevZ}for(;W&&W.z<=D;){if(W!==i.prev&&W!==i.next&&ap(F.x,F.y,j.x,j.y,p.x,p.y,W.x,W.y)&&xl(W.prev,W,W.next)>=0)return!1;W=W.nextZ}return!0}function Yf(i,l,_){var S=i;do{var F=S.prev,j=S.next.next;!dc(F,j)&&Fp(F,S,S.next,j)&&nf(F,j)&&nf(j,F)&&(l.push(F.i/_),l.push(S.i/_),l.push(j.i/_),of(S),of(S.next),S=i=j),S=S.next}while(S!==i);return tf(S)}function Kl(i,l,_,S,F,j){var p=i;do{for(var v=p.next.next;v!==p.prev;){if(p.i!==v.i&&kf(p,v)){var m=Nf(p,v);return p=tf(p,p.next),m=tf(m,m.next),ud(p,l,_,S,F,j),void ud(m,l,_,S,F,j)}v=v.next}p=p.next}while(p!==i)}function Od(i,l){return i.x-l.x}function Bd(i,l){if(l=function(S,F){var j,p=F,v=S.x,m=S.y,w=-1/0;do{if(m<=p.y&&m>=p.next.y&&p.next.y!==p.y){var D=p.x+(m-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(D<=v&&D>w){if(w=D,D===v){if(m===p.y)return p;if(m===p.next.y)return p.next}j=p.x=p.x&&p.x>=$&&v!==p.x&&ap(mj.x||p.x===j.x&&bf(j,p)))&&(j=p,pe=N)),p=p.next;while(p!==W);return j}(i,l)){var _=Nf(l,i);tf(l,l.next),tf(_,_.next)}}function bf(i,l){return xl(i.prev,i,l.prev)<0&&xl(l.next,i,i.next)<0}function wp(i,l,_,S,F){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=32767*(i-_)*F)|i<<8))|i<<4))|i<<2))|i<<1))|(l=1431655765&((l=858993459&((l=252645135&((l=16711935&((l=32767*(l-S)*F)|l<<8))|l<<4))|l<<2))|l<<1))<<1}function $f(i){var l=i,_=i;do(l.x<_.x||l.x===_.x&&l.y<_.y)&&(_=l),l=l.next;while(l!==i);return _}function ap(i,l,_,S,F,j,p,v){return(F-p)*(l-v)-(i-p)*(j-v)>=0&&(i-p)*(S-v)-(_-p)*(l-v)>=0&&(_-p)*(j-v)-(F-p)*(S-v)>=0}function kf(i,l){return i.next.i!==l.i&&i.prev.i!==l.i&&!function(_,S){var F=_;do{if(F.i!==_.i&&F.next.i!==_.i&&F.i!==S.i&&F.next.i!==S.i&&Fp(F,F.next,_,S))return!0;F=F.next}while(F!==_);return!1}(i,l)&&(nf(i,l)&&nf(l,i)&&function(_,S){var F=_,j=!1,p=(_.x+S.x)/2,v=(_.y+S.y)/2;do F.y>v!=F.next.y>v&&F.next.y!==F.y&&p<(F.next.x-F.x)*(v-F.y)/(F.next.y-F.y)+F.x&&(j=!j),F=F.next;while(F!==_);return j}(i,l)&&(xl(i.prev,i,l.prev)||xl(i,l.prev,l))||dc(i,l)&&xl(i.prev,i,i.next)>0&&xl(l.prev,l,l.next)>0)}function xl(i,l,_){return(l.y-i.y)*(_.x-l.x)-(l.x-i.x)*(_.y-l.y)}function dc(i,l){return i.x===l.x&&i.y===l.y}function Fp(i,l,_,S){var F=rf(xl(i,l,_)),j=rf(xl(i,l,S)),p=rf(xl(_,S,i)),v=rf(xl(_,S,l));return F!==j&&p!==v||!(F!==0||!Sp(i,_,l))||!(j!==0||!Sp(i,S,l))||!(p!==0||!Sp(_,i,S))||!(v!==0||!Sp(_,l,S))}function Sp(i,l,_){return l.x<=Math.max(i.x,_.x)&&l.x>=Math.min(i.x,_.x)&&l.y<=Math.max(i.y,_.y)&&l.y>=Math.min(i.y,_.y)}function rf(i){return i>0?1:i<0?-1:0}function nf(i,l){return xl(i.prev,i,i.next)<0?xl(i,l,i.next)>=0&&xl(i,i.prev,l)>=0:xl(i,l,i.prev)<0||xl(i,i.next,l)<0}function Nf(i,l){var _=new af(i.i,i.x,i.y),S=new af(l.i,l.x,l.y),F=i.next,j=l.prev;return i.next=l,l.prev=i,_.next=F,F.prev=_,S.next=_,_.prev=S,j.next=S,S.prev=j,S}function zf(i,l,_,S){var F=new af(i,l,_);return S?(F.next=S.next,F.prev=S,S.next.prev=F,S.next=F):(F.prev=F,F.next=F),F}function of(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function af(i,l,_){this.i=i,this.x=l,this.y=_,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function kp(i,l,_,S){for(var F=0,j=l,p=_-S;j<_;j+=S)F+=(i[p]-i[j])*(i[j+1]+i[p+1]),p=j;return F}function yd(i,l,_,S,F){(function j(p,v,m,w,D){for(;w>m;){if(w-m>600){var N=w-m+1,W=v-m+1,$=Math.log(N),ie=.5*Math.exp(2*$/3),pe=.5*Math.sqrt($*ie*(N-ie)/N)*(W-N/2<0?-1:1);j(p,v,Math.max(m,Math.floor(v-W*ie/N+pe)),Math.min(w,Math.floor(v+(N-W)*ie/N+pe)),D)}var we=p[v],ke=m,Ge=w;for(Dc(p,m,v),D(p[w],we)>0&&Dc(p,m,w);ke0;)Ge--}D(p[m],we)===0?Dc(p,m,Ge):Dc(p,++Ge,w),Ge<=v&&(m=Ge+1),v<=Ge&&(w=Ge-1)}})(i,l,_||0,S||i.length-1,F||_p)}function Dc(i,l,_){var S=i[l];i[l]=i[_],i[_]=S}function _p(i,l){return il?1:0}function Kf(i,l){var _=i.length;if(_<=1)return[i];for(var S,F,j=[],p=0;p<_;p++){var v=jn(i[p]);v!==0&&(i[p].area=Math.abs(v),F===void 0&&(F=v<0),F===v<0?(S&&j.push(S),S=[i[p]]):S.push(i[p]))}if(S&&j.push(S),l>1)for(var m=0;m0&&_.holes.push(S+=i[F-1].length)}return _},Xf.default=tm;var Tp=function(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(function(l){return l.id}),this.index=i.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ks,this.indexArray=new s,this.indexArray2=new ne,this.programConfigurations=new qi(i.layers,i.zoom),this.segments=new Ie,this.segments2=new Ie,this.stateDependentLayerIds=this.layers.filter(function(l){return l.isStateDependent()}).map(function(l){return l.id})};Tp.prototype.populate=function(i,l,_){this.hasPattern=bd("fill",this.layers,l);for(var S=this.layers[0].layout.get("fill-sort-key"),F=[],j=0,p=i;j>3}if(F--,S===1||S===2)j+=i.readSVarint(),p+=i.readSVarint(),S===1&&(l&&v.push(l),l=[]),l.push(new Le(j,p));else{if(S!==7)throw new Error("unknown command "+S);l&&l.push(l[0].clone())}}return l&&v.push(l),v},sf.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var l=i.readVarint()+i.pos,_=1,S=0,F=0,j=0,p=1/0,v=-1/0,m=1/0,w=-1/0;i.pos>3}if(S--,_===1||_===2)(F+=i.readSVarint())v&&(v=F),(j+=i.readSVarint())w&&(w=j);else if(_!==7)throw new Error("unknown command "+_)}return[p,m,v,w]},sf.prototype.toGeoJSON=function(i,l,_){var S,F,j=this.extent*Math.pow(2,_),p=this.extent*i,v=this.extent*l,m=this.loadGeometry(),w=sf.types[this.type];function D($){for(var ie=0;ie<$.length;ie++){var pe=$[ie];$[ie]=[360*(pe.x+p)/j-180,360/Math.PI*Math.atan(Math.exp((180-360*(pe.y+v)/j)*Math.PI/180))-90]}}switch(this.type){case 1:var N=[];for(S=0;S>3;F=p===1?S.readString():p===2?S.readFloat():p===3?S.readDouble():p===4?S.readVarint64():p===5?S.readVarint():p===6?S.readSVarint():p===7?S.readBoolean():null}return F}(_))}function pd(i,l,_){if(i===3){var S=new lf(_,_.readVarint()+_.pos);S.length&&(l[S.name]=S)}}Ah.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var l=this._pbf.readVarint()+this._pbf.pos;return new Uf(this._pbf,l,this.extent,this._keys,this._values)};var yp={VectorTile:function(i,l){this.layers=i.readFields(pd,{},l)},VectorTileFeature:Uf,VectorTileLayer:lf},Zf=yp.VectorTileFeature.types,zp=Math.pow(2,13);function Oc(i,l,_,S,F,j,p,v){i.emplaceBack(l,_,2*Math.floor(S*zp)+p,F*zp*2,j*zp*2,Math.round(v))}var Wu=function(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(function(l){return l.id}),this.index=i.index,this.hasPattern=!1,this.layoutVertexArray=new pc,this.indexArray=new s,this.programConfigurations=new qi(i.layers,i.zoom),this.segments=new Ie,this.stateDependentLayerIds=this.layers.filter(function(l){return l.isStateDependent()}).map(function(l){return l.id})};function Au(i,l){return i.x===l.x&&(i.x<0||i.x>8192)||i.y===l.y&&(i.y<0||i.y>8192)}Wu.prototype.populate=function(i,l,_){this.features=[],this.hasPattern=bd("fill-extrusion",this.layers,l);for(var S=0,F=i;S8192})||Ai.every(function($n){return $n.y<0})||Ai.every(function($n){return $n.y>8192})))for(var pe=0,we=0;we=1){var Ge=ie[we-1];if(!Au(ke,Ge)){N.vertexLength+4>Ie.MAX_VERTEX_ARRAY_LENGTH&&(N=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var ht=ke.sub(Ge)._perp()._unit(),mt=Ge.dist(ke);pe+mt>32768&&(pe=0),Oc(this.layoutVertexArray,ke.x,ke.y,ht.x,ht.y,0,0,pe),Oc(this.layoutVertexArray,ke.x,ke.y,ht.x,ht.y,0,1,pe),Oc(this.layoutVertexArray,Ge.x,Ge.y,ht.x,ht.y,0,0,pe+=mt),Oc(this.layoutVertexArray,Ge.x,Ge.y,ht.x,ht.y,0,1,pe);var St=N.vertexLength;this.indexArray.emplaceBack(St,St+2,St+1),this.indexArray.emplaceBack(St+1,St+2,St+3),N.vertexLength+=4,N.primitiveLength+=2}}}}if(N.vertexLength+m>Ie.MAX_VERTEX_ARRAY_LENGTH&&(N=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray)),Zf[i.type]==="Polygon"){for(var xt=[],bt=[],kt=N.vertexLength,ft=0,nr=v;ft=2&&i[m-1].equals(i[m-2]);)m--;for(var w=0;w0;if(bt&&ke>w){var ft=D.dist($);if(ft>2*N){var nr=D.sub(D.sub($)._mult(N/ft)._round());this.updateDistance($,nr),this.addCurrentVertex(nr,pe,0,0,W),$=nr}}var br=$&&ie,Pr=br?_:v?"butt":S;if(br&&Pr==="round"&&(StF&&(Pr="bevel"),Pr==="bevel"&&(St>2&&(Pr="flipbevel"),St100)Ge=we.mult(-1);else{var Mn=St*pe.add(we).mag()/pe.sub(we).mag();Ge._perp()._mult(Mn*(kt?-1:1))}this.addCurrentVertex(D,Ge,0,0,W),this.addCurrentVertex(D,Ge.mult(-1),0,0,W)}else if(Pr==="bevel"||Pr==="fakeround"){var yn=-Math.sqrt(St*St-1),kr=kt?yn:0,Ai=kt?0:yn;if($&&this.addCurrentVertex(D,pe,kr,Ai,W),Pr==="fakeround")for(var $n=Math.round(180*xt/Math.PI/20),ti=1;ti<$n;ti++){var ri=ti/$n;if(ri!==.5){var hn=ri-.5;ri+=ri*hn*(ri-1)*((1.0904+ht*(ht*(3.55645-1.43519*ht)-3.2452))*hn*hn+(.848013+ht*(.215638*ht-1.06021)))}var An=we.sub(pe)._mult(ri)._add(pe)._unit()._mult(kt?-1:1);this.addHalfVertex(D,An.x,An.y,!1,kt,0,W)}ie&&this.addCurrentVertex(D,we,-kr,-Ai,W)}else if(Pr==="butt")this.addCurrentVertex(D,Ge,0,0,W);else if(Pr==="square"){var Yi=$?1:-1;this.addCurrentVertex(D,Ge,Yi,Yi,W)}else Pr==="round"&&($&&(this.addCurrentVertex(D,pe,0,0,W),this.addCurrentVertex(D,pe,1,1,W,!0)),ie&&(this.addCurrentVertex(D,we,-1,-1,W,!0),this.addCurrentVertex(D,we,0,0,W)));if(bt&&ke2*N){var fo=D.add(ie.sub(D)._mult(N/Ci)._round());this.updateDistance(D,fo),this.addCurrentVertex(fo,we,0,0,W),D=fo}}}}},Bc.prototype.addCurrentVertex=function(i,l,_,S,F,j){j===void 0&&(j=!1);var p=l.y*S-l.x,v=-l.y-l.x*S;this.addHalfVertex(i,l.x+l.y*_,l.y-l.x*_,j,!1,_,F),this.addHalfVertex(i,p,v,j,!0,-S,F),this.distance>fd/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(i,l,_,S,F,j))},Bc.prototype.addHalfVertex=function(i,l,_,S,F,j,p){var v=.5*(this.lineClips?this.scaledDistance*(fd-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((i.x<<1)+(S?1:0),(i.y<<1)+(F?1:0),Math.round(63*l)+128,Math.round(63*_)+128,1+(j===0?0:j<0?-1:1)|(63&v)<<2,v>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var m=p.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,m),p.primitiveLength++),F?this.e2=m:this.e1=m},Bc.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Bc.prototype.updateDistance=function(i,l){this.distance+=i.dist(l),this.updateScaledDistance()},fi("LineBucket",Bc,{omit:["layers","patternFeatures"]});var im=new Gs({"line-cap":new Gi(Ae.layout_line["line-cap"]),"line-join":new Si(Ae.layout_line["line-join"]),"line-miter-limit":new Gi(Ae.layout_line["line-miter-limit"]),"line-round-limit":new Gi(Ae.layout_line["line-round-limit"]),"line-sort-key":new Si(Ae.layout_line["line-sort-key"])}),om={paint:new Gs({"line-opacity":new Si(Ae.paint_line["line-opacity"]),"line-color":new Si(Ae.paint_line["line-color"]),"line-translate":new Gi(Ae.paint_line["line-translate"]),"line-translate-anchor":new Gi(Ae.paint_line["line-translate-anchor"]),"line-width":new Si(Ae.paint_line["line-width"]),"line-gap-width":new Si(Ae.paint_line["line-gap-width"]),"line-offset":new Si(Ae.paint_line["line-offset"]),"line-blur":new Si(Ae.paint_line["line-blur"]),"line-dasharray":new ao(Ae.paint_line["line-dasharray"]),"line-pattern":new ji(Ae.paint_line["line-pattern"]),"line-gradient":new Ic(Ae.paint_line["line-gradient"])}),layout:im},Nd=new(function(i){function l(){i.apply(this,arguments)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.possiblyEvaluate=function(_,S){return S=new fa(Math.floor(S.zoom),{now:S.now,fadeDuration:S.fadeDuration,zoomHistory:S.zoomHistory,transition:S.transition}),i.prototype.possiblyEvaluate.call(this,_,S)},l.prototype.evaluate=function(_,S,F,j){return S=er({},S,{zoom:Math.floor(S.zoom)}),i.prototype.evaluate.call(this,_,S,F,j)},l}(Si))(om.paint.properties["line-width"].specification);Nd.useIntegerZoom=!0;var am=function(i){function l(_){i.call(this,_,om),this.gradientVersion=0}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype._handleSpecialPaintPropertyUpdate=function(_){_==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Nl,this.gradientVersion=(this.gradientVersion+1)%He)},l.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},l.prototype.recalculate=function(_,S){i.prototype.recalculate.call(this,_,S),this.paint._values["line-floorwidth"]=Nd.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,_)},l.prototype.createBucket=function(_){return new Bc(_)},l.prototype.queryRadius=function(_){var S=_,F=uf(ml("line-width",this,S),ml("line-gap-width",this,S)),j=ml("line-offset",this,S);return F/2+Math.abs(j)+$l(this.paint.get("line-translate"))},l.prototype.queryIntersectsFeature=function(_,S,F,j,p,v,m){var w=Vu(_,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),v.angle,m),D=m/2*uf(this.paint.get("line-width").evaluate(S,F),this.paint.get("line-gap-width").evaluate(S,F)),N=this.paint.get("line-offset").evaluate(S,F);return N&&(j=function(W,$){for(var ie=[],pe=new Le(0,0),we=0;we=3){for(var ke=0;ke0?l+2*i:i}var Qf=Al([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),cl=Al([{name:"a_projected_pos",components:3,type:"Float32"}],4),zd=(Al([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Al([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Fc=(Al([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Al([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Pe=Al([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function _t(i,l,_){return i.sections.forEach(function(S){S.text=function(F,j,p){var v=j.layout.get("text-transform").evaluate(p,{});return v==="uppercase"?F=F.toLocaleUpperCase():v==="lowercase"&&(F=F.toLocaleLowerCase()),ql.applyArabicShaping&&(F=ql.applyArabicShaping(F)),F}(S.text,l,_)}),i}Al([{name:"triangle",components:3,type:"Uint16"}]),Al([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Al([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Al([{type:"Float32",name:"offsetX"}]),Al([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Zt={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"},qr=function(i,l,_,S,F){var j,p,v=8*F-S-1,m=(1<>1,D=-7,N=_?F-1:0,W=_?-1:1,$=i[l+N];for(N+=W,j=$&(1<<-D)-1,$>>=-D,D+=v;D>0;j=256*j+i[l+N],N+=W,D-=8);for(p=j&(1<<-D)-1,j>>=-D,D+=S;D>0;p=256*p+i[l+N],N+=W,D-=8);if(j===0)j=1-w;else{if(j===m)return p?NaN:1/0*($?-1:1);p+=Math.pow(2,S),j-=w}return($?-1:1)*p*Math.pow(2,j-S)},wn=function(i,l,_,S,F,j){var p,v,m,w=8*j-F-1,D=(1<>1,W=F===23?Math.pow(2,-24)-Math.pow(2,-77):0,$=S?0:j-1,ie=S?1:-1,pe=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(v=isNaN(l)?1:0,p=D):(p=Math.floor(Math.log(l)/Math.LN2),l*(m=Math.pow(2,-p))<1&&(p--,m*=2),(l+=p+N>=1?W/m:W*Math.pow(2,1-N))*m>=2&&(p++,m/=2),p+N>=D?(v=0,p=D):p+N>=1?(v=(l*m-1)*Math.pow(2,F),p+=N):(v=l*Math.pow(2,N-1)*Math.pow(2,F),p=0));F>=8;i[_+$]=255&v,$+=ie,v/=256,F-=8);for(p=p<0;i[_+$]=255&p,$+=ie,p/=256,w-=8);i[_+$-ie]|=128*pe},Yr=Or;function Or(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}Or.Varint=0,Or.Fixed64=1,Or.Bytes=2,Or.Fixed32=5;var Wn=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");function Bn(i){return i.type===Or.Bytes?i.readVarint()+i.pos:i.pos+1}function si(i,l,_){return _?4294967296*l+(i>>>0):4294967296*(l>>>0)+(i>>>0)}function Hn(i,l,_){var S=l<=16383?1:l<=2097151?2:l<=268435455?3:Math.floor(Math.log(l)/(7*Math.LN2));_.realloc(S);for(var F=_.pos-1;F>=i;F--)_.buf[F+S]=_.buf[F]}function qn(i,l){for(var _=0;_>>8,i[_+2]=l>>>16,i[_+3]=l>>>24}function Oi(i,l){return(i[l]|i[l+1]<<8|i[l+2]<<16)+(i[l+3]<<24)}function Ln(i,l,_){i===1&&_.readMessage(wi,l)}function wi(i,l,_){if(i===3){var S=_.readMessage(Po,{}),F=S.width,j=S.height,p=S.left,v=S.top,m=S.advance;l.push({id:S.id,bitmap:new ef({width:F+6,height:j+6},S.bitmap),metrics:{width:F,height:j,left:p,top:v,advance:m}})}}function Po(i,l,_){i===1?l.id=_.readVarint():i===2?l.bitmap=_.readBytes():i===3?l.width=_.readVarint():i===4?l.height=_.readVarint():i===5?l.left=_.readSVarint():i===6?l.top=_.readSVarint():i===7&&(l.advance=_.readVarint())}function da(i){for(var l=0,_=0,S=0,F=i;S=0;W--){var $=p[W];if(!(N.w>$.w||N.h>$.h)){if(N.x=$.x,N.y=$.y,m=Math.max(m,N.y+N.h),v=Math.max(v,N.x+N.w),N.w===$.w&&N.h===$.h){var ie=p.pop();W>3,j=this.pos;this.type=7&S,i(F,l,this),this.pos===j&&this.skip(S)}return l},readMessage:function(i,l){return this.readFields(i,l,this.readVarint()+this.pos)},readFixed32:function(){var i=xi(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=Oi(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=xi(this.buf,this.pos)+4294967296*xi(this.buf,this.pos+4);return this.pos+=8,i},readSFixed64:function(){var i=xi(this.buf,this.pos)+4294967296*Oi(this.buf,this.pos+4);return this.pos+=8,i},readFloat:function(){var i=qr(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=qr(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var l,_,S=this.buf;return l=127&(_=S[this.pos++]),_<128?l:(l|=(127&(_=S[this.pos++]))<<7,_<128?l:(l|=(127&(_=S[this.pos++]))<<14,_<128?l:(l|=(127&(_=S[this.pos++]))<<21,_<128?l:function(F,j,p){var v,m,w=p.buf;if(v=(112&(m=w[p.pos++]))>>4,m<128||(v|=(127&(m=w[p.pos++]))<<3,m<128)||(v|=(127&(m=w[p.pos++]))<<10,m<128)||(v|=(127&(m=w[p.pos++]))<<17,m<128)||(v|=(127&(m=w[p.pos++]))<<24,m<128)||(v|=(1&(m=w[p.pos++]))<<31,m<128))return si(F,v,j);throw new Error("Expected varint not more than 10 bytes")}(l|=(15&(_=S[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,l=this.pos;return this.pos=i,i-l>=12&&Wn?function(_,S,F){return Wn.decode(_.subarray(S,F))}(this.buf,l,i):function(_,S,F){for(var j="",p=S;p239?4:D>223?3:D>191?2:1;if(p+W>F)break;W===1?D<128&&(N=D):W===2?(192&(v=_[p+1]))==128&&(N=(31&D)<<6|63&v)<=127&&(N=null):W===3?(m=_[p+2],(192&(v=_[p+1]))==128&&(192&m)==128&&((N=(15&D)<<12|(63&v)<<6|63&m)<=2047||N>=55296&&N<=57343)&&(N=null)):W===4&&(m=_[p+2],w=_[p+3],(192&(v=_[p+1]))==128&&(192&m)==128&&(192&w)==128&&((N=(15&D)<<18|(63&v)<<12|(63&m)<<6|63&w)<=65535||N>=1114112)&&(N=null)),N===null?(N=65533,W=1):N>65535&&(N-=65536,j+=String.fromCharCode(N>>>10&1023|55296),N=56320|1023&N),j+=String.fromCharCode(N),p+=W}return j}(this.buf,l,i)},readBytes:function(){var i=this.readVarint()+this.pos,l=this.buf.subarray(this.pos,i);return this.pos=i,l},readPackedVarint:function(i,l){if(this.type!==Or.Bytes)return i.push(this.readVarint(l));var _=Bn(this);for(i=i||[];this.pos<_;)i.push(this.readVarint(l));return i},readPackedSVarint:function(i){if(this.type!==Or.Bytes)return i.push(this.readSVarint());var l=Bn(this);for(i=i||[];this.pos127;);else if(l===Or.Bytes)this.pos=this.readVarint()+this.pos;else if(l===Or.Fixed32)this.pos+=4;else{if(l!==Or.Fixed64)throw new Error("Unimplemented type: "+l);this.pos+=8}},writeTag:function(i,l){this.writeVarint(i<<3|l)},realloc:function(i){for(var l=this.length||16;l268435455||i<0?function(l,_){var S,F;if(l>=0?(S=l%4294967296|0,F=l/4294967296|0):(F=~(-l/4294967296),4294967295^(S=~(-l%4294967296))?S=S+1|0:(S=0,F=F+1|0)),l>=18446744073709552e3||l<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");_.realloc(10),function(j,p,v){v.buf[v.pos++]=127&j|128,j>>>=7,v.buf[v.pos++]=127&j|128,j>>>=7,v.buf[v.pos++]=127&j|128,j>>>=7,v.buf[v.pos++]=127&j|128,v.buf[v.pos]=127&(j>>>=7)}(S,0,_),function(j,p){var v=(7&j)<<4;p.buf[p.pos++]|=v|((j>>>=3)?128:0),j&&(p.buf[p.pos++]=127&j|((j>>>=7)?128:0),j&&(p.buf[p.pos++]=127&j|((j>>>=7)?128:0),j&&(p.buf[p.pos++]=127&j|((j>>>=7)?128:0),j&&(p.buf[p.pos++]=127&j|((j>>>=7)?128:0),j&&(p.buf[p.pos++]=127&j)))))}(F,_)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var l=this.pos;this.pos=function(S,F,j){for(var p,v,m=0;m55295&&p<57344){if(!v){p>56319||m+1===F.length?(S[j++]=239,S[j++]=191,S[j++]=189):v=p;continue}if(p<56320){S[j++]=239,S[j++]=191,S[j++]=189,v=p;continue}p=v-55296<<10|p-56320|65536,v=null}else v&&(S[j++]=239,S[j++]=191,S[j++]=189,v=null);p<128?S[j++]=p:(p<2048?S[j++]=p>>6|192:(p<65536?S[j++]=p>>12|224:(S[j++]=p>>18|240,S[j++]=p>>12&63|128),S[j++]=p>>6&63|128),S[j++]=63&p|128)}return j}(this.buf,i,this.pos);var _=this.pos-l;_>=128&&Hn(l,_,this),this.pos=l-1,this.writeVarint(_),this.pos+=_},writeFloat:function(i){this.realloc(4),wn(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),wn(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var l=i.length;this.writeVarint(l),this.realloc(l);for(var _=0;_=128&&Hn(_,S,this),this.pos=_-1,this.writeVarint(S),this.pos+=S},writeMessage:function(i,l,_){this.writeTag(i,Or.Bytes),this.writeRawMessage(l,_)},writePackedVarint:function(i,l){l.length&&this.writeMessage(i,qn,l)},writePackedSVarint:function(i,l){l.length&&this.writeMessage(i,ci,l)},writePackedBoolean:function(i,l){l.length&&this.writeMessage(i,Tr,l)},writePackedFloat:function(i,l){l.length&&this.writeMessage(i,Vn,l)},writePackedDouble:function(i,l){l.length&&this.writeMessage(i,Yn,l)},writePackedFixed32:function(i,l){l.length&&this.writeMessage(i,en,l)},writePackedSFixed32:function(i,l){l.length&&this.writeMessage(i,Xn,l)},writePackedFixed64:function(i,l){l.length&&this.writeMessage(i,_i,l)},writePackedSFixed64:function(i,l){l.length&&this.writeMessage(i,Rn,l)},writeBytesField:function(i,l){this.writeTag(i,Or.Bytes),this.writeBytes(l)},writeFixed32Field:function(i,l){this.writeTag(i,Or.Fixed32),this.writeFixed32(l)},writeSFixed32Field:function(i,l){this.writeTag(i,Or.Fixed32),this.writeSFixed32(l)},writeFixed64Field:function(i,l){this.writeTag(i,Or.Fixed64),this.writeFixed64(l)},writeSFixed64Field:function(i,l){this.writeTag(i,Or.Fixed64),this.writeSFixed64(l)},writeVarintField:function(i,l){this.writeTag(i,Or.Varint),this.writeVarint(l)},writeSVarintField:function(i,l){this.writeTag(i,Or.Varint),this.writeSVarint(l)},writeStringField:function(i,l){this.writeTag(i,Or.Bytes),this.writeString(l)},writeFloatField:function(i,l){this.writeTag(i,Or.Fixed32),this.writeFloat(l)},writeDoubleField:function(i,l){this.writeTag(i,Or.Fixed64),this.writeDouble(l)},writeBooleanField:function(i,l){this.writeVarintField(i,!!l)}};var bi=function(i,l){var _=l.pixelRatio,S=l.version,F=l.stretchX,j=l.stretchY,p=l.content;this.paddedRect=i,this.pixelRatio=_,this.stretchX=F,this.stretchY=j,this.content=p,this.version=S},Zn={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Zn.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Zn.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Zn.tlbr.get=function(){return this.tl.concat(this.br)},Zn.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(bi.prototype,Zn);var Sn=function(i,l){var _={},S={};this.haveRenderCallbacks=[];var F=[];this.addImages(i,_,F),this.addImages(l,S,F);var j=da(F),p=new _s({width:j.w||1,height:j.h||1});for(var v in i){var m=i[v],w=_[v].paddedRect;_s.copy(m.data,p,{x:0,y:0},{x:w.x+1,y:w.y+1},m.data)}for(var D in l){var N=l[D],W=S[D].paddedRect,$=W.x+1,ie=W.y+1,pe=N.data.width,we=N.data.height;_s.copy(N.data,p,{x:0,y:0},{x:$,y:ie},N.data),_s.copy(N.data,p,{x:0,y:we-1},{x:$,y:ie-1},{width:pe,height:1}),_s.copy(N.data,p,{x:0,y:0},{x:$,y:ie+we},{width:pe,height:1}),_s.copy(N.data,p,{x:pe-1,y:0},{x:$-1,y:ie},{width:1,height:we}),_s.copy(N.data,p,{x:0,y:0},{x:$+pe,y:ie},{width:1,height:we})}this.image=p,this.iconPositions=_,this.patternPositions=S};Sn.prototype.addImages=function(i,l,_){for(var S in i){var F=i[S],j={x:0,y:0,w:F.data.width+2,h:F.data.height+2};_.push(j),l[S]=new bi(j,F),F.hasRenderCallback&&this.haveRenderCallbacks.push(S)}},Sn.prototype.patchUpdatedImages=function(i,l){for(var _ in i.dispatchRenderCallbacks(this.haveRenderCallbacks),i.updatedImages)this.patchUpdatedImage(this.iconPositions[_],i.getImage(_),l),this.patchUpdatedImage(this.patternPositions[_],i.getImage(_),l)},Sn.prototype.patchUpdatedImage=function(i,l,_){if(i&&l&&i.version!==l.version){i.version=l.version;var S=i.tl;_.update(l.data,void 0,{x:S[0],y:S[1]})}},fi("ImagePosition",bi),fi("ImageAtlas",Sn);var Wt={horizontal:1,vertical:2,horizontalOnly:3},K=function(){this.scale=1,this.fontStack="",this.imageName=null};K.forText=function(i,l){var _=new K;return _.scale=i||1,_.fontStack=l,_},K.forImage=function(i){var l=new K;return l.imageName=i,l};var Ei=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Ee(i,l,_,S,F,j,p,v,m,w,D,N,W,$,ie,pe){var we,ke=Ei.fromFeature(i,F);N===Wt.vertical&&ke.verticalizePunctuation();var Ge=ql.processBidirectionalText,ht=ql.processStyledBidirectionalText;if(Ge&&ke.sections.length===1){we=[];for(var mt=0,St=Ge(ke.toString(),fu(ke,w,j,l,S,$,ie));mt0&&me>ws&&(ws=me)}else{var Me=$n[ua.fontStack],De=Me&&Me[c];if(De&&De.rect)E=De.rect,f=De.metrics;else{var Ye=Ai[ua.fontStack],ot=Ye&&Ye[c];if(!ot)continue;f=ot.metrics}o=24*(ha-ua.scale)}X?(kr.verticalizable=!0,Ea.push({glyph:c,imageName:L,x:zi,y:Vo+o,vertical:X,scale:ua.scale,fontStack:ua.fontStack,sectionIndex:cu,metrics:f,rect:E}),zi+=V*ua.scale+fo):(Ea.push({glyph:c,imageName:L,x:zi,y:Vo+o,vertical:X,scale:ua.scale,fontStack:ua.fontStack,sectionIndex:cu,metrics:f,rect:E}),zi+=f.advance*ua.scale+fo)}Ea.length!==0&&(Ka=Math.max(zi-fo,Ka),ps(Ea,0,Ea.length-1,ka,ws)),zi=0;var lt=hn*ha+ws;Ls.lineOffset=Math.max(ws,Xs),Vo+=lt,ta=Math.max(lt,ta),++ca}else Vo+=hn,++ca}var Ct,Gt=Vo- -17,Kt=Js(An),Er=Kt.horizontalAlign,cr=Kt.verticalAlign;(function(Rr,Qr,Fn,Ki,Co,$i,Zi,Ri,vo){var Ii,ni=(Qr-Fn)*Co;Ii=$i!==Zi?-Ri*Ki- -17:(-Ki*vo+.5)*Zi;for(var jo=0,Do=Rr;jo=0&&S>=i&&sa[this.text.charCodeAt(S)];S--)_--;this.text=this.text.substring(i,_),this.sectionIndex=this.sectionIndex.slice(i,_)},Ei.prototype.substring=function(i,l){var _=new Ei;return _.text=this.text.substring(i,l),_.sectionIndex=this.sectionIndex.slice(i,l),_.sections=this.sections,_},Ei.prototype.toString=function(){return this.text},Ei.prototype.getMaxScale=function(){var i=this;return this.sectionIndex.reduce(function(l,_){return Math.max(l,i.sections[_].scale)},0)},Ei.prototype.addTextSection=function(i,l){this.text+=i.text,this.sections.push(K.forText(i.scale,i.fontStack||l));for(var _=this.sections.length-1,S=0;S=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var sa={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Jo={};function Es(i,l,_,S,F,j){if(l.imageName){var p=S[l.imageName];return p?p.displaySize[0]*l.scale*24/j+F:0}var v=_[l.fontStack],m=v&&v[i];return m?m.metrics.advance*l.scale+F:0}function Cu(i,l,_,S){var F=Math.pow(i-l,2);return S?i=0,N=0,W=0;W-_/2;){if(--p<0)return!1;v-=i[p].dist(j),j=i[p]}v+=i[p].dist(i[p+1]),p++;for(var m=[],w=0;v<_/2;){var D=i[p],N=i[p+1];if(!N)return!1;var W=i[p-1].angleTo(D)-D.angleTo(N);for(W=Math.abs((W+3*Math.PI)%(2*Math.PI)-Math.PI),m.push({distance:v,angleDelta:W}),w+=W;v-m[0].distance>S;)w-=m.shift().angleDelta;if(w>F)return!1;p++,v+=D.dist(N)}return!0}function ss(i){for(var l=0,_=0;_w){var ie=(w-m)/$,pe=Io(N.x,W.x,ie),we=Io(N.y,W.y,ie),ke=new ru(pe,we,W.angleTo(N),D);return ke._round(),!p||mu(i,ke,v,p,l)?ke:void 0}m+=$}}function Qs(i,l,_,S,F,j,p,v,m){var w=go(S,j,p),D=ya(S,F),N=D*p,W=i[0].x===0||i[0].x===m||i[0].y===0||i[0].y===m;return l-N=0&&ti=0&&ri=0&&nr+bt<=kt){var hn=new ru(ti,ri,Ai,Pr);hn._round(),ke&&!mu(ie,hn,ht,ke,Ge)||br.push(hn)}}ft+=kr}return St||br.length||mt||(br=$(ie,ft/2,we,ke,Ge,ht,mt,!0,xt)),br}(i,W?l/2*v%l:(D/2+2*j)*p*v%l,l,w,_,N,W,!1,m)}function Cp(i,l,_,S,F){for(var j=[],p=0;p=S&&N.x>=S||(D.x>=S?D=new Le(S,D.y+(S-D.x)/(N.x-D.x)*(N.y-D.y))._round():N.x>=S&&(N=new Le(S,D.y+(S-D.x)/(N.x-D.x)*(N.y-D.y))._round()),D.y>=F&&N.y>=F||(D.y>=F?D=new Le(D.x+(F-D.y)/(N.y-D.y)*(N.x-D.x),F)._round():N.y>=F&&(N=new Le(D.x+(F-D.y)/(N.y-D.y)*(N.x-D.x),F)._round()),m&&D.equals(m[m.length-1])||j.push(m=[D]),m.push(N)))))}return j}function Ft(i,l,_,S){var F=[],j=i.image,p=j.pixelRatio,v=j.paddedRect.w-2,m=j.paddedRect.h-2,w=i.right-i.left,D=i.bottom-i.top,N=j.stretchX||[[0,v]],W=j.stretchY||[[0,m]],$=function(ti,ri){return ti+ri[1]-ri[0]},ie=N.reduce($,0),pe=W.reduce($,0),we=v-ie,ke=m-pe,Ge=0,ht=ie,mt=0,St=pe,xt=0,bt=we,kt=0,ft=ke;if(j.content&&S){var nr=j.content;Ge=Xr(N,0,nr[0]),mt=Xr(W,0,nr[1]),ht=Xr(N,nr[0],nr[2]),St=Xr(W,nr[1],nr[3]),xt=nr[0]-Ge,kt=nr[1]-mt,bt=nr[2]-nr[0]-ht,ft=nr[3]-nr[1]-St}var br=function(ti,ri,hn,An){var Yi=Bi(ti.stretch-Ge,ht,w,i.left),Ci=Ma(ti.fixed-xt,bt,ti.stretch,ie),fo=Bi(ri.stretch-mt,St,D,i.top),Go=Ma(ri.fixed-kt,ft,ri.stretch,pe),hi=Bi(hn.stretch-Ge,ht,w,i.left),zi=Ma(hn.fixed-xt,bt,hn.stretch,ie),Vo=Bi(An.stretch-mt,St,D,i.top),Ka=Ma(An.fixed-kt,ft,An.stretch,pe),ta=new Le(Yi,fo),ka=new Le(hi,fo),ca=new Le(hi,Vo),Eo=new Le(Yi,Vo),Pa=new Le(Ci/p,Go/p),na=new Le(zi/p,Ka/p),ha=l*Math.PI/180;if(ha){var Xs=Math.sin(ha),Ls=Math.cos(ha),Ea=[Ls,-Xs,Xs,Ls];ta._matMult(Ea),ka._matMult(Ea),Eo._matMult(Ea),ca._matMult(Ea)}var ws=ti.stretch+ti.fixed,qs=ri.stretch+ri.fixed;return{tl:ta,tr:ka,bl:Eo,br:ca,tex:{x:j.paddedRect.x+1+ws,y:j.paddedRect.y+1+qs,w:hn.stretch+hn.fixed-ws,h:An.stretch+An.fixed-qs},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Pa,pixelOffsetBR:na,minFontScaleX:bt/p/w,minFontScaleY:ft/p/D,isSDF:_}};if(S&&(j.stretchX||j.stretchY))for(var Pr=Mr(N,we,ie),Mn=Mr(W,ke,pe),yn=0;yn0&&($=Math.max(10,$),this.circleDiameter=$)}else{var ie=j.top*p-v,pe=j.bottom*p+v,we=j.left*p-v,ke=j.right*p+v,Ge=j.collisionPadding;if(Ge&&(we-=Ge[0]*p,ie-=Ge[1]*p,ke+=Ge[2]*p,pe+=Ge[3]*p),w){var ht=new Le(we,ie),mt=new Le(ke,ie),St=new Le(we,pe),xt=new Le(ke,pe),bt=w*Math.PI/180;ht._rotate(bt),mt._rotate(bt),St._rotate(bt),xt._rotate(bt),we=Math.min(ht.x,mt.x,St.x,xt.x),ke=Math.max(ht.x,mt.x,St.x,xt.x),ie=Math.min(ht.y,mt.y,St.y,xt.y),pe=Math.max(ht.y,mt.y,St.y,xt.y)}i.emplaceBack(l.x,l.y,we,ie,ke,pe,_,S,F)}this.boxEndIndex=i.length},st=function(i,l){if(i===void 0&&(i=[]),l===void 0&&(l=Et),this.data=i,this.length=this.data.length,this.compare=l,this.length>0)for(var _=(this.length>>1)-1;_>=0;_--)this._down(_)};function Et(i,l){return il?1:0}function Vt(i,l,_){l===void 0&&(l=1),_===void 0&&(_=!1);for(var S=1/0,F=1/0,j=-1/0,p=-1/0,v=i[0],m=0;mj)&&(j=w.x),(!m||w.y>p)&&(p=w.y)}var D=Math.min(j-S,p-F),N=D/2,W=new st([],Br);if(D===0)return new Le(S,F);for(var $=S;$pe.d||!pe.d)&&(pe=ke,_&&console.log("found best %d after %d probes",Math.round(1e4*ke.d)/1e4,we)),ke.max-pe.d<=l||(W.push(new Ir(ke.p.x-(N=ke.h/2),ke.p.y-N,N,i)),W.push(new Ir(ke.p.x+N,ke.p.y-N,N,i)),W.push(new Ir(ke.p.x-N,ke.p.y+N,N,i)),W.push(new Ir(ke.p.x+N,ke.p.y+N,N,i)),we+=4)}return _&&(console.log("num probes: "+we),console.log("best distance: "+pe.d)),pe.p}function Br(i,l){return l.max-i.max}function Ir(i,l,_,S){this.p=new Le(i,l),this.h=_,this.d=function(F,j){for(var p=!1,v=1/0,m=0;mF.y!=ie.y>F.y&&F.x<(ie.x-$.x)*(F.y-$.y)/(ie.y-$.y)+$.x&&(p=!p),v=Math.min(v,Zu(F,$,ie))}return(p?1:-1)*Math.sqrt(v)}(this.p,S),this.max=this.d+this.h*Math.SQRT2}st.prototype.push=function(i){this.data.push(i),this.length++,this._up(this.length-1)},st.prototype.pop=function(){if(this.length!==0){var i=this.data[0],l=this.data.pop();return this.length--,this.length>0&&(this.data[0]=l,this._down(0)),i}},st.prototype.peek=function(){return this.data[0]},st.prototype._up=function(i){for(var l=this.data,_=this.compare,S=l[i];i>0;){var F=i-1>>1,j=l[F];if(_(S,j)>=0)break;l[i]=j,i=F}l[i]=S},st.prototype._down=function(i){for(var l=this.data,_=this.compare,S=this.length>>1,F=l[i];i=0)break;l[i]=p,i=j}l[i]=F};var Jt=Number.POSITIVE_INFINITY;function sr(i,l){return l[1]!==Jt?function(_,S,F){var j=0,p=0;switch(S=Math.abs(S),F=Math.abs(F),_){case"top-right":case"top-left":case"top":p=F-7;break;case"bottom-right":case"bottom-left":case"bottom":p=7-F}switch(_){case"top-right":case"bottom-right":case"right":j=-S;break;case"top-left":case"bottom-left":case"left":j=S}return[j,p]}(i,l[0],l[1]):function(_,S){var F=0,j=0;S<0&&(S=0);var p=S/Math.sqrt(2);switch(_){case"top-right":case"top-left":j=p-7;break;case"bottom-right":case"bottom-left":j=7-p;break;case"bottom":j=7-S;break;case"top":j=S-7}switch(_){case"top-right":case"bottom-right":F=-p;break;case"top-left":case"bottom-left":F=p;break;case"left":F=S;break;case"right":F=-S}return[F,j]}(i,l[0])}function lr(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Mt(i,l,_,S,F,j,p,v,m,w,D,N,W,$,ie){var pe=function(mt,St,xt,bt,kt,ft,nr,br){for(var Pr=bt.layout.get("text-rotate").evaluate(ft,{})*Math.PI/180,Mn=[],yn=0,kr=St.positionedLines;yn32640&&gr(i.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):we.kind==="composite"&&((ke=[128*$.compositeTextSizes[0].evaluate(p,{},ie),128*$.compositeTextSizes[1].evaluate(p,{},ie)])[0]>32640||ke[1]>32640)&&gr(i.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),i.addSymbols(i.text,pe,ke,v,j,p,w,l,m.lineStartIndex,m.lineLength,W,ie);for(var Ge=0,ht=D;Ge=0;p--)if(S.dist(j[p])<_)return!0}else F[l]=[];return F[l].push(S),!1}var $t=yp.VectorTileFeature.types,zr=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function $r(i,l,_,S,F,j,p,v,m,w,D,N,W){var $=v?Math.min(32640,Math.round(v[0])):0,ie=v?Math.min(32640,Math.round(v[1])):0;i.emplaceBack(l,_,Math.round(32*S),Math.round(32*F),j,p,($<<1)+(m?1:0),ie,16*w,16*D,256*N,256*W)}function Tn(i,l,_){i.emplaceBack(l.x,l.y,_),i.emplaceBack(l.x,l.y,_),i.emplaceBack(l.x,l.y,_),i.emplaceBack(l.x,l.y,_)}function vn(i){for(var l=0,_=i.sections;l<_.length;l+=1)if(wh(_[l].text))return!0;return!1}var _n=function(i){this.layoutVertexArray=new qc,this.indexArray=new s,this.programConfigurations=i,this.segments=new Ie,this.dynamicLayoutVertexArray=new Sh,this.opacityVertexArray=new nc,this.placedSymbolArray=new b};_n.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},_n.prototype.upload=function(i,l,_,S){this.isEmpty()||(_&&(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,Qf.members),this.indexBuffer=i.createIndexBuffer(this.indexArray,l),this.dynamicLayoutVertexBuffer=i.createVertexBuffer(this.dynamicLayoutVertexArray,cl.members,!0),this.opacityVertexBuffer=i.createVertexBuffer(this.opacityVertexArray,zr,!0),this.opacityVertexBuffer.itemSize=1),(_||S)&&this.programConfigurations.upload(i))},_n.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},fi("SymbolBuffers",_n);var Qn=function(i,l,_){this.layoutVertexArray=new i,this.layoutAttributes=l,this.indexArray=new _,this.segments=new Ie,this.collisionVertexArray=new z};Qn.prototype.upload=function(i){this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=i.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=i.createVertexBuffer(this.collisionVertexArray,zd.members,!0)},Qn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},fi("CollisionBuffers",Qn);var Fi=function(i){this.collisionBoxArray=i.collisionBoxArray,this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(function(j){return j.id}),this.index=i.index,this.pixelRatio=i.pixelRatio,this.sourceLayerIndex=i.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=yl([]),this.placementViewportMatrix=yl([]);var l=this.layers[0]._unevaluatedLayout._values;this.textSizeData=uu(this.zoom,l["text-size"]),this.iconSizeData=uu(this.zoom,l["icon-size"]);var _=this.layers[0].layout,S=_.get("symbol-sort-key"),F=_.get("symbol-z-order");this.canOverlap=_.get("text-allow-overlap")||_.get("icon-allow-overlap")||_.get("text-ignore-placement")||_.get("icon-ignore-placement"),this.sortFeaturesByKey=F!=="viewport-y"&&S.constantOr(1)!==void 0,this.sortFeaturesByY=(F==="viewport-y"||F==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,_.get("symbol-placement")==="point"&&(this.writingModes=_.get("text-writing-mode").map(function(j){return Wt[j]})),this.stateDependentLayerIds=this.layers.filter(function(j){return j.isStateDependent()}).map(function(j){return j.id}),this.sourceID=i.sourceID};Fi.prototype.createArrays=function(){this.text=new _n(new qi(this.layers,this.zoom,function(i){return/^text/.test(i)})),this.icon=new _n(new qi(this.layers,this.zoom,function(i){return/^icon/.test(i)})),this.glyphOffsetArray=new q,this.lineVertexArray=new te,this.symbolInstances=new G},Fi.prototype.calculateGlyphDependencies=function(i,l,_,S,F){for(var j=0;j0)&&(j.value.kind!=="constant"||j.value.value.length>0),w=v.value.kind!=="constant"||!!v.value.value||Object.keys(v.parameters).length>0,D=F.get("symbol-sort-key");if(this.features=[],m||w){for(var N=l.iconDependencies,W=l.glyphDependencies,$=l.availableImages,ie=new fa(this.zoom),pe=0,we=i;pe=0;for(var Ai=0,$n=kt.sections;Ai<$n.length;Ai+=1){var ti=$n[Ai];if(ti.image)N[ti.image.name]=!0;else{var ri=Mc(kt.toString()),hn=ti.fontStack||yn,An=W[hn]=W[hn]||{};this.calculateGlyphDependencies(ti.text,An,kr,this.allowVerticalPlacement,ri)}}}}}}F.get("symbol-placement")==="line"&&(this.features=function(Yi){var Ci={},fo={},Go=[],hi=0;function zi(Ea){Go.push(Yi[Ea]),hi++}function Vo(Ea,ws,qs){var ua=fo[Ea];return delete fo[Ea],fo[ws]=ua,Go[ua].geometry[0].pop(),Go[ua].geometry[0]=Go[ua].geometry[0].concat(qs[0]),ua}function Ka(Ea,ws,qs){var ua=Ci[ws];return delete Ci[ws],Ci[Ea]=ua,Go[ua].geometry[0].shift(),Go[ua].geometry[0]=qs[0].concat(Go[ua].geometry[0]),ua}function ta(Ea,ws,qs){var ua=qs?ws[0][ws[0].length-1]:ws[0][0];return Ea+":"+ua.x+":"+ua.y}for(var ka=0;ka=0;v--)j[v]={x:l[v].x,y:l[v].y,tileUnitDistanceFromAnchor:F},v>0&&(F+=l[v-1].dist(l[v]));for(var m=0;m0},Fi.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Fi.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Fi.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Fi.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Fi.prototype.addIndicesForPlacedSymbol=function(i,l){for(var _=i.placedSymbolArray.get(l),S=_.vertexStartIndex+4*_.numGlyphs,F=_.vertexStartIndex;F1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(i),this.sortedAngle=i,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var _=0,S=this.symbolInstanceIndexes;_=0&&v.indexOf(j)===p&&l.addIndicesForPlacedSymbol(l.text,j)}),F.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,F.verticalPlacedTextSymbolIndex),F.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,F.placedIconSymbolIndex),F.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,F.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},fi("SymbolBucket",Fi,{omit:["layers","collisionBoxArray","features","compareText"]}),Fi.MAX_GLYPHS=65535,Fi.addDynamicAttributes=Tn;var Vr=new Gs({"symbol-placement":new Gi(Ae.layout_symbol["symbol-placement"]),"symbol-spacing":new Gi(Ae.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Gi(Ae.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Si(Ae.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Gi(Ae.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Gi(Ae.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Gi(Ae.layout_symbol["icon-ignore-placement"]),"icon-optional":new Gi(Ae.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Gi(Ae.layout_symbol["icon-rotation-alignment"]),"icon-size":new Si(Ae.layout_symbol["icon-size"]),"icon-text-fit":new Gi(Ae.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Gi(Ae.layout_symbol["icon-text-fit-padding"]),"icon-image":new Si(Ae.layout_symbol["icon-image"]),"icon-rotate":new Si(Ae.layout_symbol["icon-rotate"]),"icon-padding":new Gi(Ae.layout_symbol["icon-padding"]),"icon-keep-upright":new Gi(Ae.layout_symbol["icon-keep-upright"]),"icon-offset":new Si(Ae.layout_symbol["icon-offset"]),"icon-anchor":new Si(Ae.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Gi(Ae.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Gi(Ae.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Gi(Ae.layout_symbol["text-rotation-alignment"]),"text-field":new Si(Ae.layout_symbol["text-field"]),"text-font":new Si(Ae.layout_symbol["text-font"]),"text-size":new Si(Ae.layout_symbol["text-size"]),"text-max-width":new Si(Ae.layout_symbol["text-max-width"]),"text-line-height":new Gi(Ae.layout_symbol["text-line-height"]),"text-letter-spacing":new Si(Ae.layout_symbol["text-letter-spacing"]),"text-justify":new Si(Ae.layout_symbol["text-justify"]),"text-radial-offset":new Si(Ae.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Gi(Ae.layout_symbol["text-variable-anchor"]),"text-anchor":new Si(Ae.layout_symbol["text-anchor"]),"text-max-angle":new Gi(Ae.layout_symbol["text-max-angle"]),"text-writing-mode":new Gi(Ae.layout_symbol["text-writing-mode"]),"text-rotate":new Si(Ae.layout_symbol["text-rotate"]),"text-padding":new Gi(Ae.layout_symbol["text-padding"]),"text-keep-upright":new Gi(Ae.layout_symbol["text-keep-upright"]),"text-transform":new Si(Ae.layout_symbol["text-transform"]),"text-offset":new Si(Ae.layout_symbol["text-offset"]),"text-allow-overlap":new Gi(Ae.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Gi(Ae.layout_symbol["text-ignore-placement"]),"text-optional":new Gi(Ae.layout_symbol["text-optional"])}),po={paint:new Gs({"icon-opacity":new Si(Ae.paint_symbol["icon-opacity"]),"icon-color":new Si(Ae.paint_symbol["icon-color"]),"icon-halo-color":new Si(Ae.paint_symbol["icon-halo-color"]),"icon-halo-width":new Si(Ae.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Si(Ae.paint_symbol["icon-halo-blur"]),"icon-translate":new Gi(Ae.paint_symbol["icon-translate"]),"icon-translate-anchor":new Gi(Ae.paint_symbol["icon-translate-anchor"]),"text-opacity":new Si(Ae.paint_symbol["text-opacity"]),"text-color":new Si(Ae.paint_symbol["text-color"],{runtimeType:En,getOverride:function(i){return i.textColor},hasOverride:function(i){return!!i.textColor}}),"text-halo-color":new Si(Ae.paint_symbol["text-halo-color"]),"text-halo-width":new Si(Ae.paint_symbol["text-halo-width"]),"text-halo-blur":new Si(Ae.paint_symbol["text-halo-blur"]),"text-translate":new Gi(Ae.paint_symbol["text-translate"]),"text-translate-anchor":new Gi(Ae.paint_symbol["text-translate-anchor"])}),layout:Vr},la=function(i){this.type=i.property.overrides?i.property.overrides.runtimeType:xn,this.defaultValue=i};la.prototype.evaluate=function(i){if(i.formattedSection){var l=this.defaultValue.property.overrides;if(l&&l.hasOverride(i.formattedSection))return l.getOverride(i.formattedSection)}return i.feature&&i.featureState?this.defaultValue.evaluate(i.feature,i.featureState):this.defaultValue.property.specification.default},la.prototype.eachChild=function(i){this.defaultValue.isConstant()||i(this.defaultValue.value._styleExpression.expression)},la.prototype.outputDefined=function(){return!1},la.prototype.serialize=function(){return null},fi("FormatSectionOverride",la,{omit:["defaultValue"]});var Ns=function(i){function l(_){i.call(this,_,po)}return i&&(l.__proto__=i),(l.prototype=Object.create(i&&i.prototype)).constructor=l,l.prototype.recalculate=function(_,S){if(i.prototype.recalculate.call(this,_,S),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var F=this.layout.get("text-writing-mode");if(F){for(var j=[],p=0,v=F;p",targetMapId:S,sourceMapId:j.mapId})}}},Ud.prototype.receive=function(i){var l=i.data,_=l.id;if(_&&(!l.targetMapId||this.mapId===l.targetMapId))if(l.type===""){delete this.tasks[_];var S=this.cancelCallbacks[_];delete this.cancelCallbacks[_],S&&S()}else qe()||l.mustQueue?(this.tasks[_]=l,this.taskQueue.push(_),this.invoker.trigger()):this.processTask(_,l)},Ud.prototype.process=function(){if(this.taskQueue.length){var i=this.taskQueue.shift(),l=this.tasks[i];delete this.tasks[i],this.taskQueue.length&&this.invoker.trigger(),l&&this.processTask(i,l)}},Ud.prototype.processTask=function(i,l){var _=this;if(l.type===""){var S=this.callbacks[i];delete this.callbacks[i],S&&(l.error?S(is(l.error)):S(null,is(l.data)))}else{var F=!1,j=Pt(this.globalScope)?void 0:[],p=l.hasCallback?function(D,N){F=!0,delete _.cancelCallbacks[i],_.target.postMessage({id:i,type:"",sourceMapId:_.mapId,error:D?ai(D):null,data:ai(N,j)},j)}:function(D){F=!0},v=null,m=is(l.data);if(this.parent[l.type])v=this.parent[l.type](l.sourceMapId,m,p);else if(this.parent.getWorkerSource){var w=l.type.split(".");v=this.parent.getWorkerSource(l.sourceMapId,w[0],m.source)[w[1]](m,p)}else p(new Error("Could not find function "+l.type));!F&&v&&v.cancel&&(this.cancelCallbacks[i]=v.cancel)}},Ud.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Bu=function(i,l){i&&(l?this.setSouthWest(i).setNorthEast(l):i.length===4?this.setSouthWest([i[0],i[1]]).setNorthEast([i[2],i[3]]):this.setSouthWest(i[0]).setNorthEast(i[1]))};Bu.prototype.setNorthEast=function(i){return this._ne=i instanceof nu?new nu(i.lng,i.lat):nu.convert(i),this},Bu.prototype.setSouthWest=function(i){return this._sw=i instanceof nu?new nu(i.lng,i.lat):nu.convert(i),this},Bu.prototype.extend=function(i){var l,_,S=this._sw,F=this._ne;if(i instanceof nu)l=i,_=i;else{if(!(i instanceof Bu))return Array.isArray(i)?i.length===4||i.every(Array.isArray)?this.extend(Bu.convert(i)):this.extend(nu.convert(i)):this;if(_=i._ne,!(l=i._sw)||!_)return this}return S||F?(S.lng=Math.min(l.lng,S.lng),S.lat=Math.min(l.lat,S.lat),F.lng=Math.max(_.lng,F.lng),F.lat=Math.max(_.lat,F.lat)):(this._sw=new nu(l.lng,l.lat),this._ne=new nu(_.lng,_.lat)),this},Bu.prototype.getCenter=function(){return new nu((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Bu.prototype.getSouthWest=function(){return this._sw},Bu.prototype.getNorthEast=function(){return this._ne},Bu.prototype.getNorthWest=function(){return new nu(this.getWest(),this.getNorth())},Bu.prototype.getSouthEast=function(){return new nu(this.getEast(),this.getSouth())},Bu.prototype.getWest=function(){return this._sw.lng},Bu.prototype.getSouth=function(){return this._sw.lat},Bu.prototype.getEast=function(){return this._ne.lng},Bu.prototype.getNorth=function(){return this._ne.lat},Bu.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Bu.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Bu.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Bu.prototype.contains=function(i){var l=nu.convert(i),_=l.lng,S=l.lat,F=this._sw.lng<=_&&_<=this._ne.lng;return this._sw.lng>this._ne.lng&&(F=this._sw.lng>=_&&_>=this._ne.lng),this._sw.lat<=S&&S<=this._ne.lat&&F},Bu.convert=function(i){return!i||i instanceof Bu?i:new Bu(i)};var nu=function(i,l){if(isNaN(i)||isNaN(l))throw new Error("Invalid LngLat object: ("+i+", "+l+")");if(this.lng=+i,this.lat=+l,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};nu.prototype.wrap=function(){return new nu(et(this.lng,-180,180),this.lat)},nu.prototype.toArray=function(){return[this.lng,this.lat]},nu.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},nu.prototype.distanceTo=function(i){var l=Math.PI/180,_=this.lat*l,S=i.lat*l,F=Math.sin(_)*Math.sin(S)+Math.cos(_)*Math.cos(S)*Math.cos((i.lng-this.lng)*l);return 63710088e-1*Math.acos(Math.min(F,1))},nu.prototype.toBounds=function(i){i===void 0&&(i=0);var l=360*i/40075017,_=l/Math.cos(Math.PI/180*this.lat);return new Bu(new nu(this.lng-_,this.lat-l),new nu(this.lng+_,this.lat+l))},nu.convert=function(i){if(i instanceof nu)return i;if(Array.isArray(i)&&(i.length===2||i.length===3))return new nu(Number(i[0]),Number(i[1]));if(!Array.isArray(i)&&typeof i=="object"&&i!==null)return new nu(Number("lng"in i?i.lng:i.lon),Number(i.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var lm=2*Math.PI*63710088e-1;function Cd(i){return lm*Math.cos(i*Math.PI/180)}function rd(i){return(180+i)/360}function bm(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function Nr(i,l){return i/Cd(l)}function um(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}var Tf=function(i,l,_){_===void 0&&(_=0),this.x=+i,this.y=+l,this.z=+_};Tf.fromLngLat=function(i,l){l===void 0&&(l=0);var _=nu.convert(i);return new Tf(rd(_.lng),bm(_.lat),Nr(l,_.lat))},Tf.prototype.toLngLat=function(){return new nu(360*this.x-180,um(this.y))},Tf.prototype.toAltitude=function(){return this.z*Cd(um(this.y))},Tf.prototype.meterInMercatorCoordinateUnits=function(){return 1/lm*(i=um(this.y),1/Math.cos(i*Math.PI/180));var i};var Mp=function(i,l,_){this.z=i,this.x=l,this.y=_,this.key=cm(0,i,i,l,_)};Mp.prototype.equals=function(i){return this.z===i.z&&this.x===i.x&&this.y===i.y},Mp.prototype.url=function(i,l){var _,S,F,j,p,v=(S=this.y,F=this.z,j=Ad(256*(_=this.x),256*(S=Math.pow(2,F)-S-1),F),p=Ad(256*(_+1),256*(S+1),F),j[0]+","+j[1]+","+p[0]+","+p[1]),m=function(w,D,N){for(var W,$="",ie=w;ie>0;ie--)$+=(D&(W=1<this.canonical.z?new Kr(i,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Kr(i,this.wrap,i,this.canonical.x>>l,this.canonical.y>>l)},Kr.prototype.calculateScaledKey=function(i,l){var _=this.canonical.z-i;return i>this.canonical.z?cm(this.wrap*+l,i,this.canonical.z,this.canonical.x,this.canonical.y):cm(this.wrap*+l,i,i,this.canonical.x>>_,this.canonical.y>>_)},Kr.prototype.isChildOf=function(i){if(i.wrap!==this.wrap)return!1;var l=this.canonical.z-i.canonical.z;return i.overscaledZ===0||i.overscaledZ>l&&i.canonical.y===this.canonical.y>>l},Kr.prototype.children=function(i){if(this.overscaledZ>=i)return[new Kr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var l=this.canonical.z+1,_=2*this.canonical.x,S=2*this.canonical.y;return[new Kr(l,this.wrap,l,_,S),new Kr(l,this.wrap,l,_+1,S),new Kr(l,this.wrap,l,_,S+1),new Kr(l,this.wrap,l,_+1,S+1)]},Kr.prototype.isLessThan=function(i){return this.wrapi.wrap)&&(this.overscaledZi.overscaledZ)&&(this.canonical.xi.canonical.x)&&this.canonical.y=this.dim+1||l<-1||l>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(l+1)*this.stride+(i+1)},Af.prototype._unpackMapbox=function(i,l,_){return(256*i*256+256*l+_)/10-1e4},Af.prototype._unpackTerrarium=function(i,l,_){return 256*i+l+_/256-32768},Af.prototype.getPixels=function(){return new _s({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Af.prototype.backfillBorder=function(i,l,_){if(this.dim!==i.dim)throw new Error("dem dimension mismatch");var S=l*this.dim,F=l*this.dim+this.dim,j=_*this.dim,p=_*this.dim+this.dim;switch(l){case-1:S=F-1;break;case 1:F=S+1}switch(_){case-1:j=p-1;break;case 1:p=j+1}for(var v=-l*this.dim,m=-_*this.dim,w=j;w=0&&D[3]>=0&&v.insert(p,D[0],D[1],D[2],D[3])}},cf.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new yp.VectorTile(new Yr(this.rawTileData)).layers,this.sourceLayerCoder=new hm(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},cf.prototype.query=function(i,l,_,S){var F=this;this.loadVTLayers();for(var j=i.params||{},p=8192/i.tileSize/i.scale,v=jc(j.filter),m=i.queryGeometry,w=i.queryPadding*p,D=Sm(m),N=this.grid.query(D.minX-w,D.minY-w,D.maxX+w,D.maxY+w),W=Sm(i.cameraQueryGeometry),$=this.grid3D.query(W.minX-w,W.minY-w,W.maxX+w,W.maxY+w,function(mt,St,xt,bt){return function(kt,ft,nr,br,Pr){for(var Mn=0,yn=kt;Mn=kr.x&&Pr>=kr.y)return!0}var Ai=[new Le(ft,nr),new Le(ft,Pr),new Le(br,Pr),new Le(br,nr)];if(kt.length>2){for(var $n=0,ti=Ai;$n=0)return!0;return!1}(j,N)){var W=this.sourceLayerCoder.decode(_),$=this.vtLayers[W].feature(S);if(F.needGeometry){var ie=$a($,!0);if(!F.filter(new fa(this.tileID.overscaledZ),ie,this.tileID.canonical))return}else if(!F.filter(new fa(this.tileID.overscaledZ),$))return;for(var pe=this.getId($,W),we=0;weS)F=!1;else if(l)if(this.expirationTimeun&&(i.getActor().send("enforceCacheSizeLimit",eo),wa=0)},M.clamp=Ve,M.clearTileCache=function(i){var l=Ce.caches.delete("mapbox-tiles");i&&l.catch(i).then(function(){return i()})},M.clipLine=Cp,M.clone=function(i){var l=new os(16);return l[0]=i[0],l[1]=i[1],l[2]=i[2],l[3]=i[3],l[4]=i[4],l[5]=i[5],l[6]=i[6],l[7]=i[7],l[8]=i[8],l[9]=i[9],l[10]=i[10],l[11]=i[11],l[12]=i[12],l[13]=i[13],l[14]=i[14],l[15]=i[15],l},M.clone$1=jt,M.clone$2=function(i){var l=new os(3);return l[0]=i[0],l[1]=i[1],l[2]=i[2],l},M.collisionCircleLayout=Pe,M.config=vi,M.create=function(){var i=new os(16);return os!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},M.create$1=function(){var i=new os(9);return os!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[5]=0,i[6]=0,i[7]=0),i[0]=1,i[4]=1,i[8]=1,i},M.create$2=function(){var i=new os(4);return os!=Float32Array&&(i[1]=0,i[2]=0),i[0]=1,i[3]=1,i},M.createCommonjsModule=R,M.createExpression=mp,M.createLayout=Al,M.createStyleLayer=function(i){return i.type==="custom"?new Sd(i):new Up[i.type](i)},M.cross=function(i,l,_){var S=l[0],F=l[1],j=l[2],p=_[0],v=_[1],m=_[2];return i[0]=F*m-j*v,i[1]=j*p-S*m,i[2]=S*v-F*p,i},M.deepEqual=function i(l,_){if(Array.isArray(l)){if(!Array.isArray(_)||l.length!==_.length)return!1;for(var S=0;S0&&(j=1/Math.sqrt(j)),i[0]=l[0]*j,i[1]=l[1]*j,i[2]=l[2]*j,i},M.number=Io,M.offscreenCanvasSupported=dn,M.ortho=function(i,l,_,S,F,j,p){var v=1/(l-_),m=1/(S-F),w=1/(j-p);return i[0]=-2*v,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*m,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*w,i[11]=0,i[12]=(l+_)*v,i[13]=(F+S)*m,i[14]=(p+j)*w,i[15]=1,i},M.parseGlyphPBF=function(i){return new Yr(i).readFields(Ln,[])},M.pbf=Yr,M.performSymbolLayout=function(i,l,_,S,F,j,p){i.createArrays(),i.tilePixelRatio=8192/(512*i.overscaling),i.compareText={},i.iconsNeedLinear=!1;var v=i.layers[0].layout,m=i.layers[0]._unevaluatedLayout._values,w={};if(i.textSizeData.kind==="composite"){var D=i.textSizeData,N=D.maxZoom;w.compositeTextSizes=[m["text-size"].possiblyEvaluate(new fa(D.minZoom),p),m["text-size"].possiblyEvaluate(new fa(N),p)]}if(i.iconSizeData.kind==="composite"){var W=i.iconSizeData,$=W.maxZoom;w.compositeIconSizes=[m["icon-size"].possiblyEvaluate(new fa(W.minZoom),p),m["icon-size"].possiblyEvaluate(new fa($),p)]}w.layoutTextSize=m["text-size"].possiblyEvaluate(new fa(i.zoom+1),p),w.layoutIconSize=m["icon-size"].possiblyEvaluate(new fa(i.zoom+1),p),w.textMaxSize=m["text-size"].possiblyEvaluate(new fa(18));for(var ie=24*v.get("text-line-height"),pe=v.get("text-rotation-alignment")==="map"&&v.get("symbol-placement")!=="point",we=v.get("text-keep-upright"),ke=v.get("text-size"),Ge=function(){var St=mt[ht],xt=v.get("text-font").evaluate(St,{},p).join(","),bt=ke.evaluate(St,{},p),kt=w.layoutTextSize.evaluate(St,{},p),ft=w.layoutIconSize.evaluate(St,{},p),nr={horizontal:{},vertical:void 0},br=St.text,Pr=[0,0];if(br){var Mn=br.toString(),yn=24*v.get("text-letter-spacing").evaluate(St,{},p),kr=function(Eo){for(var Pa=0,na=Eo;Pa=8192||vh.y<0||vh.y>=8192||function(Ys,jl,_h,vc,xp,up,Mh,_c,oc,Ss,Ph,Rh,Nc,Cf,Vp,Mf,md,Pf,Rf,Rp,$c,Vd,Ym,Vf,og){var Pd,jd,pm,Tm,fm,Am=Ys.addToLineVertexArray(jl,_h),Cg=0,Vg=0,Mg=0,$m=0,ag=-1,jp=-1,cp={},dm=tt(""),Vh=0,sg=0;if(_c._unevaluatedLayout.getValue("text-radial-offset")===void 0?(Vh=(Pd=_c.layout.get("text-offset").evaluate($c,{},Vf).map(function(Fm){return 24*Fm}))[0],sg=Pd[1]):(Vh=24*_c.layout.get("text-radial-offset").evaluate($c,{},Vf),sg=Jt),Ys.allowVerticalPlacement&&vc.vertical){var Cm=_c.layout.get("text-rotate").evaluate($c,{},Vf)+90;Tm=new el(oc,jl,Ss,Ph,Rh,vc.vertical,Nc,Cf,Vp,Cm),Mh&&(fm=new el(oc,jl,Ss,Ph,Rh,Mh,md,Pf,Vp,Cm))}if(xp){var Ih=_c.layout.get("icon-rotate").evaluate($c,{}),Hp=_c.layout.get("icon-text-fit")!=="none",Hd=Ft(xp,Ih,Ym,Hp),hf=Mh?Ft(Mh,Ih,Ym,Hp):void 0;pm=new el(oc,jl,Ss,Ph,Rh,xp,md,Pf,!1,Ih),Cg=4*Hd.length;var Gd=Ys.iconSizeData,pf=null;Gd.kind==="source"?(pf=[128*_c.layout.get("icon-size").evaluate($c,{})])[0]>32640&&gr(Ys.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):Gd.kind==="composite"&&((pf=[128*Vd.compositeIconSizes[0].evaluate($c,{},Vf),128*Vd.compositeIconSizes[1].evaluate($c,{},Vf)])[0]>32640||pf[1]>32640)&&gr(Ys.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),Ys.addSymbols(Ys.icon,Hd,pf,Rp,Rf,$c,!1,jl,Am.lineStartIndex,Am.lineLength,-1,Vf),ag=Ys.icon.placedSymbolArray.length-1,hf&&(Vg=4*hf.length,Ys.addSymbols(Ys.icon,hf,pf,Rp,Rf,$c,Wt.vertical,jl,Am.lineStartIndex,Am.lineLength,-1,Vf),jp=Ys.icon.placedSymbolArray.length-1)}for(var h0 in vc.horizontal){var lg=vc.horizontal[h0];if(!jd){dm=tt(lg.text);var av=_c.layout.get("text-rotate").evaluate($c,{},Vf);jd=new el(oc,jl,Ss,Ph,Rh,lg,Nc,Cf,Vp,av)}var jg=lg.positionedLines.length===1;if(Mg+=Mt(Ys,jl,lg,up,_c,Vp,$c,Mf,Am,vc.vertical?Wt.horizontal:Wt.horizontalOnly,jg?Object.keys(vc.horizontal):[h0],cp,ag,Vd,Vf),jg)break}vc.vertical&&($m+=Mt(Ys,jl,vc.vertical,up,_c,Vp,$c,Mf,Am,Wt.vertical,["vertical"],cp,jp,Vd,Vf));var p0=jd?jd.boxStartIndex:Ys.collisionBoxArray.length,f0=jd?jd.boxEndIndex:Ys.collisionBoxArray.length,sv=Tm?Tm.boxStartIndex:Ys.collisionBoxArray.length,lv=Tm?Tm.boxEndIndex:Ys.collisionBoxArray.length,uv=pm?pm.boxStartIndex:Ys.collisionBoxArray.length,cv=pm?pm.boxEndIndex:Ys.collisionBoxArray.length,hv=fm?fm.boxStartIndex:Ys.collisionBoxArray.length,pv=fm?fm.boxEndIndex:Ys.collisionBoxArray.length,Wd=-1,ug=function(Fm,Gg){return Fm&&Fm.circleDiameter?Math.max(Fm.circleDiameter,Gg):Gg};Wd=ug(jd,Wd),Wd=ug(Tm,Wd),Wd=ug(pm,Wd);var Hg=(Wd=ug(fm,Wd))>-1?1:0;Hg&&(Wd*=og/24),Ys.glyphOffsetArray.length>=Fi.MAX_GLYPHS&&gr("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),$c.sortKey!==void 0&&Ys.addToSortKeyRanges(Ys.symbolInstances.length,$c.sortKey),Ys.symbolInstances.emplaceBack(jl.x,jl.y,cp.right>=0?cp.right:-1,cp.center>=0?cp.center:-1,cp.left>=0?cp.left:-1,cp.vertical||-1,ag,jp,dm,p0,f0,sv,lv,uv,cv,hv,pv,Ss,Mg,$m,Cg,Vg,Hg,0,Nc,Vh,sg,Wd)}(Eo,vh,lp,na,ha,Xs,o,Eo.layers[0],Eo.collisionBoxArray,Pa.index,Pa.sourceLayerIndex,Eo.index,X,Me,ot,qs,oe,De,lt,E,Pa,Ls,ua,cu,Ea)};if(Ct==="line")for(var cr=0,Rr=Cp(Pa.geometry,0,0,8192,8192);cr1){var vo=Qo(Ri,Ye,na.vertical||L,ha,24,J);vo&&Er(Ri,vo)}}else if(Pa.type==="Polygon")for(var Ii=0,ni=Kf(Pa.geometry,0);Ii=Ga.maxzoom||Ga.visibility!=="none"&&(Ce(Ho,this.zoom,ge),(mr[Ga.id]=Ga.createBucket({index:Ae.bucketLayerIDs.length,layers:Ho,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Nn,sourceID:this.source})).populate(bn,Sr,this.tileID.canonical),Ae.bucketLayerIDs.push(Ho.map(function(_a){return _a.id})))}}}var Wo=M.mapObject(Sr.glyphDependencies,function(_a){return Object.keys(_a).map(Number)});Object.keys(Wo).length?ye.send("getGlyphs",{uid:this.uid,stacks:Wo},function(_a,$o){Je||(Je=_a,wt=$o,Yo.call(je))}):wt={};var Hl=Object.keys(Sr.iconDependencies);Hl.length?ye.send("getImages",{icons:Hl,source:this.source,tileID:this.tileID,type:"icons"},function(_a,$o){Je||(Je=_a,Ht=$o,Yo.call(je))}):Ht={};var ns=Object.keys(Sr.patternDependencies);function Yo(){if(Je)return ze(Je);if(wt&&Ht&&Fr){var _a=new Le(wt),$o=new M.ImageAtlas(Ht,Fr);for(var Fo in mr){var us=mr[Fo];us instanceof M.SymbolBucket?(Ce(us.layers,this.zoom,ge),M.performSymbolLayout(us,wt,_a.positions,Ht,$o.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):us.hasPattern&&(us instanceof M.LineBucket||us instanceof M.FillBucket||us instanceof M.FillExtrusionBucket)&&(Ce(us.layers,this.zoom,ge),us.addFeatures(Sr,this.tileID.canonical,$o.patternPositions))}this.status="done",ze(null,{buckets:M.values(mr).filter(function(xc){return!xc.isEmpty()}),featureIndex:Ae,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:_a.image,imageAtlas:$o,glyphMap:this.returnDependencies?wt:null,iconMap:this.returnDependencies?Ht:null,glyphPositions:this.returnDependencies?_a.positions:null})}}ns.length?ye.send("getImages",{icons:ns,source:this.source,tileID:this.tileID,type:"patterns"},function(_a,$o){Je||(Je=_a,Fr=$o,Yo.call(je))}):Fr={},Yo.call(this)};var Xe=function(re,le,ge,ye){this.actor=re,this.layerIndex=le,this.availableImages=ge,this.loadVectorData=ye||He,this.loading={},this.loaded={}};Xe.prototype.loadTile=function(re,le){var ge=this,ye=re.uid;this.loading||(this.loading={});var ze=!!(re&&re.request&&re.request.collectResourceTiming)&&new M.RequestPerformance(re.request),je=this.loading[ye]=new Re(re);je.abort=this.loadVectorData(re,function(Ue,Ae){if(delete ge.loading[ye],Ue||!Ae)return je.status="done",ge.loaded[ye]=je,le(Ue);var Je=Ae.rawData,wt={};Ae.expires&&(wt.expires=Ae.expires),Ae.cacheControl&&(wt.cacheControl=Ae.cacheControl);var Ht={};if(ze){var Fr=ze.finish();Fr&&(Ht.resourceTiming=JSON.parse(JSON.stringify(Fr)))}je.vectorTile=Ae.vectorTile,je.parse(Ae.vectorTile,ge.layerIndex,ge.availableImages,ge.actor,function(mr,Sr){if(mr||!Sr)return le(mr);le(null,M.extend({rawTileData:Je.slice(0)},Sr,wt,Ht))}),ge.loaded=ge.loaded||{},ge.loaded[ye]=je})},Xe.prototype.reloadTile=function(re,le){var ge=this,ye=this.loaded,ze=re.uid,je=this;if(ye&&ye[ze]){var Ue=ye[ze];Ue.showCollisionBoxes=re.showCollisionBoxes;var Ae=function(Je,wt){var Ht=Ue.reloadCallback;Ht&&(delete Ue.reloadCallback,Ue.parse(Ue.vectorTile,je.layerIndex,ge.availableImages,je.actor,Ht)),le(Je,wt)};Ue.status==="parsing"?Ue.reloadCallback=Ae:Ue.status==="done"&&(Ue.vectorTile?Ue.parse(Ue.vectorTile,this.layerIndex,this.availableImages,this.actor,Ae):Ae())}},Xe.prototype.abortTile=function(re,le){var ge=this.loading,ye=re.uid;ge&&ge[ye]&&ge[ye].abort&&(ge[ye].abort(),delete ge[ye]),le()},Xe.prototype.removeTile=function(re,le){var ge=this.loaded,ye=re.uid;ge&&ge[ye]&&delete ge[ye],le()};var Ke=M.window.ImageBitmap,Ve=function(){this.loaded={}};function et(re,le){if(re.length!==0){er(re[0],le);for(var ge=1;ge=Math.abs(Ae)?ge-Je+Ae:Ae-Je+ge,ge=Je}ge+ye>=0!=!!le&&re.reverse()}Ve.prototype.loadTile=function(re,le){var ge=re.uid,ye=re.encoding,ze=re.rawImageData,je=Ke&&ze instanceof Ke?this.getImageData(ze):ze,Ue=new M.DEMData(ge,je,ye);this.loaded=this.loaded||{},this.loaded[ge]=Ue,le(null,Ue)},Ve.prototype.getImageData=function(re){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(re.width,re.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=re.width,this.offscreenCanvas.height=re.height,this.offscreenCanvasContext.drawImage(re,0,0,re.width,re.height);var le=this.offscreenCanvasContext.getImageData(-1,-1,re.width+2,re.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new M.RGBAImage({width:le.width,height:le.height},le.data)},Ve.prototype.removeTile=function(re){var le=this.loaded,ge=re.uid;le&&le[ge]&&delete le[ge]};var fr=M.vectorTile.VectorTileFeature.prototype.toGeoJSON,Ar=function(re){this._feature=re,this.extent=M.EXTENT,this.type=re.type,this.properties=re.tags,"id"in re&&!isNaN(re.id)&&(this.id=parseInt(re.id,10))};Ar.prototype.loadGeometry=function(){if(this._feature.type===1){for(var re=[],le=0,ge=this._feature.geometry;le>31}function $e(re,le){for(var ge=re.loadGeometry(),ye=re.type,ze=0,je=0,Ue=ge.length,Ae=0;Ae>1;(function Nn(bn,En,io,On,Ao,ia){for(;Ao>On;){if(Ao-On>600){var Ho=Ao-On+1,Ga=io-On+1,Wo=Math.log(Ho),Hl=.5*Math.exp(2*Wo/3),ns=.5*Math.sqrt(Wo*Hl*(Ho-Hl)/Ho)*(Ga-Ho/2<0?-1:1);Nn(bn,En,io,Math.max(On,Math.floor(io-Ga*Hl/Ho+ns)),Math.min(Ao,Math.floor(io+(Ho-Ga)*Hl/Ho+ns)),ia)}var Yo=En[2*io+ia],_a=On,$o=Ao;for(vt(bn,En,On,io),En[2*Ao+ia]>Yo&&vt(bn,En,On,Ao);_a<$o;){for(vt(bn,En,_a,$o),_a++,$o--;En[2*_a+ia]Yo;)$o--}En[2*On+ia]===Yo?vt(bn,En,On,$o):vt(bn,En,++$o,Ao),$o<=io&&(On=$o+1),io<=$o&&(Ao=$o-1)}})(Ht,Fr,Lr,Sr,fn,xn%2),wt(Ht,Fr,mr,Sr,Lr-1,xn+1),wt(Ht,Fr,mr,Lr+1,fn,xn+1)}})(Ue,Ae,ye,0,Ue.length-1,0)};an.prototype.range=function(re,le,ge,ye){return function(ze,je,Ue,Ae,Je,wt,Ht){for(var Fr,mr,Sr=[0,ze.length-1,0],fn=[];Sr.length;){var xn=Sr.pop(),Lr=Sr.pop(),Nn=Sr.pop();if(Lr-Nn<=Ht)for(var bn=Nn;bn<=Lr;bn++)mr=je[2*bn+1],(Fr=je[2*bn])>=Ue&&Fr<=Je&&mr>=Ae&&mr<=wt&&fn.push(ze[bn]);else{var En=Math.floor((Nn+Lr)/2);mr=je[2*En+1],(Fr=je[2*En])>=Ue&&Fr<=Je&&mr>=Ae&&mr<=wt&&fn.push(ze[En]);var io=(xn+1)%2;(xn===0?Ue<=Fr:Ae<=mr)&&(Sr.push(Nn),Sr.push(En-1),Sr.push(io)),(xn===0?Je>=Fr:wt>=mr)&&(Sr.push(En+1),Sr.push(Lr),Sr.push(io))}}return fn}(this.ids,this.coords,re,le,ge,ye,this.nodeSize)},an.prototype.within=function(re,le,ge){return function(ye,ze,je,Ue,Ae,Je){for(var wt=[0,ye.length-1,0],Ht=[],Fr=Ae*Ae;wt.length;){var mr=wt.pop(),Sr=wt.pop(),fn=wt.pop();if(Sr-fn<=Je)for(var xn=fn;xn<=Sr;xn++)ar(ze[2*xn],ze[2*xn+1],je,Ue)<=Fr&&Ht.push(ye[xn]);else{var Lr=Math.floor((fn+Sr)/2),Nn=ze[2*Lr],bn=ze[2*Lr+1];ar(Nn,bn,je,Ue)<=Fr&&Ht.push(ye[Lr]);var En=(mr+1)%2;(mr===0?je-Ae<=Nn:Ue-Ae<=bn)&&(wt.push(fn),wt.push(Lr-1),wt.push(En)),(mr===0?je+Ae>=Nn:Ue+Ae>=bn)&&(wt.push(Lr+1),wt.push(Sr),wt.push(En))}}return Ht}(this.ids,this.coords,re,le,ge,this.nodeSize)};var yi={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(re){return re}},li=function(re){this.options=qo(Object.create(yi),re),this.trees=new Array(this.options.maxZoom+1)};function Uo(re,le,ge,ye,ze){return{x:re,y:le,zoom:1/0,id:ge,parentId:-1,numPoints:ye,properties:ze}}function vi(re,le){var ge=re.geometry.coordinates,ye=ge[1];return{x:Xi(ge[0]),y:Mi(ye),zoom:1/0,index:le,parentId:-1}}function bo(re){return{type:"Feature",id:re.id,properties:So(re),geometry:{type:"Point",coordinates:[(ye=re.x,360*(ye-.5)),(le=re.y,ge=(180-360*le)*Math.PI/180,360*Math.atan(Math.exp(ge))/Math.PI-90)]}};var le,ge,ye}function So(re){var le=re.numPoints,ge=le>=1e4?Math.round(le/1e3)+"k":le>=1e3?Math.round(le/100)/10+"k":le;return qo(qo({},re.properties),{cluster:!0,cluster_id:re.id,point_count:le,point_count_abbreviated:ge})}function Xi(re){return re/360+.5}function Mi(re){var le=Math.sin(re*Math.PI/180),ge=.5-.25*Math.log((1+le)/(1-le))/Math.PI;return ge<0?0:ge>1?1:ge}function qo(re,le){for(var ge in le)re[ge]=le[ge];return re}function ui(re){return re.x}function Qi(re){return re.y}function Vi(re,le,ge,ye,ze,je){var Ue=ze-ge,Ae=je-ye;if(Ue!==0||Ae!==0){var Je=((re-ge)*Ue+(le-ye)*Ae)/(Ue*Ue+Ae*Ae);Je>1?(ge=ze,ye=je):Je>0&&(ge+=Ue*Je,ye+=Ae*Je)}return(Ue=re-ge)*Ue+(Ae=le-ye)*Ae}function Pi(re,le,ge,ye){var ze={id:re===void 0?null:re,type:le,geometry:ge,tags:ye,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(je){var Ue=je.geometry,Ae=je.type;if(Ae==="Point"||Ae==="MultiPoint"||Ae==="LineString")ds(je,Ue);else if(Ae==="Polygon"||Ae==="MultiLineString")for(var Je=0;Je0&&(Ue+=ye?(ze*wt-Je*je)/2:Math.sqrt(Math.pow(Je-ze,2)+Math.pow(wt-je,2))),ze=Je,je=wt}var Ht=le.length-3;le[2]=1,function Fr(mr,Sr,fn,xn){for(var Lr,Nn=xn,bn=fn-Sr>>1,En=fn-Sr,io=mr[Sr],On=mr[Sr+1],Ao=mr[fn],ia=mr[fn+1],Ho=Sr+3;HoNn)Lr=Ho,Nn=Ga;else if(Ga===Nn){var Wo=Math.abs(Ho-bn);Woxn&&(Lr-Sr>3&&Fr(mr,Sr,Lr,xn),mr[Lr+2]=Nn,fn-Lr>3&&Fr(mr,Lr,fn,xn))}(le,0,Ht,ge),le[Ht+2]=1,le.size=Math.abs(Ue),le.start=0,le.end=le.size}function he(re,le,ge,ye){for(var ze=0;ze1?1:ge}function Ot(re,le,ge,ye,ze,je,Ue,Ae){if(ye/=le,je>=(ge/=le)&&Ue=ye)return null;for(var Je=[],wt=0;wt=ge&&fn=ye)){var xn=[];if(mr==="Point"||mr==="MultiPoint")or(Fr,xn,ge,ye,ze);else if(mr==="LineString")Wr(Fr,xn,ge,ye,ze,!1,Ae.lineMetrics);else if(mr==="MultiLineString")kn(Fr,xn,ge,ye,ze,!1);else if(mr==="Polygon")kn(Fr,xn,ge,ye,ze,!0);else if(mr==="MultiPolygon")for(var Lr=0;Lr=ge&&Ue<=ye&&(le.push(re[je]),le.push(re[je+1]),le.push(re[je+2]))}}function Wr(re,le,ge,ye,ze,je,Ue){for(var Ae,Je,wt=In(re),Ht=ze===0?un:To,Fr=re.start,mr=0;mrge&&(Je=Ht(wt,Sr,fn,Lr,Nn,ge),Ue&&(wt.start=Fr+Ae*Je)):bn>ye?En=ge&&(Je=Ht(wt,Sr,fn,Lr,Nn,ge),io=!0),En>ye&&bn<=ye&&(Je=Ht(wt,Sr,fn,Lr,Nn,ye),io=!0),!je&&io&&(Ue&&(wt.end=Fr+Ae*Je),le.push(wt),wt=In(re)),Ue&&(Fr+=Ae)}var On=re.length-3;Sr=re[On],fn=re[On+1],xn=re[On+2],(bn=ze===0?Sr:fn)>=ge&&bn<=ye&&eo(wt,Sr,fn,xn),On=wt.length-3,je&&On>=3&&(wt[On]!==wt[0]||wt[On+1]!==wt[1])&&eo(wt,wt[0],wt[1],wt[2]),wt.length&&le.push(wt)}function In(re){var le=[];return le.size=re.size,le.start=re.start,le.end=re.end,le}function kn(re,le,ge,ye,ze,je){for(var Ue=0;UeUe.maxX&&(Ue.maxX=Ht),Fr>Ue.maxY&&(Ue.maxY=Fr)}return Ue}function no(re,le,ge,ye){var ze=le.geometry,je=le.type,Ue=[];if(je==="Point"||je==="MultiPoint")for(var Ae=0;Ae0&&le.size<(ze?Ue:ye))ge.numPoints+=le.length/3;else{for(var Ae=[],Je=0;JeUe)&&(ge.numSimplified++,Ae.push(le[Je]),Ae.push(le[Je+1])),ge.numPoints++;ze&&function(wt,Ht){for(var Fr=0,mr=0,Sr=wt.length,fn=Sr-2;mr0===Ht)for(mr=0,Sr=wt.length;mr24)throw new Error("maxZoom should be in the 0-24 range");if(le.promoteId&&le.generateId)throw new Error("promoteId and generateId cannot be used together.");var ye=function(ze,je){var Ue=[];if(ze.type==="FeatureCollection")for(var Ae=0;Ae=ye;wt--){var Ht=+Date.now();Ae=this._cluster(Ae,wt),this.trees[wt]=new an(Ae,ui,Qi,je,Float32Array),ge&&console.log("z%d: %d clusters in %dms",wt,Ae.length,+Date.now()-Ht)}return ge&&console.timeEnd("total time"),this},li.prototype.getClusters=function(re,le){var ge=((re[0]+180)%360+360)%360-180,ye=Math.max(-90,Math.min(90,re[1])),ze=re[2]===180?180:((re[2]+180)%360+360)%360-180,je=Math.max(-90,Math.min(90,re[3]));if(re[2]-re[0]>=360)ge=-180,ze=180;else if(ge>ze){var Ue=this.getClusters([ge,ye,180,je],le),Ae=this.getClusters([-180,ye,ze,je],le);return Ue.concat(Ae)}for(var Je=this.trees[this._limitZoom(le)],wt=[],Ht=0,Fr=Je.range(Xi(ge),Mi(je),Xi(ze),Mi(ye));Htle&&(mr+=xn.numPoints||1)}if(mr>=je){for(var Lr=Je.x*Fr,Nn=Je.y*Fr,bn=ze&&Fr>1?this._map(Je,!0):null,En=(Ae<<5)+(le+1)+this.points.length,io=0,On=Ht;io1)for(var Ho=0,Ga=Ht;Ho>5},li.prototype._getOriginZoom=function(re){return(re-this.points.length)%32},li.prototype._map=function(re,le){if(re.numPoints)return le?qo({},re.properties):re.properties;var ge=this.points[re.index].properties,ye=this.options.map(ge);return le&&ye===ge?qo({},ye):ye},ms.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},ms.prototype.splitTile=function(re,le,ge,ye,ze,je,Ue){for(var Ae=[re,le,ge,ye],Je=this.options,wt=Je.debug;Ae.length;){ye=Ae.pop(),ge=Ae.pop(),le=Ae.pop(),re=Ae.pop();var Ht=1<1&&console.time("creation"),mr=this.tiles[Fr]=co(re,le,ge,ye,Je),this.tileCoords.push({z:le,x:ge,y:ye}),wt)){wt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",le,ge,ye,mr.numFeatures,mr.numPoints,mr.numSimplified),console.timeEnd("creation"));var Sr="z"+le;this.stats[Sr]=(this.stats[Sr]||0)+1,this.total++}if(mr.source=re,ze){if(le===Je.maxZoom||le===ze)continue;var fn=1<1&&console.time("clipping");var xn,Lr,Nn,bn,En,io,On=.5*Je.buffer/Je.extent,Ao=.5-On,ia=.5+On,Ho=1+On;xn=Lr=Nn=bn=null,En=Ot(re,Ht,ge-On,ge+ia,0,mr.minX,mr.maxX,Je),io=Ot(re,Ht,ge+Ao,ge+Ho,0,mr.minX,mr.maxX,Je),re=null,En&&(xn=Ot(En,Ht,ye-On,ye+ia,1,mr.minY,mr.maxY,Je),Lr=Ot(En,Ht,ye+Ao,ye+Ho,1,mr.minY,mr.maxY,Je),En=null),io&&(Nn=Ot(io,Ht,ye-On,ye+ia,1,mr.minY,mr.maxY,Je),bn=Ot(io,Ht,ye+Ao,ye+Ho,1,mr.minY,mr.maxY,Je),io=null),wt>1&&console.timeEnd("clipping"),Ae.push(xn||[],le+1,2*ge,2*ye),Ae.push(Lr||[],le+1,2*ge,2*ye+1),Ae.push(Nn||[],le+1,2*ge+1,2*ye),Ae.push(bn||[],le+1,2*ge+1,2*ye+1)}}},ms.prototype.getTile=function(re,le,ge){var ye=this.options,ze=ye.extent,je=ye.debug;if(re<0||re>24)return null;var Ue=1<1&&console.log("drilling down to z%d-%d-%d",re,le,ge);for(var Je,wt=re,Ht=le,Fr=ge;!Je&&wt>0;)wt--,Ht=Math.floor(Ht/2),Fr=Math.floor(Fr/2),Je=this.tiles[Ji(wt,Ht,Fr)];return Je&&Je.source?(je>1&&console.log("found parent tile z%d-%d-%d",wt,Ht,Fr),je>1&&console.time("drilling down"),this.splitTile(Je.source,wt,Ht,Fr,re,le,ge),je>1&&console.timeEnd("drilling down"),this.tiles[Ae]?wa(this.tiles[Ae],ze):null):null};var Lt=function(re){function le(ge,ye,ze,je){re.call(this,ge,ye,ze,Us),je&&(this.loadGeoJSON=je)}return re&&(le.__proto__=re),(le.prototype=Object.create(re&&re.prototype)).constructor=le,le.prototype.loadData=function(ge,ye){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=ye,this._pendingLoadDataParams=ge,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},le.prototype._loadData=function(){var ge=this;if(this._pendingCallback&&this._pendingLoadDataParams){var ye=this._pendingCallback,ze=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var je=!!(ze&&ze.request&&ze.request.collectResourceTiming)&&new M.RequestPerformance(ze.request);this.loadGeoJSON(ze,function(Ue,Ae){if(Ue||!Ae)return ye(Ue);if(typeof Ae!="object")return ye(new Error("Input data given to '"+ze.source+"' is not a valid GeoJSON object."));(function mr(Sr,fn){var xn,Lr=Sr&&Sr.type;if(Lr==="FeatureCollection")for(xn=0;xn=0?0:h.button},de.remove=function(h){h.parentNode&&h.parentNode.removeChild(h)};var er=function(h){function g(){h.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new M.RGBAImage({width:1,height:1}),this.dirty=!0}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.isLoaded=function(){return this.loaded},g.prototype.setLoaded=function(d){if(this.loaded!==d&&(this.loaded=d,d)){for(var b=0,B=this.requestors;b=0?1.2:1))}function Jn(h,g,d,b,B,G,q){for(var te=0;te65535)fe(new Error("glyphs > 65535 not supported"));else if(Ie.ranges[Qe])fe(null,{stack:ce,id:Te,glyph:Oe});else{var nt=Ie.requests[Qe];nt||(nt=Ie.requests[Qe]=[],pa.loadGlyphRange(ce,Qe,d.url,d.requestManager,function(ct,tt){if(tt){for(var Tt in tt)d._doesCharSupportLocalGlyph(+Tt)||(Ie.glyphs[+Tt]=tt[+Tt]);Ie.ranges[Qe]=!0}for(var Ut=0,Nt=nt;Ut1&&(te=h[++q]);var ce=Math.abs(fe-te.left),Te=Math.abs(fe-te.right),Ie=Math.min(ce,Te),Oe=void 0,Qe=B/d*(b+1);if(te.isDash){var nt=b-Math.abs(Qe);Oe=Math.sqrt(Ie*Ie+nt*nt)}else Oe=b-Math.sqrt(Ie*Ie+Qe*Qe);this.data[G+fe]=Math.max(0,Math.min(255,Oe+128))}},gr.prototype.addRegularDash=function(h){for(var g=h.length-1;g>=0;--g){var d=h[g],b=h[g+1];d.zeroLength?h.splice(g,1):b&&b.isDash===d.isDash&&(b.left=d.left,h.splice(g,1))}var B=h[0],G=h[h.length-1];B.isDash===G.isDash&&(B.left=G.left-this.width,G.right=B.right+this.width);for(var q=this.width*this.nextRow,te=0,fe=h[te],ce=0;ce1&&(fe=h[++te]);var Te=Math.abs(ce-fe.left),Ie=Math.abs(ce-fe.right),Oe=Math.min(Te,Ie);this.data[q+ce]=Math.max(0,Math.min(255,(fe.isDash?Oe:-Oe)+128))}},gr.prototype.addDash=function(h,g){var d=g?7:0,b=2*d+1;if(this.nextRow+b>this.height)return M.warnOnce("LineAtlas out of space"),null;for(var B=0,G=0;G=d&&h.x=b&&h.y0&&(ce[new M.OverscaledTileID(d.overscaledZ,q,b.z,G,b.y-1).key]={backfilled:!1},ce[new M.OverscaledTileID(d.overscaledZ,d.wrap,b.z,b.x,b.y-1).key]={backfilled:!1},ce[new M.OverscaledTileID(d.overscaledZ,fe,b.z,te,b.y-1).key]={backfilled:!1}),b.y+10&&(B.resourceTiming=d._resourceTiming,d._resourceTiming=[]),d.fire(new M.Event("data",B))}})},g.prototype.onAdd=function(d){this.map=d,this.load()},g.prototype.setData=function(d){var b=this;return this._data=d,this.fire(new M.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(B){if(B)b.fire(new M.ErrorEvent(B));else{var G={dataType:"source",sourceDataType:"content"};b._collectResourceTiming&&b._resourceTiming&&b._resourceTiming.length>0&&(G.resourceTiming=b._resourceTiming,b._resourceTiming=[]),b.fire(new M.Event("data",G))}}),this},g.prototype.getClusterExpansionZoom=function(d,b){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:d,source:this.id},b),this},g.prototype.getClusterChildren=function(d,b){return this.actor.send("geojson.getClusterChildren",{clusterId:d,source:this.id},b),this},g.prototype.getClusterLeaves=function(d,b,B,G){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:d,limit:b,offset:B},G),this},g.prototype._updateWorkerData=function(d){var b=this;this._loaded=!1;var B=M.extend({},this.workerOptions),G=this._data;typeof G=="string"?(B.request=this.map._requestManager.transformRequest(M.browser.resolveURL(G),M.ResourceType.Source),B.request.collectResourceTiming=this._collectResourceTiming):B.data=JSON.stringify(G),this.actor.send(this.type+".loadData",B,function(q,te){b._removed||te&&te.abandoned||(b._loaded=!0,te&&te.resourceTiming&&te.resourceTiming[b.id]&&(b._resourceTiming=te.resourceTiming[b.id].slice(0)),b.actor.send(b.type+".coalesce",{source:B.source},null),d(q))})},g.prototype.loaded=function(){return this._loaded},g.prototype.loadTile=function(d,b){var B=this,G=d.actor?"reloadTile":"loadTile";d.actor=this.actor,d.request=this.actor.send(G,{type:this.type,uid:d.uid,tileID:d.tileID,zoom:d.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:M.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},function(q,te){return delete d.request,d.unloadVectorData(),d.aborted?b(null):q?b(q):(d.loadVectorData(te,B.map.painter,G==="reloadTile"),b(null))})},g.prototype.abortTile=function(d){d.request&&(d.request.cancel(),delete d.request),d.aborted=!0},g.prototype.unloadTile=function(d){d.unloadVectorData(),this.actor.send("removeTile",{uid:d.uid,type:this.type,source:this.id})},g.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},g.prototype.serialize=function(){return M.extend({},this._options,{type:this.type,data:this._data})},g.prototype.hasTransition=function(){return!1},g}(M.Evented),rr=M.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),ar=function(h){function g(d,b,B,G){h.call(this),this.id=d,this.dispatcher=B,this.coordinates=b.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(G),this.options=b}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.load=function(d,b){var B=this;this._loaded=!1,this.fire(new M.Event("dataloading",{dataType:"source"})),this.url=this.options.url,M.getImage(this.map._requestManager.transformRequest(this.url,M.ResourceType.Image),function(G,q){B._loaded=!0,G?B.fire(new M.ErrorEvent(G)):q&&(B.image=q,d&&(B.coordinates=d),b&&b(),B._finishLoading())})},g.prototype.loaded=function(){return this._loaded},g.prototype.updateImage=function(d){var b=this;return this.image&&d.url?(this.options.url=d.url,this.load(d.coordinates,function(){b.texture=null}),this):this},g.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new M.Event("data",{dataType:"source",sourceDataType:"metadata"})))},g.prototype.onAdd=function(d){this.map=d,this.load()},g.prototype.setCoordinates=function(d){var b=this;this.coordinates=d;var B=d.map(M.MercatorCoordinate.fromLngLat);this.tileID=function(q){for(var te=1/0,fe=1/0,ce=-1/0,Te=-1/0,Ie=0,Oe=q;Ieb.end(0)?this.fire(new M.ErrorEvent(new M.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+b.start(0)+" and "+b.end(0)+"-second mark."))):this.video.currentTime=d}},g.prototype.getVideo=function(){return this.video},g.prototype.onAdd=function(d){this.map||(this.map=d,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},g.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var d=this.map.painter.context,b=d.gl;for(var B in this.boundsBuffer||(this.boundsBuffer=d.createVertexBuffer(this._boundsArray,rr.members)),this.boundsSegments||(this.boundsSegments=M.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(b.LINEAR,b.CLAMP_TO_EDGE),b.texSubImage2D(b.TEXTURE_2D,0,0,0,b.RGBA,b.UNSIGNED_BYTE,this.video)):(this.texture=new M.Texture(d,this.video,b.RGBA),this.texture.bind(b.LINEAR,b.CLAMP_TO_EDGE)),this.tiles){var G=this.tiles[B];G.state!=="loaded"&&(G.state="loaded",G.texture=this.texture)}}},g.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},g.prototype.hasTransition=function(){return this.video&&!this.video.paused},g}(ar),Cr=function(h){function g(d,b,B,G){h.call(this,d,b,B,G),b.coordinates?Array.isArray(b.coordinates)&&b.coordinates.length===4&&!b.coordinates.some(function(q){return!Array.isArray(q)||q.length!==2||q.some(function(te){return typeof te!="number"})})||this.fire(new M.ErrorEvent(new M.ValidationError("sources."+d,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new M.ErrorEvent(new M.ValidationError("sources."+d,null,'missing required property "coordinates"'))),b.animate&&typeof b.animate!="boolean"&&this.fire(new M.ErrorEvent(new M.ValidationError("sources."+d,null,'optional "animate" property must be a boolean value'))),b.canvas?typeof b.canvas=="string"||b.canvas instanceof M.window.HTMLCanvasElement||this.fire(new M.ErrorEvent(new M.ValidationError("sources."+d,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new M.ErrorEvent(new M.ValidationError("sources."+d,null,'missing required property "canvas"'))),this.options=b,this.animate=b.animate===void 0||b.animate}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof M.window.HTMLCanvasElement?this.options.canvas:M.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new M.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},g.prototype.getCanvas=function(){return this.canvas},g.prototype.onAdd=function(d){this.map=d,this.load(),this.canvas&&this.animate&&this.play()},g.prototype.onRemove=function(){this.pause()},g.prototype.prepare=function(){var d=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,d=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,d=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var b=this.map.painter.context,B=b.gl;for(var G in this.boundsBuffer||(this.boundsBuffer=b.createVertexBuffer(this._boundsArray,rr.members)),this.boundsSegments||(this.boundsSegments=M.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(d||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new M.Texture(b,this.canvas,B.RGBA,{premultiply:!0}),this.tiles){var q=this.tiles[G];q.state!=="loaded"&&(q.state="loaded",q.texture=this.texture)}}},g.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},g.prototype.hasTransition=function(){return this._playing},g.prototype._hasInvalidDimensions=function(){for(var d=0,b=[this.canvas.width,this.canvas.height];dthis.max){var q=this._getAndRemoveByKey(this.order[0]);q&&this.onRemove(q)}return this},vi.prototype.has=function(h){return h.wrapped().key in this.data},vi.prototype.getAndRemove=function(h){return this.has(h)?this._getAndRemoveByKey(h.wrapped().key):null},vi.prototype._getAndRemoveByKey=function(h){var g=this.data[h].shift();return g.timeout&&clearTimeout(g.timeout),this.data[h].length===0&&delete this.data[h],this.order.splice(this.order.indexOf(h),1),g.value},vi.prototype.getByKey=function(h){var g=this.data[h];return g?g[0].value:null},vi.prototype.get=function(h){return this.has(h)?this.data[h.wrapped().key][0].value:null},vi.prototype.remove=function(h,g){if(!this.has(h))return this;var d=h.wrapped().key,b=g===void 0?0:this.data[d].indexOf(g),B=this.data[d][b];return this.data[d].splice(b,1),B.timeout&&clearTimeout(B.timeout),this.data[d].length===0&&delete this.data[d],this.onRemove(B.value),this.order.splice(this.order.indexOf(d),1),this},vi.prototype.setMaxSize=function(h){for(this.max=h;this.order.length>this.max;){var g=this._getAndRemoveByKey(this.order[0]);g&&this.onRemove(g)}return this},vi.prototype.filter=function(h){var g=[];for(var d in this.data)for(var b=0,B=this.data[d];b1||(Math.abs(Te)>1&&(Math.abs(Te+Oe)===1?Te+=Oe:Math.abs(Te-Oe)===1&&(Te-=Oe)),ce.dem&&fe.dem&&(fe.dem.backfillBorder(ce.dem,Te,Ie),fe.neighboringTiles&&fe.neighboringTiles[Qe]&&(fe.neighboringTiles[Qe].backfilled=!0)))}},g.prototype.getTile=function(d){return this.getTileByID(d.key)},g.prototype.getTileByID=function(d){return this._tiles[d]},g.prototype._retainLoadedChildren=function(d,b,B,G){for(var q in this._tiles){var te=this._tiles[q];if(!(G[q]||!te.hasData()||te.tileID.overscaledZ<=b||te.tileID.overscaledZ>B)){for(var fe=te.tileID;te&&te.tileID.overscaledZ>b+1;){var ce=te.tileID.scaledTo(te.tileID.overscaledZ-1);(te=this._tiles[ce.key])&&te.hasData()&&(fe=ce)}for(var Te=fe;Te.overscaledZ>b;)if(d[(Te=Te.scaledTo(Te.overscaledZ-1)).key]){G[fe.key]=fe;break}}}},g.prototype.findLoadedParent=function(d,b){if(d.key in this._loadedParentTiles){var B=this._loadedParentTiles[d.key];return B&&B.tileID.overscaledZ>=b?B:null}for(var G=d.overscaledZ-1;G>=b;G--){var q=d.scaledTo(G),te=this._getLoadedTile(q);if(te)return te}},g.prototype._getLoadedTile=function(d){var b=this._tiles[d.key];return b&&b.hasData()?b:this._cache.getByKey(d.wrapped().key)},g.prototype.updateCacheSize=function(d){var b=Math.ceil(d.width/this._source.tileSize)+1,B=Math.ceil(d.height/this._source.tileSize)+1,G=Math.floor(b*B*5),q=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,G):G;this._cache.setMaxSize(q)},g.prototype.handleWrapJump=function(d){var b=Math.round((d-(this._prevLng===void 0?d:this._prevLng))/360);if(this._prevLng=d,b){var B={};for(var G in this._tiles){var q=this._tiles[G];q.tileID=q.tileID.unwrapTo(q.tileID.wrap+b),B[q.tileID.key]=q}for(var te in this._tiles=B,this._timers)clearTimeout(this._timers[te]),delete this._timers[te];for(var fe in this._tiles)this._setTileReloadTimer(fe,this._tiles[fe])}},g.prototype.update=function(d){var b=this;if(this.transform=d,this._sourceLoaded&&!this._paused){var B;this.updateCacheSize(d),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?B=d.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(Hr){return new M.OverscaledTileID(Hr.canonical.z,Hr.wrap,Hr.canonical.z,Hr.canonical.x,Hr.canonical.y)}):(B=d.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(B=B.filter(function(Hr){return b._source.hasTile(Hr)}))):B=[];var G=d.coveringZoomLevel(this._source),q=Math.max(G-g.maxOverzooming,this._source.minzoom),te=Math.max(G+g.maxUnderzooming,this._source.minzoom),fe=this._updateRetainedTiles(B,G);if(Ht(this._source.type)){for(var ce={},Te={},Ie=0,Oe=Object.keys(fe);Iethis._source.maxzoom){var Tt=ct.children(this._source.maxzoom)[0],Ut=this.getTile(Tt);if(Ut&&Ut.hasData()){B[Tt.key]=Tt;continue}}else{var Nt=ct.children(this._source.maxzoom);if(B[Nt[0].key]&&B[Nt[1].key]&&B[Nt[2].key]&&B[Nt[3].key])continue}for(var pr=tt.wasRequested(),tr=ct.overscaledZ-1;tr>=q;--tr){var Dr=ct.scaledTo(tr);if(G[Dr.key]||(G[Dr.key]=!0,!(tt=this.getTile(Dr))&&pr&&(tt=this._addTile(Dr)),tt&&(B[Dr.key]=Dr,pr=tt.wasRequested(),tt.hasData())))break}}}return B},g.prototype._updateLoadedParentTileCache=function(){for(var d in this._loadedParentTiles={},this._tiles){for(var b=[],B=void 0,G=this._tiles[d].tileID;G.overscaledZ>0;){if(G.key in this._loadedParentTiles){B=this._loadedParentTiles[G.key];break}b.push(G.key);var q=G.scaledTo(G.overscaledZ-1);if(B=this._getLoadedTile(q))break;G=q}for(var te=0,fe=b;te0||(b.hasData()&&b.state!=="reloading"?this._cache.add(b.tileID,b,b.getExpiryTimeout()):(b.aborted=!0,this._abortTile(b),this._unloadTile(b))))},g.prototype.clearTiles=function(){for(var d in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(d);this._cache.reset()},g.prototype.tilesIn=function(d,b,B){var G=this,q=[],te=this.transform;if(!te)return q;for(var fe=B?te.getCameraQueryGeometry(d):d,ce=d.map(function(tr){return te.pointCoordinate(tr)}),Te=fe.map(function(tr){return te.pointCoordinate(tr)}),Ie=this.getIds(),Oe=1/0,Qe=1/0,nt=-1/0,ct=-1/0,tt=0,Tt=Te;tt=0&&Gn[1].y+nn>=0){var di=ce.map(function(Ui){return Hr.getTilePoint(Ui)}),Di=Te.map(function(Ui){return Hr.getTilePoint(Ui)});q.push({tile:Dr,tileID:Hr,queryGeometry:di,cameraQueryGeometry:Di,scale:sn})}}},pr=0;pr=M.browser.now())return!0}return!1},g.prototype.setFeatureState=function(d,b,B){this._state.updateState(d=d||"_geojsonTileLayer",b,B)},g.prototype.removeFeatureState=function(d,b,B){this._state.removeFeatureState(d=d||"_geojsonTileLayer",b,B)},g.prototype.getFeatureState=function(d,b){return this._state.getState(d=d||"_geojsonTileLayer",b)},g.prototype.setDependencies=function(d,b,B){var G=this._tiles[d];G&&G.setDependencies(b,B)},g.prototype.reloadTilesForDependencies=function(d,b){for(var B in this._tiles)this._tiles[B].hasDependency(d,b)&&this._reloadTile(B,"reloading");this._cache.filter(function(G){return!G.hasDependency(d,b)})},g}(M.Evented);function wt(h,g){var d=Math.abs(2*h.wrap)-+(h.wrap<0),b=Math.abs(2*g.wrap)-+(g.wrap<0);return h.overscaledZ-g.overscaledZ||b-d||g.canonical.y-h.canonical.y||g.canonical.x-h.canonical.x}function Ht(h){return h==="raster"||h==="image"||h==="video"}function Fr(){return new M.window.Worker(_e.workerUrl)}Je.maxOverzooming=10,Je.maxUnderzooming=3;var mr="mapboxgl_preloaded_worker_pool",Sr=function(){this.active={}};Sr.prototype.acquire=function(h){if(!this.workers)for(this.workers=[];this.workers.length0?(b-G)/q:0;return this.points[B].mult(1-te).add(this.points[g].mult(te))};var ns=function(h,g,d){var b=this.boxCells=[],B=this.circleCells=[];this.xCellCount=Math.ceil(h/d),this.yCellCount=Math.ceil(g/d);for(var G=0;G=-g[0]&&d<=g[0]&&b>=-g[1]&&b<=g[1]}function xc(h,g,d,b,B,G,q,te){var fe=b?h.textSizeData:h.iconSizeData,ce=M.evaluateSizeForZoom(fe,d.transform.zoom),Te=[256/d.width*2+1,256/d.height*2+1],Ie=b?h.text.dynamicLayoutVertexArray:h.icon.dynamicLayoutVertexArray;Ie.clear();for(var Oe=h.lineVertexArray,Qe=b?h.text.placedSymbolArray:h.icon.placedSymbolArray,nt=d.transform.width/d.transform.height,ct=!1,tt=0;ttMath.abs(d.x-g.x)*b?{useVertical:!0}:(h===M.WritingMode.vertical?g.yd.x)?{needsFlipping:!0}:null}function sc(h,g,d,b,B,G,q,te,fe,ce,Te,Ie,Oe,Qe){var nt,ct=g/24,tt=h.lineOffsetX*ct,Tt=h.lineOffsetY*ct;if(h.numGlyphs>1){var Ut=h.glyphStartIndex+h.numGlyphs,Nt=h.lineStartIndex,pr=h.lineStartIndex+h.lineLength,tr=Ba(ct,te,tt,Tt,d,Te,Ie,h,fe,G,Oe);if(!tr)return{notEnoughRoom:!0};var Dr=$o(tr.first.point,q).point,Hr=$o(tr.last.point,q).point;if(b&&!d){var sn=Fa(h.writingMode,Dr,Hr,Qe);if(sn)return sn}nt=[tr.first];for(var nn=h.glyphStartIndex+1;nn0?Ui.point:Ql(Ie,Di,Gn,1,B),gi=Fa(h.writingMode,Gn,ho,Qe);if(gi)return gi}var Wi=oa(ct*te.getoffsetX(h.glyphStartIndex),tt,Tt,d,Te,Ie,h.segment,h.lineStartIndex,h.lineStartIndex+h.lineLength,fe,G,Oe);if(!Wi)return{notEnoughRoom:!0};nt=[Wi]}for(var Ko=0,Mo=nt;Ko0?1:-1,nt=0;b&&(Qe*=-1,nt=Math.PI),Qe<0&&(nt+=Math.PI);for(var ct=Qe>0?te+q:te+q+1,tt=B,Tt=B,Ut=0,Nt=0,pr=Math.abs(Oe),tr=[];Ut+Nt<=pr;){if((ct+=Qe)=fe)return null;if(Tt=tt,tr.push(tt),(tt=Ie[ct])===void 0){var Dr=new M.Point(ce.getx(ct),ce.gety(ct)),Hr=$o(Dr,Te);if(Hr.signedDistanceFromCamera>0)tt=Ie[ct]=Hr.point;else{var sn=ct-Qe;tt=Ql(Ut===0?G:new M.Point(ce.getx(sn),ce.gety(sn)),Dr,Tt,pr-Ut+1,Te)}}Ut+=Nt,Nt=Tt.dist(tt)}var nn=(pr-Ut)/Nt,Gn=tt.sub(Tt),di=Gn.mult(nn)._add(Tt);di._add(Gn._unit()._perp()._mult(d*Qe));var Di=nt+Math.atan2(tt.y-Tt.y,tt.x-Tt.x);return tr.push(di),{point:di,angle:Di,path:tr}}ns.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},ns.prototype.insert=function(h,g,d,b,B){this._forEachCell(g,d,b,B,this._insertBoxCell,this.boxUid++),this.boxKeys.push(h),this.bboxes.push(g),this.bboxes.push(d),this.bboxes.push(b),this.bboxes.push(B)},ns.prototype.insertCircle=function(h,g,d,b){this._forEachCell(g-b,d-b,g+b,d+b,this._insertCircleCell,this.circleUid++),this.circleKeys.push(h),this.circles.push(g),this.circles.push(d),this.circles.push(b)},ns.prototype._insertBoxCell=function(h,g,d,b,B,G){this.boxCells[B].push(G)},ns.prototype._insertCircleCell=function(h,g,d,b,B,G){this.circleCells[B].push(G)},ns.prototype._query=function(h,g,d,b,B,G){if(d<0||h>this.width||b<0||g>this.height)return!B&&[];var q=[];if(h<=0&&g<=0&&this.width<=d&&this.height<=b){if(B)return!0;for(var te=0;te0:q},ns.prototype._queryCircle=function(h,g,d,b,B){var G=h-d,q=h+d,te=g-d,fe=g+d;if(q<0||G>this.width||fe<0||te>this.height)return!b&&[];var ce=[];return this._forEachCell(G,te,q,fe,this._queryCellCircle,ce,{hitTest:b,circle:{x:h,y:g,radius:d},seenUids:{box:{},circle:{}}},B),b?ce.length>0:ce},ns.prototype.query=function(h,g,d,b,B){return this._query(h,g,d,b,!1,B)},ns.prototype.hitTest=function(h,g,d,b,B){return this._query(h,g,d,b,!0,B)},ns.prototype.hitTestCircle=function(h,g,d,b){return this._queryCircle(h,g,d,!0,b)},ns.prototype._queryCell=function(h,g,d,b,B,G,q,te){var fe=q.seenUids,ce=this.boxCells[B];if(ce!==null)for(var Te=this.bboxes,Ie=0,Oe=ce;Ie=Te[nt+0]&&b>=Te[nt+1]&&(!te||te(this.boxKeys[Qe]))){if(q.hitTest)return G.push(!0),!0;G.push({key:this.boxKeys[Qe],x1:Te[nt],y1:Te[nt+1],x2:Te[nt+2],y2:Te[nt+3]})}}}var ct=this.circleCells[B];if(ct!==null)for(var tt=this.circles,Tt=0,Ut=ct;Ttq*q+te*te},ns.prototype._circleAndRectCollide=function(h,g,d,b,B,G,q){var te=(G-b)/2,fe=Math.abs(h-(b+te));if(fe>te+d)return!1;var ce=(q-B)/2,Te=Math.abs(g-(B+ce));if(Te>ce+d)return!1;if(fe<=te||Te<=ce)return!0;var Ie=fe-te,Oe=Te-ce;return Ie*Ie+Oe*Oe<=d*d};var Zo=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function il(h,g){for(var d=0;d=1;ho--)Ui.push(di.path[ho]);for(var gi=1;gi0){for(var mo=Ui[0].clone(),ko=Ui[0].clone(),xo=1;xo=sn.x&&ko.x<=nn.x&&mo.y>=sn.y&&ko.y<=nn.y?[Ui]:ko.xnn.x||ko.ynn.y?[]:M.clipLine([Ui],sn.x,sn.y,nn.x,nn.y)}for(var qi=0,xs=Mo;qi=this.screenRightBoundary||b<100||g>this.screenBottomBoundary},El.prototype.isInsideGrid=function(h,g,d,b){return d>=0&&h=0&&g0?(this.prevPlacement&&this.prevPlacement.variableOffsets[Ie.crossTileID]&&this.prevPlacement.placements[Ie.crossTileID]&&this.prevPlacement.placements[Ie.crossTileID].text&&(ct=this.prevPlacement.variableOffsets[Ie.crossTileID].anchor),this.variableOffsets[Ie.crossTileID]={textOffset:tt,width:d,height:b,anchor:h,textBoxScale:B,prevAnchor:ct},this.markUsedJustification(Oe,h,Ie,Qe),Oe.allowVerticalPlacement&&(this.markUsedOrientation(Oe,Qe,Ie),this.placedOrientations[Ie.crossTileID]=Qe),{shift:Tt,placedGlyphBoxes:Ut}):void 0},Wl.prototype.placeLayerBucketPart=function(h,g,d){var b=this,B=h.parameters,G=B.bucket,q=B.layout,te=B.posMatrix,fe=B.textLabelPlaneMatrix,ce=B.labelToScreenMatrix,Te=B.textPixelRatio,Ie=B.holdingForFade,Oe=B.collisionBoxArray,Qe=B.partiallyEvaluatedTextSize,nt=B.collisionGroup,ct=q.get("text-optional"),tt=q.get("icon-optional"),Tt=q.get("text-allow-overlap"),Ut=q.get("icon-allow-overlap"),Nt=q.get("text-rotation-alignment")==="map",pr=q.get("text-pitch-alignment")==="map",tr=q.get("icon-text-fit")!=="none",Dr=q.get("symbol-z-order")==="viewport-y",Hr=Tt&&(Ut||!G.hasIconData()||tt),sn=Ut&&(Tt||!G.hasTextData()||ct);!G.collisionArrays&&Oe&&G.deserializeCollisionBoxes(Oe);var nn=function(gi,Wi){if(!g[gi.crossTileID])if(Ie)b.placements[gi.crossTileID]=new gu(!1,!1,!1);else{var Ko,Mo=!1,mo=!1,ko=!0,xo=null,qi={box:null,offscreen:null},xs={box:null,offscreen:null},gs=null,Cl=null,ts=0,ja=0,$a=0;Wi.textFeatureIndex?ts=Wi.textFeatureIndex:gi.useRuntimeCollisionCircles&&(ts=gi.featureIndex),Wi.verticalTextFeatureIndex&&(ja=Wi.verticalTextFeatureIndex);var vs=Wi.textBox;if(vs){var Zl=function(os){var yl=M.WritingMode.horizontal;if(G.allowVerticalPlacement&&!os&&b.prevPlacement){var Ol=b.prevPlacement.placedOrientations[gi.crossTileID];Ol&&(b.placedOrientations[gi.crossTileID]=Ol,b.markUsedOrientation(G,yl=Ol,gi))}return yl},zu=function(os,yl){if(G.allowVerticalPlacement&&gi.numVerticalGlyphVertices>0&&Wi.verticalTextBox)for(var Ol=0,ph=G.writingModes;Ol0&&(Uu=Uu.filter(function(os){return os!==hh.anchor})).unshift(hh.anchor)}var Yc=function(os,yl,Ol){for(var ph=os.x2-os.x1,_f=os.y2-os.y1,ip=gi.textBoxScale,yf=tr&&!Ut?yl:null,Hu={box:[],offscreen:!1},Bp=Tt?2*Uu.length:Uu.length,fc=0;fc=Uu.length,gi,G,Ol,yf);if(Wf&&(Hu=Wf.placedGlyphBoxes)&&Hu.box&&Hu.box.length){Mo=!0,xo=Wf.shift;break}}return Hu};zu(function(){return Yc(vs,Wi.iconBox,M.WritingMode.horizontal)},function(){var os=Wi.verticalTextBox;return G.allowVerticalPlacement&&!(qi&&qi.box&&qi.box.length)&&gi.numVerticalGlyphVertices>0&&os?Yc(os,Wi.verticalIconBox,M.WritingMode.vertical):{box:null,offscreen:null}}),qi&&(Mo=qi.box,ko=qi.offscreen);var np=Zl(qi&&qi.box);if(!Mo&&b.prevPlacement){var pu=b.prevPlacement.variableOffsets[gi.crossTileID];pu&&(b.variableOffsets[gi.crossTileID]=pu,b.markUsedJustification(G,pu.anchor,gi,np))}}else{var Tu=function(os,yl){var Ol=b.collisionIndex.placeCollisionBox(os,Tt,Te,te,nt.predicate);return Ol&&Ol.box&&Ol.box.length&&(b.markUsedOrientation(G,yl,gi),b.placedOrientations[gi.crossTileID]=yl),Ol};zu(function(){return Tu(vs,M.WritingMode.horizontal)},function(){var os=Wi.verticalTextBox;return G.allowVerticalPlacement&&gi.numVerticalGlyphVertices>0&&os?Tu(os,M.WritingMode.vertical):{box:null,offscreen:null}}),Zl(qi&&qi.box&&qi.box.length)}}if(Mo=(Ko=qi)&&Ko.box&&Ko.box.length>0,ko=Ko&&Ko.offscreen,gi.useRuntimeCollisionCircles){var Zu=G.text.placedSymbolArray.get(gi.centerJustifiedTextSymbolIndex),Dl=M.evaluateSizeForFeature(G.textSizeData,Qe,Zu),Vl=q.get("text-padding");gs=b.collisionIndex.placeCollisionCircles(Tt,Zu,G.lineVertexArray,G.glyphOffsetArray,Dl,te,fe,ce,d,pr,nt.predicate,gi.collisionCircleDiameter,Vl),Mo=Tt||gs.circles.length>0&&!gs.collisionDetected,ko=ko&&gs.offscreen}if(Wi.iconFeatureIndex&&($a=Wi.iconFeatureIndex),Wi.iconBox){var Uh=function(os){var yl=tr&&xo?Gl(os,xo.x,xo.y,Nt,pr,b.transform.angle):os;return b.collisionIndex.placeCollisionBox(yl,Ut,Te,te,nt.predicate)};mo=xs&&xs.box&&xs.box.length&&Wi.verticalIconBox?(Cl=Uh(Wi.verticalIconBox)).box.length>0:(Cl=Uh(Wi.iconBox)).box.length>0,ko=ko&&Cl.offscreen}var ml=ct||gi.numHorizontalGlyphVertices===0&&gi.numVerticalGlyphVertices===0,$l=tt||gi.numIconVertices===0;if(ml||$l?$l?ml||(mo=mo&&Mo):Mo=mo&&Mo:mo=Mo=mo&&Mo,Mo&&Ko&&Ko.box&&b.collisionIndex.insertCollisionBox(Ko.box,q.get("text-ignore-placement"),G.bucketInstanceId,xs&&xs.box&&ja?ja:ts,nt.ID),mo&&Cl&&b.collisionIndex.insertCollisionBox(Cl.box,q.get("icon-ignore-placement"),G.bucketInstanceId,$a,nt.ID),gs&&(Mo&&b.collisionIndex.insertCollisionCircles(gs.circles,q.get("text-ignore-placement"),G.bucketInstanceId,ts,nt.ID),d)){var Vu=G.bucketInstanceId,Ws=b.collisionCircleArrays[Vu];Ws===void 0&&(Ws=b.collisionCircleArrays[Vu]=new gl);for(var ju=0;ju=0;--di){var Di=Gn[di];nn(G.symbolInstances.get(Di),G.collisionArrays[Di])}else for(var Ui=h.symbolInstanceStart;Ui=0&&(h.text.placedSymbolArray.get(te).crossTileID=B>=0&&te!==B?0:d.crossTileID)}},Wl.prototype.markUsedOrientation=function(h,g,d){for(var b=g===M.WritingMode.horizontal||g===M.WritingMode.horizontalOnly?g:0,B=g===M.WritingMode.vertical?g:0,G=0,q=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex];G0,sn=b.placedOrientations[Ut.crossTileID],nn=sn===M.WritingMode.vertical,Gn=sn===M.WritingMode.horizontal||sn===M.WritingMode.horizontalOnly;if(Nt>0||pr>0){var di=kl(Dr.text);Qe(h.text,Nt,nn?Il:di),Qe(h.text,pr,Gn?Il:di);var Di=Dr.text.isHidden();[Ut.rightJustifiedTextSymbolIndex,Ut.centerJustifiedTextSymbolIndex,Ut.leftJustifiedTextSymbolIndex].forEach(function(qi){qi>=0&&(h.text.placedSymbolArray.get(qi).hidden=Di||nn?1:0)}),Ut.verticalPlacedTextSymbolIndex>=0&&(h.text.placedSymbolArray.get(Ut.verticalPlacedTextSymbolIndex).hidden=Di||Gn?1:0);var Ui=b.variableOffsets[Ut.crossTileID];Ui&&b.markUsedJustification(h,Ui.anchor,Ut,sn);var ho=b.placedOrientations[Ut.crossTileID];ho&&(b.markUsedJustification(h,"left",Ut,ho),b.markUsedOrientation(h,ho,Ut))}if(Hr){var gi=kl(Dr.icon),Wi=!(Ie&&Ut.verticalPlacedIconSymbolIndex&&nn);Ut.placedIconSymbolIndex>=0&&(Qe(h.icon,Ut.numIconVertices,Wi?gi:Il),h.icon.placedSymbolArray.get(Ut.placedIconSymbolIndex).hidden=Dr.icon.isHidden()),Ut.verticalPlacedIconSymbolIndex>=0&&(Qe(h.icon,Ut.numVerticalIconVertices,Wi?Il:gi),h.icon.placedSymbolArray.get(Ut.verticalPlacedIconSymbolIndex).hidden=Dr.icon.isHidden())}if(h.hasIconCollisionBoxData()||h.hasTextCollisionBoxData()){var Ko=h.collisionArrays[Tt];if(Ko){var Mo=new M.Point(0,0);if(Ko.textBox||Ko.verticalTextBox){var mo=!0;if(fe){var ko=b.variableOffsets[tr];ko?(Mo=Qa(ko.anchor,ko.width,ko.height,ko.textOffset,ko.textBoxScale),ce&&Mo._rotate(Te?b.transform.angle:-b.transform.angle)):mo=!1}Ko.textBox&&ut(h.textCollisionBox.collisionVertexArray,Dr.text.placed,!mo||nn,Mo.x,Mo.y),Ko.verticalTextBox&&ut(h.textCollisionBox.collisionVertexArray,Dr.text.placed,!mo||Gn,Mo.x,Mo.y)}var xo=!!(!Gn&&Ko.verticalIconBox);Ko.iconBox&&ut(h.iconCollisionBox.collisionVertexArray,Dr.icon.placed,xo,Ie?Mo.x:0,Ie?Mo.y:0),Ko.verticalIconBox&&ut(h.iconCollisionBox.collisionVertexArray,Dr.icon.placed,!xo,Ie?Mo.x:0,Ie?Mo.y:0)}}},ct=0;cth},Wl.prototype.setStale=function(){this.stale=!0};var At=Math.pow(2,25),ir=Math.pow(2,24),jr=Math.pow(2,17),Dn=Math.pow(2,16),oo=Math.pow(2,9),Xa=Math.pow(2,8),mn=Math.pow(2,1);function kl(h){if(h.opacity===0&&!h.placed)return 0;if(h.opacity===1&&h.placed)return 4294967295;var g=h.placed?1:0,d=Math.floor(127*h.opacity);return d*At+g*ir+d*jr+g*Dn+d*oo+g*Xa+d*mn+g}var Il=0,Ia=function(h){this._sortAcrossTiles=h.layout.get("symbol-z-order")!=="viewport-y"&&h.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Ia.prototype.continuePlacement=function(h,g,d,b,B){for(var G=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var q=g[h[this._currentPlacementIndex]],te=this.placement.collisionIndex.transform.zoom;if(q.type==="symbol"&&(!q.minzoom||q.minzoom<=te)&&(!q.maxzoom||q.maxzoom>te)){if(this._inProgressLayer||(this._inProgressLayer=new Ia(q)),this._inProgressLayer.continuePlacement(d[q.source],this.placement,this._showCollisionBoxes,q,G))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Xh.prototype.commit=function(h){return this.placement.commit(h),this.placement};var Sl=512/M.EXTENT/2,Va=function(h,g,d){this.tileID=h,this.indexedSymbolInstances={},this.bucketInstanceId=d;for(var b=0;bh.overscaledZ)for(var te in q){var fe=q[te];fe.tileID.isChildOf(h)&&fe.findMatches(g.symbolInstances,h,B)}else{var ce=q[h.scaledTo(Number(G)).key];ce&&ce.findMatches(g.symbolInstances,h,B)}}for(var Te=0;Te1?"@2x":"",Ie=M.getJSON(G.transformRequest(G.normalizeSpriteURL(B,Te,".json"),M.ResourceType.SpriteJSON),function(nt,ct){Ie=null,ce||(ce=nt,te=ct,Qe())}),Oe=M.getImage(G.transformRequest(G.normalizeSpriteURL(B,Te,".png"),M.ResourceType.SpriteImage),function(nt,ct){Oe=null,ce||(ce=nt,fe=ct,Qe())});function Qe(){if(ce)q(ce);else if(te&&fe){var nt=M.browser.getImageData(fe),ct={};for(var tt in te){var Tt=te[tt],Ut=Tt.width,Nt=Tt.height,pr=Tt.x,tr=Tt.y,Dr=Tt.sdf,Hr=Tt.pixelRatio,sn=Tt.stretchX,nn=Tt.stretchY,Gn=Tt.content,di=new M.RGBAImage({width:Ut,height:Nt});M.RGBAImage.copy(nt,di,{x:pr,y:tr},{x:0,y:0},{width:Ut,height:Nt}),ct[tt]={data:di,pixelRatio:Hr,sdf:Dr,stretchX:sn,stretchY:nn,content:Gn}}q(null,ct)}}return{cancel:function(){Ie&&(Ie.cancel(),Ie=null),Oe&&(Oe.cancel(),Oe=null)}}}(d,this.map._requestManager,function(B,G){if(b._spriteRequest=null,B)b.fire(new M.ErrorEvent(B));else if(G)for(var q in G)b.imageManager.addImage(q,G[q]);b.imageManager.setLoaded(!0),b._availableImages=b.imageManager.listImages(),b.dispatcher.broadcast("setImages",b._availableImages),b.fire(new M.Event("data",{dataType:"style"}))})},g.prototype._validateLayer=function(d){var b=this.sourceCaches[d.source];if(b){var B=d.sourceLayer;if(B){var G=b.getSource();(G.type==="geojson"||G.vectorLayerIds&&G.vectorLayerIds.indexOf(B)===-1)&&this.fire(new M.ErrorEvent(new Error('Source layer "'+B+'" does not exist on source "'+G.id+'" as specified by style layer "'+d.id+'"')))}}},g.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var d in this.sourceCaches)if(!this.sourceCaches[d].loaded())return!1;return!!this.imageManager.isLoaded()},g.prototype._serializeLayers=function(d){for(var b=[],B=0,G=d;B0)throw new Error("Unimplemented: "+G.map(function(q){return q.command}).join(", ")+".");return B.forEach(function(q){q.command!=="setTransition"&&b[q.command].apply(b,q.args)}),this.stylesheet=d,!0},g.prototype.addImage=function(d,b){if(this.getImage(d))return this.fire(new M.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(d,b),this._afterImageUpdated(d)},g.prototype.updateImage=function(d,b){this.imageManager.updateImage(d,b)},g.prototype.getImage=function(d){return this.imageManager.getImage(d)},g.prototype.removeImage=function(d){if(!this.getImage(d))return this.fire(new M.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(d),this._afterImageUpdated(d)},g.prototype._afterImageUpdated=function(d){this._availableImages=this.imageManager.listImages(),this._changedImages[d]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new M.Event("data",{dataType:"style"}))},g.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},g.prototype.addSource=function(d,b,B){var G=this;if(B===void 0&&(B={}),this._checkLoaded(),this.sourceCaches[d]!==void 0)throw new Error("There is already a source with this ID");if(!b.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(b).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(b.type)>=0&&this._validate(M.validateStyle.source,"sources."+d,b,null,B))){this.map&&this.map._collectResourceTiming&&(b.collectResourceTiming=!0);var q=this.sourceCaches[d]=new Je(d,b,this.dispatcher);q.style=this,q.setEventedParent(this,function(){return{isSourceLoaded:G.loaded(),source:q.serialize(),sourceId:d}}),q.onAdd(this.map),this._changed=!0}},g.prototype.removeSource=function(d){if(this._checkLoaded(),this.sourceCaches[d]===void 0)throw new Error("There is no source with this ID");for(var b in this._layers)if(this._layers[b].source===d)return this.fire(new M.ErrorEvent(new Error('Source "'+d+'" cannot be removed while layer "'+b+'" is using it.')));var B=this.sourceCaches[d];delete this.sourceCaches[d],delete this._updatedSources[d],B.fire(new M.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:d})),B.setEventedParent(null),B.clearTiles(),B.onRemove&&B.onRemove(this.map),this._changed=!0},g.prototype.setGeoJSONSourceData=function(d,b){this._checkLoaded(),this.sourceCaches[d].getSource().setData(b),this._changed=!0},g.prototype.getSource=function(d){return this.sourceCaches[d]&&this.sourceCaches[d].getSource()},g.prototype.addLayer=function(d,b,B){B===void 0&&(B={}),this._checkLoaded();var G=d.id;if(this.getLayer(G))this.fire(new M.ErrorEvent(new Error('Layer with id "'+G+'" already exists on this map')));else{var q;if(d.type==="custom"){if(Ku(this,M.validateCustomStyleLayer(d)))return;q=M.createStyleLayer(d)}else{if(typeof d.source=="object"&&(this.addSource(G,d.source),d=M.clone$1(d),d=M.extend(d,{source:G})),this._validate(M.validateStyle.layer,"layers."+G,d,{arrayIndex:-1},B))return;q=M.createStyleLayer(d),this._validateLayer(q),q.setEventedParent(this,{layer:{id:G}}),this._serializedLayers[q.id]=q.serialize()}var te=b?this._order.indexOf(b):this._order.length;if(b&&te===-1)this.fire(new M.ErrorEvent(new Error('Layer with id "'+b+'" does not exist on this map.')));else{if(this._order.splice(te,0,G),this._layerOrderChanged=!0,this._layers[G]=q,this._removedLayers[G]&&q.source&&q.type!=="custom"){var fe=this._removedLayers[G];delete this._removedLayers[G],fe.type!==q.type?this._updatedSources[q.source]="clear":(this._updatedSources[q.source]="reload",this.sourceCaches[q.source].pause())}this._updateLayer(q),q.onAdd&&q.onAdd(this.map)}}},g.prototype.moveLayer=function(d,b){if(this._checkLoaded(),this._changed=!0,this._layers[d]){if(d!==b){var B=this._order.indexOf(d);this._order.splice(B,1);var G=b?this._order.indexOf(b):this._order.length;b&&G===-1?this.fire(new M.ErrorEvent(new Error('Layer with id "'+b+'" does not exist on this map.'))):(this._order.splice(G,0,d),this._layerOrderChanged=!0)}}else this.fire(new M.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be moved.")))},g.prototype.removeLayer=function(d){this._checkLoaded();var b=this._layers[d];if(b){b.setEventedParent(null);var B=this._order.indexOf(d);this._order.splice(B,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[d]=b,delete this._layers[d],delete this._serializedLayers[d],delete this._updatedLayers[d],delete this._updatedPaintProps[d],b.onRemove&&b.onRemove(this.map)}else this.fire(new M.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be removed.")))},g.prototype.getLayer=function(d){return this._layers[d]},g.prototype.hasLayer=function(d){return d in this._layers},g.prototype.setLayerZoomRange=function(d,b,B){this._checkLoaded();var G=this.getLayer(d);G?G.minzoom===b&&G.maxzoom===B||(b!=null&&(G.minzoom=b),B!=null&&(G.maxzoom=B),this._updateLayer(G)):this.fire(new M.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot have zoom extent.")))},g.prototype.setFilter=function(d,b,B){B===void 0&&(B={}),this._checkLoaded();var G=this.getLayer(d);if(G){if(!M.deepEqual(G.filter,b))return b==null?(G.filter=void 0,void this._updateLayer(G)):void(this._validate(M.validateStyle.filter,"layers."+G.id+".filter",b,null,B)||(G.filter=M.clone$1(b),this._updateLayer(G)))}else this.fire(new M.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be filtered.")))},g.prototype.getFilter=function(d){return M.clone$1(this.getLayer(d).filter)},g.prototype.setLayoutProperty=function(d,b,B,G){G===void 0&&(G={}),this._checkLoaded();var q=this.getLayer(d);q?M.deepEqual(q.getLayoutProperty(b),B)||(q.setLayoutProperty(b,B,G),this._updateLayer(q)):this.fire(new M.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be styled.")))},g.prototype.getLayoutProperty=function(d,b){var B=this.getLayer(d);if(B)return B.getLayoutProperty(b);this.fire(new M.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style.")))},g.prototype.setPaintProperty=function(d,b,B,G){G===void 0&&(G={}),this._checkLoaded();var q=this.getLayer(d);q?M.deepEqual(q.getPaintProperty(b),B)||(q.setPaintProperty(b,B,G)&&this._updateLayer(q),this._changed=!0,this._updatedPaintProps[d]=!0):this.fire(new M.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be styled.")))},g.prototype.getPaintProperty=function(d,b){return this.getLayer(d).getPaintProperty(b)},g.prototype.setFeatureState=function(d,b){this._checkLoaded();var B=d.source,G=d.sourceLayer,q=this.sourceCaches[B];if(q!==void 0){var te=q.getSource().type;te==="geojson"&&G?this.fire(new M.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):te!=="vector"||G?(d.id===void 0&&this.fire(new M.ErrorEvent(new Error("The feature id parameter must be provided."))),q.setFeatureState(G,d.id,b)):this.fire(new M.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new M.ErrorEvent(new Error("The source '"+B+"' does not exist in the map's style.")))},g.prototype.removeFeatureState=function(d,b){this._checkLoaded();var B=d.source,G=this.sourceCaches[B];if(G!==void 0){var q=G.getSource().type,te=q==="vector"?d.sourceLayer:void 0;q!=="vector"||te?b&&typeof d.id!="string"&&typeof d.id!="number"?this.fire(new M.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):G.removeFeatureState(te,d.id,b):this.fire(new M.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new M.ErrorEvent(new Error("The source '"+B+"' does not exist in the map's style.")))},g.prototype.getFeatureState=function(d){this._checkLoaded();var b=d.source,B=d.sourceLayer,G=this.sourceCaches[b];if(G!==void 0){if(G.getSource().type!=="vector"||B)return d.id===void 0&&this.fire(new M.ErrorEvent(new Error("The feature id parameter must be provided."))),G.getFeatureState(B,d.id);this.fire(new M.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new M.ErrorEvent(new Error("The source '"+b+"' does not exist in the map's style.")))},g.prototype.getTransition=function(){return M.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},g.prototype.serialize=function(){return M.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:M.mapObject(this.sourceCaches,function(d){return d.serialize()}),layers:this._serializeLayers(this._order)},function(d){return d!==void 0})},g.prototype._updateLayer=function(d){this._updatedLayers[d.id]=!0,d.source&&!this._updatedSources[d.source]&&this.sourceCaches[d.source].getSource().type!=="raster"&&(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause()),this._changed=!0},g.prototype._flattenAndSortRenderedFeatures=function(d){for(var b=this,B=function(sn){return b._layers[sn].type==="fill-extrusion"},G={},q=[],te=this._order.length-1;te>=0;te--){var fe=this._order[te];if(B(fe)){G[fe]=te;for(var ce=0,Te=d;ce=0;ct--){var tt=this._order[ct];if(B(tt))for(var Tt=q.length-1;Tt>=0;Tt--){var Ut=q[Tt].feature;if(G[Ut.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Lp=Ps("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),gf=Ps("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),Of=Ps(`#pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity gl_FragColor=color*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec2 a_pos;uniform mat4 u_matrix; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity gl_Position=u_matrix*vec4(a_pos,0,1);}`),qh=Ps(`varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),zc=Ps(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),Oh=Ps(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),Ms=Ps(`varying vec4 v_color;void main() {gl_FragColor=v_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color; #pragma mapbox: define highp float base #pragma mapbox: define highp float height #pragma mapbox: define highp vec4 color void main() { #pragma mapbox: initialize highp float base #pragma mapbox: initialize highp float height #pragma mapbox: initialize highp vec4 color vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),Jc=Ps(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float base #pragma mapbox: initialize lowp float height #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float base #pragma mapbox: initialize lowp float height #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 ? a_pos : vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),Yh=Ps(`#ifdef GL_ES precision highp float; #endif uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),Qc=Ps(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; #define PI 3.141592653589793 void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),uc=Ps(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),eh=Ps(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),yh=Ps(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float gapwidth #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),sl=Ps(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),Uc=Ps(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),bc=Ps(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`),fp=Ps(`#define SDF_PX 8.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),dp=Ps(`#define SDF_PX 8.0 #define SDF 1.0 #define ICON 0.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`);function Ps(h,g){var d=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,b=g.match(/attribute ([\w]+) ([\w]+)/g),B=h.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),G=g.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),q=G?G.concat(B):B,te={};return{fragmentSource:h=h.replace(d,function(fe,ce,Te,Ie,Oe){return te[Oe]=!0,ce==="define"?` #ifndef HAS_UNIFORM_u_`+Oe+` varying `+Te+" "+Ie+" "+Oe+`; #else uniform `+Te+" "+Ie+" u_"+Oe+`; #endif `:` #ifdef HAS_UNIFORM_u_`+Oe+` `+Te+" "+Ie+" "+Oe+" = u_"+Oe+`; #endif `}),vertexSource:g=g.replace(d,function(fe,ce,Te,Ie,Oe){var Qe=Ie==="float"?"vec2":"vec4",nt=Oe.match(/color/)?"color":Qe;return te[Oe]?ce==="define"?` #ifndef HAS_UNIFORM_u_`+Oe+` uniform lowp float u_`+Oe+`_t; attribute `+Te+" "+Qe+" a_"+Oe+`; varying `+Te+" "+Ie+" "+Oe+`; #else uniform `+Te+" "+Ie+" u_"+Oe+`; #endif `:nt==="vec4"?` #ifndef HAS_UNIFORM_u_`+Oe+` `+Oe+" = a_"+Oe+`; #else `+Te+" "+Ie+" "+Oe+" = u_"+Oe+`; #endif `:` #ifndef HAS_UNIFORM_u_`+Oe+` `+Oe+" = unpack_mix_"+nt+"(a_"+Oe+", u_"+Oe+`_t); #else `+Te+" "+Ie+" "+Oe+" = u_"+Oe+`; #endif `:ce==="define"?` #ifndef HAS_UNIFORM_u_`+Oe+` uniform lowp float u_`+Oe+`_t; attribute `+Te+" "+Qe+" a_"+Oe+`; #else uniform `+Te+" "+Ie+" u_"+Oe+`; #endif `:nt==="vec4"?` #ifndef HAS_UNIFORM_u_`+Oe+` `+Te+" "+Ie+" "+Oe+" = a_"+Oe+`; #else `+Te+" "+Ie+" "+Oe+" = u_"+Oe+`; #endif `:` #ifndef HAS_UNIFORM_u_`+Oe+` `+Te+" "+Ie+" "+Oe+" = unpack_mix_"+nt+"(a_"+Oe+", u_"+Oe+`_t); #else `+Te+" "+Ie+" "+Oe+" = u_"+Oe+`; #endif `}),staticAttributes:b,staticUniforms:q}}var Gf=Object.freeze({__proto__:null,prelude:eu,background:Tl,backgroundPattern:Fu,circle:Ju,clippingMask:al,heatmap:Kc,heatmapTexture:ou,collisionBox:Ks,collisionCircle:Lp,debug:gf,fill:Of,fillOutline:qh,fillOutlinePattern:zc,fillPattern:Oh,fillExtrusion:Ms,fillExtrusionPattern:Jc,hillshadePrepare:Yh,hillshade:Qc,line:uc,lineGradient:eh,linePattern:yh,lineSDF:sl,raster:Uc,symbolIcon:bc,symbolSDF:fp,symbolTextAndIcon:dp}),Xp=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function cc(h){for(var g=[],d=0;d>16,te>>16],u_pixel_coord_lower:[65535&q,65535&te]}}zl.prototype.draw=function(h,g,d,b,B,G,q,te,fe,ce,Te,Ie,Oe,Qe,nt,ct){var tt,Tt=h.gl;if(!this.failedToCreate){for(var Ut in h.program.set(this.program),h.setDepthMode(d),h.setStencilMode(b),h.setColorMode(B),h.setCullFace(G),this.fixedUniforms)this.fixedUniforms[Ut].set(q[Ut]);Qe&&Qe.setUniforms(h,this.binderUniforms,Ie,{zoom:Oe});for(var Nt=(tt={},tt[Tt.LINES]=2,tt[Tt.TRIANGLES]=3,tt[Tt.LINE_STRIP]=1,tt)[g],pr=0,tr=Te.get();pr0?1-1/(1.001-q):-q),u_contrast_factor:(G=B.paint.get("raster-contrast"),G>0?1/(1-G):1+G),u_spin_weights:au(B.paint.get("raster-hue-rotate"))};var G,q};function au(h){h*=Math.PI/180;var g=Math.sin(h),d=Math.cos(h);return[(2*d+1)/3,(-Math.sqrt(3)*g-d+1)/3,(Math.sqrt(3)*g-d+1)/3]}var dl,tc=function(h,g,d,b,B,G,q,te,fe,ce){var Te=B.transform;return{u_is_size_zoom_constant:+(h==="constant"||h==="source"),u_is_size_feature_constant:+(h==="constant"||h==="camera"),u_size_t:g?g.uSizeT:0,u_size:g?g.uSize:0,u_camera_to_center_distance:Te.cameraToCenterDistance,u_pitch:Te.pitch/360*2*Math.PI,u_rotate_symbol:+d,u_aspect_ratio:Te.width/Te.height,u_fade_change:B.options.fadeDuration?B.symbolFadeChange:1,u_matrix:G,u_label_plane_matrix:q,u_coord_matrix:te,u_is_text:+fe,u_pitch_with_map:+b,u_texsize:ce,u_texture:0}},bh=function(h,g,d,b,B,G,q,te,fe,ce,Te){var Ie=B.transform;return M.extend(tc(h,g,d,b,B,G,q,te,fe,ce),{u_gamma_scale:b?Math.cos(Ie._pitch)*Ie.cameraToCenterDistance:1,u_device_pixel_ratio:M.browser.devicePixelRatio,u_is_halo:+Te})},mp=function(h,g,d,b,B,G,q,te,fe,ce){return M.extend(bh(h,g,d,b,B,G,q,te,!0,fe,!0),{u_texsize_icon:ce,u_texture_icon:1})},Kh=function(h,g,d){return{u_matrix:h,u_opacity:g,u_color:d}},Zc=function(h,g,d,b,B,G){return M.extend(function(q,te,fe,ce){var Te=fe.imageManager.getPattern(q.from.toString()),Ie=fe.imageManager.getPattern(q.to.toString()),Oe=fe.imageManager.getPixelSize(),Qe=Oe.width,nt=Oe.height,ct=Math.pow(2,ce.tileID.overscaledZ),tt=ce.tileSize*Math.pow(2,fe.transform.tileZoom)/ct,Tt=tt*(ce.tileID.canonical.x+ce.tileID.wrap*ct),Ut=tt*ce.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Te.tl,u_pattern_br_a:Te.br,u_pattern_tl_b:Ie.tl,u_pattern_br_b:Ie.br,u_texsize:[Qe,nt],u_mix:te.t,u_pattern_size_a:Te.displaySize,u_pattern_size_b:Ie.displaySize,u_scale_a:te.fromScale,u_scale_b:te.toScale,u_tile_units_to_pixels:1/Wa(ce,1,fe.transform.tileZoom),u_pixel_coord_upper:[Tt>>16,Ut>>16],u_pixel_coord_lower:[65535&Tt,65535&Ut]}}(b,G,d,B),{u_matrix:h,u_opacity:g})},vf={fillExtrusion:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_lightpos:new M.Uniform3f(h,g.u_lightpos),u_lightintensity:new M.Uniform1f(h,g.u_lightintensity),u_lightcolor:new M.Uniform3f(h,g.u_lightcolor),u_vertical_gradient:new M.Uniform1f(h,g.u_vertical_gradient),u_opacity:new M.Uniform1f(h,g.u_opacity)}},fillExtrusionPattern:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_lightpos:new M.Uniform3f(h,g.u_lightpos),u_lightintensity:new M.Uniform1f(h,g.u_lightintensity),u_lightcolor:new M.Uniform3f(h,g.u_lightcolor),u_vertical_gradient:new M.Uniform1f(h,g.u_vertical_gradient),u_height_factor:new M.Uniform1f(h,g.u_height_factor),u_image:new M.Uniform1i(h,g.u_image),u_texsize:new M.Uniform2f(h,g.u_texsize),u_pixel_coord_upper:new M.Uniform2f(h,g.u_pixel_coord_upper),u_pixel_coord_lower:new M.Uniform2f(h,g.u_pixel_coord_lower),u_scale:new M.Uniform3f(h,g.u_scale),u_fade:new M.Uniform1f(h,g.u_fade),u_opacity:new M.Uniform1f(h,g.u_opacity)}},fill:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix)}},fillPattern:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_image:new M.Uniform1i(h,g.u_image),u_texsize:new M.Uniform2f(h,g.u_texsize),u_pixel_coord_upper:new M.Uniform2f(h,g.u_pixel_coord_upper),u_pixel_coord_lower:new M.Uniform2f(h,g.u_pixel_coord_lower),u_scale:new M.Uniform3f(h,g.u_scale),u_fade:new M.Uniform1f(h,g.u_fade)}},fillOutline:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_world:new M.Uniform2f(h,g.u_world)}},fillOutlinePattern:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_world:new M.Uniform2f(h,g.u_world),u_image:new M.Uniform1i(h,g.u_image),u_texsize:new M.Uniform2f(h,g.u_texsize),u_pixel_coord_upper:new M.Uniform2f(h,g.u_pixel_coord_upper),u_pixel_coord_lower:new M.Uniform2f(h,g.u_pixel_coord_lower),u_scale:new M.Uniform3f(h,g.u_scale),u_fade:new M.Uniform1f(h,g.u_fade)}},circle:function(h,g){return{u_camera_to_center_distance:new M.Uniform1f(h,g.u_camera_to_center_distance),u_scale_with_map:new M.Uniform1i(h,g.u_scale_with_map),u_pitch_with_map:new M.Uniform1i(h,g.u_pitch_with_map),u_extrude_scale:new M.Uniform2f(h,g.u_extrude_scale),u_device_pixel_ratio:new M.Uniform1f(h,g.u_device_pixel_ratio),u_matrix:new M.UniformMatrix4f(h,g.u_matrix)}},collisionBox:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_camera_to_center_distance:new M.Uniform1f(h,g.u_camera_to_center_distance),u_pixels_to_tile_units:new M.Uniform1f(h,g.u_pixels_to_tile_units),u_extrude_scale:new M.Uniform2f(h,g.u_extrude_scale),u_overscale_factor:new M.Uniform1f(h,g.u_overscale_factor)}},collisionCircle:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_inv_matrix:new M.UniformMatrix4f(h,g.u_inv_matrix),u_camera_to_center_distance:new M.Uniform1f(h,g.u_camera_to_center_distance),u_viewport_size:new M.Uniform2f(h,g.u_viewport_size)}},debug:function(h,g){return{u_color:new M.UniformColor(h,g.u_color),u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_overlay:new M.Uniform1i(h,g.u_overlay),u_overlay_scale:new M.Uniform1f(h,g.u_overlay_scale)}},clippingMask:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix)}},heatmap:function(h,g){return{u_extrude_scale:new M.Uniform1f(h,g.u_extrude_scale),u_intensity:new M.Uniform1f(h,g.u_intensity),u_matrix:new M.UniformMatrix4f(h,g.u_matrix)}},heatmapTexture:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_world:new M.Uniform2f(h,g.u_world),u_image:new M.Uniform1i(h,g.u_image),u_color_ramp:new M.Uniform1i(h,g.u_color_ramp),u_opacity:new M.Uniform1f(h,g.u_opacity)}},hillshade:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_image:new M.Uniform1i(h,g.u_image),u_latrange:new M.Uniform2f(h,g.u_latrange),u_light:new M.Uniform2f(h,g.u_light),u_shadow:new M.UniformColor(h,g.u_shadow),u_highlight:new M.UniformColor(h,g.u_highlight),u_accent:new M.UniformColor(h,g.u_accent)}},hillshadePrepare:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_image:new M.Uniform1i(h,g.u_image),u_dimension:new M.Uniform2f(h,g.u_dimension),u_zoom:new M.Uniform1f(h,g.u_zoom),u_unpack:new M.Uniform4f(h,g.u_unpack)}},line:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_ratio:new M.Uniform1f(h,g.u_ratio),u_device_pixel_ratio:new M.Uniform1f(h,g.u_device_pixel_ratio),u_units_to_pixels:new M.Uniform2f(h,g.u_units_to_pixels)}},lineGradient:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_ratio:new M.Uniform1f(h,g.u_ratio),u_device_pixel_ratio:new M.Uniform1f(h,g.u_device_pixel_ratio),u_units_to_pixels:new M.Uniform2f(h,g.u_units_to_pixels),u_image:new M.Uniform1i(h,g.u_image),u_image_height:new M.Uniform1f(h,g.u_image_height)}},linePattern:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_texsize:new M.Uniform2f(h,g.u_texsize),u_ratio:new M.Uniform1f(h,g.u_ratio),u_device_pixel_ratio:new M.Uniform1f(h,g.u_device_pixel_ratio),u_image:new M.Uniform1i(h,g.u_image),u_units_to_pixels:new M.Uniform2f(h,g.u_units_to_pixels),u_scale:new M.Uniform3f(h,g.u_scale),u_fade:new M.Uniform1f(h,g.u_fade)}},lineSDF:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_ratio:new M.Uniform1f(h,g.u_ratio),u_device_pixel_ratio:new M.Uniform1f(h,g.u_device_pixel_ratio),u_units_to_pixels:new M.Uniform2f(h,g.u_units_to_pixels),u_patternscale_a:new M.Uniform2f(h,g.u_patternscale_a),u_patternscale_b:new M.Uniform2f(h,g.u_patternscale_b),u_sdfgamma:new M.Uniform1f(h,g.u_sdfgamma),u_image:new M.Uniform1i(h,g.u_image),u_tex_y_a:new M.Uniform1f(h,g.u_tex_y_a),u_tex_y_b:new M.Uniform1f(h,g.u_tex_y_b),u_mix:new M.Uniform1f(h,g.u_mix)}},raster:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_tl_parent:new M.Uniform2f(h,g.u_tl_parent),u_scale_parent:new M.Uniform1f(h,g.u_scale_parent),u_buffer_scale:new M.Uniform1f(h,g.u_buffer_scale),u_fade_t:new M.Uniform1f(h,g.u_fade_t),u_opacity:new M.Uniform1f(h,g.u_opacity),u_image0:new M.Uniform1i(h,g.u_image0),u_image1:new M.Uniform1i(h,g.u_image1),u_brightness_low:new M.Uniform1f(h,g.u_brightness_low),u_brightness_high:new M.Uniform1f(h,g.u_brightness_high),u_saturation_factor:new M.Uniform1f(h,g.u_saturation_factor),u_contrast_factor:new M.Uniform1f(h,g.u_contrast_factor),u_spin_weights:new M.Uniform3f(h,g.u_spin_weights)}},symbolIcon:function(h,g){return{u_is_size_zoom_constant:new M.Uniform1i(h,g.u_is_size_zoom_constant),u_is_size_feature_constant:new M.Uniform1i(h,g.u_is_size_feature_constant),u_size_t:new M.Uniform1f(h,g.u_size_t),u_size:new M.Uniform1f(h,g.u_size),u_camera_to_center_distance:new M.Uniform1f(h,g.u_camera_to_center_distance),u_pitch:new M.Uniform1f(h,g.u_pitch),u_rotate_symbol:new M.Uniform1i(h,g.u_rotate_symbol),u_aspect_ratio:new M.Uniform1f(h,g.u_aspect_ratio),u_fade_change:new M.Uniform1f(h,g.u_fade_change),u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_label_plane_matrix:new M.UniformMatrix4f(h,g.u_label_plane_matrix),u_coord_matrix:new M.UniformMatrix4f(h,g.u_coord_matrix),u_is_text:new M.Uniform1i(h,g.u_is_text),u_pitch_with_map:new M.Uniform1i(h,g.u_pitch_with_map),u_texsize:new M.Uniform2f(h,g.u_texsize),u_texture:new M.Uniform1i(h,g.u_texture)}},symbolSDF:function(h,g){return{u_is_size_zoom_constant:new M.Uniform1i(h,g.u_is_size_zoom_constant),u_is_size_feature_constant:new M.Uniform1i(h,g.u_is_size_feature_constant),u_size_t:new M.Uniform1f(h,g.u_size_t),u_size:new M.Uniform1f(h,g.u_size),u_camera_to_center_distance:new M.Uniform1f(h,g.u_camera_to_center_distance),u_pitch:new M.Uniform1f(h,g.u_pitch),u_rotate_symbol:new M.Uniform1i(h,g.u_rotate_symbol),u_aspect_ratio:new M.Uniform1f(h,g.u_aspect_ratio),u_fade_change:new M.Uniform1f(h,g.u_fade_change),u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_label_plane_matrix:new M.UniformMatrix4f(h,g.u_label_plane_matrix),u_coord_matrix:new M.UniformMatrix4f(h,g.u_coord_matrix),u_is_text:new M.Uniform1i(h,g.u_is_text),u_pitch_with_map:new M.Uniform1i(h,g.u_pitch_with_map),u_texsize:new M.Uniform2f(h,g.u_texsize),u_texture:new M.Uniform1i(h,g.u_texture),u_gamma_scale:new M.Uniform1f(h,g.u_gamma_scale),u_device_pixel_ratio:new M.Uniform1f(h,g.u_device_pixel_ratio),u_is_halo:new M.Uniform1i(h,g.u_is_halo)}},symbolTextAndIcon:function(h,g){return{u_is_size_zoom_constant:new M.Uniform1i(h,g.u_is_size_zoom_constant),u_is_size_feature_constant:new M.Uniform1i(h,g.u_is_size_feature_constant),u_size_t:new M.Uniform1f(h,g.u_size_t),u_size:new M.Uniform1f(h,g.u_size),u_camera_to_center_distance:new M.Uniform1f(h,g.u_camera_to_center_distance),u_pitch:new M.Uniform1f(h,g.u_pitch),u_rotate_symbol:new M.Uniform1i(h,g.u_rotate_symbol),u_aspect_ratio:new M.Uniform1f(h,g.u_aspect_ratio),u_fade_change:new M.Uniform1f(h,g.u_fade_change),u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_label_plane_matrix:new M.UniformMatrix4f(h,g.u_label_plane_matrix),u_coord_matrix:new M.UniformMatrix4f(h,g.u_coord_matrix),u_is_text:new M.Uniform1i(h,g.u_is_text),u_pitch_with_map:new M.Uniform1i(h,g.u_pitch_with_map),u_texsize:new M.Uniform2f(h,g.u_texsize),u_texsize_icon:new M.Uniform2f(h,g.u_texsize_icon),u_texture:new M.Uniform1i(h,g.u_texture),u_texture_icon:new M.Uniform1i(h,g.u_texture_icon),u_gamma_scale:new M.Uniform1f(h,g.u_gamma_scale),u_device_pixel_ratio:new M.Uniform1f(h,g.u_device_pixel_ratio),u_is_halo:new M.Uniform1i(h,g.u_is_halo)}},background:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_opacity:new M.Uniform1f(h,g.u_opacity),u_color:new M.UniformColor(h,g.u_color)}},backgroundPattern:function(h,g){return{u_matrix:new M.UniformMatrix4f(h,g.u_matrix),u_opacity:new M.Uniform1f(h,g.u_opacity),u_image:new M.Uniform1i(h,g.u_image),u_pattern_tl_a:new M.Uniform2f(h,g.u_pattern_tl_a),u_pattern_br_a:new M.Uniform2f(h,g.u_pattern_br_a),u_pattern_tl_b:new M.Uniform2f(h,g.u_pattern_tl_b),u_pattern_br_b:new M.Uniform2f(h,g.u_pattern_br_b),u_texsize:new M.Uniform2f(h,g.u_texsize),u_mix:new M.Uniform1f(h,g.u_mix),u_pattern_size_a:new M.Uniform2f(h,g.u_pattern_size_a),u_pattern_size_b:new M.Uniform2f(h,g.u_pattern_size_b),u_scale_a:new M.Uniform1f(h,g.u_scale_a),u_scale_b:new M.Uniform1f(h,g.u_scale_b),u_pixel_coord_upper:new M.Uniform2f(h,g.u_pixel_coord_upper),u_pixel_coord_lower:new M.Uniform2f(h,g.u_pixel_coord_lower),u_tile_units_to_pixels:new M.Uniform1f(h,g.u_tile_units_to_pixels)}}};function Bh(h,g,d,b,B,G,q){for(var te=h.context,fe=te.gl,ce=h.useProgram("collisionBox"),Te=[],Ie=0,Oe=0,Qe=0;Qe0){var pr=M.create(),tr=Tt;M.mul(pr,tt.placementInvProjMatrix,h.transform.glCoordMatrix),M.mul(pr,pr,tt.placementViewportMatrix),Te.push({circleArray:Nt,circleOffset:Oe,transform:tr,invTransform:pr}),Oe=Ie+=Nt.length/4}Ut&&ce.draw(te,fe.LINES,ye.disabled,ze.disabled,h.colorModeForRenderPass(),Ue.disabled,Qu(Tt,h.transform,ct),d.id,Ut.layoutVertexBuffer,Ut.indexBuffer,Ut.segments,null,h.transform.zoom,null,null,Ut.collisionVertexBuffer)}}if(q&&Te.length){var Dr=h.useProgram("collisionCircle"),Hr=new M.StructArrayLayout2f1f2i16;Hr.resize(4*Ie),Hr._trim();for(var sn=0,nn=0,Gn=Te;nn=0&&(nt[tt.associatedIconIndex]={shiftedAnchor:Hr,angle:sn})}else il(tt.numGlyphs,Oe)}if(Te){Qe.clear();for(var Gn=h.icon.placedSymbolArray,di=0;di0){var q=M.browser.now(),te=(q-h.timeAdded)/G,fe=g?(q-g.timeAdded)/G:-1,ce=d.getSource(),Te=B.coveringZoomLevel({tileSize:ce.tileSize,roundZoom:ce.roundZoom}),Ie=!g||Math.abs(g.tileID.overscaledZ-Te)>Math.abs(h.tileID.overscaledZ-Te),Oe=Ie&&h.refreshedUponExpiration?1:M.clamp(Ie?te:1-fe,0,1);return h.refreshedUponExpiration&&te>=1&&(h.refreshedUponExpiration=!1),g?{opacity:1,mix:1-Oe}:{opacity:Oe,mix:0}}return{opacity:1,mix:0}}var Ac=new M.Color(1,0,0,1),kh=new M.Color(0,1,0,1),Iu=new M.Color(0,0,1,1),rh=new M.Color(1,0,1,1),gp=new M.Color(0,1,1,1);function vp(h,g,d,b){Hc(h,0,g+d/2,h.transform.width,d,b)}function Kp(h,g,d,b){Hc(h,g-d/2,0,d,h.transform.height,b)}function Hc(h,g,d,b,B,G){var q=h.context,te=q.gl;te.enable(te.SCISSOR_TEST),te.scissor(g*M.browser.devicePixelRatio,d*M.browser.devicePixelRatio,b*M.browser.devicePixelRatio,B*M.browser.devicePixelRatio),q.clear({color:G}),te.disable(te.SCISSOR_TEST)}function Eh(h,g,d){var b=h.context,B=b.gl,G=d.posMatrix,q=h.useProgram("debug"),te=ye.disabled,fe=ze.disabled,ce=h.colorModeForRenderPass();b.activeTexture.set(B.TEXTURE0),h.emptyTexture.bind(B.LINEAR,B.CLAMP_TO_EDGE),q.draw(b,B.LINE_STRIP,te,fe,ce,Ue.disabled,ys(G,M.Color.red),"$debug",h.debugBuffer,h.tileBorderIndexBuffer,h.debugSegments);var Te=g.getTileByID(d.key).latestRawTileData,Ie=Math.floor((Te&&Te.byteLength||0)/1024),Oe=g.getTile(d).tileSize,Qe=512/Math.min(Oe,512)*(d.overscaledZ/h.transform.zoom)*.5,nt=d.canonical.toString();d.overscaledZ!==d.canonical.z&&(nt+=" => "+d.overscaledZ),function(ct,tt){ct.initDebugOverlayCanvas();var Tt=ct.debugOverlayCanvas,Ut=ct.context.gl,Nt=ct.debugOverlayCanvas.getContext("2d");Nt.clearRect(0,0,Tt.width,Tt.height),Nt.shadowColor="white",Nt.shadowBlur=2,Nt.lineWidth=1.5,Nt.strokeStyle="white",Nt.textBaseline="top",Nt.font="bold 36px Open Sans, sans-serif",Nt.fillText(tt,5,5),Nt.strokeText(tt,5,5),ct.debugOverlayTexture.update(Tt),ct.debugOverlayTexture.bind(Ut.LINEAR,Ut.CLAMP_TO_EDGE)}(h,nt+" "+Ie+"kb"),q.draw(b,B.TRIANGLES,te,fe,je.alphaBlended,Ue.disabled,ys(G,M.Color.transparent,Qe),"$debug",h.debugBuffer,h.quadTriangleIndexBuffer,h.debugSegments)}var yu={symbol:function(h,g,d,b,B){if(h.renderPass==="translucent"){var G=ze.disabled,q=h.colorModeForRenderPass();d.layout.get("text-variable-anchor")&&function(te,fe,ce,Te,Ie,Oe,Qe){for(var nt=fe.transform,ct=Ie==="map",tt=Oe==="map",Tt=0,Ut=te;Tt256&&this.clearStencil(),d.setColorMode(je.disabled),d.setDepthMode(ye.disabled);var B=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var G=0,q=g;G256&&this.clearStencil();var h=this.nextStencilID++,g=this.context.gl;return new ze({func:g.NOTEQUAL,mask:255},h,255,g.KEEP,g.KEEP,g.REPLACE)},Ya.prototype.stencilModeForClipping=function(h){var g=this.context.gl;return new ze({func:g.EQUAL,mask:255},this._tileClippingMaskIDs[h.key],0,g.KEEP,g.KEEP,g.REPLACE)},Ya.prototype.stencilConfigForOverlap=function(h){var g,d=this.context.gl,b=h.sort(function(fe,ce){return ce.overscaledZ-fe.overscaledZ}),B=b[b.length-1].overscaledZ,G=b[0].overscaledZ-B+1;if(G>1){this.currentStencilSource=void 0,this.nextStencilID+G>256&&this.clearStencil();for(var q={},te=0;te=0;this.currentLayer--){var Nt=this.style._layers[b[this.currentLayer]],pr=B[Nt.source],tr=ce[Nt.source];this._renderTileClippingMasks(Nt,tr),this.renderLayer(this,pr,Nt,tr)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?g.pop():null},Ya.prototype.isPatternMissing=function(h){if(!h)return!1;if(!h.from||!h.to)return!0;var g=this.imageManager.getPattern(h.from.toString()),d=this.imageManager.getPattern(h.to.toString());return!g||!d},Ya.prototype.useProgram=function(h,g){this.cache=this.cache||{};var d=""+h+(g?g.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[d]||(this.cache[d]=new zl(this.context,h,Gf[h],g,vf[h],this._showOverdrawInspector)),this.cache[d]},Ya.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Ya.prototype.setBaseState=function(){var h=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(h.FUNC_ADD)},Ya.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=M.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new M.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},Ya.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var nh=function(h,g){this.points=h,this.planes=g};nh.fromInvProjectionMatrix=function(h,g,d){var b=Math.pow(2,d),B=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(function(q){return M.transformMat4([],q,h)}).map(function(q){return M.scale$1([],q,1/q[3]/g*b)}),G=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(q){var te=M.sub([],B[q[0]],B[q[1]]),fe=M.sub([],B[q[2]],B[q[1]]),ce=M.normalize([],M.cross([],te,fe)),Te=-M.dot(ce,B[q[1]]);return ce.concat(Te)});return new nh(B,G)};var Gc=function(h,g){this.min=h,this.max=g,this.center=M.scale$2([],M.add([],this.min,this.max),.5)};Gc.prototype.quadrant=function(h){for(var g=[h%2==0,h<2],d=M.clone$2(this.min),b=M.clone$2(this.max),B=0;B=0;if(G===0)return 0;G!==g.length&&(d=!1)}if(d)return 2;for(var te=0;te<3;te++){for(var fe=Number.MAX_VALUE,ce=-Number.MAX_VALUE,Te=0;Tethis.max[te]-this.min[te])return 0}return 1};var ih=function(h,g,d,b){if(h===void 0&&(h=0),g===void 0&&(g=0),d===void 0&&(d=0),b===void 0&&(b=0),isNaN(h)||h<0||isNaN(g)||g<0||isNaN(d)||d<0||isNaN(b)||b<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=h,this.bottom=g,this.left=d,this.right=b};ih.prototype.interpolate=function(h,g,d){return g.top!=null&&h.top!=null&&(this.top=M.number(h.top,g.top,d)),g.bottom!=null&&h.bottom!=null&&(this.bottom=M.number(h.bottom,g.bottom,d)),g.left!=null&&h.left!=null&&(this.left=M.number(h.left,g.left,d)),g.right!=null&&h.right!=null&&(this.right=M.number(h.right,g.right,d)),this},ih.prototype.getCenter=function(h,g){var d=M.clamp((this.left+h-this.right)/2,0,h),b=M.clamp((this.top+g-this.bottom)/2,0,g);return new M.Point(d,b)},ih.prototype.equals=function(h){return this.top===h.top&&this.bottom===h.bottom&&this.left===h.left&&this.right===h.right},ih.prototype.clone=function(){return new ih(this.top,this.bottom,this.left,this.right)},ih.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Sa=function(h,g,d,b,B){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=B===void 0||B,this._minZoom=h||0,this._maxZoom=g||22,this._minPitch=d==null?0:d,this._maxPitch=b==null?60:b,this.setMaxBounds(),this.width=0,this.height=0,this._center=new M.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ih,this._posMatrixCache={},this._alignedPosMatrixCache={}},cs={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Sa.prototype.clone=function(){var h=new Sa(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return h.tileSize=this.tileSize,h.latRange=this.latRange,h.width=this.width,h.height=this.height,h._center=this._center,h.zoom=this.zoom,h.angle=this.angle,h._fov=this._fov,h._pitch=this._pitch,h._unmodified=this._unmodified,h._edgeInsets=this._edgeInsets.clone(),h._calcMatrices(),h},cs.minZoom.get=function(){return this._minZoom},cs.minZoom.set=function(h){this._minZoom!==h&&(this._minZoom=h,this.zoom=Math.max(this.zoom,h))},cs.maxZoom.get=function(){return this._maxZoom},cs.maxZoom.set=function(h){this._maxZoom!==h&&(this._maxZoom=h,this.zoom=Math.min(this.zoom,h))},cs.minPitch.get=function(){return this._minPitch},cs.minPitch.set=function(h){this._minPitch!==h&&(this._minPitch=h,this.pitch=Math.max(this.pitch,h))},cs.maxPitch.get=function(){return this._maxPitch},cs.maxPitch.set=function(h){this._maxPitch!==h&&(this._maxPitch=h,this.pitch=Math.min(this.pitch,h))},cs.renderWorldCopies.get=function(){return this._renderWorldCopies},cs.renderWorldCopies.set=function(h){h===void 0?h=!0:h===null&&(h=!1),this._renderWorldCopies=h},cs.worldSize.get=function(){return this.tileSize*this.scale},cs.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},cs.size.get=function(){return new M.Point(this.width,this.height)},cs.bearing.get=function(){return-this.angle/Math.PI*180},cs.bearing.set=function(h){var g=-M.wrap(h,-180,180)*Math.PI/180;this.angle!==g&&(this._unmodified=!1,this.angle=g,this._calcMatrices(),this.rotationMatrix=M.create$2(),M.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},cs.pitch.get=function(){return this._pitch/Math.PI*180},cs.pitch.set=function(h){var g=M.clamp(h,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==g&&(this._unmodified=!1,this._pitch=g,this._calcMatrices())},cs.fov.get=function(){return this._fov/Math.PI*180},cs.fov.set=function(h){h=Math.max(.01,Math.min(60,h)),this._fov!==h&&(this._unmodified=!1,this._fov=h/180*Math.PI,this._calcMatrices())},cs.zoom.get=function(){return this._zoom},cs.zoom.set=function(h){var g=Math.min(Math.max(h,this.minZoom),this.maxZoom);this._zoom!==g&&(this._unmodified=!1,this._zoom=g,this.scale=this.zoomScale(g),this.tileZoom=Math.floor(g),this.zoomFraction=g-this.tileZoom,this._constrain(),this._calcMatrices())},cs.center.get=function(){return this._center},cs.center.set=function(h){h.lat===this._center.lat&&h.lng===this._center.lng||(this._unmodified=!1,this._center=h,this._constrain(),this._calcMatrices())},cs.padding.get=function(){return this._edgeInsets.toJSON()},cs.padding.set=function(h){this._edgeInsets.equals(h)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,h,1),this._calcMatrices())},cs.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Sa.prototype.isPaddingEqual=function(h){return this._edgeInsets.equals(h)},Sa.prototype.interpolatePadding=function(h,g,d){this._unmodified=!1,this._edgeInsets.interpolate(h,g,d),this._constrain(),this._calcMatrices()},Sa.prototype.coveringZoomLevel=function(h){var g=(h.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/h.tileSize));return Math.max(0,g)},Sa.prototype.getVisibleUnwrappedCoordinates=function(h){var g=[new M.UnwrappedTileID(0,h)];if(this._renderWorldCopies)for(var d=this.pointCoordinate(new M.Point(0,0)),b=this.pointCoordinate(new M.Point(this.width,0)),B=this.pointCoordinate(new M.Point(this.width,this.height)),G=this.pointCoordinate(new M.Point(0,this.height)),q=Math.floor(Math.min(d.x,b.x,B.x,G.x)),te=Math.floor(Math.max(d.x,b.x,B.x,G.x)),fe=q-1;fe<=te+1;fe++)fe!==0&&g.push(new M.UnwrappedTileID(fe,h));return g},Sa.prototype.coveringTiles=function(h){var g=this.coveringZoomLevel(h),d=g;if(h.minzoom!==void 0&&gh.maxzoom&&(g=h.maxzoom);var b=M.MercatorCoordinate.fromLngLat(this.center),B=Math.pow(2,g),G=[B*b.x,B*b.y,0],q=nh.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,g),te=h.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(te=g);var fe=function(nn){return{aabb:new Gc([nn*B,0,0],[(nn+1)*B,B,0]),zoom:0,x:0,y:0,wrap:nn,fullyVisible:!1}},ce=[],Te=[],Ie=g,Oe=h.reparseOverscaled?d:g;if(this._renderWorldCopies)for(var Qe=1;Qe<=3;Qe++)ce.push(fe(-Qe)),ce.push(fe(Qe));for(ce.push(fe(0));ce.length>0;){var nt=ce.pop(),ct=nt.x,tt=nt.y,Tt=nt.fullyVisible;if(!Tt){var Ut=nt.aabb.intersects(q);if(Ut===0)continue;Tt=Ut===2}var Nt=nt.aabb.distanceX(G),pr=nt.aabb.distanceY(G),tr=Math.max(Math.abs(Nt),Math.abs(pr));if(nt.zoom===Ie||tr>3+(1<=te)Te.push({tileID:new M.OverscaledTileID(nt.zoom===Ie?Oe:nt.zoom,nt.wrap,nt.zoom,ct,tt),distanceSq:M.sqrLen([G[0]-.5-ct,G[1]-.5-tt])});else for(var Dr=0;Dr<4;Dr++){var Hr=(ct<<1)+Dr%2,sn=(tt<<1)+(Dr>>1);ce.push({aabb:nt.aabb.quadrant(Dr),zoom:nt.zoom+1,x:Hr,y:sn,wrap:nt.wrap,fullyVisible:Tt})}}return Te.sort(function(nn,Gn){return nn.distanceSq-Gn.distanceSq}).map(function(nn){return nn.tileID})},Sa.prototype.resize=function(h,g){this.width=h,this.height=g,this.pixelsToGLUnits=[2/h,-2/g],this._constrain(),this._calcMatrices()},cs.unmodified.get=function(){return this._unmodified},Sa.prototype.zoomScale=function(h){return Math.pow(2,h)},Sa.prototype.scaleZoom=function(h){return Math.log(h)/Math.LN2},Sa.prototype.project=function(h){var g=M.clamp(h.lat,-this.maxValidLatitude,this.maxValidLatitude);return new M.Point(M.mercatorXfromLng(h.lng)*this.worldSize,M.mercatorYfromLat(g)*this.worldSize)},Sa.prototype.unproject=function(h){return new M.MercatorCoordinate(h.x/this.worldSize,h.y/this.worldSize).toLngLat()},cs.point.get=function(){return this.project(this.center)},Sa.prototype.setLocationAtPoint=function(h,g){var d=this.pointCoordinate(g),b=this.pointCoordinate(this.centerPoint),B=this.locationCoordinate(h),G=new M.MercatorCoordinate(B.x-(d.x-b.x),B.y-(d.y-b.y));this.center=this.coordinateLocation(G),this._renderWorldCopies&&(this.center=this.center.wrap())},Sa.prototype.locationPoint=function(h){return this.coordinatePoint(this.locationCoordinate(h))},Sa.prototype.pointLocation=function(h){return this.coordinateLocation(this.pointCoordinate(h))},Sa.prototype.locationCoordinate=function(h){return M.MercatorCoordinate.fromLngLat(h)},Sa.prototype.coordinateLocation=function(h){return h.toLngLat()},Sa.prototype.pointCoordinate=function(h){var g=[h.x,h.y,0,1],d=[h.x,h.y,1,1];M.transformMat4(g,g,this.pixelMatrixInverse),M.transformMat4(d,d,this.pixelMatrixInverse);var b=g[3],B=d[3],G=g[1]/b,q=d[1]/B,te=g[2]/b,fe=d[2]/B,ce=te===fe?0:(0-te)/(fe-te);return new M.MercatorCoordinate(M.number(g[0]/b,d[0]/B,ce)/this.worldSize,M.number(G,q,ce)/this.worldSize)},Sa.prototype.coordinatePoint=function(h){var g=[h.x*this.worldSize,h.y*this.worldSize,0,1];return M.transformMat4(g,g,this.pixelMatrix),new M.Point(g[0]/g[3],g[1]/g[3])},Sa.prototype.getBounds=function(){return new M.LngLatBounds().extend(this.pointLocation(new M.Point(0,0))).extend(this.pointLocation(new M.Point(this.width,0))).extend(this.pointLocation(new M.Point(this.width,this.height))).extend(this.pointLocation(new M.Point(0,this.height)))},Sa.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new M.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Sa.prototype.setMaxBounds=function(h){h?(this.lngRange=[h.getWest(),h.getEast()],this.latRange=[h.getSouth(),h.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Sa.prototype.calculatePosMatrix=function(h,g){g===void 0&&(g=!1);var d=h.key,b=g?this._alignedPosMatrixCache:this._posMatrixCache;if(b[d])return b[d];var B=h.canonical,G=this.worldSize/this.zoomScale(B.z),q=B.x+Math.pow(2,B.z)*h.wrap,te=M.identity(new Float64Array(16));return M.translate(te,te,[q*G,B.y*G,0]),M.scale(te,te,[G/M.EXTENT,G/M.EXTENT,1]),M.multiply(te,g?this.alignedProjMatrix:this.projMatrix,te),b[d]=new Float32Array(te),b[d]},Sa.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Sa.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var h,g,d,b,B=-90,G=90,q=-180,te=180,fe=this.size,ce=this._unmodified;if(this.latRange){var Te=this.latRange;B=M.mercatorYfromLat(Te[1])*this.worldSize,h=(G=M.mercatorYfromLat(Te[0])*this.worldSize)-BG&&(b=G-ct)}if(this.lngRange){var tt=Oe.x,Tt=fe.x/2;tt-Ttte&&(d=te-Tt)}d===void 0&&b===void 0||(this.center=this.unproject(new M.Point(d!==void 0?d:Oe.x,b!==void 0?b:Oe.y))),this._unmodified=ce,this._constraining=!1}},Sa.prototype._calcMatrices=function(){if(this.height){var h=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var g=Math.PI/2+this._pitch,d=this._fov*(.5+h.y/this.height),b=Math.sin(d)*this.cameraToCenterDistance/Math.sin(M.clamp(Math.PI-g-d,.01,Math.PI-.01)),B=this.point,G=B.x,q=B.y,te=1.01*(Math.cos(Math.PI/2-this._pitch)*b+this.cameraToCenterDistance),fe=this.height/50,ce=new Float64Array(16);M.perspective(ce,this._fov,this.width/this.height,fe,te),ce[8]=2*-h.x/this.width,ce[9]=2*h.y/this.height,M.scale(ce,ce,[1,-1,1]),M.translate(ce,ce,[0,0,-this.cameraToCenterDistance]),M.rotateX(ce,ce,this._pitch),M.rotateZ(ce,ce,this.angle),M.translate(ce,ce,[-G,-q,0]),this.mercatorMatrix=M.scale([],ce,[this.worldSize,this.worldSize,this.worldSize]),M.scale(ce,ce,[1,1,M.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=ce,this.invProjMatrix=M.invert([],this.projMatrix);var Te=this.width%2/2,Ie=this.height%2/2,Oe=Math.cos(this.angle),Qe=Math.sin(this.angle),nt=G-Math.round(G)+Oe*Te+Qe*Ie,ct=q-Math.round(q)+Oe*Ie+Qe*Te,tt=new Float64Array(ce);if(M.translate(tt,tt,[nt>.5?nt-1:nt,ct>.5?ct-1:ct,0]),this.alignedProjMatrix=tt,ce=M.create(),M.scale(ce,ce,[this.width/2,-this.height/2,1]),M.translate(ce,ce,[1,-1,0]),this.labelPlaneMatrix=ce,ce=M.create(),M.scale(ce,ce,[1,-1,1]),M.translate(ce,ce,[-1,-1,0]),M.scale(ce,ce,[2/this.width,2/this.height,1]),this.glCoordMatrix=ce,this.pixelMatrix=M.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(ce=M.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=ce,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Sa.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var h=this.pointCoordinate(new M.Point(0,0)),g=[h.x*this.worldSize,h.y*this.worldSize,0,1];return M.transformMat4(g,g,this.pixelMatrix)[3]/this.cameraToCenterDistance},Sa.prototype.getCameraPoint=function(){var h=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new M.Point(0,h))},Sa.prototype.getCameraQueryGeometry=function(h){var g=this.getCameraPoint();if(h.length===1)return[h[0],g];for(var d=g.x,b=g.y,B=g.x,G=g.y,q=0,te=h;q=3&&!h.some(function(d){return isNaN(d)})){var g=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(h[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+h[2],+h[1]],zoom:+h[0],bearing:g,pitch:+(h[4]||0)}),!0}return!1},ku.prototype._updateHashUnthrottled=function(){var h=M.window.location.href.replace(/(#.+)?$/,this.getHashString());try{M.window.history.replaceState(M.window.history.state,null,h)}catch(g){}};var rc={linearity:.3,easing:M.bezier(0,0,.3,1)},xu=M.extend({deceleration:2500,maxSpeed:1400},rc),oh=M.extend({deceleration:20,maxSpeed:1400},rc),Cc=M.extend({deceleration:1e3,maxSpeed:360},rc),ah=M.extend({deceleration:1e3,maxSpeed:90},rc),Qh=function(h){this._map=h,this.clear()};function sh(h,g){(!h.duration||h.duration0&&g-h[0].time>160;)h.shift()},Qh.prototype._onMoveEnd=function(h){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var g={zoom:0,bearing:0,pitch:0,pan:new M.Point(0,0),pinchAround:void 0,around:void 0},d=0,b=this._inertiaBuffer;d=this._clickTolerance||this._map.fire(new ll(h.type,this._map,h))},oi.prototype.dblclick=function(h){return this._firePreventable(new ll(h.type,this._map,h))},oi.prototype.mouseover=function(h){this._map.fire(new ll(h.type,this._map,h))},oi.prototype.mouseout=function(h){this._map.fire(new ll(h.type,this._map,h))},oi.prototype.touchstart=function(h){return this._firePreventable(new Wc(h.type,this._map,h))},oi.prototype.touchmove=function(h){this._map.fire(new Wc(h.type,this._map,h))},oi.prototype.touchend=function(h){this._map.fire(new Wc(h.type,this._map,h))},oi.prototype.touchcancel=function(h){this._map.fire(new Wc(h.type,this._map,h))},oi.prototype._firePreventable=function(h){if(this._map.fire(h),h.defaultPrevented)return{}},oi.prototype.isEnabled=function(){return!0},oi.prototype.isActive=function(){return!1},oi.prototype.enable=function(){},oi.prototype.disable=function(){};var fi=function(h){this._map=h};fi.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},fi.prototype.mousemove=function(h){this._map.fire(new ll(h.type,this._map,h))},fi.prototype.mousedown=function(){this._delayContextMenu=!0},fi.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ll("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},fi.prototype.contextmenu=function(h){this._delayContextMenu?this._contextMenuEvent=h:this._map.fire(new ll(h.type,this._map,h)),this._map.listens("contextmenu")&&h.preventDefault()},fi.prototype.isEnabled=function(){return!0},fi.prototype.isActive=function(){return!1},fi.prototype.enable=function(){},fi.prototype.disable=function(){};var tu=function(h,g){this._map=h,this._el=h.getCanvasContainer(),this._container=h.getContainer(),this._clickTolerance=g.clickTolerance||1};function bu(h,g){for(var d={},b=0;bthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=h.timeStamp),d.length===this.numTouches&&(this.centroid=function(b){for(var B=new M.Point(0,0),G=0,q=b;G30)&&(this.aborted=!0)}}},Dp.prototype.touchend=function(h,g,d){if((!this.centroid||h.timeStamp-this.startTime>500)&&(this.aborted=!0),d.length===0){var b=!this.aborted&&this.centroid;if(this.reset(),b)return b}};var ai=function(h){this.singleTap=new Dp(h),this.numTaps=h.numTaps,this.reset()};ai.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},ai.prototype.touchstart=function(h,g,d){this.singleTap.touchstart(h,g,d)},ai.prototype.touchmove=function(h,g,d){this.singleTap.touchmove(h,g,d)},ai.prototype.touchend=function(h,g,d){var b=this.singleTap.touchend(h,g,d);if(b){var B=h.timeStamp-this.lastTime<500,G=!this.lastTap||this.lastTap.dist(b)<30;if(B&&G||this.reset(),this.count++,this.lastTime=h.timeStamp,this.lastTap=b,this.count===this.numTaps)return this.reset(),b}};var is=function(){this._zoomIn=new ai({numTouches:1,numTaps:2}),this._zoomOut=new ai({numTouches:2,numTaps:1}),this.reset()};is.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},is.prototype.touchstart=function(h,g,d){this._zoomIn.touchstart(h,g,d),this._zoomOut.touchstart(h,g,d)},is.prototype.touchmove=function(h,g,d){this._zoomIn.touchmove(h,g,d),this._zoomOut.touchmove(h,g,d)},is.prototype.touchend=function(h,g,d){var b=this,B=this._zoomIn.touchend(h,g,d),G=this._zoomOut.touchend(h,g,d);return B?(this._active=!0,h.preventDefault(),setTimeout(function(){return b.reset()},0),{cameraAnimation:function(q){return q.easeTo({duration:300,zoom:q.getZoom()+1,around:q.unproject(B)},{originalEvent:h})}}):G?(this._active=!0,h.preventDefault(),setTimeout(function(){return b.reset()},0),{cameraAnimation:function(q){return q.easeTo({duration:300,zoom:q.getZoom()-1,around:q.unproject(G)},{originalEvent:h})}}):void 0},is.prototype.touchcancel=function(){this.reset()},is.prototype.enable=function(){this._enabled=!0},is.prototype.disable=function(){this._enabled=!1,this.reset()},is.prototype.isEnabled=function(){return this._enabled},is.prototype.isActive=function(){return this._active};var ep={0:1,2:2},mi=function(h){this.reset(),this._clickTolerance=h.clickTolerance||1};mi.prototype.blur=function(){this.reset()},mi.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},mi.prototype._correctButton=function(h,g){return!1},mi.prototype._move=function(h,g){return{}},mi.prototype.mousedown=function(h,g){if(!this._lastPoint){var d=de.mouseButton(h);this._correctButton(h,d)&&(this._lastPoint=g,this._eventButton=d)}},mi.prototype.mousemoveWindow=function(h,g){var d=this._lastPoint;if(d){if(h.preventDefault(),function(b,B){var G=ep[B];return b.buttons===void 0||(b.buttons&G)!==G}(h,this._eventButton))this.reset();else if(this._moved||!(g.dist(d)0&&(this._active=!0);var b=bu(d,g),B=new M.Point(0,0),G=new M.Point(0,0),q=0;for(var te in b){var fe=b[te],ce=this._touches[te];ce&&(B._add(fe),G._add(fe.sub(ce)),q++,b[te]=fe)}if(this._touches=b,!(qMath.abs(h.x)}var tp=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.reset=function(){h.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},g.prototype._start=function(d){this._lastPoints=d,lh(d[0].sub(d[1]))&&(this._valid=!1)},g.prototype._move=function(d,b,B){var G=d[0].sub(this._lastPoints[0]),q=d[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(G,q,B.timeStamp),this._valid)return this._lastPoints=d,this._active=!0,{pitchDelta:(G.y+q.y)/2*-.5}},g.prototype.gestureBeginsVertically=function(d,b,B){if(this._valid!==void 0)return this._valid;var G=d.mag()>=2,q=b.mag()>=2;if(G||q){if(!G||!q)return this._firstMove===void 0&&(this._firstMove=B),B-this._firstMove<100&&void 0;var te=d.y>0==b.y>0;return lh(d)&&lh(b)&&te}},g}(hc),rp={panStep:100,bearingStep:15,pitchStep:10},su=function(){var h=rp;this._panStep=h.panStep,this._bearingStep=h.bearingStep,this._pitchStep=h.pitchStep,this._rotationDisabled=!1};function ql(h){return h*(2-h)}su.prototype.blur=function(){this.reset()},su.prototype.reset=function(){this._active=!1},su.prototype.keydown=function(h){var g=this;if(!(h.altKey||h.ctrlKey||h.metaKey)){var d=0,b=0,B=0,G=0,q=0;switch(h.keyCode){case 61:case 107:case 171:case 187:d=1;break;case 189:case 109:case 173:d=-1;break;case 37:h.shiftKey?b=-1:(h.preventDefault(),G=-1);break;case 39:h.shiftKey?b=1:(h.preventDefault(),G=1);break;case 38:h.shiftKey?B=1:(h.preventDefault(),q=-1);break;case 40:h.shiftKey?B=-1:(h.preventDefault(),q=1);break;default:return}return this._rotationDisabled&&(b=0,B=0),{cameraAnimation:function(te){var fe=te.getZoom();te.easeTo({duration:300,easeId:"keyboardHandler",easing:ql,zoom:d?Math.round(fe)+d*(h.shiftKey?2:1):fe,bearing:te.getBearing()+b*g._bearingStep,pitch:te.getPitch()+B*g._pitchStep,offset:[-G*g._panStep,-q*g._panStep],center:te.getCenter()},{originalEvent:h})}}}},su.prototype.enable=function(){this._enabled=!0},su.prototype.disable=function(){this._enabled=!1,this.reset()},su.prototype.isEnabled=function(){return this._enabled},su.prototype.isActive=function(){return this._active},su.prototype.disableRotation=function(){this._rotationDisabled=!0},su.prototype.enableRotation=function(){this._rotationDisabled=!1};var fa=function(h,g){this._map=h,this._el=h.getCanvasContainer(),this._handler=g,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,M.bindAll(["_onTimeout"],this)};fa.prototype.setZoomRate=function(h){this._defaultZoomRate=h},fa.prototype.setWheelZoomRate=function(h){this._wheelZoomRate=h},fa.prototype.isEnabled=function(){return!!this._enabled},fa.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},fa.prototype.isZooming=function(){return!!this._zooming},fa.prototype.enable=function(h){this.isEnabled()||(this._enabled=!0,this._aroundCenter=h&&h.around==="center")},fa.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},fa.prototype.wheel=function(h){if(this.isEnabled()){var g=h.deltaMode===M.window.WheelEvent.DOM_DELTA_LINE?40*h.deltaY:h.deltaY,d=M.browser.now(),b=d-(this._lastWheelEventTime||0);this._lastWheelEventTime=d,g!==0&&g%4.000244140625==0?this._type="wheel":g!==0&&Math.abs(g)<4?this._type="trackpad":b>400?(this._type=null,this._lastValue=g,this._timeout=setTimeout(this._onTimeout,40,h)):this._type||(this._type=Math.abs(b*g)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,g+=this._lastValue)),h.shiftKey&&g&&(g/=4),this._type&&(this._lastWheelEvent=h,this._delta-=g,this._active||this._start(h)),h.preventDefault()}},fa.prototype._onTimeout=function(h){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(h)},fa.prototype._start=function(h){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var g=de.mousePos(this._el,h);this._around=M.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(g)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},fa.prototype.renderFrame=function(){var h=this;if(this._frameId&&(this._frameId=null,this.isActive())){var g=this._map.transform;if(this._delta!==0){var d=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,b=2/(1+Math.exp(-Math.abs(this._delta*d)));this._delta<0&&b!==0&&(b=1/b);var B=typeof this._targetZoom=="number"?g.zoomScale(this._targetZoom):g.scale;this._targetZoom=Math.min(g.maxZoom,Math.max(g.minZoom,g.scaleZoom(B*b))),this._type==="wheel"&&(this._startZoom=g.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var G,q=typeof this._targetZoom=="number"?this._targetZoom:g.zoom,te=this._startZoom,fe=this._easing,ce=!1;if(this._type==="wheel"&&te&&fe){var Te=Math.min((M.browser.now()-this._lastWheelEventTime)/200,1),Ie=fe(Te);G=M.number(te,q,Ie),Te<1?this._frameId||(this._frameId=!0):ce=!0}else G=q,ce=!0;return this._active=!0,ce&&(this._active=!1,this._finishTimeout=setTimeout(function(){h._zooming=!1,h._handler._triggerRenderFrame(),delete h._targetZoom,delete h._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ce,zoomDelta:G-g.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},fa.prototype._smoothOutEasing=function(h){var g=M.ease;if(this._prevEase){var d=this._prevEase,b=(M.browser.now()-d.start)/d.duration,B=d.easing(b+.01)-d.easing(b),G=.27/Math.sqrt(B*B+1e-4)*.01,q=Math.sqrt(.0729-G*G);g=M.bezier(G,q,.25,1)}return this._prevEase={start:M.browser.now(),duration:h,easing:g},g},fa.prototype.blur=function(){this.reset()},fa.prototype.reset=function(){this._active=!1};var Rs=function(h,g){this._clickZoom=h,this._tapZoom=g};Rs.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Rs.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Rs.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Rs.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var hs=function(){this.reset()};hs.prototype.reset=function(){this._active=!1},hs.prototype.blur=function(){this.reset()},hs.prototype.dblclick=function(h,g){return h.preventDefault(),{cameraAnimation:function(d){d.easeTo({duration:300,zoom:d.getZoom()+(h.shiftKey?-1:1),around:d.unproject(g)},{originalEvent:h})}}},hs.prototype.enable=function(){this._enabled=!0},hs.prototype.disable=function(){this._enabled=!1,this.reset()},hs.prototype.isEnabled=function(){return this._enabled},hs.prototype.isActive=function(){return this._active};var lu=function(){this._tap=new ai({numTouches:1,numTaps:1}),this.reset()};lu.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},lu.prototype.touchstart=function(h,g,d){this._swipePoint||(this._tapTime&&h.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?d.length>0&&(this._swipePoint=g[0],this._swipeTouch=d[0].identifier):this._tap.touchstart(h,g,d))},lu.prototype.touchmove=function(h,g,d){if(this._tapTime){if(this._swipePoint){if(d[0].identifier!==this._swipeTouch)return;var b=g[0],B=b.y-this._swipePoint.y;return this._swipePoint=b,h.preventDefault(),this._active=!0,{zoomDelta:B/128}}}else this._tap.touchmove(h,g,d)},lu.prototype.touchend=function(h,g,d){this._tapTime?this._swipePoint&&d.length===0&&this.reset():this._tap.touchend(h,g,d)&&(this._tapTime=h.timeStamp)},lu.prototype.touchcancel=function(){this.reset()},lu.prototype.enable=function(){this._enabled=!0},lu.prototype.disable=function(){this._enabled=!1,this.reset()},lu.prototype.isEnabled=function(){return this._enabled},lu.prototype.isActive=function(){return this._active};var wu=function(h,g,d){this._el=h,this._mousePan=g,this._touchPan=d};wu.prototype.enable=function(h){this._inertiaOptions=h||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},wu.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},wu.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},wu.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var uh=function(h,g,d){this._pitchWithRotate=h.pitchWithRotate,this._mouseRotate=g,this._mousePitch=d};uh.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},uh.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},uh.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},uh.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var ch=function(h,g,d,b){this._el=h,this._touchZoom=g,this._touchRotate=d,this._tapDragZoom=b,this._rotationDisabled=!1,this._enabled=!0};ch.prototype.enable=function(h){this._touchZoom.enable(h),this._rotationDisabled||this._touchRotate.enable(h),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},ch.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},ch.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},ch.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},ch.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},ch.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Nu=function(h){return h.zoom||h.drag||h.pitch||h.rotate},Qp=function(h){function g(){h.apply(this,arguments)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g}(M.Event);function Gi(h){return h.panDelta&&h.panDelta.mag()||h.zoomDelta||h.bearingDelta||h.pitchDelta}var Si=function(h,g){this._map=h,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Qh(h),this._bearingSnap=g.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(g),M.bindAll(["handleEvent","handleWindowEvent"],this);var d=this._el;this._listeners=[[d,"touchstart",{passive:!0}],[d,"touchmove",{passive:!1}],[d,"touchend",void 0],[d,"touchcancel",void 0],[d,"mousedown",void 0],[d,"mousemove",void 0],[d,"mouseup",void 0],[M.window.document,"mousemove",{capture:!0}],[M.window.document,"mouseup",void 0],[d,"mouseover",void 0],[d,"mouseout",void 0],[d,"dblclick",void 0],[d,"click",void 0],[d,"keydown",{capture:!1}],[d,"keyup",void 0],[d,"wheel",{passive:!1}],[d,"contextmenu",void 0],[M.window,"blur",void 0]];for(var b=0,B=this._listeners;bq?Math.min(2,Dr):Math.max(.5,Dr),di=Math.pow(Gn,1-sn),Di=G.unproject(pr.add(tr.mult(sn*di)).mult(nn));G.setLocationAtPoint(G.renderWorldCopies?Di.wrap():Di,ct)}B._fireMoveEvents(b)},function(sn){B._afterEase(b,sn)},d),this},g.prototype._prepareEase=function(d,b,B){B===void 0&&(B={}),this._moving=!0,b||B.moving||this.fire(new M.Event("movestart",d)),this._zooming&&!B.zooming&&this.fire(new M.Event("zoomstart",d)),this._rotating&&!B.rotating&&this.fire(new M.Event("rotatestart",d)),this._pitching&&!B.pitching&&this.fire(new M.Event("pitchstart",d))},g.prototype._fireMoveEvents=function(d){this.fire(new M.Event("move",d)),this._zooming&&this.fire(new M.Event("zoom",d)),this._rotating&&this.fire(new M.Event("rotate",d)),this._pitching&&this.fire(new M.Event("pitch",d))},g.prototype._afterEase=function(d,b){if(!this._easeId||!b||this._easeId!==b){delete this._easeId;var B=this._zooming,G=this._rotating,q=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,B&&this.fire(new M.Event("zoomend",d)),G&&this.fire(new M.Event("rotateend",d)),q&&this.fire(new M.Event("pitchend",d)),this.fire(new M.Event("moveend",d))}},g.prototype.flyTo=function(d,b){var B=this;if(!d.essential&&M.browser.prefersReducedMotion){var G=M.pick(d,["center","zoom","bearing","pitch","around"]);return this.jumpTo(G,b)}this.stop(),d=M.extend({offset:[0,0],speed:1.2,curve:1.42,easing:M.ease},d);var q=this.transform,te=this.getZoom(),fe=this.getBearing(),ce=this.getPitch(),Te=this.getPadding(),Ie="zoom"in d?M.clamp(+d.zoom,q.minZoom,q.maxZoom):te,Oe="bearing"in d?this._normalizeBearing(d.bearing,fe):fe,Qe="pitch"in d?+d.pitch:ce,nt="padding"in d?d.padding:q.padding,ct=q.zoomScale(Ie-te),tt=M.Point.convert(d.offset),Tt=q.centerPoint.add(tt),Ut=q.pointLocation(Tt),Nt=M.LngLat.convert(d.center||Ut);this._normalizeCenter(Nt);var pr=q.project(Ut),tr=q.project(Nt).sub(pr),Dr=d.curve,Hr=Math.max(q.width,q.height),sn=Hr/ct,nn=tr.mag();if("minZoom"in d){var Gn=M.clamp(Math.min(d.minZoom,te,Ie),q.minZoom,q.maxZoom),di=Hr/q.zoomScale(Gn-te);Dr=Math.sqrt(di/nn*2)}var Di=Dr*Dr;function Ui(xo){var qi=(sn*sn-Hr*Hr+(xo?-1:1)*Di*Di*nn*nn)/(2*(xo?sn:Hr)*Di*nn);return Math.log(Math.sqrt(qi*qi+1)-qi)}function ho(xo){return(Math.exp(xo)-Math.exp(-xo))/2}function gi(xo){return(Math.exp(xo)+Math.exp(-xo))/2}var Wi=Ui(0),Ko=function(xo){return gi(Wi)/gi(Wi+Dr*xo)},Mo=function(xo){return Hr*((gi(Wi)*(ho(qi=Wi+Dr*xo)/gi(qi))-ho(Wi))/Di)/nn;var qi},mo=(Ui(1)-Wi)/Dr;if(Math.abs(nn)<1e-6||!isFinite(mo)){if(Math.abs(Hr-sn)<1e-6)return this.easeTo(d,b);var ko=snd.maxDuration&&(d.duration=0),this._zooming=!0,this._rotating=fe!==Oe,this._pitching=Qe!==ce,this._padding=!q.isPaddingEqual(nt),this._prepareEase(b,!1),this._ease(function(xo){var qi=xo*mo,xs=1/Ko(qi);q.zoom=xo===1?Ie:te+q.scaleZoom(xs),B._rotating&&(q.bearing=M.number(fe,Oe,xo)),B._pitching&&(q.pitch=M.number(ce,Qe,xo)),B._padding&&(q.interpolatePadding(Te,nt,xo),Tt=q.centerPoint.add(tt));var gs=xo===1?Nt:q.unproject(pr.add(tr.mult(Mo(qi))).mult(xs));q.setLocationAtPoint(q.renderWorldCopies?gs.wrap():gs,Tt),B._fireMoveEvents(b)},function(){return B._afterEase(b)},d),this},g.prototype.isEasing=function(){return!!this._easeFrameId},g.prototype.stop=function(){return this._stop()},g.prototype._stop=function(d,b){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var B=this._onEaseEnd;delete this._onEaseEnd,B.call(this,b)}if(!d){var G=this.handlers;G&&G.stop(!1)}return this},g.prototype._ease=function(d,b,B){B.animate===!1||B.duration===0?(d(1),b()):(this._easeStart=M.browser.now(),this._easeOptions=B,this._onEaseFrame=d,this._onEaseEnd=b,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},g.prototype._renderFrameCallback=function(){var d=Math.min((M.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(d)),d<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},g.prototype._normalizeBearing=function(d,b){d=M.wrap(d,-180,180);var B=Math.abs(d-b);return Math.abs(d-360-b)180?-360:B<-180?360:0}},g}(M.Evented),ao=function(h){h===void 0&&(h={}),this.options=h,M.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};ao.prototype.getDefaultPosition=function(){return"bottom-right"},ao.prototype.onAdd=function(h){var g=this.options&&this.options.compact;return this._map=h,this._container=de.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=de.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=de.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),g&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),g===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},ao.prototype.onRemove=function(){de.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},ao.prototype._setElementTitle=function(h,g){var d=this._map._getUIString("AttributionControl."+g);h.title=d,h.setAttribute("aria-label",d)},ao.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},ao.prototype._updateEditLink=function(){var h=this._editLink;h||(h=this._editLink=this._container.querySelector(".mapbox-improve-map"));var g=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||M.config.ACCESS_TOKEN}];if(h){var d=g.reduce(function(b,B,G){return B.value&&(b+=B.key+"="+B.value+(G=0)return!1;return!0})).join(" | ");q!==this._attribHTML&&(this._attribHTML=q,h.length?(this._innerContainer.innerHTML=q,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},ao.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Ic=function(){M.bindAll(["_updateLogo"],this),M.bindAll(["_updateCompact"],this)};Ic.prototype.onAdd=function(h){this._map=h,this._container=de.create("div","mapboxgl-ctrl");var g=de.create("a","mapboxgl-ctrl-logo");return g.target="_blank",g.rel="noopener nofollow",g.href="https://www.mapbox.com/",g.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),g.setAttribute("rel","noopener nofollow"),this._container.appendChild(g),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Ic.prototype.onRemove=function(){de.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Ic.prototype.getDefaultPosition=function(){return"bottom-left"},Ic.prototype._updateLogo=function(h){h&&h.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},Ic.prototype._logoRequired=function(){if(this._map.style){var h=this._map.style.sourceCaches;for(var g in h)if(h[g].getSource().mapbox_logo)return!0;return!1}},Ic.prototype._updateCompact=function(){var h=this._container.children;if(h.length){var g=h[0];this._map.getCanvasContainer().offsetWidth<250?g.classList.add("mapboxgl-compact"):g.classList.remove("mapboxgl-compact")}};var Gs=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Gs.prototype.add=function(h){var g=++this._id;return this._queue.push({callback:h,id:g,cancelled:!1}),g},Gs.prototype.remove=function(h){for(var g=this._currentlyRunning,d=0,b=g?this._queue.concat(g):this._queue;db.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(b.minPitch!=null&&b.maxPitch!=null&&b.minPitch>b.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(b.minPitch!=null&&b.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(b.maxPitch!=null&&b.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var G=new Sa(b.minZoom,b.maxZoom,b.minPitch,b.maxPitch,b.renderWorldCopies);if(h.call(this,G,b),this._interactive=b.interactive,this._maxTileCacheSize=b.maxTileCacheSize,this._failIfMajorPerformanceCaveat=b.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=b.preserveDrawingBuffer,this._antialias=b.antialias,this._trackResize=b.trackResize,this._bearingSnap=b.bearingSnap,this._refreshExpiredTiles=b.refreshExpiredTiles,this._fadeDuration=b.fadeDuration,this._crossSourceCollisions=b.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=b.collectResourceTiming,this._renderTaskQueue=new Gs,this._controls=[],this._mapId=M.uniqueId(),this._locale=M.extend({},Lc,b.locale),this._clickTolerance=b.clickTolerance,this._requestManager=new M.RequestManager(b.transformRequest,b.accessToken),typeof b.container=="string"){if(this._container=M.window.document.getElementById(b.container),!this._container)throw new Error("Container '"+b.container+"' not found.")}else{if(!(b.container instanceof Nh))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=b.container}if(b.maxBounds&&this.setMaxBounds(b.maxBounds),M.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return B._update(!1)}),this.on("moveend",function(){return B._update(!1)}),this.on("zoom",function(){return B._update(!0)}),M.window!==void 0&&(M.window.addEventListener("online",this._onWindowOnline,!1),M.window.addEventListener("resize",this._onWindowResize,!1),M.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Si(this,b),this._hash=b.hash&&new ku(typeof b.hash=="string"&&b.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:b.center,zoom:b.zoom,bearing:b.bearing,pitch:b.pitch}),b.bounds&&(this.resize(),this.fitBounds(b.bounds,M.extend({},b.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=b.localIdeographFontFamily,b.style&&this.setStyle(b.style,{localIdeographFontFamily:b.localIdeographFontFamily}),b.attributionControl&&this.addControl(new ao({customAttribution:b.customAttribution})),this.addControl(new Ic,b.logoPosition),this.on("style.load",function(){B.transform.unmodified&&B.jumpTo(B.style.stylesheet)}),this.on("data",function(q){B._update(q.dataType==="style"),B.fire(new M.Event(q.dataType+"data",q))}),this.on("dataloading",function(q){B.fire(new M.Event(q.dataType+"dataloading",q))})}h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g;var d={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return g.prototype._getMapId=function(){return this._mapId},g.prototype.addControl=function(b,B){if(B===void 0&&(B=b.getDefaultPosition?b.getDefaultPosition():"top-right"),!b||!b.onAdd)return this.fire(new M.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var G=b.onAdd(this);this._controls.push(b);var q=this._controlPositions[B];return B.indexOf("bottom")!==-1?q.insertBefore(G,q.firstChild):q.appendChild(G),this},g.prototype.removeControl=function(b){if(!b||!b.onRemove)return this.fire(new M.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var B=this._controls.indexOf(b);return B>-1&&this._controls.splice(B,1),b.onRemove(this),this},g.prototype.hasControl=function(b){return this._controls.indexOf(b)>-1},g.prototype.resize=function(b){var B=this._containerDimensions(),G=B[0],q=B[1];if(G===this.transform.width&&q===this.transform.height)return this;this._resizeCanvas(G,q),this.transform.resize(G,q),this.painter.resize(G,q);var te=!this._moving;return te&&this.fire(new M.Event("movestart",b)).fire(new M.Event("move",b)),this.fire(new M.Event("resize",b)),te&&this.fire(new M.Event("moveend",b)),this},g.prototype.getBounds=function(){return this.transform.getBounds()},g.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},g.prototype.setMaxBounds=function(b){return this.transform.setMaxBounds(M.LngLatBounds.convert(b)),this._update()},g.prototype.setMinZoom=function(b){if((b=b==null?-2:b)>=-2&&b<=this.transform.maxZoom)return this.transform.minZoom=b,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=b,this._update(),this.getZoom()>b&&this.setZoom(b),this;throw new Error("maxZoom must be greater than the current minZoom")},g.prototype.getMaxZoom=function(){return this.transform.maxZoom},g.prototype.setMinPitch=function(b){if((b=b==null?0:b)<0)throw new Error("minPitch must be greater than or equal to 0");if(b>=0&&b<=this.transform.maxPitch)return this.transform.minPitch=b,this._update(),this.getPitch()60)throw new Error("maxPitch must be less than or equal to 60");if(b>=this.transform.minPitch)return this.transform.maxPitch=b,this._update(),this.getPitch()>b&&this.setPitch(b),this;throw new Error("maxPitch must be greater than the current minPitch")},g.prototype.getMaxPitch=function(){return this.transform.maxPitch},g.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},g.prototype.setRenderWorldCopies=function(b){return this.transform.renderWorldCopies=b,this._update()},g.prototype.project=function(b){return this.transform.locationPoint(M.LngLat.convert(b))},g.prototype.unproject=function(b){return this.transform.pointLocation(M.Point.convert(b))},g.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},g.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},g.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},g.prototype._createDelegatedListener=function(b,B,G){var q,te=this;if(b==="mouseenter"||b==="mouseover"){var fe=!1;return{layer:B,listener:G,delegates:{mousemove:function(Te){var Ie=te.getLayer(B)?te.queryRenderedFeatures(Te.point,{layers:[B]}):[];Ie.length?fe||(fe=!0,G.call(te,new ll(b,te,Te.originalEvent,{features:Ie}))):fe=!1},mouseout:function(){fe=!1}}}}if(b==="mouseleave"||b==="mouseout"){var ce=!1;return{layer:B,listener:G,delegates:{mousemove:function(Te){(te.getLayer(B)?te.queryRenderedFeatures(Te.point,{layers:[B]}):[]).length?ce=!0:ce&&(ce=!1,G.call(te,new ll(b,te,Te.originalEvent)))},mouseout:function(Te){ce&&(ce=!1,G.call(te,new ll(b,te,Te.originalEvent)))}}}}return{layer:B,listener:G,delegates:(q={},q[b]=function(Te){var Ie=te.getLayer(B)?te.queryRenderedFeatures(Te.point,{layers:[B]}):[];Ie.length&&(Te.features=Ie,G.call(te,Te),delete Te.features)},q)}},g.prototype.on=function(b,B,G){if(G===void 0)return h.prototype.on.call(this,b,B);var q=this._createDelegatedListener(b,B,G);for(var te in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[b]=this._delegatedListeners[b]||[],this._delegatedListeners[b].push(q),q.delegates)this.on(te,q.delegates[te]);return this},g.prototype.once=function(b,B,G){if(G===void 0)return h.prototype.once.call(this,b,B);var q=this._createDelegatedListener(b,B,G);for(var te in q.delegates)this.once(te,q.delegates[te]);return this},g.prototype.off=function(b,B,G){var q=this;return G===void 0?h.prototype.off.call(this,b,B):(this._delegatedListeners&&this._delegatedListeners[b]&&function(te){for(var fe=te[b],ce=0;ce180;){var q=d.locationPoint(h);if(q.x>=0&&q.y>=0&&q.x<=d.width&&q.y<=d.height)break;h.lng>d.center.lng?h.lng-=360:h.lng+=360}return h}Du.prototype.down=function(h,g){this.mouseRotate.mousedown(h,g),this.mousePitch&&this.mousePitch.mousedown(h,g),de.disableDrag()},Du.prototype.move=function(h,g){var d=this.map,b=this.mouseRotate.mousemoveWindow(h,g);if(b&&b.bearingDelta&&d.setBearing(d.getBearing()+b.bearingDelta),this.mousePitch){var B=this.mousePitch.mousemoveWindow(h,g);B&&B.pitchDelta&&d.setPitch(d.getPitch()+B.pitchDelta)}},Du.prototype.off=function(){var h=this.element;de.removeEventListener(h,"mousedown",this.mousedown),de.removeEventListener(h,"touchstart",this.touchstart,{passive:!1}),de.removeEventListener(h,"touchmove",this.touchmove),de.removeEventListener(h,"touchend",this.touchend),de.removeEventListener(h,"touchcancel",this.reset),this.offTemp()},Du.prototype.offTemp=function(){de.enableDrag(),de.removeEventListener(M.window,"mousemove",this.mousemove),de.removeEventListener(M.window,"mouseup",this.mouseup)},Du.prototype.mousedown=function(h){this.down(M.extend({},h,{ctrlKey:!0,preventDefault:function(){return h.preventDefault()}}),de.mousePos(this.element,h)),de.addEventListener(M.window,"mousemove",this.mousemove),de.addEventListener(M.window,"mouseup",this.mouseup)},Du.prototype.mousemove=function(h){this.move(h,de.mousePos(this.element,h))},Du.prototype.mouseup=function(h){this.mouseRotate.mouseupWindow(h),this.mousePitch&&this.mousePitch.mouseupWindow(h),this.offTemp()},Du.prototype.touchstart=function(h){h.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=de.touchPos(this.element,h.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return h.preventDefault()}},this._startPos))},Du.prototype.touchmove=function(h){h.targetTouches.length!==1?this.reset():(this._lastPos=de.touchPos(this.element,h.targetTouches)[0],this.move({preventDefault:function(){return h.preventDefault()}},this._lastPos))},Du.prototype.touchend=function(h){h.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=b}this._isDragging&&(this._pos=d.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new M.Event("dragstart"))),this.fire(new M.Event("drag")))},g.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new M.Event("dragend")),this._state="inactive"},g.prototype._addDragHandler=function(d){this._element.contains(d.originalEvent.target)&&(d.preventDefault(),this._positionDelta=d.point.sub(this._pos).add(this._offset),this._pointerdownPos=d.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},g.prototype.setDraggable=function(d){return this._draggable=!!d,this._map&&(d?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},g.prototype.isDraggable=function(){return this._draggable},g.prototype.setRotation=function(d){return this._rotation=d||0,this._update(),this},g.prototype.getRotation=function(){return this._rotation},g.prototype.setRotationAlignment=function(d){return this._rotationAlignment=d||"auto",this._update(),this},g.prototype.getRotationAlignment=function(){return this._rotationAlignment},g.prototype.setPitchAlignment=function(d){return this._pitchAlignment=d&&d!=="auto"?d:this._rotationAlignment,this._update(),this},g.prototype.getPitchAlignment=function(){return this._pitchAlignment},g}(M.Evented),Yl={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Th=0,ba=!1,z=function(h){function g(d){h.call(this),this.options=M.extend({},Yl,d),M.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.onAdd=function(d){var b;return this._map=d,this._container=de.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),b=this._setupUI,Sh!==void 0?b(Sh):M.window.navigator.permissions!==void 0?M.window.navigator.permissions.query({name:"geolocation"}).then(function(B){b(Sh=B.state!=="denied")}):b(Sh=!!M.window.navigator.geolocation),this._container},g.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(M.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),de.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Th=0,ba=!1},g.prototype._isOutOfMapMaxBounds=function(d){var b=this._map.getMaxBounds(),B=d.coords;return b&&(B.longitudeb.getEast()||B.latitudeb.getNorth())},g.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},g.prototype._onSuccess=function(d){if(this._map){if(this._isOutOfMapMaxBounds(d))return this._setErrorState(),this.fire(new M.Event("outofmaxbounds",d)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=d,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(d),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(d),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new M.Event("geolocate",d)),this._finish()}},g.prototype._updateCamera=function(d){var b=new M.LngLat(d.coords.longitude,d.coords.latitude),B=d.coords.accuracy,G=this._map.getBearing(),q=M.extend({bearing:G},this.options.fitBoundsOptions);this._map.fitBounds(b.toBounds(B),q,{geolocateSource:!0})},g.prototype._updateMarker=function(d){if(d){var b=new M.LngLat(d.coords.longitude,d.coords.latitude);this._accuracyCircleMarker.setLngLat(b).addTo(this._map),this._userLocationDotMarker.setLngLat(b).addTo(this._map),this._accuracy=d.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},g.prototype._updateCircleRadius=function(){var d=this._map._container.clientHeight/2,b=this._map.unproject([0,d]),B=this._map.unproject([1,d]),G=b.distanceTo(B),q=Math.ceil(2*this._accuracy/G);this._circleElement.style.width=q+"px",this._circleElement.style.height=q+"px"},g.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},g.prototype._onError=function(d){if(this._map){if(this.options.trackUserLocation)if(d.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var b=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=b,this._geolocateButton.setAttribute("aria-label",b),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(d.code===3&&ba)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new M.Event("error",d)),this._finish()}},g.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},g.prototype._setupUI=function(d){var b=this;if(this._container.addEventListener("contextmenu",function(q){return q.preventDefault()}),this._geolocateButton=de.create("button","mapboxgl-ctrl-geolocate",this._container),de.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",d===!1){M.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var B=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=B,this._geolocateButton.setAttribute("aria-label",B)}else{var G=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=G,this._geolocateButton.setAttribute("aria-label",G)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=de.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new nc(this._dotElement),this._circleElement=de.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new nc({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(q){q.geolocateSource||b._watchState!=="ACTIVE_LOCK"||q.originalEvent&&q.originalEvent.type==="resize"||(b._watchState="BACKGROUND",b._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),b._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),b.fire(new M.Event("trackuserlocationend")))})},g.prototype.trigger=function(){if(!this._setup)return M.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new M.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Th--,ba=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new M.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new M.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var d;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Th>1?(d={maximumAge:6e5,timeout:0},ba=!0):(d=this.options.positionOptions,ba=!1),this._geolocationWatchID=M.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,d)}}else M.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},g.prototype._clearWatch=function(){M.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},g}(M.Evented),s={maxWidth:100,unit:"metric"},x=function(h){this.options=M.extend({},s,h),M.bindAll(["_onMove","setUnit"],this)};function I(h,g,d){var b=d&&d.maxWidth||100,B=h._container.clientHeight/2,G=h.unproject([0,B]),q=h.unproject([b,B]),te=G.distanceTo(q);if(d&&d.unit==="imperial"){var fe=3.2808*te;fe>5280?k(g,b,fe/5280,h._getUIString("ScaleControl.Miles")):k(g,b,fe,h._getUIString("ScaleControl.Feet"))}else d&&d.unit==="nautical"?k(g,b,te/1852,h._getUIString("ScaleControl.NauticalMiles")):te>=1e3?k(g,b,te/1e3,h._getUIString("ScaleControl.Kilometers")):k(g,b,te,h._getUIString("ScaleControl.Meters"))}function k(h,g,d,b){var B,G,q,te=(B=d,(G=Math.pow(10,(""+Math.floor(B)).length-1))*(q=(q=B/G)>=10?10:q>=5?5:q>=3?3:q>=2?2:q>=1?1:function(fe){var ce=Math.pow(10,Math.ceil(-Math.log(fe)/Math.LN10));return Math.round(fe*ce)/ce}(q)));h.style.width=g*(te/d)+"px",h.innerHTML=te+" "+b}x.prototype.getDefaultPosition=function(){return"bottom-left"},x.prototype._onMove=function(){I(this._map,this._container,this.options)},x.prototype.onAdd=function(h){return this._map=h,this._container=de.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",h.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},x.prototype.onRemove=function(){de.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},x.prototype.setUnit=function(h){this.options.unit=h,I(this._map,this._container,this.options)};var H=function(h){this._fullscreen=!1,h&&h.container&&(h.container instanceof M.window.HTMLElement?this._container=h.container:M.warnOnce("Full screen control 'container' must be a DOM element.")),M.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in M.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in M.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in M.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in M.window.document&&(this._fullscreenchange="MSFullscreenChange")};H.prototype.onAdd=function(h){return this._map=h,this._container||(this._container=this._map.getContainer()),this._controlContainer=de.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",M.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},H.prototype.onRemove=function(){de.remove(this._controlContainer),this._map=null,M.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},H.prototype._checkFullscreenSupport=function(){return!!(M.window.document.fullscreenEnabled||M.window.document.mozFullScreenEnabled||M.window.document.msFullscreenEnabled||M.window.document.webkitFullscreenEnabled)},H.prototype._setupUI=function(){var h=this._fullscreenButton=de.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);de.create("span","mapboxgl-ctrl-icon",h).setAttribute("aria-hidden",!0),h.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),M.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},H.prototype._updateTitle=function(){var h=this._getTitle();this._fullscreenButton.setAttribute("aria-label",h),this._fullscreenButton.title=h},H.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},H.prototype._isFullscreen=function(){return this._fullscreen},H.prototype._changeIcon=function(){(M.window.document.fullscreenElement||M.window.document.mozFullScreenElement||M.window.document.webkitFullscreenElement||M.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},H.prototype._onClickFullscreen=function(){this._isFullscreen()?M.window.document.exitFullscreen?M.window.document.exitFullscreen():M.window.document.mozCancelFullScreen?M.window.document.mozCancelFullScreen():M.window.document.msExitFullscreen?M.window.document.msExitFullscreen():M.window.document.webkitCancelFullScreen&&M.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var ee={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ne=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),ue=function(h){function g(d){h.call(this),this.options=M.extend(Object.create(ee),d),M.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return h&&(g.__proto__=h),(g.prototype=Object.create(h&&h.prototype)).constructor=g,g.prototype.addTo=function(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new M.Event("open")),this},g.prototype.isOpen=function(){return!!this._map},g.prototype.remove=function(){return this._content&&de.remove(this._content),this._container&&(de.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new M.Event("close")),this},g.prototype.getLngLat=function(){return this._lngLat},g.prototype.setLngLat=function(d){return this._lngLat=M.LngLat.convert(d),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},g.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},g.prototype.getElement=function(){return this._container},g.prototype.setText=function(d){return this.setDOMContent(M.window.document.createTextNode(d))},g.prototype.setHTML=function(d){var b,B=M.window.document.createDocumentFragment(),G=M.window.document.createElement("body");for(G.innerHTML=d;b=G.firstChild;)B.appendChild(b);return this.setDOMContent(B)},g.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},g.prototype.setMaxWidth=function(d){return this.options.maxWidth=d,this._update(),this},g.prototype.setDOMContent=function(d){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=de.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(d),this._createCloseButton(),this._update(),this._focusFirstElement(),this},g.prototype.addClassName=function(d){this._container&&this._container.classList.add(d)},g.prototype.removeClassName=function(d){this._container&&this._container.classList.remove(d)},g.prototype.setOffset=function(d){return this.options.offset=d,this._update(),this},g.prototype.toggleClassName=function(d){if(this._container)return this._container.classList.toggle(d)},g.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=de.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},g.prototype._onMouseUp=function(d){this._update(d.point)},g.prototype._onMouseMove=function(d){this._update(d.point)},g.prototype._onDrag=function(d){this._update(d.point)},g.prototype._update=function(d){var b=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=de.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=de.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(Ie){return b._container.classList.add(Ie)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=zh(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||d)){var B=this._pos=this._trackPointer&&d?d:this._map.project(this._lngLat),G=this.options.anchor,q=function Ie(Oe){if(Oe){if(typeof Oe=="number"){var Qe=Math.round(Math.sqrt(.5*Math.pow(Oe,2)));return{center:new M.Point(0,0),top:new M.Point(0,Oe),"top-left":new M.Point(Qe,Qe),"top-right":new M.Point(-Qe,Qe),bottom:new M.Point(0,-Oe),"bottom-left":new M.Point(Qe,-Qe),"bottom-right":new M.Point(-Qe,-Qe),left:new M.Point(Oe,0),right:new M.Point(-Oe,0)}}if(Oe instanceof M.Point||Array.isArray(Oe)){var nt=M.Point.convert(Oe);return{center:nt,top:nt,"top-left":nt,"top-right":nt,bottom:nt,"bottom-left":nt,"bottom-right":nt,left:nt,right:nt}}return{center:M.Point.convert(Oe.center||[0,0]),top:M.Point.convert(Oe.top||[0,0]),"top-left":M.Point.convert(Oe["top-left"]||[0,0]),"top-right":M.Point.convert(Oe["top-right"]||[0,0]),bottom:M.Point.convert(Oe.bottom||[0,0]),"bottom-left":M.Point.convert(Oe["bottom-left"]||[0,0]),"bottom-right":M.Point.convert(Oe["bottom-right"]||[0,0]),left:M.Point.convert(Oe.left||[0,0]),right:M.Point.convert(Oe.right||[0,0])}}return Ie(new M.Point(0,0))}(this.options.offset);if(!G){var te,fe=this._container.offsetWidth,ce=this._container.offsetHeight;te=B.y+q.bottom.ythis._map.transform.height-ce?["bottom"]:[],B.xthis._map.transform.width-fe/2&&te.push("right"),G=te.length===0?"bottom":te.join("-")}var Te=B.add(q[G]).round();de.setTransform(this._container,Su[G]+" translate("+Te.x+"px,"+Te.y+"px)"),qc(this._container,G,"popup")}},g.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var d=this._container.querySelector(ne);d&&d.focus()}},g.prototype._onClose=function(){this.remove()},g}(M.Evented),_e={version:M.version,supported:R,setRTLTextPlugin:M.setRTLTextPlugin,getRTLTextPluginStatus:M.getRTLTextPluginStatus,Map:Lu,NavigationControl:pc,GeolocateControl:z,AttributionControl:ao,ScaleControl:x,FullscreenControl:H,Popup:ue,Marker:nc,Style:Nl,LngLat:M.LngLat,LngLatBounds:M.LngLatBounds,Point:M.Point,MercatorCoordinate:M.MercatorCoordinate,Evented:M.Evented,config:M.config,prewarm:function(){Lr().acquire(mr)},clearPrewarmedResources:function(){var h=fn;h&&(h.isPreloaded()&&h.numActive()===1?(h.release(mr),fn=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return M.config.ACCESS_TOKEN},set accessToken(h){M.config.ACCESS_TOKEN=h},get baseApiUrl(){return M.config.API_URL},set baseApiUrl(h){M.config.API_URL=h},get workerCount(){return Sr.workerCount},set workerCount(h){Sr.workerCount=h},get maxParallelImageRequests(){return M.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(h){M.config.MAX_PARALLEL_IMAGE_REQUESTS=h},clearStorage:function(h){M.clearTileCache(h)},workerUrl:""};return _e}),ve})},96706:function(Zr,_r,Se){(function(){var ve=Se(1048),Ze=Se(6636).utf8,M=Se(13149),R=Se(6636).bin,de=function(be,Le){be.constructor==String?Le&&Le.encoding==="binary"?be=R.stringToBytes(be):be=Ze.stringToBytes(be):M(be)?be=Array.prototype.slice.call(be,0):!Array.isArray(be)&&be.constructor!==Uint8Array&&(be=be.toString());for(var Re=ve.bytesToWords(be),Ce=be.length*8,He=1732584193,Xe=-271733879,Ke=-1732584194,Ve=271733878,et=0;et>>24)&16711935|(Re[et]<<24|Re[et]>>>8)&4278255360;Re[Ce>>>5]|=128<>>9<<4)+14]=Ce;for(var er=de._ff,fr=de._gg,Ar=de._hh,pn=de._ii,et=0;et>>0,Xe=Xe+Jn>>>0,Ke=Ke+ki>>>0,Ve=Ve+pa>>>0}return ve.endian([He,Xe,Ke,Ve])};de._ff=function(be,Le,Re,Ce,He,Xe,Ke){var Ve=be+(Le&Re|~Le&Ce)+(He>>>0)+Ke;return(Ve<>>32-Xe)+Le},de._gg=function(be,Le,Re,Ce,He,Xe,Ke){var Ve=be+(Le&Ce|Re&~Ce)+(He>>>0)+Ke;return(Ve<>>32-Xe)+Le},de._hh=function(be,Le,Re,Ce,He,Xe,Ke){var Ve=be+(Le^Re^Ce)+(He>>>0)+Ke;return(Ve<>>32-Xe)+Le},de._ii=function(be,Le,Re,Ce,He,Xe,Ke){var Ve=be+(Re^(Le|~Ce))+(He>>>0)+Ke;return(Ve<>>32-Xe)+Le},de._blocksize=16,de._digestsize=16,Zr.exports=function(be,Le){if(be==null)throw new Error("Illegal argument "+be);var Re=ve.wordsToBytes(de(be,Le));return Le&&Le.asBytes?Re:Le&&Le.asString?R.bytesToString(Re):ve.bytesToHex(Re)}})()},63713:function(Zr,_r,Se){"use strict";Zr.exports=Ze;var ve=Se(30551);function Ze(qe){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(qe)?qe:new Uint8Array(qe||0),this.pos=0,this.type=0,this.length=this.buf.length}Ze.Varint=0,Ze.Fixed64=1,Ze.Bytes=2,Ze.Fixed32=5;var M=65536*65536,R=1/M,de=12,be=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");Ze.prototype={destroy:function(){this.buf=null},readFields:function(qe,Dt,$e){for($e=$e||this.length;this.pos<$e;){var Pt=this.readVarint(),vt=Pt>>3,rr=this.pos;this.type=Pt&7,qe(vt,Dt,this),this.pos===rr&&this.skip(Pt)}return Dt},readMessage:function(qe,Dt){return this.readFields(qe,Dt,this.readVarint()+this.pos)},readFixed32:function(){var qe=xr(this.buf,this.pos);return this.pos+=4,qe},readSFixed32:function(){var qe=Jr(this.buf,this.pos);return this.pos+=4,qe},readFixed64:function(){var qe=xr(this.buf,this.pos)+xr(this.buf,this.pos+4)*M;return this.pos+=8,qe},readSFixed64:function(){var qe=xr(this.buf,this.pos)+Jr(this.buf,this.pos+4)*M;return this.pos+=8,qe},readFloat:function(){var qe=ve.read(this.buf,this.pos,!0,23,4);return this.pos+=4,qe},readDouble:function(){var qe=ve.read(this.buf,this.pos,!0,52,8);return this.pos+=8,qe},readVarint:function(qe){var Dt=this.buf,$e,Pt;return Pt=Dt[this.pos++],$e=Pt&127,Pt<128||(Pt=Dt[this.pos++],$e|=(Pt&127)<<7,Pt<128)||(Pt=Dt[this.pos++],$e|=(Pt&127)<<14,Pt<128)||(Pt=Dt[this.pos++],$e|=(Pt&127)<<21,Pt<128)?$e:(Pt=Dt[this.pos],$e|=(Pt&15)<<28,Le($e,qe,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var qe=this.readVarint();return qe%2===1?(qe+1)/-2:qe/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var qe=this.readVarint()+this.pos,Dt=this.pos;return this.pos=qe,qe-Dt>=de&&be?rn(this.buf,Dt,qe):gr(this.buf,Dt,qe)},readBytes:function(){var qe=this.readVarint()+this.pos,Dt=this.buf.subarray(this.pos,qe);return this.pos=qe,Dt},readPackedVarint:function(qe,Dt){if(this.type!==Ze.Bytes)return qe.push(this.readVarint(Dt));var $e=Re(this);for(qe=qe||[];this.pos<$e;)qe.push(this.readVarint(Dt));return qe},readPackedSVarint:function(qe){if(this.type!==Ze.Bytes)return qe.push(this.readSVarint());var Dt=Re(this);for(qe=qe||[];this.pos127;);else if(Dt===Ze.Bytes)this.pos=this.readVarint()+this.pos;else if(Dt===Ze.Fixed32)this.pos+=4;else if(Dt===Ze.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+Dt)},writeTag:function(qe,Dt){this.writeVarint(qe<<3|Dt)},realloc:function(qe){for(var Dt=this.length||16;Dt268435455||qe<0){He(qe,this);return}this.realloc(4),this.buf[this.pos++]=qe&127|(qe>127?128:0),!(qe<=127)&&(this.buf[this.pos++]=(qe>>>=7)&127|(qe>127?128:0),!(qe<=127)&&(this.buf[this.pos++]=(qe>>>=7)&127|(qe>127?128:0),!(qe<=127)&&(this.buf[this.pos++]=qe>>>7&127)))},writeSVarint:function(qe){this.writeVarint(qe<0?-qe*2-1:qe*2)},writeBoolean:function(qe){this.writeVarint(!!qe)},writeString:function(qe){qe=String(qe),this.realloc(qe.length*4),this.pos++;var Dt=this.pos;this.pos=jn(this.buf,qe,this.pos);var $e=this.pos-Dt;$e>=128&&Ve(Dt,$e,this),this.pos=Dt-1,this.writeVarint($e),this.pos+=$e},writeFloat:function(qe){this.realloc(4),ve.write(this.buf,qe,this.pos,!0,23,4),this.pos+=4},writeDouble:function(qe){this.realloc(8),ve.write(this.buf,qe,this.pos,!0,52,8),this.pos+=8},writeBytes:function(qe){var Dt=qe.length;this.writeVarint(Dt),this.realloc(Dt);for(var $e=0;$e=128&&Ve($e,Pt,this),this.pos=$e-1,this.writeVarint(Pt),this.pos+=Pt},writeMessage:function(qe,Dt,$e){this.writeTag(qe,Ze.Bytes),this.writeRawMessage(Dt,$e)},writePackedVarint:function(qe,Dt){Dt.length&&this.writeMessage(qe,et,Dt)},writePackedSVarint:function(qe,Dt){Dt.length&&this.writeMessage(qe,er,Dt)},writePackedBoolean:function(qe,Dt){Dt.length&&this.writeMessage(qe,pn,Dt)},writePackedFloat:function(qe,Dt){Dt.length&&this.writeMessage(qe,fr,Dt)},writePackedDouble:function(qe,Dt){Dt.length&&this.writeMessage(qe,Ar,Dt)},writePackedFixed32:function(qe,Dt){Dt.length&&this.writeMessage(qe,Kn,Dt)},writePackedSFixed32:function(qe,Dt){Dt.length&&this.writeMessage(qe,Jn,Dt)},writePackedFixed64:function(qe,Dt){Dt.length&&this.writeMessage(qe,ki,Dt)},writePackedSFixed64:function(qe,Dt){Dt.length&&this.writeMessage(qe,pa,Dt)},writeBytesField:function(qe,Dt){this.writeTag(qe,Ze.Bytes),this.writeBytes(Dt)},writeFixed32Field:function(qe,Dt){this.writeTag(qe,Ze.Fixed32),this.writeFixed32(Dt)},writeSFixed32Field:function(qe,Dt){this.writeTag(qe,Ze.Fixed32),this.writeSFixed32(Dt)},writeFixed64Field:function(qe,Dt){this.writeTag(qe,Ze.Fixed64),this.writeFixed64(Dt)},writeSFixed64Field:function(qe,Dt){this.writeTag(qe,Ze.Fixed64),this.writeSFixed64(Dt)},writeVarintField:function(qe,Dt){this.writeTag(qe,Ze.Varint),this.writeVarint(Dt)},writeSVarintField:function(qe,Dt){this.writeTag(qe,Ze.Varint),this.writeSVarint(Dt)},writeStringField:function(qe,Dt){this.writeTag(qe,Ze.Bytes),this.writeString(Dt)},writeFloatField:function(qe,Dt){this.writeTag(qe,Ze.Fixed32),this.writeFloat(Dt)},writeDoubleField:function(qe,Dt){this.writeTag(qe,Ze.Fixed64),this.writeDouble(Dt)},writeBooleanField:function(qe,Dt){this.writeVarintField(qe,!!Dt)}};function Le(qe,Dt,$e){var Pt=$e.buf,vt,rr;if(rr=Pt[$e.pos++],vt=(rr&112)>>4,rr<128||(rr=Pt[$e.pos++],vt|=(rr&127)<<3,rr<128)||(rr=Pt[$e.pos++],vt|=(rr&127)<<10,rr<128)||(rr=Pt[$e.pos++],vt|=(rr&127)<<17,rr<128)||(rr=Pt[$e.pos++],vt|=(rr&127)<<24,rr<128)||(rr=Pt[$e.pos++],vt|=(rr&1)<<31,rr<128))return Ce(qe,vt,Dt);throw new Error("Expected varint not more than 10 bytes")}function Re(qe){return qe.type===Ze.Bytes?qe.readVarint()+qe.pos:qe.pos+1}function Ce(qe,Dt,$e){return $e?Dt*4294967296+(qe>>>0):(Dt>>>0)*4294967296+(qe>>>0)}function He(qe,Dt){var $e,Pt;if(qe>=0?($e=qe%4294967296|0,Pt=qe/4294967296|0):($e=~(-qe%4294967296),Pt=~(-qe/4294967296),$e^4294967295?$e=$e+1|0:($e=0,Pt=Pt+1|0)),qe>=18446744073709552e3||qe<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");Dt.realloc(10),Xe($e,Pt,Dt),Ke(Pt,Dt)}function Xe(qe,Dt,$e){$e.buf[$e.pos++]=qe&127|128,qe>>>=7,$e.buf[$e.pos++]=qe&127|128,qe>>>=7,$e.buf[$e.pos++]=qe&127|128,qe>>>=7,$e.buf[$e.pos++]=qe&127|128,qe>>>=7,$e.buf[$e.pos]=qe&127}function Ke(qe,Dt){var $e=(qe&7)<<4;Dt.buf[Dt.pos++]|=$e|((qe>>>=3)?128:0),qe&&(Dt.buf[Dt.pos++]=qe&127|((qe>>>=7)?128:0),qe&&(Dt.buf[Dt.pos++]=qe&127|((qe>>>=7)?128:0),qe&&(Dt.buf[Dt.pos++]=qe&127|((qe>>>=7)?128:0),qe&&(Dt.buf[Dt.pos++]=qe&127|((qe>>>=7)?128:0),qe&&(Dt.buf[Dt.pos++]=qe&127)))))}function Ve(qe,Dt,$e){var Pt=Dt<=16383?1:Dt<=2097151?2:Dt<=268435455?3:Math.floor(Math.log(Dt)/(Math.LN2*7));$e.realloc(Pt);for(var vt=$e.pos-1;vt>=qe;vt--)$e.buf[vt+Pt]=$e.buf[vt]}function et(qe,Dt){for(var $e=0;$e>>8,qe[$e+2]=Dt>>>16,qe[$e+3]=Dt>>>24}function Jr(qe,Dt){return(qe[Dt]|qe[Dt+1]<<8|qe[Dt+2]<<16)+(qe[Dt+3]<<24)}function gr(qe,Dt,$e){for(var Pt="",vt=Dt;vt<$e;){var rr=qe[vt],ar=null,wr=rr>239?4:rr>223?3:rr>191?2:1;if(vt+wr>$e)break;var Cr,an,yi;wr===1?rr<128&&(ar=rr):wr===2?(Cr=qe[vt+1],(Cr&192)===128&&(ar=(rr&31)<<6|Cr&63,ar<=127&&(ar=null))):wr===3?(Cr=qe[vt+1],an=qe[vt+2],(Cr&192)===128&&(an&192)===128&&(ar=(rr&15)<<12|(Cr&63)<<6|an&63,(ar<=2047||ar>=55296&&ar<=57343)&&(ar=null))):wr===4&&(Cr=qe[vt+1],an=qe[vt+2],yi=qe[vt+3],(Cr&192)===128&&(an&192)===128&&(yi&192)===128&&(ar=(rr&15)<<18|(Cr&63)<<12|(an&63)<<6|yi&63,(ar<=65535||ar>=1114112)&&(ar=null))),ar===null?(ar=65533,wr=1):ar>65535&&(ar-=65536,Pt+=String.fromCharCode(ar>>>10&1023|55296),ar=56320|ar&1023),Pt+=String.fromCharCode(ar),vt+=wr}return Pt}function rn(qe,Dt,$e){return be.decode(qe.subarray(Dt,$e))}function jn(qe,Dt,$e){for(var Pt=0,vt,rr;Pt55295&&vt<57344)if(rr)if(vt<56320){qe[$e++]=239,qe[$e++]=191,qe[$e++]=189,rr=vt;continue}else vt=rr-55296<<10|vt-56320|65536,rr=null;else{vt>56319||Pt+1===Dt.length?(qe[$e++]=239,qe[$e++]=191,qe[$e++]=189):rr=vt;continue}else rr&&(qe[$e++]=239,qe[$e++]=191,qe[$e++]=189,rr=null);vt<128?qe[$e++]=vt:(vt<2048?qe[$e++]=vt>>6|192:(vt<65536?qe[$e++]=vt>>12|224:(qe[$e++]=vt>>18|240,qe[$e++]=vt>>12&63|128),qe[$e++]=vt>>6&63|128),qe[$e++]=vt&63|128)}return $e}},23167:function(Zr,_r,Se){var ve=Se(14224);(function(Ze,M){Zr.exports=M()})(this,function(){"use strict";function Ze(dr,he){if(!(dr instanceof he))throw new TypeError("Cannot call a class as a function")}function M(dr,he){for(var We=0;Wehe?1:dr0){if(he.right===null)break;if(We(dr,he.right.key)>0){var In=he.right;if(he.right=In.left,In.left=he,he=In,he.right===null)break}Ot.right=he,Ot=he,he=he.right}else break}return Ot.right=he.left,or.left=he.right,he.left=at.right,he.right=at.left,he}function Re(dr,he,We,at){var Ot=new de(dr,he);if(We===null)return Ot.left=Ot.right=null,Ot;We=Le(dr,We,at);var or=at(dr,We.key);return or<0?(Ot.left=We.left,Ot.right=We,We.left=null):or>=0&&(Ot.right=We.right,Ot.left=We,We.right=null),Ot}function Ce(dr,he,We){var at=null,Ot=null;if(he){he=Le(dr,he,We);var or=We(he.key,dr);or===0?(at=he.left,Ot=he.right):or<0?(Ot=he.right,he.right=null,at=he):(at=he.left,he.left=null,Ot=he)}return{left:at,right:Ot}}function He(dr,he,We){return he===null?dr:(dr===null||(he=Le(dr.key,he,We),he.left=dr),he)}function Xe(dr,he,We,at,Ot){if(dr){at(""+he+(We?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+Ot(dr)+` `);var or=he+(We?" ":"\u2502 ");dr.left&&Xe(dr.left,or,!1,at,Ot),dr.right&&Xe(dr.right,or,!0,at,Ot)}}var Ke=function(){function dr(he){he===void 0&&(he=be),this._root=null,this._size=0,this._comparator=he}return dr.prototype.insert=function(he,We){return this._size++,this._root=Re(he,We,this._root,this._comparator)},dr.prototype.add=function(he,We){var at=new de(he,We);this._root===null&&(at.left=at.right=null,this._size++,this._root=at);var Ot=this._comparator,or=Le(he,this._root,Ot),Wr=Ot(he,or.key);return Wr===0?this._root=or:(Wr<0?(at.left=or.left,at.right=or,or.left=null):Wr>0&&(at.right=or.right,at.left=or,or.right=null),this._size++,this._root=at),this._root},dr.prototype.remove=function(he){this._root=this._remove(he,this._root,this._comparator)},dr.prototype._remove=function(he,We,at){var Ot;if(We===null)return null;We=Le(he,We,at);var or=at(he,We.key);return or===0?(We.left===null?Ot=We.right:(Ot=Le(he,We.left,at),Ot.right=We.right),this._size--,Ot):We},dr.prototype.pop=function(){var he=this._root;if(he){for(;he.left;)he=he.left;return this._root=Le(he.key,this._root,this._comparator),this._root=this._remove(he.key,this._root,this._comparator),{key:he.key,data:he.data}}return null},dr.prototype.findStatic=function(he){for(var We=this._root,at=this._comparator;We;){var Ot=at(he,We.key);if(Ot===0)return We;Ot<0?We=We.left:We=We.right}return null},dr.prototype.find=function(he){return this._root&&(this._root=Le(he,this._root,this._comparator),this._comparator(he,this._root.key)!==0)?null:this._root},dr.prototype.contains=function(he){for(var We=this._root,at=this._comparator;We;){var Ot=at(he,We.key);if(Ot===0)return!0;Ot<0?We=We.left:We=We.right}return!1},dr.prototype.forEach=function(he,We){for(var at=this._root,Ot=[],or=!1;!or;)at!==null?(Ot.push(at),at=at.left):Ot.length!==0?(at=Ot.pop(),he.call(We,at),at=at.right):or=!0;return this},dr.prototype.range=function(he,We,at,Ot){for(var or=[],Wr=this._comparator,In=this._root,kn;or.length!==0||In;)if(In)or.push(In),In=In.left;else{if(In=or.pop(),kn=Wr(In.key,We),kn>0)break;if(Wr(In.key,he)>=0&&at.call(Ot,In))return this;In=In.right}return this},dr.prototype.keys=function(){var he=[];return this.forEach(function(We){var at=We.key;return he.push(at)}),he},dr.prototype.values=function(){var he=[];return this.forEach(function(We){var at=We.data;return he.push(at)}),he},dr.prototype.min=function(){return this._root?this.minNode(this._root).key:null},dr.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},dr.prototype.minNode=function(he){if(he===void 0&&(he=this._root),he)for(;he.left;)he=he.left;return he},dr.prototype.maxNode=function(he){if(he===void 0&&(he=this._root),he)for(;he.right;)he=he.right;return he},dr.prototype.at=function(he){for(var We=this._root,at=!1,Ot=0,or=[];!at;)if(We)or.push(We),We=We.left;else if(or.length>0){if(We=or.pop(),Ot===he)return We;Ot++,We=We.right}else at=!0;return null},dr.prototype.next=function(he){var We=this._root,at=null;if(he.right){for(at=he.right;at.left;)at=at.left;return at}for(var Ot=this._comparator;We;){var or=Ot(he.key,We.key);if(or===0)break;or<0?(at=We,We=We.left):We=We.right}return at},dr.prototype.prev=function(he){var We=this._root,at=null;if(he.left!==null){for(at=he.left;at.right;)at=at.right;return at}for(var Ot=this._comparator;We;){var or=Ot(he.key,We.key);if(or===0)break;or<0?We=We.left:(at=We,We=We.right)}return at},dr.prototype.clear=function(){return this._root=null,this._size=0,this},dr.prototype.toList=function(){return er(this._root)},dr.prototype.load=function(he,We,at){We===void 0&&(We=[]),at===void 0&&(at=!1);var Ot=he.length,or=this._comparator;if(at&&pn(he,We,0,Ot-1,or),this._root===null)this._root=Ve(he,We,0,Ot),this._size=Ot;else{var Wr=Ar(this.toList(),et(he,We),or);Ot=this._size+Ot,this._root=fr({head:Wr},0,Ot)}return this},dr.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(dr.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(dr.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),dr.prototype.toString=function(he){he===void 0&&(he=function(Ot){return String(Ot.key)});var We=[];return Xe(this._root,"",!0,function(at){return We.push(at)},he),We.join("")},dr.prototype.update=function(he,We,at){var Ot=this._comparator,or=Ce(he,this._root,Ot),Wr=or.left,In=or.right;Ot(he,We)<0?In=Re(We,at,In,Ot):Wr=Re(We,at,Wr,Ot),this._root=He(Wr,In,Ot)},dr.prototype.split=function(he){return Ce(he,this._root,this._comparator)},dr}();function Ve(dr,he,We,at){var Ot=at-We;if(Ot>0){var or=We+Math.floor(Ot/2),Wr=dr[or],In=he[or],kn=new de(Wr,In);return kn.left=Ve(dr,he,We,or),kn.right=Ve(dr,he,or+1,at),kn}return null}function et(dr,he){for(var We=new de(null,null),at=We,Ot=0;Ot0?(he=or=or.next=We.pop(),he=he.right):at=!0;return or.next=null,Ot.next}function fr(dr,he,We){var at=We-he;if(at>0){var Ot=he+Math.floor(at/2),or=fr(dr,he,Ot),Wr=dr.head;return Wr.left=or,dr.head=dr.head.next,Wr.right=fr(dr,Ot+1,We),Wr}return null}function Ar(dr,he,We){for(var at=new de(null,null),Ot=at,or=dr,Wr=he;or!==null&&Wr!==null;)We(or.key,Wr.key)<0?(Ot.next=or,or=or.next):(Ot.next=Wr,Wr=Wr.next),Ot=Ot.next;return or!==null?Ot.next=or:Wr!==null&&(Ot.next=Wr),at.next}function pn(dr,he,We,at,Ot){if(!(We>=at)){for(var or=dr[We+at>>1],Wr=We-1,In=at+1;;){do Wr++;while(Ot(dr[Wr],or)<0);do In--;while(Ot(dr[In],or)>0);if(Wr>=In)break;var kn=dr[Wr];dr[Wr]=dr[In],dr[In]=kn,kn=he[Wr],he[Wr]=he[In],he[In]=kn}pn(dr,he,We,In,Ot),pn(dr,he,In+1,at,Ot)}}var Kn=function(he,We){return he.ll.x<=We.x&&We.x<=he.ur.x&&he.ll.y<=We.y&&We.y<=he.ur.y},Jn=function(he,We){if(We.ur.xat.x?1:We.yat.y?1:0}}]);function dr(he,We){Ze(this,dr),he.events===void 0?he.events=[this]:he.events.push(this),this.point=he,this.isLeft=We}return R(dr,[{key:"link",value:function(We){if(We.point===this.point)throw new Error("Tried to link already linked events");for(var at=We.point.events,Ot=0,or=at.length;Ot=0&&Ti>=0?unLo?-1:0:eo<0&&Ti<0?unLo?1:0:Tieo?1:0}}}]),dr}(),Cr=0,an=function(){R(dr,null,[{key:"compare",value:function(We,at){var Ot=We.leftSE.point.x,or=at.leftSE.point.x,Wr=We.rightSE.point.x,In=at.rightSE.point.x;if(Inkn&&eo>un)return-1;var Ti=We.comparePoint(at.leftSE.point);if(Ti<0)return 1;if(Ti>0)return-1;var Lo=at.comparePoint(We.rightSE.point);return Lo!==0?Lo:-1}if(Ot>or){if(kneo&&kn>To)return 1;var wa=at.comparePoint(We.leftSE.point);if(wa!==0)return wa;var dn=We.comparePoint(at.rightSE.point);return dn<0?1:dn>0?-1:1}if(kneo)return 1;if(WrIn){var no=We.comparePoint(at.rightSE.point);if(no<0)return 1;if(no>0)return-1}if(Wr!==In){var Za=un-kn,ms=Wr-Ot,Ji=To-eo,Us=In-or;if(Za>ms&&JiUs)return-1}return Wr>In?1:WrTo?1:We.idat.id?1:0}}]);function dr(he,We,at,Ot){Ze(this,dr),this.id=++Cr,this.leftSE=he,he.segment=this,he.otherSE=We,this.rightSE=We,We.segment=this,We.otherSE=he,this.rings=at,this.windings=Ot}return R(dr,[{key:"replaceRightSE",value:function(We){this.rightSE=We,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var We=this.leftSE.point.y,at=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:Weat?We:at}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(We){return We.x===this.leftSE.point.x&&We.y===this.leftSE.point.y||We.x===this.rightSE.point.x&&We.y===this.rightSE.point.y}},{key:"comparePoint",value:function(We){if(this.isAnEndpoint(We))return 0;var at=this.leftSE.point,Ot=this.rightSE.point,or=this.vector();if(at.x===Ot.x)return We.x===at.x?0:We.x0&&kn.swapEvents(),wr.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),Ot&&(or.checkForConsuming(),Wr.checkForConsuming()),at}},{key:"swapEvents",value:function(){var We=this.rightSE;this.rightSE=this.leftSE,this.leftSE=We,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var at=0,Ot=this.windings.length;at0){var Wr=at;at=Ot,Ot=Wr}if(at.prev===Ot){var In=at;at=Ot,Ot=In}for(var kn=0,eo=Ot.rings.length;kn0)or=at,Wr=We,In=-1;else throw new Error("Tried to create degenerate segment at [".concat(We.x,", ").concat(We.y,"]"));var eo=new wr(or,!0),un=new wr(Wr,!1);return new dr(eo,un,[Ot],[In])}}]),dr}(),yi=function(){function dr(he,We,at){if(Ze(this,dr),!Array.isArray(he)||he.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=We,this.isExterior=at,this.segments=[],typeof he[0][0]!="number"||typeof he[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var Ot=gr.round(he[0][0],he[0][1]);this.bbox={ll:{x:Ot.x,y:Ot.y},ur:{x:Ot.x,y:Ot.y}};for(var or=Ot,Wr=1,In=he.length;Wrthis.bbox.ur.x&&(this.bbox.ur.x=kn.x),kn.y>this.bbox.ur.y&&(this.bbox.ur.y=kn.y),or=kn)}(Ot.x!==or.x||Ot.y!==or.y)&&this.segments.push(an.fromRing(or,Ot,this))}return R(dr,[{key:"getSweepEvents",value:function(){for(var We=[],at=0,Ot=this.segments.length;atthis.bbox.ur.x&&(this.bbox.ur.x=or.bbox.ur.x),or.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=or.bbox.ur.y),this.interiorRings.push(or)}this.multiPoly=We}return R(dr,[{key:"getSweepEvents",value:function(){for(var We=this.exteriorRing.getSweepEvents(),at=0,Ot=this.interiorRings.length;atthis.bbox.ur.x&&(this.bbox.ur.x=or.bbox.ur.x),or.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=or.bbox.ur.y),this.polys.push(or)}this.isSubject=We}return R(dr,[{key:"getSweepEvents",value:function(){for(var We=[],at=0,Ot=this.polys.length;at0&&(We=or)}for(var Wr=We.segment.prevInResult(),In=Wr?Wr.prevInResult():null;;){if(!Wr)return null;if(!In)return Wr.ringOut;if(In.ringOut!==Wr.ringOut)return In.ringOut.enclosingRing()!==Wr.ringOut?Wr.ringOut:Wr.ringOut.enclosingRing();Wr=In.prevInResult(),In=Wr?Wr.prevInResult():null}}}]),dr}(),bo=function(){function dr(he){Ze(this,dr),this.exteriorRing=he,he.poly=this,this.interiorRings=[]}return R(dr,[{key:"addInterior",value:function(We){this.interiorRings.push(We),We.poly=this}},{key:"getGeom",value:function(){var We=[this.exteriorRing.getGeom()];if(We[0]===null)return null;for(var at=0,Ot=this.interiorRings.length;at1&&arguments[1]!==void 0?arguments[1]:an.compare;Ze(this,dr),this.queue=he,this.tree=new Ke(We),this.segments=[]}return R(dr,[{key:"process",value:function(We){var at=We.segment,Ot=[];if(We.consumedBy)return We.isLeft?this.queue.remove(We.otherSE):this.tree.remove(at),Ot;var or=We.isLeft?this.tree.insert(at):this.tree.find(at);if(!or)throw new Error("Unable to find segment #".concat(at.id," ")+"[".concat(at.leftSE.point.x,", ").concat(at.leftSE.point.y,"] -> ")+"[".concat(at.rightSE.point.x,", ").concat(at.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var Wr=or,In=or,kn=void 0,eo=void 0;kn===void 0;)Wr=this.tree.prev(Wr),Wr===null?kn=null:Wr.key.consumedBy===void 0&&(kn=Wr.key);for(;eo===void 0;)In=this.tree.next(In),In===null?eo=null:In.key.consumedBy===void 0&&(eo=In.key);if(We.isLeft){var un=null;if(kn){var To=kn.getIntersection(at);if(To!==null&&(at.isAnEndpoint(To)||(un=To),!kn.isAnEndpoint(To)))for(var Ti=this._splitSafely(kn,To),Lo=0,wa=Ti.length;Lo0?(this.tree.remove(at),Ot.push(We)):(this.segments.push(at),at.prev=kn)}else{if(kn&&eo){var le=kn.getIntersection(eo);if(le!==null){if(!kn.isAnEndpoint(le))for(var ge=this._splitSafely(kn,le),ye=0,ze=ge.length;yeMi)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var Us=new Xi(dn),Lt=dn.size,Ne=dn.pop();Ne;){var re=Ne.key;if(dn.size===Lt){var le=re.segment;throw new Error("Unable to pop() ".concat(re.isLeft?"left":"right"," SweepEvent ")+"[".concat(re.point.x,", ").concat(re.point.y,"] from segment #").concat(le.id," ")+"[".concat(le.leftSE.point.x,", ").concat(le.leftSE.point.y,"] -> ")+"[".concat(le.rightSE.point.x,", ").concat(le.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(dn.size>Mi)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(Us.segments.length>qo)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var ge=Us.process(re),ye=0,ze=ge.length;ye1?We-1:0),Ot=1;Ot1?We-1:0),Ot=1;Ot1?We-1:0),Ot=1;Ot1?We-1:0),Ot=1;Ot=0&&(Pe|0)===Pe||M("invalid parameter type, ("+Pe+")"+de(_t)+". must be a nonnegative integer")}function Xe(Pe,_t,Zt){_t.indexOf(Pe)<0&&M("invalid value"+de(Zt)+". must be one of: "+_t)}var Ke=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function Ve(Pe){Object.keys(Pe).forEach(function(_t){Ke.indexOf(_t)<0&&M('invalid regl constructor argument "'+_t+'". must be one of '+Ke)})}function et(Pe,_t){for(Pe=Pe+"";Pe.length<_t;)Pe=" "+Pe;return Pe}function er(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function fr(Pe,_t){this.number=Pe,this.line=_t,this.errors=[]}function Ar(Pe,_t,Zt){this.file=Pe,this.line=_t,this.message=Zt}function pn(){var Pe=new Error,_t=(Pe.stack||Pe).toString(),Zt=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(_t);if(Zt)return Zt[1];var qr=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(_t);return qr?qr[1]:"unknown"}function Kn(){var Pe=new Error,_t=(Pe.stack||Pe).toString(),Zt=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(_t);if(Zt)return Zt[1];var qr=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(_t);return qr?qr[1]:"unknown"}function Jn(Pe,_t){var Zt=Pe.split(` `),qr=1,wn=0,Yr={unknown:new er,0:new er};Yr.unknown.name=Yr[0].name=_t||pn(),Yr.unknown.lines.push(new fr(0,""));for(var Or=0;Or0&&_t.push(new Ar("unknown",0,Zt))}}),_t}function pa(Pe,_t){_t.forEach(function(Zt){var qr=Pe[Zt.file];if(qr){var wn=qr.index[Zt.line];if(wn){wn.errors.push(Zt),qr.hasErrors=!0;return}}Pe.unknown.hasErrors=!0,Pe.unknown.lines[0].errors.push(Zt)})}function xr(Pe,_t,Zt,qr,wn){if(!Pe.getShaderParameter(_t,Pe.COMPILE_STATUS)){var Yr=Pe.getShaderInfoLog(_t),Or=qr===Pe.FRAGMENT_SHADER?"fragment":"vertex";Dt(Zt,"string",Or+" shader source must be a string",wn);var Wn=Jn(Zt,wn),Bn=ki(Yr);pa(Wn,Bn),Object.keys(Wn).forEach(function(si){var Hn=Wn[si];if(!Hn.hasErrors)return;var qn=[""],ci=[""];function Vn(Yn,Tr){qn.push(Yn),ci.push(Tr||"")}Vn("file number "+si+": "+Hn.name+` `,"color:red;text-decoration:underline;font-weight:bold"),Hn.lines.forEach(function(Yn){if(Yn.errors.length>0){Vn(et(Yn.number,4)+"| ","background-color:yellow; font-weight:bold"),Vn(Yn.line+ve,"color:red; background-color:yellow; font-weight:bold");var Tr=0;Yn.errors.forEach(function(en){var Xn=en.message,_i=/^\s*'(.*)'\s*:\s*(.*)$/.exec(Xn);if(_i){var Rn=_i[1];switch(Xn=_i[2],Rn){case"assign":Rn="=";break}Tr=Math.max(Yn.line.indexOf(Rn,Tr),0)}else Tr=0;Vn(et("| ",6)),Vn(et("^^^",Tr+3)+ve,"font-weight:bold"),Vn(et("| ",6)),Vn(Xn+ve,"font-weight:bold")}),Vn(et("| ",6)+ve)}else Vn(et(Yn.number,4)+"| "),Vn(Yn.line+ve,"color:red")}),typeof document!="undefined"&&!window.chrome?(ci[0]=qn.join("%c"),console.log.apply(console,ci)):console.log(qn.join(""))}),R.raise("Error compiling "+Or+" shader, "+Wn[0].name)}}function jt(Pe,_t,Zt,qr,wn){if(!Pe.getProgramParameter(_t,Pe.LINK_STATUS)){var Yr=Pe.getProgramInfoLog(_t),Or=Jn(Zt,wn),Wn=Jn(qr,wn),Bn='Error linking program with vertex shader, "'+Wn[0].name+'", and fragment shader "'+Or[0].name+'"';typeof document!="undefined"?console.log("%c"+Bn+ve+"%c"+Yr,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(Bn+ve+Yr),R.raise(Bn)}}function Jr(Pe){Pe._commandRef=pn()}function gr(Pe,_t,Zt,qr){Jr(Pe);function wn(Bn){return Bn?qr.id(Bn):0}Pe._fragId=wn(Pe.static.frag),Pe._vertId=wn(Pe.static.vert);function Yr(Bn,si){Object.keys(si).forEach(function(Hn){Bn[qr.id(Hn)]=!0})}var Or=Pe._uniformSet={};Yr(Or,_t.static),Yr(Or,_t.dynamic);var Wn=Pe._attributeSet={};Yr(Wn,Zt.static),Yr(Wn,Zt.dynamic),Pe._hasCount="count"in Pe.static||"count"in Pe.dynamic||"elements"in Pe.static||"elements"in Pe.dynamic}function rn(Pe,_t){var Zt=Kn();M(Pe+" in command "+(_t||pn())+(Zt==="unknown"?"":" called from "+Zt))}function jn(Pe,_t,Zt){Pe||rn(_t,Zt||pn())}function qe(Pe,_t,Zt,qr){Pe in _t||rn("unknown parameter ("+Pe+")"+de(Zt)+". possible values: "+Object.keys(_t).join(),qr||pn())}function Dt(Pe,_t,Zt,qr){Re(Pe,_t)||rn("invalid parameter type"+de(Zt)+". expected "+_t+", got "+typeof Pe,qr||pn())}function $e(Pe){Pe()}function Pt(Pe,_t,Zt){Pe.texture?Xe(Pe.texture._texture.internalformat,_t,"unsupported texture format for attachment"):Xe(Pe.renderbuffer._renderbuffer.format,Zt,"unsupported renderbuffer format for attachment")}var vt=33071,rr=9728,ar=9984,wr=9985,Cr=9986,an=9987,yi=5120,li=5121,Uo=5122,vi=5123,bo=5124,So=5125,Xi=5126,Mi=32819,qo=32820,ui=33635,Qi=34042,Vi=36193,Pi={};Pi[yi]=Pi[li]=1,Pi[Uo]=Pi[vi]=Pi[Vi]=Pi[ui]=Pi[Mi]=Pi[qo]=2,Pi[bo]=Pi[So]=Pi[Xi]=Pi[Qi]=4;function ds(Pe,_t){return Pe===qo||Pe===Mi||Pe===ui?2:Pe===Qi?4:Pi[Pe]*_t}function Ur(Pe){return!(Pe&Pe-1)&&!!Pe}function ls(Pe,_t,Zt){var qr,wn=_t.width,Yr=_t.height,Or=_t.channels;R(wn>0&&wn<=Zt.maxTextureSize&&Yr>0&&Yr<=Zt.maxTextureSize,"invalid texture shape"),(Pe.wrapS!==vt||Pe.wrapT!==vt)&&R(Ur(wn)&&Ur(Yr),"incompatible wrap mode for texture, both width and height must be power of 2"),_t.mipmask===1?wn!==1&&Yr!==1&&R(Pe.minFilter!==ar&&Pe.minFilter!==Cr&&Pe.minFilter!==wr&&Pe.minFilter!==an,"min filter requires mipmap"):(R(Ur(wn)&&Ur(Yr),"texture must be a square power of 2 to support mipmapping"),R(_t.mipmask===(wn<<1)-1,"missing or incomplete mipmap data")),_t.type===Xi&&(Zt.extensions.indexOf("oes_texture_float_linear")<0&&R(Pe.minFilter===rr&&Pe.magFilter===rr,"filter not supported, must enable oes_texture_float_linear"),R(!Pe.genMipmaps,"mipmap generation not supported with float textures"));var Wn=_t.images;for(qr=0;qr<16;++qr)if(Wn[qr]){var Bn=wn>>qr,si=Yr>>qr;R(_t.mipmask&1<0&&wn<=qr.maxTextureSize&&Yr>0&&Yr<=qr.maxTextureSize,"invalid texture shape"),R(wn===Yr,"cube map must be square"),R(_t.wrapS===vt&&_t.wrapT===vt,"wrap mode not supported by cube map");for(var Wn=0;Wn>Hn,Vn=Yr>>Hn;R(Bn.mipmask&1<1&&_t===Zt&&(_t==='"'||_t==="'"))return['"'+or(Pe.substr(1,Pe.length-2))+'"'];var qr=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(Pe);if(qr)return Wr(Pe.substr(0,qr.index)).concat(Wr(qr[1])).concat(Wr(Pe.substr(qr.index+qr[0].length)));var wn=Pe.split(".");if(wn.length===1)return['"'+or(Pe)+'"'];for(var Yr=[],Or=0;Or0,"invalid pixel ratio"))):he.raise("invalid arguments to regl"),Zt&&(Zt.nodeName.toLowerCase()==="canvas"?wn=Zt:qr=Zt),!Yr){if(!wn){he(typeof document!="undefined","must manually specify webgl context outside of DOM environments");var Vn=dn(qr||document.body,qn,si);if(!Vn)return null;wn=Vn.canvas,ci=Vn.onDestroy}Or.premultipliedAlpha===void 0&&(Or.premultipliedAlpha=!0),Yr=co(wn,Or)}return Yr?{gl:Yr,canvas:wn,container:qr,extensions:Wn,optionalExtensions:Bn,pixelRatio:si,profile:Hn,onDone:qn,onDestroy:ci}:(ci(),qn("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function Lt(Pe,_t){var Zt={};function qr(Or){he.type(Or,"string","extension name must be string");var Wn=Or.toLowerCase(),Bn;try{Bn=Zt[Wn]=Pe.getExtension(Wn)}catch(si){}return!!Bn}for(var wn=0;wn<_t.extensions.length;++wn){var Yr=_t.extensions[wn];if(!qr(Yr))return _t.onDestroy(),_t.onDone('"'+Yr+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return _t.optionalExtensions.forEach(qr),{extensions:Zt,restore:function(){Object.keys(Zt).forEach(function(Or){if(Zt[Or]&&!qr(Or))throw new Error("(regl): error restoring extension "+Or)})}}}function Ne(Pe,_t){for(var Zt=Array(Pe),qr=0;qr65535)<<4,Pe>>>=_t,Zt=(Pe>255)<<3,Pe>>>=Zt,_t|=Zt,Zt=(Pe>15)<<2,Pe>>>=Zt,_t|=Zt,Zt=(Pe>3)<<1,Pe>>>=Zt,_t|=Zt,_t|Pe>>1}function wt(){var Pe=Ne(8,function(){return[]});function _t(Yr){var Or=Ae(Yr),Wn=Pe[Je(Or)>>2];return Wn.length>0?Wn.pop():new ArrayBuffer(Or)}function Zt(Yr){Pe[Je(Yr.byteLength)>>2].push(Yr)}function qr(Yr,Or){var Wn=null;switch(Yr){case re:Wn=new Int8Array(_t(Or),0,Or);break;case le:Wn=new Uint8Array(_t(Or),0,Or);break;case ge:Wn=new Int16Array(_t(2*Or),0,Or);break;case ye:Wn=new Uint16Array(_t(2*Or),0,Or);break;case ze:Wn=new Int32Array(_t(4*Or),0,Or);break;case je:Wn=new Uint32Array(_t(4*Or),0,Or);break;case Ue:Wn=new Float32Array(_t(4*Or),0,Or);break;default:return null}return Wn.length!==Or?Wn.subarray(0,Or):Wn}function wn(Yr){Zt(Yr.buffer)}return{alloc:_t,free:Zt,allocType:qr,freeType:wn}}var Ht=wt();Ht.zero=wt();var Fr=3408,mr=3410,Sr=3411,fn=3412,xn=3413,Lr=3414,Nn=3415,bn=33901,En=33902,io=3379,On=3386,Ao=34921,ia=36347,Ho=36348,Ga=35661,Wo=35660,Hl=34930,ns=36349,Yo=34076,_a=34024,$o=7936,Fo=7937,us=7938,xc=35724,Ba=34047,Fa=36063,sc=34852,Ql=3553,oa=34067,Zo=34069,il=33984,va=6408,El=5126,Wa=5121,Ds=36160,Rl=36053,gu=36064,gl=16384,wl=function(Pe,_t){var Zt=1;_t.ext_texture_filter_anisotropic&&(Zt=Pe.getParameter(Ba));var qr=1,wn=1;_t.webgl_draw_buffers&&(qr=Pe.getParameter(sc),wn=Pe.getParameter(Fa));var Yr=!!_t.oes_texture_float;if(Yr){var Or=Pe.createTexture();Pe.bindTexture(Ql,Or),Pe.texImage2D(Ql,0,va,1,1,0,va,El,null);var Wn=Pe.createFramebuffer();if(Pe.bindFramebuffer(Ds,Wn),Pe.framebufferTexture2D(Ds,gu,Ql,Or,0),Pe.bindTexture(Ql,null),Pe.checkFramebufferStatus(Ds)!==Rl)Yr=!1;else{Pe.viewport(0,0,1,1),Pe.clearColor(1,0,0,1),Pe.clear(gl);var Bn=Ht.allocType(El,4);Pe.readPixels(0,0,1,1,va,El,Bn),Pe.getError()?Yr=!1:(Pe.deleteFramebuffer(Wn),Pe.deleteTexture(Or),Yr=Bn[0]===1),Ht.freeType(Bn)}}var si=typeof navigator!="undefined"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Hn=!0;if(!si){var qn=Pe.createTexture(),ci=Ht.allocType(Wa,36);Pe.activeTexture(il),Pe.bindTexture(oa,qn),Pe.texImage2D(Zo,0,va,3,3,0,va,Wa,ci),Ht.freeType(ci),Pe.bindTexture(oa,null),Pe.deleteTexture(qn),Hn=!Pe.getError()}return{colorBits:[Pe.getParameter(mr),Pe.getParameter(Sr),Pe.getParameter(fn),Pe.getParameter(xn)],depthBits:Pe.getParameter(Lr),stencilBits:Pe.getParameter(Nn),subpixelBits:Pe.getParameter(Fr),extensions:Object.keys(_t).filter(function(Vn){return!!_t[Vn]}),maxAnisotropic:Zt,maxDrawbuffers:qr,maxColorAttachments:wn,pointSizeDims:Pe.getParameter(bn),lineWidthDims:Pe.getParameter(En),maxViewportDims:Pe.getParameter(On),maxCombinedTextureUnits:Pe.getParameter(Ga),maxCubeMapSize:Pe.getParameter(Yo),maxRenderbufferSize:Pe.getParameter(_a),maxTextureUnits:Pe.getParameter(Hl),maxTextureSize:Pe.getParameter(io),maxAttributes:Pe.getParameter(Ao),maxVertexUniforms:Pe.getParameter(ia),maxVertexTextureUnits:Pe.getParameter(Wo),maxVaryingVectors:Pe.getParameter(Ho),maxFragmentUniforms:Pe.getParameter(ns),glsl:Pe.getParameter(xc),renderer:Pe.getParameter(Fo),vendor:Pe.getParameter($o),version:Pe.getParameter(us),readFloat:Yr,npotTextureCube:Hn}};function ol(Pe){return!!Pe&&typeof Pe=="object"&&Array.isArray(Pe.shape)&&Array.isArray(Pe.stride)&&typeof Pe.offset=="number"&&Pe.shape.length===Pe.stride.length&&(Array.isArray(Pe.data)||_r(Pe.data))}var Qa=function(Pe){return Object.keys(Pe).map(function(_t){return Pe[_t]})},Gl={shape:Dn,flatten:jr};function Wl(Pe,_t,Zt){for(var qr=0;qr<_t;++qr)Zt[qr]=Pe[qr]}function ut(Pe,_t,Zt,qr){for(var wn=0,Yr=0;Yr<_t;++Yr)for(var Or=Pe[Yr],Wn=0;Wn0){var Oi;if(Array.isArray(en[0])){Un=bs(en);for(var Ln=1,wi=1;wi0)if(typeof Ln[0]=="number"){var bi=Ht.allocType(Rn.dtype,Ln.length);Ju(bi,Ln),Un(bi,Po),Ht.freeType(bi)}else if(Array.isArray(Ln[0])||_r(Ln[0])){da=bs(Ln);var Zn=lo(Ln,da,Rn.dtype);Un(Zn,Po),Ht.freeType(Zn)}else he.raise("invalid buffer data")}else if(ol(Ln)){da=Ln.shape;var Sn=Ln.stride,Wt=0,K=0,Ei=0,Ee=0;da.length===1?(Wt=da[0],K=1,Ei=Sn[0],Ee=0):da.length===2?(Wt=da[0],K=da[1],Ei=Sn[0],Ee=Sn[1]):he.raise("invalid shape");var sa=Array.isArray(Ln.data)?Rn.dtype:Fu(Ln.data),Jo=Ht.allocType(sa,Wt*K);al(Jo,Ln.data,Wt,K,Ei,Ee,Ln.offset),Un(Jo,Po),Ht.freeType(Jo)}else he.raise("invalid data for buffer subdata");return xi}return Xn||xi(Tr),xi._reglType="buffer",xi._buffer=Rn,xi.subdata=Oi,Zt.profile&&(xi.stats=Rn.stats),xi.destroy=function(){ci(Rn)},xi}function Yn(){Qa(Yr).forEach(function(Tr){Tr.buffer=Pe.createBuffer(),Pe.bindBuffer(Tr.type,Tr.buffer),Pe.bufferData(Tr.type,Tr.persistentData||Tr.byteLength,Tr.usage)})}return Zt.profile&&(_t.getTotalBufferSize=function(){var Tr=0;return Object.keys(Yr).forEach(function(en){Tr+=Yr[en].stats.size}),Tr}),{create:Vn,createStream:Bn,destroyStream:si,clear:function(){Qa(Yr).forEach(ci),Wn.forEach(ci)},getBuffer:function(Tr){return Tr&&Tr._buffer instanceof Or?Tr._buffer:null},restore:Yn,_initBuffer:qn}}var ou=0,Ks=0,Lp=1,gf=1,Of=4,qh=4,zc={points:ou,point:Ks,lines:Lp,line:gf,triangles:Of,triangle:qh,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Oh=0,Ms=1,Jc=4,Yh=5120,Qc=5121,uc=5122,eh=5123,yh=5124,sl=5125,Uc=34963,bc=35040,fp=35044;function dp(Pe,_t,Zt,qr){var wn={},Yr=0,Or={uint8:Qc,uint16:eh};_t.oes_element_index_uint&&(Or.uint32=sl);function Wn(Yn){this.id=Yr++,wn[this.id]=this,this.buffer=Yn,this.primType=Jc,this.vertCount=0,this.type=0}Wn.prototype.bind=function(){this.buffer.bind()};var Bn=[];function si(Yn){var Tr=Bn.pop();return Tr||(Tr=new Wn(Zt.create(null,Uc,!0,!1)._buffer)),qn(Tr,Yn,bc,-1,-1,0,0),Tr}function Hn(Yn){Bn.push(Yn)}function qn(Yn,Tr,en,Xn,_i,Rn,xi){Yn.buffer.bind();var Un;if(Tr){var Oi=xi;!xi&&(!_r(Tr)||ol(Tr)&&!_r(Tr.data))&&(Oi=_t.oes_element_index_uint?sl:eh),Zt._initBuffer(Yn.buffer,Tr,en,Oi,3)}else Pe.bufferData(Uc,Rn,en),Yn.buffer.dtype=Un||Qc,Yn.buffer.usage=en,Yn.buffer.dimension=3,Yn.buffer.byteLength=Rn;if(Un=xi,!xi){switch(Yn.buffer.dtype){case Qc:case Yh:Un=Qc;break;case eh:case uc:Un=eh;break;case sl:case yh:Un=sl;break;default:he.raise("unsupported type for element array")}Yn.buffer.dtype=Un}Yn.type=Un,he(Un!==sl||!!_t.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var Ln=_i;Ln<0&&(Ln=Yn.buffer.byteLength,Un===eh?Ln>>=1:Un===sl&&(Ln>>=2)),Yn.vertCount=Ln;var wi=Xn;if(Xn<0){wi=Jc;var Po=Yn.buffer.dimension;Po===1&&(wi=Oh),Po===2&&(wi=Ms),Po===3&&(wi=Jc)}Yn.primType=wi}function ci(Yn){qr.elementsCount--,he(Yn.buffer!==null,"must not double destroy elements"),delete wn[Yn.id],Yn.buffer.destroy(),Yn.buffer=null}function Vn(Yn,Tr){var en=Zt.create(null,Uc,!0),Xn=new Wn(en._buffer);qr.elementsCount++;function _i(Rn){if(!Rn)en(),Xn.primType=Jc,Xn.vertCount=0,Xn.type=Qc;else if(typeof Rn=="number")en(Rn),Xn.primType=Jc,Xn.vertCount=Rn|0,Xn.type=Qc;else{var xi=null,Un=fp,Oi=-1,Ln=-1,wi=0,Po=0;Array.isArray(Rn)||_r(Rn)||ol(Rn)?xi=Rn:(he.type(Rn,"object","invalid arguments for elements"),"data"in Rn&&(xi=Rn.data,he(Array.isArray(xi)||_r(xi)||ol(xi),"invalid data for element buffer")),"usage"in Rn&&(he.parameter(Rn.usage,Ku,"invalid element buffer usage"),Un=Ku[Rn.usage]),"primitive"in Rn&&(he.parameter(Rn.primitive,zc,"invalid element buffer primitive"),Oi=zc[Rn.primitive]),"count"in Rn&&(he(typeof Rn.count=="number"&&Rn.count>=0,"invalid vertex count for elements"),Ln=Rn.count|0),"type"in Rn&&(he.parameter(Rn.type,Or,"invalid buffer type"),Po=Or[Rn.type]),"length"in Rn?wi=Rn.length|0:(wi=Ln,Po===eh||Po===uc?wi*=2:(Po===sl||Po===yh)&&(wi*=4))),qn(Xn,xi,Un,Oi,Ln,wi,Po)}return _i}return _i(Yn),_i._reglType="elements",_i._elements=Xn,_i.subdata=function(Rn,xi){return en.subdata(Rn,xi),_i},_i.destroy=function(){ci(Xn)},_i}return{create:Vn,createStream:si,destroyStream:Hn,getElements:function(Yn){return typeof Yn=="function"&&Yn._elements instanceof Wn?Yn._elements:null},clear:function(){Qa(wn).forEach(ci)}}}var Ps=new Float32Array(1),Gf=new Uint32Array(Ps.buffer),Xp=5123;function cc(Pe){for(var _t=Ht.allocType(Xp,Pe.length),Zt=0;Zt>>31<<15,Yr=(qr<<1>>>24)-127,Or=qr>>13&1024-1;if(Yr<-24)_t[Zt]=wn;else if(Yr<-14){var Wn=-14-Yr;_t[Zt]=wn+(Or+1024>>Wn)}else Yr>15?_t[Zt]=wn+31744:_t[Zt]=wn+(Yr+15<<10)+Or}return _t}function zl(Pe){return Array.isArray(Pe)||_r(Pe)}var Ec=function(Pe){return!(Pe&Pe-1)&&!!Pe},th=34467,vu=3553,xh=34067,qa=34069,Hs=6408,Ep=6406,Na=6407,Qu=6409,Is=6410,ys=32854,ec=32855,Bf=36194,es=32819,Bs=32820,wc=33635,qp=34042,Sc=6402,$h=34041,Xo=35904,au=35906,dl=36193,tc=33776,bh=33777,mp=33778,Kh=33779,Zc=35986,vf=35987,Bh=34798,_u=35840,Vc=35841,Yp=35842,Fh=35843,Ll=36196,Fs=5121,Tc=5123,Ru=5125,jc=5126,$p=10242,Jh=10243,Ac=10497,kh=33071,Iu=33648,rh=10240,gp=10241,vp=9728,Kp=9729,Hc=9984,Eh=9985,yu=9986,Ya=9987,nh=33170,Gc=4352,ih=4353,Sa=4354,cs=34046,ku=3317,rc=37440,xu=37441,oh=37443,Cc=37444,ah=33984,Qh=[Hc,yu,Eh,Ya],sh=[0,Qu,Is,Na,Hs],Ul={};Ul[Qu]=Ul[Ep]=Ul[Sc]=1,Ul[$h]=Ul[Is]=2,Ul[Na]=Ul[Xo]=3,Ul[Hs]=Ul[au]=4;function ll(Pe){return"[object "+Pe+"]"}var Wc=ll("HTMLCanvasElement"),vl=ll("OffscreenCanvas"),oi=ll("CanvasRenderingContext2D"),fi=ll("ImageBitmap"),tu=ll("HTMLImageElement"),bu=ll("HTMLVideoElement"),Dp=Object.keys(oo).concat([Wc,vl,oi,fi,tu,bu]),ai=[];ai[Fs]=1,ai[jc]=4,ai[dl]=2,ai[Tc]=2,ai[Ru]=4;var is=[];is[ys]=2,is[ec]=2,is[Bf]=2,is[$h]=4,is[tc]=.5,is[bh]=.5,is[mp]=1,is[Kh]=1,is[Zc]=.5,is[vf]=1,is[Bh]=1,is[_u]=.5,is[Vc]=.25,is[Yp]=.5,is[Fh]=.25,is[Ll]=.5;function ep(Pe){return Array.isArray(Pe)&&(Pe.length===0||typeof Pe[0]=="number")}function mi(Pe){if(!Array.isArray(Pe))return!1;var _t=Pe.length;return!(_t===0||!zl(Pe[0]))}function Mc(Pe){return Object.prototype.toString.call(Pe)}function Op(Pe){return Mc(Pe)===Wc}function Jp(Pe){return Mc(Pe)===vl}function Xc(Pe){return Mc(Pe)===oi}function hc(Pe){return Mc(Pe)===fi}function wh(Pe){return Mc(Pe)===tu}function Pc(Pe){return Mc(Pe)===bu}function Xl(Pe){if(!Pe)return!1;var _t=Mc(Pe);return Dp.indexOf(_t)>=0?!0:ep(Pe)||mi(Pe)||ol(Pe)}function Rc(Pe){return oo[Object.prototype.toString.call(Pe)]|0}function Eu(Pe,_t){var Zt=_t.length;switch(Pe.type){case Fs:case Tc:case Ru:case jc:var qr=Ht.allocType(Pe.type,Zt);qr.set(_t),Pe.data=qr;break;case dl:Pe.data=cc(_t);break;default:he.raise("unsupported texture type, must specify a typed array")}}function lh(Pe,_t){return Ht.allocType(Pe.type===dl?jc:Pe.type,_t)}function tp(Pe,_t){Pe.type===dl?(Pe.data=cc(_t),Ht.freeType(_t)):Pe.data=_t}function rp(Pe,_t,Zt,qr,wn,Yr){for(var Or=Pe.width,Wn=Pe.height,Bn=Pe.channels,si=Or*Wn*Bn,Hn=lh(Pe,si),qn=0,ci=0;ci=1;)Wn+=Or*Bn*Bn,Bn/=2;return Wn}else return Or*Zt*qr}function ql(Pe,_t,Zt,qr,wn,Yr,Or){var Wn={"don't care":Gc,"dont care":Gc,nice:Sa,fast:ih},Bn={repeat:Ac,clamp:kh,mirror:Iu},si={nearest:vp,linear:Kp},Hn=Se({mipmap:Ya,"nearest mipmap nearest":Hc,"linear mipmap nearest":Eh,"nearest mipmap linear":yu,"linear mipmap linear":Ya},si),qn={none:0,browser:Cc},ci={uint8:Fs,rgba4:es,rgb565:wc,"rgb5 a1":Bs},Vn={alpha:Ep,luminance:Qu,"luminance alpha":Is,rgb:Na,rgba:Hs,rgba4:ys,"rgb5 a1":ec,rgb565:Bf},Yn={};_t.ext_srgb&&(Vn.srgb=Xo,Vn.srgba=au),_t.oes_texture_float&&(ci.float32=ci.float=jc),_t.oes_texture_half_float&&(ci.float16=ci["half float"]=dl),_t.webgl_depth_texture&&(Se(Vn,{depth:Sc,"depth stencil":$h}),Se(ci,{uint16:Tc,uint32:Ru,"depth stencil":qp})),_t.webgl_compressed_texture_s3tc&&Se(Yn,{"rgb s3tc dxt1":tc,"rgba s3tc dxt1":bh,"rgba s3tc dxt3":mp,"rgba s3tc dxt5":Kh}),_t.webgl_compressed_texture_atc&&Se(Yn,{"rgb atc":Zc,"rgba atc explicit alpha":vf,"rgba atc interpolated alpha":Bh}),_t.webgl_compressed_texture_pvrtc&&Se(Yn,{"rgb pvrtc 4bppv1":_u,"rgb pvrtc 2bppv1":Vc,"rgba pvrtc 4bppv1":Yp,"rgba pvrtc 2bppv1":Fh}),_t.webgl_compressed_texture_etc1&&(Yn["rgb etc1"]=Ll);var Tr=Array.prototype.slice.call(Pe.getParameter(th));Object.keys(Yn).forEach(function(Ft){var Xr=Yn[Ft];Tr.indexOf(Xr)>=0&&(Vn[Ft]=Xr)});var en=Object.keys(Vn);Zt.textureFormats=en;var Xn=[];Object.keys(Vn).forEach(function(Ft){var Xr=Vn[Ft];Xn[Xr]=Ft});var _i=[];Object.keys(ci).forEach(function(Ft){var Xr=ci[Ft];_i[Xr]=Ft});var Rn=[];Object.keys(si).forEach(function(Ft){var Xr=si[Ft];Rn[Xr]=Ft});var xi=[];Object.keys(Hn).forEach(function(Ft){var Xr=Hn[Ft];xi[Xr]=Ft});var Un=[];Object.keys(Bn).forEach(function(Ft){var Xr=Bn[Ft];Un[Xr]=Ft});var Oi=en.reduce(function(Ft,Xr){var Mr=Vn[Xr];return Mr===Qu||Mr===Ep||Mr===Qu||Mr===Is||Mr===Sc||Mr===$h||_t.ext_srgb&&(Mr===Xo||Mr===au)?Ft[Mr]=Mr:Mr===ec||Xr.indexOf("rgba")>=0?Ft[Mr]=Hs:Ft[Mr]=Na,Ft},{});function Ln(){this.internalformat=Hs,this.format=Hs,this.type=Fs,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Cc,this.width=0,this.height=0,this.channels=0}function wi(Ft,Xr){Ft.internalformat=Xr.internalformat,Ft.format=Xr.format,Ft.type=Xr.type,Ft.compressed=Xr.compressed,Ft.premultiplyAlpha=Xr.premultiplyAlpha,Ft.flipY=Xr.flipY,Ft.unpackAlignment=Xr.unpackAlignment,Ft.colorSpace=Xr.colorSpace,Ft.width=Xr.width,Ft.height=Xr.height,Ft.channels=Xr.channels}function Po(Ft,Xr){if(!(typeof Xr!="object"||!Xr)){if("premultiplyAlpha"in Xr&&(he.type(Xr.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),Ft.premultiplyAlpha=Xr.premultiplyAlpha),"flipY"in Xr&&(he.type(Xr.flipY,"boolean","invalid texture flip"),Ft.flipY=Xr.flipY),"alignment"in Xr&&(he.oneOf(Xr.alignment,[1,2,4,8],"invalid texture unpack alignment"),Ft.unpackAlignment=Xr.alignment),"colorSpace"in Xr&&(he.parameter(Xr.colorSpace,qn,"invalid colorSpace"),Ft.colorSpace=qn[Xr.colorSpace]),"type"in Xr){var Mr=Xr.type;he(_t.oes_texture_float||!(Mr==="float"||Mr==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),he(_t.oes_texture_half_float||!(Mr==="half float"||Mr==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),he(_t.webgl_depth_texture||!(Mr==="uint16"||Mr==="uint32"||Mr==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),he.parameter(Mr,ci,"invalid texture type"),Ft.type=ci[Mr]}var Bi=Ft.width,Ma=Ft.height,el=Ft.channels,st=!1;"shape"in Xr?(he(Array.isArray(Xr.shape)&&Xr.shape.length>=2,"shape must be an array"),Bi=Xr.shape[0],Ma=Xr.shape[1],Xr.shape.length===3&&(el=Xr.shape[2],he(el>0&&el<=4,"invalid number of channels"),st=!0),he(Bi>=0&&Bi<=Zt.maxTextureSize,"invalid width"),he(Ma>=0&&Ma<=Zt.maxTextureSize,"invalid height")):("radius"in Xr&&(Bi=Ma=Xr.radius,he(Bi>=0&&Bi<=Zt.maxTextureSize,"invalid radius")),"width"in Xr&&(Bi=Xr.width,he(Bi>=0&&Bi<=Zt.maxTextureSize,"invalid width")),"height"in Xr&&(Ma=Xr.height,he(Ma>=0&&Ma<=Zt.maxTextureSize,"invalid height")),"channels"in Xr&&(el=Xr.channels,he(el>0&&el<=4,"invalid number of channels"),st=!0)),Ft.width=Bi|0,Ft.height=Ma|0,Ft.channels=el|0;var Et=!1;if("format"in Xr){var Vt=Xr.format;he(_t.webgl_depth_texture||!(Vt==="depth"||Vt==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),he.parameter(Vt,Vn,"invalid texture format");var Br=Ft.internalformat=Vn[Vt];Ft.format=Oi[Br],Vt in ci&&("type"in Xr||(Ft.type=ci[Vt])),Vt in Yn&&(Ft.compressed=!0),Et=!0}!st&&Et?Ft.channels=Ul[Ft.format]:st&&!Et?Ft.channels!==sh[Ft.format]&&(Ft.format=Ft.internalformat=sh[Ft.channels]):Et&&st&&he(Ft.channels===Ul[Ft.format],"number of channels inconsistent with specified format")}}function da(Ft){Pe.pixelStorei(rc,Ft.flipY),Pe.pixelStorei(xu,Ft.premultiplyAlpha),Pe.pixelStorei(oh,Ft.colorSpace),Pe.pixelStorei(ku,Ft.unpackAlignment)}function bi(){Ln.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Zn(Ft,Xr){var Mr=null;if(Xl(Xr)?Mr=Xr:Xr&&(he.type(Xr,"object","invalid pixel data type"),Po(Ft,Xr),"x"in Xr&&(Ft.xOffset=Xr.x|0),"y"in Xr&&(Ft.yOffset=Xr.y|0),Xl(Xr.data)&&(Mr=Xr.data)),he(!Ft.compressed||Mr instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),Xr.copy){he(!Mr,"can not specify copy and data field for the same texture");var Bi=wn.viewportWidth,Ma=wn.viewportHeight;Ft.width=Ft.width||Bi-Ft.xOffset,Ft.height=Ft.height||Ma-Ft.yOffset,Ft.needsCopy=!0,he(Ft.xOffset>=0&&Ft.xOffset=0&&Ft.yOffset0&&Ft.width<=Bi&&Ft.height>0&&Ft.height<=Ma,"copy texture read out of bounds")}else if(!Mr)Ft.width=Ft.width||1,Ft.height=Ft.height||1,Ft.channels=Ft.channels||4;else if(_r(Mr))Ft.channels=Ft.channels||4,Ft.data=Mr,!("type"in Xr)&&Ft.type===Fs&&(Ft.type=Rc(Mr));else if(ep(Mr))Ft.channels=Ft.channels||4,Eu(Ft,Mr),Ft.alignment=1,Ft.needsFree=!0;else if(ol(Mr)){var el=Mr.data;!Array.isArray(el)&&Ft.type===Fs&&(Ft.type=Rc(el));var st=Mr.shape,Et=Mr.stride,Vt,Br,Ir,Jt,sr,lr;st.length===3?(Ir=st[2],lr=Et[2]):(he(st.length===2,"invalid ndarray pixel data, must be 2 or 3D"),Ir=1,lr=1),Vt=st[0],Br=st[1],Jt=Et[0],sr=Et[1],Ft.alignment=1,Ft.width=Vt,Ft.height=Br,Ft.channels=Ir,Ft.format=Ft.internalformat=sh[Ir],Ft.needsFree=!0,rp(Ft,el,Jt,sr,lr,Mr.offset)}else if(Op(Mr)||Jp(Mr)||Xc(Mr))Op(Mr)||Jp(Mr)?Ft.element=Mr:Ft.element=Mr.canvas,Ft.width=Ft.element.width,Ft.height=Ft.element.height,Ft.channels=4;else if(hc(Mr))Ft.element=Mr,Ft.width=Mr.width,Ft.height=Mr.height,Ft.channels=4;else if(wh(Mr))Ft.element=Mr,Ft.width=Mr.naturalWidth,Ft.height=Mr.naturalHeight,Ft.channels=4;else if(Pc(Mr))Ft.element=Mr,Ft.width=Mr.videoWidth,Ft.height=Mr.videoHeight,Ft.channels=4;else if(mi(Mr)){var Mt=Ft.width||Mr[0].length,Xt=Ft.height||Mr.length,pt=Ft.channels;zl(Mr[0][0])?pt=pt||Mr[0][0].length:pt=pt||1;for(var $t=Gl.shape(Mr),zr=1,$r=0;$r<$t.length;++$r)zr*=$t[$r];var Tn=lh(Ft,zr);Gl.flatten(Mr,$t,"",Tn),tp(Ft,Tn),Ft.alignment=1,Ft.width=Mt,Ft.height=Xt,Ft.channels=pt,Ft.format=Ft.internalformat=sh[pt],Ft.needsFree=!0}Ft.type===jc?he(Zt.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):Ft.type===dl&&he(Zt.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function Sn(Ft,Xr,Mr){var Bi=Ft.element,Ma=Ft.data,el=Ft.internalformat,st=Ft.format,Et=Ft.type,Vt=Ft.width,Br=Ft.height;da(Ft),Bi?Pe.texImage2D(Xr,Mr,st,st,Et,Bi):Ft.compressed?Pe.compressedTexImage2D(Xr,Mr,el,Vt,Br,0,Ma):Ft.needsCopy?(qr(),Pe.copyTexImage2D(Xr,Mr,st,Ft.xOffset,Ft.yOffset,Vt,Br,0)):Pe.texImage2D(Xr,Mr,st,Vt,Br,0,st,Et,Ma||null)}function Wt(Ft,Xr,Mr,Bi,Ma){var el=Ft.element,st=Ft.data,Et=Ft.internalformat,Vt=Ft.format,Br=Ft.type,Ir=Ft.width,Jt=Ft.height;da(Ft),el?Pe.texSubImage2D(Xr,Ma,Mr,Bi,Vt,Br,el):Ft.compressed?Pe.compressedTexSubImage2D(Xr,Ma,Mr,Bi,Et,Ir,Jt,st):Ft.needsCopy?(qr(),Pe.copyTexSubImage2D(Xr,Ma,Mr,Bi,Ft.xOffset,Ft.yOffset,Ir,Jt)):Pe.texSubImage2D(Xr,Ma,Mr,Bi,Ir,Jt,Vt,Br,st)}var K=[];function Ei(){return K.pop()||new bi}function Ee(Ft){Ft.needsFree&&Ht.freeType(Ft.data),bi.call(Ft),K.push(Ft)}function sa(){Ln.call(this),this.genMipmaps=!1,this.mipmapHint=Gc,this.mipmask=0,this.images=Array(16)}function Jo(Ft,Xr,Mr){var Bi=Ft.images[0]=Ei();Ft.mipmask=1,Bi.width=Ft.width=Xr,Bi.height=Ft.height=Mr,Bi.channels=Ft.channels=4}function Es(Ft,Xr){var Mr=null;if(Xl(Xr))Mr=Ft.images[0]=Ei(),wi(Mr,Ft),Zn(Mr,Xr),Ft.mipmask=1;else if(Po(Ft,Xr),Array.isArray(Xr.mipmap))for(var Bi=Xr.mipmap,Ma=0;Ma>=Ma,Mr.height>>=Ma,Zn(Mr,Bi[Ma]),Ft.mipmask|=1<=0&&!("faces"in Xr)&&(Ft.genMipmaps=!0)}if("mag"in Xr){var Bi=Xr.mag;he.parameter(Bi,si),Ft.magFilter=si[Bi]}var Ma=Ft.wrapS,el=Ft.wrapT;if("wrap"in Xr){var st=Xr.wrap;typeof st=="string"?(he.parameter(st,Bn),Ma=el=Bn[st]):Array.isArray(st)&&(he.parameter(st[0],Bn),he.parameter(st[1],Bn),Ma=Bn[st[0]],el=Bn[st[1]])}else{if("wrapS"in Xr){var Et=Xr.wrapS;he.parameter(Et,Bn),Ma=Bn[Et]}if("wrapT"in Xr){var Vt=Xr.wrapT;he.parameter(Vt,Bn),el=Bn[Vt]}}if(Ft.wrapS=Ma,Ft.wrapT=el,"anisotropic"in Xr){var Br=Xr.anisotropic;he(typeof Br=="number"&&Br>=1&&Br<=Zt.maxAnisotropic,"aniso samples must be between 1 and "),Ft.anisotropic=Xr.anisotropic}if("mipmap"in Xr){var Ir=!1;switch(typeof Xr.mipmap){case"string":he.parameter(Xr.mipmap,Wn,"invalid mipmap hint"),Ft.mipmapHint=Wn[Xr.mipmap],Ft.genMipmaps=!0,Ir=!0;break;case"boolean":Ir=Ft.genMipmaps=Xr.mipmap;break;case"object":he(Array.isArray(Xr.mipmap),"invalid mipmap type"),Ft.genMipmaps=!1,Ir=!0;break;default:he.raise("invalid mipmap type")}Ir&&!("min"in Xr)&&(Ft.minFilter=Hc)}}function du(Ft,Xr){Pe.texParameteri(Xr,gp,Ft.minFilter),Pe.texParameteri(Xr,rh,Ft.magFilter),Pe.texParameteri(Xr,$p,Ft.wrapS),Pe.texParameteri(Xr,Jh,Ft.wrapT),_t.ext_texture_filter_anisotropic&&Pe.texParameteri(Xr,cs,Ft.anisotropic),Ft.genMipmaps&&(Pe.hint(nh,Ft.mipmapHint),Pe.generateMipmap(Xr))}var ru=0,uu={},za=Zt.maxTextureUnits,Mu=Array(za).map(function(){return null});function Ca(Ft){Ln.call(this),this.mipmask=0,this.internalformat=Hs,this.id=ru++,this.refCount=1,this.target=Ft,this.texture=Pe.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Js,Or.profile&&(this.stats={size:0})}function mu(Ft){Pe.activeTexture(ah),Pe.bindTexture(Ft.target,Ft.texture)}function ss(){var Ft=Mu[0];Ft?Pe.bindTexture(Ft.target,Ft.texture):Pe.bindTexture(vu,null)}function go(Ft){var Xr=Ft.texture;he(Xr,"must not double destroy texture");var Mr=Ft.unit,Bi=Ft.target;Mr>=0&&(Pe.activeTexture(ah+Mr),Pe.bindTexture(Bi,null),Mu[Mr]=null),Pe.deleteTexture(Xr),Ft.texture=null,Ft.params=null,Ft.pixels=null,Ft.refCount=0,delete uu[Ft.id],Yr.textureCount--}Se(Ca.prototype,{bind:function(){var Ft=this;Ft.bindCount+=1;var Xr=Ft.unit;if(Xr<0){for(var Mr=0;Mr0)continue;Bi.unit=-1}Mu[Mr]=Ft,Xr=Mr;break}Xr>=za&&he.raise("insufficient number of texture units"),Or.profile&&Yr.maxTextureUnits>sr)-Ir,lr.height=lr.height||(Mr.height>>sr)-Jt,he(Mr.type===lr.type&&Mr.format===lr.format&&Mr.internalformat===lr.internalformat,"incompatible format for texture.subimage"),he(Ir>=0&&Jt>=0&&Ir+lr.width<=Mr.width&&Jt+lr.height<=Mr.height,"texture.subimage write out of bounds"),he(Mr.mipmask&1<>Ir;++Ir){var Jt=Vt>>Ir,sr=Br>>Ir;if(!Jt||!sr)break;Pe.texImage2D(vu,Ir,Mr.format,Jt,sr,0,Mr.format,Mr.type,null)}return ss(),Or.profile&&(Mr.stats.size=su(Mr.internalformat,Mr.type,Vt,Br,!1,!1)),Bi}return Bi(Ft,Xr),Bi.subimage=Ma,Bi.resize=el,Bi._reglType="texture2d",Bi._texture=Mr,Or.profile&&(Bi.stats=Mr.stats),Bi.destroy=function(){Mr.decRef()},Bi}function Qo(Ft,Xr,Mr,Bi,Ma,el){var st=new Ca(xh);uu[st.id]=st,Yr.cubeCount++;var Et=new Array(6);function Vt(Jt,sr,lr,Mt,Xt,pt){var $t,zr=st.texInfo;for(Js.call(zr),$t=0;$t<6;++$t)Et[$t]=as();if(typeof Jt=="number"||!Jt){var $r=Jt|0||1;for($t=0;$t<6;++$t)Jo(Et[$t],$r,$r)}else if(typeof Jt=="object")if(sr)Es(Et[0],Jt),Es(Et[1],sr),Es(Et[2],lr),Es(Et[3],Mt),Es(Et[4],Xt),Es(Et[5],pt);else if(ps(zr,Jt),Po(st,Jt),"faces"in Jt){var Tn=Jt.faces;for(he(Array.isArray(Tn)&&Tn.length===6,"cube faces must be a length 6 array"),$t=0;$t<6;++$t)he(typeof Tn[$t]=="object"&&!!Tn[$t],"invalid input for cube map face"),wi(Et[$t],st),Es(Et[$t],Tn[$t])}else for($t=0;$t<6;++$t)Es(Et[$t],Jt);else he.raise("invalid arguments to cube map");for(wi(st,Et[0]),Zt.npotTextureCube||he(Ec(st.width)&&Ec(st.height),"your browser does not support non power or two texture dimensions"),zr.genMipmaps?st.mipmask=(Et[0].width<<1)-1:st.mipmask=Et[0].mipmask,he.textureCube(st,zr,Et,Zt),st.internalformat=Et[0].internalformat,Vt.width=Et[0].width,Vt.height=Et[0].height,mu(st),$t=0;$t<6;++$t)Cu(Et[$t],qa+$t);for(du(zr,xh),ss(),Or.profile&&(st.stats.size=su(st.internalformat,st.type,Vt.width,Vt.height,zr.genMipmaps,!0)),Vt.format=Xn[st.internalformat],Vt.type=_i[st.type],Vt.mag=Rn[zr.magFilter],Vt.min=xi[zr.minFilter],Vt.wrapS=Un[zr.wrapS],Vt.wrapT=Un[zr.wrapT],$t=0;$t<6;++$t)fu(Et[$t]);return Vt}function Br(Jt,sr,lr,Mt,Xt){he(!!sr,"must specify image data"),he(typeof Jt=="number"&&Jt===(Jt|0)&&Jt>=0&&Jt<6,"invalid face");var pt=lr|0,$t=Mt|0,zr=Xt|0,$r=Ei();return wi($r,st),$r.width=0,$r.height=0,Zn($r,sr),$r.width=$r.width||(st.width>>zr)-pt,$r.height=$r.height||(st.height>>zr)-$t,he(st.type===$r.type&&st.format===$r.format&&st.internalformat===$r.internalformat,"incompatible format for texture.subimage"),he(pt>=0&&$t>=0&&pt+$r.width<=st.width&&$t+$r.height<=st.height,"texture.subimage write out of bounds"),he(st.mipmask&1<>Mt;++Mt)Pe.texImage2D(qa+lr,Mt,st.format,sr>>Mt,sr>>Mt,0,st.format,st.type,null);return ss(),Or.profile&&(st.stats.size=su(st.internalformat,st.type,Vt.width,Vt.height,!1,!0)),Vt}}return Vt(Ft,Xr,Mr,Bi,Ma,el),Vt.subimage=Br,Vt.resize=Ir,Vt._reglType="textureCube",Vt._texture=st,Or.profile&&(Vt.stats=st.stats),Vt.destroy=function(){st.decRef()},Vt}function Qs(){for(var Ft=0;Ft>Bi,Mr.height>>Bi,0,Mr.internalformat,Mr.type,null);else for(var Ma=0;Ma<6;++Ma)Pe.texImage2D(qa+Ma,Bi,Mr.internalformat,Mr.width>>Bi,Mr.height>>Bi,0,Mr.internalformat,Mr.type,null);du(Mr.texInfo,Mr.target)})}return{create2D:ya,createCube:Qo,clear:Qs,getTexture:function(Ft){return null},restore:Cp}}var fa=36161,Rs=32854,hs=32855,lu=36194,wu=33189,uh=36168,ch=34041,Nu=35907,Qp=34836,Gi=34842,Si=34843,ji=[];ji[Rs]=2,ji[hs]=2,ji[lu]=2,ji[wu]=2,ji[uh]=1,ji[ch]=4,ji[Nu]=4,ji[Qp]=16,ji[Gi]=8,ji[Si]=6;function ao(Pe,_t,Zt){return ji[Pe]*_t*Zt}var Ic=function(Pe,_t,Zt,qr,wn){var Yr={rgba4:Rs,rgb565:lu,"rgb5 a1":hs,depth:wu,stencil:uh,"depth stencil":ch};_t.ext_srgb&&(Yr.srgba=Nu),_t.ext_color_buffer_half_float&&(Yr.rgba16f=Gi,Yr.rgb16f=Si),_t.webgl_color_buffer_float&&(Yr.rgba32f=Qp);var Or=[];Object.keys(Yr).forEach(function(Vn){var Yn=Yr[Vn];Or[Yn]=Vn});var Wn=0,Bn={};function si(Vn){this.id=Wn++,this.refCount=1,this.renderbuffer=Vn,this.format=Rs,this.width=0,this.height=0,wn.profile&&(this.stats={size:0})}si.prototype.decRef=function(){--this.refCount<=0&&Hn(this)};function Hn(Vn){var Yn=Vn.renderbuffer;he(Yn,"must not double destroy renderbuffer"),Pe.bindRenderbuffer(fa,null),Pe.deleteRenderbuffer(Yn),Vn.renderbuffer=null,Vn.refCount=0,delete Bn[Vn.id],qr.renderbufferCount--}function qn(Vn,Yn){var Tr=new si(Pe.createRenderbuffer());Bn[Tr.id]=Tr,qr.renderbufferCount++;function en(_i,Rn){var xi=0,Un=0,Oi=Rs;if(typeof _i=="object"&&_i){var Ln=_i;if("shape"in Ln){var wi=Ln.shape;he(Array.isArray(wi)&&wi.length>=2,"invalid renderbuffer shape"),xi=wi[0]|0,Un=wi[1]|0}else"radius"in Ln&&(xi=Un=Ln.radius|0),"width"in Ln&&(xi=Ln.width|0),"height"in Ln&&(Un=Ln.height|0);"format"in Ln&&(he.parameter(Ln.format,Yr,"invalid renderbuffer format"),Oi=Yr[Ln.format])}else typeof _i=="number"?(xi=_i|0,typeof Rn=="number"?Un=Rn|0:Un=xi):_i?he.raise("invalid arguments to renderbuffer constructor"):xi=Un=1;if(he(xi>0&&Un>0&&xi<=Zt.maxRenderbufferSize&&Un<=Zt.maxRenderbufferSize,"invalid renderbuffer size"),!(xi===Tr.width&&Un===Tr.height&&Oi===Tr.format))return en.width=Tr.width=xi,en.height=Tr.height=Un,Tr.format=Oi,Pe.bindRenderbuffer(fa,Tr.renderbuffer),Pe.renderbufferStorage(fa,Oi,xi,Un),he(Pe.getError()===0,"invalid render buffer format"),wn.profile&&(Tr.stats.size=ao(Tr.format,Tr.width,Tr.height)),en.format=Or[Tr.format],en}function Xn(_i,Rn){var xi=_i|0,Un=Rn|0||xi;return xi===Tr.width&&Un===Tr.height||(he(xi>0&&Un>0&&xi<=Zt.maxRenderbufferSize&&Un<=Zt.maxRenderbufferSize,"invalid renderbuffer size"),en.width=Tr.width=xi,en.height=Tr.height=Un,Pe.bindRenderbuffer(fa,Tr.renderbuffer),Pe.renderbufferStorage(fa,Tr.format,xi,Un),he(Pe.getError()===0,"invalid render buffer format"),wn.profile&&(Tr.stats.size=ao(Tr.format,Tr.width,Tr.height))),en}return en(Vn,Yn),en.resize=Xn,en._reglType="renderbuffer",en._renderbuffer=Tr,wn.profile&&(en.stats=Tr.stats),en.destroy=function(){Tr.decRef()},en}wn.profile&&(qr.getTotalRenderbufferSize=function(){var Vn=0;return Object.keys(Bn).forEach(function(Yn){Vn+=Bn[Yn].stats.size}),Vn});function ci(){Qa(Bn).forEach(function(Vn){Vn.renderbuffer=Pe.createRenderbuffer(),Pe.bindRenderbuffer(fa,Vn.renderbuffer),Pe.renderbufferStorage(fa,Vn.format,Vn.width,Vn.height)}),Pe.bindRenderbuffer(fa,null)}return{create:qn,clear:function(){Qa(Bn).forEach(Hn)},restore:ci}},Gs=36160,Lc=36161,ul=3553,Nh=34069,xa=36064,Al=36096,Lu=36128,ks=33306,_l=36053,pc=36054,Du=36055,zh=36057,Su=36061,qc=36193,Sh=5121,nc=5126,Yl=6407,Th=6408,ba=6402,z=[Yl,Th],s=[];s[Th]=4,s[Yl]=3;var x=[];x[Sh]=1,x[nc]=4,x[qc]=2;var I=32854,k=32855,H=36194,ee=33189,ne=36168,ue=34041,_e=35907,h=34836,g=34842,d=34843,b=[I,k,H,_e,g,d,h],B={};B[_l]="complete",B[pc]="incomplete attachment",B[zh]="incomplete dimensions",B[Du]="incomplete, missing attachment",B[Su]="unsupported";function G(Pe,_t,Zt,qr,wn,Yr){var Or={cur:null,next:null,dirty:!1,setFBO:null},Wn=["rgba"],Bn=["rgba4","rgb565","rgb5 a1"];_t.ext_srgb&&Bn.push("srgba"),_t.ext_color_buffer_half_float&&Bn.push("rgba16f","rgb16f"),_t.webgl_color_buffer_float&&Bn.push("rgba32f");var si=["uint8"];_t.oes_texture_half_float&&si.push("half float","float16"),_t.oes_texture_float&&si.push("float","float32");function Hn(bi,Zn,Sn){this.target=bi,this.texture=Zn,this.renderbuffer=Sn;var Wt=0,K=0;Zn?(Wt=Zn.width,K=Zn.height):Sn&&(Wt=Sn.width,K=Sn.height),this.width=Wt,this.height=K}function qn(bi){bi&&(bi.texture&&bi.texture._texture.decRef(),bi.renderbuffer&&bi.renderbuffer._renderbuffer.decRef())}function ci(bi,Zn,Sn){if(bi)if(bi.texture){var Wt=bi.texture._texture,K=Math.max(1,Wt.width),Ei=Math.max(1,Wt.height);he(K===Zn&&Ei===Sn,"inconsistent width/height for supplied texture"),Wt.refCount+=1}else{var Ee=bi.renderbuffer._renderbuffer;he(Ee.width===Zn&&Ee.height===Sn,"inconsistent width/height for renderbuffer"),Ee.refCount+=1}}function Vn(bi,Zn){Zn&&(Zn.texture?Pe.framebufferTexture2D(Gs,bi,Zn.target,Zn.texture._texture.texture,0):Pe.framebufferRenderbuffer(Gs,bi,Lc,Zn.renderbuffer._renderbuffer.renderbuffer))}function Yn(bi){var Zn=ul,Sn=null,Wt=null,K=bi;typeof bi=="object"&&(K=bi.data,"target"in bi&&(Zn=bi.target|0)),he.type(K,"function","invalid attachment data");var Ei=K._reglType;return Ei==="texture2d"?(Sn=K,he(Zn===ul)):Ei==="textureCube"?(Sn=K,he(Zn>=Nh&&Zn=2,"invalid shape for framebuffer"),Jo=mu[0],Es=mu[1]}else"radius"in Ca&&(Jo=Es=Ca.radius),"width"in Ca&&(Jo=Ca.width),"height"in Ca&&(Es=Ca.height);("color"in Ca||"colors"in Ca)&&(as=Ca.color||Ca.colors,Array.isArray(as)&&he(as.length===1||_t.webgl_draw_buffers,"multiple render targets not supported")),as||("colorCount"in Ca&&(du=Ca.colorCount|0,he(du>0,"invalid color buffer count")),"colorTexture"in Ca&&(fu=!!Ca.colorTexture,Js="rgba4"),"colorType"in Ca&&(ps=Ca.colorType,fu?(he(_t.oes_texture_float||!(ps==="float"||ps==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),he(_t.oes_texture_half_float||!(ps==="half float"||ps==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):ps==="half float"||ps==="float16"?(he(_t.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),Js="rgba16f"):(ps==="float"||ps==="float32")&&(he(_t.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),Js="rgba32f"),he.oneOf(ps,si,"invalid color type")),"colorFormat"in Ca&&(Js=Ca.colorFormat,Wn.indexOf(Js)>=0?fu=!0:Bn.indexOf(Js)>=0?fu=!1:fu?he.oneOf(Ca.colorFormat,Wn,"invalid color format for texture"):he.oneOf(Ca.colorFormat,Bn,"invalid color format for renderbuffer"))),("depthTexture"in Ca||"depthStencilTexture"in Ca)&&(Mu=!!(Ca.depthTexture||Ca.depthStencilTexture),he(!Mu||_t.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in Ca&&(typeof Ca.depth=="boolean"?Cu=Ca.depth:(ru=Ca.depth,Bl=!1)),"stencil"in Ca&&(typeof Ca.stencil=="boolean"?Bl=Ca.stencil:(uu=Ca.stencil,Cu=!1)),"depthStencil"in Ca&&(typeof Ca.depthStencil=="boolean"?Cu=Bl=Ca.depthStencil:(za=Ca.depthStencil,Cu=!1,Bl=!1))}var ss=null,go=null,ya=null,Qo=null;if(Array.isArray(as))ss=as.map(Yn);else if(as)ss=[Yn(as)];else for(ss=new Array(du),sa=0;sa=0||ss[sa].renderbuffer&&b.indexOf(ss[sa].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+sa+" is invalid"),ss[sa]&&ss[sa].texture){var Cp=s[ss[sa].texture._texture.format]*x[ss[sa].texture._texture.type];Qs===null?Qs=Cp:he(Qs===Cp,"all color attachments much have the same number of bits per pixel.")}return ci(go,Jo,Es),he(!go||go.texture&&go.texture._texture.format===ba||go.renderbuffer&&go.renderbuffer._renderbuffer.format===ee,"invalid depth attachment for framebuffer object"),ci(ya,Jo,Es),he(!ya||ya.renderbuffer&&ya.renderbuffer._renderbuffer.format===ne,"invalid stencil attachment for framebuffer object"),ci(Qo,Jo,Es),he(!Qo||Qo.texture&&Qo.texture._texture.format===ue||Qo.renderbuffer&&Qo.renderbuffer._renderbuffer.format===ue,"invalid depth-stencil attachment for framebuffer object"),Un(Sn),Sn.width=Jo,Sn.height=Es,Sn.colorAttachments=ss,Sn.depthAttachment=go,Sn.stencilAttachment=ya,Sn.depthStencilAttachment=Qo,Wt.color=ss.map(en),Wt.depth=en(go),Wt.stencil=en(ya),Wt.depthStencil=en(Qo),Wt.width=Sn.width,Wt.height=Sn.height,Ln(Sn),Wt}function K(Ei,Ee){he(Or.next!==Sn,"can not resize a framebuffer which is currently in use");var sa=Math.max(Ei|0,1),Jo=Math.max(Ee|0||sa,1);if(sa===Sn.width&&Jo===Sn.height)return Wt;for(var Es=Sn.colorAttachments,Cu=0;Cu=2,"invalid shape for framebuffer"),he(fu[0]===fu[1],"cube framebuffer must be square"),sa=fu[0]}else"radius"in as&&(sa=as.radius|0),"width"in as?(sa=as.width|0,"height"in as&&he(as.height===sa,"must be square")):"height"in as&&(sa=as.height|0);("color"in as||"colors"in as)&&(Jo=as.color||as.colors,Array.isArray(Jo)&&he(Jo.length===1||_t.webgl_draw_buffers,"multiple render targets not supported")),Jo||("colorCount"in as&&(Bl=as.colorCount|0,he(Bl>0,"invalid color buffer count")),"colorType"in as&&(he.oneOf(as.colorType,si,"invalid color type"),Cu=as.colorType),"colorFormat"in as&&(Es=as.colorFormat,he.oneOf(as.colorFormat,Wn,"invalid color format for texture"))),"depth"in as&&(Ee.depth=as.depth),"stencil"in as&&(Ee.stencil=as.stencil),"depthStencil"in as&&(Ee.depthStencil=as.depthStencil)}var Js;if(Jo)if(Array.isArray(Jo))for(Js=[],Ei=0;Ei0&&(Ee.depth=Zn[0].depth,Ee.stencil=Zn[0].stencil,Ee.depthStencil=Zn[0].depthStencil),Zn[Ei]?Zn[Ei](Ee):Zn[Ei]=wi(Ee)}return Se(Sn,{width:sa,height:sa,color:Js})}function Wt(K){var Ei,Ee=K|0;if(he(Ee>0&&Ee<=Zt.maxCubeMapSize,"invalid radius for cube fbo"),Ee===Sn.width)return Sn;var sa=Sn.color;for(Ei=0;Ei0,"must specify at least one attribute");for(var Po=0;Po=1&&Sn.size<=4,"size must be between 1 and 4"),he(Sn.offset>=0,"invalid offset"),he(Sn.stride>=0&&Sn.stride<=255,"stride must be between 0 and 255"),he(Sn.divisor>=0,"divisor must be positive"),he(!Sn.divisor||!!_t.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in Zn?(he(bi>0,"first attribute must not be a constant"),Sn.x=+Zn.x||0,Sn.y=+Zn.y||0,Sn.z=+Zn.z||0,Sn.w=+Zn.w||0,Sn.state=2):he(!1,"invalid attribute spec for location "+bi)}return Oi.refresh(),Ln}return Ln.destroy=function(){Oi.destroy()},Ln._vao=Oi,Ln._reglType="vao",Ln(Un)}return Hn}var Te=35632,Ie=35633,Oe=35718,Qe=35721;function nt(Pe,_t,Zt,qr){var wn={},Yr={};function Or(Tr,en,Xn,_i){this.name=Tr,this.id=en,this.location=Xn,this.info=_i}function Wn(Tr,en){for(var Xn=0;Xn1)for(var da=0;daTr&&(Tr=en.stats.uniformsCount)}),Tr},Zt.getMaxAttributesCount=function(){var Tr=0;return Hn.forEach(function(en){en.stats.attributesCount>Tr&&(Tr=en.stats.attributesCount)}),Tr});function Yn(){wn={},Yr={};for(var Tr=0;Tr=0,"missing vertex shader",Xn),he.command(en>=0,"missing fragment shader",Xn);var Rn=si[en];Rn||(Rn=si[en]={});var xi=Rn[Tr];if(xi&&!_i)return xi;var Un=new ci(en,Tr);return Zt.shaderCount++,Vn(Un,Xn,_i),xi||(Rn[Tr]=Un),Hn.push(Un),Un},restore:Yn,shader:Bn,frag:-1,vert:-1}}var ct=6408,tt=5121,Tt=3333,Ut=5126;function Nt(Pe,_t,Zt,qr,wn,Yr,Or){function Wn(Hn){var qn;_t.next===null?(he(wn.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),qn=tt):(he(_t.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),qn=_t.next.colorAttachments[0].texture._texture.type,Yr.oes_texture_float?(he(qn===tt||qn===Ut,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),qn===Ut&&he(Or.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):he(qn===tt,"Reading from a framebuffer is only allowed for the type 'uint8'"));var ci=0,Vn=0,Yn=qr.framebufferWidth,Tr=qr.framebufferHeight,en=null;_r(Hn)?en=Hn:Hn&&(he.type(Hn,"object","invalid arguments to regl.read()"),ci=Hn.x|0,Vn=Hn.y|0,he(ci>=0&&ci=0&&Vn0&&Yn+ci<=qr.framebufferWidth,"invalid width for read pixels"),he(Tr>0&&Tr+Vn<=qr.framebufferHeight,"invalid height for read pixels"),Zt();var Xn=Yn*Tr*4;return en||(qn===tt?en=new Uint8Array(Xn):qn===Ut&&(en=en||new Float32Array(Xn))),he.isTypedArray(en,"data buffer for regl.read() must be a typedarray"),he(en.byteLength>=Xn,"data buffer for regl.read() too small"),Pe.pixelStorei(Tt,4),Pe.readPixels(ci,Vn,Yn,Tr,ct,qn,en),en}function Bn(Hn){var qn;return _t.setFBO({framebuffer:Hn.framebuffer},function(){qn=Wn(Hn)}),qn}function si(Hn){return!Hn||!("framebuffer"in Hn)?Wn(Hn):Bn(Hn)}return si}function pr(Pe){return Array.prototype.slice.call(Pe)}function tr(Pe){return pr(Pe).join("")}function Dr(){var Pe=0,_t=[],Zt=[];function qr(qn){for(var ci=0;ci0&&(qn.push(Tr,"="),qn.push.apply(qn,pr(arguments)),qn.push(";")),Tr}return Se(ci,{def:Yn,toString:function(){return tr([Vn.length>0?"var "+Vn.join(",")+";":"",tr(qn)])}})}function Yr(){var qn=wn(),ci=wn(),Vn=qn.toString,Yn=ci.toString;function Tr(en,Xn){ci(en,Xn,"=",qn.def(en,Xn),";")}return Se(function(){qn.apply(qn,pr(arguments))},{def:qn.def,entry:qn,exit:ci,save:Tr,set:function(en,Xn,_i){Tr(en,Xn),qn(en,Xn,"=",_i,";")},toString:function(){return Vn()+Yn()}})}function Or(){var qn=tr(arguments),ci=Yr(),Vn=Yr(),Yn=ci.toString,Tr=Vn.toString;return Se(ci,{then:function(){return ci.apply(ci,pr(arguments)),this},else:function(){return Vn.apply(Vn,pr(arguments)),this},toString:function(){var en=Tr();return en&&(en="else{"+en+"}"),tr(["if(",qn,"){",Yn(),"}",en])}})}var Wn=wn(),Bn={};function si(qn,ci){var Vn=[];function Yn(){var Rn="a"+Vn.length;return Vn.push(Rn),Rn}ci=ci||0;for(var Tr=0;Tr":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Np={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},pd={frag:ld,vert:ym},yp={cw:Kf,ccw:xd};function Zf(Pe){return Array.isArray(Pe)||_r(Pe)||ol(Pe)}function zp(Pe){return Pe.sort(function(_t,Zt){return _t===ml?-1:Zt===ml?1:_t=1,qr>=2,_t)}else if(Zt===gi){var wn=Pe.data;return new Oc(wn.thisDep,wn.contextDep,wn.propDep,_t)}else return new Oc(Zt===ho,Zt===Ui,Zt===Di,_t)}var rm=new Oc(!1,!1,!1,function(){});function Ap(Pe,_t,Zt,qr,wn,Yr,Or,Wn,Bn,si,Hn,qn,ci,Vn,Yn){var Tr=si.Record,en={add:32774,subtract:32778,"reverse subtract":32779};Zt.ext_blend_minmax&&(en.min=bd,en.max=Ed);var Xn=Zt.angle_instanced_arrays,_i=Zt.webgl_draw_buffers,Rn={dirty:!0,profile:Yn.profile},xi={},Un=[],Oi={},Ln={};function wi(st){return st.replace(".","_")}function Po(st,Et,Vt){var Br=wi(st);Un.push(st),xi[Br]=Rn[Br]=!!Vt,Oi[Br]=Et}function da(st,Et,Vt){var Br=wi(st);Un.push(st),Array.isArray(Vt)?(Rn[Br]=Vt.slice(),xi[Br]=Vt.slice()):Rn[Br]=xi[Br]=Vt,Ln[Br]=Et}Po(Wi,tf),Po(Ko,xf),da(Mo,"blendColor",[0,0,0,0]),da(mo,"blendEquationSeparate",[hd,hd]),da(ko,"blendFuncSeparate",[cd,wd,cd,wd]),Po(xo,qf,!0),da(qi,"depthFunc",Uf),da(xs,"depthRange",[0,1]),da(gs,"depthMask",!0),da(Cl,Cl,[!0,!0,!0,!0]),Po(ts,Gu),da(ja,"cullFace",_p),da($a,$a,xd),da(vs,vs,1),Po(Zl,Yf),da(zu,"polygonOffset",[0,0]),Po(Uu,Kl),Po(hh,Od),da(Yc,"sampleCoverage",[1,!1]),Po(np,ud),da(pu,"stencilMask",-1),da(Tu,"stencilFunc",[Tp,0,-1]),da(Zu,"stencilOpSeparate",[Dc,Ef,Ef,Ef]),da(Dl,"stencilOpSeparate",[_p,Ef,Ef,Ef]),Po(Vl,Dd),da(Uh,"scissor",[0,0,Pe.drawingBufferWidth,Pe.drawingBufferHeight]),da(ml,ml,[0,0,Pe.drawingBufferWidth,Pe.drawingBufferHeight]);var bi={gl:Pe,context:ci,strings:_t,next:xi,current:Rn,draw:qn,elements:Yr,buffer:wn,shader:Hn,attributes:si.state,vao:si,uniforms:Bn,framebuffer:Wn,extensions:Zt,timer:Vn,isBufferArgs:Zf},Zn={primTypes:zc,compareFuncs:Ah,blendFuncs:Zh,blendEquations:en,stencilOps:Np,glTypes:Aa,orientationType:yp};he.optional(function(){bi.isArrayLike=zl}),_i&&(Zn.backBuffer=[_p],Zn.drawBuffer=Ne(qr.maxDrawbuffers,function(st){return st===0?[0]:Ne(st,function(Et){return Ou+Et})}));var Sn=0;function Wt(){var st=Dr(),Et=st.link,Vt=st.global;st.id=Sn++,st.batchId="0";var Br=Et(bi),Ir=st.shared={props:"a0"};Object.keys(bi).forEach(function(Xt){Ir[Xt]=Vt.def(Br,".",Xt)}),he.optional(function(){st.CHECK=Et(he),st.commandStr=he.guessCommand(),st.command=Et(st.commandStr),st.assert=function(Xt,pt,$t){Xt("if(!(",pt,"))",this.CHECK,".commandRaise(",Et($t),",",this.command,");")},Zn.invalidBlendCombinations=lf});var Jt=st.next={},sr=st.current={};Object.keys(Ln).forEach(function(Xt){Array.isArray(Rn[Xt])&&(Jt[Xt]=Vt.def(Ir.next,".",Xt),sr[Xt]=Vt.def(Ir.current,".",Xt))});var lr=st.constants={};Object.keys(Zn).forEach(function(Xt){lr[Xt]=Vt.def(JSON.stringify(Zn[Xt]))}),st.invoke=function(Xt,pt){switch(pt.type){case di:var $t=["this",Ir.context,Ir.props,st.batchId];return Xt.def(Et(pt.data),".call(",$t.slice(0,Math.max(pt.data.length+1,4)),")");case Di:return Xt.def(Ir.props,pt.data);case Ui:return Xt.def(Ir.context,pt.data);case ho:return Xt.def("this",pt.data);case gi:return pt.data.append(st,Xt),pt.data.ref}},st.attribCache={};var Mt={};return st.scopeAttrib=function(Xt){var pt=_t.id(Xt);if(pt in Mt)return Mt[pt];var $t=si.scope[pt];$t||($t=si.scope[pt]=new Tr);var zr=Mt[pt]=Et($t);return zr},st}function K(st){var Et=st.static,Vt=st.dynamic,Br;if($l in Et){var Ir=!!Et[$l];Br=Au(function(sr,lr){return Ir}),Br.enable=Ir}else if($l in Vt){var Jt=Vt[$l];Br=dh(Jt,function(sr,lr){return sr.invoke(lr,Jt)})}return Br}function Ei(st,Et){var Vt=st.static,Br=st.dynamic;if(Vu in Vt){var Ir=Vt[Vu];return Ir?(Ir=Wn.getFramebuffer(Ir),he.command(Ir,"invalid framebuffer object"),Au(function(sr,lr){var Mt=sr.link(Ir),Xt=sr.shared;lr.set(Xt.framebuffer,".next",Mt);var pt=Xt.context;return lr.set(pt,"."+Bp,Mt+".width"),lr.set(pt,"."+fc,Mt+".height"),Mt})):Au(function(sr,lr){var Mt=sr.shared;lr.set(Mt.framebuffer,".next","null");var Xt=Mt.context;return lr.set(Xt,"."+Bp,Xt+"."+_s),lr.set(Xt,"."+fc,Xt+"."+Ff),"null"})}else if(Vu in Br){var Jt=Br[Vu];return dh(Jt,function(sr,lr){var Mt=sr.invoke(lr,Jt),Xt=sr.shared,pt=Xt.framebuffer,$t=lr.def(pt,".getFramebuffer(",Mt,")");he.optional(function(){sr.assert(lr,"!"+Mt+"||"+$t,"invalid framebuffer object")}),lr.set(pt,".next",$t);var zr=Xt.context;return lr.set(zr,"."+Bp,$t+"?"+$t+".width:"+zr+"."+_s),lr.set(zr,"."+fc,$t+"?"+$t+".height:"+zr+"."+Ff),$t})}else return null}function Ee(st,Et,Vt){var Br=st.static,Ir=st.dynamic;function Jt(Mt){if(Mt in Br){var Xt=Br[Mt];he.commandType(Xt,"object","invalid "+Mt,Vt.commandStr);var pt=!0,$t=Xt.x|0,zr=Xt.y|0,$r,Tn;return"width"in Xt?($r=Xt.width|0,he.command($r>=0,"invalid "+Mt,Vt.commandStr)):pt=!1,"height"in Xt?(Tn=Xt.height|0,he.command(Tn>=0,"invalid "+Mt,Vt.commandStr)):pt=!1,new Oc(!pt&&Et&&Et.thisDep,!pt&&Et&&Et.contextDep,!pt&&Et&&Et.propDep,function(Qn,Fi){var Vr=Qn.shared.context,po=$r;"width"in Xt||(po=Fi.def(Vr,".",Bp,"-",$t));var la=Tn;return"height"in Xt||(la=Fi.def(Vr,".",fc,"-",zr)),[$t,zr,po,la]})}else if(Mt in Ir){var vn=Ir[Mt],_n=dh(vn,function(Qn,Fi){var Vr=Qn.invoke(Fi,vn);he.optional(function(){Qn.assert(Fi,Vr+"&&typeof "+Vr+'==="object"',"invalid "+Mt)});var po=Qn.shared.context,la=Fi.def(Vr,".x|0"),Ns=Fi.def(Vr,".y|0"),Fl=Fi.def('"width" in ',Vr,"?",Vr,".width|0:","(",po,".",Bp,"-",la,")"),ic=Fi.def('"height" in ',Vr,"?",Vr,".height|0:","(",po,".",fc,"-",Ns,")");return he.optional(function(){Qn.assert(Fi,Fl+">=0&&"+ic+">=0","invalid "+Mt)}),[la,Ns,Fl,ic]});return Et&&(_n.thisDep=_n.thisDep||Et.thisDep,_n.contextDep=_n.contextDep||Et.contextDep,_n.propDep=_n.propDep||Et.propDep),_n}else return Et?new Oc(Et.thisDep,Et.contextDep,Et.propDep,function(Qn,Fi){var Vr=Qn.shared.context;return[0,0,Fi.def(Vr,".",Bp),Fi.def(Vr,".",fc)]}):null}var sr=Jt(ml);if(sr){var lr=sr;sr=new Oc(sr.thisDep,sr.contextDep,sr.propDep,function(Mt,Xt){var pt=lr.append(Mt,Xt),$t=Mt.shared.context;return Xt.set($t,"."+Wf,pt[2]),Xt.set($t,"."+op,pt[3]),pt})}return{viewport:sr,scissor_box:Jt(Uh)}}function sa(st,Et){var Vt=st.static,Br=typeof Vt[ju]=="string"&&typeof Vt[Ws]=="string";if(Br){if(Object.keys(Et.dynamic).length>0)return null;var Ir=Et.static,Jt=Object.keys(Ir);if(Jt.length>0&&typeof Ir[Jt[0]]=="number"){for(var sr=[],lr=0;lr=0,"invalid "+pt,Et.commandStr),Au(function(Tn,vn){return $t&&(Tn.OFFSET=zr),zr})}else if(pt in Br){var $r=Br[pt];return dh($r,function(Tn,vn){var _n=Tn.invoke(vn,$r);return $t&&(Tn.OFFSET=_n,he.optional(function(){Tn.assert(vn,_n+">=0","invalid "+pt)})),_n})}else if($t&&Jt)return Au(function(Tn,vn){return Tn.OFFSET="0",0});return null}var Mt=lr(ph,!0);function Xt(){if(Ol in Vt){var pt=Vt[Ol]|0;return he.command(typeof pt=="number"&&pt>=0,"invalid vertex count",Et.commandStr),Au(function(){return pt})}else if(Ol in Br){var $t=Br[Ol];return dh($t,function(Tn,vn){var _n=Tn.invoke(vn,$t);return he.optional(function(){Tn.assert(vn,"typeof "+_n+'==="number"&&'+_n+">=0&&"+_n+"===("+_n+"|0)","invalid vertex count")}),_n})}else if(Jt)if(Wu(Jt)){if(Jt)return Mt?new Oc(Mt.thisDep,Mt.contextDep,Mt.propDep,function(Tn,vn){var _n=vn.def(Tn.ELEMENTS,".vertCount-",Tn.OFFSET);return he.optional(function(){Tn.assert(vn,_n+">=0","invalid vertex offset/element buffer too small")}),_n}):Au(function(Tn,vn){return vn.def(Tn.ELEMENTS,".vertCount")});var zr=Au(function(){return-1});return he.optional(function(){zr.MISSING=!0}),zr}else{var $r=new Oc(Jt.thisDep||Mt.thisDep,Jt.contextDep||Mt.contextDep,Jt.propDep||Mt.propDep,function(Tn,vn){var _n=Tn.ELEMENTS;return Tn.OFFSET?vn.def(_n,"?",_n,".vertCount-",Tn.OFFSET,":-1"):vn.def(_n,"?",_n,".vertCount:-1")});return he.optional(function(){$r.DYNAMIC=!0}),$r}return null}return{elements:Jt,primitive:sr(),count:Xt(),instances:lr(_f,!1),offset:Mt}}function Cu(st,Et){var Vt=st.static,Br=st.dynamic,Ir={};return Un.forEach(function(Jt){var sr=wi(Jt);function lr(Mt,Xt){if(Jt in Vt){var pt=Mt(Vt[Jt]);Ir[sr]=Au(function(){return pt})}else if(Jt in Br){var $t=Br[Jt];Ir[sr]=dh($t,function(zr,$r){return Xt(zr,$r,zr.invoke($r,$t))})}}switch(Jt){case ts:case Ko:case Wi:case np:case xo:case Vl:case Zl:case Uu:case hh:case gs:return lr(function(Mt){return he.commandType(Mt,"boolean",Jt,Et.commandStr),Mt},function(Mt,Xt,pt){return he.optional(function(){Mt.assert(Xt,"typeof "+pt+'==="boolean"',"invalid flag "+Jt,Mt.commandStr)}),pt});case qi:return lr(function(Mt){return he.commandParameter(Mt,Ah,"invalid "+Jt,Et.commandStr),Ah[Mt]},function(Mt,Xt,pt){var $t=Mt.constants.compareFuncs;return he.optional(function(){Mt.assert(Xt,pt+" in "+$t,"invalid "+Jt+", must be one of "+Object.keys(Ah))}),Xt.def($t,"[",pt,"]")});case xs:return lr(function(Mt){return he.command(zl(Mt)&&Mt.length===2&&typeof Mt[0]=="number"&&typeof Mt[1]=="number"&&Mt[0]<=Mt[1],"depth range is 2d array",Et.commandStr),Mt},function(Mt,Xt,pt){he.optional(function(){Mt.assert(Xt,Mt.shared.isArrayLike+"("+pt+")&&"+pt+".length===2&&typeof "+pt+'[0]==="number"&&typeof '+pt+'[1]==="number"&&'+pt+"[0]<="+pt+"[1]","depth range must be a 2d array")});var $t=Xt.def("+",pt,"[0]"),zr=Xt.def("+",pt,"[1]");return[$t,zr]});case ko:return lr(function(Mt){he.commandType(Mt,"object","blend.func",Et.commandStr);var Xt="srcRGB"in Mt?Mt.srcRGB:Mt.src,pt="srcAlpha"in Mt?Mt.srcAlpha:Mt.src,$t="dstRGB"in Mt?Mt.dstRGB:Mt.dst,zr="dstAlpha"in Mt?Mt.dstAlpha:Mt.dst;return he.commandParameter(Xt,Zh,sr+".srcRGB",Et.commandStr),he.commandParameter(pt,Zh,sr+".srcAlpha",Et.commandStr),he.commandParameter($t,Zh,sr+".dstRGB",Et.commandStr),he.commandParameter(zr,Zh,sr+".dstAlpha",Et.commandStr),he.command(lf.indexOf(Xt+", "+$t)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+Xt+", "+$t+")",Et.commandStr),[Zh[Xt],Zh[$t],Zh[pt],Zh[zr]]},function(Mt,Xt,pt){var $t=Mt.constants.blendFuncs;he.optional(function(){Mt.assert(Xt,pt+"&&typeof "+pt+'==="object"',"invalid blend func, must be an object")});function zr(Vr,po){var la=Xt.def('"',Vr,po,'" in ',pt,"?",pt,".",Vr,po,":",pt,".",Vr);return he.optional(function(){Mt.assert(Xt,la+" in "+$t,"invalid "+Jt+"."+Vr+po+", must be one of "+Object.keys(Zh))}),la}var $r=zr("src","RGB"),Tn=zr("dst","RGB");he.optional(function(){var Vr=Mt.constants.invalidBlendCombinations;Mt.assert(Xt,Vr+".indexOf("+$r+'+", "+'+Tn+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var vn=Xt.def($t,"[",$r,"]"),_n=Xt.def($t,"[",zr("src","Alpha"),"]"),Qn=Xt.def($t,"[",Tn,"]"),Fi=Xt.def($t,"[",zr("dst","Alpha"),"]");return[vn,Qn,_n,Fi]});case mo:return lr(function(Mt){if(typeof Mt=="string")return he.commandParameter(Mt,en,"invalid "+Jt,Et.commandStr),[en[Mt],en[Mt]];if(typeof Mt=="object")return he.commandParameter(Mt.rgb,en,Jt+".rgb",Et.commandStr),he.commandParameter(Mt.alpha,en,Jt+".alpha",Et.commandStr),[en[Mt.rgb],en[Mt.alpha]];he.commandRaise("invalid blend.equation",Et.commandStr)},function(Mt,Xt,pt){var $t=Mt.constants.blendEquations,zr=Xt.def(),$r=Xt.def(),Tn=Mt.cond("typeof ",pt,'==="string"');return he.optional(function(){function vn(_n,Qn,Fi){Mt.assert(_n,Fi+" in "+$t,"invalid "+Qn+", must be one of "+Object.keys(en))}vn(Tn.then,Jt,pt),Mt.assert(Tn.else,pt+"&&typeof "+pt+'==="object"',"invalid "+Jt),vn(Tn.else,Jt+".rgb",pt+".rgb"),vn(Tn.else,Jt+".alpha",pt+".alpha")}),Tn.then(zr,"=",$r,"=",$t,"[",pt,"];"),Tn.else(zr,"=",$t,"[",pt,".rgb];",$r,"=",$t,"[",pt,".alpha];"),Xt(Tn),[zr,$r]});case Mo:return lr(function(Mt){return he.command(zl(Mt)&&Mt.length===4,"blend.color must be a 4d array",Et.commandStr),Ne(4,function(Xt){return+Mt[Xt]})},function(Mt,Xt,pt){return he.optional(function(){Mt.assert(Xt,Mt.shared.isArrayLike+"("+pt+")&&"+pt+".length===4","blend.color must be a 4d array")}),Ne(4,function($t){return Xt.def("+",pt,"[",$t,"]")})});case pu:return lr(function(Mt){return he.commandType(Mt,"number",sr,Et.commandStr),Mt|0},function(Mt,Xt,pt){return he.optional(function(){Mt.assert(Xt,"typeof "+pt+'==="number"',"invalid stencil.mask")}),Xt.def(pt,"|0")});case Tu:return lr(function(Mt){he.commandType(Mt,"object",sr,Et.commandStr);var Xt=Mt.cmp||"keep",pt=Mt.ref||0,$t="mask"in Mt?Mt.mask:-1;return he.commandParameter(Xt,Ah,Jt+".cmp",Et.commandStr),he.commandType(pt,"number",Jt+".ref",Et.commandStr),he.commandType($t,"number",Jt+".mask",Et.commandStr),[Ah[Xt],pt,$t]},function(Mt,Xt,pt){var $t=Mt.constants.compareFuncs;he.optional(function(){function vn(){Mt.assert(Xt,Array.prototype.join.call(arguments,""),"invalid stencil.func")}vn(pt+"&&typeof ",pt,'==="object"'),vn('!("cmp" in ',pt,")||(",pt,".cmp in ",$t,")")});var zr=Xt.def('"cmp" in ',pt,"?",$t,"[",pt,".cmp]",":",Ef),$r=Xt.def(pt,".ref|0"),Tn=Xt.def('"mask" in ',pt,"?",pt,".mask|0:-1");return[zr,$r,Tn]});case Zu:case Dl:return lr(function(Mt){he.commandType(Mt,"object",sr,Et.commandStr);var Xt=Mt.fail||"keep",pt=Mt.zfail||"keep",$t=Mt.zpass||"keep";return he.commandParameter(Xt,Np,Jt+".fail",Et.commandStr),he.commandParameter(pt,Np,Jt+".zfail",Et.commandStr),he.commandParameter($t,Np,Jt+".zpass",Et.commandStr),[Jt===Dl?_p:Dc,Np[Xt],Np[pt],Np[$t]]},function(Mt,Xt,pt){var $t=Mt.constants.stencilOps;he.optional(function(){Mt.assert(Xt,pt+"&&typeof "+pt+'==="object"',"invalid "+Jt)});function zr($r){return he.optional(function(){Mt.assert(Xt,'!("'+$r+'" in '+pt+")||("+pt+"."+$r+" in "+$t+")","invalid "+Jt+"."+$r+", must be one of "+Object.keys(Np))}),Xt.def('"',$r,'" in ',pt,"?",$t,"[",pt,".",$r,"]:",Ef)}return[Jt===Dl?_p:Dc,zr("fail"),zr("zfail"),zr("zpass")]});case zu:return lr(function(Mt){he.commandType(Mt,"object",sr,Et.commandStr);var Xt=Mt.factor|0,pt=Mt.units|0;return he.commandType(Xt,"number",sr+".factor",Et.commandStr),he.commandType(pt,"number",sr+".units",Et.commandStr),[Xt,pt]},function(Mt,Xt,pt){he.optional(function(){Mt.assert(Xt,pt+"&&typeof "+pt+'==="object"',"invalid "+Jt)});var $t=Xt.def(pt,".factor|0"),zr=Xt.def(pt,".units|0");return[$t,zr]});case ja:return lr(function(Mt){var Xt=0;return Mt==="front"?Xt=Dc:Mt==="back"&&(Xt=_p),he.command(!!Xt,sr,Et.commandStr),Xt},function(Mt,Xt,pt){return he.optional(function(){Mt.assert(Xt,pt+'==="front"||'+pt+'==="back"',"invalid cull.face")}),Xt.def(pt,'==="front"?',Dc,":",_p)});case vs:return lr(function(Mt){return he.command(typeof Mt=="number"&&Mt>=qr.lineWidthDims[0]&&Mt<=qr.lineWidthDims[1],"invalid line width, must be a positive number between "+qr.lineWidthDims[0]+" and "+qr.lineWidthDims[1],Et.commandStr),Mt},function(Mt,Xt,pt){return he.optional(function(){Mt.assert(Xt,"typeof "+pt+'==="number"&&'+pt+">="+qr.lineWidthDims[0]+"&&"+pt+"<="+qr.lineWidthDims[1],"invalid line width")}),pt});case $a:return lr(function(Mt){return he.commandParameter(Mt,yp,sr,Et.commandStr),yp[Mt]},function(Mt,Xt,pt){return he.optional(function(){Mt.assert(Xt,pt+'==="cw"||'+pt+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),Xt.def(pt+'==="cw"?'+Kf+":"+xd)});case Cl:return lr(function(Mt){return he.command(zl(Mt)&&Mt.length===4,"color.mask must be length 4 array",Et.commandStr),Mt.map(function(Xt){return!!Xt})},function(Mt,Xt,pt){return he.optional(function(){Mt.assert(Xt,Mt.shared.isArrayLike+"("+pt+")&&"+pt+".length===4","invalid color.mask")}),Ne(4,function($t){return"!!"+pt+"["+$t+"]"})});case Yc:return lr(function(Mt){he.command(typeof Mt=="object"&&Mt,sr,Et.commandStr);var Xt="value"in Mt?Mt.value:1,pt=!!Mt.invert;return he.command(typeof Xt=="number"&&Xt>=0&&Xt<=1,"sample.coverage.value must be a number between 0 and 1",Et.commandStr),[Xt,pt]},function(Mt,Xt,pt){he.optional(function(){Mt.assert(Xt,pt+"&&typeof "+pt+'==="object"',"invalid sample.coverage")});var $t=Xt.def('"value" in ',pt,"?+",pt,".value:1"),zr=Xt.def("!!",pt,".invert");return[$t,zr]})}}),Ir}function Bl(st,Et){var Vt=st.static,Br=st.dynamic,Ir={};return Object.keys(Vt).forEach(function(Jt){var sr=Vt[Jt],lr;if(typeof sr=="number"||typeof sr=="boolean")lr=Au(function(){return sr});else if(typeof sr=="function"){var Mt=sr._reglType;Mt==="texture2d"||Mt==="textureCube"?lr=Au(function(Xt){return Xt.link(sr)}):Mt==="framebuffer"||Mt==="framebufferCube"?(he.command(sr.color.length>0,'missing color attachment for framebuffer sent to uniform "'+Jt+'"',Et.commandStr),lr=Au(function(Xt){return Xt.link(sr.color[0])})):he.commandRaise('invalid data for uniform "'+Jt+'"',Et.commandStr)}else zl(sr)?lr=Au(function(Xt){var pt=Xt.global.def("[",Ne(sr.length,function($t){return he.command(typeof sr[$t]=="number"||typeof sr[$t]=="boolean","invalid uniform "+Jt,Xt.commandStr),sr[$t]}),"]");return pt}):he.commandRaise('invalid or missing data for uniform "'+Jt+'"',Et.commandStr);lr.value=sr,Ir[Jt]=lr}),Object.keys(Br).forEach(function(Jt){var sr=Br[Jt];Ir[Jt]=dh(sr,function(lr,Mt){return lr.invoke(Mt,sr)})}),Ir}function as(st,Et){var Vt=st.static,Br=st.dynamic,Ir={};return Object.keys(Vt).forEach(function(Jt){var sr=Vt[Jt],lr=_t.id(Jt),Mt=new Tr;if(Zf(sr))Mt.state=nn,Mt.buffer=wn.getBuffer(wn.create(sr,fh,!1,!0)),Mt.type=0;else{var Xt=wn.getBuffer(sr);if(Xt)Mt.state=nn,Mt.buffer=Xt,Mt.type=0;else if(he.command(typeof sr=="object"&&sr,"invalid data for attribute "+Jt,Et.commandStr),"constant"in sr){var pt=sr.constant;Mt.buffer="null",Mt.state=Gn,typeof pt=="number"?Mt.x=pt:(he.command(zl(pt)&&pt.length>0&&pt.length<=4,"invalid constant for attribute "+Jt,Et.commandStr),Hr.forEach(function(Qn,Fi){Fi=0,'invalid offset for attribute "'+Jt+'"',Et.commandStr);var zr=sr.stride|0;he.command(zr>=0&&zr<256,'invalid stride for attribute "'+Jt+'", must be integer betweeen [0, 255]',Et.commandStr);var $r=sr.size|0;he.command(!("size"in sr)||$r>0&&$r<=4,'invalid size for attribute "'+Jt+'", must be 1,2,3,4',Et.commandStr);var Tn=!!sr.normalized,vn=0;"type"in sr&&(he.commandParameter(sr.type,Aa,"invalid type for attribute "+Jt,Et.commandStr),vn=Aa[sr.type]);var _n=sr.divisor|0;"divisor"in sr&&(he.command(_n===0||Xn,'cannot specify divisor for attribute "'+Jt+'", instancing not supported',Et.commandStr),he.command(_n>=0,'invalid divisor for attribute "'+Jt+'"',Et.commandStr)),he.optional(function(){var Qn=Et.commandStr,Fi=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(sr).forEach(function(Vr){he.command(Fi.indexOf(Vr)>=0,'unknown parameter "'+Vr+'" for attribute pointer "'+Jt+'" (valid parameters are '+Fi+")",Qn)})}),Mt.buffer=Xt,Mt.state=nn,Mt.size=$r,Mt.normalized=Tn,Mt.type=vn||Xt.dtype,Mt.offset=$t,Mt.stride=zr,Mt.divisor=_n}}Ir[Jt]=Au(function(Qn,Fi){var Vr=Qn.attribCache;if(lr in Vr)return Vr[lr];var po={isStream:!1};return Object.keys(Mt).forEach(function(la){po[la]=Mt[la]}),Mt.buffer&&(po.buffer=Qn.link(Mt.buffer),po.type=po.type||po.buffer+".dtype"),Vr[lr]=po,po})}),Object.keys(Br).forEach(function(Jt){var sr=Br[Jt];function lr(Mt,Xt){var pt=Mt.invoke(Xt,sr),$t=Mt.shared,zr=Mt.constants,$r=$t.isBufferArgs,Tn=$t.buffer;he.optional(function(){Mt.assert(Xt,pt+"&&(typeof "+pt+'==="object"||typeof '+pt+'==="function")&&('+$r+"("+pt+")||"+Tn+".getBuffer("+pt+")||"+Tn+".getBuffer("+pt+".buffer)||"+$r+"("+pt+'.buffer)||("constant" in '+pt+"&&(typeof "+pt+'.constant==="number"||'+$t.isArrayLike+"("+pt+".constant))))",'invalid dynamic attribute "'+Jt+'"')});var vn={isStream:Xt.def(!1)},_n=new Tr;_n.state=nn,Object.keys(_n).forEach(function(po){vn[po]=Xt.def(""+_n[po])});var Qn=vn.buffer,Fi=vn.type;Xt("if(",$r,"(",pt,")){",vn.isStream,"=true;",Qn,"=",Tn,".createStream(",fh,",",pt,");",Fi,"=",Qn,".dtype;","}else{",Qn,"=",Tn,".getBuffer(",pt,");","if(",Qn,"){",Fi,"=",Qn,".dtype;",'}else if("constant" in ',pt,"){",vn.state,"=",Gn,";","if(typeof "+pt+'.constant === "number"){',vn[Hr[0]],"=",pt,".constant;",Hr.slice(1).map(function(po){return vn[po]}).join("="),"=0;","}else{",Hr.map(function(po,la){return vn[po]+"="+pt+".constant.length>"+la+"?"+pt+".constant["+la+"]:0;"}).join(""),"}}else{","if(",$r,"(",pt,".buffer)){",Qn,"=",Tn,".createStream(",fh,",",pt,".buffer);","}else{",Qn,"=",Tn,".getBuffer(",pt,".buffer);","}",Fi,'="type" in ',pt,"?",zr.glTypes,"[",pt,".type]:",Qn,".dtype;",vn.normalized,"=!!",pt,".normalized;");function Vr(po){Xt(vn[po],"=",pt,".",po,"|0;")}return Vr("size"),Vr("offset"),Vr("stride"),Vr("divisor"),Xt("}}"),Xt.exit("if(",vn.isStream,"){",Tn,".destroyStream(",Qn,");","}"),vn}Ir[Jt]=dh(sr,lr)}),Ir}function fu(st,Et){var Vt=st.static,Br=st.dynamic;if(ip in Vt){var Ir=Vt[ip];return Ir!==null&&si.getVAO(Ir)===null&&(Ir=si.createVAO(Ir)),Au(function(sr){return sr.link(si.getVAO(Ir))})}else if(ip in Br){var Jt=Br[ip];return dh(Jt,function(sr,lr){var Mt=sr.invoke(lr,Jt);return lr.def(sr.shared.vao+".getVAO("+Mt+")")})}return null}function Js(st){var Et=st.static,Vt=st.dynamic,Br={};return Object.keys(Et).forEach(function(Ir){var Jt=Et[Ir];Br[Ir]=Au(function(sr,lr){return typeof Jt=="number"||typeof Jt=="boolean"?""+Jt:sr.link(Jt)})}),Object.keys(Vt).forEach(function(Ir){var Jt=Vt[Ir];Br[Ir]=dh(Jt,function(sr,lr){return sr.invoke(lr,Jt)})}),Br}function ps(st,Et,Vt,Br,Ir){var Jt=st.static,sr=st.dynamic;he.optional(function(){var Vr=[Vu,Ws,ju,os,yl,ph,Ol,_f,$l,ip].concat(Un);function po(la){Object.keys(la).forEach(function(Ns){he.command(Vr.indexOf(Ns)>=0,'unknown parameter "'+Ns+'"',Ir.commandStr)})}po(Jt),po(sr)});var lr=sa(st,Et),Mt=Ei(st,Ir),Xt=Ee(st,Mt,Ir),pt=Es(st,Ir),$t=Cu(st,Ir),zr=Jo(st,Ir,lr);function $r(Vr){var po=Xt[Vr];po&&($t[Vr]=po)}$r(ml),$r(wi(Uh));var Tn=Object.keys($t).length>0,vn={framebuffer:Mt,draw:pt,shader:zr,state:$t,dirty:Tn,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(vn.profile=K(st,Ir),vn.uniforms=Bl(Vt,Ir),vn.drawVAO=vn.scopeVAO=fu(st,Ir),!vn.drawVAO&&zr.program&&!lr&&Zt.angle_instanced_arrays){var _n=!0,Qn=zr.program.attributes.map(function(Vr){var po=Et.static[Vr];return _n=_n&&!!po,po});if(_n&&Qn.length>0){var Fi=si.getVAO(si.createVAO(Qn));vn.drawVAO=new Oc(null,null,null,function(Vr,po){return Vr.link(Fi)}),vn.useVAO=!0}}return lr?vn.useVAO=!0:vn.attributes=as(Et,Ir),vn.context=Js(Br,Ir),vn}function du(st,Et,Vt){var Br=st.shared,Ir=Br.context,Jt=st.scope();Object.keys(Vt).forEach(function(sr){Et.save(Ir,"."+sr);var lr=Vt[sr];Jt(Ir,".",sr,"=",lr.append(st,Et),";")}),Et(Jt)}function ru(st,Et,Vt,Br){var Ir=st.shared,Jt=Ir.gl,sr=Ir.framebuffer,lr;_i&&(lr=Et.def(Ir.extensions,".webgl_draw_buffers"));var Mt=st.constants,Xt=Mt.drawBuffer,pt=Mt.backBuffer,$t;Vt?$t=Vt.append(st,Et):$t=Et.def(sr,".next"),Br||Et("if(",$t,"!==",sr,".cur){"),Et("if(",$t,"){",Jt,".bindFramebuffer(",sf,",",$t,".framebuffer);"),_i&&Et(lr,".drawBuffersWEBGL(",Xt,"[",$t,".colorAttachments.length]);"),Et("}else{",Jt,".bindFramebuffer(",sf,",null);"),_i&&Et(lr,".drawBuffersWEBGL(",pt,");"),Et("}",sr,".cur=",$t,";"),Br||Et("}")}function uu(st,Et,Vt){var Br=st.shared,Ir=Br.gl,Jt=st.current,sr=st.next,lr=Br.current,Mt=Br.next,Xt=st.cond(lr,".dirty");Un.forEach(function(pt){var $t=wi(pt);if(!($t in Vt.state)){var zr,$r;if($t in sr){zr=sr[$t],$r=Jt[$t];var Tn=Ne(Rn[$t].length,function(_n){return Xt.def(zr,"[",_n,"]")});Xt(st.cond(Tn.map(function(_n,Qn){return _n+"!=="+$r+"["+Qn+"]"}).join("||")).then(Ir,".",Ln[$t],"(",Tn,");",Tn.map(function(_n,Qn){return $r+"["+Qn+"]="+_n}).join(";"),";"))}else{zr=Xt.def(Mt,".",$t);var vn=st.cond(zr,"!==",lr,".",$t);Xt(vn),$t in Oi?vn(st.cond(zr).then(Ir,".enable(",Oi[$t],");").else(Ir,".disable(",Oi[$t],");"),lr,".",$t,"=",zr,";"):vn(Ir,".",Ln[$t],"(",zr,");",lr,".",$t,"=",zr,";")}}}),Object.keys(Vt.state).length===0&&Xt(lr,".dirty=false;"),Et(Xt)}function za(st,Et,Vt,Br){var Ir=st.shared,Jt=st.current,sr=Ir.current,lr=Ir.gl;zp(Object.keys(Vt)).forEach(function(Mt){var Xt=Vt[Mt];if(!(Br&&!Br(Xt))){var pt=Xt.append(st,Et);if(Oi[Mt]){var $t=Oi[Mt];Wu(Xt)?pt?Et(lr,".enable(",$t,");"):Et(lr,".disable(",$t,");"):Et(st.cond(pt).then(lr,".enable(",$t,");").else(lr,".disable(",$t,");")),Et(sr,".",Mt,"=",pt,";")}else if(zl(pt)){var zr=Jt[Mt];Et(lr,".",Ln[Mt],"(",pt,");",pt.map(function($r,Tn){return zr+"["+Tn+"]="+$r}).join(";"),";")}else Et(lr,".",Ln[Mt],"(",pt,");",sr,".",Mt,"=",pt,";")}})}function Mu(st,Et){Xn&&(st.instancing=Et.def(st.shared.extensions,".angle_instanced_arrays"))}function Ca(st,Et,Vt,Br,Ir){var Jt=st.shared,sr=st.stats,lr=Jt.current,Mt=Jt.timer,Xt=Vt.profile;function pt(){return typeof performance=="undefined"?"Date.now()":"performance.now()"}var $t,zr;function $r(Vr){$t=Et.def(),Vr($t,"=",pt(),";"),typeof Ir=="string"?Vr(sr,".count+=",Ir,";"):Vr(sr,".count++;"),Vn&&(Br?(zr=Et.def(),Vr(zr,"=",Mt,".getNumPendingQueries();")):Vr(Mt,".beginQuery(",sr,");"))}function Tn(Vr){Vr(sr,".cpuTime+=",pt(),"-",$t,";"),Vn&&(Br?Vr(Mt,".pushScopeStats(",zr,",",Mt,".getNumPendingQueries(),",sr,");"):Vr(Mt,".endQuery();"))}function vn(Vr){var po=Et.def(lr,".profile");Et(lr,".profile=",Vr,";"),Et.exit(lr,".profile=",po,";")}var _n;if(Xt){if(Wu(Xt)){Xt.enable?($r(Et),Tn(Et.exit),vn("true")):vn("false");return}_n=Xt.append(st,Et),vn(_n)}else _n=Et.def(lr,".profile");var Qn=st.block();$r(Qn),Et("if(",_n,"){",Qn,"}");var Fi=st.block();Tn(Fi),Et.exit("if(",_n,"){",Fi,"}")}function mu(st,Et,Vt,Br,Ir){var Jt=st.shared;function sr(Mt){switch(Mt){case bf:case kf:case Sp:return 2;case wp:case xl:case rf:return 3;case $f:case dc:case nf:return 4;default:return 1}}function lr(Mt,Xt,pt){var $t=Jt.gl,zr=Et.def(Mt,".location"),$r=Et.def(Jt.attributes,"[",zr,"]"),Tn=pt.state,vn=pt.buffer,_n=[pt.x,pt.y,pt.z,pt.w],Qn=["buffer","normalized","offset","stride"];function Fi(){Et("if(!",$r,".buffer){",$t,".enableVertexAttribArray(",zr,");}");var po=pt.type,la;if(pt.size?la=Et.def(pt.size,"||",Xt):la=Xt,Et("if(",$r,".type!==",po,"||",$r,".size!==",la,"||",Qn.map(function(Fl){return $r+"."+Fl+"!=="+pt[Fl]}).join("||"),"){",$t,".bindBuffer(",fh,",",vn,".buffer);",$t,".vertexAttribPointer(",[zr,la,po,pt.normalized,pt.stride,pt.offset],");",$r,".type=",po,";",$r,".size=",la,";",Qn.map(function(Fl){return $r+"."+Fl+"="+pt[Fl]+";"}).join(""),"}"),Xn){var Ns=pt.divisor;Et("if(",$r,".divisor!==",Ns,"){",st.instancing,".vertexAttribDivisorANGLE(",[zr,Ns],");",$r,".divisor=",Ns,";}")}}function Vr(){Et("if(",$r,".buffer){",$t,".disableVertexAttribArray(",zr,");",$r,".buffer=null;","}if(",Hr.map(function(po,la){return $r+"."+po+"!=="+_n[la]}).join("||"),"){",$t,".vertexAttrib4f(",zr,",",_n,");",Hr.map(function(po,la){return $r+"."+po+"="+_n[la]+";"}).join(""),"}")}Tn===nn?Fi():Tn===Gn?Vr():(Et("if(",Tn,"===",nn,"){"),Fi(),Et("}else{"),Vr(),Et("}"))}Br.forEach(function(Mt){var Xt=Mt.name,pt=Vt.attributes[Xt],$t;if(pt){if(!Ir(pt))return;$t=pt.append(st,Et)}else{if(!Ir(rm))return;var zr=st.scopeAttrib(Xt);he.optional(function(){st.assert(Et,zr+".state","missing attribute "+Xt)}),$t={},Object.keys(new Tr).forEach(function($r){$t[$r]=Et.def(zr,".",$r)})}lr(st.link(Mt),sr(Mt.info.type),$t)})}function ss(st,Et,Vt,Br,Ir){for(var Jt=st.shared,sr=Jt.gl,lr,Mt=0;Mt1?Et(Ne(po,function(ic){return vn+"["+ic+"]"})):Et(vn);Et(");")}}function go(st,Et,Vt,Br){var Ir=st.shared,Jt=Ir.gl,sr=Ir.draw,lr=Br.draw;function Mt(){var la=lr.elements,Ns,Fl=Et;return la?((la.contextDep&&Br.contextDynamic||la.propDep)&&(Fl=Vt),Ns=la.append(st,Fl)):Ns=Fl.def(sr,".",os),Ns&&Fl("if("+Ns+")"+Jt+".bindBuffer("+_d+","+Ns+".buffer.buffer);"),Ns}function Xt(){var la=lr.count,Ns,Fl=Et;return la?((la.contextDep&&Br.contextDynamic||la.propDep)&&(Fl=Vt),Ns=la.append(st,Fl),he.optional(function(){la.MISSING&&st.assert(Et,"false","missing vertex count"),la.DYNAMIC&&st.assert(Fl,Ns+">=0","missing vertex count")})):(Ns=Fl.def(sr,".",Ol),he.optional(function(){st.assert(Fl,Ns+">=0","missing vertex count")})),Ns}var pt=Mt();function $t(la){var Ns=lr[la];return Ns?Ns.contextDep&&Br.contextDynamic||Ns.propDep?Ns.append(st,Vt):Ns.append(st,Et):Et.def(sr,".",la)}var zr=$t(yl),$r=$t(ph),Tn=Xt();if(typeof Tn=="number"){if(Tn===0)return}else Vt("if(",Tn,"){"),Vt.exit("}");var vn,_n;Xn&&(vn=$t(_f),_n=st.instancing);var Qn=pt+".type",Fi=lr.elements&&Wu(lr.elements);function Vr(){function la(){Vt(_n,".drawElementsInstancedANGLE(",[zr,Tn,Qn,$r+"<<(("+Qn+"-"+sn+")>>1)",vn],");")}function Ns(){Vt(_n,".drawArraysInstancedANGLE(",[zr,$r,Tn,vn],");")}pt?Fi?la():(Vt("if(",pt,"){"),la(),Vt("}else{"),Ns(),Vt("}")):Ns()}function po(){function la(){Vt(Jt+".drawElements("+[zr,Tn,Qn,$r+"<<(("+Qn+"-"+sn+")>>1)"]+");")}function Ns(){Vt(Jt+".drawArrays("+[zr,$r,Tn]+");")}pt?Fi?la():(Vt("if(",pt,"){"),la(),Vt("}else{"),Ns(),Vt("}")):Ns()}Xn&&(typeof vn!="number"||vn>=0)?typeof vn=="string"?(Vt("if(",vn,">0){"),Vr(),Vt("}else if(",vn,"<0){"),po(),Vt("}")):Vr():po()}function ya(st,Et,Vt,Br,Ir){var Jt=Wt(),sr=Jt.proc("body",Ir);return he.optional(function(){Jt.commandStr=Et.commandStr,Jt.command=Jt.link(Et.commandStr)}),Xn&&(Jt.instancing=sr.def(Jt.shared.extensions,".angle_instanced_arrays")),st(Jt,sr,Vt,Br),Jt.compile().body}function Qo(st,Et,Vt,Br){Mu(st,Et),Vt.useVAO?Vt.drawVAO?Et(st.shared.vao,".setVAO(",Vt.drawVAO.append(st,Et),");"):Et(st.shared.vao,".setVAO(",st.shared.vao,".targetVAO);"):(Et(st.shared.vao,".setVAO(null);"),mu(st,Et,Vt,Br.attributes,function(){return!0})),ss(st,Et,Vt,Br.uniforms,function(){return!0}),go(st,Et,Et,Vt)}function Qs(st,Et){var Vt=st.proc("draw",1);Mu(st,Vt),du(st,Vt,Et.context),ru(st,Vt,Et.framebuffer),uu(st,Vt,Et),za(st,Vt,Et.state),Ca(st,Vt,Et,!1,!0);var Br=Et.shader.progVar.append(st,Vt);if(Vt(st.shared.gl,".useProgram(",Br,".program);"),Et.shader.program)Qo(st,Vt,Et,Et.shader.program);else{Vt(st.shared.vao,".setVAO(null);");var Ir=st.global.def("{}"),Jt=Vt.def(Br,".id"),sr=Vt.def(Ir,"[",Jt,"]");Vt(st.cond(sr).then(sr,".call(this,a0);").else(sr,"=",Ir,"[",Jt,"]=",st.link(function(lr){return ya(Qo,st,Et,lr,1)}),"(",Br,");",sr,".call(this,a0);"))}Object.keys(Et.state).length>0&&Vt(st.shared.current,".dirty=true;")}function Cp(st,Et,Vt,Br){st.batchId="a1",Mu(st,Et);function Ir(){return!0}mu(st,Et,Vt,Br.attributes,Ir),ss(st,Et,Vt,Br.uniforms,Ir),go(st,Et,Et,Vt)}function Ft(st,Et,Vt,Br){Mu(st,Et);var Ir=Vt.contextDep,Jt=Et.def(),sr="a0",lr="a1",Mt=Et.def();st.shared.props=Mt,st.batchId=Jt;var Xt=st.scope(),pt=st.scope();Et(Xt.entry,"for(",Jt,"=0;",Jt,"<",lr,";++",Jt,"){",Mt,"=",sr,"[",Jt,"];",pt,"}",Xt.exit);function $t(Qn){return Qn.contextDep&&Ir||Qn.propDep}function zr(Qn){return!$t(Qn)}if(Vt.needsContext&&du(st,pt,Vt.context),Vt.needsFramebuffer&&ru(st,pt,Vt.framebuffer),za(st,pt,Vt.state,$t),Vt.profile&&$t(Vt.profile)&&Ca(st,pt,Vt,!1,!0),Br)Vt.useVAO?Vt.drawVAO?$t(Vt.drawVAO)?pt(st.shared.vao,".setVAO(",Vt.drawVAO.append(st,pt),");"):Xt(st.shared.vao,".setVAO(",Vt.drawVAO.append(st,Xt),");"):Xt(st.shared.vao,".setVAO(",st.shared.vao,".targetVAO);"):(Xt(st.shared.vao,".setVAO(null);"),mu(st,Xt,Vt,Br.attributes,zr),mu(st,pt,Vt,Br.attributes,$t)),ss(st,Xt,Vt,Br.uniforms,zr),ss(st,pt,Vt,Br.uniforms,$t),go(st,Xt,pt,Vt);else{var $r=st.global.def("{}"),Tn=Vt.shader.progVar.append(st,pt),vn=pt.def(Tn,".id"),_n=pt.def($r,"[",vn,"]");pt(st.shared.gl,".useProgram(",Tn,".program);","if(!",_n,"){",_n,"=",$r,"[",vn,"]=",st.link(function(Qn){return ya(Cp,st,Vt,Qn,2)}),"(",Tn,");}",_n,".call(this,a0[",Jt,"],",Jt,");")}}function Xr(st,Et){var Vt=st.proc("batch",2);st.batchId="0",Mu(st,Vt);var Br=!1,Ir=!0;Object.keys(Et.context).forEach(function($r){Br=Br||Et.context[$r].propDep}),Br||(du(st,Vt,Et.context),Ir=!1);var Jt=Et.framebuffer,sr=!1;Jt?(Jt.propDep?Br=sr=!0:Jt.contextDep&&Br&&(sr=!0),sr||ru(st,Vt,Jt)):ru(st,Vt,null),Et.state.viewport&&Et.state.viewport.propDep&&(Br=!0);function lr($r){return $r.contextDep&&Br||$r.propDep}uu(st,Vt,Et),za(st,Vt,Et.state,function($r){return!lr($r)}),(!Et.profile||!lr(Et.profile))&&Ca(st,Vt,Et,!1,"a1"),Et.contextDep=Br,Et.needsContext=Ir,Et.needsFramebuffer=sr;var Mt=Et.shader.progVar;if(Mt.contextDep&&Br||Mt.propDep)Ft(st,Vt,Et,null);else{var Xt=Mt.append(st,Vt);if(Vt(st.shared.gl,".useProgram(",Xt,".program);"),Et.shader.program)Ft(st,Vt,Et,Et.shader.program);else{Vt(st.shared.vao,".setVAO(null);");var pt=st.global.def("{}"),$t=Vt.def(Xt,".id"),zr=Vt.def(pt,"[",$t,"]");Vt(st.cond(zr).then(zr,".call(this,a0,a1);").else(zr,"=",pt,"[",$t,"]=",st.link(function($r){return ya(Ft,st,Et,$r,2)}),"(",Xt,");",zr,".call(this,a0,a1);"))}}Object.keys(Et.state).length>0&&Vt(st.shared.current,".dirty=true;")}function Mr(st,Et){var Vt=st.proc("scope",3);st.batchId="a2";var Br=st.shared,Ir=Br.current;du(st,Vt,Et.context),Et.framebuffer&&Et.framebuffer.append(st,Vt),zp(Object.keys(Et.state)).forEach(function(sr){var lr=Et.state[sr],Mt=lr.append(st,Vt);zl(Mt)?Mt.forEach(function(Xt,pt){Vt.set(st.next[sr],"["+pt+"]",Xt)}):Vt.set(Br.next,"."+sr,Mt)}),Ca(st,Vt,Et,!0,!0),[os,ph,Ol,_f,yl].forEach(function(sr){var lr=Et.draw[sr];lr&&Vt.set(Br.draw,"."+sr,""+lr.append(st,Vt))}),Object.keys(Et.uniforms).forEach(function(sr){Vt.set(Br.uniforms,"["+_t.id(sr)+"]",Et.uniforms[sr].append(st,Vt))}),Object.keys(Et.attributes).forEach(function(sr){var lr=Et.attributes[sr].append(st,Vt),Mt=st.scopeAttrib(sr);Object.keys(new Tr).forEach(function(Xt){Vt.set(Mt,"."+Xt,lr[Xt])})}),Et.scopeVAO&&Vt.set(Br.vao,".targetVAO",Et.scopeVAO.append(st,Vt));function Jt(sr){var lr=Et.shader[sr];lr&&Vt.set(Br.shader,"."+sr,lr.append(st,Vt))}Jt(Ws),Jt(ju),Object.keys(Et.state).length>0&&(Vt(Ir,".dirty=true;"),Vt.exit(Ir,".dirty=true;")),Vt("a1(",st.shared.context,",a0,",st.batchId,");")}function Bi(st){if(!(typeof st!="object"||zl(st))){for(var Et=Object.keys(st),Vt=0;Vt=0;--go){var ya=Sn[go];ya&&ya(Vn,null,0)}Zt.flush(),si&&si.update()}function Jo(){!Ee&&Sn.length>0&&(Ee=Ti.next(sa))}function Es(){Ee&&(Ti.cancel(sa),Ee=null)}function Cu(go){go.preventDefault(),wn=!0,Es(),Wt.forEach(function(ya){ya()})}function Bl(go){Zt.getError(),wn=!1,Yr.restore(),Un.restore(),Xn.restore(),Oi.restore(),Ln.restore(),wi.restore(),_i.restore(),si&&si.restore(),Po.procs.refresh(),Jo(),K.forEach(function(ya){ya()})}Zn&&(Zn.addEventListener(Nd,Cu,!1),Zn.addEventListener(am,Bl,!1));function as(){Sn.length=0,Es(),Zn&&(Zn.removeEventListener(Nd,Cu),Zn.removeEventListener(am,Bl)),Un.clear(),wi.clear(),Ln.clear(),Oi.clear(),xi.clear(),Xn.clear(),_i.clear(),si&&si.clear(),Ei.forEach(function(go){go()})}function fu(go){he(!!go,"invalid args to regl({...})"),he.type(go,"object","invalid args to regl({...})");function ya(Ir){var Jt=Se({},Ir);delete Jt.uniforms,delete Jt.attributes,delete Jt.context,delete Jt.vao,"stencil"in Jt&&Jt.stencil.op&&(Jt.stencil.opBack=Jt.stencil.opFront=Jt.stencil.op,delete Jt.stencil.op);function sr(lr){if(lr in Jt){var Mt=Jt[lr];delete Jt[lr],Object.keys(Mt).forEach(function(Xt){Jt[lr+"."+Xt]=Mt[Xt]})}}return sr("blend"),sr("depth"),sr("cull"),sr("stencil"),sr("polygonOffset"),sr("scissor"),sr("sample"),"vao"in Ir&&(Jt.vao=Ir.vao),Jt}function Qo(Ir){var Jt={},sr={};return Object.keys(Ir).forEach(function(lr){var Mt=Ir[lr];To.isDynamic(Mt)?sr[lr]=To.unbox(Mt,lr):Jt[lr]=Mt}),{dynamic:sr,static:Jt}}var Qs=Qo(go.context||{}),Cp=Qo(go.uniforms||{}),Ft=Qo(go.attributes||{}),Xr=Qo(ya(go)),Mr={gpuTime:0,cpuTime:0,count:0},Bi=Po.compile(Xr,Ft,Cp,Qs,Mr),Ma=Bi.draw,el=Bi.batch,st=Bi.scope,Et=[];function Vt(Ir){for(;Et.length0)return el.call(this,Vt(Ir|0),Ir|0)}else if(Array.isArray(Ir)){if(Ir.length)return el.call(this,Ir,Ir.length)}else return Ma.call(this,Ir)}return Se(Br,{stats:Mr})}var Js=wi.setFBO=fu({framebuffer:To.define.call(null,uf,"framebuffer")});function ps(go,ya){var Qo=0;Po.procs.poll();var Qs=ya.color;Qs&&(Zt.clearColor(+Qs[0]||0,+Qs[1]||0,+Qs[2]||0,+Qs[3]||0),Qo|=fd),"depth"in ya&&(Zt.clearDepth(+ya.depth),Qo|=Bc),"stencil"in ya&&(Zt.clearStencil(ya.stencil|0),Qo|=im),he(!!Qo,"called regl.clear with no buffer specified"),Zt.clear(Qo)}function du(go){if(he(typeof go=="object"&&go,"regl.clear() takes an object as input"),"framebuffer"in go)if(go.framebuffer&&go.framebuffer_reglType==="framebufferCube")for(var ya=0;ya<6;++ya)Js(Se({framebuffer:go.framebuffer.faces[ya]},go),ps);else Js(go,ps);else ps(null,go)}function ru(go){he.type(go,"function","regl.frame() callback must be a function"),Sn.push(go);function ya(){var Qo=zd(Sn,go);he(Qo>=0,"cannot cancel a frame twice");function Qs(){var Cp=zd(Sn,Qs);Sn[Cp]=Sn[Sn.length-1],Sn.length-=1,Sn.length<=0&&Es()}Sn[Qo]=Qs}return Jo(),{cancel:ya}}function uu(){var go=bi.viewport,ya=bi.scissor_box;go[0]=go[1]=ya[0]=ya[1]=0,Vn.viewportWidth=Vn.framebufferWidth=Vn.drawingBufferWidth=go[2]=ya[2]=Zt.drawingBufferWidth,Vn.viewportHeight=Vn.framebufferHeight=Vn.drawingBufferHeight=go[3]=ya[3]=Zt.drawingBufferHeight}function za(){Vn.tick+=1,Vn.time=Ca(),uu(),Po.procs.poll()}function Mu(){uu(),Po.procs.refresh(),si&&si.update()}function Ca(){return(Lo()-Hn)/1e3}Mu();function mu(go,ya){he.type(ya,"function","listener callback must be a function");var Qo;switch(go){case"frame":return ru(ya);case"lost":Qo=Wt;break;case"restore":Qo=K;break;case"destroy":Qo=Ei;break;default:he.raise("invalid event, must be one of frame,lost,restore,destroy")}return Qo.push(ya),{cancel:function(){for(var Qs=0;Qs=0},read:da,destroy:as,_gl:Zt,_refresh:Mu,poll:function(){za(),si&&si.update()},now:Ca,stats:Wn});return _t.onDone(null,ss),ss}return Fc})},48096:function(Zr){(function(_r,Se){Zr.exports=Se()})(this,function(){"use strict";function _r(xr,jt,Jr,gr,rn,jn){if(!(rn-gr<=Jr)){var qe=gr+rn>>1;Se(xr,jt,qe,gr,rn,jn%2),_r(xr,jt,Jr,gr,qe-1,jn+1),_r(xr,jt,Jr,qe+1,rn,jn+1)}}function Se(xr,jt,Jr,gr,rn,jn){for(;rn>gr;){if(rn-gr>600){var qe=rn-gr+1,Dt=Jr-gr+1,$e=Math.log(qe),Pt=.5*Math.exp(2*$e/3),vt=.5*Math.sqrt($e*Pt*(qe-Pt)/qe)*(Dt-qe/2<0?-1:1),rr=Math.max(gr,Math.floor(Jr-Dt*Pt/qe+vt)),ar=Math.min(rn,Math.floor(Jr+(qe-Dt)*Pt/qe+vt));Se(xr,jt,Jr,rr,ar,jn)}var wr=jt[2*Jr+jn],Cr=gr,an=rn;for(ve(xr,jt,gr,Jr),jt[2*rn+jn]>wr&&ve(xr,jt,gr,rn);Crwr;)an--}jt[2*gr+jn]===wr?ve(xr,jt,gr,an):(an++,ve(xr,jt,an,rn)),an<=Jr&&(gr=an+1),Jr<=an&&(rn=an-1)}}function ve(xr,jt,Jr,gr){Ze(xr,Jr,gr),Ze(jt,2*Jr,2*gr),Ze(jt,2*Jr+1,2*gr+1)}function Ze(xr,jt,Jr){var gr=xr[jt];xr[jt]=xr[Jr],xr[Jr]=gr}function M(xr,jt,Jr,gr,rn,jn,qe){for(var Dt=[0,xr.length-1,0],$e=[],Pt,vt;Dt.length;){var rr=Dt.pop(),ar=Dt.pop(),wr=Dt.pop();if(ar-wr<=qe){for(var Cr=wr;Cr<=ar;Cr++)Pt=jt[2*Cr],vt=jt[2*Cr+1],Pt>=Jr&&Pt<=rn&&vt>=gr&&vt<=jn&&$e.push(xr[Cr]);continue}var an=Math.floor((wr+ar)/2);Pt=jt[2*an],vt=jt[2*an+1],Pt>=Jr&&Pt<=rn&&vt>=gr&&vt<=jn&&$e.push(xr[an]);var yi=(rr+1)%2;(rr===0?Jr<=Pt:gr<=vt)&&(Dt.push(wr),Dt.push(an-1),Dt.push(yi)),(rr===0?rn>=Pt:jn>=vt)&&(Dt.push(an+1),Dt.push(ar),Dt.push(yi))}return $e}function R(xr,jt,Jr,gr,rn,jn){for(var qe=[0,xr.length-1,0],Dt=[],$e=rn*rn;qe.length;){var Pt=qe.pop(),vt=qe.pop(),rr=qe.pop();if(vt-rr<=jn){for(var ar=rr;ar<=vt;ar++)de(jt[2*ar],jt[2*ar+1],Jr,gr)<=$e&&Dt.push(xr[ar]);continue}var wr=Math.floor((rr+vt)/2),Cr=jt[2*wr],an=jt[2*wr+1];de(Cr,an,Jr,gr)<=$e&&Dt.push(xr[wr]);var yi=(Pt+1)%2;(Pt===0?Jr-rn<=Cr:gr-rn<=an)&&(qe.push(rr),qe.push(wr-1),qe.push(yi)),(Pt===0?Jr+rn>=Cr:gr+rn>=an)&&(qe.push(wr+1),qe.push(vt),qe.push(yi))}return Dt}function de(xr,jt,Jr,gr){var rn=xr-Jr,jn=jt-gr;return rn*rn+jn*jn}var be=function(xr){return xr[0]},Le=function(xr){return xr[1]},Re=function(jt,Jr,gr,rn,jn){Jr===void 0&&(Jr=be),gr===void 0&&(gr=Le),rn===void 0&&(rn=64),jn===void 0&&(jn=Float64Array),this.nodeSize=rn,this.points=jt;for(var qe=jt.length<65536?Uint16Array:Uint32Array,Dt=this.ids=new qe(jt.length),$e=this.coords=new jn(jt.length*2),Pt=0;Pt=rn;vt--){var rr=+Date.now();$e=this._cluster($e,vt),this.trees[vt]=new Re($e,ki,pa,qe,Float32Array),gr&&console.log("z%d: %d clusters in %dms",vt,$e.length,+Date.now()-rr)}return gr&&console.timeEnd("total time"),this},Xe.prototype.getClusters=function(jt,Jr){var gr=((jt[0]+180)%360+360)%360-180,rn=Math.max(-90,Math.min(90,jt[1])),jn=jt[2]===180?180:((jt[2]+180)%360+360)%360-180,qe=Math.max(-90,Math.min(90,jt[3]));if(jt[2]-jt[0]>=360)gr=-180,jn=180;else if(gr>jn){var Dt=this.getClusters([gr,rn,180,qe],Jr),$e=this.getClusters([-180,rn,jn,qe],Jr);return Dt.concat($e)}for(var Pt=this.trees[this._limitZoom(Jr)],vt=Pt.range(fr(gr),Ar(qe),fr(jn),Ar(rn)),rr=[],ar=0,wr=vt;arJr&&(an+=vi.numPoints||1)}if(an>Cr&&an>=$e){for(var bo=rr.x*Cr,So=rr.y*Cr,Xi=Dt&&Cr>1?this._map(rr,!0):null,Mi=(vt<<5)+(Jr+1)+this.points.length,qo=0,ui=wr;qo1)for(var ds=0,Ur=wr;ds>5},Xe.prototype._getOriginZoom=function(jt){return(jt-this.points.length)%32},Xe.prototype._map=function(jt,Jr){if(jt.numPoints)return Jr?Jn({},jt.properties):jt.properties;var gr=this.points[jt.index].properties,rn=this.options.map(gr);return Jr&&rn===gr?Jn({},rn):rn};function Ke(xr,jt,Jr,gr,rn){return{x:He(xr),y:He(jt),zoom:1/0,id:Jr,parentId:-1,numPoints:gr,properties:rn}}function Ve(xr,jt){var Jr=xr.geometry.coordinates,gr=Jr[0],rn=Jr[1];return{x:He(fr(gr)),y:He(Ar(rn)),zoom:1/0,index:jt,parentId:-1}}function et(xr){return{type:"Feature",id:xr.id,properties:er(xr),geometry:{type:"Point",coordinates:[pn(xr.x),Kn(xr.y)]}}}function er(xr){var jt=xr.numPoints,Jr=jt>=1e4?Math.round(jt/1e3)+"k":jt>=1e3?Math.round(jt/100)/10+"k":jt;return Jn(Jn({},xr.properties),{cluster:!0,cluster_id:xr.id,point_count:jt,point_count_abbreviated:Jr})}function fr(xr){return xr/360+.5}function Ar(xr){var jt=Math.sin(xr*Math.PI/180),Jr=.5-.25*Math.log((1+jt)/(1-jt))/Math.PI;return Jr<0?0:Jr>1?1:Jr}function pn(xr){return(xr-.5)*360}function Kn(xr){var jt=(180-xr*360)*Math.PI/180;return 360*Math.atan(Math.exp(jt))/Math.PI-90}function Jn(xr,jt){for(var Jr in jt)xr[Jr]=jt[Jr];return xr}function ki(xr){return xr.x}function pa(xr){return xr.y}return Xe})},68974:function(Zr){(function(_r,Se){Zr.exports=Se()})(this,function(){"use strict";var _r,Se,ve;function Ze(R,de){if(!_r)_r=de;else if(!Se)Se=de;else{var be="var sharedChunk = {}; ("+_r+")(sharedChunk); ("+Se+")(sharedChunk);",Le={};_r(Le),ve=de(Le),typeof window!="undefined"&&(ve.workerUrl=window.URL.createObjectURL(new Blob([be],{type:"text/javascript"})))}}Ze(["exports"],function(R){"use strict";function de(c,o,f,E){return new(f||(f=Promise))(function(L,V){function X(me){try{oe(E.next(me))}catch(Me){V(Me)}}function J(me){try{oe(E.throw(me))}catch(Me){V(Me)}}function oe(me){var Me;me.done?L(me.value):(Me=me.value,Me instanceof f?Me:new f(function(De){De(Me)})).then(X,J)}oe((E=E.apply(c,o||[])).next())})}function be(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}typeof SuppressedError=="function"&&SuppressedError;var Le=Re;function Re(c,o){this.x=c,this.y=o}Re.prototype={clone:function(){return new Re(this.x,this.y)},add:function(c){return this.clone()._add(c)},sub:function(c){return this.clone()._sub(c)},multByPoint:function(c){return this.clone()._multByPoint(c)},divByPoint:function(c){return this.clone()._divByPoint(c)},mult:function(c){return this.clone()._mult(c)},div:function(c){return this.clone()._div(c)},rotate:function(c){return this.clone()._rotate(c)},rotateAround:function(c,o){return this.clone()._rotateAround(c,o)},matMult:function(c){return this.clone()._matMult(c)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(c){return this.x===c.x&&this.y===c.y},dist:function(c){return Math.sqrt(this.distSqr(c))},distSqr:function(c){var o=c.x-this.x,f=c.y-this.y;return o*o+f*f},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(c){return Math.atan2(this.y-c.y,this.x-c.x)},angleWith:function(c){return this.angleWithSep(c.x,c.y)},angleWithSep:function(c,o){return Math.atan2(this.x*o-this.y*c,this.x*c+this.y*o)},_matMult:function(c){var o=c[2]*this.x+c[3]*this.y;return this.x=c[0]*this.x+c[1]*this.y,this.y=o,this},_add:function(c){return this.x+=c.x,this.y+=c.y,this},_sub:function(c){return this.x-=c.x,this.y-=c.y,this},_mult:function(c){return this.x*=c,this.y*=c,this},_div:function(c){return this.x/=c,this.y/=c,this},_multByPoint:function(c){return this.x*=c.x,this.y*=c.y,this},_divByPoint:function(c){return this.x/=c.x,this.y/=c.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var c=this.y;return this.y=this.x,this.x=-c,this},_rotate:function(c){var o=Math.cos(c),f=Math.sin(c),E=f*this.x+o*this.y;return this.x=o*this.x-f*this.y,this.y=E,this},_rotateAround:function(c,o){var f=Math.cos(c),E=Math.sin(c),L=o.y+E*(this.x-o.x)+f*(this.y-o.y);return this.x=o.x+f*(this.x-o.x)-E*(this.y-o.y),this.y=L,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Re.convert=function(c){return c instanceof Re?c:Array.isArray(c)?new Re(c[0],c[1]):c};var Ce=be(Le),He=Xe;function Xe(c,o,f,E){this.cx=3*c,this.bx=3*(f-c)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*o,this.by=3*(E-o)-this.cy,this.ay=1-this.cy-this.by,this.p1x=c,this.p1y=o,this.p2x=f,this.p2y=E}Xe.prototype={sampleCurveX:function(c){return((this.ax*c+this.bx)*c+this.cx)*c},sampleCurveY:function(c){return((this.ay*c+this.by)*c+this.cy)*c},sampleCurveDerivativeX:function(c){return(3*this.ax*c+2*this.bx)*c+this.cx},solveCurveX:function(c,o){if(o===void 0&&(o=1e-6),c<0)return 0;if(c>1)return 1;for(var f=c,E=0;E<8;E++){var L=this.sampleCurveX(f)-c;if(Math.abs(L)L?X=f:J=f,f=.5*(J-X)+X;return f},solve:function(c,o){return this.sampleCurveY(this.solveCurveX(c,o))}};var Ke=be(He);let Ve,et;function er(){return Ve==null&&(Ve=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Ve}function fr(){if(et==null&&(et=!1,er())){const o=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(o){for(let E=0;E<5*5;E++){const L=4*E;o.fillStyle=`rgb(${L},${L+1},${L+2})`,o.fillRect(E%5,Math.floor(E/5),1,1)}const f=o.getImageData(0,0,5,5).data;for(let E=0;E<5*5*4;E++)if(E%4!=3&&f[E]!==E){et=!0;break}}}return et||!1}function Ar(c,o,f,E){const L=new Ke(c,o,f,E);return function(V){return L.solve(V)}}const pn=Ar(.25,.1,.25,1);function Kn(c,o,f){return Math.min(f,Math.max(o,c))}function Jn(c,o,f){const E=f-o,L=((c-o)%E+E)%E+o;return L===o?f:L}function ki(c,...o){for(const f of o)for(const E in f)c[E]=f[E];return c}let pa=1;function xr(c,o,f){const E={};for(const L in c)E[L]=o.call(f||this,c[L],L,c);return E}function jt(c,o,f){const E={};for(const L in c)o.call(f||this,c[L],L,c)&&(E[L]=c[L]);return E}function Jr(c){return Array.isArray(c)?c.map(Jr):typeof c=="object"&&c?xr(c,Jr):c}const gr={};function rn(c){gr[c]||(typeof console!="undefined"&&console.warn(c),gr[c]=!0)}function jn(c,o,f){return(f.y-c.y)*(o.x-c.x)>(o.y-c.y)*(f.x-c.x)}function qe(c){let o=0;for(let f,E,L=0,V=c.length,X=V-1;LcancelAnimationFrame(o)}},getImageData(c,o=0){return this.getImageCanvasContext(c).getImageData(-o,-o,c.width+2*o,c.height+2*o)},getImageCanvasContext(c){const o=window.document.createElement("canvas"),f=o.getContext("2d",{willReadFrequently:!0});if(!f)throw new Error("failed to create canvas 2d context");return o.width=c.width,o.height=c.height,f.drawImage(c,0,0,c.width,c.height),f},resolveURL:c=>(Cr||(Cr=document.createElement("a")),Cr.href=c,Cr.href),hardwareConcurrency:typeof navigator!="undefined"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(an==null&&(an=matchMedia("(prefers-reduced-motion: reduce)")),an.matches)}},li={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class Uo extends Error{constructor(o,f,E,L){super(`AJAXError: ${f} (${o}): ${E}`),this.status=o,this.statusText=f,this.url=E,this.body=L}}const vi=Dt()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,bo=c=>li.REGISTERED_PROTOCOLS[c.substring(0,c.indexOf("://"))];function So(c,o){const f=new AbortController,E=new Request(c.url,{method:c.method||"GET",body:c.body,credentials:c.credentials,headers:c.headers,cache:c.cache,referrer:vi(),signal:f.signal});let L=!1,V=!1;return c.type==="json"&&E.headers.set("Accept","application/json"),V||fetch(E).then(X=>X.ok?(J=>{(c.type==="arrayBuffer"||c.type==="image"?J.arrayBuffer():c.type==="json"?J.json():J.text()).then(oe=>{V||(L=!0,o(null,oe,J.headers.get("Cache-Control"),J.headers.get("Expires")))}).catch(oe=>{V||o(new Error(oe.message))})})(X):X.blob().then(J=>o(new Uo(X.status,X.statusText,c.url,J)))).catch(X=>{X.code!==20&&o(new Error(X.message))}),{cancel:()=>{V=!0,L||f.abort()}}}const Xi=function(c,o){if(/:\/\//.test(c.url)&&!/^https?:|^file:/.test(c.url)){if(Dt()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",c,o);if(!Dt())return(bo(c.url)||So)(c,o)}if(!(/^file:/.test(f=c.url)||/^file:/.test(vi())&&!/^\w+:/.test(f))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return So(c,o);if(Dt()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",c,o,void 0,!0)}var f;return function(E,L){const V=new XMLHttpRequest;V.open(E.method||"GET",E.url,!0),E.type!=="arrayBuffer"&&E.type!=="image"||(V.responseType="arraybuffer");for(const X in E.headers)V.setRequestHeader(X,E.headers[X]);return E.type==="json"&&(V.responseType="text",V.setRequestHeader("Accept","application/json")),V.withCredentials=E.credentials==="include",V.onerror=()=>{L(new Error(V.statusText))},V.onload=()=>{if((V.status>=200&&V.status<300||V.status===0)&&V.response!==null){let X=V.response;if(E.type==="json")try{X=JSON.parse(V.response)}catch(J){return L(J)}L(null,X,V.getResponseHeader("Cache-Control"),V.getResponseHeader("Expires"))}else{const X=new Blob([V.response],{type:V.getResponseHeader("Content-Type")});L(new Uo(V.status,V.statusText,E.url,X))}},V.send(E.body),{cancel:()=>V.abort()}}(c,o)},Mi=function(c,o){return Xi(ki(c,{type:"arrayBuffer"}),o)};function qo(c){if(!c||c.indexOf("://")<=0||c.indexOf("data:image/")===0||c.indexOf("blob:")===0)return!0;const o=new URL(c),f=window.location;return o.protocol===f.protocol&&o.host===f.host}function ui(c,o,f){f[c]&&f[c].indexOf(o)!==-1||(f[c]=f[c]||[],f[c].push(o))}function Qi(c,o,f){if(f&&f[c]){const E=f[c].indexOf(o);E!==-1&&f[c].splice(E,1)}}class Vi{constructor(o,f={}){ki(this,f),this.type=o}}class Pi extends Vi{constructor(o,f={}){super("error",ki({error:o},f))}}class ds{on(o,f){return this._listeners=this._listeners||{},ui(o,f,this._listeners),this}off(o,f){return Qi(o,f,this._listeners),Qi(o,f,this._oneTimeListeners),this}once(o,f){return f?(this._oneTimeListeners=this._oneTimeListeners||{},ui(o,f,this._oneTimeListeners),this):new Promise(E=>this.once(o,E))}fire(o,f){typeof o=="string"&&(o=new Vi(o,f||{}));const E=o.type;if(this.listens(E)){o.target=this;const L=this._listeners&&this._listeners[E]?this._listeners[E].slice():[];for(const J of L)J.call(this,o);const V=this._oneTimeListeners&&this._oneTimeListeners[E]?this._oneTimeListeners[E].slice():[];for(const J of V)Qi(E,J,this._oneTimeListeners),J.call(this,o);const X=this._eventedParent;X&&(ki(o,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),X.fire(o))}else o instanceof Pi&&console.error(o.error);return this}listens(o){return this._listeners&&this._listeners[o]&&this._listeners[o].length>0||this._oneTimeListeners&&this._oneTimeListeners[o]&&this._oneTimeListeners[o].length>0||this._eventedParent&&this._eventedParent.listens(o)}setEventedParent(o,f){return this._eventedParent=o,this._eventedParentData=f,this}}var Ur={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const ls=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function dr(c,o){const f={};for(const E in c)E!=="ref"&&(f[E]=c[E]);return ls.forEach(E=>{E in o&&(f[E]=o[E])}),f}function he(c,o){if(Array.isArray(c)){if(!Array.isArray(o)||c.length!==o.length)return!1;for(let f=0;f`:c.itemType.kind==="value"?"array":`array<${o}>`}return c.kind}const ze=[wa,dn,co,no,Za,Lt,ms,ge(Ji),Ne,re,le];function je(c,o){if(o.kind==="error")return null;if(c.kind==="array"){if(o.kind==="array"&&(o.N===0&&o.itemType.kind==="value"||!je(c.itemType,o.itemType))&&(typeof c.N!="number"||c.N===o.N))return null}else{if(c.kind===o.kind)return null;if(c.kind==="value"){for(const f of ze)if(!je(f,o))return null}}return`Expected ${ye(c)} but found ${ye(o)} instead.`}function Ue(c,o){return o.some(f=>f.kind===c.kind)}function Ae(c,o){return o.some(f=>f==="null"?c===null:f==="array"?Array.isArray(c):f==="object"?c&&!Array.isArray(c)&&typeof c=="object":f===typeof c)}function Je(c,o){return c.kind==="array"&&o.kind==="array"?c.itemType.kind===o.itemType.kind&&typeof c.N=="number":c.kind===o.kind}const wt=.96422,Ht=.82521,Fr=4/29,mr=6/29,Sr=3*mr*mr,fn=mr*mr*mr,xn=Math.PI/180,Lr=180/Math.PI;function Nn(c){return(c%=360)<0&&(c+=360),c}function bn([c,o,f,E]){let L,V;const X=io((.2225045*(c=En(c))+.7168786*(o=En(o))+.0606169*(f=En(f)))/1);c===o&&o===f?L=V=X:(L=io((.4360747*c+.3850649*o+.1430804*f)/wt),V=io((.0139322*c+.0971045*o+.7141733*f)/Ht));const J=116*X-16;return[J<0?0:J,500*(L-X),200*(X-V),E]}function En(c){return c<=.04045?c/12.92:Math.pow((c+.055)/1.055,2.4)}function io(c){return c>fn?Math.pow(c,1/3):c/Sr+Fr}function On([c,o,f,E]){let L=(c+16)/116,V=isNaN(o)?L:L+o/500,X=isNaN(f)?L:L-f/200;return L=1*ia(L),V=wt*ia(V),X=Ht*ia(X),[Ao(3.1338561*V-1.6168667*L-.4906146*X),Ao(-.9787684*V+1.9161415*L+.033454*X),Ao(.0719453*V-.2289914*L+1.4052427*X),E]}function Ao(c){return(c=c<=.00304?12.92*c:1.055*Math.pow(c,1/2.4)-.055)<0?0:c>1?1:c}function ia(c){return c>mr?c*c*c:Sr*(c-Fr)}function Ho(c){return parseInt(c.padEnd(2,c),16)/255}function Ga(c,o){return Wo(o?c/100:c,0,1)}function Wo(c,o,f){return Math.min(Math.max(o,c),f)}function Hl(c){return!c.some(Number.isNaN)}const ns={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Yo{constructor(o,f,E,L=1,V=!0){this.r=o,this.g=f,this.b=E,this.a=L,V||(this.r*=L,this.g*=L,this.b*=L,L||this.overwriteGetter("rgb",[o,f,E,L]))}static parse(o){if(o instanceof Yo)return o;if(typeof o!="string")return;const f=function(E){if((E=E.toLowerCase().trim())==="transparent")return[0,0,0,0];const L=ns[E];if(L){const[X,J,oe]=L;return[X/255,J/255,oe/255,1]}if(E.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(E)){const X=E.length<6?1:2;let J=1;return[Ho(E.slice(J,J+=X)),Ho(E.slice(J,J+=X)),Ho(E.slice(J,J+=X)),Ho(E.slice(J,J+X)||"ff")]}if(E.startsWith("rgb")){const X=E.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(X){const[J,oe,me,Me,De,Ye,ot,lt,Ct,Gt,Kt,Er]=X,cr=[Me||" ",ot||" ",Gt].join("");if(cr===" "||cr===" /"||cr===",,"||cr===",,,"){const Rr=[me,Ye,Ct].join(""),Qr=Rr==="%%%"?100:Rr===""?255:0;if(Qr){const Fn=[Wo(+oe/Qr,0,1),Wo(+De/Qr,0,1),Wo(+lt/Qr,0,1),Kt?Ga(+Kt,Er):1];if(Hl(Fn))return Fn}}return}}const V=E.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(V){const[X,J,oe,me,Me,De,Ye,ot,lt]=V,Ct=[oe||" ",Me||" ",Ye].join("");if(Ct===" "||Ct===" /"||Ct===",,"||Ct===",,,"){const Gt=[+J,Wo(+me,0,100),Wo(+De,0,100),ot?Ga(+ot,lt):1];if(Hl(Gt))return function([Kt,Er,cr,Rr]){function Qr(Fn){const Ki=(Fn+Kt/30)%12,Co=Er*Math.min(cr,1-cr);return cr-Co*Math.max(-1,Math.min(Ki-3,9-Ki,1))}return Kt=Nn(Kt),Er/=100,cr/=100,[Qr(0),Qr(8),Qr(4),Rr]}(Gt)}}}(o);return f?new Yo(...f,!1):void 0}get rgb(){const{r:o,g:f,b:E,a:L}=this,V=L||1/0;return this.overwriteGetter("rgb",[o/V,f/V,E/V,L])}get hcl(){return this.overwriteGetter("hcl",function(o){const[f,E,L,V]=bn(o),X=Math.sqrt(E*E+L*L);return[Math.round(1e4*X)?Nn(Math.atan2(L,E)*Lr):NaN,X,f,V]}(this.rgb))}get lab(){return this.overwriteGetter("lab",bn(this.rgb))}overwriteGetter(o,f){return Object.defineProperty(this,o,{value:f}),f}toString(){const[o,f,E,L]=this.rgb;return`rgba(${[o,f,E].map(V=>Math.round(255*V)).join(",")},${L})`}}Yo.black=new Yo(0,0,0,1),Yo.white=new Yo(1,1,1,1),Yo.transparent=new Yo(0,0,0,0),Yo.red=new Yo(1,0,0,1);class _a{constructor(o,f,E){this.sensitivity=o?f?"variant":"case":f?"accent":"base",this.locale=E,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(o,f){return this.collator.compare(o,f)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class $o{constructor(o,f,E,L,V){this.text=o,this.image=f,this.scale=E,this.fontStack=L,this.textColor=V}}class Fo{constructor(o){this.sections=o}static fromString(o){return new Fo([new $o(o,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(o=>o.text.length!==0||o.image&&o.image.name.length!==0)}static factory(o){return o instanceof Fo?o:Fo.fromString(o)}toString(){return this.sections.length===0?"":this.sections.map(o=>o.text).join("")}}class us{constructor(o){this.values=o.slice()}static parse(o){if(o instanceof us)return o;if(typeof o=="number")return new us([o,o,o,o]);if(Array.isArray(o)&&!(o.length<1||o.length>4)){for(const f of o)if(typeof f!="number")return;switch(o.length){case 1:o=[o[0],o[0],o[0],o[0]];break;case 2:o=[o[0],o[1],o[0],o[1]];break;case 3:o=[o[0],o[1],o[2],o[1]]}return new us(o)}}toString(){return JSON.stringify(this.values)}}const xc=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Ba{constructor(o){this.values=o.slice()}static parse(o){if(o instanceof Ba)return o;if(Array.isArray(o)&&!(o.length<1)&&o.length%2==0){for(let f=0;f=0&&c<=255&&typeof o=="number"&&o>=0&&o<=255&&typeof f=="number"&&f>=0&&f<=255?E===void 0||typeof E=="number"&&E>=0&&E<=1?null:`Invalid rgba value [${[c,o,f,E].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof E=="number"?[c,o,f,E]:[c,o,f]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ql(c){if(c===null||typeof c=="string"||typeof c=="boolean"||typeof c=="number"||c instanceof Yo||c instanceof _a||c instanceof Fo||c instanceof us||c instanceof Ba||c instanceof Fa)return!0;if(Array.isArray(c)){for(const o of c)if(!Ql(o))return!1;return!0}if(typeof c=="object"){for(const o in c)if(!Ql(c[o]))return!1;return!0}return!1}function oa(c){if(c===null)return wa;if(typeof c=="string")return co;if(typeof c=="boolean")return no;if(typeof c=="number")return dn;if(c instanceof Yo)return Za;if(c instanceof _a)return Us;if(c instanceof Fo)return Lt;if(c instanceof us)return Ne;if(c instanceof Ba)return le;if(c instanceof Fa)return re;if(Array.isArray(c)){const o=c.length;let f;for(const E of c){const L=oa(E);if(f){if(f===L)continue;f=Ji;break}f=L}return ge(f||Ji,o)}return ms}function Zo(c){const o=typeof c;return c===null?"":o==="string"||o==="number"||o==="boolean"?String(c):c instanceof Yo||c instanceof Fo||c instanceof us||c instanceof Ba||c instanceof Fa?c.toString():JSON.stringify(c)}class il{constructor(o,f){this.type=o,this.value=f}static parse(o,f){if(o.length!==2)return f.error(`'literal' expression requires exactly one argument, but found ${o.length-1} instead.`);if(!Ql(o[1]))return f.error("invalid value");const E=o[1];let L=oa(E);const V=f.expectedType;return L.kind!=="array"||L.N!==0||!V||V.kind!=="array"||typeof V.N=="number"&&V.N!==0||(L=V),new il(L,E)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class va{constructor(o){this.name="ExpressionEvaluationError",this.message=o}toJSON(){return this.message}}const El={string:co,number:dn,boolean:no,object:ms};class Wa{constructor(o,f){this.type=o,this.args=f}static parse(o,f){if(o.length<2)return f.error("Expected at least one argument.");let E,L=1;const V=o[0];if(V==="array"){let J,oe;if(o.length>2){const me=o[1];if(typeof me!="string"||!(me in El)||me==="object")return f.error('The item type argument of "array" must be one of string, number, boolean',1);J=El[me],L++}else J=Ji;if(o.length>3){if(o[2]!==null&&(typeof o[2]!="number"||o[2]<0||o[2]!==Math.floor(o[2])))return f.error('The length argument to "array" must be a positive integer literal',2);oe=o[2],L++}E=ge(J,oe)}else{if(!El[V])throw new Error(`Types doesn't contain name = ${V}`);E=El[V]}const X=[];for(;Lo.outputDefined())}}const Ds={"to-boolean":no,"to-color":Za,"to-number":dn,"to-string":co};class Rl{constructor(o,f){this.type=o,this.args=f}static parse(o,f){if(o.length<2)return f.error("Expected at least one argument.");const E=o[0];if(!Ds[E])throw new Error(`Can't parse ${E} as it is not part of the known types`);if((E==="to-boolean"||E==="to-string")&&o.length!==2)return f.error("Expected one argument.");const L=Ds[E],V=[];for(let X=1;X4?`Invalid rbga value ${JSON.stringify(f)}: expected an array containing either three or four numeric values.`:sc(f[0],f[1],f[2],f[3]),!E))return new Yo(f[0]/255,f[1]/255,f[2]/255,f[3])}throw new va(E||`Could not parse color from value '${typeof f=="string"?f:JSON.stringify(f)}'`)}case"padding":{let f;for(const E of this.args){f=E.evaluate(o);const L=us.parse(f);if(L)return L}throw new va(`Could not parse padding from value '${typeof f=="string"?f:JSON.stringify(f)}'`)}case"variableAnchorOffsetCollection":{let f;for(const E of this.args){f=E.evaluate(o);const L=Ba.parse(f);if(L)return L}throw new va(`Could not parse variableAnchorOffsetCollection from value '${typeof f=="string"?f:JSON.stringify(f)}'`)}case"number":{let f=null;for(const E of this.args){if(f=E.evaluate(o),f===null)return 0;const L=Number(f);if(!isNaN(L))return L}throw new va(`Could not convert ${JSON.stringify(f)} to number.`)}case"formatted":return Fo.fromString(Zo(this.args[0].evaluate(o)));case"resolvedImage":return Fa.fromString(Zo(this.args[0].evaluate(o)));default:return Zo(this.args[0].evaluate(o))}}eachChild(o){this.args.forEach(o)}outputDefined(){return this.args.every(o=>o.outputDefined())}}const gu=["Unknown","Point","LineString","Polygon"];class gl{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?gu[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(o){let f=this._parseColorCache[o];return f||(f=this._parseColorCache[o]=Yo.parse(o)),f}}class wl{constructor(o,f,E=[],L,V=new Lo,X=[]){this.registry=o,this.path=E,this.key=E.map(J=>`[${J}]`).join(""),this.scope=V,this.errors=X,this.expectedType=L,this._isConstant=f}parse(o,f,E,L,V={}){return f?this.concat(f,E,L)._parse(o,V):this._parse(o,V)}_parse(o,f){function E(L,V,X){return X==="assert"?new Wa(V,[L]):X==="coerce"?new Rl(V,[L]):L}if(o!==null&&typeof o!="string"&&typeof o!="boolean"&&typeof o!="number"||(o=["literal",o]),Array.isArray(o)){if(o.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const L=o[0];if(typeof L!="string")return this.error(`Expression name must be a string, but found ${typeof L} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const V=this.registry[L];if(V){let X=V.parse(o,this);if(!X)return null;if(this.expectedType){const J=this.expectedType,oe=X.type;if(J.kind!=="string"&&J.kind!=="number"&&J.kind!=="boolean"&&J.kind!=="object"&&J.kind!=="array"||oe.kind!=="value")if(J.kind!=="color"&&J.kind!=="formatted"&&J.kind!=="resolvedImage"||oe.kind!=="value"&&oe.kind!=="string")if(J.kind!=="padding"||oe.kind!=="value"&&oe.kind!=="number"&&oe.kind!=="array")if(J.kind!=="variableAnchorOffsetCollection"||oe.kind!=="value"&&oe.kind!=="array"){if(this.checkSubtype(J,oe))return null}else X=E(X,J,f.typeAnnotation||"coerce");else X=E(X,J,f.typeAnnotation||"coerce");else X=E(X,J,f.typeAnnotation||"coerce");else X=E(X,J,f.typeAnnotation||"assert")}if(!(X instanceof il)&&X.type.kind!=="resolvedImage"&&this._isConstant(X)){const J=new gl;try{X=new il(X.type,X.evaluate(J))}catch(oe){return this.error(oe.message),null}}return X}return this.error(`Unknown expression "${L}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(o===void 0?"'undefined' value invalid. Use null instead.":typeof o=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof o} instead.`)}concat(o,f,E){const L=typeof o=="number"?this.path.concat(o):this.path,V=E?this.scope.concat(E):this.scope;return new wl(this.registry,this._isConstant,L,f||null,V,this.errors)}error(o,...f){const E=`${this.key}${f.map(L=>`[${L}]`).join("")}`;this.errors.push(new Ti(E,o))}checkSubtype(o,f){const E=je(o,f);return E&&this.error(E),E}}class ol{constructor(o,f,E){this.type=Us,this.locale=E,this.caseSensitive=o,this.diacriticSensitive=f}static parse(o,f){if(o.length!==2)return f.error("Expected one argument.");const E=o[1];if(typeof E!="object"||Array.isArray(E))return f.error("Collator options argument must be an object.");const L=f.parse(E["case-sensitive"]!==void 0&&E["case-sensitive"],1,no);if(!L)return null;const V=f.parse(E["diacritic-sensitive"]!==void 0&&E["diacritic-sensitive"],1,no);if(!V)return null;let X=null;return E.locale&&(X=f.parse(E.locale,1,co),!X)?null:new ol(L,V,X)}evaluate(o){return new _a(this.caseSensitive.evaluate(o),this.diacriticSensitive.evaluate(o),this.locale?this.locale.evaluate(o):null)}eachChild(o){o(this.caseSensitive),o(this.diacriticSensitive),this.locale&&o(this.locale)}outputDefined(){return!1}}const Qa=8192;function Gl(c,o){c[0]=Math.min(c[0],o[0]),c[1]=Math.min(c[1],o[1]),c[2]=Math.max(c[2],o[0]),c[3]=Math.max(c[3],o[1])}function Wl(c,o){return!(c[0]<=o[0]||c[2]>=o[2]||c[1]<=o[1]||c[3]>=o[3])}function ut(c,o){const f=(180+c[0])/360,E=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c[1]*Math.PI/360)))/360,L=Math.pow(2,o.z);return[Math.round(f*L*Qa),Math.round(E*L*Qa)]}function At(c,o,f){const E=c[0]-o[0],L=c[1]-o[1],V=c[0]-f[0],X=c[1]-f[1];return E*X-V*L==0&&E*V<=0&&L*X<=0}function ir(c,o){let f=!1;for(let X=0,J=o.length;X(E=c)[1]!=(V=oe[me+1])[1]>E[1]&&E[0]<(V[0]-L[0])*(E[1]-L[1])/(V[1]-L[1])+L[0]&&(f=!f)}}var E,L,V;return f}function jr(c,o){for(let f=0;f0&&J<0||X<0&&J>0}function oo(c,o,f){for(const me of f)for(let Me=0;Mef[2]){const L=.5*E;let V=c[0]-f[0]>L?-E:f[0]-c[0]>L?E:0;V===0&&(V=c[0]-f[2]>L?-E:f[2]-c[0]>L?E:0),c[0]+=V}Gl(o,c)}function Xh(c,o,f,E){const L=Math.pow(2,E.z)*Qa,V=[E.x*Qa,E.y*Qa],X=[];for(const J of c)for(const oe of J){const me=[oe.x+V[0],oe.y+V[1]];Ia(me,o,f,L),X.push(me)}return X}function Sl(c,o,f,E){const L=Math.pow(2,E.z)*Qa,V=[E.x*Qa,E.y*Qa],X=[];for(const oe of c){const me=[];for(const Me of oe){const De=[Me.x+V[0],Me.y+V[1]];Gl(o,De),me.push(De)}X.push(me)}if(o[2]-o[0]<=L/2){(J=o)[0]=J[1]=1/0,J[2]=J[3]=-1/0;for(const oe of X)for(const me of oe)Ia(me,o,f,L)}var J;return X}class Va{constructor(o,f){this.type=no,this.geojson=o,this.geometries=f}static parse(o,f){if(o.length!==2)return f.error(`'within' expression requires exactly one argument, but found ${o.length-1} instead.`);if(Ql(o[1])){const E=o[1];if(E.type==="FeatureCollection")for(let L=0;L!Array.isArray(me)||me.length===o.length-1);let oe=null;for(const[me,Me]of J){oe=new wl(f.registry,lc,f.path,null,f.scope);const De=[];let Ye=!1;for(let ot=1;ot{return Ye=De,Array.isArray(Ye)?`(${Ye.map(ye).join(", ")})`:`(${ye(Ye.type)}...)`;var Ye}).join(" | "),Me=[];for(let De=1;De{f=o?f&&lc(E):f&&E instanceof il}),!!f&&Ku(c)&&bs(c,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Ku(c){if(c instanceof Ni&&(c.name==="get"&&c.args.length===1||c.name==="feature-state"||c.name==="has"&&c.args.length===1||c.name==="properties"||c.name==="geometry-type"||c.name==="id"||/^filter-/.test(c.name))||c instanceof Va)return!1;let o=!0;return c.eachChild(f=>{o&&!Ku(f)&&(o=!1)}),o}function lo(c){if(c instanceof Ni&&c.name==="feature-state")return!1;let o=!0;return c.eachChild(f=>{o&&!lo(f)&&(o=!1)}),o}function bs(c,o){if(c instanceof Ni&&o.indexOf(c.name)>=0)return!1;let f=!0;return c.eachChild(E=>{f&&!bs(E,o)&&(f=!1)}),f}function Os(c,o){const f=c.length-1;let E,L,V=0,X=f,J=0;for(;V<=X;)if(J=Math.floor((V+X)/2),E=c[J],L=c[J+1],E<=o){if(J===f||oo))throw new va("Input is not a number.");X=J-1}return 0}class Nl{constructor(o,f,E){this.type=o,this.input=f,this.labels=[],this.outputs=[];for(const[L,V]of E)this.labels.push(L),this.outputs.push(V)}static parse(o,f){if(o.length-1<4)return f.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if((o.length-1)%2!=0)return f.error("Expected an even number of arguments.");const E=f.parse(o[1],1,dn);if(!E)return null;const L=[];let V=null;f.expectedType&&f.expectedType.kind!=="value"&&(V=f.expectedType);for(let X=1;X=J)return f.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',me);const De=f.parse(oe,Me,V);if(!De)return null;V=V||De.type,L.push([J,De])}return new Nl(V,E,L)}evaluate(o){const f=this.labels,E=this.outputs;if(f.length===1)return E[0].evaluate(o);const L=this.input.evaluate(o);if(L<=f[0])return E[0].evaluate(o);const V=f.length;return L>=f[V-1]?E[V-1].evaluate(o):E[Os(f,L)].evaluate(o)}eachChild(o){o(this.input);for(const f of this.outputs)o(f)}outputDefined(){return this.outputs.every(o=>o.outputDefined())}}function Io(c,o,f){return c+f*(o-c)}function eu(c,o,f){return c.map((E,L)=>Io(E,o[L],f))}const Tl={number:Io,color:function(c,o,f,E="rgb"){switch(E){case"rgb":{const[L,V,X,J]=eu(c.rgb,o.rgb,f);return new Yo(L,V,X,J,!1)}case"hcl":{const[L,V,X,J]=c.hcl,[oe,me,Me,De]=o.hcl;let Ye,ot;if(isNaN(L)||isNaN(oe))isNaN(L)?isNaN(oe)?Ye=NaN:(Ye=oe,X!==1&&X!==0||(ot=me)):(Ye=L,Me!==1&&Me!==0||(ot=V));else{let Er=oe-L;oe>L&&Er>180?Er-=360:oe180&&(Er+=360),Ye=L+f*Er}const[lt,Ct,Gt,Kt]=function([Er,cr,Rr,Qr]){return Er=isNaN(Er)?0:Er*xn,On([Rr,Math.cos(Er)*cr,Math.sin(Er)*cr,Qr])}([Ye,ot!=null?ot:Io(V,me,f),Io(X,Me,f),Io(J,De,f)]);return new Yo(lt,Ct,Gt,Kt,!1)}case"lab":{const[L,V,X,J]=On(eu(c.lab,o.lab,f));return new Yo(L,V,X,J,!1)}}},array:eu,padding:function(c,o,f){return new us(eu(c.values,o.values,f))},variableAnchorOffsetCollection:function(c,o,f){const E=c.values,L=o.values;if(E.length!==L.length)throw new va(`Cannot interpolate values of different length. from: ${c.toString()}, to: ${o.toString()}`);const V=[];for(let X=0;Xtypeof Me!="number"||Me<0||Me>1))return f.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);L={name:"cubic-bezier",controlPoints:me}}}if(o.length-1<4)return f.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if((o.length-1)%2!=0)return f.error("Expected an even number of arguments.");if(V=f.parse(V,2,dn),!V)return null;const J=[];let oe=null;E==="interpolate-hcl"||E==="interpolate-lab"?oe=Za:f.expectedType&&f.expectedType.kind!=="value"&&(oe=f.expectedType);for(let me=0;me=Me)return f.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Ye);const lt=f.parse(De,ot,oe);if(!lt)return null;oe=oe||lt.type,J.push([Me,lt])}return Je(oe,dn)||Je(oe,Za)||Je(oe,Ne)||Je(oe,le)||Je(oe,ge(dn))?new Fu(oe,E,L,V,J):f.error(`Type ${ye(oe)} is not interpolatable.`)}evaluate(o){const f=this.labels,E=this.outputs;if(f.length===1)return E[0].evaluate(o);const L=this.input.evaluate(o);if(L<=f[0])return E[0].evaluate(o);const V=f.length;if(L>=f[V-1])return E[V-1].evaluate(o);const X=Os(f,L),J=Fu.interpolationFactor(this.interpolation,L,f[X],f[X+1]),oe=E[X].evaluate(o),me=E[X+1].evaluate(o);switch(this.operator){case"interpolate":return Tl[this.type.kind](oe,me,J);case"interpolate-hcl":return Tl.color(oe,me,J,"hcl");case"interpolate-lab":return Tl.color(oe,me,J,"lab")}}eachChild(o){o(this.input);for(const f of this.outputs)o(f)}outputDefined(){return this.outputs.every(o=>o.outputDefined())}}function Ju(c,o,f,E){const L=E-f,V=c-f;return L===0?0:o===1?V/L:(Math.pow(o,V)-1)/(Math.pow(o,L)-1)}class al{constructor(o,f){this.type=o,this.args=f}static parse(o,f){if(o.length<2)return f.error("Expectected at least one argument.");let E=null;const L=f.expectedType;L&&L.kind!=="value"&&(E=L);const V=[];for(const J of o.slice(1)){const oe=f.parse(J,1+V.length,E,void 0,{typeAnnotation:"omit"});if(!oe)return null;E=E||oe.type,V.push(oe)}if(!E)throw new Error("No output type");const X=L&&V.some(J=>je(L,J.type));return new al(X?Ji:E,V)}evaluate(o){let f,E=null,L=0;for(const V of this.args)if(L++,E=V.evaluate(o),E&&E instanceof Fa&&!E.available&&(f||(f=E.name),E=null,L===this.args.length&&(E=f)),E!==null)break;return E}eachChild(o){this.args.forEach(o)}outputDefined(){return this.args.every(o=>o.outputDefined())}}class Kc{constructor(o,f){this.type=f.type,this.bindings=[].concat(o),this.result=f}evaluate(o){return this.result.evaluate(o)}eachChild(o){for(const f of this.bindings)o(f[1]);o(this.result)}static parse(o,f){if(o.length<4)return f.error(`Expected at least 3 arguments, but found ${o.length-1} instead.`);const E=[];for(let V=1;V=E.length)throw new va(`Array index out of bounds: ${f} > ${E.length-1}.`);if(f!==Math.floor(f))throw new va(`Array index must be an integer, but found ${f} instead.`);return E[f]}eachChild(o){o(this.index),o(this.input)}outputDefined(){return!1}}class Ks{constructor(o,f){this.type=no,this.needle=o,this.haystack=f}static parse(o,f){if(o.length!==3)return f.error(`Expected 2 arguments, but found ${o.length-1} instead.`);const E=f.parse(o[1],1,Ji),L=f.parse(o[2],2,Ji);return E&&L?Ue(E.type,[no,co,dn,wa,Ji])?new Ks(E,L):f.error(`Expected first argument to be of type boolean, string, number or null, but found ${ye(E.type)} instead`):null}evaluate(o){const f=this.needle.evaluate(o),E=this.haystack.evaluate(o);if(!E)return!1;if(!Ae(f,["boolean","string","number","null"]))throw new va(`Expected first argument to be of type boolean, string, number or null, but found ${ye(oa(f))} instead.`);if(!Ae(E,["string","array"]))throw new va(`Expected second argument to be of type array or string, but found ${ye(oa(E))} instead.`);return E.indexOf(f)>=0}eachChild(o){o(this.needle),o(this.haystack)}outputDefined(){return!0}}class Lp{constructor(o,f,E){this.type=dn,this.needle=o,this.haystack=f,this.fromIndex=E}static parse(o,f){if(o.length<=2||o.length>=5)return f.error(`Expected 3 or 4 arguments, but found ${o.length-1} instead.`);const E=f.parse(o[1],1,Ji),L=f.parse(o[2],2,Ji);if(!E||!L)return null;if(!Ue(E.type,[no,co,dn,wa,Ji]))return f.error(`Expected first argument to be of type boolean, string, number or null, but found ${ye(E.type)} instead`);if(o.length===4){const V=f.parse(o[3],3,dn);return V?new Lp(E,L,V):null}return new Lp(E,L)}evaluate(o){const f=this.needle.evaluate(o),E=this.haystack.evaluate(o);if(!Ae(f,["boolean","string","number","null"]))throw new va(`Expected first argument to be of type boolean, string, number or null, but found ${ye(oa(f))} instead.`);if(!Ae(E,["string","array"]))throw new va(`Expected second argument to be of type array or string, but found ${ye(oa(E))} instead.`);if(this.fromIndex){const L=this.fromIndex.evaluate(o);return E.indexOf(f,L)}return E.indexOf(f)}eachChild(o){o(this.needle),o(this.haystack),this.fromIndex&&o(this.fromIndex)}outputDefined(){return!1}}class gf{constructor(o,f,E,L,V,X){this.inputType=o,this.type=f,this.input=E,this.cases=L,this.outputs=V,this.otherwise=X}static parse(o,f){if(o.length<5)return f.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if(o.length%2!=1)return f.error("Expected an even number of arguments.");let E,L;f.expectedType&&f.expectedType.kind!=="value"&&(L=f.expectedType);const V={},X=[];for(let me=2;meNumber.MAX_SAFE_INTEGER)return Ye.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof lt=="number"&&Math.floor(lt)!==lt)return Ye.error("Numeric branch labels must be integer values.");if(E){if(Ye.checkSubtype(E,oa(lt)))return null}else E=oa(lt);if(V[String(lt)]!==void 0)return Ye.error("Branch labels must be unique.");V[String(lt)]=X.length}const ot=f.parse(De,me,L);if(!ot)return null;L=L||ot.type,X.push(ot)}const J=f.parse(o[1],1,Ji);if(!J)return null;const oe=f.parse(o[o.length-1],o.length-1,L);return oe?J.type.kind!=="value"&&f.concat(1).checkSubtype(E,J.type)?null:new gf(E,L,J,V,X,oe):null}evaluate(o){const f=this.input.evaluate(o);return(oa(f)===this.inputType&&this.outputs[this.cases[f]]||this.otherwise).evaluate(o)}eachChild(o){o(this.input),this.outputs.forEach(o),o(this.otherwise)}outputDefined(){return this.outputs.every(o=>o.outputDefined())&&this.otherwise.outputDefined()}}class Of{constructor(o,f,E){this.type=o,this.branches=f,this.otherwise=E}static parse(o,f){if(o.length<4)return f.error(`Expected at least 3 arguments, but found only ${o.length-1}.`);if(o.length%2!=0)return f.error("Expected an odd number of arguments.");let E;f.expectedType&&f.expectedType.kind!=="value"&&(E=f.expectedType);const L=[];for(let X=1;Xf.outputDefined())&&this.otherwise.outputDefined()}}class qh{constructor(o,f,E,L){this.type=o,this.input=f,this.beginIndex=E,this.endIndex=L}static parse(o,f){if(o.length<=2||o.length>=5)return f.error(`Expected 3 or 4 arguments, but found ${o.length-1} instead.`);const E=f.parse(o[1],1,Ji),L=f.parse(o[2],2,dn);if(!E||!L)return null;if(!Ue(E.type,[ge(Ji),co,Ji]))return f.error(`Expected first argument to be of type array or string, but found ${ye(E.type)} instead`);if(o.length===4){const V=f.parse(o[3],3,dn);return V?new qh(E.type,E,L,V):null}return new qh(E.type,E,L)}evaluate(o){const f=this.input.evaluate(o),E=this.beginIndex.evaluate(o);if(!Ae(f,["string","array"]))throw new va(`Expected first argument to be of type array or string, but found ${ye(oa(f))} instead.`);if(this.endIndex){const L=this.endIndex.evaluate(o);return f.slice(E,L)}return f.slice(E)}eachChild(o){o(this.input),o(this.beginIndex),this.endIndex&&o(this.endIndex)}outputDefined(){return!1}}function zc(c,o){return c==="=="||c==="!="?o.kind==="boolean"||o.kind==="string"||o.kind==="number"||o.kind==="null"||o.kind==="value":o.kind==="string"||o.kind==="number"||o.kind==="value"}function Oh(c,o,f,E){return E.compare(o,f)===0}function Ms(c,o,f){const E=c!=="=="&&c!=="!=";return class JS{constructor(V,X,J){this.type=no,this.lhs=V,this.rhs=X,this.collator=J,this.hasUntypedArgument=V.type.kind==="value"||X.type.kind==="value"}static parse(V,X){if(V.length!==3&&V.length!==4)return X.error("Expected two or three arguments.");const J=V[0];let oe=X.parse(V[1],1,Ji);if(!oe)return null;if(!zc(J,oe.type))return X.concat(1).error(`"${J}" comparisons are not supported for type '${ye(oe.type)}'.`);let me=X.parse(V[2],2,Ji);if(!me)return null;if(!zc(J,me.type))return X.concat(2).error(`"${J}" comparisons are not supported for type '${ye(me.type)}'.`);if(oe.type.kind!==me.type.kind&&oe.type.kind!=="value"&&me.type.kind!=="value")return X.error(`Cannot compare types '${ye(oe.type)}' and '${ye(me.type)}'.`);E&&(oe.type.kind==="value"&&me.type.kind!=="value"?oe=new Wa(me.type,[oe]):oe.type.kind!=="value"&&me.type.kind==="value"&&(me=new Wa(oe.type,[me])));let Me=null;if(V.length===4){if(oe.type.kind!=="string"&&me.type.kind!=="string"&&oe.type.kind!=="value"&&me.type.kind!=="value")return X.error("Cannot use collator to compare non-string types.");if(Me=X.parse(V[3],3,Us),!Me)return null}return new JS(oe,me,Me)}evaluate(V){const X=this.lhs.evaluate(V),J=this.rhs.evaluate(V);if(E&&this.hasUntypedArgument){const oe=oa(X),me=oa(J);if(oe.kind!==me.kind||oe.kind!=="string"&&oe.kind!=="number")throw new va(`Expected arguments for "${c}" to be (string, string) or (number, number), but found (${oe.kind}, ${me.kind}) instead.`)}if(this.collator&&!E&&this.hasUntypedArgument){const oe=oa(X),me=oa(J);if(oe.kind!=="string"||me.kind!=="string")return o(V,X,J)}return this.collator?f(V,X,J,this.collator.evaluate(V)):o(V,X,J)}eachChild(V){V(this.lhs),V(this.rhs),this.collator&&V(this.collator)}outputDefined(){return!0}}}const Jc=Ms("==",function(c,o,f){return o===f},Oh),Yh=Ms("!=",function(c,o,f){return o!==f},function(c,o,f,E){return!Oh(0,o,f,E)}),Qc=Ms("<",function(c,o,f){return o",function(c,o,f){return o>f},function(c,o,f,E){return E.compare(o,f)>0}),eh=Ms("<=",function(c,o,f){return o<=f},function(c,o,f,E){return E.compare(o,f)<=0}),yh=Ms(">=",function(c,o,f){return o>=f},function(c,o,f,E){return E.compare(o,f)>=0});class sl{constructor(o,f,E,L,V){this.type=co,this.number=o,this.locale=f,this.currency=E,this.minFractionDigits=L,this.maxFractionDigits=V}static parse(o,f){if(o.length!==3)return f.error("Expected two arguments.");const E=f.parse(o[1],1,dn);if(!E)return null;const L=o[2];if(typeof L!="object"||Array.isArray(L))return f.error("NumberFormat options argument must be an object.");let V=null;if(L.locale&&(V=f.parse(L.locale,1,co),!V))return null;let X=null;if(L.currency&&(X=f.parse(L.currency,1,co),!X))return null;let J=null;if(L["min-fraction-digits"]&&(J=f.parse(L["min-fraction-digits"],1,dn),!J))return null;let oe=null;return L["max-fraction-digits"]&&(oe=f.parse(L["max-fraction-digits"],1,dn),!oe)?null:new sl(E,V,X,J,oe)}evaluate(o){return new Intl.NumberFormat(this.locale?this.locale.evaluate(o):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(o):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(o):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(o):void 0}).format(this.number.evaluate(o))}eachChild(o){o(this.number),this.locale&&o(this.locale),this.currency&&o(this.currency),this.minFractionDigits&&o(this.minFractionDigits),this.maxFractionDigits&&o(this.maxFractionDigits)}outputDefined(){return!1}}class Uc{constructor(o){this.type=Lt,this.sections=o}static parse(o,f){if(o.length<2)return f.error("Expected at least one argument.");const E=o[1];if(!Array.isArray(E)&&typeof E=="object")return f.error("First argument must be an image or text section.");const L=[];let V=!1;for(let X=1;X<=o.length-1;++X){const J=o[X];if(V&&typeof J=="object"&&!Array.isArray(J)){V=!1;let oe=null;if(J["font-scale"]&&(oe=f.parse(J["font-scale"],1,dn),!oe))return null;let me=null;if(J["text-font"]&&(me=f.parse(J["text-font"],1,ge(co)),!me))return null;let Me=null;if(J["text-color"]&&(Me=f.parse(J["text-color"],1,Za),!Me))return null;const De=L[L.length-1];De.scale=oe,De.font=me,De.textColor=Me}else{const oe=f.parse(o[X],1,Ji);if(!oe)return null;const me=oe.type.kind;if(me!=="string"&&me!=="value"&&me!=="null"&&me!=="resolvedImage")return f.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");V=!0,L.push({content:oe,scale:null,font:null,textColor:null})}}return new Uc(L)}evaluate(o){return new Fo(this.sections.map(f=>{const E=f.content.evaluate(o);return oa(E)===re?new $o("",E,null,null,null):new $o(Zo(E),null,f.scale?f.scale.evaluate(o):null,f.font?f.font.evaluate(o).join(","):null,f.textColor?f.textColor.evaluate(o):null)}))}eachChild(o){for(const f of this.sections)o(f.content),f.scale&&o(f.scale),f.font&&o(f.font),f.textColor&&o(f.textColor)}outputDefined(){return!1}}class bc{constructor(o){this.type=re,this.input=o}static parse(o,f){if(o.length!==2)return f.error("Expected two arguments.");const E=f.parse(o[1],1,co);return E?new bc(E):f.error("No image name provided.")}evaluate(o){const f=this.input.evaluate(o),E=Fa.fromString(f);return E&&o.availableImages&&(E.available=o.availableImages.indexOf(f)>-1),E}eachChild(o){o(this.input)}outputDefined(){return!1}}class fp{constructor(o){this.type=dn,this.input=o}static parse(o,f){if(o.length!==2)return f.error(`Expected 1 argument, but found ${o.length-1} instead.`);const E=f.parse(o[1],1);return E?E.type.kind!=="array"&&E.type.kind!=="string"&&E.type.kind!=="value"?f.error(`Expected argument of type string or array, but found ${ye(E.type)} instead.`):new fp(E):null}evaluate(o){const f=this.input.evaluate(o);if(typeof f=="string"||Array.isArray(f))return f.length;throw new va(`Expected value to be of type string or array, but found ${ye(oa(f))} instead.`)}eachChild(o){o(this.input)}outputDefined(){return!1}}const dp={"==":Jc,"!=":Yh,">":uc,"<":Qc,">=":yh,"<=":eh,array:Wa,at:ou,boolean:Wa,case:Of,coalesce:al,collator:ol,format:Uc,image:bc,in:Ks,"index-of":Lp,interpolate:Fu,"interpolate-hcl":Fu,"interpolate-lab":Fu,length:fp,let:Kc,literal:il,match:gf,number:Wa,"number-format":sl,object:Wa,slice:qh,step:Nl,string:Wa,"to-boolean":Rl,"to-color":Rl,"to-number":Rl,"to-string":Rl,var:Aa,within:Va};function Ps(c,[o,f,E,L]){o=o.evaluate(c),f=f.evaluate(c),E=E.evaluate(c);const V=L?L.evaluate(c):1,X=sc(o,f,E,V);if(X)throw new va(X);return new Yo(o/255,f/255,E/255,V,!1)}function Gf(c,o){return c in o}function Xp(c,o){const f=o[c];return f===void 0?null:f}function cc(c){return{type:c}}function zl(c){return{result:"success",value:c}}function Ec(c){return{result:"error",value:c}}function th(c){return c["property-type"]==="data-driven"||c["property-type"]==="cross-faded-data-driven"}function vu(c){return!!c.expression&&c.expression.parameters.indexOf("zoom")>-1}function xh(c){return!!c.expression&&c.expression.interpolated}function qa(c){return c instanceof Number?"number":c instanceof String?"string":c instanceof Boolean?"boolean":Array.isArray(c)?"array":c===null?"null":typeof c}function Hs(c){return typeof c=="object"&&c!==null&&!Array.isArray(c)}function Ep(c){return c}function Na(c,o){const f=o.type==="color",E=c.stops&&typeof c.stops[0][0]=="object",L=E||!(E||c.property!==void 0),V=c.type||(xh(o)?"exponential":"interval");if(f||o.type==="padding"){const Me=f?Yo.parse:us.parse;(c=To({},c)).stops&&(c.stops=c.stops.map(De=>[De[0],Me(De[1])])),c.default=Me(c.default?c.default:o.default)}if(c.colorSpace&&(X=c.colorSpace)!=="rgb"&&X!=="hcl"&&X!=="lab")throw new Error(`Unknown color space: "${c.colorSpace}"`);var X;let J,oe,me;if(V==="exponential")J=ec;else if(V==="interval")J=ys;else if(V==="categorical"){J=Is,oe=Object.create(null);for(const Me of c.stops)oe[Me[0]]=Me[1];me=typeof c.stops[0][0]}else{if(V!=="identity")throw new Error(`Unknown function type "${V}"`);J=Bf}if(E){const Me={},De=[];for(let lt=0;ltlt[0]),evaluate:({zoom:lt},Ct)=>ec({stops:Ye,base:c.base},o,lt).evaluate(lt,Ct)}}if(L){const Me=V==="exponential"?{name:"exponential",base:c.base!==void 0?c.base:1}:null;return{kind:"camera",interpolationType:Me,interpolationFactor:Fu.interpolationFactor.bind(void 0,Me),zoomStops:c.stops.map(De=>De[0]),evaluate:({zoom:De})=>J(c,o,De,oe,me)}}return{kind:"source",evaluate(Me,De){const Ye=De&&De.properties?De.properties[c.property]:void 0;return Ye===void 0?Qu(c.default,o.default):J(c,o,Ye,oe,me)}}}function Qu(c,o,f){return c!==void 0?c:o!==void 0?o:f!==void 0?f:void 0}function Is(c,o,f,E,L){return Qu(typeof f===L?E[f]:void 0,c.default,o.default)}function ys(c,o,f){if(qa(f)!=="number")return Qu(c.default,o.default);const E=c.stops.length;if(E===1||f<=c.stops[0][0])return c.stops[0][1];if(f>=c.stops[E-1][0])return c.stops[E-1][1];const L=Os(c.stops.map(V=>V[0]),f);return c.stops[L][1]}function ec(c,o,f){const E=c.base!==void 0?c.base:1;if(qa(f)!=="number")return Qu(c.default,o.default);const L=c.stops.length;if(L===1||f<=c.stops[0][0])return c.stops[0][1];if(f>=c.stops[L-1][0])return c.stops[L-1][1];const V=Os(c.stops.map(Me=>Me[0]),f),X=function(Me,De,Ye,ot){const lt=ot-Ye,Ct=Me-Ye;return lt===0?0:De===1?Ct/lt:(Math.pow(De,Ct)-1)/(Math.pow(De,lt)-1)}(f,E,c.stops[V][0],c.stops[V+1][0]),J=c.stops[V][1],oe=c.stops[V+1][1],me=Tl[o.type]||Ep;return typeof J.evaluate=="function"?{evaluate(...Me){const De=J.evaluate.apply(void 0,Me),Ye=oe.evaluate.apply(void 0,Me);if(De!==void 0&&Ye!==void 0)return me(De,Ye,X,c.colorSpace)}}:me(J,oe,X,c.colorSpace)}function Bf(c,o,f){switch(o.type){case"color":f=Yo.parse(f);break;case"formatted":f=Fo.fromString(f.toString());break;case"resolvedImage":f=Fa.fromString(f.toString());break;case"padding":f=us.parse(f);break;default:qa(f)===o.type||o.type==="enum"&&o.values[f]||(f=void 0)}return Qu(f,c.default,o.default)}Ni.register(dp,{error:[{kind:"error"},[co],(c,[o])=>{throw new va(o.evaluate(c))}],typeof:[co,[Ji],(c,[o])=>ye(oa(o.evaluate(c)))],"to-rgba":[ge(dn,4),[Za],(c,[o])=>{const[f,E,L,V]=o.evaluate(c).rgb;return[255*f,255*E,255*L,V]}],rgb:[Za,[dn,dn,dn],Ps],rgba:[Za,[dn,dn,dn,dn],Ps],has:{type:no,overloads:[[[co],(c,[o])=>Gf(o.evaluate(c),c.properties())],[[co,ms],(c,[o,f])=>Gf(o.evaluate(c),f.evaluate(c))]]},get:{type:Ji,overloads:[[[co],(c,[o])=>Xp(o.evaluate(c),c.properties())],[[co,ms],(c,[o,f])=>Xp(o.evaluate(c),f.evaluate(c))]]},"feature-state":[Ji,[co],(c,[o])=>Xp(o.evaluate(c),c.featureState||{})],properties:[ms,[],c=>c.properties()],"geometry-type":[co,[],c=>c.geometryType()],id:[Ji,[],c=>c.id()],zoom:[dn,[],c=>c.globals.zoom],"heatmap-density":[dn,[],c=>c.globals.heatmapDensity||0],"line-progress":[dn,[],c=>c.globals.lineProgress||0],accumulated:[Ji,[],c=>c.globals.accumulated===void 0?null:c.globals.accumulated],"+":[dn,cc(dn),(c,o)=>{let f=0;for(const E of o)f+=E.evaluate(c);return f}],"*":[dn,cc(dn),(c,o)=>{let f=1;for(const E of o)f*=E.evaluate(c);return f}],"-":{type:dn,overloads:[[[dn,dn],(c,[o,f])=>o.evaluate(c)-f.evaluate(c)],[[dn],(c,[o])=>-o.evaluate(c)]]},"/":[dn,[dn,dn],(c,[o,f])=>o.evaluate(c)/f.evaluate(c)],"%":[dn,[dn,dn],(c,[o,f])=>o.evaluate(c)%f.evaluate(c)],ln2:[dn,[],()=>Math.LN2],pi:[dn,[],()=>Math.PI],e:[dn,[],()=>Math.E],"^":[dn,[dn,dn],(c,[o,f])=>Math.pow(o.evaluate(c),f.evaluate(c))],sqrt:[dn,[dn],(c,[o])=>Math.sqrt(o.evaluate(c))],log10:[dn,[dn],(c,[o])=>Math.log(o.evaluate(c))/Math.LN10],ln:[dn,[dn],(c,[o])=>Math.log(o.evaluate(c))],log2:[dn,[dn],(c,[o])=>Math.log(o.evaluate(c))/Math.LN2],sin:[dn,[dn],(c,[o])=>Math.sin(o.evaluate(c))],cos:[dn,[dn],(c,[o])=>Math.cos(o.evaluate(c))],tan:[dn,[dn],(c,[o])=>Math.tan(o.evaluate(c))],asin:[dn,[dn],(c,[o])=>Math.asin(o.evaluate(c))],acos:[dn,[dn],(c,[o])=>Math.acos(o.evaluate(c))],atan:[dn,[dn],(c,[o])=>Math.atan(o.evaluate(c))],min:[dn,cc(dn),(c,o)=>Math.min(...o.map(f=>f.evaluate(c)))],max:[dn,cc(dn),(c,o)=>Math.max(...o.map(f=>f.evaluate(c)))],abs:[dn,[dn],(c,[o])=>Math.abs(o.evaluate(c))],round:[dn,[dn],(c,[o])=>{const f=o.evaluate(c);return f<0?-Math.round(-f):Math.round(f)}],floor:[dn,[dn],(c,[o])=>Math.floor(o.evaluate(c))],ceil:[dn,[dn],(c,[o])=>Math.ceil(o.evaluate(c))],"filter-==":[no,[co,Ji],(c,[o,f])=>c.properties()[o.value]===f.value],"filter-id-==":[no,[Ji],(c,[o])=>c.id()===o.value],"filter-type-==":[no,[co],(c,[o])=>c.geometryType()===o.value],"filter-<":[no,[co,Ji],(c,[o,f])=>{const E=c.properties()[o.value],L=f.value;return typeof E==typeof L&&E{const f=c.id(),E=o.value;return typeof f==typeof E&&f":[no,[co,Ji],(c,[o,f])=>{const E=c.properties()[o.value],L=f.value;return typeof E==typeof L&&E>L}],"filter-id->":[no,[Ji],(c,[o])=>{const f=c.id(),E=o.value;return typeof f==typeof E&&f>E}],"filter-<=":[no,[co,Ji],(c,[o,f])=>{const E=c.properties()[o.value],L=f.value;return typeof E==typeof L&&E<=L}],"filter-id-<=":[no,[Ji],(c,[o])=>{const f=c.id(),E=o.value;return typeof f==typeof E&&f<=E}],"filter->=":[no,[co,Ji],(c,[o,f])=>{const E=c.properties()[o.value],L=f.value;return typeof E==typeof L&&E>=L}],"filter-id->=":[no,[Ji],(c,[o])=>{const f=c.id(),E=o.value;return typeof f==typeof E&&f>=E}],"filter-has":[no,[Ji],(c,[o])=>o.value in c.properties()],"filter-has-id":[no,[],c=>c.id()!==null&&c.id()!==void 0],"filter-type-in":[no,[ge(co)],(c,[o])=>o.value.indexOf(c.geometryType())>=0],"filter-id-in":[no,[ge(Ji)],(c,[o])=>o.value.indexOf(c.id())>=0],"filter-in-small":[no,[co,ge(Ji)],(c,[o,f])=>f.value.indexOf(c.properties()[o.value])>=0],"filter-in-large":[no,[co,ge(Ji)],(c,[o,f])=>function(E,L,V,X){for(;V<=X;){const J=V+X>>1;if(L[J]===E)return!0;L[J]>E?X=J-1:V=J+1}return!1}(c.properties()[o.value],f.value,0,f.value.length-1)],all:{type:no,overloads:[[[no,no],(c,[o,f])=>o.evaluate(c)&&f.evaluate(c)],[cc(no),(c,o)=>{for(const f of o)if(!f.evaluate(c))return!1;return!0}]]},any:{type:no,overloads:[[[no,no],(c,[o,f])=>o.evaluate(c)||f.evaluate(c)],[cc(no),(c,o)=>{for(const f of o)if(f.evaluate(c))return!0;return!1}]]},"!":[no,[no],(c,[o])=>!o.evaluate(c)],"is-supported-script":[no,[co],(c,[o])=>{const f=c.globals&&c.globals.isSupportedScript;return!f||f(o.evaluate(c))}],upcase:[co,[co],(c,[o])=>o.evaluate(c).toUpperCase()],downcase:[co,[co],(c,[o])=>o.evaluate(c).toLowerCase()],concat:[co,cc(Ji),(c,o)=>o.map(f=>Zo(f.evaluate(c))).join("")],"resolved-locale":[co,[Us],(c,[o])=>o.evaluate(c).resolvedLocale()]});class es{constructor(o,f){var E;this.expression=o,this._warningHistory={},this._evaluator=new gl,this._defaultValue=f?(E=f).type==="color"&&Hs(E.default)?new Yo(0,0,0,0):E.type==="color"?Yo.parse(E.default)||null:E.type==="padding"?us.parse(E.default)||null:E.type==="variableAnchorOffsetCollection"?Ba.parse(E.default)||null:E.default===void 0?null:E.default:null,this._enumValues=f&&f.type==="enum"?f.values:null}evaluateWithoutErrorHandling(o,f,E,L,V,X){return this._evaluator.globals=o,this._evaluator.feature=f,this._evaluator.featureState=E,this._evaluator.canonical=L,this._evaluator.availableImages=V||null,this._evaluator.formattedSection=X,this.expression.evaluate(this._evaluator)}evaluate(o,f,E,L,V,X){this._evaluator.globals=o,this._evaluator.feature=f||null,this._evaluator.featureState=E||null,this._evaluator.canonical=L,this._evaluator.availableImages=V||null,this._evaluator.formattedSection=X||null;try{const J=this.expression.evaluate(this._evaluator);if(J==null||typeof J=="number"&&J!=J)return this._defaultValue;if(this._enumValues&&!(J in this._enumValues))throw new va(`Expected value to be one of ${Object.keys(this._enumValues).map(oe=>JSON.stringify(oe)).join(", ")}, but found ${JSON.stringify(J)} instead.`);return J}catch(J){return this._warningHistory[J.message]||(this._warningHistory[J.message]=!0,typeof console!="undefined"&&console.warn(J.message)),this._defaultValue}}}function Bs(c){return Array.isArray(c)&&c.length>0&&typeof c[0]=="string"&&c[0]in dp}function wc(c,o){const f=new wl(dp,lc,[],o?function(L){const V={color:Za,string:co,number:dn,enum:co,boolean:no,formatted:Lt,padding:Ne,resolvedImage:re,variableAnchorOffsetCollection:le};return L.type==="array"?ge(V[L.value]||Ji,L.length):V[L.type]}(o):void 0),E=f.parse(c,void 0,void 0,void 0,o&&o.type==="string"?{typeAnnotation:"coerce"}:void 0);return E?zl(new es(E,o)):Ec(f.errors)}class qp{constructor(o,f){this.kind=o,this._styleExpression=f,this.isStateDependent=o!=="constant"&&!lo(f.expression)}evaluateWithoutErrorHandling(o,f,E,L,V,X){return this._styleExpression.evaluateWithoutErrorHandling(o,f,E,L,V,X)}evaluate(o,f,E,L,V,X){return this._styleExpression.evaluate(o,f,E,L,V,X)}}class Sc{constructor(o,f,E,L){this.kind=o,this.zoomStops=E,this._styleExpression=f,this.isStateDependent=o!=="camera"&&!lo(f.expression),this.interpolationType=L}evaluateWithoutErrorHandling(o,f,E,L,V,X){return this._styleExpression.evaluateWithoutErrorHandling(o,f,E,L,V,X)}evaluate(o,f,E,L,V,X){return this._styleExpression.evaluate(o,f,E,L,V,X)}interpolationFactor(o,f,E){return this.interpolationType?Fu.interpolationFactor(this.interpolationType,o,f,E):0}}function $h(c,o){const f=wc(c,o);if(f.result==="error")return f;const E=f.value.expression,L=Ku(E);if(!L&&!th(o))return Ec([new Ti("","data expressions not supported")]);const V=bs(E,["zoom"]);if(!V&&!vu(o))return Ec([new Ti("","zoom expressions not supported")]);const X=au(E);return X||V?X instanceof Ti?Ec([X]):X instanceof Fu&&!xh(o)?Ec([new Ti("",'"interpolate" expressions cannot be used with this property')]):zl(X?new Sc(L?"camera":"composite",f.value,X.labels,X instanceof Fu?X.interpolation:void 0):new qp(L?"constant":"source",f.value)):Ec([new Ti("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Xo{constructor(o,f){this._parameters=o,this._specification=f,To(this,Na(this._parameters,this._specification))}static deserialize(o){return new Xo(o._parameters,o._specification)}static serialize(o){return{_parameters:o._parameters,_specification:o._specification}}}function au(c){let o=null;if(c instanceof Kc)o=au(c.result);else if(c instanceof al){for(const f of c.args)if(o=au(f),o)break}else(c instanceof Nl||c instanceof Fu)&&c.input instanceof Ni&&c.input.name==="zoom"&&(o=c);return o instanceof Ti||c.eachChild(f=>{const E=au(f);E instanceof Ti?o=E:!o&&E?o=new Ti("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):o&&E&&o!==E&&(o=new Ti("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),o}function dl(c){if(c===!0||c===!1)return!0;if(!Array.isArray(c)||c.length===0)return!1;switch(c[0]){case"has":return c.length>=2&&c[1]!=="$id"&&c[1]!=="$type";case"in":return c.length>=3&&(typeof c[1]!="string"||Array.isArray(c[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return c.length!==3||Array.isArray(c[1])||Array.isArray(c[2]);case"any":case"all":for(const o of c.slice(1))if(!dl(o)&&typeof o!="boolean")return!1;return!0;default:return!0}}const tc={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function bh(c){if(c==null)return{filter:()=>!0,needGeometry:!1};dl(c)||(c=Zc(c));const o=wc(c,tc);if(o.result==="error")throw new Error(o.value.map(f=>`${f.key}: ${f.message}`).join(", "));return{filter:(f,E,L)=>o.value.evaluate(f,E,{},L),needGeometry:Kh(c)}}function mp(c,o){return co?1:0}function Kh(c){if(!Array.isArray(c))return!1;if(c[0]==="within")return!0;for(let o=1;o"||o==="<="||o===">="?vf(c[1],c[2],o):o==="any"?(f=c.slice(1),["any"].concat(f.map(Zc))):o==="all"?["all"].concat(c.slice(1).map(Zc)):o==="none"?["all"].concat(c.slice(1).map(Zc).map(Vc)):o==="in"?Bh(c[1],c.slice(2)):o==="!in"?Vc(Bh(c[1],c.slice(2))):o==="has"?_u(c[1]):o==="!has"?Vc(_u(c[1])):o!=="within"||c;var f}function vf(c,o,f){switch(c){case"$type":return[`filter-type-${f}`,o];case"$id":return[`filter-id-${f}`,o];default:return[`filter-${f}`,c,o]}}function Bh(c,o){if(o.length===0)return!1;switch(c){case"$type":return["filter-type-in",["literal",o]];case"$id":return["filter-id-in",["literal",o]];default:return o.length>200&&!o.some(f=>typeof f!=typeof o[0])?["filter-in-large",c,["literal",o.sort(mp)]]:["filter-in-small",c,["literal",o]]}}function _u(c){switch(c){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",c]}}function Vc(c){return["!",c]}function Yp(c){const o=typeof c;if(o==="number"||o==="boolean"||o==="string"||c==null)return JSON.stringify(c);if(Array.isArray(c)){let L="[";for(const V of c)L+=`${Yp(V)},`;return`${L}]`}const f=Object.keys(c).sort();let E="{";for(let L=0;LE.maximum?[new un(o,f,`${f} is greater than the maximum value ${E.maximum}`)]:[]}function Jh(c){const o=c.valueSpec,f=Fs(c.value.type);let E,L,V,X={};const J=f!=="categorical"&&c.value.property===void 0,oe=!J,me=qa(c.value.stops)==="array"&&qa(c.value.stops[0])==="array"&&qa(c.value.stops[0][0])==="object",Me=Ru({key:c.key,value:c.value,valueSpec:c.styleSpec.function,validateSpec:c.validateSpec,style:c.style,styleSpec:c.styleSpec,objectElementValidators:{stops:function(ot){if(f==="identity")return[new un(ot.key,ot.value,'identity function may not have a "stops" property')];let lt=[];const Ct=ot.value;return lt=lt.concat(jc({key:ot.key,value:Ct,valueSpec:ot.valueSpec,validateSpec:ot.validateSpec,style:ot.style,styleSpec:ot.styleSpec,arrayElementValidator:De})),qa(Ct)==="array"&&Ct.length===0&<.push(new un(ot.key,Ct,"array must have at least one stop")),lt},default:function(ot){return ot.validateSpec({key:ot.key,value:ot.value,valueSpec:o,validateSpec:ot.validateSpec,style:ot.style,styleSpec:ot.styleSpec})}}});return f==="identity"&&J&&Me.push(new un(c.key,c.value,'missing required property "property"')),f==="identity"||c.value.stops||Me.push(new un(c.key,c.value,'missing required property "stops"')),f==="exponential"&&c.valueSpec.expression&&!xh(c.valueSpec)&&Me.push(new un(c.key,c.value,"exponential functions not supported")),c.styleSpec.$version>=8&&(oe&&!th(c.valueSpec)?Me.push(new un(c.key,c.value,"property functions not supported")):J&&!vu(c.valueSpec)&&Me.push(new un(c.key,c.value,"zoom functions not supported"))),f!=="categorical"&&!me||c.value.property!==void 0||Me.push(new un(c.key,c.value,'"property" property is required')),Me;function De(ot){let lt=[];const Ct=ot.value,Gt=ot.key;if(qa(Ct)!=="array")return[new un(Gt,Ct,`array expected, ${qa(Ct)} found`)];if(Ct.length!==2)return[new un(Gt,Ct,`array length 2 expected, length ${Ct.length} found`)];if(me){if(qa(Ct[0])!=="object")return[new un(Gt,Ct,`object expected, ${qa(Ct[0])} found`)];if(Ct[0].zoom===void 0)return[new un(Gt,Ct,"object stop key must have zoom")];if(Ct[0].value===void 0)return[new un(Gt,Ct,"object stop key must have value")];if(V&&V>Fs(Ct[0].zoom))return[new un(Gt,Ct[0].zoom,"stop zoom values must appear in ascending order")];Fs(Ct[0].zoom)!==V&&(V=Fs(Ct[0].zoom),L=void 0,X={}),lt=lt.concat(Ru({key:`${Gt}[0]`,value:Ct[0],valueSpec:{zoom:{}},validateSpec:ot.validateSpec,style:ot.style,styleSpec:ot.styleSpec,objectElementValidators:{zoom:$p,value:Ye}}))}else lt=lt.concat(Ye({key:`${Gt}[0]`,value:Ct[0],valueSpec:{},validateSpec:ot.validateSpec,style:ot.style,styleSpec:ot.styleSpec},Ct));return Bs(Tc(Ct[1]))?lt.concat([new un(`${Gt}[1]`,Ct[1],"expressions are not allowed in function stops.")]):lt.concat(ot.validateSpec({key:`${Gt}[1]`,value:Ct[1],valueSpec:o,validateSpec:ot.validateSpec,style:ot.style,styleSpec:ot.styleSpec}))}function Ye(ot,lt){const Ct=qa(ot.value),Gt=Fs(ot.value),Kt=ot.value!==null?ot.value:lt;if(E){if(Ct!==E)return[new un(ot.key,Kt,`${Ct} stop domain type must match previous stop domain type ${E}`)]}else E=Ct;if(Ct!=="number"&&Ct!=="string"&&Ct!=="boolean")return[new un(ot.key,Kt,"stop domain value must be a number, string, or boolean")];if(Ct!=="number"&&f!=="categorical"){let Er=`number expected, ${Ct} found`;return th(o)&&f===void 0&&(Er+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new un(ot.key,Kt,Er)]}return f!=="categorical"||Ct!=="number"||isFinite(Gt)&&Math.floor(Gt)===Gt?f!=="categorical"&&Ct==="number"&&L!==void 0&&Gtnew un(`${c.key}${E.key}`,c.value,E.message));const f=o.value.expression||o.value._styleExpression.expression;if(c.expressionContext==="property"&&c.propertyKey==="text-font"&&!f.outputDefined())return[new un(c.key,c.value,`Invalid data expression for "${c.propertyKey}". Output values must be contained as literals within the expression.`)];if(c.expressionContext==="property"&&c.propertyType==="layout"&&!lo(f))return[new un(c.key,c.value,'"feature-state" data expressions are not supported with layout properties.')];if(c.expressionContext==="filter"&&!lo(f))return[new un(c.key,c.value,'"feature-state" data expressions are not supported with filters.')];if(c.expressionContext&&c.expressionContext.indexOf("cluster")===0){if(!bs(f,["zoom","feature-state"]))return[new un(c.key,c.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(c.expressionContext==="cluster-initial"&&!Ku(f))return[new un(c.key,c.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function kh(c){const o=c.key,f=c.value,E=c.valueSpec,L=[];return Array.isArray(E.values)?E.values.indexOf(Fs(f))===-1&&L.push(new un(o,f,`expected one of [${E.values.join(", ")}], ${JSON.stringify(f)} found`)):Object.keys(E.values).indexOf(Fs(f))===-1&&L.push(new un(o,f,`expected one of [${Object.keys(E.values).join(", ")}], ${JSON.stringify(f)} found`)),L}function Iu(c){return dl(Tc(c.value))?Ac(To({},c,{expressionContext:"filter",valueSpec:{value:"boolean"}})):rh(c)}function rh(c){const o=c.value,f=c.key;if(qa(o)!=="array")return[new un(f,o,`array expected, ${qa(o)} found`)];const E=c.styleSpec;let L,V=[];if(o.length<1)return[new un(f,o,"filter array must have at least 1 element")];switch(V=V.concat(kh({key:`${f}[0]`,value:o[0],valueSpec:E.filter_operator,style:c.style,styleSpec:c.styleSpec})),Fs(o[0])){case"<":case"<=":case">":case">=":o.length>=2&&Fs(o[1])==="$type"&&V.push(new un(f,o,`"$type" cannot be use with operator "${o[0]}"`));case"==":case"!=":o.length!==3&&V.push(new un(f,o,`filter array for operator "${o[0]}" must have 3 elements`));case"in":case"!in":o.length>=2&&(L=qa(o[1]),L!=="string"&&V.push(new un(`${f}[1]`,o[1],`string expected, ${L} found`)));for(let X=2;X{me in f&&o.push(new un(E,f[me],`"${me}" is prohibited for ref layers`))}),L.layers.forEach(me=>{Fs(me.id)===J&&(oe=me)}),oe?oe.ref?o.push(new un(E,f.ref,"ref cannot reference another ref layer")):X=Fs(oe.type):o.push(new un(E,f.ref,`ref layer "${J}" not found`))}else if(X!=="background")if(f.source){const oe=L.sources&&L.sources[f.source],me=oe&&Fs(oe.type);oe?me==="vector"&&X==="raster"?o.push(new un(E,f.source,`layer "${f.id}" requires a raster source`)):me!=="raster-dem"&&X==="hillshade"?o.push(new un(E,f.source,`layer "${f.id}" requires a raster-dem source`)):me==="raster"&&X!=="raster"?o.push(new un(E,f.source,`layer "${f.id}" requires a vector source`)):me!=="vector"||f["source-layer"]?me==="raster-dem"&&X!=="hillshade"?o.push(new un(E,f.source,"raster-dem source can only be used with layer type 'hillshade'.")):X!=="line"||!f.paint||!f.paint["line-gradient"]||me==="geojson"&&oe.lineMetrics||o.push(new un(E,f,`layer "${f.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):o.push(new un(E,f,`layer "${f.id}" must specify a "source-layer"`)):o.push(new un(E,f.source,`source "${f.source}" not found`))}else o.push(new un(E,f,'missing required property "source"'));return o=o.concat(Ru({key:E,value:f,valueSpec:V.layer,style:c.style,styleSpec:c.styleSpec,validateSpec:c.validateSpec,objectElementValidators:{"*":()=>[],type:()=>c.validateSpec({key:`${E}.type`,value:f.type,valueSpec:V.layer.type,style:c.style,styleSpec:c.styleSpec,validateSpec:c.validateSpec,object:f,objectKey:"type"}),filter:Iu,layout:oe=>Ru({layer:f,key:oe.key,value:oe.value,style:oe.style,styleSpec:oe.styleSpec,validateSpec:oe.validateSpec,objectElementValidators:{"*":me=>Kp(To({layerType:X},me))}}),paint:oe=>Ru({layer:f,key:oe.key,value:oe.value,style:oe.style,styleSpec:oe.styleSpec,validateSpec:oe.validateSpec,objectElementValidators:{"*":me=>vp(To({layerType:X},me))}})}})),o}function Eh(c){const o=c.value,f=c.key,E=qa(o);return E!=="string"?[new un(f,o,`string expected, ${E} found`)]:[]}const yu={promoteId:function({key:c,value:o}){if(qa(o)==="string")return Eh({key:c,value:o});{const f=[];for(const E in o)f.push(...Eh({key:`${c}.${E}`,value:o[E]}));return f}}};function Ya(c){const o=c.value,f=c.key,E=c.styleSpec,L=c.style,V=c.validateSpec;if(!o.type)return[new un(f,o,'"type" is required')];const X=Fs(o.type);let J;switch(X){case"vector":case"raster":return J=Ru({key:f,value:o,valueSpec:E[`source_${X.replace("-","_")}`],style:c.style,styleSpec:E,objectElementValidators:yu,validateSpec:V}),J;case"raster-dem":return J=function(oe){var me;const Me=(me=oe.sourceName)!==null&&me!==void 0?me:"",De=oe.value,Ye=oe.styleSpec,ot=Ye.source_raster_dem,lt=oe.style;let Ct=[];const Gt=qa(De);if(De===void 0)return Ct;if(Gt!=="object")return Ct.push(new un("source_raster_dem",De,`object expected, ${Gt} found`)),Ct;const Kt=Fs(De.encoding)==="custom",Er=["redFactor","greenFactor","blueFactor","baseShift"],cr=oe.value.encoding?`"${oe.value.encoding}"`:"Default";for(const Rr in De)!Kt&&Er.includes(Rr)?Ct.push(new un(Rr,De[Rr],`In "${Me}": "${Rr}" is only valid when "encoding" is set to "custom". ${cr} encoding found`)):ot[Rr]?Ct=Ct.concat(oe.validateSpec({key:Rr,value:De[Rr],valueSpec:ot[Rr],validateSpec:oe.validateSpec,style:lt,styleSpec:Ye})):Ct.push(new un(Rr,De[Rr],`unknown property "${Rr}"`));return Ct}({sourceName:f,value:o,style:c.style,styleSpec:E,validateSpec:V}),J;case"geojson":if(J=Ru({key:f,value:o,valueSpec:E.source_geojson,style:L,styleSpec:E,validateSpec:V,objectElementValidators:yu}),o.cluster)for(const oe in o.clusterProperties){const[me,Me]=o.clusterProperties[oe],De=typeof me=="string"?[me,["accumulated"],["get",oe]]:me;J.push(...Ac({key:`${f}.${oe}.map`,value:Me,validateSpec:V,expressionContext:"cluster-map"})),J.push(...Ac({key:`${f}.${oe}.reduce`,value:De,validateSpec:V,expressionContext:"cluster-reduce"}))}return J;case"video":return Ru({key:f,value:o,valueSpec:E.source_video,style:L,validateSpec:V,styleSpec:E});case"image":return Ru({key:f,value:o,valueSpec:E.source_image,style:L,validateSpec:V,styleSpec:E});case"canvas":return[new un(f,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return kh({key:`${f}.type`,value:o.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:L,validateSpec:V,styleSpec:E})}}function nh(c){const o=c.value,f=c.styleSpec,E=f.light,L=c.style;let V=[];const X=qa(o);if(o===void 0)return V;if(X!=="object")return V=V.concat([new un("light",o,`object expected, ${X} found`)]),V;for(const J in o){const oe=J.match(/^(.*)-transition$/);V=V.concat(oe&&E[oe[1]]&&E[oe[1]].transition?c.validateSpec({key:J,value:o[J],valueSpec:f.transition,validateSpec:c.validateSpec,style:L,styleSpec:f}):E[J]?c.validateSpec({key:J,value:o[J],valueSpec:E[J],validateSpec:c.validateSpec,style:L,styleSpec:f}):[new un(J,o[J],`unknown property "${J}"`)])}return V}function Gc(c){const o=c.value,f=c.styleSpec,E=f.terrain,L=c.style;let V=[];const X=qa(o);if(o===void 0)return V;if(X!=="object")return V=V.concat([new un("terrain",o,`object expected, ${X} found`)]),V;for(const J in o)V=V.concat(E[J]?c.validateSpec({key:J,value:o[J],valueSpec:E[J],validateSpec:c.validateSpec,style:L,styleSpec:f}):[new un(J,o[J],`unknown property "${J}"`)]);return V}function ih(c){let o=[];const f=c.value,E=c.key;if(Array.isArray(f)){const L=[],V=[];for(const X in f)f[X].id&&L.includes(f[X].id)&&o.push(new un(E,f,`all the sprites' ids must be unique, but ${f[X].id} is duplicated`)),L.push(f[X].id),f[X].url&&V.includes(f[X].url)&&o.push(new un(E,f,`all the sprites' URLs must be unique, but ${f[X].url} is duplicated`)),V.push(f[X].url),o=o.concat(Ru({key:`${E}[${X}]`,value:f[X],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:c.validateSpec}));return o}return Eh({key:E,value:f})}const Sa={"*":()=>[],array:jc,boolean:function(c){const o=c.value,f=c.key,E=qa(o);return E!=="boolean"?[new un(f,o,`boolean expected, ${E} found`)]:[]},number:$p,color:function(c){const o=c.key,f=c.value,E=qa(f);return E!=="string"?[new un(o,f,`color expected, ${E} found`)]:Yo.parse(String(f))?[]:[new un(o,f,`color expected, "${f}" found`)]},constants:Ll,enum:kh,filter:Iu,function:Jh,layer:Hc,object:Ru,source:Ya,light:nh,terrain:Gc,string:Eh,formatted:function(c){return Eh(c).length===0?[]:Ac(c)},resolvedImage:function(c){return Eh(c).length===0?[]:Ac(c)},padding:function(c){const o=c.key,f=c.value;if(qa(f)==="array"){if(f.length<1||f.length>4)return[new un(o,f,`padding requires 1 to 4 values; ${f.length} values found`)];const E={type:"number"};let L=[];for(let V=0;V[]}})),c.constants&&(f=f.concat(Ll({key:"constants",value:c.constants,style:c,styleSpec:o,validateSpec:cs}))),oh(f)}function xu(c){return function(o){return c(KS($S({},o),{validateSpec:cs}))}}function oh(c){return[].concat(c).sort((o,f)=>o.line-f.line)}function Cc(c){return function(...o){return oh(c.apply(this,o))}}rc.source=Cc(xu(Ya)),rc.sprite=Cc(xu(ih)),rc.glyphs=Cc(xu(ku)),rc.light=Cc(xu(nh)),rc.terrain=Cc(xu(Gc)),rc.layer=Cc(xu(Hc)),rc.filter=Cc(xu(Iu)),rc.paintProperty=Cc(xu(vp)),rc.layoutProperty=Cc(xu(Kp));const ah=rc,Qh=ah.light,sh=ah.paintProperty,Ul=ah.layoutProperty;function ll(c,o){let f=!1;if(o&&o.length)for(const E of o)c.fire(new Pi(new Error(E.message))),f=!0;return f}class Wc{constructor(o,f,E){const L=this.cells=[];if(o instanceof ArrayBuffer){this.arrayBuffer=o;const X=new Int32Array(this.arrayBuffer);o=X[0],this.d=(f=X[1])+2*(E=X[2]);for(let oe=0;oe=De[lt+0]&&L>=De[lt+1])?(J[ot]=!0,X.push(Me[ot])):J[ot]=!1}}}}_forEachCell(o,f,E,L,V,X,J,oe){const me=this._convertToCellCoord(o),Me=this._convertToCellCoord(f),De=this._convertToCellCoord(E),Ye=this._convertToCellCoord(L);for(let ot=me;ot<=De;ot++)for(let lt=Me;lt<=Ye;lt++){const Ct=this.d*lt+ot;if((!oe||oe(this._convertFromCellCoord(ot),this._convertFromCellCoord(lt),this._convertFromCellCoord(ot+1),this._convertFromCellCoord(lt+1)))&&V.call(this,o,f,E,L,Ct,X,J,oe))return}}_convertFromCellCoord(o){return(o-this.padding)/this.scale}_convertToCellCoord(o){return Math.max(0,Math.min(this.d-1,Math.floor(o*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const o=this.cells,f=3+this.cells.length+1+1;let E=0;for(let X=0;X=0)continue;const X=c[V];L[V]=vl[E].shallow.indexOf(V)>=0?X:tu(X,o)}c instanceof Error&&(L.message=c.message)}if(L.$name)throw new Error("$name property is reserved for worker serialization logic.");return E!=="Object"&&(L.$name=E),L}throw new Error("can't serialize object of type "+typeof c)}function bu(c){if(c==null||typeof c=="boolean"||typeof c=="number"||typeof c=="string"||c instanceof Boolean||c instanceof Number||c instanceof String||c instanceof Date||c instanceof RegExp||c instanceof Blob||fi(c)||Pt(c)||ArrayBuffer.isView(c)||c instanceof ImageData)return c;if(Array.isArray(c))return c.map(bu);if(typeof c=="object"){const o=c.$name||"Object";if(!vl[o])throw new Error(`can't deserialize unregistered class ${o}`);const{klass:f}=vl[o];if(!f)throw new Error(`can't deserialize unregistered class ${o}`);if(f.deserialize)return f.deserialize(c);const E=Object.create(f.prototype);for(const L of Object.keys(c)){if(L==="$name")continue;const V=c[L];E[L]=vl[o].shallow.indexOf(L)>=0?V:bu(V)}return E}throw new Error("can't deserialize object of type "+typeof c)}class Dp{constructor(){this.first=!0}update(o,f){const E=Math.floor(o);return this.first?(this.first=!1,this.lastIntegerZoom=E,this.lastIntegerZoomTime=0,this.lastZoom=o,this.lastFloorZoom=E,!0):(this.lastFloorZoom>E?(this.lastIntegerZoom=E+1,this.lastIntegerZoomTime=f):this.lastFloorZoomc>=128&&c<=255,Arabic:c=>c>=1536&&c<=1791,"Arabic Supplement":c=>c>=1872&&c<=1919,"Arabic Extended-A":c=>c>=2208&&c<=2303,"Hangul Jamo":c=>c>=4352&&c<=4607,"Unified Canadian Aboriginal Syllabics":c=>c>=5120&&c<=5759,Khmer:c=>c>=6016&&c<=6143,"Unified Canadian Aboriginal Syllabics Extended":c=>c>=6320&&c<=6399,"General Punctuation":c=>c>=8192&&c<=8303,"Letterlike Symbols":c=>c>=8448&&c<=8527,"Number Forms":c=>c>=8528&&c<=8591,"Miscellaneous Technical":c=>c>=8960&&c<=9215,"Control Pictures":c=>c>=9216&&c<=9279,"Optical Character Recognition":c=>c>=9280&&c<=9311,"Enclosed Alphanumerics":c=>c>=9312&&c<=9471,"Geometric Shapes":c=>c>=9632&&c<=9727,"Miscellaneous Symbols":c=>c>=9728&&c<=9983,"Miscellaneous Symbols and Arrows":c=>c>=11008&&c<=11263,"CJK Radicals Supplement":c=>c>=11904&&c<=12031,"Kangxi Radicals":c=>c>=12032&&c<=12255,"Ideographic Description Characters":c=>c>=12272&&c<=12287,"CJK Symbols and Punctuation":c=>c>=12288&&c<=12351,Hiragana:c=>c>=12352&&c<=12447,Katakana:c=>c>=12448&&c<=12543,Bopomofo:c=>c>=12544&&c<=12591,"Hangul Compatibility Jamo":c=>c>=12592&&c<=12687,Kanbun:c=>c>=12688&&c<=12703,"Bopomofo Extended":c=>c>=12704&&c<=12735,"CJK Strokes":c=>c>=12736&&c<=12783,"Katakana Phonetic Extensions":c=>c>=12784&&c<=12799,"Enclosed CJK Letters and Months":c=>c>=12800&&c<=13055,"CJK Compatibility":c=>c>=13056&&c<=13311,"CJK Unified Ideographs Extension A":c=>c>=13312&&c<=19903,"Yijing Hexagram Symbols":c=>c>=19904&&c<=19967,"CJK Unified Ideographs":c=>c>=19968&&c<=40959,"Yi Syllables":c=>c>=40960&&c<=42127,"Yi Radicals":c=>c>=42128&&c<=42191,"Hangul Jamo Extended-A":c=>c>=43360&&c<=43391,"Hangul Syllables":c=>c>=44032&&c<=55215,"Hangul Jamo Extended-B":c=>c>=55216&&c<=55295,"Private Use Area":c=>c>=57344&&c<=63743,"CJK Compatibility Ideographs":c=>c>=63744&&c<=64255,"Arabic Presentation Forms-A":c=>c>=64336&&c<=65023,"Vertical Forms":c=>c>=65040&&c<=65055,"CJK Compatibility Forms":c=>c>=65072&&c<=65103,"Small Form Variants":c=>c>=65104&&c<=65135,"Arabic Presentation Forms-B":c=>c>=65136&&c<=65279,"Halfwidth and Fullwidth Forms":c=>c>=65280&&c<=65519};function is(c){for(const o of c)if(Mc(o.charCodeAt(0)))return!0;return!1}function ep(c){for(const o of c)if(!mi(o.charCodeAt(0)))return!1;return!0}function mi(c){return!(ai.Arabic(c)||ai["Arabic Supplement"](c)||ai["Arabic Extended-A"](c)||ai["Arabic Presentation Forms-A"](c)||ai["Arabic Presentation Forms-B"](c))}function Mc(c){return!(c!==746&&c!==747&&(c<4352||!(ai["Bopomofo Extended"](c)||ai.Bopomofo(c)||ai["CJK Compatibility Forms"](c)&&!(c>=65097&&c<=65103)||ai["CJK Compatibility Ideographs"](c)||ai["CJK Compatibility"](c)||ai["CJK Radicals Supplement"](c)||ai["CJK Strokes"](c)||!(!ai["CJK Symbols and Punctuation"](c)||c>=12296&&c<=12305||c>=12308&&c<=12319||c===12336)||ai["CJK Unified Ideographs Extension A"](c)||ai["CJK Unified Ideographs"](c)||ai["Enclosed CJK Letters and Months"](c)||ai["Hangul Compatibility Jamo"](c)||ai["Hangul Jamo Extended-A"](c)||ai["Hangul Jamo Extended-B"](c)||ai["Hangul Jamo"](c)||ai["Hangul Syllables"](c)||ai.Hiragana(c)||ai["Ideographic Description Characters"](c)||ai.Kanbun(c)||ai["Kangxi Radicals"](c)||ai["Katakana Phonetic Extensions"](c)||ai.Katakana(c)&&c!==12540||!(!ai["Halfwidth and Fullwidth Forms"](c)||c===65288||c===65289||c===65293||c>=65306&&c<=65310||c===65339||c===65341||c===65343||c>=65371&&c<=65503||c===65507||c>=65512&&c<=65519)||!(!ai["Small Form Variants"](c)||c>=65112&&c<=65118||c>=65123&&c<=65126)||ai["Unified Canadian Aboriginal Syllabics"](c)||ai["Unified Canadian Aboriginal Syllabics Extended"](c)||ai["Vertical Forms"](c)||ai["Yijing Hexagram Symbols"](c)||ai["Yi Syllables"](c)||ai["Yi Radicals"](c))))}function Op(c){return!(Mc(c)||function(o){return!!(ai["Latin-1 Supplement"](o)&&(o===167||o===169||o===174||o===177||o===188||o===189||o===190||o===215||o===247)||ai["General Punctuation"](o)&&(o===8214||o===8224||o===8225||o===8240||o===8241||o===8251||o===8252||o===8258||o===8263||o===8264||o===8265||o===8273)||ai["Letterlike Symbols"](o)||ai["Number Forms"](o)||ai["Miscellaneous Technical"](o)&&(o>=8960&&o<=8967||o>=8972&&o<=8991||o>=8996&&o<=9e3||o===9003||o>=9085&&o<=9114||o>=9150&&o<=9165||o===9167||o>=9169&&o<=9179||o>=9186&&o<=9215)||ai["Control Pictures"](o)&&o!==9251||ai["Optical Character Recognition"](o)||ai["Enclosed Alphanumerics"](o)||ai["Geometric Shapes"](o)||ai["Miscellaneous Symbols"](o)&&!(o>=9754&&o<=9759)||ai["Miscellaneous Symbols and Arrows"](o)&&(o>=11026&&o<=11055||o>=11088&&o<=11097||o>=11192&&o<=11243)||ai["CJK Symbols and Punctuation"](o)||ai.Katakana(o)||ai["Private Use Area"](o)||ai["CJK Compatibility Forms"](o)||ai["Small Form Variants"](o)||ai["Halfwidth and Fullwidth Forms"](o)||o===8734||o===8756||o===8757||o>=9984&&o<=10087||o>=10102&&o<=10131||o===65532||o===65533)}(c))}function Jp(c){return c>=1424&&c<=2303||ai["Arabic Presentation Forms-A"](c)||ai["Arabic Presentation Forms-B"](c)}function Xc(c,o){return!(!o&&Jp(c)||c>=2304&&c<=3583||c>=3840&&c<=4255||ai.Khmer(c))}function hc(c){for(const o of c)if(Jp(o.charCodeAt(0)))return!0;return!1}const wh="deferred",Pc="loading",Xl="loaded";let Rc=null,Eu="unavailable",lh=null;const tp=function(c){c&&typeof c=="string"&&c.indexOf("NetworkError")>-1&&(Eu="error"),Rc&&Rc(c)};function rp(){su.fire(new Vi("pluginStateChange",{pluginStatus:Eu,pluginURL:lh}))}const su=new ds,ql=function(){return Eu},fa=function(){if(Eu!==wh||!lh)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Eu=Pc,rp(),lh&&Mi({url:lh},c=>{c?tp(c):(Eu=Xl,rp())})},Rs={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Eu===Xl||Rs.applyArabicShaping!=null,isLoading:()=>Eu===Pc,setState(c){if(!Dt())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");Eu=c.pluginStatus,lh=c.pluginURL},isParsed(){if(!Dt())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Rs.applyArabicShaping!=null&&Rs.processBidirectionalText!=null&&Rs.processStyledBidirectionalText!=null},getPluginURL(){if(!Dt())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return lh}};class hs{constructor(o,f){this.zoom=o,f?(this.now=f.now,this.fadeDuration=f.fadeDuration,this.zoomHistory=f.zoomHistory,this.transition=f.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Dp,this.transition={})}isSupportedScript(o){return function(f,E){for(const L of f)if(!Xc(L.charCodeAt(0),E))return!1;return!0}(o,Rs.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const o=this.zoom,f=o-Math.floor(o),E=this.crossFadingFactor();return o>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:f+(1-f)*E}:{fromScale:.5,toScale:1,t:1-(1-E)*f}}}class lu{constructor(o,f){this.property=o,this.value=f,this.expression=function(E,L){if(Hs(E))return new Xo(E,L);if(Bs(E)){const V=$h(E,L);if(V.result==="error")throw new Error(V.value.map(X=>`${X.key}: ${X.message}`).join(", "));return V.value}{let V=E;return L.type==="color"&&typeof E=="string"?V=Yo.parse(E):L.type!=="padding"||typeof E!="number"&&!Array.isArray(E)?L.type==="variableAnchorOffsetCollection"&&Array.isArray(E)&&(V=Ba.parse(E)):V=us.parse(E),{kind:"constant",evaluate:()=>V}}}(f===void 0?o.specification.default:f,o.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(o,f,E){return this.property.possiblyEvaluate(this,o,f,E)}}class wu{constructor(o){this.property=o,this.value=new lu(o,void 0)}transitioned(o,f){return new ch(this.property,this.value,f,ki({},o.transition,this.transition),o.now)}untransitioned(){return new ch(this.property,this.value,null,{},0)}}class uh{constructor(o){this._properties=o,this._values=Object.create(o.defaultTransitionablePropertyValues)}getValue(o){return Jr(this._values[o].value.value)}setValue(o,f){Object.prototype.hasOwnProperty.call(this._values,o)||(this._values[o]=new wu(this._values[o].property)),this._values[o].value=new lu(this._values[o].property,f===null?void 0:Jr(f))}getTransition(o){return Jr(this._values[o].transition)}setTransition(o,f){Object.prototype.hasOwnProperty.call(this._values,o)||(this._values[o]=new wu(this._values[o].property)),this._values[o].transition=Jr(f)||void 0}serialize(){const o={};for(const f of Object.keys(this._values)){const E=this.getValue(f);E!==void 0&&(o[f]=E);const L=this.getTransition(f);L!==void 0&&(o[`${f}-transition`]=L)}return o}transitioned(o,f){const E=new Nu(this._properties);for(const L of Object.keys(this._values))E._values[L]=this._values[L].transitioned(o,f._values[L]);return E}untransitioned(){const o=new Nu(this._properties);for(const f of Object.keys(this._values))o._values[f]=this._values[f].untransitioned();return o}}class ch{constructor(o,f,E,L,V){this.property=o,this.value=f,this.begin=V+L.delay||0,this.end=this.begin+L.duration||0,o.specification.transition&&(L.delay||L.duration)&&(this.prior=E)}possiblyEvaluate(o,f,E){const L=o.now||0,V=this.value.possiblyEvaluate(o,f,E),X=this.prior;if(X){if(L>this.end)return this.prior=null,V;if(this.value.isDataDriven())return this.prior=null,V;if(L=1)return 1;const me=oe*oe,Me=me*oe;return 4*(oe<.5?Me:3*(oe-me)+Me-.75)}(J))}}return V}}class Nu{constructor(o){this._properties=o,this._values=Object.create(o.defaultTransitioningPropertyValues)}possiblyEvaluate(o,f,E){const L=new Si(this._properties);for(const V of Object.keys(this._values))L._values[V]=this._values[V].possiblyEvaluate(o,f,E);return L}hasTransition(){for(const o of Object.keys(this._values))if(this._values[o].prior)return!0;return!1}}class Qp{constructor(o){this._properties=o,this._values=Object.create(o.defaultPropertyValues)}hasValue(o){return this._values[o].value!==void 0}getValue(o){return Jr(this._values[o].value)}setValue(o,f){this._values[o]=new lu(this._values[o].property,f===null?void 0:Jr(f))}serialize(){const o={};for(const f of Object.keys(this._values)){const E=this.getValue(f);E!==void 0&&(o[f]=E)}return o}possiblyEvaluate(o,f,E){const L=new Si(this._properties);for(const V of Object.keys(this._values))L._values[V]=this._values[V].possiblyEvaluate(o,f,E);return L}}class Gi{constructor(o,f,E){this.property=o,this.value=f,this.parameters=E}isConstant(){return this.value.kind==="constant"}constantOr(o){return this.value.kind==="constant"?this.value.value:o}evaluate(o,f,E,L){return this.property.evaluate(this.value,this.parameters,o,f,E,L)}}class Si{constructor(o){this._properties=o,this._values=Object.create(o.defaultPossiblyEvaluatedValues)}get(o){return this._values[o]}}class ji{constructor(o){this.specification=o}possiblyEvaluate(o,f){if(o.isDataDriven())throw new Error("Value should not be data driven");return o.expression.evaluate(f)}interpolate(o,f,E){const L=Tl[this.specification.type];return L?L(o,f,E):o}}class ao{constructor(o,f){this.specification=o,this.overrides=f}possiblyEvaluate(o,f,E,L){return new Gi(this,o.expression.kind==="constant"||o.expression.kind==="camera"?{kind:"constant",value:o.expression.evaluate(f,null,{},E,L)}:o.expression,f)}interpolate(o,f,E){if(o.value.kind!=="constant"||f.value.kind!=="constant")return o;if(o.value.value===void 0||f.value.value===void 0)return new Gi(this,{kind:"constant",value:void 0},o.parameters);const L=Tl[this.specification.type];if(L){const V=L(o.value.value,f.value.value,E);return new Gi(this,{kind:"constant",value:V},o.parameters)}return o}evaluate(o,f,E,L,V,X){return o.kind==="constant"?o.value:o.evaluate(f,E,L,V,X)}}class Ic extends ao{possiblyEvaluate(o,f,E,L){if(o.value===void 0)return new Gi(this,{kind:"constant",value:void 0},f);if(o.expression.kind==="constant"){const V=o.expression.evaluate(f,null,{},E,L),X=o.property.specification.type==="resolvedImage"&&typeof V!="string"?V.name:V,J=this._calculate(X,X,X,f);return new Gi(this,{kind:"constant",value:J},f)}if(o.expression.kind==="camera"){const V=this._calculate(o.expression.evaluate({zoom:f.zoom-1}),o.expression.evaluate({zoom:f.zoom}),o.expression.evaluate({zoom:f.zoom+1}),f);return new Gi(this,{kind:"constant",value:V},f)}return new Gi(this,o.expression,f)}evaluate(o,f,E,L,V,X){if(o.kind==="source"){const J=o.evaluate(f,E,L,V,X);return this._calculate(J,J,J,f)}return o.kind==="composite"?this._calculate(o.evaluate({zoom:Math.floor(f.zoom)-1},E,L),o.evaluate({zoom:Math.floor(f.zoom)},E,L),o.evaluate({zoom:Math.floor(f.zoom)+1},E,L),f):o.value}_calculate(o,f,E,L){return L.zoom>L.zoomHistory.lastIntegerZoom?{from:o,to:f}:{from:E,to:f}}interpolate(o){return o}}class Gs{constructor(o){this.specification=o}possiblyEvaluate(o,f,E,L){if(o.value!==void 0){if(o.expression.kind==="constant"){const V=o.expression.evaluate(f,null,{},E,L);return this._calculate(V,V,V,f)}return this._calculate(o.expression.evaluate(new hs(Math.floor(f.zoom-1),f)),o.expression.evaluate(new hs(Math.floor(f.zoom),f)),o.expression.evaluate(new hs(Math.floor(f.zoom+1),f)),f)}}_calculate(o,f,E,L){return L.zoom>L.zoomHistory.lastIntegerZoom?{from:o,to:f}:{from:E,to:f}}interpolate(o){return o}}class Lc{constructor(o){this.specification=o}possiblyEvaluate(o,f,E,L){return!!o.expression.evaluate(f,null,{},E,L)}interpolate(){return!1}}class ul{constructor(o){this.properties=o,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const f in o){const E=o[f];E.specification.overridable&&this.overridableProperties.push(f);const L=this.defaultPropertyValues[f]=new lu(E,void 0),V=this.defaultTransitionablePropertyValues[f]=new wu(E);this.defaultTransitioningPropertyValues[f]=V.untransitioned(),this.defaultPossiblyEvaluatedValues[f]=L.possiblyEvaluate({})}}}oi("DataDrivenProperty",ao),oi("DataConstantProperty",ji),oi("CrossFadedDataDrivenProperty",Ic),oi("CrossFadedProperty",Gs),oi("ColorRampProperty",Lc);const Nh="-transition";class xa extends ds{constructor(o,f){if(super(),this.id=o.id,this.type=o.type,this._featureFilter={filter:()=>!0,needGeometry:!1},o.type!=="custom"&&(this.metadata=o.metadata,this.minzoom=o.minzoom,this.maxzoom=o.maxzoom,o.type!=="background"&&(this.source=o.source,this.sourceLayer=o["source-layer"],this.filter=o.filter),f.layout&&(this._unevaluatedLayout=new Qp(f.layout)),f.paint)){this._transitionablePaint=new uh(f.paint);for(const E in o.paint)this.setPaintProperty(E,o.paint[E],{validate:!1});for(const E in o.layout)this.setLayoutProperty(E,o.layout[E],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Si(f.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(o){return o==="visibility"?this.visibility:this._unevaluatedLayout.getValue(o)}setLayoutProperty(o,f,E={}){f!=null&&this._validate(Ul,`layers.${this.id}.layout.${o}`,o,f,E)||(o!=="visibility"?this._unevaluatedLayout.setValue(o,f):this.visibility=f)}getPaintProperty(o){return o.endsWith(Nh)?this._transitionablePaint.getTransition(o.slice(0,-11)):this._transitionablePaint.getValue(o)}setPaintProperty(o,f,E={}){if(f!=null&&this._validate(sh,`layers.${this.id}.paint.${o}`,o,f,E))return!1;if(o.endsWith(Nh))return this._transitionablePaint.setTransition(o.slice(0,-11),f||void 0),!1;{const L=this._transitionablePaint._values[o],V=L.property.specification["property-type"]==="cross-faded-data-driven",X=L.value.isDataDriven(),J=L.value;this._transitionablePaint.setValue(o,f),this._handleSpecialPaintPropertyUpdate(o);const oe=this._transitionablePaint._values[o].value;return oe.isDataDriven()||X||V||this._handleOverridablePaintPropertyUpdate(o,J,oe)}}_handleSpecialPaintPropertyUpdate(o){}_handleOverridablePaintPropertyUpdate(o,f,E){return!1}isHidden(o){return!!(this.minzoom&&o=this.maxzoom)||this.visibility==="none"}updateTransitions(o){this._transitioningPaint=this._transitionablePaint.transitioned(o,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(o,f){o.getCrossfadeParameters&&(this._crossfadeParameters=o.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(o,void 0,f)),this.paint=this._transitioningPaint.possiblyEvaluate(o,void 0,f)}serialize(){const o={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(o.layout=o.layout||{},o.layout.visibility=this.visibility),jt(o,(f,E)=>!(f===void 0||E==="layout"&&!Object.keys(f).length||E==="paint"&&!Object.keys(f).length))}_validate(o,f,E,L,V={}){return(!V||V.validate!==!1)&&ll(this,o.call(ah,{key:f,layerType:this.type,objectKey:E,value:L,styleSpec:Ur,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const o in this.paint._values){const f=this.paint.get(o);if(f instanceof Gi&&th(f.property.specification)&&(f.value.kind==="source"||f.value.kind==="composite")&&f.value.isStateDependent)return!0}return!1}}const Al={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Lu{constructor(o,f){this._structArray=o,this._pos1=f*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ks{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(o,f){return o._trim(),f&&(o.isTransferred=!0,f.push(o.arrayBuffer)),{length:o.length,arrayBuffer:o.arrayBuffer}}static deserialize(o){const f=Object.create(this.prototype);return f.arrayBuffer=o.arrayBuffer,f.length=o.length,f.capacity=o.arrayBuffer.byteLength/f.bytesPerElement,f._refreshViews(),f}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(o){this.reserve(o),this.length=o}reserve(o){if(o>this.capacity){this.capacity=Math.max(o,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const f=this.uint8;this._refreshViews(),f&&this.uint8.set(f)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function _l(c,o=1){let f=0,E=0;return{members:c.map(L=>{const V=Al[L.type].BYTES_PER_ELEMENT,X=f=pc(f,Math.max(o,V)),J=L.components||1;return E=Math.max(E,V),f+=V*J,{name:L.name,type:L.type,components:J,offset:X}}),size:pc(f,Math.max(E,o)),alignment:o}}function pc(c,o){return Math.ceil(c/o)*o}class Du extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,f){const E=this.length;return this.resize(E+1),this.emplace(E,o,f)}emplace(o,f,E){const L=2*o;return this.int16[L+0]=f,this.int16[L+1]=E,o}}Du.prototype.bytesPerElement=4,oi("StructArrayLayout2i4",Du);class zh extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,f,E){const L=this.length;return this.resize(L+1),this.emplace(L,o,f,E)}emplace(o,f,E,L){const V=3*o;return this.int16[V+0]=f,this.int16[V+1]=E,this.int16[V+2]=L,o}}zh.prototype.bytesPerElement=6,oi("StructArrayLayout3i6",zh);class Su extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,f,E,L){const V=this.length;return this.resize(V+1),this.emplace(V,o,f,E,L)}emplace(o,f,E,L,V){const X=4*o;return this.int16[X+0]=f,this.int16[X+1]=E,this.int16[X+2]=L,this.int16[X+3]=V,o}}Su.prototype.bytesPerElement=8,oi("StructArrayLayout4i8",Su);class qc extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V,X){const J=this.length;return this.resize(J+1),this.emplace(J,o,f,E,L,V,X)}emplace(o,f,E,L,V,X,J){const oe=6*o;return this.int16[oe+0]=f,this.int16[oe+1]=E,this.int16[oe+2]=L,this.int16[oe+3]=V,this.int16[oe+4]=X,this.int16[oe+5]=J,o}}qc.prototype.bytesPerElement=12,oi("StructArrayLayout2i4i12",qc);class Sh extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V,X){const J=this.length;return this.resize(J+1),this.emplace(J,o,f,E,L,V,X)}emplace(o,f,E,L,V,X,J){const oe=4*o,me=8*o;return this.int16[oe+0]=f,this.int16[oe+1]=E,this.uint8[me+4]=L,this.uint8[me+5]=V,this.uint8[me+6]=X,this.uint8[me+7]=J,o}}Sh.prototype.bytesPerElement=8,oi("StructArrayLayout2i4ub8",Sh);class nc extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,f){const E=this.length;return this.resize(E+1),this.emplace(E,o,f)}emplace(o,f,E){const L=2*o;return this.float32[L+0]=f,this.float32[L+1]=E,o}}nc.prototype.bytesPerElement=8,oi("StructArrayLayout2f8",nc);class Yl extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V,X,J,oe,me,Me){const De=this.length;return this.resize(De+1),this.emplace(De,o,f,E,L,V,X,J,oe,me,Me)}emplace(o,f,E,L,V,X,J,oe,me,Me,De){const Ye=10*o;return this.uint16[Ye+0]=f,this.uint16[Ye+1]=E,this.uint16[Ye+2]=L,this.uint16[Ye+3]=V,this.uint16[Ye+4]=X,this.uint16[Ye+5]=J,this.uint16[Ye+6]=oe,this.uint16[Ye+7]=me,this.uint16[Ye+8]=Me,this.uint16[Ye+9]=De,o}}Yl.prototype.bytesPerElement=20,oi("StructArrayLayout10ui20",Yl);class Th extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V,X,J,oe,me,Me,De,Ye){const ot=this.length;return this.resize(ot+1),this.emplace(ot,o,f,E,L,V,X,J,oe,me,Me,De,Ye)}emplace(o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot){const lt=12*o;return this.int16[lt+0]=f,this.int16[lt+1]=E,this.int16[lt+2]=L,this.int16[lt+3]=V,this.uint16[lt+4]=X,this.uint16[lt+5]=J,this.uint16[lt+6]=oe,this.uint16[lt+7]=me,this.int16[lt+8]=Me,this.int16[lt+9]=De,this.int16[lt+10]=Ye,this.int16[lt+11]=ot,o}}Th.prototype.bytesPerElement=24,oi("StructArrayLayout4i4ui4i24",Th);class ba extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,f,E){const L=this.length;return this.resize(L+1),this.emplace(L,o,f,E)}emplace(o,f,E,L){const V=3*o;return this.float32[V+0]=f,this.float32[V+1]=E,this.float32[V+2]=L,o}}ba.prototype.bytesPerElement=12,oi("StructArrayLayout3f12",ba);class z extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(o){const f=this.length;return this.resize(f+1),this.emplace(f,o)}emplace(o,f){return this.uint32[1*o+0]=f,o}}z.prototype.bytesPerElement=4,oi("StructArrayLayout1ul4",z);class s extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V,X,J,oe,me){const Me=this.length;return this.resize(Me+1),this.emplace(Me,o,f,E,L,V,X,J,oe,me)}emplace(o,f,E,L,V,X,J,oe,me,Me){const De=10*o,Ye=5*o;return this.int16[De+0]=f,this.int16[De+1]=E,this.int16[De+2]=L,this.int16[De+3]=V,this.int16[De+4]=X,this.int16[De+5]=J,this.uint32[Ye+3]=oe,this.uint16[De+8]=me,this.uint16[De+9]=Me,o}}s.prototype.bytesPerElement=20,oi("StructArrayLayout6i1ul2ui20",s);class x extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V,X){const J=this.length;return this.resize(J+1),this.emplace(J,o,f,E,L,V,X)}emplace(o,f,E,L,V,X,J){const oe=6*o;return this.int16[oe+0]=f,this.int16[oe+1]=E,this.int16[oe+2]=L,this.int16[oe+3]=V,this.int16[oe+4]=X,this.int16[oe+5]=J,o}}x.prototype.bytesPerElement=12,oi("StructArrayLayout2i2i2i12",x);class I extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V){const X=this.length;return this.resize(X+1),this.emplace(X,o,f,E,L,V)}emplace(o,f,E,L,V,X){const J=4*o,oe=8*o;return this.float32[J+0]=f,this.float32[J+1]=E,this.float32[J+2]=L,this.int16[oe+6]=V,this.int16[oe+7]=X,o}}I.prototype.bytesPerElement=16,oi("StructArrayLayout2f1f2i16",I);class k extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,f,E,L){const V=this.length;return this.resize(V+1),this.emplace(V,o,f,E,L)}emplace(o,f,E,L,V){const X=12*o,J=3*o;return this.uint8[X+0]=f,this.uint8[X+1]=E,this.float32[J+1]=L,this.float32[J+2]=V,o}}k.prototype.bytesPerElement=12,oi("StructArrayLayout2ub2f12",k);class H extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,f,E){const L=this.length;return this.resize(L+1),this.emplace(L,o,f,E)}emplace(o,f,E,L){const V=3*o;return this.uint16[V+0]=f,this.uint16[V+1]=E,this.uint16[V+2]=L,o}}H.prototype.bytesPerElement=6,oi("StructArrayLayout3ui6",H);class ee extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot,lt,Ct,Gt,Kt){const Er=this.length;return this.resize(Er+1),this.emplace(Er,o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot,lt,Ct,Gt,Kt)}emplace(o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot,lt,Ct,Gt,Kt,Er){const cr=24*o,Rr=12*o,Qr=48*o;return this.int16[cr+0]=f,this.int16[cr+1]=E,this.uint16[cr+2]=L,this.uint16[cr+3]=V,this.uint32[Rr+2]=X,this.uint32[Rr+3]=J,this.uint32[Rr+4]=oe,this.uint16[cr+10]=me,this.uint16[cr+11]=Me,this.uint16[cr+12]=De,this.float32[Rr+7]=Ye,this.float32[Rr+8]=ot,this.uint8[Qr+36]=lt,this.uint8[Qr+37]=Ct,this.uint8[Qr+38]=Gt,this.uint32[Rr+10]=Kt,this.int16[cr+22]=Er,o}}ee.prototype.bytesPerElement=48,oi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ee);class ne extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot,lt,Ct,Gt,Kt,Er,cr,Rr,Qr,Fn,Ki,Co,$i,Zi,Ri,vo){const Ii=this.length;return this.resize(Ii+1),this.emplace(Ii,o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot,lt,Ct,Gt,Kt,Er,cr,Rr,Qr,Fn,Ki,Co,$i,Zi,Ri,vo)}emplace(o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot,lt,Ct,Gt,Kt,Er,cr,Rr,Qr,Fn,Ki,Co,$i,Zi,Ri,vo,Ii){const ni=32*o,jo=16*o;return this.int16[ni+0]=f,this.int16[ni+1]=E,this.int16[ni+2]=L,this.int16[ni+3]=V,this.int16[ni+4]=X,this.int16[ni+5]=J,this.int16[ni+6]=oe,this.int16[ni+7]=me,this.uint16[ni+8]=Me,this.uint16[ni+9]=De,this.uint16[ni+10]=Ye,this.uint16[ni+11]=ot,this.uint16[ni+12]=lt,this.uint16[ni+13]=Ct,this.uint16[ni+14]=Gt,this.uint16[ni+15]=Kt,this.uint16[ni+16]=Er,this.uint16[ni+17]=cr,this.uint16[ni+18]=Rr,this.uint16[ni+19]=Qr,this.uint16[ni+20]=Fn,this.uint16[ni+21]=Ki,this.uint16[ni+22]=Co,this.uint32[jo+12]=$i,this.float32[jo+13]=Zi,this.float32[jo+14]=Ri,this.uint16[ni+30]=vo,this.uint16[ni+31]=Ii,o}}ne.prototype.bytesPerElement=64,oi("StructArrayLayout8i15ui1ul2f2ui64",ne);class ue extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o){const f=this.length;return this.resize(f+1),this.emplace(f,o)}emplace(o,f){return this.float32[1*o+0]=f,o}}ue.prototype.bytesPerElement=4,oi("StructArrayLayout1f4",ue);class _e extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,f,E){const L=this.length;return this.resize(L+1),this.emplace(L,o,f,E)}emplace(o,f,E,L){const V=3*o;return this.uint16[6*o+0]=f,this.float32[V+1]=E,this.float32[V+2]=L,o}}_e.prototype.bytesPerElement=12,oi("StructArrayLayout1ui2f12",_e);class h extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,f,E){const L=this.length;return this.resize(L+1),this.emplace(L,o,f,E)}emplace(o,f,E,L){const V=4*o;return this.uint32[2*o+0]=f,this.uint16[V+2]=E,this.uint16[V+3]=L,o}}h.prototype.bytesPerElement=8,oi("StructArrayLayout1ul2ui8",h);class g extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,f){const E=this.length;return this.resize(E+1),this.emplace(E,o,f)}emplace(o,f,E){const L=2*o;return this.uint16[L+0]=f,this.uint16[L+1]=E,o}}g.prototype.bytesPerElement=4,oi("StructArrayLayout2ui4",g);class d extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o){const f=this.length;return this.resize(f+1),this.emplace(f,o)}emplace(o,f){return this.uint16[1*o+0]=f,o}}d.prototype.bytesPerElement=2,oi("StructArrayLayout1ui2",d);class b extends ks{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,f,E,L){const V=this.length;return this.resize(V+1),this.emplace(V,o,f,E,L)}emplace(o,f,E,L,V){const X=4*o;return this.float32[X+0]=f,this.float32[X+1]=E,this.float32[X+2]=L,this.float32[X+3]=V,o}}b.prototype.bytesPerElement=16,oi("StructArrayLayout4f16",b);class B extends Lu{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new Ce(this.anchorPointX,this.anchorPointY)}}B.prototype.size=20;class G extends s{get(o){return new B(this,o)}}oi("CollisionBoxArray",G);class q extends Lu{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(o){this._structArray.uint8[this._pos1+37]=o}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(o){this._structArray.uint8[this._pos1+38]=o}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(o){this._structArray.uint32[this._pos4+10]=o}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}q.prototype.size=48;class te extends ee{get(o){return new q(this,o)}}oi("PlacedSymbolArray",te);class fe extends Lu{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(o){this._structArray.uint32[this._pos4+12]=o}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}fe.prototype.size=64;class ce extends ne{get(o){return new fe(this,o)}}oi("SymbolInstanceArray",ce);class Te extends ue{getoffsetX(o){return this.float32[1*o+0]}}oi("GlyphOffsetArray",Te);class Ie extends zh{getx(o){return this.int16[3*o+0]}gety(o){return this.int16[3*o+1]}gettileUnitDistanceFromAnchor(o){return this.int16[3*o+2]}}oi("SymbolLineVertexArray",Ie);class Oe extends Lu{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Oe.prototype.size=12;class Qe extends _e{get(o){return new Oe(this,o)}}oi("TextAnchorOffsetArray",Qe);class nt extends Lu{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}nt.prototype.size=8;class ct extends h{get(o){return new nt(this,o)}}oi("FeatureIndexArray",ct);class tt extends Du{}class Tt extends Du{}class Ut extends Du{}class Nt extends qc{}class pr extends Sh{}class tr extends nc{}class Dr extends Yl{}class Hr extends Th{}class sn extends ba{}class nn extends z{}class Gn extends x{}class di extends k{}class Di extends H{}class Ui extends g{}const ho=_l([{name:"a_pos",components:2,type:"Int16"}],4),{members:gi}=ho;class Wi{constructor(o=[]){this.segments=o}prepareSegment(o,f,E,L){let V=this.segments[this.segments.length-1];return o>Wi.MAX_VERTEX_ARRAY_LENGTH&&rn(`Max vertices per segment is ${Wi.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${o}`),(!V||V.vertexLength+o>Wi.MAX_VERTEX_ARRAY_LENGTH||V.sortKey!==L)&&(V={vertexOffset:f.length,primitiveOffset:E.length,vertexLength:0,primitiveLength:0},L!==void 0&&(V.sortKey=L),this.segments.push(V)),V}get(){return this.segments}destroy(){for(const o of this.segments)for(const f in o.vaos)o.vaos[f].destroy()}static simpleSegment(o,f,E,L){return new Wi([{vertexOffset:o,primitiveOffset:f,vertexLength:E,primitiveLength:L,vaos:{},sortKey:0}])}}function Ko(c,o){return 256*(c=Kn(Math.floor(c),0,255))+Kn(Math.floor(o),0,255)}Wi.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,oi("SegmentVector",Wi);const Mo=_l([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var mo={exports:{}},ko={exports:{}};ko.exports=function(c,o){var f,E,L,V,X,J,oe,me;for(E=c.length-(f=3&c.length),L=o,X=3432918353,J=461845907,me=0;me>>16)*X&65535)<<16)&4294967295)<<15|oe>>>17))*J+(((oe>>>16)*J&65535)<<16)&4294967295)<<13|L>>>19))+((5*(L>>>16)&65535)<<16)&4294967295))+((58964+(V>>>16)&65535)<<16);switch(oe=0,f){case 3:oe^=(255&c.charCodeAt(me+2))<<16;case 2:oe^=(255&c.charCodeAt(me+1))<<8;case 1:L^=oe=(65535&(oe=(oe=(65535&(oe^=255&c.charCodeAt(me)))*X+(((oe>>>16)*X&65535)<<16)&4294967295)<<15|oe>>>17))*J+(((oe>>>16)*J&65535)<<16)&4294967295}return L^=c.length,L=2246822507*(65535&(L^=L>>>16))+((2246822507*(L>>>16)&65535)<<16)&4294967295,L=3266489909*(65535&(L^=L>>>13))+((3266489909*(L>>>16)&65535)<<16)&4294967295,(L^=L>>>16)>>>0};var xo=ko.exports,qi={exports:{}};qi.exports=function(c,o){for(var f,E=c.length,L=o^E,V=0;E>=4;)f=1540483477*(65535&(f=255&c.charCodeAt(V)|(255&c.charCodeAt(++V))<<8|(255&c.charCodeAt(++V))<<16|(255&c.charCodeAt(++V))<<24))+((1540483477*(f>>>16)&65535)<<16),L=1540483477*(65535&L)+((1540483477*(L>>>16)&65535)<<16)^(f=1540483477*(65535&(f^=f>>>24))+((1540483477*(f>>>16)&65535)<<16)),E-=4,++V;switch(E){case 3:L^=(255&c.charCodeAt(V+2))<<16;case 2:L^=(255&c.charCodeAt(V+1))<<8;case 1:L=1540483477*(65535&(L^=255&c.charCodeAt(V)))+((1540483477*(L>>>16)&65535)<<16)}return L=1540483477*(65535&(L^=L>>>13))+((1540483477*(L>>>16)&65535)<<16),(L^=L>>>15)>>>0};var xs=xo,gs=qi.exports;mo.exports=xs,mo.exports.murmur3=xs,mo.exports.murmur2=gs;var Cl=be(mo.exports);class ts{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(o,f,E,L){this.ids.push(ja(o)),this.positions.push(f,E,L)}getPositions(o){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const f=ja(o);let E=0,L=this.ids.length-1;for(;E>1;this.ids[X]>=f?L=X:E=X+1}const V=[];for(;this.ids[E]===f;)V.push({index:this.positions[3*E],start:this.positions[3*E+1],end:this.positions[3*E+2]}),E++;return V}static serialize(o,f){const E=new Float64Array(o.ids),L=new Uint32Array(o.positions);return $a(E,L,0,E.length-1),f&&f.push(E.buffer,L.buffer),{ids:E,positions:L}}static deserialize(o){const f=new ts;return f.ids=o.ids,f.positions=o.positions,f.indexed=!0,f}}function ja(c){const o=+c;return!isNaN(o)&&o<=Number.MAX_SAFE_INTEGER?o:Cl(String(c))}function $a(c,o,f,E){for(;f>1];let V=f-1,X=E+1;for(;;){do V++;while(c[V]L);if(V>=X)break;vs(c,V,X),vs(o,3*V,3*X),vs(o,3*V+1,3*X+1),vs(o,3*V+2,3*X+2)}X-f`u_${L}`),this.type=E}setUniform(o,f,E){o.set(E.constantOr(this.value))}getBinding(o,f,E){return this.type==="color"?new hh(o,f):new zu(o,f)}}class Tu{constructor(o,f){this.uniformNames=f.map(E=>`u_${E}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(o,f){this.pixelRatioFrom=f.pixelRatio,this.pixelRatioTo=o.pixelRatio,this.patternFrom=f.tlbr,this.patternTo=o.tlbr}setUniform(o,f,E,L){const V=L==="u_pattern_to"?this.patternTo:L==="u_pattern_from"?this.patternFrom:L==="u_pixel_ratio_to"?this.pixelRatioTo:L==="u_pixel_ratio_from"?this.pixelRatioFrom:null;V&&o.set(V)}getBinding(o,f,E){return E.substr(0,9)==="u_pattern"?new Uu(o,f):new zu(o,f)}}class Zu{constructor(o,f,E,L){this.expression=o,this.type=E,this.maxValue=0,this.paintVertexAttributes=f.map(V=>({name:`a_${V}`,type:"Float32",components:E==="color"?2:1,offset:0})),this.paintVertexArray=new L}populatePaintArray(o,f,E,L,V){const X=this.paintVertexArray.length,J=this.expression.evaluate(new hs(0),f,{},L,[],V);this.paintVertexArray.resize(o),this._setPaintValue(X,o,J)}updatePaintArray(o,f,E,L){const V=this.expression.evaluate({zoom:0},E,L);this._setPaintValue(o,f,V)}_setPaintValue(o,f,E){if(this.type==="color"){const L=np(E);for(let V=o;V`u_${J}_t`),this.type=E,this.useIntegerZoom=L,this.zoom=V,this.maxValue=0,this.paintVertexAttributes=f.map(J=>({name:`a_${J}`,type:"Float32",components:E==="color"?4:2,offset:0})),this.paintVertexArray=new X}populatePaintArray(o,f,E,L,V){const X=this.expression.evaluate(new hs(this.zoom),f,{},L,[],V),J=this.expression.evaluate(new hs(this.zoom+1),f,{},L,[],V),oe=this.paintVertexArray.length;this.paintVertexArray.resize(o),this._setPaintValue(oe,o,X,J)}updatePaintArray(o,f,E,L){const V=this.expression.evaluate({zoom:this.zoom},E,L),X=this.expression.evaluate({zoom:this.zoom+1},E,L);this._setPaintValue(o,f,V,X)}_setPaintValue(o,f,E,L){if(this.type==="color"){const V=np(E),X=np(L);for(let J=o;J`#define HAS_UNIFORM_${L}`))}return o}getBinderAttributes(){const o=[];for(const f in this.binders){const E=this.binders[f];if(E instanceof Zu||E instanceof Dl)for(let L=0;L!0){this.programConfigurations={};for(const L of o)this.programConfigurations[L.id]=new Uh(L,f,E);this.needsUpload=!1,this._featureMap=new ts,this._bufferOffset=0}populatePaintArrays(o,f,E,L,V,X){for(const J in this.programConfigurations)this.programConfigurations[J].populatePaintArrays(o,f,L,V,X);f.id!==void 0&&this._featureMap.add(f.id,E,this._bufferOffset,o),this._bufferOffset=o,this.needsUpload=!0}updatePaintArrays(o,f,E,L){for(const V of E)this.needsUpload=this.programConfigurations[V.id].updatePaintArrays(o,this._featureMap,f,V,L)||this.needsUpload}get(o){return this.programConfigurations[o]}upload(o){if(this.needsUpload){for(const f in this.programConfigurations)this.programConfigurations[f].upload(o);this.needsUpload=!1}}destroy(){for(const o in this.programConfigurations)this.programConfigurations[o].destroy()}}function $l(c,o){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[c]||[c.replace(`${o}-`,"").replace(/-/g,"_")]}function Vu(c,o,f){const E={color:{source:nc,composite:b},number:{source:ue,composite:nc}},L=function(V){return{"line-pattern":{source:Dr,composite:Dr},"fill-pattern":{source:Dr,composite:Dr},"fill-extrusion-pattern":{source:Dr,composite:Dr}}[V]}(c);return L&&L[f]||E[o][f]}oi("ConstantBinder",pu),oi("CrossFadedConstantBinder",Tu),oi("SourceExpressionBinder",Zu),oi("CrossFadedCompositeBinder",Vl),oi("CompositeExpressionBinder",Dl),oi("ProgramConfiguration",Uh,{omit:["_buffers"]}),oi("ProgramConfigurationSet",ml);const Ws=8192,ju=Math.pow(2,14)-1,os=-ju-1;function yl(c){const o=Ws/c.extent,f=c.loadGeometry();for(let E=0;EX.x+1||oeX.y+1)&&rn("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return f}function Ol(c,o){return{type:c.type,id:c.id,properties:c.properties,geometry:o?yl(c):[]}}function ph(c,o,f,E,L){c.emplaceBack(2*o+(E+1)/2,2*f+(L+1)/2)}class _f{constructor(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(f=>f.id),this.index=o.index,this.hasPattern=!1,this.layoutVertexArray=new Tt,this.indexArray=new Di,this.segments=new Wi,this.programConfigurations=new ml(o.layers,o.zoom),this.stateDependentLayerIds=this.layers.filter(f=>f.isStateDependent()).map(f=>f.id)}populate(o,f,E){const L=this.layers[0],V=[];let X=null,J=!1;L.type==="circle"&&(X=L.layout.get("circle-sort-key"),J=!X.isConstant());for(const{feature:oe,id:me,index:Me,sourceLayerIndex:De}of o){const Ye=this.layers[0]._featureFilter.needGeometry,ot=Ol(oe,Ye);if(!this.layers[0]._featureFilter.filter(new hs(this.zoom),ot,E))continue;const lt=J?X.evaluate(ot,{},E):void 0,Ct={id:me,properties:oe.properties,type:oe.type,sourceLayerIndex:De,index:Me,geometry:Ye?ot.geometry:yl(oe),patterns:{},sortKey:lt};V.push(Ct)}J&&V.sort((oe,me)=>oe.sortKey-me.sortKey);for(const oe of V){const{geometry:me,index:Me,sourceLayerIndex:De}=oe,Ye=o[Me].feature;this.addFeature(oe,me,Me,E),f.featureIndex.insert(Ye,me,Me,De,this.index)}}update(o,f,E){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,f,this.stateDependentLayers,E)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,gi),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(o,f,E,L){for(const V of f)for(const X of V){const J=X.x,oe=X.y;if(J<0||J>=Ws||oe<0||oe>=Ws)continue;const me=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,o.sortKey),Me=me.vertexLength;ph(this.layoutVertexArray,J,oe,-1,-1),ph(this.layoutVertexArray,J,oe,1,-1),ph(this.layoutVertexArray,J,oe,1,1),ph(this.layoutVertexArray,J,oe,-1,1),this.indexArray.emplaceBack(Me,Me+1,Me+2),this.indexArray.emplaceBack(Me,Me+3,Me+2),me.vertexLength+=4,me.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,E,{},L)}}function ip(c,o){for(let f=0;f1){if(fc(c,o))return!0;for(let E=0;E1?f:f.sub(o)._mult(L)._add(o))}function _s(c,o){let f,E,L,V=!1;for(let X=0;Xo.y!=L.y>o.y&&o.x<(L.x-E.x)*(o.y-E.y)/(L.y-E.y)+E.x&&(V=!V)}return V}function Ff(c,o){let f=!1;for(let E=0,L=c.length-1;Eo.y!=X.y>o.y&&o.x<(X.x-V.x)*(o.y-V.y)/(X.y-V.y)+V.x&&(f=!f)}return f}function sd(c,o,f){const E=f[0],L=f[2];if(c.xL.x&&o.x>L.x||c.yL.y&&o.y>L.y)return!1;const V=jn(c,o,f[0]);return V!==jn(c,o,f[1])||V!==jn(c,o,f[2])||V!==jn(c,o,f[3])}function fh(c,o,f){const E=o.paint.get(c).value;return E.kind==="constant"?E.value:f.programConfigurations.get(o.id).getMaxValue(c)}function _d(c){return Math.sqrt(c[0]*c[0]+c[1]*c[1])}function ld(c,o,f,E,L){if(!o[0]&&!o[1])return c;const V=Ce.convert(o)._mult(L);f==="viewport"&&V._rotate(-E);const X=[];for(let J=0;JOd(Gt,Ct))}(me,oe),ot=De?Me*J:Me;for(const lt of L)for(const Ct of lt){const Gt=De?Ct:Od(Ct,oe);let Kt=ot;const Er=Yf([],[Ct.x,Ct.y,0,1],oe);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Kt*=Er[3]/X.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Kt*=X.cameraToCenterDistance/Er[3]),yf(Ye,Gt,Kt))return!0}return!1}}function Od(c,o){const f=Yf([],[c.x,c.y,0,1],o);return new Ce(f[0]/f[3],f[1]/f[3])}class Bd extends _f{}let bf;oi("HeatmapBucket",Bd,{omit:["layers"]});var wp={get paint(){return bf=bf||new ul({"heatmap-radius":new ao(Ur.paint_heatmap["heatmap-radius"]),"heatmap-weight":new ao(Ur.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ji(Ur.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Lc(Ur.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ji(Ur.paint_heatmap["heatmap-opacity"])})}};function $f(c,{width:o,height:f},E,L){if(L){if(L instanceof Uint8ClampedArray)L=new Uint8Array(L.buffer);else if(L.length!==o*f*E)throw new RangeError(`mismatched image size. expected: ${L.length} but got: ${o*f*E}`)}else L=new Uint8Array(o*f*E);return c.width=o,c.height=f,c.data=L,c}function ap(c,{width:o,height:f},E){if(o===c.width&&f===c.height)return;const L=$f({},{width:o,height:f},E);kf(c,L,{x:0,y:0},{x:0,y:0},{width:Math.min(c.width,o),height:Math.min(c.height,f)},E),c.width=o,c.height=f,c.data=L.data}function kf(c,o,f,E,L,V){if(L.width===0||L.height===0)return o;if(L.width>c.width||L.height>c.height||f.x>c.width-L.width||f.y>c.height-L.height)throw new RangeError("out of range source coordinates for image copy");if(L.width>o.width||L.height>o.height||E.x>o.width-L.width||E.y>o.height-L.height)throw new RangeError("out of range destination coordinates for image copy");const X=c.data,J=o.data;if(X===J)throw new Error("srcData equals dstData, so image is already copied");for(let oe=0;oe{o[c.evaluationKey]=oe;const me=c.expression.evaluate(o);L.data[X+J+0]=Math.floor(255*me.r/me.a),L.data[X+J+1]=Math.floor(255*me.g/me.a),L.data[X+J+2]=Math.floor(255*me.b/me.a),L.data[X+J+3]=Math.floor(255*me.a)};if(c.clips)for(let X=0,J=0;X80*f){E=V=c[0],L=X=c[1];for(var lt=f;ltV&&(V=J),oe>X&&(X=oe);me=(me=Math.max(V-E,X-L))!==0?32767/me:0}return _p(Ye,ot,f,E,L,me,0),ot}function yd(c,o,f,E,L){var V,X;if(L===Wu(c,o,f,E)>0)for(V=o;V=o;V-=E)X=Zf(V,c[V],c[V+1],X);return X&&Zh(X,X.next)&&(zp(X),X=X.next),X}function Dc(c,o){if(!c)return c;o||(o=c);var f,E=c;do if(f=!1,E.steiner||!Zh(E,E.next)&&Ou(E.prev,E,E.next)!==0)E=E.next;else{if(zp(E),(E=o=E.prev)===E.next)break;f=!0}while(f||E!==o);return o}function _p(c,o,f,E,L,V,X){if(c){!X&&V&&function(Me,De,Ye,ot){var lt=Me;do lt.z===0&&(lt.z=cd(lt.x,lt.y,De,Ye,ot)),lt.prevZ=lt.prev,lt.nextZ=lt.next,lt=lt.next;while(lt!==Me);lt.prevZ.nextZ=null,lt.prevZ=null,function(Ct){var Gt,Kt,Er,cr,Rr,Qr,Fn,Ki,Co=1;do{for(Kt=Ct,Ct=null,Rr=null,Qr=0;Kt;){for(Qr++,Er=Kt,Fn=0,Gt=0;Gt0||Ki>0&&Er;)Fn!==0&&(Ki===0||!Er||Kt.z<=Er.z)?(cr=Kt,Kt=Kt.nextZ,Fn--):(cr=Er,Er=Er.nextZ,Ki--),Rr?Rr.nextZ=cr:Ct=cr,cr.prevZ=Rr,Rr=cr;Kt=Er}Rr.nextZ=null,Co*=2}while(Qr>1)}(lt)}(c,E,L,V);for(var J,oe,me=c;c.prev!==c.next;)if(J=c.prev,oe=c.next,V?xd(c,E,L,V):Kf(c))o.push(J.i/f|0),o.push(c.i/f|0),o.push(oe.i/f|0),zp(c),c=oe.next,me=oe.next;else if((c=oe)===me){X?X===1?_p(c=bd(Dc(c),o,f),o,f,E,L,V,2):X===2&&Ed(c,o,f,E,L,V):_p(Dc(c),o,f,E,L,V,1);break}}}function Kf(c){var o=c.prev,f=c,E=c.next;if(Ou(o,f,E)>=0)return!1;for(var L=o.x,V=f.x,X=E.x,J=o.y,oe=f.y,me=E.y,Me=LV?L>X?L:X:V>X?V:X,ot=J>oe?J>me?J:me:oe>me?oe:me,lt=E.next;lt!==o;){if(lt.x>=Me&<.x<=Ye&<.y>=De&<.y<=ot&&Uf(L,J,V,oe,X,me,lt.x,lt.y)&&Ou(lt.prev,lt,lt.next)>=0)return!1;lt=lt.next}return!0}function xd(c,o,f,E){var L=c.prev,V=c,X=c.next;if(Ou(L,V,X)>=0)return!1;for(var J=L.x,oe=V.x,me=X.x,Me=L.y,De=V.y,Ye=X.y,ot=Joe?J>me?J:me:oe>me?oe:me,Gt=Me>De?Me>Ye?Me:Ye:De>Ye?De:Ye,Kt=cd(ot,lt,o,f,E),Er=cd(Ct,Gt,o,f,E),cr=c.prevZ,Rr=c.nextZ;cr&&cr.z>=Kt&&Rr&&Rr.z<=Er;){if(cr.x>=ot&&cr.x<=Ct&&cr.y>=lt&&cr.y<=Gt&&cr!==L&&cr!==X&&Uf(J,Me,oe,De,me,Ye,cr.x,cr.y)&&Ou(cr.prev,cr,cr.next)>=0||(cr=cr.prevZ,Rr.x>=ot&&Rr.x<=Ct&&Rr.y>=lt&&Rr.y<=Gt&&Rr!==L&&Rr!==X&&Uf(J,Me,oe,De,me,Ye,Rr.x,Rr.y)&&Ou(Rr.prev,Rr,Rr.next)>=0))return!1;Rr=Rr.nextZ}for(;cr&&cr.z>=Kt;){if(cr.x>=ot&&cr.x<=Ct&&cr.y>=lt&&cr.y<=Gt&&cr!==L&&cr!==X&&Uf(J,Me,oe,De,me,Ye,cr.x,cr.y)&&Ou(cr.prev,cr,cr.next)>=0)return!1;cr=cr.prevZ}for(;Rr&&Rr.z<=Er;){if(Rr.x>=ot&&Rr.x<=Ct&&Rr.y>=lt&&Rr.y<=Gt&&Rr!==L&&Rr!==X&&Uf(J,Me,oe,De,me,Ye,Rr.x,Rr.y)&&Ou(Rr.prev,Rr,Rr.next)>=0)return!1;Rr=Rr.nextZ}return!0}function bd(c,o,f){var E=c;do{var L=E.prev,V=E.next.next;!Zh(L,V)&&lf(L,E,E.next,V)&&pd(L,V)&&pd(V,L)&&(o.push(L.i/f|0),o.push(E.i/f|0),o.push(V.i/f|0),zp(E),zp(E.next),E=c=V),E=E.next}while(E!==c);return Dc(E)}function Ed(c,o,f,E,L,V){var X=c;do{for(var J=X.next.next;J!==X.prev;){if(X.i!==J.i&&sf(X,J)){var oe=yp(X,J);return X=Dc(X,X.next),oe=Dc(oe,oe.next),_p(X,o,f,E,L,V,0),void _p(oe,o,f,E,L,V,0)}J=J.next}X=X.next}while(X!==c)}function Tp(c,o){return c.x-o.x}function Ef(c,o){var f=function(L,V){var X,J=V,oe=L.x,me=L.y,Me=-1/0;do{if(me<=J.y&&me>=J.next.y&&J.next.y!==J.y){var De=J.x+(me-J.y)*(J.next.x-J.x)/(J.next.y-J.y);if(De<=oe&&De>Me&&(Me=De,X=J.x=J.x&&J.x>=lt&&oe!==J.x&&Uf(meX.x||J.x===X.x&&wd(X,J)))&&(X=J,Gt=Ye)),J=J.next;while(J!==ot);return X}(c,o);if(!f)return o;var E=yp(f,c);return Dc(E,E.next),Dc(f,f.next)}function wd(c,o){return Ou(c.prev,c,o.prev)<0&&Ou(o.next,c,c.next)<0}function cd(c,o,f,E,L){return(c=1431655765&((c=858993459&((c=252645135&((c=16711935&((c=(c-f)*L|0)|c<<8))|c<<4))|c<<2))|c<<1))|(o=1431655765&((o=858993459&((o=252645135&((o=16711935&((o=(o-E)*L|0)|o<<8))|o<<4))|o<<2))|o<<1))<<1}function hd(c){var o=c,f=c;do(o.x=(c-X)*(V-J)&&(c-X)*(E-J)>=(f-X)*(o-J)&&(f-X)*(V-J)>=(L-X)*(E-J)}function sf(c,o){return c.next.i!==o.i&&c.prev.i!==o.i&&!function(f,E){var L=f;do{if(L.i!==f.i&&L.next.i!==f.i&&L.i!==E.i&&L.next.i!==E.i&&lf(L,L.next,f,E))return!0;L=L.next}while(L!==f);return!1}(c,o)&&(pd(c,o)&&pd(o,c)&&function(f,E){var L=f,V=!1,X=(f.x+E.x)/2,J=(f.y+E.y)/2;do L.y>J!=L.next.y>J&&L.next.y!==L.y&&X<(L.next.x-L.x)*(J-L.y)/(L.next.y-L.y)+L.x&&(V=!V),L=L.next;while(L!==f);return V}(c,o)&&(Ou(c.prev,c,o.prev)||Ou(c,o.prev,o))||Zh(c,o)&&Ou(c.prev,c,c.next)>0&&Ou(o.prev,o,o.next)>0)}function Ou(c,o,f){return(o.y-c.y)*(f.x-o.x)-(o.x-c.x)*(f.y-o.y)}function Zh(c,o){return c.x===o.x&&c.y===o.y}function lf(c,o,f,E){var L=Np(Ou(c,o,f)),V=Np(Ou(c,o,E)),X=Np(Ou(f,E,c)),J=Np(Ou(f,E,o));return L!==V&&X!==J||!(L!==0||!Ah(c,f,o))||!(V!==0||!Ah(c,E,o))||!(X!==0||!Ah(f,c,E))||!(J!==0||!Ah(f,o,E))}function Ah(c,o,f){return o.x<=Math.max(c.x,f.x)&&o.x>=Math.min(c.x,f.x)&&o.y<=Math.max(c.y,f.y)&&o.y>=Math.min(c.y,f.y)}function Np(c){return c>0?1:c<0?-1:0}function pd(c,o){return Ou(c.prev,c,c.next)<0?Ou(c,o,c.next)>=0&&Ou(c,c.prev,o)>=0:Ou(c,o,c.prev)<0||Ou(c,c.next,o)<0}function yp(c,o){var f=new Oc(c.i,c.x,c.y),E=new Oc(o.i,o.x,o.y),L=c.next,V=o.prev;return c.next=o,o.prev=c,f.next=L,L.prev=f,E.next=f,f.prev=E,V.next=E,E.prev=V,E}function Zf(c,o,f,E){var L=new Oc(c,o,f);return E?(L.next=E.next,L.prev=E,E.next.prev=L,E.next=L):(L.prev=L,L.next=L),L}function zp(c){c.next.prev=c.prev,c.prev.next=c.next,c.prevZ&&(c.prevZ.nextZ=c.nextZ),c.nextZ&&(c.nextZ.prevZ=c.prevZ)}function Oc(c,o,f){this.i=c,this.x=o,this.y=f,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Wu(c,o,f,E){for(var L=0,V=o,X=f-E;V0&&f.holes.push(E+=c[L-1].length)}return f};var Au=be(af.exports);function dh(c,o,f,E,L){rm(c,o,f||0,E||c.length-1,L||nm)}function rm(c,o,f,E,L){for(;E>f;){if(E-f>600){var V=E-f+1,X=o-f+1,J=Math.log(V),oe=.5*Math.exp(2*J/3),me=.5*Math.sqrt(J*oe*(V-oe)/V)*(X-V/2<0?-1:1);rm(c,o,Math.max(f,Math.floor(o-X*oe/V+me)),Math.min(E,Math.floor(o+(V-X)*oe/V+me)),L)}var Me=c[o],De=f,Ye=E;for(Ap(c,f,o),L(c[E],Me)>0&&Ap(c,f,E);De0;)Ye--}L(c[f],Me)===0?Ap(c,f,Ye):Ap(c,++Ye,E),Ye<=o&&(f=Ye+1),o<=Ye&&(E=Ye-1)}}function Ap(c,o,f){var E=c[o];c[o]=c[f],c[f]=E}function nm(c,o){return co?1:0}function Fd(c,o){const f=c.length;if(f<=1)return[c];const E=[];let L,V;for(let X=0;X1)for(let X=0;Xf.id),this.index=o.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ut,this.indexArray=new Di,this.indexArray2=new Ui,this.programConfigurations=new ml(o.layers,o.zoom),this.segments=new Wi,this.segments2=new Wi,this.stateDependentLayerIds=this.layers.filter(f=>f.isStateDependent()).map(f=>f.id)}populate(o,f,E){this.hasPattern=Jf("fill",this.layers,f);const L=this.layers[0].layout.get("fill-sort-key"),V=!L.isConstant(),X=[];for(const{feature:J,id:oe,index:me,sourceLayerIndex:Me}of o){const De=this.layers[0]._featureFilter.needGeometry,Ye=Ol(J,De);if(!this.layers[0]._featureFilter.filter(new hs(this.zoom),Ye,E))continue;const ot=V?L.evaluate(Ye,{},E,f.availableImages):void 0,lt={id:oe,properties:J.properties,type:J.type,sourceLayerIndex:Me,index:me,geometry:De?Ye.geometry:yl(J),patterns:{},sortKey:ot};X.push(lt)}V&&X.sort((J,oe)=>J.sortKey-oe.sortKey);for(const J of X){const{geometry:oe,index:me,sourceLayerIndex:Me}=J;if(this.hasPattern){const De=kd("fill",this.layers,J,this.zoom,f);this.patternFeatures.push(De)}else this.addFeature(J,oe,me,E,{});f.featureIndex.insert(o[me].feature,oe,me,Me,this.index)}}update(o,f,E){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,f,this.stateDependentLayers,E)}addFeatures(o,f,E){for(const L of this.patternFeatures)this.addFeature(L,L.geometry,L.index,f,E)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,of),this.indexBuffer=o.createIndexBuffer(this.indexArray),this.indexBuffer2=o.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(o,f,E,L,V){for(const X of Fd(f,500)){let J=0;for(const ot of X)J+=ot.length;const oe=this.segments.prepareSegment(J,this.layoutVertexArray,this.indexArray),me=oe.vertexLength,Me=[],De=[];for(const ot of X){if(ot.length===0)continue;ot!==X[0]&&De.push(Me.length/2);const lt=this.segments2.prepareSegment(ot.length,this.layoutVertexArray,this.indexArray2),Ct=lt.vertexLength;this.layoutVertexArray.emplaceBack(ot[0].x,ot[0].y),this.indexArray2.emplaceBack(Ct+ot.length-1,Ct),Me.push(ot[0].x),Me.push(ot[0].y);for(let Gt=1;Gt>3}if(L--,E===1||E===2)V+=c.readSVarint(),X+=c.readSVarint(),E===1&&(o&&J.push(o),o=[]),o.push(new zd(V,X));else{if(E!==7)throw new Error("unknown command "+E);o&&o.push(o[0].clone())}}return o&&J.push(o),J},Pe.prototype.bbox=function(){var c=this._pbf;c.pos=this._geometry;for(var o=c.readVarint()+c.pos,f=1,E=0,L=0,V=0,X=1/0,J=-1/0,oe=1/0,me=-1/0;c.pos>3}if(E--,f===1||f===2)(L+=c.readSVarint())J&&(J=L),(V+=c.readSVarint())me&&(me=V);else if(f!==7)throw new Error("unknown command "+f)}return[X,oe,J,me]},Pe.prototype.toGeoJSON=function(c,o,f){var E,L,V=this.extent*Math.pow(2,f),X=this.extent*c,J=this.extent*o,oe=this.loadGeometry(),me=Pe.types[this.type];function Me(ot){for(var lt=0;lt>3;L=X===1?E.readString():X===2?E.readFloat():X===3?E.readDouble():X===4?E.readVarint64():X===5?E.readVarint():X===6?E.readSVarint():X===7?E.readBoolean():null}return L}(f))}Yr.prototype.feature=function(c){if(c<0||c>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[c];var o=this._pbf.readVarint()+this._pbf.pos;return new qr(this._pbf,o,this.extent,this._keys,this._values)};var Wn=wn;function Bn(c,o,f){if(c===3){var E=new Wn(f,f.readVarint()+f.pos);E.length&&(o[E.name]=E)}}cl.VectorTile=function(c,o){this.layers=c.readFields(Bn,{},o)},cl.VectorTileFeature=Fc,cl.VectorTileLayer=wn;const si=cl.VectorTileFeature.types,Hn=Math.pow(2,13);function qn(c,o,f,E,L,V,X,J){c.emplaceBack(o,f,2*Math.floor(E*Hn)+X,L*Hn*2,V*Hn*2,Math.round(J))}class ci{constructor(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(f=>f.id),this.index=o.index,this.hasPattern=!1,this.layoutVertexArray=new Nt,this.centroidVertexArray=new tt,this.indexArray=new Di,this.programConfigurations=new ml(o.layers,o.zoom),this.segments=new Wi,this.stateDependentLayerIds=this.layers.filter(f=>f.isStateDependent()).map(f=>f.id)}populate(o,f,E){this.features=[],this.hasPattern=Jf("fill-extrusion",this.layers,f);for(const{feature:L,id:V,index:X,sourceLayerIndex:J}of o){const oe=this.layers[0]._featureFilter.needGeometry,me=Ol(L,oe);if(!this.layers[0]._featureFilter.filter(new hs(this.zoom),me,E))continue;const Me={id:V,sourceLayerIndex:J,index:X,geometry:oe?me.geometry:yl(L),properties:L.properties,type:L.type,patterns:{}};this.hasPattern?this.features.push(kd("fill-extrusion",this.layers,Me,this.zoom,f)):this.addFeature(Me,Me.geometry,X,E,{}),f.featureIndex.insert(L,Me.geometry,X,J,this.index,!0)}}addFeatures(o,f,E){for(const L of this.features){const{geometry:V}=L;this.addFeature(L,V,L.index,f,E)}}update(o,f,E){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,f,this.stateDependentLayers,E)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,Qf),this.centroidVertexBuffer=o.createVertexBuffer(this.centroidVertexArray,uf.members,!0),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(o,f,E,L,V){const X={x:0,y:0,vertexCount:0};for(const J of Fd(f,500)){let oe=0;for(const lt of J)oe+=lt.length;let me=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const lt of J){if(lt.length===0||Yn(lt))continue;let Ct=0;for(let Gt=0;Gt=1){const Er=lt[Gt-1];if(!Vn(Kt,Er)){me.vertexLength+4>Wi.MAX_VERTEX_ARRAY_LENGTH&&(me=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const cr=Kt.sub(Er)._perp()._unit(),Rr=Er.dist(Kt);Ct+Rr>32768&&(Ct=0),qn(this.layoutVertexArray,Kt.x,Kt.y,cr.x,cr.y,0,0,Ct),qn(this.layoutVertexArray,Kt.x,Kt.y,cr.x,cr.y,0,1,Ct),X.x+=2*Kt.x,X.y+=2*Kt.y,X.vertexCount+=2,Ct+=Rr,qn(this.layoutVertexArray,Er.x,Er.y,cr.x,cr.y,0,0,Ct),qn(this.layoutVertexArray,Er.x,Er.y,cr.x,cr.y,0,1,Ct),X.x+=2*Er.x,X.y+=2*Er.y,X.vertexCount+=2;const Qr=me.vertexLength;this.indexArray.emplaceBack(Qr,Qr+2,Qr+1),this.indexArray.emplaceBack(Qr+1,Qr+2,Qr+3),me.vertexLength+=4,me.primitiveLength+=2}}}}if(me.vertexLength+oe>Wi.MAX_VERTEX_ARRAY_LENGTH&&(me=this.segments.prepareSegment(oe,this.layoutVertexArray,this.indexArray)),si[o.type]!=="Polygon")continue;const Me=[],De=[],Ye=me.vertexLength;for(const lt of J)if(lt.length!==0){lt!==J[0]&&De.push(Me.length/2);for(let Ct=0;CtWs)||c.y===o.y&&(c.y<0||c.y>Ws)}function Yn(c){return c.every(o=>o.x<0)||c.every(o=>o.x>Ws)||c.every(o=>o.y<0)||c.every(o=>o.y>Ws)}let Tr;oi("FillExtrusionBucket",ci,{omit:["layers","features"]});var en={get paint(){return Tr=Tr||new ul({"fill-extrusion-opacity":new ji(Ur["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new ao(Ur["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ji(Ur["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ji(Ur["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ic(Ur["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new ao(Ur["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new ao(Ur["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ji(Ur["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Xn extends xa{constructor(o){super(o,en)}createBucket(o){return new ci(o)}queryRadius(){return _d(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(o,f,E,L,V,X,J,oe){const me=ld(o,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),X.angle,J),Me=this.paint.get("fill-extrusion-height").evaluate(f,E),De=this.paint.get("fill-extrusion-base").evaluate(f,E),Ye=function(lt,Ct,Gt,Kt){const Er=[];for(const cr of lt){const Rr=[cr.x,cr.y,0,1];Yf(Rr,Rr,Ct),Er.push(new Ce(Rr[0]/Rr[3],Rr[1]/Rr[3]))}return Er}(me,oe),ot=function(lt,Ct,Gt,Kt){const Er=[],cr=[],Rr=Kt[8]*Ct,Qr=Kt[9]*Ct,Fn=Kt[10]*Ct,Ki=Kt[11]*Ct,Co=Kt[8]*Gt,$i=Kt[9]*Gt,Zi=Kt[10]*Gt,Ri=Kt[11]*Gt;for(const vo of lt){const Ii=[],ni=[];for(const jo of vo){const Do=jo.x,rs=jo.y,iu=Kt[0]*Do+Kt[4]*rs+Kt[12],tl=Kt[1]*Do+Kt[5]*rs+Kt[13],gc=Kt[2]*Do+Kt[6]*rs+Kt[14],Pp=Kt[3]*Do+Kt[7]*rs+Kt[15],sp=gc+Fn,kc=Pp+Ki,gh=iu+Co,lp=tl+$i,vh=gc+Zi,Ys=Pp+Ri,jl=new Ce((iu+Rr)/kc,(tl+Qr)/kc);jl.z=sp/kc,Ii.push(jl);const _h=new Ce(gh/Ys,lp/Ys);_h.z=vh/Ys,ni.push(_h)}Er.push(Ii),cr.push(ni)}return[Er,cr]}(L,De,Me,oe);return function(lt,Ct,Gt){let Kt=1/0;Hu(Gt,Ct)&&(Kt=Rn(Gt,Ct[0]));for(let Er=0;Erf.id),this.index=o.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(f=>{this.gradients[f.id]={}}),this.layoutVertexArray=new pr,this.layoutVertexArray2=new tr,this.indexArray=new Di,this.programConfigurations=new ml(o.layers,o.zoom),this.segments=new Wi,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(f=>f.isStateDependent()).map(f=>f.id)}populate(o,f,E){this.hasPattern=Jf("line",this.layers,f);const L=this.layers[0].layout.get("line-sort-key"),V=!L.isConstant(),X=[];for(const{feature:J,id:oe,index:me,sourceLayerIndex:Me}of o){const De=this.layers[0]._featureFilter.needGeometry,Ye=Ol(J,De);if(!this.layers[0]._featureFilter.filter(new hs(this.zoom),Ye,E))continue;const ot=V?L.evaluate(Ye,{},E):void 0,lt={id:oe,properties:J.properties,type:J.type,sourceLayerIndex:Me,index:me,geometry:De?Ye.geometry:yl(J),patterns:{},sortKey:ot};X.push(lt)}V&&X.sort((J,oe)=>J.sortKey-oe.sortKey);for(const J of X){const{geometry:oe,index:me,sourceLayerIndex:Me}=J;if(this.hasPattern){const De=kd("line",this.layers,J,this.zoom,f);this.patternFeatures.push(De)}else this.addFeature(J,oe,me,E,{});f.featureIndex.insert(o[me].feature,oe,me,Me,this.index)}}update(o,f,E){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,f,this.stateDependentLayers,E)}addFeatures(o,f,E){for(const L of this.patternFeatures)this.addFeature(L,L.geometry,L.index,f,E)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=o.createVertexBuffer(this.layoutVertexArray2,Ln)),this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,Un),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(o){if(o.properties&&Object.prototype.hasOwnProperty.call(o.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(o.properties,"mapbox_clip_end"))return{start:+o.properties.mapbox_clip_start,end:+o.properties.mapbox_clip_end}}addFeature(o,f,E,L,V){const X=this.layers[0].layout,J=X.get("line-join").evaluate(o,{}),oe=X.get("line-cap"),me=X.get("line-miter-limit"),Me=X.get("line-round-limit");this.lineClips=this.lineFeatureClips(o);for(const De of f)this.addLine(De,o,J,oe,me,Me);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,E,V,L)}addLine(o,f,E,L,V,X){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Kt=0;Kt=2&&o[oe-1].equals(o[oe-2]);)oe--;let me=0;for(;me0;if(Ki&&Kt>me){const Ri=Ye.dist(ot);if(Ri>2*Me){const vo=Ye.sub(Ye.sub(ot)._mult(Me/Ri)._round());this.updateDistance(ot,vo),this.addCurrentVertex(vo,Ct,0,0,De),ot=vo}}const $i=ot&<let Zi=$i?E:J?"butt":L;if($i&&Zi==="round"&&(QrV&&(Zi="bevel"),Zi==="bevel"&&(Qr>2&&(Zi="flipbevel"),Qr100)Er=Gt.mult(-1);else{const Ri=Qr*Ct.add(Gt).mag()/Ct.sub(Gt).mag();Er._perp()._mult(Ri*(Co?-1:1))}this.addCurrentVertex(Ye,Er,0,0,De),this.addCurrentVertex(Ye,Er.mult(-1),0,0,De)}else if(Zi==="bevel"||Zi==="fakeround"){const Ri=-Math.sqrt(Qr*Qr-1),vo=Co?Ri:0,Ii=Co?0:Ri;if(ot&&this.addCurrentVertex(Ye,Ct,vo,Ii,De),Zi==="fakeround"){const ni=Math.round(180*Fn/Math.PI/20);for(let jo=1;jo2*Me){const vo=Ye.add(lt.sub(Ye)._mult(Me/Ri)._round());this.updateDistance(Ye,vo),this.addCurrentVertex(vo,Gt,0,0,De),Ye=vo}}}}addCurrentVertex(o,f,E,L,V,X=!1){const J=f.y*L-f.x,oe=-f.y-f.x*L;this.addHalfVertex(o,f.x+f.y*E,f.y-f.x*E,X,!1,E,V),this.addHalfVertex(o,J,oe,X,!0,-L,V),this.distance>da/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(o,f,E,L,V,X))}addHalfVertex({x:o,y:f},E,L,V,X,J,oe){const me=.5*(this.lineClips?this.scaledDistance*(da-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((o<<1)+(V?1:0),(f<<1)+(X?1:0),Math.round(63*E)+128,Math.round(63*L)+128,1+(J===0?0:J<0?-1:1)|(63&me)<<2,me>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const Me=oe.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Me),oe.primitiveLength++),X?this.e2=Me:this.e1=Me}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(o,f){this.distance+=o.dist(f),this.updateScaledDistance()}}let Zn,Sn;oi("LineBucket",bi,{omit:["layers","patternFeatures"]});var Wt={get paint(){return Sn=Sn||new ul({"line-opacity":new ao(Ur.paint_line["line-opacity"]),"line-color":new ao(Ur.paint_line["line-color"]),"line-translate":new ji(Ur.paint_line["line-translate"]),"line-translate-anchor":new ji(Ur.paint_line["line-translate-anchor"]),"line-width":new ao(Ur.paint_line["line-width"]),"line-gap-width":new ao(Ur.paint_line["line-gap-width"]),"line-offset":new ao(Ur.paint_line["line-offset"]),"line-blur":new ao(Ur.paint_line["line-blur"]),"line-dasharray":new Gs(Ur.paint_line["line-dasharray"]),"line-pattern":new Ic(Ur.paint_line["line-pattern"]),"line-gradient":new Lc(Ur.paint_line["line-gradient"])})},get layout(){return Zn=Zn||new ul({"line-cap":new ji(Ur.layout_line["line-cap"]),"line-join":new ao(Ur.layout_line["line-join"]),"line-miter-limit":new ji(Ur.layout_line["line-miter-limit"]),"line-round-limit":new ji(Ur.layout_line["line-round-limit"]),"line-sort-key":new ao(Ur.layout_line["line-sort-key"])})}};class K extends ao{possiblyEvaluate(o,f){return f=new hs(Math.floor(f.zoom),{now:f.now,fadeDuration:f.fadeDuration,zoomHistory:f.zoomHistory,transition:f.transition}),super.possiblyEvaluate(o,f)}evaluate(o,f,E,L){return f=ki({},f,{zoom:Math.floor(f.zoom)}),super.evaluate(o,f,E,L)}}let Ei;class Ee extends xa{constructor(o){super(o,Wt),this.gradientVersion=0,Ei||(Ei=new K(Wt.paint.properties["line-width"].specification),Ei.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(o){if(o==="line-gradient"){const f=this.gradientExpression();this.stepInterpolant=!!function(E){return E._styleExpression!==void 0}(f)&&f._styleExpression.expression instanceof Nl,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(o,f){super.recalculate(o,f),this.paint._values["line-floorwidth"]=Ei.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,o)}createBucket(o){return new bi(o)}queryRadius(o){const f=o,E=sa(fh("line-width",this,f),fh("line-gap-width",this,f)),L=fh("line-offset",this,f);return E/2+Math.abs(L)+_d(this.paint.get("line-translate"))}queryIntersectsFeature(o,f,E,L,V,X,J){const oe=ld(o,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),X.angle,J),me=J/2*sa(this.paint.get("line-width").evaluate(f,E),this.paint.get("line-gap-width").evaluate(f,E)),Me=this.paint.get("line-offset").evaluate(f,E);return Me&&(L=function(De,Ye){const ot=[];for(let lt=0;lt=3){for(let Gt=0;Gt0?o+2*c:c}const Jo=_l([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Es=_l([{name:"a_projected_pos",components:3,type:"Float32"}],4);_l([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Cu=_l([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);_l([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Bl=_l([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),as=_l([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function fu(c,o,f){return c.sections.forEach(E=>{E.text=function(L,V,X){const J=V.layout.get("text-transform").evaluate(X,{});return J==="uppercase"?L=L.toLocaleUpperCase():J==="lowercase"&&(L=L.toLocaleLowerCase()),Rs.applyArabicShaping&&(L=Rs.applyArabicShaping(L)),L}(E.text,o,f)}),c}_l([{name:"triangle",components:3,type:"Uint16"}]),_l([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),_l([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),_l([{type:"Float32",name:"offsetX"}]),_l([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),_l([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Js={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};var ps=24,du=za,ru=function(c,o,f,E,L){var V,X,J=8*L-E-1,oe=(1<>1,Me=-7,De=f?L-1:0,Ye=f?-1:1,ot=c[o+De];for(De+=Ye,V=ot&(1<<-Me)-1,ot>>=-Me,Me+=J;Me>0;V=256*V+c[o+De],De+=Ye,Me-=8);for(X=V&(1<<-Me)-1,V>>=-Me,Me+=E;Me>0;X=256*X+c[o+De],De+=Ye,Me-=8);if(V===0)V=1-me;else{if(V===oe)return X?NaN:1/0*(ot?-1:1);X+=Math.pow(2,E),V-=me}return(ot?-1:1)*X*Math.pow(2,V-E)},uu=function(c,o,f,E,L,V){var X,J,oe,me=8*V-L-1,Me=(1<>1,Ye=L===23?Math.pow(2,-24)-Math.pow(2,-77):0,ot=E?0:V-1,lt=E?1:-1,Ct=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(J=isNaN(o)?1:0,X=Me):(X=Math.floor(Math.log(o)/Math.LN2),o*(oe=Math.pow(2,-X))<1&&(X--,oe*=2),(o+=X+De>=1?Ye/oe:Ye*Math.pow(2,1-De))*oe>=2&&(X++,oe/=2),X+De>=Me?(J=0,X=Me):X+De>=1?(J=(o*oe-1)*Math.pow(2,L),X+=De):(J=o*Math.pow(2,De-1)*Math.pow(2,L),X=0));L>=8;c[f+ot]=255&J,ot+=lt,J/=256,L-=8);for(X=X<0;c[f+ot]=255&X,ot+=lt,X/=256,me-=8);c[f+ot-lt]|=128*Ct};function za(c){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(c)?c:new Uint8Array(c||0),this.pos=0,this.type=0,this.length=this.buf.length}za.Varint=0,za.Fixed64=1,za.Bytes=2,za.Fixed32=5;var Mu=4294967296,Ca=1/Mu,mu=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");function ss(c){return c.type===za.Bytes?c.readVarint()+c.pos:c.pos+1}function go(c,o,f){return f?4294967296*o+(c>>>0):4294967296*(o>>>0)+(c>>>0)}function ya(c,o,f){var E=o<=16383?1:o<=2097151?2:o<=268435455?3:Math.floor(Math.log(o)/(7*Math.LN2));f.realloc(E);for(var L=f.pos-1;L>=c;L--)f.buf[L+E]=f.buf[L]}function Qo(c,o){for(var f=0;f>>8,c[f+2]=o>>>16,c[f+3]=o>>>24}function Vt(c,o){return(c[o]|c[o+1]<<8|c[o+2]<<16)+(c[o+3]<<24)}za.prototype={destroy:function(){this.buf=null},readFields:function(c,o,f){for(f=f||this.length;this.pos>3,V=this.pos;this.type=7&E,c(L,o,this),this.pos===V&&this.skip(E)}return o},readMessage:function(c,o){return this.readFields(c,o,this.readVarint()+this.pos)},readFixed32:function(){var c=st(this.buf,this.pos);return this.pos+=4,c},readSFixed32:function(){var c=Vt(this.buf,this.pos);return this.pos+=4,c},readFixed64:function(){var c=st(this.buf,this.pos)+st(this.buf,this.pos+4)*Mu;return this.pos+=8,c},readSFixed64:function(){var c=st(this.buf,this.pos)+Vt(this.buf,this.pos+4)*Mu;return this.pos+=8,c},readFloat:function(){var c=ru(this.buf,this.pos,!0,23,4);return this.pos+=4,c},readDouble:function(){var c=ru(this.buf,this.pos,!0,52,8);return this.pos+=8,c},readVarint:function(c){var o,f,E=this.buf;return o=127&(f=E[this.pos++]),f<128?o:(o|=(127&(f=E[this.pos++]))<<7,f<128?o:(o|=(127&(f=E[this.pos++]))<<14,f<128?o:(o|=(127&(f=E[this.pos++]))<<21,f<128?o:function(L,V,X){var J,oe,me=X.buf;if(J=(112&(oe=me[X.pos++]))>>4,oe<128||(J|=(127&(oe=me[X.pos++]))<<3,oe<128)||(J|=(127&(oe=me[X.pos++]))<<10,oe<128)||(J|=(127&(oe=me[X.pos++]))<<17,oe<128)||(J|=(127&(oe=me[X.pos++]))<<24,oe<128)||(J|=(1&(oe=me[X.pos++]))<<31,oe<128))return go(L,J,V);throw new Error("Expected varint not more than 10 bytes")}(o|=(15&(f=E[this.pos]))<<28,c,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var c=this.readVarint();return c%2==1?(c+1)/-2:c/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var c=this.readVarint()+this.pos,o=this.pos;return this.pos=c,c-o>=12&&mu?function(f,E,L){return mu.decode(f.subarray(E,L))}(this.buf,o,c):function(f,E,L){for(var V="",X=E;X239?4:Me>223?3:Me>191?2:1;if(X+Ye>L)break;Ye===1?Me<128&&(De=Me):Ye===2?(192&(J=f[X+1]))==128&&(De=(31&Me)<<6|63&J)<=127&&(De=null):Ye===3?(oe=f[X+2],(192&(J=f[X+1]))==128&&(192&oe)==128&&((De=(15&Me)<<12|(63&J)<<6|63&oe)<=2047||De>=55296&&De<=57343)&&(De=null)):Ye===4&&(oe=f[X+2],me=f[X+3],(192&(J=f[X+1]))==128&&(192&oe)==128&&(192&me)==128&&((De=(15&Me)<<18|(63&J)<<12|(63&oe)<<6|63&me)<=65535||De>=1114112)&&(De=null)),De===null?(De=65533,Ye=1):De>65535&&(De-=65536,V+=String.fromCharCode(De>>>10&1023|55296),De=56320|1023&De),V+=String.fromCharCode(De),X+=Ye}return V}(this.buf,o,c)},readBytes:function(){var c=this.readVarint()+this.pos,o=this.buf.subarray(this.pos,c);return this.pos=c,o},readPackedVarint:function(c,o){if(this.type!==za.Bytes)return c.push(this.readVarint(o));var f=ss(this);for(c=c||[];this.pos127;);else if(o===za.Bytes)this.pos=this.readVarint()+this.pos;else if(o===za.Fixed32)this.pos+=4;else{if(o!==za.Fixed64)throw new Error("Unimplemented type: "+o);this.pos+=8}},writeTag:function(c,o){this.writeVarint(c<<3|o)},realloc:function(c){for(var o=this.length||16;o268435455||c<0?function(o,f){var E,L;if(o>=0?(E=o%4294967296|0,L=o/4294967296|0):(L=~(-o/4294967296),4294967295^(E=~(-o%4294967296))?E=E+1|0:(E=0,L=L+1|0)),o>=18446744073709552e3||o<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");f.realloc(10),function(V,X,J){J.buf[J.pos++]=127&V|128,V>>>=7,J.buf[J.pos++]=127&V|128,V>>>=7,J.buf[J.pos++]=127&V|128,V>>>=7,J.buf[J.pos++]=127&V|128,J.buf[J.pos]=127&(V>>>=7)}(E,0,f),function(V,X){var J=(7&V)<<4;X.buf[X.pos++]|=J|((V>>>=3)?128:0),V&&(X.buf[X.pos++]=127&V|((V>>>=7)?128:0),V&&(X.buf[X.pos++]=127&V|((V>>>=7)?128:0),V&&(X.buf[X.pos++]=127&V|((V>>>=7)?128:0),V&&(X.buf[X.pos++]=127&V|((V>>>=7)?128:0),V&&(X.buf[X.pos++]=127&V)))))}(L,f)}(c,this):(this.realloc(4),this.buf[this.pos++]=127&c|(c>127?128:0),c<=127||(this.buf[this.pos++]=127&(c>>>=7)|(c>127?128:0),c<=127||(this.buf[this.pos++]=127&(c>>>=7)|(c>127?128:0),c<=127||(this.buf[this.pos++]=c>>>7&127))))},writeSVarint:function(c){this.writeVarint(c<0?2*-c-1:2*c)},writeBoolean:function(c){this.writeVarint(!!c)},writeString:function(c){c=String(c),this.realloc(4*c.length),this.pos++;var o=this.pos;this.pos=function(E,L,V){for(var X,J,oe=0;oe55295&&X<57344){if(!J){X>56319||oe+1===L.length?(E[V++]=239,E[V++]=191,E[V++]=189):J=X;continue}if(X<56320){E[V++]=239,E[V++]=191,E[V++]=189,J=X;continue}X=J-55296<<10|X-56320|65536,J=null}else J&&(E[V++]=239,E[V++]=191,E[V++]=189,J=null);X<128?E[V++]=X:(X<2048?E[V++]=X>>6|192:(X<65536?E[V++]=X>>12|224:(E[V++]=X>>18|240,E[V++]=X>>12&63|128),E[V++]=X>>6&63|128),E[V++]=63&X|128)}return V}(this.buf,c,this.pos);var f=this.pos-o;f>=128&&ya(o,f,this),this.pos=o-1,this.writeVarint(f),this.pos+=f},writeFloat:function(c){this.realloc(4),uu(this.buf,c,this.pos,!0,23,4),this.pos+=4},writeDouble:function(c){this.realloc(8),uu(this.buf,c,this.pos,!0,52,8),this.pos+=8},writeBytes:function(c){var o=c.length;this.writeVarint(o),this.realloc(o);for(var f=0;f=128&&ya(f,E,this),this.pos=f-1,this.writeVarint(E),this.pos+=E},writeMessage:function(c,o,f){this.writeTag(c,za.Bytes),this.writeRawMessage(o,f)},writePackedVarint:function(c,o){o.length&&this.writeMessage(c,Qo,o)},writePackedSVarint:function(c,o){o.length&&this.writeMessage(c,Qs,o)},writePackedBoolean:function(c,o){o.length&&this.writeMessage(c,Xr,o)},writePackedFloat:function(c,o){o.length&&this.writeMessage(c,Cp,o)},writePackedDouble:function(c,o){o.length&&this.writeMessage(c,Ft,o)},writePackedFixed32:function(c,o){o.length&&this.writeMessage(c,Mr,o)},writePackedSFixed32:function(c,o){o.length&&this.writeMessage(c,Bi,o)},writePackedFixed64:function(c,o){o.length&&this.writeMessage(c,Ma,o)},writePackedSFixed64:function(c,o){o.length&&this.writeMessage(c,el,o)},writeBytesField:function(c,o){this.writeTag(c,za.Bytes),this.writeBytes(o)},writeFixed32Field:function(c,o){this.writeTag(c,za.Fixed32),this.writeFixed32(o)},writeSFixed32Field:function(c,o){this.writeTag(c,za.Fixed32),this.writeSFixed32(o)},writeFixed64Field:function(c,o){this.writeTag(c,za.Fixed64),this.writeFixed64(o)},writeSFixed64Field:function(c,o){this.writeTag(c,za.Fixed64),this.writeSFixed64(o)},writeVarintField:function(c,o){this.writeTag(c,za.Varint),this.writeVarint(o)},writeSVarintField:function(c,o){this.writeTag(c,za.Varint),this.writeSVarint(o)},writeStringField:function(c,o){this.writeTag(c,za.Bytes),this.writeString(o)},writeFloatField:function(c,o){this.writeTag(c,za.Fixed32),this.writeFloat(o)},writeDoubleField:function(c,o){this.writeTag(c,za.Fixed64),this.writeDouble(o)},writeBooleanField:function(c,o){this.writeVarintField(c,!!o)}};var Br=be(du);const Ir=3;function Jt(c,o,f){c===1&&f.readMessage(sr,o)}function sr(c,o,f){if(c===3){const{id:E,bitmap:L,width:V,height:X,left:J,top:oe,advance:me}=f.readMessage(lr,{});o.push({id:E,bitmap:new xl({width:V+2*Ir,height:X+2*Ir},L),metrics:{width:V,height:X,left:J,top:oe,advance:me}})}}function lr(c,o,f){c===1?o.id=f.readVarint():c===2?o.bitmap=f.readBytes():c===3?o.width=f.readVarint():c===4?o.height=f.readVarint():c===5?o.left=f.readSVarint():c===6?o.top=f.readSVarint():c===7&&(o.advance=f.readVarint())}const Mt=Ir;function Xt(c){let o=0,f=0;for(const X of c)o+=X.w*X.h,f=Math.max(f,X.w);c.sort((X,J)=>J.h-X.h);const E=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(o/.95)),f),h:1/0}];let L=0,V=0;for(const X of c)for(let J=E.length-1;J>=0;J--){const oe=E[J];if(!(X.w>oe.w||X.h>oe.h)){if(X.x=oe.x,X.y=oe.y,V=Math.max(V,X.y+X.h),L=Math.max(L,X.x+X.w),X.w===oe.w&&X.h===oe.h){const me=E.pop();J=0&&E>=o&&Fi[this.text.charCodeAt(E)];E--)f--;this.text=this.text.substring(o,f),this.sectionIndex=this.sectionIndex.slice(o,f)}substring(o,f){const E=new _n;return E.text=this.text.substring(o,f),E.sectionIndex=this.sectionIndex.slice(o,f),E.sections=this.sections,E}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((o,f)=>Math.max(o,this.sections[f].scale),0)}addTextSection(o,f){this.text+=o.text,this.sections.push(vn.forText(o.scale,o.fontStack||f));const E=this.sections.length-1;for(let L=0;L=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Qn(c,o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot,lt,Ct){const Gt=_n.fromFeature(c,L);let Kt;De===R.ai.vertical&&Gt.verticalizePunctuation();const{processBidirectionalText:Er,processStyledBidirectionalText:cr}=Rs;if(Er&&Gt.sections.length===1){Kt=[];const Fn=Er(Gt.toString(),ed(Gt,me,V,o,E,ot,lt));for(const Ki of Fn){const Co=new _n;Co.text=Ki,Co.sections=Gt.sections;for(let $i=0;$i0&&$c>Mh&&(Mh=$c)}else{const Rf=Co[Ss.fontStack],Rp=Rf&&Rf[Rh];if(Rp&&Rp.rect)Vp=Rp.rect,Cf=Rp.metrics;else{const $c=Ki[Ss.fontStack],Vd=$c&&$c[Rh];if(!Vd)continue;Cf=Vd.metrics}Nc=(_h-Ss.scale)*ps}Pf?(Fn.verticalizable=!0,up.push({glyph:Rh,imageName:Mf,x:iu,y:tl+Nc,vertical:Pf,scale:Ss.scale,fontStack:Ss.fontStack,sectionIndex:Ph,metrics:Cf,rect:Vp}),iu+=md*Ss.scale+jo):(up.push({glyph:Rh,imageName:Mf,x:iu,y:tl+Nc,vertical:Pf,scale:Ss.scale,fontStack:Ss.fontStack,sectionIndex:Ph,metrics:Cf,rect:Vp}),iu+=Cf.advance*Ss.scale+jo)}up.length!==0&&(gc=Math.max(iu-jo,gc),Sd(up,0,up.length-1,sp,Mh)),iu=0;const _c=Ri*_h+Mh;xp.lineOffset=Math.max(Mh,vc),tl+=_c,Pp=Math.max(_c,Pp),++kc}var gh;const lp=tl-Tn,{horizontalAlign:vh,verticalAlign:Ys}=Ch(vo);(function(jl,_h,vc,xp,up,Mh,_c,oc,Ss){const Ph=(_h-vc)*up;let Rh=0;Rh=Mh!==_c?-oc*xp-Tn:(-xp*Ss+.5)*_c;for(const Nc of jl)for(const Cf of Nc.positionedGlyphs)Cf.x+=Ph,Cf.y+=Rh})(Fn.positionedLines,sp,vh,Ys,gc,Pp,Ri,lp,Zi.length),Fn.top+=-Ys*lp,Fn.bottom=Fn.top+lp,Fn.left+=-vh*gc,Fn.right=Fn.left+gc}(Qr,o,f,E,Kt,X,J,oe,De,me,Ye,Ct),!function(Fn){for(const Ki of Fn)if(Ki.positionedGlyphs.length!==0)return!1;return!0}(Rr)&&Qr}const Fi={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Vr={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function po(c,o,f,E,L,V){if(o.imageName){const X=E[o.imageName];return X?X.displaySize[0]*o.scale*ps/V+L:0}{const X=f[o.fontStack],J=X&&X[c];return J?J.metrics.advance*o.scale+L:0}}function la(c,o,f,E){const L=Math.pow(c-o,2);return E?c=0;let Me=0;for(let Ye=0;YeX.id),this.index=o.index,this.pixelRatio=o.pixelRatio,this.sourceLayerIndex=o.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=tf([]),this.placementViewportMatrix=tf([]);const f=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Td(this.zoom,f["text-size"]),this.iconSizeData=Td(this.zoom,f["icon-size"]);const E=this.layers[0].layout,L=E.get("symbol-sort-key"),V=E.get("symbol-z-order");this.canOverlap=Sf(E,"text-overlap","text-allow-overlap")!=="never"||Sf(E,"icon-overlap","icon-allow-overlap")!=="never"||E.get("text-ignore-placement")||E.get("icon-ignore-placement"),this.sortFeaturesByKey=V!=="viewport-y"&&!L.isConstant(),this.sortFeaturesByY=(V==="viewport-y"||V==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,E.get("symbol-placement")==="point"&&(this.writingModes=E.get("text-writing-mode").map(X=>R.ai[X])),this.stateDependentLayerIds=this.layers.filter(X=>X.isStateDependent()).map(X=>X.id),this.sourceID=o.sourceID}createArrays(){this.text=new lm(new ml(this.layers,this.zoom,o=>/^text/.test(o))),this.icon=new lm(new ml(this.layers,this.zoom,o=>/^icon/.test(o))),this.glyphOffsetArray=new Te,this.lineVertexArray=new Ie,this.symbolInstances=new ce,this.textAnchorOffsets=new Qe}calculateGlyphDependencies(o,f,E,L,V){for(let X=0;X0)&&(X.value.kind!=="constant"||X.value.value.length>0),Me=oe.value.kind!=="constant"||!!oe.value.value||Object.keys(oe.parameters).length>0,De=V.get("symbol-sort-key");if(this.features=[],!me&&!Me)return;const Ye=f.iconDependencies,ot=f.glyphDependencies,lt=f.availableImages,Ct=new hs(this.zoom);for(const{feature:Gt,id:Kt,index:Er,sourceLayerIndex:cr}of o){const Rr=L._featureFilter.needGeometry,Qr=Ol(Gt,Rr);if(!L._featureFilter.filter(Ct,Qr,E))continue;let Fn,Ki;if(Rr||(Qr.geometry=yl(Gt)),me){const $i=L.getValueAndResolveTokens("text-field",Qr,E,lt),Zi=Fo.factory($i);nu(Zi)&&(this.hasRTLText=!0),(!this.hasRTLText||ql()==="unavailable"||this.hasRTLText&&Rs.isParsed())&&(Fn=fu(Zi,L,Qr))}if(Me){const $i=L.getValueAndResolveTokens("icon-image",Qr,E,lt);Ki=$i instanceof Fa?$i:Fa.fromString($i)}if(!Fn&&!Ki)continue;const Co=this.sortFeaturesByKey?De.evaluate(Qr,{},E):void 0;if(this.features.push({id:Kt,text:Fn,icon:Ki,index:Er,sourceLayerIndex:cr,geometry:Qr.geometry,properties:Gt.properties,type:sm[Gt.type],sortKey:Co}),Ki&&(Ye[Ki.name]=!0),Fn){const $i=X.evaluate(Qr,{},E).join(","),Zi=V.get("text-rotation-alignment")!=="viewport"&&V.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(R.ai.vertical)>=0;for(const Ri of Fn.sections)if(Ri.image)Ye[Ri.image.name]=!0;else{const vo=is(Fn.toString()),Ii=Ri.fontStack||$i,ni=ot[Ii]=ot[Ii]||{};this.calculateGlyphDependencies(Ri.text,ni,Zi,this.allowVerticalPlacement,vo)}}}V.get("symbol-placement")==="line"&&(this.features=function(Gt){const Kt={},Er={},cr=[];let Rr=0;function Qr($i){cr.push(Gt[$i]),Rr++}function Fn($i,Zi,Ri){const vo=Er[$i];return delete Er[$i],Er[Zi]=vo,cr[vo].geometry[0].pop(),cr[vo].geometry[0]=cr[vo].geometry[0].concat(Ri[0]),vo}function Ki($i,Zi,Ri){const vo=Kt[Zi];return delete Kt[Zi],Kt[$i]=vo,cr[vo].geometry[0].shift(),cr[vo].geometry[0]=Ri[0].concat(cr[vo].geometry[0]),vo}function Co($i,Zi,Ri){const vo=Ri?Zi[0][Zi[0].length-1]:Zi[0][0];return`${$i}:${vo.x}:${vo.y}`}for(let $i=0;$i$i.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Gt,Kt)=>Gt.sortKey-Kt.sortKey)}update(o,f,E){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(o,f,this.layers,E),this.icon.programConfigurations.updatePaintArrays(o,f,this.layers,E))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(o){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(o),this.iconCollisionBox.upload(o)),this.text.upload(o,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(o,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(o,f){const E=this.lineVertexArray.length;if(o.segment!==void 0){let L=o.dist(f[o.segment+1]),V=o.dist(f[o.segment]);const X={};for(let J=o.segment+1;J=0;J--)X[J]={x:f[J].x,y:f[J].y,tileUnitDistanceFromAnchor:V},J>0&&(V+=f[J-1].dist(f[J]));for(let J=0;J0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(o,f){const E=o.placedSymbolArray.get(f),L=E.vertexStartIndex+4*E.numGlyphs;for(let V=E.vertexStartIndex;VL[J]-L[oe]||V[oe]-V[J]),X}addToSortKeyRanges(o,f){const E=this.sortKeyRanges[this.sortKeyRanges.length-1];E&&E.sortKey===f?E.symbolInstanceEnd=o+1:this.sortKeyRanges.push({sortKey:f,symbolInstanceStart:o,symbolInstanceEnd:o+1})}sortFeatures(o){if(this.sortFeaturesByY&&this.sortedAngle!==o&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(o),this.sortedAngle=o,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const f of this.symbolInstanceIndexes){const E=this.symbolInstances.get(f);this.featureSortOrder.push(E.featureIndex),[E.rightJustifiedTextSymbolIndex,E.centerJustifiedTextSymbolIndex,E.leftJustifiedTextSymbolIndex].forEach((L,V,X)=>{L>=0&&X.indexOf(L)===V&&this.addIndicesForPlacedSymbol(this.text,L)}),E.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,E.verticalPlacedTextSymbolIndex),E.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,E.placedIconSymbolIndex),E.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,E.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let bm,Nr;oi("SymbolBucket",rd,{omit:["layers","collisionBoxArray","features","compareText"]}),rd.MAX_GLYPHS=65535,rd.addDynamicAttributes=Bu;var um={get paint(){return Nr=Nr||new ul({"icon-opacity":new ao(Ur.paint_symbol["icon-opacity"]),"icon-color":new ao(Ur.paint_symbol["icon-color"]),"icon-halo-color":new ao(Ur.paint_symbol["icon-halo-color"]),"icon-halo-width":new ao(Ur.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ao(Ur.paint_symbol["icon-halo-blur"]),"icon-translate":new ji(Ur.paint_symbol["icon-translate"]),"icon-translate-anchor":new ji(Ur.paint_symbol["icon-translate-anchor"]),"text-opacity":new ao(Ur.paint_symbol["text-opacity"]),"text-color":new ao(Ur.paint_symbol["text-color"],{runtimeType:Za,getOverride:c=>c.textColor,hasOverride:c=>!!c.textColor}),"text-halo-color":new ao(Ur.paint_symbol["text-halo-color"]),"text-halo-width":new ao(Ur.paint_symbol["text-halo-width"]),"text-halo-blur":new ao(Ur.paint_symbol["text-halo-blur"]),"text-translate":new ji(Ur.paint_symbol["text-translate"]),"text-translate-anchor":new ji(Ur.paint_symbol["text-translate-anchor"])})},get layout(){return bm=bm||new ul({"symbol-placement":new ji(Ur.layout_symbol["symbol-placement"]),"symbol-spacing":new ji(Ur.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ji(Ur.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ao(Ur.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ji(Ur.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ji(Ur.layout_symbol["icon-allow-overlap"]),"icon-overlap":new ji(Ur.layout_symbol["icon-overlap"]),"icon-ignore-placement":new ji(Ur.layout_symbol["icon-ignore-placement"]),"icon-optional":new ji(Ur.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ji(Ur.layout_symbol["icon-rotation-alignment"]),"icon-size":new ao(Ur.layout_symbol["icon-size"]),"icon-text-fit":new ji(Ur.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ji(Ur.layout_symbol["icon-text-fit-padding"]),"icon-image":new ao(Ur.layout_symbol["icon-image"]),"icon-rotate":new ao(Ur.layout_symbol["icon-rotate"]),"icon-padding":new ao(Ur.layout_symbol["icon-padding"]),"icon-keep-upright":new ji(Ur.layout_symbol["icon-keep-upright"]),"icon-offset":new ao(Ur.layout_symbol["icon-offset"]),"icon-anchor":new ao(Ur.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ji(Ur.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ji(Ur.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ji(Ur.layout_symbol["text-rotation-alignment"]),"text-field":new ao(Ur.layout_symbol["text-field"]),"text-font":new ao(Ur.layout_symbol["text-font"]),"text-size":new ao(Ur.layout_symbol["text-size"]),"text-max-width":new ao(Ur.layout_symbol["text-max-width"]),"text-line-height":new ji(Ur.layout_symbol["text-line-height"]),"text-letter-spacing":new ao(Ur.layout_symbol["text-letter-spacing"]),"text-justify":new ao(Ur.layout_symbol["text-justify"]),"text-radial-offset":new ao(Ur.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ji(Ur.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new ao(Ur.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new ao(Ur.layout_symbol["text-anchor"]),"text-max-angle":new ji(Ur.layout_symbol["text-max-angle"]),"text-writing-mode":new ji(Ur.layout_symbol["text-writing-mode"]),"text-rotate":new ao(Ur.layout_symbol["text-rotate"]),"text-padding":new ji(Ur.layout_symbol["text-padding"]),"text-keep-upright":new ji(Ur.layout_symbol["text-keep-upright"]),"text-transform":new ao(Ur.layout_symbol["text-transform"]),"text-offset":new ao(Ur.layout_symbol["text-offset"]),"text-allow-overlap":new ji(Ur.layout_symbol["text-allow-overlap"]),"text-overlap":new ji(Ur.layout_symbol["text-overlap"]),"text-ignore-placement":new ji(Ur.layout_symbol["text-ignore-placement"]),"text-optional":new ji(Ur.layout_symbol["text-optional"])})}};class Tf{constructor(o){if(o.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=o.property.overrides?o.property.overrides.runtimeType:wa,this.defaultValue=o}evaluate(o){if(o.formattedSection){const f=this.defaultValue.property.overrides;if(f&&f.hasOverride(o.formattedSection))return f.getOverride(o.formattedSection)}return o.feature&&o.featureState?this.defaultValue.evaluate(o.feature,o.featureState):this.defaultValue.property.specification.default}eachChild(o){this.defaultValue.isConstant()||o(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}oi("FormatSectionOverride",Tf,{omit:["defaultValue"]});class Mp extends xa{constructor(o){super(o,um)}recalculate(o,f){if(super.recalculate(o,f),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const E=this.layout.get("text-writing-mode");if(E){const L=[];for(const V of E)L.indexOf(V)<0&&L.push(V);this.layout._values["text-writing-mode"]=L}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(o,f,E,L){const V=this.layout.get(o).evaluate(f,{},E,L),X=this._unevaluatedLayout._values[o];return X.isDataDriven()||Bs(X.value)||!V?V:function(J,oe){return oe.replace(/{([^{}]+)}/g,(me,Me)=>J&&Me in J?String(J[Me]):"")}(f.properties,V)}createBucket(o){return new rd(o)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const o of um.paint.overridableProperties){if(!Mp.hasPaintOverride(this.layout,o))continue;const f=this.paint.get(o),E=new Tf(f),L=new es(E,f.property.specification);let V=null;V=f.value.kind==="constant"||f.value.kind==="source"?new qp("source",L):new Sc("composite",L,f.value.zoomStops),this.paint._values[o]=new Gi(f.property,V,f.parameters)}}_handleOverridablePaintPropertyUpdate(o,f,E){return!(!this.layout||f.isDataDriven()||E.isDataDriven())&&Mp.hasPaintOverride(this.layout,o)}static hasPaintOverride(o,f){const E=o.get("text-field"),L=um.paint.properties[f];let V=!1;const X=J=>{for(const oe of J)if(L.overrides&&L.overrides.hasOverride(oe))return void(V=!0)};if(E.value.kind==="constant"&&E.value.value instanceof Fo)X(E.value.value.sections);else if(E.value.kind==="source"){const J=me=>{V||(me instanceof il&&oa(me.value)===Lt?X(me.value.sections):me instanceof Uc?X(me.sections):me.eachChild(J))},oe=E.value;oe._styleExpression&&J(oe._styleExpression.expression)}return V}}let Bm;var Kr={get paint(){return Bm=Bm||new ul({"background-color":new ji(Ur.paint_background["background-color"]),"background-pattern":new Gs(Ur.paint_background["background-pattern"]),"background-opacity":new ji(Ur.paint_background["background-opacity"])})}};class cm extends xa{constructor(o){super(o,Kr)}}let Af;var hm={get paint(){return Af=Af||new ul({"raster-opacity":new ji(Ur.paint_raster["raster-opacity"]),"raster-hue-rotate":new ji(Ur.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ji(Ur.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ji(Ur.paint_raster["raster-brightness-max"]),"raster-saturation":new ji(Ur.paint_raster["raster-saturation"]),"raster-contrast":new ji(Ur.paint_raster["raster-contrast"]),"raster-resampling":new ji(Ur.paint_raster["raster-resampling"]),"raster-fade-duration":new ji(Ur.paint_raster["raster-fade-duration"])})}};class Em extends xa{constructor(o){super(o,hm)}}class wm extends xa{constructor(o){super(o,{}),this.onAdd=f=>{this.implementation.onAdd&&this.implementation.onAdd(f,f.painter.context.gl)},this.onRemove=f=>{this.implementation.onRemove&&this.implementation.onRemove(f,f.painter.context.gl)},this.implementation=o}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Md{constructor(o){this._callback=o,this._triggered=!1,typeof MessageChannel!="undefined"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const cf=63710088e-1;class nd{constructor(o,f){if(isNaN(o)||isNaN(f))throw new Error(`Invalid LngLat object: (${o}, ${f})`);if(this.lng=+o,this.lat=+f,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new nd(Jn(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(o){const f=Math.PI/180,E=this.lat*f,L=o.lat*f,V=Math.sin(E)*Math.sin(L)+Math.cos(E)*Math.cos(L)*Math.cos((o.lng-this.lng)*f);return cf*Math.acos(Math.min(V,1))}static convert(o){if(o instanceof nd)return o;if(Array.isArray(o)&&(o.length===2||o.length===3))return new nd(Number(o[0]),Number(o[1]));if(!Array.isArray(o)&&typeof o=="object"&&o!==null)return new nd(Number("lng"in o?o.lng:o.lon),Number(o.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const Sm=2*Math.PI*cf;function qm(c){return Sm*Math.cos(c*Math.PI/180)}function mc(c){return(180+c)/360}function mh(c){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+c*Math.PI/360)))/360}function Zd(c,o){return c/qm(o)}function i(c){return 360*c-180}function l(c){return 360/Math.PI*Math.atan(Math.exp((180-360*c)*Math.PI/180))-90}class _{constructor(o,f,E=0){this.x=+o,this.y=+f,this.z=+E}static fromLngLat(o,f=0){const E=nd.convert(o);return new _(mc(E.lng),mh(E.lat),Zd(f,E.lat))}toLngLat(){return new nd(i(this.x),l(this.y))}toAltitude(){return this.z*qm(l(this.y))}meterInMercatorCoordinateUnits(){return 1/Sm*(o=l(this.y),1/Math.cos(o*Math.PI/180));var o}}function S(c,o,f){var E=2*Math.PI*6378137/256/Math.pow(2,f);return[c*E-2*Math.PI*6378137/2,o*E-2*Math.PI*6378137/2]}class F{constructor(o,f,E){if(o<0||o>25||E<0||E>=Math.pow(2,o)||f<0||f>=Math.pow(2,o))throw new Error(`x=${f}, y=${E}, z=${o} outside of bounds. 0<=x<${Math.pow(2,o)}, 0<=y<${Math.pow(2,o)} 0<=z<=25 `);this.z=o,this.x=f,this.y=E,this.key=v(0,o,o,f,E)}equals(o){return this.z===o.z&&this.x===o.x&&this.y===o.y}url(o,f,E){const L=(X=this.y,J=this.z,oe=S(256*(V=this.x),256*(X=Math.pow(2,J)-X-1),J),me=S(256*(V+1),256*(X+1),J),oe[0]+","+oe[1]+","+me[0]+","+me[1]);var V,X,J,oe,me;const Me=function(De,Ye,ot){let lt,Ct="";for(let Gt=De;Gt>0;Gt--)lt=1<1?"@2x":"").replace(/{quadkey}/g,Me).replace(/{bbox-epsg-3857}/g,L)}isChildOf(o){const f=this.z-o.z;return f>0&&o.x===this.x>>f&&o.y===this.y>>f}getTilePoint(o){const f=Math.pow(2,this.z);return new Ce((o.x*f-this.x)*Ws,(o.y*f-this.y)*Ws)}toString(){return`${this.z}/${this.x}/${this.y}`}}class j{constructor(o,f){this.wrap=o,this.canonical=f,this.key=v(o,f.z,f.z,f.x,f.y)}}class p{constructor(o,f,E,L,V){if(o= z; overscaledZ = ${o}; z = ${E}`);this.overscaledZ=o,this.wrap=f,this.canonical=new F(E,+L,+V),this.key=v(f,o,E,L,V)}clone(){return new p(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(o){return this.overscaledZ===o.overscaledZ&&this.wrap===o.wrap&&this.canonical.equals(o.canonical)}scaledTo(o){if(o>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${o}; overscaledZ = ${this.overscaledZ}`);const f=this.canonical.z-o;return o>this.canonical.z?new p(o,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new p(o,this.wrap,o,this.canonical.x>>f,this.canonical.y>>f)}calculateScaledKey(o,f){if(o>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${o}; overscaledZ = ${this.overscaledZ}`);const E=this.canonical.z-o;return o>this.canonical.z?v(this.wrap*+f,o,this.canonical.z,this.canonical.x,this.canonical.y):v(this.wrap*+f,o,o,this.canonical.x>>E,this.canonical.y>>E)}isChildOf(o){if(o.wrap!==this.wrap)return!1;const f=this.canonical.z-o.canonical.z;return o.overscaledZ===0||o.overscaledZ>f&&o.canonical.y===this.canonical.y>>f}children(o){if(this.overscaledZ>=o)return[new p(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const f=this.canonical.z+1,E=2*this.canonical.x,L=2*this.canonical.y;return[new p(f,this.wrap,f,E,L),new p(f,this.wrap,f,E+1,L),new p(f,this.wrap,f,E,L+1),new p(f,this.wrap,f,E+1,L+1)]}isLessThan(o){return this.wrapo.wrap)&&(this.overscaledZo.overscaledZ)&&(this.canonical.xo.canonical.x)&&this.canonical.ythis.max&&(this.max=De),De=this.dim+1||f<-1||f>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(f+1)*this.stride+(o+1)}unpack(o,f,E){return o*this.redFactor+f*this.greenFactor+E*this.blueFactor-this.baseShift}getPixels(){return new dc({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(o,f,E){if(this.dim!==o.dim)throw new Error("dem dimension mismatch");let L=f*this.dim,V=f*this.dim+this.dim,X=E*this.dim,J=E*this.dim+this.dim;switch(f){case-1:L=V-1;break;case 1:V=L+1}switch(E){case-1:X=J-1;break;case 1:J=X+1}const oe=-f*this.dim,me=-E*this.dim;for(let Me=X;Me=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${o} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[o]}}class D{constructor(o,f,E,L,V){this.type="Feature",this._vectorTileFeature=o,o._z=f,o._x=E,o._y=L,this.properties=o.properties,this.id=V}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(o){this._geometry=o}toJSON(){const o={geometry:this.geometry};for(const f in this)f!=="_geometry"&&f!=="_vectorTileFeature"&&(o[f]=this[f]);return o}}class N{constructor(o,f){this.tileID=o,this.x=o.canonical.x,this.y=o.canonical.y,this.z=o.canonical.z,this.grid=new Wc(Ws,16,0),this.grid3D=new Wc(Ws,16,0),this.featureIndexArray=new ct,this.promoteId=f}insert(o,f,E,L,V,X){const J=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(E,L,V);const oe=X?this.grid3D:this.grid;for(let me=0;me=0&&De[3]>=0&&oe.insert(J,De[0],De[1],De[2],De[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new cl.VectorTile(new Br(this.rawTileData)).layers,this.sourceLayerCoder=new w(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(o,f,E,L){this.loadVTLayers();const V=o.params||{},X=Ws/o.tileSize/o.scale,J=bh(V.filter),oe=o.queryGeometry,me=o.queryPadding*X,Me=$(oe),De=this.grid.query(Me.minX-me,Me.minY-me,Me.maxX+me,Me.maxY+me),Ye=$(o.cameraQueryGeometry),ot=this.grid3D.query(Ye.minX-me,Ye.minY-me,Ye.maxX+me,Ye.maxY+me,(Gt,Kt,Er,cr)=>function(Rr,Qr,Fn,Ki,Co){for(const Zi of Rr)if(Qr<=Zi.x&&Fn<=Zi.y&&Ki>=Zi.x&&Co>=Zi.y)return!0;const $i=[new Ce(Qr,Fn),new Ce(Qr,Co),new Ce(Ki,Co),new Ce(Ki,Fn)];if(Rr.length>2){for(const Zi of $i)if(Ff(Rr,Zi))return!0}for(let Zi=0;Zi(cr||(cr=yl(Rr)),Qr.queryIntersectsFeature(oe,Rr,Fn,cr,this.z,o.transform,X,o.pixelPosMatrix)))}return lt}loadMatchingFeature(o,f,E,L,V,X,J,oe,me,Me,De){const Ye=this.bucketLayerIDs[f];if(X&&!function(Gt,Kt){for(let Er=0;Er=0)return!0;return!1}(X,Ye))return;const ot=this.sourceLayerCoder.decode(E),lt=this.vtLayers[ot].feature(L);if(V.needGeometry){const Gt=Ol(lt,!0);if(!V.filter(new hs(this.tileID.overscaledZ),Gt,this.tileID.canonical))return}else if(!V.filter(new hs(this.tileID.overscaledZ),lt))return;const Ct=this.getId(lt,ot);for(let Gt=0;Gt{const J=o instanceof Si?o.get(X):null;return J&&J.evaluate?J.evaluate(f,E,L):J})}function $(c){let o=1/0,f=1/0,E=-1/0,L=-1/0;for(const V of c)o=Math.min(o,V.x),f=Math.min(f,V.y),E=Math.max(E,V.x),L=Math.max(L,V.y);return{minX:o,minY:f,maxX:E,maxY:L}}function ie(c,o){return o-c}function pe(c,o,f,E,L){const V=[];for(let X=0;X=E&&De.x>=E||(Me.x>=E?Me=new Ce(E,Me.y+(E-Me.x)/(De.x-Me.x)*(De.y-Me.y))._round():De.x>=E&&(De=new Ce(E,Me.y+(E-Me.x)/(De.x-Me.x)*(De.y-Me.y))._round()),Me.y>=L&&De.y>=L||(Me.y>=L?Me=new Ce(Me.x+(L-Me.y)/(De.y-Me.y)*(De.x-Me.x),L)._round():De.y>=L&&(De=new Ce(Me.x+(L-Me.y)/(De.y-Me.y)*(De.x-Me.x),L)._round()),oe&&Me.equals(oe[oe.length-1])||(oe=[Me],V.push(oe)),oe.push(De)))))}}return V}oi("FeatureIndex",N,{omit:["rawTileData","sourceLayerCoder"]});class we extends Ce{constructor(o,f,E,L){super(o,f),this.angle=E,L!==void 0&&(this.segment=L)}clone(){return new we(this.x,this.y,this.angle,this.segment)}}function ke(c,o,f,E,L){if(o.segment===void 0||f===0)return!0;let V=o,X=o.segment+1,J=0;for(;J>-f/2;){if(X--,X<0)return!1;J-=c[X].dist(V),V=c[X]}J+=c[X].dist(c[X+1]),X++;const oe=[];let me=0;for(;JE;)me-=oe.shift().angleDelta;if(me>L)return!1;X++,J+=Me.dist(De)}return!0}function Ge(c){let o=0;for(let f=0;fme){const lt=(me-oe)/ot,Ct=Tl.number(De.x,Ye.x,lt),Gt=Tl.number(De.y,Ye.y,lt),Kt=new we(Ct,Gt,Ye.angleTo(De),Me);return Kt._round(),!X||ke(c,Kt,J,X,o)?Kt:void 0}oe+=ot}}function xt(c,o,f,E,L,V,X,J,oe){const me=ht(E,V,X),Me=mt(E,L),De=Me*X,Ye=c[0].x===0||c[0].x===oe||c[0].y===0||c[0].y===oe;return o-De=0&&Rr=0&&Qr=0&&Ye+me<=Me){const Fn=new we(Rr,Qr,Er,lt);Fn._round(),E&&!ke(c,Fn,V,E,L)||ot.push(Fn)}}De+=Kt}return J||ot.length||X||(ot=bt(c,De/2,f,E,L,V,X,!0,oe)),ot}oi("Anchor",we);const kt=pt;function ft(c,o,f,E){const L=[],V=c.image,X=V.pixelRatio,J=V.paddedRect.w-2*kt,oe=V.paddedRect.h-2*kt,me=c.right-c.left,Me=c.bottom-c.top,De=V.stretchX||[[0,J]],Ye=V.stretchY||[[0,oe]],ot=(Ri,vo)=>Ri+vo[1]-vo[0],lt=De.reduce(ot,0),Ct=Ye.reduce(ot,0),Gt=J-lt,Kt=oe-Ct;let Er=0,cr=lt,Rr=0,Qr=Ct,Fn=0,Ki=Gt,Co=0,$i=Kt;if(V.content&&E){const Ri=V.content;Er=nr(De,0,Ri[0]),Rr=nr(Ye,0,Ri[1]),cr=nr(De,Ri[0],Ri[2]),Qr=nr(Ye,Ri[1],Ri[3]),Fn=Ri[0]-Er,Co=Ri[1]-Rr,Ki=Ri[2]-Ri[0]-cr,$i=Ri[3]-Ri[1]-Qr}const Zi=(Ri,vo,Ii,ni)=>{const jo=Pr(Ri.stretch-Er,cr,me,c.left),Do=Mn(Ri.fixed-Fn,Ki,Ri.stretch,lt),rs=Pr(vo.stretch-Rr,Qr,Me,c.top),iu=Mn(vo.fixed-Co,$i,vo.stretch,Ct),tl=Pr(Ii.stretch-Er,cr,me,c.left),gc=Mn(Ii.fixed-Fn,Ki,Ii.stretch,lt),Pp=Pr(ni.stretch-Rr,Qr,Me,c.top),sp=Mn(ni.fixed-Co,$i,ni.stretch,Ct),kc=new Ce(jo,rs),gh=new Ce(tl,rs),lp=new Ce(tl,Pp),vh=new Ce(jo,Pp),Ys=new Ce(Do/X,iu/X),jl=new Ce(gc/X,sp/X),_h=o*Math.PI/180;if(_h){const up=Math.sin(_h),Mh=Math.cos(_h),_c=[Mh,-up,up,Mh];kc._matMult(_c),gh._matMult(_c),vh._matMult(_c),lp._matMult(_c)}const vc=Ri.stretch+Ri.fixed,xp=vo.stretch+vo.fixed;return{tl:kc,tr:gh,bl:vh,br:lp,tex:{x:V.paddedRect.x+kt+vc,y:V.paddedRect.y+kt+xp,w:Ii.stretch+Ii.fixed-vc,h:ni.stretch+ni.fixed-xp},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Ys,pixelOffsetBR:jl,minFontScaleX:Ki/X/me,minFontScaleY:$i/X/Me,isSDF:f}};if(E&&(V.stretchX||V.stretchY)){const Ri=br(De,Gt,lt),vo=br(Ye,Kt,Ct);for(let Ii=0;Ii0&&(lt=Math.max(10,lt),this.circleDiameter=lt)}else{let De=X.top*J-oe[0],Ye=X.bottom*J+oe[2],ot=X.left*J-oe[3],lt=X.right*J+oe[1];const Ct=X.collisionPadding;if(Ct&&(ot-=Ct[0]*J,De-=Ct[1]*J,lt+=Ct[2]*J,Ye+=Ct[3]*J),Me){const Gt=new Ce(ot,De),Kt=new Ce(lt,De),Er=new Ce(ot,Ye),cr=new Ce(lt,Ye),Rr=Me*Math.PI/180;Gt._rotate(Rr),Kt._rotate(Rr),Er._rotate(Rr),cr._rotate(Rr),ot=Math.min(Gt.x,Kt.x,Er.x,cr.x),lt=Math.max(Gt.x,Kt.x,Er.x,cr.x),De=Math.min(Gt.y,Kt.y,Er.y,cr.y),Ye=Math.max(Gt.y,Kt.y,Er.y,cr.y)}o.emplaceBack(f.x,f.y,ot,De,lt,Ye,E,L,V)}this.boxEndIndex=o.length}}class kr{constructor(o=[],f=Ai){if(this.data=o,this.length=this.data.length,this.compare=f,this.length>0)for(let E=(this.length>>1)-1;E>=0;E--)this._down(E)}push(o){this.data.push(o),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const o=this.data[0],f=this.data.pop();return this.length--,this.length>0&&(this.data[0]=f,this._down(0)),o}peek(){return this.data[0]}_up(o){const{data:f,compare:E}=this,L=f[o];for(;o>0;){const V=o-1>>1,X=f[V];if(E(L,X)>=0)break;f[o]=X,o=V}f[o]=L}_down(o){const{data:f,compare:E}=this,L=this.length>>1,V=f[o];for(;o=0)break;f[o]=J,o=X}f[o]=V}}function Ai(c,o){return co?1:0}function $n(c,o=1,f=!1){let E=1/0,L=1/0,V=-1/0,X=-1/0;const J=c[0];for(let ot=0;otV)&&(V=lt.x),(!ot||lt.y>X)&&(X=lt.y)}const oe=Math.min(V-E,X-L);let me=oe/2;const Me=new kr([],ti);if(oe===0)return new Ce(E,L);for(let ot=E;otDe.d||!De.d)&&(De=ot,f&&console.log("found best %d after %d probes",Math.round(1e4*ot.d)/1e4,Ye)),ot.max-De.d<=o||(me=ot.h/2,Me.push(new ri(ot.p.x-me,ot.p.y-me,me,c)),Me.push(new ri(ot.p.x+me,ot.p.y-me,me,c)),Me.push(new ri(ot.p.x-me,ot.p.y+me,me,c)),Me.push(new ri(ot.p.x+me,ot.p.y+me,me,c)),Ye+=4)}return f&&(console.log(`num probes: ${Ye}`),console.log(`best distance: ${De.d}`)),De.p}function ti(c,o){return o.max-c.max}function ri(c,o,f,E){this.p=new Ce(c,o),this.h=f,this.d=function(L,V){let X=!1,J=1/0;for(let oe=0;oeL.y!=lt.y>L.y&&L.x<(lt.x-ot.x)*(L.y-ot.y)/(lt.y-ot.y)+ot.x&&(X=!X),J=Math.min(J,ef(L,ot,lt))}}return(X?1:-1)*Math.sqrt(J)}(this.p,E),this.max=this.d+this.h*Math.SQRT2}var hn;R.aq=void 0,(hn=R.aq||(R.aq={}))[hn.center=1]="center",hn[hn.left=2]="left",hn[hn.right=3]="right",hn[hn.top=4]="top",hn[hn.bottom=5]="bottom",hn[hn["top-left"]=6]="top-left",hn[hn["top-right"]=7]="top-right",hn[hn["bottom-left"]=8]="bottom-left",hn[hn["bottom-right"]=9]="bottom-right";const An=7,Yi=Number.POSITIVE_INFINITY;function Ci(c,o){return o[1]!==Yi?function(f,E,L){let V=0,X=0;switch(E=Math.abs(E),L=Math.abs(L),f){case"top-right":case"top-left":case"top":X=L-An;break;case"bottom-right":case"bottom-left":case"bottom":X=-L+An}switch(f){case"top-right":case"bottom-right":case"right":V=-E;break;case"top-left":case"bottom-left":case"left":V=E}return[V,X]}(c,o[0],o[1]):function(f,E){let L=0,V=0;E<0&&(E=0);const X=E/Math.SQRT2;switch(f){case"top-right":case"top-left":V=X-An;break;case"bottom-right":case"bottom-left":V=-X+An;break;case"bottom":V=-E+An;break;case"top":V=E-An}switch(f){case"top-right":case"bottom-right":L=-X;break;case"top-left":case"bottom-left":L=X;break;case"left":L=E;break;case"right":L=-E}return[L,V]}(c,o[0])}function fo(c,o,f){var E;const L=c.layout,V=(E=L.get("text-variable-anchor-offset"))===null||E===void 0?void 0:E.evaluate(o,{},f);if(V){const J=V.values,oe=[];for(let me=0;meYe*ps);Me.startsWith("top")?De[1]-=An:Me.startsWith("bottom")&&(De[1]+=An),oe[me+1]=De}return new Ba(oe)}const X=L.get("text-variable-anchor");if(X){let J;J=c._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[L.get("text-radial-offset").evaluate(o,{},f)*ps,Yi]:L.get("text-offset").evaluate(o,{},f).map(me=>me*ps);const oe=[];for(const me of X)oe.push(me,Ci(me,J));return new Ba(oe)}return null}function Go(c){switch(c){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function hi(c,o,f,E,L,V,X,J,oe,me,Me){let De=V.textMaxSize.evaluate(o,{});De===void 0&&(De=X);const Ye=c.layers[0].layout,ot=Ye.get("icon-offset").evaluate(o,{},Me),lt=Vo(f.horizontal),Ct=X/24,Gt=c.tilePixelRatio*Ct,Kt=c.tilePixelRatio*De/24,Er=c.tilePixelRatio*J,cr=c.tilePixelRatio*Ye.get("symbol-spacing"),Rr=Ye.get("text-padding")*c.tilePixelRatio,Qr=function(ni,jo,Do,rs=1){const iu=ni.get("icon-padding").evaluate(jo,{},Do),tl=iu&&iu.values;return[tl[0]*rs,tl[1]*rs,tl[2]*rs,tl[3]*rs]}(Ye,o,Me,c.tilePixelRatio),Fn=Ye.get("text-max-angle")/180*Math.PI,Ki=Ye.get("text-rotation-alignment")!=="viewport"&&Ye.get("symbol-placement")!=="point",Co=Ye.get("icon-rotation-alignment")==="map"&&Ye.get("symbol-placement")!=="point",$i=Ye.get("symbol-placement"),Zi=cr/2,Ri=Ye.get("icon-text-fit");let vo;E&&Ri!=="none"&&(c.allowVerticalPlacement&&f.vertical&&(vo=td(E,f.vertical,Ri,Ye.get("icon-text-fit-padding"),ot,Ct)),lt&&(E=td(E,lt,Ri,Ye.get("icon-text-fit-padding"),ot,Ct)));const Ii=(ni,jo)=>{jo.x<0||jo.x>=Ws||jo.y<0||jo.y>=Ws||function(Do,rs,iu,tl,gc,Pp,sp,kc,gh,lp,vh,Ys,jl,_h,vc,xp,up,Mh,_c,oc,Ss,Ph,Rh,Nc,Cf){const Vp=Do.addToLineVertexArray(rs,iu);let Mf,md,Pf,Rf,Rp=0,$c=0,Vd=0,Ym=0,Vf=-1,og=-1;const Pd={};let jd=Cl("");if(Do.allowVerticalPlacement&&tl.vertical){const Ih=kc.layout.get("text-rotate").evaluate(Ss,{},Nc)+90;Pf=new yn(gh,rs,lp,vh,Ys,tl.vertical,jl,_h,vc,Ih),sp&&(Rf=new yn(gh,rs,lp,vh,Ys,sp,up,Mh,vc,Ih))}if(gc){const Ih=kc.layout.get("icon-rotate").evaluate(Ss,{}),Hp=kc.layout.get("icon-text-fit")!=="none",Hd=ft(gc,Ih,Rh,Hp),hf=sp?ft(sp,Ih,Rh,Hp):void 0;md=new yn(gh,rs,lp,vh,Ys,gc,up,Mh,!1,Ih),Rp=4*Hd.length;const Gd=Do.iconSizeData;let pf=null;Gd.kind==="source"?(pf=[Zp*kc.layout.get("icon-size").evaluate(Ss,{})],pf[0]>wf&&rn(`${Do.layerIds[0]}: Value for "icon-size" is >= ${dd}. Reduce your "icon-size".`)):Gd.kind==="composite"&&(pf=[Zp*Ph.compositeIconSizes[0].evaluate(Ss,{},Nc),Zp*Ph.compositeIconSizes[1].evaluate(Ss,{},Nc)],(pf[0]>wf||pf[1]>wf)&&rn(`${Do.layerIds[0]}: Value for "icon-size" is >= ${dd}. Reduce your "icon-size".`)),Do.addSymbols(Do.icon,Hd,pf,oc,_c,Ss,R.ai.none,rs,Vp.lineStartIndex,Vp.lineLength,-1,Nc),Vf=Do.icon.placedSymbolArray.length-1,hf&&($c=4*hf.length,Do.addSymbols(Do.icon,hf,pf,oc,_c,Ss,R.ai.vertical,rs,Vp.lineStartIndex,Vp.lineLength,-1,Nc),og=Do.icon.placedSymbolArray.length-1)}const pm=Object.keys(tl.horizontal);for(const Ih of pm){const Hp=tl.horizontal[Ih];if(!Mf){jd=Cl(Hp.text);const hf=kc.layout.get("text-rotate").evaluate(Ss,{},Nc);Mf=new yn(gh,rs,lp,vh,Ys,Hp,jl,_h,vc,hf)}const Hd=Hp.positionedLines.length===1;if(Vd+=zi(Do,rs,Hp,Pp,kc,vc,Ss,xp,Vp,tl.vertical?R.ai.horizontal:R.ai.horizontalOnly,Hd?pm:[Ih],Pd,Vf,Ph,Nc),Hd)break}tl.vertical&&(Ym+=zi(Do,rs,tl.vertical,Pp,kc,vc,Ss,xp,Vp,R.ai.vertical,["vertical"],Pd,og,Ph,Nc));const Tm=Mf?Mf.boxStartIndex:Do.collisionBoxArray.length,fm=Mf?Mf.boxEndIndex:Do.collisionBoxArray.length,Am=Pf?Pf.boxStartIndex:Do.collisionBoxArray.length,Cg=Pf?Pf.boxEndIndex:Do.collisionBoxArray.length,Vg=md?md.boxStartIndex:Do.collisionBoxArray.length,Mg=md?md.boxEndIndex:Do.collisionBoxArray.length,$m=Rf?Rf.boxStartIndex:Do.collisionBoxArray.length,ag=Rf?Rf.boxEndIndex:Do.collisionBoxArray.length;let jp=-1;const cp=(Ih,Hp)=>Ih&&Ih.circleDiameter?Math.max(Ih.circleDiameter,Hp):Hp;jp=cp(Mf,jp),jp=cp(Pf,jp),jp=cp(md,jp),jp=cp(Rf,jp);const dm=jp>-1?1:0;dm&&(jp*=Cf/ps),Do.glyphOffsetArray.length>=rd.MAX_GLYPHS&&rn("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ss.sortKey!==void 0&&Do.addToSortKeyRanges(Do.symbolInstances.length,Ss.sortKey);const Vh=fo(kc,Ss,Nc),[sg,Cm]=function(Ih,Hp){const Hd=Ih.length,hf=Hp==null?void 0:Hp.values;if((hf==null?void 0:hf.length)>0)for(let Gd=0;Gd=0?Pd.right:-1,Pd.center>=0?Pd.center:-1,Pd.left>=0?Pd.left:-1,Pd.vertical||-1,Vf,og,jd,Tm,fm,Am,Cg,Vg,Mg,$m,ag,lp,Vd,Ym,Rp,$c,dm,0,jl,jp,sg,Cm)}(c,jo,ni,f,E,L,vo,c.layers[0],c.collisionBoxArray,o.index,o.sourceLayerIndex,c.index,Gt,[Rr,Rr,Rr,Rr],Ki,oe,Er,Qr,Co,ot,o,V,me,Me,X)};if($i==="line")for(const ni of pe(o.geometry,0,0,Ws,Ws)){const jo=xt(ni,cr,Fn,f.vertical||lt,E,24,Kt,c.overscaling,Ws);for(const Do of jo)lt&&Ka(c,lt.text,Zi,Do)||Ii(ni,Do)}else if($i==="line-center"){for(const ni of o.geometry)if(ni.length>1){const jo=St(ni,Fn,f.vertical||lt,E,24,Kt);jo&&Ii(ni,jo)}}else if(o.type==="Polygon")for(const ni of Fd(o.geometry,0)){const jo=$n(ni,16);Ii(ni[0],new we(jo.x,jo.y,0))}else if(o.type==="LineString")for(const ni of o.geometry)Ii(ni,new we(ni[0].x,ni[0].y,0));else if(o.type==="Point")for(const ni of o.geometry)for(const jo of ni)Ii([jo],new we(jo.x,jo.y,0))}function zi(c,o,f,E,L,V,X,J,oe,me,Me,De,Ye,ot,lt){const Ct=function(Er,cr,Rr,Qr,Fn,Ki,Co,$i){const Zi=Qr.layout.get("text-rotate").evaluate(Ki,{})*Math.PI/180,Ri=[];for(const vo of cr.positionedLines)for(const Ii of vo.positionedGlyphs){if(!Ii.rect)continue;const ni=Ii.rect||{};let jo=Mt+1,Do=!0,rs=1,iu=0;const tl=(Fn||$i)&&Ii.vertical,gc=Ii.metrics.advance*Ii.scale/2;if($i&&cr.verticalizable&&(iu=vo.lineOffset/2-(Ii.imageName?-(ps-Ii.metrics.width*Ii.scale)/2:(Ii.scale-1)*ps)),Ii.imageName){const oc=Co[Ii.imageName];Do=oc.sdf,rs=oc.pixelRatio,jo=pt/rs}const Pp=Fn?[Ii.x+gc,Ii.y]:[0,0];let sp=Fn?[0,0]:[Ii.x+gc+Rr[0],Ii.y+Rr[1]-iu],kc=[0,0];tl&&(kc=sp,sp=[0,0]);const gh=Ii.metrics.isDoubleResolution?2:1,lp=(Ii.metrics.left-jo)*Ii.scale-gc+sp[0],vh=(-Ii.metrics.top-jo)*Ii.scale+sp[1],Ys=lp+ni.w/gh*Ii.scale/rs,jl=vh+ni.h/gh*Ii.scale/rs,_h=new Ce(lp,vh),vc=new Ce(Ys,vh),xp=new Ce(lp,jl),up=new Ce(Ys,jl);if(tl){const oc=new Ce(-gc,gc-Tn),Ss=-Math.PI/2,Ph=ps/2-gc,Rh=new Ce(5-Tn-Ph,-(Ii.imageName?Ph:0)),Nc=new Ce(...kc);_h._rotateAround(Ss,oc)._add(Rh)._add(Nc),vc._rotateAround(Ss,oc)._add(Rh)._add(Nc),xp._rotateAround(Ss,oc)._add(Rh)._add(Nc),up._rotateAround(Ss,oc)._add(Rh)._add(Nc)}if(Zi){const oc=Math.sin(Zi),Ss=Math.cos(Zi),Ph=[Ss,-oc,oc,Ss];_h._matMult(Ph),vc._matMult(Ph),xp._matMult(Ph),up._matMult(Ph)}const Mh=new Ce(0,0),_c=new Ce(0,0);Ri.push({tl:_h,tr:vc,bl:xp,br:up,tex:ni,writingMode:cr.writingMode,glyphOffset:Pp,sectionIndex:Ii.sectionIndex,isSDF:Do,pixelOffsetTL:Mh,pixelOffsetBR:_c,minFontScaleX:0,minFontScaleY:0})}return Ri}(0,f,J,L,V,X,E,c.allowVerticalPlacement),Gt=c.textSizeData;let Kt=null;Gt.kind==="source"?(Kt=[Zp*L.layout.get("text-size").evaluate(X,{})],Kt[0]>wf&&rn(`${c.layerIds[0]}: Value for "text-size" is >= ${dd}. Reduce your "text-size".`)):Gt.kind==="composite"&&(Kt=[Zp*ot.compositeTextSizes[0].evaluate(X,{},lt),Zp*ot.compositeTextSizes[1].evaluate(X,{},lt)],(Kt[0]>wf||Kt[1]>wf)&&rn(`${c.layerIds[0]}: Value for "text-size" is >= ${dd}. Reduce your "text-size".`)),c.addSymbols(c.text,Ct,Kt,J,V,X,me,o,oe.lineStartIndex,oe.lineLength,Ye,lt);for(const Er of Me)De[Er]=c.text.placedSymbolArray.length-1;return 4*Ct.length}function Vo(c){for(const o in c)return c[o];return null}function Ka(c,o,f,E){const L=c.compareText;if(o in L){const V=L[o];for(let X=V.length-1;X>=0;X--)if(E.dist(V[X])>4;if(L!==1)throw new Error(`Got v${L} data when expected v1.`);const V=ta[15&E];if(!V)throw new Error("Unrecognized array type.");const[X]=new Uint16Array(o,2,1),[J]=new Uint32Array(o,4,1);return new ka(J,X,V,o)}constructor(o,f=64,E=Float64Array,L){if(isNaN(o)||o<0)throw new Error(`Unpexpected numItems value: ${o}.`);this.numItems=+o,this.nodeSize=Math.min(Math.max(+f,2),65535),this.ArrayType=E,this.IndexArrayType=o<65536?Uint16Array:Uint32Array;const V=ta.indexOf(this.ArrayType),X=2*o*this.ArrayType.BYTES_PER_ELEMENT,J=o*this.IndexArrayType.BYTES_PER_ELEMENT,oe=(8-J%8)%8;if(V<0)throw new Error(`Unexpected typed array class: ${E}.`);L&&L instanceof ArrayBuffer?(this.data=L,this.ids=new this.IndexArrayType(this.data,8,o),this.coords=new this.ArrayType(this.data,8+J+oe,2*o),this._pos=2*o,this._finished=!0):(this.data=new ArrayBuffer(8+X+J+oe),this.ids=new this.IndexArrayType(this.data,8,o),this.coords=new this.ArrayType(this.data,8+J+oe,2*o),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+V]),new Uint16Array(this.data,2,1)[0]=f,new Uint32Array(this.data,4,1)[0]=o)}add(o,f){const E=this._pos>>1;return this.ids[E]=E,this.coords[this._pos++]=o,this.coords[this._pos++]=f,E}finish(){const o=this._pos>>1;if(o!==this.numItems)throw new Error(`Added ${o} items when expected ${this.numItems}.`);return ca(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(o,f,E,L){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:V,coords:X,nodeSize:J}=this,oe=[0,V.length-1,0],me=[];for(;oe.length;){const Me=oe.pop()||0,De=oe.pop()||0,Ye=oe.pop()||0;if(De-Ye<=J){for(let Gt=Ye;Gt<=De;Gt++){const Kt=X[2*Gt],Er=X[2*Gt+1];Kt>=o&&Kt<=E&&Er>=f&&Er<=L&&me.push(V[Gt])}continue}const ot=Ye+De>>1,lt=X[2*ot],Ct=X[2*ot+1];lt>=o&<<=E&&Ct>=f&&Ct<=L&&me.push(V[ot]),(Me===0?o<=lt:f<=Ct)&&(oe.push(Ye),oe.push(ot-1),oe.push(1-Me)),(Me===0?E>=lt:L>=Ct)&&(oe.push(ot+1),oe.push(De),oe.push(1-Me))}return me}within(o,f,E){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:L,coords:V,nodeSize:X}=this,J=[0,L.length-1,0],oe=[],me=E*E;for(;J.length;){const Me=J.pop()||0,De=J.pop()||0,Ye=J.pop()||0;if(De-Ye<=X){for(let Gt=Ye;Gt<=De;Gt++)ha(V[2*Gt],V[2*Gt+1],o,f)<=me&&oe.push(L[Gt]);continue}const ot=Ye+De>>1,lt=V[2*ot],Ct=V[2*ot+1];ha(lt,Ct,o,f)<=me&&oe.push(L[ot]),(Me===0?o-E<=lt:f-E<=Ct)&&(J.push(Ye),J.push(ot-1),J.push(1-Me)),(Me===0?o+E>=lt:f+E>=Ct)&&(J.push(ot+1),J.push(De),J.push(1-Me))}return oe}}function ca(c,o,f,E,L,V){if(L-E<=f)return;const X=E+L>>1;Eo(c,o,X,E,L,V),ca(c,o,f,E,X-1,1-V),ca(c,o,f,X+1,L,1-V)}function Eo(c,o,f,E,L,V){for(;L>E;){if(L-E>600){const me=L-E+1,Me=f-E+1,De=Math.log(me),Ye=.5*Math.exp(2*De/3),ot=.5*Math.sqrt(De*Ye*(me-Ye)/me)*(Me-me/2<0?-1:1);Eo(c,o,f,Math.max(E,Math.floor(f-Me*Ye/me+ot)),Math.min(L,Math.floor(f+(me-Me)*Ye/me+ot)),V)}const X=o[2*f+V];let J=E,oe=L;for(Pa(c,o,E,f),o[2*L+V]>X&&Pa(c,o,E,L);JX;)oe--}o[2*E+V]===X?Pa(c,o,E,oe):(oe++,Pa(c,o,oe,L)),oe<=f&&(E=oe+1),f<=oe&&(L=oe-1)}}function Pa(c,o,f,E){na(c,f,E),na(o,2*f,2*E),na(o,2*f+1,2*E+1)}function na(c,o,f){const E=c[o];c[o]=c[f],c[f]=E}function ha(c,o,f,E){const L=c-f,V=o-E;return L*L+V*V}var Xs;R.bh=void 0,(Xs=R.bh||(R.bh={})).create="create",Xs.load="load",Xs.fullLoad="fullLoad";let Ls=null,Ea=[];const ws=1e3/60,qs="loadTime",ua="fullLoadTime",cu={mark(c){performance.mark(c)},frame(c){const o=c;Ls!=null&&Ea.push(o-Ls),Ls=o},clearMetrics(){Ls=null,Ea=[],performance.clearMeasures(qs),performance.clearMeasures(ua);for(const c in R.bh)performance.clearMarks(R.bh[c])},getPerformanceMetrics(){performance.measure(qs,R.bh.create,R.bh.load),performance.measure(ua,R.bh.create,R.bh.fullLoad);const c=performance.getEntriesByName(qs)[0].duration,o=performance.getEntriesByName(ua)[0].duration,f=Ea.length,E=1/(Ea.reduce((V,X)=>V+X,0)/f/1e3),L=Ea.filter(V=>V>ws).reduce((V,X)=>V+(X-ws)/ws,0);return{loadTime:c,fullLoadTime:o,fps:E,percentDroppedFrames:L/(f+L)*100,totalFrames:f}}};R.$=function(c,o,f){var E,L,V,X,J,oe,me,Me,De,Ye,ot,lt,Ct=f[0],Gt=f[1],Kt=f[2];return o===c?(c[12]=o[0]*Ct+o[4]*Gt+o[8]*Kt+o[12],c[13]=o[1]*Ct+o[5]*Gt+o[9]*Kt+o[13],c[14]=o[2]*Ct+o[6]*Gt+o[10]*Kt+o[14],c[15]=o[3]*Ct+o[7]*Gt+o[11]*Kt+o[15]):(L=o[1],V=o[2],X=o[3],J=o[4],oe=o[5],me=o[6],Me=o[7],De=o[8],Ye=o[9],ot=o[10],lt=o[11],c[0]=E=o[0],c[1]=L,c[2]=V,c[3]=X,c[4]=J,c[5]=oe,c[6]=me,c[7]=Me,c[8]=De,c[9]=Ye,c[10]=ot,c[11]=lt,c[12]=E*Ct+J*Gt+De*Kt+o[12],c[13]=L*Ct+oe*Gt+Ye*Kt+o[13],c[14]=V*Ct+me*Gt+ot*Kt+o[14],c[15]=X*Ct+Me*Gt+lt*Kt+o[15]),c},R.A=xf,R.B=Tl,R.C=class{constructor(c,o,f){this.receive=E=>{const L=E.data,V=L.id;if(V&&(!L.targetMapId||this.mapId===L.targetMapId))if(L.type===""){delete this.tasks[V];const X=this.cancelCallbacks[V];delete this.cancelCallbacks[V],X&&X()}else Dt()||L.mustQueue?(this.tasks[V]=L,this.taskQueue.push(V),this.invoker.trigger()):this.processTask(V,L)},this.process=()=>{if(!this.taskQueue.length)return;const E=this.taskQueue.shift(),L=this.tasks[E];delete this.tasks[E],this.taskQueue.length&&this.invoker.trigger(),L&&this.processTask(E,L)},this.target=c,this.parent=o,this.mapId=f,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new Md(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Dt()?c:window}send(c,o,f,E,L=!1){const V=Math.round(1e18*Math.random()).toString(36).substring(0,10);f&&(this.callbacks[V]=f);const X=[],J={id:V,type:c,hasCallback:!!f,targetMapId:E,mustQueue:L,sourceMapId:this.mapId,data:tu(o,X)};return this.target.postMessage(J,{transfer:X}),{cancel:()=>{f&&delete this.callbacks[V],this.target.postMessage({id:V,type:"",targetMapId:E,sourceMapId:this.mapId})}}}processTask(c,o){if(o.type===""){const f=this.callbacks[c];delete this.callbacks[c],f&&(o.error?f(bu(o.error)):f(null,bu(o.data)))}else{let f=!1;const E=[],L=o.hasCallback?(J,oe)=>{f=!0,delete this.cancelCallbacks[c];const me={id:c,type:"",sourceMapId:this.mapId,error:J?tu(J):null,data:tu(oe,E)};this.target.postMessage(me,{transfer:E})}:J=>{f=!0};let V=null;const X=bu(o.data);if(this.parent[o.type])V=this.parent[o.type](o.sourceMapId,X,L);else if("getWorkerSource"in this.parent){const J=o.type.split(".");V=this.parent.getWorkerSource(o.sourceMapId,J[0],X.source)[J[1]](X,L)}else L(new Error(`Could not find function ${o.type}`));!f&&V&&V.cancel&&(this.cancelCallbacks[c]=V.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},R.D=ji,R.E=ds,R.F=function(c,o){const f={};for(let E=0;E{}}},R.Y=un,R.Z=function(){var c=new xf(16);return xf!=Float32Array&&(c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[11]=0,c[12]=0,c[13]=0,c[14]=0),c[0]=1,c[5]=1,c[10]=1,c[15]=1,c},R._=de,R.a=Pt,R.a$=class extends d{},R.a0=function(c,o,f){var E=f[0],L=f[1],V=f[2];return c[0]=o[0]*E,c[1]=o[1]*E,c[2]=o[2]*E,c[3]=o[3]*E,c[4]=o[4]*L,c[5]=o[5]*L,c[6]=o[6]*L,c[7]=o[7]*L,c[8]=o[8]*V,c[9]=o[9]*V,c[10]=o[10]*V,c[11]=o[11]*V,c[12]=o[12],c[13]=o[13],c[14]=o[14],c[15]=o[15],c},R.a1=ud,R.a2=function(){return pa++},R.a3=G,R.a4=rd,R.a5=function(){Rs.isLoading()||Rs.isLoaded()||ql()!=="deferred"||fa()},R.a6=bh,R.a7=Ol,R.a8=hs,R.a9=D,R.aA=tp,R.aB=function(c){c=c.slice();const o=Object.create(null);for(let f=0;f{E[X.source]?f.push({command:We.removeLayer,args:[X.id]}):V.push(X)}),f=f.concat(L),function(X,J,oe){J=J||[];const me=(X=X||[]).map(kn),Me=J.map(kn),De=X.reduce(eo,{}),Ye=J.reduce(eo,{}),ot=me.slice(),lt=Object.create(null);let Ct,Gt,Kt,Er,cr,Rr,Qr;for(Ct=0,Gt=0;Ct@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(f,E,L,V)=>{const X=L||V;return o[E]=!X||X.toLowerCase(),""}),o["max-age"]){const f=parseInt(o["max-age"],10);isNaN(f)?delete o["max-age"]:o["max-age"]=f}return o},R.ab=function(c,o){const f=[];for(const E in c)E in o||f.push(E);return f},R.ac=function(c){if($e==null){const o=c.navigator?c.navigator.userAgent:null;$e=!!c.safari||!(!o||!(/\b(iPad|iPhone|iPod)\b/.test(o)||o.match("Safari")&&!o.match("Chrome")))}return $e},R.ad=Kn,R.ae=function(c,o,f){var E=Math.sin(f),L=Math.cos(f),V=o[0],X=o[1],J=o[2],oe=o[3],me=o[4],Me=o[5],De=o[6],Ye=o[7];return o!==c&&(c[8]=o[8],c[9]=o[9],c[10]=o[10],c[11]=o[11],c[12]=o[12],c[13]=o[13],c[14]=o[14],c[15]=o[15]),c[0]=V*L+me*E,c[1]=X*L+Me*E,c[2]=J*L+De*E,c[3]=oe*L+Ye*E,c[4]=me*L-V*E,c[5]=Me*L-X*E,c[6]=De*L-J*E,c[7]=Ye*L-oe*E,c},R.af=function(c){var o=new xf(16);return o[0]=c[0],o[1]=c[1],o[2]=c[2],o[3]=c[3],o[4]=c[4],o[5]=c[5],o[6]=c[6],o[7]=c[7],o[8]=c[8],o[9]=c[9],o[10]=c[10],o[11]=c[11],o[12]=c[12],o[13]=c[13],o[14]=c[14],o[15]=c[15],o},R.ag=Yf,R.ah=function(c,o){let f=0,E=0;if(c.kind==="constant")E=c.layoutSize;else if(c.kind!=="source"){const{interpolationType:L,minZoom:V,maxZoom:X}=c,J=L?Kn(Fu.interpolationFactor(L,o,V,X),0,1):0;c.kind==="camera"?E=Tl.number(c.minSize,c.maxSize,J):f=J}return{uSizeT:f,uSize:E}},R.aj=function(c,{uSize:o,uSizeT:f},{lowerSize:E,upperSize:L}){return c.kind==="source"?E/Zp:c.kind==="composite"?Tl.number(E/Zp,L/Zp,f):o},R.ak=Bu,R.al=function(c,o,f,E){const L=o.y-c.y,V=o.x-c.x,X=E.y-f.y,J=E.x-f.x,oe=X*V-J*L;if(oe===0)return null;const me=(J*(c.y-f.y)-X*(c.x-f.x))/oe;return new Ce(c.x+me*V,c.y+me*L)},R.am=pe,R.an=ip,R.ao=tf,R.ap=ps,R.ar=Sf,R.as=function(c,o){var f=o[0],E=o[1],L=o[2],V=o[3],X=o[4],J=o[5],oe=o[6],me=o[7],Me=o[8],De=o[9],Ye=o[10],ot=o[11],lt=o[12],Ct=o[13],Gt=o[14],Kt=o[15],Er=f*J-E*X,cr=f*oe-L*X,Rr=f*me-V*X,Qr=E*oe-L*J,Fn=E*me-V*J,Ki=L*me-V*oe,Co=Me*Ct-De*lt,$i=Me*Gt-Ye*lt,Zi=Me*Kt-ot*lt,Ri=De*Gt-Ye*Ct,vo=De*Kt-ot*Ct,Ii=Ye*Kt-ot*Gt,ni=Er*Ii-cr*vo+Rr*Ri+Qr*Zi-Fn*$i+Ki*Co;return ni?(c[0]=(J*Ii-oe*vo+me*Ri)*(ni=1/ni),c[1]=(L*vo-E*Ii-V*Ri)*ni,c[2]=(Ct*Ki-Gt*Fn+Kt*Qr)*ni,c[3]=(Ye*Fn-De*Ki-ot*Qr)*ni,c[4]=(oe*Zi-X*Ii-me*$i)*ni,c[5]=(f*Ii-L*Zi+V*$i)*ni,c[6]=(Gt*Rr-lt*Ki-Kt*cr)*ni,c[7]=(Me*Ki-Ye*Rr+ot*cr)*ni,c[8]=(X*vo-J*Zi+me*Co)*ni,c[9]=(E*Zi-f*vo-V*Co)*ni,c[10]=(lt*Fn-Ct*Rr+Kt*Er)*ni,c[11]=(De*Rr-Me*Fn-ot*Er)*ni,c[12]=(J*$i-X*Ri-oe*Co)*ni,c[13]=(f*Ri-E*$i+L*Co)*ni,c[14]=(Ct*cr-lt*Qr-Gt*Er)*ni,c[15]=(Me*Qr-De*cr+Ye*Er)*ni,c):null},R.at=Go,R.au=Ch,R.av=ka,R.aw=function(){const c={},o=Ur.$version;for(const f in Ur.$root){const E=Ur.$root[f];if(E.required){let L=null;L=f==="version"?o:E.type==="array"?[]:{},L!=null&&(c[f]=L)}}return c},R.ax=We,R.ay=Dp,R.az=vi,R.b=function(c,o){const f=new Blob([new Uint8Array(c)],{type:"image/png"});createImageBitmap(f).then(E=>{o(null,E)}).catch(E=>{o(new Error(`Could not load image because of ${E.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},R.b0=Di,R.b1=function(c,o){var f=c[0],E=c[1],L=c[2],V=c[3],X=c[4],J=c[5],oe=c[6],me=c[7],Me=c[8],De=c[9],Ye=c[10],ot=c[11],lt=c[12],Ct=c[13],Gt=c[14],Kt=c[15],Er=o[0],cr=o[1],Rr=o[2],Qr=o[3],Fn=o[4],Ki=o[5],Co=o[6],$i=o[7],Zi=o[8],Ri=o[9],vo=o[10],Ii=o[11],ni=o[12],jo=o[13],Do=o[14],rs=o[15];return Math.abs(f-Er)<=Gu*Math.max(1,Math.abs(f),Math.abs(Er))&&Math.abs(E-cr)<=Gu*Math.max(1,Math.abs(E),Math.abs(cr))&&Math.abs(L-Rr)<=Gu*Math.max(1,Math.abs(L),Math.abs(Rr))&&Math.abs(V-Qr)<=Gu*Math.max(1,Math.abs(V),Math.abs(Qr))&&Math.abs(X-Fn)<=Gu*Math.max(1,Math.abs(X),Math.abs(Fn))&&Math.abs(J-Ki)<=Gu*Math.max(1,Math.abs(J),Math.abs(Ki))&&Math.abs(oe-Co)<=Gu*Math.max(1,Math.abs(oe),Math.abs(Co))&&Math.abs(me-$i)<=Gu*Math.max(1,Math.abs(me),Math.abs($i))&&Math.abs(Me-Zi)<=Gu*Math.max(1,Math.abs(Me),Math.abs(Zi))&&Math.abs(De-Ri)<=Gu*Math.max(1,Math.abs(De),Math.abs(Ri))&&Math.abs(Ye-vo)<=Gu*Math.max(1,Math.abs(Ye),Math.abs(vo))&&Math.abs(ot-Ii)<=Gu*Math.max(1,Math.abs(ot),Math.abs(Ii))&&Math.abs(lt-ni)<=Gu*Math.max(1,Math.abs(lt),Math.abs(ni))&&Math.abs(Ct-jo)<=Gu*Math.max(1,Math.abs(Ct),Math.abs(jo))&&Math.abs(Gt-Do)<=Gu*Math.max(1,Math.abs(Gt),Math.abs(Do))&&Math.abs(Kt-rs)<=Gu*Math.max(1,Math.abs(Kt),Math.abs(rs))},R.b2=function(c,o){return c[0]=o[0],c[1]=o[1],c[2]=o[2],c[3]=o[3],c[4]=o[4],c[5]=o[5],c[6]=o[6],c[7]=o[7],c[8]=o[8],c[9]=o[9],c[10]=o[10],c[11]=o[11],c[12]=o[12],c[13]=o[13],c[14]=o[14],c[15]=o[15],c},R.b3=function(c,o,f){return c[0]=o[0]*f[0],c[1]=o[1]*f[1],c[2]=o[2]*f[2],c[3]=o[3]*f[3],c},R.b4=function(c,o){return c[0]*o[0]+c[1]*o[1]+c[2]*o[2]+c[3]*o[3]},R.b5=Jn,R.b6=j,R.b7=Zd,R.b8=function(c,o,f,E,L){var V,X=1/Math.tan(o/2);return c[0]=X/f,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=X,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[11]=-1,c[12]=0,c[13]=0,c[15]=0,L!=null&&L!==1/0?(c[10]=(L+E)*(V=1/(E-L)),c[14]=2*L*E*V):(c[10]=-1,c[14]=-2*E),c},R.b9=function(c,o,f){var E=Math.sin(f),L=Math.cos(f),V=o[4],X=o[5],J=o[6],oe=o[7],me=o[8],Me=o[9],De=o[10],Ye=o[11];return o!==c&&(c[0]=o[0],c[1]=o[1],c[2]=o[2],c[3]=o[3],c[12]=o[12],c[13]=o[13],c[14]=o[14],c[15]=o[15]),c[4]=V*L+me*E,c[5]=X*L+Me*E,c[6]=J*L+De*E,c[7]=oe*L+Ye*E,c[8]=me*L-V*E,c[9]=Me*L-X*E,c[10]=De*L-J*E,c[11]=Ye*L-oe*E,c},R.bA=Le,R.bB=du,R.bC=wc,R.bD=Rs,R.ba=Ar,R.bb=pn,R.bc=function(c,o){return c[0]=o[0],c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=o[1],c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=o[2],c[11]=0,c[12]=0,c[13]=0,c[14]=0,c[15]=1,c},R.bd=class extends zh{},R.be=cf,R.bf=i,R.bg=cu,R.bi=Uo,R.bj=function(c,o,f=!1){if(Eu===wh||Eu===Pc||Eu===Xl)throw new Error("setRTLTextPlugin cannot be called multiple times.");lh=yi.resolveURL(c),Eu=wh,Rc=o,rp(),f||fa()},R.bk=ql,R.bl=function(c,o){const f={};for(let L=0;Lni*ps)}let $i=X?"center":f.get("text-justify").evaluate(me,{},c.canonical);const Zi=f.get("symbol-placement"),Ri=Zi==="point"?f.get("text-max-width").evaluate(me,{},c.canonical)*ps:0,vo=()=>{c.bucket.allowVerticalPlacement&&is(Rr)&&(lt.vertical=Qn(Ct,c.glyphMap,c.glyphPositions,c.imagePositions,Me,Ri,V,Ki,"left",Fn,Kt,R.ai.vertical,!0,Zi,Ye,De))};if(!X&&Co){const Ii=new Set;if($i==="auto")for(let jo=0;jo{o(null,f),URL.revokeObjectURL(f.src),f.onload=null,window.requestAnimationFrame(()=>{f.src=vt})},f.onerror=()=>o(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const E=new Blob([new Uint8Array(c)],{type:"image/png"});f.src=c.byteLength?URL.createObjectURL(E):vt},R.e=ki,R.f=function(c,o){return Xi(ki(c,{type:"json"}),o)},R.g=bo,R.h=yi,R.i=Dt,R.j=Pi,R.k=Vi,R.l=Mi,R.m=Xi,R.n=function(c){return new Br(c).readFields(Jt,[])},R.o=function(c,o,f){if(!c.length)return f(null,[]);let E=c.length;const L=new Array(c.length);let V=null;c.forEach((X,J)=>{o(X,(oe,me)=>{oe&&(V=oe),L[J]=me,--E==0&&f(V,L)})})},R.p=Xt,R.q=xl,R.r=ul,R.s=qo,R.t=Qh,R.u=ai,R.v=Ur,R.w=rn,R.x=ll,R.y=ah,R.z=function([c,o,f]){return o+=90,o*=Math.PI/180,f*=Math.PI/180,{x:c*Math.cos(o)*Math.sin(f),y:c*Math.sin(o)*Math.sin(f),z:c*Math.cos(f)}}}),Ze(["./shared"],function(R){"use strict";class de{constructor(Ne){this.keyCache={},Ne&&this.replace(Ne)}replace(Ne){this._layerConfigs={},this._layers={},this.update(Ne,[])}update(Ne,re){for(const ge of Ne){this._layerConfigs[ge.id]=ge;const ye=this._layers[ge.id]=R.aC(ge);ye._featureFilter=R.a6(ye.filter),this.keyCache[ge.id]&&delete this.keyCache[ge.id]}for(const ge of re)delete this.keyCache[ge],delete this._layerConfigs[ge],delete this._layers[ge];this.familiesBySource={};const le=R.bl(Object.values(this._layerConfigs),this.keyCache);for(const ge of le){const ye=ge.map(wt=>this._layers[wt.id]),ze=ye[0];if(ze.visibility==="none")continue;const je=ze.source||"";let Ue=this.familiesBySource[je];Ue||(Ue=this.familiesBySource[je]={});const Ae=ze.sourceLayer||"_geojsonTileLayer";let Je=Ue[Ae];Je||(Je=Ue[Ae]=[]),Je.push(ye)}}}class be{constructor(Ne){const re={},le=[];for(const je in Ne){const Ue=Ne[je],Ae=re[je]={};for(const Je in Ue){const wt=Ue[+Je];if(!wt||wt.bitmap.width===0||wt.bitmap.height===0)continue;const Ht={x:0,y:0,w:wt.bitmap.width+2,h:wt.bitmap.height+2};le.push(Ht),Ae[Je]={rect:Ht,metrics:wt.metrics}}}const{w:ge,h:ye}=R.p(le),ze=new R.q({width:ge||1,height:ye||1});for(const je in Ne){const Ue=Ne[je];for(const Ae in Ue){const Je=Ue[+Ae];if(!Je||Je.bitmap.width===0||Je.bitmap.height===0)continue;const wt=re[je][Ae].rect;R.q.copy(Je.bitmap,ze,{x:0,y:0},{x:wt.x+1,y:wt.y+1},Je.bitmap)}}this.image=ze,this.positions=re}}R.bm("GlyphAtlas",be);class Le{constructor(Ne){this.tileID=new R.O(Ne.tileID.overscaledZ,Ne.tileID.wrap,Ne.tileID.canonical.z,Ne.tileID.canonical.x,Ne.tileID.canonical.y),this.uid=Ne.uid,this.zoom=Ne.zoom,this.pixelRatio=Ne.pixelRatio,this.tileSize=Ne.tileSize,this.source=Ne.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Ne.showCollisionBoxes,this.collectResourceTiming=!!Ne.collectResourceTiming,this.returnDependencies=!!Ne.returnDependencies,this.promoteId=Ne.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(Ne,re,le,ge,ye){this.status="parsing",this.data=Ne,this.collisionBoxArray=new R.a3;const ze=new R.bn(Object.keys(Ne.layers).sort()),je=new R.bo(this.tileID,this.promoteId);je.bucketLayerIDs=[];const Ue={},Ae={featureIndex:je,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:le},Je=re.familiesBySource[this.source];for(const bn in Je){const En=Ne.layers[bn];if(!En)continue;En.version===1&&R.w(`Vector tile source "${this.source}" layer "${bn}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const io=ze.encode(bn),On=[];for(let Ao=0;Ao=ia.maxzoom||ia.visibility!=="none"&&(Re(Ao,this.zoom,le),(Ue[ia.id]=ia.createBucket({index:je.bucketLayerIDs.length,layers:Ao,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:io,sourceID:this.source})).populate(On,Ae,this.tileID.canonical),je.bucketLayerIDs.push(Ao.map(Ho=>Ho.id)))}}let wt,Ht,Fr,mr;const Sr=R.aH(Ae.glyphDependencies,bn=>Object.keys(bn).map(Number));this.inFlightDependencies.forEach(bn=>bn==null?void 0:bn.cancel()),this.inFlightDependencies=[];const fn=++this.dependencySentinel;Object.keys(Sr).length?this.inFlightDependencies.push(ge.send("getGlyphs",{uid:this.uid,stacks:Sr,source:this.source,tileID:this.tileID,type:"glyphs"},(bn,En)=>{fn===this.dependencySentinel&&(wt||(wt=bn,Ht=En,Nn.call(this)))})):Ht={};const xn=Object.keys(Ae.iconDependencies);xn.length?this.inFlightDependencies.push(ge.send("getImages",{icons:xn,source:this.source,tileID:this.tileID,type:"icons"},(bn,En)=>{fn===this.dependencySentinel&&(wt||(wt=bn,Fr=En,Nn.call(this)))})):Fr={};const Lr=Object.keys(Ae.patternDependencies);function Nn(){if(wt)return ye(wt);if(Ht&&Fr&&mr){const bn=new be(Ht),En=new R.bp(Fr,mr);for(const io in Ue){const On=Ue[io];On instanceof R.a4?(Re(On.layers,this.zoom,le),R.bq({bucket:On,glyphMap:Ht,glyphPositions:bn.positions,imageMap:Fr,imagePositions:En.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):On.hasPattern&&(On instanceof R.br||On instanceof R.bs||On instanceof R.bt)&&(Re(On.layers,this.zoom,le),On.addFeatures(Ae,this.tileID.canonical,En.patternPositions))}this.status="done",ye(null,{buckets:Object.values(Ue).filter(io=>!io.isEmpty()),featureIndex:je,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:bn.image,imageAtlas:En,glyphMap:this.returnDependencies?Ht:null,iconMap:this.returnDependencies?Fr:null,glyphPositions:this.returnDependencies?bn.positions:null})}}Lr.length?this.inFlightDependencies.push(ge.send("getImages",{icons:Lr,source:this.source,tileID:this.tileID,type:"patterns"},(bn,En)=>{fn===this.dependencySentinel&&(wt||(wt=bn,mr=En,Nn.call(this)))})):mr={},Nn.call(this)}}function Re(Lt,Ne,re){const le=new R.a8(Ne);for(const ge of Lt)ge.recalculate(le,re)}function Ce(Lt,Ne){const re=R.l(Lt.request,(le,ge,ye,ze)=>{if(le)Ne(le);else if(ge)try{const je=new R.bw.VectorTile(new R.bv(ge));Ne(null,{vectorTile:je,rawData:ge,cacheControl:ye,expires:ze})}catch(je){const Ue=new Uint8Array(ge);let Ae=`Unable to parse the tile at ${Lt.request.url}, `;Ae+=Ue[0]===31&&Ue[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${je.messge}`,Ne(new Error(Ae))}});return()=>{re.cancel(),Ne()}}class He{constructor(Ne,re,le,ge){this.actor=Ne,this.layerIndex=re,this.availableImages=le,this.loadVectorData=ge||Ce,this.fetching={},this.loading={},this.loaded={}}loadTile(Ne,re){const le=Ne.uid;this.loading||(this.loading={});const ge=!!(Ne&&Ne.request&&Ne.request.collectResourceTiming)&&new R.bu(Ne.request),ye=this.loading[le]=new Le(Ne);ye.abort=this.loadVectorData(Ne,(ze,je)=>{if(delete this.loading[le],ze||!je)return ye.status="done",this.loaded[le]=ye,re(ze);const Ue=je.rawData,Ae={};je.expires&&(Ae.expires=je.expires),je.cacheControl&&(Ae.cacheControl=je.cacheControl);const Je={};if(ge){const wt=ge.finish();wt&&(Je.resourceTiming=JSON.parse(JSON.stringify(wt)))}ye.vectorTile=je.vectorTile,ye.parse(je.vectorTile,this.layerIndex,this.availableImages,this.actor,(wt,Ht)=>{if(delete this.fetching[le],wt||!Ht)return re(wt);re(null,R.e({rawTileData:Ue.slice(0)},Ht,Ae,Je))}),this.loaded=this.loaded||{},this.loaded[le]=ye,this.fetching[le]={rawTileData:Ue,cacheControl:Ae,resourceTiming:Je}})}reloadTile(Ne,re){const le=this.loaded,ge=Ne.uid;if(le&&le[ge]){const ye=le[ge];ye.showCollisionBoxes=Ne.showCollisionBoxes,ye.status==="parsing"?ye.parse(ye.vectorTile,this.layerIndex,this.availableImages,this.actor,(ze,je)=>{if(ze||!je)return re(ze,je);let Ue;if(this.fetching[ge]){const{rawTileData:Ae,cacheControl:Je,resourceTiming:wt}=this.fetching[ge];delete this.fetching[ge],Ue=R.e({rawTileData:Ae.slice(0)},je,Je,wt)}else Ue=je;re(null,Ue)}):ye.status==="done"&&(ye.vectorTile?ye.parse(ye.vectorTile,this.layerIndex,this.availableImages,this.actor,re):re())}}abortTile(Ne,re){const le=this.loading,ge=Ne.uid;le&&le[ge]&&le[ge].abort&&(le[ge].abort(),delete le[ge]),re()}removeTile(Ne,re){const le=this.loaded,ge=Ne.uid;le&&le[ge]&&delete le[ge],re()}}class Xe{constructor(){this.loaded={}}loadTile(Ne,re){return R._(this,void 0,void 0,function*(){const{uid:le,encoding:ge,rawImageData:ye,redFactor:ze,greenFactor:je,blueFactor:Ue,baseShift:Ae}=Ne,Je=ye.width+2,wt=ye.height+2,Ht=R.a(ye)?new R.R({width:Je,height:wt},yield R.bx(ye,-1,-1,Je,wt)):ye,Fr=new R.by(le,Ht,ge,ze,je,Ue,Ae);this.loaded=this.loaded||{},this.loaded[le]=Fr,re(null,Fr)})}removeTile(Ne){const re=this.loaded,le=Ne.uid;re&&re[le]&&delete re[le]}}function Ke(Lt,Ne){if(Lt.length!==0){Ve(Lt[0],Ne);for(var re=1;re=Math.abs(je)?re-Ue+je:je-Ue+re,re=Ue}re+le>=0!=!!Ne&&Lt.reverse()}var et=R.bz(function Lt(Ne,re){var le,ge=Ne&&Ne.type;if(ge==="FeatureCollection")for(le=0;le>31}function Dt(Lt,Ne){for(var re=Lt.loadGeometry(),le=Lt.type,ge=0,ye=0,ze=re.length,je=0;jeLt},rr=Math.fround||(ar=new Float32Array(1),Lt=>(ar[0]=+Lt,ar[0]));var ar;const wr=3,Cr=5,an=6;class yi{constructor(Ne){this.options=Object.assign(Object.create(vt),Ne),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Ne){const{log:re,minZoom:le,maxZoom:ge}=this.options;re&&console.time("total time");const ye=`prepare ${Ne.length} points`;re&&console.time(ye),this.points=Ne;const ze=[];for(let Ue=0;Ue=le;Ue--){const Ae=+Date.now();je=this.trees[Ue]=this._createTree(this._cluster(je,Ue)),re&&console.log("z%d: %d clusters in %dms",Ue,je.numItems,+Date.now()-Ae)}return re&&console.timeEnd("total time"),this}getClusters(Ne,re){let le=((Ne[0]+180)%360+360)%360-180;const ge=Math.max(-90,Math.min(90,Ne[1]));let ye=Ne[2]===180?180:((Ne[2]+180)%360+360)%360-180;const ze=Math.max(-90,Math.min(90,Ne[3]));if(Ne[2]-Ne[0]>=360)le=-180,ye=180;else if(le>ye){const wt=this.getClusters([le,ge,180,ze],re),Ht=this.getClusters([-180,ge,ye,ze],re);return wt.concat(Ht)}const je=this.trees[this._limitZoom(re)],Ue=je.range(vi(le),bo(ze),vi(ye),bo(ge)),Ae=je.data,Je=[];for(const wt of Ue){const Ht=this.stride*wt;Je.push(Ae[Ht+Cr]>1?li(Ae,Ht,this.clusterProps):this.points[Ae[Ht+wr]])}return Je}getChildren(Ne){const re=this._getOriginId(Ne),le=this._getOriginZoom(Ne),ge="No cluster with the specified id.",ye=this.trees[le];if(!ye)throw new Error(ge);const ze=ye.data;if(re*this.stride>=ze.length)throw new Error(ge);const je=this.options.radius/(this.options.extent*Math.pow(2,le-1)),Ue=ye.within(ze[re*this.stride],ze[re*this.stride+1],je),Ae=[];for(const Je of Ue){const wt=Je*this.stride;ze[wt+4]===Ne&&Ae.push(ze[wt+Cr]>1?li(ze,wt,this.clusterProps):this.points[ze[wt+wr]])}if(Ae.length===0)throw new Error(ge);return Ae}getLeaves(Ne,re,le){const ge=[];return this._appendLeaves(ge,Ne,re=re||10,le=le||0,0),ge}getTile(Ne,re,le){const ge=this.trees[this._limitZoom(Ne)],ye=Math.pow(2,Ne),{extent:ze,radius:je}=this.options,Ue=je/ze,Ae=(le-Ue)/ye,Je=(le+1+Ue)/ye,wt={features:[]};return this._addTileFeatures(ge.range((re-Ue)/ye,Ae,(re+1+Ue)/ye,Je),ge.data,re,le,ye,wt),re===0&&this._addTileFeatures(ge.range(1-Ue/ye,Ae,1,Je),ge.data,ye,le,ye,wt),re===ye-1&&this._addTileFeatures(ge.range(0,Ae,Ue/ye,Je),ge.data,-1,le,ye,wt),wt.features.length?wt:null}getClusterExpansionZoom(Ne){let re=this._getOriginZoom(Ne)-1;for(;re<=this.options.maxZoom;){const le=this.getChildren(Ne);if(re++,le.length!==1)break;Ne=le[0].properties.cluster_id}return re}_appendLeaves(Ne,re,le,ge,ye){const ze=this.getChildren(re);for(const je of ze){const Ue=je.properties;if(Ue&&Ue.cluster?ye+Ue.point_count<=ge?ye+=Ue.point_count:ye=this._appendLeaves(Ne,Ue.cluster_id,le,ge,ye):ye1;let Je,wt,Ht;if(Ae)Je=Uo(re,Ue,this.clusterProps),wt=re[Ue],Ht=re[Ue+1];else{const Sr=this.points[re[Ue+wr]];Je=Sr.properties;const[fn,xn]=Sr.geometry.coordinates;wt=vi(fn),Ht=bo(xn)}const Fr={type:1,geometry:[[Math.round(this.options.extent*(wt*ye-le)),Math.round(this.options.extent*(Ht*ye-ge))]],tags:Je};let mr;mr=Ae||this.options.generateId?re[Ue+wr]:this.points[re[Ue+wr]].id,mr!==void 0&&(Fr.id=mr),ze.features.push(Fr)}}_limitZoom(Ne){return Math.max(this.options.minZoom,Math.min(Math.floor(+Ne),this.options.maxZoom+1))}_cluster(Ne,re){const{radius:le,extent:ge,reduce:ye,minPoints:ze}=this.options,je=le/(ge*Math.pow(2,re)),Ue=Ne.data,Ae=[],Je=this.stride;for(let wt=0;wtre&&(fn+=Ue[Lr+Cr])}if(fn>Sr&&fn>=ze){let xn,Lr=Ht*Sr,Nn=Fr*Sr,bn=-1;const En=((wt/Je|0)<<5)+(re+1)+this.points.length;for(const io of mr){const On=io*Je;if(Ue[On+2]<=re)continue;Ue[On+2]=re;const Ao=Ue[On+Cr];Lr+=Ue[On]*Ao,Nn+=Ue[On+1]*Ao,Ue[On+4]=En,ye&&(xn||(xn=this._map(Ue,wt,!0),bn=this.clusterProps.length,this.clusterProps.push(xn)),ye(xn,this._map(Ue,On)))}Ue[wt+4]=En,Ae.push(Lr/fn,Nn/fn,1/0,En,-1,fn),ye&&Ae.push(bn)}else{for(let xn=0;xn1)for(const xn of mr){const Lr=xn*Je;if(!(Ue[Lr+2]<=re)){Ue[Lr+2]=re;for(let Nn=0;Nn>5}_getOriginZoom(Ne){return(Ne-this.points.length)%32}_map(Ne,re,le){if(Ne[re+Cr]>1){const ze=this.clusterProps[Ne[re+an]];return le?Object.assign({},ze):ze}const ge=this.points[Ne[re+wr]].properties,ye=this.options.map(ge);return le&&ye===ge?Object.assign({},ye):ye}}function li(Lt,Ne,re){return{type:"Feature",id:Lt[Ne+wr],properties:Uo(Lt,Ne,re),geometry:{type:"Point",coordinates:[(le=Lt[Ne],360*(le-.5)),So(Lt[Ne+1])]}};var le}function Uo(Lt,Ne,re){const le=Lt[Ne+Cr],ge=le>=1e4?`${Math.round(le/1e3)}k`:le>=1e3?Math.round(le/100)/10+"k":le,ye=Lt[Ne+an],ze=ye===-1?{}:Object.assign({},re[ye]);return Object.assign(ze,{cluster:!0,cluster_id:Lt[Ne+wr],point_count:le,point_count_abbreviated:ge})}function vi(Lt){return Lt/360+.5}function bo(Lt){const Ne=Math.sin(Lt*Math.PI/180),re=.5-.25*Math.log((1+Ne)/(1-Ne))/Math.PI;return re<0?0:re>1?1:re}function So(Lt){const Ne=(180-360*Lt)*Math.PI/180;return 360*Math.atan(Math.exp(Ne))/Math.PI-90}function Xi(Lt,Ne,re,le){for(var ge,ye=le,ze=re-Ne>>1,je=re-Ne,Ue=Lt[Ne],Ae=Lt[Ne+1],Je=Lt[re],wt=Lt[re+1],Ht=Ne+3;Htye)ge=Ht,ye=Fr;else if(Fr===ye){var mr=Math.abs(Ht-ze);mrle&&(ge-Ne>3&&Xi(Lt,Ne,ge,le),Lt[ge+2]=ye,re-ge>3&&Xi(Lt,ge,re,le))}function Mi(Lt,Ne,re,le,ge,ye){var ze=ge-re,je=ye-le;if(ze!==0||je!==0){var Ue=((Lt-re)*ze+(Ne-le)*je)/(ze*ze+je*je);Ue>1?(re=ge,le=ye):Ue>0&&(re+=ze*Ue,le+=je*Ue)}return(ze=Lt-re)*ze+(je=Ne-le)*je}function qo(Lt,Ne,re,le){var ge={id:Lt===void 0?null:Lt,type:Ne,geometry:re,tags:le,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(ye){var ze=ye.geometry,je=ye.type;if(je==="Point"||je==="MultiPoint"||je==="LineString")ui(ye,ze);else if(je==="Polygon"||je==="MultiLineString")for(var Ue=0;Ue0&&(ze+=le?(ge*Ae-Ue*ye)/2:Math.sqrt(Math.pow(Ue-ge,2)+Math.pow(Ae-ye,2))),ge=Ue,ye=Ae}var Je=Ne.length-3;Ne[2]=1,Xi(Ne,0,Je,re),Ne[Je+2]=1,Ne.size=Math.abs(ze),Ne.start=0,Ne.end=Ne.size}function ds(Lt,Ne,re,le){for(var ge=0;ge1?1:re}function dr(Lt,Ne,re,le,ge,ye,ze,je){if(le/=Ne,ye>=(re/=Ne)&&ze=le)return null;for(var Ue=[],Ae=0;Ae=re&&mr=le)){var Sr=[];if(Ht==="Point"||Ht==="MultiPoint")he(wt,Sr,re,le,ge);else if(Ht==="LineString")We(wt,Sr,re,le,ge,!1,je.lineMetrics);else if(Ht==="MultiLineString")Ot(wt,Sr,re,le,ge,!1);else if(Ht==="Polygon")Ot(wt,Sr,re,le,ge,!0);else if(Ht==="MultiPolygon")for(var fn=0;fn=re&&ze<=le&&(Ne.push(Lt[ye]),Ne.push(Lt[ye+1]),Ne.push(Lt[ye+2]))}}function We(Lt,Ne,re,le,ge,ye,ze){for(var je,Ue,Ae=at(Lt),Je=ge===0?Wr:In,wt=Lt.start,Ht=0;Htre&&(Ue=Je(Ae,Fr,mr,fn,xn,re),ze&&(Ae.start=wt+je*Ue)):Lr>le?Nn=re&&(Ue=Je(Ae,Fr,mr,fn,xn,re),bn=!0),Nn>le&&Lr<=le&&(Ue=Je(Ae,Fr,mr,fn,xn,le),bn=!0),!ye&&bn&&(ze&&(Ae.end=wt+je*Ue),Ne.push(Ae),Ae=at(Lt)),ze&&(wt+=je)}var En=Lt.length-3;Fr=Lt[En],mr=Lt[En+1],Sr=Lt[En+2],(Lr=ge===0?Fr:mr)>=re&&Lr<=le&&or(Ae,Fr,mr,Sr),En=Ae.length-3,ye&&En>=3&&(Ae[En]!==Ae[0]||Ae[En+1]!==Ae[1])&&or(Ae,Ae[0],Ae[1],Ae[2]),Ae.length&&Ne.push(Ae)}function at(Lt){var Ne=[];return Ne.size=Lt.size,Ne.start=Lt.start,Ne.end=Lt.end,Ne}function Ot(Lt,Ne,re,le,ge,ye){for(var ze=0;zeze.maxX&&(ze.maxX=Je),wt>ze.maxY&&(ze.maxY=wt)}return ze}function Lo(Lt,Ne,re,le){var ge=Ne.geometry,ye=Ne.type,ze=[];if(ye==="Point"||ye==="MultiPoint")for(var je=0;je0&&Ne.size<(ge?ze:le))re.numPoints+=Ne.length/3;else{for(var je=[],Ue=0;Ueze)&&(re.numSimplified++,je.push(Ne[Ue]),je.push(Ne[Ue+1])),re.numPoints++;ge&&function(Ae,Je){for(var wt=0,Ht=0,Fr=Ae.length,mr=Fr-2;Ht0===Je)for(Ht=0,Fr=Ae.length;Ht24)throw new Error("maxZoom should be in the 0-24 range");if(Ne.promoteId&&Ne.generateId)throw new Error("promoteId and generateId cannot be used together.");var le=function(ge,ye){var ze=[];if(ge.type==="FeatureCollection")for(var je=0;je1&&console.time("creation"),Ht=this.tiles[wt]=Ti(Lt,Ne,re,le,Ue),this.tileCoords.push({z:Ne,x:re,y:le}),Ae)){Ae>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Ne,re,le,Ht.numFeatures,Ht.numPoints,Ht.numSimplified),console.timeEnd("creation"));var Fr="z"+Ne;this.stats[Fr]=(this.stats[Fr]||0)+1,this.total++}if(Ht.source=Lt,ge){if(Ne===Ue.maxZoom||Ne===ge)continue;var mr=1<1&&console.time("clipping");var Sr,fn,xn,Lr,Nn,bn,En=.5*Ue.buffer/Ue.extent,io=.5-En,On=.5+En,Ao=1+En;Sr=fn=xn=Lr=null,Nn=dr(Lt,Je,re-En,re+On,0,Ht.minX,Ht.maxX,Ue),bn=dr(Lt,Je,re+io,re+Ao,0,Ht.minX,Ht.maxX,Ue),Lt=null,Nn&&(Sr=dr(Nn,Je,le-En,le+On,1,Ht.minY,Ht.maxY,Ue),fn=dr(Nn,Je,le+io,le+Ao,1,Ht.minY,Ht.maxY,Ue),Nn=null),bn&&(xn=dr(bn,Je,le-En,le+On,1,Ht.minY,Ht.maxY,Ue),Lr=dr(bn,Je,le+io,le+Ao,1,Ht.minY,Ht.maxY,Ue),bn=null),Ae>1&&console.timeEnd("clipping"),je.push(Sr||[],Ne+1,2*re,2*le),je.push(fn||[],Ne+1,2*re,2*le+1),je.push(xn||[],Ne+1,2*re+1,2*le),je.push(Lr||[],Ne+1,2*re+1,2*le+1)}}},dn.prototype.getTile=function(Lt,Ne,re){var le=this.options,ge=le.extent,ye=le.debug;if(Lt<0||Lt>24)return null;var ze=1<1&&console.log("drilling down to z%d-%d-%d",Lt,Ne,re);for(var Ue,Ae=Lt,Je=Ne,wt=re;!Ue&&Ae>0;)Ae--,Je=Math.floor(Je/2),wt=Math.floor(wt/2),Ue=this.tiles[co(Ae,Je,wt)];return Ue&&Ue.source?(ye>1&&console.log("found parent tile z%d-%d-%d",Ae,Je,wt),ye>1&&console.time("drilling down"),this.splitTile(Ue.source,Ae,Je,wt,Lt,Ne,re),ye>1&&console.timeEnd("drilling down"),this.tiles[je]?un(this.tiles[je],ge):null):null};class Ji extends He{constructor(Ne,re,le,ge){super(Ne,re,le),this._dataUpdateable=new Map,this.loadGeoJSON=(ye,ze)=>{const{promoteId:je}=ye;if(ye.request)return R.f(ye.request,(Ue,Ae,Je,wt)=>{this._dataUpdateable=Za(Ae,je)?ms(Ae,je):void 0,ze(Ue,Ae,Je,wt)});if(typeof ye.data=="string")try{const Ue=JSON.parse(ye.data);this._dataUpdateable=Za(Ue,je)?ms(Ue,je):void 0,ze(null,Ue)}catch(Ue){ze(new Error(`Input data given to '${ye.source}' is not a valid GeoJSON object.`))}else ye.dataDiff?this._dataUpdateable?(function(Ue,Ae,Je){var wt,Ht,Fr,mr;if(Ae.removeAll&&Ue.clear(),Ae.remove)for(const Sr of Ae.remove)Ue.delete(Sr);if(Ae.add)for(const Sr of Ae.add){const fn=no(Sr,Je);fn!=null&&Ue.set(fn,Sr)}if(Ae.update)for(const Sr of Ae.update){let fn=Ue.get(Sr.id);if(fn==null)continue;const xn=!Sr.removeAllProperties&&(((wt=Sr.removeProperties)===null||wt===void 0?void 0:wt.length)>0||((Ht=Sr.addOrUpdateProperties)===null||Ht===void 0?void 0:Ht.length)>0);if((Sr.newGeometry||Sr.removeAllProperties||xn)&&(fn=Object.assign({},fn),Ue.set(Sr.id,fn),xn&&(fn.properties=Object.assign({},fn.properties))),Sr.newGeometry&&(fn.geometry=Sr.newGeometry),Sr.removeAllProperties)fn.properties={};else if(((Fr=Sr.removeProperties)===null||Fr===void 0?void 0:Fr.length)>0)for(const Lr of Sr.removeProperties)Object.prototype.hasOwnProperty.call(fn.properties,Lr)&&delete fn.properties[Lr];if(((mr=Sr.addOrUpdateProperties)===null||mr===void 0?void 0:mr.length)>0)for(const{key:Lr,value:Nn}of Sr.addOrUpdateProperties)fn.properties[Lr]=Nn}}(this._dataUpdateable,ye.dataDiff,je),ze(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):ze(new Error(`Cannot update existing geojson data in ${ye.source}`)):ze(new Error(`Input data given to '${ye.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},this.loadVectorData=this.loadGeoJSONTile,ge&&(this.loadGeoJSON=ge)}loadGeoJSONTile(Ne,re){const le=Ne.tileID.canonical;if(!this._geoJSONIndex)return re(null,null);const ge=this._geoJSONIndex.getTile(le.z,le.x,le.y);if(!ge)return re(null,null);const ye=new class{constructor(je){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=R.N,this.length=je.length,this._features=je}feature(je){return new class{constructor(Ue){this._feature=Ue,this.extent=R.N,this.type=Ue.type,this.properties=Ue.tags,"id"in Ue&&!isNaN(Ue.id)&&(this.id=parseInt(Ue.id,10))}loadGeometry(){if(this._feature.type===1){const Ue=[];for(const Ae of this._feature.geometry)Ue.push([new R.P(Ae[0],Ae[1])]);return Ue}{const Ue=[];for(const Ae of this._feature.geometry){const Je=[];for(const wt of Ae)Je.push(new R.P(wt[0],wt[1]));Ue.push(Je)}return Ue}}toGeoJSON(Ue,Ae,Je){return er.call(this,Ue,Ae,Je)}}(this._features[je])}}(ge.features);let ze=Pt(ye);ze.byteOffset===0&&ze.byteLength===ze.buffer.byteLength||(ze=new Uint8Array(ze)),re(null,{vectorTile:ye,rawData:ze.buffer})}loadData(Ne,re){var le;(le=this._pendingRequest)===null||le===void 0||le.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const ge=!!(Ne&&Ne.request&&Ne.request.collectResourceTiming)&&new R.bu(Ne.request);this._pendingCallback=re,this._pendingRequest=this.loadGeoJSON(Ne,(ye,ze)=>{if(delete this._pendingCallback,delete this._pendingRequest,ye||!ze)return re(ye);if(typeof ze!="object")return re(new Error(`Input data given to '${Ne.source}' is not a valid GeoJSON object.`));{et(ze,!0);try{if(Ne.filter){const Ue=R.bC(Ne.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ue.result==="error")throw new Error(Ue.value.map(Je=>`${Je.key}: ${Je.message}`).join(", "));ze={type:"FeatureCollection",features:ze.features.filter(Je=>Ue.value.evaluate({zoom:0},Je))}}this._geoJSONIndex=Ne.cluster?new yi(function({superclusterOptions:Ue,clusterProperties:Ae}){if(!Ae||!Ue)return Ue;const Je={},wt={},Ht={accumulated:null,zoom:0},Fr={properties:null},mr=Object.keys(Ae);for(const Sr of mr){const[fn,xn]=Ae[Sr],Lr=R.bC(xn),Nn=R.bC(typeof fn=="string"?[fn,["accumulated"],["get",Sr]]:fn);Je[Sr]=Lr.value,wt[Sr]=Nn.value}return Ue.map=Sr=>{Fr.properties=Sr;const fn={};for(const xn of mr)fn[xn]=Je[xn].evaluate(Ht,Fr);return fn},Ue.reduce=(Sr,fn)=>{Fr.properties=fn;for(const xn of mr)Ht.accumulated=Sr[xn],Sr[xn]=wt[xn].evaluate(Ht,Fr)},Ue}(Ne)).load(ze.features):function(Ue,Ae){return new dn(Ue,Ae)}(ze,Ne.geojsonVtOptions)}catch(Ue){return re(Ue)}this.loaded={};const je={};if(ge){const Ue=ge.finish();Ue&&(je.resourceTiming={},je.resourceTiming[Ne.source]=JSON.parse(JSON.stringify(Ue)))}re(null,je)}})}reloadTile(Ne,re){const le=this.loaded;return le&&le[Ne.uid]?super.reloadTile(Ne,re):this.loadTile(Ne,re)}removeSource(Ne,re){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),re()}getClusterExpansionZoom(Ne,re){try{re(null,this._geoJSONIndex.getClusterExpansionZoom(Ne.clusterId))}catch(le){re(le)}}getClusterChildren(Ne,re){try{re(null,this._geoJSONIndex.getChildren(Ne.clusterId))}catch(le){re(le)}}getClusterLeaves(Ne,re){try{re(null,this._geoJSONIndex.getLeaves(Ne.clusterId,Ne.limit,Ne.offset))}catch(le){re(le)}}}class Us{constructor(Ne){this.self=Ne,this.actor=new R.C(Ne,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:He,geojson:Ji},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(re,le)=>{if(this.workerSourceTypes[re])throw new Error(`Worker source with name "${re}" already registered.`);this.workerSourceTypes[re]=le},this.self.registerRTLTextPlugin=re=>{if(R.bD.isParsed())throw new Error("RTL text plugin already registered.");R.bD.applyArabicShaping=re.applyArabicShaping,R.bD.processBidirectionalText=re.processBidirectionalText,R.bD.processStyledBidirectionalText=re.processStyledBidirectionalText}}setReferrer(Ne,re){this.referrer=re}setImages(Ne,re,le){this.availableImages[Ne]=re;for(const ge in this.workerSources[Ne]){const ye=this.workerSources[Ne][ge];for(const ze in ye)ye[ze].availableImages=re}le()}setLayers(Ne,re,le){this.getLayerIndex(Ne).replace(re),le()}updateLayers(Ne,re,le){this.getLayerIndex(Ne).update(re.layers,re.removedIds),le()}loadTile(Ne,re,le){this.getWorkerSource(Ne,re.type,re.source).loadTile(re,le)}loadDEMTile(Ne,re,le){this.getDEMWorkerSource(Ne,re.source).loadTile(re,le)}reloadTile(Ne,re,le){this.getWorkerSource(Ne,re.type,re.source).reloadTile(re,le)}abortTile(Ne,re,le){this.getWorkerSource(Ne,re.type,re.source).abortTile(re,le)}removeTile(Ne,re,le){this.getWorkerSource(Ne,re.type,re.source).removeTile(re,le)}removeDEMTile(Ne,re){this.getDEMWorkerSource(Ne,re.source).removeTile(re)}removeSource(Ne,re,le){if(!this.workerSources[Ne]||!this.workerSources[Ne][re.type]||!this.workerSources[Ne][re.type][re.source])return;const ge=this.workerSources[Ne][re.type][re.source];delete this.workerSources[Ne][re.type][re.source],ge.removeSource!==void 0?ge.removeSource(re,le):le()}loadWorkerSource(Ne,re,le){try{this.self.importScripts(re.url),le()}catch(ge){le(ge.toString())}}syncRTLPluginState(Ne,re,le){try{R.bD.setState(re);const ge=R.bD.getPluginURL();if(R.bD.isLoaded()&&!R.bD.isParsed()&&ge!=null){this.self.importScripts(ge);const ye=R.bD.isParsed();le(ye?void 0:new Error(`RTL Text Plugin failed to import scripts from ${ge}`),ye)}}catch(ge){le(ge.toString())}}getAvailableImages(Ne){let re=this.availableImages[Ne];return re||(re=[]),re}getLayerIndex(Ne){let re=this.layerIndexes[Ne];return re||(re=this.layerIndexes[Ne]=new de),re}getWorkerSource(Ne,re,le){return this.workerSources[Ne]||(this.workerSources[Ne]={}),this.workerSources[Ne][re]||(this.workerSources[Ne][re]={}),this.workerSources[Ne][re][le]||(this.workerSources[Ne][re][le]=new this.workerSourceTypes[re]({send:(ge,ye,ze)=>{this.actor.send(ge,ye,ze,Ne)}},this.getLayerIndex(Ne),this.getAvailableImages(Ne))),this.workerSources[Ne][re][le]}getDEMWorkerSource(Ne,re){return this.demWorkerSources[Ne]||(this.demWorkerSources[Ne]={}),this.demWorkerSources[Ne][re]||(this.demWorkerSources[Ne][re]=new Xe),this.demWorkerSources[Ne][re]}}return R.i()&&(self.worker=new Us(self)),Us}),Ze(["./shared"],function(R){"use strict";var de="3.6.2";class be{static testProp(s){if(!be.docStyle)return s[0];for(let x=0;x{window.removeEventListener("click",be.suppressClickInternal,!0)},0)}static mousePos(s,x){const I=s.getBoundingClientRect();return new R.P(x.clientX-I.left-s.clientLeft,x.clientY-I.top-s.clientTop)}static touchPos(s,x){const I=s.getBoundingClientRect(),k=[];for(let H=0;H{s=[],x=0,I=0,k={}},z.addThrottleControl=_e=>{const h=I++;return k[h]=_e,h},z.removeThrottleControl=_e=>{delete k[_e],ne()},z.getImage=(_e,h,g=!0)=>{Le.supported&&(_e.headers||(_e.headers={}),_e.headers.accept="image/webp,*/*");const d={requestParameters:_e,supportImageRefresh:g,callback:h,cancelled:!1,completed:!1,cancel:()=>{d.completed||d.cancelled||(d.cancelled=!0,d.innerRequest&&(d.innerRequest.cancel(),x--),ne())}};return s.push(d),ne(),d};const H=_e=>{const{requestParameters:h,supportImageRefresh:g,callback:d}=_e;return R.e(h,{type:"image"}),(g!==!1||R.i()||R.g(h.url)||h.headers&&!Object.keys(h.headers).reduce((b,B)=>b&&B==="accept",!0)?R.m:ue)(h,(b,B,G,q)=>{ee(_e,d,b,B,G,q)})},ee=(_e,h,g,d,b,B)=>{g?h(g):d instanceof HTMLImageElement||R.a(d)?h(null,d):d&&((G,q)=>{typeof createImageBitmap=="function"?R.b(G,q):R.d(G,q)})(d,(G,q)=>{G!=null?h(G):q!=null&&h(null,q,{cacheControl:b,expires:B})}),_e.cancelled||(_e.completed=!0,x--,ne())},ne=()=>{const _e=(()=>{const h=Object.keys(k);let g=!1;if(h.length>0){for(const d of h)if(g=k[d](),g)break}return g})()?R.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:R.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let h=x;h<_e&&s.length>0;h++){const g=s.shift();if(g.cancelled){h--;continue}const d=H(g);x++,g.innerRequest=d}},ue=(_e,h)=>{const g=new Image,d=_e.url;let b=!1;const B=_e.credentials;return B&&B==="include"?g.crossOrigin="use-credentials":(B&&B==="same-origin"||!R.s(d))&&(g.crossOrigin="anonymous"),g.fetchPriority="high",g.onload=()=>{h(null,g),g.onerror=g.onload=null},g.onerror=()=>{b||h(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")),g.onerror=g.onload=null},g.src=d,{cancel:()=>{b=!0,g.src=""}}}}(Ve||(Ve={})),Ve.resetRequestQueue(),function(z){z.Glyphs="Glyphs",z.Image="Image",z.Source="Source",z.SpriteImage="SpriteImage",z.SpriteJSON="SpriteJSON",z.Style="Style",z.Tile="Tile",z.Unknown="Unknown"}(et||(et={}));class er{constructor(s){this._transformRequestFn=s}transformRequest(s,x){return this._transformRequestFn&&this._transformRequestFn(s,x)||{url:s}}normalizeSpriteURL(s,x,I){const k=function(H){const ee=H.match(fr);if(!ee)throw new Error(`Unable to parse URL "${H}"`);return{protocol:ee[1],authority:ee[2],path:ee[3]||"/",params:ee[4]?ee[4].split("&"):[]}}(s);return k.path+=`${x}${I}`,function(H){const ee=H.params.length?`?${H.params.join("&")}`:"";return`${H.protocol}://${H.authority}${H.path}${ee}`}(k)}setTransformRequest(s){this._transformRequestFn=s}}const fr=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Ar(z){var s=new R.A(3);return s[0]=z[0],s[1]=z[1],s[2]=z[2],s}var pn,Kn=function(z,s,x){return z[0]=s[0]-x[0],z[1]=s[1]-x[1],z[2]=s[2]-x[2],z};pn=new R.A(3),R.A!=Float32Array&&(pn[0]=0,pn[1]=0,pn[2]=0);var Jn=function(z){var s=z[0],x=z[1];return s*s+x*x};function ki(z){const s=[];if(typeof z=="string")s.push({id:"default",url:z});else if(z&&z.length>0){const x=[];for(const{id:I,url:k}of z){const H=`${I}${k}`;x.indexOf(H)===-1&&(x.push(H),s.push({id:I,url:k}))}}return s}function pa(z,s,x,I,k){if(I)return void z(I);if(k!==Object.values(s).length||k!==Object.values(x).length)return;const H={};for(const ee in s){H[ee]={};const ne=R.h.getImageCanvasContext(x[ee]),ue=s[ee];for(const _e in ue){const{width:h,height:g,x:d,y:b,sdf:B,pixelRatio:G,stretchX:q,stretchY:te,content:fe}=ue[_e];H[ee][_e]={data:null,pixelRatio:G,sdf:B,stretchX:q,stretchY:te,content:fe,spriteData:{width:h,height:g,x:d,y:b,context:ne}}}}z(null,H)}(function(){var z=new R.A(2);R.A!=Float32Array&&(z[0]=0,z[1]=0)})();class xr{constructor(s,x,I,k){this.context=s,this.format=I,this.texture=s.gl.createTexture(),this.update(x,k)}update(s,x,I){const{width:k,height:H}=s,ee=!(this.size&&this.size[0]===k&&this.size[1]===H||I),{context:ne}=this,{gl:ue}=ne;if(this.useMipmap=!!(x&&x.useMipmap),ue.bindTexture(ue.TEXTURE_2D,this.texture),ne.pixelStoreUnpackFlipY.set(!1),ne.pixelStoreUnpack.set(1),ne.pixelStoreUnpackPremultiplyAlpha.set(this.format===ue.RGBA&&(!x||x.premultiply!==!1)),ee)this.size=[k,H],s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement||s instanceof ImageData||R.a(s)?ue.texImage2D(ue.TEXTURE_2D,0,this.format,this.format,ue.UNSIGNED_BYTE,s):ue.texImage2D(ue.TEXTURE_2D,0,this.format,k,H,0,this.format,ue.UNSIGNED_BYTE,s.data);else{const{x:_e,y:h}=I||{x:0,y:0};s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement||s instanceof ImageData||R.a(s)?ue.texSubImage2D(ue.TEXTURE_2D,0,_e,h,ue.RGBA,ue.UNSIGNED_BYTE,s):ue.texSubImage2D(ue.TEXTURE_2D,0,_e,h,k,H,ue.RGBA,ue.UNSIGNED_BYTE,s.data)}this.useMipmap&&this.isSizePowerOfTwo()&&ue.generateMipmap(ue.TEXTURE_2D)}bind(s,x,I){const{context:k}=this,{gl:H}=k;H.bindTexture(H.TEXTURE_2D,this.texture),I!==H.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(I=H.LINEAR),s!==this.filter&&(H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MAG_FILTER,s),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MIN_FILTER,I||s),this.filter=s),x!==this.wrap&&(H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_S,x),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_T,x),this.wrap=x)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:s}=this.context;s.deleteTexture(this.texture),this.texture=null}}function jt(z){const{userImage:s}=z;return!!(s&&s.render&&s.render())&&(z.data.replace(new Uint8Array(s.data.buffer)),!0)}class Jr extends R.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new R.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(s){if(this.loaded!==s&&(this.loaded=s,s)){for(const{ids:x,callback:I}of this.requestors)this._notify(x,I);this.requestors=[]}}getImage(s){const x=this.images[s];if(x&&!x.data&&x.spriteData){const I=x.spriteData;x.data=new R.R({width:I.width,height:I.height},I.context.getImageData(I.x,I.y,I.width,I.height).data),x.spriteData=null}return x}addImage(s,x){if(this.images[s])throw new Error(`Image id ${s} already exist, use updateImage instead`);this._validate(s,x)&&(this.images[s]=x)}_validate(s,x){let I=!0;const k=x.data||x.spriteData;return this._validateStretch(x.stretchX,k&&k.width)||(this.fire(new R.j(new Error(`Image "${s}" has invalid "stretchX" value`))),I=!1),this._validateStretch(x.stretchY,k&&k.height)||(this.fire(new R.j(new Error(`Image "${s}" has invalid "stretchY" value`))),I=!1),this._validateContent(x.content,x)||(this.fire(new R.j(new Error(`Image "${s}" has invalid "content" value`))),I=!1),I}_validateStretch(s,x){if(!s)return!0;let I=0;for(const k of s){if(k[0]-1);ue++,H[ue]=ne,ee[ue]=_e,ee[ue+1]=gr}for(let ne=0,ue=0;ne{let ne=this.entries[k];ne||(ne=this.entries[k]={glyphs:{},requests:{},ranges:{}});let ue=ne.glyphs[H];if(ue!==void 0)return void ee(null,{stack:k,id:H,glyph:ue});if(ue=this._tinySDF(ne,k,H),ue)return ne.glyphs[H]=ue,void ee(null,{stack:k,id:H,glyph:ue});const _e=Math.floor(H/256);if(256*_e>65535)return void ee(new Error("glyphs > 65535 not supported"));if(ne.ranges[_e])return void ee(null,{stack:k,id:H,glyph:ue});if(!this.url)return void ee(new Error("glyphsUrl is not set"));let h=ne.requests[_e];h||(h=ne.requests[_e]=[],qe.loadGlyphRange(k,_e,this.url,this.requestManager,(g,d)=>{if(d){for(const b in d)this._doesCharSupportLocalGlyph(+b)||(ne.glyphs[+b]=d[+b]);ne.ranges[_e]=!0}for(const b of h)b(g,d);delete ne.requests[_e]})),h.push((g,d)=>{g?ee(g):d&&ee(null,{stack:k,id:H,glyph:d[H]||null})})},(k,H)=>{if(k)x(k);else if(H){const ee={};for(const{stack:ne,id:ue,glyph:_e}of H)(ee[ne]||(ee[ne]={}))[ue]=_e&&{id:_e.id,bitmap:_e.bitmap.clone(),metrics:_e.metrics};x(null,ee)}})}_doesCharSupportLocalGlyph(s){return!!this.localIdeographFontFamily&&(R.u["CJK Unified Ideographs"](s)||R.u["Hangul Syllables"](s)||R.u.Hiragana(s)||R.u.Katakana(s))}_tinySDF(s,x,I){const k=this.localIdeographFontFamily;if(!k||!this._doesCharSupportLocalGlyph(I))return;let H=s.tinySDF;if(!H){let ne="400";/bold/i.test(x)?ne="900":/medium/i.test(x)?ne="500":/light/i.test(x)&&(ne="200"),H=s.tinySDF=new qe.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:k,fontWeight:ne})}const ee=H.draw(String.fromCharCode(I));return{id:I,bitmap:new R.q({width:ee.width||60,height:ee.height||60},ee.data),metrics:{width:ee.glyphWidth/2||24,height:ee.glyphHeight/2||24,left:ee.glyphLeft/2+.5||0,top:ee.glyphTop/2-27.5||-8,advance:ee.glyphAdvance/2||24,isDoubleResolution:!0}}}}qe.loadGlyphRange=function(z,s,x,I,k){const H=256*s,ee=H+255,ne=I.transformRequest(x.replace("{fontstack}",z).replace("{range}",`${H}-${ee}`),et.Glyphs);R.l(ne,(ue,_e)=>{if(ue)k(ue);else if(_e){const h={};for(const g of R.n(_e))h[g.id]=g;k(null,h)}})},qe.TinySDF=class{constructor({fontSize:z=24,buffer:s=3,radius:x=8,cutoff:I=.25,fontFamily:k="sans-serif",fontWeight:H="normal",fontStyle:ee="normal"}={}){this.buffer=s,this.cutoff=I,this.radius=x;const ne=this.size=z+4*s,ue=this._createCanvas(ne),_e=this.ctx=ue.getContext("2d",{willReadFrequently:!0});_e.font=`${ee} ${H} ${z}px ${k}`,_e.textBaseline="alphabetic",_e.textAlign="left",_e.fillStyle="black",this.gridOuter=new Float64Array(ne*ne),this.gridInner=new Float64Array(ne*ne),this.f=new Float64Array(ne),this.z=new Float64Array(ne+1),this.v=new Uint16Array(ne)}_createCanvas(z){const s=document.createElement("canvas");return s.width=s.height=z,s}draw(z){const{width:s,actualBoundingBoxAscent:x,actualBoundingBoxDescent:I,actualBoundingBoxLeft:k,actualBoundingBoxRight:H}=this.ctx.measureText(z),ee=Math.ceil(x),ne=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(H-k))),ue=Math.min(this.size-this.buffer,ee+Math.ceil(I)),_e=ne+2*this.buffer,h=ue+2*this.buffer,g=Math.max(_e*h,0),d=new Uint8ClampedArray(g),b={data:d,width:_e,height:h,glyphWidth:ne,glyphHeight:ue,glyphTop:ee,glyphLeft:0,glyphAdvance:s};if(ne===0||ue===0)return b;const{ctx:B,buffer:G,gridInner:q,gridOuter:te}=this;B.clearRect(G,G,ne,ue),B.fillText(z,G,G+ee);const fe=B.getImageData(G,G,ne,ue);te.fill(gr,0,g),q.fill(0,0,g);for(let ce=0;ce0?Qe*Qe:0,q[Oe]=Qe<0?Qe*Qe:0}}rn(te,0,0,_e,h,_e,this.f,this.v,this.z),rn(q,G,G,ne,ue,_e,this.f,this.v,this.z);for(let ce=0;ce1&&(ue=s[++ne]);const h=Math.abs(_e-ue.left),g=Math.abs(_e-ue.right),d=Math.min(h,g);let b;const B=H/I*(k+1);if(ue.isDash){const G=k-Math.abs(B);b=Math.sqrt(d*d+G*G)}else b=k-Math.sqrt(d*d+B*B);this.data[ee+_e]=Math.max(0,Math.min(255,b+128))}}}addRegularDash(s){for(let ne=s.length-1;ne>=0;--ne){const ue=s[ne],_e=s[ne+1];ue.zeroLength?s.splice(ne,1):_e&&_e.isDash===ue.isDash&&(_e.left=ue.left,s.splice(ne,1))}const x=s[0],I=s[s.length-1];x.isDash===I.isDash&&(x.left=I.left-this.width,I.right=x.right+this.width);const k=this.width*this.nextRow;let H=0,ee=s[H];for(let ne=0;ne1&&(ee=s[++H]);const ue=Math.abs(ne-ee.left),_e=Math.abs(ne-ee.right),h=Math.min(ue,_e);this.data[k+ne]=Math.max(0,Math.min(255,(ee.isDash?h:-h)+128))}}addDash(s,x){const I=x?7:0,k=2*I+1;if(this.nextRow+k>this.height)return R.w("LineAtlas out of space"),null;let H=0;for(let ne=0;ne{k.send(s,x,H)},I=I||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(s=!0){this.actors.forEach(x=>{x.remove()}),this.actors=[],s&&this.workerPool.release(this.id)}}function ar(z,s,x){const I=function(k,H){if(k)return x(k);if(H){const ee=R.F(R.e(H,z),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);H.vector_layers&&(ee.vectorLayers=H.vector_layers,ee.vectorLayerIds=ee.vectorLayers.map(ne=>ne.id)),x(null,ee)}};return z.url?R.f(s.transformRequest(z.url,et.Source),I):R.h.frame(()=>I(null,z))}class wr{constructor(s,x){s&&(x?this.setSouthWest(s).setNorthEast(x):Array.isArray(s)&&(s.length===4?this.setSouthWest([s[0],s[1]]).setNorthEast([s[2],s[3]]):this.setSouthWest(s[0]).setNorthEast(s[1])))}setNorthEast(s){return this._ne=s instanceof R.L?new R.L(s.lng,s.lat):R.L.convert(s),this}setSouthWest(s){return this._sw=s instanceof R.L?new R.L(s.lng,s.lat):R.L.convert(s),this}extend(s){const x=this._sw,I=this._ne;let k,H;if(s instanceof R.L)k=s,H=s;else{if(!(s instanceof wr))return Array.isArray(s)?s.length===4||s.every(Array.isArray)?this.extend(wr.convert(s)):this.extend(R.L.convert(s)):s&&("lng"in s||"lon"in s)&&"lat"in s?this.extend(R.L.convert(s)):this;if(k=s._sw,H=s._ne,!k||!H)return this}return x||I?(x.lng=Math.min(k.lng,x.lng),x.lat=Math.min(k.lat,x.lat),I.lng=Math.max(H.lng,I.lng),I.lat=Math.max(H.lat,I.lat)):(this._sw=new R.L(k.lng,k.lat),this._ne=new R.L(H.lng,H.lat)),this}getCenter(){return new R.L((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new R.L(this.getWest(),this.getNorth())}getSouthEast(){return new R.L(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(s){const{lng:x,lat:I}=R.L.convert(s);let k=this._sw.lng<=x&&x<=this._ne.lng;return this._sw.lng>this._ne.lng&&(k=this._sw.lng>=x&&x>=this._ne.lng),this._sw.lat<=I&&I<=this._ne.lat&&k}static convert(s){return s instanceof wr?s:s&&new wr(s)}static fromLngLat(s,x=0){const I=360*x/40075017,k=I/Math.cos(Math.PI/180*s.lat);return new wr(new R.L(s.lng-k,s.lat-I),new R.L(s.lng+k,s.lat+I))}}class Cr{constructor(s,x,I){this.bounds=wr.convert(this.validateBounds(s)),this.minzoom=x||0,this.maxzoom=I||24}validateBounds(s){return Array.isArray(s)&&s.length===4?[Math.max(-180,s[0]),Math.max(-90,s[1]),Math.min(180,s[2]),Math.min(90,s[3])]:[-180,-90,180,90]}contains(s){const x=Math.pow(2,s.z),I=Math.floor(R.G(this.bounds.getWest())*x),k=Math.floor(R.H(this.bounds.getNorth())*x),H=Math.ceil(R.G(this.bounds.getEast())*x),ee=Math.ceil(R.H(this.bounds.getSouth())*x);return s.x>=I&&s.x=k&&s.y{this._loaded=!1,this.fire(new R.k("dataloading",{dataType:"source"})),this._tileJSONRequest=ar(this._options,this.map._requestManager,(H,ee)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),H?this.fire(new R.j(H)):ee&&(R.e(this,ee),ee.bounds&&(this.tileBounds=new Cr(ee.bounds,this.minzoom,this.maxzoom)),this.fire(new R.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new R.k("data",{dataType:"source",sourceDataType:"content"})))})},this.serialize=()=>R.e({},this._options),this.id=s,this.dispatcher=I,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,R.e(this,R.F(x,["url","scheme","tileSize","promoteId"])),this._options=R.e({type:"vector"},x),this._collectResourceTiming=x.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(k)}loaded(){return this._loaded}hasTile(s){return!this.tileBounds||this.tileBounds.contains(s.canonical)}onAdd(s){this.map=s,this.load()}setSourceProperty(s){this._tileJSONRequest&&this._tileJSONRequest.cancel(),s(),this.load()}setTiles(s){return this.setSourceProperty(()=>{this._options.tiles=s}),this}setUrl(s){return this.setSourceProperty(()=>{this.url=s,this._options.url=s}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}loadTile(s,x){const I=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),k={request:this.map._requestManager.transformRequest(I,et.Tile),uid:s.uid,tileID:s.tileID,zoom:s.tileID.overscaledZ,tileSize:this.tileSize*s.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function H(ee,ne){return delete s.request,s.aborted?x(null):ee&&ee.status!==404?x(ee):(ne&&ne.resourceTiming&&(s.resourceTiming=ne.resourceTiming),this.map._refreshExpiredTiles&&ne&&s.setExpiryData(ne),s.loadVectorData(ne,this.map.painter),x(null),void(s.reloadCallback&&(this.loadTile(s,s.reloadCallback),s.reloadCallback=null)))}k.request.collectResourceTiming=this._collectResourceTiming,s.actor&&s.state!=="expired"?s.state==="loading"?s.reloadCallback=x:s.request=s.actor.send("reloadTile",k,H.bind(this)):(s.actor=this.dispatcher.getActor(),s.request=s.actor.send("loadTile",k,H.bind(this)))}abortTile(s){s.request&&(s.request.cancel(),delete s.request),s.actor&&s.actor.send("abortTile",{uid:s.uid,type:this.type,source:this.id},void 0)}unloadTile(s){s.unloadVectorData(),s.actor&&s.actor.send("removeTile",{uid:s.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class yi extends R.E{constructor(s,x,I,k){super(),this.id=s,this.dispatcher=I,this.setEventedParent(k),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=R.e({type:"raster"},x),R.e(this,R.F(x,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new R.k("dataloading",{dataType:"source"})),this._tileJSONRequest=ar(this._options,this.map._requestManager,(s,x)=>{this._tileJSONRequest=null,this._loaded=!0,s?this.fire(new R.j(s)):x&&(R.e(this,x),x.bounds&&(this.tileBounds=new Cr(x.bounds,this.minzoom,this.maxzoom)),this.fire(new R.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new R.k("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(s){this.map=s,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}setSourceProperty(s){this._tileJSONRequest&&this._tileJSONRequest.cancel(),s(),this.load()}setTiles(s){return this.setSourceProperty(()=>{this._options.tiles=s}),this}serialize(){return R.e({},this._options)}hasTile(s){return!this.tileBounds||this.tileBounds.contains(s.canonical)}loadTile(s,x){const I=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);s.request=Ve.getImage(this.map._requestManager.transformRequest(I,et.Tile),(k,H,ee)=>{if(delete s.request,s.aborted)s.state="unloaded",x(null);else if(k)s.state="errored",x(k);else if(H){this.map._refreshExpiredTiles&&ee&&s.setExpiryData(ee);const ne=this.map.painter.context,ue=ne.gl;s.texture=this.map.painter.getTileTexture(H.width),s.texture?s.texture.update(H,{useMipmap:!0}):(s.texture=new xr(ne,H,ue.RGBA,{useMipmap:!0}),s.texture.bind(ue.LINEAR,ue.CLAMP_TO_EDGE,ue.LINEAR_MIPMAP_NEAREST),ne.extTextureFilterAnisotropic&&ue.texParameterf(ue.TEXTURE_2D,ne.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,ne.extTextureFilterAnisotropicMax)),s.state="loaded",x(null)}},this.map._refreshExpiredTiles)}abortTile(s,x){s.request&&(s.request.cancel(),delete s.request),x()}unloadTile(s,x){s.texture&&this.map.painter.saveTileTexture(s.texture),x()}hasTransition(){return!1}}class li extends yi{constructor(s,x,I,k){super(s,x,I,k),this.type="raster-dem",this.maxzoom=22,this._options=R.e({type:"raster-dem"},x),this.encoding=x.encoding||"mapbox",this.redFactor=x.redFactor,this.greenFactor=x.greenFactor,this.blueFactor=x.blueFactor,this.baseShift=x.baseShift}loadTile(s,x){const I=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),k=this.map._requestManager.transformRequest(I,et.Tile);function H(ee,ne){ee&&(s.state="errored",x(ee)),ne&&(s.dem=ne,s.needsHillshadePrepare=!0,s.needsTerrainPrepare=!0,s.state="loaded",x(null))}s.neighboringTiles=this._getNeighboringTiles(s.tileID),s.request=Ve.getImage(k,(ee,ne,ue)=>R._(this,void 0,void 0,function*(){if(delete s.request,s.aborted)s.state="unloaded",x(null);else if(ee)s.state="errored",x(ee);else if(ne){this.map._refreshExpiredTiles&&s.setExpiryData(ue);const _e=R.a(ne)&&R.J()?ne:yield function(g){return R._(this,void 0,void 0,function*(){if(typeof VideoFrame!="undefined"&&R.K()){const d=g.width+2,b=g.height+2;try{return new R.R({width:d,height:b},yield R.M(g,-1,-1,d,b))}catch(B){}}return R.h.getImageData(g,1)})}(ne),h={uid:s.uid,coord:s.tileID,source:this.id,rawImageData:_e,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};s.actor&&s.state!=="expired"||(s.actor=this.dispatcher.getActor(),s.actor.send("loadDEMTile",h,H))}}),this.map._refreshExpiredTiles)}_getNeighboringTiles(s){const x=s.canonical,I=Math.pow(2,x.z),k=(x.x-1+I)%I,H=x.x===0?s.wrap-1:s.wrap,ee=(x.x+1+I)%I,ne=x.x+1===I?s.wrap+1:s.wrap,ue={};return ue[new R.O(s.overscaledZ,H,x.z,k,x.y).key]={backfilled:!1},ue[new R.O(s.overscaledZ,ne,x.z,ee,x.y).key]={backfilled:!1},x.y>0&&(ue[new R.O(s.overscaledZ,H,x.z,k,x.y-1).key]={backfilled:!1},ue[new R.O(s.overscaledZ,s.wrap,x.z,x.x,x.y-1).key]={backfilled:!1},ue[new R.O(s.overscaledZ,ne,x.z,ee,x.y-1).key]={backfilled:!1}),x.y+1{this._updateWorkerData()},this.serialize=()=>R.e({},this._options,{type:this.type,data:this._data}),this.id=s,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=I.getActor(),this.setEventedParent(k),this._data=x.data,this._options=R.e({},x),this._collectResourceTiming=x.collectResourceTiming,x.maxzoom!==void 0&&(this.maxzoom=x.maxzoom),x.type&&(this.type=x.type),x.attribution&&(this.attribution=x.attribution),this.promoteId=x.promoteId;const H=R.N/this.tileSize;this.workerOptions=R.e({source:this.id,cluster:x.cluster||!1,geojsonVtOptions:{buffer:(x.buffer!==void 0?x.buffer:128)*H,tolerance:(x.tolerance!==void 0?x.tolerance:.375)*H,extent:R.N,maxZoom:this.maxzoom,lineMetrics:x.lineMetrics||!1,generateId:x.generateId||!1},superclusterOptions:{maxZoom:x.clusterMaxZoom!==void 0?x.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,x.clusterMinPoints||2),extent:R.N,radius:(x.clusterRadius||50)*H,log:!1,generateId:x.generateId||!1},clusterProperties:x.clusterProperties,filter:x.filter},x.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}onAdd(s){this.map=s,this.load()}setData(s){return this._data=s,this._updateWorkerData(),this}updateData(s){return this._updateWorkerData(s),this}setClusterOptions(s){return this.workerOptions.cluster=s.cluster,s&&(s.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=s.clusterRadius),s.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=s.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(s,x){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:s,source:this.id},x),this}getClusterChildren(s,x){return this.actor.send("geojson.getClusterChildren",{clusterId:s,source:this.id},x),this}getClusterLeaves(s,x,I,k){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:s,limit:x,offset:I},k),this}_updateWorkerData(s){const x=R.e({},this.workerOptions);s?x.dataDiff=s:typeof this._data=="string"?(x.request=this.map._requestManager.transformRequest(R.h.resolveURL(this._data),et.Source),x.request.collectResourceTiming=this._collectResourceTiming):x.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new R.k("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,x,(I,k)=>{if(this._pendingLoads--,this._removed||k&&k.abandoned)return void this.fire(new R.k("dataabort",{dataType:"source"}));let H=null;if(k&&k.resourceTiming&&k.resourceTiming[this.id]&&(H=k.resourceTiming[this.id].slice(0)),I)return void this.fire(new R.j(I));const ee={dataType:"source"};this._collectResourceTiming&&H&&H.length>0&&R.e(ee,{resourceTiming:H}),this.fire(new R.k("data",Object.assign(Object.assign({},ee),{sourceDataType:"metadata"}))),this.fire(new R.k("data",Object.assign(Object.assign({},ee),{sourceDataType:"content"})))})}loaded(){return this._pendingLoads===0}loadTile(s,x){const I=s.actor?"reloadTile":"loadTile";s.actor=this.actor;const k={type:this.type,uid:s.uid,tileID:s.tileID,zoom:s.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};s.request=this.actor.send(I,k,(H,ee)=>(delete s.request,s.unloadVectorData(),s.aborted?x(null):H?x(H):(s.loadVectorData(ee,this.map.painter,I==="reloadTile"),x(null))))}abortTile(s){s.request&&(s.request.cancel(),delete s.request),s.aborted=!0}unloadTile(s){s.unloadVectorData(),this.actor.send("removeTile",{uid:s.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}hasTransition(){return!1}}var vi=R.Q([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class bo extends R.E{constructor(s,x,I,k){super(),this.load=(H,ee)=>{this._loaded=!1,this.fire(new R.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=Ve.getImage(this.map._requestManager.transformRequest(this.url,et.Image),(ne,ue)=>{this._request=null,this._loaded=!0,ne?this.fire(new R.j(ne)):ue&&(this.image=ue,H&&(this.coordinates=H),ee&&ee(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||!this.image)return;const H=this.map.painter.context,ee=H.gl;this.boundsBuffer||(this.boundsBuffer=H.createVertexBuffer(this._boundsArray,vi.members)),this.boundsSegments||(this.boundsSegments=R.S.simpleSegment(0,0,4,2)),this.texture||(this.texture=new xr(H,this.image,ee.RGBA),this.texture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE));let ne=!1;for(const ue in this.tiles){const _e=this.tiles[ue];_e.state!=="loaded"&&(_e.state="loaded",_e.texture=this.texture,ne=!0)}ne&&this.fire(new R.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"image",url:this.options.url,coordinates:this.coordinates}),this.id=s,this.dispatcher=I,this.coordinates=x.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(k),this.options=x}loaded(){return this._loaded}updateImage(s){return s.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=s.url,this.load(s.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new R.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(s){this.map=s,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(s){this.coordinates=s;const x=s.map(R.U.fromLngLat);this.tileID=function(k){let H=1/0,ee=1/0,ne=-1/0,ue=-1/0;for(const d of k)H=Math.min(H,d.x),ee=Math.min(ee,d.y),ne=Math.max(ne,d.x),ue=Math.max(ue,d.y);const _e=Math.max(ne-H,ue-ee),h=Math.max(0,Math.floor(-Math.log(_e)/Math.LN2)),g=Math.pow(2,h);return new R.W(h,Math.floor((H+ne)/2*g),Math.floor((ee+ue)/2*g))}(x),this.minzoom=this.maxzoom=this.tileID.z;const I=x.map(k=>this.tileID.getTilePoint(k)._round());return this._boundsArray=new R.V,this._boundsArray.emplaceBack(I[0].x,I[0].y,0,0),this._boundsArray.emplaceBack(I[1].x,I[1].y,R.N,0),this._boundsArray.emplaceBack(I[3].x,I[3].y,0,R.N),this._boundsArray.emplaceBack(I[2].x,I[2].y,R.N,R.N),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new R.k("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(s,x){this.tileID&&this.tileID.equals(s.tileID.canonical)?(this.tiles[String(s.tileID.wrap)]=s,s.buckets={},x(null)):(s.state="errored",x(null))}hasTransition(){return!1}}class So extends bo{constructor(s,x,I,k){super(s,x,I,k),this.load=()=>{this._loaded=!1;const H=this.options;this.urls=[];for(const ee of H.urls)this.urls.push(this.map._requestManager.transformRequest(ee,et.Source).url);R.X(this.urls,(ee,ne)=>{this._loaded=!0,ee?this.fire(new R.j(ee)):ne&&(this.video=ne,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const H=this.map.painter.context,ee=H.gl;this.boundsBuffer||(this.boundsBuffer=H.createVertexBuffer(this._boundsArray,vi.members)),this.boundsSegments||(this.boundsSegments=R.S.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE),ee.texSubImage2D(ee.TEXTURE_2D,0,0,0,ee.RGBA,ee.UNSIGNED_BYTE,this.video)):(this.texture=new xr(H,this.video,ee.RGBA),this.texture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE));let ne=!1;for(const ue in this.tiles){const _e=this.tiles[ue];_e.state!=="loaded"&&(_e.state="loaded",_e.texture=this.texture,ne=!0)}ne&&this.fire(new R.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"video",urls:this.urls,coordinates:this.coordinates}),this.roundZoom=!0,this.type="video",this.options=x}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(s){if(this.video){const x=this.video.seekable;sx.end(0)?this.fire(new R.j(new R.Y(`sources.${this.id}`,null,`Playback for this video can be set only between the ${x.start(0)} and ${x.end(0)}-second mark.`))):this.video.currentTime=s}}getVideo(){return this.video}onAdd(s){this.map||(this.map=s,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}hasTransition(){return this.video&&!this.video.paused}}class Xi extends bo{constructor(s,x,I,k){super(s,x,I,k),this.load=()=>{this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new R.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},this.prepare=()=>{let H=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,H=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,H=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const ee=this.map.painter.context,ne=ee.gl;this.boundsBuffer||(this.boundsBuffer=ee.createVertexBuffer(this._boundsArray,vi.members)),this.boundsSegments||(this.boundsSegments=R.S.simpleSegment(0,0,4,2)),this.texture?(H||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new xr(ee,this.canvas,ne.RGBA,{premultiply:!0});let ue=!1;for(const _e in this.tiles){const h=this.tiles[_e];h.state!=="loaded"&&(h.state="loaded",h.texture=this.texture,ue=!0)}ue&&this.fire(new R.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"canvas",coordinates:this.coordinates}),x.coordinates?Array.isArray(x.coordinates)&&x.coordinates.length===4&&!x.coordinates.some(H=>!Array.isArray(H)||H.length!==2||H.some(ee=>typeof ee!="number"))||this.fire(new R.j(new R.Y(`sources.${s}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new R.j(new R.Y(`sources.${s}`,null,'missing required property "coordinates"'))),x.animate&&typeof x.animate!="boolean"&&this.fire(new R.j(new R.Y(`sources.${s}`,null,'optional "animate" property must be a boolean value'))),x.canvas?typeof x.canvas=="string"||x.canvas instanceof HTMLCanvasElement||this.fire(new R.j(new R.Y(`sources.${s}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new R.j(new R.Y(`sources.${s}`,null,'missing required property "canvas"'))),this.options=x,this.animate=x.animate===void 0||x.animate}getCanvas(){return this.canvas}onAdd(s){this.map=s,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const s of[this.canvas.width,this.canvas.height])if(isNaN(s)||s<=0)return!0;return!1}}const Mi={},qo=z=>{switch(z){case"geojson":return Uo;case"image":return bo;case"raster":return yi;case"raster-dem":return li;case"vector":return an;case"video":return So;case"canvas":return Xi}return Mi[z]};function ui(z,s){const x=R.Z();return R.$(x,x,[1,1,0]),R.a0(x,x,[.5*z.width,.5*z.height,1]),R.a1(x,x,z.calculatePosMatrix(s.toUnwrapped()))}function Qi(z,s,x,I,k,H){const ee=function(g,d,b){if(g)for(const B of g){const G=d[B];if(G&&G.source===b&&G.type==="fill-extrusion")return!0}else for(const B in d){const G=d[B];if(G.source===b&&G.type==="fill-extrusion")return!0}return!1}(k&&k.layers,s,z.id),ne=H.maxPitchScaleFactor(),ue=z.tilesIn(I,ne,ee);ue.sort(Vi);const _e=[];for(const g of ue)_e.push({wrappedTileID:g.tileID.wrapped().key,queryResults:g.tile.queryRenderedFeatures(s,x,z._state,g.queryGeometry,g.cameraQueryGeometry,g.scale,k,H,ne,ui(z.transform,g.tileID))});const h=function(g){const d={},b={};for(const B of g){const G=B.queryResults,q=B.wrappedTileID,te=b[q]=b[q]||{};for(const fe in G){const ce=G[fe],Te=te[fe]=te[fe]||{},Ie=d[fe]=d[fe]||[];for(const Oe of ce)Te[Oe.featureIndex]||(Te[Oe.featureIndex]=!0,Ie.push(Oe))}}return d}(_e);for(const g in h)h[g].forEach(d=>{const b=d.feature,B=z.getFeatureState(b.layer["source-layer"],b.id);b.source=b.layer.source,b.layer["source-layer"]&&(b.sourceLayer=b.layer["source-layer"]),b.state=B});return h}function Vi(z,s){const x=z.tileID,I=s.tileID;return x.overscaledZ-I.overscaledZ||x.canonical.y-I.canonical.y||x.wrap-I.wrap||x.canonical.x-I.canonical.x}class Pi{constructor(s,x){this.timeAdded=0,this.fadeEndTime=0,this.tileID=s,this.uid=R.a2(),this.uses=0,this.tileSize=x,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(s){const x=s+this.timeAdded;xH.getLayer(_e)).filter(Boolean);if(ue.length!==0){ne.layers=ue,ne.stateDependentLayerIds&&(ne.stateDependentLayers=ne.stateDependentLayerIds.map(_e=>ue.filter(h=>h.id===_e)[0]));for(const _e of ue)ee[_e.id]=ne}}return ee}(s.buckets,x.style),this.hasSymbolBuckets=!1;for(const k in this.buckets){const H=this.buckets[k];if(H instanceof R.a4){if(this.hasSymbolBuckets=!0,!I)break;H.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const k in this.buckets){const H=this.buckets[k];if(H instanceof R.a4&&H.hasRTLText){this.hasRTLText=!0,R.a5();break}}this.queryPadding=0;for(const k in this.buckets){const H=this.buckets[k];this.queryPadding=Math.max(this.queryPadding,x.style.getLayer(k).queryRadius(H))}s.imageAtlas&&(this.imageAtlas=s.imageAtlas),s.glyphAtlasImage&&(this.glyphAtlasImage=s.glyphAtlasImage)}else this.collisionBoxArray=new R.a3}unloadVectorData(){for(const s in this.buckets)this.buckets[s].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(s){return this.buckets[s.id]}upload(s){for(const I in this.buckets){const k=this.buckets[I];k.uploadPending()&&k.upload(s)}const x=s.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new xr(s,this.imageAtlas.image,x.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new xr(s,this.glyphAtlasImage,x.ALPHA),this.glyphAtlasImage=null)}prepare(s){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(s,this.imageAtlasTexture)}queryRenderedFeatures(s,x,I,k,H,ee,ne,ue,_e,h){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:k,cameraQueryGeometry:H,scale:ee,tileSize:this.tileSize,pixelPosMatrix:h,transform:ue,params:ne,queryPadding:this.queryPadding*_e},s,x,I):{}}querySourceFeatures(s,x){const I=this.latestFeatureIndex;if(!I||!I.rawTileData)return;const k=I.loadVTLayers(),H=x&&x.sourceLayer?x.sourceLayer:"",ee=k._geojsonTileLayer||k[H];if(!ee)return;const ne=R.a6(x&&x.filter),{z:ue,x:_e,y:h}=this.tileID.canonical,g={z:ue,x:_e,y:h};for(let d=0;dI)k=!1;else if(x)if(this.expirationTime{this.remove(s,H)},I)),this.data[k].push(H),this.order.push(k),this.order.length>this.max){const ee=this._getAndRemoveByKey(this.order[0]);ee&&this.onRemove(ee)}return this}has(s){return s.wrapped().key in this.data}getAndRemove(s){return this.has(s)?this._getAndRemoveByKey(s.wrapped().key):null}_getAndRemoveByKey(s){const x=this.data[s].shift();return x.timeout&&clearTimeout(x.timeout),this.data[s].length===0&&delete this.data[s],this.order.splice(this.order.indexOf(s),1),x.value}getByKey(s){const x=this.data[s];return x?x[0].value:null}get(s){return this.has(s)?this.data[s.wrapped().key][0].value:null}remove(s,x){if(!this.has(s))return this;const I=s.wrapped().key,k=x===void 0?0:this.data[I].indexOf(x),H=this.data[I][k];return this.data[I].splice(k,1),H.timeout&&clearTimeout(H.timeout),this.data[I].length===0&&delete this.data[I],this.onRemove(H.value),this.order.splice(this.order.indexOf(I),1),this}setMaxSize(s){for(this.max=s;this.order.length>this.max;){const x=this._getAndRemoveByKey(this.order[0]);x&&this.onRemove(x)}return this}filter(s){const x=[];for(const I in this.data)for(const k of this.data[I])s(k.value)||x.push(k);for(const I of x)this.remove(I.value.tileID,I)}}class Ur{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(s,x,I){const k=String(x);if(this.stateChanges[s]=this.stateChanges[s]||{},this.stateChanges[s][k]=this.stateChanges[s][k]||{},R.e(this.stateChanges[s][k],I),this.deletedStates[s]===null){this.deletedStates[s]={};for(const H in this.state[s])H!==k&&(this.deletedStates[s][H]=null)}else if(this.deletedStates[s]&&this.deletedStates[s][k]===null){this.deletedStates[s][k]={};for(const H in this.state[s][k])I[H]||(this.deletedStates[s][k][H]=null)}else for(const H in I)this.deletedStates[s]&&this.deletedStates[s][k]&&this.deletedStates[s][k][H]===null&&delete this.deletedStates[s][k][H]}removeFeatureState(s,x,I){if(this.deletedStates[s]===null)return;const k=String(x);if(this.deletedStates[s]=this.deletedStates[s]||{},I&&x!==void 0)this.deletedStates[s][k]!==null&&(this.deletedStates[s][k]=this.deletedStates[s][k]||{},this.deletedStates[s][k][I]=null);else if(x!==void 0)if(this.stateChanges[s]&&this.stateChanges[s][k])for(I in this.deletedStates[s][k]={},this.stateChanges[s][k])this.deletedStates[s][k][I]=null;else this.deletedStates[s][k]=null;else this.deletedStates[s]=null}getState(s,x){const I=String(x),k=R.e({},(this.state[s]||{})[I],(this.stateChanges[s]||{})[I]);if(this.deletedStates[s]===null)return{};if(this.deletedStates[s]){const H=this.deletedStates[s][x];if(H===null)return{};for(const ee in H)delete k[ee]}return k}initializeTileState(s,x){s.setFeatureState(this.state,x)}coalesceChanges(s,x){const I={};for(const k in this.stateChanges){this.state[k]=this.state[k]||{};const H={};for(const ee in this.stateChanges[k])this.state[k][ee]||(this.state[k][ee]={}),R.e(this.state[k][ee],this.stateChanges[k][ee]),H[ee]=this.state[k][ee];I[k]=H}for(const k in this.deletedStates){this.state[k]=this.state[k]||{};const H={};if(this.deletedStates[k]===null)for(const ee in this.state[k])H[ee]={},this.state[k][ee]={};else for(const ee in this.deletedStates[k]){if(this.deletedStates[k][ee]===null)this.state[k][ee]={};else for(const ne of Object.keys(this.deletedStates[k][ee]))delete this.state[k][ee][ne];H[ee]=this.state[k][ee]}I[k]=I[k]||{},R.e(I[k],H)}if(this.stateChanges={},this.deletedStates={},Object.keys(I).length!==0)for(const k in s)s[k].setFeatureState(I,x)}}class ls extends R.E{constructor(s,x,I){super(),this.id=s,this.dispatcher=I,this.on("data",k=>{k.dataType==="source"&&k.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&k.dataType==="source"&&k.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((k,H,ee,ne)=>{const ue=new(qo(H.type))(k,H,ee,ne);if(ue.id!==k)throw new Error(`Expected Source id to be ${k} instead of ${ue.id}`);return ue})(s,x,I,this),this._tiles={},this._cache=new ds(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ur,this._didEmitContent=!1,this._updated=!1}onAdd(s){this.map=s,this._maxTileCacheSize=s?s._maxTileCacheSize:null,this._maxTileCacheZoomLevels=s?s._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(s)}onRemove(s){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(s)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const s in this._tiles){const x=this._tiles[s];if(x.state!=="loaded"&&x.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const s=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,s&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(s,x){return this._source.loadTile(s,x)}_unloadTile(s){if(this._source.unloadTile)return this._source.unloadTile(s,()=>{})}_abortTile(s){this._source.abortTile&&this._source.abortTile(s,()=>{}),this._source.fire(new R.k("dataabort",{tile:s,coord:s.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(s){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const x in this._tiles){const I=this._tiles[x];I.upload(s),I.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(s=>s.tileID).sort(dr).map(s=>s.key)}getRenderableIds(s){const x=[];for(const I in this._tiles)this._isIdRenderable(I,s)&&x.push(this._tiles[I]);return s?x.sort((I,k)=>{const H=I.tileID,ee=k.tileID,ne=new R.P(H.canonical.x,H.canonical.y)._rotate(this.transform.angle),ue=new R.P(ee.canonical.x,ee.canonical.y)._rotate(this.transform.angle);return H.overscaledZ-ee.overscaledZ||ue.y-ne.y||ue.x-ne.x}).map(I=>I.tileID.key):x.map(I=>I.tileID).sort(dr).map(I=>I.key)}hasRenderableParent(s){const x=this.findLoadedParent(s,0);return!!x&&this._isIdRenderable(x.tileID.key)}_isIdRenderable(s,x){return this._tiles[s]&&this._tiles[s].hasData()&&!this._coveredTiles[s]&&(x||!this._tiles[s].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const s in this._tiles)this._tiles[s].state!=="errored"&&this._reloadTile(s,"reloading")}}_reloadTile(s,x){const I=this._tiles[s];I&&(I.state!=="loading"&&(I.state=x),this._loadTile(I,this._tileLoaded.bind(this,I,s,x)))}_tileLoaded(s,x,I,k){if(k)return s.state="errored",void(k.status!==404?this._source.fire(new R.j(k,{tile:s})):this.update(this.transform,this.terrain));s.timeAdded=R.h.now(),I==="expired"&&(s.refreshedUponExpiration=!0),this._setTileReloadTimer(x,s),this.getSource().type==="raster-dem"&&s.dem&&this._backfillDEM(s),this._state.initializeTileState(s,this.map?this.map.painter:null),s.aborted||this._source.fire(new R.k("data",{dataType:"source",tile:s,coord:s.tileID}))}_backfillDEM(s){const x=this.getRenderableIds();for(let k=0;k1||(Math.abs(ee)>1&&(Math.abs(ee+ue)===1?ee+=ue:Math.abs(ee-ue)===1&&(ee-=ue)),H.dem&&k.dem&&(k.dem.backfillBorder(H.dem,ee,ne),k.neighboringTiles&&k.neighboringTiles[_e]&&(k.neighboringTiles[_e].backfilled=!0)))}}getTile(s){return this.getTileByID(s.key)}getTileByID(s){return this._tiles[s]}_retainLoadedChildren(s,x,I,k){for(const H in this._tiles){let ee=this._tiles[H];if(k[H]||!ee.hasData()||ee.tileID.overscaledZ<=x||ee.tileID.overscaledZ>I)continue;let ne=ee.tileID;for(;ee&&ee.tileID.overscaledZ>x+1;){const _e=ee.tileID.scaledTo(ee.tileID.overscaledZ-1);ee=this._tiles[_e.key],ee&&ee.hasData()&&(ne=_e)}let ue=ne;for(;ue.overscaledZ>x;)if(ue=ue.scaledTo(ue.overscaledZ-1),s[ue.key]){k[ne.key]=ne;break}}}findLoadedParent(s,x){if(s.key in this._loadedParentTiles){const I=this._loadedParentTiles[s.key];return I&&I.tileID.overscaledZ>=x?I:null}for(let I=s.overscaledZ-1;I>=x;I--){const k=s.scaledTo(I),H=this._getLoadedTile(k);if(H)return H}}_getLoadedTile(s){const x=this._tiles[s.key];return x&&x.hasData()?x:this._cache.getByKey(s.wrapped().key)}updateCacheSize(s){const x=Math.ceil(s.width/this._source.tileSize)+1,I=Math.ceil(s.height/this._source.tileSize)+1,k=Math.floor(x*I*(this._maxTileCacheZoomLevels===null?R.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),H=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,k):k;this._cache.setMaxSize(H)}handleWrapJump(s){const x=Math.round((s-(this._prevLng===void 0?s:this._prevLng))/360);if(this._prevLng=s,x){const I={};for(const k in this._tiles){const H=this._tiles[k];H.tileID=H.tileID.unwrapTo(H.tileID.wrap+x),I[H.tileID.key]=H}this._tiles=I;for(const k in this._timers)clearTimeout(this._timers[k]),delete this._timers[k];for(const k in this._tiles)this._setTileReloadTimer(k,this._tiles[k])}}update(s,x){if(this.transform=s,this.terrain=x,!this._sourceLoaded||this._paused)return;let I;this.updateCacheSize(s),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?I=s.getVisibleUnwrappedCoordinates(this._source.tileID).map(h=>new R.O(h.canonical.z,h.wrap,h.canonical.z,h.canonical.x,h.canonical.y)):(I=s.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:x}),this._source.hasTile&&(I=I.filter(h=>this._source.hasTile(h)))):I=[];const k=s.coveringZoomLevel(this._source),H=Math.max(k-ls.maxOverzooming,this._source.minzoom),ee=Math.max(k+ls.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const h={};for(const g of I)if(g.canonical.z>this._source.minzoom){const d=g.scaledTo(g.canonical.z-1);h[d.key]=d;const b=g.scaledTo(Math.max(this._source.minzoom,Math.min(g.canonical.z,5)));h[b.key]=b}I=I.concat(Object.values(h))}const ne=I.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,ne&&this.fire(new R.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const ue=this._updateRetainedTiles(I,k);if(he(this._source.type)){const h={},g={},d=Object.keys(ue),b=R.h.now();for(const B of d){const G=ue[B],q=this._tiles[B];if(!q||q.fadeEndTime!==0&&q.fadeEndTime<=b)continue;const te=this.findLoadedParent(G,H);te&&(this._addTile(te.tileID),h[te.tileID.key]=te.tileID),g[B]=G}this._retainLoadedChildren(g,k,ee,ue);for(const B in h)ue[B]||(this._coveredTiles[B]=!0,ue[B]=h[B]);if(x){const B={},G={};for(const q of I)this._tiles[q.key].hasData()?B[q.key]=q:G[q.key]=q;for(const q in G){const te=G[q].children(this._source.maxzoom);this._tiles[te[0].key]&&this._tiles[te[1].key]&&this._tiles[te[2].key]&&this._tiles[te[3].key]&&(B[te[0].key]=ue[te[0].key]=te[0],B[te[1].key]=ue[te[1].key]=te[1],B[te[2].key]=ue[te[2].key]=te[2],B[te[3].key]=ue[te[3].key]=te[3],delete G[q])}for(const q in G){const te=this.findLoadedParent(G[q],this._source.minzoom);if(te){B[te.tileID.key]=ue[te.tileID.key]=te.tileID;for(const fe in B)B[fe].isChildOf(te.tileID)&&delete B[fe]}}for(const q in this._tiles)B[q]||(this._coveredTiles[q]=!0)}}for(const h in ue)this._tiles[h].clearFadeHold();const _e=R.ab(this._tiles,ue);for(const h of _e){const g=this._tiles[h];g.hasSymbolBuckets&&!g.holdingForFade()?g.setHoldDuration(this.map._fadeDuration):g.hasSymbolBuckets&&!g.symbolFadeFinished()||this._removeTile(h)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const s in this._tiles)this._tiles[s].holdingForFade()&&this._removeTile(s)}_updateRetainedTiles(s,x){const I={},k={},H=Math.max(x-ls.maxOverzooming,this._source.minzoom),ee=Math.max(x+ls.maxUnderzooming,this._source.minzoom),ne={};for(const ue of s){const _e=this._addTile(ue);I[ue.key]=ue,_e.hasData()||xthis._source.maxzoom){const g=ue.children(this._source.maxzoom)[0],d=this.getTile(g);if(d&&d.hasData()){I[g.key]=g;continue}}else{const g=ue.children(this._source.maxzoom);if(I[g[0].key]&&I[g[1].key]&&I[g[2].key]&&I[g[3].key])continue}let h=_e.wasRequested();for(let g=ue.overscaledZ-1;g>=H;--g){const d=ue.scaledTo(g);if(k[d.key])break;if(k[d.key]=!0,_e=this.getTile(d),!_e&&h&&(_e=this._addTile(d)),_e){const b=_e.hasData();if((h||b)&&(I[d.key]=d),h=_e.wasRequested(),b)break}}}return I}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const s in this._tiles){const x=[];let I,k=this._tiles[s].tileID;for(;k.overscaledZ>0;){if(k.key in this._loadedParentTiles){I=this._loadedParentTiles[k.key];break}x.push(k.key);const H=k.scaledTo(k.overscaledZ-1);if(I=this._getLoadedTile(H),I)break;k=H}for(const H of x)this._loadedParentTiles[H]=I}}_addTile(s){let x=this._tiles[s.key];if(x)return x;x=this._cache.getAndRemove(s),x&&(this._setTileReloadTimer(s.key,x),x.tileID=s,this._state.initializeTileState(x,this.map?this.map.painter:null),this._cacheTimers[s.key]&&(clearTimeout(this._cacheTimers[s.key]),delete this._cacheTimers[s.key],this._setTileReloadTimer(s.key,x)));const I=x;return x||(x=new Pi(s,this._source.tileSize*s.overscaleFactor()),this._loadTile(x,this._tileLoaded.bind(this,x,s.key,x.state))),x.uses++,this._tiles[s.key]=x,I||this._source.fire(new R.k("dataloading",{tile:x,coord:x.tileID,dataType:"source"})),x}_setTileReloadTimer(s,x){s in this._timers&&(clearTimeout(this._timers[s]),delete this._timers[s]);const I=x.getExpiryTimeout();I&&(this._timers[s]=setTimeout(()=>{this._reloadTile(s,"expired"),delete this._timers[s]},I))}_removeTile(s){const x=this._tiles[s];x&&(x.uses--,delete this._tiles[s],this._timers[s]&&(clearTimeout(this._timers[s]),delete this._timers[s]),x.uses>0||(x.hasData()&&x.state!=="reloading"?this._cache.add(x.tileID,x,x.getExpiryTimeout()):(x.aborted=!0,this._abortTile(x),this._unloadTile(x))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const s in this._tiles)this._removeTile(s);this._cache.reset()}tilesIn(s,x,I){const k=[],H=this.transform;if(!H)return k;const ee=I?H.getCameraQueryGeometry(s):s,ne=s.map(B=>H.pointCoordinate(B,this.terrain)),ue=ee.map(B=>H.pointCoordinate(B,this.terrain)),_e=this.getIds();let h=1/0,g=1/0,d=-1/0,b=-1/0;for(const B of ue)h=Math.min(h,B.x),g=Math.min(g,B.y),d=Math.max(d,B.x),b=Math.max(b,B.y);for(let B=0;B<_e.length;B++){const G=this._tiles[_e[B]];if(G.holdingForFade())continue;const q=G.tileID,te=Math.pow(2,H.zoom-G.tileID.overscaledZ),fe=x*G.queryPadding*R.N/G.tileSize/te,ce=[q.getTilePoint(new R.U(h,g)),q.getTilePoint(new R.U(d,b))];if(ce[0].x-fe=0&&ce[1].y+fe>=0){const Te=ne.map(Oe=>q.getTilePoint(Oe)),Ie=ue.map(Oe=>q.getTilePoint(Oe));k.push({tile:G,tileID:q,queryGeometry:Te,cameraQueryGeometry:Ie,scale:te})}}return k}getVisibleCoordinates(s){const x=this.getRenderableIds(s).map(I=>this._tiles[I].tileID);for(const I of x)I.posMatrix=this.transform.calculatePosMatrix(I.toUnwrapped());return x}hasTransition(){if(this._source.hasTransition())return!0;if(he(this._source.type)){const s=R.h.now();for(const x in this._tiles)if(this._tiles[x].fadeEndTime>=s)return!0}return!1}setFeatureState(s,x,I){this._state.updateState(s=s||"_geojsonTileLayer",x,I)}removeFeatureState(s,x,I){this._state.removeFeatureState(s=s||"_geojsonTileLayer",x,I)}getFeatureState(s,x){return this._state.getState(s=s||"_geojsonTileLayer",x)}setDependencies(s,x,I){const k=this._tiles[s];k&&k.setDependencies(x,I)}reloadTilesForDependencies(s,x){for(const I in this._tiles)this._tiles[I].hasDependency(s,x)&&this._reloadTile(I,"reloading");this._cache.filter(I=>!I.hasDependency(s,x))}}function dr(z,s){const x=Math.abs(2*z.wrap)-+(z.wrap<0),I=Math.abs(2*s.wrap)-+(s.wrap<0);return z.overscaledZ-s.overscaledZ||I-x||s.canonical.y-z.canonical.y||s.canonical.x-z.canonical.x}function he(z){return z==="raster"||z==="image"||z==="video"}ls.maxOverzooming=10,ls.maxUnderzooming=3;const We="mapboxgl_preloaded_worker_pool";class at{constructor(){this.active={}}acquire(s){if(!this.workers)for(this.workers=[];this.workers.length{x.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[We]}numActive(){return Object.keys(this.active).length}}const Ot=Math.floor(R.h.hardwareConcurrency/2);let or;function Wr(){return or||(or=new at),or}at.workerCount=R.ac(globalThis)?Math.max(Math.min(Ot,3),1):1;class In{constructor(s,x){this.reset(s,x)}reset(s,x){this.points=s||[],this._distances=[0];for(let I=1;I0?(k-ee)/ne:0;return this.points[H].mult(1-ue).add(this.points[x].mult(ue))}}function kn(z,s){let x=!0;return z==="always"||z!=="never"&&s!=="never"||(x=!1),x}class eo{constructor(s,x,I){const k=this.boxCells=[],H=this.circleCells=[];this.xCellCount=Math.ceil(s/I),this.yCellCount=Math.ceil(x/I);for(let ee=0;eethis.width||k<0||x>this.height)return[];const ue=[];if(s<=0&&x<=0&&this.width<=I&&this.height<=k){if(H)return[{key:null,x1:s,y1:x,x2:I,y2:k}];for(let _e=0;_e0}hitTestCircle(s,x,I,k,H){const ee=s-I,ne=s+I,ue=x-I,_e=x+I;if(ne<0||ee>this.width||_e<0||ue>this.height)return!1;const h=[];return this._forEachCell(ee,ue,ne,_e,this._queryCellCircle,h,{hitTest:!0,overlapMode:k,circle:{x:s,y:x,radius:I},seenUids:{box:{},circle:{}}},H),h.length>0}_queryCell(s,x,I,k,H,ee,ne,ue){const{seenUids:_e,hitTest:h,overlapMode:g}=ne,d=this.boxCells[H];if(d!==null){const B=this.bboxes;for(const G of d)if(!_e.box[G]){_e.box[G]=!0;const q=4*G,te=this.boxKeys[G];if(s<=B[q+2]&&x<=B[q+3]&&I>=B[q+0]&&k>=B[q+1]&&(!ue||ue(te))&&(!h||!kn(g,te.overlapMode))&&(ee.push({key:te,x1:B[q],y1:B[q+1],x2:B[q+2],y2:B[q+3]}),h))return!0}}const b=this.circleCells[H];if(b!==null){const B=this.circles;for(const G of b)if(!_e.circle[G]){_e.circle[G]=!0;const q=3*G,te=this.circleKeys[G];if(this._circleAndRectCollide(B[q],B[q+1],B[q+2],s,x,I,k)&&(!ue||ue(te))&&(!h||!kn(g,te.overlapMode))){const fe=B[q],ce=B[q+1],Te=B[q+2];if(ee.push({key:te,x1:fe-Te,y1:ce-Te,x2:fe+Te,y2:ce+Te}),h)return!0}}}return!1}_queryCellCircle(s,x,I,k,H,ee,ne,ue){const{circle:_e,seenUids:h,overlapMode:g}=ne,d=this.boxCells[H];if(d!==null){const B=this.bboxes;for(const G of d)if(!h.box[G]){h.box[G]=!0;const q=4*G,te=this.boxKeys[G];if(this._circleAndRectCollide(_e.x,_e.y,_e.radius,B[q+0],B[q+1],B[q+2],B[q+3])&&(!ue||ue(te))&&!kn(g,te.overlapMode))return ee.push(!0),!0}}const b=this.circleCells[H];if(b!==null){const B=this.circles;for(const G of b)if(!h.circle[G]){h.circle[G]=!0;const q=3*G,te=this.circleKeys[G];if(this._circlesCollide(B[q],B[q+1],B[q+2],_e.x,_e.y,_e.radius)&&(!ue||ue(te))&&!kn(g,te.overlapMode))return ee.push(!0),!0}}}_forEachCell(s,x,I,k,H,ee,ne,ue){const _e=this._convertToXCellCoord(s),h=this._convertToYCellCoord(x),g=this._convertToXCellCoord(I),d=this._convertToYCellCoord(k);for(let b=_e;b<=g;b++)for(let B=h;B<=d;B++)if(H.call(this,s,x,I,k,this.xCellCount*B+b,ee,ne,ue))return}_convertToXCellCoord(s){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(s*this.xScale)))}_convertToYCellCoord(s){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(s*this.yScale)))}_circlesCollide(s,x,I,k,H,ee){const ne=k-s,ue=H-x,_e=I+ee;return _e*_e>ne*ne+ue*ue}_circleAndRectCollide(s,x,I,k,H,ee,ne){const ue=(ee-k)/2,_e=Math.abs(s-(k+ue));if(_e>ue+I)return!1;const h=(ne-H)/2,g=Math.abs(x-(H+h));if(g>h+I)return!1;if(_e<=ue||g<=h)return!0;const d=_e-ue,b=g-h;return d*d+b*b<=I*I}}function un(z,s,x,I,k){const H=R.Z();return s?(R.a0(H,H,[1/k,1/k,1]),x||R.ae(H,H,I.angle)):R.a1(H,I.labelPlaneMatrix,z),H}function To(z,s,x,I,k){if(s){const H=R.af(z);return R.a0(H,H,[k,k,1]),x||R.ae(H,H,-I.angle),H}return I.glCoordMatrix}function Ti(z,s,x){let I;x?(I=[z.x,z.y,x(z.x,z.y),1],R.ag(I,I,s)):(I=[z.x,z.y,0,1],ge(I,I,s));const k=I[3];return{point:new R.P(I[0]/k,I[1]/k),signedDistanceFromCamera:k}}function Lo(z,s){return .5+z/s*.5}function wa(z,s){const x=z[0]/z[3],I=z[1]/z[3];return x>=-s[0]&&x<=s[0]&&I>=-s[1]&&I<=s[1]}function dn(z,s,x,I,k,H,ee,ne,ue,_e){const h=I?z.textSizeData:z.iconSizeData,g=R.ah(h,x.transform.zoom),d=[256/x.width*2+1,256/x.height*2+1],b=I?z.text.dynamicLayoutVertexArray:z.icon.dynamicLayoutVertexArray;b.clear();const B=z.lineVertexArray,G=I?z.text.placedSymbolArray:z.icon.placedSymbolArray,q=x.transform.width/x.transform.height;let te=!1;for(let fe=0;feMath.abs(x.x-s.x)*I?{useVertical:!0}:(z===R.ai.vertical?s.yx.x)?{needsFlipping:!0}:null}function Za(z,s,x,I,k,H,ee,ne,ue,_e,h,g,d,b,B,G){const q=s/24,te=z.lineOffsetX*q,fe=z.lineOffsetY*q;let ce;if(z.numGlyphs>1){const Te=z.glyphStartIndex+z.numGlyphs,Ie=z.lineStartIndex,Oe=z.lineStartIndex+z.lineLength,Qe=co(q,ne,te,fe,x,h,g,z,ue,H,d,B,G);if(!Qe)return{notEnoughRoom:!0};const nt=Ti(Qe.first.point,ee,G).point,ct=Ti(Qe.last.point,ee,G).point;if(I&&!x){const tt=no(z.writingMode,nt,ct,b);if(tt)return tt}ce=[Qe.first];for(let tt=z.glyphStartIndex+1;tt0?nt.point:ms(g,Qe,Ie,1,k,G),tt=no(z.writingMode,Ie,ct,b);if(tt)return tt}const Te=Ne(q*ne.getoffsetX(z.glyphStartIndex),te,fe,x,h,g,z.segment,z.lineStartIndex,z.lineStartIndex+z.lineLength,ue,H,d,B,G);if(!Te)return{notEnoughRoom:!0};ce=[Te]}for(const Te of ce)R.ak(_e,Te.point,Te.angle);return{}}function ms(z,s,x,I,k,H){const ee=Ti(z.add(z.sub(s)._unit()),k,H).point,ne=x.sub(ee);return x.add(ne._mult(I/ne.mag()))}function Ji(z,s){const{projectionCache:x,lineVertexArray:I,labelPlaneMatrix:k,tileAnchorPoint:H,distanceFromAnchor:ee,getElevation:ne,previousVertex:ue,direction:_e,absOffsetX:h}=s;if(x.projections[z])return x.projections[z];const g=new R.P(I.getx(z),I.gety(z)),d=Ti(g,k,ne);if(d.signedDistanceFromCamera>0)return x.projections[z]=d.point,d.point;const b=z-_e;return ms(ee===0?H:new R.P(I.getx(b),I.gety(b)),g,ue,h-ee+1,k,ne)}function Us(z,s,x){return z._unit()._perp()._mult(s*x)}function Lt(z,s,x,I,k,H,ee,ne){const{projectionCache:ue,direction:_e}=ne;if(ue.offsets[z])return ue.offsets[z];const h=x.add(s);if(z+_e=k)return ue.offsets[z]=h,h;const g=Ji(z+_e,ne),d=Us(g.sub(x),ee,_e),b=x.add(d),B=g.add(d);return ue.offsets[z]=R.al(H,h,b,B)||h,ue.offsets[z]}function Ne(z,s,x,I,k,H,ee,ne,ue,_e,h,g,d,b){const B=I?z-s:z+s;let G=B>0?1:-1,q=0;I&&(G*=-1,q=Math.PI),G<0&&(q+=Math.PI);let te,fe,ce=G>0?ne+ee:ne+ee+1,Te=k,Ie=k,Oe=0,Qe=0;const nt=Math.abs(B),ct=[];let tt;for(;Oe+Qe<=nt;){if(ce+=G,ce=ue)return null;Oe+=Qe,Ie=Te,fe=te;const Nt={projectionCache:g,lineVertexArray:_e,labelPlaneMatrix:h,tileAnchorPoint:H,distanceFromAnchor:Oe,getElevation:b,previousVertex:Ie,direction:G,absOffsetX:nt};if(Te=Ji(ce,Nt),x===0)ct.push(Ie),tt=Te.sub(Ie);else{let pr;const tr=Te.sub(Ie);pr=tr.mag()===0?Us(Ji(ce+G,Nt).sub(Te),x,G):Us(tr,x,G),fe||(fe=Ie.add(pr)),te=Lt(ce,pr,Te,ne,ue,fe,x,Nt),ct.push(fe),tt=te.sub(fe)}Qe=tt.mag()}const Tt=tt._mult((nt-Oe)/Qe)._add(fe||Ie),Ut=q+Math.atan2(Te.y-Ie.y,Te.x-Ie.x);return ct.push(Tt),{point:Tt,angle:d?Ut:0,path:ct}}const re=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function le(z,s){for(let x=0;x=1;sn--)tr.push(Nt.path[sn]);for(let sn=1;snTi(nn,ue,B));tr=sn.some(nn=>nn.signedDistanceFromCamera<=0)?[]:sn.map(nn=>nn.point)}let Hr=[];if(tr.length>0){const sn=tr[0].clone(),nn=tr[0].clone();for(let Gn=1;Gn=tt.x&&nn.x<=Tt.x&&sn.y>=tt.y&&nn.y<=Tt.y?[tr]:nn.xTt.x||nn.yTt.y?[]:R.am([tr],tt.x,tt.y,Tt.x,Tt.y)}for(const sn of Hr){Ut.reset(sn,.25*ct);let nn=0;nn=Ut.length<=.5*ct?1:Math.ceil(Ut.paddedLength/Dr)+1;for(let Gn=0;Gn=this.screenRightBoundary||kthis.screenBottomBoundary}isInsideGrid(s,x,I,k){return I>=0&&s=0&&xI.collisionGroupID===x}}return this.collisionGroups[s]}}function mr(z,s,x,I,k){const{horizontalAlign:H,verticalAlign:ee}=R.au(z);return new R.P(-(H-.5)*s+I[0]*k,-(ee-.5)*x+I[1]*k)}function Sr(z,s,x,I,k,H){const{x1:ee,x2:ne,y1:ue,y2:_e,anchorPointX:h,anchorPointY:g}=z,d=new R.P(s,x);return I&&d._rotate(k?H:-H),{x1:ee+d.x,y1:ue+d.y,x2:ne+d.x,y2:_e+d.y,anchorPointX:h,anchorPointY:g}}class fn{constructor(s,x,I,k,H){this.transform=s.clone(),this.terrain=x,this.collisionIndex=new ze(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=I,this.retainedQueryData={},this.collisionGroups=new Fr(k),this.collisionCircleArrays={},this.prevPlacement=H,H&&(H.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(s,x,I,k){const H=I.getBucket(x),ee=I.latestFeatureIndex;if(!H||!ee||x.id!==H.layerIds[0])return;const ne=I.collisionBoxArray,ue=H.layers[0].layout,_e=Math.pow(2,this.transform.zoom-I.tileID.overscaledZ),h=I.tileSize/R.N,g=this.transform.calculatePosMatrix(I.tileID.toUnwrapped()),d=ue.get("text-pitch-alignment")==="map",b=ue.get("text-rotation-alignment")==="map",B=je(I,1,this.transform.zoom),G=un(g,d,b,this.transform,B);let q=null;if(d){const fe=To(g,d,b,this.transform,B);q=R.a1([],this.transform.labelPlaneMatrix,fe)}this.retainedQueryData[H.bucketInstanceId]=new Ht(H.bucketInstanceId,ee,H.sourceLayerIndex,H.index,I.tileID);const te={bucket:H,layout:ue,posMatrix:g,textLabelPlaneMatrix:G,labelToScreenMatrix:q,scale:_e,textPixelRatio:h,holdingForFade:I.holdingForFade(),collisionBoxArray:ne,partiallyEvaluatedTextSize:R.ah(H.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(H.sourceID)};if(k)for(const fe of H.sortKeyRanges){const{sortKey:ce,symbolInstanceStart:Te,symbolInstanceEnd:Ie}=fe;s.push({sortKey:ce,symbolInstanceStart:Te,symbolInstanceEnd:Ie,parameters:te})}else s.push({symbolInstanceStart:0,symbolInstanceEnd:H.symbolInstances.length,parameters:te})}attemptAnchorPlacement(s,x,I,k,H,ee,ne,ue,_e,h,g,d,b,B,G,q){const te=R.aq[s.textAnchor],fe=[s.textOffset0,s.textOffset1],ce=mr(te,I,k,fe,H),Te=this.collisionIndex.placeCollisionBox(Sr(x,ce.x,ce.y,ee,ne,this.transform.angle),g,ue,_e,h.predicate,q);if((!G||this.collisionIndex.placeCollisionBox(Sr(G,ce.x,ce.y,ee,ne,this.transform.angle),g,ue,_e,h.predicate,q).box.length!==0)&&Te.box.length>0){let Ie;if(this.prevPlacement&&this.prevPlacement.variableOffsets[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID].text&&(Ie=this.prevPlacement.variableOffsets[d.crossTileID].anchor),d.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[d.crossTileID]={textOffset:fe,width:I,height:k,anchor:te,textBoxScale:H,prevAnchor:Ie},this.markUsedJustification(b,te,d,B),b.allowVerticalPlacement&&(this.markUsedOrientation(b,B,d),this.placedOrientations[d.crossTileID]=B),{shift:ce,placedGlyphBoxes:Te}}}placeLayerBucketPart(s,x,I){const{bucket:k,layout:H,posMatrix:ee,textLabelPlaneMatrix:ne,labelToScreenMatrix:ue,textPixelRatio:_e,holdingForFade:h,collisionBoxArray:g,partiallyEvaluatedTextSize:d,collisionGroup:b}=s.parameters,B=H.get("text-optional"),G=H.get("icon-optional"),q=R.ar(H,"text-overlap","text-allow-overlap"),te=q==="always",fe=R.ar(H,"icon-overlap","icon-allow-overlap"),ce=fe==="always",Te=H.get("text-rotation-alignment")==="map",Ie=H.get("text-pitch-alignment")==="map",Oe=H.get("icon-text-fit")!=="none",Qe=H.get("symbol-z-order")==="viewport-y",nt=te&&(ce||!k.hasIconData()||G),ct=ce&&(te||!k.hasTextData()||B);!k.collisionArrays&&g&&k.deserializeCollisionBoxes(g);const tt=this.retainedQueryData[k.bucketInstanceId].tileID,Tt=this.terrain?(Nt,pr)=>this.terrain.getElevation(tt,Nt,pr):null,Ut=(Nt,pr)=>{var tr,Dr;if(x[Nt.crossTileID])return;if(h)return void(this.placements[Nt.crossTileID]=new Je(!1,!1,!1));let Hr=!1,sn=!1,nn=!0,Gn=null,di={box:null,offscreen:null},Di={box:null,offscreen:null},Ui=null,ho=null,gi=null,Wi=0,Ko=0,Mo=0;pr.textFeatureIndex?Wi=pr.textFeatureIndex:Nt.useRuntimeCollisionCircles&&(Wi=Nt.featureIndex),pr.verticalTextFeatureIndex&&(Ko=pr.verticalTextFeatureIndex);const mo=pr.textBox;if(mo){const qi=ts=>{let ja=R.ai.horizontal;if(k.allowVerticalPlacement&&!ts&&this.prevPlacement){const $a=this.prevPlacement.placedOrientations[Nt.crossTileID];$a&&(this.placedOrientations[Nt.crossTileID]=$a,ja=$a,this.markUsedOrientation(k,ja,Nt))}return ja},xs=(ts,ja)=>{if(k.allowVerticalPlacement&&Nt.numVerticalGlyphVertices>0&&pr.verticalTextBox){for(const $a of k.writingModes)if($a===R.ai.vertical?(di=ja(),Di=di):di=ts(),di&&di.box&&di.box.length)break}else di=ts()},gs=Nt.textAnchorOffsetStartIndex,Cl=Nt.textAnchorOffsetEndIndex;if(Cl===gs){const ts=(ja,$a)=>{const vs=this.collisionIndex.placeCollisionBox(ja,q,_e,ee,b.predicate,Tt);return vs&&vs.box&&vs.box.length&&(this.markUsedOrientation(k,$a,Nt),this.placedOrientations[Nt.crossTileID]=$a),vs};xs(()=>ts(mo,R.ai.horizontal),()=>{const ja=pr.verticalTextBox;return k.allowVerticalPlacement&&Nt.numVerticalGlyphVertices>0&&ja?ts(ja,R.ai.vertical):{box:null,offscreen:null}}),qi(di&&di.box&&di.box.length)}else{let ts=R.aq[(Dr=(tr=this.prevPlacement)===null||tr===void 0?void 0:tr.variableOffsets[Nt.crossTileID])===null||Dr===void 0?void 0:Dr.anchor];const ja=(vs,Zl,zu)=>{const Uu=vs.x2-vs.x1,hh=vs.y2-vs.y1,Yc=Nt.textBoxScale,np=Oe&&fe==="never"?Zl:null;let pu={box:[],offscreen:!1},Tu=q==="never"?1:2,Zu="never";ts&&Tu++;for(let Dl=0;Dlja(mo,pr.iconBox,R.ai.horizontal),()=>{const vs=pr.verticalTextBox;return k.allowVerticalPlacement&&!(di&&di.box&&di.box.length)&&Nt.numVerticalGlyphVertices>0&&vs?ja(vs,pr.verticalIconBox,R.ai.vertical):{box:null,offscreen:null}}),di&&(Hr=di.box,nn=di.offscreen);const $a=qi(di&&di.box);if(!Hr&&this.prevPlacement){const vs=this.prevPlacement.variableOffsets[Nt.crossTileID];vs&&(this.variableOffsets[Nt.crossTileID]=vs,this.markUsedJustification(k,vs.anchor,Nt,$a))}}}if(Ui=di,Hr=Ui&&Ui.box&&Ui.box.length>0,nn=Ui&&Ui.offscreen,Nt.useRuntimeCollisionCircles){const qi=k.text.placedSymbolArray.get(Nt.centerJustifiedTextSymbolIndex),xs=R.aj(k.textSizeData,d,qi),gs=H.get("text-padding");ho=this.collisionIndex.placeCollisionCircles(q,qi,k.lineVertexArray,k.glyphOffsetArray,xs,ee,ne,ue,I,Ie,b.predicate,Nt.collisionCircleDiameter,gs,Tt),ho.circles.length&&ho.collisionDetected&&!I&&R.w("Collisions detected, but collision boxes are not shown"),Hr=te||ho.circles.length>0&&!ho.collisionDetected,nn=nn&&ho.offscreen}if(pr.iconFeatureIndex&&(Mo=pr.iconFeatureIndex),pr.iconBox){const qi=xs=>{const gs=Oe&&Gn?Sr(xs,Gn.x,Gn.y,Te,Ie,this.transform.angle):xs;return this.collisionIndex.placeCollisionBox(gs,fe,_e,ee,b.predicate,Tt)};Di&&Di.box&&Di.box.length&&pr.verticalIconBox?(gi=qi(pr.verticalIconBox),sn=gi.box.length>0):(gi=qi(pr.iconBox),sn=gi.box.length>0),nn=nn&&gi.offscreen}const ko=B||Nt.numHorizontalGlyphVertices===0&&Nt.numVerticalGlyphVertices===0,xo=G||Nt.numIconVertices===0;if(ko||xo?xo?ko||(sn=sn&&Hr):Hr=sn&&Hr:sn=Hr=sn&&Hr,Hr&&Ui&&Ui.box&&this.collisionIndex.insertCollisionBox(Ui.box,q,H.get("text-ignore-placement"),k.bucketInstanceId,Di&&Di.box&&Ko?Ko:Wi,b.ID),sn&&gi&&this.collisionIndex.insertCollisionBox(gi.box,fe,H.get("icon-ignore-placement"),k.bucketInstanceId,Mo,b.ID),ho&&(Hr&&this.collisionIndex.insertCollisionCircles(ho.circles,q,H.get("text-ignore-placement"),k.bucketInstanceId,Wi,b.ID),I)){const qi=k.bucketInstanceId;let xs=this.collisionCircleArrays[qi];xs===void 0&&(xs=this.collisionCircleArrays[qi]=new wt);for(let gs=0;gs=0;--pr){const tr=Nt[pr];Ut(k.symbolInstances.get(tr),k.collisionArrays[tr])}}else for(let Nt=s.symbolInstanceStart;Nt=0&&(s.text.placedSymbolArray.get(ne).crossTileID=H>=0&&ne!==H?0:I.crossTileID)}markUsedOrientation(s,x,I){const k=x===R.ai.horizontal||x===R.ai.horizontalOnly?x:0,H=x===R.ai.vertical?x:0,ee=[I.leftJustifiedTextSymbolIndex,I.centerJustifiedTextSymbolIndex,I.rightJustifiedTextSymbolIndex];for(const ne of ee)s.text.placedSymbolArray.get(ne).placedOrientation=k;I.verticalPlacedTextSymbolIndex&&(s.text.placedSymbolArray.get(I.verticalPlacedTextSymbolIndex).placedOrientation=H)}commit(s){this.commitTime=s,this.zoomAtLastRecencyCheck=this.transform.zoom;const x=this.prevPlacement;let I=!1;this.prevZoomAdjustment=x?x.zoomAdjustment(this.transform.zoom):0;const k=x?x.symbolFadeChange(s):1,H=x?x.opacities:{},ee=x?x.variableOffsets:{},ne=x?x.placedOrientations:{};for(const ue in this.placements){const _e=this.placements[ue],h=H[ue];h?(this.opacities[ue]=new Ae(h,k,_e.text,_e.icon),I=I||_e.text!==h.text.placed||_e.icon!==h.icon.placed):(this.opacities[ue]=new Ae(null,k,_e.text,_e.icon,_e.skipFade),I=I||_e.text||_e.icon)}for(const ue in H){const _e=H[ue];if(!this.opacities[ue]){const h=new Ae(_e,k,!1,!1);h.isHidden()||(this.opacities[ue]=h,I=I||_e.text.placed||_e.icon.placed)}}for(const ue in ee)this.variableOffsets[ue]||!this.opacities[ue]||this.opacities[ue].isHidden()||(this.variableOffsets[ue]=ee[ue]);for(const ue in ne)this.placedOrientations[ue]||!this.opacities[ue]||this.opacities[ue].isHidden()||(this.placedOrientations[ue]=ne[ue]);if(x&&x.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");I?this.lastPlacementChangeTime=s:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=x?x.lastPlacementChangeTime:s)}updateLayerOpacities(s,x){const I={};for(const k of x){const H=k.getBucket(s);H&&k.latestFeatureIndex&&s.id===H.layerIds[0]&&this.updateBucketOpacities(H,I,k.collisionBoxArray)}}updateBucketOpacities(s,x,I){s.hasTextData()&&(s.text.opacityVertexArray.clear(),s.text.hasVisibleVertices=!1),s.hasIconData()&&(s.icon.opacityVertexArray.clear(),s.icon.hasVisibleVertices=!1),s.hasIconCollisionBoxData()&&s.iconCollisionBox.collisionVertexArray.clear(),s.hasTextCollisionBoxData()&&s.textCollisionBox.collisionVertexArray.clear();const k=s.layers[0],H=k.layout,ee=new Ae(null,0,!1,!1,!0),ne=H.get("text-allow-overlap"),ue=H.get("icon-allow-overlap"),_e=k._unevaluatedLayout.hasValue("text-variable-anchor")||k._unevaluatedLayout.hasValue("text-variable-anchor-offset"),h=H.get("text-rotation-alignment")==="map",g=H.get("text-pitch-alignment")==="map",d=H.get("icon-text-fit")!=="none",b=new Ae(null,0,ne&&(ue||!s.hasIconData()||H.get("icon-optional")),ue&&(ne||!s.hasTextData()||H.get("text-optional")),!0);!s.collisionArrays&&I&&(s.hasIconCollisionBoxData()||s.hasTextCollisionBoxData())&&s.deserializeCollisionBoxes(I);const B=(G,q,te)=>{for(let fe=0;fe0,Oe=this.placedOrientations[q.crossTileID],Qe=Oe===R.ai.vertical,nt=Oe===R.ai.horizontal||Oe===R.ai.horizontalOnly;if(te>0||fe>0){const ct=ia(Te.text);B(s.text,te,Qe?Ho:ct),B(s.text,fe,nt?Ho:ct);const tt=Te.text.isHidden();[q.rightJustifiedTextSymbolIndex,q.centerJustifiedTextSymbolIndex,q.leftJustifiedTextSymbolIndex].forEach(Nt=>{Nt>=0&&(s.text.placedSymbolArray.get(Nt).hidden=tt||Qe?1:0)}),q.verticalPlacedTextSymbolIndex>=0&&(s.text.placedSymbolArray.get(q.verticalPlacedTextSymbolIndex).hidden=tt||nt?1:0);const Tt=this.variableOffsets[q.crossTileID];Tt&&this.markUsedJustification(s,Tt.anchor,q,Oe);const Ut=this.placedOrientations[q.crossTileID];Ut&&(this.markUsedJustification(s,"left",q,Ut),this.markUsedOrientation(s,Ut,q))}if(Ie){const ct=ia(Te.icon),tt=!(d&&q.verticalPlacedIconSymbolIndex&&Qe);q.placedIconSymbolIndex>=0&&(B(s.icon,q.numIconVertices,tt?ct:Ho),s.icon.placedSymbolArray.get(q.placedIconSymbolIndex).hidden=Te.icon.isHidden()),q.verticalPlacedIconSymbolIndex>=0&&(B(s.icon,q.numVerticalIconVertices,tt?Ho:ct),s.icon.placedSymbolArray.get(q.verticalPlacedIconSymbolIndex).hidden=Te.icon.isHidden())}if(s.hasIconCollisionBoxData()||s.hasTextCollisionBoxData()){const ct=s.collisionArrays[G];if(ct){let tt=new R.P(0,0);if(ct.textBox||ct.verticalTextBox){let Ut=!0;if(_e){const Nt=this.variableOffsets[ce];Nt?(tt=mr(Nt.anchor,Nt.width,Nt.height,Nt.textOffset,Nt.textBoxScale),h&&tt._rotate(g?this.transform.angle:-this.transform.angle)):Ut=!1}ct.textBox&&xn(s.textCollisionBox.collisionVertexArray,Te.text.placed,!Ut||Qe,tt.x,tt.y),ct.verticalTextBox&&xn(s.textCollisionBox.collisionVertexArray,Te.text.placed,!Ut||nt,tt.x,tt.y)}const Tt=!!(!nt&&ct.verticalIconBox);ct.iconBox&&xn(s.iconCollisionBox.collisionVertexArray,Te.icon.placed,Tt,d?tt.x:0,d?tt.y:0),ct.verticalIconBox&&xn(s.iconCollisionBox.collisionVertexArray,Te.icon.placed,!Tt,d?tt.x:0,d?tt.y:0)}}}if(s.sortFeatures(this.transform.angle),this.retainedQueryData[s.bucketInstanceId]&&(this.retainedQueryData[s.bucketInstanceId].featureSortOrder=s.featureSortOrder),s.hasTextData()&&s.text.opacityVertexBuffer&&s.text.opacityVertexBuffer.updateData(s.text.opacityVertexArray),s.hasIconData()&&s.icon.opacityVertexBuffer&&s.icon.opacityVertexBuffer.updateData(s.icon.opacityVertexArray),s.hasIconCollisionBoxData()&&s.iconCollisionBox.collisionVertexBuffer&&s.iconCollisionBox.collisionVertexBuffer.updateData(s.iconCollisionBox.collisionVertexArray),s.hasTextCollisionBoxData()&&s.textCollisionBox.collisionVertexBuffer&&s.textCollisionBox.collisionVertexBuffer.updateData(s.textCollisionBox.collisionVertexArray),s.text.opacityVertexArray.length!==s.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${s.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${s.text.layoutVertexArray.length}) / 4`);if(s.icon.opacityVertexArray.length!==s.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${s.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${s.icon.layoutVertexArray.length}) / 4`);if(s.bucketInstanceId in this.collisionCircleArrays){const G=this.collisionCircleArrays[s.bucketInstanceId];s.placementInvProjMatrix=G.invProjMatrix,s.placementViewportMatrix=G.viewportMatrix,s.collisionCircleArray=G.circles,delete this.collisionCircleArrays[s.bucketInstanceId]}}symbolFadeChange(s){return this.fadeDuration===0?1:(s-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(s){return Math.max(0,(this.transform.zoom-s)/1.5)}hasTransitions(s){return this.stale||s-this.lastPlacementChangeTimes}setStale(){this.stale=!0}}function xn(z,s,x,I,k){z.emplaceBack(s?1:0,x?1:0,I||0,k||0),z.emplaceBack(s?1:0,x?1:0,I||0,k||0),z.emplaceBack(s?1:0,x?1:0,I||0,k||0),z.emplaceBack(s?1:0,x?1:0,I||0,k||0)}const Lr=Math.pow(2,25),Nn=Math.pow(2,24),bn=Math.pow(2,17),En=Math.pow(2,16),io=Math.pow(2,9),On=Math.pow(2,8),Ao=Math.pow(2,1);function ia(z){if(z.opacity===0&&!z.placed)return 0;if(z.opacity===1&&z.placed)return 4294967295;const s=z.placed?1:0,x=Math.floor(127*z.opacity);return x*Lr+s*Nn+x*bn+s*En+x*io+s*On+x*Ao+s}const Ho=0;class Ga{constructor(s){this._sortAcrossTiles=s.layout.get("symbol-z-order")!=="viewport-y"&&!s.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(s,x,I,k,H){const ee=this._bucketParts;for(;this._currentTileIndexne.sortKey-ue.sortKey));this._currentPartIndex!this._forceFullPlacement&&R.h.now()-k>2;for(;this._currentPlacementIndex>=0;){const ee=x[s[this._currentPlacementIndex]],ne=this.placement.collisionIndex.transform.zoom;if(ee.type==="symbol"&&(!ee.minzoom||ee.minzoom<=ne)&&(!ee.maxzoom||ee.maxzoom>ne)){if(this._inProgressLayer||(this._inProgressLayer=new Ga(ee)),this._inProgressLayer.continuePlacement(I[ee.source],this.placement,this._showCollisionBoxes,ee,H))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(s){return this.placement.commit(s),this.placement}}const Hl=512/R.N/2;class ns{constructor(s,x,I){this.tileID=s,this.bucketInstanceId=I,this._symbolsByKey={};const k=new Map;for(let H=0;H({x:Math.floor(ue.anchorX*Hl),y:Math.floor(ue.anchorY*Hl)})),crossTileIDs:ee.map(ue=>ue.crossTileID)};if(ne.positions.length>128){const ue=new R.av(ne.positions.length,16,Uint16Array);for(const{x:_e,y:h}of ne.positions)ue.add(_e,h);ue.finish(),delete ne.positions,ne.index=ue}this._symbolsByKey[H]=ne}}getScaledCoordinates(s,x){const{x:I,y:k,z:H}=this.tileID.canonical,{x:ee,y:ne,z:ue}=x.canonical,_e=Hl/Math.pow(2,ue-H),h=(ne*R.N+s.anchorY)*_e,g=k*R.N*Hl;return{x:Math.floor((ee*R.N+s.anchorX)*_e-I*R.N*Hl),y:Math.floor(h-g)}}findMatches(s,x,I){const k=this.tileID.canonical.zs)}}class Yo{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class _a{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(s){const x=Math.round((s-this.lng)/360);if(x!==0)for(const I in this.indexes){const k=this.indexes[I],H={};for(const ee in k){const ne=k[ee];ne.tileID=ne.tileID.unwrapTo(ne.tileID.wrap+x),H[ne.tileID.key]=ne}this.indexes[I]=H}this.lng=s}addBucket(s,x,I){if(this.indexes[s.overscaledZ]&&this.indexes[s.overscaledZ][s.key]){if(this.indexes[s.overscaledZ][s.key].bucketInstanceId===x.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(s.overscaledZ,this.indexes[s.overscaledZ][s.key])}for(let H=0;Hs.overscaledZ)for(const ne in ee){const ue=ee[ne];ue.tileID.isChildOf(s)&&ue.findMatches(x.symbolInstances,s,k)}else{const ne=ee[s.scaledTo(Number(H)).key];ne&&ne.findMatches(x.symbolInstances,s,k)}}for(let H=0;H{x[I]=!0});for(const I in this.layerIndexes)x[I]||delete this.layerIndexes[I]}}const Fo=(z,s)=>R.x(z,s&&s.filter(x=>x.identifier!=="source.canvas")),us=R.F(R.ax,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),xc=R.F(R.ax,["setCenter","setZoom","setBearing","setPitch"]),Ba=R.aw();class Fa extends R.E{constructor(s,x={}){super(),this.map=s,this.dispatcher=new rr(Wr(),this,s._getMapId()),this.imageManager=new Jr,this.imageManager.setEventedParent(this),this.glyphManager=new qe(s._requestManager,x.localIdeographFontFamily),this.lineAtlas=new vt(256,512),this.crossTileSymbolIndex=new $o,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new R.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",R.az());const I=this;this._rtlTextPluginCallback=Fa.registerForPluginStateChange(k=>{I.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:k.pluginStatus,pluginURL:k.pluginURL},(H,ee)=>{if(R.aA(H),ee&&ee.every(ne=>ne))for(const ne in I.sourceCaches){const ue=I.sourceCaches[ne].getSource().type;ue!=="vector"&&ue!=="geojson"||I.sourceCaches[ne].reload()}})}),this.on("data",k=>{if(k.dataType!=="source"||k.sourceDataType!=="metadata")return;const H=this.sourceCaches[k.sourceId];if(!H)return;const ee=H.getSource();if(ee&&ee.vectorLayerIds)for(const ne in this._layers){const ue=this._layers[ne];ue.source===ee.id&&this._validateLayer(ue)}})}loadURL(s,x={},I){this.fire(new R.k("dataloading",{dataType:"style"})),x.validate=typeof x.validate!="boolean"||x.validate;const k=this.map._requestManager.transformRequest(s,et.Style);this._request=R.f(k,(H,ee)=>{this._request=null,H?this.fire(new R.j(H)):ee&&this._load(ee,x,I)})}loadJSON(s,x={},I){this.fire(new R.k("dataloading",{dataType:"style"})),this._request=R.h.frame(()=>{this._request=null,x.validate=x.validate!==!1,this._load(s,x,I)})}loadEmpty(){this.fire(new R.k("dataloading",{dataType:"style"})),this._load(Ba,{validate:!1})}_load(s,x,I){var k;const H=x.transformStyle?x.transformStyle(I,s):s;if(!x.validate||!Fo(this,R.y(H))){this._loaded=!0,this.stylesheet=H;for(const ee in H.sources)this.addSource(ee,H.sources[ee],{validate:!1});H.sprite?this._loadSprite(H.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(H.glyphs),this._createLayers(),this.light=new Pt(this.stylesheet.light),this.map.setTerrain((k=this.stylesheet.terrain)!==null&&k!==void 0?k:null),this.fire(new R.k("data",{dataType:"style"})),this.fire(new R.k("style.load"))}}_createLayers(){const s=R.aB(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",s),this._order=s.map(x=>x.id),this._layers={},this._serializedLayers=null;for(const x of s){const I=R.aC(x);I.setEventedParent(this,{layer:{id:x.id}}),this._layers[x.id]=I}}_loadSprite(s,x=!1,I=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=function(k,H,ee,ne){const ue=ki(k),_e=ue.length,h=ee>1?"@2x":"",g={},d={},b={};for(const{id:B,url:G}of ue){const q=H.transformRequest(H.normalizeSpriteURL(G,h,".json"),et.SpriteJSON),te=`${B}_${q.url}`;g[te]=R.f(q,(Te,Ie)=>{delete g[te],d[B]=Ie,pa(ne,d,b,Te,_e)});const fe=H.transformRequest(H.normalizeSpriteURL(G,h,".png"),et.SpriteImage),ce=`${B}_${fe.url}`;g[ce]=Ve.getImage(fe,(Te,Ie)=>{delete g[ce],b[B]=Ie,pa(ne,d,b,Te,_e)})}return{cancel(){for(const B of Object.values(g))B.cancel()}}}(s,this.map._requestManager,this.map.getPixelRatio(),(k,H)=>{if(this._spriteRequest=null,k)this.fire(new R.j(k));else if(H)for(const ee in H){this._spritesImagesIds[ee]=[];const ne=this._spritesImagesIds[ee]?this._spritesImagesIds[ee].filter(ue=>!(ue in H)):[];for(const ue of ne)this.imageManager.removeImage(ue),this._changedImages[ue]=!0;for(const ue in H[ee]){const _e=ee==="default"?ue:`${ee}:${ue}`;this._spritesImagesIds[ee].push(_e),_e in this.imageManager.images?this.imageManager.updateImage(_e,H[ee][ue],!1):this.imageManager.addImage(_e,H[ee][ue]),x&&(this._changedImages[_e]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),x&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new R.k("data",{dataType:"style"})),I&&I(k)})}_unloadSprite(){for(const s of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(s),this._changedImages[s]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new R.k("data",{dataType:"style"}))}_validateLayer(s){const x=this.sourceCaches[s.source];if(!x)return;const I=s.sourceLayer;if(!I)return;const k=x.getSource();(k.type==="geojson"||k.vectorLayerIds&&k.vectorLayerIds.indexOf(I)===-1)&&this.fire(new R.j(new Error(`Source layer "${I}" does not exist on source "${k.id}" as specified by style layer "${s.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const s in this.sourceCaches)if(!this.sourceCaches[s].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(s){const x=this._serializedAllLayers();if(!s||s.length===0)return Object.values(x);const I=[];for(const k of s)x[k]&&I.push(x[k]);return I}_serializedAllLayers(){let s=this._serializedLayers;if(s)return s;s=this._serializedLayers={};const x=Object.keys(this._layers);for(const I of x){const k=this._layers[I];k.type!=="custom"&&(s[I]=k.serialize())}return s}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const s in this.sourceCaches)if(this.sourceCaches[s].hasTransition())return!0;for(const s in this._layers)if(this._layers[s].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(s){if(!this._loaded)return;const x=this._changed;if(this._changed){const k=Object.keys(this._updatedLayers),H=Object.keys(this._removedLayers);(k.length||H.length)&&this._updateWorkerLayers(k,H);for(const ee in this._updatedSources){const ne=this._updatedSources[ee];if(ne==="reload")this._reloadSource(ee);else{if(ne!=="clear")throw new Error(`Invalid action ${ne}`);this._clearSource(ee)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const ee in this._updatedPaintProps)this._layers[ee].updateTransitions(s);this.light.updateTransitions(s),this._resetUpdates()}const I={};for(const k in this.sourceCaches){const H=this.sourceCaches[k];I[k]=H.used,H.used=!1}for(const k of this._order){const H=this._layers[k];H.recalculate(s,this._availableImages),!H.isHidden(s.zoom)&&H.source&&(this.sourceCaches[H.source].used=!0)}for(const k in I){const H=this.sourceCaches[k];I[k]!==H.used&&H.fire(new R.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:k}))}this.light.recalculate(s),this.z=s.zoom,x&&this.fire(new R.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const s=Object.keys(this._changedImages);if(s.length){for(const x in this.sourceCaches)this.sourceCaches[x].reloadTilesForDependencies(["icons","patterns"],s);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(s,x){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(s),removedIds:x})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(s,x={}){this._checkLoaded();const I=this.serialize();if(s=x.transformStyle?x.transformStyle(I,s):s,Fo(this,R.y(s)))return!1;(s=R.aD(s)).layers=R.aB(s.layers);const k=R.aE(I,s).filter(ee=>!(ee.command in xc));if(k.length===0)return!1;const H=k.filter(ee=>!(ee.command in us));if(H.length>0)throw new Error(`Unimplemented: ${H.map(ee=>ee.command).join(", ")}.`);for(const ee of k)ee.command!=="setTransition"&&this[ee.command].apply(this,ee.args);return this.stylesheet=s,this._serializedLayers=null,!0}addImage(s,x){if(this.getImage(s))return this.fire(new R.j(new Error(`An image named "${s}" already exists.`)));this.imageManager.addImage(s,x),this._afterImageUpdated(s)}updateImage(s,x){this.imageManager.updateImage(s,x)}getImage(s){return this.imageManager.getImage(s)}removeImage(s){if(!this.getImage(s))return this.fire(new R.j(new Error(`An image named "${s}" does not exist.`)));this.imageManager.removeImage(s),this._afterImageUpdated(s)}_afterImageUpdated(s){this._availableImages=this.imageManager.listImages(),this._changedImages[s]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new R.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(s,x,I={}){if(this._checkLoaded(),this.sourceCaches[s]!==void 0)throw new Error(`Source "${s}" already exists.`);if(!x.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(x).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(x.type)>=0&&this._validate(R.y.source,`sources.${s}`,x,null,I))return;this.map&&this.map._collectResourceTiming&&(x.collectResourceTiming=!0);const k=this.sourceCaches[s]=new ls(s,x,this.dispatcher);k.style=this,k.setEventedParent(this,()=>({isSourceLoaded:k.loaded(),source:k.serialize(),sourceId:s})),k.onAdd(this.map),this._changed=!0}removeSource(s){if(this._checkLoaded(),this.sourceCaches[s]===void 0)throw new Error("There is no source with this ID");for(const I in this._layers)if(this._layers[I].source===s)return this.fire(new R.j(new Error(`Source "${s}" cannot be removed while layer "${I}" is using it.`)));const x=this.sourceCaches[s];delete this.sourceCaches[s],delete this._updatedSources[s],x.fire(new R.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:s})),x.setEventedParent(null),x.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(s,x){if(this._checkLoaded(),this.sourceCaches[s]===void 0)throw new Error(`There is no source with this ID=${s}`);const I=this.sourceCaches[s].getSource();if(I.type!=="geojson")throw new Error(`geojsonSource.type is ${I.type}, which is !== 'geojson`);I.setData(x),this._changed=!0}getSource(s){return this.sourceCaches[s]&&this.sourceCaches[s].getSource()}addLayer(s,x,I={}){this._checkLoaded();const k=s.id;if(this.getLayer(k))return void this.fire(new R.j(new Error(`Layer "${k}" already exists on this map.`)));let H;if(s.type==="custom"){if(Fo(this,R.aF(s)))return;H=R.aC(s)}else{if("source"in s&&typeof s.source=="object"&&(this.addSource(k,s.source),s=R.aD(s),s=R.e(s,{source:k})),this._validate(R.y.layer,`layers.${k}`,s,{arrayIndex:-1},I))return;H=R.aC(s),this._validateLayer(H),H.setEventedParent(this,{layer:{id:k}})}const ee=x?this._order.indexOf(x):this._order.length;if(x&&ee===-1)this.fire(new R.j(new Error(`Cannot add layer "${k}" before non-existing layer "${x}".`)));else{if(this._order.splice(ee,0,k),this._layerOrderChanged=!0,this._layers[k]=H,this._removedLayers[k]&&H.source&&H.type!=="custom"){const ne=this._removedLayers[k];delete this._removedLayers[k],ne.type!==H.type?this._updatedSources[H.source]="clear":(this._updatedSources[H.source]="reload",this.sourceCaches[H.source].pause())}this._updateLayer(H),H.onAdd&&H.onAdd(this.map)}}moveLayer(s,x){if(this._checkLoaded(),this._changed=!0,!this._layers[s])return void this.fire(new R.j(new Error(`The layer '${s}' does not exist in the map's style and cannot be moved.`)));if(s===x)return;const I=this._order.indexOf(s);this._order.splice(I,1);const k=x?this._order.indexOf(x):this._order.length;x&&k===-1?this.fire(new R.j(new Error(`Cannot move layer "${s}" before non-existing layer "${x}".`))):(this._order.splice(k,0,s),this._layerOrderChanged=!0)}removeLayer(s){this._checkLoaded();const x=this._layers[s];if(!x)return void this.fire(new R.j(new Error(`Cannot remove non-existing layer "${s}".`)));x.setEventedParent(null);const I=this._order.indexOf(s);this._order.splice(I,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[s]=x,delete this._layers[s],this._serializedLayers&&delete this._serializedLayers[s],delete this._updatedLayers[s],delete this._updatedPaintProps[s],x.onRemove&&x.onRemove(this.map)}getLayer(s){return this._layers[s]}getLayersOrder(){return[...this._order]}hasLayer(s){return s in this._layers}setLayerZoomRange(s,x,I){this._checkLoaded();const k=this.getLayer(s);k?k.minzoom===x&&k.maxzoom===I||(x!=null&&(k.minzoom=x),I!=null&&(k.maxzoom=I),this._updateLayer(k)):this.fire(new R.j(new Error(`Cannot set the zoom range of non-existing layer "${s}".`)))}setFilter(s,x,I={}){this._checkLoaded();const k=this.getLayer(s);if(k){if(!R.aG(k.filter,x))return x==null?(k.filter=void 0,void this._updateLayer(k)):void(this._validate(R.y.filter,`layers.${k.id}.filter`,x,null,I)||(k.filter=R.aD(x),this._updateLayer(k)))}else this.fire(new R.j(new Error(`Cannot filter non-existing layer "${s}".`)))}getFilter(s){return R.aD(this.getLayer(s).filter)}setLayoutProperty(s,x,I,k={}){this._checkLoaded();const H=this.getLayer(s);H?R.aG(H.getLayoutProperty(x),I)||(H.setLayoutProperty(x,I,k),this._updateLayer(H)):this.fire(new R.j(new Error(`Cannot style non-existing layer "${s}".`)))}getLayoutProperty(s,x){const I=this.getLayer(s);if(I)return I.getLayoutProperty(x);this.fire(new R.j(new Error(`Cannot get style of non-existing layer "${s}".`)))}setPaintProperty(s,x,I,k={}){this._checkLoaded();const H=this.getLayer(s);H?R.aG(H.getPaintProperty(x),I)||(H.setPaintProperty(x,I,k)&&this._updateLayer(H),this._changed=!0,this._updatedPaintProps[s]=!0):this.fire(new R.j(new Error(`Cannot style non-existing layer "${s}".`)))}getPaintProperty(s,x){return this.getLayer(s).getPaintProperty(x)}setFeatureState(s,x){this._checkLoaded();const I=s.source,k=s.sourceLayer,H=this.sourceCaches[I];if(H===void 0)return void this.fire(new R.j(new Error(`The source '${I}' does not exist in the map's style.`)));const ee=H.getSource().type;ee==="geojson"&&k?this.fire(new R.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):ee!=="vector"||k?(s.id===void 0&&this.fire(new R.j(new Error("The feature id parameter must be provided."))),H.setFeatureState(k,s.id,x)):this.fire(new R.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(s,x){this._checkLoaded();const I=s.source,k=this.sourceCaches[I];if(k===void 0)return void this.fire(new R.j(new Error(`The source '${I}' does not exist in the map's style.`)));const H=k.getSource().type,ee=H==="vector"?s.sourceLayer:void 0;H!=="vector"||ee?x&&typeof s.id!="string"&&typeof s.id!="number"?this.fire(new R.j(new Error("A feature id is required to remove its specific state property."))):k.removeFeatureState(ee,s.id,x):this.fire(new R.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(s){this._checkLoaded();const x=s.source,I=s.sourceLayer,k=this.sourceCaches[x];if(k!==void 0)return k.getSource().type!=="vector"||I?(s.id===void 0&&this.fire(new R.j(new Error("The feature id parameter must be provided."))),k.getFeatureState(I,s.id)):void this.fire(new R.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new R.j(new Error(`The source '${x}' does not exist in the map's style.`)))}getTransition(){return R.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const s=R.aH(this.sourceCaches,H=>H.serialize()),x=this._serializeByIds(this._order),I=this.map.getTerrain()||void 0,k=this.stylesheet;return R.aI({version:k.version,name:k.name,metadata:k.metadata,light:k.light,center:k.center,zoom:k.zoom,bearing:k.bearing,pitch:k.pitch,sprite:k.sprite,glyphs:k.glyphs,transition:k.transition,sources:s,layers:x,terrain:I},H=>H!==void 0)}_updateLayer(s){this._updatedLayers[s.id]=!0,s.source&&!this._updatedSources[s.source]&&this.sourceCaches[s.source].getSource().type!=="raster"&&(this._updatedSources[s.source]="reload",this.sourceCaches[s.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(s){const x=ee=>this._layers[ee].type==="fill-extrusion",I={},k=[];for(let ee=this._order.length-1;ee>=0;ee--){const ne=this._order[ee];if(x(ne)){I[ne]=ee;for(const ue of s){const _e=ue[ne];if(_e)for(const h of _e)k.push(h)}}}k.sort((ee,ne)=>ne.intersectionZ-ee.intersectionZ);const H=[];for(let ee=this._order.length-1;ee>=0;ee--){const ne=this._order[ee];if(x(ne))for(let ue=k.length-1;ue>=0;ue--){const _e=k[ue].feature;if(I[_e.layer.id]{const nt=te.featureSortOrder;if(nt){const ct=nt.indexOf(Oe.featureIndex);return nt.indexOf(Qe.featureIndex)-ct}return Qe.featureIndex-Oe.featureIndex});for(const Oe of Ie)Te.push(Oe)}}for(const te in B)B[te].forEach(fe=>{const ce=fe.feature,Te=_e[ne[te].source].getFeatureState(ce.layer["source-layer"],ce.id);ce.source=ce.layer.source,ce.layer["source-layer"]&&(ce.sourceLayer=ce.layer["source-layer"]),ce.state=Te});return B}(this._layers,ee,this.sourceCaches,s,x,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(H)}querySourceFeatures(s,x){x&&x.filter&&this._validate(R.y.filter,"querySourceFeatures.filter",x.filter,null,x);const I=this.sourceCaches[s];return I?function(k,H){const ee=k.getRenderableIds().map(_e=>k.getTileByID(_e)),ne=[],ue={};for(let _e=0;_e{Mi[k]=H})(s,x),x.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:s,url:x.workerSourceURL},I):I(null,null))}getLight(){return this.light.getLight()}setLight(s,x={}){this._checkLoaded();const I=this.light.getLight();let k=!1;for(const ee in s)if(!R.aG(s[ee],I[ee])){k=!0;break}if(!k)return;const H={now:R.h.now(),transition:R.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(s,x),this.light.updateTransitions(H)}_validate(s,x,I,k,H={}){return(!H||H.validate!==!1)&&Fo(this,s.call(R.y,R.e({key:x,style:this.serialize(),value:I,styleSpec:R.v},k)))}_remove(s=!0){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),R.aJ.off("pluginStateChange",this._rtlTextPluginCallback);for(const x in this._layers)this._layers[x].setEventedParent(null);for(const x in this.sourceCaches){const I=this.sourceCaches[x];I.setEventedParent(null),I.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(s)}_clearSource(s){this.sourceCaches[s].clearTiles()}_reloadSource(s){this.sourceCaches[s].resume(),this.sourceCaches[s].reload()}_updateSources(s){for(const x in this.sourceCaches)this.sourceCaches[x].update(s,this.map.terrain)}_generateCollisionBoxes(){for(const s in this.sourceCaches)this._reloadSource(s)}_updatePlacement(s,x,I,k,H=!1){let ee=!1,ne=!1;const ue={};for(const _e of this._order){const h=this._layers[_e];if(h.type!=="symbol")continue;if(!ue[h.source]){const d=this.sourceCaches[h.source];ue[h.source]=d.getRenderableIds(!0).map(b=>d.getTileByID(b)).sort((b,B)=>B.tileID.overscaledZ-b.tileID.overscaledZ||(b.tileID.isLessThan(B.tileID)?-1:1))}const g=this.crossTileSymbolIndex.addLayer(h,ue[h.source],s.center.lng);ee=ee||g}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((H=H||this._layerOrderChanged||I===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(R.h.now(),s.zoom))&&(this.pauseablePlacement=new Wo(s,this.map.terrain,this._order,H,x,I,k,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,ue),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(R.h.now()),ne=!0),ee&&this.pauseablePlacement.placement.setStale()),ne||ee)for(const _e of this._order){const h=this._layers[_e];h.type==="symbol"&&this.placement.updateLayerOpacities(h,ue[h.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(R.h.now())}_releaseSymbolFadeTiles(){for(const s in this.sourceCaches)this.sourceCaches[s].releaseSymbolFadeTiles()}getImages(s,x,I){this.imageManager.getImages(x.icons,I),this._updateTilesForChangedImages();const k=this.sourceCaches[x.source];k&&k.setDependencies(x.tileID.key,x.type,x.icons)}getGlyphs(s,x,I){this.glyphManager.getGlyphs(x.stacks,I);const k=this.sourceCaches[x.source];k&&k.setDependencies(x.tileID.key,x.type,[""])}getResource(s,x,I){return R.m(x,I)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(s,x={}){this._checkLoaded(),s&&this._validate(R.y.glyphs,"glyphs",s,null,x)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=s,this.glyphManager.entries={},this.glyphManager.setURL(s))}addSprite(s,x,I={},k){this._checkLoaded();const H=[{id:s,url:x}],ee=[...ki(this.stylesheet.sprite),...H];this._validate(R.y.sprite,"sprite",ee,null,I)||(this.stylesheet.sprite=ee,this._loadSprite(H,!0,k))}removeSprite(s){this._checkLoaded();const x=ki(this.stylesheet.sprite);if(x.find(I=>I.id===s)){if(this._spritesImagesIds[s])for(const I of this._spritesImagesIds[s])this.imageManager.removeImage(I),this._changedImages[I]=!0;x.splice(x.findIndex(I=>I.id===s),1),this.stylesheet.sprite=x.length>0?x:void 0,delete this._spritesImagesIds[s],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new R.k("data",{dataType:"style"}))}else this.fire(new R.j(new Error(`Sprite "${s}" doesn't exists on this map.`)))}getSprite(){return ki(this.stylesheet.sprite)}setSprite(s,x={},I){this._checkLoaded(),s&&this._validate(R.y.sprite,"sprite",s,null,x)||(this.stylesheet.sprite=s,s?this._loadSprite(s,!0,I):(this._unloadSprite(),I&&I(null)))}}Fa.registerForPluginStateChange=R.aK;var sc=R.Q([{name:"a_pos",type:"Int16",components:2}]),Ql="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const oa={prelude:Zo(`#ifdef GL_ES precision mediump float; #else #if !defined(lowp) #define lowp #endif #if !defined(mediump) #define mediump #endif #if !defined(highp) #define highp #endif #endif `,`#ifdef GL_ES precision highp float; #else #if !defined(lowp) #define lowp #endif #if !defined(mediump) #define mediump #endif #if !defined(highp) #define highp #endif #endif vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 );}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} #ifdef TERRAIN3D uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; #endif const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { #ifdef TERRAIN3D highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); #else return 1.0; #endif }float calculate_visibility(vec4 pos) { #ifdef TERRAIN3D vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; #else return 1.0; #endif }float ele(vec2 pos) { #ifdef TERRAIN3D vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; #else return 0.0; #endif }float get_elevation(vec2 pos) { #ifdef TERRAIN3D vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; #else return 0.0; #endif }`),background:Zo(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Zo(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Zo(`varying vec3 v_data;varying float v_visibility; #pragma mapbox: define highp vec4 color #pragma mapbox: define mediump float radius #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define highp vec4 stroke_color #pragma mapbox: define mediump float stroke_width #pragma mapbox: define lowp float stroke_opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize mediump float radius #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; #pragma mapbox: define highp vec4 color #pragma mapbox: define mediump float radius #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define highp vec4 stroke_color #pragma mapbox: define mediump float stroke_width #pragma mapbox: define lowp float stroke_opacity void main(void) { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize mediump float radius #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Zo("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Zo(`uniform highp float u_intensity;varying vec2 v_extrude; #pragma mapbox: define highp float weight #define GAUSS_COEF 0.3989422804014327 void main() { #pragma mapbox: initialize highp float weight float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; #pragma mapbox: define highp float weight #pragma mapbox: define mediump float radius const highp float ZERO=1.0/255.0/16.0; #define GAUSS_COEF 0.3989422804014327 void main(void) { #pragma mapbox: initialize highp float weight #pragma mapbox: initialize mediump float radius vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:Zo(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(0.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Zo("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Zo("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Zo("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:Zo(`#pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity gl_FragColor=color*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec2 a_pos;uniform mat4 u_matrix; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Zo(`varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Zo(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Zo(`#ifdef GL_ES precision highp float; #endif uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Zo(`varying vec4 v_color;void main() {gl_FragColor=v_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; #ifdef TERRAIN3D attribute vec2 a_centroid; #endif varying vec4 v_color; #pragma mapbox: define highp float base #pragma mapbox: define highp float height #pragma mapbox: define highp vec4 color void main() { #pragma mapbox: initialize highp float base #pragma mapbox: initialize highp float height #pragma mapbox: initialize highp vec4 color vec3 normal=a_normal_ed.xyz; #ifdef TERRAIN3D float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); #else float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; #endif base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Zo(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float base #pragma mapbox: initialize lowp float height #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; #ifdef TERRAIN3D attribute vec2 a_centroid; #endif varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float base #pragma mapbox: initialize lowp float height #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; #ifdef TERRAIN3D float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); #else float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; #endif base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 ? a_pos : vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Zo(`#ifdef GL_ES precision highp float; #endif uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:Zo(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; #define PI 3.141592653589793 void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:Zo(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_width2=vec2(outset,inset);}`),lineGradient:Zo(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_width2=vec2(outset,inset);}`),linePattern:Zo(`#ifdef GL_ES precision highp float; #endif uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float gapwidth #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Zo(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Zo(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Zo(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Zo(`#define SDF_PX 8.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Zo(`#define SDF_PX 8.0 #define SDF 1.0 #define ICON 0.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:Zo("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Ql),terrainDepth:Zo("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",Ql),terrainCoords:Zo("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",Ql)};function Zo(z,s){const x=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,I=s.match(/attribute ([\w]+) ([\w]+)/g),k=z.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),H=s.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),ee=H?H.concat(k):k,ne={};return{fragmentSource:z=z.replace(x,(ue,_e,h,g,d)=>(ne[d]=!0,_e==="define"?` #ifndef HAS_UNIFORM_u_${d} varying ${h} ${g} ${d}; #else uniform ${h} ${g} u_${d}; #endif `:` #ifdef HAS_UNIFORM_u_${d} ${h} ${g} ${d} = u_${d}; #endif `)),vertexSource:s=s.replace(x,(ue,_e,h,g,d)=>{const b=g==="float"?"vec2":"vec4",B=d.match(/color/)?"color":b;return ne[d]?_e==="define"?` #ifndef HAS_UNIFORM_u_${d} uniform lowp float u_${d}_t; attribute ${h} ${b} a_${d}; varying ${h} ${g} ${d}; #else uniform ${h} ${g} u_${d}; #endif `:B==="vec4"?` #ifndef HAS_UNIFORM_u_${d} ${d} = a_${d}; #else ${h} ${g} ${d} = u_${d}; #endif `:` #ifndef HAS_UNIFORM_u_${d} ${d} = unpack_mix_${B}(a_${d}, u_${d}_t); #else ${h} ${g} ${d} = u_${d}; #endif `:_e==="define"?` #ifndef HAS_UNIFORM_u_${d} uniform lowp float u_${d}_t; attribute ${h} ${b} a_${d}; #else uniform ${h} ${g} u_${d}; #endif `:B==="vec4"?` #ifndef HAS_UNIFORM_u_${d} ${h} ${g} ${d} = a_${d}; #else ${h} ${g} ${d} = u_${d}; #endif `:` #ifndef HAS_UNIFORM_u_${d} ${h} ${g} ${d} = unpack_mix_${B}(a_${d}, u_${d}_t); #else ${h} ${g} ${d} = u_${d}; #endif `}),staticAttributes:I,staticUniforms:ee}}class il{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(s,x,I,k,H,ee,ne,ue,_e){this.context=s;let h=this.boundPaintVertexBuffers.length!==k.length;for(let g=0;!h&&g({u_depth:new R.aL(Oe,Qe.u_depth),u_terrain:new R.aL(Oe,Qe.u_terrain),u_terrain_dim:new R.aM(Oe,Qe.u_terrain_dim),u_terrain_matrix:new R.aN(Oe,Qe.u_terrain_matrix),u_terrain_unpack:new R.aO(Oe,Qe.u_terrain_unpack),u_terrain_exaggeration:new R.aM(Oe,Qe.u_terrain_exaggeration)}))(s,Ie),this.binderUniforms=I?I.getUniforms(s,Ie):[]}draw(s,x,I,k,H,ee,ne,ue,_e,h,g,d,b,B,G,q,te,fe){const ce=s.gl;if(this.failedToCreate)return;if(s.program.set(this.program),s.setDepthMode(I),s.setStencilMode(k),s.setColorMode(H),s.setCullFace(ee),ue){s.activeTexture.set(ce.TEXTURE2),ce.bindTexture(ce.TEXTURE_2D,ue.depthTexture),s.activeTexture.set(ce.TEXTURE3),ce.bindTexture(ce.TEXTURE_2D,ue.texture);for(const Ie in this.terrainUniforms)this.terrainUniforms[Ie].set(ue[Ie])}for(const Ie in this.fixedUniforms)this.fixedUniforms[Ie].set(ne[Ie]);G&&G.setUniforms(s,this.binderUniforms,b,{zoom:B});let Te=0;switch(x){case ce.LINES:Te=2;break;case ce.TRIANGLES:Te=3;break;case ce.LINE_STRIP:Te=1}for(const Ie of d.get()){const Oe=Ie.vaos||(Ie.vaos={});(Oe[_e]||(Oe[_e]=new il)).bind(s,this,h,G?G.getPaintVertexBuffers():[],g,Ie.vertexOffset,q,te,fe),ce.drawElements(x,Ie.primitiveLength*Te,ce.UNSIGNED_SHORT,Ie.primitiveOffset*Te*2)}}}function Wa(z,s,x){const I=1/je(x,1,s.transform.tileZoom),k=Math.pow(2,x.tileID.overscaledZ),H=x.tileSize*Math.pow(2,s.transform.tileZoom)/k,ee=H*(x.tileID.canonical.x+x.tileID.wrap*k),ne=H*x.tileID.canonical.y;return{u_image:0,u_texsize:x.imageAtlasTexture.size,u_scale:[I,z.fromScale,z.toScale],u_fade:z.t,u_pixel_coord_upper:[ee>>16,ne>>16],u_pixel_coord_lower:[65535&ee,65535&ne]}}const Ds=(z,s,x,I)=>{const k=s.style.light,H=k.properties.get("position"),ee=[H.x,H.y,H.z],ne=function(){var _e=new R.A(9);return R.A!=Float32Array&&(_e[1]=0,_e[2]=0,_e[3]=0,_e[5]=0,_e[6]=0,_e[7]=0),_e[0]=1,_e[4]=1,_e[8]=1,_e}();k.properties.get("anchor")==="viewport"&&function(_e,h){var g=Math.sin(h),d=Math.cos(h);_e[0]=d,_e[1]=g,_e[2]=0,_e[3]=-g,_e[4]=d,_e[5]=0,_e[6]=0,_e[7]=0,_e[8]=1}(ne,-s.transform.angle),function(_e,h,g){var d=h[0],b=h[1],B=h[2];_e[0]=d*g[0]+b*g[3]+B*g[6],_e[1]=d*g[1]+b*g[4]+B*g[7],_e[2]=d*g[2]+b*g[5]+B*g[8]}(ee,ee,ne);const ue=k.properties.get("color");return{u_matrix:z,u_lightpos:ee,u_lightintensity:k.properties.get("intensity"),u_lightcolor:[ue.r,ue.g,ue.b],u_vertical_gradient:+x,u_opacity:I}},Rl=(z,s,x,I,k,H,ee)=>R.e(Ds(z,s,x,I),Wa(H,s,ee),{u_height_factor:-Math.pow(2,k.overscaledZ)/ee.tileSize/8}),gu=z=>({u_matrix:z}),gl=(z,s,x,I)=>R.e(gu(z),Wa(x,s,I)),wl=(z,s)=>({u_matrix:z,u_world:s}),ol=(z,s,x,I,k)=>R.e(gl(z,s,x,I),{u_world:k}),Qa=(z,s,x,I)=>{const k=z.transform;let H,ee;if(I.paint.get("circle-pitch-alignment")==="map"){const ne=je(x,1,k.zoom);H=!0,ee=[ne,ne]}else H=!1,ee=k.pixelsToGLUnits;return{u_camera_to_center_distance:k.cameraToCenterDistance,u_scale_with_map:+(I.paint.get("circle-pitch-scale")==="map"),u_matrix:z.translatePosMatrix(s.posMatrix,x,I.paint.get("circle-translate"),I.paint.get("circle-translate-anchor")),u_pitch_with_map:+H,u_device_pixel_ratio:z.pixelRatio,u_extrude_scale:ee}},Gl=(z,s,x)=>{const I=je(x,1,s.zoom),k=Math.pow(2,s.zoom-x.tileID.overscaledZ),H=x.tileID.overscaleFactor();return{u_matrix:z,u_camera_to_center_distance:s.cameraToCenterDistance,u_pixels_to_tile_units:I,u_extrude_scale:[s.pixelsToGLUnits[0]/(I*k),s.pixelsToGLUnits[1]/(I*k)],u_overscale_factor:H}},Wl=(z,s,x=1)=>({u_matrix:z,u_color:s,u_overlay:0,u_overlay_scale:x}),ut=z=>({u_matrix:z}),At=(z,s,x,I)=>({u_matrix:z,u_extrude_scale:je(s,1,x),u_intensity:I});function ir(z,s){const x=Math.pow(2,s.canonical.z),I=s.canonical.y;return[new R.U(0,I/x).toLngLat().lat,new R.U(0,(I+1)/x).toLngLat().lat]}const jr=(z,s,x,I)=>{const k=z.transform;return{u_matrix:kl(z,s,x,I),u_ratio:1/je(s,1,k.zoom),u_device_pixel_ratio:z.pixelRatio,u_units_to_pixels:[1/k.pixelsToGLUnits[0],1/k.pixelsToGLUnits[1]]}},Dn=(z,s,x,I,k)=>R.e(jr(z,s,x,k),{u_image:0,u_image_height:I}),oo=(z,s,x,I,k)=>{const H=z.transform,ee=mn(s,H);return{u_matrix:kl(z,s,x,k),u_texsize:s.imageAtlasTexture.size,u_ratio:1/je(s,1,H.zoom),u_device_pixel_ratio:z.pixelRatio,u_image:0,u_scale:[ee,I.fromScale,I.toScale],u_fade:I.t,u_units_to_pixels:[1/H.pixelsToGLUnits[0],1/H.pixelsToGLUnits[1]]}},Xa=(z,s,x,I,k,H)=>{const ee=z.lineAtlas,ne=mn(s,z.transform),ue=x.layout.get("line-cap")==="round",_e=ee.getDash(I.from,ue),h=ee.getDash(I.to,ue),g=_e.width*k.fromScale,d=h.width*k.toScale;return R.e(jr(z,s,x,H),{u_patternscale_a:[ne/g,-_e.height/2],u_patternscale_b:[ne/d,-h.height/2],u_sdfgamma:ee.width/(256*Math.min(g,d)*z.pixelRatio)/2,u_image:0,u_tex_y_a:_e.y,u_tex_y_b:h.y,u_mix:k.t})};function mn(z,s){return 1/je(z,1,s.tileZoom)}function kl(z,s,x,I){return z.translatePosMatrix(I?I.posMatrix:s.tileID.posMatrix,s,x.paint.get("line-translate"),x.paint.get("line-translate-anchor"))}const Il=(z,s,x,I,k)=>{return{u_matrix:z,u_tl_parent:s,u_scale_parent:x,u_buffer_scale:1,u_fade_t:I.mix,u_opacity:I.opacity*k.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:k.paint.get("raster-brightness-min"),u_brightness_high:k.paint.get("raster-brightness-max"),u_saturation_factor:(ee=k.paint.get("raster-saturation"),ee>0?1-1/(1.001-ee):-ee),u_contrast_factor:(H=k.paint.get("raster-contrast"),H>0?1/(1-H):1+H),u_spin_weights:Ia(k.paint.get("raster-hue-rotate"))};var H,ee};function Ia(z){z*=Math.PI/180;const s=Math.sin(z),x=Math.cos(z);return[(2*x+1)/3,(-Math.sqrt(3)*s-x+1)/3,(Math.sqrt(3)*s-x+1)/3]}const Xh=(z,s,x,I,k,H,ee,ne,ue,_e)=>{const h=k.transform;return{u_is_size_zoom_constant:+(z==="constant"||z==="source"),u_is_size_feature_constant:+(z==="constant"||z==="camera"),u_size_t:s?s.uSizeT:0,u_size:s?s.uSize:0,u_camera_to_center_distance:h.cameraToCenterDistance,u_pitch:h.pitch/360*2*Math.PI,u_rotate_symbol:+x,u_aspect_ratio:h.width/h.height,u_fade_change:k.options.fadeDuration?k.symbolFadeChange:1,u_matrix:H,u_label_plane_matrix:ee,u_coord_matrix:ne,u_is_text:+ue,u_pitch_with_map:+I,u_texsize:_e,u_texture:0}},Sl=(z,s,x,I,k,H,ee,ne,ue,_e,h)=>{const g=k.transform;return R.e(Xh(z,s,x,I,k,H,ee,ne,ue,_e),{u_gamma_scale:I?Math.cos(g._pitch)*g.cameraToCenterDistance:1,u_device_pixel_ratio:k.pixelRatio,u_is_halo:+h})},Va=(z,s,x,I,k,H,ee,ne,ue,_e)=>R.e(Sl(z,s,x,I,k,H,ee,ne,!0,ue,!0),{u_texsize_icon:_e,u_texture_icon:1}),Aa=(z,s,x)=>({u_matrix:z,u_opacity:s,u_color:x}),Ni=(z,s,x,I,k,H)=>R.e(function(ee,ne,ue,_e){const h=ue.imageManager.getPattern(ee.from.toString()),g=ue.imageManager.getPattern(ee.to.toString()),{width:d,height:b}=ue.imageManager.getPixelSize(),B=Math.pow(2,_e.tileID.overscaledZ),G=_e.tileSize*Math.pow(2,ue.transform.tileZoom)/B,q=G*(_e.tileID.canonical.x+_e.tileID.wrap*B),te=G*_e.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:h.tl,u_pattern_br_a:h.br,u_pattern_tl_b:g.tl,u_pattern_br_b:g.br,u_texsize:[d,b],u_mix:ne.t,u_pattern_size_a:h.displaySize,u_pattern_size_b:g.displaySize,u_scale_a:ne.fromScale,u_scale_b:ne.toScale,u_tile_units_to_pixels:1/je(_e,1,ue.transform.tileZoom),u_pixel_coord_upper:[q>>16,te>>16],u_pixel_coord_lower:[65535&q,65535&te]}}(I,H,x,k),{u_matrix:z,u_opacity:s}),lc={fillExtrusion:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_lightpos:new R.aP(z,s.u_lightpos),u_lightintensity:new R.aM(z,s.u_lightintensity),u_lightcolor:new R.aP(z,s.u_lightcolor),u_vertical_gradient:new R.aM(z,s.u_vertical_gradient),u_opacity:new R.aM(z,s.u_opacity)}),fillExtrusionPattern:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_lightpos:new R.aP(z,s.u_lightpos),u_lightintensity:new R.aM(z,s.u_lightintensity),u_lightcolor:new R.aP(z,s.u_lightcolor),u_vertical_gradient:new R.aM(z,s.u_vertical_gradient),u_height_factor:new R.aM(z,s.u_height_factor),u_image:new R.aL(z,s.u_image),u_texsize:new R.aQ(z,s.u_texsize),u_pixel_coord_upper:new R.aQ(z,s.u_pixel_coord_upper),u_pixel_coord_lower:new R.aQ(z,s.u_pixel_coord_lower),u_scale:new R.aP(z,s.u_scale),u_fade:new R.aM(z,s.u_fade),u_opacity:new R.aM(z,s.u_opacity)}),fill:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix)}),fillPattern:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_image:new R.aL(z,s.u_image),u_texsize:new R.aQ(z,s.u_texsize),u_pixel_coord_upper:new R.aQ(z,s.u_pixel_coord_upper),u_pixel_coord_lower:new R.aQ(z,s.u_pixel_coord_lower),u_scale:new R.aP(z,s.u_scale),u_fade:new R.aM(z,s.u_fade)}),fillOutline:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_world:new R.aQ(z,s.u_world)}),fillOutlinePattern:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_world:new R.aQ(z,s.u_world),u_image:new R.aL(z,s.u_image),u_texsize:new R.aQ(z,s.u_texsize),u_pixel_coord_upper:new R.aQ(z,s.u_pixel_coord_upper),u_pixel_coord_lower:new R.aQ(z,s.u_pixel_coord_lower),u_scale:new R.aP(z,s.u_scale),u_fade:new R.aM(z,s.u_fade)}),circle:(z,s)=>({u_camera_to_center_distance:new R.aM(z,s.u_camera_to_center_distance),u_scale_with_map:new R.aL(z,s.u_scale_with_map),u_pitch_with_map:new R.aL(z,s.u_pitch_with_map),u_extrude_scale:new R.aQ(z,s.u_extrude_scale),u_device_pixel_ratio:new R.aM(z,s.u_device_pixel_ratio),u_matrix:new R.aN(z,s.u_matrix)}),collisionBox:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_camera_to_center_distance:new R.aM(z,s.u_camera_to_center_distance),u_pixels_to_tile_units:new R.aM(z,s.u_pixels_to_tile_units),u_extrude_scale:new R.aQ(z,s.u_extrude_scale),u_overscale_factor:new R.aM(z,s.u_overscale_factor)}),collisionCircle:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_inv_matrix:new R.aN(z,s.u_inv_matrix),u_camera_to_center_distance:new R.aM(z,s.u_camera_to_center_distance),u_viewport_size:new R.aQ(z,s.u_viewport_size)}),debug:(z,s)=>({u_color:new R.aR(z,s.u_color),u_matrix:new R.aN(z,s.u_matrix),u_overlay:new R.aL(z,s.u_overlay),u_overlay_scale:new R.aM(z,s.u_overlay_scale)}),clippingMask:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix)}),heatmap:(z,s)=>({u_extrude_scale:new R.aM(z,s.u_extrude_scale),u_intensity:new R.aM(z,s.u_intensity),u_matrix:new R.aN(z,s.u_matrix)}),heatmapTexture:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_world:new R.aQ(z,s.u_world),u_image:new R.aL(z,s.u_image),u_color_ramp:new R.aL(z,s.u_color_ramp),u_opacity:new R.aM(z,s.u_opacity)}),hillshade:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_image:new R.aL(z,s.u_image),u_latrange:new R.aQ(z,s.u_latrange),u_light:new R.aQ(z,s.u_light),u_shadow:new R.aR(z,s.u_shadow),u_highlight:new R.aR(z,s.u_highlight),u_accent:new R.aR(z,s.u_accent)}),hillshadePrepare:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_image:new R.aL(z,s.u_image),u_dimension:new R.aQ(z,s.u_dimension),u_zoom:new R.aM(z,s.u_zoom),u_unpack:new R.aO(z,s.u_unpack)}),line:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_ratio:new R.aM(z,s.u_ratio),u_device_pixel_ratio:new R.aM(z,s.u_device_pixel_ratio),u_units_to_pixels:new R.aQ(z,s.u_units_to_pixels)}),lineGradient:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_ratio:new R.aM(z,s.u_ratio),u_device_pixel_ratio:new R.aM(z,s.u_device_pixel_ratio),u_units_to_pixels:new R.aQ(z,s.u_units_to_pixels),u_image:new R.aL(z,s.u_image),u_image_height:new R.aM(z,s.u_image_height)}),linePattern:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_texsize:new R.aQ(z,s.u_texsize),u_ratio:new R.aM(z,s.u_ratio),u_device_pixel_ratio:new R.aM(z,s.u_device_pixel_ratio),u_image:new R.aL(z,s.u_image),u_units_to_pixels:new R.aQ(z,s.u_units_to_pixels),u_scale:new R.aP(z,s.u_scale),u_fade:new R.aM(z,s.u_fade)}),lineSDF:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_ratio:new R.aM(z,s.u_ratio),u_device_pixel_ratio:new R.aM(z,s.u_device_pixel_ratio),u_units_to_pixels:new R.aQ(z,s.u_units_to_pixels),u_patternscale_a:new R.aQ(z,s.u_patternscale_a),u_patternscale_b:new R.aQ(z,s.u_patternscale_b),u_sdfgamma:new R.aM(z,s.u_sdfgamma),u_image:new R.aL(z,s.u_image),u_tex_y_a:new R.aM(z,s.u_tex_y_a),u_tex_y_b:new R.aM(z,s.u_tex_y_b),u_mix:new R.aM(z,s.u_mix)}),raster:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_tl_parent:new R.aQ(z,s.u_tl_parent),u_scale_parent:new R.aM(z,s.u_scale_parent),u_buffer_scale:new R.aM(z,s.u_buffer_scale),u_fade_t:new R.aM(z,s.u_fade_t),u_opacity:new R.aM(z,s.u_opacity),u_image0:new R.aL(z,s.u_image0),u_image1:new R.aL(z,s.u_image1),u_brightness_low:new R.aM(z,s.u_brightness_low),u_brightness_high:new R.aM(z,s.u_brightness_high),u_saturation_factor:new R.aM(z,s.u_saturation_factor),u_contrast_factor:new R.aM(z,s.u_contrast_factor),u_spin_weights:new R.aP(z,s.u_spin_weights)}),symbolIcon:(z,s)=>({u_is_size_zoom_constant:new R.aL(z,s.u_is_size_zoom_constant),u_is_size_feature_constant:new R.aL(z,s.u_is_size_feature_constant),u_size_t:new R.aM(z,s.u_size_t),u_size:new R.aM(z,s.u_size),u_camera_to_center_distance:new R.aM(z,s.u_camera_to_center_distance),u_pitch:new R.aM(z,s.u_pitch),u_rotate_symbol:new R.aL(z,s.u_rotate_symbol),u_aspect_ratio:new R.aM(z,s.u_aspect_ratio),u_fade_change:new R.aM(z,s.u_fade_change),u_matrix:new R.aN(z,s.u_matrix),u_label_plane_matrix:new R.aN(z,s.u_label_plane_matrix),u_coord_matrix:new R.aN(z,s.u_coord_matrix),u_is_text:new R.aL(z,s.u_is_text),u_pitch_with_map:new R.aL(z,s.u_pitch_with_map),u_texsize:new R.aQ(z,s.u_texsize),u_texture:new R.aL(z,s.u_texture)}),symbolSDF:(z,s)=>({u_is_size_zoom_constant:new R.aL(z,s.u_is_size_zoom_constant),u_is_size_feature_constant:new R.aL(z,s.u_is_size_feature_constant),u_size_t:new R.aM(z,s.u_size_t),u_size:new R.aM(z,s.u_size),u_camera_to_center_distance:new R.aM(z,s.u_camera_to_center_distance),u_pitch:new R.aM(z,s.u_pitch),u_rotate_symbol:new R.aL(z,s.u_rotate_symbol),u_aspect_ratio:new R.aM(z,s.u_aspect_ratio),u_fade_change:new R.aM(z,s.u_fade_change),u_matrix:new R.aN(z,s.u_matrix),u_label_plane_matrix:new R.aN(z,s.u_label_plane_matrix),u_coord_matrix:new R.aN(z,s.u_coord_matrix),u_is_text:new R.aL(z,s.u_is_text),u_pitch_with_map:new R.aL(z,s.u_pitch_with_map),u_texsize:new R.aQ(z,s.u_texsize),u_texture:new R.aL(z,s.u_texture),u_gamma_scale:new R.aM(z,s.u_gamma_scale),u_device_pixel_ratio:new R.aM(z,s.u_device_pixel_ratio),u_is_halo:new R.aL(z,s.u_is_halo)}),symbolTextAndIcon:(z,s)=>({u_is_size_zoom_constant:new R.aL(z,s.u_is_size_zoom_constant),u_is_size_feature_constant:new R.aL(z,s.u_is_size_feature_constant),u_size_t:new R.aM(z,s.u_size_t),u_size:new R.aM(z,s.u_size),u_camera_to_center_distance:new R.aM(z,s.u_camera_to_center_distance),u_pitch:new R.aM(z,s.u_pitch),u_rotate_symbol:new R.aL(z,s.u_rotate_symbol),u_aspect_ratio:new R.aM(z,s.u_aspect_ratio),u_fade_change:new R.aM(z,s.u_fade_change),u_matrix:new R.aN(z,s.u_matrix),u_label_plane_matrix:new R.aN(z,s.u_label_plane_matrix),u_coord_matrix:new R.aN(z,s.u_coord_matrix),u_is_text:new R.aL(z,s.u_is_text),u_pitch_with_map:new R.aL(z,s.u_pitch_with_map),u_texsize:new R.aQ(z,s.u_texsize),u_texsize_icon:new R.aQ(z,s.u_texsize_icon),u_texture:new R.aL(z,s.u_texture),u_texture_icon:new R.aL(z,s.u_texture_icon),u_gamma_scale:new R.aM(z,s.u_gamma_scale),u_device_pixel_ratio:new R.aM(z,s.u_device_pixel_ratio),u_is_halo:new R.aL(z,s.u_is_halo)}),background:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_opacity:new R.aM(z,s.u_opacity),u_color:new R.aR(z,s.u_color)}),backgroundPattern:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_opacity:new R.aM(z,s.u_opacity),u_image:new R.aL(z,s.u_image),u_pattern_tl_a:new R.aQ(z,s.u_pattern_tl_a),u_pattern_br_a:new R.aQ(z,s.u_pattern_br_a),u_pattern_tl_b:new R.aQ(z,s.u_pattern_tl_b),u_pattern_br_b:new R.aQ(z,s.u_pattern_br_b),u_texsize:new R.aQ(z,s.u_texsize),u_mix:new R.aM(z,s.u_mix),u_pattern_size_a:new R.aQ(z,s.u_pattern_size_a),u_pattern_size_b:new R.aQ(z,s.u_pattern_size_b),u_scale_a:new R.aM(z,s.u_scale_a),u_scale_b:new R.aM(z,s.u_scale_b),u_pixel_coord_upper:new R.aQ(z,s.u_pixel_coord_upper),u_pixel_coord_lower:new R.aQ(z,s.u_pixel_coord_lower),u_tile_units_to_pixels:new R.aM(z,s.u_tile_units_to_pixels)}),terrain:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_texture:new R.aL(z,s.u_texture),u_ele_delta:new R.aM(z,s.u_ele_delta)}),terrainDepth:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_ele_delta:new R.aM(z,s.u_ele_delta)}),terrainCoords:(z,s)=>({u_matrix:new R.aN(z,s.u_matrix),u_texture:new R.aL(z,s.u_texture),u_terrain_coords_id:new R.aM(z,s.u_terrain_coords_id),u_ele_delta:new R.aM(z,s.u_ele_delta)})};class Ku{constructor(s,x,I){this.context=s;const k=s.gl;this.buffer=k.createBuffer(),this.dynamicDraw=!!I,this.context.unbindVAO(),s.bindElementBuffer.set(this.buffer),k.bufferData(k.ELEMENT_ARRAY_BUFFER,x.arrayBuffer,this.dynamicDraw?k.DYNAMIC_DRAW:k.STATIC_DRAW),this.dynamicDraw||delete x.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(s){const x=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),x.bufferSubData(x.ELEMENT_ARRAY_BUFFER,0,s.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const lo={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class bs{constructor(s,x,I,k){this.length=x.length,this.attributes=I,this.itemSize=x.bytesPerElement,this.dynamicDraw=k,this.context=s;const H=s.gl;this.buffer=H.createBuffer(),s.bindVertexBuffer.set(this.buffer),H.bufferData(H.ARRAY_BUFFER,x.arrayBuffer,this.dynamicDraw?H.DYNAMIC_DRAW:H.STATIC_DRAW),this.dynamicDraw||delete x.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(s){if(s.length!==this.length)throw new Error(`Length of new data is ${s.length}, which doesn't match current length of ${this.length}`);const x=this.context.gl;this.bind(),x.bufferSubData(x.ARRAY_BUFFER,0,s.arrayBuffer)}enableAttributes(s,x){for(let I=0;I0){const tt=R.Z(),Tt=Qe;R.aU(tt,Oe.placementInvProjMatrix,z.transform.glCoordMatrix),R.aU(tt,tt,Oe.placementViewportMatrix),h.push({circleArray:ct,circleOffset:d,transform:Tt,invTransform:tt,coord:Te}),g+=ct.length/4,d=g}nt&&_e.draw(ne,ue.LINES,Na.disabled,Is.disabled,z.colorModeForRenderPass(),ys.disabled,Gl(Qe,z.transform,Ie),z.style.map.terrain&&z.style.map.terrain.getTerrainData(Te),x.id,nt.layoutVertexBuffer,nt.indexBuffer,nt.segments,null,z.transform.zoom,null,null,nt.collisionVertexBuffer)}if(!ee||!h.length)return;const b=z.useProgram("collisionCircle"),B=new R.aV;B.resize(4*g),B._trim();let G=0;for(const ce of h)for(let Te=0;Te=0&&(B[q.associatedIconIndex]={shiftedAnchor:Ut,angle:Nt})}else le(q.numGlyphs,d)}if(_e){b.clear();const G=z.icon.placedSymbolArray;for(let q=0;qz.style.map.terrain.getElevation(nt,$a,vs):null,ja=x.layout.get("text-rotation-alignment")==="map";dn(tt,nt.posMatrix,z,k,Wi,Ko,q,_e,ja,ts)}const ko=z.translatePosMatrix(nt.posMatrix,ct,H,ee),xo=te||k&&Oe||mo?es:Wi,qi=z.translatePosMatrix(Ko,ct,H,ee,!0),xs=Nt&&x.paint.get(k?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let gs;gs=Nt?tt.iconsInText?Va(pr.kind,Hr,fe,q,z,ko,xo,qi,nn,Ui):Sl(pr.kind,Hr,fe,q,z,ko,xo,qi,k,nn,!0):Xh(pr.kind,Hr,fe,q,z,ko,xo,qi,k,nn);const Cl={program:Dr,buffers:Tt,uniformValues:gs,atlasTexture:Gn,atlasTextureIcon:ho,atlasInterpolation:di,atlasInterpolationIcon:Di,isSDF:Nt,hasHalo:xs};if(ce&&tt.canOverlap){Te=!0;const ts=Tt.segments.get();for(const ja of ts)Qe.push({segments:new R.S([ja]),sortKey:ja.sortKey,state:Cl,terrainData:sn})}else Qe.push({segments:Tt.segments,sortKey:0,state:Cl,terrainData:sn})}Te&&Qe.sort((nt,ct)=>nt.sortKey-ct.sortKey);for(const nt of Qe){const ct=nt.state;if(d.activeTexture.set(b.TEXTURE0),ct.atlasTexture.bind(ct.atlasInterpolation,b.CLAMP_TO_EDGE),ct.atlasTextureIcon&&(d.activeTexture.set(b.TEXTURE1),ct.atlasTextureIcon&&ct.atlasTextureIcon.bind(ct.atlasInterpolationIcon,b.CLAMP_TO_EDGE)),ct.isSDF){const tt=ct.uniformValues;ct.hasHalo&&(tt.u_is_halo=1,$h(ct.buffers,nt.segments,x,z,ct.program,Ie,h,g,tt,nt.terrainData)),tt.u_is_halo=0}$h(ct.buffers,nt.segments,x,z,ct.program,Ie,h,g,ct.uniformValues,nt.terrainData)}}function $h(z,s,x,I,k,H,ee,ne,ue,_e){const h=I.context;k.draw(h,h.gl.TRIANGLES,H,ee,ne,ys.disabled,ue,_e,x.id,z.layoutVertexBuffer,z.indexBuffer,s,x.paint,I.transform.zoom,z.programConfigurations.get(x.id),z.dynamicLayoutVertexBuffer,z.opacityVertexBuffer)}function Xo(z,s,x,I,k){if(!x||!I||!I.imageAtlas)return;const H=I.imageAtlas.patternPositions;let ee=H[x.to.toString()],ne=H[x.from.toString()];if(!ee&&ne&&(ee=ne),!ne&&ee&&(ne=ee),!ee||!ne){const ue=k.getPaintProperty(s);ee=H[ue],ne=H[ue]}ee&&ne&&z.setConstantPatternPositions(ee,ne)}function au(z,s,x,I,k,H,ee){const ne=z.context.gl,ue="fill-pattern",_e=x.paint.get(ue),h=_e&&_e.constantOr(1),g=x.getCrossfadeParameters();let d,b,B,G,q;ee?(b=h&&!x.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",d=ne.LINES):(b=h?"fillPattern":"fill",d=ne.TRIANGLES);const te=_e.constantOr(null);for(const fe of I){const ce=s.getTile(fe);if(h&&!ce.patternsLoaded())continue;const Te=ce.getBucket(x);if(!Te)continue;const Ie=Te.programConfigurations.get(x.id),Oe=z.useProgram(b,Ie),Qe=z.style.map.terrain&&z.style.map.terrain.getTerrainData(fe);h&&(z.context.activeTexture.set(ne.TEXTURE0),ce.imageAtlasTexture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE),Ie.updatePaintBuffers(g)),Xo(Ie,ue,te,ce,x);const nt=Qe?fe:null,ct=z.translatePosMatrix(nt?nt.posMatrix:fe.posMatrix,ce,x.paint.get("fill-translate"),x.paint.get("fill-translate-anchor"));if(ee){G=Te.indexBuffer2,q=Te.segments2;const tt=[ne.drawingBufferWidth,ne.drawingBufferHeight];B=b==="fillOutlinePattern"&&h?ol(ct,z,g,ce,tt):wl(ct,tt)}else G=Te.indexBuffer,q=Te.segments,B=h?gl(ct,z,g,ce):gu(ct);Oe.draw(z.context,d,k,z.stencilModeForClipping(fe),H,ys.disabled,B,Qe,x.id,Te.layoutVertexBuffer,G,q,x.paint,z.transform.zoom,Ie)}}function dl(z,s,x,I,k,H,ee){const ne=z.context,ue=ne.gl,_e="fill-extrusion-pattern",h=x.paint.get(_e),g=h.constantOr(1),d=x.getCrossfadeParameters(),b=x.paint.get("fill-extrusion-opacity"),B=h.constantOr(null);for(const G of I){const q=s.getTile(G),te=q.getBucket(x);if(!te)continue;const fe=z.style.map.terrain&&z.style.map.terrain.getTerrainData(G),ce=te.programConfigurations.get(x.id),Te=z.useProgram(g?"fillExtrusionPattern":"fillExtrusion",ce);g&&(z.context.activeTexture.set(ue.TEXTURE0),q.imageAtlasTexture.bind(ue.LINEAR,ue.CLAMP_TO_EDGE),ce.updatePaintBuffers(d)),Xo(ce,_e,B,q,x);const Ie=z.translatePosMatrix(G.posMatrix,q,x.paint.get("fill-extrusion-translate"),x.paint.get("fill-extrusion-translate-anchor")),Oe=x.paint.get("fill-extrusion-vertical-gradient"),Qe=g?Rl(Ie,z,Oe,b,G,d,q):Ds(Ie,z,Oe,b);Te.draw(ne,ne.gl.TRIANGLES,k,H,ee,ys.backCCW,Qe,fe,x.id,te.layoutVertexBuffer,te.indexBuffer,te.segments,x.paint,z.transform.zoom,ce,z.style.map.terrain&&te.centroidVertexBuffer)}}function tc(z,s,x,I,k,H,ee){const ne=z.context,ue=ne.gl,_e=x.fbo;if(!_e)return;const h=z.useProgram("hillshade"),g=z.style.map.terrain&&z.style.map.terrain.getTerrainData(s);ne.activeTexture.set(ue.TEXTURE0),ue.bindTexture(ue.TEXTURE_2D,_e.colorAttachment.get()),h.draw(ne,ue.TRIANGLES,k,H,ee,ys.disabled,((d,b,B,G)=>{const q=B.paint.get("hillshade-shadow-color"),te=B.paint.get("hillshade-highlight-color"),fe=B.paint.get("hillshade-accent-color");let ce=B.paint.get("hillshade-illumination-direction")*(Math.PI/180);B.paint.get("hillshade-illumination-anchor")==="viewport"&&(ce-=d.transform.angle);const Te=!d.options.moving;return{u_matrix:G?G.posMatrix:d.transform.calculatePosMatrix(b.tileID.toUnwrapped(),Te),u_image:0,u_latrange:ir(0,b.tileID),u_light:[B.paint.get("hillshade-exaggeration"),ce],u_shadow:q,u_highlight:te,u_accent:fe}})(z,x,I,g?s:null),g,I.id,z.rasterBoundsBuffer,z.quadTriangleIndexBuffer,z.rasterBoundsSegments)}function bh(z,s,x,I,k,H){const ee=z.context,ne=ee.gl,ue=s.dem;if(ue&&ue.data){const _e=ue.dim,h=ue.stride,g=ue.getPixels();if(ee.activeTexture.set(ne.TEXTURE1),ee.pixelStoreUnpackPremultiplyAlpha.set(!1),s.demTexture=s.demTexture||z.getTileTexture(h),s.demTexture){const b=s.demTexture;b.update(g,{premultiply:!1}),b.bind(ne.NEAREST,ne.CLAMP_TO_EDGE)}else s.demTexture=new xr(ee,g,ne.RGBA,{premultiply:!1}),s.demTexture.bind(ne.NEAREST,ne.CLAMP_TO_EDGE);ee.activeTexture.set(ne.TEXTURE0);let d=s.fbo;if(!d){const b=new xr(ee,{width:_e,height:_e,data:null},ne.RGBA);b.bind(ne.LINEAR,ne.CLAMP_TO_EDGE),d=s.fbo=ee.createFramebuffer(_e,_e,!0,!1),d.colorAttachment.set(b.texture)}ee.bindFramebuffer.set(d.framebuffer),ee.viewport.set([0,0,_e,_e]),z.useProgram("hillshadePrepare").draw(ee,ne.TRIANGLES,I,k,H,ys.disabled,((b,B)=>{const G=B.stride,q=R.Z();return R.aS(q,0,R.N,-R.N,0,0,1),R.$(q,q,[0,-R.N,0]),{u_matrix:q,u_image:1,u_dimension:[G,G],u_zoom:b.overscaledZ,u_unpack:B.getUnpackVector()}})(s.tileID,ue),null,x.id,z.rasterBoundsBuffer,z.quadTriangleIndexBuffer,z.rasterBoundsSegments),s.needsHillshadePrepare=!1}}function mp(z,s,x,I,k,H){const ee=I.paint.get("raster-fade-duration");if(!H&&ee>0){const ne=R.h.now(),ue=(ne-z.timeAdded)/ee,_e=s?(ne-s.timeAdded)/ee:-1,h=x.getSource(),g=k.coveringZoomLevel({tileSize:h.tileSize,roundZoom:h.roundZoom}),d=!s||Math.abs(s.tileID.overscaledZ-g)>Math.abs(z.tileID.overscaledZ-g),b=d&&z.refreshedUponExpiration?1:R.ad(d?ue:1-_e,0,1);return z.refreshedUponExpiration&&ue>=1&&(z.refreshedUponExpiration=!1),s?{opacity:1,mix:1-b}:{opacity:b,mix:0}}return{opacity:1,mix:0}}const Kh=new R.aT(1,0,0,1),Zc=new R.aT(0,1,0,1),vf=new R.aT(0,0,1,1),Bh=new R.aT(1,0,1,1),_u=new R.aT(0,1,1,1);function Vc(z,s,x,I){Fh(z,0,s+x/2,z.transform.width,x,I)}function Yp(z,s,x,I){Fh(z,s-x/2,0,x,z.transform.height,I)}function Fh(z,s,x,I,k,H){const ee=z.context,ne=ee.gl;ne.enable(ne.SCISSOR_TEST),ne.scissor(s*z.pixelRatio,x*z.pixelRatio,I*z.pixelRatio,k*z.pixelRatio),ee.clear({color:H}),ne.disable(ne.SCISSOR_TEST)}function Ll(z,s,x){const I=z.context,k=I.gl,H=x.posMatrix,ee=z.useProgram("debug"),ne=Na.disabled,ue=Is.disabled,_e=z.colorModeForRenderPass(),h="$debug",g=z.style.map.terrain&&z.style.map.terrain.getTerrainData(x);I.activeTexture.set(k.TEXTURE0);const d=s.getTileByID(x.key).latestRawTileData,b=Math.floor((d&&d.byteLength||0)/1024),B=s.getTile(x).tileSize,G=512/Math.min(B,512)*(x.overscaledZ/z.transform.zoom)*.5;let q=x.canonical.toString();x.overscaledZ!==x.canonical.z&&(q+=` => ${x.overscaledZ}`),function(te,fe){te.initDebugOverlayCanvas();const ce=te.debugOverlayCanvas,Te=te.context.gl,Ie=te.debugOverlayCanvas.getContext("2d");Ie.clearRect(0,0,ce.width,ce.height),Ie.shadowColor="white",Ie.shadowBlur=2,Ie.lineWidth=1.5,Ie.strokeStyle="white",Ie.textBaseline="top",Ie.font="bold 36px Open Sans, sans-serif",Ie.fillText(fe,5,5),Ie.strokeText(fe,5,5),te.debugOverlayTexture.update(ce),te.debugOverlayTexture.bind(Te.LINEAR,Te.CLAMP_TO_EDGE)}(z,`${q} ${b}kB`),ee.draw(I,k.TRIANGLES,ne,ue,Hs.alphaBlended,ys.disabled,Wl(H,R.aT.transparent,G),null,h,z.debugBuffer,z.quadTriangleIndexBuffer,z.debugSegments),ee.draw(I,k.LINE_STRIP,ne,ue,_e,ys.disabled,Wl(H,R.aT.red),g,h,z.debugBuffer,z.tileBorderIndexBuffer,z.debugSegments)}function Fs(z,s,x){const I=z.context,k=I.gl,H=z.colorModeForRenderPass(),ee=new Na(k.LEQUAL,Na.ReadWrite,z.depthRangeFor3D),ne=z.useProgram("terrain"),ue=s.getTerrainMesh();I.bindFramebuffer.set(null),I.viewport.set([0,0,z.width,z.height]);for(const _e of x){const h=z.renderToTexture.getTexture(_e),g=s.getTerrainData(_e.tileID);I.activeTexture.set(k.TEXTURE0),k.bindTexture(k.TEXTURE_2D,h.texture);const d={u_matrix:z.transform.calculatePosMatrix(_e.tileID.toUnwrapped()),u_texture:0,u_ele_delta:s.getMeshFrameDelta(z.transform.zoom)};ne.draw(I,k.TRIANGLES,ee,Is.disabled,H,ys.backCCW,d,g,"terrain",ue.vertexBuffer,ue.indexBuffer,ue.segments)}}class Tc{constructor(s,x){this.context=new Ep(s),this.transform=x,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:R.Z(),renderTime:0},this.setup(),this.numSublayers=ls.maxUnderzooming+ls.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new $o}resize(s,x,I){if(this.width=Math.floor(s*I),this.height=Math.floor(x*I),this.pixelRatio=I,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const k of this.style._order)this.style._layers[k].resize()}setup(){const s=this.context,x=new R.a_;x.emplaceBack(0,0),x.emplaceBack(R.N,0),x.emplaceBack(0,R.N),x.emplaceBack(R.N,R.N),this.tileExtentBuffer=s.createVertexBuffer(x,sc.members),this.tileExtentSegments=R.S.simpleSegment(0,0,4,2);const I=new R.a_;I.emplaceBack(0,0),I.emplaceBack(R.N,0),I.emplaceBack(0,R.N),I.emplaceBack(R.N,R.N),this.debugBuffer=s.createVertexBuffer(I,sc.members),this.debugSegments=R.S.simpleSegment(0,0,4,5);const k=new R.V;k.emplaceBack(0,0,0,0),k.emplaceBack(R.N,0,R.N,0),k.emplaceBack(0,R.N,0,R.N),k.emplaceBack(R.N,R.N,R.N,R.N),this.rasterBoundsBuffer=s.createVertexBuffer(k,vi.members),this.rasterBoundsSegments=R.S.simpleSegment(0,0,4,2);const H=new R.a_;H.emplaceBack(0,0),H.emplaceBack(1,0),H.emplaceBack(0,1),H.emplaceBack(1,1),this.viewportBuffer=s.createVertexBuffer(H,sc.members),this.viewportSegments=R.S.simpleSegment(0,0,4,2);const ee=new R.a$;ee.emplaceBack(0),ee.emplaceBack(1),ee.emplaceBack(3),ee.emplaceBack(2),ee.emplaceBack(0),this.tileBorderIndexBuffer=s.createIndexBuffer(ee);const ne=new R.b0;ne.emplaceBack(0,1,2),ne.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=s.createIndexBuffer(ne);const ue=this.context.gl;this.stencilClearMode=new Is({func:ue.ALWAYS,mask:0},0,255,ue.ZERO,ue.ZERO,ue.ZERO)}clearStencil(){const s=this.context,x=s.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const I=R.Z();R.aS(I,0,this.width,this.height,0,0,1),R.a0(I,I,[x.drawingBufferWidth,x.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(s,x.TRIANGLES,Na.disabled,this.stencilClearMode,Hs.disabled,ys.disabled,ut(I),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(s,x){if(this.currentStencilSource===s.source||!s.isTileClipped()||!x||!x.length)return;this.currentStencilSource=s.source;const I=this.context,k=I.gl;this.nextStencilID+x.length>256&&this.clearStencil(),I.setColorMode(Hs.disabled),I.setDepthMode(Na.disabled);const H=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const ee of x){const ne=this._tileClippingMaskIDs[ee.key]=this.nextStencilID++,ue=this.style.map.terrain&&this.style.map.terrain.getTerrainData(ee);H.draw(I,k.TRIANGLES,Na.disabled,new Is({func:k.ALWAYS,mask:0},ne,255,k.KEEP,k.KEEP,k.REPLACE),Hs.disabled,ys.disabled,ut(ee.posMatrix),ue,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const s=this.nextStencilID++,x=this.context.gl;return new Is({func:x.NOTEQUAL,mask:255},s,255,x.KEEP,x.KEEP,x.REPLACE)}stencilModeForClipping(s){const x=this.context.gl;return new Is({func:x.EQUAL,mask:255},this._tileClippingMaskIDs[s.key],0,x.KEEP,x.KEEP,x.REPLACE)}stencilConfigForOverlap(s){const x=this.context.gl,I=s.sort((ee,ne)=>ne.overscaledZ-ee.overscaledZ),k=I[I.length-1].overscaledZ,H=I[0].overscaledZ-k+1;if(H>1){this.currentStencilSource=void 0,this.nextStencilID+H>256&&this.clearStencil();const ee={};for(let ne=0;ne=0;this.currentLayer--){const ue=this.style._layers[I[this.currentLayer]],_e=k[ue.source],h=H[ue.source];this._renderTileClippingMasks(ue,h),this.renderLayer(this,_e,ue,h)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerq.source&&!q.isHidden(h)?[_e.sourceCaches[q.source]]:[]),b=d.filter(q=>q.getSource().type==="vector"),B=d.filter(q=>q.getSource().type!=="vector"),G=q=>{(!g||g.getSource().maxzoomG(q)),g||B.forEach(q=>G(q)),g}(this.style,this.transform.zoom);ue&&function(_e,h,g){for(let d=0;db.style.map.terrain.getElevation(Oe,pr,tr):null)}}}(ue,H,ne,ee,ne.layout.get("text-rotation-alignment"),ne.layout.get("text-pitch-alignment"),_e),ne.paint.get("icon-opacity").constantOr(1)!==0&&Sc(H,ee,ne,ue,!1,ne.paint.get("icon-translate"),ne.paint.get("icon-translate-anchor"),ne.layout.get("icon-rotation-alignment"),ne.layout.get("icon-pitch-alignment"),ne.layout.get("icon-keep-upright"),h,g),ne.paint.get("text-opacity").constantOr(1)!==0&&Sc(H,ee,ne,ue,!0,ne.paint.get("text-translate"),ne.paint.get("text-translate-anchor"),ne.layout.get("text-rotation-alignment"),ne.layout.get("text-pitch-alignment"),ne.layout.get("text-keep-upright"),h,g),ee.map.showCollisionBoxes&&(Bf(H,ee,ne,ue,ne.paint.get("text-translate"),ne.paint.get("text-translate-anchor"),!0),Bf(H,ee,ne,ue,ne.paint.get("icon-translate"),ne.paint.get("icon-translate-anchor"),!1))})(s,x,I,k,this.style.placement.variableOffsets);break;case"circle":(function(H,ee,ne,ue){if(H.renderPass!=="translucent")return;const _e=ne.paint.get("circle-opacity"),h=ne.paint.get("circle-stroke-width"),g=ne.paint.get("circle-stroke-opacity"),d=!ne.layout.get("circle-sort-key").isConstant();if(_e.constantOr(1)===0&&(h.constantOr(1)===0||g.constantOr(1)===0))return;const b=H.context,B=b.gl,G=H.depthModeForSublayer(0,Na.ReadOnly),q=Is.disabled,te=H.colorModeForRenderPass(),fe=[];for(let ce=0;cece.sortKey-Te.sortKey);for(const ce of fe){const{programConfiguration:Te,program:Ie,layoutVertexBuffer:Oe,indexBuffer:Qe,uniformValues:nt,terrainData:ct}=ce.state;Ie.draw(b,B.TRIANGLES,G,q,te,ys.disabled,nt,ct,ne.id,Oe,Qe,ce.segments,ne.paint,H.transform.zoom,Te)}})(s,x,I,k);break;case"heatmap":(function(H,ee,ne,ue){if(ne.paint.get("heatmap-opacity")!==0)if(H.renderPass==="offscreen"){const _e=H.context,h=_e.gl,g=Is.disabled,d=new Hs([h.ONE,h.ONE],R.aT.transparent,[!0,!0,!0,!0]);(function(b,B,G){const q=b.gl;b.activeTexture.set(q.TEXTURE1),b.viewport.set([0,0,B.width/4,B.height/4]);let te=G.heatmapFbo;if(te)q.bindTexture(q.TEXTURE_2D,te.colorAttachment.get()),b.bindFramebuffer.set(te.framebuffer);else{const fe=q.createTexture();q.bindTexture(q.TEXTURE_2D,fe),q.texParameteri(q.TEXTURE_2D,q.TEXTURE_WRAP_S,q.CLAMP_TO_EDGE),q.texParameteri(q.TEXTURE_2D,q.TEXTURE_WRAP_T,q.CLAMP_TO_EDGE),q.texParameteri(q.TEXTURE_2D,q.TEXTURE_MIN_FILTER,q.LINEAR),q.texParameteri(q.TEXTURE_2D,q.TEXTURE_MAG_FILTER,q.LINEAR),te=G.heatmapFbo=b.createFramebuffer(B.width/4,B.height/4,!1,!1),function(ce,Te,Ie,Oe){var Qe,nt;const ct=ce.gl,tt=(Qe=ce.HALF_FLOAT)!==null&&Qe!==void 0?Qe:ct.UNSIGNED_BYTE,Tt=(nt=ce.RGBA16F)!==null&&nt!==void 0?nt:ct.RGBA;ct.texImage2D(ct.TEXTURE_2D,0,Tt,Te.width/4,Te.height/4,0,ct.RGBA,tt,null),Oe.colorAttachment.set(Ie)}(b,B,fe,te)}})(_e,H,ne),_e.clear({color:R.aT.transparent});for(let b=0;b{const ce=R.Z();R.aS(ce,0,G.width,G.height,0,0,1);const Te=G.context.gl;return{u_matrix:ce,u_world:[Te.drawingBufferWidth,Te.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:q.paint.get("heatmap-opacity")}})(_e,h),null,h.id,_e.viewportBuffer,_e.quadTriangleIndexBuffer,_e.viewportSegments,h.paint,_e.transform.zoom)}(H,ne))})(s,x,I,k);break;case"line":(function(H,ee,ne,ue){if(H.renderPass!=="translucent")return;const _e=ne.paint.get("line-opacity"),h=ne.paint.get("line-width");if(_e.constantOr(1)===0||h.constantOr(1)===0)return;const g=H.depthModeForSublayer(0,Na.ReadOnly),d=H.colorModeForRenderPass(),b=ne.paint.get("line-dasharray"),B=ne.paint.get("line-pattern"),G=B.constantOr(1),q=ne.paint.get("line-gradient"),te=ne.getCrossfadeParameters(),fe=G?"linePattern":b?"lineSDF":q?"lineGradient":"line",ce=H.context,Te=ce.gl;let Ie=!0;for(const Oe of ue){const Qe=ee.getTile(Oe);if(G&&!Qe.patternsLoaded())continue;const nt=Qe.getBucket(ne);if(!nt)continue;const ct=nt.programConfigurations.get(ne.id),tt=H.context.program.get(),Tt=H.useProgram(fe,ct),Ut=Ie||Tt.program!==tt,Nt=H.style.map.terrain&&H.style.map.terrain.getTerrainData(Oe),pr=B.constantOr(null);if(pr&&Qe.imageAtlas){const Hr=Qe.imageAtlas,sn=Hr.patternPositions[pr.to.toString()],nn=Hr.patternPositions[pr.from.toString()];sn&&nn&&ct.setConstantPatternPositions(sn,nn)}const tr=Nt?Oe:null,Dr=G?oo(H,Qe,ne,te,tr):b?Xa(H,Qe,ne,b,te,tr):q?Dn(H,Qe,ne,nt.lineClipsArray.length,tr):jr(H,Qe,ne,tr);if(G)ce.activeTexture.set(Te.TEXTURE0),Qe.imageAtlasTexture.bind(Te.LINEAR,Te.CLAMP_TO_EDGE),ct.updatePaintBuffers(te);else if(b&&(Ut||H.lineAtlas.dirty))ce.activeTexture.set(Te.TEXTURE0),H.lineAtlas.bind(ce);else if(q){const Hr=nt.gradients[ne.id];let sn=Hr.texture;if(ne.gradientVersion!==Hr.version){let nn=256;if(ne.stepInterpolant){const Gn=ee.getSource().maxzoom,di=Oe.canonical.z===Gn?Math.ceil(1<0?x.pop():null}isPatternMissing(s){if(!s)return!1;if(!s.from||!s.to)return!0;const x=this.imageManager.getPattern(s.from.toString()),I=this.imageManager.getPattern(s.to.toString());return!x||!I}useProgram(s,x){this.cache=this.cache||{};const I=s+(x?x.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[I]||(this.cache[I]=new El(this.context,oa[s],x,lc[s],this._showOverdrawInspector,this.style.map.terrain)),this.cache[I]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const s=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(s.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new xr(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:s,drawingBufferHeight:x}=this.context.gl;return this.width!==s||this.height!==x}}class Ru{constructor(s,x){this.points=s,this.planes=x}static fromInvProjectionMatrix(s,x,I){const k=Math.pow(2,I),H=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(ne=>{const ue=1/(ne=R.ag([],ne,s))[3]/x*k;return R.b3(ne,ne,[ue,ue,1/ne[3],ue])}),ee=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(ne=>{const ue=function(d,b){var B=b[0],G=b[1],q=b[2],te=B*B+G*G+q*q;return te>0&&(te=1/Math.sqrt(te)),d[0]=b[0]*te,d[1]=b[1]*te,d[2]=b[2]*te,d}([],function(d,b,B){var G=b[0],q=b[1],te=b[2],fe=B[0],ce=B[1],Te=B[2];return d[0]=q*Te-te*ce,d[1]=te*fe-G*Te,d[2]=G*ce-q*fe,d}([],Kn([],H[ne[0]],H[ne[1]]),Kn([],H[ne[2]],H[ne[1]]))),_e=-((h=ue)[0]*(g=H[ne[1]])[0]+h[1]*g[1]+h[2]*g[2]);var h,g;return ue.concat(_e)});return new Ru(H,ee)}}class jc{constructor(s,x){this.min=s,this.max=x,this.center=function(I,k,H){return I[0]=.5*k[0],I[1]=.5*k[1],I[2]=.5*k[2],I}([],function(I,k,H){return I[0]=k[0]+H[0],I[1]=k[1]+H[1],I[2]=k[2]+H[2],I}([],this.min,this.max))}quadrant(s){const x=[s%2==0,s<2],I=Ar(this.min),k=Ar(this.max);for(let H=0;H=0&&ee++;if(ee===0)return 0;ee!==x.length&&(I=!1)}if(I)return 2;for(let k=0;k<3;k++){let H=Number.MAX_VALUE,ee=-Number.MAX_VALUE;for(let ne=0;nethis.max[k]-this.min[k])return 0}return 1}}class $p{constructor(s=0,x=0,I=0,k=0){if(isNaN(s)||s<0||isNaN(x)||x<0||isNaN(I)||I<0||isNaN(k)||k<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=s,this.bottom=x,this.left=I,this.right=k}interpolate(s,x,I){return x.top!=null&&s.top!=null&&(this.top=R.B.number(s.top,x.top,I)),x.bottom!=null&&s.bottom!=null&&(this.bottom=R.B.number(s.bottom,x.bottom,I)),x.left!=null&&s.left!=null&&(this.left=R.B.number(s.left,x.left,I)),x.right!=null&&s.right!=null&&(this.right=R.B.number(s.right,x.right,I)),this}getCenter(s,x){const I=R.ad((this.left+s-this.right)/2,0,s),k=R.ad((this.top+x-this.bottom)/2,0,x);return new R.P(I,k)}equals(s){return this.top===s.top&&this.bottom===s.bottom&&this.left===s.left&&this.right===s.right}clone(){return new $p(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Jh{constructor(s,x,I,k,H){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=H===void 0||!!H,this._minZoom=s||0,this._maxZoom=x||22,this._minPitch=I==null?0:I,this._maxPitch=k==null?60:k,this.setMaxBounds(),this.width=0,this.height=0,this._center=new R.L(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new $p,this._posMatrixCache={},this._alignedPosMatrixCache={},this._minEleveationForCurrentTile=0}clone(){const s=new Jh(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return s.apply(this),s}apply(s){this.tileSize=s.tileSize,this.latRange=s.latRange,this.width=s.width,this.height=s.height,this._center=s._center,this._elevation=s._elevation,this._minEleveationForCurrentTile=s._minEleveationForCurrentTile,this.zoom=s.zoom,this.angle=s.angle,this._fov=s._fov,this._pitch=s._pitch,this._unmodified=s._unmodified,this._edgeInsets=s._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(s){this._minZoom!==s&&(this._minZoom=s,this.zoom=Math.max(this.zoom,s))}get maxZoom(){return this._maxZoom}set maxZoom(s){this._maxZoom!==s&&(this._maxZoom=s,this.zoom=Math.min(this.zoom,s))}get minPitch(){return this._minPitch}set minPitch(s){this._minPitch!==s&&(this._minPitch=s,this.pitch=Math.max(this.pitch,s))}get maxPitch(){return this._maxPitch}set maxPitch(s){this._maxPitch!==s&&(this._maxPitch=s,this.pitch=Math.min(this.pitch,s))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(s){s===void 0?s=!0:s===null&&(s=!1),this._renderWorldCopies=s}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new R.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(s){const x=-R.b5(s,-180,180)*Math.PI/180;this.angle!==x&&(this._unmodified=!1,this.angle=x,this._calcMatrices(),this.rotationMatrix=function(){var I=new R.A(4);return R.A!=Float32Array&&(I[1]=0,I[2]=0),I[0]=1,I[3]=1,I}(),function(I,k,H){var ee=k[0],ne=k[1],ue=k[2],_e=k[3],h=Math.sin(H),g=Math.cos(H);I[0]=ee*g+ue*h,I[1]=ne*g+_e*h,I[2]=ee*-h+ue*g,I[3]=ne*-h+_e*g}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(s){const x=R.ad(s,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==x&&(this._unmodified=!1,this._pitch=x,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(s){s=Math.max(.01,Math.min(60,s)),this._fov!==s&&(this._unmodified=!1,this._fov=s/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(s){const x=Math.min(Math.max(s,this.minZoom),this.maxZoom);this._zoom!==x&&(this._unmodified=!1,this._zoom=x,this.tileZoom=Math.max(0,Math.floor(x)),this.scale=this.zoomScale(x),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(s){s.lat===this._center.lat&&s.lng===this._center.lng||(this._unmodified=!1,this._center=s,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(s){s!==this._elevation&&(this._elevation=s,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(s){this._edgeInsets.equals(s)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,s,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(s){return this._edgeInsets.equals(s)}interpolatePadding(s,x,I){this._unmodified=!1,this._edgeInsets.interpolate(s,x,I),this._constrain(),this._calcMatrices()}coveringZoomLevel(s){const x=(s.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/s.tileSize));return Math.max(0,x)}getVisibleUnwrappedCoordinates(s){const x=[new R.b6(0,s)];if(this._renderWorldCopies){const I=this.pointCoordinate(new R.P(0,0)),k=this.pointCoordinate(new R.P(this.width,0)),H=this.pointCoordinate(new R.P(this.width,this.height)),ee=this.pointCoordinate(new R.P(0,this.height)),ne=Math.floor(Math.min(I.x,k.x,H.x,ee.x)),ue=Math.floor(Math.max(I.x,k.x,H.x,ee.x)),_e=1;for(let h=ne-_e;h<=ue+_e;h++)h!==0&&x.push(new R.b6(h,s))}return x}coveringTiles(s){var x,I;let k=this.coveringZoomLevel(s);const H=k;if(s.minzoom!==void 0&&ks.maxzoom&&(k=s.maxzoom);const ee=this.pointCoordinate(this.getCameraPoint()),ne=R.U.fromLngLat(this.center),ue=Math.pow(2,k),_e=[ue*ee.x,ue*ee.y,0],h=[ue*ne.x,ue*ne.y,0],g=Ru.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,k);let d=s.minzoom||0;!s.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(d=k);const b=s.terrain?2/Math.min(this.tileSize,s.tileSize)*this.tileSize:3,B=ce=>({aabb:new jc([ce*ue,0,0],[(ce+1)*ue,ue,0]),zoom:0,x:0,y:0,wrap:ce,fullyVisible:!1}),G=[],q=[],te=k,fe=s.reparseOverscaled?H:k;if(this._renderWorldCopies)for(let ce=1;ce<=3;ce++)G.push(B(-ce)),G.push(B(ce));for(G.push(B(0));G.length>0;){const ce=G.pop(),Te=ce.x,Ie=ce.y;let Oe=ce.fullyVisible;if(!Oe){const Tt=ce.aabb.intersects(g);if(Tt===0)continue;Oe=Tt===2}const Qe=s.terrain?_e:h,nt=ce.aabb.distanceX(Qe),ct=ce.aabb.distanceY(Qe),tt=Math.max(Math.abs(nt),Math.abs(ct));if(ce.zoom===te||tt>b+(1<=d){const Tt=te-ce.zoom,Ut=_e[0]-.5-(Te<>1),pr=ce.zoom+1;let tr=ce.aabb.quadrant(Tt);if(s.terrain){const Dr=new R.O(pr,ce.wrap,pr,Ut,Nt),Hr=s.terrain.getMinMaxElevation(Dr),sn=(x=Hr.minElevation)!==null&&x!==void 0?x:this.elevation,nn=(I=Hr.maxElevation)!==null&&I!==void 0?I:this.elevation;tr=new jc([tr.min[0],tr.min[1],sn],[tr.max[0],tr.max[1],nn])}G.push({aabb:tr,zoom:pr,x:Ut,y:Nt,wrap:ce.wrap,fullyVisible:Oe})}}return q.sort((ce,Te)=>ce.distanceSq-Te.distanceSq).map(ce=>ce.tileID)}resize(s,x){this.width=s,this.height=x,this.pixelsToGLUnits=[2/s,-2/x],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(s){return Math.pow(2,s)}scaleZoom(s){return Math.log(s)/Math.LN2}project(s){const x=R.ad(s.lat,-this.maxValidLatitude,this.maxValidLatitude);return new R.P(R.G(s.lng)*this.worldSize,R.H(x)*this.worldSize)}unproject(s){return new R.U(s.x/this.worldSize,s.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(s){const x=this.pointLocation(this.centerPoint,s),I=s.getElevationForLngLatZoom(x,this.tileZoom);if(!(this.elevation-I))return;const k=this.getCameraPosition(),H=R.U.fromLngLat(k.lngLat,k.altitude),ee=R.U.fromLngLat(x,I),ne=H.x-ee.x,ue=H.y-ee.y,_e=H.z-ee.z,h=Math.sqrt(ne*ne+ue*ue+_e*_e),g=this.scaleZoom(this.cameraToCenterDistance/h/this.tileSize);this._elevation=I,this._center=x,this.zoom=g}setLocationAtPoint(s,x){const I=this.pointCoordinate(x),k=this.pointCoordinate(this.centerPoint),H=this.locationCoordinate(s),ee=new R.U(H.x-(I.x-k.x),H.y-(I.y-k.y));this.center=this.coordinateLocation(ee),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(s,x){return x?this.coordinatePoint(this.locationCoordinate(s),x.getElevationForLngLatZoom(s,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(s))}pointLocation(s,x){return this.coordinateLocation(this.pointCoordinate(s,x))}locationCoordinate(s){return R.U.fromLngLat(s)}coordinateLocation(s){return s&&s.toLngLat()}pointCoordinate(s,x){if(x){const d=x.pointCoordinate(s);if(d!=null)return d}const I=[s.x,s.y,0,1],k=[s.x,s.y,1,1];R.ag(I,I,this.pixelMatrixInverse),R.ag(k,k,this.pixelMatrixInverse);const H=I[3],ee=k[3],ne=I[1]/H,ue=k[1]/ee,_e=I[2]/H,h=k[2]/ee,g=_e===h?0:(0-_e)/(h-_e);return new R.U(R.B.number(I[0]/H,k[0]/ee,g)/this.worldSize,R.B.number(ne,ue,g)/this.worldSize)}coordinatePoint(s,x=0,I=this.pixelMatrix){const k=[s.x*this.worldSize,s.y*this.worldSize,x,1];return R.ag(k,k,I),new R.P(k[0]/k[3],k[1]/k[3])}getBounds(){const s=Math.max(0,this.height/2-this.getHorizon());return new wr().extend(this.pointLocation(new R.P(0,s))).extend(this.pointLocation(new R.P(this.width,s))).extend(this.pointLocation(new R.P(this.width,this.height))).extend(this.pointLocation(new R.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new wr([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(s){s?(this.lngRange=[s.getWest(),s.getEast()],this.latRange=[s.getSouth(),s.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(s,x=!1){const I=s.key,k=x?this._alignedPosMatrixCache:this._posMatrixCache;if(k[I])return k[I];const H=s.canonical,ee=this.worldSize/this.zoomScale(H.z),ne=H.x+Math.pow(2,H.z)*s.wrap,ue=R.ao(new Float64Array(16));return R.$(ue,ue,[ne*ee,H.y*ee,0]),R.a0(ue,ue,[ee/R.N,ee/R.N,1]),R.a1(ue,x?this.alignedProjMatrix:this.projMatrix,ue),k[I]=new Float32Array(ue),k[I]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let s,x,I,k,H=-90,ee=90,ne=-180,ue=180;const _e=this.size,h=this._unmodified;if(this.latRange){const b=this.latRange;H=R.H(b[1])*this.worldSize,ee=R.H(b[0])*this.worldSize,s=ee-H<_e.y?_e.y/(ee-H):0}if(this.lngRange){const b=this.lngRange;ne=R.b5(R.G(b[0])*this.worldSize,0,this.worldSize),ue=R.b5(R.G(b[1])*this.worldSize,0,this.worldSize),ueee&&(k=ee-B)}if(this.lngRange){const b=(ne+ue)/2,B=R.b5(g.x,b-this.worldSize/2,b+this.worldSize/2),G=_e.x/2;B-Gue&&(I=ue-G)}I===void 0&&k===void 0||(this.center=this.unproject(new R.P(I!==void 0?I:g.x,k!==void 0?k:g.y)).wrap()),this._unmodified=h,this._constraining=!1}_calcMatrices(){if(!this.height)return;const s=this.centerOffset,x=this.point.x,I=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=R.b7(1,this.center.lat)*this.worldSize;let k=R.ao(new Float64Array(16));R.a0(k,k,[this.width/2,-this.height/2,1]),R.$(k,k,[1,-1,0]),this.labelPlaneMatrix=k,k=R.ao(new Float64Array(16)),R.a0(k,k,[1,-1,1]),R.$(k,k,[-1,-1,0]),R.a0(k,k,[2/this.width,2/this.height,1]),this.glCoordMatrix=k;const H=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),ee=Math.min(this.elevation,this._minEleveationForCurrentTile),ne=H-ee*this._pixelPerMeter/Math.cos(this._pitch),ue=ee<0?ne:H,_e=Math.PI/2+this._pitch,h=this._fov*(.5+s.y/this.height),g=Math.sin(h)*ue/Math.sin(R.ad(Math.PI-_e-h,.01,Math.PI-.01)),d=this.getHorizon(),b=2*Math.atan(d/this.cameraToCenterDistance)*(.5+s.y/(2*d)),B=Math.sin(b)*ue/Math.sin(R.ad(Math.PI-_e-b,.01,Math.PI-.01)),G=Math.min(g,B),q=1.01*(Math.cos(Math.PI/2-this._pitch)*G+ue),te=this.height/50;k=new Float64Array(16),R.b8(k,this._fov,this.width/this.height,te,q),k[8]=2*-s.x/this.width,k[9]=2*s.y/this.height,R.a0(k,k,[1,-1,1]),R.$(k,k,[0,0,-this.cameraToCenterDistance]),R.b9(k,k,this._pitch),R.ae(k,k,this.angle),R.$(k,k,[-x,-I,0]),this.mercatorMatrix=R.a0([],k,[this.worldSize,this.worldSize,this.worldSize]),R.a0(k,k,[1,1,this._pixelPerMeter]),this.pixelMatrix=R.a1(new Float64Array(16),this.labelPlaneMatrix,k),R.$(k,k,[0,0,-this.elevation]),this.projMatrix=k,this.invProjMatrix=R.as([],k),this.pixelMatrix3D=R.a1(new Float64Array(16),this.labelPlaneMatrix,k);const fe=this.width%2/2,ce=this.height%2/2,Te=Math.cos(this.angle),Ie=Math.sin(this.angle),Oe=x-Math.round(x)+Te*fe+Ie*ce,Qe=I-Math.round(I)+Te*ce+Ie*fe,nt=new Float64Array(k);if(R.$(nt,nt,[Oe>.5?Oe-1:Oe,Qe>.5?Qe-1:Qe,0]),this.alignedProjMatrix=nt,k=R.as(new Float64Array(16),this.pixelMatrix),!k)throw new Error("failed to invert matrix");this.pixelMatrixInverse=k,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const s=this.pointCoordinate(new R.P(0,0)),x=[s.x*this.worldSize,s.y*this.worldSize,0,1];return R.ag(x,x,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const s=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new R.P(0,s))}getCameraQueryGeometry(s){const x=this.getCameraPoint();if(s.length===1)return[s[0],x];{let I=x.x,k=x.y,H=x.x,ee=x.y;for(const ne of s)I=Math.min(I,ne.x),k=Math.min(k,ne.y),H=Math.max(H,ne.x),ee=Math.max(ee,ne.y);return[new R.P(I,k),new R.P(H,k),new R.P(H,ee),new R.P(I,ee),new R.P(I,k)]}}}function Ac(z,s){let x,I=!1,k=null,H=null;const ee=()=>{k=null,I&&(z.apply(H,x),k=setTimeout(ee,s),I=!1)};return(...ne)=>(I=!0,H=this,x=ne,k||ee(),k)}class kh{constructor(s){this._getCurrentHash=()=>{const x=window.location.hash.replace("#","");if(this._hashName){let I;return x.split("&").map(k=>k.split("=")).forEach(k=>{k[0]===this._hashName&&(I=k)}),(I&&I[1]||"").split("/")}return x.split("/")},this._onHashChange=()=>{const x=this._getCurrentHash();if(x.length>=3&&!x.some(I=>isNaN(I))){const I=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(x[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+x[2],+x[1]],zoom:+x[0],bearing:I,pitch:+(x[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const x=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,x)}catch(I){}},this._updateHash=Ac(this._updateHashUnthrottled,300),this._hashName=s&&encodeURIComponent(s)}addTo(s){return this._map=s,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(s){const x=this._map.getCenter(),I=Math.round(100*this._map.getZoom())/100,k=Math.ceil((I*Math.LN2+Math.log(512/360/.5))/Math.LN10),H=Math.pow(10,k),ee=Math.round(x.lng*H)/H,ne=Math.round(x.lat*H)/H,ue=this._map.getBearing(),_e=this._map.getPitch();let h="";if(h+=s?`/${ee}/${ne}/${I}`:`${I}/${ne}/${ee}`,(ue||_e)&&(h+="/"+Math.round(10*ue)/10),_e&&(h+=`/${Math.round(_e)}`),this._hashName){const g=this._hashName;let d=!1;const b=window.location.hash.slice(1).split("&").map(B=>{const G=B.split("=")[0];return G===g?(d=!0,`${G}=${h}`):B}).filter(B=>B);return d||b.push(`${g}=${h}`),`#${b.join("&")}`}return`#${h}`}}const Iu={linearity:.3,easing:R.ba(0,0,.3,1)},rh=R.e({deceleration:2500,maxSpeed:1400},Iu),gp=R.e({deceleration:20,maxSpeed:1400},Iu),vp=R.e({deceleration:1e3,maxSpeed:360},Iu),Kp=R.e({deceleration:1e3,maxSpeed:90},Iu);class Hc{constructor(s){this._map=s,this.clear()}clear(){this._inertiaBuffer=[]}record(s){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:R.h.now(),settings:s})}_drainInertiaBuffer(){const s=this._inertiaBuffer,x=R.h.now();for(;s.length>0&&x-s[0].time>160;)s.shift()}_onMoveEnd(s){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const x={zoom:0,bearing:0,pitch:0,pan:new R.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:H}of this._inertiaBuffer)x.zoom+=H.zoomDelta||0,x.bearing+=H.bearingDelta||0,x.pitch+=H.pitchDelta||0,H.panDelta&&x.pan._add(H.panDelta),H.around&&(x.around=H.around),H.pinchAround&&(x.pinchAround=H.pinchAround);const I=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,k={};if(x.pan.mag()){const H=yu(x.pan.mag(),I,R.e({},rh,s||{}));k.offset=x.pan.mult(H.amount/x.pan.mag()),k.center=this._map.transform.center,Eh(k,H)}if(x.zoom){const H=yu(x.zoom,I,gp);k.zoom=this._map.transform.zoom+H.amount,Eh(k,H)}if(x.bearing){const H=yu(x.bearing,I,vp);k.bearing=this._map.transform.bearing+R.ad(H.amount,-179,179),Eh(k,H)}if(x.pitch){const H=yu(x.pitch,I,Kp);k.pitch=this._map.transform.pitch+H.amount,Eh(k,H)}if(k.zoom||k.bearing){const H=x.pinchAround===void 0?x.around:x.pinchAround;k.around=H?this._map.unproject(H):this._map.getCenter()}return this.clear(),R.e(k,{noMoveStart:!0})}}function Eh(z,s){(!z.duration||z.durationx.unproject(ue)),ne=H.reduce((ue,_e,h,g)=>ue.add(_e.div(g.length)),new R.P(0,0));super(s,{points:H,point:ne,lngLats:ee,lngLat:x.unproject(ne),originalEvent:I}),this._defaultPrevented=!1}}class Gc extends R.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(s,x,I){super(s,{originalEvent:I}),this._defaultPrevented=!1}}class ih{constructor(s,x){this._map=s,this._clickTolerance=x.clickTolerance}reset(){delete this._mousedownPos}wheel(s){return this._firePreventable(new Gc(s.type,this._map,s))}mousedown(s,x){return this._mousedownPos=x,this._firePreventable(new Ya(s.type,this._map,s))}mouseup(s){this._map.fire(new Ya(s.type,this._map,s))}click(s,x){this._mousedownPos&&this._mousedownPos.dist(x)>=this._clickTolerance||this._map.fire(new Ya(s.type,this._map,s))}dblclick(s){return this._firePreventable(new Ya(s.type,this._map,s))}mouseover(s){this._map.fire(new Ya(s.type,this._map,s))}mouseout(s){this._map.fire(new Ya(s.type,this._map,s))}touchstart(s){return this._firePreventable(new nh(s.type,this._map,s))}touchmove(s){this._map.fire(new nh(s.type,this._map,s))}touchend(s){this._map.fire(new nh(s.type,this._map,s))}touchcancel(s){this._map.fire(new nh(s.type,this._map,s))}_firePreventable(s){if(this._map.fire(s),s.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Sa{constructor(s){this._map=s}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(s){this._map.fire(new Ya(s.type,this._map,s))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ya("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(s){this._delayContextMenu?this._contextMenuEvent=s:this._ignoreContextMenu||this._map.fire(new Ya(s.type,this._map,s)),this._map.listens("contextmenu")&&s.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class cs{constructor(s){this._map=s}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(s){return this.transform.pointLocation(R.P.convert(s),this._map.terrain)}}class ku{constructor(s,x){this._map=s,this._tr=new cs(s),this._el=s.getCanvasContainer(),this._container=s.getContainer(),this._clickTolerance=x.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(s,x){this.isEnabled()&&s.shiftKey&&s.button===0&&(be.disableDrag(),this._startPos=this._lastPos=x,this._active=!0)}mousemoveWindow(s,x){if(!this._active)return;const I=x;if(this._lastPos.equals(I)||!this._box&&I.dist(this._startPos)H.fitScreenCoordinates(I,k,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",s)}keydown(s){this._active&&s.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",s))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(be.remove(this._box),this._box=null),be.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(s,x){return this._map.fire(new R.k(s,{originalEvent:x}))}}function rc(z,s){if(z.length!==s.length)throw new Error(`The number of touches and points are not equal - touches ${z.length}, points ${s.length}`);const x={};for(let I=0;Ithis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=s.timeStamp),I.length===this.numTouches&&(this.centroid=function(k){const H=new R.P(0,0);for(const ee of k)H._add(ee);return H.div(k.length)}(x),this.touches=rc(I,x)))}touchmove(s,x,I){if(this.aborted||!this.centroid)return;const k=rc(I,x);for(const H in this.touches){const ee=k[H];(!ee||ee.dist(this.touches[H])>30)&&(this.aborted=!0)}}touchend(s,x,I){if((!this.centroid||s.timeStamp-this.startTime>500)&&(this.aborted=!0),I.length===0){const k=!this.aborted&&this.centroid;if(this.reset(),k)return k}}}class oh{constructor(s){this.singleTap=new xu(s),this.numTaps=s.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(s,x,I){this.singleTap.touchstart(s,x,I)}touchmove(s,x,I){this.singleTap.touchmove(s,x,I)}touchend(s,x,I){const k=this.singleTap.touchend(s,x,I);if(k){const H=s.timeStamp-this.lastTime<500,ee=!this.lastTap||this.lastTap.dist(k)<30;if(H&&ee||this.reset(),this.count++,this.lastTime=s.timeStamp,this.lastTap=k,this.count===this.numTaps)return this.reset(),k}}}class Cc{constructor(s){this._tr=new cs(s),this._zoomIn=new oh({numTouches:1,numTaps:2}),this._zoomOut=new oh({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(s,x,I){this._zoomIn.touchstart(s,x,I),this._zoomOut.touchstart(s,x,I)}touchmove(s,x,I){this._zoomIn.touchmove(s,x,I),this._zoomOut.touchmove(s,x,I)}touchend(s,x,I){const k=this._zoomIn.touchend(s,x,I),H=this._zoomOut.touchend(s,x,I),ee=this._tr;return k?(this._active=!0,s.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:ne=>ne.easeTo({duration:300,zoom:ee.zoom+1,around:ee.unproject(k)},{originalEvent:s})}):H?(this._active=!0,s.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:ne=>ne.easeTo({duration:300,zoom:ee.zoom-1,around:ee.unproject(H)},{originalEvent:s})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ah{constructor(s){this._enabled=!!s.enable,this._moveStateManager=s.moveStateManager,this._clickTolerance=s.clickTolerance||1,this._moveFunction=s.move,this._activateOnStart=!!s.activateOnStart,s.assignEvents(this),this.reset()}reset(s){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(s)}_move(...s){const x=this._moveFunction(...s);if(x.bearingDelta||x.pitchDelta||x.around||x.panDelta)return this._active=!0,x}dragStart(s,x){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(s)&&(this._moveStateManager.startMove(s),this._lastPoint=x.length?x[0]:x,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(s,x){if(!this.isEnabled())return;const I=this._lastPoint;if(!I)return;if(s.preventDefault(),!this._moveStateManager.isValidMoveEvent(s))return void this.reset(s);const k=x.length?x[0]:x;return!this._moved&&k.dist(I){z.mousedown=z.dragStart,z.mousemoveWindow=z.dragMove,z.mouseup=z.dragEnd,z.contextmenu=function(s){s.preventDefault()}},Wc=({enable:z,clickTolerance:s,bearingDegreesPerPixelMoved:x=.8})=>{const I=new sh({checkCorrectEvent:k=>be.mouseButton(k)===0&&k.ctrlKey||be.mouseButton(k)===2});return new ah({clickTolerance:s,move:(k,H)=>({bearingDelta:(H.x-k.x)*x}),moveStateManager:I,enable:z,assignEvents:ll})},vl=({enable:z,clickTolerance:s,pitchDegreesPerPixelMoved:x=-.5})=>{const I=new sh({checkCorrectEvent:k=>be.mouseButton(k)===0&&k.ctrlKey||be.mouseButton(k)===2});return new ah({clickTolerance:s,move:(k,H)=>({pitchDelta:(H.y-k.y)*x}),moveStateManager:I,enable:z,assignEvents:ll})};class oi{constructor(s,x){this._minTouches=s.cooperativeGestures?2:1,this._clickTolerance=s.clickTolerance||1,this._map=x,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new R.P(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(s,x,I){return this._calculateTransform(s,x,I)}touchmove(s,x,I){if(this._map._cooperativeGestures&&(this._minTouches===2&&I.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(s,!1,I.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(I.length0&&(this._active=!0);const k=rc(I,x),H=new R.P(0,0),ee=new R.P(0,0);let ne=0;for(const _e in k){const h=k[_e],g=this._touches[_e];g&&(H._add(h),ee._add(h.sub(g)),ne++,k[_e]=h)}if(this._touches=k,neMath.abs(z.x)}class mi extends fi{constructor(s){super(),this._map=s}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(s,x,I){super.touchstart(s,x,I),this._currentTouchCount=I.length}_start(s){this._lastPoints=s,ep(s[0].sub(s[1]))&&(this._valid=!1)}_move(s,x,I){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const k=s[0].sub(this._lastPoints[0]),H=s[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(k,H,I.timeStamp),this._valid?(this._lastPoints=s,this._active=!0,{pitchDelta:(k.y+H.y)/2*-.5}):void 0}gestureBeginsVertically(s,x,I){if(this._valid!==void 0)return this._valid;const k=s.mag()>=2,H=x.mag()>=2;if(!k&&!H)return;if(!k||!H)return this._firstMove===void 0&&(this._firstMove=I),I-this._firstMove<100&&void 0;const ee=s.y>0==x.y>0;return ep(s)&&ep(x)&&ee}}const Mc={panStep:100,bearingStep:15,pitchStep:10};class Op{constructor(s){this._tr=new cs(s);const x=Mc;this._panStep=x.panStep,this._bearingStep=x.bearingStep,this._pitchStep=x.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(s){if(s.altKey||s.ctrlKey||s.metaKey)return;let x=0,I=0,k=0,H=0,ee=0;switch(s.keyCode){case 61:case 107:case 171:case 187:x=1;break;case 189:case 109:case 173:x=-1;break;case 37:s.shiftKey?I=-1:(s.preventDefault(),H=-1);break;case 39:s.shiftKey?I=1:(s.preventDefault(),H=1);break;case 38:s.shiftKey?k=1:(s.preventDefault(),ee=-1);break;case 40:s.shiftKey?k=-1:(s.preventDefault(),ee=1);break;default:return}return this._rotationDisabled&&(I=0,k=0),{cameraAnimation:ne=>{const ue=this._tr;ne.easeTo({duration:300,easeId:"keyboardHandler",easing:Jp,zoom:x?Math.round(ue.zoom)+x*(s.shiftKey?2:1):ue.zoom,bearing:ue.bearing+I*this._bearingStep,pitch:ue.pitch+k*this._pitchStep,offset:[-H*this._panStep,-ee*this._panStep],center:ue.center},{originalEvent:s})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Jp(z){return z*(2-z)}const Xc=4.000244140625;class hc{constructor(s,x){this._onTimeout=I=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(I)},this._map=s,this._tr=new cs(s),this._el=s.getCanvasContainer(),this._triggerRenderFrame=x,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(s){this._defaultZoomRate=s}setWheelZoomRate(s){this._wheelZoomRate=s}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(s){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!s&&s.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(s){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!s[this._map._metaKey])return;s.preventDefault()}let x=s.deltaMode===WheelEvent.DOM_DELTA_LINE?40*s.deltaY:s.deltaY;const I=R.h.now(),k=I-(this._lastWheelEventTime||0);this._lastWheelEventTime=I,x!==0&&x%Xc==0?this._type="wheel":x!==0&&Math.abs(x)<4?this._type="trackpad":k>400?(this._type=null,this._lastValue=x,this._timeout=setTimeout(this._onTimeout,40,s)):this._type||(this._type=Math.abs(k*x)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,x+=this._lastValue)),s.shiftKey&&x&&(x/=4),this._type&&(this._lastWheelEvent=s,this._delta-=x,this._active||this._start(s)),s.preventDefault()}_start(s){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const x=be.mousePos(this._el,s),I=this._tr;this._around=R.L.convert(this._aroundCenter?I.center:I.unproject(x)),this._aroundPoint=I.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const s=this._tr.transform;if(this._delta!==0){const ne=this._type==="wheel"&&Math.abs(this._delta)>Xc?this._wheelZoomRate:this._defaultZoomRate;let ue=2/(1+Math.exp(-Math.abs(this._delta*ne)));this._delta<0&&ue!==0&&(ue=1/ue);const _e=typeof this._targetZoom=="number"?s.zoomScale(this._targetZoom):s.scale;this._targetZoom=Math.min(s.maxZoom,Math.max(s.minZoom,s.scaleZoom(_e*ue))),this._type==="wheel"&&(this._startZoom=s.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const x=typeof this._targetZoom=="number"?this._targetZoom:s.zoom,I=this._startZoom,k=this._easing;let H,ee=!1;if(this._type==="wheel"&&I&&k){const ne=Math.min((R.h.now()-this._lastWheelEventTime)/200,1),ue=k(ne);H=R.B.number(I,x,ue),ne<1?this._frameId||(this._frameId=!0):ee=!0}else H=x,ee=!0;return this._active=!0,ee&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ee,zoomDelta:H-s.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(s){let x=R.bb;if(this._prevEase){const I=this._prevEase,k=(R.h.now()-I.start)/I.duration,H=I.easing(k+.01)-I.easing(k),ee=.27/Math.sqrt(H*H+1e-4)*.01,ne=Math.sqrt(.0729-ee*ee);x=R.ba(ee,ne,.25,1)}return this._prevEase={start:R.h.now(),duration:s,easing:x},x}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class wh{constructor(s,x){this._clickZoom=s,this._tapZoom=x}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Pc{constructor(s){this._tr=new cs(s),this.reset()}reset(){this._active=!1}dblclick(s,x){return s.preventDefault(),{cameraAnimation:I=>{I.easeTo({duration:300,zoom:this._tr.zoom+(s.shiftKey?-1:1),around:this._tr.unproject(x)},{originalEvent:s})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Xl{constructor(){this._tap=new oh({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(s,x,I){if(!this._swipePoint)if(this._tapTime){const k=x[0],H=s.timeStamp-this._tapTime<500,ee=this._tapPoint.dist(k)<30;H&&ee?I.length>0&&(this._swipePoint=k,this._swipeTouch=I[0].identifier):this.reset()}else this._tap.touchstart(s,x,I)}touchmove(s,x,I){if(this._tapTime){if(this._swipePoint){if(I[0].identifier!==this._swipeTouch)return;const k=x[0],H=k.y-this._swipePoint.y;return this._swipePoint=k,s.preventDefault(),this._active=!0,{zoomDelta:H/128}}}else this._tap.touchmove(s,x,I)}touchend(s,x,I){if(this._tapTime)this._swipePoint&&I.length===0&&this.reset();else{const k=this._tap.touchend(s,x,I);k&&(this._tapTime=s.timeStamp,this._tapPoint=k)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Rc{constructor(s,x,I){this._el=s,this._mousePan=x,this._touchPan=I}enable(s){this._inertiaOptions=s||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Eu{constructor(s,x,I){this._pitchWithRotate=s.pitchWithRotate,this._mouseRotate=x,this._mousePitch=I}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class lh{constructor(s,x,I,k){this._el=s,this._touchZoom=x,this._touchRotate=I,this._tapDragZoom=k,this._rotationDisabled=!1,this._enabled=!0}enable(s){this._touchZoom.enable(s),this._rotationDisabled||this._touchRotate.enable(s),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const tp=z=>z.zoom||z.drag||z.pitch||z.rotate;class rp extends R.k{}function su(z){return z.panDelta&&z.panDelta.mag()||z.zoomDelta||z.bearingDelta||z.pitchDelta}class ql{constructor(s,x){this.handleWindowEvent=k=>{this.handleEvent(k,`${k.type}Window`)},this.handleEvent=(k,H)=>{if(k.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const ee=k.type==="renderFrame"?void 0:k,ne={needsRenderFrame:!1},ue={},_e={},h=k.touches,g=h?this._getMapTouches(h):void 0,d=g?be.touchPos(this._el,g):be.mousePos(this._el,k);for(const{handlerName:G,handler:q,allowed:te}of this._handlers){if(!q.isEnabled())continue;let fe;this._blockedByActive(_e,te,G)?q.reset():q[H||k.type]&&(fe=q[H||k.type](k,d,g),this.mergeHandlerResult(ne,ue,fe,G,ee),fe&&fe.needsRenderFrame&&this._triggerRenderFrame()),(fe||q.isActive())&&(_e[G]=q)}const b={};for(const G in this._previousActiveHandlers)_e[G]||(b[G]=ee);this._previousActiveHandlers=_e,(Object.keys(b).length||su(ne))&&(this._changes.push([ne,ue,b]),this._triggerRenderFrame()),(Object.keys(_e).length||su(ne))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:B}=ne;B&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],B(this._map))},this._map=s,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Hc(s),this._bearingSnap=x.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(x);const I=this._el;this._listeners=[[I,"touchstart",{passive:!0}],[I,"touchmove",{passive:!1}],[I,"touchend",void 0],[I,"touchcancel",void 0],[I,"mousedown",void 0],[I,"mousemove",void 0],[I,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[I,"mouseover",void 0],[I,"mouseout",void 0],[I,"dblclick",void 0],[I,"click",void 0],[I,"keydown",{capture:!1}],[I,"keyup",void 0],[I,"wheel",{passive:!1}],[I,"contextmenu",void 0],[window,"blur",void 0]];for(const[k,H,ee]of this._listeners)be.addEventListener(k,H,k===document?this.handleWindowEvent:this.handleEvent,ee)}destroy(){for(const[s,x,I]of this._listeners)be.removeEventListener(s,x,s===document?this.handleWindowEvent:this.handleEvent,I)}_addDefaultHandlers(s){const x=this._map,I=x.getCanvasContainer();this._add("mapEvent",new ih(x,s));const k=x.boxZoom=new ku(x,s);this._add("boxZoom",k),s.interactive&&s.boxZoom&&k.enable();const H=new Cc(x),ee=new Pc(x);x.doubleClickZoom=new wh(ee,H),this._add("tapZoom",H),this._add("clickZoom",ee),s.interactive&&s.doubleClickZoom&&x.doubleClickZoom.enable();const ne=new Xl;this._add("tapDragZoom",ne);const ue=x.touchPitch=new mi(x);this._add("touchPitch",ue),s.interactive&&s.touchPitch&&x.touchPitch.enable(s.touchPitch);const _e=Wc(s),h=vl(s);x.dragRotate=new Eu(s,_e,h),this._add("mouseRotate",_e,["mousePitch"]),this._add("mousePitch",h,["mouseRotate"]),s.interactive&&s.dragRotate&&x.dragRotate.enable();const g=(({enable:te,clickTolerance:fe})=>{const ce=new sh({checkCorrectEvent:Te=>be.mouseButton(Te)===0&&!Te.ctrlKey});return new ah({clickTolerance:fe,move:(Te,Ie)=>({around:Ie,panDelta:Ie.sub(Te)}),activateOnStart:!0,moveStateManager:ce,enable:te,assignEvents:ll})})(s),d=new oi(s,x);x.dragPan=new Rc(I,g,d),this._add("mousePan",g),this._add("touchPan",d,["touchZoom","touchRotate"]),s.interactive&&s.dragPan&&x.dragPan.enable(s.dragPan);const b=new is,B=new Dp;x.touchZoomRotate=new lh(I,B,b,ne),this._add("touchRotate",b,["touchPan","touchZoom"]),this._add("touchZoom",B,["touchPan","touchRotate"]),s.interactive&&s.touchZoomRotate&&x.touchZoomRotate.enable(s.touchZoomRotate);const G=x.scrollZoom=new hc(x,()=>this._triggerRenderFrame());this._add("scrollZoom",G,["mousePan"]),s.interactive&&s.scrollZoom&&x.scrollZoom.enable(s.scrollZoom);const q=x.keyboard=new Op(x);this._add("keyboard",q),s.interactive&&s.keyboard&&x.keyboard.enable(),this._add("blockableMapEvent",new Sa(x))}_add(s,x,I){this._handlers.push({handlerName:s,handler:x,allowed:I}),this._handlersById[s]=x}stop(s){if(!this._updatingCamera){for(const{handler:x}of this._handlers)x.reset();this._inertia.clear(),this._fireEvents({},{},s),this._changes=[]}}isActive(){for(const{handler:s}of this._handlers)if(s.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!tp(this._eventsInProgress)||this.isZooming()}_blockedByActive(s,x,I){for(const k in s)if(k!==I&&(!x||x.indexOf(k)<0))return!0;return!1}_getMapTouches(s){const x=[];for(const I of s)this._el.contains(I.target)&&x.push(I);return x}mergeHandlerResult(s,x,I,k,H){if(!I)return;R.e(s,I);const ee={handlerName:k,originalEvent:I.originalEvent||H};I.zoomDelta!==void 0&&(x.zoom=ee),I.panDelta!==void 0&&(x.drag=ee),I.pitchDelta!==void 0&&(x.pitch=ee),I.bearingDelta!==void 0&&(x.rotate=ee)}_applyChanges(){const s={},x={},I={};for(const[k,H,ee]of this._changes)k.panDelta&&(s.panDelta=(s.panDelta||new R.P(0,0))._add(k.panDelta)),k.zoomDelta&&(s.zoomDelta=(s.zoomDelta||0)+k.zoomDelta),k.bearingDelta&&(s.bearingDelta=(s.bearingDelta||0)+k.bearingDelta),k.pitchDelta&&(s.pitchDelta=(s.pitchDelta||0)+k.pitchDelta),k.around!==void 0&&(s.around=k.around),k.pinchAround!==void 0&&(s.pinchAround=k.pinchAround),k.noInertia&&(s.noInertia=k.noInertia),R.e(x,H),R.e(I,ee);this._updateMapTransform(s,x,I),this._changes=[]}_updateMapTransform(s,x,I){const k=this._map,H=k._getTransformForUpdate(),ee=k.terrain;if(!(su(s)||ee&&this._terrainMovement))return this._fireEvents(x,I,!0);let{panDelta:ne,zoomDelta:ue,bearingDelta:_e,pitchDelta:h,around:g,pinchAround:d}=s;d!==void 0&&(g=d),k._stop(!0),g=g||k.transform.centerPoint;const b=H.pointLocation(ne?g.sub(ne):g);_e&&(H.bearing+=_e),h&&(H.pitch+=h),ue&&(H.zoom+=ue),ee?this._terrainMovement||!x.drag&&!x.zoom?x.drag&&this._terrainMovement?H.center=H.pointLocation(H.centerPoint.sub(ne)):H.setLocationAtPoint(b,g):(this._terrainMovement=!0,this._map._elevationFreeze=!0,H.setLocationAtPoint(b,g),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,H.recalculateZoom(k.terrain)})):H.setLocationAtPoint(b,g),k._applyUpdatedTransform(H),this._map._update(),s.noInertia||this._inertia.record(s),this._fireEvents(x,I,!0)}_fireEvents(s,x,I){const k=tp(this._eventsInProgress),H=tp(s),ee={};for(const h in s){const{originalEvent:g}=s[h];this._eventsInProgress[h]||(ee[`${h}start`]=g),this._eventsInProgress[h]=s[h]}!k&&H&&this._fireEvent("movestart",H.originalEvent);for(const h in ee)this._fireEvent(h,ee[h]);H&&this._fireEvent("move",H.originalEvent);for(const h in s){const{originalEvent:g}=s[h];this._fireEvent(h,g)}const ne={};let ue;for(const h in this._eventsInProgress){const{handlerName:g,originalEvent:d}=this._eventsInProgress[h];this._handlersById[g].isActive()||(delete this._eventsInProgress[h],ue=x[g]||d,ne[`${h}end`]=ue)}for(const h in ne)this._fireEvent(h,ne[h]);const _e=tp(this._eventsInProgress);if(I&&(k||H)&&!_e){this._updatingCamera=!0;const h=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),g=d=>d!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new rp("renderFrame",{timeStamp:s})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class fa extends R.E{constructor(s,x){super(),this._renderFrameCallback=()=>{const I=Math.min((R.h.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(I)),I<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=s,this._bearingSnap=x.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new R.L(this.transform.center.lng,this.transform.center.lat)}setCenter(s,x){return this.jumpTo({center:s},x)}panBy(s,x,I){return s=R.P.convert(s).mult(-1),this.panTo(this.transform.center,R.e({offset:s},x),I)}panTo(s,x,I){return this.easeTo(R.e({center:s},x),I)}getZoom(){return this.transform.zoom}setZoom(s,x){return this.jumpTo({zoom:s},x),this}zoomTo(s,x,I){return this.easeTo(R.e({zoom:s},x),I)}zoomIn(s,x){return this.zoomTo(this.getZoom()+1,s,x),this}zoomOut(s,x){return this.zoomTo(this.getZoom()-1,s,x),this}getBearing(){return this.transform.bearing}setBearing(s,x){return this.jumpTo({bearing:s},x),this}getPadding(){return this.transform.padding}setPadding(s,x){return this.jumpTo({padding:s},x),this}rotateTo(s,x,I){return this.easeTo(R.e({bearing:s},x),I)}resetNorth(s,x){return this.rotateTo(0,R.e({duration:1e3},s),x),this}resetNorthPitch(s,x){return this.easeTo(R.e({bearing:0,pitch:0,duration:1e3},s),x),this}snapToNorth(s,x){return Math.abs(this.getBearing()){if(this._zooming&&(I.zoom=R.B.number(k,ue,Oe)),this._rotating&&(I.bearing=R.B.number(H,_e,Oe)),this._pitching&&(I.pitch=R.B.number(ee,h,Oe)),this._padding&&(I.interpolatePadding(ne,g,Oe),b=I.centerPoint.add(d)),this.terrain&&!s.freezeElevation&&this._updateElevation(Oe),ce)I.setLocationAtPoint(ce,Te);else{const Qe=I.zoomScale(I.zoom-k),nt=ue>k?Math.min(2,fe):Math.max(.5,fe),ct=Math.pow(nt,1-Oe),tt=I.unproject(q.add(te.mult(Oe*ct)).mult(Qe));I.setLocationAtPoint(I.renderWorldCopies?tt.wrap():tt,b)}this._applyUpdatedTransform(I),this._fireMoveEvents(x)},Oe=>{this.terrain&&this._finalizeElevation(),this._afterEase(x,Oe)},s),this}_prepareEase(s,x,I={}){this._moving=!0,x||I.moving||this.fire(new R.k("movestart",s)),this._zooming&&!I.zooming&&this.fire(new R.k("zoomstart",s)),this._rotating&&!I.rotating&&this.fire(new R.k("rotatestart",s)),this._pitching&&!I.pitching&&this.fire(new R.k("pitchstart",s))}_prepareElevation(s){this._elevationCenter=s,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(s,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(s){this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const x=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(s<1&&x!==this._elevationTarget){const I=this._elevationTarget-this._elevationStart;this._elevationStart+=s*(I-(x-(I*s+this._elevationStart))/(1-s)),this._elevationTarget=x}this.transform.elevation=R.B.number(this._elevationStart,this._elevationTarget,s)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(s){if(!this.transformCameraUpdate)return;const x=s.clone(),{center:I,zoom:k,pitch:H,bearing:ee,elevation:ne}=this.transformCameraUpdate(x);I&&(x.center=I),k!==void 0&&(x.zoom=k),H!==void 0&&(x.pitch=H),ee!==void 0&&(x.bearing=ee),ne!==void 0&&(x.elevation=ne),this.transform.apply(x)}_fireMoveEvents(s){this.fire(new R.k("move",s)),this._zooming&&this.fire(new R.k("zoom",s)),this._rotating&&this.fire(new R.k("rotate",s)),this._pitching&&this.fire(new R.k("pitch",s))}_afterEase(s,x){if(this._easeId&&x&&this._easeId===x)return;delete this._easeId;const I=this._zooming,k=this._rotating,H=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,I&&this.fire(new R.k("zoomend",s)),k&&this.fire(new R.k("rotateend",s)),H&&this.fire(new R.k("pitchend",s)),this.fire(new R.k("moveend",s))}flyTo(s,x){if(!s.essential&&R.h.prefersReducedMotion){const tr=R.F(s,["center","zoom","bearing","pitch","around"]);return this.jumpTo(tr,x)}this.stop(),s=R.e({offset:[0,0],speed:1.2,curve:1.42,easing:R.bb},s);const I=this._getTransformForUpdate(),k=this.getZoom(),H=this.getBearing(),ee=this.getPitch(),ne=this.getPadding(),ue="zoom"in s?R.ad(+s.zoom,I.minZoom,I.maxZoom):k,_e="bearing"in s?this._normalizeBearing(s.bearing,H):H,h="pitch"in s?+s.pitch:ee,g="padding"in s?s.padding:I.padding,d=I.zoomScale(ue-k),b=R.P.convert(s.offset);let B=I.centerPoint.add(b);const G=I.pointLocation(B),q=R.L.convert(s.center||G);this._normalizeCenter(q);const te=I.project(G),fe=I.project(q).sub(te);let ce=s.curve;const Te=Math.max(I.width,I.height),Ie=Te/d,Oe=fe.mag();if("minZoom"in s){const tr=R.ad(Math.min(s.minZoom,k,ue),I.minZoom,I.maxZoom),Dr=Te/I.zoomScale(tr-k);ce=Math.sqrt(Dr/Oe*2)}const Qe=ce*ce;function nt(tr){const Dr=(Ie*Ie-Te*Te+(tr?-1:1)*Qe*Qe*Oe*Oe)/(2*(tr?Ie:Te)*Qe*Oe);return Math.log(Math.sqrt(Dr*Dr+1)-Dr)}function ct(tr){return(Math.exp(tr)-Math.exp(-tr))/2}function tt(tr){return(Math.exp(tr)+Math.exp(-tr))/2}const Tt=nt(!1);let Ut=function(tr){return tt(Tt)/tt(Tt+ce*tr)},Nt=function(tr){return Te*((tt(Tt)*(ct(Dr=Tt+ce*tr)/tt(Dr))-ct(Tt))/Qe)/Oe;var Dr},pr=(nt(!0)-Tt)/ce;if(Math.abs(Oe)<1e-6||!isFinite(pr)){if(Math.abs(Te-Ie)<1e-6)return this.easeTo(s,x);const tr=Ies.maxDuration&&(s.duration=0),this._zooming=!0,this._rotating=H!==_e,this._pitching=h!==ee,this._padding=!I.isPaddingEqual(g),this._prepareEase(x,!1),this.terrain&&this._prepareElevation(q),this._ease(tr=>{const Dr=tr*pr,Hr=1/Ut(Dr);I.zoom=tr===1?ue:k+I.scaleZoom(Hr),this._rotating&&(I.bearing=R.B.number(H,_e,tr)),this._pitching&&(I.pitch=R.B.number(ee,h,tr)),this._padding&&(I.interpolatePadding(ne,g,tr),B=I.centerPoint.add(b)),this.terrain&&!s.freezeElevation&&this._updateElevation(tr);const sn=tr===1?q:I.unproject(te.add(fe.mult(Nt(Dr))).mult(Hr));I.setLocationAtPoint(I.renderWorldCopies?sn.wrap():sn,B),this._applyUpdatedTransform(I),this._fireMoveEvents(x)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(x)},s),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(s,x){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const I=this._onEaseEnd;delete this._onEaseEnd,I.call(this,x)}if(!s){const I=this.handlers;I&&I.stop(!1)}return this}_ease(s,x,I){I.animate===!1||I.duration===0?(s(1),x()):(this._easeStart=R.h.now(),this._easeOptions=I,this._onEaseFrame=s,this._onEaseEnd=x,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(s,x){s=R.b5(s,-180,180);const I=Math.abs(s-x);return Math.abs(s-360-x)180?-360:I<-180?360:0}queryTerrainElevation(s){return this.terrain?this.terrain.getElevationForLngLatZoom(R.L.convert(s),this.transform.tileZoom)-this.transform.elevation:null}}class Rs{constructor(s={}){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=x=>{!x||x.sourceDataType!=="metadata"&&x.sourceDataType!=="visibility"&&x.dataType!=="style"&&x.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=s}getDefaultPosition(){return"bottom-right"}onAdd(s){return this._map=s,this._compact=this.options&&this.options.compact,this._container=be.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=be.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=be.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){be.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(s,x){const I=this._map._getUIString(`AttributionControl.${x}`);s.title=I,s.setAttribute("aria-label",I)}_updateAttributions(){if(!this._map.style)return;let s=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?s=s.concat(this.options.customAttribution.map(k=>typeof k!="string"?"":k)):typeof this.options.customAttribution=="string"&&s.push(this.options.customAttribution)),this._map.style.stylesheet){const k=this._map.style.stylesheet;this.styleOwner=k.owner,this.styleId=k.id}const x=this._map.style.sourceCaches;for(const k in x){const H=x[k];if(H.used||H.usedForTerrain){const ee=H.getSource();ee.attribution&&s.indexOf(ee.attribution)<0&&s.push(ee.attribution)}}s=s.filter(k=>String(k).trim()),s.sort((k,H)=>k.length-H.length),s=s.filter((k,H)=>{for(let ee=H+1;ee=0)return!1;return!0});const I=s.join(" | ");I!==this._attribHTML&&(this._attribHTML=I,s.length?(this._innerContainer.innerHTML=I,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class hs{constructor(s={}){this._updateCompact=()=>{const x=this._container.children;if(x.length){const I=x[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&I.classList.add("maplibregl-compact"):I.classList.remove("maplibregl-compact")}},this.options=s}getDefaultPosition(){return"bottom-left"}onAdd(s){this._map=s,this._compact=this.options&&this.options.compact,this._container=be.create("div","maplibregl-ctrl");const x=be.create("a","maplibregl-ctrl-logo");return x.target="_blank",x.rel="noopener nofollow",x.href="https://maplibre.org/",x.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),x.setAttribute("rel","noopener nofollow"),this._container.appendChild(x),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){be.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class lu{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(s){const x=++this._id;return this._queue.push({callback:s,id:x,cancelled:!1}),x}remove(s){const x=this._currentlyRunning,I=x?this._queue.concat(x):this._queue;for(const k of I)if(k.id===s)return void(k.cancelled=!0)}run(s=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const x=this._currentlyRunning=this._queue;this._queue=[];for(const I of x)if(!I.cancelled&&(I.callback(s),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const wu={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var uh=R.Q([{name:"a_pos3d",type:"Int16",components:3}]);class ch extends R.E{constructor(s){super(),this.sourceCache=s,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,s.usedForTerrain=!0,s.tileSize=this.tileSize*bp(2,this.deltaZoom)}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(s,x){this.sourceCache.update(s,x),this._renderableTilesKeys=[];const I={};for(const k of s.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:x}))I[k.key]=!0,this._renderableTilesKeys.push(k.key),this._tiles[k.key]||(k.posMatrix=new Float64Array(16),R.aS(k.posMatrix,0,R.N,0,R.N,0,1),this._tiles[k.key]=new Pi(k,this.tileSize));for(const k in this._tiles)I[k]||delete this._tiles[k]}freeRtt(s){for(const x in this._tiles){const I=this._tiles[x];(!s||I.tileID.equals(s)||I.tileID.isChildOf(s)||s.isChildOf(I.tileID))&&(I.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(s=>this.getTileByID(s))}getTileByID(s){return this._tiles[s]}getTerrainCoords(s){const x={};for(const I of this._renderableTilesKeys){const k=this._tiles[I].tileID;if(k.canonical.equals(s.canonical)){const H=s.clone();H.posMatrix=new Float64Array(16),R.aS(H.posMatrix,0,R.N,0,R.N,0,1),x[I]=H}else if(k.canonical.isChildOf(s.canonical)){const H=s.clone();H.posMatrix=new Float64Array(16);const ee=k.canonical.z-s.canonical.z,ne=k.canonical.x-(k.canonical.x>>ee<>ee<>ee;R.aS(H.posMatrix,0,_e,0,_e,0,1),R.$(H.posMatrix,H.posMatrix,[-ne*_e,-ue*_e,0]),x[I]=H}else if(s.canonical.isChildOf(k.canonical)){const H=s.clone();H.posMatrix=new Float64Array(16);const ee=s.canonical.z-k.canonical.z,ne=s.canonical.x-(s.canonical.x>>ee<>ee<>ee;R.aS(H.posMatrix,0,R.N,0,R.N,0,1),R.$(H.posMatrix,H.posMatrix,[ne*_e,ue*_e,0]),R.a0(H.posMatrix,H.posMatrix,[1/bp(2,ee),1/bp(2,ee),0]),x[I]=H}}return x}getSourceTile(s,x){const I=this.sourceCache._source;let k=s.overscaledZ-this.deltaZoom;if(k>I.maxzoom&&(k=I.maxzoom),k=I.minzoom&&(!H||!H.dem);)H=this.sourceCache.getTileByID(s.scaledTo(k--).key);return H}tilesAfterTime(s=Date.now()){return Object.values(this._tiles).filter(x=>x.timeAdded>=s)}}class Nu{constructor(s,x,I){this.painter=s,this.sourceCache=new ch(x),this.options=I,this.exaggeration=typeof I.exaggeration=="number"?I.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(s,x,I,k=R.N){var H;if(!(x>=0&&x=0&&Is.canonical.z&&(s.canonical.z>=k?H=s.canonical.z-k:R.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const ee=s.canonical.x-(s.canonical.x>>H<>H<>8<<4|H>>8,x[ee+3]=0;const I=new R.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(x.buffer)),k=new xr(s,I,s.gl.RGBA,{premultiply:!1});return k.bind(s.gl.NEAREST,s.gl.CLAMP_TO_EDGE),this._coordsTexture=k,k}pointCoordinate(s){const x=new Uint8Array(4),I=this.painter.context,k=I.gl;I.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),k.readPixels(s.x,this.painter.height/devicePixelRatio-s.y-1,1,1,k.RGBA,k.UNSIGNED_BYTE,x),I.bindFramebuffer.set(null);const H=x[0]+(x[2]>>4<<8),ee=x[1]+((15&x[2])<<8),ne=this.coordsIndex[255-x[3]],ue=ne&&this.sourceCache.getTileByID(ne);if(!ue)return null;const _e=this._coordsTextureSize,h=(1<0&&Math.sign(H)<0||!I&&Math.sign(k)<0&&Math.sign(H)>0?(k=360*Math.sign(H)+k,R.G(k)):x}}class Qp{constructor(s,x,I){this._context=s,this._size=x,this._tileSize=I,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const s of this._objects)s.texture.destroy(),s.fbo.destroy()}_createObject(s){const x=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),I=new xr(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return I.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),x.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),x.colorAttachment.set(I.texture),{id:s,fbo:x,texture:I,stamp:-1,inUse:!1}}getObjectForId(s){return this._objects[s]}useObject(s){s.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(x=>s.id!==x),this._recentlyUsed.push(s.id)}stampObject(s){s.stamp=++this._stamp}getOrCreateFreeObject(){for(const x of this._recentlyUsed)if(!this._objects[x].inUse)return this._objects[x];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const s=this._createObject(this._objects.length);return this._objects.push(s),s}freeObject(s){s.inUse=!1}freeAllObjects(){for(const s of this._objects)this.freeObject(s)}isFull(){return!(this._objects.length!s.inUse)===!1}}const Gi={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Si{constructor(s,x){this.painter=s,this.terrain=x,this.pool=new Qp(s.context,30,x.sourceCache.tileSize*x.qualityFactor)}destruct(){this.pool.destruct()}getTexture(s){return this.pool.getObjectForId(s.rtt[this._stacks.length-1].id).texture}prepareForRender(s,x){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=s._order.filter(I=>!s._layers[I].isHidden(x)),this._coordsDescendingInv={};for(const I in s.sourceCaches){this._coordsDescendingInv[I]={};const k=s.sourceCaches[I].getVisibleCoordinates();for(const H of k){const ee=this.terrain.sourceCache.getTerrainCoords(H);for(const ne in ee)this._coordsDescendingInv[I][ne]||(this._coordsDescendingInv[I][ne]=[]),this._coordsDescendingInv[I][ne].push(ee[ne])}}this._coordsDescendingInvStr={};for(const I of s._order){const k=s._layers[I],H=k.source;if(Gi[k.type]&&!this._coordsDescendingInvStr[H]){this._coordsDescendingInvStr[H]={};for(const ee in this._coordsDescendingInv[H])this._coordsDescendingInvStr[H][ee]=this._coordsDescendingInv[H][ee].map(ne=>ne.key).sort().join()}}for(const I of this._renderableTiles)for(const k in this._coordsDescendingInvStr){const H=this._coordsDescendingInvStr[k][I.tileID.key];H&&H!==I.rttCoords[k]&&(I.rtt=[])}}renderLayer(s){if(s.isHidden(this.painter.transform.zoom))return!1;const x=s.type,I=this.painter,k=this._renderableLayerIds[this._renderableLayerIds.length-1]===s.id;if(Gi[x]&&(this._prevType&&Gi[this._prevType]||this._stacks.push([]),this._prevType=x,this._stacks[this._stacks.length-1].push(s.id),!k))return!0;if(Gi[this._prevType]||Gi[x]&&k){this._prevType=x;const H=this._stacks.length-1,ee=this._stacks[H]||[];for(const ne of this._renderableTiles){if(this.pool.isFull()&&(Fs(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(ne),ne.rtt[H]){const _e=this.pool.getObjectForId(ne.rtt[H].id);if(_e.stamp===ne.rtt[H].stamp){this.pool.useObject(_e);continue}}const ue=this.pool.getOrCreateFreeObject();this.pool.useObject(ue),this.pool.stampObject(ue),ne.rtt[H]={id:ue.id,stamp:ue.stamp},I.context.bindFramebuffer.set(ue.fbo.framebuffer),I.context.clear({color:R.aT.transparent,stencil:0}),I.currentStencilSource=void 0;for(let _e=0;_e{z.touchstart=z.dragStart,z.touchmoveWindow=z.dragMove,z.touchend=z.dragEnd},Gs={showCompass:!0,showZoom:!0,visualizePitch:!1};class Lc{constructor(s,x,I=!1){this.mousedown=ee=>{this.startMouse(R.e({},ee,{ctrlKey:!0,preventDefault:()=>ee.preventDefault()}),be.mousePos(this.element,ee)),be.addEventListener(window,"mousemove",this.mousemove),be.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=ee=>{this.moveMouse(ee,be.mousePos(this.element,ee))},this.mouseup=ee=>{this.mouseRotate.dragEnd(ee),this.mousePitch&&this.mousePitch.dragEnd(ee),this.offTemp()},this.touchstart=ee=>{ee.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=be.touchPos(this.element,ee.targetTouches)[0],this.startTouch(ee,this._startPos),be.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),be.addEventListener(window,"touchend",this.touchend))},this.touchmove=ee=>{ee.targetTouches.length!==1?this.reset():(this._lastPos=be.touchPos(this.element,ee.targetTouches)[0],this.moveTouch(ee,this._lastPos))},this.touchend=ee=>{ee.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const k=s.dragRotate._mouseRotate.getClickTolerance(),H=s.dragRotate._mousePitch.getClickTolerance();this.element=x,this.mouseRotate=Wc({clickTolerance:k,enable:!0}),this.touchRotate=(({enable:ee,clickTolerance:ne,bearingDegreesPerPixelMoved:ue=.8})=>{const _e=new Ul;return new ah({clickTolerance:ne,move:(h,g)=>({bearingDelta:(g.x-h.x)*ue}),moveStateManager:_e,enable:ee,assignEvents:Ic})})({clickTolerance:k,enable:!0}),this.map=s,I&&(this.mousePitch=vl({clickTolerance:H,enable:!0}),this.touchPitch=(({enable:ee,clickTolerance:ne,pitchDegreesPerPixelMoved:ue=-.5})=>{const _e=new Ul;return new ah({clickTolerance:ne,move:(h,g)=>({pitchDelta:(g.y-h.y)*ue}),moveStateManager:_e,enable:ee,assignEvents:Ic})})({clickTolerance:H,enable:!0})),be.addEventListener(x,"mousedown",this.mousedown),be.addEventListener(x,"touchstart",this.touchstart,{passive:!1}),be.addEventListener(x,"touchcancel",this.reset)}startMouse(s,x){this.mouseRotate.dragStart(s,x),this.mousePitch&&this.mousePitch.dragStart(s,x),be.disableDrag()}startTouch(s,x){this.touchRotate.dragStart(s,x),this.touchPitch&&this.touchPitch.dragStart(s,x),be.disableDrag()}moveMouse(s,x){const I=this.map,{bearingDelta:k}=this.mouseRotate.dragMove(s,x)||{};if(k&&I.setBearing(I.getBearing()+k),this.mousePitch){const{pitchDelta:H}=this.mousePitch.dragMove(s,x)||{};H&&I.setPitch(I.getPitch()+H)}}moveTouch(s,x){const I=this.map,{bearingDelta:k}=this.touchRotate.dragMove(s,x)||{};if(k&&I.setBearing(I.getBearing()+k),this.touchPitch){const{pitchDelta:H}=this.touchPitch.dragMove(s,x)||{};H&&I.setPitch(I.getPitch()+H)}}off(){const s=this.element;be.removeEventListener(s,"mousedown",this.mousedown),be.removeEventListener(s,"touchstart",this.touchstart,{passive:!1}),be.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),be.removeEventListener(window,"touchend",this.touchend),be.removeEventListener(s,"touchcancel",this.reset),this.offTemp()}offTemp(){be.enableDrag(),be.removeEventListener(window,"mousemove",this.mousemove),be.removeEventListener(window,"mouseup",this.mouseup),be.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),be.removeEventListener(window,"touchend",this.touchend)}}let ul;function Nh(z,s,x){if(z=new R.L(z.lng,z.lat),s){const I=new R.L(z.lng-360,z.lat),k=new R.L(z.lng+360,z.lat),H=x.locationPoint(z).distSqr(s);x.locationPoint(I).distSqr(s)180;){const I=x.locationPoint(z);if(I.x>=0&&I.y>=0&&I.x<=x.width&&I.y<=x.height)break;z.lng>x.center.lng?z.lng-=360:z.lng+=360}return z}const xa={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Al(z,s,x){const I=z.classList;for(const k in xa)I.remove(`maplibregl-${x}-anchor-${k}`);I.add(`maplibregl-${x}-anchor-${s}`)}class Lu extends R.E{constructor(s){if(super(),this._onKeyPress=x=>{const I=x.code,k=x.charCode||x.keyCode;I!=="Space"&&I!=="Enter"&&k!==32&&k!==13||this.togglePopup()},this._onMapClick=x=>{const I=x.originalEvent.target,k=this._element;this._popup&&(I===k||k.contains(I))&&this.togglePopup()},this._update=x=>{if(!this._map)return;const I=this._map.loaded()&&!this._map.isMoving();((x==null?void 0:x.type)==="terrain"||(x==null?void 0:x.type)==="render"&&!I)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=Nh(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let k="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?k=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(k=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let H="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?H="rotateX(0deg)":this._pitchAlignment==="map"&&(H=`rotateX(${this._map.getPitch()}deg)`),x&&x.type!=="moveend"||(this._pos=this._pos.round()),be.setTransform(this._element,`${xa[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${H} ${k}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const ee=this._map.unproject(this._pos),ne=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=ee.distanceTo(this._lngLat)>20*ne?"0.2":"1.0",this._opacityTimeout=null},100))},this._onMove=x=>{if(!this._isDragging){const I=this._clickTolerance||this._map._clickTolerance;this._isDragging=x.point.dist(this._pointerdownPos)>=I}this._isDragging&&(this._pos=x.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new R.k("dragstart"))),this.fire(new R.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new R.k("dragend")),this._state="inactive"},this._addDragHandler=x=>{this._element.contains(x.originalEvent.target)&&(x.preventDefault(),this._positionDelta=x.point.sub(this._pos).add(this._offset),this._pointerdownPos=x.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=s&&s.anchor||"center",this._color=s&&s.color||"#3FB1CE",this._scale=s&&s.scale||1,this._draggable=s&&s.draggable||!1,this._clickTolerance=s&&s.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=s&&s.rotation||0,this._rotationAlignment=s&&s.rotationAlignment||"auto",this._pitchAlignment=s&&s.pitchAlignment&&s.pitchAlignment!=="auto"?s.pitchAlignment:this._rotationAlignment,s&&s.element)this._element=s.element,this._offset=R.P.convert(s&&s.offset||[0,0]);else{this._defaultMarker=!0,this._element=be.create("div"),this._element.setAttribute("aria-label","Map marker");const x=be.createNS("http://www.w3.org/2000/svg","svg"),I=41,k=27;x.setAttributeNS(null,"display","block"),x.setAttributeNS(null,"height",`${I}px`),x.setAttributeNS(null,"width",`${k}px`),x.setAttributeNS(null,"viewBox",`0 0 ${k} ${I}`);const H=be.createNS("http://www.w3.org/2000/svg","g");H.setAttributeNS(null,"stroke","none"),H.setAttributeNS(null,"stroke-width","1"),H.setAttributeNS(null,"fill","none"),H.setAttributeNS(null,"fill-rule","evenodd");const ee=be.createNS("http://www.w3.org/2000/svg","g");ee.setAttributeNS(null,"fill-rule","nonzero");const ne=be.createNS("http://www.w3.org/2000/svg","g");ne.setAttributeNS(null,"transform","translate(3.0, 29.0)"),ne.setAttributeNS(null,"fill","#000000");const ue=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const te of ue){const fe=be.createNS("http://www.w3.org/2000/svg","ellipse");fe.setAttributeNS(null,"opacity","0.04"),fe.setAttributeNS(null,"cx","10.5"),fe.setAttributeNS(null,"cy","5.80029008"),fe.setAttributeNS(null,"rx",te.rx),fe.setAttributeNS(null,"ry",te.ry),ne.appendChild(fe)}const _e=be.createNS("http://www.w3.org/2000/svg","g");_e.setAttributeNS(null,"fill",this._color);const h=be.createNS("http://www.w3.org/2000/svg","path");h.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),_e.appendChild(h);const g=be.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"fill","#000000");const d=be.createNS("http://www.w3.org/2000/svg","path");d.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),g.appendChild(d);const b=be.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"transform","translate(6.0, 7.0)"),b.setAttributeNS(null,"fill","#FFFFFF");const B=be.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"transform","translate(8.0, 8.0)");const G=be.createNS("http://www.w3.org/2000/svg","circle");G.setAttributeNS(null,"fill","#000000"),G.setAttributeNS(null,"opacity","0.25"),G.setAttributeNS(null,"cx","5.5"),G.setAttributeNS(null,"cy","5.5"),G.setAttributeNS(null,"r","5.4999962");const q=be.createNS("http://www.w3.org/2000/svg","circle");q.setAttributeNS(null,"fill","#FFFFFF"),q.setAttributeNS(null,"cx","5.5"),q.setAttributeNS(null,"cy","5.5"),q.setAttributeNS(null,"r","5.4999962"),B.appendChild(G),B.appendChild(q),ee.appendChild(ne),ee.appendChild(_e),ee.appendChild(g),ee.appendChild(b),ee.appendChild(B),x.appendChild(ee),x.setAttributeNS(null,"height",I*this._scale+"px"),x.setAttributeNS(null,"width",k*this._scale+"px"),this._element.appendChild(x),this._offset=R.P.convert(s&&s.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",x=>{x.preventDefault()}),this._element.addEventListener("mousedown",x=>{x.preventDefault()}),Al(this._element,this._anchor,"marker"),s&&s.className)for(const x of s.className.split(" "))this._element.classList.add(x);this._popup=null}addTo(s){return this.remove(),this._map=s,s.getCanvasContainer().appendChild(this._element),s.on("move",this._update),s.on("moveend",this._update),s.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),be.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(s){return this._lngLat=R.L.convert(s),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(s){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),s){if(!("offset"in s.options)){const k=Math.abs(13.5)/Math.SQRT2;s.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[k,-1*(38.1-13.5+k)],"bottom-right":[-k,-1*(38.1-13.5+k)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=s,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){const s=this._popup;return s?(s.isOpen()?s.remove():s.addTo(this._map),this):this}getOffset(){return this._offset}setOffset(s){return this._offset=R.P.convert(s),this._update(),this}addClassName(s){this._element.classList.add(s)}removeClassName(s){this._element.classList.remove(s)}toggleClassName(s){return this._element.classList.toggle(s)}setDraggable(s){return this._draggable=!!s,this._map&&(s?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(s){return this._rotation=s||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(s){return this._rotationAlignment=s||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(s){return this._pitchAlignment=s&&s!=="auto"?s:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const ks={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let _l=0,pc=!1;const Du={maxWidth:100,unit:"metric"};function zh(z,s,x){const I=x&&x.maxWidth||100,k=z._container.clientHeight/2,H=z.unproject([0,k]),ee=z.unproject([I,k]),ne=H.distanceTo(ee);if(x&&x.unit==="imperial"){const ue=3.2808*ne;ue>5280?Su(s,I,ue/5280,z._getUIString("ScaleControl.Miles")):Su(s,I,ue,z._getUIString("ScaleControl.Feet"))}else x&&x.unit==="nautical"?Su(s,I,ne/1852,z._getUIString("ScaleControl.NauticalMiles")):ne>=1e3?Su(s,I,ne/1e3,z._getUIString("ScaleControl.Kilometers")):Su(s,I,ne,z._getUIString("ScaleControl.Meters"))}function Su(z,s,x,I){const k=function(H){const ee=Math.pow(10,`${Math.floor(H)}`.length-1);let ne=H/ee;return ne=ne>=10?10:ne>=5?5:ne>=3?3:ne>=2?2:ne>=1?1:function(ue){const _e=Math.pow(10,Math.ceil(-Math.log(ue)/Math.LN10));return Math.round(ue*_e)/_e}(ne),ee*ne}(x);z.style.width=s*(k/x)+"px",z.innerHTML=`${k} ${I}`}const qc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Sh=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function nc(z){if(z){if(typeof z=="number"){const s=Math.round(Math.abs(z)/Math.SQRT2);return{center:new R.P(0,0),top:new R.P(0,z),"top-left":new R.P(s,s),"top-right":new R.P(-s,s),bottom:new R.P(0,-z),"bottom-left":new R.P(s,-s),"bottom-right":new R.P(-s,-s),left:new R.P(z,0),right:new R.P(-z,0)}}if(z instanceof R.P||Array.isArray(z)){const s=R.P.convert(z);return{center:s,top:s,"top-left":s,"top-right":s,bottom:s,"bottom-left":s,"bottom-right":s,left:s,right:s}}return{center:R.P.convert(z.center||[0,0]),top:R.P.convert(z.top||[0,0]),"top-left":R.P.convert(z["top-left"]||[0,0]),"top-right":R.P.convert(z["top-right"]||[0,0]),bottom:R.P.convert(z.bottom||[0,0]),"bottom-left":R.P.convert(z["bottom-left"]||[0,0]),"bottom-right":R.P.convert(z["bottom-right"]||[0,0]),left:R.P.convert(z.left||[0,0]),right:R.P.convert(z.right||[0,0])}}return nc(new R.P(0,0))}const Yl={extend:(z,...s)=>R.e(z,...s),run(z){z()},logToElement(z,s=!1,x="log"){const I=window.document.getElementById(x);I&&(s&&(I.innerHTML=""),I.innerHTML+=`
${z}`)}},Th=de;class ba{static get version(){return Th}static get workerCount(){return at.workerCount}static set workerCount(s){at.workerCount=s}static get maxParallelImageRequests(){return R.c.MAX_PARALLEL_IMAGE_REQUESTS}static set maxParallelImageRequests(s){R.c.MAX_PARALLEL_IMAGE_REQUESTS=s}static get workerUrl(){return R.c.WORKER_URL}static set workerUrl(s){R.c.WORKER_URL=s}static addProtocol(s,x){R.c.REGISTERED_PROTOCOLS[s]=x}static removeProtocol(s){delete R.c.REGISTERED_PROTOCOLS[s]}}return ba.Map=class extends fa{constructor(z){if(R.bg.mark(R.bh.create),(z=R.e({},ao,z)).minZoom!=null&&z.maxZoom!=null&&z.minZoom>z.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(z.minPitch!=null&&z.maxPitch!=null&&z.minPitch>z.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(z.minPitch!=null&&z.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(z.maxPitch!=null&&z.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Jh(z.minZoom,z.maxZoom,z.minPitch,z.maxPitch,z.renderWorldCopies),{bearingSnap:z.bearingSnap}),this._cooperativeGesturesOnWheel=s=>{this._onCooperativeGesture(s,s[this._metaKey],1)},this._contextLost=s=>{s.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new R.k("webglcontextlost",{originalEvent:s}))},this._contextRestored=s=>{this._setupPainter(),this.resize(),this._update(),this.fire(new R.k("webglcontextrestored",{originalEvent:s}))},this._onMapScroll=s=>{if(s.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=z.interactive,this._cooperativeGestures=z.cooperativeGestures,this._metaKey=navigator.platform.indexOf("Mac")===0?"metaKey":"ctrlKey",this._maxTileCacheSize=z.maxTileCacheSize,this._maxTileCacheZoomLevels=z.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=z.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=z.preserveDrawingBuffer,this._antialias=z.antialias,this._trackResize=z.trackResize,this._bearingSnap=z.bearingSnap,this._refreshExpiredTiles=z.refreshExpiredTiles,this._fadeDuration=z.fadeDuration,this._crossSourceCollisions=z.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=z.collectResourceTiming,this._renderTaskQueue=new lu,this._controls=[],this._mapId=R.a2(),this._locale=R.e({},wu,z.locale),this._clickTolerance=z.clickTolerance,this._overridePixelRatio=z.pixelRatio,this._maxCanvasSize=z.maxCanvasSize,this.transformCameraUpdate=z.transformCameraUpdate,this._imageQueueHandle=Ve.addThrottleControl(()=>this.isMoving()),this._requestManager=new er(z.transformRequest),typeof z.container=="string"){if(this._container=document.getElementById(z.container),!this._container)throw new Error(`Container '${z.container}' not found.`)}else{if(!(z.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=z.container}if(z.maxBounds&&this.setMaxBounds(z.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window!="undefined"){addEventListener("online",this._onWindowOnline,!1);let s=!1;const x=Ac(I=>{this._trackResize&&!this._removed&&this.resize(I)._update()},50);this._resizeObserver=new ResizeObserver(I=>{s?x(I):s=!0}),this._resizeObserver.observe(this._container)}this.handlers=new ql(this,z),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=z.hash&&new kh(typeof z.hash=="string"&&z.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:z.center,zoom:z.zoom,bearing:z.bearing,pitch:z.pitch}),z.bounds&&(this.resize(),this.fitBounds(z.bounds,R.e({},z.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=z.localIdeographFontFamily,this._validateStyle=z.validateStyle,z.style&&this.setStyle(z.style,{localIdeographFontFamily:z.localIdeographFontFamily}),z.attributionControl&&this.addControl(new Rs({customAttribution:z.customAttribution})),z.maplibreLogo&&this.addControl(new hs,z.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",s=>{this._update(s.dataType==="style"),this.fire(new R.k(`${s.dataType}data`,s))}),this.on("dataloading",s=>{this.fire(new R.k(`${s.dataType}dataloading`,s))}),this.on("dataabort",s=>{this.fire(new R.k("sourcedataabort",s))})}_getMapId(){return this._mapId}addControl(z,s){if(s===void 0&&(s=z.getDefaultPosition?z.getDefaultPosition():"top-right"),!z||!z.onAdd)return this.fire(new R.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const x=z.onAdd(this);this._controls.push(z);const I=this._controlPositions[s];return s.indexOf("bottom")!==-1?I.insertBefore(x,I.firstChild):I.appendChild(x),this}removeControl(z){if(!z||!z.onRemove)return this.fire(new R.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const s=this._controls.indexOf(z);return s>-1&&this._controls.splice(s,1),z.onRemove(this),this}hasControl(z){return this._controls.indexOf(z)>-1}calculateCameraOptionsFromTo(z,s,x,I){return I==null&&this.terrain&&(I=this.terrain.getElevationForLngLatZoom(x,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(z,s,x,I)}resize(z){var s;const x=this._containerDimensions(),I=x[0],k=x[1],H=this._getClampedPixelRatio(I,k);if(this._resizeCanvas(I,k,H),this.painter.resize(I,k,H),this.painter.overLimit()){const ne=this.painter.context.gl;this._maxCanvasSize=[ne.drawingBufferWidth,ne.drawingBufferHeight];const ue=this._getClampedPixelRatio(I,k);this._resizeCanvas(I,k,ue),this.painter.resize(I,k,ue)}this.transform.resize(I,k),(s=this._requestedCameraState)===null||s===void 0||s.resize(I,k);const ee=!this._moving;return ee&&(this.stop(),this.fire(new R.k("movestart",z)).fire(new R.k("move",z))),this.fire(new R.k("resize",z)),ee&&this.fire(new R.k("moveend",z)),this}_getClampedPixelRatio(z,s){const{0:x,1:I}=this._maxCanvasSize,k=this.getPixelRatio(),H=z*k,ee=s*k;return Math.min(H>x?x/H:1,ee>I?I/ee:1)*k}getPixelRatio(){var z;return(z=this._overridePixelRatio)!==null&&z!==void 0?z:devicePixelRatio}setPixelRatio(z){this._overridePixelRatio=z,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(z){return this.transform.setMaxBounds(wr.convert(z)),this._update()}setMinZoom(z){if((z=z==null?-2:z)>=-2&&z<=this.transform.maxZoom)return this.transform.minZoom=z,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=z,this._update(),this.getZoom()>z&&this.setZoom(z),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(z){if((z=z==null?0:z)<0)throw new Error("minPitch must be greater than or equal to 0");if(z>=0&&z<=this.transform.maxPitch)return this.transform.minPitch=z,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(z>=this.transform.minPitch)return this.transform.maxPitch=z,this._update(),this.getPitch()>z&&this.setPitch(z),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(z){return this.transform.renderWorldCopies=z,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(z){return this._cooperativeGestures=z,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(z){return this.transform.locationPoint(R.L.convert(z),this.style&&this.terrain)}unproject(z){return this.transform.pointLocation(R.P.convert(z),this.terrain)}isMoving(){var z;return this._moving||((z=this.handlers)===null||z===void 0?void 0:z.isMoving())}isZooming(){var z;return this._zooming||((z=this.handlers)===null||z===void 0?void 0:z.isZooming())}isRotating(){var z;return this._rotating||((z=this.handlers)===null||z===void 0?void 0:z.isRotating())}_createDelegatedListener(z,s,x){if(z==="mouseenter"||z==="mouseover"){let I=!1;return{layer:s,listener:x,delegates:{mousemove:H=>{const ee=this.getLayer(s)?this.queryRenderedFeatures(H.point,{layers:[s]}):[];ee.length?I||(I=!0,x.call(this,new Ya(z,this,H.originalEvent,{features:ee}))):I=!1},mouseout:()=>{I=!1}}}}if(z==="mouseleave"||z==="mouseout"){let I=!1;return{layer:s,listener:x,delegates:{mousemove:ee=>{(this.getLayer(s)?this.queryRenderedFeatures(ee.point,{layers:[s]}):[]).length?I=!0:I&&(I=!1,x.call(this,new Ya(z,this,ee.originalEvent)))},mouseout:ee=>{I&&(I=!1,x.call(this,new Ya(z,this,ee.originalEvent)))}}}}{const I=k=>{const H=this.getLayer(s)?this.queryRenderedFeatures(k.point,{layers:[s]}):[];H.length&&(k.features=H,x.call(this,k),delete k.features)};return{layer:s,listener:x,delegates:{[z]:I}}}}on(z,s,x){if(x===void 0)return super.on(z,s);const I=this._createDelegatedListener(z,s,x);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[z]=this._delegatedListeners[z]||[],this._delegatedListeners[z].push(I);for(const k in I.delegates)this.on(k,I.delegates[k]);return this}once(z,s,x){if(x===void 0)return super.once(z,s);const I=this._createDelegatedListener(z,s,x);for(const k in I.delegates)this.once(k,I.delegates[k]);return this}off(z,s,x){return x===void 0?super.off(z,s):(this._delegatedListeners&&this._delegatedListeners[z]&&(I=>{const k=this._delegatedListeners[z];for(let H=0;Hthis._updateStyle(z,s));const x=this.style&&s.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!z)),z?(this.style=new Fa(this,s||{}),this.style.setEventedParent(this,{style:this.style}),typeof z=="string"?this.style.loadURL(z,s,x):this.style.loadJSON(z,s,x),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Fa(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(z,s){if(typeof z=="string"){const x=this._requestManager.transformRequest(z,et.Style);R.f(x,(I,k)=>{I?this.fire(new R.j(I)):k&&this._updateDiff(k,s)})}else typeof z=="object"&&this._updateDiff(z,s)}_updateDiff(z,s){try{this.style.setState(z,s)&&this._update(!0)}catch(x){R.w(`Unable to perform style diff: ${x.message||x.error||x}. Rebuilding the style from scratch.`),this._updateStyle(z,s)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():R.w("There is no style added to the map.")}addSource(z,s){return this._lazyInitEmptyStyle(),this.style.addSource(z,s),this._update(!0)}isSourceLoaded(z){const s=this.style&&this.style.sourceCaches[z];if(s!==void 0)return s.loaded();this.fire(new R.j(new Error(`There is no source with ID '${z}'`)))}setTerrain(z){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),z){const s=this.style.sourceCaches[z.source];if(!s)throw new Error(`cannot load terrain, because there exists no source with ID: ${z.source}`);for(const x in this.style._layers){const I=this.style._layers[x];I.type==="hillshade"&&I.source===z.source&&R.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Nu(this.painter,s,z),this.painter.renderToTexture=new Si(this.painter,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=x=>{x.dataType==="style"?this.terrain.sourceCache.freeRtt():x.dataType==="source"&&x.tile&&(x.sourceId!==z.source||this._elevationFreeze||(this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(x.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0;return this.fire(new R.k("terrain",{terrain:z})),this}getTerrain(){var z,s;return(s=(z=this.terrain)===null||z===void 0?void 0:z.options)!==null&&s!==void 0?s:null}areTilesLoaded(){const z=this.style&&this.style.sourceCaches;for(const s in z){const x=z[s]._tiles;for(const I in x){const k=x[I];if(k.state!=="loaded"&&k.state!=="errored")return!1}}return!0}addSourceType(z,s,x){return this._lazyInitEmptyStyle(),this.style.addSourceType(z,s,x)}removeSource(z){return this.style.removeSource(z),this._update(!0)}getSource(z){return this.style.getSource(z)}addImage(z,s,x={}){const{pixelRatio:I=1,sdf:k=!1,stretchX:H,stretchY:ee,content:ne}=x;if(this._lazyInitEmptyStyle(),!(s instanceof HTMLImageElement||R.a(s))){if(s.width===void 0||s.height===void 0)return this.fire(new R.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:ue,height:_e,data:h}=s,g=s;return this.style.addImage(z,{data:new R.R({width:ue,height:_e},new Uint8Array(h)),pixelRatio:I,stretchX:H,stretchY:ee,content:ne,sdf:k,version:0,userImage:g}),g.onAdd&&g.onAdd(this,z),this}}{const{width:ue,height:_e,data:h}=R.h.getImageData(s);this.style.addImage(z,{data:new R.R({width:ue,height:_e},h),pixelRatio:I,stretchX:H,stretchY:ee,content:ne,sdf:k,version:0})}}updateImage(z,s){const x=this.style.getImage(z);if(!x)return this.fire(new R.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const I=s instanceof HTMLImageElement||R.a(s)?R.h.getImageData(s):s,{width:k,height:H,data:ee}=I;if(k===void 0||H===void 0)return this.fire(new R.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(k!==x.data.width||H!==x.data.height)return this.fire(new R.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const ne=!(s instanceof HTMLImageElement||R.a(s));return x.data.replace(ee,ne),this.style.updateImage(z,x),this}getImage(z){return this.style.getImage(z)}hasImage(z){return z?!!this.style.getImage(z):(this.fire(new R.j(new Error("Missing required image id"))),!1)}removeImage(z){this.style.removeImage(z)}loadImage(z,s){Ve.getImage(this._requestManager.transformRequest(z,et.Image),s)}listImages(){return this.style.listImages()}addLayer(z,s){return this._lazyInitEmptyStyle(),this.style.addLayer(z,s),this._update(!0)}moveLayer(z,s){return this.style.moveLayer(z,s),this._update(!0)}removeLayer(z){return this.style.removeLayer(z),this._update(!0)}getLayer(z){return this.style.getLayer(z)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(z,s,x){return this.style.setLayerZoomRange(z,s,x),this._update(!0)}setFilter(z,s,x={}){return this.style.setFilter(z,s,x),this._update(!0)}getFilter(z){return this.style.getFilter(z)}setPaintProperty(z,s,x,I={}){return this.style.setPaintProperty(z,s,x,I),this._update(!0)}getPaintProperty(z,s){return this.style.getPaintProperty(z,s)}setLayoutProperty(z,s,x,I={}){return this.style.setLayoutProperty(z,s,x,I),this._update(!0)}getLayoutProperty(z,s){return this.style.getLayoutProperty(z,s)}setGlyphs(z,s={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(z,s),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(z,s,x={}){return this._lazyInitEmptyStyle(),this.style.addSprite(z,s,x,I=>{I||this._update(!0)}),this}removeSprite(z){return this._lazyInitEmptyStyle(),this.style.removeSprite(z),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(z,s={}){return this._lazyInitEmptyStyle(),this.style.setSprite(z,s,x=>{x||this._update(!0)}),this}setLight(z,s={}){return this._lazyInitEmptyStyle(),this.style.setLight(z,s),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(z,s){return this.style.setFeatureState(z,s),this._update()}removeFeatureState(z,s){return this.style.removeFeatureState(z,s),this._update()}getFeatureState(z){return this.style.getFeatureState(z)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let z=0,s=0;return this._container&&(z=this._container.clientWidth||400,s=this._container.clientHeight||300),[z,s]}_setupContainer(){const z=this._container;z.classList.add("maplibregl-map");const s=this._canvasContainer=be.create("div","maplibregl-canvas-container",z);this._interactive&&s.classList.add("maplibregl-interactive"),this._canvas=be.create("canvas","maplibregl-canvas",s),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const x=this._containerDimensions(),I=this._getClampedPixelRatio(x[0],x[1]);this._resizeCanvas(x[0],x[1],I);const k=this._controlContainer=be.create("div","maplibregl-control-container",z),H=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(ee=>{H[ee]=be.create("div",`maplibregl-ctrl-${ee} `,k)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){this._cooperativeGesturesScreen=be.create("div","maplibregl-cooperative-gesture-screen",this._container);let z=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(z=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map"),this._cooperativeGesturesScreen.innerHTML=`
${z}
${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}
`,this._cooperativeGesturesScreen.setAttribute("aria-hidden","true"),this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){be.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(z,s,x){this._canvas.width=Math.floor(x*z),this._canvas.height=Math.floor(x*s),this._canvas.style.width=`${z}px`,this._canvas.style.height=`${s}px`}_setupPainter(){const z={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let s=null;this._canvas.addEventListener("webglcontextcreationerror",I=>{s={requestedAttributes:z},I&&(s.statusMessage=I.statusMessage,s.type=I.type)},{once:!0});const x=this._canvas.getContext("webgl2",z)||this._canvas.getContext("webgl",z);if(!x){const I="Failed to initialize WebGL";throw s?(s.message=I,new Error(JSON.stringify(s))):new Error(I)}this.painter=new Tc(x,this.transform),Le.testSupport(x)}_onCooperativeGesture(z,s,x){return!s&&x<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(z){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||z,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(z){return this._update(),this._renderTaskQueue.add(z)}_cancelRenderFrame(z){this._renderTaskQueue.remove(z)}_render(z){const s=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(z),this._removed)return;let x=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const k=this.transform.zoom,H=R.h.now();this.style.zoomHistory.update(k,H);const ee=new R.a8(k,{now:H,fadeDuration:s,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),ne=ee.crossFadingFactor();ne===1&&ne===this._crossFadingFactor||(x=!0,this._crossFadingFactor=ne),this.style.update(ee)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,s,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:s,showPadding:this.showPadding}),this.fire(new R.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,R.bg.mark(R.bh.load),this.fire(new R.k("load"))),this.style&&(this.style.hasTransitions()||x)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const I=this._sourcesDirty||this._styleDirty||this._placementDirty;return I||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new R.k("idle")),!this._loaded||this._fullyLoaded||I||(this._fullyLoaded=!0,R.bg.mark(R.bh.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var z;this._hash&&this._hash.remove();for(const x of this._controls)x.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window!="undefined"&&removeEventListener("online",this._onWindowOnline,!1),Ve.removeThrottleControl(this._imageQueueHandle),(z=this._resizeObserver)===null||z===void 0||z.disconnect();const s=this.painter.context.gl.getExtension("WEBGL_lose_context");s&&s.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),be.remove(this._canvasContainer),be.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),R.bg.clearMetrics(),this._removed=!0,this.fire(new R.k("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=R.h.frame(z=>{R.bg.frame(z),this._frame=null,this._render(z)}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(z){this._showTileBoundaries!==z&&(this._showTileBoundaries=z,this._update())}get showPadding(){return!!this._showPadding}set showPadding(z){this._showPadding!==z&&(this._showPadding=z,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(z){this._showCollisionBoxes!==z&&(this._showCollisionBoxes=z,z?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(z){this._showOverdrawInspector!==z&&(this._showOverdrawInspector=z,this._update())}get repaint(){return!!this._repaint}set repaint(z){this._repaint!==z&&(this._repaint=z,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(z){this._vertices=z,this._update()}get version(){return ji}getCameraTargetElevation(){return this.transform.elevation}},ba.NavigationControl=class{constructor(z){this._updateZoomButtons=()=>{const s=this._map.getZoom(),x=s===this._map.getMaxZoom(),I=s===this._map.getMinZoom();this._zoomInButton.disabled=x,this._zoomOutButton.disabled=I,this._zoomInButton.setAttribute("aria-disabled",x.toString()),this._zoomOutButton.setAttribute("aria-disabled",I.toString())},this._rotateCompassArrow=()=>{const s=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=s},this._setButtonTitle=(s,x)=>{const I=this._map._getUIString(`NavigationControl.${x}`);s.title=I,s.setAttribute("aria-label",I)},this.options=R.e({},Gs,z),this._container=be.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",s=>s.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",s=>this._map.zoomIn({},{originalEvent:s})),be.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",s=>this._map.zoomOut({},{originalEvent:s})),be.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",s=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:s}):this._map.resetNorth({},{originalEvent:s})}),this._compassIcon=be.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(z){return this._map=z,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Lc(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){be.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(z,s){const x=be.create("button",z,this._container);return x.type="button",x.addEventListener("click",s),x}},ba.GeolocateControl=class extends R.E{constructor(z){super(),this._onSuccess=s=>{if(this._map){if(this._isOutOfMapMaxBounds(s))return this._setErrorState(),this.fire(new R.k("outofmaxbounds",s)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=s,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(s),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(s),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new R.k("geolocate",s)),this._finish()}},this._updateCamera=s=>{const x=new R.L(s.coords.longitude,s.coords.latitude),I=s.coords.accuracy,k=this._map.getBearing(),H=R.e({bearing:k},this.options.fitBoundsOptions),ee=wr.fromLngLat(x,I);this._map.fitBounds(ee,H,{geolocateSource:!0})},this._updateMarker=s=>{if(s){const x=new R.L(s.coords.longitude,s.coords.latitude);this._accuracyCircleMarker.setLngLat(x).addTo(this._map),this._userLocationDotMarker.setLngLat(x).addTo(this._map),this._accuracy=s.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=s=>{if(this._map){if(this.options.trackUserLocation)if(s.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const x=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=x,this._geolocateButton.setAttribute("aria-label",x),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(s.code===3&&pc)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new R.k("error",s)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=s=>{if(this._map){if(this._container.addEventListener("contextmenu",x=>x.preventDefault()),this._geolocateButton=be.create("button","maplibregl-ctrl-geolocate",this._container),be.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",s===!1){R.w("Geolocation support is not available so the GeolocateControl will be disabled.");const x=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=x,this._geolocateButton.setAttribute("aria-label",x)}else{const x=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=x,this._geolocateButton.setAttribute("aria-label",x)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=be.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Lu({element:this._dotElement}),this._circleElement=be.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Lu({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",x=>{x.geolocateSource||this._watchState!=="ACTIVE_LOCK"||x.originalEvent&&x.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new R.k("trackuserlocationend")))})}},this.options=R.e({},ks,z)}onAdd(z){return this._map=z,this._container=be.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(s,x=!1){ul===void 0||x?window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(I=>{ul=I.state!=="denied",s(ul)}).catch(()=>{ul=!!window.navigator.geolocation,s(ul)}):(ul=!!window.navigator.geolocation,s(ul)):s(ul)}(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),be.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,_l=0,pc=!1}_isOutOfMapMaxBounds(z){const s=this._map.getMaxBounds(),x=z.coords;return s&&(x.longitudes.getEast()||x.latitudes.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const z=this._map.getBounds(),s=z.getSouthEast(),x=z.getNorthEast(),I=s.distanceTo(x),k=Math.ceil(this._accuracy/(I/this._map._container.clientHeight)*2);this._circleElement.style.width=`${k}px`,this._circleElement.style.height=`${k}px`}trigger(){if(!this._setup)return R.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new R.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":_l--,pc=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new R.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new R.k("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let z;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),_l++,_l>1?(z={maximumAge:6e5,timeout:0},pc=!0):(z=this.options.positionOptions,pc=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,z)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},ba.AttributionControl=Rs,ba.LogoControl=hs,ba.ScaleControl=class{constructor(z){this._onMove=()=>{zh(this._map,this._container,this.options)},this.setUnit=s=>{this.options.unit=s,zh(this._map,this._container,this.options)},this.options=R.e({},Du,z)}getDefaultPosition(){return"bottom-left"}onAdd(z){return this._map=z,this._container=be.create("div","maplibregl-ctrl maplibregl-ctrl-scale",z.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){be.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},ba.FullscreenControl=class extends R.E{constructor(z={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,z&&z.container&&(z.container instanceof HTMLElement?this._container=z.container:R.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(z){return this._map=z,this._container||(this._container=this._map.getContainer()),this._controlContainer=be.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){be.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const z=this._fullscreenButton=be.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);be.create("span","maplibregl-ctrl-icon",z).setAttribute("aria-hidden","true"),z.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const z=this._getTitle();this._fullscreenButton.setAttribute("aria-label",z),this._fullscreenButton.title=z}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new R.k("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new R.k("fullscreenend")),this._prevCooperativeGestures&&(this._map.setCooperativeGestures(this._prevCooperativeGestures),delete this._prevCooperativeGestures))}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},ba.TerrainControl=class{constructor(z){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))},this.options=z}onAdd(z){return this._map=z,this._container=be.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=be.create("button","maplibregl-ctrl-terrain",this._container),be.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){be.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},ba.Popup=class extends R.E{constructor(z){super(),this.remove=()=>(this._content&&be.remove(this._content),this._container&&(be.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new R.k("close")),this),this._onMouseUp=s=>{this._update(s.point)},this._onMouseMove=s=>{this._update(s.point)},this._onDrag=s=>{this._update(s.point)},this._update=s=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=be.create("div","maplibregl-popup",this._map.getContainer()),this._tip=be.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const ee of this.options.className.split(" "))this._container.classList.add(ee);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Nh(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!s)return;const x=this._pos=this._trackPointer&&s?s:this._map.project(this._lngLat);let I=this.options.anchor;const k=nc(this.options.offset);if(!I){const ee=this._container.offsetWidth,ne=this._container.offsetHeight;let ue;ue=x.y+k.bottom.ythis._map.transform.height-ne?["bottom"]:[],x.xthis._map.transform.width-ee/2&&ue.push("right"),I=ue.length===0?"bottom":ue.join("-")}const H=x.add(k[I]).round();be.setTransform(this._container,`${xa[I]} translate(${H.x}px,${H.y}px)`),Al(this._container,I,"popup")},this._onClose=()=>{this.remove()},this.options=R.e(Object.create(qc),z)}addTo(z){return this._map&&this.remove(),this._map=z,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new R.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(z){return this._lngLat=R.L.convert(z),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(z){return this.setDOMContent(document.createTextNode(z))}setHTML(z){const s=document.createDocumentFragment(),x=document.createElement("body");let I;for(x.innerHTML=z;I=x.firstChild,I;)s.appendChild(I);return this.setDOMContent(s)}getMaxWidth(){var z;return(z=this._container)===null||z===void 0?void 0:z.style.maxWidth}setMaxWidth(z){return this.options.maxWidth=z,this._update(),this}setDOMContent(z){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=be.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(z),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(z){this._container&&this._container.classList.add(z)}removeClassName(z){this._container&&this._container.classList.remove(z)}setOffset(z){return this.options.offset=z,this._update(),this}toggleClassName(z){if(this._container)return this._container.classList.toggle(z)}_createCloseButton(){this.options.closeButton&&(this._closeButton=be.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const z=this._container.querySelector(Sh);z&&z.focus()}},ba.Marker=Lu,ba.Style=Fa,ba.LngLat=R.L,ba.LngLatBounds=wr,ba.Point=R.P,ba.MercatorCoordinate=R.U,ba.Evented=R.E,ba.AJAXError=R.bi,ba.config=R.c,ba.CanvasSource=Xi,ba.GeoJSONSource=Uo,ba.ImageSource=bo,ba.RasterDEMTileSource=li,ba.RasterTileSource=yi,ba.VectorTileSource=an,ba.VideoSource=So,ba.setRTLTextPlugin=R.bj,ba.getRTLTextPluginStatus=R.bk,ba.prewarm=function(){Wr().acquire(We)},ba.clearPrewarmedResources=function(){const z=or;z&&(z.isPreloaded()&&z.numActive()===1?(z.release(We),or=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},Yl.extend(ba,{isSafari:R.ac,getPerformanceMetrics:R.bg.getPerformanceMetrics}),ba});var M=ve;return M})},56052:function(Zr,_r){"use strict";var Se=Array.isArray;_r.Z=Se}}]);