var m_=Object.defineProperty;var __=(R,B,U)=>B in R?m_(R,B,{enumerable:!0,configurable:!0,writable:!0,value:U}):R[B]=U;var Ju=(R,B,U)=>(__(R,typeof B!="symbol"?B+"":B,U),U);import{u as Ci,O as g_,P as y_,l as Po,Q as x_,k as sc,D as zd,n as v_,w as Rd,R as sh,S as h6,U as Of,V as b_,W as w_,m as ac,j as tr,X as T_,A as S_,q as Da,o as Mo,c as Yl,t as Dd,z as E_,I as dh,s as eh,G as d6,a as ah,v as Qo,L as p6,H as f6,J as m6,Y as M_,d as J1,Z as A_,y as Qu,x as I_,F as P_,_ as C_,$ as _6,a0 as Ed,a1 as kf,h as z_}from"./vue-4ebd1e77.js";import{s as g6,w as y6,e as x6,i as v6,f as R_,_ as b6,c as D_,g as L_,d as O_}from"./index-573c7dfe.js";var Ff;const lc=typeof window<"u",k_=R=>typeof R=="string",F_=()=>{};lc&&((Ff=window==null?void 0:window.navigator)!=null&&Ff.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Ld(R){return typeof R=="function"?R():Ci(R)}function B_(R){return R}function Od(R){return g_()?(y_(R),!0):!1}function N_(R,B=!0){sc()?zd(R):B?R():v_(R)}function V_(R,B,U={}){const{immediate:W=!0}=U,_e=Po(!1);let Me=null;function De(){Me&&(clearTimeout(Me),Me=null)}function s(){_e.value=!1,De()}function gt(...nt){De(),_e.value=!0,Me=setTimeout(()=>{_e.value=!1,Me=null,R(...nt)},Ld(B))}return W&&(_e.value=!0,lc&>()),Od(s),{isPending:x_(_e),start:gt,stop:s}}function w6(R){var B;const U=Ld(R);return(B=U==null?void 0:U.$el)!=null?B:U}const T6=lc?window:void 0;function U_(...R){let B,U,W,_e;if(k_(R[0])||Array.isArray(R[0])?([U,W,_e]=R,B=T6):[B,U,W,_e]=R,!B)return F_;Array.isArray(U)||(U=[U]),Array.isArray(W)||(W=[W]);const Me=[],De=()=>{Me.forEach(dt=>dt()),Me.length=0},s=(dt,At,yi,_i)=>(dt.addEventListener(At,yi,_i),()=>dt.removeEventListener(At,yi,_i)),gt=Rd(()=>[w6(B),Ld(_e)],([dt,At])=>{De(),dt&&Me.push(...U.flatMap(yi=>W.map(_i=>s(dt,yi,_i,At))))},{immediate:!0,flush:"post"}),nt=()=>{gt(),De()};return Od(nt),nt}function j_(R,B=!1){const U=Po(),W=()=>U.value=!!R();return W(),N_(W,B),U}const Bf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Nf="__vueuse_ssr_handlers__";Bf[Nf]=Bf[Nf]||{};var Vf=Object.getOwnPropertySymbols,G_=Object.prototype.hasOwnProperty,q_=Object.prototype.propertyIsEnumerable,$_=(R,B)=>{var U={};for(var W in R)G_.call(R,W)&&B.indexOf(W)<0&&(U[W]=R[W]);if(R!=null&&Vf)for(var W of Vf(R))B.indexOf(W)<0&&q_.call(R,W)&&(U[W]=R[W]);return U};function H_(R,B,U={}){const W=U,{window:_e=T6}=W,Me=$_(W,["window"]);let De;const s=j_(()=>_e&&"ResizeObserver"in _e),gt=()=>{De&&(De.disconnect(),De=void 0)},nt=Rd(()=>w6(R),At=>{gt(),s.value&&_e&&At&&(De=new ResizeObserver(B),De.observe(At,Me))},{immediate:!0,flush:"post"}),dt=()=>{gt(),nt()};return Od(dt),{isSupported:s,stop:dt}}var Uf;(function(R){R.UP="UP",R.RIGHT="RIGHT",R.DOWN="DOWN",R.LEFT="LEFT",R.NONE="NONE"})(Uf||(Uf={}));var Z_=Object.defineProperty,jf=Object.getOwnPropertySymbols,W_=Object.prototype.hasOwnProperty,X_=Object.prototype.propertyIsEnumerable,Gf=(R,B,U)=>B in R?Z_(R,B,{enumerable:!0,configurable:!0,writable:!0,value:U}):R[B]=U,Y_=(R,B)=>{for(var U in B||(B={}))W_.call(B,U)&&Gf(R,U,B[U]);if(jf)for(var U of jf(B))X_.call(B,U)&&Gf(R,U,B[U]);return R};const K_={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};Y_({linear:B_},K_);var J_=typeof global=="object"&&global&&global.Object===Object&&global;const Q_=J_;var e9=typeof self=="object"&&self&&self.Object===Object&&self,t9=Q_||e9||Function("return this")();const kd=t9;var i9=kd.Symbol;const Kl=i9;var S6=Object.prototype,r9=S6.hasOwnProperty,n9=S6.toString,Q1=Kl?Kl.toStringTag:void 0;function o9(R){var B=r9.call(R,Q1),U=R[Q1];try{R[Q1]=void 0;var W=!0}catch{}var _e=n9.call(R);return W&&(B?R[Q1]=U:delete R[Q1]),_e}var s9=Object.prototype,a9=s9.toString;function l9(R){return a9.call(R)}var c9="[object Null]",u9="[object Undefined]",qf=Kl?Kl.toStringTag:void 0;function E6(R){return R==null?R===void 0?u9:c9:qf&&qf in Object(R)?o9(R):l9(R)}function h9(R){return R!=null&&typeof R=="object"}var d9="[object Symbol]";function Fd(R){return typeof R=="symbol"||h9(R)&&E6(R)==d9}function p9(R,B){for(var U=-1,W=R==null?0:R.length,_e=Array(W);++U-1}function rg(R,B){var U=this.__data__,W=ph(U,R);return W<0?(++this.size,U.push([R,B])):U[W][1]=B,this}function e3(R){var B=-1,U=R==null?0:R.length;for(this.clear();++BR===void 0,rc=R=>typeof R=="number",Ag=R=>typeof Element>"u"?!1:R instanceof Element,Ig=R=>sh(R)?!Number.isNaN(Number(R)):!1,Wf=R=>Object.keys(R);function Pg(R,B="px"){if(!R)return"";if(rc(R)||Ig(R))return`${R}${B}`;if(sh(R))return R}const P6="__epPropKey",lh=R=>R,Cg=R=>h6(R)&&!!R[P6],C6=(R,B)=>{if(!h6(R)||Cg(R))return R;const{values:U,required:W,default:_e,type:Me,validator:De}=R,gt={type:Me,required:!!W,validator:U||De?nt=>{let dt=!1,At=[];if(U&&(At=Array.from(U),Of(R,"default")&&At.push(_e),dt||(dt=At.includes(nt))),De&&(dt||(dt=De(nt))),!dt&&At.length>0){const yi=[...new Set(At)].map(_i=>JSON.stringify(_i)).join(", ");b_(`Invalid prop: validation failed${B?` for prop "${B}"`:""}. Expected one of [${yi}], got value ${JSON.stringify(nt)}.`)}return dt}:void 0,[P6]:!0};return Of(R,"default")&&(gt.default=_e),gt},Vd=R=>Eg(Object.entries(R).map(([B,U])=>[B,C6(U,B)])),zg=lh([String,Object,Function]),Rg={Close:R_,SuccessFilled:g6,InfoFilled:v6,WarningFilled:y6,CircleCloseFilled:x6},Xf={success:g6,warning:y6,error:x6,info:v6},z6=(R,B)=>{if(R.install=U=>{for(const W of[R,...Object.values(B??{})])U.component(W.name,W)},B)for(const[U,W]of Object.entries(B))R[U]=W;return R},Dg=(R,B)=>(R.install=U=>{R._context=U._context,U.config.globalProperties[B]=R},R),Lv=R=>(R.install=w_,R),Lg={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},Og=["","default","small","large"],kg=R=>R;var Fg={name:"en",el:{colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color."},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"}}};const Bg=R=>(B,U)=>Ng(B,U,Ci(R)),Ng=(R,B,U)=>Sg(U,R,R).replace(/\{(\w+)\}/g,(W,_e)=>{var Me;return`${(Me=B==null?void 0:B[_e])!=null?Me:`{${_e}}`}`}),Vg=R=>{const B=tr(()=>Ci(R).name),U=T_(R)?R:Po(R);return{lang:B,locale:U,t:Bg(R)}},R6=Symbol("localeContextKey"),Ug=R=>{const B=R||ac(R6,Po());return Vg(tr(()=>B.value||Fg))},th="el",jg="is-",D0=(R,B,U,W,_e)=>{let Me=`${R}-${B}`;return U&&(Me+=`-${U}`),W&&(Me+=`__${W}`),_e&&(Me+=`--${_e}`),Me},D6=Symbol("namespaceContextKey"),Gg=R=>{const B=R||(sc()?ac(D6,Po(th)):Po(th));return tr(()=>Ci(B)||th)},Ud=(R,B)=>{const U=Gg(B);return{namespace:U,b:(ut="")=>D0(U.value,R,ut,"",""),e:ut=>ut?D0(U.value,R,"",ut,""):"",m:ut=>ut?D0(U.value,R,"","",ut):"",be:(ut,oi)=>ut&&oi?D0(U.value,R,ut,oi,""):"",em:(ut,oi)=>ut&&oi?D0(U.value,R,"",ut,oi):"",bm:(ut,oi)=>ut&&oi?D0(U.value,R,ut,"",oi):"",bem:(ut,oi,kt)=>ut&&oi&&kt?D0(U.value,R,ut,oi,kt):"",is:(ut,...oi)=>{const kt=oi.length>=1?oi[0]:!0;return ut&&kt?`${jg}${ut}`:""},cssVar:ut=>{const oi={};for(const kt in ut)ut[kt]&&(oi[`--${U.value}-${kt}`]=ut[kt]);return oi},cssVarName:ut=>`--${U.value}-${ut}`,cssVarBlock:ut=>{const oi={};for(const kt in ut)ut[kt]&&(oi[`--${U.value}-${R}-${kt}`]=ut[kt]);return oi},cssVarBlockName:ut=>`--${U.value}-${R}-${ut}`}},Yf=Po(0),L6=2e3,O6=Symbol("zIndexContextKey"),qg=R=>{const B=R||(sc()?ac(O6,void 0):void 0),U=tr(()=>{const Me=Ci(B);return rc(Me)?Me:L6}),W=tr(()=>U.value+Yf.value);return{initialZIndex:U,currentZIndex:W,nextZIndex:()=>(Yf.value++,W.value)}},Ov=C6({type:String,values:Og,required:!1}),k6=Symbol("size"),kv=()=>{const R=ac(k6,{});return tr(()=>Ci(R.size)||"")},F6=Symbol(),ch=Po();function B6(R,B=void 0){const U=sc()?ac(F6,ch):ch;return R?tr(()=>{var W,_e;return(_e=(W=U.value)==null?void 0:W[R])!=null?_e:B}):U}function $g(R,B){const U=B6(),W=Ud(R,tr(()=>{var s;return((s=U.value)==null?void 0:s.namespace)||th})),_e=Ug(tr(()=>{var s;return(s=U.value)==null?void 0:s.locale})),Me=qg(tr(()=>{var s;return((s=U.value)==null?void 0:s.zIndex)||L6})),De=tr(()=>{var s;return Ci(B)||((s=U.value)==null?void 0:s.size)||""});return Hg(tr(()=>Ci(U)||{})),{ns:W,locale:_e,zIndex:Me,size:De}}const Hg=(R,B,U=!1)=>{var W;const _e=!!sc(),Me=_e?B6():void 0,De=(W=B==null?void 0:B.provide)!=null?W:_e?S_:void 0;if(!De)return;const s=tr(()=>{const gt=Ci(R);return Me!=null&&Me.value?Zg(Me.value,gt):gt});return De(F6,s),De(R6,tr(()=>s.value.locale)),De(D6,tr(()=>s.value.namespace)),De(O6,tr(()=>s.value.zIndex)),De(k6,{size:tr(()=>s.value.size||"")}),(U||!ch.value)&&(ch.value=s.value),s},Zg=(R,B)=>{var U;const W=[...new Set([...Wf(R),...Wf(B)])],_e={};for(const Me of W)_e[Me]=(U=B[Me])!=null?U:R[Me];return _e},Kf={};var jd=(R,B)=>{const U=R.__vccOpts||R;for(const[W,_e]of B)U[W]=_e;return U};const Wg=Vd({size:{type:lh([Number,String])},color:{type:String}}),Xg=Da({name:"ElIcon",inheritAttrs:!1}),Yg=Da({...Xg,props:Wg,setup(R){const B=R,U=Ud("icon"),W=tr(()=>{const{size:_e,color:Me}=B;return!_e&&!Me?{}:{fontSize:Mg(_e)?void 0:Pg(_e),"--color":Me}});return(_e,Me)=>(Mo(),Yl("i",E_({class:Ci(U).b(),style:Ci(W)},_e.$attrs),[Dd(_e.$slots,"default")],16))}});var Kg=jd(Yg,[["__file","/home/runner/work/element-plus/element-plus/packages/components/icon/src/icon.vue"]]);const Jf=z6(Kg),Jg=Vd({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"}}),Qg=["textContent"],ey=Da({name:"ElBadge"}),ty=Da({...ey,props:Jg,setup(R,{expose:B}){const U=R,W=Ud("badge"),_e=tr(()=>U.isDot?"":rc(U.value)&&rc(U.max)?U.max(Mo(),Yl("div",{class:Qo(Ci(W).b())},[Dd(Me.$slots,"default"),dh(m6,{name:`${Ci(W).namespace.value}-zoom-in-center`,persisted:""},{default:eh(()=>[d6(ah("sup",{class:Qo([Ci(W).e("content"),Ci(W).em("content",Me.type),Ci(W).is("fixed",!!Me.$slots.default),Ci(W).is("dot",Me.isDot)]),textContent:p6(Ci(_e))},null,10,Qg),[[f6,!Me.hidden&&(Ci(_e)||Me.isDot)]])]),_:1},8,["name"])],2))}});var iy=jd(ty,[["__file","/home/runner/work/element-plus/element-plus/packages/components/badge/src/badge.vue"]]);const ry=z6(iy),N6=["success","info","warning","error"],Mn=kg({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:lc?document.body:void 0}),ny=Vd({customClass:{type:String,default:Mn.customClass},center:{type:Boolean,default:Mn.center},dangerouslyUseHTMLString:{type:Boolean,default:Mn.dangerouslyUseHTMLString},duration:{type:Number,default:Mn.duration},icon:{type:zg,default:Mn.icon},id:{type:String,default:Mn.id},message:{type:lh([String,Object,Function]),default:Mn.message},onClose:{type:lh(Function),required:!1},showClose:{type:Boolean,default:Mn.showClose},type:{type:String,values:N6,default:Mn.type},offset:{type:Number,default:Mn.offset},zIndex:{type:Number,default:Mn.zIndex},grouping:{type:Boolean,default:Mn.grouping},repeatNum:{type:Number,default:Mn.repeatNum}}),oy={destroy:()=>!0},Ao=M_([]),sy=R=>{const B=Ao.findIndex(_e=>_e.id===R),U=Ao[B];let W;return B>0&&(W=Ao[B-1]),{current:U,prev:W}},ay=R=>{const{prev:B}=sy(R);return B?B.vm.exposed.bottom.value:0},ly=(R,B)=>Ao.findIndex(W=>W.id===R)>0?20:B,cy=["id"],uy=["innerHTML"],hy=Da({name:"ElMessage"}),dy=Da({...hy,props:ny,emits:oy,setup(R,{expose:B}){const U=R,{Close:W}=Rg,{ns:_e,zIndex:Me}=$g("message"),{currentZIndex:De,nextZIndex:s}=Me,gt=Po(),nt=Po(!1),dt=Po(0);let At;const yi=tr(()=>U.type?U.type==="error"?"danger":U.type:"info"),_i=tr(()=>{const vt=U.type;return{[_e.bm("icon",vt)]:vt&&Xf[vt]}}),yt=tr(()=>U.icon||Xf[U.type]||""),ut=tr(()=>ay(U.id)),oi=tr(()=>ly(U.id,U.offset)+ut.value),kt=tr(()=>dt.value+oi.value),Dr=tr(()=>({top:`${oi.value}px`,zIndex:De.value}));function $r(){U.duration!==0&&({stop:At}=V_(()=>{Nn()},U.duration))}function mi(){At==null||At()}function Nn(){nt.value=!1}function Co({code:vt}){vt===Lg.esc&&Nn()}return zd(()=>{$r(),s(),nt.value=!0}),Rd(()=>U.repeatNum,()=>{mi(),$r()}),U_(document,"keydown",Co),H_(gt,()=>{dt.value=gt.value.getBoundingClientRect().height}),B({visible:nt,bottom:kt,close:Nn}),(vt,dn)=>(Mo(),J1(m6,{name:Ci(_e).b("fade"),onBeforeLeave:vt.onClose,onAfterLeave:dn[0]||(dn[0]=zo=>vt.$emit("destroy")),persisted:""},{default:eh(()=>[d6(ah("div",{id:vt.id,ref_key:"messageRef",ref:gt,class:Qo([Ci(_e).b(),{[Ci(_e).m(vt.type)]:vt.type&&!vt.icon},Ci(_e).is("center",vt.center),Ci(_e).is("closable",vt.showClose),vt.customClass]),style:A_(Ci(Dr)),role:"alert",onMouseenter:mi,onMouseleave:$r},[vt.repeatNum>1?(Mo(),J1(Ci(ry),{key:0,value:vt.repeatNum,type:Ci(yi),class:Qo(Ci(_e).e("badge"))},null,8,["value","type","class"])):Qu("v-if",!0),Ci(yt)?(Mo(),J1(Ci(Jf),{key:1,class:Qo([Ci(_e).e("icon"),Ci(_i)])},{default:eh(()=>[(Mo(),J1(I_(Ci(yt))))]),_:1},8,["class"])):Qu("v-if",!0),Dd(vt.$slots,"default",{},()=>[vt.dangerouslyUseHTMLString?(Mo(),Yl(P_,{key:1},[Qu(" Caution here, message could've been compromised, never use user's input as message "),ah("p",{class:Qo(Ci(_e).e("content")),innerHTML:vt.message},null,10,uy)],2112)):(Mo(),Yl("p",{key:0,class:Qo(Ci(_e).e("content"))},p6(vt.message),3))]),vt.showClose?(Mo(),J1(Ci(Jf),{key:2,class:Qo(Ci(_e).e("closeBtn")),onClick:C_(Nn,["stop"])},{default:eh(()=>[dh(Ci(W))]),_:1},8,["class","onClick"])):Qu("v-if",!0)],46,cy),[[f6,nt.value]])]),_:3},8,["name","onBeforeLeave"]))}});var py=jd(dy,[["__file","/home/runner/work/element-plus/element-plus/packages/components/message/src/message.vue"]]);let fy=1;const V6=R=>{const B=!R||sh(R)||_6(R)||Ed(R)?{message:R}:R,U={...Mn,...B};if(!U.appendTo)U.appendTo=document.body;else if(sh(U.appendTo)){let W=document.querySelector(U.appendTo);Ag(W)||(W=document.body),U.appendTo=W}return U},my=R=>{const B=Ao.indexOf(R);if(B===-1)return;Ao.splice(B,1);const{handler:U}=R;U.close()},_y=({appendTo:R,...B},U)=>{const W=`message_${fy++}`,_e=B.onClose,Me=document.createElement("div"),De={...B,id:W,onClose:()=>{_e==null||_e(),my(dt)},onDestroy:()=>{kf(null,Me)}},s=dh(py,De,Ed(De.message)||_6(De.message)?{default:Ed(De.message)?De.message:()=>De.message}:null);s.appContext=U||Jl._context,kf(s,Me),R.appendChild(Me.firstElementChild);const gt=s.component,dt={id:W,vnode:s,vm:gt,handler:{close:()=>{gt.exposed.visible.value=!1}},props:s.component.props};return dt},Jl=(R={},B)=>{if(!lc)return{close:()=>{}};if(rc(Kf.max)&&Ao.length>=Kf.max)return{close:()=>{}};const U=V6(R);if(U.grouping&&Ao.length){const _e=Ao.find(({vnode:Me})=>{var De;return((De=Me.props)==null?void 0:De.message)===U.message});if(_e)return _e.props.repeatNum+=1,_e.props.type=U.type,_e.handler}const W=_y(U,B);return Ao.push(W),W.handler};N6.forEach(R=>{Jl[R]=(B={},U)=>{const W=V6(B);return Jl({...W,type:R},U)}});function gy(R){for(const B of Ao)(!R||R===B.props.type)&&B.handler.close()}Jl.closeAll=gy;Jl._context=null;const yy=Dg(Jl,"$message");var Qr=63710088e-1,Gd={centimeters:Qr*100,centimetres:Qr*100,degrees:Qr/111325,feet:Qr*3.28084,inches:Qr*39.37,kilometers:Qr/1e3,kilometres:Qr/1e3,meters:Qr,metres:Qr,miles:Qr/1609.344,millimeters:Qr*1e3,millimetres:Qr*1e3,nauticalmiles:Qr/1852,radians:1,yards:Qr*1.0936},xy={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Qr,yards:1.0936133},Md={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 La(R,B,U){U===void 0&&(U={});var W={type:"Feature"};return(U.id===0||U.id)&&(W.id=U.id),U.bbox&&(W.bbox=U.bbox),W.properties=B||{},W.geometry=R,W}function vy(R,B,U){switch(R){case"Point":return nc(B).geometry;case"LineString":return $d(B).geometry;case"Polygon":return qd(B).geometry;case"MultiPoint":return j6(B).geometry;case"MultiLineString":return U6(B).geometry;case"MultiPolygon":return G6(B).geometry;default:throw new Error(R+" is invalid")}}function nc(R,B,U){if(U===void 0&&(U={}),!R)throw new Error("coordinates is required");if(!Array.isArray(R))throw new Error("coordinates must be an Array");if(R.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!uh(R[0])||!uh(R[1]))throw new Error("coordinates must contain numbers");var W={type:"Point",coordinates:R};return La(W,B,U)}function by(R,B,U){return U===void 0&&(U={}),mh(R.map(function(W){return nc(W,B)}),U)}function qd(R,B,U){U===void 0&&(U={});for(var W=0,_e=R;W<_e.length;W++){var Me=_e[W];if(Me.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var De=0;De=0))throw new Error("precision must be a positive number");var U=Math.pow(10,B||0);return Math.round(R*U)/U}function Hd(R,B){B===void 0&&(B="kilometers");var U=Gd[B];if(!U)throw new Error(B+" units is invalid");return R*U}function Zd(R,B){B===void 0&&(B="kilometers");var U=Gd[B];if(!U)throw new Error(B+" units is invalid");return R/U}function My(R,B){return q6(Zd(R,B))}function Ay(R){var B=R%360;return B<0&&(B+=360),B}function q6(R){var B=R%(2*Math.PI);return B*180/Math.PI}function tc(R){var B=R%360;return B*Math.PI/180}function Iy(R,B,U){if(B===void 0&&(B="kilometers"),U===void 0&&(U="kilometers"),!(R>=0))throw new Error("length must be a positive number");return Hd(Zd(R,B),U)}function Py(R,B,U){if(B===void 0&&(B="meters"),U===void 0&&(U="kilometers"),!(R>=0))throw new Error("area must be a positive number");var W=Md[B];if(!W)throw new Error("invalid original units");var _e=Md[U];if(!_e)throw new Error("invalid final units");return R/W*_e}function uh(R){return!isNaN(R)&&R!==null&&!Array.isArray(R)}function Cy(R){return!!R&&R.constructor===Object}function zy(R){if(!R)throw new Error("bbox is required");if(!Array.isArray(R))throw new Error("bbox must be an Array");if(R.length!==4&&R.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");R.forEach(function(B){if(!uh(B))throw new Error("bbox must only contain numbers")})}function Ry(R){if(!R)throw new Error("id is required");if(["string","number"].indexOf(typeof R)===-1)throw new Error("id must be a number or a string")}const Fv=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:Md,bearingToAzimuth:Ay,convertArea:Py,convertLength:Iy,degreesToRadians:tc,earthRadius:Qr,factors:Gd,feature:La,featureCollection:mh,geometry:vy,geometryCollection:Sy,isNumber:uh,isObject:Cy,lengthToDegrees:My,lengthToRadians:Zd,lineString:$d,lineStrings:Ty,multiLineString:U6,multiPoint:j6,multiPolygon:G6,point:nc,points:by,polygon:qd,polygons:wy,radiansToDegrees:q6,radiansToLength:Hd,round:Ey,unitsFactors:xy,validateBBox:zy,validateId:Ry},Symbol.toStringTag,{value:"Module"}));function Qf(R){if(!R)throw new Error("coord is required");if(!Array.isArray(R)){if(R.type==="Feature"&&R.geometry!==null&&R.geometry.type==="Point")return R.geometry.coordinates;if(R.type==="Point")return R.coordinates}if(Array.isArray(R)&&R.length>=2&&!Array.isArray(R[0])&&!Array.isArray(R[1]))return R;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Bv(R){if(Array.isArray(R))return R;if(R.type==="Feature"){if(R.geometry!==null)return R.geometry.coordinates}else if(R.coordinates)return R.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Nv(R,B,U){if(!R)throw new Error("No feature passed");if(!U)throw new Error(".featureOf() requires a name");if(!R||R.type!=="Feature"||!R.geometry)throw new Error("Invalid input to "+U+", Feature with geometry required");if(!R.geometry||R.geometry.type!==B)throw new Error("Invalid input to "+U+": must be a "+B+", given "+R.geometry.type)}function Vv(R){return R.type==="Feature"?R.geometry:R}function Uv(R,B){return R.type==="FeatureCollection"?"FeatureCollection":R.type==="GeometryCollection"?"GeometryCollection":R.type==="Feature"&&R.geometry!==null?R.geometry.type:R.type}function Dy(R,B,U){U===void 0&&(U={});var W=Qf(R),_e=Qf(B),Me=tc(_e[1]-W[1]),De=tc(_e[0]-W[0]),s=tc(W[1]),gt=tc(_e[1]),nt=Math.pow(Math.sin(Me/2),2)+Math.pow(Math.sin(De/2),2)*Math.cos(s)*Math.cos(gt);return Hd(2*Math.atan2(Math.sqrt(nt),Math.sqrt(1-nt)),U.units)}function $6(R,B){return function(){return R.apply(B,arguments)}}const{toString:Ly}=Object.prototype,{getPrototypeOf:Wd}=Object,_h=(R=>B=>{const U=Ly.call(B);return R[U]||(R[U]=U.slice(8,-1).toLowerCase())})(Object.create(null)),es=R=>(R=R.toLowerCase(),B=>_h(B)===R),gh=R=>B=>typeof B===R,{isArray:t3}=Array,oc=gh("undefined");function Oy(R){return R!==null&&!oc(R)&&R.constructor!==null&&!oc(R.constructor)&&Qn(R.constructor.isBuffer)&&R.constructor.isBuffer(R)}const H6=es("ArrayBuffer");function ky(R){let B;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?B=ArrayBuffer.isView(R):B=R&&R.buffer&&H6(R.buffer),B}const Fy=gh("string"),Qn=gh("function"),Z6=gh("number"),yh=R=>R!==null&&typeof R=="object",By=R=>R===!0||R===!1,ih=R=>{if(_h(R)!=="object")return!1;const B=Wd(R);return(B===null||B===Object.prototype||Object.getPrototypeOf(B)===null)&&!(Symbol.toStringTag in R)&&!(Symbol.iterator in R)},Ny=es("Date"),Vy=es("File"),Uy=es("Blob"),jy=es("FileList"),Gy=R=>yh(R)&&Qn(R.pipe),qy=R=>{let B;return R&&(typeof FormData=="function"&&R instanceof FormData||Qn(R.append)&&((B=_h(R))==="formdata"||B==="object"&&Qn(R.toString)&&R.toString()==="[object FormData]"))},$y=es("URLSearchParams"),Hy=R=>R.trim?R.trim():R.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function cc(R,B,{allOwnKeys:U=!1}={}){if(R===null||typeof R>"u")return;let W,_e;if(typeof R!="object"&&(R=[R]),t3(R))for(W=0,_e=R.length;W<_e;W++)B.call(null,R[W],W,R);else{const Me=U?Object.getOwnPropertyNames(R):Object.keys(R),De=Me.length;let s;for(W=0;W0;)if(_e=U[W],B===_e.toLowerCase())return _e;return null}const X6=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Y6=R=>!oc(R)&&R!==X6;function Ad(){const{caseless:R}=Y6(this)&&this||{},B={},U=(W,_e)=>{const Me=R&&W6(B,_e)||_e;ih(B[Me])&&ih(W)?B[Me]=Ad(B[Me],W):ih(W)?B[Me]=Ad({},W):t3(W)?B[Me]=W.slice():B[Me]=W};for(let W=0,_e=arguments.length;W<_e;W++)arguments[W]&&cc(arguments[W],U);return B}const Zy=(R,B,U,{allOwnKeys:W}={})=>(cc(B,(_e,Me)=>{U&&Qn(_e)?R[Me]=$6(_e,U):R[Me]=_e},{allOwnKeys:W}),R),Wy=R=>(R.charCodeAt(0)===65279&&(R=R.slice(1)),R),Xy=(R,B,U,W)=>{R.prototype=Object.create(B.prototype,W),R.prototype.constructor=R,Object.defineProperty(R,"super",{value:B.prototype}),U&&Object.assign(R.prototype,U)},Yy=(R,B,U,W)=>{let _e,Me,De;const s={};if(B=B||{},R==null)return B;do{for(_e=Object.getOwnPropertyNames(R),Me=_e.length;Me-- >0;)De=_e[Me],(!W||W(De,R,B))&&!s[De]&&(B[De]=R[De],s[De]=!0);R=U!==!1&&Wd(R)}while(R&&(!U||U(R,B))&&R!==Object.prototype);return B},Ky=(R,B,U)=>{R=String(R),(U===void 0||U>R.length)&&(U=R.length),U-=B.length;const W=R.indexOf(B,U);return W!==-1&&W===U},Jy=R=>{if(!R)return null;if(t3(R))return R;let B=R.length;if(!Z6(B))return null;const U=new Array(B);for(;B-- >0;)U[B]=R[B];return U},Qy=(R=>B=>R&&B instanceof R)(typeof Uint8Array<"u"&&Wd(Uint8Array)),ex=(R,B)=>{const W=(R&&R[Symbol.iterator]).call(R);let _e;for(;(_e=W.next())&&!_e.done;){const Me=_e.value;B.call(R,Me[0],Me[1])}},tx=(R,B)=>{let U;const W=[];for(;(U=R.exec(B))!==null;)W.push(U);return W},ix=es("HTMLFormElement"),rx=R=>R.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(U,W,_e){return W.toUpperCase()+_e}),e6=(({hasOwnProperty:R})=>(B,U)=>R.call(B,U))(Object.prototype),nx=es("RegExp"),K6=(R,B)=>{const U=Object.getOwnPropertyDescriptors(R),W={};cc(U,(_e,Me)=>{let De;(De=B(_e,Me,R))!==!1&&(W[Me]=De||_e)}),Object.defineProperties(R,W)},ox=R=>{K6(R,(B,U)=>{if(Qn(R)&&["arguments","caller","callee"].indexOf(U)!==-1)return!1;const W=R[U];if(Qn(W)){if(B.enumerable=!1,"writable"in B){B.writable=!1;return}B.set||(B.set=()=>{throw Error("Can not rewrite read-only method '"+U+"'")})}})},sx=(R,B)=>{const U={},W=_e=>{_e.forEach(Me=>{U[Me]=!0})};return t3(R)?W(R):W(String(R).split(B)),U},ax=()=>{},lx=(R,B)=>(R=+R,Number.isFinite(R)?R:B),bd="abcdefghijklmnopqrstuvwxyz",t6="0123456789",J6={DIGIT:t6,ALPHA:bd,ALPHA_DIGIT:bd+bd.toUpperCase()+t6},cx=(R=16,B=J6.ALPHA_DIGIT)=>{let U="";const{length:W}=B;for(;R--;)U+=B[Math.random()*W|0];return U};function ux(R){return!!(R&&Qn(R.append)&&R[Symbol.toStringTag]==="FormData"&&R[Symbol.iterator])}const hx=R=>{const B=new Array(10),U=(W,_e)=>{if(yh(W)){if(B.indexOf(W)>=0)return;if(!("toJSON"in W)){B[_e]=W;const Me=t3(W)?[]:{};return cc(W,(De,s)=>{const gt=U(De,_e+1);!oc(gt)&&(Me[s]=gt)}),B[_e]=void 0,Me}}return W};return U(R,0)},dx=es("AsyncFunction"),px=R=>R&&(yh(R)||Qn(R))&&Qn(R.then)&&Qn(R.catch),ct={isArray:t3,isArrayBuffer:H6,isBuffer:Oy,isFormData:qy,isArrayBufferView:ky,isString:Fy,isNumber:Z6,isBoolean:By,isObject:yh,isPlainObject:ih,isUndefined:oc,isDate:Ny,isFile:Vy,isBlob:Uy,isRegExp:nx,isFunction:Qn,isStream:Gy,isURLSearchParams:$y,isTypedArray:Qy,isFileList:jy,forEach:cc,merge:Ad,extend:Zy,trim:Hy,stripBOM:Wy,inherits:Xy,toFlatObject:Yy,kindOf:_h,kindOfTest:es,endsWith:Ky,toArray:Jy,forEachEntry:ex,matchAll:tx,isHTMLForm:ix,hasOwnProperty:e6,hasOwnProp:e6,reduceDescriptors:K6,freezeMethods:ox,toObjectSet:sx,toCamelCase:rx,noop:ax,toFiniteNumber:lx,findKey:W6,global:X6,isContextDefined:Y6,ALPHABET:J6,generateString:cx,isSpecCompliantForm:ux,toJSONObject:hx,isAsyncFn:dx,isThenable:px};function Vi(R,B,U,W,_e){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=R,this.name="AxiosError",B&&(this.code=B),U&&(this.config=U),W&&(this.request=W),_e&&(this.response=_e)}ct.inherits(Vi,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ct.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Q6=Vi.prototype,e5={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(R=>{e5[R]={value:R}});Object.defineProperties(Vi,e5);Object.defineProperty(Q6,"isAxiosError",{value:!0});Vi.from=(R,B,U,W,_e,Me)=>{const De=Object.create(Q6);return ct.toFlatObject(R,De,function(gt){return gt!==Error.prototype},s=>s!=="isAxiosError"),Vi.call(De,R.message,B,U,W,_e),De.cause=R,De.name=R.name,Me&&Object.assign(De,Me),De};const fx=null;function Id(R){return ct.isPlainObject(R)||ct.isArray(R)}function t5(R){return ct.endsWith(R,"[]")?R.slice(0,-2):R}function i6(R,B,U){return R?R.concat(B).map(function(_e,Me){return _e=t5(_e),!U&&Me?"["+_e+"]":_e}).join(U?".":""):B}function mx(R){return ct.isArray(R)&&!R.some(Id)}const _x=ct.toFlatObject(ct,{},null,function(B){return/^is[A-Z]/.test(B)});function xh(R,B,U){if(!ct.isObject(R))throw new TypeError("target must be an object");B=B||new FormData,U=ct.toFlatObject(U,{metaTokens:!0,dots:!1,indexes:!1},!1,function(ut,oi){return!ct.isUndefined(oi[ut])});const W=U.metaTokens,_e=U.visitor||dt,Me=U.dots,De=U.indexes,gt=(U.Blob||typeof Blob<"u"&&Blob)&&ct.isSpecCompliantForm(B);if(!ct.isFunction(_e))throw new TypeError("visitor must be a function");function nt(yt){if(yt===null)return"";if(ct.isDate(yt))return yt.toISOString();if(!gt&&ct.isBlob(yt))throw new Vi("Blob is not supported. Use a Buffer instead.");return ct.isArrayBuffer(yt)||ct.isTypedArray(yt)?gt&&typeof Blob=="function"?new Blob([yt]):Buffer.from(yt):yt}function dt(yt,ut,oi){let kt=yt;if(yt&&!oi&&typeof yt=="object"){if(ct.endsWith(ut,"{}"))ut=W?ut:ut.slice(0,-2),yt=JSON.stringify(yt);else if(ct.isArray(yt)&&mx(yt)||(ct.isFileList(yt)||ct.endsWith(ut,"[]"))&&(kt=ct.toArray(yt)))return ut=t5(ut),kt.forEach(function($r,mi){!(ct.isUndefined($r)||$r===null)&&B.append(De===!0?i6([ut],mi,Me):De===null?ut:ut+"[]",nt($r))}),!1}return Id(yt)?!0:(B.append(i6(oi,ut,Me),nt(yt)),!1)}const At=[],yi=Object.assign(_x,{defaultVisitor:dt,convertValue:nt,isVisitable:Id});function _i(yt,ut){if(!ct.isUndefined(yt)){if(At.indexOf(yt)!==-1)throw Error("Circular reference detected in "+ut.join("."));At.push(yt),ct.forEach(yt,function(kt,Dr){(!(ct.isUndefined(kt)||kt===null)&&_e.call(B,kt,ct.isString(Dr)?Dr.trim():Dr,ut,yi))===!0&&_i(kt,ut?ut.concat(Dr):[Dr])}),At.pop()}}if(!ct.isObject(R))throw new TypeError("data must be an object");return _i(R),B}function r6(R){const B={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(R).replace(/[!'()~]|%20|%00/g,function(W){return B[W]})}function Xd(R,B){this._pairs=[],R&&xh(R,this,B)}const i5=Xd.prototype;i5.append=function(B,U){this._pairs.push([B,U])};i5.toString=function(B){const U=B?function(W){return B.call(this,W,r6)}:r6;return this._pairs.map(function(_e){return U(_e[0])+"="+U(_e[1])},"").join("&")};function gx(R){return encodeURIComponent(R).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function r5(R,B,U){if(!B)return R;const W=U&&U.encode||gx,_e=U&&U.serialize;let Me;if(_e?Me=_e(B,U):Me=ct.isURLSearchParams(B)?B.toString():new Xd(B,U).toString(W),Me){const De=R.indexOf("#");De!==-1&&(R=R.slice(0,De)),R+=(R.indexOf("?")===-1?"?":"&")+Me}return R}class yx{constructor(){this.handlers=[]}use(B,U,W){return this.handlers.push({fulfilled:B,rejected:U,synchronous:W?W.synchronous:!1,runWhen:W?W.runWhen:null}),this.handlers.length-1}eject(B){this.handlers[B]&&(this.handlers[B]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(B){ct.forEach(this.handlers,function(W){W!==null&&B(W)})}}const n6=yx,n5={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xx=typeof URLSearchParams<"u"?URLSearchParams:Xd,vx=typeof FormData<"u"?FormData:null,bx=typeof Blob<"u"?Blob:null,wx=(()=>{let R;return typeof navigator<"u"&&((R=navigator.product)==="ReactNative"||R==="NativeScript"||R==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Tx=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Io={isBrowser:!0,classes:{URLSearchParams:xx,FormData:vx,Blob:bx},isStandardBrowserEnv:wx,isStandardBrowserWebWorkerEnv:Tx,protocols:["http","https","file","blob","url","data"]};function Sx(R,B){return xh(R,new Io.classes.URLSearchParams,Object.assign({visitor:function(U,W,_e,Me){return Io.isNode&&ct.isBuffer(U)?(this.append(W,U.toString("base64")),!1):Me.defaultVisitor.apply(this,arguments)}},B))}function Ex(R){return ct.matchAll(/\w+|\[(\w*)]/g,R).map(B=>B[0]==="[]"?"":B[1]||B[0])}function Mx(R){const B={},U=Object.keys(R);let W;const _e=U.length;let Me;for(W=0;W<_e;W++)Me=U[W],B[Me]=R[Me];return B}function o5(R){function B(U,W,_e,Me){let De=U[Me++];const s=Number.isFinite(+De),gt=Me>=U.length;return De=!De&&ct.isArray(_e)?_e.length:De,gt?(ct.hasOwnProp(_e,De)?_e[De]=[_e[De],W]:_e[De]=W,!s):((!_e[De]||!ct.isObject(_e[De]))&&(_e[De]=[]),B(U,W,_e[De],Me)&&ct.isArray(_e[De])&&(_e[De]=Mx(_e[De])),!s)}if(ct.isFormData(R)&&ct.isFunction(R.entries)){const U={};return ct.forEachEntry(R,(W,_e)=>{B(Ex(W),_e,U,0)}),U}return null}function Ax(R,B,U){if(ct.isString(R))try{return(B||JSON.parse)(R),ct.trim(R)}catch(W){if(W.name!=="SyntaxError")throw W}return(U||JSON.stringify)(R)}const Yd={transitional:n5,adapter:Io.isNode?"http":"xhr",transformRequest:[function(B,U){const W=U.getContentType()||"",_e=W.indexOf("application/json")>-1,Me=ct.isObject(B);if(Me&&ct.isHTMLForm(B)&&(B=new FormData(B)),ct.isFormData(B))return _e&&_e?JSON.stringify(o5(B)):B;if(ct.isArrayBuffer(B)||ct.isBuffer(B)||ct.isStream(B)||ct.isFile(B)||ct.isBlob(B))return B;if(ct.isArrayBufferView(B))return B.buffer;if(ct.isURLSearchParams(B))return U.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),B.toString();let s;if(Me){if(W.indexOf("application/x-www-form-urlencoded")>-1)return Sx(B,this.formSerializer).toString();if((s=ct.isFileList(B))||W.indexOf("multipart/form-data")>-1){const gt=this.env&&this.env.FormData;return xh(s?{"files[]":B}:B,gt&&new gt,this.formSerializer)}}return Me||_e?(U.setContentType("application/json",!1),Ax(B)):B}],transformResponse:[function(B){const U=this.transitional||Yd.transitional,W=U&&U.forcedJSONParsing,_e=this.responseType==="json";if(B&&ct.isString(B)&&(W&&!this.responseType||_e)){const De=!(U&&U.silentJSONParsing)&&_e;try{return JSON.parse(B)}catch(s){if(De)throw s.name==="SyntaxError"?Vi.from(s,Vi.ERR_BAD_RESPONSE,this,null,this.response):s}}return B}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Io.classes.FormData,Blob:Io.classes.Blob},validateStatus:function(B){return B>=200&&B<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ct.forEach(["delete","get","head","post","put","patch"],R=>{Yd.headers[R]={}});const Kd=Yd,Ix=ct.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Px=R=>{const B={};let U,W,_e;return R&&R.split(` `).forEach(function(De){_e=De.indexOf(":"),U=De.substring(0,_e).trim().toLowerCase(),W=De.substring(_e+1).trim(),!(!U||B[U]&&Ix[U])&&(U==="set-cookie"?B[U]?B[U].push(W):B[U]=[W]:B[U]=B[U]?B[U]+", "+W:W)}),B},o6=Symbol("internals");function ec(R){return R&&String(R).trim().toLowerCase()}function rh(R){return R===!1||R==null?R:ct.isArray(R)?R.map(rh):String(R)}function Cx(R){const B=Object.create(null),U=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let W;for(;W=U.exec(R);)B[W[1]]=W[2];return B}const zx=R=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(R.trim());function wd(R,B,U,W,_e){if(ct.isFunction(W))return W.call(this,B,U);if(_e&&(B=U),!!ct.isString(B)){if(ct.isString(W))return B.indexOf(W)!==-1;if(ct.isRegExp(W))return W.test(B)}}function Rx(R){return R.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(B,U,W)=>U.toUpperCase()+W)}function Dx(R,B){const U=ct.toCamelCase(" "+B);["get","set","has"].forEach(W=>{Object.defineProperty(R,W+U,{value:function(_e,Me,De){return this[W].call(this,B,_e,Me,De)},configurable:!0})})}class vh{constructor(B){B&&this.set(B)}set(B,U,W){const _e=this;function Me(s,gt,nt){const dt=ec(gt);if(!dt)throw new Error("header name must be a non-empty string");const At=ct.findKey(_e,dt);(!At||_e[At]===void 0||nt===!0||nt===void 0&&_e[At]!==!1)&&(_e[At||gt]=rh(s))}const De=(s,gt)=>ct.forEach(s,(nt,dt)=>Me(nt,dt,gt));return ct.isPlainObject(B)||B instanceof this.constructor?De(B,U):ct.isString(B)&&(B=B.trim())&&!zx(B)?De(Px(B),U):B!=null&&Me(U,B,W),this}get(B,U){if(B=ec(B),B){const W=ct.findKey(this,B);if(W){const _e=this[W];if(!U)return _e;if(U===!0)return Cx(_e);if(ct.isFunction(U))return U.call(this,_e,W);if(ct.isRegExp(U))return U.exec(_e);throw new TypeError("parser must be boolean|regexp|function")}}}has(B,U){if(B=ec(B),B){const W=ct.findKey(this,B);return!!(W&&this[W]!==void 0&&(!U||wd(this,this[W],W,U)))}return!1}delete(B,U){const W=this;let _e=!1;function Me(De){if(De=ec(De),De){const s=ct.findKey(W,De);s&&(!U||wd(W,W[s],s,U))&&(delete W[s],_e=!0)}}return ct.isArray(B)?B.forEach(Me):Me(B),_e}clear(B){const U=Object.keys(this);let W=U.length,_e=!1;for(;W--;){const Me=U[W];(!B||wd(this,this[Me],Me,B,!0))&&(delete this[Me],_e=!0)}return _e}normalize(B){const U=this,W={};return ct.forEach(this,(_e,Me)=>{const De=ct.findKey(W,Me);if(De){U[De]=rh(_e),delete U[Me];return}const s=B?Rx(Me):String(Me).trim();s!==Me&&delete U[Me],U[s]=rh(_e),W[s]=!0}),this}concat(...B){return this.constructor.concat(this,...B)}toJSON(B){const U=Object.create(null);return ct.forEach(this,(W,_e)=>{W!=null&&W!==!1&&(U[_e]=B&&ct.isArray(W)?W.join(", "):W)}),U}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([B,U])=>B+": "+U).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(B){return B instanceof this?B:new this(B)}static concat(B,...U){const W=new this(B);return U.forEach(_e=>W.set(_e)),W}static accessor(B){const W=(this[o6]=this[o6]={accessors:{}}).accessors,_e=this.prototype;function Me(De){const s=ec(De);W[s]||(Dx(_e,De),W[s]=!0)}return ct.isArray(B)?B.forEach(Me):Me(B),this}}vh.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ct.reduceDescriptors(vh.prototype,({value:R},B)=>{let U=B[0].toUpperCase()+B.slice(1);return{get:()=>R,set(W){this[U]=W}}});ct.freezeMethods(vh);const Ss=vh;function Td(R,B){const U=this||Kd,W=B||U,_e=Ss.from(W.headers);let Me=W.data;return ct.forEach(R,function(s){Me=s.call(U,Me,_e.normalize(),B?B.status:void 0)}),_e.normalize(),Me}function s5(R){return!!(R&&R.__CANCEL__)}function uc(R,B,U){Vi.call(this,R??"canceled",Vi.ERR_CANCELED,B,U),this.name="CanceledError"}ct.inherits(uc,Vi,{__CANCEL__:!0});function Lx(R,B,U){const W=U.config.validateStatus;!U.status||!W||W(U.status)?R(U):B(new Vi("Request failed with status code "+U.status,[Vi.ERR_BAD_REQUEST,Vi.ERR_BAD_RESPONSE][Math.floor(U.status/100)-4],U.config,U.request,U))}const Ox=Io.isStandardBrowserEnv?function(){return{write:function(U,W,_e,Me,De,s){const gt=[];gt.push(U+"="+encodeURIComponent(W)),ct.isNumber(_e)&>.push("expires="+new Date(_e).toGMTString()),ct.isString(Me)&>.push("path="+Me),ct.isString(De)&>.push("domain="+De),s===!0&>.push("secure"),document.cookie=gt.join("; ")},read:function(U){const W=document.cookie.match(new RegExp("(^|;\\s*)("+U+")=([^;]*)"));return W?decodeURIComponent(W[3]):null},remove:function(U){this.write(U,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function kx(R){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(R)}function Fx(R,B){return B?R.replace(/\/+$/,"")+"/"+B.replace(/^\/+/,""):R}function a5(R,B){return R&&!kx(B)?Fx(R,B):B}const Bx=Io.isStandardBrowserEnv?function(){const B=/(msie|trident)/i.test(navigator.userAgent),U=document.createElement("a");let W;function _e(Me){let De=Me;return B&&(U.setAttribute("href",De),De=U.href),U.setAttribute("href",De),{href:U.href,protocol:U.protocol?U.protocol.replace(/:$/,""):"",host:U.host,search:U.search?U.search.replace(/^\?/,""):"",hash:U.hash?U.hash.replace(/^#/,""):"",hostname:U.hostname,port:U.port,pathname:U.pathname.charAt(0)==="/"?U.pathname:"/"+U.pathname}}return W=_e(window.location.href),function(De){const s=ct.isString(De)?_e(De):De;return s.protocol===W.protocol&&s.host===W.host}}():function(){return function(){return!0}}();function Nx(R){const B=/^([-+\w]{1,25})(:?\/\/|:)/.exec(R);return B&&B[1]||""}function Vx(R,B){R=R||10;const U=new Array(R),W=new Array(R);let _e=0,Me=0,De;return B=B!==void 0?B:1e3,function(gt){const nt=Date.now(),dt=W[Me];De||(De=nt),U[_e]=gt,W[_e]=nt;let At=Me,yi=0;for(;At!==_e;)yi+=U[At++],At=At%R;if(_e=(_e+1)%R,_e===Me&&(Me=(Me+1)%R),nt-De{const Me=_e.loaded,De=_e.lengthComputable?_e.total:void 0,s=Me-U,gt=W(s),nt=Me<=De;U=Me;const dt={loaded:Me,total:De,progress:De?Me/De:void 0,bytes:s,rate:gt||void 0,estimated:gt&&De&&nt?(De-Me)/gt:void 0,event:_e};dt[B?"download":"upload"]=!0,R(dt)}}const Ux=typeof XMLHttpRequest<"u",jx=Ux&&function(R){return new Promise(function(U,W){let _e=R.data;const Me=Ss.from(R.headers).normalize(),De=R.responseType;let s;function gt(){R.cancelToken&&R.cancelToken.unsubscribe(s),R.signal&&R.signal.removeEventListener("abort",s)}ct.isFormData(_e)&&(Io.isStandardBrowserEnv||Io.isStandardBrowserWebWorkerEnv?Me.setContentType(!1):Me.setContentType("multipart/form-data;",!1));let nt=new XMLHttpRequest;if(R.auth){const _i=R.auth.username||"",yt=R.auth.password?unescape(encodeURIComponent(R.auth.password)):"";Me.set("Authorization","Basic "+btoa(_i+":"+yt))}const dt=a5(R.baseURL,R.url);nt.open(R.method.toUpperCase(),r5(dt,R.params,R.paramsSerializer),!0),nt.timeout=R.timeout;function At(){if(!nt)return;const _i=Ss.from("getAllResponseHeaders"in nt&&nt.getAllResponseHeaders()),ut={data:!De||De==="text"||De==="json"?nt.responseText:nt.response,status:nt.status,statusText:nt.statusText,headers:_i,config:R,request:nt};Lx(function(kt){U(kt),gt()},function(kt){W(kt),gt()},ut),nt=null}if("onloadend"in nt?nt.onloadend=At:nt.onreadystatechange=function(){!nt||nt.readyState!==4||nt.status===0&&!(nt.responseURL&&nt.responseURL.indexOf("file:")===0)||setTimeout(At)},nt.onabort=function(){nt&&(W(new Vi("Request aborted",Vi.ECONNABORTED,R,nt)),nt=null)},nt.onerror=function(){W(new Vi("Network Error",Vi.ERR_NETWORK,R,nt)),nt=null},nt.ontimeout=function(){let yt=R.timeout?"timeout of "+R.timeout+"ms exceeded":"timeout exceeded";const ut=R.transitional||n5;R.timeoutErrorMessage&&(yt=R.timeoutErrorMessage),W(new Vi(yt,ut.clarifyTimeoutError?Vi.ETIMEDOUT:Vi.ECONNABORTED,R,nt)),nt=null},Io.isStandardBrowserEnv){const _i=(R.withCredentials||Bx(dt))&&R.xsrfCookieName&&Ox.read(R.xsrfCookieName);_i&&Me.set(R.xsrfHeaderName,_i)}_e===void 0&&Me.setContentType(null),"setRequestHeader"in nt&&ct.forEach(Me.toJSON(),function(yt,ut){nt.setRequestHeader(ut,yt)}),ct.isUndefined(R.withCredentials)||(nt.withCredentials=!!R.withCredentials),De&&De!=="json"&&(nt.responseType=R.responseType),typeof R.onDownloadProgress=="function"&&nt.addEventListener("progress",s6(R.onDownloadProgress,!0)),typeof R.onUploadProgress=="function"&&nt.upload&&nt.upload.addEventListener("progress",s6(R.onUploadProgress)),(R.cancelToken||R.signal)&&(s=_i=>{nt&&(W(!_i||_i.type?new uc(null,R,nt):_i),nt.abort(),nt=null)},R.cancelToken&&R.cancelToken.subscribe(s),R.signal&&(R.signal.aborted?s():R.signal.addEventListener("abort",s)));const yi=Nx(dt);if(yi&&Io.protocols.indexOf(yi)===-1){W(new Vi("Unsupported protocol "+yi+":",Vi.ERR_BAD_REQUEST,R));return}nt.send(_e||null)})},nh={http:fx,xhr:jx};ct.forEach(nh,(R,B)=>{if(R){try{Object.defineProperty(R,"name",{value:B})}catch{}Object.defineProperty(R,"adapterName",{value:B})}});const l5={getAdapter:R=>{R=ct.isArray(R)?R:[R];const{length:B}=R;let U,W;for(let _e=0;_eR instanceof Ss?R.toJSON():R;function Ql(R,B){B=B||{};const U={};function W(nt,dt,At){return ct.isPlainObject(nt)&&ct.isPlainObject(dt)?ct.merge.call({caseless:At},nt,dt):ct.isPlainObject(dt)?ct.merge({},dt):ct.isArray(dt)?dt.slice():dt}function _e(nt,dt,At){if(ct.isUndefined(dt)){if(!ct.isUndefined(nt))return W(void 0,nt,At)}else return W(nt,dt,At)}function Me(nt,dt){if(!ct.isUndefined(dt))return W(void 0,dt)}function De(nt,dt){if(ct.isUndefined(dt)){if(!ct.isUndefined(nt))return W(void 0,nt)}else return W(void 0,dt)}function s(nt,dt,At){if(At in B)return W(nt,dt);if(At in R)return W(void 0,nt)}const gt={url:Me,method:Me,data:Me,baseURL:De,transformRequest:De,transformResponse:De,paramsSerializer:De,timeout:De,timeoutMessage:De,withCredentials:De,adapter:De,responseType:De,xsrfCookieName:De,xsrfHeaderName:De,onUploadProgress:De,onDownloadProgress:De,decompress:De,maxContentLength:De,maxBodyLength:De,beforeRedirect:De,transport:De,httpAgent:De,httpsAgent:De,cancelToken:De,socketPath:De,responseEncoding:De,validateStatus:s,headers:(nt,dt)=>_e(l6(nt),l6(dt),!0)};return ct.forEach(Object.keys(Object.assign({},R,B)),function(dt){const At=gt[dt]||_e,yi=At(R[dt],B[dt],dt);ct.isUndefined(yi)&&At!==s||(U[dt]=yi)}),U}const c5="1.5.0",Jd={};["object","boolean","number","function","string","symbol"].forEach((R,B)=>{Jd[R]=function(W){return typeof W===R||"a"+(B<1?"n ":" ")+R}});const c6={};Jd.transitional=function(B,U,W){function _e(Me,De){return"[Axios v"+c5+"] Transitional option '"+Me+"'"+De+(W?". "+W:"")}return(Me,De,s)=>{if(B===!1)throw new Vi(_e(De," has been removed"+(U?" in "+U:"")),Vi.ERR_DEPRECATED);return U&&!c6[De]&&(c6[De]=!0,console.warn(_e(De," has been deprecated since v"+U+" and will be removed in the near future"))),B?B(Me,De,s):!0}};function Gx(R,B,U){if(typeof R!="object")throw new Vi("options must be an object",Vi.ERR_BAD_OPTION_VALUE);const W=Object.keys(R);let _e=W.length;for(;_e-- >0;){const Me=W[_e],De=B[Me];if(De){const s=R[Me],gt=s===void 0||De(s,Me,R);if(gt!==!0)throw new Vi("option "+Me+" must be "+gt,Vi.ERR_BAD_OPTION_VALUE);continue}if(U!==!0)throw new Vi("Unknown option "+Me,Vi.ERR_BAD_OPTION)}}const Pd={assertOptions:Gx,validators:Jd},Ra=Pd.validators;class hh{constructor(B){this.defaults=B,this.interceptors={request:new n6,response:new n6}}request(B,U){typeof B=="string"?(U=U||{},U.url=B):U=B||{},U=Ql(this.defaults,U);const{transitional:W,paramsSerializer:_e,headers:Me}=U;W!==void 0&&Pd.assertOptions(W,{silentJSONParsing:Ra.transitional(Ra.boolean),forcedJSONParsing:Ra.transitional(Ra.boolean),clarifyTimeoutError:Ra.transitional(Ra.boolean)},!1),_e!=null&&(ct.isFunction(_e)?U.paramsSerializer={serialize:_e}:Pd.assertOptions(_e,{encode:Ra.function,serialize:Ra.function},!0)),U.method=(U.method||this.defaults.method||"get").toLowerCase();let De=Me&&ct.merge(Me.common,Me[U.method]);Me&&ct.forEach(["delete","get","head","post","put","patch","common"],yt=>{delete Me[yt]}),U.headers=Ss.concat(De,Me);const s=[];let gt=!0;this.interceptors.request.forEach(function(ut){typeof ut.runWhen=="function"&&ut.runWhen(U)===!1||(gt=gt&&ut.synchronous,s.unshift(ut.fulfilled,ut.rejected))});const nt=[];this.interceptors.response.forEach(function(ut){nt.push(ut.fulfilled,ut.rejected)});let dt,At=0,yi;if(!gt){const yt=[a6.bind(this),void 0];for(yt.unshift.apply(yt,s),yt.push.apply(yt,nt),yi=yt.length,dt=Promise.resolve(U);At{if(!W._listeners)return;let Me=W._listeners.length;for(;Me-- >0;)W._listeners[Me](_e);W._listeners=null}),this.promise.then=_e=>{let Me;const De=new Promise(s=>{W.subscribe(s),Me=s}).then(_e);return De.cancel=function(){W.unsubscribe(Me)},De},B(function(Me,De,s){W.reason||(W.reason=new uc(Me,De,s),U(W.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(B){if(this.reason){B(this.reason);return}this._listeners?this._listeners.push(B):this._listeners=[B]}unsubscribe(B){if(!this._listeners)return;const U=this._listeners.indexOf(B);U!==-1&&this._listeners.splice(U,1)}static source(){let B;return{token:new Qd(function(_e){B=_e}),cancel:B}}}const qx=Qd;function $x(R){return function(U){return R.apply(null,U)}}function Hx(R){return ct.isObject(R)&&R.isAxiosError===!0}const Cd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Cd).forEach(([R,B])=>{Cd[B]=R});const Zx=Cd;function u5(R){const B=new oh(R),U=$6(oh.prototype.request,B);return ct.extend(U,oh.prototype,B,{allOwnKeys:!0}),ct.extend(U,B,null,{allOwnKeys:!0}),U.create=function(_e){return u5(Ql(R,_e))},U}const Mr=u5(Kd);Mr.Axios=oh;Mr.CanceledError=uc;Mr.CancelToken=qx;Mr.isCancel=s5;Mr.VERSION=c5;Mr.toFormData=xh;Mr.AxiosError=Vi;Mr.Cancel=Mr.CanceledError;Mr.all=function(B){return Promise.all(B)};Mr.spread=$x;Mr.isAxiosError=Hx;Mr.mergeConfig=Ql;Mr.AxiosHeaders=Ss;Mr.formToJSON=R=>o5(ct.isHTMLForm(R)?new FormData(R):R);Mr.getAdapter=l5.getAdapter;Mr.HttpStatusCode=Zx;Mr.default=Mr;const u6=Mr;let h5=class{constructor(B){Ju(this,"instance");Ju(this,"interceptorsObj");Ju(this,"abortControllerMap");var U,W,_e,Me;this.abortControllerMap=new Map,this.interceptorsObj=B.interceptors,this.instance=u6.create(B),this.instance.interceptors.request.use(De=>{const s=new AbortController,gt=De.url||"";return De.signal=s.signal,this.abortControllerMap.set(gt,s),De},De=>Promise.reject(De)),this.instance.interceptors.request.use((U=this.interceptorsObj)==null?void 0:U.requestInterceptors,(W=this.interceptorsObj)==null?void 0:W.requestInterceptorsCatch),this.instance.interceptors.response.use((_e=this.interceptorsObj)==null?void 0:_e.responseInterceptors,(Me=this.interceptorsObj)==null?void 0:Me.responseInterceptorsCatch),this.instance.interceptors.response.use(De=>{const s=De.config.url||"";return this.abortControllerMap.delete(s),De.data},De=>Promise.reject(De))}cancelAllRequest(){for(const[,B]of this.abortControllerMap)B.abort();this.abortControllerMap.clear()}cancelRequest(B){var W;const U=Array.isArray(B)?B:[B];for(const _e of U)(W=this.abortControllerMap.get(_e))==null||W.abort(),this.abortControllerMap.delete(_e)}request(B){return new Promise((U,W)=>{var _e;(_e=B.interceptors)!=null&&_e.requestInterceptors&&(B=B.interceptors.requestInterceptors(B)),this.instance.request(B).then(Me=>{var De;(De=B.interceptors)!=null&&De.responseInterceptors&&(Me=B.interceptors.responseInterceptors(Me)),U(Me)}).catch(Me=>{W(Me)})})}get(B,U,W){return this.instance.get(B,{params:U,...W})}post(B,U,W){return this.instance.post(B,U,W)}put(B,U,W){return this.instance.put(B,U,W)}delete(B,U){return this.instance.delete(B,U)}local(B){return u6.get(B,{headers:{"Content-Type":"application/json;charset=UTF-8"}})}};function Wx(R){return Yx.post("/opr/login",R)}const d5=z_({id:"user",getters:{username:R=>R.userInfo.username||sessionStorage.getItem("username")},state:()=>({token:sessionStorage.token||"",roles:[],userInfo:{username:""}}),actions:{setRoles(R){this.roles=R},login(R){return new Promise((B,U)=>{Wx({userAccount:R.userAccount.trim(),password:R.password,verificationCode:R.verificationCode}).then(W=>{this.updateToken(W.token),this.updateUserInfo(W),sessionStorage.setItem("tenantCode",W.tenantCode),sessionStorage.setItem("tenantId",W.tenantId),sessionStorage.setItem("lastTime",Date.now().toString()),B(!0)}).catch(W=>{U(W)})})},logout(){sessionStorage.token="",this.token="",this.roles=[]},resetToken(){sessionStorage.token="",this.token="",this.roles=[]},updateUserInfo(R){this.userInfo=R,sessionStorage.setItem("username",R.username)},updateToken(R){sessionStorage.setItem("token",R),this.token=R}}}),Xx=new h5({baseURL:"/api",timeout:6e4,interceptors:{requestInterceptors:R=>(sessionStorage.getItem("tenantId")&&(R.headers["Tenant-Id"]=sessionStorage.getItem("tenantId")),sessionStorage.token&&(R.headers.Authorization=sessionStorage.token),R),requestInterceptorsCatch:R=>(console.error("网络错误,请稍后重试"),Promise.reject(R)),responseInterceptors:R=>R,responseInterceptorsCatch:R=>{const B=R.response.data;return B.code==="B-00-999"&&d5().logout(),yy.error(B.msg),Promise.reject(R)}}}),Yx=Xx,Kx=Da({__name:"eagleEyeMap",props:{divClass:{default:"right-second"},class:{default:"right-second-map"}},setup(R){const B=R;return(U,W)=>(Mo(),Yl("div",{class:Qo(B.divClass)},[ah("div",{id:"small-map",class:Qo(B.class)},null,2)],2))}});const Jx=b6(Kx,[["__scopeId","data-v-a6795a7f"]]);var p5={exports:{}};(function(R,B){(function(U,W){R.exports=W()})(D_,function(){var U,W,_e;function Me(s,gt){if(!U)U=gt;else if(!W)W=gt;else{var nt="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+U+")(sharedChunk); ("+W+")(sharedChunk); self.onerror = null;",dt={};U(dt),_e=gt(dt),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(_e.workerUrl=window.URL.createObjectURL(new Blob([nt],{type:"text/javascript"})))}}Me(["exports"],function(s){function gt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var nt,dt={},At={};function yi(){if(nt)return At;nt=1,Object.defineProperty(At,"__esModule",{value:!0}),At.setMatrixArrayType=function(l){At.ARRAY_TYPE=e=l},At.toRadian=function(l){return l*o},At.equals=function(l,a){return Math.abs(l-a)<=n*Math.max(1,Math.abs(l),Math.abs(a))},At.RANDOM=At.ARRAY_TYPE=At.EPSILON=void 0;var n=1e-6;At.EPSILON=n;var e=typeof Float32Array<"u"?Float32Array:Array;At.ARRAY_TYPE=e;var i=Math.random;At.RANDOM=i;var o=Math.PI/180;return Math.hypot||(Math.hypot=function(){for(var l=0,a=arguments.length;a--;)l+=arguments[a]*arguments[a];return Math.sqrt(l)}),At}var _i,yt={};function ut(){if(_i)return yt;function n(a){return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},n(a)}_i=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.create=function(){var a=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(a[1]=0,a[2]=0),a[0]=1,a[3]=1,a},yt.clone=function(a){var h=new e.ARRAY_TYPE(4);return h[0]=a[0],h[1]=a[1],h[2]=a[2],h[3]=a[3],h},yt.copy=function(a,h){return a[0]=h[0],a[1]=h[1],a[2]=h[2],a[3]=h[3],a},yt.identity=function(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=1,a},yt.fromValues=function(a,h,m,g){var v=new e.ARRAY_TYPE(4);return v[0]=a,v[1]=h,v[2]=m,v[3]=g,v},yt.set=function(a,h,m,g,v){return a[0]=h,a[1]=m,a[2]=g,a[3]=v,a},yt.transpose=function(a,h){if(a===h){var m=h[1];a[1]=h[2],a[2]=m}else a[0]=h[0],a[1]=h[2],a[2]=h[1],a[3]=h[3];return a},yt.invert=function(a,h){var m=h[0],g=h[1],v=h[2],p=h[3],y=m*p-v*g;return y?(a[0]=p*(y=1/y),a[1]=-g*y,a[2]=-v*y,a[3]=m*y,a):null},yt.adjoint=function(a,h){var m=h[0];return a[0]=h[3],a[1]=-h[1],a[2]=-h[2],a[3]=m,a},yt.determinant=function(a){return a[0]*a[3]-a[2]*a[1]},yt.multiply=o,yt.rotate=function(a,h,m){var g=h[0],v=h[1],p=h[2],y=h[3],w=Math.sin(m),x=Math.cos(m);return a[0]=g*x+p*w,a[1]=v*x+y*w,a[2]=g*-w+p*x,a[3]=v*-w+y*x,a},yt.scale=function(a,h,m){var g=h[1],v=h[2],p=h[3],y=m[0],w=m[1];return a[0]=h[0]*y,a[1]=g*y,a[2]=v*w,a[3]=p*w,a},yt.fromRotation=function(a,h){var m=Math.sin(h),g=Math.cos(h);return a[0]=g,a[1]=m,a[2]=-m,a[3]=g,a},yt.fromScaling=function(a,h){return a[0]=h[0],a[1]=0,a[2]=0,a[3]=h[1],a},yt.str=function(a){return"mat2("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"},yt.frob=function(a){return Math.hypot(a[0],a[1],a[2],a[3])},yt.LDU=function(a,h,m,g){return a[2]=g[2]/g[0],m[0]=g[0],m[1]=g[1],m[3]=g[3]-a[2]*m[1],[a,h,m]},yt.add=function(a,h,m){return a[0]=h[0]+m[0],a[1]=h[1]+m[1],a[2]=h[2]+m[2],a[3]=h[3]+m[3],a},yt.subtract=l,yt.exactEquals=function(a,h){return a[0]===h[0]&&a[1]===h[1]&&a[2]===h[2]&&a[3]===h[3]},yt.equals=function(a,h){var m=a[0],g=a[1],v=a[2],p=a[3],y=h[0],w=h[1],x=h[2],b=h[3];return Math.abs(m-y)<=e.EPSILON*Math.max(1,Math.abs(m),Math.abs(y))&&Math.abs(g-w)<=e.EPSILON*Math.max(1,Math.abs(g),Math.abs(w))&&Math.abs(v-x)<=e.EPSILON*Math.max(1,Math.abs(v),Math.abs(x))&&Math.abs(p-b)<=e.EPSILON*Math.max(1,Math.abs(p),Math.abs(b))},yt.multiplyScalar=function(a,h,m){return a[0]=h[0]*m,a[1]=h[1]*m,a[2]=h[2]*m,a[3]=h[3]*m,a},yt.multiplyScalarAndAdd=function(a,h,m,g){return a[0]=h[0]+m[0]*g,a[1]=h[1]+m[1]*g,a[2]=h[2]+m[2]*g,a[3]=h[3]+m[3]*g,a},yt.sub=yt.mul=void 0;var e=function(a,h){if(a&&a.__esModule)return a;if(a===null||n(a)!=="object"&&typeof a!="function")return{default:a};var m=i(void 0);if(m&&m.has(a))return m.get(a);var g={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var p in a)if(p!=="default"&&Object.prototype.hasOwnProperty.call(a,p)){var y=v?Object.getOwnPropertyDescriptor(a,p):null;y&&(y.get||y.set)?Object.defineProperty(g,p,y):g[p]=a[p]}return g.default=a,m&&m.set(a,g),g}(yi());function i(a){if(typeof WeakMap!="function")return null;var h=new WeakMap,m=new WeakMap;return(i=function(g){return g?m:h})(a)}function o(a,h,m){var g=h[0],v=h[1],p=h[2],y=h[3],w=m[0],x=m[1],b=m[2],S=m[3];return a[0]=g*w+p*x,a[1]=v*w+y*x,a[2]=g*b+p*S,a[3]=v*b+y*S,a}function l(a,h,m){return a[0]=h[0]-m[0],a[1]=h[1]-m[1],a[2]=h[2]-m[2],a[3]=h[3]-m[3],a}return yt.mul=o,yt.sub=l,yt}var oi,kt={};function Dr(){if(oi)return kt;function n(a){return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},n(a)}oi=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.create=function(){var a=new e.ARRAY_TYPE(6);return e.ARRAY_TYPE!=Float32Array&&(a[1]=0,a[2]=0,a[4]=0,a[5]=0),a[0]=1,a[3]=1,a},kt.clone=function(a){var h=new e.ARRAY_TYPE(6);return h[0]=a[0],h[1]=a[1],h[2]=a[2],h[3]=a[3],h[4]=a[4],h[5]=a[5],h},kt.copy=function(a,h){return a[0]=h[0],a[1]=h[1],a[2]=h[2],a[3]=h[3],a[4]=h[4],a[5]=h[5],a},kt.identity=function(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=1,a[4]=0,a[5]=0,a},kt.fromValues=function(a,h,m,g,v,p){var y=new e.ARRAY_TYPE(6);return y[0]=a,y[1]=h,y[2]=m,y[3]=g,y[4]=v,y[5]=p,y},kt.set=function(a,h,m,g,v,p,y){return a[0]=h,a[1]=m,a[2]=g,a[3]=v,a[4]=p,a[5]=y,a},kt.invert=function(a,h){var m=h[0],g=h[1],v=h[2],p=h[3],y=h[4],w=h[5],x=m*p-g*v;return x?(a[0]=p*(x=1/x),a[1]=-g*x,a[2]=-v*x,a[3]=m*x,a[4]=(v*w-p*y)*x,a[5]=(g*y-m*w)*x,a):null},kt.determinant=function(a){return a[0]*a[3]-a[1]*a[2]},kt.multiply=o,kt.rotate=function(a,h,m){var g=h[0],v=h[1],p=h[2],y=h[3],w=h[4],x=h[5],b=Math.sin(m),S=Math.cos(m);return a[0]=g*S+p*b,a[1]=v*S+y*b,a[2]=g*-b+p*S,a[3]=v*-b+y*S,a[4]=w,a[5]=x,a},kt.scale=function(a,h,m){var g=h[1],v=h[2],p=h[3],y=h[4],w=h[5],x=m[0],b=m[1];return a[0]=h[0]*x,a[1]=g*x,a[2]=v*b,a[3]=p*b,a[4]=y,a[5]=w,a},kt.translate=function(a,h,m){var g=h[0],v=h[1],p=h[2],y=h[3],w=h[4],x=h[5],b=m[0],S=m[1];return a[0]=g,a[1]=v,a[2]=p,a[3]=y,a[4]=g*b+p*S+w,a[5]=v*b+y*S+x,a},kt.fromRotation=function(a,h){var m=Math.sin(h),g=Math.cos(h);return a[0]=g,a[1]=m,a[2]=-m,a[3]=g,a[4]=0,a[5]=0,a},kt.fromScaling=function(a,h){return a[0]=h[0],a[1]=0,a[2]=0,a[3]=h[1],a[4]=0,a[5]=0,a},kt.fromTranslation=function(a,h){return a[0]=1,a[1]=0,a[2]=0,a[3]=1,a[4]=h[0],a[5]=h[1],a},kt.str=function(a){return"mat2d("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")"},kt.frob=function(a){return Math.hypot(a[0],a[1],a[2],a[3],a[4],a[5],1)},kt.add=function(a,h,m){return a[0]=h[0]+m[0],a[1]=h[1]+m[1],a[2]=h[2]+m[2],a[3]=h[3]+m[3],a[4]=h[4]+m[4],a[5]=h[5]+m[5],a},kt.subtract=l,kt.multiplyScalar=function(a,h,m){return a[0]=h[0]*m,a[1]=h[1]*m,a[2]=h[2]*m,a[3]=h[3]*m,a[4]=h[4]*m,a[5]=h[5]*m,a},kt.multiplyScalarAndAdd=function(a,h,m,g){return a[0]=h[0]+m[0]*g,a[1]=h[1]+m[1]*g,a[2]=h[2]+m[2]*g,a[3]=h[3]+m[3]*g,a[4]=h[4]+m[4]*g,a[5]=h[5]+m[5]*g,a},kt.exactEquals=function(a,h){return a[0]===h[0]&&a[1]===h[1]&&a[2]===h[2]&&a[3]===h[3]&&a[4]===h[4]&&a[5]===h[5]},kt.equals=function(a,h){var m=a[0],g=a[1],v=a[2],p=a[3],y=a[4],w=a[5],x=h[0],b=h[1],S=h[2],I=h[3],P=h[4],O=h[5];return Math.abs(m-x)<=e.EPSILON*Math.max(1,Math.abs(m),Math.abs(x))&&Math.abs(g-b)<=e.EPSILON*Math.max(1,Math.abs(g),Math.abs(b))&&Math.abs(v-S)<=e.EPSILON*Math.max(1,Math.abs(v),Math.abs(S))&&Math.abs(p-I)<=e.EPSILON*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(y-P)<=e.EPSILON*Math.max(1,Math.abs(y),Math.abs(P))&&Math.abs(w-O)<=e.EPSILON*Math.max(1,Math.abs(w),Math.abs(O))},kt.sub=kt.mul=void 0;var e=function(a,h){if(a&&a.__esModule)return a;if(a===null||n(a)!=="object"&&typeof a!="function")return{default:a};var m=i(void 0);if(m&&m.has(a))return m.get(a);var g={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var p in a)if(p!=="default"&&Object.prototype.hasOwnProperty.call(a,p)){var y=v?Object.getOwnPropertyDescriptor(a,p):null;y&&(y.get||y.set)?Object.defineProperty(g,p,y):g[p]=a[p]}return g.default=a,m&&m.set(a,g),g}(yi());function i(a){if(typeof WeakMap!="function")return null;var h=new WeakMap,m=new WeakMap;return(i=function(g){return g?m:h})(a)}function o(a,h,m){var g=h[0],v=h[1],p=h[2],y=h[3],w=h[4],x=h[5],b=m[0],S=m[1],I=m[2],P=m[3],O=m[4],L=m[5];return a[0]=g*b+p*S,a[1]=v*b+y*S,a[2]=g*I+p*P,a[3]=v*I+y*P,a[4]=g*O+p*L+w,a[5]=v*O+y*L+x,a}function l(a,h,m){return a[0]=h[0]-m[0],a[1]=h[1]-m[1],a[2]=h[2]-m[2],a[3]=h[3]-m[3],a[4]=h[4]-m[4],a[5]=h[5]-m[5],a}return kt.mul=o,kt.sub=l,kt}var $r,mi={};function Nn(){if($r)return mi;function n(a){return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},n(a)}$r=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.create=function(){var a=new e.ARRAY_TYPE(9);return e.ARRAY_TYPE!=Float32Array&&(a[1]=0,a[2]=0,a[3]=0,a[5]=0,a[6]=0,a[7]=0),a[0]=1,a[4]=1,a[8]=1,a},mi.fromMat4=function(a,h){return a[0]=h[0],a[1]=h[1],a[2]=h[2],a[3]=h[4],a[4]=h[5],a[5]=h[6],a[6]=h[8],a[7]=h[9],a[8]=h[10],a},mi.clone=function(a){var h=new e.ARRAY_TYPE(9);return h[0]=a[0],h[1]=a[1],h[2]=a[2],h[3]=a[3],h[4]=a[4],h[5]=a[5],h[6]=a[6],h[7]=a[7],h[8]=a[8],h},mi.copy=function(a,h){return a[0]=h[0],a[1]=h[1],a[2]=h[2],a[3]=h[3],a[4]=h[4],a[5]=h[5],a[6]=h[6],a[7]=h[7],a[8]=h[8],a},mi.fromValues=function(a,h,m,g,v,p,y,w,x){var b=new e.ARRAY_TYPE(9);return b[0]=a,b[1]=h,b[2]=m,b[3]=g,b[4]=v,b[5]=p,b[6]=y,b[7]=w,b[8]=x,b},mi.set=function(a,h,m,g,v,p,y,w,x,b){return a[0]=h,a[1]=m,a[2]=g,a[3]=v,a[4]=p,a[5]=y,a[6]=w,a[7]=x,a[8]=b,a},mi.identity=function(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},mi.transpose=function(a,h){if(a===h){var m=h[1],g=h[2],v=h[5];a[1]=h[3],a[2]=h[6],a[3]=m,a[5]=h[7],a[6]=g,a[7]=v}else a[0]=h[0],a[1]=h[3],a[2]=h[6],a[3]=h[1],a[4]=h[4],a[5]=h[7],a[6]=h[2],a[7]=h[5],a[8]=h[8];return a},mi.invert=function(a,h){var m=h[0],g=h[1],v=h[2],p=h[3],y=h[4],w=h[5],x=h[6],b=h[7],S=h[8],I=S*y-w*b,P=-S*p+w*x,O=b*p-y*x,L=m*I+g*P+v*O;return L?(a[0]=I*(L=1/L),a[1]=(-S*g+v*b)*L,a[2]=(w*g-v*y)*L,a[3]=P*L,a[4]=(S*m-v*x)*L,a[5]=(-w*m+v*p)*L,a[6]=O*L,a[7]=(-b*m+g*x)*L,a[8]=(y*m-g*p)*L,a):null},mi.adjoint=function(a,h){var m=h[0],g=h[1],v=h[2],p=h[3],y=h[4],w=h[5],x=h[6],b=h[7],S=h[8];return a[0]=y*S-w*b,a[1]=v*b-g*S,a[2]=g*w-v*y,a[3]=w*x-p*S,a[4]=m*S-v*x,a[5]=v*p-m*w,a[6]=p*b-y*x,a[7]=g*x-m*b,a[8]=m*y-g*p,a},mi.determinant=function(a){var h=a[3],m=a[4],g=a[5],v=a[6],p=a[7],y=a[8];return a[0]*(y*m-g*p)+a[1]*(-y*h+g*v)+a[2]*(p*h-m*v)},mi.multiply=o,mi.translate=function(a,h,m){var g=h[0],v=h[1],p=h[2],y=h[3],w=h[4],x=h[5],b=h[6],S=h[7],I=h[8],P=m[0],O=m[1];return a[0]=g,a[1]=v,a[2]=p,a[3]=y,a[4]=w,a[5]=x,a[6]=P*g+O*y+b,a[7]=P*v+O*w+S,a[8]=P*p+O*x+I,a},mi.rotate=function(a,h,m){var g=h[0],v=h[1],p=h[2],y=h[3],w=h[4],x=h[5],b=h[6],S=h[7],I=h[8],P=Math.sin(m),O=Math.cos(m);return a[0]=O*g+P*y,a[1]=O*v+P*w,a[2]=O*p+P*x,a[3]=O*y-P*g,a[4]=O*w-P*v,a[5]=O*x-P*p,a[6]=b,a[7]=S,a[8]=I,a},mi.scale=function(a,h,m){var g=m[0],v=m[1];return a[0]=g*h[0],a[1]=g*h[1],a[2]=g*h[2],a[3]=v*h[3],a[4]=v*h[4],a[5]=v*h[5],a[6]=h[6],a[7]=h[7],a[8]=h[8],a},mi.fromTranslation=function(a,h){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=h[0],a[7]=h[1],a[8]=1,a},mi.fromRotation=function(a,h){var m=Math.sin(h),g=Math.cos(h);return a[0]=g,a[1]=m,a[2]=0,a[3]=-m,a[4]=g,a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},mi.fromScaling=function(a,h){return a[0]=h[0],a[1]=0,a[2]=0,a[3]=0,a[4]=h[1],a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},mi.fromMat2d=function(a,h){return a[0]=h[0],a[1]=h[1],a[2]=0,a[3]=h[2],a[4]=h[3],a[5]=0,a[6]=h[4],a[7]=h[5],a[8]=1,a},mi.fromQuat=function(a,h){var m=h[0],g=h[1],v=h[2],p=h[3],y=m+m,w=g+g,x=v+v,b=m*y,S=g*y,I=g*w,P=v*y,O=v*w,L=v*x,D=p*y,F=p*w,V=p*x;return a[0]=1-I-L,a[3]=S-V,a[6]=P+F,a[1]=S+V,a[4]=1-b-L,a[7]=O-D,a[2]=P-F,a[5]=O+D,a[8]=1-b-I,a},mi.normalFromMat4=function(a,h){var m=h[0],g=h[1],v=h[2],p=h[3],y=h[4],w=h[5],x=h[6],b=h[7],S=h[8],I=h[9],P=h[10],O=h[11],L=h[12],D=h[13],F=h[14],V=h[15],q=m*w-g*y,J=m*x-v*y,X=m*b-p*y,Y=g*x-v*w,le=g*b-p*w,ee=v*b-p*x,ce=S*D-I*L,me=S*F-P*L,pe=S*V-O*L,xe=I*F-P*D,ye=I*V-O*D,Ee=P*V-O*F,we=q*Ee-J*ye+X*xe+Y*pe-le*me+ee*ce;return we?(a[0]=(w*Ee-x*ye+b*xe)*(we=1/we),a[1]=(x*pe-y*Ee-b*me)*we,a[2]=(y*ye-w*pe+b*ce)*we,a[3]=(v*ye-g*Ee-p*xe)*we,a[4]=(m*Ee-v*pe+p*me)*we,a[5]=(g*pe-m*ye-p*ce)*we,a[6]=(D*ee-F*le+V*Y)*we,a[7]=(F*X-L*ee-V*J)*we,a[8]=(L*le-D*X+V*q)*we,a):null},mi.projection=function(a,h,m){return a[0]=2/h,a[1]=0,a[2]=0,a[3]=0,a[4]=-2/m,a[5]=0,a[6]=-1,a[7]=1,a[8]=1,a},mi.str=function(a){return"mat3("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+")"},mi.frob=function(a){return Math.hypot(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])},mi.add=function(a,h,m){return a[0]=h[0]+m[0],a[1]=h[1]+m[1],a[2]=h[2]+m[2],a[3]=h[3]+m[3],a[4]=h[4]+m[4],a[5]=h[5]+m[5],a[6]=h[6]+m[6],a[7]=h[7]+m[7],a[8]=h[8]+m[8],a},mi.subtract=l,mi.multiplyScalar=function(a,h,m){return a[0]=h[0]*m,a[1]=h[1]*m,a[2]=h[2]*m,a[3]=h[3]*m,a[4]=h[4]*m,a[5]=h[5]*m,a[6]=h[6]*m,a[7]=h[7]*m,a[8]=h[8]*m,a},mi.multiplyScalarAndAdd=function(a,h,m,g){return a[0]=h[0]+m[0]*g,a[1]=h[1]+m[1]*g,a[2]=h[2]+m[2]*g,a[3]=h[3]+m[3]*g,a[4]=h[4]+m[4]*g,a[5]=h[5]+m[5]*g,a[6]=h[6]+m[6]*g,a[7]=h[7]+m[7]*g,a[8]=h[8]+m[8]*g,a},mi.exactEquals=function(a,h){return a[0]===h[0]&&a[1]===h[1]&&a[2]===h[2]&&a[3]===h[3]&&a[4]===h[4]&&a[5]===h[5]&&a[6]===h[6]&&a[7]===h[7]&&a[8]===h[8]},mi.equals=function(a,h){var m=a[0],g=a[1],v=a[2],p=a[3],y=a[4],w=a[5],x=a[6],b=a[7],S=a[8],I=h[0],P=h[1],O=h[2],L=h[3],D=h[4],F=h[5],V=h[6],q=h[7],J=h[8];return Math.abs(m-I)<=e.EPSILON*Math.max(1,Math.abs(m),Math.abs(I))&&Math.abs(g-P)<=e.EPSILON*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(v-O)<=e.EPSILON*Math.max(1,Math.abs(v),Math.abs(O))&&Math.abs(p-L)<=e.EPSILON*Math.max(1,Math.abs(p),Math.abs(L))&&Math.abs(y-D)<=e.EPSILON*Math.max(1,Math.abs(y),Math.abs(D))&&Math.abs(w-F)<=e.EPSILON*Math.max(1,Math.abs(w),Math.abs(F))&&Math.abs(x-V)<=e.EPSILON*Math.max(1,Math.abs(x),Math.abs(V))&&Math.abs(b-q)<=e.EPSILON*Math.max(1,Math.abs(b),Math.abs(q))&&Math.abs(S-J)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(J))},mi.sub=mi.mul=void 0;var e=function(a,h){if(a&&a.__esModule)return a;if(a===null||n(a)!=="object"&&typeof a!="function")return{default:a};var m=i(void 0);if(m&&m.has(a))return m.get(a);var g={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var p in a)if(p!=="default"&&Object.prototype.hasOwnProperty.call(a,p)){var y=v?Object.getOwnPropertyDescriptor(a,p):null;y&&(y.get||y.set)?Object.defineProperty(g,p,y):g[p]=a[p]}return g.default=a,m&&m.set(a,g),g}(yi());function i(a){if(typeof WeakMap!="function")return null;var h=new WeakMap,m=new WeakMap;return(i=function(g){return g?m:h})(a)}function o(a,h,m){var g=h[0],v=h[1],p=h[2],y=h[3],w=h[4],x=h[5],b=h[6],S=h[7],I=h[8],P=m[0],O=m[1],L=m[2],D=m[3],F=m[4],V=m[5],q=m[6],J=m[7],X=m[8];return a[0]=P*g+O*y+L*b,a[1]=P*v+O*w+L*S,a[2]=P*p+O*x+L*I,a[3]=D*g+F*y+V*b,a[4]=D*v+F*w+V*S,a[5]=D*p+F*x+V*I,a[6]=q*g+J*y+X*b,a[7]=q*v+J*w+X*S,a[8]=q*p+J*x+X*I,a}function l(a,h,m){return a[0]=h[0]-m[0],a[1]=h[1]-m[1],a[2]=h[2]-m[2],a[3]=h[3]-m[3],a[4]=h[4]-m[4],a[5]=h[5]-m[5],a[6]=h[6]-m[6],a[7]=h[7]-m[7],a[8]=h[8]-m[8],a}return mi.mul=o,mi.sub=l,mi}var Co,vt={};function dn(){if(Co)return vt;function n(p){return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},n(p)}Co=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.create=function(){var p=new e.ARRAY_TYPE(16);return e.ARRAY_TYPE!=Float32Array&&(p[1]=0,p[2]=0,p[3]=0,p[4]=0,p[6]=0,p[7]=0,p[8]=0,p[9]=0,p[11]=0,p[12]=0,p[13]=0,p[14]=0),p[0]=1,p[5]=1,p[10]=1,p[15]=1,p},vt.clone=function(p){var y=new e.ARRAY_TYPE(16);return y[0]=p[0],y[1]=p[1],y[2]=p[2],y[3]=p[3],y[4]=p[4],y[5]=p[5],y[6]=p[6],y[7]=p[7],y[8]=p[8],y[9]=p[9],y[10]=p[10],y[11]=p[11],y[12]=p[12],y[13]=p[13],y[14]=p[14],y[15]=p[15],y},vt.copy=function(p,y){return p[0]=y[0],p[1]=y[1],p[2]=y[2],p[3]=y[3],p[4]=y[4],p[5]=y[5],p[6]=y[6],p[7]=y[7],p[8]=y[8],p[9]=y[9],p[10]=y[10],p[11]=y[11],p[12]=y[12],p[13]=y[13],p[14]=y[14],p[15]=y[15],p},vt.fromValues=function(p,y,w,x,b,S,I,P,O,L,D,F,V,q,J,X){var Y=new e.ARRAY_TYPE(16);return Y[0]=p,Y[1]=y,Y[2]=w,Y[3]=x,Y[4]=b,Y[5]=S,Y[6]=I,Y[7]=P,Y[8]=O,Y[9]=L,Y[10]=D,Y[11]=F,Y[12]=V,Y[13]=q,Y[14]=J,Y[15]=X,Y},vt.set=function(p,y,w,x,b,S,I,P,O,L,D,F,V,q,J,X,Y){return p[0]=y,p[1]=w,p[2]=x,p[3]=b,p[4]=S,p[5]=I,p[6]=P,p[7]=O,p[8]=L,p[9]=D,p[10]=F,p[11]=V,p[12]=q,p[13]=J,p[14]=X,p[15]=Y,p},vt.identity=o,vt.transpose=function(p,y){if(p===y){var w=y[1],x=y[2],b=y[3],S=y[6],I=y[7],P=y[11];p[1]=y[4],p[2]=y[8],p[3]=y[12],p[4]=w,p[6]=y[9],p[7]=y[13],p[8]=x,p[9]=S,p[11]=y[14],p[12]=b,p[13]=I,p[14]=P}else p[0]=y[0],p[1]=y[4],p[2]=y[8],p[3]=y[12],p[4]=y[1],p[5]=y[5],p[6]=y[9],p[7]=y[13],p[8]=y[2],p[9]=y[6],p[10]=y[10],p[11]=y[14],p[12]=y[3],p[13]=y[7],p[14]=y[11],p[15]=y[15];return p},vt.invert=function(p,y){var w=y[0],x=y[1],b=y[2],S=y[3],I=y[4],P=y[5],O=y[6],L=y[7],D=y[8],F=y[9],V=y[10],q=y[11],J=y[12],X=y[13],Y=y[14],le=y[15],ee=w*P-x*I,ce=w*O-b*I,me=w*L-S*I,pe=x*O-b*P,xe=x*L-S*P,ye=b*L-S*O,Ee=D*X-F*J,we=D*Y-V*J,Ae=D*le-q*J,$e=F*Y-V*X,Ge=F*le-q*X,lt=V*le-q*Y,Ze=ee*lt-ce*Ge+me*$e+pe*Ae-xe*we+ye*Ee;return Ze?(p[0]=(P*lt-O*Ge+L*$e)*(Ze=1/Ze),p[1]=(b*Ge-x*lt-S*$e)*Ze,p[2]=(X*ye-Y*xe+le*pe)*Ze,p[3]=(V*xe-F*ye-q*pe)*Ze,p[4]=(O*Ae-I*lt-L*we)*Ze,p[5]=(w*lt-b*Ae+S*we)*Ze,p[6]=(Y*me-J*ye-le*ce)*Ze,p[7]=(D*ye-V*me+q*ce)*Ze,p[8]=(I*Ge-P*Ae+L*Ee)*Ze,p[9]=(x*Ae-w*Ge-S*Ee)*Ze,p[10]=(J*xe-X*me+le*ee)*Ze,p[11]=(F*me-D*xe-q*ee)*Ze,p[12]=(P*we-I*$e-O*Ee)*Ze,p[13]=(w*$e-x*we+b*Ee)*Ze,p[14]=(X*ce-J*pe-Y*ee)*Ze,p[15]=(D*pe-F*ce+V*ee)*Ze,p):null},vt.adjoint=function(p,y){var w=y[0],x=y[1],b=y[2],S=y[3],I=y[4],P=y[5],O=y[6],L=y[7],D=y[8],F=y[9],V=y[10],q=y[11],J=y[12],X=y[13],Y=y[14],le=y[15];return p[0]=P*(V*le-q*Y)-F*(O*le-L*Y)+X*(O*q-L*V),p[1]=-(x*(V*le-q*Y)-F*(b*le-S*Y)+X*(b*q-S*V)),p[2]=x*(O*le-L*Y)-P*(b*le-S*Y)+X*(b*L-S*O),p[3]=-(x*(O*q-L*V)-P*(b*q-S*V)+F*(b*L-S*O)),p[4]=-(I*(V*le-q*Y)-D*(O*le-L*Y)+J*(O*q-L*V)),p[5]=w*(V*le-q*Y)-D*(b*le-S*Y)+J*(b*q-S*V),p[6]=-(w*(O*le-L*Y)-I*(b*le-S*Y)+J*(b*L-S*O)),p[7]=w*(O*q-L*V)-I*(b*q-S*V)+D*(b*L-S*O),p[8]=I*(F*le-q*X)-D*(P*le-L*X)+J*(P*q-L*F),p[9]=-(w*(F*le-q*X)-D*(x*le-S*X)+J*(x*q-S*F)),p[10]=w*(P*le-L*X)-I*(x*le-S*X)+J*(x*L-S*P),p[11]=-(w*(P*q-L*F)-I*(x*q-S*F)+D*(x*L-S*P)),p[12]=-(I*(F*Y-V*X)-D*(P*Y-O*X)+J*(P*V-O*F)),p[13]=w*(F*Y-V*X)-D*(x*Y-b*X)+J*(x*V-b*F),p[14]=-(w*(P*Y-O*X)-I*(x*Y-b*X)+J*(x*O-b*P)),p[15]=w*(P*V-O*F)-I*(x*V-b*F)+D*(x*O-b*P),p},vt.determinant=function(p){var y=p[0],w=p[1],x=p[2],b=p[3],S=p[4],I=p[5],P=p[6],O=p[7],L=p[8],D=p[9],F=p[10],V=p[11],q=p[12],J=p[13],X=p[14],Y=p[15];return(y*I-w*S)*(F*Y-V*X)-(y*P-x*S)*(D*Y-V*J)+(y*O-b*S)*(D*X-F*J)+(w*P-x*I)*(L*Y-V*q)-(w*O-b*I)*(L*X-F*q)+(x*O-b*P)*(L*J-D*q)},vt.multiply=l,vt.translate=function(p,y,w){var x,b,S,I,P,O,L,D,F,V,q,J,X=w[0],Y=w[1],le=w[2];return y===p?(p[12]=y[0]*X+y[4]*Y+y[8]*le+y[12],p[13]=y[1]*X+y[5]*Y+y[9]*le+y[13],p[14]=y[2]*X+y[6]*Y+y[10]*le+y[14],p[15]=y[3]*X+y[7]*Y+y[11]*le+y[15]):(b=y[1],S=y[2],I=y[3],P=y[4],O=y[5],L=y[6],D=y[7],F=y[8],V=y[9],q=y[10],J=y[11],p[0]=x=y[0],p[1]=b,p[2]=S,p[3]=I,p[4]=P,p[5]=O,p[6]=L,p[7]=D,p[8]=F,p[9]=V,p[10]=q,p[11]=J,p[12]=x*X+P*Y+F*le+y[12],p[13]=b*X+O*Y+V*le+y[13],p[14]=S*X+L*Y+q*le+y[14],p[15]=I*X+D*Y+J*le+y[15]),p},vt.scale=function(p,y,w){var x=w[0],b=w[1],S=w[2];return p[0]=y[0]*x,p[1]=y[1]*x,p[2]=y[2]*x,p[3]=y[3]*x,p[4]=y[4]*b,p[5]=y[5]*b,p[6]=y[6]*b,p[7]=y[7]*b,p[8]=y[8]*S,p[9]=y[9]*S,p[10]=y[10]*S,p[11]=y[11]*S,p[12]=y[12],p[13]=y[13],p[14]=y[14],p[15]=y[15],p},vt.rotate=function(p,y,w,x){var b,S,I,P,O,L,D,F,V,q,J,X,Y,le,ee,ce,me,pe,xe,ye,Ee,we,Ae,$e,Ge=x[0],lt=x[1],Ze=x[2],Ke=Math.hypot(Ge,lt,Ze);return Ke0?(w[0]=2*(P*I+D*x+O*S-L*b)/F,w[1]=2*(O*I+D*b+L*x-P*S)/F,w[2]=2*(L*I+D*S+P*b-O*x)/F):(w[0]=2*(P*I+D*x+O*S-L*b),w[1]=2*(O*I+D*b+L*x-P*S),w[2]=2*(L*I+D*S+P*b-O*x)),a(p,y,w),p},vt.getTranslation=function(p,y){return p[0]=y[12],p[1]=y[13],p[2]=y[14],p},vt.getScaling=h,vt.getRotation=function(p,y){var w=new e.ARRAY_TYPE(3);h(w,y);var x=1/w[0],b=1/w[1],S=1/w[2],I=y[0]*x,P=y[1]*b,O=y[2]*S,L=y[4]*x,D=y[5]*b,F=y[6]*S,V=y[8]*x,q=y[9]*b,J=y[10]*S,X=I+D+J,Y=0;return X>0?(Y=2*Math.sqrt(X+1),p[3]=.25*Y,p[0]=(F-q)/Y,p[1]=(V-O)/Y,p[2]=(P-L)/Y):I>D&&I>J?(Y=2*Math.sqrt(1+I-D-J),p[3]=(F-q)/Y,p[0]=.25*Y,p[1]=(P+L)/Y,p[2]=(V+O)/Y):D>J?(Y=2*Math.sqrt(1+D-I-J),p[3]=(V-O)/Y,p[0]=(P+L)/Y,p[1]=.25*Y,p[2]=(F+q)/Y):(Y=2*Math.sqrt(1+J-I-D),p[3]=(P-L)/Y,p[0]=(V+O)/Y,p[1]=(F+q)/Y,p[2]=.25*Y),p},vt.fromRotationTranslationScale=function(p,y,w,x){var b=y[0],S=y[1],I=y[2],P=y[3],O=b+b,L=S+S,D=I+I,F=b*O,V=b*L,q=b*D,J=S*L,X=S*D,Y=I*D,le=P*O,ee=P*L,ce=P*D,me=x[0],pe=x[1],xe=x[2];return p[0]=(1-(J+Y))*me,p[1]=(V+ce)*me,p[2]=(q-ee)*me,p[3]=0,p[4]=(V-ce)*pe,p[5]=(1-(F+Y))*pe,p[6]=(X+le)*pe,p[7]=0,p[8]=(q+ee)*xe,p[9]=(X-le)*xe,p[10]=(1-(F+J))*xe,p[11]=0,p[12]=w[0],p[13]=w[1],p[14]=w[2],p[15]=1,p},vt.fromRotationTranslationScaleOrigin=function(p,y,w,x,b){var S=y[0],I=y[1],P=y[2],O=y[3],L=S+S,D=I+I,F=P+P,V=S*L,q=S*D,J=S*F,X=I*D,Y=I*F,le=P*F,ee=O*L,ce=O*D,me=O*F,pe=x[0],xe=x[1],ye=x[2],Ee=b[0],we=b[1],Ae=b[2],$e=(1-(X+le))*pe,Ge=(q+me)*pe,lt=(J-ce)*pe,Ze=(q-me)*xe,Ke=(1-(V+le))*xe,He=(Y+ee)*xe,wt=(J+ce)*ye,rt=(Y-ee)*ye,pt=(1-(V+X))*ye;return p[0]=$e,p[1]=Ge,p[2]=lt,p[3]=0,p[4]=Ze,p[5]=Ke,p[6]=He,p[7]=0,p[8]=wt,p[9]=rt,p[10]=pt,p[11]=0,p[12]=w[0]+Ee-($e*Ee+Ze*we+wt*Ae),p[13]=w[1]+we-(Ge*Ee+Ke*we+rt*Ae),p[14]=w[2]+Ae-(lt*Ee+He*we+pt*Ae),p[15]=1,p},vt.fromQuat=function(p,y){var w=y[0],x=y[1],b=y[2],S=y[3],I=w+w,P=x+x,O=b+b,L=w*I,D=x*I,F=x*P,V=b*I,q=b*P,J=b*O,X=S*I,Y=S*P,le=S*O;return p[0]=1-F-J,p[1]=D+le,p[2]=V-Y,p[3]=0,p[4]=D-le,p[5]=1-L-J,p[6]=q+X,p[7]=0,p[8]=V+Y,p[9]=q-X,p[10]=1-L-F,p[11]=0,p[12]=0,p[13]=0,p[14]=0,p[15]=1,p},vt.frustum=function(p,y,w,x,b,S,I){var P=1/(w-y),O=1/(b-x),L=1/(S-I);return p[0]=2*S*P,p[1]=0,p[2]=0,p[3]=0,p[4]=0,p[5]=2*S*O,p[6]=0,p[7]=0,p[8]=(w+y)*P,p[9]=(b+x)*O,p[10]=(I+S)*L,p[11]=-1,p[12]=0,p[13]=0,p[14]=I*S*2*L,p[15]=0,p},vt.perspectiveNO=m,vt.perspectiveZO=function(p,y,w,x,b){var S,I=1/Math.tan(y/2);return p[0]=I/w,p[1]=0,p[2]=0,p[3]=0,p[4]=0,p[5]=I,p[6]=0,p[7]=0,p[8]=0,p[9]=0,p[11]=-1,p[12]=0,p[13]=0,p[15]=0,b!=null&&b!==1/0?(p[10]=b*(S=1/(x-b)),p[14]=b*x*S):(p[10]=-1,p[14]=-x),p},vt.perspectiveFromFieldOfView=function(p,y,w,x){var b=Math.tan(y.upDegrees*Math.PI/180),S=Math.tan(y.downDegrees*Math.PI/180),I=Math.tan(y.leftDegrees*Math.PI/180),P=Math.tan(y.rightDegrees*Math.PI/180),O=2/(I+P),L=2/(b+S);return p[0]=O,p[1]=0,p[2]=0,p[3]=0,p[4]=0,p[5]=L,p[6]=0,p[7]=0,p[8]=-(I-P)*O*.5,p[9]=(b-S)*L*.5,p[10]=x/(w-x),p[11]=-1,p[12]=0,p[13]=0,p[14]=x*w/(w-x),p[15]=0,p},vt.orthoNO=g,vt.orthoZO=function(p,y,w,x,b,S,I){var P=1/(y-w),O=1/(x-b),L=1/(S-I);return p[0]=-2*P,p[1]=0,p[2]=0,p[3]=0,p[4]=0,p[5]=-2*O,p[6]=0,p[7]=0,p[8]=0,p[9]=0,p[10]=L,p[11]=0,p[12]=(y+w)*P,p[13]=(b+x)*O,p[14]=S*L,p[15]=1,p},vt.lookAt=function(p,y,w,x){var b,S,I,P,O,L,D,F,V,q,J=y[0],X=y[1],Y=y[2],le=x[0],ee=x[1],ce=x[2],me=w[0],pe=w[1],xe=w[2];return Math.abs(J-me)0&&(D*=q=1/Math.sqrt(q),F*=q,V*=q);var J=O*V-L*F,X=L*D-P*V,Y=P*F-O*D;return(q=J*J+X*X+Y*Y)>0&&(J*=q=1/Math.sqrt(q),X*=q,Y*=q),p[0]=J,p[1]=X,p[2]=Y,p[3]=0,p[4]=F*Y-V*X,p[5]=V*J-D*Y,p[6]=D*X-F*J,p[7]=0,p[8]=D,p[9]=F,p[10]=V,p[11]=0,p[12]=b,p[13]=S,p[14]=I,p[15]=1,p},vt.str=function(p){return"mat4("+p[0]+", "+p[1]+", "+p[2]+", "+p[3]+", "+p[4]+", "+p[5]+", "+p[6]+", "+p[7]+", "+p[8]+", "+p[9]+", "+p[10]+", "+p[11]+", "+p[12]+", "+p[13]+", "+p[14]+", "+p[15]+")"},vt.frob=function(p){return Math.hypot(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],p[9],p[10],p[11],p[12],p[13],p[14],p[15])},vt.add=function(p,y,w){return p[0]=y[0]+w[0],p[1]=y[1]+w[1],p[2]=y[2]+w[2],p[3]=y[3]+w[3],p[4]=y[4]+w[4],p[5]=y[5]+w[5],p[6]=y[6]+w[6],p[7]=y[7]+w[7],p[8]=y[8]+w[8],p[9]=y[9]+w[9],p[10]=y[10]+w[10],p[11]=y[11]+w[11],p[12]=y[12]+w[12],p[13]=y[13]+w[13],p[14]=y[14]+w[14],p[15]=y[15]+w[15],p},vt.subtract=v,vt.multiplyScalar=function(p,y,w){return p[0]=y[0]*w,p[1]=y[1]*w,p[2]=y[2]*w,p[3]=y[3]*w,p[4]=y[4]*w,p[5]=y[5]*w,p[6]=y[6]*w,p[7]=y[7]*w,p[8]=y[8]*w,p[9]=y[9]*w,p[10]=y[10]*w,p[11]=y[11]*w,p[12]=y[12]*w,p[13]=y[13]*w,p[14]=y[14]*w,p[15]=y[15]*w,p},vt.multiplyScalarAndAdd=function(p,y,w,x){return p[0]=y[0]+w[0]*x,p[1]=y[1]+w[1]*x,p[2]=y[2]+w[2]*x,p[3]=y[3]+w[3]*x,p[4]=y[4]+w[4]*x,p[5]=y[5]+w[5]*x,p[6]=y[6]+w[6]*x,p[7]=y[7]+w[7]*x,p[8]=y[8]+w[8]*x,p[9]=y[9]+w[9]*x,p[10]=y[10]+w[10]*x,p[11]=y[11]+w[11]*x,p[12]=y[12]+w[12]*x,p[13]=y[13]+w[13]*x,p[14]=y[14]+w[14]*x,p[15]=y[15]+w[15]*x,p},vt.exactEquals=function(p,y){return p[0]===y[0]&&p[1]===y[1]&&p[2]===y[2]&&p[3]===y[3]&&p[4]===y[4]&&p[5]===y[5]&&p[6]===y[6]&&p[7]===y[7]&&p[8]===y[8]&&p[9]===y[9]&&p[10]===y[10]&&p[11]===y[11]&&p[12]===y[12]&&p[13]===y[13]&&p[14]===y[14]&&p[15]===y[15]},vt.equals=function(p,y){var w=p[0],x=p[1],b=p[2],S=p[3],I=p[4],P=p[5],O=p[6],L=p[7],D=p[8],F=p[9],V=p[10],q=p[11],J=p[12],X=p[13],Y=p[14],le=p[15],ee=y[0],ce=y[1],me=y[2],pe=y[3],xe=y[4],ye=y[5],Ee=y[6],we=y[7],Ae=y[8],$e=y[9],Ge=y[10],lt=y[11],Ze=y[12],Ke=y[13],He=y[14],wt=y[15];return Math.abs(w-ee)<=e.EPSILON*Math.max(1,Math.abs(w),Math.abs(ee))&&Math.abs(x-ce)<=e.EPSILON*Math.max(1,Math.abs(x),Math.abs(ce))&&Math.abs(b-me)<=e.EPSILON*Math.max(1,Math.abs(b),Math.abs(me))&&Math.abs(S-pe)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(pe))&&Math.abs(I-xe)<=e.EPSILON*Math.max(1,Math.abs(I),Math.abs(xe))&&Math.abs(P-ye)<=e.EPSILON*Math.max(1,Math.abs(P),Math.abs(ye))&&Math.abs(O-Ee)<=e.EPSILON*Math.max(1,Math.abs(O),Math.abs(Ee))&&Math.abs(L-we)<=e.EPSILON*Math.max(1,Math.abs(L),Math.abs(we))&&Math.abs(D-Ae)<=e.EPSILON*Math.max(1,Math.abs(D),Math.abs(Ae))&&Math.abs(F-$e)<=e.EPSILON*Math.max(1,Math.abs(F),Math.abs($e))&&Math.abs(V-Ge)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(Ge))&&Math.abs(q-lt)<=e.EPSILON*Math.max(1,Math.abs(q),Math.abs(lt))&&Math.abs(J-Ze)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(Ze))&&Math.abs(X-Ke)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(Ke))&&Math.abs(Y-He)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(He))&&Math.abs(le-wt)<=e.EPSILON*Math.max(1,Math.abs(le),Math.abs(wt))},vt.sub=vt.mul=vt.ortho=vt.perspective=void 0;var e=function(p,y){if(p&&p.__esModule)return p;if(p===null||n(p)!=="object"&&typeof p!="function")return{default:p};var w=i(void 0);if(w&&w.has(p))return w.get(p);var x={},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in p)if(S!=="default"&&Object.prototype.hasOwnProperty.call(p,S)){var I=b?Object.getOwnPropertyDescriptor(p,S):null;I&&(I.get||I.set)?Object.defineProperty(x,S,I):x[S]=p[S]}return x.default=p,w&&w.set(p,x),x}(yi());function i(p){if(typeof WeakMap!="function")return null;var y=new WeakMap,w=new WeakMap;return(i=function(x){return x?w:y})(p)}function o(p){return p[0]=1,p[1]=0,p[2]=0,p[3]=0,p[4]=0,p[5]=1,p[6]=0,p[7]=0,p[8]=0,p[9]=0,p[10]=1,p[11]=0,p[12]=0,p[13]=0,p[14]=0,p[15]=1,p}function l(p,y,w){var x=y[0],b=y[1],S=y[2],I=y[3],P=y[4],O=y[5],L=y[6],D=y[7],F=y[8],V=y[9],q=y[10],J=y[11],X=y[12],Y=y[13],le=y[14],ee=y[15],ce=w[0],me=w[1],pe=w[2],xe=w[3];return p[0]=ce*x+me*P+pe*F+xe*X,p[1]=ce*b+me*O+pe*V+xe*Y,p[2]=ce*S+me*L+pe*q+xe*le,p[3]=ce*I+me*D+pe*J+xe*ee,p[4]=(ce=w[4])*x+(me=w[5])*P+(pe=w[6])*F+(xe=w[7])*X,p[5]=ce*b+me*O+pe*V+xe*Y,p[6]=ce*S+me*L+pe*q+xe*le,p[7]=ce*I+me*D+pe*J+xe*ee,p[8]=(ce=w[8])*x+(me=w[9])*P+(pe=w[10])*F+(xe=w[11])*X,p[9]=ce*b+me*O+pe*V+xe*Y,p[10]=ce*S+me*L+pe*q+xe*le,p[11]=ce*I+me*D+pe*J+xe*ee,p[12]=(ce=w[12])*x+(me=w[13])*P+(pe=w[14])*F+(xe=w[15])*X,p[13]=ce*b+me*O+pe*V+xe*Y,p[14]=ce*S+me*L+pe*q+xe*le,p[15]=ce*I+me*D+pe*J+xe*ee,p}function a(p,y,w){var x=y[0],b=y[1],S=y[2],I=y[3],P=x+x,O=b+b,L=S+S,D=x*P,F=x*O,V=x*L,q=b*O,J=b*L,X=S*L,Y=I*P,le=I*O,ee=I*L;return p[0]=1-(q+X),p[1]=F+ee,p[2]=V-le,p[3]=0,p[4]=F-ee,p[5]=1-(D+X),p[6]=J+Y,p[7]=0,p[8]=V+le,p[9]=J-Y,p[10]=1-(D+q),p[11]=0,p[12]=w[0],p[13]=w[1],p[14]=w[2],p[15]=1,p}function h(p,y){var w=y[4],x=y[5],b=y[6],S=y[8],I=y[9],P=y[10];return p[0]=Math.hypot(y[0],y[1],y[2]),p[1]=Math.hypot(w,x,b),p[2]=Math.hypot(S,I,P),p}function m(p,y,w,x,b){var S,I=1/Math.tan(y/2);return p[0]=I/w,p[1]=0,p[2]=0,p[3]=0,p[4]=0,p[5]=I,p[6]=0,p[7]=0,p[8]=0,p[9]=0,p[11]=-1,p[12]=0,p[13]=0,p[15]=0,b!=null&&b!==1/0?(p[10]=(b+x)*(S=1/(x-b)),p[14]=2*b*x*S):(p[10]=-1,p[14]=-2*x),p}function g(p,y,w,x,b,S,I){var P=1/(y-w),O=1/(x-b),L=1/(S-I);return p[0]=-2*P,p[1]=0,p[2]=0,p[3]=0,p[4]=0,p[5]=-2*O,p[6]=0,p[7]=0,p[8]=0,p[9]=0,p[10]=2*L,p[11]=0,p[12]=(y+w)*P,p[13]=(b+x)*O,p[14]=(I+S)*L,p[15]=1,p}function v(p,y,w){return p[0]=y[0]-w[0],p[1]=y[1]-w[1],p[2]=y[2]-w[2],p[3]=y[3]-w[3],p[4]=y[4]-w[4],p[5]=y[5]-w[5],p[6]=y[6]-w[6],p[7]=y[7]-w[7],p[8]=y[8]-w[8],p[9]=y[9]-w[9],p[10]=y[10]-w[10],p[11]=y[11]-w[11],p[12]=y[12]-w[12],p[13]=y[13]-w[13],p[14]=y[14]-w[14],p[15]=y[15]-w[15],p}return vt.perspective=m,vt.ortho=g,vt.mul=l,vt.sub=v,vt}var zo,Ft={},Ut={};function Ro(){if(zo)return Ut;function n(b){return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(S){return typeof S}:function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},n(b)}zo=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.create=o,Ut.clone=function(b){var S=new e.ARRAY_TYPE(3);return S[0]=b[0],S[1]=b[1],S[2]=b[2],S},Ut.length=l,Ut.fromValues=function(b,S,I){var P=new e.ARRAY_TYPE(3);return P[0]=b,P[1]=S,P[2]=I,P},Ut.copy=function(b,S){return b[0]=S[0],b[1]=S[1],b[2]=S[2],b},Ut.set=function(b,S,I,P){return b[0]=S,b[1]=I,b[2]=P,b},Ut.add=function(b,S,I){return b[0]=S[0]+I[0],b[1]=S[1]+I[1],b[2]=S[2]+I[2],b},Ut.subtract=a,Ut.multiply=h,Ut.divide=m,Ut.ceil=function(b,S){return b[0]=Math.ceil(S[0]),b[1]=Math.ceil(S[1]),b[2]=Math.ceil(S[2]),b},Ut.floor=function(b,S){return b[0]=Math.floor(S[0]),b[1]=Math.floor(S[1]),b[2]=Math.floor(S[2]),b},Ut.min=function(b,S,I){return b[0]=Math.min(S[0],I[0]),b[1]=Math.min(S[1],I[1]),b[2]=Math.min(S[2],I[2]),b},Ut.max=function(b,S,I){return b[0]=Math.max(S[0],I[0]),b[1]=Math.max(S[1],I[1]),b[2]=Math.max(S[2],I[2]),b},Ut.round=function(b,S){return b[0]=Math.round(S[0]),b[1]=Math.round(S[1]),b[2]=Math.round(S[2]),b},Ut.scale=function(b,S,I){return b[0]=S[0]*I,b[1]=S[1]*I,b[2]=S[2]*I,b},Ut.scaleAndAdd=function(b,S,I,P){return b[0]=S[0]+I[0]*P,b[1]=S[1]+I[1]*P,b[2]=S[2]+I[2]*P,b},Ut.distance=g,Ut.squaredDistance=v,Ut.squaredLength=p,Ut.negate=function(b,S){return b[0]=-S[0],b[1]=-S[1],b[2]=-S[2],b},Ut.inverse=function(b,S){return b[0]=1/S[0],b[1]=1/S[1],b[2]=1/S[2],b},Ut.normalize=function(b,S){var I=S[0],P=S[1],O=S[2],L=I*I+P*P+O*O;return L>0&&(L=1/Math.sqrt(L)),b[0]=S[0]*L,b[1]=S[1]*L,b[2]=S[2]*L,b},Ut.dot=y,Ut.cross=function(b,S,I){var P=S[0],O=S[1],L=S[2],D=I[0],F=I[1],V=I[2];return b[0]=O*V-L*F,b[1]=L*D-P*V,b[2]=P*F-O*D,b},Ut.lerp=function(b,S,I,P){var O=S[0],L=S[1],D=S[2];return b[0]=O+P*(I[0]-O),b[1]=L+P*(I[1]-L),b[2]=D+P*(I[2]-D),b},Ut.hermite=function(b,S,I,P,O,L){var D=L*L,F=D*(2*L-3)+1,V=D*(L-2)+L,q=D*(L-1),J=D*(3-2*L);return b[0]=S[0]*F+I[0]*V+P[0]*q+O[0]*J,b[1]=S[1]*F+I[1]*V+P[1]*q+O[1]*J,b[2]=S[2]*F+I[2]*V+P[2]*q+O[2]*J,b},Ut.bezier=function(b,S,I,P,O,L){var D=1-L,F=D*D,V=L*L,q=F*D,J=3*L*F,X=3*V*D,Y=V*L;return b[0]=S[0]*q+I[0]*J+P[0]*X+O[0]*Y,b[1]=S[1]*q+I[1]*J+P[1]*X+O[1]*Y,b[2]=S[2]*q+I[2]*J+P[2]*X+O[2]*Y,b},Ut.random=function(b,S){S=S||1;var I=2*e.RANDOM()*Math.PI,P=2*e.RANDOM()-1,O=Math.sqrt(1-P*P)*S;return b[0]=Math.cos(I)*O,b[1]=Math.sin(I)*O,b[2]=P*S,b},Ut.transformMat4=function(b,S,I){var P=S[0],O=S[1],L=S[2],D=I[3]*P+I[7]*O+I[11]*L+I[15];return b[0]=(I[0]*P+I[4]*O+I[8]*L+I[12])/(D=D||1),b[1]=(I[1]*P+I[5]*O+I[9]*L+I[13])/D,b[2]=(I[2]*P+I[6]*O+I[10]*L+I[14])/D,b},Ut.transformMat3=function(b,S,I){var P=S[0],O=S[1],L=S[2];return b[0]=P*I[0]+O*I[3]+L*I[6],b[1]=P*I[1]+O*I[4]+L*I[7],b[2]=P*I[2]+O*I[5]+L*I[8],b},Ut.transformQuat=function(b,S,I){var P=I[0],O=I[1],L=I[2],D=S[0],F=S[1],V=S[2],q=O*V-L*F,J=L*D-P*V,X=P*F-O*D,Y=O*X-L*J,le=L*q-P*X,ee=P*J-O*q,ce=2*I[3];return J*=ce,X*=ce,le*=2,ee*=2,b[0]=D+(q*=ce)+(Y*=2),b[1]=F+J+le,b[2]=V+X+ee,b},Ut.rotateX=function(b,S,I,P){var O=[],L=[];return O[0]=S[0]-I[0],O[1]=S[1]-I[1],O[2]=S[2]-I[2],L[0]=O[0],L[1]=O[1]*Math.cos(P)-O[2]*Math.sin(P),L[2]=O[1]*Math.sin(P)+O[2]*Math.cos(P),b[0]=L[0]+I[0],b[1]=L[1]+I[1],b[2]=L[2]+I[2],b},Ut.rotateY=function(b,S,I,P){var O=[],L=[];return O[0]=S[0]-I[0],O[1]=S[1]-I[1],O[2]=S[2]-I[2],L[0]=O[2]*Math.sin(P)+O[0]*Math.cos(P),L[1]=O[1],L[2]=O[2]*Math.cos(P)-O[0]*Math.sin(P),b[0]=L[0]+I[0],b[1]=L[1]+I[1],b[2]=L[2]+I[2],b},Ut.rotateZ=function(b,S,I,P){var O=[],L=[];return O[0]=S[0]-I[0],O[1]=S[1]-I[1],O[2]=S[2]-I[2],L[0]=O[0]*Math.cos(P)-O[1]*Math.sin(P),L[1]=O[0]*Math.sin(P)+O[1]*Math.cos(P),L[2]=O[2],b[0]=L[0]+I[0],b[1]=L[1]+I[1],b[2]=L[2]+I[2],b},Ut.angle=function(b,S){var I=b[0],P=b[1],O=b[2],L=S[0],D=S[1],F=S[2],V=Math.sqrt(I*I+P*P+O*O)*Math.sqrt(L*L+D*D+F*F),q=V&&y(b,S)/V;return Math.acos(Math.min(Math.max(q,-1),1))},Ut.zero=function(b){return b[0]=0,b[1]=0,b[2]=0,b},Ut.str=function(b){return"vec3("+b[0]+", "+b[1]+", "+b[2]+")"},Ut.exactEquals=function(b,S){return b[0]===S[0]&&b[1]===S[1]&&b[2]===S[2]},Ut.equals=function(b,S){var I=b[0],P=b[1],O=b[2],L=S[0],D=S[1],F=S[2];return Math.abs(I-L)<=e.EPSILON*Math.max(1,Math.abs(I),Math.abs(L))&&Math.abs(P-D)<=e.EPSILON*Math.max(1,Math.abs(P),Math.abs(D))&&Math.abs(O-F)<=e.EPSILON*Math.max(1,Math.abs(O),Math.abs(F))},Ut.forEach=Ut.sqrLen=Ut.len=Ut.sqrDist=Ut.dist=Ut.div=Ut.mul=Ut.sub=void 0;var e=function(b,S){if(b&&b.__esModule)return b;if(b===null||n(b)!=="object"&&typeof b!="function")return{default:b};var I=i(void 0);if(I&&I.has(b))return I.get(b);var P={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var L in b)if(L!=="default"&&Object.prototype.hasOwnProperty.call(b,L)){var D=O?Object.getOwnPropertyDescriptor(b,L):null;D&&(D.get||D.set)?Object.defineProperty(P,L,D):P[L]=b[L]}return P.default=b,I&&I.set(b,P),P}(yi());function i(b){if(typeof WeakMap!="function")return null;var S=new WeakMap,I=new WeakMap;return(i=function(P){return P?I:S})(b)}function o(){var b=new e.ARRAY_TYPE(3);return e.ARRAY_TYPE!=Float32Array&&(b[0]=0,b[1]=0,b[2]=0),b}function l(b){return Math.hypot(b[0],b[1],b[2])}function a(b,S,I){return b[0]=S[0]-I[0],b[1]=S[1]-I[1],b[2]=S[2]-I[2],b}function h(b,S,I){return b[0]=S[0]*I[0],b[1]=S[1]*I[1],b[2]=S[2]*I[2],b}function m(b,S,I){return b[0]=S[0]/I[0],b[1]=S[1]/I[1],b[2]=S[2]/I[2],b}function g(b,S){return Math.hypot(S[0]-b[0],S[1]-b[1],S[2]-b[2])}function v(b,S){var I=S[0]-b[0],P=S[1]-b[1],O=S[2]-b[2];return I*I+P*P+O*O}function p(b){var S=b[0],I=b[1],P=b[2];return S*S+I*I+P*P}function y(b,S){return b[0]*S[0]+b[1]*S[1]+b[2]*S[2]}Ut.sub=a,Ut.mul=h,Ut.div=m,Ut.dist=g,Ut.sqrDist=v,Ut.len=l,Ut.sqrLen=p;var w,x=(w=o(),function(b,S,I,P,O,L){var D,F;for(S||(S=3),I||(I=0),F=P?Math.min(P*S+I,b.length):b.length,D=I;D0&&(L=1/Math.sqrt(L)),x[0]=S*L,x[1]=I*L,x[2]=P*L,x[3]=O*L,x},Kt.dot=function(x,b){return x[0]*b[0]+x[1]*b[1]+x[2]*b[2]+x[3]*b[3]},Kt.cross=function(x,b,S,I){var P=S[0]*I[1]-S[1]*I[0],O=S[0]*I[2]-S[2]*I[0],L=S[0]*I[3]-S[3]*I[0],D=S[1]*I[2]-S[2]*I[1],F=S[1]*I[3]-S[3]*I[1],V=S[2]*I[3]-S[3]*I[2],q=b[0],J=b[1],X=b[2],Y=b[3];return x[0]=J*V-X*F+Y*D,x[1]=-q*V+X*L-Y*O,x[2]=q*F-J*L+Y*P,x[3]=-q*D+J*O-X*P,x},Kt.lerp=function(x,b,S,I){var P=b[0],O=b[1],L=b[2],D=b[3];return x[0]=P+I*(S[0]-P),x[1]=O+I*(S[1]-O),x[2]=L+I*(S[2]-L),x[3]=D+I*(S[3]-D),x},Kt.random=function(x,b){var S,I,P,O,L,D;b=b||1;do L=(S=2*e.RANDOM()-1)*S+(I=2*e.RANDOM()-1)*I;while(L>=1);do D=(P=2*e.RANDOM()-1)*P+(O=2*e.RANDOM()-1)*O;while(D>=1);var F=Math.sqrt((1-L)/D);return x[0]=b*S,x[1]=b*I,x[2]=b*P*F,x[3]=b*O*F,x},Kt.transformMat4=function(x,b,S){var I=b[0],P=b[1],O=b[2],L=b[3];return x[0]=S[0]*I+S[4]*P+S[8]*O+S[12]*L,x[1]=S[1]*I+S[5]*P+S[9]*O+S[13]*L,x[2]=S[2]*I+S[6]*P+S[10]*O+S[14]*L,x[3]=S[3]*I+S[7]*P+S[11]*O+S[15]*L,x},Kt.transformQuat=function(x,b,S){var I=b[0],P=b[1],O=b[2],L=S[0],D=S[1],F=S[2],V=S[3],q=V*I+D*O-F*P,J=V*P+F*I-L*O,X=V*O+L*P-D*I,Y=-L*I-D*P-F*O;return x[0]=q*V+Y*-L+J*-F-X*-D,x[1]=J*V+Y*-D+X*-L-q*-F,x[2]=X*V+Y*-F+q*-D-J*-L,x[3]=b[3],x},Kt.zero=function(x){return x[0]=0,x[1]=0,x[2]=0,x[3]=0,x},Kt.str=function(x){return"vec4("+x[0]+", "+x[1]+", "+x[2]+", "+x[3]+")"},Kt.exactEquals=function(x,b){return x[0]===b[0]&&x[1]===b[1]&&x[2]===b[2]&&x[3]===b[3]},Kt.equals=function(x,b){var S=x[0],I=x[1],P=x[2],O=x[3],L=b[0],D=b[1],F=b[2],V=b[3];return Math.abs(S-L)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(L))&&Math.abs(I-D)<=e.EPSILON*Math.max(1,Math.abs(I),Math.abs(D))&&Math.abs(P-F)<=e.EPSILON*Math.max(1,Math.abs(P),Math.abs(F))&&Math.abs(O-V)<=e.EPSILON*Math.max(1,Math.abs(O),Math.abs(V))},Kt.forEach=Kt.sqrLen=Kt.len=Kt.sqrDist=Kt.dist=Kt.div=Kt.mul=Kt.sub=void 0;var e=function(x,b){if(x&&x.__esModule)return x;if(x===null||n(x)!=="object"&&typeof x!="function")return{default:x};var S=i(void 0);if(S&&S.has(x))return S.get(x);var I={},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in x)if(O!=="default"&&Object.prototype.hasOwnProperty.call(x,O)){var L=P?Object.getOwnPropertyDescriptor(x,O):null;L&&(L.get||L.set)?Object.defineProperty(I,O,L):I[O]=x[O]}return I.default=x,S&&S.set(x,I),I}(yi());function i(x){if(typeof WeakMap!="function")return null;var b=new WeakMap,S=new WeakMap;return(i=function(I){return I?S:b})(x)}function o(){var x=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(x[0]=0,x[1]=0,x[2]=0,x[3]=0),x}function l(x,b,S){return x[0]=b[0]-S[0],x[1]=b[1]-S[1],x[2]=b[2]-S[2],x[3]=b[3]-S[3],x}function a(x,b,S){return x[0]=b[0]*S[0],x[1]=b[1]*S[1],x[2]=b[2]*S[2],x[3]=b[3]*S[3],x}function h(x,b,S){return x[0]=b[0]/S[0],x[1]=b[1]/S[1],x[2]=b[2]/S[2],x[3]=b[3]/S[3],x}function m(x,b){return Math.hypot(b[0]-x[0],b[1]-x[1],b[2]-x[2],b[3]-x[3])}function g(x,b){var S=b[0]-x[0],I=b[1]-x[1],P=b[2]-x[2],O=b[3]-x[3];return S*S+I*I+P*P+O*O}function v(x){return Math.hypot(x[0],x[1],x[2],x[3])}function p(x){var b=x[0],S=x[1],I=x[2],P=x[3];return b*b+S*S+I*I+P*P}Kt.sub=l,Kt.mul=a,Kt.div=h,Kt.dist=m,Kt.sqrDist=g,Kt.len=v,Kt.sqrLen=p;var y,w=(y=o(),function(x,b,S,I,P,O){var L,D;for(b||(b=4),S||(S=0),D=I?Math.min(I*b+S,x.length):x.length,L=S;Le.EPSILON?(ee[0]=ce[0]/pe,ee[1]=ce[1]/pe,ee[2]=ce[2]/pe):(ee[0]=1,ee[1]=0,ee[2]=0),me},Ft.getAngle=function(ee,ce){var me=S(ee,ce);return Math.acos(2*me*me-1)},Ft.multiply=v,Ft.rotateX=function(ee,ce,me){me*=.5;var pe=ce[0],xe=ce[1],ye=ce[2],Ee=ce[3],we=Math.sin(me),Ae=Math.cos(me);return ee[0]=pe*Ae+Ee*we,ee[1]=xe*Ae+ye*we,ee[2]=ye*Ae-xe*we,ee[3]=Ee*Ae-pe*we,ee},Ft.rotateY=function(ee,ce,me){me*=.5;var pe=ce[0],xe=ce[1],ye=ce[2],Ee=ce[3],we=Math.sin(me),Ae=Math.cos(me);return ee[0]=pe*Ae-ye*we,ee[1]=xe*Ae+Ee*we,ee[2]=ye*Ae+pe*we,ee[3]=Ee*Ae-xe*we,ee},Ft.rotateZ=function(ee,ce,me){me*=.5;var pe=ce[0],xe=ce[1],ye=ce[2],Ee=ce[3],we=Math.sin(me),Ae=Math.cos(me);return ee[0]=pe*Ae+xe*we,ee[1]=xe*Ae-pe*we,ee[2]=ye*Ae+Ee*we,ee[3]=Ee*Ae-ye*we,ee},Ft.calculateW=function(ee,ce){var me=ce[0],pe=ce[1],xe=ce[2];return ee[0]=me,ee[1]=pe,ee[2]=xe,ee[3]=Math.sqrt(Math.abs(1-me*me-pe*pe-xe*xe)),ee},Ft.exp=p,Ft.ln=y,Ft.pow=function(ee,ce,me){return y(ee,ce),b(ee,ee,me),p(ee,ee),ee},Ft.slerp=w,Ft.random=function(ee){var ce=e.RANDOM(),me=e.RANDOM(),pe=e.RANDOM(),xe=Math.sqrt(1-ce),ye=Math.sqrt(ce);return ee[0]=xe*Math.sin(2*Math.PI*me),ee[1]=xe*Math.cos(2*Math.PI*me),ee[2]=ye*Math.sin(2*Math.PI*pe),ee[3]=ye*Math.cos(2*Math.PI*pe),ee},Ft.invert=function(ee,ce){var me=ce[0],pe=ce[1],xe=ce[2],ye=ce[3],Ee=me*me+pe*pe+xe*xe+ye*ye,we=Ee?1/Ee:0;return ee[0]=-me*we,ee[1]=-pe*we,ee[2]=-xe*we,ee[3]=ye*we,ee},Ft.conjugate=function(ee,ce){return ee[0]=-ce[0],ee[1]=-ce[1],ee[2]=-ce[2],ee[3]=ce[3],ee},Ft.fromMat3=x,Ft.fromEuler=function(ee,ce,me,pe){var xe=.5*Math.PI/180;ce*=xe,me*=xe,pe*=xe;var ye=Math.sin(ce),Ee=Math.cos(ce),we=Math.sin(me),Ae=Math.cos(me),$e=Math.sin(pe),Ge=Math.cos(pe);return ee[0]=ye*Ae*Ge-Ee*we*$e,ee[1]=Ee*we*Ge+ye*Ae*$e,ee[2]=Ee*Ae*$e-ye*we*Ge,ee[3]=Ee*Ae*Ge+ye*we*$e,ee},Ft.str=function(ee){return"quat("+ee[0]+", "+ee[1]+", "+ee[2]+", "+ee[3]+")"},Ft.setAxes=Ft.sqlerp=Ft.rotationTo=Ft.equals=Ft.exactEquals=Ft.normalize=Ft.sqrLen=Ft.squaredLength=Ft.len=Ft.length=Ft.lerp=Ft.dot=Ft.scale=Ft.mul=Ft.add=Ft.set=Ft.copy=Ft.fromValues=Ft.clone=void 0;var e=h(yi()),i=h(Nn()),o=h(Ro()),l=h(Hr());function a(ee){if(typeof WeakMap!="function")return null;var ce=new WeakMap,me=new WeakMap;return(a=function(pe){return pe?me:ce})(ee)}function h(ee,ce){if(ee&&ee.__esModule)return ee;if(ee===null||n(ee)!=="object"&&typeof ee!="function")return{default:ee};var me=a(ce);if(me&&me.has(ee))return me.get(ee);var pe={},xe=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ye in ee)if(ye!=="default"&&Object.prototype.hasOwnProperty.call(ee,ye)){var Ee=xe?Object.getOwnPropertyDescriptor(ee,ye):null;Ee&&(Ee.get||Ee.set)?Object.defineProperty(pe,ye,Ee):pe[ye]=ee[ye]}return pe.default=ee,me&&me.set(ee,pe),pe}function m(){var ee=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(ee[0]=0,ee[1]=0,ee[2]=0),ee[3]=1,ee}function g(ee,ce,me){me*=.5;var pe=Math.sin(me);return ee[0]=pe*ce[0],ee[1]=pe*ce[1],ee[2]=pe*ce[2],ee[3]=Math.cos(me),ee}function v(ee,ce,me){var pe=ce[0],xe=ce[1],ye=ce[2],Ee=ce[3],we=me[0],Ae=me[1],$e=me[2],Ge=me[3];return ee[0]=pe*Ge+Ee*we+xe*$e-ye*Ae,ee[1]=xe*Ge+Ee*Ae+ye*we-pe*$e,ee[2]=ye*Ge+Ee*$e+pe*Ae-xe*we,ee[3]=Ee*Ge-pe*we-xe*Ae-ye*$e,ee}function p(ee,ce){var me=ce[0],pe=ce[1],xe=ce[2],ye=ce[3],Ee=Math.sqrt(me*me+pe*pe+xe*xe),we=Math.exp(ye),Ae=Ee>0?we*Math.sin(Ee)/Ee:0;return ee[0]=me*Ae,ee[1]=pe*Ae,ee[2]=xe*Ae,ee[3]=we*Math.cos(Ee),ee}function y(ee,ce){var me=ce[0],pe=ce[1],xe=ce[2],ye=ce[3],Ee=Math.sqrt(me*me+pe*pe+xe*xe),we=Ee>0?Math.atan2(Ee,ye)/Ee:0;return ee[0]=me*we,ee[1]=pe*we,ee[2]=xe*we,ee[3]=.5*Math.log(me*me+pe*pe+xe*xe+ye*ye),ee}function w(ee,ce,me,pe){var xe,ye,Ee,we,Ae,$e=ce[0],Ge=ce[1],lt=ce[2],Ze=ce[3],Ke=me[0],He=me[1],wt=me[2],rt=me[3];return(ye=$e*Ke+Ge*He+lt*wt+Ze*rt)<0&&(ye=-ye,Ke=-Ke,He=-He,wt=-wt,rt=-rt),1-ye>e.EPSILON?(xe=Math.acos(ye),Ee=Math.sin(xe),we=Math.sin((1-pe)*xe)/Ee,Ae=Math.sin(pe*xe)/Ee):(we=1-pe,Ae=pe),ee[0]=we*$e+Ae*Ke,ee[1]=we*Ge+Ae*He,ee[2]=we*lt+Ae*wt,ee[3]=we*Ze+Ae*rt,ee}function x(ee,ce){var me,pe=ce[0]+ce[4]+ce[8];if(pe>0)me=Math.sqrt(pe+1),ee[3]=.5*me,ee[0]=(ce[5]-ce[7])*(me=.5/me),ee[1]=(ce[6]-ce[2])*me,ee[2]=(ce[1]-ce[3])*me;else{var xe=0;ce[4]>ce[0]&&(xe=1),ce[8]>ce[3*xe+xe]&&(xe=2);var ye=(xe+1)%3,Ee=(xe+2)%3;me=Math.sqrt(ce[3*xe+xe]-ce[3*ye+ye]-ce[3*Ee+Ee]+1),ee[xe]=.5*me,ee[3]=(ce[3*ye+Ee]-ce[3*Ee+ye])*(me=.5/me),ee[ye]=(ce[3*ye+xe]+ce[3*xe+ye])*me,ee[Ee]=(ce[3*Ee+xe]+ce[3*xe+Ee])*me}return ee}Ft.clone=l.clone,Ft.fromValues=l.fromValues,Ft.copy=l.copy,Ft.set=l.set,Ft.add=l.add,Ft.mul=v;var b=l.scale;Ft.scale=b;var S=l.dot;Ft.dot=S,Ft.lerp=l.lerp;var I=l.length;Ft.length=I,Ft.len=I;var P=l.squaredLength;Ft.squaredLength=P,Ft.sqrLen=P;var O=l.normalize;Ft.normalize=O,Ft.exactEquals=l.exactEquals,Ft.equals=l.equals;var L,D,F,V=(L=o.create(),D=o.fromValues(1,0,0),F=o.fromValues(0,1,0),function(ee,ce,me){var pe=o.dot(ce,me);return pe<-.999999?(o.cross(L,D,ce),o.len(L)<1e-6&&o.cross(L,F,ce),o.normalize(L,L),g(ee,L,Math.PI),ee):pe>.999999?(ee[0]=0,ee[1]=0,ee[2]=0,ee[3]=1,ee):(o.cross(L,ce,me),ee[0]=L[0],ee[1]=L[1],ee[2]=L[2],ee[3]=1+pe,O(ee,ee))});Ft.rotationTo=V;var q,J,X=(q=m(),J=m(),function(ee,ce,me,pe,xe,ye){return w(q,ce,xe,ye),w(J,me,pe,ye),w(ee,q,J,2*ye*(1-ye)),ee});Ft.sqlerp=X;var Y,le=(Y=i.create(),function(ee,ce,me,pe){return Y[0]=me[0],Y[3]=me[1],Y[6]=me[2],Y[1]=pe[0],Y[4]=pe[1],Y[7]=pe[2],Y[2]=-ce[0],Y[5]=-ce[1],Y[8]=-ce[2],O(ee,x(ee,Y))});return Ft.setAxes=le,Ft}var Ms,Jt={};function pn(){if(Ms)return Jt;function n(w){return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},n(w)}Ms=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.create=function(){var w=new e.ARRAY_TYPE(8);return e.ARRAY_TYPE!=Float32Array&&(w[0]=0,w[1]=0,w[2]=0,w[4]=0,w[5]=0,w[6]=0,w[7]=0),w[3]=1,w},Jt.clone=function(w){var x=new e.ARRAY_TYPE(8);return x[0]=w[0],x[1]=w[1],x[2]=w[2],x[3]=w[3],x[4]=w[4],x[5]=w[5],x[6]=w[6],x[7]=w[7],x},Jt.fromValues=function(w,x,b,S,I,P,O,L){var D=new e.ARRAY_TYPE(8);return D[0]=w,D[1]=x,D[2]=b,D[3]=S,D[4]=I,D[5]=P,D[6]=O,D[7]=L,D},Jt.fromRotationTranslationValues=function(w,x,b,S,I,P,O){var L=new e.ARRAY_TYPE(8);L[0]=w,L[1]=x,L[2]=b,L[3]=S;var D=.5*I,F=.5*P,V=.5*O;return L[4]=D*S+F*b-V*x,L[5]=F*S+V*w-D*b,L[6]=V*S+D*x-F*w,L[7]=-D*w-F*x-V*b,L},Jt.fromRotationTranslation=h,Jt.fromTranslation=function(w,x){return w[0]=0,w[1]=0,w[2]=0,w[3]=1,w[4]=.5*x[0],w[5]=.5*x[1],w[6]=.5*x[2],w[7]=0,w},Jt.fromRotation=function(w,x){return w[0]=x[0],w[1]=x[1],w[2]=x[2],w[3]=x[3],w[4]=0,w[5]=0,w[6]=0,w[7]=0,w},Jt.fromMat4=function(w,x){var b=i.create();o.getRotation(b,x);var S=new e.ARRAY_TYPE(3);return o.getTranslation(S,x),h(w,b,S),w},Jt.copy=m,Jt.identity=function(w){return w[0]=0,w[1]=0,w[2]=0,w[3]=1,w[4]=0,w[5]=0,w[6]=0,w[7]=0,w},Jt.set=function(w,x,b,S,I,P,O,L,D){return w[0]=x,w[1]=b,w[2]=S,w[3]=I,w[4]=P,w[5]=O,w[6]=L,w[7]=D,w},Jt.getDual=function(w,x){return w[0]=x[4],w[1]=x[5],w[2]=x[6],w[3]=x[7],w},Jt.setDual=function(w,x){return w[4]=x[0],w[5]=x[1],w[6]=x[2],w[7]=x[3],w},Jt.getTranslation=function(w,x){var b=x[4],S=x[5],I=x[6],P=x[7],O=-x[0],L=-x[1],D=-x[2],F=x[3];return w[0]=2*(b*F+P*O+S*D-I*L),w[1]=2*(S*F+P*L+I*O-b*D),w[2]=2*(I*F+P*D+b*L-S*O),w},Jt.translate=function(w,x,b){var S=x[0],I=x[1],P=x[2],O=x[3],L=.5*b[0],D=.5*b[1],F=.5*b[2],V=x[4],q=x[5],J=x[6],X=x[7];return w[0]=S,w[1]=I,w[2]=P,w[3]=O,w[4]=O*L+I*F-P*D+V,w[5]=O*D+P*L-S*F+q,w[6]=O*F+S*D-I*L+J,w[7]=-S*L-I*D-P*F+X,w},Jt.rotateX=function(w,x,b){var S=-x[0],I=-x[1],P=-x[2],O=x[3],L=x[4],D=x[5],F=x[6],V=x[7],q=L*O+V*S+D*P-F*I,J=D*O+V*I+F*S-L*P,X=F*O+V*P+L*I-D*S,Y=V*O-L*S-D*I-F*P;return i.rotateX(w,x,b),w[4]=q*(O=w[3])+Y*(S=w[0])+J*(P=w[2])-X*(I=w[1]),w[5]=J*O+Y*I+X*S-q*P,w[6]=X*O+Y*P+q*I-J*S,w[7]=Y*O-q*S-J*I-X*P,w},Jt.rotateY=function(w,x,b){var S=-x[0],I=-x[1],P=-x[2],O=x[3],L=x[4],D=x[5],F=x[6],V=x[7],q=L*O+V*S+D*P-F*I,J=D*O+V*I+F*S-L*P,X=F*O+V*P+L*I-D*S,Y=V*O-L*S-D*I-F*P;return i.rotateY(w,x,b),w[4]=q*(O=w[3])+Y*(S=w[0])+J*(P=w[2])-X*(I=w[1]),w[5]=J*O+Y*I+X*S-q*P,w[6]=X*O+Y*P+q*I-J*S,w[7]=Y*O-q*S-J*I-X*P,w},Jt.rotateZ=function(w,x,b){var S=-x[0],I=-x[1],P=-x[2],O=x[3],L=x[4],D=x[5],F=x[6],V=x[7],q=L*O+V*S+D*P-F*I,J=D*O+V*I+F*S-L*P,X=F*O+V*P+L*I-D*S,Y=V*O-L*S-D*I-F*P;return i.rotateZ(w,x,b),w[4]=q*(O=w[3])+Y*(S=w[0])+J*(P=w[2])-X*(I=w[1]),w[5]=J*O+Y*I+X*S-q*P,w[6]=X*O+Y*P+q*I-J*S,w[7]=Y*O-q*S-J*I-X*P,w},Jt.rotateByQuatAppend=function(w,x,b){var S=b[0],I=b[1],P=b[2],O=b[3],L=x[0],D=x[1],F=x[2],V=x[3];return w[0]=L*O+V*S+D*P-F*I,w[1]=D*O+V*I+F*S-L*P,w[2]=F*O+V*P+L*I-D*S,w[3]=V*O-L*S-D*I-F*P,w[4]=(L=x[4])*O+(V=x[7])*S+(D=x[5])*P-(F=x[6])*I,w[5]=D*O+V*I+F*S-L*P,w[6]=F*O+V*P+L*I-D*S,w[7]=V*O-L*S-D*I-F*P,w},Jt.rotateByQuatPrepend=function(w,x,b){var S=x[0],I=x[1],P=x[2],O=x[3],L=b[0],D=b[1],F=b[2],V=b[3];return w[0]=S*V+O*L+I*F-P*D,w[1]=I*V+O*D+P*L-S*F,w[2]=P*V+O*F+S*D-I*L,w[3]=O*V-S*L-I*D-P*F,w[4]=S*(V=b[7])+O*(L=b[4])+I*(F=b[6])-P*(D=b[5]),w[5]=I*V+O*D+P*L-S*F,w[6]=P*V+O*F+S*D-I*L,w[7]=O*V-S*L-I*D-P*F,w},Jt.rotateAroundAxis=function(w,x,b,S){if(Math.abs(S)0){b=Math.sqrt(b);var S=x[0]/b,I=x[1]/b,P=x[2]/b,O=x[3]/b,L=x[4],D=x[5],F=x[6],V=x[7],q=S*L+I*D+P*F+O*V;w[0]=S,w[1]=I,w[2]=P,w[3]=O,w[4]=(L-S*q)/b,w[5]=(D-I*q)/b,w[6]=(F-P*q)/b,w[7]=(V-O*q)/b}return w},Jt.str=function(w){return"quat2("+w[0]+", "+w[1]+", "+w[2]+", "+w[3]+", "+w[4]+", "+w[5]+", "+w[6]+", "+w[7]+")"},Jt.exactEquals=function(w,x){return w[0]===x[0]&&w[1]===x[1]&&w[2]===x[2]&&w[3]===x[3]&&w[4]===x[4]&&w[5]===x[5]&&w[6]===x[6]&&w[7]===x[7]},Jt.equals=function(w,x){var b=w[0],S=w[1],I=w[2],P=w[3],O=w[4],L=w[5],D=w[6],F=w[7],V=x[0],q=x[1],J=x[2],X=x[3],Y=x[4],le=x[5],ee=x[6],ce=x[7];return Math.abs(b-V)<=e.EPSILON*Math.max(1,Math.abs(b),Math.abs(V))&&Math.abs(S-q)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(q))&&Math.abs(I-J)<=e.EPSILON*Math.max(1,Math.abs(I),Math.abs(J))&&Math.abs(P-X)<=e.EPSILON*Math.max(1,Math.abs(P),Math.abs(X))&&Math.abs(O-Y)<=e.EPSILON*Math.max(1,Math.abs(O),Math.abs(Y))&&Math.abs(L-le)<=e.EPSILON*Math.max(1,Math.abs(L),Math.abs(le))&&Math.abs(D-ee)<=e.EPSILON*Math.max(1,Math.abs(D),Math.abs(ee))&&Math.abs(F-ce)<=e.EPSILON*Math.max(1,Math.abs(F),Math.abs(ce))},Jt.sqrLen=Jt.squaredLength=Jt.len=Jt.length=Jt.dot=Jt.mul=Jt.setReal=Jt.getReal=void 0;var e=a(yi()),i=a(An()),o=a(dn());function l(w){if(typeof WeakMap!="function")return null;var x=new WeakMap,b=new WeakMap;return(l=function(S){return S?b:x})(w)}function a(w,x){if(w&&w.__esModule)return w;if(w===null||n(w)!=="object"&&typeof w!="function")return{default:w};var b=l(x);if(b&&b.has(w))return b.get(w);var S={},I=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var P in w)if(P!=="default"&&Object.prototype.hasOwnProperty.call(w,P)){var O=I?Object.getOwnPropertyDescriptor(w,P):null;O&&(O.get||O.set)?Object.defineProperty(S,P,O):S[P]=w[P]}return S.default=w,b&&b.set(w,S),S}function h(w,x,b){var S=.5*b[0],I=.5*b[1],P=.5*b[2],O=x[0],L=x[1],D=x[2],F=x[3];return w[0]=O,w[1]=L,w[2]=D,w[3]=F,w[4]=S*F+I*D-P*L,w[5]=I*F+P*O-S*D,w[6]=P*F+S*L-I*O,w[7]=-S*O-I*L-P*D,w}function m(w,x){return w[0]=x[0],w[1]=x[1],w[2]=x[2],w[3]=x[3],w[4]=x[4],w[5]=x[5],w[6]=x[6],w[7]=x[7],w}function g(w,x,b){var S=x[0],I=x[1],P=x[2],O=x[3],L=b[4],D=b[5],F=b[6],V=b[7],q=x[4],J=x[5],X=x[6],Y=x[7],le=b[0],ee=b[1],ce=b[2],me=b[3];return w[0]=S*me+O*le+I*ce-P*ee,w[1]=I*me+O*ee+P*le-S*ce,w[2]=P*me+O*ce+S*ee-I*le,w[3]=O*me-S*le-I*ee-P*ce,w[4]=S*V+O*L+I*F-P*D+q*me+Y*le+J*ce-X*ee,w[5]=I*V+O*D+P*L-S*F+J*me+Y*ee+X*le-q*ce,w[6]=P*V+O*F+S*D-I*L+X*me+Y*ce+q*ee-J*le,w[7]=O*V-S*L-I*D-P*F+Y*me-q*le-J*ee-X*ce,w}Jt.getReal=i.copy,Jt.setReal=i.copy,Jt.mul=g;var v=i.dot;Jt.dot=v;var p=i.length;Jt.length=p,Jt.len=p;var y=i.squaredLength;return Jt.squaredLength=y,Jt.sqrLen=y,Jt}var Oa,As,qt={};function k0(){if(Oa)return qt;function n(x){return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},n(x)}Oa=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.create=o,qt.clone=function(x){var b=new e.ARRAY_TYPE(2);return b[0]=x[0],b[1]=x[1],b},qt.fromValues=function(x,b){var S=new e.ARRAY_TYPE(2);return S[0]=x,S[1]=b,S},qt.copy=function(x,b){return x[0]=b[0],x[1]=b[1],x},qt.set=function(x,b,S){return x[0]=b,x[1]=S,x},qt.add=function(x,b,S){return x[0]=b[0]+S[0],x[1]=b[1]+S[1],x},qt.subtract=l,qt.multiply=a,qt.divide=h,qt.ceil=function(x,b){return x[0]=Math.ceil(b[0]),x[1]=Math.ceil(b[1]),x},qt.floor=function(x,b){return x[0]=Math.floor(b[0]),x[1]=Math.floor(b[1]),x},qt.min=function(x,b,S){return x[0]=Math.min(b[0],S[0]),x[1]=Math.min(b[1],S[1]),x},qt.max=function(x,b,S){return x[0]=Math.max(b[0],S[0]),x[1]=Math.max(b[1],S[1]),x},qt.round=function(x,b){return x[0]=Math.round(b[0]),x[1]=Math.round(b[1]),x},qt.scale=function(x,b,S){return x[0]=b[0]*S,x[1]=b[1]*S,x},qt.scaleAndAdd=function(x,b,S,I){return x[0]=b[0]+S[0]*I,x[1]=b[1]+S[1]*I,x},qt.distance=m,qt.squaredDistance=g,qt.length=v,qt.squaredLength=p,qt.negate=function(x,b){return x[0]=-b[0],x[1]=-b[1],x},qt.inverse=function(x,b){return x[0]=1/b[0],x[1]=1/b[1],x},qt.normalize=function(x,b){var S=b[0],I=b[1],P=S*S+I*I;return P>0&&(P=1/Math.sqrt(P)),x[0]=b[0]*P,x[1]=b[1]*P,x},qt.dot=function(x,b){return x[0]*b[0]+x[1]*b[1]},qt.cross=function(x,b,S){var I=b[0]*S[1]-b[1]*S[0];return x[0]=x[1]=0,x[2]=I,x},qt.lerp=function(x,b,S,I){var P=b[0],O=b[1];return x[0]=P+I*(S[0]-P),x[1]=O+I*(S[1]-O),x},qt.random=function(x,b){b=b||1;var S=2*e.RANDOM()*Math.PI;return x[0]=Math.cos(S)*b,x[1]=Math.sin(S)*b,x},qt.transformMat2=function(x,b,S){var I=b[0],P=b[1];return x[0]=S[0]*I+S[2]*P,x[1]=S[1]*I+S[3]*P,x},qt.transformMat2d=function(x,b,S){var I=b[0],P=b[1];return x[0]=S[0]*I+S[2]*P+S[4],x[1]=S[1]*I+S[3]*P+S[5],x},qt.transformMat3=function(x,b,S){var I=b[0],P=b[1];return x[0]=S[0]*I+S[3]*P+S[6],x[1]=S[1]*I+S[4]*P+S[7],x},qt.transformMat4=function(x,b,S){var I=b[0],P=b[1];return x[0]=S[0]*I+S[4]*P+S[12],x[1]=S[1]*I+S[5]*P+S[13],x},qt.rotate=function(x,b,S,I){var P=b[0]-S[0],O=b[1]-S[1],L=Math.sin(I),D=Math.cos(I);return x[0]=P*D-O*L+S[0],x[1]=P*L+O*D+S[1],x},qt.angle=function(x,b){var S=x[0],I=x[1],P=b[0],O=b[1],L=Math.sqrt(S*S+I*I)*Math.sqrt(P*P+O*O);return Math.acos(Math.min(Math.max(L&&(S*P+I*O)/L,-1),1))},qt.zero=function(x){return x[0]=0,x[1]=0,x},qt.str=function(x){return"vec2("+x[0]+", "+x[1]+")"},qt.exactEquals=function(x,b){return x[0]===b[0]&&x[1]===b[1]},qt.equals=function(x,b){var S=x[0],I=x[1],P=b[0],O=b[1];return Math.abs(S-P)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(P))&&Math.abs(I-O)<=e.EPSILON*Math.max(1,Math.abs(I),Math.abs(O))},qt.forEach=qt.sqrLen=qt.sqrDist=qt.dist=qt.div=qt.mul=qt.sub=qt.len=void 0;var e=function(x,b){if(x&&x.__esModule)return x;if(x===null||n(x)!=="object"&&typeof x!="function")return{default:x};var S=i(void 0);if(S&&S.has(x))return S.get(x);var I={},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in x)if(O!=="default"&&Object.prototype.hasOwnProperty.call(x,O)){var L=P?Object.getOwnPropertyDescriptor(x,O):null;L&&(L.get||L.set)?Object.defineProperty(I,O,L):I[O]=x[O]}return I.default=x,S&&S.set(x,I),I}(yi());function i(x){if(typeof WeakMap!="function")return null;var b=new WeakMap,S=new WeakMap;return(i=function(I){return I?S:b})(x)}function o(){var x=new e.ARRAY_TYPE(2);return e.ARRAY_TYPE!=Float32Array&&(x[0]=0,x[1]=0),x}function l(x,b,S){return x[0]=b[0]-S[0],x[1]=b[1]-S[1],x}function a(x,b,S){return x[0]=b[0]*S[0],x[1]=b[1]*S[1],x}function h(x,b,S){return x[0]=b[0]/S[0],x[1]=b[1]/S[1],x}function m(x,b){return Math.hypot(b[0]-x[0],b[1]-x[1])}function g(x,b){var S=b[0]-x[0],I=b[1]-x[1];return S*S+I*I}function v(x){return Math.hypot(x[0],x[1])}function p(x){var b=x[0],S=x[1];return b*b+S*S}qt.len=v,qt.sub=l,qt.mul=a,qt.div=h,qt.dist=m,qt.sqrDist=g,qt.sqrLen=p;var y,w=(y=o(),function(x,b,S,I,P,O){var L,D;for(b||(b=2),S||(S=0),D=I?Math.min(I*b+S,x.length):x.length,L=S;L1)return 1;for(var o=e,l=0;l<8;l++){var a=this.sampleCurveX(o)-e;if(Math.abs(a)a?m=o:g=o,o=.5*(g-m)+m;return o},solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},fn}(),Do=gt(is);function Lo(){if(Cs)return Ps;function n(e,i){this.x=e,this.y=i}return Cs=1,Ps=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,i){return this.clone()._rotateAround(e,i)},matMult:function(e){return this.clone()._matMult(e)},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(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var i=e.x-this.x,o=e.y-this.y;return i*i+o*o},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,i){return Math.atan2(this.x*i-this.y*e,this.x*e+this.y*i)},_matMult:function(e){var i=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=i,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var i=Math.cos(e),o=Math.sin(e),l=o*this.x+i*this.y;return this.x=i*this.x-o*this.y,this.y=l,this},_rotateAround:function(e,i){var o=Math.cos(e),l=Math.sin(e),a=i.y+l*(this.x-i.x)+o*(this.y-i.y);return this.x=i.x+o*(this.x-i.x)-l*(this.y-i.y),this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(e){return e instanceof n?e:Array.isArray(e)?new n(e[0],e[1]):e},Ps}var Qe=gt(Lo());function In(n,e){if(Array.isArray(n)){if(!Array.isArray(e)||n.length!==e.length)return!1;for(let i=0;i=1)return 1;const e=n*n,i=e*n;return 4*(n<.5?i:3*(n-e)+i-.75)}function eo(n,e,i,o){const l=new Do(n,e,i,o);return function(a){return l.solve(a)}}const zs=eo(.25,.1,.25,1);function $t(n,e,i){return Math.min(i,Math.max(e,n))}function Nr(n,e,i){return(i=$t((i-n)/(e-n),0,1))*i*(3-2*i)}function Oo(n,e,i){const o=i-e,l=((n-e)%o+o)%o+e;return l===e?i:l}function ns(n,e,i){if(!n.length)return i(null,[]);let o=n.length;const l=new Array(n.length);let a=null;n.forEach((h,m)=>{e(h,(g,v)=>{g&&(a=g),l[m]=v,--o==0&&i(a,l)})})}function Lr(n,...e){for(const i of e)for(const o in i)n[o]=i[o];return n}let to=1;function jn(){return to++}function ka(n){return n<=1?1:Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Fa(n,e){n.forEach(i=>{e[i]&&(e[i]=e[i].bind(e))})}function os(n,e,i){const o={};for(const l in n)o[l]=e.call(this,n[l],l,n);return o}function ss(n,e,i){const o={};for(const l in n)e.call(this,n[l],l,n)&&(o[l]=n[l]);return o}function en(n){return Array.isArray(n)?n.map(en):typeof n=="object"&&n?os(n,en):n}const Rs={};function ji(n){Rs[n]||(typeof console<"u"&&console.warn(n),Rs[n]=!0)}function Si(n,e,i){return(i.y-n.y)*(e.x-n.x)>(e.y-n.y)*(i.x-n.x)}function Ba(n){let e=0;for(let i,o,l=0,a=n.length,h=a-1;l@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,o,l,a)=>{const h=l||a;return e[o]=!h||h.toLowerCase(),""}),e["max-age"]){const i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e}let Na=null;function Ls(n,e){return[n[4*e],n[4*e+1],n[4*e+2],n[4*e+3]]}function F0(n,e,i,o){for(;e>1;n[l]>1;n[l]<=o?e=l+1:i=l}return e}function Va(n){return n>0?1/(1.001-n):1+n}function Oe(n){return n>0?1-1/(1.001-n):-n}const H={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!H.API_URL)return null;try{const n=new URL(H.API_URL);return n.hostname==="api.mapbox.cn"?"https://events.mapbox.cn/events/v2":n.hostname==="api.mapbox.com"?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",TILES3D_URL_PREFIX:"3dtiles/v1"};function Z(n){return H.API_URL_REGEX.test(n)}function re(n){return H.API_SPRITE_REGEX.test(n)}let de,ue,ge,Pe,ve,Re;function Fe(){return de==null&&(de=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&typeof self.createImageBitmap=="function"),de}const Le={now:()=>Pe!==void 0?Pe:performance.now(),setNow(n){Pe=n},restoreNow(){Pe=void 0},frame(n){const e=requestAnimationFrame(n);return{cancel:()=>cancelAnimationFrame(e)}},getImageData(n,e=0){const{width:i,height:o}=n;ve||(ve=document.createElement("canvas"));const l=ve.getContext("2d",{willReadFrequently:!0});if(!l)throw new Error("failed to create canvas 2d context");return(i>ve.width||o>ve.height)&&(ve.width=i,ve.height=o),l.clearRect(-e,-e,i+2*e,o+2*e),l.drawImage(n,0,0,i,o),l.getImageData(-e,-e,i+2*e,o+2*e)},resolveURL:n=>(ue||(ue=document.createElement("a")),ue.href=n,ue.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(ge==null&&(ge=window.matchMedia("(prefers-reduced-motion: reduce)")),ge.matches)},hasCanvasFingerprintNoise(){if(Re!==void 0)return Re;if(!Fe())return Re=!1,!1;const n=new OffscreenCanvas(85,1),e=n.getContext("2d",{willReadFrequently:!0});let i=0;for(let l=0;l0?`?${a}`:""}`}const ht="mapbox-tiles";let Dt=500,Bt=50;const Nt=["language","worldview","jobid"];let Gt,zi;function Ui(){try{return caches}catch{}}function Xt(){const n=Ui();n&&Gt==null&&(Gt=n.open(ht))}let xi=1/0;const vi={supported:!1,testSupport:function(n){!hr&&Wi&&(Ar?Or(n):Ti=n)}};let Ti,Wi,hr=!1,Ar=!1;const _n=typeof self<"u"?self:{};function Or(n){const e=n.createTexture();n.bindTexture(n.TEXTURE_2D,e);try{if(n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,Wi),n.isContextLost())return;vi.supported=!0}catch{}n.deleteTexture(e),hr=!0}_n.document&&(Wi=_n.document.createElement("img"),Wi.onload=function(){Ti&&Or(Ti),Ti=null,Ar=!0},Wi.onerror=function(){hr=!0,Ti=null},Wi.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const dr={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Iconset:"Iconset",Image:"Image",Model:"Model"};typeof Object.freeze=="function"&&Object.freeze(dr);class mr extends Error{constructor(e,i,o){i===401&&Z(o)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=i,this.url=o}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const Os=Vr()?()=>self.worker&&self.worker.referrer:()=>(location.protocol==="blob:"?parent:self).location.href,gn=function(n,e){if(!(/^file:/.test(i=n.url)||/^file:/.test(Os())&&!/^\w+:/.test(i))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal"))return function(o,l){const a=new AbortController,h=new Request(o.url,{method:o.method||"GET",body:o.body,credentials:o.credentials,headers:o.headers,referrer:Os(),referrerPolicy:o.referrerPolicy,signal:a.signal});let m=!1,g=!1;const v=(p=h.url).indexOf("sku=")>0&&Z(p);var p;o.type==="json"&&h.headers.set("Accept","application/json");const y=(x,b,S)=>{if(g)return;if(x&&x.message!=="SecurityError"&&ji(x.toString()),b&&S)return w(b);const I=Date.now();fetch(h).then(P=>{if(P.ok){const O=v?P.clone():null;return w(P,O,I)}return l(new mr(P.statusText,P.status,o.url))}).catch(P=>{P.name!=="AbortError"&&l(new Error(`${P.message} ${o.url}`))})},w=(x,b,S)=>{(o.type==="arrayBuffer"?x.arrayBuffer():o.type==="json"?x.json():x.text()).then(I=>{g||(b&&S&&function(P,O,L){if(Xt(),Gt==null)return;const D=as(O.headers.get("Cache-Control")||"");if(D["no-store"])return;const F={status:O.status,statusText:O.statusText,headers:new Headers};O.headers.forEach((J,X)=>F.headers.set(X,J)),D["max-age"]&&F.headers.set("Expires",new Date(L+1e3*D["max-age"]).toUTCString());const V=F.headers.get("Expires");if(!V||new Date(V).getTime()-L<42e4)return;let q=ot(P.url,{persistentParams:Nt});if(O.status===206){const J=P.headers.get("Range");if(!J)return;F.status=200,q=Xe(q,{range:J})}(function(J,X){if(zi===void 0)try{new Response(new ReadableStream),zi=!0}catch{zi=!1}zi?X(J.body):J.blob().then(X)})(O,J=>{const X=new Response((Y=O.status)!==200&&Y!==404&&[101,103,204,205,304].includes(Y)?null:J,F);var Y;Xt(),Gt!=null&&Gt.then(le=>le.put(q,X)).catch(le=>ji(le.message))})}(h,b,S),m=!0,l(null,I,x.headers.get("Cache-Control"),x.headers.get("Expires")))}).catch(I=>{g||l(new Error(I.message))})};return v?function(x,b){if(Xt(),Gt==null)return b(null);Gt.then(S=>{let I=ot(x.url,{persistentParams:Nt});const P=x.headers.get("Range");P&&(I=Xe(I,{range:P})),S.match(I).then(O=>{const L=function(D){if(!D)return!1;const F=new Date(D.headers.get("Expires")||0),V=as(D.headers.get("Cache-Control")||"");return F>Date.now()&&!V["no-cache"]}(O);S.delete(I),L&&S.put(I,O.clone()),b(null,O,L)}).catch(b)}).catch(b)}(h,y):y(null,null),{cancel:()=>{g=!0,m||a.abort()}}}(n,e);if(Vr()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",n,e,void 0,!0)}var i;return function(o,l){const a=new XMLHttpRequest;a.open(o.method||"GET",o.url,!0),o.type==="arrayBuffer"&&(a.responseType="arraybuffer");for(const h in o.headers)a.setRequestHeader(h,o.headers[h]);return o.type==="json"&&(a.responseType="text",a.setRequestHeader("Accept","application/json")),a.withCredentials=o.credentials==="include",a.onerror=()=>{l(new Error(a.statusText))},a.onload=()=>{if((a.status>=200&&a.status<300||a.status===0)&&a.response!==null){let h=a.response;if(o.type==="json")try{h=JSON.parse(a.response)}catch(m){return l(m)}l(null,h,a.getResponseHeader("Cache-Control"),a.getResponseHeader("Expires"))}else l(new mr(a.statusText,a.status,o.url))},a.send(o.body),{cancel:()=>a.abort()}}(n,e)},Gn=function(n,e){return gn(Lr(n,{type:"arrayBuffer"}),e)};function i3(n){const e=document.createElement("a");return e.href=n,e.protocol===location.protocol&&e.host===location.host}const N0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let Ua,ks;Ua=[],ks=0;const r3=function(n,e){if(vi.supported&&(n.headers||(n.headers={}),n.headers.accept="image/webp,*/*"),ks>=H.MAX_PARALLEL_IMAGE_REQUESTS){const a={requestParameters:n,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return Ua.push(a),a}ks++;let i=!1;const o=()=>{if(!i)for(i=!0,ks--;Ua.length&&ks{o(),a?e(a):h&&(self.createImageBitmap?function(v,p){const y=new Blob([new Uint8Array(v)],{type:"image/png"});createImageBitmap(y).then(w=>{p(null,w)}).catch(w=>{p(new Error(`Could not load image because of ${w.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(h,(v,p)=>e(v,p,m,g)):function(v,p){const y=new Image;y.onload=()=>{p(null,y),URL.revokeObjectURL(y.src),y.onload=null,requestAnimationFrame(()=>{y.src=N0})},y.onerror=()=>p(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 w=new Blob([new Uint8Array(v)],{type:"image/png"});y.src=v.byteLength?URL.createObjectURL(w):N0}(h,(v,p)=>e(v,p,m,g)))});return{cancel:()=>{l.cancel(),o()}}};var hc,dc,n3,Fs={exports:{}},tn={exports:{}},Pn={exports:{}},ko=function(){if(n3)return Fs.exports;n3=1;var n=(hc||(hc=1,tn.exports=function(i,o){var l,a,h,m,g,v,p,y;for(a=i.length-(l=3&i.length),h=o,g=3432918353,v=461845907,y=0;y>>16)*g&65535)<<16)&4294967295)<<15|p>>>17))*v+(((p>>>16)*v&65535)<<16)&4294967295)<<13|h>>>19))+((5*(h>>>16)&65535)<<16)&4294967295))+((58964+(m>>>16)&65535)<<16);switch(p=0,l){case 3:p^=(255&i.charCodeAt(y+2))<<16;case 2:p^=(255&i.charCodeAt(y+1))<<8;case 1:h^=p=(65535&(p=(p=(65535&(p^=255&i.charCodeAt(y)))*g+(((p>>>16)*g&65535)<<16)&4294967295)<<15|p>>>17))*v+(((p>>>16)*v&65535)<<16)&4294967295}return h^=i.length,h=2246822507*(65535&(h^=h>>>16))+((2246822507*(h>>>16)&65535)<<16)&4294967295,h=3266489909*(65535&(h^=h>>>13))+((3266489909*(h>>>16)&65535)<<16)&4294967295,(h^=h>>>16)>>>0}),tn.exports),e=(dc||(dc=1,Pn.exports=function(i,o){for(var l,a=i.length,h=o^a,m=0;a>=4;)l=1540483477*(65535&(l=255&i.charCodeAt(m)|(255&i.charCodeAt(++m))<<8|(255&i.charCodeAt(++m))<<16|(255&i.charCodeAt(++m))<<24))+((1540483477*(l>>>16)&65535)<<16),h=1540483477*(65535&h)+((1540483477*(h>>>16)&65535)<<16)^(l=1540483477*(65535&(l^=l>>>24))+((1540483477*(l>>>16)&65535)<<16)),a-=4,++m;switch(a){case 3:h^=(255&i.charCodeAt(m+2))<<16;case 2:h^=(255&i.charCodeAt(m+1))<<8;case 1:h=1540483477*(65535&(h^=255&i.charCodeAt(m)))+((1540483477*(h>>>16)&65535)<<16)}return h=1540483477*(65535&(h^=h>>>13))+((1540483477*(h>>>16)&65535)<<16),(h^=h>>>15)>>>0}),Pn.exports);return Fs.exports=n,Fs.exports.murmur3=n,Fs.exports.murmur2=e,Fs.exports}(),rn=gt(ko);class Zr{constructor(e,...i){Lr(this,i[0]||{}),this.type=e}}class Bs extends Zr{constructor(e,i={}){super("error",Lr({error:e},i))}}function o3(n,e,i){i[n]&&i[n].indexOf(e)!==-1||(i[n]=i[n]||[],i[n].push(e))}function V0(n,e,i){if(i&&i[n]){const o=i[n].indexOf(e);o!==-1&&i[n].splice(o,1)}}class Cn{on(e,i){return this._listeners=this._listeners||{},o3(e,i,this._listeners),this}off(e,i){return V0(e,i,this._listeners),V0(e,i,this._oneTimeListeners),this}once(e,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},o3(e,i,this._oneTimeListeners),this):new Promise(o=>{this.once(e,o)})}fire(e,i){const o=typeof e=="string"?new Zr(e,i):e,l=o.type;if(this.listens(l)){o.target=this;const a=this._listeners&&this._listeners[l]?this._listeners[l].slice():[];for(const g of a)g.call(this,o);const h=this._oneTimeListeners&&this._oneTimeListeners[l]?this._oneTimeListeners[l].slice():[];for(const g of h)V0(l,g,this._oneTimeListeners),g.call(this,o);const m=this._eventedParent;m&&(Lr(o,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),m.fire(o))}else o instanceof Bs&&console.error(o.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,i){return this._eventedParent=e,this._eventedParentData=i,this}}class Ur{constructor(e){typeof e=="string"?this.name=e:(this.name=e.name,this.iconsetId=e.iconsetId)}static from(e){return new Ur(e)}static toString(e){return e.iconsetId?`${e.name}${e.iconsetId}`:e.name}static parse(e){const[i,o]=e.split("");return new Ur({name:i,iconsetId:o})}static isEqual(e,i){return e.name===i.name&&e.iconsetId===i.iconsetId}toString(){return Ur.toString(this)}serialize(){return{name:this.name,iconsetId:this.iconsetId}}}var pc,s3={},yn=function(){if(pc)return s3;pc=1;var n={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function e(a){return(a=Math.round(a))<0?0:a>255?255:a}function i(a){return e(a[a.length-1]==="%"?parseFloat(a)/100*255:parseInt(a))}function o(a){return(h=a[a.length-1]==="%"?parseFloat(a)/100:parseFloat(a))<0?0:h>1?1:h;var h}function l(a,h,m){return m<0?m+=1:m>1&&(m-=1),6*m<1?a+(h-a)*m*6:2*m<1?h:3*m<2?a+(h-a)*(2/3-m)*6:a}try{s3.parseCSSColor=function(a){var h,m=a.replace(/ /g,"").toLowerCase();if(m in n)return n[m].slice();if(m[0]==="#")return m.length===4?(h=parseInt(m.substr(1),16))>=0&&h<=4095?[(3840&h)>>4|(3840&h)>>8,240&h|(240&h)>>4,15&h|(15&h)<<4,1]:null:m.length===7&&(h=parseInt(m.substr(1),16))>=0&&h<=16777215?[(16711680&h)>>16,(65280&h)>>8,255&h,1]:null;var g=m.indexOf("("),v=m.indexOf(")");if(g!==-1&&v+1===m.length){var p=m.substr(0,g),y=m.substr(g+1,v-(g+1)).split(","),w=1;switch(p){case"rgba":if(y.length!==4)return null;w=o(y.pop());case"rgb":return y.length!==3?null:[i(y[0]),i(y[1]),i(y[2]),w];case"hsla":if(y.length!==4)return null;w=o(y.pop());case"hsl":if(y.length!==3)return null;var x=(parseFloat(y[0])%360+360)%360/360,b=o(y[1]),S=o(y[2]),I=S<=.5?S*(b+1):S+b-S*b,P=2*S-I;return[e(255*l(P,I,x+1/3)),e(255*l(P,I,x)),e(255*l(P,I,x-1/3)),w];default:return null}}return null}}catch{}return s3}();class bi{constructor(e,i,o,l=1){this.r=e,this.g=i,this.b=o,this.a=l}static parse(e){if(!e)return;if(e instanceof bi)return e;if(typeof e!="string")return;const i=yn.parseCSSColor(e);return i?new bi(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3]):void 0}toStringPremultipliedAlpha(){const[e,i,o,l]=this.a===0?[0,0,0,0]:[255*this.r/this.a,255*this.g/this.a,255*this.b/this.a,this.a];return`rgba(${Math.round(e)},${Math.round(i)},${Math.round(o)},${l})`}toString(){const[e,i,o,l]=[this.r,this.g,this.b,this.a];return`rgba(${Math.round(255*e)},${Math.round(255*i)},${Math.round(255*o)},${l})`}toRenderColor(e){const{r:i,g:o,b:l,a}=this;return new a3(e,i,o,l,a)}clone(){return new bi(this.r,this.g,this.b,this.a)}}class a3{constructor(e,i,o,l,a){if(e){const h=e.image.height,m=h*h;i=a===0?0:i/a*(h-1),o=a===0?0:o/a*(h-1),l=a===0?0:l/a*(h-1);const g=Math.floor(i),v=Math.floor(o),p=Math.floor(l),y=Math.ceil(i),w=Math.ceil(o),x=Math.ceil(l),b=i-g,S=o-v,I=l-p,P=e.image.data,O=4*(g+v*m+p*h),L=4*(g+v*m+x*h),D=4*(g+w*m+p*h),F=4*(g+w*m+x*h),V=4*(y+v*m+p*h),q=4*(y+v*m+x*h),J=4*(y+w*m+p*h),X=4*(y+w*m+x*h);if(O<0||X>=P.length)throw new Error("out of range");this.r=St(St(St(P[O],P[L],I),St(P[D],P[F],I),S),St(St(P[V],P[q],I),St(P[J],P[X],I),S),b)/255*a,this.g=St(St(St(P[O+1],P[L+1],I),St(P[D+1],P[F+1],I),S),St(St(P[V+1],P[q+1],I),St(P[J+1],P[X+1],I),S),b)/255*a,this.b=St(St(St(P[O+2],P[L+2],I),St(P[D+2],P[F+2],I),S),St(St(P[V+2],P[q+2],I),St(P[J+2],P[X+2],I),S),b)/255*a,this.a=a}else this.r=i,this.g=o,this.b=l,this.a=a}toArray(){const{r:e,g:i,b:o,a:l}=this;return l===0?[0,0,0,0]:[255*e/l,255*i/l,255*o/l,l]}toHslaArray(){if(this.a===0)return[0,0,0,0];const{r:e,g:i,b:o,a:l}=this,a=Math.min(Math.max(e/l,0),1),h=Math.min(Math.max(i/l,0),1),m=Math.min(Math.max(o/l,0),1),g=Math.min(a,h,m),v=Math.max(a,h,m),p=(g+v)/2;if(g===v)return[0,0,100*p,l];const y=v-g,w=p>.5?y/(2-v-g):y/(v+g);let x=0;return v===a?x=(h-m)/y+(hSt(o,e[l],i))}function mc(n){return n*n*n*n*n}bi.black=new bi(0,0,0,1),bi.white=new bi(1,1,1,1),bi.transparent=new bi(0,0,0,0),bi.red=new bi(1,0,0,1),bi.blue=new bi(0,0,1,1);var ja=Object.freeze({__proto__:null,array:fc,color:function(n,e,i){return new bi(St(n.r,e.r,i),St(n.g,e.g,i),St(n.b,e.b,i),St(n.a,e.a,i))},easeIn:mc,number:St});function ni(n,...e){for(const i of e)for(const o in i)n[o]=i[o];return n}class xn extends Error{constructor(e,i){super(i),this.message=i,this.key=e}}class U0{constructor(e,i=[]){this.parent=e,this.bindings={};for(const[o,l]of i)this.bindings[o]=l}concat(e){return new U0(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const Ns={kind:"null"},_t={kind:"number"},gi={kind:"string"},ai={kind:"boolean"},Ir={kind:"color"},Vs={kind:"object"},ui={kind:"value"},io={kind:"collator"},Ga={kind:"formatted"},ro={kind:"resolvedImage"};function vr(n,e){return{kind:"array",itemType:n,N:e}}function Xi(n){if(n.kind==="array"){const e=Xi(n.itemType);return typeof n.N=="number"?`array<${e}, ${n.N}>`:n.itemType.kind==="value"?"array":`array<${e}>`}return n.kind}const zn=[Ns,_t,gi,ai,Ir,Ga,Vs,vr(ui),ro];function Us(n,e){if(e.kind==="error")return null;if(n.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Us(n.itemType,e.itemType))&&(typeof n.N!="number"||n.N===e.N))return null}else{if(n.kind===e.kind)return null;if(n.kind==="value"){for(const i of zn)if(!Us(i,e))return null}}return`Expected ${Xi(n)} but found ${Xi(e)} instead.`}function l3(n,e){return e.some(i=>i.kind===n.kind)}function js(n,e){return e.some(i=>i==="null"?n===null:i==="array"?Array.isArray(n):i==="object"?n&&!Array.isArray(n)&&typeof n=="object":i===typeof n)}class j0{constructor(e,i,o){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=o,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,i){return this.collator.compare(e,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class qa{constructor(e,i,o,l,a){this.text=e.normalize?e.normalize():e,this.image=i,this.scale=o,this.fontStack=l,this.textColor=a}}class Pr{constructor(e){this.sections=e}static fromString(e){return new Pr([new qa(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||!!e.image&&e.image.hasPrimary())}static factory(e){return e instanceof Pr?e:Pr.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const i of this.sections){if(i.image){const l=i.image.getPrimary().id.toString();e.push(["image",l]);continue}e.push(i.text);const o={};i.fontStack&&(o["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(o["font-scale"]=i.scale),i.textColor&&(o["text-color"]=["rgba"].concat(i.textColor.toRenderColor(null).toArray())),e.push(o)}return e}}class qn{constructor(e,i={}){if(this.id=Ur.from(e),this.options=Object.assign({},i),i.transform){const{a:o,b:l,c:a,d:h,e:m,f:g}=i.transform;this.options.transform=new DOMMatrix([o,l,a,h,m,g])}else this.options.transform=new DOMMatrix([1,0,0,1,0,0])}toString(){const{a:e,b:i,c:o,d:l,e:a,f:h}=this.options.transform;return JSON.stringify({name:this.id.name,iconsetId:this.id.iconsetId,params:this.options.params,transform:{a:e,b:i,c:o,d:l,e:a,f:h}})}static parse(e){let i,o,l,a;try{({name:i,iconsetId:o,params:l,transform:a}=JSON.parse(e)||{})}catch{return null}if(!i)return null;const{a:h,b:m,c:g,d:v,e:p,f:y}=a||{};return new qn({name:i,iconsetId:o},{params:l,transform:new DOMMatrix([h,m,g,v,p,y])})}scaleSelf(e){return this.options.transform.scaleSelf(e),this}}class Cr{constructor(e,i,o,l,a=!1){this.primaryId=Ur.from(e),this.primaryOptions=i,o&&(this.secondaryId=Ur.from(o)),this.secondaryOptions=l,this.available=a}toString(){return this.primaryId&&this.secondaryId?`[${this.primaryId.name},${this.secondaryId.name}]`:this.primaryId.name}hasPrimary(){return!!this.primaryId}getPrimary(){return new qn(this.primaryId,this.primaryOptions)}hasSecondary(){return!!this.secondaryId}getSecondary(){return this.secondaryId?new qn(this.secondaryId,this.secondaryOptions):null}static from(e){return typeof e=="string"?Cr.build({name:e}):e}static build(e,i,o,l){return!e||typeof e=="object"&&!("name"in e)?null:new Cr(e,o,i,l)}}function $a(n,e,i,o){return typeof n=="number"&&n>=0&&n<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof i=="number"&&i>=0&&i<=255?o===void 0||typeof o=="number"&&o>=0&&o<=1?null:`Invalid rgba value [${[n,e,i,o].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof o=="number"?[n,e,i,o]:[n,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Rn(n){if(n===null||typeof n=="string"||typeof n=="boolean"||typeof n=="number"||n instanceof bi||n instanceof j0||n instanceof Pr||n instanceof Cr)return!0;if(Array.isArray(n)){for(const e of n)if(!Rn(e))return!1;return!0}if(typeof n=="object"){for(const e in n)if(!Rn(n[e]))return!1;return!0}return!1}function ir(n){if(n===null)return Ns;if(typeof n=="string")return gi;if(typeof n=="boolean")return ai;if(typeof n=="number")return _t;if(n instanceof bi)return Ir;if(n instanceof j0)return io;if(n instanceof Pr)return Ga;if(n instanceof Cr)return ro;if(Array.isArray(n)){const e=n.length;let i;for(const o of n){const l=ir(o);if(i){if(i===l)continue;i=ui;break}i=l}return vr(i||ui,e)}return Vs}function pr(n){const e=typeof n;return n===null?"":e==="string"||e==="number"||e==="boolean"?String(n):n instanceof bi?n.toStringPremultipliedAlpha():n instanceof Pr||n instanceof Cr?n.toString():JSON.stringify(n)}class no{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(e.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Rn(e[1]))return i.error("invalid value");const o=e[1];let l=ir(o);const a=i.expectedType;return l.kind!=="array"||l.N!==0||!a||a.kind!=="array"||typeof a.N=="number"&&a.N!==0||(l=a),new no(l,o)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof bi?["rgba"].concat(this.value.toRenderColor(null).toArray()):this.value instanceof Pr?this.value.serialize():this.value}}class Ki{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const c3={string:gi,number:_t,boolean:ai,object:Vs};class nn{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let o,l=1;const a=e[0];if(a==="array"){let m,g;if(e.length>2){const v=e[1];if(typeof v!="string"||!(v in c3)||v==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);m=c3[v],l++}else m=ui;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);g=e[2],l++}o=vr(m,g)}else o=c3[a];const h=[];for(;le.outputDefined())}serialize(){const e=this.type,i=[e.kind];if(e.kind==="array"){const o=e.itemType;if(o.kind==="string"||o.kind==="number"||o.kind==="boolean"){i.push(o.kind);const l=e.N;(typeof l=="number"||this.args.length>1)&&i.push(l)}}return i.concat(this.args.map(o=>o.serialize()))}}class Gs{constructor(e){this.type=Ga,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const o=e[1];if(!Array.isArray(o)&&typeof o=="object")return i.error("First argument must be an image or text section.");const l=[];let a=!1;for(let h=1;h<=e.length-1;++h){const m=e[h];if(a&&typeof m=="object"&&!Array.isArray(m)){a=!1;let g=null;if(m["font-scale"]&&(g=i.parseObjectValue(m["font-scale"],h,"font-scale",_t),!g))return null;let v=null;if(m["text-font"]&&(v=i.parseObjectValue(m["text-font"],h,"text-font",vr(gi)),!v))return null;let p=null;if(m["text-color"]&&(p=i.parseObjectValue(m["text-color"],h,"text-color",Ir),!p))return null;const y=l[l.length-1];y.scale=g,y.font=v,y.textColor=p}else{const g=i.parse(e[h],h,ui);if(!g)return null;const v=g.type.kind;if(v!=="string"&&v!=="value"&&v!=="null"&&v!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,l.push({content:g,scale:null,font:null,textColor:null})}}return new Gs(l)}evaluate(e){return new Pr(this.sections.map(i=>{const o=i.content.evaluate(e);return ir(o)===ro?new qa("",o,null,null,null):new qa(pr(o),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null)}))}eachChild(e){for(const i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const i of this.sections){e.push(i.content.serialize());const o={};i.scale&&(o["font-scale"]=i.scale.serialize()),i.font&&(o["text-font"]=i.font.serialize()),i.textColor&&(o["text-color"]=i.textColor.serialize()),e.push(o)}return e}}class Fo{constructor(e,i,o,l){this._imageWarnHistory={},this.type=ro,this.namePrimary=e,this.nameSecondary=i,o&&(this.paramsPrimary=o.params,this.iconsetIdPrimary=o.iconset?o.iconset.id:void 0),l&&(this.paramsSecondary=l.params,this.iconsetIdSecondary=l.iconset?l.iconset.id:void 0)}static parse(e,i){if(e.length<2)return i.error("Expected two or more arguments.");let o=1;const l=[];function a(){if(oUr.isEqual(h,a)),l.available){const h=l.getSecondary()?l.getSecondary().id:null;h&&(l.available=e.availableImages.some(m=>Ur.isEqual(m,h)))}}return l}eachChild(e){if(e(this.namePrimary),this.paramsPrimary)for(const i in this.paramsPrimary)this.paramsPrimary[i]&&e(this.paramsPrimary[i]);if(this.nameSecondary&&(e(this.nameSecondary),this.paramsSecondary))for(const i in this.paramsSecondary)this.paramsSecondary[i]&&e(this.paramsSecondary[i])}outputDefined(){return!1}serializeOptions(e,i){const o={};if(i&&(o.iconset={id:i}),e){o.params={};for(const l in e)e[l]&&(o.params[l]=e[l].serialize())}return Object.keys(o).length>0?o:void 0}serialize(){const e=["image",this.namePrimary.serialize()];if(this.paramsPrimary||this.iconsetIdPrimary){const i=this.serializeOptions(this.paramsPrimary,this.iconsetIdPrimary);i&&e.push(i)}if(this.nameSecondary&&(e.push(this.nameSecondary.serialize()),this.paramsSecondary||this.iconsetIdSecondary)){const i=this.serializeOptions(this.paramsSecondary,this.iconsetIdSecondary);i&&e.push(i)}return e}}function oo(n){return n instanceof Number?"number":n instanceof String?"string":n instanceof Boolean?"boolean":Array.isArray(n)?"array":n===null?"null":typeof n}const bh={"to-boolean":ai,"to-color":Ir,"to-number":_t,"to-string":gi};class so{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const o=e[0],l=[];let a=Ns;if(o==="to-array"){if(!Array.isArray(e[1]))return null;const h=e[1].length;if(i.expectedType){if(i.expectedType.kind!=="array")return i.error(`Expected ${i.expectedType.kind} but found array.`);a=vr(i.expectedType.itemType,h)}else{if(!(h>0&&Rn(e[1][0])))return null;a=vr(ir(e[1][0]),h)}for(let m=0;m4?`Invalid rbga value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:$a(i[0],i[1],i[2],i[3]),!o))return new bi(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new Ki(o||`Could not parse color from value '${typeof i=="string"?i:String(JSON.stringify(i))}'`)}if(this.type.kind==="number"){let i=null;for(const o of this.args){if(i=o.evaluate(e),i===null)return 0;const l=Number(i);if(!isNaN(l))return l}throw new Ki(`Could not convert ${JSON.stringify(i)} to number.`)}return this.type.kind==="formatted"?Pr.fromString(pr(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Cr.build(pr(this.args[0].evaluate(e))):this.type.kind==="array"?this.args.map(i=>i.evaluate(e)):pr(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if(this.type.kind==="formatted")return new Gs([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Fo(this.args[0]).serialize();const e=this.type.kind==="array"?[]:[`to-${this.type.kind}`];return this.eachChild(i=>{e.push(i.serialize())}),e}}const wh=["Unknown","Point","LineString","Polygon"];class G0{constructor(e,i){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.scope=e,this.options=i}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?wh[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||{}}measureLight(e){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,i=this.featureDistanceData.scale,{x:o,y:l}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(o*i-e[0])+this.featureDistanceData.bearing[1]*(l*i-e[1])}return 0}parseColor(e){let i=this._parseColorCache[e];return i||(i=this._parseColorCache[e]=bi.parse(e)),i}getConfig(e){return this.options?this.options.get(e):null}}class kr{constructor(e,i,o,l,a){this.name=e,this.type=i,this._evaluate=o,this.args=l,this._overloadIndex=a}evaluate(e){if(!this._evaluate){const i=kr.definitions[this.name];this._evaluate=Array.isArray(i)?i[2]:i.overloads[this._overloadIndex][1]}return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,i){const o=e[0],l=kr.definitions[o];if(!l)return i.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0);const a=Array.isArray(l)?l[0]:l.type,h=Array.isArray(l)?[[l[1],l[2]]]:l.overloads,m=[];let g=null,v=-1;for(const[p,y]of h){if(Array.isArray(p)&&p.length!==e.length-1)continue;m.push(p),v++,g=new _3(i.registry,i.path,null,i.scope,void 0,i._scope,i.options);const w=[];let x=!1;for(let b=1;bw)).map(Th).join(" | "),y=[];for(let w=1;wi;){if(o-i>600){const g=o-i+1,v=e-i+1,p=Math.log(g),y=.5*Math.exp(2*p/3),w=.5*Math.sqrt(p*y*(g-y)/g)*(v-g/2<0?-1:1);_c(n,e,Math.max(i,Math.floor(e-v*y/g+w)),Math.min(o,Math.floor(e+(g-v)*y/g+w)),l)}const a=n[e];let h=i,m=o;for(Ha(n,i,e),l(n[o],a)>0&&Ha(n,i,o);h0;)m--}l(n[i],a)===0?Ha(n,i,m):(m++,Ha(n,m,o)),m<=e&&(i=m+1),e<=m&&(o=m-1)}}function Ha(n,e,i){const o=n[e];n[e]=n[i],n[i]=o}function Sh(n,e){return ne?1:0}function Eh(n){let e=0;for(let i,o,l=0,a=n.length,h=a-1;l=e[2]||n[1]<=e[1]||n[3]>=e[3])}function Mh(n,e,i){const o=n[0]-e[0],l=n[1]-e[1],a=n[0]-i[0],h=n[1]-i[1];return o*h-a*l==0&&o*a<=0&&l*h<=0}function cs(n,e,i=!1){let o=!1;for(let m=0,g=e.length;m(l=n)[1]!=(h=b)[1]>l[1]&&l[0]<(h[0]-a[0])*(l[1]-a[1])/(h[1]-a[1])+a[0]&&(o=!o)}}var l,a,h;return o}function us(n,e,i,o){const l=o[0]-i[0],a=o[1]-i[1],h=(n[0]-i[0])*a-l*(n[1]-i[1]),m=(e[0]-i[0])*a-l*(e[1]-i[1]);return h>0&&m<0||h<0&&m>0}function q0(n,e,i,o){return(l=[o[0]-i[0],o[1]-i[1]])[0]*(a=[e[0]-n[0],e[1]-n[1]])[1]-l[1]*a[0]!=0&&!(!us(n,e,i,o)||!us(i,o,n,e));var l,a}const Bo=8192;function u3(n,e){const i=(180+n[0])/360,o=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n[1]*Math.PI/360)))/360,l=Math.pow(2,e.z);return[Math.round(i*l*Bo),Math.round(o*l*Bo)]}function Ah(n,e){for(let i=0;ii[2]){const l=.5*o;let a=n[0]-i[0]>l?-o:i[0]-n[0]>l?o:0;a===0&&(a=n[0]-i[2]>l?-o:i[2]-n[0]>l?o:0),n[0]+=a}Za(e,n)}function $0(n,e,i,o){const l=Math.pow(2,o.z)*Bo,a=[o.x*Bo,o.y*Bo],h=[];if(!n)return h;for(const m of n)for(const g of m){const v=[g.x+a[0],g.y+a[1]];xt(v,e,i,l),h.push(v)}return h}function Lt(n,e,i,o){const l=Math.pow(2,o.z)*Bo,a=[o.x*Bo,o.y*Bo],h=[];if(!n)return h;for(const g of n){const v=[];for(const p of g){const y=[p.x+a[0],p.y+a[1]];Za(e,y),v.push(y)}h.push(v)}if(e[2]-e[0]<=l/2){(m=e)[0]=m[1]=1/0,m[2]=m[3]=-1/0;for(const g of h)for(const v of g)xt(v,e,i,l)}var m;return h}class ao{constructor(e,i){this.type=ai,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Rn(e[1])){const o=e[1];if(o.type==="FeatureCollection")for(let l=0;li)return Hs(a,h,(i-(o-m))/m)}return e[e.length-1]}pointToSegmentDistance(e,i,o){let[l,a]=i,h=Zi(o[0]-l)*this.kx,m=(o[1]-a)*this.ky;if(h!==0||m!==0){const g=(Zi(e[0]-l)*this.kx*h+(e[1]-a)*this.ky*m)/(h*h+m*m);g>1?(l=o[0],a=o[1]):g>0&&(l+=h/this.kx*g,a+=m/this.ky*g)}return h=Zi(e[0]-l)*this.kx,m=(e[1]-a)*this.ky,Math.sqrt(h*h+m*m)}pointOnLine(e,i){let o=1/0,l=e[0][0],a=e[0][1],h=0,m=0;for(let g=0;g1?(v=e[g+1][0],p=e[g+1][1]):x>0&&(v+=y/this.kx*x,p+=w/this.ky*x)),y=Zi(i[0]-v)*this.kx,w=(i[1]-p)*this.ky;const b=y*y+w*w;ba.index||l.index===a.index&&l.t>a.t){const v=l;l=a,a=v}const h=[l.point],m=l.index+1,g=a.index;!d3(o[m],h[0])&&m<=g&&h.push(o[m]);for(let v=m+1;v<=g;v++)h.push(o[v]);return d3(o[g],a.point)||h.push(a.point),h}lineSliceAlong(e,i,o){let l=0;const a=[];for(let h=0;he&&a.length===0&&a.push(Hs(m,g,(e-(l-v))/v)),l>=i)return a.push(Hs(m,g,(i-(l-v))/v)),a;l>e&&a.push(g)}return a}bufferPoint(e,i){const o=i/this.ky,l=i/this.kx;return[e[0]-l,e[1]-o,e[0]+l,e[1]+o]}bufferBBox(e,i){const o=i/this.ky,l=i/this.kx;return[e[0]-l,e[1]-o,e[2]+l,e[3]+o]}insideBBox(e,i){return Zi(e[0]-i[0])>=0&&Zi(e[0]-i[2])<=0&&e[1]>=i[1]&&e[1]<=i[3]}}function d3(n,e){return n[0]===e[0]&&n[1]===e[1]}function Hs(n,e,i){const o=Zi(e[0]-n[0]);return[n[0]+o*i,n[1]+(e[1]-n[1])*i]}function Zi(n){for(;n<-180;)n+=360;for(;n>180;)n-=360;return n}class Xa{constructor(e=[],i=(o,l)=>ol?1:0){if(this.data=e,this.length=this.data.length,this.compare=i,this.length>0)for(let o=(this.length>>1)-1;o>=0;o--)this._down(o)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;const e=this.data[0],i=this.data.pop();return--this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:i,compare:o}=this,l=i[e];for(;e>0;){const a=e-1>>1,h=i[a];if(o(l,h)>=0)break;i[e]=h,e=a}i[e]=l}_down(e){const{data:i,compare:o}=this,l=this.length>>1,a=i[e];for(;e=0)break;i[e]=i[h],e=h}i[e]=a}}var Je=8192;function H0(n,e){return e.dist-n.dist}const lo=100,br=50;function yc(n){const e=[1/0,1/0,-1/0,-1/0];if(e.length!==n.length)return!1;for(let i=0;i=n[0]&&n[1]n[1])return[null,null];const i=Z0(n);if(e){if(i===2)return[n,null];const o=Math.floor(i/2);return[[n[0],n[0]+o],[n[0]+o,n[1]]]}{if(i===1)return[n,null];const o=Math.floor(i/2)-1;return[[n[0],n[0]+o],[n[0]+o+1,n[1]]]}}function Vo(n,e){const i=[1/0,1/0,-1/0,-1/0];if(!co(e,n.length))return i;for(let o=e[0];o<=e[1];++o)Za(i,n[o]);return i}function Ws(n){const e=[1/0,1/0,-1/0,-1/0];for(let i=0;ie[2]&&(o=n[0]-e[2]),n[1]>e[3]&&(l=n[1]-e[3]),n[3]=o)return o;if(Wa(l,a)){if(X0(n,e))return 0}else if(X0(e,n))return 0;let h=o;for(const m of n)for(let g=0,v=m.length,p=v-1;g=a)continue;const p=v.range1;if(Z0(p)<=m){if(!co(p,n.length))return NaN;if(e){const y=Lh(n,p,i,o);if((a=Math.min(a,y))===0)return a}else for(let y=p[0];y<=p[1];++y){const w=Dh(n[y],i,o);if((a=Math.min(a,w))===0)return a}}else{const y=Zs(p,e);if(y[0]!==null){const w=Xs(Vo(n,y[0]),g,o);w=h)continue;const y=p.range1,w=p.range2;if(Z0(y)<=g&&Z0(w)<=v){if(!co(y,n.length)||!co(w,i.length))return NaN;if(e&&o?h=Math.min(h,Rh(n,y,i,w,l)):e||o?e&&!o?h=Math.min(h,bc(i,w,n,y,l)):!e&&o&&(h=Math.min(h,bc(n,y,i,w,l))):h=Math.min(h,ds(n,y,i,w,l)),h===0)return h}else{const x=Zs(y,e),b=Zs(w,o);Ya(m,h,l,n,i,x[0],b[0]),Ya(m,h,l,n,i,x[0],b[1]),Ya(m,h,l,n,i,x[1],b[0]),Ya(m,h,l,n,i,x[1],b[1])}}return h}function Y0(n,e,i,o,l=1/0){let a=l;const h=Vo(n,[0,n.length-1]);for(const m of i)if(!(a!==1/0&&Xs(h,Vo(m,[0,m.length-1]),o)>=a)&&(a=Math.min(a,f3(n,e,m,!0,o,a)),a===0))return a;return a}function Ka(n,e,i,o,l=1/0){let a=l;const h=Vo(n,[0,n.length-1]);for(const m of i){if(a!==1/0&&Xs(h,Ws(m),o)>=a)continue;const g=Dn(n,e,m,o,a);if(isNaN(g))return g;if((a=Math.min(a,g))===0)return a}return a}function K0(n){return n==="Point"||n==="MultiPoint"||n==="LineString"||n==="MultiLineString"||n==="Polygon"||n==="MultiPolygon"}class Uo{constructor(e,i){this.type=_t,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'distance' expression requires either one argument, but found ' ${e.length-1} instead.`);if(Rn(e[1])){const o=e[1];if(o.type==="FeatureCollection"){for(let l=0;li&&(n=i),n}class ps{constructor(e,i,o){this.type=e,this.key=i,this.scope=o}static parse(e,i){let o=i.expectedType;if(o==null&&(o=ui),e.length<2||e.length>3)return i.error("Invalid number of arguments for 'config' expression.");const l=i.parse(e[1],1);if(!(l instanceof no))return i.error("Key name of 'config' expression must be a string literal.");if(e.length>=3){const a=i.parse(e[2],2);return a instanceof no?new ps(o,pr(l.value),pr(a.value)):i.error("Scope of 'config' expression must be a string literal.")}return new ps(o,pr(l.value))}evaluate(e){const i=[this.key,this.scope,e.scope].filter(Boolean).join(""),o=e.getConfig(i);if(!o)return null;const{type:l,value:a,values:h,minValue:m,maxValue:g,stepValue:v}=o,p=o.default.evaluate(e);let y=p;if(a){const w=e.scope;e.scope=(w||"").split("").slice(1).join(""),y=a.evaluate(e),e.scope=w}return l&&(y=J0(l,y)),y===void 0||m===void 0&&g===void 0&&v===void 0||(typeof y=="number"?y=m3(y,m,g,v):Array.isArray(y)&&(y=y.map(w=>typeof w=="number"?m3(w,m,g,v):w))),a!==void 0&&y!==void 0&&h&&!h.includes(y)&&(y=p,l&&(y=J0(l,y))),(l&&l!==this.type||y!==void 0&&ir(y)!==this.type)&&(y=J0(this.type.kind,y)),y}eachChild(){}outputDefined(){return!1}serialize(){const e=["config",this.key];return this.scope&&e.concat(this.key),e}}function Ys(n){if(n instanceof kr&&(n.name==="get"&&n.args.length===1||n.name==="feature-state"||n.name==="has"&&n.args.length===1||n.name==="properties"||n.name==="geometry-type"||n.name==="id"||/^filter-/.test(n.name))||n instanceof ao||n instanceof Uo)return!1;let e=!0;return n.eachChild(i=>{e&&!Ys(i)&&(e=!1)}),e}function Ja(n){if(n instanceof kr&&n.name==="feature-state")return!1;let e=!0;return n.eachChild(i=>{e&&!Ja(i)&&(e=!1)}),e}function Qa(n){if(n instanceof ps)return new Set([n.key]);let e=new Set;return n.eachChild(i=>{e=new Set([...e,...Qa(i)])}),e}function uo(n,e){if(n instanceof kr&&e.indexOf(n.name)>=0)return!1;let i=!0;return n.eachChild(o=>{i&&!uo(o,e)&&(i=!1)}),i}class fs{constructor(e,i){this.type=i.type,this.name=e,this.boundExpression=i}static parse(e,i){if(e.length!==2||typeof e[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const o=e[1];return i.scope.has(o)?new fs(o,i.scope.get(o)):i.error(`Unknown variable "${o}". Make sure "${o}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Ks{constructor(e,i=[],o,l=new U0,a=[],h,m){this.registry=e,this.path=i,this.key=i.map(g=>typeof g=="string"?`['${g}']`:`[${g}]`).join(""),this.scope=l,this.errors=a,this.expectedType=o,this._scope=h,this.options=m}parse(e,i,o,l,a={}){return i||o?this.concat(i,null,o,l)._parse(e,a):this._parse(e,a)}parseObjectValue(e,i,o,l,a,h={}){return this.concat(i,o,l,a)._parse(e,h)}_parse(e,i){function o(l,a,h){return h==="assert"?new nn(a,[l]):h==="coerce"?new so(a,[l]):l}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const l=typeof e[0]=="string"?this.registry[e[0]]:void 0;if(l){let a=l.parse(e,this);if(!a)return null;if(this.expectedType){const h=this.expectedType,m=a.type;if(h.kind!=="string"&&h.kind!=="number"&&h.kind!=="boolean"&&h.kind!=="object"&&h.kind!=="array"||m.kind!=="value")if(h.kind!=="color"&&h.kind!=="formatted"&&h.kind!=="resolvedImage"||m.kind!=="value"&&m.kind!=="string"){if(this.checkSubtype(h,m))return null}else a=o(a,h,i.typeAnnotation||"coerce");else a=o(a,h,i.typeAnnotation||"assert")}if(!(a instanceof no)&&a.type.kind!=="resolvedImage"&&Q0(a)){const h=new G0(this._scope,this.options);try{a=new no(a.type,a.evaluate(h))}catch(m){return this.error(m.message),null}}return a}return so.parse(["to-array",e],this)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,i,o,l){let a=typeof e=="number"?this.path.concat(e):this.path;a=typeof i=="string"?a.concat(i):a;const h=l?this.scope.concat(l):this.scope;return new Ks(this.registry,a,o||null,h,this.errors,this._scope,this.options)}error(e,...i){const o=`${this.key}${i.map(l=>`[${l}]`).join("")}`;this.errors.push(new xn(o,e))}checkSubtype(e,i){const o=Us(e,i);return o&&this.error(o),o}}var _3=Ks;function Q0(n){if(n instanceof fs)return Q0(n.boundExpression);if(n instanceof kr&&n.name==="error"||n instanceof ls||n instanceof ao||n instanceof Uo||n instanceof ps)return!1;const e=n instanceof so||n instanceof nn;let i=!0;return n.eachChild(o=>{i=e?i&&Q0(o):i&&o instanceof no}),!!i&&Ys(n)&&uo(n,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}function e0(n,e){const i=n.length-1;let o,l,a=0,h=i,m=0;for(;a<=h;)if(m=Math.floor((a+h)/2),o=n[m],l=n[m+1],o<=e){if(m===i||ee))throw new Ki("Input is not a number.");h=m-1}return 0}class $n{constructor(e,i,o){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(const[l,a]of o)this.labels.push(l),this.outputs.push(a)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");const o=i.parse(e[1],1,_t);if(!o)return null;const l=[];let a=null;i.expectedType&&i.expectedType.kind!=="value"&&(a=i.expectedType);for(let h=1;h=m)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',v);const y=i.parse(g,p,a);if(!y)return null;a=a||y.type,l.push([m,y])}return new $n(a,o,l)}evaluate(e){const i=this.labels,o=this.outputs;if(i.length===1)return o[0].evaluate(e);const l=this.input.evaluate(e);if(l<=i[0])return o[0].evaluate(e);const a=i.length;return l>=i[a-1]?o[a-1].evaluate(e):o[e0(i,l)].evaluate(e)}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let i=0;i0&&e.push(this.labels[i]),e.push(this.outputs[i].serialize());return e}}const ei=.95047,Tc=1.08883,Sc=4/29,Js=6/29,g3=3*Js*Js,Oh=Js*Js*Js,Oi=Math.PI/180,kh=180/Math.PI;function y3(n){return n>Oh?Math.pow(n,1/3):n/g3+Sc}function x3(n){return n>Js?n*n*n:g3*(n-Sc)}function v3(n){return 255*(n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function b3(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Ec(n){const e=b3(n.r),i=b3(n.g),o=b3(n.b),l=y3((.4124564*e+.3575761*i+.1804375*o)/ei),a=y3((.2126729*e+.7151522*i+.072175*o)/1);return{l:116*a-16,a:500*(l-a),b:200*(a-y3((.0193339*e+.119192*i+.9503041*o)/Tc)),alpha:n.a}}function Mc(n){let e=(n.l+16)/116,i=isNaN(n.a)?e:e+n.a/500,o=isNaN(n.b)?e:e-n.b/200;return e=1*x3(e),i=ei*x3(i),o=Tc*x3(o),new bi(v3(3.2404542*i-1.5371385*e-.4985314*o),v3(-.969266*i+1.8760108*e+.041556*o),v3(.0556434*i-.2040259*e+1.0572252*o),n.alpha)}function Fh(n,e,i){const o=e-n;return n+i*(o>180||o<-180?o-360*Math.round(o/360):o)}const t0={forward:Ec,reverse:Mc,interpolate:function(n,e,i){return{l:St(n.l,e.l,i),a:St(n.a,e.a,i),b:St(n.b,e.b,i),alpha:St(n.alpha,e.alpha,i)}}},i0={forward:function(n){const{l:e,a:i,b:o}=Ec(n),l=Math.atan2(o,i)*kh;return{h:l<0?l+360:l,c:Math.sqrt(i*i+o*o),l:e,alpha:n.a}},reverse:function(n){const e=n.h*Oi,i=n.c;return Mc({l:n.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:n.alpha})},interpolate:function(n,e,i){return{h:Fh(n.h,e.h,i),c:St(n.c,e.c,i),l:St(n.l,e.l,i),alpha:St(n.alpha,e.alpha,i)}}};var Ac=Object.freeze({__proto__:null,hcl:i0,lab:t0});class on{constructor(e,i,o,l,a){this.type=e,this.operator=i,this.interpolation=o,this.input=l,this.labels=[],this.outputs=[];for(const[h,m]of a)this.labels.push(h),this.outputs.push(m)}static interpolationFactor(e,i,o,l){let a=0;if(e.name==="exponential")a=w3(i,e.base,o,l);else if(e.name==="linear")a=w3(i,1,o,l);else if(e.name==="cubic-bezier"){const h=e.controlPoints;a=new Do(h[0],h[1],h[2],h[3]).solve(w3(i,1,o,l))}return a}static parse(e,i){let[o,l,a,...h]=e;if(!Array.isArray(l)||l.length===0)return i.error("Expected an interpolation type expression.",1);if(l[0]==="linear")l={name:"linear"};else if(l[0]==="exponential"){const v=l[1];if(typeof v!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);l={name:"exponential",base:v}}else{if(l[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(l[0])}`,1,0);{const v=l.slice(1);if(v.length!==4||v.some(p=>typeof p!="number"||p<0||p>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);l={name:"cubic-bezier",controlPoints:v}}}if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length-1>3&&(e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(a=i.parse(a,2,_t),!a)return null;const m=[];let g=null;o==="interpolate-hcl"||o==="interpolate-lab"?g=Ir:i.expectedType&&i.expectedType.kind!=="value"&&(g=i.expectedType);for(let v=0;v=p)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',w);const b=i.parse(y,x,g);if(!b)return null;g=g||b.type,m.push([p,b])}return g.kind==="number"||g.kind==="color"||g.kind==="array"&&g.itemType.kind==="number"&&typeof g.N=="number"?new on(g,o,l,a,m):i.error(`Type ${Xi(g)} is not interpolatable.`)}evaluate(e){const i=this.labels,o=this.outputs;if(i.length===1)return o[0].evaluate(e);const l=this.input.evaluate(e);if(l<=i[0])return o[0].evaluate(e);const a=i.length;if(l>=i[a-1])return o[a-1].evaluate(e);const h=e0(i,l),m=on.interpolationFactor(this.interpolation,l,i[h],i[h+1]),g=o[h].evaluate(e),v=o[h+1].evaluate(e);return this.operator==="interpolate"?ja[this.type.kind.toLowerCase()](g,v,m):this.operator==="interpolate-hcl"?i0.reverse(i0.interpolate(i0.forward(g),i0.forward(v),m)):t0.reverse(t0.interpolate(t0.forward(g),t0.forward(v),m))}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier",...this.interpolation.controlPoints];const i=[this.operator,e,this.input.serialize()];for(let o=0;oUs(l,m.type));return new el(h?ui:o,a)}evaluate(e){let i,o=null,l=0;for(const a of this.args){if(l++,o=a.evaluate(e),o&&o instanceof Cr&&!o.available&&(i||(i=o),o=null,l===this.args.length))return i;if(o!==null)break}return o}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(i=>{e.push(i.serialize())}),e}}class tl{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const o=[];for(let a=1;a=o.length)throw new Ki(`Array index out of bounds: ${i} > ${o.length-1}.`);if(i!==Math.floor(i))throw new Ki(`Array index must be an integer, but found ${i} instead. Use at-interpolated to retrieve interpolated result with a fractional index.`);return o[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class S3{constructor(e,i,o){this.type=e,this.index=i,this.input=o}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const o=i.parse(e[1],1,_t),l=i.parse(e[2],2,vr(i.expectedType||ui));return o&&l?new S3(l.type.itemType,o,l):null}evaluate(e){const i=this.index.evaluate(e),o=this.input.evaluate(e);if(i<0)throw new Ki(`Array index out of bounds: ${i} < 0.`);if(i>o.length-1)throw new Ki(`Array index out of bounds: ${i} > ${o.length-1}.`);if(i===Math.floor(i))return o[i];const l=Math.floor(i),a=Math.ceil(i),h=o[l],m=o[a];if(typeof h!="number"||typeof m!="number")throw new Ki(`Cannot interpolate between non-number values at index ${i}.`);const g=i-l;return h*(1-g)+m*g}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at-interpolated",this.index.serialize(),this.input.serialize()]}}class E3{constructor(e,i){this.type=ai,this.needle=e,this.haystack=i}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const o=i.parse(e[1],1,ui),l=i.parse(e[2],2,ui);return o&&l?l3(o.type,[ai,gi,_t,Ns,ui])?new E3(o,l):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Xi(o.type)} instead`):null}evaluate(e){const i=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(o==null)return!1;if(!js(i,["boolean","string","number","null"]))throw new Ki(`Expected first argument to be of type boolean, string, number or null, but found ${Xi(ir(i))} instead.`);if(!js(o,["string","array"]))throw new Ki(`Expected second argument to be of type array or string, but found ${Xi(ir(o))} instead.`);return o.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class il{constructor(e,i,o){this.type=_t,this.needle=e,this.haystack=i,this.fromIndex=o}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const o=i.parse(e[1],1,ui),l=i.parse(e[2],2,ui);if(!o||!l)return null;if(!l3(o.type,[ai,gi,_t,Ns,ui]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Xi(o.type)} instead`);if(e.length===4){const a=i.parse(e[3],3,_t);return a?new il(o,l,a):null}return new il(o,l)}evaluate(e){const i=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!js(i,["boolean","string","number","null"]))throw new Ki(`Expected first argument to be of type boolean, string, number or null, but found ${Xi(ir(i))} instead.`);if(!js(o,["string","array"]))throw new Ki(`Expected second argument to be of type array or string, but found ${Xi(ir(o))} instead.`);if(this.fromIndex){const l=this.fromIndex.evaluate(e);return o.indexOf(i,l)}return o.indexOf(i)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class M3{constructor(e,i,o,l,a,h){this.inputType=e,this.type=i,this.input=o,this.cases=l,this.outputs=a,this.otherwise=h}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let o,l;i.expectedType&&i.expectedType.kind!=="value"&&(l=i.expectedType);const a={},h=[];for(let v=2;vNumber.MAX_SAFE_INTEGER)return w.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof b=="number"&&Math.floor(b)!==b)return w.error("Numeric branch labels must be integer values.");if(o){if(w.checkSubtype(o,ir(b)))return null}else o=ir(b);if(a[String(b)]!==void 0)return w.error("Branch labels must be unique.");a[String(b)]=h.length}const x=i.parse(y,v,l);if(!x)return null;l=l||x.type,h.push(x)}const m=i.parse(e[1],1,ui);if(!m)return null;const g=i.parse(e[e.length-1],e.length-1,l);return g?m.type.kind!=="value"&&i.concat(1).checkSubtype(o,m.type)?null:new M3(o,l,m,a,h,g):null}evaluate(e){const i=this.input.evaluate(e);return(ir(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],i=Object.keys(this.cases).sort(),o=[],l={};for(const h of i){const m=l[this.cases[h]];m===void 0?(l[this.cases[h]]=o.length,o.push([this.cases[h],[h]])):o[m][1].push(h)}const a=h=>this.inputType.kind==="number"?Number(h):h;for(const[h,m]of o)e.push(m.length===1?a(m[0]):m.map(a)),e.push(this.outputs[h].serialize());return e.push(this.otherwise.serialize()),e}}class A3{constructor(e,i,o){this.type=e,this.branches=i,this.otherwise=o}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let o;i.expectedType&&i.expectedType.kind!=="value"&&(o=i.expectedType);const l=[];for(let h=1;hi.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(i=>{e.push(i.serialize())}),e}}class rl{constructor(e,i,o,l){this.type=e,this.input=i,this.beginIndex=o,this.endIndex=l}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const o=i.parse(e[1],1,ui),l=i.parse(e[2],2,_t);if(!o||!l)return null;if(!l3(o.type,[vr(ui),gi,ui]))return i.error(`Expected first argument to be of type array or string, but found ${Xi(o.type)} instead`);if(e.length===4){const a=i.parse(e[3],3,_t);return a?new rl(o.type,o,l,a):null}return new rl(o.type,o,l)}evaluate(e){const i=this.input.evaluate(e),o=this.beginIndex.evaluate(e);if(!js(i,["string","array"]))throw new Ki(`Expected first argument to be of type array or string, but found ${Xi(ir(i))} instead.`);if(this.endIndex){const l=this.endIndex.evaluate(e);return i.slice(o,l)}return i.slice(o)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function Ic(n,e){return n==="=="||n==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Pc(n,e,i,o){return o.compare(e,i)===0}function Qs(n,e,i){const o=n!=="=="&&n!=="!=";return class f5{constructor(a,h,m){this.type=ai,this.lhs=a,this.rhs=h,this.collator=m,this.hasUntypedArgument=a.type.kind==="value"||h.type.kind==="value"}static parse(a,h){if(a.length!==3&&a.length!==4)return h.error("Expected two or three arguments.");const m=a[0];let g=h.parse(a[1],1,ui);if(!g)return null;if(!Ic(m,g.type))return h.concat(1).error(`"${m}" comparisons are not supported for type '${Xi(g.type)}'.`);let v=h.parse(a[2],2,ui);if(!v)return null;if(!Ic(m,v.type))return h.concat(2).error(`"${m}" comparisons are not supported for type '${Xi(v.type)}'.`);if(g.type.kind!==v.type.kind&&g.type.kind!=="value"&&v.type.kind!=="value")return h.error(`Cannot compare types '${Xi(g.type)}' and '${Xi(v.type)}'.`);o&&(g.type.kind==="value"&&v.type.kind!=="value"?g=new nn(v.type,[g]):g.type.kind!=="value"&&v.type.kind==="value"&&(v=new nn(g.type,[v])));let p=null;if(a.length===4){if(g.type.kind!=="string"&&v.type.kind!=="string"&&g.type.kind!=="value"&&v.type.kind!=="value")return h.error("Cannot use collator to compare non-string types.");if(p=h.parse(a[3],3,io),!p)return null}return new f5(g,v,p)}evaluate(a){const h=this.lhs.evaluate(a),m=this.rhs.evaluate(a);if(o&&this.hasUntypedArgument){const g=ir(h),v=ir(m);if(g.kind!==v.kind||g.kind!=="string"&&g.kind!=="number")throw new Ki(`Expected arguments for "${n}" to be (string, string) or (number, number), but found (${g.kind}, ${v.kind}) instead.`)}if(this.collator&&!o&&this.hasUntypedArgument){const g=ir(h),v=ir(m);if(g.kind!=="string"||v.kind!=="string")return e(a,h,m)}return this.collator?i(a,h,m,this.collator.evaluate(a)):e(a,h,m)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}serialize(){const a=[n];return this.eachChild(h=>{a.push(h.serialize())}),a}}}const Bh=Qs("==",function(n,e,i){return e===i},Pc),Nh=Qs("!=",function(n,e,i){return e!==i},function(n,e,i,o){return!Pc(0,e,i,o)}),Vh=Qs("<",function(n,e,i){return e",function(n,e,i){return e>i},function(n,e,i,o){return o.compare(e,i)>0}),jh=Qs("<=",function(n,e,i){return e<=i},function(n,e,i,o){return o.compare(e,i)<=0}),Gh=Qs(">=",function(n,e,i){return e>=i},function(n,e,i,o){return o.compare(e,i)>=0});class r0{constructor(e,i,o,l,a,h){this.type=gi,this.number=e,this.locale=i,this.currency=o,this.unit=l,this.minFractionDigits=a,this.maxFractionDigits=h}static parse(e,i){if(e.length!==3)return i.error("Expected two arguments.");const o=i.parse(e[1],1,_t);if(!o)return null;const l=e[2];if(typeof l!="object"||Array.isArray(l))return i.error("NumberFormat options argument must be an object.");let a=null;if(l.locale&&(a=i.parseObjectValue(l.locale,2,"locale",gi),!a))return null;let h=null;if(l.currency&&(h=i.parseObjectValue(l.currency,2,"currency",gi),!h))return null;let m=null;if(l.unit&&(m=i.parseObjectValue(l.unit,2,"unit",gi),!m))return null;let g=null;if(l["min-fraction-digits"]&&(g=i.parseObjectValue(l["min-fraction-digits"],2,"min-fraction-digits",_t),!g))return null;let v=null;return l["max-fraction-digits"]&&(v=i.parseObjectValue(l["max-fraction-digits"],2,"max-fraction-digits",_t),!v)?null:new r0(o,a,h,m,g,v)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class I3{constructor(e){this.type=_t,this.input=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const o=i.parse(e[1],1);return o?o.type.kind!=="array"&&o.type.kind!=="string"&&o.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${Xi(o.type)} instead.`):new I3(o):null}evaluate(e){const i=this.input.evaluate(e);if(typeof i=="string"||Array.isArray(i))return i.length;throw new Ki(`Expected value to be of type string or array, but found ${Xi(ir(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(i=>{e.push(i.serialize())}),e}}function P3(n){return function(){n=1831565813+(n|=0)|0;let e=Math.imul(n^n>>>15,1|n);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}const ea={"==":Bh,"!=":Nh,">":Uh,"<":Vh,">=":Gh,"<=":jh,array:nn,at:T3,"at-interpolated":S3,boolean:nn,case:A3,coalesce:el,collator:ls,format:Gs,image:Fo,in:E3,"index-of":il,interpolate:on,"interpolate-hcl":on,"interpolate-lab":on,length:I3,let:tl,literal:no,match:M3,number:nn,"number-format":r0,object:nn,slice:rl,step:$n,string:nn,"to-boolean":so,"to-color":so,"to-number":so,"to-string":so,var:fs,within:ao,distance:Uo,config:ps};function Cc(n,[e,i,o,l]){e=e.evaluate(n),i=i.evaluate(n),o=o.evaluate(n);const a=l?l.evaluate(n):1,h=$a(e,i,o,a);if(h)throw new Ki(h);return new bi(e/255*a,i/255*a,o/255*a,a)}function zc(n,[e,i,o,l]){e=e.evaluate(n),i=i.evaluate(n),o=o.evaluate(n);const a=l?l.evaluate(n):1,h=function(v,p,y,w){return typeof v=="number"&&v>=0&&v<=360?typeof p=="number"&&p>=0&&p<=100&&typeof y=="number"&&y>=0&&y<=100?w===void 0||typeof w=="number"&&w>=0&&w<=1?null:`Invalid hsla value [${[v,p,y,w].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${(typeof w=="number"?[v,p,y,w]:[v,p,y]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${(typeof w=="number"?[v,p,y,w]:[v,p,y]).join(", ")}]: 'h' must be between 0 and 360.`}(e,i,o,a);if(h)throw new Ki(h);const m=`hsla(${e}, ${i}%, ${o}%, ${a})`,g=bi.parse(m);if(!g)throw new Ki(`Failed to parse HSLA color: ${m}`);return g}function C3(n,e){return n in e}function nl(n,e){const i=e[n];return i===void 0?null:i}function vn(n){return{type:n}}function z3(n){return{result:"success",value:n}}function ho(n){return{result:"error",value:n}}function R3(n,e){return!!n&&!!n.parameters&&n.parameters.indexOf(e)>-1}function ta(n){return n["property-type"]==="data-driven"}function ol(n){return R3(n.expression,"measure-light")}function Rc(n){return R3(n.expression,"zoom")}function D3(n){return!!n.expression&&n.expression.interpolated}function sl(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function Dc(n){return n}function Lc(n,e){const i=e.type==="color",o=n.stops&&typeof n.stops[0][0]=="object",l=o||!(o||n.property!==void 0),a=n.type||(D3(e)?"exponential":"interval");if(i&&((n=ni({},n)).stops&&(n.stops=n.stops.map(v=>[v[0],bi.parse(v[1])])),n.default=bi.parse(n.default?n.default:e.default)),n.colorSpace&&n.colorSpace!=="rgb"&&!Ac[n.colorSpace])throw new Error(`Unknown color space: ${n.colorSpace}`);let h,m,g;if(a==="exponential")h=L3;else if(a==="interval")h=Oc;else if(a==="categorical"){h=qh,m=Object.create(null);for(const v of n.stops)m[v[0]]=v[1];g=typeof n.stops[0][0]}else{if(a!=="identity")throw new Error(`Unknown function type "${a}"`);h=al}if(o){const v={},p=[];for(let x=0;xx[0]),evaluate:({zoom:x},b)=>L3({stops:y,base:n.base},e,x).evaluate(x,b)}}if(l){const v=a==="exponential"?{name:"exponential",base:n.base!==void 0?n.base:1}:null;return{kind:"camera",interpolationType:v,interpolationFactor:on.interpolationFactor.bind(void 0,v),zoomStops:n.stops.map(p=>p[0]),evaluate:({zoom:p})=>h(n,e,p,m,g)}}return{kind:"source",evaluate(v,p){const y=p&&p.properties?p.properties[n.property]:void 0;return y===void 0?n0(n.default,e.default):h(n,e,y,m,g)}}}function n0(n,e,i){return n!==void 0?n:e!==void 0?e:i!==void 0?i:void 0}function qh(n,e,i,o,l){return n0(typeof i===l?o[i]:void 0,n.default,e.default)}function Oc(n,e,i){if(oo(i)!=="number")return n0(n.default,e.default);const o=n.stops.length;if(o===1||i<=n.stops[0][0])return n.stops[0][1];if(i>=n.stops[o-1][0])return n.stops[o-1][1];const l=e0(n.stops.map(a=>a[0]),i);return n.stops[l][1]}function L3(n,e,i){const o=n.base!==void 0?n.base:1;if(oo(i)!=="number")return n0(n.default,e.default);const l=n.stops.length;if(l===1||i<=n.stops[0][0])return n.stops[0][1];if(i>=n.stops[l-1][0])return n.stops[l-1][1];const a=e0(n.stops.map(p=>p[0]),i),h=function(p,y,w,x){const b=x-w,S=p-w;return b===0?0:y===1?S/b:(Math.pow(y,S)-1)/(Math.pow(y,b)-1)}(i,o,n.stops[a][0],n.stops[a+1][0]),m=n.stops[a][1],g=n.stops[a+1][1];let v=ja[e.type]||Dc;if(n.colorSpace&&n.colorSpace!=="rgb"){const p=Ac[n.colorSpace];v=(y,w)=>p.reverse(p.interpolate(p.forward(y),p.forward(w),h))}return typeof m.evaluate=="function"?{evaluate(...p){const y=m.evaluate.apply(void 0,p),w=g.evaluate.apply(void 0,p);if(y!==void 0&&w!==void 0)return v(y,w,h)}}:v(m,g,h)}function al(n,e,i){return e.type==="color"?i=bi.parse(i):e.type==="formatted"?i=Pr.fromString(i.toString()):e.type==="resolvedImage"?i=Cr.build(i.toString()):oo(i)===e.type||e.type==="enum"&&e.values[i]||(i=void 0),n0(i,n.default,e.default)}kr.register(ea,{error:[{kind:"error"},[gi],(n,[e])=>{throw new Ki(e.evaluate(n))}],typeof:[gi,[ui],(n,[e])=>Xi(ir(e.evaluate(n)))],"to-rgba":[vr(_t,4),[Ir],(n,[e])=>e.evaluate(n).toRenderColor(null).toArray()],"to-hsla":[vr(_t,4),[Ir],(n,[e])=>e.evaluate(n).toRenderColor(null).toHslaArray()],rgb:[Ir,[_t,_t,_t],Cc],rgba:[Ir,[_t,_t,_t,_t],Cc],hsl:[Ir,[_t,_t,_t],zc],hsla:[Ir,[_t,_t,_t,_t],zc],has:{type:ai,overloads:[[[gi],(n,[e])=>C3(e.evaluate(n),n.properties())],[[gi,Vs],(n,[e,i])=>C3(e.evaluate(n),i.evaluate(n))]]},get:{type:ui,overloads:[[[gi],(n,[e])=>nl(e.evaluate(n),n.properties())],[[gi,Vs],(n,[e,i])=>nl(e.evaluate(n),i.evaluate(n))]]},"feature-state":[ui,[gi],(n,[e])=>nl(e.evaluate(n),n.featureState||{})],properties:[Vs,[],n=>n.properties()],"geometry-type":[gi,[],n=>n.geometryType()],id:[ui,[],n=>n.id()],zoom:[_t,[],n=>n.globals.zoom],pitch:[_t,[],n=>n.globals.pitch||0],"distance-from-center":[_t,[],n=>n.distanceFromCenter()],"measure-light":[_t,[gi],(n,[e])=>n.measureLight(e.evaluate(n))],"heatmap-density":[_t,[],n=>n.globals.heatmapDensity||0],"line-progress":[_t,[],n=>n.globals.lineProgress||0],"raster-value":[_t,[],n=>n.globals.rasterValue||0],"raster-particle-speed":[_t,[],n=>n.globals.rasterParticleSpeed||0],"sky-radial-progress":[_t,[],n=>n.globals.skyRadialProgress||0],accumulated:[ui,[],n=>n.globals.accumulated===void 0?null:n.globals.accumulated],"+":[_t,vn(_t),(n,e)=>{let i=0;for(const o of e)i+=o.evaluate(n);return i}],"*":[_t,vn(_t),(n,e)=>{let i=1;for(const o of e)i*=o.evaluate(n);return i}],"-":{type:_t,overloads:[[[_t,_t],(n,[e,i])=>e.evaluate(n)-i.evaluate(n)],[[_t],(n,[e])=>-e.evaluate(n)]]},"/":[_t,[_t,_t],(n,[e,i])=>e.evaluate(n)/i.evaluate(n)],"%":[_t,[_t,_t],(n,[e,i])=>e.evaluate(n)%i.evaluate(n)],ln2:[_t,[],()=>Math.LN2],pi:[_t,[],()=>Math.PI],e:[_t,[],()=>Math.E],"^":[_t,[_t,_t],(n,[e,i])=>Math.pow(e.evaluate(n),i.evaluate(n))],sqrt:[_t,[_t],(n,[e])=>Math.sqrt(e.evaluate(n))],log10:[_t,[_t],(n,[e])=>Math.log(e.evaluate(n))/Math.LN10],ln:[_t,[_t],(n,[e])=>Math.log(e.evaluate(n))],log2:[_t,[_t],(n,[e])=>Math.log(e.evaluate(n))/Math.LN2],sin:[_t,[_t],(n,[e])=>Math.sin(e.evaluate(n))],cos:[_t,[_t],(n,[e])=>Math.cos(e.evaluate(n))],tan:[_t,[_t],(n,[e])=>Math.tan(e.evaluate(n))],asin:[_t,[_t],(n,[e])=>Math.asin(e.evaluate(n))],acos:[_t,[_t],(n,[e])=>Math.acos(e.evaluate(n))],atan:[_t,[_t],(n,[e])=>Math.atan(e.evaluate(n))],min:[_t,vn(_t),(n,e)=>Math.min(...e.map(i=>i.evaluate(n)))],max:[_t,vn(_t),(n,e)=>Math.max(...e.map(i=>i.evaluate(n)))],abs:[_t,[_t],(n,[e])=>Math.abs(e.evaluate(n))],round:[_t,[_t],(n,[e])=>{const i=e.evaluate(n);return i<0?-Math.round(-i):Math.round(i)}],floor:[_t,[_t],(n,[e])=>Math.floor(e.evaluate(n))],ceil:[_t,[_t],(n,[e])=>Math.ceil(e.evaluate(n))],"filter-==":[ai,[gi,ui],(n,[e,i])=>n.properties()[e.value]===i.value],"filter-id-==":[ai,[ui],(n,[e])=>n.id()===e.value],"filter-type-==":[ai,[gi],(n,[e])=>n.geometryType()===e.value],"filter-<":[ai,[gi,ui],(n,[e,i])=>{const o=n.properties()[e.value],l=i.value;return typeof o==typeof l&&o{const i=n.id(),o=e.value;return typeof i==typeof o&&i":[ai,[gi,ui],(n,[e,i])=>{const o=n.properties()[e.value],l=i.value;return typeof o==typeof l&&o>l}],"filter-id->":[ai,[ui],(n,[e])=>{const i=n.id(),o=e.value;return typeof i==typeof o&&i>o}],"filter-<=":[ai,[gi,ui],(n,[e,i])=>{const o=n.properties()[e.value],l=i.value;return typeof o==typeof l&&o<=l}],"filter-id-<=":[ai,[ui],(n,[e])=>{const i=n.id(),o=e.value;return typeof i==typeof o&&i<=o}],"filter->=":[ai,[gi,ui],(n,[e,i])=>{const o=n.properties()[e.value],l=i.value;return typeof o==typeof l&&o>=l}],"filter-id->=":[ai,[ui],(n,[e])=>{const i=n.id(),o=e.value;return typeof i==typeof o&&i>=o}],"filter-has":[ai,[ui],(n,[e])=>e.value in n.properties()],"filter-has-id":[ai,[],n=>n.id()!==null&&n.id()!==void 0],"filter-type-in":[ai,[vr(gi)],(n,[e])=>e.value.indexOf(n.geometryType())>=0],"filter-id-in":[ai,[vr(ui)],(n,[e])=>e.value.indexOf(n.id())>=0],"filter-in-small":[ai,[gi,vr(ui)],(n,[e,i])=>i.value.indexOf(n.properties()[e.value])>=0],"filter-in-large":[ai,[gi,vr(ui)],(n,[e,i])=>function(o,l,a,h){for(;a<=h;){const m=a+h>>1;if(l[m]===o)return!0;l[m]>o?h=m-1:a=m+1}return!1}(n.properties()[e.value],i.value,0,i.value.length-1)],all:{type:ai,overloads:[[[ai,ai],(n,[e,i])=>e.evaluate(n)&&i.evaluate(n)],[vn(ai),(n,e)=>{for(const i of e)if(!i.evaluate(n))return!1;return!0}]]},any:{type:ai,overloads:[[[ai,ai],(n,[e,i])=>e.evaluate(n)||i.evaluate(n)],[vn(ai),(n,e)=>{for(const i of e)if(i.evaluate(n))return!0;return!1}]]},"!":[ai,[ai],(n,[e])=>!e.evaluate(n)],"is-supported-script":[ai,[gi],(n,[e])=>{const i=n.globals&&n.globals.isSupportedScript;return!i||i(e.evaluate(n))}],upcase:[gi,[gi],(n,[e])=>e.evaluate(n).toUpperCase()],downcase:[gi,[gi],(n,[e])=>e.evaluate(n).toLowerCase()],concat:[gi,vn(ui),(n,e)=>e.map(i=>pr(i.evaluate(n))).join("")],"resolved-locale":[gi,[io],(n,[e])=>e.evaluate(n).resolvedLocale()],random:[_t,[_t,_t,ui],(n,e)=>{const[i,o,l]=e.map(h=>h.evaluate(n));if(i>o||i===o)return i;let a;if(typeof l=="string")a=function(h){let m=0;if(h.length===0)return m;for(let g=0;gJSON.stringify(p)).join(", ")}, but found ${JSON.stringify(v)} instead.`);return v}catch(v){return this._warningHistory[v.message]||(this._warningHistory[v.message]=!0,typeof console<"u"&&console.warn(`Failed to evaluate expression "${JSON.stringify(this.expression.serialize())}". ${v.message}`)),this._defaultValue}}}function ll(n){return Array.isArray(n)&&n.length>0&&typeof n[0]=="string"&&n[0]in ea}function ia(n,e,i,o){const l=new _3(ea,[],e?function(h){const m={color:Ir,string:gi,number:_t,enum:gi,boolean:ai,formatted:Ga,resolvedImage:ro};return h.type==="array"?vr(m[h.value]||ui,h.length):m[h.type]}(e):void 0,void 0,void 0,i,o),a=l.parse(n,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?z3(new O3(a,e,i,o)):ho(l.errors)}class k3{constructor(e,i,o,l){this.kind=e,this._styleExpression=i,this.isLightConstant=o,this.isLineProgressConstant=l,this.isStateDependent=e!=="constant"&&!Ja(i.expression),this.configDependencies=Qa(i.expression)}evaluateWithoutErrorHandling(e,i,o,l,a,h){return this._styleExpression.evaluateWithoutErrorHandling(e,i,o,l,a,h)}evaluate(e,i,o,l,a,h){return this._styleExpression.evaluate(e,i,o,l,a,h)}}class ra{constructor(e,i,o,l,a,h){this.kind=e,this.zoomStops=o,this._styleExpression=i,this.isStateDependent=e!=="camera"&&!Ja(i.expression),this.isLightConstant=a,this.isLineProgressConstant=h,this.configDependencies=Qa(i.expression),this.interpolationType=l}evaluateWithoutErrorHandling(e,i,o,l,a,h){return this._styleExpression.evaluateWithoutErrorHandling(e,i,o,l,a,h)}evaluate(e,i,o,l,a,h){return this._styleExpression.evaluate(e,i,o,l,a,h)}interpolationFactor(e,i,o){return this.interpolationType?on.interpolationFactor(this.interpolationType,e,i,o):0}}function F3(n,e,i,o){if((n=ia(n,e,i,o)).result==="error")return n;const l=n.value.expression,a=Ys(l);if(!a&&!ta(e))return ho([new xn("","data expressions not supported")]);const h=uo(l,["zoom","pitch","distance-from-center"]);if(!h&&!Rc(e))return ho([new xn("","zoom expressions not supported")]);const m=uo(l,["measure-light"]);if(!m&&!ol(e))return ho([new xn("","measure-light expression not supported")]);const g=uo(l,["line-progress"]);if(!g&&!function(y){return R3(y.expression,"line-progress")}(e))return ho([new xn("","line-progress expression not supported")]);const v=e.expression&&e.expression.relaxZoomRestriction,p=ul(l);return p||h||v?p instanceof xn?ho([p]):p instanceof on&&!D3(e)?ho([new xn("",'"interpolate" expressions cannot be used with this property')]):z3(p?new ra(a&&g?"camera":"composite",n.value,p.labels,p instanceof on?p.interpolation:void 0,m,g):new k3(a&&g?"constant":"source",n.value,m,g)):ho([new xn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class cl{constructor(e,i){this._parameters=e,this._specification=i,ni(this,Lc(this._parameters,this._specification))}static deserialize(e){return new cl(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function ul(n){let e=null;if(n instanceof tl)e=ul(n.result);else if(n instanceof el){for(const i of n.args)if(e=ul(i),e)break}else(n instanceof $n||n instanceof on)&&n.input instanceof kr&&n.input.name==="zoom"&&(e=n);return e instanceof xn||n.eachChild(i=>{const o=ul(i);o instanceof xn?e=o:e&&o&&e!==o&&(e=new xn("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}var o0,kc,Fc=function(){if(kc)return o0;kc=1,o0=e;var n=3;function e(i,o,l){var a=this.cells=[];if(i instanceof ArrayBuffer){this.arrayBuffer=i;var h=new Int32Array(this.arrayBuffer);i=h[0],this.d=(o=h[1])+2*(l=h[2]);for(var m=0;m=w[S+0]&&a>=w[S+1])?(g[b]=!0,m.push(y[b])):g[b]=!1}}},e.prototype._forEachCell=function(i,o,l,a,h,m,g,v){for(var p=this._convertToCellCoord(i),y=this._convertToCellCoord(o),w=this._convertToCellCoord(l),x=this._convertToCellCoord(a),b=p;b<=w;b++)for(var S=y;S<=x;S++){var I=this.d*S+b;if((!v||v(this._convertFromCellCoord(b),this._convertFromCellCoord(S),this._convertFromCellCoord(b+1),this._convertFromCellCoord(S+1)))&&h.call(this,i,o,l,a,I,m,g,v))return}},e.prototype._convertFromCellCoord=function(i){return(i-this.padding)/this.scale},e.prototype._convertToCellCoord=function(i){return Math.max(0,Math.min(this.d-1,Math.floor(i*this.scale)+this.padding))},e.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var i=this.cells,o=n+this.cells.length+1+1,l=0,a=0;a=0||(l[a]=jo(n[a],e)));n instanceof Error&&(l.message=n.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return o!=="Object"&&(l.$name=o),l}throw new Error("can't serialize object of type "+typeof n)}function sn(n){if(n==null||typeof n=="boolean"||typeof n=="number"||typeof n=="string"||n instanceof Boolean||n instanceof Number||n instanceof String||n instanceof Date||n instanceof RegExp||B3(n)||N3(n)||ArrayBuffer.isView(n)||n instanceof ImageData)return n;if(Array.isArray(n))return n.map(sn);if(typeof n=="object"){const e=n.$name||"Object";if(e==="Map"){const l=n.entries||[],a=new Map;for(let h=0;hn>=128&&n<=255,Arabic:n=>n>=1536&&n<=1791,"Arabic Supplement":n=>n>=1872&&n<=1919,"Arabic Extended-A":n=>n>=2208&&n<=2303,"Hangul Jamo":n=>n>=4352&&n<=4607,"Unified Canadian Aboriginal Syllabics":n=>n>=5120&&n<=5759,Khmer:n=>n>=6016&&n<=6143,"Unified Canadian Aboriginal Syllabics Extended":n=>n>=6320&&n<=6399,"General Punctuation":n=>n>=8192&&n<=8303,"Letterlike Symbols":n=>n>=8448&&n<=8527,"Number Forms":n=>n>=8528&&n<=8591,"Miscellaneous Technical":n=>n>=8960&&n<=9215,"Control Pictures":n=>n>=9216&&n<=9279,"Optical Character Recognition":n=>n>=9280&&n<=9311,"Enclosed Alphanumerics":n=>n>=9312&&n<=9471,"Geometric Shapes":n=>n>=9632&&n<=9727,"Miscellaneous Symbols":n=>n>=9728&&n<=9983,"Miscellaneous Symbols and Arrows":n=>n>=11008&&n<=11263,"CJK Radicals Supplement":n=>n>=11904&&n<=12031,"Kangxi Radicals":n=>n>=12032&&n<=12255,"Ideographic Description Characters":n=>n>=12272&&n<=12287,"CJK Symbols and Punctuation":n=>n>=12288&&n<=12351,Hiragana:n=>n>=12352&&n<=12447,Katakana:n=>n>=12448&&n<=12543,Bopomofo:n=>n>=12544&&n<=12591,"Hangul Compatibility Jamo":n=>n>=12592&&n<=12687,Kanbun:n=>n>=12688&&n<=12703,"Bopomofo Extended":n=>n>=12704&&n<=12735,"CJK Strokes":n=>n>=12736&&n<=12783,"Katakana Phonetic Extensions":n=>n>=12784&&n<=12799,"Enclosed CJK Letters and Months":n=>n>=12800&&n<=13055,"CJK Compatibility":n=>n>=13056&&n<=13311,"CJK Unified Ideographs Extension A":n=>n>=13312&&n<=19903,"Yijing Hexagram Symbols":n=>n>=19904&&n<=19967,"CJK Unified Ideographs":n=>n>=19968&&n<=40959,"Yi Syllables":n=>n>=40960&&n<=42127,"Yi Radicals":n=>n>=42128&&n<=42191,"Hangul Jamo Extended-A":n=>n>=43360&&n<=43391,"Hangul Syllables":n=>n>=44032&&n<=55215,"Hangul Jamo Extended-B":n=>n>=55216&&n<=55295,"Private Use Area":n=>n>=57344&&n<=63743,"CJK Compatibility Ideographs":n=>n>=63744&&n<=64255,"Arabic Presentation Forms-A":n=>n>=64336&&n<=65023,"Vertical Forms":n=>n>=65040&&n<=65055,"CJK Compatibility Forms":n=>n>=65072&&n<=65103,"Small Form Variants":n=>n>=65104&&n<=65135,"Arabic Presentation Forms-B":n=>n>=65136&&n<=65279,"Halfwidth and Fullwidth Forms":n=>n>=65280&&n<=65519,Osage:n=>n>=66736&&n<=66815,"CJK Unified Ideographs Extension B":n=>n>=131072&&n<=173791};function V3(n){for(const e of n)if(dl(e.charCodeAt(0)))return!0;return!1}function $h(n){for(const e of n)if(!Bc(e.charCodeAt(0)))return!1;return!0}function Bc(n){return!(bt.Arabic(n)||bt["Arabic Supplement"](n)||bt["Arabic Extended-A"](n)||bt["Arabic Presentation Forms-A"](n)||bt["Arabic Presentation Forms-B"](n))}function dl(n){return!(n!==746&&n!==747&&(n<4352||!(bt["Bopomofo Extended"](n)||bt.Bopomofo(n)||bt["CJK Compatibility Forms"](n)&&!(n>=65097&&n<=65103)||bt["CJK Compatibility Ideographs"](n)||bt["CJK Compatibility"](n)||bt["CJK Radicals Supplement"](n)||bt["CJK Strokes"](n)||!(!bt["CJK Symbols and Punctuation"](n)||n>=12296&&n<=12305||n>=12308&&n<=12319||n===12336)||bt["CJK Unified Ideographs Extension A"](n)||bt["CJK Unified Ideographs"](n)||bt["Enclosed CJK Letters and Months"](n)||bt["Hangul Compatibility Jamo"](n)||bt["Hangul Jamo Extended-A"](n)||bt["Hangul Jamo Extended-B"](n)||bt["Hangul Jamo"](n)||bt["Hangul Syllables"](n)||bt.Hiragana(n)||bt["Ideographic Description Characters"](n)||bt.Kanbun(n)||bt["Kangxi Radicals"](n)||bt["Katakana Phonetic Extensions"](n)||bt.Katakana(n)&&n!==12540||!(!bt["Halfwidth and Fullwidth Forms"](n)||n===65288||n===65289||n===65293||n>=65306&&n<=65310||n===65339||n===65341||n===65343||n>=65371&&n<=65503||n===65507||n>=65512&&n<=65519)||!(!bt["Small Form Variants"](n)||n>=65112&&n<=65118||n>=65123&&n<=65126)||bt["Unified Canadian Aboriginal Syllabics"](n)||bt["Unified Canadian Aboriginal Syllabics Extended"](n)||bt["Vertical Forms"](n)||bt["Yijing Hexagram Symbols"](n)||bt["Yi Syllables"](n)||bt["Yi Radicals"](n))))}function U3(n){return!(dl(n)||function(e){return!!(bt["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||bt["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||bt["Letterlike Symbols"](e)||bt["Number Forms"](e)||bt["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||bt["Control Pictures"](e)&&e!==9251||bt["Optical Character Recognition"](e)||bt["Enclosed Alphanumerics"](e)||bt["Geometric Shapes"](e)||bt["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||bt["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||bt["CJK Symbols and Punctuation"](e)||bt.Katakana(e)||bt["Private Use Area"](e)||bt["CJK Compatibility Forms"](e)||bt["Small Form Variants"](e)||bt["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(n))}function Nc(n){return bt.Arabic(n)||bt["Arabic Supplement"](n)||bt["Arabic Extended-A"](n)||bt["Arabic Presentation Forms-A"](n)||bt["Arabic Presentation Forms-B"](n)}function pl(n){return n>=1424&&n<=2303||bt["Arabic Presentation Forms-A"](n)||bt["Arabic Presentation Forms-B"](n)}function j3(n,e){return!(!e&&pl(n)||n>=2304&&n<=3583||n>=3840&&n<=4255||bt.Khmer(n))}function Vc(n){for(const e of n)if(pl(e.charCodeAt(0)))return!0;return!1}const G3="deferred",Hn="loading",q3="loaded";let $3=null,jr="unavailable",Go=null;const s0=function(n){n&&typeof n=="string"&&n.indexOf("NetworkError")>-1&&(jr="error"),$3&&$3(n)};function fl(){oa.fire(new Zr("pluginStateChange",{pluginStatus:jr,pluginURL:Go}))}const oa=new Cn,ml=function(){return jr},Uc=function(){if(jr!==G3||!Go)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");jr=Hn,fl(),Go&&Gn({url:Go},n=>{n?s0(n):(jr=q3,fl())})},bn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>jr===q3||bn.applyArabicShaping!=null,isLoading:()=>jr===Hn,setState(n){jr=n.pluginStatus,Go=n.pluginURL},isParsed:()=>bn.applyArabicShaping!=null&&bn.processBidirectionalText!=null&&bn.processStyledBidirectionalText!=null,getPluginURL:()=>Go};class Ai{constructor(e,i){this.zoom=e,i?(this.now=i.now,this.fadeDuration=i.fadeDuration,this.transition=i.transition,this.pitch=i.pitch,this.brightness=i.brightness):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(e){return function(i,o){for(const l of i)if(!j3(l.charCodeAt(0),o))return!1;return!0}(e,bn.isLoaded())}}class sa{constructor(e,i,o,l){this.property=e,this.value=i,this.expression=function(a,h,m,g){if(sl(a))return new cl(a,h);if(ll(a)||Array.isArray(a)&&a.length>0){const v=F3(a,h,m,g);if(v.result==="error")throw new Error(v.value.map(p=>`${p.key}: ${p.message}`).join(", "));return v.value}{let v=a;return typeof a=="string"&&h.type==="color"&&(v=bi.parse(a)),{kind:"constant",configDependencies:new Set,evaluate:()=>v}}}(i===void 0?e.specification.default:i,e.specification,o,l)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,i,o){return this.property.possiblyEvaluate(this,e,i,o)}}class H3{constructor(e,i,o){this.property=e,this.value=new sa(e,void 0,i,o)}transitioned(e,i){return new _l(this.property,this.value,i,Lr({},e.transition,this.transition),e.now)}untransitioned(){return new _l(this.property,this.value,null,{},0)}}class Z3{constructor(e,i,o){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._scope=i,this._options=o,this.configDependencies=new Set}getValue(e){return en(this._values[e].value.value)}setValue(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new H3(this._values[e].property,this._scope,this._options)),this._values[e].value=new sa(this._values[e].property,i===null?void 0:en(i),this._scope,this._options),this._values[e].value.expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[e].value.expression.configDependencies]))}setTransitionOrValue(e,i){i&&(this._options=i);const o=this._properties.properties;if(e)for(const l in e){const a=e[l];if(l.endsWith("-transition")){const h=l.slice(0,-11);o[h]&&this.setTransition(h,a)}else o.hasOwnProperty(l)&&this.setValue(l,a)}}getTransition(e){return en(this._values[e].transition)}setTransition(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new H3(this._values[e].property)),this._values[e].transition=en(i)||void 0}serialize(){const e={};for(const i of Object.keys(this._values)){const o=this.getValue(i);o!==void 0&&(e[i]=o);const l=this.getTransition(i);l!==void 0&&(e[`${i}-transition`]=l)}return e}transitioned(e,i){const o=new a0(this._properties);for(const l of Object.keys(this._values))o._values[l]=this._values[l].transitioned(e,i._values[l]);return o}untransitioned(){const e=new a0(this._properties);for(const i of Object.keys(this._values))e._values[i]=this._values[i].untransitioned();return e}}class _l{constructor(e,i,o,l,a){const h=l.delay||0,m=l.duration||0;a=a||0,this.property=e,this.value=i,this.begin=a+h,this.end=this.begin+m,e.specification.transition&&(l.delay||l.duration)&&(this.prior=o)}possiblyEvaluate(e,i,o){const l=e.now||0,a=this.value.possiblyEvaluate(e,i,o),h=this.prior;if(h){if(l>this.end)return this.prior=null,a;if(this.value.isDataDriven())return this.prior=null,a;if(l":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"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":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"snow":{"density":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],11,0,13,0.85],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"opacity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],11,0,13,0.3],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","property-type":"data-constant","default":"#ffffff","experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"center-thinning":{"type":"number","property-type":"data-constant","default":0.4,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,50],"minimum":0,"maximum":360,"length":2,"value":"number","property-type":"data-constant","transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"flake-size":{"type":"number","property-type":"data-constant","default":0.71,"minimum":0,"maximum":5,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"rain":{"density":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],11,0,13,0.5],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["measure-light","brightness"],0,"#03113d",0.3,"#a8adbc"],"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"opacity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["measure-light","brightness"],0,0.88,1,0.7],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],11,0,13,1],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["measure-light","brightness"],0,"#001736",0.3,"#464646"],"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"center-thinning":{"type":"number","property-type":"data-constant","default":0.57,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,80],"minimum":0,"maximum":360,"length":2,"value":"number","property-type":"data-constant","transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"droplet-size":{"type":"array","default":[2.6,18.2],"minimum":0,"maximum":50,"length":2,"value":"number","property-type":"data-constant","transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"distortion-strength":{"type":"number","property-type":"data-constant","default":0.7,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective","property-type":"data-constant"}},"colorTheme":{"data":{"type":"string","property-type":"data-constant","expression":{}}},"indoor":{"floorplanFeaturesetId":{"type":"string","experimental":true,"property-type":"data-constant","expression":{}},"buildingFeaturesetId":{"type":"string","experimental":true,"property-type":"data-constant","expression":{}}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"fill-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-bridge-guard-rail-color":{"type":"color","default":"rgba(241, 236, 225, 255)","experimental":true,"private":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature"]},"property-type":"data-driven"},"fill-tunnel-structure-color":{"type":"color","default":"rgba(241, 236, 225, 255)","transition":true,"experimental":true,"private":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-height-alignment":{"type":"enum","experimental":true,"values":{"terrain":1,"flat":1},"default":"flat","property-type":"data-constant"},"fill-extrusion-base-alignment":{"type":"enum","experimental":true,"values":{"terrain":1,"flat":1},"default":"terrain","property-type":"data-constant"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant","type":"number","experimental":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant","type":"number","experimental":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant","type":"number","experimental":true,"default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"property-type":"data-constant","type":"color","experimental":true,"default":"#ffffff","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant","type":"number","experimental":true,"default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","experimental":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","experimental":true,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant","type":"number","experimental":true,"default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"property-type":"data-constant","type":"number","experimental":true,"default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"property-type":"data-constant","type":"boolean","default":true,"experimental":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"fill-extrusion-line-width":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-cast-shadows":{"type":"boolean","default":true,"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light","line-progress"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"property-type":"constant"},"line-trim-fade-range":{"type":"array","value":"number","experimental":true,"length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-trim-color":{"type":"color","experimental":true,"default":"transparent","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{"type":"number","private":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","private":true,"default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"property-type":"data-constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"transition":true},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"symbol-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{"type":"string","required":false,"experimental":true,"property-type":"data-constant"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-particle-count":{"type":"number","default":512,"minimum":1,"property-type":"data-constant"},"raster-particle-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1,"property-type":"data-constant"},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1,"property-type":"data-constant"},"raster-particle-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_background":{"background-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":[]},"experimental":true,"property-type":"data-constant"},"background-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"property-type":"data-driven"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d","property-type":"data-constant"},"model-cast-shadows":{"type":"boolean","default":true,"property-type":"data-constant"},"model-receive-shadows":{"type":"boolean","default":true,"property-type":"data-constant"},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant","transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"model-front-cutoff":{"type":"array","private":true,"value":"number","property-type":"data-constant","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"*"}}}');function jc(n){return n instanceof Number||n instanceof String||n instanceof Boolean?n.valueOf():n}function gl(n){if(Array.isArray(n))return n.map(gl);if(n instanceof Object&&!(n instanceof Number||n instanceof String||n instanceof Boolean)){const e={};for(const i in n)e[i]=gl(n[i]);return e}return jc(n)}function W3(n){if(n===!0||n===!1)return!0;if(!Array.isArray(n)||n.length===0)return!1;switch(n[0]){case"has":return n.length>=2&&n[1]!=="$id"&&n[1]!=="$type";case"in":return n.length>=3&&(typeof n[1]!="string"||Array.isArray(n[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return n.length!==3||Array.isArray(n[1])||Array.isArray(n[2]);case"any":case"all":for(const e of n.slice(1))if(!W3(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}function X3(n,e="",i=null,o="fill"){if(n==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};W3(n)||(n=yl(n));const l=n;let a=!0;try{a=function(p){if(!ha(p))return p;let y=gl(p);return qc(y),y=Gc(y),y}(l)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md and paste the contents of this message in the report. Thank you! Filter Expression: ${JSON.stringify(l,null,2)} `)}let h=null,m=null;if(o!=="background"&&o!=="sky"&&o!=="slot"){m=Ie[`filter_${o}`];const p=ia(a,m,e,i);if(p.result==="error")throw new Error(p.value.map(y=>`${y.key}: ${y.message}`).join(", "));h=(y,w,x)=>p.value.evaluate(y,w,{},x)}let g=null,v=null;if(a!==l){const p=ia(l,m,e,i);if(p.result==="error")throw new Error(p.value.map(y=>`${y.key}: ${y.message}`).join(", "));g=(y,w,x,b,S)=>p.value.evaluate(y,w,{},x,void 0,void 0,b,S),v=!Ys(p.value.expression)}return{filter:h,dynamicFilter:g||void 0,needGeometry:$c(a),needFeature:!!v}}function Gc(n){if(!Array.isArray(n))return n;const e=function(i){if(Hh.has(i[0])){for(let o=1;oGc(i))}function qc(n){let e=!1;const i=[];if(n[0]==="case"){for(let o=1;o",">=","<","<=","to-boolean"]);function Zh(n,e){return ne?1:0}function $c(n){if(!Array.isArray(n))return!1;if(n[0]==="within"||n[0]==="distance")return!0;for(let e=1;e"||e==="<="||e===">="?qo(n[1],n[2],e):e==="any"?(i=n.slice(1),["any"].concat(i.map(yl))):e==="all"?["all"].concat(n.slice(1).map(yl)):e==="none"?["all"].concat(n.slice(1).map(yl).map(ms)):e==="in"?Y3(n[1],n.slice(2)):e==="!in"?ms(Y3(n[1],n.slice(2))):e==="has"?K3(n[1]):e!=="!has"||ms(K3(n[1]));var i}function qo(n,e,i){switch(n){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,n,e]}}function Y3(n,e){if(e.length===0)return!1;switch(n){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(i=>typeof i!=typeof e[0])?["filter-in-large",n,["literal",e.sort(Zh)]]:["filter-in-small",n,["literal",e]]}}function K3(n){switch(n){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",n]}}function ms(n){return["!",n]}const xl="";function da(n,e){return e?`${n}${xl}${e}`:n}const po="-transition",Hc=new Set(["fill","line","background","hillshade","raster"]);class fr extends Cn{constructor(e,i,o,l,a){if(super(),this.id=e.id,this.fqid=da(this.id,o),this.type=e.type,this.scope=o,this.lut=l,this.options=a,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.configDependencies=new Set,e.type!=="custom"){if(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type&&e.type!=="background"&&e.type!=="sky"&&e.type!=="slot"){this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter;const h=ia(this.filter,Ie[`filter_${e.type}`]);h.result!=="error"&&(this.configDependencies=new Set([...this.configDependencies,...h.value.configDependencies]))}if(e.slot&&(this.slot=e.slot),i.layout&&(this._unevaluatedLayout=new aa(i.layout,this.scope,a),this.configDependencies=new Set([...this.configDependencies,...this._unevaluatedLayout.configDependencies])),i.paint){this._transitionablePaint=new Z3(i.paint,this.scope,a);for(const h in e.paint)this.setPaintProperty(h,e.paint[h]);for(const h in e.layout)this.setLayoutProperty(h,e.layout[h]);this.configDependencies=new Set([...this.configDependencies,...this._transitionablePaint.configDependencies]),this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ca(i.paint)}}}onAdd(e){}onRemove(e){}isDraped(e){return!this.is3D(!0)&&Hc.has(this.type)}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,i){if(this.type==="custom"&&e==="visibility")return void(this.visibility=i);const o=this._unevaluatedLayout;o._properties.properties[e]&&(o.setValue(e,i),this.configDependencies=new Set([...this.configDependencies,...o.configDependencies]),e==="visibility"&&this.possiblyEvaluateVisibility())}possiblyEvaluateVisibility(){this._unevaluatedLayout._values.visibility&&(this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0}))}getPaintProperty(e){return e.endsWith(po)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,i){const o=this._transitionablePaint,l=o._properties.properties;if(e.endsWith(po)){const y=e.slice(0,-11);return l[y]&&o.setTransition(y,i||void 0),!1}if(!l[e])return!1;const a=o._values[e],h=a.value.isDataDriven(),m=a.value;o.setValue(e,i),this.configDependencies=new Set([...this.configDependencies,...o.configDependencies]),this._handleSpecialPaintPropertyUpdate(e);const g=o._values[e].value,v=g.isDataDriven(),p=e.endsWith("pattern")||e==="line-dasharray";return v||h||p||this._handleOverridablePaintPropertyUpdate(e,m,g)}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getDefaultProgramParams(e,i,o){return null}_handleOverridablePaintPropertyUpdate(e,i,o){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,i){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,i)}serialize(){return ss({id:this.id,type:this.type,slot:this.slot,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()},(e,i)=>!(e===void 0||i==="layout"&&!Object.keys(e).length||i==="paint"&&!Object.keys(e).length))}is3D(e){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}isStateDependent(){for(const e in this.paint._values){const i=this.paint.get(e);if(i instanceof la&&ta(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}compileFilter(e){this._filterCompiled||(this._featureFilter=X3(this.filter,this.scope,e),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(e){this._stats&&(e.renderPass==="shadow"?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}queryRadius(e){}queryIntersectsFeature(e,i,o,l,a,h,m,g,v){}}const Wh={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class l0{constructor(e,i){this._structArray=e,this._pos1=i*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Ri{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,i){return e._trim(),i&&(e.isTransferred=!0,i.add(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const i=Object.create(this.prototype);return i.arrayBuffer=e.arrayBuffer,i.length=e.length,i.capacity=e.arrayBuffer.byteLength/i.bytesPerElement,i._refreshViews(),i}_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(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(...e){throw new Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(...e){throw new Error("StructArray#emplaceBack() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function hi(n,e=1){let i=0,o=0;return{members:n.map(l=>{const a=Wh[l.type].BYTES_PER_ELEMENT,h=i=Zc(i,Math.max(e,a)),m=l.components||1;return o=Math.max(o,a),i+=a*m,{name:l.name,type:l.type,components:m,offset:h}}),size:Zc(i,Math.max(o,e)),alignment:e}}function Zc(n,e){return Math.ceil(n/e)*e}class fo extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,i)}emplace(e,i,o){const l=2*e;return this.int16[l+0]=i,this.int16[l+1]=o,e}}fo.prototype.bytesPerElement=4,at(fo,"StructArrayLayout2i4");class pa extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o){const l=this.length;return this.resize(l+1),this.emplace(l,e,i,o)}emplace(e,i,o,l){const a=3*e;return this.int16[a+0]=i,this.int16[a+1]=o,this.int16[a+2]=l,e}}pa.prototype.bytesPerElement=6,at(pa,"StructArrayLayout3i6");class mo extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,l){const a=this.length;return this.resize(a+1),this.emplace(a,e,i,o,l)}emplace(e,i,o,l,a){const h=4*e;return this.int16[h+0]=i,this.int16[h+1]=o,this.int16[h+2]=l,this.int16[h+3]=a,e}}mo.prototype.bytesPerElement=8,at(mo,"StructArrayLayout4i8");class _s extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.float32[1*e+0]=i,e}}_s.prototype.bytesPerElement=4,at(_s,"StructArrayLayout1f4");class c0 extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o){const l=this.length;return this.resize(l+1),this.emplace(l,e,i,o)}emplace(e,i,o,l){const a=4*e,h=2*e;return this.int16[a+0]=i,this.int16[a+1]=o,this.float32[h+1]=l,e}}c0.prototype.bytesPerElement=8,at(c0,"StructArrayLayout2i1f8");class J3 extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o){const l=this.length;return this.resize(l+1),this.emplace(l,e,i,o)}emplace(e,i,o,l){const a=4*e;return this.int16[a+0]=i,this.int16[a+1]=o,this.int16[a+2]=l,e}}J3.prototype.bytesPerElement=8,at(J3,"StructArrayLayout3i8");class wn extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a){const h=this.length;return this.resize(h+1),this.emplace(h,e,i,o,l,a)}emplace(e,i,o,l,a,h){const m=5*e;return this.int16[m+0]=i,this.int16[m+1]=o,this.int16[m+2]=l,this.int16[m+3]=a,this.int16[m+4]=h,e}}wn.prototype.bytesPerElement=10,at(wn,"StructArrayLayout5i10");class Q3 extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a,h,m){const g=this.length;return this.resize(g+1),this.emplace(g,e,i,o,l,a,h,m)}emplace(e,i,o,l,a,h,m,g){const v=6*e,p=12*e,y=3*e;return this.int16[v+0]=i,this.int16[v+1]=o,this.uint8[p+4]=l,this.uint8[p+5]=a,this.uint8[p+6]=h,this.uint8[p+7]=m,this.float32[y+2]=g,e}}Q3.prototype.bytesPerElement=12,at(Q3,"StructArrayLayout2i4ub1f12");class Ln extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o){const l=this.length;return this.resize(l+1),this.emplace(l,e,i,o)}emplace(e,i,o,l){const a=3*e;return this.float32[a+0]=i,this.float32[a+1]=o,this.float32[a+2]=l,e}}Ln.prototype.bytesPerElement=12,at(Ln,"StructArrayLayout3f12");class $o extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a){const h=this.length;return this.resize(h+1),this.emplace(h,e,i,o,l,a)}emplace(e,i,o,l,a,h){const m=6*e,g=3*e;return this.uint16[m+0]=i,this.uint16[m+1]=o,this.uint16[m+2]=l,this.uint16[m+3]=a,this.float32[g+2]=h,e}}$o.prototype.bytesPerElement=12,at($o,"StructArrayLayout4ui1f12");class vl extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o,l){const a=this.length;return this.resize(a+1),this.emplace(a,e,i,o,l)}emplace(e,i,o,l,a){const h=4*e;return this.uint16[h+0]=i,this.uint16[h+1]=o,this.uint16[h+2]=l,this.uint16[h+3]=a,e}}vl.prototype.bytesPerElement=8,at(vl,"StructArrayLayout4ui8");class bl extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a,h){const m=this.length;return this.resize(m+1),this.emplace(m,e,i,o,l,a,h)}emplace(e,i,o,l,a,h,m){const g=6*e;return this.int16[g+0]=i,this.int16[g+1]=o,this.int16[g+2]=l,this.int16[g+3]=a,this.int16[g+4]=h,this.int16[g+5]=m,e}}bl.prototype.bytesPerElement=12,at(bl,"StructArrayLayout6i12");class e1 extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a,h,m,g,v,p,y,w){const x=this.length;return this.resize(x+1),this.emplace(x,e,i,o,l,a,h,m,g,v,p,y,w)}emplace(e,i,o,l,a,h,m,g,v,p,y,w,x){const b=12*e;return this.int16[b+0]=i,this.int16[b+1]=o,this.int16[b+2]=l,this.int16[b+3]=a,this.uint16[b+4]=h,this.uint16[b+5]=m,this.uint16[b+6]=g,this.uint16[b+7]=v,this.int16[b+8]=p,this.int16[b+9]=y,this.int16[b+10]=w,this.int16[b+11]=x,e}}e1.prototype.bytesPerElement=24,at(e1,"StructArrayLayout4i4ui4i24");class t1 extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a,h){const m=this.length;return this.resize(m+1),this.emplace(m,e,i,o,l,a,h)}emplace(e,i,o,l,a,h,m){const g=10*e,v=5*e;return this.int16[g+0]=i,this.int16[g+1]=o,this.int16[g+2]=l,this.float32[v+2]=a,this.float32[v+3]=h,this.float32[v+4]=m,e}}t1.prototype.bytesPerElement=20,at(t1,"StructArrayLayout3i3f20");class gs extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o,l){const a=this.length;return this.resize(a+1),this.emplace(a,e,i,o,l)}emplace(e,i,o,l,a){const h=4*e;return this.float32[h+0]=i,this.float32[h+1]=o,this.float32[h+2]=l,this.float32[h+3]=a,e}}gs.prototype.bytesPerElement=16,at(gs,"StructArrayLayout4f16");class i1 extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint32[1*e+0]=i,e}}i1.prototype.bytesPerElement=4,at(i1,"StructArrayLayout1ul4");class Ho extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,i)}emplace(e,i,o){const l=2*e;return this.uint16[l+0]=i,this.uint16[l+1]=o,e}}Ho.prototype.bytesPerElement=4,at(Ho,"StructArrayLayout2ui4");class r1 extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a,h,m,g,v,p,y,w,x){const b=this.length;return this.resize(b+1),this.emplace(b,e,i,o,l,a,h,m,g,v,p,y,w,x)}emplace(e,i,o,l,a,h,m,g,v,p,y,w,x,b){const S=20*e,I=10*e;return this.int16[S+0]=i,this.int16[S+1]=o,this.int16[S+2]=l,this.int16[S+3]=a,this.int16[S+4]=h,this.float32[I+3]=m,this.float32[I+4]=g,this.float32[I+5]=v,this.float32[I+6]=p,this.int16[S+14]=y,this.uint32[I+8]=w,this.uint16[S+18]=x,this.uint16[S+19]=b,e}}r1.prototype.bytesPerElement=40,at(r1,"StructArrayLayout5i4f1i1ul2ui40");class u0 extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a,h,m){const g=this.length;return this.resize(g+1),this.emplace(g,e,i,o,l,a,h,m)}emplace(e,i,o,l,a,h,m,g){const v=8*e;return this.int16[v+0]=i,this.int16[v+1]=o,this.int16[v+2]=l,this.int16[v+4]=a,this.int16[v+5]=h,this.int16[v+6]=m,this.int16[v+7]=g,e}}u0.prototype.bytesPerElement=16,at(u0,"StructArrayLayout3i2i2i16");class n1 extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a){const h=this.length;return this.resize(h+1),this.emplace(h,e,i,o,l,a)}emplace(e,i,o,l,a,h){const m=4*e,g=8*e;return this.float32[m+0]=i,this.float32[m+1]=o,this.float32[m+2]=l,this.int16[g+6]=a,this.int16[g+7]=h,e}}n1.prototype.bytesPerElement=16,at(n1,"StructArrayLayout2f1f2i16");class o1 extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a,h){const m=this.length;return this.resize(m+1),this.emplace(m,e,i,o,l,a,h)}emplace(e,i,o,l,a,h,m){const g=20*e,v=5*e;return this.uint8[g+0]=i,this.uint8[g+1]=o,this.float32[v+1]=l,this.float32[v+2]=a,this.float32[v+3]=h,this.float32[v+4]=m,e}}o1.prototype.bytesPerElement=20,at(o1,"StructArrayLayout2ub4f20");class _r extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o){const l=this.length;return this.resize(l+1),this.emplace(l,e,i,o)}emplace(e,i,o,l){const a=3*e;return this.uint16[a+0]=i,this.uint16[a+1]=o,this.uint16[a+2]=l,e}}_r.prototype.bytesPerElement=6,at(_r,"StructArrayLayout3ui6");class wl extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a,h,m,g,v,p,y,w,x,b,S,I,P,O,L,D,F){const V=this.length;return this.resize(V+1),this.emplace(V,e,i,o,l,a,h,m,g,v,p,y,w,x,b,S,I,P,O,L,D,F)}emplace(e,i,o,l,a,h,m,g,v,p,y,w,x,b,S,I,P,O,L,D,F,V){const q=30*e,J=15*e,X=60*e;return this.int16[q+0]=i,this.int16[q+1]=o,this.int16[q+2]=l,this.float32[J+2]=a,this.float32[J+3]=h,this.uint16[q+8]=m,this.uint16[q+9]=g,this.uint32[J+5]=v,this.uint32[J+6]=p,this.uint32[J+7]=y,this.uint16[q+16]=w,this.uint16[q+17]=x,this.uint16[q+18]=b,this.float32[J+10]=S,this.float32[J+11]=I,this.uint8[X+48]=P,this.uint8[X+49]=O,this.uint8[X+50]=L,this.uint32[J+13]=D,this.int16[q+28]=F,this.uint8[X+58]=V,e}}wl.prototype.bytesPerElement=60,at(wl,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Tl extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a,h,m,g,v,p,y,w,x,b,S,I,P,O,L,D,F,V,q,J,X,Y,le,ee,ce,me,pe,xe,ye){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,e,i,o,l,a,h,m,g,v,p,y,w,x,b,S,I,P,O,L,D,F,V,q,J,X,Y,le,ee,ce,me,pe,xe,ye)}emplace(e,i,o,l,a,h,m,g,v,p,y,w,x,b,S,I,P,O,L,D,F,V,q,J,X,Y,le,ee,ce,me,pe,xe,ye,Ee){const we=20*e,Ae=40*e,$e=80*e;return this.float32[we+0]=i,this.float32[we+1]=o,this.int16[Ae+4]=l,this.int16[Ae+5]=a,this.int16[Ae+6]=h,this.int16[Ae+7]=m,this.int16[Ae+8]=g,this.int16[Ae+9]=v,this.int16[Ae+10]=p,this.int16[Ae+11]=y,this.int16[Ae+12]=w,this.uint16[Ae+13]=x,this.uint16[Ae+14]=b,this.uint16[Ae+15]=S,this.uint16[Ae+16]=I,this.uint16[Ae+17]=P,this.uint16[Ae+18]=O,this.uint16[Ae+19]=L,this.uint16[Ae+20]=D,this.uint16[Ae+21]=F,this.uint16[Ae+22]=V,this.uint16[Ae+23]=q,this.uint16[Ae+24]=J,this.uint16[Ae+25]=X,this.uint16[Ae+26]=Y,this.uint16[Ae+27]=le,this.uint32[we+14]=ee,this.float32[we+15]=ce,this.float32[we+16]=me,this.float32[we+17]=pe,this.float32[we+18]=xe,this.uint8[$e+76]=ye,this.uint16[Ae+39]=Ee,e}}Tl.prototype.bytesPerElement=80,at(Tl,"StructArrayLayout2f9i15ui1ul4f1ub1ui80");class Wr extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a){const h=this.length;return this.resize(h+1),this.emplace(h,e,i,o,l,a)}emplace(e,i,o,l,a,h){const m=5*e;return this.float32[m+0]=i,this.float32[m+1]=o,this.float32[m+2]=l,this.float32[m+3]=a,this.float32[m+4]=h,e}}Wr.prototype.bytesPerElement=20,at(Wr,"StructArrayLayout5f20");class Sl extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a,h,m){const g=this.length;return this.resize(g+1),this.emplace(g,e,i,o,l,a,h,m)}emplace(e,i,o,l,a,h,m,g){const v=7*e;return this.float32[v+0]=i,this.float32[v+1]=o,this.float32[v+2]=l,this.float32[v+3]=a,this.float32[v+4]=h,this.float32[v+5]=m,this.float32[v+6]=g,e}}Sl.prototype.bytesPerElement=28,at(Sl,"StructArrayLayout7f28");class s1 extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a,h,m,g,v,p,y){const w=this.length;return this.resize(w+1),this.emplace(w,e,i,o,l,a,h,m,g,v,p,y)}emplace(e,i,o,l,a,h,m,g,v,p,y,w){const x=11*e;return this.float32[x+0]=i,this.float32[x+1]=o,this.float32[x+2]=l,this.float32[x+3]=a,this.float32[x+4]=h,this.float32[x+5]=m,this.float32[x+6]=g,this.float32[x+7]=v,this.float32[x+8]=p,this.float32[x+9]=y,this.float32[x+10]=w,e}}s1.prototype.bytesPerElement=44,at(s1,"StructArrayLayout11f44");class a1 extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a,h,m,g,v){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,o,l,a,h,m,g,v)}emplace(e,i,o,l,a,h,m,g,v,p){const y=9*e;return this.float32[y+0]=i,this.float32[y+1]=o,this.float32[y+2]=l,this.float32[y+3]=a,this.float32[y+4]=h,this.float32[y+5]=m,this.float32[y+6]=g,this.float32[y+7]=v,this.float32[y+8]=p,e}}a1.prototype.bytesPerElement=36,at(a1,"StructArrayLayout9f36");class fa extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,i)}emplace(e,i,o){const l=2*e;return this.float32[l+0]=i,this.float32[l+1]=o,e}}fa.prototype.bytesPerElement=8,at(fa,"StructArrayLayout2f8");class h0 extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o,l){const a=this.length;return this.resize(a+1),this.emplace(a,e,i,o,l)}emplace(e,i,o,l,a){const h=6*e;return this.uint32[3*e+0]=i,this.uint16[h+2]=o,this.uint16[h+3]=l,this.uint16[h+4]=a,e}}h0.prototype.bytesPerElement=12,at(h0,"StructArrayLayout1ul3ui12");class El extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint16[1*e+0]=i,e}}El.prototype.bytesPerElement=2,at(El,"StructArrayLayout1ui2");class Ml extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a,h,m,g,v,p,y,w,x,b,S,I){const P=this.length;return this.resize(P+1),this.emplace(P,e,i,o,l,a,h,m,g,v,p,y,w,x,b,S,I)}emplace(e,i,o,l,a,h,m,g,v,p,y,w,x,b,S,I,P){const O=16*e;return this.float32[O+0]=i,this.float32[O+1]=o,this.float32[O+2]=l,this.float32[O+3]=a,this.float32[O+4]=h,this.float32[O+5]=m,this.float32[O+6]=g,this.float32[O+7]=v,this.float32[O+8]=p,this.float32[O+9]=y,this.float32[O+10]=w,this.float32[O+11]=x,this.float32[O+12]=b,this.float32[O+13]=S,this.float32[O+14]=I,this.float32[O+15]=P,e}}Ml.prototype.bytesPerElement=64,at(Ml,"StructArrayLayout16f64");class Al extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o,l,a,h,m){const g=this.length;return this.resize(g+1),this.emplace(g,e,i,o,l,a,h,m)}emplace(e,i,o,l,a,h,m,g){const v=10*e,p=5*e;return this.uint16[v+0]=i,this.uint16[v+1]=o,this.uint16[v+2]=l,this.uint16[v+3]=a,this.float32[p+2]=h,this.float32[p+3]=m,this.float32[p+4]=g,e}}Al.prototype.bytesPerElement=20,at(Al,"StructArrayLayout4ui3f20");class Il extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.int16[1*e+0]=i,e}}Il.prototype.bytesPerElement=2,at(Il,"StructArrayLayout1i2");class l1 extends Ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint8[1*e+0]=i,e}}l1.prototype.bytesPerElement=1,at(l1,"StructArrayLayout1ub1");class c1 extends l0{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}c1.prototype.size=40;class d0 extends r1{get(e){return new c1(this,e)}}at(d0,"CollisionBoxArray");class Wc extends l0{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}Wc.prototype.size=60;class Xc extends wl{get(e){return new Wc(this,e)}}at(Xc,"PlacedSymbolArray");class Yc extends l0{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(e){this._structArray.uint32[this._pos4+14]=e}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(e){this._structArray.float32[this._pos4+18]=e}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}get elevationFeatureIndex(){return this._structArray.uint16[this._pos2+39]}}Yc.prototype.size=80;class Kc extends Tl{get(e){return new Yc(this,e)}}at(Kc,"SymbolInstanceArray");class Jc extends _s{getoffsetX(e){return this.float32[1*e+0]}}at(Jc,"GlyphOffsetArray");class p0 extends fo{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}at(p0,"SymbolLineVertexArray");class f0 extends l0{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]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}f0.prototype.size=12;class Xr extends h0{get(e){return new f0(this,e)}}at(Xr,"FeatureIndexArray");class m0 extends Ho{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}at(m0,"FillExtrusionCentroidArray");class Qc extends l0{get a_join_normal_inside0(){return this._structArray.int16[this._pos2+0]}get a_join_normal_inside1(){return this._structArray.int16[this._pos2+1]}get a_join_normal_inside2(){return this._structArray.int16[this._pos2+2]}}Qc.prototype.size=6;class eu extends pa{get(e){return new Qc(this,e)}}at(eu,"FillExtrusionWallArray");const Xh=hi([{name:"a_pos",components:2,type:"Int16"}],4),Yh=hi([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class ki{constructor(e=[]){this.segments=e}_prepareSegment(e,i,o,l){let a=this.segments[this.segments.length-1];return e>ki.MAX_VERTEX_ARRAY_LENGTH&&ji(`Max vertices per segment is ${ki.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!a||a.vertexLength+e>ki.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==l)&&(a={vertexOffset:i,primitiveOffset:o,vertexLength:0,primitiveLength:0},l!==void 0&&(a.sortKey=l),this.segments.push(a)),a}prepareSegment(e,i,o,l){return this._prepareSegment(e,i.length,o.length,l)}get(){return this.segments}destroy(){for(const e of this.segments)for(const i in e.vaos)e.vaos[i].destroy()}static simpleSegment(e,i,o,l){return new ki([{vertexOffset:e,primitiveOffset:i,vertexLength:o,primitiveLength:l,vaos:{},sortKey:0}])}}function tu(n,e){return 256*(n=$t(Math.floor(n),0,255))+$t(Math.floor(e),0,255)}ki.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,at(ki,"SegmentVector");const u1=hi([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Kh=hi([{name:"a_dash",components:4,type:"Uint16"}]);class _0{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}add(e,i,o,l){this.ids.push(h1(e)),this.positions.push(i,o,l)}eachPosition(e,i){const o=h1(e);let l=0,a=this.ids.length-1;for(;l>1;this.ids[h]>=o?a=h:l=h+1}for(;this.ids[l]===o;)i(this.positions[3*l],this.positions[3*l+1],this.positions[3*l+2]),l++}static serialize(e,i){const o=new Float64Array(e.ids),l=new Uint32Array(e.positions);return g0(o,l,0,o.length-1),i&&(i.add(o.buffer),i.add(l.buffer)),{ids:o,positions:l}}static deserialize(e){const i=new _0;let o;i.ids=e.ids,i.positions=e.positions;for(const l of i.ids)l!==o&&i.uniqueIds.push(l),o=l;return i.indexed=!0,i}}function h1(n){const e=+n;return!isNaN(e)&&Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:rn(String(n))}function g0(n,e,i,o){for(;i>1];let a=i-1,h=o+1;for(;;){do a++;while(n[a]l);if(a>=h)break;Pl(n,a,h),Pl(e,3*a,3*h),Pl(e,3*a+1,3*h+1),Pl(e,3*a+2,3*h+2)}h-i`u_${a}`),this.type=o,this.context=l}setUniform(e,i,o,l,a){const h=l.constantOr(this.value);i.set(e,a,h instanceof bi?h.toRenderColor(this.lutExpression&&this.lutExpression.value==="none"?null:this.context.lut):h)}getBinding(e,i){return this.type==="color"?new iu(e):new Ji(e)}}class ys{constructor(e,i){this.uniformNames=i.map(o=>`u_${o}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,i,o,l,a){const h=a==="u_pattern"||a==="u_dash"?this.pattern:a==="u_pixel_ratio"?this.pixelRatio:null;h&&i.set(e,a,h)}getBinding(e,i){return i==="u_pattern"||i==="u_dash"?new x0(e):new Ji(e)}}class _o{constructor(e,i,o,l){this.expression=e,this.type=o,this.maxValue=0,this.paintVertexAttributes=i.map(a=>({name:`a_${a}`,type:"Float32",components:o==="color"?2:1,offset:0})),this.paintVertexArray=new l}populatePaintArray(e,i,o,l,a,h,m){const g=this.paintVertexArray.length,v=this.expression.kind==="composite"||this.expression.kind==="source"?this.expression.evaluate(new Ai(0,{brightness:h}),i,{},a,l,m):this.expression.kind==="constant"&&this.expression.value,p=!!this.lutExpression&&(this.lutExpression.kind==="composite"||this.lutExpression.kind==="source"?this.lutExpression.evaluate(new Ai(0,{brightness:h}),i,{},a,l,m):this.lutExpression.value)==="none";this.paintVertexArray.resize(e),this._setPaintValue(g,e,v,p?null:this.context.lut)}updatePaintArray(e,i,o,l,a,h,m){const g=this.expression.kind==="composite"||this.expression.kind==="source"?this.expression.evaluate({zoom:0,brightness:m},o,l,void 0,a):this.expression.kind==="constant"&&this.expression.value,v=!!this.lutExpression&&(this.lutExpression.kind==="composite"||this.lutExpression.kind==="source"?this.lutExpression.evaluate(new Ai(0,{brightness:m}),o,l,void 0,a):this.lutExpression.value)==="none";this._setPaintValue(e,i,g,v?null:this.context.lut)}_setPaintValue(e,i,o,l){if(this.type==="color"){const a=f1(o.toRenderColor(l));for(let h=e;h`u_${m}_t`),this.type=o,this.useIntegerZoom=l,this.context=a,this.maxValue=0,this.paintVertexAttributes=i.map(m=>({name:`a_${m}`,type:"Float32",components:o==="color"?4:2,offset:0})),this.paintVertexArray=new h}populatePaintArray(e,i,o,l,a,h,m){const g=this.expression.evaluate(new Ai(this.context.zoom,{brightness:h}),i,{},a,l,m),v=this.expression.evaluate(new Ai(this.context.zoom+1,{brightness:h}),i,{},a,l,m),p=!!this.lutExpression&&(this.lutExpression.kind==="composite"||this.lutExpression.kind==="source"?this.lutExpression.evaluate(new Ai(0,{brightness:h}),i,{},a,l,m):this.lutExpression.value)==="none",y=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(y,e,g,v,p?null:this.context.lut)}updatePaintArray(e,i,o,l,a,h,m){const g=this.expression.evaluate({zoom:this.context.zoom,brightness:m},o,l,void 0,a),v=this.expression.evaluate({zoom:this.context.zoom+1,brightness:m},o,l,void 0,a),p=!!this.lutExpression&&(this.lutExpression.kind==="composite"||this.lutExpression.kind==="source"?this.lutExpression.evaluate(new Ai(0,{brightness:m}),o,l,void 0,a):this.lutExpression.value)==="none";this._setPaintValue(e,i,g,v,p?null:this.context.lut)}_setPaintValue(e,i,o,l,a){if(this.type==="color"){const h=f1(o.toRenderColor(a)),m=f1(o.toRenderColor(a));for(let g=e;g!0){this.binders={},this._buffers=[],this.context=i;const l=[];for(const a in e.paint._values){const h=e.paint.get(a);if(a.endsWith("-use-theme")||!o(a)||!(h instanceof la&&ta(h.property.specification)))continue;const m=e4(a,e.type),g=h.value,v=h.property.specification.type,p=!!h.property.useIntegerZoom,y=a==="line-dasharray"||a.endsWith("pattern"),w=e.paint.get(`${a}-use-theme`),x=a==="line-dasharray"&&e.layout.get("line-cap").value.kind!=="constant"||w&&w.value.kind!=="constant";if(g.kind!=="constant"||x)if(g.kind==="source"||x||y){const b=nu(a,v,"source");this.binders[a]=y?new Zo(g,m,v,b,e.id):new _o(g,m,v,b),l.push(`/a_${a}`)}else{const b=nu(a,v,"composite");this.binders[a]=new On(g,m,v,p,i,b),l.push(`/z_${a}`)}else this.binders[a]=y?new ys(g.value,m):new b0(g.value,m,v,i),l.push(`/u_${a}`);w&&(this.binders[a].lutExpression=w.value)}this.cacheKey=l.sort().join("")}getMaxValue(e){const i=this.binders[e];return i instanceof _o||i instanceof On?i.maxValue:0}populatePaintArrays(e,i,o,l,a,h,m){for(const g in this.binders){const v=this.binders[g];v.context=this.context,(v instanceof _o||v instanceof On||v instanceof Zo)&&v.populatePaintArray(e,i,o,l,a,h,m)}}setConstantPatternPositions(e){for(const i in this.binders){const o=this.binders[i];o instanceof ys&&o.setConstantPatternPositions(e)}}updatePaintArrays(e,i,o,l,a,h,m,g,v){let p=!1;const y=Object.keys(e),w=y.length!==0&&!g,x=w?y:i.uniqueIds;this.context.lut=a.lut;for(const b in this.binders){const S=this.binders[b];if(S.context=this.context,(S instanceof _o||S instanceof On||S instanceof Zo)&&S.expression&&S.expression.kind&&S.expression.kind!=="constant"&&(S.expression.isStateDependent===!0||S.expression.isLightConstant===!1)){const I=a.paint.get(b);S.expression=I.value;for(const P of x){const O=e[P.toString()];i.eachPosition(P,(L,D,F)=>{const V=l.feature(L);S.updatePaintArray(D,F,V,O,h,m,v)})}if(!w)for(const P of o.uniqueIds){const O=e[P.toString()];o.eachPosition(P,(L,D,F)=>{const V=l.feature(L);S.updatePaintArray(D,F,V,O,h,m,v)})}p=!0}}return p}defines(){const e=[];for(const i in this.binders){const o=this.binders[i];(o instanceof b0||o instanceof ys)&&e.push(...o.uniformNames.map(l=>`#define HAS_UNIFORM_${l}`))}return e}getBinderAttributes(){const e=[];for(const i in this.binders){const o=this.binders[i];if(o instanceof _o||o instanceof On||o instanceof Zo)for(let l=0;l!0){this.programConfigurations={};for(const l of e)this.programConfigurations[l.id]=new xs(l,i,o);this.needsUpload=!1,this._featureMap=new _0,this._featureMapWithoutIds=new _0,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(e,i,o,l,a,h,m,g){for(const v in this.programConfigurations)this.programConfigurations[v].populatePaintArrays(e,i,l,a,h,m,g);i.id!==void 0?this._featureMap.add(i.id,o,this._bufferOffset,e):(this._featureMapWithoutIds.add(this._idlessCounter,o,this._bufferOffset,e),this._idlessCounter+=1),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,i,o,l,a,h,m){for(const g of o)this.needsUpload=this.programConfigurations[g.id].updatePaintArrays(e,this._featureMap,this._featureMapWithoutIds,i,g,l,a,h,m||0)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const Qh={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-occlusion-opacity":["occlusion_opacity"],"icon-occlusion-opacity":["occlusion_opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"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"],"symbol-z-offset":["z_offset"],"line-gap-width":["gapwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function e4(n,e){return Qh[n]||[n.replace(`${e}-`,"").replace(/-/g,"_")]}const t4={"line-pattern":{source:$o,composite:$o},"fill-pattern":{source:$o,composite:$o},"fill-extrusion-pattern":{source:$o,composite:$o},"line-dasharray":{source:vl,composite:vl}},Cl={color:{source:fa,composite:gs},number:{source:_s,composite:fa}};function nu(n,e,i){const o=t4[n];return o&&o[i]||Cl[e][i]}at(b0,"ConstantBinder"),at(ys,"PatternConstantBinder"),at(_o,"SourceExpressionBinder"),at(Zo,"PatternCompositeBinder"),at(On,"CompositeExpressionBinder"),at(xs,"ProgramConfiguration",{omit:["_buffers"]}),at(Wo,"ProgramConfigurationSet");const Fr=Je/Math.PI/2,_a=5,ou=6,su=16383,ga=64,zl=[ga,32,16],an=-Fr,ln=Fr;function ya(n,e,i,o=Fr){return i=ri(i),[n*Math.sin(i)*o,-e*o,n*Math.cos(i)*o]}function vs(n,e,i){return ya(Math.cos(ri(n)),Math.sin(ri(n)),e,i)}const bs=63710088e-1,m1=2*Math.PI*bs;class di{constructor(e,i){if(isNaN(e)||isNaN(i))throw new Error(`Invalid LngLat object: (${e}, ${i})`);if(this.lng=+e,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new di(Oo(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const i=Math.PI/180,o=this.lat*i,l=e.lat*i,a=Math.sin(o)*Math.sin(l)+Math.cos(o)*Math.cos(l)*Math.cos((e.lng-this.lng)*i);return bs*Math.acos(Math.min(a,1))}toBounds(e=0){const i=360*e/40075017,o=i/Math.cos(Math.PI/180*this.lat);return new Xo({lng:this.lng-o,lat:this.lat-i},{lng:this.lng+o,lat:this.lat+i})}toEcef(e){return vs(this.lat,this.lng,Fr+e*Fr/bs)}static convert(e){if(e instanceof di)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new di(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new di(Number("lng"in e?e.lng:e.lon),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 [, ]")}}class Xo{constructor(e,i){if(e)if(i)this.setSouthWest(e).setNorthEast(i);else if(e.length===4){const o=e;this.setSouthWest([o[0],o[1]]).setNorthEast([o[2],o[3]])}else{const o=e;this.setSouthWest(o[0]).setNorthEast(o[1])}}setNorthEast(e){return this._ne=e instanceof di?new di(e.lng,e.lat):di.convert(e),this}setSouthWest(e){return this._sw=e instanceof di?new di(e.lng,e.lat):di.convert(e),this}extend(e){const i=this._sw,o=this._ne;let l,a;if(e instanceof di)l=e,a=e;else{if(!(e instanceof Xo))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(Xo.convert(e)):this.extend(di.convert(e)):typeof e=="object"&&e!==null&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(di.convert(e)):this;if(l=e._sw,a=e._ne,!l||!a)return this}return i||o?(i.lng=Math.min(l.lng,i.lng),i.lat=Math.min(l.lat,i.lat),o.lng=Math.max(a.lng,o.lng),o.lat=Math.max(a.lat,o.lat)):(this._sw=new di(l.lng,l.lat),this._ne=new di(a.lng,a.lat)),this}getCenter(){return new di((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 di(this.getWest(),this.getNorth())}getSouthEast(){return new di(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:i,lat:o}=di.convert(e);let l=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=o&&o<=this._ne.lat&&l}static convert(e){if(e)return e instanceof Xo?e:new Xo(e)}}const i4=0,r4=25.5;function Rl(n){return m1*Math.cos(n*Math.PI/180)}function Wn(n){return(180+n)/360}function wr(n){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360}function Tr(n,e){return n/Rl(e)}function Yr(n){return 360*n-180}function gr(n){return 360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90}function _1(n,e){return n*Rl(gr(e))}const Yi=85.051129;function au(n){return Math.cos(ri($t(n,-Yi,Yi)))}function Yo(n,e){const i=$t(e,i4,r4),o=Math.pow(2,i);return au(n)*m1/(512*o)}function n4(n){return 1/Math.cos(n*Math.PI/180)}function u(n,e=0){const i=Math.exp(Math.PI*(1-(n.y+e/Je)/(1<=g?(r(n,e,i,v,p,a,y,m,g),r(n,v,p,o,l,y,h,m,g)):n.push(h)}function c(n,e,i){let o=n[0],l=o.x,a=o.y;e(o);const h=[o];for(let m=1;mn.x+1||on.y+1)&&ji("Geometry exceeds allowed extent, reduce your vector tile buffer size"),n}function M(n,e,i){const o=n.loadGeometry(),l=n.extent,a=Je/l;if(e&&i&&i.projection.isReprojectedInTileSpace){const h=1<{const x=Yr((e.x+w.x/l)/h),b=gr((e.y+w.y/l)/h),S=p.project(x,b);w.x=(S.x*m-g)*l,w.y=(S.y*m-v)*l};for(let w=0;w=l||b.y<0||b.y>=l||(y(b),x.push(b));o[w]=x}}for(const h of o)for(const m of h)E(m,a);return o}function A(n,e){return{type:n.type,id:n.id,properties:n.properties,geometry:e?M(n):[]}}function z(n,e,i,o,l){n.emplaceBack(2*e+(o+1)/2,2*i+(l+1)/2)}function C(n,e,i){n.emplaceBack(e.x,e.y,e.z,i[0]*16384,i[1]*16384,i[2]*16384)}class k{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.fqid),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new fo,this.indexArray=new _r,this.segments=new ki,this.programConfigurations=new Wo(e.layers,{zoom:e.zoom,lut:e.lut}),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}updateFootprints(e,i){}populate(e,i,o,l){const a=this.layers[0],h=[];let m=null;a.type==="circle"&&(m=a.layout.get("circle-sort-key"));for(const{feature:v,id:p,index:y,sourceLayerIndex:w}of e){const x=this.layers[0]._featureFilter.needGeometry,b=A(v,x);if(!this.layers[0]._featureFilter.filter(new Ai(this.zoom),b,o))continue;const S=m?m.evaluate(b,{},o):void 0,I={id:p,properties:v.properties,type:v.type,sourceLayerIndex:w,index:y,geometry:x?b.geometry:M(v,o,l),patterns:{},sortKey:S};h.push(I)}m&&h.sort((v,p)=>v.sortKey-p.sortKey);let g=null;l.projection.name==="globe"&&(this.globeExtVertexArray=new bl,g=l.projection);for(const v of h){const{geometry:p,index:y,sourceLayerIndex:w}=v,x=e[y].feature;this.addFeature(v,p,y,i.availableImages,o,g,i.brightness),i.featureIndex.insert(x,p,y,w,this.index)}}update(e,i,o,l,a,h,m){this.programConfigurations.updatePaintArrays(e,i,a,o,l,h,m)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Xh.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Yh.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,i,o,l,a,h,m){for(const g of i)for(const v of g){const p=v.x,y=v.y;if(p<0||p>=Je||y<0||y>=Je)continue;if(h){const b=h.projectTilePoint(p,y,a),S=h.upVector(a,p,y),I=this.globeExtVertexArray;C(I,b,S),C(I,b,S),C(I,b,S),C(I,b,S)}const w=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),x=w.vertexLength;z(this.layoutVertexArray,p,y,-1,-1),z(this.layoutVertexArray,p,y,1,-1),z(this.layoutVertexArray,p,y,1,1),z(this.layoutVertexArray,p,y,-1,1),this.indexArray.emplaceBack(x,x+1,x+2),this.indexArray.emplaceBack(x,x+2,x+3),w.vertexLength+=4,w.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{},l,a,m)}}function j(n,e){for(let i=0;i1){if(K(n,e))return!0;for(let o=0;o1?i:i.sub(e)._mult(l)._add(e))}function ne(n,e){let i,o,l,a=!1;for(let h=0;he.y!=l.y>e.y&&e.x<(l.x-o.x)*(e.y-o.y)/(l.y-o.y)+o.x&&(a=!a)}return a}function oe(n,e){let i=!1;for(let o=0,l=n.length-1;oe.y!=h.y>e.y&&e.x<(h.x-a.x)*(e.y-a.y)/(h.y-a.y)+a.x&&(i=!i)}return i}function se(n,e,i,o,l){for(const h of n)if(e<=h.x&&i<=h.y&&o>=h.x&&l>=h.y)return!0;const a=[new Qe(e,i),new Qe(e,l),new Qe(o,l),new Qe(o,i)];if(n.length>2){for(const h of a)if(oe(n,h))return!0}for(let h=0;hl.x&&e.x>l.x||n.yl.y&&e.y>l.y)return!1;const a=Si(n,e,i[0]);return a!==Si(n,e,i[1])||a!==Si(n,e,i[2])||a!==Si(n,e,i[3])}function fe(n,e,i,o,l,a){let h=e.y-n.y,m=n.x-e.x;if(a=a||0){const g=h*h+m*m;if(g===0)return!0;const v=Math.sqrt(g);h/=v,m/=v}return!((i.x-n.x)*h+(i.y-n.y)*m-a<0||(o.x-n.x)*h+(o.y-n.y)*m-a<0||(l.x-n.x)*h+(l.y-n.y)*m-a<0)}function Ce(n,e,i,o,l,a,h){return!(fe(n,e,o,l,a,h)||fe(e,i,o,l,a,h)||fe(i,n,o,l,a,h)||fe(o,l,n,e,i,h)||fe(l,a,n,e,i,h)||fe(a,o,n,e,i,h))}function Se(n,e,i){const o=e.paint.get(n).value;return o.kind==="constant"?o.value:i.programConfigurations.get(e.id).getMaxValue(n)}function Ve(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1])}function Ue(n,e,i,o,l){if(!e[0]&&!e[1])return n;const a=Qe.convert(e)._mult(l);i==="viewport"&&a._rotate(-o);const h=[];for(let m=0;m0;p--)g=1<this.canonical.z?new qe(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new qe(e,this.wrap,e,this.canonical.x>>i,this.canonical.y>>i)}calculateScaledKey(e,i=!0){if(this.overscaledZ===e&&i)return this.key;if(e>this.canonical.z)return et(this.wrap*+i,e,this.canonical.z,this.canonical.x,this.canonical.y);{const o=this.canonical.z-e;return et(this.wrap*+i,e,e,this.canonical.x>>o,this.canonical.y>>o)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const i=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>i&&e.canonical.y===this.canonical.y>>i}children(e){if(this.overscaledZ>=e)return[new qe(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,o=2*this.canonical.x,l=2*this.canonical.y;return[new qe(i,this.wrap,i,o,l),new qe(i,this.wrap,i,o+1,l),new qe(i,this.wrap,i,o,l+1),new qe(i,this.wrap,i,o+1,l+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.y{let e=n.canonical.x-1,i=n.wrap;return e<0&&(e=(1<{let e=n.canonical.x+1,i=n.wrap;return e===1<new qe(n.overscaledZ,n.wrap,n.canonical.z,n.canonical.x,(n.canonical.y===0?1<new qe(n.overscaledZ,n.wrap,n.canonical.z,n.canonical.x,n.canonical.y===(1<=0;if(a===0)return 0;a!==e.length&&(i=!1)}return i?2:1}function Ht(n,e){for(const i of n.projections){const o=pi(e,n.points[0],i.axis);if(i.projection[1]o[1])return 0}return 1}function Fi(n,e){let i=0;const o=[0,0,0,0];for(let l=0;l=0&&i++;return i}class Ot{constructor(e,i){this.points=e||new Array(8).fill([0,0,0]),this.planes=i||new Array(6).fill([0,0,0,0]),this.bounds=mt.fromPoints(this.points),this.projections=[],this.frustumEdges=[Q.vec3.sub([],this.points[2],this.points[3]),Q.vec3.sub([],this.points[0],this.points[3]),Q.vec3.sub([],this.points[4],this.points[0]),Q.vec3.sub([],this.points[5],this.points[1]),Q.vec3.sub([],this.points[6],this.points[2]),Q.vec3.sub([],this.points[7],this.points[3])];for(const o of this.frustumEdges){const l=[0,-o[2],o[1]],a=[o[2],0,-o[0]];this.projections.push({axis:l,projection:pi(this.points,this.points[0],l)}),this.projections.push({axis:a,projection:pi(this.points,this.points[0],a)})}}static fromInvProjectionMatrix(e,i,o,l){const a=Math.pow(2,o),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(v=>{const p=Q.vec4.transformMat4([],v,e),y=1/p[3]/i*a;return Q.vec4.mul(p,p,[y,y,l?1/p[3]:y,y])}),m=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(v=>{const p=Q.vec3.sub([],h[v[0]],h[v[1]]),y=Q.vec3.sub([],h[v[2]],h[v[1]]),w=Q.vec3.normalize([],Q.vec3.cross([],p,y)),x=-Q.vec3.dot(w,h[v[1]]);return w.concat(x)}),g=[];for(let v=0;vv[1]||v[0]>g[1])return 0}return 1}containsPoint(e){for(const i of this.planes){const o=i[3];if(Q.vec3.dot([i[0],i[1],i[2]],e)+o<0)return!1}return!0}}class mt{static fromPoints(e){const i=[1/0,1/0,1/0],o=[-1/0,-1/0,-1/0];for(const l of e)Q.vec3.min(i,i,l),Q.vec3.max(o,o,l);return new mt(i,o)}static fromTileIdAndHeight(e,i,o){const l=1<e.max[i]||e.min[i]>this.max[i])return!1;return!0}intersectsAabbXY(e){return!(this.min[0]>e.max[0]||e.min[0]>this.max[0]||this.min[1]>e.max[1]||e.min[1]>this.max[1])}encapsulate(e){for(let i=0;i<3;i++)this.min[i]=Math.min(this.min[i],e.min[i]),this.max[i]=Math.max(this.max[i],e.max[i])}encapsulatePoint(e){for(let i=0;i<3;i++)this.min[i]=Math.min(this.min[i],e[i]),this.max[i]=Math.max(this.max[i],e[i])}closestPoint(e){return[Math.max(Math.min(this.max[0],e[0]),this.min[0]),Math.max(Math.min(this.max[1],e[1]),this.min[1]),Math.max(Math.min(this.max[2],e[2]),this.min[2])]}}function ti(n){return n*Fr/bs}at(mt,"Aabb");const wi=[new mt([an,an,an],[ln,ln,ln]),new mt([an,an,an],[0,0,ln]),new mt([0,an,an],[ln,0,ln]),new mt([an,0,an],[0,ln,ln]),new mt([0,0,an],[ln,ln,ln])];function li(n,e,i,o=!0){const l=Q.vec3.scale([],n._camera.position,n.worldSize),a=[e,i,1,1];Q.vec4.transformMat4(a,a,n.pixelMatrixInverse),Q.vec4.scale(a,a,1/a[3]);const h=Q.vec3.sub([],a,l),m=Q.vec3.normalize([],h),g=n.globeMatrix,v=[g[12],g[13],g[14]],p=Q.vec3.sub([],v,l),y=Q.vec3.length(p),w=Q.vec3.normalize([],p),x=n.worldSize/(2*Math.PI),b=Q.vec3.dot(w,m),S=Math.asin(x/y);if(S1?null:function(o,l,a,h){const m=Math.sin(a);return o*(Math.sin((1-h)*a)/m)+l*(Math.sin(h*a)/m)}(n.a[e],n.b[e],n.angle,$t(i,0,1))+n.center[e]}function or(n){if(n.z<=1)return wi[n.z+2*n.y+n.x];const e=Bi(si(n));return mt.fromPoints(e)}function ar(n,e,i){return Q.vec3.scale(n,n,1-i),Q.vec3.scaleAndAdd(n,n,e,i)}function cn(n,e,i){for(const o of n)Q.vec3.transformMat4(o,o,e),Q.vec3.scale(o,o,i)}function zr(n,e,i,o){const l=e/n.worldSize,a=n.globeMatrix;if(i.z<=1){const X=or(i).getCorners();return cn(X,a,l),mt.fromPoints(X)}const h=si(i,o),m=Bi(h,Fr+ti(n._tileCoverLift));cn(m,a,l);const g=Number.MAX_VALUE,v=[-g,-g,-g],p=[g,g,g];if(h.contains(n.center)){for(const le of m)Q.vec3.min(p,p,le),Q.vec3.max(v,v,le);v[2]=0;const X=n.point,Y=[X.x*l,X.y*l,0];return Q.vec3.min(p,p,Y),Q.vec3.max(v,v,Y),new mt(p,v)}if(n._tileCoverLift>0){for(const X of m)Q.vec3.min(p,p,X),Q.vec3.max(v,v,X);return new mt(p,v)}const y=[a[12]*l,a[13]*l,a[14]*l],w=h.getCenter(),x=$t(n.center.lat,-Yi,Yi),b=$t(w.lat,-Yi,Yi),S=Wn(n.center.lng),I=wr(x);let P=S-Wn(w.lng);const O=I-wr(b);P>.5?P-=1:P<-.5&&(P+=1);let L=0;if(Math.abs(P)>Math.abs(O))L=P>=0?1:3;else{L=O>=0?0:2;const X=[a[4]*l,a[5]*l,a[6]*l],Y=-Math.sin(ri(O>=0?h.getSouth():h.getNorth()))*Fr;Q.vec3.scaleAndAdd(y,y,X,Y)}const D=m[L],F=m[(L+1)%4],V=new $i(D,F,y),q=[Qi(V,0)||D[0],Qi(V,1)||D[1],Qi(V,2)||D[2]],J=Gr(n.zoom);if(J>0){const X=function({x:le,y:ee,z:ce},me,pe,xe,ye){const Ee=1/(1<.5?lt=-1:Ze<-.5&&(lt=1),we=((we+lt)*me-(xe*=me))*pe+xe,Ae=((Ae+lt)*me-xe)*pe+xe,$e=($e*me-(ye*=me))*pe+ye,Ge=(Ge*me-ye)*pe+ye,[[we,Ge,0],[Ae,Ge,0],[Ae,$e,0],[we,$e,0]]}(i,e,n._pixelsPerMercatorPixel,S,I);for(let le=0;leMath.PI/2*1.01}const go=ri(85),Yn=Math.cos(go),yo=Math.sin(go),g1=Q.mat4.create(),xa=n=>{const e=[];return n.paint.get("circle-pitch-alignment")==="map"&&e.push("PITCH_WITH_MAP"),n.paint.get("circle-pitch-scale")==="map"&&e.push("SCALE_WITH_MAP"),e};function Dl(n,e,i,o,l,a,h,m,g){if(a&&n.queryGeometry.isAboveHorizon)return!1;a&&(g*=n.pixelToTileUnitsFactor);const v=n.tileID.canonical,p=i.projection.upVectorScale(v,i.center.lat,i.worldSize).metersToTile;for(const y of e)for(const w of y){const x=w.add(m),b=l&&i.elevation?i.elevation.exaggeration()*l.getElevationAt(x.x,x.y,!0):0,S=i.projection.projectTilePoint(x.x,x.y,v);if(b>0){const L=i.projection.upVector(v,x.x,x.y);S.x+=L[0]*p*b,S.y+=L[1]*p*b,S.z+=L[2]*p*b}const I=a?x:y1(S.x,S.y,S.z,o),P=a?n.tilespaceRays.map(L=>_5(L,b)):n.queryGeometry.screenGeometry,O=Q.vec4.transformMat4([],[S.x,S.y,S.z,1],o);if(!h&&a?g*=O[3]/i.cameraToCenterDistance:h&&!a&&(g*=i.cameraToCenterDistance/O[3]),a){const L=gr((w.y/Je+v.y)/(1<n.width||l.height>n.height||i.x>n.width-l.width||i.y>n.height-l.height)throw new RangeError("out of range source coordinates for image copy");if(l.width>e.width||l.height>e.height||o.x>e.width-l.width||o.y>e.height-l.height)throw new RangeError("out of range destination coordinates for image copy");const g=n.data,v=e.data,p=a===4&&m;for(let y=0;y{e[n.evaluationKey]=g;const v=n.expression.evaluate(e);v&&(l.data[h+m+0]=Math.floor(255*v.r/v.a),l.data[h+m+1]=Math.floor(255*v.g/v.a),l.data[h+m+2]=Math.floor(255*v.b/v.a),l.data[h+m+3]=Math.floor(255*v.a))};if(n.clips)for(let h=0,m=0;h80*i){m=1/0,g=1/0;let p=-1/0,y=-1/0;for(let w=i;wp&&(p=x),b>y&&(y=b)}v=Math.max(p-m,y-g),v=v!==0?32767/v:0}return b1(a,h,i,m,g,v,0),h}function cp(n,e,i,o,l){let a;if(l===function(h,m,g,v){let p=0;for(let y=m,w=g-v;y0)for(let h=e;h=e;h-=o)a=dp(h/o|0,n[h],n[h+1],a);return a&&lu(a,a.next)&&(T1(a),a=a.next),a}function w0(n,e){if(!n)return n;e||(e=n);let i,o=n;do if(i=!1,o.steiner||!lu(o,o.next)&&lr(o.prev,o,o.next)!==0)o=o.next;else{if(T1(o),o=e=o.prev,o===o.next)break;i=!0}while(i||o!==e);return e}function b1(n,e,i,o,l,a,h){if(!n)return;!h&&a&&function(g,v,p,y){let w=g;do w.z===0&&(w.z=s4(w.x,w.y,v,p,y)),w.prevZ=w.prev,w.nextZ=w.next,w=w.next;while(w!==g);w.prevZ.nextZ=null,w.prevZ=null,function(x){let b,S=1;do{let I,P=x;x=null;let O=null;for(b=0;P;){b++;let L=P,D=0;for(let V=0;V0||F>0&&L;)D!==0&&(F===0||!L||P.z<=L.z)?(I=P,P=P.nextZ,D--):(I=L,L=L.nextZ,F--),O?O.nextZ=I:x=I,I.prevZ=O,O=I;P=L}O.nextZ=null,S*=2}while(b>1)}(w)}(n,o,l,a);let m=n;for(;n.prev!==n.next;){const g=n.prev,v=n.next;if(a?w5(n,o,l,a):b5(n))e.push(g.i,n.i,v.i),T1(n),n=v.next,m=v.next;else if((n=v)===m){h?h===1?b1(n=T5(w0(n),e),e,i,o,l,a,2):h===2&&S5(n,e,i,o,l,a):b1(w0(n),e,i,o,l,a,1);break}}}function b5(n){const e=n.prev,i=n,o=n.next;if(lr(e,i,o)>=0)return!1;const l=e.x,a=i.x,h=o.x,m=e.y,g=i.y,v=o.y,p=la?l>h?l:h:a>h?a:h,x=m>g?m>v?m:v:g>v?g:v;let b=o.next;for(;b!==e;){if(b.x>=p&&b.x<=w&&b.y>=y&&b.y<=x&&Ll(l,m,a,g,h,v,b.x,b.y)&&lr(b.prev,b,b.next)>=0)return!1;b=b.next}return!0}function w5(n,e,i,o){const l=n.prev,a=n,h=n.next;if(lr(l,a,h)>=0)return!1;const m=l.x,g=a.x,v=h.x,p=l.y,y=a.y,w=h.y,x=mg?m>v?m:v:g>v?g:v,I=p>y?p>w?p:w:y>w?y:w,P=s4(x,b,e,i,o),O=s4(S,I,e,i,o);let L=n.prevZ,D=n.nextZ;for(;L&&L.z>=P&&D&&D.z<=O;){if(L.x>=x&&L.x<=S&&L.y>=b&&L.y<=I&&L!==l&&L!==h&&Ll(m,p,g,y,v,w,L.x,L.y)&&lr(L.prev,L,L.next)>=0||(L=L.prevZ,D.x>=x&&D.x<=S&&D.y>=b&&D.y<=I&&D!==l&&D!==h&&Ll(m,p,g,y,v,w,D.x,D.y)&&lr(D.prev,D,D.next)>=0))return!1;D=D.nextZ}for(;L&&L.z>=P;){if(L.x>=x&&L.x<=S&&L.y>=b&&L.y<=I&&L!==l&&L!==h&&Ll(m,p,g,y,v,w,L.x,L.y)&&lr(L.prev,L,L.next)>=0)return!1;L=L.prevZ}for(;D&&D.z<=O;){if(D.x>=x&&D.x<=S&&D.y>=b&&D.y<=I&&D!==l&&D!==h&&Ll(m,p,g,y,v,w,D.x,D.y)&&lr(D.prev,D,D.next)>=0)return!1;D=D.nextZ}return!0}function T5(n,e){let i=n;do{const o=i.prev,l=i.next.next;!lu(o,l)&&up(o,i,i.next,l)&&w1(o,l)&&w1(l,o)&&(e.push(o.i,i.i,l.i),T1(i),T1(i.next),i=n=l),i=i.next}while(i!==n);return w0(i)}function S5(n,e,i,o,l,a){let h=n;do{let m=h.next.next;for(;m!==h.prev;){if(h.i!==m.i&&P5(h,m)){let g=hp(h,m);return h=w0(h,h.next),g=w0(g,g.next),b1(h,e,i,o,l,a,0),void b1(g,e,i,o,l,a,0)}m=m.next}h=h.next}while(h!==n)}function E5(n,e){return n.x-e.x}function M5(n,e){const i=function(l,a){let h=a;const m=l.x,g=l.y;let v,p=-1/0;do{if(g<=h.y&&g>=h.next.y&&h.next.y!==h.y){const S=h.x+(g-h.y)*(h.next.x-h.x)/(h.next.y-h.y);if(S<=m&&S>p&&(p=S,v=h.x=h.x&&h.x>=w&&m!==h.x&&Ll(gv.x||h.x===v.x&&A5(v,h)))&&(v=h,b=S)}h=h.next}while(h!==y);return v}(n,e);if(!i)return e;const o=hp(i,n);return w0(o,o.next),w0(i,i.next)}function A5(n,e){return lr(n.prev,n,e.prev)<0&&lr(e.next,n,n.next)<0}function s4(n,e,i,o,l){return(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=(n-i)*l|0)|n<<8))|n<<4))|n<<2))|n<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-o)*l|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function I5(n){let e=n,i=n;do(e.x=(n-h)*(a-m)&&(n-h)*(o-m)>=(i-h)*(e-m)&&(i-h)*(a-m)>=(l-h)*(o-m)}function P5(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!function(i,o){let l=i;do{if(l.i!==i.i&&l.next.i!==i.i&&l.i!==o.i&&l.next.i!==o.i&&up(l,l.next,i,o))return!0;l=l.next}while(l!==i);return!1}(n,e)&&(w1(n,e)&&w1(e,n)&&function(i,o){let l=i,a=!1;const h=(i.x+o.x)/2,m=(i.y+o.y)/2;do l.y>m!=l.next.y>m&&l.next.y!==l.y&&h<(l.next.x-l.x)*(m-l.y)/(l.next.y-l.y)+l.x&&(a=!a),l=l.next;while(l!==i);return a}(n,e)&&(lr(n.prev,n,e.prev)||lr(n,e.prev,e))||lu(n,e)&&lr(n.prev,n,n.next)>0&&lr(e.prev,e,e.next)>0)}function lr(n,e,i){return(e.y-n.y)*(i.x-e.x)-(e.x-n.x)*(i.y-e.y)}function lu(n,e){return n.x===e.x&&n.y===e.y}function up(n,e,i,o){const l=uu(lr(n,e,i)),a=uu(lr(n,e,o)),h=uu(lr(i,o,n)),m=uu(lr(i,o,e));return l!==a&&h!==m||!(l!==0||!cu(n,i,e))||!(a!==0||!cu(n,o,e))||!(h!==0||!cu(i,n,o))||!(m!==0||!cu(i,e,o))}function cu(n,e,i){return e.x<=Math.max(n.x,i.x)&&e.x>=Math.min(n.x,i.x)&&e.y<=Math.max(n.y,i.y)&&e.y>=Math.min(n.y,i.y)}function uu(n){return n>0?1:n<0?-1:0}function w1(n,e){return lr(n.prev,n,n.next)<0?lr(n,e,n.next)>=0&&lr(n,n.prev,e)>=0:lr(n,e,n.prev)<0||lr(n,n.next,e)<0}function hp(n,e){const i=a4(n.i,n.x,n.y),o=a4(e.i,e.x,e.y),l=n.next,a=e.prev;return n.next=e,e.prev=n,i.next=l,l.prev=i,o.next=i,i.prev=o,a.next=o,o.prev=a,o}function dp(n,e,i,o){const l=a4(n,e,i);return o?(l.next=o.next,l.prev=o,o.next.prev=l,o.next=l):(l.prev=l,l.next=l),l}function T1(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function a4(n,e,i){return{i:n,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function hu(n,e){const i=n.length;if(i<=1)return[n];const o=[];let l,a;for(let h=0;h1)for(let h=0;h>3}if(g--,m===1||m===2)v+=l.readSVarint(),p+=l.readSVarint(),m===1&&(a&&y.push(a),a=[]),a.push(new n(v,p));else{if(m!==7)throw new Error("unknown command "+m);a&&a.push(a[0].clone())}}return a&&y.push(a),y},e.prototype.bbox=function(){var l=this._pbf;l.pos=this._geometry;for(var a=l.readVarint()+l.pos,h=1,m=0,g=0,v=0,p=1/0,y=-1/0,w=1/0,x=-1/0;l.pos>3}if(m--,h===1||h===2)(g+=l.readSVarint())y&&(y=g),(v+=l.readSVarint())x&&(x=v);else if(h!==7)throw new Error("unknown command "+h)}return[p,w,y,x]},e.prototype.toGeoJSON=function(l,a,h){var m,g,v=this.extent*Math.pow(2,h),p=this.extent*l,y=this.extent*a,w=this.loadGeometry(),x=e.types[this.type];function b(P){for(var O=0;O>3;m=v===1?h.readString():v===2?h.readFloat():v===3?h.readDouble():v===4?h.readVarint64():v===5?h.readVarint():v===6?h.readSVarint():v===7?h.readBoolean():null}return m}(a))}return h4=e,e.prototype.feature=function(o){if(o<0||o>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[o];var l=this._pbf.readVarint()+this._pbf.pos;return new n(this._pbf,l,this.extent,this._keys,this._values)},h4}function vp(){return gp||(gp=1,du.VectorTile=function(){if(_p)return d4;_p=1;var n=xp();function e(i,o,l){if(i===3){var a=new n(l,l.readVarint()+l.pos);a.length&&(o[a.name]=a)}}return d4=function(i,o){this.layers=i.readFields(e,{},o)},d4}(),du.VectorTileFeature=yp(),du.VectorTileLayer=xp()),du}var ba=vp();const T0="3d_elevation_id",bp="level";class z5{constructor(){this._valid=!1}reset(e){return this.feature=e,this._valid=!0,this._geometry=e.loadGeometry(),this._geometry.length!==0&&this._geometry[0].length!==0||(this._valid=!1),this}geometry(e,i){return this._valid&&e(i(this._geometry)),this}require(e,i,o){return this.get(e,!0,i,o)}optional(e,i,o){return this.get(e,!1,i,o)}success(){return this._valid}get(e,i,o,l){const a=this.feature.properties.hasOwnProperty(e)?+this.feature.properties[e]:void 0;return this._valid&&a!==void 0?o(l?l(a):a):i&&(this._valid=!1),this}}class wp{constructor(e,i){this.featureFunc=e,this.vertexFunc=i}parseFeature(e,i,o){return this.featureFunc(e,i,o)}parseVertex(e,i,o){return this.vertexFunc(e,i,o)}}const R5=new wp((n,e,i)=>n.reset(e).require(T0,o=>{i.id=o}).optional("fixed_height_relative",o=>{i.constantHeight=o},ws.decodeRelativeHeight).geometry(o=>{i.bounds=o},ws.computeBounds).success(),(n,e,i)=>n.reset(e).require(T0,o=>{i.id=o}).require("elevation_idx",o=>{i.idx=o}).require("extent",o=>{i.extent=o}).require("height_relative",o=>{i.height=o},ws.decodeRelativeHeight).geometry(o=>{i.position=o},ws.getPoint).success()),D5=new wp((n,e,i)=>n.reset(e).require(T0,o=>{i.id=o}).optional("fixed_height",o=>{i.constantHeight=o},ws.decodeMetricHeight).geometry(o=>{i.bounds=o},ws.computeBounds).success(),(n,e,i)=>n.reset(e).require(T0,o=>{i.id=o}).require("elevation_idx",o=>{i.idx=o}).require("extent",o=>{i.extent=o}).require("height",o=>{i.height=o},ws.decodeMetricHeight).geometry(o=>{i.position=o},ws.getPoint).success());class ws{static computeBounds(e){const i=new Qe(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),o=new Qe(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(const l of e[0])i.x>l.x&&(i.x=l.x),i.y>l.y&&(i.y=l.y),o.xm.a(1-m)*a+m*h)(this.vertices[this.edges[o].a].height,this.vertices[this.edges[o].b].height,l)}getSafeArea(){return this.safeArea}isTunnel(){return this.heightRange.max<=-5}getClosestEdge(e){if(this.edges.length===0)return;let i=0,o=Number.POSITIVE_INFINITY,l=0;const a=Q.vec2.fromValues(e.x,e.y);for(let h=0;h0?Q.vec2.dot(P,I)/O:0,D=$t(L,0,1),F=Math.abs((L-D)*this.edgeProps[h].len),V=Q.vec2.subtract(Q.vec2.create(),a,p),q=F+Math.abs(Q.vec2.dot(V,Q.vec2.fromValues(g[1],-g[0])));q=0;--i){const o=this.edges[i].a,l=this.edges[i].b,{position:a,height:h,extent:m}=this.vertices[o],{position:g,height:v,extent:p}=this.vertices[l],y=this.vertexProps[o].dir,w=this.vertexProps[l].dir,x=Q.vec3.fromValues(a[0]/e,a[1]/e,h),b=Q.vec3.fromValues(g[0]/e,g[1]/e,v),S=Q.vec3.fromValues(y[1],-y[0],0);Q.vec3.scale(S,S,m);const I=Q.vec3.fromValues(w[1],-w[0],0);if(Q.vec3.scale(I,I,p),this.distSqLines(Q.vec3.fromValues(x[0]+.5*S[0],x[1]+.5*S[1],x[2]+.5*S[2]),Q.vec3.fromValues(b[0]-.5*I[0],b[1]-.5*I[1],b[2]-.5*I[2]),Q.vec3.fromValues(x[0]-.5*S[0],x[1]-.5*S[1],x[2]-.5*S[2]),Q.vec3.fromValues(b[0]+.5*I[0],b[1]+.5*I[1],b[2]+.5*I[2]))<=.05*.05)continue;const P=this.vertices.length,O=Q.vec2.add(Q.vec2.create(),a,g);this.vertices.push({position:Q.vec2.scale(O,O,.5),height:.5*(h+v),extent:.5*(m+p)});const L=Q.vec2.add(Q.vec2.create(),y,w);this.vertexProps.push({dir:Q.vec2.normalize(L,L)}),this.edges.splice(i,1),this.edgeProps.splice(i,1),this.edges.push({a:o,b:P}),this.edges.push({a:P,b:l});const D=Q.vec2.subtract(Q.vec2.create(),this.vertices[P].position,a),F=Q.vec2.length(D),V={vec:D,dir:Q.vec2.scale(Q.vec2.create(),D,1/F),len:F};this.edgeProps.push(V),this.edgeProps.push(V)}}distSqLines(e,i,o,l){const a=Q.vec3.subtract(Q.vec3.create(),i,e),h=Q.vec3.subtract(Q.vec3.create(),l,o),m=Q.vec3.subtract(Q.vec3.create(),e,o),g=Q.vec3.dot(a,a),v=Q.vec3.dot(a,h),p=Q.vec3.dot(a,m),y=Q.vec3.dot(h,h),w=Q.vec3.dot(h,m),x=g*y-v*v;if(x===0){const O=Q.vec3.dot(m,h)/Q.vec3.dot(h,h),L=Q.vec3.lerp(Q.vec3.create(),o,l,O);return Q.vec3.squaredDistance(L,e)}const b=(v*w-p*y)/x,S=(g*w-v*p)/x,I=Q.vec3.lerp(Q.vec3.create(),e,i,b),P=Q.vec3.lerp(Q.vec3.create(),o,l,S);return Q.vec3.squaredDistance(I,P)}}class L5{constructor(e,i){this.zScale=1,this.xOffset=0,this.yOffset=0,e.equals(i)||(this.zScale=Math.pow(2,i.z-e.z),this.xOffset=(e.x*this.zScale-i.x)*Je,this.yOffset=(e.y*this.zScale-i.y)*Je)}constantElevation(e,i){if(e.constantHeight!=null)return this.computeBiasedHeight(e.constantHeight,i)}pointElevation(e,i,o){const l=this.constantElevation(i,o);return l??(e.x=e.x*this.zScale+this.xOffset,e.y=e.y*this.zScale+this.yOffset,this.computeBiasedHeight(i.pointElevation(e),o))}computeBiasedHeight(e,i){return i<=0?e:e+i*Nr(0,i,e>=0?e:Math.abs(.5*e))}}at(p4,"ElevationFeature");class Tp{constructor(){this.polygons=new Map}add(e,...i){this.polygons.has(e)?this.polygons.get(e).push(...i):this.polygons.set(e,i)}merge(e){for(const[i,o]of e.polygons)this.add(i,...o)}}class S0{constructor(){this.portals=[]}static evaluate(e){if(e.length===0)return new S0;let i=[];for(const v of e)i.push(...v.portals);if(i.length===0)return new S0;const o=(v,p)=>v<=0&&p<=0||v>=Je&&p>=Je;for(const v of i){const p=v.va,y=v.vb;(o(p.x,y.x)||o(p.y,y.y))&&(v.type="border")}const l=i.filter(v=>v.type!=="unevaluated"),a=i.filter(v=>v.type==="unevaluated");if(a.length===0)return new S0;a.sort((v,p)=>v.hash===p.hash?v.isTunnel===p.isTunnel?0:v.isTunnel?-1:1:v.hashv.hashQ.vec3.fromValues(g.coord.x,g.coord.y,g.height))),[l,a,h,m]=o;this.addTriangles([l,a,h,h,m,l])}getBits(e){return this.view.setFloat32(0,e),BigInt(this.view.getUint32(0))}getVec3Bits(e){return this.getBits(e[0])<<64n|this.getBits(e[1])<<32n|this.getBits(e[2])}}class xo{constructor(e){this.unevaluatedPortals=new S0,this.portalPolygons=new Tp,this.vertexHashLookup=new Map,this.unevalVertices=[],this.unevalHeights=[],this.unevalTriangles=[],this.unevalTunnelTriangles=[],this.unevalEdges=[],this.vertexPositions=new c0,this.vertexNormals=new J3,this.indexArray=new _r,this.tileToMeters=u(e)}addVertices(e,i){const o=this.unevalVertices.length;for(let l=0;l=a.min.x&&p.x<=a.max.x&&p.y>=a.min.y&&p.y<=a.max.y||y.x>=a.min.x&&y.x<=a.max.x&&y.y>=a.min.y&&y.y<=a.max.y||he(p,y,h))||this.isOnBorder(p.x,y.x)||this.isOnBorder(p.y,y.y))continue;const w=xo.computeEdgeHash(this.unevalVertices[g],this.unevalVertices[v]);let x,b=this.vertexHashLookup.get(xo.computePosHash(p));b!=null?x=b.next:(b=this.vertexHashLookup.get(xo.computePosHash(y)),x=b!=null?b.prev:w),this.unevalEdges.push({polygonIdx:e,a:g,b:v,hash:w,portalHash:x,isTunnel:l,type:"unevaluated"})}}addPortalCandidates(e,i,o,l,a){if(i.length===0)return;this.portalPolygons.add(e,{geometry:i,zLevel:a});const h=i[0];this.vertexHashLookup.clear();let m=xo.computeEdgeHash(h[h.length-2],h[h.length-1]);for(let g=0;g({vertexOffset:0,primitiveOffset:this.indexArray.length}),o=y=>{y.primitiveLength=this.indexArray.length-y.primitiveOffset},l=new O5(this.vertexPositions,this.vertexNormals,this.indexArray);this.prepareEdges(e.portals,this.unevalEdges);const a=i(),h=i(),m=i(),g=(y,w)=>{y.sort((b,S)=>b.type===w&&S.type!==w?-1:b.type!==w&&S.type===w?1:0);const x=y.findIndex(b=>b.type!==w);return x>=0?x:y.length};let v=0;this.unevalEdges.length>0&&(v=g(this.unevalEdges,"none"),this.constructBridgeStructures(l,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:v},this.tileToMeters));const p=i();if(this.unevalEdges.length>0){const y=this.unevalEdges.splice(v),w=g(y,"tunnel")+v;this.unevalEdges.push(...y),this.constructTunnelStructures(l,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:v},{min:v,max:w})}o(m),l.addTriangles(this.unevalTriangles,this.unevalVertices,this.unevalHeights),o(p),l.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,this.unevalHeights),o(h),l.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,[-.1]),o(a),this.maskSegments=ki.simpleSegment(0,p.primitiveOffset,0,p.primitiveLength),this.depthSegments=ki.simpleSegment(0,h.primitiveOffset,0,h.primitiveLength),this.renderableSegments=ki.simpleSegment(0,m.primitiveOffset,0,m.primitiveLength),this.shadowCasterSegments=ki.simpleSegment(0,a.primitiveOffset,0,a.primitiveLength)}upload(e){this.vertexBuffer||this.vertexPositions.length===0||this.vertexNormals.length===0||this.indexArray.length===0||(this.vertexBuffer=e.createVertexBuffer(this.vertexPositions,x5.members),this.vertexBufferNormal=e.createVertexBuffer(this.vertexNormals,v5.members),this.indexBuffer=e.createIndexBuffer(this.indexArray))}destroy(){this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBufferNormal.destroy(),this.indexBuffer.destroy()),this.maskSegments&&(this.maskSegments.destroy(),this.depthSegments.destroy(),this.renderableSegments.destroy(),this.shadowCasterSegments.destroy())}computeVertexConnections(e,i,o,l){const a=new Map;for(let h=o;h0&&(p.to=v),e[g]>0&&(y.from=g)}return a}constructBridgeStructures(e,i,o,l,a,h){const m=this.computeVertexConnections(o,l,a.min,a.max),g=1/h,v=.5*g,p=w=>Q.vec3.fromValues(i[w].x,i[w].y,o[w]*g),y=w=>{const x=m.get(w),b=x.from,S=x.to;if(!b||!S)return;const I=p(b),P=p(w),O=p(S),L=Q.vec3.fromValues(0,0,0);if(!Q.vec3.exactEquals(I,P)){const F=Q.vec3.sub(Q.vec3.create(),P,I);Q.vec3.add(L,L,Q.vec3.normalize(F,F))}if(!Q.vec3.exactEquals(O,P)){const F=Q.vec3.sub(Q.vec3.create(),O,P);Q.vec3.add(L,L,Q.vec3.normalize(F,F))}const D=Q.vec3.len(L);return D>0?Q.vec3.scale(L,L,1/D):void 0};for(let w=a.min;wHe>=wt);if(b==null)continue;const S=b[0],I=b[1],P=Q.vec3.fromValues(S.coord.x,S.coord.y,g*S.height),O=Q.vec3.fromValues(I.coord.x,I.coord.y,g*I.height);if(Q.vec3.exactEquals(P,O))continue;const L=Q.vec3.sub(Q.vec3.create(),O,P);Q.vec3.normalize(L,L);const D=He=>Q.vec3.normalize(He,He),F=y(x.a)||L,V=y(x.b)||L,q=D(Q.vec3.fromValues(F[1],-F[0],0)),J=D(Q.vec3.fromValues(V[1],-V[0],0)),X=D(Q.vec3.cross(Q.vec3.create(),q,F)),Y=D(Q.vec3.cross(Q.vec3.create(),J,V)),le=Q.vec3.create(),ee=[Q.vec3.add(Q.vec3.create(),P,Q.vec3.scale(le,Q.vec3.sub(le,q,X),v)),Q.vec3.add(Q.vec3.create(),P,Q.vec3.scale(le,Q.vec3.add(le,q,X),v)),Q.vec3.add(Q.vec3.create(),P,Q.vec3.scale(le,X,v)),P],ce=[Q.vec3.add(Q.vec3.create(),O,Q.vec3.scale(le,Q.vec3.sub(le,J,Y),v)),Q.vec3.add(Q.vec3.create(),O,Q.vec3.scale(le,Q.vec3.add(le,J,Y),v)),Q.vec3.add(Q.vec3.create(),O,Q.vec3.scale(le,Y,v)),O],[me,pe]=e.addVertices(q,h,ee[0],ee[1]),[xe,ye]=e.addVertices(J,h,ce[0],ce[1]);e.addTriangles([me,pe,xe,pe,ye,xe]);const[Ee,we]=e.addVertices(X,h,ee[1],ee[2]),[Ae,$e]=e.addVertices(Y,h,ce[1],ce[2]);e.addTriangles([Ee,we,Ae,we,$e,Ae]);const[Ge,lt]=e.addVertices(Q.vec3.negate(q,q),h,ee[2],ee[3]),[Ze,Ke]=e.addVertices(Q.vec3.negate(J,J),h,ce[2],ce[3]);e.addTriangles([Ge,lt,Ze,lt,Ke,Ze])}}constructTunnelStructures(e,i,o,l,a,h){const m=g=>Q.vec3.normalize(g,g);for(let g=a.min;gx<=b);if(v==null)continue;const[p,y]=v,w=m(Q.vec3.fromValues(y.coord.y-p.coord.y,-(y.coord.x-p.coord.x),0));e.addQuad([p,y,{coord:y.coord,height:l[g].isTunnel?-.1:0},{coord:p.coord,height:l[g].isTunnel?-.1:0}],w)}for(let g=h.min;gm.hash===g.hash?g.polygonIdx-m.polygonIdx:g.hash>m.hash?1:-1);let o=0,l=0,a=0,h=i[o].polygonIdx;do l++,(l===i.length||i[o].hash!==i[l].hash)&&((l-o==1||i[l-1].polygonIdx!==h)&&(av.hashp.hash?m++:p.hash>v.portalHash?g++:(v.type=p.type,m++)}}}isOnBorder(e,i){return e<=0&&i<=0||e>=Je&&i>=Je}static computeEdgeHash(e,i){return(e.y===i.y&&e.x>i.x||e.y>i.y)&&([e,i]=[i,e]),BigInt(xo.computePosHash(e))<<32n|BigInt(xo.computePosHash(i))}static computePosHash(e){return((65535&e.x)<<16|65535&e.y)>>>0}}class f4{constructor(e,i){this.layoutVertexArray=new fo,this.indexArray=new _r,this.lineIndexArray=new Ho,this.triangleSegments=new ki,this.lineSegments=new ki,this.programConfigurations=new Wo(e.layers,{zoom:e.zoom,lut:e.lut}),this.uploaded=!1,i&&(this.elevatedLayoutVertexArray=new _s)}update(e,i,o,l,a,h,m){this.programConfigurations.updatePaintArrays(e,i,a,o,l,h,m)}isEmpty(){return this.layoutVertexArray.length===0}needsUpload(){return this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,g5.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.lineIndexBuffer=e.createIndexBuffer(this.lineIndexArray),this.elevatedLayoutVertexArray&&this.elevatedLayoutVertexArray.length>0&&(this.elevatedLayoutVertexBuffer=e.createVertexBuffer(this.elevatedLayoutVertexArray,y5.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.lineIndexBuffer.destroy(),this.programConfigurations.destroy(),this.triangleSegments.destroy(),this.lineSegments.destroy())}populatePaintArrays(e,i,o,l,a,h){this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,o,l,a,h)}}class m4{constructor(e){this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.fqid),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.bufferData=new f4(e,!1),this.elevationBufferData=new f4(e,!0),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.projection=e.projection,this.elevationMode=this.layers[0].layout.get("fill-elevation-reference")}updateFootprints(e,i){}populate(e,i,o,l){this.hasPattern=l4("fill",this.layers,this.pixelRatio,i);const a=this.layers[0].layout.get("fill-sort-key"),h=[];for(const{feature:m,id:g,index:v,sourceLayerIndex:p}of e){const y=this.layers[0]._featureFilter.needGeometry,w=A(m,y);if(!this.layers[0]._featureFilter.filter(new Ai(this.zoom),w,o))continue;const x=a?a.evaluate(w,{},o,i.availableImages):void 0,b={id:g,properties:m.properties,type:m.type,sourceLayerIndex:p,index:v,geometry:y?w.geometry:M(m,o,l),patterns:{},sortKey:x};h.push(b)}a&&h.sort((m,g)=>m.sortKey-g.sortKey);for(const m of h){const{geometry:g,index:v,sourceLayerIndex:p}=m;if(this.hasPattern){const y=c4("fill",this.layers,m,this.zoom,this.pixelRatio,i);this.patternFeatures.push(y)}else this.addFeature(m,g,v,o,{},i.availableImages,i.brightness,i.elevationFeatures);i.featureIndex.insert(e[v].feature,g,v,p,this.index)}}update(e,i,o,l,a,h,m){this.bufferData.update(e,i,o,l,a,h,m),this.elevationBufferData.update(e,i,o,l,a,h,m)}addFeatures(e,i,o,l,a,h){for(const m of this.patternFeatures)this.addFeature(m,m.geometry,m.index,i,o,l,h,e.elevationFeatures)}isEmpty(){return this.bufferData.isEmpty()&&this.elevationBufferData.isEmpty()}uploadPending(){return!this.uploaded||this.bufferData.needsUpload()||this.elevationBufferData.needsUpload()}upload(e){this.bufferData.upload(e),this.elevationBufferData.upload(e),this.elevatedStructures&&this.elevatedStructures.upload(e)}destroy(){this.bufferData.destroy(),this.elevationBufferData.destroy(),this.elevatedStructures&&this.elevatedStructures.destroy()}addFeature(e,i,o,l,a,h=[],m,g){const v=hu(i,500);this.elevationMode!=="none"?this.addElevatedRoadFeature(e,v,l,o,g):this.addGeometry(v,this.bufferData),this.bufferData.populatePaintArrays(e,o,a,h,l,m),this.elevationBufferData.populatePaintArrays(e,o,a,h,l,m)}getUnevaluatedPortalGraph(){return this.elevatedStructures?this.elevatedStructures.unevaluatedPortals:void 0}getElevationPolygons(){return this.elevatedStructures?this.elevatedStructures.portalPolygons:void 0}setEvaluatedPortalGraph(e){this.elevatedStructures&&this.elevatedStructures.construct(e)}addElevatedRoadFeature(e,i,o,l,a){const h=new Array,m=this.getElevationFeature(e,a);if(m){h.push({polygons:i,elevationFeature:m,elevationTileID:o});for(const g of h)if(g.elevationFeature){if(this.elevationMode==="hd-road-base"){this.elevatedStructures||(this.elevatedStructures=new xo(g.elevationTileID));const p=g.elevationFeature.isTunnel();let y=0;e.properties.hasOwnProperty(bp)&&(y=+e.properties[bp]);for(const w of g.polygons)this.elevatedStructures.addPortalCandidates(g.elevationFeature.id,w,p,g.elevationFeature,y)}const v=new L5(o,g.elevationTileID);this.addElevatedGeometry(g.polygons,v,g.elevationFeature,this.elevationMode==="hd-road-base"?0:.05,l)}}else this.addGeometry(i,this.bufferData)}addElevatedGeometry(e,i,o,l,a){const h={elevation:o,elevationSampler:i,bias:l,index:a},[m,g]=this.addGeometry(e,this.elevationBufferData,h);this.elevationBufferData.heightRange==null?this.elevationBufferData.heightRange={min:m,max:g}:(this.elevationBufferData.heightRange.min=Math.min(this.elevationBufferData.heightRange.min,m),this.elevationBufferData.heightRange.max=Math.max(this.elevationBufferData.heightRange.max,g))}addGeometry(e,i,o){let l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,h=null;o&&(h=o.elevationSampler.constantElevation(o.elevation,o.bias),h!=null&&(l=h,a=h));const m=(g,v,p)=>{if(o!=null)if(v.push(g),h!=null)i.elevatedLayoutVertexArray.emplaceBack(h),p.push(h);else{const y=o.elevationSampler.pointElevation(g,o.elevation,o.bias);i.elevatedLayoutVertexArray.emplaceBack(y),p.push(y),l=Math.min(l,y),a=Math.max(a,y)}};for(const g of e){let v=0;for(const L of g)v+=L.length;const p=i.triangleSegments.prepareSegment(v,i.layoutVertexArray,i.indexArray),y=p.vertexLength,w=[],x=[],b=[],S=[],I=[],P=i.layoutVertexArray.length;for(const L of g){if(L.length===0)continue;L!==g[0]&&x.push(w.length/2);const D=i.lineSegments.prepareSegment(L.length,i.layoutVertexArray,i.lineIndexArray),F=D.vertexLength;o&&I.push(i.layoutVertexArray.length-P),m(L[0],b,S),i.layoutVertexArray.emplaceBack(L[0].x,L[0].y),i.lineIndexArray.emplaceBack(F+L.length-1,F),w.push(L[0].x),w.push(L[0].y);for(let V=1;V0){for(let q=0;ql.id===o):void 0}}let Sp,Ep,Mp,Ap;at(m4,"FillBucket",{omit:["layers","patternFeatures"]}),at(f4,"FillBufferData"),at(xo,"ElevatedStructures");class _4{constructor(e,i,o,l){if(this.triangleCount=i.length/3,this.min=new Qe(0,0),this.max=new Qe(0,0),this.xScale=0,this.yScale=0,this.cellsX=0,this.cellsY=0,this.cells=[],this.payload=[],this.triangleCount===0||e.length===0)return;const[a,h]=[e[0].clone(),e[0].clone()];for(let y=1;yy.cellIdx-w.cellIdx||y.triIdx-w.triIdx);let p=0;for(;pthis.max.x||this.min.x>e.x||e.y>this.max.y||this.min.y>e.y)return;const o=Ko(e.x-this.min.x,this.xScale,this.cellsX),l=Ko(e.y-this.min.y,this.yScale,this.cellsY),a=this.cells[l*this.cellsX+o];if(a){this._lazyInitLookup();for(let h=0;hthis.max.x||this.min.x>i.x||e.y>this.max.y||this.min.y>i.y)return;this._lazyInitLookup();const l=Ko(e.x-this.min.x,this.xScale,this.cellsX),a=Ko(i.x-this.min.x,this.xScale,this.cellsX),h=Ko(e.y-this.min.y,this.yScale,this.cellsY),m=Ko(i.y-this.min.y,this.yScale,this.cellsY);for(let g=h;g<=m;g++)for(let v=l;v<=a;v++){const p=this.cells[g*this.cellsX+v];if(p)for(let y=0;yi.fqid),this.index=e.index,this.hasPattern=!1,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.footprints=[]}updateFootprints(e,i){for(const o of this.footprints)i.push({footprint:o,id:e})}populate(e,i,o,l){const a=[];for(const{feature:h,id:m,index:g,sourceLayerIndex:v}of e){const p=this.layers[0]._featureFilter.needGeometry,y=A(h,p);if(!this.layers[0]._featureFilter.filter(new Ai(this.zoom),y,o))continue;const w={id:m,properties:h.properties,type:h.type,sourceLayerIndex:v,index:g,geometry:p?y.geometry:M(h,o,l),patterns:{}};a.push(w)}for(const h of a){const{geometry:m,index:g,sourceLayerIndex:v}=h;this.addFeature(h,m,g,o,{},i.availableImages,i.brightness),i.featureIndex.insert(e[g].feature,m,g,v,this.index)}}isEmpty(){return this.footprints.length===0}uploadPending(){return!1}upload(e){}update(e,i,o,l,a,h,m){}destroy(){}addFeature(e,i,o,l,a,h=[],m){for(const g of hu(i,2)){const v=[],p=[],y=[],w=new Qe(1/0,1/0),x=new Qe(-1/0,-1/0);for(const I of g)if(I.length!==0){I!==g[0]&&y.push(p.length/2);for(let P=0;P{h.push(new Qe(y,g+(y-m)/(v-m)*(p-g)))}:(h,m,g,v,p,y)=>{h.push(new Qe(m+(y-g)/(p-g)*(v-m),y))};for(const h of n){const m=[];for(const g of h){if(g.length<=2)continue;const v=[];for(let w=0;we&&a(v,x,b,S,I,e):P>i?O=e&&a(v,x,b,S,I,e),O>i&&P<=i&&a(v,x,b,S,I,i)}let p=g[g.length-1];const y=o===0?p.x:p.y;y>=e&&y<=i&&v.push(p),v.length&&(p=v[v.length-1],v[0].x===p.x&&v[0].y===p.y||v.push(v[0]),m.push(v))}m.length&&l.push(m)}return l}function Cp(n,e,i,o){const l=i==="x"?"y":"x",a=(o-n[i])/(e[i]-n[i]);n[l]=n[l]+(e[l]-n[l])*a,n[i]=o,n.hasOwnProperty("z")&&(n.z=St(n.z,e.z,a)),n.hasOwnProperty("w")&&(n.w=St(n.w,e.w,a))}function zp(n,e,i,o){const l=i,a=o;for(const h of["x","y"]){let m=n,g=e;m[h]>=g[h]&&(m=e,g=n),m[h]l&&Cp(m,g,h,l),m[h]a&&Cp(g,m,h,a)}}const fu=Number.MAX_SAFE_INTEGER;function Rp(n,e,i,o){return n.orderh===l)===void 0}(o,n.clipScope)}function mu(n,e){return n.x-e.x||n.y-e.y}function Dp(n,e){return mu(n.min,e.min)===0&&mu(n.max,e.max)===0}function g4(n,e){return!(n.min.x>e.max.x||n.max.xe.max.y||n.max.ynew Qe((g.x+a.x*Je)*m-h.x*Je,(g.y+a.y*Je)*m-h.y*Je))}return Op(i,l,n.indices,0,n.indices.length,0,0)}function Fp(n,e,i,o){const l=Math.pow(2,o.z-i.z);return new Qe((n+i.x*Je)*l-o.x*Je,(e+i.y*Je)*l-o.y*Je)}function Bp(n,e){const i=[];e.grid.queryPoint(n,i);const o=e.indices,l=e.vertices;for(let a=0;a0&&(o.length>1&&i.push(o),o=[])}return o.length>1&&i.push(o),i}const v4=ba.VectorTileFeature.types,q5=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius","fill-extrusion-line-width","fill-extrusion-emissive-strength"],$5=["fill-extrusion-flood-light-ground-radius"],H5=Math.pow(2,13),Z5=Math.pow(2,15)-1,Vp=new Qe(0,1),wa=2147483648;function S1(n,e,i,o,l,a,h,m){n.emplaceBack((e<<1)+h,(i<<1)+a,(Math.floor(o*H5)<<1)+l,Math.round(m))}function E1(n,e,i){n.emplaceBack(e.x*Je,e.y*Je,i?1:0)}function _u(n,e,i,o,l,a){n.emplaceBack(e.x,e.y,(i.x<<1)+o,(i.y<<1)+l,a)}function M1(n,e,i){n.emplaceBack(e.x,e.y,e.z,i[0]*16384,i[1]*16384,i[2]*16384)}class Up{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class jp{constructor(){this.centroidXY=new Qe(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new Qe(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new Qe(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0}span(){return new Qe(this.max.x-this.min.x,this.max.y-this.min.y)}}class Gp{constructor(){this.acc=new Qe(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(e,i){e.min.x===Number.MAX_VALUE&&(e.min.x=e.max.x=i.x,e.min.y=e.max.y=i.y)}appendEdge(e,i,o){this.accCount++,this.acc._add(i);let l=!!this.borders;i.xe.max.x&&(e.max.x=i.x,l=!0),i.ye.max.y&&(e.max.y=i.y,l=!0),((i.x===0||i.x===Je)&&i.x===o.x)!=((i.y===0||i.y===Je)&&i.y===o.y)&&this.processBorderOverlap(i,o),l&&this.checkBorderIntersection(i,o)}checkBorderIntersection(e,i){i.x<0!=e.x<0&&this.addBorderIntersection(0,St(i.y,e.y,(0-i.x)/(e.x-i.x))),i.x>Je!=e.x>Je&&this.addBorderIntersection(1,St(i.y,e.y,(Je-i.x)/(e.x-i.x))),i.y<0!=e.y<0&&this.addBorderIntersection(2,St(i.x,e.x,(0-i.y)/(e.y-i.y))),i.y>Je!=e.y>Je&&this.addBorderIntersection(3,St(i.x,e.x,(Je-i.y)/(e.y-i.y)))}addBorderIntersection(e,i){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const o=this.borders[e];io[1]&&(o[1]=i)}processBorderOverlap(e,i){if(e.x===i.x){if(e.y===i.y)return;const o=e.x===0?0:1;this.addBorderIntersection(o,i.y),this.addBorderIntersection(o,e.y)}else{const o=e.y===0?2:3;this.addBorderIntersection(o,i.x),this.addBorderIntersection(o,e.x)}}centroid(){return this.accCount===0?new Qe(0,0):new Qe(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce((e,i)=>e+ +(i[0]!==Number.MAX_VALUE),0):0}}function qp(n,e){const i=n.add(e)._unit(),o=$t(n.x*i.x+n.y*i.y,-1,1);var l,a,h;return h=Math.acos(o),Math.min(4,Math.max(-4,Math.tan(h)))/4*Z5*((l=n).x*(a=e).y-l.y*a.x<0?-1:1)}const W5=[n=>n.x<0,n=>n.x>Je,n=>n.y<0,n=>n.y>Je];function X5(n,e,i,o){const l=[4];if(o===0)return l;i._mult(o);const a=n.sub(i),h=e.sub(i),m=[n,e,a,h];for(let g=0;g<4;g++)for(const v of m)if(W5[g](v)){l.push(g);break}return l}class $p{constructor(e){this.vertexArray=new wn,this.indexArray=new _r,this.programConfigurations=new Wo(e.layers,{zoom:e.zoom,lut:e.lut},i=>$5.includes(i)),this._segments=new ki,this.hiddenByLandmarkVertexArray=new l1,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new ki}getDefaultSegment(){return this.regionSegments[4]}hasData(){return this.vertexArray.length!==0}addData(e,i,o,l=!1){const a=e.length;if(a>2){let h=Math.max(0,this._segments.get().length-1);const m=this._segments._prepareSegment(4*a,this.vertexArray.length,2*this._segmentToGroundQuads[h].length);let g;h!==this._segments.get().length-1&&(h++,this._segmentToGroundQuads[h]=[],this._segmentToRegionTriCounts[h]=[0,0,0,0,0]);{const v=e[0],p=e[1];g=qp(v.sub(e[a-1])._perp()._unit(),p.sub(v)._perp()._unit())}for(let v=0;vl.region-a.region);for(let o=0;og+v,0);let m=0;for(let g=0;g<=4;g++){const v=h[g];if(v!==0){let p=this.regionSegments[g];p||(p=this.regionSegments[g]=new ki);const y={vertexOffset:a.vertexOffset,primitiveOffset:a.primitiveOffset+m,vertexLength:a.vertexLength,primitiveLength:v};p.get().push(y)}m+=v}for(let g=0;g0?this.hiddenByLandmarkVertexBuffer=e.createVertexBuffer(this.hiddenByLandmarkVertexArray,V5.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let e=0;e<=4;e++){const i=this.regionSegments[e];i&&i.destroy()}}}}class gu{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.pixelRatio=e.pixelRatio,this.layerIds=this.layers.map(i=>i.fqid),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=[],this.footprintIndices=new _r,this.footprintVertices=new fo,this.footprintSegments=[],this.layoutVertexArray=new mo,this.centroidVertexArray=new m0,this.wallVertexArray=new eu,this.indexArray=new _r,this.programConfigurations=new Wo(e.layers,{zoom:e.zoom,lut:e.lut},i=>q5.includes(i)),this.segments=new ki,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.groundEffect=new $p(e),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[]}updateFootprints(e,i){}populate(e,i,o,l){this.features=[],this.hasPattern=l4("fill-extrusion",this.layers,this.pixelRatio,i),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.selfDEMTileTimestamp=Number.MAX_VALUE,this.borderDEMTileTimestamp=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],this.tileToMeter=u(o),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter,this.wallMode=this.layers[0].paint.get("fill-extrusion-line-width").constantOr(1)!==0;for(const{feature:a,id:h,index:m,sourceLayerIndex:g}of e){const v=this.layers[0]._featureFilter.needGeometry,p=A(a,v);if(!this.layers[0]._featureFilter.filter(new Ai(this.zoom),p,o))continue;const y={id:h,sourceLayerIndex:g,index:m,geometry:v?p.geometry:M(a,o,l),properties:a.properties,type:a.type,patterns:{}},w=this.layoutVertexArray.length,x=v4[y.type]==="Polygon";if(this.hasPattern)this.features.push(c4("fill-extrusion",this.layers,y,this.zoom,this.pixelRatio,i));else if(this.wallMode)for(const b of y.geometry)for(const S of Np(b,x))this.addFeature(y,[S],m,o,{},i.availableImages,l,i.brightness);else this.addFeature(y,y.geometry,m,o,{},i.availableImages,l,i.brightness);i.featureIndex.insert(a,y.geometry,m,g,this.index,w)}this.sortBorders(),this.projection.name==="mercator"&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(e,i,o,l,a,h){for(const m of this.features){const g=v4[m.type]==="Polygon",{geometry:v}=m;if(this.wallMode)for(const p of v)for(const y of Np(p,g))this.addFeature(m,[y],m.index,i,o,l,a,h);else this.addFeature(m,v,m.index,i,o,l,a,h)}this.sortBorders(),this.projection.name==="mercator"&&this.splitToSubtiles()}update(e,i,o,l,a,h,m){this.programConfigurations.updatePaintArrays(e,i,a,o,l,h,m),this.groundEffect.update(e,i,a,o,l,h,m)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,j5),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.wallVertexBuffer=e.createVertexBuffer(this.wallVertexArray,N5.members),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,U5.members,!0)),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){this.groundEffect.uploadHiddenByLandmark(e),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,B5.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,i,o,l,a,h,m,g){const v=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(e,{})/this.tileToMeter,p=[new Qe(0,0),new Qe(Je,Je)],y=m.projection,w=y.name==="globe",x=this.wallMode||v4[e.type]==="Polygon",b=new Gp;b.centroidDataIndex=this.centroidData.length;const S=new jp,I=this.layers[0].paint.get("fill-extrusion-base").evaluate(e,{},l)<=0,P=this.layers[0].paint.get("fill-extrusion-height").evaluate(e,{},l);let O;if(S.height=P,S.vertexArrayOffset=this.layoutVertexArray.length,S.groundVertexArrayOffset=this.groundEffect.vertexArray.length,w&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new bl),this.wallMode){if(w)return void ji("Non zero fill-extrusion-line-width is not yet supported on globe.");if(i.length!==1)return;O=function(Y){const le=Y[0].x===Y[Y.length-1].x&&Y[0].y===Y[Y.length-1].y;(function(Ke){let He=0;const wt=Ke.length;for(let rt=0;rt=0})(Y)||(Y=Y.reverse());const ce={geometry:[],joinNormals:[],indices:[]},me=[],pe=[],xe=[];let ye=Y.length;for(;ye>=2&&Y[ye-1].equals(Y[ye-2]);)ye--;if(ye<(le?3:2))return ce;let Ee,we,Ae,$e,Ge,lt=0;for(;lt0;let Mt="miter";const jt=2;Mt==="miter"&&rt>jt&&(Mt="bevel"),Mt==="bevel"&&(rt>100&&(Mt="flipbevel"),rt{const Ii=new Qe(Wt.x,Wt.y),It=new Qe(Wt.x,Wt.y);Ii.x+=Vt.x*ci,Ii.y+=Vt.y*ci,It.x-=Vt.x*Math.max(Yt,1),It.y-=Vt.y*Math.max(Yt,1),xe.push(Vt),me.push(Ii),pe.push(It)};if(Mt==="miter")He._mult(rt),Ct(Ee,He,0,0);else if(Mt==="flipbevel")He=Ge.mult(-1),Ct(Ee,He,0,0),Ct(Ee,He.mult(-1),0,0);else{const Wt=-Math.sqrt(rt*rt-1),Vt=pt?Wt:0,Yt=pt?0:Wt;we&&Ct(Ee,$e,Vt,Yt),Ae&&Ct(Ee,Ge,Vt,Yt)}}ce.geometry=[...me,...pe.reverse(),me[0]],ce.joinNormals=[...xe,...xe.reverse(),xe[xe.length-1]];const Ze=ce.geometry.length-1;for(let Ke=0;KeY<(le.length-1)/2||Y===le.length-1,D=this.wallMode?[i]:hu(i,500);for(let Y=D.length-1;Y>=0;Y--){const le=D[Y];(le.length===0||(F=le[0]).every(ee=>ee.x<=0)||F.every(ee=>ee.x>=Je)||F.every(ee=>ee.y<=0)||F.every(ee=>ee.y>=Je))&&D.splice(Y,1)}var F;let V;if(w)V=Jp(D,p,l);else{V=[];for(const Y of D)V.push({polygon:Y,bounds:p})}const q=x?this.edgeRadius:0,J=q>0&&this.zoom<17,X=(Y,le)=>{if(Y.length===0)return!1;const ee=Y[Y.length-1];return le.x===ee.x&&le.y===ee.y};for(const{polygon:Y,bounds:le}of V){let ee=0,ce=0;for(const ye of Y)x&&!ye[0].equals(ye[ye.length-1])&&ye.push(ye[0]),ce+=x?ye.length-1:ye.length;const me=this.segments.prepareSegment((x?5:4)*ce,this.layoutVertexArray,this.indexArray);S.footprintSegIdx<0&&(S.footprintSegIdx=this.footprintSegments.length),S.polygonSegIdx<0&&(S.polygonSegIdx=this.polygonSegments.length);const pe={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},xe=new Up;if(xe.vertexOffset=this.footprintVertices.length,xe.indexOffset=3*this.footprintIndices.length,xe.ringIndices=[],x){const ye=[],Ee=[];ee=me.vertexLength;for(let Ae=0;Ae4&&Xp(Ee[Ee.length-2],Ee[0],Ee[1]),Ae=q?Y5(Ee[Ee.length-2],Ee[0],Ee[1],q):0;const $e=[];let Ge,lt,Ze;lt=Ee[1].sub(Ee[0])._perp()._unit();let Ke=!0;for(let He=1,wt=0;He0?1:0,Vt=rt.dist(pt);if(wt+Vt>32768&&(wt=0),q){Ze=Mt.sub(pt)._perp()._unit();let It=Zp(rt,pt,Mt,Hp(lt,Ze),q);isNaN(It)&&(It=0);const ii=pt.sub(rt)._unit();rt=rt.add(ii.mult(Ae))._round(),pt=pt.add(ii.mult(-It))._round(),Ae=It,lt=Ze,I&&this.zoom>=17&&(X($e,rt)||$e.push(rt),X($e,pt)||$e.push(pt))}const Yt=me.vertexLength,ci=Ee.length>4&&Xp(rt,pt,Mt);let Ii=Yp(wt,we,Ke);if(S1(this.layoutVertexArray,rt.x,rt.y,Ct,Wt,0,0,Ii),S1(this.layoutVertexArray,rt.x,rt.y,Ct,Wt,0,1,Ii),this.wallMode){const It=L(He-1,Ee),ii=O.joinNormals[He-1];E1(this.wallVertexArray,ii,It),E1(this.wallVertexArray,ii,It)}if(wt+=Vt,Ii=Yp(wt,ci,!Ke),we=ci,S1(this.layoutVertexArray,pt.x,pt.y,Ct,Wt,0,0,Ii),S1(this.layoutVertexArray,pt.x,pt.y,Ct,Wt,0,1,Ii),this.wallMode){const It=L(He,Ee),ii=O.joinNormals[He];E1(this.wallVertexArray,ii,It),E1(this.wallVertexArray,ii,It)}if(me.vertexLength+=4,this.indexArray.emplaceBack(Yt+0,Yt+1,Yt+2),this.indexArray.emplaceBack(Yt+1,Yt+3,Yt+2),me.primitiveLength+=2,q){const It=ee+(He===1?Ee.length-2:He-2),ii=He===1?ee:It+1;if(this.indexArray.emplaceBack(Yt+1,It,Yt+3),this.indexArray.emplaceBack(It,ii,Yt+3),me.primitiveLength+=2,Ge===void 0&&(Ge=Yt),!b4(Mt,Ee[He],le)){const Li=He===Ee.length-1?Ge:me.vertexLength;this.indexArray.emplaceBack(Yt+2,Yt+3,Li),this.indexArray.emplaceBack(Yt+3,Li+1,Li),this.indexArray.emplaceBack(Yt+3,ii,Li+1),me.primitiveLength+=3}Ke=!Ke}if(w){const It=this.layoutVertexExtArray,ii=y.projectTilePoint(rt.x,rt.y,l),Li=y.projectTilePoint(pt.x,pt.y,l),Ni=y.upVector(l,rt.x,rt.y),qi=y.upVector(l,pt.x,pt.y);M1(It,ii,Ni),M1(It,ii,Ni),M1(It,Li,qi),M1(It,Li,qi)}}x&&(ee+=Ee.length-1),I&&q&&this.zoom>=17&&($e.length!==0&&X($e,$e[0])&&$e.pop(),this.groundEffect.addData($e,le,v,q>0))}this.footprintSegments.push(xe),pe.triangleCount=this.indexArray.length-pe.triangleArrayOffset,this.polygonSegments.push(pe),++S.footprintSegLen,++S.polygonSegLen}if(S.vertexCount=this.layoutVertexArray.length-S.vertexArrayOffset,S.groundVertexCount=this.groundEffect.vertexArray.length-S.groundVertexArrayOffset,S.vertexCount!==0){if(S.centroidXY=b.borders?Vp:this.encodeCentroid(b,S),this.centroidData.push(S),b.borders){this.featuresOnBorder.push(b);const Y=this.featuresOnBorder.length-1;for(let le=0;lethis.featuresOnBorder[i].borders[e][0]-this.featuresOnBorder[o].borders[e][0])}splitToSubtiles(){const e=[];for(let m=0;mJe),p=2*v+(+(g.min.x+g.max.x>Je)^v);for(let y=0;ym.triangleSegmentIdx===g.triangleSegmentIdx?m.subtile-g.subtile:m.triangleSegmentIdx-g.triangleSegmentIdx);let o=0,l=0,a=0;for(const m of e){if(m.triangleSegmentIdx!==o)break;a++}const h=e.length;for(;l!==e.length;){o=e[l].triangleSegmentIdx;let m=0,g=l,v=l;for(let p=g;p0&&this.triangleSubSegments.push({segment:x,min:y,max:w}),g=v;for(let b=g;b[S[0]*(1-P[0])+I[0]*P[0],S[1]*(1-P[1])+I[1]*P[1]],x=[],b=[];for(const S of this.triangleSubSegments){x[0]=S.min.x/Je,x[1]=S.min.y/Je,b[0]=S.max.x/Je,b[1]=S.max.y/Je;const I=w(p,y,x),P=w(p,y,b);if(new mt([I[0],I[1],a],[P[0],P[1],h]).intersectsPrecise(o)===0){v&&(l.segments.push(v),v=void 0);continue}const O=S.segment;v&&v.vertexOffset!==O.vertexOffset&&(l.segments.push(v),v=void 0),v?(v.vertexLength+=O.vertexLength,v.primitiveLength+=O.primitiveLength):v={vertexOffset:O.vertexOffset,primitiveLength:O.primitiveLength,vertexLength:O.vertexLength,primitiveOffset:O.primitiveOffset,sortKey:void 0,vaos:{}}}return v&&l.segments.push(v),l}encodeCentroid(e,i){const o=e.centroid(),l=i.span(),a=Math.min(7,Math.round(l.x*this.tileToMeter/10)),h=Math.min(7,Math.round(l.y*this.tileToMeter/10));return new Qe($t(o.x,1,Je-1)<<3|a,$t(o.y,1,Je-1)<<3|h)}encodeBorderCentroid(e){if(!e.borders)return new Qe(0,0);const i=e.borders,o=Number.MAX_VALUE;if(i[0][0]!==o||i[1][0]!==o){const l=i[0][0]!==o?0:1;return new Qe(6|(i[0][0]!==o?0:65528),(i[l][0]+i[l][1])/2<<3|6)}{const l=i[2][0]!==o?2:3;return new Qe((i[l][0]+i[l][1])/2<<3|6,6|(i[2][0]!==o?0:65528))}}showCentroid(e){const i=this.centroidData[e.centroidDataIndex];i.flags&=wa,i.centroidXY.x=0,i.centroidXY.y=0,this.writeCentroidToBuffer(i)}writeCentroidToBuffer(e){this.groundEffect.updateHiddenByLandmark(e);const i=e.vertexArrayOffset,o=e.vertexCount+e.vertexArrayOffset,l=e.flags&wa?Vp:e.centroidXY,a=this.centroidVertexArray.geta_centroid_pos0(i);if(this.centroidVertexArray.geta_centroid_pos1(i)!==l.y||a!==l.x){for(let h=i;hg.max.x||g.min.x>h.max.x||h.min.y>g.max.y||g.min.y>h.max.y))for(let v=0;vi!=x>i&&e<(this.footprintVertices.int16[2*(p+h.vertexOffset)+0]-y)*(i-w)/(x-w)+y&&(l=!l)}m=g}}return l}getHeightAtTileCoord(e,i){let o=Number.NEGATIVE_INFINITY,l=!0;const a=4*(e+Je)*Je+(i+Je);if(this.partLookup.hasOwnProperty(a)){const h=this.partLookup[a];return h?{height:h.height,hidden:!!(h.flags&wa)}:void 0}for(const h of this.centroidData)e>h.max.x||h.min.x>e||i>h.max.y||h.min.y>i||this.footprintContainsPoint(e,i,h)&&h&&h.height>o&&(o=h.height,this.partLookup[a]=h,l=!!(h.flags&wa));if(o!==Number.NEGATIVE_INFINITY)return{height:o,hidden:l};this.partLookup[a]=void 0}}function Hp(n,e){const i=n.add(e)._unit();return n.x*i.x+n.y*i.y}function Y5(n,e,i,o){const l=e.sub(n)._perp()._unit(),a=i.sub(e)._perp()._unit();return Zp(n,e,i,Hp(l,a),o)}function Zp(n,e,i,o,l){const a=Math.sqrt(1-o*o);return Math.min(n.dist(e)/3,e.dist(i)/3,l*a/o)}function b4(n,e,i){return n.xi[1].x&&e.x>i[1].x||n.yi[1].y&&e.y>i[1].y}function Wp(n,e){return n.xe[1].x||n.ye[1].y}function Xp(n,e,i){if(n.x<0||n.x>=Je||e.x<0||e.x>=Je||i.x<0||i.x>=Je)return!1;const o=i.sub(e),l=o.perp(),a=n.sub(e);return(o.x*a.x+o.y*a.y)/Math.sqrt((o.x*o.x+o.y*o.y)*(a.x*a.x+a.y*a.y))>-.866&&l.x*a.x+l.y*a.y<0}function Yp(n,e,i){const o=e?2|n:-3&n;return i?1|o:-2&o}function Kp(){const n=Math.PI/32,e=Math.tan(n),i=bs;return i*Math.sqrt(1+2*e*e)-i}function Jp(n,e,i){const o=1<{for(const J of V)b.push({polygon:J,bounds:q})},I=Math.ceil(Math.log2(p)),P=Math.ceil(Math.log2(y)),O=I-P,L=[];for(let V=0;V0?0:1);for(let V=0;Vq+1?F.push({polygons:me,bounds:xe,depth:q+1}):S(me,xe)}if(pe.length){const xe=[new Qe(J===0?ce:X.x,J===1?ce:X.y),Y];L.length>q+1?F.push({polygons:pe,bounds:xe,depth:q+1}):S(pe,xe)}}return b}(n,e,Math.ceil((a-l)/11.25),Math.ceil((h-m)/11.25),1,(g,v,p)=>{if(g===0)return .5*(v+p);{const y=gr((i.y+v/Je)/o);return(wr(.5*(gr((i.y+p/Je)/o)+y))*o-i.y)*Je}})}function K5(n,e,i,o,l,a){const h=Math.pow(2,o.z-l.z);for(let m=0;m1&&(g=e[++m]);const p=Math.abs(v-g.left),y=Math.abs(v-g.right),w=Math.min(p,y);let x;const b=a/o*(l+1);if(g.isDash){const S=l-Math.abs(b);x=Math.sqrt(w*w+S*S)}else x=l-Math.sqrt(w*w+b*b);this.image.data[h+v]=Math.max(0,Math.min(255,x+128))}}}addRegularDash(e,i){for(let g=e.length-1;g>=0;--g){const v=e[g],p=e[g+1];v.zeroLength?e.splice(g,1):p&&p.isDash===v.isDash&&(p.left=v.left,e.splice(g,1))}const o=e[0],l=e[e.length-1];o.isDash===l.isDash&&(o.left=l.left-this.width,l.right=o.right+this.width);const a=this.width*this.nextRow;let h=0,m=e[h];for(let g=0;g1&&(m=e[++h]);const v=Math.abs(g-m.left),p=Math.abs(g-m.right),y=Math.min(v,p);this.image.data[a+g]=Math.max(0,Math.min(255,(m.isDash?y:-y)+i+128))}}addDash(e,i){const o=this.getKey(e,i);if(this.positions[o])return this.positions[o];const l=i==="round",a=l?7:0,h=2*a+1;if(this.nextRow+h>this.height)return ji("LineAtlas out of space"),null;e.length===0&&e.push(1);let m=0;for(let p=0;pi.fqid),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.hasZOffset=!1,this.hasCrossSlope=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new Q3,this.layoutVertexArray2=new Ln,this.patternVertexArray=new Ln,this.indexArray=new _r,this.programConfigurations=new Wo(e.layers,{zoom:e.zoom,lut:e.lut}),this.segments=new ki,this.maxLineLength=0,this.zOffsetVertexArray=new Ln,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.tessellationStep=e.tessellationStep?e.tessellationStep:Je/64}updateFootprints(e,i){}populate(e,i,o,l){this.hasPattern=l4("line",this.layers,this.pixelRatio,i);const a=this.layers[0].layout.get("line-sort-key");this.tileToMeter=u(o);const h=this.layers[0].layout.get("line-z-offset"),m=h.isConstant()&&!h.constantOr(0),g=this.layers[0].layout.get("line-elevation-reference");this.hasZOffset=g==="sea"||g==="ground"||!m&&g==="none",this.hasZOffset&&g==="none"&&ji(`line-elevation-reference: ground is used for the layer ${this.layerIds[0]} because non-zero line-z-offset value was found.`);const v=this.layers[0].layout.get("line-cross-slope");this.hasCrossSlope=this.hasZOffset&&v!==void 0;const p=[];for(const{feature:b,id:S,index:I,sourceLayerIndex:P}of e){const O=this.layers[0]._featureFilter.needGeometry,L=A(b,O);if(!this.layers[0]._featureFilter.filter(new Ai(this.zoom),L,o))continue;const D=a?a.evaluate(L,{},o):void 0,F={id:S,properties:b.properties,type:b.type,sourceLayerIndex:P,index:I,geometry:O?L.geometry:M(b,o,l),patterns:{},sortKey:D};p.push(F)}a&&p.sort((b,S)=>b.sortKey-S.sortKey);const{lineAtlas:y,featureIndex:w}=i,x=this.addConstantDashes(y);for(const b of p){const{geometry:S,index:I,sourceLayerIndex:P}=b;if(x&&this.addFeatureDashes(b,y),this.hasPattern){const O=c4("line",this.layers,b,this.zoom,this.pixelRatio,i);this.patternFeatures.push(O)}else this.addFeature(b,S,I,o,y.positions,i.availableImages,i.brightness);w.insert(e[I].feature,S,I,P,this.index)}}addConstantDashes(e){let i=!1;for(const o of this.layers){const l=o.paint.get("line-dasharray").value,a=o.layout.get("line-cap").value;if(l.kind!=="constant"||a.kind!=="constant")i=!0;else{const h=a.value,m=l.value;if(!m)continue;e.addDash(m,h)}}return i}addFeatureDashes(e,i){const o=this.zoom;for(const l of this.layers){const a=l.paint.get("line-dasharray").value,h=l.layout.get("line-cap").value;if(a.kind==="constant"&&h.kind==="constant")continue;let m,g;if(a.kind==="constant"){if(m=a.value,!m)continue}else m=a.evaluate({zoom:o},e);g=h.kind==="constant"?h.value:h.evaluate({zoom:o},e),i.addDash(m,g),e.patterns[l.id]=i.getKey(m,g)}}update(e,i,o,l,a,h,m){this.programConfigurations.updatePaintArrays(e,i,a,o,l,h,m)}addFeatures(e,i,o,l,a,h){for(const m of this.patternFeatures)this.addFeature(m,m.geometry,m.index,i,o,l,h)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,im)),this.patternVertexArray.length!==0&&(this.patternVertexBuffer=e.createVertexBuffer(this.patternVertexArray,nm)),!this.zOffsetVertexBuffer&&this.zOffsetVertexArray.length>0&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,Q5.members,!0)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,em),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,i,o,l,a,h,m){const g=this.layers[0].layout,v=g.get("line-join").evaluate(e,{}),p=g.get("line-cap").evaluate(e,{}),y=g.get("line-miter-limit"),w=g.get("line-round-limit");this.lineClips=this.lineFeatureClips(e),this.lineFeature=e,this.zOffsetValue=g.get("line-z-offset").value;const x=this.layers[0].paint.get("line-width").value;x.kind!=="constant"&&x.isLineProgressConstant===!1&&(this.variableWidthValue=x);for(const b of i)this.addLine(b,e,l,v,p,y,w);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,a,h,l,m)}addLine(e,i,o,l,a,h,m){this.distance=0,this.prevDistance=0,this.scaledDistance=0,this.totalDistance=0,this.totalFeatureLength=0,this.lineSoFar=0,this.currentVertex=void 0;const g=l==="none";if(this.patternJoinNone=this.hasPattern&&g,this.segmentStart=0,this.segmentStartf32=0,this.segmentPoints=[],this.lineClips){this.lineClipsArray.push(this.lineClips);for(let L=0;L=2&&e[p-1].equals(e[p-2]);)p--;let y=0;for(;y0,ce=this.overscaling<=16?15*Je/(512*this.overscaling):0;if(D&&F==="round"){if(Xh&&(F="bevel"),F==="bevel"&&(X>2&&(F="flipbevel"),X2*ce){const xe=x.sub(x.sub(b)._mult(ce/me)._round());this.updateDistance(b,xe),this.addCurrentVertex(xe,I,0,0,w,O),b=xe}this.updateDistance(b,x),q._mult(X),this.addCurrentVertex(x,q,0,0,w,O);const pe=x.dist(S);if(pe>2*ce){const xe=x.add(S.sub(x)._mult(ce/pe)._round());this.updateDistance(x,xe),this.addCurrentVertex(xe,P,0,0,w,O),x=xe}}else q._mult(X),this.addCurrentVertex(x,q,0,0,w,O);else if(F==="flipbevel"){if(X>100)q=P.mult(-1);else{const me=X*I.add(P).mag()/I.sub(P).mag();q._perp()._mult(me*(ee?-1:1))}this.addCurrentVertex(x,q,0,0,w,O),this.addCurrentVertex(x,q.mult(-1),0,0,w,O)}else if(F==="bevel"||F==="fakeround"){O!=null&&b&&this.addCurrentVertex(x,I,-1,-1,w,O);const me=x.dist(b)<=2*ce&&F!=="bevel",pe=q.mult(ee?1:-1);pe._mult(X);const xe=P.mult(ee?-1:1),ye=I.mult(ee?-1:1),Ee=this.evaluateLineProgressFeatures(this.distance);if(O==null&&(this.addHalfVertex(x,pe.x,pe.y,!1,!ee,0,w,Ee),me||this.addHalfVertex(x,pe.x+2*ye.x,pe.y+2*ye.y,!1,ee,0,w,Ee)),F==="fakeround"){const we=Math.round(180*Y/Math.PI/20);this.addHalfVertex(x,ye.x,ye.y,!1,ee,0,w,Ee);for(let Ae=0;Ae1){this.lineSoFar=e.w;const S=(i.x-e.x)/y,I=(i.y-e.y)/y,P=(i.z-e.z)/y,O=(i.w-e.w)/y;for(let L=1;L=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,p),g.primitiveLength++),h?this.e2=p:this.e1=p,v!=null&&this.zOffsetVertexArray.emplaceBack(v.zOffset,v.variableWidth,v.variableWidth)}updateScaledDistance(){this.lineClips?(this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=this.totalFeatureLength*this.lineClips.start+this.distance):this.lineSoFar=this.distance}updateDistance(e,i){this.prevDistance=this.distance,this.distance+=e.dist(i),this.updateScaledDistance()}}function T4(n,e,i){return n.xi||n.yi}let n8,o8;function s8(n,e,i){return e*(Je/(n.tileSize*Math.pow(2,i-n.tileID.overscaledZ)))}at(w4,"LineBucket",{omit:["layers","patternFeatures","currentVertex","currentVertexIsOutside"]});const a8=(n,e,i)=>(1-i)*n+i*e;function l8(n,e){return 1/s8(n,1,e.tileZoom)}function c8(n,e,i,o){return n.translatePosMatrix(o||e.tileID.projMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}const u8=n=>{const e=[];h8(n)&&e.push("RENDER_LINE_DASH"),n.paint.get("line-gradient")&&e.push("RENDER_LINE_GRADIENT");const i=n.paint.get("line-trim-offset");i[0]===0&&i[1]===0||e.push("RENDER_LINE_TRIM_OFFSET"),n.paint.get("line-border-width").constantOr(1)!==0&&e.push("RENDER_LINE_BORDER");const o=n.layout.get("line-join").constantOr("miter")==="none",l=!!n.paint.get("line-pattern").constantOr(1);return o&&l&&e.push("LINE_JOIN_NONE"),e};function h8(n){const e=n.paint.get("line-dasharray").value;return e.value||e.kind!=="constant"}let S4;const d8=()=>S4||(S4={layout:n8||(n8=new Gi({"line-cap":new st(Ie.layout_line["line-cap"]),"line-join":new st(Ie.layout_line["line-join"]),"line-miter-limit":new Ye(Ie.layout_line["line-miter-limit"]),"line-round-limit":new Ye(Ie.layout_line["line-round-limit"]),"line-sort-key":new st(Ie.layout_line["line-sort-key"]),"line-z-offset":new st(Ie.layout_line["line-z-offset"]),"line-elevation-reference":new Ye(Ie.layout_line["line-elevation-reference"]),"line-cross-slope":new Ye(Ie.layout_line["line-cross-slope"]),visibility:new Ye(Ie.layout_line.visibility),"line-width-unit":new Ye(Ie.layout_line["line-width-unit"])})),paint:o8||(o8=new Gi({"line-opacity":new st(Ie.paint_line["line-opacity"]),"line-color":new st(Ie.paint_line["line-color"]),"line-translate":new Ye(Ie.paint_line["line-translate"]),"line-translate-anchor":new Ye(Ie.paint_line["line-translate-anchor"]),"line-width":new st(Ie.paint_line["line-width"]),"line-gap-width":new st(Ie.paint_line["line-gap-width"]),"line-offset":new st(Ie.paint_line["line-offset"]),"line-blur":new st(Ie.paint_line["line-blur"]),"line-dasharray":new st(Ie.paint_line["line-dasharray"]),"line-pattern":new st(Ie.paint_line["line-pattern"]),"line-gradient":new ua(Ie.paint_line["line-gradient"]),"line-trim-offset":new Ye(Ie.paint_line["line-trim-offset"]),"line-trim-fade-range":new Ye(Ie.paint_line["line-trim-fade-range"]),"line-trim-color":new Ye(Ie.paint_line["line-trim-color"]),"line-emissive-strength":new Ye(Ie.paint_line["line-emissive-strength"]),"line-border-width":new st(Ie.paint_line["line-border-width"]),"line-border-color":new st(Ie.paint_line["line-border-color"]),"line-occlusion-opacity":new Ye(Ie.paint_line["line-occlusion-opacity"]),"line-color-use-theme":new st({type:"string",default:"default","property-type":"data-driven"}),"line-gradient-use-theme":new st({type:"string",default:"default","property-type":"data-driven"}),"line-trim-color-use-theme":new st({type:"string",default:"default","property-type":"data-driven"}),"line-border-color-use-theme":new st({type:"string",default:"default","property-type":"data-driven"})}))},S4);class lm extends st{possiblyEvaluate(e,i){return i=new Ai(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,transition:i.transition}),super.possiblyEvaluate(e,i)}evaluate(e,i,o,l){return i=Lr({},i,{zoom:Math.floor(i.zoom)}),super.evaluate(e,i,o,l)}}let I1;function p8(n,e){return e>0?e+2*n:n}const cm=hi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),um=hi([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),hm=hi([{name:"a_projected_pos",components:4,type:"Float32"}],4);hi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const dm=hi([{name:"a_auto_z_offset",components:1,type:"Float32"}],4),pm=hi([{name:"a_texb",components:2,type:"Uint16"}]),fm=hi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_elevation_from_sea",components:2,type:"Float32"}]),mm=hi([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_auto_z_offset",components:1,type:"Float32"}]);hi([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const f8=hi([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),_m=hi([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);hi([{name:"triangle",components:3,type:"Uint16"}]),hi([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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"},{type:"Uint8",name:"flipState"}]),hi([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"},{type:"Uint16",name:"elevationFeatureIndex"}]),hi([{type:"Float32",name:"offsetX"}]),hi([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Er=24;const vo=128;function m8(n,e,i,o,l){if(n.kind==="camera")return n.maxSize;if(n.kind==="composite"){const a=e.possiblyEvaluate(new Ai(n.maxZoom),i).evaluate(l,{},i),h=e.possiblyEvaluate(new Ai(n.minZoom),i).evaluate(l,{},i);return Math.max(a,h)}return e.possiblyEvaluate(new Ai(o)).evaluate(l,{},i)}function E4(n,e){const{expression:i}=e;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new Ai(n+1))};if(i.kind==="source")return{kind:"source"};{const{zoomStops:o,interpolationType:l}=i;let a=0;for(;a{o.text=function(l,a,h){const m=a.layout.get("text-transform").evaluate(h,{});return m==="uppercase"?l=l.toLocaleUpperCase():m==="lowercase"&&(l=l.toLocaleLowerCase()),bn.applyArabicShaping&&(l=bn.applyArabicShaping(l)),l}(o.text,e,i)}),n}const P1={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function xm(n){return n==="︶"||n==="﹈"||n==="︸"||n==="﹄"||n==="﹂"||n==="︾"||n==="︼"||n==="︺"||n==="︘"||n==="﹀"||n==="︐"||n==="︓"||n==="︔"||n==="`"||n===" ̄"||n==="︑"||n==="︒"}function vm(n){return n==="︵"||n==="﹇"||n==="︷"||n==="﹃"||n==="﹁"||n==="︽"||n==="︻"||n==="︹"||n==="︗"||n==="︿"}var _8,M4,g8,A4={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */function bm(){return _8||(_8=1,A4.read=function(n,e,i,o,l){var a,h,m=8*l-o-1,g=(1<>1,p=-7,y=i?l-1:0,w=i?-1:1,x=n[e+y];for(y+=w,a=x&(1<<-p)-1,x>>=-p,p+=m;p>0;a=256*a+n[e+y],y+=w,p-=8);for(h=a&(1<<-p)-1,a>>=-p,p+=o;p>0;h=256*h+n[e+y],y+=w,p-=8);if(a===0)a=1-v;else{if(a===g)return h?NaN:1/0*(x?-1:1);h+=Math.pow(2,o),a-=v}return(x?-1:1)*h*Math.pow(2,a-o)},A4.write=function(n,e,i,o,l,a){var h,m,g,v=8*a-l-1,p=(1<>1,w=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=o?0:a-1,b=o?1:-1,S=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(m=isNaN(e)?1:0,h=p):(h=Math.floor(Math.log(e)/Math.LN2),e*(g=Math.pow(2,-h))<1&&(h--,g*=2),(e+=h+y>=1?w/g:w*Math.pow(2,1-y))*g>=2&&(h++,g/=2),h+y>=p?(m=0,h=p):h+y>=1?(m=(e*g-1)*Math.pow(2,l),h+=y):(m=e*Math.pow(2,y-1)*Math.pow(2,l),h=0));l>=8;n[i+x]=255&m,x+=b,m/=256,l-=8);for(h=h<0;n[i+x]=255&h,x+=b,h/=256,v-=8);n[i+x-b]|=128*S}),A4}function y8(){if(g8)return M4;g8=1,M4=e;var n=bm();function e(D){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(D)?D:new Uint8Array(D||0),this.pos=0,this.type=0,this.length=this.buf.length}e.Varint=0,e.Fixed64=1,e.Bytes=2,e.Fixed32=5;var i=4294967296,o=1/i,l=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function a(D){return D.type===e.Bytes?D.readVarint()+D.pos:D.pos+1}function h(D,F,V){return V?4294967296*F+(D>>>0):4294967296*(F>>>0)+(D>>>0)}function m(D,F,V){var q=F<=16383?1:F<=2097151?2:F<=268435455?3:Math.floor(Math.log(F)/(7*Math.LN2));V.realloc(q);for(var J=V.pos-1;J>=D;J--)V.buf[J+q]=V.buf[J]}function g(D,F){for(var V=0;V>>8,D[V+2]=F>>>16,D[V+3]=F>>>24}function L(D,F){return(D[F]|D[F+1]<<8|D[F+2]<<16)+(D[F+3]<<24)}return e.prototype={destroy:function(){this.buf=null},readFields:function(D,F,V){for(V=V||this.length;this.pos>3,X=this.pos;this.type=7&q,D(J,F,this),this.pos===X&&this.skip(q)}return F},readMessage:function(D,F){return this.readFields(D,F,this.readVarint()+this.pos)},readFixed32:function(){var D=P(this.buf,this.pos);return this.pos+=4,D},readSFixed32:function(){var D=L(this.buf,this.pos);return this.pos+=4,D},readFixed64:function(){var D=P(this.buf,this.pos)+P(this.buf,this.pos+4)*i;return this.pos+=8,D},readSFixed64:function(){var D=P(this.buf,this.pos)+L(this.buf,this.pos+4)*i;return this.pos+=8,D},readFloat:function(){var D=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,D},readDouble:function(){var D=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,D},readVarint:function(D){var F,V,q=this.buf;return F=127&(V=q[this.pos++]),V<128?F:(F|=(127&(V=q[this.pos++]))<<7,V<128?F:(F|=(127&(V=q[this.pos++]))<<14,V<128?F:(F|=(127&(V=q[this.pos++]))<<21,V<128?F:function(J,X,Y){var le,ee,ce=Y.buf;if(le=(112&(ee=ce[Y.pos++]))>>4,ee<128||(le|=(127&(ee=ce[Y.pos++]))<<3,ee<128)||(le|=(127&(ee=ce[Y.pos++]))<<10,ee<128)||(le|=(127&(ee=ce[Y.pos++]))<<17,ee<128)||(le|=(127&(ee=ce[Y.pos++]))<<24,ee<128)||(le|=(1&(ee=ce[Y.pos++]))<<31,ee<128))return h(J,le,X);throw new Error("Expected varint not more than 10 bytes")}(F|=(15&(V=q[this.pos]))<<28,D,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var D=this.readVarint();return D%2==1?(D+1)/-2:D/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var D=this.readVarint()+this.pos,F=this.pos;return this.pos=D,D-F>=12&&l?function(V,q,J){return l.decode(V.subarray(q,J))}(this.buf,F,D):function(V,q,J){for(var X="",Y=q;Y239?4:me>223?3:me>191?2:1;if(Y+xe>J)break;xe===1?me<128&&(pe=me):xe===2?(192&(le=V[Y+1]))==128&&(pe=(31&me)<<6|63&le)<=127&&(pe=null):xe===3?(ee=V[Y+2],(192&(le=V[Y+1]))==128&&(192&ee)==128&&((pe=(15&me)<<12|(63&le)<<6|63&ee)<=2047||pe>=55296&&pe<=57343)&&(pe=null)):xe===4&&(ee=V[Y+2],ce=V[Y+3],(192&(le=V[Y+1]))==128&&(192&ee)==128&&(192&ce)==128&&((pe=(15&me)<<18|(63&le)<<12|(63&ee)<<6|63&ce)<=65535||pe>=1114112)&&(pe=null)),pe===null?(pe=65533,xe=1):pe>65535&&(pe-=65536,X+=String.fromCharCode(pe>>>10&1023|55296),pe=56320|1023&pe),X+=String.fromCharCode(pe),Y+=xe}return X}(this.buf,F,D)},readBytes:function(){var D=this.readVarint()+this.pos,F=this.buf.subarray(this.pos,D);return this.pos=D,F},readPackedVarint:function(D,F){if(this.type!==e.Bytes)return D.push(this.readVarint(F));var V=a(this);for(D=D||[];this.pos127;);else if(F===e.Bytes)this.pos=this.readVarint()+this.pos;else if(F===e.Fixed32)this.pos+=4;else{if(F!==e.Fixed64)throw new Error("Unimplemented type: "+F);this.pos+=8}},writeTag:function(D,F){this.writeVarint(D<<3|F)},realloc:function(D){for(var F=this.length||16;F268435455||D<0?function(F,V){var q,J;if(F>=0?(q=F%4294967296|0,J=F/4294967296|0):(J=~(-F/4294967296),4294967295^(q=~(-F%4294967296))?q=q+1|0:(q=0,J=J+1|0)),F>=18446744073709552e3||F<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");V.realloc(10),function(X,Y,le){le.buf[le.pos++]=127&X|128,X>>>=7,le.buf[le.pos++]=127&X|128,X>>>=7,le.buf[le.pos++]=127&X|128,X>>>=7,le.buf[le.pos++]=127&X|128,le.buf[le.pos]=127&(X>>>=7)}(q,0,V),function(X,Y){var le=(7&X)<<4;Y.buf[Y.pos++]|=le|((X>>>=3)?128:0),X&&(Y.buf[Y.pos++]=127&X|((X>>>=7)?128:0),X&&(Y.buf[Y.pos++]=127&X|((X>>>=7)?128:0),X&&(Y.buf[Y.pos++]=127&X|((X>>>=7)?128:0),X&&(Y.buf[Y.pos++]=127&X|((X>>>=7)?128:0),X&&(Y.buf[Y.pos++]=127&X)))))}(J,V)}(D,this):(this.realloc(4),this.buf[this.pos++]=127&D|(D>127?128:0),D<=127||(this.buf[this.pos++]=127&(D>>>=7)|(D>127?128:0),D<=127||(this.buf[this.pos++]=127&(D>>>=7)|(D>127?128:0),D<=127||(this.buf[this.pos++]=D>>>7&127))))},writeSVarint:function(D){this.writeVarint(D<0?2*-D-1:2*D)},writeBoolean:function(D){this.writeVarint(!!D)},writeString:function(D){D=String(D),this.realloc(4*D.length),this.pos++;var F=this.pos;this.pos=function(q,J,X){for(var Y,le,ee=0;ee55295&&Y<57344){if(!le){Y>56319||ee+1===J.length?(q[X++]=239,q[X++]=191,q[X++]=189):le=Y;continue}if(Y<56320){q[X++]=239,q[X++]=191,q[X++]=189,le=Y;continue}Y=le-55296<<10|Y-56320|65536,le=null}else le&&(q[X++]=239,q[X++]=191,q[X++]=189,le=null);Y<128?q[X++]=Y:(Y<2048?q[X++]=Y>>6|192:(Y<65536?q[X++]=Y>>12|224:(q[X++]=Y>>18|240,q[X++]=Y>>12&63|128),q[X++]=Y>>6&63|128),q[X++]=63&Y|128)}return X}(this.buf,D,this.pos);var V=this.pos-F;V>=128&&m(F,V,this),this.pos=F-1,this.writeVarint(V),this.pos+=V},writeFloat:function(D){this.realloc(4),n.write(this.buf,D,this.pos,!0,23,4),this.pos+=4},writeDouble:function(D){this.realloc(8),n.write(this.buf,D,this.pos,!0,52,8),this.pos+=8},writeBytes:function(D){var F=D.length;this.writeVarint(F),this.realloc(F);for(var V=0;V=128&&m(V,q,this),this.pos=V-1,this.writeVarint(q),this.pos+=q},writeMessage:function(D,F,V){this.writeTag(D,e.Bytes),this.writeRawMessage(F,V)},writePackedVarint:function(D,F){F.length&&this.writeMessage(D,g,F)},writePackedSVarint:function(D,F){F.length&&this.writeMessage(D,v,F)},writePackedBoolean:function(D,F){F.length&&this.writeMessage(D,w,F)},writePackedFloat:function(D,F){F.length&&this.writeMessage(D,p,F)},writePackedDouble:function(D,F){F.length&&this.writeMessage(D,y,F)},writePackedFixed32:function(D,F){F.length&&this.writeMessage(D,x,F)},writePackedSFixed32:function(D,F){F.length&&this.writeMessage(D,b,F)},writePackedFixed64:function(D,F){F.length&&this.writeMessage(D,S,F)},writePackedSFixed64:function(D,F){F.length&&this.writeMessage(D,I,F)},writeBytesField:function(D,F){this.writeTag(D,e.Bytes),this.writeBytes(F)},writeFixed32Field:function(D,F){this.writeTag(D,e.Fixed32),this.writeFixed32(F)},writeSFixed32Field:function(D,F){this.writeTag(D,e.Fixed32),this.writeSFixed32(F)},writeFixed64Field:function(D,F){this.writeTag(D,e.Fixed64),this.writeFixed64(F)},writeSFixed64Field:function(D,F){this.writeTag(D,e.Fixed64),this.writeSFixed64(F)},writeVarintField:function(D,F){this.writeTag(D,e.Varint),this.writeVarint(F)},writeSVarintField:function(D,F){this.writeTag(D,e.Varint),this.writeSVarint(F)},writeStringField:function(D,F){this.writeTag(D,e.Bytes),this.writeString(F)},writeFloatField:function(D,F){this.writeTag(D,e.Fixed32),this.writeFloat(F)},writeDoubleField:function(D,F){this.writeTag(D,e.Fixed64),this.writeDouble(F)},writeBooleanField:function(D,F){this.writeVarintField(D,!!F)}},M4}var xu=gt(y8());const I4=3;function wm(n,e,i){e.glyphs=[],n===1&&i.readMessage(Tm,e)}function Tm(n,e,i){if(n===3){const{id:o,bitmap:l,width:a,height:h,left:m,top:g,advance:v}=i.readMessage(Sm,{});e.glyphs.push({id:o,bitmap:new va({width:a+2*I4,height:h+2*I4},l),metrics:{width:a,height:h,left:m,top:g,advance:v}})}else n===4?e.ascender=i.readSVarint():n===5&&(e.descender=i.readSVarint())}function Sm(n,e,i){n===1?e.id=i.readVarint():n===2?e.bitmap=i.readBytes():n===3?e.width=i.readVarint():n===4?e.height=i.readVarint():n===5?e.left=i.readSVarint():n===6?e.top=i.readSVarint():n===7&&(e.advance=i.readVarint())}const x8=I4,un={horizontal:1,vertical:2,horizontalOnly:3};class C1{constructor(){this.scale=1,this.fontStack="",this.image=null}static forText(e,i){const o=new C1;return o.scale=e||1,o.fontStack=i,o}static forImage(e){const i=new C1;return i.image=e,i}}class kl{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,i,o){const l=new kl;for(let a=0;a=0&&o>=e&&vu[this.text.charCodeAt(o)];o--)i--;this.text=this.text.substring(e,i),this.sectionIndex=this.sectionIndex.slice(e,i)}substring(e,i){const o=new kl;return o.text=this.text.substring(e,i),o.sectionIndex=this.sectionIndex.slice(e,i),o.sections=this.sections,o}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,i)=>Math.max(e,this.sections[i].scale),0)}addTextSection(e,i){this.text+=e.text,this.sections.push(C1.forText(e.scale,e.fontStack||i));const o=this.sections.length-1;for(let l=0;l=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function P4(n,e,i,o,l,a,h,m,g,v,p,y,w,x,b,S=1){const I=kl.fromFeature(n,l,S);y===un.vertical&&I.verticalizePunctuation(w);let P=[];const O=function(q,J,X,Y,le,ee){if(!q)return[];const ce=[],me=function(Ee,we,Ae,$e,Ge,lt){let Ze=0;for(let Ke=0;Ke=0;let xe=0;for(let Ee=0;Ee0&&Fn>Vt&&(Vt=Fn)}else{const Rr=X[ii.fontStack];if(!Rr)continue;Rr[Ni]&&(Mi=Rr[Ni]);const xr=J[ii.fontStack];if(!xr)continue;const Fn=xr.glyphs[Ni];if(!Fn)continue;if(Hi=Fn.metrics,qr=Ni!==8203?Er:0,lt){const Ia=xr.ascender!==void 0?Math.abs(xr.ascender):0,Jn=xr.descender!==void 0?Math.abs(xr.descender):0,Eo=(Ia+Jn)*qi;Yt-i/2;){if(h--,h<0)return!1;m-=n[h].dist(a),a=n[h]}m+=n[h].dist(n[h+1]),h++;const g=[];let v=0;for(;mo;)v-=g.shift().angleDelta;if(v>l)return!1;h++,m+=p.dist(y)}return!0}function A8(n){let e=0;for(let i=0;iv){const b=(v-g)/x,S=St(y.x,w.x,b),I=St(y.y,w.y,b),P=new Ts(S,I,0,w.angleTo(y),p);return!h||M8(n,P,m,h,e)?P:void 0}g+=x}}function Pm(n,e,i,o,l,a,h,m,g){const v=I8(o,a,h),p=P8(o,l),y=p*h,w=n[0].x===0||n[0].x===g||n[0].y===0||n[0].y===g;return e-y=0&&D=0&&F=0&&w+v<=p){const V=new Ts(D,F,0,O,b);o&&!M8(n,V,a,o,l)||x.push(V)}}y+=P}return m||x.length||h||(x=C8(n,y/2,i,o,l,a,h,!0,g)),x}function z8(n,e,i,o,l){const a=[];for(let h=0;h=o&&y.x>=o||(p.x>=o?p=new Qe(o,p.y+(o-p.x)/(y.x-p.x)*(y.y-p.y))._round():y.x>=o&&(y=new Qe(o,p.y+(o-p.x)/(y.x-p.x)*(y.y-p.y))._round()),p.y>=l&&y.y>=l||(p.y>=l?p=new Qe(p.x+(l-p.y)/(y.y-p.y)*(y.x-p.x),l)._round():y.y>=l&&(y=new Qe(p.x+(l-p.y)/(y.y-p.y)*(y.x-p.x),l)._round()),g&&p.equals(g[g.length-1])||(g=[p],a.push(g)),g.push(y)))))}}return a}function R8(n){let e=0,i=0;for(const h of n)e+=h.w*h.h,i=Math.max(i,h.w);n.sort((h,m)=>m.h-h.h);const o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let l=0,a=0;for(const h of n)for(let m=o.length-1;m>=0;m--){const g=o[m];if(!(h.w>g.w||h.h>g.h)){if(h.x=g.x,h.y=g.y,a=Math.max(a,h.y+h.h),l=Math.max(l,h.x+h.w),h.w===g.w&&h.h===g.h){const v=o.pop();m1?b-1:b,Sr.copy(y.data,v,{x:0,y:0},{x:S,y:I},y.data,o),Sr.copy(y.data,v,{x:0,y:O-b},{x:S,y:I-b},{width:P,height:b},o),Sr.copy(y.data,v,{x:0,y:0},{x:S,y:I+O},{width:P,height:b},o),Sr.copy(y.data,v,{x:P-b,y:0},{x:S-b,y:I},{width:b,height:O},o),Sr.copy(y.data,v,{x:0,y:0},{x:S+P,y:I},{width:b,height:O},o),Sr.copy(y.data,v,{x:P-b,y:O-b},{x:S-b,y:I-b},{width:b,height:b},o),Sr.copy(y.data,v,{x:0,y:O-b},{x:S+P,y:I-b},{width:b,height:b},o),Sr.copy(y.data,v,{x:0,y:0},{x:S+P,y:I+O},{width:b,height:b},o),Sr.copy(y.data,v,{x:P-b,y:0},{x:S-b,y:I+O},{width:b,height:b},o)}this.lut=o,this.image=v,this.iconPositions=l,this.patternPositions=a}addImages(e,i,o,l){for(const[a,h]of e.entries()){const{bin:m,imagePosition:g,imageVariant:v}=D8(a,h,o);i.set(a,g),l.push(m),h.hasRenderCallback&&this.haveRenderCallbacks.push(v.id)}}patchUpdatedImages(e,i,o){this.haveRenderCallbacks=this.haveRenderCallbacks.filter(l=>e.hasImage(l,o)),e.dispatchRenderCallbacks(this.haveRenderCallbacks,o);for(const l of e.getUpdatedImages(o)){for(const a of this.iconPositions.keys()){const h=qn.parse(a);if(Ur.isEqual(h.id,l)){const m=e.getImage(l,o);this.patchUpdatedImage(this.iconPositions.get(a),m,i)}}for(const a of this.patternPositions.keys()){const h=qn.parse(a);if(Ur.isEqual(h.id,l)){const m=e.getImage(l,o);this.patchUpdatedImage(this.patternPositions.get(a),m,i)}}}}patchUpdatedImage(e,i,o){if(!e||!i||e.version===i.version)return;e.version=i.version;const[l,a]=e.tl,h=e.sdf;if(this.lut||h){const m={width:i.data.width,height:i.data.height},g=new Sr(m);Sr.copy(i.data,g,{x:0,y:0},{x:0,y:0},m,this.lut,h),o.update(g,{position:{x:l,y:a}})}else o.update(i.data,{position:{x:l,y:a}})}}at(z1,"ImagePosition"),at(L8,"ImageAtlas");const R1=1e20;function O8(n,e,i,o,l,a,h,m,g){for(let v=e;v-1);g++,a[g]=m,h[g]=v,h[g+1]=R1}for(let m=0,g=0;m{let v=this.entries[h];v||(v=this.entries[h]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let p=v.glyphs[m];if(p!==void 0)return void g(null,{stack:h,id:m,glyph:p});if(p=this._tinySDF(v,h,m),p)return v.glyphs[m]=p,void g(null,{stack:h,id:m,glyph:p});const y=Math.floor(m/256);if(256*y>65535)return ji("glyphs > 65535 not supported"),void g(null,{stack:h,id:m,glyph:p});if(v.ranges[y])return void g(null,{stack:h,id:m,glyph:p});let w=v.requests[y];w||(w=v.requests[y]=[],Bl.loadGlyphRange(h,y,a,this.requestManager,(x,b)=>{if(b){v.ascender=b.ascender,v.descender=b.descender;for(const S in b.glyphs)this._doesCharSupportLocalGlyph(+S)||(v.glyphs[+S]=b.glyphs[+S]);v.ranges[y]=!0}for(const S of w)S(x,b);delete v.requests[y]})),w.push((x,b)=>{x?g(x):b&&g(null,{stack:h,id:m,glyph:b.glyphs[m]||null})})},(h,m)=>{if(h)o(h);else if(m){const g={};for(const{stack:v,id:p,glyph:y}of m)g[v]===void 0&&(g[v]={}),g[v].glyphs===void 0&&(g[v].glyphs={}),g[v].glyphs[p]=y&&{id:y.id,bitmap:y.bitmap.clone(),metrics:y.metrics},g[v].ascender=this.entries[v].ascender,g[v].descender=this.entries[v].descender;o(null,g)}})}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==z4.none&&(this.localGlyphMode===z4.all?!!this.localFontFamily:!!this.localFontFamily&&(bt["CJK Unified Ideographs"](e)||bt["Hangul Syllables"](e)||bt.Hiragana(e)||bt.Katakana(e)||bt["CJK Symbols and Punctuation"](e)||bt["CJK Unified Ideographs Extension A"](e)||bt["CJK Unified Ideographs Extension B"](e)||bt.Osage(e)))}_tinySDF(e,i,o){const l=this.localFontFamily;if(!l||!this._doesCharSupportLocalGlyph(o))return;let a=e.tinySDF;if(!a){let S="400";/bold/i.test(i)?S="900":/medium/i.test(i)?S="500":/light/i.test(i)&&(S="200"),a=e.tinySDF=new Bl.TinySDF({fontFamily:l,fontWeight:S,fontSize:24*bo,buffer:3*bo,radius:8*bo}),a.fontWeight=S}if(this.localGlyphs[a.fontWeight][o])return this.localGlyphs[a.fontWeight][o];const h=String.fromCodePoint(o),{data:m,width:g,height:v,glyphWidth:p,glyphHeight:y,glyphLeft:w,glyphTop:x,glyphAdvance:b}=a.draw(h);return this.localGlyphs[a.fontWeight][o]={id:o,bitmap:new va({width:g,height:v},m),metrics:{width:p/bo,height:y/bo,left:w/bo,top:x/bo-27,advance:b/bo,localGlyph:!0}}}}Bl.loadGlyphRange=function(n,e,i,o,l){const a=256*e,h=a+255,m=o.transformRequest(o.normalizeGlyphsURL(i).replace("{fontstack}",n).replace("{range}",`${a}-${h}`),dr.Glyphs);Gn(m,(g,v)=>{if(g)l(g);else if(v){const p={},y=function(w){return new xu(w).readFields(wm,{})}(v);for(const w of y.glyphs)p[w.id]=w;l(null,{glyphs:p,ascender:y.ascender,descender:y.descender})}})},Bl.TinySDF=class{constructor({fontSize:n=24,buffer:e=3,radius:i=8,cutoff:o=.25,fontFamily:l="sans-serif",fontWeight:a="normal",fontStyle:h="normal"}={}){this.buffer=e,this.cutoff=o,this.radius=i;const m=this.size=n+4*e,g=this._createCanvas(m),v=this.ctx=g.getContext("2d",{willReadFrequently:!0});v.font=`${h} ${a} ${n}px ${l}`,v.textBaseline="alphabetic",v.textAlign="left",v.fillStyle="black",this.gridOuter=new Float64Array(m*m),this.gridInner=new Float64Array(m*m),this.f=new Float64Array(m),this.z=new Float64Array(m+1),this.v=new Uint16Array(m)}_createCanvas(n){const e=document.createElement("canvas");return e.width=e.height=n,e}draw(n){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:o,actualBoundingBoxLeft:l,actualBoundingBoxRight:a}=this.ctx.measureText(n),h=Math.ceil(i),m=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-l))),g=Math.min(this.size-this.buffer,h+Math.ceil(o)),v=m+2*this.buffer,p=g+2*this.buffer,y=Math.max(v*p,0),w=new Uint8ClampedArray(y),x={data:w,width:v,height:p,glyphWidth:m,glyphHeight:g,glyphTop:h,glyphLeft:0,glyphAdvance:e};if(m===0||g===0)return x;const{ctx:b,buffer:S,gridInner:I,gridOuter:P}=this;b.clearRect(S,S,m,g),b.fillText(n,S,S+h);const O=b.getImageData(S,S,m,g);P.fill(R1,0,y),I.fill(0,0,y);for(let L=0;L0?q*q:0,I[V]=q<0?q*q:0}}O8(P,0,0,v,p,v,this.f,this.v,this.z),O8(I,S,S,m,g,v,this.f,this.v,this.z);for(let L=0;L{const pe=wu(le.stretch-O,L,p,n.left*l),xe=Tu(le.fixed-V,q,le.stretch,b),ye=wu(ee.stretch-D,F,y,n.top*l),Ee=Tu(ee.fixed-J,X,ee.stretch,S),we=wu(ce.stretch-O,L,p,n.left*l),Ae=Tu(ce.fixed-V,q,ce.stretch,b),$e=wu(me.stretch-D,F,y,n.top*l),Ge=Tu(me.fixed-J,X,me.stretch,S),lt=new Qe(pe,ye),Ze=new Qe(we,ye),Ke=new Qe(we,$e),He=new Qe(pe,$e),wt=new Qe(xe/m,Ee/m),rt=new Qe(Ae/m,Ge/m),pt=e*Math.PI/180;if(pt){const Yt=Math.sin(pt),ci=Math.cos(pt),Ii=[ci,-Yt,Yt,ci];lt._matMult(Ii),Ze._matMult(Ii),He._matMult(Ii),Ke._matMult(Ii)}const Mt=le.stretch+le.fixed,jt=ce.stretch+ce.fixed,Ct=ee.stretch+ee.fixed,Wt=me.stretch+me.fixed,Vt=n.imageSecondary;return{tl:lt,tr:Ze,bl:He,br:Ke,texPrimary:{x:h.paddedRect.x+Ta+Mt,y:h.paddedRect.y+Ta+Ct,w:jt-Mt,h:Wt-Ct},texSecondary:Vt?{x:Vt.paddedRect.x+Ta+Mt,y:Vt.paddedRect.y+Ta+Ct,w:jt-Mt,h:Wt-Ct}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:wt,pixelOffsetBR:rt,minFontScaleX:q/m/p,minFontScaleY:X/m/y,isSDF:i}};if(o&&(h.stretchX||h.stretchY)){const le=N8(w,I,b),ee=N8(x,P,S);for(let ce=0;cea)&&(a=b.x),(!x||b.y>h)&&(h=b.y)}const g=Math.min(a-o,h-l);let v=g/2;const p=new Xa([],Rm);if(g===0)return new Qe(o,l);for(let x=o;xy.d||!y.d)&&(y=x,i&&console.log("found best %d after %d probes",Math.round(1e4*x.d)/1e4,w)),x.max-y.d<=e||(v=x.h/2,p.push(new Nl(x.p.x-v,x.p.y-v,v,n)),p.push(new Nl(x.p.x+v,x.p.y-v,v,n)),p.push(new Nl(x.p.x-v,x.p.y+v,v,n)),p.push(new Nl(x.p.x+v,x.p.y+v,v,n)),w+=4)}return i&&(console.log(`num probes: ${w}`),console.log(`best distance: ${y.d}`)),y.p}function Rm(n,e){return e.max-n.max}class Nl{constructor(e,i,o,l){this.p=new Qe(e,i),this.h=o,this.d=function(a,h){let m=!1,g=1/0;for(let v=0;va.y!=S.y>a.y&&a.x<(S.x-b.x)*(a.y-b.y)/(S.y-b.y)+b.x&&(m=!m),g=Math.min(g,ae(a,b,S))}}return(m?1:-1)*Math.sqrt(g)}(this.p,l),this.max=this.d+this.h*Math.SQRT2}}const R4=Number.POSITIVE_INFINITY,Dm=Math.sqrt(2);function V8(n,[e,i]){let o=0,l=0;if(i===R4){e<0&&(e=0);const a=e/Dm;switch(n){case"top-right":case"top-left":l=a-7;break;case"bottom-right":case"bottom-left":l=7-a;break;case"bottom":l=7-e;break;case"top":l=e-7}switch(n){case"top-right":case"bottom-right":o=-a;break;case"top-left":case"bottom-left":o=a;break;case"left":o=e;break;case"right":o=-e}}else{switch(e=Math.abs(e),i=Math.abs(i),n){case"top-right":case"top-left":case"top":l=i-7;break;case"bottom-right":case"bottom-left":case"bottom":l=7-i}switch(n){case"top-right":case"bottom-right":case"right":o=-e;break;case"top-left":case"bottom-left":case"left":o=e}}return[o,l]}function U8(n,e,i,o,l,a,h,m){if(!n)return;const g=m8(e,i,o,l,a);return n.scaleSelf(g*m*h)}function j8(n,e,i,o,l,a,h,m){return{iconPrimary:U8(n.getPrimary(),e,i,o,l,a,h,m),iconSecondary:U8(n.getSecondary(),e,i,o,l,a,h,m)}}function G8(n,e,i,o){if(!n)return;const l=e.get(i.toString());if(n.imagePrimary=l,o){const a=e.get(o.toString());n.imageSecondary=a}}function Lm(n,e){for(const i in n.horizontal)q8(n.horizontal[i],e);q8(n.vertical,e)}function q8(n,e){if(n){for(const i of n.positionedLines)for(const o of i.positionedGlyphs)if(o.image!==null){const l=o.image.toString();o.rect=e.get(l).paddedRect}}}function D4(n){switch(n){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Om(n,e,i,o,l,a,h,m,g){const v=L4(a.horizontal)||a.vertical,p=i.get("icon-text-fit-padding").evaluate(o,{},l);let y,w=e;return e&&g!=="none"&&(n.allowVerticalPlacement&&a.vertical&&(y=E8(e,a.vertical,g,p,m,h)),v&&(w=E8(e,v,g,p,m,h))),{defaultShapedIcon:w,verticallyShapedIcon:y}}function km(n,e,i,o,l,a,h,m,g,v,p,y,w,x,b,S,I,P,O,L){let D=h.textMaxSize.evaluate(e,{},w);D===void 0?D=m*h.textScaleFactor:D*=h.textScaleFactor;const F=n.layers[0].layout,V=L4(i.horizontal)||i.vertical,q=x.name==="globe",J=Er,X=n.tilePixelRatio*D/J,Y=(xe=n.overscaling,n.zoom>18&&xe>2&&(xe>>=1),Math.max(Je/(512*xe),1)*F.get("symbol-spacing")),le=F.get("text-padding")*n.tilePixelRatio,ee=F.get("icon-padding")*n.tilePixelRatio,ce=ri(F.get("text-max-angle")),me=F.get("icon-rotation-alignment")==="map"&&L!=="point",pe=Y/2;var xe;n.hasAnyIconTextFit===!1&&I!=="none"&&(n.hasAnyIconTextFit=!0);const ye=e.properties?+e.properties[T0]:null,Ee=ye&&n.elevationFeatureIdToIndex?n.elevationFeatureIdToIndex.get(ye):65535,we=(Ae,$e,Ge)=>{if($e.x<0||$e.x>=Je||$e.y<0||$e.y>=Je)return;let lt=null;if(q){const{x:Ze,y:Ke,z:He}=x.projectTilePoint($e.x,$e.y,Ge);lt={anchor:new Ts(Ze,Ke,He,0,void 0),up:x.upVector(Ge,$e.x,$e.y)}}(function(Ze,Ke,He,wt,rt,pt,Mt,jt,Ct,Wt,Vt,Yt,ci,Ii,It,ii,Li,Ni,qi,Hi,Mi,cr,qr,er,nr,Rr,xr,Fn,Ia){const Jn=Ze.addToLineVertexArray(Ke,wt);let Eo,Pa,Ca,C0,Af,If,Pf,Cf=0,zf=0,Rf=0,Df=0,pd=-1,fd=-1;const Jo={};let Lf=rn("");const z0=He?He.anchor:Ke,md=Fn!=="none";let _d=0,gd=0;if(Ct._unevaluatedLayout.getValue("text-radial-offset")===void 0?[_d,gd]=Ct.layout.get("text-offset").evaluate(Mi,{},nr).map(Bn=>Bn*Er):(_d=Ct.layout.get("text-radial-offset").evaluate(Mi,{},nr)*Er,gd=R4),Ze.allowVerticalPlacement&&rt.vertical){const Bn=rt.vertical;if(It)If=O4(Bn),jt&&(Pf=O4(jt));else{const hn=Ct.layout.get("text-rotate").evaluate(Mi,{},nr)+90;Ca=Su(Wt,z0,Ke,Vt,Yt,ci,Bn,Ii,hn,ii),jt&&(C0=Su(Wt,z0,Ke,Vt,Yt,ci,jt,Ni,hn))}}if(pt){const Bn=Ze.iconSizeData,hn=Ct.layout.get("icon-rotate").evaluate(Mi,{},nr),K1=B8(pt,hn,qr,md,cr.iconScaleFactor),xd=jt?B8(jt,hn,qr,md,cr.iconScaleFactor):void 0;Pa=Su(Wt,z0,Ke,Vt,Yt,ci,pt,Ni,hn,null),Cf=4*K1.length;let R0=null;Bn.kind==="source"?(R0=[vo*Ct.layout.get("icon-size").evaluate(Mi,{},nr)*cr.iconScaleFactor],R0[0]>Sa&&ji(`${Ze.layerIds[0]}: Value for "icon-size" is >= ${D1}. Reduce your "icon-size".`)):Bn.kind==="composite"&&(R0=[vo*cr.compositeIconSizes[0].evaluate(Mi,{},nr)*cr.iconScaleFactor,vo*cr.compositeIconSizes[1].evaluate(Mi,{},nr)*cr.iconScaleFactor],(R0[0]>Sa||R0[1]>Sa)&&ji(`${Ze.layerIds[0]}: Value for "icon-size" is >= ${D1}. Reduce your "icon-size".`)),Ze.addSymbols(Ze.icon,K1,R0,Hi,qi,Mi,!1,He,Ke,Jn.lineStartIndex,Jn.lineLength,-1,er,nr,Rr,xr),pd=Ze.icon.placedSymbolArray.length-1,xd&&(zf=4*xd.length,Ze.addSymbols(Ze.icon,xd,R0,Hi,qi,Mi,un.vertical,He,Ke,Jn.lineStartIndex,Jn.lineLength,-1,er,nr,Rr,xr),fd=Ze.icon.placedSymbolArray.length-1)}for(const Bn in rt.horizontal){const hn=rt.horizontal[Bn];Eo||(Lf=rn(hn.text),It?Af=O4(hn):Eo=Su(Wt,z0,Ke,Vt,Yt,ci,hn,Ii,Ct.layout.get("text-rotate").evaluate(Mi,{},nr),ii));const K1=hn.positionedLines.length===1;if(Rf+=$8(Ze,He,Ke,hn,Mt,Ct,It,Mi,ii,Jn,rt.vertical?un.horizontal:un.horizontalOnly,K1?Object.keys(rt.horizontal):[Bn],Jo,pd,cr,er,nr,Rr),K1)break}rt.vertical&&(Df+=$8(Ze,He,Ke,rt.vertical,Mt,Ct,It,Mi,ii,Jn,un.vertical,["vertical"],Jo,fd,cr,er,nr,Rr));let za=-1;const yd=(Bn,hn)=>Bn?Math.max(Bn,hn):hn;za=yd(Af,za),za=yd(If,za),za=yd(Pf,za);const f_=za>-1?1:0;Ze.glyphOffsetArray.length>=65535&&ji("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Mi.sortKey!==void 0&&Ze.addToSortKeyRanges(Ze.symbolInstances.length,Mi.sortKey),Ze.symbolInstances.emplaceBack(Ke.x,Ke.y,z0.x,z0.y,z0.z,Jo.right>=0?Jo.right:-1,Jo.center>=0?Jo.center:-1,Jo.left>=0?Jo.left:-1,Jo.vertical>=0?Jo.vertical:-1,pd,fd,Lf,Eo!==void 0?Eo:Ze.collisionBoxArray.length,Eo!==void 0?Eo+1:Ze.collisionBoxArray.length,Ca!==void 0?Ca:Ze.collisionBoxArray.length,Ca!==void 0?Ca+1:Ze.collisionBoxArray.length,Pa!==void 0?Pa:Ze.collisionBoxArray.length,Pa!==void 0?Pa+1:Ze.collisionBoxArray.length,C0||Ze.collisionBoxArray.length,C0?C0+1:Ze.collisionBoxArray.length,Vt,Rf,Df,Cf,zf,f_,0,_d,gd,za,0,md?1:0,Ia)})(n,$e,lt,Ae,i,o,a,l,n.layers[0],n.collisionBoxArray,e.index,e.sourceLayerIndex,n.index,le,O,v,0,ee,me,P,e,h,p,y,w,b,S,I,Ee)};if(L==="line")for(const Ae of z8(e.geometry,0,0,Je,Je)){const $e=Pm(Ae,Y,ce,i.vertical||V,o,J,X,n.overscaling,Je);for(const Ge of $e)V&&Fm(n,V.text,pe,Ge)||we(Ae,Ge,w)}else if(L==="line-center"){for(const Ae of e.geometry)if(Ae.length>1){const $e=Im(Ae,ce,i.vertical||V,o,J,X);$e&&we(Ae,$e,w)}}else if(e.type==="Polygon")for(const Ae of hu(e.geometry,0)){const $e=zm(Ae,16);we(Ae[0],new Ts($e.x,$e.y,0,0,void 0),w)}else if(e.type==="LineString")for(const Ae of e.geometry)we(Ae,new Ts(Ae[0].x,Ae[0].y,0,0,void 0),w);else if(e.type==="Point")for(const Ae of e.geometry)for(const $e of Ae)we([$e],new Ts($e.x,$e.y,0,0,void 0),w)}const D1=255,Sa=D1*vo;function $8(n,e,i,o,l,a,h,m,g,v,p,y,w,x,b,S,I,P){const O=function(F,V,q,J,X,Y,le,ee){const ce=[];if(V.positionedLines.length===0)return ce;const me=J.layout.get("text-rotate").evaluate(Y,{})*Math.PI/180,pe=function(Ae){const $e=Ae[0],Ge=Ae[1],lt=$e*Ge;return lt>0?[$e,-Ge]:lt<0?[-$e,Ge]:$e===0?[Ge,$e]:[Ge,-$e]}(q);let xe=Math.abs(V.top-V.bottom);for(const Ae of V.positionedLines)xe-=Ae.lineOffset;const ye=V.positionedLines.length,Ee=xe/ye;let we=V.top-q[1];for(let Ae=0;AeSa&&ji(`${n.layerIds[0]}: Value for "text-size" is >= ${D1}. Reduce your "text-size".`)):L.kind==="composite"&&(D=[vo*b.compositeTextSizes[0].evaluate(m,{},I)*b.textScaleFactor,vo*b.compositeTextSizes[1].evaluate(m,{},I)*b.textScaleFactor],(D[0]>Sa||D[1]>Sa)&&ji(`${n.layerIds[0]}: Value for "text-size" is >= ${D1}. Reduce your "text-size".`)),n.addSymbols(n.text,O,D,g,h,m,p,e,i,v.lineStartIndex,v.lineLength,x,S,I,P,!1);for(const F of y)w[F]=n.text.placedSymbolArray.length-1;return 4*O.length}function L4(n){for(const e in n)return n[e];return null}function Su(n,e,i,o,l,a,h,m,g,v){let p=h.top,y=h.bottom,w=h.left,x=h.right;const b=h.collisionPadding;if(b&&(w-=b[0],p-=b[1],x+=b[2],y+=b[3]),g){const S=new Qe(w,p),I=new Qe(x,p),P=new Qe(w,y),O=new Qe(x,y),L=ri(g);let D=new Qe(0,0);v&&(D=new Qe(v[0],v[1])),S._rotateAround(L,D),I._rotateAround(L,D),P._rotateAround(L,D),O._rotateAround(L,D),w=Math.min(S.x,I.x,P.x,O.x),x=Math.max(S.x,I.x,P.x,O.x),p=Math.min(S.y,I.y,P.y,O.y),y=Math.max(S.y,I.y,P.y,O.y)}return n.emplaceBack(e.x,e.y,e.z,i.x,i.y,w,p,x,y,m,o,l,a),n.length-1}function O4(n){n.collisionPadding&&(n.top-=n.collisionPadding[1],n.bottom+=n.collisionPadding[3]);const e=n.bottom-n.top;return e>0?Math.max(10,e):null}function Fm(n,e,i,o){const l=n.compareText;if(e in l){const a=l[e];for(let h=a.length-1;h>=0;h--)if(o.dist(a[h])L&&(D(V,me,J,X,ee,ce),D(me,q,ee,ce,Y,le))}D(y,w,o,a,l,a),D(w,x,l,a,l,h),D(x,b,l,h,o,h),D(b,y,o,h,o,a),S-=L,I-=L,P+=L,O+=L;const F=1/Math.max(P-S,O-I);return{scale:F,x:S*F,y:I*F,x2:P*F,y2:O*F,projection:e}}function Z8(n,{x:e,y:i},o=0){return new Qe(((e-o)*n.scale-n.x)*Je,(i*n.scale-n.y)*Je)}const Bm=Q.mat4.identity(new Float32Array(16));class Ea{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,i){return{x:0,y:0,z:0}}unproject(e,i){return new di(0,0)}projectTilePoint(e,i,o){return{x:e,y:i,z:0}}locationPoint(e,i,o,l=!0){return e._coordinatePoint(e.locationCoordinate(i,o),l)}pixelsPerMeter(e,i){return Tr(1,e)*i}pixelSpaceConversion(e,i,o){return 1}farthestPixelDistance(e){return H8(e,e.pixelsPerMeter)}pointCoordinate(e,i,o,l){const a=e.horizonLineFromTop(!1),h=new Qe(i,Math.max(a,o));return e.rayIntersectionCoordinate(e.pointRayIntersection(h,l))}pointCoordinate3D(e,i,o){const l=new Qe(i,o);if(e.elevation)return e.elevation.pointCoordinate(l);{const a=this.pointCoordinate(e,l.x,l.y,0);return[a.x,a.y,a.z]}}isPointAboveHorizon(e,i){if(e.elevation&&e.elevation.visibleDemTiles.length)return!this.pointCoordinate3D(e,i.x,i.y);const o=e.horizonLineFromTop();return i.y0?i<-Vl+o&&(i=-Vl+o):i>Vl-o&&(i=Vl-o);const h=a/Math.pow(Mu(i),l);let m=h*Math.sin(l*e),g=a-h*Math.cos(l*e);return m=.5*(m/Math.PI+.5),g=.5*(g/Math.PI+.5),{x:m,y:this.southernCenter?g:1-g,z:0}}unproject(e,i){e=(2*e-.5)*Math.PI,this.southernCenter&&(i=1-i),i=(2*(1-i)-.5)*Math.PI;const{n:o,f:l}=this,a=l-i,h=Math.sign(a),m=Math.sign(o)*Math.sqrt(e*e+a*a);let g=Math.atan2(e,Math.abs(a))*h;a*o<0&&(g-=Math.PI*Math.sign(e)*h);const v=$t(ur(g/o)+this.center[0],-180,180),p=$t(ur(2*Math.atan(Math.pow(l/m,1/o))-Vl),-Yi,Yi);return new di(v,this.southernCenter?-p:p)}}class W8 extends Ea{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,i){return{x:Wn(e),y:wr(i),z:0}}unproject(e,i){const o=Yr(e),l=gr(i);return new di(o,l)}}const X8=ri(Yi);class Gm extends Ea{project(e,i){const o=(i=ri(i))*i,l=o*o;return{x:.5*((e=ri(e))*(.8707-.131979*o+l*(l*(.003971*o-.001529*l)-.013791))/Math.PI+.5),y:1-.5*(i*(1.007226+o*(.015085+l*(.028874*o-.044475-.005916*l)))/Math.PI+1),z:0}}unproject(e,i){e=(2*e-.5)*Math.PI;let o=i=(2*(1-i)-1)*Math.PI,l=25,a=0,h=o*o;do{h=o*o;const v=h*h;a=(o*(1.007226+h*(.015085+v*(.028874*h-.044475-.005916*v)))-i)/(1.007226+h*(.045255+v*(.259866*h-.311325-.005916*11*v))),o=$t(o-a,-X8,X8)}while(Math.abs(a)>1e-6&&--l>0);h=o*o;const m=$t(ur(e/(.8707+h*(h*(h*h*h*(.003971-.001529*h)-.013791)-.131979))),-180,180),g=ur(o);return new di(m,g)}}const Y8=ri(Yi);class qm extends Ea{project(e,i){i=ri(i),e=ri(e);const o=Math.cos(i),l=2/Math.PI,a=Math.acos(o*Math.cos(e/2)),h=Math.sin(a)/a,m=.5*(e*l+2*o*Math.sin(e/2)/h)||0,g=.5*(i+Math.sin(i)/h)||0;return{x:.5*(m/Math.PI+.5),y:1-.5*(g/Math.PI+1),z:0}}unproject(e,i){let o=e=(2*e-.5)*Math.PI,l=i=(2*(1-i)-1)*Math.PI,a=25;const h=1e-6;let m=0,g=0;do{const v=Math.cos(l),p=Math.sin(l),y=2*p*v,w=p*p,x=v*v,b=Math.cos(o/2),S=Math.sin(o/2),I=2*b*S,P=S*S,O=1-x*b*b,L=O?1/O:0,D=O?Math.acos(v*b)*Math.sqrt(1/O):0,F=.5*(2*D*v*S+2*o/Math.PI)-e,V=.5*(D*p+l)-i,q=.5*L*(x*P+D*v*b*w)+1/Math.PI,J=L*(I*y/4-D*p*S),X=.125*L*(y*S-D*p*x*I),Y=.5*L*(w*b+D*P*v)+.5,le=J*X-Y*q;m=(V*J-F*Y)/le,g=(F*X-V*q)/le,o=$t(o-m,-Math.PI,Math.PI),l=$t(l-g,-Y8,Y8)}while((Math.abs(m)>h||Math.abs(g)>h)&&--a>0);return new di(ur(o),ur(l))}}class K8 extends Ea{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(ri(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,i){const{scale:o,cosPhi:l}=this;return{x:ri(e)*l*o+.5,y:-Math.sin(ri(i))/l*o+.5,z:0}}unproject(e,i){const{scale:o,cosPhi:l}=this,a=-(i-.5)/o,h=$t(ur((e-.5)/o)/l,-180,180),m=Math.asin($t(a*l,-1,1)),g=$t(ur(m),-Yi,Yi);return new di(h,g)}}class $m extends W8{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,i,o){const l=fi(e,i,o),a=Di(or(o));return Q.vec3.transformMat4(l,l,a),{x:l[0],y:l[1],z:l[2]}}locationPoint(e,i,o){const l=vs(i.lat,i.lng),a=Q.vec3.normalize([],l),h=o?e._centerAltitude+o:e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(i),e._centerAltitude):e._centerAltitude,m=Tr(1,0)*Je*h;Q.vec3.scaleAndAdd(l,l,a,m);const g=Q.mat4.identity(new Float64Array(16));return Q.mat4.multiply(g,e.pixelMatrix,e.globeMatrix),Q.vec3.transformMat4(l,l,g),new Qe(l[0],l[1])}pixelsPerMeter(e,i){return Tr(1,0)*i}pixelSpaceConversion(e,i,o){const l=Tr(1,e)*i,a=St(Tr(1,45)*i,l,o);return this.pixelsPerMeter(e,i)/a}createTileMatrix(e,i,o){const l=sr(or(o.canonical));return Q.mat4.multiply(new Float64Array(16),e.globeMatrix,l)}createInversionMatrix(e,i){const{center:o}=e,l=Di(or(i));return Q.mat4.rotateY(l,l,ri(o.lng)),Q.mat4.rotateX(l,l,ri(o.lat)),Q.mat4.scale(l,l,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(l)}pointCoordinate(e,i,o,l){return li(e,i,o,!0)||new t(0,0)}pointCoordinate3D(e,i,o){const l=this.pointCoordinate(e,i,o,0);return[l.x,l.y,l.z]}isPointAboveHorizon(e,i){return!li(e,i.x,i.y,!1)}farthestPixelDistance(e){const i=function(l,a){const h=l.cameraToCenterDistance,m=l._centerAltitude*a,g=l._camera,v=l._camera.forward(),p=Q.vec3.add([],Q.vec3.scale([],v,-h),[0,0,m]),y=l.worldSize/(2*Math.PI),w=[0,0,-y],x=l.width/l.height,b=Math.tan(l.fovAboveCenter),S=Q.vec3.scale([],g.up(),b),I=Q.vec3.scale([],g.right(),b*x),P=Q.vec3.normalize([],Q.vec3.add([],Q.vec3.add([],v,S),I)),O=[];let L;if(new Et(p,P).closestPointOnSphere(w,y,O)){const D=Q.vec3.add([],O,w),F=Q.vec3.sub([],D,p);L=Math.cos(l.fovAboveCenter)*Q.vec3.length(F)}else{const D=Q.vec3.sub([],p,w),F=Q.vec3.sub([],w,p);Q.vec3.normalize(F,F);const V=Q.vec3.length(D)-y;L=Math.sqrt(V*(V+2*y));const q=Math.acos(L/(y+V))-Math.acos(Q.vec3.dot(v,F));L*=Math.cos(q)}return 1.01*L}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),o=Gr(e.zoom);if(o>0){const l=H8(e,Tr(1,e.center.lat)*e.worldSize),a=e.worldSize/(2*Math.PI),h=Math.max(e.width,e.height)/e.worldSize*Math.PI;return St(i,l+a*(1-Math.cos(h)),Math.pow(o,10))}return i}upVector(e,i,o){return fi(i,o,e,1)}upVectorScale(e){return{metersToTile:ti(Ei(or(e)))}}}function J8(n){const e=n.parallels,i=!!e&&Math.abs(e[0]+e[1])<.01;switch(n.name){case"mercator":return new W8(n);case"equirectangular":return new Um(n);case"naturalEarth":return new Gm(n);case"equalEarth":return new Vm(n);case"winkelTripel":return new qm(n);case"albers":return i?new K8(n):new Nm(n);case"lambertConformalConic":return i?new K8(n):new jm(n);case"globe":return new $m(n)}throw new Error(`Invalid projection name: ${n.name}`)}const Hm=ba.VectorTileFeature.types,Zm=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Au(n,e,i,o,l,a,h,m,g,v,p,y,w){const x=m?Math.min(Sa,Math.round(m[0])):0,b=m?Math.min(Sa,Math.round(m[1])):0;n.emplaceBack(e,i,Math.round(32*o),Math.round(32*l),a,h,(x<<1)+(g?1:0),b,16*v,16*p,256*y,256*w)}function Iu(n,e,i){n.emplaceBack(e,i)}function Pu(n,e,i,o,l,a,h){n.emplaceBack(e,i,o,l,a,h)}function Cu(n,e,i,o,l){n.emplaceBack(e,i,o,l),n.emplaceBack(e,i,o,l),n.emplaceBack(e,i,o,l),n.emplaceBack(e,i,o,l)}function Wm(n){for(const e of n.sections)if(Vc(e.text))return!0;return!1}class k4{constructor(e){this.layoutVertexArray=new e1,this.indexArray=new _r,this.programConfigurations=e,this.segments=new ki,this.dynamicLayoutVertexArray=new gs,this.opacityVertexArray=new i1,this.placedSymbolArray=new Xc,this.iconTransitioningVertexArray=new Ho,this.globeExtVertexArray=new t1,this.zOffsetVertexArray=new _s}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0&&this.iconTransitioningVertexArray.length===0}upload(e,i,o,l,a){this.isEmpty()||(o&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,cm.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,hm.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Zm,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=e.createVertexBuffer(this.iconTransitioningVertexArray,pm.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,um.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||a)&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,dm.members,!0)),this.opacityVertexBuffer.itemSize=1),(o||l)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy())}}at(k4,"SymbolBuffers");class F4{constructor(e,i,o){this.layoutVertexArray=new e,this.layoutAttributes=i,this.indexArray=new o,this.segments=new ki,this.collisionVertexArray=new o1,this.collisionVertexArrayExt=new gs}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,fm.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,mm.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}at(F4,"CollisionBuffers");class zu{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.lut=e.lut,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(h=>h.fqid),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.hasAnyIconTextFit=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Q.mat4.identity([]),this.placementViewportMatrix=Q.mat4.identity([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=E4(this.zoom,i["text-size"]),this.iconSizeData=E4(this.zoom,i["icon-size"]);const o=this.layers[0].layout,l=o.get("symbol-sort-key"),a=o.get("symbol-z-order");this.canOverlap=o.get("text-allow-overlap")||o.get("icon-allow-overlap")||o.get("text-ignore-placement")||o.get("icon-ignore-placement"),this.sortFeaturesByKey=a!=="viewport-y"&&l.constantOr(1)!==void 0,this.sortFeaturesByY=(a==="viewport-y"||a==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=o.get("text-writing-mode").map(h=>un[h]),this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id),this.sourceID=e.sourceID,this.projection=e.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=!1,this.elevationType="none",this.elevationStateComplete=!1,this.activeReplacements=[],this.replacementUpdateTime=0}createArrays(){this.text=new k4(new Wo(this.layers,{zoom:this.zoom,lut:this.lut},e=>e.startsWith("text")||e.startsWith("symbol"))),this.icon=new k4(new Wo(this.layers,{zoom:this.zoom,lut:this.lut},e=>e.startsWith("icon")||e.startsWith("symbol"))),this.glyphOffsetArray=new Jc,this.lineVertexArray=new p0,this.symbolInstances=new Kc}calculateGlyphDependencies(e,i,o,l,a){for(const h of e){const m=h.codePointAt(0);if(m===void 0)break;if(i[m]=!0,l&&a&&m<=65535){const g=P1[h];g&&(i[g.charCodeAt(0)]=!0)}}}updateFootprints(e,i){}updateReplacement(e,i){if(i.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=i.updateTime;const o=i.getReplacementRegionsForTile(e.toUnwrapped(),!0);return!y4(this.activeReplacements,o)&&(this.activeReplacements=o,!0)}populate(e,i,o,l){const a=this.layers[0],h=a.layout,m=this.projection.name==="globe",g=h.get("text-font"),v=h.get("text-field"),p=h.get("icon-image"),[y,w]=h.get("icon-size-scale-range"),x=$t(i.scaleFactor||1,y,w),b=(v.value.kind!=="constant"||v.value.value instanceof Pr&&!v.value.value.isEmpty()||v.value.value.toString().length>0)&&(g.value.kind!=="constant"||g.value.value.length>0),S=p.value.kind!=="constant"||!!p.value.value||Object.keys(p.parameters).length>0,I=h.get("symbol-sort-key");if(this.features=[],!b&&!S)return;const P=i.iconDependencies,O=i.glyphDependencies,L=i.availableImages,D=new Ai(this.zoom);for(const{feature:F,id:V,index:q,sourceLayerIndex:J}of e){const X=a._featureFilter.needGeometry,Y=A(F,X);if(!a._featureFilter.filter(D,Y,o))continue;if(X||(Y.geometry=M(F,o,l)),m&&F.type!==1&&o.z<=5){const pe=Y.geometry,xe=.98078528056,ye=(Ee,we)=>{const Ae=fi(Ee.x,Ee.y,o,1),$e=fi(we.x,we.y,o,1);return Q.vec3.dot(Ae,$e)=0;for(const ye of le.sections)if(ye.image){const Ee=ye.image.getPrimary().scaleSelf(this.pixelRatio),we=Ee.id.toString(),Ae=P.get(we)||[];Ae.push(Ee),P.set(we,Ae)}else{const Ee=V3(le.toString()),we=ye.fontStack||pe,Ae=O[we]=O[we]||{};this.calculateGlyphDependencies(ye.text,Ae,xe,this.allowVerticalPlacement,Ee)}}}if(h.get("symbol-placement")==="line"&&(this.features=function(F){const V={},q={},J=[];let X=0;function Y(me){J.push(F[me]),X++}function le(me,pe,xe){const ye=q[me];return delete q[me],q[pe]=ye,J[ye].geometry[0].pop(),J[ye].geometry[0]=J[ye].geometry[0].concat(xe[0]),ye}function ee(me,pe,xe){const ye=V[pe];return delete V[pe],V[me]=ye,J[ye].geometry[0].shift(),J[ye].geometry[0]=xe[0].concat(J[ye].geometry[0]),ye}function ce(me,pe,xe){const ye=xe?pe[0][pe[0].length-1]:pe[0][0];return`${me}:${ye.x}:${ye.y}`}for(let me=0;meme.geometry)}(this.features)),h.get("symbol-elevation-reference")==="hd-road-markup"){if(this.elevationType="road",i.elevationFeatures){!this.elevationFeatures&&i.elevationFeatures.length>0&&(this.elevationFeatures=[],this.elevationFeatureIdToIndex=new Map);for(const F of i.elevationFeatures)this.elevationFeatureIdToIndex.set(F.id,this.elevationFeatures.length),this.elevationFeatures.push(F)}}else h.get("symbol-z-elevate")&&(this.elevationType="offset");this.elevationType!=="none"&&(this.zOffsetBuffersNeedUpload=!0),this.sortFeaturesByKey&&this.features.sort((F,V)=>F.sortKey-V.sortKey)}update(e,i,o,l,a,h,m){this.text.programConfigurations.updatePaintArrays(e,i,a,o,l,h,m),this.icon.programConfigurations.updatePaintArrays(e,i,a,o,l,h,m)}updateRoadElevation(){if(this.elevationType!=="road"||!this.elevationFeatures||this.elevationStateComplete)return;this.elevationStateComplete=!0,this.hasAnyZOffset=!1;let e=!1;for(let i=0;i{o+=h,o>a.length&&a.resize(o);for(let g=-h;g<0;g++)a.emplace(g+o,m)},i=(a,h,m)=>{l+=h,l>a.length&&a.resize(l);for(let g=-h;g<0;g++)a.emplace(g+l,m)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let o=0,l=0;for(let a=0;a0;if((m>0||g>0)&&(e(this.text.zOffsetVertexArray,m,p),e(this.text.zOffsetVertexArray,g,p)),y){const{placedIconSymbolIndex:w,verticalPlacedIconSymbolIndex:x}=h;w>=0&&i(this.icon.zOffsetVertexArray,v,p),x>=0&&i(this.icon.zOffsetVertexArray,h.numVerticalIconVertices,p)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=J8(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,i){const o=this.lineVertexArray.length;if(e.segment!==void 0)for(const{x:l,y:a}of i)this.lineVertexArray.emplaceBack(l,a);return{lineStartIndex:o,lineLength:this.lineVertexArray.length-o}}addSymbols(e,i,o,l,a,h,m,g,v,p,y,w,x,b,S,I){const P=e.indexArray,O=e.layoutVertexArray,L=e.globeExtVertexArray,D=e.segments.prepareSegment(4*i.length,O,P,this.canOverlap?h.sortKey:void 0),F=this.glyphOffsetArray.length,V=D.vertexLength,q=this.allowVerticalPlacement&&m===un.vertical?Math.PI/2:0,J=h.text&&h.text.sections;for(let Y=0;Y=0?i.rightJustifiedTextSymbolIndex:i.centerJustifiedTextSymbolIndex>=0?i.centerJustifiedTextSymbolIndex:i.leftJustifiedTextSymbolIndex>=0?i.leftJustifiedTextSymbolIndex:i.verticalPlacedTextSymbolIndex>=0?i.verticalPlacedTextSymbolIndex:l),h=yu(this.textSizeData,e,a)/Er;return this.tilePixelRatio*h}getSymbolInstanceIconSize(e,i,o){const l=this.icon.placedSymbolArray.get(o),a=yu(this.iconSizeData,e,l);return this.tilePixelRatio*a}_commitDebugCollisionVertexUpdate(e,i,o,l){e.emplaceBack(i,-o,-o,l),e.emplaceBack(i,o,-o,l),e.emplaceBack(i,o,o,l),e.emplaceBack(i,-o,o,l)}_updateTextDebugCollisionBoxes(e,i,o,l,a,h,m){for(let g=l;g0}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}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(e,i){const o=e.placedSymbolArray.get(i),l=o.vertexStartIndex+4*o.numGlyphs;for(let a=o.vertexStartIndex;al[m]-l[g]||a[g]-a[m]),h}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let e=0;ethis.symbolInstances.get(i).zOffset-this.symbolInstances.get(e).zOffset)}addToSortKeyRanges(e,i){const o=this.sortKeyRanges[this.sortKeyRanges.length-1];o&&o.sortKey===i?o.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const i of this.symbolInstanceIndexes){const o=this.symbolInstances.get(i);this.featureSortOrder.push(o.featureIndex);const{rightJustifiedTextSymbolIndex:l,centerJustifiedTextSymbolIndex:a,leftJustifiedTextSymbolIndex:h,verticalPlacedTextSymbolIndex:m,placedIconSymbolIndex:g,verticalPlacedIconSymbolIndex:v}=o;l>=0&&this.addIndicesForPlacedSymbol(this.text,l),a>=0&&a!==l&&this.addIndicesForPlacedSymbol(this.text,a),h>=0&&h!==a&&h!==l&&this.addIndicesForPlacedSymbol(this.text,h),m>=0&&this.addIndicesForPlacedSymbol(this.text,m),g>=0&&this.addIndicesForPlacedSymbol(this.icon,g),v>=0&&this.addIndicesForPlacedSymbol(this.icon,v)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Q8,e2,B4;at(zu,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),zu.addDynamicAttributes=Cu;class t2{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Ns,this.defaultValue=e}evaluate(e){if(e.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(e.formattedSection))return i.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}at(t2,"FormatSectionOverride",{omit:["defaultValue"]});const N4=()=>B4||(B4={layout:Q8||(Q8=new Gi({"symbol-placement":new Ye(Ie.layout_symbol["symbol-placement"]),"symbol-spacing":new Ye(Ie.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ye(Ie.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new st(Ie.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ye(Ie.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new Ye(Ie.layout_symbol["symbol-z-elevate"]),"symbol-elevation-reference":new Ye(Ie.layout_symbol["symbol-elevation-reference"]),"icon-allow-overlap":new Ye(Ie.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Ye(Ie.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ye(Ie.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ye(Ie.layout_symbol["icon-rotation-alignment"]),"icon-size":new st(Ie.layout_symbol["icon-size"]),"icon-size-scale-range":new Ye(Ie.layout_symbol["icon-size-scale-range"]),"icon-text-fit":new st(Ie.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new st(Ie.layout_symbol["icon-text-fit-padding"]),"icon-image":new st(Ie.layout_symbol["icon-image"]),"icon-rotate":new st(Ie.layout_symbol["icon-rotate"]),"icon-padding":new Ye(Ie.layout_symbol["icon-padding"]),"icon-keep-upright":new Ye(Ie.layout_symbol["icon-keep-upright"]),"icon-offset":new st(Ie.layout_symbol["icon-offset"]),"icon-anchor":new st(Ie.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ye(Ie.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ye(Ie.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ye(Ie.layout_symbol["text-rotation-alignment"]),"text-field":new st(Ie.layout_symbol["text-field"]),"text-font":new st(Ie.layout_symbol["text-font"]),"text-size":new st(Ie.layout_symbol["text-size"]),"text-size-scale-range":new Ye(Ie.layout_symbol["text-size-scale-range"]),"text-max-width":new st(Ie.layout_symbol["text-max-width"]),"text-line-height":new st(Ie.layout_symbol["text-line-height"]),"text-letter-spacing":new st(Ie.layout_symbol["text-letter-spacing"]),"text-justify":new st(Ie.layout_symbol["text-justify"]),"text-radial-offset":new st(Ie.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ye(Ie.layout_symbol["text-variable-anchor"]),"text-anchor":new st(Ie.layout_symbol["text-anchor"]),"text-max-angle":new Ye(Ie.layout_symbol["text-max-angle"]),"text-writing-mode":new Ye(Ie.layout_symbol["text-writing-mode"]),"text-rotate":new st(Ie.layout_symbol["text-rotate"]),"text-padding":new Ye(Ie.layout_symbol["text-padding"]),"text-keep-upright":new Ye(Ie.layout_symbol["text-keep-upright"]),"text-transform":new st(Ie.layout_symbol["text-transform"]),"text-offset":new st(Ie.layout_symbol["text-offset"]),"text-allow-overlap":new Ye(Ie.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Ye(Ie.layout_symbol["text-ignore-placement"]),"text-optional":new Ye(Ie.layout_symbol["text-optional"]),visibility:new Ye(Ie.layout_symbol.visibility)})),paint:e2||(e2=new Gi({"icon-opacity":new st(Ie.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new st(Ie.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new st(Ie.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new st(Ie.paint_symbol["text-emissive-strength"]),"icon-color":new st(Ie.paint_symbol["icon-color"]),"icon-halo-color":new st(Ie.paint_symbol["icon-halo-color"]),"icon-halo-width":new st(Ie.paint_symbol["icon-halo-width"]),"icon-halo-blur":new st(Ie.paint_symbol["icon-halo-blur"]),"icon-translate":new Ye(Ie.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ye(Ie.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new st(Ie.paint_symbol["icon-image-cross-fade"]),"text-opacity":new st(Ie.paint_symbol["text-opacity"]),"text-occlusion-opacity":new st(Ie.paint_symbol["text-occlusion-opacity"]),"text-color":new st(Ie.paint_symbol["text-color"],{runtimeType:Ir,getOverride:n=>n.textColor,hasOverride:n=>!!n.textColor}),"text-halo-color":new st(Ie.paint_symbol["text-halo-color"]),"text-halo-width":new st(Ie.paint_symbol["text-halo-width"]),"text-halo-blur":new st(Ie.paint_symbol["text-halo-blur"]),"text-translate":new Ye(Ie.paint_symbol["text-translate"]),"text-translate-anchor":new Ye(Ie.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new Ye(Ie.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new Ye(Ie.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new Ye(Ie.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new Ye(Ie.paint_symbol["icon-color-brightness-max"]),"symbol-z-offset":new st(Ie.paint_symbol["symbol-z-offset"]),"icon-color-use-theme":new st({type:"string",default:"default","property-type":"data-driven"}),"icon-halo-color-use-theme":new st({type:"string",default:"default","property-type":"data-driven"}),"text-color-use-theme":new st({type:"string",default:"default","property-type":"data-driven"}),"text-halo-color-use-theme":new st({type:"string",default:"default","property-type":"data-driven"})}))},B4);class Ru extends fr{constructor(e,i,o,l){super(e,N4(),i,o,l),this._colorAdjustmentMatrix=Q.mat4.identity([]),this.hasInitialOcclusionOpacityProperties=e.paint!==void 0&&("icon-occlusion-opacity"in e.paint||"text-occlusion-opacity"in e.paint)}recalculate(e,i){super.recalculate(e,i),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"));const o=this.layout.get("text-writing-mode");if(o){const l=[];for(const a of o)l.indexOf(a)<0&&l.push(a);this.layout._values["text-writing-mode"]=l}else this.layout._values["text-writing-mode"]=this.layout.get("symbol-placement")==="point"?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getColorAdjustmentMatrix(e,i,o,l){return this._saturation===e&&this._contrast===i&&this._brightnessMin===o&&this._brightnessMax===l||(this._colorAdjustmentMatrix=function(a,h,m,g){a=Oe(a),h=Va(h);const v=Q.mat4.create(),p=a/3,y=1-2*p,w=[y,p,p,0,p,y,p,0,p,p,y,0,0,0,0,1],x=.5-.5*h,b=g-m;return Q.mat4.multiply(v,[b,0,0,0,0,b,0,0,0,0,b,0,m,m,m,1],[h,0,0,0,0,h,0,0,0,0,h,0,x,x,x,1]),Q.mat4.multiply(v,v,w),v}(e,i,o,l),this._saturation=e,this._contrast=i,this._brightnessMin=o,this._brightnessMax=l),this._colorAdjustmentMatrix}getValueAndResolveTokens(e,i,o,l){const a=this.layout.get(e).evaluate(i,{},o,l),h=this._unevaluatedLayout._values[e];return h.isDataDriven()||ll(h.value)||!a?a:function(m,g){return g.replace(/{([^{}]+)}/g,(v,p)=>p in m?String(m[p]):"")}(i.properties,a)}createBucket(e){return new zu(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of N4().paint.overridableProperties){if(!Ru.hasPaintOverride(this.layout,e))continue;const i=this.paint.get(e),o=new t2(i),l=new O3(o,i.property.specification,this.scope,this.options);let a=null;a=i.value.kind==="constant"||i.value.kind==="source"?new k3("source",l):new ra("composite",l,i.value.zoomStops,i.value._interpolationType),this.paint._values[e]=new la(i.property,a,i.parameters)}}_handleOverridablePaintPropertyUpdate(e,i,o){return!(!this.layout||i.isDataDriven()||o.isDataDriven())&&Ru.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,i){const o=e.get("text-field"),l=N4().paint.properties[i];let a=!1;const h=m=>{for(const g of m)if(l.overrides&&l.overrides.hasOverride(g))return void(a=!0)};if(o.value.kind==="constant"&&o.value.value instanceof Pr)h(o.value.value.sections);else if(o.value.kind==="source"){const m=v=>{a||(v instanceof no&&ir(v.value)===Ga?h(v.value.sections):v instanceof Gs?h(v.sections):v.eachChild(m))},g=o.value;g._styleExpression&&m(g._styleExpression.expression)}return a}getProgramIds(){return["symbol"]}getDefaultProgramParams(e,i,o){return{config:new xs(this,{zoom:i,lut:o}),overrideFog:!1}}}let i2,r2,n2,o2;var V4=hi([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);function U4(n){switch(n){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.RGBA;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.DEPTH_COMPONENT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.DEPTH_STENCIL;case WebGL2RenderingContext.R8:case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.RED}}function j4(n){switch(n){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.UNSIGNED_SHORT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.UNSIGNED_INT_24_8;case WebGL2RenderingContext.R8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.FLOAT}}class G4{constructor(e,i,o,l){this.context=e,this.format=o,this.useMipmap=l&&l.useMipmap,this.texture=e.gl.createTexture(),this.update(i,{premultiply:l&&l.premultiply})}update(e,i){const o=e&&e instanceof HTMLVideoElement&&e.width===0?e.videoWidth:e.width,l=e&&e instanceof HTMLVideoElement&&e.height===0?e.videoHeight:e.height,{context:a}=this,{gl:h}=a,{x:m,y:g}=i&&i.position?i.position:{x:0,y:0},v=m+o,p=g+l;!this.size||this.size[0]===v&&this.size[1]===p||(h.bindTexture(h.TEXTURE_2D,null),h.deleteTexture(this.texture),this.texture=h.createTexture(),this.size=null),h.bindTexture(h.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===h.RGBA8&&(!i||i.premultiply!==!1));const y=e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||ImageBitmap&&e instanceof ImageBitmap;if(!this.size&&v>0&&p>0){const w=this.useMipmap?Math.floor(Math.log2(Math.max(v,p)))+1:1;h.texStorage2D(h.TEXTURE_2D,w,this.format,v,p),this.size=[v,p]}if(this.size)if(y)h.texSubImage2D(h.TEXTURE_2D,0,m,g,U4(this.format),j4(this.format),e);else{const w=e.data;w&&h.texSubImage2D(h.TEXTURE_2D,0,m,g,o,l,U4(this.format),j4(this.format),w)}this.useMipmap&&h.generateMipmap(h.TEXTURE_2D)}bind(e,i,o=!1){const{context:l}=this,{gl:a}=l;a.bindTexture(a.TEXTURE_2D,this.texture),e!==this.minFilter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,this.useMipmap&&!o?e===a.NEAREST?a.NEAREST_MIPMAP_NEAREST:a.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),i!==this.wrapS&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,i),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,i),this.wrapS=i)}bindExtraParam(e,i,o,l){const{context:a}=this,{gl:h}=a;h.bindTexture(h.TEXTURE_2D,this.texture),i!==this.magFilter&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,i),this.magFilter=i),e!==this.minFilter&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,this.useMipmap?e===h.NEAREST?h.NEAREST_MIPMAP_NEAREST:h.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),o!==this.wrapS&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,o),this.wrapS=o),l!==this.wrapT&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,l),this.wrapT=l)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class Du{constructor(e,i){this.context=e,this.texture=i}bind(e,i){const{context:o}=this,{gl:l}=o;l.bindTexture(l.TEXTURE_2D,this.texture),e!==this.minFilter&&(l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,e),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,e),this.minFilter=e),i!==this.wrapS&&(l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,i),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,i),this.wrapS=i)}}function Lu(n,e,i,o,l,a,h,m){const g=[n,e,1,i,o,1,l,a,1],v=[h,m,1],p=Q.mat3.adjoint([],g),[y,w,x]=Q.vec3.transformMat3(v,v,p);return Q.mat3.multiply(g,g,[y,0,0,0,w,0,0,0,x])}function s2(n,e,i,o,l,a,h,m){const g=function(v,p,y,w,x,b,S,I){const P=Lu(0,0,1,0,1,1,0,1),O=Lu(v,p,y,w,x,b,S,I),L=Q.mat3.adjoint([],P);return Q.mat3.multiply(O,O,L)}(n,e,i,o,l,a,h,m);return[g[2]/g[8]/Je,g[5]/g[8]/Je]}function Ou(n){return[n[0],Math.min(Math.max(n[1],-Yi),Yi)]}class a2 extends Cn{constructor(e,i,o,l){super(),this.id=e,this.dispatcher=o,this.coordinates=i.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.onNorthPole=!1,this.onSouthPole=!1,this.setEventedParent(l),this.options=i,this._dirty=!1}load(e,i){if(this._loaded=i||!1,this.fire(new Zr("dataloading",{dataType:"source"})),this.url=this.options.url,!this.url)return e&&(this.coordinates=e),this._loaded=!0,void this._finishLoading();this._imageRequest=r3(this.map._requestManager.transformRequest(this.url,dr.Image),(o,l)=>{this._imageRequest=null,this._loaded=!0,o?this.fire(new Bs(o)):l&&(this.image=l instanceof HTMLImageElement?Le.getImageData(l):l,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,e&&(this.coordinates=e),this._finishLoading())})}loaded(){return this._loaded}updateImage(e){return e.url?(this._imageRequest&&e.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=e.url,this.load(e.coordinates,this._loaded),this):this}setTexture(e){if(!(e.handle instanceof WebGLTexture))throw new Error("The provided handle is not a WebGLTexture instance");return this.texture=new Du(this.map.painter.context,e.handle),this.width=e.dimensions[0],this.height=e.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new Zr("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(e){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),!this.texture||this.texture instanceof Du||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy())}setCoordinates(e){if(this.coordinates=e,this._boundsArray=void 0,this._unsupportedCoords=!1,!e.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let i=e[0][1],o=e[0][1];for(const a of e)a[1]>o&&(o=a[1]),a[1]Yi?this.onNorthPole=!0:l<-Yi&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){const a=e.map(t.fromLngLat);this.tileID=function(h){let m=1/0,g=1/0,v=-1/0,p=-1/0;for(const S of h)m=Math.min(m,S.x),g=Math.min(g,S.y),v=Math.max(v,S.x),p=Math.max(p,S.y);const y=Math.max(v-m,p-g),w=Math.max(0,Math.floor(-Math.log(y)/Math.LN2)),x=Math.pow(2,w);let b=Math.floor((m+v)/2*x);return b>1&&(b-=1),new je(w,b,Math.floor((g+p)/2*x))}(a),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new Zr("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0,this._unsupportedCoords=!1}_prepareData(e){for(const P in this.tiles){const O=this.tiles[P];O.state!=="loaded"&&(O.state="loaded",O.texture=this.texture)}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;const i=L1(new je(0,0,0),this.map.transform.projection),o=[i.projection.project(this.coordinates[0][0],this.coordinates[0][1]),i.projection.project(this.coordinates[1][0],this.coordinates[1][1]),i.projection.project(this.coordinates[2][0],this.coordinates[2][1]),i.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(!function(P){const O=P[1].x-P[0].x,L=P[1].y-P[0].y,D=P[2].x-P[1].x,F=P[2].y-P[1].y,V=P[3].x-P[2].x,q=P[3].y-P[2].y,J=P[0].x-P[3].x,X=P[0].y-P[3].y,Y=O*F-D*L,le=D*q-V*F,ee=V*X-J*q,ce=J*L-O*X;return Y>0&&le>0&&ee>0&&ce>0||Y<0&&le<0&&ee<0&&ce<0}(o))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=!0);const l=L1(this.tileID,this.map.transform.projection),[a,h,m,g]=this.coordinates.map(P=>{const O=l.projection.project(P[0],P[1]);return Z8(l,O)._round()});this.perspectiveTransform=s2(a.x,a.y,h.x,h.y,m.x,m.y,g.x,g.y);const v=this._boundsArray=new mo;v.emplaceBack(a.x,a.y,0,0),v.emplaceBack(h.x,h.y,Je,0),v.emplaceBack(g.x,g.y,0,Je),v.emplaceBack(m.x,m.y,Je,Je),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=e.createVertexBuffer(v,V4.members),this.boundsSegments=ki.simpleSegment(0,0,4,2);const p=[],y=[Ou((w=this.coordinates)[0]),Ou(w[1]),Ou(w[2]),Ou(w[3])];var w;const[x,b,S,I]=function(P){let O=P[0][0],L=O,D=P[0][1],F=D;for(let V=1;VL&&(L=P[V][0]),P[V][1]F&&(F=P[V][1]);return[O,D,L-O,F-D]}(y);{const P=new mo,[O,L,D,F]=function(ye){let Ee=ye[0].x,we=Ee,Ae=ye[0].y,$e=Ae;for(let Ge=1;Gewe&&(we=ye[Ge].x),ye[Ge].y$e&&($e=ye[Ge].y);return[Ee,Ae,we-Ee,$e-Ae]}(o),V=ye=>[(ye.x-O)/D,(ye.y-L)/F],[q,J,X,Y]=o.map(V),le=function(ye,Ee,we,Ae,$e,Ge,lt,Ze){const Ke=Lu(0,0,1,0,1,1,0,1),He=Lu(ye,Ee,we,Ae,$e,Ge,lt,Ze),wt=Q.mat3.adjoint([],He);return Q.mat3.multiply(Ke,Ke,wt)}(q[0],q[1],J[0],J[1],X[0],X[1],Y[0],Y[1]);this.elevatedGlobePerspectiveTransform=s2(q[0],q[1],J[0],J[1],X[0],X[1],Y[0],Y[1]);const ee=(ye,Ee)=>{p.push(ye.lng);const we=Math.round((ye.lng-x)/S*Je),Ae=Math.round((ye.lat-b)/I*Je),$e=V(Ee),Ge=Q.vec3.transformMat3([],[$e[0],$e[1],1],le),lt=Math.round(Ge[0]/Ge[2]*Je),Ze=Math.round(Ge[1]/Ge[2]*Je);P.emplaceBack(we,Ae,lt,Ze)},ce=o[3].x-o[0].x,me=o[3].y-o[0].y,pe=o[2].x-o[1].x,xe=o[2].y-o[1].y;for(let ye=0;ye<65;ye++){const Ee=ye/64,we=[o[0].x+Ee*ce,o[0].y+Ee*me],Ae=[o[1].x+Ee*pe,o[1].y+Ee*xe],$e=Ae[0]-we[0],Ge=Ae[1]-we[1];for(let lt=0;lt<65;lt++){const Ze=lt/64,Ke={x:we[0]+$e*Ze,y:we[1]+Ge*Ze,z:0};ee(i.projection.unproject(Ke.x,Ke.y),Ke)}}this.elevatedGlobeVertexBuffer=e.createVertexBuffer(P,V4.members)}{this.maxLongitudeTriangleSize=0;let P=[],O=new _r;const L=(D,F,V)=>{O.emplaceBack(D,F,V);const q=p[D],J=p[F],X=p[V],Y=Math.min(Math.min(q,J),X),le=Math.max(Math.max(q,J),X)-Y;le>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=le),P.push(Y+le/2)};for(let D=0;D<64;D++)for(let F=0;F<64;F++){const V=65*D+F,q=V+1,J=V+65,X=J+1;L(V,J,q),L(q,J,X)}[P,O]=function(D,F){const V=Array.from({length:D.length},(X,Y)=>Y);V.sort((X,Y)=>D[X]-D[Y]);const q=[],J=new _r;for(let X=0;X{h.segments.push({vertexOffset:0,primitiveOffset:y,vertexLength:i.segments[0].vertexLength,primitiveLength:w,sortKey:void 0,vaos:{}})},g=.51*this.maxLongitudeTriangleSize;if(Math.abs(o[0]-l)<=g){const y=B0(o,0,o.length,l+g);return y===o.length||m(y,F0(o,y+1,o.length,l+360-g)-y),h}l0){const a=function(h,m){const g=m.worldSize,v=Tr(1,0)*g*Yo(m.center.lat,m.zoom)/Xn(g),p=Tr(1,m.center.lat)*g,y=Q.mat4.identity([]);return Q.mat4.rotateY(y,y,ri(m.center.lng)),Q.mat4.rotateX(y,y,ri(m.center.lat)),Q.mat4.translate(y,y,[0,0,Fr]),Q.mat4.scale(y,y,[v,v,v*p]),Q.mat4.translate(y,y,[m.point.x-.5*g,m.point.y-.5*g,0]),Q.mat4.multiply(y,y,h),Q.mat4.multiply(y,m.globeMatrix,y)}(n,e);return function(h,m,g){const v=(b,S,I)=>{const P=Q.vec3.length(b),O=Q.vec3.length(S),L=ar(b,S,I);return Q.vec3.scale(L,L,1/Q.vec3.length(L)*St(P,O,I))},p=v([h[0],h[1],h[2]],[m[0],m[1],m[2]],g),y=v([h[4],h[5],h[6]],[m[4],m[5],m[6]],g),w=v([h[8],h[9],h[10]],[m[8],m[9],m[10]],g),x=ar([h[12],h[13],h[14]],[m[12],m[13],m[14]],g);return[p[0],p[1],p[2],0,y[0],y[1],y[2],0,w[0],w[1],w[2],0,x[0],x[1],x[2],1]}(l,a,o)}return l}function x2(n,e,i,o){const l=mt.projectAabbCorners(o,i);let a=Number.MAX_VALUE,h=-1;for(let v=0;vnew Qe(l[v][0],l[v][1]);let g;switch(h){case 0:case 6:g=[m(1),m(5),m(4),m(7),m(3),m(2),m(1)];break;case 1:case 7:g=[m(0),m(4),m(5),m(6),m(2),m(3),m(0)];break;case 3:case 5:g=[m(1),m(0),m(4),m(7),m(6),m(2),m(1)];break;default:g=[m(1),m(5),m(6),m(7),m(3),m(0),m(1)]}if(j(n,g))return a}const Km=hi([{name:"a_pos_3f",components:3,type:"Float32"}]),Jm=hi([{name:"a_color_3f",components:3,type:"Float32"}]),Qm=hi([{name:"a_color_4f",components:4,type:"Float32"}]),e7=hi([{name:"a_uv_2f",components:2,type:"Float32"}]),t7=hi([{name:"a_normal_3f",components:3,type:"Float32"}]),i7=hi([{name:"a_normal_matrix0",components:4,type:"Float32"},{name:"a_normal_matrix1",components:4,type:"Float32"},{name:"a_normal_matrix2",components:4,type:"Float32"},{name:"a_normal_matrix3",components:4,type:"Float32"}]),r7=hi([{name:"a_pbr",components:4,type:"Uint16"},{name:"a_heightBasedEmissiveStrength",components:3,type:"Float32"}]),v2={None:0,Model:1,Symbol:2,FillExtrusion:4,All:7};class Bu{constructor(e,i,o,l){this.message=(e?`${e}: `:"")+o,l&&(this.identifier=l),i!=null&&i.__line__&&(this.line=i.__line__)}}function b2(n,e){const i=n.indexOf("://")===-1;try{return new URL(n,i&&e?"http://example.com":void 0),!0}catch{return!1}}class w2{constructor(e,i){this.feature=e,this.instancedDataOffset=i,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class T2{constructor(){this.instancedDataArray=new Ml,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}}class Z4{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.fqid),this.projection=e.projection,this.index=e.index,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.hasPattern=!1,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0},this.modelUris=[],this.modelsRequested=!1,this.activeReplacements=[],this.replacementUpdateTime=0}updateFootprints(e,i){}populate(e,i,o,l){this.tileToMeter=u(o);const a=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);for(const{feature:h,id:m,index:g,sourceLayerIndex:v}of e){const p=m??(h.properties&&h.properties.hasOwnProperty("id")?h.properties.id:void 0),y=A(h,a);if(!this.layers[0]._featureFilter.filter(new Ai(this.zoom),y,o))continue;const w={id:p,sourceLayerIndex:v,index:g,geometry:a?y.geometry:M(h,o,l),properties:h.properties,type:h.type,patterns:{}},x=this.addFeature(w,w.geometry,y);x&&i.featureIndex.insert(h,w.geometry,g,v,this.index,this.instancesPerModel[x].instancedDataArray.length,Je/32)}this.lookup=null}update(e,i,o,l){for(const a in this.instancesPerModel){const h=this.instancesPerModel[a];for(const m in e)h.idToFeaturesIndex.hasOwnProperty(m)&&(this.evaluate(h.features[h.idToFeaturesIndex[m]],e[m],h,!0),this.uploaded=!1)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return!1;let e=!1;for(const i in this.instancesPerModel){const o=this.instancesPerModel[i];for(const l of o.features){const a=this.layers[0],h=l.feature,m=this.canonical,g=a.paint.get("model-rotation").evaluate(h,{},m),v=a.paint.get("model-scale").evaluate(h,{},m),p=a.paint.get("model-translation").evaluate(h,{},m);Q.vec3.exactEquals(l.rotation,g)&&Q.vec3.exactEquals(l.scale,v)&&Q.vec3.exactEquals(l.translation,p)||(this.evaluate(l,l.featureStates,o,!0),e=!0)}}return e}updateReplacement(e,i,o,l){if(i.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=i.updateTime;const a=i.getReplacementRegionsForTile(e.toUnwrapped(),!0);if(y4(this.activeReplacements,a))return!1;this.activeReplacements=a;let h=!1;for(const m in this.instancesPerModel){const g=this.instancesPerModel[m],v=g.instancedDataArray;for(const p of g.features){const y=p.instancedDataOffset,w=p.instancedDataCount;for(let x=0;xJe;S=I?S-Je:S;const P=Math.floor(S),O=v.float32[b+1];let L=!1;for(const D of this.activeReplacements)if(!Rp(D,o,v2.Model,l)&&!(D.min.x>P||P>D.max.x||D.min.y>O||O>D.max.y)&&(L=Bp(Fp(P,O,e.canonical,D.footprintTileId.canonical),D.footprint),L))break;v.float32[b]=L?S+Je:S,h=h||L!==I}}}return h}isEmpty(){for(const e in this.instancesPerModel)if(this.instancesPerModel[e].instancedDataArray.length!==0)return!1;return!0}uploadPending(){return!this.uploaded}upload(e){if(!this.uploaded)for(const i in this.instancesPerModel){const o=this.instancesPerModel[i];o.instancedDataArray.length<0||o.instancedDataArray.length===0||(o.instancedDataBuffer?o.instancedDataBuffer.updateData(o.instancedDataArray):o.instancedDataBuffer=e.createVertexBuffer(o.instancedDataArray,i7.members,!0,void 0,this.instanceCount))}this.uploaded=!0}destroy(){for(const i in this.instancesPerModel){const o=this.instancesPerModel[i];o.instancedDataArray.length!==0&&o.instancedDataBuffer&&o.instancedDataBuffer.destroy()}const e=this.layers[0].modelManager;if(e&&this.modelUris)for(const i of this.modelUris)e.removeModel(i,"")}addFeature(e,i,o){const l=this.layers[0],a=l.layout.get("model-id").evaluate(o,{},this.canonical);if(!a)return ji(`modelId is not evaluated for layer ${l.id} and it is not going to get rendered.`),a;b2(a,!1)&&(this.modelUris.includes(a)||this.modelUris.push(a)),this.instancesPerModel[a]||(this.instancesPerModel[a]=new T2);const h=this.instancesPerModel[a],m=h.instancedDataArray,g=new w2(o,m.length);for(const v of i)for(const p of v){if(p.x<0||p.x>=Je||p.y<0||p.y>=Je)continue;const y=(this.lookupDim-1)/Je,w=this.lookupDim*(p.y*y|0)+p.x*y|0;if(this.lookup){if(this.lookup[w]!==0)continue;this.lookup[w]=1}this.instanceCount++;const x=m.length;m.resize(x+1),h.instancesEvaluatedElevation.push(0),m.float32[16*x]=p.x,m.float32[16*x+1]=p.y}return g.instancedDataCount=h.instancedDataArray.length-g.instancedDataOffset,g.instancedDataCount>0&&(e.id&&(h.idToFeaturesIndex[e.id]=h.features.length),h.features.push(g),this.evaluate(g,{},h,!1)),a}getModelUris(){return this.modelUris}evaluate(e,i,o,l){const a=this.layers[0],h=e.feature,m=this.canonical,g=e.rotation=a.paint.get("model-rotation").evaluate(h,i,m),v=e.scale=a.paint.get("model-scale").evaluate(h,i,m),p=e.translation=a.paint.get("model-translation").evaluate(h,i,m),y=a.paint.get("model-color").evaluate(h,i,m);y.a=a.paint.get("model-color-mix-intensity").evaluate(h,i,m);const w=[];this.maxVerticalOffset10?this.tileToMeter:u(m,L)),P[I+4]=p[0],P[I+5]=p[1],P[I+6]=p[2]+O,P[I+7]=w[0],P[I+8]=w[1],P[I+9]=w[2],P[I+10]=w[4],P[I+11]=w[5],P[I+12]=w[6],P[I+13]=w[8],P[I+14]=w[9],P[I+15]=w[10],o.instancesEvaluatedElevation[S]=p[2]}}}let S2,E2;at(Z4,"ModelBucket",{omit:["layers"]}),at(T2,"PerModelAttributes"),at(w2,"ModelFeature");const M0=64,Ul={CoordinateSpaceTile:1,CoordinateSpaceYUp:2,HasMapboxMeshFeatures:4,HasMeshoptCompression:8};function M2(n,e,i,o,l,a,h,m,g,v=!1){const p=i.zoom,y=i.project(o),w=Yo(o.lat,p),x=1/w;Q.mat4.identity(n),Q.mat4.translate(n,n,[y.x+h[0]*x,y.y+h[1]*x,h[2]]);let b=1,S=1;const I=i.worldSize;if(v){if(i.projection.name==="mercator"){let D=0;i.elevation&&(D=i.elevation.getAtPointOrZero(new t(y.x/I,y.y/I),0));const F=Q.vec4.transformMat4([],[y.x,y.y,D,1],i.projMatrix)[3]/i.cameraToCenterDistance;b=F,S=F*Yo(i.center.lat,p)}else if(i.projection.name==="globe"){const D=H4(n,i),F=Q.mat4.multiply([],i.projMatrix,D),V=[0,0,0,1];Q.vec4.transformMat4(V,V,F);const q=V[3]/i.cameraToCenterDistance,J=Gr(p),X=i.projection.pixelsPerMeter(o.lat,I)*Yo(o.lat,p),Y=i.projection.pixelsPerMeter(i.center.lat,I)*Yo(i.center.lat,p);b=q/St(X,au(i.center.lat),J),S=q*w/X,b*=Y,S*=Y}}else b=x;Q.mat4.scale(n,n,[b,b,S]);const P=[...n],O=e.orientation,L=[];if(y2(L,[O[0]+l[0],O[1]+l[1],O[2]+l[2]],a),Q.mat4.multiply(n,P,L),m&&i.elevation){let D=0;const F=[];if(g&&i.elevation){D=function(J,X,Y,le,ee){const ce=X.elevation;if(!ce)return 0;const me=mt.projectAabbCorners(Y,le),pe=Tr(1,ee.lat)*X.worldSize,xe=function(wt,rt){const pt=[0,0,1],Mt=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(const jt of Mt){const Ct=wt[jt.corners[0]],Wt=wt[jt.corners[1]],Vt=wt[jt.corners[2]],Yt=[Wt[0]-Ct[0],Wt[1]-Ct[1],rt*(Wt[2]-Ct[2])],ci=Q.vec3.cross(Yt,Yt,[Vt[0]-Ct[0],Vt[1]-Ct[1],rt*(Vt[2]-Ct[2])]);Q.vec3.normalize(ci,ci),jt.dotProductWithUp=Q.vec3.dot(ci,pt)}return Mt.sort((jt,Ct)=>jt.dotProductWithUp-Ct.dotProductWithUp),Mt[0].corners}(me,pe),ye=me[xe[0]],Ee=me[xe[1]],we=me[xe[2]],Ae=me[xe[3]],$e=ce.getAtPointOrZero(new t(ye[0]/X.worldSize,ye[1]/X.worldSize),0),Ge=ce.getAtPointOrZero(new t(Ee[0]/X.worldSize,Ee[1]/X.worldSize),0),lt=ce.getAtPointOrZero(new t(we[0]/X.worldSize,we[1]/X.worldSize),0),Ze=ce.getAtPointOrZero(new t(Ae[0]/X.worldSize,Ae[1]/X.worldSize),0),Ke=($e+Ze)/2,He=(Ge+lt)/2;return Ke>He?Ge=e.gl.NEAREST_MIPMAP_NEAREST}),n.uploaded=!0,n.image=null)}function n7(n,e,i){n.indexBuffer=e.createIndexBuffer(n.indexArray,!1,!0),n.vertexBuffer=e.createVertexBuffer(n.vertexArray,Km.members,!1,!0),n.normalArray&&(n.normalBuffer=e.createVertexBuffer(n.normalArray,t7.members,!1,!0)),n.texcoordArray&&(n.texcoordBuffer=e.createVertexBuffer(n.texcoordArray,e7.members,!1,!0)),n.colorArray&&(n.colorBuffer=e.createVertexBuffer(n.colorArray,(n.colorArray.bytesPerElement===12?Jm:Qm).members,!1,!0)),n.featureArray&&(n.pbrBuffer=e.createVertexBuffer(n.featureArray,r7.members,!0)),n.segments=ki.simpleSegment(0,0,n.vertexArray.length,n.indexArray.length);const o=n.material;o.pbrMetallicRoughness.baseColorTexture&&N1(o.pbrMetallicRoughness.baseColorTexture,e),o.pbrMetallicRoughness.metallicRoughnessTexture&&N1(o.pbrMetallicRoughness.metallicRoughnessTexture,e),o.normalTexture&&N1(o.normalTexture,e),o.occlusionTexture&&N1(o.occlusionTexture,e,i),o.emissionTexture&&N1(o.emissionTexture,e)}function W4(n,e,i){if(n.meshes)for(const o of n.meshes)n7(o,e,i);if(n.children)for(const o of n.children)W4(o,e,i)}function Nu(n){if(n.meshes)for(const e of n.meshes)e.indexArray.destroy(),e.vertexArray.destroy(),e.colorArray&&e.colorArray.destroy(),e.normalArray&&e.normalArray.destroy(),e.texcoordArray&&e.texcoordArray.destroy(),e.featureArray&&e.featureArray.destroy();if(n.children)for(const e of n.children)Nu(e)}function X4(n){if(n.meshes)for(const i of n.meshes)i.vertexBuffer&&(i.vertexBuffer.destroy(),i.indexBuffer.destroy(),i.normalBuffer&&i.normalBuffer.destroy(),i.texcoordBuffer&&i.texcoordBuffer.destroy(),i.colorBuffer&&i.colorBuffer.destroy(),i.pbrBuffer&&i.pbrBuffer.destroy(),i.segments.destroy(),i.material&&((e=i.material).pbrMetallicRoughness.baseColorTexture&&e.pbrMetallicRoughness.baseColorTexture.gfxTexture&&e.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),e.pbrMetallicRoughness.metallicRoughnessTexture&&e.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&e.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),e.normalTexture&&e.normalTexture.gfxTexture&&e.normalTexture.gfxTexture.destroy(),e.emissionTexture&&e.emissionTexture.gfxTexture&&e.emissionTexture.gfxTexture.destroy(),e.occlusionTexture&&e.occlusionTexture.gfxTexture&&e.occlusionTexture.gfxTexture.destroy()));var e;if(n.children)for(const i of n.children)X4(i)}class jl{constructor(e,i,o){this._demTile=e,this._dem=this._demTile.dem,this._scale=i,this._offset=o}static create(e,i,o){const l=o||e.findDEMTileFor(i);if(!l||!l.dem)return;const a=l.dem,h=l.tileID,m=1<g.fqid),this.stateDependentLayerIds=this.layers.filter(g=>g.isStateDependent()).map(g=>g.id),this.modelTraits|=Ul.CoordinateSpaceTile,this.uploaded=!1,this.hasPattern=!1,l&&(this.modelTraits|=Ul.HasMapboxMeshFeatures),a&&(this.modelTraits|=Ul.HasMeshoptCompression),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=h,this.dirty=!0,this.needsUpload=!1,this.filter=null,this.nodesInfo=[];for(const g of i)this.nodesInfo.push(new C2(g)),I2(g,m.featureIndexArray.length,m.grid),m.featureIndexArray.emplaceBack(this.nodesInfo.length-1,0,m.bucketLayerIDs.length-1,0);this.states={}}updateFootprints(e,i){for(const o of this.getNodesInfo()){const l=o.node;l.footprint&&i.push({footprint:l.footprint,id:e})}}update(e){const i=Object.keys(e).length!==0;if(i&&!this.stateDependentLayers.length)return;const o=i?this.stateDependentLayers:this.layers;if(!In(e,this.states))for(const l of o)this.evaluate(l,e);this.states=structuredClone(e)}populate(){console.log("populate 3D model bucket")}uploadPending(){return!this.uploaded||this.needsUpload}upload(e){if(!this.needsUpload)return;const i=this.getNodesInfo();for(const o of i){const l=o.node;this.uploaded?this.updatePbrBuffer(l):W4(l,e,!0)}for(const o of i)Nu(o.node);this.uploaded=!0,this.needsUpload=!1}updatePbrBuffer(e){let i=!1;if(!e.meshes)return i;for(const o of e.meshes)o.pbrBuffer&&(o.pbrBuffer.updateData(o.featureArray),i=!0);return i}needsReEvaluation(e,i,o){const l=e.transform.projectionOptions,a=e.style.getBrightness(),h=this.brightness!==a;if(!this.uploaded||this.dirty||l.name!==this.projection.name||V1(o.paint.get("model-color").value,h)||V1(o.paint.get("model-color-mix-intensity").value,h)||V1(o.paint.get("model-roughness").value,h)||V1(o.paint.get("model-emissive-strength").value,h)||V1(o.paint.get("model-height-based-emissive-strength-multiplier").value,h)){this.projection=l,this.brightness=a;const m=this.getNodesInfo();for(const g of m)g.state=null;return!0}return!1}evaluateScale(e,i){if(e.transform.zoom===this.zoom)return;this.zoom=e.transform.zoom;const o=this.getNodesInfo(),l=this.id.canonical;for(const a of o){const h=a.feature;a.evaluatedScale=i.paint.get("model-scale").evaluate(h,{},l)}}evaluate(e,i){const o=this.getNodesInfo();for(const l of o){if(!l.node.meshes)continue;const a=l.feature,h=i&&i[a.id];if(In(h,l.state))continue;l.state=structuredClone(h);const m=l.node.meshes&&l.node.meshes[0].featureData,g=l.evaluatedColor[2],v=l.evaluatedRMEA[2],p=this.id.canonical;if(l.hasTranslucentParts=!1,m){for(let y=0;y=V)continue;const ye=Y4[xe],Ee=Math.abs(ye);Ee>le&&(Y=ye,le=Ee,ee=pe,ce=me)}if(le>.1){const me=1-(V+.5*Math.abs(ee*ce))/b;let pe=i._dem.get(J,q)+Y*me;const xe=i._dem.get(J+ee,q+ce),ye=i._dem.get(J-ee,q-ce,!0);(pe-xe)*(pe-ye)>0&&(pe=(xe+ye)/2),Y4[X]=i._dem.set(J,q,pe),A0[X]=V}}}}}m&&(i._demTile.needsDEMTextureUpload=!0,i._dem._timestamp=Le.now())}setFilter(e){this.filter=e?X3(e):null}getNodesInfo(){return this.filter?this.nodesInfo.filter(e=>this.filter.filter(new Ai(this.id.overscaledZ),e.feature,this.id.canonical)):this.nodesInfo}destroy(){const e=this.getNodesInfo();for(const i of e)Nu(i.node),X4(i.node)}isEmpty(){return!this.nodesInfo.length}updateReplacement(e,i){if(i.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=i.updateTime;const o=i.getReplacementRegionsForTile(e.toUnwrapped()),l=this.getNodesInfo();for(let a=0;am.footprint===h.footprint)}}getHeightAtTileCoord(e,i){const o=this.getNodesInfo(),l=[],a=[0,0,0],h=Q.mat4.identity([]);for(let m=0;mp.max[0]||i>p.max[1])continue;if(g.node.hidden===!0)return{height:1/0,maxHeight:g.feature.properties.height,hidden:!1,verticalScale:g.evaluatedScale[2]};Q.mat4.invert(h,g.node.matrix),a[0]=e,a[1]=i,Q.vec3.transformMat4(a,a,h);const y=(a[0]-v.aabb.min[0])/(v.aabb.max[0]-v.aabb.min[0])*M0|0,w=Math.min(63,(a[1]-v.aabb.min[1])/(v.aabb.max[1]-v.aabb.min[1])*M0|0)*M0+Math.min(63,y),x=v.heightmap[w];if(!(x<0&&g.node.footprint))return g.hiddenByReplacement?void 0:{height:x,maxHeight:g.feature.properties.height,hidden:!1,verticalScale:g.evaluatedScale[2]};if(g.node.footprint.grid.query(new Qe(e,i),new Qe(e,i),l),l.length>0)return{height:void 0,maxHeight:g.feature.properties.height,hidden:g.hiddenByReplacement,verticalScale:g.evaluatedScale[2]}}}}function V1(n,e){return!n.isLightConstant&&e}function o7(n,e,i,o,l,a,h,m){let g=(61440&e|(61440&e)>>4)>>8,v=(3840&e|(3840&e)>>4)>>4,p=240&e|(240&e)>>4;i[3]>0&&(g=St(g,255*i[0],i[3]),v=St(v,255*i[1],i[3]),p=St(p,255*i[2],i[3]));const y=g<<8|v,w=p<<8|Math.floor(255*o[3]),x=function(V){const q=$t(V,0,2);return Math.min(Math.round(.5*q*255),255)}(o[2])<<8|15*o[0]<<4|15*o[1],b=$t(l[0],0,1),S=$t(l[1],0,1),I=$t(l[2],0,1),P=$t(l[3],0,1);let O,L,D,F;if(b!==S&&h!==a&&S!==b){const V=h-a;L=1/(V*(S-b)),D=-(a+V*b)/(V*(S-b));const q=$t(l[4],-1,1);F=Math.pow(10,q),O=255*I<<8|255*P}else O=65535,L=0,D=1,F=1;if(n.emplaceBack(y,w,x,O,L,D,F),m){const V=m.length;m.clear();for(let q=0;q>16&65535,p=a?g>>16&65535:65535&g,y=(15&p)<8?15&p:0,w=n.evaluatedRMEA[y],x=n.evaluatedColor[y],b=n.emissionHeightBasedParams[y];let S;if(m&&y===2&&o.lights&&(S=new Al,S.resize(10*o.lights.length)),o7(h.featureArray,v,x,w,b,h.aabb.min[2],h.aabb.max[2],S),S&&m){m=!1;const I=o.meshes[o.lightMeshIndex];I.featureArray=S,I.featureArray._trim()}}h.featureArray._trim(),l++}}function z2(n,e,i,o){const l=1<D.polygon).flat());const I=x?m:null,[P,O]=function(D,F,V,q,J,X,Y,le,ee,ce,me){return D.projection.name==="globe"?function(pe,xe,ye,Ee,we,Ae,$e,Ge,lt,Ze,Ke){const He=[],wt=[],rt=pe.projection.upVectorScale(Ke,pe.center.lat,pe.worldSize).metersToTile,pt=[0,0,0,1],Mt=[0,0,0,1],jt=(Wt,Vt,Yt,ci)=>{Wt[0]=Vt,Wt[1]=Yt,Wt[2]=ci,Wt[3]=1},Ct=Kp();ye>0&&(ye+=Ct),Ee+=Ct;for(const Wt of xe){const Vt=[],Yt=[];for(const ci of Wt){const Ii=ci.x+we.x,It=ci.y+we.y,ii=pe.projection.projectTilePoint(Ii,It,Ke),Li=pe.projection.upVector(Ke,ci.x,ci.y);let Ni=ye,qi=Ee;if($e){const Hi=i8(Ii,It,ye,Ee,$e,Ge,lt,Ze);Ni+=Hi.base,qi+=Hi.top}ye!==0?jt(pt,ii.x+Li[0]*rt*Ni,ii.y+Li[1]*rt*Ni,ii.z+Li[2]*rt*Ni):jt(pt,ii.x,ii.y,ii.z),jt(Mt,ii.x+Li[0]*rt*qi,ii.y+Li[1]*rt*qi,ii.z+Li[2]*rt*qi),Q.vec3.transformMat4(pt,pt,Ae),Q.vec3.transformMat4(Mt,Mt,Ae),Vt.push(new E0(pt[0],pt[1],pt[2])),Yt.push(new E0(Mt[0],Mt[1],Mt[2]))}He.push(Vt),wt.push(Yt)}return[He,wt]}(D,F,V,q,J,X,Y,le,ee,ce,me):Y?function(pe,xe,ye,Ee,we,Ae,$e,Ge,lt){const Ze=[],Ke=[],He=[0,0,0,1];for(const wt of pe){const rt=[],pt=[];for(const Mt of wt){const jt=Mt.x+Ee.x,Ct=Mt.y+Ee.y,Wt=i8(jt,Ct,xe,ye,Ae,$e,Ge,lt);He[0]=jt,He[1]=Ct,He[2]=Wt.base,He[3]=1,Q.vec4.transformMat4(He,He,we),He[3]=Math.max(He[3],1e-5);const Vt=new E0(He[0]/He[3],He[1]/He[3],He[2]/He[3]);He[0]=jt,He[1]=Ct,He[2]=Wt.top,He[3]=1,Q.vec4.transformMat4(He,He,we),He[3]=Math.max(He[3],1e-5);const Yt=new E0(He[0]/He[3],He[1]/He[3],He[2]/He[3]);rt.push(Vt),pt.push(Yt)}Ze.push(rt),Ke.push(pt)}return[Ze,Ke]}(F,V,q,J,X,Y,le,ee,ce):function(pe,xe,ye,Ee,we){const Ae=[],$e=[],Ge=we[8]*xe,lt=we[9]*xe,Ze=we[10]*xe,Ke=we[11]*xe,He=we[8]*ye,wt=we[9]*ye,rt=we[10]*ye,pt=we[11]*ye;for(const Mt of pe){const jt=[],Ct=[];for(const Wt of Mt){const Vt=Wt.x+Ee.x,Yt=Wt.y+Ee.y,ci=we[0]*Vt+we[4]*Yt+we[12],Ii=we[1]*Vt+we[5]*Yt+we[13],It=we[2]*Vt+we[6]*Yt+we[14],ii=we[3]*Vt+we[7]*Yt+we[15],Li=ci+Ge,Ni=Ii+lt,qi=It+Ze,Hi=Math.max(ii+Ke,1e-5),Mi=ci+He,cr=Ii+wt,qr=It+rt,er=Math.max(ii+pt,1e-5);jt.push(new E0(Li/Hi,Ni/Hi,qi/Hi)),Ct.push(new E0(Mi/er,cr/er,qr/er))}Ae.push(jt),$e.push(Ct)}return[Ae,$e]}(F,V,q,J,X)}(a,o,y,p,v,h,I,w,b,a.center.lat,n.tileID.canonical),L=n.queryGeometry;return function(D,F,V){let q=1/0;G(V,F)&&(q=t8(V,F[0]));for(let J=0;J{if(I1)return I1;const i=d8();return I1=new lm(i.paint.properties["line-width"].specification),I1.useIntegerZoom=!0,I1})().possiblyEvaluate(this._transitioningPaint._values["line-width"].value,n)}createBucket(n){return new w4(n)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getDefaultProgramParams(n,e,i){const o=u8(this);return{config:new xs(this,{zoom:e,lut:i}),defines:o,overrideFog:!1}}queryRadius(n){const e=n,i=p8(Se("line-width",this,e),Se("line-gap-width",this,e)),o=Se("line-offset",this,e);return i/2+Math.abs(o)+Ve(this.paint.get("line-translate"))}queryIntersectsFeature(n,e,i,o,l,a){if(n.queryGeometry.isAboveHorizon)return!1;const h=Ue(n.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,n.pixelToTileUnitsFactor),m=n.pixelToTileUnitsFactor/2*p8(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),g=this.paint.get("line-offset").evaluate(e,i);return g&&(o=function(v,p){const y=[],w=new Qe(0,0);for(let x=0;x=3){for(let b=0;b{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(){this._channel=void 0,this._callback=()=>{}}}class c7{constructor(){this.tasks={},this.taskQueue=[],Fa(["process"],this),this.invoker=new l7(this.process),this.nextId=0}add(e,i){const o=this.nextId++,l=function({type:a,isSymbolTile:h,zoom:m}){return m=m||0,a==="message"?0:a!=="maybePrepare"||h?a!=="parseTile"||h?a==="parseTile"&&h?300-m:a==="maybePrepare"&&h?400-m:500:200-m:100-m}(i);if(l===0){try{e()}finally{}return null}return this.tasks[o]={fn:e,metadata:i,priority:l,id:o},this.taskQueue.push(o),this.invoker.trigger(),{cancel:()=>{delete this.tasks[o]}}}process(){try{if(this.taskQueue=this.taskQueue.filter(o=>!!this.tasks[o]),!this.taskQueue.length)return;const e=this.pick();if(e===null)return;const i=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!i)return;i.fn()}finally{}}pick(){let e=null,i=1/0;for(let l=0;l{o&&delete this.callbacks[m],this.target.postMessage({id:m,type:"",targetMapId:l,sourceMapId:this.mapId})}}}receive(e){const i=e.data;if(!i)return;const o=i.id;if(o&&(!i.targetMapId||this.mapId===i.targetMapId))if(i.type===""){const l=this.cancelCallbacks[o];delete this.cancelCallbacks[o],l&&l.cancel()}else if(i.mustQueue||Vr()){const l=this.callbacks[o],a=this.scheduler.add(()=>this.processTask(o,i),l&&l.metadata||{type:"message"});a&&(this.cancelCallbacks[o]=a)}else this.processTask(o,i)}processTask(e,i){if(delete this.cancelCallbacks[e],i.type===""){const o=this.callbacks[e];delete this.callbacks[e],o&&(i.error?o(sn(i.error)):o(null,sn(i.data)))}else{const o=new Set,l=i.hasCallback?(h,m)=>{this.target.postMessage({id:e,type:"",sourceMapId:this.mapId,error:h?jo(h):null,data:jo(m,o)},o)}:()=>{},a=sn(i.data);if(this.parent[i.type])this.parent[i.type](i.sourceMapId,a,l);else if(this.parent.getWorkerSource){const h=i.type.split(".");this.parent.getWorkerSource(i.sourceMapId,h[0],a.source,a.scope)[h[1]](a,l)}else l(new Error(`Could not find function ${i.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}}var U1={workerUrl:"",workerClass:null,workerParams:void 0};const K4="mapboxgl_preloaded_worker_pool";class I0{constructor(){this.active={}}acquire(e,i=I0.workerCount){if(!this.workers)for(this.workers=[];this.workers.length{i.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[K4]}numActive(){return Object.keys(this.active).length}}I0.workerCount=2;class Gl{constructor(e,i,o="Worker",l=I0.workerCount){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=jn();const a=this.workerPool.acquire(this.id,l);for(let h=0;h{this.ready=!0})}broadcast(e,i,o){ns(this.actors,(l,a)=>{l.send(e,i,a)},o=o||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(e=>{e.remove()}),this.actors=[],this.workerPool.release(this.id)}}let j1,J4;function Uu(){return j1||(j1=new I0),j1}Gl.Actor=R2;const Q4=new bi(0,0,0);var ed=(n=>(n[n.PATH_RULE_UNSPECIFIED=0]="PATH_RULE_UNSPECIFIED",n[n.PATH_RULE_NON_ZERO=1]="PATH_RULE_NON_ZERO",n[n.PATH_RULE_EVEN_ODD=2]="PATH_RULE_EVEN_ODD",n))(ed||{}),ju=(n=>(n[n.LINE_CAP_UNSPECIFIED=0]="LINE_CAP_UNSPECIFIED",n[n.LINE_CAP_BUTT=1]="LINE_CAP_BUTT",n[n.LINE_CAP_ROUND=2]="LINE_CAP_ROUND",n[n.LINE_CAP_SQUARE=3]="LINE_CAP_SQUARE",n))(ju||{}),G1=(n=>(n[n.LINE_JOIN_UNSPECIFIED=0]="LINE_JOIN_UNSPECIFIED",n[n.LINE_JOIN_MITER=1]="LINE_JOIN_MITER",n[n.LINE_JOIN_MITER_CLIP=2]="LINE_JOIN_MITER_CLIP",n[n.LINE_JOIN_ROUND=3]="LINE_JOIN_ROUND",n[n.LINE_JOIN_BEVEL=4]="LINE_JOIN_BEVEL",n))(G1||{}),D2=(n=>(n[n.PAINT_ORDER_UNSPECIFIED=0]="PAINT_ORDER_UNSPECIFIED",n[n.PAINT_ORDER_FILL_AND_STROKE=1]="PAINT_ORDER_FILL_AND_STROKE",n[n.PAINT_ORDER_STROKE_AND_FILL=2]="PAINT_ORDER_STROKE_AND_FILL",n))(D2||{}),ql=(n=>(n[n.PATH_COMMAND_UNSPECIFIED=0]="PATH_COMMAND_UNSPECIFIED",n[n.PATH_COMMAND_MOVE=1]="PATH_COMMAND_MOVE",n[n.PATH_COMMAND_LINE=2]="PATH_COMMAND_LINE",n[n.PATH_COMMAND_QUAD=3]="PATH_COMMAND_QUAD",n[n.PATH_COMMAND_CUBIC=4]="PATH_COMMAND_CUBIC",n[n.PATH_COMMAND_CLOSE=5]="PATH_COMMAND_CLOSE",n))(ql||{}),L2=(n=>(n[n.MASK_TYPE_UNSPECIFIED=0]="MASK_TYPE_UNSPECIFIED",n[n.MASK_TYPE_LUMINANCE=1]="MASK_TYPE_LUMINANCE",n[n.MASK_TYPE_ALPHA=2]="MASK_TYPE_ALPHA",n))(L2||{});function u7(n,e,i){n===1&&e.icons.push(function(o,l){return function(a){if(a.usvg_tree.height||(a.usvg_tree.height=a.usvg_tree.width),!a.metadata)return a;const{metadata:h}=a;if(h.content_area){const{content_area:m}=h;m.top==null&&(m.top=m.left),m.width==null&&(m.width=a.usvg_tree.width),m.height==null&&(m.height=m.width)}return h.stretch_x&&h.stretch_x.length&&O2(h,"x"),h.stretch_y&&h.stretch_y.length&&O2(h,"y"),a}(o.readFields(h7,{name:void 0},l))}(i,i.readVarint()+i.pos))}function O2(n,e){const i=[],o=n[`stretch_${e}`];let l=null;for(let a=0;a>16&255)/255,(n>>8&255)/255,(255&n)/255,1)}function b7(n,e,i){n===1?(e.rgb_color=$u(i.readVarint()),e.paint="rgb_color"):n===2?(e.linear_gradient_idx=i.readVarint(),e.paint="linear_gradient_idx"):n===3?(e.radial_gradient_idx=i.readVarint(),e.paint="radial_gradient_idx"):n===5?i.readPackedFloat(e.dasharray):n===6?e.dashoffset=i.readFloat():n===7?e.miterlimit=i.readFloat():n===8?e.opacity=i.readVarint():n===9?e.width=i.readFloat():n===10?e.linecap=i.readVarint():n===11&&(e.linejoin=i.readVarint())}function w7(n,e,i){n===1?e.transform=qu(i,i.readVarint()+i.pos):n===2?e.spread_method=i.readVarint():n===3?e.stops.push(k2(i,i.readVarint()+i.pos)):n===4?e.x1=i.readFloat():n===5?e.y1=i.readFloat():n===6?e.x2=i.readFloat():n===7&&(e.y2=i.readFloat())}function k2(n,e){return n.readFields(T7,{offset:0,opacity:255,rgb_color:Q4},e)}function T7(n,e,i){n===1?e.offset=i.readFloat():n===2?e.opacity=i.readVarint():n===3&&(e.rgb_color=$u(i.readVarint()))}function S7(n,e,i){n===1?e.transform=qu(i,i.readVarint()+i.pos):n===2?e.spread_method=i.readVarint():n===3?e.stops.push(k2(i,i.readVarint()+i.pos)):n===4?e.cx=i.readFloat():n===5?e.cy=i.readFloat():n===6?e.r=i.readFloat():n===7?e.fx=i.readFloat():n===8?e.fy=i.readFloat():n===9&&(e.fr=i.readFloat())}function E7(n,e,i){n===1?e.transform=qu(i,i.readVarint()+i.pos):n===2?e.clip_path_idx=i.readVarint():n===3&&e.children.push(Gu(i,i.readVarint()+i.pos))}function M7(n,e,i){n===1?e.left=e.top=i.readFloat():n===2?e.width=e.height=i.readFloat():n===3?e.top=i.readFloat():n===4?e.height=i.readFloat():n===5?e.mask_type=i.readVarint():n===6?e.mask_idx=i.readVarint():n===7&&e.children.push(Gu(i,i.readVarint()+i.pos))}class A7{static calculate(e={},i=[]){const o=new Map,l=new Map;if(Object.keys(e).length===0)return o;i.forEach(a=>{l.set(a.name,a.rgb_color||new bi(0,0,0))});for(const[a,h]of Object.entries(e))l.has(a)?o.set(l.get(a).toStringPremultipliedAlpha(),h):console.warn(`Ignoring unknown image variable "${a}"`);return o}}function $l(n,e=255,i){const o=e/255,l=n.toStringPremultipliedAlpha(),a=i.has(l)?i.get(l).clone():n.clone();return a.a*=o,a.toString()}function q1(n,e){if(!Fe()){const i=document.createElement("canvas");return i.width=n,i.height=e,i}return new OffscreenCanvas(n,e)}function I7(n,e){const i=A7.calculate(e.params,n.metadata?n.metadata.variables:[]),o=n.usvg_tree,l=o.width,a=o.height,h=e.transform?e.transform:new DOMMatrix,m=Math.max(1,Math.round(l*h.a)),g=Math.max(1,Math.round(a*h.d)),v=new DOMMatrix([m/l,0,0,g/a,0,0]),p=q1(m,g).getContext("2d");return td(p,v,o,o,i),p.getImageData(0,0,m,g)}function td(n,e,i,o,l){for(const a of o.children)F2(n,e,i,a,l)}function F2(n,e,i,o,l){o.group?(n.save(),function(a,h,m,g,v){const p=g.mask_idx!=null?m.masks[g.mask_idx]:null,y=g.clip_path_idx!=null?m.clip_paths[g.clip_path_idx]:null;if(g.transform&&(h=Hu(g.transform).preMultiplySelf(h)),!function(b,S,I){return b.opacity!==255||S||I}(g,y!=null,p!=null))return void td(a,h,m,g,v);const w=q1(a.canvas.width,a.canvas.height),x=w.getContext("2d");td(x,h,m,g,v),y&&q2(x,h,m,y),p&&$2(x,h,m,p,v),a.globalAlpha=g.opacity/255,a.drawImage(w,0,0)}(n,e,i,o.group,l),n.restore()):o.path&&(n.save(),function(a,h,m,g,v){const p=H2(g);a.setTransform(h),g.paint_order===D2.PAINT_ORDER_FILL_AND_STROKE?(B2(a,m,g,p,v),V2(a,m,g,p,v)):(V2(a,m,g,p,v),B2(a,m,g,p,v))}(n,e,i,o.path,l),n.restore())}function B2(n,e,i,o,l){const a=i.fill;if(!a)return;const h=a.opacity/255;switch(a.paint){case"rgb_color":n.fillStyle=$l(a.rgb_color,a.opacity,l);break;case"linear_gradient_idx":n.fillStyle=U2(n,e.linear_gradients[a.linear_gradient_idx],h,l);break;case"radial_gradient_idx":n.fillStyle=j2(n,e.radial_gradients[a.radial_gradient_idx],h,l)}n.fill(o,N2(i))}function N2(n){return n.rule===ed.PATH_RULE_NON_ZERO?"nonzero":n.rule===ed.PATH_RULE_EVEN_ODD?"evenodd":void 0}function V2(n,e,i,o,l){const a=i.stroke;if(!a)return;n.lineWidth=a.width,n.miterLimit=a.miterlimit,n.setLineDash(a.dasharray),n.lineDashOffset=a.dashoffset;const h=a.opacity/255;switch(a.paint){case"rgb_color":n.strokeStyle=$l(a.rgb_color,a.opacity,l);break;case"linear_gradient_idx":n.strokeStyle=U2(n,e.linear_gradients[a.linear_gradient_idx],h,l);break;case"radial_gradient_idx":n.strokeStyle=j2(n,e.radial_gradients[a.radial_gradient_idx],h,l)}switch(a.linejoin){case G1.LINE_JOIN_MITER_CLIP:case G1.LINE_JOIN_MITER:n.lineJoin="miter";break;case G1.LINE_JOIN_ROUND:n.lineJoin="round";break;case G1.LINE_JOIN_BEVEL:n.lineJoin="bevel"}switch(a.linecap){case ju.LINE_CAP_BUTT:n.lineCap="butt";break;case ju.LINE_CAP_ROUND:n.lineCap="round";break;case ju.LINE_CAP_SQUARE:n.lineCap="square"}n.stroke(o)}function U2(n,e,i,o){if(e.stops.length===1){const w=e.stops[0];return $l(w.rgb_color,w.opacity*i,o)}const l=Hu(e.transform),{x1:a,y1:h,x2:m,y2:g}=e,v=l.transformPoint(new DOMPoint(a,h)),p=l.transformPoint(new DOMPoint(m,g)),y=n.createLinearGradient(v.x,v.y,p.x,p.y);for(const w of e.stops)y.addColorStop(w.offset,$l(w.rgb_color,w.opacity*i,o));return y}function j2(n,e,i,o){if(e.stops.length===1){const w=e.stops[0];return $l(w.rgb_color,w.opacity*i,o)}const l=Hu(e.transform),{fx:a,fy:h,cx:m,cy:g}=e,v=l.transformPoint(new DOMPoint(a,h)),p=l.transformPoint(new DOMPoint(m,g)),y=n.createRadialGradient(v.x,v.y,0,p.x,p.y,e.r*((l.a+l.d)/2));for(const w of e.stops)y.addColorStop(w.offset,$l(w.rgb_color,w.opacity*i,o));return y}function G2(n,e,i,o){const l=o.transform?Hu(o.transform).preMultiplySelf(e):e,a=q1(n.canvas.width,n.canvas.height),h=a.getContext("2d");for(const g of o.children)if(g.group)G2(h,l,i,g.group);else if(g.path){const v=g.path,p=new Path2D;p.addPath(H2(v),l),h.fill(p,N2(v))}const m=o.clip_path_idx!=null?i.clip_paths[o.clip_path_idx]:null;m&&q2(h,l,i,m),n.globalCompositeOperation="source-over",n.drawImage(a,0,0)}function q2(n,e,i,o){const l=q1(n.canvas.width,n.canvas.height);G2(l.getContext("2d"),e,i,o),n.globalCompositeOperation="destination-in",n.drawImage(l,0,0)}function $2(n,e,i,o,l){if(o.children.length===0)return;const a=o.mask_idx!=null?i.masks[o.mask_idx]:null;a&&$2(n,e,i,a,l);const h=n.canvas.width,m=n.canvas.height,g=q1(h,m),v=g.getContext("2d"),p=o.width,y=o.height,w=o.left,x=o.top,b=new Path2D,S=new Path2D;S.rect(w,x,p,y),b.addPath(S,e),v.clip(b);for(const O of o.children)F2(v,e,i,O,l);const I=v.getImageData(0,0,h,m),P=I.data;if(o.mask_type===L2.MASK_TYPE_LUMINANCE)for(let O=0;Oe[h])return null}else{const m=1/o[h];let g=(n[h]-i[h])*m,v=(e[h]-i[h])*m;if(g>v){const p=g;g=v,v=p}if(g>l&&(l=g),va)return null}return l}function X2(n,e,i,o,l,a,h,m,g,v,p){const y=o-n,w=l-e,x=a-i,b=h-n,S=m-e,I=g-i,P=p[1]*I-p[2]*S,O=p[2]*b-p[0]*I,L=p[0]*S-p[1]*b,D=y*P+w*O+x*L;if(Math.abs(D)<1e-15)return null;const F=1/D,V=v[0]-n,q=v[1]-e,J=v[2]-i,X=(V*P+q*O+J*L)*F;if(X<0||X>1)return null;const Y=q*x-J*w,le=J*y-V*x,ee=V*w-q*y,ce=(p[0]*Y+p[1]*le+p[2]*ee)*F;return ce<0||X+ce>1?null:(b*Y+S*le+I*ee)*F}function Y2(n,e,i){return(n-e)/(i-e)}function K2(n,e,i,o,l,a,h,m,g){const v=1<{const O=I?1:0,L=(x+1)*S-O,D=b*S,F=(b+1)*S-O;P[0]=x*S,P[1]=D,P[2]=L,P[3]=F};let y=new Z2(g);const w=[];for(let x=0;x=1;g/=2){const x=m[m.length-1];y=new Z2(g);for(let b=0;b0;){const{idx:b,t:S,nodex:I,nodey:P,depth:O}=x.pop();if(this.leaves[b]){K2(I,P,O,e,i,o,l,y,w);const D=1<=xe[2])return S}continue}let L=0;for(let D=0;D=v[p[J]]&&(p.splice(J,0,D),q=!0);q||(p[L]=D),L++}}for(let D=0;D=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(e+1)}static pack(e,i){const o=[0,0,0,0],l=Wu.getUnpackVector(i);let a=Math.floor((e+l[3])/l[2]);return o[2]=a%256,a=Math.floor(a/256),o[1]=a%256,a=Math.floor(a/256),o[0]=a,o}getPixels(){return new lp({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,i,o){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let l=i*this.dim,a=i*this.dim+this.dim,h=o*this.dim,m=o*this.dim+this.dim;switch(i){case-1:l=a-1;break;case 1:a=l+1}switch(o){case-1:h=m-1;break;case 1:m=h+1}const g=-i*this.dim,v=-o*this.dim;for(let p=h;p=1;o--){const l=o===1?1:0,a=o===2?1:0;for(let h=0;h>>1^-(1&n[e]);return n}function j7(n,e){switch(e){case"uint32":return n;case"uint16":for(let i=0;i>4|(61440&o)>>8|(240&l)<<4|61440&l,n[i+1]=15&o|(3840&o)>>4|(15&l)<<8|(3840&l)<<4}return n;case"uint8":for(let i=0;i>6|(192&l)>>4|(192&a)>>2|192&h,n[i+1]=(48&o)>>4|(48&l)>>2|48&a|(48&h)<<2,n[i+2]=(12&o)>>2|12&l|(12&a)<<2|(12&h)<<4,n[i+3]=3&o|(3&l)<<2|(3&a)<<4|(3&h)<<6}return n;default:throw new Error(`Invalid pixel format, "${e}"`)}}at(Wu,"DEMData"),at(J2,"DemMinMaxQuadTree",{omit:["dem"]});var kn=Uint8Array,$1=Uint16Array,G7=Int32Array,ef=new kn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),tf=new kn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),q7=new kn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rf=function(n,e){for(var i=new $1(31),o=0;o<31;++o)i[o]=e+=1<>1|(21845&rr)<<1;sf[rr]=((65280&(Hl=(61680&(Hl=(52428&Hl)>>2|(13107&Hl)<<2))>>4|(3855&Hl)<<4))>>8|(255&Hl)<<8)>>1}var H1=function(n,e,i){for(var o=n.length,l=0,a=new $1(e);l>g]=v;return h},Z1=new kn(288);for(rr=0;rr<144;++rr)Z1[rr]=8;for(rr=144;rr<256;++rr)Z1[rr]=9;for(rr=256;rr<280;++rr)Z1[rr]=7;for(rr=280;rr<288;++rr)Z1[rr]=8;var af=new kn(32);for(rr=0;rr<32;++rr)af[rr]=5;var Z7=H1(Z1,9),W7=H1(af,5),rd=function(n){for(var e=n[0],i=1;ie&&(e=n[i]);return e},wo=function(n,e,i){var o=e/8|0;return(n[o]|n[o+1]<<8)>>(7&e)&i},nd=function(n,e){var i=e/8|0;return(n[i]|n[i+1]<<8|n[i+2]<<16)>>(7&e)},X7=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],To=function(n,e,i){var o=new Error(e||X7[n]);if(o.code=n,Error.captureStackTrace&&Error.captureStackTrace(o,To),!i)throw o;return o},Y7=new kn(0),K7=typeof TextDecoder<"u"&&new TextDecoder;try{K7.decode(Y7,{stream:!0})}catch{}const J7={gzip_data:"gzip"};class Kn extends Error{constructor(e){super(e),this.name="MRTError"}}const Q7={0:"uint32",1:"uint32",2:"uint16",3:"uint8"},lf={uint32:1,uint16:2,uint8:4},e_={uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array};let od;class Xu{constructor(e=5){this.x=NaN,this.y=NaN,this.z=NaN,this.layers={},this._cacheSize=e}getLayer(e){const i=this.layers[e];if(!i)throw new Kn(`Layer '${e}' not found`);return i}getHeaderLength(e){const i=new Uint8Array(e),o=new DataView(e);if(i[0]!==13)throw new Kn("File is not a valid MRT.");return o.getUint32(1,!0)}parseHeader(e){const i=new Uint8Array(e),o=this.getHeaderLength(e);if(i.length= ${o} but got buffer of length ${i.length}`);const l=function(a,h){return a.readFields(R7,{headerLength:0,x:0,y:0,z:0,layers:[]},void 0)}(new od(i.subarray(0,o)));if(!isNaN(this.x)&&(this.x!==l.x||this.y!==l.y||this.z!==l.z))throw new Kn(`Invalid attempt to parse header ${l.z}/${l.x}/${l.y} for tile ${this.z}/${this.x}/${this.y}`);this.x=l.x,this.y=l.y,this.z=l.z;for(const a of l.layers)this.layers[a.name]=new cf(a,{cacheSize:this._cacheSize});return this}createDecodingTask(e){const i=[],o=this.getLayer(e.layerName);for(let l of e.blockIndices){const a=o.dataIndex[l],h=a.firstByte-e.firstByte,m=a.lastByte-e.firstByte;if(o._blocksInProgress.has(l))continue;const g={layerName:o.name,firstByte:h,lastByte:m,pixelFormat:o.pixelFormat,blockIndex:l,blockShape:[a.bands.length].concat(o.bandShape),buffer:o.buffer,codec:a.codec.codec,filters:a.filters.map(v=>v.filter)};o._blocksInProgress.add(l),i.push(g)}return new uf(i,()=>{i.forEach(l=>o._blocksInProgress.delete(l.blockIndex))},(l,a)=>{if(i.forEach(h=>o._blocksInProgress.delete(h.blockIndex)),l)throw l;a.forEach(h=>{this.getLayer(h.layerName).processDecodedData(h)})})}}class cf{constructor({version:e,name:i,units:o,tileSize:l,pixelFormat:a,buffer:h,dataIndex:m},g){if(this.version=e,this.version!==1)throw new Kn(`Cannot parse raster layer encoded with MRT version ${e}`);this.name=i,this.units=o,this.tileSize=l,this.buffer=h,this.pixelFormat=Q7[a],this.dataIndex=m,this.bandShape=[l+2*h,l+2*h,lf[this.pixelFormat]],this._decodedBlocks=new Zu(g?g.cacheSize:5),this._blocksInProgress=new Set}get dimension(){return lf[this.pixelFormat]}get cacheSize(){return this._decodedBlocks.capacity}getBandList(){return this.dataIndex.map(({bands:e})=>e).flat()}processDecodedData(e){const i=e.blockIndex.toString();this._decodedBlocks.get(i)||this._decodedBlocks.put(i,e.data)}getBlockForBand(e){let i=0;switch(typeof e){case"string":for(const[o,l]of this.dataIndex.entries()){for(const[a,h]of l.bands.entries())if(h===e)return{bandIndex:i+a,blockIndex:o,blockBandIndex:a};i+=l.bands.length}break;case"number":for(const[o,l]of this.dataIndex.entries()){if(e>=i&&ethis.cacheSize)throw new Kn(`Number of blocks to decode (${a.size}) exceeds cache size (${this.cacheSize}).`);return{layerName:this.name,firstByte:i,lastByte:o,blockIndices:l}}hasBand(e){const{blockIndex:i}=this.getBlockForBand(e);return i>=0}hasDataForBand(e){const{blockIndex:i}=this.getBlockForBand(e);return i>=0&&!!this._decodedBlocks.get(i.toString())}getBandView(e){const{blockIndex:i,blockBandIndex:o}=this.getBlockForBand(e);if(i<0)throw new Kn(`Band not found: ${JSON.stringify(e)}`);const l=this._decodedBlocks.get(i.toString());if(!l)throw new Kn(`Data for band ${JSON.stringify(e)} of layer "${this.name}" not decoded.`);const a=this.dataIndex[i],h=this.bandShape.reduce((v,p)=>v*p,1),m=o*h,g=l.subarray(m,m+h);return{data:g,bytes:new Uint8Array(g.buffer).subarray(g.byteOffset,g.byteOffset+g.byteLength),tileSize:this.tileSize,buffer:this.buffer,pixelFormat:this.pixelFormat,dimension:this.dimension,offset:a.offset,scale:a.scale}}}Xu.setPbf=function(n){od=n};class uf{constructor(e,i,o){this.tasks=e,this._onCancel=i,this._onComplete=o,this._finalized=!1}cancel(){this._finalized||(this._onCancel(),this._finalized=!0)}complete(e,i){this._finalized||(this._onComplete(e,i),this._finalized=!0)}}Xu.performDecoding=function(n,e){const i=new Uint8Array(n);return Promise.all(e.tasks.map(o=>{const{layerName:l,firstByte:a,lastByte:h,pixelFormat:m,blockShape:g,blockIndex:v,filters:p,codec:y}=o,w=i.subarray(a,h+1),x=new Uint32Array(g[0]*g[1]*g[2]);let b;if(y!=="gzip_data")throw new Kn(`Unhandled codec: ${y}`);return b=function(S,I){if(!globalThis.DecompressionStream&&I==="gzip_data")return Promise.resolve(((D=function(q){q[0]==31&&q[1]==139&&q[2]==8||To(6,"invalid gzip data");var J=q[3],X=10;4&J&&(X+=2+(q[10]|q[11]<<8));for(var Y=(J>>3&1)+(J>>4&1);Y>0;Y-=!q[X++]);return X+(2&J)}(L=S))+8>L.length&&To(6,"invalid gzip data"),function(q,J,X,Y){var le=q.length;if(!le||J.f&&!J.l)return X||new kn(0);var ee=!X,ce=ee||J.i!=2,me=J.i;ee&&(X=new kn(3*le));var pe,xe,ye=function(Pa){var Ca=X.length;if(Pa>Ca){var C0=new kn(Math.max(2*Ca,Pa));C0.set(X),X=C0}},Ee=J.f||0,we=J.p||0,Ae=J.b||0,$e=J.l,Ge=J.d,lt=J.m,Ze=J.n,Ke=8*le;do{if(!$e){Ee=wo(q,we,1);var He=wo(q,we+1,3);if(we+=3,!He){var wt=q[(It=4+((we+7)/8|0))-4]|q[It-3]<<8,rt=It+wt;if(rt>le){me&&To(0);break}ce&&ye(Ae+wt),X.set(q.subarray(It,rt),Ae),J.b=Ae+=wt,J.p=we=8*rt,J.f=Ee;continue}if(He==1)$e=Z7,Ge=W7,lt=9,Ze=5;else if(He==2){var pt=wo(q,we,31)+257,Mt=wo(q,we+10,15)+4,jt=pt+wo(q,we+5,31)+1;we+=14;for(var Ct=new kn(jt),Wt=new kn(19),Vt=0;Vt>4)<16)Ct[Vt++]=It;else{var Li=0,Ni=0;for(It==16?(Ni=3+wo(q,we,3),we+=2,Li=Ct[Vt-1]):It==17?(Ni=3+wo(q,we,7),we+=3):It==18&&(Ni=11+wo(q,we,127),we+=7);Ni--;)Ct[Vt++]=Li}}var qi=Ct.subarray(0,pt),Hi=Ct.subarray(pt);lt=rd(qi),Ze=rd(Hi),$e=H1(qi,lt),Ge=H1(Hi,Ze)}else To(1);if(we>Ke){me&&To(0);break}}ce&&ye(Ae+131072);for(var Mi=(1<>4;if((we+=15&Li)>Ke){me&&To(0);break}if(Li||To(2),er<256)X[Ae++]=er;else{if(er==256){qr=we,$e=null;break}var nr=er-254;er>264&&(nr=wo(q,we,(1<<(Fn=ef[Vt=er-257]))-1)+of[Vt],we+=Fn);var Rr=Ge[nd(q,we)&cr],xr=Rr>>4;if(Rr||To(3),we+=15&Rr,Hi=H7[xr],xr>3){var Fn=tf[xr];Hi+=nd(q,we)&(1<Ke){me&&To(0);break}ce&&ye(Ae+131072);var Ia=Ae+nr;if(Aepe.length)&&(xe=pe.length),new kn(pe.subarray(0,xe))):X.subarray(0,Ae)}(L.subarray(D,-8),{i:2},new kn(((P=L)[(O=P.length)-4]|P[O-3]<<8|P[O-2]<<16|P[O-1]<<24)>>>0))));var P,O,L,D;const F=J7[I];if(!F)throw new Error(`Unhandled codec: ${I}`);const V=new globalThis.DecompressionStream(F);return new Response(new Blob([S]).stream().pipeThrough(V)).arrayBuffer().then(q=>new Uint8Array(q))}(w,y).then(S=>(function(I,P){I.readFields(B7,P)}(new od(S),x),new e_[m](x.buffer))),b.then(S=>{for(let I=p.length-1;I>=0;I--)switch(p[I]){case"delta_filter":V7(S,g);break;case"zigzag_filter":U7(S);break;case"bitshuffle_filter":j7(S,m);break;default:throw new Kn(`Unhandled filter "${p[I]}"`)}return{layerName:l,blockIndex:v,data:S}}).catch(S=>{throw S})}))},at(uf,"MRTDecodingBatch",{omit:["_onCancel","_onComplete"]}),at(Xu,"MapboxRasterTile"),at(cf,"MapboxRasterLayer",{omit:["_blocksInProgress"]});let W1,sd,So,Zl,ad,Wl=null;function hf(){return Vr()&&self.worker&&self.worker.dracoUrl?self.worker.dracoUrl:sd||H.DRACO_URL}function df(){if(Vr()&&self.worker&&self.worker.meshoptUrl)return self.worker.meshoptUrl;if(Zl)return Zl;const n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);if(typeof WebAssembly!="object")throw new Error("WebAssembly not supported, cannot instantiate meshoptimizer");return Zl=WebAssembly.validate(n)?H.MESHOPT_SIMD_URL:H.MESHOPT_URL,Zl}const Yu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},t_={5120:"DT_INT8",5121:"DT_UINT8",5122:"DT_INT16",5123:"DT_UINT16",5125:"DT_UINT32",5126:"DT_FLOAT32"},X1={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function pf(n,e,i){const o=i.json.bufferViews.length,l=i.buffers.length;e.bufferView=o,i.json.bufferViews[o]={buffer:l,byteLength:n.byteLength},i.buffers[l]=n}const ld="KHR_draco_mesh_compression";function i_(n,e){const i=n.extensions&&n.extensions[ld];if(!i)return;const o=new So.Decoder,l=gf(e,i.bufferView),a=new So.Mesh;if(!o.DecodeArrayToMesh(l,l.byteLength,a))throw new Error("Failed to decode Draco mesh");const h=e.json.accessors[n.indices],m=Yu[h.componentType],g=h.count*m.BYTES_PER_ELEMENT,v=So._malloc(g);m===Uint16Array?o.GetTrianglesUInt16Array(a,g,v):o.GetTrianglesUInt32Array(a,g,v),pf(So.memory.buffer.slice(v,v+g),h,e),So._free(v);for(const p of Object.keys(i.attributes)){const y=o.GetAttributeByUniqueId(a,i.attributes[p]),w=e.json.accessors[n.attributes[p]],x=t_[w.componentType],b=w.count*X1[w.type]*Yu[w.componentType].BYTES_PER_ELEMENT,S=So._malloc(b);o.GetAttributeDataArrayForAllPoints(a,y,So[x],b,S),pf(So.memory.buffer.slice(S,S+b),w,e),So._free(S)}o.destroy(),a.destroy(),delete n.extensions[ld]}const Ku="EXT_meshopt_compression";function r_(n,e){if(!n.extensions||!n.extensions[Ku])return;const i=n.extensions[Ku],o=new Uint8Array(e.buffers[i.buffer],i.byteOffset||0,i.byteLength||0),l=new Uint8Array(i.count*i.byteStride);ad.decodeGltfBuffer(l,i.count,i.byteStride,o,i.mode,i.filter),n.buffer=e.buffers.length,n.byteOffset=0,e.buffers[n.buffer]=l.buffer,delete n.extensions[Ku]}const ff=1179937895,mf=new TextDecoder("utf8");function _f(n,e){return new URL(n,e).href}function n_(n,e,i,o){return fetch(_f(n.uri,o)).then(l=>l.arrayBuffer()).then(l=>{e.buffers[i]=l})}function gf(n,e){const i=n.json.bufferViews[e];return new Uint8Array(n.buffers[i.buffer],i.byteOffset||0,i.byteLength)}function o_(n,e,i,o){if(n.uri){const l=_f(n.uri,o);return fetch(l).then(a=>a.blob()).then(a=>createImageBitmap(a)).then(a=>{e.images[i]=a})}if(n.bufferView!==void 0){const l=gf(e,n.bufferView),a=new Blob([l],{type:n.mimeType});return createImageBitmap(a).then(h=>{e.images[i]=h})}}function yf(n,e=0,i){const o={json:null,images:[],buffers:[]};if(new Uint32Array(n,e,1)[0]===ff){const p=new Uint32Array(n,e);let y=2;const w=(p[y++]>>2)-3,x=p[y++]>>2;if(y++,o.json=JSON.parse(mf.decode(p.subarray(y,y+x))),y+=x,y{const p=[],y=m&&m.includes(ld),w=m&&m.includes(Ku);if(y&&p.push(function(){if(!So)return W1??(W1=function(x){let b,S=null;function I(){b=new Uint8Array(S.buffer)}function P(){throw new Error("Unexpected Draco error.")}const O={a:{a:P,d:function(L,D,F){return b.copyWithin(L,D,D+F)},c:function(L){const D=b.length,F=Math.max(L>>>0,Math.ceil(1.2*D)),V=Math.ceil((F-D)/65536);try{return S.grow(V),I(),!0}catch{return!1}},b:P}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(x,O):x.then(L=>L.arrayBuffer()).then(L=>WebAssembly.instantiate(L,O))).then(L=>{const{Rb:D,Qb:F,P:V,T:q,X:J,Ja:X,La:Y,Qa:le,Va:ee,Wa:ce,eb:me,jb:pe,f:xe,e:ye,yb:Ee,zb:we,Ab:Ae,Bb:$e,Db:Ge,Gb:lt}=L.instance.exports;S=ye;const Ze=(()=>{let Ke=0,He=0,wt=0,rt=0;return pt=>{wt&&(D(rt),D(Ke),He+=wt,wt=Ke=0),Ke||(He+=128,Ke=F(He));const Mt=pt.length+7&-8;let jt=Ke;Mt>=He&&(wt=Mt,jt=rt=F(Mt));for(let Ct=0;Ct{So=x,W1=void 0}))}()),w&&p.push(function(){if(ad)return;const x=function(b){let S;const I=WebAssembly.instantiateStreaming(b,{}).then(L=>{S=L.instance,S.exports.__wasm_call_ctors()}),P={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},O={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:I,supported:!0,decodeGltfBuffer(L,D,F,V,q,J){(function(X,Y,le,ee,ce,me,pe){const xe=X.exports.sbrk,ye=ee+3&-4,Ee=xe(ye*ce),we=xe(me.length),Ae=new Uint8Array(X.exports.memory.buffer);Ae.set(me,we);const $e=Y(Ee,ee,ce,we,me.length);if($e===0&&pe&&pe(Ee,ye,ce),le.set(Ae.subarray(Ee,Ee+ee*ce)),xe(Ee-xe(0)),$e!==0)throw new Error(`Malformed buffer data: ${$e}`)})(S,S.exports[O[q]],L,D,F,V,S.exports[P[J]])}}}(fetch(df()));return x.ready.then(()=>{ad=x})}()),a)for(let x=0;x{if(y&&h)for(const{primitives:x}of h)for(const b of x)i_(b,o);if(w&&h&&g)for(const x of g)r_(x,o);return o})})}function P0(n,e){const i=n.json.bufferViews[e.bufferView],o=Yu[e.componentType];return new o(n.buffers[i.buffer],(e.byteOffset||0)+(i.byteOffset||0),e.count*(i.byteStride&&i.byteStride!==X1[e.type]*o.BYTES_PER_ELEMENT?i.byteStride/o.BYTES_PER_ELEMENT:X1[e.type]))}function cd(n,e,i,o){const l=Yu[e.componentType],a=function(p){switch(p){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:return 1}}(l),h=n.json.bufferViews[e.bufferView],m=h.byteStride?h.byteStride/l.BYTES_PER_ELEMENT:X1[e.type],g=i.float32,v=g.length/i.capacity;for(let p=0,y=0;p0){for(let I=0;I0){a.texcoordArray=new fa;const w=e.json.accessors[l.TEXCOORD_0];a.texcoordArray.resize(w.count);const x=P0(e,w);cd(e,w,a.texcoordArray,x)}if(l._FEATURE_ID_RGBA4444!==void 0){const w=e.json.accessors[l._FEATURE_ID_RGBA4444];e.json.extensionsUsed&&e.json.extensionsUsed.includes("EXT_meshopt_compression")&&(a.featureData=P0(e,w))}l._FEATURE_RGBA4444!==void 0&&(a.featureData=new Uint32Array(P0(e,e.json.accessors[l._FEATURE_RGBA4444]).buffer));const y=n.material;return a.material=function(w,x){const{emissiveFactor:b=[0,0,0],alphaMode:S="OPAQUE",alphaCutoff:I=.5,normalTexture:P,occlusionTexture:O,emissiveTexture:L,doubleSided:D}=w,{baseColorFactor:F=[1,1,1,1],metallicFactor:V=1,roughnessFactor:q=1,baseColorTexture:J,metallicRoughnessTexture:X}=w.pbrMetallicRoughness||{},Y=O?x[O.index]:void 0;if(O&&O.extensions&&O.extensions.KHR_texture_transform&&Y){const le=O.extensions.KHR_texture_transform;Y.offsetScale=[le.offset[0],le.offset[1],le.scale[0],le.scale[1]]}return{pbrMetallicRoughness:{baseColorFactor:new bi(...F),metallicFactor:V,roughnessFactor:q,baseColorTexture:J?x[J.index]:void 0,metallicRoughnessTexture:X?x[X.index]:void 0},doubleSided:D,emissiveFactor:b,alphaMode:S,alphaCutoff:I,normalTexture:P?x[P.index]:void 0,occlusionTexture:Y,emissionTexture:L?x[L.index]:void 0,defined:w.defined===void 0}}(y!==void 0?e.json.materials[y]:{defined:!1},i),a}function xf(n,e,i){const{matrix:o,rotation:l,translation:a,scale:h,mesh:m,extras:g,children:v}=n,p={};if(p.matrix=o||Q.mat4.fromRotationTranslationScale([],l||[0,0,0,1],a||[0,0,0],h||[1,1,1]),m!==void 0){p.meshes=i[m];const y=p.anchor=[0,0];for(const w of p.meshes){const{min:x,max:b}=w.aabb;y[0]+=x[0]+b[0],y[1]+=x[1]+b[1]}y[0]=Math.floor(y[0]/p.meshes.length/2),y[1]=Math.floor(y[1]/p.meshes.length/2)}if(g&&(g.id&&(p.id=g.id),g.lights&&(p.lights=function(y){if(!y.length)return[];const w=function(P){const O=atob(P),L=new Uint8Array(O.length);for(let D=0;D1&&o[o.length-1].equals(o[0])&&o.pop();let l=0;for(let h=0;h0&&o.reverse();const a=v1(o.flatMap(h=>[h.x,h.y]),[]);return a.length===0?null:{vertices:o,indices:a}}function c_(n,e){const i=[],o=[];let l=0;const a=[];for(const h of n){l=i.length;const m=h.vertexArray.float32,g=h.indexArray.uint16;for(let v=0;v0&&([o[h+1],o[h+2]]=[o[h+2],o[h+1]])}return{vertices:i,indices:o}}function vf(n){const e=function(g,v){const p=[],y=WebGL2RenderingContext;if(g.json.textures)for(const w of g.json.textures){const x={magFilter:y.LINEAR,minFilter:y.NEAREST,wrapS:y.REPEAT,wrapT:y.REPEAT};w.sampler!==void 0&&Object.assign(x,g.json.samplers[w.sampler]),p.push({image:v[w.source],sampler:x,uploaded:!1})}return p}(n,n.images),i=function(g,v){const p=[];for(const y of g.json.meshes){const w=[];for(const x of y.primitives)w.push(s_(x,g,v));p.push(w)}return p}(n,e),{scenes:o,scene:l,nodes:a}=n.json,h=o?o[l||0].nodes:a,m=[];for(const g of h)m.push(xf(a[g],n,i));return function(g,v,p){const y={},w=new Set;for(let x=0;x0){const x=Array.from(w.values()).sort((b,S)=>b-S);for(let b=x.length-1;b>=0;b--)g.splice(x[b],1)}}(m,h,n.json.nodes),m}function u_(n){n.heightmap=new Float32Array(4096),n.heightmap.fill(-1);const e=n.vertexArray.float32,i=n.aabb.min[0]-1,o=n.aabb.min[1]-1,l=M0/(n.aabb.max[0]-i+2),a=M0/(n.aabb.max[1]-o+2);for(let h=0;hn.heightmap[v*M0+g]&&(n.heightmap[v*M0+g]=m)}}function h_(n,e){const i={};i.indexArray=new _r,i.indexArray.reserve(4*n.length),i.vertexArray=new Ln,i.vertexArray.reserve(10*n.length),i.colorArray=new gs,i.vertexArray.reserve(10*n.length);let o=0;for(const h of n){const m=Math.min(10,Math.max(4,1.3*h.height))*e,g=[-h.normal[1],h.normal[0],0],v=Math.min(.29,.1*h.width/h.depth),p=h.width-2*h.depth*e*(v+.01),y=Q.vec3.scaleAndAdd([],h.pos,g,p/2),w=Q.vec3.scaleAndAdd([],h.pos,g,-p/2),x=[y[0],y[1],y[2]+h.height],b=[w[0],w[1],w[2]+h.height],S=Q.vec3.scaleAndAdd([],h.normal,g,v);Q.vec3.scale(S,S,m);const I=Q.vec3.scaleAndAdd([],h.normal,g,-v);Q.vec3.scale(I,I,m),Q.vec3.add(S,y,S),Q.vec3.add(I,w,I),y[2]+=.1,w[2]+=.1,i.vertexArray.emplaceBack(S[0],S[1],S[2]),i.vertexArray.emplaceBack(I[0],I[1],I[2]),i.vertexArray.emplaceBack(y[0],y[1],y[2]),i.vertexArray.emplaceBack(w[0],w[1],w[2]),i.vertexArray.emplaceBack(x[0],x[1],x[2]),i.vertexArray.emplaceBack(b[0],b[1],b[2]),i.vertexArray.emplaceBack(y[0],y[1],y[2]),i.vertexArray.emplaceBack(w[0],w[1],w[2]),i.vertexArray.emplaceBack(S[0],S[1],S[2]),i.vertexArray.emplaceBack(I[0],I[1],I[2]);const P=p/m/2;i.colorArray.emplaceBack(-P-v,-1,P,.8),i.colorArray.emplaceBack(P+v,-1,P,.8),i.colorArray.emplaceBack(-P,0,P,1.3),i.colorArray.emplaceBack(P,0,P,1.3),i.colorArray.emplaceBack(P+v,-.8,P,.7),i.colorArray.emplaceBack(P+v,-.8,P,.7),i.colorArray.emplaceBack(0,0,P,1.3),i.colorArray.emplaceBack(0,0,P,1.3),i.colorArray.emplaceBack(P+v,-1.2,P,.8),i.colorArray.emplaceBack(P+v,-1.2,P,.8),i.indexArray.emplaceBack(6+o,4+o,8+o),i.indexArray.emplaceBack(7+o,9+o,5+o),i.indexArray.emplaceBack(0+o,1+o,2+o),i.indexArray.emplaceBack(1+o,3+o,2+o),o+=10}const l={defined:!0,emissiveFactor:[0,0,0]},a={};return a.baseColorFactor=bi.white,l.pbrMetallicRoughness=a,i.material=l,i.aabb=new mt([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),i}class bf{constructor(e){this._stringToNumber={},this._numberToString=[];for(let i=0;i=0&&w[3]>=0&&v.insert(g,w[0],w[1],w[2],w[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new ba.VectorTile(new xu(this.rawTileData)).layers,this.sourceLayerCoder=new bf(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,i){const{tilespaceGeometry:o,transform:l,tileTransform:a,pixelPosMatrix:h,availableImages:m}=i;this.loadVTLayers(),this.serializedLayersCache.clear();const g=o.bufferedTilespaceBounds,v=this.grid.query(g.min.x,g.min.y,g.max.x,g.max.y,(x,b,S,I)=>se(o.bufferedTilespaceGeometry,x,b,S,I));v.sort(p_);let p=null;l.elevation&&v.length>0&&(p=jl.create(l.elevation,this.tileID));const y={};let w;for(let x=0;x(I||(I=M(P,this.tileID.canonical,a)),O.queryIntersectsFeature(o,P,L,I,this.z,l,h,p,D)))}return y}loadMatchingFeature(e,i,o,l,a){const{featureIndex:h,bucketIndex:m,sourceLayerIndex:g,layoutVertexArrayOffset:v}=i,p=this.bucketLayerIDs[m],y=o.layers,w=Object.keys(y);if(w.length&&!function(P,O){for(let L=0;L=0)return!0;return!1}(w,p))return;const x=o.sourceCache,b=this.sourceLayerCoder.decode(g),S=this.vtLayers[b].feature(h),I=this.getId(S,b);for(let P=0;P`${m.key}: ${m.message}`).join(", ");return void ji(`Failed to create expression for promoteId: ${h}`)}this.promoteIdExpression=a.value}this.promoteIdExpression._evaluator||(this.promoteIdExpression._evaluator=new G0),o=this.promoteIdExpression.evaluate({zoom:0},e)}else o=e.properties[l];typeof o=="boolean"&&(o=Number(o))}return o}}function Tf(n,e,i,o,l){return os(n,(a,h)=>{const m=e instanceof ca?e.get(h):null;return m&&m.evaluate?m.evaluate(i,o,l):m})}function p_(n,e){return e-n}at(wf,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});const Sf=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class ud{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,o]=new Uint8Array(e,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const l=o>>4;if(l!==1)throw new Error(`Got v${l} data when expected v1.`);const a=Sf[15&o];if(!a)throw new Error("Unrecognized array type.");const[h]=new Uint16Array(e,2,1),[m]=new Uint32Array(e,4,1);return new ud(m,h,a,e)}constructor(e,i=64,o=Float64Array,l){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=o,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const a=Sf.indexOf(this.ArrayType),h=2*e*this.ArrayType.BYTES_PER_ELEMENT,m=e*this.IndexArrayType.BYTES_PER_ELEMENT,g=(8-m%8)%8;if(a<0)throw new Error(`Unexpected typed array class: ${o}.`);l&&l instanceof ArrayBuffer?(this.data=l,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+m+g,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+h+m+g),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+m+g,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+a]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){const o=this._pos>>1;return this.ids[o]=o,this.coords[this._pos++]=e,this.coords[this._pos++]=i,o}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return hd(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,o,l){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:h,nodeSize:m}=this,g=[0,a.length-1,0],v=[];for(;g.length;){const p=g.pop()||0,y=g.pop()||0,w=g.pop()||0;if(y-w<=m){for(let I=w;I<=y;I++){const P=h[2*I],O=h[2*I+1];P>=e&&P<=o&&O>=i&&O<=l&&v.push(a[I])}continue}const x=w+y>>1,b=h[2*x],S=h[2*x+1];b>=e&&b<=o&&S>=i&&S<=l&&v.push(a[x]),(p===0?e<=b:i<=S)&&(g.push(w),g.push(x-1),g.push(1-p)),(p===0?o>=b:l>=S)&&(g.push(x+1),g.push(y),g.push(1-p))}return v}within(e,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:l,coords:a,nodeSize:h}=this,m=[0,l.length-1,0],g=[],v=o*o;for(;m.length;){const p=m.pop()||0,y=m.pop()||0,w=m.pop()||0;if(y-w<=h){for(let I=w;I<=y;I++)Mf(a[2*I],a[2*I+1],e,i)<=v&&g.push(l[I]);continue}const x=w+y>>1,b=a[2*x],S=a[2*x+1];Mf(b,S,e,i)<=v&&g.push(l[x]),(p===0?e-o<=b:i-o<=S)&&(m.push(w),m.push(x-1),m.push(1-p)),(p===0?e+o>=b:i+o>=S)&&(m.push(x+1),m.push(y),m.push(1-p))}return g}}function hd(n,e,i,o,l,a){if(l-o<=i)return;const h=o+l>>1;Ef(n,e,h,o,l,a),hd(n,e,i,o,h-1,1-a),hd(n,e,i,h+1,l,1-a)}function Ef(n,e,i,o,l,a){for(;l>o;){if(l-o>600){const v=l-o+1,p=i-o+1,y=Math.log(v),w=.5*Math.exp(2*y/3),x=.5*Math.sqrt(y*w*(v-w)/v)*(p-v/2<0?-1:1);Ef(n,e,i,Math.max(o,Math.floor(i-p*w/v+x)),Math.min(l,Math.floor(i+(v-p)*w/v+x)),a)}const h=e[2*i+a];let m=o,g=l;for(Y1(n,e,o,i),e[2*l+a]>h&&Y1(n,e,o,l);mh;)g--}e[2*o+a]===h?Y1(n,e,o,g):(g++,Y1(n,e,g,l)),g<=i&&(o=g+1),i<=g&&(l=g-1)}}function Y1(n,e,i,o){dd(n,i,o),dd(e,2*i,2*o),dd(e,2*i+1,2*o+1)}function dd(n,e,i){const o=n[e];n[e]=n[i],n[i]=o}function Mf(n,e,i,o){const l=n-i,a=e-o;return l*l+a*a}s.$=kr,s.A=Zr,s.B=qn,s.C=da,s.D=Gl,s.E=Cn,s.F=2,s.G=z1,s.H=R8,s.I=Ur,s.J=class extends Bu{},s.K=oo,s.L=ni,s.M=jc,s.N=D3,s.O=ta,s.P=Qe,s.Q=Rc,s.R=dr,s.S=ll,s.T=G4,s.U=gl,s.V=Bu,s.W=F3,s.X=ia,s.Y=Ja,s.Z=uo,s._=Ys,s.a=function(n){return H.API_CDN_URL_REGEX.test(n)},s.a$=A,s.a0=yn,s.a1=W3,s.a2=sl,s.a3=ol,s.a4=function(n){const e=n.value;let i=[];if(!e)return i;const o=oo(e);return o!=="string"?(i=i.concat([new Bu(n.key,e,`string expected, "${o}" found`)]),i):(b2(e,!0)||(i=i.concat([new Bu(n.key,e,`invalid url "${e}"`)])),i)},s.a5=Ie,s.a6=Z3,s.a7=Gi,s.a8=Ye,s.a9=class{constructor(n){this.specification=n}possiblyEvaluate(n,e){return Ds(n.expression.evaluate(e))}interpolate(n,e,i){return{x:St(n.x,e.x,i),y:St(n.y,e.y,i),z:St(n.z,e.z,i),azimuthal:St(n.azimuthal,e.azimuthal,i),polar:St(n.polar,e.polar,i)}}},s.aA=function(n,e){const i={};for(let o=0;o{o(a,h)},e):o(a,h),()=>{}}return l.callbacks.push(o),l.cancel||(l.cancel=i((a,h)=>{l.result=[a,h];for(const m of l.callbacks)this.scheduler?this.scheduler.add(()=>{m(a,h)},e):m(a,h);setTimeout(()=>delete this.entries[n],3e3)})),()=>{l.result||(l.callbacks=l.callbacks.filter(a=>a!==o),l.callbacks.length||(l.cancel(),delete this.entries[n]))}}},s.aE=function(n,e,i){const o=JSON.stringify(n.request);return n.data&&(this.deduped.entries[o]={result:[null,n.data]}),this.deduped.request(o,{type:"parseTile",isSymbolTile:n.isSymbolTile,zoom:n.tileZoom},l=>{const a=Gn(n.request,(h,m,g,v)=>{h?l(h):m&&l(null,{vectorTile:i?void 0:new ba.VectorTile(new xu(m)),rawData:m,cacheControl:g,expires:v})});return()=>{a.cancel(),l()}},e)},s.aF=function(n){xi++,xi>Bt&&(n.getActor().send("enforceCacheSizeLimit",Dt),xi=0)},s.aG=function(n){return n<=1?1:Math.pow(2,Math.floor(Math.log(n)/Math.LN2))},s.aH=qe,s.aI=l2,s.aJ=f2,s.aK=a2,s.aL=function(n,e){const i=document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(let o=0;o{}}},s.aM=Du,s.aN=function(n){return fetch(n).then(e=>e.arrayBuffer()).then(e=>yf(e,0,n))},s.aO=vf,s.aP=class{constructor(n,e,i,o){this.id=n,this.position=e!=null?new di(e[0],e[1]):new di(0,0),this.orientation=i??[0,0,0],this.nodes=o,this.uploaded=!1,this.aabb=new mt([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),this.matrix=[]}_applyTransformations(n,e){if(Q.mat4.multiply(n.matrix,e,n.matrix),n.meshes)for(const i of n.meshes){const o=mt.applyTransformFast(i.aabb,n.matrix);this.aabb.encapsulate(o)}if(n.children)for(const i of n.children)this._applyTransformations(i,n.matrix)}computeBoundsAndApplyParent(){const n=Q.mat4.identity([]);for(const e of this.nodes)this._applyTransformations(e,n)}computeModelMatrix(n,e,i,o,l,a,h=!1){M2(this.matrix,this,n.transform,this.position,e,i,o,l,a,h)}upload(n){if(!this.uploaded){for(const e of this.nodes)W4(e,n);for(const e of this.nodes)Nu(e);this.uploaded=!0}}destroy(){for(const n of this.nodes)X4(n)}},s.aQ=Fa,s.aR=L1,s.aS=Yr,s.aT=gr,s.aU=mo,s.aV=_r,s.aW=jn,s.aX=d0,s.aY=zu,s.aZ=function(){bn.isLoading()||bn.isLoaded()||ml()!=="deferred"||Uc()},s.a_=X3,s.aa=Ai,s.ab=ra,s.ac=t,s.ad=Q,s.ae=Nr,s.af=ca,s.ag=Gr,s.ah=St,s.ai=Je,s.aj=fc,s.ak=ri,s.al=bi,s.am=class{constructor(n){this.specification=n}possiblyEvaluate(n,e){return function([i,o]){const l=Ds([1,i,o]);return{x:l.x,y:l.y,z:l.z}}(n.expression.evaluate(e))}interpolate(n,e,i){return{x:St(n.x,e.x,i),y:St(n.y,e.y,i),z:St(n.z,e.z,i)}}},s.an=function(n,e,i=0,o=!0){const l=new Qe(i,i),a=n.sub(l),h=e.add(l),m=[a,new Qe(h.x,a.y),h,new Qe(a.x,h.y)];return o&&m.push(a.clone()),m},s.ao=function(n,e){const i=[];for(let o=0;o0&&(o+=(n[l]-0)*(n[l]-0)),e[l]<0&&(o+=(0-e[l])*(0-e[l]));return o},s.bX=Yi,s.bY=ou,s.bZ=function(n){const e=Q.mat4.identity(new Float64Array(16));Q.mat4.multiply(e,n.pixelMatrix,n.globeMatrix);const i=[0,an,0],o=[0,ln,0];return Q.vec3.transformMat4(i,i,e),Q.vec3.transformMat4(o,o,e),[i[0]>0&&i[0]<=n.width&&i[1]>0&&i[1]<=n.height&&!Jr(n,new di(n.center.lat,90)),o[0]>0&&o[0]<=n.width&&o[1]>0&&o[1]<=n.height&&!Jr(n,new di(n.center.lat,-90))]},s.b_=function(n,e){const{scale:i}=n.tileTransform,o=i*Je/(n.tileSize*Math.pow(2,e.zoom-n.tileID.overscaledZ+n.tileID.canonical.z));return Q.mat2.scale(new Float32Array(4),e.inverseAdjustmentMatrix,[o,o])},s.ba=V4,s.bb=function(n,e){const i=Gr(e.zoom);if(i===0)return or(n);const o=si(n),l=Bi(o),a=Wn(o.getWest())*e.worldSize,h=Wn(o.getEast())*e.worldSize,m=wr(o.getNorth())*e.worldSize,g=wr(o.getSouth())*e.worldSize,v=[a,m,0],p=[h,m,0],y=[a,g,0],w=[h,g,0],x=Q.mat4.invert([],e.globeMatrix);return Q.vec3.transformMat4(v,v,x),Q.vec3.transformMat4(p,p,x),Q.vec3.transformMat4(y,y,x),Q.vec3.transformMat4(w,w,x),l[0]=ar(l[0],y,i),l[1]=ar(l[1],w,i),l[2]=ar(l[2],p,i),l[3]=ar(l[3],v,i),mt.fromPoints(l)},s.bc=Di,s.bd=fi,s.be=ar,s.bf=pa,s.bg=Rt,s.bh=Xu,s.bi=xu,s.bj=Gn,s.bk=function(n,e){const i=[];for(const o in n)o in e||i.push(o);return i},s.bl=ns,s.bm=["type","source","source-layer","minzoom","maxzoom","filter","layout"],s.bn=In,s.bo=function(n,e){const{x:i,y:o}=n.point,l=Sn(i,o,n.worldSize/n._pixelsPerMercatorPixel,0,0);return Q.mat4.multiply(l,l,sr(or(e)))},s.bp=Ol,s.bq=un,s.br=yu,s.bs=function(n,e,i,o,l){const a=5*e+2;n.float32[a+0]=i,n.float32[a+1]=o,n.float32[a+2]=l},s.bt=Cu,s.bu=z8,s.bv=j,s.bw=Er,s.bx=Rp,s.by=v2,s.bz=Fp,s.c=re,s.c$=u8,s.c0=m2,s.c1=function(n){const e=m2(n,!0);return Q.mat2.invert([],[e[0],e[1],e[4],e[5]])},s.c2=Qt,s.c3=function(n){const{x:e,y:i}=n.point,{lng:o,lat:l}=n._center;return Sn(e,i,n.worldSize,o,l)},s.c4=ur,s.c5=et,s.c6=_a,s.c7=function(n){const e=Math.round((n+45+360)%360/90)%4;return Un[e]},s.c8=45,s.c9=mc,s.cA=iu,s.cB=class extends Zn{constructor(n){super(n),this.current=d1}set(n,e,i){if(this.fetchUniformLocation(n,e)){for(let o=0;o<9;o++)if(i[o]!==this.current[o]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}}},s.cC=rs,s.cD=function(n,e,i){const o=Gr(i.zoom),l=n.style.map._antialias,a=n.terrain&&n.terrain.exaggeration()>0;return o===0&&!l&&!a},s.cE=function(n){const e=n.pixelsPerMeter,i=e/Tr(1,n.center.lat),o=Q.mat4.identity(new Float64Array(16));return Q.mat4.translate(o,o,[n.point.x,n.point.y,0]),Q.mat4.scale(o,o,[i,i,e]),Float32Array.from(o)},s.cF=si,s.cG=function(n){const e=Yi-5;n=$t(n,-e,e)/e*90;const i=Math.pow(Math.abs(Math.sin(ri(n))),3);return Math.round(i*(zl.length-1))},s.cH=function(n,e,i,o){const l=e.getNorth(),a=e.getSouth(),h=e.getWest(),m=e.getEast(),g=1<0){const b=180/o;Q.mat3.multiply(x,x,[b/v+1,0,0,0,b/p+1,0,-.5*b/y,.5*b/w,1])}return x[2]=g,x[5]=n.x,x[8]=n.y,x},s.cI=or,s.cJ=function(n,e,i){const o=Q.mat4.identity(new Float64Array(16)),l=(e/(1<1)return!1;const i=e.getSource().maxzoom,o=1<1)return e;const l=o.getSource().maxzoom,a=1<{const a=this.getAtTileOffset(n,l.x,l.y),h=o.upVector(n.canonical,l.x,l.y),m=o.upVectorScale(n.canonical,e,i).metersToTile;return Q.vec3.scale(h,h,a*m),h}}getForTilePoints(n,e,i,o){if(this.isUsingMockSource())return!1;const l=jl.create(this,n,o);return!!l&&(e.forEach(a=>{a[2]=this.exaggeration()*l.getElevationAt(a[0],a[1],i)}),!0)}getMinMaxForTile(n){if(this.isUsingMockSource())return null;const e=this.findDEMTileFor(n);if(!e||!e.dem)return null;const i=e.dem.tree,o=e.tileID,l=1<({u_camera_to_center_distance:new Ji(n),u_extrude_scale:new p1(n),u_device_pixel_ratio:new Ji(n),u_matrix:new v0(n),u_inv_rot_matrix:new v0(n),u_merc_center:new Tn(n),u_tile_id:new ma(n),u_zoom_transition:new Ji(n),u_up_dir:new ma(n),u_emissive_strength:new Ji(n)}),s.cU=n=>({u_matrix:new v0(n),u_pixels_to_tile_units:new p1(n),u_device_pixel_ratio:new Ji(n),u_width_scale:new Ji(n),u_floor_width_scale:new Ji(n),u_units_to_pixels:new Tn(n),u_dash_image:new y0(n),u_gradient_image:new y0(n),u_image_height:new Ji(n),u_texsize:new Tn(n),u_tile_units_to_pixels:new Ji(n),u_alpha_discard_threshold:new Ji(n),u_trim_offset:new Tn(n),u_trim_fade_range:new Tn(n),u_trim_color:new x0(n),u_emissive_strength:new Ji(n),u_zbias_factor:new Ji(n),u_tile_to_meter:new Ji(n)}),s.cV=n=>({u_matrix:new v0(n),u_texsize:new Tn(n),u_pixels_to_tile_units:new p1(n),u_device_pixel_ratio:new Ji(n),u_width_scale:new Ji(n),u_floor_width_scale:new Ji(n),u_image:new y0(n),u_units_to_pixels:new Tn(n),u_tile_units_to_pixels:new Ji(n),u_alpha_discard_threshold:new Ji(n),u_trim_offset:new Tn(n),u_trim_fade_range:new Tn(n),u_trim_color:new x0(n),u_emissive_strength:new Ji(n),u_zbias_factor:new Ji(n),u_tile_to_meter:new Ji(n)}),s.cW=n1,s.cX=_m,s.cY=gm,s.cZ=xa,s.c_=(n,e,i,o,l,a)=>{const h=n.transform,m=h.projection.name==="globe";let g;if(a.paint.get("circle-pitch-alignment")==="map")if(m){const p=Kr(h.zoom,e.canonical)*h._pixelsPerMercatorPixel;g=Float32Array.from([p,0,0,p])}else g=h.calculatePixelsToTileUnitsMatrix(i);else g=new Float32Array([h.pixelsToGLUnits[0],0,0,h.pixelsToGLUnits[1]]);const v={u_camera_to_center_distance:n.transform.getCameraToCenterDistance(h.projection),u_matrix:n.translatePosMatrix(e.projMatrix,i,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_device_pixel_ratio:Le.devicePixelRatio,u_extrude_scale:g,u_inv_rot_matrix:g1,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0],u_emissive_strength:a.paint.get("circle-emissive-strength")};if(m){v.u_inv_rot_matrix=o,v.u_merc_center=l,v.u_tile_id=[e.canonical.x,e.canonical.y,1<0?Math.acos(i/o)*Vn:0;let a=n!==0||e!==0?Math.atan2(-e,-n)*Vn+90:0;return a<0&&(a+=360),[o,a,l]},s.cd=u,s.ce=mt,s.cf=Ds,s.cg=function(n){return[Math.pow(n[0],1/2.2),Math.pow(n[1],1/2.2),Math.pow(n[2],1/2.2)]},s.ch=function(n,e){return n.readFields(u7,{icons:[]},e)},s.ci=function(n){return n({pluginStatus:jr,pluginURL:Go}),oa.on("pluginStateChange",n),n},s.cj=Uu,s.ck=Bl,s.cl=z4,s.cm=Os,s.cn=s0,s.co=ot,s.cp=rn,s.cq=en,s.cr=function(n){const e=n.indexOf(xl);return e>=0?n.slice(0,e):n},s.cs=function(n){return n.indexOf(xl)>=0},s.ct=function(n){const e=n.indexOf(xl);return e>=0?n.slice(e+1):""},s.cu=function(n){const e=[],i=n.id;return i===void 0&&e.push({message:`layers.${i}: missing required property "id"`}),n.render===void 0&&e.push({message:`layers.${i}: missing required method "render"`}),n.renderingMode&&n.renderingMode!=="2d"&&n.renderingMode!=="3d"&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},s.cv=function(n,e,i,o){return n.type==="custom"?new Ym(n,e):new a7[n.type](n,e,i,o)},s.cw=ss,s.cx=class extends Xl{constructor(n,e){super(n._vectorTileFeature,n._z,n._x,n._y,n.id),n.state&&(this.state=Object.assign({},n.state)),this.target=e.target,this.namespace=e.namespace,e.properties&&(this.properties=e.properties),this.target&&("featuresetId"in this.target&&!this.target.importId||"layerId"in this.target)&&(this.source=n.source,this.sourceLayer=n.sourceLayer,this.layer=n.layer)}toJSON(){const n=super.toJSON();return n.target=this.target,n.namespace=this.namespace,n}},s.cy=oa,s.cz=gn,s.d=function(n){return H.API_TILEJSON_REGEX.test(n)},s.d$=bf,s.d0=Cr,s.d1=(n,e,i,o,l,a,h,m)=>{const g=n.transform,v=g.pitch<15?a8(.07,.7,$t((14-g.zoom)/5,0,1)):.07,p=i.paint.get("line-trim-color-use-theme").constantOr("default")==="none";return{u_matrix:c8(n,e,i,o),u_texsize:e.imageAtlasTexture?e.imageAtlasTexture.size:[0,0],u_pixels_to_tile_units:g.calculatePixelsToTileUnitsMatrix(e),u_device_pixel_ratio:l,u_width_scale:a,u_floor_width_scale:h,u_image:0,u_tile_units_to_pixels:l8(e,g),u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]],u_alpha_discard_threshold:0,u_trim_offset:m,u_trim_fade_range:i.paint.get("line-trim-fade-range"),u_trim_color:i.paint.get("line-trim-color").toRenderColor(p?null:i.lut).toArray01(),u_emissive_strength:i.paint.get("line-emissive-strength"),u_zbias_factor:v,u_tile_to_meter:u(e.tileID.canonical,0)}},s.d2=(n,e,i,o,l,a,h,m,g)=>{const v=n.transform,p=v.calculatePixelsToTileUnitsMatrix(e),y=i.paint.get("line-trim-color-use-theme").constantOr("default")==="none",w=v.pitch<15?a8(.07,.7,$t((14-v.zoom)/5,0,1)):.07;return{u_matrix:c8(n,e,i,o),u_pixels_to_tile_units:p,u_device_pixel_ratio:a,u_width_scale:h,u_floor_width_scale:m,u_units_to_pixels:[1/v.pixelsToGLUnits[0],1/v.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:l,u_texsize:h8(i)&&e.lineAtlasTexture?e.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:l8(e,n.transform),u_alpha_discard_threshold:0,u_trim_offset:g,u_trim_fade_range:i.paint.get("line-trim-fade-range"),u_trim_color:i.paint.get("line-trim-color").toRenderColor(y?null:i.lut).toArray01(),u_emissive_strength:i.paint.get("line-emissive-strength"),u_zbias_factor:w,u_tile_to_meter:u(e.tileID.canonical,0)}},s.d3=ka,s.d4=x1,s.d5=_1,s.d6=Kp,s.d7=tt,s.d8=gu,s.d9=wa,s.dA=fu,s.dB=eo,s.dC=function(){return!!document.fullscreenElement||!!document.webkitFullscreenElement},s.dD=zs,s.dE=n4,s.dF=vs,s.dG=function([n,e,i]){const o=Math.hypot(n,e,i),l=Math.atan2(n,i),a=.5*Math.PI-Math.acos(-e/o);return new di(ur(l),ur(a))},s.dH=$4,s.dI=function(n){const e=n.navigator?n.navigator.userAgent:null;return!!function(i){if(Na==null){const o=i.navigator?i.navigator.userAgent:null;Na=!!i.safari||!(!o||!(/\b(iPad|iPhone|iPod)\b/.test(o)||o.match("Safari")&&!o.match("Chrome")))}return Na}(n)&&e&&(e.match("Version/15.4")||e.match("Version/15.5")||e.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},s.dJ=function(n,e){Dt=n,Bt=e},s.dK=Jr,s.dL=En,s.dM=function(n){const e=[0,0,0],i=Q.mat4.identity(new Float64Array(16));return Q.mat4.multiply(i,n.pixelMatrix,n.globeMatrix),Q.vec3.transformMat4(e,e,i),new Qe(e[0],e[1])},s.dN=function(n,e,i=!1){if(jr===G3||jr===Hn||jr===q3)throw new Error("setRTLTextPlugin cannot be called multiple times.");Go=Le.resolveURL(n),jr=G3,$3=e,fl(),i||Uc()},s.dO=ml,s.dP=function(){Uu().acquire(K4)},s.dQ=function(){const n=j1;n&&(n.isPreloaded()&&n.numActive()===1?(n.release(K4),j1=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()"))},s.dR=I0,s.dS=function(n){const e=Ui();if(!e)return;const i=e.delete(ht);n&&i.catch(n).then(()=>n())},s.dT=U1,s.dU=hf,s.dV=function(n){sd=Le.resolveURL(n),Wl||(Wl=new Gl(Uu(),new Cn)),Wl.broadcast("setDracoUrl",sd)},s.dW=df,s.dX=function(n){Zl=Le.resolveURL(n),Wl||(Wl=new Gl(Uu(),new Cn)),Wl.broadcast("setMeshoptUrl",Zl)},s.dY=at,s.dZ=va,s.d_=bo,s.da=450,s.db=7,s.dc=Xm,s.dd=hi,s.de=Il,s.df=256,s.dg=sr,s.dh=Ln,s.di=Wr,s.dj=Sl,s.dk=function(n,e,i,o,l){return $t((n-e)/(i-e)*(l-o)+o,o,l)},s.dl=P3,s.dm=Yo,s.dn=class{constructor(n,e,i,o){this.context=n,this.format=o,this.size=i,this.texture=n.gl.createTexture();const[l,a,h]=this.size,{gl:m}=n;m.bindTexture(m.TEXTURE_3D,this.texture),n.pixelStoreUnpackFlipY.set(!1),n.pixelStoreUnpack.set(1),n.pixelStoreUnpackPremultiplyAlpha.set(!1),m.texImage3D(m.TEXTURE_3D,0,this.format,l,a,h,0,U4(this.format),j4(this.format),e.data)}bind(n,e){const{context:i}=this,{gl:o}=i;o.bindTexture(o.TEXTURE_3D,this.texture),n!==this.minFilter&&(o.texParameteri(o.TEXTURE_3D,o.TEXTURE_MAG_FILTER,n),o.texParameteri(o.TEXTURE_3D,o.TEXTURE_MIN_FILTER,n),this.minFilter=n),e!==this.wrapS&&(o.texParameteri(o.TEXTURE_3D,o.TEXTURE_WRAP_S,e),o.texParameteri(o.TEXTURE_3D,o.TEXTURE_WRAP_T,e),this.wrapS=e)}destroy(){const{gl:n}=this.context;n.deleteTexture(this.texture),this.texture=null}},s.dp=H4,s.dq=[1,1,1],s.dr=jl,s.ds=Ul,s.dt=Ho,s.du=fa,s.dv=bs,s.dw=a1,s.dx=s1,s.dy=class{constructor(){this._updateTime=0,this._sourceIds=[],this._activeRegions=[],this._prevRegions=[],this._globalClipBounds={min:new Qe(1/0,1/0),max:new Qe(-1/0,-1/0)}}clear(){this._activeRegions.length>0&&++this._updateTime,this._activeRegions=[],this._prevRegions=[]}get updateTime(){return this._updateTime}getReplacementRegionsForTile(n,e=!1){const i=Lp(new Qe(0,0),new Qe(Je,Je),n),o=[];if(e&&!g4(i,this._globalClipBounds))return o;for(const l of this._activeRegions){if(l.hiddenByOverlap||!g4(i,l))continue;const a=G5(l.min,l.max,n);o.push({min:a.min,max:a.max,sourceId:this._sourceIds[l.priority],footprint:l.footprint,footprintTileId:l.tileId,order:l.order,clipMask:l.clipMask,clipScope:l.clipScope})}return o}setSources(n){this._setSources(n.map(e=>({getSourceId:()=>e.cache.id,getFootprints:()=>{const i=[];for(const o of e.cache.getVisibleCoordinates()){const l=e.cache.getTile(o).buckets[e.layer];l&&l.updateFootprints(o.toUnwrapped(),i)}return i},getOrder:()=>e.order,getClipMask:()=>e.clipMask,getClipScope:()=>e.clipScope})))}_addSource(n){const e=n.getFootprints();if(e.length===0)return;const i=n.getOrder(),o=n.getClipMask(),l=n.getClipScope();for(const a of e){if(!a.footprint)continue;const h=Lp(a.footprint.min,a.footprint.max,a.id);this._activeRegions.push({min:h.min,max:h.max,hiddenByOverlap:!1,priority:this._sourceIds.length,tileId:a.id,footprint:a.footprint,order:i,clipMask:o,clipScope:l})}this._sourceIds.push(n.getSourceId())}_computeReplacement(){this._activeRegions.sort((e,i)=>e.priority-i.priority||mu(e.min,i.min)||mu(e.max,i.max)||e.order-i.order||e.clipMask-i.clipMask||function(o,l){const a=(h,m)=>h+m;return o.length-l.length||o.reduce(a,"").localeCompare(l.reduce(a,""))}(e.clipScope,i.clipScope));let n=this._activeRegions.length!==this._prevRegions.length;if(!n){let e=0;for(;!n&&e!==this._activeRegions.length;){const i=this._activeRegions[e],o=this._prevRegions[e];n=i.priority!==o.priority||!Dp(i,o)||i.order!==o.order||i.clipMask!==o.clipMask||!In(i.clipScope,o.clipScope),++e}}if(n){++this._updateTime;for(const i of this._activeRegions)i.order!==fu&&(this._globalClipBounds.min.x=Math.min(this._globalClipBounds.min.x,i.min.x),this._globalClipBounds.min.y=Math.min(this._globalClipBounds.min.y,i.min.y),this._globalClipBounds.max.x=Math.max(this._globalClipBounds.max.x,i.max.x),this._globalClipBounds.max.y=Math.max(this._globalClipBounds.max.y,i.max.y));const e=i=>{const o=this._activeRegions;if(i>=o.length)return i;const l=o[i].priority;for(;i1){let i=0,o=e(i);for(;i!==o;){let l=i;const a=i;for(;l!==o;){const h=this._activeRegions[l];h.hiddenByOverlap=!1;for(let m=0;m=0;e--)this._addSource(n[e]);this._computeReplacement()}},s.dz=class{constructor(n){this._createGrid(n),this._createPoles(n)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const n of this._poleSegments)n.destroy();for(const n of this._gridSegments)n.withSkirts.destroy(),n.withoutSkirts.destroy()}_fillGridMeshWithLods(n,e){const i=new fo,o=new _r,l=[],a=n+1+2,h=e[0]+1,m=e[0]+1+(1+e.length),g=(v,p,y)=>{let w=v===a-1?v-2:v===0?v:v-1;return w+=y?24575:0,[w,p]};for(let v=0;vv.id-p.id),o.sort((v,p)=>v.id-p.id||v.idx-p.idx),o=o.filter((v,p,y)=>p===y.findIndex(w=>w.id===v.id&&w.idx===v.idx));const h=new Array;let m=0;const g=o.length;for(const v of l){if(v.constantHeight){h.push(new p4(v.id,v.bounds,v.constantHeight));continue}for(;m!==g&&o[m].idIi*Er)}let Ct=L?"center":v.get("text-justify").evaluate(q,{},a);const Wt=O==="point",Vt=Wt?v.get("text-max-width").evaluate(q,{},a)*Er:1/0,Yt=ci=>{n.allowVerticalPlacement&&V3(He)&&(ee.vertical=P4(ce,e,i,l,J,Vt,rt,Mt,ci,pt,pe,un.vertical,!0,Y,X,g))};if(!L&&jt){const ci=Ct==="auto"?jt.map(It=>D4(It)):[Ct];let Ii=!1;for(let It=0;It=0||!V3(He)){const ci=P4(ce,e,i,l,J,Vt,rt,Mt,Ct,pt,pe,un.horizontal,!1,Y,X,g);ci&&(ee.horizontal[Ct]=ci)}Yt(Wt?"left":Ct)}}let xe,ye,Ee,we,Ae,$e=!1;if(q.icon&&q.icon.hasPrimary()){const He=j8(q.icon,n.iconSizeData,p["icon-size"],a,n.zoom,q,g,y.iconScaleFactor);xe=He.iconPrimary,ye=He.iconSecondary;const wt=xe.toString(),rt=o.get(wt);rt&&(Ee=v.get("icon-offset").evaluate(q,{},a),we=v.get("icon-anchor").evaluate(q,{},a),Ae=v.get("icon-text-fit").evaluate(q,{},a),me=Am(l.get(wt),ye?l.get(ye.toString()):void 0,Ee,we),$e=rt.sdf,n.sdfIcons===void 0?n.sdfIcons=rt.sdf:n.sdfIcons!==rt.sdf&&ji("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(rt.pixelRatio!==n.pixelRatio||v.get("icon-rotate").constantOr(1)!==0)&&(n.iconsNeedLinear=!0))}F=F||!(!q.icon||!q.icon.hasSecondary());const Ge=L4(ee.horizontal)||ee.vertical;n.iconsInText||(n.iconsInText=!!Ge&&Ge.iconsInText);const lt=Y*y.textScaleFactor/Er,{defaultShapedIcon:Ze,verticallyShapedIcon:Ke}=Om(n,me,v,q,a,ee,lt,Ee,Ae);me=Ze,V.push({feature:q,shapedTextOrientations:ee,shapedText:Ge,shapedIcon:me,iconPrimary:xe,iconSecondary:ye,iconOffset:Ee,iconAnchor:we,verticallyShapedIcon:Ke,layoutTextSize:Y,layoutIconSize:le,textOffset:pe,isSDFIcon:$e,iconTextFit:Ae})}return{featureData:V,sizes:y,hasAnySecondaryIcon:F,textAlongLine:L,symbolPlacement:O}},s.ea=L8,s.eb=function(n,e,i,o,l,a,h,m,g,v){const{featureData:p,hasAnySecondaryIcon:y,sizes:w,textAlongLine:x,symbolPlacement:b}=e;for(const S of p){const{shapedIcon:I,verticallyShapedIcon:P,feature:O,shapedTextOrientations:L,shapedText:D,layoutTextSize:F,textOffset:V,isSDFIcon:q,iconPrimary:J,iconSecondary:X,iconTextFit:Y,iconOffset:le}=S;G8(I,v.iconPositions,J,X),G8(P,v.iconPositions,J,X),Lm(L,v.iconPositions),(D||I)&&km(n,O,L,I,P,g,w,F,0,V,q,o,l,h,m,y,Y,le,x,b)}i&&n.generateCollisionDebugBuffers(a,n.collisionBoxArray,w.textScaleFactor)},s.ec=ba,s.ed=Wu,s.ee=Lo,s.ef=vp,s.eg=y8,s.eh=gt,s.ei=function(n){let e=0;if(new Uint32Array(n,0,1)[0]!==ff){const i=new Uint32Array(n,0,7),[,,o,l,a,h]=i;e=i.byteLength+l+a+h+a,(o!==n.byteLength||e>=n.byteLength)&&ji("Invalid b3dm header information.")}return yf(n,e)},s.ej=function(n,e){const i=vf(n);for(const o of i){for(const l of o.meshes)u_(l);o.lights&&(o.lightMeshIndex=o.meshes.length,o.meshes.push(h_(o.lights,e)))}return i},s.ek=Vu,s.el=R2,s.em=bn,s.en=function(n){Xt(),Gt!=null&&Gt.then(e=>{e.keys().then(i=>{for(let o=0;o"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join(""))},s.k=function(n){return btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,(e,i)=>String.fromCharCode(+("0x"+i))))},s.l=Lr,s.m=vi,s.n=function(n,e){return gn(Lr(n,{type:"json"}),e)},s.o=r3,s.p=function(n,e){return gn(Lr(n,{method:"POST"}),e)},s.q=Le,s.r=Sr,s.s=function(n){try{const e=self[n];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch{return!1}},s.t=Fe,s.u=function(){return function n(e){return e?(e^Math.random()*(16>>e/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,n)}()},s.v=function(n){return!!n&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(n)},s.w=ji,s.x=function(){return J4||(J4=new I0),J4},s.y=id,s.z=Bs}),Me(["./shared"],function(s){function gt(Oe){const H=Oe?Oe.url.toString():void 0;return H?performance.getEntriesByName(H):[]}function nt(Oe){if(typeof Oe=="number"||typeof Oe=="boolean"||typeof Oe=="string"||Oe==null)return JSON.stringify(Oe);if(Array.isArray(Oe)){let Z="[";for(const re of Oe)Z+=`${nt(re)},`;return`${Z}]`}let H="{";for(const Z of Object.keys(Oe).sort())H+=`${Z}:${nt(Oe[Z])},`;return`${H}}`}function dt(Oe){let H="";for(const Z of s.bm)(Oe.type!=="model"||Z!=="minzoom"&&Z!=="maxzoom")&&(H+=`/${nt(Oe[Z])}`);return H}class At{constructor(H){this.keyCache={},this._layers={},this._layerConfigs={},H&&this.replace(H)}replace(H,Z){this._layerConfigs={},this._layers={},this.update(H,[],Z)}update(H,Z,re){this._options=re;for(const ue of H)this._layerConfigs[ue.id]=ue,(this._layers[ue.id]=s.cv(ue,this.scope,null,this._options)).compileFilter(re),this.keyCache[ue.id]&&delete this.keyCache[ue.id];for(const ue of Z)delete this.keyCache[ue],delete this._layerConfigs[ue],delete this._layers[ue];this.familiesBySource={};const de=function(ue,ge){const Pe={};for(let Re=0;Rethis._layers[Xe.id]),Pe=ge[0];if(Pe.visibility==="none")continue;const ve=Pe.source||"";let Re=this.familiesBySource[ve];Re||(Re=this.familiesBySource[ve]={});const Fe=Pe.sourceLayer||"_geojsonTileLayer";let Le=Re[Fe];Le||(Le=Re[Fe]=[]),Le.push(ge)}}}const yi=1*s.d_;class _i{constructor(H){const Z={},re=[];for(const Pe in H){const ve=H[Pe],Re=Z[Pe]={};for(const Fe in ve.glyphs){const Le=ve.glyphs[+Fe];if(!Le||Le.bitmap.width===0||Le.bitmap.height===0)continue;const Xe=Le.metrics.localGlyph?yi:1,ot={x:0,y:0,w:Le.bitmap.width+2*Xe,h:Le.bitmap.height+2*Xe};re.push(ot),Re[Fe]=ot}}const{w:de,h:ue}=s.H(re),ge=new s.dZ({width:de||1,height:ue||1});for(const Pe in H){const ve=H[Pe];for(const Re in ve.glyphs){const Fe=ve.glyphs[+Re];if(!Fe||Fe.bitmap.width===0||Fe.bitmap.height===0)continue;const Le=Z[Pe][Re],Xe=Fe.metrics.localGlyph?yi:1;s.dZ.copy(Fe.bitmap,ge,{x:0,y:0},{x:Le.x+Xe,y:Le.y+Xe},Fe.bitmap)}}this.image=ge,this.positions=Z}}s.dY(_i,"GlyphAtlas");class yt{constructor(H){this.tileID=new s.aH(H.tileID.overscaledZ,H.tileID.wrap,H.tileID.canonical.z,H.tileID.canonical.x,H.tileID.canonical.y),this.tileZoom=H.tileZoom,this.uid=H.uid,this.zoom=H.zoom,this.lut=H.lut,this.canonical=H.tileID.canonical,this.pixelRatio=H.pixelRatio,this.tileSize=H.tileSize,this.source=H.source,this.scope=H.scope,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=H.showCollisionBoxes,this.collectResourceTiming=!!H.request&&H.request.collectResourceTiming,this.promoteId=H.promoteId,this.isSymbolTile=H.isSymbolTile,this.tileTransform=s.aR(H.tileID.canonical,H.projection),this.projection=H.projection,this.worldview=H.worldview,this.localizableLayerIds=H.localizableLayerIds,this.brightness=H.brightness,this.extraShadowCaster=!!H.extraShadowCaster,this.tessellationStep=H.tessellationStep,this.scaleFactor=H.scaleFactor}parse(H,Z,re,de,ue){this.status="parsing",this.data=H,this.collisionBoxArray=new s.aX;const ge=new s.d$(Object.keys(H.layers).sort()),Pe=new s.e0(this.tileID,this.promoteId);Pe.bucketLayerIDs=[];const ve={},Re=new s.e1(256,256),Fe={featureIndex:Pe,iconDependencies:new Map,patternDependencies:new Map,glyphDependencies:{},lineAtlas:Re,availableImages:re,brightness:this.brightness,scaleFactor:this.scaleFactor,elevationFeatures:void 0},Le=Z.familiesBySource[this.source];for(const Xt in Le){const xi=H.layers[Xt];if(!xi)continue;let vi=!1,Ti=!1,Wi=!1;for(const Or of Le[Xt])Or[0].type==="symbol"?vi=!0:Ti=!0,Or[0].is3D()&&Or[0].type!=="model"&&(Wi=!0);if(this.extraShadowCaster&&!Wi||this.isSymbolTile===!0&&!vi||this.isSymbolTile===!1&&!Ti)continue;xi.version===1&&s.w(`Vector tile source "${this.source}" layer "${Xt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const hr=ge.encode(Xt),Ar=[];let _n=!1;for(let Or=0,dr=0;Or=dr.maxzoom||dr.visibility!=="none"&&(ut(Or,this.zoom,Fe.brightness,re),(ve[dr.id]=dr.createBucket({index:Pe.bucketLayerIDs.length,layers:Or,zoom:this.zoom,lut:this.lut,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:hr,sourceID:this.source,projection:this.projection.spec,tessellationStep:this.tessellationStep})).populate(Ar,Fe,this.tileID.canonical,this.tileTransform),Pe.bucketLayerIDs.push(Or.map(mr=>s.C(mr.id,mr.scope)))))}}let Xe,ot,ht,Dt,Bt,Nt;Re.trim();const Gt={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},zi=()=>{if(Xe)return this.status="done",ue(Xe);if(this.extraShadowCaster)this.status="done",ue(null,{buckets:Object.values(ve).filter(Xt=>!Xt.isEmpty()),featureIndex:Pe,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:Fe.brightness,glyphMap:null,iconMap:null,glyphPositions:null});else if(ot&&ht&&Dt){const Xt=new _i(ot),xi=new Map;for(const[Wi,hr]of ht.entries()){const{imagePosition:Ar}=s.e7(Wi,hr,s.e8);xi.set(Wi,Ar)}const vi={};for(const Wi in ve){const hr=ve[Wi];hr instanceof s.aY&&(ut(hr.layers,this.zoom,Fe.brightness,re),vi[Wi]=s.e9(hr,ot,Xt.positions,ht,xi,this.tileID.canonical,this.tileZoom,this.scaleFactor,this.pixelRatio))}const Ti={iconsPending:!0,patternsPending:!0};this.rasterizeIfNeeded(de,ht,Bt,()=>{Ti.iconsPending=!1,Ui(vi,Xt,Ti)}),this.rasterizeIfNeeded(de,Dt,Nt,()=>{Ti.patternsPending=!1,Ui(vi,Xt,Ti)})}},Ui=(Xt,xi,vi,Ti)=>{if(vi.iconsPending||vi.patternsPending)return;const Wi=new s.ea(ht,Dt,this.lut);for(const hr in ve){const Ar=ve[hr];if(hr in Xt)s.eb(Ar,Xt[hr],this.showCollisionBoxes,re,this.tileID.canonical,this.tileZoom,this.projection,this.brightness,ht,Wi);else if(Ar.hasPattern&&(Ar instanceof s.b2||Ar instanceof s.b3||Ar instanceof s.d8)){ut(Ar.layers,this.zoom,Fe.brightness,re);const _n=Object.fromEntries(Wi.patternPositions);Ar.addFeatures(Fe,this.tileID.canonical,_n,re,this.tileTransform,this.brightness)}}this.status="done",ue(null,{buckets:Object.values(ve).filter(hr=>!hr.isEmpty()),featureIndex:Pe,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:xi.image,lineAtlas:Re,imageAtlas:Wi,brightness:Fe.brightness})};if(!this.extraShadowCaster){const Xt=s.e5(Fe.glyphDependencies,Ti=>Object.keys(Ti).map(Number));Object.keys(Xt).length?de.send("getGlyphs",{uid:this.uid,stacks:Xt,scope:this.scope},(Ti,Wi)=>{Xe||(Xe=Ti,ot=Wi,zi())},void 0,!1,Gt):ot={};const xi=Array.from(Fe.iconDependencies.keys()).map(Ti=>s.I.parse(Ti));xi.length?de.send("getImages",{images:xi,source:this.source,scope:this.scope,tileID:this.tileID,type:"icons"},(Ti,Wi)=>{Xe||(Xe=Ti,ht=new Map,Bt=this.updateImageMapAndGetImageTaskQueue(ht,Wi,Fe.iconDependencies),zi())},void 0,!1,Gt):(ht=new Map,Bt=new Map);const vi=Array.from(Fe.patternDependencies.keys()).map(Ti=>s.I.parse(Ti));vi.length?de.send("getImages",{images:vi,source:this.source,scope:this.scope,tileID:this.tileID,type:"patterns"},(Ti,Wi)=>{Xe||(Xe=Ti,Dt=new Map,Nt=this.updateImageMapAndGetImageTaskQueue(Dt,Wi,Fe.patternDependencies),zi())},void 0,!1,Gt):(Dt=new Map,Nt=new Map)}if(Fe.elevationFeatures&&Fe.elevationFeatures.length>0){const Xt=[];for(const vi of Object.values(ve))if(vi instanceof s.b3){const Ti=vi.getUnevaluatedPortalGraph();Ti&&Xt.push(Ti)}const xi=s.e6.evaluate(Xt);for(const vi of Object.values(ve))vi instanceof s.b3&&vi.setEvaluatedPortalGraph(xi)}zi()}rasterizeIfNeeded(H,Z,re,de){Array.from(Z.values()).some(ue=>ue.usvg)?this.rasterize(H,Z,re,de):de()}updateImageMapAndGetImageTaskQueue(H,Z,re){const de=new Map;for(const ue of Z.keys()){const ge=re.get(ue)||[];for(const Pe of ge){const ve=Pe.toString(),Re=Z.get(Pe.id.toString());Re.usvg?de.has(ve)||(de.set(ve,Pe),H.set(ve,Object.assign({},Re))):H.set(ve,Re)}}return de}rasterize(H,Z,re,de){this.rasterizeTask=H.send("rasterizeImages",{scope:this.scope,tasks:re},(ue,ge)=>{if(!ue)for(const[Pe,ve]of ge.entries()){const Re=Object.assign(Z.get(Pe),{data:ve});Z.set(Pe,Re)}de()})}cancelRasterize(){this.rasterizeTask&&this.rasterizeTask.cancel()}}function ut(Oe,H,Z,re){const de=new s.aa(H,{brightness:Z});for(const ue of Oe)ue.recalculate(de,re)}class oi extends s.E{constructor(H,Z,re,de,ue,ge){super(),this.actor=H,this.layerIndex=Z,this.availableImages=re,this.loadVectorData=ue||s.aE,this.loading={},this.loaded={},this.deduped=new s.aD(H.scheduler),this.isSpriteLoaded=de,this.scheduler=H.scheduler,this.brightness=ge}loadTile(H,Z){const re=H.uid,de=H&&H.request,ue=de&&de.collectResourceTiming,ge=this.loading[re]=new yt(H);ge.abort=this.loadVectorData(H,(Pe,ve)=>{const Re=!this.loading[re];if(delete this.loading[re],ge.cancelRasterize(),Re||Pe||!ve)return ge.status="done",Re||(this.loaded[re]=ge),Z(Pe);const Fe=ve.rawData,Le={};ve.expires&&(Le.expires=ve.expires),ve.cacheControl&&(Le.cacheControl=ve.cacheControl),ge.vectorTile=ve.vectorTile||new s.ec.VectorTile(new s.bi(Fe));const Xe=()=>{ge.parse(ge.vectorTile,this.layerIndex,this.availableImages,this.actor,(ot,ht)=>{if(ot||!ht)return Z(ot);const Dt={};if(ue){const Bt=gt(de);Bt.length>0&&(Dt.resourceTiming=JSON.parse(JSON.stringify(Bt)))}Z(null,s.l({rawTileData:Fe.slice(0)},ht,Le,Dt))})};this.isSpriteLoaded?Xe():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(Xe,{type:"parseTile",isSymbolTile:H.isSymbolTile,zoom:H.tileZoom}):Xe()}),this.loaded=this.loaded||{},this.loaded[re]=ge})}reloadTile(H,Z){const re=this.loaded,de=H.uid;if(re&&re[de]){const ue=re[de];ue.scaleFactor=H.scaleFactor,ue.showCollisionBoxes=H.showCollisionBoxes,ue.projection=H.projection,ue.brightness=H.brightness,ue.tileTransform=s.aR(H.tileID.canonical,H.projection),ue.extraShadowCaster=H.extraShadowCaster,ue.lut=H.lut;const ge=(Pe,ve)=>{const Re=ue.reloadCallback;Re&&(delete ue.reloadCallback,ue.parse(ue.vectorTile,this.layerIndex,this.availableImages,this.actor,Re)),Z(Pe,ve)};ue.status==="parsing"?ue.reloadCallback=ge:ue.status==="done"&&(ue.vectorTile?ue.parse(ue.vectorTile,this.layerIndex,this.availableImages,this.actor,ge):ge())}else Z(null,void 0)}abortTile(H,Z){const re=H.uid,de=this.loading[re];de&&(de.abort&&de.abort(),delete this.loading[re]),Z()}removeTile(H,Z){const re=this.loaded,de=H.uid;re&&re[de]&&delete re[de],Z()}}class kt{loadTile(H,Z){const{uid:re,encoding:de,rawImageData:ue,padding:ge}=H,Pe=ImageBitmap&&ue instanceof ImageBitmap?this.getImageData(ue,ge):ue;Z(null,new s.ed(re,Pe,de,ge<1))}reloadTile(H,Z){Z(null,null)}abortTile(H,Z){Z()}removeTile(H,Z){Z()}getImageData(H,Z){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(H.width,H.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=H.width,this.offscreenCanvas.height=H.height,this.offscreenCanvasContext.drawImage(H,0,0,H.width,H.height);const re=this.offscreenCanvasContext.getImageData(-Z,-Z,H.width+2*Z,H.height+2*Z);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),re}}s.bh.setPbf(s.bi);class Dr{constructor(H){this._mrt=new s.bh(H.partial?30:1/0),this._isHeaderLoaded=!1,this.uid=H.uid,this.tileID=H.tileID,this.source=H.source}parse(H,Z){const re=this._mrt;this.status="parsing",this._entireBuffer=H;try{re.parseHeader(H),this._isHeaderLoaded=!0;const de=[];for(const ue in re.layers){const ge=re.getLayer(ue),Pe=ge.getDataRange(ge.getBandList()),ve=re.createDecodingTask(Pe),Re=H.slice(Pe.firstByte,Pe.lastByte+1),Fe=s.bh.performDecoding(Re,ve).then(Le=>ve.complete(null,Le)).catch(Le=>ve.complete(Le,null));de.push(Fe)}Promise.allSettled(de).then(()=>Z(null,re))}catch(de){Z(de)}}}class $r{constructor(H){this.actor=H,this.loading={},this.loaded={}}loadTile(H,Z){const re=H.uid,de=H.request,ue=this.loading[re]=new Dr(H),{cancel:ge}=s.bj(de,(Pe,ve,Re,Fe)=>{const Le=!this.loading[re];if(delete this.loading[re],Le||Pe||!ve)return ue.status="done",Le||(this.loaded[re]=ue),Z(Pe);ue.parse(ve,(Xe,ot)=>{if(Xe||!ot)return Z(Xe);Z(null,ot,Re,Fe)}),this.loaded[re]=ue});ue.abort=ge}reloadTile(H,Z){Z(null,void 0)}abortTile(H,Z){const re=H.uid,de=this.loading[re];de&&(de.abort&&de.abort(),delete this.loading[re]),Z()}removeTile(H,Z){const re=H.uid;this.loaded[re]&&delete this.loaded[re],Z()}decodeRasterArray({task:H,buffer:Z},re){s.bh.performDecoding(Z,H).then(de=>re(null,de)).catch(de=>re(de))}}const mi=s.ec.VectorTileFeature.prototype.toGeoJSON;class Nn{constructor(H){this._feature=H,this.extent=s.ai,this.type=H.type,this.properties=H.tags,"id"in H&&!isNaN(H.id)&&(this.id=parseInt(H.id,10))}loadGeometry(){if(this._feature.type===1){const H=[];for(const Z of this._feature.geometry)H.push([new s.P(Z[0],Z[1])]);return H}{const H=[];for(const Z of this._feature.geometry){const re=[];for(const de of Z)re.push(new s.P(de[0],de[1]));H.push(re)}return H}}toGeoJSON(H,Z,re){return mi.call(this,H,Z,re)}}class Co{constructor(H){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=s.ai,this.length=H.length,this._features=H}feature(H){return new Nn(this._features[H])}}const vt=64/4096,dn=128;class zo{constructor(){this.features=new Map}clear(){this.features.clear()}load(H=[],Z){for(const re of H){const de=re.id;if(de==null)continue;let ue=this.features.get(de);ue&&this.updateCache(ue,Z),re.geometry?(ue=Ut(re),this.updateCache(ue,Z),this.features.set(de,ue)):this.features.delete(de),this.updateCache(ue,Z)}}updateCache(H,Z){for(const{canonical:re,uid:de}of Object.values(Z)){const{z:ue,x:ge,y:Pe}=re;Ft(H,Math.pow(2,ue),ge,Pe)&&delete Z[de]}}getTile(H,Z,re){const de=Math.pow(2,H),ue=[];for(const ge of this.features.values())Ft(ge,de,Z,re)&&ue.push(Kt(ge,de,Z,re));return{features:ue}}getFeatures(){return[...this.features.values()]}}function Ft({minX:Oe,minY:H,maxX:Z,maxY:re},de,ue,ge){return Oe<(ue+1+vt)/de&&H<(ge+1+vt)/de&&Z>(ue-vt)/de&&re>(ge-vt)/de}function Ut(Oe){const{id:H,geometry:Z,properties:re}=Oe;if(!Z)return;if(Z.type==="GeometryCollection")throw new Error("GeometryCollection not supported in dynamic mode.");const{type:de,coordinates:ue}=Z,ge={id:H,type:1,geometry:[],tags:re,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},Pe=ge.geometry;if(de==="Point")Ro(ue,Pe,ge);else if(de==="MultiPoint")for(const ve of ue)Ro(ve,Pe,ge);else if(de==="LineString")ge.type=2,ts(ue,Pe,ge);else if(de==="MultiLineString")ge.type=2,Es(ue,Pe,ge);else if(de==="Polygon")ge.type=3,Es(ue,Pe,ge,!0);else{if(de!=="MultiPolygon")throw new Error("Input data is not a valid GeoJSON object.");ge.type=3;for(const ve of ue)Es(ve,Pe,ge,!0)}return ge}function Ro([Oe,H],Z,re){const de=s.av(Oe);let ue=s.aC(H);ue=ue<0?0:ue>1?1:ue,Z.push(de,ue),re.minX=Math.min(re.minX,de),re.minY=Math.min(re.minY,ue),re.maxX=Math.max(re.maxX,de),re.maxY=Math.max(re.maxY,ue)}function ts(Oe,H,Z,re=!1,de=!1){const ue=[];for(const ge of Oe)Ro(ge,ue,Z);H.push(ue),re&&function(ge,Pe){let ve=0;for(let Re=0,Fe=ge.length,Le=Fe-2;Re0===Pe)for(let Re=0,Fe=ge.length;Re=ge&&Le>=ge||(Re>=ge?(Fe+=Math.round(ht*((ge-Re)/ot)),Re=ge):Le>=ge&&(Xe=Fe+Math.round(ht*((ge-Re)/ot)),Le=ge),Fe>=ge&&Xe>=ge||(Fe>=ge?(Re+=Math.round(ot*((ge-Fe)/ht)),Fe=ge):Xe>=ge&&(Le=Re+Math.round(ot*((ge-Fe)/ht)),Xe=ge),Pe&&Re===Pe[Pe.length-1][0]&&Fe===Pe[Pe.length-1][1]||(Pe=[[Re,Fe]],de.push(Pe)),Pe.push([Le,Xe])))))}}var An,Ms,Jt,pn={exports:{}},Oa=function(){if(Jt)return pn.exports;Jt=1;var Oe=s.eg(),H=function(){if(Ms)return An;Ms=1;var Fe=s.ee(),Le=s.ef().VectorTileFeature;function Xe(ht,Dt){this.options=Dt||{},this.features=ht,this.length=ht.length}function ot(ht,Dt){this.id=typeof ht.id=="number"?ht.id:void 0,this.type=ht.type,this.rawGeometry=ht.type===1?[ht.geometry]:ht.geometry,this.properties=ht.tags,this.extent=Dt||4096}return An=Xe,Xe.prototype.feature=function(ht){return new ot(this.features[ht],this.options.extent)},ot.prototype.loadGeometry=function(){var ht=this.rawGeometry;this.geometry=[];for(var Dt=0;Dt>31}function ve(Fe,Le){for(var Xe=Fe.loadGeometry(),ot=Fe.type,ht=0,Dt=0,Bt=Xe.length,Nt=0;NtOe},k0=Math.fround||(Is=new Float32Array(1),Oe=>(Is[0]=+Oe,Is[0]));var Is;const fn=3,mn=5,Ps=6;class Cs{constructor(H){this.options=Object.assign(Object.create(qt),H),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(H){const{log:Z,minZoom:re,maxZoom:de}=this.options;Z&&console.time("total time");const ue=`prepare ${H.length} points`;Z&&console.time(ue),this.points=H;const ge=[];for(let ve=0;ve=re;ve--){const Re=+Date.now();Pe=this.trees[ve]=this._createTree(this._cluster(Pe,ve)),Z&&console.log("z%d: %d clusters in %dms",ve,Pe.numItems,+Date.now()-Re)}return Z&&console.timeEnd("total time"),this}getClusters(H,Z){let re=((H[0]+180)%360+360)%360-180;const de=Math.max(-90,Math.min(90,H[1]));let ue=H[2]===180?180:((H[2]+180)%360+360)%360-180;const ge=Math.max(-90,Math.min(90,H[3]));if(H[2]-H[0]>=360)re=-180,ue=180;else if(re>ue){const Le=this.getClusters([re,de,180,ge],Z),Xe=this.getClusters([-180,de,ue,ge],Z);return Le.concat(Xe)}const Pe=this.trees[this._limitZoom(Z)],ve=Pe.range(Do(re),Lo(ge),Do(ue),Lo(de)),Re=Pe.data,Fe=[];for(const Le of ve){const Xe=this.stride*Le;Fe.push(Re[Xe+mn]>1?Q(Re,Xe,this.clusterProps):this.points[Re[Xe+fn]])}return Fe}getChildren(H){const Z=this._getOriginId(H),re=this._getOriginZoom(H),de="No cluster with the specified id.",ue=this.trees[re];if(!ue)throw new Error(de);const ge=ue.data;if(Z*this.stride>=ge.length)throw new Error(de);const Pe=this.options.radius/(this.options.extent*Math.pow(2,re-1)),ve=ue.within(ge[Z*this.stride],ge[Z*this.stride+1],Pe),Re=[];for(const Fe of ve){const Le=Fe*this.stride;ge[Le+4]===H&&Re.push(ge[Le+mn]>1?Q(ge,Le,this.clusterProps):this.points[ge[Le+fn]])}if(Re.length===0)throw new Error(de);return Re}getLeaves(H,Z,re){const de=[];return this._appendLeaves(de,H,Z=Z||10,re=re||0,0),de}getTile(H,Z,re){const de=this.trees[this._limitZoom(H)],ue=Math.pow(2,H),{extent:ge,radius:Pe}=this.options,ve=Pe/ge,Re=(re-ve)/ue,Fe=(re+1+ve)/ue,Le={features:[]};return this._addTileFeatures(de.range((Z-ve)/ue,Re,(Z+1+ve)/ue,Fe),de.data,Z,re,ue,Le),Z===0&&this._addTileFeatures(de.range(1-ve/ue,Re,1,Fe),de.data,ue,re,ue,Le),Z===ue-1&&this._addTileFeatures(de.range(0,Re,ve/ue,Fe),de.data,-1,re,ue,Le),Le.features.length?Le:null}getClusterExpansionZoom(H){let Z=this._getOriginZoom(H)-1;for(;Z<=this.options.maxZoom;){const re=this.getChildren(H);if(Z++,re.length!==1)break;H=re[0].properties.cluster_id}return Z}_appendLeaves(H,Z,re,de,ue){const ge=this.getChildren(Z);for(const Pe of ge){const ve=Pe.properties;if(ve&&ve.cluster?ue+ve.point_count<=de?ue+=ve.point_count:ue=this._appendLeaves(H,ve.cluster_id,re,de,ue):ue1;let Fe,Le,Xe;if(Re)Fe=is(Z,ve,this.clusterProps),Le=Z[ve],Xe=Z[ve+1];else{const Dt=this.points[Z[ve+fn]];Fe=Dt.properties;const[Bt,Nt]=Dt.geometry.coordinates;Le=Do(Bt),Xe=Lo(Nt)}const ot={type:1,geometry:[[Math.round(this.options.extent*(Le*ue-re)),Math.round(this.options.extent*(Xe*ue-de))]],tags:Fe};let ht;ht=Re||this.options.generateId?Z[ve+fn]:this.points[Z[ve+fn]].id,ht!==void 0&&(ot.id=ht),ge.features.push(ot)}}_limitZoom(H){return Math.max(this.options.minZoom,Math.min(Math.floor(+H),this.options.maxZoom+1))}_cluster(H,Z){const{radius:re,extent:de,reduce:ue,minPoints:ge}=this.options,Pe=re/(de*Math.pow(2,Z)),ve=H.data,Re=[],Fe=this.stride;for(let Le=0;LeZ&&(Bt+=ve[Gt+mn])}if(Bt>Dt&&Bt>=ge){let Nt,Gt=Xe*Dt,zi=ot*Dt,Ui=-1;const Xt=(Le/Fe<<5)+(Z+1)+this.points.length;for(const xi of ht){const vi=xi*Fe;if(ve[vi+2]<=Z)continue;ve[vi+2]=Z;const Ti=ve[vi+mn];Gt+=ve[vi]*Ti,zi+=ve[vi+1]*Ti,ve[vi+4]=Xt,ue&&(Nt||(Nt=this._map(ve,Le,!0),Ui=this.clusterProps.length,this.clusterProps.push(Nt)),ue(Nt,this._map(ve,vi)))}ve[Le+4]=Xt,Re.push(Gt/Bt,zi/Bt,1/0,Xt,-1,Bt),ue&&Re.push(Ui)}else{for(let Nt=0;Nt1)for(const Nt of ht){const Gt=Nt*Fe;if(!(ve[Gt+2]<=Z)){ve[Gt+2]=Z;for(let zi=0;zi>5}_getOriginZoom(H){return(H-this.points.length)%32}_map(H,Z,re){if(H[Z+mn]>1){const ge=this.clusterProps[H[Z+Ps]];return re?Object.assign({},ge):ge}const de=this.points[H[Z+fn]].properties,ue=this.options.map(de);return re&&ue===de?Object.assign({},ue):ue}}function Q(Oe,H,Z){return{type:"Feature",id:Oe[H+fn],properties:is(Oe,H,Z),geometry:{type:"Point",coordinates:[(re=Oe[H],360*(re-.5)),Qe(Oe[H+1])]}};var re}function is(Oe,H,Z){const re=Oe[H+mn],de=re>=1e4?`${Math.round(re/1e3)}k`:re>=1e3?Math.round(re/100)/10+"k":re,ue=Oe[H+Ps],ge=ue===-1?{}:Object.assign({},Z[ue]);return Object.assign(ge,{cluster:!0,cluster_id:Oe[H+fn],point_count:re,point_count_abbreviated:de})}function Do(Oe){return Oe/360+.5}function Lo(Oe){const H=Math.sin(Oe*Math.PI/180),Z=.5-.25*Math.log((1+H)/(1-H))/Math.PI;return Z<0?0:Z>1?1:Z}function Qe(Oe){const H=(180-360*Oe)*Math.PI/180;return 360*Math.atan(Math.exp(H))/Math.PI-90}function In(Oe,H,Z,re){let de=re;const ue=H+(Z-H>>1);let ge,Pe=Z-H;const ve=Oe[H],Re=Oe[H+1],Fe=Oe[Z],Le=Oe[Z+1];for(let Xe=H+3;Xede)ge=Xe,de=ot;else if(ot===de){const ht=Math.abs(Xe-ue);htre&&(ge-H>3&&In(Oe,H,ge,re),Oe[ge+2]=de,Z-ge>3&&In(Oe,ge,Z,re))}function Br(Oe,H,Z,re,de,ue){let ge=de-Z,Pe=ue-re;if(ge!==0||Pe!==0){const ve=((Oe-Z)*ge+(H-re)*Pe)/(ge*ge+Pe*Pe);ve>1?(Z=de,re=ue):ve>0&&(Z+=ge*ve,re+=Pe*ve)}return ge=Oe-Z,Pe=H-re,ge*ge+Pe*Pe}function Vn(Oe,H,Z,re){const de={id:Oe??null,type:H,geometry:Z,tags:re,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(H==="Point"||H==="MultiPoint"||H==="LineString")ri(de,Z);else if(H==="Polygon")ri(de,Z[0]);else if(H==="MultiLineString")for(const ue of Z)ri(de,ue);else if(H==="MultiPolygon")for(const ue of Z)ri(de,ue[0]);return de}function ri(Oe,H){for(let Z=0;Z0&&(ge+=re?(de*Fe-Re*ue)/2:Math.sqrt(Math.pow(Re-de,2)+Math.pow(Fe-ue,2))),de=Re,ue=Fe}const Pe=H.length-3;H[2]=1,In(H,0,Pe,Z),H[Pe+2]=1,H.size=Math.abs(ge),H.start=0,H.end=H.size}function eo(Oe,H,Z,re){for(let de=0;de1?1:Z}function Nr(Oe,H,Z,re,de,ue,ge,Pe){if(re/=H,ue>=(Z/=H)&&ge=re)return null;const ve=[];for(const Re of Oe){const Fe=Re.geometry;let Le=Re.type;const Xe=de===0?Re.minX:Re.minY,ot=de===0?Re.maxX:Re.maxY;if(Xe>=Z&&ot=re)continue;let ht=[];if(Le==="Point"||Le==="MultiPoint")Oo(Fe,ht,Z,re,de);else if(Le==="LineString")ns(Fe,ht,Z,re,de,!1,Pe.lineMetrics);else if(Le==="MultiLineString")to(Fe,ht,Z,re,de,!1);else if(Le==="Polygon")to(Fe,ht,Z,re,de,!0);else if(Le==="MultiPolygon")for(const Dt of Fe){const Bt=[];to(Dt,Bt,Z,re,de,!0),Bt.length&&ht.push(Bt)}if(ht.length){if(Pe.lineMetrics&&Le==="LineString"){for(const Dt of ht)ve.push(Vn(Re.id,Le,Dt,Re.tags));continue}Le!=="LineString"&&Le!=="MultiLineString"||(ht.length===1?(Le="LineString",ht=ht[0]):Le="MultiLineString"),Le!=="Point"&&Le!=="MultiPoint"||(Le=ht.length===3?"Point":"MultiPoint"),ve.push(Vn(Re.id,Le,ht,Re.tags))}}return ve.length?ve:null}function Oo(Oe,H,Z,re,de){for(let ue=0;ue=Z&&ge<=re&&jn(H,Oe[ue],Oe[ue+1],Oe[ue+2])}}function ns(Oe,H,Z,re,de,ue,ge){let Pe=Lr(Oe);const ve=de===0?ka:Fa;let Re,Fe,Le=Oe.start;for(let Bt=0;BtZ&&(Fe=ve(Pe,Nt,Gt,Ui,Xt,Z),ge&&(Pe.start=Le+Re*Fe)):xi>re?vi=Z&&(Fe=ve(Pe,Nt,Gt,Ui,Xt,Z),Ti=!0),vi>re&&xi<=re&&(Fe=ve(Pe,Nt,Gt,Ui,Xt,re),Ti=!0),!ue&&Ti&&(ge&&(Pe.end=Le+Re*Fe),H.push(Pe),Pe=Lr(Oe)),ge&&(Le+=Re)}let Xe=Oe.length-3;const ot=Oe[Xe],ht=Oe[Xe+1],Dt=de===0?ot:ht;Dt>=Z&&Dt<=re&&jn(Pe,ot,ht,Oe[Xe+2]),Xe=Pe.length-3,ue&&Xe>=3&&(Pe[Xe]!==Pe[0]||Pe[Xe+1]!==Pe[1])&&jn(Pe,Pe[0],Pe[1],Pe[2]),Pe.length&&H.push(Pe)}function Lr(Oe){const H=[];return H.size=Oe.size,H.start=Oe.start,H.end=Oe.end,H}function to(Oe,H,Z,re,de,ue){for(const ge of Oe)ns(ge,H,Z,re,de,ue,!1)}function jn(Oe,H,Z,re){Oe.push(H,Z,re)}function ka(Oe,H,Z,re,de,ue){const ge=(ue-H)/(re-H);return jn(Oe,ue,Z+(de-Z)*ge,1),ge}function Fa(Oe,H,Z,re,de,ue){const ge=(ue-Z)/(de-Z);return jn(Oe,H+(re-H)*ge,ue,1),ge}function os(Oe,H){const Z=[];for(let re=0;re0&&H.size<(de?ge:re))return void(Z.numPoints+=H.length/3);const Pe=[];for(let ve=0;vege)&&(Z.numSimplified++,Pe.push(H[ve],H[ve+1])),Z.numPoints++;de&&function(ve,Re){let Fe=0;for(let Le=0,Xe=ve.length,ot=Xe-2;Le0===Re)for(let Le=0,Xe=ve.length;Le24)throw new Error("maxZoom should be in the 0-24 range");if(Z.promoteId&&Z.generateId)throw new Error("promoteId and generateId cannot be used together.");let de=function(ue,ge){const Pe=[];if(ue.type==="FeatureCollection")for(let ve=0;ve1&&console.time("creation"),ot=this.tiles[Xe]=ji(H,Z,re,de,Re),this.tileCoords.push({z:Z,x:re,y:de}),Fe)){Fe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Z,re,de,ot.numFeatures,ot.numPoints,ot.numSimplified),console.timeEnd("creation"));const Ti=`z${Z}`;this.stats[Ti]=(this.stats[Ti]||0)+1,this.total++}if(ot.source=H,ue==null){if(Z===Re.indexMaxZoom||ot.numPoints<=Re.indexMaxPoints)continue}else{if(Z===Re.maxZoom||Z===ue)continue;if(ue!=null){const Ti=ue-Z;if(re!==ge>>Ti||de!==Pe>>Ti)continue}}if(ot.source=null,H.length===0)continue;Fe>1&&console.time("clipping");const ht=.5*Re.buffer/Re.extent,Dt=.5-ht,Bt=.5+ht,Nt=1+ht;let Gt=null,zi=null,Ui=null,Xt=null,xi=Nr(H,Le,re-ht,re+Bt,0,ot.minX,ot.maxX,Re),vi=Nr(H,Le,re+Dt,re+Nt,0,ot.minX,ot.maxX,Re);H=null,xi&&(Gt=Nr(xi,Le,de-ht,de+Bt,1,ot.minY,ot.maxY,Re),zi=Nr(xi,Le,de+Dt,de+Nt,1,ot.minY,ot.maxY,Re),xi=null),vi&&(Ui=Nr(vi,Le,de-ht,de+Bt,1,ot.minY,ot.maxY,Re),Xt=Nr(vi,Le,de+Dt,de+Nt,1,ot.minY,ot.maxY,Re),vi=null),Fe>1&&console.timeEnd("clipping"),ve.push(Gt||[],Z+1,2*re,2*de),ve.push(zi||[],Z+1,2*re,2*de+1),ve.push(Ui||[],Z+1,2*re+1,2*de),ve.push(Xt||[],Z+1,2*re+1,2*de+1)}}getTile(H,Z,re){H=+H,Z=+Z,re=+re;const de=this.options,{extent:ue,debug:ge}=de;if(H<0||H>24)return null;const Pe=1<1&&console.log("drilling down to z%d-%d-%d",H,Z,re);let Re,Fe=H,Le=Z,Xe=re;for(;!Re&&Fe>0;)Fe--,Le>>=1,Xe>>=1,Re=this.tiles[as(Fe,Le,Xe)];return Re&&Re.source?(ge>1&&(console.log("found parent tile z%d-%d-%d",Fe,Le,Xe),console.time("drilling down")),this.splitTile(Re.source,Fe,Le,Xe,H,Z,re),ge>1&&console.timeEnd("drilling down"),this.tiles[ve]?en(this.tiles[ve],ue):null):null}}function as(Oe,H,Z){return 32*((1<{if(ue||!ge)return Z(ue);if(typeof ge!="object")return Z(new Error(`Input data given to '${H.source}' is not a valid GeoJSON object.`));{try{if(H.filter){const ve=s.X(H.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ve.result==="error")throw new Error(ve.value.map(Re=>`${Re.key}: ${Re.message}`).join(", "));ge.features=ge.features.filter(Re=>ve.value.evaluate({zoom:0},Re))}H.dynamic?(ge.type==="Feature"&&(ge={type:"FeatureCollection",features:[ge]}),H.append||(this._dynamicIndex.clear(),this.loaded={}),this._dynamicIndex.load(ge.features,this.loaded),H.cluster&&(ge.features=this._dynamicIndex.getFeatures())):this.loaded={},this._geoJSONIndex=H.cluster?new Cs(function({superclusterOptions:ve,clusterProperties:Re}){if(!Re||!ve)return ve;const Fe={},Le={},Xe={accumulated:null,zoom:0},ot={properties:null},ht=Object.keys(Re);for(const Dt of ht){const[Bt,Nt]=Re[Dt],Gt=s.X(Nt),zi=s.X(typeof Bt=="string"?[Bt,["accumulated"],["get",Dt]]:Bt);Fe[Dt]=Gt.value,Le[Dt]=zi.value}return ve.map=Dt=>{ot.properties=Dt;const Bt={};for(const Nt of ht)Bt[Nt]=Fe[Nt].evaluate(Xe,ot);return Bt},ve.reduce=(Dt,Bt)=>{ot.properties=Bt;for(const Nt of ht)Xe.accumulated=Dt[Nt],Dt[Nt]=Le[Nt].evaluate(Xe,ot)},ve}(H)).load(ge.features):H.dynamic?this._dynamicIndex:function(ve,Re){return new Vr(ve,Re)}(ge,H.geojsonVtOptions)}catch(ve){return Z(ve)}const Pe={};if(de){const ve=gt(re);ve&&(Pe.resourceTiming={},Pe.resourceTiming[H.source]=JSON.parse(JSON.stringify(ve)))}Z(null,Pe)}})}reloadTile(H,Z){const re=this.loaded;return re&&re[H.uid]?H.partial?Z(null,void 0):super.reloadTile(H,Z):this.loadTile(H,Z)}loadGeoJSON(H,Z){if(H.request)s.n(H.request,Z);else{if(typeof H.data!="string")return Z(new Error(`Input data given to '${H.source}' is not a valid GeoJSON object.`));try{return Z(null,JSON.parse(H.data))}catch{return Z(new Error(`Input data given to '${H.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(H,Z){try{Z(null,this._geoJSONIndex.getClusterExpansionZoom(H.clusterId))}catch(re){Z(re)}}getClusterChildren(H,Z){try{Z(null,this._geoJSONIndex.getChildren(H.clusterId))}catch(re){Z(re)}}getClusterLeaves(H,Z){try{Z(null,this._geoJSONIndex.getLeaves(H.clusterId,H.limit,H.offset))}catch(re){Z(re)}}}class F0{constructor(H,Z){this.tileID=new s.aH(H.tileID.overscaledZ,H.tileID.wrap,H.tileID.canonical.z,H.tileID.canonical.x,H.tileID.canonical.y),this.tileZoom=H.tileZoom,this.uid=H.uid,this.zoom=H.zoom,this.canonical=H.tileID.canonical,this.pixelRatio=H.pixelRatio,this.tileSize=H.tileSize,this.source=H.source,this.overscaling=this.tileID.overscaleFactor(),this.projection=H.projection,this.brightness=Z}parse(H,Z,re,de){this.status="parsing";const ue=new s.aH(re.tileID.overscaledZ,re.tileID.wrap,re.tileID.canonical.z,re.tileID.canonical.x,re.tileID.canonical.y),ge=[],Pe=Z.familiesBySource[re.source],ve=new s.e0(ue,re.promoteId);return ve.bucketLayerIDs=[],ve.is3DTile=!0,s.ei(H).then(Re=>{if(!Re)return de(new Error("Could not parse tile"));const Fe=s.ej(Re,1/s.cd(re.tileID.canonical)),Le=Re.json.extensionsUsed&&Re.json.extensionsUsed.includes("MAPBOX_mesh_features")||Re.json.asset.extras&&Re.json.asset.extras.MAPBOX_mesh_features,Xe=Re.json.extensionsUsed&&Re.json.extensionsUsed.includes("EXT_meshopt_compression"),ot=new s.aa(this.zoom,{brightness:this.brightness});for(const ht in Pe)for(const Dt of Pe[ht]){const Bt=Dt[0];ve.bucketLayerIDs.push(Dt.map(Gt=>s.C(Gt.id,Gt.scope))),Bt.recalculate(ot,[]);const Nt=new s.ek(Dt,Fe,ue,Le,Xe,this.brightness,ve);Le||(Nt.needsUpload=!0),ge.push(Nt),Nt.evaluate(Bt)}this.status="done",de(null,{buckets:ge,featureIndex:ve,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:null})}).catch(Re=>de(new Error(Re.message)))}}class B0{constructor(H,Z,re,de,ue,ge){this.actor=H,this.layerIndex=Z,this.availableImages=re,this.brightness=ge,this.loading={},this.loaded={}}loadTile(H,Z){const re=H.uid,de=this.loading[re]=new F0(H,this.brightness);s.bj(H.request,(ue,ge)=>{const Pe=!this.loading[re];return delete this.loading[re],Pe||ue?(de.status="done",Pe||(this.loaded[re]=de),Z(ue)):ge&&ge.byteLength!==0?void de.parse(ge,this.layerIndex,H,(ve,Re)=>{de.status="done",this.loaded=this.loaded||{},this.loaded[re]=de,ve||!Re?Z(ve):Z(null,Re)}):(de.status="done",this.loaded[re]=de,Z())})}reloadTile(H,Z){const re=this.loaded,de=H.uid;if(re&&re[de]){const ue=re[de];ue.projection=H.projection,ue.brightness=H.brightness;const ge=(Pe,ve)=>{ue.reloadCallback&&(delete ue.reloadCallback,this.loadTile(H,Z)),Z(Pe,ve)};ue.status==="parsing"?ue.reloadCallback=ge:ue.status==="done"&&this.loadTile(H,Z)}}abortTile(H,Z){const re=H.uid;this.loading[re]&&delete this.loading[re],Z()}removeTile(H,Z){const re=this.loaded,de=H.uid;re&&re[de]&&delete re[de],Z()}}class Va{constructor(H){this.self=H,this.actor=new s.el(H,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.imageRasterizer=new s.y,this.projections={},this.defaultProjection=s.bP({name:"mercator"}),this.workerSourceTypes={vector:oi,geojson:Ls,"raster-dem":kt,"raster-array":$r,"batched-model":B0},this.workerSources={},this.self.registerWorkerSource=(Z,re)=>{if(this.workerSourceTypes[Z])throw new Error(`Worker source with name "${Z}" already registered.`);this.workerSourceTypes[Z]=re},this.self.registerRTLTextPlugin=Z=>{if(s.em.isParsed())throw new Error("RTL text plugin already registered.");s.em.applyArabicShaping=Z.applyArabicShaping,s.em.processBidirectionalText=Z.processBidirectionalText,s.em.processStyledBidirectionalText=Z.processStyledBidirectionalText}}clearCaches(H,Z,re){delete this.layerIndexes[H],delete this.availableImages[H],delete this.workerSources[H],re()}checkIfReady(H,Z,re){re()}setReferrer(H,Z){this.referrer=Z}spriteLoaded(H,{scope:Z,isLoaded:re}){if(this.isSpriteLoaded[H]||(this.isSpriteLoaded[H]={}),this.isSpriteLoaded[H][Z]=re,this.workerSources[H]&&this.workerSources[H][Z])for(const de in this.workerSources[H][Z]){const ue=this.workerSources[H][Z][de];for(const ge in ue){const Pe=ue[ge];Pe instanceof oi&&(Pe.isSpriteLoaded=re,Pe.fire(new s.A("isSpriteLoaded")))}}}setImages(H,{scope:Z,images:re},de){if(this.availableImages[H]||(this.availableImages[H]={}),this.availableImages[H][Z]=re,this.workerSources[H]&&this.workerSources[H][Z]){for(const ue in this.workerSources[H][Z]){const ge=this.workerSources[H][Z][ue];for(const Pe in ge)ge[Pe].availableImages=re}de()}else de()}setProjection(H,Z){this.projections[H]=s.bP(Z)}setBrightness(H,Z,re){this.brightness=Z,re()}setLayers(H,Z,re){this.getLayerIndex(H,Z.scope).replace(Z.layers,Z.options),re()}updateLayers(H,Z,re){this.getLayerIndex(H,Z.scope).update(Z.layers,Z.removedIds,Z.options),re()}loadTile(H,Z,re){Z.projection=this.projections[H]||this.defaultProjection,this.getWorkerSource(H,Z.type,Z.source,Z.scope).loadTile(Z,re)}decodeRasterArray(H,Z,re){this.getWorkerSource(H,Z.type,Z.source,Z.scope).decodeRasterArray(Z,re)}reloadTile(H,Z,re){Z.projection=this.projections[H]||this.defaultProjection,this.getWorkerSource(H,Z.type,Z.source,Z.scope).reloadTile(Z,re)}abortTile(H,Z,re){this.getWorkerSource(H,Z.type,Z.source,Z.scope).abortTile(Z,re)}removeTile(H,Z,re){this.getWorkerSource(H,Z.type,Z.source,Z.scope).removeTile(Z,re)}removeSource(H,Z,re){if(!(this.workerSources[H]&&this.workerSources[H][Z.scope]&&this.workerSources[H][Z.scope][Z.type]&&this.workerSources[H][Z.scope][Z.type][Z.source]))return;const de=this.workerSources[H][Z.scope][Z.type][Z.source];delete this.workerSources[H][Z.scope][Z.type][Z.source],de.removeSource!==void 0?de.removeSource(Z,re):re()}loadWorkerSource(H,Z,re){try{this.self.importScripts(Z.url),re()}catch(de){re(de.toString())}}syncRTLPluginState(H,Z,re){try{s.em.setState(Z);const de=s.em.getPluginURL();if(s.em.isLoaded()&&!s.em.isParsed()&&de!=null){this.self.importScripts(de);const ue=s.em.isParsed();re(ue?void 0:new Error(`RTL Text Plugin failed to import scripts from ${de}`),ue)}}catch(de){re(de.toString())}}setDracoUrl(H,Z){this.dracoUrl=Z}getAvailableImages(H,Z){this.availableImages[H]||(this.availableImages[H]={});let re=this.availableImages[H][Z];return re||(re=[]),re}getLayerIndex(H,Z){this.layerIndexes[H]||(this.layerIndexes[H]={});let re=this.layerIndexes[H][Z];return re||(re=this.layerIndexes[H][Z]=new At,re.scope=Z),re}getWorkerSource(H,Z,re,de){const ue=this.workerSources;return ue[H]||(ue[H]={}),ue[H][de]||(ue[H][de]={}),ue[H][de][Z]||(ue[H][de][Z]={}),this.isSpriteLoaded[H]||(this.isSpriteLoaded[H]={}),ue[H][de][Z][re]||(ue[H][de][Z][re]=new this.workerSourceTypes[Z]({send:(ge,Pe,ve,Re,Fe,Le)=>{this.actor.send(ge,Pe,ve,H,Fe,Le)},scheduler:this.actor.scheduler},this.getLayerIndex(H,de),this.getAvailableImages(H,de),this.isSpriteLoaded[H][de],void 0,this.brightness)),ue[H][de][Z][re]}rasterizeImages(H,Z,re){const de=new Map;for(const[ue,{image:ge,imageVariant:Pe}]of Z.tasks.entries()){const ve=this.imageRasterizer.rasterize(Pe,ge,Z.scope,H);de.set(ue,ve)}re(void 0,de)}removeRasterizedImages(H,Z,re){this.imageRasterizer.removeImagesFromCacheByIds(Z.imageIds,Z.scope,H),re()}enforceCacheSizeLimit(H,Z){s.en(Z)}getWorkerPerformanceMetrics(H,Z,re){re(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Va(self)),Va}),Me(["./shared"],function(s){var gt="3.11.1";const nt={create:"create",load:"load",fullLoad:"fullLoad"},dt={mark(u){performance.mark(u)},measure(u,t,r){performance.measure(u,t,r)}};function At(u){const t=u.name.split("?")[0];return s.a(t)&&t.includes("mapbox-gl.js")?"javascript":s.a(t)&&t.includes("mapbox-gl.css")?"css":s.b(t)?"fontRange":s.c(t)?"sprite":s.i(t)?"style":s.d(t)?"tilejson":"other"}var yi,_i={},yt=function(){if(yi)return _i;function u(c){return!t(c)}function t(c){return typeof window>"u"||typeof document>"u"?"not a browser":function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var f,_,T=new Blob([""],{type:"text/javascript"}),E=URL.createObjectURL(T);try{_=new Worker(E),f=!0}catch{f=!1}return _&&_.terminate(),URL.revokeObjectURL(E),f}()?function(){var f=document.createElement("canvas");f.width=f.height=1;var _=f.getContext("2d");if(!_)return!1;var T=_.getImageData(0,0,1,1);return T&&T.width===f.width}()?(r[d=c&&c.failIfMajorPerformanceCaveat]===void 0&&(r[d]=function(f){var _,T=function(E){var M=document.createElement("canvas"),A=Object.create(u.webGLContextAttributes);return A.failIfMajorPerformanceCaveat=E,M.getContext("webgl2",A)}(f);if(!T)return!1;try{_=T.createShader(T.VERTEX_SHADER)}catch{return!1}return!(!_||T.isContextLost())&&(T.shaderSource(_,"void main() {}"),T.compileShader(_),T.getShaderParameter(_,T.COMPILE_STATUS)===!0)}(d)),r[d]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL2 support"):"insufficient Canvas/getImageData support":"insufficient worker support";var d}yi=1,_i.supported=u,_i.notSupportedReason=t;var r={};return u.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0},_i}();function ut(u,t,r){const c=document.createElement(u);return t!=null&&(c.className=t),r&&r.appendChild(c),c}function oi(u,t,r){const c=document.createElementNS("http://www.w3.org/2000/svg",u);for(const d of Object.keys(t))c.setAttributeNS(null,d,String(t[d]));return r&&r.appendChild(c),c}const kt=typeof document<"u"?document.documentElement&&document.documentElement.style:null,Dr=kt&&kt.userSelect!==void 0?"userSelect":"WebkitUserSelect";let $r;function mi(){kt&&Dr&&($r=kt[Dr],kt[Dr]="none")}function Nn(){kt&&Dr&&(kt[Dr]=$r)}function Co(u){u.preventDefault(),u.stopPropagation(),window.removeEventListener("click",Co,!0)}function vt(){window.addEventListener("click",Co,!0),window.setTimeout(()=>{window.removeEventListener("click",Co,!0)},0)}function dn(u,t){const r=u.getBoundingClientRect();return Ut(u,r,t)}function zo(u,t){const r=u.getBoundingClientRect(),c=[];for(let d=0;dthis._skuTokenExpiresAt}transformRequest(t,r){return this._transformRequestFn&&this._transformRequestFn(t,r)||{url:t}}normalizeStyleURL(t,r){if(!s.f(t))return t;const c=Hr(t);return c.params.push(`sdk=js-${gt}`),c.path=`/styles/v1${c.path}`,this._makeAPIURL(c,this._customAccessToken||r)}normalizeGlyphsURL(t,r){if(!s.f(t))return t;const c=Hr(t);return c.path=`/fonts/v1${c.path}`,this._makeAPIURL(c,this._customAccessToken||r)}normalizeModelURL(t,r){if(!s.f(t))return t;const c=Hr(t);return c.path=`/models/v1${c.path}`,this._makeAPIURL(c,this._customAccessToken||r)}normalizeSourceURL(t,r,c,d){if(!s.f(t))return t;const f=Hr(t);return f.path=`/v4/${f.authority}.json`,f.params.push("secure"),c&&f.params.push(`language=${c}`),d&&f.params.push(`worldview=${d}`),this._makeAPIURL(f,this._customAccessToken||r)}normalizeIconsetURL(t,r){const c=Hr(t);return s.f(t)?(c.path=`/styles/v1${c.path}/iconset.pbf`,this._makeAPIURL(c,this._customAccessToken||r)):An(c)}normalizeSpriteURL(t,r,c,d){const f=Hr(t);return s.f(t)?(f.path=`/styles/v1${f.path}/sprite${r}${c}`,this._makeAPIURL(f,this._customAccessToken||d)):(f.path+=`${r}${c}`,An(f))}normalizeTileURL(t,r,c){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!s.f(t))return t;const d=Hr(t);d.path=d.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${r||c&&d.authority!=="raster"&&c===512?"@2x":""}${s.m.supported?".webp":"$1"}`),d.authority==="raster"?d.path=`/${s.e.RASTER_URL_PREFIX}${d.path}`:d.authority==="rasterarrays"?d.path=`/${s.e.RASTERARRAYS_URL_PREFIX}${d.path}`:d.authority==="3dtiles"?d.path=`/${s.e.TILES3D_URL_PREFIX}${d.path}`:(d.path=d.path.replace(/^.+\/v4\//,"/"),d.path=`/${s.e.TILE_URL_VERSION}${d.path}`);const f=this._customAccessToken||function(_){for(const T of _){const E=T.match(/^access_token=(.*)$/);if(E)return E[1]}return null}(d.params)||s.e.ACCESS_TOKEN;return s.e.REQUIRE_ACCESS_TOKEN&&f&&this._skuToken&&d.params.push(`sku=${this._skuToken}`),this._makeAPIURL(d,f)}canonicalizeTileURL(t,r){const c=Hr(t);if(!c.path.match(/^(\/v4\/|\/(raster|rasterarrays)\/v1\/)/)||!c.path.match(/\.[\w]+$/))return t;let d="mapbox://";c.path.match(/^\/raster\/v1\//)?d+=`raster/${c.path.replace(`/${s.e.RASTER_URL_PREFIX}/`,"")}`:c.path.match(/^\/rasterarrays\/v1\//)?d+=`rasterarrays/${c.path.replace(`/${s.e.RASTERARRAYS_URL_PREFIX}/`,"")}`:d+=`tiles/${c.path.replace(`/${s.e.TILE_URL_VERSION}/`,"")}`;let f=c.params;return r&&(f=f.filter(_=>!_.match(/^access_token=/))),f.length&&(d+=`?${f.join("&")}`),d}canonicalizeTileset(t,r){const c=!!r&&s.f(r),d=[];for(const f of t.tiles||[])s.h(f)?d.push(this.canonicalizeTileURL(f,c)):d.push(f);return d}_makeAPIURL(t,r){const c="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",d=Hr(s.e.API_URL);if(t.protocol=d.protocol,t.authority=d.authority,t.protocol==="http"){const f=t.params.indexOf("secure");f>=0&&t.params.splice(f,1)}if(d.path!=="/"&&(t.path=`${d.path}${t.path}`),!s.e.REQUIRE_ACCESS_TOKEN)return An(t);if(r=r||s.e.ACCESS_TOKEN,!this._silenceAuthErrors){if(!r)throw new Error(`An API access token is required to use Mapbox GL. ${c}`);if(r[0]==="s")throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${c}`)}return t.params=t.params.filter(f=>f.indexOf("access_token")===-1),t.params.push(`access_token=${r||""}`),An(t)}}const Kt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Hr(u){const t=u.match(Kt);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function An(u){const t=u.params.length?`?${u.params.join("&")}`:"";return`${u.protocol}://${u.authority}${u.path}${t}`}const Ms="mapbox.eventData";function Jt(u){if(!u)return null;const t=u.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(s.j(t[1]))}catch{return null}}class pn{constructor(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(t){const r=Jt(s.e.ACCESS_TOKEN);let c="";return c=r&&r.u?s.k(r.u):s.e.ACCESS_TOKEN||"",t?`${Ms}.${t}:${c}`:`${Ms}:${c}`}fetchEventData(){const t=s.s("localStorage"),r=this.getStorageKey(),c=this.getStorageKey("uuid");if(t)try{const d=localStorage.getItem(r);d&&(this.eventData=JSON.parse(d));const f=localStorage.getItem(c);f&&(this.anonId=f)}catch{s.w("Unable to read from LocalStorage")}}saveEventData(){const t=s.s("localStorage"),r=this.getStorageKey(),c=this.getStorageKey("uuid"),d=this.anonId;if(t&&d)try{localStorage.setItem(c,d),Object.keys(this.eventData).length>=1&&localStorage.setItem(r,JSON.stringify(this.eventData))}catch{s.w("Unable to write to LocalStorage")}}processRequests(t){}postEvent(t,r,c,d){if(!s.e.EVENTS_URL)return;const f=Hr(s.e.EVENTS_URL);f.params.push(`access_token=${d||s.e.ACCESS_TOKEN||""}`);const _={event:this.type,created:new Date(t).toISOString()},T=r?s.l(_,r):_,E={url:An(f),headers:{"Content-Type":"text/plain"},body:JSON.stringify([T])};this.pendingRequest=s.p(E,M=>{this.pendingRequest=null,c(M),this.saveEventData(),this.processRequests(d)})}queueRequest(t,r){this.queue.push(t),this.processRequests(r)}}const Oa=new class extends pn{constructor(u){super("appUserTurnstile"),this._customAccessToken=u}postTurnstileEvent(u,t){s.e.EVENTS_URL&&s.e.ACCESS_TOKEN&&Array.isArray(u)&&u.some(r=>s.f(r)||s.h(r))&&this.queueRequest(Date.now(),t)}processRequests(u){if(this.pendingRequest||this.queue.length===0)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const t=Jt(s.e.ACCESS_TOKEN),r=t?t.u:s.e.ACCESS_TOKEN;let c=r!==this.eventData.tokenU;s.v(this.anonId)||(this.anonId=s.u(),c=!0);const d=this.queue.shift();if(this.eventData.lastSuccess){const f=new Date(this.eventData.lastSuccess),_=new Date(d),T=(d-this.eventData.lastSuccess)/864e5;c=c||T>=1||T<-1||f.getDate()!==_.getDate()}else c=!0;c?this.postEvent(d,{sdkIdentifier:"mapbox-gl-js",sdkVersion:gt,skuId:Ro,"enabled.telemetry":!1,userId:this.anonId},f=>{f||(this.eventData.lastSuccess=d,this.eventData.tokenU=r)},u):this.processRequests()}},As=Oa.postTurnstileEvent.bind(Oa),qt=new class extends pn{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(u,t,r,c){this.skuToken=t,this.errorCb=c,s.e.EVENTS_URL&&(r||s.e.ACCESS_TOKEN?this.queueRequest({id:u,timestamp:Date.now()},r):this.errorCb(new Error(ts)))}processRequests(u){if(this.pendingRequest||this.queue.length===0)return;const{id:t,timestamp:r}=this.queue.shift();t&&this.success[t]||(this.anonId||this.fetchEventData(),s.v(this.anonId)||(this.anonId=s.u()),this.postEvent(r,{sdkIdentifier:"mapbox-gl-js",sdkVersion:gt,skuId:Ro,skuToken:this.skuToken,userId:this.anonId},c=>{c?this.errorCb(c):t&&(this.success[t]=!0)},u))}remove(){this.errorCb=null}},k0=qt.postMapLoadEvent.bind(qt),Is=new class extends pn{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(u){let t=this.mapInstanceIdMap.get(u);return t||(t=s.u(),this.mapInstanceIdMap.set(u,t)),t}getEventId(u){const t=this.eventIdPerMapInstanceMap.get(u)||0;return this.eventIdPerMapInstanceMap.set(u,t+1),t}postStyleLoadEvent(u,t){const{map:r,style:c,importedStyles:d}=t;if(!s.e.EVENTS_URL||!u&&!s.e.ACCESS_TOKEN)return;const f=this.getMapInstanceId(r),_={mapInstanceId:f,eventId:this.getEventId(f),style:c};d.length&&(_.importedStyles=d),this.queueRequest({timestamp:Date.now(),payload:_},u)}processRequests(u){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:t,payload:r}=this.queue.shift();this.postEvent(t,r,()=>{},u)}},fn=Is.postStyleLoadEvent.bind(Is),mn=new class extends pn{constructor(){super("gljs.performance")}postPerformanceEvent(u,t){s.e.EVENTS_URL&&(u||s.e.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},u)}processRequests(u){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:t,performanceData:r}=this.queue.shift(),c=function(d){const f=performance.getEntriesByType("resource"),_=performance.getEntriesByType("mark"),T=function(k){const j={};if(k){for(const N in k)if(N!=="other")for(const G of k[N]){const $=`${N}ResolveRangeMin`,K=`${N}ResolveRangeMax`,ie=`${N}RequestCount`,te=`${N}RequestCachedCount`;j[$]=Math.min(j[$]||1/0,G.startTime),j[K]=Math.max(j[K]||-1/0,G.responseEnd);const ae=ne=>{j[ne]===void 0&&(j[ne]=0),++j[ne]};G.transferSize!==void 0&&G.transferSize===0&&ae(te),ae(ie)}}return j}(function(k,j){const N={};if(k)for(const G of k){const $=j(G);N[$]===void 0&&(N[$]=[]),N[$].push(G)}return N}(f,At)),E=window.devicePixelRatio,M=navigator.connection||navigator.mozConnection||navigator.webkitConnection,A=M?M.effectiveType:void 0,z={counters:[],metadata:[],attributes:[]},C=(k,j,N)=>{N!=null&&k.push({name:j,value:N.toString()})};for(const k in T)C(z.counters,k,T[k]);if(d.interactionRange[0]!==1/0&&d.interactionRange[1]!==-1/0&&(C(z.counters,"interactionRangeMin",d.interactionRange[0]),C(z.counters,"interactionRangeMax",d.interactionRange[1])),_)for(const k of Object.keys(nt)){const j=nt[k],N=_.find(G=>G.name===j);N&&C(z.counters,j,N.startTime)}return C(z.counters,"visibilityHidden",d.visibilityHidden),C(z.attributes,"style",function(k){if(k)for(const j of k){const N=j.name.split("?")[0];if(s.i(N)){const G=N.split("/").slice(-2);if(G.length===2)return`mapbox://styles/${G[0]}/${G[1]}`}}}(f)),C(z.attributes,"terrainEnabled",d.terrainEnabled?"true":"false"),C(z.attributes,"fogEnabled",d.fogEnabled?"true":"false"),C(z.attributes,"projection",d.projection),C(z.attributes,"zoom",d.zoom),C(z.metadata,"devicePixelRatio",E),C(z.metadata,"connectionEffectiveType",A),C(z.metadata,"navigatorUserAgent",navigator.userAgent),C(z.metadata,"screenWidth",window.screen.width),C(z.metadata,"screenHeight",window.screen.height),C(z.metadata,"windowWidth",window.innerWidth),C(z.metadata,"windowHeight",window.innerHeight),C(z.metadata,"mapWidth",d.width/E),C(z.metadata,"mapHeight",d.height/E),C(z.metadata,"webglRenderer",d.renderer),C(z.metadata,"webglVendor",d.vendor),C(z.metadata,"sdkVersion",gt),C(z.metadata,"sdkIdentifier","mapbox-gl-js"),z}(r);for(const d of c.metadata);for(const d of c.counters);for(const d of c.attributes);this.postEvent(t,c,()=>{},u)}},Ps=mn.postPerformanceEvent.bind(mn),Cs=new class extends pn{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(u,t,r,c){if(!s.e.API_URL||!s.e.SESSION_PATH)return;const d=Hr(s.e.API_URL+s.e.SESSION_PATH);d.params.push(`sku=${t||""}`),d.params.push(`access_token=${c||s.e.ACCESS_TOKEN||""}`);const f={url:An(d),headers:{"Content-Type":"text/plain"}};this.pendingRequest=s.g(f,_=>{this.pendingRequest=null,r(_),this.saveEventData(),this.processRequests(c)})}getSessionAPI(u,t,r,c){this.skuToken=t,this.errorCb=c,s.e.SESSION_PATH&&s.e.API_URL&&(r||s.e.ACCESS_TOKEN?this.queueRequest({id:u,timestamp:Date.now()},r):this.errorCb(new Error(ts)))}processRequests(u){if(this.pendingRequest||this.queue.length===0)return;const{id:t,timestamp:r}=this.queue.shift();t&&this.success[t]||this.getSession(r,this.skuToken,c=>{c?this.errorCb(c):t&&(this.success[t]=!0)},u)}remove(){this.errorCb=null}},Q=Cs.getSessionAPI.bind(Cs),is=new Set;function Do(u,t){t?is.add(u):is.delete(u)}class Lo{constructor(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps=new Set,this._updatedImages={}}isDirty(){return this._changed}setDirty(){this._changed=!0}getUpdatedSourceCaches(){return this._updatedSourceCaches}updateSourceCache(t,r){this._updatedSourceCaches[t]=r,this.setDirty()}discardSourceCacheUpdate(t){delete this._updatedSourceCaches[t]}updateLayer(t){const r=t.scope;this._updatedLayers[r]=this._updatedLayers[r]||new Set,this._updatedLayers[r].add(t.id),this.setDirty()}removeLayer(t){const r=t.scope;this._removedLayers[r]=this._removedLayers[r]||{},this._updatedLayers[r]=this._updatedLayers[r]||new Set,this._removedLayers[r][t.id]=t,this._updatedLayers[r].delete(t.id),this._updatedPaintProps.delete(t.fqid),this.setDirty()}getRemovedLayer(t){return this._removedLayers[t.scope]?this._removedLayers[t.scope][t.id]:null}discardLayerRemoval(t){this._removedLayers[t.scope]&&delete this._removedLayers[t.scope][t.id]}getLayerUpdatesByScope(){const t={};for(const r in this._updatedLayers)t[r]=t[r]||{},t[r].updatedIds=Array.from(this._updatedLayers[r].values());for(const r in this._removedLayers)t[r]=t[r]||{},t[r].removedIds=Object.keys(this._removedLayers[r]);return t}getUpdatedPaintProperties(){return this._updatedPaintProps}updatePaintProperties(t){this._updatedPaintProps.add(t.fqid),this.setDirty()}getUpdatedImages(t){return this._updatedImages[t]?Array.from(this._updatedImages[t].values()):[]}updateImage(t,r){this._updatedImages[r]=this._updatedImages[r]||new Set,this._updatedImages[r].add(s.I.toString(t)),this.setDirty()}resetUpdatedImages(t){this._updatedImages[t]&&this._updatedImages[t].clear()}reset(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps.clear(),this._updatedImages={}}}function Qe(u){const{userImage:t}=u;return!!(t&&t.render&&t.render())&&(u.data.replace(new Uint8Array(t.data.buffer)),!0)}class In extends s.E{constructor(t){super(),this.imageProviders=new Map,this.images=new Map,this.updatedImages=new Map,this.callbackDispatchedThisFrame=new Map,this.loaded=new Map,this.requestors=[],this.patterns=new Map,this.patternsInFlight=new Set,this.atlasImage=new Map,this.atlasTexture=new Map,this.dirty=!0,this.spriteFormat=t,t!=="raster"&&s.t()&&(this.imageRasterizerDispatcher=new s.D(s.x(),this,"Image Rasterizer Worker",1))}addScope(t){this.loaded.set(t,!1),this.imageProviders.set(t,new Map),this.images.set(t,new Map),this.updatedImages.set(t,new Set),this.callbackDispatchedThisFrame.set(t,new Set),this.patterns.set(t,new Map),this.atlasImage.set(t,new s.r({width:1,height:1}))}removeScope(t){this.loaded.delete(t),this.imageProviders.delete(t),this.images.delete(t),this.updatedImages.delete(t),this.callbackDispatchedThisFrame.delete(t),this.patterns.delete(t),this.atlasImage.delete(t);const r=this.atlasTexture.get(t);r&&(r.destroy(),this.atlasTexture.delete(t))}addImageProvider(t,r){this.imageProviders.has(r)||this.imageProviders.set(r,new Map),this.imageProviders.get(r).set(t.id,t)}removeImageProvider(t,r){this.imageProviders.has(r)&&this.imageProviders.get(r).delete(t)}getPendingImageProviders(){const t=[];for(const r of this.imageProviders.values())for(const c of r.values())c.hasPendingRequests()&&t.push(c);return t}get imageRasterizer(){return this._imageRasterizer||(this._imageRasterizer=new s.y),this._imageRasterizer}isLoaded(){for(const t of this.loaded.keys())if(!this.loaded.get(t))return!1;return!0}setLoaded(t,r){if(this.loaded.get(r)!==t&&(this.loaded.set(r,t),t)){for(const{ids:c,callback:d}of this.requestors)this._notify(c,r,d);this.requestors=[]}}hasImage(t,r){return!!this.getImage(t,r)}getImage(t,r){return this.images.get(r).get(t.toString())}addImage(t,r,c){this._validate(t,c)&&this.images.get(r).set(t.toString(),c)}_validate(t,r){let c=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new s.z(new Error(`Image "${t.name}" has invalid "stretchX" value`))),c=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new s.z(new Error(`Image "${t.name}" has invalid "stretchY" value`))),c=!1),this._validateContent(r.content,r)||(this.fire(new s.z(new Error(`Image "${t.name}" has invalid "content" value`))),c=!1),c}_validateStretch(t,r){if(!t)return!0;let c=0;for(const d of t){if(d[0]s.I.from(r))}getImages(t,r,c){const d=[],f=[],_=this.imageProviders.get(r);for(const A of t){if(!A.iconsetId){d.push(A);continue}const z=_.get(A.iconsetId);z&&(this.getImage(A,r)?f.push(A):z.addPendingRequest(A))}if(d.length===0)return void this._notify(f,r,c);let T=!0;const E=!!this.loaded.get(r),M=this.images.get(r);if(!E)for(const A of d)M.has(A.toString())||(T=!1);E||T?this._notify(d,r,c):this.requestors.push({ids:d,scope:r,callback:c})}rasterizeImages({scope:t,tasks:r},c){const d=new Map;for(const[f,_]of r.entries()){const T=this.getImage(_.id,t);T&&d.set(f,{image:T,imageVariant:_})}this._rasterizeImages(t,d,c)}_rasterizeImages(t,r,c){if(s.t())this.imageRasterizerDispatcher.getActor().send("rasterizeImages",{tasks:r,scope:t},c);else{const d=new Map;for(const[f,{image:_,imageVariant:T}]of r.entries())d.set(f,this.imageRasterizer.rasterize(T,_,t,0));c(void 0,d)}}getUpdatedImages(t){return this.updatedImages.get(t)||new Set}_notify(t,r,c){const d=this.images.get(r),f=new Map;for(const _ of t){const T=d.get(_.toString());if(!T){if(_.iconsetId)continue;s.w(`Image "${_.name}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`),this.fire(new s.A("styleimagemissing",{id:_.name}));continue}const E={data:T.usvg?null:T.data.clone(),pixelRatio:T.pixelRatio,sdf:T.sdf,usvg:T.usvg,version:T.version,stretchX:T.stretchX,stretchY:T.stretchY,content:T.content,hasRenderCallback:!!(T.userImage&&T.userImage.render)};T.usvg&&Object.assign(E,{width:T.icon.usvg_tree.width,height:T.icon.usvg_tree.height}),f.set(s.I.toString(_),E)}c(null,f)}getPixelSize(t){const{width:r,height:c}=this.atlasImage.get(t);return{width:r,height:c}}getPattern(t,r,c){const d=t.toString(),f=this.patterns.get(r),_=f.get(d),T=this.getImage(t,r);if(!T)return null;if(_){if(_.position.version===T.version)return _.position;_.position.version=T.version}else{if(T.usvg&&!T.data){const E=this.getPatternInFlightId(d,r);if(this.patternsInFlight.has(E))return null;this.patternsInFlight.add(E);const M=new s.B(t).scaleSelf(s.q.devicePixelRatio),A=new Map([[M.toString(),{image:T,imageVariant:M}]]);return this._rasterizeImages(r,A,(z,C)=>this.storePatternImage(M,r,T,c,C)),null}this.storePattern(t,r,T)}return this._updatePatternAtlas(r,c),f.get(d).position}getPatternInFlightId(t,r){return s.C(t,r)}hasPatternsInFlight(){return this.patternsInFlight.size!==0}storePatternImage(t,r,c,d,f){const _=t.toString(),T=f?f.get(_):void 0;T&&(c.data=T,this.storePattern(t.id,r,c),this._updatePatternAtlas(r,d),this.patternsInFlight.delete(this.getPatternInFlightId(t.id.toString(),r)))}storePattern(t,r,c){const d={w:c.data.width+2*s.F,h:c.data.height+2*s.F,x:0,y:0},f=new s.G(d,c,s.F);this.patterns.get(r).set(t.toString(),{bin:d,position:f})}bind(t,r){const c=t.gl;let d=this.atlasTexture.get(r);d?this.dirty&&(d.update(this.atlasImage.get(r)),this.dirty=!1):(d=new s.T(t,this.atlasImage.get(r),c.RGBA8),this.atlasTexture.set(r,d)),d.bind(c.LINEAR,c.CLAMP_TO_EDGE)}_updatePatternAtlas(t,r){const c=this.patterns.get(t),d=Array.from(c.values()).map(({bin:M})=>M),{w:f,h:_}=s.H(d),T=this.atlasImage.get(t);T.resize({width:f||1,height:_||1});const E=this.images.get(t);for(const[M,{bin:A,position:z}]of c.entries()){let C=z.padding;const k=A.x+C,j=A.y+C,N=E.get(M).data,G=N.width,$=N.height;C=C>1?C-1:C,s.r.copy(N,T,{x:0,y:0},{x:k,y:j},{width:G,height:$},r),s.r.copy(N,T,{x:0,y:$-C},{x:k,y:j-C},{width:G,height:C},r),s.r.copy(N,T,{x:0,y:0},{x:k,y:j+$},{width:G,height:C},r),s.r.copy(N,T,{x:G-C,y:0},{x:k-C,y:j},{width:C,height:$},r),s.r.copy(N,T,{x:0,y:0},{x:k+G,y:j},{width:C,height:$},r),s.r.copy(N,T,{x:G-C,y:$-C},{x:k-C,y:j-C},{width:C,height:C},r),s.r.copy(N,T,{x:0,y:$-C},{x:k+G,y:j-C},{width:C,height:C},r),s.r.copy(N,T,{x:0,y:0},{x:k+G,y:j+$},{width:C,height:C},r),s.r.copy(N,T,{x:G-C,y:0},{x:k-C,y:j+$},{width:C,height:C},r)}this.dirty=!0}beginFrame(){for(const t of this.images.keys())this.callbackDispatchedThisFrame.set(t,new Set)}dispatchRenderCallbacks(t,r){const c=this.images.get(r);for(const d of t){if(this.callbackDispatchedThisFrame.get(r).has(d.toString()))continue;this.callbackDispatchedThisFrame.get(r).add(d.toString());const f=c.get(d.toString());Qe(f)&&this.updateImage(d,r,f)}}}function Br(u){const t=u.key,r=u.value,c=u.valueSpec||{},d=u.objectElementValidators||{},f=u.style,_=u.styleSpec;let T=[];const E=s.K(r);if(E!=="object")return[new s.V(t,r,`object expected, ${E} found`)];for(const M in r){const A=M.split(".")[0];let z;d[A]?z=d[A]:c[A]?z=Si:d["*"]?z=d["*"]:c["*"]&&(z=Si),z?T=T.concat(z({key:(t&&`${t}.`)+M,value:r[M],valueSpec:c[A]||c["*"],style:f,styleSpec:_,object:r,objectKey:M},r)):T.push(new s.J(t,r[M],`unknown property "${M}"`))}for(const M in c)d[M]||c[M].required&&c[M].default===void 0&&r[M]===void 0&&T.push(new s.V(t,r,`missing required property "${M}"`));return T}function Vn(u){const t=u.value,r=u.valueSpec,c=u.style,d=u.styleSpec,f=u.key,_=u.arrayElementValidator||Si;if(s.K(t)!=="array")return[new s.V(f,t,`array expected, ${s.K(t)} found`)];if(r.length&&t.length!==r.length)return[new s.V(f,t,`array length ${r.length} expected, length ${t.length} found`)];if(r["min-length"]&&t.lengthf)return[new s.V(t,r,`${r} is greater than the maximum value ${f}`)]}return[]}function ur(u){const t=u.valueSpec,r=s.M(u.value.type);let c,d,f,_={};const T=r!=="categorical"&&u.value.property===void 0,E=!T,M=s.K(u.value.stops)==="array"&&s.K(u.value.stops[0])==="array"&&s.K(u.value.stops[0][0])==="object",A=Br({key:u.key,value:u.value,valueSpec:u.styleSpec.function,style:u.style,styleSpec:u.styleSpec,objectElementValidators:{stops:function(k){if(r==="identity")return[new s.V(k.key,k.value,'identity function may not have a "stops" property')];let j=[];const N=k.value;return j=j.concat(Vn({key:k.key,value:N,valueSpec:k.valueSpec,style:k.style,styleSpec:k.styleSpec,arrayElementValidator:z})),s.K(N)==="array"&&N.length===0&&j.push(new s.V(k.key,N,"array must have at least one stop")),j},default:function(k){return Si({key:k.key,value:k.value,valueSpec:t,style:k.style,styleSpec:k.styleSpec})}}});return r==="identity"&&T&&A.push(new s.V(u.key,u.value,'missing required property "property"')),r==="identity"||u.value.stops||A.push(new s.V(u.key,u.value,'missing required property "stops"')),r==="exponential"&&u.valueSpec.expression&&!s.N(u.valueSpec)&&A.push(new s.V(u.key,u.value,"exponential functions not supported")),u.styleSpec.$version>=8&&(E&&!s.O(u.valueSpec)?A.push(new s.V(u.key,u.value,"property functions not supported")):T&&!s.Q(u.valueSpec)&&A.push(new s.V(u.key,u.value,"zoom functions not supported"))),r!=="categorical"&&!M||u.value.property!==void 0||A.push(new s.V(u.key,u.value,'"property" property is required')),A;function z(k){let j=[];const N=k.value,G=k.key;if(s.K(N)!=="array")return[new s.V(G,N,`array expected, ${s.K(N)} found`)];if(N.length!==2)return[new s.V(G,N,`array length 2 expected, length ${N.length} found`)];if(M){if(s.K(N[0])!=="object")return[new s.V(G,N,`object expected, ${s.K(N[0])} found`)];if(N[0].zoom===void 0)return[new s.V(G,N,"object stop key must have zoom")];if(N[0].value===void 0)return[new s.V(G,N,"object stop key must have value")];const $=s.M(N[0].zoom);if(typeof $!="number")return[new s.V(G,N[0].zoom,"stop zoom values must be numbers")];if(f&&f>$)return[new s.V(G,N[0].zoom,"stop zoom values must appear in ascending order")];$!==f&&(f=$,d=void 0,_={}),j=j.concat(Br({key:`${G}[0]`,value:N[0],valueSpec:{zoom:{}},style:k.style,styleSpec:k.styleSpec,objectElementValidators:{zoom:ri,value:C}}))}else j=j.concat(C({key:`${G}[0]`,value:N[0],valueSpec:{},style:k.style,styleSpec:k.styleSpec},N));return s.S(s.U(N[1]))?j.concat([new s.V(`${G}[1]`,N[1],"expressions are not allowed in function stops.")]):j.concat(Si({key:`${G}[1]`,value:N[1],valueSpec:t,style:k.style,styleSpec:k.styleSpec}))}function C(k,j){const N=s.K(k.value),G=s.M(k.value),$=k.value!==null?k.value:j;if(c){if(N!==c)return[new s.V(k.key,$,`${N} stop domain type must match previous stop domain type ${c}`)]}else c=N;if(N!=="number"&&N!=="string"&&N!=="boolean"&&typeof G!="number"&&typeof G!="string"&&typeof G!="boolean")return[new s.V(k.key,$,"stop domain value must be a number, string, or boolean")];if(N!=="number"&&r!=="categorical"){let K=`number expected, ${N} found`;return s.O(t)&&r===void 0&&(K+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new s.V(k.key,$,K)]}return r!=="categorical"||N!=="number"||typeof G=="number"&&isFinite(G)&&Math.floor(G)===G?r!=="categorical"&&N==="number"&&typeof G=="number"&&typeof d=="number"&&d!==void 0&&Gnew s.V(`${u.key}${c.key}`,u.value,c.message));const r=t.value.expression||t.value._styleExpression.expression;if(u.expressionContext==="property"&&u.propertyKey==="text-font"&&!r.outputDefined())return[new s.V(u.key,u.value,`Invalid data expression for "${u.propertyKey}". Output values must be contained as literals within the expression.`)];if(u.expressionContext==="property"&&u.propertyType==="layout"&&!s.Y(r))return[new s.V(u.key,u.value,'"feature-state" data expressions are not supported with layout properties.')];if(u.expressionContext==="filter")return rs(r,u);if(u.expressionContext&&u.expressionContext.indexOf("cluster")===0){if(!s.Z(r,["zoom","feature-state"]))return[new s.V(u.key,u.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(u.expressionContext==="cluster-initial"&&!s._(r))return[new s.V(u.key,u.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function rs(u,t){const r=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(t.valueSpec&&t.valueSpec.expression)for(const d of t.valueSpec.expression.parameters)r.delete(d);if(r.size===0)return[];const c=[];return u instanceof s.$&&r.has(u.name)?[new s.V(t.key,t.value,`["${u.name}"] expression is not supported in a filter for a ${t.object.type} layer with id: ${t.object.id}`)]:(u.eachChild(d=>{c.push(...rs(d,t))}),c)}function eo(u){const t=u.key,r=u.value,c=u.valueSpec,d=[];return Array.isArray(c.values)?c.values.indexOf(s.M(r))===-1&&d.push(new s.V(t,r,`expected one of [${c.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(c.values).indexOf(s.M(r))===-1&&d.push(new s.V(t,r,`expected one of [${Object.keys(c.values).join(", ")}], ${JSON.stringify(r)} found`)),d}function zs(u){return s.a1(s.U(u.value))?Un(s.L({},u,{expressionContext:"filter",valueSpec:u.styleSpec[`filter_${u.layerType||"fill"}`]})):$t(u)}function $t(u){const t=u.value,r=u.key;if(s.K(t)!=="array")return[new s.V(r,t,`array expected, ${s.K(t)} found`)];const c=u.styleSpec;let d,f=[];if(t.length<1)return[new s.V(r,t,"filter array must have at least 1 element")];switch(f=f.concat(eo({key:`${r}[0]`,value:t[0],valueSpec:c.filter_operator,style:u.style,styleSpec:u.styleSpec})),s.M(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&s.M(t[1])==="$type"&&f.push(new s.V(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&f.push(new s.V(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(d=s.K(t[1]),d!=="string"&&f.push(new s.V(`${r}[1]`,t[1],`string expected, ${d} found`)));for(let _=2;_{M in r&&t.push(new s.V(c,r[M],`"${M}" is prohibited for ref layers`))}),d.layers.forEach(M=>{s.M(M.id)===T&&(E=M)}),E?E.ref?t.push(new s.V(c,r.ref,"ref cannot reference another ref layer")):_=s.M(E.type):typeof T=="string"&&t.push(new s.V(c,r.ref,`ref layer "${T}" not found`))}else if(_!=="background"&&_!=="sky"&&_!=="slot")if(r.source){const E=d.sources&&d.sources[r.source],M=E&&s.M(E.type);E?M==="vector"&&_==="raster"?t.push(new s.V(c,r.source,`layer "${r.id}" requires a raster source`)):M==="raster"&&_!=="raster"?t.push(new s.V(c,r.source,`layer "${r.id}" requires a vector source`)):M!=="vector"||r["source-layer"]?M==="raster-dem"&&_!=="hillshade"?t.push(new s.V(c,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):M!=="raster-array"||["raster","raster-particle"].includes(_)?_!=="line"||!r.paint||!r.paint["line-gradient"]&&!r.paint["line-trim-offset"]||M==="geojson"&&E.lineMetrics?_==="raster-particle"&&M!=="raster-array"&&t.push(new s.V(c,r.source,`layer "${r.id}" requires a 'raster-array' source.`)):t.push(new s.V(c,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new s.V(c,r.source,"raster-array source can only be used with layer type 'raster'.")):t.push(new s.V(c,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new s.V(c,r.source,`source "${r.source}" not found`))}else t.push(new s.V(c,r,'missing required property "source"'));return t=t.concat(Br({key:c,value:r,valueSpec:f.layer,style:u.style,styleSpec:u.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Si({key:`${c}.type`,value:r.type,valueSpec:f.layer.type,style:u.style,styleSpec:u.styleSpec,object:r,objectKey:"type"}),filter:E=>zs(s.L({layerType:_},E)),layout:E=>Br({layer:r,key:E.key,value:E.value,valueSpec:{},style:E.style,styleSpec:E.styleSpec,objectElementValidators:{"*":M=>ns(s.L({layerType:_},M))}}),paint:E=>Br({layer:r,key:E.key,value:E.value,valueSpec:{},style:E.style,styleSpec:E.styleSpec,objectElementValidators:{"*":M=>Oo(s.L({layerType:_,layer:r},M))}})}})),t}function to(u){const t=u.value,r=u.key,c=s.K(t);return c!=="string"?[new s.V(r,t,`string expected, ${c} found`)]:[]}const jn={promoteId:function u({key:t,value:r}){if(s.K(r)==="string")return to({key:t,value:r});if(Array.isArray(r)){const c=[],d=s.U(r),f=s.X(d);return f.result==="error"&&f.value.forEach(_=>{c.push(new s.V(`${t}${_.key}`,null,`${_.message}`))}),s.Z(f.value.expression,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])||c.push(new s.V(`${t}`,null,"promoteId expression should be only feature dependent")),c}{const c=[];for(const d in r)c.push(...u({key:`${t}.${d}`,value:r[d]}));return c}}};function ka(u){const t=u.value,r=u.key,c=u.styleSpec,d=u.style;if(!t.type)return[new s.V(r,t,'"type" is required')];const f=s.M(t.type);let _=[];switch(["vector","raster","raster-dem","raster-array"].includes(f)&&(t.url||t.tiles||_.push(new s.J(r,t,'Either "url" or "tiles" is required.'))),f){case"vector":case"raster":case"raster-dem":case"raster-array":return _=_.concat(Br({key:r,value:t,valueSpec:c[`source_${f.replace("-","_")}`],style:u.style,styleSpec:c,objectElementValidators:jn})),_;case"geojson":if(_=Br({key:r,value:t,valueSpec:c.source_geojson,style:d,styleSpec:c,objectElementValidators:jn}),t.cluster)for(const T in t.clusterProperties){const[E,M]=t.clusterProperties[T],A=typeof E=="string"?[E,["accumulated"],["get",T]]:E;_.push(...Un({key:`${r}.${T}.map`,value:M,expressionContext:"cluster-map"})),_.push(...Un({key:`${r}.${T}.reduce`,value:A,expressionContext:"cluster-reduce"}))}return _;case"video":return Br({key:r,value:t,valueSpec:c.source_video,style:d,styleSpec:c});case"image":return Br({key:r,value:t,valueSpec:c.source_image,style:d,styleSpec:c});case"canvas":return[new s.V(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return eo({key:`${r}.type`,value:t.type,valueSpec:{values:Fa(c)},style:d,styleSpec:c})}}function Fa(u){return u.source.reduce((t,r)=>{const c=u[r];return c.type.type==="enum"&&(t=t.concat(Object.keys(c.type.values))),t},[])}function os(u){const t=u.value,r=u.styleSpec,c=r.light,d=u.style;let f=[];const _=s.K(t);if(t===void 0)return f;if(_!=="object")return f=f.concat([new s.V("light",t,`object expected, ${_} found`)]),f;for(const T in t){const E=T.match(/^(.*)-transition$/),M=T.match(/^(.*)-use-theme$/);f=f.concat(M&&c[M[1]]?Si({key:T,value:t[T],valueSpec:{type:"string"},style:d,styleSpec:r}):E&&c[E[1]]&&c[E[1]].transition?Si({key:T,value:t[T],valueSpec:r.transition,style:d,styleSpec:r}):c[T]?Si({key:T,value:t[T],valueSpec:c[T],style:d,styleSpec:r}):[new s.V(T,t[T],`unknown property "${T}"`)])}return f}function ss(u){const t=u.value;let r=[];if(!t)return r;const c=s.K(t);if(c!=="object")return r=r.concat([new s.V("light-3d",t,`object expected, ${c} found`)]),r;const d=u.styleSpec,f=d["light-3d"],_=u.key,T=u.style,E=u.style.lights;for(const z of["type","id"])if(!(z in t))return r=r.concat([new s.V("light-3d",t,`missing property ${z} on light`)]),r;if(t.type&&E)for(let z=0;z[],array:Vn,boolean:function(u){const t=u.value,r=u.key,c=s.K(t);return c!=="boolean"?[new s.V(r,t,`boolean expected, ${c} found`)]:[]},number:ri,color:function(u){const t=u.key,r=u.value,c=s.K(r);return c!=="string"?[new s.V(t,r,`color expected, ${c} found`)]:s.a0.parseCSSColor(r)===null?[new s.V(t,r,`color expected, "${r}" found`)]:[]},enum:eo,filter:zs,function:ur,layer:Lr,object:Br,source:ka,model:s.a4,light:os,"light-3d":ss,terrain:en,fog:Rs,string:to,formatted:function(u){return to(u).length===0?[]:Un(u)},resolvedImage:function(u){return to(u).length===0?[]:Un(u)},projection:function(u){const t=u.value,r=u.styleSpec,c=r.projection,d=u.style;let f=[];const _=s.K(t);if(_==="object")for(const T in t)f=f.concat(Si({key:T,value:t[T],valueSpec:c[T],style:d,styleSpec:r}));else _!=="string"&&(f=f.concat([new s.V("projection",t,`object or string expected, ${_} found`)]));return f},import:function(u){const{value:t,styleSpec:r}=u,{data:c,...d}=t;Object.defineProperty(d,"__line__",{value:t.__line__,enumerable:!1});let f=Br(s.L({},u,{value:d,valueSpec:r.import}));return s.M(d.id)===""&&f.push(new s.V(`${u.key}.id`,d,"import id can't be an empty string")),c&&(f=f.concat(Ds(c,r,{key:`${u.key}.data`}))),f},iconset:function(u){const t=u.value,r=u.key,c=u.styleSpec,d=u.style;if(!t.type)return[new s.V(r,t,'"type" is required')];const f=s.M(t.type);let _=[];if(_=_.concat(Br({key:r,value:t,valueSpec:c[`iconset_${f}`],style:d,styleSpec:c})),f==="source"&&t.source){const T=d.sources&&d.sources[t.source],E=T&&s.M(T.type);T?E!=="raster-array"&&_.push(new s.V(r,t.source,`iconset cannot be used with a source of type ${String(E)}, it only be used with a "raster-array" source type`)):_.push(new s.V(r,t.source,`source "${t.source}" not found`))}return _}};function Si(u,t=!1){const r=u.value,c=u.valueSpec,d=u.styleSpec;if(c.expression&&s.a2(s.M(r)))return ur(u);if(c.expression&&s.S(s.U(r)))return Un(u);if(c.type&&ji[c.type]){const f=ji[c.type](u);return t===!0&&f.length>0&&s.K(u.value)==="array"?Un(u):f}return Br(s.L({},u,{valueSpec:c.type?d[c.type]:c}))}function Ba(u){const t=u.value,r=u.key,c=to(u);return c.length||(t.indexOf("{fontstack}")===-1&&c.push(new s.V(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&c.push(new s.V(r,t,'"glyphs" url must include a "{range}" token'))),c}function Ds(u,t=s.a5,r={}){return Si({key:r.key||"",value:u,valueSpec:t.$root,styleSpec:t,style:u,objectElementValidators:{glyphs:Ba,"*":()=>[]}})}function Vr(u,t=s.a5){return ge(Ds(u,t))}const as=u=>ge(ka(u)),Na=u=>ge(os(u)),Ls=u=>ge(ss(u)),F0=u=>ge(en(u)),B0=u=>ge(Rs(u)),Va=u=>ge(function(t){const r=t.value,c=t.style,d=t.styleSpec,f=d.snow;let _=[];const T=s.K(r);if(r===void 0)return _;if(T!=="object")return _=_.concat([new s.V("snow",r,`object expected, ${T} found`)]),_;for(const E in r){const M=E.match(/^(.*)-transition$/);_=_.concat(M&&f[M[1]]&&f[M[1]].transition?Si({key:E,value:r[E],valueSpec:d.transition,style:c,styleSpec:d}):f[E]?Si({key:E,value:r[E],valueSpec:f[E],style:c,styleSpec:d}):[new s.J(E,r[E],`unknown property "${E}"`)])}return _}(u)),Oe=u=>ge(function(t){const r=t.value,c=t.style,d=t.styleSpec,f=d.rain;let _=[];const T=s.K(r);if(r===void 0)return _;if(T!=="object")return _=_.concat([new s.V("rain",r,`object expected, ${T} found`)]),_;for(const E in r){const M=E.match(/^(.*)-transition$/);_=_.concat(M&&f[M[1]]&&f[M[1]].transition?Si({key:E,value:r[E],valueSpec:d.transition,style:c,styleSpec:d}):f[E]?Si({key:E,value:r[E],valueSpec:f[E],style:c,styleSpec:d}):[new s.J(E,r[E],`unknown property "${E}"`)])}return _}(u)),H=u=>ge(Lr(u)),Z=u=>ge(zs(u)),re=u=>ge(Oo(u)),de=u=>ge(ns(u)),ue=u=>ge(s.a4(u));function ge(u){return u.slice().sort((t,r)=>t.line&&r.line?t.line-r.line:0)}function Pe(u,t){let r=!1;if(t&&t.length)for(const c of t)c instanceof s.J?s.w(c.message):(u.fire(new s.z(new Error(c.message))),r=!0);return r}let ve;class Re extends s.E{constructor(t,r="flat"){super(),this._transitionable=new s.a6(ve||(ve=new s.a7({anchor:new s.a8(s.a5.light.anchor),position:new s.a9(s.a5.light.position),color:new s.a8(s.a5.light.color),intensity:new s.a8(s.a5.light.intensity)}))),this.setLight(t,r),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,r,c={}){this._validate(Na,t,c)||(this._transitionable.setTransitionOrValue(t),this.id=r)}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,r,c){return(!c||c.validate!==!1)&&Pe(this,t.call(Vr,s.l({value:r,style:{glyphs:!0,sprite:!0},styleSpec:s.a5})))}}let Fe=class extends s.E{constructor(u,t,r,c){super(),this.scope=r,this._transitionable=new s.a6(new s.a7({source:new s.a8(s.a5.terrain.source),exaggeration:new s.a8(s.a5.terrain.exaggeration)}),r,c),this._transitionable.setTransitionOrValue(u,c),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=t}get(){return this._transitionable.serialize()}set(u,t){this._transitionable.setTransitionOrValue(u,t)}updateTransitions(u){this._transitioning=this._transitionable.transitioned(u,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(u){this.properties=this._transitioning.possiblyEvaluate(u)}getExaggeration(u){return this._transitioning.possiblyEvaluate(new s.aa(u)).get("exaggeration")}getAttenuationRange(){if(!this.isZoomDependent())return null;const u=this._transitionable._values.exaggeration;if(!u)return null;const t=u.value.expression;if(!t)return null;let r=-1,c=-1,d=1;for(const f of t.zoomStops)d=t.evaluate(new s.aa(f)),d>.01?(r=f,c=-1):c=f;return d<.01&&r>0&&c>r?[r,c]:null}isZoomDependent(){const u=this._transitionable._values.exaggeration;return u!=null&&u.value!=null&&u.value.expression!=null&&u.value.expression instanceof s.ab}};const Le=45,Xe=65,ot=.05;function ht(u,t,r,c){const d=s.ae(Le,Xe,r),[f,_]=Dt(u,c);let T=1-Math.min(1,Math.exp((t-f)/(_-f)*-6));return T*=T*T,T=Math.min(1,1.00747*T),T*d*u.alpha}function Dt(u,t){const r=.5/Math.tan(.5*t);return[u.range[0]+r,u.range[1]+r]}function Bt(u,t,r,c,d){const f=s.ad.vec3.transformMat4([],[t,r,c],d.mercatorFogMatrix);return ht(u,s.ad.vec3.length(f),d.pitch,d._fov)}function Nt(u,t,r,c,d,f,_){const T=[[r,c,0],[d,c,0],[d,f,0],[r,f,0]];let E=Number.MAX_VALUE,M=-Number.MAX_VALUE;for(const A of T){const z=s.ad.vec3.transformMat4([],A,t),C=s.ad.vec3.length(z);E=Math.min(E,C),M=Math.max(M,C)}return[ht(u,E,_.pitch,_._fov),ht(u,M,_.pitch,_._fov)]}class Gt extends s.E{constructor(t,r,c,d){super();const f=new s.a7({range:new s.a8(s.a5.fog.range),color:new s.a8(s.a5.fog.color),"color-use-theme":new s.a8({type:"string","property-type":"data-constant",default:"default"}),"high-color":new s.a8(s.a5.fog["high-color"]),"high-color-use-theme":new s.a8({type:"string","property-type":"data-constant",default:"default"}),"space-color":new s.a8(s.a5.fog["space-color"]),"space-color-use-theme":new s.a8({type:"string","property-type":"data-constant",default:"default"}),"horizon-blend":new s.a8(s.a5.fog["horizon-blend"]),"star-intensity":new s.a8(s.a5.fog["star-intensity"]),"vertical-range":new s.a8(s.a5.fog["vertical-range"])});this._transitionable=new s.a6(f,c,new Map(d)),this.set(t,d),this._transitioning=this._transitionable.untransitioned(),this._transform=r,this.properties=new s.af(f),this.scope=c}get state(){const t=this._transform,r=t.projection.name==="globe",c=s.ag(t.zoom),d=this.properties.get("range"),f=[.5,3];return{range:r?[s.ah(f[0],d[0],c),s.ah(f[1],d[1],c)]:d,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(t,r,c={}){if(this._validate(B0,t,c))return;const d=s.l({},t);for(const f of Object.keys(s.a5.fog))d[f]===void 0&&(d[f]=s.a5.fog[f].default);this._options=d,this._transitionable.setTransitionOrValue(this._options,r)}getOpacity(t){if(!this._transform.projection.supportsFog)return 0;const r=this.properties&&this.properties.get("color")||1;return(this._transform.projection.name==="globe"?1:s.ae(Le,Xe,t))*r.a}getOpacityAtLatLng(t,r){return this._transform.projection.supportsFog?function(c,d,f){const _=s.ac.fromLngLat(d),T=f.elevation?f.elevation.getAtPointOrZero(_):0;return Bt(c,_.x,_.y,T,f)}(this.state,t,r):0}getOpacityForTile(t){if(!this._transform.projection.supportsFog)return[1,1];const r=this._transform.calculateFogTileMatrix(t.toUnwrapped());return Nt(this.state,r,0,0,s.ai,s.ai,this._transform)}getOpacityForBounds(t,r,c,d,f){return this._transform.projection.supportsFog?Nt(this.state,t,r,c,d,f,this._transform):[1,1]}getFovAdjustedRange(t){return this._transform.projection.supportsFog?Dt(this.state,t):[0,1]}isVisibleOnFrustum(t){if(!this._transform.projection.supportsFog)return!1;const r=[4,5,6,7];for(const c of r){const d=t.points[c];let f;if(d[2]>=0)f=d;else{const _=t.points[c-4];f=s.aj(_,d,_[2]/(_[2]-d[2]))}if(Bt(this.state,f[0],f[1],0,this._transform)>=ot)return!0}return!1}updateConfig(t){this._transitionable.setTransitionOrValue(this._options,new Map(t))}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,r,c){return(!c||c.validate!==!1)&&Pe(this,t.call(Vr,s.l({value:r,style:{glyphs:!0,sprite:!0},styleSpec:s.a5})))}}let zi,Ui,Xt,xi,vi=class extends s.E{constructor(u,t,r,c){super();const d=zi||(zi=new s.a7({density:new s.a8(s.a5.snow.density),intensity:new s.a8(s.a5.snow.intensity),color:new s.a8(s.a5.snow.color),opacity:new s.a8(s.a5.snow.opacity),vignette:new s.a8(s.a5.snow.vignette),"vignette-color":new s.a8(s.a5.snow["vignette-color"]),"center-thinning":new s.a8(s.a5.snow["center-thinning"]),direction:new s.a8(s.a5.snow.direction),"flake-size":new s.a8(s.a5.snow["flake-size"])}));this._transitionable=new s.a6(d,r,new Map(c)),this.set(u,c),this._transitioning=this._transitionable.untransitioned(),this.properties=new s.af(d),this.scope=r}get state(){const u=this.properties.get("opacity"),t=this.properties.get("color"),r=this.properties.get("direction"),c=s.ak(r[0]),d=-Math.max(s.ak(r[1]),.01),f=[Math.cos(c)*Math.cos(d),Math.sin(c)*Math.cos(d),Math.sin(d)],_=this.properties.get("vignette"),T=this.properties.get("vignette-color");return T.a=_,{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new s.al(t.r,t.g,t.b,t.a*u),direction:f,centerThinning:this.properties.get("center-thinning"),flakeSize:this.properties.get("flake-size"),vignetteColor:T}}get(){return this._transitionable.serialize()}set(u,t,r={}){if(this._validate(Va,u,r))return;const c=s.l({},u);for(const d of Object.keys(s.a5.snow))c[d]===void 0&&(c[d]=s.a5.snow[d].default);this._options=c,this._transitionable.setTransitionOrValue(this._options,t)}updateConfig(u){this._transitionable.setTransitionOrValue(this._options,new Map(u))}updateTransitions(u){this._transitioning=this._transitionable.transitioned(u,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(u){this.properties=this._transitioning.possiblyEvaluate(u)}_validate(u,t,r){return(!r||r.validate!==!1)&&Pe(this,u.call(Vr,s.l({value:t,style:{glyphs:!0,sprite:!0},styleSpec:s.a5})))}},Ti=class extends s.E{constructor(u,t,r,c){super();const d=Ui||(Ui=new s.a7({density:new s.a8(s.a5.rain.density),intensity:new s.a8(s.a5.rain.intensity),color:new s.a8(s.a5.rain.color),opacity:new s.a8(s.a5.rain.opacity),vignette:new s.a8(s.a5.rain.vignette),"vignette-color":new s.a8(s.a5.rain["vignette-color"]),"center-thinning":new s.a8(s.a5.rain["center-thinning"]),direction:new s.a8(s.a5.rain.direction),"droplet-size":new s.a8(s.a5.rain["droplet-size"]),"distortion-strength":new s.a8(s.a5.rain["distortion-strength"])}));this._transitionable=new s.a6(d,r,new Map(c)),this.set(u,c),this._transitioning=this._transitionable.untransitioned(),this.properties=new s.af(d),this.scope=r}get state(){const u=this.properties.get("opacity"),t=this.properties.get("color"),r=this.properties.get("direction"),c=s.ak(r[0]),d=-Math.max(s.ak(r[1]),.01),f=[Math.cos(c)*Math.cos(d),Math.sin(c)*Math.cos(d),Math.sin(d)],_=this.properties.get("vignette-color");return _.a=this.properties.get("vignette"),{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new s.al(t.r,t.g,t.b,t.a*u),direction:f,centerThinning:this.properties.get("center-thinning"),dropletSize:this.properties.get("droplet-size"),distortionStrength:this.properties.get("distortion-strength"),vignetteColor:_}}get(){return this._transitionable.serialize()}set(u,t,r={}){if(this._validate(Oe,u,r))return;const c=s.l({},u);for(const d of Object.keys(s.a5.rain))c[d]===void 0&&(c[d]=s.a5.rain[d].default);this._options=c,this._transitionable.setTransitionOrValue(this._options,t)}updateConfig(u){this._transitionable.setTransitionOrValue(this._options,new Map(u))}updateTransitions(u){this._transitioning=this._transitionable.transitioned(u,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(u){this.properties=this._transitioning.possiblyEvaluate(u)}_validate(u,t,r){return(!r||r.validate!==!1)&&Pe(this,u.call(Vr,s.l({value:t,style:{glyphs:!0,sprite:!0},styleSpec:s.a5})))}};class Wi extends s.E{constructor(t,r,c,d){super(),this.scope=c,this._options=t,this.properties=new s.af(r),this._transitionable=new s.a6(r,c,new Map(d)),this._transitionable.setTransitionOrValue(t.properties),this._transitioning=this._transitionable.untransitioned()}updateConfig(t){this._transitionable.setTransitionOrValue(this._options.properties,new Map(t))}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}get(){return this._options.properties=this._transitionable.serialize(),this._options}set(t,r){this._options=t,this._transitionable.setTransitionOrValue(t.properties,r)}shadowsEnabled(){return!!this.properties&&this.properties.get("cast-shadows")===!0}}class hr{constructor(t,r,c,d){this.screenBounds=t,this.cameraPoint=r,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=c,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,d)}static createFromScreenPoints(t,r){let c,d;if(t instanceof s.P||typeof t[0]=="number"){const f=s.P.convert(t);c=[f],d=r.isPointAboveHorizon(f)}else{const f=s.P.convert(t[0]),_=s.P.convert(t[1]);c=[f,_],d=s.an(f,_).every(T=>r.isPointAboveHorizon(T))}return new hr(c,r.getCameraPoint(),d,r)}isPointQuery(){return this.screenBounds.length===1}bufferedScreenGeometry(t){return s.an(this.screenBounds[0],this.screenBounds.length===1?this.screenBounds[0]:this.screenBounds[1],t)}bufferedCameraGeometry(t){const r=this.screenBounds[0],c=this.screenBounds.length===1?this.screenBounds[0].add(new s.P(1,1)):this.screenBounds[1],d=s.an(r,c,0,!1);return this.cameraPoint.y>c.y&&(this.cameraPoint.x>r.x&&this.cameraPoint.x=c.x?d[2]=this.cameraPoint:this.cameraPoint.x<=r.x&&(d[3]=this.cameraPoint)),s.ao(d,t)}bufferedCameraGeometryGlobe(t){const r=this.screenBounds[0],c=this.screenBounds.length===1?this.screenBounds[0].add(new s.P(1,1)):this.screenBounds[1],d=s.an(r,c,t),f=this.cameraPoint.clone();switch(3*((f.y>r.y)+(f.y>c.y))+((f.x>r.x)+(f.x>c.x))){case 0:d[0]=f,d[4]=f.clone();break;case 1:d.splice(1,0,f);break;case 2:d[1]=f;break;case 3:d.splice(4,0,f);break;case 5:d.splice(2,0,f);break;case 6:d[3]=f;break;case 7:d.splice(3,0,f);break;case 8:d[2]=f}return d}containsTile(t,r,c,d=0){const f=t.queryPadding/r._pixelsPerMercatorPixel+1,_=c?this._bufferedCameraMercator(f,r):this._bufferedScreenMercator(f,r);let T=t.tileID.wrap+(_.unwrapped?d:0);const E=_.polygon.map(G=>s.ap(t.tileTransform,G,T));if(!s.aq(E,0,0,s.ai,s.ai))return;T=t.tileID.wrap+(this.screenGeometryMercator.unwrapped?d:0);const M=this.screenGeometryMercator.polygon.map(G=>s.ar(t.tileTransform,G,T)),A=M.map(G=>new s.P(G[0],G[1])),z=r.getFreeCameraOptions().position||new s.ac(0,0,0),C=s.ar(t.tileTransform,z,T),k=M.map(G=>{const $=s.ad.vec3.sub(G,G,C);return s.ad.vec3.normalize($,$),new s.as(C,$)}),j=s.at(t,1,r.zoom)*r._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:A,tilespaceRays:k,bufferedTilespaceGeometry:E,bufferedTilespaceBounds:(N=s.au(E),N.min.x=s.ay(N.min.x,0,s.ai),N.min.y=s.ay(N.min.y,0,s.ai),N.max.x=s.ay(N.max.x,0,s.ai),N.max.y=s.ay(N.max.y,0,s.ai),N),tile:t,tileID:t.tileID,pixelToTileUnitsFactor:j};var N}_bufferedScreenMercator(t,r){const c=Or(t);if(this._screenRaycastCache[c])return this._screenRaycastCache[c];{let d;return d=r.projection.name==="globe"?this._projectAndResample(this.bufferedScreenGeometry(t),r):{polygon:this.bufferedScreenGeometry(t).map(f=>r.pointCoordinate3D(f)),unwrapped:!0},this._screenRaycastCache[c]=d,d}}_bufferedCameraMercator(t,r){const c=Or(t);if(this._cameraRaycastCache[c])return this._cameraRaycastCache[c];{let d;return d=r.projection.name==="globe"?this._projectAndResample(this.bufferedCameraGeometryGlobe(t),r):{polygon:this.bufferedCameraGeometry(t).map(f=>r.pointCoordinate3D(f)),unwrapped:!0},this._cameraRaycastCache[c]=d,d}}_projectAndResample(t,r){const c=function(f,_){const T=s.ad.mat4.multiply([],_.pixelMatrix,_.globeMatrix),E=[0,-s.az,0,1],M=[0,s.az,0,1],A=[0,0,0,1];s.ad.vec4.transformMat4(E,E,T),s.ad.vec4.transformMat4(M,M,T),s.ad.vec4.transformMat4(A,A,T);const z=new s.P(E[0]/E[3],E[1]/E[3]),C=new s.P(M[0]/M[3],M[1]/M[3]),k=s.aw(f,z)&&E[3]1?Ar(f.slice(0,G),_):[],ie=Gnew s.P(_n(oe.x),oe.y)),ie=ie.map(oe=>new s.P(_n(oe.x),oe.y));const te=[...K];te.length===0&&te.push(ie[ie.length-1]);const ae=s.ah(te[te.length-1].y,(ie.length===0?K[0]:ie[0]).y,$);let ne;return ne=k?[new s.P(0,ae),new s.P(0,0),new s.P(1,0),new s.P(1,ae)]:[new s.P(1,ae),new s.P(1,1),new s.P(0,1),new s.P(0,ae)],te.push(...ne),ie.length===0?te.push(K[0]):te.push(...ie),{polygon:te.map(oe=>new s.ac(oe.x,oe.y)),unwrapped:!1}}(t,r);if(c)return c;const d=function(f,_){let T=!1,E=-1/0,M=0;for(let z=0;zE&&(E=f[z].x,M=z);for(let z=0;z.5&&(k.x{z.x-=1}),{polygon:f,unwrapped:T}}(Ar(t,r).map(f=>new s.P(_n(f.x),f.y)),r);return{polygon:d.polygon.map(f=>new s.ac(f.x,f.y)),unwrapped:d.unwrapped}}}function Ar(u,t){return s.ax(u,r=>{const c=t.pointCoordinate3D(r);r.x=c.x,r.y=c.y},1/256)}function _n(u){return u<0?1+u%1:u%1}function Or(u){return 100*u|0}function dr(u,t,r,c,d){const f=function(T,E){if(T)return d(T);if(E){if(u.url&&E.tiles&&u.tiles&&delete u.tiles,E.variants){if(!Array.isArray(E.variants))return d(new Error("variants must be an array"));for(const A of E.variants){if(A==null||typeof A!="object"||A.constructor!==Object)return d(new Error("variant must be an object"));if(!Array.isArray(A.capabilities))return d(new Error("capabilities must be an array"));if(A.capabilities.length===1&&A.capabilities[0]==="meshopt"){E=s.l(E,A);break}}}const M=s.aA(s.l({},E,u),["tilejson","tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding","vector_layers","raster_layers","worldview_options","worldview_default","worldview"]);M.tiles=t.canonicalizeTileset(M,u.url),d(null,M)}},_=function(T,E,M){if(!T)return null;if(!E&&!M)return T;M=M||T.worldview_default;const A=Object.values(T.language||{});if(A.length===0)return null;const z=Object.values(T.worldview||{});if(z.length===0)return null;const C=A.every(j=>j===E),k=z.every(j=>j===M);return C&&k?T:E in(T.language_options||{})||M in(T.worldview_options||{})?null:T.language_options&&T.worldview_options?T:null}(u.data,r,c);return _?s.q.frame(()=>f(null,_)):u.url?s.n(t.transformRequest(t.normalizeSourceURL(u.url,null,r,c),s.R.Source),f):s.q.frame(()=>{const{data:T,...E}=u;f(null,E)})}class mr{constructor(t,r,c){this.bounds=s.aB.convert(this.validateBounds(t)),this.minzoom=r||0,this.maxzoom=c||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const r=Math.pow(2,t.z),c=Math.floor(s.av(this.bounds.getWest())*r),d=Math.floor(s.aC(this.bounds.getNorth())*r),f=Math.ceil(s.av(this.bounds.getEast())*r),_=Math.ceil(s.aC(this.bounds.getSouth())*r);return t.x>=c&&t.x=d&&t.y<_}}class Os extends s.E{constructor(t,r,c,d){if(super(),this.id=t,this.dispatcher=c,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,s.l(this,s.aA(r,["url","scheme","tileSize","promoteId"])),this._options=s.l({type:"vector"},r),this._collectResourceTiming=!!r.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(d),this._tileWorkers={},this._deduped=new s.aD}load(t){this._loaded=!1,this.fire(new s.A("dataloading",{dataType:"source"}));const r=Array.isArray(this.map._language)?this.map._language.join():this.map._language,c=this.map.getWorldview();this._tileJSONRequest=dr(this._options,this.map._requestManager,r,c,(d,f)=>{if(this._tileJSONRequest=null,this._loaded=!0,d)r&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${r}`),c&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${c}`),this.fire(new s.z(d));else if(f){if(s.l(this,f),this.hasWorldviews=!!f.worldview_options,f.worldview_default&&(this.worldviewDefault=f.worldview_default),f.vector_layers){this.vectorLayers=f.vector_layers,this.vectorLayerIds=[],this.localizableLayerIds=new Set;for(const _ of f.vector_layers)this.vectorLayerIds.push(_.id),f.worldview&&f.worldview[_.source]&&this.localizableLayerIds.add(_.id)}f.bounds&&(this.tileBounds=new mr(f.bounds,this.minzoom,this.maxzoom)),As(f.tiles,this.map._requestManager._customAccessToken),this.fire(new s.A("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.A("data",{dataType:"source",sourceDataType:"content"}))}t&&t(d)})}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}reload(){this.cancelTileJSONRequest();const t=s.C(this.id,this.scope);this.load(()=>this.map.style.clearSource(t))}setTiles(t){return this._options.tiles=t,this.reload(),this}setUrl(t){return this.url=t,this._options.url=t,this.reload(),this}onRemove(t){this.cancelTileJSONRequest()}serialize(){return s.l({},this._options)}loadTile(t,r){const c=t.tileID.canonical.url(this.tiles,this.scheme),d=this.map._requestManager.normalizeTileURL(c),f=this.map._requestManager.transformRequest(d,s.R.Tile),_=this.map.style?this.map.style.getLut(this.scope):null,T=_?{image:_.image.clone()}:null,E={request:f,data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,lut:T,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,pixelRatio:s.q.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:t.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:t.isExtraShadowCaster,tessellationStep:this.map._tessellationStep,scaleFactor:this.map.getScaleFactor()};if(this.hasWorldviews&&s.f(c)&&(E.worldview=this.map.getWorldview()||this.worldviewDefault,E.localizableLayerIds=this.localizableLayerIds),E.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired")t.state==="loading"?t.reloadCallback=r:t.request=t.actor.send("reloadTile",E,M.bind(this));else if(t.actor=this._tileWorkers[d]=this._tileWorkers[d]||this.dispatcher.getActor(),this.dispatcher.ready)t.request=t.actor.send("loadTile",E,M.bind(this),void 0,!0);else{const A=s.aE.call({deduped:this._deduped},E,(z,C)=>{z||!C?M.call(this,z):(E.data={cacheControl:C.cacheControl,expires:C.expires,rawData:C.rawData.slice(0)},t.actor&&t.actor.send("loadTile",E,M.bind(this),void 0,!0))},!0);t.request={cancel:A}}function M(A,z){return delete t.request,t.aborted?r(null):A&&A.status!==404?r(A):(z&&z.resourceTiming&&(t.resourceTiming=z.resourceTiming),this.map._refreshExpiredTiles&&z&&t.setExpiryData(z),t.loadVectorData(z,this.map.painter),s.aF(this.dispatcher),r(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id,scope:this.scope})}unloadTile(t,r){t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id,scope:this.scope}),t.destroy()}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class gn extends s.E{constructor(t,r,c,d){super(),this.id=t,this.dispatcher=c,this.setEventedParent(d),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=s.l({type:"raster"},r),s.l(this,s.aA(r,["url","scheme","tileSize"]))}load(t){this._loaded=!1,this.fire(new s.A("dataloading",{dataType:"source"})),this._tileJSONRequest=dr(this._options,this.map._requestManager,null,null,(r,c)=>{this._tileJSONRequest=null,this._loaded=!0,r?this.fire(new s.z(r)):c&&(s.l(this,c),c.raster_layers&&(this.rasterLayers=c.raster_layers,this.rasterLayerIds=this.rasterLayers.map(d=>d.id)),c.bounds&&(this.tileBounds=new mr(c.bounds,this.minzoom,this.maxzoom)),As(c.tiles),this.fire(new s.A("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.A("data",{dataType:"source",sourceDataType:"content"}))),t&&t(r)})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}reload(){this.cancelTileJSONRequest();const t=s.C(this.id,this.scope);this.load(()=>this.map.style.clearSource(t))}setTiles(t){return this._options.tiles=t,this.reload(),this}setUrl(t){return this.url=t,this._options.url=t,this.reload(),this}onRemove(t){this.cancelTileJSONRequest()}serialize(){return s.l({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,r){const c=s.q.devicePixelRatio>=2,d=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),c,this.tileSize);t.request=s.o(this.map._requestManager.transformRequest(d,s.R.Tile),(f,_,T,E)=>(delete t.request,t.aborted?(t.state="unloaded",r(null)):f?(t.state="errored",r(f)):_?(this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:T,expires:E}),t.setTexture(_,this.map.painter),t.state="loaded",s.aF(this.dispatcher),void r(null)):r(null)))}abortTile(t,r){t.request&&(t.request.cancel(),delete t.request),r&&r()}unloadTile(t,r){t.texture&&t.texture instanceof s.T?(t.destroy(!0),t.texture&&t.texture instanceof s.T&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),r&&r()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Gn extends gn{constructor(t,r,c,d){super(t,r,c,d),this.type="raster-array",this.maxzoom=22,this.partial=!0,this._options=s.l({type:"raster-array"},r)}triggerRepaint(t){const r=this.map.painter._terrain,c=this.map.style.getSourceCache(this.id);r&&r.enabled&&c&&r._clearRenderCacheForTile(c.id,t.tileID),this.map.triggerRepaint()}loadTile(t,r){const c=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),d=this.map._requestManager.transformRequest(c,s.R.Tile),f={request:d,uid:t.uid,tileID:t.tileID,type:this.type,source:this.id,scope:this.scope,partial:this.partial};t.source=this.id,t.scope=this.scope,t.requestParams=d,t.actor||(t.actor=this.dispatcher.getActor());const _=(T,E,M,A)=>{if(delete t.request,t.aborted)return t.state="unloaded",r(null);if(T)return T.name==="AbortError"?void 0:(t.state="errored",r(T));if(this.map._refreshExpiredTiles&&E&&t.setExpiryData({cacheControl:M,expires:A}),this.partial)t.state="empty";else{if(!E)return r(null);t.state="loaded",t._isHeaderLoaded=!0,t._mrt=E}r(null)};t.request=this.partial?t.fetchHeader(void 0,_.bind(this)):t.actor.send("loadTile",f,_.bind(this),void 0,!0)}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id,scope:this.scope})}unloadTile(t,r){const c=t.texture;c&&c instanceof s.T?(t.destroy(!0),this.map.painter.saveTileTexture(c)):(t.destroy(),t.flushQueues(),t._isHeaderLoaded=!1,delete t._mrt,delete t.textureDescriptor),t.fbo&&(t.fbo.destroy(),delete t.fbo),delete t.request,delete t.requestParams,delete t.neighboringTiles,t.state="unloaded"}prepareTile(t,r,c){t._isHeaderLoaded&&(t.state!=="empty"&&(t.state="reloading"),t.fetchBand(r,c,(d,f)=>{if(d)return t.state="errored",this.fire(new s.z(d)),void this.triggerRepaint(t);f&&(t._isHeaderLoaded=!0,t.setTexture(f,this.map.painter),t.state="loaded",this.triggerRepaint(t))}))}getInitialBand(t){if(!this.rasterLayers)return 0;const r=this.rasterLayers.find(({id:f})=>f===t),c=r&&r.fields,d=c&&c.bands&&c.bands;return d?d[0]:0}getTextureDescriptor(t,r,c){if(!t)return;const d=r.sourceLayer||this.rasterLayerIds&&this.rasterLayerIds[0];if(!d)return;let f=null;r instanceof s.aI?f=r.paint.get("raster-array-band"):r instanceof s.aJ&&(f=r.paint.get("raster-particle-array-band"));const _=f||this.getInitialBand(d);if(_!=null)if(t.textureDescriptor){if(!t.updateNeeded(d,_)||c)return Object.assign({},t.textureDescriptor,{texture:t.texture})}else this.prepareTile(t,d,_)}getImages(t,r){const c=new Map;for(const d of t)for(const f of r){const[_,T]=f.split("/"),E=d.getLayer(_);if(!E||!E.hasBand(T)||!E.hasDataForBand(T))continue;const{bytes:M,tileSize:A,buffer:z}=E.getBandView(T),C=A+2*z,k={data:new s.r({width:C,height:C},M),pixelRatio:2,sdf:!1,usvg:!1,version:0};c.set(f,k)}return c}}const i3={vector:Os,raster:gn,"raster-dem":class extends gn{constructor(u,t,r,c){super(u,t,r,c),this.type="raster-dem",this.maxzoom=22,this._options=s.l({type:"raster-dem"},t),this.encoding=t.encoding||"mapbox"}loadTile(u,t){const r=this.map._requestManager.normalizeTileURL(u.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function c(d,f){d&&(u.state="errored",t(d)),f&&(u.dem=f,u.dem.onDeserialize(),u.needsHillshadePrepare=!0,u.needsDEMTextureUpload=!0,u.state="loaded",t(null))}u.request=s.o(this.map._requestManager.transformRequest(r,s.R.Tile),(function(d,f,_,T){if(delete u.request,u.aborted)u.state="unloaded",t(null);else if(d)u.state="errored",t(d);else if(f){this.map._refreshExpiredTiles&&u.setExpiryData({cacheControl:_,expires:T});const E=ImageBitmap&&f instanceof ImageBitmap&&s.t(),M=1-(f.width-s.aG(f.width))/2;M<1||u.neighboringTiles||(u.neighboringTiles=this._getNeighboringTiles(u.tileID));const A=E?f:s.q.getImageData(f,M),z={uid:u.uid,tileID:u.tileID,source:this.id,type:this.type,scope:this.scope,rawImageData:A,encoding:this.encoding,padding:M};u.actor&&u.state!=="expired"||(u.actor=this.dispatcher.getActor(),u.actor.send("loadTile",z,c.bind(this),void 0,!0))}}).bind(this))}_getNeighboringTiles(u){const t=u.canonical,r=Math.pow(2,t.z),c=(t.x-1+r)%r,d=t.x===0?u.wrap-1:u.wrap,f=(t.x+1+r)%r,_=t.x+1===r?u.wrap+1:u.wrap,T={};return T[new s.aH(u.overscaledZ,d,t.z,c,t.y).key]={backfilled:!1},T[new s.aH(u.overscaledZ,_,t.z,f,t.y).key]={backfilled:!1},t.y>0&&(T[new s.aH(u.overscaledZ,d,t.z,c,t.y-1).key]={backfilled:!1},T[new s.aH(u.overscaledZ,u.wrap,t.z,t.x,t.y-1).key]={backfilled:!1},T[new s.aH(u.overscaledZ,_,t.z,f,t.y-1).key]={backfilled:!1}),t.y+1{if(this._loaded=!0,this._pendingLoad=null,c)this.fire(new s.z(c));else{const f={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&d&&d.resourceTiming&&d.resourceTiming[this.id]&&(f.resourceTiming=d.resourceTiming[this.id]),u&&(this._partialReload=!0),this.fire(new s.A("data",f)),this._partialReload=!1,this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(u),this._coalesce=!1)})}loaded(){return this._loaded}reload(){const u=s.C(this.id,this.scope);this.map.style.clearSource(u),this._updateWorkerData()}loadTile(u,t){const r=u.actor?"reloadTile":"loadTile";u.actor=this.actor;const c=this.map.style?this.map.style.getLut(this.scope):null,d=c?{image:c.image.clone()}:null,f=this._partialReload,_={type:this.type,uid:u.uid,tileID:u.tileID,tileZoom:u.tileZoom,zoom:u.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,lut:d,scope:this.scope,pixelRatio:s.q.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,brightness:this.map.style&&this.map.style.getBrightness()||0,scaleFactor:this.map.getScaleFactor(),partial:f};u.request=this.actor.send(r,_,(T,E)=>f&&!E?(u.state="loaded",t(null)):(delete u.request,u.destroy(),u.aborted?t(null):T?t(T):(u.loadVectorData(E,this.map.painter,r==="reloadTile"),t(null))),void 0,r==="loadTile")}abortTile(u){u.request&&(u.request.cancel(),delete u.request),u.aborted=!0}unloadTile(u,t){this.actor.send("removeTile",{uid:u.uid,type:this.type,source:this.id,scope:this.scope}),u.destroy()}onRemove(u){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return s.l({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends s.aK{constructor(u,t,r,c){super(u,t,r,c),this.roundZoom=!0,this.type="video",this.options=t}load(){this._loaded=!1;const u=this.options;this.urls=[];for(const t of u.urls)this.urls.push(this.map._requestManager.transformRequest(t,s.R.Source).url);s.aL(this.urls,(t,r)=>{this._loaded=!0,t?this.fire(new s.z(t)):r&&(this.video=r,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(u){if(this.video){const t=this.video.seekable;ut.end(0)?this.fire(new s.z(new s.V(`sources.${this.id}`,null,`Playback for this video can be set only between the ${t.start(0)} and ${t.end(0)}-second mark.`))):this.video.currentTime=u}}getVideo(){return this.video}onAdd(u){this.map||(this.map=u,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const u=this.map.painter.context,t=u.gl;this.texture?this.video.paused||(this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this.texture=new s.T(u,this.video,t.RGBA8),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(u)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:s.aK,model:class extends s.E{constructor(u,t,r,c){super(),this.id=u,this.type="model",this.models=[],this._loaded=!1,this._options=t}load(){const u=[];for(const t in this._options.models){const r=this._options.models[t],c=s.aN(this.map._requestManager.transformRequest(r.uri,s.R.Model).url).then(d=>{if(!d)return;const f=s.aO(d),_=new s.aP(t,r.position,r.orientation,f);_.computeBoundsAndApplyParent(),this.models.push(_)}).catch(d=>{this.fire(new s.z(new Error(`Could not load model ${t} from ${r.uri}: ${d.message}`)))});u.push(c)}return Promise.allSettled(u).then(()=>{this._loaded=!0,this.fire(new s.A("data",{dataType:"source",sourceDataType:"metadata"}))}).catch(t=>{this.fire(new s.z(new Error(`Could not load models: ${t.message}`)))})}onAdd(u){this.map=u,this.load()}hasTransition(){return!1}loaded(){return this._loaded}getModels(){return this.models}loadTile(u,t){}serialize(){return{type:"model"}}},"batched-model":class extends s.E{constructor(u,t,r,c){super(),this.type="batched-model",this.id=u,this.tileSize=512,this._options=t,this.tiles=this._options.tiles,this.maxzoom=t.maxzoom||19,this.minzoom=t.minzoom||0,this.roundZoom=!0,this.usedInConflation=!0,this.dispatcher=r,this.reparseOverscaled=!1,this.scheme="xyz",this._loaded=!1,this.setEventedParent(c)}onAdd(u){this.map=u,this.load()}reload(){this.cancelTileJSONRequest();const u=s.C(this.id,this.scope);this.load(()=>this.map.style.clearSource(u))}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}load(u){this._loaded=!1,this.fire(new s.A("dataloading",{dataType:"source"}));const t=Array.isArray(this.map._language)?this.map._language.join():this.map._language,r=this.map.getWorldview();this._tileJSONRequest=dr(this._options,this.map._requestManager,t,r,(c,d)=>{this._tileJSONRequest=null,this._loaded=!0,c?(t&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${t}`),r&&r.length!==2&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${r}`),this.fire(new s.z(c))):d&&(s.l(this,d),d.bounds&&(this.tileBounds=new mr(d.bounds,this.minzoom,this.maxzoom)),As(d.tiles,this.map._requestManager._customAccessToken),this.fire(new s.A("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.A("data",{dataType:"source",sourceDataType:"content"}))),u&&u(c)})}hasTransition(){return!1}hasTile(u){return!this.tileBounds||this.tileBounds.contains(u.canonical)}loaded(){return this._loaded}loadTile(u,t){const r=this.map._requestManager.normalizeTileURL(u.tileID.canonical.url(this.tiles,this.scheme)),c={request:this.map._requestManager.transformRequest(r,s.R.Tile),data:void 0,uid:u.uid,tileID:u.tileID,tileZoom:u.tileZoom,zoom:u.tileID.overscaledZ,tileSize:this.tileSize*u.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,showCollisionBoxes:this.map.showCollisionBoxes,isSymbolTile:u.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,pixelRatio:s.q.devicePixelRatio,promoteId:this.promoteId};if(u.actor&&u.state!=="expired")if(u.state==="loading")u.reloadCallback=t;else{if(u.buckets){const f=Object.values(u.buckets);for(const _ of f)_.dirty=!0;return void(u.state="loaded")}u.request=u.actor.send("reloadTile",c,d.bind(this))}else u.actor=this.dispatcher.getActor(),u.request=u.actor.send("loadTile",c,d.bind(this),void 0,!0);function d(f,_){return u.aborted?t(null):f&&f.status!==404?t(f):(this.map._refreshExpiredTiles&&_&&u.setExpiryData(_),u.loadModelData(_,this.map.painter),u.state="loaded",void t(null))}}serialize(){return s.l({},this._options)}},canvas:class extends s.aK{constructor(u,t,r,c){super(u,t,r,c),t.coordinates?Array.isArray(t.coordinates)&&t.coordinates.length===4&&!t.coordinates.some(d=>!Array.isArray(d)||d.length!==2||d.some(f=>typeof f!="number"))||this.fire(new s.z(new s.V(`sources.${u}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new s.z(new s.V(`sources.${u}`,null,'missing required property "coordinates"'))),t.animate&&typeof t.animate!="boolean"&&this.fire(new s.z(new s.V(`sources.${u}`,null,'optional "animate" property must be a boolean value'))),t.canvas?typeof t.canvas=="string"||t.canvas instanceof HTMLCanvasElement||this.fire(new s.z(new s.V(`sources.${u}`,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 s.z(new s.V(`sources.${u}`,null,'missing required property "canvas"'))),this.options=t,this.animate=t.animate===void 0||t.animate}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 s.z(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())}getCanvas(){return this.canvas}onAdd(u){this.map=u,this.load(),this.canvas&&this.animate&&this.play()}onRemove(u){this.pause()}prepare(){let u=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,u=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,u=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const t=this.map.painter.context;this.texture?!u&&!this._playing||this.texture instanceof s.aM||this.texture.update(this.canvas,{premultiply:!0}):this.texture=new s.T(t,this.canvas,t.gl.RGBA8,{premultiply:!0}),this._prepareData(t)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const u of[this.canvas.width,this.canvas.height])if(isNaN(u)||u<=0)return!0;return!1}},custom:class extends s.E{constructor(u,t,r,c){super(),this.id=u,this.type="custom",this._dataType="raster",this._dispatcher=r,this._implementation=t,this.setEventedParent(c),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new s.z(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new s.z(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new mr(this._implementation.bounds,this.minzoom,this.maxzoom)),t.update=this._update.bind(this),t.clearTiles=this._clearTiles.bind(this),t.coveringTiles=this._coveringTiles.bind(this),s.l(this,s.aA(t,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return s.aA(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new s.A("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.A("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(u){this.map=u,this._loaded=!1,this.fire(new s.A("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(u),this.load()}onRemove(u){this._implementation.onRemove&&this._implementation.onRemove(u)}hasTile(u){if(this._implementation.hasTile){const{x:t,y:r,z:c}=u.canonical;return this._implementation.hasTile({x:t,y:r,z:c})}return!this.tileBounds||this.tileBounds.contains(u.canonical)}loadTile(u,t){const{x:r,y:c,z:d}=u.tileID.canonical,f=new AbortController;u.request=Promise.resolve(this._implementation.loadTile({x:r,y:c,z:d},{signal:f.signal})).then((function(_){return delete u.request,u.aborted?(u.state="unloaded",t(null)):_===void 0?(u.state="errored",t(null)):_===null?(this.loadTileData(u,{width:this.tileSize,height:this.tileSize,data:null}),u.state="loaded",t(null)):function(T){return T instanceof ImageData||T instanceof HTMLCanvasElement||T instanceof ImageBitmap||T instanceof HTMLImageElement}(_)?(this.loadTileData(u,_),u.state="loaded",void t(null)):(u.state="errored",t(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(_=>{_.name!=="AbortError"&&(u.state="errored",t(_))}),u.request.cancel=()=>f.abort()}loadTileData(u,t){u.setTexture(t,this.map.painter)}unloadTile(u,t){if(u.texture&&u.texture instanceof s.T?(u.destroy(!0),u.texture&&u.texture instanceof s.T&&this.map.painter.saveTileTexture(u.texture)):u.destroy(),this._implementation.unloadTile){const{x:r,y:c,z:d}=u.tileID.canonical;this._implementation.unloadTile({x:r,y:c,z:d})}t&&t()}abortTile(u,t){u.request&&u.request.cancel&&(u.request.cancel(),delete u.request),t&&t()}hasTransition(){return!1}_coveringTiles(){return this.map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(u=>({x:u.canonical.x,y:u.canonical.y,z:u.canonical.z}))}_clearTiles(){const u=s.C(this.id,this.scope);this.map.style.clearSource(u)}_update(){this.fire(new s.A("data",{dataType:"source",sourceDataType:"content"}))}}},N0=function(u,t,r,c){const d=new i3[t.type](u,t,r,c);if(d.id!==u)throw new Error(`Expected Source id to be ${u} instead of ${d.id}`);return s.aQ(["load","abort","unload","serialize","prepare"],d),d};function Ua(u,t,r=""){return`${r}:${t.id||""}:${t.layer.id}:${function(c){if("layerId"in c)return`layer:${c.layerId}`;{const{featuresetId:d,importId:f}=c;return`featureset:${d}${f?`:import:${f}`:""}`}}(u.target)}`}function ks(u,t,r,c=""){if(u.uniqueFeatureID){const d=Ua(u,t,c);if(r.has(d))return!0;r.add(d)}return!1}function r3(u,t,r,c,d=!1){const f=t.sourceCache.transform,_=t.sourceCache.tilesIn(u,t.has3DLayers,d);_.sort(n3);const T=[];for(const E of _){const M=E.tile.queryRenderedFeatures(t,E,r,c,f,d);Object.keys(M).length&&T.push({wrappedTileID:E.tile.tileID.wrapped().key,queryResults:M})}return T.length===0?{}:function(E){const M={},A={};for(const z of E){const C=z.queryResults,k=z.wrappedTileID,j=A[k]=A[k]||{};for(const N in C){const G=C[N],$=j[N]=j[N]||{},K=M[N]=M[N]||[];for(const ie of G)$[ie.featureIndex]||($[ie.featureIndex]=!0,K.push(ie))}}return M}(T)}function hc(u,t,r,c,d){const f={},_=c.queryRenderedSymbols(u),T=[];for(const E of Object.keys(_).map(Number))T.push(d[E]);T.sort(n3);for(const E of T){const M=E.featureIndex.lookupSymbolFeatures(_[E.bucketInstanceId],E.bucketIndex,E.sourceLayerIndex,t,r);for(const A in M){const z=f[A]=f[A]||[],C=M[A];C.sort((k,j)=>{const N=E.featureSortOrder;if(N){const G=N.indexOf(k.featureIndex);return N.indexOf(j.featureIndex)-G}return j.featureIndex-k.featureIndex});for(const k of C)z.push(k)}}return f}function dc(u,t){const r=u.getRenderableIds().map(f=>u.getTileByID(f)),c=[],d={};for(let f=0;ft.getLayer(f)).filter(Boolean);if(d.length!==0){c.layers=d,c.stateDependentLayerIds&&(c.stateDependentLayers=c.stateDependentLayerIds.map(f=>d.filter(_=>_.id===f)[0]));for(const f of d)r[f.fqid]=c}}return r}const tn=32,Pn=33,ko=new Uint16Array(8184);for(let u=0;u<2046;u++){let t=u+2,r=0,c=0,d=0,f=0,_=0,T=0;for(1&t?d=f=_=tn:r=c=T=tn;(t>>=1)>1;){const M=r+d>>1,A=c+f>>1;1&t?(d=r,f=c,r=_,c=T):(r=d,c=f,d=_,f=T),_=M,T=A}const E=4*u;ko[E+0]=r,ko[E+1]=c,ko[E+2]=d,ko[E+3]=f}const rn=new Uint16Array(2178),Zr=new Uint8Array(1089),Bs=new Uint16Array(1089);function o3(u){return u===0?-.03125:u===32?.03125:0}const V0=(()=>({type:2,extent:s.ai,loadGeometry:()=>[[new s.P(0,0),new s.P(s.ai+1,0),new s.P(s.ai+1,s.ai+1),new s.P(0,s.ai+1),new s.P(0,0)]]}))();class Cn{constructor(t,r,c,d,f){this.tileID=t,this.uid=s.aW(),this.uses=0,this.tileSize=r,this.tileZoom=c,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=f,d&&d.style&&(this._lastUpdatedBrightness=d.style.getBrightness()),this.expiredRequestCount=0,this.state="loading",d&&d.transform&&(this.projection=d.transform.projection)}registerFadeDuration(t){const r=t+this.timeAdded;rc)d=!1;else if(r)if(this.expirationTime0&&!r;j&&!T.stateDependentLayers.length&&!r||T.update(C,A,d,k,j?T.stateDependentLayers:T.layers,r,f),(T instanceof s.b2||T instanceof s.b3)&&t._terrain&&t._terrain.enabled&&z&&T.uploadPending()&&t._terrain._clearRenderCacheForTile(z.id,this.tileID);const N=t&&t.style&&t.style.getOwnLayer(_);N&&(this.queryPadding=Math.max(this.queryPadding,N.queryRadius(T)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil=0;G--){const $=4*G,K=ko[$+0],ie=ko[$+1],te=ko[$+2],ae=ko[$+3],ne=K+te>>1,oe=ie+ae>>1,se=ne+oe-ie,he=oe+K-ne,fe=ie*Pn+K,Ce=ae*Pn+te,Se=oe*Pn+ne,Ve=Math.hypot((rn[2*fe+0]+rn[2*Ce+0])/2-rn[2*Se+0],(rn[2*fe+1]+rn[2*Ce+1])/2-rn[2*Se+1])>=16;Zr[Se]=Zr[Se]||(Ve?1:0),G<1022&&(Zr[Se]=Zr[Se]||Zr[(ie+he>>1)*Pn+(K+se>>1)]||Zr[(ae+he>>1)*Pn+(te+se>>1)])}const z=new s.aU,C=new s.aV;let k=0;function j(G,$){const K=$*Pn+G;return Bs[K]===0&&(z.emplaceBack(rn[2*K+0],rn[2*K+1],G*s.ai/tn,$*s.ai/tn),Bs[K]=++k),Bs[K]-1}function N(G,$,K,ie,te,ae){const ne=G+K>>1,oe=$+ie>>1;if(Math.abs(G-te)+Math.abs($-ae)>1&&Zr[oe*Pn+ne])N(te,ae,G,$,ne,oe),N(K,ie,te,ae,ne,oe);else{const se=j(G,$),he=j(K,ie),fe=j(te,ae);C.emplaceBack(se,he,fe)}}return N(0,0,tn,tn,tn,0),N(tn,tn,0,0,0,tn),{vertices:z,indices:C}}(this.tileID.canonical,r);d=_.vertices,f=_.indices}else{d=new s.aU,f=new s.aV;for(const{x:T,y:E}of c)d.emplaceBack(T,E,0,0);const _=s.b9(d.int16,void 0,4);for(let T=0;T<_.length;T+=3)f.emplaceBack(_[T],_[T+1],_[T+2])}this._tileBoundsBuffer=t.createVertexBuffer(d,s.ba.members),this._tileBoundsIndexBuffer=t.createIndexBuffer(f),this._tileBoundsSegments=s.b8.simpleSegment(0,0,d.length,f.length)}_makeGlobeTileDebugBuffers(t,r){const c=r.projection;if(!c||c.name!=="globe"||r.freezeTileCoverage)return;const d=this.tileID.canonical,f=s.bb(d,r),_=s.bc(f),T=s.ag(r.zoom);let E;T>0&&(E=s.ad.mat4.invert(new Float64Array(16),r.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(t,d,r,_,E,T),this._makeGlobeTileDebugTextBuffer(t,d,r,_,E,T)}_globePoint(t,r,c,d,f,_,T){let E=s.bd(t,r,c);if(_){const M=1<.5?k=-1:C<-.5&&(k=1);let j=(t/s.ai+c.x)/M+k,N=(r/s.ai+c.y)/M;j=(j-A)*d._pixelsPerMercatorPixel+A,N=(N-z)*d._pixelsPerMercatorPixel+z;const G=[j*d.worldSize,N*d.worldSize,0];s.ad.vec3.transformMat4(G,G,_),E=s.be(E,G,T)}return s.ad.vec3.transformMat4(E,E,f)}_makeGlobeTileDebugBorderBuffer(t,r,c,d,f,_){const T=new s.b5,E=new s.b6,M=new s.bf,A=(C,k,j,N,G)=>{const $=(j-C)/(G-1),K=(N-k)/(G-1),ie=T.length;for(let te=0;tez*k+j;for(let k=0;k{if(f)r(f);else try{const M=c.getHeaderLength(_);if(M>t)return void(this.request=this.fetchHeader(M,r));c.parseHeader(_),this._isHeaderLoaded=!0;let A=0;for(const z of Object.values(c.layers))A=Math.max(A,z.dataIndex[z.dataIndex.length-1].lastByte);_.byteLength>=A&&(this.entireBuffer=_),r(null,this.entireBuffer||_,T,E)}catch(M){r(M)}}),this.request}fetchBand(t,r,c){const d=this._mrt;if(!this._isHeaderLoaded||!d)return void c(new Error("Tile header is not ready"));const f=this.actor;if(!f)return void c(new Error("Can't fetch tile band without an actor"));let _;const T=(z,C)=>{_.complete(z,C),z?c(z):(this.updateTextureDescriptor(t,r),c(null,this.textureDescriptor&&this.textureDescriptor.img))},E=(z,C)=>{if(z)return c(z);const k=f.send("decodeRasterArray",{type:"raster-array",source:this.source,scope:this.scope,tileID:this.tileID,uid:this.uid,buffer:C,task:_},T,void 0,!0);this._workQueue.push(()=>{k&&k.cancel(),_.cancel()})},M=d.getLayer(t);if(!M)return void c(new Error(`Unknown sourceLayer "${t}"`));if(M.hasDataForBand(r))return this.updateTextureDescriptor(t,r),void c(null,this.textureDescriptor?this.textureDescriptor.img:null);const A=M.getDataRange([r]);if(_=d.createDecodingTask(A),!_||_.tasks.length)if(this.flushQueues(),this.entireBuffer)E(null,this.entireBuffer.slice(A.firstByte,A.lastByte+1));else{const z=Object.assign({},this.requestParams,{headers:{Range:`bytes=${A.firstByte}-${A.lastByte}`}}),C=s.bj(z,E);this._fetchQueue.push(()=>{C.cancel(),_.cancel()})}else c(null)}updateNeeded(t,r){return(!this.textureDescriptor||this.textureDescriptor.band!==r||this.textureDescriptor.layer!==t)&&this.state!=="errored"}updateTextureDescriptor(t,r){if(!this._mrt)return;const c=this._mrt.getLayer(t);if(!c||!c.hasBand(r)||!c.hasDataForBand(r))return;const{bytes:d,tileSize:f,buffer:_,offset:T,scale:E}=c.getBandView(r),M=f+2*_,A=new s.r({width:M,height:M},d),z=this.texture;z&&z instanceof s.T&&z.update(A,{premultiply:!1}),this.textureDescriptor={layer:t,band:r,img:A,buffer:_,offset:T,tileSize:f,format:c.pixelFormat,mix:[E,256*E,65536*E,16777216*E]}}}class pc{constructor(t,r){this.max=t,this.onRemove=r,this.reset()}reset(){for(const t in this.data)for(const r of this.data[t])r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value);return this.data={},this.order=[],this}add(t,r,c){const d=t.wrapped().key;this.data[d]===void 0&&(this.data[d]=[]);const f={value:r,timeout:void 0};if(c!==void 0&&(f.timeout=setTimeout(()=>{this.remove(t,f)},c)),this.data[d].push(f),this.order.push(d),this.order.length>this.max){const _=this._getAndRemoveByKey(this.order[0]);_&&this.onRemove(_)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const r=this.data[t].shift();return r.timeout&&clearTimeout(r.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),r.value}getByKey(t){const r=this.data[t];return r?r[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,r){if(!this.has(t))return this;const c=t.wrapped().key,d=r===void 0?0:this.data[c].indexOf(r),f=this.data[c][d];return this.data[c].splice(d,1),f.timeout&&clearTimeout(f.timeout),this.data[c].length===0&&delete this.data[c],this.onRemove(f.value),this.order.splice(this.order.indexOf(c),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const r=this._getAndRemoveByKey(this.order[0]);r&&this.onRemove(r)}return this}filter(t){const r=[];for(const c in this.data)for(const d of this.data[c])t(d.value)||r.push(d);for(const c of r)this.remove(c.value.tileID,c)}}class s3{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,r,c){const d=String(r);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][d]=this.stateChanges[t][d]||{},s.l(this.stateChanges[t][d],c),this.deletedStates[t]===null){this.deletedStates[t]={};for(const f in this.state[t])f!==d&&(this.deletedStates[t][f]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][d]===null){this.deletedStates[t][d]={};for(const f in this.state[t][d])c[f]||(this.deletedStates[t][d][f]=null)}else for(const f in c)this.deletedStates[t]&&this.deletedStates[t][d]&&this.deletedStates[t][d][f]===null&&delete this.deletedStates[t][d][f]}removeFeatureState(t,r,c){if(this.deletedStates[t]===null)return;const d=String(r);if(this.deletedStates[t]=this.deletedStates[t]||{},c&&r!==void 0)this.deletedStates[t][d]!==null&&(this.deletedStates[t][d]=this.deletedStates[t][d]||{},this.deletedStates[t][d][c]=null);else if(r!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][d])for(c in this.deletedStates[t][d]={},this.stateChanges[t][d])this.deletedStates[t][d][c]=null;else this.deletedStates[t][d]=null;else this.deletedStates[t]=null}getState(t,r){const c=this.state[t]||{},d=this.stateChanges[t]||{},f=this.deletedStates[t];if(f===null)return{};if(r!==void 0){const T=String(r),E=s.l({},c[T],d[T]);if(f){const M=f[r];if(M===null)return{};for(const A in M)delete E[A]}return E}const _=s.l({},c,d);if(f)for(const T in f)delete _[T];return _}initializeTileState(t,r){t.refreshFeatureState(r)}coalesceChanges(t,r){const c={};for(const d in this.stateChanges){this.state[d]=this.state[d]||{};const f={};for(const _ in this.stateChanges[d])this.state[d][_]||(this.state[d][_]={}),s.l(this.state[d][_],this.stateChanges[d][_]),f[_]=this.state[d][_];c[d]=f}for(const d in this.deletedStates){this.state[d]=this.state[d]||{};const f={};if(this.deletedStates[d]===null)for(const _ in this.state[d])f[_]={},this.state[d][_]={};else for(const _ in this.deletedStates[d]){if(this.deletedStates[d][_]===null)this.state[d][_]={};else if(this.state[d][_])for(const T of Object.keys(this.deletedStates[d][_]))delete this.state[d][_][T];f[_]=this.state[d][_]}c[d]=c[d]||{},s.l(c[d],f)}if(this.stateChanges={},this.deletedStates={},Object.keys(c).length!==0)for(const d in t)t[d].refreshFeatureState(r)}}class yn extends s.E{constructor(t,r,c){super(),this.id=t,this._onlySymbols=c,r.on("data",d=>{d.dataType==="source"&&d.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&d.dataType==="source"&&d.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),r.on("error",()=>{this._sourceErrored=!0}),this._source=r,this._tiles={},this._cache=new pc(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=r.minTileCacheSize,this._maxTileCacheSize=r.maxTileCacheSize,this._loadedParentTiles={},this.castsShadows=!1,this.tileCoverLift=0,this._coveredTiles={},this._shadowCasterTiles={},this._state=new s3,this._isRaster=this._source.type==="raster"||this._source.type==="raster-dem"||this._source.type==="raster-array"||this._source.type==="custom"&&this._source._dataType==="raster"}onAdd(t){this.map=t,this._minTileCacheSize=this._minTileCacheSize===void 0&&t?t._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=this._maxTileCacheSize===void 0&&t?t._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const t in this._tiles)if(!this._tiles[t].loaded())return!1;return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(t,r){return t.isSymbolTile=this._onlySymbols,t.isExtraShadowCaster=this._shadowCasterTiles[t.tileID.key],this._source.loadTile(t,r)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t)}_abortTile(t){if(this._source.abortTile)return this._source.abortTile(t)}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const r in this._tiles){const c=this._tiles[r];c.upload(t),c.prepare(this.map.style.imageManager,this.map?this.map.painter:null,this._source.scope)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(bi).map(t=>t.key)}getRenderableIds(t,r){const c=[];for(const d in this._tiles)this._isIdRenderable(+d,t,r)&&c.push(this._tiles[d]);return t?c.sort((d,f)=>{const _=d.tileID,T=f.tileID,E=new s.P(_.canonical.x,_.canonical.y)._rotate(this.transform.angle),M=new s.P(T.canonical.x,T.canonical.y)._rotate(this.transform.angle);return _.overscaledZ-T.overscaledZ||M.y-E.y||M.x-E.x}).map(d=>d.tileID.key):c.map(d=>d.tileID).sort(bi).map(d=>d.key)}hasRenderableParent(t){const r=this.findLoadedParent(t,0);return!!r&&this._isIdRenderable(r.tileID.key)}_isIdRenderable(t,r,c){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(r||!this._tiles[t].holdingForFade())&&(c||!this._shadowCasterTiles[t])}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(+t,"reloading")}}_reloadTile(t,r){const c=this._tiles[t];c&&(c.state!=="loading"&&(c.state=r),this._loadTile(c,this._tileLoaded.bind(this,c,t,r)))}_tileLoaded(t,r,c,d){if(d)if(t.state="errored",d.status!==404)this._source.fire(new s.z(d,{tile:t}));else{if(this._source.fire(new s.A("data",{dataType:"source",sourceDataType:"error",sourceId:this._source.id,tile:t})),!(t.tileID.key in this._loadedParentTiles))return;if(this._source.type==="raster-dem"&&this.usedForTerrain&&this.map.painter.terrain){const f=this.map.painter.terrain;this.update(this.transform,f.getScaledDemTileSize(),!0),f.resetTileLookupCache(this.id)}else this.update(this.transform)}else t.timeAdded=s.q.now(),c==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(r,t),this._source.type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new s.A("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id}))}_backfillDEM(t){const r=this.getRenderableIds();for(let d=0;d1||(Math.abs(_)>1&&(Math.abs(_+E)===1?_+=E:Math.abs(_-E)===1&&(_-=E)),f.dem&&d.dem&&(d.dem.backfillBorder(f.dem,_,T),d.neighboringTiles&&d.neighboringTiles[M]&&(d.neighboringTiles[M].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,r,c,d){for(const f in this._tiles){let _=this._tiles[f];if(d[f]||!_.hasData()||_.tileID.overscaledZ<=r||_.tileID.overscaledZ>c)continue;let T=_.tileID;for(;_&&_.tileID.overscaledZ>r+1;){const M=_.tileID.scaledTo(_.tileID.overscaledZ-1);_=this._tiles[M.key],_&&_.hasData()&&(T=M)}let E=T;for(;E.overscaledZ>r;)if(E=E.scaledTo(E.overscaledZ-1),t[E.key]){d[T.key]=T;break}}}findLoadedParent(t,r){if(t.key in this._loadedParentTiles){const c=this._loadedParentTiles[t.key];return c&&c.tileID.overscaledZ>=r?c:null}for(let c=t.overscaledZ-1;c>=r;c--){const d=t.scaledTo(c),f=this._getLoadedTile(d);if(f)return f}}_getLoadedTile(t){const r=this._tiles[t.key];return r&&r.hasData()?r:this._cache.getByKey(this._source.reparseOverscaled?t.wrapped().key:t.canonical.key)}updateCacheSize(t,r){r=r||this._source.tileSize;const c=Math.ceil(t.width/r)+1,d=Math.ceil(t.height/r)+1,f=Math.floor(c*d*5),_=typeof this._minTileCacheSize=="number"?Math.max(this._minTileCacheSize,f):f,T=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,_):_;this._cache.setMaxSize(T)}handleWrapJump(t){const r=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,r){const c={};for(const d in this._tiles){const f=this._tiles[d];f.tileID=f.tileID.unwrapTo(f.tileID.wrap+r),c[f.tileID.key]=f}this._tiles=c;for(const d in this._timers)clearTimeout(this._timers[d]),delete this._timers[d];for(const d in this._tiles)this._setTileReloadTimer(+d,this._tiles[d])}}update(t,r,c,d){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!c)return;this.updateCacheSize(t,r),this.transform.projection.name!=="globe"&&this.handleWrapJump(this.transform.center.lng),this._shadowCasterTiles={},this._coveredTiles={};const f=this._source.type==="batched-model";let _,T=this._source.maxzoom;const E=this.map&&this.map.painter?this.map.painter._terrain:null;if(E&&E.sourceCache===this&&E.attenuationRange()){const z=E.attenuationRange()[0],C=Math.floor(z)-Math.log2(E.getDemUpscale());T>C&&(T=C)}if(this.used||this.usedForTerrain){if(this._source.tileID)_=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(z=>new s.aH(z.canonical.z,z.wrap,z.canonical.z,z.canonical.x,z.canonical.y));else if(this.tileCoverLift!==0){const z=t.clone();z.tileCoverLift=this.tileCoverLift,_=z.coveringTiles({tileSize:r||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:T,roundZoom:this._source.roundZoom&&!c,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:f}),this._source.minzoom<=1&&t.projection.name==="globe"&&(_.push(new s.aH(1,0,1,0,0)),_.push(new s.aH(1,0,1,1,0)),_.push(new s.aH(1,0,1,0,1)),_.push(new s.aH(1,0,1,1,1)))}else if(_=t.coveringTiles({tileSize:r||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:T,roundZoom:this._source.roundZoom&&!c,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:f}),this._source.hasTile){const z=this._source.hasTile.bind(this._source);_=_.filter(C=>z(C))}}else _=[];if(_.length>0&&this.castsShadows&&d&&this.transform.projection.name!=="globe"&&!this.usedForTerrain&&!a3(this._source.type)){const z=t.coveringZoomLevel({tileSize:r||this._source.tileSize,roundZoom:this._source.roundZoom&&!c}),C=Math.min(z,this._source.maxzoom);if(f){const k=t.extendTileCover(_,C);for(const j of k)_.push(j)}else{const k=t.extendTileCover(_,C,d);for(const j of k)this._shadowCasterTiles[j.key]=!0,_.push(j)}}const M=this._updateRetainedTiles(_);if(a3(this._source.type)&&_.length!==0){const z={},C={},k=Object.keys(M);for(const N of k){const G=M[N],$=this._tiles[N];if(!$||$.fadeEndTime&&$.fadeEndTime<=s.q.now())continue;const K=this.findLoadedParent(G,Math.max(G.overscaledZ-yn.maxOverzooming,this._source.minzoom));K&&(this._addTile(K.tileID),z[K.tileID.key]=K.tileID),C[N]=G}const j=_[_.length-1].overscaledZ;for(const N in this._tiles){const G=this._tiles[N];if(M[N]||!G.hasData())continue;let $=G.tileID;for(;$.overscaledZ>j;){$=$.scaledTo($.overscaledZ-1);const K=this._tiles[$.key];if(K&&K.hasData()&&C[$.key]){M[N]=G.tileID;break}}}for(const N in z)M[N]||(this._coveredTiles[N]=!0,M[N]=z[N])}for(const z in M)this._tiles[z].clearFadeHold();const A=s.bk(this._tiles,M);for(const z of A){const C=this._tiles[z];C.hasSymbolBuckets&&!C.holdingForFade()?C.setHoldDuration(this.map._fadeDuration):C.hasSymbolBuckets&&!C.symbolFadeFinished()||this._removeTile(+z)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(+t)}_updateRetainedTiles(t){const r={};if(t.length===0)return r;const c={},d=t.reduce((M,A)=>Math.min(M,A.overscaledZ),1/0),f=t[0].overscaledZ,_=Math.max(f-yn.maxOverzooming,this._source.minzoom),T=Math.max(f+yn.maxUnderzooming,this._source.minzoom),E={};for(const M of t){const A=this._addTile(M);r[M.key]=M,A.hasData()||d=this._source.maxzoom){const C=M.children(this._source.maxzoom)[0],k=this.getTile(C);if(k&&k.hasData()){r[C.key]=C;continue}}else{const C=M.children(this._source.maxzoom);if(r[C[0].key]&&r[C[1].key]&&r[C[2].key]&&r[C[3].key])continue}let z=A.wasRequested();for(let C=M.overscaledZ-1;C>=_;--C){const k=M.scaledTo(C);if(c[k.key]||(c[k.key]=!0,A=this.getTile(k),!A&&z&&(A=this._addTile(k)),A&&(r[k.key]=k,z=A.wasRequested(),A.hasData())))break}}return r}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const r=[];let c,d=this._tiles[t].tileID;for(;d.overscaledZ>0;){if(d.key in this._loadedParentTiles){c=this._loadedParentTiles[d.key];break}r.push(d.key);const f=d.scaledTo(d.overscaledZ-1);if(c=this._getLoadedTile(f),c)break;d=f}for(const f of r)this._loadedParentTiles[f]=c}}_addTile(t){let r=this._tiles[t.key];if(r)return r.isExtraShadowCaster!==!0||this._shadowCasterTiles[t.key]||this._reloadTile(t.key,"reloading"),r;r=this._cache.getAndRemove(t),r&&(this._setTileReloadTimer(t.key,r),r.tileID=t,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,r)));const c=!!r;if(!c){const d=this.map?this.map.painter:null,f=this._source.tileSize*t.overscaleFactor();r=this._source.type==="raster-array"?new Ur(t,f,this.transform.tileZoom,d,this._isRaster):new Cn(t,f,this.transform.tileZoom,d,this._isRaster),this._loadTile(r,this._tileLoaded.bind(this,r,t.key,r.state))}return r?(r.uses++,this._tiles[t.key]=r,c||this._source.fire(new s.A("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null}_setTileReloadTimer(t,r){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const c=r.getExpiryTimeout();c&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},c))}_removeTile(t){const r=this._tiles[t];r&&(r.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),r.uses>0||(r.hasData()&&r.state!=="reloading"||r.state==="empty"?this._cache.add(r.tileID,r,r.getExpiryTimeout()):(r.aborted=!0,this._abortTile(r),this._unloadTile(r))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(+t);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(t,r,c){const d=[],f=this.transform;if(!f)return d;const _=f.projection.name==="globe",T=s.av(f.center.lng);for(const E in this._tiles){const M=this._tiles[E];if(c&&M.clearQueryDebugViz(),M.holdingForFade())continue;let A;if(_){const z=M.tileID.canonical;if(z.z===0){const C=[Math.abs(s.ay(T,...St(z,-1))-T),Math.abs(s.ay(T,...St(z,1))-T)];A=[0,2*C.indexOf(Math.min(...C))-1]}else{const C=[Math.abs(s.ay(T,...St(z,-1))-T),Math.abs(s.ay(T,...St(z,0))-T),Math.abs(s.ay(T,...St(z,1))-T)];A=[C.indexOf(Math.min(...C))-1]}}else A=[0];for(const z of A){const C=t.containsTile(M,f,r,z);C&&d.push(C)}}return d}getShadowCasterCoordinates(){return this._getRenderableCoordinates(!1,!0)}getVisibleCoordinates(t){return this._getRenderableCoordinates(t)}_getRenderableCoordinates(t,r){const c=this.getRenderableIds(t,r).map(f=>this._tiles[f].tileID),d=this.transform.projection.name==="globe";for(const f of c)f.projMatrix=this.transform.calculateProjMatrix(f.toUnwrapped()),f.expandedProjMatrix=d?this.transform.calculateProjMatrix(f.toUnwrapped(),!1,!0):f.projMatrix;return c}sortCoordinatesByDistance(t){const r=t.slice(),c=this.transform._camera.position,d=this.transform._camera.forward(),f={};for(const _ of r){const T=1/(1<<_.canonical.z);f[_.key]=((_.canonical.x+.5)*T+_.wrap-c[0])*d[0]+((_.canonical.y+.5)*T-c[1])*d[1]-c[2]*d[2]}return r.sort((_,T)=>f[_.key]-f[T.key]),r}hasTransition(){if(this._source.hasTransition())return!0;if(a3(this._source.type))for(const t in this._tiles){const r=this._tiles[t];if(r.fadeEndTime!==void 0&&r.fadeEndTime>=s.q.now())return!0}return!1}setFeatureState(t,r,c){this._state.updateState(t=t||"_geojsonTileLayer",r,c)}removeFeatureState(t,r,c){this._state.removeFeatureState(t=t||"_geojsonTileLayer",r,c)}getFeatureState(t,r){return this._state.getState(t=t||"_geojsonTileLayer",r)}setDependencies(t,r,c){const d=this._tiles[t];d&&d.setDependencies(r,c)}reloadTilesForDependencies(t,r){for(const c in this._tiles)this._tiles[c].hasDependency(t,r)&&this._reloadTile(+c,"reloading");this._cache.filter(c=>!c.hasDependency(t,r))}_preloadTiles(t,r){if(!this._sourceLoaded){const E=()=>{this._sourceLoaded&&(this._source.off("data",E),this._preloadTiles(t,r))};return void this._source.on("data",E)}const c=new Map,d=Array.isArray(t)?t:[t],f=this.map.painter.terrain,_=this.usedForTerrain&&f?f.getScaledDemTileSize():this._source.tileSize;for(const E of d){const M=E.coveringTiles({tileSize:_,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const A of M)c.set(A.key,A);this.usedForTerrain&&E.updateElevation(!1)}const T=Array.from(c.values());s.bl(T,(E,M)=>{const A=new Cn(E,this._source.tileSize*E.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(A,z=>{this._source.type==="raster-dem"&&A.dem&&this._backfillDEM(A),M(z,A)})},r)}}function bi(u,t){const r=Math.abs(2*u.wrap)-+(u.wrap<0),c=Math.abs(2*t.wrap)-+(t.wrap<0);return u.overscaledZ-t.overscaledZ||c-r||t.canonical.y-u.canonical.y||t.canonical.x-u.canonical.x}function a3(u){return u==="raster"||u==="image"||u==="video"||u==="custom"}function St(u,t){const r=1<0:c.type==="model"&&(d=!c.isHidden(t)&&c.paint.get("model-opacity").constantOr(1)>0),this.layersGotHidden=this.layersGotHidden||!d&&r.visible,r.visible=d}}updateZOffset(t,r){this.currentBuildingBuckets=[];for(const d of this.layers){const f=d.layer,_=this.style.getLayerSourceCache(f);let T=1;f.type==="fill-extrusion"&&(T=d.visible?f.paint.get("fill-extrusion-vertical-scale"):0);let E=_?_.getTile(r):null;if(!E&&_&&r.canonical.z>_.getSource().minzoom){let M=r.scaledTo(Math.min(_.getSource().maxzoom,r.overscaledZ-1));for(;M.overscaledZ>=_.getSource().minzoom&&(E=_.getTile(M),!E&&M.overscaledZ!==0);)M=M.scaledTo(M.overscaledZ-1)}this.currentBuildingBuckets.push({bucket:E?E.getBucket(f):null,tileID:E?E.tileID:r,verticalScale:T})}t.hasAnyZOffset=!1;let c=!1;for(let d=0;d{c in t&&(r[c]=t[c])}),r}function ja(u){u=u.slice();const t=Object.create(null);for(let r=0;r0?(d-_)/T:0;return this.points[f].mult(1-E).add(this.points[r].mult(E))}}class ui{constructor(t,r,c){const d=this.boxCells=[],f=this.circleCells=[];this.xCellCount=Math.ceil(t/c),this.yCellCount=Math.ceil(r/c);for(let _=0;_this.width||d<0||r>this.height)return!f&&[];const T=[];if(t<=0&&r<=0&&this.width<=c&&this.height<=d){if(f)return!0;for(let E=0;E0:T}_queryCircle(t,r,c,d,f){const _=t-c,T=t+c,E=r-c,M=r+c;if(T<0||_>this.width||M<0||E>this.height)return!d&&[];const A=[];return this._forEachCell(_,E,T,M,this._queryCellCircle,A,{hitTest:d,circle:{x:t,y:r,radius:c},seenUids:{box:{},circle:{}}},f),d?A.length>0:A}query(t,r,c,d,f){return this._query(t,r,c,d,!1,f)}hitTest(t,r,c,d,f){return this._query(t,r,c,d,!0,f)}hitTestCircle(t,r,c,d){return this._queryCircle(t,r,c,!0,d)}_queryCell(t,r,c,d,f,_,T,E){const M=T.seenUids,A=this.boxCells[f];if(A!==null){const C=this.bboxes;for(const k of A)if(!M.box[k]){M.box[k]=!0;const j=4*k;if(t<=C[j+2]&&r<=C[j+3]&&c>=C[j+0]&&d>=C[j+1]&&(!E||E(this.boxKeys[k]))){if(T.hitTest)return _.push(!0),!0;_.push({key:this.boxKeys[k],x1:C[j],y1:C[j+1],x2:C[j+2],y2:C[j+3]})}}}const z=this.circleCells[f];if(z!==null){const C=this.circles;for(const k of z)if(!M.circle[k]){M.circle[k]=!0;const j=3*k;if(this._circleAndRectCollide(C[j],C[j+1],C[j+2],t,r,c,d)&&(!E||E(this.circleKeys[k]))){if(T.hitTest)return _.push(!0),!0;{const N=C[j],G=C[j+1],$=C[j+2];_.push({key:this.circleKeys[k],x1:N-$,y1:G-$,x2:N+$,y2:G+$})}}}}}_queryCellCircle(t,r,c,d,f,_,T,E){const M=T.circle,A=T.seenUids,z=this.boxCells[f];if(z!==null){const k=this.bboxes;for(const j of z)if(!A.box[j]){A.box[j]=!0;const N=4*j;if(this._circleAndRectCollide(M.x,M.y,M.radius,k[N+0],k[N+1],k[N+2],k[N+3])&&(!E||E(this.boxKeys[j])))return _.push(!0),!0}}const C=this.circleCells[f];if(C!==null){const k=this.circles;for(const j of C)if(!A.circle[j]){A.circle[j]=!0;const N=3*j;if(this._circlesCollide(k[N],k[N+1],k[N+2],M.x,M.y,M.radius)&&(!E||E(this.circleKeys[j])))return _.push(!0),!0}}}_forEachCell(t,r,c,d,f,_,T,E){const M=this._convertToXCellCoord(t),A=this._convertToYCellCoord(r),z=this._convertToXCellCoord(c),C=this._convertToYCellCoord(d);for(let k=M;k<=z;k++)for(let j=A;j<=C;j++)if(f.call(this,t,r,c,d,this.xCellCount*j+k,_,T,E))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,r,c,d,f,_){const T=d-t,E=f-r,M=c+_;return M*M>T*T+E*E}_circleAndRectCollide(t,r,c,d,f,_,T){const E=(_-d)/2,M=Math.abs(t-(d+E));if(M>E+c)return!1;const A=(T-f)/2,z=Math.abs(r-(f+A));if(z>A+c)return!1;if(M<=E||z<=A)return!0;const C=M-E,k=z-A;return C*C+k*k<=c*c}}const io={unknown:0,flipRequired:1,flipNotRequired:2},Ga=Math.tan(85*Math.PI/180);function ro(u,t,r,c,d,f,_){const T=s.ad.mat4.create();if(r)if(f.name==="globe"){const E=s.bo(d,t);s.ad.mat4.multiply(T,T,E)}else{const E=s.ad.mat2.invert([],_);T[0]=E[0],T[1]=E[1],T[4]=E[2],T[5]=E[3],c||s.ad.mat4.rotateZ(T,T,d.angle)}else s.ad.mat4.multiply(T,d.labelPlaneMatrix,u);return T}function vr(u,t,r,c,d,f,_){const T=ro(u,t,r,c,d,f,_);return f.name==="globe"&&r||(T[2]=T[6]=T[10]=T[14]=0),T}function Xi(u,t,r,c,d,f,_){if(r){if(f.name==="globe"){const T=ro(u,t,r,c,d,f,_);return s.ad.mat4.invert(T,T),s.ad.mat4.multiply(T,u,T),T}{const T=s.ad.mat4.clone(u),E=s.ad.mat4.identity([]);return E[0]=_[0],E[1]=_[1],E[4]=_[2],E[5]=_[3],s.ad.mat4.multiply(T,T,E),c||s.ad.mat4.rotateZ(T,T,-d.angle),T}}return d.glCoordMatrix}function zn(u,t,r,c){const d=[u,t,r,1];r?s.ad.vec4.transformMat4(d,d,c):ir(d,d,c);const f=d[3];return d[0]/=f,d[1]/=f,d[2]/=f,d}function Us(u,t){return Math.min(.5+u/t*.5,1.5)}function l3(u,t){const r=u[0]/u[3],c=u[1]/u[3];return r>=-t[0]&&r<=t[0]&&c>=-t[1]&&c<=t[1]}function js(u,t,r,c,d,f,_,T,E,M){const A=r.transform,z=c?u.textSizeData:u.iconSizeData,C=s.bp(z,r.transform.zoom),k=A.projection.name==="globe",j=[256/r.width*2+1,256/r.height*2+1],N=c?u.text.dynamicLayoutVertexArray:u.icon.dynamicLayoutVertexArray;N.clear();let G=null;k&&(G=c?u.text.globeExtVertexArray:u.icon.globeExtVertexArray);const $=u.lineVertexArray,K=c?u.text.placedSymbolArray:u.icon.placedSymbolArray,ie=r.transform.width/r.transform.height;let te,ae=!1;for(let ne=0;neMath.abs(r)?{useVertical:!0}:u===s.bq.vertical?c>0?{needsFlipping:!0}:null:t!==io.unknown&&function(d,f){return d===0||Math.abs(f/d)>Ga}(r,c)?t===io.flipRequired?{needsFlipping:!0}:null:r<0?{needsFlipping:!0}:null}function Pr(u,t,r,c,d,f,_,T,E,M,A,z,C,k,j,N,G,$,K,ie){const te=t/24,ae=u.lineOffsetX*te,ne=u.lineOffsetY*te,{lineStartIndex:oe,glyphStartIndex:se,numGlyphs:he,segment:fe,writingMode:Ce,flipState:Se}=u,Ve=oe+u.lineLength,Ue=We=>{if(A){const[Be,ke,je]=We.up,ze=M.length;s.bs(A,ze+0,Be,ke,je),s.bs(A,ze+1,Be,ke,je),s.bs(A,ze+2,Be,ke,je),s.bs(A,ze+3,Be,ke,je)}const[Te,Ne,be]=We.point;s.bt(M,Te,Ne,be,We.angle)};if(he>1){const We=j0(te,T,ae,ne,r,z,C,u,E,f,k,N,!1,G,$,K,ie);if(!We)return{notEnoughRoom:!0};if(c&&!r){let[Te,Ne,be]=We.first.point,[Be,ke,je]=We.last.point;[Te,Ne]=zn(Te,Ne,be,_),[Be,ke]=zn(Be,ke,je,_);const ze=qa(Ce,Se,(Be-Te)*j,ke-Ne);if(u.flipState=ze&&ze.needsFlipping?io.flipRequired:io.flipNotRequired,ze)return ze}Ue(We.first);for(let Te=se+1;Te0?Be:Cr(C,be,Te,1,d,void 0,G,$.canonical),je=qa(Ce,Se,(ke[0]-Te[0])*j,ke[1]-Te[1]);if(u.flipState=je&&je.needsFlipping?io.flipRequired:io.flipNotRequired,je)return je}const We=$a(te*T.getoffsetX(se),ae,ne,r,z,C,fe,oe,Ve,E,f,k,N,!1,!1,G,$,K,ie);if(!We)return{notEnoughRoom:!0};Ue(We)}return{}}function qn(u,t,r,c,d){const{x:f,y:_,z:T}=c.projectTilePoint(u.x,u.y,t);if(!d)return zn(f,_,T,r);const[E,M,A]=d(u);return zn(f+E,_+M,T+A,r)}function Cr(u,t,r,c,d,f,_,T){const E=qn(u.sub(t)._unit()._add(u),T,d,_,f);return s.ad.vec3.sub(E,r,E),s.ad.vec3.normalize(E,E),s.ad.vec3.scaleAndAdd(E,r,E,c)}function $a(u,t,r,c,d,f,_,T,E,M,A,z,C,k,j,N,G,$,K){const ie=c?u-t:u+t;let te=ie>0?1:-1,ae=0;c&&(te*=-1,ae=Math.PI),te<0&&(ae+=Math.PI);let ne=T+_+(te>0?0:1)|0,oe=d,se=d,he=0,fe=0;const Ce=Math.abs(ie),Se=[],Ve=[];let Ue=f,We=Ue,Te=s.ad.vec3.zero([]);const Ne=()=>Cr(We,Ue,se,Ce-he+1,A,C,N,G.canonical);for(;he+fe<=Ce;){if(ne+=te,ne=E)return null;if(se=oe,We=Ue,Se.push(se),k&&Ve.push(We),Ue=new s.P(M.getx(ne),M.gety(ne)),oe=z[ne],!oe){const ft=qn(Ue,G.canonical,A,N,C);oe=ft[3]>0?z[ne]=ft:Ne()}he+=fe;const tt=s.ad.vec3.sub([],oe,se),it=s.ad.vec3.distance(se,oe);if(r&&it>0&&fe>0&&s.ad.vec3.dot(Te,tt)/(fe*it)0,j),G=_*N.perspectiveRatio,$=(c.x1*r+d.x-c.padding)*G+N.point.x,K=(c.y1*r+d.y-c.padding)*G+N.point.y,ie=(c.x2*r+d.x+c.padding)*G+N.point.x,te=(c.y2*r+d.y+c.padding)*G+N.point.y,ae=N.perspectiveRatio<=.55||N.occluded;return!this.isInsideGrid($,K,ie,te)||!f&&this.grid.hitTest($,K,ie,te,E)||ae?{box:[],offscreen:!1,occluded:N.occluded}:{box:[$,K,ie,te],offscreen:this.isOffscreen($,K,ie,te),occluded:!1}}placeCollisionCircles(t,r,c,d,f,_,T,E,M,A,z,C,k,j,N){const G=[],$=this.transform.elevation,K=t.getProjection(),ie=$?$.getAtTileOffsetFunc(N,this.transform.center.lat,this.transform.worldSize,K):null,te=new s.P(c.tileAnchorX,c.tileAnchorY);let{x:ae,y:ne,z:oe}=K.projectTilePoint(te.x,te.y,N.canonical);if(ie){const[je,ze,qe]=ie(te);ae+=je,ne+=ze,oe+=qe}const se=K.name==="globe",he=this.projectAndGetPerspectiveRatio(T,ae,ne,oe,N,se||!!$||this.transform.pitch>0,K),{perspectiveRatio:fe}=he,Ce=(z?_/fe:_*fe)/s.bw,Se=zn(ae,ne,oe,E),Ve=c.lineOffsetX*Ce,Ue=c.lineOffsetY*Ce,We=s.ak(t.layers[0].layout.get("text-max-angle")),Te=Math.cos(We),Ne=he.signedDistanceFromCamera>0?j0(Ce,f,Ve,Ue,!1,Se,te,c,d,E,{},$&&!z?ie:null,z&&!!$,K,N,z,Te):null;let be=!1,Be=!1,ke=!0;if(Ne&&!he.occluded){const je=.5*k*fe+j,ze=new s.P(-100,-100),qe=new s.P(this.screenRightBoundary,this.screenBottomBoundary),et=new Vs,{first:tt,last:it}=Ne,ft=tt.path.length;let Rt=[];for(let Et=ft-1;Et>=1;Et--)Rt.push(tt.path[Et]);for(let Et=1;Et(ie&&!se&&(pi=ie(PiEt[3]<=0)&&(Rt=[]));let Pt=[];if(Rt.length>0){let Et=1/0,Qt=-1/0,pi=1/0,Pi=-1/0;for(const Ht of Rt)Et=Math.min(Et,Ht[0]),pi=Math.min(pi,Ht[1]),Qt=Math.max(Qt,Ht[0]),Pi=Math.max(Pi,Ht[1]);Qt>=ze.x&&Et<=qe.x&&Pi>=ze.y&&pi<=qe.y&&(Pt=[Rt.map(Ht=>new s.P(Ht[0],Ht[1]))],(Etqe.x||piqe.y)&&(Pt=s.bu(Pt,ze.x,ze.y,qe.x,qe.y)))}for(const Et of Pt){et.reset(Et,.25*je);let Qt=0;Qt=et.length<=.5*je?1:Math.ceil(et.paddedLength/Tt)+1;for(let pi=0;pi0?(s.ad.vec4.transformMat4(E,E,t),this.fogState&&f&&T.name!=="globe"&&(M=function(C,k,j,N,G,$){const K=$.calculateFogTileMatrix(G),ie=[k,j,N];return s.ad.vec3.transformMat4(ie,ie,K),ht(C,s.ad.vec3.length(ie),$.pitch,$._fov)}(this.fogState,r,c,d,f.toUnwrapped(),this.transform)>.9)):ir(E,E,t);const A=E[3];return{point:new s.P((E[0]/A+1)/2*this.transform.width+pr,(-E[1]/A+1)/2*this.transform.height+pr),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(T)/A*.5,1.5),signedDistanceFromCamera:A,occluded:_&&E[2]>A||M}}isOffscreen(t,r,c,d){return c=this.screenRightBoundary||dthis.screenBottomBoundary}isInsideGrid(t,r,c,d){return c>=0&&t=0&&rc.collisionGroupID===r}}return this.collisionGroups[t]}}function G0(u,t,r,c,d){const{horizontalAlign:f,verticalAlign:_}=s.bD(u),T=-(f-.5)*t,E=-(_-.5)*r,M=s.bC(u,c);return new s.P(T+M[0]*d,E+M[1]*d)}function kr(u,t,r,c,d){const f=new s.P(u,t);return r&&f._rotate(c?d:-d),f}class Th{constructor(t,r,c,d,f,_){this.transform=t.clone(),this.projection=t.projection.name,this.collisionIndex=new no(this.transform,f),this.buildingIndex=_,this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=r,this.retainedQueryData={},this.collisionGroups=new wh(c),this.collisionCircleArrays={},this.prevPlacement=d,d&&(d.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,r,c,d,f=1){const _=c.getBucket(r),T=c.latestFeatureIndex;if(!_||!T||r.fqid!==_.layerIds[0])return;const E=_.layers[0].layout,M=_.layers[0].paint,A=c.collisionBoxArray,z=Math.pow(2,this.transform.zoom-c.tileID.overscaledZ),C=c.tileSize/s.ai,k=c.tileID.toUnwrapped();this.transform.setProjection(_.projection);const j=(N=c.tileID,G=_.getProjection(),$=this.transform,G.name===this.projection?$.calculateProjMatrix(N.toUnwrapped()):Ki($,G,N));var N,G,$;const K=E.get("text-pitch-alignment")==="map",ie=E.get("text-rotation-alignment")==="map";r.compileFilter(r.options);const te=r.dynamicFilter(),ae=r.dynamicFilterNeedsFeature(),ne=this.transform.calculatePixelsToTileUnitsMatrix(c),oe=vr(j,c.tileID.canonical,K,ie,this.transform,_.getProjection(),ne);let se=null;if(K){const Ne=Xi(j,c.tileID.canonical,K,ie,this.transform,_.getProjection(),ne);se=s.ad.mat4.multiply([],this.transform.labelPlaneMatrix,Ne)}let he=null;te&&c.latestFeatureIndex&&(he={unwrappedTileID:k,dynamicFilter:te,dynamicFilterNeedsFeature:ae}),this.retainedQueryData[_.bucketInstanceId]=new so(_.bucketInstanceId,T,_.sourceLayerIndex,_.index,c.tileID);const[fe,Ce]=_.layers[0].layout.get("text-size-scale-range"),Se=s.ay(f,fe,Ce),[Ve,Ue]=E.get("icon-size-scale-range"),We=s.ay(f,Ve,Ue),Te={bucket:_,layout:E,paint:M,posMatrix:j,textLabelPlaneMatrix:oe,labelToScreenMatrix:se,clippingData:he,scale:z,textPixelRatio:C,holdingForFade:c.holdingForFade(),collisionBoxArray:A,partiallyEvaluatedTextSize:s.bp(_.textSizeData,this.transform.zoom,Se),partiallyEvaluatedIconSize:s.bp(_.iconSizeData,this.transform.zoom,We),collisionGroup:this.collisionGroups.get(_.sourceID),latestFeatureIndex:c.latestFeatureIndex};if(d)for(const Ne of _.sortKeyRanges){const{sortKey:be,symbolInstanceStart:Be,symbolInstanceEnd:ke}=Ne;t.push({sortKey:be,symbolInstanceStart:Be,symbolInstanceEnd:ke,parameters:Te})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:_.symbolInstances.length,parameters:Te})}attemptAnchorPlacement(t,r,c,d,f,_,T,E,M,A,z,C,k,j,N,G,$,K){const{textOffset0:ie,textOffset1:te,crossTileID:ae}=C,ne=[ie,te],oe=G0(t,c,d,ne,f),se=this.collisionIndex.placeCollisionBox(j,f,r,kr(oe.x,oe.y,_,T,this.transform.angle),z,E,M,A.predicate);if(G){const he=j.getSymbolInstanceIconSize(K,this.transform.zoom,C.placedIconSymbolIndex);if(this.collisionIndex.placeCollisionBox(j,he,G,kr(oe.x,oe.y,_,T,this.transform.angle),z,E,M,A.predicate).box.length===0)return}if(se.box.length>0){let he;return this.prevPlacement&&this.prevPlacement.variableOffsets[ae]&&this.prevPlacement.placements[ae]&&this.prevPlacement.placements[ae].text&&(he=this.prevPlacement.variableOffsets[ae].anchor),this.variableOffsets[ae]={textOffset:ne,width:c,height:d,anchor:t,textScale:f,prevAnchor:he},this.markUsedJustification(j,t,C,N),j.allowVerticalPlacement&&(this.markUsedOrientation(j,N,C),this.placedOrientations[ae]=N),{shift:oe,placedGlyphBoxes:se}}}placeLayerBucketPart(t,r,c,d,f=1){const{bucket:_,layout:T,paint:E,posMatrix:M,textLabelPlaneMatrix:A,labelToScreenMatrix:z,clippingData:C,textPixelRatio:k,holdingForFade:j,collisionBoxArray:N,partiallyEvaluatedTextSize:G,partiallyEvaluatedIconSize:$,collisionGroup:K,latestFeatureIndex:ie}=t.parameters,te=T.get("text-optional"),ae=T.get("icon-optional"),ne=T.get("text-allow-overlap"),oe=T.get("icon-allow-overlap"),se=T.get("text-rotation-alignment")==="map",he=T.get("text-pitch-alignment")==="map",fe=E.get("symbol-z-offset"),Ce=T.get("symbol-elevation-reference")==="sea",[Se,Ve]=T.get("text-size-scale-range"),[Ue,We]=T.get("icon-size-scale-range"),Te=s.ay(f,Se,Ve),Ne=s.ay(f,Ue,We);this.transform.setProjection(_.projection);let be=ne&&(oe||!_.hasIconData()||ae),Be=oe&&(ne||!_.hasTextData()||te);const ke=!fe.isConstant();!_.collisionArrays&&N&&_.deserializeCollisionBoxes(N),c&&d&&_.updateCollisionDebugBuffers(this.transform.zoom,N,Te,Ne);const je=(ze,qe,et)=>{const{crossTileID:tt,numVerticalGlyphVertices:it}=ze;let ft=null;if(C&&C.dynamicFilterNeedsFeature||ke){const si=this.retainedQueryData[_.bucketInstanceId];ft=ie.loadFeature({featureIndex:ze.featureIndex,bucketIndex:si.bucketIndex,sourceLayerIndex:si.sourceLayerIndex,layoutVertexArrayOffset:0})}if(C&&!(0,C.dynamicFilter)({zoom:this.transform.zoom,pitch:this.transform.pitch},ft,this.retainedQueryData[_.bucketInstanceId].tileID.canonical,new s.P(ze.tileAnchorX,ze.tileAnchorY),this.transform.calculateDistanceTileData(C.unwrappedTileID)))return this.placements[tt]=new oo(!1,!1,!1,!0),void r.add(tt);const Rt=fe.evaluate(ft,{});if(r.has(tt))return;if(j)return void(this.placements[tt]=new oo(!1,!1,!1));let Tt=!1,Pt=!1,Et=!0,Qt=!1,pi=!1,Pi=null,Ht={box:null,offscreen:null,occluded:null},Fi={box:null,offscreen:null,occluded:null},Ot=null,mt=null,ti=null,wi=0,li=0,$i=0;et.textFeatureIndex?wi=et.textFeatureIndex:ze.useRuntimeCollisionCircles&&(wi=ze.featureIndex),et.verticalTextFeatureIndex&&(li=et.verticalTextFeatureIndex);const Qi=si=>{si.tileID=this.retainedQueryData[_.bucketInstanceId].tileID;const Bi=this.transform.elevation;si.elevation=Ce?Rt:Rt+(Bi?Bi.getAtTileOffset(si.tileID,si.tileAnchorX,si.tileAnchorY):0),si.elevation+=ze.zOffset},or=et.textBox;if(or){Qi(or);const si=fi=>{let Ei=s.bq.horizontal;if(_.allowVerticalPlacement&&!fi&&this.prevPlacement){const yr=this.prevPlacement.placedOrientations[tt];yr&&(this.placedOrientations[tt]=yr,Ei=yr,this.markUsedOrientation(_,Ei,ze))}return Ei},Bi=(fi,Ei)=>{if(_.allowVerticalPlacement&&it>0&&et.verticalTextBox){for(const yr of _.writingModes)if(yr===s.bq.vertical?(Ht=Ei(),Fi=Ht):Ht=fi(),Ht&&Ht.box&&Ht.box.length)break}else Ht=fi()};if(T.get("text-variable-anchor")){let fi=T.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[tt]){const Di=this.prevPlacement.variableOffsets[tt];fi.indexOf(Di.anchor)>0&&(fi=fi.filter(sr=>sr!==Di.anchor),fi.unshift(Di.anchor))}const Ei=(Di,sr,Xn)=>{const Kr=_.getSymbolInstanceTextSize(G,ze,this.transform.zoom,qe),Sn=(Di.x2-Di.x1)*Kr+2*Di.padding,Gr=(Di.y2-Di.y1)*Kr+2*Di.padding,En=ze.hasIconTextFit&&!oe?sr:null;En&&Qi(En);let Jr={box:[],offscreen:!1,occluded:!1};const go=ne?2*fi.length:fi.length;for(let Yn=0;Yn=fi.length,ze,qe,_,Xn,En,G,$);if(yo&&(Jr=yo.placedGlyphBoxes,Jr&&Jr.box&&Jr.box.length)){Tt=!0,Pi=yo.shift;break}}return Jr};Bi(()=>Ei(or,et.iconBox,s.bq.horizontal),()=>{const Di=et.verticalTextBox;return Di&&Qi(Di),_.allowVerticalPlacement&&!(Ht&&Ht.box&&Ht.box.length)&&it>0&&Di?Ei(Di,et.verticalIconBox,s.bq.vertical):{box:null,offscreen:null,occluded:null}}),Ht&&(Tt=Ht.box,Et=Ht.offscreen,Qt=Ht.occluded);const yr=si(!(!Ht||!Ht.box));if(!Tt&&this.prevPlacement){const Di=this.prevPlacement.variableOffsets[tt];Di&&(this.variableOffsets[tt]=Di,this.markUsedJustification(_,Di.anchor,ze,yr))}}else{const fi=(Ei,yr)=>{const Di=_.getSymbolInstanceTextSize(G,ze,this.transform.zoom,qe,f),sr=this.collisionIndex.placeCollisionBox(_,Di,Ei,new s.P(0,0),ne,k,M,K.predicate);return sr&&sr.box&&sr.box.length&&(this.markUsedOrientation(_,yr,ze),this.placedOrientations[tt]=yr),sr};Bi(()=>fi(or,s.bq.horizontal),()=>{const Ei=et.verticalTextBox;return _.allowVerticalPlacement&&it>0&&Ei?(Qi(Ei),fi(Ei,s.bq.vertical)):{box:null,offscreen:null,occluded:null}}),si(!!(Ht&&Ht.box&&Ht.box.length))}}if(Ot=Ht,Tt=Ot&&Ot.box&&Ot.box.length>0,Et=Ot&&Ot.offscreen,Qt=Ot&&Ot.occluded,ze.useRuntimeCollisionCircles){const si=_.text.placedSymbolArray.get(ze.centerJustifiedTextSymbolIndex>=0?ze.centerJustifiedTextSymbolIndex:ze.verticalPlacedTextSymbolIndex),Bi=s.br(_.textSizeData,G,si),fi=T.get("text-padding");mt=this.collisionIndex.placeCollisionCircles(_,ne,si,_.lineVertexArray,_.glyphOffsetArray,Bi,M,A,z,c,he,K.predicate,ze.collisionCircleDiameter*Bi/s.bw,fi,this.retainedQueryData[_.bucketInstanceId].tileID),Tt=ne||mt.circles.length>0&&!mt.collisionDetected,Et=Et&&mt.offscreen,Qt=mt.occluded}if(et.iconFeatureIndex&&($i=et.iconFeatureIndex),et.iconBox){const si=Bi=>{Qi(Bi);const fi=ze.hasIconTextFit&&Pi?kr(Pi.x,Pi.y,se,he,this.transform.angle):new s.P(0,0),Ei=_.getSymbolInstanceIconSize($,this.transform.zoom,ze.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(_,Ei,Bi,fi,oe,k,M,K.predicate)};Fi&&Fi.box&&Fi.box.length&&et.verticalIconBox?(ti=si(et.verticalIconBox),Pt=ti.box.length>0):(ti=si(et.iconBox),Pt=ti.box.length>0),Et=Et&&ti.offscreen,pi=ti.occluded}const ar=te||ze.numHorizontalGlyphVertices===0&&it===0,cn=ae||ze.numIconVertices===0;if(ar||cn?cn?ar||(Pt=Pt&&Tt):Tt=Pt&&Tt:Pt=Tt=Pt&&Tt,Tt&&Ot&&Ot.box&&this.collisionIndex.insertCollisionBox(Ot.box,T.get("text-ignore-placement"),_.bucketInstanceId,Fi&&Fi.box&&li?li:wi,K.ID),Pt&&ti&&this.collisionIndex.insertCollisionBox(ti.box,T.get("icon-ignore-placement"),_.bucketInstanceId,$i,K.ID),mt&&(Tt&&this.collisionIndex.insertCollisionCircles(mt.circles,T.get("text-ignore-placement"),_.bucketInstanceId,wi,K.ID),c)){const si=_.bucketInstanceId;let Bi=this.collisionCircleArrays[si];Bi===void 0&&(Bi=this.collisionCircleArrays[si]=new bh);for(let fi=0;fi=0;--qe){const et=ze[qe];je(_.symbolInstances.get(et),et,_.collisionArrays[et])}_.hasAnyZOffset&&s.w(`${_.layerIds[0]} layer symbol-z-elevate: symbols are not sorted by elevation if symbol-z-order is evaluated to viewport-y`)}else if(_.hasAnyZOffset){const ze=_.getSortedIndexesByZOffset();for(let qe=0;qe=0&&(t.text.placedSymbolArray.get(f).crossTileID=z>=0&&f!==z?0:M),_>=0&&(t.text.placedSymbolArray.get(_).crossTileID=z>=0&&_!==z?0:M),T>=0&&(t.text.placedSymbolArray.get(T).crossTileID=z>=0&&T!==z?0:M),E>=0&&(t.text.placedSymbolArray.get(E).crossTileID=z>=0&&E!==z?0:M)}markUsedOrientation(t,r,c){const d=r===s.bq.horizontal||r===s.bq.horizontalOnly?r:0,f=r===s.bq.vertical?r:0,{leftJustifiedTextSymbolIndex:_,centerJustifiedTextSymbolIndex:T,rightJustifiedTextSymbolIndex:E,verticalPlacedTextSymbolIndex:M}=c,A=t.text.placedSymbolArray;_>=0&&(A.get(_).placedOrientation=d),T>=0&&(A.get(T).placedOrientation=d),E>=0&&(A.get(E).placedOrientation=d),M>=0&&(A.get(M).placedOrientation=f)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const r=this.prevPlacement;let c=!1;this.prevZoomAdjustment=r?r.zoomAdjustment(this.transform.zoom):0;const d=r?r.symbolFadeChange(t):1,f=r?r.opacities:{},_=r?r.variableOffsets:{},T=r?r.placedOrientations:{};for(const E in this.placements){const M=this.placements[E],A=f[E];A?(this.opacities[E]=new Fo(A,d,M.text,M.icon,null,M.clipped),c=c||M.text!==A.text.placed||M.icon!==A.icon.placed):(this.opacities[E]=new Fo(null,d,M.text,M.icon,M.skipFade,M.clipped),c=c||M.text||M.icon)}for(const E in f){const M=f[E];if(!this.opacities[E]){const A=new Fo(M,d,!1,!1);A.isHidden()||(this.opacities[E]=A,c=c||M.text.placed||M.icon.placed)}}for(const E in _)this.variableOffsets[E]||!this.opacities[E]||this.opacities[E].isHidden()||(this.variableOffsets[E]=_[E]);for(const E in T)this.placedOrientations[E]||!this.opacities[E]||this.opacities[E].isHidden()||(this.placedOrientations[E]=T[E]);c?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=r?r.lastPlacementChangeTime:t)}updateLayerOpacities(t,r,c,d){const f=new Set;for(const _ of r){const T=_.getBucket(t);T&&_.latestFeatureIndex&&t.fqid===T.layerIds[0]&&(this.updateBucketOpacities(T,f,_,_.collisionBoxArray,c,d,_.tileID,t.scope),T.elevationType==="offset"&&this.buildingIndex&&this.buildingIndex.updateZOffset(T,_.tileID),T.elevationType==="road"&&T.updateRoadElevation(),T.updateZOffset())}}updateBucketOpacities(t,r,c,d,f,_,T,E){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const M=t.layers[0].layout,A=t.layers[0].paint,z=!!t.layers[0].dynamicFilter(),C=new Fo(null,0,!1,!1,!0),k=M.get("text-allow-overlap"),j=M.get("icon-allow-overlap"),N=M.get("text-variable-anchor"),G=M.get("text-rotation-alignment")==="map",$=M.get("text-pitch-alignment")==="map",K=A.get("symbol-z-offset"),ie=M.get("symbol-elevation-reference")==="sea",te=!K.isConstant(),ae=new Fo(null,0,k&&(j||!t.hasIconData()||M.get("icon-optional")),j&&(k||!t.hasTextData()||M.get("text-optional")),!0);!t.collisionArrays&&d&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(d);const ne=(se,he,fe)=>{for(let Ce=0;Ce0||Ce>0,ze=Ve>0,qe=this.placedOrientations[Se],et=qe===s.bq.vertical,tt=qe===s.bq.horizontal||qe===s.bq.horizontalOnly;!je&&!ze||ke.isHidden()||oe++;let it=!1;if((je||ze)&&_)for(const ft of t.activeReplacements){if(s.bx(ft,f,s.by.Symbol,E)||ft.min.x>Ue||Ue>ft.max.x||ft.min.y>We||We>ft.max.y)continue;const Rt=s.bz(Ue,We,T.canonical,ft.footprintTileId.canonical);if(it=s.bA(Rt,ft.footprint),it)break}if(je){const ft=it?us:cs(ke.text);ne(t.text,fe,et?us:ft),ne(t.text,Ce,tt?us:ft);const Rt=ke.text.isHidden(),{leftJustifiedTextSymbolIndex:Tt,centerJustifiedTextSymbolIndex:Pt,rightJustifiedTextSymbolIndex:Et,verticalPlacedTextSymbolIndex:Qt}=he,pi=t.text.placedSymbolArray,Pi=Rt||et?1:0;Tt>=0&&(pi.get(Tt).hidden=Pi),Pt>=0&&(pi.get(Pt).hidden=Pi),Et>=0&&(pi.get(Et).hidden=Pi),Qt>=0&&(pi.get(Qt).hidden=Rt||tt?1:0);const Ht=this.variableOffsets[Se];Ht&&this.markUsedJustification(t,Ht.anchor,he,qe);const Fi=this.placedOrientations[Se];Fi&&(this.markUsedJustification(t,"left",he,Fi),this.markUsedOrientation(t,Fi,he))}if(ze){const ft=it?us:cs(ke.icon),{placedIconSymbolIndex:Rt,verticalPlacedIconSymbolIndex:Tt}=he,Pt=t.icon.placedSymbolArray,Et=ke.icon.isHidden()?1:0;Rt>=0&&(ne(t.icon,Ve,et?us:ft),Pt.get(Rt).hidden=Et),Tt>=0&&(ne(t.icon,he.numVerticalIconVertices,tt?us:ft),Pt.get(Tt).hidden=Et)}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const ft=t.collisionArrays[se];if(ft){let Rt=new s.P(0,0),Tt=!0;if(ft.textBox||ft.verticalTextBox){if(N){const Et=this.variableOffsets[Se];Et?(Rt=G0(Et.anchor,Et.width,Et.height,Et.textOffset,Et.textScale),G&&Rt._rotate($?this.transform.angle:-this.transform.angle)):Tt=!1}z&&(Tt=!ke.clipped),ft.textBox&&ls(t.textCollisionBox.collisionVertexArray,ke.text.placed,!Tt||et,be,ie,Rt.x,Rt.y),ft.verticalTextBox&&ls(t.textCollisionBox.collisionVertexArray,ke.text.placed,!Tt||tt,be,ie,Rt.x,Rt.y)}const Pt=Tt&&!!(!tt&&ft.verticalIconBox);ft.iconBox&&ls(t.iconCollisionBox.collisionVertexArray,ke.icon.placed,Pt,be,ie,he.hasIconTextFit?Rt.x:0,he.hasIconTextFit?Rt.y:0),ft.verticalIconBox&&ls(t.iconCollisionBox.collisionVertexArray,ke.icon.placed,!Pt,be,ie,he.hasIconTextFit?Rt.x:0,he.hasIconTextFit?Rt.y:0)}}}if(t.fullyClipped=oe===0,t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.bucketInstanceId in this.collisionCircleArrays){const se=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=se.invProjMatrix,t.placementViewportMatrix=se.viewportMatrix,t.collisionCircleArray=se.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTimet}setStale(){this.stale=!0}}function ls(u,t,r,c,d,f,_){u.emplaceBack(t?1:0,r?1:0,f||0,_||0,c,d?1:0),u.emplaceBack(t?1:0,r?1:0,f||0,_||0,c,d?1:0),u.emplaceBack(t?1:0,r?1:0,f||0,_||0,c,d?1:0),u.emplaceBack(t?1:0,r?1:0,f||0,_||0,c,d?1:0)}const _c=Math.pow(2,25),Ha=Math.pow(2,24),Sh=Math.pow(2,17),Eh=Math.pow(2,16),Za=Math.pow(2,9),Wa=Math.pow(2,8),Mh=Math.pow(2,1);function cs(u){if(u.opacity===0&&!u.placed)return 0;if(u.opacity===1&&u.placed)return 4294967295;const t=u.placed?1:0,r=Math.floor(127*u.opacity);return r*_c+t*Ha+r*Sh+t*Eh+r*Za+t*Wa+r*Mh+t}const us=0;class q0{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&t.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(t,r,c,d,f,_){const T=this._bucketParts;for(;this._currentTileIndexE.sortKey-M.sortKey));this._currentPartIndex{const E=s.q.now()-_;return!this._forceFullPlacement&&E>2};for(;this._currentPlacementIndex>=0;){const E=r[t[this._currentPlacementIndex]],M=this.placement.collisionIndex.transform.zoom;if(E.type==="symbol"&&(!E.minzoom||E.minzoom<=M)&&(!E.maxzoom||E.maxzoom>M)){const A=E,z=A.layout.get("symbol-z-elevate"),C=A.layout.get("symbol-sort-key").constantOr(1)!==void 0,k=A.layout.get("symbol-z-order"),j=k==="viewport-y"||k==="auto"&&!(k!=="viewport-y"&&C),N=A.layout.get("text-allow-overlap")||A.layout.get("icon-allow-overlap")||A.layout.get("text-ignore-placement")||A.layout.get("icon-ignore-placement"),G=j&&N,$=this._inProgressLayer=this._inProgressLayer||new q0(A),K=s.C(E.source,E.scope);if($.continuePlacement(z||G?d[K]:c[K],this.placement,this._showCollisionBoxes,E,T,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const u3=512/s.ai/2;class Ah{constructor(t,r,c){this.tileID=t,this.bucketInstanceId=c,this.index=new s.bE(r.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const d=t.canonical.x*s.ai,f=t.canonical.y*s.ai;for(let _=0;_t.overscaledZ)for(const T in _){const E=_[T];E.tileID.isChildOf(t)&&E.findMatches(r.symbolInstances,t,d)}else{const T=_[t.scaledTo(Number(f)).key];T&&T.findMatches(r.symbolInstances,t,d)}}for(let f=0;f{r[c]=!0});for(const c in this.layerIndexes)r[c]||delete this.layerIndexes[c]}}const No=771;class Zt{constructor(t,r,c,d){this.blendFunction=t,this.blendColor=r,this.mask=c,this.blendEquation=d}}Zt.Replace=[1,0,1,0],Zt.disabled=new Zt(Zt.Replace,s.al.transparent,[!1,!1,!1,!1]),Zt.unblended=new Zt(Zt.Replace,s.al.transparent,[!0,!0,!0,!0]),Zt.alphaBlended=new Zt([1,No,1,No],s.al.transparent,[!0,!0,!0,!0]),Zt.alphaBlendedNonPremultiplied=new Zt([770,No,770,No],s.al.transparent,[!0,!0,!0,!0]),Zt.multiply=new Zt([774,0,774,0],s.al.transparent,[!0,!0,!0,!0]);class xt{constructor(t,r,c){this.func=t,this.mask=r,this.range=c}}xt.ReadOnly=!1,xt.ReadWrite=!0,xt.disabled=new xt(519,xt.ReadOnly,[0,1]);const $0=7680;class Lt{constructor(t,r,c,d,f,_){this.test=t,this.ref=r,this.mask=c,this.fail=d,this.depthFail=f,this.pass=_}}Lt.disabled=new Lt({func:519,mask:0},0,0,$0,$0,$0);const ao=1029,qs=2305;class zt{constructor(t,r,c){this.enable=t,this.mode=r,this.frontFace=c}}function h3(u,t){const r=s.bG(u,3);s.ad.mat4.fromQuat(u,t),s.bI(u,3,r)}function hs(u,t){const r=s.ad.quat.identity([]);return s.ad.quat.rotateZ(r,r,-t),s.ad.quat.rotateX(r,r,-u),r}function $s(u,t){const r=[u[0],u[1],0],c=[t[0],t[1],0];if(s.ad.vec3.length(r)>=1e-15){const _=s.ad.vec3.normalize([],r);s.ad.vec3.scale(c,_,s.ad.vec3.dot(c,_)),t[0]=c[0],t[1]=c[1]}const d=s.ad.vec3.cross([],t,u);if(s.ad.vec3.len(d)<1e-15)return null;const f=Math.atan2(-d[1],d[0]);return hs(Math.atan2(Math.sqrt(u[0]*u[0]+u[1]*u[1]),-u[2]),f)}zt.disabled=new zt(!1,ao,qs),zt.backCCW=new zt(!0,ao,qs),zt.backCW=new zt(!0,ao,2304),zt.frontCW=new zt(!0,1028,2304),zt.frontCCW=new zt(!0,1028,qs);class d3{constructor(t,r){this.position=t,this.orientation=r}get position(){return this._position}set position(t){if(t){const r=t instanceof s.ac?t:new s.ac(t[0],t[1],t[2]);this._renderWorldCopies&&(r.x=s.bF(r.x,0,1)),this._position=r}else this._position=null}lookAtPoint(t,r){if(this.orientation=null,!this.position)return;const c=this.position,d=this._elevation?this._elevation.getAtPointOrZero(s.ac.fromLngLat(t)):0,f=s.ac.fromLngLat(t,d),_=[f.x-c.x,f.y-c.y,f.z-c.z];r||(r=[0,0,1]),r[2]=Math.abs(r[2]),this.orientation=$s(_,r)}setPitchBearing(t,r){this.orientation=hs(s.ak(t),s.ak(-r))}}class Hs{constructor(t,r){this._transform=s.ad.mat4.identity([]),this.orientation=r,this.position=t}get mercatorPosition(){const t=this.position;return new s.ac(t[0],t[1],t[2])}get position(){const t=s.bG(this._transform,3);return[t[0],t[1],t[2]]}set position(t){var r;t&&s.bI(this._transform,3,[(r=t)[0],r[1],r[2],1])}get orientation(){return this._orientation}set orientation(t){this._orientation=t||s.ad.quat.identity([]),t&&h3(this._transform,this._orientation)}getPitchBearing(){const t=this.forward(),r=this.right();return{bearing:Math.atan2(-r[1],r[0]),pitch:Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2])}}setPitchBearing(t,r){this._orientation=hs(t,r),h3(this._transform,this._orientation)}forward(){const t=s.bG(this._transform,2);return[-t[0],-t[1],-t[2]]}up(){const t=s.bG(this._transform,1);return[-t[0],-t[1],-t[2]]}right(){const t=s.bG(this._transform,0);return[t[0],t[1],t[2]]}getCameraToWorld(t,r){const c=new Float64Array(16);return s.ad.mat4.invert(c,this.getWorldToCamera(t,r)),c}getCameraToWorldMercator(){return this._transform}getWorldToCameraPosition(t,r,c){const d=this.position;s.ad.vec3.scale(d,d,-t);const f=new Float64Array(16);return s.ad.mat4.fromScaling(f,[c,c,c]),s.ad.mat4.translate(f,f,d),f[10]*=r,f}getWorldToCamera(t,r){const c=new Float64Array(16),d=new Float64Array(4),f=this.position;return s.ad.quat.conjugate(d,this._orientation),s.ad.vec3.scale(f,f,-t),s.ad.mat4.fromQuat(c,d),s.ad.mat4.translate(c,c,f),c[1]*=-1,c[5]*=-1,c[9]*=-1,c[13]*=-1,c[8]*=r,c[9]*=r,c[10]*=r,c[11]*=r,c}getCameraToClipPerspective(t,r,c,d){const f=new Float64Array(16);return s.ad.mat4.perspective(f,t,r,c,d),f}getCameraToClipOrthographic(t,r,c,d,f,_){const T=new Float64Array(16);return s.ad.mat4.ortho(T,t,r,c,d,f,_),T}getDistanceToElevation(t,r=!1){const c=t===0?0:s.bH(t,r?s.aT(this.position[1]):this.position[1]),d=this.forward();return(c-this.position[2])/d[2]}clone(){return new Hs([...this.position],[...this.orientation])}}const Zi={BaseColor:5,MetallicRoughness:6,Normal:7,Occlusion:8,Emission:9,LUT:10,ShadowMap0:11};class Xa{constructor(t=0,r=0,c=0,d=0){if(isNaN(t)||t<0||isNaN(r)||r<0||isNaN(c)||c<0||isNaN(d)||d<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=r,this.left=c,this.right=d}interpolate(t,r,c){return r.top!=null&&t.top!=null&&(this.top=s.ah(t.top,r.top,c)),r.bottom!=null&&t.bottom!=null&&(this.bottom=s.ah(t.bottom,r.bottom,c)),r.left!=null&&t.left!=null&&(this.left=s.ah(t.left,r.left,c)),r.right!=null&&t.right!=null&&(this.right=s.ah(t.right,r.right,c)),this}getCenter(t,r){const c=s.ay((this.left+t-this.right)/2,0,t),d=s.ay((this.top+r-this.bottom)/2,0,r);return new s.P(c,d)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Xa(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Je=15;class H0{constructor(t,r,c,d,f,_,T){this.tileSize=512,this._renderWorldCopies=f===void 0||f,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=c??0,this._maxPitch=d??60,this.setProjection(_),this.setMaxBounds(T),this.width=0,this.height=0,this._center=new s.bO(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Xa,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._expandedProjMatrixCache={},this._distanceTileDataCache={},this._camera=new Hs,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._tileCoverLift=0,this.freezeTileCoverage=!1,this._horizonShift=.1,this._orthographicProjectionAtLowPitch=!1,this._allowWorldUnderZoom=!1}clone(){const t=new H0(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection(),this.maxBounds);return t._elevation=this._elevation,t._centerAltitude=this._centerAltitude,t._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,t.tileSize=this.tileSize,t.mercatorFromTransition=this.mercatorFromTransition,t.width=this.width,t.height=this.height,t.cameraElevationReference=this.cameraElevationReference,t._center=this._center,t._setZoom(this.zoom),t._seaLevelZoom=this._seaLevelZoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._nearZ=this._nearZ,t._farZ=this._farZ,t._averageElevation=this._averageElevation,t._orthographicProjectionAtLowPitch=this._orthographicProjectionAtLowPitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._camera=this._camera.clone(),t._calcMatrices(),t.freezeTileCoverage=this.freezeTileCoverage,t.frustumCorners=this.frustumCorners,t._allowWorldUnderZoom=this._allowWorldUnderZoom,t}get isOrthographic(){return this.projection.name!=="globe"&&this._orthographicProjectionAtLowPitch&&this.pitch0&&this.elevation.exaggeration()>0&&this._centerAltitudeValidForExaggeration;if(!this._elevation||t===Number.NEGATIVE_INFINITY&&(!r||!this._centerAltitude))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const c=this._elevation;r||this._centerAltitude&&this._centerAltitudeValidForExaggeration&&c.exaggeration()&&this._centerAltitudeValidForExaggeration!==c.exaggeration()?(this._centerAltitude=this._centerAltitude/this._centerAltitudeValidForExaggeration*c.exaggeration(),this._centerAltitudeValidForExaggeration=c.exaggeration()):(this._centerAltitude=t||0,this._centerAltitudeValidForExaggeration=c.exaggeration()),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){this._centerAltitudeValidForExaggeration!==void 0&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const t=this._elevation,r=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],c=this.horizonLineFromTop();let d=0,f=0;for(let _=0;_{const N=s.c5(z,A,C,k,j);T.has(N)||(d.push(new s.aH(A,z,C,k,j)),T.add(N))};for(let A=0;A0,K=C.y+10,te=z.wrap-($?0:1),ae=z.wrap+(G?0:1),ne=$?C.x-1:N-1,oe=G?C.x+1:0;if(f)c[0]<0?(E(k,ae,C.z,oe,C.y),c[1]<0&&K&&(E(k,j,C.z,C.x,C.y+1),E(k,ae,C.z,oe,C.y+1)),c[1]>0&&ie&&(E(k,j,C.z,C.x,C.y-1),E(k,ae,C.z,oe,C.y-1))):c[0]>0?(E(k,te,C.z,ne,C.y),c[1]<0&&K&&(E(k,j,C.z,C.x,C.y+1),E(k,te,C.z,ne,C.y+1)),c[1]>0&&ie&&(E(k,j,C.z,C.x,C.y-1),E(k,te,C.z,ne,C.y-1))):c[1]<0&&K?E(k,j,C.z,C.x,C.y+1):ie&&E(k,j,C.z,C.x,C.y-1);else{const se=z.visibleQuadrants;1&se&&(E(k,te,C.z,ne,C.y),ie&&(E(k,j,C.z,C.x,C.y-1),E(k,te,C.z,ne,C.y-1))),2&se&&(E(k,ae,C.z,oe,C.y),ie&&(E(k,j,C.z,C.x,C.y-1),E(k,ae,C.z,oe,C.y-1))),4&se&&(E(k,te,C.z,ne,C.y),K&&(E(k,j,C.z,C.x,C.y+1),E(k,te,C.z,ne,C.y+1))),8&se&&(E(k,ae,C.z,oe,C.y),K&&(E(k,j,C.z,C.x,C.y+1),E(k,ae,C.z,oe,C.y+1)))}}const M=[];for(const A of d)d.some(z=>A.isChildOf(z))||M.push(A);if(d=M.filter(A=>!t.some(z=>!!(A.overscaledZ{const G=N.canonical.x+.5-C[0],$=N.canonical.y+.5-C[1];return G*G+$*$t.maxzoom&&(r=t.maxzoom);const T=this.locationCoordinate(this.center),E=this.center.lat,M=1<{const ke=new s.ac(be.x+25e-6,be.y,be.z),je=new s.ac(be.x,be.y+25e-6,be.z),ze=be.toLngLat(),qe=ke.toLngLat(),et=je.toLngLat(),tt=this.locationCoordinate(ze),it=this.locationCoordinate(qe),ft=this.locationCoordinate(et),Rt=Math.hypot(it.x-tt.x,it.y-tt.y),Tt=Math.hypot(ft.x-tt.x,ft.y-tt.y);return Math.sqrt(Rt*Tt)*oe/25e-6},he=be=>{const Be=ae,ke=ne;return{aabb:s.bV(this,M,0,0,0,be,ke,Be,this.projection),zoom:0,x:0,y:0,minZ:ke,maxZ:Be,wrap:be,fullyVisible:!1}},fe=[];let Ce=[];const Se=r,Ve=t.reparseOverscaled?c:r,Ue=(G-this._centerAltitude)*N,We=be=>{if(!this._elevation||!be.tileID||!_)return;const Be=this._elevation.getMinMaxForTile(be.tileID),ke=be.aabb;Be?(ke.min[2]=Be.min,ke.max[2]=Be.max,ke.center[2]=(ke.min[2]+ke.max[2])/2):(be.shouldSplit=Ne(be),be.shouldSplit||(ke.min[2]=ke.max[2]=ke.center[2]=this._centerAltitude))},Te=(be,Be)=>{if(.707*Be{if(be.zoom=.9)return!0}else if(f&&(je=be.aabb.distanceZ($)*N),this.projection.isReprojectedInTileSpace&&c<=5){const Tt=Math.pow(2,be.zoom),Pt=se(new s.ac((be.x+.5)/Tt,(be.y+.5)/Tt));ze=Pt>.85?1:Pt}if(!_){const Tt=Math.sqrt(Be*Be+ke*ke+je*je);let Pt=(1<0;){const be=fe.pop(),Be=be.x,ke=be.y;let je=be.fullyVisible;const ze=()=>this.projection.name==="globe"&&(be.y===0||be.y===(1<>1),it={aabb:_?be.aabb.quadrant(qe):s.bV(this,M,be.zoom+1,et,tt,be.wrap,be.minZ,be.maxZ,this.projection),zoom:be.zoom+1,x:et,y:tt,wrap:be.wrap,fullyVisible:je,tileID:void 0,shouldSplit:void 0,minZ:be.minZ,maxZ:be.maxZ};f&&!z&&(it.tileID=new s.aH(be.zoom+1===Se?Ve:be.zoom+1,be.wrap,be.zoom+1,et,tt),We(it)),fe.push(it)}else{const qe=be.zoom===Se?Ve:be.zoom;if(t.minzoom&&t.minzoom>qe)continue;let et=0;if(!je){let Rt=K?be.aabb.intersectsPrecise(k):be.aabb.intersectsPreciseFlat(k);if(Rt===0&&ze()){const Tt=new s.bT(be.zoom,Be,ke);Rt=s.bU(this,M,Tt,!0).intersectsPrecise(k)}if(Rt===0)continue;if(t.calculateQuadrantVisibility)if(k.containsPoint(be.aabb.center))et=15;else for(let Tt=0;Tt<4;Tt++)be.aabb.quadrant(Tt).intersects(k)!==0&&(et|=1<{const je=[0,0,0,1],ze=[s.ai,s.ai,0,1],qe=this.calculateFogTileMatrix(ke.tileID.toUnwrapped());s.ad.vec4.transformMat4(je,je,qe),s.ad.vec4.transformMat4(ze,ze,qe);const et=s.ad.vec4.min([],je,ze),tt=s.ad.vec4.max([],je,ze),it=s.bW(et,tt);if(it===0)return!0;let ft=!1;const Rt=this._elevation;if(Rt&&it>be&&Be!==0){const Tt=this.calculateProjMatrix(ke.tileID.toUnwrapped());let Pt;t.isTerrainDEM||(Pt=Rt.getMinMaxForTile(ke.tileID)),Pt||(Pt={min:ne,max:ae});const Et=s.c7(this.rotation),Qt=[Et[0]*s.ai,Et[1]*s.ai,Pt.max];s.ad.vec3.transformMat4(Qt,Qt,Tt),ft=(1-Qt[1])*this.height*.5be.distanceSq-Be.distanceSq).map(be=>be.tileID)}resize(t,r){this.width=t,this.height=r,this.pixelsToGLUnits=[2/t,-2/r],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){const r=s.ay(t.lat,-s.bX,s.bX),c=this.projection.project(t.lng,r);return new s.P(c.x*this.worldSize,c.y*this.worldSize)}unproject(t){return this.projection.unproject(t.x/this.worldSize,t.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/s.bH(1,this.center.lat)/this.worldSize}setLocationAtPoint(t,r){let c,d;const f=this.centerPoint;if(this.projection.name==="globe"){const T=this.worldSize;c=(r.x-f.x)/T,d=(r.y-f.y)/T}else{const T=this.pointCoordinate(r),E=this.pointCoordinate(f);c=T.x-E.x,d=T.y-E.y}const _=this.locationCoordinate(t);this.setLocation(new s.ac(_.x-c,_.y-d))}setLocation(t){this.center=this.coordinateLocation(t),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(t,r){return this.projection.locationPoint(this,t,r)}locationPoint3D(t,r){return this.projection.locationPoint(this,t,r,!0)}pointLocation(t){return this.coordinateLocation(this.pointCoordinate(t))}pointLocation3D(t,r){return this.coordinateLocation(this.pointCoordinate3D(t,r))}locationCoordinate(t,r){const c=r?s.bH(r,t.lat):void 0,d=this.projection.project(t.lng,t.lat);return new s.ac(d.x,d.y,c)}coordinateLocation(t){return this.projection.unproject(t.x,t.y)}pointRayIntersection(t,r){const c=r??this._centerAltitude,d=[t.x,t.y,0,1],f=[t.x,t.y,1,1];s.ad.vec4.transformMat4(d,d,this.pixelMatrixInverse),s.ad.vec4.transformMat4(f,f,this.pixelMatrixInverse);const _=f[3];s.ad.vec4.scale(d,d,1/d[3]),s.ad.vec4.scale(f,f,1/_);const T=d[2],E=f[2];return{p0:d,p1:f,t:T===E?0:(c-T)/(E-T)}}screenPointToMercatorRay(t){const r=[t.x,t.y,0,1],c=[t.x,t.y,1,1];return s.ad.vec4.transformMat4(r,r,this.pixelMatrixInverse),s.ad.vec4.transformMat4(c,c,this.pixelMatrixInverse),s.ad.vec4.scale(r,r,1/r[3]),s.ad.vec4.scale(c,c,1/c[3]),r[2]=s.bH(r[2],this._center.lat)*this.worldSize,c[2]=s.bH(c[2],this._center.lat)*this.worldSize,s.ad.vec4.scale(r,r,1/this.worldSize),s.ad.vec4.scale(c,c,1/this.worldSize),new s.as([r[0],r[1],r[2]],s.ad.vec3.normalize([],s.ad.vec3.sub([],c,r)))}rayIntersectionCoordinate(t){const{p0:r,p1:c,t:d}=t,f=s.bH(r[2],this._center.lat),_=s.bH(c[2],this._center.lat);return new s.ac(s.ah(r[0],c[0],d)/this.worldSize,s.ah(r[1],c[1],d)/this.worldSize,s.ah(f,_,d))}pointCoordinate(t,r=this._centerAltitude){return this.projection.pointCoordinate(this,t.x,t.y,r)}pointCoordinate3D(t,r){if(!this.elevation)return this.pointCoordinate(t,r);let c=this.projection.pointCoordinate3D(this,t.x,t.y);if(c)return new s.ac(c[0],c[1],c[2]);let d=0,f=this.horizonLineFromTop();if(t.y>f)return this.pointCoordinate(t,r);const _=.02*f,T=t.clone();for(let E=0;E<10&&f-d>_;E++){T.y=s.ah(d,f,.66);const M=this.projection.pointCoordinate3D(this,T.x,T.y);M?(f=T.y,c=M):d=T.y}return c?new s.ac(c[0],c[1],c[2]):this.pointCoordinate(t)}isPointAboveHorizon(t){return this.projection.isPointAboveHorizon(this,t)}isPointOnSurface(t){if(t.y<0||t.y>this.height||t.x<0||t.x>this.width)return!1;if(this.elevation||this.zoom>=s.bY)return!this.isPointAboveHorizon(t);const r=this.pointCoordinate(t);return r.y>=0&&r.y<=1}_coordinatePoint(t,r){const c=r&&this.elevation?this.elevation.getAtPointOrZero(t,this._centerAltitude):this._centerAltitude,d=[t.x*this.worldSize,t.y*this.worldSize,c+t.toAltitude(),1];return s.ad.vec4.transformMat4(d,d,this.pixelMatrix),d[3]>0?new s.P(d[0]/d[3],d[1]/d[3]):new s.P(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:t,left:r}=this._edgeInsets,c=this.height-this._edgeInsets.bottom,d=this.width-this._edgeInsets.right,f=this.pointLocation3D(new s.P(r,t)),_=this.pointLocation3D(new s.P(d,t)),T=this.pointLocation3D(new s.P(d,c)),E=this.pointLocation3D(new s.P(r,c));let M=Math.min(f.lng,_.lng,T.lng,E.lng),A=Math.max(f.lng,_.lng,T.lng,E.lng),z=Math.min(f.lat,_.lat,T.lat,E.lat),C=Math.max(f.lat,_.lat,T.lat,E.lat);const k=Math.pow(2,-this.zoom)/16*270,j=this.projection.name==="globe"?1:4,N=(G,$,K,ie,te)=>{const ae=(G+K)/2,ne=($+ie)/2,oe=new s.P(ae,ne),{lng:se,lat:he}=this.pointLocation3D(oe),fe=Math.max(0,M-se,z-he,se-A,he-C);M=Math.min(M,se),A=Math.max(A,se),z=Math.min(z,he),C=Math.max(C,he),(tek)&&(N(G,$,ae,ne,te+1),N(ae,ne,K,ie,te+1))};if(N(r,t,d,t,1),N(d,t,d,c,1),N(d,c,r,c,1),N(r,c,r,t,1),this.projection.name==="globe"){const[G,$]=s.bZ(this);G?(C=90,A=180,M=-180):$&&(z=-90,A=180,M=-180)}return new s.aB(new s.bO(M,z),new s.bO(A,C))}_getBoundsRectangular(t,r){const{top:c,left:d}=this._edgeInsets,f=this.height-this._edgeInsets.bottom,_=this.width-this._edgeInsets.right,T=new s.P(d,c),E=new s.P(_,c),M=new s.P(_,f),A=new s.P(d,f);let z=this.pointCoordinate(T,t),C=this.pointCoordinate(E,t);const k=this.pointCoordinate(M,r),j=this.pointCoordinate(A,r),N=(G,$)=>($.y-G.y)/($.x-G.x);return z.y>1&&C.y>=0?z=new s.ac((1-j.y)/N(j,z)+j.x,1):z.y<0&&C.y<=1&&(z=new s.ac(-j.y/N(j,z)+j.x,0)),C.y>1&&z.y>=0?C=new s.ac((1-k.y)/N(k,C)+k.x,1):C.y<0&&z.y<=1&&(C=new s.ac(-k.y/N(k,C)+k.x,0)),new s.aB().extend(this.coordinateLocation(z)).extend(this.coordinateLocation(C)).extend(this.coordinateLocation(j)).extend(this.coordinateLocation(k))}_getBoundsRectangularTerrain(){const t=this.elevation;if(!t.visibleDemTiles.length||t.isUsingMockSource())return this._getBoundsRectangular(0,0);const r=t.visibleDemTiles.reduce((c,d)=>{if(d.dem){const f=d.dem.tree;c.min=Math.min(c.min,f.minimums[0]),c.max=Math.max(c.max,f.maximums[0])}return c},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(r.min*t.exaggeration(),r.max*t.exaggeration())}getBounds(){return this.projection.name==="mercator"||this.projection.name==="equirectangular"?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(t=!0){const r=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))-this.centerOffset.y,c=this.height/2-r*(1-this._horizonShift);return t?Math.max(0,c):c}getMaxBounds(){return this.maxBounds}setMaxBounds(t){this.maxBounds=t,this.minLat=-s.bX,this.maxLat=s.bX,this.minLng=-180,this.maxLng=180,t&&(this.minLat=t.getSouth(),this.maxLat=t.getNorth(),this.minLng=t.getWest(),this.maxLng=t.getEast(),this.maxLngz&&(T=z-M),z-Ak&&(_=k-E),k-C{for(let Ne=0;Ne<16;Ne++)Ve[Ne]=s.ah(Ue[Ne],We[Ne],Te)})(T,T,E,s.c9(this.pitch>=Je?1:this.pitch/Je))}else T=E;const M=s.ad.mat4.mul([],E,_);let A=s.ad.mat4.mul([],T,_);if(this.projection.isReprojectedInTileSpace){const he=this.locationCoordinate(this.center),fe=s.ad.mat4.identity([]);s.ad.mat4.translate(fe,fe,[he.x*this.worldSize,he.y*this.worldSize,0]),s.ad.mat4.multiply(fe,fe,s.c0(this)),s.ad.mat4.translate(fe,fe,[-he.x*this.worldSize,-he.y*this.worldSize,0]),s.ad.mat4.multiply(A,A,fe),s.ad.mat4.multiply(M,M,fe),this.inverseAdjustmentMatrix=s.c1(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];if(this.mercatorMatrix=s.ad.mat4.scale([],A,[this.worldSize,this.worldSize,this.worldSize/f,1]),this.projMatrix=A,this.invProjMatrix=s.ad.mat4.invert(new Float64Array(16),this.projMatrix),r){const he=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,1/0);he[8]=2*-t.x/this.width,he[9]=2*t.y/this.height,this.expandedFarZProjMatrix=s.ad.mat4.mul([],he,_)}else this.expandedFarZProjMatrix=this.projMatrix;const z=s.ad.mat4.invert([],T);this.frustumCorners=s.c2.fromInvProjectionMatrix(z,this.horizonLineFromTop(),this.height),this.cameraFrustum=s.bR.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,0,!r);const C=new Float32Array(16);s.ad.mat4.identity(C),s.ad.mat4.scale(C,C,[1,-1,1]),s.ad.mat4.rotateX(C,C,this._pitch),s.ad.mat4.rotateZ(C,C,this.angle);const k=s.ad.mat4.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ);this.starsProjMatrix=s.ad.mat4.clone(k);const j=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;k[8]=2*-t.x/this.width,k[9]=2*(t.y+j)/this.height,this.skyboxMatrix=s.ad.mat4.multiply(C,k,C);const N=this.point,G=N.x,$=N.y,K=this.width%2/2,ie=this.height%2/2,te=Math.cos(this.angle),ae=Math.sin(this.angle),ne=G-Math.round(G)+te*K+ae*ie,oe=$-Math.round($)+te*ie+ae*K,se=new Float64Array(A);if(s.ad.mat4.translate(se,se,[ne>.5?ne-1:ne,oe>.5?oe-1:oe,0]),this.alignedProjMatrix=se,A=s.ad.mat4.create(),s.ad.mat4.scale(A,A,[this.width/2,-this.height/2,1]),s.ad.mat4.translate(A,A,[1,-1,0]),this.labelPlaneMatrix=A,A=s.ad.mat4.create(),s.ad.mat4.scale(A,A,[1,-1,1]),s.ad.mat4.translate(A,A,[-1,-1,0]),s.ad.mat4.scale(A,A,[2/this.width,2/this.height,1]),this.glCoordMatrix=A,this.pixelMatrix=s.ad.mat4.multiply(new Float64Array(16),this.labelPlaneMatrix,M),this._calcFogMatrices(),this._distanceTileDataCache={},A=s.ad.mat4.invert(new Float64Array(16),this.pixelMatrix),!A)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=A,this.projection.name==="globe"||this.mercatorFromTransition){this.globeMatrix=s.c3(this);const he=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=s.ad.vec3.transformMat4(he,he,_),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=A;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={},this._expandedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const t=this.cameraWorldSizeForFog,r=this.cameraPixelsPerMeter,c=this._camera.position,d=1/this.height/this._pixelsPerMercatorPixel,f=[t,t,r];s.ad.vec3.scale(f,f,d),s.ad.vec3.scale(c,c,-1),s.ad.vec3.multiply(c,c,f);const _=s.ad.mat4.create();s.ad.mat4.translate(_,_,c),s.ad.mat4.scale(_,_,f),this.mercatorFogMatrix=_,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(t,r,d)}_computeCameraPosition(t){const r=(t=t||this.pixelsPerMeter)/this.pixelsPerMeter,c=this._camera.forward(),d=this.point,f=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*r-t/this.worldSize*this._centerAltitude;return[d.x/this.worldSize-c[0]*f,d.y/this.worldSize-c[1]*f,t/this.worldSize*this._centerAltitude-c[2]*f]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(t){const r=this._maxCameraBoundsDistance()*Math.cos(this._pitch),c=this._camera.position[2],d=t[2];let f=1;this.projection.wrap&&(this.center=this.center.wrap()),d>0&&(f=Math.min((r-c)/d,1)),this._camera.position=s.ad.vec3.scaleAndAdd([],this._camera.position,t,f),this._updateStateFromCamera()}_updateStateFromCamera(){const t=this._camera.position,r=this._camera.forward(),{pitch:c,bearing:d}=this._camera.getPitchBearing(),f=s.bH(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,_=this._mercatorZfromZoom(this._maxZoom)*Math.cos(s.ak(this._maxPitch)),T=Math.max((t[2]-f)/Math.cos(c),_),E=this._zoomFromMercatorZ(T);s.ad.vec3.scaleAndAdd(t,t,r,T),this._pitch=s.ay(c,s.ak(this.minPitch),s.ak(this.maxPitch)),this.angle=s.bF(d,-Math.PI,Math.PI),this._setZoom(s.ay(E,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new s.ac(t[0],t[1],t[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(t){return Math.pow(2,t)*this.tileSize}_mercatorZfromZoom(t){return this.cameraToCenterDistance/this._worldSizeFromZoom(t)}_minimumHeightOverTerrain(){const t=Math.min(this._seaLevelZoom!=null?this._seaLevelZoom:this._zoom,this._maxZoom)+4;return this._mercatorZfromZoom(t)}_zoomFromMercatorZ(t){return this.scaleZoom(this.cameraToCenterDistance/(t*this.tileSize))}zoomFromMercatorZAdjusted(t){let r=0,c=s.bY,d=0,f=1/0;for(;c-r>1e-6&&c>r;){const _=r+.5*(c-r),T=this.tileSize*Math.pow(2,_),E=this.getCameraToCenterDistance(this.projection,_,T),M=this.scaleZoom(E/(t*this.tileSize)),A=Math.abs(_-M);AM||C.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+s.c4(this.fovAboveCenter)>88||this.anyCornerOffEdge(new s.P(0,0),new s.P(this.width,this.height))}zoomDeltaToMovement(t,r){const c=s.ad.vec3.length(s.ad.vec3.sub([],this._camera.position,t)),d=this._zoomFromMercatorZ(c)+r;return c-this._mercatorZfromZoom(d)}getCameraPoint(){if(this.projection.name==="globe"){const t=function([r,c,d],f){const _=[r,c,d,1];s.ad.vec4.transformMat4(_,_,f);const T=_[3]=Math.max(_[3],1e-6);return _[0]/=T,_[1]/=T,_[2]/=T,_}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new s.P(t[0],t[1])}{const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new s.P(0,t))}}getCameraToCenterDistance(t,r=this.zoom,c=this.worldSize){const d=s.b$(t,r,this.width,this.height,1024),f=t.pixelSpaceConversion(this.center.lat,c,d);let _=.5/Math.tan(.5*this._fov)*this.height*f;return this.isOrthographic&&(_=s.ah(1,_,s.c9(this.pitch>=Je?1:this.pitch/Je))),_}getWorldToCameraMatrix(){const t=this._camera.getWorldToCamera(this.worldSize,this.projection.zAxisUnit==="meters"?this.pixelsPerMeter:1);return this.projection.name==="globe"&&s.ad.mat4.multiply(t,t,this.globeMatrix),t}getFrustum(t){return s.bR.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,t,this.projection.zAxisUnit==="meters")}}const lo=(u,t)=>{if(t>0&&u.terrain&&s.w("Cutoff is currently disabled on terrain"),t<=0||u.terrain)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};const r=u.transform,c=Math.max(Math.abs(r._zoom-(u.minCutoffZoom-1)),1),d=r.isLODDisabled(!1)?s.ae(60,45,r.pitch):s.ae(30,15,r.pitch),f=r._farZ-r._nearZ,_=t*r.height,T=((1-(E=d))*r.cameraToCenterDistance+E*(r._farZ+_))*c;var E;return{shouldRenderCutoff:d<1,uniformValues:{u_cutoff_params:[r._nearZ,r._farZ,(T-r._nearZ)/f,(T-_-r._nearZ)/f]}}},br={cascadeCount:2,normalOffset:3,shadowMapResolution:2048};class yc{constructor(t,r){this.aabb=t,this.lastCascade=r}}class Z0{add(t,r){const c=this.receivers[t.key];c!==void 0?(c.aabb.min[0]=Math.min(c.aabb.min[0],r.min[0]),c.aabb.min[1]=Math.min(c.aabb.min[1],r.min[1]),c.aabb.min[2]=Math.min(c.aabb.min[2],r.min[2]),c.aabb.max[0]=Math.max(c.aabb.max[0],r.max[0]),c.aabb.max[1]=Math.max(c.aabb.max[1],r.max[1]),c.aabb.max[2]=Math.max(c.aabb.max[2],r.max[2])):this.receivers[t.key]=new yc(r,null)}clear(){this.receivers={}}get(t){return this.receivers[t.key]}computeRequiredCascades(t,r,c){const d=s.ce.fromPoints(t.points);let f=0;for(const _ in this.receivers){const T=this.receivers[_];if(!T||!d.intersectsAabb(T.aabb))continue;T.aabb.min=d.closestPoint(T.aabb.min),T.aabb.max=d.closestPoint(T.aabb.max);const E=T.aabb.getCorners();for(let M=0;M1||C[1]<-1||C[1]>1){A=!1;break}}if(T.lastCascade=M,f=Math.max(f,M),A)break}}return f+1}}class co{constructor(t){this.painter=t,this._enabled=!1,this._shadowLayerCount=0,this._numCascadesToRender=0,this._cascades=[],this._groundShadowTiles=[],this._receivers=new Z0,this._depthMode=new xt(t.context.gl.LEQUAL,xt.ReadWrite,[0,1]),this._uniformValues={u_light_matrix_0:new Float32Array(16),u_light_matrix_1:new Float32Array(16),u_shadow_intensity:0,u_fade_range:[0,0],u_shadow_normal_offset:[1,1,1],u_shadow_texel_size:1,u_shadow_map_resolution:1,u_shadow_direction:[0,0,1],u_shadow_bias:[36e-5,.0012,.012],u_shadowmap_0:0,u_shadowmap_1:0},this._forceDisable=!1,this.useNormalOffset=!1,t.tp.registerParameter(this,["Shadows"],"_forceDisable",{label:"forceDisable"},()=>{this.painter.style.map.triggerRepaint()}),t.tp.registerParameter(br,["Shadows"],"cascadeCount",{min:1,max:2,step:1}),t.tp.registerParameter(br,["Shadows"],"normalOffset",{min:0,max:10,step:.05}),t.tp.registerParameter(br,["Shadows"],"shadowMapResolution",{min:32,max:2048,step:32}),t.tp.registerBinding(this,["Shadows"],"_numCascadesToRender",{readonly:!0,label:"numCascadesToRender"})}destroy(){for(const t of this._cascades)t.texture.destroy(),t.framebuffer.destroy();this._cascades=[]}updateShadowParameters(t,r){const c=this.painter;if(this._enabled=!1,this._shadowLayerCount=0,this._receivers.clear(),!r||!r.properties)return;const d=r.properties.get("shadow-intensity");if(!r.shadowsEnabled()||d<=0||(this._shadowLayerCount=c.style.order.reduce((j,N)=>{const G=c.style._mergedLayers[N];return j+(G.hasShadowPass()&&!G.isHidden(t.zoom)?1:0)},0),this._enabled=this._shadowLayerCount>0,!this.enabled))return;const f=c.context,_=br.shadowMapResolution,T=br.shadowMapResolution;if(this._cascades.length===0||br.shadowMapResolution!==this._cascades[0].texture.size[0]){this._cascades=[];for(let j=0;jG.dem).forEach(G=>{const $=G.dem.tree;N[0]=Math.min(N[0],$.minimums[0]),N[1]=Math.max(N[1],$.maximums[0])}),N[0]!==1e4&&(E=(N[1]-N[0])*j.exaggeration())}const M=1.5*t.cameraToCenterDistance,A=3*M,z=new Float64Array(16);for(let j=0;j=0)return{};const f=function(E,M,A){const z=A/(1<0&&(s.ad.vec3.add(f[1],f[1],[d[0]*_,0,0]),s.ad.vec3.add(f[2],f[2],[d[0]*_,0,0])),d[1]<0?(s.ad.vec3.add(f[0],f[0],[0,d[1]*_,0]),s.ad.vec3.add(f[1],f[1],[0,d[1]*_,0])):d[1]>0&&(s.ad.vec3.add(f[2],f[2],[0,d[1]*_,0]),s.ad.vec3.add(f[3],f[3],[0,d[1]*_,0]));const T={};return T.vertices=f,T.planes=[Zs(f[1],f[0],f[4]),Zs(f[2],f[1],f[5]),Zs(f[3],f[2],f[6]),Zs(f[0],f[3],f[7])],T}addShadowReceiver(t,r,c){this._receivers.add(t,s.ce.fromTileIdAndHeight(t,r,c))}getMaxCascadeForTile(t){const r=this._receivers.get(t);return r&&r.lastCascade?r.lastCascade:0}}function Zs(u,t,r){const c=s.ad.vec3.sub([],r,t),d=s.ad.vec3.sub([],u,t),f=s.ad.vec3.cross([],c,d),_=s.ad.vec3.length(f);return _===0?[0,0,1,0]:(s.ad.vec3.scale(f,f,1/_),[f[0],f[1],f[2],-s.ad.vec3.dot(f,t)])}function Vo(u){const t=u.properties.get("direction"),r=s.cc(t.x,t.y,t.z);r[2]=s.ay(r[2],0,75);const c=s.cf([r[0],r[1],r[2]]);return s.ad.vec3.fromValues(c.x,c.y,c.z)}function Ws(u,t,r){const c=t.properties.get("color-use-theme")==="none",d=t.properties.get("color"),f=t.properties.get("intensity"),_=t.properties.get("direction"),T=[_.x,_.y,_.z],E=r.properties.get("color-use-theme")==="none",M=r.properties.get("color"),A=r.properties.get("intensity"),z=Math.max(s.ad.vec3.dot([0,0,1],T),0),C=[0,0,0];s.ad.vec3.scale(C,M.toRenderColor(E?null:u.getLut(t.scope)).toArray01Linear().slice(0,3),A);const k=[0,0,0];return s.ad.vec3.scale(k,d.toRenderColor(c?null:u.getLut(r.scope)).toArray01Linear().slice(0,3),z*f),s.cg([C[0]>0?C[0]/(C[0]+k[0]):0,C[1]>0?C[1]/(C[1]+k[1]):0,C[2]>0?C[2]/(C[2]+k[2]):0])}function Xs(u,t,r,c,d,f){const _=u.zoom,T=u.scale,E=u.worldSize,M=1/E,A=u.aspect,z=Math.sqrt(1+A*A)*Math.tan(.5*u.fovX),C=z*z,k=c-r,j=c+r;let N,G;C>k/j?(N=c,G=c*z):(N=.5*j*(1+C),G=.5*Math.sqrt(k*k+2*(c*c+r*r)*C+j*j*C*C));const $=u.projection.pixelsPerMeter(u.center.lat,E),K=u._camera.getCameraToWorldMercator(),ie=[0,0,-N*M];s.ad.vec3.transformMat4(ie,ie,K);let te=G*M;const ae=u._edgeInsets;if(!(ae.left===0&&ae.top===0&&ae.right===0&&ae.bottom===0||ae.left===ae.right&&ae.top===ae.bottom)){const je=u._camera.getWorldToCamera(u.worldSize,u.projection.zAxisUnit==="meters"?$:1),ze=u._camera.getCameraToClipPerspective(u._fov,u.width/u.height,r,c);ze[8]=2*-u.centerOffset.x/u.width,ze[9]=2*u.centerOffset.y/u.height;const qe=new Float64Array(16);s.ad.mat4.mul(qe,ze,je);const et=new Float64Array(16);s.ad.mat4.invert(et,qe);const tt=s.bR.fromInvProjectionMatrix(et,E,_,!0);for(const it of tt.points){const ft=((ne=it)[0]/=T,ne[1]/=T,ne[2]=s.bH(ne[2],u._center.lat),ne);te=Math.max(te,s.ad.vec3.len(s.ad.vec3.subtract([],ie,ft)))}}var ne;te*=d/(d-1);const oe=Math.acos(t[2]),se=Math.atan2(-t[0],-t[1]),he=new Hs;he.position=ie,he.setPitchBearing(oe,se);const fe=he.getWorldToCamera(E,$),Ce=te*E,Se=Math.min(u._mercatorZfromZoom(17)*E*-2,-2*Ce),Ve=he.getCameraToClipOrthographic(-Ce,Ce,-Ce,Ce,Se,(Ce+f*$)/t[2]),Ue=new Float64Array(16);s.ad.mat4.multiply(Ue,Ve,fe);const We=s.ad.vec3.fromValues(Math.floor(1e6*ie[0])/1e6*E,Math.floor(1e6*ie[1])/1e6*E,0),Te=.5*d,Ne=[0,0,0];s.ad.vec3.transformMat4(Ne,We,Ue),s.ad.vec3.scale(Ne,Ne,Te);const be=[Math.floor(Ne[0]),Math.floor(Ne[1]),Math.floor(Ne[2])],Be=[0,0,0];s.ad.vec3.sub(Be,Ne,be),s.ad.vec3.scale(Be,Be,-1/Te);const ke=new Float64Array(16);return s.ad.mat4.identity(ke),s.ad.mat4.translate(ke,ke,Be),s.ad.mat4.multiply(Ue,ke,Ue),[Ue,Ce]}class Ch extends s.E{constructor(t){super(),this.requestManager=t,this.models={"":{}},this.modelUris={"":{}},this.numModelsLoading={}}loadModel(t,r){return s.aN(this.requestManager.transformRequest(r,s.R.Model).url).then(c=>{if(!c)return;const d=s.aO(c),f=new s.aP(t,void 0,void 0,d);return f.computeBoundsAndApplyParent(),f}).catch(c=>{if(c&&c.status===404)return null;this.fire(new s.z(new Error(`Could not load model ${t} from ${r}: ${c.message}`)))})}load(t,r,c={keepNumReferences:!1}){this.models[r]||(this.models[r]={});const d=Object.keys(t);this.numModelsLoading[r]=(this.numModelsLoading[r]||0)+d.length;const f=[];for(const _ of d)f.push(this.loadModel(_,t[_]));Promise.allSettled(f).then(_=>{for(let T=0;T<_.length;T++){const{status:E,value:M}=_[T];if(E==="fulfilled"&&M){const A=this.models[r][d[T]];this.models[r][d[T]]={model:M,numReferences:c.keepNumReferences&&A?A.numReferences:1}}}this.numModelsLoading[r]-=d.length,this.fire(new s.A("data",{dataType:"style"}))}).catch(_=>{this.fire(new s.z(new Error(`Could not load models: ${_.message}`)))})}isLoaded(){for(const t in this.numModelsLoading)if(this.numModelsLoading[t]>0)return!1;return!0}hasModel(t,r){return!!this.getModel(t,r)}getModel(t,r){return this.models[r]||(this.models[r]={}),this.models[r][t]?this.models[r][t].model:void 0}addModel(t,r,c){this.models[c]||(this.models[c]={}),this.modelUris[c]||(this.modelUris[c]={}),this.hasModel(t,c)&&this.models[c][t].numReferences++,this.modelUris[c][t]=this.requestManager.normalizeModelURL(r),this.load({[t]:this.modelUris[c][t]},c)}addModels(t,r){this.models[r]||(this.models[r]={}),this.modelUris[r]||(this.modelUris[r]={});const c=this.modelUris[r];for(const d in t)this.models[r][d]={},c[d]=this.requestManager.normalizeModelURL(t[d]);this.load(c,r,{keepNumReferences:!0})}reloadModels(t){this.load(this.modelUris[t],t)}addModelsFromBucket(t,r){this.models[r]||(this.models[r]={}),this.modelUris[r]||(this.modelUris[r]={});const c={};for(const d of t)this.hasModel(d,r)?this.models[r][d].numReferences++:(this.modelUris[r][d]=this.requestManager.normalizeModelURL(d),c[d]=this.modelUris[r][d]);this.load(c,r)}removeModel(t,r){if(this.models[r]&&this.models[r][t]&&(this.models[r][t].numReferences--,this.models[r][t].numReferences===0)){const c=this.models[r][t].model;delete this.models[r][t],delete this.modelUris[r][t],c.destroy()}}listModels(t){return this.models[t]||(this.models[t]={}),Object.keys(this.models[t])}upload(t,r){this.models[r]||(this.models[r]={});for(const c in this.models[r])this.models[r][c].model&&this.models[r][c].model.upload(t.context)}}const zh=new s.a7({data:new s.a8(s.a5.colorTheme.data)}),p3={"mbx-indoor-active-floorplans":{default:["literal",[]]},"mbx-indoor-underground":{default:["literal",!1]},"mbx-indoor-loaded-levels":{default:["literal",[]]},"mbx-indoor-level-height":{default:["literal",{}]},"mbx-indoor-level-base":{default:["literal",{}]},"mbx-indoor-level-selected":{default:["literal",{}]},"mbx-indoor-level-overlapped":{default:["literal",{}]}};function xc(u){return u=u||{},Object.assign(u,p3)}class vc extends s.E{constructor(t){super(),this.mergeFloors=!0,this._scope=void 0,this._queryFeatureSetId=void 0,this._buildingEntryFeatureSetId=void 0,this._selectedFloorplan=void 0,this._indoorData=void 0,this._selectedLevel=void 0,this._floorplanStates={},s.aQ(["_onLoad","_onMove","_checkFloorplanVisible"],this),this._map=t,this._checkFloorplanVisible(!0),this._map.on("load",this._onLoad),this._map.on("move",this._onMove)}destroy(){this._map.indoor.off("load",this._onLoad),this._map.indoor.off("move",this._onMove),this._map=void 0}_onLoad(){this._map.style.forEachFragmentStyle(t=>{t.stylesheet.indoor&&(this._queryFeatureSetId?this.fire(new s.z(new Error("Multiple indoor map styles detected, simultaneous usage is not allowed currently."))):(this._queryFeatureSetId=t.stylesheet.indoor.floorplanFeaturesetId,this._buildingEntryFeatureSetId=t.stylesheet.indoor.buildingFeaturesetId,this._scope=t.scope))}),this._queryFeatureSetId&&this._buildingEntryFeatureSetId&&this._map.addInteraction("mbx-indoor-buildingclick",{type:"click",target:{featuresetId:this._buildingEntryFeatureSetId,importId:this._scope},handler:t=>(t.feature&&t.feature.properties.floorplan&&this.selectFloorplan(t.feature.properties.floorplan),!0)}),this._checkFloorplanVisible(!0)}_onMove(){this._checkFloorplanVisible(!1)}_checkFloorplanVisible(t){if(!this._queryFeatureSetId||!this._map.isStyleLoaded()||this._map.transform.zoom<13)return;this._indoorData&&!function(_,T){const[E,M]=_,{center:A,radius:z}=T,[C,k]=A,j=Math.abs(E-C);return Math.sqrt((j>180?360-j:j)**2+(M-k)**2)<=z}([this._map.getCenter().lng,this._map.getCenter().lat],this._indoorData.circumCircle)&&(this._indoorData=void 0,this._selectedFloorplan=void 0,this._map.setConfigProperty(this._scope,"mbx-indoor-underground",!1),this._map.setConfigProperty(this._scope,"mbx-indoor-active-floorplans",["literal",[]]),this.fire(new s.A("floorplangone")));const r={target:{featuresetId:this._queryFeatureSetId,importId:this._scope}},c=new s.P(this._map.transform.width/2,this._map.transform.height/2),d=[new s.P(0,0),new s.P(this._map.transform.width,this._map.transform.height)],f=this._map.queryRenderedFeatures(t?d:c,r);f.length>0&&(this._selectedFloorplan&&f[0].properties.id===this._selectedFloorplan.properties.id||(this._selectedFloorplan=f[0],this._floorplanSelected(!1)))}_floorplanSelected(t){this._indoorData=JSON.parse(this._selectedFloorplan.properties["indoor-data"]),this._indoorData.id=this._selectedFloorplan.properties.id,this._indoorData.circumCircle=function(f){const[[_,T],[E,M]]=f,A=(E-_+360)%360,z=A>180?360-A:A;return{center:[(_+z/2+360)%360,(T+M)/2],radius:Math.sqrt(z**2+(M-T)**2)/2}}(this._indoorData.extent),this._floorplanStates[this._indoorData.id]||(this._floorplanStates[this._indoorData.id]={});const r=this._floorplanStates[this._indoorData.id].selectedBuilding,c=this._floorplanStates[this._indoorData.id].selectedLevel;let d;if(this._map.setConfigProperty(this._scope,"mbx-indoor-active-floorplans",this._indoorData.floorplanIDs),this._selectedLevel)for(const f of this._indoorData.levels)f.id===this._selectedLevel.id&&(d=f.id);if(this.fire(new s.A("floorplanselected",{buildings:this._indoorData.buildings,levels:this._indoorData.levels,selectedLevelId:d})),r){const f=this._indoorData.buildings.find(_=>_.id===r);this._buildingSelected(f,!1)}else this._indoorData.buildings.length>0&&this._buildingSelected(this._indoorData.buildings[0],!1);if(c){const f=this._indoorData.levels.find(_=>_.id===c);this._updateLevels(f,t)}else t&&this._indoorData["default-levels"].length>0&&this.selectLevel(this._indoorData["default-levels"][0])}_buildingSelected(t,r){r&&t&&t.extent&&this._map.fitBounds(t.extent,{pitch:this._map.getPitch(),bearing:this._map.getBearing()}),this._floorplanStates[this._indoorData.id].selectedBuilding=t?t.id:void 0;const c=this._indoorData.levels.filter(d=>t.levels.includes(d.id));this.fire(new s.A("buildingselected",{buildingId:t.id,levels:c}))}_levelSelected(t){if(t==="overview")this._updateLevels(void 0,!0);else{const r=this._indoorData.levels.find(c=>c.id===t);this._updateLevels(r,!0)}this.fire(new s.A("levelselected",{levelId:t==="overview"?void 0:t}))}_updateLevels(t,r){if(!t)return this._map.setConfigProperty(this._scope,"mbx-indoor-loaded-levels",["literal",[]]),this._map.setConfigProperty(this._scope,"mbx-indoor-underground",!1),this._floorplanStates[this._indoorData.id].selectedLevel=void 0,void(r&&this._indoorData.extent&&this._map.fitBounds(this._indoorData.extent,{pitch:this._map.getPitch(),bearing:this._map.getBearing()}));function c(M){const A=M.indexOf("/floor/");if(A===-1)return M;const z=A+7,C=M.indexOf("/",z);return C===-1?M.slice(z):M.slice(z,C)}this._selectedLevel=t,this._floorplanStates[this._indoorData.id].selectedLevel=t?t.id:void 0;const d=[],f={},_={},T={},E={};for(const M of this._indoorData.levels)if(d.push(M.id),f[M.id]=M.height,_[M.id]=M.base,t){if(this.mergeFloors){const A=c(t.id),z=c(M.id);T[M.id]=z===A?"true":"false"}else T[M.id]=M.id===t.id?"true":"false";E[M.id]=M.base=1?{pitch:this._map.getPitch(),bearing:this._map.getBearing()}:{pitch:this._map.getPitch(),bearing:this._map.getBearing(),zoom:A})}}selectFloorplan(t){const r={target:{featuresetId:this._queryFeatureSetId,importId:this._scope}},c=[new s.P(0,0),new s.P(this._map.transform.width,this._map.transform.height)],d=this._map.queryRenderedFeatures(c,r);if(d.length>0){for(const f of d)if(JSON.parse(f.properties["indoor-data"]).floorplanIDs.includes(t)){this._selectedFloorplan=f,this._floorplanSelected(!0);break}}}selectBuilding(t){const r=this._indoorData.buildings.find(c=>c.id===t);this._buildingSelected(r,!0)}selectLevel(t){this._levelSelected(t)}}function bc(u){if(!u.metadata||!u.metadata.content_area)return;const t=s.q.devicePixelRatio,{left:r,top:c,width:d,height:f}=u.metadata.content_area,_=r*t,T=c*t;return[_,T,_+d*t,T+f*t]}function W0(u){if(u)return u.map(([t,r])=>[t*s.q.devicePixelRatio,r*s.q.devicePixelRatio])}class Rh{constructor(t,r,c){this.id=t,this.scope=r,this.sourceCache=c,this.pendingRequests=new Set,this.missingRequests=new Set}addPendingRequest(t){this.missingRequests.has(t.name)||this.pendingRequests.has(t.name)||this.pendingRequests.add(t.name)}hasPendingRequests(){return this.pendingRequests.size>0}resolvePendingRequests(){const t=new Map;if(!this.sourceCache.loaded())return t;const r=this.sourceCache.getVisibleCoordinates();if(r.length===0)return t;const c=this.sourceCache.getSource();if(!(c instanceof Gn))return t;const d=r.map(_=>this.sourceCache.getTile(_)),f=c.getImages(d,Array.from(this.pendingRequests));for(const[_,T]of f)t.set(s.I.from({name:_,iconsetId:this.id}),T),this.pendingRequests.delete(_);for(const _ of this.pendingRequests)this.missingRequests.add(_);return this.pendingRequests.clear(),t}}const ds=(u,t)=>Pe(u,t&&t.filter(r=>r.identifier!=="source.canvas")),Dh=s.aA(ni,["addLayer","removeLayer","setLights","setPaintProperty","setLayoutProperty","setSlot","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setSnow","setRain","setProjection","setCamera","addImport","removeImport","updateImport","addIconset","removeIconset"]),Lh=s.aA(ni,["setCenter","setZoom","setBearing","setPitch"]),X0=new Set(["background","sky","slot","custom"]),wc={version:8,layers:[],sources:{}},Ya={duration:300,delay:0};class Dn extends s.E{constructor(t,r={}){super(),this.map=t,this.scope=r.scope||"",this.globalId=null,this.fragments=[],this.importDepth=r.importDepth||0,this.importsCache=r.importsCache||new Map,this.resolvedImports=r.resolvedImports||new Set,this.transition=s.l({},Ya),this._buildingIndex=new fc(this),this.crossTileSymbolIndex=new Ph,this._mergedOrder=[],this._drapedFirstOrder=[],this._mergedLayers={},this._mergedSourceCaches={},this._mergedOtherSourceCaches={},this._mergedSymbolSourceCaches={},this._clipLayerPresent=!1,this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this._changes=r.styleChanges||new Lo,this.dispatcher=r.dispatcher?r.dispatcher:new s.D(s.cj(),this),r.imageManager?this.imageManager=r.imageManager:(this.imageManager=new In(this.map._spriteFormat),this.imageManager.setEventedParent(this)),this.imageManager.addScope(this.scope),this.glyphManager=r.glyphManager?r.glyphManager:new s.ck(t._requestManager,r.localFontFamily?s.cl.all:r.localIdeographFontFamily?s.cl.ideographs:s.cl.none,r.localFontFamily||r.localIdeographFontFamily),r.modelManager?this.modelManager=r.modelManager:(this.modelManager=new Ch(t._requestManager),this.modelManager.setEventedParent(this)),this._layers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._precompileDone=!1,this._shouldPrecompile=!1,this._availableImages=[],this._order=[],this._markersNeedUpdate=!1,this.options=r.configOptions?r.configOptions:new Map,this._configDependentLayers=r.configDependentLayers?r.configDependentLayers:new Set,this._config=r.config,this._styleColorTheme={lut:null,lutLoading:!1,lutLoadingCorrelationID:0,colorTheme:null,colorThemeOverride:r.colorThemeOverride},this._styleColorThemeForScope={},this._initialConfig=r.initialConfig,this.dispatcher.broadcast("setReferrer",s.cm());const c=this;this._rtlTextPluginCallback=Dn.registerForPluginStateChange(d=>{c.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:d.pluginStatus,pluginURL:d.pluginURL},(f,_)=>{if(s.cn(f),_&&_.every(T=>T))for(const T in c._sourceCaches){const E=c._sourceCaches[T],M=E.getSource().type;M!=="vector"&&M!=="geojson"||E.reload()}})}),this.on("data",d=>{if(d.dataType!=="source"||d.sourceDataType!=="metadata")return;const f=this.getOwnSource(d.sourceId);if(f&&f.vectorLayerIds)for(const _ in this._layers){const T=this._layers[_];T.source===f.id&&this._validateLayer(T)}})}load(t){return t?(typeof t=="string"?this.loadURL(t):this.loadJSON(t),this):this}_getGlobalId(t){if(!t)return null;if(typeof t=="string"){if(s.f(t))return t;const r=s.co(t);if(!r.startsWith("http"))try{return new URL(r,location.href).toString()}catch{return r}return r}return`json://${s.cp(JSON.stringify(t))}`}_diffStyle(t,r,c){this.globalId=this._getGlobalId(t);const d=(f,_)=>{try{_(null,this.setState(f,c))}catch(T){_(T,!1)}};if(typeof t=="string"){const f=this.map._requestManager.normalizeStyleURL(t),_=this.map._requestManager.transformRequest(f,s.R.Style);s.n(_,(T,E)=>{T?this.fire(new s.z(T)):E&&d(E,r)})}else typeof t=="object"&&d(t,r)}loadURL(t,r={}){this.fire(new s.A("dataloading",{dataType:"style"}));const c=typeof r.validate=="boolean"?r.validate:!s.f(t);this.globalId=this._getGlobalId(t),t=this.map._requestManager.normalizeStyleURL(t,r.accessToken),this.resolvedImports.add(t);const d=this.importsCache.get(t);if(d)return this._load(d,c);const f=this.map._requestManager.transformRequest(t,s.R.Style);this._request=s.n(f,(_,T)=>{if(this._request=null,_)this.fire(new s.z(_));else if(T)return this.importsCache.set(t,T),this._load(T,c)})}loadJSON(t,r={}){this.fire(new s.A("dataloading",{dataType:"style"})),this.globalId=this._getGlobalId(t),this._request=s.q.frame(()=>{this._request=null,this._load(t,r.validate!==!1)})}loadEmpty(){this.fire(new s.A("dataloading",{dataType:"style"})),this._load(wc,!1)}_loadImports(t,r,c){if(this.importDepth>=4)return s.w("Style doesn't support nesting deeper than 5"),Promise.resolve();const d=[];for(const f of t){const _=this._createFragmentStyle(f),T=new Promise(A=>{_.once("style.import.load",A),_.once("error",A)}).then(()=>this.mergeAll());if(d.push(T),this.resolvedImports.has(f.url)){_.loadEmpty();continue}const E=f.data||this.importsCache.get(f.url);E?(_.loadJSON(E,{validate:r}),this._isInternalStyle(E)&&(_.globalId=null)):f.url?_.loadURL(f.url,{validate:r}):_.loadEmpty();const M={style:_,id:f.id,config:f.config};if(c){const A=this.fragments.findIndex(({id:z})=>z===c);this.fragments=this.fragments.slice(0,A).concat(M).concat(this.fragments.slice(A))}else this.fragments.push(M)}return Promise.allSettled(d)}getImportGlobalIds(t=this,r=new Set){for(const c of t.fragments)c.style.globalId&&r.add(c.style.globalId),this.getImportGlobalIds(c.style,r);return[...r.values()]}_createFragmentStyle(t){const r=this.scope?s.C(t.id,this.scope):t.id;let c;const d=this._initialConfig&&this._initialConfig[r];(t.config||d)&&(c=s.l({},t.config,d));const f=new Dn(this.map,{scope:r,styleChanges:this._changes,importDepth:this.importDepth+1,importsCache:this.importsCache,resolvedImports:new Set(this.resolvedImports),dispatcher:this.dispatcher,imageManager:this.imageManager,glyphManager:this.glyphManager,modelManager:this.modelManager,config:c,configOptions:this.options,colorThemeOverride:t["color-theme"],configDependentLayers:this._configDependentLayers});return f.setEventedParent(this.map,{style:f}),f}_reloadImports(){this.mergeAll(),this._updateMapProjection(),this.updateConfigDependencies(),this.map._triggerCameraUpdate(this.camera),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),this._shouldPrecompile=this.map._precompilePrograms&&this.isRootStyle()}_isInternalStyle(t){return this.isRootStyle()&&(t.fragment||!!t.schema&&t.fragment!==!1)}_load(t,r){const c=t.indoor?xc(t.schema):t.schema;if(this._isInternalStyle(t)){const _=s.l({},wc,{imports:[{id:"basemap",data:t,url:""}]});return void this._load(_,r)}if(this.updateConfig(this._config,c),r&&ds(this,Vr(t)))return;this._loaded=!0,this.stylesheet=s.cq(t);const d=()=>{for(const M in t.sources)this.addSource(M,t.sources[M],{validate:!1,isInitialLoad:!0});if(t.iconsets)for(const M in t.iconsets)this.addIconset(M,t.iconsets[M]);t.sprite?this._loadIconset(t.sprite):(this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0})),this.setGlyphsUrl(t.glyphs);const _=ja(this.stylesheet.layers);if(this._order=_.map(M=>M.id),this.stylesheet.light&&s.w("The `light` root property is deprecated, prefer using `lights` with `flat` light type instead."),this.stylesheet.lights)if(this.stylesheet.lights.length===1&&this.stylesheet.lights[0].type==="flat"){const M=this.stylesheet.lights[0];this.light=new Re(M.properties,M.id)}else this.setLights(this.stylesheet.lights);this.light||(this.light=new Re(this.stylesheet.light)),this._layers={};for(const M of _){const A=s.cv(M,this.scope,this._styleColorTheme.lut,this.options);A.configDependencies.size!==0&&this._configDependentLayers.add(A.fqid),A.setEventedParent(this,{layer:{id:A.id}}),this._layers[A.id]=A;const z=this.getOwnLayerSourceCache(A),C=!!this.directionalLight&&this.directionalLight.shadowsEnabled();z&&A.canCastShadows()&&C&&(z.castsShadows=!0)}this.stylesheet.featuresets&&this.setFeaturesetSelectors(this.stylesheet.featuresets),this.stylesheet.models&&this.modelManager.addModels(this.stylesheet.models,this.scope);const T=this.stylesheet.terrain;T&&(this.checkCanvasFingerprintNoise(),this.disableElevatedTerrain||this.terrainSetForDrapingOnly()||this._createTerrain(T,1)),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this.stylesheet.snow&&this._createSnow(this.stylesheet.snow),this.stylesheet.rain&&this._createRain(this.stylesheet.rain),this.stylesheet.transition&&this.setTransition(this.stylesheet.transition),this.fire(new s.A("data",{dataType:"style"}));const E=this.isRootStyle();t.imports?this._loadImports(t.imports,r).then(()=>{this._reloadImports(),this.fire(new s.A(E?"style.load":"style.import.load"))}):(this._reloadImports(),this.fire(new s.A(E?"style.load":"style.import.load")))};this._styleColorTheme.colorTheme=this.stylesheet["color-theme"];const f=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(f){const _=this._evaluateColorThemeData(f);this._loadColorTheme(_).then(()=>{d()}).catch(T=>{s.w(`Couldn't load color theme from the stylesheet: ${T}`),d()})}else this._styleColorTheme.lut=null,d()}isRootStyle(){return this.importDepth===0}mergeAll(){let t,r,c,d,f,_,T,E,M,A;const z={};this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(C=>{if(C.stylesheet){if(C.light!=null&&(t=C.light),C.stylesheet.lights)for(const k of C.stylesheet.lights)k.type==="ambient"&&C.ambientLight!=null&&(r=C.ambientLight),k.type==="directional"&&C.directionalLight!=null&&(c=C.directionalLight);d=this._prioritizeTerrain(d,C.terrain,C.stylesheet.terrain),C.stylesheet.fog&&C.fog!=null&&(f=C.fog),C.stylesheet.snow&&C.snow!=null&&(_=C.snow),C.stylesheet.rain&&C.rain!=null&&(T=C.rain),C.stylesheet.camera!=null&&(A=C.stylesheet.camera),C.stylesheet.projection!=null&&(E=C.stylesheet.projection),C.stylesheet.transition!=null&&(M=C.stylesheet.transition),z[C.scope]=C._styleColorTheme}}),this.light=t,this.ambientLight=r,this.directionalLight=c,this.fog=f,this.snow=_,this.rain=T,this._styleColorThemeForScope=z,d===null?delete this.terrain:this.terrain=d,this.camera=A||{"camera-projection":"perspective"},this.projection=E||{name:"mercator"},this.transition=s.l({},Ya,M),this.mergeSources(),this.mergeLayers()}forEachFragmentStyle(t){const r=c=>{for(const d of c.fragments)r(d.style);t(c)};r(this)}_prioritizeTerrain(t,r,c){const d=t&&t.drapeRenderMode===0;return c===null?r&&r.drapeRenderMode===0?r:d?t:null:r!=null&&(!t||d||r&&r.drapeRenderMode===1)?r:t}mergeTerrain(){let t;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(r=>{t=this._prioritizeTerrain(t,r.terrain,r.stylesheet.terrain)}),t===null?delete this.terrain:this.terrain=t}mergeProjection(){let t;this.forEachFragmentStyle(r=>{r.stylesheet.projection!=null&&(t=r.stylesheet.projection)}),this.projection=t||{name:"mercator"}}mergeSources(){const t={},r={},c={};this.forEachFragmentStyle(d=>{for(const f in d._sourceCaches){const _=s.C(f,d.scope);t[_]=d._sourceCaches[f]}for(const f in d._otherSourceCaches){const _=s.C(f,d.scope);r[_]=d._otherSourceCaches[f]}for(const f in d._symbolSourceCaches){const _=s.C(f,d.scope);c[_]=d._symbolSourceCaches[f]}}),this._mergedSourceCaches=t,this._mergedOtherSourceCaches=r,this._mergedSymbolSourceCaches=c}mergeLayers(){const t={},r=[],c={};this._mergedSlots=[],this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this.forEachFragmentStyle(f=>{for(const _ of f._order){const T=f._layers[_];if(T.type==="slot"){const E=s.cr(_);if(t[E])continue;t[E]=[]}T.slot&&t[T.slot]?t[T.slot].push(T):r.push(T)}}),this._mergedOrder=[];const d=(f=[])=>{for(const _ of f)if(_.type==="slot"){const T=s.cr(_.id);t[T]&&d(t[T]),this._mergedSlots.push(T)}else{const T=s.C(_.id,_.scope);this._mergedOrder.push(T),c[T]=_,_.is3D(!!this.terrain)&&(this._has3DLayers=!0),_.type==="circle"&&(this._hasCircleLayers=!0),_.type==="symbol"&&(this._hasSymbolLayers=!0),_.type==="clip"&&(this._clipLayerPresent=!0)}};d(r),this._mergedOrder.sort((f,_)=>{const T=c[f],E=c[_];return T.hasInitialOcclusionOpacityProperties?E.is3D(!!this.terrain)?1:0:T.is3D(!!this.terrain)&&E.hasInitialOcclusionOpacityProperties?-1:0}),this._mergedLayers=c,this.updateDrapeFirstLayers(),this._buildingIndex.processLayersChanged()}terrainSetForDrapingOnly(){return!!this.terrain&&this.terrain.drapeRenderMode===0}getCamera(){return this.stylesheet.camera}setCamera(t){return this.stylesheet.camera=s.l({},this.stylesheet.camera,t),this.camera=this.stylesheet.camera,this}_evaluateColorThemeData(t){return t.data?function(r,c,d){const f=s.l({},c);for(const T of Object.keys(s.a5.colorTheme))f[T]===void 0&&(f[T]=s.a5.colorTheme[T].default);const _=new s.a6(zh,r,new Map(d));return _.setTransitionOrValue(f,d),_.untransitioned().possiblyEvaluate(new s.aa(0))}(this.scope,t,this.options).get("data"):null}_loadColorTheme(t){this._styleColorTheme.lutLoading=!0,this._styleColorTheme.lutLoadingCorrelationID+=1;const r=this._styleColorTheme.lutLoadingCorrelationID;return new Promise((c,d)=>{const f="data:image/png;base64,";if(!t||t.length===0)return this._styleColorTheme.lut=null,this._styleColorTheme.lutLoading=!1,void c();let _=t;_.startsWith(f)||(_=f+_);const T=s.I.from("mapbox-reserved-lut"),E=new Image;E.src=_,E.onerror=()=>{this._styleColorTheme.lutLoading=!1,d(new Error("Failed to load image data"))},E.onload=()=>{if(this._styleColorTheme.lutLoadingCorrelationID!==r)return void c();this._styleColorTheme.lutLoading=!1;const{width:M,height:A,data:z}=s.q.getImageData(E);if(A>32)return void d(new Error("The height of the image must be less than or equal to 32 pixels."));if(M!==A*A)return void d(new Error("The width of the image must be equal to the height squared."));this.getImage(T,this.scope)&&this.removeImage(T,this.scope),this.addImage(T,this.scope,{data:new s.r({width:M,height:A},z),pixelRatio:1,sdf:!1,usvg:!1,version:0});const C=this.imageManager.getImage(T,this.scope);C?(this._styleColorTheme.lut={image:C.data,data:t},c()):d(new Error("Missing LUT image."))}})}getLut(t){const r=this._styleColorThemeForScope[t];return r?r.lut:null}setProjection(t){t?this.stylesheet.projection=t:delete this.stylesheet.projection,this.mergeProjection(),this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?(this.getTerrain()||this.stylesheet.terrain)&&!this.disableElevatedTerrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null,0))}_updateMapProjection(){this.isRootStyle()&&(this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.projection))}_loadSprite(t){this._spriteRequest=function(r,c,d){let f,_,T;const E=s.q.devicePixelRatio>1?"@2x":"";let M=s.n(c.transformRequest(c.normalizeSpriteURL(r,E,".json"),s.R.SpriteJSON),(C,k)=>{M=null,T||(T=C,f=k,z())}),A=s.o(c.transformRequest(c.normalizeSpriteURL(r,E,".png"),s.R.SpriteImage),(C,k)=>{A=null,T||(T=C,_=k,z())});function z(){if(T)d(T);else if(f&&_){const C=s.q.getImageData(_),k={};for(const j in f){const{width:N,height:G,x:$,y:K,sdf:ie,pixelRatio:te,stretchX:ae,stretchY:ne,content:oe}=f[j],se=new s.r({width:N,height:G});s.r.copy(C,se,{x:$,y:K},{x:0,y:0},{width:N,height:G},null),k[j]={data:se,pixelRatio:te,sdf:ie,stretchX:ae,stretchY:ne,content:oe,usvg:!1}}d(null,k)}}return{cancel(){M&&(M.cancel(),M=null),A&&(A.cancel(),A=null)}}}(t,this.map._requestManager,(r,c)=>{if(this._spriteRequest=null,r)this.fire(new s.z(r));else if(c){const d=new Map;for(const f in c)d.set(s.I.from(f),c[f]);this.addImages(d,this.scope)}this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new s.A("data",{dataType:"style"}))})}addIconset(t,r){if(r.type==="sprite")return void this._loadSprite(r.url);const c=this.getOwnSourceCache(r.source);if(!c)return void this.fire(new s.z(new Error(`Source "${r.source}" as specified by iconset "${t}" does not exist and cannot be used as an iconset source`)));const d=c.getSource();if(d.type!=="raster-array")return void this.fire(new s.z(new Error(`Source "${r.source}" as specified by iconset "${t}" is not a "raster-array" source and cannot be used as an iconset source`)));d.partial=!1;const f=new Rh(t,this.scope,c);this.imageManager.addImageProvider(f,this.scope)}removeIconset(t){this.imageManager.removeImageProvider(t,this.scope)}_loadIconset(t){if(!s.f(t)&&this.map._spriteFormat!=="icon_set"||this.map._spriteFormat==="raster")return void this._loadSprite(t);const r=this.map._spriteFormat==="auto";var c,d;this._spriteRequest=(d=(f,_)=>{if(this._spriteRequest=null,f)r?this._loadSprite(t):this.fire(new s.z(f));else if(_){const T=new Map;for(const E in _)T.set(s.I.from(E),_[E]);this.addImages(T,this.scope)}this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new s.A("data",{dataType:"style"}))},s.bj((c=this.map._requestManager).transformRequest(c.normalizeIconsetURL(t),s.R.Iconset),(f,_)=>{if(f)return void d(f);const T={},E=s.ch(new s.bi(_));for(const M of E.icons){const A={version:1,pixelRatio:s.q.devicePixelRatio,content:bc(M),stretchX:M.metadata?W0(M.metadata.stretch_x_areas):void 0,stretchY:M.metadata?W0(M.metadata.stretch_y_areas):void 0,sdf:!1,usvg:!0,icon:M};T[M.name]=A}d(null,T)}))}_validateLayer(t){const r=this.getOwnSource(t.source);if(!r)return;const c=t.sourceLayer;c&&(r.type==="geojson"||r.vectorLayerIds&&r.vectorLayerIds.indexOf(c)===-1)&&this.fire(new s.z(new Error(`Source layer "${c}" does not exist on source "${r.id}" as specified by style layer "${t.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._changes.getUpdatedSourceCaches()).length)return!1;for(const t in this._sourceCaches)if(!this._sourceCaches[t].loaded())return!1;if(!this.imageManager.isLoaded()||this.imageManager.hasPatternsInFlight()||!this.modelManager.isLoaded()||this._styleColorTheme.lutLoading)return!1;for(const{style:t}of this.fragments)if(!t.loaded())return!1;return!0}_serializeImports(){if(this.stylesheet.imports)return this.stylesheet.imports.map((t,r)=>{const c=this.fragments[r];return c&&c.style&&(t.data=c.style.serialize()),t})}_serializeSources(){const t={};for(const r in this._sourceCaches){const c=this._sourceCaches[r].getSource();t[c.id]||(t[c.id]=c.serialize())}return t}_serializeLayers(t){const r=[];for(const c of t){const d=this._layers[c];d&&d.type!=="custom"&&r.push(d.serialize())}return r}hasLightTransitions(){return!(!this.light||!this.light.hasTransition())||!(!this.ambientLight||!this.ambientLight.hasTransition())||!(!this.directionalLight||!this.directionalLight.hasTransition())}hasFogTransition(){return!!this.fog&&this.fog.hasTransition()}hasSnowTransition(){return!!this.snow&&this.snow.hasTransition()}hasRainTransition(){return!!this.rain&&this.rain.hasTransition()}hasTransitions(){if(this.hasLightTransitions()||this.hasFogTransition()||this.hasSnowTransition()||this.hasRainTransition())return!0;for(const t in this._sourceCaches)if(this._sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}get order(){return this.terrain?this._drapedFirstOrder:this._mergedOrder}_getOrder(t){return t?this.order:this._mergedOrder}isLayerDraped(t){return!!this.terrain&&t.isDraped(this.getLayerSourceCache(t))}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}_checkLayer(t){const r=this.getOwnLayer(t);if(r)return r;this.fire(new s.z(new Error(`The layer '${t}' does not exist in the map's style.`)))}_checkSource(t){const r=this.getOwnSource(t);if(r)return r;this.fire(new s.z(new Error(`The source '${t}' does not exist in the map's style.`)))}precompilePrograms(t,r){const c=this.map.painter;if(c)for(let d=t.minzoom||0;d<(t.maxzoom||25.5);d++){const f=t.getProgramIds();if(f)for(const _ of f){const T=t.getDefaultProgramParams(_,r.zoom,this._styleColorTheme.lut);T&&(c.style=this,this.fog&&(c._fogVisible=!0,T.overrideFog=!0,c.getOrCreateProgram(_,T)),c._fogVisible=!1,T.overrideFog=!1,c.getOrCreateProgram(_,T),(this.stylesheet.terrain||this.stylesheet.projection&&this.stylesheet.projection.name==="globe")&&(T.overrideRtt=!0,c.getOrCreateProgram(_,T)))}}}update(t){if(!this._loaded)return;this.ambientLight&&this.ambientLight.recalculate(t),this.directionalLight&&this.directionalLight.recalculate(t);const r=this.calculateLightsBrightness();t.brightness=r||0,r!==this._brightness&&(this._brightness=r,this.dispatcher.broadcast("setBrightness",r));const c=this._changes.isDirty();let d=!1;if(this._changes.isDirty()){const T=this._changes.getLayerUpdatesByScope();for(const E in T){const{updatedIds:M,removedIds:A}=T[E];(M||A)&&(this._updateWorkerLayers(E,M,A),d=!0)}this.updateSourceCaches(),this._updateTilesForChangedImages(),this.updateLayers(t),this.light&&this.light.updateTransitions(t),this.ambientLight&&this.ambientLight.updateTransitions(t),this.directionalLight&&this.directionalLight.updateTransitions(t),this.fog&&this.fog.updateTransitions(t),this.snow&&this.snow.updateTransitions(t),this.rain&&this.rain.updateTransitions(t),this._changes.reset()}const f={};for(const T in this._mergedSourceCaches){const E=this._mergedSourceCaches[T];f[T]=E.used,E.used=!1,E.tileCoverLift=0}for(const T of this._mergedOrder){const E=this._mergedLayers[T];if(E.recalculate(t,this._availableImages),!E.isHidden(t.zoom)){const M=this.getLayerSourceCache(E);M&&(M.used=!0,M.tileCoverLift=Math.max(M.tileCoverLift,E.tileCoverLift()))}!this._precompileDone&&this._shouldPrecompile&&("requestIdleCallback"in window?requestIdleCallback(()=>{this.precompilePrograms(E,t)}):this.precompilePrograms(E,t))}this._shouldPrecompile&&(this._precompileDone=!0),this.terrain&&d&&this.mergeLayers();const _=this.imageManager.getPendingImageProviders();for(const T of _)T.sourceCache.used=!0;for(const T in f){const E=this._mergedSourceCaches[T];f[T]!==E.used&&E.getSource().fire(new s.A("data",{sourceDataType:"visibility",dataType:"source",sourceId:E.getSource().id}))}this.light&&this.light.recalculate(t),this.terrain&&this.terrain.recalculate(t),this.fog&&this.fog.recalculate(t),this.snow&&this.snow.recalculate(t),this.rain&&this.rain.recalculate(t),this.z=t.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),this.imageManager.clearUpdatedImages(this.scope),c&&this.fire(new s.A("data",{dataType:"style"}))}updateImageProviders(){const t=this.imageManager.getPendingImageProviders();for(const r of t){const c=r.resolvePendingRequests();this.addImages(c,r.scope)}}_updateTilesForChangedImages(){const t={};for(const r in this._mergedSourceCaches){const c=this._mergedSourceCaches[r].getSource().scope;t[c]=t[c]||this._changes.getUpdatedImages(c),t[c].length!==0&&this._mergedSourceCaches[r].reloadTilesForDependencies(["icons","patterns"],t[c])}for(const r in t)this._changes.resetUpdatedImages(r)}_updateWorkerLayers(t,r,c){const d=this.getFragmentStyle(t);d&&this.dispatcher.broadcast("updateLayers",{layers:r?d._serializeLayers(r):[],scope:t,removedIds:c||[],options:d.options})}setState(t,r){if(this._checkLoaded(),ds(this,Vr(t)))return!1;(t=s.cq(t)).layers=ja(t.layers);const c=function(_,T){if(!_)return[{command:ni.setStyle,args:[T]}];let E=[];try{if(!s.bn(_.version,T.version))return[{command:ni.setStyle,args:[T]}];if(s.bn(_.center,T.center)||E.push({command:ni.setCenter,args:[T.center]}),s.bn(_.zoom,T.zoom)||E.push({command:ni.setZoom,args:[T.zoom]}),s.bn(_.bearing,T.bearing)||E.push({command:ni.setBearing,args:[T.bearing]}),s.bn(_.pitch,T.pitch)||E.push({command:ni.setPitch,args:[T.pitch]}),s.bn(_.sprite,T.sprite)||E.push({command:ni.setSprite,args:[T.sprite]}),s.bn(_.glyphs,T.glyphs)||E.push({command:ni.setGlyphs,args:[T.glyphs]}),s.bn(_.imports,T.imports)||function(k=[],j=[],N){j=j||[];const G=(k=k||[]).map(ai),$=j.map(ai),K=k.reduce(Ir,{}),ie=j.reduce(Ir,{}),te=G.slice();let ae,ne,oe,se;for(ae=0,ne=0;ae{k.source&&M[k.source]?E.push({command:ni.removeLayer,args:[k.id]}):z.push(k)});let C=_.terrain;C&&M[C.source]&&(E.push({command:ni.setTerrain,args:[void 0]}),C=void 0),E=E.concat(A),s.bn(C,T.terrain)||E.push({command:ni.setTerrain,args:[T.terrain]}),function(k,j,N){j=j||[];const G=(k=k||[]).map(ai),$=j.map(ai),K=k.reduce(Ir,{}),ie=j.reduce(Ir,{}),te=G.slice(),ae=Object.create(null);let ne,oe,se,he,fe,Ce,Se;for(ne=0,oe=0;ne!(_.command in Lh));if(c.length===0)return!1;const d=c.filter(_=>!(_.command in Dh));if(d.length>0)throw new Error(`Unimplemented: ${d.map(_=>_.command).join(", ")}.`);const f=[];return c.forEach(_=>{f.push(this[_.command].apply(this,_.args))}),r&&Promise.all(f).then(r),this.stylesheet=t,this.mergeAll(),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),!0}_updateWorkerImages(t){const r=this.getFragmentStyle(t);r&&(r._availableImages=r.imageManager.listImages(t),r.dispatcher.broadcast("setImages",{scope:t,images:r._availableImages}))}addImages(t,r){for(const[c,d]of t.entries()){if(this.getImage(c,r))return this.fire(new s.z(new Error(`An image with the name "${c.name}" already exists.`)));this.imageManager.addImage(c,r,d),this._changes.updateImage(c,r)}return this._updateWorkerImages(r),this.fire(new s.A("data",{dataType:"style"})),this}addImage(t,r,c){return this.getImage(t,r)?this.fire(new s.z(new Error(`An image with the name "${t.name}" already exists.`))):(this.imageManager.addImage(t,r,c),this._changes.updateImage(t,r),this._updateWorkerImages(r),this.fire(new s.A("data",{dataType:"style"})),this)}updateImage(t,r,c,d=!1){this.imageManager.updateImage(t,r,c),d&&(this._changes.updateImage(t,r),this._updateWorkerImages(r),this.fire(new s.A("data",{dataType:"style"})))}getImage(t,r){return this.imageManager.getImage(t,r)}removeImage(t,r){return this.getImage(t,r)?(this.imageManager.removeImage(t,r),this._changes.updateImage(t,r),this._updateWorkerImages(r),this.fire(new s.A("data",{dataType:"style"})),this):this.fire(new s.z(new Error("No image with this name exists.")))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addModel(t,r,c={}){return this._checkLoaded(),this._validate(ue,`models.${t}`,r,null,c)||(this.modelManager.addModel(t,r,this.scope),this._changes.setDirty()),this}hasModel(t){return this.modelManager.hasModel(t,this.scope)}removeModel(t){return this.hasModel(t)?(this.modelManager.removeModel(t,this.scope),this):this.fire(new s.z(new Error("No model with this ID exists.")))}listModels(){return this._checkLoaded(),this.modelManager.listModels(this.scope)}addSource(t,r,c={}){if(this._checkLoaded(),this.getOwnSource(t)!==void 0)throw new Error(`There is already a source with ID "${t}".`);if(!r.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(as,`sources.${t}`,r,null,c))return;this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);const d=N0(t,r,this.dispatcher,this);d.scope=this.scope,d.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(d.id),source:d.serialize(),sourceId:d.id}));const f=_=>{const T=(_?"symbol:":"other:")+d.id,E=s.C(T,this.scope),M=this._sourceCaches[T]=new yn(E,d,_);(_?this._symbolSourceCaches:this._otherSourceCaches)[d.id]=M,M.onAdd(this.map)};f(!1),r.type!=="vector"&&r.type!=="geojson"||f(!0),d.onAdd&&d.onAdd(this.map),c.isInitialLoad||(this.mergeSources(),this._changes.setDirty())}removeSource(t){this._checkLoaded();const r=this.getOwnSource(t);if(!r)throw new Error("There is no source with this ID");for(const d in this._layers)if(this._layers[d].source===t)return this.fire(new s.z(new Error(`Source "${t}" cannot be removed while layer "${d}" is using it.`)));if(this.terrain&&this.terrain.scope===this.scope&&this.terrain.get().source===t)return this.fire(new s.z(new Error(`Source "${t}" cannot be removed while terrain is using it.`)));if(this.stylesheet.iconsets){const d=Object.entries(this.stylesheet.iconsets).find(([f,_])=>_.type==="source"&&_.source===t);if(d)return this.fire(new s.z(new Error(`Source "${t}" cannot be removed while iconset "${d[0]}" is using it.`)))}const c=this.getOwnSourceCaches(t);for(const d of c){const f=s.cr(d.id);delete this._sourceCaches[f],this._changes.discardSourceCacheUpdate(d.id),d.fire(new s.A("data",{sourceDataType:"metadata",dataType:"source",sourceId:d.getSource().id})),d.setEventedParent(null),d.clearTiles()}return delete this._otherSourceCaches[t],delete this._symbolSourceCaches[t],this.mergeSources(),r.setEventedParent(null),r.onRemove&&r.onRemove(this.map),this._changes.setDirty(),this}setGeoJSONSourceData(t,r){this._checkLoaded(),this.getOwnSource(t).setData(r),this._changes.setDirty()}getOwnSource(t){const r=this.getOwnSourceCache(t);return r&&r.getSource()}getOwnSources(){const t=[];for(const r in this._otherSourceCaches){const c=this.getOwnSourceCache(r);c&&t.push(c.getSource())}return t}areTilesLoaded(){const t=this._mergedSourceCaches;for(const r in t){const c=t[r]._tiles;for(const d in c){const f=c[d];if(f.state!=="loaded"&&f.state!=="errored")return!1}}return!0}setLights(t){if(this._checkLoaded(),!t)return delete this.ambientLight,void delete this.directionalLight;const r=this._getTransitionParameters();for(const d of t){if(this._validate(Ls,"lights",d))return;switch(d.type){case"ambient":if(this.ambientLight){const f=this.ambientLight;f.set(d),f.updateTransitions(r)}else this.ambientLight=new Wi(d,Xt||(Xt=new s.a7({color:new s.a8(s.a5.properties_light_ambient.color),"color-use-theme":new s.a8({type:"string",default:"default","property-type":"data-constant"}),intensity:new s.a8(s.a5.properties_light_ambient.intensity)})),this.scope,this.options);break;case"directional":if(this.directionalLight){const f=this.directionalLight;f.set(d),f.updateTransitions(r)}else this.directionalLight=new Wi(d,xi||(xi=new s.a7({direction:new s.am(s.a5.properties_light_directional.direction),color:new s.a8(s.a5.properties_light_directional.color),"color-use-theme":new s.a8({type:"string",default:"default","property-type":"data-constant"}),intensity:new s.a8(s.a5.properties_light_directional.intensity),"cast-shadows":new s.a8(s.a5.properties_light_directional["cast-shadows"]),"shadow-quality":new s.a8(s.a5.properties_light_directional["shadow-quality"]),"shadow-intensity":new s.a8(s.a5.properties_light_directional["shadow-intensity"])})),this.scope,this.options)}}const c=new s.aa(this.z||0,r);this.ambientLight&&this.ambientLight.recalculate(c),this.directionalLight&&this.directionalLight.recalculate(c),this._brightness=this.calculateLightsBrightness(),this.dispatcher.broadcast("setBrightness",this._brightness)}calculateLightsBrightness(){const t=this.directionalLight,r=this.ambientLight;if(!t||!r)return;const c=C=>.2126*(C[0]<=.03928?C[0]/12.92:Math.pow((C[0]+.055)/1.055,2.4))+.7152*(C[1]<=.03928?C[1]/12.92:Math.pow((C[1]+.055)/1.055,2.4))+.0722*(C[2]<=.03928?C[2]/12.92:Math.pow((C[2]+.055)/1.055,2.4)),d=t.properties.get("color").toRenderColor(null).toArray01(),f=t.properties.get("intensity"),_=t.properties.get("direction"),T=1-s.cc(_.x,_.y,_.z)[2]/90,E=c(d)*f*T,M=r.properties.get("color").toRenderColor(null).toArray01(),A=r.properties.get("intensity"),z=c(M)*A;return Number(((E+z)/2).toFixed(6))}getBrightness(){return this._brightness}getLights(){if(!this.enable3dLights())return null;const t=[];return this.directionalLight&&t.push(this.directionalLight.get()),this.ambientLight&&t.push(this.ambientLight.get()),t}enable3dLights(){return!!this.ambientLight&&!!this.directionalLight}getFragmentStyle(t){if(!t)return this;if(s.cs(t)){const r=s.ct(t),c=this.fragments.find(({id:f})=>f===r);if(!c)throw new Error(`Style import '${t}' not found`);const d=s.cr(t);return c.style.getFragmentStyle(d)}{const r=this.fragments.find(({id:c})=>c===t);return r?r.style:void 0}}setFeaturesetSelectors(t){if(!t)return;const r={},c=(d,f="")=>`${d}::${f}`;this._featuresetSelectors={};for(const d in t){const f=this._featuresetSelectors[d]=[];for(const _ of t[d].selectors){if(_.featureNamespace){const E=this.getOwnLayer(_.layer);if(!E){s.w(`Layer is undefined for selector: ${_.layer}`);continue}const M=c(E.source,E.sourceLayer);if(M in r&&r[M]!==_.featureNamespace){s.w(`"featureNamespace ${_.featureNamespace} of featureset ${d}'s selector is not associated to the same source, skip this selector`);continue}r[M]=_.featureNamespace}let T;if(_.properties)for(const E in _.properties){const M=s.X(_.properties[E]);M.result==="success"&&(T=T||{},T[E]=M.value)}f.push({layerId:_.layer,namespace:_.featureNamespace,properties:T,uniqueFeatureID:_._uniqueFeatureID})}}}getFeaturesetDescriptors(t){const r=this.getFragmentStyle(t);if(!r||!r.stylesheet.featuresets)return[];const c=[];for(const d in r.stylesheet.featuresets)c.push({featuresetId:d,importId:r.scope?r.scope:void 0});return c}getFeaturesetLayers(t,r){const c=this.getFragmentStyle(r),d=c.stylesheet.featuresets;if(!d||!d[t])return this.fire(new s.z(new Error(`The featureset '${t}' does not exist in the map's style and cannot be queried.`))),[];const f=[];for(const _ of d[t].selectors){const T=c.getOwnLayer(_.layer);T&&f.push(T)}return f}getConfigProperty(t,r){const c=this.getFragmentStyle(t);if(!c)return null;const d=s.C(r,c.scope),f=c.options.get(d),_=f?f.value||f.default:null;return _?_.serialize():null}setConfigProperty(t,r,c){const d=this.getFragmentStyle(t);if(!d)return;const f=d.stylesheet.indoor?xc(d.stylesheet.schema):d.stylesheet.schema;if(!f||!f[r])return;const _=s.X(c);if(_.result!=="success")return void ds(this,_.value);const T=_.value.expression,E=s.C(r,d.scope),M=d.options.get(E);if(!M)return;let A;const{minValue:z,maxValue:C,stepValue:k,type:j,values:N}=f[r],G=s.X(f[r].default);G.result==="success"&&(A=G.value.expression),A?(this.options.set(E,Object.assign({},M,{value:T,default:A,minValue:z,maxValue:C,stepValue:k,type:j,values:N})),this.updateConfigDependencies(r)):this.fire(new s.z(new Error(`No schema defined for the config option "${r}" in the "${t}" fragment.`)))}getConfig(t){const r=this.getFragmentStyle(t);if(!r)return null;const c=r.stylesheet.schema;if(!c)return null;const d={};for(const f in c){const _=s.C(f,r.scope),T=r.options.get(_),E=T?T.value||T.default:null;d[f]=E?E.serialize():null}return d}setConfig(t,r){const c=this.getFragmentStyle(t);c&&(c.updateConfig(r,c.stylesheet.schema),this.updateConfigDependencies())}getSchema(t){const r=this.getFragmentStyle(t);return r?r.stylesheet.schema:null}setSchema(t,r){const c=this.getFragmentStyle(t);c&&(c.stylesheet.schema=r,c.updateConfig(c._config,r),this.updateConfigDependencies())}updateConfig(t,r){if(this._config=t,t||r)if(r)for(const c in r){let d,f;const _=s.X(r[c].default);if(_.result==="success"&&(d=_.value.expression),t&&t[c]!==void 0){const C=s.X(t[c]);C.result==="success"&&(f=C.value.expression)}const{minValue:T,maxValue:E,stepValue:M,type:A,values:z}=r[c];if(d){const C=s.C(c,this.scope);this.options.set(C,{default:d,value:f,minValue:T,maxValue:E,stepValue:M,type:A,values:z})}else this.fire(new s.z(new Error(`No schema defined for config option "${c}".`)))}else this.fire(new s.z(new Error("Attempting to set config for a style without schema.")))}updateConfigDependencies(t){for(const r of this._configDependentLayers){const c=this.getLayer(r);if(c){if(t&&!c.configDependencies.has(t))continue;c.possiblyEvaluateVisibility(),this._updateLayer(c)}}this.ambientLight&&this.ambientLight.updateConfig(this.options),this.directionalLight&&this.directionalLight.updateConfig(this.options),this.fog&&this.fog.updateConfig(this.options),this.snow&&this.snow.updateConfig(this.options),this.rain&&this.rain.updateConfig(this.options),this.forEachFragmentStyle(r=>{const c=r._styleColorTheme.colorThemeOverride?r._styleColorTheme.colorThemeOverride:r._styleColorTheme.colorTheme;if(c){const d=r._evaluateColorThemeData(c);(!r._styleColorTheme.lut&&d!==""||r._styleColorTheme.lut&&d!==r._styleColorTheme.lut.data)&&r.setColorTheme(c)}}),this._changes.setDirty()}addLayer(t,r,c={}){this._checkLoaded();const d=t.id;if(this._layers[d])return void this.fire(new s.z(new Error(`Layer with id "${d}" already exists on this map`)));let f;if(t.type==="custom"){if(ds(this,s.cu(t)))return;f=s.cv(t,this.scope,this._styleColorTheme.lut,this.options)}else{if(typeof t.source=="object"&&(this.addSource(d,t.source),t=s.cq(t),t=s.l(t,{source:d})),this._validate(H,`layers.${d}`,t,{arrayIndex:-1},c))return;f=s.cv(t,this.scope,this._styleColorTheme.lut,this.options),this._validateLayer(f),f.setEventedParent(this,{layer:{id:d}})}f.configDependencies.size!==0&&this._configDependentLayers.add(f.fqid);let _=this._order.length;if(r){const A=this._order.indexOf(r);if(A===-1)return void this.fire(new s.z(new Error(`Layer with id "${r}" does not exist on this map.`)));f.slot===this._layers[r].slot?_=A:s.w(`Layer with id "${r}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(_,0,d),this._layerOrderChanged=!0,this._layers[d]=f;const T=this.getOwnLayerSourceCache(f),E=!!this.directionalLight&&this.directionalLight.shadowsEnabled();T&&f.canCastShadows()&&E&&(T.castsShadows=!0);const M=this._changes.getRemovedLayer(f);if(M&&f.source&&T&&f.type!=="custom"){this._changes.discardLayerRemoval(f);const A=s.C(f.source,f.scope);M.type!==f.type?this._changes.updateSourceCache(A,"clear"):(this._changes.updateSourceCache(A,"reload"),T.pause())}this._updateLayer(f),f.onAdd&&f.onAdd(this.map),f.scope=this.scope,this.mergeLayers()}moveLayer(t,r){this._checkLoaded();const c=this._checkLayer(t);if(!c||t===r)return;const d=this._order.indexOf(t);this._order.splice(d,1);let f=this._order.length;if(r){const _=this._order.indexOf(r);if(_===-1)return void this.fire(new s.z(new Error(`Layer with id "${r}" does not exist on this map.`)));c.slot===this._layers[r].slot?f=_:s.w(`Layer with id "${r}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(f,0,t),this._changes.setDirty(),this._layerOrderChanged=!0,this.mergeLayers()}removeLayer(t){this._checkLoaded();const r=this._checkLayer(t);if(!r)return;r.setEventedParent(null);const c=this._order.indexOf(t);this._order.splice(c,1),delete this._layers[t],this._changes.setDirty(),this._layerOrderChanged=!0,this._configDependentLayers.delete(r.fqid),this._changes.removeLayer(r);const d=this.getOwnLayerSourceCache(r);if(d&&d.castsShadows){let f=!1;for(const _ in this._layers)if(this._layers[_].source===r.source&&this._layers[_].canCastShadows()){f=!0;break}d.castsShadows=f}r.onRemove&&r.onRemove(this.map),this.mergeLayers()}getOwnLayer(t){return this._layers[t]}hasLayer(t){return t in this._mergedLayers}hasLayerType(t){for(const r in this._layers)if(this._layers[r].type===t)return!0;return!1}setLayerZoomRange(t,r,c){this._checkLoaded();const d=this._checkLayer(t);d&&(d.minzoom===r&&d.maxzoom===c||(r!=null&&(d.minzoom=r),c!=null&&(d.maxzoom=c),this._updateLayer(d)))}getSlots(){return this._checkLoaded(),this._mergedSlots}setSlot(t,r){this._checkLoaded();const c=this._checkLayer(t);c&&c.slot!==r&&(c.slot=r,this._updateLayer(c))}setFilter(t,r,c={}){this._checkLoaded();const d=this._checkLayer(t);if(d&&!s.bn(d.filter,r))return r==null?(d.filter=void 0,void this._updateLayer(d)):void(this._validate(Z,`layers.${d.id}.filter`,r,{layerType:d.type},c)||(d.filter=s.cq(r),this._updateLayer(d)))}getFilter(t){const r=this._checkLayer(t);if(r)return s.cq(r.filter)}setLayoutProperty(t,r,c,d={}){this._checkLoaded();const f=this._checkLayer(t);if(f&&!s.bn(f.getLayoutProperty(r),c)){if(c!=null&&(!d||d.validate!==!1)&&ds(f,de.call(Vr,{key:`layers.${t}.layout.${r}`,layerType:f.type,objectKey:r,value:c,styleSpec:s.a5,style:{glyphs:!0,sprite:!0}})))return;f.setLayoutProperty(r,c),f.configDependencies.size!==0&&this._configDependentLayers.add(f.fqid),this._updateLayer(f)}}getLayoutProperty(t,r){const c=this._checkLayer(t);if(c)return c.getLayoutProperty(r)}setPaintProperty(t,r,c,d={}){this._checkLoaded();const f=this._checkLayer(t);if(!f||s.bn(f.getPaintProperty(r),c)||c!=null&&(!d||d.validate!==!1)&&ds(f,re.call(Vr,{key:`layers.${t}.paint.${r}`,layerType:f.type,objectKey:r,value:c,styleSpec:s.a5})))return;const _=f.setPaintProperty(r,c);f.configDependencies.size!==0&&this._configDependentLayers.add(f.fqid),_&&this._updateLayer(f),this._changes.updatePaintProperties(f)}getPaintProperty(t,r){const c=this._checkLayer(t);if(c)return c.getPaintProperty(r)}setFeatureState(t,r){if(this._checkLoaded(),"target"in t){if("featuresetId"in t.target){const{featuresetId:E,importId:M}=t.target,A=this.getFragmentStyle(M),z=A.getFeaturesetLayers(E);for(const{source:C,sourceLayer:k}of z)A.setFeatureState({id:t.id,source:C,sourceLayer:k},r)}else if("layerId"in t.target){const{layerId:E}=t.target,M=this.getLayer(E);this.setFeatureState({id:t.id,source:M.source,sourceLayer:M.sourceLayer},r)}return}const c=t.source,d=t.sourceLayer,f=this._checkSource(c);if(!f)return;const _=f.type;if(_==="geojson"&&d)return void this.fire(new s.z(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if(_==="vector"&&!d)return void this.fire(new s.z(new Error("The sourceLayer parameter must be provided for vector source types.")));t.id===void 0&&this.fire(new s.z(new Error("The feature id parameter must be provided.")));const T=this.getOwnSourceCaches(c);for(const E of T)E.setFeatureState(d,t.id,r)}removeFeatureState(t,r){if(this._checkLoaded(),"target"in t){if("featuresetId"in t.target){const{featuresetId:E,importId:M}=t.target,A=this.getFragmentStyle(M),z=A.getFeaturesetLayers(E);for(const{source:C,sourceLayer:k}of z)A.removeFeatureState({id:t.id,source:C,sourceLayer:k},r)}else if("layerId"in t.target){const{layerId:E}=t.target,M=this.getLayer(E);this.removeFeatureState({id:t.id,source:M.source,sourceLayer:M.sourceLayer},r)}return}const c=t.source,d=this._checkSource(c);if(!d)return;const f=d.type,_=f==="vector"?t.sourceLayer:void 0;if(f==="vector"&&!_)return void this.fire(new s.z(new Error("The sourceLayer parameter must be provided for vector source types.")));if(r&&typeof t.id!="string"&&typeof t.id!="number")return void this.fire(new s.z(new Error("A feature id is required to remove its specific state property.")));const T=this.getOwnSourceCaches(c);for(const E of T)E.removeFeatureState(_,t.id,r)}getFeatureState(t){if(this._checkLoaded(),"target"in t){let f;if("featuresetId"in t.target){const{featuresetId:_,importId:T}=t.target,E=this.getFragmentStyle(T),M=E.getFeaturesetLayers(_);for(const{source:A,sourceLayer:z}of M){const C=E.getFeatureState({id:t.id,source:A,sourceLayer:z});if(C&&!f)f=C;else if(!s.bn(f,C))return void this.fire(new s.z(new Error("The same feature id exists in multiple sources in the featureset, but their feature states are not consistent through the sources.")))}}else if("layerId"in t.target){const{layerId:_}=t.target,T=this.getLayer(_);f=this.getFeatureState({id:t.id,source:T.source,sourceLayer:T.sourceLayer})}return f}const r=t.source,c=t.sourceLayer,d=this._checkSource(r);if(d){if(d.type!=="vector"||c)return t.id===void 0&&this.fire(new s.z(new Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(r)[0].getFeatureState(c,t.id);this.fire(new s.z(new Error("The sourceLayer parameter must be provided for vector source types.")))}}setTransition(t){return this.stylesheet.transition=s.l({},this.stylesheet.transition,t),this.transition=this.stylesheet.transition,this}getTransition(){return s.l({},this.stylesheet.transition)}serialize(){this._checkLoaded();const t=this.getTerrain(),r=t&&this.terrain&&this.terrain.scope===this.scope?t:this.stylesheet.terrain;return s.cw({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,fragment:this.stylesheet.fragment,iconsets:this.stylesheet.iconsets,imports:this._serializeImports(),schema:this.stylesheet.schema,camera:this.stylesheet.camera,light:this.stylesheet.light,lights:this.stylesheet.lights,terrain:r,fog:this.stylesheet.fog,snow:this.stylesheet.snow,rain:this.stylesheet.rain,center:this.stylesheet.center,"color-theme":this.stylesheet["color-theme"],zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:this._serializeSources(),layers:this._serializeLayers(this._order)},c=>c!==void 0)}_updateFilteredLayers(t){for(const r of Object.values(this._mergedLayers))t(r)&&this._updateLayer(r)}_updateLayer(t){this._changes.updateLayer(t);const r=this.getLayerSourceCache(t),c=s.C(t.source,t.scope),d=this._changes.getUpdatedSourceCaches();t.source&&!d[c]&&r&&r.getSource().type!=="raster"&&(this._changes.updateSourceCache(c,"reload"),r.pause()),t.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(t){const r=T=>this._mergedLayers[T].is3D(!!this.terrain),c=this.order,d={},f=[];for(let T=c.length-1;T>=0;T--){const E=c[T];if(r(E)){d[E]=T;for(const M of t){const A=M[E];if(A)for(const z of A)f.push(z)}}}f.sort((T,E)=>E.intersectionZ-T.intersectionZ);const _=[];for(let T=c.length-1;T>=0;T--){const E=c[T];if(r(E))for(let M=f.length-1;M>=0;M--){const A=f[M].feature;if(A.layer&&d[A.layer.id]{if(X0.has(A.type))return;const z=this.getOwnLayerSourceCache(A),C=f[z.id]=f[z.id]||{sourceCache:z,layers:{},has3DLayers:!1};A.is3D(!!this.terrain)&&(C.has3DLayers=!0),C.layers[A.fqid]=C.layers[A.fqid]||{styleLayer:A,targets:[]},C.layers[A.fqid].targets.push({filter:d})};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new s.z(new Error("parameters.layers must be an Array."))),[];for(const A of r.layers){const z=this._layers[A];if(!z)return this.fire(new s.z(new Error(`The layer '${A}' does not exist in the map's style and cannot be queried for features.`))),[];_(z)}}else for(const A in this._layers)_(this._layers[A]);const T=this._queryRenderedFeatures(t,f,c),E=this._flattenAndSortRenderedFeatures(T),M=[];for(const A of E)s.ct(A.layer.id)===this.scope&&M.push(A);return M}queryRenderedFeatureset(t,r,c){let d;r&&!Array.isArray(r)&&r.filter&&(this._validate(Z,"queryRenderedFeatures.filter",r.filter,null,r),d=s.a_(r.filter));const f="mock",_=[];if(r&&r.target)_.push(Object.assign({},r,{targetId:f,filter:d}));else{const A=this.getFeaturesetDescriptors();for(const z of A)_.push({targetId:f,filter:d,target:z});for(const{style:z}of this.fragments){const C=z.getFeaturesetDescriptors();for(const k of C)_.push({targetId:f,filter:d,target:k})}}const T=this.queryRenderedTargets(t,_,c),E=[],M=new Set;for(const A of T)for(const z of A.variants[f])ks(z,A,M)||E.push(new s.cx(A,z));return E}queryRenderedTargets(t,r,c){const d={},f=(T,E,M,A)=>{const z=d[E.id]=d[E.id]||{sourceCache:E,layers:{},has3DLayers:!1};if(z.layers[T.fqid]=z.layers[T.fqid]||{styleLayer:T,targets:[]},T.is3D(!!this.terrain)&&(z.has3DLayers=!0),!A)return M.uniqueFeatureID=!1,void z.layers[T.fqid].targets.push(M);z.layers[T.fqid].targets.push(Object.assign({},M,{namespace:A.namespace,properties:A.properties,uniqueFeatureID:A.uniqueFeatureID}))};for(const T of r)if("featuresetId"in T.target){const{featuresetId:E,importId:M}=T.target,A=this.getFragmentStyle(M);if(!A||!A._featuresetSelectors)continue;const z=A._featuresetSelectors[E];if(!z){this.fire(new s.z(new Error(`The featureset '${E}' does not exist in the map's style and cannot be queried for features.`)));continue}for(const C of z){const k=A.getOwnLayer(C.layerId);k&&!X0.has(k.type)&&f(k,A.getOwnLayerSourceCache(k),T,C)}}else if("layerId"in T.target){const{layerId:E}=T.target,M=this.getLayer(E);if(!M||X0.has(M.type))continue;f(M,this.getLayerSourceCache(M),T)}const _=this._queryRenderedFeatures(t,d,c);return this._flattenAndSortRenderedFeatures(_)}_queryRenderedFeatures(t,r,c){const d=[],f=!!this.map._showQueryGeometry,_=hr.createFromScreenPoints(t,c);for(const T in r){const E=r3(_,r[T],this._availableImages,c,f);Object.keys(E).length&&d.push(E)}if(this.placement)for(const T in r){if(!r[T].sourceCache._onlySymbols)continue;const E=hc(_.screenGeometry,r[T],this._availableImages,this.placement.collisionIndex,this.placement.retainedQueryData);Object.keys(E).length&&d.push(E)}return d}querySourceFeatures(t,r){const c=r&&r.filter;c&&this._validate(Z,"querySourceFeatures.filter",c,null,r);let d=[];const f=this.getOwnSourceCaches(t);for(const _ of f)d=d.concat(dc(_,r));return d}addSourceType(t,r,c){return Dn.getSourceType(t)?c(new Error(`A source type called "${t}" already exists.`)):(Dn.setSourceType(t,r),r.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:r.workerSourceURL},c):c(null,null))}getFlatLight(){return this.light.getLight()}setFlatLight(t,r,c={}){this._checkLoaded();const d=this.light.getLight();let f=!1;for(const T in t)if(!s.bn(t[T],d[T])){f=!0;break}if(!f)return;const _=this._getTransitionParameters();this.light.setLight(t,r,c),this.light.updateTransitions(_)}getTerrain(){return this.terrain&&this.terrain.drapeRenderMode===1?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}checkCanvasFingerprintNoise(){this.disableElevatedTerrain===void 0&&(this.disableElevatedTerrain=s.q.hasCanvasFingerprintNoise(),this.disableElevatedTerrain&&s.w("Terrain and hillshade are disabled because of Canvas2D limitations when fingerprinting protection is enabled (e.g. in private browsing mode)."))}setTerrain(t,r=1){if(this._checkLoaded(),!t)return this.terrainSetForDrapingOnly()||(delete this.terrain,this.map.transform.projection.requiresDraping&&this.setTerrainForDraping()),r===0&&delete this.terrain,t===null?this.stylesheet.terrain=null:delete this.stylesheet.terrain,this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);this.checkCanvasFingerprintNoise();let c=t;const d=t.source==null;if(r===1){if(this.disableElevatedTerrain)return;if(typeof c.source=="object"){const T="terrain-dem-src";this.addSource(T,c.source),c=s.cq(c),c=s.l(c,{source:T})}const f=s.l({},c),_={};if(this.terrain&&d){f.source=this.terrain.get().source;const T=this.terrain?this.getFragmentStyle(this.terrain.scope):null;T&&(_.style=T.serialize())}if(this._validate(F0,"terrain",f,_))return}if(!this.terrain||this.terrain.scope!==this.scope&&!d||this.terrain&&r!==this.terrain.drapeRenderMode){if(!c)return;this._createTerrain(c,r),this.fire(new s.A("data",{dataType:"style"}))}else{const f=this.terrain,_=f.get();for(const T of Object.keys(s.a5.terrain))!c.hasOwnProperty(T)&&s.a5.terrain[T].default&&(c[T]=s.a5.terrain[T].default);for(const T in t)if(!s.bn(t[T],_[T])){f.set(t,this.options),this.stylesheet.terrain=t;const E=this._getTransitionParameters({duration:0});f.updateTransitions(E),this.fire(new s.A("data",{dataType:"style"}));break}}this.mergeTerrain(),this.updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(t){const r=this.fog=new Gt(t,this.map.transform,this.scope,this.options);this.stylesheet.fog=r.get();const c=this._getTransitionParameters({duration:0});r.updateTransitions(c)}_createSnow(t){const r=this.snow=new vi(t,this.map.transform,this.scope,this.options);this.stylesheet.snow=r.get();const c=this._getTransitionParameters({duration:0});r.updateTransitions(c)}_createRain(t){const r=this.rain=new Ti(t,this.map.transform,this.scope,this.options);this.stylesheet.rain=r.get();const c=this._getTransitionParameters({duration:0});r.updateTransitions(c)}_updateMarkersOpacity(){this.map._markers.length!==0&&this.map._requestDomTask(()=>{for(const t of this.map._markers)t._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(t){if(this._checkLoaded(),!t)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const r=this.fog;if(!s.bn(r.get(),t)){r.set(t,this.options),this.stylesheet.fog=r.get();const c=this._getTransitionParameters({duration:0});r.updateTransitions(c)}}else this._createFog(t);this._markersNeedUpdate=!0}getSnow(){return this.snow?this.snow.get():null}setSnow(t){if(this._checkLoaded(),!t)return delete this.snow,void delete this.stylesheet.snow;if(this.snow){const r=this.snow;if(!s.bn(r.get(),t)){r.set(t,this.options),this.stylesheet.snow=r.get();const c=this._getTransitionParameters({duration:0});r.updateTransitions(c)}}else this._createSnow(t);this._markersNeedUpdate=!0}getRain(){return this.rain?this.rain.get():null}setRain(t){if(this._checkLoaded(),!t)return delete this.rain,void delete this.stylesheet.rain;if(this.rain){const r=this.rain;if(!s.bn(r.get(),t)){r.set(t,this.options),this.stylesheet.rain=r.get();const c=this._getTransitionParameters({duration:0});r.updateTransitions(c)}}else this._createRain(t);this._markersNeedUpdate=!0}_reloadColorTheme(){const t=()=>{for(const d in this._layers)this._layers[d].lut=this._styleColorTheme.lut;for(const d in this._sourceCaches)this._sourceCaches[d].clearTiles()},r=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(!r)return this._styleColorTheme.lut=null,void t();const c=this._evaluateColorThemeData(r);this._loadColorTheme(c).then(()=>{this.fire(new s.A("colorthemeset")),t()}).catch(d=>{s.w(`Couldn't set color theme: ${d}`)})}setColorTheme(t){this._checkLoaded(),this._styleColorTheme.colorThemeOverride&&s.w("Note: setColorTheme is called on a style with a color-theme override, the passed color-theme won't be visible."),this._styleColorTheme.colorTheme=t,this._reloadColorTheme()}setImportColorTheme(t,r){const c=this.getFragmentStyle(t);c&&(c._styleColorTheme.colorThemeOverride=r,c._reloadColorTheme())}_getTransitionParameters(t){return{now:s.q.now(),transition:s.l(this.transition,t)}}updateDrapeFirstLayers(){if(!this.terrain)return;const t=[],r=[];for(const c of this._mergedOrder)this.isLayerDraped(this._mergedLayers[c])?t.push(c):r.push(c);this._drapedFirstOrder=[],this._drapedFirstOrder.push(...t),this._drapedFirstOrder.push(...r)}_createTerrain(t,r){const c=this.terrain=new Fe(t,r,this.scope,this.options);r===1&&(this.stylesheet.terrain=t),this.mergeTerrain(),this.updateDrapeFirstLayers(),this._force3DLayerUpdate();const d=this._getTransitionParameters({duration:0});c.updateTransitions(d)}_force3DLayerUpdate(){for(const t in this._layers){const r=this._layers[t];r.type==="fill-extrusion"&&this._updateLayer(r)}}_forceSymbolLayerUpdate(){for(const t in this._layers){const r=this._layers[t];r.type==="symbol"&&this._updateLayer(r)}}_validate(t,r,c,d,f={}){if(f&&f.validate===!1)return!1;const _=s.l({},this.serialize());return ds(this,t.call(Vr,s.l({key:r,style:_,value:c,styleSpec:s.a5},d)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),s.cy.off("pluginStateChange",this._rtlTextPluginCallback);for(const t in this._mergedLayers)this._mergedLayers[t].setEventedParent(null);for(const t in this._mergedSourceCaches)this._mergedSourceCaches[t].clearTiles(),this._mergedSourceCaches[t].setEventedParent(null);this.imageManager.removeScope(this.scope),this.setEventedParent(null),delete this.fog,delete this.snow,delete this.rain,delete this.terrain,delete this.ambientLight,delete this.directionalLight,this.isRootStyle()&&(this.imageManager.setEventedParent(null),this.modelManager.setEventedParent(null),this.dispatcher.remove())}clearSource(t){const r=this.getSourceCaches(t);for(const c of r)c.clearTiles()}clearSources(){for(const t in this._mergedSourceCaches)this._mergedSourceCaches[t].clearTiles()}reloadSource(t){const r=this.getSourceCaches(t);for(const c of r)c.resume(),c.reload()}reloadSources(){for(const t of this.getSources())t.reload&&t.reload()}reloadModels(){this.modelManager.reloadModels(""),this.forEachFragmentStyle(t=>{t.modelManager.reloadModels(t.scope)})}updateSources(t){let r;this.directionalLight&&(r=Vo(this.directionalLight));for(const c in this._mergedSourceCaches)this._mergedSourceCaches[c].update(t,void 0,void 0,r)}_generateCollisionBoxes(){for(const t in this._sourceCaches){const r=this._sourceCaches[t];r.resume(),r.reload()}}_updatePlacement(t,r,c,d,f,_,T=!1){let E=!1,M=!1;const A={},z={};for(const C of this._mergedOrder){const k=this._mergedLayers[C];if(k.type!=="symbol")continue;const j=s.C(k.source,k.scope);let N=A[j];if(!N){const $=this.getLayerSourceCache(k);if(!$)continue;const K=$.getRenderableIds(!0).map(ie=>$.getTileByID(ie));z[j]=K.slice(),N=A[j]=K.sort((ie,te)=>te.tileID.overscaledZ-ie.tileID.overscaledZ||(ie.tileID.isLessThan(te.tileID)?-1:1))}const G=this.crossTileSymbolIndex.addLayer(k,N,r.center.lng,r.projection);E=E||G}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._mergedOrder),T=T||this._layerOrderChanged||d===0,this._layerOrderChanged&&this.fire(new s.A("neworder")),(T||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(s.q.now(),r.zoom))&&(this.pauseablePlacement=new Bo(r,this._mergedOrder,T,c,d,f,this.placement,this.fog&&r.projection.supportsFog?this.fog.state:null,this._buildingIndex),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._mergedOrder,this._mergedLayers,A,z,this.map.painter.scaleFactor),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(s.q.now()),M=!0),E&&this.pauseablePlacement.placement.setStale()),M||E){this._buildingIndex.onNewFrame(r.zoom);for(let C=0;Cf===t.id)!==-1)return void this.fire(new s.z(new Error(`Import with id '${t.id}' already exists in the map's style.`)));if(!r)return c.push(t),this._loadImports([t],!0);const d=c.findIndex(({id:f})=>f===r);return d===-1&&this.fire(new s.z(new Error(`Import with id "${r}" does not exist on this map.`))),this.stylesheet.imports=c.slice(0,d).concat(t).concat(c.slice(d)),this._loadImports([t],!0,r)}updateImport(t,r){this._checkLoaded();const c=this.stylesheet.imports||[],d=this.getImportIndex(t);return d===-1?this:typeof r=="string"?(this.setImportUrl(t,r),this):(r.url&&r.url!==c[d].url&&this.setImportUrl(t,r.url),s.bn(r.config,c[d].config)||this.setImportConfig(t,r.config,r.data.schema),s.bn(r.data,c[d].data)||this.setImportData(t,r.data),this)}moveImport(t,r){this._checkLoaded();let c=this.stylesheet.imports||[];const d=this.getImportIndex(t);if(d===-1)return this;const f=this.getImportIndex(r);if(f===-1)return this;const _=c[d],T=this.fragments[d];return c=c.filter(({id:E})=>E!==t),this.fragments=this.fragments.filter(({id:E})=>E!==t),this.stylesheet.imports=c.slice(0,f).concat(_).concat(c.slice(f)),this.fragments=this.fragments.slice(0,f).concat(T).concat(this.fragments.slice(f)),this.mergeLayers(),this}setImportUrl(t,r){this._checkLoaded();const c=this.stylesheet.imports||[],d=this.getImportIndex(t);if(d===-1)return this;c[d].url=r;const f=this.fragments[d];return f.style=this._createFragmentStyle(c[d]),f.style.on("style.import.load",()=>this.mergeAll()),f.style.loadURL(r),this}setImportData(t,r){this._checkLoaded();const c=this.getImportIndex(t),d=this.stylesheet.imports||[];return c===-1?this:r?(this.fragments[c].style.setState(r),this._reloadImports(),this):(delete d[c].data,this.setImportUrl(t,d[c].url))}setImportConfig(t,r,c){this._checkLoaded();const d=this.getImportIndex(t),f=this.stylesheet.imports||[];if(d===-1)return this;r?f[d].config=r:delete f[d].config;const _=this.fragments[d];c&&_.style.stylesheet&&(_.style.stylesheet.schema=c);const T=_.style.stylesheet&&_.style.stylesheet.schema;return _.config=r,_.style.updateConfig(r,T),this.updateConfigDependencies(),this}removeImport(t){this._checkLoaded();const r=this.stylesheet.imports||[],c=this.getImportIndex(t);c!==-1&&(r.splice(c,1),this.fragments[c].style._remove(),this.fragments.splice(c,1),this._reloadImports())}getImportIndex(t){const r=(this.stylesheet.imports||[]).findIndex(c=>c.id===t);return r===-1&&this.fire(new s.z(new Error(`Import '${t}' does not exist in the map's style and cannot be updated.`))),r}getLayer(t){return this._mergedLayers[t]}getSources(){const t=[];for(const r in this._mergedOtherSourceCaches){const c=this._mergedOtherSourceCaches[r];c&&t.push(c.getSource())}return t}getSource(t,r){const c=this.getSourceCache(t,r);return c&&c.getSource()}getLayerSource(t){const r=this.getLayerSourceCache(t);return r&&r.getSource()}getSourceCache(t,r){const c=s.C(t,r);return this._mergedOtherSourceCaches[c]}getLayerSourceCache(t){const r=s.C(t.source,t.scope);return t.type==="symbol"?this._mergedSymbolSourceCaches[r]:this._mergedOtherSourceCaches[r]}getSourceCaches(t){if(t==null)return Object.values(this._mergedSourceCaches);const r=[];return this._mergedOtherSourceCaches[t]&&r.push(this._mergedOtherSourceCaches[t]),this._mergedSymbolSourceCaches[t]&&r.push(this._mergedSymbolSourceCaches[t]),r}updateSourceCaches(){const t=this._changes.getUpdatedSourceCaches();for(const r in t){const c=t[r];c==="reload"?this.reloadSource(r):c==="clear"&&this.clearSource(r)}}updateLayers(t){const r=this._changes.getUpdatedPaintProperties();for(const c of r){const d=this.getLayer(c);d&&d.updateTransitions(t)}}getGlyphsUrl(){return this.stylesheet.glyphs}setGlyphsUrl(t){this.stylesheet.glyphs=t,this.glyphManager.setURL(t,this.scope)}getImages(t,r,c){this.imageManager.getImages(r.images,r.scope,c),this._updateTilesForChangedImages();const d=_=>{if(_){const T=r.images.map(E=>s.I.toString(E));_.setDependencies(r.tileID.key,r.type,T)}},f=s.C(r.source,r.scope);d(this._mergedOtherSourceCaches[f]),d(this._mergedSymbolSourceCaches[f])}rasterizeImages(t,r,c){this.imageManager.rasterizeImages(r,c)}getGlyphs(t,r,c){this.glyphManager.getGlyphs(r.stacks,r.scope,c)}getResource(t,r,c){return s.cz(r,c)}getOwnSourceCache(t){return this._otherSourceCaches[t]}getOwnLayerSourceCache(t){return t.type==="symbol"?this._symbolSourceCaches[t.source]:this._otherSourceCaches[t.source]}getOwnSourceCaches(t){const r=[];return this._otherSourceCaches[t]&&r.push(this._otherSourceCaches[t]),this._symbolSourceCaches[t]&&r.push(this._symbolSourceCaches[t]),r}_isSourceCacheLoaded(t){const r=this.getOwnSourceCaches(t);return r.length===0?(this.fire(new s.z(new Error(`There is no source with ID '${t}'`))),!1):r.every(c=>c.loaded())}has3DLayers(){return this._has3DLayers}hasSymbolLayers(){return this._hasSymbolLayers}hasCircleLayers(){return this._hasCircleLayers}isLayerClipped(t,r){if(!this._clipLayerPresent&&t.type!=="fill-extrusion")return!1;const c=t.type==="fill-extrusion"&&t.sourceLayer==="building";if(t.is3D(!!this.terrain)){if(c||r&&r.type==="batched-model"||t.type==="model")return!0}else if(t.type==="symbol")return!0;return!1}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.fragments.forEach(t=>{t.style._remove()}),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}Dn.getSourceType=function(u){return i3[u]},Dn.setSourceType=function(u,t){i3[u]=t},Dn.registerForPluginStateChange=s.ci;var f3=` #define EPSILON 0.0000001 #define PI 3.141592653589793 #ifdef RENDER_CUTOFF float cutoff_opacity(vec4 cutoff_params,float depth) {float near=cutoff_params.x;float far=cutoff_params.y;float cutoffStart=cutoff_params.z;float cutoffEnd=cutoff_params.w;float linearDepth=(depth-near)/(far-near);return clamp((linearDepth-cutoffStart)/(cutoffEnd-cutoffStart),0.0,1.0);} #endif`,Y0=` out vec4 glFragColor;highp float unpack_depth(highp vec4 rgba_depth) {const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;} #ifdef INDICATOR_CUTOUT uniform vec3 u_indicator_cutout_centers;uniform vec4 u_indicator_cutout_params; #endif vec4 applyCutout(vec4 color,float height) { #ifdef INDICATOR_CUTOUT float verticalFadeRange=u_indicator_cutout_centers.z*0.25;float holeMinOpacity=mix(1.0,u_indicator_cutout_params.x,smoothstep(u_indicator_cutout_centers.z,u_indicator_cutout_centers.z+verticalFadeRange,height));float holeRadius=max(u_indicator_cutout_params.y,0.0);float holeAspectRatio=u_indicator_cutout_params.z;float fadeStart=u_indicator_cutout_params.w;float distA=distance(vec2(gl_FragCoord.x,gl_FragCoord.y*holeAspectRatio),vec2(u_indicator_cutout_centers[0],u_indicator_cutout_centers[1]*holeAspectRatio));return color*min(smoothstep(fadeStart,holeRadius,distA)+holeMinOpacity,1.0); #else return color; #endif } #ifdef DEBUG_WIREFRAME #define HANDLE_WIREFRAME_DEBUG \\ glFragColor=vec4(0.7,0.0,0.0,0.7); \\ gl_FragDepth=gl_FragCoord.z-0.0001; #else #define HANDLE_WIREFRAME_DEBUG #endif #ifdef RENDER_CUTOFF uniform highp vec4 u_cutoff_params;in float v_cutoff_opacity; #endif vec4 textureLodCustom(sampler2D image,highp vec2 pos,highp vec2 lod_coord) {highp vec2 size=vec2(textureSize(image,0));highp vec2 dx=dFdx(lod_coord.xy*size);highp vec2 dy=dFdy(lod_coord.xy*size);highp float delta_max_sqr=max(dot(dx,dx),dot(dy,dy));highp float lod=0.5*log2(delta_max_sqr);return textureLod(image,pos,lod);}vec4 applyLUT(highp sampler3D lut,vec4 col) {vec3 size=vec3(textureSize(lut,0));vec3 uvw=(col.rbg*float(size-1.0)+0.5)/size;return vec4(texture(lut,uvw).rgb,col.a);}vec3 applyLUT(highp sampler3D lut,vec3 col) {return applyLUT(lut,vec4(col,1.0)).rgb;}`,Ka=` #define EXTENT 8192.0 #define RAD_TO_DEG 180.0/PI #define DEG_TO_RAD PI/180.0 #define GLOBE_RADIUS EXTENT/PI/2.0 float wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;} #ifdef PROJECTION_GLOBE_VIEW vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) { #ifndef PROJECTED_POS_ON_VIEWPORT float tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz; #else return vec3(0.0); #endif }vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);} #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 vec2 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 (units_to_pixels*pos+offset)/pattern_size;}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) {return get_pattern_pos(pixel_coord_upper,pixel_coord_lower,pattern_size,vec2(tile_units_to_pixels),pos);}float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(PI/4.0+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);} #ifdef RENDER_CUTOFF uniform vec4 u_cutoff_params;out float v_cutoff_opacity; #endif const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt) {float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}`,K0="in highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;out highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",Uo=` #define ELEVATION_SCALE 7.0 #define ELEVATION_OFFSET 450.0 #ifdef PROJECTION_GLOBE_VIEW uniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix( mix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;} #else vec3 elevationVector(vec2 pos) { return vec3(0,0,1); } #endif #ifdef TERRAIN uniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float currentElevation(vec2 apos) { #ifdef TERRAIN_DEM_FLOAT_FORMAT vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem,pos).r; #else float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(dd,0)).r;float bl=texture(u_dem,pos+vec2(0,dd)).r;float br=texture(u_dem,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); #endif }float prevElevation(vec2 apos) { #ifdef TERRAIN_DEM_FLOAT_FORMAT vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem_prev,pos).r; #else float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem_prev,pos).r;float tr=texture(u_dem_prev,pos+vec2(dd,0)).r;float bl=texture(u_dem_prev,pos+vec2(0,dd)).r;float br=texture(u_dem_prev,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); #endif } #ifdef TERRAIN_VERTEX_MORPHING float elevation(vec2 apos) { #ifdef ZERO_EXAGGERATION return 0.0; #endif float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);} #else float elevation(vec2 apos) { #ifdef ZERO_EXAGGERATION return 0.0; #endif return currentElevation(apos);} #endif vec4 fourSample(vec2 pos,vec2 off) {float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(off.x,0.0)).r;float bl=texture(u_dem,pos+vec2(0.0,off.y)).r;float br=texture(u_dem,pos+off).r;return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);} #else float elevation(vec2 pos) { return 0.0; } #endif #ifdef DEPTH_OCCLUSION uniform highp sampler2D u_depth;uniform highp vec2 u_depth_size_inv;uniform highp vec2 u_depth_range_unpack;uniform highp float u_occluder_half_size;uniform highp float u_occlusion_depth_offset; #ifdef DEPTH_D24 float unpack_depth(float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}vec4 unpack_depth4(vec4 depth) {return depth*u_depth_range_unpack.x+vec4(u_depth_range_unpack.y);} #else highp float unpack_depth_rgba(vec4 rgba_depth) {const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;} #endif bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w; #ifdef DEPTH_D24 float depth=unpack_depth(texture(u_depth,(coord.xy+1.0)*0.5).r); #else float depth=unpack_depth_rgba(texture(u_depth,(coord.xy+1.0)*0.5)); #endif return coord.z+u_occlusion_depth_offset > depth;}highp vec4 getCornerDepths(vec2 coord) {highp vec3 df=vec3(u_occluder_half_size*u_depth_size_inv,0.0);highp vec2 uv=0.5*coord.xy+0.5; #ifdef DEPTH_D24 highp vec4 depth=vec4( texture(u_depth,uv-df.xz).r,texture(u_depth,uv+df.xz).r,texture(u_depth,uv-df.zy).r,texture(u_depth,uv+df.zy).r );depth=unpack_depth4(depth); #else highp vec4 depth=vec4( unpack_depth_rgba(texture(u_depth,uv-df.xz)),unpack_depth_rgba(texture(u_depth,uv+df.xz)),unpack_depth_rgba(texture(u_depth,uv-df.zy)),unpack_depth_rgba(texture(u_depth,uv+df.zy)) ); #endif return depth;}highp float occlusionFadeMultiSample(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec2 uv=0.5*coord.xy+0.5;int NX=3;int NY=4;highp vec2 df=u_occluder_half_size*u_depth_size_inv;highp vec2 oneStep=2.0*u_occluder_half_size*u_depth_size_inv/vec2(NX-1,NY-1);highp float res=0.0;for (int y=0; y < NY;++y) {for (int x=0; x < NX;++x) { #ifdef DEPTH_D24 highp float depth=unpack_depth(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)).r); #else highp float depth=unpack_depth_rgba(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y))); #endif res+=1.0-clamp(300.0*(coord.z+u_occlusion_depth_offset-depth),0.0,1.0);}}res=clamp(2.0*res/float(NX*NY)-0.5,0.0,1.0);return res;}highp float occlusionFade(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec4 depth=getCornerDepths(coord.xy);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z+u_occlusion_depth_offset)-depth),0.0,1.0));} #else bool isOccluded(vec4 frag) { return false; }highp float occlusionFade(vec4 frag) { return 1.0; }highp float occlusionFadeMultiSample(vec4 frag) { return 1.0; } #endif//DEPTH_OCCLUSION`,J0=`#ifdef FOG uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;out vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);} #endif`,m3=`#ifdef FOG uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump vec2 u_fog_vertical_limit;uniform mediump float u_fog_temporal_offset;in vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos,float opacity_limit) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,min(opacity,opacity_limit));}vec3 fog_apply(vec3 color,vec3 pos) {return fog_apply(color,pos,1.0);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec4 fog_apply_premultiplied(vec4 color,vec3 pos,float heightMeters) {float verticalProgress=(u_fog_vertical_limit.x > 0.0 || u_fog_vertical_limit.y > 0.0) ? smoothstep(u_fog_vertical_limit.x,u_fog_vertical_limit.y,heightMeters) : 0.0;float opacityLimit=1.0-smoothstep(0.9,1.0,fog_opacity(pos));return mix(fog_apply_premultiplied(color,pos),color,min(verticalProgress,opacityLimit));}vec3 fog_dither(vec3 color) {return color;}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);} #endif`,ps=`#ifdef RASTER_ARRAY uniform highp sampler2D u_image0;uniform sampler2D u_image1;const vec4 NODATA=vec4(1);ivec4 _raTexLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}vec2 _raTexLinearMix(highp vec2 fxy,highp vec4 colorMix,highp float colorOffset,highp vec4 t00,highp vec4 t10,highp vec4 t01,highp vec4 t11) {vec2 c00=t00==NODATA ? vec2(0) : vec2(colorOffset+dot(t00,colorMix),1);vec2 c10=t10==NODATA ? vec2(0) : vec2(colorOffset+dot(t10,colorMix),1);vec2 c01=t01==NODATA ? vec2(0) : vec2(colorOffset+dot(t01,colorMix),1);vec2 c11=t11==NODATA ? vec2(0) : vec2(colorOffset+dot(t11,colorMix),1);return mix(mix(c01,c11,fxy.x),mix(c00,c10,fxy.x),fxy.y);}vec2 raTexture2D_image0_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image0,c.yz,0),texelFetch(u_image0,c.xz,0),texelFetch(u_image0,c.yw,0),texelFetch(u_image0,c.xw,0) );}vec2 raTexture2D_image1_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image1,c.yz,0),texelFetch(u_image1,c.xz,0),texelFetch(u_image1,c.yw,0),texelFetch(u_image1,c.xw,0) );}vec2 raTexture2D_image0_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image0,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}vec2 raTexture2D_image1_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image1,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);} #endif`,Ys=`#ifdef RASTER_ARRAY uniform sampler2D u_velocity;uniform mediump vec2 u_velocity_res;uniform mediump float u_max_speed;const vec4 NO_DATA=vec4(1);const vec2 INVALID_VELOCITY=vec2(-1);uniform highp vec2 u_uv_offset;uniform highp float u_data_offset;uniform highp vec2 u_data_scale;ivec4 rasterArrayLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}highp vec2 lookup_velocity(highp vec2 uv) {uv=u_uv_offset.x+u_uv_offset.y*uv;highp vec2 fxy;ivec4 c=rasterArrayLinearCoord(uv,u_velocity_res,fxy);highp vec4 tl=texelFetch(u_velocity,c.yz,0);highp vec4 tr=texelFetch(u_velocity,c.xz,0);highp vec4 bl=texelFetch(u_velocity,c.yw,0);highp vec4 br=texelFetch(u_velocity,c.xw,0);if (tl==NO_DATA) {return INVALID_VELOCITY;}if (tr==NO_DATA) {return INVALID_VELOCITY;}if (bl==NO_DATA) {return INVALID_VELOCITY;}if (br==NO_DATA) {return INVALID_VELOCITY;}highp vec4 t=mix(mix(bl,br,fxy.x),mix(tl,tr,fxy.x),fxy.y);highp vec2 velocity=u_data_offset+vec2(dot(t.rg,u_data_scale),dot(t.ba,u_data_scale));velocity.y=-velocity.y;velocity/=max(u_max_speed,length(velocity));return velocity;} #endif uniform highp float u_particle_pos_scale;uniform highp vec2 u_particle_pos_offset;highp vec4 pack_pos_to_rgba(highp vec2 p) {highp vec2 v=(p+u_particle_pos_offset)/u_particle_pos_scale;highp vec4 r=vec4(v.x,fract(v.x*255.0),v.y,fract(v.y*255.0));return vec4(r.x-r.y/255.0,r.y,r.z-r.w/255.0,r.w);}highp vec2 unpack_pos_from_rgba(highp vec4 v) {v=floor(v*255.0+0.5)/255.0;highp vec2 p=vec2(v.x+(v.y/255.0),v.z+(v.w/255.0));return u_particle_pos_scale*p-u_particle_pos_offset;}`,Ja=`#ifdef RENDER_SHADOWS uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_normal_offset;vec3 shadow_normal_offset(vec3 normal) {float tileInMeters=u_shadow_normal_offset[0];vec3 n=vec3(-normal.xy,tileInMeters*normal.z);float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return n*dotScale;}vec3 shadow_normal_offset_model(vec3 normal) {vec3 transformed_normal=vec3(-normal.xy,normal.z);float NDotL=dot(normalize(transformed_normal),u_shadow_direction);float dotScale=min(1.0-NDotL,1.0)*0.5+0.5;return normal*dotScale;}float shadow_normal_offset_multiplier0() {return u_shadow_normal_offset[1];}float shadow_normal_offset_multiplier1() {return u_shadow_normal_offset[2];} #endif//RENDER_SHADOWS`,Qa=`#ifdef RENDER_SHADOWS #ifdef DEPTH_TEXTURE uniform highp sampler2D u_shadowmap_0;uniform highp sampler2D u_shadowmap_1; #else uniform sampler2D u_shadowmap_0;uniform sampler2D u_shadowmap_1; #endif uniform float u_shadow_intensity;uniform float u_shadow_map_resolution;uniform float u_shadow_texel_size;uniform highp vec3 u_shadow_normal_offset;uniform vec2 u_fade_range;uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_bias;highp float shadow_sample_1(highp vec2 uv,highp float compare) {highp float shadow_depth; #ifdef DEPTH_TEXTURE shadow_depth=texture(u_shadowmap_1,uv).r; #else shadow_depth=unpack_depth(texture(u_shadowmap_1,uv))*0.5+0.5; #endif return step(shadow_depth,compare);}highp float shadow_sample_0(highp vec2 uv,highp float compare) {highp float shadow_depth; #ifdef DEPTH_TEXTURE shadow_depth=texture(u_shadowmap_0,uv).r; #else shadow_depth=unpack_depth(texture(u_shadowmap_0,uv))*0.5+0.5; #endif return step(shadow_depth,compare);}float shadow_occlusion_1(highp vec4 pos,highp float bias) {highp vec2 uv=pos.xy;return shadow_sample_1(uv,pos.z-bias);}float shadow_occlusion_0(highp vec4 pos,highp float bias) {highp float compare0=pos.z-bias; #ifdef TEXTURE_GATHER highp vec2 uv=pos.xy;highp vec4 samples=textureGather(u_shadowmap_0,uv,0);lowp vec4 stepSamples=step(samples,vec4(compare0)); #else highp vec2 uv00=pos.xy-vec2(0.5*u_shadow_texel_size);highp vec2 uv10=uv00+vec2(u_shadow_texel_size,0.0);highp vec2 uv01=uv00+vec2(0.0,u_shadow_texel_size);highp vec2 uv11=uv01+vec2(u_shadow_texel_size,0.0);lowp vec4 stepSamples=vec4( shadow_sample_0(uv01,compare0),shadow_sample_0(uv11,compare0),shadow_sample_0(uv10,compare0),shadow_sample_0(uv00,compare0) ); #endif vec2 f=fract(pos.xy*u_shadow_map_resolution-vec2(0.5));lowp vec2 lerpx=mix(stepSamples.wx,stepSamples.zy,f.xx);return clamp(mix(lerpx.x,lerpx.y,f.y),0.0,1.0);}float shadow_occlusion(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,highp float bias) { #ifdef SHADOWS_SINGLE_CASCADE light_view_pos0.xyz/=light_view_pos0.w;vec2 abs_bounds=abs(light_view_pos0.xy);if (abs_bounds.x >=1.0 || abs_bounds.y >=1.0) {return 0.0;}light_view_pos0.xyz=light_view_pos0.xyz*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias); #else light_view_pos0.xyz/=light_view_pos0.w;light_view_pos1.xyz/=light_view_pos1.w;vec4 uv=vec4(light_view_pos0.xy,light_view_pos1.xy);vec4 abs_bounds=abs(uv);if (abs_bounds.x < 1.0 && abs_bounds.y < 1.0) {light_view_pos0.xyz=light_view_pos0.xyz*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias);}if (abs_bounds.z >=1.0 || abs_bounds.w >=1.0) {return 0.0;}light_view_pos1.xyz=light_view_pos1.xyz*0.5+0.5;float occlusion1=shadow_occlusion_1(light_view_pos1,bias);return clamp(mix(occlusion1,0.0,smoothstep(u_fade_range.x,u_fade_range.y,view_depth)),0.0,1.0); #endif }highp float calculate_shadow_bias(float NDotL) { #ifdef NORMAL_OFFSET return 0.5*u_shadow_bias.x; #else return 0.5*(u_shadow_bias.x+clamp(u_shadow_bias.y*tan(acos(NDotL)),0.0,u_shadow_bias.z)); #endif }float shadowed_light_factor_normal(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_opacity(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,float shadow_opacity) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias)*shadow_opacity;return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_unbiased(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}highp vec2 compute_receiver_plane_depth_bias(highp vec3 pos_dx,highp vec3 pos_dy) {highp vec2 biasUV=vec2( pos_dy.y*pos_dx.z-pos_dx.y*pos_dy.z,pos_dx.x*pos_dy.z-pos_dy.x*pos_dx.z);biasUV*=1.0/((pos_dx.x*pos_dy.y)-(pos_dx.y*pos_dy.x));return biasUV;}float shadowed_light_factor_plane_bias(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {highp vec3 light_view_pos0_xyz=light_view_pos0.xyz/light_view_pos0.w*0.5+0.5;highp vec3 light_view_pos0_ddx=dFdx(light_view_pos0_xyz);highp vec3 light_view_pos0_ddy=dFdy(light_view_pos0_xyz);highp vec2 plane_depth_bias=compute_receiver_plane_depth_bias(light_view_pos0_ddx,light_view_pos0_ddy);highp float bias=dot(vec2(u_shadow_texel_size,u_shadow_texel_size),plane_depth_bias)+0.0001;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadowed_light_factor(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadow_occlusion(float ndotl,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=calculate_shadow_bias(ndotl);return shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);} #endif`;const uo=[];$n(f3,uo),$n(Ka,uo),$n(Y0,uo);const fs={"_prelude_fog.vertex.glsl":J0,"_prelude_terrain.vertex.glsl":Uo,"_prelude_shadow.vertex.glsl":Ja,"_prelude_fog.fragment.glsl":m3,"_prelude_shadow.fragment.glsl":Qa,"_prelude_lighting.glsl":` #ifdef LIGHTING_3D_MODE uniform mediump vec3 u_lighting_ambient_color;uniform mediump vec3 u_lighting_directional_dir;uniform mediump vec3 u_lighting_directional_color;uniform mediump vec3 u_ground_radiance;float calculate_ambient_directional_factor(vec3 normal) {float NdotL=dot(normal,u_lighting_directional_dir);const float factor_reduction_max=0.3;float dir_luminance=dot(u_lighting_directional_color,vec3(0.2126,0.7152,0.0722));float directional_factor_min=1.0-factor_reduction_max*min(dir_luminance,1.0);float ambient_directional_factor=mix(directional_factor_min,1.0,min((NdotL+1.0),1.0));const float vertical_factor_min=0.92;float vertical_factor=mix(vertical_factor_min,1.0,normal.z*0.5+0.5);return vertical_factor*ambient_directional_factor;}vec3 linearProduct(vec3 srgbIn,vec3 k) {return srgbIn*pow(k,vec3(1./2.2));}vec3 apply_lighting(vec3 color,vec3 normal,float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return linearProduct(color,ambient_contrib+directional_contrib);}vec4 apply_lighting(vec4 color,vec3 normal,float dir_factor) {return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting(vec3 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return apply_lighting(color.rgb,normal,dir_factor);}vec4 apply_lighting(vec4 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting_ground(vec3 color) {return color*u_ground_radiance;}vec4 apply_lighting_ground(vec4 color) {return vec4(apply_lighting_ground(color.rgb),color.a);}float calculate_NdotL(vec3 normal) {const float ext=0.70710678118;return (clamp(dot(normal,u_lighting_directional_dir),-ext,1.0)+ext)/(1.0+ext);}vec4 apply_lighting_with_emission_ground(vec4 color,float emissive_strength) {return mix(apply_lighting_ground(color),color,emissive_strength);}vec3 compute_flood_lighting(vec3 flood_light_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=flood_light_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);float occlusion_ramp=smoothstep(0.0,0.2,1.0-occlusion);return mix(fully_occluded_color,flood_light_color,occlusion_ramp);}vec3 compute_emissive_draped(vec3 unlit_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=unlit_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);return mix(fully_occluded_color,unlit_color,1.0-occlusion);} #endif//LIGHTING_3D_MODE`,"_prelude_raster_array.glsl":ps,"_prelude_raster_particle.glsl":Ys},Ks={};ei("",Uo),ei(m3,J0),ei(Qa,Ja),ei(ps,""),ei(Ys,"");const _3=ei(Y0,Ka),Q0=f3;var e0={background:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_lighting.glsl" uniform vec4 u_color;uniform float u_opacity; #ifdef LIGHTING_3D_MODE in vec4 v_color; #endif void main() {vec4 out_color; #ifdef LIGHTING_3D_MODE out_color=v_color; #else out_color=u_color; #endif #ifdef FOG out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); #endif glFragColor=out_color*u_opacity; #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" #include "_prelude_lighting.glsl" in vec2 a_pos;uniform mat4 u_matrix; #ifdef LIGHTING_3D_MODE uniform mediump vec4 u_color;out vec4 v_color;uniform float u_emissive_strength; #endif void main() {gl_Position=u_matrix*vec4(a_pos,0,1); #ifdef LIGHTING_3D_MODE v_color=apply_lighting_with_emission_ground(u_color,u_emissive_strength); #endif #ifdef FOG v_fog_pos=fog_position(a_pos); #endif }`),backgroundPattern:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_lighting.glsl" uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform float u_emissive_strength;uniform sampler2D u_image;in highp vec2 v_pos;void main() {highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=textureLodCustom(u_image,pos,v_pos); #ifdef LIGHTING_3D_MODE out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); #endif #ifdef FOG out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); #endif glFragColor=out_color*u_opacity; #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec2 u_pattern_units_to_pixels;in vec2 a_pos;out highp vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_pattern_units_to_pixels,a_pos); #ifdef FOG v_fog_pos=fog_position(a_pos); #endif }`),circle:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_lighting.glsl" in vec3 v_data;in 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 uniform float u_emissive_strength;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 blur_positive=blur < 0.0 ? 0.0 : 1.0;lowp float antialiasblur=v_data.z;float extrude_length=length(extrude)+antialiasblur*(1.0-blur_positive);float antialiased_blur=-max(abs(blur),antialiasblur);float antialiase_blur_opacity=smoothstep(0.0,antialiasblur,extrude_length-1.0);float opacity_t=blur_positive==1.0 ? smoothstep(0.0,-antialiased_blur,1.0-extrude_length) : smoothstep(antialiased_blur,0.0,extrude_length-1.0)-antialiase_blur_opacity;float color_t=stroke_width < 0.01 ? 0.0 : smoothstep( antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width) );vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t); #ifdef LIGHTING_3D_MODE out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); #endif #ifdef FOG out_color=fog_apply_premultiplied(out_color,v_fog_pos); #endif glFragColor=out_color*(v_visibility*opacity_t); #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif }`,`#include "_prelude_fog.vertex.glsl" #include "_prelude_terrain.vertex.glsl" #define NUM_VISIBILITY_RINGS 2 #define INV_SQRT2 0.70710678 #define ELEVATION_BIAS 0.0001 #define NUM_SAMPLES_PER_RING 16 uniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;in vec2 a_pos; #ifdef PROJECTION_GLOBE_VIEW in vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; #endif #ifdef ELEVATED_ROADS in float a_circle_z_offset; #endif out vec3 v_data;out 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 vec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) { #if defined(TERRAIN) return elevation(pos)+ELEVATION_BIAS; #else return 0.0; #endif }vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale); #ifdef PITCH_WITH_MAP #ifdef PROJECTION_GLOBE_VIEW return u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) ); #else return u_matrix*( world_center+vec4(sample_offset,0,0) ); #endif #else return projected_center+vec4(sample_offset,0,0); #endif }float get_sample_step() { #ifdef PITCH_WITH_MAP return 2.0*PI/float(NUM_SAMPLES_PER_RING); #else return PI/float(NUM_SAMPLES_PER_RING); #endif }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);vec4 world_center;mat3 surface_vectors; #ifdef PROJECTION_GLOBE_VIEW vec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1); #else surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1); #endif #ifdef ELEVATED_ROADS world_center.z+=a_circle_z_offset+ELEVATION_BIAS; #endif vec4 projected_center=u_matrix*world_center;float view_scale=0.0; #ifdef PITCH_WITH_MAP #ifdef SCALE_WITH_MAP view_scale=1.0; #else view_scale=projected_center.w/u_camera_to_center_distance; #endif #else #ifdef SCALE_WITH_MAP view_scale=u_camera_to_center_distance; #else view_scale=projected_center.w; #endif #endif gl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0; #ifdef TERRAIN float step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center; #ifdef PITCH_WITH_MAP float cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center; #else occlusion_world_center=world_center;occlusion_projected_center=projected_center; #endif for(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING); #else visibility=1.0; #endif #ifdef PROJECTION_GLOBE_VIEW visibility=1.0; #endif v_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur); #ifdef FOG v_fog_pos=fog_position(world_center.xyz); #endif }`),clippingMask:ei("void main() {glFragColor=vec4(1.0);}","in vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:ei(`#include "_prelude_fog.fragment.glsl" uniform highp float u_intensity;in 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);glFragColor=vec4(val,1.0,1.0,1.0); #ifdef FOG if (u_is_globe==0) {glFragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);} #endif #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_terrain.vertex.glsl" #include "_prelude_fog.vertex.glsl" uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;in vec2 a_pos; #ifdef PROJECTION_GLOBE_VIEW in vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; #endif out 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;vec2 tilePos=floor(a_pos*0.5);vec3 pos; #ifdef PROJECTION_GLOBE_VIEW vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); #else pos=vec3(tilePos+extrude,elevation(tilePos)); #endif gl_Position=u_matrix*vec4(pos,1); #ifdef FOG v_fog_pos=fog_position(pos); #endif }`),heatmapTexture:ei(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));glFragColor=color*u_opacity; #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(0.0); #endif HANDLE_WIREFRAME_DEBUG;}`,"in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:ei("in float v_placed;in float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);glFragColor =mix(red,blue,step(0.5,v_placed))*0.5;glFragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",`#include "_prelude_terrain.vertex.glsl" in vec3 a_pos;in vec2 a_anchor_pos;in vec2 a_extrude;in vec2 a_placed;in vec2 a_shift;in vec2 a_elevation_from_sea;in float a_size_scale;in vec2 a_padding;in float a_auto_z_offset;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;out float v_placed;out float v_notUsed;void main() {float feature_elevation=a_elevation_from_sea.x+a_auto_z_offset;float terrain_elevation=(a_elevation_from_sea.y==1.0 ? 0.0 : elevation(a_anchor_pos));vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*(feature_elevation+terrain_elevation),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,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}`),collisionCircle:ei("in float v_radius;in vec2 v_extrude;in float v_perspective_ratio;in 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);glFragColor=color*alpha*opacity_t;}",`in vec2 a_pos_2f;in float a_radius;in vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;out float v_radius;out vec2 v_extrude;out float v_perspective_ratio;out 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_2f;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:ei("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);glFragColor=mix(u_color,overlay_color,overlay_color.a);}",`#include "_prelude_terrain.vertex.glsl" in vec2 a_pos; #ifdef PROJECTION_GLOBE_VIEW in vec3 a_pos_3; #endif out vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0; #ifdef PROJECTION_GLOBE_VIEW gl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1); #else gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1); #endif }`),elevatedStructuresDepth:ei(`void main() { #ifndef DEPTH_TEXTURE glFragColor=vec4(0.); #endif }`,"in vec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform float u_depth_bias;void main() {gl_Position=u_matrix*vec4(a_pos,a_height,1);gl_Position.z=gl_Position.z+u_depth_bias;}"),elevatedStructuresDepthReconstruct:ei(`#ifdef DEPTH_RECONSTRUCTION in float v_height; #endif void main() { #ifdef DEPTH_RECONSTRUCTION if (v_height >=0.0) discard; #endif glFragColor=vec4(1.0,0.0,0.0,1.0);}`,`in vec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform vec3 u_camera_pos;uniform highp float u_depth_bias;uniform lowp float u_height_scale;uniform lowp float u_reset_depth; #ifdef DEPTH_RECONSTRUCTION out float v_height; #endif void main() {vec3 vpos=vec3(a_pos,a_height*u_height_scale); #ifdef DEPTH_RECONSTRUCTION if (u_camera_pos.z > vpos.z) {vpos-=(u_camera_pos-vpos)*(vpos.z/(u_camera_pos.z-vpos.z));}v_height=a_height; #endif gl_Position=u_matrix*vec4(vpos,1);gl_Position.z=u_reset_depth==1.0 ? gl_Position.w : gl_Position.z+u_depth_bias;}`),elevatedStructures:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_lighting.glsl" #include "_prelude_shadow.fragment.glsl" in vec3 v_normal;in float v_height; #ifdef RENDER_SHADOWS in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth; #endif void main() {vec3 color=vec3(241.0/255.0,236.0/255.0,225.0/255.0); #ifdef LIGHTING_3D_MODE vec3 normal=normalize(v_normal); #ifdef RENDER_SHADOWS float shadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,v_depth);color.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor); #else color=apply_lighting(color,normal); #endif if (v_height < 0.0) {float penetration=max(v_height+7.5,0.0);float occlusion=1.0-1.0/PI*acos(1.0-penetration/4.0);color=color*(1.0-pow(occlusion,2.0)*0.3);} #endif #ifdef FOG color=fog_apply(color,v_fog_pos); #endif vec4 out_color=vec4(color,1.0); #ifdef INDICATOR_CUTOUT out_color=applyCutout(out_color,v_height); #endif glFragColor=out_color;HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" #include "_prelude_shadow.vertex.glsl" in vec2 a_pos;in float a_height;in vec3 a_pos_normal_3;uniform mat4 u_matrix;out vec3 v_normal;out float v_height; #ifdef RENDER_SHADOWS uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth; #endif void main() {v_normal=a_pos_normal_3/16384.0;v_height=a_height;vec3 pos=vec3(a_pos,a_height);gl_Position=u_matrix*vec4(pos,1); #ifdef RENDER_SHADOWS vec3 shd_pos0=pos;vec3 shd_pos1=pos; #ifdef NORMAL_OFFSET vec3 offset=shadow_normal_offset(v_normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); #endif v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; #endif #ifdef FOG v_fog_pos=fog_position(a_pos); #endif }`),fill:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_lighting.glsl" #include "_prelude_shadow.fragment.glsl" #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity uniform float u_emissive_strength; #ifdef RENDER_SHADOWS uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; #endif #ifdef INDICATOR_CUTOUT in highp float v_z_offset; #endif void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity vec4 out_color=color; #ifdef LIGHTING_3D_MODE out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); #ifdef RENDER_SHADOWS float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); #endif #endif #ifdef FOG out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); #endif out_color*=opacity; #ifdef INDICATOR_CUTOUT if (v_z_offset >=0.0) {out_color=applyCutout(out_color,v_z_offset);} #endif glFragColor=out_color; #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" #include "_prelude_shadow.vertex.glsl" in vec2 a_pos; #ifdef ELEVATED_ROADS in float a_road_z_offset; #endif #ifdef RENDER_SHADOWS uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; #endif #ifdef INDICATOR_CUTOUT out highp float v_z_offset; #endif uniform mat4 u_matrix; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity #pragma mapbox: define highp float z_offset void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize highp float z_offset #ifdef ELEVATED_ROADS z_offset+=a_road_z_offset; #endif float hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden); #ifdef RENDER_SHADOWS vec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset); #ifdef NORMAL_OFFSET vec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); #endif v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; #endif #ifdef FOG v_fog_pos=fog_position(a_pos); #endif #ifdef INDICATOR_CUTOUT v_z_offset=z_offset; #endif }`),fillOutline:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_lighting.glsl" #include "_prelude_shadow.fragment.glsl" in highp vec2 v_pos;uniform float u_emissive_strength; #ifdef RENDER_SHADOWS uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; #endif #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);vec4 out_color=outline_color; #ifdef LIGHTING_3D_MODE out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); #ifdef RENDER_SHADOWS float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); #endif #endif #ifdef FOG out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); #endif glFragColor=out_color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" #include "_prelude_shadow.vertex.glsl" in vec2 a_pos; #ifdef ELEVATED_ROADS in float a_road_z_offset; #endif #ifdef RENDER_SHADOWS uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; #endif uniform mat4 u_matrix;uniform vec2 u_world;out highp vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity #pragma mapbox: define highp float z_offset void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize highp float z_offset #ifdef ELEVATED_ROADS z_offset+=a_road_z_offset; #endif float hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; #ifdef RENDER_SHADOWS vec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset); #ifdef NORMAL_OFFSET vec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); #endif v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; #endif #ifdef FOG v_fog_pos=fog_position(a_pos); #endif }`),fillOutlinePattern:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_lighting.glsl" #include "_prelude_shadow.fragment.glsl" uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_emissive_strength; #ifdef RENDER_SHADOWS uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; #endif in highp vec2 v_pos;in highp vec2 v_pos_world; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=textureLodCustom(u_image,pos,lod_pos); #ifdef LIGHTING_3D_MODE out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); #ifdef RENDER_SHADOWS float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); #endif #endif #ifdef FOG out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); #endif glFragColor=out_color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" #include "_prelude_shadow.vertex.glsl" uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos; #ifdef ELEVATED_ROADS in float a_road_z_offset; #endif #ifdef RENDER_SHADOWS uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; #endif out highp vec2 v_pos;out highp vec2 v_pos_world; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern #pragma mapbox: define lowp float pixel_ratio #pragma mapbox: define highp float z_offset void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern #pragma mapbox: initialize lowp float pixel_ratio #pragma mapbox: initialize highp float z_offset vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw; #ifdef ELEVATED_ROADS z_offset+=a_road_z_offset; #endif float hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; #ifdef RENDER_SHADOWS vec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset); #ifdef NORMAL_OFFSET vec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); #endif v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; #endif #ifdef FOG v_fog_pos=fog_position(a_pos); #endif }`),fillPattern:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_lighting.glsl" #include "_prelude_shadow.fragment.glsl" uniform vec2 u_texsize;uniform sampler2D u_image;in highp vec2 v_pos;uniform float u_emissive_strength; #ifdef RENDER_SHADOWS uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; #endif #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos); #ifdef LIGHTING_3D_MODE out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); #ifdef RENDER_SHADOWS float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); #endif #endif #ifdef FOG out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); #endif glFragColor=out_color*opacity; #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" #include "_prelude_shadow.vertex.glsl" uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos; #ifdef ELEVATED_ROADS in float a_road_z_offset; #endif #ifdef RENDER_SHADOWS uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; #endif out highp vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern #pragma mapbox: define lowp float pixel_ratio #pragma mapbox: define highp float z_offset void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern #pragma mapbox: initialize lowp float pixel_ratio #pragma mapbox: initialize highp float z_offset vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio; #ifdef ELEVATED_ROADS z_offset+=a_road_z_offset; #endif float hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos); #ifdef RENDER_SHADOWS vec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset); #ifdef NORMAL_OFFSET vec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); #endif v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; #endif #ifdef FOG v_fog_pos=fog_position(a_pos); #endif }`),fillExtrusion:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_shadow.fragment.glsl" #include "_prelude_lighting.glsl" in vec4 v_color;in vec4 v_flat; #ifdef RENDER_SHADOWS in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1; #endif uniform lowp float u_opacity; #ifdef FAUX_AO uniform lowp vec2 u_ao;in vec2 v_ao; #endif #if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE) in vec4 v_roof_color; #endif #if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE) in highp vec3 v_normal; #endif uniform vec3 u_flood_light_color;uniform highp float u_vertical_scale;uniform float u_flood_light_intensity;uniform vec3 u_ground_shadow_factor; #if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT) in float v_flood_radius;in float v_has_floodlight; #endif in float v_height; #pragma mapbox: define highp float emissive_strength void main() { #pragma mapbox: initialize highp float emissive_strength #if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE) vec3 normal=normalize(v_normal); #endif float z;vec4 color=v_color; #ifdef ZERO_ROOF_RADIUS z=float(normal.z > 0.00001); #ifdef LIGHTING_3D_MODE normal=mix(normal,vec3(0.0,0.0,1.0),z); #else color=mix(v_color,v_roof_color,z); #endif #endif float h=max(0.0,v_height);float ao_shade=1.0; #ifdef FAUX_AO float intensity=u_ao[0];float h_floors=h/(u_ao[1]*u_vertical_scale);float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);ao_shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x; #ifdef ZERO_ROOF_RADIUS concave*=(1.0-z); #endif float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);ao_shade*=mix(1.0,x_shade*x_shade*x_shade,concave); #ifdef LIGHTING_3D_MODE #ifdef FLOOD_LIGHT color.rgb*=mix(ao_shade,1.0,v_has_floodlight); #else color.rgb*=ao_shade; #endif #else color.rgb*=ao_shade; #endif #endif #ifdef LIGHTING_3D_MODE float flood_radiance=0.0; #ifdef FLOOD_LIGHT flood_radiance=(1.0-min(h/v_flood_radius,1.0))*u_flood_light_intensity*v_has_floodlight; #endif #ifdef RENDER_SHADOWS #ifdef FLOOD_LIGHT float ndotl_unclamped=dot(normal,u_shadow_direction);float ndotl=max(0.0,ndotl_unclamped);float occlusion=ndotl_unclamped < 0.0 ? 1.0 : shadow_occlusion(ndotl,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 litColor=apply_lighting(color.rgb,normal,(1.0-u_shadow_intensity*occlusion)*ndotl);vec3 floodLitColor=compute_flood_lighting(u_flood_light_color*u_opacity,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=mix(litColor,floodLitColor,flood_radiance); #else float shadowed_lighting_factor; #ifdef RENDER_CUTOFF shadowed_lighting_factor=shadowed_light_factor_normal_opacity(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;} #else shadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w); #endif color.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor); #endif #else color.rgb=apply_lighting(color.rgb,normal); #ifdef FLOOD_LIGHT color.rgb=mix(color.rgb,u_flood_light_color*u_opacity,flood_radiance); #endif #endif color.rgb=mix(color.rgb,v_flat.rgb,emissive_strength);color*=u_opacity; #endif #ifdef FOG color=fog_dither(fog_apply_premultiplied(color,v_fog_pos,h)); #endif #ifdef INDICATOR_CUTOUT color=applyCutout(color,h); #endif glFragColor=color; #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" #include "_prelude_terrain.vertex.glsl" #include "_prelude_shadow.vertex.glsl" #include "_prelude_lighting.glsl" 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;uniform float u_edge_radius;uniform float u_width_scale;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos; #ifdef RENDER_WALL_MODE in vec3 a_join_normal_inside; #endif #ifdef PROJECTION_GLOBE_VIEW in vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; #endif #ifdef TERRAIN uniform int u_height_type;uniform int u_base_type; #endif uniform highp float u_vertical_scale;out vec4 v_color;out vec4 v_flat; #ifdef RENDER_SHADOWS uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1; #endif #if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE) out vec4 v_roof_color; #endif #if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE) out highp vec3 v_normal; #endif #ifdef FAUX_AO uniform lowp vec2 u_ao;out vec2 v_ao; #endif #if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT) out float v_flood_radius;out float v_has_floodlight; #endif out float v_height;vec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));} #pragma mapbox: define highp float base #pragma mapbox: define highp float height #pragma mapbox: define highp vec4 color #pragma mapbox: define highp float flood_light_wall_radius #pragma mapbox: define highp float line_width #pragma mapbox: define highp float emissive_strength void main() { #pragma mapbox: initialize highp float base #pragma mapbox: initialize highp float height #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize highp float flood_light_wall_radius #pragma mapbox: initialize highp float line_width #pragma mapbox: initialize highp float emissive_strength base*=u_vertical_scale;height*=u_vertical_scale;vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0)); #if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE) v_normal=normal; #endif base=max(0.0,base);float attr_height=height;height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0); #if defined(HAS_CENTROID) || defined(TERRAIN) centroid_pos=a_centroid_pos; #endif float ele=0.0;float h=0.0;float c_ele=0.0;vec3 pos; #ifdef TERRAIN bool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h); #else h=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h); #endif #ifdef PROJECTION_GLOBE_VIEW float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); #endif float cutoff=1.0;vec3 scaled_pos=pos; #ifdef RENDER_CUTOFF vec3 centroid_random=vec3(centroid_pos.xy,centroid_pos.x+centroid_pos.y+1.0);vec3 ground_pos=centroid_pos.x==0.0 ? pos.xyz : (centroid_random/8.0);vec4 ground=u_matrix*vec4(ground_pos.xy,ele,1.0);cutoff=cutoff_opacity(u_cutoff_params,ground.z);if (centroid_pos.y !=0.0 && centroid_pos.x !=0.0) {vec3 g=floor(ground_pos);vec3 mod_=centroid_random-g*8.0;float seed=min(1.0,0.1*(min(3.5,max(mod_.x+mod_.y,0.2*attr_height))*0.35+mod_.z));if (cutoff < 0.8-seed) {cutoff=0.0;}}float cutoff_scale=cutoff;v_cutoff_opacity=cutoff;scaled_pos.z=mix(c_ele,h,cutoff_scale); #endif float hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (cutoff==0.0 && centroid_pos.x !=0.0) || (color.a==0.0)); #ifdef RENDER_WALL_MODE vec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);scaled_pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;scaled_pos.xy-=a_join_normal_inside.z*wall_offset*0.5; #endif gl_Position=mix(u_matrix*vec4(scaled_pos,1),AWAY,hidden);h=h-ele;v_height=h; #ifdef RENDER_SHADOWS vec3 shd_pos0=pos;vec3 shd_pos1=pos; #ifdef NORMAL_OFFSET vec3 offset=shadow_normal_offset(normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1(); #endif v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1); #endif float NdotL=0.0;float colorvalue=0.0; #ifndef LIGHTING_3D_MODE colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);if (normal.y !=0.0) {float r=0.84;r=mix(0.7,0.98,1.0-u_lightintensity);NdotL*=( (1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));} #endif #ifdef FAUX_AO float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; #ifdef TERRAIN top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); #endif v_ao=vec2(mix(concave,-concave,start),y_ground);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); #ifdef PROJECTION_GLOBE_VIEW top_height+=u_height_lift; #endif gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; #endif #ifdef LIGHTING_3D_MODE #ifdef FLOOD_LIGHT float is_wall=1.0-float(t > 0.0 && top_up_ny.y > 0.0);v_has_floodlight=float(flood_light_wall_radius > 0.0 && is_wall > 0.0);v_flood_radius=flood_light_wall_radius*u_vertical_scale; #endif v_color=vec4(color.rgb,1.0);float ndotl=calculate_NdotL(normal);v_flat.rgb=sRGBToLinear(color.rgb);v_flat.rgb=v_flat.rgb*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);v_flat=vec4(linearTosRGB(v_flat.rgb),1.0); #else v_color=vec4(0.0,0.0,0.0,1.0);v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity; #endif #if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE) float roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color=vec4(0.0,0.0,0.0,1.0);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_roof_color*=u_opacity; #endif #ifdef FOG v_fog_pos=fog_position(pos); #endif }`),fillExtrusionDepth:ei(`in highp float v_depth;void main() { #ifndef DEPTH_TEXTURE glFragColor=pack_depth(v_depth); #endif }`,`#include "_prelude_terrain.vertex.glsl" uniform mat4 u_matrix;uniform float u_edge_radius;uniform float u_width_scale;uniform float u_vertical_scale; #ifdef TERRAIN uniform int u_height_type;uniform int u_base_type; #endif in vec4 a_pos_normal_ed;in vec2 a_centroid_pos; #ifdef RENDER_WALL_MODE in vec3 a_join_normal_inside; #endif #pragma mapbox: define highp float base #pragma mapbox: define highp float height #pragma mapbox: define highp float line_width #pragma mapbox: define highp vec4 color out highp float v_depth;void main() { #pragma mapbox: initialize highp float base #pragma mapbox: initialize highp float height #pragma mapbox: initialize highp float line_width #pragma mapbox: initialize highp vec4 color base*=u_vertical_scale;height*=u_vertical_scale;vec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0); #if defined(HAS_CENTROID) || defined(TERRAIN) centroid_pos=a_centroid_pos; #endif vec3 pos; #ifdef TERRAIN bool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;float ele=elevation(pos_nx.xy);float c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);float h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h); #else pos=vec3(pos_nx.xy,t > 0.0 ? height : base); #endif #ifdef RENDER_WALL_MODE vec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;pos.xy-=a_join_normal_inside.z*wall_offset*0.5; #endif float hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);v_depth=gl_Position.z/gl_Position.w;}`),fillExtrusionPattern:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_lighting.glsl" uniform vec2 u_texsize;uniform sampler2D u_image; #ifdef FAUX_AO uniform lowp vec2 u_ao;in vec3 v_ao; #endif #ifdef LIGHTING_3D_MODE in vec3 v_normal; #endif in highp vec2 v_pos;in vec4 v_lighting;uniform lowp float u_opacity; #pragma mapbox: define highp float base #pragma mapbox: define highp float height #pragma mapbox: define mediump vec4 pattern #pragma mapbox: define highp float pixel_ratio void main() { #pragma mapbox: initialize highp float base #pragma mapbox: initialize highp float height #pragma mapbox: initialize mediump vec4 pattern #pragma mapbox: initialize highp float pixel_ratio vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos); #ifdef LIGHTING_3D_MODE out_color=apply_lighting(out_color,normalize(v_normal))*u_opacity; #else out_color=out_color*v_lighting; #endif #ifdef FAUX_AO float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade; #endif #ifdef FOG out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); #endif #ifdef INDICATOR_CUTOUT out_color=applyCutout(out_color,height); #endif glFragColor=out_color; #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" #include "_prelude_terrain.vertex.glsl" #include "_prelude_lighting.glsl" uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_width_scale;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos; #ifdef RENDER_WALL_MODE in vec3 a_join_normal_inside; #endif #ifdef PROJECTION_GLOBE_VIEW in vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; #endif #ifdef TERRAIN uniform int u_height_type;uniform int u_base_type; #endif out highp vec2 v_pos;out vec4 v_lighting; #ifdef FAUX_AO uniform lowp vec2 u_ao;out vec3 v_ao; #endif #ifdef LIGHTING_3D_MODE out vec3 v_normal; #endif #pragma mapbox: define highp float base #pragma mapbox: define highp float height #pragma mapbox: define highp vec4 color #pragma mapbox: define mediump vec4 pattern #pragma mapbox: define highp float pixel_ratio #pragma mapbox: define highp float line_width void main() { #pragma mapbox: initialize highp float base #pragma mapbox: initialize highp float height #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize mediump vec4 pattern #pragma mapbox: initialize highp float pixel_ratio #pragma mapbox: initialize highp float line_width vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0); #if defined(HAS_CENTROID) || defined(TERRAIN) centroid_pos=a_centroid_pos; #endif float ele=0.0;float h=z;vec3 p;float c_ele; #ifdef TERRAIN bool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;p=vec3(pos_nx.xy,h); #else p=vec3(pos_nx.xy,z); #endif #ifdef PROJECTION_GLOBE_VIEW float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); #endif #ifdef RENDER_WALL_MODE vec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);p.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;p.xy-=a_join_normal_inside.z*wall_offset*0.5; #endif float hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0 ? pos_nx.xy : vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0; #ifdef LIGHTING_3D_MODE NdotL=calculate_NdotL(normal); #else NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL); #endif if (normal.y !=0.0) {float r=0.84; #ifndef LIGHTING_3D_MODE r=mix(0.7,0.98,1.0-u_lightintensity); #endif NdotL*=( (1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));} #ifdef FAUX_AO float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; #ifdef TERRAIN top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); #endif v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); #ifdef PROJECTION_GLOBE_VIEW top_height+=u_height_lift; #endif gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; #endif #ifdef LIGHTING_3D_MODE v_normal=normal; #else v_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity; #endif #ifdef FOG v_fog_pos=fog_position(p); #endif }`),groundShadow:ei(`#include "_prelude_shadow.fragment.glsl" precision highp float;uniform vec3 u_ground_shadow_factor;in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1; #ifdef FOG in float v_fog_opacity; #endif void main() {float light=shadowed_light_factor_plane_bias(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 shadow=mix(u_ground_shadow_factor,vec3(1.0),light); #ifdef RENDER_CUTOFF shadow=mix(vec3(1.0),shadow,cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w)); #endif #ifdef FOG shadow=mix(shadow,vec3(1.0),v_fog_opacity); #endif #ifdef INDICATOR_CUTOUT shadow=mix(shadow,vec3(1.0),1.0-applyCutout(vec4(1.0),0.0).r); #endif glFragColor=vec4(shadow,1.0);}`,`#include "_prelude_fog.vertex.glsl" uniform mat4 u_matrix;uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;in vec2 a_pos;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1; #ifdef FOG out float v_fog_opacity; #endif void main() {gl_Position=u_matrix*vec4(a_pos,0.0,1.0);v_pos_light_view_0=u_light_matrix_0*vec4(a_pos,0.0,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(a_pos,0.0,1.0); #ifdef FOG v_fog_pos=fog_position(a_pos);v_fog_opacity=fog(v_fog_pos); #endif }`),fillExtrusionGroundEffect:ei(`uniform highp float u_ao_pass;uniform highp float u_opacity;uniform highp float u_flood_light_intensity;uniform highp vec3 u_flood_light_color;uniform highp float u_attenuation;uniform sampler2D u_fb;uniform float u_fb_size; #ifdef SDF_SUBPASS in highp vec2 v_pos;in highp vec4 v_line_segment;in highp float v_flood_light_radius_tile;in highp vec2 v_ao;float line_df(highp vec2 a,highp vec2 b,highp vec2 p) {highp vec2 ba=b-a;highp vec2 pa=p-a;highp float r=clamp(dot(pa,ba)/dot(ba,ba),0.0,1.0);return length(pa-r*ba);} #ifdef FOG in highp float v_fog; #endif #endif void main() { #ifdef CLEAR_SUBPASS vec4 color=vec4(1.0); #ifdef CLEAR_FROM_TEXTURE color=texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size)); #endif glFragColor=color; #else #ifdef SDF_SUBPASS highp float d=line_df(v_line_segment.xy,v_line_segment.zw,v_pos);highp float effect_radius=mix(v_flood_light_radius_tile,v_ao.y,u_ao_pass);d/=effect_radius;d=min(d,1.0);d=1.0-pow(1.0-d,u_attenuation);highp float effect_intensity=mix(u_flood_light_intensity,v_ao.x,u_ao_pass);highp float fog=1.0; #ifdef FOG fog=v_fog; #endif #ifdef RENDER_CUTOFF fog*=v_cutoff_opacity; #endif glFragColor=vec4(vec3(0.0),mix(1.0,d,effect_intensity*u_opacity*fog)); #else vec4 color=mix(vec4(u_flood_light_color,1.0),vec4(vec3(0.0),1.0),u_ao_pass); #ifdef OVERDRAW_INSPECTOR color=vec4(1.0); #endif glFragColor=color; #endif HANDLE_WIREFRAME_DEBUG; #endif }`,`#include "_prelude_fog.vertex.glsl" in highp vec4 a_pos_end;in highp float a_angular_offset_factor;in highp float a_hidden_by_landmark; #ifdef SDF_SUBPASS out highp vec2 v_pos;out highp vec4 v_line_segment;out highp float v_flood_light_radius_tile;out highp vec2 v_ao; #ifdef FOG out highp float v_fog; #endif #endif uniform highp float u_flood_light_intensity;uniform highp mat4 u_matrix;uniform highp float u_ao_pass;uniform highp float u_meter_to_tile;uniform highp float u_edge_radius;uniform highp float u_dynamic_offset;uniform highp vec2 u_ao; #pragma mapbox: define highp float flood_light_ground_radius const float TANGENT_CUTOFF=4.0;const float NORM=32767.0;void main() { #pragma mapbox: initialize highp float flood_light_ground_radius vec2 p=a_pos_end.xy;vec2 q=floor(a_pos_end.zw*0.5);vec2 start_bottom=a_pos_end.zw-q*2.0;float fl_ground_radius=flood_light_ground_radius;fl_ground_radius=abs(flood_light_ground_radius);float direction=flood_light_ground_radius < 0.0 ?-1.0 : 1.0;float flood_radius_tile=fl_ground_radius*u_meter_to_tile;vec2 v=normalize(q-p);float ao_radius=u_ao.y/3.5;float effect_radius=mix(flood_radius_tile,ao_radius,u_ao_pass)+u_edge_radius;float angular_offset_factor=a_angular_offset_factor/NORM*TANGENT_CUTOFF;float angular_offset=direction*angular_offset_factor*effect_radius;float top=1.0-start_bottom.y;float side=(0.5-start_bottom.x)*2.0;vec2 extrusion_parallel=v*side*mix(u_dynamic_offset,angular_offset,top);vec2 perp=vec2(v.y,-v.x);vec2 extrusion_perp=direction*perp*effect_radius*top;vec3 pos=vec3(mix(q,p,start_bottom.x),0.0);pos.xy+=extrusion_parallel+extrusion_perp; #ifdef SDF_SUBPASS v_pos=pos.xy;v_line_segment=vec4(p,q)+perp.xyxy*u_edge_radius;v_flood_light_radius_tile=flood_radius_tile;v_ao=vec2(u_ao.x,ao_radius); #ifdef FOG v_fog_pos=fog_position(pos);v_fog=1.0-fog(v_fog_pos); #endif #endif float hidden_by_landmark=0.0; #ifdef HAS_CENTROID hidden_by_landmark=a_hidden_by_landmark; #endif float isFloodlit=float(fl_ground_radius > 0.0 && u_flood_light_intensity > 0.0);float hidden=mix(1.0-isFloodlit,isFloodlit,u_ao_pass);hidden+=hidden_by_landmark;gl_Position=mix(u_matrix*vec4(pos,1.0),AWAY,float(hidden > 0.0)); #ifdef RENDER_CUTOFF v_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z); #endif }`),hillshadePrepare:ei(`precision highp float;uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;float getElevation(vec2 coord) {return texture(u_image,coord).r/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));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+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c) )/pow(2.0,exaggeration+(19.2562-u_zoom));glFragColor=clamp(vec4( deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out 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:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_lighting.glsl" uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;uniform float u_emissive_strength;void main() {vec4 pixel=texture(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);glFragColor=accent_color*(1.0-shade_color.a)+shade_color; #ifdef LIGHTING_3D_MODE glFragColor=apply_lighting_with_emission_ground(glFragColor,u_emissive_strength); #endif #ifdef FOG glFragColor=fog_dither(fog_apply_premultiplied(glFragColor,v_fog_pos)); #endif #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" uniform mat4 u_matrix;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0; #ifdef FOG v_fog_pos=fog_position(a_pos); #endif }`),line:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_lighting.glsl" #include "_prelude_shadow.fragment.glsl" uniform lowp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_floor_width_scale;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec3 v_uv; #ifdef ELEVATED_ROADS in highp float v_road_z_offset; #endif #ifdef RENDER_LINE_DASH uniform sampler2D u_dash_image;in vec2 v_tex; #endif #ifdef RENDER_LINE_GRADIENT uniform sampler2D u_gradient_image; #endif #ifdef INDICATOR_CUTOUT in highp float v_z_offset; #endif #ifdef RENDER_SHADOWS uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; #endif float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}uniform float u_emissive_strength; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float floorwidth #pragma mapbox: define lowp vec4 dash #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float border_width #pragma mapbox: define lowp vec4 border_color float linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float floorwidth #pragma mapbox: initialize lowp vec4 dash #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float border_width #pragma mapbox: initialize lowp vec4 border_color float dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*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); #ifdef RENDER_LINE_DASH float sdfdist=texture(u_dash_image,v_tex).r;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;float scaled_floorwidth=(floorwidth*u_floor_width_scale);alpha*=linearstep(0.5-sdfgamma/scaled_floorwidth,0.5+sdfgamma/scaled_floorwidth,sdfdist); #endif highp vec4 out_color; #ifdef RENDER_LINE_GRADIENT out_color=texture(u_gradient_image,v_uv.xy); #else out_color=color; #endif float trim_alpha=1.0; #ifdef RENDER_LINE_TRIM_OFFSET highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);out_color=mix(out_color,u_trim_color,transition_factor);trim_alpha=1.0-transition_factor;} #endif if (u_alpha_discard_threshold !=0.0) {if (alpha < u_alpha_discard_threshold) {discard;}} #ifdef RENDER_LINE_BORDER float edgeBlur=((border_width*u_width_scale)+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);if (border_color.a==0.0) {float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}} else {out_color=mix(border_color*trim_alpha,out_color,smoothAlpha);}} #endif #ifdef LIGHTING_3D_MODE out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength); #ifdef RENDER_SHADOWS float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth); #ifdef ELEVATED_ROADS out_color.rgb*=mix(v_road_z_offset > 0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light); #else out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); #endif #endif #endif #ifdef FOG out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); #endif out_color*=(alpha*opacity); #ifdef INDICATOR_CUTOUT out_color=applyCutout(out_color,v_z_offset); #endif glFragColor=out_color; #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" #include "_prelude_shadow.vertex.glsl" #include "_prelude_terrain.vertex.glsl" #define EXTRUDE_SCALE 0.015873016 in vec2 a_pos_normal;in vec4 a_data; #if defined(ELEVATED) || defined(ELEVATED_ROADS) || defined(VARIABLE_LINE_WIDTH) in vec3 a_z_offset_width; #endif #if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) in highp vec3 a_packed; #endif #ifdef RENDER_LINE_DASH in float a_linesofar; #endif uniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;uniform float u_width_scale;uniform highp float u_floor_width_scale; #ifdef ELEVATED uniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) { #ifdef ELEVATION_REFERENCE_SEA return 0.0; #else return elevation(apos); #endif } #endif out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec3 v_uv; #ifdef ELEVATED_ROADS out highp float v_road_z_offset; #endif #ifdef RENDER_LINE_DASH uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;out vec2 v_tex; #endif #ifdef RENDER_LINE_GRADIENT uniform float u_image_height; #endif #ifdef INDICATOR_CUTOUT out highp float v_z_offset; #endif #ifdef RENDER_SHADOWS uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; #endif #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float floorwidth #pragma mapbox: define lowp vec4 dash #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 border_width #pragma mapbox: define lowp vec4 border_color void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float floorwidth #pragma mapbox: initialize lowp vec4 dash #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 border_width #pragma mapbox: initialize lowp vec4 border_color float a_z_offset; #if defined(ELEVATED) || defined(ELEVATED_ROADS) a_z_offset=a_z_offset_width.x; #endif 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;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; #ifdef VARIABLE_LINE_WIDTH float left=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);halfwidth=(u_width_scale*(left==1.0 ? a_z_offset_width.y : a_z_offset_width.z))/2.0; #else halfwidth=(u_width_scale*width)/2.0; #endif offset=-1.0*offset*u_width_scale;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*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy; #ifdef ELEVATED_ROADS v_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude; #else #ifdef ELEVATED vec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0; #ifdef CROSS_SLOPE_VERTICAL float top=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+a_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0); #else #ifdef CROSS_SLOPE_HORIZONTAL float ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+a_z_offset; #else float ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+a_z_offset; #endif #endif gl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden); #else gl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden); #endif #endif #ifdef ELEVATED_ROADS #ifdef RENDER_SHADOWS vec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos; #ifdef NORMAL_OFFSET vec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1(); #endif v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; #endif #endif #ifndef RENDER_TO_TEXTURE float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=max(length(projected_extrude_xy/gl_Position.w*u_units_to_pixels),0.001);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur)); #else v_gamma_scale=1.0; #endif #if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) highp float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float line_progress=a_packed[2]; #ifdef RENDER_LINE_GRADIENT highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec3(a_uv_x,a_split_index*texel_height-half_texel_height,line_progress); #else v_uv=vec3(a_uv_x,0.0,line_progress); #endif #endif #ifdef RENDER_LINE_DASH float scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/(floorwidth*u_floor_width_scale),(-normal.y*height+dash.x+0.5)/u_texsize.y); #endif v_width2=vec2(outset,inset); #ifdef FOG v_fog_pos=fog_position(pos); #endif #ifdef INDICATOR_CUTOUT v_z_offset=a_z_offset; #endif }`),linePattern:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_lighting.glsl" #include "_prelude_shadow.fragment.glsl" uniform highp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_alpha_discard_threshold;uniform highp vec2 u_texsize;uniform highp float u_tile_units_to_pixels;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in highp float v_linesofar;in float v_gamma_scale;in float v_width; #ifdef RENDER_LINE_TRIM_OFFSET in highp vec3 v_uv; #endif #ifdef ELEVATED_ROADS in highp float v_road_z_offset; #endif #ifdef LINE_JOIN_NONE in vec2 v_pattern_data; #endif #ifdef INDICATOR_CUTOUT in highp float v_z_offset; #endif #ifdef RENDER_SHADOWS uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth; #endif uniform float u_emissive_strength; #pragma mapbox: define mediump vec4 pattern #pragma mapbox: define mediump float pixel_ratio #pragma mapbox: define mediump float blur #pragma mapbox: define mediump float opacity void main() { #pragma mapbox: initialize mediump vec4 pattern #pragma mapbox: initialize mediump float pixel_ratio #pragma mapbox: initialize mediump float blur #pragma mapbox: initialize mediump float opacity vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;highp float pattern_size=display_size.x/u_tile_units_to_pixels;float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*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);highp float pattern_x=v_linesofar/pattern_size*aspect;highp float x=mod(pattern_x,1.0);highp float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;highp vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));highp vec2 lod_pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(pattern_x,y));vec4 color=textureLodCustom(u_image,pos,lod_pos); #ifdef RENDER_LINE_TRIM_OFFSET highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);color=mix(color,color.a*u_trim_color,transition_factor);} #endif #ifdef LINE_JOIN_NONE highp float pattern_len=pattern_size/aspect;highp float segment_phase=pattern_len-mod(v_linesofar-v_pattern_data.x+pattern_len,pattern_len);highp float visible_start=segment_phase-step(pattern_len*0.5,segment_phase)*pattern_len;highp float visible_end=floor((v_pattern_data.y-segment_phase)/pattern_len)*pattern_len+segment_phase;visible_end+=step(pattern_len*0.5,v_pattern_data.y-visible_end)*pattern_len;if (v_pattern_data.x < visible_start || v_pattern_data.x >=visible_end) {color=vec4(0.0);} #endif #ifdef LIGHTING_3D_MODE color=apply_lighting_with_emission_ground(color,u_emissive_strength); #ifdef RENDER_SHADOWS float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth); #ifdef ELEVATED_ROADS color.rgb*=mix(v_road_z_offset > 0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light); #else color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light); #endif #endif #endif #ifdef FOG color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); #endif color*=(alpha*opacity);if (u_alpha_discard_threshold !=0.0) {if (color.a < u_alpha_discard_threshold) {discard;}} #ifdef INDICATOR_CUTOUT color=applyCutout(color,v_z_offset); #endif glFragColor=color; #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" #include "_prelude_shadow.vertex.glsl" #include "_prelude_terrain.vertex.glsl" #define scale 0.015873016 in vec2 a_pos_normal;in vec4 a_data; #if defined(ELEVATED) || defined(ELEVATED_ROADS) in vec3 a_z_offset_width; #endif #ifdef RENDER_LINE_TRIM_OFFSET in highp vec3 a_packed; #endif in highp float a_linesofar; #ifdef LINE_JOIN_NONE in highp vec3 a_pattern_data;out vec2 v_pattern_data; #endif #ifdef INDICATOR_CUTOUT out highp float v_z_offset; #endif uniform mat4 u_matrix;uniform float u_tile_units_to_pixels;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform float u_device_pixel_ratio;uniform float u_width_scale;uniform float u_floor_width_scale; #ifdef ELEVATED uniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) { #ifdef ELEVATION_REFERENCE_SEA return 0.0; #else return elevation(apos); #endif } #endif out vec2 v_normal;out vec2 v_width2;out highp float v_linesofar;out float v_gamma_scale;out float v_width; #ifdef RENDER_LINE_TRIM_OFFSET out highp vec3 v_uv; #endif #ifdef ELEVATED_ROADS out highp float v_road_z_offset; #endif #ifdef RENDER_SHADOWS uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth; #endif #pragma mapbox: define mediump float blur #pragma mapbox: define mediump float opacity #pragma mapbox: define mediump float offset #pragma mapbox: define mediump float gapwidth #pragma mapbox: define mediump float width #pragma mapbox: define mediump float floorwidth #pragma mapbox: define mediump vec4 pattern #pragma mapbox: define mediump float pixel_ratio void main() { #pragma mapbox: initialize mediump float blur #pragma mapbox: initialize mediump float opacity #pragma mapbox: initialize mediump float offset #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize mediump float width #pragma mapbox: initialize mediump float floorwidth #pragma mapbox: initialize mediump vec4 pattern #pragma mapbox: initialize mediump float pixel_ratio float a_z_offset; #if defined(ELEVATED) || defined(ELEVATED_ROADS) a_z_offset=a_z_offset_width.x; #endif 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;vec2 pos=floor(a_pos_normal*0.5);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=(u_width_scale*width)/2.0;offset=-1.0*offset*u_width_scale;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);vec2 dist=outset*a_extrude*scale;float u=0.5*a_direction;float t=1.0-abs(u);vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy; #ifdef ELEVATED_ROADS v_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude; #else #ifdef ELEVATED vec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0; #ifdef CROSS_SLOPE_VERTICAL float top=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+a_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0); #else #ifdef CROSS_SLOPE_HORIZONTAL float ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+a_z_offset; #else float ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+a_z_offset; #endif #endif gl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden); #else gl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden); #endif #endif #ifdef ELEVATED_ROADS #ifdef RENDER_SHADOWS vec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos; #ifdef NORMAL_OFFSET vec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1(); #endif v_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w; #endif #endif #ifndef RENDER_TO_TEXTURE 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=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur)); #else v_gamma_scale=1.0; #endif #ifdef RENDER_LINE_TRIM_OFFSET highp float a_uv_x=a_packed[0];highp float line_progress=a_packed[2];v_uv=vec3(a_uv_x,0.0,line_progress); #endif v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=(floorwidth*u_floor_width_scale); #ifdef LINE_JOIN_NONE v_width=(floorwidth*u_floor_width_scale)+ANTIALIASING;mediump float pixels_to_tile_units=1.0/u_tile_units_to_pixels;mediump float pixel_ratio_inverse=1.0/pixel_ratio;mediump float aspect=v_width/((pattern.w-pattern.y)*pixel_ratio_inverse);highp float subt_multiple=(pattern.z-pattern.x)*pixel_ratio_inverse*pixels_to_tile_units*aspect*32.0;highp float subt=floor(a_pattern_data.z/subt_multiple)*subt_multiple;float offset_sign=(fract(a_pattern_data.x)-0.5)*4.0;float line_progress_offset=offset_sign*v_width*0.5*pixels_to_tile_units;v_linesofar=(a_pattern_data.z-subt)+a_linesofar+line_progress_offset;v_pattern_data=vec2(a_pattern_data.x+line_progress_offset,a_pattern_data.y); #endif #ifdef FOG v_fog_pos=fog_position(pos); #endif #ifdef INDICATOR_CUTOUT v_z_offset=a_z_offset; #endif }`),raster:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_lighting.glsl" #include "_prelude_raster_array.glsl" uniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;uniform highp float u_zoom_transition;in vec2 v_pos0;in vec2 v_pos1;in float v_depth; #ifdef PROJECTION_GLOBE_VIEW in float v_split_fade; #endif 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;uniform float u_emissive_strength; #ifndef RASTER_ARRAY uniform highp sampler2D u_image0;uniform sampler2D u_image1; #endif #ifdef RASTER_COLOR uniform sampler2D u_color_ramp;uniform highp vec4 u_colorization_mix;uniform highp float u_colorization_offset;uniform vec2 u_texture_res; #endif void main() {vec4 color0,color1,color;vec2 value; #ifdef RASTER_COLOR #ifdef RASTER_ARRAY #ifdef RASTER_ARRAY_LINEAR value=mix( raTexture2D_image0_linear(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_linear(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t ); #else value=mix( raTexture2D_image0_nearest(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_nearest(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t ); #endif if (value.y > 0.0) value.x/=value.y; #else color=mix(texture(u_image0,v_pos0),texture(u_image1,v_pos1),u_fade_t);value=vec2(u_colorization_offset+dot(color.rgb,u_colorization_mix.rgb),color.a); #endif color=texture(u_color_ramp,vec2(value.x,0.5));if (color.a > 0.0) color.rgb/=color.a;color.a*=value.y; #else color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t); #endif color.a*=u_opacity; #ifdef GLOBE_POLES color.a*=1.0-smoothstep(0.0,0.05,u_zoom_transition); #endif 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);vec3 out_color=mix(u_high_vec,u_low_vec,rgb); #ifdef LIGHTING_3D_MODE out_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),u_emissive_strength).rgb; #endif #ifdef FOG highp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit)); #endif glFragColor=vec4(out_color*color.a,color.a); #ifdef PROJECTION_GLOBE_VIEW glFragColor*=mix(1.0,1.0-smoothstep(0.0,0.05,u_zoom_transition),smoothstep(0.8,0.9,v_split_fade)); #endif #ifdef RENDER_CUTOFF glFragColor=glFragColor*cutoff_opacity(u_cutoff_params,v_depth); #endif #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" uniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;uniform vec2 u_texture_offset;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center; #define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8 #ifdef GLOBE_POLES in vec3 a_globe_pos;in vec2 a_uv; #else in vec2 a_pos;in vec2 a_texture_pos; #endif out vec2 v_pos0;out vec2 v_pos1;out float v_depth; #ifdef PROJECTION_GLOBE_VIEW out float v_split_fade; #endif void main() {vec2 uv; #ifdef GLOBE_POLES vec3 globe_pos=a_globe_pos;globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;gl_Position=u_matrix*u_globe_matrix*vec4(globe_pos ,1.0);uv=a_uv; #ifdef FOG v_fog_pos=fog_position((u_normalize_matrix*vec4(a_globe_pos,1.0)).xyz); #endif #else float w=1.0+dot(a_texture_pos,u_perspective_transform);uv=a_texture_pos/8192.0; #ifdef PROJECTION_GLOBE_VIEW vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]); v_split_fade=0.0;if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;float opposite_merc_center=mod(u_merc_center.x+0.5,1.0);float dist_from_poles=(abs(mercatorY-0.5)*2.0);float range=0.1;v_split_fade=abs(opposite_merc_center-mercatorX);v_split_fade=clamp(1.0-v_split_fade,0.0,1.0);v_split_fade=max(smoothstep(1.0-range,1.0,dist_from_poles),max(smoothstep(1.0-range,1.0,v_split_fade),smoothstep(1.0-range,1.0,1.0-v_split_fade)));}float tiles=u_grid_matrix[0][2];if (tiles > 0.0) {float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvY=mercatorY*tiles-idy;float uvX=mercatorX*tiles-idx;uv=vec2(uvX,uvY);}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos; #ifdef FOG v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); #endif #else gl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w); #ifdef FOG v_fog_pos=fog_position(a_pos); #endif #endif #endif v_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;v_pos0=u_texture_offset.x+u_texture_offset.y*v_pos0;v_pos1=u_texture_offset.x+u_texture_offset.y*v_pos1; #ifdef RENDER_CUTOFF v_depth=gl_Position.z; #endif }`),rasterParticle:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_lighting.glsl" uniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;in vec2 v_pos0;in vec2 v_pos1;uniform sampler2D u_image0;uniform sampler2D u_image1;void main() {vec4 color0,color1,color;color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 out_color=color.rgb; #ifdef LIGHTING_3D_MODE out_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),0.0).rgb; #endif #ifdef FOG highp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit)); #endif glFragColor=vec4(out_color*color.a,color.a); #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" uniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center; #define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8 in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {float w=1.0;vec2 uv; #ifdef PROJECTION_GLOBE_VIEW vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvX=mercatorX*tiles-idx;float uvY=mercatorY*tiles-idy;uv=vec2(uvX,uvY);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos; #ifdef FOG v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); #endif #else uv=a_texture_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w); #ifdef FOG v_fog_pos=fog_position(a_pos); #endif #endif v_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),rasterParticleDraw:ei("uniform sampler2D u_color_ramp;in float v_particle_speed;void main() {glFragColor=texture(u_color_ramp,vec2(v_particle_speed,0.5));}",`#include "_prelude_raster_particle.glsl" in float a_index;uniform sampler2D u_particle_texture;uniform float u_particle_texture_side_len;uniform vec2 u_tile_offset;out float v_particle_speed;void main() {ivec2 pixel_coord=ivec2( mod(a_index,u_particle_texture_side_len),a_index/u_particle_texture_side_len);vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);vec2 pos=unpack_pos_from_rgba(pixel)+u_tile_offset;vec2 tex_coord=fract(pos);vec2 velocity=lookup_velocity(tex_coord);if (velocity==INVALID_VELOCITY) {gl_Position=AWAY;v_particle_speed=0.0;} else {gl_Position=vec4(2.0*pos-1.0,0,1);v_particle_speed=length(velocity);}gl_PointSize=1.0;}`),rasterParticleTexture:ei("uniform sampler2D u_texture;uniform float u_opacity;in vec2 v_tex_pos;void main() {vec4 color=texture(u_texture,v_tex_pos);glFragColor=vec4(floor(255.0*color*u_opacity)/255.0);}","in vec2 a_pos;out vec2 v_tex_pos;void main() {vec2 uv=0.5*a_pos+vec2(0.5);v_tex_pos=uv;gl_Position=vec4(a_pos,0.0,1.0);}"),rasterParticleUpdate:ei(`#include "_prelude_raster_particle.glsl" uniform sampler2D u_particle_texture;uniform mediump float u_particle_texture_side_len;uniform mediump float u_speed_factor;uniform highp float u_reset_rate;uniform highp float u_rand_seed;in highp vec2 v_tex_coord;vec2 linearstep(vec2 edge0,vec2 edge1,vec2 x) {return clamp((x-edge0)/(edge1-edge0),vec2(0),vec2(1));}const highp vec3 rand_constants=vec3(12.9898,78.233,4375.85453);highp float rand(const highp vec2 co) {highp float t=dot(rand_constants.xy,co);return fract(sin(t)*(rand_constants.z+t));}void main() {ivec2 pixel_coord=ivec2(v_tex_coord*u_particle_texture_side_len);highp vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);highp vec2 pos=unpack_pos_from_rgba(pixel);highp vec2 velocity=lookup_velocity(clamp(pos,0.0,1.0));highp vec2 dp=velocity==INVALID_VELOCITY ? vec2(0) : velocity*u_speed_factor;pos=pos+dp;highp vec2 seed=(pos+v_tex_coord)*u_rand_seed;highp vec2 random_pos=vec2(rand(seed+1.3),rand(seed+2.1));highp vec2 persist_rate=pow( linearstep(vec2(-u_particle_pos_offset),vec2(0),pos)*linearstep(vec2(1.0+u_particle_pos_offset),vec2(1),pos),vec2(4) );highp vec2 per_frame_persist=pow(persist_rate,abs(dp)/u_particle_pos_offset);highp float drop_rate=1.0-per_frame_persist.x*per_frame_persist.y;drop_rate=any(greaterThanEqual(abs(pos-0.5),vec2(0.5+u_particle_pos_offset))) ? 1.0 : drop_rate;highp float drop=step(1.0-drop_rate-u_reset_rate,rand(seed));highp vec2 next_pos=mix(pos,random_pos,drop);glFragColor=pack_pos_to_rgba(next_pos);}`,"in vec2 a_pos;out vec2 v_tex_coord;void main() {v_tex_coord=0.5*(a_pos+vec2(1.0));gl_Position=vec4(a_pos,0.0,1.0);}"),symbol:ei(`#include "_prelude_lighting.glsl" #define SDF_PX 8.0 #define SDF 1.0 #define ICON 0.0 uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;uniform bool u_is_halo;uniform lowp float u_scale_factor; #ifdef ICON_TRANSITION uniform float u_icon_transition; #endif #ifdef COLOR_ADJUSTMENT uniform mat4 u_color_adj_mat; #endif #ifdef INDICATOR_CUTOUT in highp float v_z_offset; #endif in vec2 v_tex_a; #ifdef ICON_TRANSITION in vec2 v_tex_b; #endif in float v_draw_halo;in vec3 v_gamma_scale_size_fade_opacity; #ifdef RENDER_TEXT_AND_SYMBOL in float is_sdf;in vec2 v_tex_a_icon; #endif #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 #pragma mapbox: define lowp float emissive_strength 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 #pragma mapbox: initialize lowp float emissive_strength vec4 out_color;float fade_opacity=v_gamma_scale_size_fade_opacity[2]; #ifdef RENDER_TEXT_AND_SYMBOL if (is_sdf==ICON) {vec2 tex_icon=v_tex_a_icon;lowp float alpha=opacity*fade_opacity;glFragColor=texture(u_texture_icon,tex_icon)*alpha; #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif return;} #endif #ifdef RENDER_SDF float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_gamma_scale_size_fade_opacity.x;float size=v_gamma_scale_size_fade_opacity.y;float fontScale=u_is_text ? size/24.0 : size;out_color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_halo) {out_color=halo_color;gamma=(halo_blur*u_scale_factor*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width*u_scale_factor/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,v_tex_a).r;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);out_color*=alpha; #else #ifdef ICON_TRANSITION vec4 a=texture(u_texture,v_tex_a)*(1.0-u_icon_transition);vec4 b=texture(u_texture,v_tex_b)*u_icon_transition;out_color=(a+b); #else out_color=texture(u_texture,v_tex_a); #endif #ifdef COLOR_ADJUSTMENT out_color=u_color_adj_mat*out_color; #endif #endif out_color*=opacity*fade_opacity; #ifdef LIGHTING_3D_MODE out_color=apply_lighting_with_emission_ground(out_color,emissive_strength); #endif #ifdef INDICATOR_CUTOUT out_color=applyCutout(out_color,v_z_offset); #endif glFragColor=out_color; #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_terrain.vertex.glsl" in vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_pixeloffset;in vec4 a_projected_pos;in float a_fade_opacity; #ifdef Z_OFFSET in float a_auto_z_offset; #endif #ifdef PROJECTION_GLOBE_VIEW in vec3 a_globe_anchor;in vec3 a_globe_normal; #endif #ifdef ICON_TRANSITION in vec2 a_texb; #endif #ifdef OCCLUSION_QUERIES in float a_occlusion_query_opacity; #endif #ifdef INDICATOR_CUTOUT out highp float v_z_offset; #endif 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_elevation_from_sea;uniform bool u_pitch_with_map;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 vec3 u_up_vector;uniform vec2 u_texsize_icon;uniform bool u_is_halo; #ifdef PROJECTION_GLOBE_VIEW uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; #endif out vec2 v_tex_a; #ifdef ICON_TRANSITION out vec2 v_tex_b; #endif out float v_draw_halo;out vec3 v_gamma_scale_size_fade_opacity; #ifdef RENDER_TEXT_AND_SYMBOL out float is_sdf;out vec2 v_tex_a_icon; #endif #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 #pragma mapbox: define lowp float emissive_strength #pragma mapbox: define lowp float occlusion_opacity #pragma mapbox: define lowp float z_offset 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 #pragma mapbox: initialize lowp float emissive_strength #pragma mapbox: initialize lowp float occlusion_opacity #pragma mapbox: initialize lowp float z_offset vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];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;}vec2 tile_anchor=a_pos;float e=u_elevation_from_sea ? z_offset : z_offset+elevation(tile_anchor); #ifdef Z_OFFSET e+=a_auto_z_offset; #endif vec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;vec3 world_pos_globe; #ifdef PROJECTION_GLOBE_VIEW mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos_globe=a_globe_anchor+h;world_pos=mix_globe_mercator(world_pos_globe,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; #else world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; #endif vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.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,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;vec2 a; #ifdef PROJECTION_GLOBE_VIEW vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);vec4 projected_point_globe=u_matrix*vec4(world_pos_globe,1);a=projected_point_globe.xy/projected_point_globe.w; #else offsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);a=projected_point.xy/projected_point.w; #endif vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; #ifdef PROJECTION_GLOBE_VIEW #ifdef PROJECTED_POS_ON_VIEWPORT projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xyz+h,1.0); #else vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz,mercator_pos,u_zoom_transition)+h;projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); #endif #else projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); #endif 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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0); #ifdef TERRAIN #ifdef PITCH_WITH_MAP_TERRAIN vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); #endif #endif #ifdef Z_OFFSET z+=u_pitch_with_map ? a_auto_z_offset+(u_elevation_from_sea ? z_offset : z_offset) : 0.0; #else z+=u_pitch_with_map ? (u_elevation_from_sea ? z_offset : z_offset) : 0.0; #endif float occlusion_fade=globe_occlusion_fade;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float out_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change)); #ifdef DEPTH_OCCLUSION float depth_occlusion=occlusionFadeMultiSample(projected_point);float depth_occlusion_multplier=mix(occlusion_opacity,1.0,depth_occlusion);out_fade_opacity*=depth_occlusion_multplier; #endif #ifdef OCCLUSION_QUERIES float occludedFadeMultiplier=mix(occlusion_opacity,1.0,a_occlusion_query_opacity);out_fade_opacity*=occludedFadeMultiplier; #endif float alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0); #ifdef PROJECTION_GLOBE_VIEW vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,hidden); #else gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,hidden); #endif float gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_gamma_scale_size_fade_opacity=vec3(gamma_scale,size,out_fade_opacity);v_tex_a=a_tex/u_texsize; #ifdef RENDER_TEXT_AND_SYMBOL is_sdf=a_size[0]-2.0*a_size_min;v_tex_a_icon=a_tex/u_texsize_icon; #endif #ifdef ICON_TRANSITION v_tex_b=a_texb/u_texsize; #endif #ifdef INDICATOR_CUTOUT v_z_offset=e; #endif }`),terrainRaster:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_shadow.fragment.glsl" #include "_prelude_lighting.glsl" uniform sampler2D u_image0;in vec2 v_pos0; #ifdef FOG in float v_fog_opacity; #endif #ifdef RENDER_SHADOWS in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1; #endif uniform vec3 u_ground_shadow_factor;void main() {vec4 image_color=texture(u_image0,v_pos0);vec4 color; #ifdef LIGHTING_3D_MODE const vec3 normal=vec3(0.0,0.0,1.0); #ifdef RENDER_SHADOWS float cutoffOpacity=1.0; #ifdef RENDER_CUTOFF cutoffOpacity=cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w); #endif #ifdef LIGHTING_3D_ALPHA_EMISSIVENESS vec3 unlit_base=image_color.rgb*(1.0-image_color.a);vec3 emissive_base=image_color.rgb*image_color.a;float ndotl=u_shadow_direction.z;float occlusion=ndotl < 0.0 ? 1.0 : shadow_occlusion(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,0.0);ndotl=max(0.0,ndotl);vec3 lit=apply_lighting(unlit_base,normal,mix(1.0,(1.0-(u_shadow_intensity*occlusion))*ndotl,cutoffOpacity));vec3 emissive=compute_emissive_draped(emissive_base,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=lit+emissive;color.a=1.0; #else float lighting_factor=shadowed_light_factor_normal_unbiased(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);color=apply_lighting(image_color,normal,mix(1.0,lighting_factor,cutoffOpacity)); #endif #else float lighting_factor=u_lighting_directional_dir.z;color=apply_lighting(image_color,normal,lighting_factor); #ifdef LIGHTING_3D_ALPHA_EMISSIVENESS color.rgb=mix(color.rgb,image_color.rgb,image_color.a);color.a=1.0; #endif #endif #else color=image_color; #endif #ifdef FOG #ifdef ZERO_EXAGGERATION color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); #else color=fog_dither(fog_apply_from_vert(color,v_fog_opacity)); #endif #endif glFragColor=color; #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" #include "_prelude_terrain.vertex.glsl" uniform mat4 u_matrix;uniform float u_skirt_height;in vec2 a_pos;out vec2 v_pos0; #ifdef FOG out float v_fog_opacity; #endif #ifdef RENDER_SHADOWS uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;out float v_depth; #endif void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0); #ifdef FOG #ifdef ZERO_EXAGGERATION v_fog_pos=fog_position(decodedPos); #else v_fog_opacity=fog(fog_position(vec3(decodedPos,elevation))); #endif #endif #ifdef RENDER_SHADOWS vec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.); #endif }`),terrainDepth:ei("precision highp float;in float v_depth;void main() {glFragColor=pack_depth(v_depth);}",`#include "_prelude_terrain.vertex.glsl" uniform mat4 u_matrix;in vec2 a_pos;out float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}`),skybox:ei(`#include "_prelude_fog.fragment.glsl" in lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep( cos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=texture(u_cubemap,uv).rgb; #ifdef FOG sky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color); #endif sky_color+=0.1*sun_disk(v_uv,u_sun_direction);glFragColor=vec4(sky_color*u_opacity,u_opacity); #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif }`,K0),skyboxGradient:ei(`#include "_prelude_fog.fragment.glsl" in highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture(u_color_ramp,vec2(progress,0.5)); #ifdef FOG color.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a; #endif color*=u_opacity;glFragColor=color; #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif }`,K0),skyboxCapture:ei(` in highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;precision highp float; #define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6) #define BETA_M vec3(21e-6,21e-6,21e-6) #define MIE_G 0.76 #define DENSITY_HEIGHT_SCALE_R 8000.0 #define DENSITY_HEIGHT_SCALE_M 1200.0 #define PLANET_RADIUS 6360e3 #define ATMOSPHERE_RADIUS 6420e3 #define SAMPLE_STEPS 10 #define DENSITY_STEPS 4 float ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;glFragColor=vec4(color,1.0);}`,"in highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;out highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_lighting.glsl" uniform sampler2D u_image0;uniform float u_far_z_cutoff;in vec2 v_pos0; #ifndef FOG uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport; #endif void main() {vec4 color; #ifdef CUSTOM_ANTIALIASING highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;highp float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);highp float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture(u_image0,v_pos0); #ifdef LIGHTING_3D_MODE #ifdef LIGHTING_3D_ALPHA_EMISSIVENESS raster=apply_lighting_with_emission_ground(raster,raster.a);color=vec4(clamp(raster.rgb,vec3(0),vec3(1))*antialias,antialias); #else raster=apply_lighting_ground(raster);color=vec4(raster.rgb*antialias,raster.a*antialias); #endif #else color=vec4(raster.rgb*antialias,raster.a*antialias); #endif #else color=texture(u_image0,v_pos0); #ifdef LIGHTING_3D_MODE #ifdef LIGHTING_3D_ALPHA_EMISSIVENESS color=apply_lighting_with_emission_ground(color,color.a);color.a=1.0; #else color=apply_lighting_ground(color); #endif #endif #endif #ifdef FOG color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); #endif color*=1.0-step(u_far_z_cutoff,1.0/gl_FragCoord.w);glFragColor=color; #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" #include "_prelude_terrain.vertex.glsl" uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height; #ifdef GLOBE_POLES in vec3 a_globe_pos;in vec2 a_uv; #else in vec2 a_pos; #endif out vec2 v_pos0;void main() { #ifdef GLOBE_POLES vec3 globe_pos=a_globe_pos;vec2 uv=a_uv; #else float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY); #endif v_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale; #ifdef GLOBE_POLES vec3 up_vector=globe_derived_up_vector; #else vec3 up_vector=elevationVector(tile_pos); #endif float height=elevation(tile_pos);globe_pos+=up_vector*height; #ifndef GLOBE_POLES globe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z; #endif #ifdef GLOBE_POLES vec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0); #else vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0); #endif gl_Position=u_proj_matrix*interpolated_pos; #ifdef FOG v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); #endif }`),globeAtmosphere:ei(`#include "_prelude_fog.fragment.glsl" uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec4 u_color;uniform vec4 u_high_color;uniform vec4 u_space_color;uniform float u_horizon_angle;in highp vec3 v_ray_dir;in highp vec3 v_horizon_dir;void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir; #ifdef PROJECTION_GLOBE_VIEW globe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) { #ifdef ALPHA_PASS glFragColor=vec4(0,0,0,0);return; #else #ifdef NATIVE glFragColor=vec4(1,1,1,1); #else glFragColor=vec4(0,0,0,1); #endif return; #endif } #endif highp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ? 0.0 : max(acos(clamp(dot(dir,horizon_dir),-1.0,1.0)),0.0);float horizon_angle; #ifdef PROJECTION_GLOBE_VIEW highp vec3 closest_point=globe_pos_dot_dir*dir;highp float closest_point_to_center=length(closest_point-u_globe_pos);highp float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ? PI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t); #else horizon_angle=horizon_angle_mercator; #endif horizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb; #ifdef ALPHA_PASS float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);glFragColor=vec4(1.0,1.0,1.0,a); #else vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c=c2;glFragColor=vec4(c*t,t); #endif }`,`in vec3 a_pos;in vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;out highp vec3 v_ray_dir;out highp vec3 v_horizon_dir;void main() {v_ray_dir=mix( mix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix( mix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}`),model:ei(`#include "_prelude_fog.fragment.glsl" #include "_prelude_shadow.fragment.glsl" #include "_prelude_lighting.glsl" uniform float u_opacity;uniform vec3 u_lightcolor;uniform vec3 u_lightpos;uniform float u_lightintensity;uniform vec4 u_baseColorFactor;uniform vec4 u_emissiveFactor;uniform float u_metallicFactor;uniform float u_roughnessFactor;uniform float u_emissive_strength;in highp vec4 v_position_height;in lowp vec4 v_color_mix; #ifdef RENDER_SHADOWS in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth_shadows; #endif #ifdef OCCLUSION_TEXTURE_TRANSFORM uniform vec4 u_occlusionTextureTransform; #endif #pragma mapbox: define-attribute highp vec3 normal_3f #pragma mapbox: define-attribute highp vec3 color_3f #pragma mapbox: define-attribute highp vec4 color_4f #pragma mapbox: define-attribute highp vec2 uv_2f #pragma mapbox: initialize-attribute highp vec3 normal_3f #pragma mapbox: initialize-attribute highp vec3 color_3f #pragma mapbox: initialize-attribute highp vec4 color_4f #pragma mapbox: initialize-attribute highp vec2 uv_2f #ifdef HAS_ATTRIBUTE_a_pbr in lowp vec4 v_roughness_metallic_emissive_alpha;in mediump vec4 v_height_based_emission_params; #endif #ifdef HAS_TEXTURE_u_baseColorTexture uniform sampler2D u_baseColorTexture;uniform bool u_baseTextureIsAlpha;uniform bool u_alphaMask;uniform float u_alphaCutoff; #endif #ifdef HAS_TEXTURE_u_metallicRoughnessTexture uniform sampler2D u_metallicRoughnessTexture; #endif #ifdef HAS_TEXTURE_u_occlusionTexture uniform sampler2D u_occlusionTexture;uniform float u_aoIntensity; #endif #ifdef HAS_TEXTURE_u_normalTexture uniform sampler2D u_normalTexture; #endif #ifdef HAS_TEXTURE_u_emissionTexture uniform sampler2D u_emissionTexture; #endif #ifdef APPLY_LUT_ON_GPU uniform highp sampler3D u_lutTexture; #endif #ifdef TERRAIN_FRAGMENT_OCCLUSION in highp float v_depth;uniform highp sampler2D u_depthTexture;uniform highp vec2 u_inv_depth_size;uniform highp vec2 u_depth_range_unpack; #ifdef DEPTH_D24 highp float unpack_depth(highp float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;} #else highp float unpack_depth_rgba(highp vec4 rgba_depth) {const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;} #endif bool isOccluded() {highp vec2 coord=gl_FragCoord.xy*u_inv_depth_size; #ifdef DEPTH_D24 highp float depth=unpack_depth(texture(u_depthTexture,coord).r); #else highp float depth=unpack_depth_rgba(texture(u_depthTexture,coord)); #endif return v_depth > depth+0.0005;} #endif #define saturate(_x) clamp(_x,0.,1.) vec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}float calculate_NdotL(vec3 normal,vec3 lightDir) {const float ext=0.70710678118;return (clamp(dot(normal,lightDir),-ext,1.0)+ext)/(1.0+ext);}vec3 getDiffuseShadedColor(vec3 albedo,vec3 normal,vec3 lightDir,vec3 lightColor) { #ifdef LIGHTING_3D_MODE vec3 transformed_normal=vec3(-normal.xy,normal.z);float lighting_factor; #ifdef RENDER_SHADOWS lighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows); #else lighting_factor=saturate(dot(transformed_normal,u_lighting_directional_dir)); #endif return apply_lighting(albedo,transformed_normal,lighting_factor); #else vec3 n=normal;float colorvalue=((albedo.x*0.2126)+(albedo.y*0.7152))+(albedo.z*0.0722);vec3 c=vec3(0.03,0.03,0.03);float directional=clamp(dot(n,vec3(lightDir)),0.0,1.0);directional=mix(1.0-u_lightintensity,max((1.0-colorvalue)+u_lightintensity,1.0),directional);vec3 c3=c+clamp((albedo*directional)*lightColor,mix(vec3(0.0),vec3(0.3),vec3(1.0)-lightColor),vec3(1.0));return c3; #endif }vec4 getBaseColor() {vec4 albedo=u_baseColorFactor; #ifdef HAS_ATTRIBUTE_a_color_3f albedo*=vec4(color_3f,1.0); #endif #ifdef HAS_ATTRIBUTE_a_pbr #else #ifdef HAS_ATTRIBUTE_a_color_4f albedo*=color_4f; #endif #endif #if defined (HAS_TEXTURE_u_baseColorTexture) && defined (HAS_ATTRIBUTE_a_uv_2f) vec4 texColor=texture(u_baseColorTexture,uv_2f);if(u_alphaMask) {if (texColor.w < u_alphaCutoff) {discard;}} #ifdef UNPREMULT_TEXTURE_IN_SHADER if(texColor.w > 0.0) {texColor.rgb/=texColor.w;}texColor.w=1.0; #endif if(u_baseTextureIsAlpha) {if (texColor.r < 0.5) {discard;}} else {texColor.rgb=sRGBToLinear(texColor.rgb);albedo*=texColor;} #endif vec4 color=vec4(mix(albedo.rgb,v_color_mix.rgb,v_color_mix.a),albedo.a); #ifdef APPLY_LUT_ON_GPU color=applyLUT(u_lutTexture,color); #endif return color;}highp mat3 cotangentFrame(highp vec3 N,highp vec3 p,highp vec2 uv ) { #ifdef HAS_TEXTURE_u_normalTexture highp vec3 dp1=vec3(dFdx(p.x),dFdx(p.y),dFdx(p.z));highp vec3 dp2=vec3(dFdy(p.x),dFdy(p.y),dFdy(p.z));highp vec2 duv1=vec2(dFdx(uv.x),dFdx(uv.y));highp vec2 duv2=vec2(dFdy(uv.x),dFdy(uv.y));highp vec3 dp2perp=cross( dp2,N );highp vec3 dp1perp=cross( N,dp1 );highp vec3 T=dp2perp*duv1.x+dp1perp*duv2.x;highp vec3 B=dp2perp*duv1.y+dp1perp*duv2.y;highp float lengthT=dot(T,T);highp float lengthB=dot(B,B);highp float maxLength=max(lengthT,lengthB);highp float invmax=inversesqrt( maxLength );highp mat3 res=mat3( T*invmax,B*invmax,N );return res; #else return mat3(1.0); #endif }highp vec3 getNormal(){highp vec3 n; #ifdef HAS_ATTRIBUTE_a_normal_3f n=normalize(normal_3f); #else highp vec3 fdx=vec3(dFdx(v_position_height.x),dFdx(v_position_height.y),dFdx(v_position_height.z));highp vec3 fdy=vec3(dFdy(v_position_height.x),dFdy(v_position_height.y),dFdy(v_position_height.z));n=normalize(cross(fdx,fdy))*-1.0; #endif #if defined(HAS_TEXTURE_u_normalTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) vec3 nMap=texture( u_normalTexture,uv_2f).xyz;nMap=normalize(2.0*nMap-vec3(1.0));highp vec3 v=normalize(-v_position_height.xyz);highp mat3 TBN=cotangentFrame(n,v,uv_2f);n=normalize(TBN*nMap); #endif return n;}struct Material {float perceptualRoughness;float alphaRoughness;float metallic;vec3 f90;vec4 baseColor;vec3 diffuseColor;vec3 specularColor;highp vec3 normal;};Material getPBRMaterial() {Material mat;mat.baseColor=getBaseColor();mat.perceptualRoughness=u_roughnessFactor;mat.metallic=u_metallicFactor; #ifdef HAS_ATTRIBUTE_a_pbr mat.perceptualRoughness=v_roughness_metallic_emissive_alpha.x;mat.metallic=v_roughness_metallic_emissive_alpha.y;mat.baseColor.w*=v_roughness_metallic_emissive_alpha.w; #endif #if defined(HAS_TEXTURE_u_metallicRoughnessTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) vec4 mrSample=texture(u_metallicRoughnessTexture,uv_2f);mat.perceptualRoughness*=mrSample.g;mat.metallic*=mrSample.b; #endif const float c_minRoughness=0.04;mat.perceptualRoughness=clamp(mat.perceptualRoughness,c_minRoughness,1.0);mat.metallic=saturate(mat.metallic);mat.alphaRoughness=mat.perceptualRoughness*mat.perceptualRoughness;const vec3 f0=vec3(0.04);mat.diffuseColor=mat.baseColor.rgb*(vec3(1.0)-f0);mat.diffuseColor*=1.0-mat.metallic;mat.specularColor=mix(f0,mat.baseColor.rgb,mat.metallic);highp float reflectance=max(max(mat.specularColor.r,mat.specularColor.g),mat.specularColor.b);highp float reflectance90=saturate(reflectance*25.0);mat.f90=vec3(reflectance90);mat.normal=getNormal();return mat;}float V_GGX(float NdotL,float NdotV,float roughness) {float a2=roughness*roughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-a2)+a2);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-a2)+a2);return 0.5/(GGXV+GGXL);}float V_GGXFast(float NdotL,float NdotV,float roughness) {float a=roughness;float GGXV=NdotL*(NdotV*(1.0-a)+a);float GGXL=NdotV*(NdotL*(1.0-a)+a);return 0.5/(GGXV+GGXL);}vec3 F_Schlick(vec3 specularColor,vec3 f90,float VdotH) {return specularColor+(f90-specularColor)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}vec3 F_SchlickFast(vec3 specularColor,float VdotH) {float x=1.0-VdotH;float x4=x*x*x*x;return specularColor+(1.0-specularColor)*x4*x;}float D_GGX(highp float NdotH,float alphaRoughness) {highp float a4=alphaRoughness*alphaRoughness;highp float f=(NdotH*a4-NdotH)*NdotH+1.0;return a4/(PI*f*f);}vec3 diffuseBurley(Material mat,float LdotH,float NdotL,float NdotV) {float f90=2.0*LdotH*LdotH*mat.alphaRoughness-0.5;return (mat.diffuseColor/PI)*(1.0+f90*pow((1.0-NdotL),5.0))*(1.0+f90*pow((1.0-NdotV),5.0));}vec3 diffuseLambertian(Material mat) { #ifdef LIGHTING_3D_MODE return mat.diffuseColor; #else return mat.diffuseColor/PI; #endif }vec3 EnvBRDFApprox(vec3 specularColor,float roughness,highp float NdotV) {vec4 c0=vec4(-1,-0.0275,-0.572,0.022);vec4 c1=vec4(1,0.0425,1.04,-0.04);highp vec4 r=roughness*c0+c1;highp float a004=min(r.x*r.x,exp2(-9.28*NdotV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}vec3 computeIndirectLightContribution(Material mat,float NdotV,vec3 normal) {vec3 env_light=vec3(0.65,0.65,0.65); #ifdef LIGHTING_3D_MODE float ambient_factor=calculate_ambient_directional_factor(normal);env_light=u_lighting_ambient_color*ambient_factor; #endif vec3 envBRDF=EnvBRDFApprox(mat.specularColor,mat.perceptualRoughness,NdotV);vec3 indirectSpecular= envBRDF*env_light;vec3 indirectDiffuse=mat.diffuseColor*env_light;return indirectSpecular+indirectDiffuse;}vec3 computeLightContribution(Material mat,vec3 lightPosition,vec3 lightColor) {highp vec3 n=mat.normal;highp vec3 v=normalize(-v_position_height.xyz);highp vec3 l=normalize(lightPosition);highp vec3 h=normalize(v+l);float NdotV=clamp(abs(dot(n,v)),0.001,1.0);float NdotL=saturate(dot(n,l));highp float NdotH=saturate(dot(n,h));float VdotH=saturate(dot(v,h));vec3 f=F_SchlickFast(mat.specularColor,VdotH);float g=V_GGXFast(NdotL,NdotV,mat.alphaRoughness);float d=D_GGX(NdotH,mat.alphaRoughness);vec3 diffuseTerm=(1.0-f)*diffuseLambertian(mat);vec3 specularTerm=f*g*d;vec3 transformed_normal=vec3(-n.xy,n.z);float lighting_factor; #ifdef RENDER_SHADOWS lighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows); #else lighting_factor=NdotL; #endif vec3 directLightColor=(specularTerm+diffuseTerm)*lighting_factor*lightColor;vec3 indirectLightColor=computeIndirectLightContribution(mat,NdotV,transformed_normal);vec3 color=(saturate(directLightColor)+indirectLightColor);float intensityFactor=1.0; #if !defined(LIGHTING_3D_MODE) const vec3 luminosityFactor=vec3(0.2126,0.7152,0.0722);float luminance=dot(diffuseTerm,luminosityFactor);intensityFactor=mix((1.0-u_lightintensity),max((1.0-luminance+u_lightintensity),1.0),NdotL); #endif color*=intensityFactor;return color;}void main() { #ifdef TERRAIN_FRAGMENT_OCCLUSION if (isOccluded()) {discard;} #endif vec3 lightDir=u_lightpos;vec3 lightColor=u_lightcolor; #ifdef LIGHTING_3D_MODE lightDir=u_lighting_directional_dir;lightDir.xy=-lightDir.xy;lightColor=u_lighting_directional_color; #endif vec4 finalColor; #ifdef DIFFUSE_SHADED vec3 N=getNormal();vec3 baseColor=getBaseColor().rgb;vec3 diffuse=getDiffuseShadedColor(baseColor,N,lightDir,lightColor); #ifdef HAS_TEXTURE_u_occlusionTexture float ao=(texture(u_occlusionTexture,uv_2f).r-1.0)*u_aoIntensity+1.0;diffuse*=ao; #endif finalColor=vec4(mix(diffuse,baseColor,u_emissive_strength),1.0)*u_opacity; #else Material mat=getPBRMaterial();vec3 color=computeLightContribution(mat,lightDir,lightColor);float ao=1.0; #if defined (HAS_TEXTURE_u_occlusionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) #ifdef OCCLUSION_TEXTURE_TRANSFORM vec2 uv=uv_2f.xy*u_occlusionTextureTransform.zw+u_occlusionTextureTransform.xy; #else vec2 uv=uv_2f; #endif ao=(texture(u_occlusionTexture,uv).x-1.0)*u_aoIntensity+1.0;color*=ao; #endif vec4 emissive=u_emissiveFactor; #if defined(HAS_TEXTURE_u_emissionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) emissive.rgb*=sRGBToLinear(texture(u_emissionTexture,uv_2f).rgb); #endif #ifdef APPLY_LUT_ON_GPU float emissiveFactorLength=max(length(u_emissiveFactor.rgb),0.001);emissive.rgb=sRGBToLinear(applyLUT(u_lutTexture,linearTosRGB(emissive.rgb/emissiveFactorLength).rbg))*emissiveFactorLength; #endif color+=emissive.rgb;float opacity=mat.baseColor.w*u_opacity; #ifdef HAS_ATTRIBUTE_a_pbr float resEmission=v_roughness_metallic_emissive_alpha.z;resEmission*=v_height_based_emission_params.z+v_height_based_emission_params.w*pow(clamp(v_height_based_emission_params.x,0.0,1.0),v_height_based_emission_params.y);vec3 color_mix=v_color_mix.rgb; #ifdef APPLY_LUT_ON_GPU color_mix=applyLUT(u_lutTexture,color_mix); #endif color=mix(color,color_mix,min(1.0,resEmission)); #ifdef HAS_ATTRIBUTE_a_color_4f float distance=length(vec2(1.3*max(0.0,abs(color_4f.x)-color_4f.z),color_4f.y));distance+= mix(0.5,0.0,clamp(resEmission-1.0,0.0,1.0));opacity*=v_roughness_metallic_emissive_alpha.w*saturate(1.0-distance*distance); #endif #endif vec3 unlitColor=mat.baseColor.rgb*ao+emissive.rgb;color=mix(color,unlitColor,u_emissive_strength);color=linearTosRGB(color);color*=opacity;finalColor=vec4(color,opacity); #endif #ifdef FOG finalColor=fog_dither(fog_apply_premultiplied(finalColor,v_fog_pos,v_position_height.w)); #endif #ifdef RENDER_CUTOFF finalColor*=v_cutoff_opacity; #endif #ifdef INDICATOR_CUTOUT finalColor=applyCutout(finalColor,v_position_height.w); #endif glFragColor=finalColor; #ifdef OVERDRAW_INSPECTOR glFragColor=vec4(1.0); #endif HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl" #include "_prelude_shadow.vertex.glsl" in vec3 a_pos_3f; #pragma mapbox: define-attribute highp vec3 normal_3f #pragma mapbox: define-attribute highp vec2 uv_2f #pragma mapbox: define-attribute highp vec3 color_3f #pragma mapbox: define-attribute highp vec4 color_4f #pragma mapbox: define-attribute-vertex-shader-only highp vec4 pbr #pragma mapbox: define-attribute-vertex-shader-only highp vec3 heightBasedEmissiveStrength uniform mat4 u_matrix;uniform mat4 u_node_matrix;uniform mat4 u_lighting_matrix;uniform vec3 u_camera_pos;uniform vec4 u_color_mix; #ifdef INSTANCED_ARRAYS in vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3; #else uniform highp mat4 u_normal_matrix; #endif #ifdef RENDER_SHADOWS uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth_shadows; #endif out vec4 v_position_height;out lowp vec4 v_color_mix; #ifdef TERRAIN_FRAGMENT_OCCLUSION out highp float v_depth; #endif #ifdef HAS_ATTRIBUTE_a_pbr out lowp vec4 v_roughness_metallic_emissive_alpha;out mediump vec4 v_height_based_emission_params; #endif vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() { #pragma mapbox: initialize-attribute highp vec3 normal_3f #pragma mapbox: initialize-attribute highp vec2 uv_2f #pragma mapbox: initialize-attribute highp vec3 color_3f #pragma mapbox: initialize-attribute highp vec4 color_4f #pragma mapbox: initialize-attribute-custom highp vec4 pbr #pragma mapbox: initialize-attribute-custom highp vec3 heightBasedEmissiveStrength highp mat4 normal_matrix; #ifdef INSTANCED_ARRAYS normal_matrix=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3); #else normal_matrix=u_normal_matrix; #endif vec3 local_pos;mat3 rs; #ifdef MODEL_POSITION_ON_GPU vec3 pos_color=normal_matrix[0].xyz;vec4 translate=normal_matrix[1];vec3 pos_a=floor(pos_color);vec3 rgb=1.05*(pos_color-pos_a);float hidden=float(pos_a.x > EXTENT);float color_mix=pos_a.z/100.0;v_color_mix=vec4(sRGBToLinear(rgb),color_mix);float meter_to_tile=normal_matrix[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);rs[0].x=normal_matrix[1].w;rs[0].yz=normal_matrix[2].xy;rs[1].xy=normal_matrix[2].zw;rs[1].z=normal_matrix[3].x;rs[2].xyz=normal_matrix[3].yzw;vec4 pos_node=u_lighting_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;local_pos=pos.xyz;gl_Position=mix(u_matrix*pos,AWAY,hidden);pos.z*=meter_to_tile;v_position_height.xyz=pos.xyz-u_camera_pos; #else local_pos=a_pos_3f;gl_Position=u_matrix*vec4(a_pos_3f,1);v_position_height.xyz=vec3(u_lighting_matrix*vec4(a_pos_3f,1));v_color_mix=vec4(sRGBToLinear(u_color_mix.rgb),u_color_mix.a); #endif v_position_height.w=a_pos_3f.z; #ifdef HAS_ATTRIBUTE_a_pbr vec4 albedo_c=decode_color(pbr.xy);vec2 e_r_m=unpack_float(pbr.z);vec2 r_m= unpack_float(e_r_m.y*16.0);r_m.r=r_m.r*16.0;v_color_mix=vec4(albedo_c.rgb,1.0);v_roughness_metallic_emissive_alpha=vec4(vec3(r_m,e_r_m.x)/255.0,albedo_c.a);v_roughness_metallic_emissive_alpha.z*=2.0;float heightBasedRelativeIntepolation=a_pos_3f.z*heightBasedEmissiveStrength.x+heightBasedEmissiveStrength.y;v_height_based_emission_params.x=heightBasedRelativeIntepolation;v_height_based_emission_params.y=heightBasedEmissiveStrength.z;vec2 emissionMultiplierValues=unpack_float(pbr.w)/256.0;v_height_based_emission_params.z=emissionMultiplierValues.x;v_height_based_emission_params.w=emissionMultiplierValues.y-emissionMultiplierValues.x; #endif #ifdef FOG v_fog_pos=fog_position(local_pos); #endif #ifdef RENDER_CUTOFF v_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z); #endif #ifdef TERRAIN_FRAGMENT_OCCLUSION v_depth=gl_Position.z/gl_Position.w; #endif #ifdef HAS_ATTRIBUTE_a_normal_3f #ifdef MODEL_POSITION_ON_GPU float x_squared_scale=dot(rs[0],rs[0]);float y_squared_scale=dot(rs[1],rs[1]);float z_squared_scale=dot(rs[2],rs[2]);vec3 squared_scale=vec3(x_squared_scale,y_squared_scale,z_squared_scale);normal_3f=rs*((u_lighting_matrix*vec4(normal_3f,0.0)).xyz/squared_scale);normal_3f=normalize(normal_3f); #else normal_3f=vec3(normal_matrix*vec4(normal_3f,0)); #endif #endif #ifdef HAS_ATTRIBUTE_a_pbr #ifdef HAS_ATTRIBUTE_a_color_4f v_roughness_metallic_emissive_alpha.w=clamp(color_4f.a*v_roughness_metallic_emissive_alpha.w*(v_roughness_metallic_emissive_alpha.z-1.0),0.0,1.0); #endif #endif #ifdef RENDER_SHADOWS vec4 shadow_pos=u_node_matrix*vec4(local_pos,1.0); #ifdef NORMAL_OFFSET #ifdef HAS_ATTRIBUTE_a_normal_3f #ifdef MODEL_POSITION_ON_GPU vec3 offset=shadow_normal_offset(vec3(-normal_3f.xy,normal_3f.z));shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0(); #else vec3 offset=shadow_normal_offset_model(normal_3f);shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0(); #endif #endif #endif v_pos_light_view_0=u_light_matrix_0*shadow_pos;v_pos_light_view_1=u_light_matrix_1*shadow_pos;v_depth_shadows=gl_Position.w; #endif }`),modelDepth:ei(`in highp float v_depth;void main() { #ifndef DEPTH_TEXTURE glFragColor=pack_depth(v_depth); #endif }`,`in vec3 a_pos_3f;uniform mat4 u_matrix;out highp float v_depth; #ifdef MODEL_POSITION_ON_GPU #ifdef INSTANCED_ARRAYS in vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3; #else uniform highp mat4 u_instance; #endif uniform highp mat4 u_node_matrix; #endif void main() { #ifdef MODEL_POSITION_ON_GPU highp mat4 instance; #ifdef INSTANCED_ARRAYS instance=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3); #else instance=u_instance; #endif vec3 pos_color=instance[0].xyz;vec4 translate=instance[1];vec3 pos_a=floor(pos_color);float hidden=float(pos_a.x > EXTENT);float meter_to_tile=instance[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);mat3 rs;rs[0].x=instance[1].w;rs[0].yz=instance[2].xy;rs[1].xy=instance[2].zw;rs[1].z=instance[3].x;rs[2].xyz=instance[3].yzw;vec4 pos_node=u_node_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;gl_Position=mix(u_matrix*pos,AWAY,hidden); #else gl_Position=u_matrix*vec4(a_pos_3f,1); #endif v_depth=gl_Position.z/gl_Position.w;}`),stars:ei(`in highp vec2 v_uv;in mediump float v_intensity;float shapeCircle(in vec2 uv) {float beginFade=0.6;float lengthFromCenter=length(v_uv);return 1.0-clamp((lengthFromCenter-beginFade)/(1.0-beginFade),0.0,1.0);}void main() {float alpha=shapeCircle(v_uv);vec3 color=vec3(1.0,1.0,1.0);alpha*=v_intensity;glFragColor=vec4(color*alpha,alpha);HANDLE_WIREFRAME_DEBUG;}`,` in vec3 a_pos_3f;in vec2 a_uv;in float a_size_scale;in float a_fade_opacity;uniform mat4 u_matrix;uniform vec3 u_up;uniform vec3 u_right;uniform float u_intensity_multiplier;out highp vec2 v_uv;out mediump float v_intensity;void main() {v_uv=a_uv;v_intensity=a_fade_opacity*u_intensity_multiplier;vec3 pos=a_pos_3f;pos+=a_uv.x*u_right*a_size_scale;pos+=a_uv.y*u_up*a_size_scale;gl_Position=u_matrix*vec4(pos,1.0);}`),snowParticle:ei("in highp vec2 uv;in highp float alphaMultiplier;uniform vec4 u_particleColor;uniform vec2 u_simpleShapeParameters;void main() {float t=clamp((length(uv)-u_simpleShapeParameters.x)/(1.0-u_simpleShapeParameters.x),0.0,1.0);float alpha=1.0-pow(t,pow(10.0,u_simpleShapeParameters.y));alpha*=alphaMultiplier;alpha*=u_particleColor.a;vec3 color=u_particleColor.rgb*alpha;glFragColor=vec4(color,alpha) ;HANDLE_WIREFRAME_DEBUG;}",` in highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_snowParticleData;in highp vec4 a_snowParticleDataHorizontalOscillation;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform vec2 u_screenSize;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; uniform float u_velocity;uniform vec3 u_direction;uniform float u_horizontalOscillationRadius; uniform float u_horizontalOscillationRate; uniform float u_billboardSize;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;out highp vec2 uv;out highp float alphaMultiplier;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos.xyz*=halfBoxSize;pos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_snowParticleData.z;float coneAngleHeadingRad=a_snowParticleData.w*radians(360.0);vec3 localZ=normalize(u_direction);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 direction;direction.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.z=cos(coneAnglePichRad);direction=normalize(direction);vec3 simPosLocal=vec3(0,0,0);float velocityScale=(1.0+3.0*a_snowParticleData.y)*u_velocity;simPosLocal+=direction*velocityScale*u_time;float horizontalOscillationRadius=u_horizontalOscillationRadius*a_snowParticleDataHorizontalOscillation.x;float horizontalOscillationAngle=u_horizontalOscillationRate*u_time*(-1.0+2.0*a_snowParticleDataHorizontalOscillation.y);simPosLocal.xy+=horizontalOscillationRadius*vec2(cos(horizontalOscillationAngle),sin(horizontalOscillationAngle));vec3 simPos=localX*simPosLocal.x+ localY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);float clipZ=-u_cam_pos.z+pos.z;vec4 posView=u_modelview*vec4(pos,1.0);float size=u_billboardSize;alphaMultiplier=1.0;vec4 posScreen=u_projection*posView;posScreen/=posScreen.w;posScreen.xy=vec2(0.5)+posScreen.xy*0.5;posScreen.xy*=u_screenSize;vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=u_screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-posScreen.xy)/(0.5*u_screenSize));screenDist+=a_snowParticleData.x*u_thinningParticleOffset;float scaleFactorMode=0.0;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);if (a_snowParticleData.x < u_thinningAffectedRatio) {scaleFactorMode=1.0-thinningFadeRatio;alphaMultiplier=thinningFadeRatio;}}vec4 posScreen1=u_projection*vec4(posView.x-size,posView.yzw);posScreen1/=posScreen1.w;vec4 posScreen2=u_projection*vec4(posView.x+size,posView.yzw);posScreen2/=posScreen2.w;posScreen1.xy=vec2(0.5)+posScreen1.xy*0.5;posScreen1.xy*=u_screenSize;posScreen2.xy=vec2(0.5)+posScreen2.xy*0.5;posScreen2.xy*=u_screenSize;float screenLength=length(posScreen1.xy-posScreen2.xy);float screenEpsilon=3.0;float scaleFactor=1.0;if (screenLength < screenEpsilon) {scaleFactor=screenEpsilon/max(screenLength,0.01);scaleFactor=mix(scaleFactor,1.0,scaleFactorMode);}float screenEpsilon2=15.0;if (screenLength > screenEpsilon2) {scaleFactor=screenEpsilon2/max(screenLength,0.01);}size*=scaleFactor;vec2 right=size*vec2(1,0);vec2 up=size*vec2(0,1);posView.xy+=right*a_uv.x;posView.xy+=up*a_uv.y;uv=a_uv;gl_Position=u_projection*posView;}`),rainParticle:ei("in highp vec2 uv;in highp float particleRandomValue;uniform sampler2D u_texScreen;uniform float u_distortionStrength;uniform vec4 u_color;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;uniform float u_shapeDirectionalPower;uniform float u_mode;void main() {vec2 st=uv*0.5+vec2(0.5);vec2 uvm=uv;uvm.y=-1.0+2.0*pow(st.y,u_shapeDirectionalPower);float shape=clamp(1.0-length(uvm),0.0,1.0);float alpha=abs(shape)*u_color.a;vec2 screenSize=vec2(textureSize(u_texScreen,0));vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-gl_FragCoord.xy)/(0.5*screenSize));screenDist+=(0.5+0.5*particleRandomValue)*u_thinningParticleOffset;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;float thinningAlpha=1.0;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);thinningAlpha*=thinningFadeRatio;}vec2 offsetXY=normalize(uvm)*abs(shape);vec2 stScreen=(gl_FragCoord.xy+offsetXY*u_distortionStrength*thinningAlpha)/screenSize;vec3 colorScreen=texture(u_texScreen,stScreen).rgb;alpha*=thinningAlpha;glFragColor=mix(vec4(colorScreen,1.0),vec4(u_color.rgb*alpha,alpha),u_mode);HANDLE_WIREFRAME_DEBUG;}",` in highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_rainParticleData;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; uniform float u_velocity; uniform vec2 u_rainDropletSize;uniform vec3 u_rainDirection;out highp vec2 uv;out highp float particleRandomValue;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos*=halfBoxSize; pos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_rainParticleData.z;float coneAngleHeadingRad=a_rainParticleData.w*radians(360.0);vec3 localZ=normalize(u_rainDirection);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 directionLocal;directionLocal.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.z=cos(coneAnglePichRad);directionLocal=normalize(directionLocal);vec3 directionWorld=localX*directionLocal.x+localY*directionLocal.y+localZ*directionLocal.z;float velocityScale=(1.0+3.0*a_rainParticleData.y)*u_velocity;vec3 simPosLocal=vec3(0,0,0);simPosLocal+=directionLocal*velocityScale*u_time;vec3 simPos=localX*simPosLocal.x+ localY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);vec4 posView=u_modelview*vec4(pos,1.0);vec3 directionView=normalize((u_modelview*vec4(directionWorld,0.0)).xyz);vec3 side=cross(directionView,normalize(posView.xyz));posView.xyz+=side*a_uv.x*u_rainDropletSize.x;posView.xyz+=directionView*a_uv.y*u_rainDropletSize.y;uv=a_uv;particleRandomValue=a_rainParticleData.x;gl_Position=u_projection*posView;}`),vignette:ei("uniform vec3 u_vignetteShape;uniform vec4 u_vignetteColor;in vec2 st;void main() {float screenDist=length(st);float alpha=clamp((screenDist-u_vignetteShape.x)/u_vignetteShape.y,0.0,1.0);alpha=pow(alpha,u_vignetteShape.z)*u_vignetteColor.a;vec3 color=u_vignetteColor.rgb;glFragColor=vec4(color*alpha,alpha) ;}","in vec2 a_pos_2f;out vec2 st;void main() {st=a_pos_2f;gl_Position=vec4(a_pos_2f,0,1);}"),occlusion:ei("uniform vec4 u_color;void main() {glFragColor=u_color;}",`#include "_prelude_terrain.vertex.glsl" in highp vec2 a_offset_xy;uniform highp vec3 u_anchorPos;uniform mat4 u_matrix;uniform vec2 u_screenSizePx;uniform vec2 u_occluderSizePx;void main() {vec3 world_pos=u_anchorPos; #ifdef TERRAIN float e=elevation(world_pos.xy);world_pos.z+=e; #endif vec4 projected_point=u_matrix*vec4(world_pos,1.0);projected_point.xy+=projected_point.w*a_offset_xy*0.5*u_occluderSizePx/u_screenSizePx;gl_Position=projected_point;}`)};function $n(u,t){const r=u.replace(/\s*\/\/[^\n]*\n/g,` `).split(` `);for(let c of r)if(c=c.trim(),c[0]==="#"&&c.includes("if")&&!c.includes("endif")){c=c.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const d=c.split(" ");for(const f of d)t.includes(f)||t.push(f)}}function ei(u,t){const r=/#include\s+"([^"]+)"/g,c=/#pragma mapbox: ([\w\-]+) ([\w]+) ([\w]+) ([\w]+)/g;let d=t.match(/(attribute(\S*)|(^\s*|;)in) (highp |mediump |lowp )?([\w]+) ([\w]+)/gm);d&&(d=d.map(M=>{const A=M.split(" ");return A[A.length-1]}),d=[...new Set(d)]);const f={},_=[],T=[];if(u=u.replace(r,(M,A)=>(T.push(A),"")),(t=t.replace(r,(M,A)=>(_.push(A),""))).includes("flat out"))return void console.error('The usage of "flat" qualifier is disallowed, see: https://bugs.webkit.org/show_bug.cgi?id=268071');let E=[...uo];$n(u,E),$n(t,E);for(const M of[..._,...T])fs[M]||console.error(`Undefined include: ${M}`),Ks[M]||(Ks[M]=[],$n(fs[M],Ks[M])),E=[...E,...Ks[M]];return{fragmentSource:u=u.replace(c,(M,A,z,C,k)=>(f[k]=!0,A==="define"?` #ifndef HAS_UNIFORM_u_${k} in ${z} ${C} ${k}; #else uniform ${z} ${C} u_${k}; #endif `:A==="initialize"?` #ifdef HAS_UNIFORM_u_${k} ${z} ${C} ${k} = u_${k}; #endif `:A==="define-attribute"?` #ifdef HAS_ATTRIBUTE_a_${k} in ${z} ${C} ${k}; #endif `:A==="initialize-attribute"?"":void 0)),vertexSource:t=t.replace(c,(M,A,z,C,k)=>{const j=C==="float"?"vec2":C,N=k.match(/color/)?"color":j;return A==="define-attribute-vertex-shader-only"?` #ifdef HAS_ATTRIBUTE_a_${k} in ${z} ${C} a_${k}; #endif `:f[k]?A==="define"?` #ifndef HAS_UNIFORM_u_${k} uniform lowp float u_${k}_t; in ${z} ${j} a_${k}; out ${z} ${C} ${k}; #else uniform ${z} ${C} u_${k}; #endif `:A==="initialize"?N==="vec4"?` #ifndef HAS_UNIFORM_u_${k} ${k} = a_${k}; #else ${z} ${C} ${k} = u_${k}; #endif `:` #ifndef HAS_UNIFORM_u_${k} ${k} = unpack_mix_${N}(a_${k}, u_${k}_t); #else ${z} ${C} ${k} = u_${k}; #endif `:A==="define-attribute"?` #ifdef HAS_ATTRIBUTE_a_${k} in ${z} ${C} a_${k}; out ${z} ${C} ${k}; #endif `:A==="initialize-attribute"?` #ifdef HAS_ATTRIBUTE_a_${k} ${k} = a_${k}; #endif `:void 0:A==="define"?` #ifndef HAS_UNIFORM_u_${k} uniform lowp float u_${k}_t; in ${z} ${j} a_${k}; #else uniform ${z} ${C} u_${k}; #endif `:A==="define-instanced"?N==="mat4"?` #ifdef INSTANCED_ARRAYS in vec4 a_${k}0; in vec4 a_${k}1; in vec4 a_${k}2; in vec4 a_${k}3; #else uniform ${z} ${C} u_${k}; #endif `:` #ifdef INSTANCED_ARRAYS in ${z} ${j} a_${k}; #else uniform ${z} ${C} u_${k}; #endif `:A==="initialize-attribute-custom"?` #ifdef HAS_ATTRIBUTE_a_${k} ${z} ${C} ${k} = a_${k}; #endif `:N==="vec4"?` #ifndef HAS_UNIFORM_u_${k} ${z} ${C} ${k} = a_${k}; #else ${z} ${C} ${k} = u_${k}; #endif `:` #ifndef HAS_UNIFORM_u_${k} ${z} ${C} ${k} = unpack_mix_${N}(a_${k}, u_${k}_t); #else ${z} ${C} ${k} = u_${k}; #endif `}),staticAttributes:d,usedDefines:E,vertexIncludes:_,fragmentIncludes:T}}class Tc{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(t,r,c,d,f,_,T,E){this.context=t;let M=this.boundPaintVertexBuffers.length!==d.length;for(let z=0;!M&&z{const te=K.paint.get("hillshade-shadow-color"),ae=K.paint.get("hillshade-shadow-color-use-theme").constantOr("default")==="none",ne=K.paint.get("hillshade-highlight-color"),oe=K.paint.get("hillshade-highlight-color-use-theme").constantOr("default")==="none",se=K.paint.get("hillshade-accent-color"),he=K.paint.get("hillshade-accent-color-use-theme").constantOr("default")==="none",fe=K.paint.get("hillshade-emissive-strength");let Ce=s.ak(K.paint.get("hillshade-illumination-direction"));if(K.paint.get("hillshade-illumination-anchor")==="viewport")Ce-=G.transform.angle;else if(G.style&&G.style.enable3dLights()&&G.style.directionalLight){const Ve=G.style.directionalLight.properties.get("direction"),Ue=s.cc(Ve.x,Ve.y,Ve.z);Ce=s.ak(Ue[1])}const Se=!G.options.moving;return{u_matrix:ie||G.transform.calculateProjMatrix($.tileID.toUnwrapped(),Se),u_image:0,u_latrange:Sc(0,$.tileID),u_light:[K.paint.get("hillshade-exaggeration"),Ce],u_shadow:te.toRenderColor(ae?null:K.lut),u_highlight:ne.toRenderColor(oe?null:K.lut),u_emissive_strength:fe,u_accent:se.toRenderColor(he?null:K.lut)}})(u,r,c,u.terrain?t.projMatrix:null);u.uploadCommonUniforms(T,z,t.toUnwrapped());const{tileBoundsBuffer:k,tileBoundsIndexBuffer:j,tileBoundsSegments:N}=u.getTileBoundsBuffers(r);z.draw(u,E.TRIANGLES,d,f,_,zt.disabled,C,c.id,k,j,N)}function g3(u,t,r){if(!t.needsDEMTextureUpload)return;const c=u.context,d=c.gl;c.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||u.getTileTexture(r.stride);const f=r.getPixels();t.demTexture?t.demTexture.update(f,{premultiply:!1}):t.demTexture=new s.T(c,f,d.R32F,{premultiply:!1}),t.needsDEMTextureUpload=!1}function Oh(u,t,r){const c=u.context,d=c.gl;if(!t.dem)return;const f=t.dem;if(c.activeTexture.set(d.TEXTURE1),g3(u,t,f),!t.demTexture)return;t.demTexture.bind(d.NEAREST,d.CLAMP_TO_EDGE);const _=f.dim;c.activeTexture.set(d.TEXTURE0);let T=t.hillshadeFBO;if(!T){const C=new s.T(c,{width:_,height:_,data:null},d.RGBA8);C.bind(d.LINEAR,d.CLAMP_TO_EDGE),T=t.hillshadeFBO=c.createFramebuffer(_,_,!0,"renderbuffer"),T.colorAttachment.set(C.texture)}c.bindFramebuffer.set(T.framebuffer),c.viewport.set([0,0,_,_]);const{tileBoundsBuffer:E,tileBoundsIndexBuffer:M,tileBoundsSegments:A}=u.getMercatorTileBoundsBuffers(),z=[];u.linearFloatFilteringSupported()&&z.push("TERRAIN_DEM_FLOAT_FORMAT"),u.getOrCreateProgram("hillshadePrepare",{defines:z}).draw(u,d.TRIANGLES,xt.disabled,Lt.disabled,Zt.unblended,zt.disabled,((C,k)=>{const j=k.stride,N=s.ad.mat4.create();return s.ad.mat4.ortho(N,0,s.ai,-s.ai,0,0,1),s.ad.mat4.translate(N,N,[0,-s.ai,0]),{u_matrix:N,u_image:1,u_dimension:[j,j],u_zoom:C.overscaledZ}})(t.tileID,f),r.id,E,M,A),t.needsHillshadePrepare=!1}class Oi{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class kh extends Oi{getDefault(){return s.al.transparent}set(t){const r=this.current;(t.r!==r.r||t.g!==r.g||t.b!==r.b||t.a!==r.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class y3 extends Oi{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class x3 extends Oi{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class v3 extends Oi{getDefault(){return[!0,!0,!0,!0]}set(t){const r=this.current;(t[0]!==r[0]||t[1]!==r[1]||t[2]!==r[2]||t[3]!==r[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class b3 extends Oi{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class Ec extends Oi{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class Mc extends Oi{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const r=this.current;(t.func!==r.func||t.ref!==r.ref||t.mask!==r.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class Fh extends Oi{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const r=this.current;(t[0]!==r[0]||t[1]!==r[1]||t[2]!==r[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class t0 extends Oi{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const r=this.gl;t?r.enable(r.STENCIL_TEST):r.disable(r.STENCIL_TEST),this.current=t,this.dirty=!1}}class i0 extends Oi{getDefault(){return[0,1]}set(t){const r=this.current;(t[0]!==r[0]||t[1]!==r[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class Ac extends Oi{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const r=this.gl;t?r.enable(r.DEPTH_TEST):r.disable(r.DEPTH_TEST),this.current=t,this.dirty=!1}}class on extends Oi{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class w3 extends Oi{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const r=this.gl;t?r.enable(r.BLEND):r.disable(r.BLEND),this.current=t,this.dirty=!1}}class el extends Oi{getDefault(){const t=this.gl;return[t.ONE,t.ZERO,t.ONE,t.ZERO]}set(t){const r=this.current;(t[0]!==r[0]||t[1]!==r[1]||t[2]!==r[2]||t[3]!==r[3]||this.dirty)&&(this.gl.blendFuncSeparate(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class tl extends Oi{getDefault(){return s.al.transparent}set(t){const r=this.current;(t.r!==r.r||t.g!==r.g||t.b!==r.b||t.a!==r.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class T3 extends Oi{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquationSeparate(t,t),this.current=t,this.dirty=!1)}}class S3 extends Oi{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const r=this.gl;t?r.enable(r.CULL_FACE):r.disable(r.CULL_FACE),this.current=t,this.dirty=!1}}class E3 extends Oi{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class il extends Oi{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}let M3=class extends Oi{getDefault(){return null}set(u){(u!==this.current||this.dirty)&&(this.gl.useProgram(u),this.current=u,this.dirty=!1)}};class A3 extends Oi{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class rl extends Oi{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const r=this.current;(t[0]!==r[0]||t[1]!==r[1]||t[2]!==r[2]||t[3]!==r[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Ic extends Oi{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const r=this.gl;r.bindFramebuffer(r.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class Pc extends Oi{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const r=this.gl;r.bindRenderbuffer(r.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Qs extends Oi{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const r=this.gl;r.bindTexture(r.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class Bh extends Oi{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const r=this.gl;r.bindBuffer(r.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Nh extends Oi{getDefault(){return null}set(t){const r=this.gl;r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Vh extends Oi{getDefault(){return null}set(t){this.gl&&(t!==this.current||this.dirty)&&(this.gl.bindVertexArray(t),this.current=t,this.dirty=!1)}}class Uh extends Oi{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const r=this.gl;r.pixelStorei(r.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class jh extends Oi{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const r=this.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class Gh extends Oi{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const r=this.gl;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class r0 extends Oi{constructor(t,r){super(t),this.context=t,this.parent=r}getDefault(){return null}}class I3 extends r0{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const r=this.gl;r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class P3 extends r0{attachment(){return this.gl.DEPTH_ATTACHMENT}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const r=this.gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,this.attachment(),r.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class ea extends r0{attachment(){return this.gl.DEPTH_ATTACHMENT}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const r=this.gl;r.framebufferTexture2D(r.FRAMEBUFFER,this.attachment(),r.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class Cc extends P3{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}const zc=(u,t,r)=>({u_matrix:u,u_image0:0,u_skirt_height:t,u_ground_shadow_factor:r}),C3=(u,t,r,c,d,f,_,T,E,M,A,z,C,k,j,N)=>({u_proj_matrix:Float32Array.from(u),u_globe_matrix:t,u_normalize_matrix:Float32Array.from(c),u_merc_matrix:r,u_zoom_transition:d,u_merc_center:f,u_image0:0,u_frustum_tl:_,u_frustum_tr:T,u_frustum_br:E,u_frustum_bl:M,u_globe_pos:A,u_globe_radius:z,u_viewport:C,u_grid_matrix:N?Float32Array.from(N):new Float32Array(9),u_skirt_height:k,u_far_z_cutoff:j});function nl(u,t){return u!=null&&t!=null&&!(!u.hasData()||!t.hasData())&&u.demTexture!=null&&t.demTexture!=null&&u.tileID.key!==t.tileID.key}const vn=new class{constructor(){this.operations={}}newMorphing(u,t,r,c,d){if(u in this.operations){const f=this.operations[u];f.to.tileID.key!==r.tileID.key&&(f.queued=r)}else this.operations[u]={startTime:c,phase:0,duration:d,from:t,to:r,queued:null}}getMorphValuesForProxy(u){if(!(u in this.operations))return null;const t=this.operations[u];return{from:t.from,to:t.to,phase:t.phase}}update(u){for(const t in this.operations){const r=this.operations[t];for(r.phase=(u-r.startTime)/r.duration;r.phase>=1||!this._validOp(r);)if(!this._nextOp(r,u)){delete this.operations[t];break}}}_nextOp(u,t){return!!u.queued&&(u.from=u.to,u.to=u.queued,u.queued=null,u.phase=0,u.startTime=t,!0)}_validOp(u){return u.from.hasData()&&u.to.hasData()}},z3={0:null,1:"TERRAIN_VERTEX_MORPHING"};function ho(u,t,r){if(t===0)return 0;const c=t<1&&r===514?.25/t:1;return 6*Math.pow(1.5,22-u)*Math.max(t,1)*c}function R3(u,t){const r=1<({u_matrix:u});function ol(u,t,r,c,d){if(d>0){const f=s.q.now(),_=(f-u.timeAdded)/d,T=t?(f-t.timeAdded)/d:-1,E=r.getSource(),M=c.coveringZoomLevel({tileSize:E.tileSize,roundZoom:E.roundZoom}),A=!t||Math.abs(t.tileID.overscaledZ-M)>Math.abs(u.tileID.overscaledZ-M),z=A&&u.refreshedUponExpiration?1:s.ay(A?_:1-T,0,1);return u.refreshedUponExpiration&&_>=1&&(u.refreshedUponExpiration=!1),t?{opacity:1,mix:1-z}:{opacity:z,mix:0}}return{opacity:1,mix:0}}class Rc extends yn{constructor(t){const r={type:"raster-dem",maxzoom:t.transform.maxZoom},c=new s.D(s.cj(),null),d=N0("mock-dem",r,c,t.style);super("mock-dem",d,!1),d.setEventedParent(this),this._sourceLoaded=!0}_loadTile(t,r){t.state="loaded",r(null)}}class D3 extends yn{constructor(t){const r=N0("proxy",{type:"geojson",maxzoom:t.transform.maxZoom},new s.D(s.cj(),null),t.style);super("proxy",r,!1),r.setEventedParent(this),this.map=this.getSource().map=t,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(t,r,c){if(t.freezeTileCoverage)return;this.transform=t;const d=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((f,_)=>{if(f[_.key]="",!this._tiles[_.key]){const T=new Cn(_,this._source.tileSize*_.overscaleFactor(),t.tileZoom);T.state="loaded",this._tiles[_.key]=T}return f},{});for(const f in this._tiles)f in d||(this.freeFBO(f),this._tiles[f].unloadVectorData(),delete this._tiles[f])}freeFBO(t){const r=this.proxyCachedFBO[t];if(r!==void 0){const c=Object.values(r);this.renderCachePool.push(...c),delete this.proxyCachedFBO[t]}}deallocRenderCache(){this.renderCache.forEach(t=>t.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class sl extends s.aH{constructor(t,r,c){super(t.overscaledZ,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y),this.proxyTileKey=r,this.projMatrix=c}}class Dc extends s.cK{constructor(t,r){super(),this._debugParams={sortTilesHiZFirst:!0,disableRenderCache:!1},t.tp.registerParameter(this._debugParams,["Terrain"],"sortTilesHiZFirst",{},()=>{this._style.map.triggerRepaint()}),t.tp.registerParameter(this._debugParams,["Terrain"],"disableRenderCache",{},()=>{this._style.map.triggerRepaint()}),t.tp.registerButton(["Terrain"],"Invalidate Render Cache",()=>{this.invalidateRenderCache=!0,this._style.map.triggerRepaint()}),this.painter=t,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[c,d,f]=function(E){const M=new s.b5,A=new s.aV,z=131;M.reserve(17161),A.reserve(33800);const C=s.ai/128,k=s.ai+C/2,j=k+C;for(let G=-C;Gk||G<0||G>k?24575:0,ie=s.ay(Math.round($),0,s.ai),te=s.ay(Math.round(G),0,s.ai);M.emplaceBack(ie+K,te)}const N=(G,$)=>{const K=$*z+G;A.emplaceBack(K+1,K,K+z),A.emplaceBack(K+z,K+z+1,K+1)};for(let G=1;G<129;G++)for(let $=1;$<129;$++)N($,G);return[0,129].forEach(G=>{for(let $=0;$<130;$++)N($,G),N(G,$)}),[M,A,32768]}(),_=t.context;this.gridBuffer=_.createVertexBuffer(c,s.b7.members),this.gridIndexBuffer=_.createIndexBuffer(d),this.gridSegments=s.b8.simpleSegment(0,0,c.length,d.length),this.gridNoSkirtSegments=s.b8.simpleSegment(0,0,c.length,f),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new D3(r.map),this.orthoMatrix=s.ad.mat4.create(),s.ad.mat4.ortho(this.orthoMatrix,this.painter.transform.projection.name==="globe"?.015:0,s.ai,0,s.ai,0,1);const T=_.gl;this._overlapStencilMode=new Lt({func:T.GEQUAL,mask:255},0,255,T.KEEP,T.KEEP,T.REPLACE),this._previousZoom=t.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=r,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Rc(r.map),this._pendingGroundEffectLayers=[]}set style(t){t.on("data",this._onStyleDataEvent.bind(this)),this._style=t,this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(t,r,c){if(t&&t.terrain){this._style!==t&&(this.style=t,this._evaluationZoom=void 0);const d=t.terrain.properties,f=t.terrain.drapeRenderMode===0,_=t.terrain.isZoomDependent();this._previousUpdateTimestamp=this.enabled?this._updateTimestamp:void 0,this._updateTimestamp=s.q.now();const T=t.terrain&&t.terrain.scope,E=d.get("source"),M=f?this._mockSourceCache:t.getSourceCache(E,T);if(!M)return void s.w(`Couldn't find terrain source "${E}".`);if(this.sourceCache=M,this._attenuationRange=t.terrain.getAttenuationRange(),this._exaggeration=_?this.calculateExaggeration(r):d.get("exaggeration"),!r.projection.requiresDraping&&_&&this._exaggeration===0)return void this._disable();this.enabled=!0;const A=()=>{this.sourceCache.used&&s.w(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source. This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const z=this.getScaledDemTileSize();this.sourceCache.update(r,z,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,A(),this._initializing=!0),A(),r.updateElevation(!0,c),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(r),this._emptyDEMTextureDirty=!0,this._previousZoom=r.zoom}else this._disable()}calculateExaggeration(t){if(this._attenuationRange&&t.zoom>=Math.ceil(this._attenuationRange[1]))return this._style.terrain.getExaggeration(t.zoom);const r=this._previousCameraAltitude,c=t.getFreeCameraOptions().position.z/t.pixelsPerMeter*t.worldSize;this._previousCameraAltitude=c;const d=r!=null?c-r:Number.MAX_VALUE;if(Math.abs(d)<2)return this._exaggeration;const f=t.zoom,_=this._style.terrain;if(!this._previousUpdateTimestamp)return _.getExaggeration(f);let T=f-this._previousZoom;const E=this._previousUpdateTimestamp;let M=f;this._evaluationZoom!=null&&(M=this._evaluationZoom,Math.abs(f-M)>.5&&(T=.5*(f-M+T)),T*d<0&&(M+=T)),this._evaluationZoom=M;const A=_.getExaggeration(M),z=A===_.getExaggeration(Math.max(0,M-.1));if(z&&Math.abs(A-this._exaggeration)<.01)return A;let C=Math.min(.1,.00375*(this._updateTimestamp-E));return(z||A<.1||Math.abs(T)<1e-4)&&(C=Math.min(.2,4*C)),s.ah(this._exaggeration,A,C)}resetTileLookupCache(t){this._findCoveringTileCache[t]={}}attenuationRange(){return this._attenuationRange}getDemUpscale(){return this.proxySourceCache.getSource().tileSize/128}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_onStyleDataEvent(t){t.coord&&t.dataType==="source"?this._clearRenderCacheForTile(t.sourceCacheId,t.coord):t.dataType==="style"&&(this.invalidateRenderCache=!0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this._previousCameraAltitude=void 0)}_disable(){if(this.enabled&&(this.enabled=!1,this._emptyDEMTextureDirty=!0,this._sharedDepthStencil=void 0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const t in this._style._mergedSourceCaches)this._style._mergedSourceCaches[t].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this.pool.forEach(t=>t.fb.destroy()),this.pool=[],this.framebufferCopyTexture&&this.framebufferCopyTexture.destroy()}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this.enabled?this._exaggeration:0}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const t=2*this.proxySourceCache.getSource().tileSize;return[t,t]}set useVertexMorphing(t){this._useVertexMorphing=t}updateTileBinding(t){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const r=this.proxySourceCache,c=this.painter.transform;this._initializing&&(this._initializing=c._centerAltitude===0&&this.getAtPointOrZero(s.ac.fromLngLat(c.center),-1)===-1,this._emptyDEMTextureDirty=!this._initializing);const d=this.proxyCoords=r.getIds().map(E=>{const M=r.getTileByID(E).tileID;return M.projMatrix=c.calculateProjMatrix(M.toUnwrapped()),M});(function(E,M){const A=M.transform.pointCoordinate(M.transform.getCameraPoint()),z=new s.P(A.x,A.y);E.sort((C,k)=>{if(k.overscaledZ-C.overscaledZ)return k.overscaledZ-C.overscaledZ;const j=new s.P(C.canonical.x+(1<{this.proxyToSource[E.key]={}}),this.terrainTileForTile={};const _=this._style._mergedSourceCaches;for(const E in _){const M=_[E];if(!M.used||(M!==this.sourceCache&&this.resetTileLookupCache(M.id),this._setupProxiedCoordsForOrtho(M,t[E],f),M.usedForTerrain))continue;const A=t[E];M.getSource().reparseOverscaled&&this._assignTerrainTiles(A)}this.proxiedCoords[r.id]=d.map(E=>new sl(E,E.key,this.orthoMatrix)),this._assignTerrainTiles(d),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(f),this.renderingToTexture=!1;const T={};this._visibleDemTiles=[];for(const E of this.proxyCoords){const M=this.terrainTileForTile[E.key];if(!M)continue;const A=M.tileID.key;A in T||(this._visibleDemTiles.push(M),T[A]=A)}}_assignTerrainTiles(t){this._initializing||t.forEach(r=>{if(this.terrainTileForTile[r.key])return;const c=this._findTileCoveringTileID(r,this.sourceCache);c&&(this.terrainTileForTile[r.key]=c)})}_prepareDEMTextures(){const t=this.painter.context,r=t.gl;for(const c in this.terrainTileForTile){const d=this.terrainTileForTile[c],f=d.dem;!f||d.demTexture&&!d.needsDEMTextureUpload||(t.activeTexture.set(r.TEXTURE1),g3(this.painter,d,f))}}_prepareDemTileUniforms(t,r,c,d){if(!r||r.demTexture==null)return!1;const f=t.tileID.canonical,_=Math.pow(2,r.tileID.canonical.z-f.z),T=d||"";return c[`u_dem_tl${T}`]=[f.x*_%1,f.y*_%1],c[`u_dem_scale${T}`]=_,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}_getLoadedAreaMinimum(){if(!this.enabled)return 0;let t=0;const r=this._visibleDemTiles.reduce((c,d)=>{if(!d.dem)return c;const f=d.dem.tree.minimums[0];return f>0&&t++,c+f},0);return t?r/t:0}_updateEmptyDEMTexture(){const t=this.painter.context,r=t.gl;t.activeTexture.set(r.TEXTURE2);const c=this._getLoadedAreaMinimum(),d=new s.cL({width:1,height:1},new Float32Array([c]));this._emptyDEMTextureDirty=!1;let f=this._emptyDEMTexture;return f?f.update(d,{premultiply:!1}):f=this._emptyDEMTexture=new s.T(t,d,r.R32F,{premultiply:!1}),f}setupElevationDraw(t,r,c){const d=this.painter.context,f=d.gl,_={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0};_.u_exaggeration=this.exaggeration();let T=null,E=null,M=1;if(c&&c.morphing&&this._useVertexMorphing){const k=c.morphing.srcDemTile,j=c.morphing.dstDemTile;M=c.morphing.phase,k&&j&&(this._prepareDemTileUniforms(t,k,_,"_prev")&&(E=k),this._prepareDemTileUniforms(t,j,_)&&(T=j))}const A=k=>k&&k.demTexture&&this.painter.linearFloatFilteringSupported()?f.LINEAR:f.NEAREST;let z=null;var C;if(this.enabled?E&&T?(z=T.demTexture,d.activeTexture.set(f.TEXTURE4),E.demTexture.bind(A(E),f.CLAMP_TO_EDGE),_.u_dem_lerp=M):(T=this.terrainTileForTile[t.tileID.key],z=this._prepareDemTileUniforms(t,T,_)?T.demTexture:this.emptyDEMTexture):z=this.emptyDEMTexture,d.activeTexture.set(f.TEXTURE2),z&&(_.u_dem_size=(C=z).size[0]===1?1:C.size[0]-2,z.bind(A(T),f.CLAMP_TO_EDGE)),this.painter.setupDepthForOcclusion(c&&c.useDepthForOcclusion,r,_),c&&c.useMeterToDem&&T){const k=(1<{if($===Ue)return;const We=[z3[Ue],"PROJECTION_GLOBE_VIEW"];ie&&We.push("CUSTOM_ANTIALIASING");const Te=M.isTileAffectedByFog(Ve);G=M.getOrCreateProgram("globeRaster",{defines:We,overrideFog:Te}),$=Ue},ae=M.colorModeForRenderPass(),ne=new xt(N.LEQUAL,xt.ReadWrite,M.depthRangeFor3D);vn.update(k);const oe=s.cE(K),se=[s.av(K.center.lng),s.aC(K.center.lat)],he=M.globeSharedBuffers,fe=[K.width*s.q.devicePixelRatio,K.height*s.q.devicePixelRatio],Ce=Float32Array.from(K.globeMatrix),Se={useDenormalizedUpVectorScale:!0};{const Ve=M.transform,Ue=ho(Ve.zoom,A.exaggeration(),A.sourceCache._source.tileSize);$=-1;const We=N.TRIANGLES;for(const Te of C){const Ne=z.getTile(Te),be=Lt.disabled,Be=A.prevTerrainTileForTile[Te.key],ke=A.terrainTileForTile[Te.key];nl(Be,ke)&&vn.newMorphing(Te.key,Be,ke,k,250),j.activeTexture.set(N.TEXTURE0),Ne.texture&&Ne.texture.bind(N.LINEAR,N.CLAMP_TO_EDGE);const je=vn.getMorphValuesForProxy(Te.key),ze=je?1:0;je&&s.L(Se,{morphing:{srcDemTile:je.from,dstDemTile:je.to,phase:s.cC(je.phase)}});const qe=s.cF(Te.canonical),et=s.cG(qe.getCenter().lat),tt=s.cH(Te.canonical,qe,et,Ve.worldSize/Ve._pixelsPerMercatorPixel),it=s.bc(s.cI(Te.canonical)),ft=C3(Ve.expandedFarZProjMatrix,Ce,oe,it,s.ag(Ve.zoom),se,Ve.frustumCorners.TL,Ve.frustumCorners.TR,Ve.frustumCorners.BR,Ve.frustumCorners.BL,Ve.globeCenterInViewSpace,Ve.globeRadius,fe,Ue,Ve._farZ,tt);if(te(Te,ze),G&&(A.setupElevationDraw(Ne,G,Se),M.uploadCommonUniforms(j,G,Te.toUnwrapped()),he)){const[Rt,Tt,Pt]=he.getGridBuffers(et,Ue!==0);G.draw(M,We,ne,be,ae,zt.backCCW,ft,"globe_raster",Rt,Tt,Pt)}}}if(he&&(M.renderDefaultNorthPole||M.renderDefaultSouthPole)){const Ve=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];ie&&Ve.push("CUSTOM_ANTIALIASING"),G=M.getOrCreateProgram("globeRaster",{defines:Ve});for(const Ue of C){const{x:We,y:Te,z:Ne}=Ue.canonical,be=Te===0,Be=Te===(1<Rt.draw(M,N.TRIANGLES,ne,Lt.disabled,ae,zt.disabled,C3(K.expandedFarZProjMatrix,tt,tt,it,0,se,K.frustumCorners.TL,K.frustumCorners.TR,K.frustumCorners.BR,K.frustumCorners.BL,K.globeCenterInViewSpace,K.globeRadius,fe,0,K._farZ),"globe_pole_raster",Tt,ze,qe);A.setupElevationDraw(et,G,Se),M.uploadCommonUniforms(j,G,Ue.toUnwrapped()),be&&M.renderDefaultNorthPole&&ft(G,ke),Be&&M.renderDefaultSouthPole&&(tt=s.ad.mat4.scale(s.ad.mat4.create(),tt,[1,-1,1]),ft(G,je))}}}})(d,f,_,T,E);else{const M=d.context,A=M.gl;let z,C;const k=d.shadowRenderer,j=lo(d,d.longestCutoffRange),N=ae=>{if(C===ae)return;const ne=[];ne.push(z3[ae]),j.shouldRenderCutoff&&ne.push("RENDER_CUTOFF"),k&&(ne.push("RENDER_SHADOWS","DEPTH_TEXTURE"),k.useNormalOffset&&ne.push("NORMAL_OFFSET")),z=d.getOrCreateProgram("terrainRaster",{defines:ne}),C=ae},G=d.colorModeForRenderPass(),$=new xt(A.LEQUAL,xt.ReadWrite,d.depthRangeFor3D);vn.update(E);const K=d.transform,ie=ho(K.zoom,f.exaggeration(),f.sourceCache._source.tileSize);let te=[0,0,0];if(k){const ae=d.style.directionalLight,ne=d.style.ambientLight;ae&&ne&&(te=Ws(d.style,ae,ne))}{C=-1;const ae=A.TRIANGLES,[ne,oe]=[f.gridIndexBuffer,f.gridSegments];for(const se of T){const he=_.getTile(se),fe=Lt.disabled,Ce=f.prevTerrainTileForTile[se.key],Se=f.terrainTileForTile[se.key];nl(Ce,Se)&&vn.newMorphing(se.key,Ce,Se,E,250),M.activeTexture.set(A.TEXTURE0),he.texture&&he.texture.bind(A.LINEAR,A.CLAMP_TO_EDGE);const Ve=vn.getMorphValuesForProxy(se.key),Ue=Ve?1:0;let We;Ve&&(We={morphing:{srcDemTile:Ve.from,dstDemTile:Ve.to,phase:s.cC(Ve.phase)}});const Te=zc(se.projMatrix,R3(se.canonical,K.renderWorldCopies)?ie/10:ie,te);if(N(Ue),!z)continue;f.setupElevationDraw(he,z,We);const Ne=se.toUnwrapped();k&&k.setupShadows(Ne,z),d.uploadCommonUniforms(M,z,Ne,null,j),z.draw(d,ae,$,fe,G,zt.backCCW,Te,"terrain_raster",f.gridBuffer,ne,oe)}}}}(r,this,this.proxySourceCache,t,this._updateTimestamp),this.renderingToTexture=!0,r.gpuTimingDeferredRenderEnd(),t.splice(0,t.length))}renderBatch(t){if(this._drapedRenderBatches.length===0)return t+1;this.renderingToTexture=!0;const r=this.painter,c=this.painter.context,d=this.proxySourceCache,f=this.proxiedCoords[d.id],_=this._drapedRenderBatches.shift(),T=r.style.order,E=[];let M=0;for(const A of f){const z=d.getTileByID(A.proxyTileKey),C=d.proxyCachedFBO[A.key]?d.proxyCachedFBO[A.key][t]:void 0,k=C!==void 0?d.renderCache[C]:this.pool[M++],j=C!==void 0;if(z.texture=k.tex,j&&!k.dirty){E.push(z.tileID);continue}let N;c.bindFramebuffer.set(k.fb.framebuffer),this.renderedToTile=!1,k.dirty&&(c.clear({color:s.al.transparent,stencil:0}),k.dirty=!1);for(let G=_.start;G<=_.end;++G){const $=r.style._mergedLayers[T[G]];if($.isHidden(r.transform.zoom))continue;const K=r.style.getLayerSourceCache($),ie=K?this.proxyToSource[A.key][K.id]:[A];if(!ie)continue;const te=ie;c.viewport.set([0,0,k.fb.width,k.fb.height]),N!==(K?K.id:null)&&(this._setupStencil(k,ie,$,K),N=K?K.id:null),r.renderLayer(r,K,$,te)}if(this._drapedRenderBatches.length===0)for(const G of this._pendingGroundEffectLayers){const $=r.style._mergedLayers[T[G]];if($.isHidden(r.transform.zoom))continue;const K=r.style.getLayerSourceCache($),ie=K?this.proxyToSource[A.key][K.id]:[A];if(!ie)continue;const te=ie;c.viewport.set([0,0,k.fb.width,k.fb.height]),N!==(K?K.id:null)&&(this._setupStencil(k,ie,$,K),N=K?K.id:null),r.renderLayer(r,K,$,te)}this.renderedToTile?(k.dirty=!0,E.push(z.tileID)):j||--M,M===5&&(M=0,this.renderToBackBuffer(E))}return this.renderToBackBuffer(E),this.renderingToTexture=!1,c.bindFramebuffer.set(null),c.viewport.set([0,0,r.width,r.height]),_.end+1}postRender(){}isLayerOrderingCorrect(t){const r=t.order.length;let c=-1,d=r;for(let f=0;fc}getMinElevationBelowMSL(){let t=0;return this._visibleDemTiles.filter(r=>r.dem).forEach(r=>{t=Math.min(t,r.dem.tree.minimums[0])}),t===0?t:(t-30)*this._exaggeration}raycast(t,r,c){if(!this._visibleDemTiles)return null;const d=this._visibleDemTiles.filter(f=>f.dem).map(f=>{const _=f.tileID,T=1<<_.overscaledZ,{x:E,y:M}=_.canonical,A=E/T,z=(E+1)/T,C=M/T,k=(M+1)/T;return{minx:A,miny:C,maxx:z,maxy:k,t:f.dem.tree.raycastRoot(A,C,z,k,t,r,c),tile:f}});d.sort((f,_)=>(f.t!==null?f.t:Number.MAX_VALUE)-(_.t!==null?_.t:Number.MAX_VALUE));for(const f of d){if(f.t==null)return null;const _=f.tile.dem.tree.raycast(f.minx,f.miny,f.maxx,f.maxy,t,r,c);if(_!=null)return _}return null}_createFBO(){const t=this.painter.context,r=t.gl,c=this.drapeBufferSize;t.activeTexture.set(r.TEXTURE0);const d=new s.T(t,{width:c[0],height:c[1],data:null},r.RGBA8);d.bind(r.LINEAR,r.CLAMP_TO_EDGE);const f=t.createFramebuffer(c[0],c[1],!0,null);return f.colorAttachment.set(d.texture),f.depthAttachment=new Cc(t,f.framebuffer),this._sharedDepthStencil===void 0?(this._sharedDepthStencil=t.createRenderbuffer(t.gl.DEPTH_STENCIL,c[0],c[1]),this._stencilRef=0,f.depthAttachment.set(this._sharedDepthStencil),t.clear({stencil:0})):f.depthAttachment.set(this._sharedDepthStencil),t.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,t.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.extTextureFilterAnisotropicMax),{fb:f,tex:d,dirty:!1}}_initFBOPool(){for(;this.pool.length{const r=this._style._mergedLayers[t],c=r.isHidden(this.painter.transform.zoom);return r.type==="hillshade"||r.type==="custom"?!c&&r.shouldRedrape():!c&&r.hasTransition()})}_clearLineLayersFromRenderCache(){let t=!1;for(const c of this._style.getSources())if(c instanceof Os){t=!0;break}if(!t)return;const r={};for(let c=0;cE>T.end)||s.w("fill-extrusion with flood lighting and/or ground ambient occlusion should be moved to be on top of all draped layers.")}this._drapedRenderBatches=c}_setupRenderCache(t){const r=this.proxySourceCache;if(this._shouldDisableRenderCache()||this.invalidateRenderCache){if(this.invalidateRenderCache=!1,r.renderCache.length>r.renderCachePool.length){const _=Object.values(r.proxyCachedFBO);r.proxyCachedFBO={};for(let T=0;T<_.length;++T){const E=Object.values(_[T]);r.renderCachePool.push(...E)}}return}this._clearRasterLayersFromRenderCache();const c=this.proxyCoords,d=this._tilesDirty;for(let _=c.length-1;_>=0;_--){const T=c[_];if(r.getTileByID(T.key),r.proxyCachedFBO[T.key]!==void 0){const E=t[T.key],M=this.proxyToSource[T.key];let A=0;for(const z in M){const C=M[z],k=E[z];if(!k||k.length!==C.length||C.some((j,N)=>j!==k[N]||d[z]&&d[z].hasOwnProperty(j.key))){A=-1;break}++A}for(const z in r.proxyCachedFBO[T.key])r.renderCache[r.proxyCachedFBO[T.key][z]].dirty=A<0||A!==Object.values(E).length}}const f=[...this._drapedRenderBatches];f.sort((_,T)=>T.end-T.start-(_.end-_.start));for(const _ of f)for(const T of c){if(r.proxyCachedFBO[T.key])continue;let E=r.renderCachePool.pop();E===void 0&&r.renderCache.length<50&&(E=r.renderCache.length,r.renderCache.push(this._createFBO())),E!==void 0&&(r.proxyCachedFBO[T.key]={},r.proxyCachedFBO[T.key][_.start]=E,r.renderCache[E].dirty=!0)}this._tilesDirty={}}_setupStencil(t,r,c,d){if(!d||!this._sourceTilesOverlap[d.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const f=this.painter.context,_=f.gl;if(r.length<=1)return void(this._overlapStencilType=!1);let T;if(c.isTileClipped())T=r.length,this._overlapStencilMode.test={func:_.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(r[0].overscaledZ>r[r.length-1].overscaledZ))return void(this._overlapStencilType=!1);T=1,this._overlapStencilMode.test={func:_.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+T>255&&(f.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=T,this._overlapStencilMode.ref=this._stencilRef,c.isTileClipped()&&this._renderTileClippingMasks(r,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return this._overlapStencilType==="Clip"||this._overlapStencilType==="Mask"}stencilModeForRTTOverlap(t){return this.renderingToTexture&&this._overlapStencilType?(this._overlapStencilType==="Clip"&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[t.key]),this._overlapStencilMode):Lt.disabled}_renderTileClippingMasks(t,r){const c=this.painter,d=this.painter.context,f=d.gl;c._tileClippingMaskIDs={},d.setColorMode(Zt.disabled),d.setDepthMode(xt.disabled);const _=c.getOrCreateProgram("clippingMask");for(const T of t){const E=c._tileClippingMaskIDs[T.key]=--r;_.draw(c,f.TRIANGLES,xt.disabled,new Lt({func:f.ALWAYS,mask:0},E,255,f.KEEP,f.KEEP,f.REPLACE),Zt.disabled,zt.disabled,ta(T.projMatrix),"$clipping",c.tileExtentBuffer,c.quadTriangleIndexBuffer,c.tileExtentSegments)}}pointCoordinate(t){const r=this.painter.transform;if(t.x<0||t.x>r.width||t.y<0||t.y>r.height)return null;const c=[t.x,t.y,1,1];s.ad.vec4.transformMat4(c,c,r.pixelMatrixInverse),s.ad.vec4.scale(c,c,1/c[3]),c[0]/=r.worldSize,c[1]/=r.worldSize;const d=r._camera.position,f=s.bH(1,r.center.lat),_=[d[0],d[1],d[2]/f,0],T=s.ad.vec3.subtract([],c.slice(0,3),_);s.ad.vec3.normalize(T,T);const E=this.raycast(_,T,this._exaggeration);return E!==null&&E?(s.ad.vec3.scaleAndAdd(_,_,T,E),_[3]=_[2],_[2]*=f,_):null}_setupProxiedCoordsForOrtho(t,r,c){if(t.getSource()instanceof s.aK)return this._setupProxiedCoordsForImageSource(t,r,c);this._findCoveringTileCache[t.id]=this._findCoveringTileCache[t.id]||{};const d=this.proxiedCoords[t.id]=[],f=this.proxyCoords;for(let E=0;EA.overscaledZ-M.overscaledZ)}_setupProxiedCoordsForImageSource(t,r,c){if(!t.getSource().loaded())return;const d=this.proxiedCoords[t.id]=[],f=this.proxyCoords,_=t.getSource(),T=_.tileID;if(!T)return;const E=new s.P(T.x,T.y)._div(1<(z.min.x=Math.min(z.min.x,C.x-E.x),z.min.y=Math.min(z.min.y,C.y-E.y),z.max.x=Math.max(z.max.x,C.x-E.x),z.max.y=Math.max(z.max.y,C.y-E.y),z),{min:new s.P(Number.MAX_VALUE,Number.MAX_VALUE),max:new s.P(-Number.MAX_VALUE,-Number.MAX_VALUE)}),A=(z,C)=>{const k=z.wrap+z.canonical.x/(1<G+M.max.x||j+N<$+M.min.y||j>$+M.max.y};for(let z=0;z_.key===r.tileID.key);if(f)return f}if(r.tileID.key!==t.key){const f=t.canonical.z-r.tileID.canonical.z;let _,T,E;d=s.ad.mat4.create();const M=r.tileID.wrap-t.wrap<0?(_=s.ai>>f,T=_*((r.tileID.canonical.x<=z){const C=t.canonical.z-z;r.getSource().reparseOverscaled?(T=Math.max(t.canonical.z+2,r.transform.tileZoom),_=new s.aH(T,t.wrap,z,t.canonical.x>>C,t.canonical.y>>C)):C!==0&&(T=z,_=new s.aH(T,t.wrap,z,t.canonical.x>>C,t.canonical.y>>C))}_.key!==t.key&&(M.push(_.key),c=r.getTile(_))}const A=z=>{M.forEach(C=>{d[C]=z}),M.length=0};for(T-=1;T>=E&&(!c||!c.hasData());T--){c&&A(c.tileID.key);const z=_.calculateScaledKey(T);if(c=r.getTileByID(z),c&&c.hasData())break;const C=d[z];if(C===null)break;C===void 0?M.push(z):c=r.getTileByID(C)}return A(c?c.tileID.key:null),c&&c.hasData()?c:null}findDEMTileFor(t){return this.enabled?this._findTileCoveringTileID(t,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(t,r){let c=this._tilesDirty[t];c||(c=this._tilesDirty[t]={}),c[r.key]=!0}}function Lc(u,t,r){const c=function(T,E,M){const A=s.ad.vec3.dot(E,T),z=s.ad.vec3.dot(M,[.2126,.7152,.0722]),C=(j,N,G)=>(1-G)*j+G*N,k=C(1-.3*Math.min(z,1),1,Math.min(A+1,1));return C(.92,1,Math.asin(s.ay(E[2],-1,1))/Math.PI+.5)*k}(u,[0,0,1],t),d=[0,0,0];s.ad.vec3.scale(d,r.slice(0,3),c);const f=[0,0,0];s.ad.vec3.scale(f,t.slice(0,3),u[2]);const _=[0,0,0];return s.ad.vec3.add(_,d,f),s.cg(_)}const n0=["fill","fillOutline","fillPattern","line","linePattern","background","backgroundPattern","hillshade","raster"],qh=["stars","rainParticle","snowParticle","fillExtrusion","fillExtrusionGroundEffect","elevatedStructures","model","symbol"];class Oc{static cacheKey(t,r,c,d){let f=`${r}${d?d.cacheKey:""}`;for(const _ of c)t.usedDefines.includes(_)&&(f+=`/${_}`);return f}constructor(t,r,c,d,f,_){const T=t.gl;this.program=T.createProgram(),this.configuration=d,this.name=r,this.fixedDefines=[..._];const E=d?d.getBinderAttributes():[],M=(c.staticAttributes||[]).concat(E);let A=d?d.defines():[];A=A.concat(_.map(G=>`#define ${G}`));const z=`#version 300 es `;let C=z+A.concat("precision mediump float;",Q0,_3.fragmentSource).join(` `);for(const G of c.fragmentIncludes)C+=` ${fs[G]}`;C+=` ${c.fragmentSource}`;let k=z+A.concat("precision highp float;",Q0,_3.vertexSource).join(` `);for(const G of c.vertexIncludes)k+=` ${fs[G]}`;this.forceManualRenderingForInstanceIDShaders=t.forceManualRenderingForInstanceIDShaders&&c.vertexSource.indexOf("gl_InstanceID")!==-1,this.forceManualRenderingForInstanceIDShaders&&(k+=` uniform int u_instanceID; `),k+=` ${c.vertexSource}`,this.forceManualRenderingForInstanceIDShaders&&(k=k.replaceAll("gl_InstanceID","u_instanceID"));const j=T.createShader(T.FRAGMENT_SHADER);if(T.isContextLost())return void(this.failedToCreate=!0);T.shaderSource(j,C),T.compileShader(j),T.attachShader(this.program,j);const N=T.createShader(T.VERTEX_SHADER);if(T.isContextLost())this.failedToCreate=!0;else{T.shaderSource(N,k),T.compileShader(N),T.attachShader(this.program,N),this.attributes={},this.numAttributes=M.length;for(let G=0;G({u_instanceID:new s.bN(G)}))(t)),(_.includes("TERRAIN")||r.indexOf("symbol")!==-1||r.indexOf("circle")!==-1)&&(this.terrainUniforms=(G=>({u_dem:new s.bN(G),u_dem_prev:new s.bN(G),u_dem_tl:new s.bK(G),u_dem_scale:new s.bM(G),u_dem_tl_prev:new s.bK(G),u_dem_scale_prev:new s.bM(G),u_dem_size:new s.bM(G),u_dem_lerp:new s.bM(G),u_exaggeration:new s.bM(G),u_depth:new s.bN(G),u_depth_size_inv:new s.bK(G),u_depth_range_unpack:new s.bK(G),u_occluder_half_size:new s.bM(G),u_occlusion_depth_offset:new s.bM(G),u_meter_to_dem:new s.bM(G),u_label_plane_matrix_inv:new s.bJ(G)}))(t)),_.includes("GLOBE")&&(this.globeUniforms=(G=>({u_tile_tl_up:new s.bL(G),u_tile_tr_up:new s.bL(G),u_tile_br_up:new s.bL(G),u_tile_bl_up:new s.bL(G),u_tile_up_scale:new s.bM(G)}))(t)),_.includes("FOG")&&(this.fogUniforms=(G=>({u_fog_matrix:new s.bJ(G),u_fog_range:new s.bK(G),u_fog_color:new s.cb(G),u_fog_horizon_blend:new s.bM(G),u_fog_vertical_limit:new s.bK(G),u_fog_temporal_offset:new s.bM(G),u_frustum_tl:new s.bL(G),u_frustum_tr:new s.bL(G),u_frustum_br:new s.bL(G),u_frustum_bl:new s.bL(G),u_globe_pos:new s.bL(G),u_globe_radius:new s.bM(G),u_globe_transition:new s.bM(G),u_is_globe:new s.bN(G),u_viewport:new s.bK(G)}))(t)),_.includes("RENDER_CUTOFF")&&(this.cutoffUniforms=(G=>({u_cutoff_params:new s.cb(G)}))(t)),_.includes("LIGHTING_3D_MODE")&&(this.lightsUniforms=(G=>({u_lighting_ambient_color:new s.bL(G),u_lighting_directional_dir:new s.bL(G),u_lighting_directional_color:new s.bL(G),u_ground_radiance:new s.bL(G)}))(t)),_.includes("RENDER_SHADOWS")&&(this.shadowUniforms=(G=>({u_light_matrix_0:new s.bJ(G),u_light_matrix_1:new s.bJ(G),u_fade_range:new s.bK(G),u_shadow_normal_offset:new s.bL(G),u_shadow_intensity:new s.bM(G),u_shadow_texel_size:new s.bM(G),u_shadow_map_resolution:new s.bM(G),u_shadow_direction:new s.bL(G),u_shadow_bias:new s.bL(G),u_shadowmap_0:new s.bN(G),u_shadowmap_1:new s.bN(G)}))(t))}}setTerrainUniformValues(t,r){if(!this.terrainUniforms)return;const c=this.terrainUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const d in r)c[d]&&c[d].set(this.program,d,r[d])}}setGlobeUniformValues(t,r){if(!this.globeUniforms)return;const c=this.globeUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const d in r)c[d]&&c[d].set(this.program,d,r[d])}}setFogUniformValues(t,r){if(!this.fogUniforms)return;const c=this.fogUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const d in r)c[d].set(this.program,d,r[d])}}setCutoffUniformValues(t,r){if(!this.cutoffUniforms)return;const c=this.cutoffUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const d in r)c[d].set(this.program,d,r[d])}}setLightsUniformValues(t,r){if(!this.lightsUniforms)return;const c=this.lightsUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const d in r)c[d].set(this.program,d,r[d])}}setShadowUniformValues(t,r){if(this.failedToCreate||!this.shadowUniforms)return;const c=this.shadowUniforms;t.program.set(this.program);for(const d in r)c[d].set(this.program,d,r[d])}_drawDebugWireframe(t,r,c,d,f,_,T,E,M,A){const z=t.options.wireframe;if(z.terrain===!1&&z.layers2D===!1&&z.layers3D===!1)return;const C=t.context;if(!(()=>!(!z.terrain||this.name!=="terrainRaster"&&this.name!=="globeRaster")||!(!z.layers2D||t._terrain&&t._terrain.renderingToTexture||!n0.includes(this.name))||!(!z.layers3D||!qh.includes(this.name)))())return;const k=C.gl,j=t.wireframeDebugCache.getLinesFromTrianglesBuffer(t.frameCounter,f,C);if(!j)return;const N=[...this.fixedDefines];N.push("DEBUG_WIREFRAME");const G=t.getOrCreateProgram(this.name,{config:this.configuration,defines:N});C.program.set(G.program);const $=(te,ae,ne)=>{if(ae[te]&&ne[te])for(const oe in ae[te])ne[te][oe]&&ne[te][oe].set(ne.program,oe,ae[te][oe].current)};M&&M.setUniforms(G.program,C,G.binderUniforms,T,{zoom:E}),$("fixedUniforms",this,G),$("terrainUniforms",this,G),$("globeUniforms",this,G),$("fogUniforms",this,G),$("lightsUniforms",this,G),$("shadowUniforms",this,G),j.bind(),C.setColorMode(new Zt([k.ONE,k.ONE_MINUS_SRC_ALPHA,k.ZERO,k.ONE],s.al.transparent,[!0,!0,!0,!1])),C.setDepthMode(new xt(r.func===k.LESS?k.LEQUAL:r.func,xt.ReadOnly,r.range)),C.setStencilMode(Lt.disabled);const K=3*_.primitiveLength*2,ie=3*_.primitiveOffset*2*2;if(this.forceManualRenderingForInstanceIDShaders){const te=A||1;for(let ae=0;ae1?k.drawElementsInstanced(k.LINES,K,k.UNSIGNED_SHORT,ie,A):k.drawElements(k.LINES,K,k.UNSIGNED_SHORT,ie);f.bind(),C.program.set(this.program),C.setDepthMode(r),C.setStencilMode(c),C.setColorMode(d)}checkUniforms(t,r,c){if(this.fixedDefines.includes(r)){for(const d of Object.keys(c))if(!c[d].initialized)throw new Error(`Program '${this.name}', from draw '${t}': uniform ${d} not set but required by ${r} being defined`)}}draw(t,r,c,d,f,_,T,E,M,A,z,C,k,j,N,G){const $=t.context,K=$.gl;if(this.failedToCreate)return;$.program.set(this.program),$.setDepthMode(c),$.setStencilMode(d),$.setColorMode(f),$.setCullFace(_);for(const ae of Object.keys(this.fixedUniforms))this.fixedUniforms[ae].set(this.program,ae,T[ae]);j&&j.setUniforms(this.program,$,this.binderUniforms,C,{zoom:k});const ie={[K.POINTS]:1,[K.LINES]:2,[K.TRIANGLES]:3,[K.LINE_STRIP]:1}[r];this.checkUniforms(E,"RENDER_SHADOWS",this.shadowUniforms);const te=G&&G>0?1:void 0;for(const ae of z.get()){const ne=ae.vaos||(ae.vaos={});if((ne[E]||(ne[E]=new Tc)).bind($,this,M,j?j.getPaintVertexBuffers():[],A,ae.vertexOffset,N||[],te),this.forceManualRenderingForInstanceIDShaders){const oe=G||1;for(let se=0;se1?K.drawElementsInstanced(r,ae.primitiveLength*ie,K.UNSIGNED_SHORT,ae.primitiveOffset*ie*2,G):A?K.drawElements(r,ae.primitiveLength*ie,K.UNSIGNED_SHORT,ae.primitiveOffset*ie*2):K.drawArrays(r,ae.vertexOffset,ae.vertexLength);r===K.TRIANGLES&&A&&this._drawDebugWireframe(t,c,d,f,A,ae,C,k,j,G)}}}function L3(u,t){const r=Math.pow(2,t.tileID.overscaledZ),c=t.tileSize*Math.pow(2,u.transform.tileZoom)/r,d=c*(t.tileID.canonical.x+t.tileID.wrap*r),f=c*t.tileID.canonical.y;return{u_image:0,u_texsize:t.imageAtlasTexture?t.imageAtlasTexture.size:[0,0],u_tile_units_to_pixels:1/s.at(t,1,u.transform.tileZoom),u_pixel_coord_upper:[d>>16,f>>16],u_pixel_coord_lower:[65535&d,65535&f]}}const al={terrain:0,flat:1},O3=s.ad.mat4.create(),ll=(u,t,r,c,d,f,_,T,E,M,A,z,C,k,j,N,G,$)=>{const K=t.style.light,ie=K.properties.get("position"),te=[ie.x,ie.y,ie.z],ae=s.ad.mat3.create();K.properties.get("anchor")==="viewport"&&(s.ad.mat3.fromRotation(ae,-t.transform.angle),s.ad.vec3.transformMat3(te,te,ae));const ne=K.properties.get("color"),oe=t.transform,se={u_matrix:u,u_lightpos:te,u_lightintensity:K.properties.get("intensity"),u_lightcolor:[ne.r,ne.g,ne.b],u_vertical_gradient:+r,u_opacity:c,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:O3,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_height_type:al[M],u_base_type:al[A],u_ao:d,u_edge_radius:f,u_width_scale:_,u_flood_light_color:j,u_vertical_scale:N,u_flood_light_intensity:G,u_ground_shadow_factor:$};return oe.projection.name==="globe"&&(se.u_tile_id=[T.canonical.x,T.canonical.y,1<({u_matrix:u,u_edge_radius:t,u_width_scale:r,u_vertical_scale:c,u_height_type:al[d],u_base_type:al[f]}),k3=(u,t,r,c,d,f,_,T,E,M,A,z,C,k,j,N,G)=>{const $=ll(u,t,r,c,d,f,_,T,M,A,z,C,k,j,N,G,1,[0,0,0]),K={u_height_factor:-Math.pow(2,T.overscaledZ)/E.tileSize/8};return s.l($,L3(t,E),K)},ra=(u,t)=>({u_matrix:u,u_emissive_strength:t}),F3=(u,t,r,c)=>s.l(ra(u,t),L3(r,c)),cl=(u,t,r)=>({u_matrix:u,u_world:r,u_emissive_strength:t}),ul=(u,t,r,c,d)=>s.l(F3(u,t,r,c),{u_world:d}),o0=(u,t,r,c,d)=>({u_matrix:u,u_camera_pos:[t[0],t[1],t[2]],u_depth_bias:r,u_height_scale:c,u_reset_depth:d}),kc=(u,t,r,c)=>{const d=s.ai/r.tileSize;return{u_matrix:u,u_camera_to_center_distance:t.getCameraToCenterDistance(c),u_extrude_scale:[t.pixelsToGLUnits[0]/d,t.pixelsToGLUnits[1]/d]}},Fc=(u,t,r=1)=>({u_matrix:u,u_color:t.toRenderColor(null),u_overlay:0,u_overlay_scale:r}),na=s.ad.mat4.create(),hl=(u,t,r,c,d,f,_)=>{const T=u.transform,E=T.projection.name==="globe",M=E?s.cO(T.zoom,t.canonical)*T._pixelsPerMercatorPixel:s.at(r,1,f),A={u_matrix:t.projMatrix,u_extrude_scale:M,u_intensity:_,u_inv_rot_matrix:na,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(E){A.u_inv_rot_matrix=c,A.u_merc_center=d,A.u_tile_id=[t.canonical.x,t.canonical.y,1<({u_matrix:u,u_normalize_matrix:t,u_globe_matrix:r,u_merc_matrix:c,u_grid_matrix:d,u_tl_parent:f,u_scale_parent:M,u_fade_t:A.mix,u_opacity:A.opacity*z.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:z.paint.get("raster-brightness-min"),u_brightness_high:z.paint.get("raster-brightness-max"),u_saturation_factor:s.cP(z.paint.get("raster-saturation")),u_contrast_factor:s.cQ(z.paint.get("raster-contrast")),u_spin_weights:jo(z.paint.get("raster-hue-rotate")),u_perspective_transform:C,u_raster_elevation:k,u_zoom_transition:_,u_merc_center:T,u_cutoff_params:E,u_colorization_mix:at(s.cR,N,$),u_colorization_offset:B3(s.cR,G,$),u_color_ramp:j,u_texture_offset:[ie/(K+2*ie),K/(K+2*ie)],u_texture_res:[K+2*ie,K+2*ie],u_emissive_strength:te});function jo(u){u*=Math.PI/180;const t=Math.sin(u),r=Math.cos(u);return[(2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3]}const sn=.05,bt=(u,t,r,c,d,f,_,T,E,M,A,z)=>({u_matrix:u,u_normalize_matrix:t,u_globe_matrix:r,u_merc_matrix:c,u_grid_matrix:d,u_tl_parent:f,u_scale_parent:M,u_fade_t:A.mix,u_opacity:A.opacity,u_image0:0,u_image1:1,u_raster_elevation:z,u_zoom_transition:_,u_merc_center:T,u_cutoff_params:E}),V3=(u,t,r,c,d,f,_,T,E,M)=>({u_particle_texture:u,u_particle_texture_side_len:t,u_tile_offset:r,u_velocity:c,u_color_ramp:f,u_velocity_res:d,u_max_speed:_,u_uv_offset:T,u_data_scale:[255*E[0],255*E[1]],u_data_offset:M,u_particle_pos_scale:1.1,u_particle_pos_offset:[sn,sn]}),$h=(u,t,r,c,d,f,_,T,E,M)=>({u_particle_texture:u,u_particle_texture_side_len:t,u_velocity:r,u_velocity_res:c,u_max_speed:d,u_speed_factor:f,u_reset_rate:_,u_rand_seed:Math.random(),u_uv_offset:T,u_data_scale:[255*E[0],255*E[1]],u_data_offset:M,u_particle_pos_scale:1.1,u_particle_pos_offset:[sn,sn]}),Bc=s.ad.mat4.create(),dl=(u,t,r,c,d,f,_,T,E,M,A,z,C,k,j,N,G,$,K,ie,te,ae)=>{const ne=d.transform,oe={u_is_size_zoom_constant:+(u==="constant"||u==="source"),u_is_size_feature_constant:+(u==="constant"||u==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:ne.getCameraToCenterDistance(K),u_rotate_symbol:+r,u_aspect_ratio:ne.width/ne.height,u_fade_change:d.options.fadeDuration?d.symbolFadeChange:1,u_matrix:f,u_label_plane_matrix:_,u_coord_matrix:T,u_is_text:+M,u_elevation_from_sea:E?1:0,u_pitch_with_map:+c,u_texsize:A,u_texsize_icon:z,u_texture:0,u_texture_icon:1,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Bc,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Bc,u_up_vector:[0,-1,0],u_color_adj_mat:ie,u_icon_transition:te||0,u_gamma_scale:c?d.transform.getCameraToCenterDistance(K)*Math.cos(d.terrain?0:d.transform._pitch):1,u_device_pixel_ratio:s.q.devicePixelRatio,u_is_halo:+C,u_scale_factor:ae||1};return K.name==="globe"&&(oe.u_tile_id=[k.canonical.x,k.canonical.y,1<({u_matrix:u,u_emissive_strength:t,u_opacity:r,u_color:c}),Nc=(u,t,r,c,d,f,_,T,E)=>s.l(function(M,A,z,C,k,j){const{width:N,height:G}=C.imageManager.getPixelSize(A),$=Math.pow(2,j.tileID.overscaledZ),K=j.tileSize*Math.pow(2,C.transform.tileZoom)/$,ie=K*(j.tileID.canonical.x+j.tileID.wrap*$),te=K*j.tileID.canonical.y;return{u_image:0,u_pattern_tl:z.tl,u_pattern_br:z.br,u_texsize:[N,G],u_pattern_size:z.displaySize,u_pattern_units_to_pixels:k?[C.transform.width,-1*C.transform.height]:[1/s.at(j,1,C.transform.tileZoom),1/s.at(j,1,C.transform.tileZoom)],u_pixel_coord_upper:[ie>>16,te>>16],u_pixel_coord_lower:[65535&ie,65535&te]}}(0,f,_,c,T,E),{u_matrix:u,u_emissive_strength:t,u_opacity:r}),pl=new Float32Array(s.ad.mat4.identity([])),j3=(u,t,r,c,d,f,_,T,E,M,A,z,C,k=[0,0,0],j)=>{const N=d.style.light,G=N.properties.get("position"),$=[-G.x,-G.y,G.z],K=s.ad.mat3.create();N.properties.get("anchor")==="viewport"&&(s.ad.mat3.fromRotation(K,-d.transform.angle),s.ad.vec3.transformMat3($,$,K));const ie=A.alphaMode==="MASK",te=N.properties.get("color").toRenderColor(null),ae=C.paint.get("model-ambient-occlusion-intensity"),ne=C.paint.get("model-color").constantOr(s.al.white).toRenderColor(null),oe=C.paint.get("model-color-mix-intensity").constantOr(0);return{u_matrix:u,u_lighting_matrix:t,u_normal_matrix:r,u_node_matrix:c||pl,u_lightpos:$,u_lightintensity:N.properties.get("intensity"),u_lightcolor:[te.r,te.g,te.b],u_camera_pos:k,u_opacity:f,u_baseTextureIsAlpha:0,u_alphaMask:+ie,u_alphaCutoff:A.alphaCutoff,u_baseColorFactor:[_.r,_.g,_.b,_.a],u_emissiveFactor:[T[0],T[1],T[2],1],u_metallicFactor:E,u_roughnessFactor:M,u_baseColorTexture:Zi.BaseColor,u_metallicRoughnessTexture:Zi.MetallicRoughness,u_normalTexture:Zi.Normal,u_occlusionTexture:Zi.Occlusion,u_emissionTexture:Zi.Emission,u_lutTexture:Zi.LUT,u_color_mix:[ne.r,ne.g,ne.b,oe],u_aoIntensity:ae,u_emissive_strength:z,u_occlusionTextureTransform:j||[0,0,0,0]}},Vc=(u,t=pl,r=pl)=>({u_matrix:u,u_instance:t,u_node_matrix:r}),G3={fillExtrusion:u=>({u_matrix:new s.bJ(u),u_lightpos:new s.bL(u),u_lightintensity:new s.bM(u),u_lightcolor:new s.bL(u),u_vertical_gradient:new s.bM(u),u_opacity:new s.bM(u),u_edge_radius:new s.bM(u),u_width_scale:new s.bM(u),u_ao:new s.bK(u),u_height_type:new s.bN(u),u_base_type:new s.bN(u),u_tile_id:new s.bL(u),u_zoom_transition:new s.bM(u),u_inv_rot_matrix:new s.bJ(u),u_merc_center:new s.bK(u),u_up_dir:new s.bL(u),u_height_lift:new s.bM(u),u_flood_light_color:new s.bL(u),u_vertical_scale:new s.bM(u),u_flood_light_intensity:new s.bM(u),u_ground_shadow_factor:new s.bL(u)}),fillExtrusionDepth:u=>({u_matrix:new s.bJ(u),u_edge_radius:new s.bM(u),u_width_scale:new s.bM(u),u_vertical_scale:new s.bM(u),u_height_type:new s.bN(u),u_base_type:new s.bN(u)}),fillExtrusionPattern:u=>({u_matrix:new s.bJ(u),u_lightpos:new s.bL(u),u_lightintensity:new s.bM(u),u_lightcolor:new s.bL(u),u_vertical_gradient:new s.bM(u),u_height_factor:new s.bM(u),u_edge_radius:new s.bM(u),u_width_scale:new s.bM(u),u_ao:new s.bK(u),u_height_type:new s.bN(u),u_base_type:new s.bN(u),u_tile_id:new s.bL(u),u_zoom_transition:new s.bM(u),u_inv_rot_matrix:new s.bJ(u),u_merc_center:new s.bK(u),u_up_dir:new s.bL(u),u_height_lift:new s.bM(u),u_image:new s.bN(u),u_texsize:new s.bK(u),u_pixel_coord_upper:new s.bK(u),u_pixel_coord_lower:new s.bK(u),u_tile_units_to_pixels:new s.bM(u),u_opacity:new s.bM(u)}),fillExtrusionGroundEffect:u=>({u_matrix:new s.bJ(u),u_opacity:new s.bM(u),u_ao_pass:new s.bM(u),u_meter_to_tile:new s.bM(u),u_ao:new s.bK(u),u_flood_light_intensity:new s.bM(u),u_flood_light_color:new s.bL(u),u_attenuation:new s.bM(u),u_edge_radius:new s.bM(u),u_fb:new s.bN(u),u_fb_size:new s.bM(u),u_dynamic_offset:new s.bM(u)}),fill:u=>({u_matrix:new s.bJ(u),u_emissive_strength:new s.bM(u)}),fillPattern:u=>({u_matrix:new s.bJ(u),u_emissive_strength:new s.bM(u),u_image:new s.bN(u),u_texsize:new s.bK(u),u_pixel_coord_upper:new s.bK(u),u_pixel_coord_lower:new s.bK(u),u_tile_units_to_pixels:new s.bM(u)}),fillOutline:u=>({u_matrix:new s.bJ(u),u_emissive_strength:new s.bM(u),u_world:new s.bK(u)}),fillOutlinePattern:u=>({u_matrix:new s.bJ(u),u_emissive_strength:new s.bM(u),u_world:new s.bK(u),u_image:new s.bN(u),u_texsize:new s.bK(u),u_pixel_coord_upper:new s.bK(u),u_pixel_coord_lower:new s.bK(u),u_tile_units_to_pixels:new s.bM(u)}),elevatedStructures:u=>({u_matrix:new s.bJ(u)}),elevatedStructuresDepthReconstruct:u=>({u_matrix:new s.bJ(u),u_camera_pos:new s.bL(u),u_depth_bias:new s.bM(u),u_height_scale:new s.bM(u),u_reset_depth:new s.bM(u)}),circle:s.cT,collisionBox:u=>({u_matrix:new s.bJ(u),u_camera_to_center_distance:new s.bM(u),u_extrude_scale:new s.bK(u)}),collisionCircle:u=>({u_matrix:new s.bJ(u),u_inv_matrix:new s.bJ(u),u_camera_to_center_distance:new s.bM(u),u_viewport_size:new s.bK(u)}),debug:u=>({u_color:new s.cA(u),u_matrix:new s.bJ(u),u_overlay:new s.bN(u),u_overlay_scale:new s.bM(u)}),clippingMask:u=>({u_matrix:new s.bJ(u)}),heatmap:u=>({u_extrude_scale:new s.bM(u),u_intensity:new s.bM(u),u_matrix:new s.bJ(u),u_inv_rot_matrix:new s.bJ(u),u_merc_center:new s.bK(u),u_tile_id:new s.bL(u),u_zoom_transition:new s.bM(u),u_up_dir:new s.bL(u)}),heatmapTexture:u=>({u_image:new s.bN(u),u_color_ramp:new s.bN(u),u_opacity:new s.bM(u)}),hillshade:u=>({u_matrix:new s.bJ(u),u_image:new s.bN(u),u_latrange:new s.bK(u),u_light:new s.bK(u),u_shadow:new s.cA(u),u_highlight:new s.cA(u),u_emissive_strength:new s.bM(u),u_accent:new s.cA(u)}),hillshadePrepare:u=>({u_matrix:new s.bJ(u),u_image:new s.bN(u),u_dimension:new s.bK(u),u_zoom:new s.bM(u)}),line:s.cU,linePattern:s.cV,raster:u=>({u_matrix:new s.bJ(u),u_normalize_matrix:new s.bJ(u),u_globe_matrix:new s.bJ(u),u_merc_matrix:new s.bJ(u),u_grid_matrix:new s.cB(u),u_tl_parent:new s.bK(u),u_scale_parent:new s.bM(u),u_fade_t:new s.bM(u),u_opacity:new s.bM(u),u_image0:new s.bN(u),u_image1:new s.bN(u),u_brightness_low:new s.bM(u),u_brightness_high:new s.bM(u),u_saturation_factor:new s.bM(u),u_contrast_factor:new s.bM(u),u_spin_weights:new s.bL(u),u_perspective_transform:new s.bK(u),u_raster_elevation:new s.bM(u),u_zoom_transition:new s.bM(u),u_merc_center:new s.bK(u),u_cutoff_params:new s.cb(u),u_colorization_mix:new s.cb(u),u_colorization_offset:new s.bM(u),u_color_ramp:new s.bN(u),u_texture_offset:new s.bK(u),u_texture_res:new s.bK(u),u_emissive_strength:new s.bM(u)}),rasterParticle:u=>({u_matrix:new s.bJ(u),u_normalize_matrix:new s.bJ(u),u_globe_matrix:new s.bJ(u),u_merc_matrix:new s.bJ(u),u_grid_matrix:new s.cB(u),u_tl_parent:new s.bK(u),u_scale_parent:new s.bM(u),u_fade_t:new s.bM(u),u_opacity:new s.bM(u),u_image0:new s.bN(u),u_image1:new s.bN(u),u_raster_elevation:new s.bM(u),u_zoom_transition:new s.bM(u),u_merc_center:new s.bK(u),u_cutoff_params:new s.cb(u)}),rasterParticleTexture:u=>({u_texture:new s.bN(u),u_opacity:new s.bM(u)}),rasterParticleDraw:u=>({u_particle_texture:new s.bN(u),u_particle_texture_side_len:new s.bM(u),u_tile_offset:new s.bK(u),u_velocity:new s.bN(u),u_color_ramp:new s.bN(u),u_velocity_res:new s.bK(u),u_max_speed:new s.bM(u),u_uv_offset:new s.bK(u),u_data_scale:new s.bK(u),u_data_offset:new s.bM(u),u_particle_pos_scale:new s.bM(u),u_particle_pos_offset:new s.bK(u)}),rasterParticleUpdate:u=>({u_particle_texture:new s.bN(u),u_particle_texture_side_len:new s.bM(u),u_velocity:new s.bN(u),u_velocity_res:new s.bK(u),u_max_speed:new s.bM(u),u_speed_factor:new s.bM(u),u_reset_rate:new s.bM(u),u_rand_seed:new s.bM(u),u_uv_offset:new s.bK(u),u_data_scale:new s.bK(u),u_data_offset:new s.bM(u),u_particle_pos_scale:new s.bM(u),u_particle_pos_offset:new s.bK(u)}),symbol:u=>({u_is_size_zoom_constant:new s.bN(u),u_is_size_feature_constant:new s.bN(u),u_size_t:new s.bM(u),u_size:new s.bM(u),u_camera_to_center_distance:new s.bM(u),u_rotate_symbol:new s.bN(u),u_aspect_ratio:new s.bM(u),u_fade_change:new s.bM(u),u_matrix:new s.bJ(u),u_label_plane_matrix:new s.bJ(u),u_coord_matrix:new s.bJ(u),u_is_text:new s.bN(u),u_elevation_from_sea:new s.bN(u),u_pitch_with_map:new s.bN(u),u_texsize:new s.bK(u),u_texsize_icon:new s.bK(u),u_texture:new s.bN(u),u_texture_icon:new s.bN(u),u_gamma_scale:new s.bM(u),u_device_pixel_ratio:new s.bM(u),u_tile_id:new s.bL(u),u_zoom_transition:new s.bM(u),u_inv_rot_matrix:new s.bJ(u),u_merc_center:new s.bK(u),u_camera_forward:new s.bL(u),u_tile_matrix:new s.bJ(u),u_up_vector:new s.bL(u),u_ecef_origin:new s.bL(u),u_is_halo:new s.bN(u),u_icon_transition:new s.bM(u),u_color_adj_mat:new s.bJ(u),u_scale_factor:new s.bM(u)}),background:u=>({u_matrix:new s.bJ(u),u_emissive_strength:new s.bM(u),u_opacity:new s.bM(u),u_color:new s.cA(u)}),backgroundPattern:u=>({u_matrix:new s.bJ(u),u_emissive_strength:new s.bM(u),u_opacity:new s.bM(u),u_image:new s.bN(u),u_pattern_tl:new s.bK(u),u_pattern_br:new s.bK(u),u_texsize:new s.bK(u),u_pattern_size:new s.bK(u),u_pixel_coord_upper:new s.bK(u),u_pixel_coord_lower:new s.bK(u),u_pattern_units_to_pixels:new s.bK(u)}),terrainRaster:u=>({u_matrix:new s.bJ(u),u_image0:new s.bN(u),u_skirt_height:new s.bM(u),u_ground_shadow_factor:new s.bL(u)}),skybox:u=>({u_matrix:new s.bJ(u),u_sun_direction:new s.bL(u),u_cubemap:new s.bN(u),u_opacity:new s.bM(u),u_temporal_offset:new s.bM(u)}),skyboxGradient:u=>({u_matrix:new s.bJ(u),u_color_ramp:new s.bN(u),u_center_direction:new s.bL(u),u_radius:new s.bM(u),u_opacity:new s.bM(u),u_temporal_offset:new s.bM(u)}),skyboxCapture:u=>({u_matrix_3f:new s.cB(u),u_sun_direction:new s.bL(u),u_sun_intensity:new s.bM(u),u_color_tint_r:new s.cb(u),u_color_tint_m:new s.cb(u),u_luminance:new s.bM(u)}),globeRaster:u=>({u_proj_matrix:new s.bJ(u),u_globe_matrix:new s.bJ(u),u_normalize_matrix:new s.bJ(u),u_merc_matrix:new s.bJ(u),u_zoom_transition:new s.bM(u),u_merc_center:new s.bK(u),u_image0:new s.bN(u),u_grid_matrix:new s.cB(u),u_skirt_height:new s.bM(u),u_far_z_cutoff:new s.bM(u),u_frustum_tl:new s.bL(u),u_frustum_tr:new s.bL(u),u_frustum_br:new s.bL(u),u_frustum_bl:new s.bL(u),u_globe_pos:new s.bL(u),u_globe_radius:new s.bM(u),u_viewport:new s.bK(u)}),globeAtmosphere:u=>({u_frustum_tl:new s.bL(u),u_frustum_tr:new s.bL(u),u_frustum_br:new s.bL(u),u_frustum_bl:new s.bL(u),u_horizon:new s.bM(u),u_transition:new s.bM(u),u_fadeout_range:new s.bM(u),u_color:new s.cb(u),u_high_color:new s.cb(u),u_space_color:new s.cb(u),u_temporal_offset:new s.bM(u),u_horizon_angle:new s.bM(u)}),model:u=>({u_matrix:new s.bJ(u),u_lighting_matrix:new s.bJ(u),u_normal_matrix:new s.bJ(u),u_node_matrix:new s.bJ(u),u_lightpos:new s.bL(u),u_lightintensity:new s.bM(u),u_lightcolor:new s.bL(u),u_camera_pos:new s.bL(u),u_opacity:new s.bM(u),u_baseColorFactor:new s.cb(u),u_emissiveFactor:new s.cb(u),u_metallicFactor:new s.bM(u),u_roughnessFactor:new s.bM(u),u_baseTextureIsAlpha:new s.bN(u),u_alphaMask:new s.bN(u),u_alphaCutoff:new s.bM(u),u_baseColorTexture:new s.bN(u),u_metallicRoughnessTexture:new s.bN(u),u_normalTexture:new s.bN(u),u_occlusionTexture:new s.bN(u),u_emissionTexture:new s.bN(u),u_lutTexture:new s.bN(u),u_color_mix:new s.cb(u),u_aoIntensity:new s.bM(u),u_emissive_strength:new s.bM(u),u_occlusionTextureTransform:new s.cb(u)}),modelDepth:u=>({u_matrix:new s.bJ(u),u_instance:new s.bJ(u),u_node_matrix:new s.bJ(u)}),groundShadow:u=>({u_matrix:new s.bJ(u),u_ground_shadow_factor:new s.bL(u)}),stars:u=>({u_matrix:new s.bJ(u),u_up:new s.bL(u),u_right:new s.bL(u),u_intensity_multiplier:new s.bM(u)}),snowParticle:u=>({u_modelview:new s.bJ(u),u_projection:new s.bJ(u),u_time:new s.bM(u),u_cam_pos:new s.bL(u),u_velocityConeAperture:new s.bM(u),u_velocity:new s.bM(u),u_horizontalOscillationRadius:new s.bM(u),u_horizontalOscillationRate:new s.bM(u),u_boxSize:new s.bM(u),u_billboardSize:new s.bM(u),u_simpleShapeParameters:new s.bK(u),u_screenSize:new s.bK(u),u_thinningCenterPos:new s.bK(u),u_thinningShape:new s.bL(u),u_thinningAffectedRatio:new s.bM(u),u_thinningParticleOffset:new s.bM(u),u_particleColor:new s.cb(u),u_direction:new s.bL(u)}),rainParticle:u=>({u_modelview:new s.bJ(u),u_projection:new s.bJ(u),u_time:new s.bM(u),u_cam_pos:new s.bL(u),u_texScreen:new s.bN(u),u_velocityConeAperture:new s.bM(u),u_velocity:new s.bM(u),u_boxSize:new s.bM(u),u_rainDropletSize:new s.bK(u),u_distortionStrength:new s.bM(u),u_rainDirection:new s.bL(u),u_color:new s.cb(u),u_screenSize:new s.bK(u),u_thinningCenterPos:new s.bK(u),u_thinningShape:new s.bL(u),u_thinningAffectedRatio:new s.bM(u),u_thinningParticleOffset:new s.bM(u),u_shapeDirectionalPower:new s.bM(u),u_shapeNormalPower:new s.bM(u),u_mode:new s.bM(u)}),vignette:u=>({u_vignetteShape:new s.bL(u),u_vignetteColor:new s.cb(u)}),occlusion:u=>({u_matrix:new s.bJ(u),u_anchorPos:new s.bL(u),u_screenSizePx:new s.bK(u),u_occluderSizePx:new s.bK(u),u_color:new s.cb(u)})};class Hn{constructor(t,r,c,d){this.id=Hn.uniqueIdxCounter,Hn.uniqueIdxCounter++,this.context=t;const f=t.gl;this.buffer=f.createBuffer(),this.dynamicDraw=!!c,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),f.bufferData(f.ELEMENT_ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?f.DYNAMIC_DRAW:f.STATIC_DRAW),this.dynamicDraw||d||r.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){this.id=Hn.uniqueIdxCounter,Hn.uniqueIdxCounter++;const r=this.context.gl;this.context.unbindVAO(),this.bind(),r.bufferSubData(r.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}Hn.uniqueIdxCounter=0;const q3={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class $3{constructor(t,r,c,d,f,_){this.length=r.length,this.attributes=c,this.itemSize=r.bytesPerElement,this.dynamicDraw=d,this.instanceCount=_,this.context=t;const T=t.gl;this.buffer=T.createBuffer(),t.bindVertexBuffer.set(this.buffer),T.bufferData(T.ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?T.DYNAMIC_DRAW:T.STATIC_DRAW),this.dynamicDraw||f||r.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){const r=this.context.gl;this.bind(),r.bufferSubData(r.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,r){for(let c=0;c0&&t.vertexAttribDivisor(f,c)}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class jr{constructor(t,r,c,d,f){this.context=t,this.width=r,this.height=c;const _=this.framebuffer=t.gl.createFramebuffer();d&&(this.colorAttachment=new I3(t,_)),f&&(this.depthAttachmentType=f,this.depthAttachment=f==="renderbuffer"?new P3(t,_):new ea(t,_))}destroy(){const t=this.context.gl;if(this.colorAttachment){const r=this.colorAttachment.get();r&&t.deleteTexture(r)}if(this.depthAttachment&&this.depthAttachmentType)if(this.depthAttachmentType==="renderbuffer"){const r=this.depthAttachment.get();r&&t.deleteRenderbuffer(r)}else{const r=this.depthAttachment.get();r&&t.deleteTexture(r)}t.deleteFramebuffer(this.framebuffer)}}class Go{constructor(t,r){this.gl=t,this.clearColor=new kh(this),this.clearDepth=new y3(this),this.clearStencil=new x3(this),this.colorMask=new v3(this),this.depthMask=new b3(this),this.stencilMask=new Ec(this),this.stencilFunc=new Mc(this),this.stencilOp=new Fh(this),this.stencilTest=new t0(this),this.depthRange=new i0(this),this.depthTest=new Ac(this),this.depthFunc=new on(this),this.blend=new w3(this),this.blendFunc=new el(this),this.blendColor=new tl(this),this.blendEquation=new T3(this),this.cullFace=new S3(this),this.cullFaceSide=new E3(this),this.frontFace=new il(this),this.program=new M3(this),this.activeTexture=new A3(this),this.viewport=new rl(this),this.bindFramebuffer=new Ic(this),this.bindRenderbuffer=new Pc(this),this.bindTexture=new Qs(this),this.bindVertexBuffer=new Bh(this),this.bindElementBuffer=new Nh(this),this.bindVertexArrayOES=new Vh(this),this.pixelStoreUnpack=new Uh(this),this.pixelStoreUnpackPremultiplyAlpha=new jh(this),this.pixelStoreUnpackFlipY=new Gh(this),this.options=r?Object.assign({},r):{},this.options.extTextureFilterAnisotropicForceOff||(this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))),this.extDebugRendererInfo=t.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=t.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=t.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),this.forceManualRenderingForInstanceIDShaders=r&&!!r.forceManualRenderingForInstanceIDShaders||this.renderer&&this.renderer.indexOf("PowerVR")!==-1,this.options.extTextureFloatLinearForceOff||(this.extTextureFloatLinear=t.getExtension("OES_texture_float_linear")),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float"),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query_webgl2"),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),this.maxPointSize=t.getParameter(t.ALIASED_POINT_SIZE_RANGE)[1]}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArrayOES.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,r,c){return new Hn(this,t,r,c)}createVertexBuffer(t,r,c,d,f){return new $3(this,t,r,c,d,f)}createRenderbuffer(t,r,c){const d=this.gl,f=d.createRenderbuffer();return this.bindRenderbuffer.set(f),d.renderbufferStorage(d.RENDERBUFFER,t,r,c),this.bindRenderbuffer.set(null),f}createFramebuffer(t,r,c,d){return new jr(this,t,r,c,d)}clear({color:t,depth:r,stencil:c,colorMask:d}){const f=this.gl;let _=0;t&&(_|=f.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set(d||[!0,!0,!0,!0])),r!==void 0&&(_|=f.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),c!==void 0&&(_|=f.STENCIL_BUFFER_BIT,this.clearStencil.set(c),this.stencilMask.set(255)),f.clear(_)}setCullFace(t){t.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){s.bn(t.blendFunction,Zt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor),t.blendEquation?this.blendEquation.set(t.blendEquation):this.blendEquation.setDefault()),this.colorMask.set(t.mask)}unbindVAO(){this.bindVertexArrayOES.set(null)}}let s0;function fl(u,t,r,c,d,f,_){const T=u.context,E=T.gl,M=u.transform,A=u.getOrCreateProgram("collisionBox"),z=[];let C=0,k=0;for(let te=0;te0){const Se=s.ad.mat4.create(),Ve=he;s.ad.mat4.mul(Se,oe.placementInvProjMatrix,M.glCoordMatrix),s.ad.mat4.mul(Se,Se,oe.placementViewportMatrix),z.push({circleArray:Ce,circleOffset:k,transform:Ve,invTransform:Se,projection:oe.getProjection()}),C+=Ce.length/4,k=C}fe&&(u.terrain&&u.terrain.setupElevationDraw(ne,A),A.draw(u,E.LINES,xt.disabled,Lt.disabled,u.colorModeForRenderPass(),zt.disabled,kc(he,M,ne,oe.getProjection()),r.id,fe.layoutVertexBuffer,fe.indexBuffer,fe.segments,null,M.zoom,null,[fe.collisionVertexBuffer,fe.collisionVertexBufferExt]))}if(!_||!z.length)return;const j=u.getOrCreateProgram("collisionCircle"),N=new s.cW;N.resize(4*C),N._trim();let G=0;for(const te of z)for(let ae=0;ae=0&&(j[te.associatedIconIndex]={x:Se,y:Ve,z:Ue,angle:Be})}else Rn(oe,C)}if(A){k.clear();const ie=u.icon.placedSymbolArray;for(let te=0;te{se.depthOcclusionForSymbolsAndCircles&&(r.hasInitialOcclusionOpacityProperties||u.terrain)&&(wi.push("DEPTH_D24"),wi.push("DEPTH_OCCLUSION"))},Qt=()=>{const wi=he&&r.layout.get("symbol-placement")!=="point",li=[];Et(li);const $i=wi||Tt,Qi=r.paint.get("icon-image-cross-fade").constantOr(0);u.terrainRenderModeElevated()&&Ce&&li.push("PITCH_WITH_MAP_TERRAIN"),et&&(li.push("PROJECTION_GLOBE_VIEW"),$i&&li.push("PROJECTED_POS_ON_VIEWPORT")),Qi>0&&li.push("ICON_TRANSITION"),qe.icon.zOffsetVertexBuffer&&li.push("Z_OFFSET"),$===0&&K===0&&ie===0&&te===1||li.push("COLOR_ADJUSTMENT"),qe.sdfIcons&&li.push("RENDER_SDF");const or=qe.icon.programConfigurations.get(r.id),ar=u.getOrCreateProgram("symbol",{config:or,defines:li}),cn=ze.imageAtlasTexture?ze.imageAtlasTexture.size:[0,0],zr=qe.iconSizeData,si=s.bp(zr,se.zoom),Bi=Ce||se.pitch!==0,fi=ro(it,ze.tileID.canonical,Ce,he,se,qe.getProjection(),ft),Ei=Xi(it,ze.tileID.canonical,Ce,he,se,qe.getProjection(),ft),yr=u.translatePosMatrix(Ei,ze,T,M,!0),Di=u.translatePosMatrix(it,ze,T,M),sr=$i?oa:fi,Xn=he&&!Ce&&!wi;let Kr=ke;!be&&!se.mercatorFromTransition||he||(Kr=ml(se));const Sn=et?Kr:ke,Gr=r.getColorAdjustmentMatrix($,K,ie,te),En=dl(zr.kind,si,Xn,Ce,u,Di,sr,yr,ae,!1,cn,[0,0],!0,je,tt,Te,Pt,Sn,qe.getProjection(),Gr,Qi),Jr=ze.imageAtlasTexture?ze.imageAtlasTexture:null,go=r.layout.get("icon-size").constantOr(0)!==1||qe.iconsNeedLinear,Yn=qe.sdfIcons||u.options.rotating||u.options.zooming||go||Bi?oe.LINEAR:oe.NEAREST,yo=qe.sdfIcons&&r.paint.get("icon-halo-width").constantOr(1)!==0,g1=u.terrain&&Ce&&wi?s.ad.mat4.invert(s.ad.mat4.create(),fi):oa;if(wi&&qe.icon){const xa=se.elevation,Dl=xa?xa.getAtTileOffsetFunc(je,se.center.lat,se.worldSize,qe.getProjection()):null,y1=vr(it,ze.tileID.canonical,Ce,he,se,qe.getProjection(),ft);js(qe,it,u,!1,y1,Ei,Ce,N,Dl,je)}return{program:ar,buffers:qe.icon,uniformValues:En,atlasTexture:Jr,atlasTextureIcon:null,atlasInterpolation:Yn,atlasInterpolationIcon:null,isSDF:qe.sdfIcons,hasHalo:yo,tile:ze,labelPlaneMatrixInv:g1}},pi=()=>{const wi=fe&&r.layout.get("symbol-placement")!=="point",li=[],$i=wi||Ne||Tt;u.terrainRenderModeElevated()&&Se&&li.push("PITCH_WITH_MAP_TERRAIN"),et&&(li.push("PROJECTION_GLOBE_VIEW"),$i&&li.push("PROJECTED_POS_ON_VIEWPORT")),qe.text.zOffsetVertexBuffer&&li.push("Z_OFFSET"),qe.iconsInText&&li.push("RENDER_TEXT_AND_SYMBOL"),li.push("RENDER_SDF"),Et(li);const Qi=qe.text.programConfigurations.get(r.id),or=u.getOrCreateProgram("symbol",{config:Qi,defines:li});let ar,cn=[0,0],zr=null;const si=qe.textSizeData;qe.iconsInText&&(cn=ze.imageAtlasTexture?ze.imageAtlasTexture.size:[0,0],zr=ze.imageAtlasTexture?ze.imageAtlasTexture:null,ar=Se||se.pitch!==0||u.options.rotating||u.options.zooming||si.kind==="composite"||si.kind==="camera"?oe.LINEAR:oe.NEAREST);const Bi=ze.glyphAtlasTexture?ze.glyphAtlasTexture.size:[0,0],fi=r.layout.get("text-size-scale-range"),Ei=s.ay(u.scaleFactor,fi[0],fi[1]),yr=s.bp(si,se.zoom,Ei),Di=ro(it,ze.tileID.canonical,Se,fe,se,qe.getProjection(),ft),sr=Xi(it,ze.tileID.canonical,Se,fe,se,qe.getProjection(),ft),Xn=u.translatePosMatrix(sr,ze,E,A,!0),Kr=u.translatePosMatrix(it,ze,E,A),Sn=$i?oa:Di,Gr=fe&&!Se&&!wi;let En=ke;!be&&!se.mercatorFromTransition||fe||(En=ml(se));const Jr=dl(si.kind,yr,Gr,Se,u,Kr,Sn,Xn,ae,!0,Bi,cn,!0,je,tt,Te,Pt,et?En:ke,qe.getProjection(),null,null,Ei),go=ze.glyphAtlasTexture?ze.glyphAtlasTexture:null,Yn=oe.LINEAR,yo=r.paint.get("text-halo-width").constantOr(1)!==0,g1=u.terrain&&Se&&wi?s.ad.mat4.invert(s.ad.mat4.create(),Di):oa;if(wi&&qe.text){const xa=se.elevation,Dl=xa?xa.getAtTileOffsetFunc(je,se.center.lat,se.worldSize,qe.getProjection()):null,y1=vr(it,ze.tileID.canonical,Se,fe,se,qe.getProjection(),ft);js(qe,it,u,!0,y1,sr,Se,G,Dl,je)}return{program:or,buffers:qe.text,uniformValues:Jr,atlasTexture:go,atlasTextureIcon:zr,atlasInterpolation:Yn,atlasInterpolationIcon:ar,isSDF:!0,hasHalo:yo,tile:ze,labelPlaneMatrixInv:g1}},Pi=qe.icon.segments.get().length,Ht=qe.text.segments.get().length,Fi=Pi&&!_.onlyText?Qt():null,Ot=Ht&&!_.onlyIcons?pi():null,mt=r.paint.get("icon-opacity").constantOr(1),ti=r.paint.get("text-opacity").constantOr(1);if(Ve&&qe.canOverlap){Ue=!0;const wi=mt&&!_.onlyText?qe.icon.segments.get():[],li=ti&&!_.onlyIcons?qe.text.segments.get():[];for(const $i of wi)Be.push({segments:new s.b8([$i]),sortKey:$i.sortKey,state:Fi});for(const $i of li)Be.push({segments:new s.b8([$i]),sortKey:$i.sortKey,state:Ot})}else _.onlyText||Be.push({segments:mt?qe.icon.segments:new s.b8([]),sortKey:0,state:Fi}),_.onlyIcons||Be.push({segments:ti?qe.text.segments:new s.b8([]),sortKey:0,state:Ot})}Ue&&Be.sort((je,ze)=>je.sortKey-ze.sortKey);for(const je of Be){const ze=je.state;if(ze)if(u.terrain?u.terrain.setupElevationDraw(ze.tile,ze.program,{useDepthForOcclusion:se.depthOcclusionForSymbolsAndCircles,labelPlaneMatrixInv:ze.labelPlaneMatrixInv}):u.setupDepthForOcclusion(se.depthOcclusionForSymbolsAndCircles,ze.program),ne.activeTexture.set(oe.TEXTURE0),ze.atlasTexture&&ze.atlasTexture.bind(ze.atlasInterpolation,oe.CLAMP_TO_EDGE,!0),ze.atlasTextureIcon&&(ne.activeTexture.set(oe.TEXTURE1),ze.atlasTextureIcon&&ze.atlasTextureIcon.bind(ze.atlasInterpolationIcon,oe.CLAMP_TO_EDGE,!0)),u.uploadCommonLightUniforms(u.context,ze.program),ze.hasHalo){const qe=ze.uniformValues;qe.u_is_halo=1,sa(ze.buffers,je.segments,r,u,ze.program,We,d,f,qe,2),qe.u_is_halo=0}else{if(ze.isSDF){const qe=ze.uniformValues;ze.hasHalo&&(qe.u_is_halo=1,sa(ze.buffers,je.segments,r,u,ze.program,We,d,f,qe,1)),qe.u_is_halo=0}sa(ze.buffers,je.segments,r,u,ze.program,We,d,f,ze.uniformValues,1)}}}function sa(u,t,r,c,d,f,_,T,E,M){const A=[u.dynamicLayoutVertexBuffer,u.opacityVertexBuffer,u.iconTransitioningVertexBuffer,u.globeExtVertexBuffer,u.zOffsetVertexBuffer];d.draw(c,c.context.gl.TRIANGLES,f,_,T,zt.disabled,E,r.id,u.layoutVertexBuffer,u.indexBuffer,t,r.paint,c.transform.zoom,u.programConfigurations.get(r.id),A,M)}function H3(u,t){const r=1<=Je?1:j/Je))),2*N}(u.transform),M=u.transform.getFreeCameraOptions().position,A="elevatedStructuresDepthReconstruct",z=u.getOrCreateProgram(A,{defines:["DEPTH_RECONSTRUCTION"]}),C=u.getOrCreateProgram(A);for(const k of c){const j=t.getTile(k),N=j.getBucket(r);if(!N)continue;const G=N.elevatedStructures;if(!G)continue;const $=N.elevationBufferData.heightRange,K=H3(k.toUnwrapped(),M),ie=u.translatePosMatrix(k.projMatrix,j,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));let te,ae,ne,oe;if(d==="initialize"){if(!$||$.min>=1||G.depthSegments.segments[0].primitiveLength===0)continue;te=o0(ie,K,E,1,0),ae=_,ne=G.depthSegments,oe=z}else if(d==="reset"){if(!$||$.min>=0||G.maskSegments.segments[0].primitiveLength===0)continue;te=o0(ie,K,0,0,1),ae=T,ne=G.maskSegments,oe=z}else if(d==="geometry"){if(G.depthSegments.segments[0].primitiveLength===0)continue;te=o0(ie,K,E,1,0),ae=_,ne=G.depthSegments,oe=C}oe.draw(u,f.TRIANGLES,ae,Lt.disabled,Zt.disabled,zt.disabled,te,r.id,G.vertexBuffer,G.indexBuffer,ne,r.paint,u.transform.zoom)}}function _l(u,t,r){const{painter:c,sourceCache:d,layer:f,coords:_,colorMode:T,elevationType:E,terrainEnabled:M,pass:A}=u,z=c.context.gl,C=f.paint.get("fill-pattern");let k=E;E!=="road"||t&&!M||(k="none");const j=k==="road",N=new xt(c.context.gl.LEQUAL,xt.ReadWrite,c.depthRangeFor3D),G=C&&C.constantOr(1),$=(K,ie)=>{let te,ae,ne,oe,se;ie?(ae=G&&!f.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",te=z.LINES):(ae=G?"fillPattern":"fill",te=z.TRIANGLES);for(const he of _){const fe=d.getTile(he);if(G&&!fe.patternsLoaded())continue;const Ce=fe.getBucket(f);if(!Ce)continue;const Se=t?Ce.elevationBufferData:Ce.bufferData;if(Se.isEmpty())continue;c.prepareDrawTile();const Ve=Se.programConfigurations.get(f.id),Ue=c.isTileAffectedByFog(he),We=[],Te=[];j&&(We.push("ELEVATED_ROADS"),Te.push(Se.elevatedLayoutVertexBuffer));const Ne=c.getOrCreateProgram(ae,{config:Ve,overrideFog:Ue,defines:We});G&&(c.context.activeTexture.set(z.TEXTURE0),fe.imageAtlasTexture&&fe.imageAtlasTexture.bind(z.LINEAR,z.CLAMP_TO_EDGE),Ve.updatePaintBuffers());const be=C.constantOr(null);if(be&&fe.imageAtlas){const je=fe.imageAtlas,ze=s.d0.from(be).getPrimary().scaleSelf(s.q.devicePixelRatio).toString(),qe=je.patternPositions.get(ze);qe&&Ve.setConstantPatternPositions(qe)}const Be=c.translatePosMatrix(he.projMatrix,fe,f.paint.get("fill-translate"),f.paint.get("fill-translate-anchor")),ke=f.paint.get("fill-emissive-strength");if(ie){oe=Se.lineIndexBuffer,se=Se.lineSegments;const je=c.terrain&&c.terrain.renderingToTexture?c.terrain.drapeBufferSize:[z.drawingBufferWidth,z.drawingBufferHeight];ne=ae==="fillOutlinePattern"&&G?ul(Be,ke,c,fe,je):cl(Be,ke,je)}else oe=Se.indexBuffer,se=Se.triangleSegments,ne=G?F3(Be,ke,c,fe):ra(Be,ke);c.uploadCommonUniforms(c.context,Ne,he.toUnwrapped()),Ne.draw(c,te,k!=="none"?N:K,r||c.stencilModeForClipping(he),T,zt.disabled,ne,f.id,Se.layoutVertexBuffer,oe,se,f.paint,c.transform.zoom,Ve,Te)}};c.renderPass===A&&$(c.depthModeForSublayer(1,c.renderPass==="opaque"?xt.ReadWrite:xt.ReadOnly),!1),k==="none"&&c.renderPass==="translucent"&&f.paint.get("fill-antialias")&&$(c.depthModeForSublayer(f.getPaintProperty("fill-outline-color")?2:0,xt.ReadOnly),!0)}function a0(u,t,r,c,d,f,_,T){r.resetLayerRenderingStats(u);const E=u.context,M=E.gl,A=u.transform,z=r.paint.get("fill-extrusion-pattern"),C=z.constantOr(1),k=r.paint.get("fill-extrusion-opacity"),j=u.style.enable3dLights(),N=r.paint.get(j&&!C?"fill-extrusion-ambient-occlusion-wall-radius":"fill-extrusion-ambient-occlusion-radius"),G=[r.paint.get("fill-extrusion-ambient-occlusion-intensity"),N],$=r.layout.get("fill-extrusion-edge-radius"),K=$>0&&!r.paint.get("fill-extrusion-rounded-roof"),ie=K?0:$,te=A.projection.name==="globe"?s.d6():0,ae=A.projection.name==="globe",ne=ae?s.ag(A.zoom):0,oe=[s.av(A.center.lng),s.aC(A.center.lat)],se=r.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default")==="none",he=r.paint.get("fill-extrusion-flood-light-color").toRenderColor(se?null:r.lut).toArray01().slice(0,3),fe=r.paint.get("fill-extrusion-flood-light-intensity"),Ce=r.paint.get("fill-extrusion-vertical-scale"),Se=r.paint.get("fill-extrusion-line-width").constantOr(1)!==0,Ve=r.paint.get("fill-extrusion-height-alignment"),Ue=r.paint.get("fill-extrusion-base-alignment"),We=lo(u,r.paint.get("fill-extrusion-cutoff-fade-range")),Te=[];let Ne;ae&&Te.push("PROJECTION_GLOBE_VIEW"),G[0]>0&&Te.push("FAUX_AO"),K&&Te.push("ZERO_ROOF_RADIUS"),T&&Te.push("HAS_CENTROID"),fe>0&&Te.push("FLOOD_LIGHT"),We.shouldRenderCutoff&&Te.push("RENDER_CUTOFF"),Se&&Te.push("RENDER_WALL_MODE");const be=u.renderPass==="shadow",Be=u.shadowRenderer,ke=be&&!!Be;u.shadowRenderer&&(u.shadowRenderer.useNormalOffset=!0);let je=[0,0,0];if(Be){const et=u.style.directionalLight,tt=u.style.ambientLight;et&&tt&&(je=Ws(u.style,et,tt)),be||(Te.push("RENDER_SHADOWS","DEPTH_TEXTURE"),Be.useNormalOffset&&Te.push("NORMAL_OFFSET")),Ne=Te.concat(["SHADOWS_SINGLE_CASCADE"])}const ze=ke?"fillExtrusionDepth":C?"fillExtrusionPattern":"fillExtrusion",qe=r.getLayerRenderingStats();for(const et of c){const tt=t.getTile(et),it=tt.getBucket(r);if(!it||it.projection.name!==A.projection.name)continue;let ft=!1;Be&&(ft=Be.getMaxCascadeForTile(et.toUnwrapped())===0);const Rt=u.isTileAffectedByFog(et),Tt=it.programConfigurations.get(r.id),Pt=u.getOrCreateProgram(ze,{config:Tt,defines:ft?Ne:Te,overrideFog:Rt});if(u.terrain&&u.terrain.setupElevationDraw(tt,Pt,{useMeterToDem:!0}),!it.centroidVertexBuffer){const Ot=Pt.attributes.a_centroid_pos;Ot!==void 0&&M.vertexAttrib2f(Ot,0,0)}!be&&Be&&Be.setupShadows(tt.tileID.toUnwrapped(),Pt,"vector-tile",tt.tileID.overscaledZ),C&&(u.context.activeTexture.set(M.TEXTURE0),tt.imageAtlasTexture&&tt.imageAtlasTexture.bind(M.LINEAR,M.CLAMP_TO_EDGE),Tt.updatePaintBuffers());const Et=z.constantOr(null);if(Et&&tt.imageAtlas){const Ot=tt.imageAtlas,mt=s.d0.from(Et).getPrimary().scaleSelf(s.q.devicePixelRatio),ti=Ot.patternPositions.get(mt.toString());ti&&Tt.setConstantPatternPositions(ti)}const Qt=r.paint.get("fill-extrusion-vertical-gradient"),pi=1/it.tileToMeter;let Pi;if(be&&Be){if(ua(tt.tileID,it,u))continue;const Ot=Be.calculateShadowPassMatrixFromTile(tt.tileID.toUnwrapped());Pi=ia(Ot,ie,pi,Ce,Ve,Ue)}else{const Ot=u.translatePosMatrix(et.expandedProjMatrix,tt,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),mt=A.projection.createInversionMatrix(A,et.canonical);Pi=C?k3(Ot,u,Qt,k,G,ie,pi,et,tt,te,Ve,Ue,ne,oe,mt,he,Ce):ll(Ot,u,Qt,k,G,ie,pi,et,te,Ve,Ue,ne,oe,mt,he,Ce,fe,je)}u.uploadCommonUniforms(E,Pt,et.toUnwrapped(),null,We);let Ht=it.segments;if(A.projection.name==="mercator"&&!be&&(Ht=it.getVisibleSegments(tt.tileID,u.terrain,u.transform.getFrustum(0)),!Ht.get().length))continue;if(qe)if(be)for(const Ot of Ht.get())qe.numRenderedVerticesInShadowPass+=Ot.primitiveLength;else for(const Ot of Ht.get())qe.numRenderedVerticesInTransparentPass+=Ot.primitiveLength;const Fi=[];(u.terrain||T)&&Fi.push(it.centroidVertexBuffer),ae&&Fi.push(it.layoutVertexExtBuffer),Se&&Fi.push(it.wallVertexBuffer),Pt.draw(u,E.gl.TRIANGLES,d,f,_,zt.backCCW,Pi,r.id,it.layoutVertexBuffer,it.indexBuffer,Ht,r.paint,u.transform.zoom,Tt,Fi)}u.shadowRenderer&&(u.shadowRenderer.useNormalOffset=!1)}function aa(u,t,r,c,d,f,_,T,E,M,A,z,C,k,j,N,G,$,K){const ie=u.context,te=ie.gl,ae=u.transform,ne=u.transform.zoom,oe=[],se=lo(u,r.paint.get("fill-extrusion-cutoff-fade-range"));M==="clear"?(oe.push("CLEAR_SUBPASS"),K&&(oe.push("CLEAR_FROM_TEXTURE"),ie.activeTexture.set(te.TEXTURE0),K.bind(te.LINEAR,te.CLAMP_TO_EDGE))):M==="sdf"&&oe.push("SDF_SUBPASS"),G&&oe.push("HAS_CENTROID"),se.shouldRenderCutoff&&oe.push("RENDER_CUTOFF");const he=r.layout.get("fill-extrusion-edge-radius"),fe=(Ce,Se,Ve,Ue,We)=>{const Te=Se.programConfigurations.get(r.id),Ne=u.isTileAffectedByFog(Ce),be=u.getOrCreateProgram("fillExtrusionGroundEffect",{config:Te,defines:oe,overrideFog:Ne}),Be=((je,ze,qe,et,tt,it,ft,Rt,Tt,Pt,Et)=>({u_matrix:ze,u_opacity:qe,u_ao_pass:et?1:0,u_meter_to_tile:tt,u_ao:it,u_flood_light_intensity:ft,u_flood_light_color:Rt,u_attenuation:Tt,u_edge_radius:Pt,u_fb:0,u_fb_size:Et,u_dynamic_offset:1}))(0,Ue,A,E,We,[z,C*We],k,j,N,ne>=17?0:he*We,K?K.size[0]:0),ke=[];G&&ke.push(Se.hiddenByLandmarkVertexBuffer),u.uploadCommonUniforms(ie,be,Ce.toUnwrapped(),null,se),be.draw(u,ie.gl.TRIANGLES,d,f,_,T,Be,r.id,Se.vertexBuffer,Se.indexBuffer,Ve,r.paint,ne,Te,ke)};for(const Ce of c){const Se=t.getTile(Ce),Ve=Se.getBucket(r);if(!Ve||Ve.projection.name!==ae.projection.name||!Ve.groundEffect||Ve.groundEffect&&!Ve.groundEffect.hasData())continue;const Ue=Ve.groundEffect,We=1/Ve.tileToMeter;{const Te=u.translatePosMatrix(Ce.projMatrix,Se,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),Ne=Ue.getDefaultSegment();fe(Ce,Ue,Ne,Te,We)}if($)for(let Te=0;Te<4;Te++){const Ne=s.d7[Te](Ce),be=t.getTile(Ne);if(!be)continue;const Be=be.getBucket(r);if(!Be||Be.projection.name!==ae.projection.name||!Be.groundEffect||Be.groundEffect&&!Be.groundEffect.hasData())continue;const ke=Be.groundEffect;let je,ze;Te===0?(je=[-s.ai,0,0],ze=1):Te===1?(je=[s.ai,0,0],ze=0):Te===2?(je=[0,-s.ai,0],ze=3):(je=[0,s.ai,0],ze=2);const qe=ke.regionSegments[ze];if(!qe)continue;const et=new Float32Array(16);s.ad.mat4.translate(et,Ce.projMatrix,je),fe(Ce,ke,qe,u.translatePosMatrix(et,Se,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),We)}}}function la(u,t,r,c,d,f,_){c.centroidVertexArray.length===0&&c.createCentroidsBuffer();const T=f?f.findDEMTileFor(r):null;if(!(T&&T.dem||_))return;f&&T&&T.dem&&c.selfDEMTileTimestamp!==T.dem._timestamp&&(c.borderDoneWithNeighborZ=[-1,-1,-1,-1],c.selfDEMTileTimestamp=T.dem._timestamp);const E=$=>new s.P(Math.ceil(($+s.da)*s.db),0),M=$=>{const K=t.getSource().minzoom,ie=ae=>{const ne=t.getTileByID(ae);if(ne&&ne.hasData())return ne.getBucket(d)},te=[0,-1,1];for(const ae of te){if($.overscaledZ+ae(A[0]=Math.min($.min.y,K.min.y),A[1]=Math.max($.max.y,K.max.y),A[2]=s.ai-K.min.x>$.max.x?K.min.x-s.ai:$.max.x,A),C=($,K)=>(A[0]=Math.min($.min.x,K.min.x),A[1]=Math.max($.max.x,K.max.x),A[2]=s.ai-K.min.y>$.max.y?K.min.y-s.ai:$.max.y,A),k=[($,K)=>z($,K),($,K)=>z(K,$),($,K)=>C($,K),($,K)=>C(K,$)],j=($,K,ie,te,ae,ne,oe)=>{if(!f)return 0;const se=[[ne?ie:$,ne?$:ie,0],[ne?ie:K,ne?K:ie,0]],he=oe<0?s.ai+oe:oe,fe=[ne?he:($+K)/2,ne?($+K)/2:he,0];return ie===0&&oe<0||ie!==0&&oe>0?f.getForTilePoints(ae,[fe],!0,te):se.push(fe),f.getForTilePoints(r,se,!0,T),Math.max(se[0][2],se[1][2],fe[2])/f.exaggeration()};for(let $=0;$<4;$++){const K=c.borderFeatureIndices[$];if(K.length===0)continue;const ie=s.d7[$](r),te=M(ie);if(!(te&&te instanceof s.d8))continue;const ae=f?f.findDEMTileFor(ie):null;if(!(ae&&ae.dem||_)||(f&&ae&&ae.dem&&c.borderDEMTileTimestamp[$]!==ae.dem._timestamp&&(c.borderDoneWithNeighborZ[$]=-1,c.borderDEMTileTimestamp[$]=ae.dem._timestamp),c.borderDoneWithNeighborZ[$]===te.canonical.z))continue;te.centroidVertexArray.length===0&&te.createCentroidsBuffer();const ne=($<2?1:5)-$,oe=te.borderDoneWithNeighborZ[ne]!==c.canonical.z,se=te.borderFeatureIndices[ne];let he=0;if(c.canonical.z!==te.canonical.z){for(const fe of K)c.showCentroid(c.featuresOnBorder[fe]);if(oe)for(const fe of se)te.showCentroid(te.featuresOnBorder[fe]);c.borderDoneWithNeighborZ[$]=te.canonical.z,te.borderDoneWithNeighborZ[ne]=c.canonical.z}for(const fe of K){const Ce=c.featuresOnBorder[fe],Se=c.centroidData[Ce.centroidDataIndex],Ve=Ce.borders[$];let Ue;for(;heVe[0]+3||We[0]>Ve[0]-3)break;te.showCentroid(Ue),he++}if(Ue&&heVe[1]-3)&&(Te++,++he!==se.length);)Ue=te.featuresOnBorder[se[he]];Ue=te.featuresOnBorder[se[We]];let Ne=!1;if(Te>=1){const ke=Ue.borders[ne];Math.abs(Ve[0]-ke[0])<3&&Math.abs(Ve[1]-ke[1])<3&&(Te=1,Ne=!0,he=We+1)}else if(Te===0){c.showCentroid(Ce);continue}const be=te.centroidData[Ue.centroidDataIndex];_&&Ne&&(((N=Se).flags|(G=be).flags)&s.d9?(N.flags|=s.d9,G.flags|=s.d9):(N.flags&=~s.d9,G.flags&=~s.d9));const Be=Ce.intersectsCount()>1||Ue.intersectsCount()>1;if(Te>1)he=We,Se.centroidXY=be.centroidXY=new s.P(0,0);else if(ae&&ae.dem&&!Be){const ke=k[$](Se,be),je=$%2?s.ai-1:0,ze=j(ke[0],Math.min(s.ai-1,ke[1]),je,ae,ie,$<2,ke[2]);Se.centroidXY=be.centroidXY=E(ze)}else Be?Se.centroidXY=be.centroidXY=new s.P(0,0):(Se.centroidXY=c.encodeBorderCentroid(Ce),be.centroidXY=te.encodeBorderCentroid(Ue));c.writeCentroidToBuffer(Se),te.writeCentroidToBuffer(be)}else c.showCentroid(Ce)}c.borderDoneWithNeighborZ[$]=te.canonical.z,te.borderDoneWithNeighborZ[ne]=c.canonical.z}var N,G;(c.needsCentroidUpdate||!c.centroidVertexBuffer&&c.centroidVertexArray.length!==0)&&c.uploadCentroid(u)}const ca=[1,0,0],Ye=[0,1,0],st=[0,0,1];function ua(u,t,r){const c=r.transform,d=r.shadowRenderer;if(!d)return!0;const f=u.toUnwrapped(),_=c.tileSize*d._cascades[r.currentShadowCascade].scale;let T=t.maxHeight;if(c.elevation){const N=c.elevation.getMinMaxForTile(u);N&&(T+=N.max)}const E=[...d.shadowDirection];E[2]=-E[2];const M=d.computeSimplifiedTileShadowVolume(f,T,_,E);if(!M)return!1;const A=[ca,Ye,st,E,[E[0],0,E[2]],[0,E[1],E[2]]],z=c.projection.name==="globe",C=c.scaleZoom(_),k=s.bR.fromInvProjectionMatrix(c.invProjMatrix,c.worldSize,C,!z),j=d.getCurrentCascadeFrustum();return k.intersectsPrecise(M.vertices,M.planes,A)===0||j.intersectsPrecise(M.vertices,M.planes,A)===0}function Gi(u){return[u[0]*s.dc,u[1]*s.dc,u[2]*s.dc,0]}function Ie(u,t,r,c,d,f,_,T,E){const M=c.getSource(),A=r.globeSharedBuffers;if(!A)return;let z,C,k;if(t&&(z=c.getTile(t)),M instanceof s.aK?(C=M.texture,k=s.cJ(0,0,r.transform)):z&&t&&(C=z.texture,k=s.cJ(t.canonical.z,t.canonical.x,r.transform)),!C||!k)return;u||(k=s.ad.mat4.scale(s.ad.mat4.create(),k,[1,-1,1]));const j=r.context,N=j.gl,G=d.paint.get("raster-resampling")==="nearest"?N.NEAREST:N.LINEAR,$=r.colorModeForDrapableLayerRenderPass(f),K=_.defines;K.push("GLOBE_POLES");const ie=new xt(N.LEQUAL,xt.ReadWrite,r.depthRangeFor3D),te=Float32Array.from(r.transform.expandedFarZProjMatrix),ae=Float32Array.from(s.bc(s.cI(new s.bT(0,0,0))));r.terrain&&r.terrain.prepareDrawTile(),j.activeTexture.set(N.TEXTURE0),C.bind(G,N.CLAMP_TO_EDGE),j.activeTexture.set(N.TEXTURE1),C.bind(G,N.CLAMP_TO_EDGE),"useMipmap"in C&&j.extTextureFilterAnisotropic&&r.transform.pitch>20&&N.texParameterf(N.TEXTURE_2D,j.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,j.extTextureFilterAnisotropicMax);const[ne,oe,se,he]=t?A.getPoleBuffers(t.canonical.z,!1):A.getPoleBuffers(0,!0),fe=d.paint.get("raster-elevation");let Ce;u?(Ce=ne,r.renderDefaultNorthPole=fe!==0):(Ce=oe,r.renderDefaultSouthPole=fe!==0);const Se=Gi(_.mix),Ve=((We,Te,Ne,be,Be,ke,je,ze,qe,et,tt,it,ft)=>N3(We,Te,Ne,new Float32Array(16),new Float32Array(9),[0,0],be,[0,0],[0,0,0,0],1,{opacity:1,mix:0},ke,[0,0],ze,2,et,tt,it,1,0,ft))(te,ae,k,s.ag(r.transform.zoom),0,d,0,fe,0,Se,_.offset,_.range,f),Ue=r.getOrCreateProgram("raster",{defines:K});r.uploadCommonUniforms(j,Ue,null),Ue.draw(r,N.TRIANGLES,ie,E,$,T,Ve,d.id,Ce,se,he)}function jc(u){const t=u._nearZ,r=u.projection.farthestPixelDistance(u),c=r-t,d=.2*u.height,f=t+d;return[t,r,(f-d-t)/c,(f-t)/c]}function gl(u,t,r,c){if(u)return t instanceof Gn&&u instanceof Ur?t.getTextureDescriptor(u,r,!0):{texture:u.texture,mix:Gi(c.mix),offset:c.offset,buffer:0,tileSize:1}}var W3=s.dd([{name:"a_index",type:"Int16",components:1}]);class X3{constructor(t,r,c,d){const f={width:c[0],height:c[1],data:null},_=t.gl;this.targetColorTexture=new s.T(t,f,_.RGBA8,{useMipmap:!1}),this.backgroundColorTexture=new s.T(t,f,_.RGBA8,{useMipmap:!1}),this.context=t,this.updateParticleTexture(r,d),this.lastInvalidatedAt=0}updateParticleTexture(t,r){if(this.particleTextureDimension===r.width)return;(this.particleTexture0||this.particleTexture1||this.particleIndexBuffer||this.particleSegment)&&(this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleIndexBuffer.destroy(),this.particleSegment.destroy());const c=this.context.gl,d=r.width*r.height;this.particleTexture0=new s.T(this.context,r,c.RGBA8,{premultiply:!1,useMipmap:!1}),this.particleTexture1=new s.T(this.context,r,c.RGBA8,{premultiply:!1,useMipmap:!1});const f=new s.de;f.reserve(d);for(let _=0;_0){const Se=s.bb(r.canonical,E),Ve=s.dg(Se);C=s.ad.mat4.multiply(new Float32Array(16),E.globeMatrix,Ve),s.ad.mat4.multiply(C,E.projMatrix,C)}const k=s.ad.mat4.create();k[12]+=2*d/(s.q.devicePixelRatio*E.width),k[13]+=2*f/(s.q.devicePixelRatio*E.height),s.ad.mat4.multiply(C,k,C);const j=u.getOrCreateProgram("debug",{defines:z}),N=t.getTileByID(r.key);u.terrain&&u.terrain.setupElevationDraw(N,j);const G=xt.disabled,$=Lt.disabled,K=u.colorModeForRenderPass(),ie="$debug";T.activeTexture.set(M.TEXTURE0),u.emptyTexture.bind(M.LINEAR,M.CLAMP_TO_EDGE),A?N._makeGlobeTileDebugBuffers(u.context,E):N._makeDebugTileBoundsBuffers(u.context,E.projection);const te=N._tileDebugBuffer||u.debugBuffer,ae=N._tileDebugIndexBuffer||u.debugIndexBuffer,ne=N._tileDebugSegments||u.debugSegments;if(j.draw(u,M.LINE_STRIP,G,$,K,zt.disabled,Fc(C,c),ie,te,ae,ne,null,null,null,[N._globeTileDebugBorderBuffer]),_){const Se=N.latestRawTileData,Ve=Math.floor((Se&&Se.byteLength||0)/1024);let Ue=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(Ue+=` => ${r.overscaledZ}`),Ue+=` ${N.state}`,Ue+=` ${Ve}kb`,function(We,Te){We.initDebugOverlayCanvas();const Ne=We.debugOverlayCanvas,be=We.context.gl,Be=We.debugOverlayCanvas.getContext("2d");Be.clearRect(0,0,Ne.width,Ne.height),Be.shadowColor="white",Be.shadowBlur=2,Be.lineWidth=1.5,Be.strokeStyle="white",Be.textBaseline="top",Be.font="bold 36px Open Sans, sans-serif",Be.fillText(Te,5,5),Be.strokeText(Te,5,5),We.debugOverlayTexture.update(Ne),We.debugOverlayTexture.bind(be.LINEAR,be.CLAMP_TO_EDGE)}(u,Ue)}const oe=t.getTile(r).tileSize,se=512/Math.min(oe,512)*(r.overscaledZ/E.zoom)*.5,he=N._tileDebugTextBuffer||u.debugBuffer,fe=N._tileDebugTextIndexBuffer||u.quadTriangleIndexBuffer,Ce=N._tileDebugTextSegments||u.debugSegments;j.draw(u,M.TRIANGLES,G,$,Zt.alphaBlended,zt.disabled,Fc(C,s.al.transparent,se),ie,he,fe,Ce,null,null,null,[N._globeTileDebugTextBuffer])}function Y3(u,t,r,c){ms(u,0,t+r/2,u.transform.width,r,c)}function K3(u,t,r,c){ms(u,t-r/2,0,r,u.transform.height,c)}function ms(u,t,r,c,d,f){const _=u.context,T=_.gl;T.enable(T.SCISSOR_TEST),T.scissor(t*s.q.devicePixelRatio,r*s.q.devicePixelRatio,c*s.q.devicePixelRatio,d*s.q.devicePixelRatio),_.clear({color:f}),T.disable(T.SCISSOR_TEST)}const xl=s.dd([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:da}=xl;function po(u,t,r,c){u.emplaceBack(t,r,c)}class Hc{constructor(t){this.vertexArray=new s.dh,this.indices=new s.aV,po(this.vertexArray,-1,-1,1),po(this.vertexArray,1,-1,1),po(this.vertexArray,-1,1,1),po(this.vertexArray,1,1,1),po(this.vertexArray,-1,-1,-1),po(this.vertexArray,1,-1,-1),po(this.vertexArray,-1,1,-1),po(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=t.createVertexBuffer(this.vertexArray,da),this.indexBuffer=t.createIndexBuffer(this.indices),this.segment=s.b8.simpleSegment(0,0,36,12)}}function fr(u,t,r,c,d,f){const _=u.context.gl,T=t.paint.get("sky-atmosphere-color"),E=t.paint.get("sky-atmosphere-halo-color"),M=t.paint.get("sky-atmosphere-sun-intensity"),A=((z,C,k,j,N)=>({u_matrix_3f:z,u_sun_direction:C,u_sun_intensity:k,u_color_tint_r:[j.r,j.g,j.b,j.a],u_color_tint_m:[N.r,N.g,N.b,N.a],u_luminance:5e-5}))(s.ad.mat3.fromMat4(s.ad.mat3.create(),c),d,M,T,E);_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_CUBE_MAP_POSITIVE_X+f,t.skyboxTexture,0),r.draw(u,_.TRIANGLES,xt.disabled,Lt.disabled,Zt.unblended,zt.frontCW,A,"skyboxCapture",t.skyboxGeometry.vertexBuffer,t.skyboxGeometry.indexBuffer,t.skyboxGeometry.segment)}const Wh=s.dd([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class l0{constructor(t){const r=new s.di;r.emplaceBack(-1,1,1,0,0),r.emplaceBack(1,1,1,1,0),r.emplaceBack(1,-1,1,1,1),r.emplaceBack(-1,-1,1,0,1);const c=new s.aV;c.emplaceBack(0,1,2),c.emplaceBack(2,3,0),this.vertexBuffer=t.createVertexBuffer(r,Wh.members),this.indexBuffer=t.createIndexBuffer(c),this.segments=s.b8.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Ri=s.dd([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_size_scale",components:1},{type:"Float32",name:"a_fade_opacity",components:1}]);class hi{constructor(){this.starsCount=16e3,this.sizeMultiplier=.15,this.sizeRange=100,this.intensityRange=200}}class Zc{constructor(t){this.colorModeAlphaBlendedWriteRGB=new Zt([1,No,1,No],s.al.transparent,[!0,!0,!0,!1]),this.colorModeWriteAlpha=new Zt([1,0,1,0],s.al.transparent,[!1,!1,!1,!0]),this.params=new hi,this.updateNeeded=!0,t.tp.registerParameter(this.params,["Stars"],"starsCount",{min:100,max:16e3,step:1},()=>{this.updateNeeded=!0}),t.tp.registerParameter(this.params,["Stars"],"sizeMultiplier",{min:.01,max:2,step:.01}),t.tp.registerParameter(this.params,["Stars"],"sizeRange",{min:0,max:200,step:1},()=>{this.updateNeeded=!0}),t.tp.registerParameter(this.params,["Stars"],"intensityRange",{min:0,max:200,step:1},()=>{this.updateNeeded=!0})}update(t){const r=t.context;if(!this.atmosphereBuffer||this.updateNeeded){this.updateNeeded=!1,this.atmosphereBuffer=new l0(r);const c=this.params.sizeRange,d=this.params.intensityRange,f=function(A){const z=s.dl(30),C=[];for(let k=0;k{const se=f.projection.name==="globe"?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];oe&&se.push("ALPHA_PASS");const he=t.getOrCreateProgram("globeAtmosphere",{defines:se}),fe=((Se,Ve,Ue,We,Te,Ne,be,Be,ke,je,ze,qe)=>({u_frustum_tl:Se,u_frustum_tr:Ve,u_frustum_br:Ue,u_frustum_bl:We,u_horizon:Te,u_transition:Ne,u_fadeout_range:be,u_color:Be,u_high_color:ke,u_space_color:je,u_temporal_offset:ze,u_horizon_angle:qe}))(f.frustumCorners.TL,f.frustumCorners.TR,f.frustumCorners.BR,f.frustumCorners.BL,f.frustumCorners.horizon,T,G,A,C,j,K,ae);t.uploadCommonUniforms(c,he);const Ce=this.atmosphereBuffer;Ce&&he.draw(t,d.TRIANGLES,_,Lt.disabled,oe?this.colorModeWriteAlpha:this.colorModeAlphaBlendedWriteRGB,zt.backCW,fe,oe?"atmosphere_glow_alpha":"atmosphere_glow",Ce.vertexBuffer,Ce.indexBuffer,Ce.segments)};ne(!1),ne(!0)}drawStars(t,r){const c=s.ay(r.properties.get("star-intensity"),0,1);if(c===0)return;const d=t.context,f=d.gl,_=t.transform,T=t.getOrCreateProgram("stars"),E=s.ad.quat.identity([]);s.ad.quat.rotateX(E,E,-_._pitch),s.ad.quat.rotateZ(E,E,-_.angle),s.ad.quat.rotateX(E,E,s.ak(_._center.lat)),s.ad.quat.rotateY(E,E,-s.ak(_._center.lng));const M=s.ad.mat4.fromQuat(new Float32Array(16),E),A=s.ad.mat4.multiply([],_.starsProjMatrix,M),z=s.ad.mat3.fromMat4([],M),C=s.ad.mat3.invert([],z),k=[0,1,0];s.ad.vec3.transformMat3(k,k,C),s.ad.vec3.scale(k,k,this.params.sizeMultiplier);const j=[1,0,0];s.ad.vec3.transformMat3(j,j,C),s.ad.vec3.scale(j,j,this.params.sizeMultiplier);const N=(G=k,$=j,K=c,{u_matrix:Float32Array.from(A),u_up:G,u_right:$,u_intensity_multiplier:K});var G,$,K;t.uploadCommonUniforms(d,T),this.starsVx&&this.starsIdx&&T.draw(t,f.TRIANGLES,xt.disabled,Lt.disabled,this.colorModeAlphaBlendedWriteRGB,zt.disabled,N,"atmosphere_stars",this.starsVx,this.starsIdx,this.starsSegments)}}function fo(u,t){const r=[...u],c=t.cameraWorldSizeForFog/t.worldSize,d=s.ad.mat4.identity([]);return s.ad.mat4.scale(d,d,[c,c,1]),s.ad.mat4.multiply(r,d,r),s.ad.mat4.multiply(r,t.worldToFogMatrix,r),r}function pa(u,t,r,c,d){const f=r.material,_=c.context,{baseColorTexture:T,metallicRoughnessTexture:E}=f.pbrMetallicRoughness,{normalTexture:M,occlusionTexture:A,emissionTexture:z}=f;function C(j,N,G){if(j&&(u.push(N),_.activeTexture.set(_.gl.TEXTURE0+G),j.gfxTexture)){const{minFilter:$,magFilter:K,wrapS:ie,wrapT:te}=j.sampler;j.gfxTexture.bindExtraParam($,K,ie,te)}}C(T,"HAS_TEXTURE_u_baseColorTexture",Zi.BaseColor),C(E,"HAS_TEXTURE_u_metallicRoughnessTexture",Zi.MetallicRoughness),C(M,"HAS_TEXTURE_u_normalTexture",Zi.Normal),C(A,"HAS_TEXTURE_u_occlusionTexture",Zi.Occlusion),C(z,"HAS_TEXTURE_u_emissionTexture",Zi.Emission),d&&(d.texture||(d.texture=new s.dn(c.context,d.image,[d.image.height,d.image.height,d.image.height],_.gl.RGBA8)),_.activeTexture.set(_.gl.TEXTURE0+Zi.LUT),d.texture&&d.texture.bind(_.gl.LINEAR,_.gl.CLAMP_TO_EDGE),u.push("APPLY_LUT_ON_GPU")),r.texcoordBuffer&&(u.push("HAS_ATTRIBUTE_a_uv_2f"),t.push(r.texcoordBuffer)),r.colorBuffer&&(u.push(r.colorBuffer.itemSize===12?"HAS_ATTRIBUTE_a_color_3f":"HAS_ATTRIBUTE_a_color_4f"),t.push(r.colorBuffer)),r.normalBuffer&&(u.push("HAS_ATTRIBUTE_a_normal_3f"),t.push(r.normalBuffer)),r.pbrBuffer&&(u.push("HAS_ATTRIBUTE_a_pbr"),u.push("HAS_ATTRIBUTE_a_heightBasedEmissiveStrength"),t.push(r.pbrBuffer)),f.alphaMode!=="OPAQUE"&&f.alphaMode!=="MASK"||u.push("UNPREMULT_TEXTURE_IN_SHADER"),f.defined||u.push("DIFFUSE_SHADED");const k=c.shadowRenderer;k&&(u.push("RENDER_SHADOWS","DEPTH_TEXTURE"),k.useNormalOffset&&u.push("NORMAL_OFFSET"))}function mo(u,t,r,c,d,f){const _=r.paint.get("model-opacity").constantOr(1),T=t.context,E=new xt(t.context.gl.LEQUAL,xt.ReadWrite,t.depthRangeFor3D),M=t.transform,A=u.mesh,z=A.material,C=z.pbrMetallicRoughness,k=t.style.fog;let j;j=t.transform.projection.zAxisUnit==="pixels"?[...u.nodeModelMatrix]:s.ad.mat4.multiply([],c.zScaleMatrix,u.nodeModelMatrix),s.ad.mat4.multiply(j,c.negCameraPosMatrix,j);const N=s.ad.mat4.invert([],j);s.ad.mat4.transpose(N,N);const G=r.paint.get("model-color-use-theme").constantOr("default")==="none",$=r.paint.get("model-emissive-strength").constantOr(0),K=j3(new Float32Array(u.worldViewProjection),new Float32Array(j),new Float32Array(N),null,t,_,C.baseColorFactor.toRenderColor(null),z.emissiveFactor,C.metallicFactor,C.roughnessFactor,z,$,r),ie={defines:[]},te=[],ae=t.shadowRenderer;ae&&(ae.useNormalOffset=!1),pa(ie.defines,te,A,t,G?null:r.lut);let ne=null;if(k){const he=fo(u.nodeModelMatrix,t.transform);if(ne=new Float32Array(he),M.projection.name!=="globe"){const fe=A.aabb.min,Ce=A.aabb.max,[Se,Ve]=k.getOpacityForBounds(he,fe[0],fe[1],Ce[0],Ce[1]);ie.overrideFog=Se>=ot||Ve>=ot}}const oe=lo(t,r.paint.get("model-cutoff-fade-range"));oe.shouldRenderCutoff&&ie.defines.push("RENDER_CUTOFF");const se=t.getOrCreateProgram("model",ie);t.uploadCommonUniforms(T,se,null,ne,oe),t.renderPass!=="shadow"&&ae&&ae.setupShadowsFromMatrix(u.nodeModelMatrix,se),se.draw(t,T.gl.TRIANGLES,E,d,f,A.material.doubleSided?zt.disabled:zt.backCCW,K,r.id,A.vertexBuffer,A.indexBuffer,A.segments,r.paint,t.transform.zoom,void 0,te)}function _s(u,t,r,c,d,f,_){let T;T=u.projection.name==="globe"?s.dp(r,u):[...r],s.ad.mat4.multiply(T,T,t.matrix);const E=s.ad.mat4.multiply([],c,T);if(t.meshes)for(const M of t.meshes){if(M.material.alphaMode!=="BLEND"){_.push({mesh:M,depth:0,modelIndex:d,worldViewProjection:E,nodeModelMatrix:T});continue}const A=s.ad.vec3.transformMat4([],M.centroid,E);!u.isOrthographic&&A[2]<=0||f.push({mesh:M,depth:A[2],modelIndex:d,worldViewProjection:E,nodeModelMatrix:T})}if(t.children)for(const M of t.children)_s(u,M,r,c,d,f,_)}function c0(u,t,r,c){const d=r.shadowRenderer;if(!d)return;const f=d.getShadowPassDepthMode(),_=d.getShadowPassColorMode(),T=d.calculateShadowPassMatrixFromMatrix(t),E=Vc(T);r.getOrCreateProgram("modelDepth",{defines:r._shadowMapDebug?[]:["DEPTH_TEXTURE"]}).draw(r,r.context.gl.TRIANGLES,f,Lt.disabled,_,zt.backCCW,E,c.id,u.vertexBuffer,u.indexBuffer,u.segments,c.paint,r.transform.zoom,void 0,void 0)}function J3(u,t,r){const c=t.updateZoomBasedPaintProperties(),d=function(f,_,T){let E,M,A,z=f.terrain?f.terrain.exaggeration():0;if(f.terrain&&z>0){const C=f.terrain,k=C.findDEMTileFor(T);k&&k.dem?E=s.dr.create(C,T,k):z=0}if(z===0&&(_.terrainElevationMin=0,_.terrainElevationMax=0),z===_.validForExaggeration&&(z===0||E&&E._demTile&&E._demTile.tileID===_.validForDEMTile.id&&E._dem._timestamp===_.validForDEMTile.timestamp))return!1;for(const C in _.instancesPerModel){const k=_.instancesPerModel[C];for(let j=0;jM&&(M=k.max)}const A=s.ay(c.x,f,_)-c.x,z=s.ay(c.y,T,E)-c.y,C=s.bH(M,t.center.lat)-c.z;return t._zoomFromMercatorZ(Math.sqrt(A*A+z*z+C*C))}function Ln(u,t,r,c,d,f,_){const T=u.context,E=u.renderPass==="shadow",M=u.shadowRenderer,A=E&&M?M.getShadowPassDepthMode():new xt(T.gl.LEQUAL,xt.ReadWrite,u.depthRangeFor3D),z=u.isTileAffectedByFog(f);if(r.meshes)for(const C of r.meshes){const k=["MODEL_POSITION_ON_GPU"],j=[];let N,G,$;c.instancedDataArray.length>20&&k.push("INSTANCED_ARRAYS");const K=lo(u,t.paint.get("model-cutoff-fade-range"));if(K.shouldRenderCutoff&&k.push("RENDER_CUTOFF"),E&&M)N=u.getOrCreateProgram("modelDepth",{defines:k}),G=Vc(_.shadowTileMatrix,_.shadowTileMatrix,Float32Array.from(r.matrix)),$=M.getShadowPassColorMode();else{pa(k,j,C,u,t.paint.get("model-color-use-theme").constantOr("default")==="none"?null:t.lut),N=u.getOrCreateProgram("model",{defines:k,overrideFog:z});const te=C.material,ae=te.pbrMetallicRoughness,ne=t.paint.get("model-opacity").constantOr(1),oe=t.paint.get("model-emissive-strength").constantOr(0);G=j3(f.expandedProjMatrix,Float32Array.from(r.matrix),new Float32Array(16),null,u,ne,ae.baseColorFactor.toRenderColor(null),te.emissiveFactor,ae.metallicFactor,ae.roughnessFactor,te,oe,t,d),M&&(_.shadowUniformsInitialized?N.setShadowUniformValues(T,M.getShadowUniformValues()):(M.setupShadows(f.toUnwrapped(),N,"model-tile",f.overscaledZ),_.shadowUniformsInitialized=!0)),$=K.shouldRenderCutoff||ne<1||te.alphaMode!=="OPAQUE"?Zt.alphaBlended:Zt.unblended}u.uploadCommonUniforms(T,N,f.toUnwrapped(),null,K);const ie=C.material.doubleSided?zt.disabled:zt.backCCW;if(c.instancedDataArray.length>20)j.push(c.instancedDataBuffer),N.draw(u,T.gl.TRIANGLES,A,Lt.disabled,$,ie,G,t.id,C.vertexBuffer,C.indexBuffer,C.segments,t.paint,u.transform.zoom,void 0,j,c.instancedDataArray.length);else{const te=E?"u_instance":"u_normal_matrix";for(let ae=0;aeE[1]?_:E,f[0]=r.max[0],_=s.ad.vec4.transformMat4(s.ad.vec4.create(),f,d),T=_[1]E[1]?_:E,f[1]=r.min[1],_=s.ad.vec4.transformMat4(s.ad.vec4.create(),f,d),T=_[1]E[1]?_:E;const M=s.ay(c[0],0,1),A=100*t.pixelsPerMeter*s.ay(c[1],0,1),z=s.ay(c[2],0,1),C=s.ad.vec4.lerp(s.ad.vec4.create(),T,E,M),k=Math.tan(.5*t.fovX),j=-C[2]*k;if(A===0)return C[1]<-Math.abs(j)?z:1;const N=(-Math.abs(j)-C[1])/A,G=(K,ie,te)=>(1-te)*K+te*ie,$=s.ay(G(1,z,N),z,1);return G(1,$,s.ay((t.pitch-20)/20,0,1))}class t1{}class gs{constructor(){this._storage=new Map}getLinesFromTrianglesBuffer(t,r,c){{const z=this._storage.get(r.id);if(z)return z.lastUsedFrameIdx=t,z.buf}const d=c.gl,f=d.getBufferParameter(d.ELEMENT_ARRAY_BUFFER,d.BUFFER_SIZE),_=new ArrayBuffer(f),T=new Int16Array(_);d.getBufferSubData(d.ELEMENT_ARRAY_BUFFER,0,new Int16Array(_));const E=new s.dt;for(let z=0;z30&&(c.buf.destroy(),this._storage.delete(r))}destroy(){for(const[t,r]of this._storage)r.buf.destroy(),this._storage.delete(t)}}class i1{constructor(t){this.occluderSize=30,this.depthOffset=-1e-4,t.registerParameter(this,["Occlusion"],"occluderSize",{min:1,max:100,step:1}),t.registerParameter(this,["Occlusion"],"depthOffset",{min:-.05,max:0,step:1e-5})}}const Ho=s.dd([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_rainParticleData",components:4}]);class r1{registerParameter(){}registerButton(){}registerBinding(){}refreshUI(){}}class u0{constructor(t,r){this.revealStart=11,this.revealRange=2,t.registerParameter(this,[...r,"Reveal"],"revealStart",{min:0,max:17,step:.05}),t.registerParameter(this,[...r,"Reveal"],"revealRange",{min:.1,max:5.1,step:.05})}}const n1=s.dd([{type:"Float32",name:"a_pos_2f",components:2}]);class o1{destroy(){this.vignetteVx&&this.vignetteVx.destroy(),this.vignetteIdx&&this.vignetteIdx.destroy()}draw(t,r){const c=t.getOrCreateProgram("vignette");if(!this.vignetteVx||!this.vignetteIdx){const _=new s.du,T=new s.aV;_.emplaceBack(-1,-1),_.emplaceBack(1,-1),_.emplaceBack(1,1),_.emplaceBack(-1,1),T.emplaceBack(0,1,2),T.emplaceBack(0,2,3),this.vignetteVx=t.context.createVertexBuffer(_,n1.members),this.vignetteIdx=t.context.createIndexBuffer(T)}const d=s.b8.simpleSegment(0,0,4,6);if(this.vignetteVx&&this.vignetteIdx){t.uploadCommonUniforms(t.context,c);const _={u_vignetteShape:(f={vignetteShape:[r.start,r.range,Math.pow(10,r.fadePower)],vignetteColor:[r.color.r,r.color.g,r.color.b,r.color.a*r.strength]}).vignetteShape,u_vignetteColor:f.vignetteColor};c.draw(t,t.context.gl.TRIANGLES,xt.disabled,Lt.disabled,Zt.alphaBlended,zt.disabled,_,"vignette",this.vignetteVx,this.vignetteIdx,d)}var f}}class _r{constructor(){this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0}update(t,r){const c=t.getFreeCameraOptions().position,d=c.toAltitude(),f=c.toLngLat(),_=s.ak(f.lng),T=s.ak(f.lat),E=t.pixelsPerMeter/r,M=_*s.dv,A=s.dv*Math.log(Math.tan(Math.PI/4+T/2));if(this._offsetXPrev===void 0)this._offsetXPrev=0,this._offsetYPrev=0,this._elevationPrev=0,this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0;else{const z=-this._offsetYPrev+A,C=-this._elevationPrev+d;this._accumulatedOffsetX+=(-this._offsetXPrev+M)*E,this._accumulatedOffsetY+=z*E,this._accumulatedElevation+=C*E,this._offsetXPrev=M,this._offsetYPrev=A,this._elevationPrev=d}}getPosition(){return[this._accumulatedOffsetX,this._accumulatedOffsetY,this._accumulatedElevation]}}function wl(u,t){return[-(u[0]-Math.floor(u[0]/t)*t),-(u[1]-Math.floor(u[1]/t)*t),-(u[2]-Math.floor(u[2]/t)*t)]}function Tl(u){const t=s.dl(1323123451230),r=[];for(let c=0;cc)return;const d=Wr(0,1,r.revealStart,r.revealStart+r.revealRange,c);if(!this.particlesVx||!this.particlesIdx)return;const f=structuredClone(this._params);let _=[-f.direction.x,f.direction.y,-100];s.ad.vec3.normalize(_,_);const T=structuredClone(this._vignetteParams);T.strength*=d,f.overrideStyleParameters||(f.intensity=t.style.rain.state.density,f.timeFactor=t.style.rain.state.intensity,f.color=structuredClone(t.style.rain.state.color),_=structuredClone(t.style.rain.state.direction),f.screenThinning.intensity=t.style.rain.state.centerThinning,f.dropletSizeX=t.style.rain.state.dropletSize[0],f.dropletSizeYScale=t.style.rain.state.dropletSize[1]/t.style.rain.state.dropletSize[0],f.distortionStrength=100*t.style.rain.state.distortionStrength,T.strength=1,T.color=structuredClone(t.style.rain.state.vignetteColor));const E=this.updateOnRender(t,f.timeFactor),M=t.context,A=M.gl,z=t.transform;this.screenTexture&&this.screenTexture.size[0]===t.width&&this.screenTexture.size[1]===t.height||(this.screenTexture=new s.T(M,{width:t.width,height:t.height,data:null},A.RGBA8)),f.distortionStrength>0&&(M.activeTexture.set(A.TEXTURE0),this.screenTexture.bind(A.LINEAR,A.CLAMP_TO_EDGE),A.copyTexSubImage2D(A.TEXTURE_2D,0,0,0,0,0,t.width,t.height));const C=t.getOrCreateProgram("rainParticle");t.uploadCommonUniforms(M,C),M.activeTexture.set(A.TEXTURE0),this.screenTexture.bind(A.LINEAR,A.CLAMP_TO_EDGE);const k=[f.color.r,f.color.g,f.color.b,f.color.a],j=(N,G)=>{const $=wl(this._movement.getPosition(),N),K=f.dropletSizeX,ie=f.dropletSizeX*f.dropletSizeYScale,te=t.width/2,ae=t.height/2,ne=Wr(0,f.screenThinning.start,0,1,f.screenThinning.intensity),oe=Wr(.001,f.screenThinning.range,0,1,f.screenThinning.intensity),se=Wr(0,f.screenThinning.particleOffset,0,1,f.screenThinning.intensity),he=(fe={modelview:E.modelviewMatrix,projection:E.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:$,velocityConeAperture:f.velocityConeAperture,velocity:f.velocity,boxSize:N,rainDropletSize:[K,ie],distortionStrength:f.distortionStrength,rainDirection:_,color:k,screenSize:[z.width,z.height],thinningCenterPos:[te,ae],thinningShape:[ne,oe,Math.pow(10,f.screenThinning.fadePower)],thinningAffectedRatio:f.screenThinning.affectedRatio,thinningParticleOffset:se,shapeDirectionalPower:f.shapeDirPower,shapeNormalPower:f.shapeNormalPower,mode:G?0:1},{u_modelview:Float32Array.from(fe.modelview),u_projection:Float32Array.from(fe.projection),u_time:fe.time,u_cam_pos:fe.camPos,u_texScreen:0,u_velocityConeAperture:fe.velocityConeAperture,u_velocity:fe.velocity,u_boxSize:fe.boxSize,u_rainDropletSize:fe.rainDropletSize,u_distortionStrength:fe.distortionStrength,u_rainDirection:fe.rainDirection,u_color:fe.color,u_screenSize:fe.screenSize,u_thinningCenterPos:fe.thinningCenterPos,u_thinningShape:fe.thinningShape,u_thinningAffectedRatio:fe.thinningAffectedRatio,u_thinningParticleOffset:fe.thinningParticleOffset,u_shapeDirectionalPower:fe.shapeDirectionalPower,u_shapeNormalPower:fe.shapeNormalPower,u_mode:fe.mode});var fe;const Ce=Math.round(f.intensity*this.particlesCount),Se=s.b8.simpleSegment(0,0,4*Ce,2*Ce);C.draw(t,A.TRIANGLES,xt.disabled,Lt.disabled,Zt.alphaBlended,zt.disabled,he,"rain_particles",this.particlesVx,this.particlesIdx,Se)};f.distortionStrength>0&&j(f.boxSize,!0),j(f.boxSize,!1),this._vignette.draw(t,T)}}const a1=s.dd([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_snowParticleData",components:4},{type:"Float32",name:"a_snowParticleDataHorizontalOscillation",components:2}]);class fa extends Sl{constructor(t){super(2.25),this._params={overrideStyleParameters:!1,intensity:.85,timeFactor:.75,velocityConeAperture:70,velocity:40,horizontalOscillationRadius:4,horizontalOscillationRate:1.5,boxSize:2e3,billboardSize:2,shapeFadeStart:.27,shapeFadePower:.21,screenThinning:{intensity:.4,start:.15,range:1.4,fadePower:.24,affectedRatio:1,particleOffset:-.2},color:{r:1,g:1,b:1,a:1},direction:{x:-50,y:-35}},this._revealParams=new u0(t.tp,["Precipitation","Snow"]),this._vignetteParams={strength:.3,start:.78,range:.46,fadePower:.2,color:{r:1,g:1,b:1,a:1}},this.particlesCount=16e3}update(t){const r=t.context;if(!this.particlesVx){const c=Tl(this.particlesCount),d=new s.dx,f=new s.aV;let _=0;const T=s.dl(1323123451230);for(let E=0;E_)return;const T=Wr(0,1,f.revealStart,f.revealStart+f.revealRange,_);d.strength*=T,r.overrideStyleParameters||(r.intensity=t.style.snow.state.density,r.timeFactor=t.style.snow.state.intensity,r.color=structuredClone(t.style.snow.state.color),c=structuredClone(t.style.snow.state.direction),r.screenThinning.intensity=t.style.snow.state.centerThinning,r.billboardSize=2.79*t.style.snow.state.flakeSize,d.strength=1,d.color=structuredClone(t.style.snow.state.vignetteColor));const E=this.updateOnRender(t,r.timeFactor);if(!this.particlesVx||!this.particlesIdx)return;const M=t.context,A=M.gl,z=t.transform,C=t.getOrCreateProgram("snowParticle");t.uploadCommonUniforms(M,C),((k,j,N)=>{const G=wl(this._movement.getPosition(),k),$=z.width/2,K=z.height/2,ie=Wr(0,N.screenThinning.start,0,1,N.screenThinning.intensity),te=Wr(.001,N.screenThinning.range,0,1,N.screenThinning.intensity),ae=Wr(0,N.screenThinning.particleOffset,0,1,N.screenThinning.intensity),ne=(oe={modelview:E.modelviewMatrix,projection:E.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:G,velocityConeAperture:N.velocityConeAperture,velocity:N.velocity,horizontalOscillationRadius:N.horizontalOscillationRadius,horizontalOscillationRate:N.horizontalOscillationRate,boxSize:k,billboardSize:1*N.billboardSize,simpleShapeParameters:[N.shapeFadeStart,N.shapeFadePower],screenSize:[z.width,z.height],thinningCenterPos:[$,K],thinningShape:[ie,te,Math.pow(10,N.screenThinning.fadePower)],thinningAffectedRatio:N.screenThinning.affectedRatio,thinningParticleOffset:ae,color:[N.color.r,N.color.g,N.color.b,N.color.a],direction:c},{u_modelview:Float32Array.from(oe.modelview),u_projection:Float32Array.from(oe.projection),u_time:oe.time,u_cam_pos:oe.camPos,u_velocityConeAperture:oe.velocityConeAperture,u_velocity:oe.velocity,u_horizontalOscillationRadius:oe.horizontalOscillationRadius,u_horizontalOscillationRate:oe.horizontalOscillationRate,u_boxSize:oe.boxSize,u_billboardSize:oe.billboardSize,u_simpleShapeParameters:oe.simpleShapeParameters,u_screenSize:oe.screenSize,u_thinningCenterPos:oe.thinningCenterPos,u_thinningShape:oe.thinningShape,u_thinningAffectedRatio:oe.thinningAffectedRatio,u_thinningParticleOffset:oe.thinningParticleOffset,u_particleColor:oe.color,u_direction:oe.direction});var oe;const se=Math.round(N.intensity*this.particlesCount),he=s.b8.simpleSegment(0,0,4*se,2*se);this.particlesVx&&this.particlesIdx&&C.draw(t,A.TRIANGLES,xt.disabled,Lt.disabled,Zt.alphaBlended,zt.disabled,ne,"snow_particles",this.particlesVx,this.particlesIdx,he)})(r.boxSize,0,r),this._vignette.draw(t,d)}}const h0={symbol:function(u,t,r,c,d){if(u.renderPass!=="translucent")return;const f=Lt.disabled,_=u.colorModeForRenderPass(),T=r.layout.get("text-variable-anchor"),E=r.layout.get("text-size-scale-range"),M=s.ay(u.scaleFactor,E[0],E[1]);T&&function(C,k,j,N,G,$,K,ie){const te=k.transform,ae=G==="map",ne=$==="map";for(const oe of C){const se=N.getTile(oe),he=se.getBucket(j);if(!he||!he.text||!he.text.segments.get().length)continue;const fe=s.bp(he.textSizeData,te.zoom,ie),Ce=nn(oe,he.getProjection(),te),Se=te.calculatePixelsToTileUnitsMatrix(se),Ve=ro(Ce,se.tileID.canonical,ne,ae,te,he.getProjection(),Se),Ue=he.hasIconTextFit()&&he.hasIconData();if(fe){const We=Math.pow(2,te.zoom-se.tileID.overscaledZ);bn(he,ae,ne,K,s.cY,te,Ve,oe,We,fe,Ue)}}}(c,u,r,t,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),d,M);const A=r.paint.get("icon-opacity").constantOr(1)!==0,z=r.paint.get("text-opacity").constantOr(1)!==0;r.layout.get("symbol-sort-key").constantOr(1)!==void 0&&(A||z)?Ai(u,t,r,c,f,_):(A&&Ai(u,t,r,c,f,_,{onlyIcons:!0}),z&&Ai(u,t,r,c,f,_,{onlyText:!0})),t.map.showCollisionBoxes&&(fl(u,t,r,c,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),!0),fl(u,t,r,c,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),!1))},circle:function(u,t,r,c){if(u.renderPass!=="translucent")return;const d=r.paint.get("circle-opacity"),f=r.paint.get("circle-stroke-width"),_=r.paint.get("circle-stroke-opacity"),T=r.layout.get("circle-sort-key").constantOr(1)!==void 0,E=r.paint.get("circle-emissive-strength");if(d.constantOr(1)===0&&(f.constantOr(1)===0||_.constantOr(1)===0))return;const M=u.context,A=M.gl,z=u.transform,C=u.depthModeForSublayer(0,xt.ReadOnly),k=Lt.disabled,j=u.colorModeForDrapableLayerRenderPass(E),N=z.projection.name==="globe",G=[s.av(z.center.lng),s.aC(z.center.lat)],$=[];for(let ie=0;ieie.sortKey-te.sortKey);const K={useDepthForOcclusion:z.depthOcclusionForSymbolsAndCircles};for(const ie of $){const{programConfiguration:te,program:ae,layoutVertexBuffer:ne,globeExtVertexBuffer:oe,indexBuffer:se,uniformValues:he,tile:fe}=ie.state,Ce=ie.segments;u.terrain&&u.terrain.setupElevationDraw(fe,ae,K),u.uploadCommonUniforms(M,ae,fe.tileID.toUnwrapped()),ae.draw(u,A.TRIANGLES,C,k,j,zt.disabled,he,r.id,ne,se,Ce,r.paint,z.zoom,te,[oe])}},heatmap:function(u,t,r,c){if(r.paint.get("heatmap-opacity")!==0)if(u.renderPass==="offscreen"){const d=u.context,f=d.gl,_=Lt.disabled,T=new Zt([f.ONE,f.ONE,f.ONE,f.ONE],s.al.transparent,[!0,!0,!0,!0]);(function(k,j,N,G){const $=k.gl,K=j.width*G,ie=j.height*G;k.activeTexture.set($.TEXTURE1),k.viewport.set([0,0,K,ie]);let te=N.heatmapFbo;if(!te||te&&(te.width!==K||te.height!==ie)){te&&te.destroy();const ae=$.createTexture();$.bindTexture($.TEXTURE_2D,ae),$.texParameteri($.TEXTURE_2D,$.TEXTURE_WRAP_S,$.CLAMP_TO_EDGE),$.texParameteri($.TEXTURE_2D,$.TEXTURE_WRAP_T,$.CLAMP_TO_EDGE),$.texParameteri($.TEXTURE_2D,$.TEXTURE_MIN_FILTER,$.LINEAR),$.texParameteri($.TEXTURE_2D,$.TEXTURE_MAG_FILTER,$.LINEAR),te=N.heatmapFbo=k.createFramebuffer(K,ie,!0,null),function(ne,oe,se,he,fe,Ce){const Se=ne.gl;Se.texImage2D(Se.TEXTURE_2D,0,ne.extRenderToTextureHalfFloat?Se.RGBA16F:Se.RGBA,fe,Ce,0,Se.RGBA,ne.extRenderToTextureHalfFloat?Se.HALF_FLOAT:Se.UNSIGNED_BYTE,null),he.colorAttachment.set(se)}(k,0,ae,te,K,ie)}else $.bindTexture($.TEXTURE_2D,te.colorAttachment.get()),k.bindFramebuffer.set(te.framebuffer)})(d,u,r,u.transform.projection.name==="globe"?.5:.25),d.clear({color:s.al.transparent});const E=u.transform,M=E.projection.name==="globe",A=M?["PROJECTION_GLOBE_VIEW"]:[],z=M?zt.frontCCW:zt.disabled,C=[s.av(E.center.lng),s.aC(E.center.lat)];for(let k=0;k({u_image:0,u_color_ramp:1,u_opacity:z.paint.get("heatmap-opacity")}))(0,f),f.id,d.viewportBuffer,d.quadTriangleIndexBuffer,d.viewportSegments,f.paint,d.transform.zoom)}(u,r))},line:function(u,t,r,c){if(u.renderPass!=="translucent")return;const d=r.paint.get("line-opacity"),f=r.paint.get("line-width");if(d.constantOr(1)===0||f.constantOr(1)===0)return;const _=r.paint.get("line-emissive-strength"),T=r.paint.get("line-occlusion-opacity"),E=r.layout.get("line-elevation-reference"),M=r.layout.get("line-width-unit")==="meters",A=E==="sea",z=u.context,C=z.gl;if(r.hasElevatedBuckets&&u.transform.projection.name==="globe")return;const k=r.layout.get("line-cross-slope"),j=k!==void 0,N=k<1,G=u.colorModeForDrapableLayerRenderPass(_),$=u.terrain&&u.terrain.renderingToTexture,K=$?1:s.q.devicePixelRatio,ie=r.paint.get("line-dasharray"),te=ie.constantOr(1),ae=r.layout.get("line-cap"),ne=ie.constantOr(null),oe=ae.constantOr(null),se=r.paint.get("line-pattern"),he=se.constantOr(1),fe=se.constantOr(null),Ce=r.paint.get("line-opacity").constantOr(1);let Se=!he&&Ce!==1||u.depthOcclusion&&T>0&&T<1;const Ve=r.paint.get("line-gradient"),Ue=he?"linePattern":"line",We=s.c$(r);let Te;if($&&u.terrain&&u.terrain.clipOrMaskOverlapStencilType()&&(Se=!1),T!==0&&u.depthOcclusion){const be=r.paint._values["line-opacity"];be&&be.value&&be.value.kind==="constant"?Te=be.value:s.w(`Occlusion opacity for layer ${r.id} is supported only when line-opacity isn't data-driven.`)}f.value.kind!=="constant"&&f.value.isLineProgressConstant===!1&&We.push("VARIABLE_LINE_WIDTH");const Ne=(be,Be,ke,je,ze,qe)=>{for(const et of be){const tt=t.getTile(et);if(he&&!tt.patternsLoaded())continue;const it=tt.getBucket(r);if(!it||it.hasZOffset&&!ze||!it.hasZOffset&&ze)continue;u.prepareDrawTile();const ft=it.programConfigurations.get(r.id),Rt=u.isTileAffectedByFog(et),Tt=u.getOrCreateProgram(Ue,{config:ft,defines:Be,overrideFog:Rt,overrideRtt:!ze&&void 0});if(fe&&tt.imageAtlas){const Ot=s.d0.from(fe).getPrimary().scaleSelf(K).toString(),mt=tt.imageAtlas.patternPositions.get(Ot);mt&&ft.setConstantPatternPositions(mt)}if(!he&&ne&&oe&&tt.lineAtlas){const Ot=tt.lineAtlas.getDash(ne,oe);Ot&&ft.setConstantPatternPositions(Ot)}let[Pt,Et]=r.paint.get("line-trim-offset");(oe==="round"||oe==="square")&&Pt!==Et&&(Pt===0&&(Pt-=1),Et===1&&(Et+=1));const Qt=$?et.projMatrix:null,pi=M?1/it.tileToMeter/s.at(tt,1,u.transform.zoom):1,Pi=M?1/it.tileToMeter/s.at(tt,1,Math.floor(u.transform.zoom)):1,Ht=he?s.d1(u,tt,r,Qt,K,pi,Pi,[Pt,Et]):s.d2(u,tt,r,Qt,it.lineClipsArray.length,K,pi,Pi,[Pt,Et]);if(Ve){const Ot=it.gradients[r.id];let mt=Ot.texture;if(r.gradientVersion!==Ot.version){let ti=256;if(r.stepInterpolant){const wi=t.getSource().maxzoom,li=et.canonical.z===wi?Math.ceil(1<{Te!=null&&(Te.value=Ce*T),Tt.draw(u,C.TRIANGLES,ke,Ot,G,zt.disabled,Ht,r.id,it.layoutVertexBuffer,it.indexBuffer,it.segments,r.paint,u.transform.zoom,ft,[it.layoutVertexBuffer2,it.patternVertexBuffer,it.zOffsetVertexBuffer]),Te!=null&&(Te.value=Ce)};if(Se&&!ze){const Ot=u.stencilModeForClipping(et).ref;Ot===0&&$&&z.clear({stencil:0});const mt={func:C.EQUAL,mask:255};Ht.u_alpha_discard_threshold=.8,Fi(new Lt(mt,Ot,255,C.KEEP,C.KEEP,C.INVERT)),Ht.u_alpha_discard_threshold=0,Fi(new Lt(mt,Ot,255,C.KEEP,C.KEEP,C.KEEP))}else Ht.u_alpha_discard_threshold=Se&&ze&&qe?.8:0,Fi(ze?je:u.stencilModeForClipping(et))}};if(r.hasNonElevatedBuckets){const be=!$&&u.terrain;T!==0&&be?s.w(`Occlusion opacity for layer ${r.id} is supported on terrain only if the layer has line-z-offset enabled.`):be?s.w(`Cannot render non-elevated lines in immediate mode when terrain is enabled. Layer: ${r.id}.`):Ne(c,We,u.depthModeForSublayer(0,xt.ReadOnly),Lt.disabled,!1,!0)}if(r.hasElevatedBuckets){We.push("ELEVATED"),j&&We.push(N?"CROSS_SLOPE_HORIZONTAL":"CROSS_SLOPE_VERTICAL"),A&&We.push("ELEVATION_REFERENCE_SEA");const be=Se?u.stencilModeFor3D():Lt.disabled,Be=new xt(u.depthOcclusion?C.GREATER:C.LEQUAL,xt.ReadOnly,u.depthRangeFor3D);u.forceTerrainMode=!0,Ne(c,We,Be,be,!0,!0),Se&&Ne(c,We,Be,be,!0,!1),u.forceTerrainMode=!1}Se&&(u.resetStencilClippingMasks(),$&&z.clear({stencil:0})),T===0||u.depthOcclusion||$||u.layersWithOcclusionOpacity.push(u.currentLayer)},fill:function(u,t,r,c){const d=r.paint.get("fill-color"),f=r.paint.get("fill-opacity");if(f.constantOr(1)===0)return;const _=r.paint.get("fill-emissive-strength"),T=u.colorModeForDrapableLayerRenderPass(_),E=r.paint.get("fill-pattern"),M=u.opaquePassEnabledForLayer()&&!E.constantOr(1)&&d.constantOr(s.al.transparent).a===1&&f.constantOr(0)===1?"opaque":"translucent";let A="none";r.layout.get("fill-elevation-reference")!=="none"?A="road":r.paint.get("fill-z-offset").constantOr(1)!==0&&(A="offset");const z=!(!u.terrain||!u.terrain.enabled),C={painter:u,sourceCache:t,layer:r,coords:c,colorMode:T,elevationType:A,terrainEnabled:z,pass:M};if(A!=="offset"){if(_l(C,!1),A==="road"){const k=!z&&u.renderPass==="translucent";k&&Z3(u,t,r,c,"geometry"),_l(C,!0,Lt.disabled),k&&function(j){const{painter:N,sourceCache:G,layer:$,coords:K,colorMode:ie}=j,te=N.context.gl,ae=new xt(N.context.gl.LEQUAL,xt.ReadOnly,N.depthRangeFor3D);for(const ne of K){const oe=G.getTile(ne),se=oe.getBucket($);if(!se)continue;const he=se.elevatedStructures;if(!he||!he.renderableSegments||he.renderableSegments.segments[0].primitiveLength===0)continue;N.prepareDrawTile();const fe=se.bufferData.programConfigurations.get($.id),Ce=N.isTileAffectedByFog(ne),Se=N.getOrCreateProgram("elevatedStructures",{config:fe,overrideFog:Ce,defines:["NORMAL_OFFSET"]}),Ve={u_matrix:N.translatePosMatrix(ne.projMatrix,oe,$.paint.get("fill-translate"),$.paint.get("fill-translate-anchor"))};N.uploadCommonUniforms(N.context,Se,ne.toUnwrapped()),Se.draw(N,te.TRIANGLES,ae,Lt.disabled,ie,zt.backCCW,Ve,$.id,he.vertexBuffer,he.indexBuffer,he.renderableSegments,$.paint,N.transform.zoom,fe,[he.vertexBufferNormal])}}(C)}}else _l(C,!1,u.stencilModeFor3D())},"fill-extrusion":function(u,t,r,c){const d=r.paint.get("fill-extrusion-opacity"),f=u.context,_=f.gl,T=u.terrain,E=T&&T.renderingToTexture;if(d===0)return;const M=u.conflationActive&&u.style.isLayerClipped(r,t.getSource()),A=u.style.order.indexOf(r.fqid);if(M&&function(z,C,k,j,N){for(const G of j){const $=C.getTile(G).getBucket(k);$&&($.updateReplacement(G,z.replacementSource,N),$.uploadCentroid(z.context))}}(u,t,r,c,A),T||M)for(const z of c){const C=t.getTile(z).getBucket(r);C&&la(u.context,t,z,C,r,T,M)}if(u.renderPass==="shadow"&&u.shadowRenderer){const z=u.shadowRenderer;if(T&&d<.65&&r._transitionablePaint._values["fill-extrusion-opacity"].value.expression instanceof s.ab)return;const C=z.getShadowPassDepthMode(),k=z.getShadowPassColorMode();a0(u,t,r,c,C,Lt.disabled,k,M)}else if(u.renderPass==="translucent"){const z=!r.paint.get("fill-extrusion-pattern").constantOr(1),C=r.paint.get("fill-extrusion-color").constantOr(s.al.white);if(!E&&C.a!==0){const k=new xt(u.context.gl.LEQUAL,xt.ReadWrite,u.depthRangeFor3D);d===1&&z?a0(u,t,r,c,k,Lt.disabled,Zt.unblended,M):(a0(u,t,r,c,k,Lt.disabled,Zt.disabled,M),a0(u,t,r,c,k,u.stencilModeFor3D(),u.colorModeForRenderPass(),M),u.resetStencilClippingMasks())}if(u.style.enable3dLights()&&z&&(!T&&u.transform.projection.name!=="globe"||E)){const k=r.paint.get("fill-extrusion-opacity"),j=r.paint.get("fill-extrusion-ambient-occlusion-intensity"),N=r.paint.get("fill-extrusion-ambient-occlusion-ground-radius"),G=r.paint.get("fill-extrusion-flood-light-intensity"),$=r.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default")==="none",K=r.paint.get("fill-extrusion-flood-light-color").toRenderColor($?null:r.lut).toArray01().slice(0,3),ie=j>0&&N>0,te=G>0,ae=(oe,se,he)=>(1-he)*oe+he*se,ne=oe=>{const se=u.depthModeForSublayer(1,xt.ReadOnly,_.LEQUAL,!0),he=r.paint.get(oe?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),fe=ae(.1,3,he),Ce=u._showOverdrawInspector;if(!Ce){const Se=new Lt({func:_.ALWAYS,mask:255},255,255,_.KEEP,_.KEEP,_.REPLACE),Ve=new Zt([_.ONE,_.ONE,_.ONE,_.ONE],s.al.transparent,[!1,!1,!1,!0],_.MIN);aa(u,t,r,c,se,Se,Ve,zt.disabled,oe,"sdf",k,j,N,G,K,fe,M,!1)}{const Se=Ce?Lt.disabled:new Lt({func:_.EQUAL,mask:255},255,255,_.KEEP,_.DECR,_.DECR),Ve=Ce?u.colorModeForRenderPass():new Zt([_.ONE_MINUS_DST_ALPHA,_.DST_ALPHA,_.ONE,_.ONE],s.al.transparent,[!0,!0,!0,!0]);aa(u,t,r,c,se,Se,Ve,zt.disabled,oe,"color",k,j,N,G,K,fe,M,!1)}};if(E){const oe=(se,he,fe)=>{const Ce=u.depthModeForSublayer(1,xt.ReadOnly,_.LEQUAL,!1),Se=r.paint.get(se?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),Ve=ae(.1,3,Se);{const Ue=new Zt([_.ONE,_.ONE,_.ONE,_.ONE],s.al.transparent,[!1,!1,!1,!0]);aa(u,t,r,c,Ce,Lt.disabled,Ue,zt.disabled,se,"clear",k,j,N,G,K,Ve,M,he)}{const Ue=new Lt({func:_.ALWAYS,mask:255},255,255,_.KEEP,_.KEEP,_.REPLACE),We=new Zt([_.ONE,_.ONE,_.ONE,_.ONE],s.al.transparent,[!1,!1,!1,!0],_.MIN);aa(u,t,r,c,Ce,Ue,We,zt.disabled,se,"sdf",k,j,N,G,K,Ve,M,he)}{const Ue=se?_.ZERO:_.ONE_MINUS_DST_ALPHA,We=new Lt({func:_.EQUAL,mask:255},255,255,_.KEEP,_.DECR,_.DECR),Te=new Zt([Ue,_.DST_ALPHA,_.ONE_MINUS_DST_ALPHA,_.ZERO],s.al.transparent,[!0,!0,!0,!0]);aa(u,t,r,c,Ce,We,Te,zt.disabled,se,"color",k,j,N,G,K,Ve,M,he)}{const Ue=new Zt([_.ONE,_.ONE,_.ONE,se?_.ZERO:_.ONE],s.al.transparent,[!1,!1,!1,!0],se?_.FUNC_ADD:_.MAX);aa(u,t,r,c,Ce,Lt.disabled,Ue,zt.disabled,se,"clear",k,j,N,G,K,Ve,M,he,fe)}};if(ie||te){let se;if(u.prepareDrawTile(),T){const he=T.drapeBufferSize[0],fe=T.drapeBufferSize[1];se=T.framebufferCopyTexture,se&&(!se||se.size[0]===he&&se.size[1]===fe)||(se&&se.destroy(),se=T.framebufferCopyTexture=new s.T(f,new s.r({width:he,height:fe}),_.RGBA8)),se.bind(_.LINEAR,_.CLAMP_TO_EDGE),_.copyTexSubImage2D(_.TEXTURE_2D,0,0,0,0,0,he,fe)}ie&&oe(!0,!1,se),te&&oe(!1,!0,se)}}else ie&&ne(!0),te&&ne(!1),(ie||te)&&u.resetStencilClippingMasks()}}},hillshade:function(u,t,r,c){if(u.renderPass!=="offscreen"&&u.renderPass!=="translucent"||u.style.disableElevatedTerrain)return;const d=u.context,f=u.terrain&&u.terrain.renderingToTexture,[_,T]=u.renderPass!=="translucent"||f?[{},c]:u.stencilConfigForOverlap(c);for(const E of T){const M=t.getTile(E);if(M.needsHillshadePrepare&&u.renderPass==="offscreen")Oh(u,M,r);else if(u.renderPass==="translucent"){const A=u.depthModeForSublayer(0,xt.ReadOnly),z=r.paint.get("hillshade-emissive-strength"),C=u.colorModeForDrapableLayerRenderPass(z),k=f&&u.terrain?u.terrain.stencilModeForRTTOverlap(E):_[E.overscaledZ];Js(u,E,M,r,A,k,C)}}d.viewport.set([0,0,u.width,u.height]),u.resetStencilClippingMasks()},raster:function(u,t,r,c,d,f){if(u.renderPass!=="translucent"||r.paint.get("raster-opacity")===0)return;const _=u.transform.projection.name==="globe",T=r.paint.get("raster-elevation")!==0,E=T&&_;if(u.renderElevatedRasterBackface&&!E)return;const M=u.context,A=M.gl,z=t.getSource(),C=function(ne,oe,se,he){const fe=oe.paint.get("raster-color"),Ce=ne.type==="raster-array",Se=[],Ve=oe.paint.get("raster-resampling"),Ue=oe.paint.get("raster-color-mix");let We=oe.paint.get("raster-color-range");const Te=[Ue[0],Ue[1],Ue[2],0],Ne=Ue[3];let be=Ve==="nearest"?he.NEAREST:he.LINEAR;if(Ce&&(Se.push("RASTER_ARRAY"),fe||Se.push("RASTER_COLOR"),Ve==="linear"&&Se.push("RASTER_ARRAY_LINEAR"),be=he.NEAREST,!We&&ne.rasterLayers)){const Be=ne.rasterLayers.find(({id:ke})=>ke===oe.sourceLayer);Be&&Be.fields&&Be.fields.range&&(We=Be.fields.range)}if(We=We||[0,1],fe){Se.push("RASTER_COLOR"),se.activeTexture.set(he.TEXTURE2),oe.updateColorRamp(We);let Be=oe.colorRampTexture;Be||(Be=oe.colorRampTexture=new s.T(se,oe.colorRamp,he.RGBA8)),Be.bind(he.LINEAR,he.CLAMP_TO_EDGE)}return{mix:Te,range:We,offset:Ne,defines:Se,resampling:be}}(z,r,M,A);if(z instanceof s.aK&&!c.length&&!_)return;const k=r.paint.get("raster-emissive-strength"),j=u.colorModeForDrapableLayerRenderPass(k),N=u.terrain&&u.terrain.renderingToTexture,G=!u.options.moving,$=r.paint.get("raster-resampling")==="nearest"?A.NEAREST:A.LINEAR;if(z instanceof s.aK&&!c.length&&(z.onNorthPole||z.onSouthPole)){const ne=T?u.stencilModeFor3D():Lt.disabled;return void Ie(!!z.onNorthPole,null,u,t,r,k,C,zt.disabled,ne)}if(!c.length)return;const[K,ie]=z instanceof s.aK||N?[{},c]:u.stencilConfigForOverlap(c),te=ie[ie.length-1].overscaledZ;E&&C.defines.push("PROJECTION_GLOBE_VIEW"),T&&C.defines.push("RENDER_CUTOFF");const ae=(ne,oe,se)=>{for(const he of ne){const fe=he.toUnwrapped(),Ce=t.getTile(he);if(N&&(!Ce||!Ce.hasData()))continue;M.activeTexture.set(A.TEXTURE0);const Se=gl(Ce,z,r,C);if(!Se||!Se.texture)continue;const{texture:Ve,mix:Ue,offset:We,tileSize:Te,buffer:Ne}=Se;let be,Be;N?(be=xt.disabled,Be=he.projMatrix):T?(be=new xt(A.LEQUAL,xt.ReadWrite,u.depthRangeFor3D),Be=_?Float32Array.from(u.transform.expandedFarZProjMatrix):u.transform.calculateProjMatrix(fe,G)):(be=u.depthModeForSublayer(he.overscaledZ-te,r.paint.get("raster-opacity")===1?xt.ReadWrite:xt.ReadOnly,A.LESS),Be=u.transform.calculateProjMatrix(fe,G));const ke=u.terrain&&N?u.terrain.stencilModeForRTTOverlap(he):K[he.overscaledZ],je=f?0:r.paint.get("raster-fade-duration");Ce.registerFadeDuration(je);const ze=t.findLoadedParent(he,0),qe=ol(Ce,ze,t,u.transform,je);let et,tt;u.terrain&&u.terrain.prepareDrawTile(),M.activeTexture.set(A.TEXTURE0),Ve.bind($,A.CLAMP_TO_EDGE),M.activeTexture.set(A.TEXTURE1),ze?(ze.texture&&ze.texture.bind($,A.CLAMP_TO_EDGE),et=Math.pow(2,ze.tileID.overscaledZ-Ce.tileID.overscaledZ),tt=[Ce.tileID.canonical.x*et%1,Ce.tileID.canonical.y*et%1]):Ve.bind($,A.CLAMP_TO_EDGE),"useMipmap"in Ve&&M.extTextureFilterAnisotropic&&u.transform.pitch>20&&A.texParameterf(A.TEXTURE_2D,M.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,M.extTextureFilterAnisotropicMax);const it=u.transform;let ft;const Rt=T?jc(it):[0,0,0,0];let Tt,Pt,Et,Qt,pi,Pi=0;if(E&&z instanceof s.aK&&z.coordinates.length>3)Tt=Float32Array.from(s.bc(s.cI(new s.bT(0,0,0)))),Pt=Float32Array.from(it.globeMatrix),Et=Float32Array.from(s.cE(it)),Qt=[s.av(it.center.lng),s.aC(it.center.lat)],ft=z.elevatedGlobePerspectiveTransform,pi=z.elevatedGlobeGridMatrix||new Float32Array(9);else if(E){const mt=s.cF(he.canonical);Pi=s.cG(mt.getCenter().lat),Tt=Float32Array.from(s.bc(s.cI(he.canonical))),Pt=Float32Array.from(it.globeMatrix),Et=Float32Array.from(s.cE(it)),Qt=[s.av(it.center.lng),s.aC(it.center.lat)],ft=[0,0],pi=Float32Array.from(s.cH(he.canonical,mt,Pi,it.worldSize/it._pixelsPerMercatorPixel))}else ft=z instanceof s.aK?z.perspectiveTransform:[0,0],Tt=new Float32Array(16),Pt=new Float32Array(9),Et=new Float32Array(16),Qt=[0,0],pi=new Float32Array(9);const Ht=N3(Be,Tt,Pt,Et,pi,tt||[0,0],s.ag(u.transform.zoom),Qt,Rt,et||1,qe,r,ft,T?r.paint.get("raster-elevation"):0,2,Ue,We,C.range,Te,Ne,k),Fi=u.isTileAffectedByFog(he),Ot=u.getOrCreateProgram("raster",{defines:C.defines,overrideFog:Fi});if(u.uploadCommonUniforms(M,Ot,fe),z instanceof s.aK){const mt=z.elevatedGlobeVertexBuffer,ti=z.elevatedGlobeIndexBuffer;if(N||!_)z.boundsBuffer&&z.boundsSegments&&Ot.draw(u,A.TRIANGLES,be,Lt.disabled,j,zt.disabled,Ht,r.id,z.boundsBuffer,u.quadTriangleIndexBuffer,z.boundsSegments);else if(mt&&ti){const wi=it.zoom<=s.c6?z.elevatedGlobeSegments:z.getSegmentsForLongitude(it.center.lng);wi&&Ot.draw(u,A.TRIANGLES,be,Lt.disabled,j,oe,Ht,r.id,mt,ti,wi)}}else if(E){be=new xt(A.LEQUAL,xt.ReadOnly,u.depthRangeFor3D);const mt=u.globeSharedBuffers;if(mt){const[ti,wi,li]=mt.getGridBuffers(Pi,!1);Ot.draw(u,A.TRIANGLES,be,se||ke,u.colorModeForRenderPass(),oe,Ht,r.id,ti,wi,li)}}else{const{tileBoundsBuffer:mt,tileBoundsIndexBuffer:ti,tileBoundsSegments:wi}=u.getTileBoundsBuffers(Ce);Ot.draw(u,A.TRIANGLES,be,ke,j,zt.disabled,Ht,r.id,mt,ti,wi)}}if(!(z instanceof s.aK)&&E)for(const he of ne){const fe=he.canonical.y===(1<>>16,2654435769),((he=Math.imul(he^he>>>16,2654435769))>>>0)/4294967296},se=1/1.1;for(let he=0;hes.d7[ke](Ve));Ne.push(Ve);const be=Ve.canonical.x,Be=Ve.canonical.y;for(const ke of Ne){const je=te.getTile(fe?ke.wrapped():ke);if(!je)continue;const ze=je.rasterParticleState;if(!ze)continue;const qe=ke.canonical.x+(1<ne.tileID)),k&&(M.activeTexture.set(A.TEXTURE0),u.imageManager.bind(u.context,r.scope)),E){const ne=u.getOrCreateProgram(ie,{overrideFog:!1,overrideRtt:!0}),oe=new Float32Array(s.ad.mat4.identity([])),se=new s.aH(0,0,0,0,0),he=k?Nc(oe,T,_,u,0,r.scope,j,E,{tileID:se,tileSize:C}):U3(oe,T,_,d.toRenderColor(f?null:r.lut));ne.draw(u,A.TRIANGLES,$,G,K,zt.disabled,he,r.id,u.viewportBuffer,u.quadTriangleIndexBuffer,u.viewportSegments)}else for(const ne of ae){const oe=u.isTileAffectedByFog(ne),se=u.getOrCreateProgram(ie,{overrideFog:oe}),he=ne.toUnwrapped(),fe=c?ne.projMatrix:u.transform.calculateProjMatrix(he);u.prepareDrawTile();const Ce=t?t.getTile(ne):te?te[ne.key]:new Cn(ne,C,z.zoom,u),Se=k?Nc(fe,T,_,u,0,r.scope,j,E,{tileID:ne,tileSize:C}):U3(fe,T,_,d.toRenderColor(f?null:r.lut));u.uploadCommonUniforms(M,se,he);const{tileBoundsBuffer:Ve,tileBoundsIndexBuffer:Ue,tileBoundsSegments:We}=u.getTileBoundsBuffers(Ce);se.draw(u,A.TRIANGLES,$,G,K,zt.disabled,Se,r.id,Ve,Ue,We)}},sky:function(u,t,r){const c=u._atmosphere?s.ag(u.transform.zoom):1,d=r.paint.get("sky-opacity")*c;if(d===0)return;const f=u.context,_=r.paint.get("sky-type"),T=new xt(f.gl.LEQUAL,xt.ReadOnly,[0,1]),E=u.frameCounter/1e3%1;_==="atmosphere"?u.renderPass==="offscreen"?r.needsSkyboxCapture(u)&&(function(M,A,z,C){const k=M.context,j=k.gl;let N=A.skyboxFbo;if(!N){N=A.skyboxFbo=k.createFramebuffer(32,32,!0,null),A.skyboxGeometry=new Hc(k),A.skyboxTexture=k.gl.createTexture(),j.bindTexture(j.TEXTURE_CUBE_MAP,A.skyboxTexture),j.texParameteri(j.TEXTURE_CUBE_MAP,j.TEXTURE_WRAP_S,j.CLAMP_TO_EDGE),j.texParameteri(j.TEXTURE_CUBE_MAP,j.TEXTURE_WRAP_T,j.CLAMP_TO_EDGE),j.texParameteri(j.TEXTURE_CUBE_MAP,j.TEXTURE_MIN_FILTER,j.LINEAR),j.texParameteri(j.TEXTURE_CUBE_MAP,j.TEXTURE_MAG_FILTER,j.LINEAR);for(let ie=0;ie<6;++ie)j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,j.RGBA,32,32,0,j.RGBA,j.UNSIGNED_BYTE,null)}k.bindFramebuffer.set(N.framebuffer),k.viewport.set([0,0,32,32]);const G=A.getCenter(M,!0),$=M.getOrCreateProgram("skyboxCapture"),K=new Float64Array(16);s.ad.mat4.identity(K),s.ad.mat4.rotateY(K,K,.5*-Math.PI),fr(M,A,$,K,G,0),s.ad.mat4.identity(K),s.ad.mat4.rotateY(K,K,.5*Math.PI),fr(M,A,$,K,G,1),s.ad.mat4.identity(K),s.ad.mat4.rotateX(K,K,.5*-Math.PI),fr(M,A,$,K,G,2),s.ad.mat4.identity(K),s.ad.mat4.rotateX(K,K,.5*Math.PI),fr(M,A,$,K,G,3),s.ad.mat4.identity(K),fr(M,A,$,K,G,4),s.ad.mat4.identity(K),s.ad.mat4.rotateY(K,K,Math.PI),fr(M,A,$,K,G,5),k.viewport.set([0,0,M.width,M.height])}(u,r),r.markSkyboxValid(u)):u.renderPass==="sky"&&function(M,A,z,C,k){const j=M.context,N=j.gl,G=M.transform,$=M.getOrCreateProgram("skybox");j.activeTexture.set(N.TEXTURE0),N.bindTexture(N.TEXTURE_CUBE_MAP,A.skyboxTexture);const K=((ie,te,ae,ne,oe)=>({u_matrix:ie,u_sun_direction:te,u_cubemap:0,u_opacity:ne,u_temporal_offset:oe}))(G.skyboxMatrix,A.getCenter(M,!1),0,C,k);M.uploadCommonUniforms(j,$),$.draw(M,N.TRIANGLES,z,Lt.disabled,M.colorModeForRenderPass(),zt.backCW,K,"skybox",A.skyboxGeometry.vertexBuffer,A.skyboxGeometry.indexBuffer,A.skyboxGeometry.segment)}(u,r,T,d,E):_==="gradient"&&u.renderPass==="sky"&&function(M,A,z,C,k){const j=M.context,N=j.gl,G=M.transform,$=M.getOrCreateProgram("skyboxGradient");A.skyboxGeometry||(A.skyboxGeometry=new Hc(j)),j.activeTexture.set(N.TEXTURE0);let K=A.colorRampTexture;K||(K=A.colorRampTexture=new s.T(j,A.colorRamp,N.RGBA8)),K.bind(N.LINEAR,N.CLAMP_TO_EDGE);const ie=((te,ae,ne,oe,se)=>({u_matrix:te,u_color_ramp:0,u_center_direction:ae,u_radius:s.ak(ne),u_opacity:oe,u_temporal_offset:se}))(G.skyboxMatrix,A.getCenter(M,!1),A.paint.get("sky-gradient-radius"),C,k);M.uploadCommonUniforms(j,$),$.draw(M,N.TRIANGLES,z,Lt.disabled,M.colorModeForRenderPass(),zt.backCW,ie,"skyboxGradient",A.skyboxGeometry.vertexBuffer,A.skyboxGeometry.indexBuffer,A.skyboxGeometry.segment)}(u,r,T,d,E)},debug:function(u,t,r,c,d,f){for(let _=0;_{_&&(_.useNormalOffset=!0,T||(_.enabled=!0))},M=t.getSource();if(u.renderPass==="light-beam"&&M.type!=="batched-model")return;if(M.type==="vector"||M.type==="geojson")return function($,K,ie,te,ae){const ne=$.transform;if(ne.projection.name!=="mercator")return void s.w(`Drawing 3D models for ${ne.projection.name} projection is not yet implemented`);const oe=ne.getFreeCameraOptions().position;if(!$.modelManager)return;const se=$.modelManager;ie.modelManager=se;const he=$.shadowRenderer;if(!ie._unevaluatedLayout._values.hasOwnProperty("model-id"))return;const fe=ie._unevaluatedLayout._values["model-id"],Ce=Object.assign({},ie.layout.get("model-id").parameters),Se=$.style.order.indexOf(ie.fqid);for(const Ve of te){const Ue=K.getTile(Ve).getBucket(ie);if(!Ue||Ue.projection.name!==ne.projection.name)continue;const We=Ue.getModelUris();We&&!Ue.modelsRequested&&(se.addModelsFromBucket(We,ae),Ue.modelsRequested=!0);const Te=Q3(Ve,ne);Ce.zoom=Te;const Ne=fe.possiblyEvaluate(Ce);if(J3($,Ue,Ve),wn.shadowUniformsInitialized=!1,wn.useSingleShadowCascade=!!he&&he.getMaxCascadeForTile(Ve.toUnwrapped())===0,$.renderPass==="shadow"&&he){if($.currentShadowCascade===1&&Ue.isInsideFirstShadowMapFrustum)continue;const ke=ne.calculatePosMatrix(Ve.toUnwrapped(),ne.worldSize);if(wn.tileMatrix.set(ke),wn.shadowTileMatrix=Float32Array.from(he.calculateShadowPassMatrixFromMatrix(ke)),wn.aabb.min.fill(0),wn.aabb.max[0]=wn.aabb.max[1]=s.ai,wn.aabb.max[2]=0,vl(Ue,wn,$,ie.scope))continue}const be=1<0&&$.style.isLayerClipped(ie,K.getSource())&&Ue.updateReplacement(Ve,$.replacementSource,Se,ae)&&(Ue.uploaded=!1,Ue.upload($.context));for(let ke in Ue.instancesPerModel){const je=Ue.instancesPerModel[ke];je.features.length>0&&(ke=Ne.evaluate(je.features[0].feature,{}));const ze=se.getModel(ke,ae);if(ze&&ze.uploaded)for(const qe of ze.nodes)Ln($,ie,qe,je,Be,Ve,wn)}}}(u,t,r,c,M.type==="vector"?r.scope:""),void E();if(!M.loaded())return;if(M.type==="batched-model")return function($,K,ie,te){ie.resetLayerRenderingStats($);const ae=$.context,ne=$.transform,oe=$.style.fog,se=$.shadowRenderer;if(ne.projection.name!=="mercator")return void s.w(`Drawing 3D landmark models for ${ne.projection.name} projection is not yet implemented`);const he=$.transform.getFreeCameraOptions().position,fe=s.ad.vec3.scale([],[he.x,he.y,he.z],$.transform.worldSize),Ce=s.ad.vec3.negate([],fe),Se=s.ad.mat4.identity([]),Ve=s.dm(ne.center.lat,ne.zoom),Ue=s.ad.mat4.fromScaling([],[1,1,1/Ve]);s.ad.mat4.translate(Se,Se,Ce);const We=ie.paint.get("model-opacity").constantOr(1),Te=new xt(ae.gl.LEQUAL,xt.ReadWrite,$.depthRangeFor3D),Ne=new xt(ae.gl.LEQUAL,xt.ReadOnly,$.depthRangeFor3D),be=new s.ce([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),Be=$.renderPass==="shadow",ke=Be&&se?se.getCurrentCascadeFrustum():ne.getFrustum(ne.scaleZoom(ne.worldSize)),je=ie.paint.get("model-front-cutoff"),ze=je[2]<1,qe=lo($,ie.paint.get("model-cutoff-fade-range")),et=ie.getLayerRenderingStats();(function(tt,it,ft,Rt){const Tt=tt.terrain?tt.terrain.exaggeration():0,Pt=tt.transform.zoom;for(const Et of Rt){const Qt=it.getTile(Et).getBucket(ft);Qt&&(Qt.setFilter(ft.filter),tt.conflationActive&&Qt.updateReplacement(Et,tt.replacementSource),Qt.evaluateScale(tt,ft),tt.terrain&&Tt>0&&Qt.elevationUpdate(tt.terrain,Tt,Et,ft.source),Qt.needsReEvaluation(tt,Pt,ft)&&Qt.evaluate(ft))}})($,K,ie,te),function(){let tt,it,ft;ze?(tt=te.length-1,it=-1,ft=-1):(tt=0,it=te.length,ft=1);const Rt=new Float64Array(16),Tt=s.ad.vec3.create(),Pt=new s.P(0,0);for(let Et=tt;Et!==it;Et+=ft){const Qt=te[Et],pi=K.getTile(Qt).getBucket(ie);if(!pi||!pi.uploaded)continue;let Pi=!1;se&&(Pi=se.getMaxCascadeForTile(Qt.toUnwrapped())===0);const Ht=ne.calculatePosMatrix(Qt.toUnwrapped(),ne.worldSize),Fi=pi.modelTraits;!Be&&ze&&(s.ad.mat4.invert(Rt,Ht),s.ad.vec3.transformMat4(Tt,fe,Rt),Pt.x=Tt[0],Pt.y=Tt[1]);const Ot=[];pi.setFilter(ie.filter);for(const mt of pi.getNodesInfo()){if(mt.hiddenByReplacement||!mt.node.meshes)continue;const ti=mt.node;let wi=0;$.terrain&&ti.elevation&&(wi=ti.elevation*$.terrain.exaggeration());const li=(()=>{const Ei=mt.aabb;return be.min=[...Ei.min],be.max=[...Ei.max],be.min[2]+=wi,be.max[2]+=wi,s.ad.vec3.transformMat4(be.min,be.min,Ht),s.ad.vec3.transformMat4(be.max,be.max,Ht),be})(),$i=mt.evaluatedScale;if($i[0]<=1&&$i[1]<=1&&$i[2]<=1&&li.intersects(ke)===0)continue;if(!Be&&ze){const Ei=.16666666666666666;mt.cameraCollisionOpacity=fe[0]>li.min[0]&&fe[0]li.min[1]&&fe[1]!ze||mt.opacity===1&&ti.opacity===1?mt.depthti.depth?-1:1);for(const mt of Ot){const ti=mt.nodeInfo,wi=ti.node;let li=s.ad.mat4.multiply([],Ue,mt.tileModelMatrix);s.ad.mat4.multiply(li,Se,li);const $i=s.ad.mat4.invert([],li);s.ad.mat4.transpose($i,$i),s.ad.mat4.scale($i,$i,$o),li=s.ad.mat4.multiply(li,li,wi.matrix);const Qi=$.renderPass==="light-beam",or=ie.paint.get("model-color-use-theme").constantOr("default")==="none",ar=Fi&s.ds.HasMapboxMeshFeatures,cn=ar?0:ti.evaluatedRMEA[0][2];for(let zr=0;zr=ot||yo>=ot}}const sr=si.material;let Xn;sr.occlusionTexture&&sr.occlusionTexture.offsetScale&&(Xn=sr.occlusionTexture.offsetScale,Ei.defines.push("OCCLUSION_TEXTURE_TRANSFORM"));const Kr=$.getOrCreateProgram("model",Ei);!Be&&se&&se.setupShadowsFromMatrix(mt.tileModelMatrix,Kr,se.useNormalOffset),$.uploadCommonUniforms(ae,Kr,null,Di);const Sn=sr.pbrMetallicRoughness;Sn.metallicFactor=.9,Sn.roughnessFactor=.5;const Gr=j3(new Float32Array(fi),new Float32Array(li),new Float32Array($i),new Float32Array(wi.matrix),$,mt.opacity,Sn.baseColorFactor.toRenderColor(null),sr.emissiveFactor,Sn.metallicFactor,Sn.roughnessFactor,sr,cn,ie,[0,0,0],Xn);!Bi&&(ti.hasTranslucentParts||mt.opacity<1)&&Kr.draw($,ae.gl.TRIANGLES,Te,Lt.disabled,Zt.disabled,zt.backCCW,Gr,ie.id,si.vertexBuffer,si.indexBuffer,si.segments,ie.paint,$.transform.zoom,void 0,yr),Kr.draw($,ae.gl.TRIANGLES,Bi?Ne:Te,Lt.disabled,Bi||mt.opacity<1||ti.hasTranslucentParts?Zt.alphaBlended:Zt.unblended,zt.backCCW,Gr,ie.id,si.vertexBuffer,si.indexBuffer,si.segments,ie.paint,$.transform.zoom,void 0,yr)}}}}()}(u,t,r,c),void E();if(M.type!=="model")return;const A=M.getModels(),z=[],C=u.transform.getFreeCameraOptions().position,k=s.ad.vec3.scale([],[C.x,C.y,C.z],u.transform.worldSize);s.ad.vec3.negate(k,k);const j=[],N=[];let G=0;for(const $ of A){const K=r.paint.get("model-rotation").constantOr(null),ie=r.paint.get("model-scale").constantOr(null),te=r.paint.get("model-translation").constantOr(null);$.computeModelMatrix(u,K,ie,te,!0,!0,!1);const ae=s.ad.mat4.identity([]),ne=s.dm($.position.lat,u.transform.zoom),oe=s.ad.mat4.fromScaling([],[1,1,1/ne]);s.ad.mat4.translate(ae,ae,k),z.push({zScaleMatrix:oe,negCameraPosMatrix:ae});for(const se of $.nodes)_s(u.transform,se,$.matrix,u.transform.expandedFarZProjMatrix,G,j,N);G++}if(j.sort(($,K)=>K.depth-$.depth),u.renderPass!=="shadow"){if(d===1)for(const $ of N)mo($,u,r,z[$.modelIndex],Lt.disabled,u.colorModeForRenderPass());else{for(const $ of N)mo($,u,r,z[$.modelIndex],Lt.disabled,Zt.disabled);for(const $ of N)mo($,u,r,z[$.modelIndex],u.stencilModeFor3D(),u.colorModeForRenderPass());u.resetStencilClippingMasks()}for(const $ of j)mo($,u,r,z[$.modelIndex],Lt.disabled,u.colorModeForRenderPass());E()}else{for(const $ of N)c0($.mesh,$.nodeModelMatrix,u,r);for(const $ of j)c0($.mesh,$.nodeModelMatrix,u,r);E()}}},El={line:function(u,t,r){if(u.hasElevatedBuckets=!1,u.hasNonElevatedBuckets=!1,u._unevaluatedLayout.getValue("line-elevation-reference")!==void 0||u._unevaluatedLayout.getValue("line-z-offset")!==void 0){if(t){const c=t.getVisibleCoordinates();for(const d of c){const f=t.getTile(d).getBucket(u);if(f&&(f.hasZOffset?u.hasElevatedBuckets=!0:u.hasNonElevatedBuckets=!0,u.hasElevatedBuckets&&u.hasNonElevatedBuckets))break}}}else u.hasNonElevatedBuckets=!0},model:function(u,t,r){const c=t.getSource();if(!c.loaded())return;if(c.type==="vector"||c.type==="geojson")return void(r.modelManager&&r.modelManager.upload(r,c.type==="vector"?u.scope:""));if(c.type==="batched-model"||c.type!=="model")return;const d=c.getModels();for(const f of d)f.upload(r.context)},raster:function(u,t,r){const c=t.getSource();if(!(c instanceof Gn&&c.loaded()))return;const d=u.sourceLayer||c.rasterLayerIds&&c.rasterLayerIds[0];if(!d)return;const f=u.paint.get("raster-array-band")||c.getInitialBand(d);if(f==null)return;const _=t.getIds().map(T=>t.getTileByID(T));for(const T of _)T.updateNeeded(d,f)&&c.prepareTile(T,d,f)},"raster-particle":function(u,t,r){const c=t.getSource();if(!(c instanceof Gn&&c.loaded()))return;const d=u.sourceLayer||c.rasterLayerIds&&c.rasterLayerIds[0];if(!d)return;const f=u.paint.get("raster-particle-array-band")||c.getInitialBand(d);if(f==null)return;const _=t.getIds().map(T=>t.getTileByID(T));for(const T of _)T.updateNeeded(d,f)&&c.prepareTile(T,d,f)}},Ml={fill:Z3};class Al{constructor(t,r,c,d,f){this.context=new Go(t,r),this.transform=c,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.tp=f,this._timeStamp=s.q.now(),this._averageFPS=0,this._fpsHistory=[],this._dt=0,this._debugParams={forceEnablePrecipitation:!1,showTerrainProxyTiles:!1,fpsWindow:30,continousRedraw:!1,enabledLayers:{}};const _=["fill","line","symbol","circle","heatmap","fill-extrusion","raster","raster-particle","hillshade","model","background","sky"];for(const E of _)this._debugParams.enabledLayers[E]=!0;f.registerParameter(this._debugParams,["Terrain"],"showTerrainProxyTiles",{},()=>{this.style.map.triggerRepaint()}),f.registerParameter(this._debugParams,["Precipitation"],"forceEnablePrecipitation"),f.registerParameter(this._debugParams,["FPS"],"fpsWindow",{min:1,max:100,step:1}),f.registerBinding(this._debugParams,["FPS"],"continousRedraw",{readonly:!0,label:"continuous redraw"}),f.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"value"}),f.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"graph",view:"graph",min:0,max:200});for(const E of _)f.registerParameter(this._debugParams.enabledLayers,["Debug","Layers"],E);this.occlusionParams=new i1(f),this.setup(),this.numSublayers=yn.maxUnderzooming+yn.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={},this.conflationActive=!1,this.replacementSource=new s.dy,this.longestCutoffRange=0,this.minCutoffZoom=0,this._fogVisible=!1,this._cachedTileFogOpacities={},this._shadowRenderer=new co(this),this._wireframeDebugCache=new gs,this.renderDefaultNorthPole=!0,this.renderDefaultSouthPole=!0,this.layersWithOcclusionOpacity=[];const T=new s.r({width:1,height:1},Uint8Array.of(0,0,0,0));this.emptyDepthTexture=new s.T(this.context,T,t.RGBA8),this._clippingActiveLastFrame=!1,this.scaleFactor=d}updateTerrain(t,r){const c=!!t&&!!t.terrain&&this.transform.projection.supportsTerrain;if(!(c||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new Dc(this,t));const d=this._terrain;this.transform.elevation=c?d:null,d.update(t,this.transform,r),this.transform.elevation&&!d.enabled&&(this.transform.elevation=null)}_updateFog(t){const r=t.fog;if(!r||this.transform.projection.name==="globe"||r.getOpacity(this.transform.pitch)<1||r.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[c,d]=r.getFovAdjustedRange(this.transform._fov);if(c>d)return void(this.transform.fogCullDistSq=null);const f=c+.78*(d-c);this.transform.fogCullDistSq=f*f}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled||this._forceTerrainMode?this._terrain:null}get forceTerrainMode(){return this._forceTerrainMode}set forceTerrainMode(t){t&&!this._terrain&&(this._terrain=new Dc(this,this.style)),this._forceTerrainMode=t}get shadowRenderer(){return this._shadowRenderer&&this._shadowRenderer.enabled?this._shadowRenderer:null}get wireframeDebugCache(){return this._wireframeDebugCache}resize(t,r){if(this.width=t*s.q.devicePixelRatio,this.height=r*s.q.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const c of this.style.order)this.style._mergedLayers[c].resize()}setup(){const t=this.context,r=new s.b5;r.emplaceBack(0,0),r.emplaceBack(s.ai,0),r.emplaceBack(0,s.ai),r.emplaceBack(s.ai,s.ai),this.tileExtentBuffer=t.createVertexBuffer(r,s.b7.members),this.tileExtentSegments=s.b8.simpleSegment(0,0,4,2);const c=new s.b5;c.emplaceBack(0,0),c.emplaceBack(s.ai,0),c.emplaceBack(0,s.ai),c.emplaceBack(s.ai,s.ai),this.debugBuffer=t.createVertexBuffer(c,s.b7.members),this.debugSegments=s.b8.simpleSegment(0,0,4,5);const d=new s.b5;d.emplaceBack(-1,-1),d.emplaceBack(1,-1),d.emplaceBack(-1,1),d.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(d,s.b7.members),this.viewportSegments=s.b8.simpleSegment(0,0,4,2);const f=new s.aU;f.emplaceBack(0,0,0,0),f.emplaceBack(s.ai,0,s.ai,0),f.emplaceBack(0,s.ai,0,s.ai),f.emplaceBack(s.ai,s.ai,s.ai,s.ai),this.mercatorBoundsBuffer=t.createVertexBuffer(f,s.ba.members),this.mercatorBoundsSegments=s.b8.simpleSegment(0,0,4,2);const _=new s.aV;_.emplaceBack(0,1,2),_.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(_);const T=new s.b6;for(const M of[0,1,3,2,0])T.emplaceBack(M);this.debugIndexBuffer=t.createIndexBuffer(T),this.emptyTexture=new s.T(t,new s.r({width:1,height:1},Uint8Array.of(0,0,0,0)),t.gl.RGBA8),this.identityMat=s.ad.mat4.create();const E=this.context.gl;this.stencilClearMode=new Lt({func:E.ALWAYS,mask:0},0,255,E.ZERO,E.ZERO,E.ZERO),this.loadTimeStamps.push(performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(t){return t._makeTileBoundsBuffers(this.context,this.transform.projection),t._tileBoundsBuffer?{tileBoundsBuffer:t._tileBoundsBuffer,tileBoundsIndexBuffer:t._tileBoundsIndexBuffer,tileBoundsSegments:t._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const t=this.context.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.getOrCreateProgram("clippingMask").draw(this,t.TRIANGLES,xt.disabled,this.stencilClearMode,Zt.disabled,zt.disabled,ta(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(t,r,c){if(!r||this.currentStencilSource===r.id||!t.isTileClipped()||!c||c.length===0)return;if(this._tileClippingMaskIDs&&!this.terrain){let T=!1;for(const E of c)if(this._tileClippingMaskIDs[E.key]===void 0){T=!0;break}if(!T)return}this.currentStencilSource=r.id;const d=this.context,f=d.gl;this.nextStencilID+c.length>256&&this.clearStencil(),d.setColorMode(Zt.disabled),d.setDepthMode(xt.disabled);const _=this.getOrCreateProgram("clippingMask");this._tileClippingMaskIDs={};for(const T of c){const E=r.getTile(T),M=this._tileClippingMaskIDs[T.key]=this.nextStencilID++,{tileBoundsBuffer:A,tileBoundsIndexBuffer:z,tileBoundsSegments:C}=this.getTileBoundsBuffers(E);_.draw(this,f.TRIANGLES,xt.disabled,new Lt({func:f.ALWAYS,mask:0},M,255,f.KEEP,f.KEEP,f.REPLACE),Zt.disabled,zt.disabled,ta(T.projMatrix),"$clipping",A,z,C)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,r=this.context.gl;return new Lt({func:r.NOTEQUAL,mask:255},t,255,r.KEEP,r.KEEP,r.REPLACE)}stencilModeForClipping(t){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(t);const r=this.context.gl;return new Lt({func:r.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,r.KEEP,r.KEEP,r.REPLACE)}stencilConfigForOverlap(t){const r=this.context.gl,c=t.sort((_,T)=>T.overscaledZ-_.overscaledZ),d=c[c.length-1].overscaledZ,f=c[0].overscaledZ-d+1;if(f>1){this.currentStencilSource=void 0,this.nextStencilID+f>256&&this.clearStencil();const _={};for(let T=0;Tthis.style&&this.style.enable3dLights()&&this.terrain&&this.terrain.renderingToTexture)()&&this.renderPass==="translucent"?new Zt([r.ONE,r.ONE_MINUS_SRC_ALPHA,r.CONSTANT_ALPHA,r.ONE_MINUS_SRC_ALPHA],new s.al(0,0,0,t===void 0?0:t),[!0,!0,!0,!0]):this.colorModeForRenderPass()}depthModeForSublayer(t,r,c,d=!1){if(this.depthOcclusion)return new xt(this.context.gl.GREATER,xt.ReadOnly,this.depthRangeFor3D);if(!this.opaquePassEnabledForLayer()&&!d)return xt.disabled;const f=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new xt(c||this.context.gl.LEQUAL,r,[f,f])}opaquePassEnabledForLayer(){return this.currentLayerthis._debugParams.fpsWindow&&this._fpsHistory.splice(0,this._fpsHistory.length-this._debugParams.fpsWindow),this._averageFPS=Math.round(this._fpsHistory.reduce((t,r)=>t+r/this._fpsHistory.length,0))}render(t,r){const c=s.q.now();this._dt=c-this._timeStamp,this._timeStamp=c,this._wireframeDebugCache.update(this.frameCounter),this._debugParams.continousRedraw=t.map.repaint,this.style=t,this.options=r;const d=this.style._mergedLayers,f=!(!this.terrain||!this.terrain.enabled),_=()=>this.style._getOrder(f).filter(Te=>{const Ne=d[Te];return!(Ne.type in this._debugParams.enabledLayers)||this._debugParams.enabledLayers[Ne.type]});let T=_(),E=!1,M=!1;for(const Te of T){const Ne=d[Te];Ne.type==="circle"&&(E=!0),Ne.type==="symbol"&&(Ne.hasInitialOcclusionOpacityProperties?M=!0:E=!0)}let A=T.map(Te=>d[Te]);const z=this.style._mergedSourceCaches;this.imageManager=t.imageManager,this.modelManager=t.modelManager,this.symbolFadeChange=t.placement.symbolFadeChange(s.q.now()),this.imageManager.beginFrame();let C=0,k=!1;for(const Te in z){const Ne=z[Te];Ne.used&&(Ne.prepare(this.context),Ne.getSource().usedInConflation&&++C)}let j=!1;for(const Te of A)Te.isHidden(this.transform.zoom)||(Te.type==="clip"&&(j=!0),this.prepareLayer(Te));const N={},G={},$={},K={},ie={};for(const Te in z){const Ne=z[Te];N[Te]=Ne.getVisibleCoordinates(),G[Te]=N[Te].slice().reverse(),$[Te]=Ne.getVisibleCoordinates(!0).reverse(),K[Te]=Ne.getShadowCasterCoordinates(),ie[Te]=Ne.sortCoordinatesByDistance(N[Te])}const te=Te=>{const Ne=this.style.getLayerSourceCache(Te);return Ne&&Ne.used?Ne.getSource():null};if(C||j||this._clippingActiveLastFrame){const Te=[],Ne=[];let be=0;for(const Be of A)this.isSourceForClippingOrConflation(Be,te(Be))&&(Te.push(Be),Ne.push(be)),be++;if(Te&&(j||Te.length>1)||this._clippingActiveLastFrame){j=!1;const Be=[];for(let ke=0;ke0){const Be=te(Ne);Be&&(this.minCutoffZoom=Math.max(Be.minzoom,this.minCutoffZoom)),Ne.minzoom&&(this.minCutoffZoom=Math.max(Ne.minzoom,this.minCutoffZoom))}Ne.is3D(f)&&(this.opaquePassCutoff===1/0&&(this.opaquePassCutoff=Te),this._lastOcclusionLayer=Te)}const ae=this.style&&this.style.fog;ae?(this._fogVisible=ae.getOpacity(this.transform.pitch)!==0,this._fogVisible&&this.transform.projection.name!=="globe"&&(this._fogVisible=ae.isVisibleOnFrustum(this.transform.cameraFrustum))):this._fogVisible=!1,this._cachedTileFogOpacities={},this.terrain&&(this.terrain.updateTileBinding($),this.opaquePassCutoff=0,T=_(),A=T.map(Te=>d[Te]));const ne=this._shadowRenderer;if(ne){ne.updateShadowParameters(this.transform,this.style.directionalLight);for(const Te in z)for(const Ne of N[Te]){let be={min:0,max:0};this.terrain&&(be=this.terrain.getMinMaxForTile(Ne)||be),ne.addShadowReceiver(Ne.toUnwrapped(),be.min,be.max)}}this.transform.projection.name!=="globe"||this.globeSharedBuffers||(this.globeSharedBuffers=new s.dz(this.context)),this.style.fog&&this.transform.projection.supportsFog?(this._atmosphere||(this._atmosphere=new Zc(this)),this._atmosphere.update(this)):this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0);const oe=this._debugParams.forceEnablePrecipitation||!(!this.style||!this.style.snow),se=this._debugParams.forceEnablePrecipitation||!(!this.style||!this.style.rain);if(oe&&!this._snow&&(this._snow=new fa(this)),!oe&&this._snow&&(this._snow.destroy(),delete this._snow),se&&!this._rain&&(this._rain=new s1(this)),!se&&this._rain&&(this._rain.destroy(),delete this._rain),this._snow&&this._snow.update(this),this._rain&&this._rain.update(this),!is.has(this.context.gl))return;this.renderPass="offscreen";for(const Te of A){const Ne=t.getLayerSourceCache(Te);if(!Te.hasOffscreenPass()||Te.isHidden(this.transform.zoom))continue;const be=Ne?G[Ne.id]:void 0;(Te.type==="custom"||Te.type==="raster"||Te.type==="raster-particle"||Te.isSky()||be&&be.length)&&this.renderLayer(this,Ne,Te,be)}this.depthRangeFor3D=[0,1-(A.length+2)*this.numSublayers*this.depthEpsilon],this._shadowRenderer&&(this.renderPass="shadow",this._shadowRenderer.drawShadowPass(this.style,K)),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);const he=this.transform.projection.name==="globe"||this.transform.isHorizonVisible(),fe=(()=>{if(r.showOverdrawInspector)return s.al.black;const Te=this.style.fog;if(Te&&this.transform.projection.supportsFog){const Ne=this.style.getLut(Te.scope);if(!he){const be=Te.properties.get("color-use-theme")==="none",Be=Te.properties.get("color").toRenderColor(be?null:Ne).toArray01();return new s.al(...Be)}if(he){const be=Te.properties.get("space-color-use-theme")==="none",Be=Te.properties.get("space-color").toRenderColor(be?null:Ne).toArray01();return new s.al(...Be)}}return s.al.transparent})();if(this.context.clear({color:fe,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.renderPass="opaque",this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&he&&this._atmosphere.drawStars(this,this.style.fog),!this.terrain)for(this.currentLayer=T.length-1;this.currentLayer>=0;this.currentLayer--){const Te=A[this.currentLayer],Ne=t.getLayerSourceCache(Te);if(Te.isSky())continue;const be=Ne?(Te.is3D(f)?ie:G)[Ne.id]:void 0;this._renderTileClippingMasks(Te,Ne,be),this.renderLayer(this,Ne,Te,be)}if(this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&he&&this._atmosphere.drawAtmosphereGlow(this,this.style.fog),this.renderPass="sky",(!this._atmosphere||s.ag(this.transform.zoom)>0)&&(this.transform.projection.name==="globe"||this.transform.isHorizonVisible()))for(this.currentLayer=0;this.currentLayer{for(this.currentLayer=0;this.currentLayer0&&Te.hasShadowPass()&&--Se==0&&(ne.drawGroundShadows(),this.firstLightBeamLayer<=this.currentLayer)){const be=this.currentLayer;for(this.renderPass="light-beam",this.currentLayer=this.firstLightBeamLayer;this.currentLayer<=be;this.currentLayer++){const Be=A[this.currentLayer];if(!Be.hasLightBeamPass())continue;const ke=t.getLayerSourceCache(Be);this.renderLayer(this,ke,Be,ke?G[ke.id]:void 0)}this.currentLayer=be,this.renderPass="translucent"}if(this.currentLayer>=this._lastOcclusionLayer&&this.layersWithOcclusionOpacity.length>0){const be=this.currentLayer;this.depthOcclusion=!0;for(const Be of this.layersWithOcclusionOpacity){this.currentLayer=Be;const ke=A[this.currentLayer],je=t.getLayerSourceCache(ke),ze=je?G[je.id]:void 0;this.terrain||this._renderTileClippingMasks(ke,je,je?N[je.id]:void 0),this.renderLayer(this,je,ke,ze)}this.depthOcclusion=!1,this.currentLayer=be,this.renderPass="translucent",this.layersWithOcclusionOpacity=[]}++this.currentLayer}}if(this.terrain&&this.terrain.postRender(),this._snow&&this._snow.draw(this),this._rain&&this._rain.draw(this),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let Te=null;A.forEach(Ne=>{const be=t.getLayerSourceCache(Ne);be&&!Ne.isHidden(this.transform.zoom)&&be.getVisibleCoordinates().length&&(!Te||Te.getSource().maxzoom0?r.pop():null}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture||this.forceTerrainMode}linearFloatFilteringSupported(){return this.context.extTextureFloatLinear!=null}currentGlobalDefines(t,r,c){const d=c===void 0?this.terrain&&this.terrain.renderingToTexture:c,f=[];return this.style&&this.style.enable3dLights()&&(t==="globeRaster"||t==="terrainRaster"?(f.push("LIGHTING_3D_MODE"),f.push("LIGHTING_3D_ALPHA_EMISSIVENESS")):d||f.push("LIGHTING_3D_MODE")),this.renderPass==="shadow"&&(this._shadowMapDebug||f.push("DEPTH_TEXTURE")),this.terrainRenderModeElevated()&&(f.push("TERRAIN"),this.linearFloatFilteringSupported()&&f.push("TERRAIN_DEM_FLOAT_FORMAT")),this.transform.projection.name==="globe"&&f.push("GLOBE"),!this._fogVisible||d||r!==void 0&&!r||f.push("FOG","FOG_DITHERING"),d&&f.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&f.push("OVERDRAW_INSPECTOR"),f}getOrCreateProgram(t,r){this.cache=this.cache||{};const c=r&&r.defines||[],d=r&&r.config,f=this.currentGlobalDefines(t,r&&r.overrideFog,r&&r.overrideRtt).concat(c),_=Oc.cacheKey(e0[t],t,f,d);return this.cache[_]||(this.cache[_]=new Oc(this.context,t,e0[t],d,G3[t],f)),this.cache[_]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new s.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA8))}destroy(){this._terrain&&this._terrain.destroy(),this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this._wireframeDebugCache.destroy(),this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),this.emptyDepthTexture&&this.emptyDepthTexture.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}uploadCommonLightUniforms(t,r){if(this.style.enable3dLights()){const c=this.style.directionalLight,d=this.style.ambientLight;if(c&&d){const f=((_,T,E)=>{const M=_.properties.get("direction"),A=_.properties.get("color-use-theme")==="none",z=_.properties.get("color").toRenderColor(A?null:E.getLut(_.scope)).toArray01(),C=_.properties.get("intensity"),k=T.properties.get("color-use-theme")==="none",j=T.properties.get("color").toRenderColor(k?null:E.getLut(T.scope)).toArray01(),N=T.properties.get("intensity"),G=[M.x,M.y,M.z],$=s.cN(j,N),K=s.cN(z,C);return{u_lighting_ambient_color:$,u_lighting_directional_dir:G,u_lighting_directional_color:K,u_ground_radiance:Lc(G,K,$)}})(c,d,this.style);r.setLightsUniformValues(t,f)}}}uploadCommonUniforms(t,r,c,d,f){if(this.uploadCommonLightUniforms(t,r),this.terrain&&this.terrain.renderingToTexture)return;const _=this.style.fog;if(_){const T=_.getOpacity(this.transform.pitch),E=((M,A,z,C,k,j,N,G,$,K,ie,te)=>{const ae=M.transform,ne=A.properties.get("color-use-theme")==="none",oe=A.properties.get("color").toRenderColor(ne?null:M.style.getLut(A.scope)).toArray01();oe[3]=C;const se=M.frameCounter/1e3%1,[he,fe]=A.properties.get("vertical-range");return{u_fog_matrix:z?ae.calculateFogTileMatrix(z):te||M.identityMat,u_fog_range:A.getFovAdjustedRange(ae._fov),u_fog_color:oe,u_fog_horizon_blend:A.properties.get("horizon-blend"),u_fog_vertical_limit:[Math.min(he,fe),fe],u_fog_temporal_offset:se,u_frustum_tl:k,u_frustum_tr:j,u_frustum_br:N,u_frustum_bl:G,u_globe_pos:$,u_globe_radius:K,u_viewport:ie,u_globe_transition:s.ag(ae.zoom),u_is_globe:+(ae.projection.name==="globe")}})(this,_,c,T,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*s.q.devicePixelRatio,this.transform.height*s.q.devicePixelRatio],d);r.setFogUniformValues(t,E)}f&&r.setCutoffUniformValues(t,f.uniformValues)}setTileLoadedFlag(t){this.tileLoaded=t}saveCanvasCopy(){const t=this.canvasCopy();t&&(this.frameCopies.push(t),this.tileLoaded=!1)}canvasCopy(){const t=this.context.gl,r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,t.drawingBufferWidth,t.drawingBufferHeight,0),r}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const t=this.style&&this.style.fog;return!!t&&t.getOpacity(this.transform.pitch)!==0}getBackgroundTiles(){const t=this._backgroundTiles,r=this._backgroundTiles={},c=this.transform.coveringTiles({tileSize:512});for(const d of c)r[d.key]=t[d.key]||new Cn(d,512,this.transform.tileZoom,this);return r}clearBackgroundTiles(){this._backgroundTiles={}}isSourceForClippingOrConflation(t,r){return!(!t.is3D(!(!this.terrain||!this.terrain.enabled))||t.type!=="clip"&&(t.minzoom&&t.minzoom>this.transform.zoom||(this.style._clipLayerPresent||t.sourceLayer!=="building")&&(!r||r.type!=="batched-model")))}isTileAffectedByFog(t){if(!this.style||!this.style.fog)return!1;if(this.transform.projection.name==="globe")return!0;let r=this._cachedTileFogOpacities[t.key];return r||(this._cachedTileFogOpacities[t.key]=r=this.style.fog.getOpacityForTile(t)),r[0]>=ot||r[1]>=ot}setupDepthForOcclusion(t,r,c){const d=this.context,f=d.gl,_=!!c;var T;c||(c={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0}),d.activeTexture.set(f.TEXTURE3),t&&this.depthFBO&&this.depthTexture?(this.depthTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE),c.u_depth_size_inv=[1/this.depthFBO.width,1/this.depthFBO.height],c.u_depth_range_unpack=[2/((T=this.depthRangeFor3D)[1]-T[0]),-1-2*T[0]/(T[1]-T[0])],c.u_occluder_half_size=.5*this.occlusionParams.occluderSize,c.u_occlusion_depth_offset=this.occlusionParams.depthOffset):this.emptyDepthTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE),d.activeTexture.set(f.TEXTURE0),_||r.setTerrainUniformValues(d,c)}}function Il(u,t){let r=!1,c=null;const d=()=>{c=null,r&&(u(),c=setTimeout(d,t),r=!1)};return()=>(r=!0,c||d(),c)}class l1{constructor(t){this._hashName=t&&encodeURIComponent(t),s.aQ(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Il(this._updateHashUnthrottled.bind(this),300)}addTo(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),t.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const t=this._map;if(!t)return"";const r=c1(t);if(this._hashName){const c=this._hashName;let d=!1;const f=location.hash.slice(1).split("&").map(_=>{const T=_.split("=")[0];return T===c?(d=!0,`${T}=${r}`):_}).filter(_=>_);return d||f.push(`${c}=${r}`),`#${f.join("&")}`}return`#${r}`}_getCurrentHash(){const t=location.hash.replace("#","");if(this._hashName){let r;return t.split("&").map(c=>c.split("=")).forEach(c=>{c[0]===this._hashName&&(r=c)}),(r&&r[1]||"").split("/")}return t.split("/")}_onHashChange(){const t=this._map;if(!t)return!1;const r=this._getCurrentHash();if(r.length>=3&&!r.some(c=>isNaN(c))){const c=t.dragRotate.isEnabled()&&t.touchZoomRotate.isEnabled()?+(r[3]||0):t.getBearing();return t.jumpTo({center:[+r[2],+r[1]],zoom:+r[0],bearing:c,pitch:+(r[4]||0)}),!0}return!1}_updateHashUnthrottled(){history.replaceState(history.state,"",location.href.replace(/(#.+)?$/,this.getHashString()))}}function c1(u,t){const r=u.getCenter(),c=Math.round(100*u.getZoom())/100,d=Math.ceil((c*Math.LN2+Math.log(512/360/.5))/Math.LN10),f=Math.pow(10,d),_=Math.round(r.lng*f)/f,T=Math.round(r.lat*f)/f,E=u.getBearing(),M=u.getPitch();let A=t?`/${_}/${T}/${c}`:`${c}/${T}/${_}`;return(E||M)&&(A+="/"+Math.round(10*E)/10),M&&(A+=`/${Math.round(M)}`),A}const d0={linearity:.3,easing:s.dB(0,0,.3,1)},Wc=s.l({deceleration:2500,maxSpeed:1400},d0),Xc=s.l({deceleration:20,maxSpeed:1400},d0),Yc=s.l({deceleration:1e3,maxSpeed:360},d0),Kc=s.l({deceleration:1e3,maxSpeed:90},d0);class Jc{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:s.q.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,r=s.q.now();for(;t.length>0&&r-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const r={zoom:0,bearing:0,pitch:0,pan:new s.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:f}of this._inertiaBuffer)r.zoom+=f.zoomDelta||0,r.bearing+=f.bearingDelta||0,r.pitch+=f.pitchDelta||0,f.panDelta&&r.pan._add(f.panDelta),f.around&&(r.around=f.around),f.pinchAround&&(r.pinchAround=f.pinchAround);const c=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,d={};if(r.pan.mag()){const f=f0(r.pan.mag(),c,s.l({},Wc,t||{}));d.offset=r.pan.mult(f.amount/r.pan.mag()),d.center=this._map.transform.center,p0(d,f)}if(r.zoom){const f=f0(r.zoom,c,Xc);d.zoom=this._map.transform.zoom+f.amount,p0(d,f)}if(r.bearing){const f=f0(r.bearing,c,Yc);d.bearing=this._map.transform.bearing+s.ay(f.amount,-179,179),p0(d,f)}if(r.pitch){const f=f0(r.pitch,c,Kc);d.pitch=this._map.transform.pitch+f.amount,p0(d,f)}if(d.zoom||d.bearing){const f=r.pinchAround===void 0?r.around:r.pinchAround;d.around=f?this._map.unproject(f):this._map.getCenter()}return this.clear(),d.noMoveStart=!0,d}}function p0(u,t){(!u.duration||u.durationr.unproject(E)),T=f.reduce((E,M,A,z)=>E.add(M.div(z.length)),new s.P(0,0));super(t,{points:f,point:T,lngLats:_,lngLat:r.unproject(T),originalEvent:c}),this._defaultPrevented=!1}}class Qc extends s.A{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,r){super("wheel",{originalEvent:r}),this._defaultPrevented=!1}}class eu{constructor(t,r){this._map=t,this._clickTolerance=r.clickTolerance}reset(){this._mousedownPos=void 0}wheel(t){return this._firePreventable(new Qc(this._map,t))}mousedown(t,r){return this._mousedownPos=r,this._firePreventable(new Xr(t.type,this._map,t))}mouseup(t){this._map.fire(new Xr(t.type,this._map,t))}preclick(t){const r=s.l({},t);r.type="preclick",this._map.fire(new Xr(r.type,this._map,r))}click(t,r){this._mousedownPos&&this._mousedownPos.dist(r)>=this._clickTolerance||(this.preclick(t),this._map.fire(new Xr(t.type,this._map,t)))}dblclick(t){return this._firePreventable(new Xr(t.type,this._map,t))}mouseover(t){this._map.fire(new Xr(t.type,this._map,t))}mouseout(t){this._map.fire(new Xr(t.type,this._map,t))}touchstart(t){return this._firePreventable(new m0(t.type,this._map,t))}touchmove(t){this._map.fire(new m0(t.type,this._map,t))}touchend(t){this._map.fire(new m0(t.type,this._map,t))}touchcancel(t){this._map.fire(new m0(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Xh{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(t){this._map.fire(new Xr(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Xr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Xr(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Yh{constructor(t,r){this._map=t,this._el=t.getCanvasContainer(),this._container=t.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(t,r){this.isEnabled()&&t.shiftKey&&t.button===0&&(mi(),this._startPos=this._lastPos=r,this._active=!0)}mousemoveWindow(t,r){if(!this._active)return;const c=r,d=this._startPos,f=this._lastPos;if(!d||!f||f.equals(c)||!this._box&&c.dist(d){this._box&&(this._box.style.transform=`translate(${_}px,${E}px)`,this._box.style.width=T-_+"px",this._box.style.height=M-E+"px")})}mouseupWindow(t,r){if(!this._active)return;const c=this._startPos,d=r;if(c&&t.button===0){if(this.reset(),vt(),c.x!==d.x||c.y!==d.y)return this._map.fire(new s.A("boxzoomend",{originalEvent:t})),{cameraAnimation:f=>f.fitScreenCoordinates(c,d,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",t)}}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),Nn(),delete this._startPos,delete this._lastPos}_fireEvent(t,r){return this._map.fire(new s.A(t,{originalEvent:r}))}}function ki(u,t){const r={};for(let c=0;cthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===0&&(this.startTime=t.timeStamp),c.length===this.numTouches&&(this.centroid=function(d){const f=new s.P(0,0);for(const _ of d)f._add(_);return f.div(d.length)}(r),this.touches=ki(c,r)))}touchmove(t,r,c){if(this.aborted||!this.centroid)return;const d=ki(c,r);for(const f in this.touches){const _=d[f];(!_||_.dist(this.touches[f])>30)&&(this.aborted=!0)}}touchend(t,r,c){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),c.length===0){const d=!this.aborted&&this.centroid;if(this.reset(),d)return d}}}class u1{constructor(t){this.singleTap=new tu(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(t,r,c){this.singleTap.touchstart(t,r,c)}touchmove(t,r,c){this.singleTap.touchmove(t,r,c)}touchend(t,r,c){const d=this.singleTap.touchend(t,r,c);if(d){const f=t.timeStamp-this.lastTime<500,_=!this.lastTap||this.lastTap.dist(d)<30;if(f&&_||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=d,this.count===this.numTaps)return this.reset(),d}}}class Kh{constructor(){this._zoomIn=new u1({numTouches:1,numTaps:2}),this._zoomOut=new u1({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,r,c){this._zoomIn.touchstart(t,r,c),this._zoomOut.touchstart(t,r,c)}touchmove(t,r,c){this._zoomIn.touchmove(t,r,c),this._zoomOut.touchmove(t,r,c)}touchend(t,r,c){const d=this._zoomIn.touchend(t,r,c),f=this._zoomOut.touchend(t,r,c);return d?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:_.getZoom()+1,around:_.unproject(d)},{originalEvent:t})}):f?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:_.getZoom()-1,around:_.unproject(f)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const _0={0:1,2:2},h1={Control:"ctrlKey",Alt:"altKey",Shift:"shiftKey",Meta:"metaKey"};class g0{constructor(t){this.reset(),this._clickTolerance=t.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(t,r){return!1}_move(t,r){return{}}mousedown(t,r){if(this._lastPoint)return;const c=Ft(t);this._correctButton(t,c)&&(this._lastPoint=r,this._eventButton=c)}mousemoveWindow(t,r){const c=this._lastPoint;if(c){if(t.preventDefault(),this._eventButton!=null&&function(d,f){const _=_0[f];return d.buttons===void 0||(d.buttons&_)!==_}(t,this._eventButton))this.reset();else if(this._moved||!(r.dist(c)0&&(this._active=!0);const d=ki(c,r),f=new s.P(0,0),_=new s.P(0,0);let T=0;for(const M in d){const A=d[M],z=this._touches[M];z&&(f._add(A),_._add(A.sub(z)),T++,d[M]=A)}if(this._touches=d,T{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.removeAttribute("role")},500)}}class Tn{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(t){}_move(t,r,c){return{}}touchstart(t,r,c){this._firstTwoTouches||c.length<2||(this._firstTwoTouches=[c[0].identifier,c[1].identifier],this._start([r[0],r[1]]))}touchmove(t,r,c){const d=this._firstTwoTouches;if(!d)return;t.preventDefault();const[f,_]=d,T=ma(c,r,f),E=ma(c,r,_);if(!T||!E)return;const M=this._aroundCenter?null:T.add(E).div(2);return this._move([T,E],M,t)}touchend(t,r,c){if(!this._firstTwoTouches)return;const[d,f]=this._firstTwoTouches,_=ma(c,r,d),T=ma(c,r,f);_&&T||(this._active&&vt(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&t.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function ma(u,t,r){for(let c=0;cMath.abs(u.x)}class Jh extends Tn{constructor(t){super(),this._map=t}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(t){this._lastPoints=t,d1(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,r,c){const d=this._lastPoints;if(!d)return;const f=t[0].sub(d[0]),_=t[1].sub(d[1]);return this._map._cooperativeGestures&&!s.dC()&&c.touches.length<3||(this._valid=this.gestureBeginsVertically(f,_,c.timeStamp),!this._valid)?void 0:(this._lastPoints=t,this._active=!0,{pitchDelta:(f.y+_.y)/2*-.5})}gestureBeginsVertically(t,r,c){if(this._valid!==void 0)return this._valid;const d=t.mag()>=2,f=r.mag()>=2;if(!d&&!f)return;if(!d||!f)return this._firstMove==null&&(this._firstMove=c),c-this._firstMove<100&&void 0;const _=t.y>0==r.y>0;return d1(t)&&d1(r)&&_}}const p1={panStep:100,bearingStep:15,pitchStep:10};class f1{constructor(){const t=p1;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let r=0,c=0,d=0,f=0,_=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?c=-1:(t.preventDefault(),f=-1);break;case 39:t.shiftKey?c=1:(t.preventDefault(),f=1);break;case 38:t.shiftKey?d=1:(t.preventDefault(),_=-1);break;case 40:t.shiftKey?d=-1:(t.preventDefault(),_=1);break;default:return}return this._rotationDisabled&&(c=0,d=0),{cameraAnimation:T=>{const E=T.getZoom();T.easeTo({duration:300,easeId:"keyboardHandler",easing:b0,zoom:r?Math.round(E)+r*(t.shiftKey?2:1):E,bearing:T.getBearing()+c*this._bearingStep,pitch:T.getPitch()+d*this._pitchStep,offset:[-f*this._panStep,-_*this._panStep],center:T.getCenter()},{originalEvent:t})}}}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 b0(u){return u*(2-u)}const ys=4.000244140625,_o=1/450;class On{constructor(t,r){this._map=t,this._el=t.getCanvasContainer(),this._handler=r,this._delta=0,this._lastDelta=0,this._defaultZoomRate=.01,this._wheelZoomRate=_o,s.aQ(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&t.around==="center",this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(t.ctrlKey||t.metaKey||this.isZooming()||s.dC()))return void this._showBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let r=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const c=s.q.now(),d=c-(this._lastWheelEventTime||0);this._lastWheelEventTime=c,r!==0&&r%ys==0?this._type="wheel":r!==0&&Math.abs(r)<4?this._type="trackpad":d>400?(this._type=null,this._lastValue=r,this._timeout=window.setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(d*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),t.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=t,this._delta-=r,this._active||this._start(t)),t.preventDefault()}_onTimeout(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)}_start(t){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=dn(this._el,t);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:r,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const t=this._map.transform;this._type==="wheel"&&t.projection.wrap&&(t._center.lng>=180||t._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const r=()=>t._terrainEnabled()&&this._aroundCoord?t.computeZoomRelativeTo(this._aroundCoord):t.zoom;if(this._delta!==0){const M=this._type==="wheel"&&Math.abs(this._delta)>ys?this._wheelZoomRate:this._defaultZoomRate;let A=2/(1+Math.exp(-Math.abs(this._delta*M)));this._delta<0&&A!==0&&(A=1/A);const z=r(),C=Math.pow(2,z),k=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):C;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(k*A))),this._type==="wheel"&&(this._startZoom=z,this._easing=this._smoothOutEasing(200)),this._lastDelta=this._delta,this._delta=0}const c=typeof this._targetZoom=="number"?this._targetZoom:r(),d=this._startZoom,f=this._easing;let _,T=!1;if(this._type==="wheel"&&d&&f){const M=Math.min((s.q.now()-this._lastWheelEventTime)/200,1),A=f(M);_=s.ah(d,c,A),M<1?this._frameId||(this._frameId=!0):T=!0}else _=c,T=!0;this._active=!0,T&&(this._active=!1,this._finishTimeout=window.setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200));let E=_-r();return E*this._lastDelta<0&&(E=0),{noInertia:!0,needsRenderFrame:!T,zoomDelta:E,around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let r=s.dD;if(this._prevEase){const c=this._prevEase,d=(s.q.now()-c.start)/c.duration,f=c.easing(d+.01)-c.easing(d),_=.27/Math.sqrt(f*f+1e-4)*.01,T=Math.sqrt(.0729-_*_);r=s.dB(_,T,.25,1)}return this._prevEase={start:s.q.now(),duration:t,easing:r},r}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=ut("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.removeAttribute("role")},200)}}class Zo{constructor(t,r){this._clickZoom=t,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 xs{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(t,r){return t.preventDefault(),{cameraAnimation:c=>{c.easeTo({duration:300,zoom:c.getZoom()+(t.shiftKey?-1:1),around:c.unproject(r)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Wo{constructor(){this._tap=new u1({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(t,r,c){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?c.length>0&&(this._swipePoint=r[0],this._swipeTouch=c[0].identifier):this._tap.touchstart(t,r,c))}touchmove(t,r,c){if(this._tapTime){if(this._swipePoint){if(c[0].identifier!==this._swipeTouch)return;const d=r[0],f=d.y-this._swipePoint.y;return this._swipePoint=d,t.preventDefault(),this._active=!0,{zoomDelta:f/128}}}else this._tap.touchmove(t,r,c)}touchend(t,r,c){this._tapTime?this._swipePoint&&c.length===0&&this.reset():this._tap.touchend(t,r,c)&&(this._tapTime=t.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Qh{constructor(t,r,c){this._el=t,this._mousePan=r,this._touchPan=c}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class e4{constructor(t,r,c){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=r,this._mousePitch=c}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 t4{constructor(t,r,c,d){this._el=t,this._touchZoom=r,this._touchRotate=c,this._tapDragZoom=d,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-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 Cl=u=>u.zoom||u.drag||u.pitch||u.rotate;class nu extends s.A{}class Fr{constructor(){this.constants=[1,1,.01],this.radius=0}setup(t,r){const c=s.ad.vec3.sub([],r,t);this.radius=s.ad.vec3.length(c[2]<0?s.ad.vec3.div([],c,this.constants):[c[0],c[1],0])}projectRay(t){s.ad.vec3.div(t,t,this.constants),s.ad.vec3.normalize(t,t),s.ad.vec3.mul(t,t,this.constants);const r=s.ad.vec3.scale([],t,this.radius);if(r[2]>0){const c=s.ad.vec3.scale([],[0,0,1],s.ad.vec3.dot(r,[0,0,1])),d=s.ad.vec3.scale([],s.ad.vec3.normalize([],[r[0],r[1],0]),this.radius),f=s.ad.vec3.add([],r,s.ad.vec3.scale([],s.ad.vec3.sub([],s.ad.vec3.add([],d,c),r),2));r[0]=f[0],r[1]=f[1]}return r}}function _a(u){return u.panDelta&&u.panDelta.mag()||u.zoomDelta||u.bearingDelta||u.pitchDelta}class ou{constructor(t,r){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Jc(t),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new Fr,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(r),s.aQ(["handleEvent","handleWindowEvent"],this);const c=this._el;this._listeners=[[c,"touchstart",{passive:!0}],[c,"touchmove",{passive:!1}],[c,"touchend",void 0],[c,"touchcancel",void 0],[c,"mousedown",void 0],[c,"mousemove",void 0],[c,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[c,"mouseover",void 0],[c,"mouseout",void 0],[c,"dblclick",void 0],[c,"click",void 0],[c,"keydown",{capture:!1}],[c,"keyup",void 0],[c,"wheel",{passive:!1}],[c,"contextmenu",void 0],[window,"blur",void 0]];for(const[d,f,_]of this._listeners){const T=d===document?this.handleWindowEvent:this.handleEvent;d.addEventListener(f,T,_)}}destroy(){for(const[t,r,c]of this._listeners){const d=t===document?this.handleWindowEvent:this.handleEvent;t.removeEventListener(r,d,c)}}_addDefaultHandlers(t){const r=this._map,c=r.getCanvasContainer();this._add("mapEvent",new eu(r,t));const d=r.boxZoom=new Yh(r,t);this._add("boxZoom",d);const f=new Kh,_=new xs;r.doubleClickZoom=new Zo(_,f),this._add("tapZoom",f),this._add("clickZoom",_);const T=new Wo;this._add("tapDragZoom",T);const E=r.touchPitch=new Jh(r);this._add("touchPitch",E);const M=new Zn(t),A=new y0(t);r.dragRotate=new e4(t,M,A),this._add("mouseRotate",M,["mousePitch"]),this._add("mousePitch",A,["mouseRotate"]);const z=new Pl(t),C=new Ji(r,t);r.dragPan=new Qh(c,z,C),this._add("mousePan",z),this._add("touchPan",C,["touchZoom","touchRotate"]);const k=new v0,j=new iu;r.touchZoomRotate=new t4(c,j,k,T),this._add("touchRotate",k,["touchPan","touchZoom"]),this._add("touchZoom",j,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Xh(r));const N=r.scrollZoom=new On(r,this);this._add("scrollZoom",N,["mousePan"]);const G=r.keyboard=new f1;this._add("keyboard",G);for(const $ of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])t.interactive&&t[$]&&r[$].enable(t[$])}_add(t,r,c){this._handlers.push({handlerName:t,handler:r,allowed:c}),this._handlersById[t]=r}stop(t){if(!this._updatingCamera){for(const{handler:r}of this._handlers)r.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[],this._originalZoom=void 0}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Cl(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(t,r,c){for(const d in t)if(d!==c&&(!r||r.indexOf(d)<0))return!0;return!1}handleWindowEvent(t){this.handleEvent(t,`${t.type}Window`)}_getMapTouches(t){const r=[];for(const c of t)this._el.contains(c.target)&&r.push(c);return r}handleEvent(t,r){this._updatingCamera=!0;const c=t.type==="renderFrame",d=c?void 0:t,f={needsRenderFrame:!1},_={},T={},E=t.touches?this._getMapTouches(t.touches):void 0,M=E?zo(this._el,E):c?void 0:dn(this._el,t);for(const{handlerName:C,handler:k,allowed:j}of this._handlers){if(!k.isEnabled())continue;let N;this._blockedByActive(T,j,C)?k.reset():k[r||t.type]&&(N=k[r||t.type](t,M,E),this.mergeHandlerResult(f,_,N,C,d),N&&N.needsRenderFrame&&this._triggerRenderFrame()),(N||k.isActive())&&(T[C]=k)}const A={};for(const C in this._previousActiveHandlers)T[C]||(A[C]=d);this._previousActiveHandlers=T,(Object.keys(A).length||_a(f))&&(this._changes.push([f,_,A]),this._triggerRenderFrame()),(Object.keys(T).length||_a(f))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:z}=f;z&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],z(this._map))}mergeHandlerResult(t,r,c,d,f){if(!c)return;s.l(t,c);const _={handlerName:d,originalEvent:c.originalEvent||f};c.zoomDelta!==void 0&&(r.zoom=_),c.panDelta!==void 0&&(r.drag=_),c.pitchDelta!==void 0&&(r.pitch=_),c.bearingDelta!==void 0&&(r.rotate=_)}_applyChanges(){const t={},r={},c={};for(const[d,f,_]of this._changes)d.panDelta&&(t.panDelta=(t.panDelta||new s.P(0,0))._add(d.panDelta)),d.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+d.zoomDelta),d.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+d.bearingDelta),d.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+d.pitchDelta),d.around!==void 0&&(t.around=d.around),d.aroundCoord!==void 0&&(t.aroundCoord=d.aroundCoord),d.pinchAround!==void 0&&(t.pinchAround=d.pinchAround),d.noInertia&&(t.noInertia=d.noInertia),s.l(r,f),s.l(c,_);this._updateMapTransform(t,r,c),this._changes=[]}_updateMapTransform(t,r,c){const d=this._map,f=d.transform,_=K=>[K.x,K.y,K.z];if((K=>{const ie=this._eventsInProgress.drag;return ie&&!this._handlersById[ie.handlerName].isActive()})()&&!_a(t)){const K=f.zoom;f.cameraElevationReference="sea",this._originalZoom!=null&&f._orthographicProjectionAtLowPitch&&f.projection.name!=="globe"&&f.pitch===0?(f.cameraElevationReference="ground",f.zoom=this._originalZoom):(f.recenterOnTerrain(),f.cameraElevationReference="ground"),K!==f.zoom&&this._map._update(!0)}if(f._isCameraConstrained&&d._stop(!0),!_a(t))return void this._fireEvents(r,c,!0);let{panDelta:T,zoomDelta:E,bearingDelta:M,pitchDelta:A,around:z,aroundCoord:C,pinchAround:k}=t;f._isCameraConstrained&&(E>0&&(E=0),f._isCameraConstrained=!1),k!==void 0&&(z=k),(E||(K=>r[K]&&!this._eventsInProgress[K])("drag"))&&z&&(this._dragOrigin=_(f.pointCoordinate3D(z)),this._originalZoom=f.zoom,this._trackingEllipsoid.setup(f._camera.position,this._dragOrigin)),f.cameraElevationReference="sea",d._stop(!0),z=z||d.transform.centerPoint,M&&(f.bearing+=M),A&&(f.pitch+=A),f._updateCameraState();const j=[0,0,0];if(T)if(f.projection.name==="mercator"){const K=this._trackingEllipsoid.projectRay(f.screenPointToMercatorRay(z).dir),ie=this._trackingEllipsoid.projectRay(f.screenPointToMercatorRay(z.sub(T)).dir);j[0]=ie[0]-K[0],j[1]=ie[1]-K[1]}else{const K=f.pointCoordinate(z);if(f.projection.name==="globe"){T=T.rotate(-f.angle);const ie=f._pixelsPerMercatorPixel/f.worldSize;j[0]=-T.x*s.dE(s.aT(K.y))*ie,j[1]=-T.y*s.dE(f.center.lat)*ie}else{const ie=f.pointCoordinate(z.sub(T));K&&ie&&(j[0]=ie.x-K.x,j[1]=ie.y-K.y)}}const N=f.zoom,G=[0,0,0];if(E){const K=_(C||f.pointCoordinate3D(z)),ie={dir:s.ad.vec3.normalize([],s.ad.vec3.sub([],K,f._camera.position))};if(ie.dir[2]<0){const te=f.zoomDeltaToMovement(K,E);s.ad.vec3.scale(G,ie.dir,te)}}const $=s.ad.vec3.add(j,j,G);f._translateCameraConstrained($),E&&Math.abs(f.zoom-N)>1e-4&&f.recenterOnTerrain(),f.cameraElevationReference="ground",this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(r,c,!0)}_fireEvents(t,r,c){const d=Cl(this._eventsInProgress),f=Cl(t),_={};for(const A in t){const{originalEvent:z}=t[A];this._eventsInProgress[A]||(_[`${A}start`]=z),this._eventsInProgress[A]=t[A]}!d&&f&&this._fireEvent("movestart",f.originalEvent);for(const A in _)this._fireEvent(A,_[A]);f&&this._fireEvent("move",f.originalEvent);for(const A in t){const{originalEvent:z}=t[A];this._fireEvent(A,z)}const T={};let E;for(const A in this._eventsInProgress){const{handlerName:z,originalEvent:C}=this._eventsInProgress[A];this._handlersById[z].isActive()||(delete this._eventsInProgress[A],E=r[z]||C,T[`${A}end`]=E)}for(const A in T)this._fireEvent(A,T[A]);const M=Cl(this._eventsInProgress);if(c&&(d||f)&&!M){this._updatingCamera=!0;const A=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),z=C=>C!==0&&-this._bearingSnap{this._frameId=void 0,this.handleEvent(new nu("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const su="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class ga extends s.E{constructor(t,r){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=r.bearingSnap,this._respectPrefersReducedMotion=r.respectPrefersReducedMotion!==!1,s.aQ(["_renderFrameCallback"],this)}getCenter(){return new s.bO(this.transform.center.lng,this.transform.center.lat)}setCenter(t,r){return this.jumpTo({center:t},r)}panBy(t,r,c){return t=s.P.convert(t).mult(-1),this.panTo(this.transform.center,s.l({offset:t},r),c)}panTo(t,r,c){return this.easeTo(s.l({center:t},r),c)}getZoom(){return this.transform.zoom}setZoom(t,r){return this.jumpTo({zoom:t},r),this}zoomTo(t,r,c){return this.easeTo(s.l({zoom:t},r),c)}zoomIn(t,r){return this.zoomTo(this.getZoom()+1,t,r),this}zoomOut(t,r){return this.zoomTo(this.getZoom()-1,t,r),this}getBearing(){return this.transform.bearing}setBearing(t,r){return this.jumpTo({bearing:t},r),this}getPadding(){return this.transform.padding}setPadding(t,r){return this.jumpTo({padding:t},r),this}rotateTo(t,r,c){return this.easeTo(s.l({bearing:t},r),c)}resetNorth(t,r){return this.rotateTo(0,s.l({duration:1e3},t),r),this}resetNorthPitch(t,r){return this.easeTo(s.l({bearing:0,pitch:0,duration:1e3},t),r),this}snapToNorth(t,r){return Math.abs(this.getBearing())t.aspect?c/(2*Math.tan(.5*t.fovX)*t.aspect):d/(2*Math.tan(.5*t.fovY)*t.aspect)}_cameraForBoundsOnGlobe(t,r,c,d,f,_){const T=t.clone(),E=this._extendCameraOptions(_);T.bearing=d,T.pitch=f;const M=s.bO.convert(r),A=s.bO.convert(c),z=.5*(M.lat+A.lat),C=.5*(M.lng+A.lng),k=s.dF(z,C),j=s.ad.vec3.normalize([],k),N=s.ad.vec3.normalize([],s.ad.vec3.cross([],j,[0,1,0])),G=s.ad.vec3.cross([],N,j),$=[N[0],N[1],N[2],0,G[0],G[1],G[2],0,j[0],j[1],j[2],0,0,0,0,1],K=[k,s.dF(M.lat,M.lng),s.dF(A.lat,M.lng),s.dF(A.lat,A.lng),s.dF(M.lat,A.lng),s.dF(z,M.lng),s.dF(z,A.lng),s.dF(M.lat,C),s.dF(A.lat,C)];let ie=s.ce.fromPoints(K.map(ke=>[s.ad.vec3.dot(N,ke),s.ad.vec3.dot(G,ke),s.ad.vec3.dot(j,ke)]));const te=s.ad.vec3.transformMat4([],ie.center,$);s.ad.vec3.squaredLength(te)===0&&s.ad.vec3.set(te,0,0,1),s.ad.vec3.normalize(te,te),s.ad.vec3.scale(te,te,s.az),T.center=s.dG(te);const ae=T.getWorldToCameraMatrix(),ne=s.ad.mat4.invert(new Float64Array(16),ae);ie=s.ce.applyTransform(ie,s.ad.mat4.multiply([],ae,$));const oe=this._extendAABB(ie,T,E,d);if(!oe)return void s.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");ie=oe,s.ad.vec3.transformMat4(te,te,ae);const se=.5*(ie.max[2]-ie.min[2]),he=this._minimumAABBFrustumDistance(T,ie),fe=s.ad.vec3.scale([],[0,0,1],se),Ce=s.ad.vec3.add(fe,te,fe),Se=he+(T.pitch===0?0:s.ad.vec3.distance(te,Ce)),Ve=T.globeCenterInViewSpace,Ue=s.ad.vec3.sub([],te,[Ve[0],Ve[1],Ve[2]]);s.ad.vec3.normalize(Ue,Ue),s.ad.vec3.scale(Ue,Ue,Se);const We=s.ad.vec3.add([],te,Ue);s.ad.vec3.transformMat4(We,We,ne);const Te=s.dv/s.az,Ne=s.ad.vec3.length(We),be=s.bH(Math.max(Ne*Te-s.dv,Number.EPSILON),0),Be=Math.min(T.zoomFromMercatorZAdjusted(be),E.maxZoom);return Be>.5*(s.c6+s.bY)?(T.setProjection({name:"mercator"}),T.zoom=Be,this._cameraForBounds(T,r,c,d,f,_)):{center:T.center,zoom:Be,bearing:d,pitch:f}}_extendAABB(t,r,c,d){const f=.5*((c.padding.left||0)+(c.padding.right||0)),_=.5*((c.padding.top||0)+(c.padding.bottom||0)),T=_,E=f,M=f,A=_,z=r.width-(E+M),C=r.height-(T+A),k=s.ad.vec3.sub([],t.max,t.min),j=Math.min(z/k[0],C/k[1]),N=Math.min(r.scaleZoom(r.scale*j),c.maxZoom);if(isNaN(N))return null;const G=r.scale/r.zoomScale(N),$=new s.ce([t.min[0]-E*G,t.min[1]-A*G,t.min[2]],[t.max[0]+M*G,t.max[1]+T*G,t.max[2]]),K=(typeof c.offset.x=="number"&&typeof c.offset.y=="number"?new s.P(c.offset.x,c.offset.y):s.P.convert(c.offset)).rotate(-s.ak(d));return $.center[0]-=K.x*G,$.center[1]+=K.y*G,$}queryTerrainElevation(t,r){const c=this.transform.elevation;return c?(r=s.l({},{exaggerated:!0},r),c.getAtPoint(s.ac.fromLngLat(t),null,r.exaggerated)):null}_cameraForBounds(t,r,c,d,f,_){if(t.projection.name==="globe")return this._cameraForBoundsOnGlobe(t,r,c,d,f,_);const T=t.clone(),E=this._extendCameraOptions(_);T.bearing=d,T.pitch=f;const M=s.bO.convert(r),A=s.bO.convert(c),z=new s.bO(M.lng,A.lat),C=new s.bO(A.lng,M.lat),k=T.project(M),j=T.project(A),N=this.queryTerrainElevation(M),G=this.queryTerrainElevation(A),$=this.queryTerrainElevation(z),K=this.queryTerrainElevation(C),ie=[[k.x,k.y,Math.min(N||0,G||0,$||0,K||0)],[j.x,j.y,Math.max(N||0,G||0,$||0,K||0)]];let te=s.ce.fromPoints(ie);const ae=T.getWorldToCameraMatrix(),ne=s.ad.mat4.invert(new Float64Array(16),ae);te=s.ce.applyTransform(te,ae);const oe=this._extendAABB(te,T,E,d);if(!oe)return void s.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");te=oe;const se=.5*s.ad.vec3.sub([],te.max,te.min)[2],he=this._minimumAABBFrustumDistance(T,te),fe=[0,0,1,0];s.ad.vec4.transformMat4(fe,fe,ae),s.ad.vec4.normalize(fe,fe);const Ce=s.ad.vec3.scale([],fe,he+se),Se=s.ad.vec3.add([],te.center,Ce);s.ad.vec3.transformMat4(te.center,te.center,ne),s.ad.vec3.transformMat4(Se,Se,ne);const Ve=T.unproject(new s.P(te.center[0],te.center[1])),Ue=s.dH(T.projection,Ve),We=Math.pow(2,Ue),Te=Math.min(T._zoomFromMercatorZ(Se[2]*T.pixelsPerMeter*We/T.worldSize),E.maxZoom);return T.mercatorFromTransition&&Te<.5*(s.c6+s.bY)?(T.setProjection({name:"globe"}),T.zoom=Te,this._cameraForBounds(T,r,c,d,f,_)):{center:Ve,zoom:Te,bearing:d,pitch:f}}fitBounds(t,r,c){const d=this.cameraForBounds(t,r);return this._fitInternal(d,r,c)}fitScreenCoordinates(t,r,c,d,f){const _=s.P.convert(t),T=s.P.convert(r),E=new s.P(Math.min(_.x,T.x),Math.min(_.y,T.y)),M=new s.P(Math.max(_.x,T.x),Math.max(_.y,T.y));if(this.transform.projection.name==="mercator"&&this.transform.anyCornerOffEdge(_,T))return this;const A=this.transform.pointLocation3D(E),z=this.transform.pointLocation3D(M),C=this.transform.pointLocation3D(new s.P(E.x,M.y)),k=this.transform.pointLocation3D(new s.P(M.x,E.y)),j=[Math.min(A.lng,z.lng,C.lng,k.lng),Math.min(A.lat,z.lat,C.lat,k.lat)],N=[Math.max(A.lng,z.lng,C.lng,k.lng),Math.max(A.lat,z.lat,C.lat,k.lat)],G=d&&d.pitch?d.pitch:this.getPitch(),$=this._cameraForBounds(this.transform,j,N,c,G,d);return this._fitInternal($,d,f)}_fitInternal(t,r,c){return t?(r=s.l(t,r)).linear?this.easeTo(r,c):this.flyTo(r,c):this}jumpTo(t,r){this.stop();const c=t.preloadOnly?this.transform.clone():this.transform;let d=!1,f=!1,_=!1;"zoom"in t&&c.zoom!==+t.zoom&&(d=!0,c.zoom=+t.zoom),t.center!==void 0&&(c.center=s.bO.convert(t.center)),"bearing"in t&&c.bearing!==+t.bearing&&(f=!0,c.bearing=+t.bearing),"pitch"in t&&c.pitch!==+t.pitch&&(_=!0,c.pitch=+t.pitch);const T=typeof t.padding=="number"?this._extendPadding(t.padding):t.padding;if(t.padding!=null&&!c.isPaddingEqual(T))if(t.retainPadding===!1){const E=c.clone();E.padding=T,c.setLocationAtPoint(c.center,E.centerPoint)}else c.padding=T;return t.preloadOnly?(this._preloadTiles(c),this):(this.fire(new s.A("movestart",r)).fire(new s.A("move",r)),d&&this.fire(new s.A("zoomstart",r)).fire(new s.A("zoom",r)).fire(new s.A("zoomend",r)),f&&this.fire(new s.A("rotatestart",r)).fire(new s.A("rotate",r)).fire(new s.A("rotateend",r)),_&&this.fire(new s.A("pitchstart",r)).fire(new s.A("pitch",r)).fire(new s.A("pitchend",r)),this.fire(new s.A("moveend",r)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||s.w(su),this.transform.getFreeCameraOptions()}setFreeCameraOptions(t,r){const c=this.transform;if(!c.projection.supportsFreeCamera)return s.w(su),this;this.stop();const d=c.zoom,f=c.pitch,_=c.bearing;c.setFreeCameraOptions(t);const T=d!==c.zoom,E=f!==c.pitch,M=_!==c.bearing;return this.fire(new s.A("movestart",r)).fire(new s.A("move",r)),T&&this.fire(new s.A("zoomstart",r)).fire(new s.A("zoom",r)).fire(new s.A("zoomend",r)),M&&this.fire(new s.A("rotatestart",r)).fire(new s.A("rotate",r)).fire(new s.A("rotateend",r)),E&&this.fire(new s.A("pitchstart",r)).fire(new s.A("pitch",r)).fire(new s.A("pitchend",r)),this.fire(new s.A("moveend",r)),this}easeTo(t,r){this._stop(!1,t.easeId),((t=s.l({offset:[0,0],duration:500,easing:s.dD},t)).animate===!1||this._prefersReducedMotion(t))&&(t.duration=0);const c=this.transform,d=this.getZoom(),f=this.getBearing(),_=this.getPitch(),T=this.getPadding(),E="zoom"in t?+t.zoom:d,M="bearing"in t?this._normalizeBearing(t.bearing,f):f,A="pitch"in t?+t.pitch:_,z=this._extendPadding(t.padding),C=s.P.convert(t.offset);let k,j,N;if(c.projection.name==="globe"){const fe=s.ac.fromLngLat(c.center),Ce=C.rotate(-c.angle);fe.x+=Ce.x/c.worldSize,fe.y+=Ce.y/c.worldSize;const Se=fe.toLngLat(),Ve=s.bO.convert(t.center||Se);this._normalizeCenter(Ve),k=c.centerPoint.add(Ce),j=new s.P(fe.x,fe.y).mult(c.worldSize),N=new s.P(s.av(Ve.lng),s.aC(Ve.lat)).mult(c.worldSize).sub(j)}else{k=c.centerPoint.add(C);const fe=c.pointLocation(k),Ce=s.bO.convert(t.center||fe);this._normalizeCenter(Ce),j=c.project(fe),N=c.project(Ce).sub(j)}const G=c.zoomScale(E-d);let $,K;t.around&&($=s.bO.convert(t.around),K=c.locationPoint($));const ie=this._zooming||E!==d,te=this._rotating||f!==M,ae=this._pitching||A!==_,ne=!c.isPaddingEqual(z),oe=t.retainPadding===!1?c.clone():c,se=fe=>Ce=>{if(ie&&(fe.zoom=s.ah(d,E,Ce)),te&&(fe.bearing=s.ah(f,M,Ce)),ae&&(fe.pitch=s.ah(_,A,Ce)),ne&&(oe.interpolatePadding(T,z,Ce),k=oe.centerPoint.add(C)),$)fe.setLocationAtPoint($,K);else{const Se=fe.zoomScale(fe.zoom-d),Ve=E>d?Math.min(2,G):Math.max(.5,G),Ue=Math.pow(Ve,1-Ce),We=fe.unproject(j.add(N.mult(Ce*Ue)).mult(Se));fe.setLocationAtPoint(fe.renderWorldCopies?We.wrap():We,k)}return t.preloadOnly||this._fireMoveEvents(r),fe};if(t.preloadOnly){const fe=this._emulate(se,t.duration,c);return this._preloadTiles(fe),this}const he={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=ie,this._rotating=te,this._pitching=ae,this._padding=ne,this._easeId=t.easeId,this._prepareEase(r,t.noMoveStart,he),this._ease(se(c),fe=>{c.cameraElevationReference==="sea"&&c.recenterOnTerrain(),this._afterEase(r,fe)},t),this}_prepareEase(t,r,c={}){this._moving=!0,this.transform.cameraElevationReference="sea",this.transform._orthographicProjectionAtLowPitch&&this.transform.pitch===0&&this.transform.projection.name!=="globe"&&(this.transform.cameraElevationReference="ground"),r||c.moving||this.fire(new s.A("movestart",t)),this._zooming&&!c.zooming&&this.fire(new s.A("zoomstart",t)),this._rotating&&!c.rotating&&this.fire(new s.A("rotatestart",t)),this._pitching&&!c.pitching&&this.fire(new s.A("pitchstart",t))}_fireMoveEvents(t){this.fire(new s.A("move",t)),this._zooming&&this.fire(new s.A("zoom",t)),this._rotating&&this.fire(new s.A("rotate",t)),this._pitching&&this.fire(new s.A("pitch",t))}_afterEase(t,r){if(this._easeId&&r&&this._easeId===r)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const c=this._zooming,d=this._rotating,f=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,c&&this.fire(new s.A("zoomend",t)),d&&this.fire(new s.A("rotateend",t)),f&&this.fire(new s.A("pitchend",t)),this.fire(new s.A("moveend",t))}flyTo(t,r){if(this._prefersReducedMotion(t)){const ke=s.aA(t,["center","zoom","bearing","pitch","around","padding","retainPadding"]);return this.jumpTo(ke,r)}this.stop(),t=s.l({offset:[0,0],speed:1.2,curve:1.42,easing:s.dD},t);const c=this.transform,d=this.getZoom(),f=this.getBearing(),_=this.getPitch(),T=this.getPadding(),E="zoom"in t?s.ay(+t.zoom,c.minZoom,c.maxZoom):d,M="bearing"in t?this._normalizeBearing(t.bearing,f):f,A="pitch"in t?+t.pitch:_,z=this._extendPadding(t.padding),C=c.zoomScale(E-d),k=s.P.convert(t.offset);let j=c.centerPoint.add(k);const N=c.pointLocation(j),G=s.bO.convert(t.center||N);this._normalizeCenter(G);const $=c.project(N),K=c.project(G).sub($);let ie=t.curve;const te=Math.max(c.width,c.height),ae=te/C,ne=K.mag();if("minZoom"in t){const ke=s.ay(Math.min(t.minZoom,d,E),c.minZoom,c.maxZoom),je=te/c.zoomScale(ke-d);ie=Math.sqrt(je/ne*2)}const oe=ie*ie;function se(ke){const je=(ae*ae-te*te+(ke?-1:1)*oe*oe*ne*ne)/(2*(ke?ae:te)*oe*ne);return Math.log(Math.sqrt(je*je+1)-je)}function he(ke){return(Math.exp(ke)-Math.exp(-ke))/2}function fe(ke){return(Math.exp(ke)+Math.exp(-ke))/2}const Ce=se(0);let Se=function(ke){return fe(Ce)/fe(Ce+ie*ke)},Ve=function(ke){return te*((fe(Ce)*(he(je=Ce+ie*ke)/fe(je))-he(Ce))/oe)/ne;var je},Ue=(se(1)-Ce)/ie;if(Math.abs(ne)<1e-6||!isFinite(Ue)){if(Math.abs(te-ae)<1e-6)return this.easeTo(t,r);const ke=aet.maxDuration&&(t.duration=0);const We=f!==M,Te=A!==_,Ne=!c.isPaddingEqual(z),be=t.retainPadding===!1?c.clone():c,Be=ke=>je=>{const ze=je*Ue,qe=1/Se(ze);ke.zoom=je===1?E:d+ke.scaleZoom(qe),We&&(ke.bearing=s.ah(f,M,je)),Te&&(ke.pitch=s.ah(_,A,je)),Ne&&(be.interpolatePadding(T,z,je),j=be.centerPoint.add(k));const et=je===1?G:ke.unproject($.add(K.mult(Ve(ze))).mult(qe));return ke.setLocationAtPoint(ke.renderWorldCopies?et.wrap():et,j),ke._updateCameraOnTerrain(),t.preloadOnly||this._fireMoveEvents(r),ke};if(t.preloadOnly){const ke=this._emulate(Be,t.duration,c);return this._preloadTiles(ke),this}return this._zooming=!0,this._rotating=We,this._pitching=Te,this._padding=Ne,this._prepareEase(r,!1),this._ease(Be(c),()=>this._afterEase(r),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_requestRenderFrame(t){}_cancelRenderFrame(t){}_stop(t,r){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const c=this._onEaseEnd;this._onEaseEnd=void 0,c.call(this,r)}if(!t){const c=this.handlers;c&&c.stop(!1)}return this}_ease(t,r,c){c.animate===!1||c.duration===0?(t(1),r()):(this._easeStart=s.q.now(),this._easeOptions=c,this._onEaseFrame=t,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((s.q.now()-this._easeStart)/this._easeOptions.duration,1),r=this._onEaseFrame;r&&r(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,r){t=s.bF(t,-180,180);const c=Math.abs(t-r);return Math.abs(t-360-r)180?-360:c<-180?360:0}_prefersReducedMotion(t){return this._respectPrefersReducedMotion&&s.q.prefersReducedMotion&&!(t&&t.essential)}_emulate(t,r,c){const d=Math.ceil(15*r/1e3),f=[],_=t(c.clone());for(let T=0;T<=d;T++){const E=_(T/d);f.push(E.clone())}return f}_preloadTiles(t,r){}}class zl{constructor(t={}){this.options=t,s.aQ(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(t){const r=this.options&&this.options.compact,c=t._getUIString("AttributionControl.ToggleAttribution");this._map=t,this._container=ut("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=ut("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.setAttribute("aria-label",c);const d=ut("span","mapboxgl-ctrl-icon",this._compactButton);return d.setAttribute("aria-hidden","true"),d.setAttribute("title",c),this._innerContainer=ut("div","mapboxgl-ctrl-attrib-inner",this._container),r&&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),r===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),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}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));const r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||s.e.ACCESS_TOKEN}];if(t){const c=r.reduce((d,f,_)=>(f.value&&(d+=`${f.key}=${f.value}${_d.length-f.length),t=t.filter((d,f)=>{for(let _=f+1;_=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=[...this.options.customAttribution,...t]:t.unshift(this.options.customAttribution));const c=t.join(" | ");c!==this._attribHTML&&(this._attribHTML=c,t.length?(this._innerContainer.innerHTML=c,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class an{constructor(){s.aQ(["_updateLogo","_updateCompact"],this)}onAdd(t){this._map=t,this._container=ut("div","mapboxgl-ctrl");const r=ut("a","mapboxgl-ctrl-logo");return r.target="_blank",r.rel="noopener nofollow",r.href="https://www.mapbox.com/",r.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),r.setAttribute("rel","noopener nofollow"),this._container.appendChild(r),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(t){t&&t.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const t=this._map.style._sourceCaches;if(Object.entries(t).length===0)return!0;for(const r in t){const c=t[r].getSource();if(c.hasOwnProperty("mapbox_logo")&&!c.mapbox_logo)return!1}return!0}_updateCompact(){const t=this._container.children;if(t.length){const r=t[0];this._map.getCanvasContainer().offsetWidth<250?r.classList.add("mapboxgl-compact"):r.classList.remove("mapboxgl-compact")}}}class ln{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const r=++this._id;return this._queue.push({callback:t,id:r,cancelled:!1}),r}remove(t){const r=this._currentlyRunning,c=r?this._queue.concat(r):this._queue;for(const d of c)if(d.id===t)return void(d.cancelled=!0)}run(t=0){const r=this._currentlyRunning=this._queue;this._queue=[];for(const c of r)if(!c.cancelled&&(c.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}class ya{constructor(t){this.jumpTo(t)}getValue(t){if(t<=this._startTime)return this._start;if(t>=this._endTime)return this._end;const r=s.cC((t-this._startTime)/(this._endTime-this._startTime));return this._start*(1-r)+this._end*r}isEasing(t){return t>=this._startTime&&t<=this._endTime}jumpTo(t){this._startTime=-1/0,this._endTime=-1/0,this._start=t,this._end=t}easeTo(t,r,c){this._start=this.getValue(r),this._end=t,this._startTime=r,this._endTime=r+c}}const vs={"AttributionControl.ToggleAttribution":"Toggle attribution","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox homepage","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"};class bs extends s.A{constructor(t,r,c,d){const{point:f,lngLat:_,originalEvent:T,target:E}=t;super(t.type,{point:f,lngLat:_,originalEvent:T,target:E}),this.preventDefault=()=>{t.preventDefault()},this.id=r,this.interaction=c,this.feature=d}}class m1{constructor(t){this.map=t,this.interactionsByType=new Map,this.delegatedInteractions=new Map,this.typeById=new Map,this.filters=new Map,this.handleType=this.handleType.bind(this),this.handleMove=this.handleMove.bind(this),this.handleOut=this.handleOut.bind(this),this.hoveredFeatures=new Map,this.prevHoveredFeatures=new Map}add(t,r){if(this.typeById.has(t))throw new Error(`Interaction id "${t}" already exists.`);const c=r.filter;let d=r.type;c&&this.filters.set(t,s.a_(c)),d==="mouseover"&&(d="mouseenter"),d==="mouseout"&&(d="mouseleave");const f=this.interactionsByType.get(d)||new Map;d==="mouseenter"||d==="mouseleave"?(this.delegatedInteractions.size===0&&(this.map.on("mousemove",this.handleMove),this.map.on("mouseout",this.handleOut)),this.delegatedInteractions.set(t,r)):f.size===0&&this.map.on(d,this.handleType),f.size===0&&this.interactionsByType.set(d,f),f.set(t,r),this.typeById.set(t,d)}get(t){const r=this.typeById.get(t);if(!r)return;const c=this.interactionsByType.get(r);return c?c.get(t):void 0}remove(t){const r=this.typeById.get(t);if(!r)return;this.typeById.delete(t),this.filters.delete(t);const c=this.interactionsByType.get(r);c&&(c.delete(t),r==="mouseenter"||r==="mouseleave"?(this.delegatedInteractions.delete(t),this.delegatedInteractions.size===0&&(this.map.off("mousemove",this.handleMove),this.map.off("mouseout",this.handleOut))):c.size===0&&this.map.off(r,this.handleType))}queryTargets(t,r){const c=[];for(const[d,f]of r)f.target&&c.push({targetId:d,target:f.target,filter:this.filters.get(d)});return this.map.style.queryRenderedTargets(t,c,this.map.transform)}handleMove(t){this.prevHoveredFeatures=this.hoveredFeatures,this.hoveredFeatures=new Map;const r=this.queryTargets(t.point,Array.from(this.delegatedInteractions).reverse());r.length&&(t.type="mouseenter",this.handleType(t,r));const c=new Map;for(const[d,{feature:f}]of this.prevHoveredFeatures)this.hoveredFeatures.has(d)||c.set(f.id,f);c.size&&(t.type="mouseleave",this.handleType(t,Array.from(c.values())))}handleOut(t){const r=Array.from(this.hoveredFeatures.values()).map(({feature:c})=>c);r.length&&(t.type="mouseleave",this.handleType(t,r)),this.hoveredFeatures.clear()}handleType(t,r){const c=Array.from(this.interactionsByType.get(t.type)).reverse(),d=!!r;r=r||this.queryTargets(t.point,c);const f=t.type==="mouseenter";let _=!1;const T=new Set;for(const E of r){for(const[M,A]of c){if(!A.target)continue;const z=E.variants?E.variants[M]:null;if(z){for(const C of z){if(ks(C,E,T,M))continue;const k=new s.cx(E,C),j=Ua(C,E,M);d&&(k.state=this.map.getFeatureState(k));const N=f?this.prevHoveredFeatures.get(j):null,G=new bs(t,M,A,k),$=N?N.stop:A.handler(G);if(f&&this.hoveredFeatures.set(j,{feature:E,stop:$}),$!==!1){_=!0;break}}if(_)break}}if(_)break}if(!_)for(const[E,M]of c){const{handler:A,target:z}=M;if(!z&&A(new bs(t,E,M,null))!==!1)break}}}function di(u,t){if(Array.isArray(u)&&Array.isArray(t)){const r=new Set(u),c=new Set(t);return r.size===c.size&&u.every(d=>c.has(d))}return s.bn(u,t)}const Xo={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,antialias:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0,collectResourceTiming:!1,testMode:!1,precompilePrograms:!0,scaleFactor:1,spriteFormat:"auto"},i4={showCompass:!0,showZoom:!0,visualizePitch:!1};class r4{constructor(t,r,c=!1){this._clickTolerance=10,this.element=r,this.mouseRotate=new Zn({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,c&&(this.mousePitch=new y0({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),s.aQ(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener("mousedown",this.mousedown),r.addEventListener("touchstart",this.touchstart,{passive:!1}),r.addEventListener("touchmove",this.touchmove),r.addEventListener("touchend",this.touchend),r.addEventListener("touchcancel",this.reset)}down(t,r){this.mouseRotate.mousedown(t,r),this.mousePitch&&this.mousePitch.mousedown(t,r),mi()}move(t,r){const c=this.map,d=this.mouseRotate.mousemoveWindow(t,r),f=d&&d.bearingDelta;if(f&&c.setBearing(c.getBearing()+f),this.mousePitch){const _=this.mousePitch.mousemoveWindow(t,r),T=_&&_.pitchDelta;T&&c.setPitch(c.getPitch()+T)}}off(){const t=this.element;t.removeEventListener("mousedown",this.mousedown),t.removeEventListener("touchstart",this.touchstart,{passive:!1}),t.removeEventListener("touchmove",this.touchmove),t.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){Nn(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup)}mousedown(t){this.down(s.l({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),dn(this.element,t)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)}mousemove(t){this.move(t,dn(this.element,t))}mouseup(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()}touchstart(t){t.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=zo(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>t.preventDefault()},this._startPos))}touchmove(t){t.targetTouches.length!==1?this.reset():(this._lastPos=zo(this.element,t.targetTouches)[0],this.move({preventDefault:()=>t.preventDefault()},this._lastPos))}touchend(t){t.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)r.width||t.y>r.height;r.locationPoint3D(c).distSqr(t)<_&&(T||Math.abs(c.lng-r.center.lng)180;){const c=r.locationPoint3D(u);if(c.x>=0&&c.y>=0&&c.x<=r.width&&c.y<=r.height)break;u.lng>r.center.lng?u.lng-=360:u.lng+=360}return u}const Wn={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%)"},wr={rotation:0,rotationAlignment:"auto",pitchAlignment:"auto",occludedOpacity:.2,altitude:0};class Tr extends s.E{constructor(t,r){super(),(t instanceof HTMLElement||r)&&(t=s.l({element:t},r)),s.aQ(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this);const{anchor:c="center",color:d="#3FB1CE",scale:f=1,draggable:_=!1,clickTolerance:T=0,rotation:E=wr.rotation,rotationAlignment:M=wr.rotationAlignment,pitchAlignment:A=wr.pitchAlignment,occludedOpacity:z=wr.occludedOpacity,altitude:C=wr.altitude}=t||{};this._anchor=c,this._color=d,this._scale=f,this._draggable=_,this._clickTolerance=T,this._rotation=E,this._rotationAlignment=M,this._pitchAlignment=A,this._occludedOpacity=z,this._altitude=C,this._state="inactive",this._isDragging=!1,this._updateMoving=()=>this._update(!0),t&&t.element?(this._element=t.element,this._offset=s.P.convert(t&&t.offset||[0,0])):(this._defaultMarker=!0,this._element=this._createDefaultMarker(),this._offset=s.P.convert(t&&t.offset||[0,-14])),this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.hasAttribute("role")||this._element.setAttribute("role","img"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",N=>{N.preventDefault()}),this._element.addEventListener("mousedown",N=>{N.preventDefault()});const k=this._element.classList;for(const N in Wn)k.remove(`mapboxgl-marker-anchor-${N}`);k.add(`mapboxgl-marker-anchor-${this._anchor}`);const j=t&&t.className?t.className.trim().split(/\s+/):[];k.add(...j),this._popup=null}_createDefaultMarker(){const t=ut("div"),r=oi("svg",{display:"block",height:41*this._scale+"px",width:27*this._scale+"px",viewBox:"0 0 27 41"},t);if(this._altitude===0){const c=oi("radialGradient",{id:"shadowGradient"},oi("defs",{},r));oi("stop",{offset:"10%","stop-opacity":.4},c),oi("stop",{offset:"100%","stop-opacity":.05},c),oi("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},r)}return oi("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},r),oi("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},r),oi("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},r),t}addTo(t){return t===this._map||(this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._updateMoving),t.on("moveend",this._update),t.on("remove",this._clearFadeTimer),t._addMarker(this),this.setDraggable(this._draggable),this._update(),t.on("click",this._onMapClick)),this}remove(){const t=this._map;return t&&(t.off("click",this._onMapClick),t.off("move",this._updateMoving),t.off("moveend",this._update),t.off("mousedown",this._addDragHandler),t.off("touchstart",this._addDragHandler),t.off("mouseup",this._onUp),t.off("touchend",this._onUp),t.off("mousemove",this._onMove),t.off("touchmove",this._onMove),t.off("remove",this._clearFadeTimer),t._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=s.bO.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}setAltitude(t){return t===this._altitude||(this._defaultMarker&&(this._altitude===0&&t!==0||this._altitude!==0&&t===0)&&(this._element=this._createDefaultMarker()),this._altitude=t||wr.altitude,this._update()),this}getAltitude(){return this._altitude}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const d=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[d,-1*(38.1-13.5+d)],"bottom-right":[-d,-1*(38.1-13.5+d)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,t._marker=this,t._altitude=this._altitude,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(t){const r=t.code,c=t.charCode||t.keyCode;r!=="Space"&&r!=="Enter"&&c!==32&&c!==13||this.togglePopup()}_onMapClick(t){const r=t.originalEvent.target,c=this._element;this._popup&&(r===c||c.contains(r))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?(t.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(t.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const t=this._map,r=this._pos;if(!t||!r)return!1;const c=t.unproject(r,this._altitude),d=t.getFreeCameraOptions();if(!d.position)return!1;const f=d.position.toLngLat();return f.distanceTo(c)<.9*f.distanceTo(this._lngLat)}_evaluateOpacity(){const t=this._map;if(!t)return;const r=this._pos;if(!r||r.x<0||r.x>t.transform.width||r.y<0||r.y>t.transform.height)return void this._clearFadeTimer();const c=t.unproject(r,this._altitude);let d;t._showingGlobe()&&s.dK(t.transform,this._lngLat)?d=0:(d=1-t._queryFogOpacity(c),t.transform._terrainEnabled()&&t.getTerrain()&&this._behindTerrain()&&(d*=this._occludedOpacity)),this._element.style.opacity=`${d}`,this._element.style.pointerEvents=d>0?"auto":"none",this._popup&&this._popup._setOpacity(d),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const t=this._pos;if(!t||!this._map)return;const r=this._offset.mult(this._scale);this._element.style.transform=` translate(${t.x}px,${t.y}px) ${Wn[this._anchor]} ${this._calculateXYTransform()} ${this._calculateZTransform()} translate(${r.x}px,${r.y}px) `}_calculateXYTransform(){const t=this._pos,r=this._map,c=this.getPitchAlignment();if(!r||!t||c!=="map")return"";if(!r._showingGlobe()){const E=r.getPitch();return E?`rotateX(${E}deg)`:""}const d=s.c4(s.dL(r.transform,this._lngLat)),f=t.sub(s.dM(r.transform)),_=Math.abs(f.x)+Math.abs(f.y);if(_===0)return"";const T=d/_;return`rotateX(${-f.y*T}deg) rotateY(${f.x*T}deg)`}_calculateZTransform(){const t=this._pos,r=this._map;if(!r||!t)return"";let c=0;const d=this.getRotationAlignment();if(d==="map")if(r._showingGlobe()){const f=r.project(new s.bO(this._lngLat.lng,this._lngLat.lat+.001),this._altitude),_=r.project(new s.bO(this._lngLat.lng,this._lngLat.lat-.001),this._altitude).sub(f);c=s.c4(Math.atan2(_.y,_.x))-90}else c=-r.getBearing();else if(d==="horizon"){const f=s.ae(4,6,r.getZoom()),_=s.dM(r.transform);_.y+=f*r.transform.height;const T=t.sub(_),E=s.c4(Math.atan2(T.y,T.x));c=(E>90?E-270:E+90)*(1-f)}return c+=this._rotation,c?`rotateZ(${c}deg)`:""}_update(t){cancelAnimationFrame(this._updateFrameId);const r=this._map;r&&(r.transform.renderWorldCopies&&(this._lngLat=Rl(this._lngLat,this._pos,r.transform)),this._pos=r.project(this._lngLat,this._altitude),t===!0?this._updateFrameId=requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),r._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(r._showingGlobe()||r.getTerrain()||r.getFog())&&!this._fadeTimer&&(this._fadeTimer=window.setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(t){return this._offset=s.P.convert(t),this._update(),this}addClassName(t){return this._element.classList.add(t),this}removeClassName(t){return this._element.classList.remove(t),this}toggleClassName(t){return this._element.classList.toggle(t)}_onMove(t){const r=this._map;if(!r)return;const c=this._pointerdownPos,d=this._positionDelta;if(c&&d){if(!this._isDragging){const f=this._clickTolerance||r._clickTolerance;if(t.point.dist(c)u.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(u.minPitch!=null&&u.maxPitch!=null&&u.minPitch>u.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(u.minPitch!=null&&u.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(u.maxPitch!=null&&u.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(u.antialias&&s.dI(window)&&(u.antialias=!1,s.w("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new H0(u.minZoom,u.maxZoom,u.minPitch,u.maxPitch,u.renderWorldCopies,null,null),u),this._repaint=!!u.repaint,this._interactive=u.interactive,this._minTileCacheSize=u.minTileCacheSize,this._maxTileCacheSize=u.maxTileCacheSize,this._failIfMajorPerformanceCaveat=u.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=u.preserveDrawingBuffer,this._antialias=u.antialias,this._trackResize=u.trackResize,this._bearingSnap=u.bearingSnap,this._refreshExpiredTiles=u.refreshExpiredTiles,this._fadeDuration=u.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=u.crossSourceCollisions,this._collectResourceTiming=u.collectResourceTiming,this._language=this._parseLanguage(u.language),this._worldview=u.worldview,this._renderTaskQueue=new ln,this._domRenderTaskQueue=new ln,this._controls=[],this._markers=[],this._popups=[],this._mapId=s.aW(),this._locale=s.l({},vs,u.locale),this._clickTolerance=u.clickTolerance,this._cooperativeGestures=u.cooperativeGestures,this._performanceMetricsCollection=u.performanceMetricsCollection,this._tessellationStep=u.tessellationStep,this._containerWidth=0,this._containerHeight=0,this._showParseStatus=!0,this._precompilePrograms=u.precompilePrograms,this._scaleFactorChanged=!1,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new ya(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._frameId=0,this._scaleFactor=u.scaleFactor,this._requestManager=new Es(u.transformRequest,u.accessToken,u.testMode),this._silenceAuthErrors=!!u.testMode,this._contextCreateOptions=u.contextCreateOptions?Object.assign({},u.contextCreateOptions):{},typeof u.container=="string"){const r=document.getElementById(u.container);if(!r)throw new Error(`Container '${u.container.toString()}' not found.`);this._container=r}else{if(!(u.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=u.container}if(this._container.childNodes.length>0&&s.w("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),u.maxBounds&&this.setMaxBounds(u.maxBounds),this._spriteFormat=u.spriteFormat,s.aQ(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._tp||(this._tp=new r1),this._tp.registerParameter(this,["Debug"],"showOverdrawInspector"),this._tp.registerParameter(this,["Debug"],"showTileBoundaries"),this._tp.registerParameter(this,["Debug"],"showParseStatus"),this._tp.registerParameter(this,["Debug"],"repaint"),this._tp.registerParameter(this,["Debug"],"showTileAABBs"),this._tp.registerParameter(this,["Debug"],"showPadding"),this._tp.registerParameter(this,["Debug"],"showCollisionBoxes",{noSave:!0}),this._tp.registerParameter(this.transform,["Debug"],"freezeTileCoverage",{noSave:!0},()=>{this._update()}),this._tp.registerParameter(this,["Debug","Wireframe"],"showTerrainWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers2DWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers3DWireframe"),this._tp.registerParameter(this,["Scaling"],"_scaleFactor",{min:.1,max:10,step:.1},()=>{this.setScaleFactor(this._scaleFactor)}),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");if(this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this._fullscreenchangeEvent="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",window.addEventListener("online",this._onWindowOnline,!1),window.addEventListener("resize",this._onWindowResize,!1),window.addEventListener("orientationchange",this._onWindowResize,!1),window.addEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.addEventListener("visibilitychange",this._onVisibilityChange,!1),this.handlers=new ou(this,u),this._localFontFamily=u.localFontFamily,this._localIdeographFontFamily=u.localIdeographFontFamily,(u.style||!u.testMode)&&this.setStyle(u.style||s.e.DEFAULT_STYLE,{config:u.config,localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),u.projection&&this.setProjection(u.projection),this.indoor=new vc(this),u.hash&&(this._hash=new l1(typeof u.hash=="string"&&u.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){t.center==null&&t.zoom==null||(this.transform._unmodified=!1),this.jumpTo({center:u.center,zoom:u.zoom,bearing:u.bearing,pitch:u.pitch});const r=u.bounds;r&&(this.resize(),this.fitBounds(r,s.l({},u.fitBoundsOptions,{duration:0})))}this.resize(),u.attributionControl&&this.addControl(new zl({customAttribution:u.customAttribution})),this._logoControl=new an,this.addControl(this._logoControl,u.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this._postStyleLoadEvent()}),this.on("data",r=>{this._update(r.dataType==="style"),this.fire(new s.A(`${r.dataType}data`,r))}),this.on("dataloading",r=>{this.fire(new s.A(`${r.dataType}dataloading`,r))}),this._interactions=new m1(this)}_getMapId(){return this._mapId}addControl(u,t){if(t===void 0&&(t=u.getDefaultPosition?u.getDefaultPosition():"top-right"),!u||!u.onAdd)return this.fire(new s.z(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const r=u.onAdd(this);this._controls.push(u);const c=this._controlPositions[t];return t.indexOf("bottom")!==-1?c.insertBefore(r,c.firstChild):c.appendChild(r),this}removeControl(u){if(!u||!u.onRemove)return this.fire(new s.z(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(u);return t>-1&&this._controls.splice(t,1),u.onRemove(this),this}hasControl(u){return this._controls.indexOf(u)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(u){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const t=!this._moving;return t&&this.fire(new s.A("movestart",u)).fire(new s.A("move",u)),this.fire(new s.A("resize",u)),t&&this.fire(new s.A("moveend",u)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(u){return this.transform.setMaxBounds(s.aB.convert(u)),this._update()}setMinZoom(u){if((u=u??-2)>=-2&&u<=this.transform.maxZoom)return this.transform.minZoom=u,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=u,this._update(),this.getZoom()>u?this.setZoom(u):this.fire(new s.A("zoomstart")).fire(new s.A("zoom")).fire(new s.A("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(u){if((u=u??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(u>=0&&u<=this.transform.maxPitch)return this.transform.minPitch=u,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(u>=this.transform.minPitch)return this.transform.maxPitch=u,this._update(),this.getPitch()>u?this.setPitch(u):this.fire(new s.A("pitchstart")).fire(new s.A("pitch")).fire(new s.A("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getScaleFactor(){return this._scaleFactor}setScaleFactor(u){return this._scaleFactor=u,this.painter.scaleFactor=u,this._tp.refreshUI(),this._scaleFactorChanged=!0,this.style._updateFilteredLayers(t=>t.type==="symbol"),this._update(!0),this}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(u){return this.transform.renderWorldCopies=u,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(u){return u==="auto"?navigator.language:Array.isArray(u)?u.length===0?void 0:u.map(t=>t==="auto"?navigator.language:t):u}setLanguage(u){const t=this._parseLanguage(u);if(!this.style||t===this._language)return this;this._language=t,this.style.reloadSources();for(const r of this._controls)r._setLanguage&&r._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(u){return this.style&&u!==this._worldview?(this._worldview=u,this.style.reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(u){return this._lazyInitEmptyStyle(),u?typeof u=="string"&&(u={name:u}):u=null,this._useExplicitProjection=!!u,this._prioritizeAndUpdateProjection(u,this.style.projection)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const u=this.transform,t=u.projection.name;let r;t==="globe"&&u.zoom>=s.bY?(u.setMercatorFromTransition(),r=!0):t==="mercator"&&u.zoom=s.bY?this.transform.setMercatorFromTransition():this.transform.setProjection(u),this.style.applyProjectionUpdate(),t&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(!0),this._forceMarkerAndPopupUpdate(!0)),this}project(u,t){return this.transform.locationPoint3D(s.bO.convert(u),t)}unproject(u,t){return this.transform.pointLocation3D(s.P.convert(u),t)}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(u,t,r){const c=d=>{let f=[];if(Array.isArray(t)){const _=t.filter(T=>this.getLayer(T));f=_.length?this.queryRenderedFeatures(d,{layers:_}):[]}else f=this.queryRenderedFeatures(d,{target:t});return f};if(u==="mouseenter"||u==="mouseover"){let d=!1;return{listener:r,targets:t,delegates:{mousemove:_=>{const T=c(_.point);T.length?d||(d=!0,r.call(this,new Xr(u,this,_.originalEvent,{features:T}))):d=!1},mouseout:()=>{d=!1}}}}if(u==="mouseleave"||u==="mouseout"){let d=!1;return{listener:r,targets:t,delegates:{mousemove:T=>{c(T.point).length?d=!0:d&&(d=!1,r.call(this,new Xr(u,this,T.originalEvent)))},mouseout:T=>{d&&(d=!1,r.call(this,new Xr(u,this,T.originalEvent)))}}}}{const d=f=>{const _=c(f.point);_.length&&(f.features=_,r.call(this,f),delete f.features)};return{listener:r,targets:t,delegates:{[u]:d}}}}on(u,t,r){if(typeof t=="function"||r===void 0)return super.on(u,t);if(typeof t=="string"&&(t=[t]),!this._areTargetsValid(t))return this;const c=this._createDelegatedListener(u,t,r);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[u]=this._delegatedListeners[u]||[],this._delegatedListeners[u].push(c);for(const d in c.delegates)this.on(d,c.delegates[d]);return this}once(u,t,r){if(typeof t=="function"||r===void 0)return super.once(u,t);if(typeof t=="string"&&(t=[t]),!this._areTargetsValid(t))return this;const c=this._createDelegatedListener(u,t,r);for(const d in c.delegates)this.once(d,c.delegates[d]);return this}off(u,t,r){if(typeof t=="function"||r===void 0)return super.off(u,t);if(typeof t=="string"&&(t=[t]),!this._areTargetsValid(t))return this;const c=this._delegatedListeners?this._delegatedListeners[u]:void 0;return c&&(d=>{for(let f=0;f{r?(s.w(`Unable to perform style diff: ${String(r.message||r.error||r)}. Rebuilding the style from scratch.`),this._updateStyle(u,t)):c&&this._update(!0)},()=>{this._postStyleLoadEvent()}),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._localFontFamily=t.localFontFamily,this._updateStyle(u,t))}_getUIString(u){const t=this._locale[u];if(t==null)throw new Error(`Missing UI string '${u}'`);return t}_updateStyle(u,t){if(this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),u){const r=s.l({},t);t&&t.config&&(r.initialConfig=t.config,delete r.config),this.style=new Dn(this,r).load(u),this.style.setEventedParent(this,{style:this.style})}return this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new Dn(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(s.w("There is no style added to the map."),!1)}_isValidId(u){return u==null?(this.fire(new s.z(new Error("IDs can't be empty."))),!1):!s.cs(u)||(this.fire(new s.z(new Error(`IDs can't contain special symbols: "${u}".`))),!1)}_isTargetValid(u){return"featuresetId"in u?this._isValidId("importId"in u?u.importId:u.featuresetId):"layerId"in u&&this._isValidId(u.layerId)}_areTargetsValid(u){if(Array.isArray(u)){for(const t of u)if(!this._isValidId(t))return!1;return!0}return this._isTargetValid(u)}addSource(u,t){return this._isValidId(u)?(this._lazyInitEmptyStyle(),this.style.addSource(u,t),this._update(!0)):this}isSourceLoaded(u){return!!this._isValidId(u)&&!!this.style&&this.style._isSourceCacheLoaded(u)}areTilesLoaded(){return this.style.areTilesLoaded()}addSourceType(u,t,r){this._lazyInitEmptyStyle(),this.style.addSourceType(u,t,r)}removeSource(u){return this._isValidId(u)?(this.style.removeSource(u),this._updateTerrain(),this._update(!0)):this}getSource(u){return this._isValidId(u)?this.style.getOwnSource(u):null}addImage(u,t,{pixelRatio:r=1,sdf:c=!1,stretchX:d,stretchY:f,content:_}={}){this._lazyInitEmptyStyle();const T=s.I.from(u);if(t instanceof HTMLImageElement||ImageBitmap&&t instanceof ImageBitmap){const{width:E,height:M,data:A}=s.q.getImageData(t);this.style.addImage(T,this.style.scope,{data:new s.r({width:E,height:M},A),pixelRatio:r,stretchX:d,stretchY:f,content:_,sdf:c,version:0,usvg:!1})}else if(t.width===void 0||t.height===void 0)this.fire(new s.z(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`")));else{const{width:E,height:M}=t,A=t;this.style.addImage(T,this.style.scope,{data:new s.r({width:E,height:M},new Uint8Array(A.data)),pixelRatio:r,stretchX:d,stretchY:f,content:_,sdf:c,usvg:!1,version:0,userImage:A}),A.onAdd&&A.onAdd(this,u)}}updateImage(u,t){this._lazyInitEmptyStyle();const r=s.I.from(u),c=this.style.getImage(r,this.style.scope);if(!c)return void this.fire(new s.z(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const d=t instanceof HTMLImageElement||ImageBitmap&&t instanceof ImageBitmap?s.q.getImageData(t):t,{width:f,height:_,data:T}=d;if(f===void 0||_===void 0)return void this.fire(new s.z(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(f!==(c.usvg?c.icon.usvg_tree.width:c.data.width)||_!==(c.usvg?c.icon.usvg_tree.height:c.data.height))return void this.fire(new s.z(new Error(`The width and height of the updated image (${f}, ${_}) must be that same as the previous version of the image (${c.data.width}, ${c.data.height})`)));const E=!(t instanceof HTMLImageElement||ImageBitmap&&t instanceof ImageBitmap);let M=!1;c.usvg?(c.data=new s.r({width:f,height:_},new Uint8Array(T)),c.usvg=!1,c.icon=void 0,M=!0):c.data.replace(T,E),this.style.updateImage(r,this.style.scope,c,M)}hasImage(u){return u?!!this.style&&!!this.style.getImage(s.I.from(u),this.style.scope):(this.fire(new s.z(new Error("Missing required image id"))),!1)}removeImage(u){this.style.removeImage(s.I.from(u),this.style.scope)}loadImage(u,t){s.o(this._requestManager.transformRequest(u,s.R.Image),(r,c)=>{t(r,c instanceof HTMLImageElement?s.q.getImageData(c):c)})}listImages(){return this.style.listImages().map(u=>u.name)}addModel(u,t){this._lazyInitEmptyStyle(),this.style.addModel(u,t)}hasModel(u){return u?this.style.hasModel(u):(this.fire(new s.z(new Error("Missing required model id"))),!1)}removeModel(u){this.style.removeModel(u)}listModels(){return this.style.listModels()}addLayer(u,t){return this._isValidId(u.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(u,t),this._update(!0)):this}getSlot(u){const t=this.getLayer(u);return t&&t.slot||null}setSlot(u,t){return this.style.setSlot(u,t),this.style.mergeLayers(),this._update(!0)}addImport(u,t){return this.style.addImport(u,t),this}updateImport(u,t){return typeof t!="string"&&t.id!==u?(this.removeImport(u),this.addImport(t)):(this.style.updateImport(u,t),this._update(!0))}removeImport(u){return this.style.removeImport(u),this}moveImport(u,t){return this.style.moveImport(u,t),this._update(!0)}moveLayer(u,t){return this._isValidId(u)?(this.style.moveLayer(u,t),this._update(!0)):this}removeLayer(u){return this._isValidId(u)?(this.style.removeLayer(u),this._update(!0)):this}getLayer(u){if(!this._isValidId(u))return null;const t=this.style.getOwnLayer(u);return t?t.type==="custom"?t.implementation:t.serialize():void 0}getSlots(){return this.style.getSlots()}setLayerZoomRange(u,t,r){return this._isValidId(u)?(this.style.setLayerZoomRange(u,t,r),this._update(!0)):this}setFilter(u,t,r={}){return this._isValidId(u)?(this.style.setFilter(u,t,r),this._update(!0)):this}getFilter(u){return this._isValidId(u)?this.style.getFilter(u):null}setPaintProperty(u,t,r,c={}){return this._isValidId(u)?(this.style.setPaintProperty(u,t,r,c),this._update(!0)):this}getPaintProperty(u,t){return this._isValidId(u)?this.style.getPaintProperty(u,t):null}setLayoutProperty(u,t,r,c={}){return this._isValidId(u)?(this.style.setLayoutProperty(u,t,r,c),this._update(!0)):this}getLayoutProperty(u,t){return this._isValidId(u)?this.style.getLayoutProperty(u,t):null}getGlyphsUrl(){return this.style.getGlyphsUrl()}setGlyphsUrl(u){return this.style.setGlyphsUrl(u),this._update(!0)}getSchema(u){return this.style.getSchema(u)}setSchema(u,t){return this.style.setSchema(u,t),this._update(!0)}getConfig(u){return this.style.getConfig(u)}setConfig(u,t){return this.style.setConfig(u,t),this._update(!0)}getConfigProperty(u,t){return this.style.getConfigProperty(u,t)}setConfigProperty(u,t,r){return this.style.setConfigProperty(u,t,r),this._update(!0)}getFeaturesetDescriptors(u){return this.style.getFeaturesetDescriptors(u)}setLights(u){if(this._lazyInitEmptyStyle(),u&&u.length===1&&u[0].type==="flat"){const t=u[0];t.properties?this.style.setFlatLight(t.properties,t.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(u),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){const u=this.style.getLights()||[];return u.length===0&&u.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),u}setLight(u,t={}){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:u}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(u){return this._lazyInitEmptyStyle(),!u&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(u),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(u){return this._lazyInitEmptyStyle(),this.style.setFog(u),this._update(!0)}getFog(){return this.style?this.style.getFog():null}setSnow(u){return this._lazyInitEmptyStyle(),this.style.setSnow(u),this._update(!0)}getSnow(){return this.style?this.style.getSnow():null}setRain(u){return this._lazyInitEmptyStyle(),this.style.setRain(u),this._update(!0)}getRain(){return this.style?this.style.getRain():null}setColorTheme(u){return this._lazyInitEmptyStyle(),this.style.setColorTheme(u),this._update(!0)}setImportColorTheme(u,t){return this._lazyInitEmptyStyle(),this.style.setImportColorTheme(u,t),this._update(!0)}setCamera(u){return this.style.setCamera(u),this._triggerCameraUpdate(u)}_triggerCameraUpdate(u){return this._update(this.transform.setOrthographicProjectionAtLowPitch(u["camera-projection"]==="orthographic"))}getCamera(){return this.style.camera}_queryFogOpacity(u){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(s.bO.convert(u),this.transform):0}setFeatureState(u,t){return u.source&&!this._isValidId(u.source)?this:(this.style.setFeatureState(u,t),this._update())}removeFeatureState(u,t){return u.source&&!this._isValidId(u.source)?this:(this.style.removeFeatureState(u,t),this._update())}getFeatureState(u){return u.source&&!this._isValidId(u.source)?null:this.style.getFeatureState(u)}_updateContainerDimensions(){if(!this._container)return;const u=this._container.getBoundingClientRect().width||400,t=this._container.getBoundingClientRect().height||300;let r,c,d,f=this._container;for(;f&&(!c||!d);){const _=window.getComputedStyle(f).transform;_&&_!=="none"&&(r=_.match(/matrix.*\((.+)\)/)[1].split(", "),r[0]&&r[0]!=="0"&&r[0]!=="1"&&(c=r[0]),r[3]&&r[3]!=="0"&&r[3]!=="1"&&(d=r[3])),f=f.parentElement}this._containerWidth=c?Math.abs(u/c):u,this._containerHeight=d?Math.abs(t/d):t}_detectMissingCSS(){window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&s.w("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const u=this._container;u.classList.add("mapboxgl-map"),(this._missingCSSCanary=ut("div","mapboxgl-canary",u)).style.visibility="hidden",this._detectMissingCSS();const t=this._canvasContainer=ut("div","mapboxgl-canvas-container",u);this._canvas=ut("canvas","mapboxgl-canvas",t),this._interactive&&(t.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const r=this._controlContainer=ut("div","mapboxgl-control-container",u),c=this._controlPositions={};["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].forEach(d=>{c[d]=ut("div",`mapboxgl-ctrl-${d}`,r)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(u,t){const r=s.q.devicePixelRatio||1;this._canvas.width=r*Math.ceil(u),this._canvas.height=r*Math.ceil(t),this._canvas.style.width=`${u}px`,this._canvas.style.height=`${t}px`}_addMarker(u){this._markers.push(u)}_removeMarker(u){const t=this._markers.indexOf(u);t!==-1&&this._markers.splice(t,1)}_addPopup(u){this._popups.push(u)}_removePopup(u){const t=this._popups.indexOf(u);t!==-1&&this._popups.splice(t,1)}_setupPainter(){const u=s.l({},yt.supported.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),t=this._canvas.getContext("webgl2",u);t?(Do(t,!0),this.painter=new Al(t,this._contextCreateOptions,this.transform,this._scaleFactor,this._tp),this.on("data",r=>{r.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),s.m.testSupport(t)):this.fire(new s.z(new Error("Failed to initialize WebGL")))}_contextLost(u){u.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new s.A("webglcontextlost",{originalEvent:u}))}_contextRestored(u){this._setupPainter(),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight)),this._updateTerrain(),this.style.reloadModels(),this.style.clearSources(),this._update(),this.fire(new s.A("webglcontextrestored",{originalEvent:u}))}_onMapScroll(u){if(u.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}idle(){return!this.isMoving()&&this.loaded()}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}frameReady(){return this.loaded()&&!this._placementDirty}_update(u){return this.style?(this._styleDirty=this._styleDirty||u,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(u){return this._update(),this._renderTaskQueue.add(u)}_cancelRenderFrame(u){this._renderTaskQueue.remove(u)}_requestDomTask(u){!this.loaded()||this.loaded()&&!this.isMoving()?u():this._domRenderTaskQueue.add(u)}_render(u){let t;this.fire(new s.A("renderstart")),++this._frameId;const r=this.painter.context.extTimerQuery,c=s.q.now(),d=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(t=d.createQuery(),d.beginQuery(r.TIME_ELAPSED_EXT,t)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(u),this._domRenderTaskQueue.run(u),this._removed)return;this._updateProjectionTransition();const f=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const M=this.transform.zoom,A=this.transform.pitch,z=s.q.now(),C=new s.aa(M,{now:z,fadeDuration:f,pitch:A,transition:this.style.transition});this.style.update(C)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let _=!1;this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),_=this._updateAverageElevation(c),this.style.updateSources(this.transform),this.style.updateImageProviders(),this.isMoving()||this._forceMarkerAndPopupUpdate()):_=this._updateAverageElevation(c);const T=this.style&&this.style._updatePlacement(this.painter,this.painter.transform,this.showCollisionBoxes,f,this._crossSourceCollisions,this.painter.replacementSource,this._scaleFactorChanged);if(this._scaleFactorChanged&&(this._scaleFactorChanged=!1),T&&(this._placementDirty=T.needsRerender),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showParseStatus:this.showParseStatus,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:f,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new s.A("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,dt.mark(nt.load),this.fire(new s.A("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&(this.style.snow||this.style.rain)&&(this._styleDirty=!0),this.style&&this.style.imageManager.hasPatternsInFlight()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),t){const M=s.q.now()-c;d.endQuery(r.TIME_ELAPSED_EXT),setTimeout(()=>{const A=d.getQueryParameter(t,d.QUERY_RESULT)/1e6;d.deleteQuery(t),this.fire(new s.A("gpu-timing-frame",{cpuTime:M,gpuTime:A}))},50)}if(this.listens("gpu-timing-layer")){const M=this.painter.collectGpuTimers();setTimeout(()=>{const A=this.painter.queryGpuTimers(M);this.fire(new s.A("gpu-timing-layer",{layerTimes:A}))},50)}if(this.listens("gpu-timing-deferred-render")){const M=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const A=this.painter.queryGpuTimeDeferredRender(M);this.fire(new s.A("gpu-timing-deferred-render",{gpuTime:A}))},50)}const E=this._sourcesDirty||this._styleDirty||this._placementDirty||_;if(E||this._repaint)this.triggerRepaint();else{const M=this.idle();if(M&&(_=this._updateAverageElevation(c,!0)),_)this.triggerRepaint();else if(this._triggerFrame(!1),M&&(this.fire(new s.A("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const A=this._calculateSpeedIndex();this.fire(new s.A("speedindexcompleted",{speedIndex:A})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||E||(this._fullyLoaded=!0,dt.mark(nt.fullLoad),this._performanceMetricsCollection&&Ps(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(u){for(const t of this._markers)u&&!this.getRenderWorldCopies()&&(t._lngLat=t._lngLat.wrap()),t._update();for(const t of this._popups)!u||this.getRenderWorldCopies()||t._trackPointer||(t._lngLat=t._lngLat.wrap()),t._update()}_updateAverageElevation(u,t=!1){const r=d=>(this.transform.averageElevation=d,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&r(0);const c=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(c||(t||u-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(u)){const d=this.transform.averageElevation;let f=this.transform.sampleAverageElevation();this.transform.elevation!=null&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(f)?f=0:this._averageElevationLastSampledAt=u;const _=Math.abs(d-f);if(_>1){if(this._isInitialLoad||c)return this._averageElevation.jumpTo(f),r(f);this._averageElevation.easeTo(f,u,300)}else if(_>1e-4)return this._averageElevation.jumpTo(f),r(f)}return!!this._averageElevation.isEasing(u)&&r(this._averageElevation.getValue(u))}_authenticate(){Q(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,u=>{if(u&&(u.message===ts||u.status===401)){const t=this.painter.context.gl;Do(t,!1),this._logoControl instanceof an&&this._logoControl._updateLogo(),t&&t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new s.z(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),k0(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_postStyleLoadEvent(){this.style.globalId&&fn(this._requestManager._customAccessToken,{map:this,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()})}_updateTerrain(){const u=this._isDragging();this.painter.updateTerrain(this.style,u)}_calculateSpeedIndex(){const u=this.painter.canvasCopy(),t=this.painter.getCanvasCopiesAndTimestamps();t.timeStamps.push(performance.now());const r=this.painter.context.gl,c=r.createFramebuffer();function d(f){r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,f,0);const _=new Uint8Array(r.drawingBufferWidth*r.drawingBufferHeight*4);return r.readPixels(0,0,r.drawingBufferWidth,r.drawingBufferHeight,r.RGBA,r.UNSIGNED_BYTE,_),_}return r.bindFramebuffer(r.FRAMEBUFFER,c),this._canvasPixelComparison(d(u),t.canvasCopies.map(d),t.timeStamps)}_canvasPixelComparison(u,t,r){let c=r[1]-r[0];const d=u.length/4;for(let f=0;f{const r=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,r&&this._render(t)}))}_preloadTiles(u){const t=this.style?this.style.getSourceCaches():[];return s.bl(t,(r,c)=>r._preloadTiles(u,c),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(u){this._trackResize&&this.resize({originalEvent:u})._update()}_onVisibilityChange(){document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(u){this._showTileBoundaries!==u&&(this._showTileBoundaries=u,this._tp.refreshUI(),this._update())}get showParseStatus(){return!!this._showParseStatus}set showParseStatus(u){this._showParseStatus!==u&&(this._showParseStatus=u,this._tp.refreshUI(),this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(u){this._showTerrainWireframe!==u&&(this._showTerrainWireframe=u,this._tp.refreshUI(),this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(u){this._showLayers2DWireframe!==u&&(this._showLayers2DWireframe=u,this._tp.refreshUI(),this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(u){this._showLayers3DWireframe!==u&&(this._showLayers3DWireframe=u,this._tp.refreshUI(),this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(u){this._speedIndexTiming!==u&&(this._speedIndexTiming=u,this._update())}get showPadding(){return!!this._showPadding}set showPadding(u){this._showPadding!==u&&(this._showPadding=u,this._tp.refreshUI(),this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(u){this._showCollisionBoxes!==u&&(this._showCollisionBoxes=u,this._tp.refreshUI(),u?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(u){this._showOverdrawInspector!==u&&(this._showOverdrawInspector=u,this._tp.refreshUI(),this._update())}get repaint(){return!!this._repaint}set repaint(u){this._repaint!==u&&(this._repaint=u,this._tp.refreshUI(),this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(u){this._vertices=u,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(u){this._showTileAABBs!==u&&(this._showTileAABBs=u,this._tp.refreshUI(),u&&this._update())}_setCacheLimits(u,t){s.dJ(u,t)}get version(){return gt}},NavigationControl:class{constructor(u={}){this.options=s.l({},i4,u),this._container=ut("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(s.aQ(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",t=>{this._map&&this._map.zoomIn({},{originalEvent:t})}),ut("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",t=>{this._map&&this._map.zoomOut({},{originalEvent:t})}),ut("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(s.aQ(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",t=>{const r=this._map;r&&(this.options.visualizePitch?r.resetNorthPitch({},{originalEvent:t}):r.resetNorth({},{originalEvent:t}))}),this._compassIcon=ut("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const u=this._map;if(!u)return;const t=u.getZoom(),r=t===u.getMaxZoom(),c=t===u.getMinZoom();this._zoomInButton.disabled=r,this._zoomOutButton.disabled=c,this._zoomInButton.setAttribute("aria-disabled",r.toString()),this._zoomOutButton.setAttribute("aria-disabled",c.toString())}_rotateCompassArrow(){const u=this._map;if(!u)return;const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(u.transform.pitch*(Math.PI/180)),.5)}) rotateX(${u.transform.pitch}deg) rotateZ(${u.transform.angle*(180/Math.PI)}deg)`:`rotate(${u.transform.angle*(180/Math.PI)}deg)`;u._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=t)})}onAdd(u){return this._map=u,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),u.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&u.on("pitch",this._rotateCompassArrow),u.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new r4(u,this._compass,this.options.visualizePitch)),this._container}onRemove(){const u=this._map;u&&(this._container.remove(),this.options.showZoom&&u.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&u.off("pitch",this._rotateCompassArrow),u.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(u,t){const r=ut("button",u,this._container);return r.type="button",r.addEventListener("click",t),r}_setButtonTitle(u,t){if(!this._map)return;const r=this._map._getUIString(`NavigationControl.${t}`);u.setAttribute("aria-label",r),u.firstElementChild&&u.firstElementChild.setAttribute("title",r)}},GeolocateControl:class extends s.E{constructor(u={}){super();const t=navigator.geolocation;this.options=s.l({geolocation:t},Yr,u),s.aQ(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Il(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(u){return this._map=u,this._container=ut("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(u){const t=(r=!!this.options.geolocation)=>{this._supportsGeolocation=r,u(r)};this._supportsGeolocation!==void 0?u(this._supportsGeolocation):navigator.permissions!==void 0?navigator.permissions.query({name:"geolocation"}).then(r=>t(r.state!=="denied")).catch(()=>t()):t()}_isOutOfMapMaxBounds(u){const t=this._map.getMaxBounds(),r=u.coords;return!!t&&(r.longitudet.getEast()||r.latitudet.getNorth())}_setErrorState(){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")}}_onSuccess(u){if(this._map){if(this._isOutOfMapMaxBounds(u))return this._setErrorState(),this.fire(new s.A("outofmaxbounds",u)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=u,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(u),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(u),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new s.A("geolocate",u)),this._finish()}}_updateCamera(u){const t=new s.bO(u.coords.longitude,u.coords.latitude),r=u.coords.accuracy,c=this._map.getBearing(),d=s.l({bearing:c},this.options.fitBoundsOptions);this._map.fitBounds(t.toBounds(r),d,{geolocateSource:!0})}_updateMarker(u){if(u){const t=new s.bO(u.coords.longitude,u.coords.latitude);this._accuracyCircleMarker.setLngLat(t).addTo(this._map),this._userLocationDotMarker.setLngLat(t).addTo(this._map),this._accuracy=u.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const u=this._map.transform,t=s.bH(1,u._center.lat)*u.worldSize,r=Math.ceil(2*this._accuracy*t);this._circleElement.style.width=`${r}px`,this._circleElement.style.height=`${r}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(u){if(this._map){if(this.options.trackUserLocation)if(u.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;const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(u.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new s.A("error",u)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(u){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=ut("button","mapboxgl-ctrl-geolocate",this._container),ut("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",u===!1){s.w("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=ut("div","mapboxgl-user-location"),this._dotElement.appendChild(ut("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(ut("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Tr({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=ut("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Tr({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",t=>{t.geolocateSource||this._watchState!=="ACTIVE_LOCK"||t.originalEvent&&t.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new s.A("trackuserlocationend")))})}}_onDeviceOrientation(u){this._userLocationDotMarker&&(u.webkitCompassHeading?this._heading=u.webkitCompassHeading:u.absolute===!0&&(this._heading=-1*u.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return s.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 s.A("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!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 s.A("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 s.A("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){let u;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(u={maximumAge:6e5,timeout:0},this._noTimeout=!0):(u=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,u),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=window.setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const u=()=>{"ondeviceorientationabsolute"in window?window.addEventListener("deviceorientationabsolute",this._onDeviceOrientation):window.addEventListener("deviceorientation",this._onDeviceOrientation)};typeof DeviceMotionEvent<"u"&&typeof DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(t=>{t==="granted"&&u()}).catch(console.error):u()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),window.removeEventListener("deviceorientation",this._onDeviceOrientation),window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:zl,ScaleControl:class{constructor(u={}){this.options=s.l({},gr,u),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),s.aQ(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const u=this.options.maxWidth||100,t=this._map,r=t._containerHeight/2,c=t._containerWidth/2-u/2,d=t.unproject([c,r]),f=t.unproject([c+u,r]),_=d.distanceTo(f);if(this.options.unit==="imperial"){const T=3.2808*_;T>5280?this._setScale(u,T/5280,"mile"):this._setScale(u,T,"foot")}else this.options.unit==="nautical"?this._setScale(u,_/1852,"nautical-mile"):_>=1e3?this._setScale(u,_/1e3,"kilometer"):this._setScale(u,_,"meter")}_setScale(u,t,r){this._map._requestDomTask(()=>{const c=function(f){const _=Math.pow(10,`${Math.floor(f)}`.length-1);let T=f/_;return T=T>=10?10:T>=5?5:T>=3?3:T>=2?2:T>=1?1:function(E){const M=Math.pow(10,Math.ceil(-Math.log(E)/Math.LN10));return Math.round(E*M)/M}(T),_*T}(t),d=c/t;this._container.innerHTML=this._isNumberFormatSupported&&r!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:r}).format(c):`${c} ${_1[r]}`,this._container.style.width=u*d+"px"})}onAdd(u){return this._map=u,this._language=u.getLanguage(),this._container=ut("div","mapboxgl-ctrl mapboxgl-ctrl-scale",u.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(u){this._language=u,this._update()}setUnit(u){this.options.unit=u,this._update()}},FullscreenControl:class{constructor(u={}){this._fullscreen=!1,u&&u.container&&(u.container instanceof HTMLElement?this._container=u.container:s.w("Full screen control 'container' must be a DOM element.")),s.aQ(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(u){return this._map=u,this._container||(this._container=this._map.getContainer()),this._controlContainer=ut("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",s.w("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}_setupUI(){const u=this._fullscreenButton=ut("button","mapboxgl-ctrl-fullscreen",this._controlContainer);ut("span","mapboxgl-ctrl-icon",u).setAttribute("aria-hidden","true"),u.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const u=this._getTitle();this._fullscreenButton.setAttribute("aria-label",u),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",u)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(document.fullscreenElement||document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends s.E{constructor(u){super(),this.options=s.l(Object.create(Yi),u),this._altitude=this.options.altitude,s.aQ(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(u&&u.className?u.className.trim().split(/\s+/):[])}addTo(u){return this._map&&this.remove(),this._map=u,this.options.closeOnClick&&u.on("preclick",this._onClose),this.options.closeOnMove&&u.on("move",this._onClose),u.on("remove",this.remove),this._update(),u._addPopup(this),this._focusFirstElement(),this._trackPointer?(u.on("mousemove",this._onMouseEvent),u.on("mouseup",this._onMouseEvent),u._canvasContainer.classList.add("mapboxgl-track-pointer")):u.on("move",this._update),this.fire(new s.A("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const u=this._map;return u&&(u.off("move",this._update),u.off("move",this._onClose),u.off("preclick",this._onClose),u.off("click",this._onClose),u.off("remove",this.remove),u.off("mousemove",this._onMouseEvent),u.off("mouseup",this._onMouseEvent),u.off("drag",this._onMouseEvent),u._canvasContainer&&u._canvasContainer.classList.remove("mapboxgl-track-pointer"),u._removePopup(this),this._map=void 0),this.fire(new s.A("close")),this}getLngLat(){return this._lngLat}setLngLat(u){this._lngLat=s.bO.convert(u),this._pos=null,this._trackPointer=!1,this._update();const t=this._map;return t&&(t.on("move",this._update),t.off("mousemove",this._onMouseEvent),t._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}getAltitude(){return this._altitude}setAltitude(u){return this._altitude=u,this._update(),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const u=this._map;return u&&(u.off("move",this._update),u.on("mousemove",this._onMouseEvent),u.on("drag",this._onMouseEvent),u._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(u){return this.setDOMContent(document.createTextNode(u))}setHTML(u){const t=document.createDocumentFragment(),r=document.createElement("body");let c;for(r.innerHTML=u;c=r.firstChild,c;)t.appendChild(c);return this.setDOMContent(t)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(u){return this.options.maxWidth=u,this._update(),this}setDOMContent(u){let t=this._content;if(t)for(;t.hasChildNodes();)t.firstChild&&t.removeChild(t.firstChild);else t=this._content=ut("div","mapboxgl-popup-content",this._container||void 0);if(t.appendChild(u),this.options.closeButton){const r=this._closeButton=ut("button","mapboxgl-popup-close-button",t);r.type="button",r.setAttribute("aria-label","Close popup"),r.innerHTML='',r.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(u){return this._classList.add(u),this._updateClassList(),this}removeClassName(u){return this._classList.delete(u),this._updateClassList(),this}setOffset(u){return this.options.offset=u,this._update(),this}toggleClassName(u){let t;return this._classList.delete(u)?t=!1:(this._classList.add(u),t=!0),this._updateClassList(),t}_onMouseEvent(u){this._update(u.point)}_getAnchor(u){if(this.options.anchor)return this.options.anchor;const t=this._map,r=this._container,c=this._pos;if(!t||!r||!c)return"bottom";const d=r.offsetWidth,f=r.offsetHeight,_=c.xt.transform.width-d/2;if(c.y+ut.transform.height-f){if(_)return"bottom-left";if(T)return"bottom-right"}return _?"left":T?"right":"bottom"}_updateClassList(){const u=this._container;if(!u)return;const t=[...this._classList];t.push("mapboxgl-popup"),this._anchor&&t.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&t.push("mapboxgl-popup-track-pointer"),u.className=t.join(" ")}_update(u){const t=this._map,r=this._content;if(!t||!this._lngLat&&!this._trackPointer||!r)return;let c=this._container;if(c||(c=this._container=ut("div","mapboxgl-popup",t.getContainer()),this._tip=ut("div","mapboxgl-popup-tip",c),c.appendChild(r)),this.options.maxWidth&&c.style.maxWidth!==this.options.maxWidth&&(c.style.maxWidth=this.options.maxWidth),t.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Rl(this._lngLat,this._pos,t.transform)),!this._trackPointer||u){const d=this._pos=this._trackPointer&&u instanceof s.P?u:t.project(this._lngLat,this._altitude),f=Yo(this.options.offset),_=this._anchor=this._getAnchor(f.y),T=Yo(this.options.offset,_),E=d.add(T).round();t._requestDomTask(()=>{this._container&&_&&(this._container.style.transform=`${Wn[_]} translate(${E.x}px,${E.y}px)`)})}if(!this._marker&&t._showingGlobe()){const d=s.dK(t.transform,this._lngLat)?0:1;this._setOpacity(d)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const u=this._container.querySelector(au);u&&u.focus()}_onClose(){this.remove()}_setOpacity(u){this._container&&(this._container.style.opacity=`${u}`),this._content&&(this._content.style.pointerEvents=u?"auto":"none")}},Marker:Tr,Style:Dn,LngLat:s.bO,LngLatBounds:s.aB,Point:s.P,MercatorCoordinate:s.ac,FreeCameraOptions:d3,Evented:s.E,config:s.e,prewarm:s.dP,clearPrewarmedResources:s.dQ,get accessToken(){return s.e.ACCESS_TOKEN},set accessToken(u){s.e.ACCESS_TOKEN=u},get baseApiUrl(){return s.e.API_URL},set baseApiUrl(u){s.e.API_URL=u},get workerCount(){return s.dR.workerCount},set workerCount(u){s.dR.workerCount=u},get maxParallelImageRequests(){return s.e.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(u){s.e.MAX_PARALLEL_IMAGE_REQUESTS=u},clearStorage(u){s.dS(u)},get workerUrl(){return s.dT.workerUrl},set workerUrl(u){s.dT.workerUrl=u},get workerClass(){return s.dT.workerClass},set workerClass(u){s.dT.workerClass=u},get workerParams(){return s.dT.workerParams},set workerParams(u){s.dT.workerParams=u},get dracoUrl(){return s.dU()},set dracoUrl(u){s.dV(u)},get meshoptUrl(){return s.dW()},set meshoptUrl(u){s.dX(u)},setNow:s.q.setNow,restoreNow:s.q.restoreNow}});var De=_e;return De})})(p5);var Qx=p5.exports;const ev=L_(Qx);async function tv(R,B,U){if(R.hasImage(B))return;const W=await new Promise(_e=>{R.loadImage(U,(Me,De)=>{if(Me)throw Me;_e(De)})});R.hasImage(B)||R.addImage(B,W)}const Gv=(R,B)=>{let U=1/0,W=0;const _e=nc(R);return B.forEach((Me,De)=>{const s=nc(Me),gt=Dy(_e,s);U>gt&&(U=gt,W=De)}),W},iv="FeatureCollection",rv="lane",nv={type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},ov=[{type:"Feature",properties:{id:"10652",r_s_id:"2940",z_order:0,rid:"47",category:6,type:2,jun_id:"629",ft_type_no:"f",lane_no:"15",pre_id:null,suc_id:null,l_boun_id:"17447",r_boun_id:"17448",width:3.4,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.38109337018,30.0600388307522],[104.381066748476,30.0599554897926],[104.381040859193,30.0598741648814],[104.381032331836,30.0598474460752],[104.381005236182,30.0597627529302],[104.380995003346,30.0597308380176],[104.380985029079,30.0596998289626],[104.380968567167,30.0596488029544],[104.380961565082,30.0596270318396],[104.380954464789,30.0596048550366],[104.38094701943,30.0595815132838],[104.380932094462,30.059534564441],[104.380925068033,30.0595125163043],[104.380918207382,30.0594911527061],[104.380904017607,30.0594474034285],[104.380896545219,30.0594242819692],[104.380888934975,30.0594005110681],[104.380874034301,30.0593536611437],[104.380866987138,30.0593316408518],[104.380853119856,30.0592885654494],[104.380831659415,30.0592215797468],[104.380808295284,30.0591491063506],[104.380782210269,30.0590678781451],[104.380774640533,30.0590442286611],[104.380760029899,30.0589983385307],[104.380752220503,30.0589738893155],[104.380736121508,30.0589236495309],[104.380720291873,30.0588739720721],[104.380712349125,30.0588491054336],[104.380696485253,30.0587996365702],[104.38068843799,30.0587744775454],[104.38065747779,30.0586773733394],[104.38064913951,30.0586513587699],[104.380638911946,30.0586196379895],[104.380615307999,30.0585466641843],[104.38060498582,30.0585146159482],[104.380596597068,30.0584883890757],[104.380582917015,30.0584453937665],[104.380562085213,30.0583803554999],[104.380540418197,30.0583124179032],[104.380503034036,30.0581956203027],[104.380488798067,30.0581513671597],[104.380480643529,30.0581259534657],[104.380471529464,30.0580973858237],[104.380452667943,30.0580380960456],[104.380444359326,30.0580121030303],[104.380416992788,30.0579270061771],[104.380403593755,30.0578852413253],[104.38036387501,30.0577611010274],[104.380344886403,30.0577019990118],[104.380316465618,30.0576132093303],[104.380292088333,30.0575374097468],[104.380273641144,30.0574798226687],[104.380265298231,30.0574537018656],[104.380258027459,30.0574308745183],[104.380235815998,30.0573610260086],[104.380226755004,30.0573326310115],[104.380217730049,30.0573044338968],[104.380192358907,30.0572255135168],[104.380165436268,30.0571415491075],[104.380157558228,30.0571170888732],[104.380141545382,30.0570676780158],[104.380133213251,30.057041844967],[104.380125218968,30.0570168216364],[104.380104602993,30.0569516456624],[104.380097138464,30.0569281283067],[104.380088490962,30.0569009405608],[104.380079123588,30.056871607226],[104.380069944522,30.0568430501859],[104.380053256791,30.0567914316856],[104.380044614691,30.0567644957407],[104.380017720707,30.0566801265318],[104.380003161919,30.0566347450874],[104.379980816032,30.0565652676681],[104.379973576718,30.0565426093531],[104.379966798691,30.0565212033457],[104.379952023602,30.0564743090095],[104.379942813842,30.0564453112338],[104.379932895022,30.056414315364],[104.379923377141,30.0563847525032],[104.379907533524,30.0563356555488],[104.379900475288,30.0563136287172],[104.379886215544,30.0562688698413],[104.379879493365,30.0562478595691],[104.379866036397,30.0562059846965],[104.379823454418,30.0560727541011],[104.379792589619,30.055976506124],[104.379783343774,30.0559476224752],[104.379776632373,30.055926495279],[104.379770348032,30.0559066347486],[104.379763522205,30.055885188177],[104.379756248598,30.0558625306733],[104.379741538313,30.0558169762781],[104.379734257494,30.0557943178624],[104.379720045419,30.0557498890031],[104.379697239787,30.0556789189387],[104.37962885968,30.0554654591945],[104.379618944354,30.0554346592733],[104.379610366091,30.0554081297565],[104.379602469866,30.0553836351808],[104.379594342974,30.0553581655106],[104.379577256651,30.0553041613493],[104.379569555015,30.0552799682328],[104.379555794248,30.055236999342],[104.379538922351,30.0551840259924],[104.379529494415,30.0551545224503],[104.379512915343,30.0551028974582],[104.379489349985,30.0550292914649],[104.379479876087,30.0549997923568],[104.3794705004,30.0549707115277],[104.37945937139,30.0549363256442],[104.379416735584,30.0548027454714],[104.37941396233,30.0547940426608],[104.379411189977,30.0547853425489],[104.379392788103,30.0547275948856],[104.379369353259,30.05465392238],[104.379359492787,30.0546230945488],[104.379335006497,30.05454709711],[104.379316694684,30.0544899556305],[104.379301408397,30.0544421557336],[104.37927892763,30.0543715292168],[104.379269632946,30.0543423935484],[104.379229257456,30.0542162662542],[104.379214828882,30.0541714493245],[104.379176603106,30.0540522866693],[104.379167451645,30.0540235980761],[104.379150468672,30.0539701927189],[104.379143178675,30.0539474271294],[104.379099650426,30.0538123482211],[104.379090489933,30.0537837207484],[104.379081897959,30.0537566523734],[104.37907371954,30.0537308056934],[104.379065886208,30.053706145565],[104.379058383551,30.053682721436],[104.379043891817,30.053637779353],[104.379036681983,30.0536153339766],[104.379007722782,30.0535248967278],[104.379000548068,30.0535023416622],[104.378986196824,30.053457084036],[104.378978932008,30.0534343571026],[104.37896451411,30.0533895580485],[104.378950109714,30.0533447158341],[104.378933392419,30.0532925606773],[104.378915768696,30.0532374934856],[104.37890804795,30.0532133514384],[104.378900819151,30.0531906793815],[104.37888450095,30.0531392917273],[104.378875137648,30.0531098842707],[104.378866132051,30.0530817353256],[104.378850451771,30.0530329050706],[104.37881810546,30.0529318342038],[104.378806246342,30.0528948815673],[104.378781622582,30.0528183349458],[104.378774773079,30.0527969483759],[104.37875419131728,30.05273249504569]]]}},{type:"Feature",properties:{id:"10659",r_s_id:"2950",z_order:0,rid:"47",category:1,type:1,jun_id:null,ft_type_no:null,lane_no:"14",pre_id:[10676],suc_id:[10651],l_boun_id:"17456",r_boun_id:"17457",width:3.93,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.381520864029,30.0612577876997],[104.381520120771,30.0612554442774],[104.381512542237,30.061231612417],[104.381504104227,30.061205167227],[104.381462944754,30.0610753541831],[104.381450746266,30.0610367457551],[104.381416576078,30.0609291308044],[104.381393457507,30.0608569108223],[104.381370338016,30.060784711505],[104.38135175287,30.0607269837885],[104.381332895625,30.0606682620562],[104.38132758827,30.0606515791779],[104.38129530537,30.0605501136086],[104.381285975376,30.0605209920377],[104.381277489547,30.0604944783878],[104.381263049486,30.060449369281],[104.381256509661,30.0604291311144],[104.381241681313,30.0603833372466],[104.381204828793,30.060267664305],[104.381192823908,30.0602302421519],[104.381169924076,30.0601590096497],[104.381162430137,30.0601356912883],[104.381141489793,30.0600703475665],[104.381128722681,30.0600303598053]]]}},{type:"Feature",properties:{id:"10654",r_s_id:"2936",z_order:0,rid:"45",category:1,type:1,jun_id:null,ft_type_no:null,lane_no:"13",pre_id:[10646],suc_id:[10662],l_boun_id:"17451",r_boun_id:"17450",width:3.92,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.381009411825,30.0588766151601],[104.381016858061,30.0588998480789],[104.381024484491,30.0589238267027],[104.381031316297,30.0589453925929],[104.381037811146,30.0589657944417],[104.381044736632,30.058987364016],[104.381052727917,30.0590121460729],[104.381061953479,30.0590407873819],[104.381072040337,30.0590722308866],[104.381091680688,30.0591334635302],[104.381099944946,30.0591592063062],[104.381113734617,30.0592021178376],[104.381120493412,30.0592232096968],[104.381127908088,30.0592464362616],[104.381168410397,30.0593736887922],[104.381177528722,30.0594023110761],[104.381197563623,30.0594652797064],[104.381207763047,30.0594971540441],[104.381218001201,30.059529016724],[104.381238531545,30.0595927628088],[104.381256909563,30.0596499139353],[104.381271878476,30.0596967736171],[104.381278896706,30.0597188981022],[104.381293112453,30.0597638576983],[104.381300113558,30.0597858787405],[104.381306953388,30.0598072611126],[104.381321369994,30.059852161531],[104.381329539583,30.0598776532418],[104.381360987269,30.0599762014892],[104.381386150988,30.0600553391805],[104.381394842202,30.0600827145373],[104.381402160402,30.060105688232]]]}},{type:"Feature",properties:{id:"10655",r_s_id:"2936",z_order:0,rid:"45",category:1,type:1,jun_id:null,ft_type_no:null,lane_no:"12",pre_id:[10647],suc_id:[10663],l_boun_id:"17452",r_boun_id:"17451",width:3.86,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.380971339656,30.0588858180789],[104.380978791307,30.05890902853],[104.380986427655,30.0589329721002],[104.380993286495,30.0589545200393],[104.380999807477,30.0589749264185],[104.381006754593,30.0589965059155],[104.381014752195,30.0590212807946],[104.381023975069,30.0590499365024],[104.381034054736,30.0590813818124],[104.381053643772,30.0591426477078],[104.381061883719,30.0591683670893],[104.381075656295,30.0592112570392],[104.3810824151,30.0592323489075],[104.38108983429,30.0592555458091],[104.381130556455,30.0593828022021],[104.381139694609,30.0594113975376],[104.381159763771,30.0594743698249],[104.381169919071,30.0595062558251],[104.381180086077,30.0595381238466],[104.38120048674,30.0596019453776],[104.381218750382,30.0596590613462],[104.381233743636,30.0597058653138],[104.381240806917,30.0597279790596],[104.381255112765,30.059772962143],[104.381262133699,30.0597950056964],[104.381268968135,30.0598163889719],[104.381283345128,30.059861309157],[104.381291484102,30.0598868089435],[104.381322850762,30.0599853283781],[104.381348036138,30.0600644418424],[104.38135674628,30.0600917839542],[104.381364038365,30.0601147099703]]]}},{type:"Feature",properties:{id:"10656",r_s_id:"2936",z_order:0,rid:"45",category:1,type:1,jun_id:null,ft_type_no:null,lane_no:"11",pre_id:[10648],suc_id:[10664],l_boun_id:"17453",r_boun_id:"17452",width:4.05,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.380932684613,30.0588951624763],[104.380936518105,30.0589070668339],[104.380951436749,30.0589536910129],[104.380972456539,30.0590194639204],[104.381017966446,30.0591612733331],[104.381033949063,30.0592115434239],[104.381053172322,30.059271717198],[104.381061140185,30.0592965468942],[104.381093604416,30.0593974535201],[104.381108282411,30.0594431474939],[104.381122611743,30.0594878761591],[104.381134596852,30.0595254997679],[104.381144912531,30.0595579390107],[104.381157028266,30.0595960051991],[104.381173879292,30.0596489641017],[104.381194313304,30.0597130914373],[104.381240915663,30.0598587461227],[104.381254235897,30.0599006544018],[104.381288156728,30.0600071253719],[104.381312797969,30.060084323704],[104.381319830602,30.0601064742734],[104.381325343372,30.0601238669089]]]}},{type:"Feature",properties:{id:"10657",r_s_id:"2950",z_order:0,rid:"47",category:1,type:1,jun_id:null,ft_type_no:null,lane_no:"11",pre_id:[10674],suc_id:[10649],l_boun_id:"17454",r_boun_id:"17455",width:3.99,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.381596922917,30.0612397678536],[104.381592945377,30.0612274056956],[104.381585006509,30.0612026795944],[104.381577042408,30.0611777628121],[104.381569220644,30.0611531699158],[104.381554122156,30.0611055305567],[104.381546487777,30.0610815574603],[104.381538784933,30.0610575222444],[104.381531350564,30.0610344207708],[104.381524518906,30.0610131490748],[104.38151811968,30.0609930954606],[104.381511303324,30.0609716627982],[104.381503011264,30.0609457060754],[104.381492884037,30.0609141745489],[104.381481697328,30.0608794206639],[104.3814707944,30.0608454746296],[104.38146103743,30.0608149102078],[104.381452375066,30.0607875789637],[104.381444282076,30.0607619371733],[104.381436307109,30.060736737057],[104.381428242957,30.0607114676065],[104.381420182417,30.0606864292817],[104.381412482247,30.0606626188639],[104.381405278481,30.0606402936867],[104.38139779632,30.060616935828],[104.381377166072,30.060552260765],[104.381353373565,30.0604777351632],[104.381337234387,30.0604269605823],[104.38133001347,30.0604043251058],[104.381312658954,30.0603503253046],[104.381295603535,30.0602972826508],[104.381288100626,30.0602739867968],[104.381270438879,30.0602193202838],[104.381259073691,30.0601840454379],[104.381247237307,30.0601471846425],[104.381236582932,30.0601139339286],[104.381227865546,30.060086677208],[104.381213362386,30.0600412406656],[104.381205745027,30.0600173933997],[104.381204114344,30.0600122936147]]]}},{type:"Feature",properties:{id:"10662",r_s_id:"2949",z_order:0,rid:"45",category:1,type:1,jun_id:null,ft_type_no:null,lane_no:"13",pre_id:[10654],suc_id:[10666],l_boun_id:"17461",r_boun_id:"17460",width:3.93,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.381402160402,30.060105688232],[104.381411130893,30.060133848053],[104.381419052707,30.0601587333641],[104.381426847492,30.0601833055903],[104.381434346777,30.0602070249822],[104.381441490192,30.0602295812183],[104.381448412872,30.0602512595105],[104.381455444554,30.0602731321567],[104.381480726171,30.0603519838942],[104.381489890321,30.0603805197883],[104.381498442732,30.0604069075327],[104.381506240171,30.0604309410492],[104.381513636709,30.0604539453664],[104.381520971995,30.0604770287638],[104.381535588513,30.0605231955019],[104.381542814775,30.060545799455],[104.381557315033,30.0605909759245],[104.381578703709,30.060658068035],[104.381585758784,30.0606801313266],[104.38160169509,30.0607300773043],[104.381620248549,30.0607882913567],[104.381629091026,30.0608159158958],[104.381637317269,30.0608414930078],[104.38165326973,30.0608908499196],[104.381661133795,30.0609152153046],[104.381668660023,30.0609386990396],[104.381675906074,30.0609615134179],[104.381683240419,30.060984729872],[104.381691031525,30.0610094090419],[104.381699348759,30.0610356715009],[104.381733953705,30.0611446040158],[104.381755693584,30.0612127224441],[104.381776705512,30.0612786404461],[104.381784386668,30.061302726838],[104.381799709315,30.0613504049544],[104.38180705802,30.0613732787504],[104.381821452726,30.0614182175684],[104.381835894271,30.0614633165013],[104.381843133061,30.0614859716515],[104.381864581859,30.0615533208098],[104.381887564852,30.0616248244263],[104.381903557723,30.0616748872005],[104.381910813615,30.0616976754484],[104.38192451006,30.0617404192317],[104.381931695668,30.0617628189041],[104.381947901122,30.0618135023798],[104.381956989431,30.06184187258],[104.381975196661,30.0618985374576],[104.381983324599,30.0619239111334],[104.381998393988,30.0619711302569],[104.382006118313,30.061995221126],[104.382013936324,30.0620194766549],[104.382044245281,30.062113468958],[104.38205162365,30.0621365576555],[104.382065855161,30.0621811373722],[104.382073664152,30.0622055133849],[104.382091909147,30.0622625397485],[104.38210101993,30.0622910520158],[104.382117056808,30.0623412028443],[104.382152646714,30.0624521439375],[104.3821750709,30.0625221161705],[104.382183806878,30.0625494031965],[104.382210523817,30.0626332504186],[104.382226557923,30.0626833849954],[104.382235758738,30.0627120061198],[104.382245245133,30.06274152772],[104.382261590009,30.0627923091714],[104.382268374622,30.0628134178713],[104.382282375382,30.0628572589291],[104.382290136564,30.0628816078592],[104.382298354489,30.0629072612156],[104.382317355126,30.0629657225383],[104.382328585591,30.0630002135351],[104.382340041298,30.0630359448918],[104.382350470002,30.0630687983893],[104.382366711234,30.0631198359911],[104.382373619244,30.0631414196182],[104.382380602923,30.0631631561965],[104.382394678382,30.0632069684893],[104.382401469269,30.0632281832826],[104.382415692467,30.063272560471],[104.382433194867,30.0633268951824],[104.382451663033,30.063384847816],[104.38247676257,30.0634629826519],[104.382503774683,30.0635476293607],[104.382511295259,30.0635711893108],[104.382518304131,30.0635931525062],[104.382532401146,30.0636372939006],[104.382539702789,30.0636599435355],[104.382547095411,30.0636827191555],[104.382554471813,30.0637054039277],[104.382561696871,30.0637277441224],[104.382568701224,30.0637496659327],[104.382575795669,30.0637720096027],[104.382583528834,30.063796294576],[104.382592316019,30.0638237137228],[104.382601957229,30.06385366252],[104.382628483581,30.06393567547],[104.382636886068,30.0639617290917],[104.382647022752,30.0639934140036],[104.382658840485,30.0640306663045],[104.382688355104,30.064124588857],[104.382691083868,30.0641332994071],[104.382693812632,30.0641420090576],[104.382724889996,30.0642357693063],[104.382759641222,30.0643439542769],[104.382783446815,30.06441843645],[104.382790224088,30.0644397006006],[104.382797141894,30.0644613605755],[104.382804674988,30.0644848314268],[104.382832147054,30.0645700942689],[104.382840989103,30.0645976383931],[104.382848796956,30.0646221050232],[104.38286283434,30.064666328038],[104.382869898972,30.0646885412068],[104.382884357937,30.0647337727231],[104.382891610837,30.064756433915],[104.382906089611,30.0648017679601],[104.382913232597,30.0648240513349],[104.382927475317,30.0648683563392],[104.382935295754,30.0648928319499],[104.382953500497,30.0649499917235],[104.382962808256,30.0649790875476],[104.382971301622,30.0650055080728],[104.382978847276,30.0650290274521],[104.382999944675,30.0650954113743],[104.383028868749,30.0651858329037],[104.383036150431,30.0652084796951],[104.383050657037,30.0652536904847],[104.383057860345,30.0652762679533],[104.383079454951,30.065344139729],[104.383093952524,30.0653893235088],[104.383108535654,30.0654344147274],[104.383123130487,30.065479576995],[104.383130380617,30.0655022543109],[104.383137608231,30.0655250377245],[104.383158960451,30.0655924658612],[104.383165705188,30.065613559023],[104.383223287119,30.0657925803606],[104.383230416503,30.0658148555495],[104.383244449157,30.0658588193675],[104.383251809148,30.0658816820085],[104.383259524971,30.0659055485995],[104.383267444388,30.0659301249292],[104.383275267421,30.06595461124],[104.383290179295,30.0660015741338],[104.383297607743,30.0660247506849],[104.383312749281,30.0660715572877],[104.383320137181,30.0660945683229],[104.383334476985,30.0661397095726],[104.3833416667,30.0661622770644],[104.383356156916,30.0662074957766],[104.383385040941,30.0662978476587],[104.383392245053,30.0663204331368],[104.383406618144,30.0663656112509],[104.383413852874,30.0663881958509],[104.383428435821,30.0664333957214],[104.383435703874,30.0664560181163],[104.383442925988,30.0664786593548],[104.383450109369,30.0665012789739],[104.383457316166,30.0665239031082],[104.383464567997,30.0665465110924],[104.383471846845,30.0665690957161],[104.383479108578,30.0665916704304],[104.383486327976,30.0666142657902],[104.383493544672,30.0666369294939],[104.383500808208,30.0666596831684],[104.383508079842,30.0666823001518],[104.383515239764,30.0667044520888],[104.383522206904,30.0667260561716],[104.383529092972,30.0667475288816],[104.383536166417,30.066769641168],[104.383543578575,30.0667927429967],[104.38355121864,30.0668164619538],[104.383566224002,30.066862991312],[104.383573458684,30.066885533603],[104.383580655532,30.0669080192023],[104.38360237128,30.066975913166],[104.383616251465,30.0670190654821],[104.383623593324,30.067041754442],[104.383632317067,30.0670686183318],[104.383643049678,30.0671016245011],[104.383690292356,30.0672461659746],[104.383698587262,30.0672714026072],[104.383713238453,30.0673156823875],[104.383720318113,30.067336996039],[104.383733971157,30.067378084167],[104.383741180528,30.0673997216796],[104.38374892499,30.0674229082773],[104.383764873327,30.06747060296],[104.383783350287,30.067525836095],[104.383794736784,30.0675596827329],[104.383806462875,30.0675942374217],[104.383817003469,30.0676252693572],[104.383825740604,30.0676510630106],[104.383833271528,30.0676732970239],[104.383840524993,30.0676946863373],[104.383855697621,30.0677392722598],[104.383863453734,30.06776199209],[104.383871179217,30.0677846372484],[104.383878890285,30.0678072590101],[104.383886635581,30.0678299617375],[104.38389444843,30.0678527229765],[104.383902294597,30.0678753637334],[104.383910038962,30.0678975529433],[104.383917594151,30.0679191943045],[104.383932759483,30.0679628664723],[104.383940802014,30.0679859966153],[104.383949073344,30.0680096494555],[104.383965279074,30.0680556607222],[104.383990357845,30.0681268020013],[104.383999299358,30.068152192881],[104.384008074216,30.0681770701051],[104.384016470725,30.068200830051],[104.384024559148,30.0682236175691],[104.384040548604,30.0682684019383],[104.384048599177,30.0682909331117],[104.384064714735,30.0683361528443],[104.384072790525,30.0683587766619],[104.384080905041,30.0683813870203],[104.384089070895,30.0684040154064],[104.384121225327,30.0684931345522],[104.384130021735,30.0685175306213],[104.384150516947,30.0685743354371],[104.384161065417,30.0686035758089],[104.38417117158,30.0686314758184],[104.384181393938,30.0686595818665],[104.384192659422,30.0686904991623],[104.384205129279,30.0687247107745],[104.384238899519,30.0688164841396],[104.38425483652,30.0688596432745],[104.384263577901,30.0688832253725],[104.384273711009,30.068910407712],[104.384296689513,30.0689718657876],[104.384319567112,30.0690332041499],[104.384330839704,30.0690633587742],[104.384342309553,30.0690937959459],[104.384353828033,30.0691242088721],[104.384375129147,30.0691804970927],[104.384384673076,30.0692058352952],[104.3844032718,30.0692554132127],[104.384412551788,30.0692801063733],[104.384438080273,30.0693475748129],[104.384446154073,30.0693688036786],[104.384454568364,30.0693908035425],[104.384463466371,30.06941392256],[104.384472689553,30.0694377630997],[104.384499564573,30.0695069844807],[104.384524153365,30.0695702864159],[104.384532884686,30.0695926588382],[104.384543053651,30.0696185874603],[104.384594662261,30.0697497581921],[104.384604716803,30.0697754294913],[104.384613468804,30.0697976607125],[104.3846213414844,30.06981755119237]]]}},{type:"Feature",properties:{id:"10663",r_s_id:"2949",z_order:0,rid:"45",category:1,type:1,jun_id:null,ft_type_no:null,lane_no:"12",pre_id:[10655],suc_id:[10667],l_boun_id:"17462",r_boun_id:"17461",width:3.9,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.381364038365,30.0601147099703],[104.381373008871,30.0601429147692],[104.381380952318,30.0601678432787],[104.381388779544,30.0601924236401],[104.381396305864,30.0602161520609],[104.38140343668,30.0602387163887],[104.381410319738,30.0602604531082],[104.381417291979,30.060282340996],[104.381442461031,30.0603611207158],[104.381451609885,30.060389736647],[104.38146009295,30.0604161513169],[104.381467828244,30.0604401533091],[104.381475217586,30.0604631351467],[104.381482618641,30.0604862312067],[104.38149745948,30.0605324503372],[104.381504737997,30.0605550012896],[104.38151917702,30.060600103977],[104.381540618876,30.0606672465285],[104.381547685671,30.0606892927536],[104.381563607586,30.0607391712906],[104.381582249351,30.0607974430076],[104.381591108958,30.0608250873598],[104.381599294678,30.0608506608474],[104.381615162491,30.0609000554725],[104.381622993239,30.0609244289306],[104.381630476238,30.0609478712667],[104.381637681763,30.060970635255],[104.381645003508,30.0609938553044],[104.381652793724,30.0610185021087],[104.381661132589,30.0610447708945],[104.381695866399,30.0611536999802],[104.381717658559,30.0612218859358],[104.381738600254,30.0612877157674],[104.381746294034,30.06131185704],[104.381761614005,30.0613596008247],[104.381768950111,30.0613824782163],[104.381783346638,30.0614273864788],[104.381797835945,30.061472460295],[104.381805083753,30.0614950902826],[104.381826525379,30.0615624799327],[104.38184946337,30.0616340419941],[104.38186543194,30.0616840049431],[104.381872713965,30.0617067869301],[104.381886436557,30.0617496080976],[104.381893599656,30.0617720122554],[104.381909731269,30.0618226588124],[104.381918807882,30.0618510443026],[104.381937079096,30.0619077308481],[104.381945220556,30.0619330712728],[104.381960278257,30.0619802715203],[104.381968005299,30.0620044127642],[104.381975843141,30.062028733073],[104.382006207984,30.062122554599],[104.382013576455,30.0621456217138],[104.382027755745,30.062190245468],[104.382035583666,30.0622146934542],[104.382053946687,30.0622716623957],[104.3820630773,30.0623001531101],[104.382079071867,30.0623503255049],[104.382114505095,30.0624613132664],[104.382136978859,30.0625313242464],[104.382145735566,30.0625585807267],[104.382172527306,30.0626423552095],[104.382188606477,30.062692561795],[104.382197780283,30.0627211721153],[104.382207260387,30.0627506802328],[104.382223596281,30.0628014868791],[104.382230346675,30.0628225865636],[104.382244286202,30.0628663826185],[104.3822520546,30.0628907099823],[104.382260306769,30.0629164047499],[104.382279236284,30.062975071977],[104.382290364079,30.0630095610964],[104.382301817094,30.0630451260926],[104.382312287243,30.0630778663286],[104.382328494277,30.0631290217319],[104.382335410407,30.0631506692273],[104.382342431929,30.0631724148431],[104.382356588473,30.063216118412],[104.38236339198,30.0632373152398],[104.382377601691,30.0632817742732],[104.382395035659,30.0633360711748],[104.38241351736,30.0633939447063],[104.382438663782,30.0634722208121],[104.382465775912,30.0635567183624],[104.382473326225,30.0635802981348],[104.38248033691,30.0636022730326],[104.382494388012,30.0636464926451],[104.382501662645,30.0636691818353],[104.38250904447,30.0636919745427],[104.382516406471,30.0637146458223],[104.382523582896,30.0637369266278],[104.382530560237,30.0637588547184],[104.382537633074,30.0637811776941],[104.382545377962,30.0638054941649],[104.382554202091,30.0638329052635],[104.382563882048,30.0638628577062],[104.382590373314,30.0639449291166],[104.382598782117,30.0639709485815],[104.382608944936,30.0640025822699],[104.382620832944,30.0640398040738],[104.382650634039,30.0641335587534],[104.382653385324,30.0641422369522],[104.382656142915,30.0641509403373],[104.382686720437,30.064245246962],[104.382721362715,30.0643531827715],[104.382745180051,30.0644276083311],[104.382751976249,30.0644488473273],[104.382758909378,30.0644705037283],[104.382766445187,30.0644940087665],[104.382793908292,30.0645793561744],[104.382802766567,30.0646068742451],[104.38281058704,30.0646313004281],[104.382824611832,30.0646754551029],[104.38283167107,30.0646976691759],[104.382846129159,30.0647429438787],[104.382853372163,30.0647656266554],[104.382867803219,30.0648109624765],[104.382874919194,30.0648332341459],[104.382889180854,30.064877585052],[104.382897040034,30.0649020517151],[104.382915306053,30.0649591594083],[104.382924612025,30.0649882696328],[104.382933081085,30.0650147090336],[104.382940615942,30.0650382329104],[104.382961791734,30.0651045270001],[104.382990669918,30.0651950267692],[104.38299790207,30.0652176672314],[104.383012395188,30.0652628753311],[104.383019629131,30.0652854393473],[104.383041364285,30.0653533220698],[104.383055833058,30.0653985310249],[104.383070229761,30.0654436949427],[104.383084742653,30.0654889093182],[104.383092020714,30.0655115192203],[104.383099304181,30.0655342172583],[104.38312081316,30.0656016185844],[104.383127559709,30.0656227279448],[104.383185147134,30.0658017844406],[104.383192275628,30.0658240380549],[104.383206323616,30.0658680117984],[104.383213653895,30.0658908915104],[104.383221329198,30.06591477966],[104.383229224308,30.0659393577778],[104.383237055457,30.0659638063354],[104.383252033106,30.0660107378318],[104.383259474177,30.0660339449812],[104.383274537377,30.0660807893073],[104.383281883854,30.0661037643436],[104.383296237189,30.0661488534647],[104.383303432318,30.0661714002871],[104.383317927062,30.0662166666872],[104.383346815635,30.0663070231103],[104.383354017957,30.0663296184892],[104.383368441513,30.0663748551233],[104.38337568526,30.066397399272],[104.383390215086,30.066442575734],[104.383397448923,30.0664652062029],[104.383404646729,30.0664878546247],[104.383411827419,30.0665104751508],[104.383419048639,30.0665330993078],[104.383426320296,30.0665557019236],[104.38343361627,30.066578291069],[104.383440887021,30.0666008541102],[104.383448116337,30.0666234342003],[104.383455334845,30.0666460826273],[104.383462602896,30.0666688354165],[104.383469872741,30.0666914802874],[104.383477021867,30.0667136744929],[104.383483963798,30.0667352839593],[104.383490843573,30.0667567800557],[104.383497925136,30.0667789022515],[104.383505346312,30.0668020022998],[104.383512998097,30.0668256996942],[104.383528063831,30.0668722309246],[104.383535348964,30.0668947606793],[104.38354259446,30.0669172337405],[104.383564367886,30.06698509451],[104.383578282322,30.067028291841],[104.383585624193,30.06705100869],[104.383594331737,30.0670778833695],[104.383605067067,30.0671108949521],[104.383652295411,30.067255524612],[104.383660657887,30.0672808395552],[104.383675417183,30.0673250798796],[104.383682487849,30.0673464492908],[104.383695978788,30.0673875660755],[104.383703138634,30.0674092494205],[104.383710867797,30.0674324746864],[104.383726792739,30.0674801522841],[104.383745282339,30.067535414234],[104.383756649942,30.067569322025],[104.383768326518,30.0676039953973],[104.383778854518,30.0676350282361],[104.383787643907,30.0676608039604],[104.383795235189,30.0676830227479],[104.383802527394,30.06770437883],[104.383817737875,30.0677489648062],[104.383825489498,30.0677717269113],[104.383833215896,30.067794430537],[104.383840938687,30.0678170846949],[104.383848720924,30.0678397829683],[104.38385657882,30.0678625325657],[104.38386445112,30.0678851832484],[104.383872199101,30.0679074192368],[104.383879729084,30.0679290938615],[104.383894890838,30.0679727957249],[104.38390296941,30.0679959349032],[104.383911274079,30.0680196003739],[104.383927440205,30.0680656574943],[104.383952427146,30.0681368688765],[104.383961424518,30.0681622760042],[104.38397022911,30.0681871056021],[104.383978630134,30.068210841282],[104.383986714969,30.0682336692776],[104.384002711661,30.0682785876735],[104.384010760447,30.0683011377423],[104.384026894943,30.0683463269367],[104.384035002269,30.0683689579869],[104.384043142019,30.0683915980556],[104.384051307887,30.0684142588286],[104.384083459666,30.0685033681242],[104.384092292117,30.0685278056049],[104.384112817083,30.068584595186],[104.384123361965,30.0686138148852],[104.38413346184,30.0686417418829],[104.384143674308,30.0686698812115],[104.384154962328,30.0687008066359],[104.384167506061,30.0687350336167],[104.384201383544,30.0688270004727],[104.384217343987,30.0688701416632],[104.384226048449,30.0688936553938],[104.384236131136,30.068920878174],[104.384259020511,30.0689824171447],[104.384281979208,30.0690437583052],[104.384293245512,30.0690739147386],[104.384304627115,30.0691044318909],[104.384316051044,30.0691349220948],[104.384337406234,30.0691912373702],[104.38434697089,30.0692165027587],[104.384365602067,30.0692660636425],[104.384374954126,30.0692908198288],[104.384400565513,30.0693582856756],[104.384408587987,30.0693795118114],[104.384416961763,30.0694015755045],[104.38442586249,30.0694247997569],[104.384435129824,30.0694487248823],[104.384462038209,30.0695179130538],[104.384486626141,30.0695812770753],[104.384495331357,30.0696036737695],[104.384505439094,30.0696296446225],[104.384557054988,30.0697607920499],[104.384567139267,30.0697864552942],[104.38457595253,30.0698087459335],[104.38458240015011,30.069824957439806]]]}},{type:"Feature",properties:{id:"10664",r_s_id:"2949",z_order:0,rid:"45",category:1,type:1,jun_id:null,ft_type_no:null,lane_no:"11",pre_id:[10656],suc_id:[10668],l_boun_id:"17463",r_boun_id:"17462",width:4.05,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.381325343372,30.0601238669089],[104.381332785925,30.0601473497533],[104.381339841972,30.0601694643675],[104.381346834049,30.0601913307077],[104.38136072541,30.060234947283],[104.381397602947,30.0603510553142],[104.381419083646,30.0604183346898],[104.381434392135,30.0604667648172],[104.381442472503,30.0604921197159],[104.381450477182,30.0605170365733],[104.381465560371,30.0605636750317],[104.38147277043,30.0605860748425],[104.381487199559,30.0606311172828],[104.381494488892,30.0606537590793],[104.381501807048,30.0606763883108],[104.381509107184,30.0606989824501],[104.381516374887,30.0607215387856],[104.381523616465,30.0607440834034],[104.381530847233,30.0607666495928],[104.381552561153,30.0608345694026],[104.381574245324,30.060902392941],[104.381588785202,30.0609476242913],[104.381595970008,30.0609701256702],[104.381616771288,30.0610361038464],[104.381624603855,30.0610608658109],[104.381633792286,30.0610896624845],[104.38166339721,30.0611820294645],[104.381685219143,30.0612506507427],[104.381692151676,30.0612725574124],[104.381706245561,30.0613169762017],[104.381714103312,30.0613415106383],[104.381732486392,30.0613986650644],[104.38175788394,30.06147764617],[104.381764901129,30.061499628444],[104.38178618333,30.0615665314453],[104.381793453661,30.0615891938325],[104.381822450287,30.0616796850043],[104.381836820676,30.0617248998831],[104.381858576667,30.0617927268712],[104.381873056928,30.0618378878752],[104.381880276787,30.0618604575638],[104.381887525471,30.0618830704447],[104.381902083187,30.0619283655044],[104.38190934718,30.0619510053734],[104.381923842727,30.0619962257209],[104.38193110671,30.062018801733],[104.381938403118,30.0620413561897],[104.381953015743,30.0620864570221],[104.381960276116,30.0621090725934],[104.381967503161,30.0621317402922],[104.381974713991,30.0621544232625],[104.381989132034,30.0621996327133],[104.38199636537,30.0622221655131],[104.38200365005,30.0622447433246],[104.38201097977,30.0622673949199],[104.382018277959,30.0622900105115],[104.38202541309,30.0623122698206],[104.382039505885,30.0623565733326],[104.382056142806,30.0624087203362],[104.382074880615,30.0624674837489],[104.382083207624,30.0624935860276],[104.382090606701,30.0625166774327],[104.382105261589,30.0625621019806],[104.382113465154,30.062587570118],[104.382130564172,30.062640847047],[104.382175308058,30.062780414623],[104.382189617879,30.0628252740387],[104.382214147424,30.062901894133],[104.382222135641,30.0629267262241],[104.382229740975,30.062950317803],[104.382244302985,30.0629953186159],[104.382266139676,30.0630627739503],[104.382273384646,30.0630853705421],[104.382287808827,30.0631306419008],[104.382295048388,30.0631532969379],[104.382302320373,30.0631759160302],[104.382309603163,30.0631985027551],[104.382316882351,30.0632211362393],[104.382324147128,30.0632438470497],[104.382338477584,30.063288749577],[104.382352430543,30.0633321283086],[104.38235952684,30.0633542355142],[104.382374017636,30.063399702042],[104.382381197717,30.0634222158101],[104.382388425536,30.0634447583981],[104.382403418085,30.0634912577851],[104.382410954898,30.0635146675911],[104.382418315138,30.0635375916028],[104.382439937301,30.0636050933729],[104.382454405527,30.0636504564177],[104.382461655852,30.0636731437977],[104.382468921484,30.0636957790294],[104.38247618621,30.0637183522055],[104.382483431117,30.063740897483],[104.382505109085,30.0638086924317],[104.3825270825,30.0638769238011],[104.382541053373,30.0639203609123],[104.382547816288,30.0639413768967],[104.382565705071,30.0639968360248],[104.382577736323,30.0640341649958],[104.382589578384,30.0640708921471],[104.38260811667,30.0641283330326],[104.382610922005,30.0641370256736],[104.382613697613,30.0641456598318],[104.382647688679,30.0642520285324],[104.382653454294,30.0642699508386],[104.382660633389,30.0642923629125],[104.3826678278,30.0643148973055],[104.382682234634,30.0643600362491],[104.382689485791,30.0643826651162],[104.382704046643,30.064427861744],[104.382711276166,30.0644503026287],[104.382733997155,30.0645214752792],[104.382742096925,30.0645468523112],[104.382750092184,30.0645717517093],[104.382765051187,30.0646181933192],[104.382772230249,30.0646405936737],[104.382779412015,30.0646630713701],[104.38280085371,30.064730395538],[104.382823516966,30.0648014691402],[104.382840638943,30.0648552133084],[104.382849118847,30.0648818146214],[104.382871929779,30.0649528469487],[104.382879070973,30.0649751051502],[104.38289346597,30.0650201288633],[104.382900599053,30.0650424203268],[104.382931459199,30.0651387054396],[104.38294092282,30.0651683688801],[104.382965673277,30.0652463932571],[104.382972618964,30.0652682231855],[104.38298023309,30.0652920744742],[104.383007753649,30.0653783282389],[104.383016128101,30.0654047207664],[104.383023571958,30.065428223856],[104.383030583394,30.0654502966444],[104.383037598426,30.0654722588182],[104.38304469723,30.0654943478686],[104.383059050676,30.0655388795341],[104.383066949441,30.0655634729892],[104.383075795913,30.0655910835942],[104.383085207225,30.0656204996277],[104.383102535313,30.0656747474384],[104.383110371904,30.0656991456743],[104.383137326536,30.0657826981612],[104.38316132994,30.0658574122176],[104.3831684179,30.0658794841403],[104.38318237221,30.0659231349584],[104.383189135859,30.0659442856881],[104.383216980474,30.0660310854213],[104.383229447444,30.0660701142102],[104.383250929279,30.0661373193628],[104.383258508185,30.0661610437418],[104.383272268766,30.0662041889283],[104.383280597177,30.0662302503882],[104.383299392625,30.0662891704249],[104.383316061146,30.0663415208638],[104.383323275184,30.0663640596042],[104.383336789781,30.066406113671],[104.383343717342,30.066427760931],[104.383362824425,30.0664874006531],[104.383375896675,30.0665279227754],[104.383401179079,30.0666070902703],[104.383410470457,30.0666361931279],[104.383431374688,30.0667015261576],[104.383445881971,30.0667468662475],[104.383453221187,30.0667697477041],[104.383481497907,30.066857748143],[104.383488629012,30.0668798892703],[104.383503848801,30.0669267947649],[104.383511486168,30.0669503275723],[104.383526156437,30.0669957612921],[104.383533412745,30.0670182343654],[104.383555434772,30.0670859946358],[104.383562766731,30.0671084740626],[104.383570099591,30.0671310002529],[104.383592290935,30.0671990888926],[104.383607068326,30.0672441809227],[104.383614456115,30.0672666792703],[104.383621901551,30.0672892415175],[104.383636897804,30.0673344893039],[104.383644366655,30.0673571334034],[104.383659289039,30.0674024251803],[104.383666824536,30.0674250819221],[104.383697071881,30.0675155965453],[104.383718813521,30.0675807484244],[104.383726252604,30.0676029706965],[104.383734103357,30.0676262338326],[104.38374224957,30.0676501474285],[104.383758236598,30.0676968762827],[104.383765958511,30.0677195268635],[104.383788582835,30.0677858098925],[104.383795984031,30.0678072479086],[104.383803656369,30.0678293498526],[104.383820040582,30.0678764045668],[104.383843162062,30.0679430558006],[104.383850793848,30.0679650443829],[104.383858834602,30.0679881385759],[104.38387540614,30.0680355126763],[104.383883462193,30.0680585061518],[104.383899177937,30.0681034891173],[104.383907048417,30.0681260255733],[104.383914997259,30.0681486592208],[104.383931072381,30.0681940354783],[104.383939017601,30.0682164164075],[104.383946806079,30.0682384104937],[104.383954628786,30.0682604837469],[104.383962926216,30.0682838074557],[104.383972134365,30.0683095960712],[104.383993272909,30.0683685832989],[104.384044691375,30.0685115386535],[104.384052729319,30.0685336732164],[104.38406870702,30.0685778505212],[104.384077331386,30.068601643019],[104.384104607027,30.0686768689698],[104.384113185442,30.0687006002638],[104.384121460275,30.068723354638],[104.384129654026,30.0687457267311],[104.384146253195,30.0687907759582],[104.384154648706,30.0688134467886],[104.384163063126,30.0688360771632],[104.38417988385,30.0688812704491],[104.384188257729,30.0689038540172],[104.384205040607,30.0689490679401],[104.384213472122,30.0689716596433],[104.384221902732,30.0689942360547],[104.384247182849,30.0690622260658],[104.384255690918,30.0690850354557],[104.384272420588,30.0691297870437],[104.38428048545,30.0691513010343],[104.384288541297,30.0691727061976],[104.38429689981,30.0691949317915],[104.384305694311,30.0692183916143],[104.384314714904,30.0692423633367],[104.384323519295,30.0692655857424],[104.384331884988,30.0692875082619],[104.384340044392,30.0693088145725],[104.384348428092,30.0693307254109],[104.38435721355,30.0693538029998],[104.384366230513,30.0693775966375],[104.384375184418,30.0694012175503],[104.38438395365,30.0694242375607],[104.38439263009,30.0694468357105],[104.384401323635,30.0694693250545],[104.384410039694,30.0694918458907],[104.384418741342,30.0695143936917],[104.384436188765,30.0695596035357],[104.384453823526,30.0696049655104],[104.384471503307,30.0696503140218],[104.384480362554,30.0696729284847],[104.384489274939,30.0696955528819],[104.384507180761,30.0697408215202],[104.384515982337,30.0697631139679],[104.384533426047,30.0698074199332],[104.384543083359,30.0698318687511],[104.38454329238428,30.06983239534084]]]}},{type:"Feature",properties:{id:"10674",r_s_id:"2951",z_order:0,rid:"47",category:1,type:1,jun_id:null,ft_type_no:null,lane_no:"11",pre_id:[11160],suc_id:[10657],l_boun_id:"17481",r_boun_id:"17482",width:4.01,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.38446111946806,30.069848023797373],[104.384453551093,30.0698288045367],[104.384429935106,30.0697685043747],[104.384405435415,30.0697057932791],[104.384385046916,30.0696537110554],[104.384371317936,30.069618262801],[104.384362466735,30.0695952076437],[104.384355202725,30.0695761746684],[104.38434742256,30.0695558534338],[104.384338856004,30.0695336141896],[104.3843300039,30.0695107595689],[104.384321073426,30.0694877726796],[104.384311910542,30.0694641461766],[104.38430243147,30.0694395679259],[104.38429299112,30.0694149195579],[104.38428412457,30.0693916782037],[104.384275787688,30.069369869907],[104.384266813043,30.0693465025516],[104.384255490012,30.0693169611917],[104.384241133071,30.0692791948005],[104.384225013247,30.0692365813867],[104.384209555502,30.0691957527703],[104.384196655114,30.0691614751434],[104.384186353532,30.0691340228362],[104.384177546379,30.0691105593669],[104.384169386899,30.0690887979532],[104.384161650792,30.0690681079837],[104.38415410565,30.0690478660342],[104.384076684938,30.0688401486687],[104.384065719393,30.068810559872],[104.384057138283,30.0687873474668],[104.384049293127,30.0687660188575],[104.384040701188,30.0687424853816],[104.384030799457,30.0687151727522],[104.384008537654,30.0686535936581],[104.383977098327,30.068566560507],[104.383968100981,30.068541599445],[104.383944479772,30.068475860692],[104.383912525056,30.0683865571491],[104.383904406877,30.0683638541077],[104.383888295719,30.0683186828471],[104.383880330665,30.06829625692],[104.383872380018,30.0682738130166],[104.383864284334,30.0682508968446],[104.383847518227,30.0682033292156],[104.383819808026,30.0681251834525],[104.383807704551,30.0680907399578],[104.383794302965,30.0680522780875],[104.383750261531,30.0679256503538],[104.383742274783,30.0679025363908],[104.383733525924,30.0678770781453],[104.383696048635,30.0677673002159],[104.383667411164,30.0676833645926],[104.383654005862,30.0676440770785],[104.383640628477,30.0676048444406],[104.383578193307,30.0674202187751],[104.383565897764,30.067383676002],[104.383556832614,30.0673565392998],[104.383549627689,30.0673348261999],[104.383542780394,30.0673141377323],[104.383535603389,30.0672924849074],[104.383528146226,30.0672700710139],[104.38351301479,30.0672246278984],[104.383505191872,30.0672010067957],[104.383497098693,30.067176439373],[104.383480395244,30.0671257842225],[104.383462528791,30.0670715451648],[104.383453016751,30.0670423324139],[104.383418738621,30.0669374545948],[104.383411147176,30.0669142059861],[104.38340377192,30.0668913514659],[104.383396717352,30.0668692337658],[104.383361292207,30.0667574849859],[104.383351764785,30.0667276156857],[104.383340470791,30.0666923057585],[104.383315885584,30.0666152702026],[104.383305270816,30.0665820463757],[104.38329638659,30.0665543440783],[104.383288100537,30.0665286810572],[104.383278932548,30.0665003660693],[104.383268490743,30.0664679913365],[104.383257653446,30.0664341539613],[104.383247867431,30.0664033131352],[104.383239996623,30.0663782107411],[104.38323381492,30.0663584023181],[104.383228076446,30.0663401770836],[104.383220821838,30.0663174314394],[104.383166201893,30.0661469391369],[104.383155849221,30.066114761392],[104.383148633344,30.0660924591271],[104.383142526424,30.066073622013],[104.383135808714,30.0660527779795],[104.383127960414,30.0660282295536],[104.383110706204,30.0659739755275],[104.383102104772,30.0659470090614],[104.383093034894,30.065918665322],[104.383082615518,30.0658860747044],[104.383057503968,30.0658077263524],[104.383045189167,30.0657693622175],[104.383034845446,30.0657370369482],[104.383019416335,30.0656887487626],[104.383012433733,30.0656669673753],[104.382997479374,30.0656203586259],[104.382990049929,30.0655970399017],[104.382976296386,30.0655536382776],[104.382969729068,30.065533083919],[104.382962916722,30.0655119681662],[104.382955194502,30.0654881005881],[104.382945902965,30.0654592484895],[104.382935105166,30.0654255117495],[104.382923870436,30.0653903159222],[104.382905027869,30.0653314693364],[104.382884316877,30.0652666028344],[104.382868030939,30.065215500735],[104.382858660984,30.0651861727987],[104.382828238569,30.0650912108927],[104.382816982171,30.0650559709371],[104.382805164521,30.0650188859734],[104.38277301953,30.0649176551194],[104.382764740498,30.064891758129],[104.38274987518,30.0648454964655],[104.382742358282,30.0648220202173],[104.382734294547,30.0647967313503],[104.382713150073,30.0647301169597],[104.382698754057,30.0646847945798],[104.38268295718,30.0646353259753],[104.382667999018,30.0645886478014],[104.38264520411,30.0645175442769],[104.382636120549,30.0644890825686],[104.382618856087,30.0644347526914],[104.382611072487,30.0644103705547],[104.382604214094,30.0643890235496],[104.382597755693,30.0643690051966],[104.382590297313,30.0643458266351],[104.382580241687,30.0643144475427],[104.382567163595,30.0642734933746],[104.382539003824,30.0641852079425],[104.38252784009,30.0641502998045],[104.382518615953,30.0641214943919],[104.382488898538,30.064029169561],[104.382464920604,30.0639543200596],[104.382439617453,30.0638755249254],[104.382428127547,30.0638394707211],[104.382418339407,30.0638086502914],[104.382402809002,30.0637597033785],[104.382394898313,30.0637350099029],[104.382362226751,30.0636337304404],[104.382329140719,30.0635307427579],[104.382320746229,30.0635045307717],[104.382300505927,30.0634413019321],[104.382281699831,30.0633826060522],[104.382273066585,30.0633555736559],[104.38225408839,30.0632961707366],[104.382242756968,30.0632608423521],[104.382230383202,30.0632221513581],[104.382218016637,30.0631834711571],[104.38220701852,30.0631489839263],[104.382198123075,30.0631208478042],[104.382190886173,30.0630978617958],[104.382184310531,30.0630770608354],[104.382177684444,30.0630562616256],[104.382153846748,30.0629817375447],[104.382143545906,30.0629496179345],[104.382132440562,30.0629150649259],[104.382111441561,30.0628496274293],[104.382102741597,30.0628225220752],[104.382088030835,30.0627765659771],[104.382080780406,30.0627539405545],[104.382073255204,30.0627305108866],[104.382065758827,30.0627071603833],[104.382058625506,30.0626848282407],[104.382051929111,30.0626636997868],[104.382038983156,30.0626227014324],[104.382031755228,30.0625999842878],[104.382013234517,30.0625421581351],[104.38200264443,30.062509183855],[104.381984386754,30.0624520450056],[104.381977245297,30.0624296004205],[104.381970450689,30.0624083153753],[104.381955665988,30.0623623933146],[104.38194062182,30.0623157029884],[104.381933720899,30.0622941507385],[104.381926808257,30.0622724231093],[104.381919304613,30.0622486651702],[104.381911012667,30.0622222984767],[104.381902245045,30.0621945068199],[104.381893412567,30.0621667933407],[104.381884608029,30.0621395016645],[104.381875758451,30.0621122378224],[104.381866997154,30.0620851422321],[104.381858599806,30.0620588932356],[104.381850429474,30.062033128281],[104.381832249142,30.0619757286049],[104.38181196429,30.0619120182437],[104.381802823663,30.061883198289],[104.381793908254,30.0618549657958],[104.381783785625,30.0618229523422],[104.381771679199,30.0617849844507],[104.381758392593,30.0617436897758],[104.381735767149,30.0616734067608],[104.381727865262,30.0616487769607],[104.381720888607,30.0616269970615],[104.381713034464,30.0616025183872],[104.381702976692,30.0615712271174],[104.381690640506,30.0615327796404],[104.381677231326,30.0614909452228],[104.381654216608,30.0614192885212],[104.381646306585,30.0613945642627],[104.381639850627,30.0613742309348],[104.381633392862,30.0613537968802],[104.381626003551,30.0613304886305],[104.381617717833,30.0613044986719],[104.38160918707,30.0612778825557],[104.381596922917,30.0612397678536]]]}},{type:"Feature",properties:{id:"10675",r_s_id:"2951",z_order:0,rid:"47",category:1,type:1,jun_id:null,ft_type_no:null,lane_no:"12",pre_id:[11098],suc_id:[10658],l_boun_id:"17482",r_boun_id:"17483",width:3.83,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.38442226999084,30.06985541257453],[104.384410726202,30.0698260229975],[104.384401859722,30.0698033752306],[104.384384245648,30.069758176015],[104.384375426897,30.0697355777422],[104.384366566711,30.0697129767337],[104.384357682204,30.0696903694066],[104.384348829218,30.069667780989],[104.384340035676,30.0696452429803],[104.38430501097,30.0695546135062],[104.3842963399,30.0695319352934],[104.384279241855,30.0694869819601],[104.38427052754,30.0694642488444],[104.384251915273,30.0694161537979],[104.38424199118,30.0693903700644],[104.384231799536,30.0693636625018],[104.384221590764,30.0693367435813],[104.384211794551,30.0693108088599],[104.384194775704,30.0692657665091],[104.384187154022,30.0692457070651],[104.38417099184,30.0692033408958],[104.384162100023,30.0691800113478],[104.384153073081,30.0691563093647],[104.384144477616,30.0691336608461],[104.384136430729,30.0691122583458],[104.38412798387,30.0690895290098],[104.384117461545,30.0690611376016],[104.384104033217,30.0690250338676],[104.384074342608,30.0689454486625],[104.384061388082,30.0689106439261],[104.384049101946,30.0688775304706],[104.384036173519,30.0688425314921],[104.384022761345,30.0688061210653],[104.384010336449,30.0687723078052],[104.384000033856,30.0687441584568],[104.383991593233,30.0687209695333],[104.383983860644,30.0686996535921],[104.383967772098,30.0686553988008],[104.383959586391,30.0686328297157],[104.383943715806,30.0685887189879],[104.383915286009,30.0685096275193],[104.383904643742,30.0684799939703],[104.383894778874,30.0684524492999],[104.383878007415,30.068405552575],[104.383854160902,30.0683389223276],[104.383846110258,30.0683162481052],[104.383830061205,30.0682709401676],[104.383806219115,30.0682035940263],[104.383798174757,30.068180855944],[104.383789775473,30.0681571229081],[104.383780986125,30.0681322303129],[104.383772068852,30.0681068438793],[104.383763411907,30.0680820557138],[104.383755224286,30.0680585269953],[104.383747367266,30.0680359455414],[104.383730888416,30.067988590329],[104.383721428808,30.0679612770724],[104.383711089082,30.0679313487352],[104.383700542159,30.0679007772029],[104.383690757331,30.0678723233198],[104.383673822584,30.0678228219077],[104.383652909743,30.0677616474918],[104.383628022387,30.0676885005939],[104.383617965463,30.0676589366915],[104.383603478229,30.0676164439449],[104.383596778709,30.0675966927075],[104.383589526069,30.0675752133986],[104.383574121741,30.0675294966856],[104.383566433089,30.0675067291687],[104.383551045874,30.0674613002396],[104.383543424779,30.0674387809869],[104.383536071229,30.0674169958083],[104.383528893337,30.0673956514466],[104.38352122268,30.0673727877061],[104.383488984258,30.0672762996836],[104.383477548945,30.0672416884571],[104.383467887381,30.0672122588447],[104.383452826141,30.0671663121399],[104.383438374781,30.0671225674898],[104.383430889653,30.0670998873478],[104.383423433344,30.06707715327],[104.383408725189,30.0670318435675],[104.383401398581,30.0670092310054],[104.383394033241,30.0669866076156],[104.383379238605,30.0669414165318],[104.3833719174,30.0669189496562],[104.383364634921,30.0668964099679],[104.383357270453,30.0668734070574],[104.383342191065,30.0668260294636],[104.383327799022,30.0667808728807],[104.383320957937,30.0667594586153],[104.383299647331,30.0666929290513],[104.383292361217,30.0666701528208],[104.383277932212,30.0666249152413],[104.383270712754,30.0666023252226],[104.383263446456,30.0665797360601],[104.383248878737,30.0665348113059],[104.383241675492,30.0665124074528],[104.383234443402,30.0664895835911],[104.38321912789,30.0664409358872],[104.383195639798,30.0663670901738],[104.383188053668,30.0663433891529],[104.383180380156,30.0663194911022],[104.383165444824,30.0662731162804],[104.383158453254,30.0662513043442],[104.383143425098,30.0662041731026],[104.383134566939,30.0661765346286],[104.383125097098,30.0661471239543],[104.383098273057,30.0660635149116],[104.383090452674,30.0660391148871],[104.383083128663,30.0660162297516],[104.383068965294,30.0659718628406],[104.383054420851,30.0659263183773],[104.38304735177,30.0659041421212],[104.383033588358,30.0658608925002],[104.383026476031,30.0658386226715],[104.38301195679,30.0657932041132],[104.382997889773,30.0657491403224],[104.382972577254,30.0656703843242],[104.382963086625,30.0656407613384],[104.38293939831,30.0655665339232],[104.382932473339,30.0655448793712],[104.382917674779,30.0654987023906],[104.382909657951,30.0654736942021],[104.382885973198,30.0653996627966],[104.382871516942,30.0653545562859],[104.382864356823,30.0653321460801],[104.382857184986,30.06530959377],[104.382842847607,30.0652643947215],[104.382835661348,30.0652417596558],[104.382821232978,30.065196495764],[104.382799458905,30.0651287036655],[104.38278535123,30.0650845551969],[104.382761096093,30.0650084574428],[104.382735327456,30.0649275055893],[104.382728389812,30.0649057493532],[104.382713543383,30.0648593653801],[104.382696315025,30.0648054672541],[104.382679852397,30.0647539098322],[104.382658079078,30.0646856167064],[104.382629268979,30.0645953945451],[104.382607601029,30.0645276320731],[104.382564283995,30.0643922860607],[104.382534384628,30.0642987910996],[104.382513584146,30.0642337488787],[104.382491906191,30.0641660663487],[104.382477379438,30.0641207176571],[104.382470147138,30.0640981292216],[104.382455673526,30.0640529973028],[104.382448459237,30.0640304448509],[104.382433958579,30.06398507098],[104.382426679422,30.0639623592843],[104.382412558935,30.0639183832881],[104.382405480669,30.0638962851045],[104.382397618627,30.0638717013906],[104.382368200117,30.0637793038611],[104.382359036279,30.06375065853],[104.382351101259,30.0637260189788],[104.382343923887,30.0637038145699],[104.382336904165,30.0636820446737],[104.382329772726,30.0636597962367],[104.382315287317,30.0636145059561],[104.382308036053,30.063591905771],[104.382293663248,30.0635470841267],[104.382271209438,30.0634770202254],[104.382252836662,30.06341994889],[104.382225284651,30.0633337528185],[104.382210737027,30.0632884228577],[104.382203675821,30.0632663974844],[104.382189220968,30.0632211539324],[104.382181921918,30.0631983396339],[104.382167832816,30.0631542700165],[104.382161046366,30.0631329634401],[104.382144644643,30.0630814642209],[104.382133770823,30.0630474717005],[104.382122008717,30.0630107911969],[104.3821110421,30.0629766304099],[104.38209482595,30.0629261394679],[104.382088388133,30.0629060427777],[104.382072260248,30.0628556607218],[104.382038765713,30.0627510805331],[104.382029383735,30.0627216965551],[104.382013630569,30.0626720846286],[104.381998543162,30.0626246145844],[104.381984037739,30.06257917573],[104.381976862055,30.0625567796761],[104.381955160226,30.0624892612916],[104.381947932278,30.0624666169703],[104.381940579999,30.0624435066855],[104.381933037628,30.0624198107667],[104.381925429495,30.0623960410408],[104.381911338464,30.0623522896536],[104.38190475015,30.0623317449223],[104.381888078893,30.0622794485106],[104.381877030181,30.0622447947318],[104.381832552401,30.0621053141673],[104.381825402793,30.0620828272687],[104.381807844977,30.0620274848955],[104.381798230473,30.06199722469],[104.381788897955,30.0619679719798],[104.381770827515,30.0619114339126],[104.381761452638,30.0618819221506],[104.38174341099,30.0618250981103],[104.381735612707,30.0618007202178],[104.38171433411,30.0617347272891],[104.381689686068,30.0616578917166],[104.381681629215,30.0616328903402],[104.381667446164,30.0615890317282],[104.381659979396,30.0615657378034],[104.381651394585,30.0615388032905],[104.381632782587,30.0614803382908],[104.381592835101,30.0613553424154],[104.381558849814,30.0612487881033]]]}},{type:"Feature",properties:{id:"10676",r_s_id:"2951",z_order:0,rid:"47",category:1,type:1,jun_id:null,ft_type_no:null,lane_no:"14",pre_id:[10891,10991],suc_id:[10659],l_boun_id:"17483",r_boun_id:"17484",width:3.87,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.38438374887566,30.069862738900547],[104.384372815014,30.0698349051767],[104.384363914295,30.069812267261],[104.384346124555,30.0697669662499],[104.384328395148,30.0697216769694],[104.384302326176,30.0696550695141],[104.384292797567,30.0696305955386],[104.384282125838,30.0696030575189],[104.384270732556,30.0695734324686],[104.384259627512,30.0695442815977],[104.384240643164,30.0694942895679],[104.384232155837,30.069472174463],[104.384223634285,30.0694501303726],[104.384215003733,30.0694277912112],[104.384206401096,30.0694053801253],[104.384197816465,30.0693828854154],[104.384171067153,30.0693124236842],[104.384128336641,30.0691995886917],[104.384118789021,30.0691745058022],[104.384109809805,30.069150901871],[104.384101872811,30.0691299338243],[104.384094409629,30.0691100174809],[104.384076138543,30.0690608668076],[104.384064730706,30.0690301903582],[104.384042652781,30.0689708804248],[104.384018707452,30.0689064454671],[104.384011296484,30.0688865003679],[104.384002600955,30.0688630459311],[104.383991752481,30.0688337287985],[104.38397892221,30.0687989448138],[104.383965601879,30.0687625982891],[104.383953605728,30.068729656809],[104.383927755013,30.0686583862274],[104.3839194702,30.0686354878951],[104.383910610658,30.0686109055448],[104.383883577088,30.0685356040655],[104.383848277547,30.0684369977313],[104.383824116621,30.0683695595998],[104.383816031744,30.0683469626803],[104.383791828428,30.0682789776993],[104.383775941488,30.068234137515],[104.383767807936,30.0682110890822],[104.383759444668,30.068187316498],[104.383728231021,30.0680985673616],[104.38371869215,30.0680712801154],[104.383707023706,30.0680376472377],[104.383694331006,30.0680009512922],[104.383682513905,30.0679667148336],[104.383664663926,30.0679149841137],[104.383657292417,30.0678936144357],[104.383649829018,30.0678719191232],[104.383634360801,30.0678267060051],[104.383611193138,30.0677589582874],[104.383603454963,30.0677363148432],[104.383565132466,30.0676235053017],[104.383541690856,30.0675543543529],[104.383518648278,30.0674860050245],[104.38349537775,30.0674166527393],[104.383475915062,30.0673586648393],[104.383466575127,30.0673308111112],[104.383457634258,30.0673040620909],[104.38344862942,30.0672769946532],[104.383439517367,30.0672493713408],[104.383415182794,30.067175260669],[104.383407636401,30.0671523808184],[104.383391439169,30.0671032647895],[104.383383661242,30.0670795042978],[104.38337662921,30.067057885733],[104.383370071918,30.0670376174586],[104.383356393391,30.0669952125278],[104.383327083272,30.066904469931],[104.383319684569,30.0668815434223],[104.383312144427,30.0668581329544],[104.383282074806,30.0667643859227],[104.383266532336,30.0667156472128],[104.383244288395,30.0666461975995],[104.383228536003,30.0665968030812],[104.383220975104,30.0665731218761],[104.383207543322,30.0665313079426],[104.383200959851,30.0665107437304],[104.38319400702,30.0664888976629],[104.383186779423,30.0664661304497],[104.383179550024,30.0664434090983],[104.383172496293,30.0664212886445],[104.383165457878,30.0663992878117],[104.383157956422,30.0663758854307],[104.383130541455,30.0662905276215],[104.383121395016,30.0662620048586],[104.383105885784,30.0662134900199],[104.38309905815,30.0661921062893],[104.383085410083,30.066149363111],[104.383078286961,30.0661270600106],[104.383063703796,30.0660815991537],[104.383056405006,30.0660589064873],[104.383041937135,30.0660136966312],[104.383034834718,30.0659914304104],[104.383020662313,30.0659470481782],[104.382985374506,30.065836603057],[104.382962426714,30.0657644663338],[104.382955405355,30.0657424951414],[104.382933420637,30.0656749394773],[104.382926059662,30.0656523123719],[104.382904358638,30.0655845024321],[104.382897224649,30.0655620571844],[104.382882757567,30.0655164524474],[104.38287526863,30.0654929258971],[104.382853135151,30.0654238960566],[104.382845929087,30.065401449832],[104.382838624825,30.0653786689715],[104.38282427664,30.0653337621816],[104.38281052031,30.0652904962705],[104.3827962883,30.065245502337],[104.382789157883,30.0652230570653],[104.382782126569,30.0652011370822],[104.382766983813,30.0651544489009],[104.382758084988,30.0651268381512],[104.382748691558,30.0650972088855],[104.382731385687,30.065041753093],[104.382709415109,30.0649725919869],[104.382694923608,30.0649271858813],[104.382686859855,30.064901861927],[104.382623295704,30.0647031309347],[104.382594393671,30.0646125264441],[104.382587176717,30.0645899281595],[104.382572715777,30.0645446731046],[104.382551072993,30.0644767793113],[104.382529356338,30.0644091093644],[104.382522118649,30.0643865146417],[104.382507684698,30.0643413279265],[104.382500450605,30.0643187448927],[104.38248590404,30.0642733952877],[104.38247866093,30.0642507295029],[104.382464570189,30.0642065682997],[104.382440709353,30.0641322341916],[104.382413525109,30.0640471681785],[104.382391983106,30.0639800180915],[104.382368392454,30.0639062219612],[104.382353129598,30.0638584668598],[104.382327044362,30.0637772139744],[104.382294750142,30.0636761766941],[104.38228769437,30.0636542592644],[104.38227318643,30.063609257622],[104.382265907228,30.063586580059],[104.382251423582,30.0635412627676],[104.382244156984,30.0635185879087],[104.38223687147,30.0634959364127],[104.382222295033,30.0634507242413],[104.382215041941,30.0634281105409],[104.38220781767,30.0634054671878],[104.382179162008,30.0633157069617],[104.382148154094,30.0632190278911],[104.382140590167,30.0631953463959],[104.382115857837,30.0631178510125],[104.382104111036,30.0630811669181],[104.382091602979,30.0630422769901],[104.382063774235,30.0629556389419],[104.382050105791,30.0629129438115],[104.382028370682,30.0628451142873],[104.382021131045,30.0628224807652],[104.382006741855,30.0627774898894],[104.381992171578,30.0627320015162],[104.381984639137,30.0627084297257],[104.381962707551,30.062639464132],[104.381955882304,30.0626179901978],[104.381934634495,30.0625515154265],[104.38192003986,30.0625061142277],[104.381905605563,30.0624608840409],[104.381891237917,30.0624157087671],[104.38188400635,30.0623931336735],[104.381869484658,30.0623479231721],[104.381862299029,30.0623254290544],[104.381855125106,30.0623029070669],[104.381825401455,30.0622095158479],[104.381761507166,30.0620089866945],[104.381754271953,30.0619862667748],[104.381739842963,30.061940972658],[104.381732660895,30.0619183768884],[104.381711165137,30.0618508684042],[104.381703996584,30.0618285118584],[104.381696688388,30.0618057387961],[104.381672838549,30.0617316405785],[104.381649844573,30.0616605855345],[104.381635676833,30.0616170578694],[104.381628078532,30.0615935686606],[104.381600884403,30.0615084299215],[104.381592021199,30.0614808287347],[104.381576945271,30.061433782957],[104.3815629342,30.0613896636532],[104.381555744877,30.061367094812],[104.381541243712,30.0613218221112],[104.381534137271,30.0612995824928],[104.381527176771,30.0612776820529],[104.381520864029,30.0612577876997]]]}},{type:"Feature",properties:{id:"10645",r_s_id:"2938",z_order:0,rid:"45",category:6,type:3,jun_id:"627",ft_type_no:"t",lane_no:"14",pre_id:null,suc_id:null,l_boun_id:"17440",r_boun_id:"17439",width:3.4,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.37906275580687,30.05267558271077],[104.379074480498,30.0527120608022],[104.379081743486,30.0527347877091],[104.379103049525,30.0528019912648],[104.379110296286,30.0528246632897],[104.379124718616,30.0528696061659],[104.379131692377,30.0528915989212],[104.379146394949,30.0529383416069],[104.379155092312,30.0529655971278],[104.379164690656,30.0529953069062],[104.37917449712,30.0530255133176],[104.379183765691,30.0530542029266],[104.379192177423,30.0530805345457],[104.379207197101,30.0531279960803],[104.37921438437,30.0531505097391],[104.379221613972,30.0531729245146],[104.379236197497,30.0532178728976],[104.379243500073,30.0532404721024],[104.379265290675,30.053308283076],[104.379279863379,30.0533535219055],[104.379287099281,30.0533761740911],[104.379301453966,30.0534214738406],[104.379308632201,30.0534440135474],[104.379330286705,30.0535115158685],[104.379337894706,30.0535353708075],[104.379361066495,30.0536084063498],[104.379368730349,30.0536324438991],[104.379377529443,30.0536598496441],[104.379388067441,30.0536924938778],[104.379410894038,30.0537629587829],[104.379420400389,30.0537924219719],[104.379428140813,30.0538167707471],[104.379434918095,30.0538385366032],[104.379441570147,30.0538601062793],[104.37944848708,30.0538823255297],[104.379455685101,30.0539050163061],[104.379462978609,30.053927656816],[104.379470290131,30.0539502757588],[104.379477562014,30.0539729027533],[104.379484798761,30.0539955261132],[104.379492058028,30.0540181467961],[104.37950666123,30.0540632740294],[104.379513929497,30.0540858452537],[104.379521123891,30.0541084244951],[104.379535409076,30.0541535882636],[104.379542594458,30.0541761899736],[104.379549832989,30.0541988223124],[104.379571646763,30.0542666852436],[104.379578889791,30.0542893400628],[104.379600320652,30.0543566575993],[104.379646750197,30.0545020025918],[104.379654048159,30.0545246970178],[104.379668574686,30.0545695596943],[104.379675874441,30.0545922001578],[104.379683109334,30.0546148576411],[104.37969740704,30.0546599718812],[104.379704594176,30.0546825150978],[104.379719100873,30.0547277257648],[104.379726342059,30.0547503769486],[104.379733551714,30.0547730397899],[104.379747888135,30.0548182637611],[104.379755054537,30.0548408069445],[104.379762282196,30.0548633474898],[104.379769619758,30.0548859465995],[104.379784376848,30.0549310081996],[104.379791516193,30.0549530702125],[104.379798560046,30.0549751339265],[104.379814272222,30.0550246067193],[104.379823597345,30.055053802499],[104.37985170062,30.0551415626175],[104.379859578763,30.0551662675468],[104.379895574573,30.0552793396035],[104.379916988965,30.0553467612134],[104.379931385642,30.0553919887526],[104.379938978149,30.0554157409986],[104.379946951762,30.0554406015816],[104.379970796891,30.0555146670341],[104.379992414816,30.0555821913143],[104.379999621689,30.0556047308811],[104.380006820457,30.0556273729602],[104.38002108195,30.055672408766],[104.380028216735,30.0556946793583],[104.380035589362,30.0557174160317],[104.380043333178,30.0557411144425],[104.380059834384,30.0557914961994],[104.380067977322,30.0558164531448],[104.380075664376,30.0558401694768],[104.38008291807,30.0558627099691],[104.380090000581,30.0558847997317],[104.380097221842,30.0559073590737],[104.380104760246,30.0559310104996],[104.380120537113,30.0559808204361],[104.380128502566,30.0560057439137],[104.380136558098,30.0560306306066],[104.380144700117,30.0560557116355],[104.380152796198,30.0560809455004],[104.380160601284,30.0561056979399],[104.38016802707,30.0561294571557],[104.380175253732,30.0561523995927],[104.380182417307,30.0561747789933],[104.380196528202,30.0562184772805],[104.380203318775,30.0562397483484],[104.380210132776,30.0562612145895],[104.380217293644,30.0562836866084],[104.380225109501,30.0563080163626],[104.380243217945,30.0563641759171],[104.380253255569,30.0563954550821],[104.380292210474,30.0565173473761],[104.380319559156,30.0566030828379],[104.380327362371,30.0566274242434],[104.380341664199,30.05667188437],[104.380348776376,30.0566941575597],[104.380370283196,30.0567619278637],[104.380377508886,30.0567845599856],[104.380384768806,30.056807188542],[104.380391957542,30.0568294779842],[104.380406304367,30.056873760958],[104.380414167916,30.0568981932306],[104.380422945943,30.0569256903716],[104.380441646211,30.0569844341213],[104.380450118799,30.0570108418817],[104.380464837694,30.0570564453889],[104.380471944426,30.0570785944375],[104.380479173693,30.0571012634096],[104.380521496954,30.0572343264152],[104.38052907938,30.0572580937864],[104.380536635671,30.0572816596831],[104.380551287849,30.0573271182912],[104.380558504474,30.0573496001734],[104.380580175975,30.0574174757037],[104.380587397098,30.0574400205352],[104.380601907806,30.0574852181778],[104.380623634207,30.0575527996528],[104.380630637289,30.0575746769678],[104.380645604767,30.0576215657496],[104.380654416947,30.0576490727466],[104.380681439972,30.0577331033462],[104.38068950796,30.0577583424305],[104.380697985883,30.057784997436],[104.380716624698,30.0578437661301],[104.380725749492,30.0578724497158],[104.380734349923,30.0578993134712],[104.380760634081,30.057980835984],[104.380770378688,30.0580110031307],[104.380788681343,30.0580675231605],[104.380796233948,30.0580909522901],[104.380817098904,30.0581562656075],[104.380831584261,30.0582014855937],[104.380838743156,30.0582239961285],[104.380853510522,30.0582706588808],[104.380861024381,30.0582942390411],[104.380882864087,30.0583622817812],[104.380904341592,30.0584290983862],[104.380912210406,30.058453771546],[104.380930211199,30.0585105142255],[104.380939597187,30.058539953422],[104.380948468726,30.0585676033784],[104.380964030621,30.0586159863342],[104.380977973533,30.0586595419885],[104.380985140483,30.0586818051828],[104.381002005996,30.0587339224375],[104.381011554114,30.0587636099782],[104.381020865291,30.0587927576978],[104.381029280938,30.0588191751269],[104.381036792039,30.0588426617101],[104.381044958109,30.0588680221976]]]}},{type:"Feature",properties:{id:"10658",r_s_id:"2950",z_order:0,rid:"47",category:1,type:1,jun_id:null,ft_type_no:null,lane_no:"12",pre_id:[10675],suc_id:[10650],l_boun_id:"17455",r_boun_id:"17456",width:3.8,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.381558849814,30.0612487881033],[104.381543881967,30.0612018584225],[104.381535554779,30.0611757173157],[104.38151884904,30.0611232264047],[104.381505092905,30.0610800920659],[104.381485174477,30.0610177694657],[104.381436209452,30.0608648617406],[104.381413942266,30.060795208333],[104.381373232245,30.0606675881229],[104.38131960292,30.0605002345408],[104.381310095449,30.0604704599052],[104.38129538422,30.0604243325303],[104.381284927169,30.0603917367245],[104.381271116867,30.0603487272276],[104.381237022172,30.060242550145],[104.381218919825,30.0601862787982],[104.381185725088,30.0600828778062],[104.381172760698,30.060042350286],[104.381166079393,30.0600214077988]]]}},{type:"Feature",properties:{id:"10653",r_s_id:"2936",z_order:0,rid:"45",category:6,type:1,jun_id:null,ft_type_no:null,lane_no:"14",pre_id:null,suc_id:null,l_boun_id:"17450",r_boun_id:"17449",width:3.4,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.381044958109,30.0588680221976],[104.381050969142,30.0588866896956],[104.381058045082,30.0589087738204],[104.381072198774,30.0589532577265],[104.38108000447,30.0589777302325],[104.381088800287,30.0590052181961],[104.381107602756,30.0590638069325],[104.381130801744,30.059135769112],[104.381145086915,30.059180297175],[104.38115960813,30.0592257625449],[104.381166611075,30.059247820493],[104.381180558406,30.0592919183419],[104.381188575791,30.0593171320579],[104.381207296217,30.0593757620196],[104.381231715912,30.059452386443],[104.381239119739,30.0594754726752],[104.381255238228,30.0595255116477],[104.381270493614,30.0595727798928],[104.381284503906,30.059616070165],[104.381291885193,30.0596390250619],[104.381299473699,30.0596628246128],[104.38130698293,30.0596865521408],[104.381321217587,30.0597317194829],[104.381328082649,30.0597534193326],[104.381335202665,30.0597757876155],[104.381343050621,30.0598003032578],[104.381370790057,30.0598865848846],[104.381379260537,30.0599129905727],[104.381386784148,30.0599365337338],[104.3814079108,30.0600028397189],[104.381415030795,30.0600252250691],[104.381422195837,30.0600478334908],[104.381437507027,30.0600962834027],[104.381437813341,30.0600972504584]]]}},{type:"Feature",properties:{id:"10660",r_s_id:"2950",z_order:0,rid:"47",category:6,type:1,jun_id:null,ft_type_no:null,lane_no:"15",pre_id:null,suc_id:null,l_boun_id:"17457",r_boun_id:"17458",width:3.4,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.38148496079,30.0612662936904],[104.381467618986,30.0612122076584],[104.381458153011,30.0611825293372],[104.381450368141,30.0611579130607],[104.381422505264,30.0610690773268],[104.381404674145,30.0610119007404],[104.381395572994,30.0609828117972],[104.381387207008,30.0609563423595],[104.381379684297,30.0609327982984],[104.381365900168,30.060889778079],[104.381350983563,30.0608430668798],[104.381342133785,30.0608154989035],[104.381332553361,30.0607857952514],[104.381323076548,30.0607565935135],[104.381306992373,30.0607074260459],[104.381300054351,30.0606859599424],[104.381292818098,30.060663070834],[104.381275545471,30.0606078093454],[104.381266221757,30.0605782893766],[104.381257438611,30.0605507547125],[104.381234575761,30.0604793496273],[104.381227249416,30.0604566025086],[104.381220064526,30.0604345363059],[104.381213088654,30.0604132212307],[104.381206260524,30.0603921805866],[104.381199373814,30.0603705643221],[104.38118375255,30.060320916993],[104.381174438721,30.0602916056455],[104.381138384362,30.060179113366],[104.381116725967,30.0601117796492],[104.381102146174,30.0600663043057],[104.38109337018,30.0600388307522]]]}},{type:"Feature",properties:{id:"10661",r_s_id:"2949",z_order:0,rid:"45",category:6,type:1,jun_id:null,ft_type_no:null,lane_no:"14",pre_id:null,suc_id:null,l_boun_id:"17460",r_boun_id:"17459",width:3.4,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.381437813341,30.0600972504584],[104.381454526352,30.0601500229064],[104.381462940961,30.0601765445289],[104.381470840236,30.0602013569594],[104.381478271021,30.0602245195977],[104.381493206439,30.0602705931296],[104.381501195782,30.0602953786575],[104.381509326578,30.0603208468982],[104.381517260975,30.0603457825556],[104.381524845806,30.060369472327],[104.381539252363,30.0604140093026],[104.381546482226,30.0604365790838],[104.381553983276,30.0604603020433],[104.381561819472,30.0604852016231],[104.381569861068,30.0605106023139],[104.381577830576,30.0605355200014],[104.381592809197,30.0605821097301],[104.38160711394,30.0606269379544],[104.381621081727,30.0606705850516],[104.381628278237,30.0606931403918],[104.381645336171,30.0607469391739],[104.381654925505,30.0607770761987],[104.381664131038,30.0608058324085],[104.381672325738,30.0608312961666],[104.381701305351,30.0609210239221],[104.381710112663,30.0609484937206],[104.381719623593,30.0609783779423],[104.381746548264,30.0610635729678],[104.381761596184,30.0611109972395],[104.381775804453,30.0611559071273],[104.381782935155,30.0611783049869],[104.381797415454,30.0612233751968],[104.381804657858,30.0612460303599],[104.381819020152,30.0612912947011],[104.381826232822,30.0613138886775],[104.381848046468,30.0613816599677],[104.381855288855,30.0614042512665],[104.381884138583,30.0614947170554],[104.381898577392,30.0615398636176],[104.381905830574,30.0615624693027],[104.381913115281,30.0615850660222],[104.381927792792,30.061630488882],[104.381935044167,30.0616531548123],[104.381948945125,30.0616969959402],[104.381955787486,30.0617184222266],[104.381970364978,30.0617636525178],[104.38197803075,30.061787499625],[104.382007194736,30.0618785888082],[104.382034359599,30.0619636264056],[104.382043201928,30.0619911455966],[104.382051124427,30.0620156449267],[104.382065503652,30.0620599603806],[104.382072678405,30.0620822493914],[104.382079900012,30.0621048729895],[104.382094309893,30.0621501902964],[104.382108763895,30.0621953277734],[104.382115908915,30.062217721966],[104.382130275535,30.0622629645715],[104.382137871899,30.0622867872903],[104.3821611006,30.0623593242282],[104.382168264516,30.0623815880241],[104.382182605848,30.0624260373824],[104.382190128316,30.0624494679171],[104.382206454323,30.0625005056876],[104.382224753273,30.0625576273431],[104.382233650499,30.0625855404264],[104.382249261191,30.0626348031628],[104.382256392657,30.062657132557],[104.382270319529,30.0627002945681],[104.382277229363,30.0627217909862],[104.382291761637,30.0627671514729],[104.382307033518,30.0628144695437],[104.382314423515,30.0628374529637],[104.382321603613,30.0628599865311],[104.382328712544,30.0628823977244],[104.382335890833,30.0629048755288],[104.382343235769,30.0629275207569],[104.382350686992,30.0629501525905],[104.382358189558,30.0629728429248],[104.382365545288,30.0629953055956],[104.382372638877,30.0630173768221],[104.382386969326,30.0630627361766],[104.38239513858,30.0630884128425],[104.382414089628,30.0631474352287],[104.382424120098,30.0631787963688],[104.382434009131,30.0632098399174],[104.382443451317,30.0632394072761],[104.382452159267,30.0632664405867],[104.382467135552,30.0633126647328],[104.382473876872,30.0633337589551],[104.382487637903,30.0633772984222],[104.382494776511,30.0633997069032],[104.382501810604,30.0634215541134],[104.382508639288,30.0634426448096],[104.382515540946,30.0634640629218],[104.382522920982,30.0634872171489],[104.382539793636,30.0635405466849],[104.382548984441,30.0635694231049],[104.382558366219,30.0635986828043],[104.382567963295,30.063628425629],[104.382597297715,30.0637189558876],[104.382606592985,30.0637478332829],[104.382615836909,30.0637767070315],[104.382634386013,30.0638347684365],[104.382642883097,30.063861287988],[104.382650801811,30.0638858941667],[104.382669460767,30.0639436948462],[104.382682177546,30.0639833626153],[104.382696183489,30.0640273977263],[104.382708857942,30.0640675456807],[104.382726745795,30.064124859996],[104.382729464647,30.064133572332],[104.382732187101,30.064142284671],[104.38276153109,30.0642296644607],[104.382773277574,30.0642661351428],[104.382809960203,30.0643803337226],[104.382817619423,30.0644043541663],[104.382833790991,30.0644552934127],[104.382843196088,30.064484692433],[104.382871199629,30.0645716931937],[104.382878886752,30.0645956884649],[104.382886212628,30.0646186509945],[104.382911949582,30.0646995837913],[104.382921783465,30.0647303672182],[104.382947023972,30.0648090449512],[104.38296108471,30.0648530458064],[104.382996973437,30.0649655518198],[104.383012596236,30.0650142062094],[104.383020752666,30.0650396848342],[104.383028673979,30.0650646533345],[104.383036171889,30.0650884361558],[104.383043357193,30.0651111503081],[104.383050417263,30.0651332141409],[104.383064772503,30.0651776612678],[104.383072477578,30.0652016106372],[104.383080807856,30.0652276532711],[104.383089613793,30.0652553186931],[104.383106650918,30.0653090608247],[104.383114233477,30.0653329183437],[104.383121365595,30.0653551998574],[104.383128424733,30.0653770586256],[104.383135733398,30.0653995120618],[104.383151617322,30.0654481702034],[104.383159870088,30.0654737091276],[104.383167870626,30.0654987927717],[104.383175380204,30.0655225962506],[104.383182401518,30.0655449262141],[104.383189140854,30.0655662450939],[104.383195904505,30.0655874740618],[104.383232927051,30.0657030618391],[104.383240149218,30.0657255610371],[104.383254637679,30.0657705234939],[104.38326190308,30.0657931405351],[104.383276362718,30.0658383682539],[104.383283621807,30.0658609610023],[104.383298226447,30.0659061519656],[104.383305517959,30.0659288346687],[104.383312777948,30.0659515928848],[104.383327041181,30.0659964426916],[104.383333974146,30.0660180350995],[104.383348084182,30.066061538483],[104.383355503596,30.0660845162615],[104.383363054542,30.0661081317696],[104.383378087982,30.0661555470797],[104.383385551544,30.0661789898362],[104.383427137527,30.0663091161272],[104.383442258289,30.0663563336298],[104.383477945397,30.0664674557056],[104.383486405262,30.0664939111196],[104.383502173707,30.0665433630599],[104.383516787252,30.0665891150918],[104.383538266147,30.0666565493464],[104.383545528765,30.0666792166738],[104.383566948142,30.0667456616057],[104.383583039917,30.0667956677617],[104.383601535141,30.0668533687585],[104.383627437991,30.0669343828852],[104.383636692345,30.0669632742953],[104.383645949394,30.0669920793702],[104.383654523596,30.0670186175701],[104.383669031616,30.0670632587744],[104.383683019848,30.0671063886676],[104.383692099398,30.067134287961],[104.383703358964,30.0671687082902],[104.383745282073,30.0672965600291],[104.383752168949,30.0673173716867],[104.383758946812,30.0673376256716],[104.383774605062,30.0673841734681],[104.383784647529,30.0674141249055],[104.38379608268,30.0674483214189],[104.383818026019,30.0675140858277],[104.383826628042,30.0675397453658],[104.383833931955,30.0675612849102],[104.383848453277,30.0676036957259],[104.383857538119,30.0676304861118],[104.38388030833,30.0676980183416],[104.38389171639,30.0677316572158],[104.383901501146,30.0677602711049],[104.383917146645,30.06780572614],[104.383932120131,30.0678494485049],[104.38393960146,30.0678711689365],[104.383947017917,30.0678924936109],[104.383962737222,30.067937456757],[104.383980391487,30.0679882140533],[104.383989385261,30.0680139611102],[104.383997994374,30.0680384047245],[104.384014108173,30.0680838430185],[104.384022692952,30.0681081508074],[104.384053013514,30.0681942863283],[104.38406234235,30.068220661371],[104.384070712709,30.0682441712677],[104.384086465213,30.068288116345],[104.384094477036,30.0683105206681],[104.384110710567,30.0683560174637],[104.384118851193,30.0683786736982],[104.384134673912,30.0684224398437],[104.384142401958,30.0684439140176],[104.384158657966,30.0684892174511],[104.38416722105,30.0685129442179],[104.384183957153,30.0685591644485],[104.384200718473,30.0686055699498],[104.384227438176,30.0686791954206],[104.384236335433,30.0687037911896],[104.384246009176,30.0687304272647],[104.384256681893,30.0687595265121],[104.384267552769,30.0687888777318],[104.384285729125,30.0688377170312],[104.384303445164,30.068885419193],[104.384340701297,30.0689852325743],[104.38435950726,30.0690358251254],[104.384367516244,30.0690572086419],[104.384375728796,30.0690789295714],[104.384392940274,30.0691241950004],[104.384401550066,30.0691469252903],[104.384410089597,30.0691695565936],[104.384418589493,30.0691921509889],[104.384443954957,30.0692598234307],[104.384452466551,30.0692824277178],[104.384461033985,30.0693050527336],[104.38446964555,30.069327707461],[104.384478273325,30.0693503478103],[104.384486912803,30.0693729557913],[104.384495577497,30.069395542207],[104.384504271909,30.0694181169537],[104.384521752596,30.069463306985],[104.384548010528,30.0695310295394],[104.384556802197,30.0695536574104],[104.384565635295,30.0695762844139],[104.384574512522,30.0695988952637],[104.384583422169,30.0696214899498],[104.384592347123,30.069644062163],[104.384610248362,30.0696892443945],[104.384619194026,30.0697118984541],[104.38462808835,30.0697345893401],[104.384645688741,30.0697798594316],[104.384654512796,30.0698024162524],[104.3846577580783,30.069810625124983]]]}},{type:"Feature",properties:{id:"10677",r_s_id:"2951",z_order:0,rid:"47",category:6,type:1,jun_id:null,ft_type_no:null,lane_no:"15",pre_id:null,suc_id:null,l_boun_id:"17484",r_boun_id:"17485",width:3.4,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.38434757481245,30.06986961884105],[104.384342996193,30.0698580474038],[104.384331671435,30.0698293478339],[104.384319117984,30.0697973961904],[104.384306598751,30.0697654346775],[104.384285718334,30.0697120605439],[104.384268606822,30.0696681881714],[104.384251189919,30.0696233442671],[104.384242410745,30.0696006182818],[104.384233701822,30.0695779148359],[104.384216469514,30.0695326070182],[104.384207837146,30.0695100016547],[104.38419915614,30.0694874645954],[104.384190403071,30.0694648303461],[104.384181691432,30.0694422240079],[104.384173147333,30.0694199154833],[104.384146888053,30.0693512240007],[104.384136520705,30.0693238984221],[104.384125321001,30.0692941835446],[104.384114013192,30.0692641151387],[104.384103229651,30.0692355265518],[104.384083485794,30.0691833664123],[104.384074285856,30.0691589331106],[104.384065811058,30.0691363152467],[104.384042308968,30.0690734499956],[104.38401226336,30.0689928230098],[104.383972531284,30.0688860823149],[104.383957194054,30.0688448255847],[104.383946569865,30.0688161714234],[104.383938624685,30.0687946079746],[104.383930237193,30.0687716502023],[104.383919061666,30.0687408974499],[104.383904695433,30.0687012414095],[104.383888664476,30.0686568751056],[104.383873224442,30.0686140705155],[104.383848764487,30.0685461968779],[104.383839206781,30.0685196075267],[104.38383047782,30.068495180845],[104.383813054106,30.0684461152639],[104.383803250449,30.0684185778079],[104.383792743251,30.06838917096],[104.383764847456,30.0683113334454],[104.383757046316,30.0682894499123],[104.383748626298,30.0682656538934],[104.383718245903,30.0681792904546],[104.383692124598,30.0681052279386],[104.383684868418,30.0680844923863],[104.383677339275,30.0680627961246],[104.383658662329,30.0680086653048],[104.383628725847,30.0679217166983],[104.383613465727,30.0678774822061],[104.383606044654,30.0678559011318],[104.383579847446,30.0677791530832],[104.383562506352,30.0677286098396],[104.383554969049,30.067706548415],[104.383524983732,30.0676180699163],[104.383503764463,30.0675556360763],[104.383495645191,30.0675316702729],[104.383488380807,30.0675100866063],[104.383481155151,30.067488484086],[104.383458581819,30.0674207484521],[104.383413708071,30.0672865651913],[104.38340587972,30.0672629845248],[104.38338751415,30.0672073924067],[104.38336851348,30.0671501134991],[104.383360422963,30.0671256296751],[104.383353139594,30.0671034038444],[104.383346102148,30.0670817753745],[104.383338859302,30.0670594191746],[104.383331208364,30.067035721732],[104.383306981719,30.0669604842161],[104.383262987612,30.0668242636364],[104.38325559519,30.066801231896],[104.383248047812,30.0667775947763],[104.383226184895,30.0667088577434],[104.383204844477,30.0666421931825],[104.383197271856,30.0666183833581],[104.383183021147,30.0665732924754],[104.383176265596,30.066551979873],[104.383169293845,30.0665301706545],[104.38314310227,30.0664488680616],[104.383132007276,30.0664142956664],[104.38310091135,30.0663172389427],[104.383079228508,30.0662497538058],[104.383072060345,30.0662273931073],[104.383064834517,30.0662047032056],[104.383057670839,30.0661820331423],[104.383050554901,30.0661594458569],[104.383043376809,30.0661368099512],[104.383036094227,30.0661141352801],[104.383021917348,30.0660703888614],[104.383015070778,30.0660490392675],[104.382997924596,30.0659951836645],[104.382957092826,30.0658675305251],[104.382944237443,30.0658272323302],[104.382925525496,30.0657683022362],[104.382918165401,30.0657453055099],[104.382910856674,30.0657228852901],[104.38290341193,30.0657004190814],[104.38289606178,30.0656783306688],[104.382888944038,30.0656566948187],[104.38288193438,30.0656349772259],[104.382874856239,30.0656127298722],[104.382846534625,30.0655232341157],[104.382838755593,30.0654987270395],[104.382829977497,30.0654712225397],[104.382820506635,30.0654416948509],[104.382802707213,30.0653863699584],[104.382788119382,30.0653408675864],[104.382781064641,30.0653187857047],[104.382773888276,30.0652962207784],[104.382759525617,30.0652507815465],[104.382752362759,30.0652282651901],[104.382745117032,30.0652057829313],[104.382730382361,30.0651606068496],[104.382723051949,30.0651379374509],[104.382715858447,30.0651152483888],[104.382708830681,30.0650925702662],[104.382695043572,30.0650473689404],[104.382688058142,30.0650248356408],[104.382680918682,30.0650022914087],[104.382666379433,30.0649570570146],[104.382659121061,30.0649343678796],[104.382644866457,30.0648895950814],[104.382637891854,30.0648677686426],[104.382613986141,30.0647933195257],[104.382604541319,30.06476381607],[104.382579083335,30.064684054151],[104.38256328909,30.0646346996941],[104.382547253391,30.0645844357996],[104.382517434157,30.0644906423182],[104.382509809979,30.064466714453],[104.382501911035,30.064442060587],[104.382484000581,30.0643864395188],[104.382474547608,30.0643570187498],[104.38246585047,30.0643298775355],[104.382434891538,30.0642329506084],[104.382425404308,30.0642033211503],[104.382399968686,30.0641240932861],[104.382392972395,30.0641022110099],[104.382379194212,30.064058993433],[104.382371720445,30.064035637634],[104.382353891875,30.0639801766374],[104.382344029845,30.0639494019787],[104.382334515548,30.0639195476363],[104.382325845377,30.0638922535201],[104.382317981505,30.0638675942394],[104.382310596014,30.0638446485938],[104.382303410524,30.0638224612538],[104.382296261064,30.0638003153137],[104.382288991774,30.0637775775112],[104.382273679305,30.0637293151065],[104.382265790193,30.0637046036279],[104.38225783172,30.0636798983786],[104.382240778754,30.0636272142151],[104.382231433799,30.0635981756745],[104.382212442965,30.0635388446595],[104.38220343583,30.0635107614951],[104.38218765127,30.063461670339],[104.382180847711,30.0634403817375],[104.382174230628,30.0634195303742],[104.382160248709,30.0633753565301],[104.382152949648,30.0633524837681],[104.382145601946,30.0633296712136],[104.382131243481,30.0632852757761],[104.382124180451,30.0632632305962],[104.382108262487,30.0632132714322],[104.382098939998,30.0631841384408],[104.3820729599,30.0631031309333],[104.382065726588,30.0630806422182],[104.382050370777,30.0630330595375],[104.382042183406,30.0630075922949],[104.381989550072,30.0628430053817],[104.381981414928,30.0628175894312],[104.381958728409,30.0627468586734],[104.381942865307,30.0626972996645],[104.381934390504,30.0626707376552],[104.381926295874,30.0626452596739],[104.381912139039,30.0626004659166],[104.381905379544,30.062579192579],[104.381898341677,30.0625572381978],[104.381883715496,30.0625118729233],[104.381876449691,30.0624891512071],[104.381862069407,30.0624437483793],[104.381854988277,30.0624215088637],[104.381848054904,30.0623999367773],[104.381840993603,30.0623780390171],[104.381833071027,30.0623533228914],[104.381823604284,30.0623235781403],[104.381801739221,30.0622547222017],[104.381769712786,30.062154197189],[104.381762682985,30.0621321735347],[104.381740830511,30.0620639902506],[104.381726678098,30.0620196604535],[104.381719679814,30.0619976691936],[104.381712231068,30.0619741846436],[104.381694628123,30.061918595745],[104.381685179349,30.0618889741716],[104.381676425186,30.0618617427321],[104.381668746713,30.0618379324025],[104.381661604276,30.0618156837884],[104.381653993357,30.0617918744175],[104.381645282423,30.0617646978676],[104.38163574806,30.0617351481428],[104.381626312802,30.0617060823406],[104.381617732512,30.0616797701487],[104.381595572776,30.0616122222822],[104.381588324021,30.061589877323],[104.381581123902,30.0615674334828],[104.381573891345,30.061544824136],[104.381566350677,30.0615213682397],[104.381558284778,30.0614963722156],[104.381549758502,30.0614698397218],[104.381541123201,30.0614427090768],[104.381525029172,30.0613917610741],[104.381517583973,30.0613682944634],[104.381509763094,30.0613437609059],[104.381490126661,30.0612824044407],[104.38148496079,30.0612662936904]]]}},{type:"Feature",properties:{id:"10649",r_s_id:"2940",z_order:0,rid:"47",category:1,type:2,jun_id:"629",ft_type_no:"f",lane_no:"11",pre_id:[10657],suc_id:[10641],l_boun_id:"17444",r_boun_id:"17445",width:3.98,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.381204114344,30.0600122936147],[104.381197726752,30.0599923217784],[104.381181673079,30.0599421578284],[104.381173670116,30.059917204925],[104.381165662646,30.0598922277334],[104.381157795715,30.0598676139981],[104.381142622207,30.0598197675089],[104.381135157978,30.0597962450243],[104.381127842405,30.0597733018403],[104.381120810629,30.0597513571681],[104.381099997293,30.0596866232759],[104.381091993404,30.0596616739462],[104.381065521259,30.0595789113919],[104.381057575017,30.0595541050994],[104.381036035467,30.059486924322],[104.381028786543,30.0594643462996],[104.381006924445,30.0593964097644],[104.380985160525,30.0593286468752],[104.380977986365,30.0593063234188],[104.380970855446,30.0592840881353],[104.380955721485,30.0592367182242],[104.380946923817,30.0592091213998],[104.380937078357,30.059178341779],[104.380916481101,30.0591143651882],[104.380907689734,30.0590869689056],[104.380900365087,30.0590639968772],[104.380893279187,30.0590417571215],[104.380884585112,30.0590146235264],[104.380873432373,30.0589799827528],[104.380849261932,30.0589048835062],[104.380839831777,30.0588755602482],[104.380832460268,30.058852570171],[104.380809788019,30.0587813196195],[104.380799853308,30.0587501324752],[104.380789756426,30.0587185045049],[104.380750415759,30.0585953111853],[104.380732681551,30.0585400893955],[104.380724056792,30.0585131149988],[104.380706049566,30.0584567525936],[104.380696754491,30.0584276497532],[104.380672415382,30.0583514719145],[104.380665354655,30.0583295145132],[104.380658356094,30.0583078008856],[104.380651080935,30.0582851256171],[104.380643186811,30.0582602877858],[104.380634585432,30.0582330606773],[104.380625629077,30.0582047801201],[104.380616937612,30.058177599683],[104.380608938987,30.0581528534707],[104.380601567426,30.05813015921],[104.380594378751,30.0581079525558],[104.380586927891,30.0580847878714],[104.380571296377,30.0580357949065],[104.380563754504,30.0580121175166],[104.380548827531,30.0579655506858],[104.380531079686,30.0579106138432],[104.380521388135,30.0578804115936],[104.380511621795,30.0578498324537],[104.380501875271,30.0578192884035],[104.38049231254,30.0577893695553],[104.380483035415,30.0577604645138],[104.380463719856,30.0577005115028],[104.380452746223,30.0576663590725],[104.380441546441,30.0576314159167],[104.380431348516,30.0575995646923],[104.380422802941,30.0575728618778],[104.380402188129,30.0575082302029],[104.380394695766,30.0574848477938],[104.380386188024,30.0574583635397],[104.380376832475,30.0574291804986],[104.380367401233,30.0573995657078],[104.380358715978,30.0573721936453],[104.380350989348,30.0573479710325],[104.380343730325,30.0573254584795],[104.380328314927,30.0572778415519],[104.380320159437,30.0572524206182],[104.380312163411,30.0572274180218],[104.380304593535,30.0572036874776],[104.38029746152,30.0571812640707],[104.380283538044,30.0571373852529],[104.380275917705,30.0571134783854],[104.380267327933,30.057086668463],[104.38025766512,30.0570566711984],[104.38024719234,30.0570241937136],[104.380236560972,30.0569909219716],[104.380226439534,30.0569590024032],[104.380217261406,30.0569301198583],[104.380209168945,30.0569048059747],[104.380201923394,30.0568822808094],[104.38019502742,30.0568609268989],[104.380187945843,30.0568389603681],[104.38018021196,30.0568148285339],[104.380171496016,30.0567875013512],[104.380161738548,30.0567568429633],[104.380151184626,30.0567237421373],[104.380140280231,30.0566897281531],[104.380129635318,30.0566566964763],[104.380119939116,30.056626557041],[104.380098254615,30.0565586038122],[104.380091737908,30.0565381576648],[104.380084829279,30.0565165114378],[104.380077820642,30.0564945962141],[104.380070966974,30.0564732378198],[104.380055053163,30.0564237289893],[104.380043881136,30.0563888054937],[104.380030854,30.0563479482529],[104.380007020601,30.0562731247342],[104.37999776402,30.0562441745934],[104.379988338058,30.0562148267828],[104.379965100196,30.0561425776684],[104.379953380346,30.0561060932768],[104.379943172321,30.0560742535633],[104.379917259412,30.0559933323252],[104.379902127533,30.0559458422603],[104.379895153981,30.0559239387191],[104.379872640402,30.0558535410502],[104.379864624424,30.0558286210488],[104.379856526455,30.0558034680399],[104.379848165397,30.0557774478239],[104.379839375468,30.0557500143489],[104.379830399929,30.055721896305],[104.379821880276,30.0556950620409],[104.379807283509,30.0556489403248],[104.379799934225,30.0556258870571],[104.379791309159,30.0555989789342],[104.379771026314,30.0555355198573],[104.379761172304,30.0555048036829],[104.379743619426,30.05545029913],[104.379734612324,30.0554221666361],[104.379724302397,30.0553898860788],[104.379712479724,30.055353002191],[104.379699866888,30.0553137370112],[104.37968786851,30.0552762530922],[104.379669205552,30.055217825456],[104.379661992283,30.055195317277],[104.379646906226,30.0551483972936],[104.379638239666,30.0551213910585],[104.379629036113,30.0550926261143],[104.379608770259,30.0550291804326],[104.379598097189,30.054995842767],[104.379578699868,30.0549352478772],[104.379572963285,30.0549172197671],[104.379538644685,30.0548097265725],[104.379535911081,30.0548010166192],[104.379533181987,30.0547924262794],[104.379514810827,30.0547346571409],[104.379503076345,30.0546978128285],[104.379491326541,30.0546609127381],[104.379481701269,30.0546307344936],[104.379474011323,30.0546066933491],[104.379446471684,30.0545211781339],[104.379435788636,30.0544877810445],[104.379426161539,30.054457534432],[104.379409330101,30.0544046258014],[104.379401204953,30.0543791947509],[104.379386853053,30.0543345074857],[104.379380709187,30.0543153871532],[104.379367583523,30.0542744260969],[104.379360277368,30.0542516146797],[104.379352886517,30.0542285162923],[104.379330963552,30.0541605397717],[104.379323559195,30.0541377723116],[104.379316173748,30.0541148708709],[104.379308780175,30.0540916249818],[104.379293349695,30.0540427484526],[104.379285286677,30.0540174361435],[104.379277342593,30.0539926041888],[104.379269776923,30.0539689075564],[104.379255551975,30.0539242617258],[104.379240804444,30.053878034355],[104.379232798181,30.0538530764204],[104.379224593703,30.0538276587299],[104.379216611773,30.0538030200732],[104.379209060515,30.0537796525898],[104.379201727287,30.0537567826501],[104.379186000337,30.053707442613],[104.37917759311,30.0536811892365],[104.379169346267,30.0536556168048],[104.379153788721,30.0536075647456],[104.379146104992,30.0535836638155],[104.379138363588,30.0535593824134],[104.379130550095,30.0535347627921],[104.379122550095,30.0535095880988],[104.379114205915,30.0534834723646],[104.37910548152,30.0534563660895],[104.37908767504,30.0534014346098],[104.379079164178,30.0533751046568],[104.379071220935,30.0533503203115],[104.379056613853,30.0533044482236],[104.37904936077,30.0532817491988],[104.379034379773,30.0532350097737],[104.379026932966,30.0532116855189],[104.379012044737,30.0531647276442],[104.379004406007,30.0531407565772],[104.378989183521,30.0530933837612],[104.378980914986,30.0530675459564],[104.3789596404,30.053000787505],[104.378936195286,30.0529276173655],[104.378926978866,30.0528986435481],[104.378919514001,30.0528750854254],[104.378912673531,30.052853463276],[104.378905428506,30.0528305510864],[104.378897399603,30.0528052324119],[104.37888887785,30.0527784743184],[104.378872398373,30.0527268517699],[104.3788675595987,30.052711585142507]]]}},{type:"Feature",properties:{id:"10650",r_s_id:"2940",z_order:0,rid:"47",category:1,type:2,jun_id:"629",ft_type_no:"f",lane_no:"12",pre_id:[10658],suc_id:[10642],l_boun_id:"17445",r_boun_id:"17446",width:3.83,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.381166079393,30.0600214077988],[104.381162648646,30.0600106531836],[104.381147490462,30.0599629568971],[104.381140538869,30.0599411319154],[104.381133460247,30.0599190181296],[104.381119240839,30.0598747167492],[104.38111200725,30.0598521054874],[104.381095791349,30.0598013019196],[104.381086749579,30.0597730124293],[104.381044126385,30.0596401361108],[104.380950995667,30.0593495581379],[104.380941948448,30.0593214430646],[104.380923674717,30.0592646902334],[104.380915857268,30.0592403318859],[104.380901420603,30.0591951497577],[104.380893652694,30.0591708355186],[104.380878073629,30.0591222069922],[104.38087116972,30.0591006805651],[104.380858361037,30.0590606980408],[104.380851544514,30.0590394549784],[104.380835418552,30.0589891333857],[104.380826069471,30.0589599244147],[104.380807701949,30.0589026678023],[104.380792804851,30.0588562486131],[104.380786033355,30.0588350919134],[104.380770757833,30.0587871686883],[104.380761589811,30.0587583987389],[104.380742820408,30.0586995849779],[104.380734783966,30.0586743693199],[104.380727635857,30.0586519639889],[104.38072074542,30.0586304645186],[104.380713663085,30.0586084765311],[104.380698987574,30.0585629298466],[104.380684503942,30.0585176720223],[104.380669953631,30.0584721973905],[104.380662539726,30.0584490309626],[104.380647796594,30.0584028330811],[104.380640206994,30.0583790189681],[104.380623393464,30.0583262972102],[104.38057028511,30.0581602188804],[104.380561298118,30.0581322053702],[104.380546988301,30.0580876886844],[104.380539934741,30.0580656062544],[104.380524914031,30.0580182362294],[104.380517519904,30.0579950742805],[104.380510414089,30.0579730295636],[104.38049649617,30.0579299665327],[104.380489377734,30.0579078228734],[104.380474914711,30.0578627295399],[104.380452260192,30.0577920857654],[104.380423536816,30.0577026321969],[104.380393604318,30.0576092905637],[104.380340952297,30.0574450225895],[104.380333586048,30.0574219784319],[104.380319745493,30.0573786384034],[104.380312501773,30.0573560736972],[104.380305245441,30.0573335485467],[104.380298247683,30.057311828538],[104.380291392271,30.0572904656969],[104.380252418431,30.0571682307375],[104.380232622448,30.0571059388747],[104.380225187696,30.0570826868799],[104.380218317854,30.0570613860603],[104.380211312868,30.0570397181839],[104.380204084436,30.0570172281093],[104.380196816351,30.0569944421183],[104.380189600517,30.0569717551022],[104.380182400001,30.0569491985004],[104.380175145433,30.0569266319507],[104.380167862033,30.0569040087137],[104.380160585836,30.0568813486101],[104.380153366393,30.0568587497144],[104.380131915258,30.0567912679834],[104.380116533921,30.0567426698231],[104.380108430614,30.0567172695663],[104.380100390386,30.0566923514036],[104.380078077054,30.0566237761064],[104.380071103559,30.0566020839463],[104.380063971484,30.0565797405215],[104.380028666063,30.0564691370792],[104.380005714725,30.0563973316451],[104.379991780296,30.0563537215729],[104.379956203613,30.0562428929435],[104.37993325131,30.0561710865524],[104.379904516537,30.0560813311918],[104.3798899685,30.0560360351378],[104.379882729161,30.0560133956864],[104.379875608742,30.0559909613965],[104.379861365189,30.0559459794949],[104.37985383122,30.0559223621839],[104.379845911639,30.055897698579],[104.379829723799,30.0558474671998],[104.379821715916,30.0558225561878],[104.379813685501,30.0557974850725],[104.379790215905,30.055723904598],[104.379768692403,30.0556564144349],[104.379761445826,30.0556338271066],[104.379754192943,30.0556112604545],[104.379747005823,30.0555887667115],[104.379732532457,30.0555432287385],[104.379724970528,30.0555196653254],[104.379717290578,30.0554959596993],[104.379709789023,30.0554728828733],[104.379702641548,30.055450802845],[104.37969573012,30.0554292941189],[104.379681734252,30.0553853699762],[104.379674513771,30.055362666641],[104.379660124159,30.0553174362833],[104.379645631831,30.0552719620999],[104.379623072101,30.0552017251705],[104.379602408011,30.0551371081713],[104.379553419607,30.0549842602109],[104.379542916799,30.0549514101272],[104.379534110544,30.0549238029761],[104.379497752939,30.0548095978656],[104.379494949065,30.0548009058235],[104.379492139782,30.054792138233],[104.379473708243,30.0547345290856],[104.379461953927,30.0546977440913],[104.379450108602,30.0546606001725],[104.379432792452,30.0546063106112],[104.379425724181,30.0545843214273],[104.379417658514,30.0545593014293],[104.379408405334,30.0545304967957],[104.379398878243,30.0545006837464],[104.379382291861,30.0544486180091],[104.379368177799,30.054404386031],[104.379353863703,30.0543593786313],[104.37934659989,30.054336676071],[104.379339295539,30.0543140463122],[104.379331990289,30.0542914813015],[104.379324704855,30.0542688920276],[104.379317463559,30.0542462641263],[104.379310266404,30.0542236452616],[104.379303057537,30.0542010443695],[104.379295793717,30.0541784892846],[104.379288480348,30.0541559521336],[104.379281161571,30.0541333915931],[104.379273893238,30.0541107744453],[104.379259552049,30.0540654378225],[104.379252372896,30.0540428288545],[104.379238202916,30.0539987037758],[104.37923107242,30.0539764464853],[104.379214370605,30.0539240253056],[104.379204619089,30.0538933962838],[104.379194953171,30.0538631738375],[104.379186301782,30.0538362727051],[104.379172186735,30.0537924723044],[104.379165440051,30.0537714897233],[104.379143803437,30.0537041599661],[104.379136745901,30.053682227381],[104.379121812708,30.0536356562211],[104.379112888285,30.0536077664377],[104.379093329335,30.0535468239266],[104.379084663493,30.0535198166303],[104.379070688029,30.0534760513982],[104.379064044929,30.0534552658511],[104.379057065757,30.0534335410698],[104.379042298313,30.0533876706081],[104.379034340643,30.0533628655535],[104.379016599853,30.0533073567373],[104.378991299612,30.0532282744197],[104.378984151024,30.0532058245973],[104.378970066476,30.0531615349037],[104.378962840399,30.0531389402063],[104.378948292738,30.053093542066],[104.378941101791,30.0530709842716],[104.378926834317,30.0530261439867],[104.378919527138,30.0530032991848],[104.378904201884,30.0529555116338],[104.378896637005,30.0529317528541],[104.378882744321,30.0528879462507],[104.378875438929,30.052865059172],[104.378856887123,30.0528070196429],[104.378846397553,30.0527742088957],[104.378836414355,30.0527431469414],[104.37882860422998,30.05271877015915]]]}},{type:"Feature",properties:{id:"10651",r_s_id:"2940",z_order:0,rid:"47",category:1,type:2,jun_id:"629",ft_type_no:"f",lane_no:"14",pre_id:[10659],suc_id:[10643],l_boun_id:"17446",r_boun_id:"17447",width:3.87,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.381128722681,30.0600303598053],[104.381100282929,30.0599412803933],[104.381089884351,30.0599086827742],[104.381066497,30.0598354892117],[104.381033901171,30.0597335922773],[104.381024807131,30.059705276637],[104.381010399374,30.0596605514434],[104.381003500908,30.0596390889044],[104.380989076006,30.0595939751788],[104.380981468489,30.059570139554],[104.380957409843,30.0594948912172],[104.380935259387,30.0594261197827],[104.380899059645,30.0593132664399],[104.380870173696,30.0592233230269],[104.380862550833,30.0591995512075],[104.380846407762,30.0591491954298],[104.380838413703,30.0591242631262],[104.380816273047,30.0590553369278],[104.38080910334,30.0590329279984],[104.380794720665,30.0589877710499],[104.380787495092,30.058965163312],[104.380765764318,30.0588974434565],[104.380758554955,30.0588748986793],[104.380744119105,30.0588297515466],[104.3807368755,30.0588071042087],[104.380715203224,30.058739125369],[104.380700837617,30.0586940673155],[104.3806936895,30.0586716961499],[104.380686511654,30.0586493384434],[104.380671490166,30.058602789569],[104.380663461825,30.0585779147401],[104.380655290229,30.0585525469437],[104.380632397114,30.0584810999863],[104.380610924769,30.0584139045688],[104.380603715361,30.0583913345723],[104.380589299237,30.0583460695716],[104.380582091622,30.0583234420153],[104.380574900225,30.0583009080019],[104.380553166561,30.0582330117187],[104.38053829904,30.0581865186838],[104.380530487781,30.0581621926139],[104.380513074161,30.0581079611508],[104.380503945692,30.0580793503378],[104.380487655521,30.0580281110879],[104.380480528067,30.0580058253254],[104.380466359659,30.0579618150536],[104.380444549333,30.0578938970305],[104.380430010608,30.057848647119],[104.380422763312,30.0578259925047],[104.380408334478,30.0577807993474],[104.380401104297,30.0577582598571],[104.380386553845,30.0577131825812],[104.380379268704,30.0576905827773],[104.380372019594,30.0576679848056],[104.380350343419,30.0576002098355],[104.380328556418,30.0575323232247],[104.380292363018,30.057419163366],[104.380285146315,30.0573965869884],[104.380270720114,30.0573515295625],[104.380263475477,30.0573289063874],[104.380256292103,30.0573064649331],[104.380234709537,30.0572391117493],[104.38022613867,30.0572123198193],[104.380197876312,30.0571237406202],[104.380190277577,30.057100065775],[104.380183350967,30.0570786272953],[104.380176184701,30.0570564790154],[104.380168386851,30.0570322697731],[104.380160289869,30.0570069306902],[104.380144849092,30.0569583082039],[104.380120959041,30.0568834109765],[104.380104883076,30.0568331978463],[104.380097747411,30.0568109407603],[104.380084151793,30.0567683481957],[104.3800770945,30.0567461937048],[104.380069832689,30.0567234769358],[104.38006246727,30.0567005783998],[104.380048018442,30.0566558877628],[104.38004108008,30.0566343907821],[104.380033904757,30.0566120464074],[104.38000473221,30.0565206539519],[104.379993749353,30.0564860381916],[104.379968612217,30.0564072338636],[104.379954803911,30.056364185073],[104.379947697941,30.0563420934545],[104.3799326607,30.0562952950737],[104.379924170821,30.0562687513478],[104.379906127908,30.0562124063993],[104.379880961864,30.0561336784092],[104.379871696229,30.0561047273199],[104.37985390916,30.0560492522348],[104.379846342758,30.0560256178021],[104.379832328953,30.0559816721293],[104.379825198616,30.055959348433],[104.379817962864,30.0559367404451],[104.379803518378,30.0558914840218],[104.379774515882,30.0558011086354],[104.379745580912,30.0557106235716],[104.379738322616,30.0556879921592],[104.379716563936,30.0556202202346],[104.379709335361,30.0555976095293],[104.379694889914,30.0555523467565],[104.379687629801,30.0555296955448],[104.379680334551,30.0555070065246],[104.379658837119,30.0554402690349],[104.379651636466,30.0554179101522],[104.379643803318,30.0553935190729],[104.379635066472,30.0553661296565],[104.379625698023,30.0553365461663],[104.379616352094,30.0553070013665],[104.37960761884,30.0552795426983],[104.379599730716,30.0552549231253],[104.379585934831,30.0552119434214],[104.379579201762,30.0551908701175],[104.379553530853,30.0551106008072],[104.379543790285,30.0550802381058],[104.379518393257,30.055001149845],[104.379496537994,30.0549331906021],[104.379495635204,30.0549303847176],[104.379456485414,30.0548082249644],[104.379453720272,30.0547995230653],[104.379450953327,30.0547908148687],[104.379432628056,30.054733108677],[104.379409193247,30.0546594110227],[104.379399576053,30.0546292471483],[104.379391962668,30.0546054749557],[104.379375729494,30.0545550040623],[104.379365562691,30.054523311678],[104.379338179682,30.0544376526296],[104.379317516255,30.0543727395561],[104.379310041598,30.054349345197],[104.379292568602,30.0542949708573],[104.379282800007,30.0542645369952],[104.379262887985,30.0542023270978],[104.379253408602,30.0541728548912],[104.379236941086,30.0541217046979],[104.379229769143,30.0540992962793],[104.379215712659,30.0540551488229],[104.379208503767,30.0540325667932],[104.37918677257,30.053964660508],[104.379179564572,30.0539421072503],[104.379165116135,30.0538969314491],[104.379157888313,30.0538743916555],[104.379150668601,30.0538519435988],[104.3791284229,30.0537827660084],[104.379120807635,30.0537589748584],[104.37910634385,30.0537137648386],[104.379099479113,30.0536923162751],[104.379092552206,30.0536706787896],[104.379078193824,30.0536258097055],[104.379070987599,30.0536032905973],[104.379063821019,30.0535809334051],[104.379048891392,30.053534439553],[104.379040899484,30.0535094662926],[104.379024842667,30.0534590430524],[104.378996081681,30.0533693605237],[104.378970710246,30.0532901612033],[104.378961192007,30.0532603848942],[104.37893787212,30.0531873012189],[104.378913454783,30.0531107567192],[104.378892956823,30.0530466430133],[104.378865415653,30.0529605966584],[104.378843970688,30.0528933936845],[104.378829485132,30.0528482167821],[104.378815005871,30.052802957142],[104.378807766239,30.052780360594],[104.378793200481,30.0527350945583],[104.37879024337478,30.052725845522364]]]}},{type:"Feature",properties:{id:"10646",r_s_id:"2938",z_order:0,rid:"45",category:1,type:3,jun_id:"627",ft_type_no:"t",lane_no:"13",pre_id:[10638],suc_id:[10654],l_boun_id:"17441",r_boun_id:"17440",width:3.89,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.3790265371258,30.052682262966524],[104.379043260856,30.0527343577741],[104.379052527688,30.0527634188402],[104.379078521661,30.0528450657684],[104.379099419523,30.052910453187],[104.379124589029,30.0529894408473],[104.379150444147,30.0530700281749],[104.379157341309,30.0530916251464],[104.379206711558,30.053245386956],[104.379215842275,30.053273852484],[104.379230451961,30.0533195131554],[104.379237417572,30.0533412153983],[104.379259117191,30.0534089885124],[104.379280760035,30.0534767183853],[104.379287983321,30.0534992887201],[104.379295211111,30.0535219148153],[104.379309585611,30.0535672163801],[104.379316777362,30.0535898559229],[104.379324004244,30.0536124847082],[104.379331258148,30.0536350766472],[104.379338506644,30.0536576344049],[104.379345715498,30.0536801570471],[104.379352895521,30.0537026553766],[104.379360111577,30.0537251726267],[104.379367397001,30.0537477457033],[104.379382094874,30.053793106018],[104.37938938931,30.0538159012296],[104.379396545909,30.0538386045688],[104.379403487177,30.0538608256533],[104.379410282477,30.0538824791189],[104.379417303012,30.0539045761752],[104.379434447062,30.0539578853136],[104.379444693126,30.0539898286628],[104.379464120271,30.0540503724084],[104.379485766546,30.0541180256926],[104.37949258794,30.0541394633298],[104.379508962515,30.0541907607721],[104.379538924862,30.0542842670105],[104.379554375891,30.0543325633718],[104.379561344125,30.0543543878479],[104.379575213013,30.0543978181929],[104.379589539591,30.0544426150562],[104.379621165079,30.0545416402003],[104.379632103022,30.054575653511],[104.379641202955,30.0546039695897],[104.379648675713,30.054627295514],[104.379662409403,30.0546702022791],[104.379669582127,30.0546925836129],[104.379676867473,30.0547153229866],[104.37969135978,30.0547607270062],[104.379705520525,30.0548052277707],[104.379719859658,30.0548503357467],[104.379728053179,30.0548759205606],[104.379737365702,30.0549047215553],[104.379758089116,30.054968787236],[104.37980014863,30.055100342867],[104.379814327328,30.0551447356792],[104.379821553172,30.0551673643413],[104.379836027376,30.0552126279779],[104.379843237899,30.0552352395323],[104.379850417792,30.055257861846],[104.379857581468,30.0552804823431],[104.379864755951,30.0553031064465],[104.379871959259,30.0553257080941],[104.37988641181,30.0553708538738],[104.379893620518,30.0553934816017],[104.379908019914,30.0554387864965],[104.379915118692,30.0554609473638],[104.379929027015,30.0555040817062],[104.379936161824,30.0555262938655],[104.379943496651,30.05554923377],[104.3799508558,30.0555722123677],[104.379958169894,30.0555949517003],[104.379965856087,30.0556188281388],[104.379974589212,30.0556460771584],[104.380005801559,30.0557431472611],[104.380029846624,30.055817265026],[104.38004574242,30.0558664797741],[104.380055883732,30.0558980891595],[104.380066978271,30.0559328057295],[104.380087754631,30.0559981122868],[104.380096597637,30.0560257813602],[104.380112524045,30.056075508713],[104.38011998496,30.056098901055],[104.380134313054,30.056143956657],[104.380141441507,30.0561663342343],[104.380155992111,30.0562117326862],[104.380163305248,30.0562344809598],[104.380170442696,30.0562567362318],[104.380177347697,30.0562783356698],[104.380184168909,30.0562997506633],[104.380191182928,30.0563217998644],[104.380198514983,30.056344775675],[104.380206011905,30.056368132058],[104.380220950778,30.0564145102179],[104.380228885562,30.0564392375869],[104.380237709598,30.0564668139693],[104.380247469734,30.0564973644155],[104.380268138727,30.0565621590273],[104.380278295276,30.0565939688982],[104.380297908299,30.0566550761469],[104.380307007102,30.056683437883],[104.380322616261,30.0567325784538],[104.380329663577,30.0567547004992],[104.380343932972,30.0567991345128],[104.3803511929,30.0568217405948],[104.380365710046,30.0568669329659],[104.380373032129,30.0568896299347],[104.380380359618,30.0569123763694],[104.380387562777,30.0569348555829],[104.380401564573,30.0569788126672],[104.380409033512,30.0570021950507],[104.380426814791,30.0570575627713],[104.380445142053,30.057114960775],[104.38045295875,30.0571394703325],[104.380466833465,30.0571827941418],[104.380473917677,30.0572049620537],[104.380490565529,30.0572571684248],[104.380517102215,30.0573397795791],[104.380538710683,30.0574074473368],[104.38057228016,30.0575122613582],[104.380580775228,30.0575387176659],[104.380602267406,30.0576057026814],[104.380629863501,30.0576917582511],[104.380638450448,30.0577185374862],[104.380646094103,30.0577424478782],[104.380660670567,30.0577882867687],[104.380667986275,30.057811278633],[104.380690047798,30.0578804584711],[104.380698832935,30.0579078710003],[104.380717744695,30.0579666201748],[104.38072623611,30.0579930314705],[104.38074084224,30.0580385169183],[104.380747914657,30.0580604860029],[104.380769697694,30.058128223006],[104.380791404145,30.058195998589],[104.380798677467,30.0582187628521],[104.380805885925,30.0582414694943],[104.380812964649,30.0582638369665],[104.380819906424,30.0582857015863],[104.38082692477,30.0583076607068],[104.380834485478,30.058331219336],[104.380852185384,30.0583864320353],[104.380861499313,30.0584153963484],[104.380870298798,30.0584426757407],[104.380878662227,30.0584686533974],[104.380887258102,30.058495484728],[104.380896581939,30.0585246990494],[104.380906493186,30.0585557692256],[104.380916399924,30.0585867998242],[104.380934217809,30.0586426529008],[104.380941953272,30.058666860078],[104.380949248165,30.0586895056144],[104.380963679366,30.0587339988348],[104.380970945421,30.0587565319233],[104.380985235192,30.0588012192491],[104.380992549903,30.0588241201996],[104.38100860909,30.0588741115891],[104.381009411825,30.0588766151601]]]}},{type:"Feature",properties:{id:"10647",r_s_id:"2938",z_order:0,rid:"45",category:1,type:3,jun_id:"627",ft_type_no:"t",lane_no:"12",pre_id:[10639],suc_id:[10655],l_boun_id:"17442",r_boun_id:"17441",width:3.91,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.37898785005915,30.05268939849692],[104.379005192113,30.0527434951437],[104.379014473371,30.0527725166668],[104.379040552065,30.0528542059841],[104.379061363468,30.0529194629399],[104.37908669878,30.0529986468547],[104.379112429612,30.0530791594448],[104.379119324079,30.0531007141545],[104.379168597111,30.0532546054303],[104.379177693606,30.0532830196741],[104.379192200614,30.0533286802594],[104.379199118491,30.0533504193345],[104.379220814535,30.053418145709],[104.37924253579,30.0534859575284],[104.379249781608,30.0535085224998],[104.379257015712,30.0535310955514],[104.379271399238,30.0535763216016],[104.379278565774,30.0535989359473],[104.379285797172,30.0536215890282],[104.379293106043,30.0536442556762],[104.37930042482,30.0536668764674],[104.379307620168,30.0536893370523],[104.379314666868,30.0537117201425],[104.379321709971,30.0537342785941],[104.379328836856,30.0537569036789],[104.379343588814,30.0538025122796],[104.379350995867,30.0538252608513],[104.379358252463,30.0538477844385],[104.379365291027,30.0538698455531],[104.379372170116,30.0538914721335],[104.379379236608,30.0539136438891],[104.379396384294,30.0539671068368],[104.379406627667,30.0539990016336],[104.379426026916,30.0540595768524],[104.379447595745,30.0541271446512],[104.379454452282,30.0541485742393],[104.379470919671,30.0541999194611],[104.379500882061,30.054293403256],[104.379516334912,30.0543416681632],[104.379523315769,30.0543635025538],[104.379537222514,30.0544069554382],[104.379551546408,30.0544517082511],[104.37958316384,30.0545508548363],[104.379594057656,30.0545848501303],[104.379603099044,30.0546131014111],[104.379610561902,30.0546363949597],[104.379624381194,30.0546793422987],[104.379631584559,30.0547017452565],[104.379638850095,30.0547244459491],[104.379653251435,30.0547698040308],[104.379667437426,30.0548143498053],[104.379681860361,30.0548594902601],[104.379690060202,30.0548851227549],[104.379699312384,30.0549139794586],[104.379719864663,30.0549779730489],[104.379762098102,30.0551095154207],[104.379776274116,30.0551538704775],[104.379783490962,30.0551764820531],[104.379797974195,30.0552217349261],[104.379805178422,30.0552443365912],[104.379812352019,30.0552669526129],[104.379819505796,30.0552895749081],[104.379826688399,30.0553122179148],[104.379833929554,30.0553348429921],[104.379848457795,30.0553799564913],[104.379855670116,30.0554025527563],[104.379870060527,30.0554479224118],[104.379877174632,30.0554701372628],[104.37989111901,30.0555132680623],[104.379898243015,30.0555354145701],[104.379905568843,30.055558333791],[104.379912912689,30.0555813159803],[104.379920208777,30.0556040535059],[104.379927900386,30.0556279218661],[104.37993667316,30.0556551565478],[104.379967943213,30.0557523715392],[104.379991740582,30.0558265079741],[104.380007568839,30.0558757235753],[104.380017718271,30.0559072844191],[104.380028807419,30.0559419551333],[104.380049696415,30.0560072717229],[104.380058542138,30.0560349830786],[104.380074336145,30.0560846743481],[104.38008177725,30.0561080118219],[104.380096256705,30.0561530559024],[104.380103455436,30.0561754695316],[104.380117966426,30.0562209039361],[104.380125238132,30.056243609011],[104.380132389103,30.0562658490175],[104.380139322941,30.0562874610837],[104.380146144165,30.056308889576],[104.380153132971,30.0563309621436],[104.380160424499,30.0563539469169],[104.38016791603,30.0563773491696],[104.38018286303,30.0564236841902],[104.380190811338,30.0564483899996],[104.380199641692,30.0564759583061],[104.380209406347,30.0565065060717],[104.380230094287,30.0565712890386],[104.380240264363,30.0566030953391],[104.380259889128,30.0566642547859],[104.380268972628,30.0566925859421],[104.380284633156,30.0567416798199],[104.380291713812,30.0567637938136],[104.380306035478,30.0568082656691],[104.380313299021,30.0568308987438],[104.380327770248,30.0568761234642],[104.380335058109,30.0568987988254],[104.380342365788,30.0569214975865],[104.380349568056,30.0569439498291],[104.380363586088,30.0569879177398],[104.380371072155,30.0570113316261],[104.380388794007,30.0570667163989],[104.380407060937,30.0571240720998],[104.38041490287,30.0571485906856],[104.380428800125,30.0571918866567],[104.380435887951,30.0572140536822],[104.380452561052,30.0572663149586],[104.380479155431,30.0573489360972],[104.380500761227,30.0574165598145],[104.380534392011,30.0575214144099],[104.380542875379,30.0575478410399],[104.38056431534,30.0576148080466],[104.380591867337,30.0577009175689],[104.380600437182,30.0577277012953],[104.380608058326,30.0577515882933],[104.380622651927,30.0577973957439],[104.380629989264,30.0578203696527],[104.38065212829,30.0578895441999],[104.380660922449,30.0579169999167],[104.380679762174,30.0579757778244],[104.380688220272,30.0580022070854],[104.380702757062,30.0580477329543],[104.380709795259,30.0580697110084],[104.380731572922,30.0581374084654],[104.380753260485,30.0582051283015],[104.380760486072,30.0582278529582],[104.380767668417,30.058250543397],[104.380774757062,30.0582729360692],[104.380781728576,30.0582948510889],[104.38078877396,30.0583168597074],[104.380796333778,30.0583404192453],[104.380814032809,30.058395639162],[104.380823340447,30.0584246043808],[104.380832139043,30.0584518630998],[104.380840548425,30.0584778219265],[104.38084921998,30.0585046353556],[104.380858599679,30.0585338182675],[104.38086852085,30.0585648929631],[104.380878384364,30.0585959298283],[104.38089612751,30.0586518116348],[104.380903860282,30.0586760188197],[104.380911159692,30.0586987066381],[104.38092554137,30.0587432160178],[104.380932771404,30.0587657292963],[104.380947042278,30.0588103896437],[104.380954392132,30.0588333149194],[104.380970545029,30.0588833423935],[104.380971339656,30.0588858180789]]]}},{type:"Feature",properties:{id:"10648",r_s_id:"2938",z_order:0,rid:"45",category:1,type:3,jun_id:"627",ft_type_no:"t",lane_no:"11",pre_id:[10640],suc_id:[10656],l_boun_id:"17443",r_boun_id:"17442",width:4.02,turn_list:"2",hd_data_ve:"p1"},geometry:{type:"MultiLineString",coordinates:[[[104.3789486952465,30.052696620299447],[104.378952216226,30.0527076476404],[104.378977502984,30.0527865887833],[104.379003611444,30.052868288956],[104.379012908025,30.0528974669767],[104.379028381006,30.0529462474683],[104.379034895277,30.0529667505049],[104.379041439273,30.0529872220946],[104.379048416649,30.0530090035342],[104.379055878764,30.0530323116114],[104.379093433473,30.0531494790442],[104.379100564915,30.0531719189296],[104.379114899875,30.0532170640678],[104.37912213402,30.0532397081984],[104.379136680687,30.0532851440229],[104.379143891402,30.0533077719364],[104.379157756022,30.0533515478112],[104.379164567592,30.0533730133931],[104.379178925035,30.053418049706],[104.37919407264,30.0534654286423],[104.379201849158,30.0534896210332],[104.379218021159,30.0535396584875],[104.379225994086,30.0535644167434],[104.379233575985,30.053588146678],[104.379240823621,30.0536110048307],[104.379247929799,30.0536334500507],[104.379254977402,30.0536555390797],[104.379261951113,30.0536771999568],[104.37926886986,30.0536986665237],[104.379275858896,30.053720636778],[104.379283021836,30.0537434372776],[104.379290371281,30.0537668351123],[104.379297927035,30.0537905335276],[104.379305771988,30.0538147088741],[104.379313929576,30.0538397155062],[104.379322154746,30.0538651340921],[104.379330044759,30.0538898454708],[104.379344462486,30.0539352450888],[104.379351952447,30.0539586169712],[104.379369318186,30.0540126674111],[104.379378399293,30.0540409979412],[104.379419389932,30.0541690663786],[104.379430131558,30.0542027971794],[104.379460576919,30.0542976475689],[104.379467774022,30.0543200478626],[104.379482298869,30.0543652982355],[104.379489511286,30.0543878064575],[104.379503959547,30.054433022568],[104.379511188182,30.0544557097651],[104.379525602199,30.0545009600043],[104.379532804696,30.0545234897892],[104.379540037822,30.0545460438848],[104.379554595061,30.0545913275297],[104.379561857012,30.0546139778761],[104.379576283609,30.0546591219839],[104.379597966733,30.0547269137188],[104.379605184529,30.0547495316344],[104.379619579574,30.0547947053666],[104.379626817183,30.0548173358874],[104.379648489449,30.0548849908779],[104.37966268264,30.054929322625],[104.379698250711,30.0550401066328],[104.379706628935,30.0550661727736],[104.379720693243,30.0551098541569],[104.37972830923,30.0551335498246],[104.379737686635,30.0551627951473],[104.379760212054,30.0552334636248],[104.379770634597,30.0552662739797],[104.37978655852,30.0553163891132],[104.379793439297,30.0553379436518],[104.379807607176,30.05538206936],[104.379814590655,30.0554038641143],[104.379828479232,30.0554473806946],[104.379835888869,30.0554705374368],[104.379843552575,30.0554943635234],[104.379851093741,30.0555177155454],[104.379858298841,30.0555400348131],[104.379865457094,30.0555623144621],[104.379881999917,30.0556141280739],[104.379891437637,30.0556436674844],[104.379916719874,30.0557222633798],[104.37993345996,30.0557742983917],[104.379942677827,30.055803209843],[104.379959995424,30.055857125888],[104.379967516733,30.0558803915258],[104.3799746245,30.0559024714495],[104.379981709744,30.0559245792278],[104.379996760484,30.055971705846],[104.380014382581,30.0560267319193],[104.380024064415,30.0560570161647],[104.380042310872,30.0561141328553],[104.380050057413,30.0561383627637],[104.380064124249,30.056182291297],[104.380071318488,30.0562047750764],[104.380086923266,30.0562535011845],[104.380103097441,30.0563038807942],[104.380124691832,30.0563713653849],[104.380148808908,30.0564466486389],[104.380159013255,30.0564786168789],[104.380214255042,30.0566515418651],[104.380238097235,30.056725838223],[104.380269964267,30.0568250023022],[104.38030224571,30.0569256083601],[104.380310517431,30.0569514161193],[104.380325102185,30.0569971166918],[104.38034803342,30.0570688642975],[104.38036201181,30.0571126963734],[104.380369152809,30.0571349902713],[104.380385863781,30.0571870924445],[104.380412986235,30.0572723536583],[104.380420483999,30.0572957693423],[104.380434460529,30.0573391894946],[104.380441701513,30.057361770355],[104.38047347101,30.0574610150547],[104.380481087681,30.0574847536944],[104.380495577722,30.0575297948897],[104.380502757424,30.0575521679327],[104.380509992986,30.057574794636],[104.380524592943,30.0576205086134],[104.380538319867,30.0576634509344],[104.380550839511,30.0577027129632],[104.380581370066,30.0577980775801],[104.38063154581,30.0579550744226],[104.380660205009,30.0580447993147],[104.380674667036,30.058090085907],[104.380696413207,30.0581579560292],[104.380703663128,30.0581805808996],[104.380710901337,30.0582032093541],[104.38071811522,30.0582258108037],[104.380732524061,30.058270982203],[104.380739746946,30.0582935629716],[104.380746993251,30.0583161959216],[104.38079040167,30.0584517578952],[104.38079767228,30.0584743297026],[104.380812256742,30.0585196280363],[104.380819522846,30.0585422843696],[104.380826675432,30.058564622233],[104.380833705488,30.0585866146383],[104.380848617892,30.0586333656678],[104.380857205673,30.0586602734419],[104.380866485372,30.0586892871831],[104.380885733976,30.0587493945433],[104.380913104522,30.0588345323242],[104.380920217431,30.0588565427749],[104.380927104201,30.0588778290556],[104.380932684613,30.0588951624763]]]}}],sv={type:iv,name:rv,crs:nv,features:ov},av="FeatureCollection",lv="sdLane",cv={type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},uv=[{type:"Feature",properties:{id:"45",seg_name:"S4成宜昭高速:长河大桥-S4成宜昭高速出口",z_order:0,width:15.28,level:"41000",type_no:1,func_no:10,pass_no:1,overlap:1,median:1,walkway:2,fork:2,lane_cnt:4,lane_cnt_s:4,lane_cnt_e:5,p_a_id:null,d_road_id:"293",start_o_id:"627",start_o_tp:"inter",end_o_id:"42",end_o_tp:"inter",lnglat_seq:null,max_speed:120,min_speed:0,p_start_ju:null,p_end_jun:null,sd_rid:"0VRAE095FE00VRCI095LL00",hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38467869789301,30.069806642584275],[104.384674660599,30.0697964300345],[104.38466585817,30.0697739280967],[104.384648260495,30.0697286661144],[104.384639350866,30.0697059338538],[104.384630392598,30.069683250113],[104.384612492275,30.0696380696941],[104.384603568229,30.0696155001864],[104.384594663993,30.0695929207998],[104.384585796683,30.0695703324478],[104.384576974402,30.0695477360368],[104.384568192648,30.0695251315628],[104.384541942846,30.0694574306184],[104.38452447028,30.06941226309],[104.384515777677,30.0693896919485],[104.384507120197,30.0693671262296],[104.384498489733,30.069344538947],[104.384489867371,30.0693219120985],[104.384481260316,30.0692992708709],[104.384472701897,30.0692766674529],[104.384464208326,30.0692541117502],[104.38443883928,30.0691864321299],[104.384430333986,30.0691638197501],[104.384421787256,30.0691411704608],[104.384413169364,30.0691184203856],[104.384395955198,30.0690731468733],[104.384387754363,30.0690514583353],[104.384379776012,30.0690301539905],[104.384360966463,30.0689795551552],[104.384323707658,30.0688797337057],[104.38430599884,30.0688320486502],[104.384287820697,30.0687832075643],[104.384276959739,30.0687538833407],[104.384266304146,30.0687248308802],[104.384256649328,30.0686982442908],[104.384247756583,30.0686736602234],[104.384221041406,30.0686000473669],[104.384204279199,30.0685536382802],[104.384187541308,30.0685074126646],[104.384178983636,30.0684837038952],[104.384162735748,30.0684384202657],[104.384154999602,30.0684169272052],[104.384139174194,30.068373152076],[104.384131054293,30.0683505552201],[104.384114820775,30.068305056638],[104.384106804455,30.068282640626],[104.384091051063,30.0682386928618],[104.384082703231,30.0682152432448],[104.384073375304,30.0681888736058],[104.384043060172,30.0681027507027],[104.384034468194,30.0680784240285],[104.384018351705,30.0680329803483],[104.384009755212,30.068008570026],[104.384000774056,30.0679828625566],[104.383983122508,30.067932111571],[104.383967399613,30.0678871385411],[104.383959993972,30.0678658417604],[104.383952527963,30.0678441663134],[104.383937558994,30.0678004574534],[104.383921909905,30.0677549934337],[104.383912136868,30.0677264119375],[104.383900740528,30.0676928108531],[104.38387797574,30.0676252903363],[104.383868878294,30.0675984630743],[104.383854350679,30.0675560333784],[104.383847062085,30.0675345406172],[104.383838477186,30.06750893416],[104.383816540171,30.0674431850615],[104.383805101425,30.0674089768625],[104.383795053562,30.0673790110389],[104.383779392623,30.0673324578559],[104.383772625576,30.0673122344622],[104.383765767532,30.0672915073705],[104.383723845358,30.0671636601604],[104.383712589405,30.0671292524333],[104.383703517069,30.0671013756359],[104.383689532452,30.0670582556488],[104.383675022643,30.0670136126552],[104.383666457457,30.0669871005498],[104.383657208523,30.0669583188711],[104.383647960481,30.0669294436611],[104.383622057654,30.0668484304532],[104.38360355704,30.0667907150765],[104.383587461675,30.0667406954397],[104.383566047721,30.0666742721122],[104.38355878691,30.0666516101878],[104.383537314339,30.0665841948404],[104.383522701707,30.0665384428203],[104.383506931474,30.0664889854944],[104.383498466211,30.066462512995],[104.383462775529,30.0663513828489],[104.383447659284,30.0663041770528],[104.383406076939,30.0661740615879],[104.383398617887,30.066150635928],[104.38338358446,30.0661032197298],[104.383376020907,30.0660795619484],[104.38336859069,30.0660565517905],[104.383354477963,30.0660130412206],[104.383347559417,30.0659914946957],[104.383333307907,30.065946679084],[104.383326038916,30.0659238956845],[104.3833187375,30.0659011833007],[104.383304130169,30.0658559824535],[104.383296880096,30.0658334157985],[104.383282423172,30.0657881970861],[104.383275152372,30.0657655638579],[104.383260666625,30.0657206095083],[104.383253445365,30.0656981130143],[104.383216426453,30.065582536959],[104.383209670916,30.0655613331842],[104.383202942395,30.0655400484931],[104.383195925592,30.0655177338273],[104.383188405209,30.0654938970696],[104.383180387561,30.0654687594573],[104.383172118587,30.0654431665659],[104.383156231073,30.0653944958426],[104.383148923314,30.0653720469092],[104.383141875894,30.065350225928],[104.383134757294,30.0653279849008],[104.38312718375,30.0653041579722],[104.38311014664,30.0652504167527],[104.383101335305,30.0652227306482],[104.383093095121,30.0651970028615],[104.383092996925,30.0651966637318],[104.383092905038,30.065196396553],[104.383092653707,30.0651958081764],[104.383085284649,30.0651726909794],[104.383070926719,30.0651282393643],[104.383063881069,30.0651062214147],[104.38305671559,30.0650835675396],[104.383049214082,30.065059771231],[104.383041281966,30.0650347685529],[104.383033115633,30.0650092620465],[104.383017491946,30.0649606040705],[104.382981610455,30.0648481205731],[104.382967546126,30.0648041071348],[104.382942309243,30.0647254375177],[104.382932480773,30.0646946756866],[104.382906742038,30.0646137375114],[104.382899410763,30.0645907578954],[104.382891718241,30.0645667428401],[104.38286371112,30.0644797331038],[104.382854324949,30.0644503907645],[104.382838150691,30.0643994452324],[104.38283048337,30.064375398707],[104.382793792664,30.0642611758656],[104.382782011956,30.0642246008407],[104.38275264637,30.0641371581011],[104.382750023014,30.0641287507218],[104.382747304165,30.0641200374885],[104.382729408218,30.0640626988975],[104.382716720263,30.0640225077733],[104.38270270262,30.0639784375887],[104.382689975041,30.0639387356452],[104.3826713161,30.0638809322816],[104.382663399195,30.063856327909],[104.382654907522,30.0638298281537],[104.382636360236,30.0637717739585],[104.382627110914,30.0637428840243],[104.382617805742,30.0637139787481],[104.382588467743,30.0636234332196],[104.382578885088,30.0635937362802],[104.38256950512,30.0635644828847],[104.38256033144,30.0635356613453],[104.382543454295,30.0634823183279],[104.382536061652,30.0634591209276],[104.382529148288,30.0634376668372],[104.382522316907,30.0634165671504],[104.382515303541,30.0633947883123],[104.38250817665,30.06337241582],[104.382494409324,30.063328855673],[104.382487649991,30.0633077038831],[104.382472671016,30.063261472551],[104.382463965776,30.0632344464439],[104.382454535309,30.0632049150755],[104.382444646285,30.0631738733328],[104.382434609517,30.0631424924095],[104.382415669295,30.0630835006239],[104.382407500949,30.0630578311594],[104.382393168709,30.0630124610221],[104.382386047198,30.0629903070381],[104.382378670754,30.0629677778044],[104.382371166392,30.0629450829774],[104.382363717878,30.0629224601449],[104.382356414389,30.0628999435625],[104.382349246916,30.0628774999472],[104.38234213619,30.0628550806637],[104.382334946188,30.0628325174151],[104.382327546286,30.0628095034147],[104.382312272617,30.062762180857],[104.382297747562,30.0627168428705],[104.382290833229,30.0626953302657],[104.382276905467,30.0626521637674],[104.38226978752,30.0626298802561],[104.382254183147,30.0625806355233],[104.38224527782,30.0625526990569],[104.382226975282,30.0624955657205],[104.382210648387,30.0624445261625],[104.38220312052,30.0624210767428],[104.382188776496,30.0623766166007],[104.382181622497,30.0623543842953],[104.382158400121,30.0622818662659],[104.382150803763,30.0622580480493],[104.382136439857,30.0622128117521],[104.382129287636,30.0621903977732],[104.382114831844,30.0621452558086],[104.382100429181,30.0620999592033],[104.382093199473,30.0620773059255],[104.382086011212,30.0620549791361],[104.382071627495,30.0620106475009],[104.382063718515,30.0619861886584],[104.382054877094,30.0619586748707],[104.382027718559,30.0618736570841],[104.381998550093,30.0617825535291],[104.381990878921,30.0617586911341],[104.381976301442,30.061713459055],[104.381969471699,30.0616920750532],[104.381955573454,30.0616482420319],[104.381948308572,30.0616255320278],[104.381933627469,30.0615800956857],[104.381926342768,30.0615575025688],[104.381919100403,30.0615349301738],[104.381904662506,30.0614897854217],[104.381875812802,30.0613993205533],[104.381868563214,30.0613767076695],[104.381846757693,30.0613089615837],[104.381839554039,30.0612863963991],[104.381825187252,30.0612411176752],[104.381817935844,30.0612184346301],[104.381803453755,30.0611733563353],[104.381796342879,30.061151022351],[104.381782134622,30.0611061088763],[104.381767088516,30.0610586936105],[104.381740159362,30.0609734851107],[104.381730638529,30.0609435658134],[104.381721819513,30.060916063635],[104.381692839923,30.0608263341021],[104.381684651537,30.0608008937381],[104.38167545502,30.060772164523],[104.3816658729,30.0607420454983],[104.381648809575,30.0606882341332],[104.381641606765,30.0606656572087],[104.381627637187,30.0606220047241],[104.381613330653,30.0605771702133],[104.38159834754,30.0605305661022],[104.381590397859,30.0605057122908],[104.381582366179,30.0604803403933],[104.381574526387,30.0604554336213],[104.381567012729,30.0604316701862],[104.381559766656,30.0604090473352],[104.381545353804,30.0603644914786],[104.381537791502,30.0603408709814],[104.381529855309,30.0603159308315],[104.38152171461,30.0602904320105],[104.381513713561,30.0602656123034],[104.381498775453,30.0602195297867],[104.381491359989,30.0601964139328],[104.381483472432,30.0601716356931],[104.381475064137,30.060145134767],[104.381458045727,30.0600913970752],[104.381442734549,30.0600429498724],[104.381435565008,30.0600203270626],[104.381428441415,30.0599979291238],[104.381407312078,30.059931613259],[104.381399783067,30.0599080530113],[104.381391307188,30.0598816338345],[104.381363566873,30.059795349529],[104.381355725231,30.0597708536834],[104.381348621437,30.0597485348836],[104.381341757281,30.059726838637],[104.381327525338,30.0596816785024],[104.381320008005,30.0596579239926],[104.381312406892,30.0596340875633],[104.3813050148,30.0596110984873],[104.381291000015,30.059567793832],[104.381275751848,30.0595205462891],[104.381259638778,30.0594705262192],[104.381252243065,30.0594474687782],[104.38122782339,30.0593708416746],[104.381209102979,30.0593122099279],[104.381201091006,30.0592870160078],[104.381187149092,30.0592429298654],[104.381180138044,30.0592208494316],[104.381165608732,30.0591753615816],[104.381151318167,30.0591308128395],[104.381128121,30.0590588578732],[104.38110932305,30.0590002835439],[104.381100531745,30.0589728108793],[104.381092727857,30.0589483401794],[104.381078570573,30.0589038499848],[104.38107148653,30.0588817388779],[104.381057313943,30.058837727994],[104.38104980465,30.0588142459146],[104.381041392614,30.0587878383875],[104.381032074236,30.0587586681848],[104.381022517117,30.0587289509649],[104.38100565432,30.0586768409195],[104.380998494583,30.0586546038176],[104.380984549881,30.0586110400778],[104.380968984395,30.0585626463379],[104.380960117367,30.0585350098821],[104.380950740396,30.0585055994792],[104.38093274232,30.0584488658085],[104.380924863603,30.058424162068],[104.380903379808,30.0583573265868],[104.380881542822,30.0582892946569],[104.38087404879,30.0582657729768],[104.380859278733,30.058219103038],[104.380852111735,30.0581965637224],[104.380837624587,30.058151338349],[104.380816753342,30.0580860052556],[104.38080918903,30.0580625437448],[104.380790887291,30.0580060246284],[104.380781143592,30.0579758583889],[104.380754862159,30.0578943484882],[104.380746272546,30.0578675162255],[104.380737156769,30.057838860534],[104.380718520671,30.0577800981512],[104.380710035548,30.0577534251584],[104.380701960358,30.0577281599927],[104.380674938256,30.0576441321115],[104.380666130587,30.0576166413129],[104.380651162221,30.0575697480445],[104.380644153739,30.0575478545415],[104.380622426454,30.0574802685847],[104.380607919361,30.0574350808486],[104.380600698243,30.0574125387202],[104.38057902676,30.0573446641049],[104.380571802933,30.0573221606373],[104.380557148965,30.0572766948433],[104.380549599888,30.05725315414],[104.380542024675,30.0572294083648],[104.38049970325,30.0570963516867],[104.380492467682,30.0570736629287],[104.380485351946,30.0570514850982],[104.380470629459,30.0570058717056],[104.380462166788,30.0569794918398],[104.380443474644,30.056920775091],[104.380434688515,30.0568932518681],[104.38042681416,30.0568687854166],[104.380412462842,30.0568244898582],[104.380405281319,30.0568022220118],[104.38039803492,30.0567796357417],[104.380390817344,30.0567570297133],[104.380369306937,30.0566892486294],[104.380362184855,30.0566669430596],[104.380347882138,30.0566224802445],[104.38034007983,30.0565981433421],[104.380312736576,30.0565124240928],[104.380273777196,30.0563905183325],[104.380263733274,30.0563592184843],[104.380245623042,30.0563030490484],[104.380237821606,30.0562787687765],[104.380230667052,30.0562563165539],[104.380223849451,30.056234838623],[104.380217046271,30.0562135279776],[104.380202938991,30.0561698395965],[104.380195779025,30.0561474718958],[104.380188583002,30.0561246275198],[104.380181151816,30.0561008521163],[104.380173327816,30.0560760394093],[104.380165210118,30.0560507389794],[104.380157059997,30.0560256318681],[104.380149025193,30.0560008108517],[104.380141063351,30.0559758972758],[104.380125292802,30.0559261098397],[104.380117747196,30.0559024341306],[104.380110522338,30.0558798621996],[104.380103436228,30.0558577598481],[104.38009617353,30.0558351941713],[104.380088476572,30.0558114445601],[104.380080325531,30.0557864633309],[104.380063824338,30.0557360824851],[104.380056082331,30.0557123885782],[104.380048735838,30.0556897355725],[104.380041605563,30.0556674757816],[104.380027356695,30.0556224786692],[104.380020149823,30.0555998132049],[104.38001293755,30.0555772583495],[104.379991314237,30.0555097178916],[104.379967470928,30.0554356560552],[104.379959501827,30.0554108107707],[104.379951910226,30.0553870612289],[104.379937522571,30.0553418615879],[104.379916106394,30.0552744354949],[104.37988010881,30.0551613544688],[104.379872226169,30.0551366351516],[104.379844123816,30.0550488768527],[104.379834805909,30.0550197053684],[104.379819090141,30.05497022359],[104.379812033679,30.0549481167012],[104.379804873618,30.0549259944183],[104.379790120144,30.0548809427248],[104.379782799705,30.0548584002945],[104.379775586468,30.054835900238],[104.379768424576,30.0548133723526],[104.379754086365,30.0547681411953],[104.379746870409,30.0547454594671],[104.379739622021,30.0547227884963],[104.379725121642,30.0546775958323],[104.379717942621,30.0546550805077],[104.37970364042,30.0546099518842],[104.379696394722,30.0545872548252],[104.379689084161,30.0545645810813],[104.37967456215,30.0545197391039],[104.379667266897,30.0544970491824],[104.379620851804,30.0543517465053],[104.379599417356,30.0542844208864],[104.379592167125,30.0542617444815],[104.379570350665,30.0541938716706],[104.379563125655,30.0541712843164],[104.379555948388,30.054148706002],[104.379541658709,30.0541035287493],[104.379534451706,30.0540809081316],[104.379527171732,30.0540583009279],[104.379512565838,30.0540131665078],[104.379505322795,30.0539905935101],[104.37949808245,30.0539679611586],[104.379490802464,30.0539453089801],[104.379483487343,30.0539226774484],[104.379476201049,30.0539000594339],[104.379469048984,30.0538775152979],[104.379462145571,30.0538553374347],[104.379455487218,30.0538337497705],[104.379448688317,30.0538119155493],[104.379440921771,30.0537874858144],[104.379431402813,30.0537579785529],[104.37940857263,30.0536875055664],[104.379398040047,30.053654879332],[104.379389249068,30.053627497883],[104.379381601438,30.0536035107174],[104.379358426063,30.0535304652952],[104.379350809959,30.0535065842732],[104.379329160878,30.0534390990599],[104.37932198445,30.0534165656552],[104.379307631578,30.0533712677163],[104.379300383068,30.0533485777517],[104.37928580497,30.053303319142],[104.379264013483,30.0532355072835],[104.379256703705,30.0532128855935],[104.379242116588,30.0531679300227],[104.379234909516,30.0531455836233],[104.379227724956,30.0531230789656],[104.379212709795,30.0530756300366],[104.379204282752,30.0530492525426],[104.379195001574,30.0530205260552],[104.379185193316,30.0529903088571],[104.379175602188,30.052960625173],[104.379166923752,30.0529334290325],[104.379152234706,30.0528867268402],[104.379145245635,30.0528646882091],[104.379130816108,30.0528197192554],[104.379123575659,30.0527970670271],[104.379102274141,30.0527298796787],[104.379095001248,30.0527071203913],[104.37908362658403,30.05267173325725],[104.3789080759742,30.05270411221024],[104.378909414647,30.0527083453043],[104.378913643081,30.0527215309617],[104.378921885509,30.0527473309869],[104.378929011579,30.0527694804289],[104.378933255333,30.0527828585531],[104.378937057586,30.0527947370595],[104.378941033745,30.0528074053452],[104.378944613462,30.0528188717337],[104.378948008469,30.0528296985168],[104.378969602918,30.0528973845017],[104.3789733403,30.0529091801995],[104.378977959762,30.0529236486768],[104.378981440353,30.0529345780666],[104.378993151631,30.0529711563641],[104.379005563005,30.0530103353031],[104.379016230911,30.0530437190422],[104.379020802614,30.053058057962],[104.379024940929,30.0530709566287],[104.379029270255,30.0530844472419],[104.379036900857,30.0531081395059],[104.379044516139,30.0531317679007],[104.37904834721,30.0531437705283],[104.379051825086,30.0531546342569],[104.379059260181,30.0531781041826],[104.379066650222,30.053201395096],[104.379070362359,30.0532130432676],[104.379074666456,30.0532265824113],[104.379082154692,30.0532499525618],[104.379091515212,30.0532792511322],[104.379095136344,30.0532906114259],[104.379099788222,30.0533051959294],[104.379107072834,30.0533281359909],[104.37911166885,30.0533426044234],[104.379115635961,30.0533549866937],[104.379124508138,30.0533829798435],[104.37912876266,30.0533961277257],[104.379132710852,30.053408563034],[104.379141674888,30.0534360382667],[104.379145310429,30.0534474471321],[104.379149709106,30.0534609989525],[104.379153395099,30.0534725112901],[104.379157534292,30.0534853694698],[104.379161714933,30.0534984255413],[104.379165686551,30.0535110101557],[104.379175359671,30.0535409061666],[104.37917922407,30.053553219975],[104.379183070444,30.0535653664915],[104.37918788628,30.0535802865944],[104.379191728138,30.053592230759],[104.379196103391,30.053605914748],[104.379203909629,30.0536299273057],[104.379211495151,30.0536539342393],[104.379215620819,30.053666726747],[104.379219122101,30.0536777289747],[104.379223320754,30.0536908695916],[104.379230175541,30.0537121499437],[104.379238008826,30.0537368271149],[104.379241546141,30.053747841068],[104.379245203289,30.0537592679296],[104.379252709499,30.0537827432753],[104.379256488275,30.0537944157734],[104.379260493198,30.0538067378088],[104.379264603539,30.0538194448589],[104.37927571192,30.0538540295426],[104.379279717749,30.0538665179499],[104.379283296508,30.0538777513736],[104.379290680173,30.0539008884415],[104.379297852108,30.0539234803054],[104.379304987993,30.0539457843495],[104.379308601886,30.0539570852547],[104.379312377057,30.0539689142229],[104.379319626459,30.0539914782819],[104.379323575523,30.0540038991765],[104.379327587659,30.0540165827354],[104.379334804626,30.0540391386637],[104.379342518054,30.0540636043456],[104.379346145454,30.0540748944682],[104.379353450703,30.0540975062397],[104.379357136671,30.0541090940944],[104.379360806416,30.0541205092633],[104.379364428408,30.0541317957809],[104.379368111662,30.0541431749901],[104.379371691312,30.0541544443766],[104.379378879448,30.0541772053089],[104.379389922895,30.0542112520923],[104.379393745809,30.0542232681566],[104.379397456092,30.0542347948776],[104.379401685349,30.0542480074456],[104.379405316349,30.0542593892949],[104.379410096108,30.0542742643591],[104.379416596771,30.054294761902],[104.379421804497,30.054310916228],[104.379424883183,30.0543204988798],[104.379432124436,30.0543428389731],[104.379442136233,30.0543738306087],[104.379446208709,30.0543865295012],[104.379450468591,30.0543998095422],[104.379458868534,30.0544262795687],[104.379470563396,30.0544631049726],[104.379475381892,30.0544782273776],[104.379479170554,30.0544900797205],[104.379484518825,30.0545067656741],[104.379495364929,30.0545406080728],[104.37950912752,30.0545833692504],[104.379519912342,30.0546169193],[104.379523765867,30.0546289371772],[104.379528569937,30.0546440217876],[104.379532107214,30.0546550608866],[104.379537943821,30.0546735081874],[104.379550534225,30.0547130306181],[104.379556334793,30.0547314553958],[104.379565375324,30.0547603748798],[104.37957011271,30.0547751716346],[104.379571474105,30.0547795275035],[104.3795728355,30.0547838833723],[104.379581126369,30.0548096742697],[104.379584686163,30.0548207763374],[104.379602047227,30.0548744570168],[104.379613904192,30.054911550524],[104.379616778335,30.0549205636817],[104.379621502196,30.0549352983618],[104.379631222912,30.0549655728837],[104.379646437818,30.0550128958986],[104.379651777947,30.0550295638273],[104.379661895095,30.0550612911356],[104.379666496416,30.0550756731526],[104.379689349829,30.0551468375393],[104.379693697965,30.0551603388659],[104.379701277014,30.0551837844936],[104.379704883643,30.0551950385784],[104.37970917502,30.0552084786921],[104.379718482164,30.055237703266],[104.379731885175,30.0552799477696],[104.379737886606,30.0552986847766],[104.379745093554,30.0553213242308],[104.379751413925,30.055340953678],[104.379754815126,30.0553516014107],[104.379760769695,30.0553700595777],[104.379765953027,30.0553861751476],[104.379777888298,30.0554234080616],[104.379782375175,30.055437444608],[104.379791633635,30.0554663885231],[104.379800319975,30.0554936528366],[104.379804537452,30.0555067870944],[104.379809468506,30.0555221991377],[104.379817684515,30.0555476832263],[104.37982785745,30.0555793880505],[104.379832319989,30.0555932950632],[104.379836624859,30.0556067504602],[104.379840292741,30.0556182968678],[104.379853047875,30.055658284281],[104.379860321474,30.0556813509491],[104.37986403079,30.0556928596239],[104.379868282502,30.0557062699971],[104.379875553361,30.0557286306952],[104.379880045627,30.0557426888156],[104.379884459503,30.0557564006199],[104.379888115658,30.055767759952],[104.379892312396,30.0557807547824],[104.37989598117,30.0557922921907],[104.3798996076,30.055803735128],[104.379903653875,30.0558162954362],[104.379907108213,30.0558271014842],[104.379911092323,30.0558395574085],[104.379914272757,30.0558493613429],[104.379917274795,30.0558585562611],[104.379928473917,30.0558938161762],[104.379931638131,30.0559035805225],[104.379935344737,30.055915141346],[104.379938854029,30.0559261039263],[104.379946475359,30.0559498184286],[104.379970084464,30.0560237703342],[104.379983029634,30.0560642147335],[104.379987021841,30.0560766796487],[104.37999213125,30.0560925981546],[104.37999945975,30.0561154256248],[104.38000533498,30.0561336633305],[104.380017019656,30.0561697780468],[104.380027535792,30.0562027619722],[104.380030992816,30.0562135554178],[104.380035718401,30.056228216289],[104.380040332272,30.0562426944869],[104.380051246615,30.0562766428677],[104.380063087177,30.0563140824143],[104.380070417455,30.0563368298293],[104.380074981761,30.0563510300836],[104.380081482257,30.0563714645272],[104.380087099796,30.0563890184796],[104.380092698413,30.0564064779838],[104.380098910592,30.056425957962],[104.380106913878,30.0564506962246],[104.380117575939,30.0564842261479],[104.380121013126,30.056494902652],[104.380124516088,30.0565058607071],[104.380127963191,30.0565166856075],[104.38013121118,30.0565269104656],[104.38014204532,30.0565610547841],[104.380152798371,30.0565950182554],[104.380157125713,30.0566085689551],[104.38016193327,30.0566236480695],[104.380175628844,30.0566663135407],[104.380180932825,30.0566828581309],[104.380186403483,30.0566998822211],[104.380194201332,30.056724204772],[104.380199508914,30.0567407592549],[104.3802033281,30.056752641212],[104.380208226644,30.0567679605264],[104.380212607131,30.0567816191886],[104.380223903406,30.056816660553],[104.380227806374,30.0568287179566],[104.380231385892,30.0568396787727],[104.380235167233,30.0568514320859],[104.380238634131,30.0568620834247],[104.38024238484,30.0568737755532],[104.380245993196,30.0568850286739],[104.380253270272,30.0569077418165],[104.380257277761,30.0569204153514],[104.380261835741,30.0569348871639],[104.380269040734,30.0569573304363],[104.380274094239,30.0569733009981],[104.380277707998,30.0569846089785],[104.380283011061,30.0570012245953],[104.380290240382,30.0570239134],[104.380295464152,30.0570401485252],[104.380300316722,30.0570551656084],[104.38031462038,30.0570999189287],[104.380318941383,30.0571133266069],[104.380322759654,30.0571252777949],[104.380330443937,30.0571491595322],[104.38033737954,30.0571710980055],[104.380340935633,30.0571823123923],[104.380345298077,30.0571958972728],[104.380349083911,30.0572077629903],[104.380353585106,30.0572218768045],[104.380357592571,30.0572343749589],[104.380365872396,30.0572604884782],[104.380369971753,30.0572731944635],[104.380377703762,30.0572969719147],[104.380381320212,30.0573083302467],[104.380384958277,30.0573196040637],[104.380388821588,30.0573317306542],[104.380408344441,30.0573927424139],[104.380412682556,30.0574064297825],[104.380417393665,30.0574212254752],[104.380422066928,30.0574358052941],[104.380426323045,30.0574490474183],[104.38044300335,30.0575010919727],[104.380446744119,30.0575127849645],[104.380456988903,30.057545115565],[104.380461249524,30.0575584701031],[104.380479151504,30.0576143909914],[104.380484247305,30.0576303219884],[104.380489848538,30.0576477931101],[104.380493467673,30.0576591028677],[104.380498970696,30.0576761799908],[104.38050981188,30.0577101380212],[104.380519534952,30.057740098389],[104.380524182066,30.057754539671],[104.380535054767,30.0577884707434],[104.380539816307,30.0578034355372],[104.380544660737,30.057818714273],[104.380549537596,30.0578340146232],[104.380571169464,30.0579017911988],[104.380576012977,30.0579168774746],[104.380584856709,30.0579443503505],[104.380595655507,30.0579780699885],[104.380603145106,30.0580013902902],[104.380606939008,30.0580132236067],[104.380611147349,30.0580264090003],[104.38061895949,30.0580508654498],[104.380632650334,30.058093880536],[104.380636372155,30.0581054637683],[104.38063999216,30.058116572961],[104.380643725678,30.0581279124889],[104.380651061209,30.0581509178672],[104.380655100151,30.0581632820131],[104.380658846297,30.0581750055597],[104.380663190672,30.0581885957708],[104.380667476483,30.0582019718869],[104.380671913666,30.0582161224615],[104.380676726528,30.0582310926789],[104.380680977216,30.0582447178695],[104.380684900851,30.0582571421533],[104.380694955416,30.0582883294533],[104.380698603348,30.0582996652936],[104.380702124243,30.0583105135802],[104.380706785741,30.0583250366849],[104.380710329161,30.0583360117961],[104.380714559109,30.0583492871274],[104.38072675432,30.0583873850494],[104.380734202451,30.0584108491677],[104.380737761187,30.0584219717783],[104.380742407366,30.0584365110501],[104.38075325564,30.058470177618],[104.380762230863,30.0584983637258],[104.3807656995,30.0585091714847],[104.380770006918,30.0585226600212],[104.380776947798,30.0585443915521],[104.380785797772,30.0585719920758],[104.380797083896,30.0586072139708],[104.380816774019,30.0586688218657],[104.380827632185,30.0587027743982],[104.380832672962,30.0587185946648],[104.380843552747,30.0587526749152],[104.380848512438,30.0587682765666],[104.380852154043,30.0587796033883],[104.380855699243,30.058790551504],[104.380866997965,30.058826168184],[104.380873876638,30.0588473582428],[104.380877559684,30.0588588532737],[104.380881382372,30.0588706910788],[104.380886114107,30.0588853563146],[104.38089046745,30.0588989087292],[104.380895146035,30.0589135496306],[104.380907285284,30.0589510799539],[104.380911871073,30.0589655085243],[104.380916172165,30.058979082468],[104.380921747175,30.0589963952016],[104.380925984296,30.0590097109783],[104.380930321419,30.0590232876527],[104.380934798182,30.0590372223893],[104.380938328967,30.0590483557402],[104.380942990416,30.0590627385135],[104.380946648229,30.0590742254174],[104.380951100657,30.0590879218091],[104.380955497234,30.0591016037572],[104.380959487484,30.0591139498275],[104.38096981222,30.0591459439799],[104.38097355742,30.0591576944644],[104.380982108237,30.0591848242973],[104.380987049876,30.0592002208634],[104.380991444649,30.0592140044271],[104.380996580898,30.0592302078661],[104.38100409562,30.0592538914125],[104.38100962557,30.0592711986897],[104.381013172558,30.059282320356],[104.381018880886,30.0593000819581],[104.381022463006,30.0593112495222],[104.38103336432,30.0593451363689],[104.381062458192,30.0594355456627],[104.381073432458,30.0594695036104],[104.38107706412,30.0594807908244],[104.381080609296,30.059491876508],[104.381091386261,30.0595254646404],[104.38110642735,30.0595726518297],[104.381110398662,30.0595850554174],[104.381123608141,30.0596264402484],[104.381128133528,30.0596406744742],[104.381136924835,30.0596683935443],[104.381140927673,30.059680868204],[104.381144848532,30.0596931970953],[104.381155278604,30.0597255582036],[104.381158971522,30.059737112563],[104.38116249236,30.0597480929932],[104.38116614834,30.0597595726731],[104.381180318169,30.0598036797297],[104.381184038117,30.0598154445519],[104.381191575315,30.0598393537996],[104.381195509677,30.0598516674085],[104.381200059376,30.059865971793],[104.381203966713,30.059878285375],[104.381207961435,30.0598907842992],[104.381217988793,30.0599224606201],[104.381222007834,30.059934952371],[104.38122658636,30.0599493826832],[104.381234689301,30.059974457075],[104.381238814653,30.0599873644094],[104.381242838196,30.0599998786447],[104.381250715904,30.0600243538721],[104.381254521424,30.0600362680534],[104.381261742367,30.0600589880843],[104.381265655995,30.0600712180275],[104.381269998468,30.0600848504138],[104.381281002404,30.0601195286638],[104.381286318774,30.0601361567005],[104.381289797251,30.0601470210629],[104.381295712731,30.0601654483022],[104.381299044354,30.060175802611],[104.381302361563,30.0601861479126],[104.381308053607,30.0602037826384],[104.38131177984,30.0602155060816],[104.381320643128,30.0602428294649],[104.381330648825,30.0602745345042],[104.381334402975,30.060286181529],[104.381340152687,30.0603043540949],[104.381348675429,30.0603308812504],[104.381354045843,30.0603477404504],[104.381362741555,30.0603747453034],[104.381367378607,30.0603891774475],[104.381371342668,30.0604014721751],[104.381374958075,30.0604128025034],[104.381378459065,30.0604237649021],[104.38138651423,30.0604491485708],[104.381393928847,30.0604727743646],[104.381399622687,30.060490738224],[104.381411501356,30.0605279991927],[104.381419242078,30.0605521783689],[104.381429532416,30.0605845221587],[104.381438321798,30.0606118220536],[104.381442067827,30.0606234996335],[104.381445701233,30.0606346582004],[104.381453689687,30.0606593789908],[104.381457584354,30.0606712734448],[104.381463516004,30.0606895630694],[104.381467576443,30.0607020746102],[104.381471605361,30.0607147102264],[104.381478830721,30.0607369023082],[104.381482783969,30.0607495099725],[104.381485957904,30.060759317326],[104.381489958902,30.0607721462663],[104.38149340672,30.0607828927647],[104.381497703215,30.0607965673411],[104.381505717799,30.0608217800681],[104.38151058907,30.0608370640635],[104.381516059442,30.0608540303464],[104.381520718996,30.0608686567396],[104.381525476743,30.0608834882689],[104.381531100265,30.0609008575875],[104.381536180536,30.0609166193131],[104.381544376172,30.0609419778895],[104.381548514989,30.060954958037],[104.381551937572,30.0609655956872],[104.381555326828,30.0609763169421],[104.381558721488,30.0609870049269],[104.381561913439,30.0609970353196],[104.38156548018,30.0610084114433],[104.381568909065,30.0610190437016],[104.381572609144,30.0610309100778],[104.381576347941,30.0610424554338],[104.381580056124,30.0610542930385],[104.381583920151,30.0610663124516],[104.381587582379,30.0610778550362],[104.381591392357,30.0610898429212],[104.381595028451,30.0611011588523],[104.381602555615,30.0611249933399],[104.381609742208,30.0611472510024],[104.38161364858,30.0611595420451],[104.381617192778,30.0611705701055],[104.381621175723,30.0611830177002],[104.381624835239,30.0611944667485],[104.381628816377,30.0612068271068],[104.381632759685,30.0612192548778],[104.381640920154,30.0612444838919],[104.381649454532,30.061271594626],[104.381653724862,30.061284901334],[104.381657960064,30.0612983015373],[104.381662087153,30.0613113005431],[104.381666386313,30.0613247610594],[104.381670054841,30.061336430443],[104.381674712557,30.0613508940331],[104.381677914411,30.0613611177754],[104.381681129775,30.0613712866716],[104.381691265028,30.061402693134],[104.381695231743,30.0614150525703],[104.381706821057,30.061450864346],[104.381715398629,30.061477509255],[104.381718945518,30.061488612848],[104.381725684327,30.0615095102947],[104.381729127614,30.0615203781684],[104.381732638471,30.061531498813],[104.381738794393,30.0615507022969],[104.381742385427,30.0615620298582],[104.381746018799,30.0615733844384],[104.381751000837,30.0615890282235],[104.381754893675,30.0616012976507],[104.381762196441,30.0616238989229],[104.381765673954,30.0616348081928],[104.381769299213,30.0616460998101],[104.381773263211,30.0616584115693],[104.381776853339,30.061669712146],[104.381788211083,30.0617048240038],[104.38179534179,30.0617274269054],[104.381798928311,30.0617387130869],[104.381805562597,30.0617593622058],[104.38180917704,30.0617706394189],[104.381812814903,30.0617819175528],[104.381818866306,30.0618009365619],[104.381826192476,30.0618235908994],[104.381831234867,30.0618396016483],[104.381834906061,30.0618510066142],[104.381839337636,30.0618651237295],[104.381843885424,30.0618795296334],[104.381854440448,30.0619125345159],[104.381864557639,30.0619444004513],[104.381871753172,30.061966801048],[104.38188082531,30.0619955210925],[104.381889198316,30.0620214930698],[104.381893288431,30.0620343741974],[104.381901385752,30.0620593962358],[104.381905612793,30.0620725032177],[104.381909250645,30.0620838442915],[104.381913682179,30.0620973687454],[104.381917195711,30.0621084533973],[104.381921682196,30.0621220705308],[104.381925200233,30.062133220836],[104.381929638977,30.0621468577088],[104.381933212866,30.0621581195802],[104.381937615587,30.0621719794489],[104.381941241723,30.0621832917297],[104.381945570582,30.0621972000916],[104.381956583209,30.0622313510915],[104.381960670625,30.0622445532632],[104.381964388664,30.0622564465851],[104.381967844529,30.0622673099452],[104.381974958944,30.0622892967549],[104.381978429216,30.0623000683968],[104.381981847235,30.0623106691195],[104.381985262555,30.0623213624691],[104.381992789579,30.0623446671564],[104.382000273376,30.0623682344024],[104.382007660762,30.062391214303],[104.382011074276,30.0624018761716],[104.382024900401,30.0624451173507],[104.382028484184,30.0624563441461],[104.382037580579,30.0624848825014],[104.382045846339,30.0625107832876],[104.382051126511,30.0625272735538],[104.382054724702,30.0625384850708],[104.382064033687,30.0625674184145],[104.382074868784,30.0626009666624],[104.382078484093,30.0626123211836],[104.382084912924,30.0626328396469],[104.382088259766,30.0626434043185],[104.382105977716,30.0626985587093],[104.38210956869,30.0627097189517],[104.382113343444,30.0627213757862],[104.382117116398,30.0627330721886],[104.382120901966,30.0627448774195],[104.382124523572,30.0627561914714],[104.382128331664,30.0627681190292],[104.382135672172,30.0627911006521],[104.382143274846,30.0628150402875],[104.382147633379,30.0628286024092],[104.382151507235,30.0628407710415],[104.382155578383,30.0628534821432],[104.382166118851,30.0628861838276],[104.382170524226,30.0628998655982],[104.38217607824,30.0629171340028],[104.382185585372,30.0629465594159],[104.382190733984,30.0629626241583],[104.382195218628,30.062976450788],[104.382202741076,30.0629995503716],[104.3822146554,30.0630368218325],[104.382218164374,30.0630476429433],[104.38222147426,30.0630580510841],[104.382225377827,30.0630701585801],[104.382228645376,30.0630805639833],[104.38223222554,30.0630920659408],[104.38224171464,30.0631216064311],[104.382246113714,30.0631356658974],[104.382251213665,30.0631515803983],[104.382256677585,30.0631688325168],[104.382261681141,30.0631844843267],[104.382267870269,30.0632038424099],[104.382274072906,30.0632231681287],[104.382288130422,30.0632672547508],[104.382293783513,30.0632849126277],[104.382297809593,30.0632974779784],[104.382307272555,30.0633272045817],[104.382314474266,30.0633495717979],[104.382318790432,30.0633630879896],[104.382322334531,30.0633741294525],[104.382331739817,30.0634034656912],[104.38234256761,30.0634373906446],[104.382346199994,30.0634487154701],[104.382356319678,30.0634803384183],[104.382367235734,30.0635142382621],[104.382371439277,30.0635273424557],[104.382378686918,30.0635499201379],[104.38239526954,30.0636014139908],[104.382402495556,30.0636240006404],[104.382413258455,30.0636577303559],[104.382429568985,30.0637083381133],[104.382433277032,30.0637199291946],[104.382437236426,30.0637323038097],[104.382445322773,30.0637575280303],[104.382453092018,30.0637820217143],[104.382462349512,30.0638109323983],[104.382467256635,30.0638263394701],[104.38247220339,30.0638417519731],[104.382477964546,30.0638597615448],[104.382482924809,30.0638751389847],[104.3824955588,30.0639145252775],[104.382504827075,30.0639431661624],[104.382516853857,30.0639805886844],[104.382532658029,30.0640297129487],[104.382538466009,30.0640477072623],[104.382553362073,30.0640938620449],[104.382562631224,30.0641224300671],[104.382567250941,30.0641368305251],[104.382568660817,30.0641411746059],[104.382570069792,30.0641455186859],[104.382575634536,30.0641629677851],[104.382593051258,30.0642173841603],[104.382607104096,30.0642615488613],[104.382607813989,30.0642637618242],[104.38261141751,30.0642750838918],[104.382617941682,30.0642955510602],[104.382625139715,30.0643182194658],[104.382630164817,30.0643339099012],[104.382633760226,30.0643452004826],[104.382637502471,30.0643567870716],[104.382641112292,30.0643680848596],[104.382644364456,30.064378095401],[104.38264780941,30.0643887653157],[104.382651437245,30.0644000649173],[104.382655323635,30.0644122568747],[104.382658970384,30.0644235501972],[104.382666290903,30.0644461530529],[104.382674874479,30.064473330075],[104.382678511319,30.0644846557615],[104.382683046336,30.0644988888512],[104.382686648946,30.0645102073112],[104.382690228134,30.0645214906762],[104.382701671957,30.0645570285247],[104.382705254745,30.0645682813143],[104.382708863653,30.0645795332276],[104.382716349028,30.0646028709612],[104.382723613684,30.0646254593628],[104.382731505356,30.0646502102858],[104.382749583216,30.0647067882198],[104.382756770402,30.0647294520857],[104.382767298936,30.0647627587774],[104.382774496022,30.0647853587962],[104.382778520227,30.0647980050158],[104.382789309991,30.064831807458],[104.382793074738,30.0648435442327],[104.382800519545,30.0648666633736],[104.382808235526,30.0648909437745],[104.382812374135,30.0649039003566],[104.382816417252,30.0649165852585],[104.382820409916,30.0649290344934],[104.382836460769,30.0649796615692],[104.38284396502,30.0650029768032],[104.382849870234,30.0650215206231],[104.382860564469,30.0650548966761],[104.382866196711,30.0650725121527],[104.382873451416,30.0650951184933],[104.382888684218,30.0651425891027],[104.382897217254,30.0651692767837],[104.382901847725,30.0651838192891],[104.38290653855,30.0651984886514],[104.382910982542,30.0652125030893],[104.382919133605,30.0652380635776],[104.382926880185,30.065262563407],[104.3829304206,30.0652737109102],[104.382940797696,30.0653061162863],[104.38294790915,30.065328453584],[104.38295150812,30.0653398133758],[104.382960893358,30.0653692384209],[104.38297135605,30.0654024865224],[104.382976984665,30.0654201019737],[104.382982402471,30.0654369654067],[104.382985916754,30.0654480409342],[104.38298987606,30.0654604064791],[104.38299453443,30.0654748122979],[104.382998402739,30.0654867334977],[104.383008075326,30.0655168539555],[104.383011479692,30.0655274113753],[104.383014753438,30.0655377051783],[104.383019712699,30.065553191341],[104.383026564691,30.0655749177516],[104.383030284362,30.0655865762141],[104.383042200093,30.0656238293431],[104.383049696175,30.0656471058447],[104.383057057133,30.0656701537976],[104.383060540772,30.0656810467272],[104.38306419377,30.0656924065527],[104.383071868231,30.0657165609405],[104.383079121963,30.0657388965331],[104.383084294716,30.0657550690532],[104.383088217065,30.0657672124201],[104.383094382562,30.0657863859423],[104.383103286678,30.0658141305884],[104.383115911339,30.0658533142503],[104.383124700132,30.0658805866459],[104.383129930527,30.065896859033],[104.383133748373,30.0659087477941],[104.383138287809,30.0659229187621],[104.383146194662,30.06594766059],[104.38315049447,30.0659611514598],[104.383159855303,30.0659903488901],[104.383168455821,30.0660174772146],[104.383172364653,30.0660297446636],[104.383176774359,30.0660435458912],[104.383180137262,30.0660539611618],[104.383187601784,30.0660774129658],[104.383190677307,30.0660868261416],[104.383194304155,30.0660979727889],[104.383197798586,30.0661089214689],[104.383202981219,30.0661250148361],[104.383217421073,30.066170194906],[104.383244707135,30.0662554499919],[104.383251774353,30.0662775065872],[104.383255338143,30.0662886837479],[104.383263565674,30.0663146470985],[104.383267187118,30.0663260365474],[104.383271873374,30.0663407643008],[104.38327471018,30.0663498894755],[104.383277753289,30.0663598053316],[104.383281640499,30.0663723677226],[104.383298314428,30.0664245464078],[104.383303207877,30.0664399785038],[104.383308691367,30.066456881502],[104.383312687552,30.0664692641211],[104.383317994464,30.066485424126],[104.383322603219,30.0664995213814],[104.383330514494,30.0665237703356],[104.383334638599,30.0665366072193],[104.38333833029,30.0665480129085],[104.383342737268,30.0665618860532],[104.38334630645,30.0665730802941],[104.383351606171,30.0665897178239],[104.383358713011,30.0666122159921],[104.383362286696,30.0666234480062],[104.383374611254,30.0666619487072],[104.383385657493,30.0666963617835],[104.383391291421,30.0667140194249],[104.383396043416,30.0667289711453],[104.383415519809,30.0667898018525],[104.383433242257,30.0668456802687],[104.383440358971,30.0668679383073],[104.38344387769,30.06687896342],[104.383447392802,30.0668898985974],[104.383451056553,30.066901291657],[104.383454628413,30.0669123033251],[104.383458392153,30.0669239132067],[104.383466536705,30.066948894371],[104.383483645572,30.0670013961819],[104.383488366006,30.0670159692466],[104.383493159411,30.0670308040755],[104.383497633011,30.0670445954162],[104.383502402082,30.0670591730177],[104.38350641174,30.0670714234214],[104.383515327387,30.0670985123453],[104.383519015439,30.0671097156612],[104.383522607102,30.0671206715803],[104.383526224894,30.0671318037879],[104.383534550484,30.06715715471],[104.383538207913,30.0671684587202],[104.383542252695,30.0671807433236],[104.383545939849,30.0671920860293],[104.383549856705,30.0672038893853],[104.383553557366,30.0672151709483],[104.383561138834,30.0672378664294],[104.383568430241,30.0672599573146],[104.383572151612,30.0672711660485],[104.383575831548,30.0672823522629],[104.383579400679,30.06729318315],[104.383587883898,30.0673190027377],[104.383591283672,30.0673293532406],[104.383594870816,30.0673402129196],[104.383599798412,30.0673551755501],[104.38360433143,30.0673687402976],[104.383609339196,30.0673838936514],[104.383615489208,30.06740213985],[104.383620195186,30.0674162857042],[104.383632129472,30.0674518568767],[104.383663331696,30.0675441548135],[104.383667160248,30.0675556199332],[104.383678954893,30.067591019195],[104.383683063603,30.0676033200212],[104.383689719859,30.0676229255106],[104.383693969994,30.067635547514],[104.383698302999,30.0676482963922],[104.383705013295,30.0676679540852],[104.383713617139,30.067693172096],[104.383727959269,30.0677351250687],[104.38373618566,30.0677593193229],[104.383740145708,30.0677708457],[104.383744058906,30.0677821157304],[104.383762752036,30.0678370019313],[104.383778502086,30.0678820452491],[104.383782872004,30.0678947698645],[104.383786875279,30.0679063178557],[104.38379076955,30.0679174871398],[104.383794702559,30.0679288120386],[104.383803092857,30.067953033394],[104.383825126146,30.0680163319495],[104.383829542892,30.0680290440075],[104.383833898378,30.0680415248875],[104.383840615823,30.0680607427879],[104.383852715682,30.0680952285327],[104.383858752095,30.0681124016944],[104.383866578451,30.0681348814673],[104.38388040786,30.0681739785881],[104.383884365172,30.0681852873075],[104.383888363015,30.0681965951618],[104.383896737049,30.0682203812055],[104.383904790374,30.0682429609867],[104.383908832355,30.0682544109681],[104.383912808574,30.0682656324659],[104.383924678665,30.0682989758492],[104.383928661185,30.0683101793637],[104.383936714499,30.0683327546391],[104.383951341972,30.0683736231649],[104.383955407359,30.068384972436],[104.383971430178,30.0684295967966],[104.383981303132,30.0684573707721],[104.383985507241,30.0684691230517],[104.383989505053,30.0684801188283],[104.384001282313,30.0685129836627],[104.384005307142,30.0685239452861],[104.384009393228,30.0685351281933],[104.384013885589,30.0685476109607],[104.384017968978,30.0685589242654],[104.384022032551,30.0685702474451],[104.384026120442,30.0685815580545],[104.384041843231,30.0686250552736],[104.384050152312,30.0686477602362],[104.384054293344,30.0686591626171],[104.384065387749,30.0686899656064],[104.38407344011,30.0687123555821],[104.384078366648,30.0687259979293],[104.384082285174,30.068736786782],[104.384086563123,30.0687485436059],[104.384090509567,30.0687592857167],[104.384094430788,30.0687699504642],[104.384098731244,30.0687815481261],[104.38410711416,30.0688041892829],[104.384112616288,30.0688189733478],[104.38413399243,30.0688765712258],[104.384172676605,30.0689804113962],[104.384176915788,30.0689917356016],[104.384185457198,30.0690143408965],[104.384189556755,30.0690253187443],[104.384193568941,30.0690362353637],[104.384197355918,30.069046364889],[104.384201614025,30.0690579867806],[104.384205512695,30.069068330437],[104.384210437388,30.0690815959452],[104.384214551347,30.0690924550916],[104.384220246214,30.0691075729451],[104.38422466014,30.0691192777024],[104.384230692803,30.0691352367016],[104.38423581206,30.0691489493308],[104.384241506025,30.0691641337287],[104.384247880099,30.0691812639244],[104.384252838115,30.069194661653],[104.384260501227,30.0692151168133],[104.384264843094,30.0692268979453],[104.38426896876,30.0692379297624],[104.38427705343,30.069259256713],[104.384281258353,30.0692702643137],[104.384288496257,30.0692891201206],[104.384292829086,30.0693003319726],[104.384297199749,30.0693116769548],[104.384302905388,30.0693264134897],[104.384307235518,30.0693377602348],[104.384311734091,30.0693494209831],[104.384320154743,30.0693716205425],[104.384324295705,30.069382515668],[104.384328676284,30.0693941403414],[104.384332886603,30.0694051623278],[104.384337562638,30.0694174995082],[104.384342298115,30.0694298016645],[104.384346926388,30.0694416198968],[104.384373050321,30.0695096680608],[104.384377574993,30.0695211444602],[104.384382038414,30.0695325524592],[104.38438631628,30.0695436572315],[104.384390175283,30.0695538272602],[104.384394914353,30.0695661150215],[104.384398507623,30.069575642713],[104.384402866554,30.0695868842471],[104.38440726783,30.0695984189937],[104.384411531272,30.0696093537789],[104.3844183944,30.0696270662045],[104.384422711886,30.0696380873679],[104.384431594568,30.0696606892761],[104.384441759977,30.0696867069659],[104.384456317622,30.0697238160196],[104.384468629593,30.0697551963303],[104.384473555098,30.0697676829834],[104.384485381534,30.0697977642655],[104.384494347057,30.069820392303],[104.3845021834485,30.06984021384413],[104.38467869789301,30.069806642584275]]]]}},{type:"Feature",properties:{id:"47",seg_name:"S4成宜昭高速:S4成宜昭高速入口-长河大桥",z_order:0,width:15.11,level:"41000",type_no:1,func_no:9,pass_no:1,overlap:1,median:1,walkway:2,fork:2,lane_cnt:4,lane_cnt_s:5,lane_cnt_e:4,p_a_id:null,d_road_id:"294",start_o_id:"43",start_o_tp:"inter",end_o_id:"629",end_o_tp:"inter",lnglat_seq:null,max_speed:120,min_speed:0,p_start_ju:null,p_end_jun:null,sd_rid:"0VRCL095M100VRAC095FE00",hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.3845021834485,30.06984021384413],[104.384494347057,30.069820392303],[104.384485381534,30.0697977642655],[104.384473555098,30.0697676829834],[104.384468629593,30.0697551963303],[104.384456317622,30.0697238160196],[104.384441759977,30.0696867069659],[104.384431594568,30.0696606892761],[104.384422711886,30.0696380873679],[104.3844183944,30.0696270662045],[104.384411531272,30.0696093537789],[104.38440726783,30.0695984189937],[104.384402866554,30.0695868842471],[104.384398507623,30.069575642713],[104.384394914353,30.0695661150215],[104.384390175283,30.0695538272602],[104.38438631628,30.0695436572315],[104.384382038414,30.0695325524592],[104.384377574993,30.0695211444602],[104.384373050321,30.0695096680608],[104.384346926388,30.0694416198968],[104.384342298115,30.0694298016645],[104.384337562638,30.0694174995082],[104.384332886603,30.0694051623278],[104.384328676284,30.0693941403414],[104.384324295705,30.069382515668],[104.384320154743,30.0693716205425],[104.384311734091,30.0693494209831],[104.384307235518,30.0693377602348],[104.384302905388,30.0693264134897],[104.384297199749,30.0693116769548],[104.384292829086,30.0693003319726],[104.384288496257,30.0692891201206],[104.384281258353,30.0692702643137],[104.38427705343,30.069259256713],[104.38426896876,30.0692379297624],[104.384264843094,30.0692268979453],[104.384260501227,30.0692151168133],[104.384252838115,30.069194661653],[104.384247880099,30.0691812639244],[104.384241506025,30.0691641337287],[104.38423581206,30.0691489493308],[104.384230692803,30.0691352367016],[104.38422466014,30.0691192777024],[104.384220246214,30.0691075729451],[104.384214551347,30.0690924550916],[104.384210437388,30.0690815959452],[104.384205512695,30.069068330437],[104.384201614025,30.0690579867806],[104.384197355918,30.069046364889],[104.384193568941,30.0690362353637],[104.384189556755,30.0690253187443],[104.384185457198,30.0690143408965],[104.384176915788,30.0689917356016],[104.384172676605,30.0689804113962],[104.38413399243,30.0688765712258],[104.384112616288,30.0688189733478],[104.38410711416,30.0688041892829],[104.384098731244,30.0687815481261],[104.384094430788,30.0687699504642],[104.384090509567,30.0687592857167],[104.384086563123,30.0687485436059],[104.384082285174,30.068736786782],[104.384078366648,30.0687259979293],[104.38407344011,30.0687123555821],[104.384065387749,30.0686899656064],[104.384054293344,30.0686591626171],[104.384050152312,30.0686477602362],[104.384041843231,30.0686250552736],[104.384026120442,30.0685815580545],[104.384022032551,30.0685702474451],[104.384017968978,30.0685589242654],[104.384013885589,30.0685476109607],[104.384009393228,30.0685351281933],[104.384005307142,30.0685239452861],[104.384001282313,30.0685129836627],[104.383989505053,30.0684801188283],[104.383985507241,30.0684691230517],[104.383981303132,30.0684573707721],[104.383971430178,30.0684295967966],[104.383955407359,30.068384972436],[104.383951341972,30.0683736231649],[104.383936714499,30.0683327546391],[104.383928661185,30.0683101793637],[104.383924678665,30.0682989758492],[104.383912808574,30.0682656324659],[104.383908832355,30.0682544109681],[104.383904790374,30.0682429609867],[104.383896737049,30.0682203812055],[104.383888363015,30.0681965951618],[104.383884365172,30.0681852873075],[104.38388040786,30.0681739785881],[104.383866578451,30.0681348814673],[104.383858752095,30.0681124016944],[104.383852715682,30.0680952285327],[104.383840615823,30.0680607427879],[104.383833898378,30.0680415248875],[104.383829542892,30.0680290440075],[104.383825126146,30.0680163319495],[104.383803092857,30.067953033394],[104.383794702559,30.0679288120386],[104.38379076955,30.0679174871398],[104.383786875279,30.0679063178557],[104.383782872004,30.0678947698645],[104.383778502086,30.0678820452491],[104.383762752036,30.0678370019313],[104.383744058906,30.0677821157304],[104.383740145708,30.0677708457],[104.38373618566,30.0677593193229],[104.383727959269,30.0677351250687],[104.383713617139,30.067693172096],[104.383705013295,30.0676679540852],[104.383698302999,30.0676482963922],[104.383693969994,30.067635547514],[104.383689719859,30.0676229255106],[104.383683063603,30.0676033200212],[104.383678954893,30.067591019195],[104.383667160248,30.0675556199332],[104.383663331696,30.0675441548135],[104.383632129472,30.0674518568767],[104.383620195186,30.0674162857042],[104.383615489208,30.06740213985],[104.383609339196,30.0673838936514],[104.38360433143,30.0673687402976],[104.383599798412,30.0673551755501],[104.383594870816,30.0673402129196],[104.383591283672,30.0673293532406],[104.383587883898,30.0673190027377],[104.383579400679,30.06729318315],[104.383575831548,30.0672823522629],[104.383572151612,30.0672711660485],[104.383568430241,30.0672599573146],[104.383561138834,30.0672378664294],[104.383553557366,30.0672151709483],[104.383549856705,30.0672038893853],[104.383545939849,30.0671920860293],[104.383542252695,30.0671807433236],[104.383538207913,30.0671684587202],[104.383534550484,30.06715715471],[104.383526224894,30.0671318037879],[104.383522607102,30.0671206715803],[104.383519015439,30.0671097156612],[104.383515327387,30.0670985123453],[104.38350641174,30.0670714234214],[104.383502402082,30.0670591730177],[104.383497633011,30.0670445954162],[104.383493159411,30.0670308040755],[104.383488366006,30.0670159692466],[104.383483645572,30.0670013961819],[104.383466536705,30.066948894371],[104.383458392153,30.0669239132067],[104.383454628413,30.0669123033251],[104.383451056553,30.066901291657],[104.383447392802,30.0668898985974],[104.38344387769,30.06687896342],[104.383440358971,30.0668679383073],[104.383433242257,30.0668456802687],[104.383415519809,30.0667898018525],[104.383396043416,30.0667289711453],[104.383391291421,30.0667140194249],[104.383385657493,30.0666963617835],[104.383374611254,30.0666619487072],[104.383362286696,30.0666234480062],[104.383358713011,30.0666122159921],[104.383351606171,30.0665897178239],[104.38334630645,30.0665730802941],[104.383342737268,30.0665618860532],[104.38333833029,30.0665480129085],[104.383334638599,30.0665366072193],[104.383330514494,30.0665237703356],[104.383322603219,30.0664995213814],[104.383317994464,30.066485424126],[104.383312687552,30.0664692641211],[104.383308691367,30.066456881502],[104.383303207877,30.0664399785038],[104.383298314428,30.0664245464078],[104.383281640499,30.0663723677226],[104.383277753289,30.0663598053316],[104.38327471018,30.0663498894755],[104.383271873374,30.0663407643008],[104.383267187118,30.0663260365474],[104.383263565674,30.0663146470985],[104.383255338143,30.0662886837479],[104.383251774353,30.0662775065872],[104.383244707135,30.0662554499919],[104.383217421073,30.066170194906],[104.383202981219,30.0661250148361],[104.383197798586,30.0661089214689],[104.383194304155,30.0660979727889],[104.383190677307,30.0660868261416],[104.383187601784,30.0660774129658],[104.383180137262,30.0660539611618],[104.383176774359,30.0660435458912],[104.383172364653,30.0660297446636],[104.383168455821,30.0660174772146],[104.383159855303,30.0659903488901],[104.38315049447,30.0659611514598],[104.383146194662,30.06594766059],[104.383138287809,30.0659229187621],[104.383133748373,30.0659087477941],[104.383129930527,30.065896859033],[104.383124700132,30.0658805866459],[104.383115911339,30.0658533142503],[104.383103286678,30.0658141305884],[104.383094382562,30.0657863859423],[104.383088217065,30.0657672124201],[104.383084294716,30.0657550690532],[104.383079121963,30.0657388965331],[104.383071868231,30.0657165609405],[104.38306419377,30.0656924065527],[104.383060540772,30.0656810467272],[104.383057057133,30.0656701537976],[104.383049696175,30.0656471058447],[104.383042200093,30.0656238293431],[104.383030284362,30.0655865762141],[104.383026564691,30.0655749177516],[104.383019712699,30.065553191341],[104.383014753438,30.0655377051783],[104.383011479692,30.0655274113753],[104.383008075326,30.0655168539555],[104.382998402739,30.0654867334977],[104.38299453443,30.0654748122979],[104.38298987606,30.0654604064791],[104.382985916754,30.0654480409342],[104.382982402471,30.0654369654067],[104.382976984665,30.0654201019737],[104.38297135605,30.0654024865224],[104.382960893358,30.0653692384209],[104.38295150812,30.0653398133758],[104.38294790915,30.065328453584],[104.382940797696,30.0653061162863],[104.3829304206,30.0652737109102],[104.382926880185,30.065262563407],[104.382919133605,30.0652380635776],[104.382910982542,30.0652125030893],[104.38290653855,30.0651984886514],[104.382901847725,30.0651838192891],[104.382897217254,30.0651692767837],[104.382888684218,30.0651425891027],[104.382873451416,30.0650951184933],[104.382866196711,30.0650725121527],[104.382860564469,30.0650548966761],[104.382849870234,30.0650215206231],[104.38284396502,30.0650029768032],[104.382836460769,30.0649796615692],[104.382820409916,30.0649290344934],[104.382816417252,30.0649165852585],[104.382812374135,30.0649039003566],[104.382808235526,30.0648909437745],[104.382800519545,30.0648666633736],[104.382793074738,30.0648435442327],[104.382789309991,30.064831807458],[104.382778520227,30.0647980050158],[104.382774496022,30.0647853587962],[104.382767298936,30.0647627587774],[104.382756770402,30.0647294520857],[104.382749583216,30.0647067882198],[104.382731505356,30.0646502102858],[104.382723613684,30.0646254593628],[104.382716349028,30.0646028709612],[104.382708863653,30.0645795332276],[104.382705254745,30.0645682813143],[104.382701671957,30.0645570285247],[104.382690228134,30.0645214906762],[104.382686648946,30.0645102073112],[104.382683046336,30.0644988888512],[104.382678511319,30.0644846557615],[104.382674874479,30.064473330075],[104.382666290903,30.0644461530529],[104.382658970384,30.0644235501972],[104.382655323635,30.0644122568747],[104.382651437245,30.0644000649173],[104.38264780941,30.0643887653157],[104.382644364456,30.064378095401],[104.382641112292,30.0643680848596],[104.382637502471,30.0643567870716],[104.382633760226,30.0643452004826],[104.382630164817,30.0643339099012],[104.382625139715,30.0643182194658],[104.382617941682,30.0642955510602],[104.38261141751,30.0642750838918],[104.382607813989,30.0642637618242],[104.382607104096,30.0642615488613],[104.382593051258,30.0642173841603],[104.382575634536,30.0641629677851],[104.382570069792,30.0641455186859],[104.382568660817,30.0641411746059],[104.382567250941,30.0641368305251],[104.382562631224,30.0641224300671],[104.382553362073,30.0640938620449],[104.382538466009,30.0640477072623],[104.382532658029,30.0640297129487],[104.382516853857,30.0639805886844],[104.382504827075,30.0639431661624],[104.3824955588,30.0639145252775],[104.382482924809,30.0638751389847],[104.382477964546,30.0638597615448],[104.38247220339,30.0638417519731],[104.382467256635,30.0638263394701],[104.382462349512,30.0638109323983],[104.382453092018,30.0637820217143],[104.382445322773,30.0637575280303],[104.382437236426,30.0637323038097],[104.382433277032,30.0637199291946],[104.382429568985,30.0637083381133],[104.382413258455,30.0636577303559],[104.382402495556,30.0636240006404],[104.38239526954,30.0636014139908],[104.382378686918,30.0635499201379],[104.382371439277,30.0635273424557],[104.382367235734,30.0635142382621],[104.382356319678,30.0634803384183],[104.382346199994,30.0634487154701],[104.38234256761,30.0634373906446],[104.382331739817,30.0634034656912],[104.382322334531,30.0633741294525],[104.382318790432,30.0633630879896],[104.382314474266,30.0633495717979],[104.382307272555,30.0633272045817],[104.382297809593,30.0632974779784],[104.382293783513,30.0632849126277],[104.382288130422,30.0632672547508],[104.382274072906,30.0632231681287],[104.382267870269,30.0632038424099],[104.382261681141,30.0631844843267],[104.382256677585,30.0631688325168],[104.382251213665,30.0631515803983],[104.382246113714,30.0631356658974],[104.38224171464,30.0631216064311],[104.38223222554,30.0630920659408],[104.382228645376,30.0630805639833],[104.382225377827,30.0630701585801],[104.38222147426,30.0630580510841],[104.382218164374,30.0630476429433],[104.3822146554,30.0630368218325],[104.382202741076,30.0629995503716],[104.382195218628,30.062976450788],[104.382190733984,30.0629626241583],[104.382185585372,30.0629465594159],[104.38217607824,30.0629171340028],[104.382170524226,30.0628998655982],[104.382166118851,30.0628861838276],[104.382155578383,30.0628534821432],[104.382151507235,30.0628407710415],[104.382147633379,30.0628286024092],[104.382143274846,30.0628150402875],[104.382135672172,30.0627911006521],[104.382128331664,30.0627681190292],[104.382124523572,30.0627561914714],[104.382120901966,30.0627448774195],[104.382117116398,30.0627330721886],[104.382113343444,30.0627213757862],[104.38210956869,30.0627097189517],[104.382105977716,30.0626985587093],[104.382088259766,30.0626434043185],[104.382084912924,30.0626328396469],[104.382078484093,30.0626123211836],[104.382074868784,30.0626009666624],[104.382064033687,30.0625674184145],[104.382054724702,30.0625384850708],[104.382051126511,30.0625272735538],[104.382045846339,30.0625107832876],[104.382037580579,30.0624848825014],[104.382028484184,30.0624563441461],[104.382024900401,30.0624451173507],[104.382011074276,30.0624018761716],[104.382007660762,30.062391214303],[104.382000273376,30.0623682344024],[104.381992789579,30.0623446671564],[104.381985262555,30.0623213624691],[104.381981847235,30.0623106691195],[104.381978429216,30.0623000683968],[104.381974958944,30.0622892967549],[104.381967844529,30.0622673099452],[104.381964388664,30.0622564465851],[104.381960670625,30.0622445532632],[104.381956583209,30.0622313510915],[104.381945570582,30.0621972000916],[104.381941241723,30.0621832917297],[104.381937615587,30.0621719794489],[104.381933212866,30.0621581195802],[104.381929638977,30.0621468577088],[104.381925200233,30.062133220836],[104.381921682196,30.0621220705308],[104.381917195711,30.0621084533973],[104.381913682179,30.0620973687454],[104.381909250645,30.0620838442915],[104.381905612793,30.0620725032177],[104.381901385752,30.0620593962358],[104.381893288431,30.0620343741974],[104.381889198316,30.0620214930698],[104.38188082531,30.0619955210925],[104.381871753172,30.061966801048],[104.381864557639,30.0619444004513],[104.381854440448,30.0619125345159],[104.381843885424,30.0618795296334],[104.381839337636,30.0618651237295],[104.381834906061,30.0618510066142],[104.381831234867,30.0618396016483],[104.381826192476,30.0618235908994],[104.381818866306,30.0618009365619],[104.381812814903,30.0617819175528],[104.38180917704,30.0617706394189],[104.381805562597,30.0617593622058],[104.381798928311,30.0617387130869],[104.38179534179,30.0617274269054],[104.381788211083,30.0617048240038],[104.381776853339,30.061669712146],[104.381773263211,30.0616584115693],[104.381769299213,30.0616460998101],[104.381765673954,30.0616348081928],[104.381762196441,30.0616238989229],[104.381754893675,30.0616012976507],[104.381751000837,30.0615890282235],[104.381746018799,30.0615733844384],[104.381742385427,30.0615620298582],[104.381738794393,30.0615507022969],[104.381732638471,30.061531498813],[104.381729127614,30.0615203781684],[104.381725684327,30.0615095102947],[104.381718945518,30.061488612848],[104.381715398629,30.061477509255],[104.381706821057,30.061450864346],[104.381695231743,30.0614150525703],[104.381691265028,30.061402693134],[104.381681129775,30.0613712866716],[104.381677914411,30.0613611177754],[104.381674712557,30.0613508940331],[104.381670054841,30.061336430443],[104.381666386313,30.0613247610594],[104.381662087153,30.0613113005431],[104.381657960064,30.0612983015373],[104.381653724862,30.061284901334],[104.381649454532,30.061271594626],[104.381640920154,30.0612444838919],[104.381632759685,30.0612192548778],[104.381628816377,30.0612068271068],[104.381624835239,30.0611944667485],[104.381621175723,30.0611830177002],[104.381617192778,30.0611705701055],[104.38161364858,30.0611595420451],[104.381609742208,30.0611472510024],[104.381602555615,30.0611249933399],[104.381595028451,30.0611011588523],[104.381591392357,30.0610898429212],[104.381587582379,30.0610778550362],[104.381583920151,30.0610663124516],[104.381580056124,30.0610542930385],[104.381576347941,30.0610424554338],[104.381572609144,30.0610309100778],[104.381568909065,30.0610190437016],[104.38156548018,30.0610084114433],[104.381561913439,30.0609970353196],[104.381558721488,30.0609870049269],[104.381555326828,30.0609763169421],[104.381551937572,30.0609655956872],[104.381548514989,30.060954958037],[104.381544376172,30.0609419778895],[104.381536180536,30.0609166193131],[104.381531100265,30.0609008575875],[104.381525476743,30.0608834882689],[104.381520718996,30.0608686567396],[104.381516059442,30.0608540303464],[104.38151058907,30.0608370640635],[104.381505717799,30.0608217800681],[104.381497703215,30.0607965673411],[104.38149340672,30.0607828927647],[104.381489958902,30.0607721462663],[104.381485957904,30.060759317326],[104.381482783969,30.0607495099725],[104.381478830721,30.0607369023082],[104.381471605361,30.0607147102264],[104.381467576443,30.0607020746102],[104.381463516004,30.0606895630694],[104.381457584354,30.0606712734448],[104.381453689687,30.0606593789908],[104.381445701233,30.0606346582004],[104.381442067827,30.0606234996335],[104.381438321798,30.0606118220536],[104.381429532416,30.0605845221587],[104.381419242078,30.0605521783689],[104.381411501356,30.0605279991927],[104.381399622687,30.060490738224],[104.381393928847,30.0604727743646],[104.38138651423,30.0604491485708],[104.381378459065,30.0604237649021],[104.381374958075,30.0604128025034],[104.381371342668,30.0604014721751],[104.381367378607,30.0603891774475],[104.381362741555,30.0603747453034],[104.381354045843,30.0603477404504],[104.381348675429,30.0603308812504],[104.381340152687,30.0603043540949],[104.381334402975,30.060286181529],[104.381330648825,30.0602745345042],[104.381320643128,30.0602428294649],[104.38131177984,30.0602155060816],[104.381308053607,30.0602037826384],[104.381302361563,30.0601861479126],[104.381299044354,30.060175802611],[104.381295712731,30.0601654483022],[104.381289797251,30.0601470210629],[104.381286318774,30.0601361567005],[104.381281002404,30.0601195286638],[104.381269998468,30.0600848504138],[104.381265655995,30.0600712180275],[104.381261742367,30.0600589880843],[104.381254521424,30.0600362680534],[104.381250715904,30.0600243538721],[104.381242838196,30.0599998786447],[104.381238814653,30.0599873644094],[104.381234689301,30.059974457075],[104.38122658636,30.0599493826832],[104.381222007834,30.059934952371],[104.381217988793,30.0599224606201],[104.381207961435,30.0598907842992],[104.381203966713,30.059878285375],[104.381200059376,30.059865971793],[104.381195509677,30.0598516674085],[104.381191575315,30.0598393537996],[104.381184038117,30.0598154445519],[104.381180318169,30.0598036797297],[104.38116614834,30.0597595726731],[104.38116249236,30.0597480929932],[104.381158971522,30.059737112563],[104.381155278604,30.0597255582036],[104.381144848532,30.0596931970953],[104.381140927673,30.059680868204],[104.381136924835,30.0596683935443],[104.381128133528,30.0596406744742],[104.381123608141,30.0596264402484],[104.381110398662,30.0595850554174],[104.38110642735,30.0595726518297],[104.381091386261,30.0595254646404],[104.381080609296,30.059491876508],[104.38107706412,30.0594807908244],[104.381073432458,30.0594695036104],[104.381062458192,30.0594355456627],[104.38103336432,30.0593451363689],[104.381022463006,30.0593112495222],[104.381018880886,30.0593000819581],[104.381013172558,30.059282320356],[104.38100962557,30.0592711986897],[104.38100409562,30.0592538914125],[104.380996580898,30.0592302078661],[104.380991444649,30.0592140044271],[104.380987049876,30.0592002208634],[104.380982108237,30.0591848242973],[104.38097355742,30.0591576944644],[104.38096981222,30.0591459439799],[104.380959487484,30.0591139498275],[104.380955497234,30.0591016037572],[104.380951100657,30.0590879218091],[104.380946648229,30.0590742254174],[104.380942990416,30.0590627385135],[104.380938328967,30.0590483557402],[104.380934798182,30.0590372223893],[104.380930321419,30.0590232876527],[104.380925984296,30.0590097109783],[104.380921747175,30.0589963952016],[104.380916172165,30.058979082468],[104.380911871073,30.0589655085243],[104.380907285284,30.0589510799539],[104.380895146035,30.0589135496306],[104.38089046745,30.0588989087292],[104.380886114107,30.0588853563146],[104.380881382372,30.0588706910788],[104.380877559684,30.0588588532737],[104.380873876638,30.0588473582428],[104.380866997965,30.058826168184],[104.380855699243,30.058790551504],[104.380852154043,30.0587796033883],[104.380848512438,30.0587682765666],[104.380843552747,30.0587526749152],[104.380832672962,30.0587185946648],[104.380827632185,30.0587027743982],[104.380816774019,30.0586688218657],[104.380797083896,30.0586072139708],[104.380785797772,30.0585719920758],[104.380776947798,30.0585443915521],[104.380770006918,30.0585226600212],[104.3807656995,30.0585091714847],[104.380762230863,30.0584983637258],[104.38075325564,30.058470177618],[104.380742407366,30.0584365110501],[104.380737761187,30.0584219717783],[104.380734202451,30.0584108491677],[104.38072675432,30.0583873850494],[104.380714559109,30.0583492871274],[104.380710329161,30.0583360117961],[104.380706785741,30.0583250366849],[104.380702124243,30.0583105135802],[104.380698603348,30.0582996652936],[104.380694955416,30.0582883294533],[104.380684900851,30.0582571421533],[104.380680977216,30.0582447178695],[104.380676726528,30.0582310926789],[104.380671913666,30.0582161224615],[104.380667476483,30.0582019718869],[104.380663190672,30.0581885957708],[104.380658846297,30.0581750055597],[104.380655100151,30.0581632820131],[104.380651061209,30.0581509178672],[104.380643725678,30.0581279124889],[104.38063999216,30.058116572961],[104.380636372155,30.0581054637683],[104.380632650334,30.058093880536],[104.38061895949,30.0580508654498],[104.380611147349,30.0580264090003],[104.380606939008,30.0580132236067],[104.380603145106,30.0580013902902],[104.380595655507,30.0579780699885],[104.380584856709,30.0579443503505],[104.380576012977,30.0579168774746],[104.380571169464,30.0579017911988],[104.380549537596,30.0578340146232],[104.380544660737,30.057818714273],[104.380539816307,30.0578034355372],[104.380535054767,30.0577884707434],[104.380524182066,30.057754539671],[104.380519534952,30.057740098389],[104.38050981188,30.0577101380212],[104.380498970696,30.0576761799908],[104.380493467673,30.0576591028677],[104.380489848538,30.0576477931101],[104.380484247305,30.0576303219884],[104.380479151504,30.0576143909914],[104.380461249524,30.0575584701031],[104.380456988903,30.057545115565],[104.380446744119,30.0575127849645],[104.38044300335,30.0575010919727],[104.380426323045,30.0574490474183],[104.380422066928,30.0574358052941],[104.380417393665,30.0574212254752],[104.380412682556,30.0574064297825],[104.380408344441,30.0573927424139],[104.380388821588,30.0573317306542],[104.380384958277,30.0573196040637],[104.380381320212,30.0573083302467],[104.380377703762,30.0572969719147],[104.380369971753,30.0572731944635],[104.380365872396,30.0572604884782],[104.380357592571,30.0572343749589],[104.380353585106,30.0572218768045],[104.380349083911,30.0572077629903],[104.380345298077,30.0571958972728],[104.380340935633,30.0571823123923],[104.38033737954,30.0571710980055],[104.380330443937,30.0571491595322],[104.380322759654,30.0571252777949],[104.380318941383,30.0571133266069],[104.38031462038,30.0570999189287],[104.380300316722,30.0570551656084],[104.380295464152,30.0570401485252],[104.380290240382,30.0570239134],[104.380283011061,30.0570012245953],[104.380277707998,30.0569846089785],[104.380274094239,30.0569733009981],[104.380269040734,30.0569573304363],[104.380261835741,30.0569348871639],[104.380257277761,30.0569204153514],[104.380253270272,30.0569077418165],[104.380245993196,30.0568850286739],[104.38024238484,30.0568737755532],[104.380238634131,30.0568620834247],[104.380235167233,30.0568514320859],[104.380231385892,30.0568396787727],[104.380227806374,30.0568287179566],[104.380223903406,30.056816660553],[104.380212607131,30.0567816191886],[104.380208226644,30.0567679605264],[104.3802033281,30.056752641212],[104.380199508914,30.0567407592549],[104.380194201332,30.056724204772],[104.380186403483,30.0566998822211],[104.380180932825,30.0566828581309],[104.380175628844,30.0566663135407],[104.38016193327,30.0566236480695],[104.380157125713,30.0566085689551],[104.380152798371,30.0565950182554],[104.38014204532,30.0565610547841],[104.38013121118,30.0565269104656],[104.380127963191,30.0565166856075],[104.380124516088,30.0565058607071],[104.380121013126,30.056494902652],[104.380117575939,30.0564842261479],[104.380106913878,30.0564506962246],[104.380098910592,30.056425957962],[104.380092698413,30.0564064779838],[104.380087099796,30.0563890184796],[104.380081482257,30.0563714645272],[104.380074981761,30.0563510300836],[104.380070417455,30.0563368298293],[104.380063087177,30.0563140824143],[104.380051246615,30.0562766428677],[104.380040332272,30.0562426944869],[104.380035718401,30.056228216289],[104.380030992816,30.0562135554178],[104.380027535792,30.0562027619722],[104.380017019656,30.0561697780468],[104.38000533498,30.0561336633305],[104.37999945975,30.0561154256248],[104.37999213125,30.0560925981546],[104.379987021841,30.0560766796487],[104.379983029634,30.0560642147335],[104.379970084464,30.0560237703342],[104.379946475359,30.0559498184286],[104.379938854029,30.0559261039263],[104.379935344737,30.055915141346],[104.379931638131,30.0559035805225],[104.379928473917,30.0558938161762],[104.379917274795,30.0558585562611],[104.379914272757,30.0558493613429],[104.379911092323,30.0558395574085],[104.379907108213,30.0558271014842],[104.379903653875,30.0558162954362],[104.3798996076,30.055803735128],[104.37989598117,30.0557922921907],[104.379892312396,30.0557807547824],[104.379888115658,30.055767759952],[104.379884459503,30.0557564006199],[104.379880045627,30.0557426888156],[104.379875553361,30.0557286306952],[104.379868282502,30.0557062699971],[104.37986403079,30.0556928596239],[104.379860321474,30.0556813509491],[104.379853047875,30.055658284281],[104.379840292741,30.0556182968678],[104.379836624859,30.0556067504602],[104.379832319989,30.0555932950632],[104.37982785745,30.0555793880505],[104.379817684515,30.0555476832263],[104.379809468506,30.0555221991377],[104.379804537452,30.0555067870944],[104.379800319975,30.0554936528366],[104.379791633635,30.0554663885231],[104.379782375175,30.055437444608],[104.379777888298,30.0554234080616],[104.379765953027,30.0553861751476],[104.379760769695,30.0553700595777],[104.379754815126,30.0553516014107],[104.379751413925,30.055340953678],[104.379745093554,30.0553213242308],[104.379737886606,30.0552986847766],[104.379731885175,30.0552799477696],[104.379718482164,30.055237703266],[104.37970917502,30.0552084786921],[104.379704883643,30.0551950385784],[104.379701277014,30.0551837844936],[104.379693697965,30.0551603388659],[104.379689349829,30.0551468375393],[104.379666496416,30.0550756731526],[104.379661895095,30.0550612911356],[104.379651777947,30.0550295638273],[104.379646437818,30.0550128958986],[104.379631222912,30.0549655728837],[104.379621502196,30.0549352983618],[104.379616778335,30.0549205636817],[104.379613904192,30.054911550524],[104.379602047227,30.0548744570168],[104.379584686163,30.0548207763374],[104.379581126369,30.0548096742697],[104.3795728355,30.0547838833723],[104.379571474105,30.0547795275035],[104.37957011271,30.0547751716346],[104.379565375324,30.0547603748798],[104.379556334793,30.0547314553958],[104.379550534225,30.0547130306181],[104.379537943821,30.0546735081874],[104.379532107214,30.0546550608866],[104.379528569937,30.0546440217876],[104.379523765867,30.0546289371772],[104.379519912342,30.0546169193],[104.37950912752,30.0545833692504],[104.379495364929,30.0545406080728],[104.379484518825,30.0545067656741],[104.379479170554,30.0544900797205],[104.379475381892,30.0544782273776],[104.379470563396,30.0544631049726],[104.379458868534,30.0544262795687],[104.379450468591,30.0543998095422],[104.379446208709,30.0543865295012],[104.379442136233,30.0543738306087],[104.379432124436,30.0543428389731],[104.379424883183,30.0543204988798],[104.379421804497,30.054310916228],[104.379416596771,30.054294761902],[104.379410096108,30.0542742643591],[104.379405316349,30.0542593892949],[104.379401685349,30.0542480074456],[104.379397456092,30.0542347948776],[104.379393745809,30.0542232681566],[104.379389922895,30.0542112520923],[104.379378879448,30.0541772053089],[104.379371691312,30.0541544443766],[104.379368111662,30.0541431749901],[104.379364428408,30.0541317957809],[104.379360806416,30.0541205092633],[104.379357136671,30.0541090940944],[104.379353450703,30.0540975062397],[104.379346145454,30.0540748944682],[104.379342518054,30.0540636043456],[104.379334804626,30.0540391386637],[104.379327587659,30.0540165827354],[104.379323575523,30.0540038991765],[104.379319626459,30.0539914782819],[104.379312377057,30.0539689142229],[104.379308601886,30.0539570852547],[104.379304987993,30.0539457843495],[104.379297852108,30.0539234803054],[104.379290680173,30.0539008884415],[104.379283296508,30.0538777513736],[104.379279717749,30.0538665179499],[104.37927571192,30.0538540295426],[104.379264603539,30.0538194448589],[104.379260493198,30.0538067378088],[104.379256488275,30.0537944157734],[104.379252709499,30.0537827432753],[104.379245203289,30.0537592679296],[104.379241546141,30.053747841068],[104.379238008826,30.0537368271149],[104.379230175541,30.0537121499437],[104.379223320754,30.0536908695916],[104.379219122101,30.0536777289747],[104.379215620819,30.053666726747],[104.379211495151,30.0536539342393],[104.379203909629,30.0536299273057],[104.379196103391,30.053605914748],[104.379191728138,30.053592230759],[104.37918788628,30.0535802865944],[104.379183070444,30.0535653664915],[104.37917922407,30.053553219975],[104.379175359671,30.0535409061666],[104.379165686551,30.0535110101557],[104.379161714933,30.0534984255413],[104.379157534292,30.0534853694698],[104.379153395099,30.0534725112901],[104.379149709106,30.0534609989525],[104.379145310429,30.0534474471321],[104.379141674888,30.0534360382667],[104.379132710852,30.053408563034],[104.37912876266,30.0533961277257],[104.379124508138,30.0533829798435],[104.379115635961,30.0533549866937],[104.37911166885,30.0533426044234],[104.379107072834,30.0533281359909],[104.379099788222,30.0533051959294],[104.379095136344,30.0532906114259],[104.379091515212,30.0532792511322],[104.379082154692,30.0532499525618],[104.379074666456,30.0532265824113],[104.379070362359,30.0532130432676],[104.379066650222,30.053201395096],[104.379059260181,30.0531781041826],[104.379051825086,30.0531546342569],[104.37904834721,30.0531437705283],[104.379044516139,30.0531317679007],[104.379036900857,30.0531081395059],[104.379029270255,30.0530844472419],[104.379024940929,30.0530709566287],[104.379020802614,30.053058057962],[104.379016230911,30.0530437190422],[104.379005563005,30.0530103353031],[104.378993151631,30.0529711563641],[104.378981440353,30.0529345780666],[104.378977959762,30.0529236486768],[104.3789733403,30.0529091801995],[104.378969602918,30.0528973845017],[104.378948008469,30.0528296985168],[104.378944613462,30.0528188717337],[104.378941033745,30.0528074053452],[104.378937057586,30.0527947370595],[104.378933255333,30.0527828585531],[104.378929011579,30.0527694804289],[104.378921885509,30.0527473309869],[104.378913643081,30.0527215309617],[104.378909414647,30.0527083453043],[104.3789080759742,30.05270411221024],[104.37873332236741,30.052736344162177],[104.378754249377,30.0528018768682],[104.37876110339,30.052823281434],[104.378785728071,30.0528998280737],[104.378797582693,30.0529367681234],[104.378829931731,30.0530378462102],[104.378845610221,30.0530866674812],[104.378854608618,30.0531147957408],[104.378863968323,30.0531441897105],[104.378880288338,30.0531955854719],[104.37888752255,30.0532182746264],[104.378895246004,30.053242425675],[104.378912871543,30.0532974973775],[104.378929590653,30.0533496606418],[104.378943998664,30.0533945118632],[104.378958408464,30.0534392875369],[104.378965662474,30.0534619775921],[104.378980014629,30.053507239726],[104.378987195657,30.053529817286],[104.379016162088,30.0536202770455],[104.379023377334,30.053642737721],[104.379037862772,30.053687660922],[104.379045363632,30.05371107786],[104.379053186159,30.0537357020101],[104.379061361881,30.0537615405991],[104.37906996107,30.0537886341685],[104.379079132382,30.0538172967321],[104.379122657061,30.0539523639762],[104.379129938054,30.0539750998842],[104.379146922841,30.0540285088525],[104.379156079715,30.0540572172426],[104.37919431273,30.0541764015157],[104.379208735909,30.0542212031617],[104.379249106024,30.0543473124925],[104.379258397112,30.054376437372],[104.379280880599,30.0544470746992],[104.379296173205,30.0544948899018],[104.379314490438,30.054552049386],[104.379338969539,30.0546280288484],[104.379348828217,30.0546588512888],[104.379372257673,30.0547325049199],[104.379390661364,30.054790255296],[104.379393433719,30.0547989554099],[104.379396207876,30.0548076627199],[104.379438855428,30.0549412789075],[104.379449989852,30.0549756791933],[104.379459359241,30.0550047429357],[104.37946882864,30.0550342267575],[104.379492395819,30.0551078399639],[104.3795089713,30.0551594514743],[104.379518393838,30.0551889379306],[104.37953526755,30.0552419229851],[104.379549032832,30.0552849017828],[104.379556717356,30.0553090436262],[104.379573809999,30.0553630657924],[104.379581950412,30.0553885786493],[104.379589856554,30.0554131038173],[104.379598431221,30.0554396207462],[104.379608339346,30.0554703990835],[104.379676720408,30.0556838642731],[104.37969952786,30.0557548397513],[104.379713737243,30.0557992596248],[104.379721025276,30.0558219405359],[104.379735731968,30.0558674805489],[104.379742992967,30.0558900993745],[104.379749808888,30.0559115180621],[104.379756095937,30.055931384895],[104.379762815452,30.0559525390835],[104.379772069413,30.0559814452299],[104.379802935138,30.0560776950286],[104.379845516249,30.0562109247541],[104.379858971426,30.0562527933392],[104.379865687304,30.056273783825],[104.379879950663,30.0563185544058],[104.379887017914,30.0563406118281],[104.379902864246,30.0563897150918],[104.379912373125,30.0564192509708],[104.379922281141,30.0564502135622],[104.379931480096,30.0564791744616],[104.379946256999,30.0565260769041],[104.379953044942,30.0565475153016],[104.379960296876,30.0565702087077],[104.379982643681,30.0566396906405],[104.379997193471,30.0566850442073],[104.38002409108,30.0567694260296],[104.380032743097,30.0567963934666],[104.380049428139,30.0568480056809],[104.380058598202,30.0568765339404],[104.380067964683,30.0569058618851],[104.380076604082,30.056933023549],[104.380084064113,30.0569565274158],[104.380104687312,30.057021724096],[104.380112695115,30.0570467924116],[104.380121037164,30.0570726578516],[104.380137045518,30.0571220534276],[104.380144917257,30.0571464929769],[104.380171841719,30.0572304619039],[104.380197208377,30.0573093688079],[104.380206228834,30.0573375533341],[104.38021528533,30.0573659312462],[104.380237495908,30.0574357815695],[104.38024477029,30.0574586206167],[104.380253118615,30.0574847531223],[104.380271570324,30.0575423555064],[104.38029595033,30.0576181632039],[104.380324366633,30.0577069421095],[104.380343353453,30.0577660351438],[104.380383074032,30.0578901799686],[104.380396474878,30.0579319556237],[104.380423836932,30.0580170336064],[104.380432137448,30.0580430041369],[104.380451000785,30.0581022984268],[104.380460120263,30.0581308849663],[104.380468282015,30.0581563193575],[104.380482518897,30.0582005761089],[104.380519891375,30.0583173377522],[104.380541561111,30.058385283461],[104.380562386623,30.0584503037501],[104.38057606939,30.0584933089642],[104.380584467158,30.0585195637304],[104.380594798355,30.0585516371636],[104.380618401419,30.0586246082869],[104.380628619081,30.0586563020856],[104.380636951061,30.0586822914741],[104.380667913087,30.0587794019994],[104.380675963961,30.0588045736239],[104.380691825142,30.0588540326036],[104.380699763392,30.0588788866531],[104.380715595743,30.0589285767163],[104.380731696553,30.0589788165142],[104.380739500549,30.0590032495421],[104.380754113898,30.0590491513768],[104.380761690847,30.0590728206583],[104.380787781289,30.0591540650756],[104.380811139132,30.0592265213955],[104.380832602293,30.0592935152101],[104.380846465081,30.0593365780277],[104.38085350324,30.0593585695379],[104.380868408431,30.0594054311685],[104.380876031294,30.0594292398587],[104.380883512697,30.0594523910095],[104.380897691673,30.0594961070122],[104.380904540617,30.0595174346314],[104.380911563448,30.0595394683806],[104.380926490229,30.0595864244305],[104.380933940099,30.0596097814814],[104.380941046705,30.0596319780806],[104.380948054201,30.059653767192],[104.380964515224,30.0597047887146],[104.380974484094,30.059735781584],[104.380984713335,30.0597676857087],[104.381011806307,30.0598523689783],[104.381020333671,30.059879085992],[104.381046221174,30.059960407323],[104.381081623404,30.0600712389531],[104.381096208614,30.0601167296007],[104.38111786973,30.0601840696311],[104.381153917812,30.0602965430451],[104.381163207322,30.0603257779341],[104.381178835806,30.060375449563],[104.381185744145,30.0603971368992],[104.381192593001,30.060418239621],[104.381199567978,30.0604395538011],[104.381206737558,30.0604615714312],[104.381214054899,30.0604842888692],[104.381236912362,30.0605556750802],[104.381245682002,30.0605831683692],[104.381254990407,30.0606126406664],[104.381272269355,30.0606679237573],[104.381279530839,30.0606908884376],[104.381286493192,30.0607124346084],[104.381302586389,30.0607616263778],[104.381312050597,30.0607907912386],[104.381321616614,30.0608204490188],[104.381330458291,30.0608479936117],[104.38134537671,30.0608947093201],[104.381359159949,30.0609377268506],[104.381366668251,30.0609612241391],[104.381375019829,30.060987647704],[104.381384115581,30.0610167186624],[104.381401949418,30.0610739060562],[104.381429822228,30.0611627741952],[104.381437620617,30.0611874291609],[104.38144709651,30.0612171389745],[104.381469604204,30.0612873402697],[104.381489236148,30.0613486787587],[104.381497049826,30.0613731916307],[104.38150449413,30.0613966537494],[104.381520587271,30.0614476017631],[104.381529236093,30.0614747701985],[104.381537771384,30.0615013359817],[104.381545836389,30.0615263248163],[104.381553369855,30.0615497573291],[104.381560603319,30.0615723729773],[104.381567814255,30.0615948492083],[104.381575079233,30.0616172454492],[104.381597238987,30.0616847951305],[104.381605812977,30.0617110839404],[104.381615238333,30.0617401227607],[104.381624762793,30.0617696419063],[104.381633470131,30.0617968049695],[104.381641082858,30.0618206224415],[104.381648233409,30.0618428917527],[104.38165591369,30.0618667110828],[104.381664653446,30.06189389665],[104.381674091416,30.0619234849455],[104.381691694375,30.0619790747563],[104.381699146731,30.0620025710062],[104.381706150426,30.0620245766654],[104.381720307356,30.0620689226648],[104.381742158045,30.06213709697],[104.381749184248,30.0621591116329],[104.381781206204,30.0622596231751],[104.381803073087,30.0623284818294],[104.381812545244,30.0623582490754],[104.381820477736,30.0623829948936],[104.381827539943,30.0624048926598],[104.381834459808,30.0624264242694],[104.381841531935,30.0624486377017],[104.381855918537,30.0624940603308],[104.381863197861,30.0625168234336],[104.381877723151,30.0625618432871],[104.381877822252,30.0625621833212],[104.381877914144,30.0625624487053],[104.381878164587,30.0625630370919],[104.381884848413,30.0625840972274],[104.381891598904,30.06260534628],[104.381905759355,30.0626501490442],[104.381913860298,30.0626756495203],[104.381922341414,30.0627022286287],[104.381938207232,30.0627517993429],[104.381960892868,30.06282252562],[104.381969027117,30.0628479379783],[104.382021663197,30.0630125366238],[104.382029857783,30.0630380245635],[104.382045212704,30.06308560006],[104.382052440617,30.0631080752857],[104.382078417132,30.0631890738158],[104.382087734224,30.0632181879234],[104.382103654903,30.0632681578934],[104.382110729651,30.0632902372634],[104.38212508993,30.0633346372097],[104.382132425025,30.063357410188],[104.38213972229,30.0633802748599],[104.382153694311,30.0634244208264],[104.382160317705,30.0634452946833],[104.382167131179,30.0634666120771],[104.382182917554,30.0635157068437],[104.382191921093,30.0635437810182],[104.382210915546,30.063603124641],[104.382220268617,30.0636321883768],[104.382237319795,30.0636848653567],[104.382245265662,30.0637095319296],[104.38225314487,30.0637342128282],[104.382268461857,30.0637824905367],[104.382275744666,30.0638052688262],[104.382282903141,30.063827443558],[104.382290083231,30.063849612912],[104.382297456116,30.0638725171829],[104.382305312787,30.0638971557785],[104.382313984767,30.0639244561981],[104.382323505378,30.0639543303383],[104.382333373722,30.0639851256942],[104.382351198703,30.0640405741103],[104.38235866617,30.0640639128221],[104.382372446166,30.0641071358067],[104.382379447868,30.0641290342806],[104.382404883511,30.0642082594658],[104.382414370748,30.0642378871322],[104.382445327904,30.0643348113826],[104.382454029554,30.0643619669966],[104.382463487039,30.0643913985685],[104.382481391202,30.0644470043558],[104.382489282044,30.0644716312407],[104.382496902624,30.0644955483165],[104.382526725487,30.0645893490178],[104.382542764802,30.0646396273165],[104.382558561763,30.0646889889821],[104.382584017966,30.0647687455225],[104.3825934673,30.0647982633783],[104.382617368528,30.064872699019],[104.38262433683,30.0648945074709],[104.38263859505,30.0649392910748],[104.382645859734,30.0649620018046],[104.38266038368,30.0650071858338],[104.382667493417,30.0650296356161],[104.382674456331,30.0650520933578],[104.382688251559,30.0650973234794],[104.382695307258,30.0651200888663],[104.382702530495,30.0651428750868],[104.382709882534,30.0651656110599],[104.382724607307,30.0652107565668],[104.382731833221,30.0652331785588],[104.382738986175,30.0652556634355],[104.38275335335,30.0653011134739],[104.382760536929,30.0653237026936],[104.38276759708,30.0653458034711],[104.382782190329,30.0653913211472],[104.382799987963,30.065446642454],[104.382809457933,30.0654761665518],[104.382818228828,30.0655036467701],[104.382825997056,30.0655281196683],[104.382854322298,30.0656176262409],[104.382861413958,30.0656399185779],[104.382868448846,30.0656617144392],[104.382875590015,30.0656834213615],[104.382882942875,30.0657055187752],[104.382890365102,30.0657279148224],[104.38289764681,30.0657502486891],[104.382905003307,30.0657732346258],[104.382923707163,30.0658321422437],[104.382936567961,30.0658724575399],[104.38297739526,30.066000097216],[104.382994546861,30.0660539672257],[104.38300140605,30.0660753573052],[104.383015579337,30.0661190920401],[104.383022843006,30.0661417091435],[104.383030011195,30.066164311771],[104.38303712894,30.0661869044593],[104.383044299831,30.0662095988159],[104.383051535574,30.0662323211072],[104.383058710951,30.0662547016024],[104.383080391108,30.0663221804579],[104.38311148796,30.0664192408028],[104.383122586567,30.0664538249006],[104.383148771857,30.0665351041252],[104.383155740912,30.066556906152],[104.383162481154,30.0665781719814],[104.383176736379,30.0666232754692],[104.383184318916,30.0666471158848],[104.383205655748,30.066713767868],[104.383227519584,30.066782510314],[104.383235073274,30.0668061690285],[104.38324247381,30.0668292277611],[104.383286473358,30.0669654609689],[104.38331069732,30.0670406922053],[104.383318352769,30.0670644031474],[104.383325601927,30.067086778244],[104.383332647487,30.0671084328063],[104.383339942572,30.0671306955249],[104.383348043907,30.0671552081426],[104.383367040989,30.0672124771687],[104.383385409276,30.067268080994],[104.383393247544,30.0672916904533],[104.38343812313,30.0674258755477],[104.383460698282,30.0674936183947],[104.383467931151,30.0675152443089],[104.383475206351,30.0675368594665],[104.383483334639,30.0675608477668],[104.383504551223,30.0676232771237],[104.383534543771,30.0677117736374],[104.383542090989,30.0677338647537],[104.383559425792,30.0677843963138],[104.383585629327,30.0678611596758],[104.383593060316,30.0678827659451],[104.383608318647,30.0679269995478],[104.383638257856,30.0680139526757],[104.383656940223,30.0680681023998],[104.383664481983,30.0680898337515],[104.383671751682,30.0681106079915],[104.383697875711,30.0681846795226],[104.383728261536,30.0682710564784],[104.383736692371,30.0682948848884],[104.383744504328,30.0683168008122],[104.383772401046,30.068394637449],[104.383782901947,30.068424026313],[104.383792701108,30.0684515502827],[104.38381012934,30.0685006311691],[104.383818870019,30.0685250875448],[104.38382843494,30.0685516993924],[104.383852897618,30.0686195820437],[104.383868340367,30.0686623929429],[104.383884375842,30.0687067700544],[104.38389874749,30.0687464396],[104.383909930234,30.0687772148498],[104.383918331245,30.0688002077134],[104.383926289043,30.0688218089502],[104.38393692315,30.068850485611],[104.383952263095,30.0688917522474],[104.383991997005,30.0689984983693],[104.384022048042,30.0690791370733],[104.384045554657,30.0691420176342],[104.384054036667,30.0691646534968],[104.384063246522,30.0691891128941],[104.384082988593,30.0692412694495],[104.384093766739,30.0692698427515],[104.384105077259,30.0692999156646],[104.38411628508,30.0693296530404],[104.384126665949,30.0693570164096],[104.384152935159,30.069425733101],[104.384161487373,30.0694480623232],[104.384170208027,30.0694706947557],[104.384178957499,30.069493319116],[104.384187636711,30.0695158489857],[104.384196246566,30.0695383931829],[104.384213486095,30.0695837226033],[104.384222210338,30.0696064665379],[104.384231002131,30.0696292267145],[104.384248428957,30.0696740949218],[104.38426554769,30.069717987098],[104.384286432629,30.0697713729422],[104.384298956375,30.06980334526],[104.384311517043,30.0698353176032],[104.384322850818,30.0698640360748],[104.38432663547826,30.069873601290368],[104.3845021834485,30.06984021384413]]]]}}],hv={type:av,name:lv,crs:cv,features:uv},dv="FeatureCollection",pv="arrow",fv={type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},mv=[{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38440282341408,30.069417161259377],[104.38439857129363,30.06938438538022],[104.38439417694264,30.06938563985982],[104.38437684042664,30.06934126744882],[104.38437200924864,30.06934264656532],[104.38438875222964,30.06938718755572],[104.38438385260363,30.06938858550292],[104.38440282341408,30.069417161259377]]]]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38436629214564,30.06942912017232],[104.38436100540363,30.069395568510622],[104.38435656331164,30.06939685711832],[104.38433935110064,30.06935331036072],[104.38433442624763,30.06935473885462],[104.38435089000663,30.06939850352392],[104.38434565442563,30.06940002259112],[104.38436629214564,30.06942912017232]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38443480963907,30.069407955520877],[104.38443077220107,30.069375485892976],[104.38442645080808,30.069376655902776],[104.38441745827407,30.069353520658677],[104.38443185315808,30.069359187560877],[104.38443700389108,30.069373491000377],[104.38443510951907,30.069348715920576],[104.38442221647507,30.069332428431178],[104.38442574308007,30.069342222240376],[104.38441103477707,30.069336993940578],[104.38440879722708,30.069331235543178],[104.38440372107108,30.069332609964377],[104.38442083515608,30.069378176466575],[104.38441621474007,30.069379428063378],[104.38443480963907,30.069407955520877]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38289983652786,30.06486280782712],[104.38289579908985,30.06483033819922],[104.38289147769686,30.064831508209018],[104.38288248516285,30.06480837296492],[104.38289688004686,30.06481403986712],[104.38290203077986,30.06482834330662],[104.38290013640786,30.064803568226818],[104.38288724336385,30.06478728073742],[104.38289076996885,30.064797074546618],[104.38287606166585,30.06479184624682],[104.38287382411586,30.06478608784942],[104.38286874795986,30.06478746227062],[104.38288586204486,30.064833028772817],[104.38288124162885,30.06483428036962],[104.38289983652786,30.06486280782712]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38289983652786,30.06486280782712],[104.38289579908985,30.06483033819922],[104.38289147769686,30.064831508209018],[104.38288248516285,30.06480837296492],[104.38289688004686,30.06481403986712],[104.38290203077986,30.06482834330662],[104.38290013640786,30.064803568226818],[104.38288724336385,30.06478728073742],[104.38289076996885,30.064797074546618],[104.38287606166585,30.06479184624682],[104.38287382411586,30.06478608784942],[104.38286874795986,30.06478746227062],[104.38288586204486,30.064833028772817],[104.38288124162885,30.06483428036962],[104.38289983652786,30.06486280782712]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38051651800177,30.057530681899262],[104.38051276047152,30.057497747803506],[104.38050836612052,30.057499002283105],[104.38049346943158,30.05745335369254],[104.38048867545211,30.05745506582807],[104.38050294140753,30.057500549979004],[104.38049804178152,30.057501947926205],[104.38051651800177,30.057530681899262]]]]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38047962511523,30.057545530903386],[104.3804755734039,30.057510849848644],[104.38047113131191,30.057512138456342],[104.3804575145855,30.05746568106834],[104.3804517640972,30.057467764984896],[104.3804654580069,30.057513784861943],[104.3804602224259,30.057515303929144],[104.38047962511523,30.057545530903386]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38054818962891,30.057521905220504],[104.38054415219091,30.057489435592604],[104.38053983079791,30.057490605602403],[104.38053083826391,30.057467470358304],[104.38054523314791,30.057473137260505],[104.38055038388092,30.057487440700005],[104.38054848950891,30.057462665620204],[104.38053559646491,30.057446378130805],[104.38053912306991,30.057456171940004],[104.38052441476691,30.057450943640205],[104.38052217721692,30.057445185242806],[104.38051710106092,30.057446559664005],[104.38053421514591,30.057492126166203],[104.38052959472991,30.057493377763006],[104.38054818962891,30.057521905220504]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38051651800177,30.057531447311845],[104.38051276047152,30.057497747803506],[104.38050836612052,30.057499002283105],[104.38049346943158,30.05745335369254],[104.38048867545211,30.05745506582807],[104.38050294140753,30.057500549979004],[104.38049804178152,30.057501947926205],[104.38051651800177,30.057531447311845]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38054818962891,30.057521905220504],[104.38054415219091,30.057489435592604],[104.38053983079791,30.057490605602403],[104.38053083826391,30.057467470358304],[104.38054523314791,30.057473137260505],[104.38055038388092,30.057487440700005],[104.38054848950891,30.057462665620204],[104.38053559646491,30.057446378130805],[104.38053912306991,30.057456171940004],[104.38052441476691,30.057450943640205],[104.38052217721692,30.057445185242806],[104.38051710106092,30.057446559664005],[104.38053421514591,30.057492126166203],[104.38052959472991,30.057493377763006],[104.38054818962891,30.057521905220504]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37971500068889,30.055027364554658],[104.37971074856844,30.054994588675502],[104.37970635421745,30.0549958431551],[104.37969145752851,30.054950194564537],[104.37968666354904,30.054951906700065],[104.37970092950445,30.054997390851],[104.37969602987845,30.0549987887982],[104.37971500068889,30.055027364554658]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37974617772583,30.0550187460925],[104.37974214028783,30.0549862764646],[104.37973781889484,30.0549874464744],[104.37972882636083,30.0549643112303],[104.37974322124484,30.0549699781325],[104.37974837197784,30.054984281572],[104.37974647760583,30.0549595064922],[104.37973358456183,30.0549432190028],[104.37973711116683,30.054953012812],[104.37972240286383,30.0549477845122],[104.37972016531384,30.0549420261148],[104.37971508915784,30.054943400536],[104.37973220324284,30.0549889670382],[104.37972758282683,30.054990218635],[104.37974617772583,30.0550187460925]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37971500068889,30.055027364554658],[104.37971074856844,30.054994588675502],[104.37970635421745,30.0549958431551],[104.37969145752851,30.054950194564537],[104.37968666354904,30.054951906700065],[104.37970092950445,30.054997390851],[104.37969602987845,30.0549987887982],[104.37971500068889,30.055027364554658]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37974617772583,30.0550187460925],[104.37974214028783,30.0549862764646],[104.37973781889484,30.0549874464744],[104.37972882636083,30.0549643112303],[104.37974322124484,30.0549699781325],[104.37974837197784,30.054984281572],[104.37974647760583,30.0549595064922],[104.37973358456183,30.0549432190028],[104.37973711116683,30.054953012812],[104.37972240286383,30.0549477845122],[104.37972016531384,30.0549420261148],[104.37971508915784,30.054943400536],[104.37973220324284,30.0549889670382],[104.37972758282683,30.054990218635],[104.37974617772583,30.0550187460925]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37971500068889,30.055027364554658],[104.37971074856844,30.054994588675502],[104.37970635421745,30.0549958431551],[104.37969145752851,30.054950194564537],[104.37968666354904,30.054951906700065],[104.37970092950445,30.054997390851],[104.37969602987845,30.0549987887982],[104.37971500068889,30.055027364554658]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37974617772583,30.0550187460925],[104.37974214028783,30.0549862764646],[104.37973781889484,30.0549874464744],[104.37972882636083,30.0549643112303],[104.37974322124484,30.0549699781325],[104.37974837197784,30.054984281572],[104.37974647760583,30.0549595064922],[104.37973358456183,30.0549432190028],[104.37973711116683,30.054953012812],[104.37972240286383,30.0549477845122],[104.37972016531384,30.0549420261148],[104.37971508915784,30.054943400536],[104.37973220324284,30.0549889670382],[104.37972758282683,30.054990218635],[104.37974617772583,30.0550187460925]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37971500068889,30.055027364554658],[104.37971074856844,30.054994588675502],[104.37970635421745,30.0549958431551],[104.37969145752851,30.054950194564537],[104.37968666354904,30.054951906700065],[104.37970092950445,30.054997390851],[104.37969602987845,30.0549987887982],[104.37971500068889,30.055027364554658]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37974617772583,30.0550187460925],[104.37974214028783,30.0549862764646],[104.37973781889484,30.0549874464744],[104.37972882636083,30.0549643112303],[104.37974322124484,30.0549699781325],[104.37974837197784,30.054984281572],[104.37974647760583,30.0549595064922],[104.37973358456183,30.0549432190028],[104.37973711116683,30.054953012812],[104.37972240286383,30.0549477845122],[104.37972016531384,30.0549420261148],[104.37971508915784,30.054943400536],[104.37973220324284,30.0549889670382],[104.37972758282683,30.054990218635],[104.37974617772583,30.0550187460925]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37971500068889,30.055027364554658],[104.37971074856844,30.054994588675502],[104.37970635421745,30.0549958431551],[104.37969145752851,30.054950194564537],[104.37968666354904,30.054951906700065],[104.37970092950445,30.054997390851],[104.37969602987845,30.0549987887982],[104.37971500068889,30.055027364554658]]]]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.3796783146813,30.055043588520288],[104.37967356150082,30.05500769072064],[104.37966911940883,30.05500897932834],[104.37965550268243,30.054962521940336],[104.37964985263518,30.054964576502968],[104.37966344610382,30.05501062573394],[104.37965821052282,30.05501214480114],[104.3796783146813,30.055043588520288]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37974617772583,30.0550187460925],[104.37974214028783,30.0549862764646],[104.37973781889484,30.0549874464744],[104.37972882636083,30.0549643112303],[104.37974322124484,30.0549699781325],[104.37974837197784,30.054984281572],[104.37974647760583,30.0549595064922],[104.37973358456183,30.0549432190028],[104.37973711116683,30.054953012812],[104.37972240286383,30.0549477845122],[104.37972016531384,30.0549420261148],[104.37971508915784,30.054943400536],[104.37973220324284,30.0549889670382],[104.37972758282683,30.054990218635],[104.37974617772583,30.0550187460925]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37971500068889,30.055027364554658],[104.37971074856844,30.054994588675502],[104.37970635421745,30.0549958431551],[104.37969145752851,30.054950194564537],[104.37968666354904,30.054951906700065],[104.37970092950445,30.054997390851],[104.37969602987845,30.0549987887982],[104.37971500068889,30.055027364554658]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37974617772583,30.0550187460925],[104.37974214028783,30.0549862764646],[104.37973781889484,30.0549874464744],[104.37972882636083,30.0549643112303],[104.37974322124484,30.0549699781325],[104.37974837197784,30.054984281572],[104.37974647760583,30.0549595064922],[104.37973358456183,30.0549432190028],[104.37973711116683,30.054953012812],[104.37972240286383,30.0549477845122],[104.37972016531384,30.0549420261148],[104.37971508915784,30.054943400536],[104.37973220324284,30.0549889670382],[104.37972758282683,30.054990218635],[104.37974617772583,30.0550187460925]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38360822752288,30.067181919854637],[104.38360507282955,30.06714870461597],[104.38360067847856,30.06714995909557],[104.38358587747545,30.067105072431254],[104.38357975417479,30.067106909421454],[104.38359525376556,30.06715150679147],[104.38359035413956,30.06715290473867],[104.38360822752288,30.067181919854637]]]]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38357056922378,30.067193707208425],[104.38356750693956,30.06715988774637],[104.38356306484756,30.06716117635407],[104.38354791301131,30.067117165950073],[104.38354163662812,30.067119002940274],[104.38355739154255,30.06716282275967],[104.38355215596155,30.06716434182687],[104.38357056922378,30.067193707208425]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.383641311175,30.067172274756626],[104.383637273737,30.067139805128726],[104.383632952344,30.067140975138525],[104.38362395981,30.067117839894426],[104.383638354694,30.067123506796626],[104.383643505427,30.067137810236126],[104.383641611055,30.067113035156325],[104.383628718011,30.067096747666927],[104.383632244616,30.067106541476125],[104.383617536313,30.067101313176327],[104.383615298763,30.067095554778927],[104.383610222607,30.067096929200126],[104.383627336692,30.067142495702324],[104.383622716276,30.067143747299127],[104.383641311175,30.067172274756626]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38189171326306,30.061827858832963],[104.381891209565,30.061794069390356],[104.38188497763232,30.06179540533942],[104.38187043479324,30.061750245996993],[104.38186464752,30.061752330575455],[104.38187946666173,30.06179739541214],[104.38187456802119,30.061798773154788],[104.38189171326306,30.061827858832963]]]]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38185328955137,30.0618410239294],[104.3818525241388,30.061805814950556],[104.3818462477556,30.06180749885824],[104.38183124566896,30.061762798763365],[104.38182542853333,30.061764482671048],[104.38184104295003,30.061808876600892],[104.3818333888242,30.061810560508576],[104.38185328955137,30.0618410239294]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38192744791044,30.06181763953101],[104.38192341047244,30.06178516990311],[104.38191908907945,30.06178633991291],[104.38191009654544,30.06176320466881],[104.38192449142944,30.06176887157101],[104.38192964216245,30.06178317501051],[104.38192774779044,30.06175839993071],[104.38191485474644,30.061742112441312],[104.38191838135144,30.06175190625051],[104.38190367304844,30.061746677950712],[104.38190143549845,30.061740919553312],[104.38189635934245,30.06174229397451],[104.38191347342745,30.06178786047671],[104.38190885301144,30.061789112073512],[104.38192744791044,30.06181763953101]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38114160893123,30.05947773603655],[104.3811373635249,30.059444367715106],[104.3811329691739,30.059445622194705],[104.38111910580128,30.059400429365613],[104.38111344174816,30.059402419438328],[104.38112754446091,30.059447169890603],[104.3811226448349,30.059448567837805],[104.38114160893123,30.05947773603655]]]]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38110287905451,30.059490441885433],[104.3810997976349,30.059455550845506],[104.38109535554291,30.059456839453205],[104.38108037592455,30.05941267596695],[104.3810744057064,30.05941390062708],[104.3810896822379,30.059458485858805],[104.3810844466569,30.059460004926006],[104.38110287905451,30.059490441885433]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38117360187034,30.05946793785576],[104.38116956443234,30.05943546822786],[104.38116524303935,30.05943663823766],[104.38115625050534,30.05941350299356],[104.38117064538935,30.05941916989576],[104.38117579612235,30.05943347333526],[104.38117390175034,30.05940869825546],[104.38116100870634,30.059392410766062],[104.38116453531134,30.05940220457526],[104.38114982700834,30.059396976275462],[104.38114758945835,30.059391217878062],[104.38114251330235,30.05939259229926],[104.38115962738735,30.05943815880146],[104.38115500697134,30.059439410398262],[104.38117360187034,30.05946793785576]]]]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38282913558224,30.064885531416373],[104.38282722030284,30.064851752455258],[104.38282277821085,30.064853041062957],[104.38280785711243,30.064807459332854],[104.38280249922434,30.06480899015802],[104.38281710490584,30.064854687468557],[104.38281186932484,30.064856206535758],[104.38282913558224,30.064885531416373]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38289983652786,30.06486280782712],[104.38289579908985,30.06483033819922],[104.38289147769686,30.064831508209018],[104.38288248516285,30.06480837296492],[104.38289688004686,30.06481403986712],[104.38290203077986,30.06482834330662],[104.38290013640786,30.064803568226818],[104.38288724336385,30.06478728073742],[104.38289076996885,30.064797074546618],[104.38287606166585,30.06479184624682],[104.38287382411586,30.06478608784942],[104.38286874795986,30.06478746227062],[104.38288586204486,30.064833028772817],[104.38288124162885,30.06483428036962],[104.38289983652786,30.06486280782712]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38286664079884,30.064872213237418],[104.38286440737046,30.06483865041012],[104.38286001301947,30.06483990488972],[104.38284511633053,30.064794256299155],[104.38283893286332,30.06479613122662],[104.38285458830647,30.06484145258562],[104.38284968868047,30.06484285053282],[104.38286664079884,30.064872213237418]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38289983652786,30.06486280782712],[104.38289579908985,30.06483033819922],[104.38289147769686,30.064831508209018],[104.38288248516285,30.06480837296492],[104.38289688004686,30.06481403986712],[104.38290203077986,30.06482834330662],[104.38290013640786,30.064803568226818],[104.38288724336385,30.06478728073742],[104.38289076996885,30.064797074546618],[104.38287606166585,30.06479184624682],[104.38287382411586,30.06478608784942],[104.38286874795986,30.06478746227062],[104.38288586204486,30.064833028772817],[104.38288124162885,30.06483428036962],[104.38289983652786,30.06486280782712]]]]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38280694260342,30.065091578089124],[104.38280909718026,30.065123469926764],[104.38281413748172,30.065122500757496],[104.38282561867045,30.065161383716738],[104.38283112964106,30.06515969980906],[104.38281842379219,30.06512127609736],[104.38282439401033,30.065119439107164],[104.38280694260342,30.065091578089124]]]]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38284643789274,30.065081780808057],[104.38284828630454,30.065113825728215],[104.382853326606,30.065112856558947],[104.38286511395977,30.065151433353154],[104.38286985951778,30.06514990252799],[104.38285761291647,30.065111631898812],[104.38286358313461,30.065109794908615],[104.38284643789274,30.065081780808057]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38277096821194,30.065103212360395],[104.38277174504618,30.06513586961062],[104.38277678534764,30.065134900441354],[104.38278857270141,30.06517347723556],[104.38279331825943,30.065171946410395],[104.38278107165812,30.06513367578122],[104.38278704187626,30.06513183879102],[104.38277096821194,30.065103212360395]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38249480735182,30.064109400661962],[104.38249696192865,30.064141292499603],[104.38250200223011,30.064140323330335],[104.38251348341885,30.064179206289577],[104.38251899438946,30.064177522381897],[104.38250628854058,30.0641390986702],[104.38251225875872,30.064137261680003],[104.38249480735182,30.064109400661962]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38253430264113,30.064099603380896],[104.38253615105293,30.064131648301053],[104.38254119135439,30.064130679131786],[104.38255297870816,30.064169255925993],[104.38255772426618,30.064167725100827],[104.38254547766486,30.06412945447165],[104.382551447883,30.064127617481454],[104.38253430264113,30.064099603380896]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38245883296034,30.064121034933233],[104.38245960979458,30.06415369218346],[104.38246465009604,30.064152723014193],[104.38247643744981,30.0641912998084],[104.38248118300783,30.064189768983233],[104.38246893640651,30.064151498354057],[104.38247490662465,30.06414966136386],[104.38245883296034,30.064121034933233]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38187941563467,30.062252203569322],[104.3818815702115,30.062284095406962],[104.38188661051296,30.062283126237695],[104.3818980917017,30.062322009196937],[104.38190360267231,30.062320325289257],[104.38189089682344,30.06228190157756],[104.38189686704158,30.062280064587362],[104.38187941563467,30.062252203569322]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38191891092399,30.062242406288256],[104.38192075933578,30.062274451208413],[104.38192579963724,30.062273482039146],[104.38193758699101,30.062312058833353],[104.38194233254903,30.062310528008187],[104.38193008594772,30.06227225737901],[104.38193605616586,30.062270420388813],[104.38191891092399,30.062242406288256]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38184344124319,30.062263837840593],[104.38184421807743,30.06229649509082],[104.38184925837889,30.062295525921552],[104.38186104573266,30.06233410271576],[104.38186579129068,30.062332571890593],[104.38185354468936,30.062294301261417],[104.3818595149075,30.06229246427122],[104.38184344124319,30.062263837840593]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.3813111733326,30.06047277239516],[104.38131332790944,30.0605046642328],[104.3813183682109,30.06050369506353],[104.38132984939963,30.060542578022773],[104.38133536037024,30.060540894115093],[104.38132265452137,30.060502470403396],[104.38132862473951,30.0605006334132],[104.3813111733326,30.06047277239516]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38135066862192,30.060462975114092],[104.38135251703372,30.06049502003425],[104.38135755733518,30.060494050864982],[104.38136934468895,30.06053262765919],[104.38137409024696,30.060531096834023],[104.38136184364565,30.060492826204847],[104.38136781386379,30.06049098921465],[104.38135066862192,30.060462975114092]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38127519894113,30.06048440666643],[104.38127597577537,30.060517063916656],[104.38128101607683,30.06051609474739],[104.3812928034306,30.060554671541595],[104.38129754898861,30.06055314071643],[104.3812853023873,30.060514870087253],[104.38129127260544,30.060513033097056],[104.38127519894113,30.06048440666643]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37912209334372,30.05356997555202],[104.37912424792056,30.05360186738966],[104.37912928822202,30.05360089822039],[104.37914076941075,30.053639781179633],[104.37914628038136,30.053638097271953],[104.37913357453249,30.053599673560257],[104.37913954475063,30.05359783657006],[104.37912209334372,30.05356997555202]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37916158863304,30.053560178270953],[104.37916343704484,30.05359222319111],[104.3791684773463,30.053591254021843],[104.37918026470007,30.05362983081605],[104.37918501025808,30.053628299990883],[104.37917276365677,30.053590029361708],[104.37917873387491,30.05358819237151],[104.37916158863304,30.053560178270953]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37908611895224,30.05358160982329],[104.37908689578649,30.053614267073517],[104.37909193608795,30.05361329790425],[104.37910372344172,30.053651874698456],[104.37910846899973,30.05365034387329],[104.37909622239842,30.053612073244114],[104.37910219261656,30.053610236253917],[104.37908611895224,30.05358160982329]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37993710466263,30.05617972629676],[104.37993925923946,30.0562116181344],[104.37994429954092,30.056210648965134],[104.37995578072966,30.056249531924376],[104.37996129170027,30.056247848016696],[104.3799485858514,30.056209424305],[104.37995455606953,30.056207587314802],[104.37993710466263,30.05617972629676]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37997659995195,30.056169929015695],[104.37997844836374,30.056201973935853],[104.3799834886652,30.056201004766585],[104.37999527601897,30.056239581560792],[104.38000002157699,30.056238050735626],[104.37998777497567,30.05619978010645],[104.37999374519381,30.056197943116253],[104.37997659995195,30.056169929015695]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37990113027115,30.056191360568032],[104.37990190710539,30.05622401781826],[104.37990694740685,30.05622304864899],[104.37991873476062,30.0562616254432],[104.37992348031864,30.056260094618032],[104.37991123371732,30.056221823988857],[104.37991720393546,30.05621998699866],[104.37990113027115,30.056191360568032]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38080293937706,30.058890511502515],[104.3808050939539,30.058922403340155],[104.38081013425536,30.058921434170887],[104.38082161544409,30.05896031713013],[104.3808271264147,30.05895863322245],[104.38081442056583,30.058920209510752],[104.38082039078397,30.058918372520555],[104.38080293937706,30.058890511502515]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38084243466638,30.05888071422145],[104.38084428307818,30.058912759141606],[104.38084932337964,30.05891178997234],[104.3808611107334,30.058950366766545],[104.38086585629142,30.05894883594138],[104.3808536096901,30.058910565312203],[104.38085957990825,30.058908728322006],[104.38084243466638,30.05888071422145]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38076696498558,30.058902145773786],[104.38076774181982,30.058934803024012],[104.38077278212128,30.058933833854745],[104.38078456947505,30.058972410648952],[104.38078931503307,30.058970879823786],[104.38077706843175,30.05893260919461],[104.3807830386499,30.058930772204413],[104.38076696498558,30.058902145773786]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38324123770307,30.066509122193764],[104.38324339227991,30.066541014031404],[104.38324843258137,30.066540044862137],[104.3832599137701,30.06657892782138],[104.38326542474071,30.0665772439137],[104.38325271889184,30.066538820202002],[104.38325868910998,30.066536983211805],[104.38324123770307,30.066509122193764]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38328073299239,30.066499324912698],[104.38328258140419,30.066531369832855],[104.38328762170565,30.066530400663588],[104.38329940905942,30.066568977457795],[104.38330415461743,30.06656744663263],[104.38329190801612,30.066529176003453],[104.38329787823426,30.066527339013255],[104.38328073299239,30.066499324912698]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.3832052633116,30.066520756465035],[104.38320604014584,30.066553413715262],[104.3832110804473,30.066552444545994],[104.38322286780107,30.0665910213402],[104.38322761335908,30.066589490515035],[104.38321536675777,30.06655121988586],[104.38322133697591,30.066549382895662],[104.3832052633116,30.066520756465035]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38392582271774,30.068532260734504],[104.38392797729458,30.068564152572144],[104.38393301759604,30.068563183402876],[104.38394449878477,30.068602066362118],[104.38395000975538,30.068600382454438],[104.3839373039065,30.06856195874274],[104.38394327412465,30.068560121752544],[104.38392582271774,30.068532260734504]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38396531800706,30.068522463453437],[104.38396716641886,30.068554508373595],[104.38397220672032,30.068553539204327],[104.38398399407409,30.068592115998534],[104.3839887396321,30.068590585173368],[104.38397649303079,30.068552314544192],[104.38398246324893,30.068550477553995],[104.38396531800706,30.068522463453437]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38388984832626,30.068543895005774],[104.3838906251605,30.068576552256],[104.38389566546196,30.068575583086734],[104.38390745281573,30.06861415988094],[104.38391219837375,30.068612629055774],[104.38389995177243,30.0685743584266],[104.38390592199057,30.0685725214364],[104.38388984832626,30.068543895005774]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38229784117986,30.06309476974119],[104.38229522193977,30.063061177421993],[104.38229082758878,30.063062431901592],[104.38227640962752,30.063017003822704],[104.38227074557442,30.063018687730388],[104.38228540287578,30.06306397959749],[104.38228050324977,30.063065377544692],[104.38229784117986,30.06309476974119]]]]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38225972363321,30.063107628672594],[104.38225765604977,30.063072360552393],[104.38225321395778,30.063073649160092],[104.38223844516338,30.063029403506558],[104.38223247494524,30.06303124049676],[104.38224754065277,30.063075295565692],[104.38224230507177,30.063076814632893],[104.38225972363321,30.063107628672594]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38233146028522,30.063084747562648],[104.38232742284721,30.063052277934748],[104.38232310145422,30.063053447944547],[104.38231410892021,30.063030312700448],[104.38232850380422,30.06303597960265],[104.38233365453722,30.06305028304215],[104.38233176016521,30.063025507962347],[104.38231886712121,30.06300922047295],[104.38232239372621,30.063019014282148],[104.38230768542321,30.06301378598235],[104.38230544787322,30.06300802758495],[104.38230037171722,30.06300940200615],[104.38231748580222,30.063054968508347],[104.38231286538621,30.06305622010515],[104.38233146028522,30.063084747562648]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38330696113012,30.06624132984453],[104.38330270900967,30.066208553965375],[104.38329831465867,30.066209808444974],[104.38328353950496,30.066164686531145],[104.38327787545185,30.06616637043883],[104.38329288994568,30.066211356140872],[104.38328799031967,30.066212754088074],[104.38330696113012,30.06624132984453]]]]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38327042986168,30.066253288757473],[104.38326514311967,30.066219737095775],[104.38326070102768,30.066221025703474],[104.38324679970096,30.066176933132482],[104.38324098256533,30.066178617040165],[104.38325502772267,30.066222672109074],[104.38324979214167,30.066224191176275],[104.38327042986168,30.066253288757473]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38333894735511,30.06623212410603],[104.38333490991711,30.06619965447813],[104.38333058852412,30.06620082448793],[104.38332159599011,30.06617768924383],[104.38333599087412,30.06618335614603],[104.38334114160712,30.06619765958553],[104.38333924723511,30.06617288450573],[104.38332635419111,30.06615659701633],[104.38332988079611,30.06616639082553],[104.38331517249311,30.06616116252573],[104.38331293494312,30.06615540412833],[104.38330785878712,30.06615677854953],[104.38332497287212,30.066202345051728],[104.38332035245611,30.06620359664853],[104.38333894735511,30.06623212410603]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38389274848313,30.068027888788507],[104.38388849636269,30.06799511290935],[104.38388410201169,30.06799636738895],[104.3838667654957,30.06795199497795],[104.3838619343177,30.06795337409445],[104.3838786772987,30.06799791508485],[104.38387377767269,30.06799931303205],[104.38389274848313,30.068027888788507]]]]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.3838562172147,30.06803984770145],[104.38385093047269,30.06800629603975],[104.3838464883807,30.06800758464745],[104.38383100520134,30.06796349207646],[104.38382549423073,30.06796486981911],[104.38384081507569,30.06800923105305],[104.38383557949469,30.06801075012025],[104.3838562172147,30.06803984770145]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38392473470813,30.068018683050006],[104.38392069727013,30.067986213422106],[104.38391637587713,30.067987383431905],[104.38390738334313,30.067964248187806],[104.38392177822713,30.067969915090007],[104.38392692896014,30.067984218529507],[104.38392503458813,30.067959443449706],[104.38391214154413,30.067943155960307],[104.38391566814913,30.067952949769506],[104.38390095984613,30.067947721469707],[104.38389872229614,30.067941963072307],[104.38389364614014,30.067943337493507],[104.38391076022513,30.067988903995705],[104.38390613980913,30.067990155592508],[104.38392473470813,30.068018683050006]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38158646672476,30.06087369550636],[104.38158478281707,30.06084062968275],[104.38157881259892,30.0608420074254],[104.38156442284236,30.06079608267039],[104.3815584526242,30.060798225825625],[104.38157284238078,30.060843997498118],[104.38156652639182,30.060845885162532],[104.38158646672476,30.06087369550636]]]]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.3815483491781,30.060886401355244],[104.38154498136274,30.060852417036536],[104.38154023580472,30.06085364169667],[104.38152569296562,30.060808788519275],[104.38151926349992,30.060810472426958],[104.38153426558657,30.06085547868687],[104.38152832821382,30.060857322250733],[104.3815483491781,30.060886401355244]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38161748342726,30.060865255180488],[104.38161344598926,30.060832785552588],[104.38160912459627,30.060833955562387],[104.38160013206226,30.060810820318288],[104.38161452694627,30.06081648722049],[104.38161967767927,30.06083079065999],[104.38161778330726,30.060806015580187],[104.38160489026326,30.06078972809079],[104.38160841686826,30.060799521899987],[104.38159370856526,30.06079429360019],[104.38159147101527,30.06078853520279],[104.38158639485927,30.06078990962399],[104.38160350894427,30.060835476126186],[104.38159888852826,30.06083672772299],[104.38161748342726,30.060865255180488]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.37914505173423,30.05324773924569],[104.37914187517815,30.05321445070018],[104.37913748082715,30.05321570517978],[104.37912392634692,30.053170738739766],[104.37911795612877,30.053172269564932],[104.37913205611416,30.05321725287568],[104.37912715648815,30.05321865082288],[104.37914505173423,30.05324773924569]]]]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.3791073934351,30.053259220434445],[104.37910430928815,30.053225633830582],[104.37909986719616,30.05322692243828],[104.37908504338766,30.053182373011037],[104.37907999166461,30.053184363083755],[104.37909419389115,30.05322856884388],[104.37908895831015,30.053230087911082],[104.3791073934351,30.053259220434445]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.3791781135236,30.053238020840837],[104.37917407608559,30.053205551212937],[104.3791697546926,30.053206721222736],[104.37916076215859,30.053183585978637],[104.3791751570426,30.053189252880838],[104.3791803077756,30.053203556320337],[104.3791784134036,30.053178781240536],[104.37916552035959,30.053162493751138],[104.37916904696459,30.053172287560336],[104.37915433866159,30.053167059260538],[104.3791521011116,30.053161300863138],[104.3791470249556,30.053162675284337],[104.3791641390406,30.053208241786535],[104.37915951862459,30.05320949338334],[104.3791781135236,30.053238020840837]]]]}},{type:"Feature",properties:{id:"30469",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38022395578486,30.056616164551823],[104.38022051142823,30.05658332835199],[104.38021576587022,30.056584476470867],[104.38020206498497,30.056539087504664],[104.38019663055563,30.05654069487109],[104.38020971911081,30.05658616037855],[104.38020429610319,30.056587741877955],[104.38022395578486,30.056616164551823]]]]}},{type:"Feature",properties:{id:"30470",type:9,z_order:0,color:1,texture:8,code:"0902",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38018553207317,30.05662932964826],[104.38018247042284,30.05659457991697],[104.3801770068112,30.056596013493355],[104.38016364127328,30.056551027940966],[104.38015759451388,30.05655324763746],[104.38017133350618,30.056597659898955],[104.38016609792518,30.056599178966156],[104.38018553207317,30.05662932964826]]]]}},{type:"Feature",properties:{id:"30471",type:9,z_order:0,color:1,texture:8,code:"0906",remark:null,angle:0,hd_data_ve:"p1"},geometry:{type:"MultiPolygon",coordinates:[[[[104.38025525313863,30.05660711189591],[104.38025121570062,30.05657464226801],[104.38024689430763,30.05657581227781],[104.38023790177363,30.05655267703371],[104.38025229665763,30.05655834393591],[104.38025744739063,30.05657264737541],[104.38025555301863,30.05654787229561],[104.38024265997463,30.056531584806212],[104.38024618657963,30.05654137861541],[104.38023147827663,30.056536150315612],[104.38022924072663,30.056530391918212],[104.38022416457063,30.05653176633941],[104.38024127865563,30.05657733284161],[104.38023665823962,30.056578584438412],[104.38025525313863,30.05660711189591]]]]}}],_v={type:dv,name:pv,crs:fv,features:mv},gv="FeatureCollection",yv="lvdi",xv={type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},vv=[{type:"Feature",properties:{id:1},geometry:{type:"MultiPolygon",coordinates:[[[[104.37147965390194,30.052873504061797],[104.37817930268993,30.073589523340424],[104.39313597476485,30.071268153804237],[104.38584863748669,30.048847837904106],[104.37147965390194,30.052873504061797]]]]}}],bv={type:gv,name:yv,crs:xv,features:vv},wv="FeatureCollection",Tv="laneBorder",Sv={type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},Ev=[{type:"Feature",properties:{fid:2,id:"47",seg_name:"S4成宜昭高速:S4成宜昭高速入口-长河大桥",z_order:0,width:15.11,level:"41000",type_no:1,func_no:9,pass_no:1,overlap:1,median:1,walkway:2,fork:2,lane_cnt:4,lane_cnt_s:5,lane_cnt_e:4,p_a_id:null,d_road_id:"294",start_o_id:"43",start_o_tp:"inter",end_o_id:"629",end_o_tp:"inter",lnglat_seq:null,max_speed:120,min_speed:0,p_start_ju:null,p_end_jun:null,sd_rid:"0VRCL095M100VRAC095FE00",hd_data_ve:"p1"},geometry:{type:"LineString",coordinates:[[104.3845021834485,30.06984021384413],[104.384494347057,30.069820392303],[104.384485381534,30.0697977642655],[104.384473555098,30.0697676829834],[104.384468629593,30.0697551963303],[104.384456317622,30.0697238160196],[104.384441759977,30.0696867069659],[104.384431594568,30.0696606892761],[104.384422711886,30.0696380873679],[104.3844183944,30.0696270662045],[104.384411531272,30.0696093537789],[104.38440726783,30.0695984189937],[104.384402866554,30.0695868842471],[104.384398507623,30.069575642713],[104.384394914353,30.0695661150215],[104.384390175283,30.0695538272602],[104.38438631628,30.0695436572315],[104.384382038414,30.0695325524592],[104.384377574993,30.0695211444602],[104.384373050321,30.0695096680608],[104.384346926388,30.0694416198968],[104.384342298115,30.0694298016645],[104.384337562638,30.0694174995082],[104.384332886603,30.0694051623278],[104.384328676284,30.0693941403414],[104.384324295705,30.069382515668],[104.384320154743,30.0693716205425],[104.384311734091,30.0693494209831],[104.384307235518,30.0693377602348],[104.384302905388,30.0693264134897],[104.384297199749,30.0693116769548],[104.384292829086,30.0693003319726],[104.384288496257,30.0692891201206],[104.384281258353,30.0692702643137],[104.38427705343,30.069259256713],[104.38426896876,30.0692379297624],[104.384264843094,30.0692268979453],[104.384260501227,30.0692151168133],[104.384252838115,30.069194661653],[104.384247880099,30.0691812639244],[104.384241506025,30.0691641337287],[104.38423581206,30.0691489493308],[104.384230692803,30.0691352367016],[104.38422466014,30.0691192777024],[104.384220246214,30.0691075729451],[104.384214551347,30.0690924550916],[104.384210437388,30.0690815959452],[104.384205512695,30.069068330437],[104.384201614025,30.0690579867806],[104.384197355918,30.069046364889],[104.384193568941,30.0690362353637],[104.384189556755,30.0690253187443],[104.384185457198,30.0690143408965],[104.384176915788,30.0689917356016],[104.384172676605,30.0689804113962],[104.38413399243,30.0688765712258],[104.384112616288,30.0688189733478],[104.38410711416,30.0688041892829],[104.384098731244,30.0687815481261],[104.384094430788,30.0687699504642],[104.384090509567,30.0687592857167],[104.384086563123,30.0687485436059],[104.384082285174,30.068736786782],[104.384078366648,30.0687259979293],[104.38407344011,30.0687123555821],[104.384065387749,30.0686899656064],[104.384054293344,30.0686591626171],[104.384050152312,30.0686477602362],[104.384041843231,30.0686250552736],[104.384026120442,30.0685815580545],[104.384022032551,30.0685702474451],[104.384017968978,30.0685589242654],[104.384013885589,30.0685476109607],[104.384009393228,30.0685351281933],[104.384005307142,30.0685239452861],[104.384001282313,30.0685129836627],[104.383989505053,30.0684801188283],[104.383985507241,30.0684691230517],[104.383981303132,30.0684573707721],[104.383971430178,30.0684295967966],[104.383955407359,30.068384972436],[104.383951341972,30.0683736231649],[104.383936714499,30.0683327546391],[104.383928661185,30.0683101793637],[104.383924678665,30.0682989758492],[104.383912808574,30.0682656324659],[104.383908832355,30.0682544109681],[104.383904790374,30.0682429609867],[104.383896737049,30.0682203812055],[104.383888363015,30.0681965951618],[104.383884365172,30.0681852873075],[104.38388040786,30.0681739785881],[104.383866578451,30.0681348814673],[104.383858752095,30.0681124016944],[104.383852715682,30.0680952285327],[104.383840615823,30.0680607427879],[104.383833898378,30.0680415248875],[104.383829542892,30.0680290440075],[104.383825126146,30.0680163319495],[104.383803092857,30.067953033394],[104.383794702559,30.0679288120386],[104.38379076955,30.0679174871398],[104.383786875279,30.0679063178557],[104.383782872004,30.0678947698645],[104.383778502086,30.0678820452491],[104.383762752036,30.0678370019313],[104.383744058906,30.0677821157304],[104.383740145708,30.0677708457],[104.38373618566,30.0677593193229],[104.383727959269,30.0677351250687],[104.383713617139,30.067693172096],[104.383705013295,30.0676679540852],[104.383698302999,30.0676482963922],[104.383693969994,30.067635547514],[104.383689719859,30.0676229255106],[104.383683063603,30.0676033200212],[104.383678954893,30.067591019195],[104.383667160248,30.0675556199332],[104.383663331696,30.0675441548135],[104.383632129472,30.0674518568767],[104.383620195186,30.0674162857042],[104.383615489208,30.06740213985],[104.383609339196,30.0673838936514],[104.38360433143,30.0673687402976],[104.383599798412,30.0673551755501],[104.383594870816,30.0673402129196],[104.383591283672,30.0673293532406],[104.383587883898,30.0673190027377],[104.383579400679,30.06729318315],[104.383575831548,30.0672823522629],[104.383572151612,30.0672711660485],[104.383568430241,30.0672599573146],[104.383561138834,30.0672378664294],[104.383553557366,30.0672151709483],[104.383549856705,30.0672038893853],[104.383545939849,30.0671920860293],[104.383542252695,30.0671807433236],[104.383538207913,30.0671684587202],[104.383534550484,30.06715715471],[104.383526224894,30.0671318037879],[104.383522607102,30.0671206715803],[104.383519015439,30.0671097156612],[104.383515327387,30.0670985123453],[104.38350641174,30.0670714234214],[104.383502402082,30.0670591730177],[104.383497633011,30.0670445954162],[104.383493159411,30.0670308040755],[104.383488366006,30.0670159692466],[104.383483645572,30.0670013961819],[104.383466536705,30.066948894371],[104.383458392153,30.0669239132067],[104.383454628413,30.0669123033251],[104.383451056553,30.066901291657],[104.383447392802,30.0668898985974],[104.38344387769,30.06687896342],[104.383440358971,30.0668679383073],[104.383433242257,30.0668456802687],[104.383415519809,30.0667898018525],[104.383396043416,30.0667289711453],[104.383391291421,30.0667140194249],[104.383385657493,30.0666963617835],[104.383374611254,30.0666619487072],[104.383362286696,30.0666234480062],[104.383358713011,30.0666122159921],[104.383351606171,30.0665897178239],[104.38334630645,30.0665730802941],[104.383342737268,30.0665618860532],[104.38333833029,30.0665480129085],[104.383334638599,30.0665366072193],[104.383330514494,30.0665237703356],[104.383322603219,30.0664995213814],[104.383317994464,30.066485424126],[104.383312687552,30.0664692641211],[104.383308691367,30.066456881502],[104.383303207877,30.0664399785038],[104.383298314428,30.0664245464078],[104.383281640499,30.0663723677226],[104.383277753289,30.0663598053316],[104.38327471018,30.0663498894755],[104.383271873374,30.0663407643008],[104.383267187118,30.0663260365474],[104.383263565674,30.0663146470985],[104.383255338143,30.0662886837479],[104.383251774353,30.0662775065872],[104.383244707135,30.0662554499919],[104.383217421073,30.066170194906],[104.383202981219,30.0661250148361],[104.383197798586,30.0661089214689],[104.383194304155,30.0660979727889],[104.383190677307,30.0660868261416],[104.383187601784,30.0660774129658],[104.383180137262,30.0660539611618],[104.383176774359,30.0660435458912],[104.383172364653,30.0660297446636],[104.383168455821,30.0660174772146],[104.383159855303,30.0659903488901],[104.38315049447,30.0659611514598],[104.383146194662,30.06594766059],[104.383138287809,30.0659229187621],[104.383133748373,30.0659087477941],[104.383129930527,30.065896859033],[104.383124700132,30.0658805866459],[104.383115911339,30.0658533142503],[104.383103286678,30.0658141305884],[104.383094382562,30.0657863859423],[104.383088217065,30.0657672124201],[104.383084294716,30.0657550690532],[104.383079121963,30.0657388965331],[104.383071868231,30.0657165609405],[104.38306419377,30.0656924065527],[104.383060540772,30.0656810467272],[104.383057057133,30.0656701537976],[104.383049696175,30.0656471058447],[104.383042200093,30.0656238293431],[104.383030284362,30.0655865762141],[104.383026564691,30.0655749177516],[104.383019712699,30.065553191341],[104.383014753438,30.0655377051783],[104.383011479692,30.0655274113753],[104.383008075326,30.0655168539555],[104.382998402739,30.0654867334977],[104.38299453443,30.0654748122979],[104.38298987606,30.0654604064791],[104.382985916754,30.0654480409342],[104.382982402471,30.0654369654067],[104.382976984665,30.0654201019737],[104.38297135605,30.0654024865224],[104.382960893358,30.0653692384209],[104.38295150812,30.0653398133758],[104.38294790915,30.065328453584],[104.382940797696,30.0653061162863],[104.3829304206,30.0652737109102],[104.382926880185,30.065262563407],[104.382919133605,30.0652380635776],[104.382910982542,30.0652125030893],[104.38290653855,30.0651984886514],[104.382901847725,30.0651838192891],[104.382897217254,30.0651692767837],[104.382888684218,30.0651425891027],[104.382873451416,30.0650951184933],[104.382866196711,30.0650725121527],[104.382860564469,30.0650548966761],[104.382849870234,30.0650215206231],[104.38284396502,30.0650029768032],[104.382836460769,30.0649796615692],[104.382820409916,30.0649290344934],[104.382816417252,30.0649165852585],[104.382812374135,30.0649039003566],[104.382808235526,30.0648909437745],[104.382800519545,30.0648666633736],[104.382793074738,30.0648435442327],[104.382789309991,30.064831807458],[104.382778520227,30.0647980050158],[104.382774496022,30.0647853587962],[104.382767298936,30.0647627587774],[104.382756770402,30.0647294520857],[104.382749583216,30.0647067882198],[104.382731505356,30.0646502102858],[104.382723613684,30.0646254593628],[104.382716349028,30.0646028709612],[104.382708863653,30.0645795332276],[104.382705254745,30.0645682813143],[104.382701671957,30.0645570285247],[104.382690228134,30.0645214906762],[104.382686648946,30.0645102073112],[104.382683046336,30.0644988888512],[104.382678511319,30.0644846557615],[104.382674874479,30.064473330075],[104.382666290903,30.0644461530529],[104.382658970384,30.0644235501972],[104.382655323635,30.0644122568747],[104.382651437245,30.0644000649173],[104.38264780941,30.0643887653157],[104.382644364456,30.064378095401],[104.382641112292,30.0643680848596],[104.382637502471,30.0643567870716],[104.382633760226,30.0643452004826],[104.382630164817,30.0643339099012],[104.382625139715,30.0643182194658],[104.382617941682,30.0642955510602],[104.38261141751,30.0642750838918],[104.382607813989,30.0642637618242],[104.382607104096,30.0642615488613],[104.382593051258,30.0642173841603],[104.382575634536,30.0641629677851],[104.382570069792,30.0641455186859],[104.382568660817,30.0641411746059],[104.382567250941,30.0641368305251],[104.382562631224,30.0641224300671],[104.382553362073,30.0640938620449],[104.382538466009,30.0640477072623],[104.382532658029,30.0640297129487],[104.382516853857,30.0639805886844],[104.382504827075,30.0639431661624],[104.3824955588,30.0639145252775],[104.382482924809,30.0638751389847],[104.382477964546,30.0638597615448],[104.38247220339,30.0638417519731],[104.382467256635,30.0638263394701],[104.382462349512,30.0638109323983],[104.382453092018,30.0637820217143],[104.382445322773,30.0637575280303],[104.382437236426,30.0637323038097],[104.382433277032,30.0637199291946],[104.382429568985,30.0637083381133],[104.382413258455,30.0636577303559],[104.382402495556,30.0636240006404],[104.38239526954,30.0636014139908],[104.382378686918,30.0635499201379],[104.382371439277,30.0635273424557],[104.382367235734,30.0635142382621],[104.382356319678,30.0634803384183],[104.382346199994,30.0634487154701],[104.38234256761,30.0634373906446],[104.382331739817,30.0634034656912],[104.382322334531,30.0633741294525],[104.382318790432,30.0633630879896],[104.382314474266,30.0633495717979],[104.382307272555,30.0633272045817],[104.382297809593,30.0632974779784],[104.382293783513,30.0632849126277],[104.382288130422,30.0632672547508],[104.382274072906,30.0632231681287],[104.382267870269,30.0632038424099],[104.382261681141,30.0631844843267],[104.382256677585,30.0631688325168],[104.382251213665,30.0631515803983],[104.382246113714,30.0631356658974],[104.38224171464,30.0631216064311],[104.38223222554,30.0630920659408],[104.382228645376,30.0630805639833],[104.382225377827,30.0630701585801],[104.38222147426,30.0630580510841],[104.382218164374,30.0630476429433],[104.3822146554,30.0630368218325],[104.382202741076,30.0629995503716],[104.382195218628,30.062976450788],[104.382190733984,30.0629626241583],[104.382185585372,30.0629465594159],[104.38217607824,30.0629171340028],[104.382170524226,30.0628998655982],[104.382166118851,30.0628861838276],[104.382155578383,30.0628534821432],[104.382151507235,30.0628407710415],[104.382147633379,30.0628286024092],[104.382143274846,30.0628150402875],[104.382135672172,30.0627911006521],[104.382128331664,30.0627681190292],[104.382124523572,30.0627561914714],[104.382120901966,30.0627448774195],[104.382117116398,30.0627330721886],[104.382113343444,30.0627213757862],[104.38210956869,30.0627097189517],[104.382105977716,30.0626985587093],[104.382088259766,30.0626434043185],[104.382084912924,30.0626328396469],[104.382078484093,30.0626123211836],[104.382074868784,30.0626009666624],[104.382064033687,30.0625674184145],[104.382054724702,30.0625384850708],[104.382051126511,30.0625272735538],[104.382045846339,30.0625107832876],[104.382037580579,30.0624848825014],[104.382028484184,30.0624563441461],[104.382024900401,30.0624451173507],[104.382011074276,30.0624018761716],[104.382007660762,30.062391214303],[104.382000273376,30.0623682344024],[104.381992789579,30.0623446671564],[104.381985262555,30.0623213624691],[104.381981847235,30.0623106691195],[104.381978429216,30.0623000683968],[104.381974958944,30.0622892967549],[104.381967844529,30.0622673099452],[104.381964388664,30.0622564465851],[104.381960670625,30.0622445532632],[104.381956583209,30.0622313510915],[104.381945570582,30.0621972000916],[104.381941241723,30.0621832917297],[104.381937615587,30.0621719794489],[104.381933212866,30.0621581195802],[104.381929638977,30.0621468577088],[104.381925200233,30.062133220836],[104.381921682196,30.0621220705308],[104.381917195711,30.0621084533973],[104.381913682179,30.0620973687454],[104.381909250645,30.0620838442915],[104.381905612793,30.0620725032177],[104.381901385752,30.0620593962358],[104.381893288431,30.0620343741974],[104.381889198316,30.0620214930698],[104.38188082531,30.0619955210925],[104.381871753172,30.061966801048],[104.381864557639,30.0619444004513],[104.381854440448,30.0619125345159],[104.381843885424,30.0618795296334],[104.381839337636,30.0618651237295],[104.381834906061,30.0618510066142],[104.381831234867,30.0618396016483],[104.381826192476,30.0618235908994],[104.381818866306,30.0618009365619],[104.381812814903,30.0617819175528],[104.38180917704,30.0617706394189],[104.381805562597,30.0617593622058],[104.381798928311,30.0617387130869],[104.38179534179,30.0617274269054],[104.381788211083,30.0617048240038],[104.381776853339,30.061669712146],[104.381773263211,30.0616584115693],[104.381769299213,30.0616460998101],[104.381765673954,30.0616348081928],[104.381762196441,30.0616238989229],[104.381754893675,30.0616012976507],[104.381751000837,30.0615890282235],[104.381746018799,30.0615733844384],[104.381742385427,30.0615620298582],[104.381738794393,30.0615507022969],[104.381732638471,30.061531498813],[104.381729127614,30.0615203781684],[104.381725684327,30.0615095102947],[104.381718945518,30.061488612848],[104.381715398629,30.061477509255],[104.381706821057,30.061450864346],[104.381695231743,30.0614150525703],[104.381691265028,30.061402693134],[104.381681129775,30.0613712866716],[104.381677914411,30.0613611177754],[104.381674712557,30.0613508940331],[104.381670054841,30.061336430443],[104.381666386313,30.0613247610594],[104.381662087153,30.0613113005431],[104.381657960064,30.0612983015373],[104.381653724862,30.061284901334],[104.381649454532,30.061271594626],[104.381640920154,30.0612444838919],[104.381632759685,30.0612192548778],[104.381628816377,30.0612068271068],[104.381624835239,30.0611944667485],[104.381621175723,30.0611830177002],[104.381617192778,30.0611705701055],[104.38161364858,30.0611595420451],[104.381609742208,30.0611472510024],[104.381602555615,30.0611249933399],[104.381595028451,30.0611011588523],[104.381591392357,30.0610898429212],[104.381587582379,30.0610778550362],[104.381583920151,30.0610663124516],[104.381580056124,30.0610542930385],[104.381576347941,30.0610424554338],[104.381572609144,30.0610309100778],[104.381568909065,30.0610190437016],[104.38156548018,30.0610084114433],[104.381561913439,30.0609970353196],[104.381558721488,30.0609870049269],[104.381555326828,30.0609763169421],[104.381551937572,30.0609655956872],[104.381548514989,30.060954958037],[104.381544376172,30.0609419778895],[104.381536180536,30.0609166193131],[104.381531100265,30.0609008575875],[104.381525476743,30.0608834882689],[104.381520718996,30.0608686567396],[104.381516059442,30.0608540303464],[104.38151058907,30.0608370640635],[104.381505717799,30.0608217800681],[104.381497703215,30.0607965673411],[104.38149340672,30.0607828927647],[104.381489958902,30.0607721462663],[104.381485957904,30.060759317326],[104.381482783969,30.0607495099725],[104.381478830721,30.0607369023082],[104.381471605361,30.0607147102264],[104.381467576443,30.0607020746102],[104.381463516004,30.0606895630694],[104.381457584354,30.0606712734448],[104.381453689687,30.0606593789908],[104.381445701233,30.0606346582004],[104.381442067827,30.0606234996335],[104.381438321798,30.0606118220536],[104.381429532416,30.0605845221587],[104.381419242078,30.0605521783689],[104.381411501356,30.0605279991927],[104.381399622687,30.060490738224],[104.381393928847,30.0604727743646],[104.38138651423,30.0604491485708],[104.381378459065,30.0604237649021],[104.381374958075,30.0604128025034],[104.381371342668,30.0604014721751],[104.381367378607,30.0603891774475],[104.381362741555,30.0603747453034],[104.381354045843,30.0603477404504],[104.381348675429,30.0603308812504],[104.381340152687,30.0603043540949],[104.381334402975,30.060286181529],[104.381330648825,30.0602745345042],[104.381320643128,30.0602428294649],[104.38131177984,30.0602155060816],[104.381308053607,30.0602037826384],[104.381302361563,30.0601861479126],[104.381299044354,30.060175802611],[104.381295712731,30.0601654483022],[104.381289797251,30.0601470210629],[104.381286318774,30.0601361567005],[104.381281002404,30.0601195286638],[104.381269998468,30.0600848504138],[104.381265655995,30.0600712180275],[104.381261742367,30.0600589880843],[104.381254521424,30.0600362680534],[104.381250715904,30.0600243538721],[104.381242838196,30.0599998786447],[104.381238814653,30.0599873644094],[104.381234689301,30.059974457075],[104.38122658636,30.0599493826832],[104.381222007834,30.059934952371],[104.381217988793,30.0599224606201],[104.381207961435,30.0598907842992],[104.381203966713,30.059878285375],[104.381200059376,30.059865971793],[104.381195509677,30.0598516674085],[104.381191575315,30.0598393537996],[104.381184038117,30.0598154445519],[104.381180318169,30.0598036797297],[104.38116614834,30.0597595726731],[104.38116249236,30.0597480929932],[104.381158971522,30.059737112563],[104.381155278604,30.0597255582036],[104.381144848532,30.0596931970953],[104.381140927673,30.059680868204],[104.381136924835,30.0596683935443],[104.381128133528,30.0596406744742],[104.381123608141,30.0596264402484],[104.381110398662,30.0595850554174],[104.38110642735,30.0595726518297],[104.381091386261,30.0595254646404],[104.381080609296,30.059491876508],[104.38107706412,30.0594807908244],[104.381073432458,30.0594695036104],[104.381062458192,30.0594355456627],[104.38103336432,30.0593451363689],[104.381022463006,30.0593112495222],[104.381018880886,30.0593000819581],[104.381013172558,30.059282320356],[104.38100962557,30.0592711986897],[104.38100409562,30.0592538914125],[104.380996580898,30.0592302078661],[104.380991444649,30.0592140044271],[104.380987049876,30.0592002208634],[104.380982108237,30.0591848242973],[104.38097355742,30.0591576944644],[104.38096981222,30.0591459439799],[104.380959487484,30.0591139498275],[104.380955497234,30.0591016037572],[104.380951100657,30.0590879218091],[104.380946648229,30.0590742254174],[104.380942990416,30.0590627385135],[104.380938328967,30.0590483557402],[104.380934798182,30.0590372223893],[104.380930321419,30.0590232876527],[104.380925984296,30.0590097109783],[104.380921747175,30.0589963952016],[104.380916172165,30.058979082468],[104.380911871073,30.0589655085243],[104.380907285284,30.0589510799539],[104.380895146035,30.0589135496306],[104.38089046745,30.0588989087292],[104.380886114107,30.0588853563146],[104.380881382372,30.0588706910788],[104.380877559684,30.0588588532737],[104.380873876638,30.0588473582428],[104.380866997965,30.058826168184],[104.380855699243,30.058790551504],[104.380852154043,30.0587796033883],[104.380848512438,30.0587682765666],[104.380843552747,30.0587526749152],[104.380832672962,30.0587185946648],[104.380827632185,30.0587027743982],[104.380816774019,30.0586688218657],[104.380797083896,30.0586072139708],[104.380785797772,30.0585719920758],[104.380776947798,30.0585443915521],[104.380770006918,30.0585226600212],[104.3807656995,30.0585091714847],[104.380762230863,30.0584983637258],[104.38075325564,30.058470177618],[104.380742407366,30.0584365110501],[104.380737761187,30.0584219717783],[104.380734202451,30.0584108491677],[104.38072675432,30.0583873850494],[104.380714559109,30.0583492871274],[104.380710329161,30.0583360117961],[104.380706785741,30.0583250366849],[104.380702124243,30.0583105135802],[104.380698603348,30.0582996652936],[104.380694955416,30.0582883294533],[104.380684900851,30.0582571421533],[104.380680977216,30.0582447178695],[104.380676726528,30.0582310926789],[104.380671913666,30.0582161224615],[104.380667476483,30.0582019718869],[104.380663190672,30.0581885957708],[104.380658846297,30.0581750055597],[104.380655100151,30.0581632820131],[104.380651061209,30.0581509178672],[104.380643725678,30.0581279124889],[104.38063999216,30.058116572961],[104.380636372155,30.0581054637683],[104.380632650334,30.058093880536],[104.38061895949,30.0580508654498],[104.380611147349,30.0580264090003],[104.380606939008,30.0580132236067],[104.380603145106,30.0580013902902],[104.380595655507,30.0579780699885],[104.380584856709,30.0579443503505],[104.380576012977,30.0579168774746],[104.380571169464,30.0579017911988],[104.380549537596,30.0578340146232],[104.380544660737,30.057818714273],[104.380539816307,30.0578034355372],[104.380535054767,30.0577884707434],[104.380524182066,30.057754539671],[104.380519534952,30.057740098389],[104.38050981188,30.0577101380212],[104.380498970696,30.0576761799908],[104.380493467673,30.0576591028677],[104.380489848538,30.0576477931101],[104.380484247305,30.0576303219884],[104.380479151504,30.0576143909914],[104.380461249524,30.0575584701031],[104.380456988903,30.057545115565],[104.380446744119,30.0575127849645],[104.38044300335,30.0575010919727],[104.380426323045,30.0574490474183],[104.380422066928,30.0574358052941],[104.380417393665,30.0574212254752],[104.380412682556,30.0574064297825],[104.380408344441,30.0573927424139],[104.380388821588,30.0573317306542],[104.380384958277,30.0573196040637],[104.380381320212,30.0573083302467],[104.380377703762,30.0572969719147],[104.380369971753,30.0572731944635],[104.380365872396,30.0572604884782],[104.380357592571,30.0572343749589],[104.380353585106,30.0572218768045],[104.380349083911,30.0572077629903],[104.380345298077,30.0571958972728],[104.380340935633,30.0571823123923],[104.38033737954,30.0571710980055],[104.380330443937,30.0571491595322],[104.380322759654,30.0571252777949],[104.380318941383,30.0571133266069],[104.38031462038,30.0570999189287],[104.380300316722,30.0570551656084],[104.380295464152,30.0570401485252],[104.380290240382,30.0570239134],[104.380283011061,30.0570012245953],[104.380277707998,30.0569846089785],[104.380274094239,30.0569733009981],[104.380269040734,30.0569573304363],[104.380261835741,30.0569348871639],[104.380257277761,30.0569204153514],[104.380253270272,30.0569077418165],[104.380245993196,30.0568850286739],[104.38024238484,30.0568737755532],[104.380238634131,30.0568620834247],[104.380235167233,30.0568514320859],[104.380231385892,30.0568396787727],[104.380227806374,30.0568287179566],[104.380223903406,30.056816660553],[104.380212607131,30.0567816191886],[104.380208226644,30.0567679605264],[104.3802033281,30.056752641212],[104.380199508914,30.0567407592549],[104.380194201332,30.056724204772],[104.380186403483,30.0566998822211],[104.380180932825,30.0566828581309],[104.380175628844,30.0566663135407],[104.38016193327,30.0566236480695],[104.380157125713,30.0566085689551],[104.380152798371,30.0565950182554],[104.38014204532,30.0565610547841],[104.38013121118,30.0565269104656],[104.380127963191,30.0565166856075],[104.380124516088,30.0565058607071],[104.380121013126,30.056494902652],[104.380117575939,30.0564842261479],[104.380106913878,30.0564506962246],[104.380098910592,30.056425957962],[104.380092698413,30.0564064779838],[104.380087099796,30.0563890184796],[104.380081482257,30.0563714645272],[104.380074981761,30.0563510300836],[104.380070417455,30.0563368298293],[104.380063087177,30.0563140824143],[104.380051246615,30.0562766428677],[104.380040332272,30.0562426944869],[104.380035718401,30.056228216289],[104.380030992816,30.0562135554178],[104.380027535792,30.0562027619722],[104.380017019656,30.0561697780468],[104.38000533498,30.0561336633305],[104.37999945975,30.0561154256248],[104.37999213125,30.0560925981546],[104.379987021841,30.0560766796487],[104.379983029634,30.0560642147335],[104.379970084464,30.0560237703342],[104.379946475359,30.0559498184286],[104.379938854029,30.0559261039263],[104.379935344737,30.055915141346],[104.379931638131,30.0559035805225],[104.379928473917,30.0558938161762],[104.379917274795,30.0558585562611],[104.379914272757,30.0558493613429],[104.379911092323,30.0558395574085],[104.379907108213,30.0558271014842],[104.379903653875,30.0558162954362],[104.3798996076,30.055803735128],[104.37989598117,30.0557922921907],[104.379892312396,30.0557807547824],[104.379888115658,30.055767759952],[104.379884459503,30.0557564006199],[104.379880045627,30.0557426888156],[104.379875553361,30.0557286306952],[104.379868282502,30.0557062699971],[104.37986403079,30.0556928596239],[104.379860321474,30.0556813509491],[104.379853047875,30.055658284281],[104.379840292741,30.0556182968678],[104.379836624859,30.0556067504602],[104.379832319989,30.0555932950632],[104.37982785745,30.0555793880505],[104.379817684515,30.0555476832263],[104.379809468506,30.0555221991377],[104.379804537452,30.0555067870944],[104.379800319975,30.0554936528366],[104.379791633635,30.0554663885231],[104.379782375175,30.055437444608],[104.379777888298,30.0554234080616],[104.379765953027,30.0553861751476],[104.379760769695,30.0553700595777],[104.379754815126,30.0553516014107],[104.379751413925,30.055340953678],[104.379745093554,30.0553213242308],[104.379737886606,30.0552986847766],[104.379731885175,30.0552799477696],[104.379718482164,30.055237703266],[104.37970917502,30.0552084786921],[104.379704883643,30.0551950385784],[104.379701277014,30.0551837844936],[104.379693697965,30.0551603388659],[104.379689349829,30.0551468375393],[104.379666496416,30.0550756731526],[104.379661895095,30.0550612911356],[104.379651777947,30.0550295638273],[104.379646437818,30.0550128958986],[104.379631222912,30.0549655728837],[104.379621502196,30.0549352983618],[104.379616778335,30.0549205636817],[104.379613904192,30.054911550524],[104.379602047227,30.0548744570168],[104.379584686163,30.0548207763374],[104.379581126369,30.0548096742697],[104.3795728355,30.0547838833723],[104.379571474105,30.0547795275035],[104.37957011271,30.0547751716346],[104.379565375324,30.0547603748798],[104.379556334793,30.0547314553958],[104.379550534225,30.0547130306181],[104.379537943821,30.0546735081874],[104.379532107214,30.0546550608866],[104.379528569937,30.0546440217876],[104.379523765867,30.0546289371772],[104.379519912342,30.0546169193],[104.37950912752,30.0545833692504],[104.379495364929,30.0545406080728],[104.379484518825,30.0545067656741],[104.379479170554,30.0544900797205],[104.379475381892,30.0544782273776],[104.379470563396,30.0544631049726],[104.379458868534,30.0544262795687],[104.379450468591,30.0543998095422],[104.379446208709,30.0543865295012],[104.379442136233,30.0543738306087],[104.379432124436,30.0543428389731],[104.379424883183,30.0543204988798],[104.379421804497,30.054310916228],[104.379416596771,30.054294761902],[104.379410096108,30.0542742643591],[104.379405316349,30.0542593892949],[104.379401685349,30.0542480074456],[104.379397456092,30.0542347948776],[104.379393745809,30.0542232681566],[104.379389922895,30.0542112520923],[104.379378879448,30.0541772053089],[104.379371691312,30.0541544443766],[104.379368111662,30.0541431749901],[104.379364428408,30.0541317957809],[104.379360806416,30.0541205092633],[104.379357136671,30.0541090940944],[104.379353450703,30.0540975062397],[104.379346145454,30.0540748944682],[104.379342518054,30.0540636043456],[104.379334804626,30.0540391386637],[104.379327587659,30.0540165827354],[104.379323575523,30.0540038991765],[104.379319626459,30.0539914782819],[104.379312377057,30.0539689142229],[104.379308601886,30.0539570852547],[104.379304987993,30.0539457843495],[104.379297852108,30.0539234803054],[104.379290680173,30.0539008884415],[104.379283296508,30.0538777513736],[104.379279717749,30.0538665179499],[104.37927571192,30.0538540295426],[104.379264603539,30.0538194448589],[104.379260493198,30.0538067378088],[104.379256488275,30.0537944157734],[104.379252709499,30.0537827432753],[104.379245203289,30.0537592679296],[104.379241546141,30.053747841068],[104.379238008826,30.0537368271149],[104.379230175541,30.0537121499437],[104.379223320754,30.0536908695916],[104.379219122101,30.0536777289747],[104.379215620819,30.053666726747],[104.379211495151,30.0536539342393],[104.379203909629,30.0536299273057],[104.379196103391,30.053605914748],[104.379191728138,30.053592230759],[104.37918788628,30.0535802865944],[104.379183070444,30.0535653664915],[104.37917922407,30.053553219975],[104.379175359671,30.0535409061666],[104.379165686551,30.0535110101557],[104.379161714933,30.0534984255413],[104.379157534292,30.0534853694698],[104.379153395099,30.0534725112901],[104.379149709106,30.0534609989525],[104.379145310429,30.0534474471321],[104.379141674888,30.0534360382667],[104.379132710852,30.053408563034],[104.37912876266,30.0533961277257],[104.379124508138,30.0533829798435],[104.379115635961,30.0533549866937],[104.37911166885,30.0533426044234],[104.379107072834,30.0533281359909],[104.379099788222,30.0533051959294],[104.379095136344,30.0532906114259],[104.379091515212,30.0532792511322],[104.379082154692,30.0532499525618],[104.379074666456,30.0532265824113],[104.379070362359,30.0532130432676],[104.379066650222,30.053201395096],[104.379059260181,30.0531781041826],[104.379051825086,30.0531546342569],[104.37904834721,30.0531437705283],[104.379044516139,30.0531317679007],[104.379036900857,30.0531081395059],[104.379029270255,30.0530844472419],[104.379024940929,30.0530709566287],[104.379020802614,30.053058057962],[104.379016230911,30.0530437190422],[104.379005563005,30.0530103353031],[104.378993151631,30.0529711563641],[104.378981440353,30.0529345780666],[104.378977959762,30.0529236486768],[104.3789733403,30.0529091801995],[104.378969602918,30.0528973845017],[104.378948008469,30.0528296985168],[104.378944613462,30.0528188717337],[104.378941033745,30.0528074053452],[104.378937057586,30.0527947370595],[104.378933255333,30.0527828585531],[104.378929011579,30.0527694804289],[104.378921885509,30.0527473309869],[104.378913643081,30.0527215309617],[104.378909414647,30.0527083453043],[104.3789080759742,30.05270411221024]]}},{type:"Feature",properties:{fid:3,id:"45",seg_name:"S4成宜昭高速:长河大桥-S4成宜昭高速出口",z_order:0,width:15.28,level:"41000",type_no:1,func_no:10,pass_no:1,overlap:1,median:1,walkway:2,fork:2,lane_cnt:4,lane_cnt_s:4,lane_cnt_e:5,p_a_id:null,d_road_id:"293",start_o_id:"627",start_o_tp:"inter",end_o_id:"42",end_o_tp:"inter",lnglat_seq:null,max_speed:120,min_speed:0,p_start_ju:null,p_end_jun:null,sd_rid:"0VRAE095FE00VRCI095LL00",hd_data_ve:"p1"},geometry:{type:"LineString",coordinates:[[104.384674660599,30.0697964300345],[104.38466585817,30.0697739280967],[104.384648260495,30.0697286661144],[104.384639350866,30.0697059338538],[104.384630392598,30.069683250113],[104.384612492275,30.0696380696941],[104.384603568229,30.0696155001864],[104.384594663993,30.0695929207998],[104.384585796683,30.0695703324478],[104.384576974402,30.0695477360368],[104.384568192648,30.0695251315628],[104.384541942846,30.0694574306184],[104.38452447028,30.06941226309],[104.384515777677,30.0693896919485],[104.384507120197,30.0693671262296],[104.384498489733,30.069344538947],[104.384489867371,30.0693219120985],[104.384481260316,30.0692992708709],[104.384472701897,30.0692766674529],[104.384464208326,30.0692541117502],[104.38443883928,30.0691864321299],[104.384430333986,30.0691638197501],[104.384421787256,30.0691411704608],[104.384413169364,30.0691184203856],[104.384395955198,30.0690731468733],[104.384387754363,30.0690514583353],[104.384379776012,30.0690301539905],[104.384360966463,30.0689795551552],[104.384323707658,30.0688797337057],[104.38430599884,30.0688320486502],[104.384287820697,30.0687832075643],[104.384276959739,30.0687538833407],[104.384266304146,30.0687248308802],[104.384256649328,30.0686982442908],[104.384247756583,30.0686736602234],[104.384221041406,30.0686000473669],[104.384204279199,30.0685536382802],[104.384187541308,30.0685074126646],[104.384178983636,30.0684837038952],[104.384162735748,30.0684384202657],[104.384154999602,30.0684169272052],[104.384139174194,30.068373152076],[104.384131054293,30.0683505552201],[104.384114820775,30.068305056638],[104.384106804455,30.068282640626],[104.384091051063,30.0682386928618],[104.384082703231,30.0682152432448],[104.384073375304,30.0681888736058],[104.384043060172,30.0681027507027],[104.384034468194,30.0680784240285],[104.384018351705,30.0680329803483],[104.384009755212,30.068008570026],[104.384000774056,30.0679828625566],[104.383983122508,30.067932111571],[104.383967399613,30.0678871385411],[104.383959993972,30.0678658417604],[104.383952527963,30.0678441663134],[104.383937558994,30.0678004574534],[104.383921909905,30.0677549934337],[104.383912136868,30.0677264119375],[104.383900740528,30.0676928108531],[104.38387797574,30.0676252903363],[104.383868878294,30.0675984630743],[104.383854350679,30.0675560333784],[104.383847062085,30.0675345406172],[104.383838477186,30.06750893416],[104.383816540171,30.0674431850615],[104.383805101425,30.0674089768625],[104.383795053562,30.0673790110389],[104.383779392623,30.0673324578559],[104.383772625576,30.0673122344622],[104.383765767532,30.0672915073705],[104.383723845358,30.0671636601604],[104.383712589405,30.0671292524333],[104.383703517069,30.0671013756359],[104.383689532452,30.0670582556488],[104.383675022643,30.0670136126552],[104.383666457457,30.0669871005498],[104.383657208523,30.0669583188711],[104.383647960481,30.0669294436611],[104.383622057654,30.0668484304532],[104.38360355704,30.0667907150765],[104.383587461675,30.0667406954397],[104.383566047721,30.0666742721122],[104.38355878691,30.0666516101878],[104.383537314339,30.0665841948404],[104.383522701707,30.0665384428203],[104.383506931474,30.0664889854944],[104.383498466211,30.066462512995],[104.383462775529,30.0663513828489],[104.383447659284,30.0663041770528],[104.383406076939,30.0661740615879],[104.383398617887,30.066150635928],[104.38338358446,30.0661032197298],[104.383376020907,30.0660795619484],[104.38336859069,30.0660565517905],[104.383354477963,30.0660130412206],[104.383347559417,30.0659914946957],[104.383333307907,30.065946679084],[104.383326038916,30.0659238956845],[104.3833187375,30.0659011833007],[104.383304130169,30.0658559824535],[104.383296880096,30.0658334157985],[104.383282423172,30.0657881970861],[104.383275152372,30.0657655638579],[104.383260666625,30.0657206095083],[104.383253445365,30.0656981130143],[104.383216426453,30.065582536959],[104.383209670916,30.0655613331842],[104.383202942395,30.0655400484931],[104.383195925592,30.0655177338273],[104.383188405209,30.0654938970696],[104.383180387561,30.0654687594573],[104.383172118587,30.0654431665659],[104.383156231073,30.0653944958426],[104.383148923314,30.0653720469092],[104.383141875894,30.065350225928],[104.383134757294,30.0653279849008],[104.38312718375,30.0653041579722],[104.38311014664,30.0652504167527],[104.383101335305,30.0652227306482],[104.383093095121,30.0651970028615],[104.383092996925,30.0651966637318],[104.383092905038,30.065196396553],[104.383092653707,30.0651958081764],[104.383085284649,30.0651726909794],[104.383070926719,30.0651282393643],[104.383063881069,30.0651062214147],[104.38305671559,30.0650835675396],[104.383049214082,30.065059771231],[104.383041281966,30.0650347685529],[104.383033115633,30.0650092620465],[104.383017491946,30.0649606040705],[104.382981610455,30.0648481205731],[104.382967546126,30.0648041071348],[104.382942309243,30.0647254375177],[104.382932480773,30.0646946756866],[104.382906742038,30.0646137375114],[104.382899410763,30.0645907578954],[104.382891718241,30.0645667428401],[104.38286371112,30.0644797331038],[104.382854324949,30.0644503907645],[104.382838150691,30.0643994452324],[104.38283048337,30.064375398707],[104.382793792664,30.0642611758656],[104.382782011956,30.0642246008407],[104.38275264637,30.0641371581011],[104.382750023014,30.0641287507218],[104.382747304165,30.0641200374885],[104.382729408218,30.0640626988975],[104.382716720263,30.0640225077733],[104.38270270262,30.0639784375887],[104.382689975041,30.0639387356452],[104.3826713161,30.0638809322816],[104.382663399195,30.063856327909],[104.382654907522,30.0638298281537],[104.382636360236,30.0637717739585],[104.382627110914,30.0637428840243],[104.382617805742,30.0637139787481],[104.382588467743,30.0636234332196],[104.382578885088,30.0635937362802],[104.38256950512,30.0635644828847],[104.38256033144,30.0635356613453],[104.382543454295,30.0634823183279],[104.382536061652,30.0634591209276],[104.382529148288,30.0634376668372],[104.382522316907,30.0634165671504],[104.382515303541,30.0633947883123],[104.38250817665,30.06337241582],[104.382494409324,30.063328855673],[104.382487649991,30.0633077038831],[104.382472671016,30.063261472551],[104.382463965776,30.0632344464439],[104.382454535309,30.0632049150755],[104.382444646285,30.0631738733328],[104.382434609517,30.0631424924095],[104.382415669295,30.0630835006239],[104.382407500949,30.0630578311594],[104.382393168709,30.0630124610221],[104.382386047198,30.0629903070381],[104.382378670754,30.0629677778044],[104.382371166392,30.0629450829774],[104.382363717878,30.0629224601449],[104.382356414389,30.0628999435625],[104.382349246916,30.0628774999472],[104.38234213619,30.0628550806637],[104.382334946188,30.0628325174151],[104.382327546286,30.0628095034147],[104.382312272617,30.062762180857],[104.382297747562,30.0627168428705],[104.382290833229,30.0626953302657],[104.382276905467,30.0626521637674],[104.38226978752,30.0626298802561],[104.382254183147,30.0625806355233],[104.38224527782,30.0625526990569],[104.382226975282,30.0624955657205],[104.382210648387,30.0624445261625],[104.38220312052,30.0624210767428],[104.382188776496,30.0623766166007],[104.382181622497,30.0623543842953],[104.382158400121,30.0622818662659],[104.382150803763,30.0622580480493],[104.382136439857,30.0622128117521],[104.382129287636,30.0621903977732],[104.382114831844,30.0621452558086],[104.382100429181,30.0620999592033],[104.382093199473,30.0620773059255],[104.382086011212,30.0620549791361],[104.382071627495,30.0620106475009],[104.382063718515,30.0619861886584],[104.382054877094,30.0619586748707],[104.382027718559,30.0618736570841],[104.381998550093,30.0617825535291],[104.381990878921,30.0617586911341],[104.381976301442,30.061713459055],[104.381969471699,30.0616920750532],[104.381955573454,30.0616482420319],[104.381948308572,30.0616255320278],[104.381933627469,30.0615800956857],[104.381926342768,30.0615575025688],[104.381919100403,30.0615349301738],[104.381904662506,30.0614897854217],[104.381875812802,30.0613993205533],[104.381868563214,30.0613767076695],[104.381846757693,30.0613089615837],[104.381839554039,30.0612863963991],[104.381825187252,30.0612411176752],[104.381817935844,30.0612184346301],[104.381803453755,30.0611733563353],[104.381796342879,30.061151022351],[104.381782134622,30.0611061088763],[104.381767088516,30.0610586936105],[104.381740159362,30.0609734851107],[104.381730638529,30.0609435658134],[104.381721819513,30.060916063635],[104.381692839923,30.0608263341021],[104.381684651537,30.0608008937381],[104.38167545502,30.060772164523],[104.3816658729,30.0607420454983],[104.381648809575,30.0606882341332],[104.381641606765,30.0606656572087],[104.381627637187,30.0606220047241],[104.381613330653,30.0605771702133],[104.38159834754,30.0605305661022],[104.381590397859,30.0605057122908],[104.381582366179,30.0604803403933],[104.381574526387,30.0604554336213],[104.381567012729,30.0604316701862],[104.381559766656,30.0604090473352],[104.381545353804,30.0603644914786],[104.381537791502,30.0603408709814],[104.381529855309,30.0603159308315],[104.38152171461,30.0602904320105],[104.381513713561,30.0602656123034],[104.381498775453,30.0602195297867],[104.381491359989,30.0601964139328],[104.381483472432,30.0601716356931],[104.381475064137,30.060145134767],[104.381458045727,30.0600913970752],[104.381442734549,30.0600429498724],[104.381435565008,30.0600203270626],[104.381428441415,30.0599979291238],[104.381407312078,30.059931613259],[104.381399783067,30.0599080530113],[104.381391307188,30.0598816338345],[104.381363566873,30.059795349529],[104.381355725231,30.0597708536834],[104.381348621437,30.0597485348836],[104.381341757281,30.059726838637],[104.381327525338,30.0596816785024],[104.381320008005,30.0596579239926],[104.381312406892,30.0596340875633],[104.3813050148,30.0596110984873],[104.381291000015,30.059567793832],[104.381275751848,30.0595205462891],[104.381259638778,30.0594705262192],[104.381252243065,30.0594474687782],[104.38122782339,30.0593708416746],[104.381209102979,30.0593122099279],[104.381201091006,30.0592870160078],[104.381187149092,30.0592429298654],[104.381180138044,30.0592208494316],[104.381165608732,30.0591753615816],[104.381151318167,30.0591308128395],[104.381128121,30.0590588578732],[104.38110932305,30.0590002835439],[104.381100531745,30.0589728108793],[104.381092727857,30.0589483401794],[104.381078570573,30.0589038499848],[104.38107148653,30.0588817388779],[104.381057313943,30.058837727994],[104.38104980465,30.0588142459146],[104.381041392614,30.0587878383875],[104.381032074236,30.0587586681848],[104.381022517117,30.0587289509649],[104.38100565432,30.0586768409195],[104.380998494583,30.0586546038176],[104.380984549881,30.0586110400778],[104.380968984395,30.0585626463379],[104.380960117367,30.0585350098821],[104.380950740396,30.0585055994792],[104.38093274232,30.0584488658085],[104.380924863603,30.058424162068],[104.380903379808,30.0583573265868],[104.380881542822,30.0582892946569],[104.38087404879,30.0582657729768],[104.380859278733,30.058219103038],[104.380852111735,30.0581965637224],[104.380837624587,30.058151338349],[104.380816753342,30.0580860052556],[104.38080918903,30.0580625437448],[104.380790887291,30.0580060246284],[104.380781143592,30.0579758583889],[104.380754862159,30.0578943484882],[104.380746272546,30.0578675162255],[104.380737156769,30.057838860534],[104.380718520671,30.0577800981512],[104.380710035548,30.0577534251584],[104.380701960358,30.0577281599927],[104.380674938256,30.0576441321115],[104.380666130587,30.0576166413129],[104.380651162221,30.0575697480445],[104.380644153739,30.0575478545415],[104.380622426454,30.0574802685847],[104.380607919361,30.0574350808486],[104.380600698243,30.0574125387202],[104.38057902676,30.0573446641049],[104.380571802933,30.0573221606373],[104.380557148965,30.0572766948433],[104.380549599888,30.05725315414],[104.380542024675,30.0572294083648],[104.38049970325,30.0570963516867],[104.380492467682,30.0570736629287],[104.380485351946,30.0570514850982],[104.380470629459,30.0570058717056],[104.380462166788,30.0569794918398],[104.380443474644,30.056920775091],[104.380434688515,30.0568932518681],[104.38042681416,30.0568687854166],[104.380412462842,30.0568244898582],[104.380405281319,30.0568022220118],[104.38039803492,30.0567796357417],[104.380390817344,30.0567570297133],[104.380369306937,30.0566892486294],[104.380362184855,30.0566669430596],[104.380347882138,30.0566224802445],[104.38034007983,30.0565981433421],[104.380312736576,30.0565124240928],[104.380273777196,30.0563905183325],[104.380263733274,30.0563592184843],[104.380245623042,30.0563030490484],[104.380237821606,30.0562787687765],[104.380230667052,30.0562563165539],[104.380223849451,30.056234838623],[104.380217046271,30.0562135279776],[104.380202938991,30.0561698395965],[104.380195779025,30.0561474718958],[104.380188583002,30.0561246275198],[104.380181151816,30.0561008521163],[104.380173327816,30.0560760394093],[104.380165210118,30.0560507389794],[104.380157059997,30.0560256318681],[104.380149025193,30.0560008108517],[104.380141063351,30.0559758972758],[104.380125292802,30.0559261098397],[104.380117747196,30.0559024341306],[104.380110522338,30.0558798621996],[104.380103436228,30.0558577598481],[104.38009617353,30.0558351941713],[104.380088476572,30.0558114445601],[104.380080325531,30.0557864633309],[104.380063824338,30.0557360824851],[104.380056082331,30.0557123885782],[104.380048735838,30.0556897355725],[104.380041605563,30.0556674757816],[104.380027356695,30.0556224786692],[104.380020149823,30.0555998132049],[104.38001293755,30.0555772583495],[104.379991314237,30.0555097178916],[104.379967470928,30.0554356560552],[104.379959501827,30.0554108107707],[104.379951910226,30.0553870612289],[104.379937522571,30.0553418615879],[104.379916106394,30.0552744354949],[104.37988010881,30.0551613544688],[104.379872226169,30.0551366351516],[104.379844123816,30.0550488768527],[104.379834805909,30.0550197053684],[104.379819090141,30.05497022359],[104.379812033679,30.0549481167012],[104.379804873618,30.0549259944183],[104.379790120144,30.0548809427248],[104.379782799705,30.0548584002945],[104.379775586468,30.054835900238],[104.379768424576,30.0548133723526],[104.379754086365,30.0547681411953],[104.379746870409,30.0547454594671],[104.379739622021,30.0547227884963],[104.379725121642,30.0546775958323],[104.379717942621,30.0546550805077],[104.37970364042,30.0546099518842],[104.379696394722,30.0545872548252],[104.379689084161,30.0545645810813],[104.37967456215,30.0545197391039],[104.379667266897,30.0544970491824],[104.379620851804,30.0543517465053],[104.379599417356,30.0542844208864],[104.379592167125,30.0542617444815],[104.379570350665,30.0541938716706],[104.379563125655,30.0541712843164],[104.379555948388,30.054148706002],[104.379541658709,30.0541035287493],[104.379534451706,30.0540809081316],[104.379527171732,30.0540583009279],[104.379512565838,30.0540131665078],[104.379505322795,30.0539905935101],[104.37949808245,30.0539679611586],[104.379490802464,30.0539453089801],[104.379483487343,30.0539226774484],[104.379476201049,30.0539000594339],[104.379469048984,30.0538775152979],[104.379462145571,30.0538553374347],[104.379455487218,30.0538337497705],[104.379448688317,30.0538119155493],[104.379440921771,30.0537874858144],[104.379431402813,30.0537579785529],[104.37940857263,30.0536875055664],[104.379398040047,30.053654879332],[104.379389249068,30.053627497883],[104.379381601438,30.0536035107174],[104.379358426063,30.0535304652952],[104.379350809959,30.0535065842732],[104.379329160878,30.0534390990599],[104.37932198445,30.0534165656552],[104.379307631578,30.0533712677163],[104.379300383068,30.0533485777517],[104.37928580497,30.053303319142],[104.379264013483,30.0532355072835],[104.379256703705,30.0532128855935],[104.379242116588,30.0531679300227],[104.379234909516,30.0531455836233],[104.379227724956,30.0531230789656],[104.379212709795,30.0530756300366],[104.379204282752,30.0530492525426],[104.379195001574,30.0530205260552],[104.379185193316,30.0529903088571],[104.379175602188,30.052960625173],[104.379166923752,30.0529334290325],[104.379152234706,30.0528867268402],[104.379145245635,30.0528646882091],[104.379130816108,30.0528197192554],[104.379123575659,30.0527970670271],[104.379102274141,30.0527298796787],[104.379095001248,30.0527071203913],[104.37908362658403,30.05267173325725]]}},{type:"Feature",properties:{fid:4,id:"47",seg_name:"S4成宜昭高速:S4成宜昭高速入口-长河大桥",z_order:0,width:15.11,level:"41000",type_no:1,func_no:9,pass_no:1,overlap:1,median:1,walkway:2,fork:2,lane_cnt:4,lane_cnt_s:5,lane_cnt_e:4,p_a_id:null,d_road_id:"294",start_o_id:"43",start_o_tp:"inter",end_o_id:"629",end_o_tp:"inter",lnglat_seq:null,max_speed:120,min_speed:0,p_start_ju:null,p_end_jun:null,sd_rid:"0VRCL095M100VRAC095FE00",hd_data_ve:"p1"},geometry:{type:"LineString",coordinates:[[104.37873332236741,30.052736344162177],[104.378754249377,30.0528018768682],[104.37876110339,30.052823281434],[104.378785728071,30.0528998280737],[104.378797582693,30.0529367681234],[104.378829931731,30.0530378462102],[104.378845610221,30.0530866674812],[104.378854608618,30.0531147957408],[104.378863968323,30.0531441897105],[104.378880288338,30.0531955854719],[104.37888752255,30.0532182746264],[104.378895246004,30.053242425675],[104.378912871543,30.0532974973775],[104.378929590653,30.0533496606418],[104.378943998664,30.0533945118632],[104.378958408464,30.0534392875369],[104.378965662474,30.0534619775921],[104.378980014629,30.053507239726],[104.378987195657,30.053529817286],[104.379016162088,30.0536202770455],[104.379023377334,30.053642737721],[104.379037862772,30.053687660922],[104.379045363632,30.05371107786],[104.379053186159,30.0537357020101],[104.379061361881,30.0537615405991],[104.37906996107,30.0537886341685],[104.379079132382,30.0538172967321],[104.379122657061,30.0539523639762],[104.379129938054,30.0539750998842],[104.379146922841,30.0540285088525],[104.379156079715,30.0540572172426],[104.37919431273,30.0541764015157],[104.379208735909,30.0542212031617],[104.379249106024,30.0543473124925],[104.379258397112,30.054376437372],[104.379280880599,30.0544470746992],[104.379296173205,30.0544948899018],[104.379314490438,30.054552049386],[104.379338969539,30.0546280288484],[104.379348828217,30.0546588512888],[104.379372257673,30.0547325049199],[104.379390661364,30.054790255296],[104.379393433719,30.0547989554099],[104.379396207876,30.0548076627199],[104.379438855428,30.0549412789075],[104.379449989852,30.0549756791933],[104.379459359241,30.0550047429357],[104.37946882864,30.0550342267575],[104.379492395819,30.0551078399639],[104.3795089713,30.0551594514743],[104.379518393838,30.0551889379306],[104.37953526755,30.0552419229851],[104.379549032832,30.0552849017828],[104.379556717356,30.0553090436262],[104.379573809999,30.0553630657924],[104.379581950412,30.0553885786493],[104.379589856554,30.0554131038173],[104.379598431221,30.0554396207462],[104.379608339346,30.0554703990835],[104.379676720408,30.0556838642731],[104.37969952786,30.0557548397513],[104.379713737243,30.0557992596248],[104.379721025276,30.0558219405359],[104.379735731968,30.0558674805489],[104.379742992967,30.0558900993745],[104.379749808888,30.0559115180621],[104.379756095937,30.055931384895],[104.379762815452,30.0559525390835],[104.379772069413,30.0559814452299],[104.379802935138,30.0560776950286],[104.379845516249,30.0562109247541],[104.379858971426,30.0562527933392],[104.379865687304,30.056273783825],[104.379879950663,30.0563185544058],[104.379887017914,30.0563406118281],[104.379902864246,30.0563897150918],[104.379912373125,30.0564192509708],[104.379922281141,30.0564502135622],[104.379931480096,30.0564791744616],[104.379946256999,30.0565260769041],[104.379953044942,30.0565475153016],[104.379960296876,30.0565702087077],[104.379982643681,30.0566396906405],[104.379997193471,30.0566850442073],[104.38002409108,30.0567694260296],[104.380032743097,30.0567963934666],[104.380049428139,30.0568480056809],[104.380058598202,30.0568765339404],[104.380067964683,30.0569058618851],[104.380076604082,30.056933023549],[104.380084064113,30.0569565274158],[104.380104687312,30.057021724096],[104.380112695115,30.0570467924116],[104.380121037164,30.0570726578516],[104.380137045518,30.0571220534276],[104.380144917257,30.0571464929769],[104.380171841719,30.0572304619039],[104.380197208377,30.0573093688079],[104.380206228834,30.0573375533341],[104.38021528533,30.0573659312462],[104.380237495908,30.0574357815695],[104.38024477029,30.0574586206167],[104.380253118615,30.0574847531223],[104.380271570324,30.0575423555064],[104.38029595033,30.0576181632039],[104.380324366633,30.0577069421095],[104.380343353453,30.0577660351438],[104.380383074032,30.0578901799686],[104.380396474878,30.0579319556237],[104.380423836932,30.0580170336064],[104.380432137448,30.0580430041369],[104.380451000785,30.0581022984268],[104.380460120263,30.0581308849663],[104.380468282015,30.0581563193575],[104.380482518897,30.0582005761089],[104.380519891375,30.0583173377522],[104.380541561111,30.058385283461],[104.380562386623,30.0584503037501],[104.38057606939,30.0584933089642],[104.380584467158,30.0585195637304],[104.380594798355,30.0585516371636],[104.380618401419,30.0586246082869],[104.380628619081,30.0586563020856],[104.380636951061,30.0586822914741],[104.380667913087,30.0587794019994],[104.380675963961,30.0588045736239],[104.380691825142,30.0588540326036],[104.380699763392,30.0588788866531],[104.380715595743,30.0589285767163],[104.380731696553,30.0589788165142],[104.380739500549,30.0590032495421],[104.380754113898,30.0590491513768],[104.380761690847,30.0590728206583],[104.380787781289,30.0591540650756],[104.380811139132,30.0592265213955],[104.380832602293,30.0592935152101],[104.380846465081,30.0593365780277],[104.38085350324,30.0593585695379],[104.380868408431,30.0594054311685],[104.380876031294,30.0594292398587],[104.380883512697,30.0594523910095],[104.380897691673,30.0594961070122],[104.380904540617,30.0595174346314],[104.380911563448,30.0595394683806],[104.380926490229,30.0595864244305],[104.380933940099,30.0596097814814],[104.380941046705,30.0596319780806],[104.380948054201,30.059653767192],[104.380964515224,30.0597047887146],[104.380974484094,30.059735781584],[104.380984713335,30.0597676857087],[104.381011806307,30.0598523689783],[104.381020333671,30.059879085992],[104.381046221174,30.059960407323],[104.381081623404,30.0600712389531],[104.381096208614,30.0601167296007],[104.38111786973,30.0601840696311],[104.381153917812,30.0602965430451],[104.381163207322,30.0603257779341],[104.381178835806,30.060375449563],[104.381185744145,30.0603971368992],[104.381192593001,30.060418239621],[104.381199567978,30.0604395538011],[104.381206737558,30.0604615714312],[104.381214054899,30.0604842888692],[104.381236912362,30.0605556750802],[104.381245682002,30.0605831683692],[104.381254990407,30.0606126406664],[104.381272269355,30.0606679237573],[104.381279530839,30.0606908884376],[104.381286493192,30.0607124346084],[104.381302586389,30.0607616263778],[104.381312050597,30.0607907912386],[104.381321616614,30.0608204490188],[104.381330458291,30.0608479936117],[104.38134537671,30.0608947093201],[104.381359159949,30.0609377268506],[104.381366668251,30.0609612241391],[104.381375019829,30.060987647704],[104.381384115581,30.0610167186624],[104.381401949418,30.0610739060562],[104.381429822228,30.0611627741952],[104.381437620617,30.0611874291609],[104.38144709651,30.0612171389745],[104.381469604204,30.0612873402697],[104.381489236148,30.0613486787587],[104.381497049826,30.0613731916307],[104.38150449413,30.0613966537494],[104.381520587271,30.0614476017631],[104.381529236093,30.0614747701985],[104.381537771384,30.0615013359817],[104.381545836389,30.0615263248163],[104.381553369855,30.0615497573291],[104.381560603319,30.0615723729773],[104.381567814255,30.0615948492083],[104.381575079233,30.0616172454492],[104.381597238987,30.0616847951305],[104.381605812977,30.0617110839404],[104.381615238333,30.0617401227607],[104.381624762793,30.0617696419063],[104.381633470131,30.0617968049695],[104.381641082858,30.0618206224415],[104.381648233409,30.0618428917527],[104.38165591369,30.0618667110828],[104.381664653446,30.06189389665],[104.381674091416,30.0619234849455],[104.381691694375,30.0619790747563],[104.381699146731,30.0620025710062],[104.381706150426,30.0620245766654],[104.381720307356,30.0620689226648],[104.381742158045,30.06213709697],[104.381749184248,30.0621591116329],[104.381781206204,30.0622596231751],[104.381803073087,30.0623284818294],[104.381812545244,30.0623582490754],[104.381820477736,30.0623829948936],[104.381827539943,30.0624048926598],[104.381834459808,30.0624264242694],[104.381841531935,30.0624486377017],[104.381855918537,30.0624940603308],[104.381863197861,30.0625168234336],[104.381877723151,30.0625618432871],[104.381877822252,30.0625621833212],[104.381877914144,30.0625624487053],[104.381878164587,30.0625630370919],[104.381884848413,30.0625840972274],[104.381891598904,30.06260534628],[104.381905759355,30.0626501490442],[104.381913860298,30.0626756495203],[104.381922341414,30.0627022286287],[104.381938207232,30.0627517993429],[104.381960892868,30.06282252562],[104.381969027117,30.0628479379783],[104.382021663197,30.0630125366238],[104.382029857783,30.0630380245635],[104.382045212704,30.06308560006],[104.382052440617,30.0631080752857],[104.382078417132,30.0631890738158],[104.382087734224,30.0632181879234],[104.382103654903,30.0632681578934],[104.382110729651,30.0632902372634],[104.38212508993,30.0633346372097],[104.382132425025,30.063357410188],[104.38213972229,30.0633802748599],[104.382153694311,30.0634244208264],[104.382160317705,30.0634452946833],[104.382167131179,30.0634666120771],[104.382182917554,30.0635157068437],[104.382191921093,30.0635437810182],[104.382210915546,30.063603124641],[104.382220268617,30.0636321883768],[104.382237319795,30.0636848653567],[104.382245265662,30.0637095319296],[104.38225314487,30.0637342128282],[104.382268461857,30.0637824905367],[104.382275744666,30.0638052688262],[104.382282903141,30.063827443558],[104.382290083231,30.063849612912],[104.382297456116,30.0638725171829],[104.382305312787,30.0638971557785],[104.382313984767,30.0639244561981],[104.382323505378,30.0639543303383],[104.382333373722,30.0639851256942],[104.382351198703,30.0640405741103],[104.38235866617,30.0640639128221],[104.382372446166,30.0641071358067],[104.382379447868,30.0641290342806],[104.382404883511,30.0642082594658],[104.382414370748,30.0642378871322],[104.382445327904,30.0643348113826],[104.382454029554,30.0643619669966],[104.382463487039,30.0643913985685],[104.382481391202,30.0644470043558],[104.382489282044,30.0644716312407],[104.382496902624,30.0644955483165],[104.382526725487,30.0645893490178],[104.382542764802,30.0646396273165],[104.382558561763,30.0646889889821],[104.382584017966,30.0647687455225],[104.3825934673,30.0647982633783],[104.382617368528,30.064872699019],[104.38262433683,30.0648945074709],[104.38263859505,30.0649392910748],[104.382645859734,30.0649620018046],[104.38266038368,30.0650071858338],[104.382667493417,30.0650296356161],[104.382674456331,30.0650520933578],[104.382688251559,30.0650973234794],[104.382695307258,30.0651200888663],[104.382702530495,30.0651428750868],[104.382709882534,30.0651656110599],[104.382724607307,30.0652107565668],[104.382731833221,30.0652331785588],[104.382738986175,30.0652556634355],[104.38275335335,30.0653011134739],[104.382760536929,30.0653237026936],[104.38276759708,30.0653458034711],[104.382782190329,30.0653913211472],[104.382799987963,30.065446642454],[104.382809457933,30.0654761665518],[104.382818228828,30.0655036467701],[104.382825997056,30.0655281196683],[104.382854322298,30.0656176262409],[104.382861413958,30.0656399185779],[104.382868448846,30.0656617144392],[104.382875590015,30.0656834213615],[104.382882942875,30.0657055187752],[104.382890365102,30.0657279148224],[104.38289764681,30.0657502486891],[104.382905003307,30.0657732346258],[104.382923707163,30.0658321422437],[104.382936567961,30.0658724575399],[104.38297739526,30.066000097216],[104.382994546861,30.0660539672257],[104.38300140605,30.0660753573052],[104.383015579337,30.0661190920401],[104.383022843006,30.0661417091435],[104.383030011195,30.066164311771],[104.38303712894,30.0661869044593],[104.383044299831,30.0662095988159],[104.383051535574,30.0662323211072],[104.383058710951,30.0662547016024],[104.383080391108,30.0663221804579],[104.38311148796,30.0664192408028],[104.383122586567,30.0664538249006],[104.383148771857,30.0665351041252],[104.383155740912,30.066556906152],[104.383162481154,30.0665781719814],[104.383176736379,30.0666232754692],[104.383184318916,30.0666471158848],[104.383205655748,30.066713767868],[104.383227519584,30.066782510314],[104.383235073274,30.0668061690285],[104.38324247381,30.0668292277611],[104.383286473358,30.0669654609689],[104.38331069732,30.0670406922053],[104.383318352769,30.0670644031474],[104.383325601927,30.067086778244],[104.383332647487,30.0671084328063],[104.383339942572,30.0671306955249],[104.383348043907,30.0671552081426],[104.383367040989,30.0672124771687],[104.383385409276,30.067268080994],[104.383393247544,30.0672916904533],[104.38343812313,30.0674258755477],[104.383460698282,30.0674936183947],[104.383467931151,30.0675152443089],[104.383475206351,30.0675368594665],[104.383483334639,30.0675608477668],[104.383504551223,30.0676232771237],[104.383534543771,30.0677117736374],[104.383542090989,30.0677338647537],[104.383559425792,30.0677843963138],[104.383585629327,30.0678611596758],[104.383593060316,30.0678827659451],[104.383608318647,30.0679269995478],[104.383638257856,30.0680139526757],[104.383656940223,30.0680681023998],[104.383664481983,30.0680898337515],[104.383671751682,30.0681106079915],[104.383697875711,30.0681846795226],[104.383728261536,30.0682710564784],[104.383736692371,30.0682948848884],[104.383744504328,30.0683168008122],[104.383772401046,30.068394637449],[104.383782901947,30.068424026313],[104.383792701108,30.0684515502827],[104.38381012934,30.0685006311691],[104.383818870019,30.0685250875448],[104.38382843494,30.0685516993924],[104.383852897618,30.0686195820437],[104.383868340367,30.0686623929429],[104.383884375842,30.0687067700544],[104.38389874749,30.0687464396],[104.383909930234,30.0687772148498],[104.383918331245,30.0688002077134],[104.383926289043,30.0688218089502],[104.38393692315,30.068850485611],[104.383952263095,30.0688917522474],[104.383991997005,30.0689984983693],[104.384022048042,30.0690791370733],[104.384045554657,30.0691420176342],[104.384054036667,30.0691646534968],[104.384063246522,30.0691891128941],[104.384082988593,30.0692412694495],[104.384093766739,30.0692698427515],[104.384105077259,30.0692999156646],[104.38411628508,30.0693296530404],[104.384126665949,30.0693570164096],[104.384152935159,30.069425733101],[104.384161487373,30.0694480623232],[104.384170208027,30.0694706947557],[104.384178957499,30.069493319116],[104.384187636711,30.0695158489857],[104.384196246566,30.0695383931829],[104.384213486095,30.0695837226033],[104.384222210338,30.0696064665379],[104.384231002131,30.0696292267145],[104.384248428957,30.0696740949218],[104.38426554769,30.069717987098],[104.384286432629,30.0697713729422],[104.384298956375,30.06980334526],[104.384311517043,30.0698353176032],[104.384322850818,30.0698640360748],[104.38432663547826,30.069873601290368]]}}],Mv={type:wv,name:Tv,crs:Sv,features:Ev};function Av(){return globalConfig.defaultViews[0],window.smap=new ev.Map({container:"small-map",testMode:!0,accessToken:globalConfig.accessToken,style:{version:8,glyphs:"/shudao-navigation3d-app/glyphs/mapbox/{fontstack}/{range}.pbf",sprite:`${document.location.origin}/shudao-navigation3d-app/sprites/mapbox-gl-default/sprite`,sources:{roadPolygon:{type:"geojson",data:hv},TraMarkA:{type:"geojson",data:_v},dashline:{type:"geojson",data:sv},roadBorder:{type:"geojson",data:Mv},grassLand:{type:"geojson",data:bv}},light:{anchor:"viewport",color:"#ffffff",intensity:.5},layers:[{id:"background",type:"background",paint:{"background-color":"#2a2a2a"}},{id:"grassLand",source:"grassLand",type:"fill",paint:{"fill-color":"#2a2a2a"}},{id:"roadPolygon",source:"roadPolygon",type:"fill",paint:{"fill-color":"#3d3d3d"}},{id:"TraMarkA",source:"TraMarkA",type:"fill",paint:{"fill-color":"#fff"}},{id:"dashline",source:"dashline",type:"line",paint:{"line-color":"#232323","line-dasharray":[20,40],"line-width":1}},{id:"bottom",type:"background",layout:{visibility:"none"}}]},center:[104.37983080104271,30.05464636410663],zoom:15.05486173207568,bearing:20.228427851002948,pitch:65.05464635086483}),tv(window.smap,"smallcar",O_("newui/smallcar.png")),window.smap}const Iv={class:"eagleMap"},Pv=Da({__name:"smap",setup(R){const B=new URLSearchParams(location.search);let U=sessionStorage.getItem("token"),W=sessionStorage.getItem("tenantCode");B.get("vehicleId"),(!U||!W)&&(U=B.get("token"),W=B.get("tenantId")),new h5({baseURL:"/api",timeout:6e4,interceptors:{requestInterceptors:Me=>(Me.headers["Tenant-Id"]=W,Me.headers.Authorization=U,Me),requestInterceptorsCatch:Me=>(console.error("网络错误,请稍后重试"),Promise.reject(Me)),responseInterceptors:Me=>Me,responseInterceptorsCatch:Me=>(Me.response.data.code==="B-00-999"&&d5().logout(),Promise.reject(Me))}});const _e=async()=>{Av().on("load",()=>{})};return zd(()=>{_e()}),(Me,De)=>(Mo(),Yl("div",Iv,[dh(Jx)]))}});const Cv=b6(Pv,[["__scopeId","data-v-7b4ed2a8"]]),qv=Object.freeze(Object.defineProperty({__proto__:null,default:Cv},Symbol.toStringTag,{value:"Module"}));export{U6 as A,My as B,qd as C,ev as D,Jf as E,hv as F,bv as G,tv as H,Gv as I,qv as J,Cv as S,_v as T,jd as _,B6 as a,Vd as b,Ov as c,lh as d,Ud as e,Lv as f,La as g,Cy as h,zg as i,Qf as j,tc as k,$d as l,Zd as m,mh as n,Bv as o,nc as p,Fv as q,q6 as r,Dy as s,Iy as t,kv as u,Qr as v,z6 as w,Nv as x,Vv as y,Uv as z};